File manager - Edit - /home/gzbnyc5/avenuesny.com/wp-includes/js/imgareaselect/dist.tar
Back
html-entities.min.js 0000644 00000001514 15206720414 0010454 0 ustar 00 "use strict";var wp;(wp||={}).htmlEntities=(()=>{var r=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var u=(e,t)=>{for(var i in t)r(e,i,{get:t[i],enumerable:!0})},f=(e,t,i,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of d(t))!m.call(e,o)&&o!==i&&r(e,o,{get:()=>t[o],enumerable:!(c=a(t,o))||c.enumerable});return e};var x=e=>f(r({},"__esModule",{value:!0}),e);var T={};u(T,{decodeEntities:()=>p});var n;function p(e){if(typeof e!="string"||e.indexOf("&")===-1)return e;n===void 0&&(document.implementation&&document.implementation.createHTMLDocument?n=document.implementation.createHTMLDocument("").createElement("textarea"):n=document.createElement("textarea")),n.innerHTML=e;let t=n.textContent??"";return n.innerHTML="",t}return x(T);})(); block-editor.min.js 0000644 00004016261 15206720414 0010255 0 ustar 00 "use strict";var wp;(wp||={}).blockEditor=(()=>{var Gme=Object.create;var l0=Object.defineProperty;var Wme=Object.getOwnPropertyDescriptor;var $me=Object.getOwnPropertyNames;var Kme=Object.getPrototypeOf,Yme=Object.prototype.hasOwnProperty;var oe=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ip=(e,t)=>{for(var o in t)l0(e,o,{get:t[o],enumerable:!0})},l6=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of $me(t))!Yme.call(e,n)&&n!==o&&l0(e,n,{get:()=>t[n],enumerable:!(r=Wme(t,n))||r.enumerable});return e};var l=(e,t,o)=>(o=e!=null?Gme(Kme(e)):{},l6(t||!e||!e.__esModule?l0(o,"default",{value:e,enumerable:!0}):o,e)),qme=e=>l6(l0({},"__esModule",{value:!0}),e);var $=oe((hLe,u6)=>{u6.exports=window.wp.blocks});var R=oe((gLe,d6)=>{d6.exports=window.wp.element});var F=oe((bLe,f6)=>{f6.exports=window.wp.data});var Z=oe((kLe,m6)=>{m6.exports=window.wp.compose});var ut=oe((vLe,p6)=>{p6.exports=window.wp.hooks});var A=oe((wLe,C6)=>{C6.exports=window.wp.components});var CO=oe((CLe,B6)=>{B6.exports=window.wp.privateApis});var Re=oe((OLe,R6)=>{R6.exports=window.wp.deprecated});var w=oe((ALe,O6)=>{O6.exports=window.ReactJSXRuntime});var dn=oe((NLe,L6)=>{L6.exports=window.wp.url});var N=oe(($Le,j6)=>{j6.exports=window.wp.i18n});var yf=oe((KLe,U6)=>{"use strict";U6.exports=function e(t,o){if(t===o)return!0;if(t&&o&&typeof t=="object"&&typeof o=="object"){if(t.constructor!==o.constructor)return!1;var r,n,i;if(Array.isArray(t)){if(r=t.length,r!=o.length)return!1;for(n=r;n--!==0;)if(!e(t[n],o[n]))return!1;return!0}if(t instanceof Map&&o instanceof Map){if(t.size!==o.size)return!1;for(n of t.entries())if(!o.has(n[0]))return!1;for(n of t.entries())if(!e(n[1],o.get(n[0])))return!1;return!0}if(t instanceof Set&&o instanceof Set){if(t.size!==o.size)return!1;for(n of t.entries())if(!o.has(n[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(o)){if(r=t.length,r!=o.length)return!1;for(n=r;n--!==0;)if(t[n]!==o[n])return!1;return!0}if(t.constructor===RegExp)return t.source===o.source&&t.flags===o.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===o.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===o.toString();if(i=Object.keys(t),r=i.length,r!==Object.keys(o).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(o,i[n]))return!1;for(n=r;n--!==0;){var s=i[n];if(!e(t[s],o[s]))return!1}return!0}return t!==t&&o!==o}});var q=oe((rNe,J6)=>{J6.exports=window.wp.primitives});var dr=oe((wVe,ej)=>{ej.exports=window.wp.richText});var oj=oe((CVe,tj)=>{tj.exports=window.wp.blockSerializationDefaultParser});var Xo=oe((t3e,Vj)=>{Vj.exports=window.wp.a11y});var Un=oe((o3e,Gj)=>{Gj.exports=window.wp.notices});var Zp=oe((r3e,Wj)=>{Wj.exports=window.wp.preferences});var TU=oe((oFe,Kw)=>{var CU={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u1EA4:"A",\u1EAE:"A",\u1EB2:"A",\u1EB4:"A",\u1EB6:"A",\u00C6:"AE",\u1EA6:"A",\u1EB0:"A",\u0202:"A",\u1EA2:"A",\u1EA0:"A",\u1EA8:"A",\u1EAA:"A",\u1EAC:"A",\u00C7:"C",\u1E08:"C",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u1EBE:"E",\u1E16:"E",\u1EC0:"E",\u1E14:"E",\u1E1C:"E",\u0206:"E",\u1EBA:"E",\u1EBC:"E",\u1EB8:"E",\u1EC2:"E",\u1EC4:"E",\u1EC6:"E",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u1E2E:"I",\u020A:"I",\u1EC8:"I",\u1ECA:"I",\u00D0:"D",\u00D1:"N",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u1ED0:"O",\u1E4C:"O",\u1E52:"O",\u020E:"O",\u1ECE:"O",\u1ECC:"O",\u1ED4:"O",\u1ED6:"O",\u1ED8:"O",\u1EDC:"O",\u1EDE:"O",\u1EE0:"O",\u1EDA:"O",\u1EE2:"O",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u1EE6:"U",\u1EE4:"U",\u1EEC:"U",\u1EEE:"U",\u1EF0:"U",\u00DD:"Y",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u1EA5:"a",\u1EAF:"a",\u1EB3:"a",\u1EB5:"a",\u1EB7:"a",\u00E6:"ae",\u1EA7:"a",\u1EB1:"a",\u0203:"a",\u1EA3:"a",\u1EA1:"a",\u1EA9:"a",\u1EAB:"a",\u1EAD:"a",\u00E7:"c",\u1E09:"c",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u1EBF:"e",\u1E17:"e",\u1EC1:"e",\u1E15:"e",\u1E1D:"e",\u0207:"e",\u1EBB:"e",\u1EBD:"e",\u1EB9:"e",\u1EC3:"e",\u1EC5:"e",\u1EC7:"e",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u1E2F:"i",\u020B:"i",\u1EC9:"i",\u1ECB:"i",\u00F0:"d",\u00F1:"n",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u1ED1:"o",\u1E4D:"o",\u1E53:"o",\u020F:"o",\u1ECF:"o",\u1ECD:"o",\u1ED5:"o",\u1ED7:"o",\u1ED9:"o",\u1EDD:"o",\u1EDF:"o",\u1EE1:"o",\u1EDB:"o",\u1EE3:"o",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u1EE7:"u",\u1EE5:"u",\u1EED:"u",\u1EEF:"u",\u1EF1:"u",\u00FD:"y",\u00FF:"y",\u0100:"A",\u0101:"a",\u0102:"A",\u0103:"a",\u0104:"A",\u0105:"a",\u0106:"C",\u0107:"c",\u0108:"C",\u0109:"c",\u010A:"C",\u010B:"c",\u010C:"C",\u010D:"c",C\u0306:"C",c\u0306:"c",\u010E:"D",\u010F:"d",\u0110:"D",\u0111:"d",\u0112:"E",\u0113:"e",\u0114:"E",\u0115:"e",\u0116:"E",\u0117:"e",\u0118:"E",\u0119:"e",\u011A:"E",\u011B:"e",\u011C:"G",\u01F4:"G",\u011D:"g",\u01F5:"g",\u011E:"G",\u011F:"g",\u0120:"G",\u0121:"g",\u0122:"G",\u0123:"g",\u0124:"H",\u0125:"h",\u0126:"H",\u0127:"h",\u1E2A:"H",\u1E2B:"h",\u0128:"I",\u0129:"i",\u012A:"I",\u012B:"i",\u012C:"I",\u012D:"i",\u012E:"I",\u012F:"i",\u0130:"I",\u0131:"i",\u0132:"IJ",\u0133:"ij",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u1E30:"K",\u1E31:"k",K\u0306:"K",k\u0306:"k",\u0139:"L",\u013A:"l",\u013B:"L",\u013C:"l",\u013D:"L",\u013E:"l",\u013F:"L",\u0140:"l",\u0141:"l",\u0142:"l",\u1E3E:"M",\u1E3F:"m",M\u0306:"M",m\u0306:"m",\u0143:"N",\u0144:"n",\u0145:"N",\u0146:"n",\u0147:"N",\u0148:"n",\u0149:"n",N\u0306:"N",n\u0306:"n",\u014C:"O",\u014D:"o",\u014E:"O",\u014F:"o",\u0150:"O",\u0151:"o",\u0152:"OE",\u0153:"oe",P\u0306:"P",p\u0306:"p",\u0154:"R",\u0155:"r",\u0156:"R",\u0157:"r",\u0158:"R",\u0159:"r",R\u0306:"R",r\u0306:"r",\u0212:"R",\u0213:"r",\u015A:"S",\u015B:"s",\u015C:"S",\u015D:"s",\u015E:"S",\u0218:"S",\u0219:"s",\u015F:"s",\u0160:"S",\u0161:"s",\u0162:"T",\u0163:"t",\u021B:"t",\u021A:"T",\u0164:"T",\u0165:"t",\u0166:"T",\u0167:"t",T\u0306:"T",t\u0306:"t",\u0168:"U",\u0169:"u",\u016A:"U",\u016B:"u",\u016C:"U",\u016D:"u",\u016E:"U",\u016F:"u",\u0170:"U",\u0171:"u",\u0172:"U",\u0173:"u",\u0216:"U",\u0217:"u",V\u0306:"V",v\u0306:"v",\u0174:"W",\u0175:"w",\u1E82:"W",\u1E83:"w",X\u0306:"X",x\u0306:"x",\u0176:"Y",\u0177:"y",\u0178:"Y",Y\u0306:"Y",y\u0306:"y",\u0179:"Z",\u017A:"z",\u017B:"Z",\u017C:"z",\u017D:"Z",\u017E:"z",\u017F:"s",\u0192:"f",\u01A0:"O",\u01A1:"o",\u01AF:"U",\u01B0:"u",\u01CD:"A",\u01CE:"a",\u01CF:"I",\u01D0:"i",\u01D1:"O",\u01D2:"o",\u01D3:"U",\u01D4:"u",\u01D5:"U",\u01D6:"u",\u01D7:"U",\u01D8:"u",\u01D9:"U",\u01DA:"u",\u01DB:"U",\u01DC:"u",\u1EE8:"U",\u1EE9:"u",\u1E78:"U",\u1E79:"u",\u01FA:"A",\u01FB:"a",\u01FC:"AE",\u01FD:"ae",\u01FE:"O",\u01FF:"o",\u00DE:"TH",\u00FE:"th",\u1E54:"P",\u1E55:"p",\u1E64:"S",\u1E65:"s",X\u0301:"X",x\u0301:"x",\u0403:"\u0413",\u0453:"\u0433",\u040C:"\u041A",\u045C:"\u043A",A\u030B:"A",a\u030B:"a",E\u030B:"E",e\u030B:"e",I\u030B:"I",i\u030B:"i",\u01F8:"N",\u01F9:"n",\u1ED2:"O",\u1ED3:"o",\u1E50:"O",\u1E51:"o",\u1EEA:"U",\u1EEB:"u",\u1E80:"W",\u1E81:"w",\u1EF2:"Y",\u1EF3:"y",\u0200:"A",\u0201:"a",\u0204:"E",\u0205:"e",\u0208:"I",\u0209:"i",\u020C:"O",\u020D:"o",\u0210:"R",\u0211:"r",\u0214:"U",\u0215:"u",B\u030C:"B",b\u030C:"b",\u010C\u0323:"C",\u010D\u0323:"c",\u00CA\u030C:"E",\u00EA\u030C:"e",F\u030C:"F",f\u030C:"f",\u01E6:"G",\u01E7:"g",\u021E:"H",\u021F:"h",J\u030C:"J",\u01F0:"j",\u01E8:"K",\u01E9:"k",M\u030C:"M",m\u030C:"m",P\u030C:"P",p\u030C:"p",Q\u030C:"Q",q\u030C:"q",\u0158\u0329:"R",\u0159\u0329:"r",\u1E66:"S",\u1E67:"s",V\u030C:"V",v\u030C:"v",W\u030C:"W",w\u030C:"w",X\u030C:"X",x\u030C:"x",Y\u030C:"Y",y\u030C:"y",A\u0327:"A",a\u0327:"a",B\u0327:"B",b\u0327:"b",\u1E10:"D",\u1E11:"d",\u0228:"E",\u0229:"e",\u0190\u0327:"E",\u025B\u0327:"e",\u1E28:"H",\u1E29:"h",I\u0327:"I",i\u0327:"i",\u0197\u0327:"I",\u0268\u0327:"i",M\u0327:"M",m\u0327:"m",O\u0327:"O",o\u0327:"o",Q\u0327:"Q",q\u0327:"q",U\u0327:"U",u\u0327:"u",X\u0327:"X",x\u0327:"x",Z\u0327:"Z",z\u0327:"z",\u0439:"\u0438",\u0419:"\u0418",\u0451:"\u0435",\u0401:"\u0415"},BU=Object.keys(CU).join("|"),ave=new RegExp(BU,"g"),lve=new RegExp(BU,"");function cve(e){return CU[e]}var EU=function(e){return e.replace(ave,cve)},uve=function(e){return!!e.match(lve)};Kw.exports=EU;Kw.exports.has=uve;Kw.exports.remove=EU});var zU=oe((wFe,FU)=>{FU.exports=window.wp.apiFetch});var SM=oe((CFe,jU)=>{jU.exports=window.wp.htmlEntities});var Uv=oe((XFe,aH)=>{aH.exports=window.wp.styleEngine});var it=oe((Z4e,PH)=>{PH.exports=window.wp.keycodes});var Fe=oe((hze,GH)=>{GH.exports=window.wp.dom});var $H=oe(NM=>{"use strict";Object.defineProperty(NM,"__esModule",{value:!0});NM.default=WH;function WH(){}WH.prototype={diff:function(t,o){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=r.callback;typeof r=="function"&&(n=r,r={}),this.options=r;var i=this;function s(g){return n?(setTimeout(function(){n(void 0,g)},0),!0):g}t=this.castInput(t),o=this.castInput(o),t=this.removeEmpty(this.tokenize(t)),o=this.removeEmpty(this.tokenize(o));var a=o.length,c=t.length,u=1,d=a+c,f=[{newPos:-1,components:[]}],m=this.extractCommon(f[0],o,t,0);if(f[0].newPos+1>=a&&m+1>=c)return s([{value:this.join(o),count:o.length}]);function h(){for(var g=-1*u;g<=u;g+=2){var b=void 0,v=f[g-1],k=f[g+1],y=(k?k.newPos:0)-g;v&&(f[g-1]=void 0);var S=v&&v.newPos+1<a,x=k&&0<=y&&y<c;if(!S&&!x){f[g]=void 0;continue}if(!S||x&&v.newPos<k.newPos?(b=rye(k),i.pushComponent(b.components,void 0,!0)):(b=v,b.newPos++,i.pushComponent(b.components,!0,void 0)),y=i.extractCommon(b,o,t,g),b.newPos+1>=a&&y+1>=c)return s(oye(i,b.components,o,t,i.useLongestToken));f[g]=b}u++}if(n)(function g(){setTimeout(function(){if(u>d)return n();h()||g()},0)})();else for(;u<=d;){var p=h();if(p)return p}},pushComponent:function(t,o,r){var n=t[t.length-1];n&&n.added===o&&n.removed===r?t[t.length-1]={count:n.count+1,added:o,removed:r}:t.push({count:1,added:o,removed:r})},extractCommon:function(t,o,r,n){for(var i=o.length,s=r.length,a=t.newPos,c=a-n,u=0;a+1<i&&c+1<s&&this.equals(o[a+1],r[c+1]);)a++,c++,u++;return u&&t.components.push({count:u}),t.newPos=a,c},equals:function(t,o){return this.options.comparator?this.options.comparator(t,o):t===o||this.options.ignoreCase&&t.toLowerCase()===o.toLowerCase()},removeEmpty:function(t){for(var o=[],r=0;r<t.length;r++)t[r]&&o.push(t[r]);return o},castInput:function(t){return t},tokenize:function(t){return t.split("")},join:function(t){return t.join("")}};function oye(e,t,o,r,n){for(var i=0,s=t.length,a=0,c=0;i<s;i++){var u=t[i];if(u.removed){if(u.value=e.join(r.slice(c,c+u.count)),c+=u.count,i&&t[i-1].added){var f=t[i-1];t[i-1]=t[i],t[i]=f}}else{if(!u.added&&n){var d=o.slice(a,a+u.count);d=d.map(function(h,p){var g=r[c+p];return g.length>h.length?g:h}),u.value=e.join(d)}else u.value=e.join(o.slice(a,a+u.count));a+=u.count,u.added||(c+=u.count)}}var m=t[s-1];return s>1&&typeof m.value=="string"&&(m.added||m.removed)&&e.equals("",m.value)&&(t[s-2].value+=m.value,t.pop()),t}function rye(e){return{newPos:e.newPos,components:e.components.slice(0)}}});var YH=oe(Zv=>{"use strict";Object.defineProperty(Zv,"__esModule",{value:!0});Zv.diffChars=sye;Zv.characterDiff=void 0;var nye=iye($H());function iye(e){return e&&e.__esModule?e:{default:e}}var KH=new nye.default;Zv.characterDiff=KH;function sye(e,t,o){return KH.diff(e,t,o)}});var jr=oe((Pze,l8)=>{l8.exports=window.React});var u8=oe((Rze,c8)=>{"use strict";var uye="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";c8.exports=uye});var p8=oe((Oze,m8)=>{"use strict";var dye=u8();function d8(){}function f8(){}f8.resetWarningCache=d8;m8.exports=function(){function e(r,n,i,s,a,c){if(c!==dye){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var o={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:f8,resetWarningCache:d8};return o.PropTypes=o,o}});var g8=oe((Nze,h8)=>{h8.exports=p8()();var Aze,Lze});var k8=oe((_C,b8)=>{(function(e,t){if(typeof define=="function"&&define.amd)define(["module","exports"],t);else if(typeof _C<"u")t(b8,_C);else{var o={exports:{}};t(o,o.exports),e.autosize=o.exports}})(_C,function(e,t){"use strict";var o=typeof Map=="function"?new Map:(function(){var c=[],u=[];return{has:function(f){return c.indexOf(f)>-1},get:function(f){return u[c.indexOf(f)]},set:function(f,m){c.indexOf(f)===-1&&(c.push(f),u.push(m))},delete:function(f){var m=c.indexOf(f);m>-1&&(c.splice(m,1),u.splice(m,1))}}})(),r=function(u){return new Event(u,{bubbles:!0})};try{new Event("test")}catch{r=function(d){var f=document.createEvent("Event");return f.initEvent(d,!0,!1),f}}function n(c){if(!c||!c.nodeName||c.nodeName!=="TEXTAREA"||o.has(c))return;var u=null,d=null,f=null;function m(){var y=window.getComputedStyle(c,null);y.resize==="vertical"?c.style.resize="none":y.resize==="both"&&(c.style.resize="horizontal"),y.boxSizing==="content-box"?u=-(parseFloat(y.paddingTop)+parseFloat(y.paddingBottom)):u=parseFloat(y.borderTopWidth)+parseFloat(y.borderBottomWidth),isNaN(u)&&(u=0),b()}function h(y){{var S=c.style.width;c.style.width="0px",c.offsetWidth,c.style.width=S}c.style.overflowY=y}function p(y){for(var S=[];y&&y.parentNode&&y.parentNode instanceof Element;)y.parentNode.scrollTop&&S.push({node:y.parentNode,scrollTop:y.parentNode.scrollTop}),y=y.parentNode;return S}function g(){if(c.scrollHeight!==0){var y=p(c),S=document.documentElement&&document.documentElement.scrollTop;c.style.height="",c.style.height=c.scrollHeight+u+"px",d=c.clientWidth,y.forEach(function(x){x.node.scrollTop=x.scrollTop}),S&&(document.documentElement.scrollTop=S)}}function b(){g();var y=Math.round(parseFloat(c.style.height)),S=window.getComputedStyle(c,null),x=S.boxSizing==="content-box"?Math.round(parseFloat(S.height)):c.offsetHeight;if(x<y?S.overflowY==="hidden"&&(h("scroll"),g(),x=S.boxSizing==="content-box"?Math.round(parseFloat(window.getComputedStyle(c,null).height)):c.offsetHeight):S.overflowY!=="hidden"&&(h("hidden"),g(),x=S.boxSizing==="content-box"?Math.round(parseFloat(window.getComputedStyle(c,null).height)):c.offsetHeight),f!==x){f=x;var C=r("autosize:resized");try{c.dispatchEvent(C)}catch{}}}var v=function(){c.clientWidth!==d&&b()},k=function(y){window.removeEventListener("resize",v,!1),c.removeEventListener("input",b,!1),c.removeEventListener("keyup",b,!1),c.removeEventListener("autosize:destroy",k,!1),c.removeEventListener("autosize:update",b,!1),Object.keys(y).forEach(function(S){c.style[S]=y[S]}),o.delete(c)}.bind(c,{height:c.style.height,resize:c.style.resize,overflowY:c.style.overflowY,overflowX:c.style.overflowX,wordWrap:c.style.wordWrap});c.addEventListener("autosize:destroy",k,!1),"onpropertychange"in c&&"oninput"in c&&c.addEventListener("keyup",b,!1),window.addEventListener("resize",v,!1),c.addEventListener("input",b,!1),c.addEventListener("autosize:update",b,!1),c.style.overflowX="hidden",c.style.wordWrap="break-word",o.set(c,{destroy:k,update:b}),m()}function i(c){var u=o.get(c);u&&u.destroy()}function s(c){var u=o.get(c);u&&u.update()}var a=null;typeof window>"u"||typeof window.getComputedStyle!="function"?(a=function(u){return u},a.destroy=function(c){return c},a.update=function(c){return c}):(a=function(u,d){return u&&Array.prototype.forEach.call(u.length?u:[u],function(f){return n(f,d)}),u},a.destroy=function(c){return c&&Array.prototype.forEach.call(c.length?c:[c],i),c},a.update=function(c){return c&&Array.prototype.forEach.call(c.length?c:[c],s),c}),t.default=a,e.exports=t.default})});var y8=oe((Mze,v8)=>{var fye=function(e,t,o){return o=window.getComputedStyle,(o?o(e):e.currentStyle)[t.replace(/-(\w)/gi,function(r,n){return n.toUpperCase()})]};v8.exports=fye});var _8=oe((Dze,S8)=>{var DM=y8();function mye(e){var t=DM(e,"line-height"),o=parseFloat(t,10);if(t===o+""){var r=e.style.lineHeight;e.style.lineHeight=t+"em",t=DM(e,"line-height"),o=parseFloat(t,10),r?e.style.lineHeight=r:delete e.style.lineHeight}if(t.indexOf("pt")!==-1?(o*=4,o/=3):t.indexOf("mm")!==-1?(o*=96,o/=25.4):t.indexOf("cm")!==-1?(o*=96,o/=2.54):t.indexOf("in")!==-1?o*=96:t.indexOf("pc")!==-1&&(o*=16),o=Math.round(o),t==="normal"){var n=e.nodeName,i=document.createElement(n);i.innerHTML=" ",n.toUpperCase()==="TEXTAREA"&&i.setAttribute("rows","1");var s=DM(e,"font-size");i.style.fontSize=s,i.style.padding="0px",i.style.border="0px";var a=document.body;a.appendChild(i);var c=i.offsetHeight;o=c,a.removeChild(i)}return o}S8.exports=mye});var w8=oe(Pl=>{"use strict";var pye=Pl&&Pl.__extends||(function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,o){t.__proto__=o}||function(t,o){for(var r in o)o.hasOwnProperty(r)&&(t[r]=o[r])};return function(t,o){e(t,o);function r(){this.constructor=t}t.prototype=o===null?Object.create(o):(r.prototype=o.prototype,new r)}})(),VM=Pl&&Pl.__assign||Object.assign||function(e){for(var t,o=1,r=arguments.length;o<r;o++){t=arguments[o];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},hye=Pl&&Pl.__rest||function(e,t){var o={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,r=Object.getOwnPropertySymbols(e);n<r.length;n++)t.indexOf(r[n])<0&&(o[r[n]]=e[r[n]]);return o};Pl.__esModule=!0;var wC=jr(),Xv=g8(),xC=k8(),gye=_8(),bye=gye,x8="autosize:resized",kye=(function(e){pye(t,e);function t(){var o=e!==null&&e.apply(this,arguments)||this;return o.state={lineHeight:null},o.textarea=null,o.onResize=function(r){o.props.onResize&&o.props.onResize(r)},o.updateLineHeight=function(){o.textarea&&o.setState({lineHeight:bye(o.textarea)})},o.onChange=function(r){var n=o.props.onChange;o.currentValue=r.currentTarget.value,n&&n(r)},o}return t.prototype.componentDidMount=function(){var o=this,r=this.props,n=r.maxRows,i=r.async;typeof n=="number"&&this.updateLineHeight(),typeof n=="number"||i?setTimeout(function(){return o.textarea&&xC(o.textarea)}):this.textarea&&xC(this.textarea),this.textarea&&this.textarea.addEventListener(x8,this.onResize)},t.prototype.componentWillUnmount=function(){this.textarea&&(this.textarea.removeEventListener(x8,this.onResize),xC.destroy(this.textarea))},t.prototype.render=function(){var o=this,r=this,n=r.props,i=n.onResize,s=n.maxRows,a=n.onChange,c=n.style,u=n.innerRef,d=n.children,f=hye(n,["onResize","maxRows","onChange","style","innerRef","children"]),m=r.state.lineHeight,h=s&&m?m*s:null;return wC.createElement("textarea",VM({},f,{onChange:this.onChange,style:h?VM({},c,{maxHeight:h}):c,ref:function(p){o.textarea=p,typeof o.props.innerRef=="function"?o.props.innerRef(p):o.props.innerRef&&(o.props.innerRef.current=p)}}),d)},t.prototype.componentDidUpdate=function(){this.textarea&&xC.update(this.textarea)},t.defaultProps={rows:1,async:!1},t.propTypes={rows:Xv.number,maxRows:Xv.number,onResize:Xv.func,innerRef:Xv.any,async:Xv.bool},t})(wC.Component);Pl.TextareaAutosize=wC.forwardRef(function(e,t){return wC.createElement(kye,VM({},e,{innerRef:t}))})});var FM=oe((Fze,C8)=>{"use strict";var vye=w8();C8.exports=vye.TextareaAutosize});var Qv=oe((Uze,I8)=>{I8.exports=window.wp.warning});var B7=oe((s6e,C7)=>{C7.exports=window.ReactDOM});var Is=oe((L6e,t9)=>{t9.exports=window.wp.keyboardShortcuts});var _9=oe((Yje,S9)=>{S9.exports=window.wp.uploadMedia});var R1=oe(()=>{});var O1=oe(()=>{});var UD=oe(()=>{});var AG=oe((_He,OG)=>{var E_e="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",T_e=(e,t=21)=>(o=t)=>{let r="",n=o|0;for(;n--;)r+=e[Math.random()*e.length|0];return r},I_e=(e=21)=>{let t="",o=e|0;for(;o--;)t+=E_e[Math.random()*64|0];return t};OG.exports={nanoid:I_e,customAlphabet:T_e}});var HD=oe(()=>{});var NG=oe((CHe,GD)=>{var Ce=String,LG=function(){return{isColorSupported:!1,reset:Ce,bold:Ce,dim:Ce,italic:Ce,underline:Ce,inverse:Ce,hidden:Ce,strikethrough:Ce,black:Ce,red:Ce,green:Ce,yellow:Ce,blue:Ce,magenta:Ce,cyan:Ce,white:Ce,gray:Ce,bgBlack:Ce,bgRed:Ce,bgGreen:Ce,bgYellow:Ce,bgBlue:Ce,bgMagenta:Ce,bgCyan:Ce,bgWhite:Ce,blackBright:Ce,redBright:Ce,greenBright:Ce,yellowBright:Ce,blueBright:Ce,magentaBright:Ce,cyanBright:Ce,whiteBright:Ce,bgBlackBright:Ce,bgRedBright:Ce,bgGreenBright:Ce,bgYellowBright:Ce,bgBlueBright:Ce,bgMagentaBright:Ce,bgCyanBright:Ce,bgWhiteBright:Ce}};GD.exports=LG();GD.exports.createColors=LG});var A1=oe((BHe,VG)=>{"use strict";var MG=NG(),DG=HD(),By=class e extends Error{constructor(t,o,r,n,i,s){super(t),this.name="CssSyntaxError",this.reason=t,i&&(this.file=i),n&&(this.source=n),s&&(this.plugin=s),typeof o<"u"&&typeof r<"u"&&(typeof o=="number"?(this.line=o,this.column=r):(this.line=o.line,this.column=o.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(t){if(!this.source)return"";let o=this.source;t==null&&(t=MG.isColorSupported),DG&&t&&(o=DG(o));let r=o.split(/\r?\n/),n=Math.max(this.line-3,0),i=Math.min(this.line+2,r.length),s=String(i).length,a,c;if(t){let{bold:u,gray:d,red:f}=MG.createColors(!0);a=m=>u(f(m)),c=m=>d(m)}else a=c=u=>u;return r.slice(n,i).map((u,d)=>{let f=n+1+d,m=" "+(" "+f).slice(-s)+" | ";if(f===this.line){let h=c(m.replace(/\d/g," "))+u.slice(0,this.column-1).replace(/[^\t]/g," ");return a(">")+c(m)+u+` `+h+a("^")}return" "+c(m)+u}).join(` `)}toString(){let t=this.showSourceCode();return t&&(t=` `+t+` `),this.name+": "+this.message+t}};VG.exports=By;By.default=By});var FG=oe(()=>{});var HG=oe((IHe,UG)=>{"use strict";var{SourceMapConsumer:zG,SourceMapGenerator:jG}=R1(),{existsSync:P_e,readFileSync:R_e}=FG(),{dirname:WD,join:O_e}=O1();function A_e(e){return Buffer?Buffer.from(e,"base64").toString():window.atob(e)}var Ey=class{constructor(t,o){if(o.map===!1)return;this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:");let r=o.map?o.map.prev:void 0,n=this.loadMap(o.from,r);!this.mapFile&&o.from&&(this.mapFile=o.from),this.mapFile&&(this.root=WD(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new zG(this.text)),this.consumerCache}decodeInline(t){let o=/^data:application\/json;charset=utf-?8;base64,/,r=/^data:application\/json;base64,/,n=/^data:application\/json;charset=utf-?8,/,i=/^data:application\/json,/;if(n.test(t)||i.test(t))return decodeURIComponent(t.substr(RegExp.lastMatch.length));if(o.test(t)||r.test(t))return A_e(t.substr(RegExp.lastMatch.length));let s=t.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+s)}getAnnotationURL(t){return t.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(t){return typeof t!="object"?!1:typeof t.mappings=="string"||typeof t._mappings=="string"||Array.isArray(t.sections)}loadAnnotation(t){let o=t.match(/\/\*\s*# sourceMappingURL=/gm);if(!o)return;let r=t.lastIndexOf(o.pop()),n=t.indexOf("*/",r);r>-1&&n>-1&&(this.annotation=this.getAnnotationURL(t.substring(r,n)))}loadFile(t){if(this.root=WD(t),P_e(t))return this.mapFile=t,R_e(t,"utf-8").toString().trim()}loadMap(t,o){if(o===!1)return!1;if(o){if(typeof o=="string")return o;if(typeof o=="function"){let r=o(t);if(r){let n=this.loadFile(r);if(!n)throw new Error("Unable to load previous source map: "+r.toString());return n}}else{if(o instanceof zG)return jG.fromSourceMap(o).toString();if(o instanceof jG)return o.toString();if(this.isMap(o))return JSON.stringify(o);throw new Error("Unsupported previous source map format: "+o.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let r=this.annotation;return t&&(r=O_e(WD(t),r)),this.loadFile(r)}}}startWith(t,o){return t?t.substr(0,o.length)===o:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};UG.exports=Ey;Ey.default=Ey});var ZD=oe((PHe,KG)=>{"use strict";var{SourceMapConsumer:L_e,SourceMapGenerator:N_e}=R1(),{fileURLToPath:GG,pathToFileURL:L1}=UD(),{isAbsolute:YD,resolve:qD}=O1(),{nanoid:M_e}=AG(),$D=HD(),WG=A1(),D_e=HG(),KD=Symbol("fromOffsetCache"),V_e=!!(L_e&&N_e),$G=!!(qD&&YD),Dh=class{constructor(t,o={}){if(t===null||typeof t>"u"||typeof t=="object"&&!t.toString)throw new Error(`PostCSS received ${t} instead of CSS string`);if(this.css=t.toString(),this.css[0]==="\uFEFF"||this.css[0]==="\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,o.from&&(!$G||/^\w+:\/\//.test(o.from)||YD(o.from)?this.file=o.from:this.file=qD(o.from)),$G&&V_e){let r=new D_e(this.css,o);if(r.text){this.map=r;let n=r.consumer().file;!this.file&&n&&(this.file=this.mapResolve(n))}}this.file||(this.id="<input css "+M_e(6)+">"),this.map&&(this.map.file=this.from)}error(t,o,r,n={}){let i,s,a;if(o&&typeof o=="object"){let u=o,d=r;if(typeof u.offset=="number"){let f=this.fromOffset(u.offset);o=f.line,r=f.col}else o=u.line,r=u.column;if(typeof d.offset=="number"){let f=this.fromOffset(d.offset);s=f.line,a=f.col}else s=d.line,a=d.column}else if(!r){let u=this.fromOffset(o);o=u.line,r=u.col}let c=this.origin(o,r,s,a);return c?i=new WG(t,c.endLine===void 0?c.line:{column:c.column,line:c.line},c.endLine===void 0?c.column:{column:c.endColumn,line:c.endLine},c.source,c.file,n.plugin):i=new WG(t,s===void 0?o:{column:r,line:o},s===void 0?r:{column:a,line:s},this.css,this.file,n.plugin),i.input={column:r,endColumn:a,endLine:s,line:o,source:this.css},this.file&&(L1&&(i.input.url=L1(this.file).toString()),i.input.file=this.file),i}fromOffset(t){let o,r;if(this[KD])r=this[KD];else{let i=this.css.split(` `);r=new Array(i.length);let s=0;for(let a=0,c=i.length;a<c;a++)r[a]=s,s+=i[a].length+1;this[KD]=r}o=r[r.length-1];let n=0;if(t>=o)n=r.length-1;else{let i=r.length-2,s;for(;n<i;)if(s=n+(i-n>>1),t<r[s])i=s-1;else if(t>=r[s+1])n=s+1;else{n=s;break}}return{col:t-r[n]+1,line:n+1}}mapResolve(t){return/^\w+:\/\//.test(t)?t:qD(this.map.consumer().sourceRoot||this.map.root||".",t)}origin(t,o,r,n){if(!this.map)return!1;let i=this.map.consumer(),s=i.originalPositionFor({column:o,line:t});if(!s.source)return!1;let a;typeof r=="number"&&(a=i.originalPositionFor({column:n,line:r}));let c;YD(s.source)?c=L1(s.source):c=new URL(s.source,this.map.consumer().sourceRoot||L1(this.map.mapFile));let u={column:s.column,endColumn:a&&a.column,endLine:a&&a.line,line:s.line,url:c.toString()};if(c.protocol==="file:")if(GG)u.file=GG(c);else throw new Error("file: protocol is not available in this PostCSS build");let d=i.sourceContentFor(s.source);return d&&(u.source=d),u}toJSON(){let t={};for(let o of["hasBOM","css","file","id"])this[o]!=null&&(t[o]=this[o]);return this.map&&(t.map={...this.map},t.map.consumerCache&&(t.map.consumerCache=void 0)),t}get from(){return this.file||this.id}};KG.exports=Dh;Dh.default=Dh;$D&&$D.registerInput&&$D.registerInput(Dh)});var QD=oe((RHe,JG)=>{"use strict";var{SourceMapConsumer:qG,SourceMapGenerator:N1}=R1(),{dirname:M1,relative:ZG,resolve:XG,sep:QG}=O1(),{pathToFileURL:YG}=UD(),F_e=ZD(),z_e=!!(qG&&N1),j_e=!!(M1&&XG&&ZG&&QG),XD=class{constructor(t,o,r,n){this.stringify=t,this.mapOpts=r.map||{},this.root=o,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let t;this.isInline()?t="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?t=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?t=this.mapOpts.annotation(this.opts.to,this.root):t=this.outputFile()+".map";let o=` `;this.css.includes(`\r `)&&(o=`\r `),this.css+=o+"/*# sourceMappingURL="+t+" */"}applyPrevMaps(){for(let t of this.previous()){let o=this.toUrl(this.path(t.file)),r=t.root||M1(t.file),n;this.mapOpts.sourcesContent===!1?(n=new qG(t.text),n.sourcesContent&&(n.sourcesContent=null)):n=t.consumer(),this.map.applySourceMap(n,o,this.toUrl(this.path(r)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let t;for(let o=this.root.nodes.length-1;o>=0;o--)t=this.root.nodes[o],t.type==="comment"&&t.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(o)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),j_e&&z_e&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,o=>{t+=o}),[t]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let t=this.previous()[0].consumer();t.file=this.outputFile(),this.map=N1.fromSourceMap(t,{ignoreInvalidMapping:!0})}else this.map=new N1({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new N1({file:this.outputFile(),ignoreInvalidMapping:!0});let t=1,o=1,r="<no source>",n={generated:{column:0,line:0},original:{column:0,line:0},source:""},i,s;this.stringify(this.root,(a,c,u)=>{if(this.css+=a,c&&u!=="end"&&(n.generated.line=t,n.generated.column=o-1,c.source&&c.source.start?(n.source=this.sourcePath(c),n.original.line=c.source.start.line,n.original.column=c.source.start.column-1,this.map.addMapping(n)):(n.source=r,n.original.line=1,n.original.column=0,this.map.addMapping(n))),i=a.match(/\n/g),i?(t+=i.length,s=a.lastIndexOf(` `),o=a.length-s):o+=a.length,c&&u!=="start"){let d=c.parent||{raws:{}};(!(c.type==="decl"||c.type==="atrule"&&!c.nodes)||c!==d.last||d.raws.semicolon)&&(c.source&&c.source.end?(n.source=this.sourcePath(c),n.original.line=c.source.end.line,n.original.column=c.source.end.column-1,n.generated.line=t,n.generated.column=o-2,this.map.addMapping(n)):(n.source=r,n.original.line=1,n.original.column=0,n.generated.line=t,n.generated.column=o-1,this.map.addMapping(n)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(t=>t.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let t=this.mapOpts.annotation;return typeof t<"u"&&t!==!0?!1:this.previous().length?this.previous().some(o=>o.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(t=>t.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(t){if(this.mapOpts.absolute||t.charCodeAt(0)===60||/^\w+:\/\//.test(t))return t;let o=this.memoizedPaths.get(t);if(o)return o;let r=this.opts.to?M1(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=M1(XG(r,this.mapOpts.annotation)));let n=ZG(r,t);return this.memoizedPaths.set(t,n),n}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(t=>{if(t.source&&t.source.input.map){let o=t.source.input.map;this.previousMaps.includes(o)||this.previousMaps.push(o)}});else{let t=new F_e(this.originalCSS,this.opts);t.map&&this.previousMaps.push(t.map)}return this.previousMaps}setSourcesContent(){let t={};if(this.root)this.root.walk(o=>{if(o.source){let r=o.source.input.from;if(r&&!t[r]){t[r]=!0;let n=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(n,o.source.input.css)}}});else if(this.css){let o=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(o,this.css)}}sourcePath(t){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(t.source.input.from):this.toUrl(this.path(t.source.input.from))}toBase64(t){return Buffer?Buffer.from(t).toString("base64"):window.btoa(unescape(encodeURIComponent(t)))}toFileUrl(t){let o=this.memoizedFileURLs.get(t);if(o)return o;if(YG){let r=YG(t).toString();return this.memoizedFileURLs.set(t,r),r}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(t){let o=this.memoizedURLs.get(t);if(o)return o;QG==="\\"&&(t=t.replace(/\\/g,"/"));let r=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,r),r}};JG.exports=XD});var JD=oe((OHe,tW)=>{"use strict";var eW={after:` `,beforeClose:` `,beforeComment:` `,beforeDecl:` `,beforeOpen:" ",beforeRule:` `,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function U_e(e){return e[0].toUpperCase()+e.slice(1)}var Ty=class{constructor(t){this.builder=t}atrule(t,o){let r="@"+t.name,n=t.params?this.rawValue(t,"params"):"";if(typeof t.raws.afterName<"u"?r+=t.raws.afterName:n&&(r+=" "),t.nodes)this.block(t,r+n);else{let i=(t.raws.between||"")+(o?";":"");this.builder(r+n+i,t)}}beforeAfter(t,o){let r;t.type==="decl"?r=this.raw(t,null,"beforeDecl"):t.type==="comment"?r=this.raw(t,null,"beforeComment"):o==="before"?r=this.raw(t,null,"beforeRule"):r=this.raw(t,null,"beforeClose");let n=t.parent,i=0;for(;n&&n.type!=="root";)i+=1,n=n.parent;if(r.includes(` `)){let s=this.raw(t,null,"indent");if(s.length)for(let a=0;a<i;a++)r+=s}return r}block(t,o){let r=this.raw(t,"between","beforeOpen");this.builder(o+r+"{",t,"start");let n;t.nodes&&t.nodes.length?(this.body(t),n=this.raw(t,"after")):n=this.raw(t,"after","emptyBody"),n&&this.builder(n),this.builder("}",t,"end")}body(t){let o=t.nodes.length-1;for(;o>0&&t.nodes[o].type==="comment";)o-=1;let r=this.raw(t,"semicolon");for(let n=0;n<t.nodes.length;n++){let i=t.nodes[n],s=this.raw(i,"before");s&&this.builder(s),this.stringify(i,o!==n||r)}}comment(t){let o=this.raw(t,"left","commentLeft"),r=this.raw(t,"right","commentRight");this.builder("/*"+o+t.text+r+"*/",t)}decl(t,o){let r=this.raw(t,"between","colon"),n=t.prop+r+this.rawValue(t,"value");t.important&&(n+=t.raws.important||" !important"),o&&(n+=";"),this.builder(n,t)}document(t){this.body(t)}raw(t,o,r){let n;if(r||(r=o),o&&(n=t.raws[o],typeof n<"u"))return n;let i=t.parent;if(r==="before"&&(!i||i.type==="root"&&i.first===t||i&&i.type==="document"))return"";if(!i)return eW[r];let s=t.root();if(s.rawCache||(s.rawCache={}),typeof s.rawCache[r]<"u")return s.rawCache[r];if(r==="before"||r==="after")return this.beforeAfter(t,r);{let a="raw"+U_e(r);this[a]?n=this[a](s,t):s.walk(c=>{if(n=c.raws[o],typeof n<"u")return!1})}return typeof n>"u"&&(n=eW[r]),s.rawCache[r]=n,n}rawBeforeClose(t){let o;return t.walk(r=>{if(r.nodes&&r.nodes.length>0&&typeof r.raws.after<"u")return o=r.raws.after,o.includes(` `)&&(o=o.replace(/[^\n]+$/,"")),!1}),o&&(o=o.replace(/\S/g,"")),o}rawBeforeComment(t,o){let r;return t.walkComments(n=>{if(typeof n.raws.before<"u")return r=n.raws.before,r.includes(` `)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(o,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(t,o){let r;return t.walkDecls(n=>{if(typeof n.raws.before<"u")return r=n.raws.before,r.includes(` `)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(o,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(t){let o;return t.walk(r=>{if(r.type!=="decl"&&(o=r.raws.between,typeof o<"u"))return!1}),o}rawBeforeRule(t){let o;return t.walk(r=>{if(r.nodes&&(r.parent!==t||t.first!==r)&&typeof r.raws.before<"u")return o=r.raws.before,o.includes(` `)&&(o=o.replace(/[^\n]+$/,"")),!1}),o&&(o=o.replace(/\S/g,"")),o}rawColon(t){let o;return t.walkDecls(r=>{if(typeof r.raws.between<"u")return o=r.raws.between.replace(/[^\s:]/g,""),!1}),o}rawEmptyBody(t){let o;return t.walk(r=>{if(r.nodes&&r.nodes.length===0&&(o=r.raws.after,typeof o<"u"))return!1}),o}rawIndent(t){if(t.raws.indent)return t.raws.indent;let o;return t.walk(r=>{let n=r.parent;if(n&&n!==t&&n.parent&&n.parent===t&&typeof r.raws.before<"u"){let i=r.raws.before.split(` `);return o=i[i.length-1],o=o.replace(/\S/g,""),!1}}),o}rawSemicolon(t){let o;return t.walk(r=>{if(r.nodes&&r.nodes.length&&r.last.type==="decl"&&(o=r.raws.semicolon,typeof o<"u"))return!1}),o}rawValue(t,o){let r=t[o],n=t.raws[o];return n&&n.value===r?n.raw:r}root(t){this.body(t),t.raws.after&&this.builder(t.raws.after)}rule(t){this.block(t,this.rawValue(t,"selector")),t.raws.ownSemicolon&&this.builder(t.raws.ownSemicolon,t,"end")}stringify(t,o){if(!this[t.type])throw new Error("Unknown AST node type "+t.type+". Maybe you need to change PostCSS stringifier.");this[t.type](t,o)}};tW.exports=Ty;Ty.default=Ty});var D1=oe((AHe,oW)=>{"use strict";var H_e=JD();function e5(e,t){new H_e(t).stringify(e)}oW.exports=e5;e5.default=e5});var t5=oe((LHe,nW)=>{"use strict";var rW={};nW.exports=function(t){rW[t]||(rW[t]=!0,typeof console<"u"&&console.warn&&console.warn(t))}});var V1=oe((NHe,o5)=>{"use strict";o5.exports.isClean=Symbol("isClean");o5.exports.my=Symbol("my")});var z1=oe((MHe,iW)=>{"use strict";var{isClean:F1,my:G_e}=V1(),W_e=A1(),$_e=JD(),K_e=D1();function r5(e,t){let o=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r)||r==="proxyCache")continue;let n=e[r],i=typeof n;r==="parent"&&i==="object"?t&&(o[r]=t):r==="source"?o[r]=n:Array.isArray(n)?o[r]=n.map(s=>r5(s,o)):(i==="object"&&n!==null&&(n=r5(n)),o[r]=n)}return o}var Iy=class{constructor(t={}){this.raws={},this[F1]=!1,this[G_e]=!0;for(let o in t)if(o==="nodes"){this.nodes=[];for(let r of t[o])typeof r.clone=="function"?this.append(r.clone()):this.append(r)}else this[o]=t[o]}addToError(t){if(t.postcssNode=this,t.stack&&this.source&&/\n\s{4}at /.test(t.stack)){let o=this.source;t.stack=t.stack.replace(/\n\s{4}at /,`$&${o.input.from}:${o.start.line}:${o.start.column}$&`)}return t}after(t){return this.parent.insertAfter(this,t),this}assign(t={}){for(let o in t)this[o]=t[o];return this}before(t){return this.parent.insertBefore(this,t),this}cleanRaws(t){delete this.raws.before,delete this.raws.after,t||delete this.raws.between}clone(t={}){let o=r5(this);for(let r in t)o[r]=t[r];return o}cloneAfter(t={}){let o=this.clone(t);return this.parent.insertAfter(this,o),o}cloneBefore(t={}){let o=this.clone(t);return this.parent.insertBefore(this,o),o}error(t,o={}){if(this.source){let{end:r,start:n}=this.rangeBy(o);return this.source.input.error(t,{column:n.column,line:n.line},{column:r.column,line:r.line},o)}return new W_e(t)}getProxyProcessor(){return{get(t,o){return o==="proxyOf"?t:o==="root"?()=>t.root().toProxy():t[o]},set(t,o,r){return t[o]===r||(t[o]=r,(o==="prop"||o==="value"||o==="name"||o==="params"||o==="important"||o==="text")&&t.markDirty()),!0}}}markDirty(){if(this[F1]){this[F1]=!1;let t=this;for(;t=t.parent;)t[F1]=!1}}next(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t+1]}positionBy(t,o){let r=this.source.start;if(t.index)r=this.positionInside(t.index,o);else if(t.word){o=this.toString();let n=o.indexOf(t.word);n!==-1&&(r=this.positionInside(n,o))}return r}positionInside(t,o){let r=o||this.toString(),n=this.source.start.column,i=this.source.start.line;for(let s=0;s<t;s++)r[s]===` `?(n=1,i+=1):n+=1;return{column:n,line:i}}prev(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t-1]}rangeBy(t){let o={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:o.column+1,line:o.line};if(t.word){let n=this.toString(),i=n.indexOf(t.word);i!==-1&&(o=this.positionInside(i,n),r=this.positionInside(i+t.word.length,n))}else t.start?o={column:t.start.column,line:t.start.line}:t.index&&(o=this.positionInside(t.index)),t.end?r={column:t.end.column,line:t.end.line}:typeof t.endIndex=="number"?r=this.positionInside(t.endIndex):t.index&&(r=this.positionInside(t.index+1));return(r.line<o.line||r.line===o.line&&r.column<=o.column)&&(r={column:o.column+1,line:o.line}),{end:r,start:o}}raw(t,o){return new $_e().raw(this,t,o)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...t){if(this.parent){let o=this,r=!1;for(let n of t)n===this?r=!0:r?(this.parent.insertAfter(o,n),o=n):this.parent.insertBefore(o,n);r||this.remove()}return this}root(){let t=this;for(;t.parent&&t.parent.type!=="document";)t=t.parent;return t}toJSON(t,o){let r={},n=o==null;o=o||new Map;let i=0;for(let s in this){if(!Object.prototype.hasOwnProperty.call(this,s)||s==="parent"||s==="proxyCache")continue;let a=this[s];if(Array.isArray(a))r[s]=a.map(c=>typeof c=="object"&&c.toJSON?c.toJSON(null,o):c);else if(typeof a=="object"&&a.toJSON)r[s]=a.toJSON(null,o);else if(s==="source"){let c=o.get(a.input);c==null&&(c=i,o.set(a.input,i),i++),r[s]={end:a.end,inputId:c,start:a.start}}else r[s]=a}return n&&(r.inputs=[...o.keys()].map(s=>s.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(t=K_e){t.stringify&&(t=t.stringify);let o="";return t(this,r=>{o+=r}),o}warn(t,o,r){let n={node:this};for(let i in r)n[i]=r[i];return t.warn(o,n)}get proxyOf(){return this}};iW.exports=Iy;Iy.default=Iy});var n5=oe((DHe,sW)=>{"use strict";var Y_e=z1(),Py=class extends Y_e{constructor(t){t&&typeof t.value<"u"&&typeof t.value!="string"&&(t={...t,value:String(t.value)}),super(t),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}};sW.exports=Py;Py.default=Py});var i5=oe((VHe,aW)=>{"use strict";var q_e=z1(),Ry=class extends q_e{constructor(t){super(t),this.type="comment"}};aW.exports=Ry;Ry.default=Ry});var rm=oe((FHe,gW)=>{"use strict";var{isClean:lW,my:cW}=V1(),uW=n5(),dW=i5(),Z_e=z1(),fW,s5,a5,mW;function pW(e){return e.map(t=>(t.nodes&&(t.nodes=pW(t.nodes)),delete t.source,t))}function hW(e){if(e[lW]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)hW(t)}var Os=class e extends Z_e{append(...t){for(let o of t){let r=this.normalize(o,this.last);for(let n of r)this.proxyOf.nodes.push(n)}return this.markDirty(),this}cleanRaws(t){if(super.cleanRaws(t),this.nodes)for(let o of this.nodes)o.cleanRaws(t)}each(t){if(!this.proxyOf.nodes)return;let o=this.getIterator(),r,n;for(;this.indexes[o]<this.proxyOf.nodes.length&&(r=this.indexes[o],n=t(this.proxyOf.nodes[r],r),n!==!1);)this.indexes[o]+=1;return delete this.indexes[o],n}every(t){return this.nodes.every(t)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let t=this.lastEach;return this.indexes[t]=0,t}getProxyProcessor(){return{get(t,o){return o==="proxyOf"?t:t[o]?o==="each"||typeof o=="string"&&o.startsWith("walk")?(...r)=>t[o](...r.map(n=>typeof n=="function"?(i,s)=>n(i.toProxy(),s):n)):o==="every"||o==="some"?r=>t[o]((n,...i)=>r(n.toProxy(),...i)):o==="root"?()=>t.root().toProxy():o==="nodes"?t.nodes.map(r=>r.toProxy()):o==="first"||o==="last"?t[o].toProxy():t[o]:t[o]},set(t,o,r){return t[o]===r||(t[o]=r,(o==="name"||o==="params"||o==="selector")&&t.markDirty()),!0}}}index(t){return typeof t=="number"?t:(t.proxyOf&&(t=t.proxyOf),this.proxyOf.nodes.indexOf(t))}insertAfter(t,o){let r=this.index(t),n=this.normalize(o,this.proxyOf.nodes[r]).reverse();r=this.index(t);for(let s of n)this.proxyOf.nodes.splice(r+1,0,s);let i;for(let s in this.indexes)i=this.indexes[s],r<i&&(this.indexes[s]=i+n.length);return this.markDirty(),this}insertBefore(t,o){let r=this.index(t),n=r===0?"prepend":!1,i=this.normalize(o,this.proxyOf.nodes[r],n).reverse();r=this.index(t);for(let a of i)this.proxyOf.nodes.splice(r,0,a);let s;for(let a in this.indexes)s=this.indexes[a],r<=s&&(this.indexes[a]=s+i.length);return this.markDirty(),this}normalize(t,o){if(typeof t=="string")t=pW(fW(t).nodes);else if(typeof t>"u")t=[];else if(Array.isArray(t)){t=t.slice(0);for(let n of t)n.parent&&n.parent.removeChild(n,"ignore")}else if(t.type==="root"&&this.type!=="document"){t=t.nodes.slice(0);for(let n of t)n.parent&&n.parent.removeChild(n,"ignore")}else if(t.type)t=[t];else if(t.prop){if(typeof t.value>"u")throw new Error("Value field is missed in node creation");typeof t.value!="string"&&(t.value=String(t.value)),t=[new uW(t)]}else if(t.selector)t=[new s5(t)];else if(t.name)t=[new a5(t)];else if(t.text)t=[new dW(t)];else throw new Error("Unknown node type in node creation");return t.map(n=>(n[cW]||e.rebuild(n),n=n.proxyOf,n.parent&&n.parent.removeChild(n),n[lW]&&hW(n),typeof n.raws.before>"u"&&o&&typeof o.raws.before<"u"&&(n.raws.before=o.raws.before.replace(/\S/g,"")),n.parent=this.proxyOf,n))}prepend(...t){t=t.reverse();for(let o of t){let r=this.normalize(o,this.first,"prepend").reverse();for(let n of r)this.proxyOf.nodes.unshift(n);for(let n in this.indexes)this.indexes[n]=this.indexes[n]+r.length}return this.markDirty(),this}push(t){return t.parent=this,this.proxyOf.nodes.push(t),this}removeAll(){for(let t of this.proxyOf.nodes)t.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(t){t=this.index(t),this.proxyOf.nodes[t].parent=void 0,this.proxyOf.nodes.splice(t,1);let o;for(let r in this.indexes)o=this.indexes[r],o>=t&&(this.indexes[r]=o-1);return this.markDirty(),this}replaceValues(t,o,r){return r||(r=o,o={}),this.walkDecls(n=>{o.props&&!o.props.includes(n.prop)||o.fast&&!n.value.includes(o.fast)||(n.value=n.value.replace(t,r))}),this.markDirty(),this}some(t){return this.nodes.some(t)}walk(t){return this.each((o,r)=>{let n;try{n=t(o,r)}catch(i){throw o.addToError(i)}return n!==!1&&o.walk&&(n=o.walk(t)),n})}walkAtRules(t,o){return o?t instanceof RegExp?this.walk((r,n)=>{if(r.type==="atrule"&&t.test(r.name))return o(r,n)}):this.walk((r,n)=>{if(r.type==="atrule"&&r.name===t)return o(r,n)}):(o=t,this.walk((r,n)=>{if(r.type==="atrule")return o(r,n)}))}walkComments(t){return this.walk((o,r)=>{if(o.type==="comment")return t(o,r)})}walkDecls(t,o){return o?t instanceof RegExp?this.walk((r,n)=>{if(r.type==="decl"&&t.test(r.prop))return o(r,n)}):this.walk((r,n)=>{if(r.type==="decl"&&r.prop===t)return o(r,n)}):(o=t,this.walk((r,n)=>{if(r.type==="decl")return o(r,n)}))}walkRules(t,o){return o?t instanceof RegExp?this.walk((r,n)=>{if(r.type==="rule"&&t.test(r.selector))return o(r,n)}):this.walk((r,n)=>{if(r.type==="rule"&&r.selector===t)return o(r,n)}):(o=t,this.walk((r,n)=>{if(r.type==="rule")return o(r,n)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};Os.registerParse=e=>{fW=e};Os.registerRule=e=>{s5=e};Os.registerAtRule=e=>{a5=e};Os.registerRoot=e=>{mW=e};gW.exports=Os;Os.default=Os;Os.rebuild=e=>{e.type==="atrule"?Object.setPrototypeOf(e,a5.prototype):e.type==="rule"?Object.setPrototypeOf(e,s5.prototype):e.type==="decl"?Object.setPrototypeOf(e,uW.prototype):e.type==="comment"?Object.setPrototypeOf(e,dW.prototype):e.type==="root"&&Object.setPrototypeOf(e,mW.prototype),e[cW]=!0,e.nodes&&e.nodes.forEach(t=>{Os.rebuild(t)})}});var vW=oe((zHe,kW)=>{"use strict";var j1=/[\t\n\f\r "#'()/;[\\\]{}]/g,U1=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,X_e=/.[\r\n"'(/\\]/,bW=/[\da-f]/i;kW.exports=function(t,o={}){let r=t.css.valueOf(),n=o.ignoreErrors,i,s,a,c,u,d,f,m,h,p,g=r.length,b=0,v=[],k=[];function y(){return b}function S(I){throw t.error("Unclosed "+I,b)}function x(){return k.length===0&&b>=g}function C(I){if(k.length)return k.pop();if(b>=g)return;let P=I?I.ignoreUnclosed:!1;switch(i=r.charCodeAt(b),i){case 10:case 32:case 9:case 13:case 12:{s=b;do s+=1,i=r.charCodeAt(s);while(i===32||i===10||i===9||i===13||i===12);p=["space",r.slice(b,s)],b=s-1;break}case 91:case 93:case 123:case 125:case 58:case 59:case 41:{let E=String.fromCharCode(i);p=[E,E,b];break}case 40:{if(m=v.length?v.pop()[1]:"",h=r.charCodeAt(b+1),m==="url"&&h!==39&&h!==34&&h!==32&&h!==10&&h!==9&&h!==12&&h!==13){s=b;do{if(d=!1,s=r.indexOf(")",s+1),s===-1)if(n||P){s=b;break}else S("bracket");for(f=s;r.charCodeAt(f-1)===92;)f-=1,d=!d}while(d);p=["brackets",r.slice(b,s+1),b,s],b=s}else s=r.indexOf(")",b+1),c=r.slice(b,s+1),s===-1||X_e.test(c)?p=["(","(",b]:(p=["brackets",c,b,s],b=s);break}case 39:case 34:{a=i===39?"'":'"',s=b;do{if(d=!1,s=r.indexOf(a,s+1),s===-1)if(n||P){s=b+1;break}else S("string");for(f=s;r.charCodeAt(f-1)===92;)f-=1,d=!d}while(d);p=["string",r.slice(b,s+1),b,s],b=s;break}case 64:{j1.lastIndex=b+1,j1.test(r),j1.lastIndex===0?s=r.length-1:s=j1.lastIndex-2,p=["at-word",r.slice(b,s+1),b,s],b=s;break}case 92:{for(s=b,u=!0;r.charCodeAt(s+1)===92;)s+=1,u=!u;if(i=r.charCodeAt(s+1),u&&i!==47&&i!==32&&i!==10&&i!==9&&i!==13&&i!==12&&(s+=1,bW.test(r.charAt(s)))){for(;bW.test(r.charAt(s+1));)s+=1;r.charCodeAt(s+1)===32&&(s+=1)}p=["word",r.slice(b,s+1),b,s],b=s;break}default:{i===47&&r.charCodeAt(b+1)===42?(s=r.indexOf("*/",b+2)+1,s===0&&(n||P?s=r.length:S("comment")),p=["comment",r.slice(b,s+1),b,s],b=s):(U1.lastIndex=b+1,U1.test(r),U1.lastIndex===0?s=r.length-1:s=U1.lastIndex-2,p=["word",r.slice(b,s+1),b,s],v.push(p),b=s);break}}return b++,p}function B(I){k.push(I)}return{back:B,endOfFile:x,nextToken:C,position:y}}});var _W=oe((jHe,SW)=>{"use strict";var yW=rm(),Vh=class extends yW{constructor(t){super(t),this.type="atrule"}append(...t){return this.proxyOf.nodes||(this.nodes=[]),super.append(...t)}prepend(...t){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...t)}};SW.exports=Vh;Vh.default=Vh;yW.registerAtRule(Vh)});var H1=oe((UHe,BW)=>{"use strict";var xW=rm(),wW,CW,Fu=class extends xW{constructor(t){super(t),this.type="root",this.nodes||(this.nodes=[])}normalize(t,o,r){let n=super.normalize(t);if(o){if(r==="prepend")this.nodes.length>1?o.raws.before=this.nodes[1].raws.before:delete o.raws.before;else if(this.first!==o)for(let i of n)i.raws.before=o.raws.before}return n}removeChild(t,o){let r=this.index(t);return!o&&r===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(t)}toResult(t={}){return new wW(new CW,this,t).stringify()}};Fu.registerLazyResult=e=>{wW=e};Fu.registerProcessor=e=>{CW=e};BW.exports=Fu;Fu.default=Fu;xW.registerRoot(Fu)});var TW=oe((HHe,EW)=>{"use strict";var Oy={comma(e){return Oy.split(e,[","],!0)},space(e){let t=[" ",` `," "];return Oy.split(e,t)},split(e,t,o){let r=[],n="",i=!1,s=0,a=!1,c="",u=!1;for(let d of e)u?u=!1:d==="\\"?u=!0:a?d===c&&(a=!1):d==='"'||d==="'"?(a=!0,c=d):d==="("?s+=1:d===")"?s>0&&(s-=1):s===0&&t.includes(d)&&(i=!0),i?(n!==""&&r.push(n.trim()),n="",i=!1):n+=d;return(o||n!=="")&&r.push(n.trim()),r}};EW.exports=Oy;Oy.default=Oy});var RW=oe((GHe,PW)=>{"use strict";var IW=rm(),Q_e=TW(),Fh=class extends IW{constructor(t){super(t),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Q_e.comma(this.selector)}set selectors(t){let o=this.selector?this.selector.match(/,\s*/):null,r=o?o[0]:","+this.raw("between","beforeOpen");this.selector=t.join(r)}};PW.exports=Fh;Fh.default=Fh;IW.registerRule(Fh)});var NW=oe((WHe,LW)=>{"use strict";var J_e=n5(),e0e=vW(),t0e=i5(),o0e=_W(),r0e=H1(),OW=RW(),AW={empty:!0,space:!0};function n0e(e){for(let t=e.length-1;t>=0;t--){let o=e[t],r=o[3]||o[2];if(r)return r}}var l5=class{constructor(t){this.input=t,this.root=new r0e,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:t,start:{column:1,line:1,offset:0}}}atrule(t){let o=new o0e;o.name=t[1].slice(1),o.name===""&&this.unnamedAtrule(o,t),this.init(o,t[2]);let r,n,i,s=!1,a=!1,c=[],u=[];for(;!this.tokenizer.endOfFile();){if(t=this.tokenizer.nextToken(),r=t[0],r==="("||r==="["?u.push(r==="("?")":"]"):r==="{"&&u.length>0?u.push("}"):r===u[u.length-1]&&u.pop(),u.length===0)if(r===";"){o.source.end=this.getPosition(t[2]),o.source.end.offset++,this.semicolon=!0;break}else if(r==="{"){a=!0;break}else if(r==="}"){if(c.length>0){for(i=c.length-1,n=c[i];n&&n[0]==="space";)n=c[--i];n&&(o.source.end=this.getPosition(n[3]||n[2]),o.source.end.offset++)}this.end(t);break}else c.push(t);else c.push(t);if(this.tokenizer.endOfFile()){s=!0;break}}o.raws.between=this.spacesAndCommentsFromEnd(c),c.length?(o.raws.afterName=this.spacesAndCommentsFromStart(c),this.raw(o,"params",c),s&&(t=c[c.length-1],o.source.end=this.getPosition(t[3]||t[2]),o.source.end.offset++,this.spaces=o.raws.between,o.raws.between="")):(o.raws.afterName="",o.params=""),a&&(o.nodes=[],this.current=o)}checkMissedSemicolon(t){let o=this.colon(t);if(o===!1)return;let r=0,n;for(let i=o-1;i>=0&&(n=t[i],!(n[0]!=="space"&&(r+=1,r===2)));i--);throw this.input.error("Missed semicolon",n[0]==="word"?n[3]+1:n[2])}colon(t){let o=0,r,n,i;for(let[s,a]of t.entries()){if(r=a,n=r[0],n==="("&&(o+=1),n===")"&&(o-=1),o===0&&n===":")if(!i)this.doubleColon(r);else{if(i[0]==="word"&&i[1]==="progid")continue;return s}i=r}return!1}comment(t){let o=new t0e;this.init(o,t[2]),o.source.end=this.getPosition(t[3]||t[2]),o.source.end.offset++;let r=t[1].slice(2,-2);if(/^\s*$/.test(r))o.text="",o.raws.left=r,o.raws.right="";else{let n=r.match(/^(\s*)([^]*\S)(\s*)$/);o.text=n[2],o.raws.left=n[1],o.raws.right=n[3]}}createTokenizer(){this.tokenizer=e0e(this.input)}decl(t,o){let r=new J_e;this.init(r,t[0][2]);let n=t[t.length-1];for(n[0]===";"&&(this.semicolon=!0,t.pop()),r.source.end=this.getPosition(n[3]||n[2]||n0e(t)),r.source.end.offset++;t[0][0]!=="word";)t.length===1&&this.unknownWord(t),r.raws.before+=t.shift()[1];for(r.source.start=this.getPosition(t[0][2]),r.prop="";t.length;){let u=t[0][0];if(u===":"||u==="space"||u==="comment")break;r.prop+=t.shift()[1]}r.raws.between="";let i;for(;t.length;)if(i=t.shift(),i[0]===":"){r.raws.between+=i[1];break}else i[0]==="word"&&/\w/.test(i[1])&&this.unknownWord([i]),r.raws.between+=i[1];(r.prop[0]==="_"||r.prop[0]==="*")&&(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let s=[],a;for(;t.length&&(a=t[0][0],!(a!=="space"&&a!=="comment"));)s.push(t.shift());this.precheckMissedSemicolon(t);for(let u=t.length-1;u>=0;u--){if(i=t[u],i[1].toLowerCase()==="!important"){r.important=!0;let d=this.stringFrom(t,u);d=this.spacesFromEnd(t)+d,d!==" !important"&&(r.raws.important=d);break}else if(i[1].toLowerCase()==="important"){let d=t.slice(0),f="";for(let m=u;m>0;m--){let h=d[m][0];if(f.trim().indexOf("!")===0&&h!=="space")break;f=d.pop()[1]+f}f.trim().indexOf("!")===0&&(r.important=!0,r.raws.important=f,t=d)}if(i[0]!=="space"&&i[0]!=="comment")break}t.some(u=>u[0]!=="space"&&u[0]!=="comment")&&(r.raws.between+=s.map(u=>u[1]).join(""),s=[]),this.raw(r,"value",s.concat(t),o),r.value.includes(":")&&!o&&this.checkMissedSemicolon(t)}doubleColon(t){throw this.input.error("Double colon",{offset:t[2]},{offset:t[2]+t[1].length})}emptyRule(t){let o=new OW;this.init(o,t[2]),o.selector="",o.raws.between="",this.current=o}end(t){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(t[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(t)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(t){if(this.spaces+=t[1],this.current.nodes){let o=this.current.nodes[this.current.nodes.length-1];o&&o.type==="rule"&&!o.raws.ownSemicolon&&(o.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(t){let o=this.input.fromOffset(t);return{column:o.col,line:o.line,offset:t}}init(t,o){this.current.push(t),t.source={input:this.input,start:this.getPosition(o)},t.raws.before=this.spaces,this.spaces="",t.type!=="comment"&&(this.semicolon=!1)}other(t){let o=!1,r=null,n=!1,i=null,s=[],a=t[1].startsWith("--"),c=[],u=t;for(;u;){if(r=u[0],c.push(u),r==="("||r==="[")i||(i=u),s.push(r==="("?")":"]");else if(a&&n&&r==="{")i||(i=u),s.push("}");else if(s.length===0)if(r===";")if(n){this.decl(c,a);return}else break;else if(r==="{"){this.rule(c);return}else if(r==="}"){this.tokenizer.back(c.pop()),o=!0;break}else r===":"&&(n=!0);else r===s[s.length-1]&&(s.pop(),s.length===0&&(i=null));u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(o=!0),s.length>0&&this.unclosedBracket(i),o&&n){if(!a)for(;c.length&&(u=c[c.length-1][0],!(u!=="space"&&u!=="comment"));)this.tokenizer.back(c.pop());this.decl(c,a)}else this.unknownWord(c)}parse(){let t;for(;!this.tokenizer.endOfFile();)switch(t=this.tokenizer.nextToken(),t[0]){case"space":this.spaces+=t[1];break;case";":this.freeSemicolon(t);break;case"}":this.end(t);break;case"comment":this.comment(t);break;case"at-word":this.atrule(t);break;case"{":this.emptyRule(t);break;default:this.other(t);break}this.endFile()}precheckMissedSemicolon(){}raw(t,o,r,n){let i,s,a=r.length,c="",u=!0,d,f;for(let m=0;m<a;m+=1)i=r[m],s=i[0],s==="space"&&m===a-1&&!n?u=!1:s==="comment"?(f=r[m-1]?r[m-1][0]:"empty",d=r[m+1]?r[m+1][0]:"empty",!AW[f]&&!AW[d]?c.slice(-1)===","?u=!1:c+=i[1]:u=!1):c+=i[1];if(!u){let m=r.reduce((h,p)=>h+p[1],"");t.raws[o]={raw:m,value:c}}t[o]=c}rule(t){t.pop();let o=new OW;this.init(o,t[0][2]),o.raws.between=this.spacesAndCommentsFromEnd(t),this.raw(o,"selector",t),this.current=o}spacesAndCommentsFromEnd(t){let o,r="";for(;t.length&&(o=t[t.length-1][0],!(o!=="space"&&o!=="comment"));)r=t.pop()[1]+r;return r}spacesAndCommentsFromStart(t){let o,r="";for(;t.length&&(o=t[0][0],!(o!=="space"&&o!=="comment"));)r+=t.shift()[1];return r}spacesFromEnd(t){let o,r="";for(;t.length&&(o=t[t.length-1][0],o==="space");)r=t.pop()[1]+r;return r}stringFrom(t,o){let r="";for(let n=o;n<t.length;n++)r+=t[n][1];return t.splice(o,t.length-o),r}unclosedBlock(){let t=this.current.source.start;throw this.input.error("Unclosed block",t.line,t.column)}unclosedBracket(t){throw this.input.error("Unclosed bracket",{offset:t[2]},{offset:t[2]+1})}unexpectedClose(t){throw this.input.error("Unexpected }",{offset:t[2]},{offset:t[2]+1})}unknownWord(t){throw this.input.error("Unknown word",{offset:t[0][2]},{offset:t[0][2]+t[0][1].length})}unnamedAtrule(t,o){throw this.input.error("At-rule without name",{offset:o[2]},{offset:o[2]+o[1].length})}};LW.exports=l5});var c5=oe(($He,MW)=>{"use strict";var i0e=rm(),s0e=NW(),a0e=ZD();function G1(e,t){let o=new a0e(e,t),r=new s0e(o);try{r.parse()}catch(n){throw n}return r.root}MW.exports=G1;G1.default=G1;i0e.registerParse(G1)});var VW=oe((KHe,DW)=>{"use strict";var Ay=class{constructor(t,o={}){if(this.type="warning",this.text=t,o.node&&o.node.source){let r=o.node.rangeBy(o);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.end.column}for(let r in o)this[r]=o[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};DW.exports=Ay;Ay.default=Ay});var u5=oe((YHe,FW)=>{"use strict";var l0e=VW(),Ly=class{constructor(t,o,r){this.processor=t,this.messages=[],this.root=o,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,o={}){o.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(o.plugin=this.lastPlugin.postcssPlugin);let r=new l0e(t,o);return this.messages.push(r),r}warnings(){return this.messages.filter(t=>t.type==="warning")}get content(){return this.css}};FW.exports=Ly;Ly.default=Ly});var jW=oe((ZHe,zW)=>{"use strict";var c0e=QD(),u0e=D1(),qHe=t5(),d0e=c5(),f0e=u5(),Ny=class{constructor(t,o,r){o=o.toString(),this.stringified=!1,this._processor=t,this._css=o,this._opts=r,this._map=void 0;let n,i=u0e;this.result=new f0e(this._processor,n,this._opts),this.result.css=o;let s=this;Object.defineProperty(this.result,"root",{get(){return s.root}});let a=new c0e(i,n,this._opts,o);if(a.isMap()){let[c,u]=a.generate();c&&(this.result.css=c),u&&(this.result.map=u)}else a.clearAnnotation(),this.result.css=a.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}sync(){if(this.error)throw this.error;return this.result}then(t,o){return this.async().then(t,o)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let t,o=d0e;try{t=o(this._css,this._opts)}catch(r){this.error=r}if(this.error)throw this.error;return this._root=t,t}get[Symbol.toStringTag](){return"NoWorkResult"}};zW.exports=Ny;Ny.default=Ny});var d5=oe((XHe,GW)=>{"use strict";var m0e=rm(),UW,HW,nm=class extends m0e{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new UW(new HW,this,t).stringify()}};nm.registerLazyResult=e=>{UW=e};nm.registerProcessor=e=>{HW=e};GW.exports=nm;nm.default=nm});var qW=oe((JHe,YW)=>{"use strict";var{isClean:xa,my:p0e}=V1(),h0e=QD(),g0e=D1(),b0e=rm(),k0e=d5(),QHe=t5(),WW=u5(),v0e=c5(),y0e=H1(),S0e={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},_0e={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},x0e={Once:!0,postcssPlugin:!0,prepare:!0},zh=0;function My(e){return typeof e=="object"&&typeof e.then=="function"}function KW(e){let t=!1,o=S0e[e.type];return e.type==="decl"?t=e.prop.toLowerCase():e.type==="atrule"&&(t=e.name.toLowerCase()),t&&e.append?[o,o+"-"+t,zh,o+"Exit",o+"Exit-"+t]:t?[o,o+"-"+t,o+"Exit",o+"Exit-"+t]:e.append?[o,zh,o+"Exit"]:[o,o+"Exit"]}function $W(e){let t;return e.type==="document"?t=["Document",zh,"DocumentExit"]:e.type==="root"?t=["Root",zh,"RootExit"]:t=KW(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function f5(e){return e[xa]=!1,e.nodes&&e.nodes.forEach(t=>f5(t)),e}var m5={},zu=class e{constructor(t,o,r){this.stringified=!1,this.processed=!1;let n;if(typeof o=="object"&&o!==null&&(o.type==="root"||o.type==="document"))n=f5(o);else if(o instanceof e||o instanceof WW)n=f5(o.root),o.map&&(typeof r.map>"u"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=o.map);else{let i=v0e;r.syntax&&(i=r.syntax.parse),r.parser&&(i=r.parser),i.parse&&(i=i.parse);try{n=i(o,r)}catch(s){this.processed=!0,this.error=s}n&&!n[p0e]&&b0e.rebuild(n)}this.result=new WW(t,n,r),this.helpers={...m5,postcss:m5,result:this.result},this.plugins=this.processor.plugins.map(i=>typeof i=="object"&&i.prepare?{...i,...i.prepare(this.result)}:i)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(t,o){let r=this.result.lastPlugin;try{o&&o.addToError(t),this.error=t,t.name==="CssSyntaxError"&&!t.plugin?(t.plugin=r.postcssPlugin,t.setMessage()):r.postcssVersion}catch(n){console&&console.error&&console.error(n)}return t}prepareVisitors(){this.listeners={};let t=(o,r,n)=>{this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push([o,n])};for(let o of this.plugins)if(typeof o=="object")for(let r in o){if(!_0e[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${o.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!x0e[r])if(typeof o[r]=="object")for(let n in o[r])n==="*"?t(o,r,o[r][n]):t(o,r+"-"+n.toLowerCase(),o[r][n]);else typeof o[r]=="function"&&t(o,r,o[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let t=0;t<this.plugins.length;t++){let o=this.plugins[t],r=this.runOnRoot(o);if(My(r))try{await r}catch(n){throw this.handleError(n)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[xa];){t[xa]=!0;let o=[$W(t)];for(;o.length>0;){let r=this.visitTick(o);if(My(r))try{await r}catch(n){let i=o[o.length-1].node;throw this.handleError(n,i)}}}if(this.listeners.OnceExit)for(let[o,r]of this.listeners.OnceExit){this.result.lastPlugin=o;try{if(t.type==="document"){let n=t.nodes.map(i=>r(i,this.helpers));await Promise.all(n)}else await r(t,this.helpers)}catch(n){throw this.handleError(n)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{if(typeof t=="object"&&t.Once){if(this.result.root.type==="document"){let o=this.result.root.nodes.map(r=>t.Once(r,this.helpers));return My(o[0])?Promise.all(o):o}return t.Once(this.result.root,this.helpers)}else if(typeof t=="function")return t(this.result.root,this.result)}catch(o){throw this.handleError(o)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let t=this.result.opts,o=g0e;t.syntax&&(o=t.syntax.stringify),t.stringifier&&(o=t.stringifier),o.stringify&&(o=o.stringify);let n=new h0e(o,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let t of this.plugins){let o=this.runOnRoot(t);if(My(o))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[xa];)t[xa]=!0,this.walkSync(t);if(this.listeners.OnceExit)if(t.type==="document")for(let o of t.nodes)this.visitSync(this.listeners.OnceExit,o);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(t,o){return this.async().then(t,o)}toString(){return this.css}visitSync(t,o){for(let[r,n]of t){this.result.lastPlugin=r;let i;try{i=n(o,this.helpers)}catch(s){throw this.handleError(s,o.proxyOf)}if(o.type!=="root"&&o.type!=="document"&&!o.parent)return!0;if(My(i))throw this.getAsyncError()}}visitTick(t){let o=t[t.length-1],{node:r,visitors:n}=o;if(r.type!=="root"&&r.type!=="document"&&!r.parent){t.pop();return}if(n.length>0&&o.visitorIndex<n.length){let[s,a]=n[o.visitorIndex];o.visitorIndex+=1,o.visitorIndex===n.length&&(o.visitors=[],o.visitorIndex=0),this.result.lastPlugin=s;try{return a(r.toProxy(),this.helpers)}catch(c){throw this.handleError(c,r)}}if(o.iterator!==0){let s=o.iterator,a;for(;a=r.nodes[r.indexes[s]];)if(r.indexes[s]+=1,!a[xa]){a[xa]=!0,t.push($W(a));return}o.iterator=0,delete r.indexes[s]}let i=o.events;for(;o.eventIndex<i.length;){let s=i[o.eventIndex];if(o.eventIndex+=1,s===zh){r.nodes&&r.nodes.length&&(r[xa]=!0,o.iterator=r.getIterator());return}else if(this.listeners[s]){o.visitors=this.listeners[s];return}}t.pop()}walkSync(t){t[xa]=!0;let o=KW(t);for(let r of o)if(r===zh)t.nodes&&t.each(n=>{n[xa]||this.walkSync(n)});else{let n=this.listeners[r];if(n&&this.visitSync(n,t.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};zu.registerPostcss=e=>{m5=e};YW.exports=zu;zu.default=zu;y0e.registerLazyResult(zu);k0e.registerLazyResult(zu)});var XW=oe((e8e,ZW)=>{"use strict";var w0e=jW(),C0e=qW(),B0e=d5(),E0e=H1(),im=class{constructor(t=[]){this.version="8.4.38",this.plugins=this.normalize(t)}normalize(t){let o=[];for(let r of t)if(r.postcss===!0?r=r():r.postcss&&(r=r.postcss),typeof r=="object"&&Array.isArray(r.plugins))o=o.concat(r.plugins);else if(typeof r=="object"&&r.postcssPlugin)o.push(r);else if(typeof r=="function")o.push(r);else if(!(typeof r=="object"&&(r.parse||r.stringify)))throw new Error(r+" is not a PostCSS plugin");return o}process(t,o={}){return!this.plugins.length&&!o.parser&&!o.stringifier&&!o.syntax?new w0e(this,t,o):new C0e(this,t,o)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}};ZW.exports=im;im.default=im;E0e.registerProcessor(im);B0e.registerProcessor(im)});var e$=oe((t8e,JW)=>{JW.exports=function(t){let o=t.prefix,r=/\s+$/.test(o)?o:`${o} `,n=t.ignoreFiles?[].concat(t.ignoreFiles):[],i=t.includeFiles?[].concat(t.includeFiles):[];return function(s){n.length&&s.source.input.file&&QW(s.source.input.file,n)||i.length&&s.source.input.file&&!QW(s.source.input.file,i)||s.walkRules(a=>{let c=["keyframes","-webkit-keyframes","-moz-keyframes","-o-keyframes","-ms-keyframes"];a.parent&&c.includes(a.parent.name)||(a.selectors=a.selectors.map(u=>t.exclude&&T0e(u,t.exclude)?u:t.transform?t.transform(o,u,r+u,s.source.input.file,a):r+u))})}};function QW(e,t){return t.some(o=>o instanceof RegExp?o.test(e):e.includes(o))}function T0e(e,t){return t.some(o=>o instanceof RegExp?o.test(e):e===o)}});var o$=oe((o8e,t$)=>{var p5=40,h5=41,W1=39,g5=34,b5=92,jh=47,k5=44,v5=58,$1=42,I0e=117,P0e=85,R0e=43,O0e=/^[a-f0-9?-]+$/i;t$.exports=function(e){for(var t=[],o=e,r,n,i,s,a,c,u,d,f=0,m=o.charCodeAt(f),h=o.length,p=[{nodes:t}],g=0,b,v="",k="",y="";f<h;)if(m<=32){r=f;do r+=1,m=o.charCodeAt(r);while(m<=32);s=o.slice(f,r),i=t[t.length-1],m===h5&&g?y=s:i&&i.type==="div"?(i.after=s,i.sourceEndIndex+=s.length):m===k5||m===v5||m===jh&&o.charCodeAt(r+1)!==$1&&(!b||b&&b.type==="function"&&b.value!=="calc")?k=s:t.push({type:"space",sourceIndex:f,sourceEndIndex:r,value:s}),f=r}else if(m===W1||m===g5){r=f,n=m===W1?"'":'"',s={type:"string",sourceIndex:f,quote:n};do if(a=!1,r=o.indexOf(n,r+1),~r)for(c=r;o.charCodeAt(c-1)===b5;)c-=1,a=!a;else o+=n,r=o.length-1,s.unclosed=!0;while(a);s.value=o.slice(f+1,r),s.sourceEndIndex=s.unclosed?r:r+1,t.push(s),f=r+1,m=o.charCodeAt(f)}else if(m===jh&&o.charCodeAt(f+1)===$1)r=o.indexOf("*/",f),s={type:"comment",sourceIndex:f,sourceEndIndex:r+2},r===-1&&(s.unclosed=!0,r=o.length,s.sourceEndIndex=r),s.value=o.slice(f+2,r),t.push(s),f=r+2,m=o.charCodeAt(f);else if((m===jh||m===$1)&&b&&b.type==="function"&&b.value==="calc")s=o[f],t.push({type:"word",sourceIndex:f-k.length,sourceEndIndex:f+s.length,value:s}),f+=1,m=o.charCodeAt(f);else if(m===jh||m===k5||m===v5)s=o[f],t.push({type:"div",sourceIndex:f-k.length,sourceEndIndex:f+s.length,value:s,before:k,after:""}),k="",f+=1,m=o.charCodeAt(f);else if(p5===m){r=f;do r+=1,m=o.charCodeAt(r);while(m<=32);if(d=f,s={type:"function",sourceIndex:f-v.length,value:v,before:o.slice(d+1,r)},f=r,v==="url"&&m!==W1&&m!==g5){r-=1;do if(a=!1,r=o.indexOf(")",r+1),~r)for(c=r;o.charCodeAt(c-1)===b5;)c-=1,a=!a;else o+=")",r=o.length-1,s.unclosed=!0;while(a);u=r;do u-=1,m=o.charCodeAt(u);while(m<=32);d<u?(f!==u+1?s.nodes=[{type:"word",sourceIndex:f,sourceEndIndex:u+1,value:o.slice(f,u+1)}]:s.nodes=[],s.unclosed&&u+1!==r?(s.after="",s.nodes.push({type:"space",sourceIndex:u+1,sourceEndIndex:r,value:o.slice(u+1,r)})):(s.after=o.slice(u+1,r),s.sourceEndIndex=r)):(s.after="",s.nodes=[]),f=r+1,s.sourceEndIndex=s.unclosed?r:f,m=o.charCodeAt(f),t.push(s)}else g+=1,s.after="",s.sourceEndIndex=f+1,t.push(s),p.push(s),t=s.nodes=[],b=s;v=""}else if(h5===m&&g)f+=1,m=o.charCodeAt(f),b.after=y,b.sourceEndIndex+=y.length,y="",g-=1,p[p.length-1].sourceEndIndex=f,p.pop(),b=p[g],t=b.nodes;else{r=f;do m===b5&&(r+=1),r+=1,m=o.charCodeAt(r);while(r<h&&!(m<=32||m===W1||m===g5||m===k5||m===v5||m===jh||m===p5||m===$1&&b&&b.type==="function"&&b.value==="calc"||m===jh&&b.type==="function"&&b.value==="calc"||m===h5&&g));s=o.slice(f,r),p5===m?v=s:(I0e===s.charCodeAt(0)||P0e===s.charCodeAt(0))&&R0e===s.charCodeAt(1)&&O0e.test(s.slice(2))?t.push({type:"unicode-range",sourceIndex:f,sourceEndIndex:r,value:s}):t.push({type:"word",sourceIndex:f,sourceEndIndex:r,value:s}),f=r}for(f=p.length-1;f;f-=1)p[f].unclosed=!0,p[f].sourceEndIndex=o.length;return p[0].nodes}});var n$=oe((r8e,r$)=>{r$.exports=function e(t,o,r){var n,i,s,a;for(n=0,i=t.length;n<i;n+=1)s=t[n],r||(a=o(s,n,t)),a!==!1&&s.type==="function"&&Array.isArray(s.nodes)&&e(s.nodes,o,r),r&&o(s,n,t)}});var l$=oe((n8e,a$)=>{function i$(e,t){var o=e.type,r=e.value,n,i;return t&&(i=t(e))!==void 0?i:o==="word"||o==="space"?r:o==="string"?(n=e.quote||"",n+r+(e.unclosed?"":n)):o==="comment"?"/*"+r+(e.unclosed?"":"*/"):o==="div"?(e.before||"")+r+(e.after||""):Array.isArray(e.nodes)?(n=s$(e.nodes,t),o!=="function"?n:r+"("+(e.before||"")+n+(e.after||"")+(e.unclosed?"":")")):r}function s$(e,t){var o,r;if(Array.isArray(e)){for(o="",r=e.length-1;~r;r-=1)o=i$(e[r],t)+o;return o}return i$(e,t)}a$.exports=s$});var u$=oe((i8e,c$)=>{var K1=45,Y1=43,y5=46,A0e=101,L0e=69;function N0e(e){var t=e.charCodeAt(0),o;if(t===Y1||t===K1){if(o=e.charCodeAt(1),o>=48&&o<=57)return!0;var r=e.charCodeAt(2);return o===y5&&r>=48&&r<=57}return t===y5?(o=e.charCodeAt(1),o>=48&&o<=57):t>=48&&t<=57}c$.exports=function(e){var t=0,o=e.length,r,n,i;if(o===0||!N0e(e))return!1;for(r=e.charCodeAt(t),(r===Y1||r===K1)&&t++;t<o&&(r=e.charCodeAt(t),!(r<48||r>57));)t+=1;if(r=e.charCodeAt(t),n=e.charCodeAt(t+1),r===y5&&n>=48&&n<=57)for(t+=2;t<o&&(r=e.charCodeAt(t),!(r<48||r>57));)t+=1;if(r=e.charCodeAt(t),n=e.charCodeAt(t+1),i=e.charCodeAt(t+2),(r===A0e||r===L0e)&&(n>=48&&n<=57||(n===Y1||n===K1)&&i>=48&&i<=57))for(t+=n===Y1||n===K1?3:2;t<o&&(r=e.charCodeAt(t),!(r<48||r>57));)t+=1;return{number:e.slice(0,t),unit:e.slice(t)}}});var p$=oe((s8e,m$)=>{var M0e=o$(),d$=n$(),f$=l$();function ju(e){return this instanceof ju?(this.nodes=M0e(e),this):new ju(e)}ju.prototype.toString=function(){return Array.isArray(this.nodes)?f$(this.nodes):""};ju.prototype.walk=function(e,t){return d$(this.nodes,e,t),this};ju.unit=u$();ju.walk=d$;ju.stringify=f$;m$.exports=ju});var g$=oe((a8e,S5)=>{var h$=p$();S5.exports=e=>{let o=Object.assign({skipHostRelativeUrls:!0},e);return{postcssPlugin:"rebaseUrl",Declaration(r){let n=h$(r.value),i=!1;n.walk(s=>{if(s.type!=="function"||s.value!=="url")return;let a=s.nodes[0].value,c=new URL(a,e.rootUrl);return c.pathname===a&&o.skipHostRelativeUrls||(s.nodes[0].value=c.toString(),i=!0),!1}),i&&(r.value=h$.stringify(n))}}};S5.exports.postcss=!0});var I$=oe((S8e,T$)=>{T$.exports=window.wp.priorityQueue});var F5=oe((p9e,TK)=>{TK.exports=window.wp.blob});var Jy=oe((VWe,DY)=>{DY.exports=window.wp.isShallowEqual});var XE=oe((Kqe,TX)=>{TX.exports=window.wp.tokenList});var MV=oe((iZe,UX)=>{"use strict";var k1e=function(t){return v1e(t)&&!y1e(t)};function v1e(e){return!!e&&typeof e=="object"}function y1e(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||x1e(e)}var S1e=typeof Symbol=="function"&&Symbol.for,_1e=S1e?Symbol.for("react.element"):60103;function x1e(e){return e.$$typeof===_1e}function w1e(e){return Array.isArray(e)?[]:{}}function xS(e,t){return t.clone!==!1&&t.isMergeableObject(e)?Rg(w1e(e),e,t):e}function C1e(e,t,o){return e.concat(t).map(function(r){return xS(r,o)})}function B1e(e,t){if(!t.customMerge)return Rg;var o=t.customMerge(e);return typeof o=="function"?o:Rg}function E1e(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function zX(e){return Object.keys(e).concat(E1e(e))}function jX(e,t){try{return t in e}catch{return!1}}function T1e(e,t){return jX(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function I1e(e,t,o){var r={};return o.isMergeableObject(e)&&zX(e).forEach(function(n){r[n]=xS(e[n],o)}),zX(t).forEach(function(n){T1e(e,n)||(jX(e,n)&&o.isMergeableObject(t[n])?r[n]=B1e(n,o)(e[n],t[n],o):r[n]=xS(t[n],o))}),r}function Rg(e,t,o){o=o||{},o.arrayMerge=o.arrayMerge||C1e,o.isMergeableObject=o.isMergeableObject||k1e,o.cloneUnlessOtherwiseSpecified=xS;var r=Array.isArray(t),n=Array.isArray(e),i=r===n;return i?r?o.arrayMerge(e,t,o):I1e(e,t,o):xS(t,o)}Rg.all=function(t,o){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,n){return Rg(r,n,o)},{})};var P1e=Rg;UX.exports=P1e});var ZQ=oe((NQe,qQ)=>{qQ.exports=window.wp.commands});var pc=oe((mot,mte)=>{mte.exports=window.wp.date});var $te=oe((ert,Wte)=>{var zte=!1,Gm,N3,M3,gI,bI,jte,kI,D3,V3,F3,Ute,z3,j3,Hte,Gte;function En(){if(!zte){zte=!0;var e=navigator.userAgent,t=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e),o=/(Mac OS X)|(Windows)|(Linux)/.exec(e);if(z3=/\b(iPhone|iP[ao]d)/.exec(e),j3=/\b(iP[ao]d)/.exec(e),F3=/Android/i.exec(e),Hte=/FBAN\/\w+;/i.exec(e),Gte=/Mobile/i.exec(e),Ute=!!/Win64/.exec(e),t){Gm=t[1]?parseFloat(t[1]):t[5]?parseFloat(t[5]):NaN,Gm&&document&&document.documentMode&&(Gm=document.documentMode);var r=/(?:Trident\/(\d+.\d+))/.exec(e);jte=r?parseFloat(r[1])+4:Gm,N3=t[2]?parseFloat(t[2]):NaN,M3=t[3]?parseFloat(t[3]):NaN,gI=t[4]?parseFloat(t[4]):NaN,gI?(t=/(?:Chrome\/(\d+\.\d+))/.exec(e),bI=t&&t[1]?parseFloat(t[1]):NaN):bI=NaN}else Gm=N3=M3=bI=gI=NaN;if(o){if(o[1]){var n=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);kI=n?parseFloat(n[1].replace("_",".")):!0}else kI=!1;D3=!!o[2],V3=!!o[3]}else kI=D3=V3=!1}}var U3={ie:function(){return En()||Gm},ieCompatibilityMode:function(){return En()||jte>Gm},ie64:function(){return U3.ie()&&Ute},firefox:function(){return En()||N3},opera:function(){return En()||M3},webkit:function(){return En()||gI},safari:function(){return U3.webkit()},chrome:function(){return En()||bI},windows:function(){return En()||D3},osx:function(){return En()||kI},linux:function(){return En()||V3},iphone:function(){return En()||z3},mobile:function(){return En()||z3||j3||F3||Gte},nativeApp:function(){return En()||Hte},android:function(){return En()||F3},ipad:function(){return En()||j3}};Wte.exports=U3});var Yte=oe((trt,Kte)=>{"use strict";var vI=!!(typeof window<"u"&&window.document&&window.document.createElement),yEe={canUseDOM:vI,canUseWorkers:typeof Worker<"u",canUseEventListeners:vI&&!!(window.addEventListener||window.attachEvent),canUseViewport:vI&&!!window.screen,isInWorker:!vI};Kte.exports=yEe});var Qte=oe((ort,Xte)=>{"use strict";var qte=Yte(),Zte;qte.canUseDOM&&(Zte=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0);function SEe(e,t){if(!qte.canUseDOM||t&&!("addEventListener"in document))return!1;var o="on"+e,r=o in document;if(!r){var n=document.createElement("div");n.setAttribute(o,"return;"),r=typeof n[o]=="function"}return!r&&Zte&&e==="wheel"&&(r=document.implementation.hasFeature("Events.wheel","3.0")),r}Xte.exports=SEe});var noe=oe((rrt,roe)=>{"use strict";var _Ee=$te(),xEe=Qte(),Jte=10,eoe=40,toe=800;function ooe(e){var t=0,o=0,r=0,n=0;return"detail"in e&&(o=e.detail),"wheelDelta"in e&&(o=-e.wheelDelta/120),"wheelDeltaY"in e&&(o=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=o,o=0),r=t*Jte,n=o*Jte,"deltaY"in e&&(n=e.deltaY),"deltaX"in e&&(r=e.deltaX),(r||n)&&e.deltaMode&&(e.deltaMode==1?(r*=eoe,n*=eoe):(r*=toe,n*=toe)),r&&!t&&(t=r<1?-1:1),n&&!o&&(o=n<1?-1:1),{spinX:t,spinY:o,pixelX:r,pixelY:n}}ooe.getEventType=function(){return _Ee.firefox()?"DOMMouseScroll":xEe("wheel")?"wheel":"mousewheel"};roe.exports=ooe});var soe=oe((nrt,ioe)=>{ioe.exports=noe()});var Nre=oe((qnt,Lre)=>{"use strict";Lre.exports=function e(t,o){if(t===o)return!0;if(t&&o&&typeof t=="object"&&typeof o=="object"){if(t.constructor!==o.constructor)return!1;var r,n,i;if(Array.isArray(t)){if(r=t.length,r!=o.length)return!1;for(n=r;n--!==0;)if(!e(t[n],o[n]))return!1;return!0}if(t.constructor===RegExp)return t.source===o.source&&t.flags===o.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===o.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===o.toString();if(i=Object.keys(t),r=i.length,r!==Object.keys(o).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(o,i[n]))return!1;for(n=r;n--!==0;){var s=i[n];if(!e(t[s],o[s]))return!1}return!0}return t!==t&&o!==o}});var dLe={};Ip(dLe,{AlignmentControl:()=>$w,AlignmentToolbar:()=>wU,Autocomplete:()=>ZU,BlockAlignmentControl:()=>cC,BlockAlignmentToolbar:()=>kH,BlockBindingsAttributeControl:()=>$v,BlockBindingsSourceFieldsList:()=>Wv,BlockBreadcrumb:()=>jH,BlockCanvas:()=>tJ,BlockColorsStyleSelector:()=>iJ,BlockContextProvider:()=>g0,BlockControls:()=>Mt,BlockEdit:()=>Fw,BlockEditorKeyboardShortcuts:()=>g1,BlockEditorProvider:()=>U9,BlockFormatControls:()=>bV,BlockIcon:()=>Ae,BlockInspector:()=>Hae,BlockList:()=>Gh,BlockMover:()=>kE,BlockNavigationDropdown:()=>pee,BlockPopover:()=>vY,BlockPreview:()=>vn,BlockSelectionClearer:()=>OY,BlockSettingsMenu:()=>GE,BlockSettingsMenuControls:()=>FE,BlockStyles:()=>Qg,BlockTitle:()=>Yv,BlockToolbar:()=>MQ,BlockTools:()=>RS,BlockVerticalAlignmentControl:()=>iC,BlockVerticalAlignmentToolbar:()=>Fee,ButtonBlockAppender:()=>Qu,ButtonBlockerAppender:()=>cY,ColorPalette:()=>ate,ColorPaletteControl:()=>ute,ContrastChecker:()=>QT,CopyHandler:()=>$ae,DefaultBlockAppender:()=>cg,DimensionControl:()=>lb,FontSizePicker:()=>fM,HeadingLevelDropdown:()=>Bee,HeightControl:()=>Fte,InnerBlocks:()=>tS,Inserter:()=>Ui,InspectorAdvancedControls:()=>rd,InspectorControls:()=>fe,JustifyContentControl:()=>ah,JustifyToolbar:()=>qoe,LineHeightControl:()=>HI,LinkControl:()=>Pd,MediaPlaceholder:()=>gne,MediaReplaceFlow:()=>_b,MediaUpload:()=>qu,MediaUploadCheck:()=>Ds,MultiSelectScrollIntoView:()=>Zae,NavigableToolbar:()=>Bg,ObserveTyping:()=>rq,PanelColorSettings:()=>kne,PlainText:()=>gie,RecursionProvider:()=>f4,RichText:()=>Eb,RichTextShortcut:()=>wF,RichTextToolbarButton:()=>BF,SETTINGS_DEFAULTS:()=>Kk,SkipToSelectedBlock:()=>kP,ToolSelector:()=>cle,Typewriter:()=>ele,URLInput:()=>Td,URLInputButton:()=>Cie,URLPopover:()=>Ad,Warning:()=>pu,WritingFlow:()=>E1,__experimentalBlockAlignmentMatrixControl:()=>AH,__experimentalBlockFullHeightAligmentControl:()=>IH,__experimentalBlockPatternSetup:()=>Mee,__experimentalBlockPatternsList:()=>Ca,__experimentalBlockVariationPicker:()=>Eee,__experimentalBlockVariationTransforms:()=>WT,__experimentalBorderRadiusControl:()=>ZT,__experimentalColorGradientControl:()=>_d,__experimentalColorGradientSettingsDropdown:()=>fI,__experimentalDateFormatPicker:()=>pte,__experimentalDuotoneControl:()=>eI,__experimentalFontAppearanceControl:()=>oI,__experimentalFontFamilyControl:()=>rI,__experimentalGetBorderClassesAndStyles:()=>sO,__experimentalGetColorClassesAndStyles:()=>aO,__experimentalGetElementClassName:()=>lLe,__experimentalGetGapCSSValue:()=>mr,__experimentalGetGradientClass:()=>th,__experimentalGetGradientObjectByGradientValue:()=>pU,__experimentalGetShadowClassesAndStyles:()=>Yz,__experimentalGetSpacingClassesAndStyles:()=>Xz,__experimentalImageEditor:()=>Uoe,__experimentalImageSizeControl:()=>$oe,__experimentalImageURLInputUI:()=>Oie,__experimentalInspectorPopoverHeader:()=>y2,__experimentalLetterSpacingControl:()=>iI,__experimentalLibrary:()=>Yae,__experimentalLinkControl:()=>UI,__experimentalLinkControlSearchInput:()=>yre,__experimentalLinkControlSearchItem:()=>are,__experimentalLinkControlSearchResults:()=>mre,__experimentalListView:()=>zT,__experimentalPanelColorGradientSettings:()=>pI,__experimentalPreviewOptions:()=>Yie,__experimentalPublishDateTimePicker:()=>ile,__experimentalRecursionProvider:()=>tle,__experimentalResponsiveBlockControl:()=>Sie,__experimentalSpacingSizesControl:()=>Db,__experimentalTextDecorationControl:()=>aI,__experimentalTextTransformControl:()=>cI,__experimentalUnitControl:()=>xie,__experimentalUseBlockOverlayActive:()=>HH,__experimentalUseBlockPreview:()=>L$,__experimentalUseBorderProps:()=>Kz,__experimentalUseColorProps:()=>Zz,__experimentalUseCustomSides:()=>Cz,__experimentalUseGradient:()=>Yke,__experimentalUseHasRecursion:()=>ole,__experimentalUseMultipleOriginColorsAndGradients:()=>wd,__experimentalUseResizeCanvas:()=>qie,__experimentalWritingModeControl:()=>dI,__unstableBlockSettingsMenuFirstItem:()=>TE,__unstableBlockToolbarLastItem:()=>xE,__unstableEditorStyles:()=>Nl,__unstableIframe:()=>Mh,__unstableInserterMenuExtension:()=>yB,__unstableRichTextInputEvent:()=>EF,__unstableUseBlockSelectionClearer:()=>hm,__unstableUseClipboardHandler:()=>Wae,__unstableUseMouseMoveTypingReset:()=>rS,__unstableUseTypewriter:()=>c4,__unstableUseTypingObserver:()=>nS,createCustomColorsHOC:()=>fU,getColorClassName:()=>_i,getColorObjectByAttributeValues:()=>da,getColorObjectByColorValue:()=>p0,getComputedFluidTypographyValue:()=>bU,getCustomValueFromPreset:()=>JU,getDimensionsClassesAndStyles:()=>$z,getFontSize:()=>oh,getFontSizeClass:()=>hu,getFontSizeObjectByValue:()=>dM,getGradientSlugByValue:()=>hU,getGradientValueBySlug:()=>Gw,getPxFromCssUnit:()=>xme,getSpacingPresetCssVar:()=>jv,getTypographyClassesAndStyles:()=>Qz,isValueSpacingPreset:()=>nC,privateApis:()=>a6,store:()=>_,storeConfig:()=>Qp,transformStyles:()=>Uh,useBlockBindingsUtils:()=>El,useBlockCommands:()=>_T,useBlockDisplayInformation:()=>Tt,useBlockEditContext:()=>Ie,useBlockEditingMode:()=>ao,useBlockProps:()=>ky,useCachedTruthy:()=>Jz,useHasRecursion:()=>m4,useInnerBlocksProps:()=>ym,useSetting:()=>lU,useSettings:()=>me,useStyleOverride:()=>Qn,withColorContext:()=>XT,withColors:()=>mU,withFontSizes:()=>_U});function c6(e){var t,o,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var n=e.length;for(t=0;t<n;t++)e[t]&&(o=c6(e[t]))&&(r&&(r+=" "),r+=o)}else for(o in e)e[o]&&(r&&(r+=" "),r+=o);return r}function Zme(){for(var e,t,o=0,r="",n=arguments.length;o<n;o++)(e=arguments[o])&&(t=c6(e))&&(r&&(r+=" "),r+=t);return r}var V=Zme;var ule=l($(),1),as=l(R(),1),x2=l(F(),1),b4=l(Z(),1),w_=l(ut(),1);var c0=l(R(),1),bs=Symbol("mayDisplayControls"),Pp=Symbol("mayDisplayParentControls"),$c=Symbol("mayDisplayPatternEditingControls"),u0=Symbol("blockEditingMode"),Rp=Symbol("blockBindings"),d0=Symbol("isPreviewMode"),Hk=Symbol("isInListViewBlockSupportTree"),gO={name:"",isSelected:!1},bO=(0,c0.createContext)(gO);bO.displayName="BlockEditContext";var{Provider:f0}=bO;function Ie(){return(0,c0.useContext)(bO)}var Xme={grad:.9,turn:360,rad:360/(2*Math.PI)},ml=function(e){return typeof e=="string"?e.length>0:typeof e=="number"},Zo=function(e,t,o){return t===void 0&&(t=0),o===void 0&&(o=Math.pow(10,t)),Math.round(o*e)/o+0},Si=function(e,t,o){return t===void 0&&(t=0),o===void 0&&(o=1),e>o?o:e>t?e:t},_6=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},h6=function(e){return{r:Si(e.r,0,255),g:Si(e.g,0,255),b:Si(e.b,0,255),a:Si(e.a)}},kO=function(e){return{r:Zo(e.r),g:Zo(e.g),b:Zo(e.b),a:Zo(e.a,3)}},Qme=/^#([0-9a-f]{3,8})$/i,m0=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},x6=function(e){var t=e.r,o=e.g,r=e.b,n=e.a,i=Math.max(t,o,r),s=i-Math.min(t,o,r),a=s?i===t?(o-r)/s:i===o?2+(r-t)/s:4+(t-o)/s:0;return{h:60*(a<0?a+6:a),s:i?s/i*100:0,v:i/255*100,a:n}},w6=function(e){var t=e.h,o=e.s,r=e.v,n=e.a;t=t/360*6,o/=100,r/=100;var i=Math.floor(t),s=r*(1-o),a=r*(1-(t-i)*o),c=r*(1-(1-t+i)*o),u=i%6;return{r:255*[r,a,s,s,c,r][u],g:255*[c,r,r,a,s,s][u],b:255*[s,s,c,r,r,a][u],a:n}},g6=function(e){return{h:_6(e.h),s:Si(e.s,0,100),l:Si(e.l,0,100),a:Si(e.a)}},b6=function(e){return{h:Zo(e.h),s:Zo(e.s),l:Zo(e.l),a:Zo(e.a,3)}},k6=function(e){return w6((o=(t=e).s,{h:t.h,s:(o*=((r=t.l)<50?r:100-r)/100)>0?2*o/(r+o)*100:0,v:r+o,a:t.a}));var t,o,r},Gk=function(e){return{h:(t=x6(e)).h,s:(n=(200-(o=t.s))*(r=t.v)/100)>0&&n<200?o*r/100/(n<=100?n:200-n)*100:0,l:n/2,a:t.a};var t,o,r,n},Jme=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,epe=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,tpe=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ope=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,SO={string:[[function(e){var t=Qme.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?Zo(parseInt(e[3]+e[3],16)/255,2):1}:e.length===6||e.length===8?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:e.length===8?Zo(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=tpe.exec(e)||ope.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:h6({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=Jme.exec(e)||epe.exec(e);if(!t)return null;var o,r,n=g6({h:(o=t[1],r=t[2],r===void 0&&(r="deg"),Number(o)*(Xme[r]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return k6(n)},"hsl"]],object:[[function(e){var t=e.r,o=e.g,r=e.b,n=e.a,i=n===void 0?1:n;return ml(t)&&ml(o)&&ml(r)?h6({r:Number(t),g:Number(o),b:Number(r),a:Number(i)}):null},"rgb"],[function(e){var t=e.h,o=e.s,r=e.l,n=e.a,i=n===void 0?1:n;if(!ml(t)||!ml(o)||!ml(r))return null;var s=g6({h:Number(t),s:Number(o),l:Number(r),a:Number(i)});return k6(s)},"hsl"],[function(e){var t=e.h,o=e.s,r=e.v,n=e.a,i=n===void 0?1:n;if(!ml(t)||!ml(o)||!ml(r))return null;var s=(function(a){return{h:_6(a.h),s:Si(a.s,0,100),v:Si(a.v,0,100),a:Si(a.a)}})({h:Number(t),s:Number(o),v:Number(r),a:Number(i)});return w6(s)},"hsv"]]},v6=function(e,t){for(var o=0;o<t.length;o++){var r=t[o][0](e);if(r)return[r,t[o][1]]}return[null,void 0]},rpe=function(e){return typeof e=="string"?v6(e.trim(),SO.string):typeof e=="object"&&e!==null?v6(e,SO.object):[null,void 0]};var vO=function(e,t){var o=Gk(e);return{h:o.h,s:Si(o.s+100*t,0,100),l:o.l,a:o.a}},yO=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},y6=function(e,t){var o=Gk(e);return{h:o.h,s:o.s,l:Si(o.l+100*t,0,100),a:o.a}},_O=(function(){function e(t){this.parsed=rpe(t)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return this.parsed!==null},e.prototype.brightness=function(){return Zo(yO(this.rgba),2)},e.prototype.isDark=function(){return yO(this.rgba)<.5},e.prototype.isLight=function(){return yO(this.rgba)>=.5},e.prototype.toHex=function(){return t=kO(this.rgba),o=t.r,r=t.g,n=t.b,s=(i=t.a)<1?m0(Zo(255*i)):"","#"+m0(o)+m0(r)+m0(n)+s;var t,o,r,n,i,s},e.prototype.toRgb=function(){return kO(this.rgba)},e.prototype.toRgbString=function(){return t=kO(this.rgba),o=t.r,r=t.g,n=t.b,(i=t.a)<1?"rgba("+o+", "+r+", "+n+", "+i+")":"rgb("+o+", "+r+", "+n+")";var t,o,r,n,i},e.prototype.toHsl=function(){return b6(Gk(this.rgba))},e.prototype.toHslString=function(){return t=b6(Gk(this.rgba)),o=t.h,r=t.s,n=t.l,(i=t.a)<1?"hsla("+o+", "+r+"%, "+n+"%, "+i+")":"hsl("+o+", "+r+"%, "+n+"%)";var t,o,r,n,i},e.prototype.toHsv=function(){return t=x6(this.rgba),{h:Zo(t.h),s:Zo(t.s),v:Zo(t.v),a:Zo(t.a,3)};var t},e.prototype.invert=function(){return Bt({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},e.prototype.saturate=function(t){return t===void 0&&(t=.1),Bt(vO(this.rgba,t))},e.prototype.desaturate=function(t){return t===void 0&&(t=.1),Bt(vO(this.rgba,-t))},e.prototype.grayscale=function(){return Bt(vO(this.rgba,-1))},e.prototype.lighten=function(t){return t===void 0&&(t=.1),Bt(y6(this.rgba,t))},e.prototype.darken=function(t){return t===void 0&&(t=.1),Bt(y6(this.rgba,-t))},e.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},e.prototype.alpha=function(t){return typeof t=="number"?Bt({r:(o=this.rgba).r,g:o.g,b:o.b,a:t}):Zo(this.rgba.a,3);var o},e.prototype.hue=function(t){var o=Gk(this.rgba);return typeof t=="number"?Bt({h:t,s:o.s,l:o.l,a:o.a}):Zo(o.h)},e.prototype.isEqual=function(t){return this.toHex()===Bt(t).toHex()},e})(),Bt=function(e){return e instanceof _O?e:new _O(e)},S6=[],Kc=function(e){e.forEach(function(t){S6.indexOf(t)<0&&(t(_O,SO),S6.push(t))})};function Yc(e,t){var o={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},r={};for(var n in o)r[o[n]]=n;var i={};e.prototype.toName=function(s){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var a,c,u=r[this.toHex()];if(u)return u;if(s?.closest){var d=this.toRgb(),f=1/0,m="black";if(!i.length)for(var h in o)i[h]=new e(o[h]).toRgb();for(var p in o){var g=(a=d,c=i[p],Math.pow(a.r-c.r,2)+Math.pow(a.g-c.g,2)+Math.pow(a.b-c.b,2));g<f&&(f=g,m=p)}return m}},t.string.push([function(s){var a=s.toLowerCase(),c=a==="transparent"?"#0000":o[a];return c?new e(c).toRgb():null},"name"])}var xO=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},wO=function(e){return .2126*xO(e.r)+.7152*xO(e.g)+.0722*xO(e.b)};function Op(e){e.prototype.luminance=function(){return t=wO(this.rgba),(o=2)===void 0&&(o=0),r===void 0&&(r=Math.pow(10,o)),Math.round(r*t)/r+0;var t,o,r},e.prototype.contrast=function(t){t===void 0&&(t="#FFF");var o,r,n,i,s,a,c,u=t instanceof e?t:new e(t);return i=this.rgba,s=u.toRgb(),a=wO(i),c=wO(s),o=a>c?(a+.05)/(c+.05):(c+.05)/(a+.05),(r=2)===void 0&&(r=0),n===void 0&&(n=Math.pow(10,r)),Math.floor(n*o)/n+0},e.prototype.isReadable=function(t,o){return t===void 0&&(t="#FFF"),o===void 0&&(o={}),this.contrast(t)>=(a=(s=(r=o).size)===void 0?"normal":s,(i=(n=r.level)===void 0?"AA":n)==="AAA"&&a==="normal"?7:i==="AA"&&a==="large"?3:4.5);var r,n,i,s,a}}var I6=l(A(),1);var E6=l(CO(),1),{lock:T6,unlock:M}=(0,E6.__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/block-editor");Kc([Yc,Op]);var{kebabCase:npe}=M(I6.privateApis),da=(e,t,o)=>{if(t){let r=e?.find(n=>n.slug===t);if(r)return r}return{color:o}},p0=(e,t)=>e?.find(o=>o.color===t);function _i(e,t){if(!(!e||!t))return`has-${npe(t)}-${e}`}function P6(e,t){let o=Bt(t),r=({color:i})=>o.contrast(i),n=Math.max(...e.map(r));return e.find(i=>r(i)===n).color}var zw=l(R(),1),zf=l(Z(),1),uU=l(A(),1);var sU=l(F(),1),aU=l(Re(),1);var Vw=l(R(),1),Dw=l($(),1);var pl=l($(),1),F6=l(A(),1),$k=l(F(),1),vf=l(R(),1);var Ap=l(R(),1),A6=l(w(),1),h0=(0,Ap.createContext)({});h0.displayName="BlockContext";function g0({value:e,children:t}){let o=(0,Ap.useContext)(h0),r=(0,Ap.useMemo)(()=>({...o,...e}),[o,e]);return(0,A6.jsx)(h0.Provider,{value:r,children:t})}var xr=h0;var Lp=l(dn(),1);function gf(e){return e?.startsWith("#")&&(0,Lp.isValidFragment)(e)}function bf(e){return e?.startsWith("/")||e?.startsWith("./")||e?.startsWith("../")}function kf(e){if(e.includes(" "))return!1;let o=(0,Lp.getProtocol)(e),r=(0,Lp.isValidProtocol)(o),n=ipe(e),i=e?.startsWith("www.");return r||i||gf(e)||n||bf(e)}function ipe(e,t=6){let o=e.split(/[?#]/)[0];return new RegExp(`(?<=\\S)\\.(?:[a-zA-Z_]{2,${t}})(?:\\/|$)`).test(o)}var spe="__default",N6="core/pattern-overrides";function Wk(e){return e?.[spe]?.source===N6}function M6(e,t){if(Wk(e)){let o={};for(let r of t){let n=e[r]?e[r]:{source:N6};o[r]=n}return o}return e}var D6=l(R(),1),ur=(0,D6.createContext)({});ur.displayName="PrivateBlockContext";var b0=l(w(),1),ape={},lpe=e=>{let{name:t}=e,o=(0,pl.getBlockType)(t);if(!o)return null;let r=o.edit||o.save;return(0,b0.jsx)(r,{...e})},V6=(0,F6.withFilters)("editor.BlockEdit")(lpe),cpe=e=>{let{name:t,clientId:o,attributes:r,setAttributes:n}=e,i=(0,$k.useRegistry)(),s=(0,pl.getBlockType)(t),a=(0,vf.useContext)(xr),c=(0,$k.useSelect)(v=>M(v(pl.store)).getAllBlockBindingsSources(),[]),{bindableAttributes:u}=(0,vf.useContext)(ur),{blockBindings:d,context:f,hasPatternOverrides:m}=(0,vf.useMemo)(()=>{let v=s?.usesContext?Object.fromEntries(Object.entries(a).filter(([k])=>s.usesContext.includes(k))):ape;return r?.metadata?.bindings&&Object.values(r?.metadata?.bindings||{}).forEach(k=>{c[k?.source]?.usesContext?.forEach(y=>{v[y]=a[y]})}),{blockBindings:M6(r?.metadata?.bindings,u),context:v,hasPatternOverrides:Wk(r?.metadata?.bindings)}},[s?.usesContext,a,r?.metadata?.bindings,u,c]),h=(0,$k.useSelect)(v=>{if(!d)return r;let k={},y=new Map;for(let[S,x]of Object.entries(d)){let{source:C,args:B}=x,I=c[C];!I||!u?.includes(S)||y.set(I,{...y.get(I),[S]:{args:B}})}if(y.size)for(let[S,x]of y){let C={};S.getValues?C=S.getValues({select:v,context:f,clientId:o,bindings:x}):Object.keys(x).forEach(B=>{C[B]=S.label});for(let[B,I]of Object.entries(C))B==="url"&&(!I||!kf(I))?k[B]=null:k[B]=I}return{...r,...k}},[r,u,d,o,f,c]),p=(0,vf.useCallback)(v=>{if(!d){n(v);return}i.batch(()=>{let k={...v},y=new Map;for(let[x,C]of Object.entries(k)){if(!d[x]||!u?.includes(x))continue;let B=d[x],I=c[B?.source];I?.setValues&&(y.set(I,{...y.get(I),[x]:{args:B.args,newValue:C}}),delete k[x])}if(y.size)for(let[x,C]of y)x.setValues({select:i.select,dispatch:i.dispatch,context:f,clientId:o,bindings:C});let S=!!f["pattern/overrides"];!(m&&S)&&Object.keys(k).length&&(m&&delete k.href,n(k))})},[u,d,o,f,m,n,c,i]);if(!s)return null;if(s.apiVersion>1)return(0,b0.jsx)(V6,{...e,attributes:h,context:f,setAttributes:p});let g=(0,pl.hasBlockSupport)(s,"className",!0)?(0,pl.getBlockDefaultClassName)(t):null,b=V(g,r?.className,e.className);return(0,b0.jsx)(V6,{...e,attributes:h,className:b,context:f,setAttributes:p})},z6=cpe;var rU=l($(),1),uM=l(A(),1),nU=l(F(),1),Mw=l(N(),1);var Nw=l(F(),1);var qk=l(yf(),1),TO=l(Z(),1),Zk=l(F(),1),Y6=l(Re(),1),E0=l($(),1);var Ne=l(N(),1),H6={insertUsage:{}},Kk={alignWide:!1,supportsLayout:!0,colors:[{name:(0,Ne.__)("Black"),slug:"black",color:"#000000"},{name:(0,Ne.__)("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:(0,Ne.__)("White"),slug:"white",color:"#ffffff"},{name:(0,Ne.__)("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:(0,Ne.__)("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:(0,Ne.__)("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:(0,Ne.__)("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:(0,Ne.__)("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:(0,Ne.__)("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:(0,Ne.__)("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:(0,Ne.__)("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:(0,Ne.__)("Vivid purple"),slug:"vivid-purple",color:"#9b51e0"}],fontSizes:[{name:(0,Ne._x)("Small","font size name"),size:13,slug:"small"},{name:(0,Ne._x)("Normal","font size name"),size:16,slug:"normal"},{name:(0,Ne._x)("Medium","font size name"),size:20,slug:"medium"},{name:(0,Ne._x)("Large","font size name"),size:36,slug:"large"},{name:(0,Ne._x)("Huge","font size name"),size:42,slug:"huge"}],imageDefaultSize:"large",imageSizes:[{slug:"thumbnail",name:(0,Ne.__)("Thumbnail")},{slug:"medium",name:(0,Ne.__)("Medium")},{slug:"large",name:(0,Ne.__)("Large")},{slug:"full",name:(0,Ne.__)("Full Size")}],imageEditing:!0,maxWidth:580,allowedBlockTypes:!0,maxUploadFileSize:0,allowedMimeTypes:null,canLockBlocks:!0,canEditCSS:!1,enableOpenverseMediaCategory:!0,clearBlockSelection:!0,__experimentalCanUserUseUnfilteredHTML:!1,__experimentalBlockDirectory:!1,__mobileEnablePageTemplates:!1,__experimentalBlockPatterns:[],__experimentalBlockPatternCategories:[],isPreviewMode:!1,blockInspectorAnimation:{animationParent:"core/navigation","core/navigation":{enterDirection:"leftToRight"},"core/navigation-submenu":{enterDirection:"rightToLeft"},"core/navigation-link":{enterDirection:"rightToLeft"},"core/search":{enterDirection:"rightToLeft"},"core/social-links":{enterDirection:"rightToLeft"},"core/page-list":{enterDirection:"rightToLeft"},"core/spacer":{enterDirection:"rightToLeft"},"core/home-link":{enterDirection:"rightToLeft"},"core/site-title":{enterDirection:"rightToLeft"},"core/site-logo":{enterDirection:"rightToLeft"}},generateAnchors:!1,gradients:[{name:(0,Ne.__)("Vivid cyan blue to vivid purple"),gradient:"linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)",slug:"vivid-cyan-blue-to-vivid-purple"},{name:(0,Ne.__)("Light green cyan to vivid green cyan"),gradient:"linear-gradient(135deg,rgb(122,220,180) 0%,rgb(0,208,130) 100%)",slug:"light-green-cyan-to-vivid-green-cyan"},{name:(0,Ne.__)("Luminous vivid amber to luminous vivid orange"),gradient:"linear-gradient(135deg,rgba(252,185,0,1) 0%,rgba(255,105,0,1) 100%)",slug:"luminous-vivid-amber-to-luminous-vivid-orange"},{name:(0,Ne.__)("Luminous vivid orange to vivid red"),gradient:"linear-gradient(135deg,rgba(255,105,0,1) 0%,rgb(207,46,46) 100%)",slug:"luminous-vivid-orange-to-vivid-red"},{name:(0,Ne.__)("Very light gray to cyan bluish gray"),gradient:"linear-gradient(135deg,rgb(238,238,238) 0%,rgb(169,184,195) 100%)",slug:"very-light-gray-to-cyan-bluish-gray"},{name:(0,Ne.__)("Cool to warm spectrum"),gradient:"linear-gradient(135deg,rgb(74,234,220) 0%,rgb(151,120,209) 20%,rgb(207,42,186) 40%,rgb(238,44,130) 60%,rgb(251,105,98) 80%,rgb(254,248,76) 100%)",slug:"cool-to-warm-spectrum"},{name:(0,Ne.__)("Blush light purple"),gradient:"linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)",slug:"blush-light-purple"},{name:(0,Ne.__)("Blush bordeaux"),gradient:"linear-gradient(135deg,rgb(254,205,165) 0%,rgb(254,45,45) 50%,rgb(107,0,62) 100%)",slug:"blush-bordeaux"},{name:(0,Ne.__)("Luminous dusk"),gradient:"linear-gradient(135deg,rgb(255,203,112) 0%,rgb(199,81,192) 50%,rgb(65,88,208) 100%)",slug:"luminous-dusk"},{name:(0,Ne.__)("Pale ocean"),gradient:"linear-gradient(135deg,rgb(255,245,203) 0%,rgb(182,227,212) 50%,rgb(51,167,181) 100%)",slug:"pale-ocean"},{name:(0,Ne.__)("Electric grass"),gradient:"linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)",slug:"electric-grass"},{name:(0,Ne.__)("Midnight"),gradient:"linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)",slug:"midnight"}],__unstableResolvedAssets:{styles:[],scripts:[]}};function k0(e,t,o){return[...e.slice(0,o),...Array.isArray(t)?t:[t],...e.slice(o)]}function v0(e,t,o,r=1){let n=[...e];return n.splice(t,r),k0(n,e.slice(t,t+r),o)}var xi=Symbol("globalStylesDataKey"),y0=Symbol("globalStylesLinks"),qc=Symbol("selectBlockPatternsKey"),S0=Symbol("reusableBlocksSelect"),Zc=Symbol("sectionRootClientIdKey"),_0=Symbol("mediaEditKey"),x0=Symbol("getMediaSelect"),Xc=Symbol("isIsolatedEditor"),wi=Symbol("deviceTypeKey"),w0=Symbol("isNavigationOverlayContext"),C0=Symbol("mediaUploadOnSuccess");var{isContentBlock:upe}=M(E0.privateApis),dpe=e=>e;function B0(e,t=""){let o=new Map,r=[];return o.set(t,r),e.forEach(n=>{let{clientId:i,innerBlocks:s}=n;r.push(i),B0(s,i).forEach((a,c)=>{o.set(c,a)})}),o}function BO(e,t=""){let o=[],r=[[t,e]];for(;r.length;){let[n,i]=r.shift();i.forEach(({innerBlocks:s,...a})=>{o.push([a.clientId,n]),s?.length&&r.push([a.clientId,s])})}return o}function q6(e,t=dpe){let o=[],r=[...e];for(;r.length;){let{innerBlocks:n,...i}=r.shift();r.push(...n),o.push([i.clientId,t(i)])}return o}function Z6(e){let t={},o=[...e];for(;o.length;){let{innerBlocks:r,...n}=o.shift();o.push(...r),t[n.clientId]=!0}return t}function G6(e){return q6(e,t=>{let{attributes:o,...r}=t;return r})}function W6(e){return q6(e,t=>t.attributes)}function fpe(e,t){return(0,qk.default)(Object.keys(e),Object.keys(t))}function mpe(e,t){return e.type==="UPDATE_BLOCK_ATTRIBUTES"&&t!==void 0&&t.type==="UPDATE_BLOCK_ATTRIBUTES"&&(0,qk.default)(e.clientIds,t.clientIds)&&fpe(e.attributes,t.attributes)}function $6(e,t){let o=e.tree,r=[...t],n=[...t];for(;r.length;){let i=r.shift();r.push(...i.innerBlocks),n.push(...i.innerBlocks)}for(let i of n)o.set(i.clientId,{});for(let i of n)o.set(i.clientId,Object.assign(o.get(i.clientId),{...e.byClientId.get(i.clientId),attributes:e.attributes.get(i.clientId),innerBlocks:i.innerBlocks.map(s=>o.get(s.clientId))}))}function hl(e,t,o=!1){let r=e.tree,n=new Set([]),i=new Set;for(let s of t){let a=o?s:e.parents.get(s);do if(e.controlledInnerBlocks[a]){i.add(a);break}else n.add(a),a=e.parents.get(a);while(a!==void 0)}for(let s of n)r.set(s,{...r.get(s)});for(let s of n)r.get(s).innerBlocks=(e.order.get(s)||[]).map(a=>r.get(a));for(let s of i)r.set("controlled||"+s,{innerBlocks:(e.order.get(s)||[]).map(a=>r.get(a))})}var ppe=e=>(t={},o)=>{let r=e(t,o);if(r===t)return t;switch(r.tree=t.tree?t.tree:new Map,o.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{r.tree=new Map(r.tree),$6(r,o.blocks),hl(r,o.rootClientId?[o.rootClientId]:[""],!0);break}case"UPDATE_BLOCK":r.tree=new Map(r.tree),r.tree.set(o.clientId,{...r.tree.get(o.clientId),...r.byClientId.get(o.clientId),attributes:r.attributes.get(o.clientId)}),hl(r,[o.clientId],!1);break;case"SYNC_DERIVED_BLOCK_ATTRIBUTES":case"UPDATE_BLOCK_ATTRIBUTES":{r.tree=new Map(r.tree),o.clientIds.forEach(i=>{r.tree.set(i,{...r.tree.get(i),attributes:r.attributes.get(i)})}),hl(r,o.clientIds,!1);break}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{let i=Z6(o.blocks);r.tree=new Map(r.tree),o.replacedClientIds.forEach(a=>{r.tree.delete(a),i[a]||r.tree.delete("controlled||"+a)}),$6(r,o.blocks),hl(r,o.blocks.map(a=>a.clientId),!1);let s=[];for(let a of o.clientIds){let c=t.parents.get(a);c!==void 0&&(c===""||r.byClientId.get(c))&&s.push(c)}hl(r,s,!0);break}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":let n=[];for(let i of o.clientIds){let s=t.parents.get(i);s!==void 0&&(s===""||r.byClientId.get(s))&&n.push(s)}r.tree=new Map(r.tree),o.removedClientIds.forEach(i=>{r.tree.delete(i),r.tree.delete("controlled||"+i)}),hl(r,n,!0);break;case"MOVE_BLOCKS_TO_POSITION":{let i=[];o.fromRootClientId?i.push(o.fromRootClientId):i.push(""),o.toRootClientId&&i.push(o.toRootClientId),r.tree=new Map(r.tree),hl(r,i,!0);break}case"MOVE_BLOCKS_UP":case"MOVE_BLOCKS_DOWN":{let i=[o.rootClientId?o.rootClientId:""];r.tree=new Map(r.tree),hl(r,i,!0);break}case"SAVE_REUSABLE_BLOCK_SUCCESS":{let i=[];r.attributes.forEach((s,a)=>{r.byClientId.get(a).name==="core/block"&&s.ref===o.updatedId&&i.push(a)}),r.tree=new Map(r.tree),i.forEach(s=>{r.tree.set(s,{...r.byClientId.get(s),attributes:r.attributes.get(s),innerBlocks:r.tree.get(s).innerBlocks})}),hl(r,i,!1)}}return r};function hpe(e){let t,o=!1,r;return(n,i)=>{let s=e(n,i),a;if(i.type==="SET_EXPLICIT_PERSISTENT"&&(r=i.isPersistentChange,a=n.isPersistentChange??!0),r!==void 0)return a=r,a===s.isPersistentChange?s:{...s,isPersistentChange:a};let c=i.type==="MARK_LAST_CHANGE_AS_PERSISTENT"||o;return n===s&&!c?(o=i.type==="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT",a=n?.isPersistentChange??!0,n.isPersistentChange===a?n:{...s,isPersistentChange:a}):(s={...s,isPersistentChange:c?!o:!mpe(i,t)},t=i,o=i.type==="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT",s)}}function gpe(e){let t=new Set(["RECEIVE_BLOCKS"]);return(o,r)=>{let n=e(o,r);return n!==o&&(n.isIgnoredChange=t.has(r.type)),n}}var bpe=e=>(t,o)=>{let r=n=>{let i=n;for(let s=0;s<i.length;s++)!t.order.get(i[s])||o.keepControlledInnerBlocks&&o.keepControlledInnerBlocks[i[s]]||(i===n&&(i=[...i]),i.push(...t.order.get(i[s])));return i};if(t)switch(o.type){case"REMOVE_BLOCKS":o={...o,type:"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN",removedClientIds:r(o.clientIds)};break;case"REPLACE_BLOCKS":o={...o,type:"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN",replacedClientIds:r(o.clientIds)};break}return e(t,o)},kpe=e=>(t,o)=>{if(o.type==="RESET_BLOCKS"){let r=e(void 0,{type:"INSERT_BLOCKS",rootClientId:"",blocks:o.blocks}),n=t?.controlledInnerBlocks??{};if(t?.order)for(let s of Object.keys(n)){if(!n[s]||!r.byClientId.has(s))continue;r.controlledInnerBlocks[s]=!0;let a=t.order.get(s);if(!a?.length)continue;r.order.set(s,a);let c=(u,d)=>{let f=t.byClientId.get(u);if(!f)return;r.byClientId.set(u,f),r.attributes.set(u,t.attributes.get(u)),r.parents.set(u,d);let m=t.order.get(u)||[];r.order.set(u,m),m.forEach(h=>c(h,u))};a.forEach(u=>c(u,s))}for(let s of Object.keys(r.controlledInnerBlocks)){let a=r.order.get(s);if(!a?.length)continue;let c=a.map(f=>t.tree.get(f)),u=r.tree.get(s);u&&(u.innerBlocks=c),r.tree.set("controlled||"+s,{innerBlocks:c});let d=f=>{let m=t.tree.get(f);if(!m)return;r.tree.set(f,m),(r.order.get(f)||[]).forEach(d)};a.forEach(d)}let i=t?.blockEditingModes??new Map;for(let[s,a]of i)r.tree.has(s)&&r.blockEditingModes.set(s,a);return r}return e(t,o)},vpe=e=>(t,o)=>{if(o.type!=="REPLACE_INNER_BLOCKS")return e(t,o);let r={};if(Object.keys(t.controlledInnerBlocks).length){let s=[...o.blocks];for(;s.length;){let{innerBlocks:a,...c}=s.shift();s.push(...a),t.controlledInnerBlocks[c.clientId]&&(r[c.clientId]=!0)}}let n=t;t.order.get(o.rootClientId)&&(n=e(n,{type:"REMOVE_BLOCKS",keepControlledInnerBlocks:r,clientIds:t.order.get(o.rootClientId)}));let i=n;if(o.blocks.length){i=e(i,{...o,type:"INSERT_BLOCKS",index:0});let s=new Map(i.order);Object.keys(r).forEach(a=>{t.order.get(a)&&s.set(a,t.order.get(a))}),i.order=s,i.tree=new Map(i.tree),Object.keys(r).forEach(a=>{let c=`controlled||${a}`;t.tree.has(c)&&i.tree.set(c,t.tree.get(c))})}return i},ype=e=>(t,o)=>{if(t&&o.type==="SAVE_REUSABLE_BLOCK_SUCCESS"){let{id:r,updatedId:n}=o;if(r===n)return t;t={...t},t.attributes=new Map(t.attributes),t.attributes.forEach((i,s)=>{let{name:a}=t.byClientId.get(s);a==="core/block"&&i.ref===r&&t.attributes.set(s,{...i,ref:n})})}return e(t,o)},Spe=e=>(t,o)=>{if(o.type==="SET_HAS_CONTROLLED_INNER_BLOCKS"){if(t.order.get(o.clientId)?.length){let n=e(t,{type:"REPLACE_INNER_BLOCKS",rootClientId:o.clientId,blocks:[]});return e(n,o)}return e(t,o)}return e(t,o)},_pe=(0,TO.pipe)(Zk.combineReducers,ype,ppe,bpe,vpe,kpe,hpe,gpe,Spe)({byClientId(e=new Map,t){switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{let o=new Map(e);return G6(t.blocks).forEach(([r,n])=>{o.set(r,n)}),o}case"UPDATE_BLOCK":{if(!e.has(t.clientId))return e;let{attributes:o,...r}=t.updates;if(Object.values(r).length===0)return e;let n=new Map(e);return n.set(t.clientId,{...e.get(t.clientId),...r}),n}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{if(!t.blocks)return e;let o=new Map(e);return t.replacedClientIds.forEach(r=>{o.delete(r)}),G6(t.blocks).forEach(([r,n])=>{o.set(r,n)}),o}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{let o=new Map(e);return t.removedClientIds.forEach(r=>{o.delete(r)}),o}}return e},attributes(e=new Map,t){switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{let o=new Map(e);return W6(t.blocks).forEach(([r,n])=>{o.set(r,n)}),o}case"UPDATE_BLOCK":{if(!e.get(t.clientId)||!t.updates.attributes)return e;let o=new Map(e);return o.set(t.clientId,{...e.get(t.clientId),...t.updates.attributes}),o}case"SYNC_DERIVED_BLOCK_ATTRIBUTES":case"UPDATE_BLOCK_ATTRIBUTES":{if(t.clientIds.every(n=>!e.get(n)))return e;let o=!1,r=new Map(e);for(let n of t.clientIds){let i=Object.entries(t.options?.uniqueByBlock?t.attributes[n]:t.attributes??{});if(i.length===0)continue;let s=!1,a=e.get(n),c={};i.forEach(([u,d])=>{a[u]!==d&&(s=!0,c[u]=d)}),o=o||s,s&&r.set(n,{...a,...c})}return o?r:e}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{if(!t.blocks)return e;let o=new Map(e);return t.replacedClientIds.forEach(r=>{o.delete(r)}),W6(t.blocks).forEach(([r,n])=>{o.set(r,n)}),o}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{let o=new Map(e);return t.removedClientIds.forEach(r=>{o.delete(r)}),o}}return e},order(e=new Map,t){switch(t.type){case"RECEIVE_BLOCKS":{let o=B0(t.blocks),r=new Map(e);return o.forEach((n,i)=>{i!==""&&r.set(i,n)}),r.set("",(e.get("")??[]).concat(o[""])),r}case"INSERT_BLOCKS":{let{rootClientId:o=""}=t,r=e.get(o)||[],n=B0(t.blocks,o),{index:i=r.length}=t,s=new Map(e);return n.forEach((a,c)=>{s.set(c,a)}),s.set(o,k0(r,n.get(o),i)),s}case"MOVE_BLOCKS_TO_POSITION":{let{fromRootClientId:o="",toRootClientId:r="",clientIds:n}=t,{index:i=e.get(r).length}=t;if(o===r){let c=e.get(r).indexOf(n[0]),u=new Map(e);return u.set(r,v0(e.get(r),c,i,n.length)),u}let s=new Map(e);return s.set(o,e.get(o)?.filter(a=>!n.includes(a))??[]),s.set(r,k0(e.get(r),n,i)),s}case"MOVE_BLOCKS_UP":{let{clientIds:o,rootClientId:r=""}=t,n=o[0],i=e.get(r);if(!i.length||n===i[0])return e;let s=i.indexOf(n),a=new Map(e);return a.set(r,v0(i,s,s-1,o.length)),a}case"MOVE_BLOCKS_DOWN":{let{clientIds:o,rootClientId:r=""}=t,n=o[0],i=o[o.length-1],s=e.get(r);if(!s.length||i===s[s.length-1])return e;let a=s.indexOf(n),c=new Map(e);return c.set(r,v0(s,a,a+1,o.length)),c}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{let{clientIds:o}=t;if(!t.blocks)return e;let r=B0(t.blocks),n=new Map(e);return t.replacedClientIds.forEach(i=>{n.delete(i)}),r.forEach((i,s)=>{s!==""&&n.set(s,i)}),n.forEach((i,s)=>{let a=Object.values(i).reduce((c,u)=>u===o[0]?[...c,...r.get("")]:(o.indexOf(u)===-1&&c.push(u),c),[]);n.set(s,a)}),n}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{let o=new Map(e);return t.removedClientIds.forEach(r=>{o.delete(r)}),o.forEach((r,n)=>{let i=r?.filter(s=>!t.removedClientIds.includes(s))??[];i.length!==r.length&&o.set(n,i)}),o}}return e},parents(e=new Map,t){switch(t.type){case"RECEIVE_BLOCKS":{let o=new Map(e);return BO(t.blocks).forEach(([r,n])=>{o.set(r,n)}),o}case"INSERT_BLOCKS":{let o=new Map(e);return BO(t.blocks,t.rootClientId||"").forEach(([r,n])=>{o.set(r,n)}),o}case"MOVE_BLOCKS_TO_POSITION":{let o=new Map(e);return t.clientIds.forEach(r=>{o.set(r,t.toRootClientId||"")}),o}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{let o=new Map(e);return t.replacedClientIds.forEach(r=>{o.delete(r)}),BO(t.blocks,e.get(t.clientIds[0])).forEach(([r,n])=>{o.set(r,n)}),o}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{let o=new Map(e);return t.removedClientIds.forEach(r=>{o.delete(r)}),o}}return e},controlledInnerBlocks(e={},{type:t,clientId:o,hasControlledInnerBlocks:r}){return t==="SET_HAS_CONTROLLED_INNER_BLOCKS"?{...e,[o]:r}:e},blockEditingModes(e=new Map,t){switch(t.type){case"SET_BLOCK_EDITING_MODE":return e.get(t.clientId)===t.mode?e:new Map(e).set(t.clientId,t.mode);case"UNSET_BLOCK_EDITING_MODE":{if(!e.has(t.clientId))return e;let o=new Map(e);return o.delete(t.clientId),o}}return e}});function xpe(e=!1,t){switch(t.type){case"HIDE_BLOCK_INTERFACE":return!0;case"SHOW_BLOCK_INTERFACE":return!1}return e}function wpe(e=!1,t){switch(t.type){case"START_TYPING":return!0;case"STOP_TYPING":return!1}return e}function Cpe(e=!1,t){switch(t.type){case"START_DRAGGING":return!0;case"STOP_DRAGGING":return!1}return e}function Bpe(e=[],t){switch(t.type){case"START_DRAGGING_BLOCKS":return t.clientIds;case"STOP_DRAGGING_BLOCKS":return[]}return e}function Epe(e={},t){return t.type==="SET_BLOCK_VISIBILITY"?{...e,...t.updates}:e}function K6(e={},t){switch(t.type){case"CLEAR_SELECTED_BLOCK":return e.clientId?{}:e;case"SELECT_BLOCK":return t.clientId===e.clientId?e:{clientId:t.clientId};case"REPLACE_INNER_BLOCKS":case"INSERT_BLOCKS":return!t.updateSelection||!t.blocks.length?e:{clientId:t.blocks[0].clientId};case"REMOVE_BLOCKS":return!t.clientIds||!t.clientIds.length||t.clientIds.indexOf(e.clientId)===-1?e:{};case"REPLACE_BLOCKS":{if(t.clientIds.indexOf(e.clientId)===-1)return e;let o=t.blocks[t.indexToSelect]||t.blocks[t.blocks.length-1];return o?o.clientId===e.clientId?e:{clientId:o.clientId}:{}}}return e}function Tpe(e={},t){switch(t.type){case"SELECTION_CHANGE":return t.clientId?{selectionStart:{clientId:t.clientId,attributeKey:t.attributeKey,offset:t.startOffset},selectionEnd:{clientId:t.clientId,attributeKey:t.attributeKey,offset:t.endOffset}}:{selectionStart:t.start||e.selectionStart,selectionEnd:t.end||e.selectionEnd};case"RESET_SELECTION":let{selectionStart:n,selectionEnd:i}=t;return{selectionStart:n,selectionEnd:i};case"MULTI_SELECT":let{start:s,end:a}=t;return s===e.selectionStart?.clientId&&a===e.selectionEnd?.clientId?e:{selectionStart:{clientId:s},selectionEnd:{clientId:a}};case"RESET_BLOCKS":let c=e?.selectionStart?.clientId,u=e?.selectionEnd?.clientId;if(!c&&!u)return e;if(!t.blocks.some(d=>d.clientId===c))return{selectionStart:{},selectionEnd:{}};if(!t.blocks.some(d=>d.clientId===u))return{...e,selectionEnd:e.selectionStart}}let o=K6(e.selectionStart,t),r=K6(e.selectionEnd,t);return o===e.selectionStart&&r===e.selectionEnd?e:{selectionStart:o,selectionEnd:r}}function Ipe(e=!1,t){switch(t.type){case"START_MULTI_SELECT":return!0;case"STOP_MULTI_SELECT":return!1}return e}function Ppe(e=!0,t){return t.type==="TOGGLE_SELECTION"?t.isSelectionEnabled:e}function Rpe(e=null,t){switch(t.type){case"SHOW_VIEWPORT_MODAL":return t.clientIds;case"HIDE_VIEWPORT_MODAL":return null}return e}function Ope(e=!1,t){switch(t.type){case"DISPLAY_BLOCK_REMOVAL_PROMPT":let{clientIds:o,selectPrevious:r,message:n}=t;return{clientIds:o,selectPrevious:r,message:n};case"CLEAR_BLOCK_REMOVAL_PROMPT":return!1}return e}function Ape(e=!1,t){return t.type==="SET_BLOCK_REMOVAL_RULES"?t.rules:e}function Lpe(e=null,t){return t.type==="REPLACE_BLOCKS"&&t.initialPosition!==void 0||["MULTI_SELECT","SELECT_BLOCK","RESET_SELECTION","INSERT_BLOCKS","REPLACE_INNER_BLOCKS"].includes(t.type)?t.initialPosition:e}function Npe(e={},t){if(t.type==="TOGGLE_BLOCK_MODE"){let{clientId:o}=t;return{...e,[o]:e[o]&&e[o]==="html"?"visual":"html"}}return e}function Mpe(e=null,t){switch(t.type){case"SHOW_INSERTION_POINT":{let{rootClientId:o,index:r,__unstableWithInserter:n,operation:i,nearestSide:s}=t,a={rootClientId:o,index:r,__unstableWithInserter:n,operation:i,nearestSide:s};return(0,qk.default)(e,a)?e:a}case"HIDE_INSERTION_POINT":return null}return e}function Dpe(e={isValid:!0},t){return t.type==="SET_TEMPLATE_VALIDITY"?{...e,isValid:t.isValid}:e}function Vpe(e=Kk,t){if(t.type==="UPDATE_SETTINGS"){let o=t.reset?{...Kk,...t.settings}:{...e,...t.settings};return Object.defineProperty(o,"__unstableIsPreviewMode",{get(){return(0,Y6.default)("__unstableIsPreviewMode",{since:"6.8",alternative:"isPreviewMode"}),this.isPreviewMode}}),o}return e}function Fpe(e=H6,t){switch(t.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":{let o=t.blocks.reduce((r,n)=>{let{attributes:i,name:s}=n,a=s,c=(0,Zk.select)(E0.store).getActiveBlockVariation(s,i);return c?.name&&(a+="/"+c.name),s==="core/block"&&(a+="/"+i.ref),{...r,[a]:{time:t.time,count:r[a]?r[a].count+1:1}}},e.insertUsage);return{...e,insertUsage:o}}}return e}var zpe=(e={},t)=>{switch(t.type){case"REPLACE_BLOCKS":{let o=new Set,r=[...t.blocks];for(;r.length;){let n=r.shift();o.add(n.clientId),r.push(...n.innerBlocks)}return Object.fromEntries(Object.entries(e).filter(([n])=>!t.clientIds.includes(n)||o.has(n)))}case"REMOVE_BLOCKS":return Object.fromEntries(Object.entries(e).filter(([o])=>!t.clientIds.includes(o)));case"UPDATE_BLOCK_LIST_SETTINGS":{let o=typeof t.clientId=="string"?{[t.clientId]:t.settings}:t.clientId;for(let n in o)o[n]?(0,qk.default)(e[n],o[n])&&delete o[n]:e[n]||delete o[n];if(Object.keys(o).length===0)return e;let r={...e,...o};for(let n in o)o[n]||delete r[n];return r}}return e};function jpe(e=null,t){switch(t.type){case"UPDATE_BLOCK":if(!t.updates.attributes)break;return{[t.clientId]:t.updates.attributes};case"UPDATE_BLOCK_ATTRIBUTES":return t.clientIds.reduce((o,r)=>({...o,[r]:t.options?.uniqueByBlock?t.attributes[r]:t.attributes}),{})}return e}function Upe(e,t){switch(t.type){case"TOGGLE_BLOCK_HIGHLIGHT":let{clientId:o,isHighlighted:r}=t;return r?o:e===o?null:e;case"SELECT_BLOCK":if(t.clientId!==e)return null}return e}function Hpe(e,t){switch(t.type){case"TOGGLE_BLOCK_SPOTLIGHT":let{clientId:o,hasBlockSpotlight:r}=t;return r?o:e===o?null:e;case"SELECT_BLOCK":return t.clientId!==e?null:e;case"SELECTION_CHANGE":return t.start?.clientId!==e||t.end?.clientId!==e?null:e;case"CLEAR_SELECTED_BLOCK":return null}return e}function Gpe(e=null,t){switch(t.type){case"SET_BLOCK_EXPANDED_IN_LIST_VIEW":return t.clientId;case"SELECT_BLOCK":if(t.clientId!==e)return null}return e}function Wpe(e={},t){switch(t.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":if(!t.blocks.length)return e;let o=t.blocks.map(n=>n.clientId),r=t.meta?.source;return{clientIds:o,source:r};case"RESET_BLOCKS":return{}}return e}function $pe(e,t){if(t.type==="EDIT_CONTENT_ONLY_SECTION")return t.clientId;if(!e)return e;switch(t.type){case"REMOVE_BLOCKS":case"REPLACE_BLOCKS":if(t.clientIds.includes(e))return;break;case"RESET_BLOCKS":if(!Z6(t.blocks)[e])return;break}return e}function Kpe(e=new Map,t){switch(t.type){case"SET_STYLE_OVERRIDE":return new Map(e).set(t.id,t.style);case"DELETE_STYLE_OVERRIDE":{let o=new Map(e);return o.delete(t.id),o}}return e}function Ype(e=[],t){return t.type==="REGISTER_INSERTER_MEDIA_CATEGORY"?[...e,t.category]:e}function qpe(e=!1,t){return t.type==="LAST_FOCUS"?t.lastFocus:e}function Zpe(e=100,t){switch(t.type){case"SET_ZOOM_LEVEL":return t.zoom;case"RESET_ZOOM_LEVEL":return 100}return e}function Xpe(e=null,t){switch(t.type){case"SET_INSERTION_POINT":return t.value;case"SELECT_BLOCK":return null}return e}function Qpe(e={allOpen:!1,panels:{}},t){switch(t.type){case"SET_OPEN_LIST_VIEW_PANEL":return{allOpen:!1,panels:t.clientId?{[t.clientId]:!0}:{}};case"SET_ALL_LIST_VIEW_PANELS_OPEN":return{allOpen:!0,panels:{}};case"TOGGLE_LIST_VIEW_PANEL":return{allOpen:!1,panels:{...e.panels,[t.clientId]:t.isOpen}};case"REPLACE_BLOCKS":case"REMOVE_BLOCKS":{if(!t.clientIds||t.clientIds.length===0)return e;let o={...e.panels},r=!1;return t.clientIds.forEach(n=>{n in o&&(delete o[n],r=!0)}),r?{...e,panels:o}:e}}return e}function Jpe(e=0,t){return t.type==="INCREMENT_LIST_VIEW_EXPAND_REVISION"?e+1:e}function ehe(e=!1,t){switch(t.type){case"OPEN_LIST_VIEW_CONTENT_PANEL":return!0;case"CLOSE_LIST_VIEW_CONTENT_PANEL":return!1;case"CLEAR_SELECTED_BLOCK":return!1}return e}function the(e=null,t){switch(t.type){case"REQUEST_INSPECTOR_TAB":return{tabName:t.tabName,options:t.options};case"CLEAR_REQUESTED_INSPECTOR_TAB":return null}return e}var ohe=(0,Zk.combineReducers)({blocks:_pe,isDragging:Cpe,isTyping:wpe,isBlockInterfaceHidden:xpe,draggedBlocks:Bpe,selection:Tpe,isMultiSelecting:Ipe,isSelectionEnabled:Ppe,initialPosition:Lpe,blocksMode:Npe,blockListSettings:zpe,insertionPoint:Xpe,insertionCue:Mpe,template:Dpe,settings:Vpe,preferences:Fpe,lastBlockAttributesChange:jpe,lastFocus:qpe,expandedBlock:Gpe,highlightedBlock:Upe,lastBlockInserted:Wpe,editedContentOnlySection:$pe,blockVisibility:Epe,viewportModalClientIds:Rpe,styleOverrides:Kpe,removalPromptData:Ope,blockRemovalRules:Ape,registeredInserterMediaCategories:Ype,zoomLevel:Zpe,hasBlockSpotlight:Hpe,openedListViewPanels:Qpe,listViewExpandRevision:Jpe,listViewContentPanelOpen:ehe,requestedInspectorTab:the});function X6(e,t){if(t===""){let n=e.blocks.tree.get(t);return n?{clientId:"",...n}:void 0}if(!e.blocks.controlledInnerBlocks[t])return e.blocks.tree.get(t);let o=e.blocks.tree.get(`controlled||${t}`);return{...e.blocks.tree.get(t),innerBlocks:o?.innerBlocks}}function IO(e,t,o){let r=X6(e,t);if(r&&(o(r),!!r?.innerBlocks?.length))for(let n of r?.innerBlocks)IO(e,n.clientId,o)}function Yk(e,t,o){if(!o.length)return;let r=e.blocks.parents.get(t);for(;r!==void 0;){if(o.includes(r))return r;r=e.blocks.parents.get(r)}}function rhe(e){return e?.attributes?.metadata?.bindings&&Object.keys(e?.attributes?.metadata?.bindings).length}function EO(e,t=""){let o=e?.zoomLevel<100||e?.zoomLevel==="auto-scaled",r=new Map,n=e.settings?.[Zc],i=e.blocks.order.get(n),s=Array.from(e.blocks.blockEditingModes).some(([,g])=>g==="disabled"),a=[],c=[];Object.keys(e.blocks.controlledInnerBlocks).forEach(g=>{let b=e.blocks.byClientId?.get(g);b?.name==="core/template-part"&&a.push(g),b?.name==="core/block"&&c.push(g)});let u=Object.keys(e.blockListSettings).filter(g=>e.blockListSettings[g]?.templateLock==="contentOnly"),d=e.settings?.[Xc],f=e.settings?.disableContentOnlyForUnsyncedPatterns,m=d||f?[]:Array.from(e.blocks.attributes.keys()).filter(g=>e.blocks.attributes.get(g)?.metadata?.patternName),h=e.settings?.disableContentOnlyForTemplateParts,p=[...u,...m,...d||h?[]:a];return IO(e,t,g=>{let{clientId:b,name:v}=g,k=!!e.editedContentOnlySection,y=!1;if(k&&(y=b===e.editedContentOnlySection||!!Yk(e,b,[e.editedContentOnlySection]),!y)){r.set(b,"disabled");return}if(!e.blocks.blockEditingModes.has(b)){if(s){let S,x=e.blocks.parents.get(b);for(;x!==void 0&&(e.blocks.blockEditingModes.has(x)&&(S=e.blocks.blockEditingModes.get(x)),!S);)x=e.blocks.parents.get(x);if(S==="disabled"){r.set(b,"disabled");return}}if(o){if(b===n){r.set(b,"contentOnly");return}if(!i?.length){r.set(b,"disabled");return}if(i.includes(b)){r.set(b,"contentOnly");return}r.set(b,"disabled");return}if(c.length){if(c.includes(b)){if(Yk(e,b,c)){r.set(b,"disabled");return}return}let S=Yk(e,b,c);if(S){if(Yk(e,S,c)){r.set(b,"disabled");return}if(rhe(g)){r.set(b,"contentOnly");return}r.set(b,"disabled");return}}if(k&&y){r.set(b,"default");return}p.length&&Yk(e,b,p)&&(upe(v)?r.set(b,"contentOnly"):r.set(b,"disabled"))}}),r}function Qc({prevState:e,nextState:t,addedBlocks:o,removedClientIds:r}){let n=e.derivedBlockEditingModes,i;return r?.forEach(s=>{IO(e,s,a=>{n.has(a.clientId)&&(i||(i=new Map(n)),i.delete(a.clientId))})}),o?.forEach(s=>{let a=EO(t,s.clientId);a.size&&(i?i=new Map([...i?.size?i:[],...a]):i=new Map([...n?.size?n:[],...a]))}),i}function nhe(e){return(t,o)=>{let r=e(t,o);if(o.type!=="SET_EDITOR_MODE"&&r===t)return t;switch(o.type){case"REMOVE_BLOCKS":{let n=Qc({prevState:t,nextState:r,removedClientIds:o.clientIds});if(n)return{...r,derivedBlockEditingModes:n??t.derivedBlockEditingModes};break}case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{let n=Qc({prevState:t,nextState:r,addedBlocks:o.blocks});if(n)return{...r,derivedBlockEditingModes:n??t.derivedBlockEditingModes};break}case"UPDATE_BLOCK_ATTRIBUTES":{if(r.settings?.disableContentOnlyForUnsyncedPatterns)break;let i=[],s=[];for(let c of o?.clientIds){let u=o.options?.uniqueByBlock?o.attributes[c]:o.attributes;if(!u)break;u.metadata?.patternName&&!t.blocks.attributes.get(c)?.metadata?.patternName?i.push(r.blocks.tree.get(c)):u.metadata&&!u.metadata?.patternName&&t.blocks.attributes.get(c)?.metadata?.patternName&&s.push(c)}if(!i?.length&&!s?.length)break;let a=Qc({prevState:t,nextState:r,addedBlocks:i,removedClientIds:s});if(a)return{...r,derivedBlockEditingModes:a??t.derivedBlockEditingModes};break}case"UPDATE_BLOCK_LIST_SETTINGS":{let n=[],i=[],s=typeof o.clientId=="string"?{[o.clientId]:o.settings}:o.clientId;for(let c in s){let u=t.blockListSettings[c]?.templateLock!=="contentOnly"&&r.blockListSettings[c]?.templateLock==="contentOnly",d=t.blockListSettings[c]?.templateLock==="contentOnly"&&r.blockListSettings[c]?.templateLock!=="contentOnly";u?n.push(r.blocks.tree.get(c)):d&&i.push(c)}if(!n.length&&!i.length)break;let a=Qc({prevState:t,nextState:r,addedBlocks:n,removedClientIds:i});if(a)return{...r,derivedBlockEditingModes:a??t.derivedBlockEditingModes};break}case"SET_BLOCK_EDITING_MODE":case"UNSET_BLOCK_EDITING_MODE":case"SET_HAS_CONTROLLED_INNER_BLOCKS":{let n=X6(r,o.clientId);if(!n)break;let i=Qc({prevState:t,nextState:r,removedClientIds:[o.clientId],addedBlocks:[n]});if(i)return{...r,derivedBlockEditingModes:i??t.derivedBlockEditingModes};break}case"REPLACE_BLOCKS":{let n=Qc({prevState:t,nextState:r,addedBlocks:o.blocks,removedClientIds:o.clientIds});if(n)return{...r,derivedBlockEditingModes:n??t.derivedBlockEditingModes};break}case"REPLACE_INNER_BLOCKS":{let n=t.blocks.order.get(o.rootClientId),i=Qc({prevState:t,nextState:r,addedBlocks:o.blocks,removedClientIds:n});if(i)return{...r,derivedBlockEditingModes:i??t.derivedBlockEditingModes};break}case"MOVE_BLOCKS_TO_POSITION":{let n=o.clientIds.map(s=>r.blocks.byClientId.get(s)),i=Qc({prevState:t,nextState:r,addedBlocks:n,removedClientIds:o.clientIds});if(i)return{...r,derivedBlockEditingModes:i??t.derivedBlockEditingModes};break}case"UPDATE_SETTINGS":{if(t?.settings?.[Zc]!==r?.settings?.[Zc]||!!t?.settings?.disableContentOnlyForUnsyncedPatterns!=!!r?.settings?.disableContentOnlyForUnsyncedPatterns||!!t?.settings?.[Xc]!=!!r?.settings?.[Xc]||!!t?.settings?.disableContentOnlyForTemplateParts!=!!r?.settings?.disableContentOnlyForTemplateParts)return{...r,derivedBlockEditingModes:EO(r)};break}case"RESET_BLOCKS":case"EDIT_CONTENT_ONLY_SECTION":case"SET_EDITOR_MODE":case"RESET_ZOOM_LEVEL":case"SET_ZOOM_LEVEL":return{...r,derivedBlockEditingModes:EO(r)}}return r.derivedBlockEditingModes=t?.derivedBlockEditingModes??new Map,r}}function ihe(e){return(t,o)=>{let r=e(t,o);return t?(r.automaticChangeStatus=t.automaticChangeStatus,o.type==="MARK_AUTOMATIC_CHANGE"?{...r,automaticChangeStatus:"pending"}:o.type==="MARK_AUTOMATIC_CHANGE_FINAL"&&t.automaticChangeStatus==="pending"?{...r,automaticChangeStatus:"final"}:r.blocks===t.blocks&&r.selection===t.selection||r.automaticChangeStatus!=="final"&&r.selection!==t.selection?r:{...r,automaticChangeStatus:void 0}):r}}var Q6=(0,TO.pipe)(nhe,ihe)(ohe);var rM={};Ip(rM,{__experimentalGetActiveBlockIdByBlockNames:()=>nbe,__experimentalGetAllowedBlocks:()=>Uge,__experimentalGetAllowedPatterns:()=>$ge,__experimentalGetBlockListSettingsForBlocks:()=>Xge,__experimentalGetDirectInsertBlock:()=>Hge,__experimentalGetGlobalBlocksByName:()=>Jhe,__experimentalGetLastBlockAttributeChanges:()=>ebe,__experimentalGetParsedPattern:()=>Gge,__experimentalGetPatternTransformItems:()=>qge,__experimentalGetPatternsByBlockTypes:()=>Yge,__experimentalGetReusableBlockTitle:()=>Qge,__unstableGetBlockWithoutInnerBlocks:()=>Zhe,__unstableGetClientIdWithClientIdsTree:()=>Sj,__unstableGetClientIdsTree:()=>_j,__unstableGetContentLockingParent:()=>fbe,__unstableGetSelectedBlocksWithPartialSelection:()=>Sge,__unstableGetTemporarilyEditingAsBlocks:()=>mbe,__unstableGetVisibleBlocks:()=>lbe,__unstableHasActiveBlockOverlayActive:()=>Dj,__unstableIsFullySelected:()=>bge,__unstableIsLastBlockChangeIgnored:()=>Jge,__unstableIsSelectionCollapsed:()=>kge,__unstableIsSelectionMergeable:()=>yge,__unstableIsWithinBlockOverlay:()=>cbe,__unstableSelectionHasUnmergeableBlock:()=>vge,areInnerBlocksControlled:()=>Ow,canEditBlock:()=>Lj,canInsertBlockType:()=>Df,canInsertBlocks:()=>Nge,canLockBlockType:()=>Dge,canMoveBlock:()=>Aj,canMoveBlocks:()=>Mge,canRemoveBlock:()=>QN,canRemoveBlocks:()=>Oj,didAutomaticChange:()=>obe,getAdjacentBlockClientId:()=>YN,getAllowedBlocks:()=>WN,getBlock:()=>xl,getBlockAttributes:()=>Ti,getBlockCount:()=>tge,getBlockEditingMode:()=>Ii,getBlockHierarchyRootClientId:()=>age,getBlockIndex:()=>Ej,getBlockInsertionPoint:()=>Rge,getBlockListSettings:()=>oM,getBlockMode:()=>Bge,getBlockName:()=>dt,getBlockNamesByClientId:()=>ege,getBlockOrder:()=>wr,getBlockParents:()=>ys,getBlockParentsByBlockName:()=>KN,getBlockRootClientId:()=>Po,getBlockSelectionEnd:()=>rge,getBlockSelectionStart:()=>oge,getBlockTransformItems:()=>zge,getBlocks:()=>Xhe,getBlocksByClientId:()=>Rw,getBlocksByName:()=>wj,getClientIdsOfDescendants:()=>xj,getClientIdsWithDescendants:()=>$p,getDirectInsertBlock:()=>Mj,getDraggedBlockClientIds:()=>Tge,getFirstMultiSelectedBlockClientId:()=>qN,getGlobalBlockCount:()=>Qhe,getHoveredBlockClientId:()=>abe,getInserterItems:()=>Fge,getLastMultiSelectedBlockClientId:()=>Cj,getLowestCommonAncestorWithSelectedBlock:()=>lge,getMultiSelectedBlockClientIds:()=>du,getMultiSelectedBlocks:()=>fge,getMultiSelectedBlocksEndClientId:()=>gge,getMultiSelectedBlocksStartClientId:()=>hge,getNextBlockClientId:()=>uge,getPatternsByBlockTypes:()=>Kge,getPreviousBlockClientId:()=>cge,getSelectedBlock:()=>sge,getSelectedBlockClientId:()=>Yp,getSelectedBlockClientIds:()=>qp,getSelectedBlockCount:()=>nge,getSelectedBlocksInitialCaretPosition:()=>dge,getSelectionEnd:()=>Ov,getSelectionStart:()=>Rv,getSettings:()=>su,getTemplate:()=>Lge,getTemplateLock:()=>fa,hasBlockMovingClientId:()=>tbe,hasDraggedInnerBlock:()=>Pj,hasInserterItems:()=>jge,hasMultiSelection:()=>xge,hasSelectedBlock:()=>ige,hasSelectedInnerBlock:()=>Ij,isAncestorBeingDragged:()=>Ige,isAncestorMultiSelected:()=>pge,isBlockBeingDragged:()=>ZN,isBlockHighlighted:()=>rbe,isBlockInsertionPointVisible:()=>Oge,isBlockMultiSelected:()=>Bj,isBlockSelected:()=>Tj,isBlockValid:()=>qhe,isBlockVisible:()=>sbe,isBlockWithinSelection:()=>_ge,isCaretWithinFormattedText:()=>Pge,isDraggingBlocks:()=>Rj,isFirstMultiSelectedBlock:()=>mge,isGroupable:()=>dbe,isLastBlockChangePersistent:()=>Zge,isMultiSelecting:()=>wge,isSelectionEnabled:()=>Cge,isTyping:()=>Ege,isUngroupable:()=>ube,isValidTemplate:()=>Age,wasBlockJustInserted:()=>ibe});var Oe=l($(),1),kj=l(R(),1),vj=l(ut(),1);var T0=l(R(),1),we=(0,T0.forwardRef)(({icon:e,size:t=24,...o},r)=>(0,T0.cloneElement)(e,{width:t,height:t,...o,ref:r}));var I0=l(q(),1),PO=l(w(),1),Sf=(0,PO.jsx)(I0.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,PO.jsx)(I0.Path,{d:"M7.5 5.5h9V4h-9v1.5Zm-3.5 7h16V11H4v1.5Zm3.5 7h9V18h-9v1.5Z"})});var P0=l(q(),1),RO=l(w(),1),OO=(0,RO.jsx)(P0.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,RO.jsx)(P0.Path,{d:"M4 12.8h16v-1.5H4v1.5zm0 7h12.4v-1.5H4v1.5zM4 4.3v1.5h16V4.3H4z"})});var R0=l(q(),1),AO=l(w(),1),Jc=(0,AO.jsx)(R0.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,AO.jsx)(R0.Path,{d:"M13 5.5H4V4h9v1.5Zm7 7H4V11h16v1.5Zm-7 7H4V18h9v1.5Z"})});var O0=l(q(),1),LO=l(w(),1),_f=(0,LO.jsx)(O0.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,LO.jsx)(O0.Path,{d:"M19 5.5H5V4h14v1.5ZM19 20H5v-1.5h14V20ZM5 9h14v6H5V9Z"})});var A0=l(q(),1),NO=l(w(),1),eu=(0,NO.jsx)(A0.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,NO.jsx)(A0.Path,{d:"M11.111 5.5H20V4h-8.889v1.5ZM4 12.5h16V11H4v1.5Zm7.111 7H20V18h-8.889v1.5Z"})});var L0=l(q(),1),MO=l(w(),1),DO=(0,MO.jsx)(L0.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,MO.jsx)(L0.Path,{d:"m16.5 13.5-3.7 3.7V4h-1.5v13.2l-3.8-3.7-1 1 5.5 5.6 5.5-5.6z"})});var N0=l(q(),1),VO=l(w(),1),Xk=(0,VO.jsx)(N0.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,VO.jsx)(N0.Path,{d:"M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z"})});var M0=l(q(),1),FO=l(w(),1),Qk=(0,FO.jsx)(M0.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,FO.jsx)(M0.Path,{d:"m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z"})});var D0=l(q(),1),zO=l(w(),1),jO=(0,zO.jsx)(D0.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,zO.jsx)(D0.Path,{d:"M18.5 5.5h-13c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2v-9c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5h-13c-.3 0-.5-.2-.5-.5v-9c0-.3.2-.5.5-.5h13c.3 0 .5.2.5.5v9zM6.5 12H8v-2h2V8.5H6.5V12zm9.5 2h-2v1.5h3.5V12H16v2z"})});var V0=l(q(),1),UO=l(w(),1),HO=(0,UO.jsx)(V0.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,UO.jsx)(V0.Path,{d:"M17.7 4.3c-1.2 0-2.8 0-3.8 1-.6.6-.9 1.5-.9 2.6V14c-.6-.6-1.5-1-2.5-1C8.6 13 7 14.6 7 16.5S8.6 20 10.5 20c1.5 0 2.8-1 3.3-2.3.5-.8.7-1.8.7-2.5V7.9c0-.7.2-1.2.5-1.6.6-.6 1.8-.6 2.8-.6h.3V4.3h-.4z"})});var F0=l(q(),1),GO=l(w(),1),Jk=(0,GO.jsx)(F0.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,GO.jsx)(F0.Path,{d:"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"})});var z0=l(q(),1),WO=l(w(),1),$O=(0,WO.jsx)(z0.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,WO.jsx)(z0.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M6 5.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM4 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2V6zm11-.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5h-3a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM13 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2h-3a2 2 0 01-2-2V6zm5 8.5h-3a.5.5 0 00-.5.5v3a.5.5 0 00.5.5h3a.5.5 0 00.5-.5v-3a.5.5 0 00-.5-.5zM15 13a2 2 0 00-2 2v3a2 2 0 002 2h3a2 2 0 002-2v-3a2 2 0 00-2-2h-3zm-9 1.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5v-3a.5.5 0 01.5-.5zM4 15a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2v-3z"})});var j0=l(q(),1),KO=l(w(),1),gl=(0,KO.jsx)(j0.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,KO.jsx)(j0.Path,{d:"M16.5 7.5 10 13.9l-2.5-2.4-1 1 3.5 3.6 7.5-7.6z"})});var U0=l(q(),1),YO=l(w(),1),zn=(0,YO.jsx)(U0.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,YO.jsx)(U0.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})});var H0=l(q(),1),qO=l(w(),1),ev=(0,qO.jsx)(H0.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,qO.jsx)(H0.Path,{d:"m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z"})});var G0=l(q(),1),ZO=l(w(),1),Mr=(0,ZO.jsx)(G0.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,ZO.jsx)(G0.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})});var W0=l(q(),1),XO=l(w(),1),tu=(0,XO.jsx)(W0.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,XO.jsx)(W0.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"})});var $0=l(q(),1),QO=l(w(),1),Vo=(0,QO.jsx)($0.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,QO.jsx)($0.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})});var K0=l(q(),1),JO=l(w(),1),xf=(0,JO.jsx)(K0.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,JO.jsx)(K0.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})});var Y0=l(q(),1),eA=l(w(),1),wf=(0,eA.jsx)(Y0.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,eA.jsx)(Y0.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"})});var q0=l(q(),1),tA=l(w(),1),oA=(0,tA.jsx)(q0.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,tA.jsx)(q0.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M10.289 4.836A1 1 0 0111.275 4h1.306a1 1 0 01.987.836l.244 1.466c.787.26 1.503.679 2.108 1.218l1.393-.522a1 1 0 011.216.437l.653 1.13a1 1 0 01-.23 1.273l-1.148.944a6.025 6.025 0 010 2.435l1.149.946a1 1 0 01.23 1.272l-.653 1.13a1 1 0 01-1.216.437l-1.394-.522c-.605.54-1.32.958-2.108 1.218l-.244 1.466a1 1 0 01-.987.836h-1.306a1 1 0 01-.986-.836l-.244-1.466a5.995 5.995 0 01-2.108-1.218l-1.394.522a1 1 0 01-1.217-.436l-.653-1.131a1 1 0 01.23-1.272l1.149-.946a6.026 6.026 0 010-2.435l-1.148-.944a1 1 0 01-.23-1.272l.653-1.131a1 1 0 011.217-.437l1.393.522a5.994 5.994 0 012.108-1.218l.244-1.466zM14.929 12a3 3 0 11-6 0 3 3 0 016 0z"})});var Z0=l(q(),1),rA=l(w(),1),nA=(0,rA.jsx)(Z0.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,rA.jsx)(Z0.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5.625 5.5h9.75c.069 0 .125.056.125.125v9.75a.125.125 0 0 1-.125.125h-9.75a.125.125 0 0 1-.125-.125v-9.75c0-.069.056-.125.125-.125ZM4 5.625C4 4.728 4.728 4 5.625 4h9.75C16.273 4 17 4.728 17 5.625v9.75c0 .898-.727 1.625-1.625 1.625h-9.75A1.625 1.625 0 0 1 4 15.375v-9.75Zm14.5 11.656v-9H20v9C20 18.8 18.77 20 17.251 20H6.25v-1.5h11.001c.69 0 1.249-.528 1.249-1.219Z"})});var X0=l(q(),1),iA=l(w(),1),Cf=(0,iA.jsx)(X0.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,iA.jsx)(X0.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5 4.5h11a.5.5 0 0 1 .5.5v11a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V5a.5.5 0 0 1 .5-.5ZM3 5a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5Zm17 3v10.75c0 .69-.56 1.25-1.25 1.25H6v1.5h12.75a2.75 2.75 0 0 0 2.75-2.75V8H20Z"})});var Q0=l(q(),1),sA=l(w(),1),aA=(0,sA.jsx)(Q0.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,sA.jsx)(Q0.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5.75 6A.25.25 0 0 1 6 5.75h3v-1.5H6A1.75 1.75 0 0 0 4.25 6v3h1.5V6ZM18 18.25h-3v1.5h3A1.75 1.75 0 0 0 19.75 18v-3h-1.5v3a.25.25 0 0 1-.25.25ZM18.25 9V6a.25.25 0 0 0-.25-.25h-3v-1.5h3c.966 0 1.75.784 1.75 1.75v3h-1.5Zm-12.5 9v-3h-1.5v3c0 .966.784 1.75 1.75 1.75h3v-1.5H6a.25.25 0 0 1-.25-.25Z"})});var Bf=l(q(),1),Np=l(w(),1),lA=(0,Np.jsxs)(Bf.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,Np.jsx)(Bf.G,{opacity:".25",children:(0,Np.jsx)(Bf.Path,{d:"M5.75 6A.25.25 0 0 1 6 5.75h3v-1.5H6A1.75 1.75 0 0 0 4.25 6v3h1.5V6ZM18 18.25h-3v1.5h3A1.75 1.75 0 0 0 19.75 18v-3h-1.5v3a.25.25 0 0 1-.25.25ZM18.25 9V6a.25.25 0 0 0-.25-.25h-3v-1.5h3c.966 0 1.75.784 1.75 1.75v3h-1.5ZM5.75 18v-3h-1.5v3c0 .966.784 1.75 1.75 1.75h3v-1.5H6a.25.25 0 0 1-.25-.25Z"})}),(0,Np.jsx)(Bf.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5.75 15v3c0 .138.112.25.25.25h3v1.5H6A1.75 1.75 0 0 1 4.25 18v-3h1.5Z"})]});var Ef=l(q(),1),Mp=l(w(),1),cA=(0,Mp.jsxs)(Ef.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,Mp.jsx)(Ef.G,{opacity:".25",children:(0,Mp.jsx)(Ef.Path,{d:"M5.75 6A.25.25 0 0 1 6 5.75h3v-1.5H6A1.75 1.75 0 0 0 4.25 6v3h1.5V6ZM18 18.25h-3v1.5h3A1.75 1.75 0 0 0 19.75 18v-3h-1.5v3a.25.25 0 0 1-.25.25ZM18.25 9V6a.25.25 0 0 0-.25-.25h-3v-1.5h3c.966 0 1.75.784 1.75 1.75v3h-1.5ZM5.75 18v-3h-1.5v3c0 .966.784 1.75 1.75 1.75h3v-1.5H6a.25.25 0 0 1-.25-.25Z"})}),(0,Mp.jsx)(Ef.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M15 18.25h3a.25.25 0 0 0 .25-.25v-3h1.5v3A1.75 1.75 0 0 1 18 19.75h-3v-1.5Z"})]});var Tf=l(q(),1),Dp=l(w(),1),uA=(0,Dp.jsxs)(Tf.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,Dp.jsx)(Tf.G,{opacity:".25",children:(0,Dp.jsx)(Tf.Path,{d:"M5.75 6A.25.25 0 0 1 6 5.75h3v-1.5H6A1.75 1.75 0 0 0 4.25 6v3h1.5V6ZM18 18.25h-3v1.5h3A1.75 1.75 0 0 0 19.75 18v-3h-1.5v3a.25.25 0 0 1-.25.25ZM18.25 9V6a.25.25 0 0 0-.25-.25h-3v-1.5h3c.966 0 1.75.784 1.75 1.75v3h-1.5ZM5.75 18v-3h-1.5v3c0 .966.784 1.75 1.75 1.75h3v-1.5H6a.25.25 0 0 1-.25-.25Z"})}),(0,Dp.jsx)(Tf.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M6 5.75a.25.25 0 0 0-.25.25v3h-1.5V6c0-.966.784-1.75 1.75-1.75h3v1.5H6Z"})]});var If=l(q(),1),Vp=l(w(),1),dA=(0,Vp.jsxs)(If.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,Vp.jsx)(If.G,{opacity:".25",children:(0,Vp.jsx)(If.Path,{d:"M5.75 6A.25.25 0 0 1 6 5.75h3v-1.5H6A1.75 1.75 0 0 0 4.25 6v3h1.5V6ZM18 18.25h-3v1.5h3A1.75 1.75 0 0 0 19.75 18v-3h-1.5v3a.25.25 0 0 1-.25.25ZM18.25 9V6a.25.25 0 0 0-.25-.25h-3v-1.5h3c.966 0 1.75.784 1.75 1.75v3h-1.5ZM5.75 18v-3h-1.5v3c0 .966.784 1.75 1.75 1.75h3v-1.5H6a.25.25 0 0 1-.25-.25Z"})}),(0,Vp.jsx)(If.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M18.25 9V6a.25.25 0 0 0-.25-.25h-3v-1.5h3c.966 0 1.75.784 1.75 1.75v3h-1.5Z"})]});var J0=l(q(),1),fA=l(w(),1),mA=(0,fA.jsx)(J0.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,fA.jsx)(J0.Path,{d:"M20.5 16h-.7V8c0-1.1-.9-2-2-2H6.2c-1.1 0-2 .9-2 2v8h-.7c-.8 0-1.5.7-1.5 1.5h20c0-.8-.7-1.5-1.5-1.5zM5.7 8c0-.3.2-.5.5-.5h11.6c.3 0 .5.2.5.5v7.6H5.7V8z"})});var ex=l(q(),1),pA=l(w(),1),tv=(0,pA.jsx)(ex.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,pA.jsx)(ex.Path,{d:"M8 7h2V5H8v2zm0 6h2v-2H8v2zm0 6h2v-2H8v2zm6-14v2h2V5h-2zm0 8h2v-2h-2v2zm0 6h2v-2h-2v2z"})});var tx=l(q(),1),hA=l(w(),1),gA=(0,hA.jsx)(tx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,hA.jsx)(tx.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M3 7c0-1.1.9-2 2-2h14a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7Zm2-.5h14c.3 0 .5.2.5.5v1L12 13.5 4.5 7.9V7c0-.3.2-.5.5-.5Zm-.5 3.3V17c0 .3.2.5.5.5h14c.3 0 .5-.2.5-.5V9.8L12 15.4 4.5 9.8Z"})});var ox=l(q(),1),bA=l(w(),1),Pf=(0,bA.jsx)(ox.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,bA.jsx)(ox.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12.218 5.377a.25.25 0 0 0-.436 0l-7.29 12.96a.25.25 0 0 0 .218.373h14.58a.25.25 0 0 0 .218-.372l-7.29-12.96Zm-1.743-.735c.669-1.19 2.381-1.19 3.05 0l7.29 12.96a1.75 1.75 0 0 1-1.525 2.608H4.71a1.75 1.75 0 0 1-1.525-2.608l7.29-12.96ZM12.75 17.46h-1.5v-1.5h1.5v1.5Zm-1.5-3h1.5v-5h-1.5v5Z"})});var rx=l(q(),1),kA=l(w(),1),vA=(0,kA.jsx)(rx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,kA.jsx)(rx.Path,{d:"M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z"})});var nx=l(q(),1),yA=l(w(),1),SA=(0,yA.jsx)(nx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,yA.jsx)(nx.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12.848 8a1 1 0 0 1-.914-.594l-.723-1.63a.5.5 0 0 0-.447-.276H5a.5.5 0 0 0-.5.5v11.5a.5.5 0 0 0 .5.5h14a.5.5 0 0 0 .5-.5v-9A.5.5 0 0 0 19 8h-6.152Zm.612-1.5a.5.5 0 0 1-.462-.31l-.445-1.084A2 2 0 0 0 10.763 4H5a2 2 0 0 0-2 2v11.5a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-9a2 2 0 0 0-2-2h-5.54Z"})});var ix=l(q(),1),_A=l(w(),1),xA=(0,_A.jsx)(ix.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_A.jsx)(ix.Path,{d:"M12 4 4 19h16L12 4zm0 3.2 5.5 10.3H12V7.2z"})});var sx=l(q(),1),wA=l(w(),1),CA=(0,wA.jsx)(sx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,wA.jsx)(sx.Path,{d:"M7.1 6.8L3.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H7.1zm-.8 6.8L8 8.9l1.7 4.7H6.3zm14.5-1.5c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2 .1.8-.2 1.4-.6 2z"})});var ax=l(q(),1),BA=l(w(),1),EA=(0,BA.jsx)(ax.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,BA.jsx)(ax.Path,{d:"M11 16.8c-.1-.1-.2-.3-.3-.5v-2.6c0-.9-.1-1.7-.3-2.2-.2-.5-.5-.9-.9-1.2-.4-.2-.9-.3-1.6-.3-.5 0-1 .1-1.5.2s-.9.3-1.2.6l.2 1.2c.4-.3.7-.4 1.1-.5.3-.1.7-.2 1-.2.6 0 1 .1 1.3.4.3.2.4.7.4 1.4-1.2 0-2.3.2-3.3.7s-1.4 1.1-1.4 2.1c0 .7.2 1.2.7 1.6.4.4 1 .6 1.8.6.9 0 1.7-.4 2.4-1.2.1.3.2.5.4.7.1.2.3.3.6.4.3.1.6.1 1.1.1h.1l.2-1.2h-.1c-.4.1-.6 0-.7-.1zM9.2 16c-.2.3-.5.6-.9.8-.3.1-.7.2-1.1.2-.4 0-.7-.1-.9-.3-.2-.2-.3-.5-.3-.9 0-.6.2-1 .7-1.3.5-.3 1.3-.4 2.5-.5v2zm10.6-3.9c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2s-.2 1.4-.6 2z"})});var lx=l(q(),1),TA=l(w(),1),IA=(0,TA.jsx)(lx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,TA.jsx)(lx.Path,{d:"M9.1 9v-.5c0-.6.2-1.1.7-1.4.5-.3 1.2-.5 2-.5.7 0 1.4.1 2.1.3.7.2 1.4.5 2.1.9l.2-1.9c-.6-.3-1.2-.5-1.9-.7-.8-.1-1.6-.2-2.4-.2-1.5 0-2.7.3-3.6 1-.8.7-1.2 1.5-1.2 2.6V9h2zM20 12H4v1h8.3c.3.1.6.2.8.3.5.2.9.5 1.1.8.3.3.4.7.4 1.2 0 .7-.2 1.1-.8 1.5-.5.3-1.2.5-2.1.5-.8 0-1.6-.1-2.4-.3-.8-.2-1.5-.5-2.2-.8L7 18.1c.5.2 1.2.4 2 .6.8.2 1.6.3 2.4.3 1.7 0 3-.3 3.9-1 .9-.7 1.3-1.6 1.3-2.8 0-.9-.2-1.7-.7-2.2H20v-1z"})});var cx=l(q(),1),PA=l(w(),1),RA=(0,PA.jsx)(cx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,PA.jsx)(cx.Path,{d:"M7 18v1h10v-1H7zm5-2c1.5 0 2.6-.4 3.4-1.2.8-.8 1.1-2 1.1-3.5V5H15v5.8c0 1.2-.2 2.1-.6 2.8-.4.7-1.2 1-2.4 1s-2-.3-2.4-1c-.4-.7-.6-1.6-.6-2.8V5H7.5v6.2c0 1.5.4 2.7 1.1 3.5.8.9 1.9 1.3 3.4 1.3z"})});var ux=l(q(),1),OA=l(w(),1),AA=(0,OA.jsx)(ux.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,OA.jsx)(ux.Path,{d:"M6.1 6.8L2.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H6.1zm-.8 6.8L7 8.9l1.7 4.7H5.3zm15.1-.7c-.4-.5-.9-.8-1.6-1 .4-.2.7-.5.8-.9.2-.4.3-.9.3-1.4 0-.9-.3-1.6-.8-2-.6-.5-1.3-.7-2.4-.7h-3.5V18h4.2c1.1 0 2-.3 2.6-.8.6-.6 1-1.4 1-2.4-.1-.8-.3-1.4-.6-1.9zm-5.7-4.7h1.8c.6 0 1.1.1 1.4.4.3.2.5.7.5 1.3 0 .6-.2 1.1-.5 1.3-.3.2-.8.4-1.4.4h-1.8V8.2zm4 8c-.4.3-.9.5-1.5.5h-2.6v-3.8h2.6c1.4 0 2 .6 2 1.9.1.6-.1 1-.5 1.4z"})});var dx=l(q(),1),LA=l(w(),1),NA=(0,LA.jsx)(dx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,LA.jsx)(dx.Path,{d:"M12.75 19.45 15 17.5l1 1.1-4 3.4-4-3.4 1-1.1 2.25 1.95V14.5h1.5v4.95ZM19 12.75H5v-1.5h14v1.5ZM16 5.4l-1 1.1-2.25-1.95V9.5h-1.5V4.55L9 6.5 8 5.4 12 2l4 3.4Z"})});var fx=l(q(),1),MA=l(w(),1),mx=(0,MA.jsx)(fx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,MA.jsx)(fx.Path,{d:"M6 4a2 2 0 0 0-2 2v3h1.5V6a.5.5 0 0 1 .5-.5h3V4H6Zm3 14.5H6a.5.5 0 0 1-.5-.5v-3H4v3a2 2 0 0 0 2 2h3v-1.5Zm6 1.5v-1.5h3a.5.5 0 0 0 .5-.5v-3H20v3a2 2 0 0 1-2 2h-3Zm3-16a2 2 0 0 1 2 2v3h-1.5V6a.5.5 0 0 0-.5-.5h-3V4h3Z"})});var px=l(q(),1),DA=l(w(),1),ov=(0,DA.jsx)(px.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,DA.jsx)(px.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-8Zm6.5 8c0 .6 0 1.2-.2 1.8h-2.7c0-.6.2-1.1.2-1.8s0-1.2-.2-1.8h2.7c.2.6.2 1.1.2 1.8Zm-.9-3.2h-2.4c-.3-.9-.7-1.8-1.1-2.4-.1-.2-.2-.4-.3-.5 1.6.5 3 1.6 3.8 3ZM12.8 17c-.3.5-.6 1-.8 1.3-.2-.3-.5-.8-.8-1.3-.3-.5-.6-1.1-.8-1.7h3.3c-.2.6-.5 1.2-.8 1.7Zm-2.9-3.2c-.1-.6-.2-1.1-.2-1.8s0-1.2.2-1.8H14c.1.6.2 1.1.2 1.8s0 1.2-.2 1.8H9.9ZM11.2 7c.3-.5.6-1 .8-1.3.2.3.5.8.8 1.3.3.5.6 1.1.8 1.7h-3.3c.2-.6.5-1.2.8-1.7Zm-1-1.2c-.1.2-.2.3-.3.5-.4.7-.8 1.5-1.1 2.4H6.4c.8-1.4 2.2-2.5 3.8-3Zm-1.8 8H5.7c-.2-.6-.2-1.1-.2-1.8s0-1.2.2-1.8h2.7c0 .6-.2 1.1-.2 1.8s0 1.2.2 1.8Zm-2 1.4h2.4c.3.9.7 1.8 1.1 2.4.1.2.2.4.3.5-1.6-.5-3-1.6-3.8-3Zm7.4 3c.1-.2.2-.3.3-.5.4-.7.8-1.5 1.1-2.4h2.4c-.8 1.4-2.2 2.5-3.8 3Z"})});var hx=l(q(),1),VA=l(w(),1),rv=(0,VA.jsx)(hx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,VA.jsx)(hx.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"m3 5c0-1.10457.89543-2 2-2h13.5c1.1046 0 2 .89543 2 2v13.5c0 1.1046-.8954 2-2 2h-13.5c-1.10457 0-2-.8954-2-2zm2-.5h6v6.5h-6.5v-6c0-.27614.22386-.5.5-.5zm-.5 8v6c0 .2761.22386.5.5.5h6v-6.5zm8 0v6.5h6c.2761 0 .5-.2239.5-.5v-6zm0-8v6.5h6.5v-6c0-.27614-.2239-.5-.5-.5z"})});var gx=l(q(),1),FA=l(w(),1),nv=(0,FA.jsx)(gx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,FA.jsx)(gx.Path,{d:"M18 4h-7c-1.1 0-2 .9-2 2v3H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-3h3c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h3V13c0 1.1.9 2 2 2h2.5v3zm0-4.5H11c-.3 0-.5-.2-.5-.5v-2.5H13c.3 0 .5.2.5.5v2.5zm5-.5c0 .3-.2.5-.5.5h-3V11c0-1.1-.9-2-2-2h-2.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7z"})});var bx=l(q(),1),zA=l(w(),1),jA=(0,zA.jsx)(bx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,zA.jsx)(bx.Path,{d:"M17.6 7c-.6.9-1.5 1.7-2.6 2v1h2v7h2V7h-1.4zM11 11H7V7H5v10h2v-4h4v4h2V7h-2v4z"})});var kx=l(q(),1),UA=l(w(),1),HA=(0,UA.jsx)(kx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,UA.jsx)(kx.Path,{d:"M9 11.1H5v-4H3v10h2v-4h4v4h2v-10H9v4zm8 4c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6v1.5h8v-2H17z"})});var vx=l(q(),1),GA=l(w(),1),WA=(0,GA.jsx)(vx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,GA.jsx)(vx.Path,{d:"M9 11H5V7H3v10h2v-4h4v4h2V7H9v4zm11.3 1.7c-.4-.4-1-.7-1.6-.8v-.1c.6-.2 1.1-.5 1.5-.9.3-.4.5-.8.5-1.3 0-.4-.1-.8-.3-1.1-.2-.3-.5-.6-.8-.8-.4-.2-.8-.4-1.2-.5-.6-.1-1.1-.2-1.6-.2-.6 0-1.3.1-1.8.3s-1.1.5-1.6.9l1.2 1.4c.4-.2.7-.4 1.1-.6.3-.2.7-.3 1.1-.3.4 0 .8.1 1.1.3.3.2.4.5.4.8 0 .4-.2.7-.6.9-.7.3-1.5.5-2.2.4v1.6c.5 0 1 0 1.5.1.3.1.7.2 1 .3.2.1.4.2.5.4s.1.4.1.6c0 .3-.2.7-.5.8-.4.2-.9.3-1.4.3s-1-.1-1.4-.3c-.4-.2-.8-.4-1.2-.7L13 15.6c.5.4 1 .8 1.6 1 .7.3 1.5.4 2.3.4.6 0 1.1-.1 1.6-.2.4-.1.9-.2 1.3-.5.4-.2.7-.5.9-.9.2-.4.3-.8.3-1.2 0-.6-.3-1.1-.7-1.5z"})});var yx=l(q(),1),$A=l(w(),1),KA=(0,$A.jsx)(yx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$A.jsx)(yx.Path,{d:"M20 13V7h-3l-4 6v2h5v2h2v-2h1v-2h-1zm-2 0h-2.8L18 9v4zm-9-2H5V7H3v10h2v-4h4v4h2V7H9v4z"})});var Sx=l(q(),1),YA=l(w(),1),qA=(0,YA.jsx)(Sx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,YA.jsx)(Sx.Path,{d:"M9 11H5V7H3v10h2v-4h4v4h2V7H9v4zm11.7 1.2c-.2-.3-.5-.7-.8-.9-.3-.3-.7-.5-1.1-.6-.5-.1-.9-.2-1.4-.2-.2 0-.5.1-.7.1-.2.1-.5.1-.7.2l.1-1.9h4.3V7H14l-.3 5 1 .6.5-.2.4-.1c.1-.1.3-.1.4-.1h.5c.5 0 1 .1 1.4.4.4.2.6.7.6 1.1 0 .4-.2.8-.6 1.1-.4.3-.9.4-1.4.4-.4 0-.9-.1-1.3-.3-.4-.2-.7-.4-1.1-.7 0 0-1.1 1.4-1 1.5.5.4 1 .8 1.6 1 .7.3 1.5.4 2.3.4.5 0 1-.1 1.5-.3s.9-.4 1.3-.7c.4-.3.7-.7.9-1.1s.3-.9.3-1.4-.1-1-.3-1.4z"})});var _x=l(q(),1),ZA=l(w(),1),XA=(0,ZA.jsx)(_x.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,ZA.jsx)(_x.Path,{d:"M20.7 12.4c-.2-.3-.4-.6-.7-.9s-.6-.5-1-.6c-.4-.2-.8-.2-1.2-.2-.5 0-.9.1-1.3.3s-.8.5-1.2.8c0-.5 0-.9.2-1.4l.6-.9c.2-.2.5-.4.8-.5.6-.2 1.3-.2 1.9 0 .3.1.6.3.8.5 0 0 1.3-1.3 1.3-1.4-.4-.3-.9-.6-1.4-.8-.6-.2-1.3-.3-2-.3-.6 0-1.1.1-1.7.4-.5.2-1 .5-1.4.9-.4.4-.8 1-1 1.6-.3.7-.4 1.5-.4 2.3s.1 1.5.3 2.1c.2.6.6 1.1 1 1.5.4.4.9.7 1.4.9 1 .3 2 .3 3 0 .4-.1.8-.3 1.2-.6.3-.3.6-.6.8-1 .2-.5.3-.9.3-1.4s-.1-.9-.3-1.3zm-2 2.1c-.1.2-.3.4-.4.5-.1.1-.3.2-.5.2-.2.1-.4.1-.6.1-.2.1-.5 0-.7-.1-.2 0-.3-.2-.5-.3-.1-.2-.3-.4-.4-.6-.2-.3-.3-.7-.3-1 .3-.3.6-.5 1-.7.3-.1.7-.2 1-.2.4 0 .8.1 1.1.3.3.3.4.7.4 1.1 0 .2 0 .5-.1.7zM9 11H5V7H3v10h2v-4h4v4h2V7H9v4z"})});var xx=l(q(),1),QA=l(w(),1),JA=(0,QA.jsx)(xx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,QA.jsx)(xx.Path,{d:"M12 4L4 7.9V20h16V7.9L12 4zm6.5 14.5H14V13h-4v5.5H5.5V8.8L12 5.7l6.5 3.1v9.7z"})});var wx=l(q(),1),eL=l(w(),1),iv=(0,eL.jsx)(wx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,eL.jsx)(wx.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v8.4l-3-2.9c-.3-.3-.8-.3-1 0L11.9 14 9 12c-.3-.2-.6-.2-.8 0l-3.6 2.6V5c-.1-.3.1-.5.4-.5zm14 15H5c-.3 0-.5-.2-.5-.5v-2.4l4.1-3 3 1.9c.3.2.7.2.9-.1L16 12l3.5 3.4V19c0 .3-.2.5-.5.5z"})});var Cx=l(q(),1),tL=l(w(),1),oL=(0,tL.jsx)(Cx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,tL.jsx)(Cx.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5.5 12a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm.75 4v1.5h-1.5V8h1.5Zm0 8v-5h-1.5v5h1.5Z"})});var Bx=l(q(),1),rL=l(w(),1),nL=(0,rL.jsx)(Bx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,rL.jsx)(Bx.Path,{d:"M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z"})});var Ex=l(q(),1),iL=l(w(),1),sL=(0,iL.jsx)(Ex.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,iL.jsx)(Ex.Path,{d:"M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z"})});var Tx=l(q(),1),aL=l(w(),1),ou=(0,aL.jsx)(Tx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,aL.jsx)(Tx.Path,{d:"M12.5 15v5H11v-5H4V9h7V4h1.5v5h7v6h-7Z"})});var Ix=l(q(),1),lL=l(w(),1),ru=(0,lL.jsx)(Ix.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,lL.jsx)(Ix.Path,{d:"M9 9v6h11V9H9zM4 20h1.5V4H4v16z"})});var Px=l(q(),1),cL=l(w(),1),nu=(0,cL.jsx)(Px.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,cL.jsx)(Px.Path,{d:"M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z"})});var Rx=l(q(),1),uL=l(w(),1),dL=(0,uL.jsx)(Rx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,uL.jsx)(Rx.Path,{d:"M7 4H17V8L7 8V4ZM7 16L17 16V20L7 20V16ZM20 11.25H4V12.75H20V11.25Z"})});var Ox=l(q(),1),fL=l(w(),1),Fp=(0,fL.jsx)(Ox.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,fL.jsx)(Ox.Path,{d:"M9 15h6V9H9v6zm-5 5h1.5V4H4v16zM18.5 4v16H20V4h-1.5z"})});var Ax=l(q(),1),mL=l(w(),1),pL=(0,mL.jsx)(Ax.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,mL.jsx)(Ax.Path,{d:"M4 4L20 4L20 5.5L4 5.5L4 4ZM10 7L14 7L14 17L10 17L10 7ZM20 18.5L4 18.5L4 20L20 20L20 18.5Z"})});var Lx=l(q(),1),hL=l(w(),1),zp=(0,hL.jsx)(Lx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,hL.jsx)(Lx.Path,{d:"M4 4H5.5V20H4V4ZM7 10L17 10V14L7 14V10ZM20 4H18.5V20H20V4Z"})});var Nx=l(q(),1),gL=l(w(),1),bL=(0,gL.jsx)(Nx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,gL.jsx)(Nx.Path,{d:"M9 20h6V9H9v11zM4 4v1.5h16V4H4z"})});var Mx=l(q(),1),kL=l(w(),1),bl=(0,kL.jsx)(Mx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,kL.jsx)(Mx.Path,{d:"m6.734 16.106 2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.158 1.093-1.028-2.176-2.38h2.811c1.125 0 2.25.03 3.374 0 1.428-.001 3.362-.25 4.963-1.277 1.66-1.065 2.868-2.906 2.868-5.859 0-2.479-1.327-4.896-3.65-5.93-1.82-.813-3.044-.8-4.806-.788l-.567.002v1.5c.184 0 .368 0 .553-.002 1.82-.007 2.704-.014 4.21.657 1.854.827 2.76 2.657 2.76 4.561 0 2.472-.973 3.824-2.178 4.596-1.258.807-2.864 1.04-4.163 1.04h-.02c-1.115.03-2.229 0-3.344 0H6.734Z"})});var Dx=l(q(),1),vL=l(w(),1),yL=(0,vL.jsx)(Dx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,vL.jsx)(Dx.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 Vx=l(q(),1),SL=l(w(),1),Ci=(0,SL.jsx)(Vx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,SL.jsx)(Vx.Path,{d:"M17.031 4.703 15.576 4l-1.56 3H14v.03l-2.324 4.47H9.5V13h1.396l-1.502 2.889h-.95a3.694 3.694 0 0 1 0-7.389H10V7H8.444a5.194 5.194 0 1 0 0 10.389h.17L7.5 19.53l1.416.719L15.049 8.5h.507a3.694 3.694 0 0 1 0 7.39H14v1.5h1.556a5.194 5.194 0 0 0 .273-10.383l1.202-2.304Z"})});var Fx=l(q(),1),_L=l(w(),1),fn=(0,_L.jsx)(Fx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_L.jsx)(Fx.Path,{d:"M10 17.389H8.444A5.194 5.194 0 1 1 8.444 7H10v1.5H8.444a3.694 3.694 0 0 0 0 7.389H10v1.5ZM14 7h1.556a5.194 5.194 0 0 1 0 10.39H14v-1.5h1.556a3.694 3.694 0 0 0 0-7.39H14V7Zm-4.5 6h5v-1.5h-5V13Z"})});var zx=l(q(),1),xL=l(w(),1),sv=(0,xL.jsx)(zx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,xL.jsx)(zx.Path,{d:"M3 6h11v1.5H3V6Zm3.5 5.5h11V13h-11v-1.5ZM21 17H10v1.5h11V17Z"})});var jx=l(q(),1),wL=l(w(),1),CL=(0,wL.jsx)(jx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,wL.jsx)(jx.Path,{d:"M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1zM9.8 7c0-1.2 1-2.2 2.2-2.2 1.2 0 2.2 1 2.2 2.2v3H9.8V7zm6.7 11.5h-9v-7h9v7z"})});var Ux=l(q(),1),BL=l(w(),1),EL=(0,BL.jsx)(Ux.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,BL.jsx)(Ux.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M15 11h-.2V9c0-1.5-1.2-2.8-2.8-2.8S9.2 7.5 9.2 9v2H9c-.6 0-1 .4-1 1v4c0 .6.4 1 1 1h6c.6 0 1-.4 1-1v-4c0-.6-.4-1-1-1zm-1.8 0h-2.5V9c0-.7.6-1.2 1.2-1.2s1.2.6 1.2 1.2v2z"})});var Hx=l(q(),1),TL=l(w(),1),Rf=(0,TL.jsx)(Hx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,TL.jsx)(Hx.Path,{d:"M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1zm-2.8 0H9.8V7c0-1.2 1-2.2 2.2-2.2s2.2 1 2.2 2.2v3z"})});var av=l(q(),1),lv=l(w(),1),jp=(0,lv.jsxs)(av.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,lv.jsx)(av.Path,{d:"m7 6.5 4 2.5-4 2.5z"}),(0,lv.jsx)(av.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"m5 3c-1.10457 0-2 .89543-2 2v14c0 1.1046.89543 2 2 2h14c1.1046 0 2-.8954 2-2v-14c0-1.10457-.8954-2-2-2zm14 1.5h-14c-.27614 0-.5.22386-.5.5v10.7072l3.62953-2.6465c.25108-.1831.58905-.1924.84981-.0234l2.92666 1.8969 3.5712-3.4719c.2911-.2831.7545-.2831 1.0456 0l2.9772 2.8945v-9.3568c0-.27614-.2239-.5-.5-.5zm-14.5 14.5v-1.4364l4.09643-2.987 2.99567 1.9417c.2936.1903.6798.1523.9307-.0917l3.4772-3.3806 3.4772 3.3806.0228-.0234v2.5968c0 .2761-.2239.5-.5.5h-14c-.27614 0-.5-.2239-.5-.5z"})]});var Gx=l(q(),1),IL=l(w(),1),cv=(0,IL.jsx)(Gx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,IL.jsx)(Gx.Path,{d:"M15 4H9c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h6c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H9c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h6c.3 0 .5.2.5.5v12zm-4.5-.5h2V16h-2v1.5z"})});var Wx=l(q(),1),PL=l(w(),1),ks=(0,PL.jsx)(Wx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,PL.jsx)(Wx.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})});var uv=l(q(),1),dv=l(w(),1),kl=(0,dv.jsxs)(uv.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,dv.jsx)(uv.Path,{d:"M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z"}),(0,dv.jsx)(uv.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 $x=l(q(),1),RL=l(w(),1),OL=(0,RL.jsx)($x.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,RL.jsx)($x.Path,{d:"m9.99609 14v-.2251l.00391.0001v6.225h1.5v-14.5h2.5v14.5h1.5v-14.5h3v-1.5h-8.50391c-2.76142 0-5 2.23858-5 5 0 2.7614 2.23858 5 5 5z"})});var Kx=l(q(),1),AL=l(w(),1),Of=(0,AL.jsx)(Kx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,AL.jsx)(Kx.Path,{d:"m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z"})});var Yx=l(q(),1),LL=l(w(),1),NL=(0,LL.jsx)(Yx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,LL.jsx)(Yx.Path,{d:"M10.97 10.159a3.382 3.382 0 0 0-2.857.955l1.724 1.723-2.836 2.913L7 17h1.25l2.913-2.837 1.723 1.723a3.38 3.38 0 0 0 .606-.825c.33-.63.446-1.343.35-2.032L17 10.695 13.305 7l-2.334 3.159Z"})});var qx=l(q(),1),ML=l(w(),1),Bi=(0,ML.jsx)(qx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,ML.jsx)(qx.Path,{d:"M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"})});var Zx=l(q(),1),DL=l(w(),1),VL=(0,DL.jsx)(Zx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,DL.jsx)(Zx.Path,{d:"M19 5.5H5V4h14v1.5ZM19 20H5v-1.5h14V20ZM7 9h10v6H7V9Z"})});var Xx=l(q(),1),FL=l(w(),1),zL=(0,FL.jsx)(Xx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,FL.jsx)(Xx.Path,{d:"M5 5.5h8V4H5v1.5ZM5 20h8v-1.5H5V20ZM19 9H5v6h14V9Z"})});var Qx=l(q(),1),jL=l(w(),1),UL=(0,jL.jsx)(Qx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,jL.jsx)(Qx.Path,{d:"M19 5.5h-8V4h8v1.5ZM19 20h-8v-1.5h8V20ZM5 9h14v6H5V9Z"})});var Jx=l(q(),1),HL=l(w(),1),GL=(0,HL.jsx)(Jx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,HL.jsx)(Jx.Path,{d:"M19 3H5c-.6 0-1 .4-1 1v7c0 .5.4 1 1 1h14c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1zM5.5 10.5v-.4l1.8-1.3 1.3.8c.3.2.7.2.9-.1L11 8.1l2.4 2.4H5.5zm13 0h-2.9l-4-4c-.3-.3-.8-.3-1.1 0L8.9 8l-1.2-.8c-.3-.2-.6-.2-.9 0l-1.3 1V4.5h13v6zM4 20h9v-1.5H4V20zm0-4h16v-1.5H4V16z"})});var ew=l(q(),1),WL=l(w(),1),$L=(0,WL.jsx)(ew.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,WL.jsx)(ew.Path,{d:"M18 5.5H6a.5.5 0 0 0-.5.5v12a.5.5 0 0 0 .5.5h12a.5.5 0 0 0 .5-.5V6a.5.5 0 0 0-.5-.5ZM6 4h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2Zm1 5h1.5v1.5H7V9Zm1.5 4.5H7V15h1.5v-1.5ZM10 9h7v1.5h-7V9Zm7 4.5h-7V15h7v-1.5Z"})});var tw=l(q(),1),KL=l(w(),1),YL=(0,KL.jsx)(tw.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,KL.jsx)(tw.Path,{d:"m7.3 9.7 1.4 1.4c.2-.2.3-.3.4-.5 0 0 0-.1.1-.1.3-.5.4-1.1.3-1.6L12 7 9 4 7.2 6.5c-.6-.1-1.1 0-1.6.3 0 0-.1 0-.1.1-.3.1-.4.2-.6.4l1.4 1.4L4 11v1h1l2.3-2.3zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z"})});var ow=l(q(),1),qL=l(w(),1),Dr=(0,qL.jsx)(ow.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,qL.jsx)(ow.Path,{d:"M7 11.5h10V13H7z"})});var rw=l(q(),1),ZL=l(w(),1),XL=(0,ZL.jsx)(rw.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,ZL.jsx)(rw.Path,{d:"M15.1 4.8l-3-2.5V4c-4.4 0-8 3.6-8 8 0 3.7 2.5 6.9 6 7.7.3.1.6.1 1 .2l.2-1.5c-.4 0-.7-.1-1.1-.2l-.1.2v-.2c-2.6-.8-4.5-3.3-4.5-6.2 0-3.6 2.9-6.5 6.5-6.5v1.8l3-2.5zM20 11c-.2-1.4-.7-2.7-1.6-3.8l-1.2.8c.7.9 1.1 2 1.3 3.1L20 11zm-1.5 1.8c-.1.5-.2 1.1-.4 1.6s-.5 1-.8 1.5l1.2.9c.4-.5.8-1.1 1-1.8s.5-1.3.5-2l-1.5-.2zm-5.6 5.6l.2 1.5c1.4-.2 2.7-.7 3.8-1.6l-.9-1.1c-.9.7-2 1.1-3.1 1.2z"})});var nw=l(q(),1),QL=l(w(),1),JL=(0,QL.jsx)(nw.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,QL.jsx)(nw.Path,{d:"M4 6.5h5a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H4V16h5a.5.5 0 0 0 .5-.5v-7A.5.5 0 0 0 9 8H4V6.5Zm16 0h-5a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h5V16h-5a.5.5 0 0 1-.5-.5v-7A.5.5 0 0 1 15 8h5V6.5Z"})});var iw=l(q(),1),eN=l(w(),1),tN=(0,eN.jsx)(iw.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,eN.jsx)(iw.Path,{d:"M13 5c-3.3 0-6 2.7-6 6 0 1.4.5 2.7 1.3 3.7l-3.8 3.8 1.1 1.1 3.8-3.8c1 .8 2.3 1.3 3.7 1.3 3.3 0 6-2.7 6-6S16.3 5 13 5zm0 10.5c-2.5 0-4.5-2-4.5-4.5s2-4.5 4.5-4.5 4.5 2 4.5 4.5-2 4.5-4.5 4.5z"})});var sw=l(q(),1),oN=l(w(),1),Af=(0,oN.jsx)(sw.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oN.jsx)(sw.Path,{d:"M3.99961 13C4.67043 13.3354 4.6703 13.3357 4.67017 13.3359L4.67298 13.3305C4.67621 13.3242 4.68184 13.3135 4.68988 13.2985C4.70595 13.2686 4.7316 13.2218 4.76695 13.1608C4.8377 13.0385 4.94692 12.8592 5.09541 12.6419C5.39312 12.2062 5.84436 11.624 6.45435 11.0431C7.67308 9.88241 9.49719 8.75 11.9996 8.75C14.502 8.75 16.3261 9.88241 17.5449 11.0431C18.1549 11.624 18.6061 12.2062 18.9038 12.6419C19.0523 12.8592 19.1615 13.0385 19.2323 13.1608C19.2676 13.2218 19.2933 13.2686 19.3093 13.2985C19.3174 13.3135 19.323 13.3242 19.3262 13.3305L19.3291 13.3359C19.3289 13.3357 19.3288 13.3354 19.9996 13C20.6704 12.6646 20.6703 12.6643 20.6701 12.664L20.6697 12.6632L20.6688 12.6614L20.6662 12.6563L20.6583 12.6408C20.6517 12.6282 20.6427 12.6108 20.631 12.5892C20.6078 12.5459 20.5744 12.4852 20.5306 12.4096C20.4432 12.2584 20.3141 12.0471 20.1423 11.7956C19.7994 11.2938 19.2819 10.626 18.5794 9.9569C17.1731 8.61759 14.9972 7.25 11.9996 7.25C9.00203 7.25 6.82614 8.61759 5.41987 9.9569C4.71736 10.626 4.19984 11.2938 3.85694 11.7956C3.68511 12.0471 3.55605 12.2584 3.4686 12.4096C3.42484 12.4852 3.39142 12.5459 3.36818 12.5892C3.35656 12.6108 3.34748 12.6282 3.34092 12.6408L3.33297 12.6563L3.33041 12.6614L3.32948 12.6632L3.32911 12.664C3.32894 12.6643 3.32879 12.6646 3.99961 13ZM11.9996 16C13.9326 16 15.4996 14.433 15.4996 12.5C15.4996 10.567 13.9326 9 11.9996 9C10.0666 9 8.49961 10.567 8.49961 12.5C8.49961 14.433 10.0666 16 11.9996 16Z"})});var fv=l(q(),1),mv=l(w(),1),rN=(0,mv.jsxs)(fv.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,mv.jsx)(fv.Path,{d:"m19 7.5h-7.628c-.3089-.87389-1.1423-1.5-2.122-1.5-.97966 0-1.81309.62611-2.12197 1.5h-2.12803v1.5h2.12803c.30888.87389 1.14231 1.5 2.12197 1.5.9797 0 1.8131-.62611 2.122-1.5h7.628z"}),(0,mv.jsx)(fv.Path,{d:"m19 15h-2.128c-.3089-.8739-1.1423-1.5-2.122-1.5s-1.8131.6261-2.122 1.5h-7.628v1.5h7.628c.3089.8739 1.1423 1.5 2.122 1.5s1.8131-.6261 2.122-1.5h2.128z"})]});var aw=l(q(),1),nN=l(w(),1),iN=(0,nN.jsx)(aw.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,nN.jsx)(aw.Path,{d:"M12 8c-2.2 0-4 1.8-4 4s1.8 4 4 4 4-1.8 4-4-1.8-4-4-4zm0 6.5c-1.4 0-2.5-1.1-2.5-2.5s1.1-2.5 2.5-2.5 2.5 1.1 2.5 2.5-1.1 2.5-2.5 2.5zM12.8 3h-1.5v3h1.5V3zm-1.6 18h1.5v-3h-1.5v3zm6.8-9.8v1.5h3v-1.5h-3zm-12 0H3v1.5h3v-1.5zm9.7 5.6 2.1 2.1 1.1-1.1-2.1-2.1-1.1 1.1zM8.3 7.2 6.2 5.1 5.1 6.2l2.1 2.1 1.1-1.1zM5.1 17.8l1.1 1.1 2.1-2.1-1.1-1.1-2.1 2.1zM18.9 6.2l-1.1-1.1-2.1 2.1 1.1 1.1 2.1-2.1z"})});var lw=l(q(),1),sN=l(w(),1),cw=(0,sN.jsx)(lw.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,sN.jsx)(lw.Path,{d:"m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z"})});var pv=l(q(),1),hv=l(w(),1),aN=(0,hv.jsxs)(pv.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,hv.jsx)(pv.Path,{d:"m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z",style:{opacity:.25}}),(0,hv.jsx)(pv.Path,{d:"m16.5 19.5h-9v-1.5h9z"})]});var Up=l(q(),1),Hp=l(w(),1),lN=(0,Hp.jsxs)(Up.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,Hp.jsx)(Up.Path,{d:"m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z",style:{opacity:.25}}),(0,Hp.jsx)(Up.Path,{d:"m4.5 7.5v9h1.5v-9z"}),(0,Hp.jsx)(Up.Path,{d:"m18 7.5v9h1.5v-9z"})]});var gv=l(q(),1),bv=l(w(),1),cN=(0,bv.jsxs)(gv.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,bv.jsx)(gv.Path,{d:"m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z",style:{opacity:.25}}),(0,bv.jsx)(gv.Path,{d:"m4.5 16.5v-9h1.5v9z"})]});var kv=l(q(),1),vv=l(w(),1),uN=(0,vv.jsxs)(kv.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,vv.jsx)(kv.Path,{d:"m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z",style:{opacity:.25}}),(0,vv.jsx)(kv.Path,{d:"m18 16.5v-9h1.5v9z"})]});var yv=l(q(),1),Sv=l(w(),1),dN=(0,Sv.jsxs)(yv.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,Sv.jsx)(yv.Path,{d:"m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z",style:{opacity:.25}}),(0,Sv.jsx)(yv.Path,{d:"m16.5 6h-9v-1.5h9z"})]});var Gp=l(q(),1),Wp=l(w(),1),fN=(0,Wp.jsxs)(Gp.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,Wp.jsx)(Gp.Path,{d:"m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z",style:{opacity:.25}}),(0,Wp.jsx)(Gp.Path,{d:"m7.5 6h9v-1.5h-9z"}),(0,Wp.jsx)(Gp.Path,{d:"m7.5 19.5h9v-1.5h-9z"})]});var uw=l(q(),1),mN=l(w(),1),pN=(0,mN.jsx)(uw.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,mN.jsx)(uw.Path,{d:"M17.5 4v5a2 2 0 0 1-2 2h-7a2 2 0 0 1-2-2V4H8v5a.5.5 0 0 0 .5.5h7A.5.5 0 0 0 16 9V4h1.5Zm0 16v-5a2 2 0 0 0-2-2h-7a2 2 0 0 0-2 2v5H8v-5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 .5.5v5h1.5Z"})});var dw=l(q(),1),hN=l(w(),1),_v=(0,hN.jsx)(dw.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,hN.jsx)(dw.Path,{d:"M5 4h14v11H5V4Zm11 16H8v-1.5h8V20Z"})});var fw=l(q(),1),gN=l(w(),1),Lf=(0,gN.jsx)(fw.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,gN.jsx)(fw.Path,{d:"M16 5.5H8V4h8v1.5ZM16 20H8v-1.5h8V20ZM5 9h14v6H5V9Z"})});var mw=l(q(),1),bN=l(w(),1),kN=(0,bN.jsx)(mw.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,bN.jsx)(mw.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 pw=l(q(),1),vN=l(w(),1),Ei=(0,vN.jsx)(pw.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,vN.jsx)(pw.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 hw=l(q(),1),yN=l(w(),1),SN=(0,yN.jsx)(hw.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,yN.jsx)(hw.Path,{d:"M17 4H7c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H7c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h10c.3 0 .5.2.5.5v12zm-7.5-.5h4V16h-4v1.5z"})});var gw=l(q(),1),_N=l(w(),1),xN=(0,_N.jsx)(gw.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_N.jsx)(gw.Path,{d:"M4.75 4a.75.75 0 0 0-.75.75v7.826c0 .2.08.39.22.53l6.72 6.716a2.313 2.313 0 0 0 3.276-.001l5.61-5.611-.531-.53.532.528a2.315 2.315 0 0 0 0-3.264L13.104 4.22a.75.75 0 0 0-.53-.22H4.75ZM19 12.576a.815.815 0 0 1-.236.574l-5.61 5.611a.814.814 0 0 1-1.153 0L5.5 12.264V5.5h6.763l6.5 6.502a.816.816 0 0 1 .237.574ZM8.75 9.75a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"})});var bw=l(q(),1),wN=l(w(),1),CN=(0,wN.jsx)(bw.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,wN.jsx)(bw.Path,{d:"M8.2 14.4h3.9L13 17h1.7L11 6.5H9.3L5.6 17h1.7l.9-2.6zm2-5.5 1.4 4H8.8l1.4-4zm7.4 7.5-1.3.8.8 1.4H5.5V20h14.3l-2.2-3.6z"})});var kw=l(q(),1),BN=l(w(),1),EN=(0,BN.jsx)(kw.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,BN.jsx)(kw.Path,{d:"M7 5.6v1.7l2.6.9v3.9L7 13v1.7L17.5 11V9.3L7 5.6zm4.2 6V8.8l4 1.4-4 1.4zm-5.7 5.6V5.5H4v14.3l3.6-2.2-.8-1.3-1.3.9z"})});var vw=l(q(),1),TN=l(w(),1),IN=(0,TN.jsx)(vw.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,TN.jsx)(vw.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z"})});var yw=l(q(),1),PN=l(w(),1),RN=(0,PN.jsx)(yw.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,PN.jsx)(yw.Path,{d:"M18 4h-7c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 9c0 .3-.2.5-.5.5h-7c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7zm-5 5c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h1V9H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-1h-1.5v1z"})});var Sw=l(q(),1),ON=l(w(),1),vl=(0,ON.jsx)(Sw.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,ON.jsx)(Sw.Path,{d:"M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8h1.5c0-1.2 1-2.2 2.2-2.2s2.2 1 2.2 2.2v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1z"})});var _w=l(q(),1),AN=l(w(),1),vs=(0,AN.jsx)(_w.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,AN.jsx)(_w.Path,{d:"M20.7 12.7s0-.1-.1-.2c0-.2-.2-.4-.4-.6-.3-.5-.9-1.2-1.6-1.8-.7-.6-1.5-1.3-2.6-1.8l-.6 1.4c.9.4 1.6 1 2.1 1.5.6.6 1.1 1.2 1.4 1.6.1.2.3.4.3.5v.1l.7-.3.7-.3Zm-5.2-9.3-1.8 4c-.5-.1-1.1-.2-1.7-.2-3 0-5.2 1.4-6.6 2.7-.7.7-1.2 1.3-1.6 1.8-.2.3-.3.5-.4.6 0 0 0 .1-.1.2s0 0 .7.3l.7.3V13c0-.1.2-.3.3-.5.3-.4.7-1 1.4-1.6 1.2-1.2 3-2.3 5.5-2.3H13v.3c-.4 0-.8-.1-1.1-.1-1.9 0-3.5 1.6-3.5 3.5s.6 2.3 1.6 2.9l-2 4.4.9.4 7.6-16.2-.9-.4Zm-3 12.6c1.7-.2 3-1.7 3-3.5s-.2-1.4-.6-1.9L12.4 16Z"})});var xw=l(q(),1),LN=l(w(),1),NN=(0,LN.jsx)(xw.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,LN.jsx)(xw.Path,{d:"M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z"})});var ww=l(q(),1),MN=l(w(),1),DN=(0,MN.jsx)(ww.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,MN.jsx)(ww.Path,{d:"M17.8 2l-.9.3c-.1 0-3.6 1-5.2 2.1C10 5.5 9.3 6.5 8.9 7.1c-.6.9-1.7 4.7-1.7 6.3l-.9 2.3c-.2.4 0 .8.4 1 .1 0 .2.1.3.1.3 0 .6-.2.7-.5l.6-1.5c.3 0 .7-.1 1.2-.2.7-.1 1.4-.3 2.2-.5.8-.2 1.6-.5 2.4-.8.7-.3 1.4-.7 1.9-1.2s.8-1.2 1-1.9c.2-.7.3-1.6.4-2.4.1-.8.1-1.7.2-2.5 0-.8.1-1.5.2-2.1V2zm-1.9 5.6c-.1.8-.2 1.5-.3 2.1-.2.6-.4 1-.6 1.3-.3.3-.8.6-1.4.9-.7.3-1.4.5-2.2.8-.6.2-1.3.3-1.8.4L15 7.5c.3-.3.6-.7 1-1.1 0 .4 0 .8-.1 1.2zM6 20h8v-1.5H6V20z"})});var Cw=l(q(),1),VN=l(w(),1),FN=(0,VN.jsx)(Cw.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,VN.jsx)(Cw.Path,{d:"M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h13.4c.4 0 .8.4.8.8v13.4zM10 15l5-3-5-3v6z"})});var _l=l(dr(),1),jn=l(Re(),1),Ee=l(F(),1);var hj=l($(),1),gj=l(oj(),1);var Kt="core/block-editor";var Tw={};Ip(Tw,{getAllPatterns:()=>xhe,getBlockRemovalRules:()=>bhe,getBlockSettings:()=>nj,getBlockStyles:()=>Ihe,getBlockWithoutAttributes:()=>fhe,getClosestAllowedInsertionPoint:()=>lj,getClosestAllowedInsertionPointForPattern:()=>Rhe,getContentLockingParent:()=>zN,getEditedContentOnlySection:()=>jN,getEnabledBlockParents:()=>hhe,getEnabledClientIdsTree:()=>phe,getExpandedBlock:()=>The,getInserterMediaCategories:()=>yhe,getInsertionPoint:()=>Ohe,getLastFocus:()=>Bhe,getLastInsertedBlocksClientIds:()=>dhe,getListViewExpandRevision:()=>zhe,getParentSectionBlock:()=>au,getPatternBySlug:()=>_he,getRegisteredInserterMediaCategories:()=>vhe,getRemovalPromptData:()=>ghe,getRequestedInspectorTab:()=>Uhe,getReusableBlocks:()=>Che,getSectionRootClientId:()=>Mf,getStyleOverrides:()=>khe,getViewportModalClientIds:()=>jhe,getZoomLevel:()=>Phe,hasAllowedPatterns:()=>She,hasBlockSpotlight:()=>Mhe,isBlockHiddenAnywhere:()=>Ahe,isBlockHiddenAtViewport:()=>cj,isBlockHiddenEverywhere:()=>GN,isBlockInterfaceHidden:()=>uhe,isBlockParentHiddenAtViewport:()=>Nhe,isBlockParentHiddenEverywhere:()=>Lhe,isBlockSubtreeDisabled:()=>mhe,isContainerInsertableToInContentOnlyMode:()=>wv,isDragging:()=>Ehe,isEditLockedBlock:()=>uj,isListViewContentPanelOpen:()=>Vhe,isListViewPanelOpened:()=>Fhe,isLockedBlock:()=>Dhe,isMoveLockedBlock:()=>dj,isRemoveLockedBlock:()=>fj,isSectionBlock:()=>lu,isWithinEditedContentOnlySection:()=>UN,isZoomOut:()=>HN});var Vr=l(F(),1),xv=l($(),1);var Bw=l(N(),1);var Et={desktop:{label:(0,Bw.__)("Desktop"),icon:mA,key:"desktop"},tablet:{label:(0,Bw.__)("Tablet"),icon:SN,key:"tablet"},mobile:{label:(0,Bw.__)("Mobile"),icon:cv,key:"mobile"}},iu=Object.entries(Et);var Ew=l($(),1),rj=l(ut(),1);function pe(e,t,o){t=Array.isArray(t)?[...t]:[t],e=Array.isArray(e)?[...e]:{...e};let r=t.pop(),n=e;for(let i of t){let s=n[i];n=n[i]=Array.isArray(s)?[...s]:{...s}}return n[r]=o,e}var yl=(e,t,o)=>{let r=Array.isArray(t)?t:t.split("."),n=e;return r.forEach(i=>{n=n?.[i]}),n??o};var she=["color","border","dimensions","typography","spacing"],ahe={"color.palette":e=>e.colors,"color.gradients":e=>e.gradients,"color.custom":e=>e.disableCustomColors===void 0?void 0:!e.disableCustomColors,"color.customGradient":e=>e.disableCustomGradients===void 0?void 0:!e.disableCustomGradients,"typography.fontSizes":e=>e.fontSizes,"typography.customFontSize":e=>e.disableCustomFontSizes===void 0?void 0:!e.disableCustomFontSizes,"typography.lineHeight":e=>e.enableCustomLineHeight,"spacing.units":e=>{if(e.enableCustomUnits!==void 0)return e.enableCustomUnits===!0?["px","em","rem","vh","vw","%"]:e.enableCustomUnits},"spacing.padding":e=>e.enableCustomSpacing},lhe={"border.customColor":"border.color","border.customStyle":"border.style","border.customWidth":"border.width","typography.customFontStyle":"typography.fontStyle","typography.customFontWeight":"typography.fontWeight","typography.customLetterSpacing":"typography.letterSpacing","typography.customTextDecorations":"typography.textDecoration","typography.customTextTransforms":"typography.textTransform","border.customRadius":"border.radius","spacing.customMargin":"spacing.margin","spacing.customPadding":"spacing.padding","typography.customLineHeight":"typography.lineHeight"},che=e=>lhe[e]||e;function nj(e,t,...o){let r=dt(e,t),n=[];if(t){let i=t;do{let s=dt(e,i);(0,Ew.hasBlockSupport)(s,"__experimentalSettings",!1)&&n.push(i)}while(i=e.blocks.parents.get(i))}return o.map(i=>{if(she.includes(i)){console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");return}let s=(0,rj.applyFilters)("blockEditor.useSetting.before",void 0,i,t,r);if(s!==void 0)return s;let a=che(i);for(let d of n){let f=Ti(e,d);if(s=yl(f.settings?.blocks?.[r],a)??yl(f.settings,a),s!==void 0)break}let c=su(e);if(s===void 0&&r&&(s=yl(c.__experimentalFeatures?.blocks?.[r],a)),s===void 0&&(s=yl(c.__experimentalFeatures,a)),s!==void 0)return Ew.__EXPERIMENTAL_PATHS_WITH_OVERRIDE[a]?s.custom??s.theme??s.default:s;let u=ahe[a]?.(c);return u!==void 0?u:a==="typography.dropCap"?!0:void 0})}var{isContentBlock:ij}=M(xv.privateApis);function uhe(e){return e.isBlockInterfaceHidden}function dhe(e){return e?.lastBlockInserted?.clientIds}function fhe(e,t){return e.blocks.byClientId.get(t)}var mhe=(e,t)=>{let o=r=>Ii(e,r)==="disabled"&&wr(e,r).every(o);return wr(e,t).every(o)};function wv(e,t,o){let r=ij(t),n=dt(e,o),i=ij(n);return Mf(e)===o||i&&r}function sj(e,t){let o=wr(e,t),r=[];for(let n of o){let i=sj(e,n);Ii(e,n)!=="disabled"?r.push({clientId:n,innerBlocks:i}):r.push(...i)}return r}var phe=(0,Vr.createRegistrySelector)(()=>(0,Vr.createSelector)(sj,e=>[e.blocks.order,e.derivedBlockEditingModes,e.blocks.blockEditingModes])),hhe=(0,Vr.createSelector)((e,t,o=!1)=>ys(e,t,o).filter(r=>Ii(e,r)!=="disabled"),e=>[e.blocks.parents,e.blocks.blockEditingModes,e.settings.templateLock,e.blockListSettings]);function ghe(e){return e.removalPromptData}function bhe(e){return e.blockRemovalRules}var khe=(0,Vr.createSelector)(e=>{let o=$p(e).reduce((r,n,i)=>(r[n]=i,r),{});return[...e.styleOverrides].sort((r,n)=>{let[,{clientId:i}]=r,[,{clientId:s}]=n,a=o[i]??-1,c=o[s]??-1;return a-c})},e=>[e.blocks.order,e.styleOverrides]);function vhe(e){return e.registeredInserterMediaCategories}var yhe=(0,Vr.createSelector)(e=>{let{settings:{inserterMediaCategories:t,allowedMimeTypes:o,enableOpenverseMediaCategory:r},registeredInserterMediaCategories:n}=e;if(!t&&!n.length||!o)return;let i=t?.map(({name:a})=>a)||[];return[...t||[],...(n||[]).filter(({name:a})=>!i.includes(a))].filter(a=>!r&&a.name==="openverse"?!1:Object.values(o).some(c=>c.startsWith(`${a.mediaType}/`)))},e=>[e.settings.inserterMediaCategories,e.settings.allowedMimeTypes,e.settings.enableOpenverseMediaCategory,e.registeredInserterMediaCategories]),She=(0,Vr.createRegistrySelector)(e=>(0,Vr.createSelector)((t,o=null)=>{let{getAllPatterns:r}=M(e(Kt)),n=r(),{allowedBlockTypes:i}=su(t);return n.some(s=>{let{inserter:a=!0}=s;if(!a)return!1;let c=Nf(s);return Bv(c,i)&&c.every(({name:u})=>Df(t,u,o))})},(t,o)=>[...Ev(e)(t),...cu(e)(t,o)])),_he=(0,Vr.createRegistrySelector)(e=>(0,Vr.createSelector)((t,o)=>{if(o?.startsWith("core/block/")){let r=parseInt(o.slice(11),10),n=M(e(Kt)).getReusableBlocks().find(({id:i})=>i===r);return n?Cv(n,t.settings.__experimentalUserPatternCategories):null}return[...t.settings.__experimentalBlockPatterns??[],...t.settings[qc]?.(e)??[]].find(({name:r})=>r===o)},(t,o)=>o?.startsWith("core/block/")?[M(e(Kt)).getReusableBlocks(),t.settings.__experimentalReusableBlocks]:[t.settings.__experimentalBlockPatterns,t.settings[qc]?.(e)])),xhe=(0,Vr.createRegistrySelector)(e=>(0,Vr.createSelector)(t=>[...M(e(Kt)).getReusableBlocks().map(o=>Cv(o,t.settings.__experimentalUserPatternCategories)),...t.settings.__experimentalBlockPatterns??[],...t.settings[qc]?.(e)??[]].filter((o,r,n)=>r===n.findIndex(i=>o.name===i.name)),Ev(e))),whe=[],Che=(0,Vr.createRegistrySelector)(e=>t=>{let o=t.settings[S0];return(o?o(e):t.settings.__experimentalReusableBlocks)??whe});function Bhe(e){return e.lastFocus}function Ehe(e){return e.isDragging}function The(e){return e.expandedBlock}var zN=(e,t)=>{let o=t,r;for(;!r&&(o=e.blocks.parents.get(o));)fa(e,o)==="contentOnly"&&(r=o);return r};function aj(e,t){let o=dt(e,t);if(o==="core/block")return!0;let r=Ti(e,t),n=o==="core/template-part",i=e.settings?.[Xc],s=e.settings?.disableContentOnlyForUnsyncedPatterns,a=e.settings?.disableContentOnlyForTemplateParts;if((!s&&r?.metadata?.patternName||n&&!a)&&!i)return!0;let c=fa(e,t)==="contentOnly",u=Po(e,t),d=fa(e,u)==="contentOnly";return!!(c&&!d)}var au=(e,t)=>{if(UN(e,t))return;let o=t,r;for(;o=e.blocks.parents.get(o);)aj(e,o)&&(r=o);return r};function lu(e,t){return UN(e,t)||au(e,t)?!1:aj(e,t)}function jN(e){return e.editedContentOnlySection}function UN(e,t){if(!e.editedContentOnlySection)return!1;if(e.editedContentOnlySection===t)return!0;let o=t;for(;o=e.blocks.parents.get(o);)if(e.editedContentOnlySection===o)return!0;return!1}var Ihe=(0,Vr.createSelector)((e,t)=>t.reduce((o,r)=>(o[r]=e.blocks.attributes.get(r)?.style,o),{}),(e,t)=>[...t.map(o=>e.blocks.attributes.get(o)?.style)]);function Mf(e){return e.settings?.[Zc]}function HN(e){return e.zoomLevel==="auto-scaled"||e.zoomLevel<100}function Phe(e){return e.zoomLevel}function lj(e,t,o=""){let r=Array.isArray(t)?t:[t],n=s=>r.every(a=>Df(e,a,s));if(!o){if(n(o))return o;let s=Mf(e);return s&&n(s)?s:null}let i=o;for(;i!==null&&!n(i);)i=Po(e,i);return i}function Rhe(e,t,o){let{allowedBlockTypes:r}=su(e);if(!Bv(Nf(t),r))return null;let i=Nf(t).map(({blockName:s})=>s);return lj(e,i,o)}function Ohe(e){return e.insertionPoint}var Ahe=(e,t)=>{let o=dt(e,t);if(!(0,xv.hasBlockSupport)(o,"visibility",!0))return!1;let n=e.blocks.attributes.get(t)?.metadata?.blockVisibility;return n===!1?!0:typeof n?.viewport=="object"&&n?.viewport!==null?Object.values(Et).some(i=>n?.viewport?.[i.key]===!1):!1},GN=(e,t)=>{let o=dt(e,t);return(0,xv.hasBlockSupport)(o,"visibility",!0)?e.blocks.attributes.get(t)?.metadata?.blockVisibility===!1:!1},Lhe=(e,t)=>ys(e,t).some(r=>GN(e,r)),cj=(e,t,o)=>{if(GN(e,t))return!0;let n=e.blocks.attributes.get(t)?.metadata?.blockVisibility?.viewport;return typeof n=="object"&&n!==null&&typeof o=="string"?n?.[o.toLowerCase()]===!1:!1},Nhe=(e,t,o)=>ys(e,t).some(n=>cj(e,n,o));function Mhe(e){return!!e.hasBlockSpotlight||!!e.editedContentOnlySection}function uj(e,t){return!!Ti(e,t)?.lock?.edit}function dj(e,t){let o=Ti(e,t);if(o?.lock?.move!==void 0)return!!o?.lock?.move;let r=Po(e,t);return fa(e,r)==="all"}function fj(e,t){let o=Ti(e,t);if(o?.lock?.remove!==void 0)return!!o?.lock?.remove;let r=Po(e,t),n=fa(e,r);return n==="all"||n==="insert"}function Dhe(e,t){return uj(e,t)||dj(e,t)||fj(e,t)}function Vhe(e){return e.listViewContentPanelOpen}function Fhe(e,t){return e.openedListViewPanels?.allOpen?!0:e.openedListViewPanels?.panels?.[t]===!0}function zhe(e){return e.listViewExpandRevision||0}function jhe(e){return e.viewportModalClientIds}function Uhe(e){return e.requestedInspectorTab}var Iv=l(N(),1),Nt={user:"user",theme:"theme",directory:"directory"},Tv={full:"fully",unsynced:"unsynced"},Vf={name:"allPatterns",label:(0,Iv._x)("All","patterns")},Sl={name:"myPatterns",label:(0,Iv.__)("My patterns")},Kp={name:"core/starter-content",label:(0,Iv.__)("Starter content")};function Iw(e,t,o){let r=e.name.startsWith("core/block"),n=e.source==="core"||e.source?.startsWith("pattern-directory");return!!(t===Nt.theme&&(r||n)||t===Nt.directory&&(r||!n)||t===Nt.user&&e.type!==Nt.user||o===Tv.full&&e.syncStatus!==""||o===Tv.unsynced&&e.syncStatus!=="unsynced"&&r)}var uu=Symbol("isFiltered"),mj=new WeakMap,pj=new WeakMap;function Cv(e,t=[]){return{name:`core/block/${e.id}`,id:e.id,type:Nt.user,title:e.title?.raw,categories:e.wp_pattern_category?.map(o=>{let r=t.find(({id:n})=>n===o);return r?r.slug:o}),content:e.content?.raw,syncStatus:e.wp_pattern_sync_status}}function Hhe(e){let t=(0,hj.parse)(e.content,{__unstableSkipMigrationLogs:!0});return t.length===1&&(t[0].attributes={...t[0].attributes,metadata:{...t[0].attributes.metadata||{},categories:e.categories,patternName:e.name,name:t[0].attributes.metadata?.name||e.title}}),{...e,blocks:t}}function Pw(e){let t=mj.get(e);return t||(t=Hhe(e),mj.set(e,t)),t}function Nf(e){let t=pj.get(e);return t||(t=(0,gj.parse)(e.content),t=t.filter(o=>o.blockName!==null),pj.set(e,t)),t}var Ff=(e,t,o=null)=>typeof e=="boolean"?e:Array.isArray(e)?e.includes("core/post-content")&&t===null?!0:e.includes(t):o,Bv=(e,t)=>{if(typeof t=="boolean")return t;let o=[...e];for(;o.length>0;){let r=o.shift();if(!Ff(t,r.name||r.blockName,!0))return!1;r.innerBlocks?.forEach(i=>{o.push(i)})}return!0},Ev=e=>t=>[t.settings.__experimentalBlockPatterns,t.settings.__experimentalUserPatternCategories,t.settings.__experimentalReusableBlocks,t.settings[qc]?.(e),t.blockPatterns,M(e(Kt)).getReusableBlocks()],cu=()=>(e,t)=>[e.blockListSettings[t],e.blocks.byClientId.get(t),e.blocks.order.get(t||""),e.settings.allowedBlockTypes,e.settings.templateLock,Ii(e,t),Mf(e),lu(e,t),au(e,t)];var Ghe=(e,t,o)=>(r,n)=>{let i,s;if(typeof e=="function"?(i=e(r),s=e(n)):(i=r[e],s=n[e]),i>s)return o==="asc"?1:-1;if(s>i)return o==="asc"?-1:1;let a=t.findIndex(u=>u===r),c=t.findIndex(u=>u===n);return a>c?1:c>a?-1:0};function ma(e,t,o="asc"){return e.concat().sort(Ghe(t,e,o))}var{isContentBlock:$N}=M(Oe.privateApis),Whe=3600*1e3,$he=24*3600*1e3,Khe=168*3600*1e3,fr=[],Yhe=new Set,yj={[uu]:!0};function dt(e,t){let o=e.blocks.byClientId.get(t),r="core/social-link";if(kj.Platform.OS!=="web"&&o?.name===r){let n=e.blocks.attributes.get(t),{service:i}=n??{};return i?`${r}-${i}`:r}return o?o.name:null}function qhe(e,t){let o=e.blocks.byClientId.get(t);return!!o&&o.isValid}function Ti(e,t){return e.blocks.byClientId.get(t)?e.blocks.attributes.get(t):null}function xl(e,t){return e.blocks.byClientId.has(t)?e.blocks.tree.get(t):null}var Zhe=(0,Ee.createSelector)((e,t)=>{let o=e.blocks.byClientId.get(t);return o?{...o,attributes:Ti(e,t)}:null},(e,t)=>[e.blocks.byClientId.get(t),e.blocks.attributes.get(t)]);function Xhe(e,t){let o=!t||!Ow(e,t)?t||"":"controlled||"+t;return e.blocks.tree.get(o)?.innerBlocks||fr}var Sj=(0,Ee.createSelector)((e,t)=>((0,jn.default)("wp.data.select( 'core/block-editor' ).__unstableGetClientIdWithClientIdsTree",{since:"6.3",version:"6.5"}),{clientId:t,innerBlocks:_j(e,t)}),e=>[e.blocks.order]),_j=(0,Ee.createSelector)((e,t="")=>((0,jn.default)("wp.data.select( 'core/block-editor' ).__unstableGetClientIdsTree",{since:"6.3",version:"6.5"}),wr(e,t).map(o=>Sj(e,o))),e=>[e.blocks.order]),xj=(0,Ee.createSelector)((e,t)=>{t=Array.isArray(t)?[...t]:[t];let o=[];for(let n of t){let i=e.blocks.order.get(n);i&&o.push(...i)}let r=0;for(;r<o.length;){let n=o[r],i=e.blocks.order.get(n);i&&o.splice(r+1,0,...i),r++}return o},e=>[e.blocks.order]),$p=e=>xj(e,""),Qhe=(0,Ee.createSelector)((e,t)=>{let o=$p(e);if(!t)return o.length;let r=0;for(let n of o)e.blocks.byClientId.get(n).name===t&&r++;return r},e=>[e.blocks.order,e.blocks.byClientId]),wj=(0,Ee.createSelector)((e,t)=>{if(!t)return fr;let o=Array.isArray(t)?t:[t],n=$p(e).filter(i=>{let s=e.blocks.byClientId.get(i);return o.includes(s.name)});return n.length>0?n:fr},e=>[e.blocks.order,e.blocks.byClientId]);function Jhe(e,t){return(0,jn.default)("wp.data.select( 'core/block-editor' ).__experimentalGetGlobalBlocksByName",{since:"6.5",alternative:"wp.data.select( 'core/block-editor' ).getBlocksByName"}),wj(e,t)}var Rw=(0,Ee.createSelector)((e,t)=>(Array.isArray(t)?t:[t]).map(o=>xl(e,o)),(e,t)=>(Array.isArray(t)?t:[t]).map(o=>e.blocks.tree.get(o))),ege=(0,Ee.createSelector)((e,t)=>Rw(e,t).filter(Boolean).map(o=>o.name),(e,t)=>Rw(e,t));function tge(e,t){return wr(e,t).length}function Rv(e){return e.selection.selectionStart}function Ov(e){return e.selection.selectionEnd}function oge(e){return e.selection.selectionStart.clientId}function rge(e){return e.selection.selectionEnd.clientId}function nge(e){let t=du(e).length;return t||(e.selection.selectionStart.clientId?1:0)}function ige(e){let{selectionStart:t,selectionEnd:o}=e.selection;return!!t.clientId&&t.clientId===o.clientId}function Yp(e){let{selectionStart:t,selectionEnd:o}=e.selection,{clientId:r}=t;return!r||r!==o.clientId?null:r}function sge(e){let t=Yp(e);return t?xl(e,t):null}function Po(e,t){return e.blocks.parents.get(t)??null}var ys=(0,Ee.createSelector)((e,t,o=!1)=>{let r=[],n=t;for(;n=e.blocks.parents.get(n);)r.push(n);return r.length?o?r:r.reverse():fr},e=>[e.blocks.parents]),KN=(0,Ee.createSelector)((e,t,o,r=!1)=>{let n=ys(e,t,r),i=Array.isArray(o)?s=>o.includes(s):s=>o===s;return n.filter(s=>i(dt(e,s)))},e=>[e.blocks.parents]);function age(e,t){let o=t,r;do r=o,o=e.blocks.parents.get(o);while(o);return r}function lge(e,t){let o=Yp(e),r=[...ys(e,t),t],n=[...ys(e,o),o],i,s=Math.min(r.length,n.length);for(let a=0;a<s&&r[a]===n[a];a++)i=r[a];return i}function YN(e,t,o=1){if(t===void 0&&(t=Yp(e)),t===void 0&&(o<0?t=qN(e):t=Cj(e)),!t)return null;let r=Po(e,t);if(r===null)return null;let{order:n}=e.blocks,i=n.get(r),a=i.indexOf(t)+1*o;return a<0||a===i.length?null:i[a]}function cge(e,t){return YN(e,t,-1)}function uge(e,t){return YN(e,t,1)}function dge(e){return e.initialPosition}var qp=(0,Ee.createSelector)(e=>{let{selectionStart:t,selectionEnd:o}=e.selection;if(!t.clientId||!o.clientId)return fr;if(t.clientId===o.clientId)return[t.clientId];let r=Po(e,t.clientId);if(r===null)return fr;let n=wr(e,r),i=n.indexOf(t.clientId),s=n.indexOf(o.clientId);return i>s?n.slice(s,i+1):n.slice(i,s+1)},e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]);function du(e){let{selectionStart:t,selectionEnd:o}=e.selection;return t.clientId===o.clientId?fr:qp(e)}var fge=(0,Ee.createSelector)(e=>{let t=du(e);return t.length?t.map(o=>xl(e,o)):fr},e=>[...qp.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]);function qN(e){return du(e)[0]||null}function Cj(e){let t=du(e);return t[t.length-1]||null}function mge(e,t){return qN(e)===t}function Bj(e,t){return du(e).indexOf(t)!==-1}var pge=(0,Ee.createSelector)((e,t)=>{let o=t,r=!1;for(;o&&!r;)o=Po(e,o),r=Bj(e,o);return r},e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]);function hge(e){let{selectionStart:t,selectionEnd:o}=e.selection;return t.clientId===o.clientId?null:t.clientId||null}function gge(e){let{selectionStart:t,selectionEnd:o}=e.selection;return t.clientId===o.clientId?null:o.clientId||null}function bge(e){let t=Rv(e),o=Ov(e);return!t.attributeKey&&!o.attributeKey&&typeof t.offset>"u"&&typeof o.offset>"u"}function kge(e){let t=Rv(e),o=Ov(e);return!!t&&!!o&&t.clientId===o.clientId&&t.attributeKey===o.attributeKey&&t.offset===o.offset}function vge(e){return qp(e).some(t=>{let o=dt(e,t);return!(0,Oe.getBlockType)(o).merge})}function yge(e,t){let o=Rv(e),r=Ov(e);if(o.clientId===r.clientId||!o.attributeKey||!r.attributeKey||typeof o.offset>"u"||typeof r.offset>"u")return!1;let n=Po(e,o.clientId),i=Po(e,r.clientId);if(n!==i)return!1;let s=wr(e,n),a=s.indexOf(o.clientId),c=s.indexOf(r.clientId),u,d;a>c?(u=r,d=o):(u=o,d=r);let f=t?d.clientId:u.clientId,m=t?u.clientId:d.clientId,h=dt(e,f);if(!(0,Oe.getBlockType)(h).merge)return!1;let g=xl(e,m);if(g.name===h)return!0;let b=(0,Oe.switchToBlockType)(g,h);return b&&b.length}var Sge=e=>{let t=Rv(e),o=Ov(e);if(t.clientId===o.clientId||!t.attributeKey||!o.attributeKey||typeof t.offset>"u"||typeof o.offset>"u")return fr;let r=Po(e,t.clientId),n=Po(e,o.clientId);if(r!==n)return fr;let i=wr(e,r),s=i.indexOf(t.clientId),a=i.indexOf(o.clientId),[c,u]=s>a?[o,t]:[t,o],d=xl(e,c.clientId),f=xl(e,u.clientId),m=d.attributes[c.attributeKey],h=f.attributes[u.attributeKey],p=(0,_l.create)({html:m}),g=(0,_l.create)({html:h});return p=(0,_l.remove)(p,0,c.offset),g=(0,_l.remove)(g,u.offset,g.text.length),[{...d,attributes:{...d.attributes,[c.attributeKey]:(0,_l.toHTMLString)({value:p})}},{...f,attributes:{...f.attributes,[u.attributeKey]:(0,_l.toHTMLString)({value:g})}}]};function wr(e,t){return e.blocks.order.get(t||"")||fr}function Ej(e,t){let o=Po(e,t);return wr(e,o).indexOf(t)}function Tj(e,t){let{selectionStart:o,selectionEnd:r}=e.selection;return o.clientId!==r.clientId?!1:o.clientId===t}function Ij(e,t,o=!1){let r=qp(e);return r.length?o?r.some(n=>ys(e,n,!0).includes(t)):r.some(n=>Po(e,n)===t):!1}function Pj(e,t,o=!1){return wr(e,t).some(r=>ZN(e,r)||o&&Pj(e,r,o))}function _ge(e,t){if(!t)return!1;let o=du(e),r=o.indexOf(t);return r>-1&&r<o.length-1}function xge(e){let{selectionStart:t,selectionEnd:o}=e.selection;return t.clientId!==o.clientId}function wge(e){return e.isMultiSelecting}function Cge(e){return e.isSelectionEnabled}function Bge(e,t){return e.blocksMode[t]||"visual"}function Ege(e){return e.isTyping}function Rj(e){return!!e.draggedBlocks.length}function Tge(e){return e.draggedBlocks}function ZN(e,t){return e.draggedBlocks.includes(t)}function Ige(e,t){return Rj(e)?ys(e,t).some(r=>ZN(e,r)):!1}function Pge(){return(0,jn.default)('wp.data.select( "core/block-editor" ).isCaretWithinFormattedText',{since:"6.1",version:"6.3"}),!1}var Rge=(0,Ee.createSelector)(e=>{let t,o,{insertionCue:r,selection:{selectionEnd:n}}=e;if(r!==null)return r;let{clientId:i}=n;return i?(t=Po(e,i)||void 0,o=Ej(e,n.clientId)+1):o=wr(e).length,{rootClientId:t,index:o}},e=>[e.insertionCue,e.selection.selectionEnd.clientId,e.blocks.parents,e.blocks.order]);function Oge(e){return e.insertionCue!==null}function Age(e){return e.template.isValid}function Lge(e){return e.settings.template}function fa(e,t){if(!t)return e.settings.templateLock??!1;let o=oM(e,t)?.templateLock;return o==="contentOnly"&&e.editedContentOnlySection===t?!1:o??!1}var XN=(e,t,o=null)=>{let r,n;if(t&&typeof t=="object"?(r=t,n=t.name):(r=(0,Oe.getBlockType)(t),n=t),!r)return!1;let{allowedBlockTypes:i}=su(e);if(!Ff(i,n,!0))return!1;let a=(Array.isArray(r.parent)?r.parent:[]).concat(Array.isArray(r.ancestor)?r.ancestor:[]);if(a.length>0){if(a.includes("core/post-content"))return!0;let c=o,u=!1;do{if(a.includes(dt(e,c))){u=!0;break}c=e.blocks.parents.get(c)}while(c);return u}return!0},Av=(e,t,o=null)=>{if(e.settings.isPreviewMode||!XN(e,t,o))return!1;let r;t&&typeof t=="object"?(r=t,t=r.name):r=(0,Oe.getBlockType)(t);let n=fa(e,o);if(n&&n!=="contentOnly")return!1;let i=Ii(e,o??""),s=!!lu(e,o),a=s?o:au(e,o),c=!!a;if(i==="disabled"&&(!c||t!==(0,Oe.getDefaultBlockName)()))return!1;let u=oM(e,o);if(o&&u===void 0)return!1;let d=$N(t);if(c&&!d||c&&dt(e,a)==="core/block")return!1;if(c&&(s||i==="contentOnly"||i==="disabled")&&!wv(e,t,o)){let S=(0,Oe.getDefaultBlockName)();if(t===S){if(!wr(e,o).some(B=>dt(e,B)===S))return!1}else return!1}let f=dt(e,o),h=(0,Oe.getBlockType)(f)?.allowedBlocks,p=Ff(h,t);if(p!==!1){let S=u?.allowedBlocks,x=Ff(S,t);x!==null&&(p=x)}let g=r.parent,b=Ff(g,f),v=!0,k=r.ancestor;k&&(v=[o,...ys(e,o)].some(x=>Ff(k,dt(e,x))));let y=v&&(p===null&&b===null||p===!0||b===!0);return y&&(0,vj.applyFilters)("blockEditor.__unstableCanInsertBlockType",y,r,o,{getBlock:xl.bind(null,e),getBlockParentsByBlockName:KN.bind(null,e)})},Df=(0,Ee.createRegistrySelector)(e=>(0,Ee.createSelector)(Av,(t,o,r)=>cu(e)(t,r)));function Nge(e,t,o=null){return t.every(r=>Df(e,dt(e,r),o))}function QN(e,t){if(e.settings.isPreviewMode)return!1;let o=Ti(e,t);if(o===null)return!0;if(o.lock?.remove!==void 0)return!o.lock.remove;let r=Po(e,t),n=fa(e,r);if(n&&n!=="contentOnly")return!1;let i=!!lu(e,r),s=i?r:au(e,r),a=!!s,c=$N(dt(e,t));if(a&&!c||a&&dt(e,s)==="core/block")return!1;let u=Ii(e,r),d=dt(e,t),f=(0,Oe.getDefaultBlockName)();return a&&(i||d===f||u==="contentOnly")&&!wv(e,dt(e,t),r)?d===f?wr(e,r).filter(p=>dt(e,p)===f).length>1:!1:u!=="disabled"}function Oj(e,t){return t.every(o=>QN(e,o))}function Aj(e,t){if(e.settings.isPreviewMode)return!1;let o=Ti(e,t);if(o===null)return!0;if(o.lock?.move!==void 0)return!o.lock.move;let r=Po(e,t);if(fa(e,r)==="all")return!1;let i=!!au(e,t),s=$N(dt(e,t));if(i&&!s)return!1;let a=!!lu(e,r),c=Ii(e,r);return i&&(a||c==="contentOnly")&&!wv(e,dt(e,t),r)?!1:Ii(e,r)!=="disabled"}function Mge(e,t){return t.every(o=>Aj(e,o))}function Lj(e,t){if(e.settings.isPreviewMode)return!1;let o=Ti(e,t);if(o===null)return!0;let{lock:r}=o;return!r?.edit}function Dge(e,t){return e.settings.isPreviewMode||!(0,Oe.hasBlockSupport)(t,"lock",!0)?!1:!!e.settings?.canLockBlocks}function JN(e,t){return e.preferences.insertUsage?.[t]??null}var Pv=(e,t,o)=>(0,Oe.hasBlockSupport)(t,"inserter",!0)?Av(e,t.name,o):!1,Vge=(e,t)=>o=>{let r=`${t.id}/${o.name}`,{time:n,count:i=0}=JN(e,r)||{};return{...t,id:r,icon:o.icon||t.icon,title:o.title||t.title,description:o.description||t.description,category:o.category||t.category,example:o.hasOwnProperty("example")?o.example:t.example,initialAttributes:{...t.initialAttributes,...o.attributes},innerBlocks:o.innerBlocks,keywords:o.keywords||t.keywords,frecency:eM(n,i),isSearchOnly:o.isSearchOnly}},eM=(e,t)=>{if(!e)return t;let o=Date.now()-e;switch(!0){case o<Whe:return t*4;case o<$he:return t*2;case o<Khe:return t/2;default:return t/4}},Nj=(e,{buildScope:t="inserter"})=>o=>{let r=o.name,n=!1;(0,Oe.hasBlockSupport)(o.name,"multiple",!0)||(n=Rw(e,$p(e)).some(({name:f})=>f===o.name));let{time:i,count:s=0}=JN(e,r)||{},a={id:r,name:o.name,title:o.title,icon:o.icon,isDisabled:n,frecency:eM(i,s)};if(t==="transform")return a;let c=(0,Oe.getBlockVariations)(o.name,"inserter"),u=(0,Oe.getBlockVariations)(o.name,"block"),d=[...c,...u.filter(f=>o.name==="core/heading"&&["h1","h2","h3","h4","h5","h6"].includes(f.name)).map(f=>({...f,isSearchOnly:!0}))];return{...a,initialAttributes:{},description:o.description,category:o.category,keywords:o.keywords,parent:o.parent,ancestor:o.ancestor,variations:d,example:o.example,utility:1}},Fge=(0,Ee.createRegistrySelector)(e=>(0,Ee.createSelector)((t,o=null,r=yj)=>{let n=h=>{let p=h.wp_pattern_sync_status?Ei:{src:Ei,foreground:"var(--wp-block-synced-color)"},g=Cv(h),{time:b,count:v=0}=JN(t,g.name)||{},k=eM(b,v);return{id:g.name,name:"core/block",initialAttributes:{ref:h.id},title:g.title,icon:p,category:"reusable",keywords:["reusable"],isDisabled:!1,utility:1,frecency:k,content:g.content,get blocks(){return Pw(g).blocks},syncStatus:g.syncStatus}},i=Av(t,"core/block",o)?M(e(Kt)).getReusableBlocks().map(n):[],s=Nj(t,{buildScope:"inserter"}),a=(0,Oe.getBlockTypes)().filter(h=>(0,Oe.hasBlockSupport)(h,"inserter",!0)).map(s);if(r[uu]!==!1)a=a.filter(h=>Pv(t,h,o));else{let{getClosestAllowedInsertionPoint:h}=M(e(Kt));a=a.filter(p=>XN(t,p,o)&&h(p.name,o)!==null).map(p=>({...p,isAllowedInCurrentRoot:Pv(t,p,o)}))}let c=a.reduce((h,p)=>{let{variations:g=[]}=p;if(g.some(({isDefault:b})=>b)||h.push(p),g.length){let b=Vge(t,p);h.push(...g.map(b))}return h},[]),u=(h,p)=>{let{core:g,noncore:b}=h;return(p.name.startsWith("core/")?g:b).push(p),h},{core:d,noncore:f}=c.reduce(u,{core:[],noncore:[]});return[...[...d,...f],...i]},(t,o)=>[(0,Oe.getBlockTypes)(),M(e(Kt)).getReusableBlocks(),t.blocks.order,t.preferences.insertUsage,...cu(e)(t,o)])),zge=(0,Ee.createRegistrySelector)(e=>(0,Ee.createSelector)((t,o,r=null)=>{let n=Array.isArray(o)?o:[o],i=Nj(t,{buildScope:"transform"}),s=(0,Oe.getBlockTypes)().filter(u=>Pv(t,u,r)).map(i),a=Object.fromEntries(Object.entries(s).map(([,u])=>[u.name,u])),c=(0,Oe.getPossibleBlockTransformations)(n).reduce((u,d)=>(a[d?.name]&&u.push(a[d.name]),u),[]);return ma(c,u=>a[u.name].frecency,"desc")},(t,o,r)=>[(0,Oe.getBlockTypes)(),t.preferences.insertUsage,...cu(e)(t,r)])),jge=(e,t=null)=>(0,Oe.getBlockTypes)().some(n=>Pv(e,n,t))?!0:Av(e,"core/block",t),WN=(0,Ee.createRegistrySelector)(e=>(0,Ee.createSelector)((t,o=null)=>{if(!o)return;let r=(0,Oe.getBlockTypes)().filter(i=>Pv(t,i,o));return Av(t,"core/block",o)&&r.push("core/block"),r},(t,o)=>[(0,Oe.getBlockTypes)(),...cu(e)(t,o)])),Uge=(0,Ee.createSelector)((e,t=null)=>((0,jn.default)('wp.data.select( "core/block-editor" ).__experimentalGetAllowedBlocks',{alternative:'wp.data.select( "core/block-editor" ).getAllowedBlocks',since:"6.2",version:"6.4"}),WN(e,t)),(e,t)=>WN.getDependants(e,t));function Mj(e,t=null){if(!t)return;let{defaultBlock:o,directInsert:r}=e.blockListSettings[t]??{};if(!(!o||!r))return o}function Hge(e,t=null){return(0,jn.default)('wp.data.select( "core/block-editor" ).__experimentalGetDirectInsertBlock',{alternative:'wp.data.select( "core/block-editor" ).getDirectInsertBlock',since:"6.3",version:"6.4"}),Mj(e,t)}var Gge=(0,Ee.createRegistrySelector)(e=>(t,o)=>{let r=M(e(Kt)).getPatternBySlug(o);return r?Pw(r):null}),tM=e=>(t,o)=>[...Ev(e)(t),...cu(e)(t,o)],bj=new WeakMap;function Wge(e){let t=bj.get(e);return t||(t={...e,get blocks(){return Pw(e).blocks}},bj.set(e,t)),t}var $ge=(0,Ee.createRegistrySelector)(e=>(0,Ee.createSelector)((t,o=null,r=yj)=>{let{getAllPatterns:n}=M(e(Kt)),i=n(),{allowedBlockTypes:s}=su(t);return i.filter(({inserter:d=!0})=>!!d).map(Wge).filter(d=>Bv(Nf(d),s)).filter(d=>Nf(d).every(({blockName:f})=>r[uu]!==!1?Df(t,f,o):XN(t,f,o)))},tM(e))),Kge=(0,Ee.createRegistrySelector)(e=>(0,Ee.createSelector)((t,o,r=null)=>{if(!o)return fr;let n=e(Kt).__experimentalGetAllowedPatterns(r),i=Array.isArray(o)?o:[o],s=n.filter(a=>a?.blockTypes?.some?.(c=>i.includes(c)));return s.length===0?fr:s},(t,o,r)=>tM(e)(t,r))),Yge=(0,Ee.createRegistrySelector)(e=>((0,jn.default)('wp.data.select( "core/block-editor" ).__experimentalGetPatternsByBlockTypes',{alternative:'wp.data.select( "core/block-editor" ).getPatternsByBlockTypes',since:"6.2",version:"6.4"}),e(Kt).getPatternsByBlockTypes)),qge=(0,Ee.createRegistrySelector)(e=>(0,Ee.createSelector)((t,o,r=null)=>{if(!o||o.some(({clientId:i,innerBlocks:s})=>s.length||Ow(t,i)))return fr;let n=Array.from(new Set(o.map(({name:i})=>i)));return e(Kt).getPatternsByBlockTypes(n,r)},(t,o,r)=>tM(e)(t,r)));function oM(e,t){return e.blockListSettings[t]}function su(e){return e.settings}function Zge(e){return e.blocks.isPersistentChange}var Xge=(0,Ee.createSelector)((e,t=[])=>t.reduce((o,r)=>e.blockListSettings[r]?{...o,[r]:e.blockListSettings[r]}:o,{}),e=>[e.blockListSettings]),Qge=(0,Ee.createRegistrySelector)(e=>(0,Ee.createSelector)((t,o)=>{(0,jn.default)("wp.data.select( 'core/block-editor' ).__experimentalGetReusableBlockTitle",{since:"6.6",version:"6.8"});let r=M(e(Kt)).getReusableBlocks().find(n=>n.id===o);return r?r.title?.raw:null},()=>[M(e(Kt)).getReusableBlocks()]));function Jge(e){return e.blocks.isIgnoredChange}function ebe(e){return e.lastBlockAttributesChange}function tbe(){return(0,jn.default)('wp.data.select( "core/block-editor" ).hasBlockMovingClientId',{since:"6.7",hint:"Block moving mode feature has been removed"}),!1}function obe(e){return!!e.automaticChangeStatus}function rbe(e,t){return e.highlightedBlock===t}function Ow(e,t){return!!e.blocks.controlledInnerBlocks[t]}var nbe=(0,Ee.createSelector)((e,t)=>{if(!t.length)return null;let o=Yp(e);if(t.includes(dt(e,o)))return o;let r=du(e),n=KN(e,o||r[0],t);return n?n[n.length-1]:null},(e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]);function ibe(e,t,o){let{lastBlockInserted:r}=e;return r.clientIds?.includes(t)&&r.source===o}function sbe(e,t){return e.blockVisibility?.[t]??!0}function abe(){(0,jn.default)("wp.data.select( 'core/block-editor' ).getHoveredBlockClientId",{since:"6.9",version:"7.1"})}var lbe=(0,Ee.createSelector)(e=>{let t=new Set(Object.keys(e.blockVisibility).filter(o=>e.blockVisibility[o]));return t.size===0?Yhe:t},e=>[e.blockVisibility]);function Dj(e,t){if(Ii(e,t)!=="default")return!1;if(!Lj(e,t))return!0;if(HN(e)){let n=Mf(e);if(n){if(wr(e,n)?.includes(t))return!0}else if(t&&!Po(e,t))return!0}return((0,Oe.hasBlockSupport)(dt(e,t),"__experimentalDisableBlockOverlay",!1)?!1:Ow(e,t))&&!Tj(e,t)&&!Ij(e,t,!0)}function cbe(e,t){let o=e.blocks.parents.get(t);for(;o;){if(Dj(e,o))return!0;o=e.blocks.parents.get(o)}return!1}function Ii(e,t=""){return t===null&&(t=""),e.derivedBlockEditingModes?.has(t)?e.derivedBlockEditingModes.get(t):e.blocks.blockEditingModes.has(t)?e.blocks.blockEditingModes.get(t):"default"}var ube=(0,Ee.createRegistrySelector)(e=>(t,o="")=>{let r=o||Yp(t);if(!r||lu(t,r))return!1;let{getGroupingBlockName:n}=e(Oe.store),i=xl(t,r),s=n();return i&&(i.name===s||(0,Oe.getBlockType)(i.name)?.transforms?.ungroup)&&!!i.innerBlocks.length&&QN(t,r)}),dbe=(0,Ee.createRegistrySelector)(e=>(t,o=fr)=>{let{getGroupingBlockName:r}=e(Oe.store),n=r(),i=o?.length?o:qp(t),s=i?.length?Po(t,i[0]):void 0;return Df(t,n,s)&&i.length&&Oj(t,i)}),fbe=(e,t)=>((0,jn.default)("wp.data.select( 'core/block-editor' ).__unstableGetContentLockingParent",{since:"6.1",version:"6.7"}),zN(e,t));function mbe(e){return(0,jn.default)("wp.data.select( 'core/block-editor' ).__unstableGetTemporarilyEditingAsBlocks",{since:"6.1",version:"6.7"}),jN(e)}var Aw={};Ip(Aw,{__experimentalUpdateSettings:()=>nM,clearBlockRemovalPrompt:()=>vbe,clearRequestedInspectorTab:()=>Dbe,closeListViewContentPanel:()=>Abe,deleteStyleOverride:()=>_be,editContentOnlySection:()=>sM,ensureDefaultBlock:()=>Hj,expandBlock:()=>Bbe,hideBlockInterface:()=>gbe,hideViewportModal:()=>Nbe,openListViewContentPanel:()=>Obe,privateRemoveBlocks:()=>iM,requestInspectorTab:()=>Mbe,resetZoomLevel:()=>Pbe,setBlockRemovalRules:()=>ybe,setInsertionPoint:()=>Ebe,setLastFocus:()=>xbe,setStyleOverride:()=>Sbe,setZoomLevel:()=>Ibe,showBlockInterface:()=>bbe,showViewportModal:()=>Lbe,startDragging:()=>wbe,stopDragging:()=>Cbe,stopEditingContentOnlySection:()=>Tbe,toggleBlockSpotlight:()=>Rbe});var Fj=l(R(),1),zj=l(Re(),1),jj=l(Xo(),1),Uj=l(N(),1),pbe=e=>Array.isArray(e)?e:[e],hbe=["inserterMediaCategories","blockInspectorAnimation","mediaSideload"];function nM(e,{stripExperimentalSettings:t=!1,reset:o=!1}={}){let r=e;Object.hasOwn(r,"__unstableIsPreviewMode")&&((0,zj.default)("__unstableIsPreviewMode argument in wp.data.dispatch('core/block-editor').updateSettings",{since:"6.8",alternative:"isPreviewMode"}),r={...r},r.isPreviewMode=r.__unstableIsPreviewMode,delete r.__unstableIsPreviewMode);let n=r;if(t&&Fj.Platform.OS==="web"){n={};for(let i in r)hbe.includes(i)||(n[i]=r[i])}return{type:"UPDATE_SETTINGS",settings:n,reset:o}}function gbe(){return{type:"HIDE_BLOCK_INTERFACE"}}function bbe(){return{type:"SHOW_BLOCK_INTERFACE"}}var iM=(e,t=!0,o=!1)=>({select:r,dispatch:n,registry:i})=>{if(!e||!e.length||(e=pbe(e),!r.canRemoveBlocks(e)))return;let a=!o&&r.getBlockRemovalRules();if(a){let u=function(h){let p=[],g=[...h];for(;g.length;){let{innerBlocks:b,...v}=g.shift();g.push(...b),p.push(v)}return p};var c=u;let d=e.map(r.getBlock),f=u(d),m;for(let h of a)if(m=h.callback(f),m){n(kbe(e,t,m));return}}t&&n.selectPreviousBlock(e[0],t),i.batch(()=>{n({type:"REMOVE_BLOCKS",clientIds:e}),n(Hj())})},Hj=()=>({select:e,dispatch:t})=>{if(e.getBlockCount()>0)return;let{__unstableHasCustomAppender:r}=e.getSettings();r||t.insertDefaultBlock()};function kbe(e,t,o){return{type:"DISPLAY_BLOCK_REMOVAL_PROMPT",clientIds:e,selectPrevious:t,message:o}}function vbe(){return{type:"CLEAR_BLOCK_REMOVAL_PROMPT"}}function ybe(e=!1){return{type:"SET_BLOCK_REMOVAL_RULES",rules:e}}function Sbe(e,t){return{type:"SET_STYLE_OVERRIDE",id:e,style:t}}function _be(e){return{type:"DELETE_STYLE_OVERRIDE",id:e}}function xbe(e=null){return{type:"LAST_FOCUS",lastFocus:e}}function wbe(){return{type:"START_DRAGGING"}}function Cbe(){return{type:"STOP_DRAGGING"}}function Bbe(e){return{type:"SET_BLOCK_EXPANDED_IN_LIST_VIEW",clientId:e}}function Ebe(e){return{type:"SET_INSERTION_POINT",value:e}}function sM(e){return{type:"EDIT_CONTENT_ONLY_SECTION",clientId:e}}function Tbe(){return{type:"EDIT_CONTENT_ONLY_SECTION"}}var Ibe=(e=100)=>({select:t,dispatch:o})=>{if(e!==100){let r=t.getBlockSelectionStart(),n=t.getSectionRootClientId();if(r){let i;if(n){let s=t.getBlockOrder(n);s?.includes(r)?i=r:i=t.getBlockParents(r).find(a=>s.includes(a))}else i=t.getBlockHierarchyRootClientId(r);i?o.selectBlock(i):o.clearSelectedBlock(),(0,jj.speak)((0,Uj.__)("You are currently in zoom-out mode."))}}o({type:"SET_ZOOM_LEVEL",zoom:e})};function Pbe(){return{type:"RESET_ZOOM_LEVEL"}}function Rbe(e,t){return{type:"TOGGLE_BLOCK_SPOTLIGHT",clientId:e,hasBlockSpotlight:t}}function Obe(){return{type:"OPEN_LIST_VIEW_CONTENT_PANEL"}}function Abe(){return{type:"CLOSE_LIST_VIEW_CONTENT_PANEL"}}function Lbe(e){return{type:"SHOW_VIEWPORT_MODAL",clientIds:e}}function Nbe(){return{type:"HIDE_VIEWPORT_MODAL"}}function Mbe(e,t={}){return{type:"REQUEST_INSPECTOR_TAB",tabName:e,options:t}}function Dbe(){return{type:"CLEAR_REQUESTED_INSPECTOR_TAB"}}var cM={};Ip(cM,{__unstableDeleteSelection:()=>ake,__unstableExpandSelection:()=>cke,__unstableIncrementListViewExpandRevision:()=>Hke,__unstableMarkAutomaticChange:()=>Eke,__unstableMarkLastChangeAsPersistent:()=>Cke,__unstableMarkNextChangeAsNotPersistent:()=>Bke,__unstableSaveReusableBlock:()=>wke,__unstableSetAllListViewPanelsOpen:()=>jke,__unstableSetEditorMode:()=>Tke,__unstableSetOpenListViewPanel:()=>zke,__unstableSetTemporarilyEditingAsBlocks:()=>Mke,__unstableSplitSelection:()=>lke,__unstableToggleListViewPanel:()=>Uke,clearSelectedBlock:()=>Zbe,duplicateBlocks:()=>Pke,enterFormattedText:()=>kke,exitFormattedText:()=>vke,flashBlock:()=>Ake,hideInsertionPoint:()=>nke,hoverBlock:()=>Gbe,insertAfterBlock:()=>Oke,insertBeforeBlock:()=>Rke,insertBlock:()=>oke,insertBlocks:()=>Jj,insertDefaultBlock:()=>Ske,mergeBlocks:()=>uke,moveBlockToPosition:()=>tke,moveBlocksDown:()=>Jbe,moveBlocksToPosition:()=>Qj,moveBlocksUp:()=>eke,multiSelect:()=>qbe,receiveBlocks:()=>zbe,registerInserterMediaCategory:()=>Dke,removeBlock:()=>dke,removeBlocks:()=>eU,replaceBlock:()=>Qbe,replaceBlocks:()=>Zj,replaceInnerBlocks:()=>fke,resetBlocks:()=>Vbe,resetSelection:()=>Fbe,selectBlock:()=>Hbe,selectNextBlock:()=>$be,selectPreviousBlock:()=>Wbe,selectionChange:()=>yke,setBlockEditingMode:()=>Vke,setBlockMovingClientId:()=>Ike,setBlockVisibility:()=>Nke,setHasControlledInnerBlocks:()=>Lke,setTemplateValidity:()=>ike,showInsertionPoint:()=>rke,startDraggingBlocks:()=>gke,startMultiSelect:()=>Kbe,startTyping:()=>pke,stopDraggingBlocks:()=>bke,stopMultiSelect:()=>Ybe,stopTyping:()=>hke,synchronizeTemplate:()=>ske,toggleBlockHighlight:()=>lM,toggleBlockMode:()=>mke,toggleSelection:()=>Xbe,unsetBlockEditingMode:()=>Fke,updateBlock:()=>Ube,updateBlockAttributes:()=>jbe,updateBlockListSettings:()=>_ke,updateSettings:()=>xke,validateBlocksToTemplate:()=>qj});var be=l($(),1),Lw=l(Xo(),1),fu=l(N(),1),Kj=l(Un(),1),ft=l(dr(),1),mu=l(Re(),1),Yj=l(Zp(),1);var $j=l(dr(),1),wl="\x86";function Lv(e){if(e)return Object.keys(e).find(t=>{let o=e[t];return(typeof o=="string"||o instanceof $j.RichTextData)&&o.toString().indexOf(wl)!==-1})}function aM(e){for(let[t,o]of Object.entries(e.attributes))if(o.source==="rich-text"||o.source==="html")return t}var Xp=e=>Array.isArray(e)?e:[e],Vbe=e=>({dispatch:t})=>{t({type:"RESET_BLOCKS",blocks:e}),t(qj(e))},qj=e=>({select:t,dispatch:o})=>{let r=t.getTemplate(),n=t.getTemplateLock(),i=!r||n!=="all"||(0,be.doBlocksMatchTemplate)(e,r),s=t.isValidTemplate();if(i!==s)return o.setTemplateValidity(i),i};function Fbe(e,t,o){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:o}}function zbe(e){return(0,mu.default)('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function jbe(e,t,o={uniqueByBlock:!1}){return typeof o=="boolean"&&(o={uniqueByBlock:o}),{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:Xp(e),attributes:t,options:o}}function Ube(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function Hbe(e,t=0){return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}function Gbe(){return(0,mu.default)('wp.data.dispatch( "core/block-editor" ).hoverBlock',{since:"6.9",version:"7.1"}),{type:"DO_NOTHING"}}var Wbe=(e,t=!1)=>({select:o,dispatch:r})=>{let n=o.getPreviousBlockClientId(e);if(n)r.selectBlock(n,-1);else if(t){let i=o.getBlockRootClientId(e);if(i)r.selectBlock(i,-1);else{let s=o.getNextBlockClientId(e);s&&r.selectBlock(s,0)}}},$be=e=>({select:t,dispatch:o})=>{let r=t.getNextBlockClientId(e);r&&o.selectBlock(r)};function Kbe(){return{type:"START_MULTI_SELECT"}}function Ybe(){return{type:"STOP_MULTI_SELECT"}}var qbe=(e,t,o=0)=>({select:r,dispatch:n})=>{let i=r.getBlockRootClientId(e),s=r.getBlockRootClientId(t);if(i!==s)return;n({type:"MULTI_SELECT",start:e,end:t,initialPosition:o});let a=r.getSelectedBlockCount();(0,Lw.speak)((0,fu.sprintf)((0,fu._n)("%s block selected.","%s blocks selected.",a),a),"assertive")};function Zbe(){return{type:"CLEAR_SELECTED_BLOCK"}}function Xbe(e=!0){return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}var Zj=(e,t,o,r=0,n)=>({select:i,dispatch:s,registry:a})=>{e=Xp(e),t=Xp(t);let c=i.getBlockRootClientId(e[0]);for(let u=0;u<t.length;u++){let d=t[u];if(!i.canInsertBlockType(d.name,c))return}a.batch(()=>{s({type:"REPLACE_BLOCKS",clientIds:e,blocks:t,time:Date.now(),indexToSelect:o,initialPosition:r,meta:n}),s.ensureDefaultBlock()})};function Qbe(e,t){return Zj(e,t)}var Xj=e=>(t,o)=>({select:r,dispatch:n})=>{r.canMoveBlocks(t)&&n({type:e,clientIds:Xp(t),rootClientId:o})},Jbe=Xj("MOVE_BLOCKS_DOWN"),eke=Xj("MOVE_BLOCKS_UP"),Qj=(e,t="",o="",r)=>({select:n,dispatch:i})=>{n.canMoveBlocks(e)&&(t!==o&&(!n.canRemoveBlocks(e)||!n.canInsertBlocks(e,o))||i({type:"MOVE_BLOCKS_TO_POSITION",fromRootClientId:t,toRootClientId:o,clientIds:e,index:r}))};function tke(e,t="",o="",r){return Qj([e],t,o,r)}function oke(e,t,o,r,n,i){return Jj([e],t,o,r,n,i)}var Jj=(e,t,o,r=!0,n=0,i)=>({select:s,dispatch:a})=>{n!==null&&typeof n=="object"&&(i=n,n=0,(0,mu.default)("meta argument in wp.data.dispatch('core/block-editor')",{since:"5.8",hint:"The meta argument is now the 6th argument of the function"})),e=Xp(e);let c=[];for(let u of e)s.canInsertBlockType(u.name,o)&&c.push(u);c.length&&a({type:"INSERT_BLOCKS",blocks:c,index:t,rootClientId:o,time:Date.now(),updateSelection:r,initialPosition:r?n:null,meta:i})};function rke(e,t,o={}){let{__unstableWithInserter:r,operation:n,nearestSide:i}=o;return{type:"SHOW_INSERTION_POINT",rootClientId:e,index:t,__unstableWithInserter:r,operation:n,nearestSide:i}}var nke=()=>({select:e,dispatch:t})=>{e.isBlockInsertionPointVisible()&&t({type:"HIDE_INSERTION_POINT"})};function ike(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}var ske=()=>({select:e,dispatch:t})=>{t({type:"SYNCHRONIZE_TEMPLATE"});let o=e.getBlocks(),r=e.getTemplate(),n=(0,be.synchronizeBlocksWithTemplate)(o,r);t.resetBlocks(n)},ake=e=>({registry:t,select:o,dispatch:r})=>{let n=o.getSelectionStart(),i=o.getSelectionEnd();if(n.clientId===i.clientId)return;if(!n.attributeKey||!i.attributeKey||typeof n.offset>"u"||typeof i.offset>"u")return!1;let s=o.getBlockRootClientId(n.clientId),a=o.getBlockRootClientId(i.clientId);if(s!==a)return;let c=o.getBlockOrder(s),u=c.indexOf(n.clientId),d=c.indexOf(i.clientId),f,m;u>d?(f=i,m=n):(f=n,m=i);let h=e?m:f,p=o.getBlock(h.clientId),g=(0,be.getBlockType)(p.name);if(!g.merge)return;let b=f,v=m,k=o.getBlock(b.clientId),y=o.getBlock(v.clientId),S=k.attributes[b.attributeKey],x=y.attributes[v.attributeKey],C=(0,ft.create)({html:S}),B=(0,ft.create)({html:x});C=(0,ft.remove)(C,b.offset,C.text.length),B=(0,ft.insert)(B,wl,0,v.offset);let I=(0,be.cloneBlock)(k,{[b.attributeKey]:(0,ft.toHTMLString)({value:C})}),P=(0,be.cloneBlock)(y,{[v.attributeKey]:(0,ft.toHTMLString)({value:B})}),E=e?I:P,L=k.name===y.name?[E]:(0,be.switchToBlockType)(E,g.name);if(!L||!L.length)return;let T;if(e){let se=L.pop();T=g.merge(se.attributes,P.attributes)}else{let se=L.shift();T=g.merge(I.attributes,se.attributes)}let O=Lv(T),D=T[O],U=(0,ft.create)({html:D}),G=U.text.indexOf(wl),j=(0,ft.remove)(U,G,G+1),z=(0,ft.toHTMLString)({value:j});T[O]=z;let W=o.getSelectedBlockClientIds(),ee=[...e?L:[],{...p,attributes:{...p.attributes,...T}},...e?[]:L];t.batch(()=>{r.selectionChange(p.clientId,O,G,G),r.replaceBlocks(W,ee,0,o.getSelectedBlocksInitialCaretPosition())})},lke=(e=[])=>({registry:t,select:o,dispatch:r})=>{let n=o.getSelectionStart(),i=o.getSelectionEnd(),s=o.getBlockRootClientId(n.clientId),a=o.getBlockRootClientId(i.clientId);if(s!==a)return;let c=o.getBlockOrder(s),u=c.indexOf(n.clientId),d=c.indexOf(i.clientId),f,m;u>d?(f=i,m=n):(f=n,m=i);let h=f,p=m,g=o.getBlock(h.clientId),b=o.getBlock(p.clientId),v=(0,be.getBlockType)(g.name),k=(0,be.getBlockType)(b.name),y=typeof h.attributeKey=="string"?h.attributeKey:aM(v),S=typeof p.attributeKey=="string"?p.attributeKey:aM(k),x=o.getBlockAttributes(h.clientId);if(x?.metadata?.bindings?.[y]){if(e.length){let{createWarningNotice:ie}=t.dispatch(Kj.store);ie((0,fu.__)("Blocks can't be inserted into other blocks with bindings"),{type:"snackbar"});return}r.insertAfterBlock(h.clientId);return}if(!y||!S||typeof n.offset>"u"||typeof i.offset>"u")return;if(h.clientId===p.clientId&&y===S&&h.offset===p.offset){if(e.length){if((0,be.isUnmodifiedDefaultBlock)(g,"content")){r.replaceBlocks([h.clientId],e,e.length-1,-1);return}}else if(!o.getBlockOrder(h.clientId).length){let ie=function(){let Q=(0,be.getDefaultBlockName)();return o.canInsertBlockType(Q,s)?(0,be.createBlock)(Q):(0,be.createBlock)(o.getBlockName(h.clientId))};var B=ie;let re=x[y].length;if(h.offset===0&&re){r.insertBlocks([ie()],o.getBlockIndex(h.clientId),s,!1);return}if(h.offset===re){r.insertBlocks([ie()],o.getBlockIndex(h.clientId)+1,s);return}}}let I=g.attributes[y],P=b.attributes[S],E=(0,ft.create)({html:I}),L=(0,ft.create)({html:P});E=(0,ft.remove)(E,h.offset,E.text.length),L=(0,ft.remove)(L,0,p.offset);let T={...g,innerBlocks:g.clientId===b.clientId?[]:g.innerBlocks,attributes:{...g.attributes,[y]:(0,ft.toHTMLString)({value:E})}},O={...b,clientId:g.clientId===b.clientId?(0,be.createBlock)(b.name).clientId:b.clientId,attributes:{...b.attributes,[S]:(0,ft.toHTMLString)({value:L})}},D=(0,be.getDefaultBlockName)();if(g.clientId===b.clientId&&D&&O.name!==D&&o.canInsertBlockType(D,s)){let ie=(0,be.switchToBlockType)(O,D);ie?.length===1&&(O=ie[0])}if(!e.length){r.replaceBlocks(o.getSelectedBlockClientIds(),[T,O]);return}let U,G=[],j=[...e],z=j.shift(),W=(0,be.getBlockType)(T.name),ee=W.merge&&z.name===W.name?[z]:(0,be.switchToBlockType)(z,W.name);if(ee?.length){let ie=ee.shift();T={...T,attributes:{...T.attributes,...W.merge(T.attributes,ie.attributes)}},G.push(T),U={clientId:T.clientId,attributeKey:y,offset:(0,ft.create)({html:T.attributes[y]}).text.length},j.unshift(...ee)}else(0,be.isUnmodifiedBlock)(T)||G.push(T),G.push(z);let se=j.pop(),ce=(0,be.getBlockType)(O.name);if(j.length&&G.push(...j),se){let ie=ce.merge&&ce.name===se.name?[se]:(0,be.switchToBlockType)(se,ce.name);if(ie?.length){let re=ie.pop();G.push({...O,attributes:{...O.attributes,...ce.merge(re.attributes,O.attributes)}}),G.push(...ie),U={clientId:O.clientId,attributeKey:S,offset:(0,ft.create)({html:re.attributes[S]}).text.length}}else G.push(se),(0,be.isUnmodifiedBlock)(O)||G.push(O)}else(0,be.isUnmodifiedBlock)(O)||G.push(O);t.batch(()=>{r.replaceBlocks(o.getSelectedBlockClientIds(),G,G.length-1,0),U&&r.selectionChange(U.clientId,U.attributeKey,U.offset,U.offset)})},cke=()=>({select:e,dispatch:t})=>{let o=e.getSelectionStart(),r=e.getSelectionEnd();t.selectionChange({start:{clientId:o.clientId},end:{clientId:r.clientId}})},uke=(e,t)=>({registry:o,select:r,dispatch:n})=>{let i=e,s=t,a=r.getBlock(i),c=(0,be.getBlockType)(a.name);if(!c||r.getBlockEditingMode(i)==="disabled"||r.getBlockEditingMode(s)==="disabled")return;let u=r.getBlock(s);if(!c.merge&&(0,be.getBlockSupport)(a.name,"__experimentalOnMerge")){let x=(0,be.switchToBlockType)(u,c.name);if(x?.length!==1){n.selectBlock(a.clientId);return}let[C]=x;if(C.innerBlocks.length<1){n.selectBlock(a.clientId);return}o.batch(()=>{n.insertBlocks(C.innerBlocks,void 0,i),n.removeBlock(s),n.selectBlock(C.innerBlocks[0].clientId);let B=r.getNextBlockClientId(i);if(B&&r.getBlockName(i)===r.getBlockName(B)){let I=r.getBlockAttributes(i),P=r.getBlockAttributes(B);Object.keys(I).every(E=>I[E]===P[E])&&(n.moveBlocksToPosition(r.getBlockOrder(B),B,i),n.removeBlock(B,!1))}});return}if((0,be.isUnmodifiedDefaultBlock)(a)){n.removeBlock(i,r.isBlockSelected(i));return}if((0,be.isUnmodifiedDefaultBlock)(u)){n.removeBlock(s,r.isBlockSelected(s));return}if(!c.merge){(0,be.isUnmodifiedBlock)(u,"content")?n.removeBlock(s,r.isBlockSelected(s)):n.selectBlock(a.clientId);return}let d=(0,be.getBlockType)(u.name),{clientId:f,attributeKey:m,offset:h}=r.getSelectionStart(),g=(f===i?c:d).attributes[m],b=(f===i||f===s)&&m!==void 0&&h!==void 0&&!!g;g||(typeof m=="number"?window.console.error(`RichText needs an identifier prop that is the block attribute key of the attribute it controls. Its type is expected to be a string, but was ${typeof m}`):window.console.error("The RichText identifier prop does not match any attributes defined by the block."));let v=(0,be.cloneBlock)(a),k=(0,be.cloneBlock)(u);if(b){let x=f===i?v:k,C=x.attributes[m],B=(0,ft.insert)((0,ft.create)({html:C}),wl,h,h);x.attributes[m]=(0,ft.toHTMLString)({value:B})}let y=a.name===u.name?[k]:(0,be.switchToBlockType)(k,a.name);if(!y||!y.length)return;let S=c.merge(v.attributes,y[0].attributes);if(b){let x=Lv(S),C=S[x],B=(0,ft.create)({html:C}),I=B.text.indexOf(wl),P=(0,ft.remove)(B,I,I+1),E=(0,ft.toHTMLString)({value:P});S[x]=E,n.selectionChange(a.clientId,x,I,I)}n.replaceBlocks([a.clientId,u.clientId],[{...a,attributes:{...a.attributes,...S}},...y.slice(1)],0)},eU=(e,t=!0)=>iM(e,t);function dke(e,t){return eU([e],t)}function fke(e,t,o=!1,r=0){return{type:"REPLACE_INNER_BLOCKS",rootClientId:e,blocks:t,updateSelection:o,initialPosition:o?r:null,time:Date.now()}}function mke(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function pke(){return{type:"START_TYPING"}}function hke(){return{type:"STOP_TYPING"}}function gke(e=[]){return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function bke(){return{type:"STOP_DRAGGING_BLOCKS"}}function kke(){return(0,mu.default)('wp.data.dispatch( "core/block-editor" ).enterFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function vke(){return(0,mu.default)('wp.data.dispatch( "core/block-editor" ).exitFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function yke(e,t,o,r){return typeof e=="string"?{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:o,endOffset:r}:{type:"SELECTION_CHANGE",...e}}var Ske=(e,t,o)=>({dispatch:r})=>{let n=(0,be.getDefaultBlockName)();if(!n)return;let i=(0,be.createBlock)(n,e);return r.insertBlock(i,o,t)};function _ke(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function xke(e){return nM(e,{stripExperimentalSettings:!0})}function wke(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function Cke(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function Bke(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}var Eke=()=>({dispatch:e})=>{e({type:"MARK_AUTOMATIC_CHANGE"});let{requestIdleCallback:t=o=>setTimeout(o,100)}=window;t(()=>{e({type:"MARK_AUTOMATIC_CHANGE_FINAL"})})},Tke=e=>({registry:t})=>{t.dispatch(Yj.store).set("core","editorTool",e),e==="navigation"?(0,Lw.speak)((0,fu.__)("You are currently in Write mode.")):e==="edit"&&(0,Lw.speak)((0,fu.__)("You are currently in Design mode."))};function Ike(){return(0,mu.default)('wp.data.dispatch( "core/block-editor" ).setBlockMovingClientId',{since:"6.7",hint:"Block moving mode feature has been removed"}),{type:"DO_NOTHING"}}var Pke=(e,t=!0)=>({select:o,dispatch:r})=>{if(!e||!e.length)return;let n=o.getBlocksByClientId(e);if(n.some(d=>!d)||n.map(d=>d.name).some(d=>!(0,be.hasBlockSupport)(d,"multiple",!0)))return;let s=o.getBlockRootClientId(e[0]),a=Xp(e),c=o.getBlockIndex(a[a.length-1]),u=n.map(d=>(0,be.__experimentalCloneSanitizedBlock)(d));return r.insertBlocks(u,c+1,s,t),u.length>1&&t&&r.multiSelect(u[0].clientId,u[u.length-1].clientId),u.map(d=>d.clientId)},Rke=e=>({select:t,dispatch:o})=>{if(!e)return;let r=t.getBlockRootClientId(e),n=t.getBlockIndex(e),i=r?t.getDirectInsertBlock(r):null;if(!i)return o.insertDefaultBlock({},r,n);let s={};if(i.attributesToCopy){let c=t.getBlockAttributes(e);i.attributesToCopy.forEach(u=>{c[u]&&(s[u]=c[u])})}let a=(0,be.createBlock)(i.name,{...i.attributes,...s});return o.insertBlock(a,n,r)},Oke=e=>({select:t,dispatch:o})=>{if(!e)return;let r=t.getBlockRootClientId(e),n=t.getBlockIndex(e),i=r?t.getDirectInsertBlock(r):null;if(!i)return o.insertDefaultBlock({},r,n+1);let s={};if(i.attributesToCopy){let c=t.getBlockAttributes(e);i.attributesToCopy.forEach(u=>{c[u]&&(s[u]=c[u])})}let a=(0,be.createBlock)(i.name,{...i.attributes,...s});return o.insertBlock(a,n+1,r)};function lM(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}var Ake=(e,t=150)=>async({dispatch:o})=>{o(lM(e,!0)),await new Promise(r=>setTimeout(r,t)),o(lM(e,!1))};function Lke(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}function Nke(e){return{type:"SET_BLOCK_VISIBILITY",updates:e}}function Mke(e){return(0,mu.default)("wp.data.dispatch( 'core/block-editor' ).__unstableSetTemporarilyEditingAsBlocks",{since:"7.0"}),sM(e)}var Dke=e=>({select:t,dispatch:o})=>{if(!e||typeof e!="object"){console.error("Category should be an `InserterMediaCategory` object.");return}if(!e.name){console.error("Category should have a `name` that should be unique among all media categories.");return}if(!e.labels?.name){console.error("Category should have a `labels.name`.");return}if(!["image","audio","video"].includes(e.mediaType)){console.error("Category should have `mediaType` property that is one of `image|audio|video`.");return}if(!e.fetch||typeof e.fetch!="function"){console.error("Category should have a `fetch` function defined with the following signature `(InserterMediaRequest) => Promise<InserterMediaItem[]>`.");return}let r=t.getRegisteredInserterMediaCategories();if(r.some(({name:n})=>n===e.name)){console.error(`A category is already registered with the same name: "${e.name}".`);return}if(r.some(({labels:{name:n}={}})=>n===e.labels?.name)){console.error(`A category is already registered with the same labels.name: "${e.labels.name}".`);return}o({type:"REGISTER_INSERTER_MEDIA_CATEGORY",category:{...e,isExternalResource:!0}})};function Vke(e="",t){return{type:"SET_BLOCK_EDITING_MODE",clientId:e,mode:t}}function Fke(e=""){return{type:"UNSET_BLOCK_EDITING_MODE",clientId:e}}function zke(e){return{type:"SET_OPEN_LIST_VIEW_PANEL",clientId:e}}function jke(){return{type:"SET_ALL_LIST_VIEW_PANELS_OPEN"}}function Uke(e,t){return{type:"TOGGLE_LIST_VIEW_PANEL",clientId:e,isOpen:t}}function Hke(){return{type:"INCREMENT_LIST_VIEW_EXPAND_REVISION"}}var Qp={reducer:Q6,selectors:rM,actions:cM},_=(0,Nw.createReduxStore)(Kt,{...Qp,persist:["preferences"]}),tU=(0,Nw.registerStore)(Kt,{...Qp,persist:["preferences"]});M(tU).registerPrivateActions(Aw);M(tU).registerPrivateSelectors(Tw);M(_).registerPrivateActions(Aw);M(_).registerPrivateSelectors(Tw);var Jp=l(A(),1),oU=l(N(),1);var Ss=l(w(),1);function Gke({className:e,actions:t,children:o,secondaryActions:r}){return(0,Ss.jsx)("div",{style:{display:"contents",all:"initial"},children:(0,Ss.jsx)("div",{className:V(e,"block-editor-warning"),children:(0,Ss.jsxs)("div",{className:"block-editor-warning__contents",children:[(0,Ss.jsx)("p",{className:"block-editor-warning__message",children:o}),(t?.length>0||r)&&(0,Ss.jsxs)("div",{className:"block-editor-warning__actions",children:[t?.length>0&&t.map((n,i)=>(0,Ss.jsx)("span",{className:"block-editor-warning__action",children:n},i)),r&&(0,Ss.jsx)(Jp.DropdownMenu,{className:"block-editor-warning__secondary",icon:ks,label:(0,oU.__)("More options"),popoverProps:{placement:"bottom-end",className:"block-editor-warning__dropdown"},noIcons:!0,children:()=>(0,Ss.jsx)(Jp.MenuGroup,{children:r.map((n,i)=>(0,Ss.jsx)(Jp.MenuItem,{onClick:n.onClick,children:n.title},i))})})]})]})})})}var pu=Gke;var eh=l(w(),1);function iU({originalBlockClientId:e,name:t,onReplace:o}){let{selectBlock:r}=(0,nU.useDispatch)(_),n=(0,rU.getBlockType)(t);return(0,eh.jsxs)(pu,{actions:[(0,eh.jsx)(uM.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>r(e),children:(0,Mw.__)("Find original")},"find-original"),(0,eh.jsx)(uM.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>o([]),children:(0,Mw.__)("Remove")},"remove")],children:[(0,eh.jsxs)("strong",{children:[n?.title,": "]}),(0,Mw.__)("This block can only be used once.")]})}var Nv=l(w(),1);function Fw({mayDisplayControls:e,mayDisplayParentControls:t,mayDisplayPatternEditingControls:o,blockEditingMode:r,isPreviewMode:n,...i}){let{name:s,isSelected:a,clientId:c,attributes:u={},__unstableLayoutClassNames:d}=i,{layout:f=null,metadata:m={}}=u,{bindings:h}=m,p=(0,Dw.hasBlockSupport)(s,"layout",!1)||(0,Dw.hasBlockSupport)(s,"__experimentalLayout",!1),b=!!Ie()[Hk]||(0,Dw.hasBlockSupport)(s,"listView")||s==="core/navigation",{originalBlockClientId:v}=(0,Vw.useContext)(ur);return(0,Nv.jsxs)(f0,{value:(0,Vw.useMemo)(()=>({name:s,isSelected:a,clientId:c,layout:p?f:null,__unstableLayoutClassNames:d,[bs]:e,[Pp]:t,[$c]:o&&r!=="disabled",[u0]:r,[Rp]:h,[d0]:n,[Hk]:b}),[s,a,c,p,f,d,e,t,o,r,h,n,b]),children:[(0,Nv.jsx)(z6,{...i}),v&&(0,Nv.jsx)(iU,{originalBlockClientId:v,name:s,onReplace:i.onReplace})]})}function me(...e){let{clientId:t=null}=Ie();return(0,sU.useSelect)(o=>M(o(_)).getBlockSettings(t,...e),[t,...e])}function lU(e){(0,aU.default)("wp.blockEditor.useSetting",{since:"6.5",alternative:"wp.blockEditor.useSettings",note:"The new useSettings function can retrieve multiple settings at once, with better performance."});let[t]=me(e);return t}var jw=l(w(),1),{kebabCase:Wke}=M(uU.privateApis),cU=([e,...t])=>e.toUpperCase()+t.join(""),$ke=e=>(0,zf.createHigherOrderComponent)(t=>function(r){return(0,jw.jsx)(t,{...r,colors:e})},"withCustomColorPalette"),Kke=()=>(0,zf.createHigherOrderComponent)(e=>function(o){let[r,n,i]=me("color.palette.custom","color.palette.theme","color.palette.default"),s=(0,zw.useMemo)(()=>[...r||[],...n||[],...i||[]],[r,n,i]);return(0,jw.jsx)(e,{...o,colors:s})},"withEditorColorPalette");function dU(e,t){let o=e.reduce((r,n)=>({...r,...typeof n=="string"?{[n]:Wke(n)}:n}),{});return(0,zf.compose)([t,r=>class extends zw.Component{constructor(i){super(i),this.setters=this.createSetters(),this.colorUtils={getMostReadableColor:this.getMostReadableColor.bind(this)},this.state={}}getMostReadableColor(i){let{colors:s}=this.props;return P6(s,i)}createSetters(){return Object.keys(o).reduce((i,s)=>{let a=cU(s),c=`custom${a}`;return i[`set${a}`]=this.createSetColor(s,c),i},{})}createSetColor(i,s){return a=>{let c=p0(this.props.colors,a);this.props.setAttributes({[i]:c&&c.slug?c.slug:void 0,[s]:c&&c.slug?void 0:a})}}static getDerivedStateFromProps({attributes:i,colors:s},a){return Object.entries(o).reduce((c,[u,d])=>{let f=da(s,i[u],i[`custom${cU(u)}`]),m=a[u];return m?.color===f.color&&m?c[u]=m:c[u]={...f,class:_i(d,f.slug)},c},{})}render(){return(0,jw.jsx)(r,{...this.props,colors:void 0,...this.state,...this.setters,colorUtils:this.colorUtils})}}])}function fU(e){return(...t)=>{let o=$ke(e);return(0,zf.createHigherOrderComponent)(dU(t,o),"withCustomColors")}}function mU(...e){let t=Kke();return(0,zf.createHigherOrderComponent)(dU(e,t),"withColors")}var Uw=l(R(),1),Hw=l(F(),1);function th(e){if(e)return`has-${e}-gradient-background`}function Gw(e,t){let o=e?.find(r=>r.slug===t);return o&&o.gradient}function pU(e,t){return e?.find(r=>r.gradient===t)}function hU(e,t){let o=pU(e,t);return o&&o.slug}function Yke({gradientAttribute:e="gradient",customGradientAttribute:t="customGradient"}={}){let{clientId:o}=Ie(),[r,n,i]=me("color.gradients.custom","color.gradients.theme","color.gradients.default"),s=(0,Uw.useMemo)(()=>[...r||[],...n||[],...i||[]],[r,n,i]),{gradient:a,customGradient:c}=(0,Hw.useSelect)(h=>{let{getBlockAttributes:p}=h(_),g=p(o)||{};return{customGradient:g[t],gradient:g[e]}},[o,e,t]),{updateBlockAttributes:u}=(0,Hw.useDispatch)(_),d=(0,Uw.useCallback)(h=>{let p=hU(s,h);if(p){u(o,{[e]:p,[t]:void 0});return}u(o,{[e]:void 0,[t]:h})},[s,o,u]),f=th(a),m;return a?m=Gw(s,a):m=c,{gradientClass:f,gradientValue:m,setGradient:d}}var gU=l(A(),1);var{kebabCase:qke}=M(gU.privateApis),oh=(e,t,o)=>{if(t){let r=e?.find(({slug:n})=>n===t);if(r)return r}return{size:o}};function dM(e,t){let o=e?.find(({size:r})=>r===t);return o||{size:t}}function hu(e){if(e)return`has-${qke(e)}-font-size`}var Zke="1600px",Xke="320px",Qke=1,Jke=.25,eve=.75,tve="14px";function bU({minimumFontSize:e,maximumFontSize:t,fontSize:o,minimumViewportWidth:r=Xke,maximumViewportWidth:n=Zke,scaleFactor:i=Qke,minimumFontSizeLimit:s}){if(s=gu(s)?s:tve,o){let y=gu(o);if(!y?.unit)return null;let S=gu(s,{coerceTo:y.unit});if(S?.value&&!e&&!t&&y?.value<=S?.value)return null;if(t||(t=`${y.value}${y.unit}`),!e){let x=y.unit==="px"?y.value:y.value*16,C=Math.min(Math.max(1-.075*Math.log2(x),Jke),eve),B=Mv(y.value*C,3);S?.value&&B<S?.value?e=`${S.value}${S.unit}`:e=`${B}${y.unit}`}}let a=gu(e),c=a?.unit||"rem",u=gu(t,{coerceTo:c});if(!a||!u)return null;let d=gu(e,{coerceTo:"rem"}),f=gu(n,{coerceTo:c}),m=gu(r,{coerceTo:c});if(!f||!m||!d)return null;let h=f.value-m.value;if(!h)return null;let p=Mv(m.value/100,3),g=Mv(p,3)+c,b=100*((u.value-a.value)/h),v=Mv((b||1)*i,3),k=`${d.value}${d.unit} + ((1vw - ${g}) * ${v})`;return`clamp(${e}, ${k}, ${t})`}function gu(e,t={}){if(typeof e!="string"&&typeof e!="number")return null;isFinite(e)&&(e=`${e}px`);let{coerceTo:o,rootSizeValue:r,acceptableUnits:n}={coerceTo:"",rootSizeValue:16,acceptableUnits:["rem","px","em"],...t},i=n?.join("|"),s=new RegExp(`^(\\d*\\.?\\d+)(${i}){1,1}$`),a=e.match(s);if(!a||a.length<3)return null;let[,c,u]=a,d=parseFloat(c);return o==="px"&&(u==="em"||u==="rem")&&(d=d*r,u=o),u==="px"&&(o==="em"||o==="rem")&&(d=d/r,u=o),(o==="em"||o==="rem")&&(u==="em"||u==="rem")&&(u=o),{value:Mv(d,3),unit:u}}function Mv(e,t=3){let o=Math.pow(10,t);return Number.isFinite(e)?parseFloat(Math.round(e*o)/o):void 0}var kU=l(A(),1);var vU=l(w(),1);function ove(e){let[t,o]=me("typography.fontSizes","typography.customFontSize");return(0,vU.jsx)(kU.FontSizePicker,{...e,fontSizes:t,disableCustomFontSizes:!o,__next40pxDefaultSize:!0})}var fM=ove;var Dv=l(Z(),1),SU=l(R(),1);var mM=l(w(),1),rve=[],yU=([e,...t])=>e.toUpperCase()+t.join(""),_U=(...e)=>{let t=e.reduce((o,r)=>(o[r]=`custom${yU(r)}`,o),{});return(0,Dv.createHigherOrderComponent)((0,Dv.compose)([(0,Dv.createHigherOrderComponent)(o=>function(n){let[i]=me("typography.fontSizes");return(0,mM.jsx)(o,{...n,fontSizes:i||rve})},"withFontSizes"),o=>class extends SU.Component{constructor(n){super(n),this.setters=this.createSetters(),this.state={}}createSetters(){return Object.entries(t).reduce((n,[i,s])=>{let a=yU(i);return n[`set${a}`]=this.createSetFontSize(i,s),n},{})}createSetFontSize(n,i){return s=>{let a=this.props.fontSizes?.find(({size:c})=>c===Number(s));this.props.setAttributes({[n]:a&&a.slug?a.slug:void 0,[i]:a&&a.slug?void 0:s})}}static getDerivedStateFromProps({attributes:n,fontSizes:i},s){let a=(u,d)=>s[d]?n[d]?n[d]!==s[d].slug:s[d].size!==n[u]:!0;if(!Object.values(t).some(a))return null;let c=Object.entries(t).filter(([u,d])=>a(d,u)).reduce((u,[d,f])=>{let m=n[d],h=oh(i,m,n[f]);return u[d]={...h,class:hu(m)},u},{});return{...s,...c}}render(){return(0,mM.jsx)(o,{...this.props,fontSizes:void 0,...this.state,...this.setters})}}]),"withFontSizes")};var bu=l(N(),1),Ww=l(A(),1);var xU=l(w(),1),nve=[{icon:Jc,title:(0,bu.__)("Align text left"),align:"left"},{icon:Sf,title:(0,bu.__)("Align text center"),align:"center"},{icon:eu,title:(0,bu.__)("Align text right"),align:"right"}],ive={placement:"bottom-start"};function sve({value:e,onChange:t,alignmentControls:o=nve,label:r=(0,bu.__)("Align text"),description:n=(0,bu.__)("Change text alignment"),isCollapsed:i=!0,isToolbar:s}){function a(m){return()=>t(e===m?void 0:m)}let c=o.find(m=>m.align===e);function u(){return c?c.icon:(0,bu.isRTL)()?eu:Jc}let d=s?Ww.ToolbarGroup:Ww.ToolbarDropdownMenu,f=s?{isCollapsed:i}:{toggleProps:{description:n},popoverProps:ive};return(0,xU.jsx)(d,{icon:u(),label:r,controls:o.map(m=>{let{align:h}=m;return{...m,isActive:e===h,role:i?"menuitemradio":void 0,onClick:a(h)}}),...f})}var pM=sve;var hM=l(w(),1),$w=e=>(0,hM.jsx)(pM,{...e,isToolbar:!1}),wU=e=>(0,hM.jsx)(pM,{...e,isToolbar:!0});var Jw=l(ut(),1),eC=l(A(),1),$U=l(R(),1),tC=l($(),1);var DU=l(F(),1),vu=l($(),1),yM=l(R(),1);var AU=l(TU(),1);var gM=function(e,t){return gM=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(o[n]=r[n])},gM(e,t)};function IU(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");gM(e,t);function o(){this.constructor=e}e.prototype=t===null?Object.create(t):(o.prototype=t.prototype,new o)}var Fo=function(){return Fo=Object.assign||function(t){for(var o,r=1,n=arguments.length;r<n;r++){o=arguments[r];for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(t[i]=o[i])}return t},Fo.apply(this,arguments)};function PU(e){return e.toLowerCase()}var dve=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],fve=/[^A-Z0-9]+/gi;function OU(e,t){t===void 0&&(t={});for(var o=t.splitRegexp,r=o===void 0?dve:o,n=t.stripRegexp,i=n===void 0?fve:n,s=t.transform,a=s===void 0?PU:s,c=t.delimiter,u=c===void 0?" ":c,d=RU(RU(e,r,"$1\0$2"),i,"\0"),f=0,m=d.length;d.charAt(f)==="\0";)f++;for(;d.charAt(m-1)==="\0";)m--;return d.slice(f,m).split("\0").map(a).join(u)}function RU(e,t,o){return t instanceof RegExp?e.replace(t,o):t.reduce(function(r,n){return r.replace(n,o)},e)}var mve=e=>e.name||"",pve=e=>e.title,hve=e=>e.description||"",gve=e=>e.keywords||[],bve=e=>e.category,kve=()=>null,vve=[/([\p{Ll}\p{Lo}\p{N}])([\p{Lu}\p{Lt}])/gu,/([\p{Lu}\p{Lt}])([\p{Lu}\p{Lt}][\p{Ll}\p{Lo}])/gu],yve=new RegExp("(\\p{C}|\\p{P}|\\p{S})+","giu"),bM=new Map,kM=new Map;function Yw(e=""){if(bM.has(e))return bM.get(e);let t=OU(e,{splitRegexp:vve,stripRegexp:yve}).split(" ").filter(Boolean);return bM.set(e,t),t}function Vv(e=""){if(kM.has(e))return kM.get(e);let t=(0,AU.default)(e);return t=t.replace(/^\//,""),t=t.toLowerCase(),kM.set(e,t),t}var Fv=(e="")=>Yw(Vv(e)),Sve=(e,t)=>e.filter(o=>!Fv(t).some(r=>r.includes(o))),qw=(e,t,o,r)=>Fv(r).length===0?e:zv(e,r,{getCategory:s=>t.find(({slug:a})=>a===s.category)?.title,getCollection:s=>o[s.name.split("/")[0]]?.title}),zv=(e=[],t="",o={})=>{if(Fv(t).length===0)return e;let n=e.map(i=>[i,_ve(i,t,o)]).filter(([,i])=>i>0);return n.sort(([,i],[,s])=>s-i),n.map(([i])=>i)};function _ve(e,t,o={}){let{getName:r=mve,getTitle:n=pve,getDescription:i=hve,getKeywords:s=gve,getCategory:a=bve,getCollection:c=kve}=o,u=r(e),d=n(e),f=i(e),m=s(e),h=a(e),p=c(e),g=Vv(t),b=Vv(d),v=0;if(g===b)v+=30;else if(b.startsWith(g))v+=20;else{let k=[u,d,f,...m,h,p].join(" "),y=Yw(g);Sve(y,k).length===0&&(v+=10)}if(v!==0&&u.startsWith("core/")){let k=u!==e.id;v+=k?1:2}return v}var pa=l($(),1),rh=l(F(),1),Zw=l(R(),1),LU=l(Un(),1),Xw=l(N(),1);var xve=(e,t,o)=>{let r=(0,Zw.useMemo)(()=>({[uu]:!!o}),[o]),[n]=(0,rh.useSelect)(d=>[d(_).getInserterItems(e,r)],[e,r]),{getClosestAllowedInsertionPoint:i}=M((0,rh.useSelect)(_)),{createErrorNotice:s}=(0,rh.useDispatch)(LU.store),[a,c]=(0,rh.useSelect)(d=>{let{getCategories:f,getCollections:m}=d(pa.store);return[f(),m()]},[]),u=(0,Zw.useCallback)(({name:d,initialAttributes:f,innerBlocks:m,syncStatus:h,content:p},g)=>{let b=i(d,e);if(b===null){let k=(0,pa.getBlockType)(d)?.title??d;s((0,Xw.sprintf)((0,Xw.__)(`Block "%s" can't be inserted.`),k),{type:"snackbar",id:"inserter-notice"});return}let v=h==="unsynced"?(0,pa.parse)(p,{__unstableSkipMigrationLogs:!0}):(0,pa.createBlock)(d,f,(0,pa.createBlocksFromInnerBlocksTemplate)(m));t(v,void 0,g,b)},[i,e,t,s]);return[n,a,c,u]},ku=xve;var NU=l(A(),1);var MU=l(R(),1),vM=l(w(),1);function wve({icon:e,showColors:t=!1,className:o,context:r}){e?.src==="block-default"&&(e={src:Jk});let n=(0,vM.jsx)(NU.Icon,{icon:e&&e.src?e.src:e,context:r}),i=t?{backgroundColor:e&&e.background,color:e&&e.foreground}:{};return(0,vM.jsx)("span",{style:i,className:V("block-editor-block-icon",o,{"has-colors":t}),children:n})}var Ae=(0,MU.memo)(wve);var Qw=(e,t)=>(t&&e.sort(({id:o},{id:r})=>{let n=t.indexOf(o),i=t.indexOf(r);return n<0&&(n=t.length),i<0&&(i=t.length),n-i}),e);var nh=l(w(),1),Cve=()=>{},Bve=9;function Eve(){return{name:"blocks",className:"block-editor-autocompleters__block",triggerPrefix:"/",useItems(e){let{rootClientId:t,selectedBlockId:o,prioritizedBlocks:r}=(0,DU.useSelect)(u=>{let{getSelectedBlockClientId:d,getBlock:f,getBlockListSettings:m,getBlockRootClientId:h}=u(_),{getActiveBlockVariation:p}=u(vu.store),g=d(),{name:b,attributes:v}=f(g),k=p(b,v),y=h(g);return{selectedBlockId:k?`${b}/${k.name}`:b,rootClientId:y,prioritizedBlocks:m(y)?.prioritizedInserterBlocks}},[]),[n,i,s]=ku(t,Cve,!0),a=(0,yM.useMemo)(()=>(e.trim()?qw(n,i,s,e):Qw(ma(n,"frecency","desc"),r)).filter(d=>d.id!==o).slice(0,Bve),[e,o,n,i,s,r]);return[(0,yM.useMemo)(()=>a.map(u=>{let{title:d,icon:f,isDisabled:m}=u;return{key:`block-${u.id}`,value:u,label:(0,nh.jsxs)(nh.Fragment,{children:[(0,nh.jsx)(Ae,{icon:f,showColors:!0},"icon"),d]}),isDisabled:m}}),[a])]},allowContext(e,t){return!(/\S/.test(e)||/\S/.test(t))},getOptionCompletion(e){let{name:t,initialAttributes:o,innerBlocks:r,syncStatus:n,blocks:i}=e;return{action:"replace",value:n==="unsynced"?(i??[]).map(s=>(0,vu.cloneBlock)(s)):(0,vu.createBlock)(t,o,(0,vu.createBlocksFromInnerBlocksTemplate)(r))}}}}var VU=Eve();var UU=l(zU(),1),HU=l(dn(),1);var GU=l(SM(),1),jf=l(w(),1),Tve=10;function Ive(){return{name:"links",className:"block-editor-autocompleters__link",triggerPrefix:"[[",options:async e=>{let t=await(0,UU.default)({path:(0,HU.addQueryArgs)("/wp/v2/search",{per_page:Tve,search:e,type:"post",order_by:"menu_order"})});return t=t.filter(o=>o.title!==""),t},getOptionKeywords(e){return[...e.title.split(/\s+/)]},getOptionLabel(e){return(0,jf.jsxs)(jf.Fragment,{children:[(0,jf.jsx)(we,{icon:e.subtype==="page"?kl:YL},"icon"),(0,GU.decodeEntities)(e.title)]})},getOptionCompletion(e){return(0,jf.jsx)("a",{href:e.url,children:e.title})}}}var WU=Ive();var KU=l(w(),1),Pve=[];function YU({completers:e=Pve}){let{name:t}=Ie();return(0,$U.useMemo)(()=>{let o=[...e,WU];return(t===(0,tC.getDefaultBlockName)()||(0,tC.getBlockSupport)(t,"__experimentalSlashInserter",!1))&&(o=[...o,VU]),(0,Jw.hasFilter)("editor.Autocomplete.completers")&&(o===e&&(o=o.map(r=>({...r}))),o=(0,Jw.applyFilters)("editor.Autocomplete.completers",o,t)),o},[e,t])}function qU(e){return(0,eC.__unstableUseAutocompleteProps)({...e,completers:YU(e)})}function Rve(e){return(0,KU.jsx)(eC.Autocomplete,{...e,completers:YU(e)})}var ZU=Rve;var BM=l(N(),1),xu=l(A(),1);var gH=l(F(),1);var aC=l(R(),1);var Pi=l(N(),1);var mn=l(A(),1);var ih=l(N(),1);var Hn={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}}]}};function Gn(e,t=""){return e.split(",").map(o=>`${o}${t?` ${t}`:""}`).join(",")}function yu(e,t=Hn,o,r){let n="";return t?.[o]?.spacingStyles?.length&&r&&t[o].spacingStyles.forEach(i=>{n+=`${Gn(e,i.selector.trim())} { `,n+=Object.entries(i.rules).map(([s,a])=>`${s}: ${a||r}`).join("; "),n+="; }"}),n}function oC(e){let{contentSize:t,wideSize:o,type:r="default"}=e,n={},i=/^(?!0)\d+(px|em|rem|vw|vh|%|svw|lvw|dvw|svh|lvh|dvh|vi|svi|lvi|dvi|vb|svb|lvb|dvb|vmin|svmin|lvmin|dvmin|vmax|svmax|lvmax|dvmax)?$/i;return i.test(t)&&r==="constrained"&&(n.none=(0,ih.sprintf)((0,ih.__)("Max %s wide"),t)),i.test(o)&&(n.wide=(0,ih.sprintf)((0,ih.__)("Max %s wide"),o)),n}var _s=l(N(),1);var XU=8,Su=["top","right","bottom","left"],QU={top:void 0,right:void 0,bottom:void 0,left:void 0},rC={custom:cw,axial:cw,horizontal:lN,vertical:fN,top:dN,right:uN,bottom:aN,left:cN},ha={default:(0,_s.__)("Spacing control"),top:(0,_s.__)("Top"),bottom:(0,_s.__)("Bottom"),left:(0,_s.__)("Left"),right:(0,_s.__)("Right"),mixed:(0,_s.__)("Mixed"),vertical:(0,_s.__)("Vertical"),horizontal:(0,_s.__)("Horizontal"),axial:(0,_s.__)("Horizontal & vertical"),custom:(0,_s.__)("Custom")},Cl={axial:"axial",top:"top",right:"right",bottom:"bottom",left:"left",custom:"custom"};function nC(e){return e?.includes?e==="0"||e.includes("var:preset|spacing|"):!1}function JU(e,t){if(!nC(e))return e;let o=Ove(e);return t.find(n=>String(n.slug)===o)?.size}function sh(e,t){if(!e||nC(e)||e==="0")return e;let o=t.find(r=>String(r.size)===String(e));return o?.slug?`var:preset|spacing|${o.slug}`:e}function jv(e){if(!e)return;let t=e.match(/var:preset\|spacing\|(.+)/);return t?`var(--wp--preset--spacing--${t[1]})`:e}function Ove(e){if(!e)return;if(e==="0"||e==="default")return e;let t=e.match(/var:preset\|spacing\|(.+)/);return t?t[1]:void 0}function _M(e,t){if(!e||!e.length)return!1;let o=e.includes("horizontal")||e.includes("left")&&e.includes("right"),r=e.includes("vertical")||e.includes("top")&&e.includes("bottom");return t==="horizontal"?o:t==="vertical"?r:o||r}function Ave(e=[]){let t={top:0,right:0,bottom:0,left:0};return e.forEach(o=>t[o]+=1),(t.top+t.bottom)%2===0&&(t.left+t.right)%2===0}function eH(e={},t){let{top:o,right:r,bottom:n,left:i}=e,s=[o,r,n,i].filter(Boolean),a=o===n&&i===r&&(!!o||!!i),c=!s.length&&Ave(t),u=t?.includes("horizontal")&&t?.includes("vertical")&&t?.length===2;if(_M(t)&&(a||c))return Cl.axial;if(u&&s.length===1){let d;return Object.entries(e).some(([f,m])=>(d=f,m!==void 0)),d}return t?.length===1&&!s.length?t[0]:Cl.custom}function Lve(e){if(!e)return null;let t=typeof e=="string";return{top:t?e:e?.top,left:t?e:e?.left}}function mr(e,t="0"){let o=Lve(e);if(!o)return null;let r=jv(o?.top)||t,n=jv(o?.left)||t;return r===n?r:`${r} ${n}`}var oo=l(w(),1),Nve={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},tH={left:"flex-start",right:"flex-end",center:"center",stretch:"stretch"},Mve={top:"flex-start",center:"center",bottom:"flex-end",stretch:"stretch","space-between":"space-between"},oH={horizontal:"center",vertical:"top"},Dve=["wrap","nowrap"],nH={name:"flex",label:(0,Pi.__)("Flex"),inspectorControls:function({layout:t={},onChange:o,layoutBlockSupport:r={}}){let{allowOrientation:n=!0,allowJustification:i=!0,allowWrap:s=!0}=r;return(0,oo.jsxs)(oo.Fragment,{children:[(0,oo.jsxs)(mn.Flex,{children:[i&&(0,oo.jsx)(mn.FlexItem,{children:(0,oo.jsx)(rH,{layout:t,onChange:o})}),n&&(0,oo.jsx)(mn.FlexItem,{children:(0,oo.jsx)(jve,{layout:t,onChange:o})})]}),s&&(0,oo.jsx)(zve,{layout:t,onChange:o})]})},toolBarControls:function({layout:t={},onChange:o,layoutBlockSupport:r}){let{allowVerticalAlignment:n=!0,allowJustification:i=!0}=r;return!i&&!n?null:(0,oo.jsxs)(Mt,{group:"block",__experimentalShareWithChildBlocks:!0,children:[i&&(0,oo.jsx)(rH,{layout:t,onChange:o,isToolbar:!0}),n&&(0,oo.jsx)(Vve,{layout:t,onChange:o})]})},getLayoutStyle:function({selector:t,layout:o,style:r,blockName:n,hasBlockGapSupport:i,globalBlockGapValue:s,layoutDefinitions:a=Hn}){let{orientation:c="horizontal"}=o,u="0.5em";if(s){let k=mr(s,"0.5em").split(" ");u=k.length>1?k[1]:k[0]}let d=r?.spacing?.blockGap&&!Ue(n,"spacing","blockGap")?mr(r?.spacing?.blockGap,u):void 0,f=Nve[o.justifyContent],m=Dve.includes(o.flexWrap)?o.flexWrap:"wrap",h=Mve[o.verticalAlignment],p=tH[o.justifyContent]||tH.left,g="",b=[];return m&&m!=="wrap"&&b.push(`flex-wrap: ${m}`),c==="horizontal"?(h&&b.push(`align-items: ${h}`),f&&b.push(`justify-content: ${f}`)):(h&&b.push(`justify-content: ${h}`),b.push("flex-direction: column"),b.push(`align-items: ${p}`)),b.length&&(g=`${Gn(t)} { ${b.join("; ")}; }`),i&&d&&(g+=yu(t,a,"flex",d)),g},getOrientation(e){let{orientation:t="horizontal"}=e;return t},getAlignments(){return[]}};function Vve({layout:e,onChange:t}){let{orientation:o="horizontal"}=e,r=o==="horizontal"?oH.horizontal:oH.vertical,{verticalAlignment:n=r}=e;return(0,oo.jsx)(iC,{onChange:s=>{t({...e,verticalAlignment:s})},value:n,controls:o==="horizontal"?["top","center","bottom","stretch"]:["top","center","bottom","space-between"]})}var Fve={placement:"bottom-start"};function rH({layout:e,onChange:t,isToolbar:o=!1}){let{justifyContent:r="left",orientation:n="horizontal"}=e,i=c=>{t({...e,justifyContent:c})},s=["left","center","right"];if(n==="horizontal"?s.push("space-between"):s.push("stretch"),o)return(0,oo.jsx)(ah,{allowedControls:s,value:r,onChange:i,popoverProps:Fve});let a=[{value:"left",icon:ru,label:(0,Pi.__)("Justify items left")},{value:"center",icon:ou,label:(0,Pi.__)("Justify items center")},{value:"right",icon:nu,label:(0,Pi.__)("Justify items right")}];return n==="horizontal"?a.push({value:"space-between",icon:Fp,label:(0,Pi.__)("Space between items")}):a.push({value:"stretch",icon:zp,label:(0,Pi.__)("Stretch items")}),(0,oo.jsx)(mn.__experimentalToggleGroupControl,{__next40pxDefaultSize:!0,label:(0,Pi.__)("Justification"),value:r,onChange:i,className:"block-editor-hooks__flex-layout-justification-controls",children:a.map(({value:c,icon:u,label:d})=>(0,oo.jsx)(mn.__experimentalToggleGroupControlOptionIcon,{value:c,icon:u,label:d},c))})}function zve({layout:e,onChange:t}){let{flexWrap:o="wrap"}=e;return(0,oo.jsx)(mn.ToggleControl,{label:(0,Pi.__)("Allow to wrap to multiple lines"),onChange:r=>{t({...e,flexWrap:r?"wrap":"nowrap"})},checked:o==="wrap"})}function jve({layout:e,onChange:t}){let{orientation:o="horizontal",verticalAlignment:r,justifyContent:n}=e;return(0,oo.jsxs)(mn.__experimentalToggleGroupControl,{__next40pxDefaultSize:!0,className:"block-editor-hooks__flex-layout-orientation-controls",label:(0,Pi.__)("Orientation"),value:o,onChange:i=>{let s=r,a=n;return i==="horizontal"?(r==="space-between"&&(s="center"),n==="stretch"&&(a="left")):(r==="stretch"&&(s="top"),n==="space-between"&&(a="left")),t({...e,orientation:i,verticalAlignment:s,justifyContent:a})},children:[(0,oo.jsx)(mn.__experimentalToggleGroupControlOptionIcon,{icon:Qk,value:"horizontal",label:(0,Pi.__)("Horizontal")}),(0,oo.jsx)(mn.__experimentalToggleGroupControlOptionIcon,{icon:DO,value:"vertical",label:(0,Pi.__)("Vertical")})]})}var iH=l(N(),1);var sH={name:"default",label:(0,iH.__)("Flow"),inspectorControls:function(){return null},toolBarControls:function(){return null},getLayoutStyle:function({selector:t,style:o,blockName:r,hasBlockGapSupport:n,layoutDefinitions:i=Hn}){let s=mr(o?.spacing?.blockGap),a="";Ue(r,"spacing","blockGap")||(s?.top?a=mr(s?.top):typeof s=="string"&&(a=mr(s)));let c="";return n&&a&&(c+=yu(t,i,"default",a)),c},getOrientation(){return"vertical"},getAlignments(e,t){let o=oC(e);if(e.alignments!==void 0)return e.alignments.includes("none")||e.alignments.unshift("none"),e.alignments.map(n=>({name:n,info:o[n]}));let r=[{name:"left"},{name:"center"},{name:"right"}];if(!t){let{contentSize:n,wideSize:i}=e;n&&r.unshift({name:"full"}),i&&r.unshift({name:"wide",info:o.wide})}return r.unshift({name:"none",info:o.none}),r}};var pn=l(A(),1),Bl=l(N(),1);var lH=l(Uv(),1);var Qo=l(w(),1),cH={name:"constrained",label:(0,Bl.__)("Constrained"),inspectorControls:function({layout:t,onChange:o,layoutBlockSupport:r={}}){let{wideSize:n,contentSize:i,justifyContent:s="center"}=t,{allowJustification:a=!0,allowCustomContentAndWideSize:c=!0}=r,u=h=>{o({...t,justifyContent:h})},d=[{value:"left",icon:ru,label:(0,Bl.__)("Justify items left")},{value:"center",icon:ou,label:(0,Bl.__)("Justify items center")},{value:"right",icon:nu,label:(0,Bl.__)("Justify items right")}],[f]=me("spacing.units"),m=(0,pn.__experimentalUseCustomUnits)({availableUnits:f||["%","px","em","rem","vw"]});return(0,Qo.jsxs)(pn.__experimentalVStack,{spacing:4,className:"block-editor-hooks__layout-constrained",children:[c&&(0,Qo.jsxs)(Qo.Fragment,{children:[(0,Qo.jsx)(pn.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:(0,Bl.__)("Content width"),labelPosition:"top",value:i||n||"",onChange:h=>{h=0>parseFloat(h)?"0":h,o({...t,contentSize:h!==""?h:void 0})},units:m,prefix:(0,Qo.jsx)(pn.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,Qo.jsx)(we,{icon:_f})})}),(0,Qo.jsx)(pn.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:(0,Bl.__)("Wide width"),labelPosition:"top",value:n||i||"",onChange:h=>{h=0>parseFloat(h)?"0":h,o({...t,wideSize:h!==""?h:void 0})},units:m,prefix:(0,Qo.jsx)(pn.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,Qo.jsx)(we,{icon:Lf})})}),(0,Qo.jsx)("p",{className:"block-editor-hooks__layout-constrained-helptext",children:(0,Bl.__)("Customize the width for all elements that are assigned to the center or wide columns.")})]}),a&&(0,Qo.jsx)(pn.__experimentalToggleGroupControl,{__next40pxDefaultSize:!0,label:(0,Bl.__)("Justification"),value:s,onChange:u,children:d.map(({value:h,icon:p,label:g})=>(0,Qo.jsx)(pn.__experimentalToggleGroupControlOptionIcon,{value:h,icon:p,label:g},h))})]})},toolBarControls:function({layout:t={},onChange:o,layoutBlockSupport:r}){let{allowJustification:n=!0}=r;return n?(0,Qo.jsx)(Mt,{group:"block",__experimentalShareWithChildBlocks:!0,children:(0,Qo.jsx)(Hve,{layout:t,onChange:o})}):null},getLayoutStyle:function({selector:t,layout:o={},style:r,blockName:n,hasBlockGapSupport:i,layoutDefinitions:s=Hn}){let{contentSize:a,wideSize:c,justifyContent:u}=o,d=mr(r?.spacing?.blockGap),f="";Ue(n,"spacing","blockGap")||(d?.top?f=mr(d?.top):typeof d=="string"&&(f=mr(d)));let m=u==="left"?"0 !important":"auto !important",h=u==="right"?"0 !important":"auto !important",p=a||c?` ${Gn(t,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")} { max-width: ${a??c}; margin-left: ${m}; margin-right: ${h}; } ${Gn(t,"> .alignwide")} { max-width: ${c??a}; } ${Gn(t,"> .alignfull")} { max-width: none; } `:"";return u==="left"?p+=`${Gn(t,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")} { margin-left: ${m}; }`:u==="right"&&(p+=`${Gn(t,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")} { margin-right: ${h}; }`),r?.spacing?.padding&&(0,lH.getCSSRules)(r).forEach(b=>{if(b.key==="paddingRight"){let v=b.value==="0"?"0px":b.value;p+=` ${Gn(t,"> .alignfull")} { margin-right: calc(${v} * -1); } `}else if(b.key==="paddingLeft"){let v=b.value==="0"?"0px":b.value;p+=` ${Gn(t,"> .alignfull")} { margin-left: calc(${v} * -1); } `}}),i&&f&&(p+=yu(t,s,"constrained",f)),p},getOrientation(){return"vertical"},getAlignments(e){let t=oC(e);if(e.alignments!==void 0)return e.alignments.includes("none")||e.alignments.unshift("none"),e.alignments.map(i=>({name:i,info:t[i]}));let{contentSize:o,wideSize:r}=e,n=[{name:"left"},{name:"center"},{name:"right"}];return o&&n.unshift({name:"full"}),r&&n.unshift({name:"wide",info:t.wide}),n.unshift({name:"none",info:t.none}),n}},Uve={placement:"bottom-start"};function Hve({layout:e,onChange:t}){let{justifyContent:o="center"}=e;return(0,Qo.jsx)(ah,{allowedControls:["left","center","right"],value:o,onChange:i=>{t({...e,justifyContent:i})},popoverProps:Uve})}var Fr=l(N(),1),nt=l(A(),1),sC=l(R(),1);var Ye=l(w(),1),Gve={px:600,"%":100,vw:100,vh:100,em:38,rem:38,svw:100,lvw:100,dvw:100,svh:100,lvh:100,dvh:100,vi:100,svi:100,lvi:100,dvi:100,vb:100,svb:100,lvb:100,dvb:100,vmin:100,svmin:100,lvmin:100,dvmin:100,vmax:100,svmax:100,lvmax:100,dvmax:100},Wve=[{value:"px",label:"px",default:0},{value:"rem",label:"rem",default:0},{value:"em",label:"em",default:0}],uH={name:"grid",label:(0,Fr.__)("Grid"),inspectorControls:function({layout:t={},onChange:o,layoutBlockSupport:r={}}){let{allowSizingOnChildren:n=!1}=r,i=!0,s=!t?.isManualPlacement||window.__experimentalEnableGridInteractivity;return(0,Ye.jsxs)(Ye.Fragment,{children:[window.__experimentalEnableGridInteractivity&&(0,Ye.jsx)(Yve,{layout:t,onChange:o}),(0,Ye.jsxs)(nt.__experimentalVStack,{spacing:4,children:[i&&(0,Ye.jsx)(Kve,{layout:t,onChange:o,allowSizingOnChildren:n}),s&&(0,Ye.jsx)($ve,{layout:t,onChange:o})]})]})},toolBarControls:function(){return null},getLayoutStyle:function({selector:t,layout:o,style:r,blockName:n,hasBlockGapSupport:i,globalBlockGapValue:s,layoutDefinitions:a=Hn}){let{minimumColumnWidth:c=null,columnCount:u=null,rowCount:d=null}=o,f="1.2rem";if(s){let b=mr(s,"0.5em").split(" ");f=b.length>1?b[1]:b[0]}let m=r?.spacing?.blockGap&&!Ue(n,"spacing","blockGap")?mr(r?.spacing?.blockGap,f):void 0,h="",p=[];if(c&&u>0){let g=m||f;(g==="0"||g===0)&&(g="0px");let b=`max(min( ${c}, 100%), ( 100% - (${g}*${u-1}) ) / ${u})`;p.push(`grid-template-columns: repeat(auto-fill, minmax(${b}, 1fr))`,"container-type: inline-size"),d&&p.push(`grid-template-rows: repeat(${d}, minmax(1rem, auto))`)}else u?(p.push(`grid-template-columns: repeat(${u}, minmax(0, 1fr))`),d&&p.push(`grid-template-rows: repeat(${d}, minmax(1rem, auto))`)):p.push(`grid-template-columns: repeat(auto-fill, minmax(min(${c||"12rem"}, 100%), 1fr))`,"container-type: inline-size");return p.length&&(h=`${Gn(t)} { ${p.join("; ")}; }`),i&&m&&(h+=yu(t,a,"grid",m)),h},getOrientation(){return"horizontal"},getAlignments(){return[]}};function $ve({layout:e,onChange:t}){let{minimumColumnWidth:o,columnCount:r,isManualPlacement:n}=e,s=o||(n||r?null:"12rem"),[a,c="rem"]=(0,nt.__experimentalParseQuantityAndUnitFromRawValue)(s),u=f=>{t({...e,minimumColumnWidth:[f,c].join("")})},d=f=>{let m;["em","rem"].includes(f)&&c==="px"?m=(a/16).toFixed(2)+f:["em","rem"].includes(c)&&f==="px"&&(m=Math.round(a*16)+f),t({...e,minimumColumnWidth:m})};return(0,Ye.jsxs)("fieldset",{className:"block-editor-hooks__grid-layout-minimum-width-control",children:[(0,Ye.jsx)(nt.BaseControl.VisualLabel,{as:"legend",children:(0,Fr.__)("Min. column width")}),(0,Ye.jsxs)(nt.Flex,{gap:4,children:[(0,Ye.jsx)(nt.FlexItem,{isBlock:!0,children:(0,Ye.jsx)(nt.__experimentalUnitControl,{size:"__unstable-large",onChange:f=>{t({...e,minimumColumnWidth:f===""?void 0:f})},onUnitChange:d,value:s,units:Wve,min:0,label:(0,Fr.__)("Minimum column width"),hideLabelFromVision:!0})}),(0,Ye.jsx)(nt.FlexItem,{isBlock:!0,children:(0,Ye.jsx)(nt.RangeControl,{__next40pxDefaultSize:!0,onChange:u,value:a||0,min:0,max:Gve[c]||600,withInputField:!1,label:(0,Fr.__)("Minimum column width"),hideLabelFromVision:!0})})]}),(0,Ye.jsx)("p",{className:"components-base-control__help",children:(0,Fr.__)("Columns will wrap to fewer per row when they can no longer maintain the minimum width.")})]})}function Kve({layout:e,onChange:t,allowSizingOnChildren:o}){let{columnCount:n=void 0,rowCount:i,isManualPlacement:s}=e;return(0,Ye.jsx)(Ye.Fragment,{children:(0,Ye.jsxs)("fieldset",{className:"block-editor-hooks__grid-layout-columns-and-rows-controls",children:[!s&&(0,Ye.jsx)(nt.BaseControl.VisualLabel,{as:"legend",children:(0,Fr.__)("Max. columns")}),(0,Ye.jsxs)(nt.Flex,{gap:4,children:[(0,Ye.jsx)(nt.FlexItem,{isBlock:!0,children:(0,Ye.jsx)(nt.__experimentalNumberControl,{size:"__unstable-large",onChange:a=>{let u=a===""||a==="0"?s?1:void 0:parseInt(a,10);t({...e,columnCount:u})},value:n,min:1,label:(0,Fr.__)("Columns"),hideLabelFromVision:!s})}),(0,Ye.jsx)(nt.FlexItem,{isBlock:!0,children:o&&s?(0,Ye.jsx)(nt.__experimentalNumberControl,{size:"__unstable-large",onChange:a=>{let c=a===""||a==="0"?1:parseInt(a,10);t({...e,rowCount:c})},value:i,min:1,label:(0,Fr.__)("Rows")}):(0,Ye.jsx)(nt.RangeControl,{__next40pxDefaultSize:!0,value:n??1,onChange:a=>t({...e,columnCount:a===""||a==="0"?1:a}),min:1,max:16,withInputField:!1,label:(0,Fr.__)("Columns"),hideLabelFromVision:!0})})]})]})})}function Yve({layout:e,onChange:t}){let{columnCount:o,rowCount:r,minimumColumnWidth:n,isManualPlacement:i}=e,[s,a]=(0,sC.useState)(o||3),[c,u]=(0,sC.useState)(r),[d,f]=(0,sC.useState)(n||"12rem"),m=i?"manual":"auto",h=g=>{g==="manual"?f(n||"12rem"):(a(o||3),u(r)),t({...e,columnCount:s,rowCount:g==="manual"?c:void 0,isManualPlacement:g==="manual"?!0:void 0,minimumColumnWidth:g==="auto"?d:null})},p=m==="manual"?(0,Fr.__)("Grid items can be manually placed in any position on the grid."):(0,Fr.__)("Grid items are placed automatically depending on their order.");return(0,Ye.jsxs)(nt.__experimentalToggleGroupControl,{__next40pxDefaultSize:!0,label:(0,Fr.__)("Grid item position"),value:m,onChange:h,isBlock:!0,help:p,children:[(0,Ye.jsx)(nt.__experimentalToggleGroupControlOption,{value:"auto",label:(0,Fr.__)("Auto")},"auto"),(0,Ye.jsx)(nt.__experimentalToggleGroupControlOption,{value:"manual",label:(0,Fr.__)("Manual")},"manual")]})}var dH=[sH,nH,cH,uH];function xs(e="default"){return dH.find(t=>t.name===e)}function fH(){return dH}var xM=l(w(),1),wM={type:"default"},CM=(0,aC.createContext)(wM);CM.displayName="BlockLayoutContext";var mH=CM.Provider;function Uf(){return(0,aC.useContext)(CM)}function pH({layout:e={},css:t,...o}){let r=xs(e.type),[n]=me("spacing.blockGap"),i=n!==null;if(r){if(t)return(0,xM.jsx)("style",{children:t});let s=r.getLayoutStyle?.({hasBlockGapSupport:i,layout:e,...o});if(s)return(0,xM.jsx)("style",{children:s})}return null}var lC=[],hH=["none","left","center","right","wide","full"],qve=["wide","full"];function Hv(e=hH){e.includes("none")||(e=["none",...e]);let t=e.length===1&&e[0]==="none",[o,r,n]=(0,gH.useSelect)(c=>{if(t)return[!1,!1,!1];let u=c(_).getSettings();return[u.alignWide??!1,u.supportsLayout,u.__unstableIsBlockBasedTheme]},[t]),i=Uf();if(t)return lC;let s=xs(i?.type);if(r){let u=s.getAlignments(i,n).filter(d=>e.includes(d.name));return u.length===1&&u[0].name==="none"?lC:u}if(s.name!=="default"&&s.name!=="constrained")return lC;let a=e.filter(c=>i.alignments?i.alignments.includes(c):!o&&qve.includes(c)?!1:hH.includes(c)).map(c=>({name:c}));return a.length===1&&a[0].name==="none"?lC:a}var _u=l(N(),1);var Gv={none:{icon:_f,title:(0,_u._x)("None","Alignment option")},left:{icon:zL,title:(0,_u.__)("Align left")},center:{icon:VL,title:(0,_u.__)("Align center")},right:{icon:UL,title:(0,_u.__)("Align right")},wide:{icon:Lf,title:(0,_u.__)("Wide width")},full:{icon:_v,title:(0,_u.__)("Full width")}},bH="none";var Hf=l(w(),1);function Zve({value:e,onChange:t,controls:o,isToolbar:r,isCollapsed:n=!0}){let i=Hv(o);if(!!!i.length)return null;function a(h){t([e,"none"].includes(h)?void 0:h)}let c=Gv[e],u=Gv[bH],d=r?xu.ToolbarGroup:xu.ToolbarDropdownMenu,f={icon:c?c.icon:u.icon,label:(0,BM.__)("Align")},m=r?{isCollapsed:n,controls:i.map(({name:h})=>({...Gv[h],isActive:e===h||!e&&h==="none",role:n?"menuitemradio":void 0,onClick:()=>a(h)}))}:{toggleProps:{description:(0,BM.__)("Change alignment")},children:({onClose:h})=>(0,Hf.jsx)(Hf.Fragment,{children:(0,Hf.jsx)(xu.MenuGroup,{className:"block-editor-block-alignment-control__menu-group",children:i.map(({name:p,info:g})=>{let{icon:b,title:v}=Gv[p],k=p===e||!e&&p==="none";return(0,Hf.jsx)(xu.MenuItem,{icon:b,iconPosition:"left",className:V("components-dropdown-menu__menu-item",{"is-active":k}),isSelected:k,onClick:()=>{a(p),h()},role:"menuitemradio",info:g,children:v},p)})})})};return(0,Hf.jsx)(d,{...f,...m})}var EM=Zve;var TM=l(w(),1),cC=e=>(0,TM.jsx)(EM,{...e,isToolbar:!1}),kH=e=>(0,TM.jsx)(EM,{...e,isToolbar:!0});var xH=l(yf(),1),mC=l(N(),1),pC=l($(),1),Cs=l(A(),1),RM=l(F(),1),wH=l(R(),1),CH=l(Z(),1);var PM=l(yf(),1),vH=l($(),1),yH=l(A(),1),SH=l(F(),1),dC=l(R(),1),_H=l(Z(),1);var uC=l(F(),1);function IM(e){return!e||Object.keys(e).length===0}function El(e){let{clientId:t}=Ie(),o=e||t,{updateBlockAttributes:r}=(0,uC.useDispatch)(_),{getBlockAttributes:n}=(0,uC.useRegistry)().select(_);return{updateBlockBindings:a=>{let{metadata:{bindings:c,...u}={}}=n(o),d={...c};Object.entries(a).forEach(([m,h])=>{if(!h&&d[m]){delete d[m];return}d[m]=h});let f={...u,bindings:d};IM(f.bindings)&&delete f.bindings,r(o,{metadata:IM(f)?void 0:f})},removeAllBlockBindings:()=>{let{metadata:{bindings:a,...c}={}}=n(o);r(o,{metadata:IM(c)?void 0:c})}}}var ws=l(w(),1),{Menu:wu}=M(yH.privateApis);function Xve({args:e,attribute:t,field:o,source:r,sourceKey:n}){let i=(0,dC.useMemo)(()=>({source:n,args:o.args||{key:o.key}}),[o.args,o.key,n]),s=(0,dC.useContext)(xr),a=(0,SH.useSelect)(u=>r.getValues({select:u,context:s,bindings:{[t]:i}}),[t,s,i,r]),{updateBlockBindings:c}=El();return(0,ws.jsxs)(wu.CheckboxItem,{onChange:()=>{let u=(0,PM.default)(e,o.args)??o.key===e?.key;c(u?{[t]:void 0}:{[t]:i})},name:t+"-binding",value:a[t],checked:(0,PM.default)(e,o.args)??o.key===e?.key,children:[(0,ws.jsx)(wu.ItemLabel,{children:o.label}),(0,ws.jsx)(wu.ItemHelpText,{children:a[t]})]})}function Wv({args:e,attribute:t,sourceKey:o,fields:r}){let n=(0,_H.useViewportMatch)("medium","<");if(!r||r.length===0)return null;let i=(0,vH.getBlockBindingsSource)(o);return(0,ws.jsxs)(wu,{placement:n?"bottom-start":"left-start",children:[(0,ws.jsx)(wu.SubmenuTriggerItem,{children:(0,ws.jsx)(wu.ItemLabel,{children:i.label})}),(0,ws.jsx)(wu.Popover,{gutter:8,children:(0,ws.jsx)(wu.Group,{children:r.map(s=>(0,ws.jsx)(Xve,{args:e,attribute:t,field:s,source:i,sourceKey:o},o+JSON.stringify(s.args)||s.key))})})]},o)}var Ri=l(w(),1),{Menu:fC}=M(Cs.privateApis);function $v({attribute:e,binding:t,blockName:o}){let{updateBlockBindings:r}=El(),n=(0,CH.useViewportMatch)("medium","<"),i=(0,wH.useContext)(xr),s=(0,RM.useSelect)(g=>{let{getAllBlockBindingsSources:b,getBlockBindingsSourceFieldsList:v,getBlockType:k}=M(g(pC.store)),y=k(o).attributes?.[e];if(y?.enum)return{};let S=y?.type==="rich-text"?"string":y?.type,x={};return Object.entries(b()).forEach(([C,B])=>{let I=v(B,i);if(!I?.length)return;let P=I.filter(E=>E.type===S);P.length&&(x[C]=P)}),x},[e,o,i]),{canUpdateBlockBindings:a}=(0,RM.useSelect)(g=>({canUpdateBlockBindings:g(_).getSettings().canUpdateBlockBindings})),c=Object.keys(s).length>0,u=!a||!c,{source:d,args:f}=t||{},m=(0,pC.getBlockBindingsSource)(d),h,p=!0;return t===void 0?(c?h=(0,mC.__)("Not connected"):h=(0,mC.__)("No sources available"),p=!0):m?h=s?.[d]?.find(g=>(0,xH.default)(g.args,f))?.label||m?.label||d:(p=!1,h=(0,mC.__)("Source not registered")),(0,Ri.jsx)(Cs.__experimentalToolsPanelItem,{hasValue:()=>!!t,label:e,onDeselect:!!c&&(()=>{r({[e]:void 0})}),children:(0,Ri.jsxs)(fC,{placement:n?"bottom-start":"left-start",children:[(0,Ri.jsx)(fC.TriggerButton,{render:(0,Ri.jsx)(Cs.__experimentalItem,{}),disabled:!c,children:(0,Ri.jsxs)(Cs.__experimentalVStack,{className:"block-editor-bindings__item",spacing:0,children:[(0,Ri.jsx)(Cs.__experimentalText,{truncate:!0,children:e}),(0,Ri.jsx)(Cs.__experimentalText,{truncate:!0,variant:p?"muted":void 0,isDestructive:!p,children:h})]})}),!u&&(0,Ri.jsx)(fC.Popover,{gutter:n?8:36,children:(0,Ri.jsx)(fC,{placement:n?"bottom-start":"left-start",children:Object.entries(s).map(([g,b])=>(0,Ri.jsx)(Wv,{args:t?.args,attribute:e,sourceKey:g,fields:b},g))})})]})})}var BH=l(N(),1),EH=l(A(),1);var TH=l(w(),1);function Qve({isActive:e,label:t=(0,BH.__)("Full height"),onToggle:o,isDisabled:r}){return(0,TH.jsx)(EH.ToolbarButton,{isActive:e,icon:NA,label:t,onClick:()=>o(!e),disabled:r})}var IH=Qve;var RH=l(N(),1),OH=l(it(),1),Gf=l(A(),1),Kv=l(w(),1),Jve=()=>{};function eye(e){let{label:t=(0,RH.__)("Change matrix alignment"),onChange:o=Jve,value:r="center",isDisabled:n}=e,i=(0,Kv.jsx)(Gf.AlignmentMatrixControl.Icon,{value:r});return(0,Kv.jsx)(Gf.Dropdown,{popoverProps:{placement:"bottom-start"},renderToggle:({onToggle:s,isOpen:a})=>(0,Kv.jsx)(Gf.ToolbarButton,{onClick:s,"aria-haspopup":"true","aria-expanded":a,onKeyDown:u=>{!a&&u.keyCode===OH.DOWN&&(u.preventDefault(),s())},label:t,icon:i,showTooltip:!0,disabled:n}),renderContent:()=>(0,Kv.jsx)(Gf.AlignmentMatrixControl,{onChange:o,value:r})})}var AH=eye;var LM=l(A(),1),bC=l(F(),1),kC=l(N(),1);var zH=l(R(),1);var LH=l(F(),1),hC=l($(),1);function zr({clientId:e,maximumLength:t,context:o}){let r=(0,LH.useSelect)(n=>{if(!e)return null;let{getBlockName:i,getBlockAttributes:s}=n(_),{getBlockType:a,getActiveBlockVariation:c}=n(hC.store),u=i(e),d=a(u);if(!d)return null;let f=s(e),m=(0,hC.__experimentalGetBlockLabel)(d,f,o);return m!==d.title?m:c(u,f)?.title||d.title},[e,o]);return r?t&&t>0&&r.length>t?r.slice(0,t-3)+"...":r:null}function Yv({clientId:e,maximumLength:t,context:o}){return zr({clientId:e,maximumLength:t,context:o})}var Wf=l(R(),1),DH=l(Z(),1);var gC=l(R(),1),OM=l(Z(),1),NH=l(w(),1),qv=(0,gC.createContext)({refsMap:(0,OM.observableMap)()});qv.displayName="BlockRefsContext";function MH({children:e}){let t=(0,gC.useMemo)(()=>({refsMap:(0,OM.observableMap)()}),[]);return(0,NH.jsx)(qv.Provider,{value:t,children:e})}function VH(e){let{refsMap:t}=(0,Wf.useContext)(qv);return(0,DH.useRefEffect)(o=>(t.set(e,o),()=>t.delete(e)),[e])}function AM(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function $f(e,t){let{refsMap:o}=(0,Wf.useContext)(qv);(0,Wf.useLayoutEffect)(()=>{AM(t,o.get(e));let r=o.subscribe(e,()=>AM(t,o.get(e)));return()=>{r(),AM(t,null)}},[o,e,t])}function Xe(e){let[t,o]=(0,Wf.useState)(null);return $f(e,o),t}function FH(e){if(!e)return null;let t=Array.from(document.querySelectorAll('iframe[name="editor-canvas"]').values()).find(o=>(o.contentDocument||o.contentWindow.document)===e.ownerDocument)??e;return t?.closest('[role="region"]')??t}var Wn=l(w(),1);function tye({rootLabelText:e}){let{selectBlock:t,clearSelectedBlock:o}=(0,bC.useDispatch)(_),{clientId:r,parents:n,hasSelection:i}=(0,bC.useSelect)(c=>{let{getSelectionStart:u,getSelectedBlockClientId:d,getEnabledBlockParents:f}=M(c(_)),m=d();return{parents:f(m),clientId:m,hasSelection:!!u().clientId}},[]),s=e||(0,kC._x)("Document","noun, breadcrumb"),a=(0,zH.useRef)();return $f(r,a),(0,Wn.jsxs)("ul",{className:"block-editor-block-breadcrumb",role:"list","aria-label":(0,kC.__)("Block breadcrumb"),children:[(0,Wn.jsxs)("li",{className:i?void 0:"block-editor-block-breadcrumb__current","aria-current":i?void 0:"true",children:[i&&(0,Wn.jsx)(LM.Button,{size:"small",className:"block-editor-block-breadcrumb__button",onClick:()=>{let c=a.current?.closest(".editor-styles-wrapper");o(),FH(c)?.focus()},children:s}),!i&&(0,Wn.jsx)("span",{children:s}),!!r&&(0,Wn.jsx)(we,{icon:tu,className:"block-editor-block-breadcrumb__separator"})]}),n.map(c=>(0,Wn.jsxs)("li",{children:[(0,Wn.jsx)(LM.Button,{size:"small",className:"block-editor-block-breadcrumb__button",onClick:()=>t(c),children:(0,Wn.jsx)(Yv,{clientId:c,maximumLength:35,context:"breadcrumb"})}),(0,Wn.jsx)(we,{icon:tu,className:"block-editor-block-breadcrumb__separator"})]},c)),!!r&&(0,Wn.jsx)("li",{className:"block-editor-block-breadcrumb__current","aria-current":"true",children:(0,Wn.jsx)(Yv,{clientId:r,maximumLength:35,context:"breadcrumb"})})]})}var jH=tye;var UH=l(F(),1);function HH(e){return(0,UH.useSelect)(t=>{let{__unstableHasActiveBlockOverlayActive:o}=t(_);return o(e)},[e])}var wT=l(Z(),1),QQ=l(R(),1),JQ=l(F(),1),eJ=l(A(),1);var Gi=l(F(),1),XB=l(Z(),1),td=l(R(),1),lq=l($(),1);var Nu=l(R(),1),He=l($(),1),p9=l(A(),1),c1=l(F(),1),u1=l(Z(),1),h9=l(Fe(),1);var Tl=l(N(),1),yC=l(A(),1),Kf=l(R(),1),ch=l($(),1),SC=l(F(),1);var QH=l(YH(),1),vC=l(N(),1),JH=l($(),1);var qH=l(A(),1),ZH=l(R(),1),XH=l(Fe(),1),ga=l(w(),1);function MM({title:e,rawContent:t,renderedContent:o,action:r,actionText:n,className:i}){return(0,ga.jsxs)("div",{className:i,children:[(0,ga.jsxs)("div",{className:"block-editor-block-compare__content",children:[(0,ga.jsx)("h2",{className:"block-editor-block-compare__heading",children:e}),(0,ga.jsx)("div",{className:"block-editor-block-compare__html",children:t}),(0,ga.jsx)("div",{className:"block-editor-block-compare__preview edit-post-visual-editor",children:(0,ga.jsx)(ZH.RawHTML,{children:(0,XH.safeHTML)(o)})})]}),(0,ga.jsx)("div",{className:"block-editor-block-compare__action",children:(0,ga.jsx)(qH.Button,{__next40pxDefaultSize:!0,variant:"secondary",tabIndex:"0",onClick:r,children:n})})]})}var lh=l(w(),1);function aye({block:e,onKeep:t,onConvert:o,convertor:r,convertButtonText:n}){function i(u,d){return(0,QH.diffChars)(u,d).map((m,h)=>{let p=V({"block-editor-block-compare__added":m.added,"block-editor-block-compare__removed":m.removed});return(0,lh.jsx)("span",{className:p,children:m.value},h)})}function s(u){return(Array.isArray(u)?u:[u]).map(m=>(0,JH.getSaveContent)(m.name,m.attributes,m.innerBlocks)).join("")}let a=s(r(e)),c=i(e.originalContent,a);return(0,lh.jsxs)("div",{className:"block-editor-block-compare__wrapper",children:[(0,lh.jsx)(MM,{title:(0,vC.__)("Current"),className:"block-editor-block-compare__current",action:t,actionText:(0,vC.__)("Convert to HTML"),rawContent:e.originalContent,renderedContent:e.originalContent}),(0,lh.jsx)(MM,{title:(0,vC.__)("After Conversion"),className:"block-editor-block-compare__converted",action:o,actionText:n,rawContent:c,renderedContent:a})]})}var e8=aye;var Il=l(w(),1),t8=e=>(0,ch.rawHandler)({HTML:e.originalContent});function o8({clientId:e}){let{block:t,canInsertHTMLBlock:o,canInsertClassicBlock:r}=(0,SC.useSelect)(d=>{let{canInsertBlockType:f,getBlock:m,getBlockRootClientId:h}=d(_),p=h(e);return{block:m(e),canInsertHTMLBlock:f("core/html",p),canInsertClassicBlock:f("core/freeform",p)}},[e]),{replaceBlock:n}=(0,SC.useDispatch)(_),[i,s]=(0,Kf.useState)(!1),a=(0,Kf.useCallback)(()=>s(!1),[]),c=(0,Kf.useMemo)(()=>({toClassic(){let d=(0,ch.createBlock)("core/freeform",{content:t.originalContent});return n(t.clientId,d)},toHTML(){let d=(0,ch.createBlock)("core/html",{content:t.originalContent});return n(t.clientId,d)},toBlocks(){let d=t8(t);return n(t.clientId,d)},toRecoveredBlock(){let d=(0,ch.createBlock)(t.name,t.attributes,t.innerBlocks);return n(t.clientId,d)}}),[t,n]),u=(0,Kf.useMemo)(()=>[{title:(0,Tl._x)("Resolve","imperative verb"),onClick:()=>s(!0)},o&&{title:(0,Tl.__)("Convert to HTML"),onClick:c.toHTML},r&&{title:(0,Tl.__)("Convert to Classic Block"),onClick:c.toClassic}].filter(Boolean),[o,r,c]);return(0,Il.jsxs)(Il.Fragment,{children:[(0,Il.jsx)(pu,{actions:[(0,Il.jsx)(yC.Button,{__next40pxDefaultSize:!0,onClick:c.toRecoveredBlock,variant:"primary",children:(0,Tl.__)("Attempt recovery")},"recover")],secondaryActions:u,children:(0,Tl.__)("Block contains unexpected or invalid content.")}),i&&(0,Il.jsx)(yC.Modal,{title:(0,Tl.__)("Resolve Block"),onRequestClose:a,className:"block-editor-block-compare",children:(0,Il.jsx)(e8,{block:t,onKeep:c.toHTML,onConvert:c.toBlocks,convertor:t8,convertButtonText:(0,Tl.__)("Convert to Blocks")})})]})}var r8=l(N(),1);var n8=l(w(),1),lye=(0,n8.jsx)(pu,{className:"block-editor-block-list__block-crash-warning",children:(0,r8.__)("This block has encountered an error and cannot be previewed.")}),i8=()=>lye;var s8=l(R(),1),cye=class extends s8.Component{constructor(){super(...arguments),this.state={hasError:!1}}componentDidCatch(){this.setState({hasError:!0})}render(){return this.state.hasError?this.props.fallback:this.props.children}},a8=cye;var B8=l(FM(),1),uh=l(R(),1),CC=l(F(),1),ba=l($(),1);var E8=l(w(),1);function yye({clientId:e}){let[t,o]=(0,uh.useState)(""),r=(0,CC.useSelect)(a=>a(_).getBlock(e),[e]),{updateBlock:n}=(0,CC.useDispatch)(_),i=(0,uh.useMemo)(()=>r?(0,ba.getBlockContent)(r):"",[r]),s=()=>{let a=(0,ba.getBlockType)(r.name);if(!a)return;let c=(0,ba.getBlockAttributes)(a,t,r.attributes),u=t||(0,ba.getSaveContent)(a,c),[d]=t?(0,ba.validateBlock)({...r,attributes:c,originalContent:u}):[!0];n(e,{attributes:c,originalContent:u,isValid:d}),t||o(u)};return(0,uh.useEffect)(()=>{o(i)},[i]),(0,E8.jsx)(B8.default,{className:"block-editor-block-list__block-html-textarea",value:t,onBlur:s,onChange:a=>o(a.target.value)})}var T8=yye;var d9=l(R(),1),a1=l(N(),1),f9=l($(),1),Ch=l(Z(),1),m9=l(Qv(),1);var jM=ey(),Se=e=>Jv(e,jM),UM=ey();Se.write=e=>Jv(e,UM);var BC=ey();Se.onStart=e=>Jv(e,BC);var HM=ey();Se.onFrame=e=>Jv(e,HM);var GM=ey();Se.onFinish=e=>Jv(e,GM);var dh=[];Se.setTimeout=(e,t)=>{let o=Se.now()+t,r=()=>{let i=dh.findIndex(s=>s.cancel==r);~i&&dh.splice(i,1),Bu-=~i?1:0},n={time:o,handler:e,cancel:r};return dh.splice(P8(o),0,n),Bu+=1,R8(),n};var P8=e=>~(~dh.findIndex(t=>t.time>e)||~dh.length);Se.cancel=e=>{BC.delete(e),HM.delete(e),GM.delete(e),jM.delete(e),UM.delete(e)};Se.sync=e=>{zM=!0,Se.batchedUpdates(e),zM=!1};Se.throttle=e=>{let t;function o(){try{e(...t)}finally{t=null}}function r(...n){t=n,Se.onStart(o)}return r.handler=e,r.cancel=()=>{BC.delete(o),t=null},r};var WM=typeof window<"u"?window.requestAnimationFrame:()=>{};Se.use=e=>WM=e;Se.now=typeof performance<"u"?()=>performance.now():Date.now;Se.batchedUpdates=e=>e();Se.catch=console.error;Se.frameLoop="always";Se.advance=()=>{Se.frameLoop!=="demand"?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):A8()};var Cu=-1,Bu=0,zM=!1;function Jv(e,t){zM?(t.delete(e),e(0)):(t.add(e),R8())}function R8(){Cu<0&&(Cu=0,Se.frameLoop!=="demand"&&WM(O8))}function Sye(){Cu=-1}function O8(){~Cu&&(WM(O8),Se.batchedUpdates(A8))}function A8(){let e=Cu;Cu=Se.now();let t=P8(Cu);if(t&&(L8(dh.splice(0,t),o=>o.handler()),Bu-=t),!Bu){Sye();return}BC.flush(),jM.flush(e?Math.min(64,Cu-e):16.667),HM.flush(),UM.flush(),GM.flush()}function ey(){let e=new Set,t=e;return{add(o){Bu+=t==e&&!e.has(o)?1:0,e.add(o)},delete(o){return Bu-=t==e&&e.has(o)?1:0,e.delete(o)},flush(o){t.size&&(e=new Set,Bu-=t.size,L8(t,r=>r(o)&&e.add(r)),Bu+=e.size,t=e)}}}function L8(e,t){e.forEach(o=>{try{t(o)}catch(r){Se.catch(r)}})}var Ai=l(jr());function RC(){}var z8=(e,t,o)=>Object.defineProperty(e,t,{value:o,writable:!0,configurable:!0}),ae={arr:Array.isArray,obj:e=>!!e&&e.constructor.name==="Object",fun:e=>typeof e=="function",str:e=>typeof e=="string",num:e=>typeof e=="number",und:e=>e===void 0};function ka(e,t){if(ae.arr(e)){if(!ae.arr(t)||e.length!==t.length)return!1;for(let o=0;o<e.length;o++)if(e[o]!==t[o])return!1;return!0}return e===t}var bt=(e,t)=>e.forEach(t);function Li(e,t,o){if(ae.arr(e)){for(let r=0;r<e.length;r++)t.call(o,e[r],`${r}`);return}for(let r in e)e.hasOwnProperty(r)&&t.call(o,e[r],r)}var hn=e=>ae.und(e)?[]:ae.arr(e)?e:[e];function hh(e,t){if(e.size){let o=Array.from(e);e.clear(),bt(o,t)}}var gh=(e,...t)=>hh(e,o=>o(...t)),XM=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),QM,j8,Eu=null,U8=!1,JM=RC,_ye=e=>{e.to&&(j8=e.to),e.now&&(Se.now=e.now),e.colors!==void 0&&(Eu=e.colors),e.skipAnimation!=null&&(U8=e.skipAnimation),e.createStringInterpolator&&(QM=e.createStringInterpolator),e.requestAnimationFrame&&Se.use(e.requestAnimationFrame),e.batchedUpdates&&(Se.batchedUpdates=e.batchedUpdates),e.willAdvance&&(JM=e.willAdvance),e.frameLoop&&(Se.frameLoop=e.frameLoop)},$n=Object.freeze({__proto__:null,get createStringInterpolator(){return QM},get to(){return j8},get colors(){return Eu},get skipAnimation(){return U8},get willAdvance(){return JM},assign:_ye}),ty=new Set,Oi=[],$M=[],IC=0,bh={get idle(){return!ty.size&&!Oi.length},start(e){IC>e.priority?(ty.add(e),Se.onStart(xye)):(H8(e),Se(qM))},advance:qM,sort(e){if(IC)Se.onFrame(()=>bh.sort(e));else{let t=Oi.indexOf(e);~t&&(Oi.splice(t,1),G8(e))}},clear(){Oi=[],ty.clear()}};function xye(){ty.forEach(H8),ty.clear(),Se(qM)}function H8(e){Oi.includes(e)||G8(e)}function G8(e){Oi.splice(wye(Oi,t=>t.priority>e.priority),0,e)}function qM(e){let t=$M;for(let o=0;o<Oi.length;o++){let r=Oi[o];IC=r.priority,r.idle||(JM(r),r.advance(e),r.idle||t.push(r))}return IC=0,$M=Oi,$M.length=0,Oi=t,Oi.length>0}function wye(e,t){let o=e.findIndex(t);return o<0?e.length:o}var W8={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},Bs="[-+]?\\d*\\.?\\d+",PC=Bs+"%";function OC(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var Cye=new RegExp("rgb"+OC(Bs,Bs,Bs)),Bye=new RegExp("rgba"+OC(Bs,Bs,Bs,Bs)),Eye=new RegExp("hsl"+OC(Bs,PC,PC)),Tye=new RegExp("hsla"+OC(Bs,PC,PC,Bs)),Iye=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Pye=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Rye=/^#([0-9a-fA-F]{6})$/,Oye=/^#([0-9a-fA-F]{8})$/;function Aye(e){let t;return typeof e=="number"?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=Rye.exec(e))?parseInt(t[1]+"ff",16)>>>0:Eu&&Eu[e]!==void 0?Eu[e]:(t=Cye.exec(e))?(fh(t[1])<<24|fh(t[2])<<16|fh(t[3])<<8|255)>>>0:(t=Bye.exec(e))?(fh(t[1])<<24|fh(t[2])<<16|fh(t[3])<<8|D8(t[4]))>>>0:(t=Iye.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=Oye.exec(e))?parseInt(t[1],16)>>>0:(t=Pye.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=Eye.exec(e))?(N8(M8(t[1]),EC(t[2]),EC(t[3]))|255)>>>0:(t=Tye.exec(e))?(N8(M8(t[1]),EC(t[2]),EC(t[3]))|D8(t[4]))>>>0:null}function KM(e,t,o){return o<0&&(o+=1),o>1&&(o-=1),o<1/6?e+(t-e)*6*o:o<1/2?t:o<2/3?e+(t-e)*(2/3-o)*6:e}function N8(e,t,o){let r=o<.5?o*(1+t):o+t-o*t,n=2*o-r,i=KM(n,r,e+1/3),s=KM(n,r,e),a=KM(n,r,e-1/3);return Math.round(i*255)<<24|Math.round(s*255)<<16|Math.round(a*255)<<8}function fh(e){let t=parseInt(e,10);return t<0?0:t>255?255:t}function M8(e){return(parseFloat(e)%360+360)%360/360}function D8(e){let t=parseFloat(e);return t<0?0:t>1?255:Math.round(t*255)}function EC(e){let t=parseFloat(e);return t<0?0:t>100?1:t/100}function V8(e){let t=Aye(e);if(t===null)return e;t=t||0;let o=(t&4278190080)>>>24,r=(t&16711680)>>>16,n=(t&65280)>>>8,i=(t&255)/255;return`rgba(${o}, ${r}, ${n}, ${i})`}var Tu=(e,t,o)=>{if(ae.fun(e))return e;if(ae.arr(e))return Tu({range:e,output:t,extrapolate:o});if(ae.str(e.output[0]))return QM(e);let r=e,n=r.output,i=r.range||[0,1],s=r.extrapolateLeft||r.extrapolate||"extend",a=r.extrapolateRight||r.extrapolate||"extend",c=r.easing||(u=>u);return u=>{let d=Nye(u,i);return Lye(u,i[d],i[d+1],n[d],n[d+1],c,s,a,r.map)}};function Lye(e,t,o,r,n,i,s,a,c){let u=c?c(e):e;if(u<t){if(s==="identity")return u;s==="clamp"&&(u=t)}if(u>o){if(a==="identity")return u;a==="clamp"&&(u=o)}return r===n?r:t===o?e<=t?r:n:(t===-1/0?u=-u:o===1/0?u=u-t:u=(u-t)/(o-t),u=i(u),r===-1/0?u=-u:n===1/0?u=u+r:u=u*(n-r)+r,u)}function Nye(e,t){for(var o=1;o<t.length-1&&!(t[o]>=e);++o);return o-1}function ZM(){return ZM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},ZM.apply(this,arguments)}var mh=Symbol.for("FluidValue.get"),Yf=Symbol.for("FluidValue.observers"),Ur=e=>!!(e&&e[mh]),pr=e=>e&&e[mh]?e[mh]():e,eD=e=>e[Yf]||null;function Mye(e,t){e.eventObserved?e.eventObserved(t):e(t)}function qf(e,t){let o=e[Yf];o&&o.forEach(r=>{Mye(r,t)})}var ph=class{constructor(t){if(this[mh]=void 0,this[Yf]=void 0,!t&&!(t=this.get))throw Error("Unknown getter");Dye(this,t)}},Dye=(e,t)=>$8(e,mh,t);function Iu(e,t){if(e[mh]){let o=e[Yf];o||$8(e,Yf,o=new Set),o.has(t)||(o.add(t),e.observerAdded&&e.observerAdded(o.size,t))}return t}function Pu(e,t){let o=e[Yf];if(o&&o.has(t)){let r=o.size-1;r?o.delete(t):e[Yf]=null,e.observerRemoved&&e.observerRemoved(r,t)}}var $8=(e,t,o)=>Object.defineProperty(e,t,{value:o,writable:!0,configurable:!0}),TC=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,Vye=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,F8=new RegExp(`(${TC.source})(%|[a-z]+)`,"i"),Fye=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,AC=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,K8=e=>{let[t,o]=zye(e);if(!t||XM())return e;let r=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(r)return r.trim();if(o&&o.startsWith("--")){let n=window.getComputedStyle(document.documentElement).getPropertyValue(o);return n||e}else{if(o&&AC.test(o))return K8(o);if(o)return o}return e},zye=e=>{let t=AC.exec(e);if(!t)return[,];let[,o,r]=t;return[o,r]},YM,jye=(e,t,o,r,n)=>`rgba(${Math.round(t)}, ${Math.round(o)}, ${Math.round(r)}, ${n})`,LC=e=>{YM||(YM=Eu?new RegExp(`(${Object.keys(Eu).join("|")})(?!\\w)`,"g"):/^\b$/);let t=e.output.map(i=>pr(i).replace(AC,K8).replace(Vye,V8).replace(YM,V8)),o=t.map(i=>i.match(TC).map(Number)),n=o[0].map((i,s)=>o.map(a=>{if(!(s in a))throw Error('The arity of each "output" value must be equal');return a[s]})).map(i=>Tu(ZM({},e,{output:i})));return i=>{var s;let a=!F8.test(t[0])&&((s=t.find(u=>F8.test(u)))==null?void 0:s.replace(TC,"")),c=0;return t[0].replace(TC,()=>`${n[c++](i)}${a||""}`).replace(Fye,jye)}},Y8="react-spring: ",q8=e=>{let t=e,o=!1;if(typeof t!="function")throw new TypeError(`${Y8}once requires a function parameter`);return(...r)=>{o||(t(...r),o=!0)}},Uye=q8(console.warn);function Z8(){Uye(`${Y8}The "interpolate" function is deprecated in v9 (use "to" instead)`)}var Wze=q8(console.warn);function kh(e){return ae.str(e)&&(e[0]=="#"||/\d/.test(e)||!XM()&&AC.test(e)||e in(Eu||{}))}var oy=XM()?Ai.useEffect:Ai.useLayoutEffect,Hye=()=>{let e=(0,Ai.useRef)(!1);return oy(()=>(e.current=!0,()=>{e.current=!1}),[]),e};function tD(){let e=(0,Ai.useState)()[1],t=Hye();return()=>{t.current&&e(Math.random())}}function X8(e,t){let[o]=(0,Ai.useState)(()=>({inputs:t,result:e()})),r=(0,Ai.useRef)(),n=r.current,i=n;return i?t&&i.inputs&&Gye(t,i.inputs)||(i={inputs:t,result:e()}):i=o,(0,Ai.useEffect)(()=>{r.current=i,n==o&&(o.inputs=o.result=void 0)},[i]),i.result}function Gye(e,t){if(e.length!==t.length)return!1;for(let o=0;o<e.length;o++)if(e[o]!==t[o])return!1;return!0}var oD=e=>(0,Ai.useEffect)(e,Wye),Wye=[];var fy=l(jr()),my=l(jr());var t7=l(jr()),Rl=l(jr()),ry=Symbol.for("Animated:node"),$ye=e=>!!e&&e[ry]===e,Es=e=>e&&e[ry],VC=(e,t)=>z8(e,ry,t),ny=e=>e&&e[ry]&&e[ry].getPayload(),NC=class{constructor(){this.payload=void 0,VC(this,this)}getPayload(){return this.payload||[]}},Zf=class e extends NC{constructor(t){super(),this.done=!0,this.elapsedTime=void 0,this.lastPosition=void 0,this.lastVelocity=void 0,this.v0=void 0,this.durationProgress=0,this._value=t,ae.num(this._value)&&(this.lastPosition=this._value)}static create(t){return new e(t)}getPayload(){return[this]}getValue(){return this._value}setValue(t,o){return ae.num(t)&&(this.lastPosition=t,o&&(t=Math.round(t/o)*o,this.done&&(this.lastPosition=t))),this._value===t?!1:(this._value=t,!0)}reset(){let{done:t}=this;this.done=!1,ae.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,t&&(this.lastVelocity=null),this.v0=null)}},Xf=class e extends Zf{constructor(t){super(0),this._string=null,this._toString=void 0,this._toString=Tu({output:[t,t]})}static create(t){return new e(t)}getValue(){let t=this._string;return t??(this._string=this._toString(this._value))}setValue(t){if(ae.str(t)){if(t==this._string)return!1;this._string=t,this._value=1}else if(super.setValue(t))this._string=null;else return!1;return!0}reset(t){t&&(this._toString=Tu({output:[this.getValue(),t]})),this._value=0,super.reset()}},MC={dependencies:null},Qf=class extends NC{constructor(t){super(),this.source=t,this.setValue(t)}getValue(t){let o={};return Li(this.source,(r,n)=>{$ye(r)?o[n]=r.getValue(t):Ur(r)?o[n]=pr(r):t||(o[n]=r)}),o}setValue(t){this.source=t,this.payload=this._makePayload(t)}reset(){this.payload&&bt(this.payload,t=>t.reset())}_makePayload(t){if(t){let o=new Set;return Li(t,this._addToPayload,o),Array.from(o)}}_addToPayload(t){MC.dependencies&&Ur(t)&&MC.dependencies.add(t);let o=ny(t);o&&bt(o,r=>this.add(r))}},rD=class e extends Qf{constructor(t){super(t)}static create(t){return new e(t)}getValue(){return this.source.map(t=>t.getValue())}setValue(t){let o=this.getPayload();return t.length==o.length?o.map((r,n)=>r.setValue(t[n])).some(Boolean):(super.setValue(t.map(Kye)),!0)}};function Kye(e){return(kh(e)?Xf:Zf).create(e)}function FC(e){let t=Es(e);return t?t.constructor:ae.arr(e)?rD:kh(e)?Xf:Zf}function DC(){return DC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},DC.apply(this,arguments)}var Q8=(e,t)=>{let o=!ae.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,Rl.forwardRef)((r,n)=>{let i=(0,Rl.useRef)(null),s=o&&(0,Rl.useCallback)(p=>{i.current=qye(n,p)},[n]),[a,c]=Yye(r,t),u=tD(),d=()=>{let p=i.current;if(o&&!p)return;(p?t.applyAnimatedValues(p,a.getValue(!0)):!1)===!1&&u()},f=new nD(d,c),m=(0,Rl.useRef)();oy(()=>(m.current=f,bt(c,p=>Iu(p,f)),()=>{m.current&&(bt(m.current.deps,p=>Pu(p,m.current)),Se.cancel(m.current.update))})),(0,Rl.useEffect)(d,[]),oD(()=>()=>{let p=m.current;bt(p.deps,g=>Pu(g,p))});let h=t.getComponentProps(a.getValue());return t7.createElement(e,DC({},h,{ref:s}))})},nD=class{constructor(t,o){this.update=t,this.deps=o}eventObserved(t){t.type=="change"&&Se.write(this.update)}};function Yye(e,t){let o=new Set;return MC.dependencies=o,e.style&&(e=DC({},e,{style:t.createAnimatedStyle(e.style)})),e=new Qf(e),MC.dependencies=null,[e,o]}function qye(e,t){return e&&(ae.fun(e)?e(t):e.current=t),t}var J8=Symbol.for("AnimatedComponent"),o7=(e,{applyAnimatedValues:t=()=>!1,createAnimatedStyle:o=n=>new Qf(n),getComponentProps:r=n=>n}={})=>{let n={applyAnimatedValues:t,createAnimatedStyle:o,getComponentProps:r},i=s=>{let a=e7(s)||"Anonymous";return ae.str(s)?s=i[s]||(i[s]=Q8(s,n)):s=s[J8]||(s[J8]=Q8(s,n)),s.displayName=`Animated(${a})`,s};return Li(e,(s,a)=>{ae.arr(e)&&(a=e7(s)),i[a]=i(s)}),{animated:i}},e7=e=>ae.str(e)?e:e&&ae.str(e.displayName)?e.displayName:ae.fun(e)&&e.name||null;function Hr(){return Hr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},Hr.apply(this,arguments)}function Jf(e,...t){return ae.fun(e)?e(...t):e}var ly=(e,t)=>e===!0||!!(t&&e&&(ae.fun(e)?e(t):hn(e).includes(t))),p7=(e,t)=>ae.obj(e)?t&&e[t]:e,h7=(e,t)=>e.default===!0?e[t]:e.default?e.default[t]:void 0,Zye=e=>e,g7=(e,t=Zye)=>{let o=Xye;e.default&&e.default!==!0&&(e=e.default,o=Object.keys(e));let r={};for(let n of o){let i=t(e[n],n);ae.und(i)||(r[n]=i)}return r},Xye=["config","onProps","onStart","onChange","onPause","onResume","onRest"],Qye={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function Jye(e){let t={},o=0;if(Li(e,(r,n)=>{Qye[n]||(t[n]=r,o++)}),o)return t}function b7(e){let t=Jye(e);if(t){let o={to:t};return Li(e,(r,n)=>n in t||(o[n]=r)),o}return Hr({},e)}function cy(e){return e=pr(e),ae.arr(e)?e.map(cy):kh(e)?$n.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function aD(e){return ae.fun(e)||ae.arr(e)&&ae.obj(e[0])}var eSe={default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}},UC=1.70158,zC=UC*1.525,r7=UC+1,n7=2*Math.PI/3,i7=2*Math.PI/4.5,jC=e=>e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375,tSe={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>1-(1-e)*(1-e),easeInOutQuad:e=>e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2,easeInCubic:e=>e*e*e,easeOutCubic:e=>1-Math.pow(1-e,3),easeInOutCubic:e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2,easeInQuart:e=>e*e*e*e,easeOutQuart:e=>1-Math.pow(1-e,4),easeInOutQuart:e=>e<.5?8*e*e*e*e:1-Math.pow(-2*e+2,4)/2,easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>1-Math.pow(1-e,5),easeInOutQuint:e=>e<.5?16*e*e*e*e*e:1-Math.pow(-2*e+2,5)/2,easeInSine:e=>1-Math.cos(e*Math.PI/2),easeOutSine:e=>Math.sin(e*Math.PI/2),easeInOutSine:e=>-(Math.cos(Math.PI*e)-1)/2,easeInExpo:e=>e===0?0:Math.pow(2,10*e-10),easeOutExpo:e=>e===1?1:1-Math.pow(2,-10*e),easeInOutExpo:e=>e===0?0:e===1?1:e<.5?Math.pow(2,20*e-10)/2:(2-Math.pow(2,-20*e+10))/2,easeInCirc:e=>1-Math.sqrt(1-Math.pow(e,2)),easeOutCirc:e=>Math.sqrt(1-Math.pow(e-1,2)),easeInOutCirc:e=>e<.5?(1-Math.sqrt(1-Math.pow(2*e,2)))/2:(Math.sqrt(1-Math.pow(-2*e+2,2))+1)/2,easeInBack:e=>r7*e*e*e-UC*e*e,easeOutBack:e=>1+r7*Math.pow(e-1,3)+UC*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*((zC+1)*2*e-zC)/2:(Math.pow(2*e-2,2)*((zC+1)*(e*2-2)+zC)+2)/2,easeInElastic:e=>e===0?0:e===1?1:-Math.pow(2,10*e-10)*Math.sin((e*10-10.75)*n7),easeOutElastic:e=>e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e*10-.75)*n7)+1,easeInOutElastic:e=>e===0?0:e===1?1:e<.5?-(Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*i7))/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*i7)/2+1,easeInBounce:e=>1-jC(1-e),easeOutBounce:jC,easeInOutBounce:e=>e<.5?(1-jC(1-2*e))/2:(1+jC(2*e-1))/2},lD=Hr({},eSe.default,{mass:1,damping:1,easing:tSe.linear,clamp:!1}),cD=class{constructor(){this.tension=void 0,this.friction=void 0,this.frequency=void 0,this.damping=void 0,this.mass=void 0,this.velocity=0,this.restVelocity=void 0,this.precision=void 0,this.progress=void 0,this.duration=void 0,this.easing=void 0,this.clamp=void 0,this.bounce=void 0,this.decay=void 0,this.round=void 0,Object.assign(this,lD)}};function oSe(e,t,o){o&&(o=Hr({},o),s7(o,t),t=Hr({},o,t)),s7(e,t),Object.assign(e,t);for(let s in lD)e[s]==null&&(e[s]=lD[s]);let{mass:r,frequency:n,damping:i}=e;return ae.und(n)||(n<.01&&(n=.01),i<0&&(i=0),e.tension=Math.pow(2*Math.PI/n,2)*r,e.friction=4*Math.PI*i*r/n),e}function s7(e,t){if(!ae.und(t.decay))e.duration=void 0;else{let o=!ae.und(t.tension)||!ae.und(t.friction);(o||!ae.und(t.frequency)||!ae.und(t.damping)||!ae.und(t.mass))&&(e.duration=void 0,e.decay=void 0),o&&(e.frequency=void 0)}}var a7=[],uD=class{constructor(){this.changed=!1,this.values=a7,this.toValues=null,this.fromValues=a7,this.to=void 0,this.from=void 0,this.config=new cD,this.immediate=!1}};function k7(e,{key:t,props:o,defaultProps:r,state:n,actions:i}){return new Promise((s,a)=>{var c;let u,d,f=ly((c=o.cancel)!=null?c:r?.cancel,t);if(f)p();else{ae.und(o.pause)||(n.paused=ly(o.pause,t));let g=r?.pause;g!==!0&&(g=n.paused||ly(g,t)),u=Jf(o.delay||0,t),g?(n.resumeQueue.add(h),i.pause()):(i.resume(),h())}function m(){n.resumeQueue.add(h),n.timeouts.delete(d),d.cancel(),u=d.time-Se.now()}function h(){u>0&&!$n.skipAnimation?(n.delayed=!0,d=Se.setTimeout(p,u),n.pauseQueue.add(m),n.timeouts.add(d)):p()}function p(){n.delayed&&(n.delayed=!1),n.pauseQueue.delete(m),n.timeouts.delete(d),e<=(n.cancelId||0)&&(f=!0);try{i.start(Hr({},o,{callId:e,cancel:f}),s)}catch(g){a(g)}}})}var bD=(e,t)=>t.length==1?t[0]:t.some(o=>o.cancelled)?vh(e.get()):t.every(o=>o.noop)?v7(e.get()):Ts(e.get(),t.every(o=>o.finished)),v7=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),Ts=(e,t,o=!1)=>({value:e,finished:t,cancelled:o}),vh=e=>({value:e,cancelled:!0,finished:!1});function y7(e,t,o,r){let{callId:n,parentId:i,onRest:s}=t,{asyncTo:a,promise:c}=o;return!i&&e===a&&!t.reset?c:o.promise=(async()=>{o.asyncId=n,o.asyncTo=e;let u=g7(t,(b,v)=>v==="onRest"?void 0:b),d,f,m=new Promise((b,v)=>(d=b,f=v)),h=b=>{let v=n<=(o.cancelId||0)&&vh(r)||n!==o.asyncId&&Ts(r,!1);if(v)throw b.result=v,f(b),b},p=(b,v)=>{let k=new HC,y=new GC;return(async()=>{if($n.skipAnimation)throw uy(o),y.result=Ts(r,!1),f(y),y;h(k);let S=ae.obj(b)?Hr({},b):Hr({},v,{to:b});S.parentId=n,Li(u,(C,B)=>{ae.und(S[B])&&(S[B]=C)});let x=await r.start(S);return h(k),o.paused&&await new Promise(C=>{o.resumeQueue.add(C)}),x})()},g;if($n.skipAnimation)return uy(o),Ts(r,!1);try{let b;ae.arr(e)?b=(async v=>{for(let k of v)await p(k)})(e):b=Promise.resolve(e(p,r.stop.bind(r))),await Promise.all([b.then(d),m]),g=Ts(r.get(),!0,!1)}catch(b){if(b instanceof HC)g=b.result;else if(b instanceof GC)g=b.result;else throw b}finally{n==o.asyncId&&(o.asyncId=i,o.asyncTo=i?a:void 0,o.promise=i?c:void 0)}return ae.fun(s)&&Se.batchedUpdates(()=>{s(g,r,r.item)}),g})()}function uy(e,t){hh(e.timeouts,o=>o.cancel()),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}var HC=class extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise."),this.result=void 0}},GC=class extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}},dD=e=>e instanceof dy,rSe=1,dy=class extends ph{constructor(...t){super(...t),this.id=rSe++,this.key=void 0,this._priority=0}get priority(){return this._priority}set priority(t){this._priority!=t&&(this._priority=t,this._onPriorityChange(t))}get(){let t=Es(this);return t&&t.getValue()}to(...t){return $n.to(this,t)}interpolate(...t){return Z8(),$n.to(this,t)}toJSON(){return this.get()}observerAdded(t){t==1&&this._attach()}observerRemoved(t){t==0&&this._detach()}_attach(){}_detach(){}_onChange(t,o=!1){qf(this,{type:"change",parent:this,value:t,idle:o})}_onPriorityChange(t){this.idle||bh.sort(this),qf(this,{type:"priority",parent:this,priority:t})}},em=Symbol.for("SpringPhase"),S7=1,fD=2,mD=4,iD=e=>(e[em]&S7)>0,Ru=e=>(e[em]&fD)>0,iy=e=>(e[em]&mD)>0,l7=(e,t)=>t?e[em]|=fD|S7:e[em]&=~fD,c7=(e,t)=>t?e[em]|=mD:e[em]&=~mD,pD=class extends dy{constructor(t,o){if(super(),this.key=void 0,this.animation=new uD,this.queue=void 0,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!ae.und(t)||!ae.und(o)){let r=ae.obj(t)?Hr({},t):Hr({},o,{from:t});ae.und(r.default)&&(r.default=!0),this.start(r)}}get idle(){return!(Ru(this)||this._state.asyncTo)||iy(this)}get goal(){return pr(this.animation.to)}get velocity(){let t=Es(this);return t instanceof Zf?t.lastVelocity||0:t.getPayload().map(o=>o.lastVelocity||0)}get hasAnimated(){return iD(this)}get isAnimating(){return Ru(this)}get isPaused(){return iy(this)}get isDelayed(){return this._state.delayed}advance(t){let o=!0,r=!1,n=this.animation,{config:i,toValues:s}=n,a=ny(n.to);!a&&Ur(n.to)&&(s=hn(pr(n.to))),n.values.forEach((d,f)=>{if(d.done)return;let m=d.constructor==Xf?1:a?a[f].lastPosition:s[f],h=n.immediate,p=m;if(!h){if(p=d.lastPosition,i.tension<=0){d.done=!0;return}let g=d.elapsedTime+=t,b=n.fromValues[f],v=d.v0!=null?d.v0:d.v0=ae.arr(i.velocity)?i.velocity[f]:i.velocity,k,y=i.precision||(b==m?.005:Math.min(1,Math.abs(m-b)*.001));if(ae.und(i.duration))if(i.decay){let S=i.decay===!0?.998:i.decay,x=Math.exp(-(1-S)*g);p=b+v/(1-S)*(1-x),h=Math.abs(d.lastPosition-p)<=y,k=v*x}else{k=d.lastVelocity==null?v:d.lastVelocity;let S=i.restVelocity||y/10,x=i.clamp?0:i.bounce,C=!ae.und(x),B=b==m?d.v0>0:b<m,I,P=!1,E=1,L=Math.ceil(t/E);for(let T=0;T<L&&(I=Math.abs(k)>S,!(!I&&(h=Math.abs(m-p)<=y,h)));++T){C&&(P=p==m||p>m==B,P&&(k=-k*x,p=m));let O=-i.tension*1e-6*(p-m),D=-i.friction*.001*k,U=(O+D)/i.mass;k=k+U*E,p=p+k*E}}else{let S=1;i.duration>0&&(this._memoizedDuration!==i.duration&&(this._memoizedDuration=i.duration,d.durationProgress>0&&(d.elapsedTime=i.duration*d.durationProgress,g=d.elapsedTime+=t)),S=(i.progress||0)+g/this._memoizedDuration,S=S>1?1:S<0?0:S,d.durationProgress=S),p=b+i.easing(S)*(m-b),k=(p-d.lastPosition)/t,h=S==1}d.lastVelocity=k,Number.isNaN(p)&&(console.warn("Got NaN while animating:",this),h=!0)}a&&!a[f].done&&(h=!1),h?d.done=!0:o=!1,d.setValue(p,i.round)&&(r=!0)});let c=Es(this),u=c.getValue();if(o){let d=pr(n.to);(u!==d||r)&&!i.decay?(c.setValue(d),this._onChange(d)):r&&i.decay&&this._onChange(u),this._stop()}else r&&this._onChange(u)}set(t){return Se.batchedUpdates(()=>{this._stop(),this._focus(t),this._set(t)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(Ru(this)){let{to:t,config:o}=this.animation;Se.batchedUpdates(()=>{this._onStart(),o.decay||this._set(t,!1),this._stop()})}return this}update(t){return(this.queue||(this.queue=[])).push(t),this}start(t,o){let r;return ae.und(t)?(r=this.queue||[],this.queue=[]):r=[ae.obj(t)?t:Hr({},o,{to:t})],Promise.all(r.map(n=>this._update(n))).then(n=>bD(this,n))}stop(t){let{to:o}=this.animation;return this._focus(this.get()),uy(this._state,t&&this._lastCallId),Se.batchedUpdates(()=>this._stop(o,t)),this}reset(){this._update({reset:!0})}eventObserved(t){t.type=="change"?this._start():t.type=="priority"&&(this.priority=t.priority+1)}_prepareNode(t){let o=this.key||"",{to:r,from:n}=t;r=ae.obj(r)?r[o]:r,(r==null||aD(r))&&(r=void 0),n=ae.obj(n)?n[o]:n,n==null&&(n=void 0);let i={to:r,from:n};return iD(this)||(t.reverse&&([r,n]=[n,r]),n=pr(n),ae.und(n)?Es(this)||this._set(r):this._set(n)),i}_update(t,o){let r=Hr({},t),{key:n,defaultProps:i}=this;r.default&&Object.assign(i,g7(r,(c,u)=>/^on/.test(u)?p7(c,n):c)),d7(this,r,"onProps"),ay(this,"onProps",r,this);let s=this._prepareNode(r);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");let a=this._state;return k7(++this._lastCallId,{key:n,props:r,defaultProps:i,state:a,actions:{pause:()=>{iy(this)||(c7(this,!0),gh(a.pauseQueue),ay(this,"onPause",Ts(this,sy(this,this.animation.to)),this))},resume:()=>{iy(this)&&(c7(this,!1),Ru(this)&&this._resume(),gh(a.resumeQueue),ay(this,"onResume",Ts(this,sy(this,this.animation.to)),this))},start:this._merge.bind(this,s)}}).then(c=>{if(r.loop&&c.finished&&!(o&&c.noop)){let u=_7(r);if(u)return this._update(u,!0)}return c})}_merge(t,o,r){if(o.cancel)return this.stop(!0),r(vh(this));let n=!ae.und(t.to),i=!ae.und(t.from);if(n||i)if(o.callId>this._lastToId)this._lastToId=o.callId;else return r(vh(this));let{key:s,defaultProps:a,animation:c}=this,{to:u,from:d}=c,{to:f=u,from:m=d}=t;i&&!n&&(!o.default||ae.und(f))&&(f=m),o.reverse&&([f,m]=[m,f]);let h=!ka(m,d);h&&(c.from=m),m=pr(m);let p=!ka(f,u);p&&this._focus(f);let g=aD(o.to),{config:b}=c,{decay:v,velocity:k}=b;(n||i)&&(b.velocity=0),o.config&&!g&&oSe(b,Jf(o.config,s),o.config!==a.config?Jf(a.config,s):void 0);let y=Es(this);if(!y||ae.und(f))return r(Ts(this,!0));let S=ae.und(o.reset)?i&&!o.default:!ae.und(m)&&ly(o.reset,s),x=S?m:this.get(),C=cy(f),B=ae.num(C)||ae.arr(C)||kh(C),I=!g&&(!B||ly(a.immediate||o.immediate,s));if(p){let T=FC(f);if(T!==y.constructor)if(I)y=this._set(C);else throw Error(`Cannot animate between ${y.constructor.name} and ${T.name}, as the "to" prop suggests`)}let P=y.constructor,E=Ur(f),L=!1;if(!E){let T=S||!iD(this)&&h;(p||T)&&(L=ka(cy(x),C),E=!L),(!ka(c.immediate,I)&&!I||!ka(b.decay,v)||!ka(b.velocity,k))&&(E=!0)}if(L&&Ru(this)&&(c.changed&&!S?E=!0:E||this._stop(u)),!g&&((E||Ur(u))&&(c.values=y.getPayload(),c.toValues=Ur(f)?null:P==Xf?[1]:hn(C)),c.immediate!=I&&(c.immediate=I,!I&&!S&&this._set(u)),E)){let{onRest:T}=c;bt(nSe,D=>d7(this,o,D));let O=Ts(this,sy(this,u));gh(this._pendingCalls,O),this._pendingCalls.add(r),c.changed&&Se.batchedUpdates(()=>{c.changed=!S,T?.(O,this),S?Jf(a.onRest,O):c.onStart==null||c.onStart(O,this)})}S&&this._set(x),g?r(y7(o.to,o,this._state,this)):E?this._start():Ru(this)&&!p?this._pendingCalls.add(r):r(v7(x))}_focus(t){let o=this.animation;t!==o.to&&(eD(this)&&this._detach(),o.to=t,eD(this)&&this._attach())}_attach(){let t=0,{to:o}=this.animation;Ur(o)&&(Iu(o,this),dD(o)&&(t=o.priority+1)),this.priority=t}_detach(){let{to:t}=this.animation;Ur(t)&&Pu(t,this)}_set(t,o=!0){let r=pr(t);if(!ae.und(r)){let n=Es(this);if(!n||!ka(r,n.getValue())){let i=FC(r);!n||n.constructor!=i?VC(this,i.create(r)):n.setValue(r),n&&Se.batchedUpdates(()=>{this._onChange(r,o)})}}return Es(this)}_onStart(){let t=this.animation;t.changed||(t.changed=!0,ay(this,"onStart",Ts(this,sy(this,t.to)),this))}_onChange(t,o){o||(this._onStart(),Jf(this.animation.onChange,t,this)),Jf(this.defaultProps.onChange,t,this),super._onChange(t,o)}_start(){let t=this.animation;Es(this).reset(pr(t.to)),t.immediate||(t.fromValues=t.values.map(o=>o.lastPosition)),Ru(this)||(l7(this,!0),iy(this)||this._resume())}_resume(){$n.skipAnimation?this.finish():bh.start(this)}_stop(t,o){if(Ru(this)){l7(this,!1);let r=this.animation;bt(r.values,i=>{i.done=!0}),r.toValues&&(r.onChange=r.onPause=r.onResume=void 0),qf(this,{type:"idle",parent:this});let n=o?vh(this.get()):Ts(this.get(),sy(this,t??r.to));gh(this._pendingCalls,n),r.changed&&(r.changed=!1,ay(this,"onRest",n,this))}}};function sy(e,t){let o=cy(t),r=cy(e.get());return ka(r,o)}function _7(e,t=e.loop,o=e.to){let r=Jf(t);if(r){let n=r!==!0&&b7(r),i=(n||e).reverse,s=!n||n.reset;return hD(Hr({},e,{loop:t,default:!1,pause:void 0,to:!i||aD(o)?o:void 0,from:s?e.from:void 0,reset:s},n))}}function hD(e){let{to:t,from:o}=e=b7(e),r=new Set;return ae.obj(t)&&u7(t,r),ae.obj(o)&&u7(o,r),e.keys=r.size?Array.from(r):null,e}function u7(e,t){Li(e,(o,r)=>o!=null&&t.add(r))}var nSe=["onStart","onRest","onChange","onPause","onResume"];function d7(e,t,o){e.animation[o]=t[o]!==h7(t,o)?p7(t[o],e.key):void 0}function ay(e,t,...o){var r,n,i,s;(r=(n=e.animation)[t])==null||r.call(n,...o),(i=(s=e.defaultProps)[t])==null||i.call(s,...o)}var iSe=["onStart","onChange","onRest"],sSe=1,WC=class{constructor(t,o){this.id=sSe++,this.springs={},this.queue=[],this.ref=void 0,this._flush=void 0,this._initialProps=void 0,this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._item=void 0,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),o&&(this._flush=o),t&&this.start(Hr({default:!0},t))}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(t=>t.idle&&!t.isDelayed&&!t.isPaused)}get item(){return this._item}set item(t){this._item=t}get(){let t={};return this.each((o,r)=>t[r]=o.get()),t}set(t){for(let o in t){let r=t[o];ae.und(r)||this.springs[o].set(r)}}update(t){return t&&this.queue.push(hD(t)),this}start(t){let{queue:o}=this;return t?o=hn(t).map(hD):this.queue=[],this._flush?this._flush(this,o):(w7(this,o),aSe(this,o))}stop(t,o){if(t!==!!t&&(o=t),o){let r=this.springs;bt(hn(o),n=>r[n].stop(!!t))}else uy(this._state,this._lastAsyncId),this.each(r=>r.stop(!!t));return this}pause(t){if(ae.und(t))this.start({pause:!0});else{let o=this.springs;bt(hn(t),r=>o[r].pause())}return this}resume(t){if(ae.und(t))this.start({pause:!1});else{let o=this.springs;bt(hn(t),r=>o[r].resume())}return this}each(t){Li(this.springs,t)}_onFrame(){let{onStart:t,onChange:o,onRest:r}=this._events,n=this._active.size>0,i=this._changed.size>0;(n&&!this._started||i&&!this._started)&&(this._started=!0,hh(t,([c,u])=>{u.value=this.get(),c(u,this,this._item)}));let s=!n&&this._started,a=i||s&&r.size?this.get():null;i&&o.size&&hh(o,([c,u])=>{u.value=a,c(u,this,this._item)}),s&&(this._started=!1,hh(r,([c,u])=>{u.value=a,c(u,this,this._item)}))}eventObserved(t){if(t.type=="change")this._changed.add(t.parent),t.idle||this._active.add(t.parent);else if(t.type=="idle")this._active.delete(t.parent);else return;Se.onFrame(this._onFrame)}};function aSe(e,t){return Promise.all(t.map(o=>x7(e,o))).then(o=>bD(e,o))}async function x7(e,t,o){let{keys:r,to:n,from:i,loop:s,onRest:a,onResolve:c}=t,u=ae.obj(t.default)&&t.default;s&&(t.loop=!1),n===!1&&(t.to=null),i===!1&&(t.from=null);let d=ae.arr(n)||ae.fun(n)?n:void 0;d?(t.to=void 0,t.onRest=void 0,u&&(u.onRest=void 0)):bt(iSe,g=>{let b=t[g];if(ae.fun(b)){let v=e._events[g];t[g]=({finished:k,cancelled:y})=>{let S=v.get(b);S?(k||(S.finished=!1),y&&(S.cancelled=!0)):v.set(b,{value:null,finished:k||!1,cancelled:y||!1})},u&&(u[g]=t[g])}});let f=e._state;t.pause===!f.paused?(f.paused=t.pause,gh(t.pause?f.pauseQueue:f.resumeQueue)):f.paused&&(t.pause=!0);let m=(r||Object.keys(e.springs)).map(g=>e.springs[g].start(t)),h=t.cancel===!0||h7(t,"cancel")===!0;(d||h&&f.asyncId)&&m.push(k7(++e._lastAsyncId,{props:t,state:f,actions:{pause:RC,resume:RC,start(g,b){h?(uy(f,e._lastAsyncId),b(vh(e))):(g.onRest=a,b(y7(d,g,f,e)))}}})),f.paused&&await new Promise(g=>{f.resumeQueue.add(g)});let p=bD(e,await Promise.all(m));if(s&&p.finished&&!(o&&p.noop)){let g=_7(t,s,n);if(g)return w7(e,[g]),x7(e,g,!0)}return c&&Se.batchedUpdates(()=>c(p,e,e.item)),p}function lSe(e,t){let o=new pD;return o.key=e,t&&Iu(o,t),o}function cSe(e,t,o){t.keys&&bt(t.keys,r=>{(e[r]||(e[r]=o(r)))._prepareNode(t)})}function w7(e,t){bt(t,o=>{cSe(e.springs,o,r=>lSe(r,e))})}function uSe(e,t){if(e==null)return{};var o={},r=Object.keys(e),n,i;for(i=0;i<r.length;i++)n=r[i],!(t.indexOf(n)>=0)&&(o[n]=e[n]);return o}var dSe=["children"],kD=e=>{let{children:t}=e,o=uSe(e,dSe),r=(0,my.useContext)($C),n=o.pause||!!r.pause,i=o.immediate||!!r.immediate;o=X8(()=>({pause:n,immediate:i}),[n,i]);let{Provider:s}=$C;return fy.createElement(s,{value:o},t)},$C=fSe(kD,{});kD.Provider=$C.Provider;kD.Consumer=$C.Consumer;function fSe(e,t){return Object.assign(e,fy.createContext(t)),e.Provider._context=e,e.Consumer._context=e,e}var f7;(function(e){e.MOUNT="mount",e.ENTER="enter",e.UPDATE="update",e.LEAVE="leave"})(f7||(f7={}));var gD=class extends dy{constructor(t,o){super(),this.key=void 0,this.idle=!0,this.calc=void 0,this._active=new Set,this.source=t,this.calc=Tu(...o);let r=this._get(),n=FC(r);VC(this,n.create(r))}advance(t){let o=this._get(),r=this.get();ka(o,r)||(Es(this).setValue(o),this._onChange(o,this.idle)),!this.idle&&m7(this._active)&&sD(this)}_get(){let t=ae.arr(this.source)?this.source.map(pr):hn(pr(this.source));return this.calc(...t)}_start(){this.idle&&!m7(this._active)&&(this.idle=!1,bt(ny(this),t=>{t.done=!1}),$n.skipAnimation?(Se.batchedUpdates(()=>this.advance()),sD(this)):bh.start(this))}_attach(){let t=1;bt(hn(this.source),o=>{Ur(o)&&Iu(o,this),dD(o)&&(o.idle||this._active.add(o),t=Math.max(t,o.priority+1))}),this.priority=t,this._start()}_detach(){bt(hn(this.source),t=>{Ur(t)&&Pu(t,this)}),this._active.clear(),sD(this)}eventObserved(t){t.type=="change"?t.idle?this.advance():(this._active.add(t.parent),this._start()):t.type=="idle"?this._active.delete(t.parent):t.type=="priority"&&(this.priority=hn(this.source).reduce((o,r)=>Math.max(o,(dD(r)?r.priority:0)+1),0))}};function mSe(e){return e.idle!==!1}function m7(e){return!e.size||Array.from(e).every(mSe)}function sD(e){e.idle||(e.idle=!0,bt(ny(e),t=>{t.done=!0}),qf(e,{type:"idle",parent:e}))}$n.assign({createStringInterpolator:LC,to:(e,t)=>new gD(e,t)});var t6e=bh.advance;var T7=l(B7());function _D(e,t){if(e==null)return{};var o={},r=Object.keys(e),n,i;for(i=0;i<r.length;i++)n=r[i],!(t.indexOf(n)>=0)&&(o[n]=e[n]);return o}var pSe=["style","children","scrollTop","scrollLeft"],I7=/^--/;function hSe(e,t){return t==null||typeof t=="boolean"||t===""?"":typeof t=="number"&&t!==0&&!I7.test(e)&&!(py.hasOwnProperty(e)&&py[e])?t+"px":(""+t).trim()}var E7={};function gSe(e,t){if(!e.nodeType||!e.setAttribute)return!1;let o=e.nodeName==="filter"||e.parentNode&&e.parentNode.nodeName==="filter",r=t,{style:n,children:i,scrollTop:s,scrollLeft:a}=r,c=_D(r,pSe),u=Object.values(c),d=Object.keys(c).map(f=>o||e.hasAttribute(f)?f:E7[f]||(E7[f]=f.replace(/([A-Z])/g,m=>"-"+m.toLowerCase())));i!==void 0&&(e.textContent=i);for(let f in n)if(n.hasOwnProperty(f)){let m=hSe(f,n[f]);I7.test(f)?e.style.setProperty(f,m):e.style[f]=m}d.forEach((f,m)=>{e.setAttribute(f,u[m])}),s!==void 0&&(e.scrollTop=s),a!==void 0&&(e.scrollLeft=a)}var py={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},bSe=(e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1),kSe=["Webkit","Ms","Moz","O"];py=Object.keys(py).reduce((e,t)=>(kSe.forEach(o=>e[bSe(o,t)]=e[t]),e),py);var vSe=["x","y","z"],ySe=/^(matrix|translate|scale|rotate|skew)/,SSe=/^(translate)/,_Se=/^(rotate|skew)/,vD=(e,t)=>ae.num(e)&&e!==0?e+t:e,KC=(e,t)=>ae.arr(e)?e.every(o=>KC(o,t)):ae.num(e)?e===t:parseFloat(e)===t,yD=class extends Qf{constructor(t){let{x:o,y:r,z:n}=t,i=_D(t,vSe),s=[],a=[];(o||r||n)&&(s.push([o||0,r||0,n||0]),a.push(c=>[`translate3d(${c.map(u=>vD(u,"px")).join(",")})`,KC(c,0)])),Li(i,(c,u)=>{if(u==="transform")s.push([c||""]),a.push(d=>[d,d===""]);else if(ySe.test(u)){if(delete i[u],ae.und(c))return;let d=SSe.test(u)?"px":_Se.test(u)?"deg":"";s.push(hn(c)),a.push(u==="rotate3d"?([f,m,h,p])=>[`rotate3d(${f},${m},${h},${vD(p,d)})`,KC(p,0)]:f=>[`${u}(${f.map(m=>vD(m,d)).join(",")})`,KC(f,u.startsWith("scale")?1:0)])}}),s.length&&(i.transform=new SD(s,a)),super(i)}},SD=class extends ph{constructor(t,o){super(),this._value=null,this.inputs=t,this.transforms=o}get(){return this._value||(this._value=this._get())}_get(){let t="",o=!0;return bt(this.inputs,(r,n)=>{let i=pr(r[0]),[s,a]=this.transforms[n](ae.arr(i)?i:r.map(pr));t+=" "+s,o=o&&a}),o?"none":t}observerAdded(t){t==1&&bt(this.inputs,o=>bt(o,r=>Ur(r)&&Iu(r,this)))}observerRemoved(t){t==0&&bt(this.inputs,o=>bt(o,r=>Ur(r)&&Pu(r,this)))}eventObserved(t){t.type=="change"&&(this._value=null),qf(this,t)}},xSe=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],wSe=["scrollTop","scrollLeft"];$n.assign({batchedUpdates:T7.unstable_batchedUpdates,createStringInterpolator:LC,colors:W8});var CSe=o7(xSe,{applyAnimatedValues:gSe,createAnimatedStyle:e=>new yD(e),getComponentProps:e=>_D(e,wSe)}),P7=CSe.animated;var yh=l(R(),1),O7=l(Fe(),1),A7=l(F(),1);var BSe=200;function R7(e){return{top:e.offsetTop,left:e.offsetLeft}}function ESe({triggerAnimationOnChange:e,clientId:t}){let o=(0,yh.useRef)(),{isTyping:r,getGlobalBlockCount:n,isBlockSelected:i,isFirstMultiSelectedBlock:s,isBlockMultiSelected:a,isAncestorMultiSelected:c,isDraggingBlocks:u}=(0,A7.useSelect)(_),{previous:d,prevRect:f}=(0,yh.useMemo)(()=>({previous:o.current&&R7(o.current),prevRect:o.current&&o.current.getBoundingClientRect()}),[e]);return(0,yh.useLayoutEffect)(()=>{if(!d||!o.current)return;let m=(0,O7.getScrollContainer)(o.current),h=i(t),p=h||s(t),g=u();function b(){if(!g&&p&&f){let P=o.current.getBoundingClientRect().top-f.top;P&&(m.scrollTop+=P)}}if(window.matchMedia("(prefers-reduced-motion: reduce)").matches||r()||n()>BSe){b();return}let k=h||a(t)||c(t);if(k&&g)return;let y=k?"1":"",S=new WC({x:0,y:0,config:{mass:5,tension:2e3,friction:200},onChange({value:I}){if(!o.current)return;let{x:P,y:E}=I;P=Math.round(P),E=Math.round(E);let L=P===0&&E===0;o.current.style.transformOrigin="center center",o.current.style.transform=L?null:`translate3d(${P}px,${E}px,0)`,o.current.style.zIndex=y,b()}});o.current.style.transform=void 0;let x=R7(o.current),C=Math.round(d.left-x.left),B=Math.round(d.top-x.top);return S.start({x:0,y:0,from:{x:C,y:B}}),()=>{S.stop(),S.set({x:0,y:0})}},[d,f,t,r,n,i,s,a,c,u]),o}var YC=ESe;var ZC=l(R(),1),Ol=l(Fe(),1),N7=l(F(),1);var qC=".block-editor-block-list__block",TSe=".block-list-appender",ISe=".block-editor-button-block-appender";function L7(e,t){return e.closest(qC)===t.closest(qC)}function va(e,t){return t.closest([qC,TSe,ISe].join(","))===e}function Ni(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;let o=e.closest(qC);if(o)return o.id.slice(6)}function xD(e,t){let o=Math.min(e.left,t.left),r=Math.max(e.right,t.right),n=Math.max(e.bottom,t.bottom),i=Math.min(e.top,t.top);return new window.DOMRectReadOnly(o,i,r-o,n-i)}function PSe(e){let t=e.ownerDocument.defaultView;if(!t||e.classList.contains("components-visually-hidden"))return!1;let o=e.getBoundingClientRect();if(o.width===0||o.height===0)return!1;if(e.checkVisibility)return e.checkVisibility?.({opacityProperty:!0,contentVisibilityAuto:!0,visibilityProperty:!0});let r=t.getComputedStyle(e);return!(r.display==="none"||r.visibility==="hidden"||r.opacity==="0")}function RSe(e){let t=window.getComputedStyle(e);return t.overflowX==="auto"||t.overflowX==="scroll"||t.overflowY==="auto"||t.overflowY==="scroll"}var OSe=["core/navigation"];function Sh(e){let t=e.ownerDocument.defaultView;if(!t)return new window.DOMRectReadOnly;let o=e.getBoundingClientRect(),r=e.getAttribute("data-type");if(r&&OSe.includes(r)){let s=[e],a;for(;a=s.pop();)if(!RSe(a)){for(let c of a.children)if(PSe(c)){let u=c.getBoundingClientRect();o=xD(o,u),s.push(c)}}}let n=Math.max(o.left,0),i=Math.min(o.right,t.innerWidth);return o=new window.DOMRectReadOnly(n,o.top,i-n,o.height),o}function M7({clientId:e,initialPosition:t}){let o=(0,ZC.useRef)(),{isBlockSelected:r,isMultiSelecting:n,isZoomOut:i}=M((0,N7.useSelect)(_));return(0,ZC.useEffect)(()=>{if(!r(e)||n()||i()||t==null||!o.current)return;let{ownerDocument:s}=o.current;if(va(o.current,s.activeElement))return;let a=Ol.focus.tabbable.find(o.current).filter(d=>(0,Ol.isTextField)(d)),c=t===-1,u=a[c?a.length-1:0]||o.current;if(!va(o.current,u)){o.current.focus();return}if(!o.current.getAttribute("contenteditable")){let d=Ol.focus.tabbable.findNext(o.current);if(d&&va(o.current,d)&&(0,Ol.isFormElement)(d)){d.focus();return}}(0,Ol.placeCaretAtHorizontalEdge)(u,c)},[t,e]),o}var D7=l(Z(),1);function XC(e){e.defaultPrevented||(e.preventDefault(),e.currentTarget.classList.toggle("is-hovered",e.type==="mouseover"))}function V7({isEnabled:e=!0}={}){return(0,D7.useRefEffect)(t=>{if(e)return t.addEventListener("mouseout",XC),t.addEventListener("mouseover",XC),()=>{t.removeEventListener("mouseout",XC),t.removeEventListener("mouseover",XC),t.classList.remove("is-hovered")}},[e])}var QC=l(F(),1),F7=l(Z(),1);function z7(e){let{isBlockSelected:t}=(0,QC.useSelect)(_),{selectBlock:o,selectionChange:r}=(0,QC.useDispatch)(_);return(0,F7.useRefEffect)(n=>{function i(s){if(!n.parentElement.closest('[contenteditable="true"]')){if(t(e)){s.target.isContentEditable||r(e);return}va(n,s.target)&&o(e)}}return n.addEventListener("focusin",i),()=>{n.removeEventListener("focusin",i)}},[t,o])}var _h=l($(),1),U7=l(Fe(),1),Ou=l(it(),1),JC=l(F(),1),H7=l(Z(),1);function j7(e){return!e||e==="transparent"||e==="rgba(0, 0, 0, 0)"}function G7({clientId:e,isSelected:t}){let{getBlockRootClientId:o,isZoomOut:r,hasMultiSelection:n,isSectionBlock:i,editedContentOnlySection:s,getBlock:a}=M((0,JC.useSelect)(_)),{insertAfterBlock:c,removeBlock:u,resetZoomLevel:d,startDraggingBlocks:f,stopDraggingBlocks:m,editContentOnlySection:h}=M((0,JC.useDispatch)(_));return(0,H7.useRefEffect)(p=>{if(!t)return;function g(k){let{keyCode:y,target:S}=k;y!==Ou.ENTER&&y!==Ou.BACKSPACE&&y!==Ou.DELETE||S!==p||(0,U7.isTextField)(S)||(k.preventDefault(),y===Ou.ENTER&&r()?d():y===Ou.ENTER?c(e):u(e))}function b(k){if(p!==k.target||p.isContentEditable||p.ownerDocument.activeElement!==p||n()){k.preventDefault();return}let y=JSON.stringify({type:"block",srcClientIds:[e],srcRootClientId:o(e)});k.dataTransfer.effectAllowed="move",k.dataTransfer.clearData(),k.dataTransfer.setData("wp-blocks",y);let{ownerDocument:S}=p,{defaultView:x}=S;x.getSelection().removeAllRanges();let B=S.createElement("div");B.style.width="1px",B.style.height="1px",B.style.position="fixed",B.style.visibility="hidden",S.body.appendChild(B),k.dataTransfer.setDragImage(B,0,0);let I=p.getBoundingClientRect(),P=p.id,E=p.cloneNode();E.style.display="none",p.id=null,p.after(E);let L=1;{let J=p;for(;J=J.parentElement;){let{scale:K}=x.getComputedStyle(J);if(K&&K!=="none"){L=parseFloat(K);break}}}let T=1/L,O={};for(let J of["transform","transformOrigin","transition","zIndex","position","top","left","pointerEvents","opacity","backgroundColor"])O[J]=p.style[J];let D=x.scrollY,U=x.scrollX,G=k.clientX,j=k.clientY;p.style.position="relative",p.style.top="0px",p.style.left="0px";let z=k.clientX-I.left,W=k.clientY-I.top,ee=I.height>200?200/I.height:1;if(p.style.zIndex="1000",p.style.transformOrigin=`${z*T}px ${W*T}px`,p.style.transition="transform 0.2s ease-out",p.style.transform=`scale(${ee})`,p.style.opacity="0.9",j7(x.getComputedStyle(p).backgroundColor)){let J="transparent",K=p;for(;K=K.parentElement;){let{backgroundColor:H}=x.getComputedStyle(K);if(!j7(H)){J=H;break}}p.style.backgroundColor=J}let se=!1,ce=G,ie=j;function re(J){J.clientX===ce&&J.clientY===ie||(ce=J.clientX,ie=J.clientY,Q())}function Q(){se||(se=!0,p.style.pointerEvents="none");let J=ie-j,K=ce-G,H=x.scrollY,X=x.scrollX,ne=H-D,le=X-U,ve=J+ne,he=K+le;p.style.top=`${ve*T}px`,p.style.left=`${he*T}px`}function Y(){S.removeEventListener("dragover",re),S.removeEventListener("dragend",Y),S.removeEventListener("drop",Y),S.removeEventListener("scroll",Q);for(let[J,K]of Object.entries(O))p.style[J]=K;E.remove(),p.id=P,B.remove(),m(),document.body.classList.remove("is-dragging-components-draggable"),S.documentElement.classList.remove("is-dragging")}S.addEventListener("dragover",re),S.addEventListener("dragend",Y),S.addEventListener("drop",Y),S.addEventListener("scroll",Q),f([e]),document.body.classList.add("is-dragging-components-draggable"),S.documentElement.classList.add("is-dragging")}p.addEventListener("keydown",g),p.addEventListener("dragstart",b);function v(k){let y=i(e),S=a(e),x=(0,_h.isReusableBlock)(S),C=(0,_h.isTemplatePart)(S);!y||s===e||x||C||(k.preventDefault(),h(e))}return p.addEventListener("dblclick",v),()=>{p.removeEventListener("keydown",g),p.removeEventListener("dragstart",b),p.removeEventListener("dblclick",v)}},[e,t,o,a,_h.isReusableBlock,_h.isTemplatePart,c,u,r,d,n,f,m,i,s,h])}var W7=l(Z(),1),$7=l(R(),1);function K7(){let e=(0,$7.useContext)(e1);return(0,W7.useRefEffect)(t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}},[e])}var t1=l(Z(),1);function Y7({isSelected:e}){let t=(0,t1.useReducedMotion)();return(0,t1.useRefEffect)(o=>{if(e){let{ownerDocument:r}=o,{defaultView:n}=r;if(!n.IntersectionObserver)return;let i=new n.IntersectionObserver(s=>{s[0].isIntersecting||o.scrollIntoView({behavior:t?"instant":"smooth"}),i.disconnect()});return i.observe(o),()=>{i.disconnect()}}},[e])}var q7=l(Z(),1),Z7=l(F(),1);function o1({clientId:e="",isEnabled:t=!0}={}){let{getEnabledClientIdsTree:o}=M((0,Z7.useSelect)(_));return(0,q7.useRefEffect)(r=>{if(!t)return;let n=()=>{o(e).forEach(({clientId:s})=>{let a=r.querySelector(`[data-block="${s}"]`);a&&(a.classList.remove("has-editable-outline"),a.offsetWidth,a.classList.add("has-editable-outline"))})},i=s=>{(s.target===r||s.target.classList.contains("is-root-container"))&&(s.defaultPrevented||(s.preventDefault(),n()))};return r.addEventListener("click",i),()=>r.removeEventListener("click",i)},[t])}var X7=l(Z(),1),hy=new Map;function ASe(e,t){let o=hy.get(e);o||(o=new Set,hy.set(e,o),e.addEventListener("pointerdown",J7)),o.add(t)}function LSe(e,t){let o=hy.get(e);o&&(o.delete(t),Q7(t),o.size===0&&(hy.delete(e),e.removeEventListener("pointerdown",J7)))}function Q7(e){let t=e.getAttribute("data-draggable");t&&(e.removeAttribute("data-draggable"),t==="true"&&!e.getAttribute("draggable")&&e.setAttribute("draggable","true"))}function J7(e){let{target:t}=e,{ownerDocument:o,isContentEditable:r,tagName:n}=t,i=["INPUT","TEXTAREA"].includes(n),s=hy.get(o);if(r||i)for(let a of s)a.getAttribute("draggable")==="true"&&a.contains(t)&&(a.removeAttribute("draggable"),a.setAttribute("data-draggable","true"));else for(let a of s)Q7(a)}function e9(){return(0,X7.useRefEffect)(e=>(ASe(e.ownerDocument,e),()=>{LSe(e.ownerDocument,e)}),[])}var mo=l(N(),1),gn=l(R(),1),Gr=l(A(),1),xh=l(F(),1),n9=l(Is(),1),i9=l(Un(),1);var gy=l(N(),1);function NSe(e,t){if(!e)return!1;let o=e.attributes?.metadata?.blockVisibility;if(o===!0||typeof o!="object")return!1;let r=o.viewport;return!r||typeof r!="object"||!iu.some(([,{key:n}])=>n===t)?!1:r[t]===!1}function o9(e,t){if(!e?.length)return!1;let o=e.filter(r=>NSe(r,t)).length;return o===0?!1:o===e.length?!0:null}function r9(e){if(!e?.length)return!1;let t=e.filter(o=>o&&o.attributes?.metadata?.blockVisibility===!1).length;return t===0?!1:t===e.length?!0:null}function by(e){if(!e&&e!==!1)return null;if(e===!1)return(0,gy.__)("Block is hidden");if(e?.viewport){let t=iu.filter(([o])=>e.viewport?.[o]===!1).map(([,o])=>o.label);if(t.length>0)return(0,gy.sprintf)((0,gy.__)("Block is hidden on %s"),t.join(", "))}return null}var ro=l(w(),1);if(typeof document<"u"&&!document.head.querySelector("style[data-wp-hash='4334c7deb6']")){let e=document.createElement("style");e.setAttribute("data-wp-hash","4334c7deb6"),e.appendChild(document.createTextNode(".block-editor-block-visibility-modal{z-index:1000001}.block-editor-block-visibility-modal__options{border:0;list-style:none;margin:24px 0;padding:0}.block-editor-block-visibility-modal__options-item{align-items:center;display:flex;gap:24px;justify-content:space-between;margin:0 0 16px}.block-editor-block-visibility-modal__options-item:last-child{margin:0}.block-editor-block-visibility-modal__options-item--everywhere{align-items:start;flex-direction:column}.block-editor-block-visibility-modal__options-checkbox--everywhere{font-weight:600}.block-editor-block-visibility-modal__options-icon--checked{fill:#ddd}.block-editor-block-visibility-modal__sub-options{padding-inline-start:12px;width:100%}.block-editor-block-visibility-modal__description{color:#757575;font-size:12px}.block-editor-block-visibility-info{align-items:center;display:flex;justify-content:start;margin:0 16px 16px;padding-bottom:4px;padding-top:4px}")),document.head.appendChild(e)}var MSe={[Et.mobile.key]:!1,[Et.tablet.key]:!1,[Et.desktop.key]:!1},DSe=[];function wD({clientIds:e,onClose:t}){let{createSuccessNotice:o}=(0,xh.useDispatch)(i9.store),{updateBlockAttributes:r}=(0,xh.useDispatch)(_),n=(0,xh.useSelect)(k=>k(_).getBlocksByClientId(e)??DSe,[e]),i=(0,xh.useSelect)(k=>k(n9.store).getShortcutRepresentation("core/editor/toggle-list-view"),[]),s=(0,gn.useMemo)(()=>{if(n?.length===0)return{hideEverywhere:!1,viewportChecked:{}};let k={};return iu.forEach(([,{key:y}])=>{k[y]=o9(n,y)}),{hideEverywhere:r9(n),viewportChecked:k}},[n]),[a,c]=(0,gn.useState)(s?.viewportChecked??{}),[u,d]=(0,gn.useState)(s?.hideEverywhere??!1),f=(0,gn.useCallback)((k,y)=>{c({...a,[k]:y})},[a]),m=(0,gn.useMemo)(()=>{if(!u)return(0,mo.sprintf)((0,mo.__)("Block visibility settings updated. You can access them via the List View (%s)."),i);let k=n?.length>1?(0,mo.__)("Blocks hidden. You can access them via the List View (%s)."):(0,mo.__)("Block hidden. You can access it via the List View (%s).");return(0,mo.sprintf)(k,i)},[u,n?.length,i]),h=(0,gn.useMemo)(()=>Object.values(a).some(k=>k===!0||k===null),[a]),p=(0,gn.useMemo)(()=>u!==s.hideEverywhere?!0:iu.some(([,{key:k}])=>a[k]!==s.viewportChecked[k]),[u,a,s]),g=(0,gn.useMemo)(()=>u===null?!0:Object.values(a).some(k=>k===null),[u,a]),b=(0,gn.useCallback)(k=>{k.preventDefault();let y=u?!1:{viewport:iu.reduce((x,[,{key:C}])=>(a[C]&&(x[C]=!1),x),{})},S=Object.fromEntries(n.map(({clientId:x,attributes:C})=>[x,{metadata:Me({...C?.metadata,blockVisibility:y})}]));r(e,S,{uniqueByBlock:!0}),o(m,{id:u?"block-visibility-hidden":"block-visibility-viewports-updated",type:"snackbar"}),t()},[n,e,o,u,m,t,r,a]),v=n?.length>1;return(0,ro.jsx)(Gr.Modal,{title:e?.length>1?(0,mo.__)("Hide blocks"):(0,mo.__)("Hide block"),onRequestClose:t,overlayClassName:"block-editor-block-visibility-modal",size:"small",children:(0,ro.jsxs)("form",{onSubmit:b,children:[(0,ro.jsxs)("fieldset",{children:[(0,ro.jsx)("legend",{children:v?(0,mo.__)("Select the viewport sizes for which you want to hide the blocks. Changes will apply to all selected blocks."):(0,mo.__)("Select the viewport size for which you want to hide the block.")}),(0,ro.jsx)("ul",{className:"block-editor-block-visibility-modal__options",children:(0,ro.jsxs)("li",{className:"block-editor-block-visibility-modal__options-item block-editor-block-visibility-modal__options-item--everywhere",children:[(0,ro.jsx)(Gr.CheckboxControl,{className:"block-editor-block-visibility-modal__options-checkbox--everywhere",label:(0,mo.__)("Omit from published content"),checked:u===!0,indeterminate:u===null,onChange:k=>{d(k),c(MSe)}}),u!==!0&&(0,ro.jsx)("ul",{className:"block-editor-block-visibility-modal__sub-options",children:iu.map(([,{label:k,icon:y,key:S}])=>(0,ro.jsxs)("li",{className:"block-editor-block-visibility-modal__options-item",children:[(0,ro.jsx)(Gr.CheckboxControl,{label:(0,mo.sprintf)((0,mo.__)("Hide on %s"),k),checked:a[S]??!1,indeterminate:a[S]===null,onChange:x=>f(S,x)}),(0,ro.jsx)(Gr.Icon,{icon:y,className:V({"block-editor-block-visibility-modal__options-icon--checked":a[S]})})]},S))})]})}),v&&g&&(0,ro.jsx)("p",{className:"block-editor-block-visibility-modal__description",children:(0,mo.__)("Selected blocks have different visibility settings. The checkboxes show an indeterminate state when settings differ.")}),!v&&u===!0&&(0,ro.jsx)("p",{className:"block-editor-block-visibility-modal__description",children:(0,mo.sprintf)((0,mo.__)("Block will be hidden in the editor, and omitted from the published markup on the frontend. You can configure it again by selecting it in the List View (%s)."),i)}),!v&&!u&&h&&(0,ro.jsx)("p",{className:"block-editor-block-visibility-modal__description",children:(0,gn.createInterpolateElement)((0,mo.sprintf)((0,mo.__)("Block will be hidden according to the selected viewports. It will be <strong>included in the published markup on the frontend</strong>. You can configure it again by selecting it in the List View (%s)."),i),{strong:(0,ro.jsx)("strong",{})})})]}),(0,ro.jsxs)(Gr.Flex,{className:"block-editor-block-visibility-modal__actions",justify:"flex-end",expanded:!1,children:[(0,ro.jsx)(Gr.FlexItem,{children:(0,ro.jsx)(Gr.Button,{variant:"tertiary",onClick:t,__next40pxDefaultSize:!0,children:(0,mo.__)("Cancel")})}),(0,ro.jsx)(Gr.FlexItem,{children:(0,ro.jsx)(Gr.Button,{variant:"primary",type:"submit",disabled:!p,accessibleWhenDisabled:!0,__next40pxDefaultSize:!0,children:(0,mo.__)("Apply")})})]})]})})}var CD=l(Z(),1);function Mi(e={}){let{blockVisibility:t=void 0,deviceType:o=Et.desktop.key,view:r=window}=e,n=(0,CD.useViewportMatch)("mobile",">=",r),i=(0,CD.useViewportMatch)("medium",">=",r),s;return o===Et.mobile.key?s=Et.mobile.key:o===Et.tablet.key?s=Et.tablet.key:n?n&&!i?s=Et.tablet.key:s=Et.desktop.key:s=Et.mobile.key,{isBlockCurrentlyHidden:t===!1||t?.viewport?.[s]===!1,currentViewport:s}}var BD=l(N(),1),r1=l(A(),1),n1=l(R(),1);var s9=l($(),1),i1=l(F(),1);var ED=l(w(),1);function TD({clientIds:e}){let t=(0,n1.useRef)(!1),{canToggleBlockVisibility:o,areBlocksHiddenAnywhere:r}=(0,i1.useSelect)(s=>{let{getBlocksByClientId:a,getBlockName:c,isBlockHiddenAnywhere:u}=M(s(_));return{canToggleBlockVisibility:a(e).every(({clientId:f})=>(0,s9.hasBlockSupport)(c(f),"visibility",!0)),areBlocksHiddenAnywhere:e?.every(f=>u(f))}},[e]),n=(0,i1.useDispatch)(_);if((0,n1.useEffect)(()=>{r&&(t.current=!0)},[r]),!r&&!t.current)return null;let{showViewportModal:i}=M(n);return(0,ED.jsx)(r1.ToolbarGroup,{className:"block-editor-block-visibility-toolbar",children:(0,ED.jsx)(r1.ToolbarButton,{disabled:!o,icon:r?vs:Af,label:r?(0,BD.__)("Hidden"):(0,BD.__)("Visible"),onClick:()=>i(e),"aria-haspopup":"dialog"})})}var ID=l(N(),1),a9=l(A(),1),s1=l(F(),1),l9=l(Is(),1);var c9=l(w(),1);function PD({clientIds:e}){let{areBlocksHiddenAnywhere:t,shortcut:o}=(0,s1.useSelect)(n=>{let{isBlockHiddenAnywhere:i}=M(n(_));return{areBlocksHiddenAnywhere:e?.every(s=>i(s)),shortcut:n(l9.store).getShortcutRepresentation("core/block-editor/toggle-block-visibility")}},[e]),{showViewportModal:r}=M((0,s1.useDispatch)(_));return(0,c9.jsx)(a9.MenuItem,{onClick:()=>r(e),shortcut:o,children:t?(0,ID.__)("Show"):(0,ID.__)("Hide")})}var Lu=l(A(),1),RD=l(F(),1),Au=l(N(),1);var wh=l(w(),1),{Badge:VSe}=M(Lu.privateApis),FSe={currentBlockVisibility:void 0,hasParentHiddenEverywhere:!1,selectedDeviceType:Et.desktop.value};function u9({clientId:e}){let{currentBlockVisibility:t,selectedDeviceType:o,hasParentHiddenEverywhere:r}=(0,RD.useSelect)(f=>{if(!e)return FSe;let{getBlockAttributes:m,isBlockParentHiddenEverywhere:h,getSettings:p}=M(f(_));return{currentBlockVisibility:m(e)?.metadata?.blockVisibility,selectedDeviceType:p()?.[wi]?.toLowerCase()||Et.desktop.value,hasParentHiddenEverywhere:h(e)}},[e]),i=Xe(e)?.ownerDocument?.defaultView,s=i===null?void 0:i,{isBlockCurrentlyHidden:a,currentViewport:c}=Mi({blockVisibility:t,deviceType:o,view:s}),u=(0,RD.useSelect)(f=>!e||!c?!1:M(f(_)).isBlockParentHiddenAtViewport(e,c),[e,c]);if(!(a||r||u))return null;let d;if(a)if(t===!1)d=(0,Au.__)("Block is hidden");else{let f=Et[c]?.label||c;d=(0,Au.sprintf)((0,Au.__)("Block is hidden on %s"),f)}if(r)d=(0,Au.__)("Parent block is hidden");else if(u){let f=Et[c]?.label||c;d=(0,Au.sprintf)((0,Au.__)("Parent block is hidden on %s"),f)}return(0,wh.jsx)(VSe,{className:"block-editor-block-visibility-info",children:(0,wh.jsxs)(Lu.__experimentalHStack,{spacing:2,justify:"start",children:[(0,wh.jsx)(Lu.Icon,{icon:vs}),(0,wh.jsx)(Lu.__experimentalText,{children:d})]})})}function ky(e={},{__unstableIsHtml:t}={}){let{clientId:o,className:r,wrapperProps:n={},isAligned:i,index:s,mode:a,name:c,blockApiVersion:u,blockTitle:d,isSelected:f,isSubtreeDisabled:m,hasOverlay:h,initialPosition:p,blockEditingMode:g,isHighlighted:b,isMultiSelected:v,isPartiallySelected:k,isReusable:y,isDragging:S,hasChildSelected:x,isEditingDisabled:C,hasEditableOutline:B,isEditingContentOnlySection:I,defaultClassName:P,isSectionBlock:E,isWithinSectionBlock:L,canMove:T,blockVisibility:O,deviceType:D}=(0,d9.useContext)(ur),U=(0,Ch.useRefEffect)(Y=>{if(Y){let{ownerDocument:J}=Y,{defaultView:K}=J;U.current=K}},[]),G=(0,a1.sprintf)((0,a1.__)("Block: %s"),d),j=a==="html"&&!t?"-visual":"",z=e9(),W=!L,ee=(0,Ch.useMergeRefs)([e.ref,U,M7({clientId:o,initialPosition:p}),VH(o),z7(o),G7({clientId:o,isSelected:f}),V7({isEnabled:W}),K7(),YC({triggerAnimationOnChange:s,clientId:o}),(0,Ch.useDisabled)({isDisabled:!h}),o1({clientId:o,isEnabled:E}),Y7({isSelected:f}),T?z:void 0]),se=Ie(),ie=!!se[Rp]?{"--wp-admin-theme-color":"var(--wp-block-synced-color)","--wp-admin-theme-color--rgb":"var(--wp-block-synced-color--rgb)"}:{},{isBlockCurrentlyHidden:re}=Mi({blockVisibility:O,deviceType:D,view:U.current});u<2&&o===se.clientId&&(0,m9.default)(`Block type "${c}" must support API version 2 or higher to work correctly with "useBlockProps" method.`);let Q=!1;return(n?.style?.marginTop?.charAt(0)==="-"||n?.style?.marginBottom?.charAt(0)==="-"||n?.style?.marginLeft?.charAt(0)==="-"||n?.style?.marginRight?.charAt(0)==="-")&&(Q=!0),{tabIndex:g==="disabled"?-1:0,draggable:T&&!x?!0:void 0,...n,...e,ref:ee,id:`block-${o}${j}`,role:"document","aria-label":G,"data-block":o,"data-type":c,"data-title":d,inert:m?"true":void 0,className:V("block-editor-block-list__block",{"wp-block":!i,"has-block-overlay":h,"is-selected":f,"is-highlighted":b,"is-multi-selected":v,"is-partially-selected":k,"is-reusable":y,"is-dragging":S,"has-child-selected":x,"is-editing-disabled":C,"has-editable-outline":B,"has-negative-margin":Q,"is-editing-content-only-section":I,"is-block-hidden":re},r,e.className,n.className,P),style:{...n.style,...e.style,...ie}}}ky.save=f9.__unstableGetBlockProps;var po=l(w(),1);function zSe(e,t){let o={...e,...t};return e?.hasOwnProperty("className")&&t?.hasOwnProperty("className")&&(o.className=V(e.className,t.className)),e?.hasOwnProperty("style")&&t?.hasOwnProperty("style")&&(o.style={...e.style,...t.style}),o}function l1({children:e,isHtml:t,...o}){return(0,po.jsx)("div",{...ky(o,{__unstableIsHtml:t}),children:e})}function OD({block:{__unstableBlockSource:e},mode:t,isLocked:o,canRemove:r,clientId:n,isSelected:i,isSelectionEnabled:s,className:a,__unstableLayoutClassNames:c,name:u,isValid:d,attributes:f,wrapperProps:m,setAttributes:h,onReplace:p,onRemove:g,onInsertBlocksAfter:b,onMerge:v,toggleSelection:k}){let{mayDisplayControls:y,mayDisplayParentControls:S,isSelectionWithinCurrentSection:x,themeSupportsLayout:C,...B}=(0,Nu.useContext)(ur),I=Uf()||{},P=(0,po.jsx)(Fw,{name:u,isSelected:i,attributes:f,setAttributes:h,insertBlocksAfter:o?void 0:b,onReplace:r?p:void 0,onRemove:r?g:void 0,mergeBlocks:r?v:void 0,clientId:n,isSelectionEnabled:s,toggleSelection:k,__unstableLayoutClassNames:c,__unstableParentLayout:Object.keys(I).length?I:void 0,mayDisplayControls:y,mayDisplayParentControls:S,mayDisplayPatternEditingControls:x,blockEditingMode:B.blockEditingMode,isPreviewMode:B.isPreviewMode}),E=(0,He.getBlockType)(u);E?.getEditWrapperProps&&(m=zSe(m,E.getEditWrapperProps(f)));let L=m&&!!m["data-align"]&&!C,T=a?.includes("is-position-sticky");L&&(P=(0,po.jsx)("div",{className:V("wp-block",T&&a),"data-align":m["data-align"],children:P}));let O;if(d)t==="html"?O=(0,po.jsxs)(po.Fragment,{children:[(0,po.jsx)("div",{style:{display:"none"},children:P}),(0,po.jsx)(l1,{isHtml:!0,children:(0,po.jsx)(T8,{clientId:n})})]}):E?.apiVersion>1?O=P:O=(0,po.jsx)(l1,{children:P});else{let j=e?(0,He.serializeRawBlock)(e):(0,He.getSaveContent)(E,f);O=(0,po.jsxs)(l1,{className:"has-warning",children:[(0,po.jsx)(o8,{clientId:n}),(0,po.jsx)(Nu.RawHTML,{children:(0,h9.safeHTML)(j)})]})}let{"data-align":D,...U}=m??{},G={...U,className:V(U.className,D&&C&&`align${D}`,!(D&&T)&&a)};return(0,po.jsx)(ur.Provider,{value:{wrapperProps:G,isAligned:L,isSelectionWithinCurrentSection:x,...B},children:(0,po.jsx)(a8,{fallback:(0,po.jsx)(l1,{className:"has-warning",children:(0,po.jsx)(i8,{})}),children:O})})}var jSe=(0,c1.withDispatch)((e,t,o)=>{let{updateBlockAttributes:r,insertBlocks:n,mergeBlocks:i,replaceBlocks:s,toggleSelection:a,__unstableMarkLastChangeAsPersistent:c,moveBlocksToPosition:u,removeBlock:d,selectBlock:f}=e(_);return{setAttributes(m){let{getMultiSelectedBlockClientIds:h}=o.select(_),p=h(),{clientId:g,attributes:b}=t,v=p.length?p:[g],k=typeof m=="function"?m(b):m;r(v,k)},onInsertBlocks(m,h){let{rootClientId:p}=t;n(m,h,p)},onInsertBlocksAfter(m){let{clientId:h,rootClientId:p}=t,{getBlockIndex:g}=o.select(_),b=g(h);n(m,b+1,p)},onMerge(m){let{clientId:h,rootClientId:p}=t,{getPreviousBlockClientId:g,getNextBlockClientId:b,getBlock:v,getBlockAttributes:k,getBlockName:y,getBlockOrder:S,getBlockIndex:x,getBlockRootClientId:C,canInsertBlockType:B}=o.select(_);function I(){let E=v(h),L=(0,He.getDefaultBlockName)(),T=(0,He.getBlockType)(L);if(y(h)!==L){let O=(0,He.switchToBlockType)(E,L);O&&O.length&&s(h,O)}else if((0,He.isUnmodifiedDefaultBlock)(E)){let O=b(h);O&&o.batch(()=>{d(h),f(O)})}else if(T.merge){let O=T.merge({},E.attributes);s([h],[(0,He.createBlock)(L,O)])}}function P(E,L=!0){let T=y(E),D=(0,He.getBlockType)(T).category==="text",U=C(E),G=S(E),[j]=G;G.length===1&&(0,He.isUnmodifiedBlock)(v(j))?d(E):D?o.batch(()=>{if(B(y(j),U))u([j],E,U,x(E));else{let z=(0,He.switchToBlockType)(v(j),(0,He.getDefaultBlockName)());z&&z.length&&z.every(W=>B(W.name,U))?(n(z,x(E),U,L),d(j,!1)):I()}!S(E).length&&(0,He.isUnmodifiedBlock)(v(E))&&d(E,!1)}):I()}if(m){if(p){let L=b(p);if(L)if(y(p)===y(L)){let T=k(p),O=k(L);if(Object.keys(T).every(D=>T[D]===O[D])){o.batch(()=>{u(S(L),L,p),d(L,!1)});return}}else{i(p,L);return}}let E=b(h);if(!E)return;S(E).length?P(E,!1):i(h,E)}else{let E=g(h);if(E)i(E,h);else if(p){let L=g(p);if(L&&y(p)===y(L)){let T=k(p),O=k(L);if(Object.keys(T).every(D=>T[D]===O[D])){o.batch(()=>{u(S(p),p,L),d(p,!1)});return}}P(p)}else I()}},onReplace(m,h,p){m.length&&!(0,He.isUnmodifiedDefaultBlock)(m[m.length-1])&&c();let g=m?.length===1&&Array.isArray(m[0])?m[0]:m;s([t.clientId],g,h,p)},onRemove(){d(t.clientId)},toggleSelection(m){a(m)}}});OD=(0,u1.compose)(jSe,(0,p9.withFilters)("editor.BlockListBlock"))(OD);function USe(e){let{clientId:t,rootClientId:o}=e,r=(0,c1.useSelect)(ne=>{let{isBlockSelected:le,getBlockMode:ve,isSelectionEnabled:he,getTemplateLock:xe,isSectionBlock:ze,getParentSectionBlock:ot,getBlockWithoutAttributes:Wt,getBlockAttributes:fo,canRemoveBlock:Do,canMoveBlock:rt,getSettings:ar,getEditedContentOnlySection:xt,getBlockEditingMode:At,getBlockName:Pe,isFirstMultiSelectedBlock:wt,getMultiSelectedBlockClientIds:qo,hasSelectedInnerBlock:$t,getBlocksByName:lr,getBlockIndex:ln,isBlockMultiSelected:je,isBlockSubtreeDisabled:Eo,isBlockHighlighted:Ze,__unstableIsFullySelected:Ve,__unstableSelectionHasUnmergeableBlock:gt,isBlockBeingDragged:To,isDragging:cr,__unstableHasActiveBlockOverlayActive:ge,getSelectedBlocksInitialCaretPosition:Ct}=M(ne(_)),Io=Wt(t);if(!Io)return;let{hasBlockSupport:Ke,getActiveBlockVariation:te}=ne(He.store),Le=fo(t),{name:ct,isValid:Gc}=Io,ua=(0,He.getBlockType)(ct),Bp=ar(),{supportsLayout:jk,isPreviewMode:hf,__experimentalBlockBindingsSupportedAttributes:cn}=Bp,Ep=cn?.[ct],Tp=Le?.metadata?.blockVisibility,s0=Bp?.[wi]?.toLowerCase()||"desktop",a0=ua?.apiVersion>1,Uk=je(t),ue=At(t),to={isPreviewMode:hf,blockWithoutAttributes:Io,name:ct,attributes:Le,isValid:Gc,themeSupportsLayout:jk,index:ln(t),isReusable:(0,He.isReusableBlock)(ua),className:a0?Le.className:void 0,defaultClassName:a0?(0,He.getBlockDefaultClassName)(ct):void 0,blockTitle:ua?.title,bindableAttributes:Ep,blockVisibility:Tp,deviceType:s0,isMultiSelected:Uk,blockEditingMode:ue,isEditingDisabled:ue==="disabled"};if(hf)return to;let ye=le(t),Lt=Do(t),un=rt(t),_r=te(ct,Le),Wc=!0,mO=$t(t,Wc),pO=ze(t)?t:ot(t),hO=(0,He.hasBlockSupport)(ct,"multiple",!0)?[]:lr(ct),Ume=hO.length&&hO[0]!==t;return{...to,mode:ve(t),isSelectionEnabled:he(),isLocked:!!xe(o),isSectionBlock:ze(t),isWithinSectionBlock:!!pO,isSelectionWithinCurrentSection:le(pO)||$t(pO,Wc),blockType:ua,canRemove:Lt,canMove:un,isSelected:ye,isEditingContentOnlySection:xt()===t,blockEditingMode:ue,mayDisplayControls:ye||wt(t)&&qo().every(Hme=>Pe(Hme)===ct),mayDisplayParentControls:Ke(Pe(t),"__experimentalExposeControlsToChildren",!1)&&$t(t),blockApiVersion:ua?.apiVersion||1,blockTitle:_r?.title||ua?.title,isSubtreeDisabled:ue==="disabled"&&Eo(t),hasOverlay:ge(t)&&!cr(),initialPosition:ye?Ct():void 0,isHighlighted:Ze(t),isMultiSelected:Uk,isPartiallySelected:Uk&&!Ve()&&!gt(),isDragging:To(t),hasChildSelected:mO,isEditingDisabled:ue==="disabled",hasEditableOutline:ue!=="disabled"&&At(o)==="disabled",originalBlockClientId:Ume?hO[0]:!1,blockVisibility:Tp,deviceType:s0}},[t,o]),n=(0,u1.useRefEffect)(ne=>{if(ne){let{ownerDocument:le}=ne,{defaultView:ve}=le;n.current=ve}},[]),{isBlockCurrentlyHidden:i}=Mi({blockVisibility:r?.blockVisibility,deviceType:r?.deviceType,view:n.current}),s=(0,Nu.useMemo)(()=>({...r?.blockWithoutAttributes,attributes:r?.attributes}),[r?.blockWithoutAttributes,r?.attributes]);if(!r)return null;let{isPreviewMode:a,mode:c="visual",isSelectionEnabled:u=!1,isLocked:d=!1,canRemove:f=!1,canMove:m=!1,name:h,attributes:p,isValid:g,isSelected:b=!1,themeSupportsLayout:v,isEditingContentOnlySection:k,blockEditingMode:y,mayDisplayControls:S,mayDisplayParentControls:x,index:C,blockApiVersion:B,blockType:I,blockTitle:P,isSubtreeDisabled:E,hasOverlay:L,initialPosition:T,isHighlighted:O,isMultiSelected:D,isPartiallySelected:U,isReusable:G,isDragging:j,hasChildSelected:z,isSectionBlock:W,isWithinSectionBlock:ee,isSelectionWithinCurrentSection:se,isEditingDisabled:ce,hasEditableOutline:ie,className:re,defaultClassName:Q,originalBlockClientId:Y,bindableAttributes:J,blockVisibility:K,deviceType:H}=r,X={isPreviewMode:a,clientId:t,className:re,index:C,mode:c,name:h,blockApiVersion:B,blockType:I,blockTitle:P,isSelected:b,isSubtreeDisabled:E,hasOverlay:L,initialPosition:T,blockEditingMode:y,isHighlighted:O,isMultiSelected:D,isPartiallySelected:U,isReusable:G,isDragging:j,hasChildSelected:z,isSectionBlock:W,isWithinSectionBlock:ee,isSelectionWithinCurrentSection:se,isEditingDisabled:ce,hasEditableOutline:ie,isEditingContentOnlySection:k,defaultClassName:Q,mayDisplayControls:S,mayDisplayParentControls:x,originalBlockClientId:Y,themeSupportsLayout:v,canMove:m,isBlockCurrentlyHidden:i,bindableAttributes:J,blockVisibility:K,deviceType:H};return i&&!b&&!D&&!z?null:(0,po.jsx)(ur.Provider,{value:X,children:(0,po.jsx)(OD,{...e,mode:c,isSelectionEnabled:u,isLocked:d,canRemove:f,canMove:m,block:s,name:h,attributes:p,isValid:g,isSelected:b})})}var g9=(0,Nu.memo)(USe);var Y5=l(F(),1),uY=l($(),1);var $5=l(N(),1),iY=l(SM(),1),AB=l(F(),1),LB=l(it(),1);var rY=l(Xo(),1),Gl=l(N(),1),PB=l(A(),1),nY=l(R(),1),RB=l(F(),1),OB=l(Z(),1),Yy=l($(),1);var Ft=l(R(),1),lg=l(A(),1),Xu=l(N(),1),Wy=l(Z(),1),QK=l(F(),1);var Bh=l(N(),1),Eh=l(R(),1),k9=l(A(),1),vy=l(w(),1),b9=[(0,Eh.createInterpolateElement)((0,Bh.__)("While writing, you can press <kbd>/</kbd> to quickly insert new blocks."),{kbd:(0,vy.jsx)("kbd",{})}),(0,Eh.createInterpolateElement)((0,Bh.__)("Indent a list by pressing <kbd>space</kbd> at the beginning of a line."),{kbd:(0,vy.jsx)("kbd",{})}),(0,Eh.createInterpolateElement)((0,Bh.__)("Outdent a list by pressing <kbd>backspace</kbd> at the beginning of a line."),{kbd:(0,vy.jsx)("kbd",{})}),(0,Bh.__)("Drag files into the editor to automatically insert media blocks."),(0,Bh.__)("Change a block's type by pressing the block icon on the toolbar.")];function HSe(){let[e]=(0,Eh.useState)(Math.floor(Math.random()*b9.length));return(0,vy.jsx)(k9.Tip,{children:b9[e]})}var v9=HSe;var $h=l($(),1),N$=l(R(),1),M$=l(N(),1);var bn=l(A(),1),d1=l(F(),1),y9=l(Re(),1),Mu=l(N(),1);var f1=l($(),1);var Cr=l(w(),1),{Badge:GSe}=M(bn.privateApis);function WSe({children:e,onClick:t}){return t?(0,Cr.jsx)(bn.Button,{__next40pxDefaultSize:!0,className:"block-editor-block-card__parent-select-button",onClick:t,children:e}):e}function $Se({title:e,icon:t,description:o,blockType:r,className:n,name:i,allowParentNavigation:s,parentClientId:a,isChild:c,children:u,clientId:d}){r&&((0,y9.default)("`blockType` property in `BlockCard component`",{since:"5.7",alternative:"`title, icon and description` properties"}),{title:e,icon:t,description:o}=r);let{parentBlockClientId:f,parentBlockName:m}=(0,d1.useSelect)(g=>{if(a||c||!s)return{};let{getBlockParents:b,getBlockName:v}=g(_),y=b(d,!1).find(S=>{let x=v(S);return x==="core/navigation"||(0,f1.hasBlockSupport)(x,"listView")});return{parentBlockClientId:y,parentBlockName:y?v(y):null}},[d,s,c,a]),{selectBlock:h}=(0,d1.useDispatch)(_),p=a?"div":"h2";return(0,Cr.jsx)("div",{className:V("block-editor-block-card",{"is-parent":a,"is-child":c},n),children:(0,Cr.jsxs)(bn.__experimentalVStack,{children:[(0,Cr.jsxs)(bn.__experimentalHStack,{justify:"flex-start",spacing:0,children:[f&&(0,Cr.jsx)(bn.Button,{onClick:()=>h(f),label:m?(0,Mu.sprintf)((0,Mu.__)('Go to "%s" block'),(0,f1.getBlockType)(m)?.title):(0,Mu.__)("Go to parent block"),style:{minWidth:24,padding:0},icon:(0,Mu.isRTL)()?Vo:Mr,size:"small"}),c&&(0,Cr.jsx)("span",{className:"block-editor-block-card__child-indicator-icon",children:(0,Cr.jsx)(bn.Icon,{icon:(0,Mu.isRTL)()?Xk:Qk})}),(0,Cr.jsxs)(WSe,{onClick:a?()=>{h(a)}:void 0,children:[(0,Cr.jsx)(Ae,{icon:t,showColors:!0}),(0,Cr.jsxs)(bn.__experimentalVStack,{spacing:1,children:[(0,Cr.jsxs)(p,{className:"block-editor-block-card__title",children:[(0,Cr.jsx)("span",{className:"block-editor-block-card__name",children:i?.length?i:e}),!a&&!c&&!!i?.length&&(0,Cr.jsx)(GSe,{children:e})]}),u]})]})]}),!a&&!c&&o&&(0,Cr.jsx)(bn.__experimentalText,{className:"block-editor-block-card__description",children:o})]})})}var yy=$Se;var Z1=l(Z(),1),w5=l(F(),1),sm=l(R(),1),x5=l(Re(),1);var z9=l(F(),1),Du=l(R(),1),j9=l(A(),1),tm=l(_9(),1);var x9=l(R(),1),Th=l(F(),1),w9=l(Z(),1);var m1=l(w(),1);function KSe(e,t,o){if(!o)return t;let r=e.get(t);return r||(r=(0,Th.createRegistry)({},t),r.registerStore(Kt,Qp),e.set(t,r)),r}var YSe=(0,w9.createHigherOrderComponent)(e=>function({useSubRegistry:o=!0,...r}){let n=(0,Th.useRegistry)(),[i]=(0,x9.useState)(()=>new WeakMap),s=KSe(i,n,o);return s===n?(0,m1.jsx)(e,{registry:n,...r}):(0,m1.jsx)(Th.RegistryProvider,{value:s,children:(0,m1.jsx)(e,{registry:s,...r})})},"withRegistryProvider"),C9=YSe;var Wr=l(R(),1),I9=l(F(),1),P9=l($(),1);var B9=l(R(),1),qSe=()=>{},p1=(0,B9.createContext)({getSelection:()=>{},onChangeSelection:qSe});var E9=()=>{};function R9(e,t){let o=(0,P9.cloneBlock)(e);return t.externalToInternal.set(e.clientId,o.clientId),t.internalToExternal.set(o.clientId,e.clientId),e.innerBlocks?.length&&(o.innerBlocks=e.innerBlocks.map(r=>R9(r,t))),o}function O9(e,t){return e.map(o=>{let r=t.internalToExternal.get(o.clientId);return{...o,clientId:r??o.clientId,innerBlocks:O9(o.innerBlocks,t)}})}function T9(e,t){let{selectionStart:o,selectionEnd:r,initialPosition:n}=e,i=s=>{if(!s?.clientId)return s;let a=t.internalToExternal.get(s.clientId);return{...s,clientId:a??s.clientId}};return{selectionStart:i(o),selectionEnd:i(r),initialPosition:n}}function h1({clientId:e=null,value:t,onChange:o=E9,onInput:r=E9}){let n=(0,I9.useRegistry)(),{getSelection:i,onChangeSelection:s}=(0,Wr.useContext)(p1),{resetBlocks:a,resetSelection:c,replaceInnerBlocks:u,setHasControlledInnerBlocks:d,__unstableMarkNextChangeAsNotPersistent:f}=n.dispatch(_),{getBlockName:m,getBlocks:h,getSelectionStart:p,getSelectionEnd:g}=n.select(_),b=(0,Wr.useRef)({incoming:null,outgoing:[]}),v=(0,Wr.useRef)(!1),k=(0,Wr.useRef)({externalToInternal:new Map,internalToExternal:new Map}),y=(0,Wr.useRef)(null),S=(0,Wr.useRef)(!1),x=()=>{let E=i();if(!E?.selectionStart?.clientId||E===y.current)return;let L=E.selectionStart.clientId;if(e?k.current.externalToInternal.has(L):!!m(L)){y.current=E;let O=D=>!D?.clientId||!e?D:{...D,clientId:k.current.externalToInternal.get(D.clientId)??D.clientId};S.current=!0,c(O(E.selectionStart),O(E.selectionEnd),E.initialPosition),S.current=!1}},C=()=>{t&&(e?n.batch(()=>{k.current.externalToInternal.clear(),k.current.internalToExternal.clear();let E=t.map(L=>R9(L,k.current));d(e,!0),v.current&&(b.current.incoming=E),f(),u(e,E),y.current=null}):(v.current&&(b.current.incoming=t),f(),a(t)))},B=()=>{f(),e?(d(e,!1),f(),u(e,[])):a([])},I=(0,Wr.useRef)(r),P=(0,Wr.useRef)(o);(0,Wr.useEffect)(()=>{I.current=r,P.current=o},[r,o]),(0,Wr.useEffect)(()=>{let E=b.current.outgoing.includes(t),L=h(e)===t;E?b.current.outgoing[b.current.outgoing.length-1]===t&&(b.current.outgoing=[]):L||(b.current.outgoing=[],C(),x())},[t,e]),(0,Wr.useEffect)(()=>{let{getSelectedBlocksInitialCaretPosition:E,isLastBlockChangePersistent:L,__unstableIsLastBlockChangeIgnored:T,areInnerBlocksControlled:O,getBlockParents:D}=n.select(_),U=h(e),G=L(),j=!1,z=p(),W=g();v.current=!0;let ee=n.subscribe(()=>{if(e!==null&&m(e)===null)return;let se=L(),ce=h(e),ie=ce!==U;if(U=ce,ie&&(b.current.incoming||T())){b.current.incoming=null,G=se;return}let Q=ie||j&&!ie&&se&&!G,Y=p(),J=g(),K=Y!==z||J!==W;K&&(z=Y,W=J),(Q||K)&&n.batch(()=>{if(Q){G=se;let H=e?O9(U,k.current):U,X={selectionStart:Y,selectionEnd:J,initialPosition:E()},ne=e?T9(X,k.current):X;b.current.outgoing.push(H),(G?P.current:I.current)(H,{selection:ne})}if(K&&!Q&&Y?.clientId&&!S.current&&(e?k.current.internalToExternal.has(Y.clientId):!D(Y.clientId).some(X=>O(X)))){let X={selectionStart:Y,selectionEnd:J,initialPosition:E()};s(e?T9(X,k.current):X)}}),j=ie},_);return()=>{v.current=!1,ee()}},[n,e]),(0,Wr.useEffect)(()=>()=>{B()},[])}var A9=l(R(),1),L9=l(F(),1),N9=l(Is(),1),ho=l(N(),1);function M9(){return null}function ZSe(){let{registerShortcut:e}=(0,L9.useDispatch)(N9.store);return(0,A9.useEffect)(()=>{e({name:"core/block-editor/copy",category:"block",description:(0,ho.__)("Copy the selected block(s)."),keyCombination:{modifier:"primary",character:"c"}}),e({name:"core/block-editor/cut",category:"block",description:(0,ho.__)("Cut the selected block(s)."),keyCombination:{modifier:"primary",character:"x"}}),e({name:"core/block-editor/paste",category:"block",description:(0,ho.__)("Paste the selected block(s)."),keyCombination:{modifier:"primary",character:"v"}}),e({name:"core/block-editor/duplicate",category:"block",description:(0,ho.__)("Duplicate the selected block(s)."),keyCombination:{modifier:"primaryShift",character:"d"}}),e({name:"core/block-editor/remove",category:"block",description:(0,ho.__)("Remove the selected block(s)."),keyCombination:{modifier:"access",character:"z"}}),e({name:"core/block-editor/paste-styles",category:"block",description:(0,ho.__)("Paste the copied style to the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"v"}}),e({name:"core/block-editor/insert-before",category:"block",description:(0,ho.__)("Insert a new block before the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"t"}}),e({name:"core/block-editor/insert-after",category:"block",description:(0,ho.__)("Insert a new block after the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"y"}}),e({name:"core/block-editor/delete-multi-selection",category:"block",description:(0,ho.__)("Delete selection."),keyCombination:{character:"del"},aliases:[{character:"backspace"}]}),e({name:"core/block-editor/stop-editing-as-blocks",category:"block",description:(0,ho.__)("Finish editing a design."),keyCombination:{character:"escape"}}),e({name:"core/block-editor/select-all",category:"selection",description:(0,ho.__)("Select all text when typing. Press again to select all blocks."),keyCombination:{modifier:"primary",character:"a"}}),e({name:"core/block-editor/unselect",category:"selection",description:(0,ho.__)("Clear selection."),keyCombination:{character:"escape"}}),e({name:"core/block-editor/multi-text-selection",category:"selection",description:(0,ho.__)("Select text across multiple blocks."),keyCombination:{modifier:"shift",character:"arrow"}}),e({name:"core/block-editor/focus-toolbar",category:"global",description:(0,ho.__)("Navigate to the nearest toolbar."),keyCombination:{modifier:"alt",character:"F10"}}),e({name:"core/block-editor/move-up",category:"block",description:(0,ho.__)("Move the selected block(s) up."),keyCombination:{modifier:"secondary",character:"t"}}),e({name:"core/block-editor/move-down",category:"block",description:(0,ho.__)("Move the selected block(s) down."),keyCombination:{modifier:"secondary",character:"y"}}),e({name:"core/block-editor/collapse-list-view",category:"list-view",description:(0,ho.__)("Collapse all other items."),keyCombination:{modifier:"alt",character:"l"}}),e({name:"core/block-editor/group",category:"block",description:(0,ho.__)("Create a group block from the selected multiple blocks."),keyCombination:{modifier:"primary",character:"g"}}),e({name:"core/block-editor/toggle-block-visibility",category:"block",description:(0,ho.__)("Show or hide the selected block(s)."),keyCombination:{modifier:"primaryShift",character:"h"}}),e({name:"core/block-editor/rename",category:"block",description:(0,ho.__)("Rename the selected block."),keyCombination:{modifier:"primaryAlt",character:"r"}})},[e]),null}M9.Register=ZSe;var g1=M9;var D9=l(R(),1);function XSe(e={}){return(0,D9.useMemo)(()=>({mediaUpload:e.mediaUpload,mediaSideload:e.mediaSideload,mediaFinalize:e.mediaFinalize,maxUploadFileSize:e.maxUploadFileSize,allowedMimeTypes:e.allowedMimeTypes,allImageSizes:e.allImageSizes,bigImageSizeThreshold:e.bigImageSizeThreshold}),[e])}var V9=XSe;var Al=l(w(),1),AD=()=>{},F9=!1,Ih=null;function QSe(){if(Ih!==null)return Ih;if(!window.__clientSideMediaProcessing||typeof tm.detectClientSideMediaSupport!="function")return Ih=!1,!1;let e=(0,tm.detectClientSideMediaSupport)();return!e||!e.supported?(F9||(console.info(`Client-side media processing unavailable: ${e.reason}. Using server-side processing.`),F9=!0),Ih=!1,!1):(Ih=!0,!0)}function JSe(e,t,{allowedTypes:o,additionalData:r={},filesList:n,onError:i=AD,onFileChange:s,onSuccess:a,onBatchSuccess:c}){e.dispatch(tm.store).addItems({files:Array.from(n),onChange:s,onSuccess:u=>{t?.[C0]?.(u),a?.(u)},onBatchSuccess:c,onError:u=>i(typeof u=="string"?u:u?.message??""),additionalData:r,allowedTypes:o})}function e_e(e){return h1(e),null}var Ph=C9(e=>{let{settings:t,registry:o,stripExperimentalSettings:r=!1}=e,n=V9(t),i=QSe(),s=!!t?.mediaUpload?.__isMediaUploadInterceptor,a=(0,Du.useMemo)(()=>{if(i&&t?.mediaUpload&&!s){let p=JSe.bind(null,o,t);return p.__isMediaUploadInterceptor=!0,{...t,mediaUpload:p}}return t},[t,o,i,s]),{__experimentalUpdateSettings:c}=M((0,z9.useDispatch)(_));(0,Du.useEffect)(()=>{c({...a,__internalIsInitialized:!0},{stripExperimentalSettings:r,reset:!0})},[a,r,c]);let u=(0,Du.useRef)(e.selection);u.current=e.selection;let d=(0,Du.useRef)(e.onChangeSelection??AD);d.current=e.onChangeSelection??AD;let f=(0,Du.useMemo)(()=>({getSelection:()=>u.current,onChangeSelection:(...p)=>d.current(...p)}),[]),m=(0,Al.jsxs)(j9.SlotFillProvider,{passthrough:!0,children:[!a?.isPreviewMode&&(0,Al.jsx)(g1.Register,{}),(0,Al.jsx)(MH,{children:e.children})]}),h=(0,Al.jsxs)(p1.Provider,{value:f,children:[(0,Al.jsx)(e_e,{clientId:e.clientId,value:e.value,onChange:e.onChange,onInput:e.onInput}),m]});return i&&!s?(0,Al.jsx)(tm.MediaUploadProvider,{settings:n,useSubRegistry:!1,children:h}):h}),t_e=e=>(0,Al.jsx)(Ph,{...e,stripExperimentalSettings:!0,children:e.children}),U9=t_e;var Dy=l(Z(),1),C$=l(F(),1),q1=l(R(),1),B$=l(A(),1);var om=l(R(),1),TG=l(N(),1),Vu=l(Z(),1),IG=l(A(),1),zD=l(F(),1);var SG=l(F(),1),_G=l(N(),1),wy=l(Z(),1),xG=l(R(),1);var H9=l(Z(),1),G9=l(F(),1);function o_e(e){let{isMultiSelecting:t,getMultiSelectedBlockClientIds:o,hasMultiSelection:r,getSelectedBlockClientId:n,getSelectedBlocksInitialCaretPosition:i,__unstableIsFullySelected:s}=e(_);return{isMultiSelecting:t(),multiSelectedBlockClientIds:o(),hasMultiSelection:r(),selectedBlockClientId:n(),initialPosition:i(),isFullSelection:s()}}function W9(){let{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:o,hasMultiSelection:r,selectedBlockClientId:n,isFullSelection:i}=(0,G9.useSelect)(o_e,[]);return(0,H9.useRefEffect)(s=>{let{ownerDocument:a}=s,{defaultView:c}=a;if(e==null||!r||t)return;let{length:u}=o;u<2||i&&(s.contentEditable=!0,s.focus(),c.getSelection().removeAllRanges())},[r,t,o,n,e,i])}var Rh=l(Fe(),1),LD=l(it(),1),b1=l(F(),1),k1=l(Z(),1),Sy=l(R(),1);var ND=l(w(),1);function $9(){let e=(0,Sy.useRef)(),t=(0,Sy.useRef)(),o=(0,Sy.useRef)(),{hasMultiSelection:r,getSelectedBlockClientId:n,getBlockCount:i,getBlockOrder:s,getLastFocus:a,getSectionRootClientId:c,isZoomOut:u}=M((0,b1.useSelect)(_)),{setLastFocus:d}=M((0,b1.useDispatch)(_)),f=(0,Sy.useRef)();function m(v){let k=e.current.ownerDocument===v.target.ownerDocument?e.current:e.current.ownerDocument.defaultView.frameElement;if(f.current)f.current=null;else if(r())e.current.focus();else if(n())a()?.current?a().current.focus():e.current.querySelector(`[data-block="${n()}"]`).focus();else if(u()){let y=c(),S=s(y);S.length?e.current.querySelector(`[data-block="${S[0]}"]`).focus():y?e.current.querySelector(`[data-block="${y}"]`).focus():k.focus()}else{let y=v.target.compareDocumentPosition(k)&v.target.DOCUMENT_POSITION_FOLLOWING,S=Rh.focus.tabbable.find(e.current);S.length&&(y?S[0]:S[S.length-1]).focus()}}let h=(0,ND.jsx)("div",{ref:t,tabIndex:"0",onFocus:m}),p=(0,ND.jsx)("div",{ref:o,tabIndex:"0",onFocus:m}),g=(0,k1.useRefEffect)(v=>{function k(B){if(B.defaultPrevented||B.keyCode!==LD.TAB||!o.current||!t.current)return;let{target:I,shiftKey:P}=B,E=P?"findPrevious":"findNext",L=Rh.focus.tabbable[E](I),T=I.closest("[data-block]"),O=T&&L&&(L7(T,L)||va(T,L));if((0,Rh.isFormElement)(L)&&O)return;let D=P?t:o;f.current=!0,D.current.focus({preventScroll:!0})}function y(B){d({...a(),current:B.target});let{ownerDocument:I}=v;!B.relatedTarget&&B.target.hasAttribute("data-block")&&I.activeElement===I.body&&i()===0&&v.focus()}function S(B){if(B.keyCode!==LD.TAB||B.target?.getAttribute("role")==="region"||e.current===B.target)return;let P=B.shiftKey?"findPrevious":"findNext",E=Rh.focus.tabbable[P](B.target);(E===t.current||E===o.current)&&(B.preventDefault(),E.focus({preventScroll:!0}))}let{ownerDocument:x}=v,{defaultView:C}=x;return C.addEventListener("keydown",S),v.addEventListener("keydown",k),v.addEventListener("focusout",y),()=>{C.removeEventListener("keydown",S),v.removeEventListener("keydown",k),v.removeEventListener("focusout",y)}},[]),b=(0,k1.useMergeRefs)([e,g]);return[h,b,p]}var go=l(Fe(),1),ya=l(it(),1),v1=l(F(),1),K9=l(Z(),1);function r_e(e,t,o){let r=t===ya.UP||t===ya.DOWN,{tagName:n}=e,i=e.getAttribute("type");return r&&!o?n==="INPUT"?!["date","datetime-local","month","number","range","time","week"].includes(i):!0:n==="INPUT"?["button","checkbox","number","color","file","image","radio","reset","submit"].includes(i):n!=="TEXTAREA"}function MD(e,t,o,r){let n=go.focus.focusable.find(o);t&&n.reverse(),n=n.slice(n.indexOf(e)+1);let i;r&&(i=e.getBoundingClientRect());function s(a){if(a.contentEditable!=="true"&&Ni(a)&&go.focus.focusable.find(a).filter(c=>!(0,go.isFormElement)(c)).length!==0||!go.focus.tabbable.isTabbableIndex(a)||a.isContentEditable&&a.contentEditable!=="true")return!1;if(r){let c=a.getBoundingClientRect();if(c.left>=i.right||c.right<=i.left)return!1}return!0}return n.find(s)}function Y9(){let{getMultiSelectedBlocksStartClientId:e,getMultiSelectedBlocksEndClientId:t,getSettings:o,hasMultiSelection:r,__unstableIsFullySelected:n}=(0,v1.useSelect)(_),{selectBlock:i}=(0,v1.useDispatch)(_);return(0,K9.useRefEffect)(s=>{let a;function c(){a=null}function u(f,m){let h=MD(f,m,s);return h&&Ni(h)}function d(f){if(f.defaultPrevented)return;let{keyCode:m,target:h,shiftKey:p,ctrlKey:g,altKey:b,metaKey:v}=f,k=m===ya.UP,y=m===ya.DOWN,S=m===ya.LEFT,x=m===ya.RIGHT,C=k||S,B=S||x,I=k||y,P=B||I,E=p||g||b||v,L=I?go.isVerticalEdge:go.isHorizontalEdge,{ownerDocument:T}=s,{defaultView:O}=T;if(!P||o().isPreviewMode)return;if(r()){if(p||!n())return;f.preventDefault(),C?i(e()):i(t(),-1);return}if(!r_e(h,m,E))return;I?a||(a=(0,go.computeCaretRect)(O)):a=null;let D=(0,go.isRTL)(h)?!C:C,{keepCaretInsideBlock:U}=o();if(p)u(h,C)&&L(h,C)&&(s.contentEditable=!0,s.focus());else if(I&&(0,go.isVerticalEdge)(h,C)&&(!b||(0,go.isHorizontalEdge)(h,D))&&!U){let G=MD(h,C,s,!0);G&&((0,go.placeCaretAtVerticalEdge)(G,b?!C:C,b?void 0:a),f.preventDefault())}else if(B&&O.getSelection().isCollapsed&&(0,go.isHorizontalEdge)(h,D)&&!U){let G=MD(h,D,s);(0,go.placeCaretAtHorizontalEdge)(G,C),f.preventDefault()}}return s.addEventListener("mousedown",c),s.addEventListener("keydown",d),()=>{s.removeEventListener("mousedown",c),s.removeEventListener("keydown",d)}},[])}var q9=l(Z(),1),Z9=l(F(),1),Sa=l(it(),1);function X9(){let e=(0,Z9.useSelect)(t=>t(_).getSettings().isPreviewMode,[]);return(0,q9.useRefEffect)(t=>{if(!e)return;function o(r){let{keyCode:n,shiftKey:i,target:s}=r,a=n===Sa.TAB,c=n===Sa.UP,u=n===Sa.DOWN,d=n===Sa.LEFT;if(!a&&!(c||u||d||n===Sa.RIGHT))return;let h=a?i:c||d,p=Array.from(t.querySelectorAll("[data-block]"));if(!p.length)return;let g=s.closest("[data-block]"),b=g?p.indexOf(g):-1;if(b===-1||a&&(h&&b===0||!h&&b===p.length-1))return;let v;h?v=b<=0?p.length-1:b-1:v=b===-1||b>=p.length-1?0:b+1,r.preventDefault(),p[v].focus()}return t.addEventListener("keydown",o),()=>{t.removeEventListener("keydown",o)}},[e])}var Q9=l(Fe(),1),y1=l(F(),1),J9=l(Is(),1),eG=l(Z(),1);function tG(){let{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:o}=(0,y1.useSelect)(_),{multiSelect:r,selectBlock:n}=(0,y1.useDispatch)(_),i=(0,J9.__unstableUseShortcutEventMatch)();return(0,eG.useRefEffect)(s=>{function a(c){if(!i("core/block-editor/select-all",c))return;let u=t();if(u.length<2&&!(0,Q9.isEntirelySelected)(c.target))return;c.preventDefault();let{ownerDocument:d}=c.target,[f]=u,m=Ni(d.activeElement);if(m&&m!==f&&!va(d.getElementById("block-"+f),d.activeElement)){n(m);return}let h=o(f),p=e(h);if(u.length===p.length){h&&(s.ownerDocument.defaultView.getSelection().removeAllRanges(),n(h));return}r(p[0],p[p.length-1])}return s.addEventListener("keydown",a),()=>{s.removeEventListener("keydown",a)}},[])}var S1=l(F(),1),rG=l(Z(),1);function oG(e,t){e.contentEditable=t,t&&e.focus()}function nG(){let{startMultiSelect:e,stopMultiSelect:t}=(0,S1.useDispatch)(_),{getSettings:o,isSelectionEnabled:r,hasSelectedBlock:n,isDraggingBlocks:i,isMultiSelecting:s}=(0,S1.useSelect)(_);return(0,rG.useRefEffect)(a=>{let{ownerDocument:c}=a,{defaultView:u}=c,d,f;function m(){t(),u.removeEventListener("mouseup",m),f=u.requestAnimationFrame(()=>{if(!n())return;oG(a,!1);let b=u.getSelection();if(b.rangeCount){let v=b.getRangeAt(0),{commonAncestorContainer:k}=v,y=v.cloneRange();d.contains(k)&&(d.focus(),b.removeAllRanges(),b.addRange(y))}})}let h;function p({target:b}){h=b}function g({buttons:b,target:v,relatedTarget:k}){v.contains(h)&&(v.contains(k)||i()||b===1&&(s()||a!==v&&(v.getAttribute("contenteditable")!=="true"&&!o().isPreviewMode||r()&&(d=v,e(),u.addEventListener("mouseup",m),oG(a,!0)))))}return a.addEventListener("mouseout",g),a.addEventListener("mousedown",p),()=>{a.removeEventListener("mouseout",g),u.removeEventListener("mouseup",m),u.cancelAnimationFrame(f)}},[e,t,r,n])}var _1=l(F(),1),aG=l(Z(),1),DD=l(dr(),1),lG=l(Fe(),1);function n_e(e){let{anchorNode:t,anchorOffset:o}=e;return t.nodeType===t.TEXT_NODE||o===0?t:t.childNodes[o-1]}function i_e(e){let{focusNode:t,focusOffset:o}=e;return t.nodeType===t.TEXT_NODE||o===t.childNodes.length?t:o===0&&(0,lG.isSelectionForward)(e)?t.previousSibling??t.parentElement:t.childNodes[o]}function s_e(e,t){let o=0;for(;e[o]===t[o];)o++;return o}function iG(e,t){e.contentEditable!==String(t)&&(e.contentEditable=t,t&&e.focus())}function sG(e){return(e.nodeType===e.ELEMENT_NODE?e:e.parentElement)?.closest("[data-wp-block-attribute-key]")}function cG(){let{multiSelect:e,selectBlock:t,selectionChange:o}=(0,_1.useDispatch)(_),{getBlockParents:r,getBlockSelectionStart:n,isMultiSelecting:i}=(0,_1.useSelect)(_);return(0,aG.useRefEffect)(s=>{let{ownerDocument:a}=s,{defaultView:c}=a;function u(d){let f=c.getSelection();if(!f.rangeCount)return;let m=n_e(f),h=i_e(f);if(!s.contains(m)||!s.contains(h))return;let p=d.shiftKey&&d.type==="mouseup";if(f.isCollapsed&&!p){if(s.contentEditable==="true"&&!i()){iG(s,!1);let k=m.nodeType===m.ELEMENT_NODE?m:m.parentElement;k=k?.closest("[contenteditable]"),k?.focus()}return}let g=Ni(m),b=Ni(h);if(p){let k=n(),y=Ni(d.target),S=y!==b;(g===b&&f.isCollapsed||!b||S)&&(b=y),g!==k&&(g=k)}if(g===void 0&&b===void 0){iG(s,!1);return}if(d.type==="mouseup"&&!d.shiftKey&&!i()&&g===b){let k=Ni(d.target);if(k&&k!==g){f.removeAllRanges();return}}if(g===b)i()?e(g,g):t(g);else{let k=[...r(g),g],y=[...r(b),b],S=s_e(k,y);if(k[S]!==g||y[S]!==b){e(k[S],y[S]);return}let x=sG(m),C=sG(h);if(x&&C){let B=f.getRangeAt(0),I=(0,DD.create)({element:x,range:B,__unstableIsEditableTree:!0}),P=(0,DD.create)({element:C,range:B,__unstableIsEditableTree:!0}),E=I.start??I.end,L=P.start??P.end;o({start:{clientId:g,attributeKey:x.dataset.wpBlockAttributeKey,offset:E},end:{clientId:b,attributeKey:C.dataset.wpBlockAttributeKey,offset:L}})}else e(g,b)}}return a.addEventListener("selectionchange",u),c.addEventListener("mouseup",u),()=>{a.removeEventListener("selectionchange",u),c.removeEventListener("mouseup",u)}},[e,t,o,r])}var x1=l(F(),1),uG=l(Z(),1);function dG(){let{selectBlock:e}=(0,x1.useDispatch)(_),{isSelectionEnabled:t,getBlockSelectionStart:o,hasMultiSelection:r}=(0,x1.useSelect)(_);return(0,uG.useRefEffect)(n=>{function i(s){if(!t()||s.button!==0)return;let a=o(),c=Ni(s.target);s.shiftKey?a&&a!==c&&(n.contentEditable=!0,n.focus()):r()&&e(c)}return n.addEventListener("mousedown",i),()=>{n.removeEventListener("mousedown",i)}},[e,t,o,r])}var w1=l(F(),1),fG=l(Z(),1),Ll=l(it(),1),Ps=l($(),1);function mG(){let{__unstableIsFullySelected:e,getSelectedBlockClientIds:t,getSelectedBlockClientId:o,__unstableIsSelectionMergeable:r,hasMultiSelection:n,getBlockName:i,canInsertBlockType:s,getBlockRootClientId:a,getSelectionStart:c,getSelectionEnd:u,getBlockAttributes:d}=(0,w1.useSelect)(_),{replaceBlocks:f,__unstableSplitSelection:m,removeBlocks:h,__unstableDeleteSelection:p,__unstableExpandSelection:g,__unstableMarkAutomaticChange:b}=(0,w1.useDispatch)(_);return(0,fG.useRefEffect)(v=>{function k(x){v.contentEditable==="true"&&x.preventDefault()}function y(x){if(!x.defaultPrevented){if(!n()){if(x.keyCode===Ll.ENTER){if(x.shiftKey||e())return;let C=o(),B=i(C),I=c(),P=u();if(I.attributeKey===P.attributeKey){let E=d(C)[I.attributeKey],L=(0,Ps.getBlockTransforms)("from").filter(({type:O})=>O==="enter"),T=(0,Ps.findTransform)(L,O=>O.regExp.test(E));if(T){f(C,T.transform({content:E})),b();return}}if(!(0,Ps.hasBlockSupport)(B,"splitting",!1)&&!x.__deprecatedOnSplit)return;(s((0,Ps.getDefaultBlockName)(),a(C))||s(B,a(C)))&&(m(),x.preventDefault())}return}x.keyCode===Ll.ENTER?(v.contentEditable=!1,x.preventDefault(),e()?f(t(),(0,Ps.createBlock)((0,Ps.getDefaultBlockName)())):m()):x.keyCode===Ll.BACKSPACE||x.keyCode===Ll.DELETE?(v.contentEditable=!1,x.preventDefault(),e()?h(t()):r()?p(x.keyCode===Ll.DELETE):g()):x.key.length===1&&!(x.metaKey||x.ctrlKey)&&(v.contentEditable=!1,r()?p(x.keyCode===Ll.DELETE):(x.preventDefault(),v.ownerDocument.defaultView.getSelection().removeAllRanges()))}}function S(x){n()&&(v.contentEditable=!1,r()?p():(x.preventDefault(),v.ownerDocument.defaultView.getSelection().removeAllRanges()))}return v.addEventListener("beforeinput",k),v.addEventListener("keydown",y),v.addEventListener("compositionstart",S),()=>{v.removeEventListener("beforeinput",k),v.removeEventListener("keydown",y),v.removeEventListener("compositionstart",S)}},[])}var _a=l($(),1),B1=l(Fe(),1),Lh=l(F(),1),yG=l(Z(),1);var pG=l(R(),1),hG=l($(),1),_y=l(F(),1),Di=l(N(),1),gG=l(Un(),1);function Oh(){let{getBlockName:e}=(0,_y.useSelect)(_),{getBlockType:t}=(0,_y.useSelect)(hG.store),{createSuccessNotice:o}=(0,_y.useDispatch)(gG.store);return(0,pG.useCallback)((r,n)=>{let i="";if(r==="copyStyles")i=(0,Di.__)("Styles copied to clipboard.");else if(n.length===1){let s=n[0],a=t(e(s))?.title;r==="copy"?i=(0,Di.sprintf)((0,Di.__)('Copied "%s" to clipboard.'),a):i=(0,Di.sprintf)((0,Di.__)('Moved "%s" to clipboard.'),a)}else r==="copy"?i=(0,Di.sprintf)((0,Di._n)("Copied %d block to clipboard.","Copied %d blocks to clipboard.",n.length),n.length):i=(0,Di.sprintf)((0,Di._n)("Moved %d block to clipboard.","Moved %d blocks to clipboard.",n.length),n.length);o(i,{type:"snackbar"})},[o,e,t])}var kG=l(Fe(),1),Vi=l($(),1);var bG=l(Fe(),1);function a_e(e){let t="<!--StartFragment-->",o=e.indexOf(t);if(o>-1)e=e.substring(o+t.length);else return e;let n=e.indexOf("<!--EndFragment-->");return n>-1&&(e=e.substring(0,n)),e}function l_e(e){let t="<meta charset='utf-8'>";return e.startsWith(t)?e.slice(t.length):e}function Ah({clipboardData:e}){let t="",o="";try{t=e.getData("text/plain"),o=e.getData("text/html")}catch{return}o=a_e(o),o=l_e(o);let r=(0,bG.getFilesFromDataTransfer)(e);return r.length&&!c_e(r,o)?{files:r}:{html:o,plainText:t,files:[]}}function c_e(e,t){if(t&&e?.length===1&&e[0].type.indexOf("image/")===0){let o=/<\s*img\b/gi;if(t.match(o)?.length!==1)return!0;let r=/<\s*img\b[^>]*\bsrc="file:\/\//i;if(t.match(r))return!0}return!1}var VD=Symbol("requiresWrapperOnCopy");function C1(e,t,o){let r=t,[n]=t;if(n&&o.select(Vi.store).getBlockType(n.name)[VD]){let{getBlockRootClientId:a,getBlockName:c,getBlockAttributes:u}=o.select(_),d=a(n.clientId),f=c(d);f&&(r=(0,Vi.createBlock)(f,u(d),r))}let i=(0,Vi.serialize)(r);e.clipboardData.setData("text/plain",u_e(i)),e.clipboardData.setData("text/html",i)}function vG(e,t){let{plainText:o,html:r,files:n}=Ah(e),i=[];if(n.length){let s=(0,Vi.getBlockTransforms)("from");i=n.reduce((a,c)=>{let u=(0,Vi.findTransform)(s,d=>d.type==="files"&&d.isMatch([c]));return u&&a.push(u.transform([c])),a},[]).flat()}else i=(0,Vi.pasteHandler)({HTML:r,plainText:o,mode:"BLOCKS",canUserUseUnfilteredHTML:t});return i}function u_e(e){return e=e.replace(/<br>/g,` `),(0,kG.__unstableStripHTML)(e).trim().replace(/\n\n+/g,` `)}function xy(){let e=(0,Lh.useRegistry)(),{getBlocksByClientId:t,getSelectedBlockClientIds:o,hasMultiSelection:r,getSettings:n,getBlockName:i,__unstableIsFullySelected:s,__unstableIsSelectionCollapsed:a,__unstableIsSelectionMergeable:c,__unstableGetSelectedBlocksWithPartialSelection:u,canInsertBlockType:d,getBlockRootClientId:f}=(0,Lh.useSelect)(_),{flashBlock:m,removeBlocks:h,replaceBlocks:p,__unstableDeleteSelection:g,__unstableExpandSelection:b,__unstableSplitSelection:v}=(0,Lh.useDispatch)(_),k=Oh();return(0,yG.useRefEffect)(y=>{function S(x){if(x.defaultPrevented)return;let C=o();if(C.length===0)return;if(!r()){let{target:L}=x,{ownerDocument:T}=L;if(x.type==="copy"||x.type==="cut"?(0,B1.documentHasUncollapsedSelection)(T):(0,B1.documentHasSelection)(T)&&!T.activeElement.isContentEditable)return}let{activeElement:B}=x.target.ownerDocument;if(!y.contains(B))return;let I=c(),P=a()||s(),E=!P&&!I;if(x.type==="copy"||x.type==="cut")if(x.preventDefault(),C.length===1&&m(C[0]),E)b();else{k(x.type,C);let L;if(P)L=t(C);else{let[T,O]=u(),D=t(C.slice(1,C.length-1));L=[T,...D,O]}C1(x,L,e)}if(x.type==="cut")P&&!E?h(C):(x.target.ownerDocument.activeElement.contentEditable=!1,g());else if(x.type==="paste"){let{__experimentalCanUserUseUnfilteredHTML:L,mediaUpload:T}=n();if(x.clipboardData.getData("rich-text")==="true")return;let{plainText:D,html:U,files:G}=Ah(x),j=s(),z=[];if(G.length){if(!T){x.preventDefault();return}let ce=(0,_a.getBlockTransforms)("from");z=G.reduce((ie,re)=>{let Q=(0,_a.findTransform)(ce,Y=>Y.type==="files"&&Y.isMatch([re]));return Q&&ie.push(Q.transform([re])),ie},[]).flat()}else z=(0,_a.pasteHandler)({HTML:U,plainText:D,mode:j?"BLOCKS":"AUTO",canUserUseUnfilteredHTML:L});if(typeof z=="string")return;if(j){p(C,z,z.length-1,-1),x.preventDefault();return}if(!r()&&!(0,_a.hasBlockSupport)(i(C[0]),"splitting",!1)&&!x.__deprecatedOnSplit)return;let[W]=C,ee=f(W),se=[];for(let ce of z)if(d(ce.name,ee))se.push(ce);else{let ie=i(ee),re=ce.name!==ie?(0,_a.switchToBlockType)(ce,ie):[ce];if(!re)return;for(let Q of re)for(let Y of Q.innerBlocks)se.push(Y)}v(se),x.preventDefault()}}return y.ownerDocument.addEventListener("copy",S),y.ownerDocument.addEventListener("cut",S),y.ownerDocument.addEventListener("paste",S),()=>{y.ownerDocument.removeEventListener("copy",S),y.ownerDocument.removeEventListener("cut",S),y.ownerDocument.removeEventListener("paste",S)}},[])}var Nh=l(w(),1);function FD(){let[e,t,o]=$9(),r=(0,SG.useSelect)(n=>n(_).hasMultiSelection(),[]);return[e,(0,wy.useMergeRefs)([t,xy(),mG(),nG(),cG(),dG(),W9(),tG(),Y9(),X9(),(0,wy.useRefEffect)(n=>(n.tabIndex=0,n.dataset.hasMultiSelection=r,r?(n.setAttribute("aria-label",(0,_G.__)("Multiple selected blocks")),()=>{delete n.dataset.hasMultiSelection,n.removeAttribute("aria-label")}):()=>{delete n.dataset.hasMultiSelection}),[r])]),o]}function d_e({children:e,...t},o){let[r,n,i]=FD();return(0,Nh.jsxs)(Nh.Fragment,{children:[r,(0,Nh.jsx)("div",{...t,ref:(0,wy.useMergeRefs)([n,o]),className:V(t.className,"block-editor-writing-flow"),children:e}),i]})}var E1=(0,xG.forwardRef)(d_e);var T1=null;function wG(){return T1||(T1=Array.from(document.styleSheets).reduce((e,t)=>{try{t.cssRules}catch{return e}let{ownerNode:o,cssRules:r}=t;if(o===null||!r||o.id.startsWith("wp-")||!o.id)return e;function n(i){return Array.from(i).find(({selectorText:s,conditionText:a,cssRules:c})=>a?n(c):s&&(s.includes(".editor-styles-wrapper")||s.includes(".wp-block")))}if(n(r)){let i=o.tagName==="STYLE";if(i){let s=o.id.replace("-inline-css","-css"),a=document.getElementById(s);a&&e.push(a.cloneNode(!0))}if(e.push(o.cloneNode(!0)),!i){let s=o.id.replace("-css","-inline-css"),a=document.getElementById(s);a&&e.push(a.cloneNode(!0))}}return e},[]),T1)}var kn=l(R(),1),Cy=l(Z(),1);function CG({frameSize:e,containerWidth:t,maxContainerWidth:o,scaleContainerWidth:r}){return(Math.min(t,o)-e*2)/r}function f_e(e,t){let{scaleValue:o,scrollHeight:r}=e,{frameSize:n,scaleValue:i}=t;return r*(i/o)+n*2}function m_e(e,t){let{containerHeight:o,frameSize:r,scaleValue:n,scrollTop:i}=e,{containerHeight:s,frameSize:a,scaleValue:c,scrollHeight:u}=t,d=i;d=(d+o/2-r)/n-o/2,d=(d+s/2)*c+a-s/2,d=i<=r?0:d;let f=u-s;return Math.round(Math.min(Math.max(0,d),Math.max(0,f)))}function p_e(e,t){let{scaleValue:o,frameSize:r,scrollTop:n}=e,{scaleValue:i,frameSize:s,scrollTop:a}=t;return[{translate:"0 0",scale:o,paddingTop:`${r/o}px`,paddingBottom:`${r/o}px`},{translate:`0 ${n-a}px`,scale:i,paddingTop:`${s/i}px`,paddingBottom:`${s/i}px`}]}function BG({frameSize:e,iframeDocument:t,maxContainerWidth:o=750,scale:r}){let[n,{height:i}]=(0,Cy.useResizeObserver)(),[s,{width:a,height:c}]=(0,Cy.useResizeObserver)(),u=(0,kn.useRef)(0),d=r!==1,f=(0,Cy.useReducedMotion)(),m=r==="auto-scaled",h=(0,kn.useRef)(!1),p=(0,kn.useRef)(null);(0,kn.useEffect)(()=>{d||(u.current=a)},[a,d]);let g=Math.max(u.current,a),b=m?CG({frameSize:e,containerWidth:a,maxContainerWidth:o,scaleContainerWidth:g}):r,v=(0,kn.useRef)({scaleValue:b,frameSize:e,containerHeight:0,scrollTop:0,scrollHeight:0}),k=(0,kn.useRef)({scaleValue:b,frameSize:e,containerHeight:0,scrollTop:0,scrollHeight:0}),y=(0,kn.useCallback)(()=>{let{scrollTop:C}=v.current,{scrollTop:B}=k.current;return t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-scroll-top",`${C}px`),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-scroll-top-next",`${B}px`),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-overflow-behavior",v.current.scrollHeight===v.current.containerHeight?"auto":"scroll"),t.documentElement.classList.add("zoom-out-animation"),t.documentElement.animate(p_e(v.current,k.current),{easing:"cubic-bezier(0.46, 0.03, 0.52, 0.96)",duration:400})},[t]),S=(0,kn.useCallback)(()=>{h.current=!1,p.current=null,t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-scale",k.current.scaleValue),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-frame-size",`${k.current.frameSize}px`),t.documentElement.classList.remove("zoom-out-animation"),t.documentElement.scrollTop=k.current.scrollTop,t.documentElement.style.removeProperty("--wp-block-editor-iframe-zoom-out-scroll-top"),t.documentElement.style.removeProperty("--wp-block-editor-iframe-zoom-out-scroll-top-next"),t.documentElement.style.removeProperty("--wp-block-editor-iframe-zoom-out-overflow-behavior"),v.current=k.current},[t]),x=(0,kn.useRef)(!1);return(0,kn.useEffect)(()=>{let C=t&&x.current!==d;if(x.current=d,!!C&&(h.current=!0,!!d))return t.documentElement.classList.add("is-zoomed-out"),()=>{t.documentElement.classList.remove("is-zoomed-out")}},[t,d]),(0,kn.useEffect)(()=>{if(t&&(m&&v.current.scaleValue!==1&&(v.current.scaleValue=CG({frameSize:v.current.frameSize,containerWidth:a,maxContainerWidth:o,scaleContainerWidth:a})),b<1&&(h.current||(t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-scale",b),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-frame-size",`${e}px`)),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-content-height",`${i}px`),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-inner-height",`${c}px`),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-container-width",`${a}px`),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-scale-container-width",`${g}px`)),h.current))if(h.current=!1,p.current){p.current.reverse();let C=v.current,B=k.current;v.current=B,k.current=C}else v.current.scrollTop=t.documentElement.scrollTop,v.current.scrollHeight=t.documentElement.scrollHeight,v.current.containerHeight=c,k.current={scaleValue:b,frameSize:e,containerHeight:t.documentElement.clientHeight},k.current.scrollHeight=f_e(v.current,k.current),k.current.scrollTop=m_e(v.current,k.current),p.current=y(),f?S():p.current.onfinish=S},[y,S,f,m,b,e,t,i,a,c,o,g]),{isZoomedOut:d,scaleContainerWidth:g,contentResizeListener:n,containerResizeListener:s}}var Rs=l(w(),1);function PG(e,t,o){let r={};for(let s in e)r[s]=e[s];if(e instanceof o.contentDocument.defaultView.MouseEvent){let s=o.getBoundingClientRect();r.clientX+=s.left,r.clientY+=s.top}let n=new t(e.type,r);r.defaultPrevented&&n.preventDefault(),!o.dispatchEvent(n)&&e.preventDefault()}function h_e(e){return(0,Vu.useRefEffect)(()=>{let{defaultView:t}=e;if(!t)return;let{frameElement:o}=t,r=e.documentElement,n=["dragover","mousemove"],i={};for(let s of n)i[s]=a=>{let u=Object.getPrototypeOf(a).constructor.name,d=window[u];PG(a,d,o)},r.addEventListener(s,i[s]);return()=>{for(let s of n)r.removeEventListener(s,i[s])}})}var EG=new WeakMap,g_e=globalThis.FinalizationRegistry?new globalThis.FinalizationRegistry(e=>URL.revokeObjectURL(e)):void 0;function b_e(e){let t=EG.get(e);if(t)return t;let o=`<!doctype html> <html> <head> <meta charset="utf-8"> <base href="${window.location.href}"> <script>window.frameElement._load()<\/script> <style> html{ height: auto !important; min-height: 100%; } /* Lowest specificity to not override global styles */ :where(body) { margin: 0; /* Default background color in case zoom out mode background colors the html element */ background-color: white; } </style> ${e.styles??""} ${e.scripts??""} </head> <body> <script>document.currentScript.parentElement.remove()<\/script> </body> </html>`;return t=URL.createObjectURL(new Blob([o],{type:"text/html"})),EG.set(e,t),g_e?.register(e,t),t}function k_e({contentRef:e,children:t,tabIndex:o=0,scale:r=1,frameSize:n=0,readonly:i,forwardedRef:s,title:a=(0,TG.__)("Editor canvas"),...c}){let{resolvedAssets:u,isPreviewMode:d}=(0,zD.useSelect)(T=>{let O=T(_).getSettings();return{resolvedAssets:O.__unstableResolvedAssets,isPreviewMode:O.isPreviewMode}},[]),[f,m]=(0,om.useState)(),[h,p]=(0,om.useState)([]),[g,b,v]=FD(),k=(0,Vu.useRefEffect)(T=>{T._load=()=>{m(T.contentDocument)};let O;function D(z){z.preventDefault()}function U(z){z.target.tagName==="A"&&z.target.getAttribute("href")?.startsWith("#")&&(z.preventDefault(),O.defaultView.location.hash=z.target.getAttribute("href").slice(1))}let{ownerDocument:G}=T;p(Array.from(G.body.classList).filter(z=>z.startsWith("admin-color-")||z.startsWith("post-type-")||z==="wp-embed-responsive"));function j(){let{contentDocument:z}=T,{documentElement:W}=z;O=z,W.classList.add("block-editor-iframe__html"),z.dir=G.dir;for(let ee of wG())z.getElementById(ee.id)||(z.head.appendChild(ee.cloneNode(!0)),d||console.warn(`${ee.id} was added to the iframe incorrectly. Please use block.json or enqueue_block_assets to add styles to the iframe.`,ee));O.addEventListener("dragover",D,!1),O.addEventListener("drop",D,!1),O.addEventListener("click",U)}return T.addEventListener("load",j),()=>{delete T._load,T.removeEventListener("load",j),O?.removeEventListener("dragover",D),O?.removeEventListener("drop",D),O?.removeEventListener("click",U)}},[]),{contentResizeListener:y,containerResizeListener:S,isZoomedOut:x,scaleContainerWidth:C}=BG({scale:r,frameSize:parseInt(n),iframeDocument:f}),B=(0,Vu.useDisabled)({isDisabled:!i}),I=(0,Vu.useMergeRefs)([h_e(f),e,b,B]),P=b_e(u),E=o>=0&&!d,L=(0,Rs.jsxs)(Rs.Fragment,{children:[E&&g,(0,Rs.jsx)("iframe",{...c,style:{...c.style,height:c.style?.height,border:0},ref:(0,Vu.useMergeRefs)([s,k]),tabIndex:o,src:P,title:a,onKeyDown:T=>{if(c.onKeyDown&&c.onKeyDown(T),T.currentTarget.ownerDocument!==T.target.ownerDocument){let{stopPropagation:O}=T.nativeEvent;T.nativeEvent.stopPropagation=()=>{},T.stopPropagation(),T.nativeEvent.stopPropagation=O,PG(T,window.KeyboardEvent,T.currentTarget)}},children:f&&(0,om.createPortal)((0,Rs.jsxs)("body",{ref:I,className:V("block-editor-iframe__body","editor-styles-wrapper",...h),children:[y,(0,Rs.jsx)(IG.__experimentalStyleProvider,{document:f,children:t})]}),f.documentElement)}),E&&v]});return(0,Rs.jsxs)("div",{className:"block-editor-iframe__container",children:[S,(0,Rs.jsx)("div",{className:V("block-editor-iframe__scale-container",x&&"is-zoomed-out"),style:{"--wp-block-editor-iframe-zoom-out-scale-container-width":x&&`${C}px`},children:L})]})}function v_e(e,t){return(0,zD.useSelect)(r=>r(_).getSettings().__internalIsInitialized,[])?(0,Rs.jsx)(k_e,{...e,forwardedRef:t}):null}var Mh=(0,om.forwardRef)(v_e);var x$=l(A(),1),Hh=l(R(),1),w$=l(F(),1);var P1={attribute:/\[\s*(?:(?<namespace>\*|[-\w\P{ASCII}]*)\|)?(?<name>[-\w\P{ASCII}]+)\s*(?:(?<operator>\W?=)\s*(?<value>.+?)\s*(\s(?<caseSensitive>[iIsS]))?\s*)?\]/gu,id:/#(?<name>[-\w\P{ASCII}]+)/gu,class:/\.(?<name>[-\w\P{ASCII}]+)/gu,comma:/\s*,\s*/g,combinator:/\s*[\s>+~]\s*/g,"pseudo-element":/::(?<name>[-\w\P{ASCII}]+)(?:\((?<argument>¶*)\))?/gu,"pseudo-class":/:(?<name>[-\w\P{ASCII}]+)(?:\((?<argument>¶*)\))?/gu,universal:/(?:(?<namespace>\*|[-\w\P{ASCII}]*)\|)?\*/gu,type:/(?:(?<namespace>\*|[-\w\P{ASCII}]*)\|)?(?<name>[-\w\P{ASCII}]+)/gu},y_e=new Set(["combinator","comma"]);var S_e=e=>{switch(e){case"pseudo-element":case"pseudo-class":return new RegExp(P1[e].source.replace("(?<argument>\xB6*)","(?<argument>.*)"),"gu");default:return P1[e]}};function __e(e,t){let o=0,r="";for(;t<e.length;t++){let n=e[t];switch(n){case"(":++o;break;case")":--o;break}if(r+=n,o===0)return r}return r}function x_e(e,t=P1){if(!e)return[];let o=[e];for(let[n,i]of Object.entries(t))for(let s=0;s<o.length;s++){let a=o[s];if(typeof a!="string")continue;i.lastIndex=0;let c=i.exec(a);if(!c)continue;let u=c.index-1,d=[],f=c[0],m=a.slice(0,u+1);m&&d.push(m),d.push({...c.groups,type:n,content:f});let h=a.slice(u+f.length+1);h&&d.push(h),o.splice(s,1,...d)}let r=0;for(let n of o)switch(typeof n){case"string":throw new Error(`Unexpected sequence ${n} found at index ${r}`);case"object":r+=n.content.length,n.pos=[r-n.content.length,r],y_e.has(n.type)&&(n.content=n.content.trim()||" ");break}return o}var w_e=/(['"])([^\\\n]+?)\1/g,C_e=/\\./g;function jD(e,t=P1){if(e=e.trim(),e==="")return[];let o=[];e=e.replace(C_e,(i,s)=>(o.push({value:i,offset:s}),"\uE000".repeat(i.length))),e=e.replace(w_e,(i,s,a,c)=>(o.push({value:i,offset:c}),`${s}${"\uE001".repeat(a.length)}${s}`));{let i=0,s;for(;(s=e.indexOf("(",i))>-1;){let a=__e(e,s);o.push({value:a,offset:s}),e=`${e.substring(0,s)}(${"\xB6".repeat(a.length-2)})${e.substring(s+a.length)}`,i=s+a.length}}let r=x_e(e,t),n=new Set;for(let i of o.reverse())for(let s of r){let{offset:a,value:c}=i;if(!(s.pos[0]<=a&&a+c.length<=s.pos[1]))continue;let{content:u}=s,d=a-s.pos[0];s.content=u.slice(0,d)+c+u.slice(d+c.length),s.content!==u&&n.add(s)}for(let i of n){let s=S_e(i.type);if(!s)throw new Error(`Unknown token type: ${i.type}`);s.lastIndex=0;let a=s.exec(i.content);if(!a)throw new Error(`Unable to parse content for ${i.type}: ${i.content}`);Object.assign(i,a.groups)}return r}function*I1(e,t){switch(e.type){case"list":for(let o of e.list)yield*I1(o,e);break;case"complex":yield*I1(e.left,e),yield*I1(e.right,e);break;case"compound":yield*e.list.map(o=>[o,e]);break;default:yield[e,t]}}function RG(e){let t;return Array.isArray(e)?t=e:t=[...I1(e)].map(([o])=>o),t.map(o=>o.content).join("")}var k$=l(XW(),1),v$=l(A1(),1),y$=l(e$(),1),S$=l(g$(),1),b$=new Map,_$=[{type:"type",content:"body"},{type:"type",content:"html"},{type:"pseudo-class",content:":root"},{type:"pseudo-class",content:":where(body)"},{type:"pseudo-class",content:":where(:root)"},{type:"pseudo-class",content:":where(html)"}];function D0e(e,t){let o=jD(t),r=o.findLastIndex(({content:s,type:a})=>_$.some(c=>s===c.content&&a===c.type)),n=-1;for(let s=r+1;s<o.length;s++)if(o[s].type==="combinator"){n=s;break}let i=jD(e);return o.splice(n===-1?o.length:n,0,{type:"combinator",content:" "},...i),RG(o)}function V0e({css:e,ignoredSelectors:t=[],baseURL:o},r="",n){if(!r&&!o)return e;try{let i=[...t,...n?.ignoredSelectors??[],r];return new k$.default([r&&(0,y$.default)({prefix:r,transform(s,a,c){return i.some(d=>d instanceof RegExp?a.match(d):a.includes(d))?a:_$.some(d=>a.startsWith(d.content))?D0e(s,a):c}}),o&&(0,S$.default)({rootUrl:o})].filter(Boolean)).process(e,{}).css}catch(i){return i instanceof v$.default?console.warn("wp.blockEditor.transformStyles Failed to transform CSS.",i.message+` `+i.showSourceCode(!1)):console.warn("wp.blockEditor.transformStyles Failed to transform CSS.",i),null}}var F0e=(e,t="",o)=>{let r=b$.get(t);return r||(r=new WeakMap,b$.set(t,r)),e.map(n=>{let i=r.get(n);return i||(i=V0e(n,t,o),r.set(n,i)),i})},Uh=F0e;var Uu=l(w(),1);Kc([Yc,Op]);function z0e(e,t){return(0,Hh.useCallback)(o=>{if(!o)return;let{ownerDocument:r}=o,{defaultView:n,body:i}=r,s=t?r.querySelector(t):i,a;if(s)a=n?.getComputedStyle(s,null).getPropertyValue("background-color");else{let u=r.createElement("div");u.classList.add("editor-styles-wrapper"),i.appendChild(u),a=n?.getComputedStyle(u,null).getPropertyValue("background-color"),i.removeChild(u)}let c=Bt(a);c.luminance()>.5||c.alpha()===0?i.classList.remove("is-dark-theme"):i.classList.add("is-dark-theme")},[e,t])}function j0e({styles:e,scope:t,transformOptions:o}){let r=(0,w$.useSelect)(s=>M(s(_)).getStyleOverrides(),[]),[n,i]=(0,Hh.useMemo)(()=>{let s=Object.values(e??[]);for(let[a,c]of r){let u=s.findIndex(({id:f})=>a===f),d={...c,id:a};u===-1?s.push(d):s[u]=d}return[Uh(s.filter(a=>a?.css),t,o),s.filter(a=>a.__unstableType==="svgs").map(a=>a.assets).join("")]},[e,r,t,o]);return(0,Uu.jsxs)(Uu.Fragment,{children:[(0,Uu.jsx)("style",{ref:z0e(n,t)}),n.map((s,a)=>(0,Uu.jsx)("style",{children:s},a)),(0,Uu.jsx)(x$.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 0 0",width:"0",height:"0",role:"none",style:{visibility:"hidden",position:"absolute",left:"-9999px",overflow:"hidden"},dangerouslySetInnerHTML:{__html:i}})]})}var Nl=(0,Hh.memo)(j0e);var Fi=l(w(),1),U0e=(0,q1.memo)(Gh),_5=2e3,H0e=[];function G0e({viewportWidth:e,containerWidth:t,minHeight:o,additionalStyles:r=H0e}){e||(e=t);let[n,{height:i}]=(0,Dy.useResizeObserver)(),{styles:s}=(0,C$.useSelect)(d=>({styles:d(_).getSettings().styles}),[]),a=(0,q1.useMemo)(()=>s&&[...s,{css:"body{height:auto;overflow:hidden;border:none;padding:0;}",__unstableType:"presets"},...r],[s,r]),c=t/e,u=i?t/(i*c):0;return(0,Fi.jsx)(B$.Disabled,{className:"block-editor-block-preview__content",style:{transform:`scale(${c})`,aspectRatio:u,maxHeight:i>_5?_5*c:void 0,minHeight:o},children:(0,Fi.jsxs)(Mh,{contentRef:(0,Dy.useRefEffect)(d=>{let{ownerDocument:{documentElement:f}}=d;f.classList.add("block-editor-block-preview__content-iframe"),f.style.position="absolute",f.style.width="100%",d.style.boxSizing="border-box",d.style.position="absolute",d.style.width="100%"},[]),"aria-hidden":!0,tabIndex:-1,style:{position:"absolute",width:e,height:i,pointerEvents:"none",maxHeight:_5,minHeight:c!==0&&c<1&&o?o/c:o},children:[(0,Fi.jsx)(Nl,{styles:a}),n,(0,Fi.jsx)(U0e,{renderAppender:!1})]})})}function E$(e){let[t,{width:o}]=(0,Dy.useResizeObserver)();return(0,Fi.jsxs)(Fi.Fragment,{children:[(0,Fi.jsx)("div",{style:{position:"relative",width:"100%",height:0},children:t}),(0,Fi.jsx)("div",{className:"block-editor-block-preview__container",children:!!o&&(0,Fi.jsx)(G0e,{...e,containerWidth:o})})]})}var Wh=l(R(),1),R$=l(I$(),1),P$=(0,R$.createQueue)();function O$({children:e,placeholder:t}){let[o,r]=(0,Wh.useState)(!1);return(0,Wh.useEffect)(()=>{let n={};return P$.add(n,()=>{(0,Wh.flushSync)(()=>{r(!0)})}),()=>{P$.cancel(n)}},[]),o?e:t}var am=l(w(),1),W0e=[];function $0e({blocks:e,viewportWidth:t=1200,minHeight:o,additionalStyles:r=W0e,__experimentalMinHeight:n,__experimentalPadding:i}){n&&(o=n,(0,x5.default)("The __experimentalMinHeight prop",{since:"6.2",version:"6.4",alternative:"minHeight"})),i&&(r=[...r,{css:`body { padding: ${i}px; }`}],(0,x5.default)("The __experimentalPadding prop of BlockPreview",{since:"6.2",version:"6.4",alternative:"additionalStyles"}));let s=(0,w5.useSelect)(u=>u(_).getSettings(),[]),a=(0,sm.useMemo)(()=>({...s,focusMode:!1,isPreviewMode:!0}),[s]),c=(0,sm.useMemo)(()=>Array.isArray(e)?e:[e],[e]);return!e||e.length===0?null:(0,am.jsx)(Ph,{value:c,settings:a,children:(0,am.jsx)(E$,{viewportWidth:t,minHeight:o,additionalStyles:r})})}var A$=(0,sm.memo)($0e);A$.Async=O$;var vn=A$;function L$({blocks:e,props:t={},layout:o}){let r=(0,w5.useSelect)(u=>u(_).getSettings(),[]),n=(0,sm.useMemo)(()=>({...r,styles:void 0,focusMode:!1,isPreviewMode:!0}),[r]),i=(0,Z1.useDisabled)(),s=(0,Z1.useMergeRefs)([t.ref,i]),a=(0,sm.useMemo)(()=>Array.isArray(e)?e:[e],[e]),c=(0,am.jsxs)(Ph,{value:a,settings:n,children:[(0,am.jsx)(Nl,{}),(0,am.jsx)(Vy,{renderAppender:!1,layout:o})]});return{...t,ref:s,className:V(t.className,"block-editor-block-preview__live-content","components-disabled"),children:e?.length?c:null}}var Hu=l(w(),1);function K0e({item:e}){let{name:t,title:o,icon:r,description:n,initialAttributes:i,example:s}=e,a=(0,$h.isReusableBlock)(e),c=(0,N$.useMemo)(()=>s?(0,$h.getBlockFromExample)(t,{attributes:{...s.attributes,...i},innerBlocks:s.innerBlocks}):(0,$h.createBlock)(t,i),[t,s,i]),u=144,d=280,f=s?.viewportWidth??500,m=d/f,h=m!==0&&m<1&&u?u/m:u;return(0,Hu.jsxs)("div",{className:"block-editor-inserter__preview-container",children:[(0,Hu.jsx)("div",{className:"block-editor-inserter__preview",children:a||s?(0,Hu.jsx)("div",{className:"block-editor-inserter__preview-content",children:(0,Hu.jsx)(vn,{blocks:c,viewportWidth:f,minHeight:u,additionalStyles:[{css:` body { padding: 24px; min-height:${Math.round(h)}px; display:flex; align-items:center; } .is-root-container { width: 100%; } `}]})}):(0,Hu.jsx)("div",{className:"block-editor-inserter__preview-content-missing",children:(0,M$.__)("No preview available.")})}),!a&&(0,Hu.jsx)(yy,{title:o,icon:r,description:n})]})}var X1=K0e;var Jh=l(N(),1),Vl=l(R(),1),R5=l(Z(),1);var Z$=l($(),1),X$=l(Z(),1);var Qh=l(R(),1),Gu=l($(),1),Y$=l(A(),1),Fy=l(it(),1);var G$=l(A(),1),W$=l(R(),1);var Kh=l(R(),1),D$=l(N(),1),V$=l(Xo(),1),F$=l(w(),1);function Y0e(e,t){let[o,r]=(0,Kh.useState)(!1);return(0,Kh.useEffect)(()=>{o&&(0,V$.speak)((0,D$.__)("Use left and right arrow keys to move through blocks"))},[o]),(0,F$.jsx)("div",{ref:t,role:"listbox","aria-orientation":"horizontal",onFocus:()=>{r(!0)},onBlur:n=>{!n.currentTarget.contains(n.relatedTarget)&&r(!1)},...e})}var C5=(0,Kh.forwardRef)(Y0e);var z$=l(R(),1),j$=l(A(),1),U$=l(w(),1);function q0e(e,t){return(0,U$.jsx)(j$.Composite.Group,{role:"presentation",ref:t,...e})}var B5=(0,z$.forwardRef)(q0e);var J1=l(A(),1),H$=l(R(),1),Q1=l(w(),1);function Z0e({isFirst:e,as:t,children:o,...r},n){return(0,Q1.jsx)(J1.Composite.Item,{ref:n,role:"option",accessibleWhenDisabled:!0,...r,render:i=>{let s={...i,tabIndex:e?0:i.tabIndex};return t?(0,Q1.jsx)(t,{...s,children:o}):typeof o=="function"?o(s):(0,Q1.jsx)(J1.Button,{__next40pxDefaultSize:!0,...s,children:o})}})}var E5=(0,H$.forwardRef)(Z0e);var T5=l(w(),1);function X0e({key:e,children:t}){return(0,T5.jsx)(W$.Fragment,{children:t},e)}function Q0e({children:e}){return(0,T5.jsx)(G$.Composite,{focusShift:!0,focusWrap:"horizontal",render:X0e,children:e})}var Yh=Q0e;var $$=l(A(),1),tB=l($(),1),oB=l(F(),1),K$=l(R(),1);var Zh=l(N(),1),qh=l(A(),1);var As=l(w(),1);function eB({count:e,icon:t,isPattern:o,fadeWhenDisabled:r}){let n=o&&(0,Zh.__)("Pattern");return(0,As.jsx)("div",{className:"block-editor-block-draggable-chip-wrapper",children:(0,As.jsx)("div",{className:"block-editor-block-draggable-chip","data-testid":"block-draggable-chip",children:(0,As.jsxs)(qh.Flex,{justify:"center",className:"block-editor-block-draggable-chip__content",children:[(0,As.jsx)(qh.FlexItem,{children:t?(0,As.jsx)(Ae,{icon:t}):n||(0,Zh.sprintf)((0,Zh._n)("%d block","%d blocks",e),e)}),(0,As.jsx)(qh.FlexItem,{children:(0,As.jsx)(Ae,{icon:tv})}),r&&(0,As.jsx)(qh.FlexItem,{className:"block-editor-block-draggable-chip__disabled",children:(0,As.jsx)("span",{className:"block-editor-block-draggable-chip__disabled-icon"})})]})})})}var I5=l(w(),1),J0e=({isEnabled:e,blocks:t,icon:o,children:r,pattern:n})=>{let i=t.length===1?t[0].name:void 0,s=(0,oB.useSelect)(f=>i&&f(tB.store).getBlockType(i)?.icon,[i]),{startDragging:a,stopDragging:c}=M((0,oB.useDispatch)(_)),u=(0,K$.useMemo)(()=>n?.type===Nt.user&&n?.syncStatus!=="unsynced"?[(0,tB.createBlock)("core/block",{ref:n.id})]:void 0,[n?.type,n?.syncStatus,n?.id]);if(!e)return r({draggable:!1,onDragStart:void 0,onDragEnd:void 0});let d=u??t;return(0,I5.jsx)($$.Draggable,{__experimentalTransferDataType:"wp-blocks",transferData:{type:"inserter",blocks:d},onDragStart:f=>{a();let m=new Set;for(let h of d){let p=`wp-block:${h.name}`;m.has(p)||(f.dataTransfer.items.add("",p),m.add(p))}},onDragEnd:()=>{c()},__experimentalDragComponent:(0,I5.jsx)(eB,{count:t.length,icon:o||!n&&s,isPattern:!!n}),children:({onDraggableStart:f,onDraggableEnd:m})=>r({draggable:!0,onDragStart:f,onDragEnd:m})})},Xh=J0e;var Ml=l(w(),1);function exe({className:e,isFirst:t,item:o,onSelect:r,onHover:n,isDraggable:i,...s}){let a=(0,Qh.useRef)(!1),c=o.icon?{backgroundColor:o.icon.background,color:o.icon.foreground}:{},u=(0,Qh.useMemo)(()=>[(0,Gu.createBlock)(o.name,o.initialAttributes,(0,Gu.createBlocksFromInnerBlocksTemplate)(o.innerBlocks))],[o.name,o.initialAttributes,o.innerBlocks]),d=(0,Gu.isReusableBlock)(o)&&o.syncStatus!=="unsynced"||(0,Gu.isTemplatePart)(o);return(0,Ml.jsx)(Xh,{isEnabled:i&&!o.isDisabled,blocks:u,icon:o.icon,children:({draggable:f,onDragStart:m,onDragEnd:h})=>(0,Ml.jsx)("div",{className:V("block-editor-block-types-list__list-item",{"is-synced":d}),draggable:f,onDragStart:p=>{a.current=!0,m&&(n(null),m(p))},onDragEnd:p=>{a.current=!1,h&&h(p)},children:(0,Ml.jsxs)(E5,{isFirst:t,className:V("block-editor-block-types-list__item",e),disabled:o.isDisabled,onClick:p=>{p.preventDefault(),r(o,(0,Fy.isAppleOS)()?p.metaKey:p.ctrlKey),n(null)},onKeyDown:p=>{let{keyCode:g}=p;g===Fy.ENTER&&(p.preventDefault(),r(o,(0,Fy.isAppleOS)()?p.metaKey:p.ctrlKey),n(null))},onMouseEnter:()=>{a.current||n(o)},onMouseLeave:()=>n(null),...s,children:[(0,Ml.jsx)("span",{className:"block-editor-block-types-list__item-icon",style:c,children:(0,Ml.jsx)(Ae,{icon:o.icon,showColors:!0})}),(0,Ml.jsx)("span",{className:"block-editor-block-types-list__item-title",children:(0,Ml.jsx)(Y$.__experimentalTruncate,{numberOfLines:3,children:o.title})})]})})})}var q$=(0,Qh.memo)(exe);var zy=l(w(),1);function txe(e,t){let o=[];for(let r=0,n=e.length;r<n;r+=t)o.push(e.slice(r,r+t));return o}function Q$({items:e=[],onSelect:t,onHover:o=()=>{},children:r,label:n,isDraggable:i=!0}){let s="block-editor-block-types-list",a=(0,X$.useInstanceId)(Q$,s);return(0,zy.jsxs)(C5,{className:s,"aria-label":n,children:[txe(e,3).map((c,u)=>(0,zy.jsx)(B5,{children:c.map((d,f)=>(0,zy.jsx)(q$,{item:d,className:(0,Z$.getBlockMenuDefaultClassName)(d.id),onSelect:t,onHover:o,isDraggable:i&&!d.isDisabled,isFirst:u===0&&f===0,rowId:`${a}-${u}`},d.id))},u)),r]})}var lm=Q$;var J$=l(A(),1),Dl=l(w(),1);function oxe({title:e,icon:t,children:o}){return(0,Dl.jsxs)(Dl.Fragment,{children:[(0,Dl.jsxs)("div",{className:"block-editor-inserter__panel-header",children:[(0,Dl.jsx)("h2",{className:"block-editor-inserter__panel-title",children:e}),(0,Dl.jsx)(J$.Icon,{icon:t})]}),(0,Dl.jsx)("div",{className:"block-editor-inserter__panel-content",children:o})]})}var Wu=oxe;var eK=l(N(),1),P5=l(w(),1);function rxe(){return(0,P5.jsx)("div",{className:"block-editor-inserter__no-results",children:(0,P5.jsx)("p",{children:(0,eK.__)("No results found.")})})}var Ls=rxe;var zo=l(w(),1),nxe=e=>e.name.split("/")[0],ixe=6,sxe=[];function tK({items:e,collections:t,categories:o,onSelectItem:r,onHover:n,showMostUsedBlocks:i,className:s}){let a=(0,Vl.useMemo)(()=>ma(e,"frecency","desc").slice(0,ixe),[e]),c=(0,Vl.useMemo)(()=>e.filter(p=>!p.category),[e]),u=(0,Vl.useMemo)(()=>{let p={...t};return Object.keys(t).forEach(g=>{p[g]=e.filter(b=>nxe(b)===g),p[g].length===0&&delete p[g]}),p},[e,t]);(0,Vl.useEffect)(()=>()=>n(null),[]);let d=(0,R5.useAsyncList)(o),f=o.length===d.length,m=(0,Vl.useMemo)(()=>Object.entries(t),[t]),h=(0,R5.useAsyncList)(f?m:sxe);return(0,zo.jsxs)("div",{className:s,children:[i&&e.length>3&&!!a.length&&(0,zo.jsx)(Wu,{title:(0,Jh._x)("Most used","blocks"),children:(0,zo.jsx)(lm,{items:a,onSelect:r,onHover:n,label:(0,Jh._x)("Most used","blocks")})}),d.map(p=>{let g=e.filter(b=>b.category===p.slug);return!g||!g.length?null:(0,zo.jsx)(Wu,{title:p.title,icon:p.icon,children:(0,zo.jsx)(lm,{items:g,onSelect:r,onHover:n,label:p.title})},p.slug)}),f&&c.length>0&&(0,zo.jsx)(Wu,{className:"block-editor-inserter__uncategorized-blocks-panel",title:(0,Jh.__)("Uncategorized"),children:(0,zo.jsx)(lm,{items:c,onSelect:r,onHover:n,label:(0,Jh.__)("Uncategorized")})}),h.map(([p,g])=>{let b=u[p];return!b||!b.length?null:(0,zo.jsx)(Wu,{title:g.title,icon:g.icon,children:(0,zo.jsx)(lm,{items:b,onSelect:r,onHover:n,label:g.title})},p)})]})}function axe({rootClientId:e,onInsert:t,onHover:o,showMostUsedBlocks:r},n){let[i,s,a,c]=ku(e,t);if(!i.length)return(0,zo.jsx)(Ls,{});let u=[],d=[];for(let f of i)f.category!=="reusable"&&(f.isSearchOnly||(f.isAllowedInCurrentRoot?u.push(f):d.push(f)));return(0,zo.jsx)(Yh,{children:(0,zo.jsxs)("div",{ref:n,children:[!!u.length&&(0,zo.jsx)(zo.Fragment,{children:(0,zo.jsx)(tK,{items:u,categories:s,collections:a,onSelectItem:c,onHover:o,showMostUsedBlocks:r,className:"block-editor-inserter__insertable-blocks-at-selection"})}),(0,zo.jsx)(tK,{items:d,categories:s,collections:a,onSelectItem:c,onHover:o,showMostUsedBlocks:r,className:"block-editor-inserter__all-blocks"})]})})}var oK=(0,Vl.forwardRef)(axe);var xK=l(R(),1),wK=l(Z(),1),CK=l(A(),1),BK=l(N(),1);var bK=l(A(),1),D5=l(R(),1),kK=l(N(),1);var rB=l(A(),1),O5=l(N(),1),Fl=l(w(),1);function lxe({selectedCategory:e,patternCategories:t,onClickCategory:o}){let r="block-editor-block-patterns-explorer__sidebar";return(0,Fl.jsx)("div",{className:`${r}__categories-list`,children:t.map(({name:n,label:i})=>(0,Fl.jsx)(rB.Button,{__next40pxDefaultSize:!0,label:i,className:`${r}__categories-list__item`,isPressed:e===n,onClick:()=>{o(n)},children:i},n))})}function cxe({searchValue:e,setSearchValue:t}){return(0,Fl.jsx)("div",{className:"block-editor-block-patterns-explorer__search",children:(0,Fl.jsx)(rB.SearchControl,{onChange:t,value:e,label:(0,O5.__)("Search"),placeholder:(0,O5.__)("Search")})})}function uxe({selectedCategory:e,patternCategories:t,onClickCategory:o,searchValue:r,setSearchValue:n}){return(0,Fl.jsxs)("div",{className:"block-editor-block-patterns-explorer__sidebar",children:[(0,Fl.jsx)(cxe,{searchValue:r,setSearchValue:n}),!r&&(0,Fl.jsx)(lxe,{selectedCategory:e,patternCategories:t,onClickCategory:o})]})}var rK=uxe;var jl=l(R(),1),rg=l(N(),1),fK=l(Z(),1),mK=l(A(),1),pK=l(Xo(),1);var nK=l($(),1),wa=l(R(),1),zl=l(A(),1),iK=l(Z(),1),sK=l(N(),1);var yn=l(A(),1),zi=l(N(),1),Br=l(w(),1);function nB({currentPage:e,numPages:t,changePage:o,totalItems:r}){return(0,Br.jsxs)(yn.__experimentalVStack,{className:"block-editor-patterns__grid-pagination-wrapper",children:[(0,Br.jsx)(yn.__experimentalText,{variant:"muted",children:(0,zi.sprintf)((0,zi._n)("%s item","%s items",r),r)}),t>1&&(0,Br.jsxs)(yn.__experimentalHStack,{expanded:!1,spacing:3,justify:"flex-start",className:"block-editor-patterns__grid-pagination",children:[(0,Br.jsxs)(yn.__experimentalHStack,{expanded:!1,spacing:1,className:"block-editor-patterns__grid-pagination-previous",children:[(0,Br.jsx)(yn.Button,{variant:"tertiary",onClick:()=>o(1),disabled:e===1,"aria-label":(0,zi.__)("First page"),size:"compact",accessibleWhenDisabled:!0,className:"block-editor-patterns__grid-pagination-button",children:(0,Br.jsx)("span",{children:"\xAB"})}),(0,Br.jsx)(yn.Button,{variant:"tertiary",onClick:()=>o(e-1),disabled:e===1,"aria-label":(0,zi.__)("Previous page"),size:"compact",accessibleWhenDisabled:!0,className:"block-editor-patterns__grid-pagination-button",children:(0,Br.jsx)("span",{children:"\u2039"})})]}),(0,Br.jsx)(yn.__experimentalText,{variant:"muted",children:(0,zi.sprintf)((0,zi._x)("%1$s of %2$s","paging"),e,t)}),(0,Br.jsxs)(yn.__experimentalHStack,{expanded:!1,spacing:1,className:"block-editor-patterns__grid-pagination-next",children:[(0,Br.jsx)(yn.Button,{variant:"tertiary",onClick:()=>o(e+1),disabled:e===t,"aria-label":(0,zi.__)("Next page"),size:"compact",accessibleWhenDisabled:!0,className:"block-editor-patterns__grid-pagination-button",children:(0,Br.jsx)("span",{children:"\u203A"})}),(0,Br.jsx)(yn.Button,{variant:"tertiary",onClick:()=>o(t),disabled:e===t,"aria-label":(0,zi.__)("Last page"),size:"compact",accessibleWhenDisabled:!0,className:"block-editor-patterns__grid-pagination-button",children:(0,Br.jsx)("span",{children:"\xBB"})})]})]})]})}var Yt=l(w(),1),dxe=({showTooltip:e,title:t,children:o})=>e?(0,Yt.jsx)(zl.Tooltip,{text:t,children:o}):(0,Yt.jsx)(Yt.Fragment,{children:o});function aK({id:e,isDraggable:t,pattern:o,onClick:r,onHover:n,showTitlesAsTooltip:i,category:s,isSelected:a}){let[c,u]=(0,wa.useState)(!1),{blocks:d,viewportWidth:f}=o,h=`block-editor-block-patterns-list__item-description-${(0,iK.useInstanceId)(aK)}`,p=o.type===Nt.user,g=(0,wa.useMemo)(()=>!s||!t?d:(d??[]).map(b=>{let v=(0,nK.cloneBlock)(b);return v.attributes.metadata?.categories?.includes(s)&&(v.attributes.metadata.categories=[s]),v}),[d,t,s]);return(0,Yt.jsx)(Xh,{isEnabled:t,blocks:g,pattern:o,children:({draggable:b,onDragStart:v,onDragEnd:k})=>(0,Yt.jsx)("div",{className:"block-editor-block-patterns-list__list-item",draggable:b,onDragStart:y=>{u(!0),v&&(n?.(null),v(y))},onDragEnd:y=>{u(!1),k&&k(y)},children:(0,Yt.jsx)(dxe,{showTooltip:i&&!p,title:o.title,children:(0,Yt.jsxs)(zl.Composite.Item,{render:(0,Yt.jsx)("div",{role:"option","aria-label":o.title,"aria-describedby":o.description?h:void 0,className:V("block-editor-block-patterns-list__item",{"block-editor-block-patterns-list__list-item-synced":o.type===Nt.user&&!o.syncStatus,"is-selected":a})}),id:e,onClick:()=>{r(o,d),n?.(null)},onMouseEnter:()=>{c||n?.(o)},onMouseLeave:()=>n?.(null),children:[(0,Yt.jsx)(vn.Async,{placeholder:(0,Yt.jsx)(fxe,{}),children:(0,Yt.jsx)(vn,{blocks:d,viewportWidth:f})}),(!i||p)&&(0,Yt.jsxs)(zl.__experimentalHStack,{className:"block-editor-patterns__pattern-details",spacing:2,children:[p&&!o.syncStatus&&(0,Yt.jsx)("div",{className:"block-editor-patterns__pattern-icon-wrapper",children:(0,Yt.jsx)(we,{className:"block-editor-patterns__pattern-icon",icon:Ei})}),(0,Yt.jsx)("div",{className:"block-editor-block-patterns-list__item-title",children:o.title})]}),!!o.description&&(0,Yt.jsx)(zl.VisuallyHidden,{id:h,children:o.description})]})})})})}function fxe(){return(0,Yt.jsx)("div",{className:"block-editor-block-patterns-list__item is-placeholder"})}function mxe({isDraggable:e,blockPatterns:t,onHover:o,onClickPattern:r,orientation:n,label:i=(0,sK.__)("Block patterns"),category:s,showTitlesAsTooltip:a,pagingProps:c},u){let[d,f]=(0,wa.useState)(void 0),[m,h]=(0,wa.useState)(null);(0,wa.useEffect)(()=>{let g=t[0]?.name;f(g)},[t]);let p=(g,b)=>{h(g.name),r(g,b)};return(0,Yt.jsxs)(zl.Composite,{orientation:n,activeId:d,setActiveId:f,role:"listbox",className:"block-editor-block-patterns-list","aria-label":i,ref:u,children:[t.map(g=>(0,Yt.jsx)(aK,{id:g.name,pattern:g,onClick:p,onHover:o,isDraggable:e,showTitlesAsTooltip:a,category:s,isSelected:!!m&&m===g.name},g.name)),c&&(0,Yt.jsx)(nB,{...c})]})}var Ca=(0,wa.forwardRef)(mxe);var cm=l(F(),1),cK=l($(),1),iB=l(N(),1),uK=l(Xo(),1),A5=l(R(),1);function lK({destinationRootClientId:e,destinationIndex:t,rootClientId:o,registry:r}){if(o===e)return t;let n=["",...r.select(_).getBlockParents(e),e],i=n.indexOf(o);return i!==-1?r.select(_).getBlockIndex(n[i+1])+1:r.select(_).getBlockOrder(o).length}function pxe({rootClientId:e="",insertionIndex:t,clientId:o,isAppender:r,onSelect:n,shouldFocusBlock:i=!0,selectBlockOnInsert:s=!0}){let a=(0,cm.useRegistry)(),{getSelectedBlock:c,getClosestAllowedInsertionPoint:u,isBlockInsertionPointVisible:d}=M((0,cm.useSelect)(_)),{destinationRootClientId:f,destinationIndex:m}=(0,cm.useSelect)(S=>{let{getSelectedBlockClientId:x,getBlockRootClientId:C,getBlockIndex:B,getBlockOrder:I,getInsertionPoint:P}=M(S(_)),E=x(),L=e,T,O=P();return t!==void 0?T=t:O&&O.hasOwnProperty("index")?(L=O?.rootClientId?O.rootClientId:e,T=O.index):o?T=B(o):!r&&E?(L=C(E),T=B(E)+1):T=I(L).length,{destinationRootClientId:L,destinationIndex:T}},[e,t,o,r]),{replaceBlocks:h,insertBlocks:p,showInsertionPoint:g,hideInsertionPoint:b,setLastFocus:v}=M((0,cm.useDispatch)(_)),k=(0,A5.useCallback)((S,x,C=!1,B)=>{(C||i||s)&&v(null);let I=c();!r&&I&&(0,cK.isUnmodifiedDefaultBlock)(I,"content")?h(I.clientId,S,null,i||C?0:null,x):p(S,r||B===void 0?m:lK({destinationRootClientId:f,destinationIndex:m,rootClientId:B,registry:a}),r||B===void 0?f:B,s,i||C?0:null,x);let P=Array.isArray(S)?S.length:1,E=(0,iB.sprintf)((0,iB._n)("%d block added.","%d blocks added.",P),P);(0,uK.speak)(E),n&&n(S)},[r,c,h,p,f,m,n,i,s,v,a]),y=(0,A5.useCallback)(S=>{if(S&&!d()){let x=u(S.name,f);x!==null&&g(x,lK({destinationRootClientId:f,destinationIndex:m,rootClientId:x,registry:a}))}else b()},[u,d,g,b,f,m,a]);return[f,k,y]}var $u=pxe;var eg=l(R(),1),sB=l($(),1),tg=l(F(),1),aB=l(N(),1),dK=l(Un(),1);var hxe=(e,t,o,r)=>{let n=(0,eg.useMemo)(()=>({[uu]:!!r}),[r]),i=(0,tg.useSelect)(p=>{let{getSettings:g}=M(p(_));return g()[w0]??!1},[]),{patternCategories:s,patterns:a,userPatternCategories:c}=(0,tg.useSelect)(p=>{let{getSettings:g,__experimentalGetAllowedPatterns:b}=M(p(_)),{__experimentalUserPatternCategories:v,__experimentalBlockPatternCategories:k}=g();return{patterns:b(t,n),userPatternCategories:v,patternCategories:k}},[t,n]),u=(0,eg.useMemo)(()=>a.filter(p=>!(p.categories?.includes("navigation")&&!i)),[a,i]),{getClosestAllowedInsertionPointForPattern:d}=M((0,tg.useSelect)(_)),f=(0,eg.useMemo)(()=>{let p=[...s];return c?.forEach(g=>{p.find(b=>b.name===g.name)||p.push(g)}),p},[s,c]),{createSuccessNotice:m}=(0,tg.useDispatch)(dK.store),h=(0,eg.useCallback)((p,g)=>{let b=r?t:d(p,t);if(b===null)return;let v=p.type===Nt.user&&p.syncStatus!=="unsynced"?[(0,sB.createBlock)("core/block",{ref:p.id})]:g;e((v??[]).map(k=>{let y=(0,sB.cloneBlock)(k);return y.attributes.metadata?.categories?.includes(o)&&(y.attributes.metadata.categories=[o]),y}),p.name,!1,b),m((0,aB.sprintf)((0,aB.__)('Block pattern "%s" inserted.'),p.title),{type:"snackbar",id:"inserter-notice"})},[m,e,o,t,d,r]);return[u,f,h]},Ku=hxe;var og=l(R(),1),L5=l(Z(),1),N5=l(Fe(),1),lB=20;function cB(e,t,o,r=""){let[n,i]=(0,og.useState)(1),s=(0,L5.usePrevious)(t),a=(0,L5.usePrevious)(r);(s!==t||a!==r)&&n!==1&&i(1);let c=e.length,u=n-1,d=(0,og.useMemo)(()=>e.slice(u*lB,u*lB+lB),[u,e]),f=Math.ceil(e.length/lB),m=h=>{(0,N5.getScrollContainer)(o?.current)?.scrollTo(0,0),i(h)};return(0,og.useEffect)(function(){(0,N5.getScrollContainer)(o?.current)?.scrollTo(0,0)},[t,o]),{totalItems:c,categoryPatterns:d,numPages:f,changePage:m,currentPage:n}}var Ns=l(w(),1);function gxe({filterValue:e,filteredBlockPatternsLength:t}){return e?(0,Ns.jsx)(mK.__experimentalHeading,{level:2,lineHeight:"48px",className:"block-editor-block-patterns-explorer__search-results-count",children:(0,rg.sprintf)((0,rg._n)("%d pattern found","%d patterns found",t),t)}):null}function bxe({searchValue:e,selectedCategory:t,patternCategories:o,rootClientId:r,onModalClose:n}){let i=(0,jl.useRef)(),s=(0,fK.useDebounce)(pK.speak,500),[a,c]=$u({rootClientId:r,shouldFocusBlock:!0}),[u,,d]=Ku(c,a,t),f=(0,jl.useMemo)(()=>o.map(v=>v.name),[o]),m=(0,jl.useMemo)(()=>{let v=u.filter(k=>{if(t===Vf.name||t===Sl.name&&k.type===Nt.user||t===Kp.name&&k.blockTypes?.includes("core/post-content"))return!0;if(t==="uncategorized"){let y=k.categories?.some(S=>f.includes(S))??!1;return!k.categories?.length||!y}return k.categories?.includes(t)});return e?zv(v,e):v},[e,u,t,f]);(0,jl.useEffect)(()=>{if(!e)return;let v=m.length,k=(0,rg.sprintf)((0,rg._n)("%d result found.","%d results found.",v),v);s(k)},[e,s,m.length]);let h=cB(m,t,i),[p,g]=(0,jl.useState)(e);e!==p&&(g(e),h.changePage(1));let b=!!m?.length;return(0,Ns.jsxs)("div",{className:"block-editor-block-patterns-explorer__list",ref:i,children:[(0,Ns.jsx)(gxe,{filterValue:e,filteredBlockPatternsLength:m.length}),(0,Ns.jsx)(Yh,{children:b&&(0,Ns.jsxs)(Ns.Fragment,{children:[(0,Ns.jsx)(Ca,{blockPatterns:h.categoryPatterns,onClickPattern:(v,k)=>{d(v,k),n()},isDraggable:!1}),(0,Ns.jsx)(nB,{...h})]})})]})}var hK=bxe;var M5=l(R(),1),ng=l(N(),1),gK=l(Xo(),1);function kxe(e,t){return!e.categories||!e.categories.length?!1:e.categories.some(o=>t.some(r=>r.name===o))}function ig(e,t="all"){let[o,r]=Ku(void 0,e),n=(0,M5.useMemo)(()=>t==="all"?o:o.filter(s=>!Iw(s,t)),[t,o]);return(0,M5.useMemo)(()=>{let s=r.filter(a=>n.some(c=>c.categories?.includes(a.name))).sort((a,c)=>a.label.localeCompare(c.label));return n.some(a=>!kxe(a,r))&&!s.find(a=>a.name==="uncategorized")&&s.push({name:"uncategorized",label:(0,ng._x)("Uncategorized")}),n.some(a=>a.blockTypes?.includes("core/post-content"))&&s.unshift(Kp),n.some(a=>a.type===Nt.user)&&s.unshift(Sl),n.length>0&&s.unshift({name:Vf.name,label:Vf.label}),(0,gK.speak)((0,ng.sprintf)((0,ng._n)("%d category button displayed.","%d category buttons displayed.",s.length),s.length)),s},[r,n])}var um=l(w(),1);function vxe({initialCategory:e,rootClientId:t,onModalClose:o}){let[r,n]=(0,D5.useState)(""),[i,s]=(0,D5.useState)(e?.name),a=ig(t);return(0,um.jsxs)("div",{className:"block-editor-block-patterns-explorer",children:[(0,um.jsx)(rK,{selectedCategory:i,patternCategories:a,onClickCategory:s,searchValue:r,setSearchValue:n}),(0,um.jsx)(hK,{searchValue:r,selectedCategory:i,patternCategories:a,rootClientId:t,onModalClose:o})]})}function yxe({onModalClose:e,...t}){return(0,um.jsx)(bK.Modal,{title:(0,kK.__)("Patterns"),onRequestClose:e,isFullScreen:!0,children:(0,um.jsx)(vxe,{onModalClose:e,...t})})}var vK=yxe;var sg=l(N(),1),Dt=l(A(),1);var Jo=l(w(),1);function Sxe({title:e}){return(0,Jo.jsx)(Dt.__experimentalVStack,{spacing:0,children:(0,Jo.jsx)(Dt.__experimentalView,{children:(0,Jo.jsx)(Dt.__experimentalSpacer,{marginBottom:0,paddingX:4,paddingY:3,children:(0,Jo.jsxs)(Dt.__experimentalHStack,{spacing:2,children:[(0,Jo.jsx)(Dt.Navigator.BackButton,{style:{minWidth:24,padding:0},icon:(0,sg.isRTL)()?Vo:Mr,size:"small",label:(0,sg.__)("Back")}),(0,Jo.jsx)(Dt.__experimentalSpacer,{children:(0,Jo.jsx)(Dt.__experimentalHeading,{level:5,children:e})})]})})})})}function uB({categories:e,children:t}){return(0,Jo.jsxs)(Dt.Navigator,{initialPath:"/",className:"block-editor-inserter__mobile-tab-navigation",children:[(0,Jo.jsx)(Dt.Navigator.Screen,{path:"/",children:(0,Jo.jsx)(Dt.__experimentalItemGroup,{children:e.map(o=>(0,Jo.jsx)(Dt.Navigator.Button,{path:`/category/${o.name}`,as:Dt.__experimentalItem,isAction:!0,children:(0,Jo.jsxs)(Dt.__experimentalHStack,{children:[(0,Jo.jsx)(Dt.FlexBlock,{children:o.label}),(0,Jo.jsx)(we,{icon:(0,sg.isRTL)()?Mr:Vo})]})},o.name))})}),e.map(o=>(0,Jo.jsxs)(Dt.Navigator.Screen,{path:`/category/${o.name}`,children:[(0,Jo.jsx)(Sxe,{title:(0,sg.__)("Back")}),t(o)]},o.name))]})}var ji=l(R(),1),V5=l(N(),1),Ms=l(A(),1);var _n=l(A(),1),Sn=l(N(),1);var dB=l(R(),1);var hr=l(w(),1),yK=e=>e!=="all"&&e!=="user",_xe=e=>e.name===Sl.name,xxe=[{value:"all",label:(0,Sn._x)("All","patterns")},{value:Nt.directory,label:(0,Sn.__)("Pattern Directory")},{value:Nt.theme,label:(0,Sn.__)("Theme & Plugins")},{value:Nt.user,label:(0,Sn.__)("User")}];function SK({setPatternSyncFilter:e,setPatternSourceFilter:t,patternSyncFilter:o,patternSourceFilter:r,scrollContainerRef:n,category:i}){let s=i.name===Sl.name?Nt.user:r,a=yK(s),c=_xe(i),u=(0,dB.useMemo)(()=>[{value:"all",label:(0,Sn._x)("All","patterns")},{value:Tv.full,label:(0,Sn._x)("Synced","patterns"),disabled:a},{value:Tv.unsynced,label:(0,Sn._x)("Not synced","patterns"),disabled:a}],[a]);function d(f){t(f),yK(f)&&e("all")}return(0,hr.jsx)(hr.Fragment,{children:(0,hr.jsx)(_n.DropdownMenu,{popoverProps:{placement:"right-end"},label:(0,Sn.__)("Filter patterns"),toggleProps:{size:"compact"},icon:(0,hr.jsx)(we,{icon:(0,hr.jsx)(_n.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,hr.jsx)(_n.Path,{d:"M10 17.5H14V16H10V17.5ZM6 6V7.5H18V6H6ZM8 12.5H16V11H8V12.5Z",fill:"currentColor"})})}),children:()=>(0,hr.jsxs)(hr.Fragment,{children:[!c&&(0,hr.jsx)(_n.MenuGroup,{label:(0,Sn.__)("Source"),children:(0,hr.jsx)(_n.MenuItemsChoice,{choices:xxe,onSelect:f=>{d(f),n.current?.scrollTo(0,0)},value:s})}),(0,hr.jsx)(_n.MenuGroup,{label:(0,Sn.__)("Type"),children:(0,hr.jsx)(_n.MenuItemsChoice,{choices:u,onSelect:f=>{e(f),n.current?.scrollTo(0,0)},value:o})}),(0,hr.jsx)("div",{className:"block-editor-inserter__patterns-filter-help",children:(0,dB.createInterpolateElement)((0,Sn.__)("Patterns are available from the <Link>WordPress.org Pattern Directory</Link>, bundled in the active theme, or created by users on this site. Only patterns created on this site can be synced."),{Link:(0,hr.jsx)(_n.ExternalLink,{href:(0,Sn.__)("https://wordpress.org/patterns/")})})})]})})})}var $r=l(w(),1),wxe=()=>{};function fB({rootClientId:e,onInsert:t,onHover:o=wxe,category:r,showTitlesAsTooltip:n}){let[i,,s]=Ku(t,e,r?.name),[a,c]=(0,ji.useState)("all"),[u,d]=(0,ji.useState)("all"),f=ig(e,u),m=(0,ji.useRef)(),h=(0,ji.useMemo)(()=>i.filter(k=>Iw(k,u,a)?!1:r.name===Vf.name||r.name===Sl.name&&k.type===Nt.user||r.name===Kp.name&&k.blockTypes?.includes("core/post-content")?!0:r.name==="uncategorized"?k.categories?!k.categories.some(y=>f.some(S=>S.name===y)):!0:k.categories?.includes(r.name)),[i,f,r.name,u,a]),p=cB(h,r,m),{changePage:g}=p;(0,ji.useEffect)(()=>()=>o(null),[]);let b=(0,ji.useCallback)(k=>{c(k),g(1)},[c,g]),v=(0,ji.useCallback)(k=>{d(k),g(1)},[d,g]);return(0,$r.jsxs)($r.Fragment,{children:[(0,$r.jsxs)(Ms.__experimentalVStack,{spacing:2,className:"block-editor-inserter__patterns-category-panel-header",children:[(0,$r.jsxs)(Ms.__experimentalHStack,{children:[(0,$r.jsx)(Ms.FlexBlock,{children:(0,$r.jsx)(Ms.__experimentalHeading,{className:"block-editor-inserter__patterns-category-panel-title",size:13,level:4,as:"div",children:r.label})}),(0,$r.jsx)(SK,{patternSyncFilter:a,patternSourceFilter:u,setPatternSyncFilter:b,setPatternSourceFilter:v,scrollContainerRef:m,category:r})]}),!h.length&&(0,$r.jsx)(Ms.__experimentalText,{variant:"muted",className:"block-editor-inserter__patterns-category-no-results",children:(0,V5.__)("No results found")})]}),h.length>0&&(0,$r.jsxs)($r.Fragment,{children:[(0,$r.jsx)(Ms.__experimentalText,{size:"12",as:"p",className:"block-editor-inserter__help-text",children:(0,V5.__)("Drag and drop patterns into the canvas.")}),(0,$r.jsx)(Ca,{ref:m,blockPatterns:p.categoryPatterns,onClickPattern:s,onHover:o,label:r.label,orientation:"vertical",category:r.name,isDraggable:!0,showTitlesAsTooltip:n,patternFilter:u,pagingProps:p})]})]})}var pB=l(Z(),1),hB=l(A(),1),_K=l(R(),1);var dm=l(w(),1),{Tabs:mB}=M(hB.privateApis);function Cxe({categories:e,selectedCategory:t,onSelectCategory:o,children:r}){let s={type:"tween",duration:(0,pB.useReducedMotion)()?0:.25,ease:[.6,0,.4,1]},a=(0,pB.usePrevious)(t),c=t?t.name:null,[u,d]=(0,_K.useState)(),f=e?.[0]?.name;return c===null&&!u&&f&&d(f),(0,dm.jsxs)(mB,{selectOnMove:!1,selectedTabId:c,orientation:"vertical",onSelect:m=>{o(e.find(h=>h.name===m))},activeTabId:u,onActiveTabIdChange:d,children:[(0,dm.jsx)(mB.TabList,{className:"block-editor-inserter__category-tablist",children:e.map(m=>(0,dm.jsx)(mB.Tab,{tabId:m.name,"aria-current":m===t?"true":void 0,children:m.label},m.name))}),e.map(m=>(0,dm.jsx)(mB.TabPanel,{tabId:m.name,focusable:!1,children:(0,dm.jsx)(hB.__unstableMotion.div,{className:"block-editor-inserter__category-panel",initial:a?"open":"closed",animate:"open",variants:{open:{transform:"translateX( 0 )",transitionEnd:{zIndex:"1"}},closed:{transform:"translateX( -100% )",zIndex:"-1"}},transition:s,children:r})},m.name))]})}var gB=Cxe;var Kn=l(w(),1);function Bxe({onSelectCategory:e,selectedCategory:t,onInsert:o,rootClientId:r,children:n}){let[i,s]=(0,xK.useState)(!1),a=ig(r),c=(0,wK.useViewportMatch)("medium","<");return a.length?(0,Kn.jsxs)(Kn.Fragment,{children:[!c&&(0,Kn.jsxs)("div",{className:"block-editor-inserter__block-patterns-tabs-container",children:[(0,Kn.jsx)(gB,{categories:a,selectedCategory:t,onSelectCategory:e,children:n}),(0,Kn.jsx)(CK.Button,{__next40pxDefaultSize:!0,className:"block-editor-inserter__patterns-explore-button",onClick:()=>s(!0),variant:"secondary",children:(0,BK.__)("Explore all patterns")})]}),c&&(0,Kn.jsx)(uB,{categories:a,children:u=>(0,Kn.jsx)("div",{className:"block-editor-inserter__category-panel",children:(0,Kn.jsx)(fB,{onInsert:o,rootClientId:r,category:u},u.name)})}),i&&(0,Kn.jsx)(vK,{initialCategory:t||a[0],patternCategories:a,onModalClose:()=>s(!1),rootClientId:r})]}):(0,Kn.jsx)(Ls,{})}var EK=Bxe;var GK=l(N(),1),WK=l(Z(),1),$K=l(A(),1),vB=l(R(),1);var kB=l(A(),1),zK=l(N(),1),jK=l(Z(),1);var NK=l(A(),1),MK=l(N(),1);var Vt=l(A(),1),Yn=l(N(),1),Ba=l(R(),1),z5=l($(),1);var jy=l(F(),1),RK=l(Un(),1),OK=l(F5(),1),AK=l(dn(),1);var IK=l($(),1),PK=l(w(),1),Exe={image:"img",video:"video",audio:"audio"};function bB(e,t){let o={id:e.id||void 0,caption:e.caption||void 0},r=e.url,n=e.alt||void 0;t==="image"?(o.url=r,o.alt=n):["video","audio"].includes(t)&&(o.src=r);let i=Exe[t],s=(0,PK.jsx)(i,{src:e.previewUrl||r,alt:n,controls:t==="audio"?!0:void 0,inert:"true",onError:({currentTarget:a})=>{a.src===e.previewUrl&&(a.src=r)}});return[(0,IK.createBlock)(`core/${t}`,o),s]}var st=l(w(),1),Txe=["image"],Ixe={placement:"bottom-end",className:"block-editor-inserter__media-list__item-preview-options__popover"};function Pxe({category:e,media:t}){if(!e.getReportUrl)return null;let o=e.getReportUrl(t);return(0,st.jsx)(Vt.DropdownMenu,{className:"block-editor-inserter__media-list__item-preview-options",label:(0,Yn.__)("Options"),popoverProps:Ixe,icon:ks,children:()=>(0,st.jsx)(Vt.MenuGroup,{children:(0,st.jsx)(Vt.MenuItem,{onClick:()=>window.open(o,"_blank").focus(),icon:vA,children:(0,Yn.sprintf)((0,Yn.__)("Report %s"),e.mediaType)})})})}function Rxe({onClose:e,onSubmit:t}){return(0,st.jsxs)(Vt.Modal,{title:(0,Yn.__)("Insert external image"),onRequestClose:e,className:"block-editor-inserter-media-tab-media-preview-inserter-external-image-modal",children:[(0,st.jsxs)(Vt.__experimentalVStack,{spacing:3,children:[(0,st.jsx)("p",{children:(0,Yn.__)("This image cannot be uploaded to your Media Library, but it can still be inserted as an external image.")}),(0,st.jsx)("p",{children:(0,Yn.__)("External images can be removed by the external provider without warning and could even have legal compliance issues related to privacy legislation.")})]}),(0,st.jsxs)(Vt.Flex,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1,children:[(0,st.jsx)(Vt.FlexItem,{children:(0,st.jsx)(Vt.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:e,children:(0,Yn.__)("Cancel")})}),(0,st.jsx)(Vt.FlexItem,{children:(0,st.jsx)(Vt.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:t,children:(0,Yn.__)("Insert")})})]})]})}function LK({media:e,onClick:t,category:o}){let[r,n]=(0,Ba.useState)(!1),[i,s]=(0,Ba.useState)(!1),[a,c]=(0,Ba.useState)(!1),[u,d]=(0,Ba.useMemo)(()=>bB(e,o.mediaType),[e,o.mediaType]),{createErrorNotice:f,createSuccessNotice:m}=(0,jy.useDispatch)(RK.store),{getSettings:h,getBlock:p}=(0,jy.useSelect)(_),{updateBlockAttributes:g}=(0,jy.useDispatch)(_),b=(0,Ba.useCallback)(S=>{if(a)return;let x=h(),C=(0,z5.cloneBlock)(S),{id:B,url:I,caption:P}=C.attributes;if(!B&&!x.mediaUpload){n(!0);return}if(B){t(C);return}c(!0),window.fetch(I).then(E=>E.blob()).then(E=>{let L=(0,AK.getFilename)(I)||"image.jpg",T=new File([E],L,{type:E.type});x.mediaUpload({filesList:[T],additionalData:{caption:P},onFileChange([O]){(0,OK.isBlobURL)(O.url)||(p(C.clientId)?g(C.clientId,{...C.attributes,id:O.id,url:O.url}):(t({...C,attributes:{...C.attributes,id:O.id,url:O.url}}),m((0,Yn.__)("Image uploaded and inserted."),{type:"snackbar",id:"inserter-notice"})),c(!1))},allowedTypes:Txe,onError(O){f(O,{type:"snackbar",id:"inserter-notice"}),c(!1)}})}).catch(()=>{n(!0),c(!1)})},[a,h,t,m,g,f,p]),v=typeof e.title=="string"?e.title:e.title?.rendered||(0,Yn.__)("no title"),k=(0,Ba.useCallback)(()=>s(!0),[]),y=(0,Ba.useCallback)(()=>s(!1),[]);return(0,st.jsxs)(st.Fragment,{children:[(0,st.jsx)(Xh,{isEnabled:!0,blocks:[u],children:({draggable:S,onDragStart:x,onDragEnd:C})=>(0,st.jsx)("div",{className:V("block-editor-inserter__media-list__list-item",{"is-hovered":i}),draggable:S,onDragStart:x,onDragEnd:C,children:(0,st.jsxs)("div",{onMouseEnter:k,onMouseLeave:y,children:[(0,st.jsx)(Vt.Tooltip,{text:v,children:(0,st.jsx)(Vt.Composite.Item,{render:(0,st.jsx)("div",{"aria-label":v,role:"option",className:"block-editor-inserter__media-list__item"}),onClick:()=>b(u),children:(0,st.jsxs)("div",{className:"block-editor-inserter__media-list__item-preview",children:[d,a&&(0,st.jsx)("div",{className:"block-editor-inserter__media-list__item-preview-spinner",children:(0,st.jsx)(Vt.Spinner,{})})]})})}),!a&&(0,st.jsx)(Pxe,{category:o,media:e})]})})}),r&&(0,st.jsx)(Rxe,{onClose:()=>n(!1),onSubmit:()=>{t((0,z5.cloneBlock)(u)),m((0,Yn.__)("Image inserted."),{type:"snackbar",id:"inserter-notice"}),n(!1)}})]})}var j5=l(w(),1);function Oxe({mediaList:e,category:t,onClick:o,label:r=(0,MK.__)("Media List")}){return(0,j5.jsx)(NK.Composite,{role:"listbox",className:"block-editor-inserter__media-list","aria-label":r,children:e.map((n,i)=>(0,j5.jsx)(LK,{media:n,category:t,onClick:o},n.id||n.sourceId||i))})}var DK=Oxe;var Ul=l(R(),1),U5=l(F(),1);function VK(e,t={}){let[o,r]=(0,Ul.useState)(),[n,i]=(0,Ul.useState)(!1),s=(0,Ul.useRef)();return(0,Ul.useEffect)(()=>{(async()=>{let a=JSON.stringify({category:e.name,...t});s.current=a,i(!0),r([]);let c=await e.fetch?.(t);a===s.current&&(r(c),i(!1))})()},[e.name,...Object.values(t)]),{mediaList:o,isLoading:n}}function FK(e){let[t,o]=(0,Ul.useState)([]),r=(0,U5.useSelect)(a=>M(a(_)).getInserterMediaCategories(),[]),{canInsertImage:n,canInsertVideo:i,canInsertAudio:s}=(0,U5.useSelect)(a=>{let{canInsertBlockType:c}=a(_);return{canInsertImage:c("core/image",e),canInsertVideo:c("core/video",e),canInsertAudio:c("core/audio",e)}},[e]);return(0,Ul.useEffect)(()=>{(async()=>{let a=[];if(!r)return;let c=new Map(await Promise.all(r.map(async d=>{if(d.isExternalResource)return[d.name,!0];let f=[];try{f=await d.fetch({per_page:1})}catch{}return[d.name,!!f.length]}))),u={image:n,video:i,audio:s};r.forEach(d=>{u[d.mediaType]&&c.get(d.name)&&a.push(d)}),a.length&&o(a)})()},[n,i,s,r]),t}var Yu=l(w(),1),Axe=10;function Uy({rootClientId:e,onInsert:t,category:o}){let[r,n,i]=(0,jK.useDebouncedInput)(),{mediaList:s,isLoading:a}=VK(o,{per_page:i?20:Axe,search:i}),c="block-editor-inserter__media-panel",u=o.labels.search_items||(0,zK.__)("Search");return(0,Yu.jsxs)("div",{className:c,children:[(0,Yu.jsx)(kB.SearchControl,{className:`${c}-search`,onChange:n,value:r,label:u,placeholder:u}),a&&(0,Yu.jsx)("div",{className:`${c}-spinner`,children:(0,Yu.jsx)(kB.Spinner,{})}),!a&&!s?.length&&(0,Yu.jsx)(Ls,{}),!a&&!!s?.length&&(0,Yu.jsx)(DK,{rootClientId:e,onClick:t,mediaList:s,category:o})]})}var UK=l(F(),1);function Lxe({fallback:e=null,children:t}){return(0,UK.useSelect)(r=>{let{getSettings:n}=r(_);return!!n().mediaUpload},[])?t:e}var Ds=Lxe;var HK=l(A(),1),Nxe=()=>null,qu=(0,HK.withFilters)("editor.MediaUpload")(Nxe);var qn=l(w(),1),Mxe=["image","video","audio"];function Dxe({rootClientId:e,selectedCategory:t,onSelectCategory:o,onInsert:r,children:n}){let i=FK(e),s=(0,WK.useViewportMatch)("medium","<"),a="block-editor-inserter__media-tabs",c=(0,vB.useCallback)(d=>{if(!d?.url)return;let f=window.__experimentalDataViewsMediaModal&&d.mime_type?d.mime_type.split("/")[0]:d.type,[m]=bB(d,f);r(m)},[r]),u=(0,vB.useMemo)(()=>i.map(d=>({...d,label:d.labels.name})),[i]);return u.length?(0,qn.jsxs)(qn.Fragment,{children:[!s&&(0,qn.jsxs)("div",{className:`${a}-container`,children:[(0,qn.jsx)(gB,{categories:u,selectedCategory:t,onSelectCategory:o,children:n}),(0,qn.jsx)(Ds,{children:(0,qn.jsx)(qu,{multiple:!1,onSelect:c,allowedTypes:Mxe,render:({open:d})=>(0,qn.jsx)($K.Button,{__next40pxDefaultSize:!0,onClick:f=>{f.target.focus(),d()},className:"block-editor-inserter__media-library-button",variant:"secondary","data-unstable-ignore-focus-outside-for-relatedtarget":".media-modal",children:(0,GK.__)("Open Media Library")})})})]}),s&&(0,qn.jsx)(uB,{categories:u,children:d=>(0,qn.jsx)(Uy,{onInsert:r,rootClientId:e,category:d})})]}):(0,qn.jsx)(Ls,{})}var H5=Dxe;var Hy=l(R(),1),Zu=l(N(),1),G5=l(A(),1),SB=l(Z(),1),qK=l(Xo(),1),ZK=l(F(),1);var KK=l(A(),1),{Fill:YK,Slot:Vxe}=(0,KK.createSlotFill)("__unstableInserterMenuExtension");YK.Slot=Vxe;var yB=YK;var xn=l(w(),1),Fxe=9,zxe=[];function jxe({filterValue:e,onSelect:t,onHover:o,onHoverPattern:r,rootClientId:n,clientId:i,isAppender:s,__experimentalInsertionIndex:a,maxBlockPatterns:c,maxBlockTypes:u,showBlockDirectory:d=!1,isDraggable:f=!0,shouldFocusBlock:m=!0,prioritizePatterns:h,selectBlockOnInsert:p,isQuick:g}){let b=(0,SB.useDebounce)(qK.speak,500),{prioritizedBlocks:v}=(0,ZK.useSelect)(j=>({prioritizedBlocks:j(_).getBlockListSettings(n)?.prioritizedInserterBlocks||zxe}),[n]),[k,y]=$u({onSelect:t,rootClientId:n,clientId:i,isAppender:s,insertionIndex:a,shouldFocusBlock:m,selectBlockOnInsert:p}),[S,x,C,B]=ku(k,y,g),[I,,P]=Ku(y,k,void 0,g),E=(0,Hy.useMemo)(()=>{if(c===0)return[];let j=zv(I,e);return c!==void 0?j.slice(0,c):j},[e,I,c]),L=u;h&&E.length>2&&(L=0);let T=(0,Hy.useMemo)(()=>{if(L===0)return[];let j=S.filter(ee=>ee.name!=="core/block"),z=ma(j,"frecency","desc");!e&&v.length&&(z=Qw(z,v));let W=qw(z,x,C,e);return L!==void 0?W.slice(0,L):W},[e,S,x,C,L,v]);(0,Hy.useEffect)(()=>{if(!e)return;let j=T.length+E.length,z=(0,Zu.sprintf)((0,Zu._n)("%d result found.","%d results found.",j),j);b(z)},[e,b,T,E]);let O=(0,SB.useAsyncList)(T,{step:Fxe}),D=T.length>0||E.length>0,U=!!T.length&&(0,xn.jsx)(Wu,{title:(0,xn.jsx)(G5.VisuallyHidden,{children:(0,Zu.__)("Blocks")}),children:(0,xn.jsx)(lm,{items:O,onSelect:B,onHover:o,label:(0,Zu.__)("Blocks"),isDraggable:f})}),G=!!E.length&&(0,xn.jsx)(Wu,{title:(0,xn.jsx)(G5.VisuallyHidden,{children:(0,Zu.__)("Block patterns")}),children:(0,xn.jsx)("div",{className:"block-editor-inserter__quick-inserter-patterns",children:(0,xn.jsx)(Ca,{blockPatterns:E,onClickPattern:P,onHover:r,isDraggable:f})})});return(0,xn.jsxs)(Yh,{children:[!d&&!D&&(0,xn.jsx)(Ls,{}),h?G:U,!!T.length&&!!E.length&&(0,xn.jsx)("div",{className:"block-editor-inserter__quick-inserter-separator"}),h?U:G,d&&(0,xn.jsx)(yB.Slot,{fillProps:{onSelect:B,onHover:o,filterValue:e,hasItems:D,rootClientId:k},children:j=>j.length?j:D?null:(0,xn.jsx)(Ls,{})})]})}var _B=jxe;var wB=l(A(),1),XK=l(R(),1);var Hl=l(w(),1),{Tabs:xB}=M(wB.privateApis);function Uxe({defaultTabId:e,onClose:t,onSelect:o,selectedTab:r,tabs:n,closeButtonLabel:i},s){return(0,Hl.jsx)("div",{className:"block-editor-tabbed-sidebar",children:(0,Hl.jsxs)(xB,{selectOnMove:!1,defaultTabId:e,onSelect:o,selectedTabId:r,children:[(0,Hl.jsxs)("div",{className:"block-editor-tabbed-sidebar__tablist-and-close-button",children:[(0,Hl.jsx)(wB.Button,{className:"block-editor-tabbed-sidebar__close-button",icon:wf,label:i,onClick:()=>t(),size:"compact"}),(0,Hl.jsx)(xB.TabList,{className:"block-editor-tabbed-sidebar__tablist",ref:s,children:n.map(a=>(0,Hl.jsx)(xB.Tab,{tabId:a.name,className:"block-editor-tabbed-sidebar__tab",children:a.title},a.name))})]}),n.map(a=>(0,Hl.jsx)(xB.TabPanel,{tabId:a.name,focusable:!1,className:"block-editor-tabbed-sidebar__tabpanel",ref:a.panelRef,children:a.panel},a.name))]})})}var CB=(0,XK.forwardRef)(Uxe);var BB=l(F(),1),ag=l(R(),1);function Gy(e=!0){let{setZoomLevel:t,resetZoomLevel:o}=M((0,BB.useDispatch)(_)),{isZoomedOut:r,isZoomOut:n}=(0,BB.useSelect)(a=>{let{isZoomOut:c}=M(a(_));return{isZoomedOut:c(),isZoomOut:c}},[]),i=(0,ag.useRef)(!1),s=(0,ag.useRef)(e);(0,ag.useEffect)(()=>{r!==s.current&&(i.current=!1)},[r]),(0,ag.useEffect)(()=>(s.current=e,e!==n()&&(i.current=!0,e?t("auto-scaled"):o()),()=>{i.current&&n()&&o()}),[e,n,o,t])}var qe=l(w(),1),JK=()=>{};function Hxe({rootClientId:e,clientId:t,isAppender:o,__experimentalInsertionIndex:r,onSelect:n,showInserterHelpPanel:i,showMostUsedBlocks:s,__experimentalFilterValue:a="",shouldFocusBlock:c=!0,onPatternCategorySelection:u,onClose:d,__experimentalInitialTab:f,__experimentalInitialCategory:m},h){let{isZoomOutMode:p,hasSectionRootClientId:g}=(0,QK.useSelect)(he=>{let{isZoomOut:xe,getSectionRootClientId:ze}=M(he(_));return{isZoomOutMode:xe(),hasSectionRootClientId:!!ze()}},[]),[b,v,k]=(0,Wy.useDebouncedInput)(a),[y,S]=(0,Ft.useState)(null),[x,C]=(0,Ft.useState)(m),[B,I]=(0,Ft.useState)("all"),[P,E]=(0,Ft.useState)(null),L=(0,Wy.useViewportMatch)("large"),O=(0,Wy.useViewportMatch)("medium","<")?d:JK;function D(){return f||(p?"patterns":"blocks")}let[U,G]=(0,Ft.useState)(D());Gy(g&&(U==="patterns"||U==="media")&&L);let[z,W,ee]=$u({rootClientId:e,clientId:t,isAppender:o,insertionIndex:r,shouldFocusBlock:c}),se=(0,Ft.useRef)(),ce=(0,Ft.useCallback)((he,xe,ze,ot)=>{W(he,xe,ze,ot),n(he),O(),window.requestAnimationFrame(()=>{!c&&!se.current?.contains(h.current.ownerDocument.activeElement)&&se.current?.querySelector("button").focus()})},[W,O,n,h,c]),ie=(0,Ft.useCallback)((he,xe,...ze)=>{ee(!1),W(he,{patternName:xe},...ze),n(),O()},[W,O,n,ee]),re=(0,Ft.useCallback)(he=>{ee(he),S(he)},[ee,S]),Q=(0,Ft.useCallback)((he,xe)=>{C(he),I(xe),u?.()},[C,u]),Y=U==="patterns"&&!k&&!!x,J=U==="media"&&!!P,K=(0,Ft.useMemo)(()=>U==="media"?null:(0,qe.jsxs)(qe.Fragment,{children:[(0,qe.jsx)(lg.SearchControl,{className:"block-editor-inserter__search",onChange:he=>{y&&S(null),v(he)},value:b,label:(0,Xu.__)("Search"),placeholder:(0,Xu.__)("Search")}),!!k&&(0,qe.jsx)(_B,{filterValue:k,onSelect:n,onHover:re,rootClientId:e,clientId:t,isAppender:o,__experimentalInsertionIndex:r,showBlockDirectory:!0,shouldFocusBlock:c,prioritizePatterns:U==="patterns"})]}),[U,y,S,v,b,k,n,re,c,t,e,r,o]),H=(0,Ft.useMemo)(()=>(0,qe.jsxs)(qe.Fragment,{children:[(0,qe.jsx)("div",{className:"block-editor-inserter__block-list",children:(0,qe.jsx)(oK,{ref:se,rootClientId:z,onInsert:ce,onHover:re,showMostUsedBlocks:s})}),i&&(0,qe.jsxs)("div",{className:"block-editor-inserter__tips",children:[(0,qe.jsx)(lg.VisuallyHidden,{as:"h2",children:(0,Xu.__)("A tip for using the block editor")}),(0,qe.jsx)(v9,{})]})]}),[z,ce,re,s,i]),X=(0,Ft.useMemo)(()=>(0,qe.jsx)(EK,{rootClientId:z,onInsert:ie,onSelectCategory:Q,selectedCategory:x,children:Y&&(0,qe.jsx)(fB,{rootClientId:z,onInsert:ie,category:x,patternFilter:B,showTitlesAsTooltip:!0})}),[z,ie,Q,B,x,Y]),ne=(0,Ft.useMemo)(()=>(0,qe.jsx)(H5,{rootClientId:z,selectedCategory:P,onSelectCategory:E,onInsert:ce,children:J&&(0,qe.jsx)(Uy,{rootClientId:z,onInsert:ce,category:P})}),[z,ce,P,E,J]),le=he=>{he!=="patterns"&&C(null),G(he)},ve=(0,Ft.useRef)();return(0,Ft.useLayoutEffect)(()=>{ve.current&&window.requestAnimationFrame(()=>{ve.current.querySelector('[role="tab"][aria-selected="true"]')?.focus()})},[]),(0,qe.jsxs)("div",{className:V("block-editor-inserter__menu",{"show-panel":Y||J,"is-zoom-out":p}),ref:h,children:[(0,qe.jsx)("div",{className:"block-editor-inserter__main-area",children:(0,qe.jsx)(CB,{ref:ve,onSelect:le,onClose:d,selectedTab:U,closeButtonLabel:(0,Xu.__)("Close Block Inserter"),tabs:[{name:"blocks",title:(0,Xu.__)("Blocks"),panel:(0,qe.jsxs)(qe.Fragment,{children:[K,U==="blocks"&&!k&&H]})},{name:"patterns",title:(0,Xu.__)("Patterns"),panel:(0,qe.jsxs)(qe.Fragment,{children:[K,U==="patterns"&&!k&&X]})},{name:"media",title:(0,Xu.__)("Media"),panel:(0,qe.jsxs)(qe.Fragment,{children:[K,ne]})}]})}),i&&y&&(0,qe.jsx)(lg.Popover,{className:"block-editor-inserter__preview-container__popover",placement:"right-start",offset:16,focusOnMount:!1,animate:!1,children:(0,qe.jsx)(X1,{item:y})})]})}var W5=(0,Ft.forwardRef)(Hxe);function Gxe(e,t){return(0,qe.jsx)(W5,{...e,onPatternCategorySelection:JK,ref:t})}var eY=(0,Ft.forwardRef)(Gxe);var EB=l(R(),1),$y=l(N(),1),TB=l(A(),1),tY=l(F(),1);var fm=l(w(),1),Wxe=6,$xe=6,Kxe=2;function IB({onSelect:e,rootClientId:t,clientId:o,isAppender:r,selectBlockOnInsert:n,hasSearch:i=!0}){let[s,a]=(0,EB.useState)(""),[c,u]=$u({onSelect:e,rootClientId:t,clientId:o,isAppender:r,selectBlockOnInsert:n}),[d]=ku(c,u,!0),{setInserterIsOpened:f,insertionIndex:m}=(0,tY.useSelect)(g=>{let{getSettings:b,getBlockIndex:v,getBlockCount:k}=g(_),y=b(),S=v(o),x=k();return{setInserterIsOpened:y.__experimentalSetIsInserterOpened,insertionIndex:S===-1?x:S}},[o]),h=i&&d.length>Wxe;(0,EB.useEffect)(()=>{f&&f(!1)},[f]);let p=()=>{f({filterValue:s,onSelect:e,rootClientId:t,insertionIndex:m})};return(0,fm.jsxs)("div",{className:V("block-editor-inserter__quick-inserter",{"has-search":h,"has-expand":f}),children:[h&&(0,fm.jsx)(TB.SearchControl,{className:"block-editor-inserter__search",value:s,onChange:g=>{a(g)},label:(0,$y.__)("Search"),placeholder:(0,$y.__)("Search")}),(0,fm.jsx)("div",{className:"block-editor-inserter__quick-inserter-results",children:(0,fm.jsx)(_B,{filterValue:s,onSelect:e,rootClientId:t,clientId:o,isAppender:r,maxBlockPatterns:s?Kxe:0,maxBlockTypes:$xe,isDraggable:!1,selectBlockOnInsert:n,isQuick:!0})}),f&&(0,fm.jsx)(TB.Button,{__next40pxDefaultSize:!0,className:"block-editor-inserter__quick-inserter-expand",onClick:p,"aria-label":(0,$y.__)("Browse all. This will open the main inserter panel in the editor toolbar."),children:(0,$y.__)("Browse all")})]})}var Yxe=50;function oY(e,t){if(!e||!e.attributes||!t?.__experimentalLabel)return null;let o=t.__experimentalLabel(e.attributes,{context:"appender"});return typeof o=="string"&&o.length<Yxe&&o.length>0?o:null}var Ky=l(w(),1),qxe=({onToggle:e,disabled:t,isOpen:o,blockTitle:r,hasSingleBlockType:n,appenderLabel:i,toggleProps:s={}})=>{let{as:a=PB.Button,label:c,onClick:u,...d}=s,f=c;!f&&i?f=i:!f&&n?f=(0,Gl.sprintf)((0,Gl._x)("Add %s","directly add the only allowed block"),r.toLowerCase()):f||(f=(0,Gl._x)("Add block","Generic label for block inserter button"));function m(h){e&&e(h),u&&u(h)}return(0,Ky.jsx)(a,{__next40pxDefaultSize:s.as?void 0:!0,icon:Bi,label:f,tooltipPosition:"bottom",onClick:m,className:"block-editor-inserter__toggle","aria-haspopup":n?!1:"true","aria-expanded":n?!1:o,disabled:t,...d})},Zxe=class extends nY.Component{constructor(){super(...arguments),this.onToggle=this.onToggle.bind(this),this.renderToggle=this.renderToggle.bind(this),this.renderContent=this.renderContent.bind(this)}onToggle(e){let{onToggle:t}=this.props;t&&t(e)}renderToggle({onToggle:e,isOpen:t}){let{disabled:o,blockTitle:r,hasSingleBlockType:n,appenderLabel:i,toggleProps:s,hasItems:a,renderToggle:c=qxe}=this.props;return c({onToggle:e,isOpen:t,disabled:o||!a,blockTitle:r,hasSingleBlockType:n,appenderLabel:i,toggleProps:s})}renderContent({onClose:e}){let{rootClientId:t,clientId:o,isAppender:r,showInserterHelpPanel:n,__experimentalIsQuick:i,onSelectOrClose:s,selectBlockOnInsert:a}=this.props;return i?(0,Ky.jsx)(IB,{onSelect:c=>{let u=Array.isArray(c)&&c?.length?c[0]:c;s&&typeof s=="function"&&s(u),e()},rootClientId:t,clientId:o,isAppender:r,selectBlockOnInsert:a}):(0,Ky.jsx)(eY,{onSelect:()=>{e()},onClose:e,rootClientId:t,clientId:o,isAppender:r,showInserterHelpPanel:n})}render(){let{position:e,hasSingleBlockType:t,directInsertBlock:o,insertOnlyAllowedBlock:r,__experimentalIsQuick:n,onSelectOrClose:i}=this.props;return t||o?this.renderToggle({onToggle:r}):(0,Ky.jsx)(PB.Dropdown,{className:"block-editor-inserter",contentClassName:V("block-editor-inserter__popover",{"is-quick":n}),popoverProps:{position:e,shift:!0},onToggle:this.onToggle,expandOnMobile:!0,headerTitle:(0,Gl.__)("Add a block"),renderToggle:this.renderToggle,renderContent:this.renderContent,onClose:i})}},Ui=(0,OB.compose)([(0,RB.withSelect)((e,{clientId:t,rootClientId:o,shouldDirectInsert:r=!0})=>{let{getBlockRootClientId:n,hasInserterItems:i,getAllowedBlocks:s,getDirectInsertBlock:a}=e(_),{getBlockVariations:c,getBlockType:u}=e(Yy.store);o=o||n(t)||void 0;let d=s(o),f=r&&a(o),m=d?.length===1&&c(d[0].name,"inserter")?.length===0,h=!1;m&&(h=d[0]);let p=f?u(f.name):null,g=oY(f,p);return{hasItems:i(o),hasSingleBlockType:m,blockTitle:h?h.title:"",allowedBlockType:h,directInsertBlock:f,appenderLabel:g,rootClientId:o}}),(0,RB.withDispatch)((e,t,{select:o})=>({insertOnlyAllowedBlock(){let{rootClientId:r,clientId:n,isAppender:i,hasSingleBlockType:s,allowedBlockType:a,directInsertBlock:c,onSelectOrClose:u,selectBlockOnInsert:d}=t;if(!s&&!c)return;function f(b){let{getBlock:v,getPreviousBlockClientId:k}=o(_);if(!b||!n&&!r)return{};let y={},S={};if(n){let x=v(n),C=v(k(n));x?.name===C?.name&&(S=C?.attributes||{})}else{let x=v(r);if(x?.innerBlocks?.length){let C=x.innerBlocks[x.innerBlocks.length-1];c&&c?.name===C.name&&(S=C.attributes)}}return b.forEach(x=>{S.hasOwnProperty(x)&&(y[x]=S[x])}),y}function m(){let{getBlockIndex:b,getBlockSelectionEnd:v,getBlockOrder:k,getBlockRootClientId:y}=o(_);if(n)return b(n);let S=v();return!i&&S&&y(S)===r?b(S)+1:k(r).length}let{insertBlock:h}=e(_),p;if(c){let b=f(c.attributesToCopy);p=(0,Yy.createBlock)(c.name,{...c.attributes||{},...b})}else p=(0,Yy.createBlock)(a.name);h(p,m(),r,d),u&&u(p);let g=(0,Gl.sprintf)((0,Gl.__)("%s block added"),a.title);(0,rY.speak)(g)}})),(0,OB.ifCondition)(({hasItems:e,isAppender:t,rootClientId:o,clientId:r})=>e||!t&&!o&&!r)])(Zxe);var qy=l(w(),1),Xxe="\uFEFF";function cg({rootClientId:e}){let{showPrompt:t,isLocked:o,placeholder:r,isManualGrid:n}=(0,AB.useSelect)(u=>{let{getBlockCount:d,getSettings:f,getTemplateLock:m,getBlockAttributes:h}=u(_),p=!d(e),{bodyPlaceholder:g}=f();return{showPrompt:p,isLocked:!!m(e),placeholder:g,isManualGrid:h(e)?.layout?.isManualPlacement}},[e]),{insertDefaultBlock:i,startTyping:s}=(0,AB.useDispatch)(_);if(o||n)return null;let a=(0,iY.decodeEntities)(r)||(0,$5.__)("Type / to choose a block"),c=()=>{i(void 0,e),s()};return(0,qy.jsxs)("div",{"data-root-client-id":e||"",className:V("block-editor-default-block-appender",{"has-visible-prompt":t}),children:[(0,qy.jsx)("p",{tabIndex:"0",role:"button","aria-label":(0,$5.__)("Add default block"),className:"block-editor-default-block-appender__content",onKeyDown:u=>{(LB.ENTER===u.keyCode||LB.SPACE===u.keyCode)&&c()},onClick:()=>c(),onFocus:()=>{t&&c()},children:t?a:Xxe}),(0,qy.jsx)(Ui,{rootClientId:e,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0})]})}var sY=l(A(),1),K5=l(R(),1),Zy=l(N(),1);var aY=l(Re(),1);var NB=l(w(),1);function lY({rootClientId:e,className:t,onFocus:o,tabIndex:r,onSelect:n},i){return(0,NB.jsx)(Ui,{position:"bottom center",rootClientId:e,__experimentalIsQuick:!0,onSelectOrClose:(...s)=>{n&&typeof n=="function"&&n(...s)},renderToggle:({onToggle:s,disabled:a,isOpen:c,blockTitle:u,hasSingleBlockType:d,appenderLabel:f})=>{let m=!d,h;return f?h=f:d?h=(0,Zy.sprintf)((0,Zy._x)("Add %s","directly add the only allowed block"),u.toLowerCase()):h=(0,Zy._x)("Add block","Generic label for block inserter button"),(0,NB.jsx)(sY.Button,{__next40pxDefaultSize:!0,ref:i,onFocus:o,tabIndex:r,className:V(t,"block-editor-button-block-appender"),onClick:s,"aria-haspopup":m?"true":void 0,"aria-expanded":m?c:void 0,disabled:a,label:h,showTooltip:!0,children:(0,NB.jsx)(we,{icon:Bi})})},isAppender:!0})}var cY=(0,K5.forwardRef)((e,t)=>((0,aY.default)("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),lY(e,t))),Qu=(0,K5.forwardRef)(lY);var ug=l(w(),1);function Qxe({rootClientId:e}){return(0,Y5.useSelect)(o=>o(_).canInsertBlockType((0,uY.getDefaultBlockName)(),e))?(0,ug.jsx)(cg,{rootClientId:e}):(0,ug.jsx)(Qu,{rootClientId:e,className:"block-list-appender__toggle"})}function dY({rootClientId:e,CustomAppender:t,className:o,tagName:r="div"}){let n=(0,Y5.useSelect)(i=>{let{getBlockInsertionPoint:s,isBlockInsertionPointVisible:a,getBlockCount:c}=i(_),u=s();return a()&&e===u?.rootClientId&&c(e)===0},[e]);return(0,ug.jsx)(r,{tabIndex:-1,className:V("block-list-appender wp-block",o,{"is-drag-over":n}),contentEditable:!1,"data-block":!0,children:t?(0,ug.jsx)(t,{}):(0,ug.jsx)(Qxe,{rootClientId:e})})}var BY=l(Z(),1),Qy=l(F(),1),EY=l(R(),1),TY=l(N(),1);var dg=l(F(),1),ed=l(R(),1),VB=l(A(),1),wY=l(Z(),1);var pY=l(F(),1),Ju=l(R(),1),hY=l(A(),1),gY=l(N(),1);var mY=l(Z(),1),q5=l(Fe(),1),fY=new WeakMap;function Jxe(e){let t=(0,mY.useRefEffect)(o=>{function r(i){let{deltaX:s,deltaY:a,target:c}=i,u=e.current,d=fY.get(u);d||(d=(0,q5.getScrollContainer)(u),fY.set(u,d));let f=(0,q5.getScrollContainer)(c);o.contains(f)||d.scrollBy(s,a)}let n={passive:!0};return o.addEventListener("wheel",r,n),()=>{o.removeEventListener("wheel",r,n)}},[e]);return e?t:null}var mm=Jxe;var Z5=l(w(),1),ewe=Number.MAX_SAFE_INTEGER;function twe({previousClientId:e,nextClientId:t,children:o,__unstablePopoverSlot:r,__unstableContentRef:n,operation:i="insert",nearestSide:s="right",...a}){let[c,u]=(0,Ju.useReducer)(k=>(k+1)%ewe,0),{orientation:d,rootClientId:f,isVisible:m}=(0,pY.useSelect)(k=>{let{getBlockListSettings:y,getBlockRootClientId:S,isBlockVisible:x}=k(_),C=S(e??t);return{orientation:y(C)?.orientation||"vertical",rootClientId:C,isVisible:x(e)&&x(t)}},[e,t]),h=Xe(e),p=Xe(t),g=d==="vertical",b=(0,Ju.useMemo)(()=>c<0||!h&&!p||!m?void 0:{contextElement:i==="group"?p||h:h||p,getBoundingClientRect(){let y=h?h.getBoundingClientRect():null,S=p?p.getBoundingClientRect():null,x=0,C=0,B=0,I=0;if(i==="group"){let P=S||y;C=P.top,B=0,I=P.bottom-P.top,x=s==="left"?P.left-2:P.right-2}else g?(C=y?y.bottom:S.top,B=y?y.width:S.width,I=S&&y?S.top-y.bottom:0,x=y?y.left:S.left):(C=y?y.top:S.top,I=y?y.height:S.height,(0,gY.isRTL)()?(x=S?S.right:y.left,B=y&&S?y.left-S.right:0):(x=y?y.right:S.left,B=y&&S?S.left-y.right:0),B=Math.max(B,0));return new window.DOMRect(x,C,B,I)}},[h,p,c,g,m,i,s]),v=mm(n);return(0,Ju.useLayoutEffect)(()=>{if(!h)return;let k=new window.MutationObserver(u);return k.observe(h,{attributes:!0}),()=>{k.disconnect()}},[h]),(0,Ju.useLayoutEffect)(()=>{if(!p)return;let k=new window.MutationObserver(u);return k.observe(p,{attributes:!0}),()=>{k.disconnect()}},[p]),(0,Ju.useLayoutEffect)(()=>{if(h)return h.ownerDocument.defaultView.addEventListener("resize",u),()=>{h.ownerDocument.defaultView?.removeEventListener("resize",u)}},[h]),!h&&!p||!m?null:(0,Z5.jsx)(hY.Popover,{ref:v,animate:!1,anchor:b,focusOnMount:!1,__unstableSlotName:r,inline:!r,...a,className:V("block-editor-block-popover","block-editor-block-popover__inbetween",a.className),resize:!1,flip:!1,placement:"overlay",variant:"unstyled",children:(0,Z5.jsx)("div",{className:"block-editor-block-popover__inbetween-container",children:o})},t+"--"+f)}var MB=twe;var yY=l(F(),1),SY=l(Z(),1),_Y=l(A(),1);var $l=l(R(),1);var bY=l(Z(),1),kY=l(A(),1),Wl=l(R(),1);var X5=l(w(),1),owe=Number.MAX_SAFE_INTEGER;function rwe({clientId:e,bottomClientId:t,children:o,__unstablePopoverSlot:r,__unstableContentRef:n,shift:i=!0,...s},a){let c=Xe(e),u=Xe(t??e),d=(0,bY.useMergeRefs)([a,mm(n)]),[f,m]=(0,Wl.useReducer)(p=>(p+1)%owe,0);(0,Wl.useLayoutEffect)(()=>{if(!c)return;let p=new window.MutationObserver(m);return p.observe(c,{attributes:!0}),()=>{p.disconnect()}},[c]);let h=(0,Wl.useMemo)(()=>{if(!(f<0||!c||t&&!u))return{getBoundingClientRect(){return u?xD(Sh(c),Sh(u)):Sh(c)},contextElement:c}},[f,c,t,u]);return!c||t&&!u?null:(0,X5.jsx)(kY.Popover,{ref:d,animate:!1,focusOnMount:!1,anchor:h,__unstableSlotName:r,inline:!r,placement:"top-start",resize:!1,flip:!1,shift:i,...s,className:V("block-editor-block-popover",s.className),variant:"unstyled",children:o})}var pm=(0,Wl.forwardRef)(rwe),nwe=({clientId:e,bottomClientId:t,children:o,...r},n)=>(0,X5.jsx)(pm,{...r,bottomClientId:t,clientId:e,__unstableContentRef:void 0,__unstablePopoverSlot:void 0,ref:n,children:o}),vY=(0,Wl.forwardRef)(nwe);var DB=l(w(),1);function iwe({clientId:e,bottomClientId:t,children:o,shift:r=!1,additionalStyles:n,...i},s){t??=e;let a=Xe(e);return(0,DB.jsx)(pm,{ref:s,clientId:e,bottomClientId:t,shift:r,...i,children:a&&e===t?(0,DB.jsx)(swe,{selectedElement:a,additionalStyles:n,children:o}):o})}function swe({selectedElement:e,additionalStyles:t={},children:o}){let[r,n]=(0,$l.useState)(e.offsetWidth),[i,s]=(0,$l.useState)(e.offsetHeight);(0,$l.useEffect)(()=>{let c=new window.ResizeObserver(()=>{n(e.offsetWidth),s(e.offsetHeight)});return c.observe(e,{box:"border-box"}),()=>c.disconnect()},[e]);let a=(0,$l.useMemo)(()=>({position:"absolute",width:r,height:i,...t}),[r,i,t]);return(0,DB.jsx)("div",{style:a,children:o})}var Hi=(0,$l.forwardRef)(iwe);var Q5=l(w(),1),Xy={hide:{opacity:0,scaleY:.75},show:{opacity:1,scaleY:1},exit:{opacity:0,scaleY:.9}};function awe({__unstablePopoverSlot:e,__unstableContentRef:t}){let{clientId:o}=(0,yY.useSelect)(n=>{let{getBlockOrder:i,getBlockInsertionPoint:s}=n(_),a=s(),c=i(a.rootClientId);return c.length?{clientId:c[a.index]}:{}},[]),r=(0,SY.useReducedMotion)();return(0,Q5.jsx)(Hi,{clientId:o,__unstablePopoverSlot:e,__unstableContentRef:t,className:"block-editor-block-popover__drop-zone",children:(0,Q5.jsx)(_Y.__unstableMotion.div,{"data-testid":"block-popover-drop-zone",initial:r?Xy.show:Xy.hide,animate:Xy.show,exit:r?Xy.show:Xy.exit,className:"block-editor-block-popover__drop-zone-foreground"})})}var xY=awe;var Kl=l(w(),1),fg=(0,ed.createContext)();fg.displayName="InsertionPointOpenRefContext";function lwe({__unstablePopoverSlot:e,__unstableContentRef:t,operation:o="insert",nearestSide:r="right"}){let{selectBlock:n,hideInsertionPoint:i}=(0,dg.useDispatch)(_),s=(0,ed.useContext)(fg),a=(0,ed.useRef)(),{orientation:c,previousClientId:u,nextClientId:d,rootClientId:f,isInserterShown:m,isDistractionFree:h,isZoomOutMode:p}=(0,dg.useSelect)(P=>{let{getBlockOrder:E,getBlockListSettings:L,getBlockInsertionPoint:T,isBlockBeingDragged:O,getPreviousBlockClientId:D,getNextBlockClientId:U,getSettings:G,isZoomOut:j}=M(P(_)),z=T(),W=E(z.rootClientId);if(!W.length)return{};let ee=W[z.index-1],se=W[z.index];for(;O(ee);)ee=D(ee);for(;O(se);)se=U(se);let ce=G();return{previousClientId:ee,nextClientId:se,orientation:L(z.rootClientId)?.orientation||"vertical",rootClientId:z.rootClientId,isDistractionFree:ce.isDistractionFree,isInserterShown:z?.__unstableWithInserter,isZoomOutMode:j()}},[]),{getBlockEditingMode:g}=(0,dg.useSelect)(_),b=(0,wY.useReducedMotion)();function v(P){P.target===a.current&&d&&g(d)!=="disabled"&&n(d,-1)}function k(P){P.target===a.current&&!s.current&&i()}function y(P){P.target!==a.current&&(s.current=!0)}let S=(0,ed.useCallback)(P=>{!P&&s.current&&(s.current=!1)},[s]),x={start:{opacity:0,scale:0},rest:{opacity:1,scale:1,transition:{delay:m?.5:0,type:"tween"}},hover:{opacity:1,scale:1,transition:{delay:.5,type:"tween"}}},C={start:{scale:b?1:0},rest:{scale:1,transition:{delay:.4,type:"tween"}}};if(h||p&&o!=="insert")return null;let I=V("block-editor-block-list__insertion-point",c==="horizontal"||o==="group"?"is-horizontal":"is-vertical");return(0,Kl.jsx)(MB,{previousClientId:u,nextClientId:d,__unstablePopoverSlot:e,__unstableContentRef:t,operation:o,nearestSide:r,children:(0,Kl.jsxs)(VB.__unstableMotion.div,{layout:!b,initial:b?"rest":"start",animate:"rest",whileHover:"hover",whileTap:"pressed",exit:"start",ref:a,tabIndex:-1,onClick:v,onFocus:y,className:V(I,{"is-with-inserter":m}),onHoverEnd:k,children:[(0,Kl.jsx)(VB.__unstableMotion.div,{variants:x,className:"block-editor-block-list__insertion-point-indicator","data-testid":"block-list-insertion-point-indicator"}),m&&(0,Kl.jsx)(VB.__unstableMotion.div,{variants:C,className:V("block-editor-block-list__insertion-point-inserter"),children:(0,Kl.jsx)(Ui,{ref:S,position:"bottom center",clientId:d,rootClientId:f,__experimentalIsQuick:!0,onToggle:P=>{s.current=P},onSelectOrClose:()=>{s.current=!1}})})]})})}function CY(e){let{insertionPoint:t,isVisible:o,isBlockListEmpty:r}=(0,dg.useSelect)(n=>{let{getBlockInsertionPoint:i,isBlockInsertionPointVisible:s,getBlockCount:a}=n(_),c=i();return{insertionPoint:c,isVisible:s(),isBlockListEmpty:a(c?.rootClientId)===0}},[]);return!o||r?null:t.operation==="replace"?(0,Kl.jsx)(xY,{...e},`${t.rootClientId}-${t.index}`):(0,Kl.jsx)(lwe,{operation:t.operation,nearestSide:t.nearestSide,...e})}function IY(){let e=(0,EY.useContext)(fg),t=(0,Qy.useSelect)(g=>{let b=g(_).getSettings();return b.isDistractionFree||b.isPreviewMode||M(g(_)).isZoomOut()},[]),{getBlockListSettings:o,getBlockIndex:r,isMultiSelecting:n,getSelectedBlockClientIds:i,getSettings:s,getTemplateLock:a,__unstableIsWithinBlockOverlay:c,getBlockEditingMode:u,getBlockName:d,getBlockAttributes:f,getParentSectionBlock:m}=M((0,Qy.useSelect)(_)),{showInsertionPoint:h,hideInsertionPoint:p}=(0,Qy.useDispatch)(_);return(0,BY.useRefEffect)(g=>{if(t)return;function b(v){if(e===void 0||e.current||v.target.nodeType===v.target.TEXT_NODE||n())return;if(!v.target.classList.contains("block-editor-block-list__layout")){p();return}let k;if(v.target.classList.contains("is-root-container")||(k=(v.target.getAttribute("data-block")?v.target:v.target.closest("[data-block]")).getAttribute("data-block")),a(k)||u(k)==="disabled"||d(k)==="core/block"||k&&f(k).layout?.isManualPlacement)return;let y=o(k),S=y?.orientation||"vertical",x=!!y?.__experimentalCaptureToolbars,C=v.clientY,B=v.clientX,P=Array.from(v.target.children).find(O=>{let D=O.getBoundingClientRect();return O.classList.contains("wp-block")&&S==="vertical"&&D.top>C||O.classList.contains("wp-block")&&S==="horizontal"&&((0,TY.isRTL)()?D.right<B:D.left>B)});if(!P){p();return}if(!P.id&&(P=P.firstElementChild,!P)){p();return}let E=P.id.slice(6);if(!E||c(E)||m(E)||i().includes(E)&&S==="vertical"&&!x&&!s().hasFixedToolbar)return;let L=P.getBoundingClientRect();if(S==="horizontal"&&(v.clientY>L.bottom||v.clientY<L.top)||S==="vertical"&&(v.clientX>L.right||v.clientX<L.left)){p();return}let T=r(E);if(T===0){p();return}h(k,T,{__unstableWithInserter:!0})}return g.addEventListener("mousemove",b),()=>{g.removeEventListener("mousemove",b)}},[e,o,r,n,h,p,i,t])}var FB=l(F(),1),PY=l(Z(),1);var RY=l(w(),1);function hm(){let{getSettings:e,hasSelectedBlock:t,hasMultiSelection:o}=(0,FB.useSelect)(_),{clearSelectedBlock:r}=(0,FB.useDispatch)(_),{clearBlockSelection:n}=e();return(0,PY.useRefEffect)(i=>{if(!n)return;function s(a){!t()&&!o()||a.target===i&&r()}return i.addEventListener("mousedown",s),()=>{i.removeEventListener("mousedown",s)}},[t,o,r,n])}function OY(e){return(0,RY.jsx)("div",{ref:hm(),...e})}var JY=l(Z(),1),pg=l(R(),1),eq=l(F(),1),vm=l($(),1);var AY=l(w(),1);function LY({showSeparator:e,isFloating:t,onAddBlock:o,isToggle:r}){let{clientId:n}=Ie();return(0,AY.jsx)(Qu,{className:V({"block-list-appender__toggle":r}),rootClientId:n,showSeparator:e,isFloating:t,onAddBlock:o})}var NY=l(w(),1);function MY(){let{clientId:e}=Ie();return(0,NY.jsx)(cg,{rootClientId:e})}var jB=l(R(),1),FY=l(F(),1),zB=l(Re(),1),zY=l(Jy(),1);var eS=new WeakMap;function cwe(){let e;return t=>((e===void 0||!(0,zY.isShallowEqual)(e,t))&&(e=t),e)}function VY(e){let[t]=(0,jB.useState)(cwe);return t(e)}function jY(e,t,o,r,n,i,s,a,c,u,d,f){let m=(0,FY.useRegistry)(),h=VY(o),p=VY(r),g=c===void 0||t==="contentOnly"?t:c;(0,jB.useLayoutEffect)(()=>{let b={allowedBlocks:h,prioritizedInserterBlocks:p,templateLock:g};if(u!==void 0&&(b.__experimentalCaptureToolbars=u),d!==void 0)b.orientation=d;else{let v=xs(f?.type);b.orientation=v.getOrientation(f)}s!==void 0&&((0,zB.default)("__experimentalDefaultBlock",{alternative:"defaultBlock",since:"6.3",version:"6.4"}),b.defaultBlock=s),n!==void 0&&(b.defaultBlock=n),a!==void 0&&((0,zB.default)("__experimentalDirectInsert",{alternative:"directInsert",since:"6.3",version:"6.4"}),b.directInsert=a),i!==void 0&&(b.directInsert=i),b.directInsert!==void 0&&typeof b.directInsert!="boolean"&&(0,zB.default)("Using `Function` as a `directInsert` argument",{alternative:"`boolean` values",since:"6.5"}),eS.get(m)||eS.set(m,{}),eS.get(m)[e]=b,window.queueMicrotask(()=>{let v=eS.get(m);if(Object.keys(v).length){let{updateBlockListSettings:k}=m.dispatch(_);k(v),eS.set(m,{})}})},[e,h,p,g,n,i,s,a,u,d,f,m])}var J5=l(yf(),1),UB=l(R(),1),UY=l(F(),1),HY=l($(),1);function GY(e,t,o,r){let n=(0,UY.useRegistry)(),i=(0,UB.useRef)(null);(0,UB.useLayoutEffect)(()=>{let s=!1,{getBlocks:a,getSelectedBlocksInitialCaretPosition:c,isBlockSelected:u}=n.select(_),{replaceInnerBlocks:d,__unstableMarkNextChangeAsNotPersistent:f}=n.dispatch(_);return window.queueMicrotask(()=>{if(s)return;let m=a(e),h=m.length===0||o==="all"||o==="contentOnly",p=!(0,J5.default)(t,i.current);if(!h||!p)return;i.current=t;let g=(0,HY.synchronizeBlocksWithTemplate)(m,t);(0,J5.default)(g,m)||(f(),d(e,g,m.length===0&&r&&g.length!==0&&u(e),c()))}),()=>{s=!0}},[t,o,e,n,r])}var WY=l($(),1),$Y=l(F(),1);function KY(e){return(0,$Y.useSelect)(t=>{let o=t(_).getBlock(e);if(!o)return;let r=t(WY.store).getBlockType(o.name);if(r&&Object.keys(r.providesContext).length!==0)return Object.fromEntries(Object.entries(r.providesContext).map(([n,i])=>[n,o.attributes[i]]))},[e])}var km=l(F(),1),WB=l(R(),1),$B=l(Z(),1),XY=l(N(),1),mg=l($(),1);var eV=l(R(),1),Zn=l($(),1),gm=l(F(),1),YY=l(Fe(),1);function tV(e){let t={srcRootClientId:null,srcClientIds:null,srcIndex:null,type:null,blocks:null};if(!e.dataTransfer)return t;try{t=Object.assign(t,JSON.parse(e.dataTransfer.getData("wp-blocks")))}catch{return t}return t}function uwe(e,t,o,r,n,i,s,a,c){return u=>{let{srcRootClientId:d,srcClientIds:f,type:m,blocks:h}=tV(u);if(m==="inserter"){s();let p=h.map(g=>(0,Zn.cloneBlock)(g));i(p,!0,null)}if(m==="block"){let p=o(f[0]);if(d===e&&p===t||f.includes(e)||r(f).some(k=>k===e))return;if(a==="group"){let k=f.map(y=>c(y));i(k,!0,null,f);return}let g=d===e,b=f.length,v=g&&p<t?t-b:t;n(f,d,v)}}}function dwe(e,t,o,r,n){return i=>{if(!t().mediaUpload)return;let s=(0,Zn.findTransform)((0,Zn.getBlockTransforms)("from"),a=>a.type==="files"&&r(a.blockName,e)&&a.isMatch(i));if(s){let a=s.transform(i,o);n(a)}}}function fwe(e){return t=>{let o=(0,Zn.pasteHandler)({HTML:t,mode:"BLOCKS"});o.length&&e(o)}}function HB(e,t,o={}){let{operation:r="insert",nearestSide:n="right"}=o,{canInsertBlockType:i,getBlockIndex:s,getClientIdsOfDescendants:a,getBlockOrder:c,getBlocksByClientId:u,getSettings:d,getBlock:f}=(0,gm.useSelect)(_),{getGroupingBlockName:m}=(0,gm.useSelect)(Zn.store),{insertBlocks:h,moveBlocksToPosition:p,updateBlockAttributes:g,clearSelectedBlock:b,replaceBlocks:v,removeBlocks:k}=(0,gm.useDispatch)(_),y=(0,gm.useRegistry)(),S=(0,eV.useCallback)((P,E=!0,L=0,T=[])=>{Array.isArray(P)||(P=[P]);let D=c(e)[t];if(r==="replace")v(D,P,void 0,L);else if(r==="group"){let U=f(D);n==="left"?P.push(U):P.unshift(U);let G=P.map(ee=>(0,Zn.createBlock)(ee.name,ee.attributes,ee.innerBlocks)),j=P.every(ee=>ee.name==="core/image"),z=i("core/gallery",e),W=(0,Zn.createBlock)(j&&z?"core/gallery":m(),{layout:{type:"flex",flexWrap:j&&z?null:"nowrap"}},G);v([D,...T],W,void 0,L)}else h(P,t,e,E,L)},[c,e,t,r,v,f,n,i,m,h]),x=(0,eV.useCallback)((P,E,L)=>{if(r==="replace"){let T=u(P),D=c(e)[t];y.batch(()=>{k(P,!1),v(D,T,void 0,0)})}else p(P,E,e,L)},[r,c,u,p,y,k,v,t,e]),C=uwe(e,t,s,a,x,S,b,r,f),B=dwe(e,d,g,i,S),I=fwe(S);return P=>{let E=(0,YY.getFilesFromDataTransfer)(P.dataTransfer),L=P.dataTransfer.getData("text/html");L?I(L):E.length?B(E):C(P)}}function mwe(e,t,o){let r=o==="top"||o==="bottom",{x:n,y:i}=e,s=r?n:i,a=r?i:n,c=r?t.left:t.top,u=r?t.right:t.bottom,d=t[o],f;return s>=c&&s<=u?f=s:s<u?f=c:f=u,Math.sqrt((s-f)**2+(a-d)**2)}function bm(e,t,o=["top","bottom","left","right"]){let r,n;return o.forEach(i=>{let s=mwe(e,t,i);(r===void 0||s<r)&&(r=s,n=i)}),[r,n]}function GB(e,t){return t.left<=e.x&&t.right>=e.x&&t.top<=e.y&&t.bottom>=e.y}function qY(e,t){return t.top<=e.y&&t.bottom>=e.y}var oV=30,pwe=120,hwe=120;function gwe(e,t,o="vertical",r={}){let n=o==="horizontal"?["left","right"]:["top","bottom"],i=0,s="before",a=1/0,c=null,u="right",{dropZoneElement:d,parentBlockOrientation:f,rootBlockIndex:m=0}=r;if(d&&f!=="horizontal"){let v=d.getBoundingClientRect(),[k,y]=bm(t,v,["top","bottom"]);if(v.height>pwe&&k<oV){if(y==="top")return[m,"before"];if(y==="bottom")return[m+1,"after"]}}let h=(0,XY.isRTL)();if(d&&f==="horizontal"){let v=d.getBoundingClientRect(),[k,y]=bm(t,v,["left","right"]);if(v.width>hwe&&k<oV){if(h&&y==="right"||!h&&y==="left")return[m,"before"];if(h&&y==="left"||!h&&y==="right")return[m+1,"after"]}}e.forEach(({isUnmodifiedDefaultBlock:v,getBoundingClientRect:k,blockIndex:y,blockOrientation:S})=>{let x=k();if(!x)return;let[C,B]=bm(t,x,n),[I,P]=bm(t,x,["left","right"]),E=GB(t,x);v&&E?C=0:o==="vertical"&&S!=="horizontal"&&(E&&I<oV||!E&&qY(t,x))&&(c=y,u=P),C<a&&(s=B==="bottom"||!h&&B==="right"||h&&B==="left"?"after":"before",a=C,i=y)});let p=i+(s==="after"?1:-1),g=!!e[i]?.isUnmodifiedDefaultBlock,b=!!e[p]?.isUnmodifiedDefaultBlock;return c!==null?[c,"group",u]:!g&&!b?[s==="after"?i+1:i,"insert"]:[g?i:p,"replace"]}function KB(e,t,o,r){let n=!0;if(t){let a=t?.map(({name:c})=>c);n=o.every(c=>a?.includes(c))}let s=o.map(a=>e(a)).every(a=>{let[c]=a?.parent||[];return c?c===r:!0});return n&&s}function ZY(e,t){let{defaultView:o}=t;return!!(o&&e instanceof o.HTMLElement&&e.closest("[data-is-insertion-point]"))}function QY({dropZoneElement:e,rootClientId:t="",parentClientId:o="",isDisabled:r=!1}={}){let n=(0,km.useRegistry)(),[i,s]=(0,WB.useState)({index:null,operation:"insert"}),{getBlockType:a,getBlockVariations:c,getGroupingBlockName:u}=(0,km.useSelect)(mg.store),{canInsertBlockType:d,getBlockListSettings:f,getBlocks:m,getBlockIndex:h,getDraggedBlockClientIds:p,getBlockNamesByClientId:g,getAllowedBlocks:b,isDragging:v,isGroupable:k,isZoomOut:y,getSectionRootClientId:S,getBlockParents:x}=M((0,km.useSelect)(_)),{showInsertionPoint:C,hideInsertionPoint:B,startDragging:I,stopDragging:P}=M((0,km.useDispatch)(_)),E=HB(i.operation==="before"||i.operation==="after"?o:t,i.index,{operation:i.operation,nearestSide:i.nearestSide}),L=(0,$B.useThrottle)((0,WB.useCallback)((T,O)=>{v()||I();let D=p(),U=[t,...x(t,!0)];if(D.some(H=>U.includes(H)))return;let j=b(t),z=g([t])[0],W=g(D);if(!KB(a,j,W,z))return;let se=S();if(y()&&se!==t)return;let ce=m(t).filter(H=>!((0,mg.hasBlockSupport)(H.name,"visibility",!0)&&H.attributes?.metadata?.blockVisibility===!1));if(ce.length===0){n.batch(()=>{s({index:0,operation:"insert"}),C(t,0,{operation:"insert"})});return}let ie=ce.map(H=>{let X=H.clientId;return{isUnmodifiedDefaultBlock:(0,mg.isUnmodifiedDefaultBlock)(H),getBoundingClientRect:()=>{let ne=O.getElementById(`block-${X}`);return ne?ne.getBoundingClientRect():null},blockIndex:h(X),blockOrientation:f(X)?.orientation}}),re=gwe(ie,{x:T.clientX,y:T.clientY},f(t)?.orientation,{dropZoneElement:e,parentBlockClientId:o,parentBlockOrientation:o?f(o)?.orientation:void 0,rootBlockIndex:h(t)}),[Q,Y,J]=re,K=ie[Q]?.isUnmodifiedDefaultBlock;if(!(y()&&!K&&Y!=="insert")){if(Y==="group"){let H=ce[Q],X=[H.name,...W].every(xe=>xe==="core/image"),ne=d("core/gallery",t),le=k([H.clientId,p()]),ve=c(u(),"block"),he=ve&&ve.find(({name:xe})=>xe==="group-row");if(X&&!ne&&(!le||!he)||!X&&(!le||!he))return}n.batch(()=>{s({index:Q,operation:Y,nearestSide:J});let H=["before","after"].includes(Y)?o:t;C(H,Q,{operation:Y,nearestSide:J})})}},[v,b,t,g,p,a,S,y,m,f,e,o,h,n,I,C,d,k,c,u]),200);return(0,$B.__experimentalUseDropZone)({dropZoneElement:e,isDisabled:r,onDrop:E,onDragOver(T){L(T,T.currentTarget.ownerDocument)},onDragLeave(T){let{ownerDocument:O}=T.currentTarget;ZY(T.relatedTarget,O)||ZY(T.target,O)||(L.cancel(),B())},onDragEnd(){L.cancel(),P(),B()}})}var Yl=l(w(),1),bwe={};function kwe({children:e,clientId:t}){let o=KY(t);return(0,Yl.jsx)(g0,{value:o,children:e})}var vwe=(0,pg.memo)(Vy);function tq(e){let{clientId:t,allowedBlocks:o,prioritizedInserterBlocks:r,defaultBlock:n,directInsert:i,__experimentalDefaultBlock:s,__experimentalDirectInsert:a,template:c,templateLock:u,wrapperRef:d,templateInsertUpdatesSelection:f,__experimentalCaptureToolbars:m,__experimentalAppenderTagName:h,renderAppender:p,orientation:g,placeholder:b,layout:v,name:k,blockType:y,parentLock:S,defaultLayout:x}=e;jY(t,S,o,r,n,i,s,a,u,m,g,v),GY(t,c,u,f);let C=(0,vm.getBlockSupport)(k,"layout")||(0,vm.getBlockSupport)(k,"__experimentalLayout")||bwe,{allowSizingOnChildren:B=!1}=C,I=v||C,P=(0,pg.useMemo)(()=>({...x,...I,...B&&{allowSizingOnChildren:!0}}),[x,I,B]),E=(0,Yl.jsx)(vwe,{rootClientId:t,renderAppender:p,__experimentalAppenderTagName:h,layout:P,wrapperRef:d,placeholder:b});return!y?.providesContext||Object.keys(y.providesContext).length===0?E:(0,Yl.jsx)(kwe,{clientId:t,children:E})}function ywe(e){return h1(e),(0,Yl.jsx)(tq,{...e})}var YB=(0,pg.forwardRef)((e,t)=>{let o=ym({ref:t},e);return(0,Yl.jsx)("div",{className:"block-editor-inner-blocks",children:(0,Yl.jsx)("div",{...o})})});function ym(e={},t={}){let{__unstableDisableLayoutClassNames:o,__unstableDisableDropZone:r,dropZoneElement:n}=t,{clientId:i,layout:s=null,__unstableLayoutClassNames:a=""}=Ie(),c=(0,eq.useSelect)(S=>{let{getBlockName:x,isZoomOut:C,getTemplateLock:B,getBlockRootClientId:I,getBlockEditingMode:P,getBlockSettings:E,getSectionRootClientId:L}=M(S(_));if(!i){let W=L();return{isDropZoneDisabled:C()&&W!==""}}let{hasBlockSupport:T,getBlockType:O}=S(vm.store),D=x(i),U=P(i),G=I(i),[j]=E(i,"layout"),z=U==="disabled";if(C()){let W=L();z=i!==W}return{__experimentalCaptureToolbars:T(D,"__experimentalExposeControlsToChildren",!1),name:D,blockType:O(D),parentLock:B(G),parentClientId:G,isDropZoneDisabled:z,defaultLayout:j}},[i]),{__experimentalCaptureToolbars:u,name:d,blockType:f,parentLock:m,parentClientId:h,isDropZoneDisabled:p,defaultLayout:g}=c,b=QY({dropZoneElement:n,rootClientId:i,parentClientId:h}),v=(0,JY.useMergeRefs)([e.ref,r||p||s?.isManualPlacement&&window.__experimentalEnableGridInteractivity?null:b]),k={__experimentalCaptureToolbars:u,layout:s,name:d,blockType:f,parentLock:m,defaultLayout:g,...t},y=k.value&&k.onChange?ywe:tq;return{...e,ref:v,className:V(e.className,"block-editor-block-list__layout",o?"":a),children:i?(0,Yl.jsx)(y,{...k,clientId:i}):(0,Yl.jsx)(Vy,{...t})}}ym.save=vm.__unstableGetInnerBlocksProps;YB.DefaultBlockAppender=MY;YB.ButtonBlockAppender=LY;YB.Content=()=>ym.save().children;var tS=YB;var oS=l(Z(),1),hg=l(F(),1),rV=l(Fe(),1),Er=l(it(),1);var oq=l(w(),1),Swe=new Set([Er.UP,Er.RIGHT,Er.DOWN,Er.LEFT,Er.ENTER,Er.BACKSPACE]);function _we(e){let{keyCode:t,shiftKey:o}=e;return!o&&Swe.has(t)}function rS(){let e=(0,hg.useSelect)(o=>o(_).isTyping(),[]),{stopTyping:t}=(0,hg.useDispatch)(_);return(0,oS.useRefEffect)(o=>{if(!e)return;let{ownerDocument:r}=o,n,i;function s(a){let{clientX:c,clientY:u}=a;n&&i&&(n!==c||i!==u)&&t(),n=c,i=u}return r.addEventListener("mousemove",s),()=>{r.removeEventListener("mousemove",s)}},[e,t])}function nS(){let{isTyping:e}=(0,hg.useSelect)(i=>{let{isTyping:s}=i(_);return{isTyping:s()}},[]),{startTyping:t,stopTyping:o}=(0,hg.useDispatch)(_),r=rS(),n=(0,oS.useRefEffect)(i=>{let{ownerDocument:s}=i,{defaultView:a}=s,c=a.getSelection();if(e){let h=function(v){let{target:k}=v;b=a.setTimeout(()=>{(0,rV.isTextField)(k)||o()})},p=function(v){let{keyCode:k}=v;(k===Er.ESCAPE||k===Er.TAB)&&o()},g=function(){c.isCollapsed||o()};var u=h,d=p,f=g;let b;return i.addEventListener("focus",h),i.addEventListener("keydown",p),s.addEventListener("selectionchange",g),()=>{a.clearTimeout(b),i.removeEventListener("focus",h),i.removeEventListener("keydown",p),s.removeEventListener("selectionchange",g)}}function m(h){let{type:p,target:g}=h;!(0,rV.isTextField)(g)||!i.contains(g)||p==="keydown"&&!_we(h)||t()}return i.addEventListener("keypress",m),i.addEventListener("keydown",m),()=>{i.removeEventListener("keypress",m),i.removeEventListener("keydown",m)}},[e,t,o]);return(0,oS.useMergeRefs)([r,n])}function xwe({children:e}){return(0,oq.jsx)("div",{ref:nS(),children:e})}var rq=xwe;var iS=l(A(),1),nq=l(Z(),1),iq=l(F(),1),sq=l(R(),1),aq=l(N(),1);var qB=l(w(),1);function nV({clientId:e,rootClientId:t="",position:o="top"}){let[r,n]=(0,sq.useState)(!1),{sectionRootClientId:i,sectionClientIds:s,insertionPoint:a,blockInsertionPointVisible:c,blockInsertionPoint:u,blocksBeingDragged:d}=(0,iq.useSelect)(x=>{let{getInsertionPoint:C,getBlockOrder:B,getSectionRootClientId:I,isBlockInsertionPointVisible:P,getBlockInsertionPoint:E,getDraggedBlockClientIds:L}=M(x(_)),T=I(),O=B(T);return{sectionRootClientId:T,sectionClientIds:O,insertionPoint:C(),blockInsertionPoint:E(),blockInsertionPointVisible:P(),blocksBeingDragged:L()}},[]),f=(0,nq.useReducedMotion)();if(!e)return;let m=!1;if(!(t===i&&s&&s.includes(e)))return null;let p=a?.index===0&&e===s[a.index],g=a&&a.hasOwnProperty("index")&&e===s[a.index-1];o==="top"&&(m=p||c&&u.index===0&&e===s[u.index]),o==="bottom"&&(m=g||c&&e===s[u.index-1]);let b=d[0],v=d.includes(e),k=s.indexOf(b),S=(k>0?s[k-1]:null)===e;return(v||S)&&(m=!1),(0,qB.jsx)(iS.__unstableAnimatePresence,{children:m&&(0,qB.jsx)(iS.__unstableMotion.div,{initial:{height:0},animate:{height:"calc(1 * var(--wp-block-editor-iframe-zoom-out-frame-size) / var(--wp-block-editor-iframe-zoom-out-scale)"},exit:{height:0},transition:{type:"tween",duration:f?0:.2,ease:[.6,0,.4,1]},className:V("block-editor-block-list__zoom-out-separator",{"is-dragged-over":r}),"data-is-insertion-point":"true",onDragOver:()=>n(!0),onDragLeave:()=>n(!1),children:(0,qB.jsx)(iS.__unstableMotion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:{delay:-.125}},transition:{ease:"linear",duration:.1,delay:.125},children:(0,aq.__)("Drop pattern.")})})})}var Kr=l(w(),1),e1=(0,td.createContext)();e1.displayName="IntersectionObserverContext";var ZB=new WeakMap,wwe={trailing:!0};function Cwe({className:e,...t}){let{isOutlineMode:o,isFocusMode:r,isPreviewMode:n,editedContentOnlySection:i}=(0,Gi.useSelect)(f=>{let{getSettings:m,isTyping:h,hasBlockSpotlight:p,getEditedContentOnlySection:g}=M(f(_)),{outlineMode:b,focusMode:v,isPreviewMode:k}=m();return{isOutlineMode:b&&!h(),isFocusMode:v||p(),isPreviewMode:k,editedContentOnlySection:g()}},[]),s=(0,Gi.useRegistry)(),{setBlockVisibility:a}=(0,Gi.useDispatch)(_),c=(0,XB.useDebounce)((0,td.useCallback)(()=>{let f={};ZB.get(s).forEach(([m,h])=>{f[m]=h}),a(f)},[s]),300,wwe),u=(0,td.useMemo)(()=>{let{IntersectionObserver:f}=window;if(f)return new f(m=>{ZB.get(s)||ZB.set(s,[]);for(let h of m){let p=h.target.getAttribute("data-block");ZB.get(s).push([p,h.isIntersecting])}c()})},[]),d=ym({ref:(0,XB.useMergeRefs)([hm(),IY(),nS()]),className:V("is-root-container",e,{"is-outline-mode":o,"is-focus-mode":r,"is-preview-mode":n})},t);return(0,Kr.jsxs)(e1.Provider,{value:u,children:[(0,Kr.jsx)("div",{...d}),!!i&&(0,Kr.jsx)(Bwe,{clientId:i})]})}function Bwe({clientId:e}){let{stopEditingContentOnlySection:t}=M((0,Gi.useDispatch)(_)),o=(0,Gi.useSelect)(r=>{let{isBlockSelected:n,hasSelectedInnerBlock:i,getBlockSelectionStart:s}=r(_);return!s()||n(e)||i(e,!0)},[e]);return(0,td.useEffect)(()=>{o||t()},[o,t]),null}function Gh(e){return(0,Kr.jsx)(f0,{value:gO,children:(0,Kr.jsx)(Cwe,{...e})})}var Ewe=[],Twe=new Set;function Iwe({placeholder:e,rootClientId:t,renderAppender:o,__experimentalAppenderTagName:r,layout:n=wM}){let i=o!==!1,s=!!o,{order:a,isZoomOut:c,selectedBlocks:u,visibleBlocks:d,shouldRenderAppender:f}=(0,Gi.useSelect)(m=>{let{getSettings:h,getBlockOrder:p,getSelectedBlockClientIds:g,__unstableGetVisibleBlocks:b,getTemplateLock:v,getBlockEditingMode:k,isSectionBlock:y,isContainerInsertableToInContentOnlyMode:S,getBlockName:x,isZoomOut:C,canInsertBlockType:B}=M(m(_)),I=p(t);if(h().isPreviewMode)return{order:I,selectedBlocks:Ewe,visibleBlocks:Twe};let P=g(),E=P[0],L=!t&&!E&&(!I.length||!B((0,lq.getDefaultBlockName)(),t)),T=!!(t&&E&&t===E),O=v(t);return{order:I,selectedBlocks:P,visibleBlocks:b(),isZoomOut:C(),shouldRenderAppender:(!y(t)||S(x(E),t))&&k(t)!=="disabled"&&(!O||O==="contentOnly")&&i&&!C()&&(s||T||L)}},[t,i,s]);return(0,Kr.jsxs)(mH,{value:n,children:[a.map(m=>(0,Kr.jsxs)(Gi.AsyncModeProvider,{value:!d.has(m)&&!u.includes(m),children:[c&&(0,Kr.jsx)(nV,{clientId:m,rootClientId:t,position:"top"}),(0,Kr.jsx)(g9,{rootClientId:t,clientId:m}),c&&(0,Kr.jsx)(nV,{clientId:m,rootClientId:t,position:"bottom"})]},m)),a.length<1&&e,f&&(0,Kr.jsx)(dY,{tagName:r,rootClientId:t,CustomAppender:o})]})}function Vy(e){return(0,Kr.jsx)(Gi.AsyncModeProvider,{value:!1,children:(0,Kr.jsx)(Iwe,{...e})})}var Ug=l(F(),1),JV=l(Fe(),1),e3=l(A(),1),YQ=l(Is(),1),ST=l(R(),1),Hg=l($(),1),t3=l(Xo(),1),Gg=l(N(),1);var Mq=l(Z(),1),Dq=l(F(),1),Vq=l(Fe(),1),Ea=l(R(),1);var Xn=l(N(),1),_m=l($(),1),sE=l(A(),1),Pq=l(Z(),1),Rq=l(F(),1),aE=l(R(),1);var aS=l(A(),1),mq=l(Qv(),1),pq=l(Re(),1),oE=l(R(),1);var Tr=l(A(),1),cq=(0,Tr.createSlotFill)("InspectorControls"),Pwe=(0,Tr.createSlotFill)("InspectorAdvancedControls"),Rwe=(0,Tr.createSlotFill)("InspectorControlsBindings"),Owe=(0,Tr.createSlotFill)("InspectorControlsBackground"),Awe=(0,Tr.createSlotFill)("InspectorControlsBorder"),Lwe=(0,Tr.createSlotFill)("InspectorControlsColor"),Nwe=(0,Tr.createSlotFill)("InspectorControlsFilter"),Mwe=(0,Tr.createSlotFill)("InspectorControlsDimensions"),Dwe=(0,Tr.createSlotFill)("InspectorControlsPosition"),Vwe=(0,Tr.createSlotFill)("InspectorControlsTypography"),Fwe=(0,Tr.createSlotFill)("InspectorControlsListView"),zwe=(0,Tr.createSlotFill)("InspectorControlsStyles"),jwe=(0,Tr.createSlotFill)("InspectorControlsEffects"),Uwe=(0,Tr.createSlotFill)("InspectorControlsContent"),Hwe={default:cq,advanced:Pwe,background:Owe,bindings:Rwe,border:Awe,color:Lwe,content:Uwe,dimensions:Mwe,effects:jwe,filter:Nwe,list:Fwe,position:Dwe,settings:cq,styles:zwe,typography:Vwe},Wi=Hwe,sS=(0,Tr.createSlotFill)(Symbol("PrivateInspectorControlsAllowedBlocks"));var gg=l(A(),1),JB=l(R(),1),uq=l(Z(),1),eE=l(F(),1);var QB=l(w(),1),dq=Symbol("ListViewContentPopover"),{Fill:fq,Slot:Gwe}=(0,gg.createSlotFill)(dq);function Wwe(){return(0,uq.useViewportMatch)("medium","<")?{}:{popoverProps:{placement:"left-start",offset:35,resize:!1}}}function tE({listViewRef:e}){let{popoverProps:t}=Wwe(),o=(0,gg.__experimentalUseSlotFills)(dq),r=!!(o&&o.length),{selectedClientId:n,isOpen:i}=(0,eE.useSelect)(u=>{let{getSelectedBlockClientId:d}=u(_),f=M(u(_));return{selectedClientId:d(),isOpen:f.isListViewContentPanelOpen()}},[]),[s,a]=(0,JB.useState)(null);(0,JB.useLayoutEffect)(()=>{if(!n||!e?.current){a(null);return}let u=e.current.querySelector(`[data-block="${n}"]`);a(u)},[n,e]);let{closeListViewContentPanel:c}=M((0,eE.useDispatch)(_));return!i||!r||!s?null:(0,QB.jsx)(gg.Popover,{...t??{},className:"block-editor-inspector-list-view-content-popover",anchor:s,onClose:c,children:(0,QB.jsx)("div",{style:{width:"280px"},children:(0,QB.jsx)(Gwe,{})})})}var od=l(w(),1),$we=["content","list"],Kwe=["default","settings","advanced"];function Sm({children:e,group:t="default",__experimentalGroup:o,resetAllFilter:r}){o&&((0,pq.default)("`__experimentalGroup` property in `InspectorControlsFill`",{since:"6.2",version:"6.4",alternative:"`group`"}),t=o);let n=Ie(),i=Wi[t]?.Fill;if(!i)return(0,mq.default)(`Unknown InspectorControls group "${t}" provided.`),null;if(n[$c]){let s=n.name==="core/template-part",a=Kwe.includes(t),c=$we.includes(t);if(!(s&&a||c))return null}return!n[$c]&&!n[bs]?null:t==="content"&&n[Hk]&&n[$c]?n[bs]?(0,od.jsx)(aS.__experimentalStyleProvider,{document,children:(0,od.jsx)(fq,{children:e})}):null:(0,od.jsx)(aS.__experimentalStyleProvider,{document,children:(0,od.jsx)(i,{children:s=>(0,od.jsx)(qwe,{fillProps:s,children:e,resetAllFilter:r})})})}function Ywe({resetAllFilter:e,children:t}){let{registerResetAllFilter:o,deregisterResetAllFilter:r}=(0,oE.useContext)(aS.__experimentalToolsPanelContext);return(0,oE.useEffect)(()=>{if(e&&o&&r)return o(e),()=>{r(e)}},[e,o,r]),t}function qwe({children:e,resetAllFilter:t,fillProps:o}){let{forwardedContext:r=[]}=o,n=(0,od.jsx)(Ywe,{resetAllFilter:t,children:e});return r.reduce((i,[s,a])=>(0,od.jsx)(s,{...a,children:i}),n)}var _q=l(A(),1),xq=l(R(),1),wq=l(Qv(),1),Cq=l(Re(),1);var gq=l(A(),1),rE=l(F(),1),bq=l(R(),1);var hq=l(Z(),1);function Ro(){return(0,hq.useViewportMatch)("medium","<")?{}:{popoverProps:{placement:"left-start",offset:259}}}function bg(e,t){if(!e||!t)return t;let o=e.split(","),r=t.split(","),n=[];return o.forEach(i=>{r.forEach(s=>{n.push(`${i.trim()} ${s.trim()}`)})}),n.join(", ")}var kq=l(w(),1);function vq({children:e,group:t,label:o}){let{updateBlockAttributes:r}=(0,rE.useDispatch)(_),{getBlockAttributes:n,getMultiSelectedBlockClientIds:i,getSelectedBlockClientId:s,hasMultiSelection:a}=(0,rE.useSelect)(_),c=Ro(),u=s(),d=(0,bq.useCallback)((f=[])=>{let m={},h=a()?i():[u];h.forEach(p=>{let{style:g}=n(p),b={style:g};f.forEach(v=>{b={...b,...v(b)}}),b={...b,style:Me(b.style)},m[p]=b}),r(h,m,!0)},[n,i,a,u,r]);return(0,kq.jsx)(gq.__experimentalToolsPanel,{className:`${t}-block-support-panel`,label:o,resetAll:d,panelId:u,hasInnerWrapper:!0,shouldRenderPlaceholderItems:!0,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",dropdownMenuProps:c,children:e},u)}var iV=l(A(),1),nE=l(R(),1),yq=l(w(),1);function Sq({Slot:e,fillProps:t,...o}){let r=(0,nE.useContext)(iV.__experimentalToolsPanelContext),n=(0,nE.useMemo)(()=>({...t??{},forwardedContext:[...t?.forwardedContext??[],[iV.__experimentalToolsPanelContext.Provider,{value:r}]]}),[r,t]);return(0,yq.jsx)(e,{...o,fillProps:n,bubblesVirtually:!0})}var iE=l(w(),1);function Zwe({__experimentalGroup:e,group:t="default",label:o,fillProps:r,...n},i){e&&((0,Cq.default)("`__experimentalGroup` property in `InspectorControlsSlot`",{since:"6.2",version:"6.4",alternative:"`group`"}),t=e);let s=Wi[t],a=(0,_q.__experimentalUseSlotFills)(s?.name);if(!s)return(0,wq.default)(`Unknown InspectorControls group "${t}" provided.`),null;if(!a?.length)return null;let{Slot:c}=s;return o?(0,iE.jsx)(vq,{group:t,label:o,children:(0,iE.jsx)(Sq,{...n,fillProps:r,Slot:c})}):(0,iE.jsx)(c,{...n,ref:i,fillProps:r,bubblesVirtually:!0})}var sV=(0,xq.forwardRef)(Zwe);var aV=l(w(),1),Bq=Sm;Bq.Slot=sV;var rd=e=>(0,aV.jsx)(Sm,{...e,group:"advanced"});rd.Slot=function(t){return(0,aV.jsx)(sV,{...t,group:"advanced"})};rd.slotName="InspectorAdvancedControls";var fe=Bq;var Tq=l(F(),1),nd=l($(),1),lS=l(N(),1);function Eq(e){let t=e?.style?.position?.type;return t==="sticky"?(0,lS.__)("Sticky"):t==="fixed"?(0,lS.__)("Fixed"):null}function Tt(e){return(0,Tq.useSelect)(t=>{if(!e)return null;let{getBlockName:o,getBlockAttributes:r,__experimentalGetParsedPattern:n}=t(_),{getBlockType:i,getActiveBlockVariation:s}=t(nd.store),a=o(e),c=i(a);if(!c)return null;let u=r(e),d=u?.metadata?.patternName;if(d){let v=n(d),k=Eq(u);return{isSynced:!1,title:(0,lS.__)("Pattern"),icon:Ei,description:v?.description||(0,lS.__)("A block pattern."),anchor:u?.anchor,positionLabel:k,positionType:u?.style?.position?.type,name:v?.title||u?.metadata?.name}}let f=s(a,u),m=(0,nd.isReusableBlock)(c)||(0,nd.isTemplatePart)(c),p=(m?(0,nd.__experimentalGetBlockLabel)(c,u):void 0)||c.title,g=Eq(u),b={isSynced:m,title:p,icon:c.icon,description:c.description,anchor:u?.anchor,positionLabel:g,positionType:u?.style?.position?.type,name:u?.metadata?.name};return f?{isSynced:m,title:f.title||c.title,icon:f.icon||c.icon,description:f.description||c.description,anchor:u?.anchor,positionLabel:g,positionType:u?.style?.position?.type,name:u?.metadata?.name}:b},[e])}var cS=l(w(),1),uS="position",lV={key:"default",value:"",name:(0,Xn.__)("Default")},cV={key:"sticky",value:"sticky",name:(0,Xn._x)("Sticky","Name for the value of the CSS position property"),hint:(0,Xn.__)("The block will stick to the top of the window instead of scrolling.")},Iq={key:"fixed",value:"fixed",name:(0,Xn._x)("Fixed","Name for the value of the CSS position property"),hint:(0,Xn.__)("The block will not move when the page is scrolled.")},Xwe=["top","right","bottom","left"],Qwe=["sticky","fixed"];function Jwe({selector:e,style:t}){let o="",{type:r}=t?.position||{};return Qwe.includes(r)&&(o+=`${e} {`,o+=`position: ${r};`,Xwe.forEach(n=>{t?.position?.[n]!==void 0&&(o+=`${n}: ${t.position[n]};`)}),(r==="sticky"||r==="fixed")&&(o+="z-index: 10"),o+="}"),o}function eCe(e){let t=(0,_m.getBlockSupport)(e,uS);return!!(t===!0||t?.sticky)}function tCe(e){let t=(0,_m.getBlockSupport)(e,uS);return!!(t===!0||t?.fixed)}function oCe(e){return!!(0,_m.getBlockSupport)(e,uS)}function Oq(e){let t=e?.style?.position?.type;return t==="sticky"||t==="fixed"}function Aq({name:e}={}){let[t,o]=me("position.fixed","position.sticky"),r=!t&&!o;return!oCe(e)||r}function rCe({style:e={},clientId:t,name:o,setAttributes:r}){let n=tCe(o),i=eCe(o),s=e?.position?.type,{firstParentClientId:a}=(0,Rq.useSelect)(h=>{let{getBlockParents:p}=h(_),g=p(t);return{firstParentClientId:g[g.length-1]}},[t]),c=Tt(a),u=i&&s===cV.value&&c?(0,Xn.sprintf)((0,Xn.__)("The block will stick to the scrollable area of the parent %s block."),c.title):null,d=(0,aE.useMemo)(()=>{let h=[lV];return(i||s===cV.value)&&h.push(cV),(n||s===Iq.value)&&h.push(Iq),h},[n,i,s]),f=h=>{let g={...e,position:{...e?.position,type:h,top:h==="sticky"||h==="fixed"?"0px":void 0}};r({style:Me(g)})},m=s&&d.find(h=>h.value===s)||lV;return aE.Platform.select({web:d.length>1?(0,cS.jsx)(fe,{group:"position",children:(0,cS.jsx)(sE.BaseControl,{help:u,children:(0,cS.jsx)(sE.CustomSelectControl,{__next40pxDefaultSize:!0,label:(0,Xn.__)("Position"),hideLabelFromVision:!0,describedBy:(0,Xn.sprintf)((0,Xn.__)("Currently selected position: %s"),m.name),options:d,value:m,onChange:({selectedItem:h})=>{f(h.value)},size:"__unstable-large"})})}):null,native:null})}var uV={edit:function(t){return Aq(t)?null:(0,cS.jsx)(rCe,{...t})},useBlockProps:iCe,attributeKeys:["style"],hasSupport(e){return(0,_m.hasBlockSupport)(e,uS)}},nCe={};function iCe({name:e,style:t}){let o=(0,_m.hasBlockSupport)(e,uS),r=Aq({name:e}),n=o&&!r,i=(0,Pq.useInstanceId)(nCe),s=`.wp-container-${i}.wp-container-${i}`,a;n&&(a=Jwe({selector:s,style:t})||"");let c=V({[`wp-container-${i}`]:n&&!!a,[`is-position-${t?.position?.type}`]:n&&!!a&&!!t?.position?.type});return Qn({css:a}),{className:c}}var Fq={placement:"top-start"},Lq={...Fq,flip:!1,shift:!0},sCe={...Fq,flip:!0,shift:!1};function Nq(e,t,o,r,n){if(!e||!t)return Lq;let i=o?.scrollTop||0,s=Sh(t),a=e.getBoundingClientRect(),c=i+a.top,u=e.ownerDocument.documentElement.clientHeight,d=c+r,f=s.top>d,m=s.height>u-r;return!n&&(f||m)?Lq:sCe}function lE({contentElement:e,clientId:t}){let o=Xe(t),[r,n]=(0,Ea.useState)(0),{blockIndex:i,isSticky:s}=(0,Dq.useSelect)(m=>{let{getBlockIndex:h,getBlockAttributes:p}=m(_);return{blockIndex:h(t),isSticky:Oq(p(t))}},[t]),a=(0,Ea.useMemo)(()=>{if(e)return(0,Vq.getScrollContainer)(e)},[e]),[c,u]=(0,Ea.useState)(()=>Nq(e,o,a,r,s)),d=(0,Mq.useRefEffect)(m=>{n(m.offsetHeight)},[]),f=(0,Ea.useCallback)(()=>u(Nq(e,o,a,r,s)),[e,o,a,r]);return(0,Ea.useLayoutEffect)(f,[i,f]),(0,Ea.useLayoutEffect)(()=>{if(!e||!o)return;let m=e?.ownerDocument?.defaultView;m?.addEventHandler?.("resize",f);let h,p=o?.ownerDocument?.defaultView;return p.ResizeObserver&&(h=new p.ResizeObserver(f),h.observe(o)),()=>{m?.removeEventHandler?.("resize",f),h&&h.disconnect()}},[f,e,o]),{...c,ref:d}}var zq=l(F(),1);function cE(e){return(0,zq.useSelect)(o=>{let{getBlockRootClientId:r,getBlockParents:n,__experimentalGetBlockListSettingsForBlocks:i,isBlockInsertionPointVisible:s,getBlockInsertionPoint:a,getBlockOrder:c,hasMultiSelection:u,getLastMultiSelectedBlockClientId:d}=o(_),f=n(e),m=i(f),h=f.find(g=>m[g]?.__experimentalCaptureToolbars),p=!1;if(s()){let g=a();p=c(g.rootClientId)[g.index]===e}return{capturingClientId:h,isInsertionPointVisible:p,lastClientId:u()?d():null,rootClientId:r(e)}},[e])}var uE=l(w(),1);function jq({clientId:e,__unstableContentRef:t}){let{capturingClientId:o,isInsertionPointVisible:r,lastClientId:n,rootClientId:i}=cE(e),s=lE({contentElement:t?.current,clientId:e});return(0,uE.jsx)(Hi,{clientId:o||e,bottomClientId:n,className:V("block-editor-block-list__block-side-inserter-popover",{"is-insertion-point-visible":r}),__unstableContentRef:t,...s,children:(0,uE.jsx)("div",{className:"block-editor-block-list__empty-block-inserter",children:(0,uE.jsx)(Ui,{position:"bottom right",rootClientId:i,clientId:e,__experimentalIsQuick:!0})})})}var DQ=l(F(),1),jg=l(R(),1),VQ=l(Is(),1);var OQ=l(N(),1),AQ=l(F(),1),qV=l(R(),1),LQ=l(Z(),1),nc=l($(),1),NQ=l(A(),1);var xm=l(A(),1),Qq=l(F(),1),Jq=l(N(),1);var $q=l($(),1),Kq=l(A(),1),dS=l(F(),1),fS=l(R(),1),Yq=l(Z(),1);var Hq=l(Fe(),1),Ta=l(R(),1),dE=50,Gq=25,aCe=1e3,Uq=aCe*(Gq/1e3);function Wq(){let e=(0,Ta.useRef)(null),t=(0,Ta.useRef)(null),o=(0,Ta.useRef)(null),r=(0,Ta.useRef)(null);(0,Ta.useEffect)(()=>()=>{r.current&&(clearInterval(r.current),r.current=null)},[]);let n=(0,Ta.useCallback)(a=>{e.current=a.clientY,o.current=(0,Hq.getScrollContainer)(a.target),r.current=setInterval(()=>{if(o.current&&t.current){let c=o.current.scrollTop+t.current;o.current.scroll({top:c})}},Gq)},[]),i=(0,Ta.useCallback)(a=>{if(!o.current)return;let c=o.current.offsetHeight,u=e.current-o.current.offsetTop,d=a.clientY-o.current.offsetTop;if(a.clientY>u){let f=Math.max(c-u-dE,0),m=Math.max(d-u-dE,0),h=f===0||m===0?0:m/f;t.current=Uq*h}else if(a.clientY<u){let f=Math.max(u-dE,0),m=Math.max(u-d-dE,0),h=f===0||m===0?0:m/f;t.current=-Uq*h}else t.current=0},[]);return[n,i,()=>{e.current=null,o.current=null,r.current&&(clearInterval(r.current),r.current=null)}]}var dV=l(w(),1),lCe=({appendToOwnerDocument:e,children:t,clientIds:o,cloneClassname:r,elementId:n,onDragStart:i,onDragEnd:s,fadeWhenDisabled:a=!1,dragComponent:c})=>{let{srcRootClientId:u,isDraggable:d,icon:f,visibleInserter:m,getBlockType:h}=(0,dS.useSelect)(E=>{let{canMoveBlocks:L,getBlockRootClientId:T,getBlockName:O,getBlockAttributes:D,isBlockInsertionPointVisible:U}=E(_),{getBlockType:G,getActiveBlockVariation:j}=E($q.store),z=T(o[0]),W=O(o[0]),ee=j(W,D(o[0]));return{srcRootClientId:z,isDraggable:L(o),icon:ee?.icon||G(W)?.icon,visibleInserter:U(),getBlockType:G}},[o]),p=(0,fS.useRef)(!1),[g,b,v]=Wq(),{getAllowedBlocks:k,getBlockNamesByClientId:y,getBlockRootClientId:S}=(0,dS.useSelect)(_),{startDraggingBlocks:x,stopDraggingBlocks:C}=(0,dS.useDispatch)(_);(0,fS.useEffect)(()=>()=>{p.current&&C()},[]);let I=Xe(o[0])?.closest("body");return(0,fS.useEffect)(()=>{if(!I||!a)return;let L=(0,Yq.throttle)(T=>{if(!T.target.closest("[data-block]"))return;let O=y(o),D=T.target.closest("[data-block]").getAttribute("data-block"),U=k(D),G=y([D])[0],j;if(U?.length===0){let z=S(D),W=y([z])[0],ee=k(z);j=KB(h,ee,O,W)}else j=KB(h,U,O,G);!j&&!m?window?.document?.body?.classList?.add("block-draggable-invalid-drag-token"):window?.document?.body?.classList?.remove("block-draggable-invalid-drag-token")},200);return I.addEventListener("dragover",L),()=>{I.removeEventListener("dragover",L)}},[o,I,a,k,y,S,h,m]),d?(0,dV.jsx)(Kq.Draggable,{appendToOwnerDocument:e,cloneClassname:r,__experimentalTransferDataType:"wp-blocks",transferData:{type:"block",srcClientIds:o,srcRootClientId:u},onDragStart:E=>{window.requestAnimationFrame(()=>{x(o),p.current=!0,g(E),i&&i()})},onDragOver:b,onDragEnd:()=>{C(),p.current=!1,v(),s&&s()},__experimentalDragComponent:c!==void 0?c:(0,dV.jsx)(eB,{count:o.length,icon:f,fadeWhenDisabled:!0}),elementId:n,children:({onDraggableStart:E,onDraggableEnd:L})=>t({draggable:!0,onDragStart:E,onDragEnd:L})}):t({draggable:!1})},fE=lCe;var Zq=l($(),1),mE=l(A(),1),Xq=l(Z(),1),pE=l(F(),1),hE=l(R(),1),$i=l(N(),1);var ke=l(N(),1),id=(e,t)=>e==="up"?t==="horizontal"?(0,ke.isRTL)()?"right":"left":"up":e==="down"?t==="horizontal"?(0,ke.isRTL)()?"left":"right":"down":null;function qq(e,t,o,r,n,i,s){let a=o+1;if(e>1)return cCe(e,o,r,n,i,s);if(r&&n)return(0,ke.sprintf)((0,ke.__)("Block %s is the only block, and cannot be moved"),t);if(i>0&&!n){let c=id("down",s);if(c==="down")return(0,ke.sprintf)((0,ke.__)("Move %1$s block from position %2$d down to position %3$d"),t,a,a+1);if(c==="left")return(0,ke.sprintf)((0,ke.__)("Move %1$s block from position %2$d left to position %3$d"),t,a,a+1);if(c==="right")return(0,ke.sprintf)((0,ke.__)("Move %1$s block from position %2$d right to position %3$d"),t,a,a+1)}if(i>0&&n){let c=id("down",s);if(c==="down")return(0,ke.sprintf)((0,ke.__)("Block %1$s is at the end of the content and can\u2019t be moved down"),t);if(c==="left")return(0,ke.sprintf)((0,ke.__)("Block %1$s is at the end of the content and can\u2019t be moved left"),t);if(c==="right")return(0,ke.sprintf)((0,ke.__)("Block %1$s is at the end of the content and can\u2019t be moved right"),t)}if(i<0&&!r){let c=id("up",s);if(c==="up")return(0,ke.sprintf)((0,ke.__)("Move %1$s block from position %2$d up to position %3$d"),t,a,a-1);if(c==="left")return(0,ke.sprintf)((0,ke.__)("Move %1$s block from position %2$d left to position %3$d"),t,a,a-1);if(c==="right")return(0,ke.sprintf)((0,ke.__)("Move %1$s block from position %2$d right to position %3$d"),t,a,a-1)}if(i<0&&r){let c=id("up",s);if(c==="up")return(0,ke.sprintf)((0,ke.__)("Block %1$s is at the beginning of the content and can\u2019t be moved up"),t);if(c==="left")return(0,ke.sprintf)((0,ke.__)("Block %1$s is at the beginning of the content and can\u2019t be moved left"),t);if(c==="right")return(0,ke.sprintf)((0,ke.__)("Block %1$s is at the beginning of the content and can\u2019t be moved right"),t)}}function cCe(e,t,o,r,n,i){let s=t+1;if(o&&r)return(0,ke.__)("All blocks are selected, and cannot be moved");if(n>0&&!r){let a=id("down",i);if(a==="down")return(0,ke.sprintf)((0,ke.__)("Move %1$d blocks from position %2$d down by one place"),e,s);if(a==="left")return(0,ke.sprintf)((0,ke.__)("Move %1$d blocks from position %2$d left by one place"),e,s);if(a==="right")return(0,ke.sprintf)((0,ke.__)("Move %1$d blocks from position %2$d right by one place"),e,s)}if(n>0&&r){let a=id("down",i);if(a==="down")return(0,ke.__)("Blocks cannot be moved down as they are already at the bottom");if(a==="left")return(0,ke.__)("Blocks cannot be moved left as they are already are at the leftmost position");if(a==="right")return(0,ke.__)("Blocks cannot be moved right as they are already are at the rightmost position")}if(n<0&&!o){let a=id("up",i);if(a==="up")return(0,ke.sprintf)((0,ke.__)("Move %1$d blocks from position %2$d up by one place"),e,s);if(a==="left")return(0,ke.sprintf)((0,ke.__)("Move %1$d blocks from position %2$d left by one place"),e,s);if(a==="right")return(0,ke.sprintf)((0,ke.__)("Move %1$d blocks from position %2$d right by one place"),e,s)}if(n<0&&o){let a=id("up",i);if(a==="up")return(0,ke.__)("Blocks cannot be moved up as they are already at the top");if(a==="left")return(0,ke.__)("Blocks cannot be moved left as they are already are at the leftmost position");if(a==="right")return(0,ke.__)("Blocks cannot be moved right as they are already are at the rightmost position")}}var ql=l(w(),1),uCe=(e,t)=>e==="up"?t==="horizontal"?(0,$i.isRTL)()?Vo:Mr:xf:e==="down"?t==="horizontal"?(0,$i.isRTL)()?Mr:Vo:zn:null,dCe=(e,t)=>e==="up"?t==="horizontal"?(0,$i.isRTL)()?(0,$i.__)("Move right"):(0,$i.__)("Move left"):(0,$i.__)("Move up"):e==="down"?t==="horizontal"?(0,$i.isRTL)()?(0,$i.__)("Move left"):(0,$i.__)("Move right"):(0,$i.__)("Move down"):null,fV=(0,hE.forwardRef)(({clientIds:e,direction:t,orientation:o,...r},n)=>{let i=(0,Xq.useInstanceId)(fV),s=Array.isArray(e)?e:[e],a=s.length,{disabled:c}=r,{blockType:u,isDisabled:d,rootClientId:f,isFirst:m,isLast:h,firstIndex:p,orientation:g="vertical"}=(0,pE.useSelect)(x=>{let{getBlockIndex:C,getBlockRootClientId:B,getBlockOrder:I,getBlock:P,getBlockListSettings:E}=x(_),L=s[0],T=B(L),O=C(L),D=C(s[s.length-1]),U=I(T),G=P(L),j=O===0,z=D===U.length-1,{orientation:W}=E(T)||{};return{blockType:G?(0,Zq.getBlockType)(G.name):null,isDisabled:c||(t==="up"?j:z),rootClientId:T,firstIndex:O,isFirst:j,isLast:z,orientation:o||W}},[e,t]),{moveBlocksDown:b,moveBlocksUp:v}=(0,pE.useDispatch)(_),k=t==="up"?v:b,y=x=>{k(e,f),r.onClick&&r.onClick(x)},S=`block-editor-block-mover-button__description-${i}`;return(0,ql.jsxs)(ql.Fragment,{children:[(0,ql.jsx)(mE.Button,{__next40pxDefaultSize:!0,ref:n,className:V("block-editor-block-mover-button",`is-${t}-button`),icon:uCe(t,g),label:dCe(t,g),"aria-describedby":S,...r,onClick:d?null:y,disabled:d,accessibleWhenDisabled:!0}),(0,ql.jsx)(mE.VisuallyHidden,{id:S,children:qq(a,u&&u.title,p,m,h,t==="up"?-1:1,g)})]})}),gE=(0,hE.forwardRef)((e,t)=>(0,ql.jsx)(fV,{direction:"up",ref:t,...e})),bE=(0,hE.forwardRef)((e,t)=>(0,ql.jsx)(fV,{direction:"down",ref:t,...e}));var Ia=l(w(),1);function fCe({clientIds:e,hideDragHandle:t,isBlockMoverUpButtonDisabled:o,isBlockMoverDownButtonDisabled:r}){let{canMove:n,rootClientId:i,isFirst:s,isLast:a,orientation:c,isManualGrid:u}=(0,Qq.useSelect)(d=>{let{getBlockIndex:f,getBlockListSettings:m,canMoveBlocks:h,getBlockOrder:p,getBlockRootClientId:g,getBlockAttributes:b}=d(_),v=Array.isArray(e)?e:[e],k=v[0],y=g(k),S=f(k),x=f(v[v.length-1]),C=p(y),{layout:B={}}=b(y)??{};return{canMove:h(e),rootClientId:y,isFirst:S===0,isLast:x===C.length-1,orientation:m(y)?.orientation,isManualGrid:B.type==="grid"&&B.isManualPlacement&&window.__experimentalEnableGridInteractivity}},[e]);return!n||s&&a&&!i||t&&u?null:(0,Ia.jsxs)(xm.ToolbarGroup,{className:V("block-editor-block-mover",{"is-horizontal":c==="horizontal"}),children:[!t&&(0,Ia.jsx)(fE,{clientIds:e,fadeWhenDisabled:!0,children:d=>(0,Ia.jsx)(xm.Button,{__next40pxDefaultSize:!0,icon:tv,className:"block-editor-block-mover__drag-handle",label:(0,Jq.__)("Drag"),tabIndex:"-1",...d})}),!u&&(0,Ia.jsxs)("div",{className:"block-editor-block-mover__move-button-container",children:[(0,Ia.jsx)(xm.ToolbarItem,{children:d=>(0,Ia.jsx)(gE,{disabled:o,clientIds:e,...d})}),(0,Ia.jsx)(xm.ToolbarItem,{children:d=>(0,Ia.jsx)(bE,{disabled:r,clientIds:e,...d})})]})]})}var kE=fCe;var oZ=l(A(),1),yE=l(F(),1),SE=l(N(),1),rZ=l(R(),1);var mS=l(F(),1),sd=l(R(),1);var{clearTimeout:eZ,setTimeout:mCe}=window,tZ=200;function pCe({ref:e,isFocused:t,highlightParent:o,debounceTimeout:r=tZ}){let{getSelectedBlockClientId:n,getBlockRootClientId:i}=(0,mS.useSelect)(_),{toggleBlockHighlight:s}=(0,mS.useDispatch)(_),a=(0,sd.useRef)(),c=(0,mS.useSelect)(g=>g(_).getSettings().isDistractionFree,[]),u=g=>{if(g&&c)return;let b=n(),v=o?i(b):b;s(v,g)},d=()=>e?.current&&e.current.matches(":hover"),f=()=>{let g=d();return!t&&!g},m=()=>{let g=a.current;g&&eZ&&eZ(g)},h=g=>{g&&g.stopPropagation(),m(),u(!0)},p=g=>{g&&g.stopPropagation(),m(),a.current=mCe(()=>{f()&&u(!1)},r)};return(0,sd.useEffect)(()=>()=>{u(!1),m()},[]),{debouncedShowGestures:h,debouncedHideGestures:p}}function kg({ref:e,highlightParent:t=!1,debounceTimeout:o=tZ}){let[r,n]=(0,sd.useState)(!1),{debouncedShowGestures:i,debouncedHideGestures:s}=pCe({ref:e,debounceTimeout:o,isFocused:r,highlightParent:t}),a=(0,sd.useRef)(!1),c=()=>e?.current&&e.current.contains(e.current.ownerDocument.activeElement);return(0,sd.useEffect)(()=>{let u=e.current,d=()=>{c()&&(n(!0),i())},f=()=>{c()||(n(!1),s())};return u&&!a.current&&(u.addEventListener("focus",d,!0),u.addEventListener("blur",f,!0),a.current=!0),()=>{u&&(u.removeEventListener("focus",d),u.removeEventListener("blur",f))}},[e,a,n,i,s]),{onMouseMove:i,onMouseLeave:s}}var vE=l(w(),1);function nZ(){let{selectBlock:e}=(0,yE.useDispatch)(_),{parentClientId:t}=(0,yE.useSelect)(i=>{let{getBlockParents:s,getSelectedBlockClientId:a,getParentSectionBlock:c}=M(i(_)),u=a(),d=c(u),f=s(u);return{parentClientId:d??f[f.length-1]}},[]),o=Tt(t),r=(0,rZ.useRef)(),n=kg({ref:r,highlightParent:!0});return(0,vE.jsx)("div",{className:"block-editor-block-parent-selector",ref:r,...n,children:(0,vE.jsx)(oZ.ToolbarButton,{className:"block-editor-block-parent-selector__button",onClick:()=>e(t),label:(0,SE.sprintf)((0,SE.__)("Select parent block: %s"),o?.title),showTooltip:!0,icon:(0,vE.jsx)(Ae,{icon:o?.icon})})},t)}var _E=l(A(),1);var vg=l(A(),1),hCe=(0,vg.createSlotFill)("BlockControls"),gCe=(0,vg.createSlotFill)("BlockControlsBlock"),bCe=(0,vg.createSlotFill)("BlockFormatControls"),kCe=(0,vg.createSlotFill)("BlockControlsOther"),vCe=(0,vg.createSlotFill)("BlockControlsParent"),yCe={default:hCe,block:gCe,inline:bCe,other:kCe,parent:vCe},pS=yCe;function iZ(e,t){let o=Ie();return o[bs]?pS[e]?.Fill:o[Pp]&&t?pS.parent.Fill:null}var Zl=l(w(),1);function mV({group:e="default",controls:t,children:o,__experimentalShareWithChildBlocks:r=!1}){let n=iZ(e,r);if(!n)return null;let i=(0,Zl.jsxs)(Zl.Fragment,{children:[e==="default"&&(0,Zl.jsx)(_E.ToolbarGroup,{controls:t}),o]});return(0,Zl.jsx)(_E.__experimentalStyleProvider,{document,children:(0,Zl.jsx)(n,{children:s=>{let{forwardedContext:a=[]}=s;return a.reduce((c,[u,d])=>(0,Zl.jsx)(u,{...d,children:c}),i)}})})}var hS=l(R(),1),Xl=l(A(),1),aZ=l(Qv(),1);var pV=l(w(),1),{ComponentsContext:sZ}=M(Xl.privateApis);function hV({group:e="default",...t}){let o=(0,hS.useContext)(Xl.__experimentalToolbarContext),r=(0,hS.useContext)(sZ),n=(0,hS.useMemo)(()=>({forwardedContext:[[Xl.__experimentalToolbarContext.Provider,{value:o}],[sZ.Provider,{value:r}]]}),[o,r]),i=pS[e],s=(0,Xl.__experimentalUseSlotFills)(i.name);if(!i)return(0,aZ.default)(`Unknown BlockControls group "${e}" provided.`),null;if(!s?.length)return null;let{Slot:a}=i,c=(0,pV.jsx)(a,{...t,bubblesVirtually:!0,fillProps:n});return e==="default"?c:(0,pV.jsx)(Xl.ToolbarGroup,{children:c})}var gV=l(w(),1),lZ=mV;lZ.Slot=hV;var bV=e=>(0,gV.jsx)(mV,{group:"inline",...e});bV.Slot=function(t){return(0,gV.jsx)(hV,{group:"inline",...t})};var Mt=lZ;var cZ=l(A(),1),{Fill:uZ,Slot:SCe}=(0,cZ.createSlotFill)("__unstableBlockToolbarLastItem");uZ.Slot=SCe;var xE=uZ;var HE=l(A(),1);var wg=l($(),1),ti=l(A(),1),Om=l(F(),1);var jE=l(R(),1),Pa=l(N(),1),fX=l(Is(),1),Rm=l(Z(),1);var Sg=l(F(),1),ad=l($(),1);var EZ=l(R(),1),bS=l($(),1),gS=l(F(),1),TZ=l(Un(),1),Ql=l(N(),1);var Jn=l($(),1),dZ=l(R(),1),_Ce="align";var fZ="__experimentalBorder",wE="color",xCe="customClassName",mZ="typography.__experimentalFontFamily",pZ="typography.fontSize",wCe="typography.lineHeight",CCe="typography.__experimentalFontStyle",BCe="typography.__experimentalFontWeight",hZ="typography.textAlign",ECe="typography.textColumns",TCe="typography.__experimentalTextDecoration",ICe="typography.__experimentalWritingMode",PCe="typography.__experimentalTextTransform",RCe="typography.__experimentalLetterSpacing",OCe="layout",ACe=[wCe,pZ,CCe,BCe,mZ,hZ,ECe,TCe,PCe,ICe,RCe],LCe=["shadow"],NCe="spacing",MCe=[...LCe,...ACe,fZ,wE,NCe],gZ=e=>(0,Jn.hasBlockSupport)(e,_Ce);function bZ(e,t="any"){if(dZ.Platform.OS!=="web")return!1;let o=(0,Jn.getBlockSupport)(e,fZ);return o===!0?!0:t==="any"?!!(o?.color||o?.radius||o?.width||o?.style):!!o?.[t]}var kZ=e=>{let t=(0,Jn.getBlockSupport)(e,wE);return t!==null&&typeof t=="object"&&!!t.gradients},vZ=e=>{let t=(0,Jn.getBlockSupport)(e,wE);return t&&t.background!==!1},yZ=e=>(0,Jn.hasBlockSupport)(e,hZ);var SZ=e=>{let t=(0,Jn.getBlockSupport)(e,wE);return t&&t.text!==!1};var _Z=e=>(0,Jn.hasBlockSupport)(e,xCe,!0);var xZ=e=>(0,Jn.hasBlockSupport)(e,mZ);var wZ=e=>(0,Jn.hasBlockSupport)(e,pZ);var CZ=e=>(0,Jn.hasBlockSupport)(e,OCe);var BZ=e=>MCe.some(t=>(0,Jn.hasBlockSupport)(e,t));function DCe(e){try{let t=(0,bS.parse)(e,{__unstableSkipMigrationLogs:!0,__unstableSkipAutop:!0});return!(t.length===1&&t[0].name==="core/freeform")}catch{return!1}}var VCe={align:gZ,borderColor:e=>bZ(e,"color"),backgroundColor:vZ,textAlign:yZ,textColor:SZ,gradient:kZ,className:_Z,fontFamily:xZ,fontSize:wZ,layout:CZ,style:BZ};function FCe(e,t){return Object.entries(VCe).reduce((o,[r,n])=>(n(e.name)&&n(t.name)&&(o[r]=e.attributes[r]),o),{})}function kV(e,t,o){for(let r=0;r<Math.min(t.length,e.length);r+=1)o(e[r].clientId,FCe(t[r],e[r])),kV(e[r].innerBlocks,t[r].innerBlocks,o)}function yg(){let e=(0,gS.useRegistry)(),{updateBlockAttributes:t}=(0,gS.useDispatch)(_),{createSuccessNotice:o,createWarningNotice:r,createErrorNotice:n}=(0,gS.useDispatch)(TZ.store);return(0,EZ.useCallback)(async i=>{let s="";try{if(!window.navigator.clipboard){n((0,Ql.__)("Unable to paste styles. This feature is only available on secure (https) sites in supporting browsers."),{type:"snackbar"});return}s=await window.navigator.clipboard.readText()}catch{n((0,Ql.__)("Unable to paste styles. Please allow browser clipboard permissions before continuing."),{type:"snackbar"});return}if(!s||!DCe(s)){r((0,Ql.__)("Unable to paste styles. Block styles couldn't be found within the copied content."),{type:"snackbar"});return}let a=(0,bS.parse)(s);if(a.length===1?e.batch(()=>{kV(i,i.map(()=>a[0]),t)}):e.batch(()=>{kV(i,a,t)}),i.length===1){let c=(0,bS.getBlockType)(i[0].name)?.title;o((0,Ql.sprintf)((0,Ql.__)("Pasted styles to %s."),c),{type:"snackbar"})}else o((0,Ql.sprintf)((0,Ql.__)("Pasted styles to %d blocks."),i.length),{type:"snackbar"})},[e.batch,t,o,r,n])}function IZ({clientIds:e,children:t,__experimentalUpdateSelection:o}){let{getDefaultBlockName:r,getGroupingBlockName:n}=(0,Sg.useSelect)(ad.store),i=(0,Sg.useSelect)(y=>{let{canInsertBlockType:S,getBlockRootClientId:x,getBlocksByClientId:C,getDirectInsertBlock:B,canRemoveBlocks:I}=y(_),P=C(e),E=x(e[0]),L=S(r(),E),T=E?B(E):null;return{canRemove:I(e),canInsertBlock:P.every(O=>(L||!!T)&&S(O.name,E)),canCopyStyles:P.every(O=>!!O&&((0,ad.hasBlockSupport)(O.name,"color")||(0,ad.hasBlockSupport)(O.name,"typography"))),canDuplicate:P.every(O=>!!O&&(0,ad.hasBlockSupport)(O.name,"multiple",!0)&&S(O.name,E))}},[e,r]),{getBlocksByClientId:s,getBlocks:a}=(0,Sg.useSelect)(_),{canRemove:c,canInsertBlock:u,canCopyStyles:d,canDuplicate:f}=i,{removeBlocks:m,replaceBlocks:h,duplicateBlocks:p,insertAfterBlock:g,insertBeforeBlock:b,flashBlock:v}=(0,Sg.useDispatch)(_),k=yg();return t({canCopyStyles:d,canDuplicate:f,canInsertBlock:u,canRemove:c,onDuplicate(){return p(e,o)},onRemove(){return m(e,o)},onInsertBefore(){b(e[0])},onInsertAfter(){g(e[e.length-1])},onGroup(){if(!e.length)return;let y=n(),S=(0,ad.switchToBlockType)(s(e),y);S&&h(e,S)},onUngroup(){if(!e.length)return;let y=a(e[0]);y.length&&h(e,y)},onCopy(){e.length===1&&v(e[0])},async onPasteStyles(){await k(s(e))}})}var PZ=l(A(),1),zCe=(0,PZ.createSlotFill)(Symbol("CommentIconSlotFill")),CE=zCe;var RZ=l(N(),1),OZ=l(A(),1),BE=l($(),1),EE=l(F(),1);var AZ=l(w(),1);function jCe({clientId:e}){let t=(0,EE.useSelect)(r=>r(_).getBlock(e),[e]),{replaceBlocks:o}=(0,EE.useDispatch)(_);return!t||t.name!=="core/html"?null:(0,AZ.jsx)(OZ.MenuItem,{onClick:()=>o(e,(0,BE.rawHandler)({HTML:(0,BE.getBlockContent)(t)})),children:(0,RZ.__)("Convert to Blocks")})}var LZ=jCe;var NZ=l(A(),1),{Fill:MZ,Slot:UCe}=(0,NZ.createSlotFill)("__unstableBlockSettingsMenuFirstItem");MZ.Slot=UCe;var TE=MZ;var xg=l(A(),1),nX=l($(),1),iX=l(F(),1);var yV=l(A(),1),SV=l(N(),1),FZ=l($(),1),RE=l(F(),1),zZ=l(it(),1);var DZ=l($(),1),VZ=l(F(),1);function kS(e){return(0,VZ.useSelect)(t=>{let{getBlocksByClientId:o,getSelectedBlockClientIds:r,isUngroupable:n,isGroupable:i}=t(_),{getGroupingBlockName:s,getBlockType:a}=t(DZ.store),c=e?.length?e:r(),u=o(c),[d]=u,f=c.length===1&&n(c[0]);return{clientIds:c,isGroupable:i(c),isUngroupable:f,blocksSelection:u,groupingBlockName:s(),onUngroup:f&&a(d.name)?.transforms?.ungroup}},[e])}var IE=l(F(),1),PE=l($(),1),wm=l(A(),1);var vS=l(N(),1);var Cm=l(w(),1),HCe={group:{type:"constrained"},row:{type:"flex",flexWrap:"nowrap"},stack:{type:"flex",orientation:"vertical"},grid:{type:"grid"}};function GCe(){let{blocksSelection:e,clientIds:t,groupingBlockName:o,isGroupable:r}=kS(),{replaceBlocks:n}=(0,IE.useDispatch)(_),{canRemove:i,variations:s}=(0,IE.useSelect)(p=>{let{canRemoveBlocks:g}=p(_),{getBlockVariations:b}=p(PE.store);return{canRemove:g(t),variations:b(o,"transform")}},[t,o]),a=p=>{let g=(0,PE.switchToBlockType)(e,o);typeof p!="string"&&(p="group"),g&&g.length>0&&(g[0].attributes.layout=HCe[p],n(t,g))},c=()=>a("row"),u=()=>a("stack"),d=()=>a("grid");if(!r||!i)return null;let f=!!s.find(({name:p})=>p==="group-row"),m=!!s.find(({name:p})=>p==="group-stack"),h=!!s.find(({name:p})=>p==="group-grid");return(0,Cm.jsxs)(wm.ToolbarGroup,{children:[(0,Cm.jsx)(wm.ToolbarButton,{icon:nv,label:(0,vS._x)("Group","action: convert blocks to group"),onClick:a}),f&&(0,Cm.jsx)(wm.ToolbarButton,{icon:JL,label:(0,vS._x)("Row","action: convert blocks to row"),onClick:c}),m&&(0,Cm.jsx)(wm.ToolbarButton,{icon:pN,label:(0,vS._x)("Stack","action: convert blocks to stack"),onClick:u}),h&&(0,Cm.jsx)(wm.ToolbarButton,{icon:rv,label:(0,vS._x)("Grid","action: convert blocks to grid"),onClick:d})]})}var vV=GCe;var Bm=l(w(),1);function jZ({clientIds:e,isGroupable:t,isUngroupable:o,onUngroup:r,blocksSelection:n,groupingBlockName:i,onClose:s=()=>{}}){let{getSelectedBlockClientIds:a}=(0,RE.useSelect)(_),{replaceBlocks:c}=(0,RE.useDispatch)(_),u=()=>{let m=(0,FZ.switchToBlockType)(n,i);m&&c(e,m)},d=()=>{let m=n[0].innerBlocks;m.length&&(r&&(m=r(n[0].attributes,n[0].innerBlocks)),c(e,m))};if(!t&&!o)return null;let f=a();return(0,Bm.jsxs)(Bm.Fragment,{children:[t&&(0,Bm.jsx)(yV.MenuItem,{shortcut:f.length>1?zZ.displayShortcut.primary("g"):void 0,onClick:()=>{u(),s()},children:(0,SV._x)("Group","verb")}),o&&(0,Bm.jsx)(yV.MenuItem,{onClick:()=>{d(),s()},children:(0,SV._x)("Ungroup","Ungrouping blocks from within a grouping block back into individual blocks within the Editor")})]})}var _V=l(N(),1),GZ=l(R(),1),WZ=l(A(),1);var UZ=l(F(),1);function ei(e){return(0,UZ.useSelect)(t=>{let{canLockBlockType:o,getBlockName:r,isEditLockedBlock:n,isMoveLockedBlock:i,isRemoveLockedBlock:s,isLockedBlock:a}=M(t(_));return{isEditLocked:n(e),isMoveLocked:i(e),isRemoveLocked:s(e),canLock:o(r(e)),isLocked:a(e)}},[e])}var Ki=l(N(),1),yS=l(R(),1),bo=l(A(),1);var OE=l(F(),1),HZ=l($(),1);var It=l(w(),1),WCe=["core/navigation"];function $Ce(e){return e.remove&&e.move?"all":e.remove&&!e.move?"insert":!1}function AE({clientId:e,onClose:t}){let[o,r]=(0,yS.useState)({move:!1,remove:!1}),{isEditLocked:n,isMoveLocked:i,isRemoveLocked:s}=ei(e),{allowsEditLocking:a,templateLock:c,hasTemplateLock:u}=(0,OE.useSelect)(v=>{let{getBlockName:k,getBlockAttributes:y}=v(_),S=k(e),x=(0,HZ.getBlockType)(S);return{allowsEditLocking:WCe.includes(S),templateLock:y(e)?.templateLock,hasTemplateLock:!!x?.attributes?.templateLock}},[e]),[d,f]=(0,yS.useState)(!!c),{updateBlockAttributes:m}=(0,OE.useDispatch)(_),h=Tt(e);(0,yS.useEffect)(()=>{r({move:i,remove:s,...a?{edit:n}:{}})},[n,i,s,a]);let p=Object.values(o).every(Boolean),g=Object.values(o).some(Boolean)&&!p,b=o.move!==i||o.remove!==s||a&&o.edit!==n||u&&d!==!!c;return(0,It.jsx)(bo.Modal,{title:(0,Ki.sprintf)((0,Ki.__)("Lock %s"),h.title),overlayClassName:"block-editor-block-lock-modal",onRequestClose:t,size:"small",children:(0,It.jsxs)("form",{onSubmit:v=>{v.preventDefault(),b&&(m([e],{lock:o,templateLock:d?$Ce(o):void 0}),t())},children:[(0,It.jsxs)("fieldset",{className:"block-editor-block-lock-modal__options",children:[(0,It.jsx)("legend",{children:(0,Ki.__)("Select the features you want to lock")}),(0,It.jsx)("ul",{role:"list",className:"block-editor-block-lock-modal__checklist",children:(0,It.jsxs)("li",{children:[(0,It.jsx)(bo.CheckboxControl,{className:"block-editor-block-lock-modal__options-all",label:(0,Ki.__)("Lock all"),checked:p,indeterminate:g,onChange:v=>r({move:v,remove:v,...a?{edit:v}:{}})}),(0,It.jsxs)("ul",{role:"list",className:"block-editor-block-lock-modal__checklist",children:[a&&(0,It.jsxs)("li",{className:"block-editor-block-lock-modal__checklist-item",children:[(0,It.jsx)(bo.CheckboxControl,{label:(0,Ki.__)("Lock editing"),checked:!!o.edit,onChange:v=>r(k=>({...k,edit:v}))}),(0,It.jsx)(bo.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:o.edit?Rf:vl})]}),(0,It.jsxs)("li",{className:"block-editor-block-lock-modal__checklist-item",children:[(0,It.jsx)(bo.CheckboxControl,{label:(0,Ki.__)("Lock movement"),checked:o.move,onChange:v=>r(k=>({...k,move:v}))}),(0,It.jsx)(bo.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:o.move?Rf:vl})]}),(0,It.jsxs)("li",{className:"block-editor-block-lock-modal__checklist-item",children:[(0,It.jsx)(bo.CheckboxControl,{label:(0,Ki.__)("Lock removal"),checked:o.remove,onChange:v=>r(k=>({...k,remove:v}))}),(0,It.jsx)(bo.Icon,{className:"block-editor-block-lock-modal__lock-icon",icon:o.remove?Rf:vl})]})]})]})}),u&&(0,It.jsx)(bo.ToggleControl,{className:"block-editor-block-lock-modal__template-lock",label:(0,Ki.__)("Apply to all blocks inside"),checked:d,disabled:o.move&&!o.remove,onChange:()=>f(!d)})]}),(0,It.jsxs)(bo.Flex,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1,children:[(0,It.jsx)(bo.FlexItem,{children:(0,It.jsx)(bo.Button,{variant:"tertiary",onClick:t,__next40pxDefaultSize:!0,children:(0,Ki.__)("Cancel")})}),(0,It.jsx)(bo.FlexItem,{children:(0,It.jsx)(bo.Button,{variant:"primary",type:"submit",disabled:!b,accessibleWhenDisabled:!0,__next40pxDefaultSize:!0,children:(0,Ki.__)("Apply")})})]})]})})}var Em=l(w(),1);function xV({clientId:e}){let{canLock:t,isLocked:o}=ei(e),[r,n]=(0,GZ.useReducer)(s=>!s,!1);if(!t)return null;let i=o?(0,_V.__)("Unlock"):(0,_V.__)("Lock");return(0,Em.jsxs)(Em.Fragment,{children:[(0,Em.jsx)(WZ.MenuItem,{icon:o?vl:CL,onClick:n,"aria-expanded":r,"aria-haspopup":"dialog",children:i}),r&&(0,Em.jsx)(AE,{clientId:e,onClose:n})]})}var LE=l(N(),1),NE=l(A(),1),_g=l(R(),1);var ld=l(w(),1);function wV({clientId:e}){let{canLock:t,isLocked:o}=ei(e),[r,n]=(0,_g.useReducer)(a=>!a,!1),i=(0,_g.useRef)(!1);if((0,_g.useEffect)(()=>{o&&(i.current=!0)},[o]),!o&&!i.current)return null;let s=o?(0,LE.__)("Unlock"):(0,LE.__)("Lock");return!t&&o&&(s=(0,LE.__)("Locked")),(0,ld.jsxs)(ld.Fragment,{children:[(0,ld.jsx)(NE.ToolbarGroup,{className:"block-editor-block-lock-toolbar",children:(0,ld.jsx)(NE.ToolbarButton,{disabled:!t,icon:o?Rf:vl,label:s,onClick:n,"aria-expanded":r,"aria-haspopup":"dialog"})}),r&&(0,ld.jsx)(AE,{clientId:e,onClose:n})]})}var CV=l(N(),1),$Z=l(A(),1),ME=l($(),1),DE=l(F(),1);var KZ=l(w(),1),KCe=()=>{};function YZ({clientId:e,onToggle:t=KCe}){let{blockType:o,mode:r,enabled:n}=(0,DE.useSelect)(a=>{let{getBlock:c,getBlockMode:u,getSettings:d}=a(_),f=c(e);return{mode:u(e),blockType:f?(0,ME.getBlockType)(f.name):null,enabled:d().codeEditingEnabled&&!!f?.isValid}},[e]),{toggleBlockMode:i}=(0,DE.useDispatch)(_);if(!o||!(0,ME.hasBlockSupport)(o,"html",!0)||!n)return null;let s=r==="visual"?(0,CV.__)("Edit as HTML"):(0,CV.__)("Edit visually");return(0,KZ.jsx)($Z.MenuItem,{onClick:()=>{i(e),t()},children:s})}var QZ=l(A(),1),JZ=l(N(),1),eX=l(R(),1),tX=l(F(),1),oX=l(Is(),1);var Fs=l(A(),1),Vs=l(N(),1),ZZ=l(R(),1),XZ=l(Xo(),1),VE=l(F(),1);function qZ(e){return e?.trim()?.length===0}var Jl=l(w(),1);function Tm({clientId:e,onClose:t}){let[o,r]=(0,ZZ.useState)(),n=Tt(e),{metadata:i}=(0,VE.useSelect)(b=>{let{getBlockAttributes:v}=b(_);return{metadata:v(e)?.metadata}},[e]),{updateBlockAttributes:s}=(0,VE.useDispatch)(_),a=i?.name||"",c=n?.title,u=!!a&&!!i?.bindings&&Object.values(i.bindings).some(b=>b.source==="core/pattern-overrides"),d=o!==void 0&&o!==a,f=o===c,m=qZ(o),h=d||f,p=b=>b.target.select(),g=()=>{let b=f||m?void 0:o,v=f||m?(0,Vs.sprintf)((0,Vs.__)('Block name reset to: "%s".'),o):(0,Vs.sprintf)((0,Vs.__)('Block name changed to: "%s".'),o);(0,XZ.speak)(v,"assertive"),s([e],{metadata:Me({...i,name:b})}),t()};return(0,Jl.jsx)(Fs.Modal,{title:(0,Vs.__)("Rename"),onRequestClose:t,overlayClassName:"block-editor-block-rename-modal",focusOnMount:"firstContentElement",size:"small",children:(0,Jl.jsx)("form",{onSubmit:b=>{b.preventDefault(),h&&g()},children:(0,Jl.jsxs)(Fs.__experimentalVStack,{spacing:"3",children:[(0,Jl.jsx)(Fs.TextControl,{__next40pxDefaultSize:!0,value:o??a,label:(0,Vs.__)("Name"),help:u?(0,Vs.__)("This block allows overrides. Changing the name can cause problems with content entered into instances of this pattern."):void 0,placeholder:c,onChange:r,onFocus:p}),(0,Jl.jsxs)(Fs.__experimentalHStack,{justify:"right",children:[(0,Jl.jsx)(Fs.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:t,children:(0,Vs.__)("Cancel")}),(0,Jl.jsx)(Fs.Button,{__next40pxDefaultSize:!0,accessibleWhenDisabled:!0,disabled:!h,variant:"primary",type:"submit",children:(0,Vs.__)("Save")})]})]})})})}var Im=l(w(),1);function BV({clientId:e}){let[t,o]=(0,eX.useState)(!1),r=(0,tX.useSelect)(n=>n(oX.store).getShortcutRepresentation("core/block-editor/rename"),[]);return(0,Im.jsxs)(Im.Fragment,{children:[(0,Im.jsx)(QZ.MenuItem,{onClick:()=>{o(!0)},"aria-expanded":t,"aria-haspopup":"dialog",shortcut:r,children:(0,JZ.__)("Rename")}),t&&(0,Im.jsx)(Tm,{clientId:e,onClose:()=>o(!1)})]})}var rX=l($(),1);function Pm(e){return{canRename:!!e&&(0,rX.getBlockSupport)(e,"renaming",!0)}}var zs=l(w(),1),{Fill:YCe,Slot:qCe}=(0,xg.createSlotFill)("BlockSettingsMenuControls"),ZCe=({fillProps:e,clientIds:t=null})=>{let{selectedBlocks:o,selectedClientIds:r,isContentOnly:n,canToggleSelectedBlocksVisibility:i,canEdit:s}=(0,iX.useSelect)(b=>{let{getBlocksByClientId:v,getBlockNamesByClientId:k,getSelectedBlockClientIds:y,getBlockEditingMode:S,canEditBlock:x}=b(_),C=t!==null?t:y();return{selectedBlocks:k(C),selectedClientIds:C,isContentOnly:S(C[0])==="contentOnly",canToggleSelectedBlocksVisibility:v(C).every(B=>(0,nX.hasBlockSupport)(B.name,"visibility",!0)),canEdit:x(C[0])}},[t]),{canLock:a}=ei(r[0]),{canRename:c}=Pm(o[0]),u=r.length===1&&a&&!n,d=r.length===1&&c&&!n,f=i&&!n,m=kS(r),{isGroupable:h,isUngroupable:p}=m,g=(h||p)&&!n;return(0,zs.jsx)(qCe,{fillProps:{...e,canEdit:s,selectedBlocks:o,selectedClientIds:r},children:b=>!b?.length>0&&!g&&!u?null:(0,zs.jsxs)(xg.MenuGroup,{children:[g&&(0,zs.jsx)(jZ,{...m,onClose:e?.onClose}),s&&u&&(0,zs.jsx)(xV,{clientId:r[0]}),s&&d&&(0,zs.jsx)(BV,{clientId:r[0]}),s&&f&&(0,zs.jsx)(PD,{clientIds:r}),b,s&&e?.count===1&&!n&&(0,zs.jsx)(YZ,{clientId:e?.firstBlockClientId,onToggle:e?.onClose})]})})};function sX({...e}){return(0,zs.jsx)(xg.__experimentalStyleProvider,{document,children:(0,zs.jsx)(YCe,{...e})})}sX.Slot=ZCe;var FE=sX;var aX=l(R(),1),lX=l(A(),1),cX=l(Z(),1),uX=l(F(),1),zE=l(N(),1);var EV=l(w(),1);function dX({parentClientId:e,parentBlockType:t}){let o=(0,cX.useViewportMatch)("medium","<"),{selectBlock:r}=(0,uX.useDispatch)(_),n=(0,aX.useRef)(),i=kg({ref:n,highlightParent:!0});return o?(0,EV.jsx)(lX.MenuItem,{...i,ref:n,icon:(0,EV.jsx)(Ae,{icon:t.icon}),onClick:()=>r(e),children:(0,zE.sprintf)((0,zE.__)("Select parent block (%s)"),t.title)}):null}var kt=l(w(),1),XCe={className:"block-editor-block-settings-menu__popover",placement:"bottom-start"};function TV({clientIds:e,onCopy:t,label:o,shortcut:r,eventType:n="copy",__experimentalUpdateSelection:i=!1}){let{getBlocksByClientId:s}=(0,Om.useSelect)(_),{removeBlocks:a}=(0,Om.useDispatch)(_),c=Oh(),u=(0,Rm.useCopyToClipboard)(()=>(0,wg.serialize)(s(e)),()=>{switch(n){case"copy":case"copyStyles":t(),c(n,e);break;case"cut":c(n,e),a(e,i);break;default:break}}),d=o||(0,Pa.__)("Copy");return(0,kt.jsx)(ti.MenuItem,{ref:u,shortcut:r,children:d})}function IV({block:e,clientIds:t,children:o,__experimentalSelectBlock:r,...n}){let i=t.length,s=t[0],{firstParentClientId:a,parentBlockType:c,previousBlockClientId:u,selectedBlockClientIds:d,isContentOnly:f,isZoomOut:m,canEdit:h}=(0,Om.useSelect)(C=>{let{getBlockName:B,getBlockRootClientId:I,getPreviousBlockClientId:P,getSelectedBlockClientIds:E,getBlockAttributes:L,getBlockEditingMode:T,isZoomOut:O,canEditBlock:D}=M(C(_)),{getActiveBlockVariation:U}=C(wg.store),G=I(s),j=G&&B(G);return{firstParentClientId:G,parentBlockType:G&&(U(j,L(G))||(0,wg.getBlockType)(j)),previousBlockClientId:P(s),selectedBlockClientIds:E(),isContentOnly:T(s)==="contentOnly",isZoomOut:O(),canEdit:D(s)}},[s]),{getBlockOrder:p,getSelectedBlockClientIds:g}=(0,Om.useSelect)(_),b=(0,Om.useSelect)(C=>{let{getShortcutRepresentation:B}=C(fX.store);return{copy:B("core/block-editor/copy"),cut:B("core/block-editor/cut"),duplicate:B("core/block-editor/duplicate"),remove:B("core/block-editor/remove"),insertAfter:B("core/block-editor/insert-after"),insertBefore:B("core/block-editor/insert-before")}},[]),v=d.length>0;async function k(C){if(!r)return;let B=await C;B&&B[0]&&r(B[0],!1)}function y(){if(!r)return;let C=u||a;C||(C=p()[0]);let B=v&&g().length===0;r(C,B)}let x=!d?.includes(a)&&!!a;return(0,kt.jsx)(IZ,{clientIds:t,__experimentalUpdateSelection:!r,children:({canCopyStyles:C,canDuplicate:B,canInsertBlock:I,canRemove:P,onDuplicate:E,onInsertAfter:L,onInsertBefore:T,onRemove:O,onCopy:D,onPasteStyles:U})=>!P&&!B&&!I&&f?null:(0,kt.jsx)(ti.DropdownMenu,{icon:ks,label:(0,Pa.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:XCe,noIcons:!0,...n,children:({onClose:j})=>(0,kt.jsxs)(kt.Fragment,{children:[(0,kt.jsxs)(ti.MenuGroup,{children:[(0,kt.jsx)(TE.Slot,{fillProps:{onClose:j}}),x&&(0,kt.jsx)(dX,{parentClientId:a,parentBlockType:c}),h&&i===1&&(0,kt.jsx)(LZ,{clientId:s}),!f&&(0,kt.jsx)(TV,{clientIds:t,onCopy:D,shortcut:b.copy}),P&&!f&&(0,kt.jsx)(TV,{clientIds:t,label:(0,Pa.__)("Cut"),eventType:"cut",shortcut:b.cut,__experimentalUpdateSelection:!r}),B&&(0,kt.jsx)(ti.MenuItem,{onClick:(0,Rm.pipe)(j,E,k),shortcut:b.duplicate,children:(0,Pa.__)("Duplicate")}),I&&!m&&(0,kt.jsxs)(kt.Fragment,{children:[(0,kt.jsx)(ti.MenuItem,{onClick:(0,Rm.pipe)(j,T),shortcut:b.insertBefore,children:(0,Pa.__)("Add before")}),(0,kt.jsx)(ti.MenuItem,{onClick:(0,Rm.pipe)(j,L),shortcut:b.insertAfter,children:(0,Pa.__)("Add after")})]}),h&&i===1&&(0,kt.jsx)(CE.Slot,{fillProps:{clientId:s,onClose:j}})]}),C&&!f&&(0,kt.jsxs)(ti.MenuGroup,{children:[(0,kt.jsx)(TV,{clientIds:t,onCopy:D,label:(0,Pa.__)("Copy styles"),eventType:"copyStyles"}),h&&(0,kt.jsx)(ti.MenuItem,{onClick:U,children:(0,Pa.__)("Paste styles")})]}),!f&&(0,kt.jsx)(FE.Slot,{fillProps:{onClose:j,count:i,firstBlockClientId:s},clientIds:t}),typeof o=="function"?o({onClose:j}):jE.Children.map(z=>(0,jE.cloneElement)(z,{onClose:j})),P&&(0,kt.jsx)(ti.MenuGroup,{children:(0,kt.jsx)(ti.MenuItem,{onClick:(0,Rm.pipe)(j,O,y),shortcut:b.remove,children:(0,Pa.__)("Delete")})})]})})})}var mX=IV;var pX=l(A(),1),QCe=(0,pX.createSlotFill)(Symbol("CommentIconToolbarSlotFill")),UE=QCe;var Cg=l(w(),1);function JCe({clientIds:e,...t}){return(0,Cg.jsxs)(HE.ToolbarGroup,{children:[(0,Cg.jsx)(UE.Slot,{}),(0,Cg.jsx)(HE.ToolbarItem,{children:o=>(0,Cg.jsx)(mX,{clientIds:e,toggleProps:o,...t})})]})}var GE=JCe;var WE=l(A(),1),hX=l(N(),1),$E=l(F(),1);var PV=l(w(),1);function gX({clientIds:e}){let t=e.length===1?e[0]:void 0,o=(0,$E.useSelect)(n=>!!t&&n(_).getBlockMode(t)==="html",[t]),{toggleBlockMode:r}=(0,$E.useDispatch)(_);return o?(0,PV.jsx)(WE.ToolbarGroup,{children:(0,PV.jsx)(WE.ToolbarButton,{onClick:()=>{r(t)},children:(0,hX.__)("Edit visually")})}):null}var KE=l(A(),1),Yr=l(R(),1),vX=l(F(),1),yX=l(Re(),1),OV=l(Fe(),1),SX=l(Is(),1),_X=l(it(),1);var RV=l(w(),1);function e1e(e){let t="toolbarItem";return!e.some(o=>!(t in o.dataset))}function bX(e){return Array.from(e.querySelectorAll("[data-toolbar-item]:not([disabled])"))}function kX(e){return e.contains(e.ownerDocument.activeElement)}function t1e(e){let[t]=OV.focus.tabbable.find(e);t&&t.focus({preventScroll:!0})}function o1e(e){let[o,r]=(0,Yr.useState)(!0),n=(0,Yr.useCallback)(()=>{let i=OV.focus.tabbable.find(e.current),s=e1e(i);s||(0,yX.default)("Using custom components as toolbar controls",{since:"5.6",alternative:"ToolbarItem, ToolbarButton or ToolbarDropdownMenu components",link:"https://developer.wordpress.org/block-editor/components/toolbar-button/#inside-blockcontrols"}),r(s)},[e]);return(0,Yr.useLayoutEffect)(()=>{let i=new window.MutationObserver(n);return i.observe(e.current,{childList:!0,subtree:!0}),()=>i.disconnect()},[n,o,e]),o}function r1e({toolbarRef:e,focusOnMount:t,isAccessibleToolbar:o,defaultIndex:r,onIndexChange:n,shouldUseKeyboardFocusShortcut:i,focusEditorOnEscape:s}){let[a]=(0,Yr.useState)(t),[c]=(0,Yr.useState)(r),u=(0,Yr.useCallback)(()=>{t1e(e.current)},[e]);(0,SX.useShortcut)("core/block-editor/focus-toolbar",()=>{i&&u()}),(0,Yr.useEffect)(()=>{a&&u()},[o,a,u]),(0,Yr.useEffect)(()=>{let m=e.current,h=0;return!a&&!kX(m)&&(h=window.requestAnimationFrame(()=>{let p=bX(m),g=c||0;p[g]&&kX(m)&&p[g].focus({preventScroll:!0})})),()=>{if(window.cancelAnimationFrame(h),!n||!m)return;let g=bX(m).findIndex(b=>b.tabIndex===0);n(g)}},[c,a,n,e]);let{getLastFocus:f}=M((0,vX.useSelect)(_));(0,Yr.useEffect)(()=>{let m=e.current;if(s){let h=p=>{let g=f();p.keyCode===_X.ESCAPE&&g?.current&&(p.preventDefault(),g.current.focus())};return m.addEventListener("keydown",h),()=>{m.removeEventListener("keydown",h)}}},[s,f,e])}function Bg({children:e,focusOnMount:t,focusEditorOnEscape:o=!1,shouldUseKeyboardFocusShortcut:r=!0,__experimentalInitialIndex:n,__experimentalOnIndexChange:i,orientation:s="horizontal",...a}){let c=(0,Yr.useRef)(),u=o1e(c);return r1e({toolbarRef:c,focusOnMount:t,defaultIndex:n,onIndexChange:i,isAccessibleToolbar:u,shouldUseKeyboardFocusShortcut:r,focusEditorOnEscape:o}),u?(0,RV.jsx)(KE.Toolbar,{label:a["aria-label"],ref:c,orientation:s,...a,children:e}):(0,RV.jsx)(KE.NavigableMenu,{orientation:s,role:"toolbar",ref:c,...a,children:e})}var xX=l(F(),1),YE=l($(),1);function qE(){return(0,xX.useSelect)(t=>{let{getBlockEditingMode:o,getBlockName:r,getBlockSelectionStart:n}=t(_),i=n(),s=i&&(0,YE.getBlockType)(r(i));return s&&(0,YE.hasBlockSupport)(s,"__experimentalToolbar",!0)&&o(i)!=="disabled"},[])}var cd=l(A(),1),wX=l(N(),1),CX=l($(),1),BX=l(R(),1),ZE=l(F(),1);var Eg=l(w(),1),AV=[],n1e=6,i1e={placement:"bottom-start"};function EX({clientId:e}){let{categories:t,currentPatternName:o,patterns:r}=(0,ZE.useSelect)(a=>{let{getBlockAttributes:c,getBlockRootClientId:u,__experimentalGetAllowedPatterns:d}=a(_),f=c(e),m=f?.metadata?.categories||AV,h=u(e),p=m.length>0?d(h):AV;return{categories:m,currentPatternName:f?.metadata?.patternName,patterns:p}},[e]),{replaceBlocks:n}=(0,ZE.useDispatch)(_),i=(0,BX.useMemo)(()=>t.length===0||!r||r.length===0?AV:r.filter(a=>{let c=a.source==="core"||a.source?.startsWith("pattern-directory")&&a.source!=="pattern-directory/theme";return a.blocks.length===1&&!c&&o!==a.name&&a.categories?.some(u=>t.includes(u))&&(a.syncStatus==="unsynced"||!a.id)}).slice(0,n1e),[t,o,r]);if(i.length<2)return null;let s=a=>{let c=(a.blocks??[]).map(u=>(0,CX.cloneBlock)(u));c[0].attributes.metadata={...c[0].attributes.metadata,categories:t},n(e,c)};return(0,Eg.jsx)(cd.Dropdown,{popoverProps:i1e,renderToggle:({onToggle:a,isOpen:c})=>(0,Eg.jsx)(cd.ToolbarGroup,{children:(0,Eg.jsx)(cd.ToolbarButton,{onClick:()=>a(!c),"aria-expanded":c,children:(0,wX.__)("Change design")})}),renderContent:()=>(0,Eg.jsx)(cd.__experimentalDropdownContentWrapper,{className:"block-editor-block-toolbar-change-design-content-wrapper",paddingSize:"none",children:(0,Eg.jsx)(Ca,{blockPatterns:i,onClickPattern:s,showTitlesAsTooltip:!0})})})}var Us=l(A(),1),XX=l(N(),1),iT=l(F(),1);var JE=l(F(),1),ud=l($(),1),OX=l(R(),1);var LV=l(XE(),1),IX=l(N(),1);function PX(e,t){for(let o of new LV.default(t).values()){if(o.indexOf("is-style-")===-1)continue;let r=o.substring(9),n=e?.find(({name:i})=>i===r);if(n)return n}return QE(e)}function Tg(e,t,o){let r=new LV.default(e);return t&&r.remove("is-style-"+t.name),r.add("is-style-"+o.name),r.value}function RX(e){return!e||e.length===0?[]:QE(e)?e:[{name:"default",label:(0,IX._x)("Default","block style"),isDefault:!0},...e]}function QE(e){return e?.find(t=>t.isDefault)}function s1e(e,t){return(0,OX.useMemo)(()=>{let o=t?.example,r=t?.name;if(o&&r)return(0,ud.getBlockFromExample)(r,{attributes:o.attributes,innerBlocks:o.innerBlocks});if(e)return(0,ud.cloneBlock)(e)},[e,t?.example,t?.name])}function Ig({clientId:e,onSwitch:t}){let o=m=>{let{getBlock:h}=m(_),p=h(e);if(!p)return{};let g=(0,ud.getBlockType)(p.name),{getBlockStyles:b}=m(ud.store);return{block:g?.example?null:p,blockType:g,styles:b(p.name),className:p.attributes.className||""}},{styles:r,block:n,blockType:i,className:s}=(0,JE.useSelect)(o,[e]),{updateBlockAttributes:a}=(0,JE.useDispatch)(_),c=RX(r),u=PX(c,s),d=s1e(n,i);return{onSelect:m=>{let h=Tg(s,u,m);a(e,{className:h}),t()},stylesToRender:c,activeStyle:u,genericPreviewBlock:d,className:s}}var Lg=l($(),1),BS=l(F(),1),nT=l(R(),1);function AX(e,t,o){t=Array.isArray(t)?[...t]:[t],e=Array.isArray(e)?[...e]:{...e};let r=t.pop(),n=e;for(let i of t){let s=n[i];n=n[i]=Array.isArray(s)?[...s]:{...s}}return n[r]=o,e}var Oo=(e,t,o)=>{let r=Array.isArray(t)?t:t.split("."),n=e;return r.forEach(i=>{n=n?.[i]}),n??o};var NX=l(Uv(),1);var a1e="1600px",l1e="320px",c1e=1,u1e=.25,d1e=.75,f1e="14px";function LX({minimumFontSize:e,maximumFontSize:t,fontSize:o,minimumViewportWidth:r=l1e,maximumViewportWidth:n=a1e,scaleFactor:i=c1e,minimumFontSizeLimit:s}){if(s=Ra(s)?s:f1e,o){let y=Ra(o);if(!y?.unit||!y?.value)return null;let S=Ra(s,{coerceTo:y.unit});if(S?.value&&!e&&!t&&y?.value<=S?.value)return null;if(t||(t=`${y.value}${y.unit}`),!e){let x=y.unit==="px"?y.value:y.value*16,C=Math.min(Math.max(1-.075*Math.log2(x),u1e),d1e),B=SS(y.value*C,3);S?.value&&B<S?.value?e=`${S.value}${S.unit}`:e=`${B}${y.unit}`}}let a=Ra(e),c=a?.unit||"rem",u=Ra(t,{coerceTo:c});if(!a||!u)return null;let d=Ra(e,{coerceTo:"rem"}),f=Ra(n,{coerceTo:c}),m=Ra(r,{coerceTo:c});if(!f||!m||!d)return null;let h=f.value-m.value;if(!h)return null;let p=SS(m.value/100,3),g=SS(p,3)+c,b=100*((u.value-a.value)/h),v=SS((b||1)*i,3),k=`${d.value}${d.unit} + ((1vw - ${g}) * ${v})`;return`clamp(${e}, ${k}, ${t})`}function Ra(e,t={}){if(typeof e!="string"&&typeof e!="number")return null;isFinite(e)&&(e=`${e}px`);let{coerceTo:o,rootSizeValue:r,acceptableUnits:n}={coerceTo:"",rootSizeValue:16,acceptableUnits:["rem","px","em"],...t},i=n?.join("|"),s=new RegExp(`^(\\d*\\.?\\d+)(${i}){1,1}$`),a=e.toString().match(s);if(!a||a.length<3)return null;let[,c,u]=a,d=parseFloat(c);return o==="px"&&(u==="em"||u==="rem")&&(d=d*r,u=o),u==="px"&&(o==="em"||o==="rem")&&(d=d/r,u=o),(o==="em"||o==="rem")&&(u==="em"||u==="rem")&&(u=o),u?{value:SS(d,3),unit:u}:null}function SS(e,t=3){let o=Math.pow(10,t);return Math.round(e*o)/o}function NV(e){let t=e?.fluid;return t===!0||t&&typeof t=="object"&&Object.keys(t).length>0}function m1e(e){let t=e?.typography??{},o=e?.layout,r=Ra(o?.wideSize)?o?.wideSize:null;return NV(t)&&r?{fluid:{maxViewportWidth:r,...typeof t.fluid=="object"?t.fluid:{}}}:{fluid:t?.fluid}}function ec(e,t){let{size:o}=e;if(!o||o==="0"||e?.fluid===!1||!NV(t?.typography)&&!NV(e))return o;let r=m1e(t)?.fluid??{},n=LX({minimumFontSize:typeof e?.fluid=="boolean"?void 0:e?.fluid?.min,maximumFontSize:typeof e?.fluid=="boolean"?void 0:e?.fluid?.max,fontSize:o,minimumFontSizeLimit:typeof r=="object"?r?.minFontSize:void 0,maximumViewportWidth:typeof r=="object"?r?.maxViewportWidth:void 0,minimumViewportWidth:typeof r=="object"?r?.minViewportWidth:void 0});return n||o}var Oa="body",_S=":root",eT=[{path:["color","palette"],valueKey:"color",cssVarInfix:"color",classes:[{classSuffix:"color",propertyName:"color"},{classSuffix:"background-color",propertyName:"background-color"},{classSuffix:"border-color",propertyName:"border-color"}]},{path:["color","gradients"],valueKey:"gradient",cssVarInfix:"gradient",classes:[{classSuffix:"gradient-background",propertyName:"background"}]},{path:["color","duotone"],valueKey:"colors",cssVarInfix:"duotone",valueFunc:({slug:e})=>`url( '#wp-duotone-${e}' )`,classes:[]},{path:["shadow","presets"],valueKey:"shadow",cssVarInfix:"shadow",classes:[]},{path:["typography","fontSizes"],valueFunc:(e,t)=>ec(e,t),valueKey:"size",cssVarInfix:"font-size",classes:[{classSuffix:"font-size",propertyName:"font-size"}]},{path:["typography","fontFamilies"],valueKey:"fontFamily",cssVarInfix:"font-family",classes:[{classSuffix:"font-family",propertyName:"font-family"}]},{path:["spacing","spacingSizes"],valueKey:"size",cssVarInfix:"spacing",valueFunc:({size:e})=>e,classes:[]},{path:["border","radiusSizes"],valueKey:"size",cssVarInfix:"border-radius",classes:[]},{path:["dimensions","dimensionSizes"],valueKey:"size",cssVarInfix:"dimension",classes:[]}];function js(e,t){if(!e||!t)return t;let o=e.split(","),r=t.split(","),n=[];return o.forEach(i=>{r.forEach(s=>{n.push(`${i.trim()} ${s.trim()}`)})}),n.join(", ")}function MX(e,t){if(!e||!t)return;let o={};return Object.entries(t).forEach(([r,n])=>{typeof n=="string"&&(o[r]=js(e,n)),typeof n=="object"&&(o[r]={},Object.entries(n).forEach(([i,s])=>{o[r][i]=js(e,s)}))}),o}function DX(e,t){return e.includes(",")?e.split(",").map(n=>n+t).join(","):e+t}function VX(e,t){let o=`.is-style-${e}`;if(!t)return o;let r=/((?::\([^)]+\))?\s*)([^\s:]+)/,n=(s,a,c)=>a+c+o;return t.split(",").map(s=>s.replace(r,n)).join(",")}function p1e(e,t){if(!e||!t)return e;if(typeof e=="object"&&"ref"in e&&e?.ref){let o=(0,NX.getCSSValueFromRawStyle)(Oo(t,e.ref));return typeof o=="object"&&o!==null&&"ref"in o&&o?.ref?void 0:o===void 0?e:o}return e}function h1e(e,t){if(!e||!t||!Array.isArray(t))return e;let o=t.find(r=>r?.name===e);return o?.href?o?.href:e}function Pg(e,t){if(!e||!t)return e;let o=p1e(e,t);return typeof o=="object"&&o!==null&&"url"in o&&o?.url&&(o.url=h1e(o.url,t?._links?.["wp:theme-file"])),o}function FX(e,t,o=[],r="slug",n){let i=[t?Oo(e,["blocks",t,...o]):void 0,Oo(e,o)].filter(Boolean);for(let s of i)if(s){let a=["custom","theme","default"];for(let c of a){let u=s[c];if(u){let d=u.find(f=>f[r]===n);if(d)return r==="slug"||FX(e,t,o,"slug",d.slug)[r]===d[r]?d:void 0}}}}function g1e(e,t,o,[r,n]=[]){let i=eT.find(a=>a.cssVarInfix===r);if(!i||!e.settings)return o;let s=FX(e.settings,t,i.path,"slug",n);if(s){let{valueKey:a}=i,c=s[a];return wn(e,t,c)}return o}function b1e(e,t,o,r=[]){let n=(t?Oo(e?.settings??{},["blocks",t,"custom",...r]):void 0)??Oo(e?.settings??{},["custom",...r]);return n?wn(e,t,n):o}function wn(e,t,o){if(!o||typeof o!="string")if(typeof o=="object"&&o!==null&&"ref"in o&&typeof o.ref=="string"){let u=Oo(e,o.ref);if(!u||typeof u=="object"&&"ref"in u)return u;o=u}else return o;let r="var:",n="var(--wp--",i=")",s;if(o.startsWith(r))s=o.slice(r.length).split("|");else if(o.startsWith(n)&&o.endsWith(i))s=o.slice(n.length,-i.length).split("--");else return o;let[a,...c]=s;return a==="preset"?g1e(e,t,o,c):a==="custom"?b1e(e,t,o,c):o}var qr=l($(),1),wS=l(Uv(),1),YX=l(F(),1);function oi(e,t="root",o={}){if(!t)return null;let{fallback:r=!1}=o,{name:n,selectors:i,supports:s}=e,a=i&&Object.keys(i).length>0,c=Array.isArray(t)?t.join("."):t,u=null;if(a&&i.root?u=i?.root:s?.__experimentalSelector?u=s.__experimentalSelector:u=".wp-block-"+n.replace("core/","").replace("/","-"),c==="root")return u;let d=Array.isArray(t)?t:t.split(".");if(d.length===1){let m=r?u:null;if(a)return Oo(i,`${c}.root`,null)||Oo(i,c,null)||m;let h=s?Oo(s,`${c}.__experimentalSelector`,null):void 0;return h?js(u,h):m}let f;return a&&(f=Oo(i,c,null)),f||(r?oi(e,d[0],o):null)}function Og(e){return e.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 DV(e){if(!e)return;let t=e.match(/var:preset\|spacing\|(.+)/);return t?`var(--wp--preset--spacing--${t[1]})`:e}function R1e(e){if(!e)return null;let t=typeof e=="string";return{top:t?e:e?.top,left:t?e:e?.left}}function VV(e,t="0"){let o=R1e(e);if(!o)return null;let r=DV(o?.top)||t,n=DV(o?.left)||t;return r===n?r:`${r} ${n}`}var HX={backgroundSize:"cover",backgroundPosition:"50% 50%"};function GX(e){if(!e||!e?.backgroundImage?.url)return;let t;return e?.backgroundSize||(t={backgroundSize:HX.backgroundSize}),e?.backgroundSize==="contain"&&!e?.backgroundPosition&&(t={backgroundPosition:HX.backgroundPosition}),t}var WX={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 O1e={button:"wp-element-button",caption:"wp-element-caption"},A1e={__experimentalBorder:"border",color:"color",dimensions:"dimensions",spacing:"spacing",typography:"typography"};function L1e(e="*",t={}){return eT.reduce((o,{path:r,cssVarInfix:n,classes:i})=>{if(!i)return o;let s=Oo(t,r,[]);return["default","theme","custom"].forEach(a=>{s[a]&&s[a].forEach(({slug:c})=>{i.forEach(({classSuffix:u,propertyName:d})=>{let f=`.has-${Og(c)}-${u}`,m=e.split(",").map(p=>`${p}${f}`).join(","),h=`var(--wp--preset--${n}--${Og(c)})`;o+=`${m}{${d}: ${h} !important;}`})})}),o},"")}function N1e(e,t){let o=e.split(","),r=[];return o.forEach(n=>{r.push(`${t.trim()}${n.trim()}`)}),r.join(", ")}var $X=(e,t,o)=>{if(o!=="core/paragraph"||(t?.blocks?.["core/paragraph"]?.typography?.textIndent??t?.typography?.textIndent??"subsequent")!=="all")return e;let i=".wp-block-paragraph + .wp-block-paragraph",s=".wp-block-paragraph";if(i in e){let a=e[i],c={...e};return delete c[i],c[s]=a,c}return e},KX=(e,t)=>{let o={};return Object.entries(e).forEach(([r,n])=>{if(r==="root"||!t?.[r])return;let i=typeof n=="string";if(!i&&typeof n=="object"&&n!==null&&Object.entries(n).forEach(([s,a])=>{if(s==="root"||!t?.[r][s])return;let c={[r]:{[s]:t[r][s]}},u=Ag(c);o[a]=[...o[a]||[],...u],delete t[r][s]}),i||typeof n=="object"&&n!==null&&"root"in n){let s=i?n:n.root,a={[r]:t[r]},c=Ag(a);o[s]=[...o[s]||[],...c],delete t[r]}}),o};function Ag(e={},t="",o,r={},n=!1){let i=Oa===t,s=Object.entries(qr.__EXPERIMENTAL_STYLE_PROPERTY).reduce((c,[u,{value:d,properties:f,useEngine:m,rootOnly:h}])=>{if(h&&!i)return c;let p=d;if(p[0]==="elements"||m)return c;let g=Oo(e,p);if(u==="--wp--style--root--padding"&&(typeof g=="string"||!o))return c;if(f&&typeof g!="string")Object.entries(f).forEach(b=>{let[v,k]=b;if(!Oo(g,[k],!1))return;let y=v.startsWith("--")?v:Og(v);c.push(`${y}: ${(0,wS.getCSSValueFromRawStyle)(Oo(g,[k]))}`)});else if(Oo(e,p,!1)){let b=u.startsWith("--")?u:Og(u);c.push(`${b}: ${(0,wS.getCSSValueFromRawStyle)(Oo(e,p))}`)}return c},[]);return e.background&&(e.background?.backgroundImage&&(e.background.backgroundImage=Pg(e.background.backgroundImage,r)),!i&&e.background?.backgroundImage?.id&&(e={...e,background:{...e.background,...GX(e.background)}})),(0,wS.getCSSRules)(e).forEach(c=>{if(i&&(o||n)&&c.key.startsWith("padding"))return;let u=c.key.startsWith("--")?c.key:Og(c.key),d=Pg(c.value,r);u==="font-size"&&(d=ec({name:"",slug:"",size:d},r?.settings)),u==="aspect-ratio"&&s.push("min-height: unset"),s.push(`${u}: ${d}`)}),s}function FV({layoutDefinitions:e=WX,style:t,selector:o,hasBlockGapSupport:r,hasFallbackGapSupport:n,fallbackGapValue:i}){let s="",a=r?VV(t?.spacing?.blockGap):"";if(n&&(o===Oa?a=a||"0.5em":!r&&i&&(a=i)),a&&e&&(Object.values(e).forEach(({className:c,name:u,spacingStyles:d})=>{!r&&u!=="flex"&&u!=="grid"||d?.length&&d.forEach(f=>{let m=[];if(f.rules&&Object.entries(f.rules).forEach(([h,p])=>{m.push(`${h}: ${p||a}`)}),m.length){let h="";r?h=o===Oa?`:root :where(.${c})${f?.selector||""}`:`:root :where(${o}-${c})${f?.selector||""}`:h=o===Oa?`:where(.${c}${f?.selector||""})`:`:where(${o}.${c}${f?.selector||""})`,s+=`${h} { ${m.join("; ")}; }`}})}),o===Oa&&r&&(s+=`${_S} { --wp--style--block-gap: ${a}; }`)),o===Oa&&e){let c=["block","flex","grid"];Object.values(e).forEach(({className:u,displayMode:d,baseStyles:f})=>{d&&c.includes(d)&&(s+=`${o} .${u} { display:${d}; }`),f?.length&&f.forEach(m=>{let h=[];if(m.rules&&Object.entries(m.rules).forEach(([p,g])=>{h.push(`${p}: ${g}`)}),h.length){let p=`.${u}${m?.selector||""}`;s+=`${p} { ${h.join("; ")}; }`}})})}return s}var M1e=["border","color","dimensions","spacing","typography","filter","outline","shadow","background"];function tT(e){if(!e)return{};let r=Object.entries(e).filter(([n])=>M1e.includes(n)).map(([n,i])=>[n,JSON.parse(JSON.stringify(i))]);return Object.fromEntries(r)}var D1e=(e,t)=>{let o=[];if(!e?.styles)return o;let r=tT(e.styles);return r&&o.push({styles:r,selector:Oa,skipSelectorWrapper:!0}),Object.entries(qr.__EXPERIMENTAL_ELEMENTS).forEach(([n,i])=>{e.styles?.elements?.[n]&&o.push({styles:e.styles?.elements?.[n]??{},selector:i,skipSelectorWrapper:!O1e[n]})}),Object.entries(e.styles?.blocks??{}).forEach(([n,i])=>{let s=tT(i),a=i,c=[];if(a?.variations){let u={};Object.entries(a.variations).forEach(([d,f])=>{let m=f;u[d]=tT(m),m?.css&&(u[d].css=m.css);let h=typeof t!="string"?t[n]?.styleVariationSelectors?.[d]:void 0;Object.entries(m?.elements??{}).forEach(([p,g])=>{g&&qr.__EXPERIMENTAL_ELEMENTS[p]&&c.push({styles:g,selector:js(h,qr.__EXPERIMENTAL_ELEMENTS[p])})}),Object.entries(m?.blocks??{}).forEach(([p,g])=>{let b=typeof t!="string"?js(h,t[p]?.selector):void 0,v=typeof t!="string"?js(h,t[p]?.duotoneSelector):void 0,k=typeof t!="string"?MX(h,t[p]?.featureSelectors??{}):void 0,y=tT(g);g?.css&&(y.css=g.css),!(!b||typeof t=="string")&&(c.push({selector:b,duotoneSelector:v,featureSelectors:k,fallbackGapValue:t[p]?.fallbackGapValue,hasLayoutSupport:t[p]?.hasLayoutSupport,styles:y}),Object.entries(g.elements??{}).forEach(([S,x])=>{x&&qr.__EXPERIMENTAL_ELEMENTS[S]&&c.push({styles:x,selector:js(b,qr.__EXPERIMENTAL_ELEMENTS[S])})}))})}),s.variations=u}typeof t!="string"&&t?.[n]?.selector&&o.push({duotoneSelector:t[n].duotoneSelector,fallbackGapValue:t[n].fallbackGapValue,hasLayoutSupport:t[n].hasLayoutSupport,selector:t[n].selector,styles:s,featureSelectors:t[n].featureSelectors,styleVariationSelectors:t[n].styleVariationSelectors,name:n}),Object.entries(a?.elements??{}).forEach(([u,d])=>{typeof t!="string"&&d&&t?.[n]&&qr.__EXPERIMENTAL_ELEMENTS[u]&&o.push({styles:d,selector:t[n]?.selector.split(",").map(f=>qr.__EXPERIMENTAL_ELEMENTS[u].split(",").map(h=>f+" "+h)).join(",")})}),o.push(...c)}),o},V1e=(e,t)=>{let o=[];if(!e?.settings)return o;let r=s=>{let a={};return eT.forEach(({path:c})=>{let u=Oo(s,c,!1);u!==!1&&(a=AX(a,c,u))}),a},n=r(e.settings),i=e.settings?.custom;return(Object.keys(n).length>0||i)&&o.push({presets:n,custom:i,selector:_S}),Object.entries(e.settings?.blocks??{}).forEach(([s,a])=>{let c=a.custom;if(typeof t=="string"||!t[s])return;let u=r(a);(Object.keys(u).length>0||c)&&o.push({presets:u,custom:c,selector:t[s]?.selector})}),o};var oT=(e,t,o,r,n=!1,i=!1,s={})=>{let a={blockGap:!0,blockStyles:!0,layoutStyles:!0,marginReset:!0,presets:!0,rootPadding:!0,variationStyles:!1,...s},c=D1e(e,t),u=V1e(e,t),d=e?.settings?.useRootPaddingAwareAlignments,{contentSize:f,wideSize:m}=e?.settings?.layout||{},h=a.marginReset||a.rootPadding||a.layoutStyles,p="";if(a.presets&&(f||m)&&(p+=`${_S} {`,p=f?p+` --wp--style--global--content-size: ${f};`:p,p=m?p+` --wp--style--global--wide-size: ${m};`:p,p+="}"),h&&(p+=":where(body) {margin: 0;",a.rootPadding&&d&&(p+=`padding-right: 0; padding-left: 0; padding-top: var(--wp--style--root--padding-top); padding-bottom: var(--wp--style--root--padding-bottom) } .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; `),p+="}"),a.blockStyles&&c.forEach(({selector:g,duotoneSelector:b,styles:v,fallbackGapValue:k,hasLayoutSupport:y,featureSelectors:S,styleVariationSelectors:x,skipSelectorWrapper:C,name:B})=>{if(S){let E=KX(S,v);E=$X(E,e.settings,B),Object.entries(E).forEach(([L,T])=>{if(T.length){let O=T.join(";");p+=`:root :where(${L}){${O};}`}})}if(b){let E={};v?.filter&&(E.filter=v.filter,delete v.filter);let L=Ag(E);L.length&&(p+=`${b}{${L.join(";")};}`)}!n&&(Oa===g||y)&&(p+=FV({style:v,selector:g,hasBlockGapSupport:o,hasFallbackGapSupport:r,fallbackGapValue:k}));let I=Ag(v,g,d,e,i);if(I?.length){let E=C?g:`:root :where(${g})`;p+=`${E}{${I.join(";")};}`}v?.css&&(p+=CS(v.css,`:root :where(${g})`)),a.variationStyles&&x&&Object.entries(x).forEach(([E,L])=>{let T=v?.variations?.[E];if(T){if(S){let D=KX(S,T);D=$X(D,e.settings,B),Object.entries(D).forEach(([U,G])=>{if(G.length){let j=N1e(U,L),z=G.join(";");p+=`:root :where(${j}){${z};}`}})}let O=Ag(T,L,d,e);if(O.length&&(p+=`:root :where(${L}){${O.join(";")};}`),T?.css&&(p+=CS(T.css,`:root :where(${L})`)),y&&T?.spacing?.blockGap){let D=L+g;p+=FV({style:T,selector:D,hasBlockGapSupport:!0,hasFallbackGapSupport:r,fallbackGapValue:k})}}});let P=Object.entries(v).filter(([E])=>E.startsWith(":"));P?.length&&P.forEach(([E,L])=>{let T=Ag(L);if(!T?.length)return;let D=`:root :where(${g.split(",").map(U=>U+E).join(",")}){${T.join(";")};}`;p+=D})}),a.layoutStyles&&(p=p+".wp-site-blocks > .alignleft { float: left; margin-right: 2em; }",p=p+".wp-site-blocks > .alignright { float: right; margin-left: 2em; }",p=p+".wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }"),a.blockGap&&o){let g=VV(e?.styles?.spacing?.blockGap)||"0.5em";p=p+`:root :where(.wp-site-blocks) > * { margin-block-start: ${g}; margin-block-end: 0; }`,p=p+":root :where(.wp-site-blocks) > :first-child { margin-block-start: 0; }",p=p+":root :where(.wp-site-blocks) > :last-child { margin-block-end: 0; }"}return a.presets&&u.forEach(({selector:g,presets:b})=>{(Oa===g||_S===g)&&(g="");let v=L1e(g,b);v.length>0&&(p+=v)}),p};var F1e=(e,t)=>{if(e?.selectors&&Object.keys(e.selectors).length>0)return e.selectors;let o={root:t};return Object.entries(A1e).forEach(([r,n])=>{let i=oi(e,r);i&&(o[n]=i)}),o},rT=(e,t)=>{let{getBlockStyles:o}=(0,YX.select)(qr.store),r={};return e.forEach(n=>{let i=n.name,s=oi(n);if(!s)return;let a=oi(n,"filter.duotone");if(!a){let h=oi(n),p=(0,qr.getBlockSupport)(n,"color.__experimentalDuotone",!1);a=p&&h&&js(h,p)}let c=!!n?.supports?.layout||!!n?.supports?.__experimentalLayout,u=n?.supports?.spacing?.blockGap?.__experimentalDefault,d=o(i),f={};d?.forEach(h=>{let p=t?`-${t}`:"",g=`${h.name}${p}`,b=VX(g,s);f[g]=b});let m=F1e(n,s);r[i]={duotoneSelector:a??void 0,fallbackGapValue:u,featureSelectors:Object.keys(m).length?m:void 0,hasLayoutSupport:c,name:i,selector:s,styleVariationSelectors:d?.length?f:void 0}}),r};function CS(e,t){let o="";return!e||e.trim()===""||e.split("&").forEach(n=>{if(!n||n.trim()==="")return;if(!n.includes("{"))o+=`:root :where(${t}){${n.trim()}}`;else{let s=n.replace("}","").split("{");if(s.length!==2)return;let[a,c]=s,u=a.match(/([>+~\s]*::[a-zA-Z-]+)/),d=u?u[1]:"",f=u?a.replace(d,"").trim():a.trim(),m;f===""?m=t:m=a.startsWith(" ")?js(t,f):DX(t,f),o+=`:root :where(${m})${d}{${c.trim()}}`}}),o}var ES=l(w(),1),zV="is-style-";function qX(e){return e?e.split(/\s+/).reduce((t,o)=>{if(o.startsWith(zV)){let r=o.slice(zV.length);r!=="default"&&t.push(r)}return t},[]):[]}function jV(e,t=[]){let o=qX(e);if(!o)return null;for(let r of o)if(t.some(n=>n.name===r))return r;return null}function z1e({override:e}){tc(e)}function UV({config:e}){let{getBlockStyles:t,overrides:o}=(0,BS.useSelect)(i=>({getBlockStyles:i(Lg.store).getBlockStyles,overrides:M(i(_)).getStyleOverrides()}),[]),{getBlockName:r}=(0,BS.useSelect)(_),n=(0,nT.useMemo)(()=>{if(!o?.length)return;let i=[],s=[];for(let[,a]of o)if(a?.variation&&a?.clientId&&!s.includes(a.clientId)){let c=r(a.clientId),u=e?.styles?.blocks?.[c]?.variations?.[a.variation];if(u){let d={settings:e?.settings,styles:{blocks:{[c]:{variations:{[`${a.variation}-${a.clientId}`]:u}}}}},f=rT((0,Lg.getBlockTypes)(),a.clientId),b=oT(d,f,!1,!0,!0,!0,{blockGap:!1,blockStyles:!0,layoutStyles:!1,marginReset:!1,presets:!1,rootPadding:!1,variationStyles:!0});i.push({id:`${a.variation}-${a.clientId}`,css:b,__unstableType:"variation",variation:a.variation,clientId:a.clientId}),s.push(a.clientId)}}return i},[e,o,t,r]);return!n||!n.length?null:(0,ES.jsx)(ES.Fragment,{children:n.map(i=>(0,ES.jsx)(z1e,{override:i},i.id))})}function HV(e,t,o){if(!e?.styles?.blocks?.[t]?.variations?.[o])return;let r=i=>{Object.keys(i).forEach(s=>{let a=i[s];if(typeof a=="object"&&a!==null)if(a.ref!==void 0)if(typeof a.ref!="string"||a.ref.trim()==="")delete i[s];else{let c=yl(e,a.ref);c?i[s]=c:delete i[s]}else r(a),Object.keys(a).length===0&&delete i[s]})},n=JSON.parse(JSON.stringify(e.styles.blocks[t].variations[o]));return r(n),n}function j1e(e,t,o){let{globalSettings:r,globalStyles:n}=(0,BS.useSelect)(i=>{let s=i(_).getSettings();return{globalSettings:s.__experimentalFeatures,globalStyles:s[xi]}},[]);return(0,nT.useMemo)(()=>{let i=HV({settings:r,styles:n},e,t);return{settings:r,styles:{blocks:{[e]:{variations:{[`${t}-${o}`]:i}}}}}},[r,n,t,o,e])}function U1e({name:e,className:t,clientId:o}){let{getBlockStyles:r}=(0,BS.useSelect)(Lg.store),n=r(e),i=jV(t,n),s=`${zV}${i}-${o}`,{settings:a,styles:c}=j1e(e,i,o),u=(0,nT.useMemo)(()=>{if(!i)return;let d={settings:a,styles:c},f=rT((0,Lg.getBlockTypes)(),o);return oT(d,f,!1,!0,!0,!0,{blockGap:!1,blockStyles:!0,layoutStyles:!1,marginReset:!1,presets:!1,rootPadding:!1,variationStyles:!0})},[i,a,c,o]);return tc({id:`variation-${o}`,css:u,__unstableType:"variation",variation:i,clientId:o}),i?{className:s}:{}}var ZX={hasSupport:()=>!0,attributeKeys:["className"],isMatch:({className:e})=>qX(e).length>0,useBlockProps:U1e};var dd=l(w(),1),H1e=(0,dd.jsxs)(Us.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24","aria-hidden":"true",focusable:"false",children:[(0,dd.jsx)(Us.Path,{d:"M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3z"}),(0,dd.jsx)(Us.Path,{stroke:"currentColor",strokeWidth:"1.5",d:"M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3z"})]});function G1e({clientId:e}){let{stylesToRender:t,activeStyle:o,className:r}=Ig({clientId:e}),{updateBlockAttributes:n}=(0,iT.useDispatch)(_),{globalSettings:i,globalStyles:s,blockName:a}=(0,iT.useSelect)(d=>{let f=d(_).getSettings();return{globalSettings:f.__experimentalFeatures,globalStyles:f[xi],blockName:d(_).getBlockName(e)}},[e]),c=o?.name?HV({settings:i,styles:s},a,o.name)?.color?.background:void 0;return!t||t.length===0?null:(0,dd.jsx)(Us.ToolbarGroup,{children:(0,dd.jsx)(Us.ToolbarButton,{onClick:()=>{let f=(t.findIndex(p=>p.name===o.name)+1)%t.length,m=t[f],h=Tg(r,o,m);n(e,{className:h})},label:(0,XX.__)("Shuffle styles"),children:(0,dd.jsx)(Us.Icon,{icon:H1e,style:{fill:c||"transparent"}})})})}var QX=G1e;var lT=l(A(),1),GV=l(N(),1),JX=l(F(),1),cT=l($(),1);var sT=l(F(),1);function aT(e){let{isSectionBlock:t,isWithinSection:o,isWithinEditedSection:r,isEditingContentOnlySection:n,editedContentOnlySection:i}=(0,sT.useSelect)(u=>{let{isSectionBlock:d,getParentSectionBlock:f,getEditedContentOnlySection:m,isWithinEditedContentOnlySection:h}=M(u(_)),p=m();return{isSectionBlock:d(e),isWithinSection:d(e)||!!f(e),isWithinEditedSection:h(e),isEditingContentOnlySection:p===e,editedContentOnlySection:p}},[e]),s=(0,sT.useDispatch)(_),{editContentOnlySection:a,stopEditingContentOnlySection:c}=M(s);return{isSectionBlock:t,isWithinSection:o,isWithinEditedSection:r,isEditingContentOnlySection:n,editedContentOnlySection:i,editContentOnlySection:a,stopEditingContentOnlySection:c}}var WV=l(w(),1);function eQ({clientId:e}){let{isSectionBlock:t,isEditingContentOnlySection:o,editContentOnlySection:r,stopEditingContentOnlySection:n}=aT(e),i=(0,JX.useSelect)(c=>{if(!e)return null;let{getBlockName:u}=c(_),d=u(e);return d?{name:d}:null},[e]);if(!e||!t&&!o||(0,cT.isReusableBlock)(i)||(0,cT.isTemplatePart)(i))return null;let s=o;return(0,WV.jsx)(lT.ToolbarGroup,{children:(0,WV.jsx)(lT.ToolbarButton,{onClick:()=>{s?n():r(e)},children:s?(0,GV.__)("Exit pattern"):(0,GV.__)("Edit pattern")})})}var EQ=l(A(),1),TQ=l(N(),1),IQ=l(F(),1);var PS=l($(),1),PQ=l(Zp(),1);var Aa=l(N(),1),La=l(A(),1),fd=l($(),1),bT=l(F(),1);var lQ=l(N(),1),TS=l(A(),1),fT=l($(),1),mT=l(R(),1);var tQ=l(N(),1),oQ=l(A(),1),rQ=l(Z(),1);var Am=l(w(),1);function uT({blocks:e}){return(0,rQ.useViewportMatch)("medium","<")?null:(0,Am.jsx)("div",{className:"block-editor-block-switcher__popover-preview-container",children:(0,Am.jsx)(oQ.Popover,{className:"block-editor-block-switcher__popover-preview",placement:"right-start",focusOnMount:!1,offset:16,children:(0,Am.jsxs)("div",{className:"block-editor-block-switcher__preview",children:[(0,Am.jsx)("div",{className:"block-editor-block-switcher__preview-title",children:(0,tQ.__)("Preview")}),(0,Am.jsx)(vn,{viewportWidth:601,blocks:e})]})})})}var nQ=l(A(),1),Ng=l($(),1),iQ=l(F(),1),dT=l(R(),1);var oc=l(w(),1),W1e={};function sQ({clientIds:e,blocks:t}){let{activeBlockVariation:o,blockVariationTransformations:r}=(0,iQ.useSelect)(i=>{let{getBlockAttributes:s,canRemoveBlocks:a}=i(_),{getActiveBlockVariation:c,getBlockVariations:u}=i(Ng.store),d=a(e);if(t.length!==1||!d)return W1e;let[f]=t;return{blockVariationTransformations:u(f.name,"transform"),activeBlockVariation:c(f.name,s(f.clientId))}},[e,t]);return(0,dT.useMemo)(()=>r?.filter(({name:i})=>i!==o?.name),[r,o])}var $1e=({transformations:e,onSelect:t,blocks:o})=>{let[r,n]=(0,dT.useState)();return(0,oc.jsxs)(oc.Fragment,{children:[r&&(0,oc.jsx)(uT,{blocks:(0,Ng.cloneBlock)(o[0],e.find(({name:i})=>i===r).attributes)}),e?.map(i=>(0,oc.jsx)(K1e,{item:i,onSelect:t,setHoveredTransformItemName:n},i.name))]})};function K1e({item:e,onSelect:t,setHoveredTransformItemName:o}){let{name:r,icon:n,title:i}=e;return(0,oc.jsxs)(nQ.MenuItem,{className:(0,Ng.getBlockMenuDefaultClassName)(r),onClick:s=>{s.preventDefault(),t(r)},onMouseLeave:()=>o(null),onMouseEnter:()=>o(r),onFocus:()=>o(r),onBlur:()=>o(null),children:[(0,oc.jsx)(Ae,{icon:n,showColors:!0}),i]})}var aQ=$1e;var Cn=l(w(),1);function Y1e(e){let t={"core/paragraph":1,"core/heading":2,"core/list":3,"core/quote":4},o=(0,mT.useMemo)(()=>{let r=Object.keys(t),n=e.reduce((i,s)=>{let{name:a}=s;return r.includes(a)?i.priorityTextTransformations.push(s):i.restTransformations.push(s),i},{priorityTextTransformations:[],restTransformations:[]});if(n.priorityTextTransformations.length===1&&n.priorityTextTransformations[0].name==="core/quote"){let i=n.priorityTextTransformations.pop();n.restTransformations.push(i)}return n},[e]);return o.priorityTextTransformations.sort(({name:r},{name:n})=>t[r]<t[n]?-1:1),o}var q1e=({className:e,possibleBlockTransformations:t,possibleBlockVariationTransformations:o,onSelect:r,onSelectVariation:n,blocks:i})=>{let[s,a]=(0,mT.useState)(),{priorityTextTransformations:c,restTransformations:u}=Y1e(t),d=c.length&&u.length,f=!!u.length&&(0,Cn.jsx)(Z1e,{restTransformations:u,onSelect:r,setHoveredTransformItemName:a});return(0,Cn.jsxs)(Cn.Fragment,{children:[(0,Cn.jsxs)(TS.MenuGroup,{label:(0,lQ.__)("Transform to"),className:e,children:[s&&(0,Cn.jsx)(uT,{blocks:(0,fT.switchToBlockType)(i,s)}),!!o?.length&&(0,Cn.jsx)(aQ,{transformations:o,blocks:i,onSelect:n}),c.map(m=>(0,Cn.jsx)(cQ,{item:m,onSelect:r,setHoveredTransformItemName:a},m.name)),!d&&f]}),!!d&&(0,Cn.jsx)(TS.MenuGroup,{className:e,children:f})]})};function Z1e({restTransformations:e,onSelect:t,setHoveredTransformItemName:o}){return e.map(r=>(0,Cn.jsx)(cQ,{item:r,onSelect:t,setHoveredTransformItemName:o},r.name))}function cQ({item:e,onSelect:t,setHoveredTransformItemName:o}){let{name:r,icon:n,title:i,isDisabled:s}=e;return(0,Cn.jsxs)(TS.MenuItem,{className:(0,fT.getBlockMenuDefaultClassName)(r),onClick:a=>{a.preventDefault(),t(r)},disabled:s,onMouseLeave:()=>o(null),onMouseEnter:()=>o(r),onFocus:()=>o(r),onBlur:()=>o(null),children:[(0,Cn.jsx)(Ae,{icon:n,showColors:!0}),i]})}var uQ=q1e;var fQ=l(N(),1),mQ=l(A(),1);var pT=l(A(),1);var Mg=l(w(),1),X1e=()=>{};function dQ({clientId:e,onSwitch:t=X1e}){let{onSelect:o,stylesToRender:r,activeStyle:n}=Ig({clientId:e,onSwitch:t});return!r||r.length===0?null:(0,Mg.jsx)(Mg.Fragment,{children:r.map(i=>{let s=i.label||i.name;return(0,Mg.jsx)(pT.MenuItem,{icon:n.name===i.name?gl:null,onClick:()=>o(i),children:(0,Mg.jsx)(pT.__experimentalText,{as:"span",limit:18,ellipsizeMode:"tail",truncate:!0,children:s})},i.name)})})}var $V=l(w(),1);function hT({hoveredBlock:e,onSwitch:t}){let{clientId:o}=e;return(0,$V.jsx)(mQ.MenuGroup,{label:(0,fQ.__)("Styles"),className:"block-editor-block-switcher__styles__menugroup",children:(0,$V.jsx)(dQ,{clientId:o,onSwitch:t})})}var YV=l(N(),1),vQ=l(R(),1),gT=l(Z(),1);var Hs=l(A(),1);var gQ=l(R(),1),bQ=l($(),1);var pQ=l($(),1),KV=(e,t,o=new Set)=>{let{clientId:r,name:n,innerBlocks:i=[]}=e;if(!o.has(r)){if(n===t)return e;for(let s of i){let a=KV(s,t,o);if(a)return a}}},hQ=(e,t)=>{let o=(0,pQ.getBlockAttributesNamesByRole)(e,"content");return o?.length?o.reduce((r,n)=>(t[n]&&(r[n]=t[n]),r),{}):t};var Q1e=(e,t)=>{let o=hQ(t.name,t.attributes);e.attributes={...e.attributes,...o}},J1e=(e,t)=>{let o=t.map(n=>(0,bQ.cloneBlock)(n)),r=new Set;for(let n of e){let i=!1;for(let s of o){let a=KV(s,n.name,r);if(a){i=!0,r.add(a.clientId),Q1e(a,n);break}}if(!i)return}return o},eBe=(e,t)=>(0,gQ.useMemo)(()=>e.reduce((o,r)=>{let n=J1e(t,r.blocks);return n&&o.push({...r,transformedBlocks:n}),o},[]),[e,t]),kQ=eBe;var gr=l(w(),1);function tBe({blocks:e,patterns:t,onSelect:o}){let[r,n]=(0,vQ.useState)(!1),i=kQ(t,e);return i.length?(0,gr.jsxs)(Hs.MenuGroup,{className:"block-editor-block-switcher__pattern__transforms__menugroup",children:[r&&(0,gr.jsx)(oBe,{patterns:i,onSelect:o}),(0,gr.jsx)(Hs.MenuItem,{onClick:s=>{s.preventDefault(),n(!r)},icon:Vo,children:(0,YV.__)("Patterns")})]}):null}function oBe({patterns:e,onSelect:t}){let o=(0,gT.useViewportMatch)("medium","<");return(0,gr.jsx)("div",{className:"block-editor-block-switcher__popover-preview-container",children:(0,gr.jsx)(Hs.Popover,{className:"block-editor-block-switcher__popover-preview",placement:o?"bottom":"right-start",offset:16,children:(0,gr.jsx)("div",{className:"block-editor-block-switcher__preview is-pattern-list-preview",children:(0,gr.jsx)(rBe,{patterns:e,onSelect:t})})})})}function rBe({patterns:e,onSelect:t}){return(0,gr.jsx)(Hs.Composite,{role:"listbox",className:"block-editor-block-switcher__preview-patterns-container","aria-label":(0,YV.__)("Patterns list"),children:e.map(o=>(0,gr.jsx)(yQ,{pattern:o,onSelect:t},o.name))})}function yQ({pattern:e,onSelect:t}){let o="block-editor-block-switcher__preview-patterns-container",r=(0,gT.useInstanceId)(yQ,`${o}-list__item-description`);return(0,gr.jsxs)("div",{className:`${o}-list__list-item`,children:[(0,gr.jsxs)(Hs.Composite.Item,{render:(0,gr.jsx)("div",{role:"option","aria-label":e.title,"aria-describedby":e.description?r:void 0,className:`${o}-list__item`}),onClick:()=>t(e.transformedBlocks),children:[(0,gr.jsx)(vn,{blocks:e.transformedBlocks,viewportWidth:e.viewportWidth||500}),(0,gr.jsx)("div",{className:`${o}-list__item-title`,children:e.title})]}),!!e.description&&(0,gr.jsx)(Hs.VisuallyHidden,{id:r,children:e.description})]})}var SQ=tBe;var ri=l(w(),1);function nBe({onClose:e,clientIds:t}){let{replaceBlocks:o,multiSelect:r,updateBlockAttributes:n}=(0,bT.useDispatch)(_),{possibleBlockTransformations:i,patterns:s,blocks:a,isUsingBindings:c,canRemove:u,hasBlockStyles:d}=(0,bT.useSelect)(I=>{let{getBlockAttributes:P,getBlocksByClientId:E,getBlockRootClientId:L,getBlockTransformItems:T,__experimentalGetPatternTransformItems:O,canRemoveBlocks:D,getBlockName:U}=I(_),{getBlockStyles:G}=I(fd.store),j=L(t[0]),z=E(t),W=t.length===1,ee=W&&U(t[0]),se=W&&!!G(ee)?.length;return{blocks:z,possibleBlockTransformations:T(z,j),patterns:O(z,j),isUsingBindings:t.every(ce=>!!P(ce)?.metadata?.bindings),canRemove:D(t),hasBlockStyles:se}},[t]),f=sQ({clientIds:t,blocks:a});function m(I){I.length>1&&r(I[0].clientId,I[I.length-1].clientId)}function h(I){let P=(0,fd.switchToBlockType)(a,I);o(t,P),m(P)}function p(I){n(a[0].clientId,{...f.find(({name:P})=>P===I).attributes})}function g(I){o(t,I),m(I)}let b=a.length===1,v=b&&((0,fd.isTemplatePart)(a[0])||(0,fd.isReusableBlock)(a[0])),k=!!i?.length&&u&&!v,y=!!f?.length,S=!!s?.length&&u,x=k||y;if(!(d||x||S))return(0,ri.jsx)("p",{className:"block-editor-block-switcher__no-transforms",children:(0,Aa.__)("No transforms.")});let B=b?(0,Aa._x)("This block is connected.","block toolbar button label and description"):(0,Aa._x)("These blocks are connected.","block toolbar button label and description");return(0,ri.jsxs)("div",{className:"block-editor-block-switcher__container",children:[S&&(0,ri.jsx)(SQ,{blocks:a,patterns:s,onSelect:I=>{g(I),e()}}),x&&(0,ri.jsx)(uQ,{className:"block-editor-block-switcher__transforms__menugroup",possibleBlockTransformations:i,possibleBlockVariationTransformations:f,blocks:a,onSelect:I=>{h(I),e()},onSelectVariation:I=>{p(I),e()}}),d&&(0,ri.jsx)(hT,{hoveredBlock:a[0],onSwitch:e}),c&&(0,ri.jsx)(La.MenuGroup,{children:(0,ri.jsx)(La.__experimentalText,{className:"block-editor-block-switcher__binding-indicator",children:B})})]})}var iBe=({children:e,clientIds:t,label:o,text:r})=>{let i=t.length===1?(0,Aa.__)("Change block type or style"):(0,Aa.sprintf)((0,Aa._n)("Change type of %d block","Change type of %d blocks",t.length),t.length);return(0,ri.jsx)(La.ToolbarGroup,{children:(0,ri.jsx)(La.ToolbarItem,{children:s=>(0,ri.jsx)(La.DropdownMenu,{className:"block-editor-block-switcher",label:o,popoverProps:{placement:"bottom-start",className:"block-editor-block-switcher__popover"},icon:e,text:r,toggleProps:{description:i,...s},menuProps:{orientation:"both"},children:({onClose:a})=>(0,ri.jsx)(nBe,{onClose:a,clientIds:t})})})})},_Q=iBe;var xQ=l(N(),1),Vg=l(A(),1);var Dg=l(w(),1);function wQ({clientIds:e,children:t,label:o,text:r}){return(0,Dg.jsx)(Vg.ToolbarGroup,{children:(0,Dg.jsx)(Vg.ToolbarItem,{children:n=>(0,Dg.jsx)(Vg.DropdownMenu,{className:"block-editor-block-switcher",label:o,popoverProps:{placement:"bottom-start",className:"block-editor-block-switcher__popover"},icon:t,text:r,toggleProps:{description:(0,xQ.__)("Change block style"),...n},menuProps:{orientation:"both"},children:({onClose:i})=>(0,Dg.jsx)("div",{className:"block-editor-block-switcher__container",children:(0,Dg.jsx)(hT,{hoveredBlock:{clientId:e[0]},onSwitch:i})})})})})}var Fg=l(A(),1),IS=l(N(),1),kT=l(R(),1),CQ=l(F(),1);var rc=l(w(),1);function sBe({clientIds:e,blockTitle:t}){let o=(0,CQ.useSelect)(i=>{let{getBlockAttributes:s}=i(_);return s(e?.[0])?.metadata?.name},[e]),r=e.length===1,n;return r&&o?n=(0,IS.sprintf)((0,IS.__)('This %1$s is editable using the "%2$s" override.'),t.toLowerCase(),o):n=(0,IS.__)("These blocks are editable using overrides."),(0,rc.jsx)(Fg.__experimentalText,{children:n})}function BQ({icon:e,clientIds:t,blockTitle:o,label:r}){let[n,i]=(0,kT.useState)(!1),s=(0,kT.useRef)();return(0,rc.jsxs)(rc.Fragment,{children:[(0,rc.jsx)(Fg.ToolbarButton,{ref:s,className:"block-editor-block-toolbar__pattern-overrides-indicator",icon:e,label:r,onClick:()=>i(!n),"aria-expanded":n}),n&&(0,rc.jsx)(Fg.Popover,{anchor:s.current,onClose:()=>i(!1),placement:"bottom-start",offset:16,className:"block-editor-block-toolbar__pattern-overrides-popover",children:(0,rc.jsx)(sBe,{clientIds:t,blockTitle:o})})]})}var zg=l(w(),1);function aBe({select:e,clientIds:t}){let{getBlockName:o,getBlockAttributes:r,getBlockParentsByBlockName:n,canRemoveBlocks:i,getTemplateLock:s,getBlockEditingMode:a,canEditBlock:c}=M(e(_)),{getBlockStyles:u}=e(PS.store),d=t.some(P=>s(P)==="contentOnly"),f=t.length===1,m=f&&o(t[0]),h=f&&!!u(m)?.length,p=t.some(P=>!!r(P)?.metadata?.patternName),g=t.every(P=>Wk(r(P)?.metadata?.bindings)),b=t.every(P=>n(P,"core/block",!0).length>0),v=i(t),k=t.every(P=>c(P)),y=a(t[0]),S=y==="default",x=y==="contentOnly",B=!p&&S&&(h||v)&&!d&&k,I=g&&b;return B?"switcher":x&&h&&!g&&k?"styles-only":I?"pattern-overrides":"default"}function lBe({select:e,clientIds:t}){let{getBlockName:o,getBlockAttributes:r}=M(e(_)),n=t.length===1,i=t[0],s=r(i);if(n&&s?.metadata?.patternName)return Ei;let a=o(i),c=(0,PS.getBlockType)(a);if(n){let{getActiveBlockVariation:f}=e(PS.store);return f(a,s)?.icon||c?.icon}let u=t.map(f=>o(f));return new Set(u).size===1?c?.icon:Cf}function RQ({clientIds:e,isSynced:t}){let{icon:o,showIconLabels:r,variant:n}=(0,IQ.useSelect)(f=>({icon:lBe({select:f,clientIds:e}),showIconLabels:f(PQ.store).get("core","showIconLabels"),variant:aBe({select:f,clientIds:e})}),[e]),i=zr({clientId:e?.[0],maximumLength:35}),s=e.length===1,a=s&&t&&!r,c=s?i:(0,TQ.__)("Multiple blocks selected"),u=a&&i?i:void 0,d=(0,zg.jsx)(Ae,{className:"block-editor-block-toolbar__block-icon",icon:o});return n==="switcher"?(0,zg.jsx)(_Q,{clientIds:e,label:c,text:u,children:d}):n==="styles-only"?(0,zg.jsx)(wQ,{clientIds:e,label:c,text:u,children:d}):n==="pattern-overrides"?(0,zg.jsx)(BQ,{icon:d,clientIds:e,blockTitle:i,label:c}):(0,zg.jsx)(EQ.ToolbarButton,{disabled:!0,className:"block-editor-block-toolbar__block-icon-button",title:c,icon:d,text:u})}var Qe=l(w(),1);function ZV({hideDragHandle:e,focusOnMount:t,__experimentalInitialIndex:o,__experimentalOnIndexChange:r,variant:n="unstyled"}){let{blockClientId:i,blockClientIds:s,isDefaultEditingMode:a,blockType:c,toolbarKey:u,shouldShowVisualToolbar:d,showParentSelector:f,isUsingBindings:m,isSectionContainer:h,hasContentOnlyLocking:p,showShuffleButton:g,showSlots:b,showGroupButtons:v,showLockButtons:k,showBlockVisibilityButton:y,showSwitchSectionStyleButton:S,areSelectedBlocksHiddenOnViewport:x,canEdit:C}=(0,AQ.useSelect)(G=>{let{canEditBlock:j}=G(_),{getBlockName:z,getBlockMode:W,getBlockParents:ee,getSelectedBlockClientIds:se,isBlockValid:ce,getBlockEditingMode:ie,getBlockAttributes:re,getSettings:Q,getTemplateLock:Y,getParentSectionBlock:J,isZoomOut:K,isSectionBlock:H,isBlockHiddenAtViewport:X}=M(G(_)),ne=se(),le=ne[0],ve=ee(le),xe=J(le)??ve[ve.length-1],ze=z(xe),ot=(0,nc.getBlockType)(ze),Wt=ie(le),fo=Wt==="default",Do=z(le),rt=ne.every(je=>ce(je)),ar=ne.every(je=>W(je)==="visual"),xt=ne.every(je=>!!re(je)?.metadata?.bindings),At=ne.some(je=>Y(je)==="contentOnly"),Pe=K(),wt=H(le),qo=j(le),$t=qo&&(Pe||wt),lr=Q()?.[wi]?.toLowerCase()||"desktop",ln=ne.length>0&&ne.every(je=>X(je,lr));return{blockClientId:le,blockClientIds:ne,isDefaultEditingMode:fo,blockType:le&&(0,nc.getBlockType)(Do),shouldShowVisualToolbar:rt&&ar,toolbarKey:`${le}${xe}`,showParentSelector:!Pe&&ot&&Wt!=="contentOnly"&&ie(xe)!=="disabled"&&(0,nc.hasBlockSupport)(ot,"__experimentalParentSelector",!0)&&ne.length===1,isUsingBindings:xt,isSectionContainer:wt,hasContentOnlyLocking:At,showShuffleButton:Pe,showSlots:!Pe,showGroupButtons:!Pe,showLockButtons:!Pe,showBlockVisibilityButton:!Pe,showSwitchSectionStyleButton:$t,areSelectedBlocksHiddenOnViewport:ln,canEdit:qo}},[]),B=(0,qV.useRef)(null),I=(0,qV.useRef)(),P=kg({ref:I}),E=!(0,LQ.useViewportMatch)("medium","<");if(!qE())return null;let T=s.length>1,O=(0,nc.isReusableBlock)(c)||(0,nc.isTemplatePart)(c),D=V("block-editor-block-contextual-toolbar",{"has-parent":f}),U=V("block-editor-block-toolbar",{"is-synced":O,"is-connected":m});return(0,Qe.jsx)(Bg,{focusEditorOnEscape:!0,className:D,"aria-label":(0,OQ.__)("Block tools"),variant:n==="toolbar"?void 0:n,focusOnMount:t,__experimentalInitialIndex:o,__experimentalOnIndexChange:r,children:(0,Qe.jsxs)("div",{ref:B,className:U,children:[f&&!T&&E&&(0,Qe.jsx)(nZ,{}),(d||T)&&(0,Qe.jsx)("div",{ref:I,...P,children:(0,Qe.jsxs)(NQ.ToolbarGroup,{className:"block-editor-block-toolbar__block-controls",children:[(0,Qe.jsx)(RQ,{clientIds:s,isSynced:O}),a&&y&&(0,Qe.jsx)(TD,{clientIds:s}),!T&&a&&k&&(0,Qe.jsx)(wV,{clientId:i}),(0,Qe.jsx)(kE,{clientIds:s,hideDragHandle:e})]})}),!x&&!p&&d&&T&&v&&(0,Qe.jsx)(vV,{}),!T&&C&&(0,Qe.jsx)(eQ,{clientId:s[0]}),!x&&g&&(0,Qe.jsx)(EX,{clientId:s[0]}),!x&&S&&(0,Qe.jsx)(QX,{clientId:s[0]}),!x&&d&&b&&(0,Qe.jsxs)(Qe.Fragment,{children:[!h&&(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsx)(Mt.Slot,{group:"parent",className:"block-editor-block-toolbar__slot"}),(0,Qe.jsx)(Mt.Slot,{group:"block",className:"block-editor-block-toolbar__slot"}),(0,Qe.jsx)(Mt.Slot,{className:"block-editor-block-toolbar__slot"}),(0,Qe.jsx)(Mt.Slot,{group:"inline",className:"block-editor-block-toolbar__slot"})]}),(0,Qe.jsx)(Mt.Slot,{group:"other",className:"block-editor-block-toolbar__slot"}),(0,Qe.jsx)(xE.Slot,{})]}),(0,Qe.jsx)(gX,{clientIds:s}),(0,Qe.jsx)(GE,{clientIds:s})]})},u)}function MQ({hideDragHandle:e,variant:t}){return(0,Qe.jsx)(ZV,{hideDragHandle:e,variant:t,focusOnMount:void 0,__experimentalInitialIndex:void 0,__experimentalOnIndexChange:void 0})}var XV=l(w(),1);function FQ({clientId:e,isTyping:t,__unstableContentRef:o}){let{capturingClientId:r,isInsertionPointVisible:n,lastClientId:i}=cE(e),s=(0,jg.useRef)();(0,jg.useEffect)(()=>{s.current=void 0},[e]);let{stopTyping:a}=(0,DQ.useDispatch)(_),c=(0,jg.useRef)(!1);(0,VQ.useShortcut)("core/block-editor/focus-toolbar",()=>{c.current=!0,a(!0)}),(0,jg.useEffect)(()=>{c.current=!1});let u=r||e,d=lE({contentElement:o?.current,clientId:u});return!t&&(0,XV.jsx)(pm,{clientId:u,bottomClientId:i,className:V("block-editor-block-list__block-popover",{"is-insertion-point-visible":n}),resize:!1,...d,__unstableContentRef:o,children:(0,XV.jsx)(ZV,{focusOnMount:c.current,__experimentalInitialIndex:s.current,__experimentalOnIndexChange:f=>{s.current=f},variant:"toolbar"})})}var vT=l(F(),1),yT=l(R(),1);var zQ=l(A(),1);var jQ=l(N(),1),UQ=l(w(),1);function cBe({onClick:e}){return(0,UQ.jsx)(zQ.Button,{variant:"primary",icon:Bi,size:"compact",className:V("block-editor-button-pattern-inserter__button","block-editor-block-tools__zoom-out-mode-inserter-button"),onClick:e,label:(0,jQ._x)("Add pattern","Generic label for pattern inserter button")})}var HQ=cBe;var QV=l(w(),1);function uBe(){let[e,t]=(0,yT.useState)(!1),{hasSelection:o,blockOrder:r,setInserterIsOpened:n,sectionRootClientId:i,selectedBlockClientId:s,blockInsertionPoint:a,insertionPointVisible:c}=(0,vT.useSelect)(p=>{let{getSettings:g,getBlockOrder:b,getSelectionStart:v,getSelectedBlockClientId:k,getSectionRootClientId:y,getBlockInsertionPoint:S,isBlockInsertionPointVisible:x}=M(p(_)),C=y();return{hasSelection:!!v().clientId,blockOrder:b(C),sectionRootClientId:C,setInserterIsOpened:g().__experimentalSetIsInserterOpened,selectedBlockClientId:k(),blockInsertionPoint:S(),insertionPointVisible:x()}},[]),{showInsertionPoint:u}=M((0,vT.useDispatch)(_));if((0,yT.useEffect)(()=>{let p=setTimeout(()=>{t(!0)},500);return()=>{clearTimeout(p)}},[]),!e||!o)return null;let d=s,m=r.findIndex(p=>s===p)+1,h=r[m];return c&&a?.index===m?null:(0,QV.jsx)(MB,{previousClientId:d,nextClientId:h,children:(0,QV.jsx)(HQ,{onClick:()=>{n({rootClientId:i,insertionIndex:m,tab:"patterns",category:"all"}),u(i,m,{operation:"insert"})}})})}var GQ=uBe;var WQ=l(F(),1),$Q=l($(),1);function KQ(){return(0,WQ.useSelect)(e=>{let{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:o,getBlock:r,getBlockMode:n,getSettings:i,isTyping:s,isBlockInterfaceHidden:a}=M(e(_)),c=t()||o(),u=r(c),d=!!c&&!!u,f=d&&(0,$Q.isUnmodifiedDefaultBlock)(u,"content")&&n(c)!=="html",m=c&&!s()&&f,h=!a()&&!i().hasFixedToolbar&&!m&&d&&!f;return{showEmptyBlockSideInserter:m,showBlockToolbarPopover:h}},[])}var Yi=l(w(),1);function dBe(e){let{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:o,getSettings:r,isTyping:n,isDragging:i,isZoomOut:s,getViewportModalClientIds:a}=M(e(_));return{clientId:t()||o(),hasFixedToolbar:r().hasFixedToolbar,isTyping:n(),isZoomOutMode:s(),isDragging:i(),viewportModalClientIds:a()}}function RS({children:e,__unstableContentRef:t,...o}){let{clientId:r,hasFixedToolbar:n,isTyping:i,isZoomOutMode:s,isDragging:a,viewportModalClientIds:c}=(0,Ug.useSelect)(dBe,[]),u=(0,YQ.__unstableUseShortcutEventMatch)(),{getBlocksByClientId:d,getSelectedBlockClientIds:f,getBlockRootClientId:m,getBlockEditingMode:h,getBlockName:p,isGroupable:g,getEditedContentOnlySection:b,canEditBlock:v}=M((0,Ug.useSelect)(_)),{getGroupingBlockName:k}=(0,Ug.useSelect)(Hg.store),{showEmptyBlockSideInserter:y,showBlockToolbarPopover:S}=KQ(),x=yg(),[C,B]=(0,ST.useState)(null),{canRename:I}=Pm(p(f()[0])),{duplicateBlocks:P,removeBlocks:E,replaceBlocks:L,insertAfterBlock:T,insertBeforeBlock:O,selectBlock:D,moveBlocksUp:U,moveBlocksDown:G,expandBlock:j,stopEditingContentOnlySection:z,showViewportModal:W,hideViewportModal:ee}=M((0,Ug.useDispatch)(_));function se(re){if(!re.defaultPrevented){if(u("core/block-editor/move-up",re)||u("core/block-editor/move-down",re)){let Q=f();if(Q.length){re.preventDefault();let Y=m(Q[0]);(u("core/block-editor/move-up",re)?"up":"down")==="up"?U(Q,Y):G(Q,Y);let K=Array.isArray(Q)?Q.length:1,H=(0,Gg.sprintf)((0,Gg._n)("%d block moved.","%d blocks moved.",Q.length),K);(0,t3.speak)(H)}}else if(u("core/block-editor/duplicate",re)){let Q=f();Q.length&&(re.preventDefault(),P(Q))}else if(u("core/block-editor/remove",re)){let Q=f();Q.length&&(re.preventDefault(),E(Q))}else if(u("core/block-editor/paste-styles",re)){let Q=f();if(Q.length){re.preventDefault();let Y=d(Q);x(Y)}}else if(u("core/block-editor/insert-after",re)){let Q=f();Q.length&&(re.preventDefault(),T(Q[Q.length-1]))}else if(u("core/block-editor/insert-before",re)){let Q=f();Q.length&&(re.preventDefault(),O(Q[0]))}else if(u("core/block-editor/unselect",re)){if(re.target.closest("[role=toolbar]"))return;let Q=f();Q.length>1&&(re.preventDefault(),D(Q[0]))}else if(u("core/block-editor/collapse-list-view",re)){if((0,JV.isTextField)(re.target)||(0,JV.isTextField)(re.target?.contentWindow?.document?.activeElement))return;re.preventDefault(),j(r)}else if(u("core/block-editor/group",re)){let Q=f();if(Q.length>1&&g(Q)){re.preventDefault();let Y=d(Q),J=k(),K=(0,Hg.switchToBlockType)(Y,J);L(Q,K),(0,t3.speak)((0,Gg.__)("Selected blocks are grouped."))}}else if(u("core/block-editor/rename",re)){let Q=f();if(Q.length===1){let Y=h(Q[0])==="contentOnly";I&&!Y&&v(Q[0])&&(re.preventDefault(),B(Q[0]))}}else if(u("core/block-editor/toggle-block-visibility",re)){let Q=f();if(Q.length){if(re.preventDefault(),!d(Q).every(K=>(0,Hg.hasBlockSupport)(K.name,"visibility",!0))||Q.some(K=>h(K)!=="default"||!v(K)))return;W(Q)}}u("core/block-editor/stop-editing-as-blocks",re)&&b()&&z()}}let ce=mm(t),ie=mm(t);return(0,Yi.jsxs)("div",{...o,onKeyDown:se,className:V(o.className,{"block-editor-block-tools--is-dragging":a}),children:[(0,Yi.jsxs)(fg.Provider,{value:(0,ST.useRef)(!1),children:[!i&&!s&&(0,Yi.jsx)(CY,{__unstableContentRef:t}),y&&(0,Yi.jsx)(jq,{__unstableContentRef:t,clientId:r}),S&&(0,Yi.jsx)(FQ,{__unstableContentRef:t,clientId:r,isTyping:i}),!s&&!n&&(0,Yi.jsx)(e3.Popover.Slot,{name:"block-toolbar",ref:ce}),e,(0,Yi.jsx)(e3.Popover.Slot,{name:"__unstable-block-tools-after",ref:ie}),s&&!a&&(0,Yi.jsx)(GQ,{__unstableContentRef:t})]}),C&&(0,Yi.jsx)(Tm,{clientId:C,onClose:()=>B(null)}),c&&(0,Yi.jsx)(wD,{clientIds:c,onClose:ee})]})}var qi=l(N(),1),Na=l($(),1),ic=l(F(),1),o3=l(ZQ(),1);var fBe=()=>function(){let{replaceBlocks:t,multiSelect:o}=(0,ic.useDispatch)(_),{blocks:r,clientIds:n,canRemove:i,possibleBlockTransformations:s,invalidSelection:a}=(0,ic.useSelect)(h=>{let{getBlockRootClientId:p,getBlockTransformItems:g,getSelectedBlockClientIds:b,getBlocksByClientId:v,canRemoveBlocks:k}=h(_),y=b(),S=v(y);if(S.filter(C=>!C).length>0)return{invalidSelection:!0};let x=p(y[0]);return{blocks:S,clientIds:y,possibleBlockTransformations:g(S,x),canRemove:k(y),invalidSelection:!1}},[]);if(a)return{isLoading:!1,commands:[]};let c=r.length===1&&(0,Na.isTemplatePart)(r[0]);function u(h){h.length>1&&o(h[0].clientId,h[h.length-1].clientId)}function d(h){let p=(0,Na.switchToBlockType)(r,h);t(n,p),u(p)}let f=!!s.length&&i&&!c;return!n||n.length<1||!f?{isLoading:!1,commands:[]}:{isLoading:!1,commands:s.map(h=>{let{name:p,title:g,icon:b}=h,v=!b?.src||b?.src==="block-default"?{src:Jk}:b;return{name:"core/block-editor/transform-to-"+p.replace("/","-"),label:(0,qi.sprintf)((0,qi.__)("Transform to %s"),g),icon:v?.src,category:"command",callback:({close:k})=>{d(p),k()}}})}},mBe=()=>function(){let{clientIds:t,isUngroupable:o,isGroupable:r}=(0,ic.useSelect)(O=>{let{getSelectedBlockClientIds:D,isUngroupable:U,isGroupable:G}=O(_);return{clientIds:D(),isUngroupable:U(),isGroupable:G()}},[]),{canInsertBlockType:n,getBlockRootClientId:i,getBlocksByClientId:s,canRemoveBlocks:a,isBlockHiddenAnywhere:c}=M((0,ic.useSelect)(_)),{getBlockEditingMode:u}=(0,ic.useSelect)(_),{getDefaultBlockName:d,getGroupingBlockName:f}=(0,ic.useSelect)(Na.store),m=s(t),h=(0,ic.useDispatch)(_),{removeBlocks:p,replaceBlocks:g,duplicateBlocks:b,insertAfterBlock:v,insertBeforeBlock:k}=h,y=()=>{if(!m.length)return;let O=f(),D=(0,Na.switchToBlockType)(m,O);D&&g(t,D)},S=()=>{if(!m.length)return;let O=m[0].innerBlocks;O.length&&g(t,O)};if(!t||t.length<1)return{isLoading:!1,commands:[]};let{showViewportModal:x}=M(h),C=i(t[0]),B=n(d(),C),I=m.every(O=>!!O&&(0,Na.hasBlockSupport)(O.name,"multiple",!0)&&n(O.name,C)),P=a(t),E=[];I&&E.push({name:"duplicate",label:(0,qi.__)("Duplicate"),callback:()=>b(t,!0),icon:Cf}),B&&E.push({name:"add-before",label:(0,qi.__)("Add before"),callback:()=>{let O=Array.isArray(t)?t[0]:O;k(O)},icon:Bi},{name:"add-after",label:(0,qi.__)("Add after"),callback:()=>{let O=Array.isArray(t)?t[t.length-1]:O;v(O)},icon:Bi}),r&&E.push({name:"Group",label:(0,qi.__)("Group"),callback:y,icon:nv}),o&&E.push({name:"ungroup",label:(0,qi.__)("Ungroup"),callback:S,icon:RN}),P&&E.push({name:"remove",label:(0,qi.__)("Delete"),callback:()=>p(t,!0),icon:IN});let L=m.every(O=>!!O&&(0,Na.hasBlockSupport)(O.name,"visibility",!0)),T=t.every(O=>u(O)==="default");if(L&&T){let O=t.some(D=>c(D));E.push({name:"toggle-visibility",label:O?(0,qi.__)("Show"):(0,qi.__)("Hide"),callback:()=>x(t),icon:O?Af:vs})}return{isLoading:!1,commands:E.map(O=>({...O,name:"core/block-editor/action-"+O.name,category:"command",callback:({close:D})=>{O.callback(),D()}}))}},_T=()=>{(0,o3.useCommandLoader)({name:"core/block-editor/blockTransforms",hook:fBe()}),(0,o3.useCommandLoader)({name:"core/block-editor/blockQuickActions",hook:mBe(),context:"block-selection-edit"})};var Zr=l(w(),1),xT=(0,eJ.createSlotFill)(Symbol("BlockCanvasCover"));function XQ({children:e}){return(0,Zr.jsx)("div",{className:"block-canvas-cover",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none"},children:e})}var pBe={ignoredSelectors:[/\.editor-styles-wrapper/gi]};function r3({shouldIframe:e=!0,height:t="300px",children:o=(0,Zr.jsx)(Gh,{}),styles:r,contentRef:n,iframeProps:i}){_T();let s=(0,wT.useViewportMatch)("medium","<"),a=rS(),c=hm(),u=(0,QQ.useRef)(),d=(0,wT.useMergeRefs)([n,c,u]),f=(0,JQ.useSelect)(h=>M(h(_)).getZoomLevel(),[]),m=f!==100&&!s?{scale:f,frameSize:"40px"}:{};return e?(0,Zr.jsx)(RS,{__unstableContentRef:u,style:{height:t,display:"flex"},children:(0,Zr.jsxs)(Mh,{...i,...m,ref:a,contentRef:d,style:{...i?.style},name:"editor-canvas",children:[(0,Zr.jsx)(xT.Slot,{fillProps:{containerRef:u},children:h=>h.map((p,g)=>(0,Zr.jsx)(XQ,{children:p},g))}),(0,Zr.jsx)(Nl,{styles:r}),o]})}):(0,Zr.jsxs)(RS,{__unstableContentRef:u,style:{height:t,display:"flex"},children:[(0,Zr.jsx)(xT.Slot,{fillProps:{containerRef:u},children:h=>h.map((p,g)=>(0,Zr.jsx)(XQ,{children:p},g))}),(0,Zr.jsx)(Nl,{styles:r,scope:":where(.editor-styles-wrapper)",transformOptions:pBe}),(0,Zr.jsx)(E1,{ref:d,className:"editor-styles-wrapper",tabIndex:-1,style:{height:"100%",width:"100%",overflow:"auto"},children:o})]})}function hBe({children:e,height:t,styles:o}){return(0,Zr.jsx)(r3,{height:t,styles:o,children:e})}var tJ=hBe;var Ma=l(A(),1),oJ=l(N(),1),rJ=l(it(),1),nJ=l(Re(),1),Zi=l(w(),1),gBe=()=>(0,Zi.jsx)(Ma.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",children:(0,Zi.jsx)(Ma.Path,{d:"M7.434 5l3.18 9.16H8.538l-.692-2.184H4.628l-.705 2.184H2L5.18 5h2.254zm-1.13 1.904h-.115l-1.148 3.593H7.44L6.304 6.904zM14.348 7.006c1.853 0 2.9.876 2.9 2.374v4.78h-1.79v-.914h-.114c-.362.64-1.123 1.022-2.031 1.022-1.346 0-2.292-.826-2.292-2.108 0-1.27.972-2.006 2.71-2.107l1.696-.102V9.38c0-.584-.42-.914-1.18-.914-.667 0-1.112.228-1.264.647h-1.701c.12-1.295 1.307-2.107 3.066-2.107zm1.079 4.1l-1.416.09c-.793.056-1.18.342-1.18.844 0 .52.45.837 1.091.837.857 0 1.505-.545 1.505-1.256v-.515z"})}),bBe=({style:e,className:t})=>(0,Zi.jsx)("div",{className:"block-library-colors-selector__icon-container",children:(0,Zi.jsx)("div",{className:`${t} block-library-colors-selector__state-selection`,style:e,children:(0,Zi.jsx)(gBe,{})})}),kBe=({TextColor:e,BackgroundColor:t})=>function({onToggle:r,isOpen:n}){let i=s=>{!n&&s.keyCode===rJ.DOWN&&(s.preventDefault(),r())};return(0,Zi.jsx)(Ma.ToolbarGroup,{children:(0,Zi.jsx)(Ma.ToolbarButton,{className:"components-toolbar__control block-library-colors-selector__toggle",label:(0,oJ.__)("Open Colors Selector"),onClick:r,onKeyDown:i,icon:(0,Zi.jsx)(t,{children:(0,Zi.jsx)(e,{children:(0,Zi.jsx)(bBe,{})})})})})},vBe=({children:e,...t})=>((0,nJ.default)("wp.blockEditor.BlockColorsStyleSelector",{alternative:"block supports API",since:"6.1",version:"6.3"}),(0,Zi.jsx)(Ma.Dropdown,{popoverProps:{placement:"bottom-start"},className:"block-library-colors-selector",contentClassName:"block-library-colors-selector__popover",renderToggle:kBe(t),renderContent:()=>e})),iJ=vBe;var dee=l(Re(),1),jT=l(A(),1),c3=l(N(),1),fee=l(F(),1),mee=l(R(),1);var Xg=l(Z(),1),FT=l(A(),1),LS=l(F(),1),cee=l(Re(),1),vo=l(R(),1),l3=l(N(),1);var LT=l(A(),1),NT=l(R(),1),MT=l(F(),1);var aJ=l(Z(),1),lJ=l(Xo(),1),cJ=l(F(),1),IT=l(R(),1),Wg=l(N(),1);var CT=l(R(),1),BT=(0,CT.createContext)({});BT.displayName="ListViewContext";var md=()=>(0,CT.useContext)(BT);var ET=l(R(),1),sJ=l(w(),1);function TT({children:e,...t}){let o=(0,ET.useRef)();return(0,ET.useEffect)(()=>{o.current&&(o.current.textContent=o.current.textContent)},[e]),(0,sJ.jsx)("div",{hidden:!0,...t,ref:o,children:e})}var OS=l(w(),1),n3=(0,IT.forwardRef)(({nestingLevel:e,blockCount:t,clientId:o,...r},n)=>{let{insertedBlock:i,setInsertedBlock:s}=md(),a=(0,aJ.useInstanceId)(n3),{directInsert:c,hideInserter:u}=(0,cJ.useSelect)(p=>{let{getBlockListSettings:g,getTemplateLock:b,isZoomOut:v}=M(p(_)),y=g(o)?.directInsert||!1,S=!!b(o)||v();return{directInsert:y,hideInserter:S}},[o]),d=zr({clientId:o,context:"list-view"}),f=zr({clientId:i?.clientId,context:"list-view"});if((0,IT.useEffect)(()=>{f?.length&&(0,lJ.speak)((0,Wg.sprintf)((0,Wg.__)("%s block inserted"),f),"assertive")},[f]),u)return null;let m=`list-view-appender__${a}`,h=(0,Wg.sprintf)((0,Wg.__)("Append to %1$s block at position %2$d, Level %3$d"),d,t+1,e);return(0,OS.jsxs)("div",{className:"list-view-appender",children:[(0,OS.jsx)(Ui,{ref:n,rootClientId:o,position:"bottom right",isAppender:!0,selectBlockOnInsert:!1,shouldDirectInsert:c,__experimentalIsQuick:!0,...r,toggleProps:{"aria-describedby":m},onSelectOrClose:p=>{p?.clientId&&s(p)}}),(0,OS.jsx)(TT,{id:m,children:h})]})});var gd=l($(),1),Nm=l(A(),1),OT=l(Z(),1);var ko=l(R(),1),Kg=l(F(),1),s3=l(N(),1),AT=l(it(),1),LJ=l(Jy(),1),NJ=l(Is(),1),MJ=l(Xo(),1);var uJ=l(A(),1),dJ=l(Z(),1),fJ=l(R(),1);var mJ=l(w(),1),yBe=P7(uJ.__experimentalTreeGridRow),SBe=(0,fJ.forwardRef)(({isDragged:e,isSelected:t,position:o,level:r,rowCount:n,children:i,className:s,path:a,...c},u)=>{let d=YC({clientId:c["data-block"],enableAnimation:!0,triggerAnimationOnChange:a}),f=(0,dJ.useMergeRefs)([u,d]);return(0,mJ.jsx)(yBe,{ref:f,className:V("block-editor-list-view-leaf",s),level:r,positionInSet:o,setSize:n,isExpanded:void 0,...c,children:i})}),pJ=SBe;var hJ=l(Fe(),1),gJ=l(R(),1);function bJ({isSelected:e,selectedClientIds:t,rowItemRef:o}){let r=t.length===1;(0,gJ.useLayoutEffect)(()=>{if(!e||!r||!o.current)return;let n=(0,hJ.getScrollContainer)(o.current),{ownerDocument:i}=o.current;if(n===i.body||n===i.documentElement||!n)return;let a=o.current.getBoundingClientRect(),c=n.getBoundingClientRect();(a.top<c.top||a.bottom>c.bottom)&&o.current.scrollIntoView()},[e,r,o])}var BJ=l(R(),1);var pd=l(A(),1),xJ=l(R(),1);var RT=l(it(),1),wJ=l(F(),1);var kJ=l(N(),1),i3=l(w(),1);function PT({onClick:e}){return(0,i3.jsx)("span",{className:"block-editor-list-view__expander",onClick:t=>e(t,{forceToggle:!0}),"aria-hidden":"true","data-testid":"list-view-expander",children:(0,i3.jsx)(we,{icon:(0,kJ.isRTL)()?ev:tu})})}var vJ=l(R(),1),yJ=l(F(),1);var _Be=3,SJ={"core/image":({clientId:e,attributes:t})=>{if(t.url)return{url:t.url,alt:t.alt||"",clientId:e}},"core/cover":({clientId:e,attributes:t})=>{if(t.backgroundType==="image"&&t.url)return{url:t.url,alt:t.alt||"",clientId:e}},"core/media-text":({clientId:e,attributes:t})=>{if(t.mediaType==="image"&&t.mediaUrl)return{url:t.mediaUrl,alt:t.mediaAlt||"",clientId:e}},"core/gallery":({innerBlocks:e})=>{let t=[],o=e?.length?SJ[e[0].name]:void 0;if(!o)return t;for(let r of e){let n=o(r);if(n&&t.push(n),t.length>=_Be)return t}return t}};function xBe(e,t){let o=SJ[e.name],r=o?o(e):void 0;return r?Array.isArray(r)?t?[]:r:[r]:[]}function _J({clientId:e,isExpanded:t}){let{block:o}=(0,yJ.useSelect)(n=>({block:n(_).getBlock(e)}),[e]);return(0,vJ.useMemo)(()=>xBe(o,t),[o,t])}var jo=l(w(),1),{Badge:wBe}=M(pd.privateApis);function CBe({className:e,block:{clientId:t},onClick:o,onContextMenu:r,onMouseDown:n,onToggleExpanded:i,tabIndex:s,onFocus:a,onDragStart:c,onDragEnd:u,draggable:d,isExpanded:f,ariaDescribedBy:m},h){let p=Tt(t),g=zr({clientId:t,context:"list-view"}),{isLocked:b}=ei(t),{hasPatternName:v,blockVisibility:k}=(0,wJ.useSelect)(P=>{let{getBlockAttributes:E}=M(P(_)),L=E(t);return{hasPatternName:!!L?.metadata?.patternName,blockVisibility:L?.metadata?.blockVisibility}},[t]),y=b,S=p?.positionType==="sticky",x=_J({clientId:t,isExpanded:f}),C=by(k),B=P=>{P.dataTransfer.clearData(),c?.(P)};function I(P){(P.keyCode===RT.ENTER||P.keyCode===RT.SPACE)&&o(P)}return(0,jo.jsxs)("a",{className:V("block-editor-list-view-block-select-button",e),onClick:o,onContextMenu:r,onKeyDown:I,onMouseDown:n,ref:h,tabIndex:s,onFocus:a,onDragStart:B,onDragEnd:u,draggable:d,href:`#block-${t}`,"aria-describedby":m,"aria-expanded":f,children:[(0,jo.jsx)(PT,{onClick:i}),(0,jo.jsx)(Ae,{icon:v?Ei:p?.icon,showColors:!0,context:"list-view"}),(0,jo.jsxs)(pd.__experimentalHStack,{alignment:"center",className:"block-editor-list-view-block-select-button__label-wrapper",justify:"flex-start",spacing:1,children:[(0,jo.jsx)("span",{className:"block-editor-list-view-block-select-button__title",children:(0,jo.jsx)(pd.__experimentalTruncate,{ellipsizeMode:"auto",children:g})}),p?.anchor&&(0,jo.jsx)("span",{className:"block-editor-list-view-block-select-button__anchor-wrapper",children:(0,jo.jsx)(wBe,{className:"block-editor-list-view-block-select-button__anchor",children:p.anchor})}),S&&(0,jo.jsx)("span",{className:"block-editor-list-view-block-select-button__sticky",children:(0,jo.jsx)(we,{icon:NL})}),x.length?(0,jo.jsx)("span",{className:"block-editor-list-view-block-select-button__images","aria-hidden":!0,children:x.map((P,E)=>(0,jo.jsx)("span",{className:"block-editor-list-view-block-select-button__image",style:{backgroundImage:`url(${P.url})`,zIndex:x.length-E}},P.clientId))}):null,!!C&&(0,jo.jsx)(pd.Tooltip,{text:C,children:(0,jo.jsx)("span",{className:"block-editor-list-view-block-select-button__block-visibility","aria-hidden":"true",children:(0,jo.jsx)(we,{icon:vs})})}),y&&(0,jo.jsx)("span",{className:"block-editor-list-view-block-select-button__lock",children:(0,jo.jsx)(we,{icon:EL})})]})]})}var CJ=(0,xJ.forwardRef)(CBe);var hd=l(w(),1),BBe=(0,BJ.forwardRef)(({onClick:e,onToggleExpanded:t,block:o,isSelected:r,position:n,siblingBlockCount:i,level:s,isExpanded:a,selectedClientIds:c,...u},d)=>{let{clientId:f}=o,{AdditionalBlockContent:m,insertedBlock:h,setInsertedBlock:p}=md(),g=c.includes(f)?c:[f];return(0,hd.jsxs)(hd.Fragment,{children:[m&&(0,hd.jsx)(m,{block:o,insertedBlock:h,setInsertedBlock:p}),(0,hd.jsx)(fE,{appendToOwnerDocument:!0,clientIds:g,cloneClassname:"block-editor-list-view-draggable-chip",children:({draggable:b,onDragStart:v,onDragEnd:k})=>(0,hd.jsx)(CJ,{ref:d,className:"block-editor-list-view-block-contents",block:o,onClick:e,onToggleExpanded:t,isSelected:r,position:n,siblingBlockCount:i,level:s,draggable:b,onDragStart:v,onDragEnd:k,isExpanded:a,...u})})]})}),EJ=BBe;var Lm=l(N(),1),TJ=l(Fe(),1),IJ=(e,t,o)=>(0,Lm.sprintf)((0,Lm.__)("Block %1$d of %2$d, Level %3$d."),e,t,o),PJ=(e,t)=>[e?.positionLabel?`${(0,Lm.sprintf)((0,Lm.__)("Position: %s"),e.positionLabel)}.`:void 0,t?(0,Lm.__)("This block is locked."):void 0].filter(Boolean).join(" "),RJ=(e,t)=>Array.isArray(t)&&t.length?t.indexOf(e)!==-1:t===e;function OJ(e,t,o,r){let n=[...o,e],i=[...r,t],s=Math.min(n.length,i.length)-1,a=n[s],c=i[s];return{start:a,end:c}}function $g(e,t){if(!t)return;let o=`[role=row][data-block="${e}"]`;return new Promise(r=>{if(t.querySelector(o))return r(t.querySelector(o));let n=null,i=new window.MutationObserver(()=>{t.querySelector(o)&&(clearTimeout(n),i.disconnect(),r(t.querySelector(o)))});i.observe(t,{childList:!0,subtree:!0}),n=setTimeout(()=>{i.disconnect(),r(null)},3e3)}).then(r=>{r&&r.isConnected&&TJ.focus.focusable.find(r)?.[0]?.focus()})}function AJ({blockIndexes:e,blockDropTargetIndex:t,blockDropPosition:o,clientId:r,firstDraggedBlockIndex:n,isDragged:i}){let s,a,c;if(!i){a=!1;let u=e[r];c=u>n,t!=null&&n!==void 0?u!==void 0&&(u>=n&&u<t?s="up":u<n&&u>=t?s="down":s="normal",a=typeof t=="number"&&t-1===u&&o==="inside"):t===null&&n!==void 0?u!==void 0&&u>=n?s="up":s="normal":t!=null&&n===void 0?u!==void 0&&(u<t?s="normal":s="down"):t===null&&(s="normal")}return{displacement:s,isNesting:a,isAfterDraggedBlocks:c}}var er=l(w(),1);function DJ({block:{clientId:e},displacement:t,isAfterDraggedBlocks:o,isDragged:r,isNesting:n,isSelected:i,isBranchSelected:s,selectBlock:a,position:c,level:u,rowCount:d,siblingBlockCount:f,showBlockMovers:m,path:h,isExpanded:p,selectedClientIds:g,isSyncedBranch:b}){let v=(0,ko.useRef)(null),k=(0,ko.useRef)(null),y=(0,ko.useRef)(null),[S,x]=(0,ko.useState)(!1),[C,B]=(0,ko.useState)(),[I,P]=(0,ko.useState)(!1),{isLocked:E}=ei(e),L=i&&g[0]===e,T=i&&g[g.length-1]===e,{toggleBlockHighlight:O,duplicateBlocks:D,multiSelect:U,replaceBlocks:G,removeBlocks:j,insertAfterBlock:z,insertBeforeBlock:W,showViewportModal:ee}=M((0,Kg.useDispatch)(_)),se=(0,OT.useDebounce)(O,50),{canInsertBlockType:ce,getSelectedBlockClientIds:ie,getPreviousBlockClientId:re,getBlockRootClientId:Q,getBlockOrder:Y,getBlockParents:J,getBlockEditingMode:K,getBlocksByClientId:H,canEditBlock:X,canMoveBlock:ne,canRemoveBlocks:le,isGroupable:ve}=(0,Kg.useSelect)(_),{getGroupingBlockName:he}=(0,Kg.useSelect)(gd.store),xe=Tt(e),ze=yg(),{block:ot,blockName:Wt,allowRightClickOverrides:fo}=(0,Kg.useSelect)(ue=>{let{getBlock:to,getBlockName:ye,getSettings:Lt}=M(ue(_));return{block:to(e),blockName:ye(e),allowRightClickOverrides:Lt().allowRightClickOverrides}},[e]),{canRename:Do}=Pm(Wt),rt=(0,gd.hasBlockSupport)(Wt,"__experimentalToolbar",!0),xt=`list-view-block-select-button__description-${(0,OT.useInstanceId)(DJ)}`,{expand:At,collapse:Pe,collapseAll:wt,BlockSettingsMenu:qo,listViewInstanceId:$t,expandedState:lr,setInsertedBlock:ln,treeGridElementRef:je,rootClientId:Eo}=md(),Ze=(0,NJ.__unstableUseShortcutEventMatch)();function Ve(){let ue=ie(),to=ue.includes(e),ye=to?ue[0]:e,Lt=Q(ye);return{blocksToUpdate:to?ue:[e],firstBlockClientId:ye,firstBlockRootClientId:Lt,selectedBlockClientIds:ue}}async function gt(ue){if(ue.defaultPrevented||ue.target.closest("[role=dialog]"))return;let to=[AT.BACKSPACE,AT.DELETE].includes(ue.keyCode);if(Ze("core/block-editor/unselect",ue)&&g.length>0)ue.stopPropagation(),ue.preventDefault(),a(ue,void 0);else if(to||Ze("core/block-editor/remove",ue)){let{blocksToUpdate:ye,firstBlockClientId:Lt,firstBlockRootClientId:un,selectedBlockClientIds:_r}=Ve();if(!le(ye))return;let Wc=re(Lt)??un;j(ye,!1);let mO=_r.length>0&&ie().length===0;Wc||(Wc=Y()[0]),Ct(Wc,mO)}else if(Ze("core/block-editor/paste-styles",ue)){ue.preventDefault();let{blocksToUpdate:ye}=Ve(),Lt=H(ye);ze(Lt)}else if(Ze("core/block-editor/duplicate",ue)){ue.preventDefault();let{blocksToUpdate:ye,firstBlockRootClientId:Lt}=Ve();if(H(ye).every(_r=>!!_r&&(0,gd.hasBlockSupport)(_r.name,"multiple",!0)&&ce(_r.name,Lt))){let _r=await D(ye,!1);_r?.length&&Ct(_r[0],!1)}}else if(Ze("core/block-editor/insert-before",ue)){ue.preventDefault();let{blocksToUpdate:ye}=Ve();await W(ye[0]);let Lt=ie();Ct(Lt[0],!1)}else if(Ze("core/block-editor/insert-after",ue)){ue.preventDefault();let{blocksToUpdate:ye}=Ve();await z(ye.at(-1));let Lt=ie();Ct(Lt[0],!1)}else if(Ze("core/block-editor/select-all",ue)){ue.preventDefault();let{firstBlockRootClientId:ye,selectedBlockClientIds:Lt}=Ve(),un=Y(ye);if(!un.length)return;if((0,LJ.isShallowEqual)(Lt,un)&&ye&&ye!==Eo){Ct(ye,!0);return}U(un[0],un[un.length-1],null)}else if(Ze("core/block-editor/collapse-list-view",ue)){ue.preventDefault();let{firstBlockClientId:ye}=Ve(),Lt=J(ye,!1);wt(),At(Lt)}else if(Ze("core/block-editor/group",ue)){let{blocksToUpdate:ye}=Ve();if(ye.length>1&&ve(ye)){ue.preventDefault();let Lt=H(ye),un=he(),_r=(0,gd.switchToBlockType)(Lt,un);G(ye,_r),(0,MJ.speak)((0,s3.__)("Selected blocks are grouped."));let Wc=ie();Ct(Wc[0],!1)}}else if(Ze("core/block-editor/toggle-block-visibility",ue)){ue.preventDefault();let{blocksToUpdate:ye}=Ve();if(!H(ye).every(_r=>(0,gd.hasBlockSupport)(_r.name,"visibility",!0))||ye.some(_r=>K(_r)!=="default"))return;ee(ye)}else if(Ze("core/block-editor/rename",ue)){let{blocksToUpdate:ye}=Ve(),Lt=K(ye[0])==="contentOnly";ye.length===1&&Do&&!Lt&&(ue.preventDefault(),P(!0))}}let To=(0,ko.useCallback)(()=>{x(!0),se(e,!0)},[e,x,se]),cr=(0,ko.useCallback)(()=>{x(!1),se(e,!1)},[e,x,se]),ge=(0,ko.useCallback)(ue=>{a(ue,e),ue.preventDefault()},[e,a]),Ct=(0,ko.useCallback)((ue,to)=>{to&&a(void 0,ue,null,null),$g(ue,je?.current)},[a,je]),Io=(0,ko.useCallback)(ue=>{ue.preventDefault(),ue.stopPropagation(),p===!0?Pe(e):p===!1&&At(e)},[e,At,Pe,p]),Ke=(0,ko.useCallback)(ue=>{let{ownerDocument:to}=y?.current||{};!to||!to.hasFocus()||rt&&fo&&(y.current?.click(),B(new window.DOMRect(ue.clientX,ue.clientY,0,0)),ue.preventDefault())},[fo,y,rt]),te=(0,ko.useCallback)(ue=>{fo&&ue.button===2&&ue.preventDefault()},[fo]),Le=(0,ko.useMemo)(()=>{let{ownerDocument:ue}=k?.current||{};if(!(!C||!ue))return{ownerDocument:ue,getBoundingClientRect(){return C}}},[C]),ct=(0,ko.useCallback)(()=>{B(void 0)},[B]);if(bJ({isSelected:i,rowItemRef:k,selectedClientIds:g}),!ot)return null;let Gc=IJ(c,f,u),ua=PJ(xe,E),Bp=by(ot?.attributes?.metadata?.blockVisibility),jk=f>0,hf=m&&jk,cn=V("block-editor-list-view-block__mover-cell",{"is-visible":S||i}),Ep=V("block-editor-list-view-block__menu-cell",{"is-visible":S||L}),Tp;hf?Tp=2:rt||(Tp=3);let s0=V({"is-selected":i,"is-first-selected":L,"is-last-selected":T,"is-branch-selected":s,"is-synced-branch":b,"is-dragging":r,"has-single-cell":!rt,"is-synced":xe?.isSynced,"is-draggable":ne,"is-displacement-normal":t==="normal","is-displacement-up":t==="up","is-displacement-down":t==="down","is-after-dragged-blocks":o,"is-nesting":n}),a0=g.includes(e)?g:[e],Uk=i&&g.length===1;return(0,er.jsxs)(pJ,{className:s0,isDragged:r,onKeyDown:gt,onMouseEnter:To,onMouseLeave:cr,onFocus:To,onBlur:cr,level:u,position:c,rowCount:d,path:h,id:`list-view-${$t}-block-${e}`,"data-block":e,"data-expanded":X?p:void 0,ref:k,children:[(0,er.jsx)(Nm.__experimentalTreeGridCell,{className:"block-editor-list-view-block__contents-cell",colSpan:Tp,ref:v,"aria-selected":!!i,children:({ref:ue,tabIndex:to,onFocus:ye})=>(0,er.jsxs)("div",{className:"block-editor-list-view-block__contents-container",children:[(0,er.jsx)(EJ,{block:ot,onClick:ge,onContextMenu:Ke,onMouseDown:te,onToggleExpanded:Io,isSelected:i,position:c,siblingBlockCount:f,level:u,ref:ue,tabIndex:Uk?0:to,onFocus:ye,isExpanded:X?p:void 0,selectedClientIds:g,ariaDescribedBy:xt}),(0,er.jsx)(TT,{id:xt,children:[Gc,ua,Bp].filter(Boolean).join(" ")})]})}),hf&&(0,er.jsx)(er.Fragment,{children:(0,er.jsxs)(Nm.__experimentalTreeGridCell,{className:cn,withoutGridItem:!0,children:[(0,er.jsx)(Nm.__experimentalTreeGridItem,{children:({ref:ue,tabIndex:to,onFocus:ye})=>(0,er.jsx)(gE,{orientation:"vertical",clientIds:[e],ref:ue,tabIndex:to,onFocus:ye})}),(0,er.jsx)(Nm.__experimentalTreeGridItem,{children:({ref:ue,tabIndex:to,onFocus:ye})=>(0,er.jsx)(bE,{orientation:"vertical",clientIds:[e],ref:ue,tabIndex:to,onFocus:ye})})]})}),rt&&qo&&(0,er.jsx)(Nm.__experimentalTreeGridCell,{className:Ep,"aria-selected":!!i,ref:y,children:({ref:ue,tabIndex:to,onFocus:ye})=>(0,er.jsx)(qo,{clientIds:a0,block:ot,icon:ks,label:(0,s3.__)("Options"),popoverProps:{anchor:Le},toggleProps:{ref:ue,className:"block-editor-list-view-block__menu",tabIndex:to,onClick:ct,onFocus:ye,size:"small"},disableOpenOnArrowDown:!0,expand:At,expandedState:lr,setInsertedBlock:ln,__experimentalSelectBlock:Ct})}),I&&(0,er.jsx)(Tm,{clientId:e,onClose:()=>P(!1)})]})}var VJ=(0,ko.memo)(DJ);var ni=l(w(),1);function FJ(e,t,o,r){return o?.includes(e.clientId)?0:t[e.clientId]??r?1+e.innerBlocks.reduce(EBe(t,o,r),0):1}var EBe=(e,t,o)=>(r,n)=>t?.includes(n.clientId)?r:(e[n.clientId]??o)&&n.innerBlocks.length>0?r+FJ(n,e,t,o):r+1,TBe=()=>{};function zJ(e){let{blocks:t,selectBlock:o=TBe,showBlockMovers:r,selectedClientIds:n,level:i=1,path:s="",isBranchSelected:a=!1,listPosition:c=0,fixedListWindow:u,isExpanded:d,parentId:f,shouldShowInnerBlocks:m=!0,isSyncedBranch:h=!1,showAppender:p=!0}=e,g=Tt(f),b=h||!!g?.isSynced,v=(0,MT.useSelect)(O=>f?O(_).canEditBlock(f):!0,[f]),{blockDropPosition:k,blockDropTargetIndex:y,firstDraggedBlockIndex:S,blockIndexes:x,expandedState:C,draggedClientIds:B}=md(),I=(0,NT.useRef)();if(!v)return null;let P=p&&i===1,E=t.filter(Boolean),L=E.length,T=P?L+1:L;return I.current=c,(0,ni.jsxs)(ni.Fragment,{children:[E.map((O,D)=>{let{clientId:U,innerBlocks:G}=O;D>0&&(I.current+=FJ(E[D-1],C,B,d));let j=!!B?.includes(U),{displacement:z,isAfterDraggedBlocks:W,isNesting:ee}=AJ({blockIndexes:x,blockDropTargetIndex:y,blockDropPosition:k,clientId:U,firstDraggedBlockIndex:S,isDragged:j}),{itemInView:se}=u,ce=se(I.current),ie=D+1,re=s.length>0?`${s}_${ie}`:`${ie}`,Q=!!G?.length,Y=Q&&m?C[U]??d:void 0,J=RJ(U,n),K=a||J&&Q,H=j||ce||J&&U===n[0]||D===0||D===L-1;return(0,ni.jsxs)(MT.AsyncModeProvider,{value:!J,children:[H&&(0,ni.jsx)(VJ,{block:O,selectBlock:o,isSelected:J,isBranchSelected:K,isDragged:j,level:i,position:ie,rowCount:T,siblingBlockCount:L,showBlockMovers:r,path:re,isExpanded:j?!1:Y,listPosition:I.current,selectedClientIds:n,isSyncedBranch:b,displacement:z,isAfterDraggedBlocks:W,isNesting:ee}),!H&&(0,ni.jsx)("tr",{children:(0,ni.jsx)("td",{className:"block-editor-list-view-placeholder"})}),Q&&Y&&!j&&(0,ni.jsx)(zJ,{parentId:U,blocks:G,selectBlock:o,showBlockMovers:r,level:i+1,path:re,listPosition:I.current+1,fixedListWindow:u,isBranchSelected:K,selectedClientIds:n,isExpanded:d,isSyncedBranch:b})]},U)}),P&&(0,ni.jsx)(LT.__experimentalTreeGridRow,{level:i,setSize:T,positionInSet:T,isExpanded:!0,children:(0,ni.jsx)(LT.__experimentalTreeGridCell,{children:O=>(0,ni.jsx)(n3,{clientId:f,nestingLevel:i,blockCount:L,...O})})})]})}var jJ=(0,NT.memo)(zJ);var Yg=l(A(),1),DT=l(Fe(),1),sc=l(R(),1),a3=l(N(),1);var Xi=l(w(),1);function UJ({draggedBlockClientId:e,listViewRef:t,blockDropTarget:o}){let r=Tt(e),n=zr({clientId:e,context:"list-view"}),{rootClientId:i,clientId:s,dropPosition:a}=o||{},[c,u]=(0,sc.useMemo)(()=>{if(!t.current)return[];let k=i?t.current.querySelector(`[data-block="${i}"]`):void 0,y=s?t.current.querySelector(`[data-block="${s}"]`):void 0;return[k,y]},[t,i,s]),d=u||c,f=(0,a3.isRTL)(),m=(0,sc.useCallback)((k,y)=>{if(!d)return 0;let S=d.offsetWidth,x=(0,DT.getScrollContainer)(d,"horizontal"),C=d.ownerDocument,B=x===C.body||x===C.documentElement;if(x&&!B){let I=x.getBoundingClientRect(),P=(0,a3.isRTL)()?I.right-k.right:k.left-I.left,E=x.clientWidth;if(E<S+P&&(S=E-P),!f&&k.left+y<I.left)return S-=I.left-k.left,S;if(f&&k.right-y>I.right)return S-=k.right-I.right,S}return S-y},[f,d]),h=(0,sc.useMemo)(()=>{if(!d)return{};let k=d.getBoundingClientRect();return{width:m(k,0)}},[m,d]),p=(0,sc.useMemo)(()=>{if(!d)return{};let k=(0,DT.getScrollContainer)(d),y=d.ownerDocument,S=k===y.body||k===y.documentElement;if(k&&!S){let x=k.getBoundingClientRect(),C=d.getBoundingClientRect(),B=f?x.right-C.right:C.left-x.left;if(!f&&x.left>C.left)return{transform:`translateX( ${B}px )`};if(f&&x.right<C.right)return{transform:`translateX( ${B*-1}px )`}}return{}},[f,d]),g=(0,sc.useMemo)(()=>{if(!c)return 1;let k=parseInt(c.getAttribute("aria-level"),10);return k?k+1:1},[c]),b=(0,sc.useMemo)(()=>d?d.classList.contains("is-branch-selected"):!1,[d]),v=(0,sc.useMemo)(()=>{if(!(!d||!(a==="top"||a==="bottom"||a==="inside")))return{contextElement:d,getBoundingClientRect(){let y=d.getBoundingClientRect(),S=y.left,x=0,C=(0,DT.getScrollContainer)(d,"horizontal"),B=d.ownerDocument,I=C===B.body||C===B.documentElement;if(C&&!I){let L=C.getBoundingClientRect(),T=f?C.offsetWidth-C.clientWidth:0;S<L.left+T&&(S=L.left+T)}a==="top"?x=y.top-y.height*2:x=y.top;let P=m(y,0),E=y.height;return new window.DOMRect(S,x,P,E)}}},[d,a,m,f]);return d?(0,Xi.jsx)(Yg.Popover,{animate:!1,anchor:v,focusOnMount:!1,className:"block-editor-list-view-drop-indicator--preview",variant:"unstyled",flip:!1,resize:!0,children:(0,Xi.jsx)("div",{style:h,className:V("block-editor-list-view-drop-indicator__line",{"block-editor-list-view-drop-indicator__line--darker":b}),children:(0,Xi.jsxs)("div",{className:"block-editor-list-view-leaf","aria-level":g,children:[(0,Xi.jsxs)("div",{className:V("block-editor-list-view-block-select-button","block-editor-list-view-block-contents"),style:p,children:[(0,Xi.jsx)(PT,{onClick:()=>{}}),(0,Xi.jsx)(Ae,{icon:r?.icon,showColors:!0,context:"list-view"}),(0,Xi.jsx)(Yg.__experimentalHStack,{alignment:"center",className:"block-editor-list-view-block-select-button__label-wrapper",justify:"flex-start",spacing:1,children:(0,Xi.jsx)("span",{className:"block-editor-list-view-block-select-button__title",children:(0,Xi.jsx)(Yg.__experimentalTruncate,{ellipsizeMode:"auto",children:n})})})]}),(0,Xi.jsx)("div",{className:"block-editor-list-view-block__menu-cell"})]})})}):null}var HJ=l(Xo(),1),qg=l(N(),1),AS=l(F(),1),GJ=l(R(),1),ii=l(it(),1),WJ=l($(),1);function $J(){let{clearSelectedBlock:e,multiSelect:t,selectBlock:o}=(0,AS.useDispatch)(_),{getBlockName:r,getBlockParents:n,getBlockSelectionStart:i,getSelectedBlockClientIds:s,hasMultiSelection:a,hasSelectedBlock:c}=(0,AS.useSelect)(_),{getBlockType:u}=(0,AS.useSelect)(WJ.store);return{updateBlockSelection:(0,GJ.useCallback)(async(f,m,h,p)=>{if(!f?.shiftKey&&f?.keyCode!==ii.ESCAPE){o(m,p);return}f.preventDefault();let g=f.type==="keydown"&&f.keyCode===ii.ESCAPE,b=f.type==="keydown"&&(f.keyCode===ii.UP||f.keyCode===ii.DOWN||f.keyCode===ii.HOME||f.keyCode===ii.END);if(!b&&!c()&&!a()){o(m,null);return}let v=s(),k=[...n(m),m];if((g||b&&!v.some(C=>k.includes(C)))&&await e(),!g){let C=i(),B=m;b&&(!c()&&!a()&&(C=m),h&&(B=h));let I=n(C),P=n(B),{start:E,end:L}=OJ(C,B,I,P);await t(E,L,null)}let y=s();if((f.keyCode===ii.HOME||f.keyCode===ii.END)&&y.length>1)return;let S=v.filter(C=>!y.includes(C)),x;if(S.length===1){let C=u(r(S[0]))?.title;C&&(x=(0,qg.sprintf)((0,qg.__)("%s deselected."),C))}else S.length>1&&(x=(0,qg.sprintf)((0,qg.__)("%s blocks deselected."),S.length));x&&(0,HJ.speak)(x,"assertive")},[e,r,u,n,i,s,a,c,t,o])}}var KJ=l(R(),1);function YJ(e){return(0,KJ.useMemo)(()=>{let o={},r=0,n=i=>{i.forEach(s=>{o[s.clientId]=r,r++,s.innerBlocks.length>0&&n(s.innerBlocks)})};return n(e),o},[e])}var qJ=l(F(),1);function ZJ({blocks:e,rootClientId:t}){return(0,qJ.useSelect)(o=>{let{getDraggedBlockClientIds:r,getSelectedBlockClientIds:n,getEnabledClientIdsTree:i}=M(o(_));return{selectedClientIds:n(),draggedClientIds:r(),clientIdsTree:e??i(t)}},[e,t])}var XJ=l(R(),1),QJ=l(F(),1);function JJ({collapseAll:e,expand:t}){let{expandedBlock:o,getBlockParents:r}=(0,QJ.useSelect)(n=>{let{getBlockParents:i,getExpandedBlock:s}=M(n(_));return{expandedBlock:s(),getBlockParents:i}},[]);(0,XJ.useEffect)(()=>{if(o){let n=r(o,!1);e(),t(n)}},[e,t,o,r])}var eee=l(F(),1),Mm=l(R(),1),Dm=l(Z(),1),tee=l(N(),1);var ac=24;function IBe(e,t,o=1,r=!1){let n=r?t.right-o*ac:t.left+o*ac;return r?e.x>n:e.x<n}function PBe(e,t,o=1,r=!1){let n=r?t.right-o*ac:t.left+o*ac,i=r?n-e.x:e.x-n,s=Math.round(i/ac);return Math.abs(s)}function RBe(e,t){let o=[],r=e;for(;r;)o.push({...r}),r=t.find(n=>n.clientId===r.rootClientId);return o}function oee(e,t){let o=e[t+1];return o&&o.isDraggedBlock?oee(e,t+1):o}function OBe(e,t,o=1,r=!1){let n=r?t.right-o*ac:t.left+o*ac;return(r?e.x<n-ac:e.x>n+ac)&&e.y<t.bottom}var ABe=["top","bottom"];function LBe(e,t,o=!1){let r,n,i,s,a;for(let f=0;f<e.length;f++){let m=e[f];if(m.isDraggedBlock)continue;let h=m.element.getBoundingClientRect(),[p,g]=bm(t,h,ABe),b=GB(t,h);if(i===void 0||p<i||b){i=p;let v=e.indexOf(m),k=e[v-1];if(g==="top"&&k&&k.rootClientId===m.rootClientId&&!k.isDraggedBlock?(n=k,r="bottom",s=k.element.getBoundingClientRect(),a=v-1):(n=m,r=g,s=h,a=v),b)break}}if(!n)return;let c=RBe(n,e),u=r==="bottom";if(u&&n.canInsertDraggedBlocksAsChild&&(n.innerBlockCount>0&&n.isExpanded||OBe(t,s,c.length,o))){let f=n.isExpanded?0:n.innerBlockCount||0;return{rootClientId:n.clientId,clientId:n.clientId,blockIndex:f,dropPosition:"inside"}}if(u&&n.rootClientId&&IBe(t,s,c.length,o)){let f=oee(e,a),m=n.nestingLevel,h=f?f.nestingLevel:1;if(m&&h){let p=PBe(t,s,c.length,o),g=Math.max(Math.min(p,m-h),0);if(c[g]){let b=n.blockIndex;if(c[g].nestingLevel===f?.nestingLevel)b=f?.blockIndex;else for(let v=a;v>=0;v--){let k=e[v];if(k.rootClientId===c[g].rootClientId){b=k.blockIndex+1;break}}return{rootClientId:c[g].rootClientId,clientId:n.clientId,blockIndex:b,dropPosition:r}}}}if(!n.canInsertDraggedBlocksAsSibling)return;let d=u?1:0;return{rootClientId:n.rootClientId,clientId:n.clientId,blockIndex:n.blockIndex+d,dropPosition:r}}var NBe={leading:!1,trailing:!0};function ree({dropZoneElement:e,expandedState:t,setExpandedState:o}){let{getBlockRootClientId:r,getBlockIndex:n,getBlockCount:i,getDraggedBlockClientIds:s,canInsertBlocks:a}=(0,eee.useSelect)(_),[c,u]=(0,Mm.useState)(),{rootClientId:d,blockIndex:f}=c||{},m=HB(d,f),h=(0,tee.isRTL)(),p=(0,Dm.usePrevious)(d),g=(0,Mm.useCallback)((S,x)=>{let{rootClientId:C}=x||{};C&&x?.dropPosition==="inside"&&!S[C]&&o({type:"expand",clientIds:[C]})},[o]),b=(0,Dm.useThrottle)(g,500,NBe);(0,Mm.useEffect)(()=>{if(c?.dropPosition!=="inside"||p!==c?.rootClientId){b.cancel();return}b(t,c)},[t,p,c,b]);let v=s(),k=(0,Dm.useThrottle)((0,Mm.useCallback)((S,x)=>{let C={x:S.clientX,y:S.clientY},B=!!v?.length,P=Array.from(x.querySelectorAll("[data-block]")).map(L=>{let T=L.dataset.block,O=L.dataset.expanded==="true",D=L.classList.contains("is-dragging"),U=parseInt(L.getAttribute("aria-level"),10),G=r(T);return{clientId:T,isExpanded:O,rootClientId:G,blockIndex:n(T),element:L,nestingLevel:U||void 0,isDraggedBlock:B?D:!1,innerBlockCount:i(T),canInsertDraggedBlocksAsSibling:B?a(v,G):!0,canInsertDraggedBlocksAsChild:B?a(v,T):!0}}),E=LBe(P,C,h);E&&u(E)},[a,v,i,n,r,h]),50);return{ref:(0,Dm.__experimentalUseDropZone)({dropZoneElement:e,onDrop(S){k.cancel(),c&&m(S),u(void 0)},onDragLeave(){k.cancel(),u(null)},onDragOver(S){k(S,S.currentTarget)},onDragEnd(){k.cancel(),u(void 0)}}),target:c}}var VT=l(R(),1),nee=l(F(),1);function iee({firstSelectedBlockClientId:e,setExpandedState:t}){let[o,r]=(0,VT.useState)(null),{selectedBlockParentClientIds:n}=(0,nee.useSelect)(i=>{let{getBlockParents:s}=i(_);return{selectedBlockParentClientIds:s(e,!1)}},[e]);return(0,VT.useEffect)(()=>{o!==e&&n?.length&&t({type:"expand",clientIds:n})},[e,n,o,t]),{setSelectedTreeId:r}}var Zg=l(F(),1),see=l(Z(),1);function aee({selectBlock:e}){let t=(0,Zg.useRegistry)(),{getBlockOrder:o,getBlockRootClientId:r,getBlocksByClientId:n,getPreviousBlockClientId:i,getSelectedBlockClientIds:s,getSettings:a,canInsertBlockType:c,canRemoveBlocks:u}=(0,Zg.useSelect)(_),{flashBlock:d,removeBlocks:f,replaceBlocks:m,insertBlocks:h}=(0,Zg.useDispatch)(_),p=Oh();return(0,see.useRefEffect)(g=>{function b(y,S){S&&e(void 0,y,null,null),$g(y,g)}function v(y){let S=s(),x=S.includes(y),C=x?S[0]:y,B=r(C);return{blocksToUpdate:x?S:[y],firstBlockClientId:C,firstBlockRootClientId:B,originallySelectedBlockClientIds:S}}function k(y){if(y.defaultPrevented||!g.contains(y.target.ownerDocument.activeElement))return;let x=y.target.ownerDocument.activeElement?.closest("[role=row]")?.dataset?.block;if(!x)return;let{blocksToUpdate:C,firstBlockClientId:B,firstBlockRootClientId:I,originallySelectedBlockClientIds:P}=v(x);if(C.length!==0){if(y.preventDefault(),y.type==="copy"||y.type==="cut"){C.length===1&&d(C[0]),p(y.type,C);let E=n(C);C1(y,E,t)}if(y.type==="cut"){if(!u(C))return;let E=i(B)??I;f(C,!1);let L=P.length>0&&s().length===0;E||(E=o()[0]),b(E,L)}else if(y.type==="paste"){let{__experimentalCanUserUseUnfilteredHTML:E}=a(),L=vG(y,E);if(C.length===1){let[T]=C;if(L.every(O=>c(O.name,T))){h(L,void 0,T),b(L[0]?.clientId,!1);return}}m(C,L,L.length-1,-1),b(L[0]?.clientId,!1)}}}return g.ownerDocument.addEventListener("copy",k),g.ownerDocument.addEventListener("cut",k),g.ownerDocument.addEventListener("paste",k),()=>{g.ownerDocument.removeEventListener("copy",k),g.ownerDocument.removeEventListener("cut",k),g.ownerDocument.removeEventListener("paste",k)}},[])}var lc=l(w(),1),MBe=(e,t)=>t.type==="clear"?{}:Array.isArray(t.clientIds)?{...e,...t.clientIds.reduce((o,r)=>({...o,[r]:t.type==="expand"}),{})}:e,lee=32;function uee({id:e,blocks:t,dropZoneElement:o,showBlockMovers:r=!1,isExpanded:n=!1,showAppender:i=!1,blockSettingsMenu:s=IV,rootClientId:a,description:c,onSelect:u,additionalBlockContent:d},f){t&&(0,cee.default)("`blocks` property in `wp.blockEditor.__experimentalListView`",{since:"6.3",alternative:"`rootClientId` property"});let m=(0,Xg.useInstanceId)(uee),{clientIdsTree:h,draggedClientIds:p,selectedClientIds:g}=ZJ({blocks:t,rootClientId:a}),b=YJ(h),{getBlock:v,getSelectedBlockClientIds:k}=(0,LS.useSelect)(_),{visibleBlockCount:y}=(0,LS.useSelect)(X=>{let{getGlobalBlockCount:ne,getClientIdsOfDescendants:le}=X(_),ve=p?.length>0?le(p).length+1:0;return{visibleBlockCount:ne()-ve}},[p]),{updateBlockSelection:S}=$J(),[x,C]=(0,vo.useReducer)(MBe,{}),[B,I]=(0,vo.useState)(null),{setSelectedTreeId:P}=iee({firstSelectedBlockClientId:g[0],setExpandedState:C}),E=(0,vo.useCallback)((X,ne,le)=>{S(X,ne,null,le),P(ne),u&&u(v(ne))},[P,S,u,v]),{ref:L,target:T}=ree({dropZoneElement:o,expandedState:x,setExpandedState:C}),O=(0,vo.useRef)(),D=aee({selectBlock:E}),U=(0,vo.useCallback)(X=>{let[ne]=k();ne&&X&&$g(ne,X)},[k]),G=(0,Xg.useMergeRefs)([D,U,O,L,f]),j=(0,vo.useCallback)(X=>{if(!X)return;let ne=Array.isArray(X)?X:[X];C({type:"expand",clientIds:ne})},[C]),z=(0,vo.useCallback)(X=>{X&&C({type:"collapse",clientIds:[X]})},[C]),W=(0,vo.useCallback)(()=>{C({type:"clear"})},[C]),ee=(0,vo.useCallback)(X=>{j(X?.dataset?.block)},[j]),se=(0,vo.useCallback)(X=>{z(X?.dataset?.block)},[z]),ce=(0,vo.useCallback)((X,ne,le)=>{X.shiftKey&&S(X,ne?.dataset?.block,le?.dataset?.block)},[S]);JJ({collapseAll:W,expand:j});let ie=p?.[0],{blockDropTargetIndex:re,blockDropPosition:Q,firstDraggedBlockIndex:Y}=(0,vo.useMemo)(()=>{let X,ne;if(T?.clientId){let le=b[T.clientId];X=le===void 0||T?.dropPosition==="top"?le:le+1}else T===null&&(X=null);if(ie){let le=b[ie];ne=le===void 0||T?.dropPosition==="top"?le:le+1}return{blockDropTargetIndex:X,blockDropPosition:T?.dropPosition,firstDraggedBlockIndex:ne}},[T,b,ie]),J=(0,vo.useMemo)(()=>({blockDropPosition:Q,blockDropTargetIndex:re,blockIndexes:b,draggedClientIds:p,expandedState:x,expand:j,firstDraggedBlockIndex:Y,collapse:z,collapseAll:W,BlockSettingsMenu:s,listViewInstanceId:m,AdditionalBlockContent:d,insertedBlock:B,setInsertedBlock:I,treeGridElementRef:O,rootClientId:a}),[Q,re,b,p,x,j,Y,z,W,s,m,d,B,I,a]),[K]=(0,Xg.__experimentalUseFixedWindowList)(O,lee,y,{expandedState:x,useWindowing:!0,windowOverscan:40});if(!h.length&&!i)return null;let H=c&&`block-editor-list-view-description-${m}`;return(0,lc.jsxs)(LS.AsyncModeProvider,{value:!0,children:[(0,lc.jsx)(UJ,{draggedBlockClientId:ie,listViewRef:O,blockDropTarget:T}),c&&(0,lc.jsx)(FT.VisuallyHidden,{id:H,children:c}),(0,lc.jsx)(FT.__experimentalTreeGrid,{id:e,className:V("block-editor-list-view-tree",{"is-dragging":p?.length>0&&re!==void 0}),"aria-label":(0,l3.__)("Block navigation structure"),ref:G,onCollapseRow:se,onExpandRow:ee,onFocusRow:ce,applicationAriaLabel:(0,l3.__)("Block navigation structure"),"aria-describedby":H,style:{"--wp-admin--list-view-dragged-items-height":p?.length?`${lee*(p.length-1)}px`:null},children:(0,lc.jsx)(BT.Provider,{value:J,children:(0,lc.jsx)(jJ,{blocks:h,parentId:a,selectBlock:E,showBlockMovers:r,fixedListWindow:K,selectedClientIds:g,isExpanded:n,showAppender:i})})})]})}var NS=(0,vo.forwardRef)(uee),zT=(0,vo.forwardRef)((e,t)=>(0,lc.jsx)(NS,{ref:t,...e,showAppender:!1,rootClientId:null,onSelect:null,additionalBlockContent:null,blockSettingsMenu:void 0}));var bd=l(w(),1);function DBe({isEnabled:e,onToggle:t,isOpen:o,innerRef:r,...n}){return(0,bd.jsx)(jT.Button,{__next40pxDefaultSize:!0,...n,ref:r,icon:sv,"aria-expanded":o,"aria-haspopup":"true",onClick:e?t:void 0,label:(0,c3.__)("List view"),className:"block-editor-block-navigation","aria-disabled":!e})}function VBe({isDisabled:e,...t},o){(0,dee.default)("wp.blockEditor.BlockNavigationDropdown",{since:"6.1",alternative:"wp.components.Dropdown and wp.blockEditor.ListView"});let n=(0,fee.useSelect)(i=>!!i(_).getBlockCount(),[])&&!e;return(0,bd.jsx)(jT.Dropdown,{contentClassName:"block-editor-block-navigation__popover",popoverProps:{placement:"bottom-start"},renderToggle:({isOpen:i,onToggle:s})=>(0,bd.jsx)(DBe,{...t,innerRef:o,isOpen:i,onToggle:s,isEnabled:n}),renderContent:()=>(0,bd.jsxs)("div",{className:"block-editor-block-navigation__container",children:[(0,bd.jsx)("p",{className:"block-editor-block-navigation__label",children:(0,c3.__)("List view")}),(0,bd.jsx)(zT,{})]})})}var pee=(0,mee.forwardRef)(VBe);var vee=l(R(),1),yee=l(F(),1),UT=l(Z(),1),Da=l(A(),1),u3=l(N(),1);var hee=l(R(),1);var gee=l(w(),1);function bee({genericPreviewBlock:e,style:t,className:o,activeStyle:r}){let n=Tg(o,r,t),i=(0,hee.useMemo)(()=>({name:e.name,title:t.label||t.name,description:t.description,initialAttributes:{...e.attributes,className:n+" block-editor-block-styles__block-preview-container"},example:e}),[e,t,n]);return(0,gee.jsx)(X1,{item:i})}var Gs=l(w(),1),kee=()=>{};function FBe({clientId:e,onSwitch:t=kee,onHoverClassName:o=kee}){let r=(0,yee.useSelect)(y=>y(_).canEditBlock(e),[e]),{onSelect:n,stylesToRender:i,activeStyle:s,genericPreviewBlock:a,className:c}=Ig({clientId:e,onSwitch:t}),[u,d]=(0,vee.useState)(null),f=(0,UT.useViewportMatch)("medium","<"),m=Ro();if(!r||!i||i.length===0)return null;let h=(0,UT.debounce)(d,250),p=y=>{n(y),o(null),d(null),h.cancel()},g=y=>{if(u===y){h.cancel();return}h(y),o(y?.name??null)},b=QE(i),v=()=>s?.name!==b?.name,k=()=>{p(b)};return(0,Gs.jsx)(Da.__experimentalToolsPanel,{label:(0,u3.__)("Styles"),resetAll:k,panelId:e,hasInnerWrapper:!0,dropdownMenuProps:m,children:(0,Gs.jsx)(Da.__experimentalToolsPanelItem,{hasValue:v,label:(0,u3.__)("Variation"),onDeselect:k,isShownByDefault:!0,panelId:e,children:(0,Gs.jsxs)("div",{className:"block-editor-block-styles",children:[(0,Gs.jsx)("div",{className:"block-editor-block-styles__variants",children:i.map(y=>{let S=y.label||y.name;return(0,Gs.jsx)(Da.Button,{__next40pxDefaultSize:!0,className:V("block-editor-block-styles__item",{"is-active":s.name===y.name}),variant:"secondary",label:S,onMouseEnter:()=>g(y),onFocus:()=>g(y),onMouseLeave:()=>g(null),onBlur:()=>g(null),onClick:()=>p(y),"aria-current":s.name===y.name,children:(0,Gs.jsx)(Da.__experimentalTruncate,{numberOfLines:1,className:"block-editor-block-styles__item-text",children:S})},y.name)})}),u&&!f&&(0,Gs.jsx)(Da.Popover,{placement:"left-start",offset:34,focusOnMount:!1,children:(0,Gs.jsx)("div",{className:"block-editor-block-styles__preview-panel",onMouseLeave:()=>g(null),children:(0,Gs.jsx)(bee,{activeStyle:s,className:c,genericPreviewBlock:a,style:u})})})]})})})}var Qg=FBe;var Cee=l(A(),1),Jg=l(N(),1);var _ee=l(A(),1),xee=l(w(),1),See={0:OL,1:jA,2:HA,3:WA,4:KA,5:qA,6:XA};function d3({level:e}){return See[e]?(0,xee.jsx)(_ee.Icon,{icon:See[e]}):null}var HT=l(w(),1),wee=[1,2,3,4,5,6],zBe={className:"block-library-heading-level-dropdown"};function Bee({options:e=wee,value:t,onChange:o}){let r=e.filter(n=>n===0||wee.includes(n)).sort((n,i)=>n-i);return(0,HT.jsx)(Cee.ToolbarDropdownMenu,{popoverProps:zBe,icon:(0,HT.jsx)(d3,{level:t}),label:(0,Jg.__)("Change level"),controls:r.map(n=>{let i=n===t;return{icon:(0,HT.jsx)(d3,{level:n}),title:n===0?(0,Jg.__)("Paragraph"):(0,Jg.sprintf)((0,Jg.__)("Heading %d"),n),isActive:i,onClick(){o(n)},role:"menuitemradio"}})})}var MS=l(N(),1),DS=l(A(),1);var cc=l(w(),1);function jBe({icon:e=yL,label:t=(0,MS.__)("Choose variation"),instructions:o=(0,MS.__)("Select a variation to start with:"),variations:r,onSelect:n,allowSkip:i}){let s=V("block-editor-block-variation-picker",{"has-many-variations":r.length>4});return(0,cc.jsxs)(DS.Placeholder,{icon:e,label:t,instructions:o,className:s,children:[(0,cc.jsx)("ul",{className:"block-editor-block-variation-picker__variations",role:"list","aria-label":(0,MS.__)("Block variations"),children:r.map(a=>(0,cc.jsxs)("li",{children:[(0,cc.jsx)(DS.Button,{__next40pxDefaultSize:!0,variant:"tertiary",icon:a.icon&&a.icon.src?a.icon.src:a.icon,iconSize:48,onClick:()=>n(a),className:"block-editor-block-variation-picker__variation",label:a.description||a.title}),(0,cc.jsx)("span",{className:"block-editor-block-variation-picker__variation-label",children:a.title})]},a.name))}),i&&(0,cc.jsx)("div",{className:"block-editor-block-variation-picker__skip",children:(0,cc.jsx)(DS.Button,{__next40pxDefaultSize:!0,variant:"link",onClick:()=>n(),children:(0,MS.__)("Skip")})})]})}var Eee=jBe;var Ree=l(F(),1),Oee=l($(),1),tb=l(A(),1),f3=l(R(),1),m3=l(Z(),1),Aee=l(N(),1);var uc=l(N(),1),eb=l(A(),1);var kd={carousel:"carousel",grid:"grid"};var si=l(w(),1),UBe=({onBlockPatternSelect:e})=>(0,si.jsx)("div",{className:"block-editor-block-pattern-setup__actions",children:(0,si.jsx)(eb.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:e,children:(0,uc.__)("Choose")})}),HBe=({handlePrevious:e,handleNext:t,activeSlide:o,totalSlides:r})=>(0,si.jsxs)("div",{className:"block-editor-block-pattern-setup__navigation",children:[(0,si.jsx)(eb.Button,{size:"compact",icon:(0,uc.isRTL)()?Vo:Mr,label:(0,uc.__)("Previous pattern"),onClick:e,disabled:o===0,accessibleWhenDisabled:!0}),(0,si.jsx)(eb.Button,{size:"compact",icon:(0,uc.isRTL)()?Mr:Vo,label:(0,uc.__)("Next pattern"),onClick:t,disabled:o===r-1,accessibleWhenDisabled:!0})]}),GBe=({viewMode:e,setViewMode:t,handlePrevious:o,handleNext:r,activeSlide:n,totalSlides:i,onBlockPatternSelect:s})=>{let a=e===kd.carousel,c=(0,si.jsxs)("div",{className:"block-editor-block-pattern-setup__display-controls",children:[(0,si.jsx)(eb.Button,{size:"compact",icon:_v,label:(0,uc.__)("Carousel view"),onClick:()=>t(kd.carousel),isPressed:a}),(0,si.jsx)(eb.Button,{size:"compact",icon:rv,label:(0,uc.__)("Grid view"),onClick:()=>t(kd.grid),isPressed:e===kd.grid})]});return(0,si.jsxs)("div",{className:"block-editor-block-pattern-setup__toolbar",children:[a&&(0,si.jsx)(HBe,{handlePrevious:o,handleNext:r,activeSlide:n,totalSlides:i}),c,a&&(0,si.jsx)(UBe,{onBlockPatternSelect:s})]})},Tee=GBe;var Iee=l(F(),1);function WBe(e,t,o){return(0,Iee.useSelect)(r=>{let{getBlockRootClientId:n,getPatternsByBlockTypes:i,__experimentalGetAllowedPatterns:s}=r(_),a=n(e);return o?s(a).filter(o):i(t,a)},[e,t,o])}var Pee=WBe;var zt=l(w(),1),$Be=({viewMode:e,activeSlide:t,patterns:o,onBlockPatternSelect:r,showTitles:n})=>{let i="block-editor-block-pattern-setup__container";if(e===kd.carousel){let s=new Map([[t,"active-slide"],[t-1,"previous-slide"],[t+1,"next-slide"]]);return(0,zt.jsx)("div",{className:"block-editor-block-pattern-setup__carousel",children:(0,zt.jsx)("div",{className:i,children:(0,zt.jsx)("div",{className:"carousel-container",children:o.map((a,c)=>(0,zt.jsx)(Nee,{active:c===t,className:s.get(c)||"",pattern:a},a.name))})})})}return(0,zt.jsx)("div",{className:"block-editor-block-pattern-setup__grid",children:(0,zt.jsx)(tb.Composite,{role:"listbox",className:i,"aria-label":(0,Aee.__)("Patterns list"),children:o.map(s=>(0,zt.jsx)(Lee,{pattern:s,onSelect:r,showTitles:n},s.name))})})};function Lee({pattern:e,onSelect:t,showTitles:o}){let r="block-editor-block-pattern-setup-list",{blocks:n,description:i,viewportWidth:s=700}=e,a=(0,m3.useInstanceId)(Lee,`${r}__item-description`);return(0,zt.jsx)("div",{className:`${r}__list-item`,children:(0,zt.jsxs)(tb.Composite.Item,{render:(0,zt.jsx)("div",{"aria-describedby":i?a:void 0,"aria-label":e.title,className:`${r}__item`}),id:`${r}__pattern__${e.name}`,role:"option",onClick:()=>t(n),children:[(0,zt.jsx)(vn,{blocks:n,viewportWidth:s}),o&&(0,zt.jsx)("div",{className:`${r}__item-title`,children:e.title}),!!i&&(0,zt.jsx)(tb.VisuallyHidden,{id:a,children:i})]})})}function Nee({active:e,className:t,pattern:o,minHeight:r}){let{blocks:n,title:i,description:s}=o,a=(0,m3.useInstanceId)(Nee,"block-editor-block-pattern-setup-list__item-description");return(0,zt.jsxs)("div",{"aria-hidden":!e,role:"img",className:`pattern-slide ${t}`,"aria-label":i,"aria-describedby":s?a:void 0,children:[(0,zt.jsx)(vn,{blocks:n,minHeight:r}),!!s&&(0,zt.jsx)(tb.VisuallyHidden,{id:a,children:s})]})}var KBe=({clientId:e,blockName:t,filterPatternsFn:o,onBlockPatternSelect:r,initialViewMode:n=kd.carousel,showTitles:i=!1})=>{let[s,a]=(0,f3.useState)(n),[c,u]=(0,f3.useState)(0),{replaceBlock:d}=(0,Ree.useDispatch)(_),f=Pee(e,t,o);if(!f?.length)return null;let h=r||(p=>{let g=p.map(b=>(0,Oee.cloneBlock)(b));d(e,g)});return(0,zt.jsx)(zt.Fragment,{children:(0,zt.jsxs)("div",{className:`block-editor-block-pattern-setup view-mode-${s}`,children:[(0,zt.jsx)($Be,{viewMode:s,activeSlide:c,patterns:f,onBlockPatternSelect:h,showTitles:i}),(0,zt.jsx)(Tee,{viewMode:s,setViewMode:a,activeSlide:c,totalSlides:f.length,handleNext:()=>{u(p=>Math.min(p+1,f.length-1))},handlePrevious:()=>{u(p=>Math.max(p-1,0))},onBlockPatternSelect:()=>{h(f[c].blocks)}})]})})},Mee=KBe;var p3=l($(),1),dc=l(N(),1),Ws=l(A(),1),GT=l(F(),1),Dee=l(R(),1);var Ao=l(w(),1),{Menu:Vm}=M(Ws.privateApis);function YBe({className:e,onSelectVariation:t,selectedValue:o,variations:r}){return(0,Ao.jsxs)("fieldset",{className:e,children:[(0,Ao.jsx)(Ws.VisuallyHidden,{as:"legend",children:(0,dc.__)("Transform to variation")}),r.map(n=>(0,Ao.jsx)(Ws.Button,{__next40pxDefaultSize:!0,size:"compact",icon:(0,Ao.jsx)(Ae,{icon:n.icon,showColors:!0}),isPressed:o===n.name,label:o===n.name?n.title:(0,dc.sprintf)((0,dc.__)("Transform to %s"),n.title),onClick:()=>t(n.name),"aria-label":n.title,showTooltip:!0},n.name))]})}function qBe({className:e,onSelectVariation:t,selectedValue:o,variations:r}){return(0,Ao.jsx)("div",{className:e,children:(0,Ao.jsxs)(Vm,{children:[(0,Ao.jsx)(Vm.TriggerButton,{render:(0,Ao.jsx)(Ws.Button,{className:"block-editor-block-variation-transforms__button",__next40pxDefaultSize:!0,variant:"secondary",children:(0,dc.__)("Transform to variation")})}),(0,Ao.jsx)(Vm.Popover,{position:"bottom",children:(0,Ao.jsx)(Vm.Group,{children:r.map(n=>(0,Ao.jsxs)(Vm.RadioItem,{value:n.name,checked:o===n.name,onChange:()=>t(n.name),children:[(0,Ao.jsx)(Vm.ItemLabel,{children:n.title}),n.description&&(0,Ao.jsx)(Vm.ItemHelpText,{children:n.description})]},n.name))})})]})})}function ZBe({className:e,onSelectVariation:t,selectedValue:o,variations:r}){return(0,Ao.jsx)("div",{className:e,children:(0,Ao.jsx)(Ws.__experimentalToggleGroupControl,{label:(0,dc.__)("Transform to variation"),value:o,hideLabelFromVision:!0,onChange:t,__next40pxDefaultSize:!0,children:r.map(n=>(0,Ao.jsx)(Ws.__experimentalToggleGroupControlOptionIcon,{icon:(0,Ao.jsx)(Ae,{icon:n.icon,showColors:!0}),value:n.name,label:o===n.name?n.title:(0,dc.sprintf)((0,dc.__)("Transform to %s"),n.title)},n.name))})})}function XBe({blockClientId:e}){let{updateBlockAttributes:t}=(0,GT.useDispatch)(_),{activeBlockVariation:o,variations:r,canEdit:n,isContentOnly:i,isSection:s}=(0,GT.useSelect)(p=>{let{getActiveBlockVariation:g,getBlockVariations:b}=p(p3.store),{getBlockName:v,getBlockAttributes:k,getBlockEditingMode:y,isSectionBlock:S}=M(p(_)),{canEditBlock:x}=p(_),C=e&&v(e),{hasContentRoleAttribute:B}=M(p(p3.store)),I=B(C);return{activeBlockVariation:g(C,k(e),"transform"),variations:C&&b(C,"transform"),canEdit:x(e),isContentOnly:y(e)==="contentOnly"&&!I,isSection:S(e)}},[e]),a=o?.name,c=(0,Dee.useMemo)(()=>{let p=new Set;return r?(r.forEach(g=>{g.icon&&p.add(g.icon?.src||g.icon)}),p.size===r.length):!1},[r]),u=p=>{t(e,{...r.find(({name:g})=>g===p).attributes})};if(!r?.length||!n||i||s)return null;let d="block-editor-block-variation-transforms",m=r.length>6?YBe:ZBe;return(0,Ao.jsx)(c?m:qBe,{className:d,onSelectVariation:u,selectedValue:a,variations:r})}var WT=XBe;var Fm=l(N(),1),$T=l(A(),1);var Vee=l(w(),1),h3={top:{icon:bL,title:(0,Fm._x)("Align top","Block vertical alignment setting")},center:{icon:sL,title:(0,Fm._x)("Align middle","Block vertical alignment setting")},bottom:{icon:nL,title:(0,Fm._x)("Align bottom","Block vertical alignment setting")},stretch:{icon:pL,title:(0,Fm._x)("Stretch to fill","Block vertical alignment setting")},"space-between":{icon:dL,title:(0,Fm._x)("Space between","Block vertical alignment setting")}},QBe=["top","center","bottom"],JBe="top";function eEe({value:e,onChange:t,controls:o=QBe,isCollapsed:r=!0,isToolbar:n}){function i(d){return()=>t(e===d?void 0:d)}let s=h3[e],a=h3[JBe],c=n?$T.ToolbarGroup:$T.ToolbarDropdownMenu,u=n?{isCollapsed:r}:{};return(0,Vee.jsx)(c,{icon:s?s.icon:a.icon,label:(0,Fm._x)("Change vertical alignment","Block vertical alignment setting label"),controls:o.map(d=>({...h3[d],isActive:e===d,role:r?"menuitemradio":void 0,onClick:i(d)})),...u})}var g3=eEe;var b3=l(w(),1),iC=e=>(0,b3.jsx)(g3,{...e,isToolbar:!1}),Fee=e=>(0,b3.jsx)(g3,{...e,isToolbar:!0});var Bn=l(A(),1),VS=l(R(),1),qT=l(N(),1);var zee=l(A(),1);var k3=l(N(),1),jee=l(w(),1);function Uee({isLinked:e,...t}){let o=e?(0,k3.__)("Unlink radii"):(0,k3.__)("Link radii");return(0,jee.jsx)(zee.Button,{...t,className:"components-border-radius-control__linked-button",size:"small",icon:e?fn:Ci,iconSize:24,label:o})}var Hee=l(A(),1);function tEe(e){return[...e].sort((o,r)=>e.filter(n=>n===r).length-e.filter(n=>n===o).length).shift()}function Gee(e={}){if(typeof e=="string")return e;let t=Object.values(e).map(a=>{let c=(0,Hee.__experimentalParseQuantityAndUnitFromRawValue)(a);return typeof a=="string"&&c[0]===void 0?[a,""]:c}),o=t.map(a=>a[0]??""),r=t.map(a=>a[1]),n=o.every(a=>a===o[0])?o[0]:"",i=tEe(r);return n===0||n?`${n}${i||""}`:void 0}function Wee(e={}){if(typeof e=="string"||!e||typeof e!="object")return!1;let t=Object.values(e);if(t.length===0)return!1;let o=t[0];return!t.every(n=>n===o)}function $ee(e){return e?typeof e=="string"?!0:!!Object.values(e).filter(o=>!!o||o===0).length:!1}var Qi=l(A(),1),Qee=l(Z(),1),yd=l(N(),1);var zm=l(R(),1);var v3=24,Kee=8,KT={px:{max:300,steps:1},"%":{max:100,steps:1},vw:{max:100,steps:1},vh:{max:100,steps:1},em:{max:10,steps:.1},rem:{max:10,steps:.1},svw:{max:100,steps:1},lvw:{max:100,steps:1},dvw:{max:100,steps:1},svh:{max:100,steps:1},lvh:{max:100,steps:1},dvh:{max:100,steps:1},vi:{max:100,steps:1},svi:{max:100,steps:1},lvi:{max:100,steps:1},dvi:{max:100,steps:1},vb:{max:100,steps:1},svb:{max:100,steps:1},lvb:{max:100,steps:1},dvb:{max:100,steps:1},vmin:{max:100,steps:1},svmin:{max:100,steps:1},lvmin:{max:100,steps:1},dvmin:{max:100,steps:1},vmax:{max:100,steps:1},svmax:{max:100,steps:1},lvmax:{max:100,steps:1},dvmax:{max:100,steps:1}};var vd=(e,t)=>e?.includes?e==="0"||e.includes(`var:preset|${t}|`):!1;function Yee(e,t){if(!e)return;if(e==="0"||e==="default")return e;let o=e.match(new RegExp(`var:preset\\|${t}\\|(.+)`));return o?o[1]:void 0}function qee(e,t,o){if(e===void 0)return 0;let r=parseFloat(e,10)===0?"0":Yee(e,o),n=t.findIndex(i=>String(i.slug)===r);return n!==-1?n:NaN}function y3(e,t,o){if(!vd(e,o))return e;let r=parseFloat(e,10)===0?"0":Yee(e,o);return t.find(i=>String(i.slug)===r)?.size}function Zee(e,t,o){if(!e||vd(e,o)||e==="0")return e;let r=t.find(n=>String(n.size)===String(e));return r?.slug?`var:preset|${o}|${r.slug}`:e}var ob=l(A(),1),fc=l(w(),1);function Xee({allowNegativeOnDrag:e,ariaLabel:t,allPlaceholder:o,minValue:r,parsedQuantity:n,computedUnit:i,units:s,isMixed:a,step:c,max:u,showTooltip:d,value:f,minimumCustomValue:m,onCustomValueChange:h,onCustomValueSliderChange:p,onUnitChange:g,onMouseOut:b,onMouseOver:v,setMinValue:k}){let y=(0,fc.jsx)(ob.__experimentalUnitControl,{className:"preset-input-control__unit-control",disableUnits:a,hideLabelFromVision:!0,label:t,min:r,onChange:h,onUnitChange:g,onBlur:b,onFocus:v,onMouseOut:b,onMouseOver:v,size:"__unstable-large",units:s,value:[n,i].join(""),placeholder:o,onDragStart:()=>{e&&f?.charAt(0)==="-"&&k(0)},onDrag:()=>{e&&f?.charAt(0)==="-"&&k(0)},onDragEnd:()=>{e&&k(m)}});return(0,fc.jsxs)(fc.Fragment,{children:[d?(0,fc.jsx)(ob.Tooltip,{text:t,placement:"top",children:(0,fc.jsx)("div",{className:"preset-input-control__tooltip-wrapper",children:y})}):y,(0,fc.jsx)(ob.RangeControl,{className:"preset-input-control__custom-value-range",hideLabelFromVision:!0,initialPosition:0,label:t,max:u,min:0,onBlur:b,onChange:p,onFocus:v,onMouseOut:b,onMouseOver:v,step:c,value:n,withInputField:!1,__next40pxDefaultSize:!0})]})}var Sd=l(w(),1);function jm({allowNegativeOnDrag:e=!1,ariaLabel:t,className:o,customValueSettings:r=KT,disableCustomValues:n,icon:i,isMixed:s,value:a,minimumCustomValue:c,onChange:u,onMouseOut:d,onMouseOver:f,onUnitChange:m,presets:h=[],presetType:p,selectedUnit:g,showTooltip:b,units:v}){let k=(0,zm.useMemo)(()=>Zee(a,h,p),[a,h,p]),y=o??"preset-input-control",S=h.slice(1,h.length-1).map((K,H)=>({value:H+1,label:void 0})),x=S.length>0,C=h.length<=Kee,B=s?(0,yd.__)("Mixed"):null,[I,P]=(0,zm.useState)(c),[E,L]=(0,zm.useState)(!n&&k!==void 0&&!vd(k,p)),T=null,O=(0,Qee.usePrevious)(k);(0,zm.useEffect)(()=>{k&&O!==k&&!vd(k,p)&&E!==!0&&L(!0)},[k,O,p,E]);let D=!C&&!E&&k!==void 0&&(!vd(k,p)||vd(k,p)&&s),U=h;D?(U=[...h,{name:s?(0,yd.__)("Mixed"):(0,yd.sprintf)((0,yd.__)("Custom (%s)"),k),slug:"custom",size:k}],T=U.length-1):s||(T=E?y3(k,h,p):qee(k,h,p));let G=U.map((K,H)=>({key:H,name:K.name})),j=vd(k,p)?y3(k,h,p):k,[z,W]=(0,Qi.__experimentalParseQuantityAndUnitFromRawValue)(j),ee=W||g||"px",se=v?.find(K=>K.value===ee),ce=se?.step??r[ee]?.steps??.1,ie=se?.max??r[ee]?.max??10,re=K=>{let X=!isNaN(parseFloat(K))?K:void 0;X!==void 0&&u(X)},Q=K=>{u([K,ee].join(""))},Y=K=>k===void 0?void 0:h[K]?.name,J=(K,H)=>{let X=parseInt(K,10);if(H==="selectList"){if(X===0&&h[0]?.slug==="0")return"0";if(X===0)return}else if(X===0)return"0";return`var:preset|${p}|${h[K]?.slug}`};return(0,Sd.jsxs)(Qi.__experimentalHStack,{className:`preset-input-control__wrapper ${y}__wrapper`,children:[i&&(0,Sd.jsx)(Qi.Icon,{className:"preset-input-control__icon",icon:i,size:v3}),(!x||E)&&(0,Sd.jsx)(Xee,{allowNegativeOnDrag:e,ariaLabel:t,allPlaceholder:B,minValue:I,parsedQuantity:z,computedUnit:ee,units:v,isMixed:s,step:ce,max:ie,showTooltip:b,value:k,minimumCustomValue:c,onCustomValueChange:re,onCustomValueSliderChange:Q,onUnitChange:m,onMouseOut:d,onMouseOver:f,setMinValue:P}),x&&C&&!E&&(0,Sd.jsx)(Qi.RangeControl,{"aria-valuenow":T,"aria-valuetext":h[T]?.name,className:"preset-input-control__preset-range",hideLabelFromVision:!0,initialPosition:0,label:t,max:h.length-1,marks:S,min:0,onBlur:d,onChange:K=>u(J(K)),onFocus:f,onMouseDown:K=>{K?.nativeEvent?.offsetX<35&&k===void 0&&u("0")},onMouseOut:d,onMouseOver:f,renderTooltipContent:Y,step:1,value:T,withInputField:!1,__next40pxDefaultSize:!0}),x&&!C&&!E&&(0,Sd.jsx)(Qi.CustomSelectControl,{className:"preset-input-control__custom-select-control",hideLabelFromVision:!0,label:t,onBlur:d,onChange:K=>{D&&K.selectedItem.key===G.length-1?L(!0):u(J(K.selectedItem.key,"selectList"))},onFocus:f,onMouseOut:d,onMouseOver:f,options:G,size:"__unstable-large",value:G.find(K=>K.key===T)||""}),x&&!n&&(0,Sd.jsx)(Qi.Button,{className:"preset-input-control__custom-toggle",icon:rN,iconSize:v3,isPressed:E,label:E?(0,yd.__)("Use preset"):(0,yd.__)("Set custom value"),onClick:()=>{L(!E)},size:"small"})]})}var rb=l(N(),1);var Jee=8,YT=[],S3={all:(0,rb.__)("Border radius"),topLeft:(0,rb.__)("Top left"),topRight:(0,rb.__)("Top right"),bottomLeft:(0,rb.__)("Bottom left"),bottomRight:(0,rb.__)("Bottom right")},_3={all:aA,topLeft:uA,topRight:dA,bottomLeft:lA,bottomRight:cA},x3=0;var mc=l(w(),1);function oEe(e){let t=e?.default??YT,o=e?.custom??YT,r=e?.theme??YT;return(0,VS.useMemo)(()=>{let n=[{name:(0,qT.__)("None"),slug:"0",size:0},...o,...r,...t];return n.length>Jee?[{name:(0,qT.__)("Default"),slug:"default",size:void 0},...n]:n},[o,r,t])}function ete(e,t){return t==="all"?Gee(e):typeof e=="string"?e:e?.[t]}function tte(e,t){return t==="all"?e.flat:e[t]}function ote(e,t,o){return r=>{o(e==="all"?{topLeft:r,topRight:r,bottomLeft:r,bottomRight:r}:{...typeof t!="string"?t||{}:{topLeft:t,topRight:t,bottomLeft:t,bottomRight:t},[e]:r})}}function rte(e,t,o){return r=>{let n={...t};e==="all"?(n.flat=r,n.topLeft=r,n.topRight=r,n.bottomLeft=r,n.bottomRight=r):n[e]=r,o(n)}}function ZT({onChange:e,values:t,presets:o}){let[r,n]=(0,VS.useState)(!$ee(t)||!Wee(t)),i=oEe(o),[s,a]=(0,VS.useState)({flat:typeof t=="string"?(0,Bn.__experimentalParseQuantityAndUnitFromRawValue)(t)[1]:void 0,topLeft:(0,Bn.__experimentalParseQuantityAndUnitFromRawValue)(t?.topLeft)[1],topRight:(0,Bn.__experimentalParseQuantityAndUnitFromRawValue)(t?.topRight)[1],bottomLeft:(0,Bn.__experimentalParseQuantityAndUnitFromRawValue)(t?.bottomLeft)[1],bottomRight:(0,Bn.__experimentalParseQuantityAndUnitFromRawValue)(t?.bottomRight)[1]}),[c]=me("spacing.units"),u=(0,Bn.__experimentalUseCustomUnits)({availableUnits:c||["px","em","rem"]}),d=()=>n(!r);return(0,mc.jsxs)("fieldset",{className:"components-border-radius-control",children:[(0,mc.jsxs)(Bn.__experimentalHStack,{className:"components-border-radius-control__header",children:[(0,mc.jsx)(Bn.BaseControl.VisualLabel,{as:"legend",children:(0,qT.__)("Radius")}),(0,mc.jsx)(Uee,{onClick:d,isLinked:r})]}),r?(0,mc.jsx)(jm,{ariaLabel:S3.all,className:"components-border-radius-control",icon:_3.all,minimumCustomValue:x3,onChange:ote("all",t,e),onUnitChange:rte("all",s,a),presets:i,presetType:"border-radius",selectedUnit:tte(s,"all"),showTooltip:!0,units:u,value:ete(t,"all")}):(0,mc.jsx)(Bn.__experimentalVStack,{children:["topLeft","topRight","bottomLeft","bottomRight"].map(f=>(0,mc.jsx)(jm,{ariaLabel:S3[f],className:"components-border-radius-control",icon:_3[f],minimumCustomValue:x3,onChange:ote(f,t,e),onUnitChange:rte(f,s,a),presets:i,presetType:"border-radius",selectedUnit:tte(s,f),showTooltip:!0,units:u,value:ete(t,f)},f))})]})}var ste=l(A(),1);var nte=l(Z(),1);var ite=l(w(),1),XT=(0,nte.createHigherOrderComponent)(e=>function(o){let[r,n,i,s,a]=me("color.palette.default","color.palette.theme","color.palette.custom","color.custom","color.defaultPalette"),c=a?[...n||[],...r||[],...i||[]]:[...n||[],...i||[]],{colors:u=c,disableCustomColors:d=!s}=o,f=u&&u.length>0||!d;return(0,ite.jsx)(e,{...o,colors:u,disableCustomColors:d,hasColorsToChoose:f})},"withColorContext");var ate=XT(ste.ColorPalette);var w3=l(N(),1),$s=l(A(),1);var yo=l(w(),1),{Tabs:nb}=M($s.privateApis),rEe=["colors","disableCustomColors","gradients","disableCustomGradients"],Va={color:"color",gradient:"gradient"};function lte({colors:e,gradients:t,disableCustomColors:o,disableCustomGradients:r,__experimentalIsRenderedInSidebar:n,className:i,label:s,onColorChange:a,onGradientChange:c,colorValue:u,gradientValue:d,clearable:f,showTitle:m=!0,enableAlpha:h,headingLevel:p}){let g=a&&(e&&e.length>0||!o),b=c&&(t&&t.length>0||!r);if(!g&&!b)return null;let v={[Va.color]:(0,yo.jsx)($s.ColorPalette,{value:u,onChange:b?y=>{a(y),c()}:a,colors:e,disableCustomColors:o,__experimentalIsRenderedInSidebar:n,clearable:f,enableAlpha:h,headingLevel:p}),[Va.gradient]:(0,yo.jsx)($s.GradientPicker,{value:d,onChange:g?y=>{c(y),a()}:c,gradients:t,disableCustomGradients:r,__experimentalIsRenderedInSidebar:n,clearable:f,headingLevel:p})},k=y=>(0,yo.jsx)("div",{className:"block-editor-color-gradient-control__panel",children:v[y]});return(0,yo.jsx)($s.BaseControl,{className:V("block-editor-color-gradient-control",i),children:(0,yo.jsx)("fieldset",{className:"block-editor-color-gradient-control__fieldset",children:(0,yo.jsxs)($s.__experimentalVStack,{spacing:1,children:[m&&(0,yo.jsx)("legend",{children:(0,yo.jsx)("div",{className:"block-editor-color-gradient-control__color-indicator",children:(0,yo.jsx)($s.BaseControl.VisualLabel,{children:s})})}),g&&b&&(0,yo.jsx)("div",{children:(0,yo.jsxs)(nb,{defaultTabId:d?Va.gradient:!!g&&Va.color,children:[(0,yo.jsxs)(nb.TabList,{children:[(0,yo.jsx)(nb.Tab,{tabId:Va.color,children:(0,w3.__)("Color")}),(0,yo.jsx)(nb.Tab,{tabId:Va.gradient,children:(0,w3.__)("Gradient")})]}),(0,yo.jsx)(nb.TabPanel,{tabId:Va.color,className:"block-editor-color-gradient-control__panel",focusable:!1,children:v.color}),(0,yo.jsx)(nb.TabPanel,{tabId:Va.gradient,className:"block-editor-color-gradient-control__panel",focusable:!1,children:v.gradient})]})}),!b&&k(Va.color),!g&&k(Va.gradient)]})})})}function nEe(e){let[t,o,r,n]=me("color.palette","color.gradients","color.custom","color.customGradient");return(0,yo.jsx)(lte,{colors:t,gradients:o,disableCustomColors:!r,disableCustomGradients:!n,...e})}function iEe(e){return rEe.every(t=>e.hasOwnProperty(t))?(0,yo.jsx)(lte,{...e}):(0,yo.jsx)(nEe,{...e})}var _d=iEe;var cte=l(w(),1);function ute({onChange:e,value:t,...o}){return(0,cte.jsx)(_d,{...o,onColorChange:e,colorValue:t,gradients:[],disableCustomGradients:!0})}var Ks=l(N(),1),dte=l(A(),1),fte=l(Xo(),1),C3=l(w(),1);Kc([Yc,Op]);function sEe({backgroundColor:e,fallbackBackgroundColor:t,fallbackTextColor:o,fallbackLinkColor:r,fontSize:n,isLargeText:i,textColor:s,linkColor:a,enableAlphaChecker:c=!1}){let u=e||t;if(!u)return null;let d=s||o,f=a||r;if(!d&&!f)return null;let m=[{color:d,description:(0,Ks.__)("text color")},{color:f,description:(0,Ks.__)("link color")}],h=Bt(u),p=h.alpha()<1,g=h.brightness(),b={level:"AA",size:i||i!==!1&&n>=24?"large":"small"},v="",k="";for(let y of m){if(!y.color)continue;let S=Bt(y.color),x=S.isReadable(h,b),C=S.alpha()<1;if(!x){if(p||C)continue;v=g<S.brightness()?(0,Ks.sprintf)((0,Ks.__)("This color combination may be hard for people to read. Try using a darker background color and/or a brighter %s."),y.description):(0,Ks.sprintf)((0,Ks.__)("This color combination may be hard for people to read. Try using a brighter background color and/or a darker %s."),y.description),k=(0,Ks.__)("This color combination may be hard for people to read.");break}C&&c&&(v=(0,Ks.__)("Transparent text may be hard for people to read."),k=(0,Ks.__)("Transparent text may be hard for people to read."))}return v?((0,fte.speak)(k),(0,C3.jsx)("div",{className:"block-editor-contrast-checker",children:(0,C3.jsx)(dte.Notice,{spokenMessage:null,status:"warning",isDismissible:!1,children:v})})):null}var QT=sEe;var br=l(N(),1),FS=l(pc(),1),JT=l(R(),1),ai=l(A(),1),Fa=l(w(),1),xd=new Date;xd.setDate(20);xd.setMonth(xd.getMonth()-3);xd.getMonth()===4&&xd.setMonth(3);function pte({format:e,defaultFormat:t,onChange:o}){return(0,Fa.jsxs)(ai.__experimentalVStack,{as:"fieldset",spacing:4,className:"block-editor-date-format-picker",children:[(0,Fa.jsx)(ai.VisuallyHidden,{as:"legend",children:(0,br.__)("Date format")}),(0,Fa.jsx)(ai.ToggleControl,{label:(0,br.__)("Default format"),help:`${(0,br.__)("Example:")} ${(0,FS.dateI18n)(t,xd)}`,checked:!e,onChange:r=>o(r?null:t)}),e&&(0,Fa.jsx)(aEe,{format:e,onChange:o})]})}function aEe({format:e,onChange:t}){let r=[...[...new Set(["Y-m-d",(0,br._x)("n/j/Y","short date format"),(0,br._x)("n/j/Y g:i A","short date format with time"),(0,br._x)("M j, Y","medium date format"),(0,br._x)("M j, Y g:i A","medium date format with time"),(0,br._x)("F j, Y","long date format"),(0,br._x)("M j","short date format without the year")])].map((a,c)=>({key:`suggested-${c}`,name:(0,FS.dateI18n)(a,xd),format:a})),{key:"human-diff",name:(0,FS.humanTimeDiff)(xd),format:"human-diff"}],n={key:"custom",name:(0,br.__)("Custom"),className:"block-editor-date-format-picker__custom-format-select-control__custom-option",hint:(0,br.__)("Enter your own date format")},[i,s]=(0,JT.useState)(()=>!!e&&!r.some(a=>a.format===e));return(0,Fa.jsxs)(ai.__experimentalVStack,{children:[(0,Fa.jsx)(ai.CustomSelectControl,{__next40pxDefaultSize:!0,label:(0,br.__)("Choose a format"),options:[...r,n],value:i?n:r.find(a=>a.format===e)??n,onChange:({selectedItem:a})=>{a===n?s(!0):(s(!1),t(a.format))}}),i&&(0,Fa.jsx)(ai.TextControl,{__next40pxDefaultSize:!0,label:(0,br.__)("Custom format"),hideLabelFromVision:!0,help:(0,JT.createInterpolateElement)((0,br.__)("Enter a date or time <Link>format string</Link>."),{Link:(0,Fa.jsx)(ai.ExternalLink,{href:(0,br.__)("https://wordpress.org/documentation/article/customize-date-and-time-format/")})}),value:e,onChange:a=>t(a)})]})}var Ji=l(A(),1),zS=l(N(),1),hte=l(it(),1);var gte=l(Z(),1),za=l(w(),1);function bte({id:e,colorPalette:t,duotonePalette:o,disableCustomColors:r,disableCustomDuotone:n,value:i,onChange:s}){let a;i==="unset"?a=(0,za.jsx)(Ji.ColorIndicator,{className:"block-editor-duotone-control__unset-indicator"}):i?a=(0,za.jsx)(Ji.DuotoneSwatch,{values:i}):a=(0,za.jsx)(we,{icon:xA});let c=(0,zS.__)("Apply duotone filter"),d=`${(0,gte.useInstanceId)(bte,"duotone-control",e)}__description`;return(0,za.jsx)(Ji.Dropdown,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,zS.__)("Duotone")},renderToggle:({isOpen:f,onToggle:m})=>(0,za.jsx)(Ji.ToolbarButton,{showTooltip:!0,onClick:m,"aria-haspopup":"true","aria-expanded":f,onKeyDown:p=>{!f&&p.keyCode===hte.DOWN&&(p.preventDefault(),m())},label:c,icon:a}),renderContent:()=>(0,za.jsxs)(Ji.MenuGroup,{label:(0,zS.__)("Duotone"),children:[(0,za.jsx)("p",{children:(0,zS.__)("Create a two-tone color effect without losing your original image.")}),(0,za.jsx)(Ji.DuotonePicker,{"aria-label":c,"aria-describedby":d,colorPalette:t,duotonePalette:o,disableCustomColors:r,disableCustomDuotone:n,value:i,onChange:s})]})})}var eI=bte;var Ste=l(A(),1),_te=l(Re(),1),xte=l(R(),1),li=l(N(),1);var tr=l(N(),1);var tI=l(N(),1);function kte(e){if(!e)return{};if(typeof e=="object")return e;let t;switch(e){case"normal":t=(0,tI._x)("Regular","font style");break;case"italic":t=(0,tI._x)("Italic","font style");break;case"oblique":t=(0,tI._x)("Oblique","font style");break;default:t=e;break}return{name:t,value:e}}var Ys=l(N(),1);function B3(e){if(!e)return{};if(typeof e=="object")return e;let t;switch(e){case"normal":case"400":t=(0,Ys._x)("Regular","font weight");break;case"bold":case"700":t=(0,Ys._x)("Bold","font weight");break;case"100":t=(0,Ys._x)("Thin","font weight");break;case"200":t=(0,Ys._x)("Extra Light","font weight");break;case"300":t=(0,Ys._x)("Light","font weight");break;case"500":t=(0,Ys._x)("Medium","font weight");break;case"600":t=(0,Ys._x)("Semi Bold","font weight");break;case"800":t=(0,Ys._x)("Extra Bold","font weight");break;case"900":t=(0,Ys._x)("Black","font weight");break;case"1000":t=(0,Ys._x)("Extra Black","font weight");break;default:t=e;break}return{name:t,value:e}}var vte=[{name:(0,tr._x)("Regular","font style"),value:"normal"},{name:(0,tr._x)("Italic","font style"),value:"italic"}],yte=[{name:(0,tr._x)("Thin","font weight"),value:"100"},{name:(0,tr._x)("Extra Light","font weight"),value:"200"},{name:(0,tr._x)("Light","font weight"),value:"300"},{name:(0,tr._x)("Regular","font weight"),value:"400"},{name:(0,tr._x)("Medium","font weight"),value:"500"},{name:(0,tr._x)("Semi Bold","font weight"),value:"600"},{name:(0,tr._x)("Bold","font weight"),value:"700"},{name:(0,tr._x)("Extra Bold","font weight"),value:"800"},{name:(0,tr._x)("Black","font weight"),value:"900"},{name:(0,tr._x)("Extra Black","font weight"),value:"1000"}];function ib(e){let t=[],o=[],r=[],n=!e||e?.length===0,i=!1;return e?.forEach(s=>{if(typeof s.fontWeight=="string"&&/\s/.test(s.fontWeight.trim())){i=!0;let[u,d]=s.fontWeight.split(" ");u=parseInt(u.slice(0,1)),d==="1000"?d=10:d=parseInt(d.slice(0,1));for(let f=u;f<=d;f++){let m=`${f.toString()}00`;o.some(h=>h.value===m)||o.push(B3(m))}}let a=B3(typeof s.fontWeight=="number"?s.fontWeight.toString():s.fontWeight),c=kte(s.fontStyle);c&&Object.keys(c).length&&(t.some(u=>u.value===c.value)||t.push(c)),a&&Object.keys(a).length&&(o.some(u=>u.value===a.value)||i||o.push(a))}),o.some(s=>s.value>="600")||o.push({name:(0,tr._x)("Bold","font weight"),value:"700"}),t.some(s=>s.value==="italic")||t.push({name:(0,tr._x)("Italic","font style"),value:"italic"}),n&&(t=vte,o=yte),t=t.length===0?vte:t,o=o.length===0?yte:o,t.forEach(({name:s,value:a})=>{o.forEach(({name:c,value:u})=>{let d=a==="normal"?c:(0,tr.sprintf)((0,tr._x)("%1$s %2$s","font"),c,s);r.push({key:`${a}-${u}`,name:d,style:{fontStyle:a,fontWeight:u}})})}),{fontStyles:t,fontWeights:o,combinedStyleAndWeightOptions:r,isSystemFont:n,isVariableFont:i}}var wte=l(w(),1),lEe=(e,t)=>e?t?(0,li.__)("Appearance"):(0,li.__)("Font style"):(0,li.__)("Font weight");function oI(e){let{__next40pxDefaultSize:t=!1,onChange:o,hasFontStyles:r=!0,hasFontWeights:n=!0,fontFamilyFaces:i,value:{fontStyle:s,fontWeight:a},...c}=e,u=r||n,d=lEe(r,n),f={key:"default",name:(0,li.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},{fontStyles:m,fontWeights:h,combinedStyleAndWeightOptions:p}=ib(i),g=()=>{let x=[f];return p&&x.push(...p),x},b=()=>{let x=[f];return m.forEach(({name:C,value:B})=>{x.push({key:B,name:C,style:{fontStyle:B,fontWeight:void 0}})}),x},v=()=>{let x=[f];return h.forEach(({name:C,value:B})=>{x.push({key:B,name:C,style:{fontStyle:void 0,fontWeight:B}})}),x},k=(0,xte.useMemo)(()=>r&&n?g():r?b():v(),[e.options,m,h,p]),y=k.find(x=>x.style.fontStyle===s&&x.style.fontWeight===a)||k[0],S=()=>y?r?n?(0,li.sprintf)((0,li.__)("Currently selected font appearance: %s"),y.name):(0,li.sprintf)((0,li.__)("Currently selected font style: %s"),y.name):(0,li.sprintf)((0,li.__)("Currently selected font weight: %s"),y.name):(0,li.__)("No selected font appearance");return!t&&(c.size===void 0||c.size==="default")&&(0,_te.default)("36px default size for wp.blockEditor.__experimentalFontAppearanceControl",{since:"6.8",version:"7.1",hint:"Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version."}),u&&(0,wte.jsx)(Ste.CustomSelectControl,{...c,className:"components-font-appearance-control",__next40pxDefaultSize:t,__shouldNotWarnDeprecated36pxSize:!0,label:d,describedBy:S(),options:k,value:y,onChange:({selectedItem:x})=>o(x.style)})}var Cte=l(A(),1),Bte=l(Re(),1),E3=l(N(),1);var Ete=l(w(),1);function rI({__next40pxDefaultSize:e=!1,value:t="",onChange:o,fontFamilies:r,className:n,...i}){let[s]=me("typography.fontFamilies");if(r||(r=s),!r||r.length===0)return null;let a=[{key:"",name:(0,E3.__)("Default")},...r.map(({fontFamily:u,name:d})=>({key:u,name:d||u,style:{fontFamily:u}}))];!e&&(i.size===void 0||i.size==="default")&&(0,Bte.default)("36px default size for wp.blockEditor.__experimentalFontFamilyControl",{since:"6.8",version:"7.1",hint:"Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version."});let c=a.find(u=>u.key===t)??"";return(0,Ete.jsx)(Cte.CustomSelectControl,{__next40pxDefaultSize:e,__shouldNotWarnDeprecated36pxSize:!0,label:(0,E3.__)("Font"),value:c,onChange:({selectedItem:u})=>o(u.key),options:a,className:V("block-editor-font-family-control",n),...i})}var nI=l(A(),1),Tte=l(Re(),1),Ite=l(N(),1);var Pte=l(w(),1);function iI({__next40pxDefaultSize:e=!1,value:t,onChange:o,__unstableInputWidth:r="60px",...n}){let[i]=me("spacing.units"),s=(0,nI.__experimentalUseCustomUnits)({availableUnits:i||["px","em","rem"],defaultValues:{px:2,em:.2,rem:.2}});return!e&&(n.size===void 0||n.size==="default")&&(0,Tte.default)("36px default size for wp.blockEditor.__experimentalLetterSpacingControl",{since:"6.8",version:"7.1",hint:"Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version."}),(0,Pte.jsx)(nI.__experimentalUnitControl,{__next40pxDefaultSize:e,__shouldNotWarnDeprecated36pxSize:!0,...n,label:(0,Ite.__)("Letter spacing"),value:t,__unstableInputWidth:r,units:s,onChange:o})}var jS=l(N(),1),sI=l(A(),1),T3=l(w(),1),cEe=[{label:(0,jS.__)("None"),value:"none",icon:Dr},{label:(0,jS.__)("Underline"),value:"underline",icon:RA},{label:(0,jS.__)("Strikethrough"),value:"line-through",icon:IA}];function aI({value:e,onChange:t,className:o}){return(0,T3.jsx)(sI.__experimentalToggleGroupControl,{isDeselectable:!0,__next40pxDefaultSize:!0,label:(0,jS.__)("Decoration"),className:V("block-editor-text-decoration-control",o),value:e,onChange:r=>{t(r===e?void 0:r)},children:cEe.map(r=>(0,T3.jsx)(sI.__experimentalToggleGroupControlOptionIcon,{value:r.value,icon:r.icon,label:r.label},r.value))})}var sb=l(N(),1);var lI=l(A(),1),I3=l(w(),1),uEe=[{label:(0,sb.__)("None"),value:"none",icon:Dr},{label:(0,sb.__)("Uppercase"),value:"uppercase",icon:AA},{label:(0,sb.__)("Lowercase"),value:"lowercase",icon:EA},{label:(0,sb.__)("Capitalize"),value:"capitalize",icon:CA}];function cI({className:e,value:t,onChange:o}){return(0,I3.jsx)(lI.__experimentalToggleGroupControl,{isDeselectable:!0,__next40pxDefaultSize:!0,label:(0,sb.__)("Letter case"),className:V("block-editor-text-transform-control",e),value:t,onChange:r=>{o(r===t?void 0:r)},children:uEe.map(r=>(0,I3.jsx)(lI.__experimentalToggleGroupControlOptionIcon,{value:r.value,icon:r.icon,label:r.label},r.value))})}var ab=l(N(),1);var uI=l(A(),1),P3=l(w(),1),dEe=[{label:(0,ab.__)("Horizontal"),value:"horizontal-tb",icon:CN},{label:(0,ab.__)("Vertical"),value:(0,ab.isRTL)()?"vertical-lr":"vertical-rl",icon:EN}];function dI({className:e,value:t,onChange:o}){return(0,P3.jsx)(uI.__experimentalToggleGroupControl,{isDeselectable:!0,__next40pxDefaultSize:!0,label:(0,ab.__)("Orientation"),className:V("block-editor-writing-mode-control",e),value:t,onChange:r=>{o(r===t?void 0:r)},children:dEe.map(r=>(0,P3.jsx)(uI.__experimentalToggleGroupControlOptionIcon,{value:r.value,icon:r.icon,label:r.label},r.value))})}var Xr=l(A(),1),Rte=l(R(),1),Ote=l(N(),1);var Uo=l(w(),1),fEe=({setting:e,children:t,panelId:o,...r})=>{let n=()=>{e.colorValue?e.onColorChange():e.gradientValue&&e.onGradientChange()};return(0,Uo.jsx)(Xr.__experimentalToolsPanelItem,{hasValue:()=>!!e.colorValue||!!e.gradientValue,label:e.label,onDeselect:n,isShownByDefault:e.isShownByDefault!==void 0?e.isShownByDefault:!0,...r,className:"block-editor-tools-panel-color-gradient-settings__item",panelId:o,resetAllFilter:e.resetAllFilter,children:t})},mEe=({colorValue:e,label:t})=>(0,Uo.jsxs)(Xr.__experimentalHStack,{justify:"flex-start",children:[(0,Uo.jsx)(Xr.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:e}),(0,Uo.jsx)(Xr.FlexItem,{className:"block-editor-panel-color-gradient-settings__color-name",title:t,children:t})]}),pEe=e=>function({onToggle:o,isOpen:r}){let{clearable:n,colorValue:i,gradientValue:s,onColorChange:a,onGradientChange:c,label:u}=e,d=(0,Rte.useRef)(void 0),f={onClick:o,className:V("block-editor-panel-color-gradient-settings__dropdown",{"is-open":r}),"aria-expanded":r,ref:d},m=()=>{i?a():s&&c()},h=i??s;return(0,Uo.jsxs)(Uo.Fragment,{children:[(0,Uo.jsx)(Xr.Button,{__next40pxDefaultSize:!0,...f,children:(0,Uo.jsx)(mEe,{colorValue:h,label:u})}),n&&h&&(0,Uo.jsx)(Xr.Button,{__next40pxDefaultSize:!0,label:(0,Ote.__)("Reset"),className:"block-editor-panel-color-gradient-settings__reset",size:"small",icon:Dr,onClick:()=>{m(),r&&o(),d.current?.focus()}})]})};function fI({colors:e,disableCustomColors:t,disableCustomGradients:o,enableAlpha:r,gradients:n,settings:i,__experimentalIsRenderedInSidebar:s,...a}){let c;return s&&(c={placement:"left-start",offset:36,shift:!0}),(0,Uo.jsx)(Uo.Fragment,{children:i.map((u,d)=>{let f={clearable:!1,colorValue:u.colorValue,colors:e,disableCustomColors:t,disableCustomGradients:o,enableAlpha:r,gradientValue:u.gradientValue,gradients:n,label:u.label,onColorChange:u.onColorChange,onGradientChange:u.onGradientChange,showTitle:!1,__experimentalIsRenderedInSidebar:s,...u},m={clearable:u.clearable,label:u.label,colorValue:u.colorValue,gradientValue:u.gradientValue,onColorChange:u.onColorChange,onGradientChange:u.onGradientChange};return u&&(0,Uo.jsx)(fEe,{setting:u,...a,children:(0,Uo.jsx)(Xr.Dropdown,{popoverProps:c,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:pEe(m),renderContent:()=>(0,Uo.jsx)(Xr.__experimentalDropdownContentWrapper,{paddingSize:"none",children:(0,Uo.jsx)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content",children:(0,Uo.jsx)(_d,{...f})})})})},d)})})}var mI=l(A(),1),Ate=l(F(),1),Lte=l(Z(),1);var R3=l(R(),1),Um=l(N(),1);function wd(){let[e,t,o,r,n,i,s,a,c,u]=me("color.custom","color.palette.custom","color.palette.theme","color.palette.default","color.defaultPalette","color.customGradient","color.gradients.custom","color.gradients.theme","color.gradients.default","color.defaultGradients"),d={disableCustomColors:!e,disableCustomGradients:!i};return d.colors=(0,R3.useMemo)(()=>{let f=[];return o&&o.length&&f.push({name:(0,Um._x)("Theme","Indicates this palette comes from the theme."),slug:"theme",colors:o}),n&&r&&r.length&&f.push({name:(0,Um._x)("Default","Indicates this palette comes from WordPress."),slug:"default",colors:r}),t&&t.length&&f.push({name:(0,Um._x)("Custom","Indicates this palette is created by the user."),slug:"custom",colors:t}),f},[t,o,r,n]),d.gradients=(0,R3.useMemo)(()=>{let f=[];return a&&a.length&&f.push({name:(0,Um._x)("Theme","Indicates this palette comes from the theme."),slug:"theme",gradients:a}),u&&c&&c.length&&f.push({name:(0,Um._x)("Default","Indicates this palette comes from WordPress."),slug:"default",gradients:c}),s&&s.length&&f.push({name:(0,Um._x)("Custom","Indicates this palette is created by the user."),slug:"custom",gradients:s}),f},[s,a,c,u]),d.hasColorsOrGradients=!!d.colors.length||!!d.gradients.length,d}var qs=l(w(),1),hEe=["colors","disableCustomColors","gradients","disableCustomGradients"],O3=({className:e,colors:t,gradients:o,disableCustomColors:r,disableCustomGradients:n,children:i,settings:s,title:a,showTitle:c=!0,__experimentalIsRenderedInSidebar:u,enableAlpha:d})=>{let f=(0,Lte.useInstanceId)(O3),{batch:m}=(0,Ate.useRegistry)();return(!t||t.length===0)&&(!o||o.length===0)&&r&&n&&s?.every(h=>(!h.colors||h.colors.length===0)&&(!h.gradients||h.gradients.length===0)&&(h.disableCustomColors===void 0||h.disableCustomColors)&&(h.disableCustomGradients===void 0||h.disableCustomGradients))?null:(0,qs.jsxs)(mI.__experimentalToolsPanel,{className:V("block-editor-panel-color-gradient-settings",e),label:c?a:void 0,resetAll:()=>{m(()=>{s.forEach(({colorValue:h,gradientValue:p,onColorChange:g,onGradientChange:b})=>{h?g():p&&b()})})},panelId:f,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",children:[(0,qs.jsx)(fI,{settings:s,panelId:f,colors:t,gradients:o,disableCustomColors:r,disableCustomGradients:n,__experimentalIsRenderedInSidebar:u,enableAlpha:d}),!!i&&(0,qs.jsxs)(qs.Fragment,{children:[(0,qs.jsx)(mI.__experimentalSpacer,{marginY:4})," ",i]})]})},gEe=e=>{let t=wd();return(0,qs.jsx)(O3,{...t,...e})},bEe=e=>hEe.every(t=>e.hasOwnProperty(t))?(0,qs.jsx)(O3,{...e}):(0,qs.jsx)(gEe,{...e}),pI=bEe;var hI=l(R(),1),Hm=l(A(),1),L3=l(N(),1);var US=l(w(),1),A3=[],kEe={...KT,px:{max:1e3,steps:1},em:{max:50,steps:.1},rem:{max:50,steps:.1}};function vEe(e){let t=e?.default??A3,o=e?.custom??A3,r=e?.theme??A3;return(0,hI.useMemo)(()=>[{name:(0,L3.__)("None"),slug:"0",size:0},...o,...r,...t],[o,r,t])}function lb({label:e=(0,L3.__)("Dimension"),onChange:t,value:o}){let[r,n]=me("dimensions.dimensionSizes","spacing.units"),i=(0,Hm.__experimentalUseCustomUnits)({availableUnits:n||["%","px","em","rem","vh","vw"]}),s=vEe(r),[a,c]=(0,hI.useState)(()=>{let[,d]=(0,Hm.__experimentalParseQuantityAndUnitFromRawValue)(o);return d||i[0]?.value||"px"}),u=d=>{let[f,m]=(0,Hm.__experimentalParseQuantityAndUnitFromRawValue)(o);["em","rem"].includes(d)&&m==="px"?t((f/16).toFixed(2)+d):["em","rem"].includes(m)&&d==="px"?t(Math.round(f*16)+d):["%","vw","svw","lvw","dvw","vh","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","vmin","svmin","lvmin","dvmin","vmax","svmax","lvmax","dvmax"].includes(d)&&f>100&&t(100+d),c(d)};return(0,US.jsxs)("fieldset",{className:"block-editor-dimension-control",children:[(0,US.jsx)(Hm.BaseControl.VisualLabel,{as:"legend",children:e}),(0,US.jsx)(jm,{ariaLabel:e,className:"block-editor-dimension-control",customValueSettings:kEe,minimumCustomValue:0,onChange:t,onUnitChange:u,presets:s,presetType:"dimension",selectedUnit:a,showTooltip:!0,units:i,value:o})]})}var Mte=l(R(),1),or=l(A(),1),Dte=l(N(),1),Vte=l(Re(),1);var ja=l(w(),1),Nte={px:{max:1e3,step:1},"%":{max:100,step:1},vw:{max:100,step:1},vh:{max:100,step:1},em:{max:50,step:.1},rem:{max:50,step:.1},svw:{max:100,step:1},lvw:{max:100,step:1},dvw:{max:100,step:1},svh:{max:100,step:1},lvh:{max:100,step:1},dvh:{max:100,step:1},vi:{max:100,step:1},svi:{max:100,step:1},lvi:{max:100,step:1},dvi:{max:100,step:1},vb:{max:100,step:1},svb:{max:100,step:1},lvb:{max:100,step:1},dvb:{max:100,step:1},vmin:{max:100,step:1},svmin:{max:100,step:1},lvmin:{max:100,step:1},dvmin:{max:100,step:1},vmax:{max:100,step:1},svmax:{max:100,step:1},lvmax:{max:100,step:1},dvmax:{max:100,step:1}};function Fte({label:e=(0,Dte.__)("Height"),onChange:t,value:o}){(0,Vte.default)("wp.blockEditor.HeightControl",{since:"7.0",version:"7.2",alternative:"wp.blockEditor.DimensionControl"});let r=parseFloat(o),[n]=me("spacing.units"),i=(0,or.__experimentalUseCustomUnits)({availableUnits:n||["%","px","em","rem","vh","vw"]}),s=(0,Mte.useMemo)(()=>(0,or.__experimentalParseQuantityAndUnitFromRawValue)(o),[o])[1]||i[0]?.value||"px",a=u=>{t([u,s].join(""))},c=u=>{let[d,f]=(0,or.__experimentalParseQuantityAndUnitFromRawValue)(o);["em","rem"].includes(u)&&f==="px"?t((d/16).toFixed(2)+u):["em","rem"].includes(f)&&u==="px"?t(Math.round(d*16)+u):["%","vw","svw","lvw","dvw","vh","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","vmin","svmin","lvmin","dvmin","vmax","svmax","lvmax","dvmax"].includes(u)&&d>100&&t(100+u)};return(0,ja.jsxs)("fieldset",{className:"block-editor-height-control",children:[(0,ja.jsx)(or.BaseControl.VisualLabel,{as:"legend",children:e}),(0,ja.jsxs)(or.Flex,{children:[(0,ja.jsx)(or.FlexItem,{isBlock:!0,children:(0,ja.jsx)(or.__experimentalUnitControl,{value:o,units:i,onChange:t,onUnitChange:c,min:0,size:"__unstable-large",label:e,hideLabelFromVision:!0})}),(0,ja.jsx)(or.FlexItem,{isBlock:!0,children:(0,ja.jsx)(or.__experimentalSpacer,{marginX:2,marginBottom:0,children:(0,ja.jsx)(or.RangeControl,{__next40pxDefaultSize:!0,value:r,min:0,max:Nte[s]?.max??100,step:Nte[s]?.step??.1,withInputField:!1,onChange:a,label:e,hideLabelFromVision:!0})})})]})]})}var $S=l(A(),1);var es=l(jr()),doe=l(soe());function wEe(e,t,o,r,n,i){i===void 0&&(i=0);var s=cb(e,t,i),a=s.width,c=s.height,u=Math.min(a,o),d=Math.min(c,r);return u>d*n?{width:d*n,height:d}:{width:u,height:u/n}}function CEe(e){return e.width>e.height?e.width/e.naturalWidth:e.height/e.naturalHeight}function HS(e,t,o,r,n){n===void 0&&(n=0);var i=cb(t.width,t.height,n),s=i.width,a=i.height;return{x:aoe(e.x,s,o.width,r),y:aoe(e.y,a,o.height,r)}}function aoe(e,t,o,r){var n=t*r/2-o/2;return SI(e,-n,n)}function loe(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function coe(e,t){return Math.atan2(t.y-e.y,t.x-e.x)*180/Math.PI}function BEe(e,t,o,r,n,i,s){i===void 0&&(i=0),s===void 0&&(s=!0);var a=s?EEe:TEe,c=cb(t.width,t.height,i),u=cb(t.naturalWidth,t.naturalHeight,i),d={x:a(100,((c.width-o.width/n)/2-e.x/n)/c.width*100),y:a(100,((c.height-o.height/n)/2-e.y/n)/c.height*100),width:a(100,o.width/c.width*100/n),height:a(100,o.height/c.height*100/n)},f=Math.round(a(u.width,d.width*u.width/100)),m=Math.round(a(u.height,d.height*u.height/100)),h=u.width>=u.height*r,p=h?{width:Math.round(m*r),height:m}:{width:f,height:Math.round(f/r)},g=Fo(Fo({},p),{x:Math.round(a(u.width-p.width,d.x*u.width/100)),y:Math.round(a(u.height-p.height,d.y*u.height/100))});return{croppedAreaPercentages:d,croppedAreaPixels:g}}function EEe(e,t){return Math.min(e,Math.max(0,t))}function TEe(e,t){return t}function IEe(e,t,o,r,n,i){var s=cb(t.width,t.height,o),a=SI(r.width/s.width*(100/e.width),n,i),c={x:a*s.width/2-r.width/2-s.width*a*(e.x/100),y:a*s.height/2-r.height/2-s.height*a*(e.y/100)};return{crop:c,zoom:a}}function PEe(e,t,o){var r=CEe(t);return o.height>o.width?o.height/(e.height*r):o.width/(e.width*r)}function REe(e,t,o,r,n,i){o===void 0&&(o=0);var s=cb(t.naturalWidth,t.naturalHeight,o),a=SI(PEe(e,t,r),n,i),c=r.height>r.width?r.height/e.height:r.width/e.width,u={x:((s.width-e.width)/2-e.x)*c,y:((s.height-e.height)/2-e.y)*c};return{crop:u,zoom:a}}function uoe(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function OEe(e){return e*Math.PI/180}function cb(e,t,o){var r=OEe(o);return{width:Math.abs(Math.cos(r)*e)+Math.abs(Math.sin(r)*t),height:Math.abs(Math.sin(r)*e)+Math.abs(Math.cos(r)*t)}}function SI(e,t,o){return Math.min(Math.max(e,t),o)}function yI(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter(function(o){return typeof o=="string"&&o.length>0}).join(" ").trim()}var AEe=`.reactEasyCrop_Container { position: absolute; top: 0; left: 0; right: 0; bottom: 0; overflow: hidden; user-select: none; touch-action: none; cursor: move; display: flex; justify-content: center; align-items: center; } .reactEasyCrop_Image, .reactEasyCrop_Video { will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */ } .reactEasyCrop_Contain { max-width: 100%; max-height: 100%; margin: auto; position: absolute; top: 0; bottom: 0; left: 0; right: 0; } .reactEasyCrop_Cover_Horizontal { width: 100%; height: auto; } .reactEasyCrop_Cover_Vertical { width: auto; height: 100%; } .reactEasyCrop_CropArea { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); border: 1px solid rgba(255, 255, 255, 0.5); box-sizing: border-box; box-shadow: 0 0 0 9999em; color: rgba(0, 0, 0, 0.5); overflow: hidden; } .reactEasyCrop_CropAreaRound { border-radius: 50%; } .reactEasyCrop_CropAreaGrid::before { content: ' '; box-sizing: border-box; position: absolute; border: 1px solid rgba(255, 255, 255, 0.5); top: 0; bottom: 0; left: 33.33%; right: 33.33%; border-top: 0; border-bottom: 0; } .reactEasyCrop_CropAreaGrid::after { content: ' '; box-sizing: border-box; position: absolute; border: 1px solid rgba(255, 255, 255, 0.5); top: 33.33%; bottom: 33.33%; left: 0; right: 0; border-left: 0; border-right: 0; } `,LEe=1,NEe=3,MEe=1,foe=(function(e){IU(t,e);function t(){var o=e!==null&&e.apply(this,arguments)||this;return o.cropperRef=es.createRef(),o.imageRef=es.createRef(),o.videoRef=es.createRef(),o.containerPosition={x:0,y:0},o.containerRef=null,o.styleRef=null,o.containerRect=null,o.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},o.dragStartPosition={x:0,y:0},o.dragStartCrop={x:0,y:0},o.gestureZoomStart=0,o.gestureRotationStart=0,o.isTouching=!1,o.lastPinchDistance=0,o.lastPinchRotation=0,o.rafDragTimeout=null,o.rafPinchTimeout=null,o.wheelTimer=null,o.currentDoc=typeof document<"u"?document:null,o.currentWindow=typeof window<"u"?window:null,o.resizeObserver=null,o.previousCropSize=null,o.isInitialized=!1,o.state={cropSize:null,hasWheelJustStarted:!1,mediaObjectFit:void 0},o.initResizeObserver=function(){if(!(typeof window.ResizeObserver>"u"||!o.containerRef)){var r=!0;o.resizeObserver=new window.ResizeObserver(function(n){if(r){r=!1;return}o.computeSizes()}),o.resizeObserver.observe(o.containerRef)}},o.preventZoomSafari=function(r){return r.preventDefault()},o.cleanEvents=function(){o.currentDoc&&(o.currentDoc.removeEventListener("mousemove",o.onMouseMove),o.currentDoc.removeEventListener("mouseup",o.onDragStopped),o.currentDoc.removeEventListener("touchmove",o.onTouchMove),o.currentDoc.removeEventListener("touchend",o.onDragStopped),o.currentDoc.removeEventListener("gesturechange",o.onGestureChange),o.currentDoc.removeEventListener("gestureend",o.onGestureEnd),o.currentDoc.removeEventListener("scroll",o.onScroll))},o.clearScrollEvent=function(){o.containerRef&&o.containerRef.removeEventListener("wheel",o.onWheel),o.wheelTimer&&clearTimeout(o.wheelTimer)},o.onMediaLoad=function(){var r=o.computeSizes();r&&(o.previousCropSize=r,o.emitCropData(),o.setInitialCrop(r),o.isInitialized=!0),o.props.onMediaLoaded&&o.props.onMediaLoaded(o.mediaSize)},o.setInitialCrop=function(r){if(o.props.initialCroppedAreaPercentages){var n=IEe(o.props.initialCroppedAreaPercentages,o.mediaSize,o.props.rotation,r,o.props.minZoom,o.props.maxZoom),i=n.crop,s=n.zoom;o.props.onCropChange(i),o.props.onZoomChange&&o.props.onZoomChange(s)}else if(o.props.initialCroppedAreaPixels){var a=REe(o.props.initialCroppedAreaPixels,o.mediaSize,o.props.rotation,r,o.props.minZoom,o.props.maxZoom),i=a.crop,s=a.zoom;o.props.onCropChange(i),o.props.onZoomChange&&o.props.onZoomChange(s)}},o.computeSizes=function(){var r,n,i,s,a,c,u=o.imageRef.current||o.videoRef.current;if(u&&o.containerRef){o.containerRect=o.containerRef.getBoundingClientRect(),o.saveContainerPosition();var d=o.containerRect.width/o.containerRect.height,f=((r=o.imageRef.current)===null||r===void 0?void 0:r.naturalWidth)||((n=o.videoRef.current)===null||n===void 0?void 0:n.videoWidth)||0,m=((i=o.imageRef.current)===null||i===void 0?void 0:i.naturalHeight)||((s=o.videoRef.current)===null||s===void 0?void 0:s.videoHeight)||0,h=u.offsetWidth<f||u.offsetHeight<m,p=f/m,g=void 0;if(h)switch(o.state.mediaObjectFit){default:case"contain":g=d>p?{width:o.containerRect.height*p,height:o.containerRect.height}:{width:o.containerRect.width,height:o.containerRect.width/p};break;case"horizontal-cover":g={width:o.containerRect.width,height:o.containerRect.width/p};break;case"vertical-cover":g={width:o.containerRect.height*p,height:o.containerRect.height};break}else g={width:u.offsetWidth,height:u.offsetHeight};o.mediaSize=Fo(Fo({},g),{naturalWidth:f,naturalHeight:m}),o.props.setMediaSize&&o.props.setMediaSize(o.mediaSize);var b=o.props.cropSize?o.props.cropSize:wEe(o.mediaSize.width,o.mediaSize.height,o.containerRect.width,o.containerRect.height,o.props.aspect,o.props.rotation);return(((a=o.state.cropSize)===null||a===void 0?void 0:a.height)!==b.height||((c=o.state.cropSize)===null||c===void 0?void 0:c.width)!==b.width)&&o.props.onCropSizeChange&&o.props.onCropSizeChange(b),o.setState({cropSize:b},o.recomputeCropPosition),o.props.setCropSize&&o.props.setCropSize(b),b}},o.saveContainerPosition=function(){if(o.containerRef){var r=o.containerRef.getBoundingClientRect();o.containerPosition={x:r.left,y:r.top}}},o.onMouseDown=function(r){o.currentDoc&&(r.preventDefault(),o.currentDoc.addEventListener("mousemove",o.onMouseMove),o.currentDoc.addEventListener("mouseup",o.onDragStopped),o.saveContainerPosition(),o.onDragStart(t.getMousePoint(r)))},o.onMouseMove=function(r){return o.onDrag(t.getMousePoint(r))},o.onScroll=function(r){o.currentDoc&&(r.preventDefault(),o.saveContainerPosition())},o.onTouchStart=function(r){o.currentDoc&&(o.isTouching=!0,!(o.props.onTouchRequest&&!o.props.onTouchRequest(r))&&(o.currentDoc.addEventListener("touchmove",o.onTouchMove,{passive:!1}),o.currentDoc.addEventListener("touchend",o.onDragStopped),o.saveContainerPosition(),r.touches.length===2?o.onPinchStart(r):r.touches.length===1&&o.onDragStart(t.getTouchPoint(r.touches[0]))))},o.onTouchMove=function(r){r.preventDefault(),r.touches.length===2?o.onPinchMove(r):r.touches.length===1&&o.onDrag(t.getTouchPoint(r.touches[0]))},o.onGestureStart=function(r){o.currentDoc&&(r.preventDefault(),o.currentDoc.addEventListener("gesturechange",o.onGestureChange),o.currentDoc.addEventListener("gestureend",o.onGestureEnd),o.gestureZoomStart=o.props.zoom,o.gestureRotationStart=o.props.rotation)},o.onGestureChange=function(r){if(r.preventDefault(),!o.isTouching){var n=t.getMousePoint(r),i=o.gestureZoomStart-1+r.scale;if(o.setNewZoom(i,n,{shouldUpdatePosition:!0}),o.props.onRotationChange){var s=o.gestureRotationStart+r.rotation;o.props.onRotationChange(s)}}},o.onGestureEnd=function(r){o.cleanEvents()},o.onDragStart=function(r){var n,i,s=r.x,a=r.y;o.dragStartPosition={x:s,y:a},o.dragStartCrop=Fo({},o.props.crop),(i=(n=o.props).onInteractionStart)===null||i===void 0||i.call(n)},o.onDrag=function(r){var n=r.x,i=r.y;o.currentWindow&&(o.rafDragTimeout&&o.currentWindow.cancelAnimationFrame(o.rafDragTimeout),o.rafDragTimeout=o.currentWindow.requestAnimationFrame(function(){if(o.state.cropSize&&!(n===void 0||i===void 0)){var s=n-o.dragStartPosition.x,a=i-o.dragStartPosition.y,c={x:o.dragStartCrop.x+s,y:o.dragStartCrop.y+a},u=o.props.restrictPosition?HS(c,o.mediaSize,o.state.cropSize,o.props.zoom,o.props.rotation):c;o.props.onCropChange(u)}}))},o.onDragStopped=function(){var r,n;o.isTouching=!1,o.cleanEvents(),o.emitCropData(),(n=(r=o.props).onInteractionEnd)===null||n===void 0||n.call(r)},o.onWheel=function(r){if(o.currentWindow&&!(o.props.onWheelRequest&&!o.props.onWheelRequest(r))){r.preventDefault();var n=t.getMousePoint(r),i=(0,doe.default)(r).pixelY,s=o.props.zoom-i*o.props.zoomSpeed/200;o.setNewZoom(s,n,{shouldUpdatePosition:!0}),o.state.hasWheelJustStarted||o.setState({hasWheelJustStarted:!0},function(){var a,c;return(c=(a=o.props).onInteractionStart)===null||c===void 0?void 0:c.call(a)}),o.wheelTimer&&clearTimeout(o.wheelTimer),o.wheelTimer=o.currentWindow.setTimeout(function(){return o.setState({hasWheelJustStarted:!1},function(){var a,c;return(c=(a=o.props).onInteractionEnd)===null||c===void 0?void 0:c.call(a)})},250)}},o.getPointOnContainer=function(r,n){var i=r.x,s=r.y;if(!o.containerRect)throw new Error("The Cropper is not mounted");return{x:o.containerRect.width/2-(i-n.x),y:o.containerRect.height/2-(s-n.y)}},o.getPointOnMedia=function(r){var n=r.x,i=r.y,s=o.props,a=s.crop,c=s.zoom;return{x:(n+a.x)/c,y:(i+a.y)/c}},o.setNewZoom=function(r,n,i){var s=i===void 0?{}:i,a=s.shouldUpdatePosition,c=a===void 0?!0:a;if(!(!o.state.cropSize||!o.props.onZoomChange)){var u=SI(r,o.props.minZoom,o.props.maxZoom);if(c){var d=o.getPointOnContainer(n,o.containerPosition),f=o.getPointOnMedia(d),m={x:f.x*u-d.x,y:f.y*u-d.y},h=o.props.restrictPosition?HS(m,o.mediaSize,o.state.cropSize,u,o.props.rotation):m;o.props.onCropChange(h)}o.props.onZoomChange(u)}},o.getCropData=function(){if(!o.state.cropSize)return null;var r=o.props.restrictPosition?HS(o.props.crop,o.mediaSize,o.state.cropSize,o.props.zoom,o.props.rotation):o.props.crop;return BEe(r,o.mediaSize,o.state.cropSize,o.getAspect(),o.props.zoom,o.props.rotation,o.props.restrictPosition)},o.emitCropData=function(){var r=o.getCropData();if(r){var n=r.croppedAreaPercentages,i=r.croppedAreaPixels;o.props.onCropComplete&&o.props.onCropComplete(n,i),o.props.onCropAreaChange&&o.props.onCropAreaChange(n,i)}},o.emitCropAreaChange=function(){var r=o.getCropData();if(r){var n=r.croppedAreaPercentages,i=r.croppedAreaPixels;o.props.onCropAreaChange&&o.props.onCropAreaChange(n,i)}},o.recomputeCropPosition=function(){if(o.state.cropSize){var r=o.props.crop;if(o.isInitialized&&o.previousCropSize){var n=Math.abs(o.previousCropSize.width-o.state.cropSize.width)>1e-6||Math.abs(o.previousCropSize.height-o.state.cropSize.height)>1e-6;if(n){var i=o.state.cropSize.width/o.previousCropSize.width,s=o.state.cropSize.height/o.previousCropSize.height;r={x:o.props.crop.x*i,y:o.props.crop.y*s}}}var a=o.props.restrictPosition?HS(r,o.mediaSize,o.state.cropSize,o.props.zoom,o.props.rotation):r;o.previousCropSize=o.state.cropSize,o.props.onCropChange(a),o.emitCropData()}},o.onKeyDown=function(r){var n,i,s=o.props,a=s.crop,c=s.onCropChange,u=s.keyboardStep,d=s.zoom,f=s.rotation,m=u;if(o.state.cropSize){r.shiftKey&&(m*=.2);var h=Fo({},a);switch(r.key){case"ArrowUp":h.y-=m,r.preventDefault();break;case"ArrowDown":h.y+=m,r.preventDefault();break;case"ArrowLeft":h.x-=m,r.preventDefault();break;case"ArrowRight":h.x+=m,r.preventDefault();break;default:return}o.props.restrictPosition&&(h=HS(h,o.mediaSize,o.state.cropSize,d,f)),r.repeat||(i=(n=o.props).onInteractionStart)===null||i===void 0||i.call(n),c(h)}},o.onKeyUp=function(r){var n,i;switch(r.key){case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":r.preventDefault();break;default:return}o.emitCropData(),(i=(n=o.props).onInteractionEnd)===null||i===void 0||i.call(n)},o}return t.prototype.componentDidMount=function(){!this.currentDoc||!this.currentWindow||(this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.initResizeObserver(),typeof window.ResizeObserver>"u"&&this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.currentDoc.addEventListener("scroll",this.onScroll),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=AEe,this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef),this.props.setCropperRef&&this.props.setCropperRef(this.cropperRef))},t.prototype.componentWillUnmount=function(){var o,r;!this.currentDoc||!this.currentWindow||(typeof window.ResizeObserver>"u"&&this.currentWindow.removeEventListener("resize",this.computeSizes),(o=this.resizeObserver)===null||o===void 0||o.disconnect(),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&((r=this.styleRef.parentNode)===null||r===void 0||r.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent())},t.prototype.componentDidUpdate=function(o){var r,n,i,s,a,c,u,d,f;o.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):o.aspect!==this.props.aspect?this.computeSizes():o.objectFit!==this.props.objectFit?this.computeSizes():o.zoom!==this.props.zoom?this.recomputeCropPosition():((r=o.cropSize)===null||r===void 0?void 0:r.height)!==((n=this.props.cropSize)===null||n===void 0?void 0:n.height)||((i=o.cropSize)===null||i===void 0?void 0:i.width)!==((s=this.props.cropSize)===null||s===void 0?void 0:s.width)?this.computeSizes():(((a=o.crop)===null||a===void 0?void 0:a.x)!==((c=this.props.crop)===null||c===void 0?void 0:c.x)||((u=o.crop)===null||u===void 0?void 0:u.y)!==((d=this.props.crop)===null||d===void 0?void 0:d.y))&&this.emitCropAreaChange(),o.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),o.video!==this.props.video&&((f=this.videoRef.current)===null||f===void 0||f.load());var m=this.getObjectFit();m!==this.state.mediaObjectFit&&this.setState({mediaObjectFit:m},this.computeSizes)},t.prototype.getAspect=function(){var o=this.props,r=o.cropSize,n=o.aspect;return r?r.width/r.height:n},t.prototype.getObjectFit=function(){var o,r,n,i;if(this.props.objectFit==="cover"){var s=this.imageRef.current||this.videoRef.current;if(s&&this.containerRef){this.containerRect=this.containerRef.getBoundingClientRect();var a=this.containerRect.width/this.containerRect.height,c=((o=this.imageRef.current)===null||o===void 0?void 0:o.naturalWidth)||((r=this.videoRef.current)===null||r===void 0?void 0:r.videoWidth)||0,u=((n=this.imageRef.current)===null||n===void 0?void 0:n.naturalHeight)||((i=this.videoRef.current)===null||i===void 0?void 0:i.videoHeight)||0,d=c/u;return d<a?"horizontal-cover":"vertical-cover"}return"horizontal-cover"}return this.props.objectFit},t.prototype.onPinchStart=function(o){var r=t.getTouchPoint(o.touches[0]),n=t.getTouchPoint(o.touches[1]);this.lastPinchDistance=loe(r,n),this.lastPinchRotation=coe(r,n),this.onDragStart(uoe(r,n))},t.prototype.onPinchMove=function(o){var r=this;if(!(!this.currentDoc||!this.currentWindow)){var n=t.getTouchPoint(o.touches[0]),i=t.getTouchPoint(o.touches[1]),s=uoe(n,i);this.onDrag(s),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame(function(){var a=loe(n,i),c=r.props.zoom*(a/r.lastPinchDistance);r.setNewZoom(c,s,{shouldUpdatePosition:!1}),r.lastPinchDistance=a;var u=coe(n,i),d=r.props.rotation+(u-r.lastPinchRotation);r.props.onRotationChange&&r.props.onRotationChange(d),r.lastPinchRotation=u})}},t.prototype.render=function(){var o=this,r,n=this.props,i=n.image,s=n.video,a=n.mediaProps,c=n.cropperProps,u=n.transform,d=n.crop,f=d.x,m=d.y,h=n.rotation,p=n.zoom,g=n.cropShape,b=n.showGrid,v=n.roundCropAreaPixels,k=n.style,y=k.containerStyle,S=k.cropAreaStyle,x=k.mediaStyle,C=n.classes,B=C.containerClassName,I=C.cropAreaClassName,P=C.mediaClassName,E=(r=this.state.mediaObjectFit)!==null&&r!==void 0?r:this.getObjectFit();return es.createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(T){return o.containerRef=T},"data-testid":"container",style:y,className:yI("reactEasyCrop_Container",B)},i?es.createElement("img",Fo({alt:"",className:yI("reactEasyCrop_Image",E==="contain"&&"reactEasyCrop_Contain",E==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",E==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",P)},a,{src:i,ref:this.imageRef,style:Fo(Fo({},x),{transform:u||"translate(".concat(f,"px, ").concat(m,"px) rotate(").concat(h,"deg) scale(").concat(p,")")}),onLoad:this.onMediaLoad})):s&&es.createElement("video",Fo({autoPlay:!0,playsInline:!0,loop:!0,muted:!0,className:yI("reactEasyCrop_Video",E==="contain"&&"reactEasyCrop_Contain",E==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",E==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",P)},a,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:Fo(Fo({},x),{transform:u||"translate(".concat(f,"px, ").concat(m,"px) rotate(").concat(h,"deg) scale(").concat(p,")")}),controls:!1}),(Array.isArray(s)?s:[{src:s}]).map(function(L){return es.createElement("source",Fo({key:L.src},L))})),this.state.cropSize&&es.createElement("div",Fo({ref:this.cropperRef,style:Fo(Fo({},S),{width:v?Math.round(this.state.cropSize.width):this.state.cropSize.width,height:v?Math.round(this.state.cropSize.height):this.state.cropSize.height}),tabIndex:0,onKeyDown:this.onKeyDown,onKeyUp:this.onKeyUp,"data-testid":"cropper",className:yI("reactEasyCrop_CropArea",g==="round"&&"reactEasyCrop_CropAreaRound",b&&"reactEasyCrop_CropAreaGrid",I)},c)))},t.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:NEe,minZoom:LEe,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},cropperProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0,keyboardStep:MEe},t.getMousePoint=function(o){return{x:Number(o.clientX),y:Number(o.clientY)}},t.getTouchPoint=function(o){return{x:Number(o.clientX),y:Number(o.clientY)}},t})(es.Component);var Soe=l(R(),1);var db=l(R(),1);var moe=Object.prototype.hasOwnProperty;function poe(e,t,o){for(o of e.keys())if(Wm(o,t))return o}function Wm(e,t){var o,r,n;if(e===t)return!0;if(e&&t&&(o=e.constructor)===t.constructor){if(o===Date)return e.getTime()===t.getTime();if(o===RegExp)return e.toString()===t.toString();if(o===Array){if((r=e.length)===t.length)for(;r--&&Wm(e[r],t[r]););return r===-1}if(o===Set){if(e.size!==t.size)return!1;for(r of e)if(n=r,n&&typeof n=="object"&&(n=poe(t,n),!n)||!t.has(n))return!1;return!0}if(o===Map){if(e.size!==t.size)return!1;for(r of e)if(n=r[0],n&&typeof n=="object"&&(n=poe(t,n),!n)||!Wm(r[1],t.get(n)))return!1;return!0}if(o===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(o===DataView){if((r=e.byteLength)===t.byteLength)for(;r--&&e.getInt8(r)===t.getInt8(r););return r===-1}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===t.byteLength)for(;r--&&e[r]===t[r];);return r===-1}if(!o||typeof e=="object"){r=0;for(o in e)if(moe.call(e,o)&&++r&&!moe.call(t,o)||!(o in t)||!Wm(e[o],t[o]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}var Zs=l(R(),1);var ub=1,hoe=5;var _I=e=>e>=0?e%360:(360+e%360)%360,DEe=e=>new Promise((t,o)=>{let r=new Image;r.addEventListener("load",()=>t(r)),r.addEventListener("error",n=>o(n)),r.setAttribute("crossOrigin","anonymous"),r.src=e});function goe(e){return e*Math.PI/180}function VEe(e,t,o){let r=goe(o);return{width:Math.abs(Math.cos(r)*e)+Math.abs(Math.sin(r)*t),height:Math.abs(Math.sin(r)*e)+Math.abs(Math.cos(r)*t)}}async function boe(e,t,o=0,r={horizontal:!1,vertical:!1}){try{let n=await DEe(e),i=document.createElement("canvas"),s=i.getContext("2d");if(!s)return null;let a=goe(o),{width:c,height:u}=VEe(n.width,n.height,o);i.width=c,i.height=u,s.translate(c/2,u/2),s.rotate(a),s.scale(r.horizontal?-1:1,r.vertical?-1:1),s.translate(-n.width/2,-n.height/2),s.drawImage(n,0,0);let d=document.createElement("canvas"),f=d.getContext("2d");return f?(d.width=t.width,d.height=t.height,f.drawImage(i,t.x,t.y,t.width,t.height,0,0,t.width,t.height),new Promise(m=>{d.toBlob(h=>{h&&m(URL.createObjectURL(h))},"image/jpeg")})):null}catch{return null}}var $m={crop:{x:0,y:0,width:100,height:100},zoom:ub,rotation:0,aspectRatio:1,flip:{horizontal:!1,vertical:!1}},FEe={x:0,y:0},H3={crop:FEe,croppedArea:$m.crop,croppedAreaPixels:null,zoom:$m.zoom,rotation:$m.rotation,flip:$m.flip,aspectRatio:$m.aspectRatio,mediaSize:null};function koe(){let[e,t]=(0,Zs.useState)(H3),[o,r]=(0,Zs.useState)(null),n=(0,Zs.useCallback)(u=>{t(d=>{let m={...typeof u=="function"?u(d):u};return"rotation"in m&&m.rotation!==void 0&&(m.rotation=_I(m.rotation)),{...d,...m}})},[]),i=(0,Zs.useCallback)((u=null)=>{if(!u){r(null),n(H3);return}if(typeof u=="object"){let d={...$m,...u};r(d),n(d)}},[n,r]),s=(0,Zs.useCallback)(()=>{if(o){let u={crop:{x:0,y:0},croppedAreaPixels:null};o.crop&&(u.croppedArea=o.crop),o.zoom!==void 0&&(u.zoom=o.zoom),o.rotation!==void 0&&(u.rotation=o.rotation),o.aspectRatio!==void 0&&(u.aspectRatio=o.aspectRatio),o.flip!==void 0&&(u.flip=o.flip),n(u)}else n({...H3})},[o,n]),a=(0,Zs.useMemo)(()=>{if(o){let d={crop:e.croppedAreaPixels||e.croppedArea,zoom:e.zoom,rotation:_I(e.rotation),aspectRatio:e.aspectRatio,flip:e.flip};return Wm(d,o)===!1}let u={crop:e.croppedArea,zoom:e.zoom,rotation:_I(e.rotation),aspectRatio:e.aspectRatio,flip:e.flip};return Wm(u,$m)===!1},[e,o]),c=(0,Zs.useCallback)(async u=>e.croppedAreaPixels?boe(u,e.croppedAreaPixels,e.rotation,e.flip):null,[e.croppedAreaPixels,e.rotation,e.flip]);return(0,Zs.useMemo)(()=>({cropperState:e,setCropperState:n,resetState:o,setResetState:i,isDirty:a,reset:s,getCroppedImage:c}),[e,n,o,i,a,s,c])}var voe=l(w(),1),yoe=(0,db.createContext)({cropperState:{crop:{x:0,y:0},croppedArea:{x:0,y:0,width:100,height:100},croppedAreaPixels:null,zoom:ub,rotation:0,aspectRatio:1,flip:{horizontal:!1,vertical:!1},mediaSize:null},setCropperState:()=>{},resetState:null,setResetState:()=>{},isDirty:!1,reset:()=>{},getCroppedImage:()=>Promise.resolve(null)});function G3({children:e}){let t=koe(),o=(0,db.useMemo)(()=>({...t}),[t]);return(0,voe.jsx)(yoe.Provider,{value:o,children:e})}var GS=()=>{let e=(0,db.useContext)(yoe);if(!e)throw new Error("Missing ImageCropperContext");return e};var _oe=l(w(),1);function W3({src:e,onLoad:t,minZoom:o=ub,maxZoom:r=hoe,...n}){let{cropperState:i,setCropperState:s}=GS(),{crop:a,zoom:c,rotation:u,aspectRatio:d,flip:f}=i,m=v=>s({crop:v}),h=v=>s({zoom:v}),p=v=>s({rotation:v}),g=v=>s({mediaSize:v}),b=(0,Soe.useCallback)((v,k)=>{s({croppedArea:v,croppedAreaPixels:k})},[s]);return(0,_oe.jsx)(foe,{classes:{containerClassName:"image-cropper__container",cropAreaClassName:"image-cropper__crop-area",mediaClassName:"image-cropper__image"},minZoom:o,maxZoom:r,rotation:u,image:e,setMediaSize:g,crop:a,zoom:c,aspect:d,onCropChange:m,onZoomChange:h,onCropComplete:b,onMediaLoaded:v=>{t?.(v)},onRotationChange:p,transform:[`translate(${a.x}px, ${a.y}px)`,`rotateZ(${u}deg)`,`rotateY(${f.horizontal?180:0}deg)`,`rotateX(${f.vertical?180:0}deg)`,`scale(${c})`].join(" "),...n})}var pb=l(A(),1),mb=l(N(),1);var xoe=100,woe=300,xI={placement:"bottom-start"};var fb=l(R(),1);var wI=l(F(),1),Km=l(R(),1),hc=l(N(),1),Coe=l(Un(),1),Boe=l(Fe(),1);var zEe={crop:(0,hc.__)("Image cropped."),rotate:(0,hc.__)("Image rotated."),cropAndRotate:(0,hc.__)("Image cropped and rotated.")};function Eoe({crop:e,rotation:t,url:o,id:r,onSaveImage:n,onFinishEditing:i}){let{createErrorNotice:s,createSuccessNotice:a}=(0,wI.useDispatch)(Coe.store),[c,u]=(0,Km.useState)(!1),{editMediaEntity:d}=(0,wI.useSelect)(h=>({editMediaEntity:h(_).getSettings()?.[_0]}),[]),f=(0,Km.useCallback)(()=>{u(!1),i()},[i]),m=(0,Km.useCallback)(async()=>{if(!d){i(),s((0,hc.__)("Sorry, you are not allowed to edit images on this site."),{id:"image-editing-error",type:"snackbar"});return}u(!0);let h=[];if(t>0&&h.push({type:"rotate",args:{angle:t}}),(e.width<99.9||e.height<99.9)&&h.push({type:"crop",args:{left:e.x,top:e.y,width:e.width,height:e.height}}),h.length===0){u(!1),i();return}let p=h.length===1?h[0].type:"cropAndRotate";try{let g=await d(r,{src:o,modifiers:h},{throwOnError:!0});g&&(n({id:g.id,url:g.source_url}),a(zEe[p],{type:"snackbar",actions:[{label:(0,hc.__)("Undo"),onClick:()=>{n({id:r,url:o})}}]}))}catch(g){s((0,hc.sprintf)((0,hc.__)("Could not edit image. %s"),(0,Boe.__unstableStripHTML)(g.message)),{id:"image-editing-error",type:"snackbar"})}finally{u(!1),i()}},[e,t,r,o,n,s,a,i,d]);return(0,Km.useMemo)(()=>({isInProgress:c,apply:m,cancel:f}),[c,m,f])}var Xs=l(R(),1),Toe=l(ut(),1);function Ioe({url:e,naturalWidth:t,naturalHeight:o}){let[r,n]=(0,Xs.useState)(),{cropperState:i,setCropperState:s}=GS(),{zoom:a,aspectRatio:c,crop:u,croppedArea:d}=i,f=(0,Xs.useCallback)(k=>{s({zoom:k})},[s]),m=(0,Xs.useCallback)(k=>{s({aspectRatio:k})},[s]),h=t/o,p=o/t;(0,Xs.useEffect)(()=>{m(h)},[]);let[g,b]=(0,Xs.useState)(0),v=(0,Xs.useCallback)(()=>{let k=(g+90)%360,y=h,x=a!==1||!(h===c||p===c);if(g%180===90&&(y=1/h),k===0){n(),b(k),s({aspectRatio:x?c:h,crop:{x:-(u.y*y),y:u.x*y}});return}function C(P){let E=document.createElement("canvas"),L=0,T=0;k%180?(E.width=P.target.height,E.height=P.target.width):(E.width=P.target.width,E.height=P.target.height),(k===90||k===180)&&(L=E.width),(k===270||k===180)&&(T=E.height);let O=E.getContext("2d");O.translate(L,T),O.rotate(k*Math.PI/180),O.drawImage(P.target,0,0),E.toBlob(D=>{n(URL.createObjectURL(D)),b(k);let U=x?c:E.width/E.height;s({aspectRatio:U,crop:{x:-(u.y*y),y:u.x*y}})})}let B=new window.Image;B.src=e,B.onload=C;let I=(0,Toe.applyFilters)("media.crossOrigin",void 0,e);typeof I=="string"&&(B.crossOrigin=I)},[g,h,e,s,u,a,c,p,b]);return(0,Xs.useMemo)(()=>({editedUrl:r,setEditedUrl:n,crop:d,zoom:a,setZoom:f,rotation:g,rotateClockwise:v,aspect:c,setAspect:m,defaultAspect:h}),[r,d,a,f,g,v,c,m,h])}var Poe=l(w(),1),$3=(0,fb.createContext)({});$3.displayName="ImageEditingContext";var Ua=()=>(0,fb.useContext)($3);function Roe({id:e,url:t,naturalWidth:o,naturalHeight:r,onFinishEditing:n,onSaveImage:i,children:s}){let a=Ioe({url:t,naturalWidth:o,naturalHeight:r}),c=Eoe({id:e,url:t,onSaveImage:i,onFinishEditing:n,...a}),u=(0,fb.useMemo)(()=>({...a,...c}),[a,c]);return(0,Poe.jsx)($3.Provider,{value:u,children:s})}var ts=l(w(),1);function CI({aspectRatios:e,isDisabled:t,label:o,onClick:r,value:n}){return(0,ts.jsx)(pb.MenuGroup,{label:o,children:e.map(({name:i,slug:s,ratio:a})=>(0,ts.jsx)(pb.MenuItem,{disabled:t,onClick:()=>{r(a)},role:"menuitemradio",isSelected:a===n,icon:a===n?gl:void 0,children:i},s))})}function jEe(e){let[t,o,...r]=e.split("/").map(Number);return t<=0||o<=0||Number.isNaN(t)||Number.isNaN(o)||r.length?NaN:o?t/o:t}function K3({ratio:e,...t}){return{ratio:jEe(e),...t}}function Ooe({toggleProps:e}){let{isInProgress:t,aspect:o,setAspect:r,defaultAspect:n}=Ua(),[i,s,a]=me("dimensions.aspectRatios.default","dimensions.aspectRatios.theme","dimensions.defaultAspectRatios");return(0,ts.jsx)(pb.DropdownMenu,{icon:jO,label:(0,mb.__)("Aspect Ratio"),popoverProps:xI,toggleProps:e,children:({onClose:c})=>(0,ts.jsxs)(ts.Fragment,{children:[(0,ts.jsx)(CI,{isDisabled:t,onClick:u=>{r(u),c()},value:o,aspectRatios:[{slug:"original",name:(0,mb.__)("Original"),ratio:n},...a?i.map(K3).filter(({ratio:u})=>u===1):[]]}),s?.length>0&&(0,ts.jsx)(CI,{label:(0,mb.__)("Theme"),isDisabled:t,onClick:u=>{r(u),c()},value:o,aspectRatios:s}),a&&(0,ts.jsx)(CI,{label:(0,mb.__)("Landscape"),isDisabled:t,onClick:u=>{r(u),c()},value:o,aspectRatios:i.map(K3).filter(({ratio:u})=>u>1)}),a&&(0,ts.jsx)(CI,{label:(0,mb.__)("Portrait"),isDisabled:t,onClick:u=>{r(u),c()},value:o,aspectRatios:i.map(K3).filter(({ratio:u})=>u<1)})]})})}var Aoe=l(A(),1),Loe=l(Z(),1);var Cd=l(w(),1);function Noe({url:e,width:t,height:o,naturalHeight:r,naturalWidth:n,borderProps:i}){let{isInProgress:s,editedUrl:a,rotation:c}=Ua(),[u,{width:d}]=(0,Loe.useResizeObserver)(),f=o||d*r/n;c%180===90&&(f=d*n/r);let m=(0,Cd.jsxs)("div",{className:V("wp-block-image__crop-area",i?.className,{"is-applying":s}),style:{...i?.style,width:t||d,height:f},children:[(0,Cd.jsx)(W3,{src:a||e}),s&&(0,Cd.jsx)(Aoe.Spinner,{})]});return(0,Cd.jsxs)(Cd.Fragment,{children:[u,m]})}var Bd=l(A(),1),Y3=l(N(),1);var WS=l(w(),1);function Moe(){let{isInProgress:e,zoom:t,setZoom:o}=Ua();return(0,WS.jsx)(Bd.Dropdown,{contentClassName:"wp-block-image__zoom",popoverProps:xI,renderToggle:({isOpen:r,onToggle:n})=>(0,WS.jsx)(Bd.ToolbarButton,{icon:tN,label:(0,Y3.__)("Zoom"),onClick:n,"aria-expanded":r,disabled:e}),renderContent:()=>(0,WS.jsx)(Bd.__experimentalDropdownContentWrapper,{paddingSize:"medium",children:(0,WS.jsx)(Bd.RangeControl,{__next40pxDefaultSize:!0,label:(0,Y3.__)("Zoom"),min:xoe,max:woe,value:Math.round(t*100),onChange:r=>o(r/100)})})})}var Doe=l(A(),1),Voe=l(N(),1);var Foe=l(w(),1);function zoe(){let{isInProgress:e,rotateClockwise:t}=Ua();return(0,Foe.jsx)(Doe.ToolbarButton,{icon:XL,label:(0,Voe.__)("Rotate"),onClick:t,disabled:e})}var q3=l(A(),1),Z3=l(N(),1);var Ym=l(w(),1);function joe(){let{isInProgress:e,apply:t,cancel:o}=Ua();return(0,Ym.jsxs)(Ym.Fragment,{children:[(0,Ym.jsx)(q3.ToolbarButton,{onClick:t,disabled:e,children:(0,Z3.__)("Apply")}),(0,Ym.jsx)(q3.ToolbarButton,{onClick:o,children:(0,Z3.__)("Cancel")})]})}var ci=l(w(),1);function Uoe({id:e,url:t,width:o,height:r,naturalHeight:n,naturalWidth:i,onSaveImage:s,onFinishEditing:a,borderProps:c}){return(0,ci.jsx)(G3,{children:(0,ci.jsxs)(Roe,{id:e,url:t,naturalWidth:i,naturalHeight:n,onSaveImage:s,onFinishEditing:a,children:[(0,ci.jsx)(Noe,{borderProps:c,url:t,width:o,height:r,naturalHeight:n,naturalWidth:i}),(0,ci.jsxs)(Mt,{children:[(0,ci.jsxs)($S.ToolbarGroup,{children:[(0,ci.jsx)(Moe,{}),(0,ci.jsx)($S.ToolbarItem,{children:u=>(0,ci.jsx)(Ooe,{toggleProps:u})}),(0,ci.jsx)(zoe,{})]}),(0,ci.jsx)($S.ToolbarGroup,{children:(0,ci.jsx)(joe,{})})]})]})})}var ui=l(A(),1),Ed=l(N(),1);var hb=l(R(),1);function Hoe(e,t,o,r,n){let[i,s]=(0,hb.useState)(t??r??""),[a,c]=(0,hb.useState)(e??o??"");return(0,hb.useEffect)(()=>{t===void 0&&r!==void 0&&s(r),e===void 0&&o!==void 0&&c(o)},[r,o]),(0,hb.useEffect)(()=>{t!==void 0&&Number.parseInt(t)!==Number.parseInt(i)&&s(t),e!==void 0&&Number.parseInt(e)!==Number.parseInt(a)&&c(e)},[t,e]),{currentHeight:a,currentWidth:i,updateDimension:(f,m)=>{let h=m===""?void 0:parseInt(m,10);f==="width"?s(h):c(h),n({[f]:h})},updateDimensions:(f,m)=>{c(f??o),s(m??r),n({height:f,width:m})}}}var os=l(w(),1),Goe=[25,50,75,100],UEe=()=>{};function Woe(e,t,o){let r=Math.round(t*(e/100)),n=Math.round(o*(e/100));return{scaledWidth:r,scaledHeight:n}}function $oe({imageSizeHelp:e,imageWidth:t,imageHeight:o,imageSizeOptions:r=[],isResizable:n=!0,slug:i,width:s,height:a,onChange:c,onChangeImage:u=UEe}){let{currentHeight:d,currentWidth:f,updateDimension:m,updateDimensions:h}=Hoe(a,s,o,t,c),p=b=>{if(b===void 0){h();return}let{scaledWidth:v,scaledHeight:k}=Woe(b,t,o);h(k,v)},g=Goe.find(b=>{let{scaledWidth:v,scaledHeight:k}=Woe(b,t,o);return f===v&&d===k});return(0,os.jsxs)(ui.__experimentalVStack,{className:"block-editor-image-size-control",spacing:"4",children:[r&&r.length>0&&(0,os.jsx)(ui.SelectControl,{label:(0,Ed.__)("Resolution"),value:i,options:r,onChange:u,help:e,size:"__unstable-large"}),n&&(0,os.jsxs)(os.Fragment,{children:[(0,os.jsxs)(ui.__experimentalHStack,{align:"baseline",spacing:"4",children:[(0,os.jsx)(ui.__experimentalNumberControl,{label:(0,Ed.__)("Width"),value:f,min:1,onChange:b=>m("width",b),size:"__unstable-large"}),(0,os.jsx)(ui.__experimentalNumberControl,{label:(0,Ed.__)("Height"),value:d,min:1,onChange:b=>m("height",b),size:"__unstable-large"})]}),(0,os.jsx)(ui.__experimentalToggleGroupControl,{label:(0,Ed.__)("Image size presets"),hideLabelFromVision:!0,onChange:p,value:g,isBlock:!0,__next40pxDefaultSize:!0,children:Goe.map(b=>(0,os.jsx)(ui.__experimentalToggleGroupControlOption,{value:b,label:(0,Ed.sprintf)((0,Ed.__)("%d%%"),b)},b))})]})]})}var BI=l(A(),1);var qm=l(N(),1),Yoe=l(w(),1),Koe={left:ru,center:ou,right:nu,"space-between":Fp,stretch:zp};function HEe({allowedControls:e=["left","center","right","space-between"],isCollapsed:t=!0,onChange:o,value:r,popoverProps:n,isToolbar:i}){let s=f=>{o(f===r?void 0:f)},a=r?Koe[r]:Koe.left,c=[{name:"left",icon:ru,title:(0,qm.__)("Justify items left"),isActive:r==="left",onClick:()=>s("left")},{name:"center",icon:ou,title:(0,qm.__)("Justify items center"),isActive:r==="center",onClick:()=>s("center")},{name:"right",icon:nu,title:(0,qm.__)("Justify items right"),isActive:r==="right",onClick:()=>s("right")},{name:"space-between",icon:Fp,title:(0,qm.__)("Space between items"),isActive:r==="space-between",onClick:()=>s("space-between")},{name:"stretch",icon:zp,title:(0,qm.__)("Stretch items"),isActive:r==="stretch",onClick:()=>s("stretch")}],u=i?BI.ToolbarGroup:BI.ToolbarDropdownMenu,d=i?{isCollapsed:t}:{};return(0,Yoe.jsx)(u,{icon:a,popoverProps:n,label:(0,qm.__)("Change items justification"),controls:c.filter(f=>e.includes(f.name)),...d})}var X3=HEe;var Q3=l(w(),1),ah=e=>(0,Q3.jsx)(X3,{...e,isToolbar:!1}),qoe=e=>(0,Q3.jsx)(X3,{...e,isToolbar:!0});var Qr=l(A(),1),Qs=l(N(),1),no=l(R(),1),zre=l(Z(),1),jre=l(Fe(),1),Ure=l(it(),1),Hre=l(Jy(),1),zI=l(F(),1),aF=l(Zp(),1);var Gre=l(Re(),1),jI=l(dn(),1);var gb=l(A(),1);var EI=l(Z(),1),TI=l(N(),1),Zoe=l(R(),1),gc=l(w(),1);function Xoe({children:e,settingsOpen:t,setSettingsOpen:o}){let r=(0,EI.useReducedMotion)(),n=r?Zoe.Fragment:gb.__unstableAnimatePresence,i=r?"div":gb.__unstableMotion.div,a=`link-control-settings-drawer-${(0,EI.useInstanceId)(Xoe)}`;return(0,gc.jsxs)(gc.Fragment,{children:[(0,gc.jsx)(gb.Button,{__next40pxDefaultSize:!0,className:"block-editor-link-control__drawer-toggle","aria-expanded":t,onClick:()=>o(!t),icon:(0,TI.isRTL)()?ev:tu,"aria-controls":a,children:(0,TI._x)("Advanced","Additional link settings")}),(0,gc.jsx)(n,{children:t&&(0,gc.jsx)(i,{className:"block-editor-link-control__drawer",hidden:!t,id:a,initial:"collapsed",animate:"open",exit:"collapsed",variants:{open:{opacity:1,height:"auto"},collapsed:{opacity:0,height:0}},transition:{duration:.1},children:(0,gc.jsx)("div",{className:"block-editor-link-control__drawer-inner",children:e})})})]})}var Qoe=Xoe;var LI=l(R(),1),iF=l(N(),1),bre=l(Re(),1);var KS=l(N(),1),cre=l(A(),1);var II=l(N(),1),Joe=l(A(),1),ere=l(R(),1);var J3=l(w(),1),GEe=({searchTerm:e,onClick:t,itemProps:o,buttonText:r})=>{if(!e)return null;let n;return r?n=typeof r=="function"?r(e):r:n=(0,ere.createInterpolateElement)((0,II.sprintf)((0,II.__)("Create: <mark>%s</mark>"),e),{mark:(0,J3.jsx)("mark",{})}),(0,J3.jsx)(Joe.MenuItem,{...o,iconPosition:"left",icon:Bi,className:"block-editor-link-control__search-item",onClick:t,children:n})},tre=GEe;var bc=l(N(),1),RI=l(A(),1);var ore=l(Fe(),1),kb=l(dn(),1),rre=l(Z(),1),nre=l(Re(),1),bb=l(w(),1),PI={post:{icon:$L,label:(0,bc.__)("Post")},page:{icon:kl,label:(0,bc.__)("Page")},post_tag:{icon:xN,label:(0,bc.__)("Tag")},category:{icon:$O,label:(0,bc.__)("Category")},attachment:{icon:SA,label:(0,bc.__)("Attachment")}};function WEe({isURL:e,suggestion:t}){let o=null;return e?o=ov:t.type in PI&&(o=PI[t.type].icon,t.type==="page"&&(t.isFrontPage&&(o=JA),t.isBlogHome&&(o=DN))),o?(0,bb.jsx)(we,{className:"block-editor-link-control__search-item-icon",icon:o}):null}function $Ee(e){return e?.trim()?.length?e?.replace(/^\/?/,"/"):e}function KEe(e){return e?.trim()?.length?e?.replace(/\/$/,""):e}var YEe=(e,...t)=>(...o)=>e(...o,...t),qEe=e=>t=>t==null||t!==t?e:t;function ZEe(e){return e&&(0,rre.pipe)(kb.safeDecodeURI,kb.getPath,qEe(""),YEe(kb.filterURLForDisplay,24),KEe,$Ee)(e)}var ire=({itemProps:e,suggestion:t,searchTerm:o,onClick:r,isURL:n=!1,shouldShowType:i=!1})=>{let s=n?(0,bc.__)("Press ENTER to add this link"):ZEe(t.url);return(0,bb.jsx)(RI.MenuItem,{...e,info:s,iconPosition:"left",icon:(0,bb.jsx)(WEe,{suggestion:t,isURL:n}),onClick:r,shortcut:i&&XEe(t),className:"block-editor-link-control__search-item",children:(0,bb.jsx)(RI.TextHighlight,{text:(0,ore.__unstableStripHTML)(t.title),highlight:o})})};function XEe(e){return e.isFrontPage?(0,bc.__)("Front page"):e.isBlogHome?(0,bc.__)("Blog home"):e.type in PI?PI[e.type].label:e.type}var sre=ire,are=e=>((0,nre.default)("wp.blockEditor.__experimentalLinkControlSearchItem",{since:"6.8"}),(0,bb.jsx)(ire,{...e}));var lre=l(N(),1),Zm="__CREATE__",eF="tel",OI="link",tF="mailto",oF="internal",vb=[OI,tF,eF,oF],rF=[{id:"opensInNewTab",title:(0,lre.__)("Open in new tab")}];var ure=l(Re(),1),Xm=l(w(),1);function dre({withCreateSuggestion:e,currentInputValue:t,handleSuggestionClick:o,suggestionsListProps:r,buildSuggestionItemProps:n,suggestions:i,selectedSuggestion:s,isLoading:a,isInitialSuggestions:c,createSuggestionButtonText:u,suggestionsQuery:d}){let f=V("block-editor-link-control__search-results",{"is-loading":a}),m=i.length===1&&vb.includes(i[0].type),h=e&&!m&&!c,p=!d?.type,g=c?(0,KS.__)("Suggestions"):(0,KS.sprintf)((0,KS.__)('Search results for "%s"'),t);return(0,Xm.jsx)("div",{className:"block-editor-link-control__search-results-wrapper",children:(0,Xm.jsx)("div",{...r,className:f,"aria-label":g,children:(0,Xm.jsx)(cre.MenuGroup,{children:i.map((b,v)=>h&&Zm===b.type?(0,Xm.jsx)(tre,{searchTerm:t,buttonText:u,onClick:()=>o(b),itemProps:n(b,v),isSelected:v===s},b.type):Zm===b.type?null:(0,Xm.jsx)(sre,{itemProps:n(b,v),suggestion:b,index:v,onClick:()=>{o(b)},isSelected:v===s,isURL:vb.includes(b.type),searchTerm:t,shouldShowType:p,isFrontPage:b?.isFrontPage,isBlogHome:b?.isBlogHome},`${b.id}-${b.type}`))})})})}var fre=dre,mre=e=>((0,ure.default)("wp.blockEditor.__experimentalLinkControlSearchResults",{since:"6.8"}),(0,Xm.jsx)(dre,{...e}));var pre=l(R(),1),hre=l(F(),1);var AI=l(dn(),1);function YS(e){let t=e?.trim();if(!t)return{url:t,type:OI};let o=OI,r=(0,AI.getProtocol)(t)||"";return r.includes("mailto")?o=tF:r.includes("tel")?o=eF:t?.startsWith("#")&&(o=oF),gf(t)||bf(t)||t.startsWith("?")||r?{url:t,type:o}:{url:(0,AI.prependHTTPS)(t),type:o}}var QEe=()=>Promise.resolve([]),JEe=e=>{let{url:t,type:o}=YS(e);return Promise.resolve([{id:e,title:e,url:t,type:o}])},eTe=async(e,t,o,r,n,i)=>{let{isInitialSuggestions:s}=t,a=await o(e,t);return a.map(c=>Number(c.id)===n?(c.isFrontPage=!0,c):(Number(c.id)===i&&(c.isBlogHome=!0),c)),s||kf(e)||!r?a:a.concat({title:e,url:e,type:Zm})};function gre(e,t,o){let{fetchSearchSuggestions:r,pageOnFront:n,pageForPosts:i}=(0,hre.useSelect)(a=>{let{getSettings:c}=a(_);return{pageOnFront:c().pageOnFront,pageForPosts:c().pageForPosts,fetchSearchSuggestions:c().__experimentalFetchLinkSuggestions}},[]),s=t?JEe:QEe;return(0,pre.useCallback)((a,{isInitialSuggestions:c})=>kf(a)?s(a,{isInitialSuggestions:c}):eTe(a,{...e,isInitialSuggestions:c},r,o,n,i),[s,r,n,i,e,o])}var yb=l(w(),1),tTe=()=>Promise.resolve([]),nF=()=>{},kre=(0,LI.forwardRef)(({value:e,children:t,currentLink:o={},className:r=null,placeholder:n=null,withCreateSuggestion:i=!1,onCreateSuggestion:s=nF,onChange:a=nF,onSelect:c=nF,showSuggestions:u=!0,renderSuggestions:d=C=>(0,yb.jsx)(fre,{...C}),fetchSuggestions:f=null,allowDirectEntry:m=!0,showInitialSuggestions:h=!1,suggestionsQuery:p={},withURLSuggestion:g=!0,createSuggestionButtonText:b,hideLabelFromVision:v=!1,suffix:k,isEntity:y=!1,customValidity:S},x)=>{let C=gre(p,m,i,g),B=u?f||C:tTe,[I,P]=(0,LI.useState)(),E=(U,G)=>{a(U),P(G)},L=U=>d({...U,withCreateSuggestion:i,createSuggestionButtonText:b,suggestionsQuery:p,handleSuggestionClick:G=>{U.handleSuggestionClick&&U.handleSuggestionClick(G),T(G)}}),T=async U=>{let G=U;if(Zm===U.type){try{G=await s(U.title),G?.url&&c(G)}catch{}return}if(m||G&&Object.keys(G).length>=1){let{id:j,url:z,kind:W,type:ee,...se}=o??{};c({...se,...G},G)}},O=n??(0,iF.__)("Search or type URL"),D=v&&n!==""?O:(0,iF.__)("Link");return(0,yb.jsxs)("div",{className:"block-editor-link-control__search-input-container",children:[(0,yb.jsx)(Td,{disableSuggestions:o?.url===e,label:D,hideLabelFromVision:v,className:r,value:e,onChange:E,placeholder:O,__experimentalRenderSuggestions:u?L:null,__experimentalFetchLinkSuggestions:B,__experimentalHandleURLSuggestions:!0,__experimentalShowInitialSuggestions:h,customValidity:S,required:!1,onSubmit:(U,G)=>{let j=U||I;!j&&!e?.trim()?.length?G.preventDefault():T(j||{url:e})},inputRef:x,suffix:k,disabled:y}),t]})}),vre=kre,yre=e=>((0,bre.default)("wp.blockEditor.__experimentalLinkControlSearchInput",{since:"6.8"}),(0,yb.jsx)(kre,{...e}));var Id=l(N(),1),Lo=l(A(),1),Cre=l(Z(),1),DI=l(dn(),1);var Bre=l(Fe(),1),VI=l(F(),1),Ere=l(Un(),1),Tre=l(Zp(),1);var Sre=l(A(),1),{Slot:_re,Fill:xre}=(0,Sre.createSlotFill)("BlockEditorLinkControlViewer");var wre=l(F(),1),NI=l(R(),1);function oTe(e,t){switch(t.type){case"RESOLVED":return{...e,isFetching:!1,richData:t.richData};case"ERROR":return{...e,isFetching:!1,richData:null};case"LOADING":return{...e,isFetching:!0};default:throw new Error(`Unexpected action type ${t.type}`)}}function rTe(e){let[t,o]=(0,NI.useReducer)(oTe,{richData:null,isFetching:!1}),{fetchRichUrlData:r}=(0,wre.useSelect)(n=>{let{getSettings:i}=n(_);return{fetchRichUrlData:i().__experimentalFetchRichUrlData}},[]);return(0,NI.useEffect)(()=>{if(e?.length&&r&&typeof AbortController<"u"){o({type:"LOADING"});let n=new window.AbortController,i=n.signal;return r(e,{signal:i}).then(s=>{o({type:"RESOLVED",richData:s})}).catch(()=>{i.aborted||o({type:"ERROR"})}),()=>{n.abort()}}},[e]),t}var MI=rTe;var vt=l(w(),1),{Badge:nTe}=M(Lo.privateApis);function Ire({value:e,onEditClick:t,hasRichPreviews:o=!1,hasUnlinkControl:r=!1,onRemove:n}){let i=(0,VI.useSelect)(b=>b(Tre.store).get("core","showIconLabels"),[]),s=o?e?.url:null,{richData:a,isFetching:c}=MI(s),u=a&&Object.keys(a).length,d=e&&(0,DI.filterURLForDisplay)((0,DI.safeDecodeURI)(e.url),24)||"",f=!e?.url?.length,m=!f&&(0,Bre.__unstableStripHTML)(a?.title||e?.title||d),h;a?.icon?h=(0,vt.jsx)("img",{src:a?.icon,alt:""}):f?h=(0,vt.jsx)(we,{icon:oL,size:32}):h=(0,vt.jsx)(we,{icon:ov});let{createNotice:p}=(0,VI.useDispatch)(Ere.store),g=(0,Cre.useCopyToClipboard)(e.url,()=>{p("info",(0,Id.__)("Link copied to clipboard."),{isDismissible:!0,type:"snackbar"})});return(0,vt.jsx)(Lo.Flex,{role:"group","aria-label":(0,Id.__)("Manage link"),className:V("block-editor-link-control__preview",{"is-current":!0,"is-rich":u,"is-fetching":!!c,"is-preview":!0,"is-error":f,"is-url-title":m===d}),children:(0,vt.jsxs)(Lo.Flex,{gap:0,align:"flex-start",children:[(0,vt.jsxs)(Lo.Flex,{className:"block-editor-link-control__link-information",role:"figure","aria-label":(0,Id.__)("Link information"),justify:"start",align:"flex-start",children:[e?.image?(0,vt.jsx)(Lo.Flex,{className:"block-editor-link-control__preview-image",justify:"center",children:(0,vt.jsx)("img",{src:e?.image,alt:""})}):(0,vt.jsx)(Lo.Flex,{className:V("block-editor-link-control__preview-icon",{"is-image":a?.icon}),justify:"center",children:h}),(0,vt.jsx)(Lo.Flex,{className:"block-editor-link-control__preview-details",direction:"column",gap:2,children:f?(0,vt.jsx)("span",{className:"block-editor-link-control__preview-error-notice",children:(0,Id.__)("Link is empty")}):(0,vt.jsxs)(vt.Fragment,{children:[(0,vt.jsx)(Lo.ExternalLink,{className:"block-editor-link-control__preview-title",href:e.url,children:(0,vt.jsx)(Lo.__experimentalTruncate,{numberOfLines:1,children:m})}),(0,vt.jsx)("span",{className:"block-editor-link-control__preview-info",children:(0,vt.jsx)(Lo.__experimentalTruncate,{numberOfLines:1,children:d})}),e?.badges?.length>0&&(0,vt.jsx)(Lo.__experimentalHStack,{className:"block-editor-link-control__preview-badges",alignment:"left",gap:1,children:e.badges.map((b,v)=>(0,vt.jsx)(nTe,{intent:b.intent,children:b.label},`${b.label}|${b.intent}|${v}`))})]})})]}),(0,vt.jsx)(Lo.Button,{icon:Of,label:(0,Id.__)("Edit link"),onClick:t,size:"compact",showTooltip:!i}),r&&(0,vt.jsx)(Lo.Button,{icon:Ci,label:(0,Id.__)("Remove link"),onClick:n,size:"compact",showTooltip:!i}),(0,vt.jsx)(Lo.Button,{icon:nA,label:(0,Id.__)("Copy link"),ref:g,accessibleWhenDisabled:!0,disabled:f,size:"compact",showTooltip:!i}),(0,vt.jsx)(_re,{fillProps:e})]})})}var Pre=l(N(),1),FI=l(A(),1),Sb=l(w(),1),iTe=()=>{},sTe=({value:e,onChange:t=iTe,settings:o})=>{if(!o||!o.length)return null;let r=i=>s=>{t({...e,[i.id]:s})},n=o.map(i=>{if("render"in i){if(typeof i.render=="function"){let s=i.render(i,e,t);return(0,Sb.jsx)("div",{className:"block-editor-link-control__setting",children:s},i.id)}return null}return(0,Sb.jsx)(FI.CheckboxControl,{className:"block-editor-link-control__setting",label:i.title,onChange:r(i),checked:e?!!e[i.id]:!1,help:i?.help},i.id)}).filter(Boolean);return(0,Sb.jsxs)("fieldset",{className:"block-editor-link-control__settings",children:[(0,Sb.jsx)(FI.VisuallyHidden,{as:"legend",children:(0,Pre.__)("Currently selected link settings")}),n]})},Rre=sTe;var Ore=l(N(),1),Qm=l(R(),1);function Are(e){let t=(0,Qm.useRef)(),[o,r]=(0,Qm.useState)(!1),[n,i]=(0,Qm.useState)(null),s=async function(a){r(!0),i(null);try{return t.current=aTe(Promise.resolve(e(a))),await t.current.promise}catch(c){if(c&&c.isCanceled)return;throw i(c.message||(0,Ore.__)("An unknown error occurred during creation. Please try again.")),c}finally{r(!1)}};return(0,Qm.useEffect)(()=>()=>{t.current&&t.current.cancel()},[]),{createPage:s,isCreatingPage:o,errorMessage:n}}var aTe=e=>{let t=!1;return{promise:new Promise((r,n)=>{e.then(i=>t?n({isCanceled:!0}):r(i),i=>n(t?{isCanceled:!0}:i))}),cancel(){t=!0}}};var sF=l(R(),1),Mre=l(Nre(),1);function Dre(e){let[t,o]=(0,sF.useState)(e||{}),[r,n]=(0,sF.useState)(e);return(0,Mre.default)(e,r)||(n(e),o(e)),[t,o,c=>{o({...t,url:c})},c=>{o({...t,title:c})},c=>u=>{let d=Object.keys(u).reduce((f,m)=>(c.includes(m)&&(f[m]=u[m]),f),{});o({...t,...d})}]}var Pt=l(w(),1),lF=()=>{},Vre="core/block-editor",Fre="linkControlSettingsDrawer";function Jm({searchInputPlaceholder:e,value:t,settings:o=rF,onChange:r=lF,onInputChange:n,onRemove:i,onCancel:s,noDirectEntry:a=!1,showSuggestions:c=!0,showInitialSuggestions:u,forceIsEditingLink:d,createSuggestion:f,withCreateSuggestion:m,inputValue:h="",suggestionsQuery:p={},noURLSuggestion:g=!1,createSuggestionButtonText:b,hasRichPreviews:v=!1,hasTextControl:k=!1,renderControlBottom:y=null,handleEntities:S=!1}){m===void 0&&f&&(m=!0);let[x,C]=(0,no.useState)(!1),[B,I]=(0,no.useState)(void 0),{advancedSettingsPreference:P}=(0,zI.useSelect)(ge=>({advancedSettingsPreference:ge(aF.store).get(Vre,Fre)??!1}),[]),{set:E}=(0,zI.useDispatch)(aF.store),L=ge=>{E&&E(Vre,Fre,ge),C(ge)},T=P||x,O=(0,no.useRef)(!0),D=(0,no.useRef)(),U=(0,no.useRef)(),G=(0,no.useRef)(),j=(0,no.useRef)(),z=o.map(({id:ge})=>ge),[W,ee,se,ce,ie]=Dre(t),re=ge=>{se(ge),n?.(ge)},Q=S&&!!W?.id,Y=(0,zre.useInstanceId)(Jm,"link-control"),J=Q?`${Y}__help`:null,K=t&&!(0,Hre.isShallowEqualObjects)(W,t),[H,X]=(0,no.useState)(d!==void 0?d:!t||!t.url),{createPage:ne,isCreatingPage:le,errorMessage:ve}=Are(f);(0,no.useEffect)(()=>{d!==void 0&&X(d)},[d]),(0,no.useEffect)(()=>{if(O.current)return;(jre.focus.focusable.find(D.current)[0]||D.current).focus()},[H,le]),(0,no.useEffect)(()=>(O.current=!1,()=>{O.current=!0}),[]);let he=(0,no.useRef)();(0,no.useEffect)(()=>{if(he.current===void 0){he.current=h;return}he.current!==h&&(console.warn("LinkControl: The inputValue prop is uncontrolled and only sets the initial value. onInputChange is an observer for the input value. Changes to inputValue from the parent will not update the search input."),he.current=h)},[h]),(0,no.useEffect)(()=>{if(B?.type==="invalid"){let ge=G.current;ge&&typeof ge.reportValidity=="function"&&ge.reportValidity()}},[B]);let xe=t?.url?.trim()?.length>0,ze=()=>{X(!1)},ot=ge=>{let Ct={type:"invalid",message:(0,Qs.__)("Please enter a valid URL.")},Io={type:"valid"},Ke=ge?.trim();if(!Ke?.length||!kf(Ke))return Ct;if(gf(Ke)||bf(Ke))return Io;let te=(0,jI.prependHTTPS)(Ke);return(0,jI.isURL)(te)?Io:Ct},Wt=ge=>{if(!(ge&&ge.id&&ge.type&&!vb.includes(ge.type))){let Ke=ge?.url||$t,te=ot(Ke);if(te.type==="invalid"){I(te);return}let{url:Le}=YS(Ke);ge={...ge,url:Le}}ge?.kind==="taxonomy"&&ge?.url&&(j.current=ge.url);let Io=Object.keys(ge).reduce((Ke,te)=>(z.includes(te)||(Ke[te]=ge[te]),Ke),{});r({...W,...Io,title:W?.title||ge?.title}),I(void 0),ze()},fo=()=>{if(lr)return!1;let ge=$t.trim(),Ct=W&&W.id&&W.type&&!vb.includes(W.type),Io=t?.url===ge;if(Ct&&Io)return I(void 0),!0;let Ke=ot($t);return Ke.type==="invalid"?(I(Ke),!1):(I(void 0),!0)},Do=()=>{K&&r({...t,...W,url:YS($t).url}),ze(),I(void 0)},rt=()=>{fo()&&Do()},ar=ge=>{let{keyCode:Ct}=ge;Ct===Ure.ENTER&&!lr&&(ge.preventDefault(),rt())},xt=()=>{ee(t)},At=ge=>{ge.preventDefault(),ge.stopPropagation(),xt(),I(void 0),xe?ze():i?.(),s?.()},[Pe,wt]=(0,no.useState)(!1),qo=()=>{let{id:ge,kind:Ct,type:Io,...Ke}=W;ee({...Ke,id:void 0,kind:void 0,type:void 0,url:void 0}),wt(!0)};(0,no.useEffect)(()=>{Pe&&(G.current?.focus(),wt(!1))},[Pe]);let $t=W?.url!==void 0?W.url:h||"",lr=!$t?.trim()?.length;(0,no.useEffect)(()=>{I(void 0)},[$t]);let ln=!B,je=i&&t&&!H&&!le,Eo=H&&xe,Ze=xe&&k,Ve=(H||!t)&&!le,gt=lr||!ln||t&&!K,To=!!o?.length&&H&&xe,cr=(0,no.useMemo)(()=>t?.kind==="taxonomy"&&!t?.url&&j.current?{...t,url:j.current}:t,[t]);return(0,Pt.jsxs)("div",{tabIndex:-1,ref:D,className:"block-editor-link-control",children:[le&&(0,Pt.jsxs)("div",{className:"block-editor-link-control__loading",children:[(0,Pt.jsx)(Qr.Spinner,{})," ",(0,Qs.__)("Creating"),"\u2026"]}),Ve&&(0,Pt.jsxs)(Pt.Fragment,{children:[(0,Pt.jsxs)("div",{className:V({"block-editor-link-control__search-input-wrapper":!0,"has-text-control":Ze,"has-actions":Eo}),children:[Ze&&(0,Pt.jsx)(Qr.TextControl,{ref:U,className:"block-editor-link-control__field block-editor-link-control__text-content",label:(0,Qs.__)("Text"),value:W?.title,onChange:ce,onKeyDown:ar,__next40pxDefaultSize:!0}),(0,Pt.jsx)(vre,{ref:G,currentLink:t,className:"block-editor-link-control__field block-editor-link-control__search-input",placeholder:e,value:$t,withCreateSuggestion:m,onCreateSuggestion:ne,onChange:re,onSelect:Wt,showInitialSuggestions:u,allowDirectEntry:!a,showSuggestions:c,suggestionsQuery:p,withURLSuggestion:!g,createSuggestionButtonText:b,hideLabelFromVision:!Ze,isEntity:Q,customValidity:B,suffix:(0,Pt.jsx)(lTe,{isEntity:Q,showActions:Eo,isDisabled:gt,onUnlink:qo,onSubmit:rt,helpTextId:J})}),Q&&J&&(0,Pt.jsx)("p",{id:J,className:"block-editor-link-control__help",children:(0,Qs.sprintf)((0,Qs.__)("Synced with the selected %s."),W?.type||"item")})]}),ve&&(0,Pt.jsx)(Qr.Notice,{className:"block-editor-link-control__search-error",status:"error",isDismissible:!1,children:ve})]}),t&&!H&&!le&&(0,Pt.jsx)(Ire,{value:cr,onEditClick:()=>X(!0),hasRichPreviews:v,hasUnlinkControl:je,onRemove:()=>{i(),X(!0)}},cr?.url),To&&(0,Pt.jsx)("div",{className:"block-editor-link-control__tools",children:!lr&&(0,Pt.jsx)(Qoe,{settingsOpen:T,setSettingsOpen:L,children:(0,Pt.jsx)(Rre,{value:W,settings:o,onChange:ie(z)})})}),Eo&&(0,Pt.jsxs)(Qr.__experimentalHStack,{justify:"right",className:"block-editor-link-control__search-actions",children:[(0,Pt.jsx)(Qr.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:At,children:(0,Qs.__)("Cancel")}),(0,Pt.jsx)(Qr.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:gt?lF:rt,className:"block-editor-link-control__search-submit","aria-disabled":gt,children:(0,Qs.__)("Apply")})]}),!le&&y&&y()]})}function lTe({isEntity:e,showActions:t,isDisabled:o,onUnlink:r,onSubmit:n,helpTextId:i}){if(e)return(0,Pt.jsx)(Qr.Button,{icon:Ci,onClick:r,"aria-describedby":i,showTooltip:!0,label:(0,Qs.__)("Unsync and edit"),__next40pxDefaultSize:!0});if(!t)return(0,Pt.jsx)(Qr.__experimentalInputControlSuffixWrapper,{variant:"control",children:(0,Pt.jsx)(Qr.Button,{onClick:o?lF:n,label:(0,Qs.__)("Submit"),icon:bl,className:"block-editor-link-control__search-submit","aria-disabled":o,size:"small"})})}Jm.ViewerFill=xre;Jm.DEFAULT_LINK_SETTINGS=rF;var UI=e=>((0,Gre.default)("wp.blockEditor.__experimentalLinkControl",{since:"6.8",alternative:"wp.blockEditor.LinkControl"}),(0,Pt.jsx)(Jm,{...e}));UI.ViewerFill=Jm.ViewerFill;UI.DEFAULT_LINK_SETTINGS=Jm.DEFAULT_LINK_SETTINGS;var Pd=Jm;var $re=l(N(),1),Kre=l(A(),1),Yre=l(Re(),1);var qS=1.5,cF=.01,uF=10,dF="";function Wre(e){return e!==void 0&&e!==dF}var fF=l(w(),1),cTe=({__next40pxDefaultSize:e=!1,value:t,onChange:o,__unstableInputWidth:r="60px",...n})=>{let i=Wre(t),s=(d,f)=>{if(i)return d;let m=cF*uF;switch(`${d}`){case`${m}`:return qS+m;case"0":return f?d:qS-m;case"":return qS;default:return d}},a=(d,f)=>{let m=["insertText","insertFromPaste"].includes(f.payload.event.nativeEvent?.inputType),h=s(d.value,m);return{...d,value:h}},c=i?t:dF,u=(d,{event:f})=>{if(d===""){o();return}if(f.type==="click"){o(s(`${d}`,!1));return}o(`${d}`)};return!e&&(n.size===void 0||n.size==="default")&&(0,Yre.default)("36px default size for wp.blockEditor.LineHeightControl",{since:"6.8",version:"7.1",hint:"Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version."}),(0,fF.jsx)("div",{className:"block-editor-line-height-control",children:(0,fF.jsx)(Kre.__experimentalNumberControl,{...n,__shouldNotWarnDeprecated36pxSize:!0,__next40pxDefaultSize:e,__unstableInputWidth:r,__unstableStateReducer:a,onChange:u,label:(0,$re.__)("Line height"),placeholder:qS,step:cF,spinFactor:uF,value:c,min:0,spinControls:"custom"})})},HI=cTe;var Ha=l(N(),1),qre=l(Xo(),1),Jr=l(A(),1),WI=l(F(),1),Zre=l(it(),1);var Xre=l(Z(),1),Qre=l(Fe(),1),Jre=l(Un(),1),ene=l(R(),1);function GI(e,t,o){if(o)return o;if(!t||typeof t!="object"||Object.keys(t).length===0)return e&&e.length>0?e.map(n=>`${n}/*`).join(","):void 0;if(!e||e.length===0)return;let r=[];for(let[,n]of Object.entries(t))e.some(s=>s.includes("/")?n===s:n.startsWith(`${s}/`))&&r.push(n);return r.length>0?r.join(","):e.map(n=>`${n}/*`).join(",")}var rr=l(w(),1),uTe=()=>{},dTe=0,fTe=({mediaURL:e,mediaId:t,mediaIds:o,allowedTypes:r,accept:n,onError:i,onSelect:s,onSelectURL:a,onReset:c,onToggleFeaturedImage:u,useFeaturedImage:d,onFilesUpload:f=uTe,name:m=(0,Ha.__)("Replace"),createNotice:h,removeNotice:p,children:g,multiple:b=!1,addToGallery:v,handleUpload:k=!0,variant:y,popoverProps:S,renderToggle:x,className:C})=>{let{mediaUpload:B,allowedMimeTypes:I}=(0,WI.useSelect)(z=>{let{getSettings:W}=z(_),ee=W();return{mediaUpload:ee.mediaUpload,allowedMimeTypes:ee.allowedMimeTypes}},[]),P=`block-editor/media-replace-flow/error-notice/${++dTe}`,E=(0,ene.useMemo)(()=>GI(r,I,n),[r,I,n]),L=z=>{let W=(0,Qre.__unstableStripHTML)(z);if(i){i(W);return}setTimeout(()=>{h("error",W,{speak:!0,id:P,isDismissible:!0})},1e3)},T=(z,W)=>{d&&u&&u(),W(),s(z),(0,qre.speak)((0,Ha.__)("The media file has been replaced")),p(P)},O=(z,W)=>{let ee=z.target.files;if(!k)return W(),s(ee);f(ee),B({allowedTypes:r,filesList:ee,onFileChange:([se])=>{T(se,W)},onError:L})},D=z=>{z.keyCode===Zre.DOWN&&(z.preventDefault(),z.target.click())},G=b&&(!r||r.length===0?!1:r.every(z=>z==="image"||z.startsWith("image/"))),j={...S,variant:y};return(0,rr.jsx)(Jr.Dropdown,{popoverProps:j,className:C,contentClassName:V("block-editor-media-replace-flow__options",y&&`is-variant-${y}`),renderToggle:({isOpen:z,onToggle:W})=>x?x({"aria-expanded":z,"aria-haspopup":"true",onClick:W,onKeyDown:D,children:m}):(0,rr.jsx)(Jr.ToolbarButton,{"aria-expanded":z,"aria-haspopup":"true",onClick:W,onKeyDown:D,children:m}),renderContent:({onClose:z})=>(0,rr.jsxs)(rr.Fragment,{children:[(0,rr.jsxs)(Jr.NavigableMenu,{className:"block-editor-media-replace-flow__media-upload-menu",children:[(0,rr.jsxs)(Ds,{children:[(0,rr.jsx)(qu,{gallery:G,addToGallery:v,multiple:b,value:b?o:t,onSelect:W=>T(W,z),allowedTypes:r,render:({open:W})=>(0,rr.jsx)(Jr.MenuItem,{icon:jp,onClick:W,children:(0,Ha.__)("Open Media Library")})}),(0,rr.jsx)(Jr.FormFileUpload,{onChange:W=>{O(W,z)},accept:E,multiple:!!b,render:({openFileDialog:W})=>(0,rr.jsx)(Jr.MenuItem,{icon:NN,onClick:()=>{W()},children:(0,Ha._x)("Upload","verb")})})]}),u&&(0,rr.jsx)(Jr.MenuItem,{icon:GL,onClick:u,isPressed:d,children:(0,Ha.__)("Use featured image")}),typeof g=="function"?g({onClose:z}):g,e&&c&&(0,rr.jsx)(Jr.MenuItem,{onClick:()=>{c(),z()},children:(0,Ha.__)("Reset")})]}),a&&(0,rr.jsxs)("form",{className:"block-editor-media-flow__url-input",children:[(0,rr.jsx)("span",{className:"block-editor-media-replace-flow__image-url-label",children:(0,Ha.__)("Current media URL:")}),(0,rr.jsx)(Pd,{value:{url:e},settings:[],showSuggestions:!1,onChange:({url:W})=>{a(W)},searchInputPlaceholder:(0,Ha.__)("Paste or type URL")})]})]})})},_b=(0,Xre.compose)([(0,WI.withDispatch)(e=>{let{createNotice:t,removeNotice:o}=e(Jre.store);return{createNotice:t,removeNotice:o}}),(0,Jr.withFilters)("editor.MediaReplaceFlow")])(fTe);var _o=l(A(),1),So=l(N(),1),Ld=l(R(),1),pne=l(F(),1);var hne=l(Re(),1);var pF=l(N(),1),KI=l(R(),1),xb=l(A(),1);var mne=l(Re(),1);var rne=l(N(),1),nne=l(A(),1);var tne=l(A(),1),$I=l(dn(),1),mF=l(w(),1);function one({url:e,urlLabel:t,className:o}){let r=V(o,"block-editor-url-popover__link-viewer-url");return e?(0,mF.jsx)(tne.ExternalLink,{className:r,href:e,children:t||(0,$I.filterURLForDisplay)((0,$I.safeDecodeURI)(e))}):(0,mF.jsx)("span",{className:r})}var ZS=l(w(),1);function ine({className:e,linkClassName:t,onEditLinkClick:o,url:r,urlLabel:n,...i}){return(0,ZS.jsxs)("div",{className:V("block-editor-url-popover__link-viewer",e),...i,children:[(0,ZS.jsx)(one,{url:r,urlLabel:n,className:t}),o&&(0,ZS.jsx)(nne.Button,{icon:Of,label:(0,rne.__)("Edit"),onClick:o,size:"compact"})]})}var une=l(N(),1),dne=l(A(),1);var kc=l(N(),1),XS=l(R(),1),Js=l(it(),1),Tn=l(A(),1),Rd=l(Z(),1),sne=l(F(),1),ane=l(dn(),1);var Ga=l(w(),1),lne=l(jr(),1),{ValidatedInputControl:mTe}=M(Tn.privateApis);function cne(e){return typeof e=="function"}var pTe=class extends XS.Component{constructor(e){super(e),this.onChange=this.onChange.bind(this),this.onFocus=this.onFocus.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.selectLink=this.selectLink.bind(this),this.handleOnClick=this.handleOnClick.bind(this),this.bindSuggestionNode=this.bindSuggestionNode.bind(this),this.autocompleteRef=e.autocompleteRef||(0,XS.createRef)(),this.inputRef=e.inputRef||(0,XS.createRef)(),this.hasRenderedValidation={current:!1},this.updateSuggestions=(0,Rd.debounce)(this.updateSuggestions.bind(this),200),this.suggestionNodes=[],this.suggestionsRequest=null,this.state={suggestions:[],showSuggestions:!1,suggestionsValue:null,selectedSuggestion:null,suggestionsListboxId:"",suggestionOptionIdPrefix:""}}componentDidUpdate(e){let{showSuggestions:t,selectedSuggestion:o}=this.state,{value:r,__experimentalShowInitialSuggestions:n=!1}=this.props;t&&o!==null&&this.suggestionNodes[o]&&this.suggestionNodes[o].scrollIntoView({behavior:"instant",block:"nearest",inline:"nearest"}),e.value!==r&&!this.props.disableSuggestions&&(r?.length?this.updateSuggestions(r):n&&this.updateSuggestions())}componentDidMount(){this.shouldShowInitialSuggestions()&&this.updateSuggestions()}componentWillUnmount(){this.suggestionsRequest?.cancel?.(),this.suggestionsRequest=null}bindSuggestionNode(e){return t=>{this.suggestionNodes[e]=t}}shouldShowInitialSuggestions(){let{__experimentalShowInitialSuggestions:e=!1,value:t}=this.props;return e&&!(t&&t.length)}updateSuggestions(e=""){let{__experimentalFetchLinkSuggestions:t,__experimentalHandleURLSuggestions:o}=this.props;if(!t)return;let r=!e?.length;if(e=e.trim(),!r&&(e.length<2||!o&&(0,ane.isURL)(e))){this.suggestionsRequest?.cancel?.(),this.suggestionsRequest=null,this.setState({suggestions:[],showSuggestions:!1,suggestionsValue:e,selectedSuggestion:null,loading:!1});return}this.setState({selectedSuggestion:null,loading:!0});let n=t(e,{isInitialSuggestions:r});n.then(i=>{this.suggestionsRequest===n&&(this.setState({suggestions:i,suggestionsValue:e,loading:!1,showSuggestions:!!i.length}),i.length?this.props.debouncedSpeak((0,kc.sprintf)((0,kc._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",i.length),i.length),"assertive"):this.props.debouncedSpeak((0,kc.__)("No results."),"assertive"))}).catch(()=>{this.suggestionsRequest===n&&this.setState({loading:!1})}).finally(()=>{this.suggestionsRequest===n&&(this.suggestionsRequest=null)}),this.suggestionsRequest=n}onChange(e){this.props.onChange(e)}onFocus(){let{suggestions:e}=this.state,{disableSuggestions:t,value:o}=this.props;o&&!t&&!(e&&e.length)&&this.suggestionsRequest===null&&this.updateSuggestions(o)}onKeyDown(e){this.props.onKeyDown?.(e);let{showSuggestions:t,selectedSuggestion:o,suggestions:r,loading:n}=this.state;if(!t||!r.length||n){switch(e.keyCode){case Js.UP:{e.target.selectionStart!==0&&(e.preventDefault(),e.target.setSelectionRange(0,0));break}case Js.DOWN:{this.props.value.length!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(this.props.value.length,this.props.value.length));break}case Js.ENTER:{this.props.onSubmit&&(e.preventDefault(),this.props.onSubmit(null,e));break}}return}let i=this.state.suggestions[this.state.selectedSuggestion];switch(e.keyCode){case Js.UP:{e.preventDefault();let s=o?o-1:r.length-1;this.setState({selectedSuggestion:s});break}case Js.DOWN:{e.preventDefault();let s=o===null||o===r.length-1?0:o+1;this.setState({selectedSuggestion:s});break}case Js.TAB:{this.state.selectedSuggestion!==null&&(this.selectLink(i),this.props.speak((0,kc.__)("Link selected.")));break}case Js.ENTER:{e.preventDefault(),this.state.selectedSuggestion!==null?(this.selectLink(i),this.props.onSubmit&&this.props.onSubmit(i,e)):this.props.onSubmit&&this.props.onSubmit(null,e);break}}}selectLink(e){this.props.onChange(e.url,e),this.setState({selectedSuggestion:null,showSuggestions:!1})}handleOnClick(e){this.selectLink(e),this.inputRef.current.focus()}static getDerivedStateFromProps({value:e,instanceId:t,disableSuggestions:o,__experimentalShowInitialSuggestions:r=!1},{showSuggestions:n}){let i=n,s=e&&e.length;return!r&&!s&&(i=!1),o===!0&&(i=!1),{showSuggestions:i,suggestionsListboxId:`block-editor-url-input-suggestions-${t}`,suggestionOptionIdPrefix:`block-editor-url-input-suggestion-${t}`}}render(){return(0,Ga.jsxs)(Ga.Fragment,{children:[this.renderControl(),this.renderSuggestions()]})}renderControl(){let{label:e=null,className:t,isFullWidth:o,instanceId:r,placeholder:n=(0,kc.__)("Paste URL or type to search"),__experimentalRenderControl:i,value:s="",hideLabelFromVision:a=!1,help:c=null,disabled:u=!1,customValidity:d,markWhenOptional:f}=this.props,{loading:m,showSuggestions:h,selectedSuggestion:p,suggestionsListboxId:g,suggestionOptionIdPrefix:b}=this.state,v=`url-input-control-${r}`,k={id:v,label:e,className:V("block-editor-url-input",t,{"is-full-width":o}),hideLabelFromVision:a},y={id:v,value:s,required:this.props.required??!0,type:"text",name:v,autoComplete:"off",onChange:u?()=>{}:this.onChange,onFocus:u?()=>{}:this.onFocus,placeholder:n,onKeyDown:u?()=>{}:this.onKeyDown,role:"combobox","aria-label":e?void 0:(0,kc.__)("URL"),"aria-expanded":h,"aria-autocomplete":"list","aria-owns":g,"aria-activedescendant":p!==null?`${b}-${p}`:void 0,ref:this.inputRef,disabled:u,suffix:this.props.suffix,help:c},S={customValidity:d,...f!==void 0&&{markWhenOptional:f}};if(i)return i(k,y,m);d!==void 0&&(this.hasRenderedValidation.current=!0);let x=this.hasRenderedValidation.current?mTe:Tn.__experimentalInputControl;return(0,Ga.jsxs)(Tn.BaseControl,{...k,children:[(0,Ga.jsx)(x,{...y,...this.hasRenderedValidation.current?S:{},__next40pxDefaultSize:!0}),m&&(0,Ga.jsx)(Tn.Spinner,{})]})}renderSuggestions(){let{className:e,__experimentalRenderSuggestions:t}=this.props,{showSuggestions:o,suggestions:r,suggestionsValue:n,selectedSuggestion:i,suggestionsListboxId:s,suggestionOptionIdPrefix:a,loading:c}=this.state;if(!o||r.length===0)return null;let u={id:s,ref:this.autocompleteRef,role:"listbox"},d=(f,m)=>({role:"option",tabIndex:"-1",id:`${a}-${m}`,ref:this.bindSuggestionNode(m),"aria-selected":m===i?!0:void 0});return cne(t)?t({suggestions:r,selectedSuggestion:i,suggestionsListProps:u,buildSuggestionItemProps:d,isLoading:c,handleSuggestionClick:this.handleOnClick,isInitialSuggestions:!n?.length,currentInputValue:n}):(0,Ga.jsx)(Tn.Popover,{placement:"bottom",focusOnMount:!1,children:(0,Ga.jsx)("div",{...u,className:V("block-editor-url-input__suggestions",{[`${e}__suggestions`]:e}),children:r.map((f,m)=>(0,lne.createElement)(Tn.Button,{__next40pxDefaultSize:!0,...d(f,m),key:f.id,className:V("block-editor-url-input__suggestion",{"is-selected":m===i}),onClick:()=>this.handleOnClick(f)},f.title))})})}},Td=(0,Rd.compose)(Rd.withSafeTimeout,Tn.withSpokenMessages,Rd.withInstanceId,(0,sne.withSelect)((e,t)=>{if(cne(t.__experimentalFetchLinkSuggestions))return;let{getSettings:o}=e(_);return{__experimentalFetchLinkSuggestions:o().__experimentalFetchLinkSuggestions}}))(pTe);var QS=l(w(),1);function fne({autocompleteRef:e,className:t,onChangeInputValue:o,value:r,...n}){return(0,QS.jsxs)("form",{className:V("block-editor-url-popover__link-editor",t),...n,children:[(0,QS.jsx)(Td,{value:r,onChange:o,autocompleteRef:e}),(0,QS.jsx)(dne.Button,{icon:bl,label:(0,une.__)("Apply"),type:"submit",size:"compact"})]})}var Od=l(w(),1),{__experimentalPopoverLegacyPositionToPlacement:hTe}=M(xb.privateApis),gTe="bottom",hF=(0,KI.forwardRef)(({additionalControls:e,children:t,renderSettings:o,placement:r,focusOnMount:n="firstElement",position:i,...s},a)=>{i!==void 0&&(0,mne.default)("`position` prop in wp.blockEditor.URLPopover",{since:"6.2",alternative:"`placement` prop"});let c;r!==void 0?c=r:i!==void 0&&(c=hTe(i)),c=c||gTe;let[u,d]=(0,KI.useState)(!1),f=!!o&&u,m=()=>{d(!u)};return(0,Od.jsxs)(xb.Popover,{ref:a,role:"dialog","aria-modal":"true","aria-label":(0,pF.__)("Edit URL"),className:"block-editor-url-popover",focusOnMount:n,placement:c,shift:!0,variant:"toolbar",...s,children:[(0,Od.jsx)("div",{className:"block-editor-url-popover__input-container",children:(0,Od.jsxs)("div",{className:"block-editor-url-popover__row",children:[t,!!o&&(0,Od.jsx)(xb.Button,{className:"block-editor-url-popover__settings-toggle",icon:zn,label:(0,pF.__)("Link settings"),onClick:m,"aria-expanded":u,size:"compact"})]})}),f&&(0,Od.jsx)("div",{className:"block-editor-url-popover__settings",children:o()}),e&&!f&&(0,Od.jsx)("div",{className:"block-editor-url-popover__additional-controls",children:e})]})});hF.LinkEditor=fne;hF.LinkViewer=ine;var Ad=hF;var Ge=l(w(),1),bTe=()=>{},kTe=({src:e,onChange:t,onSubmit:o,onClose:r,popoverAnchor:n})=>(0,Ge.jsx)(Ad,{anchor:n,onClose:r,children:(0,Ge.jsx)("form",{className:"block-editor-media-placeholder__url-input-form",onSubmit:o,children:(0,Ge.jsx)(_o.__experimentalInputControl,{__next40pxDefaultSize:!0,label:(0,So.__)("URL"),type:"text",hideLabelFromVision:!0,placeholder:(0,So.__)("Paste or type URL"),onChange:t,value:e,suffix:(0,Ge.jsx)(_o.__experimentalInputControlSuffixWrapper,{variant:"control",children:(0,Ge.jsx)(_o.Button,{size:"small",icon:bl,label:(0,So.__)("Apply"),type:"submit"})})})})}),vTe=({src:e,onChangeSrc:t,onSelectURL:o})=>{let[r,n]=(0,Ld.useState)(null),[i,s]=(0,Ld.useState)(!1),a=()=>{s(!0)},c=()=>{s(!1),r?.focus()},u=d=>{d.preventDefault(),e&&o&&(o(e),c())};return(0,Ge.jsxs)("div",{className:"block-editor-media-placeholder__url-input-container",children:[(0,Ge.jsx)(_o.Button,{__next40pxDefaultSize:!0,className:"block-editor-media-placeholder__button",onClick:a,isPressed:i,variant:"secondary","aria-haspopup":"dialog",ref:n,children:(0,So.__)("Insert from URL")}),i&&(0,Ge.jsx)(kTe,{src:e,onChange:t,onSubmit:u,onClose:c,popoverAnchor:r})]})};function yTe({value:e={},allowedTypes:t,className:o,icon:r,labels:n={},mediaPreview:i,notices:s,isAppender:a,accept:c,addToGallery:u,multiple:d=!1,handleUpload:f=!0,disableDropZone:m,disableMediaButtons:h,onError:p,onSelect:g,onCancel:b,onSelectURL:v,onToggleFeaturedImage:k,onDoubleClick:y,onFilesPreUpload:S=bTe,onHTMLDrop:x,children:C,mediaLibraryButton:B,placeholder:I,style:P}){x&&(0,hne.default)("wp.blockEditor.MediaPlaceholder onHTMLDrop prop",{since:"6.2",version:"6.4"});let{mediaUpload:E,allowedMimeTypes:L}=(0,pne.useSelect)(Y=>{let{getSettings:J}=Y(_),K=J();return{mediaUpload:K.mediaUpload,allowedMimeTypes:K.allowedMimeTypes}},[]),[T,O]=(0,Ld.useState)("");(0,Ld.useEffect)(()=>{O(e?.src??"")},[e?.src]);let D=(0,Ld.useMemo)(()=>GI(t,L,c),[t,L,c]),U=()=>!t||t.length===0?!1:t.every(Y=>Y==="image"||Y.startsWith("image/")),G=Y=>{if(!f||typeof f=="function"&&!f(Y))return g(Y);S(Y);let J;if(d)if(u){let K=[];J=H=>{let X=(e??[]).filter(ne=>ne.id?!K.some(({id:le})=>Number(le)===Number(ne.id)):!K.some(({urlSlug:le})=>ne.url.includes(le)));g(X.concat(H)),K=H.map(ne=>{let le=ne.url.lastIndexOf("."),ve=ne.url.slice(0,le);return{id:ne.id,urlSlug:ve}})}}else J=g;else J=([K])=>g(K);E({allowedTypes:t,filesList:Y,onFileChange:J,onError:p,multiple:d})};async function j(Y){let{blocks:J}=tV(Y);if(!J?.length)return;let K=await Promise.all(J.map(H=>{let X=H.name.split("/")[1];return H.attributes.id?(H.attributes.type=X,H.attributes):new Promise((ne,le)=>{window.fetch(H.attributes.url).then(ve=>ve.blob()).then(ve=>E({filesList:[ve],additionalData:{title:H.attributes.title,alt_text:H.attributes.alt,caption:H.attributes.caption,type:X},onFileChange:([he])=>{he.id&&ne(he)},allowedTypes:t,onError:le})).catch(()=>ne(H.attributes.url))})})).catch(H=>p(H));K?.length&&g(d?K:K[0])}let z=Y=>{G(Y.target.files)},ee=I??(Y=>{let{instructions:J,title:K}=n;if(!E&&!v&&(J=(0,So.__)("To edit this block, you need permission to upload media.")),J===void 0||K===void 0){let X=t??[],[ne]=X,le=X.length===1,ve=le&&ne==="audio",he=le&&ne==="image",xe=le&&ne==="video";J===void 0&&E&&(J=(0,So.__)("Drag and drop an image or video, upload, or choose from your library."),ve?J=(0,So.__)("Drag and drop an audio file, upload, or choose from your library."):he?J=(0,So.__)("Drag and drop an image, upload, or choose from your library."):xe&&(J=(0,So.__)("Drag and drop a video, upload, or choose from your library."))),K===void 0&&(K=(0,So.__)("Media"),ve?K=(0,So.__)("Audio"):he?K=(0,So.__)("Image"):xe&&(K=(0,So.__)("Video")))}let H=V("block-editor-media-placeholder",o,{"is-appender":a});return(0,Ge.jsxs)(_o.Placeholder,{icon:r,label:K,instructions:J,className:H,notices:s,onDoubleClick:y,preview:i,style:P,children:[Y,C]})}),se=()=>m?null:(0,Ge.jsx)(_o.DropZone,{onFilesDrop:G,onDrop:j,isEligible:Y=>{let J="wp-block:core/",K=[];for(let H of Y.types)H.startsWith(J)&&K.push(H.slice(J.length));return K.every(H=>t.includes(H))&&(d?!0:K.length===1)}}),ce=()=>b&&(0,Ge.jsx)(_o.Button,{__next40pxDefaultSize:!0,className:"block-editor-media-placeholder__cancel-button",title:(0,So.__)("Cancel"),variant:"link",onClick:b,children:(0,So.__)("Cancel")}),ie=()=>v&&(0,Ge.jsx)(vTe,{src:T,onChangeSrc:O,onSelectURL:v}),re=()=>k&&(0,Ge.jsx)("div",{className:"block-editor-media-placeholder__url-input-container",children:(0,Ge.jsx)(_o.Button,{__next40pxDefaultSize:!0,className:"block-editor-media-placeholder__button",onClick:k,variant:"secondary",children:(0,So.__)("Use featured image")})}),Q=()=>{let J=B??(({open:H})=>(0,Ge.jsx)(_o.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>{H()},children:(0,So.__)("Media Library")})),K=(0,Ge.jsx)(qu,{addToGallery:u,gallery:d&&U(),multiple:d,onSelect:g,allowedTypes:t,mode:"browse",value:Array.isArray(e)?e.map(({id:H})=>H):e.id,render:J});if(E&&a)return(0,Ge.jsxs)(Ge.Fragment,{children:[se(),(0,Ge.jsx)(_o.FormFileUpload,{onChange:z,accept:D,multiple:!!d,render:({openFileDialog:H})=>{let X=(0,Ge.jsxs)(Ge.Fragment,{children:[(0,Ge.jsx)(_o.Button,{__next40pxDefaultSize:!0,variant:"primary",className:V("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onClick:H,children:(0,So._x)("Upload","verb")}),K,ie(),re(),ce()]});return ee(X)}})]});if(E){let H=(0,Ge.jsxs)(Ge.Fragment,{children:[se(),(0,Ge.jsx)(_o.FormFileUpload,{render:({openFileDialog:X})=>(0,Ge.jsx)(_o.Button,{__next40pxDefaultSize:!0,onClick:X,variant:"primary",className:V("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),children:(0,So._x)("Upload","verb")}),onChange:z,accept:D,multiple:!!d}),K,ie(),re(),ce()]});return ee(H)}return ee(K)};return h?(0,Ge.jsx)(Ds,{children:se()}):(0,Ge.jsx)(Ds,{fallback:ee(ie()),children:Q()})}var gne=(0,_o.withFilters)("editor.MediaPlaceholder")(yTe);var bne=l(w(),1),STe=({colorSettings:e,...t})=>{let o=e.map(r=>{if(!r)return r;let{value:n,onChange:i,...s}=r;return{...s,colorValue:n,onColorChange:i}});return(0,bne.jsx)(pI,{settings:o,gradients:[],disableCustomGradients:!0,...t})},kne=STe;var pie=l(FM(),1);var hie=l(R(),1);var die=l(R(),1);var iie=l(yf(),1),nr=l(R(),1),Md=l(F(),1),lP=l(Z(),1),sie=l(dr(),1),aie=l(A(),1),lie=l($(),1),cie=l(Re(),1),Ab=l(N(),1);var vne=l(N(),1),YI=l(A(),1);var gF=l(N(),1),ep=l(A(),1);var vc=l(w(),1),_Te={placement:"bottom-start"},xTe=()=>(0,vc.jsxs)(vc.Fragment,{children:[["bold","italic","link","unknown"].map(e=>(0,vc.jsx)(ep.Slot,{name:`RichText.ToolbarControls.${e}`},e)),(0,vc.jsx)(ep.Slot,{name:"RichText.ToolbarControls",children:e=>{if(!e.length)return null;let o=e.map(([{props:r}])=>r).some(({isActive:r})=>r);return(0,vc.jsx)(ep.ToolbarItem,{children:r=>(0,vc.jsx)(ep.DropdownMenu,{icon:zn,label:(0,gF.__)("More"),toggleProps:{...r,className:V(r.className,{"is-pressed":o}),description:(0,gF.__)("Displays more block tools")},controls:ma(e.map(([{props:n}])=>n),"title"),popoverProps:_Te})})}})]}),bF=xTe;var Nd=l(w(),1);function wTe({popoverAnchor:e}){return(0,Nd.jsx)(YI.Popover,{placement:"top",focusOnMount:!1,anchor:e,className:"block-editor-rich-text__inline-format-toolbar",__unstableSlotName:"block-toolbar",children:(0,Nd.jsx)(Bg,{className:"block-editor-rich-text__inline-format-toolbar-group","aria-label":(0,vne.__)("Format tools"),children:(0,Nd.jsx)(YI.ToolbarGroup,{children:(0,Nd.jsx)(bF,{})})})})}var CTe=({inline:e,editableContentElement:t})=>e?(0,Nd.jsx)(wTe,{popoverAnchor:t}):(0,Nd.jsx)(Mt,{group:"inline",children:(0,Nd.jsx)(bF,{})}),yne=CTe;var qI=l(R(),1),Sne=l(F(),1);function _ne({html:e,value:t}){let o=(0,qI.useRef)(),r=!!t.activeFormats?.length,{__unstableMarkLastChangeAsPersistent:n}=(0,Sne.useDispatch)(_);(0,qI.useLayoutEffect)(()=>{if(!o.current){o.current=t.text;return}if(o.current!==t.text){let i=window.setTimeout(()=>{n()},1e3);return o.current=t.text,()=>{window.clearTimeout(i)}}n()},[e,r])}var Bb=l(R(),1),jne=l(Z(),1);var JS=l(dr(),1),xne=l(ut(),1);var BTe=["`",'"',"'","\u201C\u201D","\u2018\u2019"],wne=e=>t=>{function o(r){let{inputType:n,data:i}=r,{value:s,onChange:a,registry:c}=e.current;if(n!=="insertText"||(0,JS.isCollapsed)(s))return;let u=(0,xne.applyFilters)("blockEditor.wrapSelectionSettings",BTe).find(([x,C])=>x===i||C===i);if(!u)return;let[d,f=d]=u,m=s.start,h=s.end+d.length,p=(0,JS.insert)(s,d,m,m);p=(0,JS.insert)(p,f,h,h);let{__unstableMarkLastChangeAsPersistent:g,__unstableMarkAutomaticChange:b}=c.dispatch(_);g(),a(p),b();let v={};for(let x in r)v[x]=r[x];v.data=f;let{ownerDocument:k}=t,{defaultView:y}=k,S=new y.InputEvent("input",v);window.queueMicrotask(()=>{r.target.dispatchEvent(S)}),r.preventDefault()}return t.addEventListener("beforeinput",o),()=>{t.removeEventListener("beforeinput",o)}};var ZI=l(dr(),1),wb=l($(),1);var Cne=l(dr(),1);function Bne(e){let t="tales of gutenberg",o=" \u{1F421}\u{1F422}\u{1F980}\u{1F424}\u{1F98B}\u{1F418}\u{1F427}\u{1F439}\u{1F981}\u{1F984}\u{1F98D}\u{1F43C}\u{1F43F}\u{1F383}\u{1F434}\u{1F41D}\u{1F406}\u{1F995}\u{1F994}\u{1F331}\u{1F347}\u03C0\u{1F34C}\u{1F409}\u{1F4A7}\u{1F968}\u{1F30C}\u{1F342}\u{1F360}\u{1F966}\u{1F95A}\u{1F95D}\u{1F39F}\u{1F965}\u{1F952}\u{1F6F5}\u{1F956}\u{1F352}\u{1F36F}\u{1F3BE}\u{1F3B2}\u{1F43A}\u{1F41A}\u{1F42E}\u231B\uFE0F",{start:r,text:n}=e;return r<t.length||n.slice(r-t.length,r).toLowerCase()!==t?e:(0,Cne.insert)(e,o)}function Ene(e){let t=e.length;for(;t--;){let o=Lv(e[t].attributes);if(o)return e[t].attributes[o]=e[t].attributes[o].toString().replace(wl,""),[e[t].clientId,o,0,0];let r=Ene(e[t].innerBlocks);if(r)return r}return[]}var Tne=e=>t=>{function o(){let{getValue:n,onReplace:i,selectionChange:s,registry:a}=e.current;if(!i)return;let c=n(),{start:u,text:d}=c;if(d.slice(u-1,u)!==" ")return;let m=d.slice(0,u).trim(),h=(0,wb.getBlockTransforms)("from").filter(({type:v})=>v==="prefix"),p=(0,wb.findTransform)(h,({prefix:v})=>m===v);if(!p)return;let g=(0,ZI.toHTMLString)({value:(0,ZI.insert)(c,wl,0,u)}),b=p.transform(g);return s(...Ene([b])),i([b]),a.dispatch(_).__unstableMarkAutomaticChange(),!0}function r(n){let{inputType:i,type:s}=n,{getValue:a,onChange:c,__unstableAllowPrefixTransformations:u,formatTypes:d,registry:f,onReplace:m}=e.current;if(i!=="insertText"&&s!=="compositionend"||u&&o())return;let h=a(),p=(0,wb.getBlockTransforms)("from").filter(y=>y.type==="input"),g=(0,wb.findTransform)(p,y=>y.regExp.test(h.text));if(g){m(g.transform()),f.dispatch(_).__unstableMarkAutomaticChange();return}let b=d.reduce((y,{__unstableInputRule:S})=>(S&&(y=S(y)),y),Bne(h)),{__unstableMarkLastChangeAsPersistent:v,__unstableMarkAutomaticChange:k}=f.dispatch(_);b!==h&&(v(),c({...b,activeFormats:h.activeFormats}),k())}return t.addEventListener("input",r),t.addEventListener("compositionend",r),()=>{t.removeEventListener("input",r),t.removeEventListener("compositionend",r)}};var Ine=e=>t=>{function o(r){if(r.inputType!=="insertReplacementText")return;let{registry:n}=e.current;n.dispatch(_).__unstableMarkLastChangeAsPersistent()}return t.addEventListener("beforeinput",o),()=>{t.removeEventListener("beforeinput",o)}};var XI=l(it(),1),Pne=()=>e=>{function t(o){(XI.isKeyboardEvent.primary(o,"z")||XI.isKeyboardEvent.primary(o,"y")||XI.isKeyboardEvent.primaryShift(o,"z"))&&o.preventDefault()}return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}};var Rne=e=>t=>{let{keyboardShortcuts:o}=e.current;function r(n){for(let i of o.current)i(n)}return t.addEventListener("keydown",r),()=>{t.removeEventListener("keydown",r)}};var One=e=>t=>{let{inputEvents:o}=e.current;function r(n){for(let i of o.current)i(n)}return t.addEventListener("input",r),()=>{t.removeEventListener("input",r)}};var QI=l(it(),1);var Ane=e=>t=>{function o(r){let{keyCode:n}=r;if(r.defaultPrevented||n!==QI.BACKSPACE&&n!==QI.ESCAPE)return;let{registry:i}=e.current,{didAutomaticChange:s,getSettings:a}=i.select(_),{__experimentalUndo:c}=a();c&&s()&&(r.preventDefault(),c())}return t.addEventListener("keydown",o),()=>{t.removeEventListener("keydown",o)}};var Nne=l($(),1),Wa=l(dr(),1),Mne=l(dn(),1);var ETe=l(R(),1),TTe=l($(),1),ITe=l(w(),1);function Lne(e,t){if(t?.length){let o=e.formats.length;for(;o--;)e.formats[o]=[...t,...e.formats[o]||[]]}}function JI(e){if(!(e!==!0&&e!=="p"&&e!=="li"))return e===!0?"p":e}function Cb({allowedFormats:e,disableFormats:t}){return t?Cb.EMPTY_ARRAY:e}Cb.EMPTY_ARRAY=[];var Dne=e=>t=>{function o(n){let{disableFormats:i,onChange:s,value:a,formatTypes:c,tagName:u,onReplace:d,__unstableEmbedURLOnPaste:f,preserveWhiteSpace:m,pastePlainText:h}=e.current;if(!t.contains(n.target)||n.defaultPrevented)return;let{plainText:p,html:g}=Ah(n);if(n.preventDefault(),window.console.log(`Received HTML (RichText): `,g),window.console.log(`Received plain text (RichText): `,p),i){s((0,Wa.insert)(a,p));return}let b=n.clipboardData.getData("rich-text")==="true";function v(x){let C=c.reduce((B,{__unstablePasteRule:I})=>(I&&B===a&&(B=I(a,{html:g,plainText:p})),B),a);if(C!==a)s(C);else{let B=(0,Wa.create)({html:x});Lne(B,a.activeFormats),s((0,Wa.insert)(a,B))}}if(b){v(g);return}if(h){s((0,Wa.insert)(a,(0,Wa.create)({text:p})));return}let k="INLINE",y=p.trim();f&&(0,Wa.isEmpty)(a)&&(0,Mne.isURL)(y)&&/^https?:/.test(y)&&(k="BLOCKS");let S=(0,Nne.pasteHandler)({HTML:g,plainText:p,mode:k,tagName:u,preserveWhiteSpace:m});typeof S=="string"?v(S):S.length>0&&d&&(0,Wa.isEmpty)(a)&&d(S,S.length-1,-1)}let{defaultView:r}=t.ownerDocument;return r.addEventListener("paste",o),()=>{r.removeEventListener("paste",o)}};var e_=l(it(),1),eP=l(dr(),1),Vne=e=>t=>{function o(r){let{keyCode:n}=r;if(r.defaultPrevented)return;let{value:i,onMerge:s,onRemove:a}=e.current;if(n===e_.DELETE||n===e_.BACKSPACE){let{start:c,end:u,text:d}=i,f=n===e_.BACKSPACE,m=i.activeFormats&&!!i.activeFormats.length;if(!(0,eP.isCollapsed)(i)||m||f&&c!==0||!f&&u!==d.length)return;s?s(!f):a&&(0,eP.isEmpty)(i)&&f&&a(!f),r.preventDefault()}}return t.addEventListener("keydown",o),()=>{t.removeEventListener("keydown",o)}};var kF=l(it(),1),t_=l(dr(),1),Fne=e=>t=>{function o(i){if(i.keyCode!==kF.ENTER)return;let{onReplace:s,onSplit:a}=e.current;s&&a&&(i.__deprecatedOnSplit=!0)}function r(i){if(i.defaultPrevented||i.target!==t||i.keyCode!==kF.ENTER)return;let{value:s,onChange:a,disableLineBreaks:c,onSplitAtEnd:u,onSplitAtDoubleLineEnd:d,registry:f}=e.current;i.preventDefault();let{text:m,start:h,end:p}=s;i.shiftKey?c||a((0,t_.insert)(s,` `)):u&&h===p&&p===m.length?u():d&&h===p&&p===m.length&&m.slice(-2)===` `?f.batch(()=>{let g={...s};g.start=g.end-2,a((0,t_.remove)(g)),d()}):c||a((0,t_.insert)(s,` `))}let{defaultView:n}=t.ownerDocument;return n.addEventListener("keydown",r),t.addEventListener("keydown",o),()=>{n.removeEventListener("keydown",r),t.removeEventListener("keydown",o)}};var zne=e=>t=>{function o(){let{registry:r}=e.current;if(!r.select(_).isMultiSelecting())return;let n=t.parentElement.closest('[contenteditable="true"]');n&&n.focus()}return t.addEventListener("focus",o),()=>{t.removeEventListener("focus",o)}};var PTe=[wne,Tne,Ine,Pne,Rne,One,Ane,Dne,Vne,Fne,zne];function tP(e){let t=(0,Bb.useRef)(e);(0,Bb.useInsertionEffect)(()=>{t.current=e});let o=(0,Bb.useMemo)(()=>PTe.map(r=>r(t)),[t]);return(0,jne.useRefEffect)(r=>{if(!e.isSelected)return;let n=o.map(i=>i(r));return()=>{n.forEach(i=>i())}},[o,e.isSelected])}var oP=l(dr(),1),rP=l(R(),1);var Une=l(w(),1),Hne=l(jr(),1),RTe={},vF=Symbol("usesContext");function OTe({onChange:e,onFocus:t,value:o,forwardedRef:r,settings:n,isVisible:i}){let{name:s,edit:a,[vF]:c}=n,u=(0,rP.useContext)(xr),d=(0,rP.useMemo)(()=>c?Object.fromEntries(Object.entries(u).filter(([g])=>c.includes(g))):RTe,[c,u]);if(!a)return null;let f=(0,oP.getActiveFormat)(o,s),m=f!==void 0,h=(0,oP.getActiveObject)(o),p=h!==void 0&&h.type===s;return(0,Une.jsx)(a,{isActive:m,isVisible:i,activeAttributes:m?f.attributes||{}:{},isObjectActive:p,activeObjectAttributes:p?h.attributes||{}:{},value:o,onChange:e,onFocus:t,contentRef:r,context:d},s)}function nP({formatTypes:e,...t}){return e.map(o=>(0,Hne.createElement)(OTe,{settings:o,...t,key:o.name}))}var Gne=l(R(),1),Wne=l($(),1),$ne=l(Re(),1);var yF=l(w(),1);function SF(e,t){if(Eb.isEmpty(e)){let o=JI(t);return o?`<${o}></${o}>`:""}return Array.isArray(e)?((0,$ne.default)("wp.blockEditor.RichText value prop as children type",{since:"6.1",version:"6.3",alternative:"value prop as string",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),Wne.children.toHTML(e)):typeof e=="string"?e:e.toHTMLString()}function o_({value:e,tagName:t,multiline:o,format:r,...n}){return e=(0,yF.jsx)(Gne.RawHTML,{children:SF(e,o)}),t?(0,yF.jsx)(t,{...n,children:e}):e}var Xne=l(R(),1),xF=l($(),1),Qne=l(dr(),1),Jne=l(Re(),1);var Kne=l(R(),1),Yne=l(Re(),1),iP=l(F(),1),qne=l(it(),1),Tb=l(dr(),1);var _F=l(w(),1);function ATe({children:e,identifier:t,tagName:o="div",value:r="",onChange:n,multiline:i,...s},a){(0,Yne.default)("wp.blockEditor.RichText multiline prop",{since:"6.1",version:"6.3",alternative:"nested blocks (InnerBlocks)",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/nested-blocks-inner-blocks/"});let{clientId:c}=Ie(),{getSelectionStart:u,getSelectionEnd:d}=(0,iP.useSelect)(_),{selectionChange:f}=(0,iP.useDispatch)(_),m=JI(i);r=r||`<${m}></${m}>`;let p=`</${m}>${r}<${m}>`.split(`</${m}><${m}>`);p.shift(),p.pop();function g(b){n(`<${m}>${b.join(`</${m}><${m}>`)}</${m}>`)}return(0,_F.jsx)(o,{ref:a,children:p.map((b,v)=>(0,_F.jsx)(sP,{identifier:`${t}-${v}`,tagName:m,value:b,onChange:k=>{let y=p.slice();y[v]=k,g(y)},isSelected:void 0,onKeyDown:k=>{if(k.keyCode!==qne.ENTER)return;k.preventDefault();let{offset:y}=u(),{offset:S}=d();if(typeof y!="number"||typeof S!="number")return;let x=(0,Tb.create)({html:b});x.start=y,x.end=S;let C=(0,Tb.split)(x).map(I=>(0,Tb.toHTMLString)({value:I})),B=p.slice();B.splice(v,1,...C),g(B),f(c,`${t}-${v+1}`,0,0)},onMerge:k=>{let y=p.slice(),S=0;if(k){if(!y[v+1])return;y.splice(v,2,y[v]+y[v+1]),S=y[v].length-1}else{if(!y[v-1])return;y.splice(v-1,2,y[v-1]+y[v]),S=y[v-1].length-1}g(y),f(c,`${t}-${v-(k?0:1)}`,S,S)},...s},v))})}var Zne=(0,Kne.forwardRef)(ATe);var eie=l(w(),1);function tie(e){return(0,Xne.forwardRef)((t,o)=>{let r=t.value,n=t.onChange;Array.isArray(r)&&((0,Jne.default)("wp.blockEditor.RichText value prop as children type",{since:"6.1",version:"6.3",alternative:"value prop as string",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),r=xF.children.toHTML(t.value),n=s=>t.onChange(xF.children.fromDOM((0,Qne.__unstableCreateElement)(document,s).childNodes)));let i=t.multiline?Zne:e;return(0,eie.jsx)(i,{...t,value:r,onChange:n,ref:o})})}var oie=l(it(),1),Ib=l(R(),1);function wF({character:e,type:t,onUse:o}){let r=(0,Ib.useContext)(Pb),n=(0,Ib.useRef)();return n.current=o,(0,Ib.useEffect)(()=>{function i(s){oie.isKeyboardEvent[t](s,e)&&(n.current(),s.preventDefault())}return r.current.add(i),()=>{r.current.delete(i)}},[e,t]),null}var aP=l(A(),1),rie=l(it(),1),CF=l(w(),1);function BF({name:e,shortcutType:t,shortcutCharacter:o,...r}){let n,i="RichText.ToolbarControls";return e&&(i+=`.${e}`),t&&o&&(n=rie.displayShortcut[t](o)),(0,CF.jsx)(aP.Fill,{name:i,children:(0,CF.jsx)(aP.ToolbarButton,{...r,shortcut:n})})}var Rb=l(R(),1);function EF({inputType:e,onInput:t}){let o=(0,Rb.useContext)(Ob),r=(0,Rb.useRef)();return r.current=t,(0,Rb.useEffect)(()=>{function n(i){i.inputType===e&&(r.current(),i.preventDefault())}return o.current.add(n),()=>{o.current.delete(n)}},[e]),null}var di=l(w(),1),{useRichText:LTe}=M(sie.privateApis),Pb=(0,nr.createContext)();Pb.displayName="keyboardShortcutContext";var Ob=(0,nr.createContext)();Ob.displayName="inputEventContext";var nie=Symbol("instanceId");function uie(e){let{__unstableMobileNoFocusOnMount:t,deleteEnter:o,placeholderTextColor:r,textAlign:n,selectionColor:i,tagsToEliminate:s,disableEditingMenu:a,fontSize:c,fontFamily:u,fontWeight:d,fontStyle:f,minWidth:m,maxWidth:h,disableSuggestions:p,disableAutocorrection:g,...b}=e;return b}function sP({children:e,tagName:t="div",value:o="",onChange:r,isSelected:n,multiline:i,inlineToolbar:s,wrapperClassName:a,autocompleters:c,onReplace:u,placeholder:d,allowedFormats:f,withoutInteractiveFormatting:m,onRemove:h,onMerge:p,onSplit:g,__unstableOnSplitAtEnd:b,__unstableOnSplitAtDoubleLineEnd:v,identifier:k,preserveWhiteSpace:y,__unstablePastePlainText:S,__unstableEmbedURLOnPaste:x,__unstableDisableFormats:C,disableLineBreaks:B,__unstableAllowPrefixTransformations:I,readOnly:P,...E},L){E=uie(E),g&&(0,cie.default)("wp.blockEditor.RichText onSplit prop",{since:"6.4",alternative:'block.json support key: "splitting"'});let T=(0,lP.useInstanceId)(sP),O=(0,nr.useRef)(),[D,U]=(0,nr.useState)(null),G=Ie(),{clientId:j,isSelected:z,name:W}=G,ee=G[Rp],se=(0,nr.useContext)(xr),ce=(0,Md.useRegistry)(),ie=je=>{if(!z)return{isSelected:!1};let{getSelectionStart:Eo,getSelectionEnd:Ze}=je(_),Ve=Eo(),gt=Ze(),To;return n===void 0?To=Ve.clientId===j&>.clientId===j&&(k?Ve.attributeKey===k:Ve[nie]===T):n&&(To=Ve.clientId===j),{selectionStart:To?Ve.offset:void 0,selectionEnd:To?gt.offset:void 0,isSelected:To}},{selectionStart:re,selectionEnd:Q,isSelected:Y}=(0,Md.useSelect)(ie,[j,k,T,n,z]),{disableBoundBlock:J,bindingsPlaceholder:K,bindingsLabel:H}=(0,Md.useSelect)(je=>{if(!ee?.[k])return{};let{__experimentalBlockBindingsSupportedAttributes:Eo}=je(_).getSettings();if(!Eo?.[W])return{};let Ve=ee[k],gt=(0,lie.getBlockBindingsSource)(Ve.source),To={};if(gt?.usesContext?.length)for(let ct of gt.usesContext)To[ct]=se[ct];let cr=!gt?.canUserEditValue?.({select:je,context:To,args:Ve.args});if(o.length>0)return{disableBoundBlock:cr,bindingsPlaceholder:null,bindingsLabel:null};let{getBlockAttributes:ge}=je(_),Ct=ge(j),Io=null;gt?.getFieldsList&&(Io=gt.getFieldsList({select:je,context:To})?.find(Gc=>(0,iie.default)(Gc.args,Ve?.args))?.label);let Ke=Io??gt?.label,te=cr?Ke:(0,Ab.sprintf)((0,Ab.__)("Add %s"),Ke),Le=cr?Ve?.args?.key||gt?.label:(0,Ab.sprintf)((0,Ab.__)("Empty %s; start writing to edit its value"),Ve?.args?.key||gt?.label);return{disableBoundBlock:cr,bindingsPlaceholder:Ct?.placeholder||te,bindingsLabel:Le}},[ee,k,W,o,j,se]),X=!!se?.["pattern/overrides"],ne=ee?.__default?.source==="core/pattern-overrides",ve=P||J||X&&!ne,{getSelectionStart:he,getSelectionEnd:xe,getBlockRootClientId:ze}=(0,Md.useSelect)(_),{selectionChange:ot}=(0,Md.useDispatch)(_),Wt=Cb({allowedFormats:f,disableFormats:C}),fo=!Wt||Wt.length>0,Do=(0,nr.useCallback)((je,Eo)=>{let Ze={},Ve=je===void 0&&Eo===void 0,gt={clientId:j,[k?"attributeKey":nie]:k||T};if(typeof je=="number"||Ve){if(Eo===void 0&&ze(j)!==ze(xe().clientId))return;Ze.start={...gt,offset:je}}if(typeof Eo=="number"||Ve){if(je===void 0&&ze(j)!==ze(he().clientId))return;Ze.end={...gt,offset:Eo}}ot(Ze)},[j,ze,xe,he,k,T,ot]),{value:rt,getValue:ar,onChange:xt,ref:At,formatTypes:Pe}=LTe({value:o,onChange:r,selectionStart:re,selectionEnd:Q,onSelectionChange:Do,placeholder:K||d,__unstableIsSelected:Y,__unstableDisableFormats:C,preserveWhiteSpace:y,__unstableDependencies:[t],allowedFormats:Wt,withoutInteractiveFormatting:m,__unstableFormatTypeHandlerContext:(0,nr.useMemo)(()=>({richTextIdentifier:k,blockClientId:j}),[k,j])}),wt=qU({onReplace:u,completers:c,record:rt,onChange:xt});_ne({html:o,value:rt});let qo=(0,nr.useRef)(new Set),$t=(0,nr.useRef)(new Set);function lr(){O.current?.focus()}let ln=t;return(0,di.jsxs)(di.Fragment,{children:[Y&&(0,di.jsx)(Pb.Provider,{value:qo,children:(0,di.jsx)(Ob.Provider,{value:$t,children:(0,di.jsxs)(aie.Popover.__unstableSlotNameProvider,{value:"__unstable-block-tools-after",children:[e&&e({value:rt,onChange:xt,onFocus:lr}),(0,di.jsx)(nP,{value:rt,onChange:xt,onFocus:lr,formatTypes:Pe,forwardedRef:O})]})})}),Y&&fo&&(0,di.jsx)(yne,{inline:s,editableContentElement:D}),(0,di.jsx)(ln,{role:"textbox","aria-multiline":!B,"aria-readonly":ve,...E,draggable:void 0,"aria-label":H||E["aria-label"]||d,...wt,ref:(0,lP.useMergeRefs)([At,L,wt.ref,E.ref,tP({registry:ce,getValue:ar,onChange:xt,__unstableAllowPrefixTransformations:I,formatTypes:Pe,onReplace:u,selectionChange:ot,isSelected:Y,disableFormats:C,value:rt,tagName:t,onSplit:g,__unstableEmbedURLOnPaste:x,pastePlainText:S,onMerge:p,onRemove:h,disableLineBreaks:B,onSplitAtEnd:b,onSplitAtDoubleLineEnd:v,keyboardShortcuts:qo,inputEvents:$t}),O,U]),contentEditable:!ve,suppressContentEditableWarning:!0,className:V("block-editor-rich-text__editable",E.className,"rich-text"),tabIndex:E.tabIndex===0&&!ve?null:E.tabIndex,"data-wp-block-attribute-key":k})]})}var r_=tie((0,nr.forwardRef)(sP));r_.Content=o_;r_.isEmpty=e=>!e||e.length===0;var TF=(0,nr.forwardRef)((e,t)=>{if(Ie()[d0]){let{children:n,tagName:i="div",value:s,onChange:a,isSelected:c,multiline:u,inlineToolbar:d,wrapperClassName:f,autocompleters:m,onReplace:h,placeholder:p,allowedFormats:g,withoutInteractiveFormatting:b,onRemove:v,onMerge:k,onSplit:y,__unstableOnSplitAtEnd:S,__unstableOnSplitAtDoubleLineEnd:x,identifier:C,preserveWhiteSpace:B,__unstablePastePlainText:I,__unstableEmbedURLOnPaste:P,__unstableDisableFormats:E,disableLineBreaks:L,__unstableAllowPrefixTransformations:T,readOnly:O,...D}=uie(e);return(0,di.jsx)(i,{ref:t,...D,dangerouslySetInnerHTML:{__html:SF(s,u)||"<br>"}})}return(0,di.jsx)(r_,{ref:t,...e,readOnly:!1})});TF.Content=o_;TF.isEmpty=e=>!e||e.length===0;var Eb=TF;var IF=l(w(),1),fie=(0,die.forwardRef)((e,t)=>(0,IF.jsx)(Eb,{ref:t,...e,__unstableDisableFormats:!0}));fie.Content=function({value:t="",tagName:o="div",...r}){return(0,IF.jsx)(o,{...r,children:t})};var mie=fie;var PF=l(w(),1),NTe=(0,hie.forwardRef)(({__experimentalVersion:e,...t},o)=>{if(e===2)return(0,PF.jsx)(mie,{ref:o,...t});let{className:r,onChange:n,...i}=t;return(0,PF.jsx)(pie.default,{ref:o,className:V("block-editor-plain-text",r),onChange:s=>n(s.target.value),...i})}),gie=NTe;var $a=l(N(),1),vie=l(R(),1),yie=l(A(),1);var bie=l(Z(),1),kie=l(A(),1),cP=l(N(),1),tp=l(w(),1);function uP({property:e,viewport:t,desc:o}){let r=(0,bie.useInstanceId)(uP),n=o||(0,cP.sprintf)((0,cP._x)("Controls the %1$s property for %2$s viewports.","Text labelling a interface as controlling a given layout property (eg: margin) for a given screen size."),e,t.label);return(0,tp.jsxs)(tp.Fragment,{children:[(0,tp.jsx)("span",{"aria-describedby":`rbc-desc-${r}`,children:t.label}),(0,tp.jsx)(kie.VisuallyHidden,{as:"span",id:`rbc-desc-${r}`,children:n})]})}var Ka=l(w(),1);function MTe(e){let{title:t,property:o,toggleLabel:r,onIsResponsiveChange:n,renderDefaultControl:i,renderResponsiveControls:s,isResponsive:a=!1,defaultLabel:c={id:"all",label:(0,$a._x)("All","screen sizes")},viewports:u=[{id:"small",label:(0,$a.__)("Small screens")},{id:"medium",label:(0,$a.__)("Medium screens")},{id:"large",label:(0,$a.__)("Large screens")}]}=e;if(!t||!o||!i)return null;let d=r||(0,$a.sprintf)((0,$a.__)("Use the same %s on all screen sizes."),o),f=(0,$a.__)("Choose whether to use the same value for all screen sizes or a unique value for each screen size."),m=i((0,Ka.jsx)(uP,{property:o,viewport:c}),c),h=()=>u.map(p=>(0,Ka.jsx)(vie.Fragment,{children:i((0,Ka.jsx)(uP,{property:o,viewport:p}),p)},p.id));return(0,Ka.jsxs)("fieldset",{className:"block-editor-responsive-block-control",children:[(0,Ka.jsx)("legend",{className:"block-editor-responsive-block-control__title",children:t}),(0,Ka.jsxs)("div",{className:"block-editor-responsive-block-control__inner",children:[(0,Ka.jsx)(yie.ToggleControl,{className:"block-editor-responsive-block-control__toggle",label:d,checked:!a,onChange:n,help:f}),(0,Ka.jsxs)("div",{className:V("block-editor-responsive-block-control__group",{"is-responsive":a}),children:[!a&&m,a&&(s?s(u):h())]})]})]})}var Sie=MTe;var dP=l(A(),1);var _ie=l(w(),1);function xie({units:e,...t}){let[o]=me("spacing.units"),r=(0,dP.__experimentalUseCustomUnits)({availableUnits:o||["%","px","em","rem","vw"],units:e});return(0,_ie.jsx)(dP.__experimentalUnitControl,{units:r,...t})}var n_=l(N(),1),wie=l(R(),1),Lb=l(A(),1);var Ya=l(w(),1);function DTe({url:e,onChange:t}){let[o,r]=(0,wie.useReducer)(i=>!i,!1),n=i=>{i.preventDefault(),r()};return(0,Ya.jsxs)("div",{className:"block-editor-url-input__button",children:[(0,Ya.jsx)(Lb.Button,{size:"compact",icon:fn,label:e?(0,n_.__)("Edit link"):(0,n_.__)("Insert link"),onClick:r,className:"components-toolbar__control",isPressed:!!e}),o&&(0,Ya.jsx)("form",{className:"block-editor-url-input__button-modal",onSubmit:n,children:(0,Ya.jsxs)("div",{className:"block-editor-url-input__button-modal-line",children:[(0,Ya.jsx)(Lb.Button,{__next40pxDefaultSize:!0,className:"block-editor-url-input__back",icon:Xk,label:(0,n_.__)("Close"),onClick:r}),(0,Ya.jsx)(Td,{value:e||"",onChange:t,suffix:(0,Ya.jsx)(Lb.__experimentalInputControlSuffixWrapper,{variant:"control",children:(0,Ya.jsx)(Lb.Button,{size:"small",icon:bl,label:(0,n_.__)("Submit"),type:"submit"})})})]})})]})}var Cie=DTe;var In=l(N(),1),rs=l(R(),1),Pie=l(Fe(),1),Ho=l(A(),1);var Rie=l(dn(),1);var yt=l(w(),1),RF="none",Bie="custom",Eie="media",Tie="attachment",Iie=["noreferrer","noopener"],Oie=({linkDestination:e,onChangeUrl:t,url:o,mediaType:r="image",mediaUrl:n,mediaLink:i,linkTarget:s,linkClass:a,rel:c,showLightboxSetting:u,lightboxEnabled:d,onSetLightbox:f,resetLightbox:m})=>{let[h,p]=(0,rs.useState)(!1),[g,b]=(0,rs.useState)(null),v=()=>{p(!0)},[k,y]=(0,rs.useState)(!1),[S,x]=(0,rs.useState)(null),C=(0,rs.useRef)(null),B=(0,rs.useRef)();(0,rs.useEffect)(()=>{if(!B.current)return;(Pie.focus.focusable.find(B.current)[0]||B.current).focus()},[k,o,d]);let I=()=>{(e===Eie||e===Tie)&&x(""),y(!0)},P=()=>{y(!1)},E=()=>{x(null),P(),p(!1)},L=Y=>{let J=Y?"_blank":void 0,K;if(J){let H=(c??"").split(" ");Iie.forEach(X=>{H.includes(X)||H.push(X)}),K=H.join(" ")}else{let H=(c??"").split(" ").filter(X=>Iie.includes(X)===!1);K=H.length?H.join(" "):void 0}return{linkTarget:J,rel:K}},T=()=>Y=>{let J=C.current;J&&J.contains(Y.target)||(p(!1),x(null),P())},O=()=>Y=>{if(S){let J=U().find(K=>K.url===S)?.linkDestination||Bie;t({href:(0,Rie.prependHTTPS)(S),linkDestination:J,lightbox:{enabled:!1}})}P(),x(null),Y.preventDefault()},D=()=>{t({linkDestination:RF,href:""})},U=()=>{let Y=[{linkDestination:Eie,title:(0,In.__)("Link to image file"),url:r==="image"?n:void 0,icon:iv}];return r==="image"&&i&&Y.push({linkDestination:Tie,title:(0,In.__)("Link to attachment page"),url:r==="image"?i:void 0,icon:kl}),Y},G=Y=>{let J=U(),K;Y?K=(J.find(H=>H.url===Y)||{linkDestination:Bie}).linkDestination:K=RF,t({linkDestination:K,href:Y})},j=Y=>{let J=L(Y);t(J)},z=Y=>{t({rel:Y})},W=Y=>{t({linkClass:Y})},ee=(0,yt.jsxs)(Ho.__experimentalVStack,{spacing:"3",children:[(0,yt.jsx)(Ho.ToggleControl,{label:(0,In.__)("Open in new tab"),onChange:j,checked:s==="_blank"}),(0,yt.jsx)(Ho.TextControl,{__next40pxDefaultSize:!0,label:(0,In.__)("Link relation"),value:c??"",onChange:z,help:(0,rs.createInterpolateElement)((0,In.__)("The <a>Link Relation</a> attribute defines the relationship between a linked resource and the current document."),{a:(0,yt.jsx)(Ho.ExternalLink,{href:"https://developer.mozilla.org/docs/Web/HTML/Attributes/rel"})})}),(0,yt.jsx)(Ho.TextControl,{__next40pxDefaultSize:!0,label:(0,In.__)("Link CSS class"),value:a||"",onChange:W})]}),se=S!==null?S:o,ce=!d||d&&!u,ie=!se&&ce,re=(U().find(Y=>Y.linkDestination===e)||{}).title,Q=()=>{if(d&&u&&!o&&!k)return(0,yt.jsxs)("div",{className:"block-editor-url-popover__expand-on-click",children:[(0,yt.jsx)(we,{icon:mx}),(0,yt.jsxs)("div",{className:"text",children:[(0,yt.jsx)("p",{children:(0,In.__)("Enlarge on click")}),(0,yt.jsx)("p",{className:"description",children:(0,In.__)("Scales the image with a lightbox effect")})]}),(0,yt.jsx)(Ho.Button,{icon:Ci,label:(0,In.__)("Disable enlarge on click"),onClick:()=>{f?.(!1)},size:"compact"})]});if(!o||k)return(0,yt.jsx)(Ad.LinkEditor,{className:"block-editor-format-toolbar__link-container-content",value:se,onChangeInputValue:x,onSubmit:O(),autocompleteRef:C});if(o&&!k)return(0,yt.jsxs)(yt.Fragment,{children:[(0,yt.jsx)(Ad.LinkViewer,{className:"block-editor-format-toolbar__link-container-content",url:o,onEditLinkClick:I,urlLabel:re}),(0,yt.jsx)(Ho.Button,{icon:Ci,label:(0,In.__)("Remove link"),onClick:()=>{D(),m?.()},size:"compact"})]})};return(0,yt.jsxs)(yt.Fragment,{children:[(0,yt.jsx)(Ho.ToolbarButton,{icon:fn,className:"components-toolbar__control",label:(0,In.__)("Link"),"aria-expanded":h,onClick:v,ref:b,isActive:!!o||d&&u}),h&&(0,yt.jsx)(Ad,{ref:B,anchor:g,onFocusOutside:T(),onClose:E,renderSettings:ce?()=>ee:null,additionalControls:ie&&(0,yt.jsxs)(Ho.NavigableMenu,{children:[U().map(Y=>(0,yt.jsx)(Ho.MenuItem,{icon:Y.icon,iconPosition:"left",onClick:()=>{x(null),G(Y.url),P()},children:Y.title},Y.linkDestination)),u&&(0,yt.jsx)(Ho.MenuItem,{className:"block-editor-url-popover__expand-on-click",icon:mx,info:(0,In.__)("Scale the image with a lightbox effect."),iconPosition:"left",onClick:()=>{x(null),t({linkDestination:RF,href:""}),f?.(!0),P()},children:(0,In.__)("Enlarge on click")},"expand-on-click")]}),offset:13,children:Q()})]})};var Mb=l(A(),1),$ie=l(R(),1),pP=l(N(),1);var Aie=l(R(),1),AF=l(N(),1);var OF=[],VTe=new Intl.Collator("und",{numeric:!0}).compare;function fP(){let[e,t,o,r]=me("spacing.spacingSizes.custom","spacing.spacingSizes.theme","spacing.spacingSizes.default","spacing.defaultSpacingSizes"),n=e??OF,i=t??OF,s=o&&r!==!1?o:OF;return(0,Aie.useMemo)(()=>{let a=[{name:(0,AF.__)("None"),slug:"0",size:0},...n,...i,...s];return a.every(({slug:c})=>/^[0-9]/.test(c))&&a.sort((c,u)=>VTe(c.slug,u.slug)),a.length>XU?[{name:(0,AF.__)("Default"),slug:"default",size:void 0},...a]:a},[n,i,s])}var Lie=l(R(),1),Nie=l(F(),1),mP=l(N(),1),Mie=l(A(),1);var Die=l(w(),1),FTe={px:{max:300,steps:1},"%":{max:100,steps:1},vw:{max:100,steps:1},vh:{max:100,steps:1},em:{max:10,steps:.1},rm:{max:10,steps:.1},svw:{max:100,steps:1},lvw:{max:100,steps:1},dvw:{max:100,steps:1},svh:{max:100,steps:1},lvh:{max:100,steps:1},dvh:{max:100,steps:1},vi:{max:100,steps:1},svi:{max:100,steps:1},lvi:{max:100,steps:1},dvi:{max:100,steps:1},vb:{max:100,steps:1},svb:{max:100,steps:1},lvb:{max:100,steps:1},dvb:{max:100,steps:1},vmin:{max:100,steps:1},svmin:{max:100,steps:1},lvmin:{max:100,steps:1},dvmin:{max:100,steps:1},vmax:{max:100,steps:1},svmax:{max:100,steps:1},lvmax:{max:100,steps:1},dvmax:{max:100,steps:1}};function Nb({icon:e,isMixed:t=!1,minimumCustomValue:o,onChange:r,onMouseOut:n,onMouseOver:i,showSideInLabel:s=!0,side:a,spacingSizes:c,type:u,value:d,...f}){let m=(0,Nie.useSelect)(S=>S(_).getSettings()?.disableCustomSpacingSizes),[h]=me("spacing.units"),p=(0,Mie.__experimentalUseCustomUnits)({availableUnits:h||["px","em","rem"]}),g=(0,Lie.useMemo)(()=>c?.map(S=>({name:S.name,slug:S.slug,size:S.size}))||[],[c]),b=(Su.includes(a)||["vertical","horizontal"].includes(a))&&s?ha[a]:"",v=s?u?.toLowerCase():u,k=(0,mP.sprintf)((0,mP._x)("%1$s %2$s","spacing"),b,v).trim(),y=p[0]?.value||"px";return(0,Die.jsx)(jm,{allowNegativeOnDrag:o<0,ariaLabel:k,className:"spacing-sizes-control",customValueSettings:FTe,disableCustomValues:m,icon:e,isMixed:t,minimumCustomValue:o,onChange:r,onMouseOut:n,onMouseOver:i,presets:g,presetType:"spacing",selectedUnit:y,units:p,value:d,...f})}var i_=l(w(),1),Vie=["vertical","horizontal"];function Fie({minimumCustomValue:e,onChange:t,onMouseOut:o,onMouseOver:r,sides:n,spacingSizes:i,type:s,values:a}){let c=d=>f=>{if(!t)return;let m={...Object.keys(a).reduce((h,p)=>(h[p]=sh(a[p],i),h),{})};d==="vertical"&&(m.top=f,m.bottom=f),d==="horizontal"&&(m.left=f,m.right=f),t(m)},u=n?.length?Vie.filter(d=>_M(n,d)):Vie;return(0,i_.jsx)(i_.Fragment,{children:u.map(d=>{let f=d==="vertical"?a.top:a.left;return(0,i_.jsx)(Nb,{icon:rC[d],label:ha[d],minimumCustomValue:e,onChange:c(d),onMouseOut:o,onMouseOver:r,side:d,spacingSizes:i,type:s,value:f,withInputField:!1},`spacing-sizes-control-${d}`)})})}var s_=l(w(),1);function zie({minimumCustomValue:e,onChange:t,onMouseOut:o,onMouseOver:r,sides:n,spacingSizes:i,type:s,values:a}){let c=n?.length?Su.filter(d=>n.includes(d)):Su,u=d=>f=>{let m={...Object.keys(a).reduce((h,p)=>(h[p]=sh(a[p],i),h),{})};m[d]=f,t(m)};return(0,s_.jsx)(s_.Fragment,{children:c.map(d=>(0,s_.jsx)(Nb,{icon:rC[d],label:ha[d],minimumCustomValue:e,onChange:u(d),onMouseOut:o,onMouseOver:r,side:d,spacingSizes:i,type:s,value:a[d],withInputField:!1},`spacing-sizes-control-${d}`))})}var jie=l(w(),1);function Uie({minimumCustomValue:e,onChange:t,onMouseOut:o,onMouseOver:r,showSideInLabel:n,side:i,spacingSizes:s,type:a,values:c}){let u=d=>f=>{let m={...Object.keys(c).reduce((h,p)=>(h[p]=sh(c[p],s),h),{})};m[d]=f,t(m)};return(0,jie.jsx)(Nb,{label:ha[i],minimumCustomValue:e,onChange:u(i),onMouseOut:o,onMouseOver:r,showSideInLabel:n,side:i,spacingSizes:s,type:a,value:c[i],withInputField:!1})}var Hie=l(A(),1);var LF=l(N(),1),Gie=l(w(),1);function Wie({isLinked:e,...t}){let o=e?(0,LF.__)("Unlink sides"):(0,LF.__)("Link sides");return(0,Gie.jsx)(Hie.Button,{...t,size:"small",icon:e?fn:Ci,iconSize:24,label:o})}var qa=l(w(),1);function Db({inputProps:e,label:t,minimumCustomValue:o=0,onChange:r,onMouseOut:n,onMouseOver:i,showSideInLabel:s=!0,sides:a=Su,useSelect:c,values:u}){let d=fP(),f=u||QU,m=a?.length===1,h=a?.includes("horizontal")&&a?.includes("vertical")&&a?.length===2,[p,g]=(0,$ie.useState)(eH(f,a)),b=()=>{g(p===Cl.axial?Cl.custom:Cl.axial)},k={...e,minimumCustomValue:o,onChange:C=>{let B={...u,...C};r(B)},onMouseOut:n,onMouseOver:i,sides:a,spacingSizes:d,type:t,useSelect:c,values:f},y=()=>p===Cl.axial?(0,qa.jsx)(Fie,{...k}):p===Cl.custom?(0,qa.jsx)(zie,{...k}):(0,qa.jsx)(Uie,{side:p,...k,showSideInLabel:s}),S=Su.includes(p)&&s?ha[p]:"",x=(0,pP.sprintf)((0,pP._x)("%1$s %2$s","spacing"),t,S).trim();return(0,qa.jsxs)("fieldset",{className:"spacing-sizes-control",children:[(0,qa.jsxs)(Mb.__experimentalHStack,{className:"spacing-sizes-control__header",children:[(0,qa.jsx)(Mb.BaseControl.VisualLabel,{as:"legend",className:"spacing-sizes-control__label",children:x}),!m&&!h&&(0,qa.jsx)(Wie,{label:t,onClick:b,isLinked:p===Cl.axial})]}),(0,qa.jsx)(Mb.__experimentalVStack,{spacing:.5,children:y()})]})}var Kie=l(Re(),1);function Yie(){return(0,Kie.default)("wp.blockEditor.PreviewOptions",{version:"6.5"}),null}var hP=l(R(),1);function qie(e){let[t,o]=(0,hP.useState)(window.innerWidth);(0,hP.useEffect)(()=>{if(e==="Desktop")return;let i=()=>o(window.innerWidth);return window.addEventListener("resize",i),()=>{window.removeEventListener("resize",i)}},[e]);let r=i=>{let s;switch(i){case"Tablet":s=781;break;case"Mobile":s=479;break;default:return null}return s<t?s:t};return(i=>{let s=i==="Mobile"?"768px":"1024px",a="40px",c="auto";switch(i){case"Tablet":case"Mobile":return{width:r(i),marginTop:a,marginBottom:a,marginLeft:c,marginRight:c,height:s,overflowY:"auto"};default:return{marginLeft:c,marginRight:c}}})(e)}var tk=l(N(),1),zd=l($(),1),zae=l(A(),1),n4=l(F(),1),jae=l(R(),1);var Vb=l(A(),1),gP=l(N(),1),Zie=l(F(),1),bP=l($(),1);var op=l(w(),1);function zTe({block:e,onNavigateToEntityRecord:t,isSyncedPattern:o,isTemplatePartBlock:r}){let n=e?.attributes||{};return(0,op.jsx)(Vb.__experimentalVStack,{className:"block-editor-block-inspector-edit-contents",expanded:!0,children:(0,op.jsx)(Vb.Button,{className:"block-editor-block-inspector-edit-contents__button",__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>{if(o)t({postId:n.ref,postType:"wp_block"});else if(r){let{theme:s,slug:a}=n,c=s&&a?`${s}//${a}`:null;c&&t({postId:c,postType:"wp_template_part"})}},children:(0,gP.__)("Edit original")})})}function jTe({clientId:e,editedContentOnlySection:t,editContentOnlySection:o,stopEditingContentOnlySection:r}){return(0,op.jsx)(Vb.__experimentalVStack,{className:"block-editor-block-inspector-edit-contents",expanded:!0,children:(0,op.jsx)(Vb.Button,{className:"block-editor-block-inspector-edit-contents__button",__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>{t?r():o(e)},children:t?(0,gP.__)("Exit pattern"):(0,gP.__)("Edit pattern")})})}function Xie({clientId:e}){let{isWithinSection:t,isWithinEditedSection:o,editedContentOnlySection:r,editContentOnlySection:n,stopEditingContentOnlySection:i}=aT(e),{block:s,onNavigateToEntityRecord:a,canEdit:c}=(0,Zie.useSelect)(m=>{let{getBlock:h,getSettings:p,canEditBlock:g}=m(_);return{block:h(e),onNavigateToEntityRecord:p().onNavigateToEntityRecord,canEdit:g(e)}},[e]);if(!c||!t&&!o)return null;let u=(0,bP.isReusableBlock)(s),d=(0,bP.isTemplatePart)(s);return(u||d)&&a?(0,op.jsx)(zTe,{block:s,onNavigateToEntityRecord:a,isSyncedPattern:u,isTemplatePartBlock:d}):(0,op.jsx)(jTe,{clientId:e,editedContentOnlySection:r,editContentOnlySection:n,stopEditingContentOnlySection:i})}var Qie=l(F(),1),Jie=l(N(),1),ese=l(A(),1),tse=l(R(),1);var ose=l(w(),1);function kP(){let e=(0,Qie.useSelect)(r=>r(_).getBlockSelectionStart(),[]),t=(0,tse.useRef)();return $f(e,t),e?(0,ose.jsx)(ese.Button,{__next40pxDefaultSize:!0,variant:"secondary",className:"block-editor-skip-to-selected-block",onClick:()=>{t.current?.focus()},children:(0,Jie.__)("Skip to the selected block")}):null}var vP=l(N(),1),rse=l(F(),1);var nse=l(A(),1);var a_=l(w(),1);function NF(){let e=(0,rse.useSelect)(t=>t(_).getSelectedBlockCount(),[]);return(0,a_.jsxs)(nse.__experimentalHStack,{justify:"flex-start",spacing:2,className:"block-editor-multi-selection-inspector__card",children:[(0,a_.jsx)(Ae,{icon:Cf,showColors:!0}),(0,a_.jsx)("div",{className:"block-editor-multi-selection-inspector__card-title",children:(0,vP.sprintf)((0,vP._n)("%d Block","%d Blocks",e),e)})]})}var ek=l(A(),1),oa=l(R(),1),Aae=l(Zp(),1),Jb=l(F(),1);var l_=l(N(),1),yP={name:"settings",title:(0,l_.__)("Settings"),value:"settings",icon:oA},SP={name:"styles",title:(0,l_.__)("Styles"),value:"styles",icon:kN},_P={name:"content",title:(0,l_.__)("Content"),value:"content",icon:kl},yc={name:"list",title:(0,l_.__)("List View"),value:"list-view",icon:sv};var BP=l(A(),1);var c_=l(A(),1),ise=l(N(),1);var u_=l(w(),1),UTe=({initialOpen:e=!1})=>{let t=(0,c_.__experimentalUseSlotFills)(rd.slotName),o=(0,c_.__experimentalUseSlotFills)(sS.name),r=!!(t&&t.length),n=!!(o&&o.length);return!r&&!n?null:(0,u_.jsxs)(c_.PanelBody,{className:"block-editor-block-inspector__advanced",title:(0,ise.__)("Advanced"),initialOpen:e,children:[(0,u_.jsx)(fe.Slot,{group:"advanced"}),(0,u_.jsx)(sS.Slot,{})]})},xP=UTe;var Fb=l(A(),1),wP=l(F(),1),MF=l(N(),1);var d_=l(w(),1),HTe=()=>{let{selectedClientIds:e,selectedBlocks:t,hasPositionAttribute:o}=(0,wP.useSelect)(s=>{let{getBlocksByClientId:a,getSelectedBlockClientIds:c}=s(_),u=c(),d=a(u);return{selectedClientIds:u,selectedBlocks:d,hasPositionAttribute:d?.some(({attributes:f})=>!!f?.style?.position?.type)}},[]),{updateBlockAttributes:r}=(0,wP.useDispatch)(_),n=Ro();function i(){if(!e?.length||!t?.length)return;let s=Object.fromEntries(t?.map(({clientId:a,attributes:c})=>[a,{style:Me({...c?.style,position:{...c?.style?.position,type:void 0,top:void 0,right:void 0,bottom:void 0,left:void 0}})}]));r(e,s,!0)}return(0,d_.jsx)(Fb.__experimentalToolsPanel,{className:"block-editor-block-inspector__position",label:(0,MF.__)("Position"),resetAll:i,dropdownMenuProps:n,children:(0,d_.jsx)(Fb.__experimentalToolsPanelItem,{isShownByDefault:o,label:(0,MF.__)("Position"),hasValue:()=>o,onDeselect:i,children:(0,d_.jsx)(fe.Slot,{group:"position"})})})},GTe=()=>{let e=(0,Fb.__experimentalUseSlotFills)(Wi.position.name);return!(e&&e.length)?null:(0,d_.jsx)(HTe,{})},CP=GTe;var Za=l(w(),1),WTe=({showAdvancedControls:e=!1})=>{let t=(0,BP.__experimentalUseSlotFills)(Wi.default.name),o=(0,BP.__experimentalUseSlotFills)(Wi.position.name),r=(0,BP.__experimentalUseSlotFills)(Wi.bindings.name),n=!!t?.length||!!o?.length||!!r?.length;return(0,Za.jsxs)(Za.Fragment,{children:[(0,Za.jsx)(fe.Slot,{}),(0,Za.jsx)(CP,{}),(0,Za.jsx)(fe.Slot,{group:"bindings"}),e&&(0,Za.jsx)("div",{children:(0,Za.jsx)(xP,{initialOpen:!n})})]})},sse=WTe;var Xb=l(N(),1),m2=l(F(),1);var y_=l($(),1),$F=l(A(),1),Zb=l(R(),1),uae=l(ut(),1),dae=l(F(),1);var WF={};Ip(WF,{AdvancedPanel:()=>ZP,BackgroundPanel:()=>o2,BorderPanel:()=>jP,ColorPanel:()=>WP,DimensionsPanel:()=>DP,FiltersPanel:()=>KP,ImageSettingsPanel:()=>tae,TypographyPanel:()=>OP,useHasBackgroundPanel:()=>v_,useHasBorderPanel:()=>zP,useHasBorderPanelControls:()=>p_,useHasColorPanel:()=>GP,useHasDimensionsPanel:()=>MP,useHasFiltersPanel:()=>Qse,useHasImageSettingsPanel:()=>eae,useHasTypographyPanel:()=>RP,useSettingsForBlockElement:()=>TP});var EP=l(R(),1),ase=l(F(),1),DF=l($(),1),rp=l(N(),1);function TP(e,t,o){let{supportedStyles:r,supports:n}=(0,ase.useSelect)(i=>({supportedStyles:M(i(DF.store)).getSupportedStyles(t,o),supports:i(DF.store).getBlockType(t)?.supports}),[t,o]);return(0,EP.useMemo)(()=>{let i={...e};return r.includes("fontSize")||(i.typography={...i.typography,fontSizes:{},customFontSize:!1,defaultFontSizes:!1}),r.includes("fontFamily")||(i.typography={...i.typography,fontFamilies:{}}),i.color={...i.color,text:i.color?.text&&r.includes("color"),background:i.color?.background&&(r.includes("background")||r.includes("backgroundColor")),button:i.color?.button&&r.includes("buttonColor"),heading:i.color?.heading&&r.includes("headingColor"),link:i.color?.link&&r.includes("linkColor"),caption:i.color?.caption&&r.includes("captionColor")},r.includes("background")||(i.color.gradients=[],i.color.customGradient=!1),r.includes("filter")||(i.color.defaultDuotone=!1,i.color.customDuotone=!1),["lineHeight","fontStyle","fontWeight","letterSpacing","textAlign","textTransform","textDecoration","textIndent","writingMode"].forEach(s=>{r.includes(s)||(i.typography={...i.typography,[s]:!1})}),r.includes("textIndent")&&(i.typography={...i.typography,textIndent:i.typography?.textIndent??"subsequent"}),r.includes("columnCount")||(i.typography={...i.typography,textColumns:!1}),["contentSize","wideSize"].forEach(s=>{r.includes(s)||(i.layout={...i.layout,[s]:!1})}),["padding","margin","blockGap"].forEach(s=>{r.includes(s)||(i.spacing={...i.spacing,[s]:!1});let a=Array.isArray(n?.spacing?.[s])?n?.spacing?.[s]:n?.spacing?.[s]?.sides;a?.length&&i.spacing?.[s]&&(i.spacing={...i.spacing,[s]:{...i.spacing?.[s],sides:a}})}),["aspectRatio","height","minHeight","width"].forEach(s=>{r.includes(s)||(i.dimensions={...i.dimensions,[s]:!1})}),["radius","color","style","width"].forEach(s=>{r.includes("border"+s.charAt(0).toUpperCase()+s.slice(1))||(i.border={...i.border,[s]:!1})}),["backgroundImage","backgroundSize"].forEach(s=>{r.includes(s)||(i.background={...i.background,[s]:!1})}),i.shadow=r.includes("shadow")?i.shadow:!1,i},[e,r,n])}function Xa(e){let t=e?.color?.palette?.custom,o=e?.color?.palette?.theme,r=e?.color?.palette?.default,n=e?.color?.defaultPalette;return(0,EP.useMemo)(()=>{let i=[];return o&&o.length&&i.push({name:(0,rp._x)("Theme","Indicates this palette comes from the theme."),colors:o}),n&&r&&r.length&&i.push({name:(0,rp._x)("Default","Indicates this palette comes from WordPress."),colors:r}),t&&t.length&&i.push({name:(0,rp._x)("Custom","Indicates this palette is created by the user."),colors:t}),i},[t,o,r,n])}function f_(e){let t=e?.color?.gradients?.custom,o=e?.color?.gradients?.theme,r=e?.color?.gradients?.default,n=e?.color?.defaultGradients;return(0,EP.useMemo)(()=>{let i=[];return o&&o.length&&i.push({name:(0,rp._x)("Theme","Indicates this palette comes from the theme."),gradients:o}),n&&r&&r.length&&i.push({name:(0,rp._x)("Default","Indicates this palette comes from WordPress."),gradients:r}),t&&t.length&&i.push({name:(0,rp._x)("Custom","Indicates this palette is created by the user."),gradients:t}),i},[t,o,r,n])}var io=l(A(),1),Mo=l(N(),1),jb=l(R(),1);var zb=l(N(),1);var lse=l(R(),1),IP=l(A(),1),VF=l(w(),1),$Te=[{label:(0,zb.__)("Align text left"),value:"left",icon:Jc},{label:(0,zb.__)("Align text center"),value:"center",icon:Sf},{label:(0,zb.__)("Align text right"),value:"right",icon:eu},{label:(0,zb.__)("Justify text"),value:"justify",icon:OO}],KTe=["left","center","right"];function PP({className:e,value:t,onChange:o,options:r=KTe}){let n=(0,lse.useMemo)(()=>$Te.filter(i=>r.includes(i.value)),[r]);return n.length?(0,VF.jsx)(IP.__experimentalToggleGroupControl,{isDeselectable:!0,__next40pxDefaultSize:!0,label:(0,zb.__)("Text alignment"),className:V("block-editor-text-alignment-control",e),value:t,onChange:i=>{o(i===t?void 0:i)},children:n.map(i=>(0,VF.jsx)(IP.__experimentalToggleGroupControlOptionIcon,{value:i.value,icon:i.icon,label:i.label},i.value))}):null}var No=l(A(),1),m_=l(N(),1);var ns=l(w(),1);function cse({__next40pxDefaultSize:e=!1,value:t,onChange:o,__unstableInputWidth:r="60px",withSlider:n=!1,hasBottomMargin:i=!1,help:s,...a}){let[c]=me("spacing.units"),u=(0,No.__experimentalUseCustomUnits)({availableUnits:c||["px","em","rem","ch","%","vw","vh"],defaultValues:{px:16,em:2,rem:2,ch:2}}),[d,f]=(0,No.__experimentalParseQuantityAndUnitFromRawValue)(t,u),m=!!f&&["em","rem","%","ch","vw","vh"].includes(f);return n?(0,ns.jsxs)(No.__experimentalView,{style:i?{marginBottom:12}:void 0,children:[(0,ns.jsx)(No.BaseControl.VisualLabel,{children:(0,m_.__)("Line indent")}),(0,ns.jsxs)(No.Flex,{children:[(0,ns.jsx)(No.FlexItem,{isBlock:!0,children:(0,ns.jsx)(No.__experimentalUnitControl,{__next40pxDefaultSize:e,__shouldNotWarnDeprecated36pxSize:!0,label:(0,m_.__)("Line indent"),labelPosition:"top",hideLabelFromVision:!0,value:t,onChange:o,size:a.size,units:u,__unstableInputWidth:r,min:0})}),n&&(0,ns.jsx)(No.FlexItem,{isBlock:!0,children:(0,ns.jsx)(No.__experimentalSpacer,{marginX:2,marginBottom:0,children:(0,ns.jsx)(No.RangeControl,{__next40pxDefaultSize:e,__shouldNotWarnDeprecated36pxSize:!0,label:(0,m_.__)("Line indent"),hideLabelFromVision:!0,value:d,withInputField:!1,onChange:h=>{o?.(h===void 0?void 0:h+(f??"px"))},min:0,max:m?10:100,step:m?.1:1,initialPosition:0})})})]}),s&&(0,ns.jsx)("p",{className:"components-base-control__help",children:s})]}):(0,ns.jsx)(No.__experimentalUnitControl,{__next40pxDefaultSize:e,__shouldNotWarnDeprecated36pxSize:!0,...a,label:(0,m_.__)("Line indent"),value:t,__unstableInputWidth:r,units:u,onChange:o,help:s})}function dse(e,t){let o=e?.typography?.fontFamilies,r=["default","theme","custom"].flatMap(i=>o?.[i]??[]),n=r.find(i=>i.fontFamily===t)?.fontFace??[];return{fontFamilies:r,fontFamilyFaces:n}}function use(e,t){return t=typeof t=="number"?t.toString():t,!t||typeof t!="string"?"":!e||e.length===0?t:e?.reduce((r,{value:n})=>{let i=Math.abs(parseInt(n)-parseInt(t)),s=Math.abs(parseInt(r)-parseInt(t));return i<s?n:r},e[0]?.value)}function YTe(e,t){return typeof t!="string"||!t||!["normal","italic","oblique"].includes(t)?"":!e||e.length===0||e.find(r=>r.value===t)?t:t==="oblique"&&!e.find(r=>r.value==="oblique")?"italic":""}function fse(e,t,o){let r=t,n=o,{fontStyles:i,fontWeights:s,combinedStyleAndWeightOptions:a}=ib(e),c=i?.some(({value:d})=>d===t),u=s?.some(({value:d})=>d?.toString()===o?.toString());return c||(r=t?YTe(i,t):a?.find(d=>d.style.fontWeight===use(s,o))?.style?.fontStyle),u||(n=o?use(s,o):a?.find(d=>d.style.fontStyle===(r||t))?.style?.fontWeight),{nearestFontStyle:r,nearestFontWeight:n}}var Je=l(w(),1),qTe=1,ZTe=6;function RP(e){let t=pse(e),o=hse(e),r=gse(e),n=bse(e),i=vse(e),s=kse(e),a=yse(e),c=xse(e),u=Sse(e),d=_se(e),f=mse(e);return t||o||r||n||i||s||f||a||c||u||d}function mse(e){return e?.typography?.defaultFontSizes!==!1&&e?.typography?.fontSizes?.default?.length||e?.typography?.fontSizes?.theme?.length||e?.typography?.fontSizes?.custom?.length||e?.typography?.customFontSize}function pse(e){return["default","theme","custom"].some(t=>e?.typography?.fontFamilies?.[t]?.length)}function hse(e){return e?.typography?.lineHeight}function gse(e){return e?.typography?.fontStyle||e?.typography?.fontWeight}function XTe(e){return e?.typography?.fontStyle?e?.typography?.fontWeight?(0,Mo.__)("Appearance"):(0,Mo.__)("Font style"):(0,Mo.__)("Font weight")}function bse(e){return e?.typography?.letterSpacing}function kse(e){return e?.typography?.textTransform}function vse(e){return e?.typography?.textAlign}function yse(e){return e?.typography?.textDecoration}function Sse(e){return e?.typography?.writingMode}function _se(e){return e?.typography?.textColumns}function xse(e){return e?.typography?.textIndent}function QTe(e){let t=e?.typography?.fontSizes,o=!!e?.typography?.defaultFontSizes;return[...t?.custom??[],...t?.theme??[],...o?t?.default??[]:[]]}function JTe({resetAllFilter:e,onChange:t,value:o,panelId:r,children:n}){let i=Ro(),s=()=>{let a=e(o);t(a)};return(0,Je.jsx)(io.__experimentalToolsPanel,{label:(0,Mo.__)("Typography"),resetAll:s,panelId:r,dropdownMenuProps:i,children:n})}var eIe={fontFamily:!0,fontSize:!0,fontAppearance:!0,lineHeight:!0,letterSpacing:!0,textAlign:!0,textTransform:!0,textDecoration:!0,textIndent:!0,writingMode:!0,textColumns:!0};function OP({as:e=JTe,value:t,onChange:o,inheritedValue:r=t,settings:n,panelId:i,defaultControls:s=eIe,isGlobalStyles:a=!1}){let c=te=>wn({settings:n},"",te),u=pse(n),d=c(r?.typography?.fontFamily),{fontFamilies:f,fontFamilyFaces:m}=(0,jb.useMemo)(()=>dse(n,d),[n,d]),h=te=>{let Le=f?.find(({fontFamily:cn})=>cn===te)?.slug,ct=pe(t,["typography","fontFamily"],Le?`var:preset|font-family|${Le}`:te||void 0),Gc=f?.find(({fontFamily:cn})=>cn===te)?.fontFace??[],{fontStyles:ua,fontWeights:Bp}=ib(Gc),jk=ua?.some(({value:cn})=>cn===T),hf=Bp?.some(({value:cn})=>cn?.toString()===O?.toString());if(!jk||!hf){let{nearestFontStyle:cn,nearestFontWeight:Ep}=fse(Gc,T,O);cn||Ep?ct={...ct,typography:{...ct?.typography,fontStyle:cn||void 0,fontWeight:Ep||void 0}}:(T||O)&&(ct={...ct,typography:{...ct?.typography,fontStyle:void 0,fontWeight:void 0}})}o(ct)},p=()=>!!t?.typography?.fontFamily,g=()=>h(void 0),b=mse(n),v=!n?.typography?.customFontSize,k=QTe(n),y=c(r?.typography?.fontSize),S=(()=>{let te=r?.typography?.fontSize;if(!te||typeof te!="string")return;if(te.startsWith("var:preset|font-size|"))return te.replace("var:preset|font-size|","");let Le=te.match(/^var\(--wp--preset--font-size--([^)]+)\)$/);if(Le)return Le[1]})(),x=(te,Le)=>{let ct=Le?.slug?`var:preset|font-size|${Le?.slug}`:te;o(pe(t,["typography","fontSize"],ct||void 0))},C=()=>!!t?.typography?.fontSize,B=()=>x(void 0),I=gse(n),P=XTe(n),E=n?.typography?.fontStyle,L=n?.typography?.fontWeight,T=c(r?.typography?.fontStyle),O=c(r?.typography?.fontWeight),D=(0,jb.useCallback)(({fontStyle:te,fontWeight:Le})=>{(te!==T||Le!==O)&&o({...t,typography:{...t?.typography,fontStyle:te||void 0,fontWeight:Le||void 0}})},[T,O,o,t]),U=()=>!!t?.typography?.fontStyle||!!t?.typography?.fontWeight,G=(0,jb.useCallback)(()=>{D({})},[D]),j=hse(n),z=c(r?.typography?.lineHeight),W=te=>{o(pe(t,["typography","lineHeight"],te||void 0))},ee=()=>t?.typography?.lineHeight!==void 0,se=()=>W(void 0),ce=bse(n),ie=c(r?.typography?.letterSpacing),re=te=>{o(pe(t,["typography","letterSpacing"],te||void 0))},Q=()=>!!t?.typography?.letterSpacing,Y=()=>re(void 0),J=xse(n),K=c(r?.typography?.textIndent),X=(n?.typography?.textIndent??"subsequent")==="all",ne=te=>{o(pe(t,["typography","textIndent"],te||void 0))},le=te=>{o({...t,settings:{typography:{textIndent:te?"all":"subsequent"}}})},ve=()=>!!t?.typography?.textIndent,he=()=>{o(pe(t,["typography","textIndent"],void 0))},xe=X?(0,Mo.__)("Indents the first line of all paragraphs."):(0,Mo.__)("Indents the first line of each paragraph after the first one."),ze=_se(n),ot=c(r?.typography?.textColumns),Wt=te=>{o(pe(t,["typography","textColumns"],te||void 0))},fo=()=>!!t?.typography?.textColumns,Do=()=>Wt(void 0),rt=kse(n),ar=c(r?.typography?.textTransform),xt=te=>{o(pe(t,["typography","textTransform"],te||void 0))},At=()=>!!t?.typography?.textTransform,Pe=()=>xt(void 0),wt=yse(n),qo=c(r?.typography?.textDecoration),$t=te=>{o(pe(t,["typography","textDecoration"],te||void 0))},lr=()=>!!t?.typography?.textDecoration,ln=()=>$t(void 0),je=Sse(n),Eo=c(r?.typography?.writingMode),Ze=te=>{o(pe(t,["typography","writingMode"],te||void 0))},Ve=()=>!!t?.typography?.writingMode,gt=()=>Ze(void 0),To=vse(n),cr=c(r?.typography?.textAlign),ge=te=>{o(pe(t,["typography","textAlign"],te||void 0))},Ct=()=>!!t?.typography?.textAlign,Io=()=>ge(void 0),Ke=(0,jb.useCallback)(te=>({...te,typography:{}}),[]);return(0,Je.jsxs)(e,{resetAllFilter:Ke,value:t,onChange:o,panelId:i,children:[u&&(0,Je.jsx)(io.__experimentalToolsPanelItem,{label:(0,Mo.__)("Font"),hasValue:p,onDeselect:g,isShownByDefault:s.fontFamily,panelId:i,children:(0,Je.jsx)(rI,{fontFamilies:f,value:d,onChange:h,size:"__unstable-large"})}),b&&(0,Je.jsx)(io.__experimentalToolsPanelItem,{label:(0,Mo.__)("Size"),hasValue:C,onDeselect:B,isShownByDefault:s.fontSize,panelId:i,children:(0,Je.jsx)(io.FontSizePicker,{value:S||y,valueMode:S?"slug":"literal",onChange:x,fontSizes:k,disableCustomFontSizes:v,withReset:!1,withSlider:!0,size:"__unstable-large"})}),I&&(0,Je.jsx)(io.__experimentalToolsPanelItem,{label:P,hasValue:U,onDeselect:G,isShownByDefault:s.fontAppearance,panelId:i,children:(0,Je.jsx)(oI,{value:{fontStyle:T,fontWeight:O},onChange:D,hasFontStyles:E,hasFontWeights:L,fontFamilyFaces:m,size:"__unstable-large"})}),j&&(0,Je.jsx)(io.__experimentalToolsPanelItem,{className:"single-column",label:(0,Mo.__)("Line height"),hasValue:ee,onDeselect:se,isShownByDefault:s.lineHeight,panelId:i,children:(0,Je.jsx)(HI,{__unstableInputWidth:"auto",value:z,onChange:W,size:"__unstable-large"})}),ce&&(0,Je.jsx)(io.__experimentalToolsPanelItem,{className:"single-column",label:(0,Mo.__)("Letter spacing"),hasValue:Q,onDeselect:Y,isShownByDefault:s.letterSpacing,panelId:i,children:(0,Je.jsx)(iI,{value:ie,onChange:re,size:"__unstable-large",__unstableInputWidth:"auto"})}),J&&(0,Je.jsxs)(io.__experimentalToolsPanelItem,{label:(0,Mo.__)("Line indent"),hasValue:ve,onDeselect:he,isShownByDefault:s.textIndent,panelId:i,children:[(0,Je.jsx)(cse,{value:K,onChange:ne,size:"__unstable-large",__unstableInputWidth:"auto",withSlider:!0,hasBottomMargin:a}),a&&(0,Je.jsx)(io.ToggleControl,{label:(0,Mo.__)("Indent all paragraphs"),checked:X,onChange:le,help:xe})]}),ze&&(0,Je.jsx)(io.__experimentalToolsPanelItem,{className:"single-column",label:(0,Mo.__)("Columns"),hasValue:fo,onDeselect:Do,isShownByDefault:s.textColumns,panelId:i,children:(0,Je.jsx)(io.__experimentalNumberControl,{label:(0,Mo.__)("Columns"),max:ZTe,min:qTe,onChange:Wt,size:"__unstable-large",spinControls:"custom",value:ot,initialPosition:1})}),wt&&(0,Je.jsx)(io.__experimentalToolsPanelItem,{className:"single-column",label:(0,Mo.__)("Decoration"),hasValue:lr,onDeselect:ln,isShownByDefault:s.textDecoration,panelId:i,children:(0,Je.jsx)(aI,{value:qo,onChange:$t,size:"__unstable-large",__unstableInputWidth:"auto"})}),je&&(0,Je.jsx)(io.__experimentalToolsPanelItem,{className:"single-column",label:(0,Mo.__)("Orientation"),hasValue:Ve,onDeselect:gt,isShownByDefault:s.writingMode,panelId:i,children:(0,Je.jsx)(dI,{value:Eo,onChange:Ze,size:"__unstable-large"})}),rt&&(0,Je.jsx)(io.__experimentalToolsPanelItem,{label:(0,Mo.__)("Letter case"),hasValue:At,onDeselect:Pe,isShownByDefault:s.textTransform,panelId:i,children:(0,Je.jsx)(cI,{value:ar,onChange:xt,showNone:!0,isBlock:!0,size:"__unstable-large"})}),To&&(0,Je.jsxs)(io.__experimentalToolsPanelItem,{label:(0,Mo.__)("Text alignment"),hasValue:Ct,onDeselect:Io,isShownByDefault:s.textAlign,panelId:i,children:[(0,Je.jsx)(PP,{value:cr,onChange:ge,options:["left","center","right","justify"],size:"__unstable-large"}),cr==="justify"&&(0,Je.jsx)("div",{children:(0,Je.jsx)(io.Notice,{status:"warning",isDismissible:!1,children:(0,Mo.__)("Justified text can reduce readability. For better accessibility, use left-aligned text instead.")})})]})]})}var Zt=l(N(),1),jt=l(A(),1);var Hb=l(R(),1);var et=l(A(),1),Go=l(N(),1),Cse=l(R(),1),AP=l(F(),1);var wse=l(F(),1);function np(e,t){let{getBlockOrder:o,getBlockAttributes:r}=(0,wse.useSelect)(_);return(i,s)=>{let a=(s-1)*t+i-1,c=0;for(let u of o(e)){let{columnStart:d,rowStart:f}=r(u).style?.layout??{};(f-1)*t+d-1<a&&c++}return c}}var qt=l(w(),1);function tIe(e,t){let{orientation:o="horizontal"}=t;return e==="fill"?(0,Go.__)("Stretch to fill available space."):e==="fixed"&&o==="horizontal"?(0,Go.__)("Specify a fixed width."):e==="fixed"?(0,Go.__)("Specify a fixed height."):(0,Go.__)("Fit contents.")}function Bse({value:e={},onChange:t,parentLayout:o,isShownByDefault:r,panelId:n}){let{type:i,default:{type:s="default"}={}}=o??{},a=i||s;return a==="flex"?(0,qt.jsx)(oIe,{childLayout:e,onChange:t,parentLayout:o,isShownByDefault:r,panelId:n}):a==="grid"?(0,qt.jsx)(nIe,{childLayout:e,onChange:t,parentLayout:o,isShownByDefault:r,panelId:n}):null}function oIe({childLayout:e,onChange:t,parentLayout:o,isShownByDefault:r,panelId:n}){let{selfStretch:i,flexSize:s}=e,{orientation:a="horizontal"}=o??{},c=()=>!!i,u=a==="horizontal"?(0,Go.__)("Width"):(0,Go.__)("Height"),[d]=me("spacing.units"),f=(0,et.__experimentalUseCustomUnits)({availableUnits:d||["%","px","em","rem","vh","vw"]}),m=()=>{t({selfStretch:void 0,flexSize:void 0})};return(0,Cse.useEffect)(()=>{i==="fixed"&&!s&&t({...e,selfStretch:"fit"})},[]),(0,qt.jsxs)(et.__experimentalVStack,{as:et.__experimentalToolsPanelItem,spacing:2,hasValue:c,label:u,onDeselect:m,isShownByDefault:r,panelId:n,children:[(0,qt.jsxs)(et.__experimentalToggleGroupControl,{size:"__unstable-large",label:rIe(o),value:i||"fit",help:tIe(i,o),onChange:h=>{t({selfStretch:h,flexSize:h!=="fixed"?null:s})},isBlock:!0,children:[(0,qt.jsx)(et.__experimentalToggleGroupControlOption,{value:"fit",label:(0,Go._x)("Fit","Intrinsic block width in flex layout")},"fit"),(0,qt.jsx)(et.__experimentalToggleGroupControlOption,{value:"fill",label:(0,Go._x)("Grow","Block with expanding width in flex layout")},"fill"),(0,qt.jsx)(et.__experimentalToggleGroupControlOption,{value:"fixed",label:(0,Go._x)("Fixed","Block with fixed width in flex layout")},"fixed")]}),i==="fixed"&&(0,qt.jsx)(et.__experimentalUnitControl,{size:"__unstable-large",units:f,onChange:h=>{t({selfStretch:i,flexSize:h})},value:s,min:0,label:u,hideLabelFromVision:!0})]})}function rIe(e){let{orientation:t="horizontal"}=e;return t==="horizontal"?(0,Go.__)("Width"):(0,Go.__)("Height")}function nIe({childLayout:e,onChange:t,parentLayout:o,isShownByDefault:r,panelId:n}){let{columnStart:i,rowStart:s,columnSpan:a,rowSpan:c}=e,{columnCount:u,rowCount:d}=o??{},f=(0,AP.useSelect)(x=>x(_).getBlockRootClientId(n)),{moveBlocksToPosition:m,__unstableMarkNextChangeAsNotPersistent:h}=(0,AP.useDispatch)(_),p=np(f,u||3),g=()=>!!i||!!s,b=()=>!!a||!!c,v=()=>{t({columnStart:void 0,rowStart:void 0})},k=()=>{t({columnSpan:void 0,rowSpan:void 0})},y=u?u-(i??1)+1:void 0,S=window.__experimentalEnableGridInteractivity&&d?d-(s??1)+1:void 0;return(0,qt.jsxs)(qt.Fragment,{children:[(0,qt.jsxs)(et.Flex,{as:et.__experimentalToolsPanelItem,hasValue:b,label:(0,Go.__)("Grid span"),onDeselect:k,isShownByDefault:r,panelId:n,children:[(0,qt.jsx)(et.FlexItem,{style:{width:"50%"},children:(0,qt.jsx)(et.__experimentalInputControl,{size:"__unstable-large",label:(0,Go.__)("Column span"),type:"number",onChange:x=>{let C=x===""?1:parseInt(x,10),B=y?Math.min(C,y):C;t({columnStart:i,rowStart:s,rowSpan:c,columnSpan:B})},value:a??1,min:1,max:y})}),(0,qt.jsx)(et.FlexItem,{style:{width:"50%"},children:(0,qt.jsx)(et.__experimentalInputControl,{size:"__unstable-large",label:(0,Go.__)("Row span"),type:"number",onChange:x=>{let C=x===""?1:parseInt(x,10),B=S?Math.min(C,S):C;t({columnStart:i,rowStart:s,columnSpan:a,rowSpan:B})},value:c??1,min:1,max:S})})]}),window.__experimentalEnableGridInteractivity&&(0,qt.jsxs)(et.Flex,{as:et.__experimentalToolsPanelItem,hasValue:g,label:(0,Go.__)("Grid placement"),onDeselect:v,isShownByDefault:!1,panelId:n,children:[(0,qt.jsx)(et.FlexItem,{style:{width:"50%"},children:(0,qt.jsx)(et.__experimentalInputControl,{size:"__unstable-large",label:(0,Go.__)("Column"),type:"number",onChange:x=>{let C=x===""?1:parseInt(x,10);t({columnStart:C,rowStart:s,columnSpan:a,rowSpan:c}),h(),m([n],f,f,p(C,s))},value:i??1,min:1,max:u?u-(a??1)+1:void 0})}),(0,qt.jsx)(et.FlexItem,{style:{width:"50%"},children:(0,qt.jsx)(et.__experimentalInputControl,{size:"__unstable-large",label:(0,Go.__)("Row"),type:"number",onChange:x=>{let C=x===""?1:parseInt(x,10);t({columnStart:i,rowStart:C,columnSpan:a,rowSpan:c}),h(),m([n],f,f,p(i,C))},value:s??1,min:1,max:d?d-(c??1)+1:void 0})})]})]})}var LP=l(A(),1),Ub=l(N(),1);var FF=l(w(),1);function NP({panelId:e,value:t,onChange:o=()=>{},options:r,defaultValue:n="auto",hasValue:i,isShownByDefault:s=!0}){let a=t??"auto",[c,u,d]=me("dimensions.aspectRatios.default","dimensions.aspectRatios.theme","dimensions.defaultAspectRatios"),f=u?.map(({name:p,ratio:g})=>({label:p,value:g})),m=c?.map(({name:p,ratio:g})=>({label:p,value:g})),h=[{label:(0,Ub._x)("Original","Aspect ratio option for dimensions control"),value:"auto"},...d?m:[],...f||[],{label:(0,Ub._x)("Custom","Aspect ratio option for dimensions control"),value:"custom",disabled:!0,hidden:!0}];return(0,FF.jsx)(LP.__experimentalToolsPanelItem,{hasValue:i||(()=>a!==n),label:(0,Ub.__)("Aspect ratio"),onDeselect:()=>o(void 0),isShownByDefault:s,panelId:e,children:(0,FF.jsx)(LP.SelectControl,{label:(0,Ub.__)("Aspect ratio"),value:a,options:r??h,onChange:o,size:"__unstable-large"})})}var We=l(w(),1),zF=["horizontal","vertical"];function MP(e){let t=Ise(e),o=Pse(e),r=Rse(e),n=Ose(e),i=Ase(e),s=Lse(e),a=Nse(e),c=Mse(e),u=Dse(e),d=Vse(e);return Hb.Platform.OS==="web"&&(t||o||r||n||i||s||a||c||u||d)}function Ise(e){return e?.layout?.contentSize}function Pse(e){return e?.layout?.wideSize}function Rse(e){return e?.spacing?.padding}function Ose(e){return e?.spacing?.margin}function Ase(e){return e?.spacing?.blockGap}function Lse(e){return e?.dimensions?.height}function Nse(e){return e?.dimensions?.minHeight}function Mse(e){return e?.dimensions?.width}function Dse(e){return e?.dimensions?.aspectRatio}function Vse(e){let{type:t="default",default:{type:o="default"}={},allowSizingOnChildren:r=!1}=e?.parentLayout??{},n=(o==="flex"||t==="flex"||o==="grid"||t==="grid")&&r;return!!e?.layout&&n}function iIe(e){let{defaultSpacingSizes:t,spacingSizes:o}=e?.spacing||{};return t!==!1&&o?.default?.length>0||o?.theme?.length>0||o?.custom?.length>0}function Ese(e,t){if(!t||!e)return e;let o={};return t.forEach(r=>{r==="vertical"&&(o.top=e.top,o.bottom=e.bottom),r==="horizontal"&&(o.left=e.left,o.right=e.right),o[r]=e?.[r]}),o}function Tse(e){return e&&typeof e=="string"?{top:e,right:e,bottom:e,left:e}:e}function sIe(e,t){return e&&(typeof e=="string"?t?{top:e,right:e,bottom:e,left:e}:{top:e}:{...e,right:e?.left,bottom:e?.top})}function aIe({resetAllFilter:e,onChange:t,value:o,panelId:r,children:n}){let i=Ro(),s=()=>{let a=e(o);t(a)};return(0,We.jsx)(jt.__experimentalToolsPanel,{label:(0,Zt.__)("Dimensions"),resetAll:s,panelId:r,dropdownMenuProps:i,children:n})}var ea={contentSize:!0,wideSize:!0,padding:!0,margin:!0,blockGap:!0,height:!0,minHeight:!0,width:!0,aspectRatio:!0,childLayout:!0};function DP({as:e=aIe,value:t,onChange:o,inheritedValue:r=t,settings:n,panelId:i,defaultControls:s=ea,onVisualize:a=()=>{},includeLayoutControls:c=!1}){let{dimensions:u,spacing:d}=n,f=te=>te&&typeof te=="object"?Object.keys(te).reduce((Le,ct)=>(Le[ct]=wn({settings:{dimensions:u,spacing:d}},"",te[ct]),Le),{}):wn({settings:{dimensions:u,spacing:d}},"",te),m=iIe(n),h=(0,jt.__experimentalUseCustomUnits)({availableUnits:n?.spacing?.units||["%","px","em","rem","vw"]}),p=-1/0,[g,b]=(0,Hb.useState)(p),v=Ise(n)&&c,k=f(r?.layout?.contentSize),y=te=>{o(pe(t,["layout","contentSize"],te||void 0))},S=()=>!!t?.layout?.contentSize,x=()=>y(void 0),C=Pse(n)&&c,B=f(r?.layout?.wideSize),I=te=>{o(pe(t,["layout","wideSize"],te||void 0))},P=()=>!!t?.layout?.wideSize,E=()=>I(void 0),L=Rse(n),T=f(r?.spacing?.padding),O=Tse(T),D=Array.isArray(n?.spacing?.padding)?n?.spacing?.padding:n?.spacing?.padding?.sides,U=D&&D.some(te=>zF.includes(te)),G=te=>{let Le=Ese(te,D);o(pe(t,["spacing","padding"],Le))},j=()=>!!t?.spacing?.padding&&Object.keys(t?.spacing?.padding).length,z=()=>G(void 0),W=()=>a("padding"),ee=Ose(n),se=f(r?.spacing?.margin),ce=Tse(se),ie=Array.isArray(n?.spacing?.margin)?n?.spacing?.margin:n?.spacing?.margin?.sides,re=ie&&ie.some(te=>zF.includes(te)),Q=te=>{let Le=Ese(te,ie);o(pe(t,["spacing","margin"],Le))},Y=()=>!!t?.spacing?.margin&&Object.keys(t?.spacing?.margin).length,J=()=>Q(void 0),K=()=>a("margin"),H=Ase(n),X=Array.isArray(n?.spacing?.blockGap)?n?.spacing?.blockGap:n?.spacing?.blockGap?.sides,ne=X&&X.some(te=>zF.includes(te)),le=f(r?.spacing?.blockGap),ve=sIe(le,ne),he=te=>{o(pe(t,["spacing","blockGap"],te))},xe=te=>{te||he(null),!ne&&te?.hasOwnProperty("top")?he(te.top):he({top:te?.top,left:te?.left})},ze=()=>he(void 0),ot=()=>!!t?.spacing?.blockGap,Wt=Nse(n),fo=f(r?.dimensions?.minHeight),Do=te=>{let Le=pe(t,["dimensions","minHeight"],te);o(pe(Le,["dimensions","aspectRatio"],void 0))},rt=()=>{Do(void 0)},ar=()=>!!t?.dimensions?.minHeight,xt=Lse(n),At=f(r?.dimensions?.height),Pe=te=>{let Le=pe(t,["dimensions","height"],te);o(pe(Le,["dimensions","aspectRatio"],void 0))},wt=()=>{Pe(void 0)},qo=()=>!!t?.dimensions?.height,$t=Mse(n),lr=f(r?.dimensions?.width),ln=te=>{o(pe(t,["dimensions","width"],te))},je=()=>{ln(void 0)},Eo=()=>!!t?.dimensions?.width,Ze=Dse(n),Ve=f(r?.dimensions?.aspectRatio),gt=te=>{let Le=pe(t,["dimensions","aspectRatio"],te);o(pe(Le,["dimensions","minHeight"],void 0))},To=()=>!!t?.dimensions?.aspectRatio,cr=Vse(n),ge=r?.layout,Ct=te=>{o({...t,layout:{...te}})},Io=(0,Hb.useCallback)(te=>({...te,layout:Me({...te?.layout,contentSize:void 0,wideSize:void 0,selfStretch:void 0,flexSize:void 0,columnStart:void 0,rowStart:void 0,columnSpan:void 0,rowSpan:void 0}),spacing:{...te?.spacing,padding:void 0,margin:void 0,blockGap:void 0},dimensions:{...te?.dimensions,height:void 0,minHeight:void 0,aspectRatio:void 0,width:void 0}}),[]),Ke=()=>a(!1);return(0,We.jsxs)(e,{resetAllFilter:Io,value:t,onChange:o,panelId:i,children:[(v||C)&&(0,We.jsx)("span",{className:"span-columns",children:(0,Zt.__)("Set the width of the main content area.")}),v&&(0,We.jsx)(jt.__experimentalToolsPanelItem,{label:(0,Zt.__)("Content width"),hasValue:S,onDeselect:x,isShownByDefault:s.contentSize??ea.contentSize,panelId:i,children:(0,We.jsx)(jt.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:(0,Zt.__)("Content width"),labelPosition:"top",value:k||"",onChange:te=>{y(te)},units:h,prefix:(0,We.jsx)(jt.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,We.jsx)(we,{icon:_f})})})}),C&&(0,We.jsx)(jt.__experimentalToolsPanelItem,{label:(0,Zt.__)("Wide width"),hasValue:P,onDeselect:E,isShownByDefault:s.wideSize??ea.wideSize,panelId:i,children:(0,We.jsx)(jt.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:(0,Zt.__)("Wide width"),labelPosition:"top",value:B||"",onChange:te=>{I(te)},units:h,prefix:(0,We.jsx)(jt.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,We.jsx)(we,{icon:Lf})})})}),L&&(0,We.jsxs)(jt.__experimentalToolsPanelItem,{hasValue:j,label:(0,Zt.__)("Padding"),onDeselect:z,isShownByDefault:s.padding??ea.padding,className:V({"tools-panel-item-spacing":m}),panelId:i,children:[!m&&(0,We.jsx)(jt.BoxControl,{__next40pxDefaultSize:!0,values:O,onChange:G,label:(0,Zt.__)("Padding"),sides:D,units:h,allowReset:!1,splitOnAxis:U,inputProps:{onMouseOver:W,onMouseOut:Ke}}),m&&(0,We.jsx)(Db,{values:O,onChange:G,label:(0,Zt.__)("Padding"),sides:D,units:h,allowReset:!1,onMouseOver:W,onMouseOut:Ke})]}),ee&&(0,We.jsxs)(jt.__experimentalToolsPanelItem,{hasValue:Y,label:(0,Zt.__)("Margin"),onDeselect:J,isShownByDefault:s.margin??ea.margin,className:V({"tools-panel-item-spacing":m}),panelId:i,children:[!m&&(0,We.jsx)(jt.BoxControl,{__next40pxDefaultSize:!0,values:ce,onChange:Q,inputProps:{min:g,onDragStart:()=>{b(0)},onDragEnd:()=>{b(p)},onMouseOver:K,onMouseOut:Ke},label:(0,Zt.__)("Margin"),sides:ie,units:h,allowReset:!1,splitOnAxis:re}),m&&(0,We.jsx)(Db,{values:ce,onChange:Q,minimumCustomValue:-1/0,label:(0,Zt.__)("Margin"),sides:ie,units:h,allowReset:!1,onMouseOver:K,onMouseOut:Ke})]}),H&&(0,We.jsxs)(jt.__experimentalToolsPanelItem,{hasValue:ot,label:(0,Zt.__)("Block spacing"),onDeselect:ze,isShownByDefault:s.blockGap??ea.blockGap,className:V({"tools-panel-item-spacing":m,"single-column":!m&&!ne}),panelId:i,children:[!m&&(ne?(0,We.jsx)(jt.BoxControl,{__next40pxDefaultSize:!0,label:(0,Zt.__)("Block spacing"),min:0,onChange:xe,units:h,sides:X,values:ve,allowReset:!1,splitOnAxis:ne}):(0,We.jsx)(jt.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:(0,Zt.__)("Block spacing"),min:0,onChange:he,units:h,value:le})),m&&(0,We.jsx)(Db,{label:(0,Zt.__)("Block spacing"),min:0,onChange:xe,showSideInLabel:!1,sides:ne?X:["top"],values:ve,allowReset:!1})]}),cr&&(0,We.jsx)(Bse,{value:ge,onChange:Ct,parentLayout:n?.parentLayout,panelId:i,isShownByDefault:s.childLayout??ea.childLayout}),Wt&&(0,We.jsx)(jt.__experimentalToolsPanelItem,{hasValue:ar,label:(0,Zt.__)("Minimum height"),onDeselect:rt,isShownByDefault:s.minHeight??ea.minHeight,panelId:i,children:(0,We.jsx)(lb,{label:(0,Zt.__)("Minimum height"),value:fo,onChange:Do})}),xt&&(0,We.jsx)(jt.__experimentalToolsPanelItem,{hasValue:qo,label:(0,Zt.__)("Height"),onDeselect:wt,isShownByDefault:s.height??ea.height,panelId:i,children:(0,We.jsx)(lb,{label:(0,Zt.__)("Height"),value:At,onChange:Pe})}),$t&&(0,We.jsx)(jt.__experimentalToolsPanelItem,{hasValue:Eo,label:(0,Zt.__)("Width"),onDeselect:je,isShownByDefault:s.width??ea.width,panelId:i,children:(0,We.jsx)(lb,{label:(0,Zt.__)("Width"),value:lr,onChange:ln})}),Ze&&(0,We.jsx)(NP,{hasValue:To,value:Ve,onChange:gt,panelId:i,isShownByDefault:s.aspectRatio??ea.aspectRatio})]})}var en=l(A(),1),Wb=l(R(),1),Gb=l(N(),1);var ip=l(N(),1),xo=l(A(),1),FP=l(R(),1);var Rt=l(w(),1),VP=[];function lIe({shadow:e,onShadowChange:t,settings:o}){let r=jF(o);return(0,Rt.jsx)("div",{className:"block-editor-global-styles__shadow-popover-container",children:(0,Rt.jsxs)(xo.__experimentalVStack,{spacing:4,children:[(0,Rt.jsx)(xo.__experimentalHeading,{level:5,children:(0,ip.__)("Drop shadow")}),(0,Rt.jsx)(cIe,{presets:r,activeShadow:e,onSelect:t}),(0,Rt.jsx)("div",{className:"block-editor-global-styles__clear-shadow",children:(0,Rt.jsx)(xo.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>t(void 0),disabled:!e,accessibleWhenDisabled:!0,children:(0,ip.__)("Clear")})})]})})}function cIe({presets:e,activeShadow:t,onSelect:o}){return e?(0,Rt.jsx)(xo.Composite,{role:"listbox",className:"block-editor-global-styles__shadow__list","aria-label":(0,ip.__)("Drop shadows"),children:e.map(({name:r,slug:n,shadow:i})=>(0,Rt.jsx)(uIe,{label:r,isActive:i===t,type:n==="unset"?"unset":"preset",onSelect:()=>o(i===t?void 0:i),shadow:i},n))}):null}function uIe({type:e,label:t,isActive:o,onSelect:r,shadow:n}){return(0,Rt.jsx)(xo.Tooltip,{text:t,children:(0,Rt.jsx)(xo.Composite.Item,{role:"option","aria-label":t,"aria-selected":o,className:V("block-editor-global-styles__shadow__item",{"is-active":o}),render:(0,Rt.jsx)("button",{className:V("block-editor-global-styles__shadow-indicator",{unset:e==="unset"}),onClick:r,style:{boxShadow:n},"aria-label":t,children:o&&(0,Rt.jsx)(we,{icon:gl})})})})}function Fse({shadow:e,onShadowChange:t,settings:o}){return(0,Rt.jsx)(xo.Dropdown,{popoverProps:{placement:"left-start",offset:36,shift:!0},className:"block-editor-global-styles__shadow-dropdown",renderToggle:dIe(e,t),renderContent:()=>(0,Rt.jsx)(xo.__experimentalDropdownContentWrapper,{paddingSize:"medium",children:(0,Rt.jsx)(lIe,{shadow:e,onShadowChange:t,settings:o})})})}function dIe(e,t){return function({onToggle:r,isOpen:n}){let i=(0,FP.useRef)(void 0),s={onClick:r,className:V("block-editor-global-styles__shadow-dropdown-toggle",{"is-open":n}),"aria-expanded":n,ref:i},a={onClick:()=>{n&&r(),t(void 0),i.current?.focus()},className:V("block-editor-global-styles__shadow-editor__remove-button",{"is-open":n}),label:(0,ip.__)("Remove")};return(0,Rt.jsxs)(Rt.Fragment,{children:[(0,Rt.jsx)(xo.Button,{__next40pxDefaultSize:!0,...s,children:(0,Rt.jsxs)(xo.__experimentalHStack,{justify:"flex-start",children:[(0,Rt.jsx)(we,{className:"block-editor-global-styles__toggle-icon",icon:iN,size:24}),(0,Rt.jsx)(xo.FlexItem,{children:(0,ip.__)("Drop shadow")})]})}),!!e&&(0,Rt.jsx)(xo.Button,{__next40pxDefaultSize:!0,size:"small",icon:Dr,...a})]})}}function jF(e){return(0,FP.useMemo)(()=>{if(!e?.shadow)return VP;let t=e?.shadow?.defaultPresets,{default:o,theme:r,custom:n}=e?.shadow?.presets??{},i={name:(0,ip.__)("Unset"),slug:"unset",shadow:"none"},s=[...t&&o||VP,...r||VP,...n||VP];return s.length&&s.unshift(i),s},[e])}var ta=l(w(),1);function zP(e){return Object.values(p_(e)).some(Boolean)}function p_(e){return{hasBorderColor:zse(e),hasBorderRadius:jse(e),hasBorderStyle:Use(e),hasBorderWidth:Hse(e),hasShadow:Gse(e)}}function zse(e){return e?.border?.color}function jse(e){return e?.border?.radius}function Use(e){return e?.border?.style}function Hse(e){return e?.border?.width}function Gse(e){let t=jF(e);return!!e?.shadow&&t.length>0}function fIe({resetAllFilter:e,onChange:t,value:o,panelId:r,children:n,label:i}){let s=Ro();return(0,ta.jsx)(en.__experimentalToolsPanel,{label:i,resetAll:()=>{let c=e(o);t(c)},panelId:r,dropdownMenuProps:s,children:n})}var mIe={radius:!0,color:!0,width:!0,shadow:!0};function jP({as:e=fIe,value:t,onChange:o,inheritedValue:r=t,settings:n,panelId:i,name:s,defaultControls:a=mIe}){let c=Xa(n),u=(0,Wb.useCallback)(j=>wn({settings:n},"",j),[n]),d=j=>{let W=c.flatMap(({colors:ee})=>ee).find(({color:ee})=>ee===j);return W?"var:preset|color|"+W.slug:j},f=(0,Wb.useMemo)(()=>{if((0,en.__experimentalHasSplitBorders)(r?.border)){let j={...r?.border};return["top","right","bottom","left"].forEach(z=>{j[z]={...j[z],color:u(j[z]?.color)}}),j}return{...r?.border,color:r?.border?.color?u(r?.border?.color):void 0}},[r?.border,u]),m=j=>o({...t,border:j}),h=zse(n),p=Use(n),g=Hse(n),b=jse(n),v=(0,Wb.useMemo)(()=>typeof r?.border?.radius!="object"?u(r?.border?.radius):{topLeft:u(r?.border?.radius?.topLeft),topRight:u(r?.border?.radius?.topRight),bottomLeft:u(r?.border?.radius?.bottomLeft),bottomRight:u(r?.border?.radius?.bottomRight)},[r?.border?.radius,u]),k=j=>m({...f,radius:j}),y=()=>{let j=t?.border?.radius;return typeof j=="object"?Object.entries(j).some(Boolean):!!j},S=Gse(n),x=u(r?.shadow),C=n?.shadow?.presets??{},B=C.custom??C.theme??C.default??[],I=j=>{let z=B?.find(({shadow:W})=>W===j)?.slug;o(pe(t,["shadow"],z?`var:preset|shadow|${z}`:j||void 0))},P=()=>!!t?.shadow,E=()=>I(void 0),L=()=>{if(y())return m({radius:t?.border?.radius});m(void 0)},T=j=>{let z={...j};(0,en.__experimentalHasSplitBorders)(z)?["top","right","bottom","left"].forEach(W=>{z[W]&&(z[W]={...z[W],color:d(z[W]?.color)})}):z&&(z.color=d(z.color)),m({radius:f?.radius,...z})},O=(0,Wb.useCallback)(j=>({...j,border:void 0,shadow:void 0}),[]),D=a?.color||a?.width,U=h||p||g||b,G=$b({blockName:s,hasShadowControl:S,hasBorderControl:U});return(0,ta.jsxs)(e,{resetAllFilter:O,value:t,onChange:o,panelId:i,label:G,children:[(g||h)&&(0,ta.jsx)(en.__experimentalToolsPanelItem,{hasValue:()=>(0,en.__experimentalIsDefinedBorder)(t?.border),label:(0,Gb.__)("Border"),onDeselect:()=>L(),isShownByDefault:D,panelId:i,children:(0,ta.jsx)(en.BorderBoxControl,{colors:c,enableAlpha:!0,enableStyle:p,onChange:T,popoverOffset:40,popoverPlacement:"left-start",value:f,__experimentalIsRenderedInSidebar:!0,size:"__unstable-large",hideLabelFromVision:!S,label:(0,Gb.__)("Border")})}),b&&(0,ta.jsx)(en.__experimentalToolsPanelItem,{hasValue:y,label:(0,Gb.__)("Radius"),onDeselect:()=>k(void 0),isShownByDefault:a.radius,panelId:i,children:(0,ta.jsx)(ZT,{presets:n?.border?.radiusSizes,values:v,onChange:j=>{k(j||void 0)}})}),S&&(0,ta.jsxs)(en.__experimentalToolsPanelItem,{label:(0,Gb.__)("Shadow"),hasValue:P,onDeselect:E,isShownByDefault:a.shadow,panelId:i,children:[U?(0,ta.jsx)(en.BaseControl.VisualLabel,{as:"legend",children:(0,Gb.__)("Shadow")}):null,(0,ta.jsx)(Fse,{shadow:x,onShadowChange:I,settings:n})]})]})}var Qt=l(A(),1),HP=l(R(),1),Xt=l(N(),1);var at=l(w(),1);function GP(e){let t=$se(e),o=Zse(e),r=Kse(e),n=Dd(e),i=qse(e),s=Yse(e);return t||o||r||n||i||s}function $se(e){let t=Xa(e);return e?.color?.text&&(t?.length>0||e?.color?.custom)}function Kse(e){let t=Xa(e);return e?.color?.link&&(t?.length>0||e?.color?.custom)}function Yse(e){let t=Xa(e);return e?.color?.caption&&(t?.length>0||e?.color?.custom)}function Dd(e){let t=Xa(e),o=f_(e);return e?.color?.heading&&(t?.length>0||e?.color?.custom||o?.length>0||e?.color?.customGradient)}function qse(e){let t=Xa(e),o=f_(e);return e?.color?.button&&(t?.length>0||e?.color?.custom||o?.length>0||e?.color?.customGradient)}function Zse(e){let t=Xa(e),o=f_(e);return e?.color?.background&&(t?.length>0||e?.color?.custom||o?.length>0||e?.color?.customGradient)}function UF({resetAllFilter:e,onChange:t,value:o,panelId:r,children:n,label:i}){let s=Ro(),a=()=>{let c=e(o);t(c)};return(0,at.jsx)(Qt.__experimentalToolsPanel,{label:i||(0,Xt.__)("Elements"),resetAll:a,panelId:r,hasInnerWrapper:!0,headingLevel:3,className:"color-block-support-panel",__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",dropdownMenuProps:s,children:(0,at.jsx)("div",{className:"color-block-support-panel__inner-wrapper",children:n})})}var pIe={text:!0,background:!0,link:!0,heading:!0,button:!0,caption:!0},hIe={placement:"left-start",offset:36,shift:!0},{Tabs:UP}=M(Qt.privateApis),gIe=({indicators:e,label:t})=>(0,at.jsxs)(Qt.__experimentalHStack,{justify:"flex-start",children:[(0,at.jsx)(Qt.__experimentalZStack,{isLayered:!1,offset:-8,children:e.map((o,r)=>(0,at.jsx)(Qt.Flex,{expanded:!1,children:(0,at.jsx)(Qt.ColorIndicator,{colorValue:o})},r))}),(0,at.jsx)(Qt.FlexItem,{className:"block-editor-panel-color-gradient-settings__color-name",children:t})]});function Wse({isGradient:e,inheritedValue:t,userValue:o,setValue:r,colorGradientControlSettings:n}){return(0,at.jsx)(_d,{...n,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,colorValue:e?void 0:t,gradientValue:e?t:void 0,onColorChange:e?void 0:r,onGradientChange:e?r:void 0,clearable:t===o,headingLevel:3})}function bIe({label:e,hasValue:t,resetValue:o,isShownByDefault:r,indicators:n,tabs:i,colorGradientControlSettings:s,panelId:a}){let c=i.find(m=>m.userValue!==void 0),{key:u,...d}=i[0]??{},f=(0,HP.useRef)(void 0);return(0,at.jsx)(Qt.__experimentalToolsPanelItem,{className:"block-editor-tools-panel-color-gradient-settings__item",hasValue:t,label:e,onDeselect:o,isShownByDefault:r,panelId:a,children:(0,at.jsx)(Qt.Dropdown,{popoverProps:hIe,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:({onToggle:m,isOpen:h})=>{let p={onClick:m,className:V("block-editor-panel-color-gradient-settings__dropdown",{"is-open":h}),"aria-expanded":h,ref:f};return(0,at.jsxs)(at.Fragment,{children:[(0,at.jsx)(Qt.Button,{...p,__next40pxDefaultSize:!0,children:(0,at.jsx)(gIe,{indicators:n,label:e})}),t()&&(0,at.jsx)(Qt.Button,{__next40pxDefaultSize:!0,label:(0,Xt.__)("Reset"),className:"block-editor-panel-color-gradient-settings__reset",size:"small",icon:Dr,onClick:()=>{o(),h&&m(),f.current?.focus()}})]})},renderContent:()=>(0,at.jsx)(Qt.__experimentalDropdownContentWrapper,{paddingSize:"none",children:(0,at.jsxs)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content",children:[i.length===1&&(0,at.jsx)(Wse,{...d,colorGradientControlSettings:s},u),i.length>1&&(0,at.jsxs)(UP,{defaultTabId:c?.key,children:[(0,at.jsx)(UP.TabList,{children:i.map(m=>(0,at.jsx)(UP.Tab,{tabId:m.key,children:m.label},m.key))}),i.map(m=>{let{key:h,...p}=m;return(0,at.jsx)(UP.TabPanel,{tabId:h,focusable:!1,children:(0,at.jsx)(Wse,{...p,colorGradientControlSettings:s},h)},h)})]})]})})})})}function WP({as:e=UF,value:t,onChange:o,inheritedValue:r=t,settings:n,panelId:i,defaultControls:s=pIe,label:a,children:c}){let u=Xa(n),d=f_(n),f=n?.color?.custom,m=n?.color?.customGradient,h=u.length>0||f,p=d.length>0||m,g=H=>wn({settings:n},"",H),b=H=>{let ne=u.flatMap(({colors:le})=>le).find(({color:le})=>le===H);return ne?"var:preset|color|"+ne.slug:H},v=H=>{let ne=d.flatMap(({gradients:le})=>le).find(({gradient:le})=>le===H);return ne?"var:preset|gradient|"+ne.slug:H},k=Zse(n),y=g(r?.color?.background),S=g(t?.color?.background),x=g(r?.color?.gradient),C=g(t?.color?.gradient),B=()=>!!S||!!C,I=H=>{let X=pe(t,["color","background"],b(H));X.color.gradient=void 0,o(X)},P=H=>{let X=pe(t,["color","gradient"],v(H));X.color.background=void 0,o(X)},E=()=>{let H=pe(t,["color","background"],void 0);H.color.gradient=void 0,o(H)},L=Kse(n),T=g(r?.elements?.link?.color?.text),O=g(t?.elements?.link?.color?.text),D=H=>{o(pe(t,["elements","link","color","text"],b(H)))},U=g(r?.elements?.link?.[":hover"]?.color?.text),G=g(t?.elements?.link?.[":hover"]?.color?.text),j=H=>{o(pe(t,["elements","link",":hover","color","text"],b(H)))},z=()=>!!O||!!G,W=()=>{let H=pe(t,["elements","link",":hover","color","text"],void 0);H=pe(H,["elements","link","color","text"],void 0),o(H)},ee=$se(n),se=g(r?.color?.text),ce=g(t?.color?.text),ie=()=>!!ce,re=H=>{let X=pe(t,["color","text"],b(H));se===T&&(X=pe(X,["elements","link","color","text"],b(H))),o(X)},Q=()=>re(void 0),Y=[{name:"caption",label:(0,Xt.__)("Captions"),showPanel:Yse(n)},{name:"button",label:(0,Xt.__)("Button"),showPanel:qse(n)},{name:"heading",label:(0,Xt.__)("Heading"),showPanel:Dd(n)},{name:"h1",label:(0,Xt.__)("H1"),showPanel:Dd(n)},{name:"h2",label:(0,Xt.__)("H2"),showPanel:Dd(n)},{name:"h3",label:(0,Xt.__)("H3"),showPanel:Dd(n)},{name:"h4",label:(0,Xt.__)("H4"),showPanel:Dd(n)},{name:"h5",label:(0,Xt.__)("H5"),showPanel:Dd(n)},{name:"h6",label:(0,Xt.__)("H6"),showPanel:Dd(n)}],J=(0,HP.useCallback)(H=>({...H,color:void 0,elements:{...H?.elements,link:{...H?.elements?.link,color:void 0,":hover":{color:void 0}},...Y.reduce((X,ne)=>({...X,[ne.name]:{...H?.elements?.[ne.name],color:void 0}}),{})}}),[Y]),K=[ee&&{key:"text",label:(0,Xt.__)("Text"),hasValue:ie,resetValue:Q,isShownByDefault:s.text,indicators:[se],tabs:[{key:"text",label:(0,Xt.__)("Text"),inheritedValue:se,setValue:re,userValue:ce}]},k&&{key:"background",label:(0,Xt.__)("Background"),hasValue:B,resetValue:E,isShownByDefault:s.background,indicators:[x??y],tabs:[h&&{key:"background",label:(0,Xt.__)("Color"),inheritedValue:y,setValue:I,userValue:S},p&&{key:"gradient",label:(0,Xt.__)("Gradient"),inheritedValue:x,setValue:P,userValue:C,isGradient:!0}].filter(Boolean)},L&&{key:"link",label:(0,Xt.__)("Link"),hasValue:z,resetValue:W,isShownByDefault:s.link,indicators:[T,U],tabs:[{key:"link",label:(0,Xt.__)("Default"),inheritedValue:T,setValue:D,userValue:O},{key:"hover",label:(0,Xt.__)("Hover"),inheritedValue:U,setValue:j,userValue:G}]}].filter(Boolean);return Y.forEach(({name:H,label:X,showPanel:ne})=>{if(!ne)return;let le=g(r?.elements?.[H]?.color?.background),ve=g(r?.elements?.[H]?.color?.gradient),he=g(r?.elements?.[H]?.color?.text),xe=g(t?.elements?.[H]?.color?.background),ze=g(t?.elements?.[H]?.color?.gradient),ot=g(t?.elements?.[H]?.color?.text),Wt=()=>!!(ot||xe||ze),fo=()=>{let Pe=pe(t,["elements",H,"color","background"],void 0);Pe.elements[H].color.gradient=void 0,Pe.elements[H].color.text=void 0,o(Pe)},Do=Pe=>{o(pe(t,["elements",H,"color","text"],b(Pe)))},rt=Pe=>{let wt=pe(t,["elements",H,"color","background"],b(Pe));wt.elements[H].color.gradient=void 0,o(wt)},ar=Pe=>{let wt=pe(t,["elements",H,"color","gradient"],v(Pe));wt.elements[H].color.background=void 0,o(wt)},xt=!0,At=H!=="caption";K.push({key:H,label:X,hasValue:Wt,resetValue:fo,isShownByDefault:s[H],indicators:xt&&At?[he,ve??le]:[xt?he:ve??le],tabs:[h&&xt&&{key:"text",label:(0,Xt.__)("Text"),inheritedValue:he,setValue:Do,userValue:ot},h&&At&&{key:"background",label:(0,Xt.__)("Background"),inheritedValue:le,setValue:rt,userValue:xe},p&&At&&{key:"gradient",label:(0,Xt.__)("Gradient"),inheritedValue:ve,setValue:ar,userValue:ze,isGradient:!0}].filter(Boolean)})}),(0,at.jsxs)(e,{resetAllFilter:J,value:t,onChange:o,panelId:i,label:a,children:[K.map(H=>{let{key:X,...ne}=H;return(0,at.jsx)(bIe,{...ne,colorGradientControlSettings:{colors:u,disableCustomColors:!f,gradients:d,disableCustomGradients:!m},panelId:i},X)}),c]})}var mt=l(A(),1),Sc=l(N(),1),Kb=l(R(),1);var so=l(w(),1),$P=[];function Xse(e,{presetSetting:t,defaultSetting:o}){let r=!e?.color?.[o],n=e?.color?.[t]?.custom||$P,i=e?.color?.[t]?.theme||$P,s=e?.color?.[t]?.default||$P;return(0,Kb.useMemo)(()=>[...n,...i,...r?$P:s],[r,n,i,s])}function Qse(e){return Jse(e)}function Jse(e){return e.color.customDuotone||e.color.defaultDuotone||e.color.duotone.length>0}function kIe({resetAllFilter:e,onChange:t,value:o,panelId:r,children:n}){let i=Ro(),s=()=>{let a=e(o);t(a)};return(0,so.jsx)(mt.__experimentalToolsPanel,{label:(0,Sc._x)("Filters","Name for applying graphical effects"),resetAll:s,panelId:r,dropdownMenuProps:i,children:n})}var vIe={duotone:!0},yIe={placement:"left-start",offset:36,shift:!0,className:"block-editor-duotone-control__popover",headerTitle:(0,Sc.__)("Duotone")},SIe=({indicator:e,label:t})=>(0,so.jsxs)(mt.__experimentalHStack,{justify:"flex-start",children:[(0,so.jsx)(mt.__experimentalZStack,{isLayered:!1,offset:-8,children:(0,so.jsx)(mt.Flex,{expanded:!1,children:e==="unset"||!e?(0,so.jsx)(mt.ColorIndicator,{className:"block-editor-duotone-control__unset-indicator"}):(0,so.jsx)(mt.DuotoneSwatch,{values:e})})}),(0,so.jsx)(mt.FlexItem,{title:t,children:t})]}),_Ie=(e,t)=>function({onToggle:r,isOpen:n}){let i=(0,Kb.useRef)(void 0),s={onClick:r,className:V("block-editor-global-styles-filters-panel__dropdown-toggle",{"is-open":n}),"aria-expanded":n,ref:i},a={onClick:()=>{n&&r(),t(),i.current?.focus()},className:"block-editor-panel-duotone-settings__reset",label:(0,Sc.__)("Reset")};return(0,so.jsxs)(so.Fragment,{children:[(0,so.jsx)(mt.Button,{__next40pxDefaultSize:!0,...s,children:(0,so.jsx)(SIe,{indicator:e,label:(0,Sc.__)("Duotone")})}),e&&(0,so.jsx)(mt.Button,{size:"small",icon:Dr,...a})]})};function KP({as:e=kIe,value:t,onChange:o,inheritedValue:r=t,settings:n,panelId:i,defaultControls:s=vIe}){let a=b=>wn({settings:n},"",b),c=Jse(n),u=Xse(n,{presetSetting:"duotone",defaultSetting:"defaultDuotone"}),d=Xse(n,{presetSetting:"palette",defaultSetting:"defaultPalette"}),f=a(r?.filter?.duotone),m=b=>{let v=u.find(({colors:y})=>y===b),k=v?`var:preset|duotone|${v.slug}`:b;o(pe(t,["filter","duotone"],k))},h=()=>!!t?.filter?.duotone,p=()=>m(void 0),g=(0,Kb.useCallback)(b=>({...b,filter:{...b.filter,duotone:void 0}}),[]);return(0,so.jsx)(e,{resetAllFilter:g,value:t,onChange:o,panelId:i,children:c&&(0,so.jsx)(mt.__experimentalToolsPanelItem,{label:(0,Sc.__)("Duotone"),hasValue:h,onDeselect:p,isShownByDefault:s.duotone,panelId:i,children:(0,so.jsx)(mt.Dropdown,{popoverProps:yIe,className:"block-editor-global-styles-filters-panel__dropdown",renderToggle:_Ie(f,p),renderContent:()=>(0,so.jsx)(mt.__experimentalDropdownContentWrapper,{paddingSize:"small",children:(0,so.jsxs)(mt.MenuGroup,{label:(0,Sc.__)("Duotone"),children:[(0,so.jsx)("p",{children:(0,Sc.__)("Create a two-tone color effect without losing your original image.")}),(0,so.jsx)(mt.DuotonePicker,{colorPalette:d,duotonePalette:u,disableCustomColors:!0,disableCustomDuotone:!0,value:f,onChange:m})]})})})})})}var Yb=l(A(),1),h_=l(N(),1);var sp=l(w(),1);function eae(e,t,o){return e==="core/image"&&o?.lightbox?.allowEditing||!!t?.lightbox}function tae({onChange:e,value:t,inheritedValue:o,panelId:r}){let n=Ro(),i=()=>{e(void 0)},s=c=>{e({enabled:c})},a=!1;return o?.lightbox?.enabled&&(a=o.lightbox.enabled),(0,sp.jsx)(sp.Fragment,{children:(0,sp.jsx)(Yb.__experimentalToolsPanel,{label:(0,h_._x)("Settings","Image settings"),resetAll:i,panelId:r,dropdownMenuProps:n,children:(0,sp.jsx)(Yb.__experimentalToolsPanelItem,{hasValue:()=>!!t?.lightbox,label:(0,h_.__)("Enlarge on click"),onDeselect:i,isShownByDefault:!0,panelId:r,children:(0,sp.jsx)(Yb.ToggleControl,{label:(0,h_.__)("Enlarge on click"),checked:a,onChange:s})})})})}var qb=l(A(),1),oae=l(R(),1),YP=l(N(),1);var g_=l(w(),1);function qP(e){return!(typeof e=="string"&&/<\/?\w/.test(e))}function ZP({value:e,onChange:t,inheritedValue:o=e,help:r}){let[n,i]=(0,oae.useState)(null),s=o?.css;function a(u){if(t({...e,css:u}),!qP(u)){i((0,YP.__)("The custom CSS is invalid. Do not use <> markup."));return}n&&i(null)}function c(u){let d=u?.target?.value;if(!d||!qP(d))return;let[f]=Uh([{css:d}],".for-validation-only");i(f===null?(0,YP.__)("There is an error with your CSS structure."):null)}return(0,g_.jsxs)(qb.__experimentalVStack,{spacing:3,children:[n&&(0,g_.jsx)(qb.Notice,{status:"error",onRemove:()=>i(null),children:n}),(0,g_.jsx)(qb.TextareaControl,{label:(0,YP.__)("Additional CSS"),value:s,onChange:u=>a(u),onBlur:c,className:"block-editor-global-styles-advanced-panel__custom-css-input",spellCheck:!1,help:r})]})}var e2=l(A(),1),t2=l(R(),1),GF=l(N(),1);var Be=l(A(),1);var Ot=l(N(),1),nae=l(Un(),1),HF=l(dn(),1),_c=l(R(),1),b_=l(F(),1),iae=l(Fe(),1),sae=l(F5(),1);var Te=l(w(),1),XP="image",xIe={placement:"left-start",offset:36,shift:!0,className:"block-editor-global-styles-background-panel__popover"},JP=()=>{},QP=e=>{window.requestAnimationFrame(()=>{let[t]=iae.focus.tabbable.find(e?.current);t&&t.focus()})};function wIe(e){return e==="cover"||e===void 0?(0,Ot.__)("Image covers the space evenly."):e==="contain"?(0,Ot.__)("Image is contained without distortion."):(0,Ot.__)("Image has a fixed width.")}var CIe=e=>{if(!e||isNaN(e.x)&&isNaN(e.y))return;let t=isNaN(e.x)?.5:e.x,o=isNaN(e.y)?.5:e.y;return`${t*100}% ${o*100}%`},BIe=e=>{if(!e)return{x:void 0,y:void 0};let[t,o]=e.split(" ").map(r=>parseFloat(r)/100);return t=isNaN(t)?void 0:t,o=isNaN(o)?t:o,{x:t,y:o}};function aae({as:e="span",imgUrl:t,toggleProps:o={},filename:r,label:n,onToggleCallback:i=JP}){let{isOpen:s,...a}=o;(0,_c.useEffect)(()=>{typeof s<"u"&&i(s)},[s,i]);let c=()=>(0,Te.jsxs)(Be.__experimentalHStack,{className:"block-editor-global-styles-background-panel__inspector-preview-inner",children:[(0,Te.jsx)("span",{className:"block-editor-global-styles-background-panel__inspector-image-indicator",style:{backgroundImage:t?`url(${t})`:void 0}}),(0,Te.jsxs)(Be.FlexBlock,{children:[(0,Te.jsx)(Be.__experimentalTruncate,{numberOfLines:1,className:"block-editor-global-styles-background-panel__inspector-media-replace-title",children:n}),(0,Te.jsx)(Be.VisuallyHidden,{as:"span",children:t?(0,Ot.sprintf)((0,Ot.__)("Background image: %s"),r||n):(0,Ot.__)("No background image selected")})]})]});return e==="button"?(0,Te.jsx)(Be.Button,{__next40pxDefaultSize:!0,...a,children:c()}):c()}function EIe({label:e,filename:t,url:o,children:r,onToggle:n=JP,hasImageValue:i,onReset:s,containerRef:a}){if(!i)return;let c=e||(0,HF.getFilename)(o)||(0,Ot.__)("Image");return(0,Te.jsx)(Be.Dropdown,{popoverProps:xIe,renderToggle:({onToggle:u,isOpen:d})=>{let f={onClick:u,className:"block-editor-global-styles-background-panel__dropdown-toggle","aria-expanded":d,"aria-label":(0,Ot.__)("Background size, position and repeat options."),isOpen:d};return(0,Te.jsxs)(Te.Fragment,{children:[(0,Te.jsx)(aae,{imgUrl:o,filename:t,label:c,toggleProps:f,as:"button",onToggleCallback:n}),s&&(0,Te.jsx)(Be.Button,{__next40pxDefaultSize:!0,label:(0,Ot.__)("Reset"),className:"block-editor-global-styles-background-panel__reset",size:"small",icon:Dr,onClick:()=>{s(),d&&u(),QP(a)}})]})},renderContent:()=>(0,Te.jsx)(Be.__experimentalDropdownContentWrapper,{className:"block-editor-global-styles-background-panel__dropdown-content-wrapper",paddingSize:"medium",children:r})})}function TIe(){return(0,Te.jsx)(Be.Placeholder,{className:"block-editor-global-styles-background-panel__loading",children:(0,Te.jsx)(Be.Spinner,{})})}function rae({onChange:e,style:t,inheritedValue:o,onRemoveImage:r=JP,onResetImage:n=JP,displayInPanel:i,defaultValues:s,containerRef:a}){let[c,u]=(0,_c.useState)(!1),{getSettings:d}=(0,b_.useSelect)(_),{id:f,title:m,url:h}=t?.background?.backgroundImage||{...o?.background?.backgroundImage},{createErrorNotice:p}=(0,b_.useDispatch)(nae.store),g=B=>{p(B,{type:"snackbar"}),u(!1)},b=()=>e(pe(t,["background","backgroundImage"],void 0)),v=B=>{if(!B||!B.url){b(),u(!1);return}if((0,sae.isBlobURL)(B.url)){u(!0);return}if(B.media_type&&B.media_type!==XP||!B.media_type&&B.type&&B.type!==XP){g((0,Ot.__)("Only images can be used as a background image."));return}let I=t?.background?.backgroundSize||s?.backgroundSize,P=t?.background?.backgroundPosition;e(pe(t,["background"],{...t?.background,backgroundImage:{url:B.url,id:B.id,source:"file",title:B.title||void 0},backgroundPosition:!P&&(I==="auto"||!I)?"50% 0":P,backgroundSize:I})),u(!1),QP(a)},k=B=>{d().mediaUpload({allowedTypes:[XP],filesList:B,onFileChange([I]){v(I)},onError:g,multiple:!1})},y=ap(t),S=()=>e(pe(t,["background"],{backgroundImage:"none"})),x=!y&&ap(o),C=m||(0,HF.getFilename)(h)||(0,Ot.__)("Image");return(0,Te.jsxs)("div",{className:"block-editor-global-styles-background-panel__image-tools-panel-item",children:[c&&(0,Te.jsx)(TIe,{}),(0,Te.jsx)(_b,{mediaId:f,mediaURL:h,allowedTypes:[XP],accept:"image/*",onSelect:v,popoverProps:{className:V({"block-editor-global-styles-background-panel__media-replace-popover":i})},name:(0,Te.jsx)(aae,{imgUrl:h,filename:m,label:C}),renderToggle:B=>(0,Te.jsx)(Be.Button,{...B,__next40pxDefaultSize:!0}),onError:g,onReset:()=>{QP(a),n()},children:x&&(0,Te.jsx)(Be.MenuItem,{onClick:()=>{QP(a),S(),r()},children:(0,Ot.__)("Remove")})}),(0,Te.jsx)(Be.DropZone,{onFilesDrop:k,label:(0,Ot.__)("Drop to upload")})]})}function IIe({onChange:e,style:t,inheritedValue:o,defaultValues:r}){let n=t?.background?.backgroundSize||o?.background?.backgroundSize,i=t?.background?.backgroundRepeat||o?.background?.backgroundRepeat,s=t?.background?.backgroundImage?.url||o?.background?.backgroundImage?.url,a=t?.background?.backgroundImage?.id,c=t?.background?.backgroundPosition||o?.background?.backgroundPosition,u=t?.background?.backgroundAttachment||o?.background?.backgroundAttachment,d=!n&&a?r?.backgroundSize:n||"auto";d=["cover","contain","auto"].includes(d)?d:"auto";let f=!(i==="no-repeat"||d==="cover"&&i===void 0),m=v=>{let k=i,y=c;v==="contain"&&(k="no-repeat",y=void 0),v==="cover"&&(k=void 0,y=void 0),(d==="cover"||d==="contain")&&v==="auto"&&(k=void 0,t?.background?.backgroundImage?.id&&(y="50% 0")),!v&&d==="auto"&&(v="auto"),e(pe(t,["background"],{...t?.background,backgroundPosition:y,backgroundRepeat:k,backgroundSize:v}))},h=v=>{e(pe(t,["background","backgroundPosition"],CIe(v)))},p=()=>e(pe(t,["background","backgroundRepeat"],f===!0?"no-repeat":"repeat")),g=()=>e(pe(t,["background","backgroundAttachment"],u==="fixed"?"scroll":"fixed")),b=!c&&a&&n==="contain"?r?.backgroundPosition:c;return(0,Te.jsxs)(Be.__experimentalVStack,{spacing:3,className:"single-column",children:[(0,Te.jsx)(Be.FocalPointPicker,{label:(0,Ot.__)("Focal point"),url:s,value:BIe(b),onChange:h}),(0,Te.jsx)(Be.ToggleControl,{label:(0,Ot.__)("Fixed background"),checked:u==="fixed",onChange:g}),(0,Te.jsxs)(Be.__experimentalToggleGroupControl,{size:"__unstable-large",label:(0,Ot.__)("Size"),value:d,onChange:m,isBlock:!0,help:wIe(n||r?.backgroundSize),children:[(0,Te.jsx)(Be.__experimentalToggleGroupControlOption,{value:"cover",label:(0,Ot._x)("Cover","Size option for background image control")},"cover"),(0,Te.jsx)(Be.__experimentalToggleGroupControlOption,{value:"contain",label:(0,Ot._x)("Contain","Size option for background image control")},"contain"),(0,Te.jsx)(Be.__experimentalToggleGroupControlOption,{value:"auto",label:(0,Ot._x)("Tile","Size option for background image control")},"tile")]}),(0,Te.jsxs)(Be.__experimentalHStack,{justify:"flex-start",spacing:2,as:"span",children:[(0,Te.jsx)(Be.__experimentalUnitControl,{"aria-label":(0,Ot.__)("Background image width"),onChange:m,value:n,size:"__unstable-large",__unstableInputWidth:"100px",min:0,placeholder:(0,Ot.__)("Auto"),disabled:d!=="auto"||d===void 0}),(0,Te.jsx)(Be.ToggleControl,{label:(0,Ot.__)("Repeat"),checked:f,onChange:p,disabled:d==="cover"})]})]})}function lae({value:e,onChange:t,inheritedValue:o=e,settings:r,defaultValues:n={}}){let{globalStyles:i,_links:s}=(0,b_.useSelect)(v=>{let{getSettings:k}=v(_),y=k();return{globalStyles:y[xi],_links:y[y0]}},[]),a=(0,_c.useMemo)(()=>{let v={background:{}};return o?.background?(Object.entries(o?.background).forEach(([k,y])=>{v.background[k]=Pg(y,{styles:i,_links:s})}),v):o},[i,s,o]),c=()=>t(pe(e,["background"],{})),{title:u,url:d}=e?.background?.backgroundImage||{...a?.background?.backgroundImage},f=ap(e)||ap(a),m=e?.background?.backgroundImage||o?.background?.backgroundImage,h=f&&m!=="none"&&(r?.background?.backgroundSize||r?.background?.backgroundPosition||r?.background?.backgroundRepeat),[p,g]=(0,_c.useState)(!1),b=(0,_c.useRef)();return(0,Te.jsx)("div",{ref:b,className:V("block-editor-global-styles-background-panel__inspector-media-replace-container",{"is-open":p}),children:h?(0,Te.jsx)(EIe,{label:u,filename:u,url:d,onToggle:g,hasImageValue:f,onReset:c,containerRef:b,children:(0,Te.jsxs)(Be.__experimentalVStack,{spacing:3,className:"single-column",children:[(0,Te.jsx)(rae,{onChange:t,style:e,inheritedValue:a,displayInPanel:!0,onResetImage:()=>{g(!1),c()},onRemoveImage:()=>g(!1),defaultValues:n,containerRef:b}),(0,Te.jsx)(IIe,{onChange:t,style:e,defaultValues:n,inheritedValue:a})]})}):(0,Te.jsx)(rae,{onChange:t,style:e,inheritedValue:a,defaultValues:n,onResetImage:()=>{g(!1),c()},onRemoveImage:()=>g(!1),containerRef:b})})}var k_=l(w(),1),PIe={backgroundImage:!0};function v_(e){return t2.Platform.OS==="web"&&e?.background?.backgroundImage}function ap(e){return!!e?.background?.backgroundImage?.id||typeof e?.background?.backgroundImage=="string"||!!e?.background?.backgroundImage?.url}function RIe({resetAllFilter:e,onChange:t,value:o,panelId:r,children:n,headerLabel:i}){let s=Ro();return(0,k_.jsx)(e2.__experimentalToolsPanel,{label:i,resetAll:()=>{let c=e(o);t(c)},panelId:r,dropdownMenuProps:s,children:n})}function o2({as:e=RIe,value:t,onChange:o,inheritedValue:r,settings:n,panelId:i,defaultControls:s=PIe,defaultValues:a={},headerLabel:c=(0,GF.__)("Background")}){let u=v_(n),d=()=>o(pe(t,["background"],{})),f=(0,t2.useCallback)(m=>({...m,background:{}}),[]);return(0,k_.jsx)(e,{resetAllFilter:f,value:t,onChange:o,panelId:i,headerLabel:c,children:u&&(0,k_.jsx)(e2.__experimentalToolsPanelItem,{hasValue:()=>!!t?.background,label:(0,GF.__)("Image"),onDeselect:d,isShownByDefault:s.backgroundImage,panelId:i,children:(0,k_.jsx)(lae,{value:t,onChange:o,settings:n,inheritedValue:r,defaultControls:s,defaultValues:a})})})}var n2=l(N(),1),KF=l(w(),1),cp="__experimentalBorder",S_="shadow",cae=(e,t,o)=>{let r;return e.some(n=>n.colors.some(i=>i[t]===o?(r=i,!0):!1)),r},lp=({colors:e,namedColor:t,customColor:o})=>{if(t){let n=cae(e,"slug",t);if(n)return n}if(!o)return{color:void 0};let r=cae(e,"color",o);return r||{color:o}};function r2(e){let t=/var:preset\|color\|(.+)/.exec(e);return t&&t[1]?t[1]:null}function fae(e){if((0,$F.__experimentalHasSplitBorders)(e?.border))return{style:e,borderColor:void 0};let t=e?.border?.color,o=t?.startsWith("var:preset|color|")?t.substring(17):void 0,r={...e};return r.border={...r.border,color:o?void 0:t},{style:Me(r),borderColor:o}}function mae(e){return(0,$F.__experimentalHasSplitBorders)(e.style?.border)?e.style:{...e.style,border:{...e.style?.border,color:e.borderColor?"var:preset|color|"+e.borderColor:e.style?.border?.color}}}function OIe({label:e,children:t,resetAllFilter:o}){let r=(0,Zb.useCallback)(n=>{let i=mae(n),s=o(i);return{...n,...fae(s)}},[o]);return(0,KF.jsx)(fe,{group:"border",resetAllFilter:r,label:e,children:t})}function pae({clientId:e,name:t,setAttributes:o,settings:r}){let n=zP(r),{style:i,borderColor:s}=(0,dae.useSelect)(d=>{if(!n)return{};let{style:f,borderColor:m}=d(_).getBlockAttributes(e)||{};return{style:f,borderColor:m}},[e,n]),a=(0,Zb.useMemo)(()=>mae({style:i,borderColor:s}),[i,s]),c=d=>{o(fae(d))};if(!n)return null;let u={...(0,y_.getBlockSupport)(t,[cp,"__experimentalDefaultControls"]),...(0,y_.getBlockSupport)(t,[S_,"__experimentalDefaultControls"])};return(0,KF.jsx)(jP,{as:OIe,panelId:e,settings:r,value:a,onChange:c,defaultControls:u})}function i2(e,t="any"){if(Zb.Platform.OS!=="web")return!1;let o=(0,y_.getBlockSupport)(e,cp);return o===!0?!0:t==="any"?!!(o?.color||o?.radius||o?.width||o?.style):!!o?.[t]}function $b({blockName:e,hasBorderControl:t,hasShadowControl:o}={}){let r=is(e),n=p_(r);return!t&&!o&&e&&(t=n?.hasBorderColor||n?.hasBorderStyle||n?.hasBorderWidth||n?.hasBorderRadius,o=n?.hasShadow),t&&o?(0,n2.__)("Border & Shadow"):o?(0,n2.__)("Shadow"):(0,n2.__)("Border")}function AIe(e){return!i2(e,"color")||e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}}function hae(e,t,o){if(!i2(t,"color")||Ue(t,cp,"color"))return e;let r=YF(o),n=V(e.className,r);return e.className=n||void 0,e}function YF(e){let{borderColor:t,style:o}=e,r=_i("border-color",t);return V({"has-border-color":t||o?.border?.color,[r]:!!r})}function LIe({name:e,borderColor:t,style:o}){let{colors:r}=wd();if(!i2(e,"color")||Ue(e,cp,"color"))return{};let{color:n}=lp({colors:r,namedColor:t}),{color:i}=lp({colors:r,namedColor:r2(o?.border?.top?.color)}),{color:s}=lp({colors:r,namedColor:r2(o?.border?.right?.color)}),{color:a}=lp({colors:r,namedColor:r2(o?.border?.bottom?.color)}),{color:c}=lp({colors:r,namedColor:r2(o?.border?.left?.color)});return hae({style:Me({borderTopColor:i||n,borderRightColor:s||n,borderBottomColor:a||n,borderLeftColor:c||n})||{}},e,{borderColor:t,style:o})}var qF={useBlockProps:LIe,addSaveProps:hae,attributeKeys:["borderColor","style"],hasSupport(e){return i2(e,"color")}};(0,uae.addFilter)("blocks.registerBlockType","core/border/addAttributes",AIe);var JF=l(ut(),1),xc=l($(),1),Vd=l(R(),1),Bae=l(F(),1);var XF=l($(),1),gae=l(F(),1),bae=l(R(),1);var QF=l(w(),1),up="background",ZF={backgroundSize:"cover",backgroundPosition:"50% 50%"};function s2(e,t="any"){let o=(0,XF.getBlockSupport)(e,up);return o===!0?!0:t==="any"?!!o?.backgroundImage||!!o?.backgroundSize||!!o?.backgroundRepeat:!!o?.[t]}function a2(e){if(!e||!e?.backgroundImage?.url)return;let t;return e?.backgroundSize||(t={backgroundSize:ZF.backgroundSize}),e?.backgroundSize==="contain"&&!e?.backgroundPosition&&(t={backgroundPosition:ZF.backgroundPosition}),t}function NIe({name:e,style:t}){if(!s2(e)||!t?.background?.backgroundImage)return;let o=a2(t?.background);if(o)return{style:{...o}}}function kae(e){return ap(e)?"has-background":""}function MIe({children:e}){let t=(0,bae.useCallback)(o=>({...o,style:{...o.style,background:void 0}}),[]);return(0,QF.jsx)(fe,{group:"background",resetAllFilter:t,children:e})}function vae({clientId:e,name:t,setAttributes:o,settings:r}){let{style:n,inheritedValue:i}=(0,gae.useSelect)(u=>{let{getBlockAttributes:d,getSettings:f}=u(_),m=f();return{style:d(e)?.style,inheritedValue:m[xi]?.blocks?.[t]}},[e,t]);if(!v_(r)||!s2(t,"backgroundImage"))return null;let s=u=>{o({style:Me(u)})},a={...r,background:{...r.background,backgroundSize:r?.background?.backgroundSize&&s2(t,"backgroundSize")}},c=(0,XF.getBlockSupport)(t,[up,"defaultControls"]);return(0,QF.jsx)(o2,{inheritedValue:i,as:MIe,panelId:e,defaultValues:ZF,settings:a,onChange:s,defaultControls:c,value:n})}var yae={useBlockProps:NIe,attributeKeys:["style"],hasSupport:s2};var __=l(R(),1),_ae=l(F(),1),xae=l($(),1);var wae=l(w(),1);function l2(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function Sae(e,t){if(!e||!t)return{};let o=oi(t,"color.text",{fallback:!0}),r=oi(t,"color.background",{fallback:!0}),n=e.querySelector(o)||e,i=e.querySelector(r)||e,s=e.querySelector("a"),a=l2(n,"color"),c=s&&s.textContent?l2(s,"color"):void 0,u=i,d=l2(u,"background-color");for(;d==="rgba(0, 0, 0, 0)"&&u.parentNode&&u.parentNode.nodeType===u.parentNode.ELEMENT_NODE;)u=u.parentNode,d=l2(u,"background-color");return{textColor:a,backgroundColor:d,linkColor:c}}function DIe(e,t){return Object.keys(t).some(r=>e[r]!==t[r])?t:e}function Cae({clientId:e,name:t}){let o=Xe(e),[r,n]=(0,__.useReducer)(DIe,{}),i=(0,_ae.useSelect)(s=>t?s(xae.store).getBlockType(t):void 0,[t]);return(0,__.useLayoutEffect)(()=>{!o||!i||window.requestAnimationFrame(()=>window.requestAnimationFrame(()=>n(Sae(o,i))))}),(0,__.useLayoutEffect)(()=>{if(!o||!i)return;let s=new window.MutationObserver(()=>{n(Sae(o,i))});return s.observe(o,{attributes:!0,attributeFilter:["class","style"]}),()=>{s.disconnect()}},[o,i]),(0,wae.jsx)(QT,{backgroundColor:r.backgroundColor,textColor:r.textColor,linkColor:r.linkColor,enableAlphaChecker:!0})}var c2=l(w(),1),ir="color",u2=e=>{let t=(0,xc.getBlockSupport)(e,ir);return t&&(t.link===!0||t.gradient===!0||t.background!==!1||t.text!==!1)},VIe=e=>{if(Vd.Platform.OS!=="web")return!1;let t=(0,xc.getBlockSupport)(e,ir);return t!==null&&typeof t=="object"&&!!t.link},e4=e=>{let t=(0,xc.getBlockSupport)(e,ir);return t!==null&&typeof t=="object"&&!!t.gradients},FIe=e=>{let t=(0,xc.getBlockSupport)(e,ir);return t&&t.background!==!1},zIe=e=>{let t=(0,xc.getBlockSupport)(e,ir);return t&&t.text!==!1};function jIe(e){return u2(e)&&(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),e4(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}})),e}function Eae(e,t,o){if(!u2(t)||Ue(t,ir))return e;let r=e4(t),{backgroundColor:n,textColor:i,gradient:s,style:a}=o,c=g=>!Ue(t,ir,g),u=c("text")?_i("color",i):void 0,d=c("gradients")?th(s):void 0,f=c("background")?_i("background-color",n):void 0,m=c("background")||c("gradients"),h=n||a?.color?.background||r&&(s||a?.color?.gradient),p=V(e.className,u,d,{[f]:(!r||!a?.color?.gradient)&&!!f,"has-text-color":c("text")&&(i||a?.color?.text),"has-background":m&&h,"has-link-color":c("link")&&a?.elements?.link?.color});return e.className=p||void 0,e}function Tae(e){let t=e?.color?.text,o=t?.startsWith("var:preset|color|")?t.substring(17):void 0,r=e?.color?.background,n=r?.startsWith("var:preset|color|")?r.substring(17):void 0,i=e?.color?.gradient,s=i?.startsWith("var:preset|gradient|")?i.substring(20):void 0,a={...e};return a.color={...a.color,text:o?void 0:t,background:n?void 0:r,gradient:s?void 0:i},{style:Me(a),textColor:o,backgroundColor:n,gradient:s}}function Iae(e){return{...e.style,color:{...e.style?.color,text:e.textColor?"var:preset|color|"+e.textColor:e.style?.color?.text,background:e.backgroundColor?"var:preset|color|"+e.backgroundColor:e.style?.color?.background,gradient:e.gradient?"var:preset|gradient|"+e.gradient:e.style?.color?.gradient}}}function UIe({children:e,resetAllFilter:t}){let o=(0,Vd.useCallback)(r=>{let n=Iae(r),i=t(n);return{...r,...Tae(i)}},[t]);return(0,c2.jsx)(fe,{group:"color",resetAllFilter:o,children:e})}function d2({clientId:e,name:t,setAttributes:o,settings:r,asWrapper:n,label:i,defaultControls:s}){let a=GP(r),{style:c,textColor:u,backgroundColor:d,gradient:f}=(0,Bae.useSelect)(b=>{if(!a)return{};let{style:v,textColor:k,backgroundColor:y,gradient:S}=b(_).getBlockAttributes(e)||{};return{style:v,textColor:k,backgroundColor:y,gradient:S}},[e,a]),m=(0,Vd.useMemo)(()=>Iae({style:c,textColor:u,backgroundColor:d,gradient:f}),[c,u,d,f]),h=b=>{o(Tae(b))};if(!a)return null;s=s||(0,xc.getBlockSupport)(t,[ir,"__experimentalDefaultControls"]);let p=Vd.Platform.OS==="web"&&!m?.color?.gradient&&(r?.color?.text||r?.color?.link)&&(0,xc.getBlockSupport)(t,[ir,"enableContrastChecker"])!==!1;return(0,c2.jsx)(WP,{as:n||UIe,panelId:e,settings:r,value:m,onChange:h,defaultControls:s,label:i,enableContrastChecker:(0,xc.getBlockSupport)(t,[ir,"enableContrastChecker"])!==!1,children:p&&(0,c2.jsx)(Cae,{clientId:e,name:t})})}function HIe({name:e,backgroundColor:t,textColor:o,gradient:r,style:n}){let[i,s,a]=me("color.palette.custom","color.palette.theme","color.palette.default"),c=(0,Vd.useMemo)(()=>[...i||[],...s||[],...a||[]],[i,s,a]);if(!u2(e)||Ue(e,ir))return{};let u={};o&&!Ue(e,ir,"text")&&(u.color=da(c,o)?.color),t&&!Ue(e,ir,"background")&&(u.backgroundColor=da(c,t)?.color);let d=Eae({style:u},e,{textColor:o,backgroundColor:t,gradient:r,style:n}),f=t||n?.color?.background||r||n?.color?.gradient;return{...d,className:V(d.className,!f&&kae(n))}}var t4={useBlockProps:HIe,addSaveProps:Eae,attributeKeys:["backgroundColor","textColor","gradient","style"],hasSupport:u2},GIe={linkColor:[["style","elements","link","color","text"]],textColor:[["textColor"],["style","color","text"]],backgroundColor:[["backgroundColor"],["style","color","background"]],gradient:[["gradient"],["style","color","gradient"]]};function WIe(e,t,o,r){let n=e.name,i={linkColor:VIe(n),textColor:zIe(n),backgroundColor:FIe(n),gradient:e4(n)};return f2(i,GIe,e,t,o,r)}(0,JF.addFilter)("blocks.registerBlockType","core/color/addAttribute",jIe);(0,JF.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",WIe);var kr=l(w(),1);function $Ie({blockName:e,clientId:t,contentClientIds:o}){let r=is(e),{updateBlockAttributes:n}=(0,m2.useDispatch)(_),{hasButtons:i,hasHeading:s}=(0,m2.useSelect)(c=>{let u=c(_).getBlockNamesByClientId(o);return{hasButtons:u.includes("core/buttons"),hasHeading:u.includes("core/heading")}},[o]);return(0,kr.jsx)(d2,{clientId:t,name:e,settings:r,setAttributes:c=>{n(t,c)},asWrapper:UF,label:(0,Xb.__)("Color"),defaultControls:{text:!0,background:!0,button:i,heading:s}})}var KIe=({blockName:e,clientId:t,hasBlockStyles:o,isSectionBlock:r,contentClientIds:n})=>{let i=$b({blockName:e});return(0,kr.jsxs)(kr.Fragment,{children:[o&&(0,kr.jsx)(Qg,{clientId:t}),r&&(0,kr.jsx)($Ie,{blockName:e,clientId:t,contentClientIds:n}),!r&&(0,kr.jsxs)(kr.Fragment,{children:[(0,kr.jsx)(fe.Slot,{group:"color",label:(0,Xb.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,kr.jsx)(fe.Slot,{group:"background",label:(0,Xb.__)("Background image")}),(0,kr.jsx)(fe.Slot,{group:"filter"}),(0,kr.jsx)(fe.Slot,{group:"typography",label:(0,Xb.__)("Typography")}),(0,kr.jsx)(fe.Slot,{group:"dimensions",label:(0,Xb.__)("Dimensions")}),(0,kr.jsx)(fe.Slot,{group:"border",label:i}),(0,kr.jsx)(fe.Slot,{group:"styles"})]})]})},Pae=KIe;var Rae=l(A(),1),Oae=l(N(),1);var p2=l($(),1),h2=l(F(),1),fi=l(A(),1);var ss=l(w(),1);function g2({clientIds:e,onSelect:t,onSwitchToListView:o,hasListViewTab:r}){return e.length?(0,ss.jsx)(fi.__experimentalVStack,{spacing:1,children:e.map(n=>(0,ss.jsx)(YIe,{onSelect:t,onSwitchToListView:o,hasListViewTab:r,clientId:n},n))}):null}function YIe({clientId:e,onSelect:t,onSwitchToListView:o,hasListViewTab:r}){let n=Tt(e),{isSelected:i,childBlocks:s,hasListViewSupport:a,blockName:c}=(0,h2.useSelect)(p=>{let{isBlockSelected:g,hasSelectedInnerBlock:b,getBlockOrder:v,getBlockName:k}=p(_),y=k(e);return{isSelected:g(e)||b(e,!0),childBlocks:v(e),hasListViewSupport:y==="core/navigation"||(0,p2.hasBlockSupport)(y,"listView"),blockName:y}},[e]),d=(0,p2.getBlockType)(c)?.title||c,{selectBlock:f}=(0,h2.useDispatch)(_),h=s&&s.length>0&&r&&a;return(0,ss.jsx)(fi.Button,{__next40pxDefaultSize:!0,className:"block-editor-block-quick-navigation__item",isPressed:i,onClick:async()=>{await f(e),h&&o&&o(e),t&&t(e)},children:(0,ss.jsxs)(fi.Flex,{children:[(0,ss.jsx)(fi.FlexItem,{children:(0,ss.jsx)(Ae,{icon:n?.icon})}),(0,ss.jsx)(fi.FlexBlock,{style:{textAlign:"left"},children:(0,ss.jsx)(fi.__experimentalTruncate,{children:d})}),h&&(0,ss.jsx)(fi.FlexItem,{children:(0,ss.jsx)(we,{icon:Vo,size:24})})]})})}var Qb=l(w(),1),qIe=({contentClientIds:e,onSwitchToListView:t,hasListViewTab:o})=>{if(!e||e.length===0)return null;let r=window?.__experimentalContentOnlyInspectorFields;return(0,Qb.jsx)(Qb.Fragment,{children:!r&&(0,Qb.jsx)(Rae.PanelBody,{title:(0,Oae.__)("Content"),children:(0,Qb.jsx)(g2,{clientIds:e,onSwitchToListView:t,hasListViewTab:o})})})},b2=qIe;var Wo=l(w(),1),{Tabs:Fd}=M(ek.privateApis);function o4({blockName:e,clientId:t,hasBlockStyles:o,tabs:r,isSectionBlock:n,contentClientIds:i}){let s=(0,oa.useRef)(null),a=(0,Jb.useSelect)(S=>S(Aae.store).get("core","showIconLabels"),[]),{requestedTab:c}=(0,Jb.useSelect)(S=>({requestedTab:M(S(_)).getRequestedInspectorTab()})),[u,d]=(0,oa.useState)(()=>c?.tabName??r[0]?.name),f=(0,oa.useRef)(!1),m=(0,oa.useRef)(!1),{__unstableSetOpenListViewPanel:h,__unstableIncrementListViewExpandRevision:p,__unstableSetAllListViewPanelsOpen:g}=(0,Jb.useDispatch)(_),{clearRequestedInspectorTab:b}=M((0,Jb.useDispatch)(_));(0,oa.useEffect)(()=>{f.current=!1},[t]),(0,oa.useEffect)(()=>{c&&(d(c.tabName),c.tabName===yc.name&&c.options?.openPanel&&(h(c.options.openPanel),p()),m.current=!0,f.current=!0,b())},[c,h,p,b]),(0,oa.useEffect)(()=>{u===yc.name&&!f.current&&(g(),p())},[t,u,g,p]),(0,oa.useEffect)(()=>{if(!r?.length||f.current&&r.some(x=>x.name===u))return;let S=r[0]?.name;u!==S&&d(S)},[r,u]);let v=S=>{d(S),f.current=!0,S===yc.name&&!m.current&&(g(),p()),m.current=!1},k=r.some(S=>S.name===yc.name),y=S=>{k&&(h(S),p(),m.current=!0,v(yc.name))};return(0,Wo.jsx)("div",{className:"block-editor-block-inspector__tabs",children:(0,Wo.jsxs)(Fd,{selectedTabId:u,onSelect:v,children:[(0,Wo.jsx)(Fd.TabList,{children:r.map(S=>a?(0,Wo.jsx)(Fd.Tab,{tabId:S.name,children:S.title},S.name):(0,Wo.jsx)(ek.Tooltip,{text:S.title,children:(0,Wo.jsx)(Fd.Tab,{tabId:S.name,"aria-label":S.title,children:(0,Wo.jsx)(ek.Icon,{icon:S.icon})})},S.name))}),(0,Wo.jsxs)(Fd.TabPanel,{tabId:_P.name,focusable:!1,children:[(0,Wo.jsx)(b2,{contentClientIds:i,onSwitchToListView:y,hasListViewTab:k}),(0,Wo.jsx)(fe.Slot,{group:"content"})]}),(0,Wo.jsxs)(Fd.TabPanel,{tabId:yc.name,focusable:!1,children:[(0,Wo.jsx)(fe.Slot,{group:"list",ref:s}),(0,Wo.jsx)(tE,{listViewRef:s})]}),(0,Wo.jsx)(Fd.TabPanel,{tabId:yP.name,focusable:!1,children:(0,Wo.jsx)(sse,{showAdvancedControls:!!e})}),(0,Wo.jsx)(Fd.TabPanel,{tabId:SP.name,focusable:!1,children:(0,Wo.jsx)(Pae,{blockName:e,clientId:t,hasBlockStyles:o,isSectionBlock:n,contentClientIds:i})})]},t)})}var mi=l(A(),1),Lae=l(F(),1);var ZIe=[];function XIe(e,t={}){return t[e]!==void 0?t[e]:t.default!==void 0?t.default:!0}function Nae(e,t,o,r){let n=[],{bindings:i,border:s,color:a,content:c,default:u,dimensions:d,list:f,position:m,styles:h,typography:p,effects:g}=Wi,b=(0,mi.__experimentalUseSlotFills)(f.name),v=!!b&&b.length,k=(0,mi.__experimentalUseSlotFills)(c.name),y=!!k&&k.length,x=[...(0,mi.__experimentalUseSlotFills)(s.name)||[],...(0,mi.__experimentalUseSlotFills)(a.name)||[],...(0,mi.__experimentalUseSlotFills)(d.name)||[],...(0,mi.__experimentalUseSlotFills)(h.name)||[],...(0,mi.__experimentalUseSlotFills)(p.name)||[],...(0,mi.__experimentalUseSlotFills)(g.name)||[]].length,C=[...(0,mi.__experimentalUseSlotFills)(rd.slotName)||[],...(0,mi.__experimentalUseSlotFills)(i.name)||[]],B=[...(0,mi.__experimentalUseSlotFills)(u.name)||[],...(0,mi.__experimentalUseSlotFills)(m.name)||[],...v&&x>1?C:[]],I=window?.__experimentalContentOnlyInspectorFields,P=y||!I&&t?.length;P&&n.push(_P),v&&n.push(yc),(B.length||C.length&&(P||v))&&n.push(yP);let{tabSettings:E,isPreviewMode:L}=(0,Lae.useSelect)(O=>{let D=O(_).getSettings();return{tabSettings:D.blockInspectorTabs,isPreviewMode:D.isPreviewMode}},[]);return!L&&(r||x)&&n.push(SP),XIe(e,E)?n:ZIe}var Mae=l(A(),1);var r4=l(w(),1),{Fill:QIe,Slot:JIe}=(0,Mae.createSlotFill)(Symbol("InspectorControlsLastItem")),Dae=e=>Ie()[bs]?(0,r4.jsx)(QIe,{...e}):null;Dae.Slot=function(t){return(0,r4.jsx)(JIe,{...t})};var k2=Dae;var Vae=l(F(),1);function Fae(e){return(0,Vae.useSelect)(t=>{if(e){let o=t(_).getSettings().blockInspectorAnimation,r=o?.animationParent,{getSelectedBlockClientId:n,getBlockParentsByBlockName:i}=t(_),s=n();return!i(s,r,!0)[0]&&e.name!==r?null:o?.[e.name]}return null},[e])}var _e=l(w(),1);function Uae({blockName:e,showAdvancedControls:t=!0,showPositionControls:o=!0,showBindingsControls:r=!0}){let n=$b({blockName:e});return(0,_e.jsxs)(_e.Fragment,{children:[(0,_e.jsx)(fe.Slot,{}),(0,_e.jsx)(fe.Slot,{group:"color",label:(0,tk.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,_e.jsx)(fe.Slot,{group:"background",label:(0,tk.__)("Background image")}),(0,_e.jsx)(fe.Slot,{group:"typography",label:(0,tk.__)("Typography")}),(0,_e.jsx)(fe.Slot,{group:"dimensions",label:(0,tk.__)("Dimensions")}),(0,_e.jsx)(fe.Slot,{group:"border",label:n}),(0,_e.jsx)(fe.Slot,{group:"styles"}),o&&(0,_e.jsx)(CP,{}),r&&(0,_e.jsx)(fe.Slot,{group:"bindings"}),t&&(0,_e.jsx)("div",{children:(0,_e.jsx)(xP,{})})]})}function ePe(){let{selectedBlockCount:e,renderedBlockName:t,renderedBlockClientId:o,blockType:r,isSectionBlock:n,isSectionBlockInSelection:i,hasBlockStyles:s,editedContentOnlySection:a}=(0,n4.useSelect)(g=>{let{getSelectedBlockClientId:b,getSelectedBlockClientIds:v,getSelectedBlockCount:k,getBlockName:y,getParentSectionBlock:S,isSectionBlock:x,getEditedContentOnlySection:C,isWithinEditedContentOnlySection:B}=M(g(_)),{getBlockStyles:I}=g(zd.store),P=b(),L=B(P)?P:S(P)||P,T=L&&y(L),O=T&&(0,zd.getBlockType)(T),U=v().some(z=>x(z)),G=T&&I(T),j=G&&G.length>0;return{selectedBlockCount:k(),renderedBlockClientId:L,renderedBlockName:T,blockType:O,isSectionBlockInSelection:U,isSectionBlock:x(L),hasBlockStyles:j,editedContentOnlySection:C()}},[]),c=(0,n4.useSelect)(g=>{if(!n||!o)return[];let{getClientIdsOfDescendants:b,getBlockName:v,getBlockEditingMode:k}=M(g(_)),y=b(o),S=new Set;return y.forEach(x=>{let C=v(x);(C==="core/navigation"||(0,zd.hasBlockSupport)(C,"listView"))&&b(x).forEach(I=>S.add(I))}),y.filter(x=>!S.has(x)&&k(x)==="contentOnly")},[n,o]),u=Nae(r?.name,c,n,s),d=u?.length>1,f=Fae(r),m=e>1;if(m&&!i)return(0,_e.jsxs)("div",{className:"block-editor-block-inspector",children:[(0,_e.jsx)(NF,{}),d?(0,_e.jsx)(o4,{tabs:u}):(0,_e.jsx)(Uae,{blockName:t,showAdvancedControls:!1,showPositionControls:!1,showBindingsControls:!1})]});if(m&&i)return(0,_e.jsx)("div",{className:"block-editor-block-inspector",children:(0,_e.jsx)(NF,{})});let h=t===(0,zd.getUnregisteredTypeHandlerName)();return!r||!o||h?(0,_e.jsx)("span",{className:"block-editor-block-inspector__no-blocks",children:(0,tk.__)("No block selected.")}):(0,_e.jsx)(tPe,{animate:f,wrapper:g=>(0,_e.jsx)(oPe,{blockInspectorAnimationSettings:f,renderedBlockClientId:o,children:g}),children:(0,_e.jsx)(rPe,{renderedBlockClientId:o,blockName:r.name,isSectionBlock:n,availableTabs:u,contentClientIds:c,hasBlockStyles:s,editedContentOnlySection:a})})}var tPe=({animate:e,wrapper:t,children:o})=>e?t(o):o,oPe=({blockInspectorAnimationSettings:e,renderedBlockClientId:t,children:o})=>{let r=e&&e.enterDirection==="leftToRight"?-50:50;return(0,_e.jsx)(zae.__unstableMotion.div,{animate:{x:0,opacity:1,transition:{ease:"easeInOut",duration:.14}},initial:{x:r,opacity:0},children:o},t)},rPe=({renderedBlockClientId:e,blockName:t,isSectionBlock:o,availableTabs:r,contentClientIds:n,hasBlockStyles:i,editedContentOnlySection:s})=>{let a=(0,jae.useRef)(null),c=r?.length>1,u=s&&s!==e,d=Tt(s),f=Tt(e),m=f.isSynced;return(0,_e.jsxs)("div",{className:"block-editor-block-inspector",children:[u&&(0,_e.jsx)(yy,{...d,className:d?.isSynced&&"is-synced",parentClientId:s}),(0,_e.jsx)(yy,{...f,allowParentNavigation:!0,className:m&&"is-synced",isChild:u,clientId:e}),(0,_e.jsx)(u9,{clientId:e}),(0,_e.jsx)(Xie,{clientId:e}),(0,_e.jsx)(WT,{blockClientId:e}),c&&(0,_e.jsx)(_e.Fragment,{children:(0,_e.jsx)(o4,{hasBlockStyles:i,clientId:e,blockName:t,tabs:r,isSectionBlock:o,contentClientIds:n})}),!c&&(0,_e.jsxs)(_e.Fragment,{children:[i&&(0,_e.jsx)(Qg,{clientId:e}),(0,_e.jsx)(b2,{contentClientIds:n}),(0,_e.jsx)(fe.Slot,{group:"content"}),(0,_e.jsx)(fe.Slot,{group:"list",ref:a}),(0,_e.jsx)(tE,{listViewRef:a}),!o&&(0,_e.jsx)(Uae,{blockName:t})]}),(0,_e.jsx)(k2.Slot,{}),(0,_e.jsx)(kP,{},"back")]})},Hae=ePe;var i4=l(Re(),1);var Gae=l(w(),1),Wae=()=>((0,i4.default)("__unstableUseClipboardHandler",{alternative:"BlockCanvas or WritingFlow",since:"6.4",version:"6.7"}),xy());function $ae(e){return(0,i4.default)("CopyHandler",{alternative:"BlockCanvas or WritingFlow",since:"6.4",version:"6.7"}),(0,Gae.jsx)("div",{...e,ref:xy()})}var Kae=l(F(),1),s4=l(R(),1);var a4=l(w(),1),nPe=()=>{};function iPe({rootClientId:e,clientId:t,isAppender:o,showInserterHelpPanel:r,showMostUsedBlocks:n=!1,__experimentalInsertionIndex:i,__experimentalInitialTab:s,__experimentalInitialCategory:a,__experimentalFilterValue:c,onPatternCategorySelection:u,onSelect:d=nPe,shouldFocusBlock:f=!1,onClose:m},h){let{destinationRootClientId:p}=(0,Kae.useSelect)(g=>{let{getBlockRootClientId:b}=g(_);return{destinationRootClientId:e||b(t)||void 0}},[t,e]);return(0,a4.jsx)(W5,{onSelect:d,rootClientId:p,clientId:t,isAppender:o,showInserterHelpPanel:r,showMostUsedBlocks:n,__experimentalInsertionIndex:i,__experimentalFilterValue:c,onPatternCategorySelection:u,__experimentalInitialTab:s,__experimentalInitialCategory:a,shouldFocusBlock:f,ref:h,onClose:m})}var l4=(0,s4.forwardRef)(iPe);function sPe(e,t){return(0,a4.jsx)(l4,{...e,onPatternCategorySelection:void 0,ref:t})}var Yae=(0,s4.forwardRef)(sPe);var qae=l(Re(),1);function Zae(){return(0,qae.default)("wp.blockEditor.MultiSelectScrollIntoView",{hint:"This behaviour is now built-in.",since:"5.8"}),null}var Xae=l(Z(),1),x_=l(Fe(),1),Qae=l(F(),1),jd=l(it(),1);var Jae=l(w(),1),aPe=window.navigator.userAgent.indexOf("Trident")!==-1,lPe=new Set([jd.UP,jd.DOWN,jd.LEFT,jd.RIGHT]),cPe=.75;function c4(){let e=(0,Qae.useSelect)(t=>t(_).hasSelectedBlock(),[]);return(0,Xae.useRefEffect)(t=>{if(!e)return;let{ownerDocument:o}=t,{defaultView:r}=o,n,i,s;function a(){n||(n=r.requestAnimationFrame(()=>{m(),n=null}))}function c(g){i&&r.cancelAnimationFrame(i),i=r.requestAnimationFrame(()=>{u(g),i=null})}function u({keyCode:g}){if(!h())return;let b=(0,x_.computeCaretRect)(r);if(!b)return;if(!s){s=b;return}if(lPe.has(g)){s=b;return}let v=b.top-s.top;if(v===0)return;let k=(0,x_.getScrollContainer)(t);if(!k)return;let y=k===o.body||k===o.documentElement,S=y?r.scrollY:k.scrollTop,x=y?0:k.getBoundingClientRect().top,C=y?s.top/r.innerHeight:(s.top-x)/(r.innerHeight-x);if(S===0&&C<cPe&&p()){s=b;return}let B=y?r.innerHeight:k.clientHeight;if(s.top+s.height>x+B||s.top<x){s=b;return}y?r.scrollBy(0,v):k.scrollTop+=v}function d(){o.addEventListener("selectionchange",f)}function f(){o.removeEventListener("selectionchange",f),m()}function m(){h()&&(s=(0,x_.computeCaretRect)(r))}function h(){return t.contains(o.activeElement)&&o.activeElement.isContentEditable}function p(){let g=t.querySelectorAll('[contenteditable="true"]');return g[g.length-1]===o.activeElement}return r.addEventListener("scroll",a,!0),r.addEventListener("resize",a,!0),t.addEventListener("keydown",c),t.addEventListener("keyup",u),t.addEventListener("mousedown",d),t.addEventListener("touchstart",d),()=>{r.removeEventListener("scroll",a,!0),r.removeEventListener("resize",a,!0),t.removeEventListener("keydown",c),t.removeEventListener("keyup",u),t.removeEventListener("mousedown",d),t.removeEventListener("touchstart",d),o.removeEventListener("selectionchange",f),r.cancelAnimationFrame(n),r.cancelAnimationFrame(i)}},[e])}function uPe({children:e}){return(0,Jae.jsx)("div",{ref:c4(),className:"block-editor__typewriter",children:e})}var dPe=aPe?e=>e.children:uPe,ele=dPe;var dp=l(R(),1),u4=l(Re(),1);var d4=l(w(),1),v2=(0,dp.createContext)({});v2.displayName="RenderedRefsContext";function fPe(e,t,o){let r={...e,[t]:e[t]?new Set(e[t]):new Set};return r[t].add(o),r}function f4({children:e,uniqueId:t,blockName:o=""}){let r=(0,dp.useContext)(v2),{name:n}=Ie();o=o||n;let i=(0,dp.useMemo)(()=>fPe(r,o,t),[r,o,t]);return(0,d4.jsx)(v2.Provider,{value:i,children:e})}function m4(e,t=""){let o=(0,dp.useContext)(v2),{name:r}=Ie();return t=t||r,!!o[t]?.has(e)}var tle=e=>((0,u4.default)("wp.blockEditor.__experimentalRecursionProvider",{since:"6.5",alternative:"wp.blockEditor.RecursionProvider"}),(0,d4.jsx)(f4,{...e})),ole=(...e)=>((0,u4.default)("wp.blockEditor.__experimentalUseHasRecursion",{since:"6.5",alternative:"wp.blockEditor.useHasRecursion"}),m4(...e));var S2=l(A(),1),p4=l(N(),1),h4=l(R(),1),nle=l(pc(),1);var pi=l(A(),1);var rle=l(N(),1),wc=l(w(),1);function y2({title:e,help:t,actions:o=[],onClose:r}){return(0,wc.jsxs)(pi.__experimentalVStack,{className:"block-editor-inspector-popover-header",spacing:4,children:[(0,wc.jsxs)(pi.__experimentalHStack,{alignment:"center",children:[(0,wc.jsx)(pi.__experimentalHeading,{className:"block-editor-inspector-popover-header__heading",level:2,size:13,children:e}),(0,wc.jsx)(pi.__experimentalSpacer,{}),o.map(({label:n,icon:i,onClick:s})=>(0,wc.jsx)(pi.Button,{size:"small",className:"block-editor-inspector-popover-header__action",label:n,icon:i,variant:!i&&"tertiary",onClick:s,children:!i&&n},n)),r&&(0,wc.jsx)(pi.Button,{size:"small",className:"block-editor-inspector-popover-header__action",label:(0,rle.__)("Close"),icon:wf,onClick:r})]}),t&&(0,wc.jsx)(pi.__experimentalText,{children:t})]})}var ok=l(w(),1);function mPe({onClose:e,onChange:t,showPopoverHeaderActions:o,isCompact:r,currentDate:n,title:i,...s},a){let c={startOfWeek:(0,nle.getSettings)().l10n.startOfWeek,onChange:t,currentDate:r?void 0:n,currentTime:r?n:void 0,...s},u=r?S2.TimePicker:S2.DateTimePicker;return(0,ok.jsxs)("div",{ref:a,className:"block-editor-publish-date-time-picker",children:[(0,ok.jsx)(y2,{title:i||(0,p4.__)("Publish"),actions:o?[{label:(0,p4.__)("Now"),onClick:()=>t?.(null)}]:void 0,onClose:e}),(0,ok.jsx)(u,{...c})]})}var g4=(0,h4.forwardRef)(mPe);function pPe(e,t){return(0,ok.jsx)(g4,{...e,showPopoverHeaderActions:!0,isCompact:!1,ref:t})}var ile=(0,h4.forwardRef)(pPe);var _2=l(F(),1),sle=l(R(),1);function ao(e){let t=Ie(),{clientId:o=""}=t,{setBlockEditingMode:r,unsetBlockEditingMode:n}=(0,_2.useDispatch)(_),i=(0,_2.useSelect)(s=>o?null:s(_).getBlockEditingMode(),[o]);return(0,sle.useEffect)(()=>(e&&r(o,e),()=>{e&&n(o)}),[o,e,r,n]),o?t[u0]:i}var ale=l(Re(),1),lle=l(R(),1);function hPe(){return(0,ale.default)("wp.blockEditor.ToolSelector",{since:"6.9",hint:"The ToolSelector component no longer renders anything."}),null}var cle=(0,lle.forwardRef)(hPe);var C_=l(w(),1),Me=e=>{if(e===null||typeof e!="object"||Array.isArray(e))return e;let t=Object.entries(e).map(([o,r])=>[o,Me(r)]).filter(([,o])=>o!==void 0);return t.length?Object.fromEntries(t):void 0};function f2(e,t,o,r,n,i){if(Object.values(e??{}).every(c=>!c)||i.length===1&&o.innerBlocks.length===r.length)return o;let s=r[0]?.attributes;if(i.length>1&&r.length>1)if(r[n])s=r[n]?.attributes;else return o;let a=o;return Object.entries(e).forEach(([c,u])=>{u&&t[c].forEach(d=>{let f=yl(s,d);f&&(a={...a,attributes:pe(a.attributes,d,f)})})}),a}function Ue(e,t,o){let n=(0,ule.getBlockSupport)(e,t)?.__experimentalSkipSerialization;return Array.isArray(n)?n.includes(o):n}var Cc=new WeakMap;function Qn({id:e,css:t}){return tc({id:e,css:t})}function tc({id:e,css:t,assets:o,__unstableType:r,variation:n,clientId:i}={}){let{setStyleOverride:s,deleteStyleOverride:a}=M((0,x2.useDispatch)(_)),c=(0,x2.useRegistry)(),u=(0,as.useId)();(0,as.useEffect)(()=>{if(!t&&!o)return;let d=e||u,f={id:e,css:t,assets:o,__unstableType:r,variation:n,clientId:i};return Cc.get(c)||Cc.set(c,[]),Cc.get(c).push([d,f]),window.queueMicrotask(()=>{Cc.get(c)?.length&&c.batch(()=>{Cc.get(c).forEach(m=>{s(...m)}),Cc.set(c,[])})}),()=>{Cc.get(c)?.find(([h])=>h===d)?Cc.set(c,Cc.get(c).filter(([h])=>h!==d)):a(d)}},[e,t,i,o,r,u,s,a,c,n])}function is(e,t){let[o,r,n,i,s,a,c,u,d,f,m,h,p,g,b,v,k,y,S,x,C,B,I,P,E,L,T,O,D,U,G,j,z,W,ee,se,ce,ie,re,Q,Y,J,K,H,X,ne,le,ve,he,xe,ze,ot,Wt,fo,Do,rt,ar,xt,At,Pe,wt]=me("background.backgroundImage","background.backgroundSize","typography.fontFamilies.custom","typography.fontFamilies.default","typography.fontFamilies.theme","typography.defaultFontSizes","typography.fontSizes.custom","typography.fontSizes.default","typography.fontSizes.theme","typography.customFontSize","typography.fontStyle","typography.fontWeight","typography.lineHeight","typography.textAlign","typography.textColumns","typography.textDecoration","typography.textIndent","typography.writingMode","typography.textTransform","typography.letterSpacing","spacing.padding","spacing.margin","spacing.blockGap","spacing.defaultSpacingSizes","spacing.customSpacingSize","spacing.spacingSizes.custom","spacing.spacingSizes.default","spacing.spacingSizes.theme","spacing.units","dimensions.aspectRatio","dimensions.height","dimensions.minHeight","dimensions.width","dimensions.dimensionSizes","layout","border.color","border.radius","border.style","border.width","border.radiusSizes","color.custom","color.palette.custom","color.customDuotone","color.palette.theme","color.palette.default","color.defaultPalette","color.defaultDuotone","color.duotone.custom","color.duotone.theme","color.duotone.default","color.gradients.custom","color.gradients.theme","color.gradients.default","color.defaultGradients","color.customGradient","color.background","color.link","color.text","color.heading","color.button","shadow"),qo=(0,as.useMemo)(()=>({background:{backgroundImage:o,backgroundSize:r},color:{palette:{custom:J,theme:H,default:X},gradients:{custom:ze,theme:ot,default:Wt},duotone:{custom:ve,theme:he,default:xe},defaultGradients:fo,defaultPalette:ne,defaultDuotone:le,custom:Y,customGradient:Do,customDuotone:K,background:rt,link:ar,heading:At,button:Pe,text:xt},typography:{fontFamilies:{custom:n,default:i,theme:s},fontSizes:{custom:c,default:u,theme:d},customFontSize:f,defaultFontSizes:a,fontStyle:m,fontWeight:h,lineHeight:p,textAlign:g,textColumns:b,textDecoration:v,textIndent:k,textTransform:S,letterSpacing:x,writingMode:y},spacing:{spacingSizes:{custom:L,default:T,theme:O},customSpacingSize:E,defaultSpacingSizes:P,padding:C,margin:B,blockGap:I,units:D},border:{color:se,radius:ce,style:ie,width:re,radiusSizes:Q},dimensions:{aspectRatio:U,height:G,minHeight:j,width:z,dimensionSizes:W},layout:ee,parentLayout:t,shadow:wt}),[o,r,n,i,s,a,c,u,d,f,m,h,p,g,b,v,k,S,x,y,C,B,I,P,E,L,T,O,D,U,G,j,z,W,ee,t,se,ce,ie,re,Q,Y,J,K,H,X,ne,le,ve,he,xe,ze,ot,Wt,fo,Do,rt,ar,xt,At,Pe,wt]);return TP(qo,e)}function dle(e){e=e.map(o=>({...o,Edit:(0,as.memo)(o.edit)}));let t=(0,b4.createHigherOrderComponent)(o=>function(n){let i=Ie();return[...e.map((s,a)=>{let{Edit:c,hasSupport:u,attributeKeys:d=[],shareWithChildBlocks:f,supportsPatternEditing:m}=s;if(!(m&&i[$c]||i[bs]||i[Pp]&&f)||!u(n.name))return null;let p={};for(let g of d)n.attributes[g]&&(p[g]=n.attributes[g]);return(0,C_.jsx)(c,{name:n.name,isSelected:n.isSelected,clientId:n.clientId,setAttributes:n.setAttributes,__unstableParentLayout:n.__unstableParentLayout,...p},a)}),(0,C_.jsx)(o,{...n},"edit")]},"withBlockEditHooks");(0,w_.addFilter)("editor.BlockEdit","core/editor/hooks",t)}function gPe({index:e,useBlockProps:t,setAllWrapperProps:o,...r}){let n=t(r),i=s=>o(a=>{let c=[...a];return c[e]=s,c});return(0,as.useEffect)(()=>(i(n),()=>{i(void 0)})),null}var bPe=(0,as.memo)(gPe);function fle(e){let t=(0,b4.createHigherOrderComponent)(o=>function(n){let[i,s]=(0,as.useState)(Array(e.length).fill(void 0));return[...e.map((a,c)=>{let{hasSupport:u,attributeKeys:d=[],useBlockProps:f,isMatch:m}=a,h={};for(let p of d)n.attributes[p]&&(h[p]=n.attributes[p]);return!Object.keys(h).length||!u(n.name)||m&&!m(h)?null:(0,C_.jsx)(bPe,{index:c,useBlockProps:f,setAllWrapperProps:s,name:n.name,clientId:n.clientId,...h},c)}),(0,C_.jsx)(o,{...n,wrapperProps:i.filter(Boolean).reduce((a,c)=>({...a,...c,className:V(a.className,c.className),style:{...a.style,...c.style}}),n.wrapperProps||{})},"edit")]},"withBlockListBlockHooks");(0,w_.addFilter)("editor.BlockListBlock","core/editor/hooks",t)}function mle(e){function t(o,r,n){return e.reduce((i,s)=>{let{hasSupport:a,attributeKeys:c=[],addSaveProps:u}=s,d={};for(let f of c)n[f]&&(d[f]=n[f]);return!Object.keys(d).length||!a(r)?i:u(i,r,d)},o)}(0,w_.addFilter)("blocks.getSaveContent.extraProps","core/editor/hooks",t,0),(0,w_.addFilter)("blocks.getSaveContent.extraProps","core/editor/hooks",o=>(o.hasOwnProperty("className")&&!o.className&&delete o.className,o))}var ple=l($(),1),hle=l(ut(),1);function kPe(e){let{apiVersion:t=1}=e;return t<2&&(0,ple.hasBlockSupport)(e,"lightBlockWrapper",!1)&&(e.apiVersion=2),e}(0,hle.addFilter)("blocks.registerBlockType","core/compat/migrateLightBlockWrapper",kPe);function gle(e){e.hasAttribute("crossorigin")||e.setAttribute("crossorigin","anonymous")}if(window.crossOriginIsolated){let e=function(){document.body?t.observe(document.body,{childList:!0,attributes:!0,subtree:!0}):document.readyState==="loading"&&document.addEventListener("DOMContentLoaded",()=>{document.body&&t.observe(document.body,{childList:!0,attributes:!0,subtree:!0})})};vPe=e;let t=new window.MutationObserver(o=>{o.forEach(r=>{[r.addedNodes,r.target].forEach(n=>{(n instanceof window.NodeList?n:[n]).forEach(s=>{let a=s;a.querySelectorAll&&(a.querySelectorAll("source,script,video,link").forEach(c=>{gle(c)}),["SOURCE","SCRIPT","VIDEO","LINK"].includes(a.nodeName)&&gle(a))})})})});e()}var vPe;var ble=l(ut(),1),ls=l($(),1);var k4=l(w(),1),v4=["left","center","right","wide","full"],yPe=["wide","full"];function y4(e,t=!0,o=!0){let r;return Array.isArray(e)?r=v4.filter(n=>e.includes(n)):e===!0?r=[...v4]:r=[],!o||e===!0&&!t?r.filter(n=>!yPe.includes(n)):r}function SPe(e){return"type"in(e.attributes?.align??{})||(0,ls.hasBlockSupport)(e,"align")&&(e.attributes={...e.attributes,align:{type:"string",enum:[...v4,""]}}),e}function _Pe({name:e,align:t,setAttributes:o}){let r=y4((0,ls.getBlockSupport)(e,"align"),(0,ls.hasBlockSupport)(e,"alignWide",!0)),n=Hv(r).map(({name:a})=>a),i=ao();return!n.length||i!=="default"?null:(0,k4.jsx)(Mt,{group:"block",__experimentalShareWithChildBlocks:!0,children:(0,k4.jsx)(cC,{value:t,onChange:a=>{a||(0,ls.getBlockType)(e)?.attributes?.align?.default&&(a=""),o({align:a})},controls:n})})}var w2={shareWithChildBlocks:!0,edit:_Pe,useBlockProps:xPe,addSaveProps:wPe,attributeKeys:["align"],hasSupport(e){return(0,ls.hasBlockSupport)(e,"align",!1)}};function xPe({name:e,align:t}){let o=y4((0,ls.getBlockSupport)(e,"align"),(0,ls.hasBlockSupport)(e,"alignWide",!0));return Hv(o).some(n=>n.name===t)?{"data-align":t}:{}}function wPe(e,t,o){let{align:r}=o,n=(0,ls.getBlockSupport)(t,"align"),i=(0,ls.hasBlockSupport)(t,"alignWide",!0);return y4(n,i).includes(r)&&(e.className=V(`align${r}`,e.className)),e}(0,ble.addFilter)("blocks.registerBlockType","core/editor/align/addAttribute",SPe);var kle=l(ut(),1);function CPe(e){return"type"in(e.attributes?.lock??{})||(e.attributes={...e.attributes,lock:{type:"object"}}),e}(0,kle.addFilter)("blocks.registerBlockType","core/lock/addAttribute",CPe);var C4=l(ut(),1),ak=l($(),1);var B_=l(A(),1),E2=l(N(),1),Ple=l(R(),1),Rle=l(F(),1),T2=l($(),1);var Pn=l(A(),1),Ele=l(R(),1),sk=l(N(),1),Tle=l(F(),1);var x4=l($(),1),wle=l(F(),1),ik=l(A(),1),ra=l(N(),1),C2=l(R(),1),Cle=l(Z(),1),Ble=l(Xo(),1);var S4=l(R(),1),Sle=l(Z(),1),_le=l(A(),1);var vle=l(A(),1);var rk=l(w(),1);function BPe({blockTypes:e,value:t,onItemChange:o}){return(0,rk.jsx)("ul",{className:"block-editor-block-manager__checklist",children:e.map(r=>(0,rk.jsxs)("li",{className:"block-editor-block-manager__checklist-item",children:[(0,rk.jsx)(vle.CheckboxControl,{label:r.title,checked:t.includes(r.name),onChange:(...n)=>o(r,...n)}),(0,rk.jsx)(Ae,{icon:r.icon})]},r.name))})}var yle=BPe;var nk=l(w(),1);function xle({title:e,blockTypes:t,selectedBlockTypes:o,onChange:r}){let n=(0,Sle.useInstanceId)(xle),i=(0,S4.useCallback)((f,m)=>{r(m?[...o,f]:o.filter(({name:h})=>h!==f.name))},[o,r]),s=(0,S4.useCallback)(f=>{r(f?[...o,...t.filter(m=>!o.find(({name:h})=>h===m.name))]:o.filter(m=>!t.find(({name:h})=>h===m.name)))},[t,o,r]);if(!t.length)return null;let a=t.map(({name:f})=>f).filter(f=>(o??[]).some(m=>m.name===f)),c="block-editor-block-manager__category-title-"+n,u=a.length===t.length,d=!u&&a.length>0;return(0,nk.jsxs)("div",{role:"group","aria-labelledby":c,className:"block-editor-block-manager__category",children:[(0,nk.jsx)(_le.CheckboxControl,{checked:u,onChange:s,className:"block-editor-block-manager__category-title",indeterminate:d,label:(0,nk.jsx)("span",{id:c,children:e})}),(0,nk.jsx)(yle,{blockTypes:t,value:a,onItemChange:i})]})}var _4=xle;var Bc=l(w(),1);function B2({blockTypes:e,selectedBlockTypes:t,onChange:o,showSelectAll:r=!0}){let n=(0,Cle.useDebounce)(Ble.speak,500),[i,s]=(0,C2.useState)(""),{categories:a,isMatchingSearchTerm:c}=(0,wle.useSelect)(m=>({categories:m(x4.store).getCategories(),isMatchingSearchTerm:m(x4.store).isMatchingSearchTerm}),[]),u=e.filter(m=>!i||c(m,i)),d=t.length>0&&t.length!==e.length,f=e.length>0&&t.length===e.length;return(0,C2.useEffect)(()=>{if(!i)return;let m=u.length,h=(0,ra.sprintf)((0,ra._n)("%d result found.","%d results found.",m),m);n(h)},[u?.length,i,n]),(0,Bc.jsxs)(ik.__experimentalVStack,{className:"block-editor-block-manager__content",spacing:4,children:[(0,Bc.jsx)(ik.SearchControl,{label:(0,ra.__)("Search for a block"),placeholder:(0,ra.__)("Search for a block"),value:i,onChange:m=>s(m),className:"block-editor-block-manager__search"}),r&&(0,Bc.jsx)(ik.CheckboxControl,{className:"block-editor-block-manager__select-all",label:(0,ra.__)("Select all"),checked:f,onChange:()=>{o(f?[]:e)},indeterminate:d}),(0,Bc.jsxs)("div",{tabIndex:"0",role:"region","aria-label":(0,ra.__)("Available block types"),className:"block-editor-block-manager__results",children:[u.length===0&&(0,Bc.jsx)("p",{className:"block-editor-block-manager__no-results",children:(0,ra.__)("No blocks found.")}),a.map(m=>(0,Bc.jsx)(_4,{title:m.title,blockTypes:u.filter(h=>h.category===m.slug),selectedBlockTypes:t,onChange:o},m.slug)),(0,Bc.jsx)(_4,{title:(0,ra.__)("Uncategorized"),blockTypes:u.filter(({category:m})=>!m),selectedBlockTypes:t,onChange:o})]})]})}var na=l(w(),1);function Ile({clientId:e,blockTypes:t,selectedBlockTypes:o,onClose:r}){let[n,i]=(0,Ele.useState)(o),{updateBlockAttributes:s}=(0,Tle.useDispatch)(_),a=()=>{let c=n.length===t.length,u=n.map(({name:d})=>d);s(e,{allowedBlocks:c?void 0:u}),r()};return(0,na.jsx)(Pn.Modal,{title:(0,sk._x)("Manage allowed blocks","modal title"),onRequestClose:r,overlayClassName:"block-editor-block-allowed-blocks-modal",focusOnMount:"firstContentElement",size:"medium",children:(0,na.jsxs)(Pn.__experimentalVStack,{as:"form",onSubmit:c=>{c.preventDefault(),a()},spacing:"4",children:[(0,na.jsx)(Pn.__experimentalText,{children:(0,sk.__)("Select which blocks can be added inside this container.")}),(0,na.jsx)(B2,{blockTypes:t,selectedBlockTypes:n,onChange:c=>{i(c)}}),(0,na.jsxs)(Pn.Flex,{className:"block-editor-block-allowed-blocks-modal__actions",justify:"flex-end",expanded:!1,children:[(0,na.jsx)(Pn.FlexItem,{children:(0,na.jsx)(Pn.Button,{variant:"tertiary",onClick:r,__next40pxDefaultSize:!0,children:(0,sk.__)("Cancel")})}),(0,na.jsx)(Pn.FlexItem,{children:(0,na.jsx)(Pn.Button,{variant:"primary",type:"submit",__next40pxDefaultSize:!0,children:(0,sk.__)("Apply")})})]})]})})}var fp=l(w(),1);function Ole({clientId:e}){let[t,o]=(0,Ple.useState)(!1),{blockTypes:r,selectedBlockNames:n}=(0,Rle.useSelect)(a=>{let{getBlockAttributes:c}=a(_);return{blockTypes:a(T2.store).getBlockTypes(),selectedBlockNames:c(e)?.allowedBlocks}},[e]),i=r.filter(a=>(0,T2.hasBlockSupport)(a,"inserter",!0)&&(!a.parent||a.parent.includes("core/post-content")));if(!i)return null;let s=n===void 0?i:i.filter(a=>n.includes(a.name));return(0,fp.jsxs)("div",{className:"block-editor-block-allowed-blocks-control",children:[(0,fp.jsxs)(B_.BaseControl,{help:(0,E2.__)("Specify which blocks are allowed inside this container."),children:[(0,fp.jsx)(B_.BaseControl.VisualLabel,{children:(0,E2.__)("Allowed Blocks")}),(0,fp.jsx)(B_.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>{o(!0)},className:"block-editor-block-allowed-blocks-control__button",children:(0,E2.__)("Manage allowed blocks")})]}),t&&(0,fp.jsx)(Ile,{clientId:e,blockTypes:i,selectedBlockTypes:s,onClose:()=>o(!1)})]})}var w4=l(w(),1);function EPe({clientId:e}){return ao()==="contentOnly"?null:(0,w4.jsx)(sS.Fill,{children:(0,w4.jsx)(Ole,{clientId:e})})}var Ale={edit:EPe,attributeKeys:["allowedBlocks"],hasSupport(e){return(0,ak.hasBlockSupport)(e,"allowedBlocks")}};function TPe(e){return e?.attributes?.allowedBlocks?.type||(0,ak.hasBlockSupport)(e,"allowedBlocks")&&(e.attributes={...e.attributes,allowedBlocks:{type:"array"}}),e}(0,C4.addFilter)("blocks.registerBlockType","core/allowedBlocks/attribute",TPe);function IPe(e,t,o,r){if(!(0,ak.hasBlockSupport)(e.name,"allowedBlocks")||t.length!==1&&r.length===1&&e.innerBlocks.length===t.length||r.length===1&&t.length>1||r.length>1&&t.length===1||r.length>1&&t.length>1&&r.length!==t.length||e.attributes.allowedBlocks)return e;let n=t[o]?.attributes?.allowedBlocks;if(!n)return e;let s=(0,ak.getBlockType)(e.name)?.allowedBlocks||[];if(!s.length)return{...e,attributes:{...e.attributes,allowedBlocks:n}};let a=n.filter(c=>s.includes(c));return{...e,attributes:{...e.attributes,allowedBlocks:a}}}(0,C4.addFilter)("blocks.switchToBlockType.transformedBlock","core/allowedBlocks/addTransforms",IPe);var Lle=l(ut(),1),I2=l(A(),1),lk=l(N(),1),P2=l($(),1),Nle=l(R(),1);var Qa=l(w(),1),PPe=/[\s#]/g;function RPe(e){return"type"in(e.attributes?.anchor??{})||(0,P2.hasBlockSupport)(e,"anchor")&&(e.attributes={...e.attributes,anchor:{type:"string"}}),e}function OPe({anchor:e,setAttributes:t}){if(ao()!=="default")return null;let r=Nle.Platform.OS==="web";return(0,Qa.jsx)(fe,{group:"advanced",children:(0,Qa.jsx)(I2.TextControl,{__next40pxDefaultSize:!0,className:"html-anchor-control",label:(0,lk.__)("HTML anchor"),help:(0,Qa.jsxs)(Qa.Fragment,{children:[(0,lk.__)("Enter a word or two\u2014without spaces\u2014to make a unique web address just for this block, called an \u201Canchor\u201D. Then, you\u2019ll be able to link directly to this section of your page."),r&&(0,Qa.jsxs)(Qa.Fragment,{children:[" ",(0,Qa.jsx)(I2.ExternalLink,{href:(0,lk.__)("https://wordpress.org/documentation/article/page-jumps/"),children:(0,lk.__)("Learn more about anchors")})]})]}),value:e||"",placeholder:r?null:(0,lk.__)("Add an anchor"),onChange:n=>{n=n.replace(PPe,"-"),t({anchor:n!==""?n:void 0})},autoCapitalize:"none",autoComplete:"off"})})}var B4={addSaveProps:APe,edit:OPe,attributeKeys:["anchor"],hasSupport(e){return(0,P2.hasBlockSupport)(e,"anchor")}};function APe(e,t,o){return(0,P2.hasBlockSupport)(t,"anchor")&&(e.id=o.anchor===""?null:o.anchor),e}(0,Lle.addFilter)("blocks.registerBlockType","core/anchor/attribute",RPe);var Mle=l(ut(),1),R2=l($(),1);function LPe(e){return e?.attributes?.ariaLabel?.type||(0,R2.hasBlockSupport)(e,"ariaLabel")&&(e.attributes={...e.attributes,ariaLabel:{type:"string"}}),e}function NPe(e,t,o){return(0,R2.hasBlockSupport)(t,"ariaLabel")&&!Ue(t,"ariaLabel","ariaLabel")&&(e["aria-label"]=o.ariaLabel===""?null:o.ariaLabel),e}var Dle={addSaveProps:NPe,attributeKeys:["ariaLabel"],hasSupport(e){return(0,R2.hasBlockSupport)(e,"ariaLabel")}};(0,Mle.addFilter)("blocks.registerBlockType","core/ariaLabel/attribute",LPe);var Bk=l($(),1),OR=l(A(),1),$de=l(F(),1);var Fle=l(jr(),1),Vle={};function E4(e,t){let o=Fle.useRef(Vle);return o.current===Vle&&(o.current=e(t)),o}function T4(e,...t){let o=new URL(`https://base-ui.com/production-error/${e}`);return t.forEach(r=>o.searchParams.append("args[]",r)),`Base UI error #${e}; visit ${o} for the full message.`}var O2=l(jr(),1);function I4(e,t,o,r){let n=E4(jle).current;return MPe(n,e,t,o,r)&&Ule(n,[e,t,o,r]),n.callback}function zle(e){let t=E4(jle).current;return DPe(t,e)&&Ule(t,e),t.callback}function jle(){return{callback:null,cleanup:null,refs:[]}}function MPe(e,t,o,r,n){return e.refs[0]!==t||e.refs[1]!==o||e.refs[2]!==r||e.refs[3]!==n}function DPe(e,t){return e.refs.length!==t.length||e.refs.some((o,r)=>o!==t[r])}function Ule(e,t){if(e.refs=t,t.every(o=>o==null)){e.callback=null;return}e.callback=o=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),o!=null){let r=Array(t.length).fill(null);for(let n=0;n<t.length;n+=1){let i=t[n];if(i!=null)switch(typeof i){case"function":{let s=i(o);typeof s=="function"&&(r[n]=s);break}case"object":{i.current=o;break}default:}}e.cleanup=()=>{for(let n=0;n<t.length;n+=1){let i=t[n];if(i!=null)switch(typeof i){case"function":{let s=r[n];typeof s=="function"?s():i(null);break}case"object":{i.current=null;break}default:}}}}}}var Wle=l(jr(),1);var Hle=l(jr(),1),VPe=parseInt(Hle.version,10);function Gle(e){return VPe>=e}function P4(e){if(!Wle.isValidElement(e))return null;let t=e,o=t.props;return(Gle(19)?o?.ref:t.ref)??null}function E_(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function $le(e,t){let o={};for(let r in e){let n=e[r];if(t?.hasOwnProperty(r)){let i=t[r](n);i!=null&&Object.assign(o,i);continue}n===!0?o[`data-${r.toLowerCase()}`]="":n&&(o[`data-${r.toLowerCase()}`]=n.toString())}return o}function Kle(e,t){return typeof e=="function"?e(t):e}function Yle(e,t){return typeof e=="function"?e(t):e}var I_={};function ck(e,t,o,r,n){let i={...R4(e,I_)};return t&&(i=T_(i,t)),o&&(i=T_(i,o)),r&&(i=T_(i,r)),n&&(i=T_(i,n)),i}function qle(e){if(e.length===0)return I_;if(e.length===1)return R4(e[0],I_);let t={...R4(e[0],I_)};for(let o=1;o<e.length;o+=1)t=T_(t,e[o]);return t}function T_(e,t){return Zle(t)?t(e):FPe(e,t)}function FPe(e,t){if(!t)return e;for(let o in t){let r=t[o];switch(o){case"style":{e[o]=E_(e.style,r);break}case"className":{e[o]=O4(e.className,r);break}default:zPe(o,r)?e[o]=jPe(e[o],r):e[o]=r}}return e}function zPe(e,t){let o=e.charCodeAt(0),r=e.charCodeAt(1),n=e.charCodeAt(2);return o===111&&r===110&&n>=65&&n<=90&&(typeof t=="function"||typeof t>"u")}function Zle(e){return typeof e=="function"}function R4(e,t){return Zle(e)?e(t):e??I_}function jPe(e,t){return t?e?o=>{if(HPe(o)){let n=o;UPe(n);let i=t(n);return n.baseUIHandlerPrevented||e?.(n),i}let r=t(o);return e?.(o),r}:t:e}function UPe(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function O4(e,t){return t?e?t+" "+e:t:e}function HPe(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}var GPe=Object.freeze([]),Ud=Object.freeze({});var A4=l(jr(),1);function Xle(e,t,o={}){let r=t.render,n=WPe(t,o);if(o.enabled===!1)return null;let i=o.state??Ud;return $Pe(e,r,n,i)}function WPe(e,t={}){let{className:o,style:r,render:n}=e,{state:i=Ud,ref:s,props:a,stateAttributesMapping:c,enabled:u=!0}=t,d=u?Kle(o,i):void 0,f=u?Yle(r,i):void 0,m=u?$le(i,c):Ud,h=u?E_(m,Array.isArray(a)?qle(a):a)??Ud:Ud;return typeof document<"u"&&(u?Array.isArray(s)?h.ref=zle([h.ref,P4(n),...s]):h.ref=I4(h.ref,P4(n),s):I4(null,null)),u?(d!==void 0&&(h.className=O4(h.className,d)),f!==void 0&&(h.style=E_(h.style,f)),h):Ud}function $Pe(e,t,o,r){if(t){if(typeof t=="function")return t(o,r);let n=ck(o,t.props);return n.ref=o.ref,O2.cloneElement(t,n)}if(e&&typeof e=="string")return KPe(e,o);throw new Error(T4(8))}function KPe(e,t){return e==="button"?(0,A4.createElement)("button",{type:"button",...t,key:t.key}):e==="img"?(0,A4.createElement)("img",{alt:"",...t,key:t.key}):O2.createElement(e,t)}function A2(e){return Xle(e.defaultTagName??"div",e,e)}var Jle=l(R(),1);if(typeof document<"u"&&!document.head.querySelector("style[data-wp-hash='244b5c59c0']")){let e=document.createElement("style");e.setAttribute("data-wp-hash","244b5c59c0"),e.appendChild(document.createTextNode('@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._96e6251aad1a6136__badge{border-radius:var(--wpds-border-radius-lg,8px);font-family:var(--wpds-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-font-size-sm,12px);font-weight:var(--wpds-font-weight-regular,400);line-height:var(--wpds-font-line-height-xs,16px);padding-block:var(--wpds-dimension-padding-xs,4px);padding-inline:var(--wpds-dimension-padding-sm,8px)}._99f7158cb520f750__is-high-intent{background-color:var(--wpds-color-bg-surface-error,#f6e6e3);color:var(--wpds-color-fg-content-error,#470000)}.c20ebef2365bc8b7__is-medium-intent{background-color:var(--wpds-color-bg-surface-warning,#fde6bd);color:var(--wpds-color-fg-content-warning,#2e1900)}._365e1626c6202e52__is-low-intent{background-color:var(--wpds-color-bg-surface-caution,#fee994);color:var(--wpds-color-fg-content-caution,#281d00)}._33f8198127ddf4ef__is-stable-intent{background-color:var(--wpds-color-bg-surface-success,#c5f7cc);color:var(--wpds-color-fg-content-success,#002900)}._04c1aca8fc449412__is-informational-intent{background-color:var(--wpds-color-bg-surface-info,#deebfa);color:var(--wpds-color-fg-content-info,#001b4f)}._90726e69d495ec19__is-draft-intent{background-color:var(--wpds-color-bg-surface-neutral-weak,#f0f0f0);color:var(--wpds-color-fg-content-neutral,#1e1e1e)}._898f4a544993bd39__is-none-intent{background-color:var(--wpds-color-bg-surface-neutral,#f8f8f8);color:var(--wpds-color-fg-content-neutral-weak,#6d6d6d)}}')),document.head.appendChild(e)}var Qle={badge:"_96e6251aad1a6136__badge","is-high-intent":"_99f7158cb520f750__is-high-intent","is-medium-intent":"c20ebef2365bc8b7__is-medium-intent","is-low-intent":"_365e1626c6202e52__is-low-intent","is-stable-intent":"_33f8198127ddf4ef__is-stable-intent","is-informational-intent":"_04c1aca8fc449412__is-informational-intent","is-draft-intent":"_90726e69d495ec19__is-draft-intent","is-none-intent":"_898f4a544993bd39__is-none-intent"},L4=(0,Jle.forwardRef)(function({children:t,intent:o="none",render:r,className:n,...i},s){return A2({render:r,defaultTagName:"span",ref:s,props:ck(i,{className:V(Qle.badge,Qle[`is-${o}-intent`],n),children:t})})});var ece=l(R(),1);if(typeof document<"u"&&!document.head.querySelector("style[data-wp-hash='71d20935c2']")){let e=document.createElement("style");e.setAttribute("data-wp-hash","71d20935c2"),e.appendChild(document.createTextNode("@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._19ce0419607e1896__stack{display:flex}}")),document.head.appendChild(e)}var YPe={stack:"_19ce0419607e1896__stack"},qPe={xs:"var(--wpds-dimension-gap-xs, 4px)",sm:"var(--wpds-dimension-gap-sm, 8px)",md:"var(--wpds-dimension-gap-md, 12px)",lg:"var(--wpds-dimension-gap-lg, 16px)",xl:"var(--wpds-dimension-gap-xl, 24px)","2xl":"var(--wpds-dimension-gap-2xl, 32px)","3xl":"var(--wpds-dimension-gap-3xl, 40px)"},De=(0,ece.forwardRef)(function({direction:t,gap:o,align:r,justify:n,wrap:i,render:s,...a},c){let u={gap:o&&qPe[o],alignItems:r,justifyContent:n,flexDirection:t,flexWrap:i};return A2({render:s,ref:c,props:ck(a,{style:u,className:YPe.stack})})});var N4=l(N(),1);var Ut="isAny",Ht="isNone",Ir="isAll",Pr="isNotAll",tn="between",on="inThePast",Rn="over",Jt="is",eo="isNot",Hd="lessThan",Gd="greaterThan",Wd="lessThanOrEqual",$d="greaterThanOrEqual",Kd="before",Yd="after",qd="beforeInc",Zd="afterInc",Ja="contains",el="notContains",tl="startsWith",Xd="on",Qd="notOn";var Hht={asc:(0,N4.__)("Sort ascending"),desc:(0,N4.__)("Sort descending")};var tce=l(CO(),1),{lock:Wht,unlock:St}=(0,tce.__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/dataviews");var P_=l(R(),1),ZPe=[];function On({elements:e,getElements:t}){let o=Array.isArray(e)&&e.length>0?e:ZPe,[r,n]=(0,P_.useState)(o),[i,s]=(0,P_.useState)(!1);return(0,P_.useEffect)(()=>{if(!t){n(o);return}let a=!1;return s(!0),t().then(c=>{if(!a){let u=Array.isArray(c)&&c.length>0?c:o;n(u)}}).catch(()=>{a||n(o)}).finally(()=>{a||s(!1)}),()=>{a=!0}},[t,o]),{elements:r,isLoading:i}}var XPe=Math.pow(10,8)*24*60*60*1e3,Yht=-XPe,L2=6048e5,oce=864e5;var QPe=3600;var rce=QPe*24,qht=rce*7,JPe=rce*365.2425,e2e=JPe/12,Zht=e2e*3,M4=Symbol.for("constructDateFrom");function $o(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&M4 in e?e[M4](t):e instanceof Date?new e.constructor(t):new Date(t)}function lt(e,t){return $o(t||e,e)}function N2(e,t,o){let r=lt(e,o?.in);return isNaN(t)?$o(o?.in||e,NaN):(t&&r.setDate(r.getDate()+t),r)}function M2(e,t,o){let r=lt(e,o?.in);if(isNaN(t))return $o(o?.in||e,NaN);if(!t)return r;let n=r.getDate(),i=$o(o?.in||e,r.getTime());i.setMonth(r.getMonth()+t+1,0);let s=i.getDate();return n>=s?i:(r.setFullYear(i.getFullYear(),i.getMonth(),n),r)}var t2e={};function Jd(){return t2e}function Ec(e,t){let o=Jd(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??o.weekStartsOn??o.locale?.options?.weekStartsOn??0,n=lt(e,t?.in),i=n.getDay(),s=(i<r?7:0)+i-r;return n.setDate(n.getDate()-s),n.setHours(0,0,0,0),n}function mp(e,t){return Ec(e,{...t,weekStartsOn:1})}function D2(e,t){let o=lt(e,t?.in),r=o.getFullYear(),n=$o(o,0);n.setFullYear(r+1,0,4),n.setHours(0,0,0,0);let i=mp(n),s=$o(o,0);s.setFullYear(r,0,4),s.setHours(0,0,0,0);let a=mp(s);return o.getTime()>=i.getTime()?r+1:o.getTime()>=a.getTime()?r:r-1}function D4(e){let t=lt(e),o=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return o.setUTCFullYear(t.getFullYear()),+e-+o}function nce(e,...t){let o=$o.bind(null,e||t.find(r=>typeof r=="object"));return t.map(o)}function V4(e,t){let o=lt(e,t?.in);return o.setHours(0,0,0,0),o}function ice(e,t,o){let[r,n]=nce(o?.in,e,t),i=V4(r),s=V4(n),a=+i-D4(i),c=+s-D4(s);return Math.round((a-c)/oce)}function sce(e,t){let o=D2(e,t),r=$o(t?.in||e,0);return r.setFullYear(o,0,4),r.setHours(0,0,0,0),mp(r)}function ace(e,t,o){return N2(e,t*7,o)}function lce(e,t,o){return M2(e,t*12,o)}function cce(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function uk(e){return!(!cce(e)&&typeof e!="number"||isNaN(+lt(e)))}function uce(e,t){let o=lt(e,t?.in);return o.setDate(1),o.setHours(0,0,0,0),o}function V2(e,t){let o=lt(e,t?.in);return o.setFullYear(o.getFullYear(),0,1),o.setHours(0,0,0,0),o}var o2e={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},dce=(e,t,o)=>{let r,n=o2e[e];return typeof n=="string"?r=n:t===1?r=n.one:r=n.other.replace("{{count}}",t.toString()),o?.addSuffix?o.comparison&&o.comparison>0?"in "+r:r+" ago":r};function F2(e){return(t={})=>{let o=t.width?String(t.width):e.defaultWidth;return e.formats[o]||e.formats[e.defaultWidth]}}var r2e={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},n2e={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},i2e={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},fce={date:F2({formats:r2e,defaultWidth:"full"}),time:F2({formats:n2e,defaultWidth:"full"}),dateTime:F2({formats:i2e,defaultWidth:"full"})};var s2e={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},mce=(e,t,o,r)=>s2e[e];function dk(e){return(t,o)=>{let r=o?.context?String(o.context):"standalone",n;if(r==="formatting"&&e.formattingValues){let s=e.defaultFormattingWidth||e.defaultWidth,a=o?.width?String(o.width):s;n=e.formattingValues[a]||e.formattingValues[s]}else{let s=e.defaultWidth,a=o?.width?String(o.width):e.defaultWidth;n=e.values[a]||e.values[s]}let i=e.argumentCallback?e.argumentCallback(t):t;return n[i]}}var a2e={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},l2e={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},c2e={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},u2e={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},d2e={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},f2e={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},m2e=(e,t)=>{let o=Number(e),r=o%100;if(r>20||r<10)switch(r%10){case 1:return o+"st";case 2:return o+"nd";case 3:return o+"rd"}return o+"th"},pce={ordinalNumber:m2e,era:dk({values:a2e,defaultWidth:"wide"}),quarter:dk({values:l2e,defaultWidth:"wide",argumentCallback:e=>e-1}),month:dk({values:c2e,defaultWidth:"wide"}),day:dk({values:u2e,defaultWidth:"wide"}),dayPeriod:dk({values:d2e,defaultWidth:"wide",formattingValues:f2e,defaultFormattingWidth:"wide"})};function fk(e){return(t,o={})=>{let r=o.width,n=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(n);if(!i)return null;let s=i[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(a)?h2e(a,f=>f.test(s)):p2e(a,f=>f.test(s)),u;u=e.valueCallback?e.valueCallback(c):c,u=o.valueCallback?o.valueCallback(u):u;let d=t.slice(s.length);return{value:u,rest:d}}}function p2e(e,t){for(let o in e)if(Object.prototype.hasOwnProperty.call(e,o)&&t(e[o]))return o}function h2e(e,t){for(let o=0;o<e.length;o++)if(t(e[o]))return o}function hce(e){return(t,o={})=>{let r=t.match(e.matchPattern);if(!r)return null;let n=r[0],i=t.match(e.parsePattern);if(!i)return null;let s=e.valueCallback?e.valueCallback(i[0]):i[0];s=o.valueCallback?o.valueCallback(s):s;let a=t.slice(n.length);return{value:s,rest:a}}}var g2e=/^(\d+)(th|st|nd|rd)?/i,b2e=/\d+/i,k2e={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},v2e={any:[/^b/i,/^(a|c)/i]},y2e={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},S2e={any:[/1/i,/2/i,/3/i,/4/i]},_2e={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},x2e={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},w2e={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},C2e={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},B2e={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},E2e={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},gce={ordinalNumber:hce({matchPattern:g2e,parsePattern:b2e,valueCallback:e=>parseInt(e,10)}),era:fk({matchPatterns:k2e,defaultMatchWidth:"wide",parsePatterns:v2e,defaultParseWidth:"any"}),quarter:fk({matchPatterns:y2e,defaultMatchWidth:"wide",parsePatterns:S2e,defaultParseWidth:"any",valueCallback:e=>e+1}),month:fk({matchPatterns:_2e,defaultMatchWidth:"wide",parsePatterns:x2e,defaultParseWidth:"any"}),day:fk({matchPatterns:w2e,defaultMatchWidth:"wide",parsePatterns:C2e,defaultParseWidth:"any"}),dayPeriod:fk({matchPatterns:B2e,defaultMatchWidth:"any",parsePatterns:E2e,defaultParseWidth:"any"})};var F4={code:"en-US",formatDistance:dce,formatLong:fce,formatRelative:mce,localize:pce,match:gce,options:{weekStartsOn:0,firstWeekContainsDate:1}};function bce(e,t){let o=lt(e,t?.in);return ice(o,V2(o))+1}function kce(e,t){let o=lt(e,t?.in),r=+mp(o)-+sce(o);return Math.round(r/L2)+1}function z2(e,t){let o=lt(e,t?.in),r=o.getFullYear(),n=Jd(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,s=$o(t?.in||e,0);s.setFullYear(r+1,0,i),s.setHours(0,0,0,0);let a=Ec(s,t),c=$o(t?.in||e,0);c.setFullYear(r,0,i),c.setHours(0,0,0,0);let u=Ec(c,t);return+o>=+a?r+1:+o>=+u?r:r-1}function vce(e,t){let o=Jd(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,n=z2(e,t),i=$o(t?.in||e,0);return i.setFullYear(n,0,r),i.setHours(0,0,0,0),Ec(i,t)}function yce(e,t){let o=lt(e,t?.in),r=+Ec(o,t)-+vce(o,t);return Math.round(r/L2)+1}function $e(e,t){let o=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return o+r}var Tc={y(e,t){let o=e.getFullYear(),r=o>0?o:1-o;return $e(t==="yy"?r%100:r,t.length)},M(e,t){let o=e.getMonth();return t==="M"?String(o+1):$e(o+1,2)},d(e,t){return $e(e.getDate(),t.length)},a(e,t){let o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return o.toUpperCase();case"aaa":return o;case"aaaaa":return o[0];default:return o==="am"?"a.m.":"p.m."}},h(e,t){return $e(e.getHours()%12||12,t.length)},H(e,t){return $e(e.getHours(),t.length)},m(e,t){return $e(e.getMinutes(),t.length)},s(e,t){return $e(e.getSeconds(),t.length)},S(e,t){let o=t.length,r=e.getMilliseconds(),n=Math.trunc(r*Math.pow(10,o-3));return $e(n,t.length)}};var mk={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},z4={G:function(e,t,o){let r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return o.era(r,{width:"abbreviated"});case"GGGGG":return o.era(r,{width:"narrow"});default:return o.era(r,{width:"wide"})}},y:function(e,t,o){if(t==="yo"){let r=e.getFullYear(),n=r>0?r:1-r;return o.ordinalNumber(n,{unit:"year"})}return Tc.y(e,t)},Y:function(e,t,o,r){let n=z2(e,r),i=n>0?n:1-n;if(t==="YY"){let s=i%100;return $e(s,2)}return t==="Yo"?o.ordinalNumber(i,{unit:"year"}):$e(i,t.length)},R:function(e,t){let o=D2(e);return $e(o,t.length)},u:function(e,t){let o=e.getFullYear();return $e(o,t.length)},Q:function(e,t,o){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return $e(r,2);case"Qo":return o.ordinalNumber(r,{unit:"quarter"});case"QQQ":return o.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return o.quarter(r,{width:"narrow",context:"formatting"});default:return o.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,o){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return $e(r,2);case"qo":return o.ordinalNumber(r,{unit:"quarter"});case"qqq":return o.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return o.quarter(r,{width:"narrow",context:"standalone"});default:return o.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,o){let r=e.getMonth();switch(t){case"M":case"MM":return Tc.M(e,t);case"Mo":return o.ordinalNumber(r+1,{unit:"month"});case"MMM":return o.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return o.month(r,{width:"narrow",context:"formatting"});default:return o.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,o){let r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return $e(r+1,2);case"Lo":return o.ordinalNumber(r+1,{unit:"month"});case"LLL":return o.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return o.month(r,{width:"narrow",context:"standalone"});default:return o.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,o,r){let n=yce(e,r);return t==="wo"?o.ordinalNumber(n,{unit:"week"}):$e(n,t.length)},I:function(e,t,o){let r=kce(e);return t==="Io"?o.ordinalNumber(r,{unit:"week"}):$e(r,t.length)},d:function(e,t,o){return t==="do"?o.ordinalNumber(e.getDate(),{unit:"date"}):Tc.d(e,t)},D:function(e,t,o){let r=bce(e);return t==="Do"?o.ordinalNumber(r,{unit:"dayOfYear"}):$e(r,t.length)},E:function(e,t,o){let r=e.getDay();switch(t){case"E":case"EE":case"EEE":return o.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return o.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return o.day(r,{width:"short",context:"formatting"});default:return o.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,o,r){let n=e.getDay(),i=(n-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return $e(i,2);case"eo":return o.ordinalNumber(i,{unit:"day"});case"eee":return o.day(n,{width:"abbreviated",context:"formatting"});case"eeeee":return o.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return o.day(n,{width:"short",context:"formatting"});default:return o.day(n,{width:"wide",context:"formatting"})}},c:function(e,t,o,r){let n=e.getDay(),i=(n-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return $e(i,t.length);case"co":return o.ordinalNumber(i,{unit:"day"});case"ccc":return o.day(n,{width:"abbreviated",context:"standalone"});case"ccccc":return o.day(n,{width:"narrow",context:"standalone"});case"cccccc":return o.day(n,{width:"short",context:"standalone"});default:return o.day(n,{width:"wide",context:"standalone"})}},i:function(e,t,o){let r=e.getDay(),n=r===0?7:r;switch(t){case"i":return String(n);case"ii":return $e(n,t.length);case"io":return o.ordinalNumber(n,{unit:"day"});case"iii":return o.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return o.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return o.day(r,{width:"short",context:"formatting"});default:return o.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,o){let n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return o.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return o.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return o.dayPeriod(n,{width:"narrow",context:"formatting"});default:return o.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(e,t,o){let r=e.getHours(),n;switch(r===12?n=mk.noon:r===0?n=mk.midnight:n=r/12>=1?"pm":"am",t){case"b":case"bb":return o.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return o.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return o.dayPeriod(n,{width:"narrow",context:"formatting"});default:return o.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(e,t,o){let r=e.getHours(),n;switch(r>=17?n=mk.evening:r>=12?n=mk.afternoon:r>=4?n=mk.morning:n=mk.night,t){case"B":case"BB":case"BBB":return o.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return o.dayPeriod(n,{width:"narrow",context:"formatting"});default:return o.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(e,t,o){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),o.ordinalNumber(r,{unit:"hour"})}return Tc.h(e,t)},H:function(e,t,o){return t==="Ho"?o.ordinalNumber(e.getHours(),{unit:"hour"}):Tc.H(e,t)},K:function(e,t,o){let r=e.getHours()%12;return t==="Ko"?o.ordinalNumber(r,{unit:"hour"}):$e(r,t.length)},k:function(e,t,o){let r=e.getHours();return r===0&&(r=24),t==="ko"?o.ordinalNumber(r,{unit:"hour"}):$e(r,t.length)},m:function(e,t,o){return t==="mo"?o.ordinalNumber(e.getMinutes(),{unit:"minute"}):Tc.m(e,t)},s:function(e,t,o){return t==="so"?o.ordinalNumber(e.getSeconds(),{unit:"second"}):Tc.s(e,t)},S:function(e,t){return Tc.S(e,t)},X:function(e,t,o){let r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return _ce(r);case"XXXX":case"XX":return pp(r);default:return pp(r,":")}},x:function(e,t,o){let r=e.getTimezoneOffset();switch(t){case"x":return _ce(r);case"xxxx":case"xx":return pp(r);default:return pp(r,":")}},O:function(e,t,o){let r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Sce(r,":");default:return"GMT"+pp(r,":")}},z:function(e,t,o){let r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Sce(r,":");default:return"GMT"+pp(r,":")}},t:function(e,t,o){let r=Math.trunc(+e/1e3);return $e(r,t.length)},T:function(e,t,o){return $e(+e,t.length)}};function Sce(e,t=""){let o=e>0?"-":"+",r=Math.abs(e),n=Math.trunc(r/60),i=r%60;return i===0?o+String(n):o+String(n)+t+$e(i,2)}function _ce(e,t){return e%60===0?(e>0?"-":"+")+$e(Math.abs(e)/60,2):pp(e,t)}function pp(e,t=""){let o=e>0?"-":"+",r=Math.abs(e),n=$e(Math.trunc(r/60),2),i=$e(r%60,2);return o+n+t+i}var xce=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},wce=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},T2e=(e,t)=>{let o=e.match(/(P+)(p+)?/)||[],r=o[1],n=o[2];if(!n)return xce(e,t);let i;switch(r){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",xce(r,t)).replace("{{time}}",wce(n,t))},Cce={p:wce,P:T2e};var I2e=/^D+$/,P2e=/^Y+$/,R2e=["D","DD","YY","YYYY"];function Bce(e){return I2e.test(e)}function Ece(e){return P2e.test(e)}function Tce(e,t,o){let r=O2e(e,t,o);if(console.warn(r),R2e.includes(e))throw new RangeError(r)}function O2e(e,t,o){let r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${o}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}var A2e=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,L2e=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,N2e=/^'([^]*?)'?$/,M2e=/''/g,D2e=/[a-zA-Z]/;function j4(e,t,o){let r=Jd(),n=o?.locale??r.locale??F4,i=o?.firstWeekContainsDate??o?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,s=o?.weekStartsOn??o?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,a=lt(e,o?.in);if(!uk(a))throw new RangeError("Invalid time value");let c=t.match(L2e).map(d=>{let f=d[0];if(f==="p"||f==="P"){let m=Cce[f];return m(d,n.formatLong)}return d}).join("").match(A2e).map(d=>{if(d==="''")return{isToken:!1,value:"'"};let f=d[0];if(f==="'")return{isToken:!1,value:V2e(d)};if(z4[f])return{isToken:!0,value:d};if(f.match(D2e))throw new RangeError("Format string contains an unescaped latin alphabet character `"+f+"`");return{isToken:!1,value:d}});n.localize.preprocessor&&(c=n.localize.preprocessor(a,c));let u={firstWeekContainsDate:i,weekStartsOn:s,locale:n};return c.map(d=>{if(!d.isToken)return d.value;let f=d.value;(!o?.useAdditionalWeekYearTokens&&Ece(f)||!o?.useAdditionalDayOfYearTokens&&Bce(f))&&Tce(f,t,String(e));let m=z4[f[0]];return m(a,f,n.localize,u)}).join("")}function V2e(e){let t=e.match(N2e);return t?t[1].replace(M2e,"'"):e}function hp(e,t,o){return N2(e,-t,o)}function j2(e,t,o){return M2(e,-t,o)}function Ice(e,t,o){return ace(e,-t,o)}function U2(e,t,o){return lce(e,-t,o)}var de=l(N(),1),lo=l(R(),1),rn=l(pc(),1);var U4=l(w(),1),wo={Name:(0,U4.jsx)("span",{className:"dataviews-filters__summary-filter-text-name"}),Value:(0,U4.jsx)("span",{className:"dataviews-filters__summary-filter-text-value"})};function Pce(e,t){switch(t){case"days":return hp(new Date,e);case"weeks":return Ice(new Date,e);case"months":return j2(new Date,e);case"years":return U2(new Date,e);default:return new Date}}var Rce={label:(0,de.__)("Is none of"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("<Name>%1$s is none of: </Name><Value>%2$s</Value>"),e.name,t.map(o=>o.label).join(", ")),wo),filter:((e,t,o)=>{if(!o?.length)return!0;let r=t.getValue({item:e});return Array.isArray(r)?!o.some(n=>r.includes(n)):typeof r=="string"?!o.includes(r):!1}),selection:"multi"},Oce=[{name:Ut,label:(0,de.__)("Includes"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("<Name>%1$s includes: </Name><Value>%2$s</Value>"),e.name,t.map(o=>o.label).join(", ")),wo),filter(e,t,o){if(!o?.length)return!0;let r=t.getValue({item:e});return Array.isArray(r)?o.some(n=>r.includes(n)):typeof r=="string"?o.includes(r):!1},selection:"multi"},{name:Ht,...Rce},{name:Ir,label:(0,de.__)("Includes all"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("<Name>%1$s includes all: </Name><Value>%2$s</Value>"),e.name,t.map(o=>o.label).join(", ")),wo),filter(e,t,o){return o?.length?o.every(r=>t.getValue({item:e})?.includes(r)):!0},selection:"multi"},{name:Pr,...Rce},{name:tn,label:(0,de.__)("Between (inc)"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("<Name>%1$s between (inc): </Name><Value>%2$s and %3$s</Value>"),e.name,t[0].label[0],t[0].label[1]),wo),filter(e,t,o){if(!Array.isArray(o)||o.length!==2||o[0]===void 0||o[1]===void 0)return!0;let r=t.getValue({item:e});return typeof r=="number"||r instanceof Date||typeof r=="string"?r>=o[0]&&r<=o[1]:!1},selection:"custom"},{name:on,label:(0,de.__)("In the past"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("<Name>%1$s is in the past: </Name><Value>%2$s</Value>"),e.name,`${t[0].value.value} ${t[0].value.unit}`),wo),filter(e,t,o){if(o?.value===void 0||o?.unit===void 0)return!0;let r=Pce(o.value,o.unit),n=(0,rn.getDate)(t.getValue({item:e}));return n>=r&&n<=new Date},selection:"custom"},{name:Rn,label:(0,de.__)("Over"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("<Name>%1$s is over: </Name><Value>%2$s</Value>"),e.name,`${t[0].value.value} ${t[0].value.unit}`),wo),filter(e,t,o){if(o?.value===void 0||o?.unit===void 0)return!0;let r=Pce(o.value,o.unit);return(0,rn.getDate)(t.getValue({item:e}))<r},selection:"custom"},{name:Jt,label:(0,de.__)("Is"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("<Name>%1$s is: </Name><Value>%2$s</Value>"),e.name,t[0].label),wo),filter(e,t,o){return o===t.getValue({item:e})||o===void 0},selection:"single"},{name:eo,label:(0,de.__)("Is not"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("<Name>%1$s is not: </Name><Value>%2$s</Value>"),e.name,t[0].label),wo),filter(e,t,o){return o!==t.getValue({item:e})},selection:"single"},{name:Hd,label:(0,de.__)("Less than"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("<Name>%1$s is less than: </Name><Value>%2$s</Value>"),e.name,t[0].label),wo),filter(e,t,o){return o===void 0?!0:t.getValue({item:e})<o},selection:"single"},{name:Gd,label:(0,de.__)("Greater than"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("<Name>%1$s is greater than: </Name><Value>%2$s</Value>"),e.name,t[0].label),wo),filter(e,t,o){return o===void 0?!0:t.getValue({item:e})>o},selection:"single"},{name:Wd,label:(0,de.__)("Less than or equal"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("<Name>%1$s is less than or equal to: </Name><Value>%2$s</Value>"),e.name,t[0].label),wo),filter(e,t,o){return o===void 0?!0:t.getValue({item:e})<=o},selection:"single"},{name:$d,label:(0,de.__)("Greater than or equal"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("<Name>%1$s is greater than or equal to: </Name><Value>%2$s</Value>"),e.name,t[0].label),wo),filter(e,t,o){return o===void 0?!0:t.getValue({item:e})>=o},selection:"single"},{name:Kd,label:(0,de.__)("Before"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("<Name>%1$s is before: </Name><Value>%2$s</Value>"),e.name,t[0].label),wo),filter(e,t,o){if(o===void 0)return!0;let r=(0,rn.getDate)(o);return(0,rn.getDate)(t.getValue({item:e}))<r},selection:"single"},{name:Yd,label:(0,de.__)("After"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("<Name>%1$s is after: </Name><Value>%2$s</Value>"),e.name,t[0].label),wo),filter(e,t,o){if(o===void 0)return!0;let r=(0,rn.getDate)(o);return(0,rn.getDate)(t.getValue({item:e}))>r},selection:"single"},{name:qd,label:(0,de.__)("Before (inc)"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("<Name>%1$s is on or before: </Name><Value>%2$s</Value>"),e.name,t[0].label),wo),filter(e,t,o){if(o===void 0)return!0;let r=(0,rn.getDate)(o);return(0,rn.getDate)(t.getValue({item:e}))<=r},selection:"single"},{name:Zd,label:(0,de.__)("After (inc)"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("<Name>%1$s is on or after: </Name><Value>%2$s</Value>"),e.name,t[0].label),wo),filter(e,t,o){if(o===void 0)return!0;let r=(0,rn.getDate)(o);return(0,rn.getDate)(t.getValue({item:e}))>=r},selection:"single"},{name:Ja,label:(0,de.__)("Contains"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("<Name>%1$s contains: </Name><Value>%2$s</Value>"),e.name,t[0].label),wo),filter(e,t,o){if(o===void 0)return!0;let r=t.getValue({item:e});return typeof r=="string"&&o&&r.toLowerCase().includes(String(o).toLowerCase())},selection:"single"},{name:el,label:(0,de.__)("Doesn't contain"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("<Name>%1$s doesn't contain: </Name><Value>%2$s</Value>"),e.name,t[0].label),wo),filter(e,t,o){if(o===void 0)return!0;let r=t.getValue({item:e});return typeof r=="string"&&o&&!r.toLowerCase().includes(String(o).toLowerCase())},selection:"single"},{name:tl,label:(0,de.__)("Starts with"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("<Name>%1$s starts with: </Name><Value>%2$s</Value>"),e.name,t[0].label),wo),filter(e,t,o){if(o===void 0)return!0;let r=t.getValue({item:e});return typeof r=="string"&&o&&r.toLowerCase().startsWith(String(o).toLowerCase())},selection:"single"},{name:Xd,label:(0,de.__)("On"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("<Name>%1$s is: </Name><Value>%2$s</Value>"),e.name,t[0].label),wo),filter(e,t,o){if(o===void 0)return!0;let r=(0,rn.getDate)(o),n=(0,rn.getDate)(t.getValue({item:e}));return r.getTime()===n.getTime()},selection:"single"},{name:Qd,label:(0,de.__)("Not on"),filterText:(e,t)=>(0,lo.createInterpolateElement)((0,de.sprintf)((0,de.__)("<Name>%1$s is not: </Name><Value>%2$s</Value>"),e.name,t[0].label),wo),filter(e,t,o){if(o===void 0)return!0;let r=(0,rn.getDate)(o),n=(0,rn.getDate)(t.getValue({item:e}));return r.getTime()!==n.getTime()},selection:"single"}],Ace=e=>Oce.find(t=>t.name===e),Lce=()=>Oce.map(e=>e.name);var Nce=l(A(),1),Mce=l(R(),1);function pt(e,t){let o;return e?.required&&t?.required?o=t?.required?.message?t.required:void 0:e?.pattern&&t?.pattern?o=t.pattern:e?.min&&t?.min?o=t.min:e?.max&&t?.max?o=t.max:e?.minLength&&t?.minLength?o=t.minLength:e?.maxLength&&t?.maxLength?o=t.maxLength:e?.elements&&t?.elements?o=t.elements:t?.custom&&(o=t.custom),o}var Dce=l(w(),1),{ValidatedCheckboxControl:F2e}=St(Nce.privateApis);function Vce({field:e,onChange:t,data:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{getValue:s,setValue:a,label:c,description:u,isValid:d}=e,f=(0,Mce.useCallback)(()=>{t(a({item:o,value:!s({item:o})}))},[o,s,t,a]);return(0,Dce.jsx)(F2e,{required:!!e.isValid?.required,markWhenOptional:n,customValidity:pt(d,i),hidden:r,label:c,help:u,checked:s({item:o}),onChange:f})}var H2=l(A(),1),Fce=l(R(),1);var H4=l(w(),1),{ValidatedComboboxControl:z2e}=St(H2.privateApis);function G2({data:e,field:t,onChange:o,hideLabelFromVision:r,validity:n}){let{label:i,description:s,placeholder:a,getValue:c,setValue:u,isValid:d}=t,f=c({item:e})??"",m=(0,Fce.useCallback)(g=>o(u({item:e,value:g??""})),[e,o,u]),{elements:h,isLoading:p}=On({elements:t.elements,getElements:t.getElements});return p?(0,H4.jsx)(H2.Spinner,{}):(0,H4.jsx)(z2e,{required:!!t.isValid?.required,customValidity:pt(d,n),label:i,value:f,help:s,placeholder:a,options:h,onChange:m,hideLabelFromVision:r,allowReset:!0,expandOnFocus:!0})}var Y2=l(A(),1),cs=l(R(),1),K2=l(N(),1),hi=l(pc(),1);var hk=l(A(),1),G4=l(R(),1),ol=l(N(),1);var pk=l(w(),1),j2e={[on]:[{value:"days",label:(0,ol.__)("Days")},{value:"weeks",label:(0,ol.__)("Weeks")},{value:"months",label:(0,ol.__)("Months")},{value:"years",label:(0,ol.__)("Years")}],[Rn]:[{value:"days",label:(0,ol.__)("Days ago")},{value:"weeks",label:(0,ol.__)("Weeks ago")},{value:"months",label:(0,ol.__)("Months ago")},{value:"years",label:(0,ol.__)("Years ago")}]};function W2({className:e,data:t,field:o,onChange:r,hideLabelFromVision:n,operator:i}){let s=j2e[i===on?"inThePast":"over"],{id:a,label:c,getValue:u,setValue:d}=o,f=u({item:t}),{value:m="",unit:h=s[0].value}=f&&typeof f=="object"?f:{},p=(0,G4.useCallback)(b=>r(d({item:t,value:{value:Number(b),unit:h}})),[r,d,t,h]),g=(0,G4.useCallback)(b=>r(d({item:t,value:{value:m,unit:b}})),[r,d,t,m]);return(0,pk.jsx)(hk.BaseControl,{id:a,className:V(e,"dataviews-controls__relative-date"),label:c,hideLabelFromVision:n,children:(0,pk.jsxs)(De,{direction:"row",gap:"sm",children:[(0,pk.jsx)(hk.__experimentalNumberControl,{__next40pxDefaultSize:!0,className:"dataviews-controls__relative-date-number",spinControls:"none",min:1,step:1,value:m,onChange:p}),(0,pk.jsx)(hk.SelectControl,{className:"dataviews-controls__relative-date-unit",__next40pxDefaultSize:!0,label:(0,ol.__)("Unit"),value:h,options:s,onChange:g,hideLabelFromVision:!0})]})})}var zce=l(pc(),1);function $2(e){if(!e)return null;let t=(0,zce.getDate)(e);return t&&uk(t)?t:null}var ef=l(w(),1),{DateCalendar:U2e,ValidatedInputControl:H2e}=St(Y2.privateApis),G2e=e=>e?(0,hi.dateI18n)("Y-m-d\\TH:i",(0,hi.getDate)(e)):"";function W2e({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{id:s,label:a,description:c,setValue:u,getValue:d,isValid:f}=t,m=d({item:e}),h=typeof m=="string"?m:void 0,[p,g]=(0,cs.useState)(()=>$2(h)||new Date),b=(0,cs.useRef)(null),v=(0,cs.useRef)(void 0),k=(0,cs.useRef)(null),y=(0,cs.useCallback)(E=>o(u({item:e,value:E})),[e,o,u]);(0,cs.useEffect)(()=>()=>{v.current&&clearTimeout(v.current)},[]);let S=(0,cs.useCallback)(E=>{let L;if(E){let T=(0,hi.dateI18n)("Y-m-d",E),O;h?O=(0,hi.dateI18n)("H:i",(0,hi.getDate)(h)):O=(0,hi.dateI18n)("H:i",E),L=(0,hi.getDate)(`${T}T${O}`).toISOString(),y(L),v.current&&clearTimeout(v.current)}else y(void 0);k.current=b.current&&b.current.ownerDocument.activeElement,v.current=setTimeout(()=>{b.current&&(b.current.focus(),b.current.blur(),y(L),k.current&&k.current instanceof HTMLElement&&k.current.focus())},0)},[y,h]),x=(0,cs.useCallback)(E=>{if(E){let L=(0,hi.getDate)(E);y(L.toISOString());let T=$2(L.toISOString());T&&g(T)}else y(void 0)},[y]),{format:C}=t,B=C.weekStartsOn??(0,hi.getSettings)().l10n.startOfWeek,{timezone:{string:I}}=(0,hi.getSettings)(),P=a;return f?.required&&!n&&!r?P=`${a} (${(0,K2.__)("Required")})`:!f?.required&&n&&!r&&(P=`${a} (${(0,K2.__)("Optional")})`),(0,ef.jsx)(Y2.BaseControl,{id:s,label:P,help:c,hideLabelFromVision:r,children:(0,ef.jsxs)(De,{direction:"column",gap:"lg",children:[(0,ef.jsx)(U2e,{style:{width:"100%"},selected:h&&$2(h)||void 0,onSelect:S,month:p,onMonthChange:g,timeZone:I||void 0,weekStartsOn:B}),(0,ef.jsx)(H2e,{ref:b,__next40pxDefaultSize:!0,required:!!f?.required,customValidity:pt(f,i),type:"datetime-local",label:(0,K2.__)("Date time"),hideLabelFromVision:!0,value:G2e(h),onChange:x})]})})}function jce({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,operator:i,validity:s}){return i===on||i===Rn?(0,ef.jsx)(W2,{className:"dataviews-controls__datetime",data:e,field:t,onChange:o,hideLabelFromVision:r,operator:i}):(0,ef.jsx)(W2e,{data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:s})}var Or=l(A(),1),tt=l(R(),1),Ko=l(N(),1),Rr=l(pc(),1);var ht=l(w(),1),{DateCalendar:$2e,DateRangeCalendar:K2e}=St(Or.privateApis),Y2e=[{id:"today",label:(0,Ko.__)("Today"),getValue:()=>(0,Rr.getDate)(null)},{id:"yesterday",label:(0,Ko.__)("Yesterday"),getValue:()=>{let e=(0,Rr.getDate)(null);return hp(e,1)}},{id:"past-week",label:(0,Ko.__)("Past week"),getValue:()=>{let e=(0,Rr.getDate)(null);return hp(e,7)}},{id:"past-month",label:(0,Ko.__)("Past month"),getValue:()=>{let e=(0,Rr.getDate)(null);return j2(e,1)}}],q2e=[{id:"last-7-days",label:(0,Ko.__)("Last 7 days"),getValue:()=>{let e=(0,Rr.getDate)(null);return[hp(e,7),e]}},{id:"last-30-days",label:(0,Ko.__)("Last 30 days"),getValue:()=>{let e=(0,Rr.getDate)(null);return[hp(e,30),e]}},{id:"month-to-date",label:(0,Ko.__)("Month to date"),getValue:()=>{let e=(0,Rr.getDate)(null);return[uce(e),e]}},{id:"last-year",label:(0,Ko.__)("Last year"),getValue:()=>{let e=(0,Rr.getDate)(null);return[U2(e,1),e]}},{id:"year-to-date",label:(0,Ko.__)("Year to date"),getValue:()=>{let e=(0,Rr.getDate)(null);return[V2(e),e]}}],gk=e=>{if(!e)return null;let t=(0,Rr.getDate)(e);return t&&uk(t)?t:null},W4=e=>e?typeof e=="string"?e:j4(e,"yyyy-MM-dd"):"";function Uce({field:e,validity:t,inputRefs:o,isTouched:r,setIsTouched:n,children:i}){let{isValid:s}=e,[a,c]=(0,tt.useState)(void 0),u=(0,tt.useCallback)(()=>{let f=Array.isArray(o)?o:[o];for(let m of f){let h=m.current;if(h&&!h.validity.valid){c({type:"invalid",message:h.validationMessage});return}}c(void 0)},[o]);return(0,tt.useEffect)(()=>{let f=Array.isArray(o)?o:[o],m=t?pt(s,t):void 0;for(let h of f){let p=h.current;p&&p.setCustomValidity(m?.type==="invalid"&&m.message?m.message:"")}},[o,s,t]),(0,tt.useEffect)(()=>{let f=Array.isArray(o)?o:[o],m=h=>{h.preventDefault(),n(!0)};for(let h of f)h.current?.addEventListener("invalid",m);return()=>{for(let h of f)h.current?.removeEventListener("invalid",m)}},[o,n]),(0,tt.useEffect)(()=>{if(!r)return;let f=t?pt(s,t):void 0;f?c(f):u()},[r,s,t,u]),(0,ht.jsxs)("div",{onBlur:f=>{r||(!f.relatedTarget||!f.currentTarget.contains(f.relatedTarget))&&n(!0)},children:[i,(0,ht.jsx)("div",{"aria-live":"polite",children:a&&(0,ht.jsxs)("p",{className:V("components-validated-control__indicator",a.type==="invalid"?"is-invalid":void 0),children:[(0,ht.jsx)(Or.Icon,{className:"components-validated-control__indicator-icon",icon:Pf,size:16,fill:"currentColor"}),a.message]})})]})}function Z2e({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{id:s,label:a,setValue:c,getValue:u,isValid:d,format:f}=t,[m,h]=(0,tt.useState)(null),p=f.weekStartsOn??(0,Rr.getSettings)().l10n.startOfWeek,g=u({item:e}),b=typeof g=="string"?g:void 0,[v,k]=(0,tt.useState)(()=>gk(b)||new Date),[y,S]=(0,tt.useState)(!1),x=(0,tt.useRef)(null),C=(0,tt.useCallback)(T=>o(c({item:e,value:T})),[e,o,c]),B=(0,tt.useCallback)(T=>{let O=T?j4(T,"yyyy-MM-dd"):void 0;C(O),h(null),S(!0)},[C]),I=(0,tt.useCallback)(T=>{let O=T.getValue(),D=W4(O);k(O),C(D),h(T.id),S(!0)},[C]),P=(0,tt.useCallback)(T=>{if(C(T),T){let O=gk(T);O&&k(O)}h(null),S(!0)},[C]),{timezone:{string:E}}=(0,Rr.getSettings)(),L=a;return d?.required&&!n?L=`${a} (${(0,Ko.__)("Required")})`:!d?.required&&n&&(L=`${a} (${(0,Ko.__)("Optional")})`),(0,ht.jsx)(Uce,{field:t,validity:i,inputRefs:x,isTouched:y,setIsTouched:S,children:(0,ht.jsx)(Or.BaseControl,{id:s,className:"dataviews-controls__date",label:L,hideLabelFromVision:r,children:(0,ht.jsxs)(De,{direction:"column",gap:"lg",children:[(0,ht.jsxs)(De,{direction:"row",gap:"sm",wrap:"wrap",justify:"flex-start",children:[Y2e.map(T=>{let O=m===T.id;return(0,ht.jsx)(Or.Button,{className:"dataviews-controls__date-preset",variant:"tertiary",isPressed:O,size:"small",onClick:()=>I(T),children:T.label},T.id)}),(0,ht.jsx)(Or.Button,{className:"dataviews-controls__date-preset",variant:"tertiary",isPressed:!m,size:"small",disabled:!!m,accessibleWhenDisabled:!1,children:(0,Ko.__)("Custom")})]}),(0,ht.jsx)(Or.__experimentalInputControl,{__next40pxDefaultSize:!0,ref:x,type:"date",label:(0,Ko.__)("Date"),hideLabelFromVision:!0,value:b,onChange:P,required:!!t.isValid?.required}),(0,ht.jsx)($2e,{style:{width:"100%"},selected:b&&gk(b)||void 0,onSelect:B,month:v,onMonthChange:k,timeZone:E||void 0,weekStartsOn:p})]})})})}function X2e({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{id:s,label:a,getValue:c,setValue:u,format:d}=t,f,m=c({item:e});Array.isArray(m)&&m.length===2&&m.every(D=>typeof D=="string")&&(f=m);let h=d.weekStartsOn??(0,Rr.getSettings)().l10n.startOfWeek,p=(0,tt.useCallback)(D=>{o(u({item:e,value:D}))},[e,o,u]),[g,b]=(0,tt.useState)(null),v=(0,tt.useMemo)(()=>{if(!f)return{from:void 0,to:void 0};let[D,U]=f;return{from:gk(D)||void 0,to:gk(U)||void 0}},[f]),[k,y]=(0,tt.useState)(()=>v.from||new Date),[S,x]=(0,tt.useState)(!1),C=(0,tt.useRef)(null),B=(0,tt.useRef)(null),I=(0,tt.useCallback)((D,U)=>{D&&U?p([W4(D),W4(U)]):!D&&!U&&p(void 0)},[p]),P=(0,tt.useCallback)(D=>{I(D?.from,D?.to),b(null),x(!0)},[I]),E=(0,tt.useCallback)(D=>{let[U,G]=D.getValue();y(U),I(U,G),b(D.id),x(!0)},[I]),L=(0,tt.useCallback)((D,U)=>{let[G,j]=f||[void 0,void 0];if(I(D==="from"?U:G,D==="to"?U:j),U){let ee=gk(U);ee&&y(ee)}b(null),x(!0)},[f,I]),{timezone:T}=(0,Rr.getSettings)(),O=a;return t.isValid?.required&&!n?O=`${a} (${(0,Ko.__)("Required")})`:!t.isValid?.required&&n&&(O=`${a} (${(0,Ko.__)("Optional")})`),(0,ht.jsx)(Uce,{field:t,validity:i,inputRefs:[C,B],isTouched:S,setIsTouched:x,children:(0,ht.jsx)(Or.BaseControl,{id:s,className:"dataviews-controls__date",label:O,hideLabelFromVision:r,children:(0,ht.jsxs)(De,{direction:"column",gap:"lg",children:[(0,ht.jsxs)(De,{direction:"row",gap:"sm",wrap:"wrap",justify:"flex-start",children:[q2e.map(D=>{let U=g===D.id;return(0,ht.jsx)(Or.Button,{className:"dataviews-controls__date-preset",variant:"tertiary",isPressed:U,size:"small",onClick:()=>E(D),children:D.label},D.id)}),(0,ht.jsx)(Or.Button,{className:"dataviews-controls__date-preset",variant:"tertiary",isPressed:!g,size:"small",accessibleWhenDisabled:!1,disabled:!!g,children:(0,Ko.__)("Custom")})]}),(0,ht.jsxs)(De,{direction:"row",gap:"sm",justify:"space-between",className:"dataviews-controls__date-range-inputs",children:[(0,ht.jsx)(Or.__experimentalInputControl,{__next40pxDefaultSize:!0,ref:C,type:"date",label:(0,Ko.__)("From"),hideLabelFromVision:!0,value:f?.[0],onChange:D=>L("from",D),required:!!t.isValid?.required}),(0,ht.jsx)(Or.__experimentalInputControl,{__next40pxDefaultSize:!0,ref:B,type:"date",label:(0,Ko.__)("To"),hideLabelFromVision:!0,value:f?.[1],onChange:D=>L("to",D),required:!!t.isValid?.required})]}),(0,ht.jsx)(K2e,{style:{width:"100%"},selected:v,onSelect:P,month:k,onMonthChange:y,timeZone:T.string||void 0,weekStartsOn:h})]})})})}function Hce({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,operator:i,validity:s}){return i===on||i===Rn?(0,ht.jsx)(W2,{className:"dataviews-controls__date",data:e,field:t,onChange:o,hideLabelFromVision:r,operator:i}):i===tn?(0,ht.jsx)(X2e,{data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:s}):(0,ht.jsx)(Z2e,{data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:s})}var q2=l(A(),1),Gce=l(R(),1);var $4=l(w(),1),{ValidatedSelectControl:Q2e}=St(q2.privateApis);function Z2({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{type:s,label:a,description:c,getValue:u,setValue:d,isValid:f}=t,m=s==="array",h=u({item:e})??(m?[]:""),p=(0,Gce.useCallback)(v=>o(d({item:e,value:v})),[e,o,d]),{elements:g,isLoading:b}=On({elements:t.elements,getElements:t.getElements});return b?(0,$4.jsx)(q2.Spinner,{}):(0,$4.jsx)(Q2e,{required:!!t.isValid?.required,markWhenOptional:n,customValidity:pt(f,i),label:a,value:h,help:c,options:g,onChange:p,__next40pxDefaultSize:!0,hideLabelFromVision:r,multiple:m})}var K4=l(w(),1),J2e=10;function Wce(e){let{field:t}=e,{elements:o}=On({elements:t.elements,getElements:t.getElements});return o.length>=J2e?(0,K4.jsx)(G2,{...e}):(0,K4.jsx)(Z2,{...e})}var Q2=l(A(),1);var $ce=l(A(),1),Kce=l(R(),1);var Yce=l(w(),1),{ValidatedInputControl:eRe}=St($ce.privateApis);function rl({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,type:i,prefix:s,suffix:a,validity:c}){let{label:u,placeholder:d,description:f,getValue:m,setValue:h,isValid:p}=t,g=m({item:e}),b=(0,Kce.useCallback)(v=>o(h({item:e,value:v})),[e,h,o]);return(0,Yce.jsx)(eRe,{required:!!p.required,markWhenOptional:n,customValidity:pt(p,c),label:u,placeholder:d,value:g??"",help:f,onChange:b,hideLabelFromVision:r,type:i,prefix:s,suffix:a,pattern:p.pattern?p.pattern.constraint:void 0,minLength:p.minLength?p.minLength.constraint:void 0,maxLength:p.maxLength?p.maxLength.constraint:void 0,__next40pxDefaultSize:!0})}var X2=l(w(),1);function qce({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){return(0,X2.jsx)(rl,{data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i,type:"email",prefix:(0,X2.jsx)(Q2.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,X2.jsx)(Q2.Icon,{icon:gA})})})}var eR=l(A(),1);var J2=l(w(),1);function Zce({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){return(0,J2.jsx)(rl,{data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i,type:"tel",prefix:(0,J2.jsx)(eR.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,J2.jsx)(eR.Icon,{icon:cv})})})}var oR=l(A(),1);var tR=l(w(),1);function Xce({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){return(0,tR.jsx)(rl,{data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i,type:"url",prefix:(0,tR.jsx)(oR.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,tR.jsx)(oR.Icon,{icon:fn})})})}var Ic=l(A(),1),R_=l(R(),1),rR=l(N(),1);var tf=l(w(),1),{ValidatedNumberControl:tRe}=St(Ic.privateApis);function Qce(e){if(e===""||e===void 0)return"";let t=Number(e);return Number.isFinite(t)?t:""}function oRe({value:e,onChange:t,hideLabelFromVision:o,step:r}){let[n="",i=""]=e,s=(0,R_.useCallback)(c=>t([Qce(c),i]),[t,i]),a=(0,R_.useCallback)(c=>t([n,Qce(c)]),[t,n]);return(0,tf.jsx)(Ic.BaseControl,{help:(0,rR.__)("The max. value must be greater than the min. value."),children:(0,tf.jsxs)(Ic.Flex,{direction:"row",gap:4,children:[(0,tf.jsx)(Ic.__experimentalNumberControl,{label:(0,rR.__)("Min."),value:n,max:i?Number(i)-r:void 0,onChange:s,__next40pxDefaultSize:!0,hideLabelFromVision:o,step:r}),(0,tf.jsx)(Ic.__experimentalNumberControl,{label:(0,rR.__)("Max."),value:i,min:n?Number(n)+r:void 0,onChange:a,__next40pxDefaultSize:!0,hideLabelFromVision:o,step:r})]})})}function nR({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,operator:i,validity:s}){let a=t.format?.decimals??0,c=Math.pow(10,Math.abs(a)*-1),{label:u,description:d,getValue:f,setValue:m,isValid:h}=t,p=f({item:e})??"",g=(0,R_.useCallback)(v=>{o(m({item:e,value:["",void 0].includes(v)?void 0:Number(v)}))},[e,o,m]),b=(0,R_.useCallback)(v=>{o(m({item:e,value:v}))},[e,o,m]);if(i===tn){let v=["",""];return Array.isArray(p)&&p.length===2&&p.every(k=>typeof k=="number"||k==="")&&(v=p),(0,tf.jsx)(oRe,{value:v,onChange:b,hideLabelFromVision:r,step:c})}return(0,tf.jsx)(tRe,{required:!!h.required,markWhenOptional:n,customValidity:pt(h,s),label:u,help:d,value:p,onChange:g,__next40pxDefaultSize:!0,hideLabelFromVision:r,step:c,min:h.min?h.min.constraint:void 0,max:h.max?h.max.constraint:void 0})}var Jce=l(w(),1);function eue(e){return(0,Jce.jsx)(nR,{...e})}var tue=l(w(),1);function oue(e){return(0,tue.jsx)(nR,{...e})}var iR=l(A(),1),rue=l(R(),1);var Y4=l(w(),1),{ValidatedRadioControl:rRe}=St(iR.privateApis);function nue({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{label:s,description:a,getValue:c,setValue:u,isValid:d}=t,{elements:f,isLoading:m}=On({elements:t.elements,getElements:t.getElements}),h=c({item:e}),p=(0,rue.useCallback)(g=>o(u({item:e,value:g})),[e,o,u]);return m?(0,Y4.jsx)(iR.Spinner,{}):(0,Y4.jsx)(rRe,{required:!!t.isValid?.required,markWhenOptional:n,customValidity:pt(d,i),label:s,help:a,onChange:p,options:f,selected:h,hideLabelFromVision:r})}var q4=l(R(),1);var iue=l(w(),1);function sue({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,config:i,validity:s}){let{prefix:a,suffix:c}=i||{};return(0,iue.jsx)(rl,{data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:s,prefix:a?(0,q4.createElement)(a):void 0,suffix:c?(0,q4.createElement)(c):void 0})}var aue=l(A(),1),lue=l(R(),1);var cue=l(w(),1),{ValidatedToggleControl:nRe}=St(aue.privateApis);function uue({field:e,onChange:t,data:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{label:s,description:a,getValue:c,setValue:u,isValid:d}=e,f=(0,lue.useCallback)(()=>{t(u({item:o,value:!c({item:o})}))},[t,u,o,c]);return(0,cue.jsx)(nRe,{required:!!d.required,markWhenOptional:n,customValidity:pt(d,i),hidden:r,label:s,help:a,checked:c({item:o}),onChange:f})}var due=l(A(),1),fue=l(R(),1);var mue=l(w(),1),{ValidatedTextareaControl:iRe}=St(due.privateApis);function pue({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,config:i,validity:s}){let{rows:a=4}=i||{},{label:c,placeholder:u,description:d,setValue:f,isValid:m}=t,h=t.getValue({item:e}),p=(0,fue.useCallback)(g=>o(f({item:e,value:g})),[e,o,f]);return(0,mue.jsx)(iRe,{required:!!m.required,markWhenOptional:n,customValidity:pt(m,s),label:c,placeholder:u,value:h??"",help:d,onChange:p,rows:a,minLength:m.minLength?m.minLength.constraint:void 0,maxLength:m.maxLength?m.maxLength.constraint:void 0,__next40pxDefaultSize:!0,hideLabelFromVision:r})}var bk=l(A(),1),hue=l(R(),1);var sR=l(w(),1),{ValidatedToggleGroupControl:sRe}=St(bk.privateApis);function gue({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{getValue:s,setValue:a,isValid:c}=t,u=s({item:e}),d=(0,hue.useCallback)(p=>o(a({item:e,value:p})),[e,o,a]),{elements:f,isLoading:m}=On({elements:t.elements,getElements:t.getElements});if(m)return(0,sR.jsx)(bk.Spinner,{});if(f.length===0)return null;let h=f.find(p=>p.value===u);return(0,sR.jsx)(sRe,{required:!!t.isValid?.required,markWhenOptional:n,customValidity:pt(c,i),__next40pxDefaultSize:!0,isBlock:!0,label:t.label,help:h?.description||t.description,onChange:d,value:u,hideLabelFromVision:r,children:f.map(p=>(0,sR.jsx)(bk.__experimentalToggleGroupControlOption,{label:p.label,value:p.value},p.value))})}var aR=l(A(),1),lR=l(R(),1);var O_=l(w(),1),{ValidatedFormTokenField:aRe}=St(aR.privateApis);function bue({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{label:s,placeholder:a,getValue:c,setValue:u,isValid:d}=t,f=c({item:e}),{elements:m,isLoading:h}=On({elements:t.elements,getElements:t.getElements}),p=(0,lR.useMemo)(()=>Array.isArray(f)?f.map(b=>m?.find(k=>k.value===b)||{value:b,label:b}):[],[f,m]),g=(0,lR.useCallback)(b=>{let v=b.map(k=>typeof k=="object"&&"value"in k?k.value:k);o(u({item:e,value:v}))},[o,u,e]);return h?(0,O_.jsx)(aR.Spinner,{}):(0,O_.jsx)(aRe,{required:!!d?.required,markWhenOptional:n,customValidity:pt(d,i),label:r?void 0:s,value:p,onChange:g,placeholder:a,suggestions:m?.map(b=>b.value),__experimentalValidateInput:b=>t.isValid?.elements&&m?m.some(v=>v.value===b||v.label===b):!0,__experimentalExpandOnFocus:m&&m.length>0,__experimentalShowHowTo:!t.isValid?.elements,displayTransform:b=>typeof b=="object"&&"label"in b?b.label:typeof b=="string"&&m&&m.find(k=>k.value===b)?.label||b,__experimentalRenderItem:({item:b})=>{if(typeof b=="string"&&m){let v=m.find(k=>k.value===b);return(0,O_.jsx)("span",{children:v?.label||b})}return(0,O_.jsx)("span",{children:b})}})}var An=l(A(),1),Z4=l(R(),1),kue=l(N(),1);var Pc=l(w(),1),{ValidatedInputControl:lRe}=St(An.privateApis),cRe=({color:e,onColorChange:t})=>{let o=e&&Bt(e).isValid()?e:"#ffffff";return(0,Pc.jsx)(An.Dropdown,{className:"dataviews-controls__color-picker-dropdown",popoverProps:{resize:!1},renderToggle:({onToggle:r})=>(0,Pc.jsx)(An.Button,{onClick:r,"aria-label":(0,kue.__)("Open color picker"),size:"small",icon:()=>(0,Pc.jsx)(An.ColorIndicator,{colorValue:o})}),renderContent:()=>(0,Pc.jsx)(An.__experimentalDropdownContentWrapper,{paddingSize:"none",children:(0,Pc.jsx)(An.ColorPicker,{color:o,onChange:t,enableAlpha:!0})})})};function vue({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{label:s,placeholder:a,description:c,setValue:u,isValid:d}=t,f=t.getValue({item:e})||"",m=(0,Z4.useCallback)(p=>{o(u({item:e,value:p}))},[e,o,u]),h=(0,Z4.useCallback)(p=>{o(u({item:e,value:p||""}))},[e,o,u]);return(0,Pc.jsx)(lRe,{required:!!t.isValid?.required,markWhenOptional:n,customValidity:pt(d,i),label:s,placeholder:a,value:f,help:c,onChange:h,hideLabelFromVision:r,type:"text",prefix:(0,Pc.jsx)(An.__experimentalInputControlPrefixWrapper,{variant:"control",children:(0,Pc.jsx)(cRe,{color:f,onColorChange:m})})})}var uR=l(A(),1),dR=l(R(),1),X4=l(N(),1);var cR=l(w(),1);function yue({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let[s,a]=(0,dR.useState)(!1),c=(0,dR.useCallback)(()=>{a(u=>!u)},[]);return(0,cR.jsx)(rl,{data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i,type:s?"text":"password",suffix:(0,cR.jsx)(uR.__experimentalInputControlSuffixWrapper,{variant:"control",children:(0,cR.jsx)(uR.Button,{icon:s?vs:Af,onClick:c,size:"small",label:s?(0,X4.__)("Hide password"):(0,X4.__)("Show password")})})})}function fR(e){return Array.isArray(e.elements)&&e.elements.length>0||typeof e.getElements=="function"}var _ue=l(w(),1),Sue={adaptiveSelect:Wce,array:bue,checkbox:Vce,color:vue,combobox:G2,datetime:jce,date:Hce,email:qce,telephone:Zce,url:Xce,integer:eue,number:oue,password:yue,radio:nue,select:Z2,text:sue,toggle:uue,textarea:pue,toggleGroup:gue};function uRe(e){return e&&typeof e=="object"&&typeof e.control=="string"}function dRe(e){let{control:t,...o}=e,r=mR(t);return r===null?null:function(i){return(0,_ue.jsx)(r,{...i,config:o})}}function xue(e,t){return typeof e.Edit=="function"?e.Edit:typeof e.Edit=="string"?mR(e.Edit):uRe(e.Edit)?dRe(e.Edit):fR(e)&&e.type!=="array"?mR("adaptiveSelect"):t===null?null:mR(t)}function mR(e){return Object.keys(Sue).includes(e)?Sue[e]:null}function fRe(e,t,o){if(e.filterBy===!1)return!1;let r=e.filterBy?.operators?.filter(n=>o.includes(n))??t;return r.length===0?!1:{isPrimary:!!e.filterBy?.isPrimary,operators:r}}var wue=fRe;var mRe=e=>({item:t})=>{let o=e.split("."),r=t;for(let n of o)r.hasOwnProperty(n)?r=r[n]:r=void 0;return r},Cue=mRe;var pRe=e=>({value:t})=>{let o=e.split("."),r={},n=r;for(let i of o.slice(0,-1))n[i]={},n=n[i];return n[o.at(-1)]=t,r},Bue=pRe;var Tue=l(N(),1);function pR({item:e,field:t}){let{elements:o,isLoading:r}=On({elements:t.elements,getElements:t.getElements}),n=t.getValue({item:e});return r||o.length===0?n:o?.find(i=>i.value===n)?.label||t.getValue({item:e})}var Eue=l(w(),1);function co({item:e,field:t}){return t.hasElements?(0,Eue.jsx)(pR,{item:e,field:t}):t.getValueFormatted({item:e,field:t})}var nl=(e,t,o)=>o==="asc"?e.localeCompare(t):t.localeCompare(e);function uo(e,t){let o=t.getValue({item:e});return![void 0,"",null].includes(o)}function il(e,t){if(typeof t.isValid.minLength?.constraint!="number")return!1;let o=t.getValue({item:e});return[void 0,"",null].includes(o)?!0:String(o).length>=t.isValid.minLength.constraint}function sl(e,t){if(typeof t.isValid.maxLength?.constraint!="number")return!1;let o=t.getValue({item:e});return[void 0,"",null].includes(o)?!0:String(o).length<=t.isValid.maxLength.constraint}function al(e,t){if(t.isValid.pattern?.constraint===void 0)return!0;try{let o=new RegExp(t.isValid.pattern.constraint),r=t.getValue({item:e});return[void 0,"",null].includes(r)?!0:o.test(String(r))}catch{return!1}}function _t(e,t){let r=(t.elements??[]).map(i=>i.value);if(r.length===0)return!0;let n=t.getValue({item:e});return[].concat(n).every(i=>r.includes(i))}function hRe({item:e,field:t}){return t.getValue({item:e})}var nn=hRe;var gRe=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;function bRe(e,t){let o=t.getValue({item:e});return![void 0,"",null].includes(o)&&!gRe.test(o)?(0,Tue.__)("Value must be a valid email address."):null}var Iue={type:"email",render:co,Edit:"email",sort:nl,enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[Ut,Ht],validOperators:[Jt,eo,Ja,el,tl,Ut,Ht,Ir,Pr],format:{},getValueFormatted:nn,validate:{required:uo,pattern:al,minLength:il,maxLength:sl,elements:_t,custom:bRe}};var Pue=l(N(),1);var kk=(e,t,o)=>o==="asc"?e-t:t-e;function hR(e,t){if(typeof t.isValid.min?.constraint!="number")return!1;let o=t.getValue({item:e});return[void 0,"",null].includes(o)?!0:Number(o)>=t.isValid.min.constraint}function gR(e,t){if(typeof t.isValid.max?.constraint!="number")return!1;let o=t.getValue({item:e});return[void 0,"",null].includes(o)?!0:Number(o)<=t.isValid.max.constraint}var Rue={separatorThousand:","};function kRe({item:e,field:t}){let o=t.getValue({item:e});if(o==null)return"";if(o=Number(o),!Number.isFinite(o))return String(o);let r;t.type!=="integer"?r=Rue:r=t.format;let{separatorThousand:n}=r,i=Math.trunc(o);return n?String(i).replace(/\B(?=(\d{3})+(?!\d))/g,n):String(i)}function vRe(e,t){let o=t.getValue({item:e});return![void 0,"",null].includes(o)&&!Number.isInteger(o)?(0,Pue.__)("Value must be an integer."):null}var Oue={type:"integer",render:co,Edit:"integer",sort:kk,enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[Jt,eo,Hd,Gd,Wd,$d,tn],validOperators:[Jt,eo,Hd,Gd,Wd,$d,tn,Ut,Ht,Ir,Pr],format:Rue,getValueFormatted:kRe,validate:{required:uo,min:hR,max:gR,elements:_t,custom:vRe}};var Aue=l(N(),1);var Lue={separatorThousand:",",separatorDecimal:".",decimals:2};function yRe({item:e,field:t}){let o=t.getValue({item:e});if(o==null)return"";if(o=Number(o),!Number.isFinite(o))return String(o);let r;t.type!=="number"?r=Lue:r=t.format;let{separatorThousand:n,separatorDecimal:i,decimals:s}=r,a=o.toFixed(s),[c,u]=a.split("."),d=n?c.replace(/\B(?=(\d{3})+(?!\d))/g,n):c;return s===0?d:d+i+u}function SRe(e){return e===""||e===void 0||e===null}function _Re(e,t){let o=t.getValue({item:e});return!SRe(o)&&!Number.isFinite(o)?(0,Aue.__)("Value must be a number."):null}var Nue={type:"number",render:co,Edit:"number",sort:kk,enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[Jt,eo,Hd,Gd,Wd,$d,tn],validOperators:[Jt,eo,Hd,Gd,Wd,$d,tn,Ut,Ht,Ir,Pr],format:Lue,getValueFormatted:yRe,validate:{required:uo,min:hR,max:gR,elements:_t,custom:_Re}};var Mue={type:"text",render:co,Edit:"text",sort:nl,enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[Ut,Ht],validOperators:[Jt,eo,Ja,el,tl,Ut,Ht,Ir,Pr],format:{},getValueFormatted:nn,validate:{required:uo,pattern:al,minLength:il,maxLength:sl,elements:_t}};var gp=l(pc(),1);var Due={datetime:(0,gp.getSettings)().formats.datetime,weekStartsOn:(0,gp.getSettings)().l10n.startOfWeek};function xRe({item:e,field:t}){let o=t.getValue({item:e});if(["",void 0,null].includes(o))return"";let r;return t.type!=="datetime"?r=Due:r=t.format,(0,gp.dateI18n)(r.datetime,(0,gp.getDate)(o))}var wRe=(e,t,o)=>{let r=new Date(e).getTime(),n=new Date(t).getTime();return o==="asc"?r-n:n-r},Vue={type:"datetime",render:co,Edit:"datetime",sort:wRe,enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[Xd,Qd,Kd,Yd,qd,Zd,on,Rn],validOperators:[Xd,Qd,Kd,Yd,qd,Zd,on,Rn],format:Due,getValueFormatted:xRe,validate:{required:uo,elements:_t}};var bp=l(pc(),1);var Fue={date:(0,bp.getSettings)().formats.date,weekStartsOn:(0,bp.getSettings)().l10n.startOfWeek};function CRe({item:e,field:t}){let o=t.getValue({item:e});if(["",void 0,null].includes(o))return"";let r;return t.type!=="date"?r=Fue:r=t.format,(0,bp.dateI18n)(r.date,(0,bp.getDate)(o))}var BRe=(e,t,o)=>{let r=new Date(e).getTime(),n=new Date(t).getTime();return o==="asc"?r-n:n-r},zue={type:"date",render:co,Edit:"date",sort:BRe,enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[Xd,Qd,Kd,Yd,qd,Zd,on,Rn,tn],validOperators:[Xd,Qd,Kd,Yd,qd,Zd,on,Rn,tn],format:Fue,getValueFormatted:CRe,validate:{required:uo,elements:_t}};var bR=l(N(),1);function jue(e,t){return t.getValue({item:e})===!0}function ERe({item:e,field:t}){let o=t.getValue({item:e});return o===!0?(0,bR.__)("True"):o===!1?(0,bR.__)("False"):""}function TRe(e,t){let o=t.getValue({item:e});return![void 0,"",null].includes(o)&&![!0,!1].includes(o)?(0,bR.__)("Value must be true, false, or undefined"):null}var IRe=(e,t,o)=>{let r=!!e;return r===!!t?0:o==="asc"?r?1:-1:r?-1:1},Uue={type:"boolean",render:co,Edit:"checkbox",sort:IRe,validate:{required:jue,elements:_t,custom:TRe},enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[Jt,eo],validOperators:[Jt,eo],format:{},getValueFormatted:ERe};var Hue={type:"media",render:()=>null,Edit:null,sort:()=>0,enableSorting:!1,enableGlobalSearch:!1,defaultOperators:[],validOperators:[],format:{},getValueFormatted:nn,validate:{}};var Q4=l(N(),1);function Gue(e,t){let o=t.getValue({item:e});return Array.isArray(o)&&o.length>0&&o.every(r=>![void 0,"",null].includes(r))}function Wue({item:e,field:t}){let o=t.getValue({item:e});return(Array.isArray(o)?o:[]).join(", ")}function PRe({item:e,field:t}){return Wue({item:e,field:t})}function RRe(e,t){let o=t.getValue({item:e});return![void 0,"",null].includes(o)&&!Array.isArray(o)?(0,Q4.__)("Value must be an array."):o.every(r=>typeof r=="string")?null:(0,Q4.__)("Every value must be a string.")}var ORe=(e,t,o)=>{let r=Array.isArray(e)?e:[],n=Array.isArray(t)?t:[];if(r.length!==n.length)return o==="asc"?r.length-n.length:n.length-r.length;let i=r.join(","),s=n.join(",");return o==="asc"?i.localeCompare(s):s.localeCompare(i)},$ue={type:"array",render:PRe,Edit:"array",sort:ORe,enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[Ut,Ht],validOperators:[Ut,Ht,Ir,Pr],format:{},getValueFormatted:Wue,validate:{required:Gue,elements:_t,custom:RRe}};function ARe({item:e,field:t}){return t.getValue({item:e})?"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022":""}var Kue={type:"password",render:co,Edit:"password",sort:()=>0,enableSorting:!1,enableGlobalSearch:!1,defaultOperators:[],validOperators:[],format:{},getValueFormatted:ARe,validate:{required:uo,pattern:al,minLength:il,maxLength:sl,elements:_t}};var Yue={type:"telephone",render:co,Edit:"telephone",sort:nl,enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[Ut,Ht],validOperators:[Jt,eo,Ja,el,tl,Ut,Ht,Ir,Pr],format:{},getValueFormatted:nn,validate:{required:uo,pattern:al,minLength:il,maxLength:sl,elements:_t}};var que=l(N(),1);var vk=l(w(),1);function LRe({item:e,field:t}){if(t.hasElements)return(0,vk.jsx)(pR,{item:e,field:t});let o=nn({item:e,field:t});return!o||!Bt(o).isValid()?o:(0,vk.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,vk.jsx)("div",{style:{width:"16px",height:"16px",borderRadius:"50%",backgroundColor:o,border:"1px solid #ddd",flexShrink:0}}),(0,vk.jsx)("span",{children:o})]})}function NRe(e,t){let o=t.getValue({item:e});return![void 0,"",null].includes(o)&&!Bt(o).isValid()?(0,que.__)("Value must be a valid color."):null}var MRe=(e,t,o)=>{let r=Bt(e),n=Bt(t);if(!r.isValid()&&!n.isValid())return 0;if(!r.isValid())return o==="asc"?1:-1;if(!n.isValid())return o==="asc"?-1:1;let i=r.toHsl(),s=n.toHsl();return i.h!==s.h?o==="asc"?i.h-s.h:s.h-i.h:i.s!==s.s?o==="asc"?i.s-s.s:s.s-i.s:o==="asc"?i.l-s.l:s.l-i.l},Zue={type:"color",render:LRe,Edit:"color",sort:MRe,enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[Ut,Ht],validOperators:[Jt,eo,Ut,Ht],format:{},getValueFormatted:nn,validate:{required:uo,elements:_t,custom:NRe}};var Xue={type:"url",render:co,Edit:"url",sort:nl,enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[Ut,Ht],validOperators:[Jt,eo,Ja,el,tl,Ut,Ht,Ir,Pr],format:{},getValueFormatted:nn,validate:{required:uo,pattern:al,minLength:il,maxLength:sl,elements:_t}};var DRe=(e,t,o)=>typeof e=="number"&&typeof t=="number"?kk(e,t,o):nl(e,t,o),Que={render:co,Edit:null,sort:DRe,enableSorting:!0,enableGlobalSearch:!1,defaultOperators:[Jt,eo],validOperators:Lce(),format:{},getValueFormatted:nn,validate:{required:uo,elements:_t}};function Jue(e,t){let o;e.isValid?.required===!0&&t.validate.required!==void 0&&(o={constraint:!0,validate:t.validate.required});let r;(e.isValid?.elements===!0||e.isValid?.elements===void 0&&(e.elements||e.getElements))&&t.validate.elements!==void 0&&(r={constraint:!0,validate:t.validate.elements});let n;typeof e.isValid?.min=="number"&&t.validate.min!==void 0&&(n={constraint:e.isValid.min,validate:t.validate.min});let i;typeof e.isValid?.max=="number"&&t.validate.max!==void 0&&(i={constraint:e.isValid.max,validate:t.validate.max});let s;typeof e.isValid?.minLength=="number"&&t.validate.minLength!==void 0&&(s={constraint:e.isValid.minLength,validate:t.validate.minLength});let a;typeof e.isValid?.maxLength=="number"&&t.validate.maxLength!==void 0&&(a={constraint:e.isValid.maxLength,validate:t.validate.maxLength});let c;e.isValid?.pattern!==void 0&&t.validate.pattern!==void 0&&(c={constraint:e.isValid?.pattern,validate:t.validate.pattern});let u=e.isValid?.custom??t.validate.custom;return{required:o,elements:r,min:n,max:i,minLength:s,maxLength:a,pattern:c,custom:u}}function ede(e){return e.validOperators.reduce((t,o)=>{let r=Ace(o);return r?.filter&&(t[o]=r.filter),t},{})}function VRe(e,t){return{...t.format,...e.format}}var tde=VRe;function FRe(e){let t=[Iue,Oue,Nue,Mue,Vue,zue,Uue,Hue,$ue,Kue,Yue,Zue,Xue].find(o=>o?.type===e);return t||Que}function A_(e){return e.map(t=>{let o=FRe(t.type),r=t.getValue||Cue(t.id),n=function(i,s,a){let c=r({item:i}),u=r({item:s});return t.sort?t.sort(c,u,a):o.sort(c,u,a)};return{id:t.id,label:t.label||t.id,header:t.header||t.label||t.id,description:t.description,placeholder:t.placeholder,getValue:r,setValue:t.setValue||Bue(t.id),elements:t.elements,getElements:t.getElements,hasElements:fR(t),isVisible:t.isVisible,enableHiding:t.enableHiding??!0,readOnly:t.readOnly??!1,type:o.type,render:t.render??o.render,Edit:xue(t,o.Edit),sort:n,enableSorting:t.enableSorting??o.enableSorting,enableGlobalSearch:t.enableGlobalSearch??o.enableGlobalSearch,isValid:Jue(t,o),filterBy:wue(t,o.defaultOperators,o.validOperators),filter:ede(o),format:tde(t,o),getValueFormatted:t.getValueFormatted??o.getValueFormatted}})}var sz=l(R(),1);var ode=l(R(),1),rde=l(w(),1),J4=(0,ode.createContext)({fields:[]});J4.displayName="DataFormContext";function nde({fields:e,children:t}){return(0,rde.jsx)(J4.Provider,{value:{fields:e},children:t})}var us=J4;var ER=l(R(),1);var vR=l(R(),1),L_=l(A(),1);var Ar={type:"regular",labelPosition:"top"},zRe=e=>typeof e=="string"?[{id:e,visibility:"when-collapsed"}]:e.map(t=>typeof t=="string"?{id:t,visibility:"when-collapsed"}:{id:t.id,visibility:t.visibility});function ide(e){let t=Ar;if(e?.type==="regular")t={type:"regular",labelPosition:e?.labelPosition??"top"};else if(e?.type==="panel"){let o=e.summary??[],r=Array.isArray(o)?o:[o];t={type:"panel",labelPosition:e?.labelPosition??"side",openAs:e?.openAs??"dropdown",summary:r,editVisibility:e?.editVisibility??"on-hover"}}else if(e?.type==="card")if(e.withHeader===!1)t={type:"card",withHeader:!1,isOpened:!0,summary:[],isCollapsible:!1};else{let o=e.summary??[];t={type:"card",withHeader:!0,isOpened:typeof e.isOpened=="boolean"?e.isOpened:!0,summary:zRe(o),isCollapsible:e.isCollapsible===void 0?!0:e.isCollapsible}}else e?.type==="row"?t={type:"row",alignment:e?.alignment??"center",styles:e?.styles??{}}:e?.type==="details"&&(t={type:"details",summary:e?.summary??""});return t}function sde(e){let t=ide(e?.layout),o=(e.fields??[]).map(r=>{if(typeof r=="string")return{id:r,layout:t};let n=r.layout?ide(r.layout):t;return{id:r.id,layout:n,...!!r.label&&{label:r.label},...!!r.description&&{description:r.description},..."children"in r&&Array.isArray(r.children)&&{children:sde({fields:r.children,layout:Ar}).fields}}});return{layout:t,fields:o}}var kR=sde;var Gt=l(w(),1);function jRe({title:e}){return(0,Gt.jsx)(De,{direction:"column",className:"dataforms-layouts-regular__header",gap:"lg",children:(0,Gt.jsx)(De,{direction:"row",align:"center",children:(0,Gt.jsx)(L_.__experimentalHeading,{level:2,size:13,children:e})})})}function ade({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{fields:s}=(0,vR.useContext)(us),a=t.layout,c=(0,vR.useMemo)(()=>({layout:Ar,fields:t.children?t.children:[]}),[t]);if(t.children)return(0,Gt.jsxs)(Gt.Fragment,{children:[!r&&t.label&&(0,Gt.jsx)(jRe,{title:t.label}),(0,Gt.jsx)(Ln,{data:e,form:c,onChange:o,validity:i?.children})]});let u=a.labelPosition,d=s.find(f=>f.id===t.id);return!d||!d.Edit?null:u==="side"?(0,Gt.jsxs)(De,{direction:"row",className:"dataforms-layouts-regular__field",gap:"sm",children:[(0,Gt.jsx)("div",{className:V("dataforms-layouts-regular__field-label",`dataforms-layouts-regular__field-label--label-position-${u}`),children:(0,Gt.jsx)(L_.BaseControl.VisualLabel,{children:d.label})}),(0,Gt.jsx)("div",{className:"dataforms-layouts-regular__field-control",children:d.readOnly===!0?(0,Gt.jsx)(d.render,{item:e,field:d}):(0,Gt.jsx)(d.Edit,{data:e,field:d,onChange:o,hideLabelFromVision:!0,markWhenOptional:n,validity:i},d.id)})]}):(0,Gt.jsx)("div",{className:"dataforms-layouts-regular__field",children:d.readOnly===!0?(0,Gt.jsx)(Gt.Fragment,{children:(0,Gt.jsxs)(Gt.Fragment,{children:[!r&&u!=="none"&&(0,Gt.jsx)(L_.BaseControl.VisualLabel,{children:d.label}),(0,Gt.jsx)(d.render,{item:e,field:d})]})}):(0,Gt.jsx)(d.Edit,{data:e,field:d,onChange:o,hideLabelFromVision:u==="none"?!0:r,markWhenOptional:n,validity:i})})}var tz=l(MV(),1),kp=l(A(),1),oz=l(N(),1),ia=l(R(),1),xR=l(Z(),1);var Sk=l(A(),1),yk=l(N(),1);var fde=l(Z(),1),mde=l(R(),1);function URe(e,t){return V("dataforms-layouts-panel__field-label",`dataforms-layouts-panel__field-label--label-position-${e}`,{"has-error":t})}var lde=URe;var yR=l(A(),1);var N_=l(w(),1);function HRe(e,t,o){return e?(0,N_.jsx)(yR.Tooltip,{text:t,placement:"top",children:(0,N_.jsxs)("span",{className:"dataforms-layouts-panel__field-label-error-content",children:[(0,N_.jsx)(yR.Icon,{icon:Pf,size:16}),o]})}):o}var cde=HRe;function ude(e){if(!e)return;let t=Object.keys(e).filter(o=>o!=="children");for(let o of t){let r=e[o];if(r!==void 0&&r.type==="invalid")return r.message?r.message:o==="required"?"A required field is empty":"Unidentified validation error"}if(e.children)for(let o of Object.values(e.children)){let r=ude(o);if(r)return r}}var dde=ude;var gi=l(w(),1);function M_({data:e,field:t,fieldLabel:o,summaryFields:r,validity:n,touched:i,disabled:s,onClick:a,"aria-expanded":c}){let{labelPosition:u,editVisibility:d}=t.layout,f=dde(n),m=i&&!!f,h=lde(u,m),p=cde(m,f,o),g=V("dataforms-layouts-panel__field-trigger",`dataforms-layouts-panel__field-trigger--label-${u}`,{"is-disabled":s,"dataforms-layouts-panel__field-trigger--edit-always":d==="always"}),b=(0,fde.useInstanceId)(M_,"dataforms-layouts-panel__field-control"),v=m?(0,yk.sprintf)((0,yk._x)("Edit %s (has errors)","field"),o||""):(0,yk.sprintf)((0,yk._x)("Edit %s","field"),o||""),k=(0,mde.useRef)(null);return(0,gi.jsxs)("div",{ref:k,className:g,onClick:s?void 0:()=>{let x=k.current?.ownerDocument.defaultView?.getSelection();x&&x.toString().length>0||a()},onKeyDown:s?void 0:x=>{x.target===x.currentTarget&&(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),a())},children:[u!=="none"&&(0,gi.jsx)("span",{className:h,children:p}),u==="none"&&m&&(0,gi.jsx)(Sk.Tooltip,{text:f,placement:"top",children:(0,gi.jsx)("span",{className:"dataforms-layouts-panel__field-label-error-content",children:(0,gi.jsx)(Sk.Icon,{icon:Pf,size:16})})}),(0,gi.jsx)("span",{id:`${b}`,className:"dataforms-layouts-panel__field-control",children:r.length>1?(0,gi.jsx)("span",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",width:"100%",gap:"2px"},children:r.map(x=>(0,gi.jsx)("span",{style:{width:"100%"},children:(0,gi.jsx)(x.render,{item:e,field:x})},x.id))}):r.map(x=>(0,gi.jsx)(x.render,{item:e,field:x},x.id))}),!s&&(0,gi.jsx)(Sk.Button,{className:"dataforms-layouts-panel__field-trigger-icon",label:v,showTooltip:!1,icon:Of,size:"small","aria-expanded":c,"aria-haspopup":"dialog","aria-describedby":`${b}`})]})}var pde=l(MV(),1),ez=l(yf(),1),ll=l(R(),1),sn=l(N(),1);function hde(e){return e?Object.values(e).every(t=>Object.entries(t).every(([o,r])=>o==="children"&&r&&typeof r=="object"?hde(r):r.type!=="invalid"&&r.type!=="validating")):!0}function GRe(e,t){let o=kR(e);if(o.fields.length===0)return[];let r=new Map;t.forEach(s=>{r.set(s.id,s)});function n(s){if("children"in s&&Array.isArray(s.children)){let u=s.children.map(n).filter(f=>f!==null);if(u.length===0)return null;let d=r.get(s.id);if(d){let[f]=A_([d]);return{id:s.id,children:u,field:f}}return{id:s.id,children:u}}let a=r.get(s.id);if(!a)return null;let[c]=A_([a]);return{id:s.id,children:[],field:c}}return o.fields.map(n).filter(s=>s!==null)}function _k(e,t,o){if(e||(e={}),o.length===0)return e;let r={...e},n=r;for(let s=0;s<o.length-1;s++){let a=o[s];n[a]||(n[a]={}),n[a]={...n[a]},n=n[a]}let i=o[o.length-1];return n[i]={...n[i]||{},...t},r}function gde(e,t,o){if(!e||t.length===0)return e;let r={...e},n=r;for(let a=0;a<t.length-1;a++){let c=t[a];if(!n[c])return e;n[c]={...n[c]},n=n[c]}let i=t[t.length-1];if(!n[i])return e;let s={...n[i]};if(delete s[o],Object.keys(s).length===0?delete n[i]:n[i]=s,Object.keys(r).length!==0)return r}function WRe(e,t,o){let{elementsCounterRef:r,setFormValidity:n,path:i,item:s}=o,a=(r.current[t.id]||0)+1;r.current[t.id]=a,e.then(c=>{if(a===r.current[t.id]){if(!Array.isArray(c)){n(u=>_k(u,{elements:{type:"invalid",message:(0,sn.__)("Could not validate elements.")}},[...i,t.id]));return}t.field?.isValid.elements&&!t.field.isValid.elements.validate(s,{...t.field,elements:c})?n(u=>_k(u,{elements:{type:"invalid",message:(0,sn.__)("Value must be one of the elements.")}},[...i,t.id])):n(u=>gde(u,[...i,t.id],"elements"))}}).catch(c=>{if(a!==r.current[t.id])return;let u;c instanceof Error?u=c.message:u=String(c)||(0,sn.__)("Unknown error when running elements validation asynchronously."),n(d=>_k(d,{elements:{type:"invalid",message:u}},[...i,t.id]))})}function $Re(e,t,o){let{customCounterRef:r,setFormValidity:n,path:i}=o,s=(r.current[t.id]||0)+1;r.current[t.id]=s,e.then(a=>{if(s===r.current[t.id]){if(a===null){n(c=>gde(c,[...i,t.id],"custom"));return}if(typeof a=="string"){n(c=>_k(c,{custom:{type:"invalid",message:a}},[...i,t.id]));return}n(c=>_k(c,{custom:{type:"invalid",message:(0,sn.__)("Validation could not be processed.")}},[...i,t.id]))}}).catch(a=>{if(s!==r.current[t.id])return;let c;a instanceof Error?c=a.message:c=String(a)||(0,sn.__)("Unknown error when running custom validation asynchronously."),n(u=>_k(u,{custom:{type:"invalid",message:c}},[...i,t.id]))})}function bde(e,t,o){if(t.field?.isValid.required&&!t.field.isValid.required.validate(e,t.field))return{required:{type:"invalid"}};if(t.field?.isValid.pattern&&!t.field.isValid.pattern.validate(e,t.field))return{pattern:{type:"invalid",message:(0,sn.__)("Value does not match the required pattern.")}};if(t.field?.isValid.min&&!t.field.isValid.min.validate(e,t.field))return{min:{type:"invalid",message:(0,sn.__)("Value is below the minimum.")}};if(t.field?.isValid.max&&!t.field.isValid.max.validate(e,t.field))return{max:{type:"invalid",message:(0,sn.__)("Value is above the maximum.")}};if(t.field?.isValid.minLength&&!t.field.isValid.minLength.validate(e,t.field))return{minLength:{type:"invalid",message:(0,sn.__)("Value is too short.")}};if(t.field?.isValid.maxLength&&!t.field.isValid.maxLength.validate(e,t.field))return{maxLength:{type:"invalid",message:(0,sn.__)("Value is too long.")}};if(t.field?.isValid.elements&&t.field.hasElements&&!t.field.getElements&&Array.isArray(t.field.elements)&&!t.field.isValid.elements.validate(e,t.field))return{elements:{type:"invalid",message:(0,sn.__)("Value must be one of the elements.")}};let r;if(t.field&&t.field.isValid.custom)try{let i=t.field.getValue({item:e});r=t.field.isValid.custom((0,pde.default)(e,t.field.setValue({item:e,value:i})),t.field)}catch(i){let s;return i instanceof Error?s=i.message:s=String(i)||(0,sn.__)("Unknown error when running custom validation."),{custom:{type:"invalid",message:s}}}if(typeof r=="string")return{custom:{type:"invalid",message:r}};let n={};if(t.field&&t.field.isValid.elements&&t.field.hasElements&&typeof t.field.getElements=="function"&&(WRe(t.field.getElements(),t,o),n.elements={type:"validating",message:(0,sn.__)("Validating\u2026")}),r instanceof Promise&&($Re(r,t,o),n.custom={type:"validating",message:(0,sn.__)("Validating\u2026")}),Object.keys(n).length>0)return n;if(t.children.length>0){let i={};t.children.forEach(a=>{i[a.id]=bde(e,a,{...o,path:[...o.path,t.id,"children"]})});let s={};return Object.entries(i).forEach(([a,c])=>{c!==void 0&&(s[a]=c)}),Object.keys(s).length===0?void 0:{children:s}}}function kde(e,t){let o=e?.field?.getValue({item:t});if(e.children.length===0)return o;let r=e.children.map(n=>kde(n,t));return r?{value:o,children:r}:o}function KRe(e,t,o){let[r,n]=(0,ll.useState)(),i=(0,ll.useRef)({}),s=(0,ll.useRef)({}),a=(0,ll.useRef)({}),c=(0,ll.useCallback)(()=>{let u={customCounterRef:i,elementsCounterRef:s,setFormValidity:n,path:[],item:e},d=GRe(o,t);if(d.length===0){n(void 0);return}let f={},m=[];d.forEach(h=>{let p=kde(h,e);if(a.current.hasOwnProperty(h.id)&&(0,ez.default)(a.current[h.id],p)){m.push(h.id);return}a.current[h.id]=p;let g=bde(e,h,u);g!==void 0&&(f[h.id]=g)}),n(h=>{let p={...h,...f},g=[...m,...Object.keys(f)];return Object.keys(p).forEach(v=>{p&&!g.includes(v)&&delete p[v]}),Object.keys(p).length===0&&(p=void 0),(0,ez.default)(h,p)?h:p})},[e,t,o]);return(0,ll.useEffect)(()=>{c()},[c]),{validity:r,isValid:hde(r)}}var vde=KRe;var yde=l(R(),1);function of(e,t){(0,yde.useEffect)(()=>{t&&e.current&&e.current.querySelectorAll("input, textarea, select").forEach(r=>{r.reportValidity()})},[t,e])}var Sde=l(R(),1);function YRe(e){return Array.isArray(e)?e.map(t=>typeof t=="string"?t:t.id):[]}var SR=(e,t)=>Array.isArray(e)&&e.length>0?YRe(e).map(r=>t.find(n=>n.id===r)).filter(r=>r!==void 0):[];var qRe=(e,t)=>{let o=t.find(r=>r.id===e.id);return o||t.find(r=>{if(e.children){let n=e.children.filter(i=>!i.children);return n.length===0?!1:r.id===n[0].id}return r.id===e.id})};function ZRe(e){let{fields:t}=(0,Sde.useContext)(us),o=e.layout,r=SR(o.summary,t),n=qRe(e,t),i=e.children?e.label:n?.label;return r.length===0?{summaryFields:n?[n]:[],fieldDefinition:n,fieldLabel:i}:{summaryFields:r,fieldDefinition:n,fieldLabel:i}}var _R=ZRe;var an=l(w(),1);function XRe({data:e,field:t,onChange:o,fieldLabel:r,onClose:n,touched:i}){let{fields:s}=(0,ia.useContext)(us),[a,c]=(0,ia.useState)({}),u=(0,ia.useMemo)(()=>(0,tz.default)(e,a,{arrayMerge:(k,y)=>y}),[e,a]),d=(0,ia.useMemo)(()=>({layout:Ar,fields:t.children?t.children:[{id:t.id,layout:Ar}]}),[t]),f=s.map(k=>({...k,Edit:k.Edit===null?void 0:k.Edit,isValid:{required:k.isValid.required?.constraint,elements:k.isValid.elements?.constraint,min:k.isValid.min?.constraint,max:k.isValid.max?.constraint,pattern:k.isValid.pattern?.constraint,minLength:k.isValid.minLength?.constraint,maxLength:k.isValid.maxLength?.constraint}})),{validity:m}=vde(u,f,d),h=()=>{o(a),n()},p=k=>{c(y=>(0,tz.default)(y,k,{arrayMerge:(S,x)=>x}))},g=(0,xR.useFocusOnMount)("firstInputElement"),b=(0,ia.useRef)(null),v=(0,xR.useMergeRefs)([g,b]);return of(b,i),(0,an.jsxs)(kp.Modal,{className:"dataforms-layouts-panel__modal",onRequestClose:n,isFullScreen:!1,title:r,size:"medium",children:[(0,an.jsx)("div",{ref:v,children:(0,an.jsx)(Ln,{data:u,form:d,onChange:p,validity:m,children:(k,y,S,x)=>(0,an.jsx)(k,{data:u,field:y,onChange:p,hideLabelFromVision:d.fields.length<2,markWhenOptional:x,validity:S},y.id)})}),(0,an.jsxs)(De,{direction:"row",className:"dataforms-layouts-panel__modal-footer",gap:"md",children:[(0,an.jsx)(kp.__experimentalSpacer,{style:{flex:1}}),(0,an.jsx)(kp.Button,{variant:"tertiary",onClick:n,__next40pxDefaultSize:!0,children:(0,oz.__)("Cancel")}),(0,an.jsx)(kp.Button,{variant:"primary",onClick:h,__next40pxDefaultSize:!0,children:(0,oz.__)("Apply")})]})]})}function QRe({data:e,field:t,onChange:o,validity:r}){let[n,i]=(0,ia.useState)(!1),[s,a]=(0,ia.useState)(!1),{fieldDefinition:c,fieldLabel:u,summaryFields:d}=_R(t);if(!c)return null;let f=()=>{a(!1),i(!0)};return(0,an.jsxs)(an.Fragment,{children:[(0,an.jsx)(M_,{data:e,field:t,fieldLabel:u,summaryFields:d,validity:r,touched:n,disabled:c.readOnly===!0,onClick:()=>a(!0),"aria-expanded":s}),s&&(0,an.jsx)(XRe,{data:e,field:t,onChange:o,fieldLabel:u??"",onClose:f,touched:n})]})}var _de=QRe;var rf=l(A(),1),xde=l(N(),1),Rc=l(R(),1);var wde=l(Z(),1);var Lr=l(w(),1);function JRe({title:e,onClose:t}){return(0,Lr.jsx)(De,{direction:"column",className:"dataforms-layouts-panel__dropdown-header",gap:"lg",children:(0,Lr.jsxs)(De,{direction:"row",gap:"sm",align:"center",children:[e&&(0,Lr.jsx)(rf.__experimentalHeading,{level:2,size:13,children:e}),(0,Lr.jsx)(rf.__experimentalSpacer,{style:{flex:1}}),t&&(0,Lr.jsx)(rf.Button,{label:(0,xde.__)("Close"),icon:wf,onClick:t,size:"small"})]})})}function eOe({touched:e,children:t}){let o=(0,Rc.useRef)(null);return of(o,e),(0,Lr.jsx)("div",{ref:o,children:t})}function tOe({data:e,field:t,onChange:o,validity:r}){let[n,i]=(0,Rc.useState)(!1),[s,a]=(0,Rc.useState)(null),c=(0,Rc.useMemo)(()=>({anchor:s,placement:"left-start",offset:36,shift:!0}),[s]),[u,d]=(0,wde.__experimentalUseDialog)({focusOnMount:"firstInputElement"}),f=(0,Rc.useMemo)(()=>({layout:Ar,fields:t.children?t.children:[{id:t.id,layout:Ar}]}),[t]),m=(0,Rc.useMemo)(()=>{if(r!==void 0)return t.children?r?.children:{[t.id]:r}},[r,t]),{fieldDefinition:h,fieldLabel:p,summaryFields:g}=_R(t);return h?(0,Lr.jsx)("div",{ref:a,className:"dataforms-layouts-panel__field-dropdown-anchor",children:(0,Lr.jsx)(rf.Dropdown,{contentClassName:"dataforms-layouts-panel__field-dropdown",popoverProps:c,focusOnMount:!1,onToggle:b=>{b||i(!0)},renderToggle:({isOpen:b,onToggle:v})=>(0,Lr.jsx)(M_,{data:e,field:t,fieldLabel:p,summaryFields:g,validity:r,touched:n,disabled:h.readOnly===!0,onClick:v,"aria-expanded":b}),renderContent:({onClose:b})=>(0,Lr.jsx)(eOe,{touched:n,children:(0,Lr.jsxs)("div",{ref:u,...d,children:[(0,Lr.jsx)(JRe,{title:p,onClose:b}),(0,Lr.jsx)(Ln,{data:e,form:f,onChange:o,validity:m,children:(v,k,y,S)=>(0,Lr.jsx)(v,{data:e,field:k,onChange:o,hideLabelFromVision:(f?.fields??[]).length<2,markWhenOptional:S,validity:y},k.id)})]})})})}):null}var Cde=tOe;var rz=l(w(),1);function Bde({data:e,field:t,onChange:o,validity:r}){return t.layout.openAs==="modal"?(0,rz.jsx)(_de,{data:e,field:t,onChange:o,validity:r}):(0,rz.jsx)(Cde,{data:e,field:t,onChange:o,validity:r})}var nf=l(A(),1),Ide=l(Z(),1),Nn=l(R(),1),nz=l(N(),1);var wR=l(N(),1),Ede=l(w(),1);function Tde(e){if(!e)return 0;let t=0,o=Object.keys(e).filter(r=>r!=="children");for(let r of o)e[r]?.type==="invalid"&&t++;if(e.children)for(let r of Object.values(e.children))t+=Tde(r);return t}function CR({validity:e}){let t=Tde(e);return t===0?null:(0,Ede.jsx)(L4,{intent:"high",children:(0,wR.sprintf)((0,wR._n)("%d field needs attention","%d fields need attention",t),t)})}var vr=l(w(),1);function oOe(e,t,o){if(!t||Array.isArray(t)&&t.length===0)return!1;let n=(Array.isArray(t)?t:[t]).find(i=>typeof i=="string"?i===e.id:typeof i=="object"&&"id"in i?i.id===e.id:!1);return n?typeof n=="string"?!0:typeof n=="object"&&"visibility"in n?n.visibility==="always"||n.visibility==="when-collapsed"&&!o:!0:!1}function iz({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let{fields:s}=(0,Nn.useContext)(us),a=t.layout,c=(0,Nn.useRef)(null),u=(0,Ide.useInstanceId)(iz,"dataforms-layouts-card-card-body"),d=(0,Nn.useMemo)(()=>({layout:Ar,fields:t.children??[]}),[t]),{isOpened:f,isCollapsible:m}=a,[h,p]=(0,Nn.useState)(f),[g,b]=(0,Nn.useState)(!1);(0,Nn.useEffect)(()=>{p(f)},[f]);let v=(0,Nn.useCallback)(()=>{p(T=>(T&&b(!0),!T))},[]),k=m?h:!0,y=(0,Nn.useCallback)(()=>{b(!0)},[b]);of(c,k&&g);let x=SR(a.summary,s).filter(T=>oOe(T,a.summary,k)),C=g&&a.isCollapsible?(0,vr.jsx)(CR,{validity:i}):null,B={blockStart:"medium",blockEnd:"medium",inlineStart:"medium",inlineEnd:"medium"},I=t.label,P,E;if(t.children)P=!!I&&a.withHeader,E=(0,vr.jsxs)(vr.Fragment,{children:[t.description&&(0,vr.jsx)("div",{className:"dataforms-layouts-card__field-description",children:t.description}),(0,vr.jsx)(Ln,{data:e,form:d,onChange:o,validity:i?.children})]});else{let T=s.find(D=>D.id===t.id);if(!T||!T.Edit)return null;let O=vp("regular")?.component;if(!O)return null;I=T.label,P=!!I&&a.withHeader,E=(0,vr.jsx)(O,{data:e,field:t,onChange:o,hideLabelFromVision:r||P,markWhenOptional:n,validity:i})}let L={blockStart:P?"none":"medium",blockEnd:"medium",inlineStart:"medium",inlineEnd:"medium"};return(0,vr.jsxs)(nf.Card,{className:"dataforms-layouts-card__field",size:B,children:[P&&(0,vr.jsxs)(nf.CardHeader,{className:"dataforms-layouts-card__field-header",onClick:m?v:void 0,style:{cursor:m?"pointer":void 0},isBorderless:!0,children:[(0,vr.jsxs)("div",{style:{height:m?void 0:"40px",width:"100%",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,vr.jsx)("span",{className:"dataforms-layouts-card__field-header-label",children:I}),C,x.length>0&&a.withHeader&&(0,vr.jsx)("div",{className:"dataforms-layouts-card__field-summary",children:x.map(T=>(0,vr.jsx)(T.render,{item:e,field:T},T.id))})]}),m&&(0,vr.jsx)(nf.Button,{__next40pxDefaultSize:!0,variant:"tertiary",icon:k?xf:zn,"aria-expanded":k,"aria-controls":u,"aria-label":k?(0,nz.__)("Collapse"):(0,nz.__)("Expand")})]}),(k||!P)&&(0,vr.jsx)(nf.CardBody,{id:u,size:L,className:"dataforms-layouts-card__field-control",ref:c,onBlur:y,children:E})]})}var Pde=l(A(),1);var sr=l(w(),1);function rOe({title:e}){return(0,sr.jsx)(De,{direction:"column",className:"dataforms-layouts-row__header",gap:"lg",children:(0,sr.jsx)(De,{direction:"row",align:"center",children:(0,sr.jsx)(Pde.__experimentalHeading,{level:2,size:13,children:e})})})}var nOe=({children:e})=>(0,sr.jsx)(sr.Fragment,{children:e});function Rde({data:e,field:t,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:i}){let s=t.layout;if(t.children){let c={layout:Ar,fields:t.children};return(0,sr.jsxs)("div",{className:"dataforms-layouts-row__field",children:[!r&&t.label&&(0,sr.jsx)(rOe,{title:t.label}),(0,sr.jsx)(De,{direction:"row",align:s.alignment,gap:"lg",children:(0,sr.jsx)(Ln,{data:e,form:c,onChange:o,validity:i?.children,as:nOe,children:(u,d,f)=>(0,sr.jsx)("div",{className:"dataforms-layouts-row__field-control",style:s.styles[d.id],children:(0,sr.jsx)(u,{data:e,field:d,onChange:o,hideLabelFromVision:r,markWhenOptional:n,validity:f})},d.id)})})]})}let a=vp("regular")?.component;return a?(0,sr.jsx)(sr.Fragment,{children:(0,sr.jsx)("div",{className:"dataforms-layouts-row__field-control",children:(0,sr.jsx)(a,{data:e,field:t,onChange:o,markWhenOptional:n,validity:i})})}):null}var Mn=l(R(),1),Ode=l(N(),1);var Oc=l(w(),1);function Ade({data:e,field:t,onChange:o,validity:r}){let{fields:n}=(0,Mn.useContext)(us),i=(0,Mn.useRef)(null),s=(0,Mn.useRef)(null),[a,c]=(0,Mn.useState)(!1),[u,d]=(0,Mn.useState)(!1),f=(0,Mn.useMemo)(()=>({layout:Ar,fields:t.children??[]}),[t]);(0,Mn.useEffect)(()=>{let b=i.current;if(!b)return;let v=()=>{let k=b.open;k||c(!0),d(k)};return b.addEventListener("toggle",v),()=>{b.removeEventListener("toggle",v)}},[]),of(s,u&&a);let m=(0,Mn.useCallback)(()=>{c(!0)},[]);if(!t.children)return null;let h=t.layout.summary??"",p=h?n.find(b=>b.id===h):void 0,g;return p&&p.render?g=(0,Oc.jsx)(p.render,{item:e,field:p}):g=t.label||(0,Ode.__)("More details"),(0,Oc.jsxs)("details",{ref:i,className:"dataforms-layouts-details__details",children:[(0,Oc.jsx)("summary",{className:"dataforms-layouts-details__summary",children:(0,Oc.jsxs)(De,{direction:"row",align:"center",gap:"md",className:"dataforms-layouts-details__summary-content",children:[g,a&&(0,Oc.jsx)(CR,{validity:r})]})}),(0,Oc.jsx)("div",{ref:s,className:"dataforms-layouts-details__content",onBlur:m,children:(0,Oc.jsx)(Ln,{data:e,form:f,onChange:o,validity:r?.children})})]})}var yp=l(w(),1),iOe=[{type:"regular",component:ade,wrapper:({children:e})=>(0,yp.jsx)(De,{direction:"column",className:"dataforms-layouts__wrapper",gap:"lg",children:e})},{type:"panel",component:Bde,wrapper:({children:e})=>(0,yp.jsx)(De,{direction:"column",className:"dataforms-layouts__wrapper",gap:"md",children:e})},{type:"card",component:iz,wrapper:({children:e})=>(0,yp.jsx)(De,{direction:"column",className:"dataforms-layouts__wrapper",gap:"xl",children:e})},{type:"row",component:Rde,wrapper:({children:e,layout:t})=>(0,yp.jsx)(De,{direction:"column",className:"dataforms-layouts__wrapper",gap:"lg",children:(0,yp.jsx)("div",{className:"dataforms-layouts-row__field",children:(0,yp.jsx)(De,{direction:"row",gap:"lg",align:t.alignment,children:e})})})},{type:"details",component:Ade}];function vp(e){return iOe.find(t=>t.type===e)}var BR=l(w(),1),sOe=({children:e})=>(0,BR.jsx)(De,{direction:"column",className:"dataforms-layouts__wrapper",gap:"lg",children:e});function Ln({data:e,form:t,onChange:o,validity:r,children:n,as:i}){let{fields:s}=(0,ER.useContext)(us),a=(0,ER.useMemo)(()=>{let d=s.filter(m=>!!m.isValid?.required).length,f=s.length-d;return d>f},[s]);function c(d){return s.find(f=>f.id===d.id)}let u=i??vp(t.layout.type)?.wrapper??sOe;return(0,BR.jsx)(u,{layout:t.layout,children:t.fields.map(d=>{let f=vp(d.layout.type)?.component;if(!f)return null;let m=d.children?void 0:c(d);return m&&m.isVisible&&!m.isVisible(e)?null:n?n(f,d,r?.[d.id],a):(0,BR.jsx)(f,{data:e,field:d,onChange:o,markWhenOptional:a,validity:r?.[d.id]},d.id)})})}var az=l(w(),1);function D_({data:e,form:t,fields:o,onChange:r,validity:n}){let i=(0,sz.useMemo)(()=>kR(t),[t]),s=(0,sz.useMemo)(()=>A_(o),[o]);return t.fields?(0,az.jsx)(nde,{fields:s,children:(0,az.jsx)(Ln,{data:e,form:i,onChange:r,validity:n})}):null}var sf=l(R(),1),Kde=l(N(),1);var wk=l(A(),1);var lz=l(N(),1);var Lde=l(Z(),1);function xk({isControl:e}={isControl:!1}){return(0,Lde.useViewportMatch)("medium","<")?{}:{popoverProps:{placement:"left-start",offset:e?35:259}}}var TR=l(w(),1);function Nde({fields:e,visibleFields:t,onToggleField:o}){let{popoverProps:r}=xk();return!e||e.length===0?null:(0,TR.jsx)(wk.DropdownMenu,{icon:ks,label:(0,lz.__)("Options"),popoverProps:r,toggleProps:{size:"small"},children:({onClose:n})=>(0,TR.jsx)(wk.MenuGroup,{label:(0,lz.__)("Show / Hide"),children:e.map(i=>{let s=t.includes(i.id);return(0,TR.jsx)(wk.MenuItem,{isSelected:s,onClick:()=>{o(i.id),n()},role:"menuitemcheckbox",icon:s?gl:null,children:i.label},i.id)})})})}var IR=l(A(),1),Mde=l(Z(),1),Dde=l(F(),1),Ac=l(R(),1),Vde=l(dr(),1);var sa=l(w(),1),{useRichText:aOe}=M(Vde.privateApis);function Fde({data:e,field:t,hideLabelFromVision:o,onChange:r,config:n={}}){let i=(0,Dde.useRegistry)(),s=t.getValue({item:e}),a=t.config||{},{clientId:c}=n,[u,d]=(0,Ac.useState)({start:void 0,end:void 0}),[f,m]=(0,Ac.useState)(!1),h=(0,Ac.useRef)(),p=(0,Ac.useRef)(new Set),g=(0,Ac.useRef)(new Set),b=Cb({allowedFormats:a?.allowedFormats,disableFormats:a?.disableFormats});function v(){h.current?.focus()}let{value:k,getValue:y,onChange:S,ref:x,formatTypes:C}=aOe({value:s,onChange(P){r(t.setValue({item:e,value:P}))},selectionStart:u.start,selectionEnd:u.end,onSelectionChange:(P,E)=>d({start:P,end:E}),__unstableIsSelected:f,preserveWhiteSpace:!!a?.preserveWhiteSpace,placeholder:a?.placeholder,__unstableDisableFormats:a?.disableFormats,allowedFormats:b,withoutInteractiveFormatting:a?.withoutInteractiveFormatting,__unstableFormatTypeHandlerContext:(0,Ac.useMemo)(()=>({richTextIdentifier:t.id,blockClientId:c}),[t.id,c])}),{baseControlProps:B,controlProps:I}=(0,IR.useBaseControlProps)({hideLabelFromVision:o??t.hideLabelFromVision,label:t.label});return(0,sa.jsxs)(sa.Fragment,{children:[f&&(0,sa.jsx)(Pb.Provider,{value:g,children:(0,sa.jsx)(Ob.Provider,{value:p,children:(0,sa.jsx)("div",{children:(0,sa.jsx)(nP,{value:k,onChange:S,onFocus:v,formatTypes:C,forwardedRef:h,isVisible:!1})})})}),(0,sa.jsx)(IR.BaseControl,{...B,children:(0,sa.jsx)("div",{className:"block-editor-content-only-controls__rich-text",role:"textbox","aria-multiline":!a?.disableLineBreaks,ref:(0,Mde.useMergeRefs)([x,tP({registry:i,getValue:y,onChange:S,formatTypes:C,selectionChange:d,isSelected:f,disableFormats:a?.disableFormats,value:k,tagName:"div",disableLineBreaks:a?.disableLineBreaks,keyboardShortcuts:g,inputEvents:p}),h]),onFocus:()=>m(!0),onBlur:()=>m(!1),contentEditable:!0,...I})})]})}var Sp=l(A(),1),zde=l(F(),1),Ck=l(N(),1);var Co=l(w(),1);function lOe({data:e,field:t,attachment:o,config:r}){let{allowedTypes:n=[],multiple:i=!1}=r||{};if(i)return"todo multiple";if(o?.media_type==="image"||o?.poster)return(0,Co.jsx)("div",{className:"block-editor-content-only-controls__media-thumbnail",children:(0,Co.jsx)("img",{alt:"",width:24,height:24,src:o.media_type==="image"?o.source_url:o.poster})});if(n.length===1){let a=t.getValue({item:e})?.url;if(n[0]==="image"&&a)return(0,Co.jsx)("div",{className:"block-editor-content-only-controls__media-thumbnail",children:(0,Co.jsx)("img",{alt:"",width:24,height:24,src:a})});let c;if(n[0]==="image"?c=iv:n[0]==="video"?c=FN:n[0]==="audio"?c=HO:c=jp,c)return(0,Co.jsx)(Sp.Icon,{icon:c,size:24})}return(0,Co.jsx)(Sp.Icon,{icon:jp,size:24})}function jde({data:e,field:t,onChange:o,config:r={}}){let{popoverProps:n}=xk({isControl:!0}),i=t.getValue({item:e}),{allowedTypes:s=[],multiple:a=!1,useFeaturedImage:c=!1}=r,u=i?.id,d=i?.url,f=(0,zde.useSelect)(h=>{if(!u)return;let g=h(_).getSettings()[x0];if(g)return g(h,u)},[u]),m;if(s.length===1){let h=s[0];h==="image"?m=(0,Ck.__)("Choose an image\u2026"):h==="video"?m=(0,Ck.__)("Choose a video\u2026"):h==="application"?m=(0,Ck.__)("Choose a file\u2026"):m=(0,Ck.__)("Choose a media item\u2026")}else m=(0,Ck.__)("Choose a media item\u2026");return(0,Co.jsx)(Ds,{children:(0,Co.jsx)(_b,{className:"block-editor-content-only-controls__media-replace-flow",allowedTypes:s,mediaId:u,mediaURL:d,multiple:a,popoverProps:n,onReset:()=>{o(t.setValue({item:e,value:{}}))},...c&&{useFeaturedImage:!!i?.featuredImage,onToggleFeaturedImage:()=>{o(t.setValue({item:e,value:{featuredImage:!i?.featuredImage}}))}},onSelect:h=>{if(h.id&&h.url){let p={...h,mediaType:h.media_type};c&&(p.featuredImage=!1),o(t.setValue({item:e,value:p}))}},renderToggle:h=>(0,Co.jsx)(Sp.Button,{__next40pxDefaultSize:!0,className:"block-editor-content-only-controls__media",...h,children:(0,Co.jsxs)(Sp.__experimentalGrid,{rowGap:0,columnGap:8,templateColumns:"24px 1fr",className:"block-editor-content-only-controls__media-row",children:[d&&(0,Co.jsxs)(Co.Fragment,{children:[(0,Co.jsx)(lOe,{attachment:f,field:t,data:e,config:r}),(0,Co.jsx)("span",{className:"block-editor-content-only-controls__media-title",children:f?.title?.raw&&f?.title?.raw!==""?f?.title?.raw:d})]}),!d&&(0,Co.jsxs)(Co.Fragment,{children:[(0,Co.jsx)("span",{className:"block-editor-content-only-controls__media-placeholder",style:{width:"24px",height:"24px"}}),(0,Co.jsx)("span",{className:"block-editor-content-only-controls__media-title",children:m})]})]})})})})}var Lc=l(A(),1),RR=l(R(),1),Ude=l(N(),1);var Hde=l(dn(),1);var yr=l(w(),1),cz="noreferrer noopener",Gde="_blank",PR="nofollow";function cOe({rel:e="",url:t="",opensInNewTab:o,nofollow:r}){let n,i=e;if(o)n=Gde,i=i?.includes(cz)?i:i+` ${cz}`;else{let s=new RegExp(`\\b${cz}\\s*`,"g");i=i?.replace(s,"").trim()}if(r)i=i?.includes(PR)?i:(i+` ${PR}`).trim();else{let s=new RegExp(`\\b${PR}\\s*`,"g");i=i?.replace(s,"").trim()}return{url:(0,Hde.prependHTTP)(t),linkTarget:n,rel:i||void 0}}function Wde({data:e,field:t,onChange:o}){let[r,n]=(0,RR.useState)(!1),{popoverProps:i}=xk({isControl:!0}),s=t.getValue({item:e}),a=s?.url,c=s?.rel||"",d=s?.linkTarget===Gde,f=c===PR,m=(0,RR.useMemo)(()=>({url:a,opensInNewTab:d,nofollow:f}),[a,d,f]);return(0,yr.jsxs)(yr.Fragment,{children:[(0,yr.jsx)(Lc.Button,{__next40pxDefaultSize:!0,className:"block-editor-content-only-controls__link",onClick:()=>{n(!0)},children:(0,yr.jsxs)(Lc.__experimentalGrid,{rowGap:0,columnGap:8,templateColumns:"24px 1fr",className:"block-editor-content-only-controls__link-row",children:[a&&(0,yr.jsxs)(yr.Fragment,{children:[(0,yr.jsx)(Lc.Icon,{icon:fn,size:24}),(0,yr.jsx)("span",{className:"block-editor-content-only-controls__link-title",children:a})]}),!a&&(0,yr.jsxs)(yr.Fragment,{children:[(0,yr.jsx)(Lc.Icon,{icon:fn,size:24,style:{opacity:.3}}),(0,yr.jsx)("span",{className:"block-editor-content-only-controls__link-title",children:(0,Ude.__)("Link")})]})]})}),r&&(0,yr.jsx)(Lc.Popover,{onClose:()=>{n(!1)},...i??{},children:(0,yr.jsx)(Pd,{value:m,onChange:h=>{let p=cOe({rel:c,...h});o(t.setValue({item:e,value:p}))},onRemove:()=>{o(t.setValue({item:e,value:{}}))}})})]})}var Sr=l(w(),1),{fieldsKey:Yde,formKey:uz}=M(Bk.privateApis);function dz(e,t={}){return function(r){return(0,Sr.jsx)(e,{...r,config:t})}}function uOe({clientId:e,blockType:t,setAttributes:o,isCollapsed:r=!1}){let n=zr({clientId:e,context:"list-view"}),i=Tt(e),s=t?.[Yde],a=(0,sf.useContext)(xr),c=(0,$de.useSelect)(p=>{let g=p(_).getBlockAttributes(e);if(!g?.metadata?.bindings)return g;let{getBlockBindingsSource:b}=M(p(Bk.store));return Object.entries(g.metadata.bindings).reduce((v,[k,y])=>{let S=b(y.source);if(!S)return v;let x=S.getValues({select:p,context:a,bindings:{[k]:y}});return{...v,...x}},g)},[a,e]),u=(0,sf.useMemo)(()=>r?{...t?.[uz],fields:[t?.[uz]?.fields?.[0]]}:t?.[uz],[t,r]),[d,f]=(0,sf.useState)(u),m=(0,sf.useMemo)(()=>s?.length?s.map(p=>{let g={...p};return typeof p.Edit=="string"&&p.Edit==="rich-text"?g.Edit=dz(Fde,{clientId:e}):typeof p.Edit=="string"&&p.Edit==="link"?g.Edit=dz(Wde):typeof p.Edit=="object"&&p.Edit.control==="media"&&(g.Edit=dz(jde,{...p.Edit})),g}):[],[s,e]);if(!s?.length)return null;let h=p=>{f(g=>g.fields?.includes(p)?{...g,fields:g.fields.filter(b=>b!==p)}:{...g,fields:[...g.fields||[],p]})};return(0,Sr.jsxs)("div",{className:"block-editor-block-fields__container",children:[(0,Sr.jsx)("div",{className:"block-editor-block-fields__header",children:(0,Sr.jsxs)(OR.__experimentalHStack,{spacing:1,children:[r&&(0,Sr.jsxs)(Sr.Fragment,{children:[(0,Sr.jsx)(Ae,{className:"block-editor-block-fields__header-icon",icon:i?.icon}),(0,Sr.jsx)("h2",{className:"block-editor-block-fields__header-title",children:(0,Sr.jsx)(OR.__experimentalTruncate,{numberOfLines:1,children:n})}),(0,Sr.jsx)(Nde,{fields:m,visibleFields:d.fields,onToggleField:h})]}),!r&&(0,Sr.jsx)("h2",{className:"block-editor-block-fields__header-title",children:(0,Kde.__)("Content")})]})}),(0,Sr.jsx)(D_,{data:c,fields:m,form:d,onChange:o})]})}function dOe(e){return!!(window?.__experimentalContentOnlyInspectorFields&&(0,Bk.getBlockType)(e)?.[Yde])}function fOe(e){let{blockType:t,isSelectionWithinCurrentSection:o}=(0,sf.useContext)(ur);return(0,Sr.jsx)(Sm,{group:"content",children:(0,Sr.jsx)(uOe,{...e,blockType:t,isCollapsed:o})})}var qde={edit:fOe,hasSupport:dOe,attributeKeys:[],supportsPatternEditing:!0};var pz=l(ut(),1),Zde=l(A(),1),fz=l(N(),1),V_=l($(),1);var mz=l(w(),1);function mOe(e){return(0,V_.hasBlockSupport)(e,"customClassName",!0)&&(e.attributes={...e.attributes,className:{type:"string"}}),e}function pOe({className:e,setAttributes:t}){return ao()!=="default"?null:(0,mz.jsx)(fe,{group:"advanced",children:(0,mz.jsx)(Zde.TextControl,{__next40pxDefaultSize:!0,autoComplete:"off",label:(0,fz.__)("Additional CSS class(es)"),value:e||"",onChange:r=>{t({className:r!==""?r:void 0})},help:(0,fz.__)("Separate multiple classes with spaces.")})})}var hz={edit:pOe,addSaveProps:hOe,attributeKeys:["className"],hasSupport(e){return(0,V_.hasBlockSupport)(e,"customClassName",!0)}};function hOe(e,t,o){return(0,V_.hasBlockSupport)(t,"customClassName",!0)&&o.className&&(e.className=V(e.className,o.className)),e}function gOe(e,t,o,r){if(!(0,V_.hasBlockSupport)(e.name,"customClassName",!0)||r.length===1&&e.innerBlocks.length===t.length||r.length===1&&t.length>1||r.length>1&&t.length===1)return e;if(t[o]){let n=t[o]?.attributes.className;if(n&&e.attributes.className===void 0)return{...e,attributes:{...e.attributes,className:n}}}return e}(0,pz.addFilter)("blocks.registerBlockType","core/editor/custom-class-name/attribute",mOe);(0,pz.addFilter)("blocks.switchToBlockType.transformedBlock","core/customClassName/addTransforms",gOe);var Xde=l(ut(),1),F_=l($(),1);function bOe(e,t){return(0,F_.hasBlockSupport)(t,"className",!0)&&(typeof e.className=="string"?e.className=[...new Set([(0,F_.getBlockDefaultClassName)(t.name),...e.className.split(" ")])].join(" ").trim():e.className=(0,F_.getBlockDefaultClassName)(t.name)),e}(0,Xde.addFilter)("blocks.getSaveContent.extraProps","core/generated-class-name/save-props",bOe);var Ife=l(R(),1),Pfe=l(ut(),1),Dc=l($(),1),Rfe=l(Z(),1),Pk=l(Uv(),1);var xz=l($(),1),VR=l(R(),1),gfe=l(F(),1);var kOe=l($(),1);var vOe=l(w(),1),Qde="typography.lineHeight";var Jde=l(ut(),1),AR=l($(),1),efe=l(XE(),1),tfe=l(A(),1);var z_="typography.__experimentalFontFamily",{kebabCase:yOe}=M(tfe.privateApis);function SOe(e){return(0,AR.hasBlockSupport)(e,z_)&&(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}})),e}function ofe(e,t,o){if(!(0,AR.hasBlockSupport)(t,z_)||Ue(t,ds,"fontFamily")||!o?.fontFamily)return e;let r=new efe.default(e.className);r.add(`has-${yOe(o?.fontFamily)}-font-family`);let n=r.value;return e.className=n||void 0,e}function _Oe({name:e,fontFamily:t}){return ofe({},e,{fontFamily:t})}var gz={useBlockProps:_Oe,addSaveProps:ofe,attributeKeys:["fontFamily"],hasSupport(e){return(0,AR.hasBlockSupport)(e,z_)}};(0,Jde.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",SOe);var bz=l(ut(),1),Ek=l($(),1),rfe=l(XE(),1);var xOe=l(w(),1),_p="typography.fontSize";function wOe(e){return(0,Ek.hasBlockSupport)(e,_p)&&(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}})),e}function nfe(e,t,o){if(!(0,Ek.hasBlockSupport)(t,_p)||Ue(t,ds,"fontSize"))return e;let r=new rfe.default(e.className);r.add(hu(o.fontSize));let n=r.value;return e.className=n||void 0,e}function COe({name:e,fontSize:t,style:o}){let[r,n,i]=me("typography.fontSizes","typography.fluid","layout");if(!(0,Ek.hasBlockSupport)(e,_p)||Ue(e,ds,"fontSize")||!t&&!o?.typography?.fontSize)return;let s;if(o?.typography?.fontSize&&(s={style:{fontSize:ec({size:o.typography.fontSize},{typography:{fluid:n},layout:i})}}),t&&(s={style:{fontSize:oh(r,t,o?.typography?.fontSize).size}}),!!s)return nfe(s,e,{fontSize:t})}var kz={useBlockProps:COe,addSaveProps:nfe,attributeKeys:["fontSize","style"],hasSupport(e){return(0,Ek.hasBlockSupport)(e,_p)}},BOe={fontSize:[["fontSize"],["style","typography","fontSize"]]};function EOe(e,t,o,r){let n=e.name,i={fontSize:(0,Ek.hasBlockSupport)(n,_p)};return f2(i,BOe,e,t,o,r)}(0,bz.addFilter)("blocks.registerBlockType","core/font/addAttribute",wOe);(0,bz.addFilter)("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",EOe);var LR=l(N(),1),Tk=l($(),1);var vz=l(w(),1),Ik="typography.textAlign",TOe=[{icon:Jc,title:(0,LR.__)("Align text left"),align:"left"},{icon:Sf,title:(0,LR.__)("Align text center"),align:"center"},{icon:eu,title:(0,LR.__)("Align text right"),align:"right"}],ife=["left","center","right"],IOe=[];function yz(e){return Array.isArray(e)?ife.filter(t=>e.includes(t)):e===!0?ife:IOe}function POe({style:e,name:t,setAttributes:o}){let n=is(t)?.typography?.textAlign,i=ao();if(!n||i!=="default")return null;let s=yz((0,Tk.getBlockSupport)(t,Ik));if(!s.length)return null;let a=TOe.filter(u=>s.includes(u.align)),c=u=>{let d={...e,typography:{...e?.typography,textAlign:u}};o({style:Me(d)})};return(0,vz.jsx)(Mt,{group:"block",children:(0,vz.jsx)($w,{value:e?.typography?.textAlign,onChange:c,alignmentControls:a})})}var NR={edit:POe,useBlockProps:ROe,addSaveProps:OOe,attributeKeys:["style"],hasSupport(e){return(0,Tk.hasBlockSupport)(e,Ik,!1)}};function ROe({name:e,style:t}){if(!t?.typography?.textAlign||!yz((0,Tk.getBlockSupport)(e,Ik)).length||Ue(e,ds,"textAlign"))return null;let r=t.typography.textAlign;return{className:V({[`has-text-align-${r}`]:r})}}function OOe(e,t,o){if(!o?.style?.typography?.textAlign)return e;let{textAlign:r}=o.style.typography,n=(0,Tk.getBlockSupport)(t,Ik);return yz(n).includes(r)&&!Ue(t,ds,"textAlign")&&(e.className=V(`has-text-align-${r}`,e.className)),e}var _z=l(ut(),1),af=l($(),1),xp=l(R(),1),mfe=l(F(),1),j_=l(N(),1),MR=l(A(),1),pfe=l(Z(),1);function AOe(e,t){let o=e.scrollHeight>e.clientHeight,r=0,n=2400,i=r,s=window.getComputedStyle(e),a=parseFloat(s.paddingLeft)||0,c=parseFloat(s.paddingRight)||0,u=document.createRange();u.selectNodeContents(e);let d=e,f=e.parentElement;if(f){let h=window.getComputedStyle(f);h?.display==="flex"&&(d=f,a+=parseFloat(h.paddingLeft)||0,c+=parseFloat(h.paddingRight)||0)}let m=d.clientHeight;for(;r<=n;){let h=Math.floor((r+n)/2);t(h);let g=u.getBoundingClientRect().width,b=e.scrollWidth<=d.clientWidth&&g<=d.clientWidth-a-c,v=o||e.scrollHeight<=d.clientHeight||e.scrollHeight<=m;d.clientHeight>m&&(m=d.clientHeight),b&&v?(i=h,r=h+1):n=h-1}return u.detach(),i}function sfe(e,t){if(!e)return;t(0);let o=AOe(e,t);return t(o),o}var afe=l(R(),1),lfe=l(N(),1),cfe=l(A(),1),ufe=l(Xo(),1),Sz=l(w(),1);function dfe(){let e=(0,lfe.__)("The text may be too small to read. Consider using a larger container or less text.");return(0,afe.useEffect)(()=>{(0,ufe.speak)(e)},[e]),(0,Sz.jsx)("div",{className:"block-editor-fit-text-size-warning",children:(0,Sz.jsx)(cfe.Notice,{spokenMessage:null,status:"warning",isDismissible:!1,children:e})})}var Dn=l(w(),1),LOe={},NOe=12,Nc="typography.fitText";function MOe(e){return!(0,af.hasBlockSupport)(e,Nc)||e.attributes?.fitText?e:{...e,attributes:{...e.attributes,fitText:{type:"boolean"}}}}function DOe({fitText:e,name:t,clientId:o}){let[r,n]=(0,xp.useState)(null),i=(0,af.hasBlockSupport)(t,Nc),s=Xe(o),{blockAttributes:a,parentId:c,blockMode:u}=(0,mfe.useSelect)(f=>{if(!o||!i||!e)return LOe;let m=f(_).getBlockMode(o);return m==="html"?{blockMode:m}:{blockAttributes:f(_).getBlockAttributes(o),parentId:f(_).getBlockRootClientId(o),blockMode:m}},[o,i,e]),d=(0,xp.useCallback)(()=>{if(!s||!i||!e)return;let f=`fit-text-${o}`,m=s.ownerDocument.getElementById(f);m||(m=s.ownerDocument.createElement("style"),m.id=f,s.ownerDocument.head.appendChild(m));let h=`#block-${o}`,g=sfe(s,b=>{b===0?m.textContent="":m.textContent=`${h} { font-size: ${b}px !important; }`});n(g)},[s,o,i,e]);return(0,xp.useEffect)(()=>{if(!e||!s||!o||!i||u==="html")return;let f=s,m=f.style.visibility,h=null,p=null,g=null;h=window.requestAnimationFrame(()=>{f.style.visibility="hidden",p=window.requestAnimationFrame(()=>{d(),g=setTimeout(()=>{f.style.visibility=m},10)})});let b;return window.ResizeObserver&&f.parentElement&&(b=new window.ResizeObserver(d),b.observe(f.parentElement),b.observe(f)),()=>{h!==null&&window.cancelAnimationFrame(h),p!==null&&window.cancelAnimationFrame(p),g!==null&&clearTimeout(g),b&&b.disconnect();let v=`fit-text-${o}`,k=f.ownerDocument.getElementById(v);k&&k.remove()}},[e,o,c,d,s,i,u]),(0,xp.useEffect)(()=>{if(e&&s&&i&&u!=="html"){let f=window.requestAnimationFrame(()=>{s&&d()});return()=>window.cancelAnimationFrame(f)}},[a,e,d,s,i,u]),{fontSize:r}}function ffe({clientId:e,fitText:t=!1,setAttributes:o,name:r,fontSize:n,style:i,warning:s}){return(0,af.hasBlockSupport)(r,Nc)?(0,Dn.jsx)(fe,{group:"typography",children:(0,Dn.jsxs)(MR.__experimentalToolsPanelItem,{hasValue:()=>t,label:(0,j_.__)("Fit text"),onDeselect:()=>o({fitText:void 0}),resetAllFilter:()=>({fitText:void 0}),panelId:e,children:[(0,Dn.jsx)(MR.ToggleControl,{label:(0,j_.__)("Fit text"),checked:t,onChange:()=>{let a=!t||void 0,c={fitText:a};a&&(n&&(c.fontSize=void 0),i?.typography?.fontSize&&(c.style={...i,typography:{...i?.typography,fontSize:void 0}})),o(c)},help:t?(0,j_.__)("Text will resize to fit its container."):(0,j_.__)("The text will resize to fit its container, resetting other font size settings.")}),s]})}):null}function VOe(e,t,o){if(!(0,af.hasBlockSupport)(t,Nc))return e;let{fitText:r}=o;if(!r)return e;let n=e.className?`${e.className} has-fit-text`:"has-fit-text";return{...e,className:n}}function FOe({name:e,fitText:t}){return t&&(0,af.hasBlockSupport)(e,Nc)?{className:"has-fit-text"}:{}}(0,_z.addFilter)("blocks.registerBlockType","core/fit-text/addAttribute",MOe);var zOe=e=>(0,af.hasBlockSupport)(e,Nc);function jOe({fitText:e,name:t,clientId:o,children:r}){let{fontSize:n}=DOe({fitText:e,name:t,clientId:o});return r(n)}var UOe=(0,pfe.createHigherOrderComponent)(e=>function(o){let{name:r,attributes:n,clientId:i,isSelected:s,setAttributes:a}=o,{fitText:c}=n;return(0,af.hasBlockSupport)(r,Nc)?(0,Dn.jsxs)(Dn.Fragment,{children:[(0,Dn.jsx)(e,{...o}),c&&(0,Dn.jsx)(jOe,{fitText:c,name:r,clientId:i,children:d=>s&&(0,Dn.jsx)(ffe,{clientId:i,fitText:c,setAttributes:a,name:r,fontSize:n.fontSize,style:n.style,warning:d<NOe&&(0,Dn.jsx)(dfe,{})})}),!c&&s&&(0,Dn.jsx)(ffe,{clientId:i,fitText:c,setAttributes:a,name:r,fontSize:n.fontSize,style:n.style})]}):(0,Dn.jsx)(e,{...o})},"addFitTextControl");(0,_z.addFilter)("editor.BlockEdit","core/fit-text/add-fit-text-control",UOe);var DR={useBlockProps:FOe,addSaveProps:VOe,attributeKeys:["fitText","fontSize","style"],hasSupport:zOe,edit:()=>null};var wz=l(w(),1);function hfe(e,t){return Object.fromEntries(Object.entries(e).filter(([o])=>!t.includes(o)))}var HOe="typography.__experimentalLetterSpacing",GOe="typography.__experimentalTextTransform",WOe="typography.__experimentalTextDecoration",$Oe="typography.textIndent",KOe="typography.textColumns",YOe="typography.__experimentalFontStyle",qOe="typography.__experimentalFontWeight",ZOe="typography.__experimentalWritingMode",ds="typography",bfe=[Qde,_p,YOe,qOe,z_,Ik,KOe,WOe,$Oe,ZOe,GOe,HOe,Nc];function kfe(e){let t={...hfe(e,["fontFamily"])},o=e?.typography?.fontSize,r=e?.typography?.fontFamily,n=typeof o=="string"&&o?.startsWith("var:preset|font-size|")?o.substring(21):void 0,i=r?.startsWith("var:preset|font-family|")?r.substring(23):void 0;return t.typography={...hfe(t.typography,["fontFamily"]),fontSize:n?void 0:o},{style:Me(t),fontFamily:i,fontSize:n}}function vfe(e){return{...e.style,typography:{...e.style?.typography,fontFamily:e.fontFamily?"var:preset|font-family|"+e.fontFamily:void 0,fontSize:e.fontSize?"var:preset|font-size|"+e.fontSize:e.style?.typography?.fontSize}}}function XOe({children:e,resetAllFilter:t}){let o=(0,VR.useCallback)(r=>{let n=vfe(r),i=t(n);return{...r,...kfe(i)}},[t]);return(0,wz.jsx)(fe,{group:"typography",resetAllFilter:o,children:e})}function yfe({clientId:e,name:t,setAttributes:o,settings:r}){let n=RP(r),{style:i,fontFamily:s,fontSize:a,fitText:c}=(0,gfe.useSelect)(m=>{if(!n)return{};let{style:h,fontFamily:p,fontSize:g,fitText:b}=m(_).getBlockAttributes(e)||{};return{style:h,fontFamily:p,fontSize:g,fitText:b}},[e,n]),u=(0,VR.useMemo)(()=>vfe({style:i,fontFamily:s,fontSize:a}),[i,a,s]),d=m=>{let h=kfe(m);(h.fontSize||h.style?.typography?.fontSize)&&c&&(h.fitText=void 0),o(h)};if(!n)return null;let f=(0,xz.getBlockSupport)(t,[ds,"__experimentalDefaultControls"]);return(0,wz.jsx)(OP,{as:XOe,panelId:e,settings:r,value:u,onChange:d,defaultControls:f})}var cf=l(R(),1),zR=l(F(),1),FR=l($(),1),Cfe=l(Re(),1);var cl=l(R(),1),Sfe=l(Jy(),1);var U_=l(w(),1);function _fe({clientId:e,value:t,computeStyle:o,forceShow:r}){let n=Xe(e),[i,s]=(0,cl.useReducer)(()=>o(n));(0,cl.useEffect)(()=>{n&&r&&s()},[n,r]),(0,cl.useEffect)(()=>{if(!n)return;let d=new window.MutationObserver(s);return d.observe(n,{attributes:!0,attributeFilter:["style","class"]}),()=>{d.disconnect()}},[n]);let a=(0,cl.useRef)(t),[c,u]=(0,cl.useState)(!1);return(0,cl.useEffect)(()=>{if((0,Sfe.isShallowEqual)(t,a.current)||r)return;u(!0),a.current=t;let d=setTimeout(()=>{u(!1)},400);return()=>{u(!1),clearTimeout(d)}},[t,r]),!c&&!r?null:(0,U_.jsx)(Hi,{clientId:e,__unstablePopoverSlot:"block-toolbar",children:(0,U_.jsx)("div",{className:"block-editor__spacing-visualizer",style:i})})}function lf(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function xfe({clientId:e,value:t,forceShow:o}){return(0,U_.jsx)(_fe,{clientId:e,value:t?.spacing?.margin,computeStyle:r=>{let n=lf(r,"margin-top"),i=lf(r,"margin-right"),s=lf(r,"margin-bottom"),a=lf(r,"margin-left");return{borderTopWidth:n,borderRightWidth:i,borderBottomWidth:s,borderLeftWidth:a,top:n?`-${n}`:0,right:i?`-${i}`:0,bottom:s?`-${s}`:0,left:a?`-${a}`:0}},forceShow:o})}function wfe({clientId:e,value:t,forceShow:o}){return(0,U_.jsx)(_fe,{clientId:e,value:t?.spacing?.padding,computeStyle:r=>({borderTopWidth:lf(r,"padding-top"),borderRightWidth:lf(r,"padding-right"),borderBottomWidth:lf(r,"padding-bottom"),borderLeftWidth:lf(r,"padding-left")}),forceShow:o})}var Mc=l(w(),1),ul="dimensions",H_="spacing";function QOe(){let[e,t]=(0,cf.useState)(!1),{hideBlockInterface:o,showBlockInterface:r}=M((0,zR.useDispatch)(_));return(0,cf.useEffect)(()=>{e?o():r()},[e,r,o]),[e,t]}function JOe({children:e,resetAllFilter:t}){let o=(0,cf.useCallback)(r=>{let n=r.style,i=t(n);return{...r,style:i}},[t]);return(0,Mc.jsx)(fe,{group:"dimensions",resetAllFilter:o,children:e})}function Bfe({clientId:e,name:t,setAttributes:o,settings:r}){let n=MP(r),i=(0,zR.useSelect)(m=>{if(n)return m(_).getBlockAttributes(e)?.style},[e,n]),[s,a]=QOe(),c=m=>{o({style:Me(m)})};if(!n)return null;let u=(0,FR.getBlockSupport)(t,[ul,"__experimentalDefaultControls"]),d=(0,FR.getBlockSupport)(t,[H_,"__experimentalDefaultControls"]),f={...u,...d};return(0,Mc.jsxs)(Mc.Fragment,{children:[(0,Mc.jsx)(DP,{as:JOe,panelId:e,settings:r,value:i,onChange:c,defaultControls:f,onVisualize:a}),!!r?.spacing?.padding&&s==="padding"&&(0,Mc.jsx)(wfe,{forceShow:s==="padding",clientId:e,value:i}),!!r?.spacing?.margin&&s==="margin"&&(0,Mc.jsx)(xfe,{forceShow:s==="margin",clientId:e,value:i})]})}function Efe(e,t="any"){if(cf.Platform.OS!=="web")return!1;let o=(0,FR.getBlockSupport)(e,ul);return o===!0?!0:t==="any"?!!(o?.aspectRatio||o?.height||o?.minHeight||o?.width):!!o?.[t]}var Tfe={useBlockProps:eAe,attributeKeys:["height","minHeight","width","style"],hasSupport(e){return Efe(e)}};function eAe({name:e,height:t,minHeight:o,style:r}){if(!Efe(e,"aspectRatio")||Ue(e,ul,"aspectRatio"))return{};let n=V({"has-aspect-ratio":!!r?.dimensions?.aspectRatio}),i={};return r?.dimensions?.aspectRatio?(i.minHeight="unset",i.height="unset"):(o||r?.dimensions?.minHeight||t||r?.dimensions?.height)&&(i.aspectRatio="unset"),{className:n,style:i}}function Cz(){(0,Cfe.default)("wp.blockEditor.__experimentalUseCustomSides",{since:"6.3",version:"6.4"})}var dl=l(w(),1),tAe=[...bfe,cp,ir,ul,up,H_,S_],Ez=e=>tAe.some(t=>(0,Dc.hasBlockSupport)(e,t));function bi(e={}){let t={};return(0,Pk.getCSSRules)(e).forEach(o=>{t[o.key]=o.value}),t}function oAe(e){return!Ez(e)&&!(0,Dc.hasBlockSupport)(e,"customCSS",!0)||e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e}var Ofe={[`${cp}.__experimentalSkipSerialization`]:["border"],[`${ir}.__experimentalSkipSerialization`]:[ir],[`${ds}.__experimentalSkipSerialization`]:[ds],[`${ul}.__experimentalSkipSerialization`]:[ul],[`${H_}.__experimentalSkipSerialization`]:[H_],[`${S_}.__experimentalSkipSerialization`]:[S_]},rAe={...Ofe,[`${ul}.aspectRatio`]:[`${ul}.aspectRatio`],[`${up}`]:[up]},nAe={[`${ul}.aspectRatio`]:!0,[`${up}`]:!0},iAe={gradients:"gradient"};function Bz(e,t,o=!1){if(!e)return e;let r=e;return o||(r=JSON.parse(JSON.stringify(e))),Array.isArray(t)||(t=[t]),t.forEach(n=>{if(Array.isArray(n)||(n=n.split(".")),n.length>1){let[i,...s]=n;Bz(r[i],[s],!0)}else n.length===1&&delete r[n[0]]}),r}function Afe(e,t,o,r=rAe){if(!Ez(t))return e;let{style:n}=o;return Object.entries(r).forEach(([i,s])=>{let a=nAe[i]||(0,Dc.getBlockSupport)(t,i);a===!0&&(n=Bz(n,s)),Array.isArray(a)&&a.forEach(c=>{let u=iAe[c]||c;n=Bz(n,[[...s,u]])})}),e.style={...bi(n),...e.style},e}function sAe({clientId:e,name:t,setAttributes:o,__unstableParentLayout:r}){let n=is(t,r),i=ao(),s={clientId:e,name:t,setAttributes:o,settings:{...n,typography:{...n.typography,textAlign:!1}}};return i!=="default"?null:(0,dl.jsxs)(dl.Fragment,{children:[(0,dl.jsx)(d2,{...s}),(0,dl.jsx)(vae,{...s}),(0,dl.jsx)(yfe,{...s}),(0,dl.jsx)(pae,{...s}),(0,dl.jsx)(Bfe,{...s})]})}var jR={edit:sAe,hasSupport:Ez,addSaveProps:Afe,attributeKeys:["style"],useBlockProps:cAe},aAe=[{elementType:"button"},{elementType:"link",pseudo:[":hover"]},{elementType:"heading",elements:["h1","h2","h3","h4","h5","h6"]}],lAe={};function cAe({name:e,style:t}){let o=(0,Rfe.useInstanceId)(lAe,"wp-elements"),r=`.${o}`,n=t?.elements,i=(0,Ife.useMemo)(()=>{if(!n)return;let s=[];return aAe.forEach(({elementType:a,pseudo:c,elements:u})=>{if(Ue(e,ir,a))return;let f=n?.[a];if(f){let m=bg(r,Dc.__EXPERIMENTAL_ELEMENTS[a]);s.push((0,Pk.compileCSS)(f,{selector:m})),c&&c.forEach(h=>{f[h]&&s.push((0,Pk.compileCSS)(f[h],{selector:bg(r,`${Dc.__EXPERIMENTAL_ELEMENTS[a]}${h}`)}))})}u&&u.forEach(m=>{n[m]&&s.push((0,Pk.compileCSS)(n[m],{selector:bg(r,Dc.__EXPERIMENTAL_ELEMENTS[m])}))})}),s.length>0?s.join(""):void 0},[r,n,e]);return Qn({css:i}),Afe({className:o},e,{style:t},Ofe)}(0,Pfe.addFilter)("blocks.registerBlockType","core/style/addAttribute",oAe);var Lfe=l(ut(),1),Nfe=l($(),1),uAe=e=>(0,Nfe.hasBlockSupport)(e,"__experimentalSettings",!1);function dAe(e){return uAe(e)&&(e?.attributes?.settings||(e.attributes={...e.attributes,settings:{type:"object"}})),e}(0,Lfe.addFilter)("blocks.registerBlockType","core/settings/addAttribute",dAe);var uf=l($(),1),Vfe=l(Z(),1),Ffe=l(ut(),1),G_=l(R(),1);function fAe(e=[]){let t={r:[],g:[],b:[],a:[]};return e.forEach(o=>{let r=Bt(o).toRgb();t.r.push(r.r/255),t.g.push(r.g/255),t.b.push(r.b/255),t.a.push(r.a)}),t}function Mfe(e){return`${e}{filter:none}`}function Dfe(e,t){return`${e}{filter:url(#${t})}`}function UR(e,t){let o=fAe(t);return` <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="${e}"> <!-- 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>`}var Vc=l(w(),1),Tz=[],mAe=window?.navigator.userAgent&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")&&!window.navigator.userAgent.includes("Chromium");Kc([Yc]);function Iz({presetSetting:e,defaultSetting:t}){let[o,r,n,i]=me(t,`${e}.custom`,`${e}.theme`,`${e}.default`);return(0,G_.useMemo)(()=>[...r||Tz,...n||Tz,...o&&i||Tz],[o,r,n,i])}function zfe(e,t){if(!e)return;let o=t?.find(({slug:r})=>e===`var:preset|duotone|${r}`);return o?o.colors:void 0}function pAe(e,t){if(!e||!Array.isArray(e))return;let o=t?.find(r=>r?.colors?.every((n,i)=>n===e[i]));return o?`var:preset|duotone|${o.slug}`:void 0}function hAe({style:e,setAttributes:t,name:o}){let r=e?.color?.duotone,n=is(o),i=ao(),s=Iz({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),a=Iz({presetSetting:"color.palette",defaultSetting:"color.defaultPalette"}),[c,u]=me("color.custom","color.customDuotone"),d=!c,f=!u||a?.length===0&&d;if(s?.length===0&&f||i!=="default")return null;let m=r==="unset"||Array.isArray(r)?r:zfe(r,s);return(0,Vc.jsxs)(Vc.Fragment,{children:[(0,Vc.jsx)(fe,{group:"filter",children:(0,Vc.jsx)(KP,{value:{filter:{duotone:m}},onChange:h=>{let p={...e,color:{...h?.filter}};t({style:Me(p)})},settings:n})}),(0,Vc.jsx)(Mt,{group:"block",__experimentalShareWithChildBlocks:!0,children:(0,Vc.jsx)(eI,{duotonePalette:s,colorPalette:a,disableCustomDuotone:f,disableCustomColors:d,value:m,onChange:h=>{let p=pAe(h,s),g={...e,color:{...e?.color,duotone:p??h}};t({style:Me(g)})},settings:n})})]})}var Pz={shareWithChildBlocks:!0,edit:hAe,useBlockProps:vAe,attributeKeys:["style"],hasSupport(e){return(0,uf.hasBlockSupport)(e,"filter.duotone")}};function gAe(e){return(0,uf.hasBlockSupport)(e,"filter.duotone")&&(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}})),e}function bAe({clientId:e,id:t,selector:o,attribute:r}){let n=Iz({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),i=Array.isArray(r),s=i?void 0:zfe(r,n),a=typeof r=="string"&&s,c=typeof r=="string"&&!a,u=null;a?u=s:(c||i)&&(u=r);let m=o.split(",").map(g=>`.${t}${g.trim()}`).join(", "),h=Array.isArray(u)||u==="unset";tc(h?{css:u!=="unset"?Dfe(m,t):Mfe(m),__unstableType:"presets"}:void 0),tc(h?{assets:u!=="unset"?UR(t,u):"",__unstableType:"svgs"}:void 0);let p=Xe(e);(0,G_.useEffect)(()=>{if(h&&p&&mAe){let g=p.style.display;p.style.setProperty("display","inline-block"),p.offsetHeight,p.style.setProperty("display",g)}},[h,p,u])}var kAe={};function vAe({clientId:e,name:t,style:o}){let r=(0,Vfe.useInstanceId)(kAe),n=(0,G_.useMemo)(()=>{let c=(0,uf.getBlockType)(t);if(c){if(!(0,uf.getBlockSupport)(c,"filter.duotone",!1))return null;let d=(0,uf.getBlockSupport)(c,"color.__experimentalDuotone",!1);if(d){let f=oi(c);return typeof d=="string"?bg(f,d):f}return oi(c,"filter.duotone",{fallback:!0})}},[t]),i=o?.color?.duotone,s=`wp-duotone-${r}`,a=n&&i;return bAe({clientId:e,id:s,selector:n,attribute:i}),{className:a?s:""}}(0,Ffe.addFilter)("blocks.registerBlockType","core/editor/duotone/add-attributes",gAe);var GR=l(R(),1),W_=l(F(),1),jfe=l(Z(),1),$_=l($(),1),K_=l(N(),1);var Ufe=l(Un(),1);var HR=l(w(),1),yAe={},SAe={};function _Ae({blockName:e,setAttributes:t,style:o}){if(ao()!=="default")return null;let n=(0,$_.getBlockType)(e);function i(a){let c=a?.css?.trim()?a.css:void 0;t({style:Me({...a,css:c})})}let s=(0,K_.sprintf)((0,K_.__)("Add your own CSS to customize the appearance of the %s block. You do not need to include a CSS selector, just add the property and value, e.g. color: red;."),n?.title);return(0,HR.jsx)(fe,{group:"advanced",children:(0,HR.jsx)(ZP,{value:o,onChange:i,inheritedValue:o,help:s})})}var xAe="custom-css-edit-warning";function wAe({clientId:e,name:t,setAttributes:o}){let{style:r,canEditCSS:n}=(0,W_.useSelect)(i=>{let{getBlockAttributes:s,getSettings:a}=i(_);return{style:s(e)?.style||SAe,canEditCSS:a().canEditCSS}},[e]);return n?(0,HR.jsx)(_Ae,{blockName:t,setAttributes:o,style:r}):null}function CAe({style:e}){let t=e?.css,o=typeof t=="string"&&t.trim().length>0&&qP(t),r=(0,W_.useSelect)(u=>u(_).getSettings().canEditCSS,[]),{createWarningNotice:n}=(0,W_.useDispatch)(Ufe.store),i=!!t?.trim();(0,GR.useEffect)(()=>{!r&&i&&n((0,K_.__)("This post contains blocks with custom CSS. You do not have permission to edit CSS. If you save this post, the custom CSS will be removed."),{id:xAe,isDismissible:!0})},[r,i,n]);let s=(0,jfe.useInstanceId)(yAe,"wp-custom-css"),a=`.${s}`,c=(0,GR.useMemo)(()=>{if(o)return CS(t,a)},[t,a,o]);return Qn({css:c}),o?{className:`has-custom-css ${s}`}:{}}function BAe(e,t,o){if(!(0,$_.hasBlockSupport)(t,"customCSS",!0)||!o?.style?.css?.trim())return e;let r=e.className?`${e.className} has-custom-css`:"has-custom-css";return{...e,className:r}}var WR={edit:wAe,useBlockProps:CAe,addSaveProps:BAe,attributeKeys:["style"],hasSupport(e){return(0,$_.hasBlockSupport)(e,"customCSS",!0)}};var $R=l(Z(),1),Oz=l(ut(),1),Fc=l($(),1),KR=l(F(),1),fl=l(A(),1),Rk=l(N(),1);var Yo=l(w(),1),EAe="is-style-",Az="layout",{kebabCase:Rz}=M(fl.privateApis);function Lz(e){return(0,Fc.hasBlockSupport)(e,"layout")||(0,Fc.hasBlockSupport)(e,"__experimentalLayout")}function YR(e={},t=""){let{layout:o}=e,{default:r}=(0,Fc.getBlockSupport)(t,Az)||{},n=o?.inherit||o?.contentSize||o?.wideSize?{...o,type:"constrained"}:o||r||{},i=[];if(Hn[n?.type||"default"]?.className){let a=Hn[n?.type||"default"]?.className,c=t.split("/"),d=`wp-block-${c[0]==="core"?c.pop():c.join("-")}-${a}`;i.push(a,d)}return(0,KR.useSelect)(a=>!n?.inherit&&!n?.contentSize&&n?.type!=="constrained"?!1:a(_).getSettings().__experimentalFeatures?.useRootPaddingAwareAlignments,[n?.contentSize,n?.inherit,n?.type])&&i.push("has-global-padding"),n?.orientation&&i.push(`is-${Rz(n.orientation)}`),n?.justifyContent&&i.push(`is-content-justification-${Rz(n.justifyContent)}`),n?.flexWrap&&n.flexWrap==="nowrap"&&i.push("is-nowrap"),i}function Nz(e={},t,o){let{layout:r={},style:n={}}=e,i=r?.inherit||r?.contentSize||r?.wideSize?{...r,type:"constrained"}:r||{},s=xs(i?.type||"default"),[a]=me("spacing.blockGap"),c=a!==null;return s?.getLayoutStyle?.({blockName:t,selector:o,layout:r,style:n,hasBlockGapSupport:c})}function TAe({layout:e,setAttributes:t,name:o,clientId:r}){let n=is(o),{layout:i}=n,{themeSupportsLayout:s}=(0,KR.useSelect)(T=>{let{getSettings:O}=T(_);return{themeSupportsLayout:O().supportsLayout}},[]);if(ao()!=="default")return null;let c=(0,Fc.getBlockSupport)(o,Az,{}),u={...i,...c},{allowSwitching:d,allowEditing:f=!0,allowInheriting:m=!0,default:h}=u;if(!f)return null;let p={...c,...e},{type:g,default:{type:b="default"}={}}=p,v=g||b,k=!!(m&&(!v||v==="default"||v==="constrained"||p.inherit)),y=e||h||{},{inherit:S=!1,contentSize:x=null}=y;if((v==="default"||v==="constrained")&&!s)return null;let C=xs(v),B=xs("constrained"),I=!y.type&&(x||S),P=!!S||!!x,E=T=>t({layout:{type:T}}),L=T=>t({layout:T});return(0,Yo.jsxs)(Yo.Fragment,{children:[(0,Yo.jsx)(fe,{children:(0,Yo.jsxs)(fl.PanelBody,{title:(0,Rk.__)("Layout"),children:[k&&(0,Yo.jsx)(Yo.Fragment,{children:(0,Yo.jsx)(fl.ToggleControl,{label:(0,Rk.__)("Inner blocks use content width"),checked:C?.name==="constrained"||P,onChange:()=>t({layout:{type:C?.name==="constrained"||P?"default":"constrained"}}),help:C?.name==="constrained"||P?(0,Rk.__)("Nested blocks use content width with options for full and wide widths."):(0,Rk.__)("Nested blocks will fill the width of this container.")})}),!S&&d&&(0,Yo.jsx)(IAe,{type:v,onChange:E}),C&&C.name!=="default"&&(0,Yo.jsx)(C.inspectorControls,{layout:y,onChange:L,layoutBlockSupport:u,name:o,clientId:r}),B&&I&&(0,Yo.jsx)(B.inspectorControls,{layout:y,onChange:L,layoutBlockSupport:u,name:o,clientId:r})]})}),!S&&C&&(0,Yo.jsx)(C.toolBarControls,{layout:y,onChange:L,layoutBlockSupport:c,name:o,clientId:r})]})}var Hfe={shareWithChildBlocks:!0,edit:TAe,attributeKeys:["layout"],hasSupport(e){return Lz(e)}};function IAe({type:e,onChange:t}){return(0,Yo.jsx)(fl.__experimentalToggleGroupControl,{__next40pxDefaultSize:!0,isBlock:!0,label:(0,Rk.__)("Layout type"),hideLabelFromVision:!0,isAdaptiveWidth:!0,value:e,onChange:t,children:fH().map(({name:o,label:r})=>(0,Yo.jsx)(fl.__experimentalToggleGroupControlOption,{value:o,label:r},o))})}function PAe(e){return"type"in(e.attributes?.layout??{})||Lz(e)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e}function RAe({block:e,props:t,blockGapSupport:o,globalBlockGapValue:r,layoutClasses:n}){let{name:i,attributes:s}=t,a=(0,$R.useInstanceId)(e),{layout:c}=s,{default:u}=(0,Fc.getBlockSupport)(i,Az)||{},d=c?.inherit||c?.contentSize||c?.wideSize?{...c,type:"constrained"}:c||u||{},f=`wp-container-${Rz(i)}-is-layout-`,m=`.${f}${a}`,h=o!==null,g=xs(d?.type||"default")?.getLayoutStyle?.({blockName:i,selector:m,layout:d,style:s?.style,hasBlockGapSupport:h,globalBlockGapValue:r}),b=V({[`${f}${a}`]:!!g},n);return Qn({css:g}),(0,Yo.jsx)(e,{...t,__unstableLayoutClassNames:b})}var OAe=(0,$R.createHigherOrderComponent)(e=>function(o){let{clientId:r,name:n,attributes:i}=o,s=Lz(n),a=YR(i,n),c=(0,KR.useSelect)(u=>{if(!s)return;let{getSettings:d,getBlockSettings:f}=M(u(_)),m=d(),{disableLayoutStyles:h}=m;if(h)return;let[p]=f(r,"spacing.blockGap"),g=m[xi],b,v=i?.className;if(v?.includes(EAe)){let{getBlockStyles:y}=u(Fc.store),S=y(n),x=jV(v,S);b=x?g?.blocks?.[n]?.variations?.[x]?.spacing?.blockGap:void 0}let k=b??g?.blocks?.[n]?.spacing?.blockGap??g?.spacing?.blockGap;return{blockGapSupport:p,globalBlockGapValue:k}},[s,r,i?.className,n]);return c?(0,Yo.jsx)(RAe,{block:e,props:o,layoutClasses:a,...c}):(0,Yo.jsx)(e,{...o,__unstableLayoutClassNames:s?a:void 0})},"withLayoutStyles");(0,Oz.addFilter)("blocks.registerBlockType","core/layout/addAttribute",PAe);(0,Oz.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",OAe);var Xfe=l(Z(),1),zz=l(F(),1),Qfe=l(R(),1);var fs=l(R(),1),df=l(F(),1),Wfe=l(Z(),1);function q_(e,t){return Array.from({length:t},(o,r)=>e+r)}var aa=class{constructor({columnStart:e,rowStart:t,columnEnd:o,rowEnd:r,columnSpan:n,rowSpan:i}={}){this.columnStart=e??1,this.rowStart=t??1,n!==void 0?this.columnEnd=this.columnStart+n-1:this.columnEnd=o??this.columnStart,i!==void 0?this.rowEnd=this.rowStart+i-1:this.rowEnd=r??this.rowStart}get columnSpan(){return this.columnEnd-this.columnStart+1}get rowSpan(){return this.rowEnd-this.rowStart+1}contains(e,t){return e>=this.columnStart&&e<=this.columnEnd&&t>=this.rowStart&&t<=this.rowEnd}containsRect(e){return this.contains(e.columnStart,e.rowStart)&&this.contains(e.columnEnd,e.rowEnd)}intersectsRect(e){return this.columnStart<=e.columnEnd&&this.columnEnd>=e.columnStart&&this.rowStart<=e.rowEnd&&this.rowEnd>=e.rowStart}};function Bo(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function Y_(e,t){let o=[];for(let r of e.split(" ")){let n=o[o.length-1],i=n?n.end+t:0,s=i+parseFloat(r);o.push({start:i,end:s})}return o}function zc(e,t,o="start"){return e.reduce((r,n,i)=>Math.abs(n[o]-t)<Math.abs(e[r][o]-t)?i:r,0)}function AAe(e,t){let o=parseFloat(Bo(e,"column-gap")),r=parseFloat(Bo(e,"row-gap")),n=Y_(Bo(e,"grid-template-columns"),o),i=Y_(Bo(e,"grid-template-rows"),r),s=zc(n,t.left)+1,a=zc(i,t.top)+1,c=zc(n,t.right,"end")+1,u=zc(i,t.bottom,"end")+1;return new aa({columnStart:s,columnEnd:c,rowStart:a,rowEnd:u})}function Gfe(e){return AAe(e.parentElement,new window.DOMRect(e.offsetLeft,e.offsetTop,e.offsetWidth,e.offsetHeight))}function Mz(e){let t=Bo(e,"grid-template-columns"),o=Bo(e,"grid-template-rows"),r=Bo(e,"border-top-width"),n=Bo(e,"border-right-width"),i=Bo(e,"border-bottom-width"),s=Bo(e,"border-left-width"),a=Bo(e,"padding-top"),c=Bo(e,"padding-right"),u=Bo(e,"padding-bottom"),d=Bo(e,"padding-left"),f=t.split(" ").length,m=o.split(" ").length,h=f*m;return{numColumns:f,numRows:m,numItems:h,currentColor:Bo(e,"color"),style:{gridTemplateColumns:t,gridTemplateRows:o,gap:Bo(e,"gap"),inset:` calc(${a} + ${r}) calc(${c} + ${n}) calc(${u} + ${i}) calc(${d} + ${s}) `}}}var ki=l(w(),1);function Z_({clientId:e,contentRef:t,parentLayout:o,childGridClientId:r}){let n=(0,df.useSelect)(a=>a(_).getSettings().isDistractionFree,[]),i=Xe(e);if(n||!i)return null;let s=o?.isManualPlacement&&window.__experimentalEnableGridInteractivity;return(0,ki.jsx)(LAe,{gridClientId:e,gridElement:i,isManualGrid:s,ref:t,childGridClientId:r})}var LAe=(0,fs.forwardRef)(({gridClientId:e,gridElement:t,isManualGrid:o,childGridClientId:r},n)=>{let[i,s]=(0,fs.useState)(()=>Mz(t)),[a,c]=(0,fs.useState)(!1),u=Xe(r),d=(0,fs.useMemo)(()=>u?Gfe(u):null,[u]);return(0,fs.useEffect)(()=>{let f=()=>s(Mz(t)),m=new window.ResizeObserver(f);m.observe(t,{box:"border-box"});let h=new window.ResizeObserver(f);return h.observe(t),()=>{m.disconnect(),h.disconnect()}},[t]),(0,fs.useEffect)(()=>{function f(){c(!0)}function m(){c(!1)}return document.addEventListener("drag",f),document.addEventListener("dragend",m),()=>{document.removeEventListener("drag",f),document.removeEventListener("dragend",m)}},[]),(0,ki.jsx)(Hi,{className:V("block-editor-grid-visualizer",{"is-dropping-allowed":a}),clientId:e,__unstablePopoverSlot:"__unstable-block-tools-after",children:(0,ki.jsx)("div",{ref:n,className:"block-editor-grid-visualizer__grid",style:i.style,children:o?(0,ki.jsx)(MAe,{gridClientId:e,gridInfo:i,childGridRect:d}):(0,ki.jsx)(NAe,{gridInfo:i,childGridRect:d})})})});function NAe({gridInfo:e,childGridRect:t}){return q_(1,e.numRows).map(o=>q_(1,e.numColumns).map(r=>{let n=e.currentColor;return t?.contains(r,o)&&(n="transparent"),(0,ki.jsx)($fe,{color:n},`${o}-${r}`)}))}function MAe({gridClientId:e,gridInfo:t,childGridRect:o}){let[r,n]=(0,fs.useState)(null),i=(0,df.useSelect)(a=>{let{getBlockOrder:c,getBlockStyles:u}=M(a(_)),d=c(e);return u(d)},[e]),s=(0,fs.useMemo)(()=>{let a=[];for(let c of Object.values(i)){let{columnStart:u,rowStart:d,columnSpan:f=1,rowSpan:m=1}=c?.layout??{};!u||!d||a.push(new aa({columnStart:u,rowStart:d,columnSpan:f,rowSpan:m}))}return a},[i]);return q_(1,t.numRows).map(a=>q_(1,t.numColumns).map(c=>{let u=o?.contains(c,a),d=t.currentColor;u&&(d="transparent");let f=s.some(h=>h.contains(c,a)),m=r?.contains(c,a)??!1;return(0,ki.jsx)($fe,{color:d,className:m&&"is-highlighted",children:f&&!u?(0,ki.jsx)(DAe,{column:c,row:a,gridClientId:e,gridInfo:t,setHighlightedRect:n}):(0,ki.jsx)(VAe,{column:c,row:a,gridClientId:e,gridInfo:t,setHighlightedRect:n})},`${a}-${c}`)}))}function $fe({color:e,children:t,className:o}){return(0,ki.jsx)("div",{className:V("block-editor-grid-visualizer__cell",o),style:{boxShadow:`inset 0 0 0 1px color-mix(in srgb, ${e} 20%, #0000)`,color:e},children:t})}function Kfe(e,t,o,r,n){let{getBlockAttributes:i,getBlockRootClientId:s,canInsertBlockType:a,getBlockName:c}=(0,df.useSelect)(_),{updateBlockAttributes:u,moveBlocksToPosition:d,__unstableMarkNextChangeAsNotPersistent:f}=(0,df.useDispatch)(_),m=np(o,r.numColumns);return FAe({validateDrag(h){let p=c(h);if(!a(p,o))return!1;let g=i(h),b=new aa({columnStart:e,rowStart:t,columnSpan:g.style?.layout?.columnSpan,rowSpan:g.style?.layout?.rowSpan});return new aa({columnSpan:r.numColumns,rowSpan:r.numRows}).containsRect(b)},onDragEnter(h){let p=i(h);n(new aa({columnStart:e,rowStart:t,columnSpan:p.style?.layout?.columnSpan,rowSpan:p.style?.layout?.rowSpan}))},onDragLeave(){n(h=>h?.columnStart===e&&h?.rowStart===t?null:h)},onDrop(h){n(null);let p=i(h);u(h,{style:{...p.style,layout:{...p.style?.layout,columnStart:e,rowStart:t}}}),f(),d([h],s(h),o,m(e,t))}})}function DAe({column:e,row:t,gridClientId:o,gridInfo:r,setHighlightedRect:n}){return(0,ki.jsx)("div",{className:"block-editor-grid-visualizer__drop-zone",ref:Kfe(e,t,o,r,n)})}function VAe({column:e,row:t,gridClientId:o,gridInfo:r,setHighlightedRect:n}){let{updateBlockAttributes:i,moveBlocksToPosition:s,__unstableMarkNextChangeAsNotPersistent:a}=(0,df.useDispatch)(_),c=np(o,r.numColumns);return(0,ki.jsx)(Qu,{rootClientId:o,className:"block-editor-grid-visualizer__appender",ref:Kfe(e,t,o,r,n),style:{color:r.currentColor},onSelect:u=>{u&&(i(u.clientId,{style:{layout:{columnStart:e,rowStart:t}}}),a(),s([u.clientId],o,o,c(e,t)))}})}function FAe({validateDrag:e,onDragEnter:t,onDragLeave:o,onDrop:r}){let{getDraggedBlockClientIds:n}=(0,df.useSelect)(_);return(0,Wfe.__experimentalUseDropZone)({onDragEnter(){let[i]=n();i&&e(i)&&t(i)},onDragLeave(){o()},onDrop(){let[i]=n();i&&e(i)&&r(i)}})}var Yfe=l(A(),1),X_=l(R(),1);var qR=l(w(),1);function Dz({clientId:e,bounds:t,onChange:o,parentLayout:r}){let n=Xe(e),i=n?.parentElement,{isManualPlacement:s}=r;return!n||!i?null:(0,qR.jsx)(zAe,{clientId:e,bounds:t,blockElement:n,rootBlockElement:i,onChange:o,isManualGrid:s&&window.__experimentalEnableGridInteractivity})}function zAe({clientId:e,bounds:t,blockElement:o,rootBlockElement:r,onChange:n,isManualGrid:i}){let[s,a]=(0,X_.useState)(null),[c,u]=(0,X_.useState)({top:!1,bottom:!1,left:!1,right:!1});(0,X_.useEffect)(()=>{let h=new window.ResizeObserver(()=>{let p=o.getBoundingClientRect(),g=r.getBoundingClientRect(),b=p.top>g.top,v=p.bottom<g.bottom,k=p.left>g.left,y=p.right<g.right;u({top:(i||!v)&&b,bottom:v,left:(i||!y)&&k,right:y})});return h.observe(o),()=>h.disconnect()},[o,r,i]);let d={right:"left",left:"right"},f={top:"flex-end",bottom:"flex-start"},m={display:"flex",justifyContent:"center",alignItems:"center",...d[s]&&{justifyContent:d[s]},...f[s]&&{alignItems:f[s]}};return(0,qR.jsx)(Hi,{className:"block-editor-grid-item-resizer",clientId:e,__unstablePopoverSlot:"__unstable-block-tools-after",additionalStyles:m,children:(0,qR.jsx)(Yfe.ResizableBox,{className:"block-editor-grid-item-resizer__box",size:{width:"100%",height:"100%"},enable:{bottom:c.bottom,bottomLeft:!1,bottomRight:!1,left:c.left,right:c.right,top:c.top,topLeft:!1,topRight:!1},bounds:t,boundsByDirection:!0,onPointerDown:({target:h,pointerId:p})=>{h.setPointerCapture(p)},onResizeStart:(h,p)=>{a(p)},onResizeStop:(h,p,g)=>{let b=parseFloat(Bo(r,"column-gap")),v=parseFloat(Bo(r,"row-gap")),k=Y_(Bo(r,"grid-template-columns"),b),y=Y_(Bo(r,"grid-template-rows"),v),S=new window.DOMRect(o.offsetLeft+g.offsetLeft,o.offsetTop+g.offsetTop,g.offsetWidth,g.offsetHeight),x=zc(k,S.left)+1,C=zc(y,S.top)+1,B=zc(k,S.right,"end")+1,I=zc(y,S.bottom,"end")+1;n({columnSpan:B-x+1,rowSpan:I-C+1,columnStart:i?x:void 0,rowStart:i?C:void 0})}})})}var ms=l(N(),1),Ok=l(A(),1);var qfe=l(F(),1),Zfe=l(Z(),1);var Nr=l(w(),1);function Vz({layout:e,parentLayout:t,onChange:o,gridClientId:r,blockClientId:n}){let{moveBlocksToPosition:i,__unstableMarkNextChangeAsNotPersistent:s}=(0,qfe.useDispatch)(_),a=e?.columnStart??1,c=e?.rowStart??1,u=e?.columnSpan??1,d=e?.rowSpan??1,f=a+u-1,m=c+d-1,h=t?.columnCount,p=t?.rowCount,g=np(r,h);return(0,Nr.jsx)(Mt,{group:"parent",children:(0,Nr.jsxs)(Ok.ToolbarGroup,{className:"block-editor-grid-item-mover__move-button-container",children:[(0,Nr.jsx)("div",{className:"block-editor-grid-item-mover__move-horizontal-button-container is-left",children:(0,Nr.jsx)(Q_,{icon:(0,ms.isRTL)()?Vo:Mr,label:(0,ms.__)("Move left"),description:(0,ms.__)("Move left"),isDisabled:a<=1,onClick:()=>{o({columnStart:a-1}),s(),i([n],r,r,g(a-1,c))}})}),(0,Nr.jsxs)("div",{className:"block-editor-grid-item-mover__move-vertical-button-container",children:[(0,Nr.jsx)(Q_,{className:"is-up-button",icon:xf,label:(0,ms.__)("Move up"),description:(0,ms.__)("Move up"),isDisabled:c<=1,onClick:()=>{o({rowStart:c-1}),s(),i([n],r,r,g(a,c-1))}}),(0,Nr.jsx)(Q_,{className:"is-down-button",icon:zn,label:(0,ms.__)("Move down"),description:(0,ms.__)("Move down"),isDisabled:p&&m>=p,onClick:()=>{o({rowStart:c+1}),s(),i([n],r,r,g(a,c+1))}})]}),(0,Nr.jsx)("div",{className:"block-editor-grid-item-mover__move-horizontal-button-container is-right",children:(0,Nr.jsx)(Q_,{icon:(0,ms.isRTL)()?Mr:Vo,label:(0,ms.__)("Move right"),description:(0,ms.__)("Move right"),isDisabled:h&&f>=h,onClick:()=>{o({columnStart:a+1}),s(),i([n],r,r,g(a+1,c))}})})]})})}function Q_({className:e,icon:t,label:o,isDisabled:r,onClick:n,description:i}){let a=`block-editor-grid-item-mover-button__description-${(0,Zfe.useInstanceId)(Q_)}`;return(0,Nr.jsxs)(Nr.Fragment,{children:[(0,Nr.jsx)(Ok.ToolbarButton,{className:V("block-editor-grid-item-mover-button",e),icon:t,label:o,"aria-describedby":a,onClick:r?null:n,disabled:r,accessibleWhenDisabled:!0}),(0,Nr.jsx)(Ok.VisuallyHidden,{id:a,children:i})]})}var J_=l(F(),1),XR=l(R(),1),ZR=l(Z(),1);function Fz({clientId:e}){let{gridLayout:t,blockOrder:o,selectedBlockLayout:r}=(0,J_.useSelect)(m=>{let{getBlockAttributes:h,getBlockOrder:p}=m(_),g=m(_).getSelectedBlock();return{gridLayout:h(e).layout??{},blockOrder:p(e),selectedBlockLayout:g?.attributes.style?.layout}},[e]),{getBlockAttributes:n,getBlockRootClientId:i}=(0,J_.useSelect)(_),{updateBlockAttributes:s,__unstableMarkNextChangeAsNotPersistent:a}=(0,J_.useDispatch)(_),c=(0,XR.useMemo)(()=>r?new aa(r):null,[r]),u=(0,ZR.usePrevious)(c),d=(0,ZR.usePrevious)(t.isManualPlacement),f=(0,ZR.usePrevious)(o);(0,XR.useEffect)(()=>{let m={};if(t.isManualPlacement){let h=[];for(let g of o){let{columnStart:b,rowStart:v,columnSpan:k=1,rowSpan:y=1}=n(g).style?.layout??{};!b||!v||h.push(new aa({columnStart:b,rowStart:v,columnSpan:k,rowSpan:y}))}for(let g of o){let b=n(g),{columnStart:v,rowStart:k,columnSpan:y=1,rowSpan:S=1}=b.style?.layout??{};if(v&&k)continue;let[x,C]=jAe(h,t.columnCount,y,S,u?.columnEnd,u?.rowEnd);h.push(new aa({columnStart:x,rowStart:C,columnSpan:y,rowSpan:S})),m[g]={style:{...b.style,layout:{...b.style?.layout,columnStart:x,rowStart:C}}}}let p=Math.max(...h.map(g=>g.rowEnd));(!t.rowCount||t.rowCount<p)&&(m[e]={layout:{...t,rowCount:p}});for(let g of f??[])if(!o.includes(g)){let b=i(g);if(b===null||n(b)?.layout?.type==="grid")continue;let k=n(g),{columnStart:y,rowStart:S,columnSpan:x,rowSpan:C,...B}=k.style?.layout??{};if(y||S||x||C){let I=Object.keys(B).length===0;m[g]=pe(k,["style","layout"],I?void 0:B)}}}else{if(d===!0)for(let h of o){let p=n(h),{columnStart:g,rowStart:b,...v}=p.style?.layout??{};if(g||b){let k=Object.keys(v).length===0;m[h]=pe(p,["style","layout"],k?void 0:v)}}t.rowCount&&(m[e]={layout:{...t,rowCount:void 0}})}Object.keys(m).length&&(a(),s(Object.keys(m),m,!0))},[e,t,f,o,u,d,a,n,i,s])}function jAe(e,t,o,r,n=1,i=1){for(let s=i;;s++)for(let a=s===i?n:1;a<=t;a++){let c=new aa({columnStart:a,rowStart:s,columnSpan:o,rowSpan:r});if(!e.some(u=>u.intersectsRect(c)))return[a,s]}}var jc=l(w(),1),UAe={};function HAe({style:e}){let t=(0,zz.useSelect)(g=>!g(_).getSettings().disableLayoutStyles),o=e?.layout??{},{selfStretch:r,flexSize:n,columnStart:i,rowStart:s,columnSpan:a,rowSpan:c}=o,u=Uf()||{},{columnCount:d,minimumColumnWidth:f}=u,m=(0,Xfe.useInstanceId)(UAe),h=`.wp-container-content-${m}`,p="";if(t&&(r==="fixed"&&n?p=`${h} { flex-basis: ${n}; box-sizing: border-box; }`:r==="fill"?p=`${h} { flex-grow: 1; }`:i&&a?p=`${h} { grid-column: ${i} / span ${a}; }`:i?p=`${h} { grid-column: ${i}; }`:a&&(p=`${h} { grid-column: span ${a}; }`),s&&c?p+=`${h} { grid-row: ${s} / span ${c}; }`:s?p+=`${h} { grid-row: ${s}; }`:c&&(p+=`${h} { grid-row: span ${c}; }`),(a||i)&&(f||!d))){let g=parseFloat(f);isNaN(g)&&(g=12);let b=f?.replace(g,"");["px","rem","em"].includes(b)||(b="rem");let v=2;a&&i?v=a+i-1:a?v=a:v=i;let k=b==="px"?24:1.5,y=v*g+(v-1)*k,S=g*2+k-1,x=a&&a>1?"1/-1":"auto";p+=`@container (max-width: ${Math.max(y,S)}${b}) { ${h} { grid-column: ${x}; grid-row: auto; } }`}if(Qn({css:p}),!!p)return{className:`wp-container-content-${m}`}}function GAe({clientId:e,style:t,setAttributes:o}){let r=Uf()||{},{type:n="default",allowSizingOnChildren:i=!1,isManualPlacement:s}=r;return n!=="grid"?null:(0,jc.jsx)(WAe,{clientId:e,style:t,setAttributes:o,allowSizingOnChildren:i,isManualPlacement:s,parentLayout:r})}function WAe({clientId:e,style:t,setAttributes:o,allowSizingOnChildren:r,isManualPlacement:n,parentLayout:i}){let{rootClientId:s,isVisible:a,parentBlockVisibility:c,blockBlockVisibility:u,deviceType:d,isChildBlockAGrid:f}=(0,zz.useSelect)(y=>{let{getBlockRootClientId:S,getBlockEditingMode:x,getTemplateLock:C,getBlockAttributes:B,getSettings:I}=y(_),P=S(e);if(C(P)||x(P)!=="default")return{rootClientId:P,isVisible:!1};let E=B(P),L=B(e),T=I();return{rootClientId:P,isVisible:!0,parentBlockVisibility:E?.metadata?.blockVisibility,blockBlockVisibility:L?.metadata?.blockVisibility,deviceType:T?.[wi]?.toLowerCase()||Et.desktop.value,isChildBlockAGrid:L?.layout?.type==="grid"}},[e]),{isBlockCurrentlyHidden:m}=Mi({blockVisibility:c,deviceType:d}),{isBlockCurrentlyHidden:h}=Mi({blockVisibility:u,deviceType:d}),[p,g]=(0,Qfe.useState)(),b=f?e:void 0;if(!a||m)return null;let v=r&&!h;function k(y){o({style:{...t,layout:{...t?.layout,...y}}})}return(0,jc.jsxs)(jc.Fragment,{children:[(0,jc.jsx)(Z_,{clientId:s,contentRef:g,parentLayout:i,childGridClientId:b}),v&&(0,jc.jsx)(Dz,{clientId:e,bounds:p,onChange:k,parentLayout:i}),n&&window.__experimentalEnableGridInteractivity&&(0,jc.jsx)(Vz,{layout:t?.layout,parentLayout:i,onChange:k,gridClientId:s,blockClientId:e})]})}var jz={useBlockProps:HAe,edit:GAe,attributeKeys:["style"],hasSupport(){return!0}};var Hz=l(ut(),1),Uz=l($(),1),Jfe="metadata";function $Ae(e){return e?.attributes?.[Jfe]?.type||(e.attributes={...e.attributes,[Jfe]:{type:"object"}}),e}function KAe(e,t,o,r){if(r.length===1&&e.innerBlocks.length===t.length||r.length===1&&t.length>1||r.length>1&&t.length===1||r.length>1&&t.length>1&&r.length!==t.length)return e;let n=t[o]?.attributes?.metadata;if(!n)return e;let i={};return n.noteId&&!e.attributes?.metadata?.noteId&&(i.noteId=n.noteId),n.name&&!e.attributes?.metadata?.name&&(0,Uz.hasBlockSupport)(e.name,"renaming",!0)&&(i.name=n.name),n.blockVisibility!==void 0&&!e.attributes?.metadata?.blockVisibility&&(0,Uz.hasBlockSupport)(e.name,"visibility",!0)&&(i.blockVisibility=n.blockVisibility),Object.keys(i).length>0?{...e,attributes:{...e.attributes,metadata:{...e.attributes.metadata,...i}}}:e}(0,Hz.addFilter)("blocks.registerBlockType","core/metadata/addMetaAttribute",$Ae);(0,Hz.addFilter)("blocks.switchToBlockType.transformedBlock","core/metadata/addTransforms",KAe);var Gz=l(N(),1),QR=l(R(),1),JR=l(A(),1),eO=l($(),1),Ak=l(F(),1);var ff=l(w(),1),YAe={};function qAe({name:e,clientId:t,metadata:{ignoredHookedBlocks:o=[]}={}}){let r=(0,Ak.useSelect)(h=>h(eO.store).getBlockTypes(),[]),n=(0,QR.useMemo)(()=>r?.filter(({name:h,blockHooks:p})=>p&&e in p||o.includes(h)),[r,e,o]),i=(0,Ak.useSelect)(h=>{let{getBlocks:p,getBlockRootClientId:g,getGlobalBlockCount:b}=h(_),v=g(t),k=n.reduce((y,S)=>{if(b(S.name)===0)return y;let x=S?.blockHooks?.[e],C;switch(x){case"before":case"after":C=p(v);break;case"first_child":case"last_child":C=p(t);break;case void 0:C=[...p(v),...p(t)];break}let B=C?.find(I=>I.name===S.name);return B?{...y,[S.name]:B.clientId}:y},{});return Object.values(k).length>0?k:YAe},[n,e,t]),{getBlockIndex:s,getBlockCount:a,getBlockRootClientId:c}=(0,Ak.useSelect)(_),{insertBlock:u,removeBlock:d}=(0,Ak.useDispatch)(_);if(!n.length)return null;let f=n.reduce((h,p)=>{let[g]=p.name.split("/");return h[g]||(h[g]=[]),h[g].push(p),h},{}),m=(h,p)=>{let g=s(t),b=a(t),v=c(t);switch(p){case"before":case"after":u(h,p==="after"?g+1:g,v,!1);break;case"first_child":case"last_child":u(h,p==="first_child"?0:b,t,!1);break;case void 0:u(h,g+1,v,!1);break}};return(0,ff.jsx)(fe,{children:(0,ff.jsxs)(JR.PanelBody,{className:"block-editor-hooks__block-hooks",title:(0,Gz.__)("Plugins"),initialOpen:!0,children:[(0,ff.jsx)("p",{className:"block-editor-hooks__block-hooks-helptext",children:(0,Gz.__)("Manage the inclusion of blocks added automatically by plugins.")}),Object.keys(f).map(h=>(0,ff.jsxs)(QR.Fragment,{children:[(0,ff.jsx)("h3",{children:h}),f[h].map(p=>{let g=p.name in i;return(0,ff.jsx)(JR.ToggleControl,{checked:g,label:p.title,onChange:()=>{if(!g){let b=p.blockHooks[e];m((0,eO.createBlock)(p.name),b);return}d(i[p.name],!1)}},p.title)})]},h))]})})}var eme={edit:qAe,attributeKeys:["metadata"],hasSupport(){return!0}};var Wz=l(N(),1),tme=l($(),1),Lk=l(A(),1),ome=l(F(),1),rme=l(R(),1),nme=l(Z(),1);var mf=l(w(),1),ZAe=()=>(0,nme.useViewportMatch)("medium","<")?{}:{popoverProps:{placement:"left-start",offset:259}},XAe=({name:e,metadata:t})=>{let o=(0,rme.useContext)(xr),{removeAllBlockBindings:r}=El(),n=ZAe(),{bindableAttributes:i,hasCompatibleFields:s}=(0,ome.useSelect)(c=>{let{__experimentalBlockBindingsSupportedAttributes:u}=c(_).getSettings(),{getAllBlockBindingsSources:d,getBlockBindingsSourceFieldsList:f}=M(c(tme.store));return{bindableAttributes:u?.[e],hasCompatibleFields:Object.values(d()).some(m=>f(m,o)?.length>0)}},[e,o]);if(!i||i.length===0)return null;let{bindings:a}=t||{};return a===void 0&&!s?null:(0,mf.jsx)(fe,{group:"bindings",children:(0,mf.jsxs)(Lk.__experimentalToolsPanel,{label:(0,Wz.__)("Attributes"),resetAll:()=>{r()},dropdownMenuProps:n,className:"block-editor-bindings__panel",children:[(0,mf.jsx)(Lk.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,children:i.map(c=>(0,mf.jsx)($v,{attribute:c,blockName:e,binding:a?.[c]},c))}),(0,mf.jsx)(Lk.__experimentalText,{as:"div",variant:"muted",children:(0,mf.jsx)("p",{children:(0,Wz.__)("Attributes connected to custom fields or other dynamic data.")})})]})})},ime={edit:XAe,attributeKeys:["metadata"],hasSupport(e){return!["core/post-date","core/navigation-link","core/navigation-submenu"].includes(e)}};var sme=l(N(),1),ame=l(A(),1),rO=l(F(),1),e0=l($(),1),lme=l(R(),1);var tO=l(F(),1);function oO(e){let{isOpened:t,expandRevision:o}=(0,tO.useSelect)(i=>{let{isListViewPanelOpened:s,getListViewExpandRevision:a}=M(i(_));return{isOpened:s(e),expandRevision:a()}},[e]),{__unstableToggleListViewPanel:r}=(0,tO.useDispatch)(_);return{isOpened:t,expandRevision:o,handleToggle:i=>{r(e,i)}}}var Nk=l(w(),1),QAe="listView";function cme(e){return(0,e0.hasBlockSupport)(e,QAe)}function JAe({clientId:e,name:t}){let{isSelectionWithinCurrentSection:o}=(0,lme.useContext)(ur),{isOpened:r,expandRevision:n,handleToggle:i}=oO(e),{openListViewContentPanel:s}=M((0,rO.useDispatch)(_)),a=cme(t),{hasChildren:c,isNestedListView:u}=(0,rO.useSelect)(h=>{let{getBlockCount:p,getBlockParents:g,getBlockName:b}=h(_),k=g(e,!1).find(y=>{let S=b(y);return S==="core/navigation"||(0,e0.hasBlockSupport)(S,"listView")});return{hasChildren:!!p(e),isNestedListView:k}},[e]),f=(0,e0.getBlockType)(t)?.title||t;return!a||u?null:(0,Nk.jsx)(Sm,{group:"list",children:(0,Nk.jsxs)(ame.PanelBody,{title:o?f:void 0,opened:r,onToggle:i,children:[!c&&(0,Nk.jsx)("p",{className:"block-editor-block-inspector__no-blocks",children:(0,sme.__)("No items yet.")}),(0,Nk.jsx)(NS,{rootClientId:e,isExpanded:!0,description:f,showAppender:!0,onSelect:s},`${e}-${n}`)]})})}var ume={edit:JAe,hasSupport:cme,attributeKeys:[],supportsPatternEditing:!0};var dme=l(ut(),1),fme=l($(),1);function eLe(e){return e.__experimentalLabel||(0,fme.hasBlockSupport)(e,"renaming",!0)&&(e.__experimentalLabel=(o,{context:r})=>{let{metadata:n}=o;if((r==="list-view"||r==="breadcrumb")&&n?.name)return n.name}),e}(0,dme.addFilter)("blocks.registerBlockType","core/metadata/addLabelCallback",eLe);var mme=l(Z(),1),pme=l(ut(),1),hme=l(F(),1);var ps=l(w(),1);function tLe(e){Fz(e)}function oLe({clientId:e,layout:t}){let{isVisible:o,blockVisibility:r,deviceType:n,isAnyAncestorHidden:i}=(0,hme.useSelect)(a=>{let{isBlockSelected:c,hasSelectedInnerBlock:u,isDraggingBlocks:d,getTemplateLock:f,getBlockEditingMode:m,getBlockAttributes:h,getSettings:p}=a(_);if(!d()&&!c(e)||f(e)||m(e)!=="default"||u(e))return{isVisible:!1};let{isBlockParentHiddenAtViewport:g}=M(a(_)),b=h(e),k=p()?.[wi]?.toLowerCase()||Et.desktop.value;return{isVisible:!0,blockVisibility:b?.metadata?.blockVisibility,deviceType:k,isAnyAncestorHidden:g(e,k)}},[e]),{isBlockCurrentlyHidden:s}=Mi({blockVisibility:r,deviceType:n});return(0,ps.jsxs)(ps.Fragment,{children:[(0,ps.jsx)(tLe,{clientId:e}),o&&!s&&!i&&(0,ps.jsx)(Z_,{clientId:e,parentLayout:t})]})}var rLe=(0,mme.createHigherOrderComponent)(e=>function(o){return o.attributes.layout?.type!=="grid"?(0,ps.jsx)(e,{...o},"edit"):(0,ps.jsxs)(ps.Fragment,{children:[(0,ps.jsx)(oLe,{clientId:o.clientId,layout:o.attributes.layout}),(0,ps.jsx)(e,{...o},"edit")]})},"addGridVisualizerToBlockEdit");(0,pme.addFilter)("editor.BlockEdit","core/editor/grid-visualizer",rLe);var t0=l($(),1),bme=l(A(),1),kme=l(F(),1);var iO=l(R(),1),vme=l(N(),1);function gme(e){let t=[],o=[];return Object.entries(e).forEach(([r,n])=>{if(!n.autoGenerateControl)return;let i=nLe(r,n);i&&(t.push(i),o.push(r))}),{fields:t,form:{fields:o}}}function nLe(e,t){let o=t.type,r={id:e,label:t.label||e,type:o==="string"?"text":o};return t.enum&&Array.isArray(t.enum)&&(r.elements=t.enum.map(n=>({value:n,label:String(n)}))),r}var nO=l(w(),1);function iLe(e){return e?Object.values(e).some(t=>t?.autoGenerateControl):!1}function sLe({name:e,clientId:t,setAttributes:o}){let r=ao(),n=(0,iO.useContext)(xr),i=(0,kme.useSelect)(u=>{let d=u(_).getBlockAttributes(t);if(!d?.metadata?.bindings)return d;let{getBlockBindingsSource:f}=M(u(t0.store));return Object.entries(d.metadata.bindings).reduce((m,[h,p])=>{let g=f(p.source);if(!g)return m;let b=g.getValues({select:u,context:n,bindings:{[h]:p}});return{...m,...b}},d)},[n,t]),s=(0,t0.getBlockType)(e),{fields:a,form:c}=(0,iO.useMemo)(()=>s?.attributes?gme(s.attributes):{fields:[],form:{fields:[]}},[s?.attributes]);return r!=="default"||!a||a.length===0?null:(0,nO.jsx)(fe,{children:(0,nO.jsx)(bme.PanelBody,{title:(0,vme.__)("Settings"),children:(0,nO.jsx)(D_,{data:i,fields:a,form:c,onChange:o})})})}var yme={edit:sLe,attributeKeys:[],hasSupport(e){let t=(0,t0.getBlockType)(e);return iLe(t?.attributes)}};function $z(e){let{style:t}=e,o=t?.dimensions||{},r=bi({dimensions:o});return{className:o.aspectRatio?"has-aspect-ratio":void 0,style:r}}function sO(e){let t=e.style?.border||{};return{className:YF(e)||void 0,style:bi({border:t})}}function Kz(e){let{colors:t}=wd(),o=sO(e),{borderColor:r}=e;if(r){let n=lp({colors:t,namedColor:r});o.style.borderColor=n.color}return o}function Yz(e){let t=e.style?.shadow||"";return{style:bi({shadow:t})}}var qz=l(R(),1);function aO(e){let{backgroundColor:t,textColor:o,gradient:r,style:n}=e,i=_i("background-color",t),s=_i("color",o),a=th(r),c=a||n?.color?.gradient,u=V(s,a,{[i]:!c&&!!i,"has-text-color":o||n?.color?.text,"has-background":t||n?.color?.background||r||n?.color?.gradient,"has-link-color":n?.elements?.link?.color}),d=n?.color||{},f=bi({color:d});return{className:u||void 0,style:f}}function Zz(e){let{backgroundColor:t,textColor:o,gradient:r}=e,[n,i,s,a,c,u]=me("color.palette.custom","color.palette.theme","color.palette.default","color.gradients.custom","color.gradients.theme","color.gradients.default"),d=(0,qz.useMemo)(()=>[...n||[],...i||[],...s||[]],[n,i,s]),f=(0,qz.useMemo)(()=>[...a||[],...c||[],...u||[]],[a,c,u]),m=aO(e);if(t){let h=da(d,t);m.style.backgroundColor=h.color}if(r&&(m.style.background=Gw(f,r)),o){let h=da(d,o);m.style.color=h.color}return m}function Xz(e){let{style:t}=e,o=t?.spacing||{};return{style:bi({spacing:o})}}var Sme=l(A(),1);var{kebabCase:aLe}=M(Sme.privateApis);function Qz(e,t){let o=e?.style?.typography||{};o={...o,fontSize:ec({size:e?.style?.typography?.fontSize},t)};let r=bi({typography:o}),n=e?.fontFamily?`has-${aLe(e.fontFamily)}-font-family`:"",i=e?.style?.typography?.textAlign?`has-text-align-${e?.style?.typography?.textAlign}`:"";return{className:V(n,i,hu(e?.fontSize)),style:r}}var lO=l(R(),1);function Jz(e){let[t,o]=(0,lO.useState)(e);return(0,lO.useEffect)(()=>{e&&o(e)},[e]),t}dle([w2,NR,B4,hz,jR,WR,Pz,DR,uV,Hfe,eme,ime,jz,Ale,qde,ume,yme].filter(Boolean));fle([w2,NR,yae,jR,t4,Tfe,Pz,gz,kz,DR,qF,WR,uV,ZX,jz]);mle([w2,NR,B4,Dle,hz,qF,WR,DR,t4,jR,gz,kz]);var _me={button:"wp-element-button",caption:"wp-element-caption"},lLe=e=>_me[e]?_me[e]:"";var xme=()=>"";var Mk=l(R(),1),o0=l($(),1),t6=l(dr(),1);var wme=l(w(),1);function o6(e,t,o){if(e==null||e===!1)return;if(Array.isArray(e))return e6(e,t,o);switch(typeof e){case"string":case"number":return}let{type:r,props:n}=e;switch(r){case Mk.StrictMode:case Mk.Fragment:return e6(n.children,t,o);case Mk.RawHTML:return;case tS.Content:return Cme(t,o);case o_:t.push(n.value);return}switch(typeof r){case"string":return typeof n.children<"u"?e6(n.children,t,o):void 0;case"function":let i=r.prototype&&typeof r.prototype.render=="function"?new r(n).render():r(n);return o6(i,t,o)}}function e6(e,...t){e=Array.isArray(e)?e:[e];for(let o=0;o<e.length;o++)o6(e[o],...t)}function Cme(e,t){for(let o=0;o<t.length;o++){let{name:r,attributes:n,innerBlocks:i}=t[o],s=(0,o0.getSaveElement)(r,n,(0,wme.jsx)(tS.Content,{}));o6(s,e,i)}}function Bme(e=[]){o0.__unstableGetBlockProps.skipFilters=!0;let t=[];return Cme(t,e),o0.__unstableGetBlockProps.skipFilters=!1,t.map(o=>o instanceof t6.RichTextData?o:t6.RichTextData.fromHTMLString(o))}var Eme=l(A(),1);var r6=l(w(),1);function Tme({clientId:e,resizableBoxProps:t,...o}){return(0,r6.jsx)(Hi,{clientId:e,__unstablePopoverSlot:"block-toolbar",...o,children:(0,r6.jsx)(Eme.ResizableBox,{...t})})}var n0=l(R(),1),cO=l(F(),1),la=l(A(),1),r0=l(N(),1);var hs=l(w(),1);function Ime({rules:e}){let[t,o]=(0,n0.useState)(!1),{clientIds:r,selectPrevious:n,message:i}=(0,cO.useSelect)(p=>M(p(_)).getRemovalPromptData()),{clearBlockRemovalPrompt:s,setBlockRemovalRules:a,privateRemoveBlocks:c}=M((0,cO.useDispatch)(_));if((0,n0.useEffect)(()=>(a(e),()=>{a()}),[e,a]),(0,n0.useEffect)(()=>{o(!1)},[r]),!i)return;let u=typeof i=="object"&&i!==null,d=u?i.description:i,f=u&&i.requireConfirmation,m=f&&!t,h=()=>{c(r,n,!0),s()};return(0,hs.jsx)(la.Modal,{title:(0,r0.__)("Confirm deletion"),onRequestClose:s,size:"medium",children:(0,hs.jsxs)(la.__experimentalVStack,{spacing:4,children:[(0,hs.jsxs)("div",{children:[(0,hs.jsx)("p",{children:d}),u&&(i.warning||i.subtext)&&(0,hs.jsxs)("p",{children:[i.warning&&(0,hs.jsx)("strong",{children:i.warning}),i.warning&&i.subtext&&" ",i.subtext]})]}),f&&(0,hs.jsx)(la.CheckboxControl,{label:(0,r0.__)("I understand the consequences"),checked:t,onChange:o}),(0,hs.jsxs)(la.__experimentalHStack,{justify:"right",children:[(0,hs.jsx)(la.Button,{variant:"tertiary",onClick:s,__next40pxDefaultSize:!0,children:(0,r0.__)("Cancel")}),(0,hs.jsx)(la.Button,{variant:"primary",onClick:h,disabled:m,accessibleWhenDisabled:!0,__next40pxDefaultSize:!0,children:(0,r0.__)("Delete")})]})]})})}var n6=l(R(),1);var Dk=l(A(),1),Rme=l(R(),1),Vn=l(N(),1),uO=l(w(),1),Pme=[{value:"fill",label:(0,Vn._x)("Fill","Scale option for dimensions control"),help:(0,Vn.__)("Fill the space by stretching the content.")},{value:"contain",label:(0,Vn._x)("Contain","Scale option for dimensions control"),help:(0,Vn.__)("Fit the content to the space without clipping.")},{value:"cover",label:(0,Vn._x)("Cover","Scale option for dimensions control"),help:(0,Vn.__)("Fill the space by clipping what doesn't fit.")},{value:"none",label:(0,Vn._x)("None","Scale option for dimensions control"),help:(0,Vn.__)("Do not adjust the sizing of the content. Content that is too large will be clipped, and content that is too small will have additional padding.")},{value:"scale-down",label:(0,Vn._x)("Scale down","Scale option for dimensions control"),help:(0,Vn.__)("Scale down the content to fit the space if it is too big. Content that is too small will have additional padding.")}];function Ome({panelId:e,value:t,onChange:o,options:r=Pme,defaultValue:n=Pme[0].value,isShownByDefault:i=!0}){let s=t??"fill",a=(0,Rme.useMemo)(()=>r.reduce((c,u)=>(c[u.value]=u.help,c),{}),[r]);return(0,uO.jsx)(Dk.__experimentalToolsPanelItem,{label:(0,Vn._x)("Scale","Image scaling options"),isShownByDefault:i,hasValue:()=>s!==n,onDeselect:()=>o(n),panelId:e,children:(0,uO.jsx)(Dk.__experimentalToggleGroupControl,{label:(0,Vn._x)("Scale","Image scaling options"),isBlock:!0,help:a[s],value:s,onChange:o,size:"__unstable-large",children:r.map(c=>(0,uO.jsx)(Dk.__experimentalToggleGroupControlOption,{...c},c.value))})})}var Vk=l(A(),1),wp=l(N(),1),Uc=l(w(),1);function Ame({panelId:e,value:t={},onChange:o=()=>{},units:r,isShownByDefault:n=!0}){let i=t.width==="auto"?"":t.width??"",s=t.height==="auto"?"":t.height??"",a=c=>u=>{let d={...t};u?d[c]=u:delete d[c],o(d)};return(0,Uc.jsxs)(Uc.Fragment,{children:[(0,Uc.jsx)(Vk.__experimentalToolsPanelItem,{style:{gridColumn:"span 1"},label:(0,wp.__)("Width"),isShownByDefault:n,hasValue:()=>i!=="",onDeselect:a("width"),panelId:e,children:(0,Uc.jsx)(Vk.__experimentalUnitControl,{label:(0,wp.__)("Width"),placeholder:(0,wp.__)("Auto"),labelPosition:"top",units:r,min:0,value:i,onChange:a("width"),size:"__unstable-large"})}),(0,Uc.jsx)(Vk.__experimentalToolsPanelItem,{style:{gridColumn:"span 1"},label:(0,wp.__)("Height"),isShownByDefault:n,hasValue:()=>s!=="",onDeselect:a("height"),panelId:e,children:(0,Uc.jsx)(Vk.__experimentalUnitControl,{label:(0,wp.__)("Height"),placeholder:(0,wp.__)("Auto"),labelPosition:"top",units:r,min:0,value:s,onChange:a("height"),size:"__unstable-large"})})]})}var pf=l(w(),1);function cLe({panelId:e,value:t={},onChange:o=()=>{},aspectRatioOptions:r,defaultAspectRatio:n="auto",scaleOptions:i,defaultScale:s="fill",unitsOptions:a,tools:c=["aspectRatio","widthHeight","scale"]}){let u=t.width===void 0||t.width==="auto"?null:t.width,d=t.height===void 0||t.height==="auto"?null:t.height,f=t.aspectRatio===void 0||t.aspectRatio==="auto"?null:t.aspectRatio,m=t.scale===void 0||t.scale==="fill"?null:t.scale,[h,p]=(0,n6.useState)(m),[g,b]=(0,n6.useState)(f),v=u&&d?"custom":g,k=f||u&&d;return(0,pf.jsxs)(pf.Fragment,{children:[c.includes("aspectRatio")&&(0,pf.jsx)(NP,{panelId:e,options:r,defaultValue:n,value:v,onChange:y=>{let S={...t};y=y==="auto"?null:y,b(y),y?S.aspectRatio=y:delete S.aspectRatio,y?h?S.scale=h:(S.scale=s,p(s)):delete S.scale,y!=="custom"&&u&&d&&delete S.height,o(S)}}),c.includes("widthHeight")&&(0,pf.jsx)(Ame,{panelId:e,units:a,value:{width:u,height:d},onChange:({width:y,height:S})=>{let x={...t};y=y==="auto"?null:y,S=S==="auto"?null:S,y?x.width=y:delete x.width,S?x.height=S:delete x.height,y&&S?delete x.aspectRatio:g&&(x.aspectRatio=g),!g&&!!y!=!!S?delete x.scale:h?x.scale=h:(x.scale=s,p(s)),o(x)}}),c.includes("scale")&&k&&(0,pf.jsx)(Ome,{panelId:e,options:i,defaultValue:s,value:h,onChange:y=>{let S={...t};y=y==="fill"?null:y,p(y),y?S.scale=y:delete S.scale,o(S)}})]})}var Lme=cLe;var dO=l(A(),1),Hc=l(N(),1),i6=l(w(),1),Nme=[{label:(0,Hc._x)("Thumbnail","Image size option for resolution control"),value:"thumbnail"},{label:(0,Hc._x)("Medium","Image size option for resolution control"),value:"medium"},{label:(0,Hc._x)("Large","Image size option for resolution control"),value:"large"},{label:(0,Hc._x)("Full Size","Image size option for resolution control"),value:"full"}];function Mme({panelId:e,value:t,onChange:o,options:r=Nme,defaultValue:n=Nme[0].value,isShownByDefault:i=!0,resetAllFilter:s}){let a=t??n;return(0,i6.jsx)(dO.__experimentalToolsPanelItem,{hasValue:()=>a!==n,label:(0,Hc.__)("Resolution"),onDeselect:()=>o(n),isShownByDefault:i,panelId:e,resetAllFilter:s,children:(0,i6.jsx)(dO.SelectControl,{label:(0,Hc.__)("Resolution"),value:a,options:r,onChange:o,help:(0,Hc.__)("Select the size of the source image."),size:"__unstable-large"})})}var Cp=l(N(),1),Fk=l(A(),1),Vme=l(F(),1);var ca=l(N(),1),Dme={a:(0,ca.__)("The <a> element should be used for links that navigate to a different page or to a different section within the same page."),article:(0,ca.__)("The <article> element should represent a self-contained, syndicatable portion of the document."),aside:(0,ca.__)("The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content."),button:(0,ca.__)("The <button> element should be used for interactive controls that perform an action on the current page, such as opening a modal or toggling content visibility."),div:(0,ca.__)("The <div> element should only be used if the block is a design element with no semantic meaning."),footer:(0,ca.__)("The <footer> element should represent a footer for its nearest sectioning element (e.g.: <section>, <article>, <main> etc.)."),header:(0,ca.__)("The <header> element should represent introductory content, typically a group of introductory or navigational aids."),main:(0,ca.__)("The <main> element should be used for the primary content of your document only."),nav:(0,ca.__)("The <nav> element should be used to identify groups of links that are intended to be used for website or page content navigation."),section:(0,ca.__)("The <section> element should represent a standalone portion of the document that can't be better represented by another element.")};var i0=l(w(),1);function Fme({tagName:e,onChange:t,clientId:o,options:r=[{label:(0,Cp.__)("Default (<div>)"),value:"div"},{label:"<header>",value:"header"},{label:"<main>",value:"main"},{label:"<section>",value:"section"},{label:"<article>",value:"article"},{label:"<aside>",value:"aside"},{label:"<footer>",value:"footer"}]}){let n=!!o&&r.some(a=>a.value==="main"),i=(0,Vme.useSelect)(a=>{if(!n)return!1;let{getClientIdsWithDescendants:c,getBlockAttributes:u}=a(_);return c().some(d=>d===o?!1:u(d)?.tagName==="main")},[o,n]),s=r.map(a=>a.value==="main"&&i&&e!=="main"?{...a,disabled:!0,label:(0,Cp.sprintf)((0,Cp.__)("%s (Already in use)"),a.label)}:a);return(0,i0.jsxs)(Fk.__experimentalVStack,{spacing:2,className:"block-editor-html-element-control",children:[(0,i0.jsx)(Fk.SelectControl,{__next40pxDefaultSize:!0,label:(0,Cp.__)("HTML element"),options:s,value:e,onChange:t,help:Dme[e]}),e==="main"&&i&&(0,i0.jsx)(Fk.Notice,{status:"warning",isDismissible:!1,children:(0,Cp.__)("Multiple <main> elements detected. The duplicate may be in your content or template. This is not valid HTML and may cause accessibility issues. Please change this HTML element.")})]})}var gs=l(A(),1),zk=l(R(),1),fO=l(N(),1);var Fn=l(A(),1);var zme=l(Fe(),1);var vi=l(w(),1),{Badge:uLe}=M(Fn.privateApis);function jme({title:e,url:t,image:o,badges:r}){return(0,vi.jsxs)(Fn.__experimentalHStack,{justify:"space-between",alignment:"top",children:[(0,vi.jsx)(Fn.FlexItem,{className:"link-preview-button__content",children:(0,vi.jsxs)(Fn.__experimentalHStack,{alignment:"top",children:[o&&(0,vi.jsx)(Fn.FlexItem,{className:"link-preview-button__image-container",children:(0,vi.jsx)("img",{className:"link-preview-button__image",src:o,alt:""})}),(0,vi.jsxs)(Fn.__experimentalVStack,{className:"link-preview-button__details",alignment:"topLeft",children:[(0,vi.jsx)(Fn.__experimentalTruncate,{numberOfLines:1,className:"link-preview-button__title",children:(0,zme.__unstableStripHTML)(e)}),t&&(0,vi.jsx)(Fn.__experimentalTruncate,{numberOfLines:1,className:"link-preview-button__hint",children:t}),r&&r.length>0&&(0,vi.jsx)(Fn.__experimentalHStack,{className:"link-preview-button__badges",alignment:"left",children:r.map(n=>(0,vi.jsx)(uLe,{intent:n.intent,children:n.label},`${n.label}|${n.intent}`))})]})]})}),(0,vi.jsx)(we,{icon:zn,className:"link-preview-button__icon"})]})}var yi=l(w(),1);function s6({preview:e,onSelect:t,suggestionsQuery:o,label:r,help:n}){let[i,s]=(0,zk.useState)(!1),a=(0,zk.useId)(),c=`link-picker-title-${a}`,u=`link-picker-description-${a}`,d=(0,zk.useRef)(null),{baseControlProps:f,controlProps:m}=(0,gs.useBaseControlProps)({help:n}),h=p=>{if(s(!1),p){let g={url:p.url,kind:p.kind,type:p.type,id:p.id,title:p.title};t(g)}};return(0,yi.jsxs)(gs.BaseControl,{...f,children:[(0,yi.jsx)(gs.BaseControl.VisualLabel,{children:r}),(0,yi.jsxs)(gs.Button,{ref:d,onClick:()=>s(!i),"aria-haspopup":"dialog","aria-expanded":i,"aria-describedby":m["aria-describedby"],variant:"secondary",__next40pxDefaultSize:!0,className:"link-preview-button",children:[r&&(0,yi.jsxs)(gs.VisuallyHidden,{children:[r,":"]}),(0,yi.jsx)(jme,{title:e.title||(0,fO.__)("Add link"),url:e.url,image:e.image,badges:e.badges})]}),i&&(0,yi.jsx)(gs.Popover,{anchor:d.current,onClose:()=>s(!1),placement:"left-start",offset:36,shift:!0,children:(0,yi.jsxs)("div",{role:"dialog","aria-labelledby":c,"aria-describedby":u,children:[(0,yi.jsxs)(gs.VisuallyHidden,{children:[(0,yi.jsx)("h2",{id:c,children:(0,fO.__)("Select a link")}),(0,yi.jsx)("p",{id:u,children:(0,fO.__)("Search for and add a link to the navigation item.")})]}),(0,yi.jsx)(Pd,{value:null,onChange:h,suggestionsQuery:o,showInitialSuggestions:!0,forceIsEditingLink:!0,settings:[]})]})})]})}var a6={};T6(a6,{...WF,ExperimentalBlockCanvas:r3,BlockCanvasCover:xT,ExperimentalBlockEditorProvider:Ph,getDuotoneFilter:UR,getRichTextValues:Bme,PrivateQuickInserter:IB,extractWords:Yw,getNormalizedSearchTerms:Fv,normalizeString:Vv,PrivateListView:NS,ResizableBoxPopover:Tme,InspectorControlsLastItem:k2,useHasBlockToolbar:qE,cleanEmptyObject:Me,usePrivateStyleOverride:tc,BlockQuickNavigation:g2,LayoutStyle:pH,BlockManager:B2,BlockRemovalWarningModal:Ime,useLayoutClasses:YR,useLayoutStyles:Nz,DimensionsTool:Lme,ResolutionTool:Mme,TabbedSidebar:CB,TextAlignmentControl:PP,usesContextKey:vF,useFlashEditableBlocks:o1,HTMLElementControl:Fme,useZoomOut:Gy,globalStylesDataKey:xi,globalStylesLinksDataKey:y0,selectBlockPatternsKey:qc,requiresWrapperOnCopy:VD,PrivateRichText:r_,PrivateInserterLibrary:l4,reusableBlocksSelectKey:S0,PrivateBlockPopover:pm,PrivatePublishDateTimePicker:g4,useSpacingSizes:fP,useBlockDisplayTitle:zr,__unstableBlockStyleVariationOverridesWithConfig:UV,setBackgroundStyleDefaults:a2,sectionRootClientIdKey:Zc,CommentIconSlotFill:CE,CommentIconToolbarSlotFill:UE,mediaEditKey:_0,getMediaSelectKey:x0,deviceTypeKey:wi,isIsolatedEditorKey:Xc,isNavigationOverlayContextKey:w0,mediaUploadOnSuccessKey:C0,useBlockElement:Xe,useBlockElementRef:$f,LinkPicker:s6,useRemoteUrlData:MI,PrivateBlockContext:ur,useListViewPanelState:oO,isHashLink:gf,isRelativePath:bf});return qme(dLe);})(); /*! Bundled license information: autosize/dist/autosize.js: (*! autosize 4.0.2 license: MIT http://www.jacklmoore.com/autosize *) normalize-wheel/src/isEventSupported.js: (** * Checks if an event is supported in the current execution environment. * * NOTE: This will not work correctly for non-generic events such as `change`, * `reset`, `load`, `error`, and `select`. * * Borrows from Modernizr. * * @param {string} eventNameSuffix Event name, e.g. "click". * @param {?boolean} capture Check if the capture phase is supported. * @return {boolean} True if the event is supported. * @internal * @license Modernizr 3.0.0pre (Custom Build) | MIT *) */ redux-routine.min.js 0000644 00000023166 15206720414 0010507 0 ustar 00 "use strict";var wp;(wp||={}).reduxRoutine=(()=>{var fr=Object.create;var S=Object.defineProperty;var cr=Object.getOwnPropertyDescriptor;var sr=Object.getOwnPropertyNames;var lr=Object.getPrototypeOf,pr=Object.prototype.hasOwnProperty;var g=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),dr=(e,r)=>{for(var t in r)S(e,t,{get:r[t],enumerable:!0})},F=(e,r,t,u)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of sr(r))!pr.call(e,n)&&n!==t&&S(e,n,{get:()=>r[n],enumerable:!(u=cr(r,n))||u.enumerable});return e};var yr=(e,r,t)=>(t=e!=null?fr(lr(e)):{},F(r||!e||!e.__esModule?S(t,"default",{value:e,enumerable:!0}):t,e)),mr=e=>F(S({},"__esModule",{value:!0}),e);var C=g(w=>{"use strict";Object.defineProperty(w,"__esModule",{value:!0});var br={all:Symbol("all"),error:Symbol("error"),fork:Symbol("fork"),join:Symbol("join"),race:Symbol("race"),call:Symbol("call"),cps:Symbol("cps"),subscribe:Symbol("subscribe")};w.default=br});var E=g(c=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});c.createChannel=c.subscribe=c.cps=c.apply=c.call=c.invoke=c.delay=c.race=c.join=c.fork=c.error=c.all=void 0;var vr=C(),h=hr(vr);function hr(e){return e&&e.__esModule?e:{default:e}}var oe=c.all=function(r){return{type:h.default.all,value:r}},ie=c.error=function(r){return{type:h.default.error,error:r}},fe=c.fork=function(r){for(var t=arguments.length,u=Array(t>1?t-1:0),n=1;n<t;n++)u[n-1]=arguments[n];return{type:h.default.fork,iterator:r,args:u}},ce=c.join=function(r){return{type:h.default.join,task:r}},se=c.race=function(r){return{type:h.default.race,competitors:r}},le=c.delay=function(r){return new Promise(function(t){setTimeout(function(){return t(!0)},r)})},pe=c.invoke=function(r){for(var t=arguments.length,u=Array(t>1?t-1:0),n=1;n<t;n++)u[n-1]=arguments[n];return{type:h.default.call,func:r,context:null,args:u}},de=c.call=function(r,t){for(var u=arguments.length,n=Array(u>2?u-2:0),a=2;a<u;a++)n[a-2]=arguments[a];return{type:h.default.call,func:r,context:t,args:n}},ye=c.apply=function(r,t,u){return{type:h.default.call,func:r,context:t,args:u}},me=c.cps=function(r){for(var t=arguments.length,u=Array(t>1?t-1:0),n=1;n<t;n++)u[n-1]=arguments[n];return{type:h.default.cps,func:r,args:u}},be=c.subscribe=function(r){return{type:h.default.subscribe,channel:r}},ve=c.createChannel=function(r){var t=[],u=function(o){return t.push(o),function(){return t.splice(t.indexOf(o),1)}},n=function(o){return t.forEach(function(f){return f(o)})};return r(n),{subscribe:u}}});var q=g(D=>{"use strict";Object.defineProperty(D,"__esModule",{value:!0});var gr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol?"symbol":typeof e},_r=C(),j=jr(_r);function jr(e){return e&&e.__esModule?e:{default:e}}var m={obj:function(r){return(typeof r>"u"?"undefined":gr(r))==="object"&&!!r},all:function(r){return m.obj(r)&&r.type===j.default.all},error:function(r){return m.obj(r)&&r.type===j.default.error},array:Array.isArray,func:function(r){return typeof r=="function"},promise:function(r){return r&&m.func(r.then)},iterator:function(r){return r&&m.func(r.next)&&m.func(r.throw)},fork:function(r){return m.obj(r)&&r.type===j.default.fork},join:function(r){return m.obj(r)&&r.type===j.default.join},race:function(r){return m.obj(r)&&r.type===j.default.race},call:function(r){return m.obj(r)&&r.type===j.default.call},cps:function(r){return m.obj(r)&&r.type===j.default.cps},subscribe:function(r){return m.obj(r)&&r.type===j.default.subscribe},channel:function(r){return m.obj(r)&&m.func(r.subscribe)}};D.default=m});var I=g(b=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});b.iterator=b.array=b.object=b.error=b.any=void 0;var xr=q(),A=Or(xr);function Or(e){return e&&e.__esModule?e:{default:e}}var kr=b.any=function(r,t,u,n){return n(r),!0},Ar=b.error=function(r,t,u,n,a){return A.default.error(r)?(a(r.error),!0):!1},qr=b.object=function(r,t,u,n,a){if(!A.default.all(r)||!A.default.obj(r.value))return!1;var o={},f=Object.keys(r.value),l=0,y=!1,s=function(d,k){y||(o[d]=k,l++,l===f.length&&n(o))},p=function(d,k){y||(y=!0,a(k))};return f.map(function(i){u(r.value[i],function(d){return s(i,d)},function(d){return p(i,d)})}),!0},Rr=b.array=function(r,t,u,n,a){if(!A.default.all(r)||!A.default.array(r.value))return!1;var o=[],f=0,l=!1,y=function(i,d){l||(o[i]=d,f++,f===r.value.length&&n(o))},s=function(i,d){l||(l=!0,a(d))};return r.value.map(function(p,i){u(p,function(d){return y(i,d)},function(d){return s(i,d)})}),!0},Sr=b.iterator=function(r,t,u,n,a){return A.default.iterator(r)?(u(r,t,a),!0):!1};b.default=[Ar,Sr,Rr,qr,kr]});var L=g(N=>{"use strict";Object.defineProperty(N,"__esModule",{value:!0});var Mr=I(),Pr=K(Mr),wr=q(),Cr=K(wr);function K(e){return e&&e.__esModule?e:{default:e}}function J(e){if(Array.isArray(e)){for(var r=0,t=Array(e.length);r<e.length;r++)t[r]=e[r];return t}else return Array.from(e)}var Er=function(){var r=arguments.length<=0||arguments[0]===void 0?[]:arguments[0],t=[].concat(J(r),J(Pr.default)),u=function n(a){var o=arguments.length<=1||arguments[1]===void 0?function(){}:arguments[1],f=arguments.length<=2||arguments[2]===void 0?function(){}:arguments[2],l=function(p){var i=function(P){return function(R){try{var z=P?p.throw(R):p.next(R),B=z.value,or=z.done;if(or)return o(B);d(B)}catch(ir){return f(ir)}}},d=function k(P){t.some(function(R){return R(P,k,n,i(!1),i(!0))})};i(!1)()},y=Cr.default.iterator(a)?a:regeneratorRuntime.mark(function s(){return regeneratorRuntime.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,a;case 2:return i.abrupt("return",i.sent);case 3:case"end":return i.stop()}},s,this)})();l(y,o,f)};return u};N.default=Er});var Q=g(T=>{"use strict";Object.defineProperty(T,"__esModule",{value:!0});var Dr=function(){var r=[];return{subscribe:function(u){return r.push(u),function(){r=r.filter(function(n){return n!==u})}},dispatch:function(u){r.slice().forEach(function(n){return n(u)})}}};T.default=Dr});var W=g(v=>{"use strict";Object.defineProperty(v,"__esModule",{value:!0});v.race=v.join=v.fork=v.promise=void 0;var Nr=q(),x=U(Nr),Tr=E(),Gr=Q(),Vr=U(Gr);function U(e){return e&&e.__esModule?e:{default:e}}var $r=v.promise=function(r,t,u,n,a){return x.default.promise(r)?(r.then(t,a),!0):!1},G=new Map,zr=v.fork=function(r,t,u){if(!x.default.fork(r))return!1;var n=Symbol("fork"),a=(0,Vr.default)();G.set(n,a),u(r.iterator.apply(null,r.args),function(f){return a.dispatch(f)},function(f){return a.dispatch((0,Tr.error)(f))});var o=a.subscribe(function(){o(),G.delete(n)});return t(n),!0},Br=v.join=function(r,t,u,n,a){if(!x.default.join(r))return!1;var o=G.get(r.task);return o?(function(){var f=o.subscribe(function(l){f(),t(l)})})():a("join error : task not found"),!0},Fr=v.race=function(r,t,u,n,a){if(!x.default.race(r))return!1;var o=!1,f=function(s,p,i){o||(o=!0,s[p]=i,t(s))},l=function(s){o||a(s)};return x.default.array(r.competitors)?(function(){var y=r.competitors.map(function(){return!1});r.competitors.forEach(function(s,p){u(s,function(i){return f(y,p,i)},l)})})():(function(){var y=Object.keys(r.competitors).reduce(function(s,p){return s[p]=!1,s},{});Object.keys(r.competitors).forEach(function(s){u(r.competitors[s],function(p){return f(y,s,p)},l)})})(),!0},Hr=function(r,t){if(!x.default.subscribe(r))return!1;if(!x.default.channel(r.channel))throw new Error('the first argument of "subscribe" must be a valid channel');var u=r.channel.subscribe(function(n){u&&u(),t(n)});return!0};v.default=[$r,zr,Br,Fr,Hr]});var Y=g(O=>{"use strict";Object.defineProperty(O,"__esModule",{value:!0});O.cps=O.call=void 0;var Ir=q(),X=Jr(Ir);function Jr(e){return e&&e.__esModule?e:{default:e}}function Kr(e){if(Array.isArray(e)){for(var r=0,t=Array(e.length);r<e.length;r++)t[r]=e[r];return t}else return Array.from(e)}var Lr=O.call=function(r,t,u,n,a){if(!X.default.call(r))return!1;try{t(r.func.apply(r.context,r.args))}catch(o){a(o)}return!0},Qr=O.cps=function(r,t,u,n,a){var o;return X.default.cps(r)?((o=r.func).call.apply(o,[null].concat(Kr(r.args),[function(f,l){f?a(f):t(l)}])),!0):!1};O.default=[Lr,Qr]});var rr=g(_=>{"use strict";Object.defineProperty(_,"__esModule",{value:!0});_.wrapControls=_.asyncControls=_.create=void 0;var Z=E();Object.keys(Z).forEach(function(e){e!=="default"&&Object.defineProperty(_,e,{enumerable:!0,get:function(){return Z[e]}})});var Ur=L(),Wr=V(Ur),Xr=W(),Yr=V(Xr),Zr=Y(),re=V(Zr);function V(e){return e&&e.__esModule?e:{default:e}}_.create=Wr.default;_.asyncControls=Yr.default;_.wrapControls=re.default});var te={};dr(te,{default:()=>ee});function H(e){return!!e&&typeof e[Symbol.iterator]=="function"&&typeof e.next=="function"}var ur=yr(rr(),1);function $(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function er(e){return Object.prototype.toString.call(e)==="[object Object]"}function tr(e){var r,t;return er(e)===!1?!1:(r=e.constructor,r===void 0?!0:(t=r.prototype,!(er(t)===!1||t.hasOwnProperty("isPrototypeOf")===!1)))}function M(e){return tr(e)&&typeof e.type=="string"}function nr(e,r){return M(e)&&e.type===r}function ar(e={},r){let t=Object.entries(e).map(([a,o])=>(f,l,y,s,p)=>{if(!nr(f,a))return!1;let i=o(f);return $(i)?i.then(s,p):s(i),!0}),u=(a,o)=>M(a)?(r(a),o(),!0):!1;t.push(u);let n=(0,ur.create)(t);return a=>new Promise((o,f)=>n(a,l=>{M(l)&&r(l),o(l)},f))}function ee(e={}){return r=>{let t=ar(e,r.dispatch);return u=>n=>H(n)?t(n):u(n)}}return mr(te);})(); /*! Bundled license information: is-plain-object/dist/is-plain-object.mjs: (*! * is-plain-object <https://github.com/jonschlinkert/is-plain-object> * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. *) */ if (typeof wp.reduxRoutine === 'object' && wp.reduxRoutine.default) { wp.reduxRoutine = wp.reduxRoutine.default; } plugins.js 0000644 00000027257 15206720414 0006601 0 ustar 00 "use strict"; var wp; (wp ||= {}).plugins = (() => { 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 __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; 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 )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // package-external:@wordpress/element var require_element = __commonJS({ "package-external:@wordpress/element"(exports, module) { module.exports = window.wp.element; } }); // package-external:@wordpress/hooks var require_hooks = __commonJS({ "package-external:@wordpress/hooks"(exports, module) { module.exports = window.wp.hooks; } }); // package-external:@wordpress/is-shallow-equal var require_is_shallow_equal = __commonJS({ "package-external:@wordpress/is-shallow-equal"(exports, module) { module.exports = window.wp.isShallowEqual; } }); // package-external:@wordpress/compose var require_compose = __commonJS({ "package-external:@wordpress/compose"(exports, module) { module.exports = window.wp.compose; } }); // package-external:@wordpress/deprecated var require_deprecated = __commonJS({ "package-external:@wordpress/deprecated"(exports, module) { module.exports = window.wp.deprecated; } }); // vendor-external:react/jsx-runtime var require_jsx_runtime = __commonJS({ "vendor-external:react/jsx-runtime"(exports, module) { module.exports = window.ReactJSXRuntime; } }); // package-external:@wordpress/primitives var require_primitives = __commonJS({ "package-external:@wordpress/primitives"(exports, module) { module.exports = window.wp.primitives; } }); // packages/plugins/build-module/index.mjs var index_exports = {}; __export(index_exports, { PluginArea: () => plugin_area_default, getPlugin: () => getPlugin, getPlugins: () => getPlugins, registerPlugin: () => registerPlugin, unregisterPlugin: () => unregisterPlugin, usePluginContext: () => usePluginContext, withPluginContext: () => withPluginContext }); // node_modules/memize/dist/index.js function memize(fn, options) { var size = 0; var head; var tail; options = options || {}; function memoized() { var node = head, len = arguments.length, args, i; searchCache: while (node) { if (node.args.length !== arguments.length) { node = node.next; continue; } for (i = 0; i < len; i++) { if (node.args[i] !== arguments[i]) { node = node.next; continue searchCache; } } if (node !== head) { if (node === tail) { tail = node.prev; } node.prev.next = node.next; if (node.next) { node.next.prev = node.prev; } node.next = head; node.prev = null; head.prev = node; head = node; } return node.val; } args = new Array(len); for (i = 0; i < len; i++) { args[i] = arguments[i]; } node = { args, // Generate the result from original function val: fn.apply(null, args) }; if (head) { head.prev = node; node.next = head; } else { tail = node; } if (size === /** @type {MemizeOptions} */ options.maxSize) { tail = /** @type {MemizeCacheNode} */ tail.prev; tail.next = null; } else { size++; } head = node; return node.val; } memoized.clear = function() { head = null; tail = null; size = 0; }; return memoized; } // packages/plugins/build-module/components/plugin-area/index.mjs var import_element3 = __toESM(require_element(), 1); var import_hooks2 = __toESM(require_hooks(), 1); var import_is_shallow_equal = __toESM(require_is_shallow_equal(), 1); // packages/plugins/build-module/components/plugin-context/index.mjs var import_element = __toESM(require_element(), 1); var import_compose = __toESM(require_compose(), 1); var import_deprecated = __toESM(require_deprecated(), 1); var import_jsx_runtime = __toESM(require_jsx_runtime(), 1); var Context = (0, import_element.createContext)({ name: null, icon: null }); Context.displayName = "PluginContext"; var PluginContextProvider = Context.Provider; function usePluginContext() { return (0, import_element.useContext)(Context); } var withPluginContext = (mapContextToProps) => (0, import_compose.createHigherOrderComponent)((OriginalComponent) => { (0, import_deprecated.default)("wp.plugins.withPluginContext", { since: "6.8.0", alternative: "wp.plugins.usePluginContext" }); return (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Context.Consumer, { children: (context) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)( OriginalComponent, { ...props, ...mapContextToProps(context, props) } ) }); }, "withPluginContext"); // packages/plugins/build-module/components/plugin-error-boundary/index.mjs var import_element2 = __toESM(require_element(), 1); var PluginErrorBoundary = class extends import_element2.Component { constructor(props) { super(props); this.state = { hasError: false }; } static getDerivedStateFromError() { return { hasError: true }; } componentDidCatch(error) { const { name, onError } = this.props; if (onError) { onError(name, error); } } render() { if (!this.state.hasError) { return this.props.children; } return null; } }; // packages/plugins/build-module/api/index.mjs var import_hooks = __toESM(require_hooks(), 1); // packages/icons/build-module/library/plugins.mjs var import_primitives = __toESM(require_primitives(), 1); var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1); var plugins_default = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives.Path, { d: "M10.5 4v4h3V4H15v4h1.5a1 1 0 011 1v4l-3 4v2a1 1 0 01-1 1h-3a1 1 0 01-1-1v-2l-3-4V9a1 1 0 011-1H9V4h1.5zm.5 12.5v2h2v-2l3-4v-3H8v3l3 4z" }) }); // packages/plugins/build-module/api/index.mjs var plugins = {}; function registerPlugin(name, settings) { if (typeof settings !== "object") { console.error("No settings object provided!"); return null; } if (typeof name !== "string") { console.error("Plugin name must be string."); return null; } if (!/^[a-z][a-z0-9-]*$/.test(name)) { console.error( 'Plugin name must include only lowercase alphanumeric characters or dashes, and start with a letter. Example: "my-plugin".' ); return null; } if (plugins[name]) { console.error(`Plugin "${name}" is already registered.`); } settings = (0, import_hooks.applyFilters)( "plugins.registerPlugin", settings, name ); const { render, scope } = settings; if (typeof render !== "function") { console.error( 'The "render" property must be specified and must be a valid function.' ); return null; } if (scope) { if (typeof scope !== "string") { console.error("Plugin scope must be string."); return null; } if (!/^[a-z][a-z0-9-]*$/.test(scope)) { console.error( 'Plugin scope must include only lowercase alphanumeric characters or dashes, and start with a letter. Example: "my-page".' ); return null; } } plugins[name] = { name, icon: plugins_default, ...settings }; (0, import_hooks.doAction)("plugins.pluginRegistered", settings, name); return settings; } function unregisterPlugin(name) { if (!plugins[name]) { console.error('Plugin "' + name + '" is not registered.'); return; } const oldPlugin = plugins[name]; delete plugins[name]; (0, import_hooks.doAction)("plugins.pluginUnregistered", oldPlugin, name); return oldPlugin; } function getPlugin(name) { return plugins[name]; } function getPlugins(scope) { return Object.values(plugins).filter( (plugin) => plugin.scope === scope ); } // packages/plugins/build-module/components/plugin-area/index.mjs var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1); var getPluginContext = memize( (icon, name) => ({ icon, name }) ); function PluginArea({ scope, onError }) { const store = (0, import_element3.useMemo)(() => { let lastValue = []; return { subscribe(listener) { (0, import_hooks2.addAction)( "plugins.pluginRegistered", "core/plugins/plugin-area/plugins-registered", listener ); (0, import_hooks2.addAction)( "plugins.pluginUnregistered", "core/plugins/plugin-area/plugins-unregistered", listener ); return () => { (0, import_hooks2.removeAction)( "plugins.pluginRegistered", "core/plugins/plugin-area/plugins-registered" ); (0, import_hooks2.removeAction)( "plugins.pluginUnregistered", "core/plugins/plugin-area/plugins-unregistered" ); }; }, getValue() { const nextValue = getPlugins(scope); if (!(0, import_is_shallow_equal.isShallowEqual)(lastValue, nextValue)) { lastValue = nextValue; } return lastValue; } }; }, [scope]); const plugins2 = (0, import_element3.useSyncExternalStore)( store.subscribe, store.getValue, store.getValue ); return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { style: { display: "none" }, children: plugins2.map(({ icon, name, render: Plugin }) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)( PluginContextProvider, { value: getPluginContext(icon, name), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(PluginErrorBoundary, { name, onError, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Plugin, {}) }) }, name )) }); } var plugin_area_default = PluginArea; return __toCommonJS(index_exports); })(); rich-text.min.js 0000644 00000117554 15206720414 0007611 0 ustar 00 "use strict";var wp;(wp||={}).richText=(()=>{var Cr=Object.create;var gt=Object.defineProperty;var Lr=Object.getOwnPropertyDescriptor;var Rr=Object.getOwnPropertyNames;var _r=Object.getPrototypeOf,Sr=Object.prototype.hasOwnProperty;var $=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ot=(e,t)=>{for(var r in t)gt(e,r,{get:t[r],enumerable:!0})},Zt=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Rr(t))!Sr.call(e,o)&&o!==r&>(e,o,{get:()=>t[o],enumerable:!(n=Lr(t,o))||n.enumerable});return e};var b=(e,t,r)=>(r=e!=null?Cr(_r(e)):{},Zt(t||!e||!e.__esModule?gt(r,"default",{value:e,enumerable:!0}):r,e)),Or=e=>Zt(gt({},"__esModule",{value:!0}),e);var V=$((Rn,Yt)=>{Yt.exports=window.wp.data});var ne=$((Bn,re)=>{re.exports=window.wp.escapeHtml});var xe=$((jo,we)=>{we.exports=window.wp.a11y});var Fe=$((Uo,Te)=>{Te.exports=window.wp.i18n});var Le=$((Jo,Ce)=>{Ce.exports=window.wp.privateApis});var Y=$((Qo,Se)=>{Se.exports=window.wp.element});var Nt=$((Io,Oe)=>{Oe.exports=window.wp.compose});var qt=$((ti,De)=>{De.exports=window.wp.deprecated});var Xt=$((mi,Ze)=>{Ze.exports=window.wp.keycodes});var br=$((Ji,Er)=>{Er.exports=window.wp.dom});var Cn={};Ot(Cn,{RichTextData:()=>j,__experimentalRichText:()=>An,__unstableCreateElement:()=>B,__unstableToDom:()=>jt,__unstableUseRichText:()=>hr,applyFormat:()=>vt,concat:()=>fe,create:()=>C,getActiveFormat:()=>ot,getActiveFormats:()=>X,getActiveObject:()=>me,getTextContent:()=>nt,insert:()=>at,insertObject:()=>ge,isCollapsed:()=>Z,isEmpty:()=>le,join:()=>pe,privateApis:()=>Gt,registerFormatType:()=>de,remove:()=>wt,removeFormat:()=>st,replace:()=>he,slice:()=>xt,split:()=>ye,store:()=>F,toHTMLString:()=>G,toggleFormat:()=>Ne,unregisterFormatType:()=>Ae,useAnchor:()=>Tr,useAnchorRef:()=>vr});var yt=b(V(),1);var Qt=b(V(),1);function Dr(e={},t){switch(t.type){case"ADD_FORMAT_TYPES":return{...e,...t.formatTypes.reduce((r,n)=>({...r,[n.name]:n}),{})};case"REMOVE_FORMAT_TYPES":return Object.fromEntries(Object.entries(e).filter(([r])=>!t.names.includes(r)))}return e}var It=(0,Qt.combineReducers)({formatTypes:Dr});var Mt={};Ot(Mt,{getFormatType:()=>Mr,getFormatTypeForBareElement:()=>Hr,getFormatTypeForClassName:()=>kr,getFormatTypes:()=>Dt});var te=b(V(),1),Dt=(0,te.createSelector)(e=>Object.values(e.formatTypes),e=>[e.formatTypes]);function Mr(e,t){return e.formatTypes[t]}function Hr(e,t){let r=Dt(e);return r.find(({className:n,tagName:o})=>n===null&&t===o)||r.find(({className:n,tagName:o})=>n===null&&o==="*")}function kr(e,t){return Dt(e).find(({className:r})=>r===null?!1:` ${t} `.indexOf(` ${r} `)>=0)}var Ht={};Ot(Ht,{addFormatTypes:()=>Pr,removeFormatTypes:()=>$r});function Pr(e){return{type:"ADD_FORMAT_TYPES",formatTypes:Array.isArray(e)?e:[e]}}function $r(e){return{type:"REMOVE_FORMAT_TYPES",names:Array.isArray(e)?e:[e]}}var Vr="core/rich-text",F=(0,yt.createReduxStore)(Vr,{reducer:It,selectors:Mt,actions:Ht});(0,yt.register)(F);function tt(e,t){if(e===t)return!0;if(!e||!t||e.type!==t.type)return!1;let r=e.attributes,n=t.attributes;if(r===n)return!0;if(!r||!n)return!1;let o=Object.keys(r),s=Object.keys(n);if(o.length!==s.length)return!1;let a=o.length;for(let i=0;i<a;i++){let c=o[i];if(r[c]!==n[c])return!1}return!0}function _(e){let t=e.formats.slice();return t.forEach((r,n)=>{let o=t[n-1];if(o){let s=r.slice();s.forEach((a,i)=>{let c=o[i];tt(a,c)&&(s[i]=c)}),t[n]=s}}),{...e,formats:t}}function ee(e,t,r){return e=e.slice(),e[t]=r,e}function vt(e,t,r=e.start,n=e.end){let{formats:o,activeFormats:s}=e,a=o.slice();if(r===n){let i=a[r]?.find(({type:c})=>c===t.type);if(i){let c=a[r].indexOf(i);for(;a[r]&&a[r][c]===i;)a[r]=ee(a[r],c,t),r--;for(n++;a[n]&&a[n][c]===i;)a[n]=ee(a[n],c,t),n++}}else{let i=1/0;for(let c=r;c<n;c++)if(a[c]){a[c]=a[c].filter(({type:f})=>f!==t.type);let u=a[c].length;u<i&&(i=u)}else a[c]=[],i=0;for(let c=r;c<n;c++)a[c].splice(i,0,t)}return _({...e,formats:a,activeFormats:[...s?.filter(({type:i})=>i!==t.type)||[],t]})}var Pt=b(V(),1);function B({implementation:e},t){return B.body||(B.body=e.createHTMLDocument("").body),B.body.innerHTML=t,B.body}var R="\uFFFC",mt="\uFEFF";var rt=b(ne(),1);function X(e,t=[]){let{formats:r,start:n,end:o,activeFormats:s}=e;if(n===void 0)return t;if(n===o){if(s)return s;let u=r[n-1]||t,f=r[n]||t;return u.length<f.length?u:f}if(!r[n])return t;let a=r.slice(n,o),i=[...a[0]],c=a.length;for(;c--;){let u=a[c];if(!u)return t;let f=i.length;for(;f--;){let m=i[f];u.find(l=>tt(m,l))||i.splice(f,1)}if(i.length===0)return t}return i||t}var oe=b(V(),1);function kt(e){return(0,oe.select)(F).getFormatType(e)}function ie(e,t){if(t)return e;let r={};for(let n in e){let o=n;n.startsWith("data-disable-rich-text-")&&(o=n.slice(23)),r[o]=e[n]}return r}function Et({type:e,tagName:t,attributes:r,unregisteredAttributes:n,object:o,boundaryClass:s,isEditableTree:a}){let i=kt(e),c={};if(s&&a&&(c["data-rich-text-format-boundary"]="true"),!i)return r&&(c={...r,...c}),{type:e,attributes:ie(c,a),object:o};c={...n,...c};for(let u in r){let f=i.attributes?i.attributes[u]:!1;f?c[f]=r[u]:c[u]=r[u]}return i.className&&(c.class?c.class=`${i.className} ${c.class}`:c.class=i.className),{type:t||i.tagName,object:i.object,attributes:ie(c,a)}}function Br(e,t,r){do if(e[r]!==t[r])return!1;while(r--);return!0}function bt({value:e,preserveWhiteSpace:t,createEmpty:r,append:n,getLastChild:o,getParent:s,isText:a,getText:i,remove:c,appendText:u,onStartIndex:f,onEndIndex:m,isEditableTree:l,placeholder:y}){let{formats:w,replacements:d,text:h,start:v,end:x}=e,g=w.length+1,L=r(),k=X(e),U=k[k.length-1],q,W;n(L,"");for(let T=0;T<g;T++){let E=h.charAt(T),A=l&&(!W||W===` `),O=w[T],p=o(L);if(O&&O.forEach((D,P)=>{if(p&&q&&Br(O,q,P)){p=o(p);return}let{type:Q,tagName:I,attributes:St,unregisteredAttributes:ht}=D,Fr=l&&D===U,Nr=s(p),Ar=n(Nr,Et({type:Q,tagName:I,attributes:St,unregisteredAttributes:ht,boundaryClass:Fr,isEditableTree:l}));a(p)&&i(p).length===0&&c(p),p=n(Ar,"")}),T===0&&(f&&v===0&&f(L,p),m&&x===0&&m(L,p)),E===R){let D=d[T];if(!D)continue;let{type:P,attributes:Q,innerHTML:I}=D,St=kt(P);if(l&&P==="#comment")p=n(s(p),{type:"span",attributes:{contenteditable:"false","data-rich-text-comment":Q["data-rich-text-comment"]}}),n(n(p,{type:"span"}),Q["data-rich-text-comment"].trim());else if(!l&&P==="script")p=n(s(p),Et({type:"script",isEditableTree:l})),n(p,{html:decodeURIComponent(Q["data-rich-text-script"])});else if(St?.contentEditable===!1){if(I||l){if(p=s(p),l){let ht={contenteditable:"false","data-rich-text-bogus":!0};v===T&&x===T+1&&(ht["data-rich-text-format-boundary"]=!0),p=n(p,{type:"span",attributes:ht}),l&&T+1===h.length&&n(s(p),mt)}p=n(p,Et({...D,isEditableTree:l})),I&&n(p,{html:I})}}else p=n(s(p),Et({...D,object:!0,isEditableTree:l}));p=n(s(p),"")}else!t&&E===` `?(p=n(s(p),{type:"br",attributes:l?{"data-rich-text-line-break":"true"}:void 0,object:!0}),p=n(s(p),"")):a(p)?u(p,E):p=n(s(p),E);f&&v===T+1&&f(L,p),m&&x===T+1&&m(L,p),A&&T===h.length&&(n(s(p),mt),y&&h.length===0&&n(s(p),{type:"span",attributes:{"data-rich-text-placeholder":y,style:"pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;"}})),q=O,W=E}return L}function G({value:e,preserveWhiteSpace:t}){let r=bt({value:e,preserveWhiteSpace:t,createEmpty:jr,append:qr,getLastChild:Ur,getParent:Kr,isText:zr,getText:Xr,remove:Gr,appendText:Wr});return se(r.children)}function jr(){return{}}function Ur({children:e}){return e&&e[e.length-1]}function qr(e,t){return typeof t=="string"&&(t={text:t}),t.parent=e,e.children=e.children||[],e.children.push(t),t}function Wr(e,t){e.text+=t}function Kr({parent:e}){return e}function zr({text:e}){return typeof e=="string"}function Xr({text:e}){return e}function Gr(e){let t=e.parent.children.indexOf(e);return t!==-1&&e.parent.children.splice(t,1),e}function Jr({type:e,attributes:t,object:r,children:n}){if(e==="#comment")return`<!--${t["data-rich-text-comment"]}-->`;let o="";for(let s in t)(0,rt.isValidAttributeName)(s)&&(o+=` ${s}="${(0,rt.escapeAttribute)(t[s])}"`);return r?`<${e}${o}>`:`<${e}${o}>${se(n)}</${e}>`}function se(e=[]){return e.map(t=>t.html!==void 0?t.html:t.text===void 0?Jr(t):(0,rt.escapeEditableHTML)(t.text)).join("")}function nt({text:e}){return e.replace(R,"")}function et(){return{formats:[],replacements:[],text:""}}function Zr({tagName:e,attributes:t}){let r;if(t&&t.class&&(r=(0,Pt.select)(F).getFormatTypeForClassName(t.class),r&&(t.class=` ${t.class} `.replace(` ${r.className} `," ").trim(),t.class||delete t.class)),r||(r=(0,Pt.select)(F).getFormatTypeForBareElement(e)),!r)return t?{type:e,attributes:t}:{type:e};if(r.__experimentalCreatePrepareEditableTree&&!r.__experimentalCreateOnChangeEditableValue)return null;if(!t)return{formatType:r,type:r.name,tagName:e};let n={},o={},s={...t};for(let a in r.attributes){let i=r.attributes[a];n[a]=s[i],delete s[i],typeof n[a]>"u"&&delete n[a]}for(let a in s)o[a]=t[a];return r.contentEditable===!1&&delete o.contenteditable,{formatType:r,type:r.name,tagName:e,attributes:n,unregisteredAttributes:o}}var j=class lt{#t;static empty(){return new lt}static fromPlainText(t){return new lt(C({text:t}))}static fromHTMLString(t){return new lt(C({html:t}))}static fromHTMLElement(t,r={}){let{preserveWhiteSpace:n=!1}=r,o=n?t:ce(t),s=new lt(C({element:o}));return Object.defineProperty(s,"originalHTML",{value:t.innerHTML}),s}constructor(t=et()){this.#t=t}toPlainText(){return nt(this.#t)}toHTMLString({preserveWhiteSpace:t}={}){return this.originalHTML||G({value:this.#t,preserveWhiteSpace:t})}valueOf(){return this.toHTMLString()}toString(){return this.toHTMLString()}toJSON(){return this.toHTMLString()}get length(){return this.text.length}get formats(){return this.#t.formats}get replacements(){return this.#t.replacements}get text(){return this.#t.text}};for(let e of Object.getOwnPropertyNames(String.prototype))j.prototype.hasOwnProperty(e)||Object.defineProperty(j.prototype,e,{value(...t){return this.toHTMLString()[e](...t)}});function C({element:e,text:t,html:r,range:n,__unstableIsEditableTree:o}={}){return r instanceof j?{text:r.text,formats:r.formats,replacements:r.replacements}:typeof t=="string"&&t.length>0?{formats:Array(t.length),replacements:Array(t.length),text:t}:(typeof r=="string"&&r.length>0&&(e=B(document,r)),typeof e!="object"?et():ue({element:e,range:n,isEditableTree:o}))}function J(e,t,r,n){if(!r)return;let{parentNode:o}=t,{startContainer:s,startOffset:a,endContainer:i,endOffset:c}=r,u=e.text.length;n.start!==void 0?e.start=u+n.start:t===s&&t.nodeType===t.TEXT_NODE?e.start=u+a:o===s&&t===s.childNodes[a]?e.start=u:o===s&&t===s.childNodes[a-1]?e.start=u+n.text.length:t===s&&(e.start=u),n.end!==void 0?e.end=u+n.end:t===i&&t.nodeType===t.TEXT_NODE?e.end=u+c:o===i&&t===i.childNodes[c-1]?e.end=u+n.text.length:o===i&&t===i.childNodes[c]?e.end=u:t===i&&(e.end=u+c)}function Yr(e,t,r){if(!t)return;let{startContainer:n,endContainer:o}=t,{startOffset:s,endOffset:a}=t;return e===n&&(s=r(e.nodeValue.slice(0,s)).length),e===o&&(a=r(e.nodeValue.slice(0,a)).length),{startContainer:n,startOffset:s,endContainer:o,endOffset:a}}function ce(e,t=!0,r=!1,n=!1){let o=e.cloneNode(!0);return o.normalize(),Array.from(o.childNodes).forEach((s,a,i)=>{if(s.nodeType===s.TEXT_NODE){let c=s.nodeValue;/[\n\t\r\f]/.test(c)&&(c=c.replace(/[\n\t\r\f]+/g," ")),c.indexOf(" ")!==-1&&(c=c.replace(/ {2,}/g," ")),a===0&&c.startsWith(" ")&&(t||r)&&(c=c.slice(1)),a===i.length-1&&c.endsWith(" ")&&(t||n)&&(c=c.slice(0,-1)),s.nodeValue=c}else if(s.nodeType===s.ELEMENT_NODE){let{previousSibling:c,nextSibling:u}=s,f=c?.textContent.endsWith(" "),m=u?.textContent.startsWith(" ");s.replaceWith(ce(s,!1,c?f:t||r,u?m:t||n))}}),o}var Qr="\r";function ae(e){return e.replace(new RegExp(`[${mt}${R}${Qr}]`,"gu"),"")}function ue({element:e,range:t,isEditableTree:r}){let n=et();if(!e)return n;if(!e.hasChildNodes())return J(n,e,t,et()),n;let o=e.childNodes.length;for(let a=0;a<o;a++){let i=e.childNodes[a],c=i.nodeName.toLowerCase();if(i.nodeType===i.TEXT_NODE){let m=ae(i.nodeValue);t=Yr(i,t,ae),J(n,i,t,{text:m}),n.formats.length+=m.length,n.replacements.length+=m.length,n.text+=m;continue}if(i.nodeType===i.COMMENT_NODE||i.nodeType===i.ELEMENT_NODE&&i.tagName==="SPAN"&&i.hasAttribute("data-rich-text-comment")){let m={formats:[,],replacements:[{type:"#comment",attributes:{"data-rich-text-comment":i.nodeType===i.COMMENT_NODE?i.nodeValue:i.getAttribute("data-rich-text-comment")}}],text:R};J(n,i,t,m),K(n,m);continue}if(i.nodeType!==i.ELEMENT_NODE)continue;if(r&&c==="br"&&!i.getAttribute("data-rich-text-line-break")){J(n,i,t,et());continue}if(c==="script"){let m={formats:[,],replacements:[{type:c,attributes:{"data-rich-text-script":i.getAttribute("data-rich-text-script")||encodeURIComponent(i.innerHTML)}}],text:R};J(n,i,t,m),K(n,m);continue}if(c==="br"){J(n,i,t,et()),K(n,C({text:` `}));continue}let u=Zr({tagName:c,attributes:Ir({element:i})});if(u?.formatType?.contentEditable===!1){delete u.formatType,J(n,i,t,et()),K(n,{formats:[,],replacements:[{...u,innerHTML:i.innerHTML}],text:R});continue}u&&delete u.formatType;let f=ue({element:i,range:t,isEditableTree:r});if(J(n,i,t,f),!u||i.getAttribute("data-rich-text-placeholder")||i.getAttribute("data-rich-text-bogus"))K(n,f);else if(f.text.length===0)u.attributes&&K(n,{formats:[,],replacements:[u],text:R});else{let m=function(l){if(m.formats===l)return m.newFormats;let y=l?[u,...l]:[u];return m.formats=l,m.newFormats=y,y};var s=m;m.newFormats=[u],K(n,{...f,formats:Array.from(f.formats,m)})}}return n}function Ir({element:e}){if(!e.hasAttributes())return;let t=e.attributes.length,r;for(let n=0;n<t;n++){let{name:o,value:s}=e.attributes[n];if(o.indexOf("data-rich-text-")===0)continue;let a=/^on/i.test(o)?"data-disable-rich-text-"+o:o;r=r||{},r[a]=s}return r}function K(e,t){return e.formats=e.formats.concat(t.formats),e.replacements=e.replacements.concat(t.replacements),e.text+=t.text,e}function fe(...e){return _(e.reduce(K,C()))}function ot(e,t){return X(e).find(({type:r})=>r===t)}function me({start:e,end:t,replacements:r,text:n}){if(!(e+1!==t||n[e]!==R))return r[e]}function Z({start:e,end:t}){if(!(e===void 0||t===void 0))return e===t}function le({text:e}){return e.length===0}function pe(e,t=""){return typeof t=="string"&&(t=C({text:t})),_(e.reduce((r,{formats:n,replacements:o,text:s})=>({formats:r.formats.concat(t.formats,n),replacements:r.replacements.concat(t.replacements,o),text:r.text+t.text+s})))}var it=b(V(),1);function de(e,t){if(t={name:e,...t},typeof t.name!="string"){window.console.error("Format names must be strings.");return}if(!/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(t.name)){window.console.error("Format names must contain a namespace prefix, include only lowercase alphanumeric characters or dashes, and start with a letter. Example: my-plugin/my-custom-format");return}if((0,it.select)(F).getFormatType(t.name)){window.console.error('Format "'+t.name+'" is already registered.');return}if(typeof t.tagName!="string"||t.tagName===""){window.console.error("Format tag names must be a string.");return}if((typeof t.className!="string"||t.className==="")&&t.className!==null){window.console.error("Format class names must be a string, or null to handle bare elements.");return}if(!/^[_a-zA-Z]+[a-zA-Z0-9_-]*$/.test(t.className)){window.console.error("A class name must begin with a letter, followed by any number of hyphens, underscores, letters, or numbers.");return}if(t.className===null){let r=(0,it.select)(F).getFormatTypeForBareElement(t.tagName);if(r&&r.name!=="core/unknown"){window.console.error(`Format "${r.name}" is already registered to handle bare tag name "${t.tagName}".`);return}}else{let r=(0,it.select)(F).getFormatTypeForClassName(t.className);if(r){window.console.error(`Format "${r.name}" is already registered to handle class name "${t.className}".`);return}}if(!("title"in t)||t.title===""){window.console.error('The format "'+t.name+'" must have a title.');return}if("keywords"in t&&t.keywords.length>3){window.console.error('The format "'+t.name+'" can have a maximum of 3 keywords.');return}if(typeof t.title!="string"){window.console.error("Format titles must be strings.");return}return(0,it.dispatch)(F).addFormatTypes(t),t}function st(e,t,r=e.start,n=e.end){let{formats:o,activeFormats:s}=e,a=o.slice();if(r===n){let i=a[r]?.find(({type:c})=>c===t);if(i){for(;a[r]?.find(c=>c===i);)$t(a,r,t),r--;for(n++;a[n]?.find(c=>c===i);)$t(a,n,t),n++}}else for(let i=r;i<n;i++)a[i]&&$t(a,i,t);return _({...e,formats:a,activeFormats:s?.filter(({type:i})=>i!==t)||[]})}function $t(e,t,r){let n=e[t].filter(({type:o})=>o!==r);n.length?e[t]=n:delete e[t]}function at(e,t,r=e.start,n=e.end){let{formats:o,replacements:s,text:a}=e;typeof t=="string"&&(t=C({text:t}));let i=r+t.text.length;return _({formats:o.slice(0,r).concat(t.formats,o.slice(n)),replacements:s.slice(0,r).concat(t.replacements,s.slice(n)),text:a.slice(0,r)+t.text+a.slice(n),start:i,end:i})}function wt(e,t,r){return at(e,C(),t,r)}function he({formats:e,replacements:t,text:r,start:n,end:o},s,a){return r=r.replace(s,(i,...c)=>{let u=c[c.length-2],f=a,m,l;return typeof f=="function"&&(f=a(i,...c)),typeof f=="object"?(m=f.formats,l=f.replacements,f=f.text):(m=Array(f.length),l=Array(f.length),e[u]&&(m=m.fill(e[u]))),e=e.slice(0,u).concat(m,e.slice(u+i.length)),t=t.slice(0,u).concat(l,t.slice(u+i.length)),n&&(n=o=u+f.length),f}),_({formats:e,replacements:t,text:r,start:n,end:o})}function ge(e,t,r,n){return at(e,{formats:[,],replacements:[t],text:R},r,n)}function xt(e,t=e.start,r=e.end){let{formats:n,replacements:o,text:s}=e;return t===void 0||r===void 0?{...e}:{formats:n.slice(t,r),replacements:o.slice(t,r),text:s.slice(t,r)}}function ye({formats:e,replacements:t,text:r,start:n,end:o},s){if(typeof s!="string")return tn(...arguments);let a=0;return r.split(s).map(i=>{let c=a,u={formats:e.slice(c,c+i.length),replacements:t.slice(c,c+i.length),text:i};return a+=s.length+i.length,n!==void 0&&o!==void 0&&(n>=c&&n<a?u.start=n-c:n<c&&o>c&&(u.start=0),o>=c&&o<a?u.end=o-c:n<a&&o>a&&(u.end=i.length)),u})}function tn({formats:e,replacements:t,text:r,start:n,end:o},s=n,a=o){if(n===void 0||o===void 0)return;let i={formats:e.slice(0,s),replacements:t.slice(0,s),text:r.slice(0,s)},c={formats:e.slice(a),replacements:t.slice(a),text:r.slice(a),start:0,end:0};return[i,c]}function Tt(e,t){return e===t||e&&t&&e.startContainer===t.startContainer&&e.startOffset===t.startOffset&&e.endContainer===t.endContainer&&e.endOffset===t.endOffset}var Vt="http://www.w3.org/1998/Math/MathML";function Bt(e,t,r){let n=e.parentNode,o=0;for(;e=e.previousSibling;)o++;return r=[o,...r],n!==t&&(r=Bt(n,t,r)),r}function ve(e,t){for(t=[...t];e&&t.length>1;)e=e.childNodes[t.shift()];return{node:e,offset:t[0]}}function en(e,t){if(t.html!==void 0)return e.innerHTML+=t.html;typeof t=="string"&&(t=e.ownerDocument.createTextNode(t));let{type:r,attributes:n}=t;if(r)if(r==="#comment")t=e.ownerDocument.createComment(n["data-rich-text-comment"]);else{let o=e.namespaceURI;r==="math"?t=e.ownerDocument.createElementNS(Vt,r):o===Vt?e.tagName==="MTEXT"?t=e.ownerDocument.createElement(r):t=e.ownerDocument.createElementNS(Vt,r):t=e.ownerDocument.createElement(r);for(let s in n)t.setAttribute(s,n[s])}return e.appendChild(t)}function rn(e,t){e.appendData(t)}function nn({lastChild:e}){return e}function on({parentNode:e}){return e}function sn(e){return e.nodeType===e.TEXT_NODE}function an({nodeValue:e}){return e}function cn(e){return e.parentNode.removeChild(e)}function jt({value:e,prepareEditableTree:t,isEditableTree:r=!0,placeholder:n,doc:o=document}){let s=[],a=[];return t&&(e={...e,formats:t(e)}),{body:bt({value:e,createEmpty:()=>B(o,""),append:en,getLastChild:nn,getParent:on,isText:sn,getText:an,remove:cn,appendText:rn,onStartIndex(u,f){s=Bt(f,u,[f.nodeValue.length])},onEndIndex(u,f){a=Bt(f,u,[f.nodeValue.length])},isEditableTree:r,placeholder:n}),selection:{startPath:s,endPath:a}}}function Ee({value:e,current:t,prepareEditableTree:r,__unstableDomOnly:n,placeholder:o}){let{body:s,selection:a}=jt({value:e,prepareEditableTree:r,placeholder:o,doc:t.ownerDocument});be(s,t),e.start!==void 0&&!n&&un(a,t)}function be(e,t){let r=0,n;for(;n=e.firstChild;){let o=t.childNodes[r];if(!o)t.appendChild(n);else if(o.isEqualNode(n))e.removeChild(n);else if(o.nodeName!==n.nodeName||o.nodeType===o.TEXT_NODE&&o.data!==n.data)t.replaceChild(n,o);else{let s=o.attributes,a=n.attributes;if(s){let i=s.length;for(;i--;){let{name:c}=s[i];n.getAttribute(c)||o.removeAttribute(c)}}if(a)for(let i=0;i<a.length;i++){let{name:c,value:u}=a[i];o.getAttribute(c)!==u&&o.setAttribute(c,u)}be(n,o),e.removeChild(n)}r++}for(;t.childNodes[r];)t.removeChild(t.childNodes[r])}function un({startPath:e,endPath:t},r){let{node:n,offset:o}=ve(r,e),{node:s,offset:a}=ve(r,t),{ownerDocument:i}=r,{defaultView:c}=i,u=c.getSelection(),f=i.createRange();f.setStart(n,o),f.setEnd(s,a);let{activeElement:m}=i;if(u.rangeCount>0){if(Tt(f,u.getRangeAt(0)))return;u.removeAllRanges()}u.addRange(f),m!==i.activeElement&&m instanceof c.HTMLElement&&m.focus()}var Ut=b(xe(),1),ct=b(Fe(),1);function Ne(e,t){return ot(e,t.type)?(t.title&&(0,Ut.speak)((0,ct.sprintf)((0,ct.__)("%s removed."),t.title),"assertive"),st(e,t.type)):(t.title&&(0,Ut.speak)((0,ct.sprintf)((0,ct.__)("%s applied."),t.title),"assertive"),vt(e,t))}var Ft=b(V(),1);function Ae(e){let t=(0,Ft.select)(F).getFormatType(e);if(!t){window.console.error(`Format ${e} is not registered.`);return}return(0,Ft.dispatch)(F).removeFormatTypes(e),t}var Re=b(Le(),1),{lock:_e,unlock:Zo}=(0,Re.__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/rich-text");var H=b(Y(),1),Rt=b(Nt(),1),mr=b(V(),1),lr=b(qt(),1);var Me=b(Y(),1),fn="pre-wrap";function He(){return(0,Me.useCallback)(e=>{e&&(e.style.whiteSpace=fn)},[])}var mn={grad:.9,turn:360,rad:360/(2*Math.PI)},z=function(e){return typeof e=="string"?e.length>0:typeof e=="number"},N=function(e,t,r){return t===void 0&&(t=0),r===void 0&&(r=Math.pow(10,t)),Math.round(r*e)/r+0},S=function(e,t,r){return t===void 0&&(t=0),r===void 0&&(r=1),e>r?r:e>t?e:t},We=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},ke=function(e){return{r:S(e.r,0,255),g:S(e.g,0,255),b:S(e.b,0,255),a:S(e.a)}},Wt=function(e){return{r:N(e.r),g:N(e.g),b:N(e.b),a:N(e.a,3)}},ln=/^#([0-9a-f]{3,8})$/i,At=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Ke=function(e){var t=e.r,r=e.g,n=e.b,o=e.a,s=Math.max(t,r,n),a=s-Math.min(t,r,n),i=a?s===t?(r-n)/a:s===r?2+(n-t)/a:4+(t-r)/a:0;return{h:60*(i<0?i+6:i),s:s?a/s*100:0,v:s/255*100,a:o}},ze=function(e){var t=e.h,r=e.s,n=e.v,o=e.a;t=t/360*6,r/=100,n/=100;var s=Math.floor(t),a=n*(1-r),i=n*(1-(t-s)*r),c=n*(1-(1-t+s)*r),u=s%6;return{r:255*[n,i,a,a,c,n][u],g:255*[c,n,n,i,a,a][u],b:255*[a,a,c,n,n,i][u],a:o}},Pe=function(e){return{h:We(e.h),s:S(e.s,0,100),l:S(e.l,0,100),a:S(e.a)}},$e=function(e){return{h:N(e.h),s:N(e.s),l:N(e.l),a:N(e.a,3)}},Ve=function(e){return ze((r=(t=e).s,{h:t.h,s:(r*=((n=t.l)<50?n:100-n)/100)>0?2*r/(n+r)*100:0,v:n+r,a:t.a}));var t,r,n},pt=function(e){return{h:(t=Ke(e)).h,s:(o=(200-(r=t.s))*(n=t.v)/100)>0&&o<200?r*n/100/(o<=100?o:200-o)*100:0,l:o/2,a:t.a};var t,r,n,o},pn=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,dn=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,hn=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,gn=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Be={string:[[function(e){var t=ln.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?N(parseInt(e[3]+e[3],16)/255,2):1}:e.length===6||e.length===8?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:e.length===8?N(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=hn.exec(e)||gn.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:ke({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=pn.exec(e)||dn.exec(e);if(!t)return null;var r,n,o=Pe({h:(r=t[1],n=t[2],n===void 0&&(n="deg"),Number(r)*(mn[n]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return Ve(o)},"hsl"]],object:[[function(e){var t=e.r,r=e.g,n=e.b,o=e.a,s=o===void 0?1:o;return z(t)&&z(r)&&z(n)?ke({r:Number(t),g:Number(r),b:Number(n),a:Number(s)}):null},"rgb"],[function(e){var t=e.h,r=e.s,n=e.l,o=e.a,s=o===void 0?1:o;if(!z(t)||!z(r)||!z(n))return null;var a=Pe({h:Number(t),s:Number(r),l:Number(n),a:Number(s)});return Ve(a)},"hsl"],[function(e){var t=e.h,r=e.s,n=e.v,o=e.a,s=o===void 0?1:o;if(!z(t)||!z(r)||!z(n))return null;var a=(function(i){return{h:We(i.h),s:S(i.s,0,100),v:S(i.v,0,100),a:S(i.a)}})({h:Number(t),s:Number(r),v:Number(n),a:Number(s)});return ze(a)},"hsv"]]},je=function(e,t){for(var r=0;r<t.length;r++){var n=t[r][0](e);if(n)return[n,t[r][1]]}return[null,void 0]},yn=function(e){return typeof e=="string"?je(e.trim(),Be.string):typeof e=="object"&&e!==null?je(e,Be.object):[null,void 0]};var Kt=function(e,t){var r=pt(e);return{h:r.h,s:S(r.s+100*t,0,100),l:r.l,a:r.a}},zt=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},Ue=function(e,t){var r=pt(e);return{h:r.h,s:r.s,l:S(r.l+100*t,0,100),a:r.a}},qe=(function(){function e(t){this.parsed=yn(t)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return this.parsed!==null},e.prototype.brightness=function(){return N(zt(this.rgba),2)},e.prototype.isDark=function(){return zt(this.rgba)<.5},e.prototype.isLight=function(){return zt(this.rgba)>=.5},e.prototype.toHex=function(){return t=Wt(this.rgba),r=t.r,n=t.g,o=t.b,a=(s=t.a)<1?At(N(255*s)):"","#"+At(r)+At(n)+At(o)+a;var t,r,n,o,s,a},e.prototype.toRgb=function(){return Wt(this.rgba)},e.prototype.toRgbString=function(){return t=Wt(this.rgba),r=t.r,n=t.g,o=t.b,(s=t.a)<1?"rgba("+r+", "+n+", "+o+", "+s+")":"rgb("+r+", "+n+", "+o+")";var t,r,n,o,s},e.prototype.toHsl=function(){return $e(pt(this.rgba))},e.prototype.toHslString=function(){return t=$e(pt(this.rgba)),r=t.h,n=t.s,o=t.l,(s=t.a)<1?"hsla("+r+", "+n+"%, "+o+"%, "+s+")":"hsl("+r+", "+n+"%, "+o+"%)";var t,r,n,o,s},e.prototype.toHsv=function(){return t=Ke(this.rgba),{h:N(t.h),s:N(t.s),v:N(t.v),a:N(t.a,3)};var t},e.prototype.invert=function(){return M({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},e.prototype.saturate=function(t){return t===void 0&&(t=.1),M(Kt(this.rgba,t))},e.prototype.desaturate=function(t){return t===void 0&&(t=.1),M(Kt(this.rgba,-t))},e.prototype.grayscale=function(){return M(Kt(this.rgba,-1))},e.prototype.lighten=function(t){return t===void 0&&(t=.1),M(Ue(this.rgba,t))},e.prototype.darken=function(t){return t===void 0&&(t=.1),M(Ue(this.rgba,-t))},e.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},e.prototype.alpha=function(t){return typeof t=="number"?M({r:(r=this.rgba).r,g:r.g,b:r.b,a:t}):N(this.rgba.a,3);var r},e.prototype.hue=function(t){var r=pt(this.rgba);return typeof t=="number"?M({h:t,s:r.s,l:r.l,a:r.a}):N(r.h)},e.prototype.isEqual=function(t){return this.toHex()===M(t).toHex()},e})(),M=function(e){return e instanceof qe?e:new qe(e)};var Ct=b(Y(),1);function Xe({record:e}){let t=(0,Ct.useRef)(),{activeFormats:r=[],replacements:n,start:o}=e.current,s=n[o];return(0,Ct.useEffect)(()=>{if((!r||!r.length)&&!s)return;let a="*[data-rich-text-format-boundary]",i=t.current.querySelector(a);if(!i)return;let{ownerDocument:c}=i,{defaultView:u}=c,f=u.getComputedStyle(i),m=M(f.color).alpha(.2).toRgbString(),l=`.rich-text:focus ${a}`,y=`background-color: ${m}`,w=`${l} {${y}}`,d="rich-text-boundary-style",h=c.getElementById(d);h||(h=c.createElement("style"),h.id=d,c.head.appendChild(h)),h.innerHTML!==w&&(h.innerHTML=w)},[r,s]),t}var ft=b(Y(),1),sr=b(Nt(),1);var Ge=e=>t=>{function r(o){let{record:s}=e.current,{ownerDocument:a}=t;if(Z(s.current)||!t.contains(a.activeElement))return;let i=xt(s.current),c=nt(i),u=G({value:i});o.clipboardData.setData("text/plain",c),o.clipboardData.setData("text/html",u),o.clipboardData.setData("rich-text","true"),o.preventDefault(),o.type==="cut"&&a.execCommand("delete")}let{defaultView:n}=t.ownerDocument;return n.addEventListener("copy",r),n.addEventListener("cut",r),()=>{n.removeEventListener("copy",r),n.removeEventListener("cut",r)}};var Je=()=>e=>{function t(n){let{target:o}=n;if(o===e||o.textContent&&o.isContentEditable)return;let{ownerDocument:s}=o,{defaultView:a}=s,i=a.getSelection();if(i.containsNode(o))return;let c=s.createRange(),u=o.isContentEditable?o:o.closest("[contenteditable]");c.selectNode(u),i.removeAllRanges(),i.addRange(c),n.preventDefault()}function r(n){n.relatedTarget&&!e.contains(n.relatedTarget)&&n.relatedTarget.tagName==="A"&&t(n)}return e.addEventListener("click",t),e.addEventListener("focusin",r),()=>{e.removeEventListener("click",t),e.removeEventListener("focusin",r)}};var ut=b(Xt(),1);var Ye=[],Qe=e=>t=>{function r(n){let{keyCode:o,shiftKey:s,altKey:a,metaKey:i,ctrlKey:c}=n;if(s||a||i||c||o!==ut.LEFT&&o!==ut.RIGHT)return;let{record:u,applyRecord:f,forceRender:m}=e.current,{text:l,formats:y,start:w,end:d,activeFormats:h=[]}=u.current,v=Z(u.current),{ownerDocument:x}=t,{defaultView:g}=x,{direction:L}=g.getComputedStyle(t),k=L==="rtl"?ut.RIGHT:ut.LEFT,U=n.keyCode===k;if(v&&h.length===0&&(w===0&&U||d===l.length&&!U)||!v)return;let q=y[w-1]||Ye,W=y[w]||Ye,T=U?q:W,E=h.every((Q,I)=>Q===T[I]),A=h.length;if(E?A<T.length&&A++:A--,A===h.length){u.current._newActiveFormats=T;return}n.preventDefault();let D=(E?T:U?W:q).slice(0,A),P={...u.current,activeFormats:D};u.current=P,f(P),m()}return t.addEventListener("keydown",r),()=>{t.removeEventListener("keydown",r)}};var Lt=b(Xt(),1);var Ie=e=>t=>{function r(n){let{keyCode:o}=n,{createRecord:s,handleChange:a}=e.current;if(n.defaultPrevented||o!==Lt.DELETE&&o!==Lt.BACKSPACE)return;let i=s(),{start:c,end:u,text:f}=i;c===0&&u!==0&&u===f.length&&(a(wt(i)),n.preventDefault())}return t.addEventListener("keydown",r),()=>{t.removeEventListener("keydown",r)}};function tr({value:e,start:t,end:r,formats:n}){let o=Math.min(t,r),s=Math.max(t,r),a=e.formats[o-1]||[],i=e.formats[s]||[];for(e.activeFormats=n.map((c,u)=>{if(a[u]){if(tt(c,a[u]))return a[u]}else if(i[u]&&tt(c,i[u]))return i[u];return c});--r>=t;)e.activeFormats.length>0?e.formats[r]=e.activeFormats:delete e.formats[r];return e}var vn=new Set(["insertParagraph","insertOrderedList","insertUnorderedList","insertHorizontalRule","insertLink"]),er=[],rr="data-rich-text-placeholder";function En(e){let t=e.getSelection(),{anchorNode:r,anchorOffset:n}=t;if(r.nodeType!==r.ELEMENT_NODE)return;let o=r.childNodes[n];!o||o.nodeType!==o.ELEMENT_NODE||!o.hasAttribute(rr)||t.collapseToStart()}var nr=e=>t=>{let{ownerDocument:r}=t,{defaultView:n}=r,o=!1;function s(f){if(o)return;let m;f&&(m=f.inputType);let{record:l,applyRecord:y,createRecord:w,handleChange:d}=e.current;if(m&&(m.indexOf("format")===0||vn.has(m))){y(l.current);return}let h=w(),{start:v,activeFormats:x=[]}=l.current,g=!Z(l.current)&&h.start<=v,L=tr({value:h,start:v,end:h.start,formats:g?[]:x});d(L)}function a(){let{record:f,applyRecord:m,createRecord:l,onSelectionChange:y}=e.current;if(t.contentEditable!=="true")return;if(r.activeElement!==t){r.removeEventListener("selectionchange",a);return}if(o)return;let{start:w,end:d,text:h}=l(),v=f.current;if(h!==v.text){s();return}if(w===v.start&&d===v.end){v.text.length===0&&w===0&&En(n);return}let x={...v,start:w,end:d,activeFormats:v._newActiveFormats,_newActiveFormats:void 0},g=X(x,er);x.activeFormats=g,f.current=x,m(x,{domOnly:!0}),y(w,d)}function i(){o=!0,r.removeEventListener("selectionchange",a),t.querySelector(`[${rr}]`)?.remove()}function c(){o=!1,s({inputType:"insertText"}),r.addEventListener("selectionchange",a)}function u(){let{record:f,isSelected:m,onSelectionChange:l,applyRecord:y}=e.current;t.parentElement.closest('[contenteditable="true"]')||(m?y(f.current,{domOnly:!0}):f.current={...f.current,start:void 0,end:void 0,activeFormats:er},l(f.current.start,f.current.end),window.queueMicrotask(a),r.addEventListener("selectionchange",a))}return t.addEventListener("input",s),t.addEventListener("compositionstart",i),t.addEventListener("compositionend",c),t.addEventListener("focus",u),()=>{t.removeEventListener("input",s),t.removeEventListener("compositionstart",i),t.removeEventListener("compositionend",c),t.removeEventListener("focus",u)}};var or=()=>e=>{let{ownerDocument:t}=e,{defaultView:r}=t,n=r?.getSelection(),o;function s(){return n.rangeCount?n.getRangeAt(0):null}function a(i){let c=i.type==="keydown"?"keyup":"pointerup";function u(){t.removeEventListener(c,f),t.removeEventListener("selectionchange",u),t.removeEventListener("input",u)}function f(){u(),!Tt(o,s())&&t.dispatchEvent(new Event("selectionchange"))}t.addEventListener(c,f),t.addEventListener("selectionchange",u),t.addEventListener("input",u),o=s()}return e.addEventListener("pointerdown",a),e.addEventListener("keydown",a),()=>{e.removeEventListener("pointerdown",a),e.removeEventListener("keydown",a)}};function ir(){return e=>{let{ownerDocument:t}=e,{defaultView:r}=t,n=null;function o(a){a.defaultPrevented||a.target!==e&&a.target.contains(e)&&(n=e.getAttribute("contenteditable"),e.setAttribute("contenteditable","false"),r.getSelection().removeAllRanges())}function s(){n!==null&&(e.setAttribute("contenteditable",n),n=null)}return r.addEventListener("pointerdown",o),r.addEventListener("pointerup",s),()=>{r.removeEventListener("pointerdown",o),r.removeEventListener("pointerup",s)}}}var bn=[Ge,Je,Qe,Ie,nr,or,ir];function ar(e){let t=(0,ft.useRef)(e);(0,ft.useInsertionEffect)(()=>{t.current=e});let r=(0,ft.useMemo)(()=>bn.map(n=>n(t)),[t]);return(0,sr.useRefEffect)(n=>{let o=r.map(s=>s(n));return()=>{o.forEach(s=>s())}},[r])}var ur=b(Y(),1),dt=b(V(),1);function wn(e){return e(F).getFormatTypes()}var xn=new Set(["a","audio","button","details","embed","iframe","input","label","select","textarea","video"]);function Tn(e,t){return typeof e!="object"?{[t]:e}:Object.fromEntries(Object.entries(e).map(([r,n])=>[`${t}.${r}`,n]))}function cr(e,t){return e[t]?e[t]:Object.keys(e).filter(r=>r.startsWith(t+".")).reduce((r,n)=>(r[n.slice(t.length+1)]=e[n],r),{})}function fr({allowedFormats:e,withoutInteractiveFormatting:t,__unstableFormatTypeHandlerContext:r}){let n=(0,dt.useSelect)(wn,[]),o=(0,ur.useMemo)(()=>n.filter(({name:m,interactive:l,tagName:y})=>!(e&&!e.includes(m)||t&&(l||xn.has(y)))),[n,e,t]),s=(0,dt.useSelect)(m=>o.reduce((l,y)=>!y.__experimentalGetPropsForEditableTreePreparation||!r?l:{...l,...Tn(y.__experimentalGetPropsForEditableTreePreparation(m,r),y.name)},{}),[o,r]),a=(0,dt.useDispatch)(),i=[],c=[],u=[],f=[];for(let m in s)f.push(s[m]);return o.forEach(m=>{if(m.__experimentalCreatePrepareEditableTree&&r){let l=m.__experimentalCreatePrepareEditableTree(cr(s,m.name),r);m.__experimentalCreateOnChangeEditableValue?c.push(l):i.push(l)}if(m.__experimentalCreateOnChangeEditableValue&&r){let l={};m.__experimentalGetPropsForEditableTreeChangeHandler&&(l=m.__experimentalGetPropsForEditableTreeChangeHandler(a,r));let y=cr(s,m.name);u.push(m.__experimentalCreateOnChangeEditableValue({...typeof y=="object"?y:{},...l},r))}}),{formatTypes:o,prepareHandlers:i,valueHandlers:c,changeHandlers:u,dependencies:f}}function pr({value:e="",selectionStart:t,selectionEnd:r,placeholder:n,onSelectionChange:o,preserveWhiteSpace:s,onChange:a,__unstableDisableFormats:i,__unstableIsSelected:c,__unstableDependencies:u=[],__unstableAfterParse:f,__unstableBeforeSerialize:m,__unstableAddInvisibleFormats:l}){let y=(0,mr.useRegistry)(),[,w]=(0,H.useReducer)(()=>({})),d=(0,H.useRef)();function h(){let{ownerDocument:{defaultView:E}}=d.current,A=E.getSelection(),O=A.rangeCount>0?A.getRangeAt(0):null;return C({element:d.current,range:O,__unstableIsEditableTree:!0})}function v(E,{domOnly:A}={}){Ee({value:E,current:d.current,prepareEditableTree:l,__unstableDomOnly:A,placeholder:n})}let x=(0,H.useRef)(e),g=(0,H.useRef)();function L(){let E=g.current?.activeFormats;x.current=e,g.current=e,e instanceof j||(g.current=e?j.fromHTMLString(e,{preserveWhiteSpace:s}):j.empty()),g.current={text:g.current.text,formats:g.current.formats,replacements:g.current.replacements,activeFormats:E},i&&(g.current.formats=Array(e.length),g.current.replacements=Array(e.length)),f&&(g.current.formats=f(g.current)),g.current.start=t,g.current.end=r}let k=(0,H.useRef)(!1);g.current?(t!==g.current.start||r!==g.current.end)&&(k.current=c,g.current={...g.current,start:t,end:r,activeFormats:void 0}):(k.current=c,L());function U(E){if(g.current=E,v(E),i)x.current=E.text;else{let P=m?m(E):E.formats;E={...E,formats:P},typeof e=="string"?x.current=G({value:E,preserveWhiteSpace:s}):x.current=new j(E)}let{start:A,end:O,formats:p,text:D}=g.current;y.batch(()=>{o(A,O),a(x.current,{__unstableFormats:p,__unstableText:D})}),w()}function q(){let E=x.current;L();let A=E&&typeof E=="string"&&typeof e=="string"&&E.length!==e.length,O=d.current?.contains(d.current.ownerDocument.activeElement),p=A&&!O;v(g.current,{domOnly:p})}let W=(0,H.useRef)(!1);(0,H.useLayoutEffect)(()=>{W.current&&e!==x.current&&(q(),w())},[e]),(0,H.useLayoutEffect)(()=>{k.current&&(d.current.ownerDocument.activeElement!==d.current&&d.current.focus(),v(g.current),k.current=!1)},[k.current]);let T=(0,Rt.useMergeRefs)([d,He(),Xe({record:g}),ar({record:g,handleChange:U,applyRecord:v,createRecord:h,isSelected:c,onSelectionChange:o,forceRender:w}),(0,Rt.useRefEffect)(()=>{q(),W.current=!0},[n,...u])]);return{value:g.current,getValue:()=>g.current,onChange:U,ref:T}}function dr({allowedFormats:e,withoutInteractiveFormatting:t,onChange:r,__unstableDependencies:n=[],__unstableFormatTypeHandlerContext:o,...s}){let{formatTypes:a,prepareHandlers:i,valueHandlers:c,changeHandlers:u,dependencies:f}=fr({allowedFormats:e,withoutInteractiveFormatting:t,__unstableFormatTypeHandlerContext:o});function m(d){return c.reduce((h,v)=>v(h,d.text),d.formats)}function l(d){return a.forEach(h=>{h.__experimentalCreatePrepareEditableTree&&(d=st(d,h.name,0,d.text.length))}),d.formats}function y(d){return i.reduce((h,v)=>v(h,d.text),d.formats)}return{...pr({...s,onChange(d,{__unstableFormats:h,__unstableText:v}){r(d,{__unstableFormats:h,__unstableText:v}),Object.values(u).forEach(x=>{x(h,v)})},__unstableDependencies:[...f,...n],__unstableAfterParse:m,__unstableBeforeSerialize:l,__unstableAddInvisibleFormats:y}),formatTypes:a}}function hr(e){return(0,lr.default)("`__unstableUseRichText` hook",{since:"7.0"}),pr(e)}var Gt={};_e(Gt,{useRichText:dr});var gr=b(Y(),1),yr=b(qt(),1);function vr({ref:e,value:t,settings:r={}}){(0,yr.default)("`useAnchorRef` hook",{since:"6.1",alternative:"`useAnchor` hook"});let{tagName:n,className:o,name:s}=r,a=s?ot(t,s):void 0;return(0,gr.useMemo)(()=>{if(!e.current)return;let{ownerDocument:{defaultView:i}}=e.current,c=i.getSelection();if(!c.rangeCount)return;let u=c.getRangeAt(0);if(!a)return u;let f=u.startContainer;for(f=f.nextElementSibling||f;f.nodeType!==f.ELEMENT_NODE;)f=f.parentNode;return f.closest(n+(o?"."+o:""))},[a,t.start,t.end,n,o])}var wr=b(Nt(),1),_t=b(Y(),1),xr=b(br(),1);function Fn(e,t,r,n){let o=e.startContainer;if(o.nodeType===o.TEXT_NODE&&e.startOffset===o.length&&o.nextSibling)for(o=o.nextSibling;o.firstChild;)o=o.firstChild;if(o.nodeType!==o.ELEMENT_NODE&&(o=o.parentElement),!o||o===t||!t.contains(o))return;let s=r+(n?"."+n:"");for(;o!==t;){if(o.matches(s))return o;o=o.parentElement}}function Nn(e,t){return{contextElement:t,getBoundingClientRect(){return t.contains(e.startContainer)?(0,xr.getRectangleFromRange)(e)??e.getBoundingClientRect():t.getBoundingClientRect()}}}function Jt(e,t,r){if(!e)return;let{ownerDocument:n}=e,{defaultView:o}=n,s=o.getSelection();if(!s||!s.rangeCount)return;let a=s.getRangeAt(0);if(!a||!a.startContainer)return;let i=Fn(a,e,t,r);return i||Nn(a,e)}function Tr({editableContentElement:e,settings:t={}}){let{tagName:r,className:n,isActive:o}=t,[s,a]=(0,_t.useState)(()=>Jt(e,r,n)),i=(0,wr.usePrevious)(o);return(0,_t.useLayoutEffect)(()=>{if(!e)return;function c(){a(Jt(e,r,n))}function u(){m.addEventListener("selectionchange",c)}function f(){m.removeEventListener("selectionchange",c)}let{ownerDocument:m}=e;return(e===m.activeElement||!i&&o||i&&!o)&&(a(Jt(e,r,n)),u()),e.addEventListener("focusin",u),e.addEventListener("focusout",f),()=>{f(),e.removeEventListener("focusin",u),e.removeEventListener("focusout",f)}},[e,r,n,o,i]),s}function An(){}return Or(Cn);})(); date.js 0000644 00000540540 15206720414 0006030 0 ustar 00 "use strict"; var wp; (wp ||= {}).date = (() => { 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 __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; 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 )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // vendor-external:moment var require_moment = __commonJS({ "vendor-external:moment"(exports, module) { module.exports = window.moment; } }); // node_modules/moment-timezone/builds/moment-timezone-with-data-1970-2030.js var require_moment_timezone_with_data_1970_2030 = __commonJS({ "node_modules/moment-timezone/builds/moment-timezone-with-data-1970-2030.js"(exports, module) { (function(root, factory) { "use strict"; if (typeof module === "object" && module.exports) { module.exports = factory(require_moment()); } else if (typeof define === "function" && define.amd) { define(["moment"], factory); } else { factory(root.moment); } })(exports, function(moment) { "use strict"; if (moment.version === void 0 && moment.default) { moment = moment.default; } var VERSION = "0.5.43", zones = {}, links = {}, countries = {}, names = {}, guesses = {}, cachedGuess; if (!moment || typeof moment.version !== "string") { logError("Moment Timezone requires Moment.js. See https://momentjs.com/timezone/docs/#/use-it/browser/"); } var momentVersion = moment.version.split("."), major = +momentVersion[0], minor = +momentVersion[1]; if (major < 2 || major === 2 && minor < 6) { logError("Moment Timezone requires Moment.js >= 2.6.0. You are using Moment.js " + moment.version + ". See momentjs.com"); } function charCodeToInt(charCode) { if (charCode > 96) { return charCode - 87; } else if (charCode > 64) { return charCode - 29; } return charCode - 48; } function unpackBase60(string) { var i = 0, parts = string.split("."), whole = parts[0], fractional = parts[1] || "", multiplier = 1, num, out = 0, sign = 1; if (string.charCodeAt(0) === 45) { i = 1; sign = -1; } for (i; i < whole.length; i++) { num = charCodeToInt(whole.charCodeAt(i)); out = 60 * out + num; } for (i = 0; i < fractional.length; i++) { multiplier = multiplier / 60; num = charCodeToInt(fractional.charCodeAt(i)); out += num * multiplier; } return out * sign; } function arrayToInt(array) { for (var i = 0; i < array.length; i++) { array[i] = unpackBase60(array[i]); } } function intToUntil(array, length) { for (var i = 0; i < length; i++) { array[i] = Math.round((array[i - 1] || 0) + array[i] * 6e4); } array[length - 1] = Infinity; } function mapIndices(source, indices) { var out = [], i; for (i = 0; i < indices.length; i++) { out[i] = source[indices[i]]; } return out; } function unpack(string) { var data = string.split("|"), offsets = data[2].split(" "), indices = data[3].split(""), untils = data[4].split(" "); arrayToInt(offsets); arrayToInt(indices); arrayToInt(untils); intToUntil(untils, indices.length); return { name: data[0], abbrs: mapIndices(data[1].split(" "), indices), offsets: mapIndices(offsets, indices), untils, population: data[5] | 0 }; } function Zone(packedString) { if (packedString) { this._set(unpack(packedString)); } } Zone.prototype = { _set: function(unpacked) { this.name = unpacked.name; this.abbrs = unpacked.abbrs; this.untils = unpacked.untils; this.offsets = unpacked.offsets; this.population = unpacked.population; }, _index: function(timestamp) { var target = +timestamp, untils = this.untils, i; for (i = 0; i < untils.length; i++) { if (target < untils[i]) { return i; } } }, countries: function() { var zone_name = this.name; return Object.keys(countries).filter(function(country_code) { return countries[country_code].zones.indexOf(zone_name) !== -1; }); }, parse: function(timestamp) { var target = +timestamp, offsets = this.offsets, untils = this.untils, max = untils.length - 1, offset, offsetNext, offsetPrev, i; for (i = 0; i < max; i++) { offset = offsets[i]; offsetNext = offsets[i + 1]; offsetPrev = offsets[i ? i - 1 : i]; if (offset < offsetNext && tz.moveAmbiguousForward) { offset = offsetNext; } else if (offset > offsetPrev && tz.moveInvalidForward) { offset = offsetPrev; } if (target < untils[i] - offset * 6e4) { return offsets[i]; } } return offsets[max]; }, abbr: function(mom) { return this.abbrs[this._index(mom)]; }, offset: function(mom) { logError("zone.offset has been deprecated in favor of zone.utcOffset"); return this.offsets[this._index(mom)]; }, utcOffset: function(mom) { return this.offsets[this._index(mom)]; } }; function Country(country_name, zone_names) { this.name = country_name; this.zones = zone_names; } function OffsetAt(at) { var timeString = at.toTimeString(); var abbr = timeString.match(/\([a-z ]+\)/i); if (abbr && abbr[0]) { abbr = abbr[0].match(/[A-Z]/g); abbr = abbr ? abbr.join("") : void 0; } else { abbr = timeString.match(/[A-Z]{3,5}/g); abbr = abbr ? abbr[0] : void 0; } if (abbr === "GMT") { abbr = void 0; } this.at = +at; this.abbr = abbr; this.offset = at.getTimezoneOffset(); } function ZoneScore(zone) { this.zone = zone; this.offsetScore = 0; this.abbrScore = 0; } ZoneScore.prototype.scoreOffsetAt = function(offsetAt) { this.offsetScore += Math.abs(this.zone.utcOffset(offsetAt.at) - offsetAt.offset); if (this.zone.abbr(offsetAt.at).replace(/[^A-Z]/g, "") !== offsetAt.abbr) { this.abbrScore++; } }; function findChange(low, high) { var mid, diff; while (diff = ((high.at - low.at) / 12e4 | 0) * 6e4) { mid = new OffsetAt(new Date(low.at + diff)); if (mid.offset === low.offset) { low = mid; } else { high = mid; } } return low; } function userOffsets() { var startYear = (/* @__PURE__ */ new Date()).getFullYear() - 2, last = new OffsetAt(new Date(startYear, 0, 1)), offsets = [last], change, next, i; for (i = 1; i < 48; i++) { next = new OffsetAt(new Date(startYear, i, 1)); if (next.offset !== last.offset) { change = findChange(last, next); offsets.push(change); offsets.push(new OffsetAt(new Date(change.at + 6e4))); } last = next; } for (i = 0; i < 4; i++) { offsets.push(new OffsetAt(new Date(startYear + i, 0, 1))); offsets.push(new OffsetAt(new Date(startYear + i, 6, 1))); } return offsets; } function sortZoneScores(a, b) { if (a.offsetScore !== b.offsetScore) { return a.offsetScore - b.offsetScore; } if (a.abbrScore !== b.abbrScore) { return a.abbrScore - b.abbrScore; } if (a.zone.population !== b.zone.population) { return b.zone.population - a.zone.population; } return b.zone.name.localeCompare(a.zone.name); } function addToGuesses(name, offsets) { var i, offset; arrayToInt(offsets); for (i = 0; i < offsets.length; i++) { offset = offsets[i]; guesses[offset] = guesses[offset] || {}; guesses[offset][name] = true; } } function guessesForUserOffsets(offsets) { var offsetsLength = offsets.length, filteredGuesses = {}, out = [], i, j, guessesOffset; for (i = 0; i < offsetsLength; i++) { guessesOffset = guesses[offsets[i].offset] || {}; for (j in guessesOffset) { if (guessesOffset.hasOwnProperty(j)) { filteredGuesses[j] = true; } } } for (i in filteredGuesses) { if (filteredGuesses.hasOwnProperty(i)) { out.push(names[i]); } } return out; } function rebuildGuess() { try { var intlName = Intl.DateTimeFormat().resolvedOptions().timeZone; if (intlName && intlName.length > 3) { var name = names[normalizeName(intlName)]; if (name) { return name; } logError("Moment Timezone found " + intlName + " from the Intl api, but did not have that data loaded."); } } catch (e) { } var offsets = userOffsets(), offsetsLength = offsets.length, guesses2 = guessesForUserOffsets(offsets), zoneScores = [], zoneScore, i, j; for (i = 0; i < guesses2.length; i++) { zoneScore = new ZoneScore(getZone(guesses2[i]), offsetsLength); for (j = 0; j < offsetsLength; j++) { zoneScore.scoreOffsetAt(offsets[j]); } zoneScores.push(zoneScore); } zoneScores.sort(sortZoneScores); return zoneScores.length > 0 ? zoneScores[0].zone.name : void 0; } function guess(ignoreCache) { if (!cachedGuess || ignoreCache) { cachedGuess = rebuildGuess(); } return cachedGuess; } function normalizeName(name) { return (name || "").toLowerCase().replace(/\//g, "_"); } function addZone(packed) { var i, name, split, normalized; if (typeof packed === "string") { packed = [packed]; } for (i = 0; i < packed.length; i++) { split = packed[i].split("|"); name = split[0]; normalized = normalizeName(name); zones[normalized] = packed[i]; names[normalized] = name; addToGuesses(normalized, split[2].split(" ")); } } function getZone(name, caller) { name = normalizeName(name); var zone = zones[name]; var link; if (zone instanceof Zone) { return zone; } if (typeof zone === "string") { zone = new Zone(zone); zones[name] = zone; return zone; } if (links[name] && caller !== getZone && (link = getZone(links[name], getZone))) { zone = zones[name] = new Zone(); zone._set(link); zone.name = names[name]; return zone; } return null; } function getNames() { var i, out = []; for (i in names) { if (names.hasOwnProperty(i) && (zones[i] || zones[links[i]]) && names[i]) { out.push(names[i]); } } return out.sort(); } function getCountryNames() { return Object.keys(countries); } function addLink(aliases) { var i, alias, normal0, normal1; if (typeof aliases === "string") { aliases = [aliases]; } for (i = 0; i < aliases.length; i++) { alias = aliases[i].split("|"); normal0 = normalizeName(alias[0]); normal1 = normalizeName(alias[1]); links[normal0] = normal1; names[normal0] = alias[0]; links[normal1] = normal0; names[normal1] = alias[1]; } } function addCountries(data) { var i, country_code, country_zones, split; if (!data || !data.length) return; for (i = 0; i < data.length; i++) { split = data[i].split("|"); country_code = split[0].toUpperCase(); country_zones = split[1].split(" "); countries[country_code] = new Country( country_code, country_zones ); } } function getCountry(name) { name = name.toUpperCase(); return countries[name] || null; } function zonesForCountry(country, with_offset) { country = getCountry(country); if (!country) return null; var zones2 = country.zones.sort(); if (with_offset) { return zones2.map(function(zone_name) { var zone = getZone(zone_name); return { name: zone_name, offset: zone.utcOffset(/* @__PURE__ */ new Date()) }; }); } return zones2; } function loadData(data) { addZone(data.zones); addLink(data.links); addCountries(data.countries); tz.dataVersion = data.version; } function zoneExists(name) { if (!zoneExists.didShowError) { zoneExists.didShowError = true; logError("moment.tz.zoneExists('" + name + "') has been deprecated in favor of !moment.tz.zone('" + name + "')"); } return !!getZone(name); } function needsOffset(m) { var isUnixTimestamp = m._f === "X" || m._f === "x"; return !!(m._a && m._tzm === void 0 && !isUnixTimestamp); } function logError(message) { if (typeof console !== "undefined" && typeof console.error === "function") { console.error(message); } } function tz(input) { var args = Array.prototype.slice.call(arguments, 0, -1), name = arguments[arguments.length - 1], zone = getZone(name), out = moment.utc.apply(null, args); if (zone && !moment.isMoment(input) && needsOffset(out)) { out.add(zone.parse(out), "minutes"); } out.tz(name); return out; } tz.version = VERSION; tz.dataVersion = ""; tz._zones = zones; tz._links = links; tz._names = names; tz._countries = countries; tz.add = addZone; tz.link = addLink; tz.load = loadData; tz.zone = getZone; tz.zoneExists = zoneExists; tz.guess = guess; tz.names = getNames; tz.Zone = Zone; tz.unpack = unpack; tz.unpackBase60 = unpackBase60; tz.needsOffset = needsOffset; tz.moveInvalidForward = true; tz.moveAmbiguousForward = false; tz.countries = getCountryNames; tz.zonesForCountry = zonesForCountry; var fn = moment.fn; moment.tz = tz; moment.defaultZone = null; moment.updateOffset = function(mom, keepTime) { var zone = moment.defaultZone, offset; if (mom._z === void 0) { if (zone && needsOffset(mom) && !mom._isUTC) { mom._d = moment.utc(mom._a)._d; mom.utc().add(zone.parse(mom), "minutes"); } mom._z = zone; } if (mom._z) { offset = mom._z.utcOffset(mom); if (Math.abs(offset) < 16) { offset = offset / 60; } if (mom.utcOffset !== void 0) { var z = mom._z; mom.utcOffset(-offset, keepTime); mom._z = z; } else { mom.zone(offset, keepTime); } } }; fn.tz = function(name, keepTime) { if (name) { if (typeof name !== "string") { throw new Error("Time zone name must be a string, got " + name + " [" + typeof name + "]"); } this._z = getZone(name); if (this._z) { moment.updateOffset(this, keepTime); } else { logError("Moment Timezone has no data for " + name + ". See http://momentjs.com/timezone/docs/#/data-loading/."); } return this; } if (this._z) { return this._z.name; } }; function abbrWrap(old) { return function() { if (this._z) { return this._z.abbr(this); } return old.call(this); }; } function resetZoneWrap(old) { return function() { this._z = null; return old.apply(this, arguments); }; } function resetZoneWrap2(old) { return function() { if (arguments.length > 0) this._z = null; return old.apply(this, arguments); }; } fn.zoneName = abbrWrap(fn.zoneName); fn.zoneAbbr = abbrWrap(fn.zoneAbbr); fn.utc = resetZoneWrap(fn.utc); fn.local = resetZoneWrap(fn.local); fn.utcOffset = resetZoneWrap2(fn.utcOffset); moment.tz.setDefault = function(name) { if (major < 2 || major === 2 && minor < 9) { logError("Moment Timezone setDefault() requires Moment.js >= 2.9.0. You are using Moment.js " + moment.version + "."); } moment.defaultZone = name ? getZone(name) : null; return moment; }; var momentProperties = moment.momentProperties; if (Object.prototype.toString.call(momentProperties) === "[object Array]") { momentProperties.push("_z"); momentProperties.push("_a"); } else if (momentProperties) { momentProperties._z = null; } loadData({ "version": "2023c", "zones": [ "Africa/Abidjan|GMT|0|0||48e5", "Africa/Nairobi|EAT|-30|0||47e5", "Africa/Algiers|WET WEST CET CEST|0 -10 -10 -20|01012320102|3bX0 11A0 dDd0 17b0 11B0 1cN0 2Dy0 1cN0 1fB0 1cL0|26e5", "Africa/Lagos|WAT|-10|0||17e6", "Africa/Bissau|-01 GMT|10 0|01|cap0|39e4", "Africa/Maputo|CAT|-20|0||26e5", "Africa/Cairo|EET EEST|-20 -30|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|LX0 11d0 1oL0 11d0 1pb0 11d0 1oL0 11d0 1oL0 11d0 1oL0 11d0 1pb0 11d0 1oL0 11d0 1oL0 11d0 1oL0 11d0 1pb0 11d0 1oL0 11d0 1WL0 rd0 1Rz0 wp0 1pb0 11d0 1oL0 11d0 1oL0 11d0 1oL0 11d0 1pb0 11d0 1qL0 Xd0 1oL0 11d0 1oL0 11d0 1pb0 11d0 1oL0 11d0 1oL0 11d0 1ny0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 11z0 1o10 11z0 1o10 WL0 1qN0 Rb0 1wp0 On0 1zd0 Lz0 1EN0 Fb0 c10 8n0 8Nd0 gL0 e10 mn0 kSp0 1cL0 1cN0 1fz0 1a10 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0|15e6", "Africa/Casablanca|+00 +01|0 -10|01010101010101010101010101010101010101010101010101010101010101010101010|aS00 rz0 43d0 AL0 1Nd0 XX0 1Cp0 pz0 dEp0 4mn0 SyN0 AL0 1Nd0 wn0 1FB0 Db0 1zd0 Lz0 1Nf0 wM0 co0 go0 1o00 s00 dA0 vc0 11A0 A00 e00 y00 11A0 uM0 e00 Dc0 11A0 s00 e00 IM0 WM0 mo0 gM0 LA0 WM0 jA0 e00 28M0 e00 2600 gM0 2600 e00 2600 gM0 2600 e00 28M0 e00 2600 gM0 2600 e00 28M0 e00 2600 gM0 2600 e00 2600 gM0 2600|32e5", "Africa/Ceuta|WET WEST CET CEST|0 -10 -10 -20|0101010102323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232|aS00 rz0 43d0 AL0 1Nd0 XX0 1Cp0 pz0 dEp0 4VB0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|85e3", "Africa/El_Aaiun|-01 +00 +01|10 0 -10|01212121212121212121212121212121212121212121212121212121212121212121|fi10 6L0 AL0 1Nd0 XX0 1Cp0 pz0 1cBB0 AL0 1Nd0 wn0 1FB0 Db0 1zd0 Lz0 1Nf0 wM0 co0 go0 1o00 s00 dA0 vc0 11A0 A00 e00 y00 11A0 uM0 e00 Dc0 11A0 s00 e00 IM0 WM0 mo0 gM0 LA0 WM0 jA0 e00 28M0 e00 2600 gM0 2600 e00 2600 gM0 2600 e00 28M0 e00 2600 gM0 2600 e00 28M0 e00 2600 gM0 2600 e00 2600 gM0 2600|20e4", "Africa/Johannesburg|SAST|-20|0||84e5", "Africa/Juba|CAT CAST EAT|-20 -30 -30|01010101010101010101010101010101020|LW0 16L0 1iN0 17b0 1jd0 17b0 1ip0 17z0 1i10 17X0 1hB0 18n0 1hd0 19b0 1gp0 19z0 1iN0 17b0 1ip0 17z0 1i10 18n0 1hd0 18L0 1gN0 19b0 1gp0 19z0 1iN0 17z0 1i10 17X0 yGd0 PeX0|", "Africa/Khartoum|CAT CAST EAT|-20 -30 -30|01010101010101010101010101010101020|LW0 16L0 1iN0 17b0 1jd0 17b0 1ip0 17z0 1i10 17X0 1hB0 18n0 1hd0 19b0 1gp0 19z0 1iN0 17b0 1ip0 17z0 1i10 18n0 1hd0 18L0 1gN0 19b0 1gp0 19z0 1iN0 17z0 1i10 17X0 yGd0 HjL0|51e5", "Africa/Monrovia|MMT GMT|I.u 0|01|4SoI.u|11e5", "Africa/Ndjamena|WAT WAST|-10 -20|010|nNb0 Wn0|13e5", "Africa/Sao_Tome|GMT WAT|0 -10|010|1UQN0 2q00|", "Africa/Tripoli|EET CET CEST|-20 -10 -20|0121212121212121210120120|tda0 A10 1db0 1cN0 1db0 1dd0 1db0 1eN0 1bb0 1e10 1cL0 1c10 1db0 1dd0 1db0 1cN0 1db0 1q10 fAn0 1ep0 1db0 AKq0 TA0 1o00|11e5", "Africa/Tunis|CET CEST|-10 -20|0101010101010101010|hOn0 WM0 1rA0 11c0 nwo0 Ko0 1cM0 1cM0 1rA0 10M0 zuM0 10N0 1aN0 1qM0 WM0 1qM0 11A0 1o00|20e5", "Africa/Windhoek|SAST CAT WAT|-20 -20 -10|01212121212121212121212121212121212121212121212121|Ndy0 9Io0 16P0 1nX0 11B0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0|32e4", "America/Adak|BST BDT AHST HST HDT|b0 a0 a0 a0 90|0101010101010101010101010101234343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343|Kd0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 cm0 10q0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|326", "America/Anchorage|AHST AHDT YST AKST AKDT|a0 90 90 90 80|0101010101010101010101010101234343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343|Kc0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 cm0 10q0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|30e4", "America/Puerto_Rico|AST|40|0||24e5", "America/Araguaina|-03 -02|30 20|01010101010101010101010101010|CxD0 Rb0 1tB0 IL0 1Fd0 FX0 1EN0 FX0 1HB0 Lz0 dMN0 Lz0 1zd0 Rb0 1wN0 Wn0 1tB0 Rb0 1tB0 WL0 1tB0 Rb0 1zd0 On0 1HB0 FX0 ny10 Lz0|14e4", "America/Argentina/Buenos_Aires|-03 -02|30 20|01010101010101010|9Rf0 Db0 zvd0 Bz0 1tB0 TX0 1wp0 Rb0 1wp0 Rb0 1wp0 TX0 A4p0 uL0 1qN0 WL0|", "America/Argentina/Catamarca|-03 -02 -04|30 20 40|01010101210102010|9Rf0 Db0 zvd0 Bz0 1tB0 TX0 1wp0 Rb0 1wq0 Ra0 1wp0 TX0 rlB0 7B0 8zb0 uL0|", "America/Argentina/Cordoba|-03 -02 -04|30 20 40|01010101210101010|9Rf0 Db0 zvd0 Bz0 1tB0 TX0 1wp0 Rb0 1wq0 Ra0 1wp0 TX0 A4p0 uL0 1qN0 WL0|", "America/Argentina/Jujuy|-03 -02 -04|30 20 40|010101202101010|9Rf0 Db0 zvd0 Bz0 1tB0 TX0 1ze0 TX0 1ld0 WK0 1wp0 TX0 A4p0 uL0|", "America/Argentina/La_Rioja|-03 -02 -04|30 20 40|010101012010102010|9Rf0 Db0 zvd0 Bz0 1tB0 TX0 1wp0 Qn0 qO0 16n0 Rb0 1wp0 TX0 rlB0 7B0 8zb0 uL0|", "America/Argentina/Mendoza|-03 -02 -04|30 20 40|01010120202102010|9Rf0 Db0 zvd0 Bz0 1tB0 TX0 1u20 SL0 1vd0 Tb0 1wp0 TW0 ri10 Op0 7TX0 uL0|", "America/Argentina/Rio_Gallegos|-03 -02 -04|30 20 40|01010101010102010|9Rf0 Db0 zvd0 Bz0 1tB0 TX0 1wp0 Rb0 1wp0 Rb0 1wp0 TX0 rlB0 7B0 8zb0 uL0|", "America/Argentina/Salta|-03 -02 -04|30 20 40|010101012101010|9Rf0 Db0 zvd0 Bz0 1tB0 TX0 1wp0 Rb0 1wq0 Ra0 1wp0 TX0 A4p0 uL0|", "America/Argentina/San_Juan|-03 -02 -04|30 20 40|010101012010102010|9Rf0 Db0 zvd0 Bz0 1tB0 TX0 1wp0 Qn0 qO0 16n0 Rb0 1wp0 TX0 rld0 m10 8lb0 uL0|", "America/Argentina/San_Luis|-03 -02 -04|30 20 40|010101202020102020|9Rf0 Db0 zvd0 Bz0 1tB0 XX0 1q20 SL0 AN0 vDb0 m10 8lb0 8L0 jd0 1qN0 WL0 1qN0|", "America/Argentina/Tucuman|-03 -02 -04|30 20 40|0101010121010201010|9Rf0 Db0 zvd0 Bz0 1tB0 TX0 1wp0 Rb0 1wq0 Ra0 1wp0 TX0 rlB0 4N0 8BX0 uL0 1qN0 WL0|", "America/Argentina/Ushuaia|-03 -02 -04|30 20 40|01010101010102010|9Rf0 Db0 zvd0 Bz0 1tB0 TX0 1wp0 Rb0 1wp0 Rb0 1wp0 TX0 rkN0 8p0 8zb0 uL0|", "America/Asuncion|-04 -03|40 30|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101|6FE0 3CL0 3Dd0 10L0 1pB0 10n0 1pB0 10n0 1pB0 1cL0 1dd0 1db0 1dd0 1cL0 1dd0 1cL0 1dd0 1cL0 1dd0 1db0 1dd0 1cL0 1dd0 1cL0 1dd0 1cL0 1dd0 1db0 1dd0 1cL0 1lB0 14n0 1dd0 1cL0 1fd0 WL0 1rd0 1aL0 1dB0 Xz0 1qp0 Xb0 1qN0 10L0 1rB0 TX0 1tB0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1qN0 1cL0 WN0 1qL0 11B0 1nX0 1ip0 WL0 1qN0 WL0 1qN0 WL0 1tB0 TX0 1tB0 TX0 1tB0 19X0 1a10 1fz0 1a10 1fz0 1cN0 17b0 1ip0 17b0 1ip0 17b0 1ip0 19X0 1fB0 19X0 1fB0 19X0 1ip0 17b0 1ip0 17b0 1ip0 19X0 1fB0 19X0 1fB0 19X0 1fB0 19X0 1ip0 17b0 1ip0 17b0 1ip0 19X0 1fB0 19X0 1fB0 19X0 1ip0 17b0 1ip0|28e5", "America/Panama|EST|50|0||15e5", "America/Bahia_Banderas|PST MST MDT CDT CST|80 70 60 50 60|01212121212121212121212121212134343434343434343434343434|80 13Vd0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 1fB0 WL0 1fB0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nW0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0|84e3", "America/Bahia|-03 -02|30 20|010101010101010101010101010101010101010|CxD0 Rb0 1tB0 IL0 1Fd0 FX0 1EN0 FX0 1HB0 Lz0 1EN0 Lz0 1C10 IL0 1HB0 Db0 1HB0 On0 1zd0 On0 1zd0 Lz0 1zd0 Rb0 1wN0 Wn0 1tB0 Rb0 1tB0 WL0 1tB0 Rb0 1zd0 On0 1HB0 FX0 l5B0 Rb0|27e5", "America/Barbados|AST ADT|40 30|010101010|i7G0 IL0 1ip0 17b0 1ip0 17b0 1ld0 13b0|28e4", "America/Belem|-03 -02|30 20|0101010|CxD0 Rb0 1tB0 IL0 1Fd0 FX0|20e5", "America/Belize|CST CDT|60 50|01010|9xG0 qn0 lxB0 mn0|57e3", "America/Boa_Vista|-04 -03|40 30|01010101010|CxE0 Rb0 1tB0 IL0 1Fd0 FX0 smp0 WL0 1tB0 2L0|62e2", "America/Bogota|-05 -04|50 40|010|Snh0 1PX0|90e5", "America/Boise|MST MDT|70 60|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|K90 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 Dd0 1Kn0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|21e4", "America/Cambridge_Bay|MST MDT CST CDT EST|70 60 60 50 50|010101010101010101010101010101010101010101010101010101012342101010101010101010101010101010101010101010101010101010101010|5E90 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11A0 1nX0 2K0 WQ0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|15e2", "America/Campo_Grande|-04 -03|40 30|010101010101010101010101010101010101010101010101010101010101010101010|CxE0 Rb0 1tB0 IL0 1Fd0 FX0 1EN0 FX0 1HB0 Lz0 1EN0 Lz0 1C10 IL0 1HB0 Db0 1HB0 On0 1zd0 On0 1zd0 Lz0 1zd0 Rb0 1wN0 Wn0 1tB0 Rb0 1tB0 WL0 1tB0 Rb0 1zd0 On0 1HB0 FX0 1C10 Lz0 1Ip0 HX0 1zd0 On0 1HB0 IL0 1wp0 On0 1C10 Lz0 1C10 On0 1zd0 On0 1zd0 Rb0 1zd0 Lz0 1C10 Lz0 1C10 On0 1zd0 On0 1zd0 On0 1zd0 On0 1HB0 FX0|77e4", "America/Cancun|CST EST EDT CDT|60 50 40 50|012121230303030303030303030303030303030301|t9G0 yLB0 1lb0 14p0 1lb0 14p0 Lz0 xB0 14p0 1nX0 11B0 1nX0 1fB0 WL0 1fB0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 Dd0|63e4", "America/Caracas|-04 -0430|40 4u|010|1wmv0 kqo0|29e5", "America/Cayenne|-03|30|0||58e3", "America/Chicago|CST CDT|60 50|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|K80 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|92e5", "America/Chihuahua|CST CDT MDT MST|60 50 60 70|0101023232323232323232323232323232323232323232323232320|13Vk0 1lb0 14p0 1lb0 14q0 1lb0 14p0 1nX0 11B0 1nX0 1fB0 WL0 1fB0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0|81e4", "America/Ciudad_Juarez|CST CDT MDT MST|60 50 60 70|010102323232323232323232323232323232323232323232323232032323232323232323|13Vk0 1lb0 14p0 1lb0 14q0 1lb0 14p0 1nX0 11B0 1nX0 1fB0 WL0 1fB0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 U10 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1wn0 cm0 EP0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|", "America/Costa_Rica|CST CDT|60 50|010101010|mgS0 Db0 1Kp0 Db0 pRB0 15b0 1kp0 mL0|12e5", "America/Phoenix|MST|70|0||42e5", "America/Cuiaba|-04 -03|40 30|0101010101010101010101010101010101010101010101010101010101010101010|CxE0 Rb0 1tB0 IL0 1Fd0 FX0 1EN0 FX0 1HB0 Lz0 1EN0 Lz0 1C10 IL0 1HB0 Db0 1HB0 On0 1zd0 On0 1zd0 Lz0 1zd0 Rb0 1wN0 Wn0 1tB0 Rb0 1tB0 WL0 1tB0 Rb0 1zd0 On0 1HB0 FX0 4a10 HX0 1zd0 On0 1HB0 IL0 1wp0 On0 1C10 Lz0 1C10 On0 1zd0 On0 1zd0 Rb0 1zd0 Lz0 1C10 Lz0 1C10 On0 1zd0 On0 1zd0 On0 1zd0 On0 1HB0 FX0|54e4", "America/Danmarkshavn|-03 -02 GMT|30 20 0|0101010101010101010101010101010102|oXh0 19U0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 DC0|8", "America/Dawson_Creek|PST PDT MST|80 70 70|0101012|Ka0 1cL0 1cN0 1fz0 1cN0 ML0|12e3", "America/Dawson|YST PST PDT MST|90 80 70 70|012121212121212121212121212121212121212121212121212121212121212121212121212121212123|9ix0 fNd0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1z90|13e2", "America/Denver|MST MDT|70 60|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|K90 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|26e5", "America/Detroit|EST EDT|50 40|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|85H0 1cL0 s10 1Vz0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|37e5", "America/Edmonton|MST MDT|70 60|01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|5E90 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|10e5", "America/Eirunepe|-05 -04|50 40|01010101010|CxF0 Rb0 1tB0 IL0 1Fd0 FX0 dPB0 On0 yTd0 d5X0|31e3", "America/El_Salvador|CST CDT|60 50|01010|Gcu0 WL0 1qN0 WL0|11e5", "America/Tijuana|PST PDT|80 70|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|fmy0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 U10 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|20e5", "America/Fort_Nelson|PST PDT MST|80 70 70|01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010102|Ka0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0|39e2", "America/Fort_Wayne|EST EDT|50 40|01010101010101010101010101010101010101010101010101010|K70 1cL0 1qhd0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|", "America/Fortaleza|-03 -02|30 20|01010101010101010|CxD0 Rb0 1tB0 IL0 1Fd0 FX0 1EN0 FX0 1HB0 Lz0 nsp0 WL0 1tB0 5z0 2mN0 On0|34e5", "America/Glace_Bay|AST ADT|40 30|01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|5E60 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|19e3", "America/Godthab|-03 -02 -01|30 20 10|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010121212121212121|oXh0 19U0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 2so0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|17e3", "America/Goose_Bay|AST ADT ADDT|40 30 20|010101010101010101010101010101010101020101010101010101010101010101010101010101010101010101010101010101010101010101010101010|K60 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14n1 1lb0 14p0 1nW0 11C0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zcX Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|76e2", "America/Grand_Turk|EST EDT AST|50 40 40|0101010101010101010101010101010101010101010101010101010101010101010101010210101010101010101010101010|mG70 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 7jA0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|37e2", "America/Guatemala|CST CDT|60 50|010101010|9tG0 An0 mtd0 Nz0 ifB0 17b0 zDB0 11z0|13e5", "America/Guayaquil|-05 -04|50 40|010|TKR0 rz0|27e5", "America/Guyana|-0345 -03 -04|3J 30 40|012|dzfJ Ey0f|80e4", "America/Halifax|AST ADT|40 30|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|K60 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|39e4", "America/Havana|CST CDT|50 40|01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|K50 1cL0 1cN0 1fz0 1cN0 14n0 1ld0 14L0 1kN0 15b0 1kp0 1cL0 1cN0 1fz0 1a10 1fz0 1fB0 11z0 14p0 1nX0 11B0 1nX0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 14n0 1ld0 14n0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 1a10 1in0 1a10 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1cM0 1cM0 1fA0 17c0 1o00 11A0 1qM0 11A0 1o00 11A0 1o00 14o0 1lc0 14o0 1lc0 11A0 6i00 Rc0 1wo0 U00 1tA0 Rc0 1wo0 U00 1wo0 U00 1zc0 U00 1qM0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0|21e5", "America/Hermosillo|PST MST MDT|80 70 60|01212121|80 13Vd0 1lb0 14p0 1lb0 14p0 1lb0|64e4", "America/Indiana/Knox|CST CDT EST|60 50 50|01010101010101010101010101010101010101010101210101010101010101010101010101010101010101010101010|K80 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 z8o0 1o00 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|", "America/Indiana/Marengo|EST EDT CDT|50 40 50|010101010201010101010101010101010101010101010101010101010101010|K70 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1VA0 LA0 1BX0 1e6p0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|", "America/Indiana/Petersburg|CST CDT EST EDT|60 50 50 40|0101010101010101210123232323232323232323232323232323232323232323232|K80 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 19co0 1o00 Rd0 1zb0 Oo0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|", "America/Indiana/Tell_City|EST EDT CDT CST|50 40 50 60|01023232323232323232323232323232323232323232323232323|K70 1cL0 1qhd0 1o00 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|", "America/Indiana/Vevay|EST EDT|50 40|010101010101010101010101010101010101010101010101010101010|K70 1cL0 1cN0 1fz0 1cN0 1cL0 1lnd0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|", "America/Indiana/Vincennes|EST EDT CDT CST|50 40 50 60|01023201010101010101010101010101010101010101010101010|K70 1cL0 1qhd0 1o00 Rd0 1zb0 Oo0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|", "America/Indiana/Winamac|EST EDT CDT CST|50 40 50 60|01023101010101010101010101010101010101010101010101010|K70 1cL0 1qhd0 1o00 Rd0 1za0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|", "America/Inuvik|PST PDT MDT MST|80 70 60 70|01010101010101023232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323|5Ea0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cK0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|35e2", "America/Iqaluit|EST EDT CST CDT|50 40 60 50|01010101010101010101010101010101010101010101010101010101230101010101010101010101010101010101010101010101010101010101010|5E70 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11C0 1nX0 11A0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|67e2", "America/Jamaica|EST EDT|50 40|010101010101010101010|9Kv0 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0|94e4", "America/Juneau|PST PDT YDT YST AKST AKDT|80 70 80 90 90 80|0101010101010101010102010101345454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454|Ka0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cM0 1cM0 1cL0 1cN0 1fz0 1a10 1fz0 co0 10q0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|33e3", "America/Kentucky/Louisville|EST EDT CDT|50 40 50|010101010201010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|K70 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1VA0 LA0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|", "America/Kentucky/Monticello|CST CDT EST EDT|60 50 50 40|010101010101010101010101010101010101010101010101010101010101012323232323232323232323232323232323232323232323232323232323232|K80 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11A0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|", "America/La_Paz|-04|40|0||19e5", "America/Lima|-05 -04|50 40|010101010|CVF0 zX0 1O10 zX0 6Gp0 zX0 98p0 zX0|11e6", "America/Los_Angeles|PST PDT|80 70|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|Ka0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|15e6", "America/Maceio|-03 -02|30 20|0101010101010101010|CxD0 Rb0 1tB0 IL0 1Fd0 FX0 1EN0 FX0 1HB0 Lz0 dMN0 Lz0 8Q10 WL0 1tB0 5z0 2mN0 On0|93e4", "America/Managua|CST EST CDT|60 50 50|010202010102020|86u0 4mn0 9Up0 Dz0 1K10 Dz0 s3F0 1KH0 DB0 9In0 k8p0 19X0 1o30 11y0|22e5", "America/Manaus|-04 -03|40 30|010101010|CxE0 Rb0 1tB0 IL0 1Fd0 FX0 dPB0 On0|19e5", "America/Martinique|AST ADT|40 30|010|oXg0 19X0|39e4", "America/Matamoros|CST CDT|60 50|0101010101010101010101010101010101010101010101010101010101010101010101010|IqU0 1nX0 i6p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 1fB0 WL0 1fB0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 U10 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|45e4", "America/Mazatlan|PST MST MDT|80 70 60|01212121212121212121212121212121212121212121212121212121|80 13Vd0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 1fB0 WL0 1fB0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0|44e4", "America/Menominee|EST CDT CST|50 50 60|012121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212|85H0 1cM0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|85e2", "America/Merida|CST EST CDT|60 50 50|010202020202020202020202020202020202020202020202020202020|t9G0 2hz0 wu30 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 1fB0 WL0 1fB0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0|11e5", "America/Metlakatla|PST PDT AKST AKDT|80 70 90 80|0101010101010101010101010101023232302323232323232323232323232|Ka0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1hU10 Rd0 1zb0 Op0 1zb0 Op0 1zb0 uM0 jB0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|14e2", "America/Mexico_City|CST CDT|60 50|0101010101010101010101010101010101010101010101010101010|13Vk0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 1fB0 WL0 1fB0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0|20e6", "America/Miquelon|AST -03 -02|40 30 20|012121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|p9g0 gQ10 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|61e2", "America/Moncton|AST ADT|40 30|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|K60 1cL0 1cN0 1fz0 1cN0 1cL0 3Cp0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14n1 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 ReX 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|64e3", "America/Monterrey|CST CDT|60 50|010101010101010101010101010101010101010101010101010101010|IqU0 1nX0 i6p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 1fB0 WL0 1fB0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0|41e5", "America/Montevideo|-03 -02 -0130 -0230|30 20 1u 2u|0101023010101010101010101010101010101010101010101010|JD0 jX0 4vB0 xz0 3Cp0 mmu 1a10 IMu Db0 4c10 uL0 1Nd0 An0 1SN0 uL0 mp0 28L0 iPB0 un0 1SN0 xz0 1zd0 Lz0 1zd0 Rb0 1zd0 On0 1wp0 Rb0 s8p0 1fB0 1ip0 11z0 1ld0 14n0 1o10 11z0 1o10 11z0 1o10 14n0 1ld0 14n0 1ld0 14n0 1o10 11z0 1o10 11z0 1o10 11z0|17e5", "America/Toronto|EST EDT|50 40|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|K70 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|65e5", "America/New_York|EST EDT|50 40|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|K70 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|21e6", "America/Nome|BST BDT YST AKST AKDT|b0 a0 90 90 80|0101010101010101010101010101234343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343|Kd0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 cl0 10q0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|38e2", "America/Noronha|-02 -01|20 10|01010101010101010|CxC0 Rb0 1tB0 IL0 1Fd0 FX0 1EN0 FX0 1HB0 Lz0 nsp0 WL0 1tB0 2L0 2pB0 On0|30e2", "America/North_Dakota/Beulah|MST MDT CST CDT|70 60 60 50|010101010101010101010101010101010101010101010101010101010101010101010101010101010123232323232323232323232323232323232323232|K90 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Oo0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|", "America/North_Dakota/Center|MST MDT CST CDT|70 60 60 50|010101010101010101010101010101010101010101010123232323232323232323232323232323232323232323232323232323232323232323232323232|K90 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14o0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|", "America/North_Dakota/New_Salem|MST MDT CST CDT|70 60 60 50|010101010101010101010101010101010101010101010101010101010101010101012323232323232323232323232323232323232323232323232323232|K90 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14o0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|", "America/Ojinaga|CST CDT MDT MST|60 50 60 70|01010232323232323232323232323232323232323232323232323201010101010101010|13Vk0 1lb0 14p0 1lb0 14q0 1lb0 14p0 1nX0 11B0 1nX0 1fB0 WL0 1fB0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 U10 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1wn0 Rc0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|23e3", "America/Paramaribo|-0330 -03|3u 30|01|zSPu|24e4", "America/Port-au-Prince|EST EDT|50 40|01010101010101010101010101010101010101010101010101010101010101010101010|wu50 19X0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14q0 1o00 11A0 1o00 11A0 1o00 14o0 1lc0 14o0 1lc0 14o0 1o00 11A0 1o00 11A0 1o00 14o0 1lc0 14o0 1lc0 i6n0 1nX0 11B0 1nX0 d430 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 3iN0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|23e5", "America/Rio_Branco|-05 -04|50 40|010101010|CxF0 Rb0 1tB0 IL0 1Fd0 FX0 NBd0 d5X0|31e4", "America/Porto_Velho|-04 -03|40 30|0101010|CxE0 Rb0 1tB0 IL0 1Fd0 FX0|37e4", "America/Punta_Arenas|-03 -04|30 40|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|yP0 1ip0 11z0 1o10 11z0 1qN0 WL0 1ld0 14n0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 WL0 1qN0 1cL0 1cN0 11z0 1o10 11z0 1qN0 WL0 1fB0 19X0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 17b0 1ip0 11z0 1ip0 1fz0 1fB0 11z0 1qN0 WL0 1qN0 WL0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 17b0 1ip0 11z0 1o10 19X0 1fB0 1nX0 G10 1EL0 Op0 1zb0 Rd0 1wn0 Rd0 46n0 Ap0|", "America/Winnipeg|CST CDT|60 50|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|K80 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1a00 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1a00 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 14o0 1lc0 14o0 1o00 11A0 1o00 11A0 1o00 14o0 1lc0 14o0 1lc0 14o0 1o00 11A0 1o00 11A0 1o00 14o0 1lc0 14o0 1lc0 14o0 1lc0 14o0 1o00 11A0 1o00 11A0 1o00 14o0 1lc0 14o0 1lc0 14o0 1o00 11A0 1o00 11A0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|66e4", "America/Rankin_Inlet|CST CDT EST|60 50 50|01010101010101010101010101010101010101010101010101010101012101010101010101010101010101010101010101010101010101010101010|5E80 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|26e2", "America/Recife|-03 -02|30 20|01010101010101010|CxD0 Rb0 1tB0 IL0 1Fd0 FX0 1EN0 FX0 1HB0 Lz0 nsp0 WL0 1tB0 2L0 2pB0 On0|33e5", "America/Regina|CST|60|0||19e4", "America/Resolute|CST CDT EST|60 50 50|01010101010101010101010101010101010101010101010101010101012101010101012101010101010101010101010101010101010101010101010|5E80 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|229", "America/Santarem|-04 -03|40 30|01010101|CxE0 Rb0 1tB0 IL0 1Fd0 FX0 NBd0|21e4", "America/Santiago|-03 -04|30 40|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|yP0 1ip0 11z0 1o10 11z0 1qN0 WL0 1ld0 14n0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 WL0 1qN0 1cL0 1cN0 11z0 1o10 11z0 1qN0 WL0 1fB0 19X0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 17b0 1ip0 11z0 1ip0 1fz0 1fB0 11z0 1qN0 WL0 1qN0 WL0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 17b0 1ip0 11z0 1o10 19X0 1fB0 1nX0 G10 1EL0 Op0 1zb0 Rd0 1wn0 Rd0 46n0 Ap0 1Nb0 Ap0 1Nb0 Ap0 1zb0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 11B0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 11B0|62e5", "America/Santo_Domingo|-0430 EST AST|4u 50 40|0101010101212|ksu 1Cou yLu 1RAu wLu 1QMu xzu 1Q0u xXu 1PAu 13jB0 e00|29e5", "America/Sao_Paulo|-03 -02|30 20|010101010101010101010101010101010101010101010101010101010101010101010|CxD0 Rb0 1tB0 IL0 1Fd0 FX0 1EN0 FX0 1HB0 Lz0 1EN0 Lz0 1C10 IL0 1HB0 Db0 1HB0 On0 1zd0 On0 1zd0 Lz0 1zd0 Rb0 1wN0 Wn0 1tB0 Rb0 1tB0 WL0 1tB0 Rb0 1zd0 On0 1HB0 FX0 1C10 Lz0 1Ip0 HX0 1zd0 On0 1HB0 IL0 1wp0 On0 1C10 Lz0 1C10 On0 1zd0 On0 1zd0 Rb0 1zd0 Lz0 1C10 Lz0 1C10 On0 1zd0 On0 1zd0 On0 1zd0 On0 1HB0 FX0|20e6", "America/Scoresbysund|-02 -01 +00|20 10 0|0102121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|oXg0 1a00 1cK0 1cL0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|452", "America/Sitka|PST PDT YST AKST AKDT|80 70 90 90 80|0101010101010101010101010101234343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343|Ka0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 co0 10q0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|90e2", "America/St_Johns|NST NDT NDDT|3u 2u 1u|010101010101010101010101010101010101020101010101010101010101010101010101010101010101010101010101010101010101010101010101010|K5u 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14n1 1lb0 14p0 1nW0 11C0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zcX Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|11e4", "America/Swift_Current|MST CST|70 60|01|5E90|16e3", "America/Tegucigalpa|CST CDT|60 50|0101010|Gcu0 WL0 1qN0 WL0 GRd0 AL0|11e5", "America/Thule|AST ADT|40 30|010101010101010101010101010101010101010101010101010101010101010101010101010101010|PHG0 1cL0 1cN0 1cL0 1fB0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|656", "America/Vancouver|PST PDT|80 70|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|Ka0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|23e5", "America/Whitehorse|PST PDT MST|80 70 70|01010101010101010101010101010101010101010101010101010101010101010101010101010101012|p7K0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1z90|23e3", "America/Yakutat|YST YDT AKST AKDT|90 80 90 80|0101010101010101010101010101023232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232|Kb0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 cn0 10q0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|642", "Antarctica/Casey|+08 +11|-80 -b0|010101010101|1ARS0 T90 40P0 KL0 blz0 3m10 1o30 14k0 1kr0 12l0 1o01|10", "Antarctica/Davis|+07 +05|-70 -50|01010|1ART0 VB0 3Wn0 KN0|70", "Pacific/Port_Moresby|+10|-a0|0||25e4", "Antarctica/Macquarie|AEDT AEST|-b0 -a0|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|qg0 1wo0 U00 1wo0 LA0 1C00 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 11A0 1qM0 WM0 1qM0 Oo0 1zc0 Oo0 1zc0 Oo0 1wo0 WM0 1tA0 WM0 1tA0 U00 1tA0 U00 1tA0 11A0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 11A0 1o00 1io0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1cM0 1a00 1io0 1cM0 1cM0 1cM0 1cM0 3Co0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0|1", "Antarctica/Mawson|+06 +05|-60 -50|01|1ARU0|60", "Pacific/Auckland|NZST NZDT|-c0 -d0|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101|bKC0 IM0 1C00 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1qM0 14o0 1lc0 14o0 1lc0 14o0 1lc0 17c0 1io0 17c0 1io0 17c0 1io0 17c0 1lc0 14o0 1lc0 14o0 1lc0 17c0 1io0 17c0 1io0 17c0 1lc0 14o0 1lc0 14o0 1lc0 17c0 1io0 17c0 1io0 17c0 1io0 17c0 1io0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1io0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00|14e5", "Antarctica/Palmer|-03 -02 -04|30 20 40|01020202020202020202020202020202020202020202020202020202020202020202020|9Rf0 Db0 jsN0 14N0 11z0 1o10 11z0 1qN0 WL0 1qN0 WL0 1qN0 1cL0 1cN0 11z0 1o10 11z0 1qN0 WL0 1fB0 19X0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 17b0 1ip0 11z0 1ip0 1fz0 1fB0 11z0 1qN0 WL0 1qN0 WL0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 17b0 1ip0 11z0 1o10 19X0 1fB0 1nX0 G10 1EL0 Op0 1zb0 Rd0 1wn0 Rd0 46n0 Ap0|40", "Antarctica/Rothera|-00 -03|0 30|01|gOo0|130", "Asia/Riyadh|+03|-30|0||57e5", "Antarctica/Troll|-00 +00 +02|0 0 -20|012121212121212121212121212121212121212121212121212121|1puo0 hd0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|40", "Asia/Urumqi|+06|-60|0||32e5", "Europe/Berlin|CET CEST|-10 -20|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|oXd0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|41e5", "Asia/Almaty|+06 +07 +05|-60 -70 -50|0101010101010101010102010101010101010101010101010|rn60 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0|15e5", "Asia/Amman|EET EEST +03|-20 -30 -30|010101010101010101010101010101010101010101010101010101010101010101010101010101010101012|8kK0 KL0 1oN0 11b0 1oN0 11b0 1pd0 1dz0 1cp0 11b0 1op0 11b0 fO10 1db0 1e10 1cL0 1cN0 1cL0 1cN0 1fz0 1pd0 10n0 1ld0 14n0 1hB0 15b0 1ip0 19X0 1cN0 1cL0 1cN0 17b0 1ld0 14o0 1lc0 17c0 1io0 17c0 1io0 17c0 1So0 y00 1fc0 1dc0 1co0 1dc0 1cM0 1cM0 1cM0 1o00 11A0 1lc0 17c0 1cM0 1cM0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 4bX0 Dd0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 LA0 1C00|25e5", "Asia/Anadyr|+13 +14 +12 +11|-d0 -e0 -c0 -b0|010202020202020202023202020202020202020202020202020202020232|rmX0 1db0 2q10 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 2sp0 WM0|13e3", "Asia/Aqtau|+05 +06 +04|-50 -60 -40|0101010101010101010201010120202020202020202020|sAj0 2pX0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cN0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0|15e4", "Asia/Aqtobe|+05 +06 +04|-50 -60 -40|01010101010101010102010101010101010101010101010|rn70 3Db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0|27e4", "Asia/Ashgabat|+05 +06 +04|-50 -60 -40|01010101010101010101020|rn70 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0|41e4", "Asia/Atyrau|+05 +06 +04|-50 -60 -40|010101010101010101020101010101010102020202020|sAj0 2pX0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 2sp0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0|", "Asia/Baghdad|+03 +04|-30 -40|01010101010101010101010101010101010101010101010101010|u190 11b0 1cp0 1dz0 1dd0 1db0 1cN0 1cp0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1de0 1dc0 1dc0 1dc0 1cM0 1dc0 1cM0 1dc0 1cM0 1dc0 1dc0 1dc0 1cM0 1dc0 1cM0 1dc0 1cM0 1dc0 1dc0 1dc0 1cM0 1dc0 1cM0 1dc0 1cM0 1dc0 1dc0 1dc0 1cM0 1dc0 1cM0 1dc0 1cM0 1dc0|66e5", "Asia/Qatar|+04 +03|-40 -30|01|5QI0|96e4", "Asia/Baku|+04 +05 +03|-40 -50 -30|010101010101010101010201010101010101010101010101010101010101010|rn80 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 1cM0 9Je0 1o00 11z0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00|27e5", "Asia/Bangkok|+07|-70|0||15e6", "Asia/Barnaul|+07 +08 +06|-70 -80 -60|01010101010101010101020101010102020202020202020202020202020202020|rn50 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 p90 LE0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0 3rd0|", "Asia/Beirut|EET EEST|-20 -30|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|61a0 En0 1oN0 11b0 1oN0 11b0 1oN0 11b0 1pd0 11b0 1oN0 11b0 1op0 11b0 dA10 17b0 1iN0 17b0 1iN0 17b0 1iN0 17b0 1vB0 SL0 1mp0 13z0 1iN0 17b0 1iN0 17b0 1jd0 12n0 1a10 1cL0 1cN0 1cL0 1cN0 1cL0 1fB0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0|22e5", "Asia/Bishkek|+06 +07 +05|-60 -70 -50|0101010101010101010102020202020202020202020202020|rn60 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2e00 1tX0 17b0 1ip0 17b0 1ip0 17b0 1ip0 17b0 1ip0 19X0 1cPu 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0|87e4", "Asia/Brunei|+08|-80|0||42e4", "Asia/Kolkata|IST|-5u|0||15e6", "Asia/Chita|+09 +10 +08|-90 -a0 -80|0101010101010101010102010101010101010101010101010101010101010120|rn30 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0 3re0|33e4", "Asia/Choibalsan|+07 +08 +10 +09|-70 -80 -a0 -90|012323232323232323232323232323232323232323232313131|jsF0 cKn0 1da0 1dd0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1fB0 1cL0 1cN0 1cL0 1cN0 1cL0 6hD0 11z0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 3Db0 h1f0 1cJ0 1cP0 1cJ0|38e3", "Asia/Shanghai|CST CDT|-80 -90|0101010101010|DKG0 Rb0 1o10 11z0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0|23e6", "Asia/Colombo|+0530 +0630 +06|-5u -6u -60|0120|14giu 11zu n3cu|22e5", "Asia/Dhaka|+06 +07|-60 -70|010|1A5R0 1i00|16e6", "Asia/Damascus|EET EEST +03|-20 -30 -30|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101012|M00 11b0 1oN0 11b0 1pd0 11b0 1oN0 11b0 1oN0 11b0 1oN0 11b0 1pd0 11b0 1oN0 Nb0 1AN0 Nb0 bcp0 19X0 1gp0 19X0 3ld0 1xX0 Vd0 1Bz0 Sp0 1vX0 10p0 1dz0 1cN0 1cL0 1db0 1db0 1g10 1an0 1ap0 1db0 1fd0 1db0 1cN0 1db0 1dd0 1db0 1cp0 1dz0 1c10 1dX0 1cN0 1db0 1dd0 1db0 1cN0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1db0 1cN0 1db0 1cN0 19z0 1fB0 1qL0 11B0 1on0 Wp0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0|26e5", "Asia/Dili|+09 +08|-90 -80|010|fpr0 Xld0|19e4", "Asia/Dubai|+04|-40|0||39e5", "Asia/Dushanbe|+06 +07 +05|-60 -70 -50|0101010101010101010102|rn60 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2hB0|76e4", "Asia/Famagusta|EET EEST +03|-20 -30 -30|0101010101010101010101010101010101010101010101010101010101010101010101010101010101012010101010101010101010101010|cPa0 1cL0 1qp0 Xz0 19B0 19X0 1fB0 1db0 1cp0 1cL0 1fB0 19X0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1fB0 1cL0 1cN0 1cL0 1cN0 1o30 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 15U0 2Ks0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|", "Asia/Gaza|IST IDT EET EEST|-20 -30 -20 -30|010101010101010101010101010101023232323232323232323232323232323232323232323232323232323232323232323232|aXa0 Db0 1fB0 Rb0 bXB0 gM0 8Q00 IM0 1wo0 TX0 1HB0 IL0 1s10 10n0 1o10 WL0 1zd0 On0 1ld0 11z0 1o10 14n0 1o10 14n0 1nd0 12n0 1nd0 Xz0 1q10 12n0 M10 C00 17c0 1io0 17c0 1io0 17c0 1o00 1cL0 1fB0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 17c0 1io0 18N0 1bz0 19z0 1gp0 1610 1iL0 11z0 1o10 14o0 1lA1 SKX 1xd1 MKX 1AN0 1a00 1fA0 1cL0 1cN0 1nX0 1210 1nA0 1210 1qL0 WN0 1qL0 WN0 1qL0 11c0 1on0 11B0 1o00 11A0 1qo0 XA0 1qp0 1cN0 1cL0 17d0 1in0 14p0 1lb0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0|18e5", "Asia/Hebron|IST IDT EET EEST|-20 -30 -20 -30|01010101010101010101010101010102323232323232323232323232323232323232323232323232323232323232323232323232|aXa0 Db0 1fB0 Rb0 bXB0 gM0 8Q00 IM0 1wo0 TX0 1HB0 IL0 1s10 10n0 1o10 WL0 1zd0 On0 1ld0 11z0 1o10 14n0 1o10 14n0 1nd0 12n0 1nd0 Xz0 1q10 12n0 M10 C00 17c0 1io0 17c0 1io0 17c0 1o00 1cL0 1fB0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 17c0 1io0 18N0 1bz0 19z0 1gp0 1610 1iL0 12L0 1mN0 14o0 1lc0 Tb0 1xd1 MKX bB0 cn0 1cN0 1a00 1fA0 1cL0 1cN0 1nX0 1210 1nA0 1210 1qL0 WN0 1qL0 WN0 1qL0 11c0 1on0 11B0 1o00 11A0 1qo0 XA0 1qp0 1cN0 1cL0 17d0 1in0 14p0 1lb0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0|25e4", "Asia/Ho_Chi_Minh|+08 +07|-80 -70|01|dfs0|90e5", "Asia/Hong_Kong|HKT HKST|-80 -90|01010101010101010|H7u 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 s10 1Vz0 1cN0 1cL0 1cN0 1cL0 6fd0 14n0|73e5", "Asia/Hovd|+06 +07 +08|-60 -70 -80|01212121212121212121212121212121212121212121212121|jsG0 cKn0 1db0 1dd0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1fB0 1cL0 1cN0 1cL0 1cN0 1cL0 6hD0 11z0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 kEp0 1cJ0 1cP0 1cJ0|81e3", "Asia/Irkutsk|+08 +09 +07|-80 -90 -70|010101010101010101010201010101010101010101010101010101010101010|rn40 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0|60e4", "Europe/Istanbul|EET EEST +03 +04|-20 -30 -30 -40|01010101010123201010101010101010101010101010101010101010101010101010101010101012|8jz0 11A0 WN0 1qL0 TB0 1tX0 U10 1tz0 11B0 1in0 17d0 z90 cne0 pb0 2Cp0 1800 14o0 1dc0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1a00 1fA0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WO0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 Xc0 1qo0 WM0 1qM0 11A0 1o00 1200 1nA0 11A0 1tA0 U00 15w0|13e6", "Asia/Jakarta|WIB|-70|0||31e6", "Asia/Jayapura|WIT|-90|0||26e4", "Asia/Jerusalem|IST IDT|-20 -30|01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|aXa0 Db0 1fB0 Rb0 bXB0 gM0 8Q00 IM0 1wo0 TX0 1HB0 IL0 1s10 10n0 1o10 WL0 1zd0 On0 1ld0 11z0 1o10 14n0 1o10 14n0 1nd0 12n0 1nd0 Xz0 1q10 12n0 1hB0 1dX0 1ep0 1aL0 1eN0 17X0 1nf0 11z0 1tB0 19W0 1e10 17b0 1ep0 1gL0 18N0 1fz0 1eN0 17b0 1gq0 1gn0 19d0 1dz0 1c10 17X0 1hB0 1gn0 19d0 1dz0 1c10 17X0 1kp0 1dz0 1c10 1aL0 1eN0 1oL0 10N0 1oL0 10N0 1oL0 10N0 1rz0 W10 1rz0 W10 1rz0 10N0 1oL0 10N0 1oL0 10N0 1rz0 W10 1rz0 W10 1rz0 10N0 1oL0 10N0 1oL0 10N0 1oL0 10N0 1rz0 W10 1rz0 W10 1rz0 10N0 1oL0|81e4", "Asia/Kabul|+0430|-4u|0||46e5", "Asia/Kamchatka|+12 +13 +11|-c0 -d0 -b0|0101010101010101010102010101010101010101010101010101010101020|rn00 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 2sp0 WM0|18e4", "Asia/Karachi|+05 PKT PKST|-50 -50 -60|01212121|2Xv0 1fy00 1cL0 dK10 11b0 1610 1jX0|24e6", "Asia/Kathmandu|+0530 +0545|-5u -5J|01|CVuu|12e5", "Asia/Khandyga|+09 +10 +08 +11|-90 -a0 -80 -b0|01010101010101010101020101010101010101010101010131313131313131310|rn30 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 qK0 yN0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 17V0 7zD0|66e2", "Asia/Krasnoyarsk|+07 +08 +06|-70 -80 -60|010101010101010101010201010101010101010101010101010101010101010|rn50 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0|10e5", "Asia/Kuala_Lumpur|+0730 +08|-7u -80|01|td40|71e5", "Asia/Macau|CST CDT|-80 -90|01010101010101010|H7u 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 s10 1Vz0 1cN0 1cL0 1cN0 1cL0 6fd0 14n0|57e4", "Asia/Magadan|+11 +12 +10|-b0 -c0 -a0|0101010101010101010102010101010101010101010101010101010101010120|rn10 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0 3Cq0|95e3", "Asia/Makassar|WITA|-80|0||15e5", "Asia/Manila|PST PDT|-80 -90|010|k0E0 1db0|24e6", "Asia/Nicosia|EET EEST|-20 -30|01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|cPa0 1cL0 1qp0 Xz0 19B0 19X0 1fB0 1db0 1cp0 1cL0 1fB0 19X0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1fB0 1cL0 1cN0 1cL0 1cN0 1o30 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|32e4", "Asia/Novokuznetsk|+07 +08 +06|-70 -80 -60|0101010101010101010102010101010101010101010101010101010101020|rn50 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 2sp0 WM0|55e4", "Asia/Novosibirsk|+07 +08 +06|-70 -80 -60|01010101010101010101020101020202020202020202020202020202020202020|rn50 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 ml0 Os0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0 4eN0|15e5", "Asia/Omsk|+06 +07 +05|-60 -70 -50|010101010101010101010201010101010101010101010101010101010101010|rn60 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0|12e5", "Asia/Oral|+05 +06 +04|-50 -60 -40|010101010101010202020202020202020202020202020|rn70 3Db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 2pB0 1cM0 1fA0 1cM0 1cM0 IM0 1EM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0|27e4", "Asia/Pontianak|WITA WIB|-80 -70|01|HNs0|23e4", "Asia/Pyongyang|KST KST|-90 -8u|010|1P4D0 6BA0|29e5", "Asia/Qostanay|+05 +06 +04|-50 -60 -40|0101010101010101010201010101010101010101010101|rn70 3Db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0|", "Asia/Qyzylorda|+05 +06|-50 -60|010101010101010101010101010101010101010101010|rn70 3Db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 3ao0 1EM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 zQl0|73e4", "Asia/Rangoon|+0630|-6u|0||48e5", "Asia/Sakhalin|+11 +12 +10|-b0 -c0 -a0|010101010101010101010201010101010202020202020202020202020202020|rn10 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 2pB0 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0 3rd0|58e4", "Asia/Samarkand|+05 +06|-50 -60|010101010101010101010|rn70 3Db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0|36e4", "Asia/Seoul|KST KDT|-90 -a0|01010|Gf50 11A0 1o00 11A0|23e6", "Asia/Srednekolymsk|+11 +12 +10|-b0 -c0 -a0|010101010101010101010201010101010101010101010101010101010101010|rn10 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0|35e2", "Asia/Taipei|CST CDT|-80 -90|0101010|akg0 1db0 1cN0 1db0 97B0 AL0|74e5", "Asia/Tashkent|+06 +07 +05|-60 -70 -50|0101010101010101010102|rn60 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0|23e5", "Asia/Tbilisi|+04 +05 +03|-40 -50 -30|01010101010101010101020202010101010101010101020|rn80 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 1cK0 1cL0 1cN0 1cL0 1cN0 2pz0 1cL0 1fB0 3Nz0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 An0 Os0 WM0|11e5", "Asia/Tehran|+0330 +0430 +04 +05|-3u -4u -40 -50|0123201010101010101010101010101010101010101010101010101010101010101010|hyHu 1pc0 120u Rc0 XA0 Wou JX0 1dB0 1en0 pNB0 UL0 1cN0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0 1cN0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0 1cN0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0 1cN0 1dz0 64p0 1dz0 1cN0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0 1cN0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0 1cN0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0 1cN0 1dz0 1cp0 1dz0|14e6", "Asia/Thimphu|+0530 +06|-5u -60|01|HcGu|79e3", "Asia/Tokyo|JST|-90|0||38e6", "Asia/Tomsk|+07 +08 +06|-70 -80 -60|01010101010101010101020101010101010101010101020202020202020202020|rn50 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 co0 1bB0 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0 3Qp0|10e5", "Asia/Ulaanbaatar|+07 +08 +09|-70 -80 -90|01212121212121212121212121212121212121212121212121|jsF0 cKn0 1db0 1dd0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1fB0 1cL0 1cN0 1cL0 1cN0 1cL0 6hD0 11z0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 kEp0 1cJ0 1cP0 1cJ0|12e5", "Asia/Ust-Nera|+09 +12 +11 +10|-90 -c0 -b0 -a0|0121212121212121212123212121212121212121212121212121212121212123|rn30 1d90 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 17V0 7zD0|65e2", "Asia/Vladivostok|+10 +11 +09|-a0 -b0 -90|010101010101010101010201010101010101010101010101010101010101010|rn20 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0|60e4", "Asia/Yakutsk|+09 +10 +08|-90 -a0 -80|010101010101010101010201010101010101010101010101010101010101010|rn30 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0|28e4", "Asia/Yekaterinburg|+05 +06 +04|-50 -60 -40|010101010101010101010201010101010101010101010101010101010101010|rn70 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0|14e5", "Asia/Yerevan|+04 +05 +03|-40 -50 -30|01010101010101010101020202020101010101010101010101010101010|rn80 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 4RX0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0|13e5", "Atlantic/Azores|-01 +00 WET|10 0 0|0101010101010101010101010101010121010101010101010101010101010101010101010101010101010101010101010101010101010|hAN0 1cM0 1fA0 1cM0 1cM0 1cN0 1cL0 1cN0 1cM0 1cM0 1cM0 1cM0 1cN0 1cL0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cL0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|25e4", "Atlantic/Bermuda|AST ADT|40 30|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|avi0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|65e3", "Atlantic/Canary|WET WEST|0 -10|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|oXc0 1a10 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|54e4", "Atlantic/Cape_Verde|-02 -01|20 10|01|elE0|50e4", "Atlantic/Faroe|WET WEST|0 -10|01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|rm10 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|49e3", "Atlantic/Madeira|WET WEST|0 -10|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|hAM0 1cM0 1fA0 1cM0 1cM0 1cN0 1cL0 1cN0 1cM0 1cM0 1cM0 1cM0 1cN0 1cL0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|27e4", "Atlantic/South_Georgia|-02|20|0||30", "Atlantic/Stanley|-04 -03 -02|40 30 20|01212101010101010101010101010101010101010101010101010101|wrg0 WL0 1qL0 U10 1tz0 2mN0 WN0 1qL0 WN0 1qL0 WN0 1qL0 WN0 1tz0 U10 1tz0 WN0 1qL0 WN0 1qL0 WN0 1qL0 WN0 1qL0 WN0 1tz0 WN0 1qL0 WN0 1qL0 WN0 1qL0 WN0 1qL0 WN0 1qN0 U10 1wn0 Rd0 1wn0 U10 1tz0 U10 1tz0 U10 1tz0 U10 1tz0 U10 1wn0 U10 1tz0 U10 1tz0 U10|21e2", "Australia/Sydney|AEST AEDT|-a0 -b0|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101|4r40 LA0 1C00 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 14o0 1o00 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 U00 1qM0 WM0 1tA0 WM0 1tA0 U00 1tA0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 11A0 1o00 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 11A0 1o00 WM0 1qM0 14o0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0|40e5", "Australia/Adelaide|ACST ACDT|-9u -au|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101|4r4u LA0 1C00 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 U00 1qM0 WM0 1tA0 WM0 1tA0 U00 1tA0 U00 1tA0 Oo0 1zc0 WM0 1qM0 Rc0 1zc0 U00 1tA0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 11A0 1o00 WM0 1qM0 14o0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0|11e5", "Australia/Brisbane|AEST AEDT|-a0 -b0|010101010|4r40 LA0 H1A0 Oo0 1zc0 Oo0 1zc0 Oo0|20e5", "Australia/Broken_Hill|ACST ACDT|-9u -au|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101|4r4u LA0 1C00 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 14o0 1o00 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 U00 1qM0 WM0 1tA0 WM0 1tA0 U00 1tA0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 11A0 1o00 WM0 1qM0 14o0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0|18e3", "Australia/Hobart|AEDT AEST|-b0 -a0|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|qg0 1wo0 U00 1wo0 LA0 1C00 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 11A0 1qM0 WM0 1qM0 Oo0 1zc0 Oo0 1zc0 Oo0 1wo0 WM0 1tA0 WM0 1tA0 U00 1tA0 U00 1tA0 11A0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 11A0 1o00 1io0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1cM0 1a00 1io0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0|21e4", "Australia/Darwin|ACST|-9u|0||12e4", "Australia/Eucla|+0845 +0945|-8J -9J|0101010101010|bHRf Oo0 l5A0 Oo0 iJA0 G00 zU00 IM0 1qM0 11A0 1o00 11A0|368", "Australia/Lord_Howe|AEST +1030 +1130 +11|-a0 -au -bu -b0|01212121213131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313|raC0 1zdu Rb0 1zd0 On0 1zd0 On0 1zd0 On0 1zd0 TXu 1qMu WLu 1tAu WLu 1tAu TXu 1tAu Onu 1zcu Onu 1zcu Onu 1zcu Rbu 1zcu Onu 1zcu Onu 1zcu 11zu 1o0u 11zu 1o0u 11zu 1o0u 11zu 1qMu WLu 11Au 1nXu 1qMu 11zu 1o0u 11zu 1o0u 11zu 1qMu WLu 1qMu 11zu 1o0u WLu 1qMu 14nu 1cMu 1cLu 1cMu 1cLu 1cMu 1cLu 1cMu 1cLu 1fAu 1cLu 1cMu 1cLu 1cMu 1cLu 1cMu 1cLu 1cMu 1cLu 1cMu 1cLu 1fAu 1cLu 1cMu 1cLu 1cMu 1cLu 1cMu 1cLu 1cMu 1cLu 1cMu 1fzu 1cMu 1cLu 1cMu 1cLu 1cMu 1cLu 1cMu 1cLu 1cMu 1cLu 1fAu 1cLu 1cMu|347", "Australia/Lindeman|AEST AEDT|-a0 -b0|0101010101010|4r40 LA0 H1A0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0|10", "Australia/Melbourne|AEST AEDT|-a0 -b0|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101|4r40 LA0 1C00 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 U00 1qM0 WM0 1qM0 11A0 1tA0 U00 1tA0 U00 1tA0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 11A0 1o00 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 11A0 1o00 WM0 1qM0 14o0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0|39e5", "Australia/Perth|AWST AWDT|-80 -90|0101010101010|bHS0 Oo0 l5A0 Oo0 iJA0 G00 zU00 IM0 1qM0 11A0 1o00 11A0|18e5", "Europe/Brussels|CET CEST|-10 -20|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|hDB0 1a00 1fA0 1cM0 1cM0 1cM0 1fA0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|21e5", "Pacific/Easter|-06 -07 -05|60 70 50|010101010101010101010101020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202|yP0 1ip0 11z0 1o10 11z0 1qN0 WL0 1ld0 14n0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 WL0 1qN0 11z0 1o10 2pA0 11z0 1o10 11z0 1qN0 WL0 1qN0 WL0 1qN0 1cL0 1cN0 11z0 1o10 11z0 1qN0 WL0 1fB0 19X0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 17b0 1ip0 11z0 1ip0 1fz0 1fB0 11z0 1qN0 WL0 1qN0 WL0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 17b0 1ip0 11z0 1o10 19X0 1fB0 1nX0 G10 1EL0 Op0 1zb0 Rd0 1wn0 Rd0 46n0 Ap0 1Nb0 Ap0 1Nb0 Ap0 1zb0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 11B0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 11B0|30e2", "EET|EET EEST|-20 -30|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|hDB0 1a00 1fA0 1cM0 1cM0 1cM0 1fA0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|", "Europe/Dublin|IST GMT|-10 0|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101|4re0 U00 1tA0 U00 1tA0 U00 1tA0 U00 1tA0 WM0 1qM0 WM0 1qM0 WM0 1tA0 U00 1tA0 U00 1tA0 11z0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1o00 14o0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|12e5", "Etc/GMT-1|+01|-10|0||", "Pacific/Guadalcanal|+11|-b0|0||11e4", "Pacific/Tarawa|+12|-c0|0||29e3", "Etc/GMT-13|+13|-d0|0||", "Etc/GMT-14|+14|-e0|0||", "Etc/GMT-2|+02|-20|0||", "Indian/Maldives|+05|-50|0||35e4", "Pacific/Palau|+09|-90|0||21e3", "Etc/GMT+1|-01|10|0||", "Pacific/Tahiti|-10|a0|0||18e4", "Pacific/Niue|-11|b0|0||12e2", "Etc/GMT+12|-12|c0|0||", "Etc/GMT+5|-05|50|0||", "Etc/GMT+6|-06|60|0||", "Etc/GMT+7|-07|70|0||", "Etc/GMT+8|-08|80|0||", "Pacific/Gambier|-09|90|0||125", "Etc/UTC|UTC|0|0||", "Europe/Andorra|CET CEST|-10 -20|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|B7d0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|79e3", "Europe/Astrakhan|+04 +05 +03|-40 -50 -30|0101010101010101020202020202020202020202020202020202020202020|rn80 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 2pB0 1cM0 1fA0 1cM0 3Co0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0 3rd0|10e5", "Europe/Athens|EET EEST|-20 -30|01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|cOK0 1vc0 SO0 1cM0 1a00 1ao0 1fc0 1a10 1fG0 1cg0 1dX0 1bX0 1cQ0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|35e5", "Europe/London|BST GMT|-10 0|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101|4re0 U00 1tA0 U00 1tA0 U00 1tA0 U00 1tA0 WM0 1qM0 WM0 1qM0 WM0 1tA0 U00 1tA0 U00 1tA0 11z0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1o00 14o0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|10e6", "Europe/Belgrade|CET CEST|-10 -20|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|wdd0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|12e5", "Europe/Prague|CET CEST|-10 -20|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|muN0 1cM0 1fA0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|13e5", "Europe/Bucharest|EET EEST|-20 -30|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|mRa0 On0 1fA0 1a10 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cK0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cL0 1cN0 1cL0 1fB0 1nX0 11E0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|19e5", "Europe/Budapest|CET CEST|-10 -20|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|oXb0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cO0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|17e5", "Europe/Zurich|CET CEST|-10 -20|01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|rm10 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|38e4", "Europe/Chisinau|MSK MSD EEST EET|-30 -40 -30 -20|010101010101010101012323232323232323232323232323232323232323232323232323232323232323232323232323232323|rn90 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 gL0 WO0 1cM0 1cM0 1cK0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1fB0 1nX0 11D0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|67e4", "Europe/Gibraltar|CET CEST|-10 -20|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|tLB0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|30e3", "Europe/Helsinki|EET EEST|-20 -30|01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|rm00 1cM0 1cM0 1cM0 1cN0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|12e5", "Europe/Kaliningrad|MSK MSD EEST EET +03|-30 -40 -30 -20 -30|010101010101010102323232323232323232323232323232323232323232343|rn90 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cN0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0|44e4", "Europe/Kiev|MSK MSD EEST EET|-30 -40 -30 -20|0101010101010101010123232323232323232323232323232323232323232323232323232323232323232323232323232323|rn90 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 Db0 3220 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o10 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|34e5", "Europe/Kirov|+04 +05 MSD MSK MSK|-40 -50 -40 -30 -40|01010101010101010232302323232323232323232323232323232323232343|rn80 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cN0 1cM0 1fA0 1cM0 2pz0 1cN0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0|48e4", "Europe/Lisbon|CET WET WEST CEST|-10 0 -10 -20|01212121212121212121212121212121203030302121212121212121212121212121212121212121212121212121212121212121212121|go00 1cM0 1cM0 1fA0 1cM0 1cM0 1cN0 1cL0 1cN0 1cM0 1cM0 1cM0 1cM0 1cN0 1cL0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|27e5", "Europe/Madrid|CET CEST|-10 -20|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|apy0 1a10 1fz0 1a10 19X0 1cN0 1fz0 1a10 1fC0 1cM0 1cM0 1cM0 1fA0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|62e5", "Europe/Malta|CET CEST|-10 -20|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|XX0 LA0 1zc0 Oo0 1C00 Oo0 1co0 1cM0 1lA0 Xc0 1qq0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1iN0 19z0 1fB0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|42e4", "Europe/Minsk|MSK MSD EEST EET +03|-30 -40 -30 -20 -30|010101010101010101023232323232323232323232323232323232323234|rn90 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 3Fc0 1cN0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0|19e5", "Europe/Paris|CET CEST|-10 -20|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|fbc0 1cL0 1fC0 1a00 1fA0 1cM0 1cM0 1cM0 1fA0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|11e6", "Europe/Moscow|MSK MSD EEST EET MSK|-30 -40 -30 -20 -40|0101010101010101010102301010101010101010101010101010101010101040|rn90 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cN0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0|16e6", "Europe/Riga|MSK MSD EEST EET|-30 -40 -30 -20|010101010101010102323232323232323232323232323232323232323232323232323232323232323232323232323232323|rn90 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cN0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cN0 1o00 11A0 1o00 11A0 1qM0 3oo0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|64e4", "Europe/Rome|CET CEST|-10 -20|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|XX0 LA0 1zc0 Oo0 1C00 Oo0 1C00 LA0 1zc0 Oo0 1C00 LA0 1C00 LA0 1zc0 Oo0 1C00 Oo0 1zc0 Oo0 1fC0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|39e5", "Europe/Samara|+04 +05 +03|-40 -50 -30|01010101010101010202010101010101010101010101010101010101020|rn80 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 2pB0 1cM0 1fA0 2y10 14m0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 2sp0 WM0|12e5", "Europe/Saratov|+04 +05 +03|-40 -50 -30|0101010101010102020202020202020202020202020202020202020202020|rn80 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 2pB0 1cM0 1cM0 1cM0 1fA0 1cM0 3Co0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0 5810|", "Europe/Simferopol|MSK MSD EET EEST MSK|-30 -40 -20 -30 -40|0101010101010101010232323101010323232323232323232323232323232323240|rn90 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1Q00 4eN0 1cM0 1cM0 1cM0 1cM0 dV0 WO0 1cM0 1cM0 1fy0 1o30 11B0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11z0 1nW0|33e4", "Europe/Sofia|EET EEST|-20 -30|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|muJ0 1dd0 1fb0 1ap0 1fb0 1a20 1fy0 1a30 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cK0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1fB0 1nX0 11E0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|12e5", "Europe/Tallinn|MSK MSD EEST EET|-30 -40 -30 -20|0101010101010101023232323232323232323232323232323232323232323232323232323232323232323232323232323|rn90 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cN0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o10 11A0 1qM0 5QM0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|41e4", "Europe/Tirane|CET CEST|-10 -20|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|axz0 10n0 1op0 11z0 1pd0 11z0 1qN0 WL0 1qp0 Xb0 1qp0 Xb0 1qp0 11z0 1lB0 11z0 1qN0 11z0 1iN0 16n0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|42e4", "Europe/Ulyanovsk|+04 +05 +03 +02|-40 -50 -30 -20|010101010101010102023202020202020202020202020202020202020202020|rn80 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 2pB0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0 3rd0|13e5", "Europe/Vienna|CET CEST|-10 -20|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|oXb0 19X0 1cP0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|18e5", "Europe/Vilnius|MSK MSD EEST EET CEST CET|-30 -40 -30 -20 -20 -10|01010101010101010232323232323232323454323232323232323232323232323232323232323232323232323232323|rn90 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cN0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11B0 1o00 11A0 1qM0 8io0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|54e4", "Europe/Volgograd|+04 +05 MSD MSK MSK|-40 -50 -40 -30 -40|0101010101010102323230232323232323232323232323232323232323234303|rn80 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cN0 1cM0 1cM0 1cM0 1fA0 1cM0 2pz0 1cN0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0 9Jd0 5gn0|10e5", "Europe/Warsaw|CET CEST|-10 -20|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|hDA0 1a00 1fA0 1cM0 1cM0 1cM0 1fA0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cN0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|17e5", "Pacific/Honolulu|HST|a0|0||37e4", "Indian/Chagos|+05 +06|-50 -60|01|13ij0|30e2", "Indian/Mauritius|+04 +05|-40 -50|01010|v5U0 14L0 12kr0 11z0|15e4", "Pacific/Kwajalein|-12 +12|c0 -c0|01|Vxo0|14e3", "MET|MET MEST|-10 -20|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|hDB0 1a00 1fA0 1cM0 1cM0 1cM0 1fA0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|", "Pacific/Chatham|+1245 +1345|-cJ -dJ|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101|bKC0 IM0 1C00 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1qM0 14o0 1lc0 14o0 1lc0 14o0 1lc0 17c0 1io0 17c0 1io0 17c0 1io0 17c0 1lc0 14o0 1lc0 14o0 1lc0 17c0 1io0 17c0 1io0 17c0 1lc0 14o0 1lc0 14o0 1lc0 17c0 1io0 17c0 1io0 17c0 1io0 17c0 1io0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1io0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00|600", "Pacific/Apia|-11 -10 +14 +13|b0 a0 -e0 -d0|010123232323232323232323|1Dbn0 1ff0 1a00 CI0 AQ0 1cM0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00 1fA0 1a00 1fA0|37e3", "Pacific/Bougainville|+10 +11|-a0 -b0|01|1NwE0|18e4", "Pacific/Efate|+11 +12|-b0 -c0|01010101010101010101010|9EA0 Dc0 n610 1cL0 1cN0 1cL0 1fB0 19X0 1fB0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1fB0 Lz0 1Nd0 An0|66e3", "Pacific/Enderbury|-12 -11 +13|c0 b0 -d0|012|nIc0 B7X0|1", "Pacific/Fakaofo|-11 +13|b0 -d0|01|1Gfn0|483", "Pacific/Fiji|+12 +13|-c0 -d0|01010101010101010101010101010|1ace0 LA0 1EM0 IM0 nJc0 LA0 1o00 Rc0 1wo0 Ao0 1Nc0 Ao0 1Q00 xz0 1SN0 uM0 1SM0 uM0 1VA0 s00 1VA0 s00 1VA0 s00 20o0 pc0 2hc0 bc0|88e4", "Pacific/Galapagos|-05 -06|50 60|0101|CVF0 gNd0 rz0|25e3", "Pacific/Guam|GST GDT ChST|-a0 -b0 -a0|010101010102|JQ0 Rb0 1wp0 Rb0 5xd0 rX0 5sN0 zb1 1C0X On0 ULb0|17e4", "Pacific/Kiritimati|-1040 -10 +14|aE a0 -e0|012|nIaE B7Xk|51e2", "Pacific/Kosrae|+12 +11|-c0 -b0|01|1aAA0|66e2", "Pacific/Marquesas|-0930|9u|0||86e2", "Pacific/Pago_Pago|SST|b0|0||37e2", "Pacific/Nauru|+1130 +12|-bu -c0|01|maCu|10e3", "Pacific/Norfolk|+1130 +1230 +11 +12|-bu -cu -b0 -c0|010232323232323232323232323|bHOu Oo0 1COo0 9Jcu 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0|25e4", "Pacific/Noumea|+11 +12|-b0 -c0|0101010|jhp0 xX0 1PB0 yn0 HeP0 Ao0|98e3", "Pacific/Pitcairn|-0830 -08|8u 80|01|18Vku|56", "Pacific/Rarotonga|-1030 -0930 -10|au 9u a0|012121212121212121212121212|lyWu IL0 1zcu Onu 1zcu Onu 1zcu Rbu 1zcu Onu 1zcu Onu 1zcu Onu 1zcu Onu 1zcu Onu 1zcu Rbu 1zcu Onu 1zcu Onu 1zcu Onu|13e3", "Pacific/Tongatapu|+13 +14|-d0 -e0|010101010|1csd0 15A0 1wo0 xz0 1Q10 xz0 zWN0 s00|75e3", "WET|WET WEST|0 -10|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|hDB0 1a00 1fA0 1cM0 1cM0 1cM0 1fA0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|" ], "links": [ "Africa/Abidjan|Africa/Accra", "Africa/Abidjan|Africa/Bamako", "Africa/Abidjan|Africa/Banjul", "Africa/Abidjan|Africa/Conakry", "Africa/Abidjan|Africa/Dakar", "Africa/Abidjan|Africa/Freetown", "Africa/Abidjan|Africa/Lome", "Africa/Abidjan|Africa/Nouakchott", "Africa/Abidjan|Africa/Ouagadougou", "Africa/Abidjan|Africa/Timbuktu", "Africa/Abidjan|Atlantic/Reykjavik", "Africa/Abidjan|Atlantic/St_Helena", "Africa/Abidjan|Etc/GMT", "Africa/Abidjan|Etc/GMT+0", "Africa/Abidjan|Etc/GMT-0", "Africa/Abidjan|Etc/GMT0", "Africa/Abidjan|Etc/Greenwich", "Africa/Abidjan|GMT", "Africa/Abidjan|GMT+0", "Africa/Abidjan|GMT-0", "Africa/Abidjan|GMT0", "Africa/Abidjan|Greenwich", "Africa/Abidjan|Iceland", "Africa/Cairo|Egypt", "Africa/Johannesburg|Africa/Maseru", "Africa/Johannesburg|Africa/Mbabane", "Africa/Lagos|Africa/Bangui", "Africa/Lagos|Africa/Brazzaville", "Africa/Lagos|Africa/Douala", "Africa/Lagos|Africa/Kinshasa", "Africa/Lagos|Africa/Libreville", "Africa/Lagos|Africa/Luanda", "Africa/Lagos|Africa/Malabo", "Africa/Lagos|Africa/Niamey", "Africa/Lagos|Africa/Porto-Novo", "Africa/Maputo|Africa/Blantyre", "Africa/Maputo|Africa/Bujumbura", "Africa/Maputo|Africa/Gaborone", "Africa/Maputo|Africa/Harare", "Africa/Maputo|Africa/Kigali", "Africa/Maputo|Africa/Lubumbashi", "Africa/Maputo|Africa/Lusaka", "Africa/Nairobi|Africa/Addis_Ababa", "Africa/Nairobi|Africa/Asmara", "Africa/Nairobi|Africa/Asmera", "Africa/Nairobi|Africa/Dar_es_Salaam", "Africa/Nairobi|Africa/Djibouti", "Africa/Nairobi|Africa/Kampala", "Africa/Nairobi|Africa/Mogadishu", "Africa/Nairobi|Indian/Antananarivo", "Africa/Nairobi|Indian/Comoro", "Africa/Nairobi|Indian/Mayotte", "Africa/Tripoli|Libya", "America/Adak|America/Atka", "America/Adak|US/Aleutian", "America/Anchorage|US/Alaska", "America/Argentina/Buenos_Aires|America/Buenos_Aires", "America/Argentina/Catamarca|America/Argentina/ComodRivadavia", "America/Argentina/Catamarca|America/Catamarca", "America/Argentina/Cordoba|America/Cordoba", "America/Argentina/Cordoba|America/Rosario", "America/Argentina/Jujuy|America/Jujuy", "America/Argentina/Mendoza|America/Mendoza", "America/Cayenne|Etc/GMT+3", "America/Chicago|CST6CDT", "America/Chicago|US/Central", "America/Denver|America/Shiprock", "America/Denver|MST7MDT", "America/Denver|Navajo", "America/Denver|US/Mountain", "America/Detroit|US/Michigan", "America/Edmonton|America/Yellowknife", "America/Edmonton|Canada/Mountain", "America/Fort_Wayne|America/Indiana/Indianapolis", "America/Fort_Wayne|America/Indianapolis", "America/Fort_Wayne|US/East-Indiana", "America/Godthab|America/Nuuk", "America/Halifax|Canada/Atlantic", "America/Havana|Cuba", "America/Indiana/Knox|America/Knox_IN", "America/Indiana/Knox|US/Indiana-Starke", "America/Iqaluit|America/Pangnirtung", "America/Jamaica|Jamaica", "America/Kentucky/Louisville|America/Louisville", "America/La_Paz|Etc/GMT+4", "America/Los_Angeles|PST8PDT", "America/Los_Angeles|US/Pacific", "America/Manaus|Brazil/West", "America/Mazatlan|Mexico/BajaSur", "America/Mexico_City|Mexico/General", "America/New_York|EST5EDT", "America/New_York|US/Eastern", "America/Noronha|Brazil/DeNoronha", "America/Panama|America/Atikokan", "America/Panama|America/Cayman", "America/Panama|America/Coral_Harbour", "America/Panama|EST", "America/Phoenix|America/Creston", "America/Phoenix|MST", "America/Phoenix|US/Arizona", "America/Puerto_Rico|America/Anguilla", "America/Puerto_Rico|America/Antigua", "America/Puerto_Rico|America/Aruba", "America/Puerto_Rico|America/Blanc-Sablon", "America/Puerto_Rico|America/Curacao", "America/Puerto_Rico|America/Dominica", "America/Puerto_Rico|America/Grenada", "America/Puerto_Rico|America/Guadeloupe", "America/Puerto_Rico|America/Kralendijk", "America/Puerto_Rico|America/Lower_Princes", "America/Puerto_Rico|America/Marigot", "America/Puerto_Rico|America/Montserrat", "America/Puerto_Rico|America/Port_of_Spain", "America/Puerto_Rico|America/St_Barthelemy", "America/Puerto_Rico|America/St_Kitts", "America/Puerto_Rico|America/St_Lucia", "America/Puerto_Rico|America/St_Thomas", "America/Puerto_Rico|America/St_Vincent", "America/Puerto_Rico|America/Tortola", "America/Puerto_Rico|America/Virgin", "America/Regina|Canada/Saskatchewan", "America/Rio_Branco|America/Porto_Acre", "America/Rio_Branco|Brazil/Acre", "America/Santiago|Chile/Continental", "America/Sao_Paulo|Brazil/East", "America/St_Johns|Canada/Newfoundland", "America/Tijuana|America/Ensenada", "America/Tijuana|America/Santa_Isabel", "America/Tijuana|Mexico/BajaNorte", "America/Toronto|America/Montreal", "America/Toronto|America/Nassau", "America/Toronto|America/Nipigon", "America/Toronto|America/Thunder_Bay", "America/Toronto|Canada/Eastern", "America/Vancouver|Canada/Pacific", "America/Whitehorse|Canada/Yukon", "America/Winnipeg|America/Rainy_River", "America/Winnipeg|Canada/Central", "Asia/Ashgabat|Asia/Ashkhabad", "Asia/Bangkok|Asia/Phnom_Penh", "Asia/Bangkok|Asia/Vientiane", "Asia/Bangkok|Etc/GMT-7", "Asia/Bangkok|Indian/Christmas", "Asia/Brunei|Asia/Kuching", "Asia/Brunei|Etc/GMT-8", "Asia/Dhaka|Asia/Dacca", "Asia/Dubai|Asia/Muscat", "Asia/Dubai|Etc/GMT-4", "Asia/Dubai|Indian/Mahe", "Asia/Dubai|Indian/Reunion", "Asia/Ho_Chi_Minh|Asia/Saigon", "Asia/Hong_Kong|Hongkong", "Asia/Jerusalem|Asia/Tel_Aviv", "Asia/Jerusalem|Israel", "Asia/Kathmandu|Asia/Katmandu", "Asia/Kolkata|Asia/Calcutta", "Asia/Kuala_Lumpur|Asia/Singapore", "Asia/Kuala_Lumpur|Singapore", "Asia/Macau|Asia/Macao", "Asia/Makassar|Asia/Ujung_Pandang", "Asia/Nicosia|Europe/Nicosia", "Asia/Qatar|Asia/Bahrain", "Asia/Rangoon|Asia/Yangon", "Asia/Rangoon|Indian/Cocos", "Asia/Riyadh|Antarctica/Syowa", "Asia/Riyadh|Asia/Aden", "Asia/Riyadh|Asia/Kuwait", "Asia/Riyadh|Etc/GMT-3", "Asia/Seoul|ROK", "Asia/Shanghai|Asia/Chongqing", "Asia/Shanghai|Asia/Chungking", "Asia/Shanghai|Asia/Harbin", "Asia/Shanghai|PRC", "Asia/Taipei|ROC", "Asia/Tehran|Iran", "Asia/Thimphu|Asia/Thimbu", "Asia/Tokyo|Japan", "Asia/Ulaanbaatar|Asia/Ulan_Bator", "Asia/Urumqi|Antarctica/Vostok", "Asia/Urumqi|Asia/Kashgar", "Asia/Urumqi|Etc/GMT-6", "Atlantic/Faroe|Atlantic/Faeroe", "Atlantic/South_Georgia|Etc/GMT+2", "Australia/Adelaide|Australia/South", "Australia/Brisbane|Australia/Queensland", "Australia/Broken_Hill|Australia/Yancowinna", "Australia/Darwin|Australia/North", "Australia/Hobart|Australia/Currie", "Australia/Hobart|Australia/Tasmania", "Australia/Lord_Howe|Australia/LHI", "Australia/Melbourne|Australia/Victoria", "Australia/Perth|Australia/West", "Australia/Sydney|Australia/ACT", "Australia/Sydney|Australia/Canberra", "Australia/Sydney|Australia/NSW", "Etc/UTC|Etc/UCT", "Etc/UTC|Etc/Universal", "Etc/UTC|Etc/Zulu", "Etc/UTC|UCT", "Etc/UTC|UTC", "Etc/UTC|Universal", "Etc/UTC|Zulu", "Europe/Belgrade|Europe/Ljubljana", "Europe/Belgrade|Europe/Podgorica", "Europe/Belgrade|Europe/Sarajevo", "Europe/Belgrade|Europe/Skopje", "Europe/Belgrade|Europe/Zagreb", "Europe/Berlin|Arctic/Longyearbyen", "Europe/Berlin|Atlantic/Jan_Mayen", "Europe/Berlin|Europe/Copenhagen", "Europe/Berlin|Europe/Oslo", "Europe/Berlin|Europe/Stockholm", "Europe/Brussels|CET", "Europe/Brussels|Europe/Amsterdam", "Europe/Brussels|Europe/Luxembourg", "Europe/Chisinau|Europe/Tiraspol", "Europe/Dublin|Eire", "Europe/Helsinki|Europe/Mariehamn", "Europe/Istanbul|Asia/Istanbul", "Europe/Istanbul|Turkey", "Europe/Kiev|Europe/Kyiv", "Europe/Kiev|Europe/Uzhgorod", "Europe/Kiev|Europe/Zaporozhye", "Europe/Lisbon|Portugal", "Europe/London|Europe/Belfast", "Europe/London|Europe/Guernsey", "Europe/London|Europe/Isle_of_Man", "Europe/London|Europe/Jersey", "Europe/London|GB", "Europe/London|GB-Eire", "Europe/Moscow|W-SU", "Europe/Paris|Europe/Monaco", "Europe/Prague|Europe/Bratislava", "Europe/Rome|Europe/San_Marino", "Europe/Rome|Europe/Vatican", "Europe/Warsaw|Poland", "Europe/Zurich|Europe/Busingen", "Europe/Zurich|Europe/Vaduz", "Indian/Maldives|Etc/GMT-5", "Indian/Maldives|Indian/Kerguelen", "Pacific/Auckland|Antarctica/McMurdo", "Pacific/Auckland|Antarctica/South_Pole", "Pacific/Auckland|NZ", "Pacific/Chatham|NZ-CHAT", "Pacific/Easter|Chile/EasterIsland", "Pacific/Enderbury|Pacific/Kanton", "Pacific/Gambier|Etc/GMT+9", "Pacific/Guadalcanal|Etc/GMT-11", "Pacific/Guadalcanal|Pacific/Pohnpei", "Pacific/Guadalcanal|Pacific/Ponape", "Pacific/Guam|Pacific/Saipan", "Pacific/Honolulu|HST", "Pacific/Honolulu|Pacific/Johnston", "Pacific/Honolulu|US/Hawaii", "Pacific/Kwajalein|Kwajalein", "Pacific/Niue|Etc/GMT+11", "Pacific/Pago_Pago|Pacific/Midway", "Pacific/Pago_Pago|Pacific/Samoa", "Pacific/Pago_Pago|US/Samoa", "Pacific/Palau|Etc/GMT-9", "Pacific/Port_Moresby|Antarctica/DumontDUrville", "Pacific/Port_Moresby|Etc/GMT-10", "Pacific/Port_Moresby|Pacific/Chuuk", "Pacific/Port_Moresby|Pacific/Truk", "Pacific/Port_Moresby|Pacific/Yap", "Pacific/Tahiti|Etc/GMT+10", "Pacific/Tarawa|Etc/GMT-12", "Pacific/Tarawa|Pacific/Funafuti", "Pacific/Tarawa|Pacific/Majuro", "Pacific/Tarawa|Pacific/Wake", "Pacific/Tarawa|Pacific/Wallis" ], "countries": [ "AD|Europe/Andorra", "AE|Asia/Dubai", "AF|Asia/Kabul", "AG|America/Puerto_Rico America/Antigua", "AI|America/Puerto_Rico America/Anguilla", "AL|Europe/Tirane", "AM|Asia/Yerevan", "AO|Africa/Lagos Africa/Luanda", "AQ|Antarctica/Casey Antarctica/Davis Antarctica/Mawson Antarctica/Palmer Antarctica/Rothera Antarctica/Troll Asia/Urumqi Pacific/Auckland Pacific/Port_Moresby Asia/Riyadh Antarctica/McMurdo Antarctica/DumontDUrville Antarctica/Syowa Antarctica/Vostok", "AR|America/Argentina/Buenos_Aires America/Argentina/Cordoba America/Argentina/Salta America/Argentina/Jujuy America/Argentina/Tucuman America/Argentina/Catamarca America/Argentina/La_Rioja America/Argentina/San_Juan America/Argentina/Mendoza America/Argentina/San_Luis America/Argentina/Rio_Gallegos America/Argentina/Ushuaia", "AS|Pacific/Pago_Pago", "AT|Europe/Vienna", "AU|Australia/Lord_Howe Antarctica/Macquarie Australia/Hobart Australia/Melbourne Australia/Sydney Australia/Broken_Hill Australia/Brisbane Australia/Lindeman Australia/Adelaide Australia/Darwin Australia/Perth Australia/Eucla", "AW|America/Puerto_Rico America/Aruba", "AX|Europe/Helsinki Europe/Mariehamn", "AZ|Asia/Baku", "BA|Europe/Belgrade Europe/Sarajevo", "BB|America/Barbados", "BD|Asia/Dhaka", "BE|Europe/Brussels", "BF|Africa/Abidjan Africa/Ouagadougou", "BG|Europe/Sofia", "BH|Asia/Qatar Asia/Bahrain", "BI|Africa/Maputo Africa/Bujumbura", "BJ|Africa/Lagos Africa/Porto-Novo", "BL|America/Puerto_Rico America/St_Barthelemy", "BM|Atlantic/Bermuda", "BN|Asia/Kuching Asia/Brunei", "BO|America/La_Paz", "BQ|America/Puerto_Rico America/Kralendijk", "BR|America/Noronha America/Belem America/Fortaleza America/Recife America/Araguaina America/Maceio America/Bahia America/Sao_Paulo America/Campo_Grande America/Cuiaba America/Santarem America/Porto_Velho America/Boa_Vista America/Manaus America/Eirunepe America/Rio_Branco", "BS|America/Toronto America/Nassau", "BT|Asia/Thimphu", "BW|Africa/Maputo Africa/Gaborone", "BY|Europe/Minsk", "BZ|America/Belize", "CA|America/St_Johns America/Halifax America/Glace_Bay America/Moncton America/Goose_Bay America/Toronto America/Iqaluit America/Winnipeg America/Resolute America/Rankin_Inlet America/Regina America/Swift_Current America/Edmonton America/Cambridge_Bay America/Inuvik America/Dawson_Creek America/Fort_Nelson America/Whitehorse America/Dawson America/Vancouver America/Panama America/Puerto_Rico America/Phoenix America/Blanc-Sablon America/Atikokan America/Creston", "CC|Asia/Yangon Indian/Cocos", "CD|Africa/Maputo Africa/Lagos Africa/Kinshasa Africa/Lubumbashi", "CF|Africa/Lagos Africa/Bangui", "CG|Africa/Lagos Africa/Brazzaville", "CH|Europe/Zurich", "CI|Africa/Abidjan", "CK|Pacific/Rarotonga", "CL|America/Santiago America/Punta_Arenas Pacific/Easter", "CM|Africa/Lagos Africa/Douala", "CN|Asia/Shanghai Asia/Urumqi", "CO|America/Bogota", "CR|America/Costa_Rica", "CU|America/Havana", "CV|Atlantic/Cape_Verde", "CW|America/Puerto_Rico America/Curacao", "CX|Asia/Bangkok Indian/Christmas", "CY|Asia/Nicosia Asia/Famagusta", "CZ|Europe/Prague", "DE|Europe/Zurich Europe/Berlin Europe/Busingen", "DJ|Africa/Nairobi Africa/Djibouti", "DK|Europe/Berlin Europe/Copenhagen", "DM|America/Puerto_Rico America/Dominica", "DO|America/Santo_Domingo", "DZ|Africa/Algiers", "EC|America/Guayaquil Pacific/Galapagos", "EE|Europe/Tallinn", "EG|Africa/Cairo", "EH|Africa/El_Aaiun", "ER|Africa/Nairobi Africa/Asmara", "ES|Europe/Madrid Africa/Ceuta Atlantic/Canary", "ET|Africa/Nairobi Africa/Addis_Ababa", "FI|Europe/Helsinki", "FJ|Pacific/Fiji", "FK|Atlantic/Stanley", "FM|Pacific/Kosrae Pacific/Port_Moresby Pacific/Guadalcanal Pacific/Chuuk Pacific/Pohnpei", "FO|Atlantic/Faroe", "FR|Europe/Paris", "GA|Africa/Lagos Africa/Libreville", "GB|Europe/London", "GD|America/Puerto_Rico America/Grenada", "GE|Asia/Tbilisi", "GF|America/Cayenne", "GG|Europe/London Europe/Guernsey", "GH|Africa/Abidjan Africa/Accra", "GI|Europe/Gibraltar", "GL|America/Nuuk America/Danmarkshavn America/Scoresbysund America/Thule", "GM|Africa/Abidjan Africa/Banjul", "GN|Africa/Abidjan Africa/Conakry", "GP|America/Puerto_Rico America/Guadeloupe", "GQ|Africa/Lagos Africa/Malabo", "GR|Europe/Athens", "GS|Atlantic/South_Georgia", "GT|America/Guatemala", "GU|Pacific/Guam", "GW|Africa/Bissau", "GY|America/Guyana", "HK|Asia/Hong_Kong", "HN|America/Tegucigalpa", "HR|Europe/Belgrade Europe/Zagreb", "HT|America/Port-au-Prince", "HU|Europe/Budapest", "ID|Asia/Jakarta Asia/Pontianak Asia/Makassar Asia/Jayapura", "IE|Europe/Dublin", "IL|Asia/Jerusalem", "IM|Europe/London Europe/Isle_of_Man", "IN|Asia/Kolkata", "IO|Indian/Chagos", "IQ|Asia/Baghdad", "IR|Asia/Tehran", "IS|Africa/Abidjan Atlantic/Reykjavik", "IT|Europe/Rome", "JE|Europe/London Europe/Jersey", "JM|America/Jamaica", "JO|Asia/Amman", "JP|Asia/Tokyo", "KE|Africa/Nairobi", "KG|Asia/Bishkek", "KH|Asia/Bangkok Asia/Phnom_Penh", "KI|Pacific/Tarawa Pacific/Kanton Pacific/Kiritimati", "KM|Africa/Nairobi Indian/Comoro", "KN|America/Puerto_Rico America/St_Kitts", "KP|Asia/Pyongyang", "KR|Asia/Seoul", "KW|Asia/Riyadh Asia/Kuwait", "KY|America/Panama America/Cayman", "KZ|Asia/Almaty Asia/Qyzylorda Asia/Qostanay Asia/Aqtobe Asia/Aqtau Asia/Atyrau Asia/Oral", "LA|Asia/Bangkok Asia/Vientiane", "LB|Asia/Beirut", "LC|America/Puerto_Rico America/St_Lucia", "LI|Europe/Zurich Europe/Vaduz", "LK|Asia/Colombo", "LR|Africa/Monrovia", "LS|Africa/Johannesburg Africa/Maseru", "LT|Europe/Vilnius", "LU|Europe/Brussels Europe/Luxembourg", "LV|Europe/Riga", "LY|Africa/Tripoli", "MA|Africa/Casablanca", "MC|Europe/Paris Europe/Monaco", "MD|Europe/Chisinau", "ME|Europe/Belgrade Europe/Podgorica", "MF|America/Puerto_Rico America/Marigot", "MG|Africa/Nairobi Indian/Antananarivo", "MH|Pacific/Tarawa Pacific/Kwajalein Pacific/Majuro", "MK|Europe/Belgrade Europe/Skopje", "ML|Africa/Abidjan Africa/Bamako", "MM|Asia/Yangon", "MN|Asia/Ulaanbaatar Asia/Hovd Asia/Choibalsan", "MO|Asia/Macau", "MP|Pacific/Guam Pacific/Saipan", "MQ|America/Martinique", "MR|Africa/Abidjan Africa/Nouakchott", "MS|America/Puerto_Rico America/Montserrat", "MT|Europe/Malta", "MU|Indian/Mauritius", "MV|Indian/Maldives", "MW|Africa/Maputo Africa/Blantyre", "MX|America/Mexico_City America/Cancun America/Merida America/Monterrey America/Matamoros America/Chihuahua America/Ciudad_Juarez America/Ojinaga America/Mazatlan America/Bahia_Banderas America/Hermosillo America/Tijuana", "MY|Asia/Kuching Asia/Singapore Asia/Kuala_Lumpur", "MZ|Africa/Maputo", "NA|Africa/Windhoek", "NC|Pacific/Noumea", "NE|Africa/Lagos Africa/Niamey", "NF|Pacific/Norfolk", "NG|Africa/Lagos", "NI|America/Managua", "NL|Europe/Brussels Europe/Amsterdam", "NO|Europe/Berlin Europe/Oslo", "NP|Asia/Kathmandu", "NR|Pacific/Nauru", "NU|Pacific/Niue", "NZ|Pacific/Auckland Pacific/Chatham", "OM|Asia/Dubai Asia/Muscat", "PA|America/Panama", "PE|America/Lima", "PF|Pacific/Tahiti Pacific/Marquesas Pacific/Gambier", "PG|Pacific/Port_Moresby Pacific/Bougainville", "PH|Asia/Manila", "PK|Asia/Karachi", "PL|Europe/Warsaw", "PM|America/Miquelon", "PN|Pacific/Pitcairn", "PR|America/Puerto_Rico", "PS|Asia/Gaza Asia/Hebron", "PT|Europe/Lisbon Atlantic/Madeira Atlantic/Azores", "PW|Pacific/Palau", "PY|America/Asuncion", "QA|Asia/Qatar", "RE|Asia/Dubai Indian/Reunion", "RO|Europe/Bucharest", "RS|Europe/Belgrade", "RU|Europe/Kaliningrad Europe/Moscow Europe/Simferopol Europe/Kirov Europe/Volgograd Europe/Astrakhan Europe/Saratov Europe/Ulyanovsk Europe/Samara Asia/Yekaterinburg Asia/Omsk Asia/Novosibirsk Asia/Barnaul Asia/Tomsk Asia/Novokuznetsk Asia/Krasnoyarsk Asia/Irkutsk Asia/Chita Asia/Yakutsk Asia/Khandyga Asia/Vladivostok Asia/Ust-Nera Asia/Magadan Asia/Sakhalin Asia/Srednekolymsk Asia/Kamchatka Asia/Anadyr", "RW|Africa/Maputo Africa/Kigali", "SA|Asia/Riyadh", "SB|Pacific/Guadalcanal", "SC|Asia/Dubai Indian/Mahe", "SD|Africa/Khartoum", "SE|Europe/Berlin Europe/Stockholm", "SG|Asia/Singapore", "SH|Africa/Abidjan Atlantic/St_Helena", "SI|Europe/Belgrade Europe/Ljubljana", "SJ|Europe/Berlin Arctic/Longyearbyen", "SK|Europe/Prague Europe/Bratislava", "SL|Africa/Abidjan Africa/Freetown", "SM|Europe/Rome Europe/San_Marino", "SN|Africa/Abidjan Africa/Dakar", "SO|Africa/Nairobi Africa/Mogadishu", "SR|America/Paramaribo", "SS|Africa/Juba", "ST|Africa/Sao_Tome", "SV|America/El_Salvador", "SX|America/Puerto_Rico America/Lower_Princes", "SY|Asia/Damascus", "SZ|Africa/Johannesburg Africa/Mbabane", "TC|America/Grand_Turk", "TD|Africa/Ndjamena", "TF|Asia/Dubai Indian/Maldives Indian/Kerguelen", "TG|Africa/Abidjan Africa/Lome", "TH|Asia/Bangkok", "TJ|Asia/Dushanbe", "TK|Pacific/Fakaofo", "TL|Asia/Dili", "TM|Asia/Ashgabat", "TN|Africa/Tunis", "TO|Pacific/Tongatapu", "TR|Europe/Istanbul", "TT|America/Puerto_Rico America/Port_of_Spain", "TV|Pacific/Tarawa Pacific/Funafuti", "TW|Asia/Taipei", "TZ|Africa/Nairobi Africa/Dar_es_Salaam", "UA|Europe/Simferopol Europe/Kyiv", "UG|Africa/Nairobi Africa/Kampala", "UM|Pacific/Pago_Pago Pacific/Tarawa Pacific/Midway Pacific/Wake", "US|America/New_York America/Detroit America/Kentucky/Louisville America/Kentucky/Monticello America/Indiana/Indianapolis America/Indiana/Vincennes America/Indiana/Winamac America/Indiana/Marengo America/Indiana/Petersburg America/Indiana/Vevay America/Chicago America/Indiana/Tell_City America/Indiana/Knox America/Menominee America/North_Dakota/Center America/North_Dakota/New_Salem America/North_Dakota/Beulah America/Denver America/Boise America/Phoenix America/Los_Angeles America/Anchorage America/Juneau America/Sitka America/Metlakatla America/Yakutat America/Nome America/Adak Pacific/Honolulu", "UY|America/Montevideo", "UZ|Asia/Samarkand Asia/Tashkent", "VA|Europe/Rome Europe/Vatican", "VC|America/Puerto_Rico America/St_Vincent", "VE|America/Caracas", "VG|America/Puerto_Rico America/Tortola", "VI|America/Puerto_Rico America/St_Thomas", "VN|Asia/Bangkok Asia/Ho_Chi_Minh", "VU|Pacific/Efate", "WF|Pacific/Tarawa Pacific/Wallis", "WS|Pacific/Apia", "YE|Asia/Riyadh Asia/Aden", "YT|Africa/Nairobi Indian/Mayotte", "ZA|Africa/Johannesburg", "ZM|Africa/Maputo Africa/Lusaka", "ZW|Africa/Maputo Africa/Harare" ] }); return moment; }); } }); // node_modules/moment-timezone/moment-timezone-utils.js var require_moment_timezone_utils = __commonJS({ "node_modules/moment-timezone/moment-timezone-utils.js"(exports, module) { (function(root, factory) { "use strict"; if (typeof module === "object" && module.exports) { module.exports = factory(require_moment_timezone_with_data_1970_2030()); } else if (typeof define === "function" && define.amd) { define(["moment"], factory); } else { factory(root.moment); } })(exports, function(moment) { "use strict"; if (!moment.tz) { throw new Error("moment-timezone-utils.js must be loaded after moment-timezone.js"); } var BASE60 = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX", EPSILON = 1e-6; function packBase60Fraction(fraction, precision) { var buffer = ".", output = "", current; while (precision > 0) { precision -= 1; fraction *= 60; current = Math.floor(fraction + EPSILON); buffer += BASE60[current]; fraction -= current; if (current) { output += buffer; buffer = ""; } } return output; } function packBase60(number, precision) { var output = "", absolute = Math.abs(number), whole = Math.floor(absolute), fraction = packBase60Fraction(absolute - whole, Math.min(~~precision, 10)); while (whole > 0) { output = BASE60[whole % 60] + output; whole = Math.floor(whole / 60); } if (number < 0) { output = "-" + output; } if (output && fraction) { return output + fraction; } if (!fraction && output === "-") { return "0"; } return output || fraction || "0"; } function packUntils(untils) { var out = [], last = 0, i; for (i = 0; i < untils.length - 1; i++) { out[i] = packBase60(Math.round((untils[i] - last) / 1e3) / 60, 1); last = untils[i]; } return out.join(" "); } function packAbbrsAndOffsets(source) { var index = 0, abbrs = [], offsets = [], indices = [], map = {}, i, key; for (i = 0; i < source.abbrs.length; i++) { key = source.abbrs[i] + "|" + source.offsets[i]; if (map[key] === void 0) { map[key] = index; abbrs[index] = source.abbrs[i]; offsets[index] = packBase60(Math.round(source.offsets[i] * 60) / 60, 1); index++; } indices[i] = packBase60(map[key], 0); } return abbrs.join(" ") + "|" + offsets.join(" ") + "|" + indices.join(""); } function packPopulation(number) { if (!number) { return ""; } if (number < 1e3) { return number; } var exponent = String(number | 0).length - 2; var precision = Math.round(number / Math.pow(10, exponent)); return precision + "e" + exponent; } function packCountries(countries) { if (!countries) { return ""; } return countries.join(" "); } function validatePackData(source) { if (!source.name) { throw new Error("Missing name"); } if (!source.abbrs) { throw new Error("Missing abbrs"); } if (!source.untils) { throw new Error("Missing untils"); } if (!source.offsets) { throw new Error("Missing offsets"); } if (source.offsets.length !== source.untils.length || source.offsets.length !== source.abbrs.length) { throw new Error("Mismatched array lengths"); } } function pack(source) { validatePackData(source); return [ source.name, // 0 - timezone name packAbbrsAndOffsets(source), // 1 - abbrs, 2 - offsets, 3 - indices packUntils(source.untils), // 4 - untils packPopulation(source.population) // 5 - population ].join("|"); } function packCountry(source) { return [ source.name, source.zones.join(" ") ].join("|"); } function arraysAreEqual(a, b) { var i; if (a.length !== b.length) { return false; } for (i = 0; i < a.length; i++) { if (a[i] !== b[i]) { return false; } } return true; } function zonesAreEqual(a, b) { return arraysAreEqual(a.offsets, b.offsets) && arraysAreEqual(a.abbrs, b.abbrs) && arraysAreEqual(a.untils, b.untils); } function findAndCreateLinks(input, output, links, groupLeaders) { var i, j, a, b, group, foundGroup, groups = []; for (i = 0; i < input.length; i++) { foundGroup = false; a = input[i]; for (j = 0; j < groups.length; j++) { group = groups[j]; b = group[0]; if (zonesAreEqual(a, b)) { if (a.population > b.population) { group.unshift(a); } else if (a.population === b.population && groupLeaders && groupLeaders[a.name]) { group.unshift(a); } else { group.push(a); } foundGroup = true; } } if (!foundGroup) { groups.push([a]); } } for (i = 0; i < groups.length; i++) { group = groups[i]; output.push(group[0]); for (j = 1; j < group.length; j++) { links.push(group[0].name + "|" + group[j].name); } } } function createLinks(source, groupLeaders) { var zones = [], links = []; if (source.links) { links = source.links.slice(); } findAndCreateLinks(source.zones, zones, links, groupLeaders); return { version: source.version, zones, links: links.sort() }; } function findStartAndEndIndex(untils, start, end) { var startI = 0, endI = untils.length + 1, untilYear, i; if (!end) { end = start; } if (start > end) { i = start; start = end; end = i; } for (i = 0; i < untils.length; i++) { if (untils[i] == null) { continue; } untilYear = new Date(untils[i]).getUTCFullYear(); if (untilYear < start) { startI = i + 1; } if (untilYear > end) { endI = Math.min(endI, i + 1); } } return [startI, endI]; } function filterYears(source, start, end) { var slice = Array.prototype.slice, indices = findStartAndEndIndex(source.untils, start, end), untils = slice.apply(source.untils, indices); untils[untils.length - 1] = null; return { name: source.name, abbrs: slice.apply(source.abbrs, indices), untils, offsets: slice.apply(source.offsets, indices), population: source.population, countries: source.countries }; } function filterLinkPack(input, start, end, groupLeaders) { var i, inputZones = input.zones, outputZones = [], output; for (i = 0; i < inputZones.length; i++) { outputZones[i] = filterYears(inputZones[i], start, end); } output = createLinks({ zones: outputZones, links: input.links.slice(), version: input.version }, groupLeaders); for (i = 0; i < output.zones.length; i++) { output.zones[i] = pack(output.zones[i]); } output.countries = input.countries ? input.countries.map(function(unpacked) { return packCountry(unpacked); }) : []; return output; } moment.tz.pack = pack; moment.tz.packBase60 = packBase60; moment.tz.createLinks = createLinks; moment.tz.filterYears = filterYears; moment.tz.filterLinkPack = filterLinkPack; moment.tz.packCountry = packCountry; return moment; }); } }); // package-external:@wordpress/deprecated var require_deprecated = __commonJS({ "package-external:@wordpress/deprecated"(exports, module) { module.exports = window.wp.deprecated; } }); // packages/date/build-module/index.mjs var index_exports = {}; __export(index_exports, { __experimentalGetSettings: () => __experimentalGetSettings, date: () => date, dateI18n: () => dateI18n, format: () => format, getDate: () => getDate, getSettings: () => getSettings, gmdate: () => gmdate, gmdateI18n: () => gmdateI18n, humanTimeDiff: () => humanTimeDiff, isInTheFuture: () => isInTheFuture, setSettings: () => setSettings }); var import_moment = __toESM(require_moment(), 1); var import_moment_timezone = __toESM(require_moment_timezone_with_data_1970_2030(), 1); var import_moment_timezone_utils = __toESM(require_moment_timezone_utils(), 1); var import_deprecated = __toESM(require_deprecated(), 1); var WP_ZONE = "WP"; var VALID_UTC_OFFSET = /^[+-][0-1][0-9](:?[0-9][0-9])?$/; var settings = { l10n: { locale: "en", months: [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ], monthsShort: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ], weekdays: [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ], weekdaysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], meridiem: { am: "am", pm: "pm", AM: "AM", PM: "PM" }, relative: { future: "%s from now", past: "%s ago", s: "a few seconds", ss: "%d seconds", m: "a minute", mm: "%d minutes", h: "an hour", hh: "%d hours", d: "a day", dd: "%d days", M: "a month", MM: "%d months", y: "a year", yy: "%d years" }, startOfWeek: 0 }, formats: { time: "g:i a", date: "F j, Y", datetime: "F j, Y g:i a", datetimeAbbreviated: "M j, Y g:i a" }, timezone: { offset: 0, offsetFormatted: "0", string: "", abbr: "" } }; function setSettings(dateSettings) { settings = dateSettings; setupWPTimezone(); if (import_moment.default.locales().includes(dateSettings.l10n.locale)) { if (import_moment.default.localeData(dateSettings.l10n.locale).longDateFormat("LTS") === null) { import_moment.default.defineLocale(dateSettings.l10n.locale, null); } else { return; } } const currentLocale = import_moment.default.locale(); import_moment.default.defineLocale(dateSettings.l10n.locale, { // Inherit anything missing from English. We don't load // moment-with-locales.js so English is all there is. parentLocale: "en", months: dateSettings.l10n.months, monthsShort: dateSettings.l10n.monthsShort, weekdays: dateSettings.l10n.weekdays, weekdaysShort: dateSettings.l10n.weekdaysShort, meridiem(hour, minute, isLowercase) { if (hour < 12) { return isLowercase ? dateSettings.l10n.meridiem.am : dateSettings.l10n.meridiem.AM; } return isLowercase ? dateSettings.l10n.meridiem.pm : dateSettings.l10n.meridiem.PM; }, longDateFormat: { LT: dateSettings.formats.time, LTS: import_moment.default.localeData("en").longDateFormat("LTS"), L: import_moment.default.localeData("en").longDateFormat("L"), LL: dateSettings.formats.date, LLL: dateSettings.formats.datetime, LLLL: import_moment.default.localeData("en").longDateFormat("LLLL") }, // From human_time_diff? // Set to `(number, withoutSuffix, key, isFuture) => {}` instead. relativeTime: dateSettings.l10n.relative }); import_moment.default.locale(currentLocale); } function getSettings() { return settings; } function __experimentalGetSettings() { (0, import_deprecated.default)("wp.date.__experimentalGetSettings", { since: "6.1", alternative: "wp.date.getSettings" }); return getSettings(); } function setupWPTimezone() { const currentTimezone = import_moment.default.tz.zone(settings.timezone.string); if (currentTimezone) { import_moment.default.tz.add( import_moment.default.tz.pack({ name: WP_ZONE, abbrs: currentTimezone.abbrs, untils: currentTimezone.untils, offsets: currentTimezone.offsets }) ); } else { import_moment.default.tz.add( import_moment.default.tz.pack({ name: WP_ZONE, abbrs: [WP_ZONE], untils: [null], offsets: [-settings.timezone.offset * 60 || 0] }) ); } } var MINUTE_IN_SECONDS = 60; var HOUR_IN_MINUTES = 60; var HOUR_IN_SECONDS = 60 * MINUTE_IN_SECONDS; var formatMap = { // Day. d: "DD", D: "ddd", j: "D", l: "dddd", N: "E", /** * Gets the ordinal suffix. * * @param momentDate Moment instance. * * @return Formatted date. */ S(momentDate) { const num = momentDate.format("D"); const withOrdinal = momentDate.format("Do"); return withOrdinal.replace(num, ""); }, w: "d", /** * Gets the day of the year (zero-indexed). * * @param momentDate Moment instance. * * @return Formatted date. */ z(momentDate) { return (parseInt(momentDate.format("DDD"), 10) - 1).toString(); }, // Week. W: "W", // Month. F: "MMMM", m: "MM", M: "MMM", n: "M", /** * Gets the days in the month. * * @param momentDate Moment instance. * * @return Formatted date. */ t(momentDate) { return momentDate.daysInMonth(); }, // Year. /** * Gets whether the current year is a leap year. * * @param momentDate Moment instance. * * @return Formatted date. */ L(momentDate) { return momentDate.isLeapYear() ? "1" : "0"; }, o: "GGGG", Y: "YYYY", y: "YY", // Time. a: "a", A: "A", /** * Gets the current time in Swatch Internet Time (.beats). * * @param momentDate Moment instance. * * @return Formatted date. */ B(momentDate) { const timezoned = (0, import_moment.default)(momentDate).utcOffset(60); const seconds = parseInt(timezoned.format("s"), 10), minutes = parseInt(timezoned.format("m"), 10), hours = parseInt(timezoned.format("H"), 10); return parseInt( ((seconds + minutes * MINUTE_IN_SECONDS + hours * HOUR_IN_SECONDS) / 86.4).toString(), 10 ); }, g: "h", G: "H", h: "hh", H: "HH", i: "mm", s: "ss", u: "SSSSSS", v: "SSS", // Timezone. e: "zz", /** * Gets whether the timezone is in DST currently. * * @param momentDate Moment instance. * * @return Formatted date. */ I(momentDate) { return momentDate.isDST() ? "1" : "0"; }, O: "ZZ", P: "Z", T: "z", /** * Gets the timezone offset in seconds. * * @param momentDate Moment instance. * * @return Formatted date. */ Z(momentDate) { const offset = momentDate.format("Z"); const sign = offset[0] === "-" ? -1 : 1; const parts = offset.substring(1).split(":").map((n) => parseInt(n, 10)); return sign * (parts[0] * HOUR_IN_MINUTES + parts[1]) * MINUTE_IN_SECONDS; }, // Full date/time. c: "YYYY-MM-DDTHH:mm:ssZ", // .toISOString. /** * Formats the date as RFC2822. * * @param momentDate Moment instance. * * @return Formatted date. */ r(momentDate) { return momentDate.locale("en").format("ddd, DD MMM YYYY HH:mm:ss ZZ"); }, U: "X" }; function format(dateFormat, dateValue = /* @__PURE__ */ new Date()) { let i, char; const newFormat = []; const momentDate = (0, import_moment.default)(dateValue); for (i = 0; i < dateFormat.length; i++) { char = dateFormat[i]; if ("\\" === char) { i++; newFormat.push("[" + dateFormat[i] + "]"); continue; } if (char in formatMap) { const formatter = formatMap[char]; if (typeof formatter !== "string") { newFormat.push("[" + formatter(momentDate) + "]"); } else { newFormat.push(formatter); } } else { newFormat.push("[" + char + "]"); } } return momentDate.format(newFormat.join("[]")); } function date(dateFormat, dateValue = /* @__PURE__ */ new Date(), timezone) { const dateMoment = buildMoment(dateValue, timezone); return format(dateFormat, dateMoment); } function gmdate(dateFormat, dateValue = /* @__PURE__ */ new Date()) { const dateMoment = (0, import_moment.default)(dateValue).utc(); return format(dateFormat, dateMoment); } function dateI18n(dateFormat, dateValue = /* @__PURE__ */ new Date(), timezone) { if (true === timezone) { return gmdateI18n(dateFormat, dateValue); } if (false === timezone) { timezone = void 0; } const dateMoment = buildMoment(dateValue, timezone); dateMoment.locale(settings.l10n.locale); return format(dateFormat, dateMoment); } function gmdateI18n(dateFormat, dateValue = /* @__PURE__ */ new Date()) { const dateMoment = (0, import_moment.default)(dateValue).utc(); dateMoment.locale(settings.l10n.locale); return format(dateFormat, dateMoment); } function isInTheFuture(dateValue) { const now = import_moment.default.tz(WP_ZONE); const momentObject = import_moment.default.tz(dateValue, WP_ZONE); return momentObject.isAfter(now); } function getDate(dateString) { if (!dateString) { return import_moment.default.tz(WP_ZONE).toDate(); } return import_moment.default.tz(dateString, WP_ZONE).toDate(); } function humanTimeDiff(from, to) { const fromMoment = import_moment.default.tz(from, WP_ZONE); const toMoment = to ? import_moment.default.tz(to, WP_ZONE) : import_moment.default.tz(WP_ZONE); return fromMoment.from(toMoment); } function buildMoment(dateValue, timezone = "") { const dateMoment = (0, import_moment.default)(dateValue); if (timezone !== "") { return isUTCOffset(timezone) ? dateMoment.utcOffset(timezone) : ( // A false isUTCOffset() guarantees that timezone is a string. dateMoment.tz(timezone) ); } if (settings.timezone.string) { return dateMoment.tz(settings.timezone.string); } return dateMoment.utcOffset(+settings.timezone.offset); } function isUTCOffset(offset) { if ("number" === typeof offset) { return true; } return VALID_UTC_OFFSET.test(offset); } setupWPTimezone(); return __toCommonJS(index_exports); })(); /*! Bundled license information: moment-timezone/builds/moment-timezone-with-data-1970-2030.js: (*! moment-timezone.js *) (*! version : 0.5.43 *) (*! Copyright (c) JS Foundation and other contributors *) (*! license : MIT *) (*! github.com/moment/moment-timezone *) moment-timezone/moment-timezone-utils.js: (*! moment-timezone-utils.js *) (*! version : 0.5.43 *) (*! Copyright (c) JS Foundation and other contributors *) (*! license : MIT *) (*! github.com/moment/moment-timezone *) */ private-apis.min.js 0000644 00000005200 15206720414 0010266 0 ustar 00 "use strict";var wp;(wp||={}).privateApis=(()=>{var n=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var u=(r,e)=>{for(var o in e)n(r,o,{get:e[o],enumerable:!0})},c=(r,e,o,d)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of w(e))!p.call(r,s)&&s!==o&&n(r,s,{get:()=>e[s],enumerable:!(d=l(e,s))||d.enumerable});return r};var f=r=>c(n({},"__esModule",{value:!0}),r);var y={};u(y,{__dangerousOptInToUnstableAPIsOnlyForCoreModules:()=>i});var h=["@wordpress/block-directory","@wordpress/block-editor","@wordpress/block-library","@wordpress/blocks","@wordpress/boot","@wordpress/commands","@wordpress/connectors","@wordpress/workflows","@wordpress/components","@wordpress/core-commands","@wordpress/core-data","@wordpress/customize-widgets","@wordpress/data","@wordpress/edit-post","@wordpress/edit-site","@wordpress/edit-widgets","@wordpress/editor","@wordpress/font-list-route","@wordpress/format-library","@wordpress/patterns","@wordpress/preferences","@wordpress/reusable-blocks","@wordpress/rich-text","@wordpress/route","@wordpress/router","@wordpress/routes","@wordpress/sync","@wordpress/theme","@wordpress/dataviews","@wordpress/fields","@wordpress/lazy-editor","@wordpress/media-utils","@wordpress/upload-media","@wordpress/global-styles-ui","@wordpress/ui"],b="I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.",i=(r,e)=>{if(!h.includes(e))throw new Error(`You tried to opt-in to unstable APIs as module "${e}". This feature is only for JavaScript modules shipped with WordPress core. Please do not use it in plugins and themes as the unstable APIs will be removed without a warning. If you ignore this error and depend on unstable features, your product will inevitably break on one of the next WordPress releases.`);if(r!==b)throw new Error("You tried to opt-in to unstable APIs without confirming you know the consequences. This feature is only for JavaScript modules shipped with WordPress core. Please do not use it in plugins and themes as the unstable APIs will removed without a warning. If you ignore this error and depend on unstable features, your product will inevitably break on the next WordPress release.");return{lock:m,unlock:k}};function m(r,e){if(!r)throw new Error("Cannot lock an undefined object.");let o=r;t in o||(o[t]={}),a.set(o[t],e)}function k(r){if(!r)throw new Error("Cannot unlock an undefined object.");let e=r;if(!(t in e))throw new Error("Cannot unlock an object that was not locked before. ");return a.get(e[t])}var a=new WeakMap,t=Symbol("Private API ID");return f(y);})(); private-apis.js 0000644 00000010140 15206720414 0007503 0 ustar 00 "use strict"; var wp; (wp ||= {}).privateApis = (() => { var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; 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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // packages/private-apis/build-module/index.mjs var index_exports = {}; __export(index_exports, { __dangerousOptInToUnstableAPIsOnlyForCoreModules: () => __dangerousOptInToUnstableAPIsOnlyForCoreModules }); // packages/private-apis/build-module/implementation.mjs var CORE_MODULES_USING_PRIVATE_APIS = [ "@wordpress/block-directory", "@wordpress/block-editor", "@wordpress/block-library", "@wordpress/blocks", "@wordpress/boot", "@wordpress/commands", "@wordpress/connectors", "@wordpress/workflows", "@wordpress/components", "@wordpress/core-commands", "@wordpress/core-data", "@wordpress/customize-widgets", "@wordpress/data", "@wordpress/edit-post", "@wordpress/edit-site", "@wordpress/edit-widgets", "@wordpress/editor", "@wordpress/font-list-route", "@wordpress/format-library", "@wordpress/patterns", "@wordpress/preferences", "@wordpress/reusable-blocks", "@wordpress/rich-text", "@wordpress/route", "@wordpress/router", "@wordpress/routes", "@wordpress/sync", "@wordpress/theme", "@wordpress/dataviews", "@wordpress/fields", "@wordpress/lazy-editor", "@wordpress/media-utils", "@wordpress/upload-media", "@wordpress/global-styles-ui", "@wordpress/ui" ]; var requiredConsent = "I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress."; var __dangerousOptInToUnstableAPIsOnlyForCoreModules = (consent, moduleName) => { if (!CORE_MODULES_USING_PRIVATE_APIS.includes(moduleName)) { throw new Error( `You tried to opt-in to unstable APIs as module "${moduleName}". This feature is only for JavaScript modules shipped with WordPress core. Please do not use it in plugins and themes as the unstable APIs will be removed without a warning. If you ignore this error and depend on unstable features, your product will inevitably break on one of the next WordPress releases.` ); } if (consent !== requiredConsent) { throw new Error( `You tried to opt-in to unstable APIs without confirming you know the consequences. This feature is only for JavaScript modules shipped with WordPress core. Please do not use it in plugins and themes as the unstable APIs will removed without a warning. If you ignore this error and depend on unstable features, your product will inevitably break on the next WordPress release.` ); } return { lock, unlock }; }; function lock(object, privateData) { if (!object) { throw new Error("Cannot lock an undefined object."); } const _object = object; if (!(__private in _object)) { _object[__private] = {}; } lockedData.set(_object[__private], privateData); } function unlock(object) { if (!object) { throw new Error("Cannot unlock an undefined object."); } const _object = object; if (!(__private in _object)) { throw new Error( "Cannot unlock an object that was not locked before. " ); } return lockedData.get(_object[__private]); } var lockedData = /* @__PURE__ */ new WeakMap(); var __private = /* @__PURE__ */ Symbol("Private API ID"); return __toCommonJS(index_exports); })(); date.min.js 0000644 00000432275 15206720414 0006617 0 ustar 00 "use strict";var wp;(wp||={}).date=(()=>{var E0=Object.create;var j=Object.defineProperty;var R0=Object.getOwnPropertyDescriptor;var S0=Object.getOwnPropertyNames;var h0=Object.getPrototypeOf,g0=Object.prototype.hasOwnProperty;var F=(M,n)=>()=>(n||M((n={exports:{}}).exports,n),n.exports),C0=(M,n)=>{for(var e in n)j(M,e,{get:n[e],enumerable:!0})},b0=(M,n,e,q)=>{if(n&&typeof n=="object"||typeof n=="function")for(let u of S0(n))!g0.call(M,u)&&u!==e&&j(M,u,{get:()=>n[u],enumerable:!(q=R0(n,u))||q.enumerable});return M};var V=(M,n,e)=>(e=M!=null?E0(h0(M)):{},b0(n||!M||!M.__esModule?j(e,"default",{value:M,enumerable:!0}):e,M)),P0=M=>b0(j({},"__esModule",{value:!0}),M);var M0=F((J0,r0)=>{r0.exports=window.moment});var a0=F((p0,x)=>{(function(M,n){"use strict";typeof x=="object"&&x.exports?x.exports=n(M0()):typeof define=="function"&&define.amd?define(["moment"],n):n(M.moment)})(p0,function(M){"use strict";M.version===void 0&&M.default&&(M=M.default);var n="0.5.43",e={},q={},u={},W={},E={},I;(!M||typeof M.version!="string")&&D("Moment Timezone requires Moment.js. See https://momentjs.com/timezone/docs/#/use-it/browser/");var Y=M.version.split("."),_=+Y[0],w=+Y[1];(_<2||_===2&&w<6)&&D("Moment Timezone requires Moment.js >= 2.6.0. You are using Moment.js "+M.version+". See momentjs.com");function K(c){return c>96?c-87:c>64?c-29:c-48}function k(c){var o=0,a=c.split("."),i=a[0],b=a[1]||"",d=1,B,m=0,L=1;for(c.charCodeAt(0)===45&&(o=1,L=-1),o;o<i.length;o++)B=K(i.charCodeAt(o)),m=60*m+B;for(o=0;o<b.length;o++)d=d/60,B=K(b.charCodeAt(o)),m+=B*d;return m*L}function y(c){for(var o=0;o<c.length;o++)c[o]=k(c[o])}function Z(c,o){for(var a=0;a<o;a++)c[a]=Math.round((c[a-1]||0)+c[a]*6e4);c[o-1]=1/0}function v(c,o){var a=[],i;for(i=0;i<o.length;i++)a[i]=c[o[i]];return a}function U(c){var o=c.split("|"),a=o[2].split(" "),i=o[3].split(""),b=o[4].split(" ");return y(a),y(i),y(b),Z(b,i.length),{name:o[0],abbrs:v(o[1].split(" "),i),offsets:v(a,i),untils:b,population:o[5]|0}}function C(c){c&&this._set(U(c))}C.prototype={_set:function(c){this.name=c.name,this.abbrs=c.abbrs,this.untils=c.untils,this.offsets=c.offsets,this.population=c.population},_index:function(c){var o=+c,a=this.untils,i;for(i=0;i<a.length;i++)if(o<a[i])return i},countries:function(){var c=this.name;return Object.keys(u).filter(function(o){return u[o].zones.indexOf(c)!==-1})},parse:function(c){var o=+c,a=this.offsets,i=this.untils,b=i.length-1,d,B,m,L;for(L=0;L<b;L++)if(d=a[L],B=a[L+1],m=a[L&&L-1],d<B&&s.moveAmbiguousForward?d=B:d>m&&s.moveInvalidForward&&(d=m),o<i[L]-d*6e4)return a[L];return a[b]},abbr:function(c){return this.abbrs[this._index(c)]},offset:function(c){return D("zone.offset has been deprecated in favor of zone.utcOffset"),this.offsets[this._index(c)]},utcOffset:function(c){return this.offsets[this._index(c)]}};function Q(c,o){this.name=c,this.zones=o}function A(c){var o=c.toTimeString(),a=o.match(/\([a-z ]+\)/i);a&&a[0]?(a=a[0].match(/[A-Z]/g),a=a?a.join(""):void 0):(a=o.match(/[A-Z]{3,5}/g),a=a?a[0]:void 0),a==="GMT"&&(a=void 0),this.at=+c,this.abbr=a,this.offset=c.getTimezoneOffset()}function z(c){this.zone=c,this.offsetScore=0,this.abbrScore=0}z.prototype.scoreOffsetAt=function(c){this.offsetScore+=Math.abs(this.zone.utcOffset(c.at)-c.offset),this.zone.abbr(c.at).replace(/[^A-Z]/g,"")!==c.abbr&&this.abbrScore++};function r(c,o){for(var a,i;i=((o.at-c.at)/12e4|0)*6e4;)a=new A(new Date(c.at+i)),a.offset===c.offset?c=a:o=a;return c}function t(){var c=new Date().getFullYear()-2,o=new A(new Date(c,0,1)),a=[o],i,b,d;for(d=1;d<48;d++)b=new A(new Date(c,d,1)),b.offset!==o.offset&&(i=r(o,b),a.push(i),a.push(new A(new Date(i.at+6e4)))),o=b;for(d=0;d<4;d++)a.push(new A(new Date(c+d,0,1))),a.push(new A(new Date(c+d,6,1)));return a}function p(c,o){return c.offsetScore!==o.offsetScore?c.offsetScore-o.offsetScore:c.abbrScore!==o.abbrScore?c.abbrScore-o.abbrScore:c.zone.population!==o.zone.population?o.zone.population-c.zone.population:o.zone.name.localeCompare(c.zone.name)}function O(c,o){var a,i;for(y(o),a=0;a<o.length;a++)i=o[a],E[i]=E[i]||{},E[i][c]=!0}function f(c){var o=c.length,a={},i=[],b,d,B;for(b=0;b<o;b++){B=E[c[b].offset]||{};for(d in B)B.hasOwnProperty(d)&&(a[d]=!0)}for(b in a)a.hasOwnProperty(b)&&i.push(W[b]);return i}function N(){try{var c=Intl.DateTimeFormat().resolvedOptions().timeZone;if(c&&c.length>3){var o=W[h(c)];if(o)return o;D("Moment Timezone found "+c+" from the Intl api, but did not have that data loaded.")}}catch{}var a=t(),i=a.length,b=f(a),d=[],B,m,L;for(m=0;m<b.length;m++){for(B=new z(R(b[m]),i),L=0;L<i;L++)B.scoreOffsetAt(a[L]);d.push(B)}return d.sort(p),d.length>0?d[0].zone.name:void 0}function X(c){return(!I||c)&&(I=N()),I}function h(c){return(c||"").toLowerCase().replace(/\//g,"_")}function P(c){var o,a,i,b;for(typeof c=="string"&&(c=[c]),o=0;o<c.length;o++)i=c[o].split("|"),a=i[0],b=h(a),e[b]=c[o],W[b]=a,O(b,i[2].split(" "))}function R(c,o){c=h(c);var a=e[c],i;return a instanceof C?a:typeof a=="string"?(a=new C(a),e[c]=a,a):q[c]&&o!==R&&(i=R(q[c],R))?(a=e[c]=new C,a._set(i),a.name=W[c],a):null}function L0(){var c,o=[];for(c in W)W.hasOwnProperty(c)&&(e[c]||e[q[c]])&&W[c]&&o.push(W[c]);return o.sort()}function W0(){return Object.keys(u)}function A0(c){var o,a,i,b;for(typeof c=="string"&&(c=[c]),o=0;o<c.length;o++)a=c[o].split("|"),i=h(a[0]),b=h(a[1]),q[i]=b,W[i]=a[0],q[b]=i,W[b]=a[1]}function B0(c){var o,a,i,b;if(!(!c||!c.length))for(o=0;o<c.length;o++)b=c[o].split("|"),a=b[0].toUpperCase(),i=b[1].split(" "),u[a]=new Q(a,i)}function X0(c){return c=c.toUpperCase(),u[c]||null}function m0(c,o){if(c=X0(c),!c)return null;var a=c.zones.sort();return o?a.map(function(i){var b=R(i);return{name:i,offset:b.utcOffset(new Date)}}):a}function i0(c){P(c.zones),A0(c.links),B0(c.countries),s.dataVersion=c.version}function $(c){return $.didShowError||($.didShowError=!0,D("moment.tz.zoneExists('"+c+"') has been deprecated in favor of !moment.tz.zone('"+c+"')")),!!R(c)}function c0(c){var o=c._f==="X"||c._f==="x";return!!(c._a&&c._tzm===void 0&&!o)}function D(c){typeof console<"u"&&typeof console.error=="function"&&console.error(c)}function s(c){var o=Array.prototype.slice.call(arguments,0,-1),a=arguments[arguments.length-1],i=R(a),b=M.utc.apply(null,o);return i&&!M.isMoment(c)&&c0(b)&&b.add(i.parse(b),"minutes"),b.tz(a),b}s.version=n,s.dataVersion="",s._zones=e,s._links=q,s._names=W,s._countries=u,s.add=P,s.link=A0,s.load=i0,s.zone=R,s.zoneExists=$,s.guess=X,s.names=L0,s.Zone=C,s.unpack=U,s.unpackBase60=k,s.needsOffset=c0,s.moveInvalidForward=!0,s.moveAmbiguousForward=!1,s.countries=W0,s.zonesForCountry=m0;var T=M.fn;M.tz=s,M.defaultZone=null,M.updateOffset=function(c,o){var a=M.defaultZone,i;if(c._z===void 0&&(a&&c0(c)&&!c._isUTC&&(c._d=M.utc(c._a)._d,c.utc().add(a.parse(c),"minutes")),c._z=a),c._z)if(i=c._z.utcOffset(c),Math.abs(i)<16&&(i=i/60),c.utcOffset!==void 0){var b=c._z;c.utcOffset(-i,o),c._z=b}else c.zone(i,o)},T.tz=function(c,o){if(c){if(typeof c!="string")throw new Error("Time zone name must be a string, got "+c+" ["+typeof c+"]");return this._z=R(c),this._z?M.updateOffset(this,o):D("Moment Timezone has no data for "+c+". See http://momentjs.com/timezone/docs/#/data-loading/."),this}if(this._z)return this._z.name};function n0(c){return function(){return this._z?this._z.abbr(this):c.call(this)}}function e0(c){return function(){return this._z=null,c.apply(this,arguments)}}function T0(c){return function(){return arguments.length>0&&(this._z=null),c.apply(this,arguments)}}T.zoneName=n0(T.zoneName),T.zoneAbbr=n0(T.zoneAbbr),T.utc=e0(T.utc),T.local=e0(T.local),T.utcOffset=T0(T.utcOffset),M.tz.setDefault=function(c){return(_<2||_===2&&w<9)&&D("Moment Timezone setDefault() requires Moment.js >= 2.9.0. You are using Moment.js "+M.version+"."),M.defaultZone=c?R(c):null,M};var G=M.momentProperties;return Object.prototype.toString.call(G)==="[object Array]"?(G.push("_z"),G.push("_a")):G&&(G._z=null),i0({version:"2023c",zones:["Africa/Abidjan|GMT|0|0||48e5","Africa/Nairobi|EAT|-30|0||47e5","Africa/Algiers|WET WEST CET CEST|0 -10 -10 -20|01012320102|3bX0 11A0 dDd0 17b0 11B0 1cN0 2Dy0 1cN0 1fB0 1cL0|26e5","Africa/Lagos|WAT|-10|0||17e6","Africa/Bissau|-01 GMT|10 0|01|cap0|39e4","Africa/Maputo|CAT|-20|0||26e5","Africa/Cairo|EET EEST|-20 -30|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|LX0 11d0 1oL0 11d0 1pb0 11d0 1oL0 11d0 1oL0 11d0 1oL0 11d0 1pb0 11d0 1oL0 11d0 1oL0 11d0 1oL0 11d0 1pb0 11d0 1oL0 11d0 1WL0 rd0 1Rz0 wp0 1pb0 11d0 1oL0 11d0 1oL0 11d0 1oL0 11d0 1pb0 11d0 1qL0 Xd0 1oL0 11d0 1oL0 11d0 1pb0 11d0 1oL0 11d0 1oL0 11d0 1ny0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 11z0 1o10 11z0 1o10 WL0 1qN0 Rb0 1wp0 On0 1zd0 Lz0 1EN0 Fb0 c10 8n0 8Nd0 gL0 e10 mn0 kSp0 1cL0 1cN0 1fz0 1a10 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0|15e6","Africa/Casablanca|+00 +01|0 -10|01010101010101010101010101010101010101010101010101010101010101010101010|aS00 rz0 43d0 AL0 1Nd0 XX0 1Cp0 pz0 dEp0 4mn0 SyN0 AL0 1Nd0 wn0 1FB0 Db0 1zd0 Lz0 1Nf0 wM0 co0 go0 1o00 s00 dA0 vc0 11A0 A00 e00 y00 11A0 uM0 e00 Dc0 11A0 s00 e00 IM0 WM0 mo0 gM0 LA0 WM0 jA0 e00 28M0 e00 2600 gM0 2600 e00 2600 gM0 2600 e00 28M0 e00 2600 gM0 2600 e00 28M0 e00 2600 gM0 2600 e00 2600 gM0 2600|32e5","Africa/Ceuta|WET WEST CET CEST|0 -10 -10 -20|0101010102323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232|aS00 rz0 43d0 AL0 1Nd0 XX0 1Cp0 pz0 dEp0 4VB0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|85e3","Africa/El_Aaiun|-01 +00 +01|10 0 -10|01212121212121212121212121212121212121212121212121212121212121212121|fi10 6L0 AL0 1Nd0 XX0 1Cp0 pz0 1cBB0 AL0 1Nd0 wn0 1FB0 Db0 1zd0 Lz0 1Nf0 wM0 co0 go0 1o00 s00 dA0 vc0 11A0 A00 e00 y00 11A0 uM0 e00 Dc0 11A0 s00 e00 IM0 WM0 mo0 gM0 LA0 WM0 jA0 e00 28M0 e00 2600 gM0 2600 e00 2600 gM0 2600 e00 28M0 e00 2600 gM0 2600 e00 28M0 e00 2600 gM0 2600 e00 2600 gM0 2600|20e4","Africa/Johannesburg|SAST|-20|0||84e5","Africa/Juba|CAT CAST EAT|-20 -30 -30|01010101010101010101010101010101020|LW0 16L0 1iN0 17b0 1jd0 17b0 1ip0 17z0 1i10 17X0 1hB0 18n0 1hd0 19b0 1gp0 19z0 1iN0 17b0 1ip0 17z0 1i10 18n0 1hd0 18L0 1gN0 19b0 1gp0 19z0 1iN0 17z0 1i10 17X0 yGd0 PeX0|","Africa/Khartoum|CAT CAST EAT|-20 -30 -30|01010101010101010101010101010101020|LW0 16L0 1iN0 17b0 1jd0 17b0 1ip0 17z0 1i10 17X0 1hB0 18n0 1hd0 19b0 1gp0 19z0 1iN0 17b0 1ip0 17z0 1i10 18n0 1hd0 18L0 1gN0 19b0 1gp0 19z0 1iN0 17z0 1i10 17X0 yGd0 HjL0|51e5","Africa/Monrovia|MMT GMT|I.u 0|01|4SoI.u|11e5","Africa/Ndjamena|WAT WAST|-10 -20|010|nNb0 Wn0|13e5","Africa/Sao_Tome|GMT WAT|0 -10|010|1UQN0 2q00|","Africa/Tripoli|EET CET CEST|-20 -10 -20|0121212121212121210120120|tda0 A10 1db0 1cN0 1db0 1dd0 1db0 1eN0 1bb0 1e10 1cL0 1c10 1db0 1dd0 1db0 1cN0 1db0 1q10 fAn0 1ep0 1db0 AKq0 TA0 1o00|11e5","Africa/Tunis|CET CEST|-10 -20|0101010101010101010|hOn0 WM0 1rA0 11c0 nwo0 Ko0 1cM0 1cM0 1rA0 10M0 zuM0 10N0 1aN0 1qM0 WM0 1qM0 11A0 1o00|20e5","Africa/Windhoek|SAST CAT WAT|-20 -20 -10|01212121212121212121212121212121212121212121212121|Ndy0 9Io0 16P0 1nX0 11B0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0|32e4","America/Adak|BST BDT AHST HST HDT|b0 a0 a0 a0 90|0101010101010101010101010101234343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343|Kd0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 cm0 10q0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|326","America/Anchorage|AHST AHDT YST AKST AKDT|a0 90 90 90 80|0101010101010101010101010101234343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343|Kc0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 cm0 10q0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|30e4","America/Puerto_Rico|AST|40|0||24e5","America/Araguaina|-03 -02|30 20|01010101010101010101010101010|CxD0 Rb0 1tB0 IL0 1Fd0 FX0 1EN0 FX0 1HB0 Lz0 dMN0 Lz0 1zd0 Rb0 1wN0 Wn0 1tB0 Rb0 1tB0 WL0 1tB0 Rb0 1zd0 On0 1HB0 FX0 ny10 Lz0|14e4","America/Argentina/Buenos_Aires|-03 -02|30 20|01010101010101010|9Rf0 Db0 zvd0 Bz0 1tB0 TX0 1wp0 Rb0 1wp0 Rb0 1wp0 TX0 A4p0 uL0 1qN0 WL0|","America/Argentina/Catamarca|-03 -02 -04|30 20 40|01010101210102010|9Rf0 Db0 zvd0 Bz0 1tB0 TX0 1wp0 Rb0 1wq0 Ra0 1wp0 TX0 rlB0 7B0 8zb0 uL0|","America/Argentina/Cordoba|-03 -02 -04|30 20 40|01010101210101010|9Rf0 Db0 zvd0 Bz0 1tB0 TX0 1wp0 Rb0 1wq0 Ra0 1wp0 TX0 A4p0 uL0 1qN0 WL0|","America/Argentina/Jujuy|-03 -02 -04|30 20 40|010101202101010|9Rf0 Db0 zvd0 Bz0 1tB0 TX0 1ze0 TX0 1ld0 WK0 1wp0 TX0 A4p0 uL0|","America/Argentina/La_Rioja|-03 -02 -04|30 20 40|010101012010102010|9Rf0 Db0 zvd0 Bz0 1tB0 TX0 1wp0 Qn0 qO0 16n0 Rb0 1wp0 TX0 rlB0 7B0 8zb0 uL0|","America/Argentina/Mendoza|-03 -02 -04|30 20 40|01010120202102010|9Rf0 Db0 zvd0 Bz0 1tB0 TX0 1u20 SL0 1vd0 Tb0 1wp0 TW0 ri10 Op0 7TX0 uL0|","America/Argentina/Rio_Gallegos|-03 -02 -04|30 20 40|01010101010102010|9Rf0 Db0 zvd0 Bz0 1tB0 TX0 1wp0 Rb0 1wp0 Rb0 1wp0 TX0 rlB0 7B0 8zb0 uL0|","America/Argentina/Salta|-03 -02 -04|30 20 40|010101012101010|9Rf0 Db0 zvd0 Bz0 1tB0 TX0 1wp0 Rb0 1wq0 Ra0 1wp0 TX0 A4p0 uL0|","America/Argentina/San_Juan|-03 -02 -04|30 20 40|010101012010102010|9Rf0 Db0 zvd0 Bz0 1tB0 TX0 1wp0 Qn0 qO0 16n0 Rb0 1wp0 TX0 rld0 m10 8lb0 uL0|","America/Argentina/San_Luis|-03 -02 -04|30 20 40|010101202020102020|9Rf0 Db0 zvd0 Bz0 1tB0 XX0 1q20 SL0 AN0 vDb0 m10 8lb0 8L0 jd0 1qN0 WL0 1qN0|","America/Argentina/Tucuman|-03 -02 -04|30 20 40|0101010121010201010|9Rf0 Db0 zvd0 Bz0 1tB0 TX0 1wp0 Rb0 1wq0 Ra0 1wp0 TX0 rlB0 4N0 8BX0 uL0 1qN0 WL0|","America/Argentina/Ushuaia|-03 -02 -04|30 20 40|01010101010102010|9Rf0 Db0 zvd0 Bz0 1tB0 TX0 1wp0 Rb0 1wp0 Rb0 1wp0 TX0 rkN0 8p0 8zb0 uL0|","America/Asuncion|-04 -03|40 30|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101|6FE0 3CL0 3Dd0 10L0 1pB0 10n0 1pB0 10n0 1pB0 1cL0 1dd0 1db0 1dd0 1cL0 1dd0 1cL0 1dd0 1cL0 1dd0 1db0 1dd0 1cL0 1dd0 1cL0 1dd0 1cL0 1dd0 1db0 1dd0 1cL0 1lB0 14n0 1dd0 1cL0 1fd0 WL0 1rd0 1aL0 1dB0 Xz0 1qp0 Xb0 1qN0 10L0 1rB0 TX0 1tB0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1qN0 1cL0 WN0 1qL0 11B0 1nX0 1ip0 WL0 1qN0 WL0 1qN0 WL0 1tB0 TX0 1tB0 TX0 1tB0 19X0 1a10 1fz0 1a10 1fz0 1cN0 17b0 1ip0 17b0 1ip0 17b0 1ip0 19X0 1fB0 19X0 1fB0 19X0 1ip0 17b0 1ip0 17b0 1ip0 19X0 1fB0 19X0 1fB0 19X0 1fB0 19X0 1ip0 17b0 1ip0 17b0 1ip0 19X0 1fB0 19X0 1fB0 19X0 1ip0 17b0 1ip0|28e5","America/Panama|EST|50|0||15e5","America/Bahia_Banderas|PST MST MDT CDT CST|80 70 60 50 60|01212121212121212121212121212134343434343434343434343434|80 13Vd0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 1fB0 WL0 1fB0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nW0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0|84e3","America/Bahia|-03 -02|30 20|010101010101010101010101010101010101010|CxD0 Rb0 1tB0 IL0 1Fd0 FX0 1EN0 FX0 1HB0 Lz0 1EN0 Lz0 1C10 IL0 1HB0 Db0 1HB0 On0 1zd0 On0 1zd0 Lz0 1zd0 Rb0 1wN0 Wn0 1tB0 Rb0 1tB0 WL0 1tB0 Rb0 1zd0 On0 1HB0 FX0 l5B0 Rb0|27e5","America/Barbados|AST ADT|40 30|010101010|i7G0 IL0 1ip0 17b0 1ip0 17b0 1ld0 13b0|28e4","America/Belem|-03 -02|30 20|0101010|CxD0 Rb0 1tB0 IL0 1Fd0 FX0|20e5","America/Belize|CST CDT|60 50|01010|9xG0 qn0 lxB0 mn0|57e3","America/Boa_Vista|-04 -03|40 30|01010101010|CxE0 Rb0 1tB0 IL0 1Fd0 FX0 smp0 WL0 1tB0 2L0|62e2","America/Bogota|-05 -04|50 40|010|Snh0 1PX0|90e5","America/Boise|MST MDT|70 60|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|K90 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 Dd0 1Kn0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|21e4","America/Cambridge_Bay|MST MDT CST CDT EST|70 60 60 50 50|010101010101010101010101010101010101010101010101010101012342101010101010101010101010101010101010101010101010101010101010|5E90 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11A0 1nX0 2K0 WQ0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|15e2","America/Campo_Grande|-04 -03|40 30|010101010101010101010101010101010101010101010101010101010101010101010|CxE0 Rb0 1tB0 IL0 1Fd0 FX0 1EN0 FX0 1HB0 Lz0 1EN0 Lz0 1C10 IL0 1HB0 Db0 1HB0 On0 1zd0 On0 1zd0 Lz0 1zd0 Rb0 1wN0 Wn0 1tB0 Rb0 1tB0 WL0 1tB0 Rb0 1zd0 On0 1HB0 FX0 1C10 Lz0 1Ip0 HX0 1zd0 On0 1HB0 IL0 1wp0 On0 1C10 Lz0 1C10 On0 1zd0 On0 1zd0 Rb0 1zd0 Lz0 1C10 Lz0 1C10 On0 1zd0 On0 1zd0 On0 1zd0 On0 1HB0 FX0|77e4","America/Cancun|CST EST EDT CDT|60 50 40 50|012121230303030303030303030303030303030301|t9G0 yLB0 1lb0 14p0 1lb0 14p0 Lz0 xB0 14p0 1nX0 11B0 1nX0 1fB0 WL0 1fB0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 Dd0|63e4","America/Caracas|-04 -0430|40 4u|010|1wmv0 kqo0|29e5","America/Cayenne|-03|30|0||58e3","America/Chicago|CST CDT|60 50|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|K80 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|92e5","America/Chihuahua|CST CDT MDT MST|60 50 60 70|0101023232323232323232323232323232323232323232323232320|13Vk0 1lb0 14p0 1lb0 14q0 1lb0 14p0 1nX0 11B0 1nX0 1fB0 WL0 1fB0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0|81e4","America/Ciudad_Juarez|CST CDT MDT MST|60 50 60 70|010102323232323232323232323232323232323232323232323232032323232323232323|13Vk0 1lb0 14p0 1lb0 14q0 1lb0 14p0 1nX0 11B0 1nX0 1fB0 WL0 1fB0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 U10 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1wn0 cm0 EP0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|","America/Costa_Rica|CST CDT|60 50|010101010|mgS0 Db0 1Kp0 Db0 pRB0 15b0 1kp0 mL0|12e5","America/Phoenix|MST|70|0||42e5","America/Cuiaba|-04 -03|40 30|0101010101010101010101010101010101010101010101010101010101010101010|CxE0 Rb0 1tB0 IL0 1Fd0 FX0 1EN0 FX0 1HB0 Lz0 1EN0 Lz0 1C10 IL0 1HB0 Db0 1HB0 On0 1zd0 On0 1zd0 Lz0 1zd0 Rb0 1wN0 Wn0 1tB0 Rb0 1tB0 WL0 1tB0 Rb0 1zd0 On0 1HB0 FX0 4a10 HX0 1zd0 On0 1HB0 IL0 1wp0 On0 1C10 Lz0 1C10 On0 1zd0 On0 1zd0 Rb0 1zd0 Lz0 1C10 Lz0 1C10 On0 1zd0 On0 1zd0 On0 1zd0 On0 1HB0 FX0|54e4","America/Danmarkshavn|-03 -02 GMT|30 20 0|0101010101010101010101010101010102|oXh0 19U0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 DC0|8","America/Dawson_Creek|PST PDT MST|80 70 70|0101012|Ka0 1cL0 1cN0 1fz0 1cN0 ML0|12e3","America/Dawson|YST PST PDT MST|90 80 70 70|012121212121212121212121212121212121212121212121212121212121212121212121212121212123|9ix0 fNd0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1z90|13e2","America/Denver|MST MDT|70 60|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|K90 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|26e5","America/Detroit|EST EDT|50 40|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|85H0 1cL0 s10 1Vz0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|37e5","America/Edmonton|MST MDT|70 60|01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|5E90 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|10e5","America/Eirunepe|-05 -04|50 40|01010101010|CxF0 Rb0 1tB0 IL0 1Fd0 FX0 dPB0 On0 yTd0 d5X0|31e3","America/El_Salvador|CST CDT|60 50|01010|Gcu0 WL0 1qN0 WL0|11e5","America/Tijuana|PST PDT|80 70|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|fmy0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 U10 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|20e5","America/Fort_Nelson|PST PDT MST|80 70 70|01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010102|Ka0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0|39e2","America/Fort_Wayne|EST EDT|50 40|01010101010101010101010101010101010101010101010101010|K70 1cL0 1qhd0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|","America/Fortaleza|-03 -02|30 20|01010101010101010|CxD0 Rb0 1tB0 IL0 1Fd0 FX0 1EN0 FX0 1HB0 Lz0 nsp0 WL0 1tB0 5z0 2mN0 On0|34e5","America/Glace_Bay|AST ADT|40 30|01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|5E60 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|19e3","America/Godthab|-03 -02 -01|30 20 10|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010121212121212121|oXh0 19U0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 2so0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|17e3","America/Goose_Bay|AST ADT ADDT|40 30 20|010101010101010101010101010101010101020101010101010101010101010101010101010101010101010101010101010101010101010101010101010|K60 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14n1 1lb0 14p0 1nW0 11C0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zcX Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|76e2","America/Grand_Turk|EST EDT AST|50 40 40|0101010101010101010101010101010101010101010101010101010101010101010101010210101010101010101010101010|mG70 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 7jA0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|37e2","America/Guatemala|CST CDT|60 50|010101010|9tG0 An0 mtd0 Nz0 ifB0 17b0 zDB0 11z0|13e5","America/Guayaquil|-05 -04|50 40|010|TKR0 rz0|27e5","America/Guyana|-0345 -03 -04|3J 30 40|012|dzfJ Ey0f|80e4","America/Halifax|AST ADT|40 30|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|K60 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|39e4","America/Havana|CST CDT|50 40|01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|K50 1cL0 1cN0 1fz0 1cN0 14n0 1ld0 14L0 1kN0 15b0 1kp0 1cL0 1cN0 1fz0 1a10 1fz0 1fB0 11z0 14p0 1nX0 11B0 1nX0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 14n0 1ld0 14n0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 1a10 1in0 1a10 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1cM0 1cM0 1fA0 17c0 1o00 11A0 1qM0 11A0 1o00 11A0 1o00 14o0 1lc0 14o0 1lc0 11A0 6i00 Rc0 1wo0 U00 1tA0 Rc0 1wo0 U00 1wo0 U00 1zc0 U00 1qM0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0|21e5","America/Hermosillo|PST MST MDT|80 70 60|01212121|80 13Vd0 1lb0 14p0 1lb0 14p0 1lb0|64e4","America/Indiana/Knox|CST CDT EST|60 50 50|01010101010101010101010101010101010101010101210101010101010101010101010101010101010101010101010|K80 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 z8o0 1o00 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|","America/Indiana/Marengo|EST EDT CDT|50 40 50|010101010201010101010101010101010101010101010101010101010101010|K70 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1VA0 LA0 1BX0 1e6p0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|","America/Indiana/Petersburg|CST CDT EST EDT|60 50 50 40|0101010101010101210123232323232323232323232323232323232323232323232|K80 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 19co0 1o00 Rd0 1zb0 Oo0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|","America/Indiana/Tell_City|EST EDT CDT CST|50 40 50 60|01023232323232323232323232323232323232323232323232323|K70 1cL0 1qhd0 1o00 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|","America/Indiana/Vevay|EST EDT|50 40|010101010101010101010101010101010101010101010101010101010|K70 1cL0 1cN0 1fz0 1cN0 1cL0 1lnd0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|","America/Indiana/Vincennes|EST EDT CDT CST|50 40 50 60|01023201010101010101010101010101010101010101010101010|K70 1cL0 1qhd0 1o00 Rd0 1zb0 Oo0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|","America/Indiana/Winamac|EST EDT CDT CST|50 40 50 60|01023101010101010101010101010101010101010101010101010|K70 1cL0 1qhd0 1o00 Rd0 1za0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|","America/Inuvik|PST PDT MDT MST|80 70 60 70|01010101010101023232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323|5Ea0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cK0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|35e2","America/Iqaluit|EST EDT CST CDT|50 40 60 50|01010101010101010101010101010101010101010101010101010101230101010101010101010101010101010101010101010101010101010101010|5E70 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11C0 1nX0 11A0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|67e2","America/Jamaica|EST EDT|50 40|010101010101010101010|9Kv0 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0|94e4","America/Juneau|PST PDT YDT YST AKST AKDT|80 70 80 90 90 80|0101010101010101010102010101345454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454|Ka0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cM0 1cM0 1cL0 1cN0 1fz0 1a10 1fz0 co0 10q0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|33e3","America/Kentucky/Louisville|EST EDT CDT|50 40 50|010101010201010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|K70 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1VA0 LA0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|","America/Kentucky/Monticello|CST CDT EST EDT|60 50 50 40|010101010101010101010101010101010101010101010101010101010101012323232323232323232323232323232323232323232323232323232323232|K80 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11A0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|","America/La_Paz|-04|40|0||19e5","America/Lima|-05 -04|50 40|010101010|CVF0 zX0 1O10 zX0 6Gp0 zX0 98p0 zX0|11e6","America/Los_Angeles|PST PDT|80 70|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|Ka0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|15e6","America/Maceio|-03 -02|30 20|0101010101010101010|CxD0 Rb0 1tB0 IL0 1Fd0 FX0 1EN0 FX0 1HB0 Lz0 dMN0 Lz0 8Q10 WL0 1tB0 5z0 2mN0 On0|93e4","America/Managua|CST EST CDT|60 50 50|010202010102020|86u0 4mn0 9Up0 Dz0 1K10 Dz0 s3F0 1KH0 DB0 9In0 k8p0 19X0 1o30 11y0|22e5","America/Manaus|-04 -03|40 30|010101010|CxE0 Rb0 1tB0 IL0 1Fd0 FX0 dPB0 On0|19e5","America/Martinique|AST ADT|40 30|010|oXg0 19X0|39e4","America/Matamoros|CST CDT|60 50|0101010101010101010101010101010101010101010101010101010101010101010101010|IqU0 1nX0 i6p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 1fB0 WL0 1fB0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 U10 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|45e4","America/Mazatlan|PST MST MDT|80 70 60|01212121212121212121212121212121212121212121212121212121|80 13Vd0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 1fB0 WL0 1fB0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0|44e4","America/Menominee|EST CDT CST|50 50 60|012121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212|85H0 1cM0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|85e2","America/Merida|CST EST CDT|60 50 50|010202020202020202020202020202020202020202020202020202020|t9G0 2hz0 wu30 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 1fB0 WL0 1fB0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0|11e5","America/Metlakatla|PST PDT AKST AKDT|80 70 90 80|0101010101010101010101010101023232302323232323232323232323232|Ka0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1hU10 Rd0 1zb0 Op0 1zb0 Op0 1zb0 uM0 jB0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|14e2","America/Mexico_City|CST CDT|60 50|0101010101010101010101010101010101010101010101010101010|13Vk0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 1fB0 WL0 1fB0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0|20e6","America/Miquelon|AST -03 -02|40 30 20|012121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|p9g0 gQ10 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|61e2","America/Moncton|AST ADT|40 30|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|K60 1cL0 1cN0 1fz0 1cN0 1cL0 3Cp0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14n1 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 ReX 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|64e3","America/Monterrey|CST CDT|60 50|010101010101010101010101010101010101010101010101010101010|IqU0 1nX0 i6p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 1fB0 WL0 1fB0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0|41e5","America/Montevideo|-03 -02 -0130 -0230|30 20 1u 2u|0101023010101010101010101010101010101010101010101010|JD0 jX0 4vB0 xz0 3Cp0 mmu 1a10 IMu Db0 4c10 uL0 1Nd0 An0 1SN0 uL0 mp0 28L0 iPB0 un0 1SN0 xz0 1zd0 Lz0 1zd0 Rb0 1zd0 On0 1wp0 Rb0 s8p0 1fB0 1ip0 11z0 1ld0 14n0 1o10 11z0 1o10 11z0 1o10 14n0 1ld0 14n0 1ld0 14n0 1o10 11z0 1o10 11z0 1o10 11z0|17e5","America/Toronto|EST EDT|50 40|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|K70 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|65e5","America/New_York|EST EDT|50 40|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|K70 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|21e6","America/Nome|BST BDT YST AKST AKDT|b0 a0 90 90 80|0101010101010101010101010101234343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343|Kd0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 cl0 10q0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|38e2","America/Noronha|-02 -01|20 10|01010101010101010|CxC0 Rb0 1tB0 IL0 1Fd0 FX0 1EN0 FX0 1HB0 Lz0 nsp0 WL0 1tB0 2L0 2pB0 On0|30e2","America/North_Dakota/Beulah|MST MDT CST CDT|70 60 60 50|010101010101010101010101010101010101010101010101010101010101010101010101010101010123232323232323232323232323232323232323232|K90 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Oo0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|","America/North_Dakota/Center|MST MDT CST CDT|70 60 60 50|010101010101010101010101010101010101010101010123232323232323232323232323232323232323232323232323232323232323232323232323232|K90 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14o0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|","America/North_Dakota/New_Salem|MST MDT CST CDT|70 60 60 50|010101010101010101010101010101010101010101010101010101010101010101012323232323232323232323232323232323232323232323232323232|K90 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14o0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|","America/Ojinaga|CST CDT MDT MST|60 50 60 70|01010232323232323232323232323232323232323232323232323201010101010101010|13Vk0 1lb0 14p0 1lb0 14q0 1lb0 14p0 1nX0 11B0 1nX0 1fB0 WL0 1fB0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 U10 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1wn0 Rc0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|23e3","America/Paramaribo|-0330 -03|3u 30|01|zSPu|24e4","America/Port-au-Prince|EST EDT|50 40|01010101010101010101010101010101010101010101010101010101010101010101010|wu50 19X0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14q0 1o00 11A0 1o00 11A0 1o00 14o0 1lc0 14o0 1lc0 14o0 1o00 11A0 1o00 11A0 1o00 14o0 1lc0 14o0 1lc0 i6n0 1nX0 11B0 1nX0 d430 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 3iN0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|23e5","America/Rio_Branco|-05 -04|50 40|010101010|CxF0 Rb0 1tB0 IL0 1Fd0 FX0 NBd0 d5X0|31e4","America/Porto_Velho|-04 -03|40 30|0101010|CxE0 Rb0 1tB0 IL0 1Fd0 FX0|37e4","America/Punta_Arenas|-03 -04|30 40|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|yP0 1ip0 11z0 1o10 11z0 1qN0 WL0 1ld0 14n0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 WL0 1qN0 1cL0 1cN0 11z0 1o10 11z0 1qN0 WL0 1fB0 19X0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 17b0 1ip0 11z0 1ip0 1fz0 1fB0 11z0 1qN0 WL0 1qN0 WL0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 17b0 1ip0 11z0 1o10 19X0 1fB0 1nX0 G10 1EL0 Op0 1zb0 Rd0 1wn0 Rd0 46n0 Ap0|","America/Winnipeg|CST CDT|60 50|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|K80 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1a00 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1a00 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 14o0 1lc0 14o0 1o00 11A0 1o00 11A0 1o00 14o0 1lc0 14o0 1lc0 14o0 1o00 11A0 1o00 11A0 1o00 14o0 1lc0 14o0 1lc0 14o0 1lc0 14o0 1o00 11A0 1o00 11A0 1o00 14o0 1lc0 14o0 1lc0 14o0 1o00 11A0 1o00 11A0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|66e4","America/Rankin_Inlet|CST CDT EST|60 50 50|01010101010101010101010101010101010101010101010101010101012101010101010101010101010101010101010101010101010101010101010|5E80 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|26e2","America/Recife|-03 -02|30 20|01010101010101010|CxD0 Rb0 1tB0 IL0 1Fd0 FX0 1EN0 FX0 1HB0 Lz0 nsp0 WL0 1tB0 2L0 2pB0 On0|33e5","America/Regina|CST|60|0||19e4","America/Resolute|CST CDT EST|60 50 50|01010101010101010101010101010101010101010101010101010101012101010101012101010101010101010101010101010101010101010101010|5E80 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|229","America/Santarem|-04 -03|40 30|01010101|CxE0 Rb0 1tB0 IL0 1Fd0 FX0 NBd0|21e4","America/Santiago|-03 -04|30 40|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|yP0 1ip0 11z0 1o10 11z0 1qN0 WL0 1ld0 14n0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 WL0 1qN0 1cL0 1cN0 11z0 1o10 11z0 1qN0 WL0 1fB0 19X0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 17b0 1ip0 11z0 1ip0 1fz0 1fB0 11z0 1qN0 WL0 1qN0 WL0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 17b0 1ip0 11z0 1o10 19X0 1fB0 1nX0 G10 1EL0 Op0 1zb0 Rd0 1wn0 Rd0 46n0 Ap0 1Nb0 Ap0 1Nb0 Ap0 1zb0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 11B0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 11B0|62e5","America/Santo_Domingo|-0430 EST AST|4u 50 40|0101010101212|ksu 1Cou yLu 1RAu wLu 1QMu xzu 1Q0u xXu 1PAu 13jB0 e00|29e5","America/Sao_Paulo|-03 -02|30 20|010101010101010101010101010101010101010101010101010101010101010101010|CxD0 Rb0 1tB0 IL0 1Fd0 FX0 1EN0 FX0 1HB0 Lz0 1EN0 Lz0 1C10 IL0 1HB0 Db0 1HB0 On0 1zd0 On0 1zd0 Lz0 1zd0 Rb0 1wN0 Wn0 1tB0 Rb0 1tB0 WL0 1tB0 Rb0 1zd0 On0 1HB0 FX0 1C10 Lz0 1Ip0 HX0 1zd0 On0 1HB0 IL0 1wp0 On0 1C10 Lz0 1C10 On0 1zd0 On0 1zd0 Rb0 1zd0 Lz0 1C10 Lz0 1C10 On0 1zd0 On0 1zd0 On0 1zd0 On0 1HB0 FX0|20e6","America/Scoresbysund|-02 -01 +00|20 10 0|0102121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|oXg0 1a00 1cK0 1cL0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|452","America/Sitka|PST PDT YST AKST AKDT|80 70 90 90 80|0101010101010101010101010101234343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343|Ka0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 co0 10q0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|90e2","America/St_Johns|NST NDT NDDT|3u 2u 1u|010101010101010101010101010101010101020101010101010101010101010101010101010101010101010101010101010101010101010101010101010|K5u 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14n1 1lb0 14p0 1nW0 11C0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zcX Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|11e4","America/Swift_Current|MST CST|70 60|01|5E90|16e3","America/Tegucigalpa|CST CDT|60 50|0101010|Gcu0 WL0 1qN0 WL0 GRd0 AL0|11e5","America/Thule|AST ADT|40 30|010101010101010101010101010101010101010101010101010101010101010101010101010101010|PHG0 1cL0 1cN0 1cL0 1fB0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|656","America/Vancouver|PST PDT|80 70|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|Ka0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|23e5","America/Whitehorse|PST PDT MST|80 70 70|01010101010101010101010101010101010101010101010101010101010101010101010101010101012|p7K0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1z90|23e3","America/Yakutat|YST YDT AKST AKDT|90 80 90 80|0101010101010101010101010101023232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232|Kb0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 cn0 10q0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|642","Antarctica/Casey|+08 +11|-80 -b0|010101010101|1ARS0 T90 40P0 KL0 blz0 3m10 1o30 14k0 1kr0 12l0 1o01|10","Antarctica/Davis|+07 +05|-70 -50|01010|1ART0 VB0 3Wn0 KN0|70","Pacific/Port_Moresby|+10|-a0|0||25e4","Antarctica/Macquarie|AEDT AEST|-b0 -a0|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|qg0 1wo0 U00 1wo0 LA0 1C00 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 11A0 1qM0 WM0 1qM0 Oo0 1zc0 Oo0 1zc0 Oo0 1wo0 WM0 1tA0 WM0 1tA0 U00 1tA0 U00 1tA0 11A0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 11A0 1o00 1io0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1cM0 1a00 1io0 1cM0 1cM0 1cM0 1cM0 3Co0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0|1","Antarctica/Mawson|+06 +05|-60 -50|01|1ARU0|60","Pacific/Auckland|NZST NZDT|-c0 -d0|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101|bKC0 IM0 1C00 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1qM0 14o0 1lc0 14o0 1lc0 14o0 1lc0 17c0 1io0 17c0 1io0 17c0 1io0 17c0 1lc0 14o0 1lc0 14o0 1lc0 17c0 1io0 17c0 1io0 17c0 1lc0 14o0 1lc0 14o0 1lc0 17c0 1io0 17c0 1io0 17c0 1io0 17c0 1io0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1io0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00|14e5","Antarctica/Palmer|-03 -02 -04|30 20 40|01020202020202020202020202020202020202020202020202020202020202020202020|9Rf0 Db0 jsN0 14N0 11z0 1o10 11z0 1qN0 WL0 1qN0 WL0 1qN0 1cL0 1cN0 11z0 1o10 11z0 1qN0 WL0 1fB0 19X0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 17b0 1ip0 11z0 1ip0 1fz0 1fB0 11z0 1qN0 WL0 1qN0 WL0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 17b0 1ip0 11z0 1o10 19X0 1fB0 1nX0 G10 1EL0 Op0 1zb0 Rd0 1wn0 Rd0 46n0 Ap0|40","Antarctica/Rothera|-00 -03|0 30|01|gOo0|130","Asia/Riyadh|+03|-30|0||57e5","Antarctica/Troll|-00 +00 +02|0 0 -20|012121212121212121212121212121212121212121212121212121|1puo0 hd0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|40","Asia/Urumqi|+06|-60|0||32e5","Europe/Berlin|CET CEST|-10 -20|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|oXd0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|41e5","Asia/Almaty|+06 +07 +05|-60 -70 -50|0101010101010101010102010101010101010101010101010|rn60 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0|15e5","Asia/Amman|EET EEST +03|-20 -30 -30|010101010101010101010101010101010101010101010101010101010101010101010101010101010101012|8kK0 KL0 1oN0 11b0 1oN0 11b0 1pd0 1dz0 1cp0 11b0 1op0 11b0 fO10 1db0 1e10 1cL0 1cN0 1cL0 1cN0 1fz0 1pd0 10n0 1ld0 14n0 1hB0 15b0 1ip0 19X0 1cN0 1cL0 1cN0 17b0 1ld0 14o0 1lc0 17c0 1io0 17c0 1io0 17c0 1So0 y00 1fc0 1dc0 1co0 1dc0 1cM0 1cM0 1cM0 1o00 11A0 1lc0 17c0 1cM0 1cM0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 4bX0 Dd0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 LA0 1C00|25e5","Asia/Anadyr|+13 +14 +12 +11|-d0 -e0 -c0 -b0|010202020202020202023202020202020202020202020202020202020232|rmX0 1db0 2q10 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 2sp0 WM0|13e3","Asia/Aqtau|+05 +06 +04|-50 -60 -40|0101010101010101010201010120202020202020202020|sAj0 2pX0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cN0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0|15e4","Asia/Aqtobe|+05 +06 +04|-50 -60 -40|01010101010101010102010101010101010101010101010|rn70 3Db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0|27e4","Asia/Ashgabat|+05 +06 +04|-50 -60 -40|01010101010101010101020|rn70 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0|41e4","Asia/Atyrau|+05 +06 +04|-50 -60 -40|010101010101010101020101010101010102020202020|sAj0 2pX0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 2sp0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0|","Asia/Baghdad|+03 +04|-30 -40|01010101010101010101010101010101010101010101010101010|u190 11b0 1cp0 1dz0 1dd0 1db0 1cN0 1cp0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1de0 1dc0 1dc0 1dc0 1cM0 1dc0 1cM0 1dc0 1cM0 1dc0 1dc0 1dc0 1cM0 1dc0 1cM0 1dc0 1cM0 1dc0 1dc0 1dc0 1cM0 1dc0 1cM0 1dc0 1cM0 1dc0 1dc0 1dc0 1cM0 1dc0 1cM0 1dc0 1cM0 1dc0|66e5","Asia/Qatar|+04 +03|-40 -30|01|5QI0|96e4","Asia/Baku|+04 +05 +03|-40 -50 -30|010101010101010101010201010101010101010101010101010101010101010|rn80 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 1cM0 9Je0 1o00 11z0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00|27e5","Asia/Bangkok|+07|-70|0||15e6","Asia/Barnaul|+07 +08 +06|-70 -80 -60|01010101010101010101020101010102020202020202020202020202020202020|rn50 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 p90 LE0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0 3rd0|","Asia/Beirut|EET EEST|-20 -30|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|61a0 En0 1oN0 11b0 1oN0 11b0 1oN0 11b0 1pd0 11b0 1oN0 11b0 1op0 11b0 dA10 17b0 1iN0 17b0 1iN0 17b0 1iN0 17b0 1vB0 SL0 1mp0 13z0 1iN0 17b0 1iN0 17b0 1jd0 12n0 1a10 1cL0 1cN0 1cL0 1cN0 1cL0 1fB0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0|22e5","Asia/Bishkek|+06 +07 +05|-60 -70 -50|0101010101010101010102020202020202020202020202020|rn60 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2e00 1tX0 17b0 1ip0 17b0 1ip0 17b0 1ip0 17b0 1ip0 19X0 1cPu 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0|87e4","Asia/Brunei|+08|-80|0||42e4","Asia/Kolkata|IST|-5u|0||15e6","Asia/Chita|+09 +10 +08|-90 -a0 -80|0101010101010101010102010101010101010101010101010101010101010120|rn30 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0 3re0|33e4","Asia/Choibalsan|+07 +08 +10 +09|-70 -80 -a0 -90|012323232323232323232323232323232323232323232313131|jsF0 cKn0 1da0 1dd0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1fB0 1cL0 1cN0 1cL0 1cN0 1cL0 6hD0 11z0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 3Db0 h1f0 1cJ0 1cP0 1cJ0|38e3","Asia/Shanghai|CST CDT|-80 -90|0101010101010|DKG0 Rb0 1o10 11z0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0|23e6","Asia/Colombo|+0530 +0630 +06|-5u -6u -60|0120|14giu 11zu n3cu|22e5","Asia/Dhaka|+06 +07|-60 -70|010|1A5R0 1i00|16e6","Asia/Damascus|EET EEST +03|-20 -30 -30|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101012|M00 11b0 1oN0 11b0 1pd0 11b0 1oN0 11b0 1oN0 11b0 1oN0 11b0 1pd0 11b0 1oN0 Nb0 1AN0 Nb0 bcp0 19X0 1gp0 19X0 3ld0 1xX0 Vd0 1Bz0 Sp0 1vX0 10p0 1dz0 1cN0 1cL0 1db0 1db0 1g10 1an0 1ap0 1db0 1fd0 1db0 1cN0 1db0 1dd0 1db0 1cp0 1dz0 1c10 1dX0 1cN0 1db0 1dd0 1db0 1cN0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1db0 1cN0 1db0 1cN0 19z0 1fB0 1qL0 11B0 1on0 Wp0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0|26e5","Asia/Dili|+09 +08|-90 -80|010|fpr0 Xld0|19e4","Asia/Dubai|+04|-40|0||39e5","Asia/Dushanbe|+06 +07 +05|-60 -70 -50|0101010101010101010102|rn60 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2hB0|76e4","Asia/Famagusta|EET EEST +03|-20 -30 -30|0101010101010101010101010101010101010101010101010101010101010101010101010101010101012010101010101010101010101010|cPa0 1cL0 1qp0 Xz0 19B0 19X0 1fB0 1db0 1cp0 1cL0 1fB0 19X0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1fB0 1cL0 1cN0 1cL0 1cN0 1o30 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 15U0 2Ks0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|","Asia/Gaza|IST IDT EET EEST|-20 -30 -20 -30|010101010101010101010101010101023232323232323232323232323232323232323232323232323232323232323232323232|aXa0 Db0 1fB0 Rb0 bXB0 gM0 8Q00 IM0 1wo0 TX0 1HB0 IL0 1s10 10n0 1o10 WL0 1zd0 On0 1ld0 11z0 1o10 14n0 1o10 14n0 1nd0 12n0 1nd0 Xz0 1q10 12n0 M10 C00 17c0 1io0 17c0 1io0 17c0 1o00 1cL0 1fB0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 17c0 1io0 18N0 1bz0 19z0 1gp0 1610 1iL0 11z0 1o10 14o0 1lA1 SKX 1xd1 MKX 1AN0 1a00 1fA0 1cL0 1cN0 1nX0 1210 1nA0 1210 1qL0 WN0 1qL0 WN0 1qL0 11c0 1on0 11B0 1o00 11A0 1qo0 XA0 1qp0 1cN0 1cL0 17d0 1in0 14p0 1lb0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0|18e5","Asia/Hebron|IST IDT EET EEST|-20 -30 -20 -30|01010101010101010101010101010102323232323232323232323232323232323232323232323232323232323232323232323232|aXa0 Db0 1fB0 Rb0 bXB0 gM0 8Q00 IM0 1wo0 TX0 1HB0 IL0 1s10 10n0 1o10 WL0 1zd0 On0 1ld0 11z0 1o10 14n0 1o10 14n0 1nd0 12n0 1nd0 Xz0 1q10 12n0 M10 C00 17c0 1io0 17c0 1io0 17c0 1o00 1cL0 1fB0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 17c0 1io0 18N0 1bz0 19z0 1gp0 1610 1iL0 12L0 1mN0 14o0 1lc0 Tb0 1xd1 MKX bB0 cn0 1cN0 1a00 1fA0 1cL0 1cN0 1nX0 1210 1nA0 1210 1qL0 WN0 1qL0 WN0 1qL0 11c0 1on0 11B0 1o00 11A0 1qo0 XA0 1qp0 1cN0 1cL0 17d0 1in0 14p0 1lb0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0|25e4","Asia/Ho_Chi_Minh|+08 +07|-80 -70|01|dfs0|90e5","Asia/Hong_Kong|HKT HKST|-80 -90|01010101010101010|H7u 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 s10 1Vz0 1cN0 1cL0 1cN0 1cL0 6fd0 14n0|73e5","Asia/Hovd|+06 +07 +08|-60 -70 -80|01212121212121212121212121212121212121212121212121|jsG0 cKn0 1db0 1dd0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1fB0 1cL0 1cN0 1cL0 1cN0 1cL0 6hD0 11z0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 kEp0 1cJ0 1cP0 1cJ0|81e3","Asia/Irkutsk|+08 +09 +07|-80 -90 -70|010101010101010101010201010101010101010101010101010101010101010|rn40 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0|60e4","Europe/Istanbul|EET EEST +03 +04|-20 -30 -30 -40|01010101010123201010101010101010101010101010101010101010101010101010101010101012|8jz0 11A0 WN0 1qL0 TB0 1tX0 U10 1tz0 11B0 1in0 17d0 z90 cne0 pb0 2Cp0 1800 14o0 1dc0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1a00 1fA0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WO0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 Xc0 1qo0 WM0 1qM0 11A0 1o00 1200 1nA0 11A0 1tA0 U00 15w0|13e6","Asia/Jakarta|WIB|-70|0||31e6","Asia/Jayapura|WIT|-90|0||26e4","Asia/Jerusalem|IST IDT|-20 -30|01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|aXa0 Db0 1fB0 Rb0 bXB0 gM0 8Q00 IM0 1wo0 TX0 1HB0 IL0 1s10 10n0 1o10 WL0 1zd0 On0 1ld0 11z0 1o10 14n0 1o10 14n0 1nd0 12n0 1nd0 Xz0 1q10 12n0 1hB0 1dX0 1ep0 1aL0 1eN0 17X0 1nf0 11z0 1tB0 19W0 1e10 17b0 1ep0 1gL0 18N0 1fz0 1eN0 17b0 1gq0 1gn0 19d0 1dz0 1c10 17X0 1hB0 1gn0 19d0 1dz0 1c10 17X0 1kp0 1dz0 1c10 1aL0 1eN0 1oL0 10N0 1oL0 10N0 1oL0 10N0 1rz0 W10 1rz0 W10 1rz0 10N0 1oL0 10N0 1oL0 10N0 1rz0 W10 1rz0 W10 1rz0 10N0 1oL0 10N0 1oL0 10N0 1oL0 10N0 1rz0 W10 1rz0 W10 1rz0 10N0 1oL0|81e4","Asia/Kabul|+0430|-4u|0||46e5","Asia/Kamchatka|+12 +13 +11|-c0 -d0 -b0|0101010101010101010102010101010101010101010101010101010101020|rn00 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 2sp0 WM0|18e4","Asia/Karachi|+05 PKT PKST|-50 -50 -60|01212121|2Xv0 1fy00 1cL0 dK10 11b0 1610 1jX0|24e6","Asia/Kathmandu|+0530 +0545|-5u -5J|01|CVuu|12e5","Asia/Khandyga|+09 +10 +08 +11|-90 -a0 -80 -b0|01010101010101010101020101010101010101010101010131313131313131310|rn30 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 qK0 yN0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 17V0 7zD0|66e2","Asia/Krasnoyarsk|+07 +08 +06|-70 -80 -60|010101010101010101010201010101010101010101010101010101010101010|rn50 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0|10e5","Asia/Kuala_Lumpur|+0730 +08|-7u -80|01|td40|71e5","Asia/Macau|CST CDT|-80 -90|01010101010101010|H7u 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 s10 1Vz0 1cN0 1cL0 1cN0 1cL0 6fd0 14n0|57e4","Asia/Magadan|+11 +12 +10|-b0 -c0 -a0|0101010101010101010102010101010101010101010101010101010101010120|rn10 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0 3Cq0|95e3","Asia/Makassar|WITA|-80|0||15e5","Asia/Manila|PST PDT|-80 -90|010|k0E0 1db0|24e6","Asia/Nicosia|EET EEST|-20 -30|01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|cPa0 1cL0 1qp0 Xz0 19B0 19X0 1fB0 1db0 1cp0 1cL0 1fB0 19X0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1fB0 1cL0 1cN0 1cL0 1cN0 1o30 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|32e4","Asia/Novokuznetsk|+07 +08 +06|-70 -80 -60|0101010101010101010102010101010101010101010101010101010101020|rn50 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 2sp0 WM0|55e4","Asia/Novosibirsk|+07 +08 +06|-70 -80 -60|01010101010101010101020101020202020202020202020202020202020202020|rn50 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 ml0 Os0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0 4eN0|15e5","Asia/Omsk|+06 +07 +05|-60 -70 -50|010101010101010101010201010101010101010101010101010101010101010|rn60 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0|12e5","Asia/Oral|+05 +06 +04|-50 -60 -40|010101010101010202020202020202020202020202020|rn70 3Db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 2pB0 1cM0 1fA0 1cM0 1cM0 IM0 1EM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0|27e4","Asia/Pontianak|WITA WIB|-80 -70|01|HNs0|23e4","Asia/Pyongyang|KST KST|-90 -8u|010|1P4D0 6BA0|29e5","Asia/Qostanay|+05 +06 +04|-50 -60 -40|0101010101010101010201010101010101010101010101|rn70 3Db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0|","Asia/Qyzylorda|+05 +06|-50 -60|010101010101010101010101010101010101010101010|rn70 3Db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 3ao0 1EM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 zQl0|73e4","Asia/Rangoon|+0630|-6u|0||48e5","Asia/Sakhalin|+11 +12 +10|-b0 -c0 -a0|010101010101010101010201010101010202020202020202020202020202020|rn10 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 2pB0 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0 3rd0|58e4","Asia/Samarkand|+05 +06|-50 -60|010101010101010101010|rn70 3Db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0|36e4","Asia/Seoul|KST KDT|-90 -a0|01010|Gf50 11A0 1o00 11A0|23e6","Asia/Srednekolymsk|+11 +12 +10|-b0 -c0 -a0|010101010101010101010201010101010101010101010101010101010101010|rn10 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0|35e2","Asia/Taipei|CST CDT|-80 -90|0101010|akg0 1db0 1cN0 1db0 97B0 AL0|74e5","Asia/Tashkent|+06 +07 +05|-60 -70 -50|0101010101010101010102|rn60 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0|23e5","Asia/Tbilisi|+04 +05 +03|-40 -50 -30|01010101010101010101020202010101010101010101020|rn80 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 1cK0 1cL0 1cN0 1cL0 1cN0 2pz0 1cL0 1fB0 3Nz0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 An0 Os0 WM0|11e5","Asia/Tehran|+0330 +0430 +04 +05|-3u -4u -40 -50|0123201010101010101010101010101010101010101010101010101010101010101010|hyHu 1pc0 120u Rc0 XA0 Wou JX0 1dB0 1en0 pNB0 UL0 1cN0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0 1cN0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0 1cN0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0 1cN0 1dz0 64p0 1dz0 1cN0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0 1cN0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0 1cN0 1dz0 1cp0 1dz0 1cp0 1dz0 1cp0 1dz0 1cN0 1dz0 1cp0 1dz0|14e6","Asia/Thimphu|+0530 +06|-5u -60|01|HcGu|79e3","Asia/Tokyo|JST|-90|0||38e6","Asia/Tomsk|+07 +08 +06|-70 -80 -60|01010101010101010101020101010101010101010101020202020202020202020|rn50 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 co0 1bB0 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0 3Qp0|10e5","Asia/Ulaanbaatar|+07 +08 +09|-70 -80 -90|01212121212121212121212121212121212121212121212121|jsF0 cKn0 1db0 1dd0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1fB0 1cL0 1cN0 1cL0 1cN0 1cL0 6hD0 11z0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 kEp0 1cJ0 1cP0 1cJ0|12e5","Asia/Ust-Nera|+09 +12 +11 +10|-90 -c0 -b0 -a0|0121212121212121212123212121212121212121212121212121212121212123|rn30 1d90 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 17V0 7zD0|65e2","Asia/Vladivostok|+10 +11 +09|-a0 -b0 -90|010101010101010101010201010101010101010101010101010101010101010|rn20 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0|60e4","Asia/Yakutsk|+09 +10 +08|-90 -a0 -80|010101010101010101010201010101010101010101010101010101010101010|rn30 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0|28e4","Asia/Yekaterinburg|+05 +06 +04|-50 -60 -40|010101010101010101010201010101010101010101010101010101010101010|rn70 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0|14e5","Asia/Yerevan|+04 +05 +03|-40 -50 -30|01010101010101010101020202020101010101010101010101010101010|rn80 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 2pB0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 4RX0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0|13e5","Atlantic/Azores|-01 +00 WET|10 0 0|0101010101010101010101010101010121010101010101010101010101010101010101010101010101010101010101010101010101010|hAN0 1cM0 1fA0 1cM0 1cM0 1cN0 1cL0 1cN0 1cM0 1cM0 1cM0 1cM0 1cN0 1cL0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cL0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|25e4","Atlantic/Bermuda|AST ADT|40 30|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|avi0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|65e3","Atlantic/Canary|WET WEST|0 -10|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|oXc0 1a10 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|54e4","Atlantic/Cape_Verde|-02 -01|20 10|01|elE0|50e4","Atlantic/Faroe|WET WEST|0 -10|01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|rm10 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|49e3","Atlantic/Madeira|WET WEST|0 -10|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|hAM0 1cM0 1fA0 1cM0 1cM0 1cN0 1cL0 1cN0 1cM0 1cM0 1cM0 1cM0 1cN0 1cL0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|27e4","Atlantic/South_Georgia|-02|20|0||30","Atlantic/Stanley|-04 -03 -02|40 30 20|01212101010101010101010101010101010101010101010101010101|wrg0 WL0 1qL0 U10 1tz0 2mN0 WN0 1qL0 WN0 1qL0 WN0 1qL0 WN0 1tz0 U10 1tz0 WN0 1qL0 WN0 1qL0 WN0 1qL0 WN0 1qL0 WN0 1tz0 WN0 1qL0 WN0 1qL0 WN0 1qL0 WN0 1qL0 WN0 1qN0 U10 1wn0 Rd0 1wn0 U10 1tz0 U10 1tz0 U10 1tz0 U10 1tz0 U10 1wn0 U10 1tz0 U10 1tz0 U10|21e2","Australia/Sydney|AEST AEDT|-a0 -b0|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101|4r40 LA0 1C00 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 14o0 1o00 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 U00 1qM0 WM0 1tA0 WM0 1tA0 U00 1tA0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 11A0 1o00 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 11A0 1o00 WM0 1qM0 14o0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0|40e5","Australia/Adelaide|ACST ACDT|-9u -au|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101|4r4u LA0 1C00 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 U00 1qM0 WM0 1tA0 WM0 1tA0 U00 1tA0 U00 1tA0 Oo0 1zc0 WM0 1qM0 Rc0 1zc0 U00 1tA0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 11A0 1o00 WM0 1qM0 14o0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0|11e5","Australia/Brisbane|AEST AEDT|-a0 -b0|010101010|4r40 LA0 H1A0 Oo0 1zc0 Oo0 1zc0 Oo0|20e5","Australia/Broken_Hill|ACST ACDT|-9u -au|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101|4r4u LA0 1C00 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 14o0 1o00 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 U00 1qM0 WM0 1tA0 WM0 1tA0 U00 1tA0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 11A0 1o00 WM0 1qM0 14o0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0|18e3","Australia/Hobart|AEDT AEST|-b0 -a0|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|qg0 1wo0 U00 1wo0 LA0 1C00 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 11A0 1qM0 WM0 1qM0 Oo0 1zc0 Oo0 1zc0 Oo0 1wo0 WM0 1tA0 WM0 1tA0 U00 1tA0 U00 1tA0 11A0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 11A0 1o00 1io0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1cM0 1a00 1io0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0|21e4","Australia/Darwin|ACST|-9u|0||12e4","Australia/Eucla|+0845 +0945|-8J -9J|0101010101010|bHRf Oo0 l5A0 Oo0 iJA0 G00 zU00 IM0 1qM0 11A0 1o00 11A0|368","Australia/Lord_Howe|AEST +1030 +1130 +11|-a0 -au -bu -b0|01212121213131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313|raC0 1zdu Rb0 1zd0 On0 1zd0 On0 1zd0 On0 1zd0 TXu 1qMu WLu 1tAu WLu 1tAu TXu 1tAu Onu 1zcu Onu 1zcu Onu 1zcu Rbu 1zcu Onu 1zcu Onu 1zcu 11zu 1o0u 11zu 1o0u 11zu 1o0u 11zu 1qMu WLu 11Au 1nXu 1qMu 11zu 1o0u 11zu 1o0u 11zu 1qMu WLu 1qMu 11zu 1o0u WLu 1qMu 14nu 1cMu 1cLu 1cMu 1cLu 1cMu 1cLu 1cMu 1cLu 1fAu 1cLu 1cMu 1cLu 1cMu 1cLu 1cMu 1cLu 1cMu 1cLu 1cMu 1cLu 1fAu 1cLu 1cMu 1cLu 1cMu 1cLu 1cMu 1cLu 1cMu 1cLu 1cMu 1fzu 1cMu 1cLu 1cMu 1cLu 1cMu 1cLu 1cMu 1cLu 1cMu 1cLu 1fAu 1cLu 1cMu|347","Australia/Lindeman|AEST AEDT|-a0 -b0|0101010101010|4r40 LA0 H1A0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0|10","Australia/Melbourne|AEST AEDT|-a0 -b0|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101|4r40 LA0 1C00 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 U00 1qM0 WM0 1qM0 11A0 1tA0 U00 1tA0 U00 1tA0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 11A0 1o00 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 11A0 1o00 WM0 1qM0 14o0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0|39e5","Australia/Perth|AWST AWDT|-80 -90|0101010101010|bHS0 Oo0 l5A0 Oo0 iJA0 G00 zU00 IM0 1qM0 11A0 1o00 11A0|18e5","Europe/Brussels|CET CEST|-10 -20|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|hDB0 1a00 1fA0 1cM0 1cM0 1cM0 1fA0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|21e5","Pacific/Easter|-06 -07 -05|60 70 50|010101010101010101010101020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202|yP0 1ip0 11z0 1o10 11z0 1qN0 WL0 1ld0 14n0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 WL0 1qN0 11z0 1o10 2pA0 11z0 1o10 11z0 1qN0 WL0 1qN0 WL0 1qN0 1cL0 1cN0 11z0 1o10 11z0 1qN0 WL0 1fB0 19X0 1qN0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 17b0 1ip0 11z0 1ip0 1fz0 1fB0 11z0 1qN0 WL0 1qN0 WL0 1qN0 WL0 1qN0 11z0 1o10 11z0 1o10 11z0 1qN0 WL0 1qN0 17b0 1ip0 11z0 1o10 19X0 1fB0 1nX0 G10 1EL0 Op0 1zb0 Rd0 1wn0 Rd0 46n0 Ap0 1Nb0 Ap0 1Nb0 Ap0 1zb0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 11B0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 11B0|30e2","EET|EET EEST|-20 -30|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|hDB0 1a00 1fA0 1cM0 1cM0 1cM0 1fA0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|","Europe/Dublin|IST GMT|-10 0|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101|4re0 U00 1tA0 U00 1tA0 U00 1tA0 U00 1tA0 WM0 1qM0 WM0 1qM0 WM0 1tA0 U00 1tA0 U00 1tA0 11z0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1o00 14o0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|12e5","Etc/GMT-1|+01|-10|0||","Pacific/Guadalcanal|+11|-b0|0||11e4","Pacific/Tarawa|+12|-c0|0||29e3","Etc/GMT-13|+13|-d0|0||","Etc/GMT-14|+14|-e0|0||","Etc/GMT-2|+02|-20|0||","Indian/Maldives|+05|-50|0||35e4","Pacific/Palau|+09|-90|0||21e3","Etc/GMT+1|-01|10|0||","Pacific/Tahiti|-10|a0|0||18e4","Pacific/Niue|-11|b0|0||12e2","Etc/GMT+12|-12|c0|0||","Etc/GMT+5|-05|50|0||","Etc/GMT+6|-06|60|0||","Etc/GMT+7|-07|70|0||","Etc/GMT+8|-08|80|0||","Pacific/Gambier|-09|90|0||125","Etc/UTC|UTC|0|0||","Europe/Andorra|CET CEST|-10 -20|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|B7d0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|79e3","Europe/Astrakhan|+04 +05 +03|-40 -50 -30|0101010101010101020202020202020202020202020202020202020202020|rn80 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 2pB0 1cM0 1fA0 1cM0 3Co0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0 3rd0|10e5","Europe/Athens|EET EEST|-20 -30|01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|cOK0 1vc0 SO0 1cM0 1a00 1ao0 1fc0 1a10 1fG0 1cg0 1dX0 1bX0 1cQ0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|35e5","Europe/London|BST GMT|-10 0|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101|4re0 U00 1tA0 U00 1tA0 U00 1tA0 U00 1tA0 WM0 1qM0 WM0 1qM0 WM0 1tA0 U00 1tA0 U00 1tA0 11z0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1o00 14o0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|10e6","Europe/Belgrade|CET CEST|-10 -20|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|wdd0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|12e5","Europe/Prague|CET CEST|-10 -20|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|muN0 1cM0 1fA0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|13e5","Europe/Bucharest|EET EEST|-20 -30|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|mRa0 On0 1fA0 1a10 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cK0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cL0 1cN0 1cL0 1fB0 1nX0 11E0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|19e5","Europe/Budapest|CET CEST|-10 -20|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|oXb0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cO0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|17e5","Europe/Zurich|CET CEST|-10 -20|01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|rm10 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|38e4","Europe/Chisinau|MSK MSD EEST EET|-30 -40 -30 -20|010101010101010101012323232323232323232323232323232323232323232323232323232323232323232323232323232323|rn90 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 gL0 WO0 1cM0 1cM0 1cK0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1fB0 1nX0 11D0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|67e4","Europe/Gibraltar|CET CEST|-10 -20|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|tLB0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|30e3","Europe/Helsinki|EET EEST|-20 -30|01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|rm00 1cM0 1cM0 1cM0 1cN0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|12e5","Europe/Kaliningrad|MSK MSD EEST EET +03|-30 -40 -30 -20 -30|010101010101010102323232323232323232323232323232323232323232343|rn90 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cN0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0|44e4","Europe/Kiev|MSK MSD EEST EET|-30 -40 -30 -20|0101010101010101010123232323232323232323232323232323232323232323232323232323232323232323232323232323|rn90 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 Db0 3220 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o10 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|34e5","Europe/Kirov|+04 +05 MSD MSK MSK|-40 -50 -40 -30 -40|01010101010101010232302323232323232323232323232323232323232343|rn80 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cN0 1cM0 1fA0 1cM0 2pz0 1cN0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0|48e4","Europe/Lisbon|CET WET WEST CEST|-10 0 -10 -20|01212121212121212121212121212121203030302121212121212121212121212121212121212121212121212121212121212121212121|go00 1cM0 1cM0 1fA0 1cM0 1cM0 1cN0 1cL0 1cN0 1cM0 1cM0 1cM0 1cM0 1cN0 1cL0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|27e5","Europe/Madrid|CET CEST|-10 -20|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|apy0 1a10 1fz0 1a10 19X0 1cN0 1fz0 1a10 1fC0 1cM0 1cM0 1cM0 1fA0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|62e5","Europe/Malta|CET CEST|-10 -20|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|XX0 LA0 1zc0 Oo0 1C00 Oo0 1co0 1cM0 1lA0 Xc0 1qq0 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1o10 11z0 1iN0 19z0 1fB0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|42e4","Europe/Minsk|MSK MSD EEST EET +03|-30 -40 -30 -20 -30|010101010101010101023232323232323232323232323232323232323234|rn90 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 3Fc0 1cN0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0|19e5","Europe/Paris|CET CEST|-10 -20|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|fbc0 1cL0 1fC0 1a00 1fA0 1cM0 1cM0 1cM0 1fA0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|11e6","Europe/Moscow|MSK MSD EEST EET MSK|-30 -40 -30 -20 -40|0101010101010101010102301010101010101010101010101010101010101040|rn90 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cN0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0|16e6","Europe/Riga|MSK MSD EEST EET|-30 -40 -30 -20|010101010101010102323232323232323232323232323232323232323232323232323232323232323232323232323232323|rn90 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cN0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cN0 1o00 11A0 1o00 11A0 1qM0 3oo0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|64e4","Europe/Rome|CET CEST|-10 -20|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|XX0 LA0 1zc0 Oo0 1C00 Oo0 1C00 LA0 1zc0 Oo0 1C00 LA0 1C00 LA0 1zc0 Oo0 1C00 Oo0 1zc0 Oo0 1fC0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|39e5","Europe/Samara|+04 +05 +03|-40 -50 -30|01010101010101010202010101010101010101010101010101010101020|rn80 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 2pB0 1cM0 1fA0 2y10 14m0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 2sp0 WM0|12e5","Europe/Saratov|+04 +05 +03|-40 -50 -30|0101010101010102020202020202020202020202020202020202020202020|rn80 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 2pB0 1cM0 1cM0 1cM0 1fA0 1cM0 3Co0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0 5810|","Europe/Simferopol|MSK MSD EET EEST MSK|-30 -40 -20 -30 -40|0101010101010101010232323101010323232323232323232323232323232323240|rn90 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1Q00 4eN0 1cM0 1cM0 1cM0 1cM0 dV0 WO0 1cM0 1cM0 1fy0 1o30 11B0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11z0 1nW0|33e4","Europe/Sofia|EET EEST|-20 -30|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|muJ0 1dd0 1fb0 1ap0 1fb0 1a20 1fy0 1a30 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cK0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1fB0 1nX0 11E0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|12e5","Europe/Tallinn|MSK MSD EEST EET|-30 -40 -30 -20|0101010101010101023232323232323232323232323232323232323232323232323232323232323232323232323232323|rn90 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cN0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o10 11A0 1qM0 5QM0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|41e4","Europe/Tirane|CET CEST|-10 -20|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|axz0 10n0 1op0 11z0 1pd0 11z0 1qN0 WL0 1qp0 Xb0 1qp0 Xb0 1qp0 11z0 1lB0 11z0 1qN0 11z0 1iN0 16n0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|42e4","Europe/Ulyanovsk|+04 +05 +03 +02|-40 -50 -30 -20|010101010101010102023202020202020202020202020202020202020202020|rn80 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 2pB0 1cM0 1fA0 2pB0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0 3rd0|13e5","Europe/Vienna|CET CEST|-10 -20|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|oXb0 19X0 1cP0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|18e5","Europe/Vilnius|MSK MSD EEST EET CEST CET|-30 -40 -30 -20 -20 -10|01010101010101010232323232323232323454323232323232323232323232323232323232323232323232323232323|rn90 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cN0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11B0 1o00 11A0 1qM0 8io0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|54e4","Europe/Volgograd|+04 +05 MSD MSK MSK|-40 -50 -40 -30 -40|0101010101010102323230232323232323232323232323232323232323234303|rn80 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cN0 1cM0 1cM0 1cM0 1fA0 1cM0 2pz0 1cN0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0 9Jd0 5gn0|10e5","Europe/Warsaw|CET CEST|-10 -20|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|hDA0 1a00 1fA0 1cM0 1cM0 1cM0 1fA0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cN0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|17e5","Pacific/Honolulu|HST|a0|0||37e4","Indian/Chagos|+05 +06|-50 -60|01|13ij0|30e2","Indian/Mauritius|+04 +05|-40 -50|01010|v5U0 14L0 12kr0 11z0|15e4","Pacific/Kwajalein|-12 +12|c0 -c0|01|Vxo0|14e3","MET|MET MEST|-10 -20|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|hDB0 1a00 1fA0 1cM0 1cM0 1cM0 1fA0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|","Pacific/Chatham|+1245 +1345|-cJ -dJ|010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101|bKC0 IM0 1C00 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1qM0 14o0 1lc0 14o0 1lc0 14o0 1lc0 17c0 1io0 17c0 1io0 17c0 1io0 17c0 1lc0 14o0 1lc0 14o0 1lc0 17c0 1io0 17c0 1io0 17c0 1lc0 14o0 1lc0 14o0 1lc0 17c0 1io0 17c0 1io0 17c0 1io0 17c0 1io0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1io0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00|600","Pacific/Apia|-11 -10 +14 +13|b0 a0 -e0 -d0|010123232323232323232323|1Dbn0 1ff0 1a00 CI0 AQ0 1cM0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00 1fA0 1a00 1fA0|37e3","Pacific/Bougainville|+10 +11|-a0 -b0|01|1NwE0|18e4","Pacific/Efate|+11 +12|-b0 -c0|01010101010101010101010|9EA0 Dc0 n610 1cL0 1cN0 1cL0 1fB0 19X0 1fB0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1fB0 Lz0 1Nd0 An0|66e3","Pacific/Enderbury|-12 -11 +13|c0 b0 -d0|012|nIc0 B7X0|1","Pacific/Fakaofo|-11 +13|b0 -d0|01|1Gfn0|483","Pacific/Fiji|+12 +13|-c0 -d0|01010101010101010101010101010|1ace0 LA0 1EM0 IM0 nJc0 LA0 1o00 Rc0 1wo0 Ao0 1Nc0 Ao0 1Q00 xz0 1SN0 uM0 1SM0 uM0 1VA0 s00 1VA0 s00 1VA0 s00 20o0 pc0 2hc0 bc0|88e4","Pacific/Galapagos|-05 -06|50 60|0101|CVF0 gNd0 rz0|25e3","Pacific/Guam|GST GDT ChST|-a0 -b0 -a0|010101010102|JQ0 Rb0 1wp0 Rb0 5xd0 rX0 5sN0 zb1 1C0X On0 ULb0|17e4","Pacific/Kiritimati|-1040 -10 +14|aE a0 -e0|012|nIaE B7Xk|51e2","Pacific/Kosrae|+12 +11|-c0 -b0|01|1aAA0|66e2","Pacific/Marquesas|-0930|9u|0||86e2","Pacific/Pago_Pago|SST|b0|0||37e2","Pacific/Nauru|+1130 +12|-bu -c0|01|maCu|10e3","Pacific/Norfolk|+1130 +1230 +11 +12|-bu -cu -b0 -c0|010232323232323232323232323|bHOu Oo0 1COo0 9Jcu 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0|25e4","Pacific/Noumea|+11 +12|-b0 -c0|0101010|jhp0 xX0 1PB0 yn0 HeP0 Ao0|98e3","Pacific/Pitcairn|-0830 -08|8u 80|01|18Vku|56","Pacific/Rarotonga|-1030 -0930 -10|au 9u a0|012121212121212121212121212|lyWu IL0 1zcu Onu 1zcu Onu 1zcu Rbu 1zcu Onu 1zcu Onu 1zcu Onu 1zcu Onu 1zcu Onu 1zcu Rbu 1zcu Onu 1zcu Onu 1zcu Onu|13e3","Pacific/Tongatapu|+13 +14|-d0 -e0|010101010|1csd0 15A0 1wo0 xz0 1Q10 xz0 zWN0 s00|75e3","WET|WET WEST|0 -10|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|hDB0 1a00 1fA0 1cM0 1cM0 1cM0 1fA0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00|"],links:["Africa/Abidjan|Africa/Accra","Africa/Abidjan|Africa/Bamako","Africa/Abidjan|Africa/Banjul","Africa/Abidjan|Africa/Conakry","Africa/Abidjan|Africa/Dakar","Africa/Abidjan|Africa/Freetown","Africa/Abidjan|Africa/Lome","Africa/Abidjan|Africa/Nouakchott","Africa/Abidjan|Africa/Ouagadougou","Africa/Abidjan|Africa/Timbuktu","Africa/Abidjan|Atlantic/Reykjavik","Africa/Abidjan|Atlantic/St_Helena","Africa/Abidjan|Etc/GMT","Africa/Abidjan|Etc/GMT+0","Africa/Abidjan|Etc/GMT-0","Africa/Abidjan|Etc/GMT0","Africa/Abidjan|Etc/Greenwich","Africa/Abidjan|GMT","Africa/Abidjan|GMT+0","Africa/Abidjan|GMT-0","Africa/Abidjan|GMT0","Africa/Abidjan|Greenwich","Africa/Abidjan|Iceland","Africa/Cairo|Egypt","Africa/Johannesburg|Africa/Maseru","Africa/Johannesburg|Africa/Mbabane","Africa/Lagos|Africa/Bangui","Africa/Lagos|Africa/Brazzaville","Africa/Lagos|Africa/Douala","Africa/Lagos|Africa/Kinshasa","Africa/Lagos|Africa/Libreville","Africa/Lagos|Africa/Luanda","Africa/Lagos|Africa/Malabo","Africa/Lagos|Africa/Niamey","Africa/Lagos|Africa/Porto-Novo","Africa/Maputo|Africa/Blantyre","Africa/Maputo|Africa/Bujumbura","Africa/Maputo|Africa/Gaborone","Africa/Maputo|Africa/Harare","Africa/Maputo|Africa/Kigali","Africa/Maputo|Africa/Lubumbashi","Africa/Maputo|Africa/Lusaka","Africa/Nairobi|Africa/Addis_Ababa","Africa/Nairobi|Africa/Asmara","Africa/Nairobi|Africa/Asmera","Africa/Nairobi|Africa/Dar_es_Salaam","Africa/Nairobi|Africa/Djibouti","Africa/Nairobi|Africa/Kampala","Africa/Nairobi|Africa/Mogadishu","Africa/Nairobi|Indian/Antananarivo","Africa/Nairobi|Indian/Comoro","Africa/Nairobi|Indian/Mayotte","Africa/Tripoli|Libya","America/Adak|America/Atka","America/Adak|US/Aleutian","America/Anchorage|US/Alaska","America/Argentina/Buenos_Aires|America/Buenos_Aires","America/Argentina/Catamarca|America/Argentina/ComodRivadavia","America/Argentina/Catamarca|America/Catamarca","America/Argentina/Cordoba|America/Cordoba","America/Argentina/Cordoba|America/Rosario","America/Argentina/Jujuy|America/Jujuy","America/Argentina/Mendoza|America/Mendoza","America/Cayenne|Etc/GMT+3","America/Chicago|CST6CDT","America/Chicago|US/Central","America/Denver|America/Shiprock","America/Denver|MST7MDT","America/Denver|Navajo","America/Denver|US/Mountain","America/Detroit|US/Michigan","America/Edmonton|America/Yellowknife","America/Edmonton|Canada/Mountain","America/Fort_Wayne|America/Indiana/Indianapolis","America/Fort_Wayne|America/Indianapolis","America/Fort_Wayne|US/East-Indiana","America/Godthab|America/Nuuk","America/Halifax|Canada/Atlantic","America/Havana|Cuba","America/Indiana/Knox|America/Knox_IN","America/Indiana/Knox|US/Indiana-Starke","America/Iqaluit|America/Pangnirtung","America/Jamaica|Jamaica","America/Kentucky/Louisville|America/Louisville","America/La_Paz|Etc/GMT+4","America/Los_Angeles|PST8PDT","America/Los_Angeles|US/Pacific","America/Manaus|Brazil/West","America/Mazatlan|Mexico/BajaSur","America/Mexico_City|Mexico/General","America/New_York|EST5EDT","America/New_York|US/Eastern","America/Noronha|Brazil/DeNoronha","America/Panama|America/Atikokan","America/Panama|America/Cayman","America/Panama|America/Coral_Harbour","America/Panama|EST","America/Phoenix|America/Creston","America/Phoenix|MST","America/Phoenix|US/Arizona","America/Puerto_Rico|America/Anguilla","America/Puerto_Rico|America/Antigua","America/Puerto_Rico|America/Aruba","America/Puerto_Rico|America/Blanc-Sablon","America/Puerto_Rico|America/Curacao","America/Puerto_Rico|America/Dominica","America/Puerto_Rico|America/Grenada","America/Puerto_Rico|America/Guadeloupe","America/Puerto_Rico|America/Kralendijk","America/Puerto_Rico|America/Lower_Princes","America/Puerto_Rico|America/Marigot","America/Puerto_Rico|America/Montserrat","America/Puerto_Rico|America/Port_of_Spain","America/Puerto_Rico|America/St_Barthelemy","America/Puerto_Rico|America/St_Kitts","America/Puerto_Rico|America/St_Lucia","America/Puerto_Rico|America/St_Thomas","America/Puerto_Rico|America/St_Vincent","America/Puerto_Rico|America/Tortola","America/Puerto_Rico|America/Virgin","America/Regina|Canada/Saskatchewan","America/Rio_Branco|America/Porto_Acre","America/Rio_Branco|Brazil/Acre","America/Santiago|Chile/Continental","America/Sao_Paulo|Brazil/East","America/St_Johns|Canada/Newfoundland","America/Tijuana|America/Ensenada","America/Tijuana|America/Santa_Isabel","America/Tijuana|Mexico/BajaNorte","America/Toronto|America/Montreal","America/Toronto|America/Nassau","America/Toronto|America/Nipigon","America/Toronto|America/Thunder_Bay","America/Toronto|Canada/Eastern","America/Vancouver|Canada/Pacific","America/Whitehorse|Canada/Yukon","America/Winnipeg|America/Rainy_River","America/Winnipeg|Canada/Central","Asia/Ashgabat|Asia/Ashkhabad","Asia/Bangkok|Asia/Phnom_Penh","Asia/Bangkok|Asia/Vientiane","Asia/Bangkok|Etc/GMT-7","Asia/Bangkok|Indian/Christmas","Asia/Brunei|Asia/Kuching","Asia/Brunei|Etc/GMT-8","Asia/Dhaka|Asia/Dacca","Asia/Dubai|Asia/Muscat","Asia/Dubai|Etc/GMT-4","Asia/Dubai|Indian/Mahe","Asia/Dubai|Indian/Reunion","Asia/Ho_Chi_Minh|Asia/Saigon","Asia/Hong_Kong|Hongkong","Asia/Jerusalem|Asia/Tel_Aviv","Asia/Jerusalem|Israel","Asia/Kathmandu|Asia/Katmandu","Asia/Kolkata|Asia/Calcutta","Asia/Kuala_Lumpur|Asia/Singapore","Asia/Kuala_Lumpur|Singapore","Asia/Macau|Asia/Macao","Asia/Makassar|Asia/Ujung_Pandang","Asia/Nicosia|Europe/Nicosia","Asia/Qatar|Asia/Bahrain","Asia/Rangoon|Asia/Yangon","Asia/Rangoon|Indian/Cocos","Asia/Riyadh|Antarctica/Syowa","Asia/Riyadh|Asia/Aden","Asia/Riyadh|Asia/Kuwait","Asia/Riyadh|Etc/GMT-3","Asia/Seoul|ROK","Asia/Shanghai|Asia/Chongqing","Asia/Shanghai|Asia/Chungking","Asia/Shanghai|Asia/Harbin","Asia/Shanghai|PRC","Asia/Taipei|ROC","Asia/Tehran|Iran","Asia/Thimphu|Asia/Thimbu","Asia/Tokyo|Japan","Asia/Ulaanbaatar|Asia/Ulan_Bator","Asia/Urumqi|Antarctica/Vostok","Asia/Urumqi|Asia/Kashgar","Asia/Urumqi|Etc/GMT-6","Atlantic/Faroe|Atlantic/Faeroe","Atlantic/South_Georgia|Etc/GMT+2","Australia/Adelaide|Australia/South","Australia/Brisbane|Australia/Queensland","Australia/Broken_Hill|Australia/Yancowinna","Australia/Darwin|Australia/North","Australia/Hobart|Australia/Currie","Australia/Hobart|Australia/Tasmania","Australia/Lord_Howe|Australia/LHI","Australia/Melbourne|Australia/Victoria","Australia/Perth|Australia/West","Australia/Sydney|Australia/ACT","Australia/Sydney|Australia/Canberra","Australia/Sydney|Australia/NSW","Etc/UTC|Etc/UCT","Etc/UTC|Etc/Universal","Etc/UTC|Etc/Zulu","Etc/UTC|UCT","Etc/UTC|UTC","Etc/UTC|Universal","Etc/UTC|Zulu","Europe/Belgrade|Europe/Ljubljana","Europe/Belgrade|Europe/Podgorica","Europe/Belgrade|Europe/Sarajevo","Europe/Belgrade|Europe/Skopje","Europe/Belgrade|Europe/Zagreb","Europe/Berlin|Arctic/Longyearbyen","Europe/Berlin|Atlantic/Jan_Mayen","Europe/Berlin|Europe/Copenhagen","Europe/Berlin|Europe/Oslo","Europe/Berlin|Europe/Stockholm","Europe/Brussels|CET","Europe/Brussels|Europe/Amsterdam","Europe/Brussels|Europe/Luxembourg","Europe/Chisinau|Europe/Tiraspol","Europe/Dublin|Eire","Europe/Helsinki|Europe/Mariehamn","Europe/Istanbul|Asia/Istanbul","Europe/Istanbul|Turkey","Europe/Kiev|Europe/Kyiv","Europe/Kiev|Europe/Uzhgorod","Europe/Kiev|Europe/Zaporozhye","Europe/Lisbon|Portugal","Europe/London|Europe/Belfast","Europe/London|Europe/Guernsey","Europe/London|Europe/Isle_of_Man","Europe/London|Europe/Jersey","Europe/London|GB","Europe/London|GB-Eire","Europe/Moscow|W-SU","Europe/Paris|Europe/Monaco","Europe/Prague|Europe/Bratislava","Europe/Rome|Europe/San_Marino","Europe/Rome|Europe/Vatican","Europe/Warsaw|Poland","Europe/Zurich|Europe/Busingen","Europe/Zurich|Europe/Vaduz","Indian/Maldives|Etc/GMT-5","Indian/Maldives|Indian/Kerguelen","Pacific/Auckland|Antarctica/McMurdo","Pacific/Auckland|Antarctica/South_Pole","Pacific/Auckland|NZ","Pacific/Chatham|NZ-CHAT","Pacific/Easter|Chile/EasterIsland","Pacific/Enderbury|Pacific/Kanton","Pacific/Gambier|Etc/GMT+9","Pacific/Guadalcanal|Etc/GMT-11","Pacific/Guadalcanal|Pacific/Pohnpei","Pacific/Guadalcanal|Pacific/Ponape","Pacific/Guam|Pacific/Saipan","Pacific/Honolulu|HST","Pacific/Honolulu|Pacific/Johnston","Pacific/Honolulu|US/Hawaii","Pacific/Kwajalein|Kwajalein","Pacific/Niue|Etc/GMT+11","Pacific/Pago_Pago|Pacific/Midway","Pacific/Pago_Pago|Pacific/Samoa","Pacific/Pago_Pago|US/Samoa","Pacific/Palau|Etc/GMT-9","Pacific/Port_Moresby|Antarctica/DumontDUrville","Pacific/Port_Moresby|Etc/GMT-10","Pacific/Port_Moresby|Pacific/Chuuk","Pacific/Port_Moresby|Pacific/Truk","Pacific/Port_Moresby|Pacific/Yap","Pacific/Tahiti|Etc/GMT+10","Pacific/Tarawa|Etc/GMT-12","Pacific/Tarawa|Pacific/Funafuti","Pacific/Tarawa|Pacific/Majuro","Pacific/Tarawa|Pacific/Wake","Pacific/Tarawa|Pacific/Wallis"],countries:["AD|Europe/Andorra","AE|Asia/Dubai","AF|Asia/Kabul","AG|America/Puerto_Rico America/Antigua","AI|America/Puerto_Rico America/Anguilla","AL|Europe/Tirane","AM|Asia/Yerevan","AO|Africa/Lagos Africa/Luanda","AQ|Antarctica/Casey Antarctica/Davis Antarctica/Mawson Antarctica/Palmer Antarctica/Rothera Antarctica/Troll Asia/Urumqi Pacific/Auckland Pacific/Port_Moresby Asia/Riyadh Antarctica/McMurdo Antarctica/DumontDUrville Antarctica/Syowa Antarctica/Vostok","AR|America/Argentina/Buenos_Aires America/Argentina/Cordoba America/Argentina/Salta America/Argentina/Jujuy America/Argentina/Tucuman America/Argentina/Catamarca America/Argentina/La_Rioja America/Argentina/San_Juan America/Argentina/Mendoza America/Argentina/San_Luis America/Argentina/Rio_Gallegos America/Argentina/Ushuaia","AS|Pacific/Pago_Pago","AT|Europe/Vienna","AU|Australia/Lord_Howe Antarctica/Macquarie Australia/Hobart Australia/Melbourne Australia/Sydney Australia/Broken_Hill Australia/Brisbane Australia/Lindeman Australia/Adelaide Australia/Darwin Australia/Perth Australia/Eucla","AW|America/Puerto_Rico America/Aruba","AX|Europe/Helsinki Europe/Mariehamn","AZ|Asia/Baku","BA|Europe/Belgrade Europe/Sarajevo","BB|America/Barbados","BD|Asia/Dhaka","BE|Europe/Brussels","BF|Africa/Abidjan Africa/Ouagadougou","BG|Europe/Sofia","BH|Asia/Qatar Asia/Bahrain","BI|Africa/Maputo Africa/Bujumbura","BJ|Africa/Lagos Africa/Porto-Novo","BL|America/Puerto_Rico America/St_Barthelemy","BM|Atlantic/Bermuda","BN|Asia/Kuching Asia/Brunei","BO|America/La_Paz","BQ|America/Puerto_Rico America/Kralendijk","BR|America/Noronha America/Belem America/Fortaleza America/Recife America/Araguaina America/Maceio America/Bahia America/Sao_Paulo America/Campo_Grande America/Cuiaba America/Santarem America/Porto_Velho America/Boa_Vista America/Manaus America/Eirunepe America/Rio_Branco","BS|America/Toronto America/Nassau","BT|Asia/Thimphu","BW|Africa/Maputo Africa/Gaborone","BY|Europe/Minsk","BZ|America/Belize","CA|America/St_Johns America/Halifax America/Glace_Bay America/Moncton America/Goose_Bay America/Toronto America/Iqaluit America/Winnipeg America/Resolute America/Rankin_Inlet America/Regina America/Swift_Current America/Edmonton America/Cambridge_Bay America/Inuvik America/Dawson_Creek America/Fort_Nelson America/Whitehorse America/Dawson America/Vancouver America/Panama America/Puerto_Rico America/Phoenix America/Blanc-Sablon America/Atikokan America/Creston","CC|Asia/Yangon Indian/Cocos","CD|Africa/Maputo Africa/Lagos Africa/Kinshasa Africa/Lubumbashi","CF|Africa/Lagos Africa/Bangui","CG|Africa/Lagos Africa/Brazzaville","CH|Europe/Zurich","CI|Africa/Abidjan","CK|Pacific/Rarotonga","CL|America/Santiago America/Punta_Arenas Pacific/Easter","CM|Africa/Lagos Africa/Douala","CN|Asia/Shanghai Asia/Urumqi","CO|America/Bogota","CR|America/Costa_Rica","CU|America/Havana","CV|Atlantic/Cape_Verde","CW|America/Puerto_Rico America/Curacao","CX|Asia/Bangkok Indian/Christmas","CY|Asia/Nicosia Asia/Famagusta","CZ|Europe/Prague","DE|Europe/Zurich Europe/Berlin Europe/Busingen","DJ|Africa/Nairobi Africa/Djibouti","DK|Europe/Berlin Europe/Copenhagen","DM|America/Puerto_Rico America/Dominica","DO|America/Santo_Domingo","DZ|Africa/Algiers","EC|America/Guayaquil Pacific/Galapagos","EE|Europe/Tallinn","EG|Africa/Cairo","EH|Africa/El_Aaiun","ER|Africa/Nairobi Africa/Asmara","ES|Europe/Madrid Africa/Ceuta Atlantic/Canary","ET|Africa/Nairobi Africa/Addis_Ababa","FI|Europe/Helsinki","FJ|Pacific/Fiji","FK|Atlantic/Stanley","FM|Pacific/Kosrae Pacific/Port_Moresby Pacific/Guadalcanal Pacific/Chuuk Pacific/Pohnpei","FO|Atlantic/Faroe","FR|Europe/Paris","GA|Africa/Lagos Africa/Libreville","GB|Europe/London","GD|America/Puerto_Rico America/Grenada","GE|Asia/Tbilisi","GF|America/Cayenne","GG|Europe/London Europe/Guernsey","GH|Africa/Abidjan Africa/Accra","GI|Europe/Gibraltar","GL|America/Nuuk America/Danmarkshavn America/Scoresbysund America/Thule","GM|Africa/Abidjan Africa/Banjul","GN|Africa/Abidjan Africa/Conakry","GP|America/Puerto_Rico America/Guadeloupe","GQ|Africa/Lagos Africa/Malabo","GR|Europe/Athens","GS|Atlantic/South_Georgia","GT|America/Guatemala","GU|Pacific/Guam","GW|Africa/Bissau","GY|America/Guyana","HK|Asia/Hong_Kong","HN|America/Tegucigalpa","HR|Europe/Belgrade Europe/Zagreb","HT|America/Port-au-Prince","HU|Europe/Budapest","ID|Asia/Jakarta Asia/Pontianak Asia/Makassar Asia/Jayapura","IE|Europe/Dublin","IL|Asia/Jerusalem","IM|Europe/London Europe/Isle_of_Man","IN|Asia/Kolkata","IO|Indian/Chagos","IQ|Asia/Baghdad","IR|Asia/Tehran","IS|Africa/Abidjan Atlantic/Reykjavik","IT|Europe/Rome","JE|Europe/London Europe/Jersey","JM|America/Jamaica","JO|Asia/Amman","JP|Asia/Tokyo","KE|Africa/Nairobi","KG|Asia/Bishkek","KH|Asia/Bangkok Asia/Phnom_Penh","KI|Pacific/Tarawa Pacific/Kanton Pacific/Kiritimati","KM|Africa/Nairobi Indian/Comoro","KN|America/Puerto_Rico America/St_Kitts","KP|Asia/Pyongyang","KR|Asia/Seoul","KW|Asia/Riyadh Asia/Kuwait","KY|America/Panama America/Cayman","KZ|Asia/Almaty Asia/Qyzylorda Asia/Qostanay Asia/Aqtobe Asia/Aqtau Asia/Atyrau Asia/Oral","LA|Asia/Bangkok Asia/Vientiane","LB|Asia/Beirut","LC|America/Puerto_Rico America/St_Lucia","LI|Europe/Zurich Europe/Vaduz","LK|Asia/Colombo","LR|Africa/Monrovia","LS|Africa/Johannesburg Africa/Maseru","LT|Europe/Vilnius","LU|Europe/Brussels Europe/Luxembourg","LV|Europe/Riga","LY|Africa/Tripoli","MA|Africa/Casablanca","MC|Europe/Paris Europe/Monaco","MD|Europe/Chisinau","ME|Europe/Belgrade Europe/Podgorica","MF|America/Puerto_Rico America/Marigot","MG|Africa/Nairobi Indian/Antananarivo","MH|Pacific/Tarawa Pacific/Kwajalein Pacific/Majuro","MK|Europe/Belgrade Europe/Skopje","ML|Africa/Abidjan Africa/Bamako","MM|Asia/Yangon","MN|Asia/Ulaanbaatar Asia/Hovd Asia/Choibalsan","MO|Asia/Macau","MP|Pacific/Guam Pacific/Saipan","MQ|America/Martinique","MR|Africa/Abidjan Africa/Nouakchott","MS|America/Puerto_Rico America/Montserrat","MT|Europe/Malta","MU|Indian/Mauritius","MV|Indian/Maldives","MW|Africa/Maputo Africa/Blantyre","MX|America/Mexico_City America/Cancun America/Merida America/Monterrey America/Matamoros America/Chihuahua America/Ciudad_Juarez America/Ojinaga America/Mazatlan America/Bahia_Banderas America/Hermosillo America/Tijuana","MY|Asia/Kuching Asia/Singapore Asia/Kuala_Lumpur","MZ|Africa/Maputo","NA|Africa/Windhoek","NC|Pacific/Noumea","NE|Africa/Lagos Africa/Niamey","NF|Pacific/Norfolk","NG|Africa/Lagos","NI|America/Managua","NL|Europe/Brussels Europe/Amsterdam","NO|Europe/Berlin Europe/Oslo","NP|Asia/Kathmandu","NR|Pacific/Nauru","NU|Pacific/Niue","NZ|Pacific/Auckland Pacific/Chatham","OM|Asia/Dubai Asia/Muscat","PA|America/Panama","PE|America/Lima","PF|Pacific/Tahiti Pacific/Marquesas Pacific/Gambier","PG|Pacific/Port_Moresby Pacific/Bougainville","PH|Asia/Manila","PK|Asia/Karachi","PL|Europe/Warsaw","PM|America/Miquelon","PN|Pacific/Pitcairn","PR|America/Puerto_Rico","PS|Asia/Gaza Asia/Hebron","PT|Europe/Lisbon Atlantic/Madeira Atlantic/Azores","PW|Pacific/Palau","PY|America/Asuncion","QA|Asia/Qatar","RE|Asia/Dubai Indian/Reunion","RO|Europe/Bucharest","RS|Europe/Belgrade","RU|Europe/Kaliningrad Europe/Moscow Europe/Simferopol Europe/Kirov Europe/Volgograd Europe/Astrakhan Europe/Saratov Europe/Ulyanovsk Europe/Samara Asia/Yekaterinburg Asia/Omsk Asia/Novosibirsk Asia/Barnaul Asia/Tomsk Asia/Novokuznetsk Asia/Krasnoyarsk Asia/Irkutsk Asia/Chita Asia/Yakutsk Asia/Khandyga Asia/Vladivostok Asia/Ust-Nera Asia/Magadan Asia/Sakhalin Asia/Srednekolymsk Asia/Kamchatka Asia/Anadyr","RW|Africa/Maputo Africa/Kigali","SA|Asia/Riyadh","SB|Pacific/Guadalcanal","SC|Asia/Dubai Indian/Mahe","SD|Africa/Khartoum","SE|Europe/Berlin Europe/Stockholm","SG|Asia/Singapore","SH|Africa/Abidjan Atlantic/St_Helena","SI|Europe/Belgrade Europe/Ljubljana","SJ|Europe/Berlin Arctic/Longyearbyen","SK|Europe/Prague Europe/Bratislava","SL|Africa/Abidjan Africa/Freetown","SM|Europe/Rome Europe/San_Marino","SN|Africa/Abidjan Africa/Dakar","SO|Africa/Nairobi Africa/Mogadishu","SR|America/Paramaribo","SS|Africa/Juba","ST|Africa/Sao_Tome","SV|America/El_Salvador","SX|America/Puerto_Rico America/Lower_Princes","SY|Asia/Damascus","SZ|Africa/Johannesburg Africa/Mbabane","TC|America/Grand_Turk","TD|Africa/Ndjamena","TF|Asia/Dubai Indian/Maldives Indian/Kerguelen","TG|Africa/Abidjan Africa/Lome","TH|Asia/Bangkok","TJ|Asia/Dushanbe","TK|Pacific/Fakaofo","TL|Asia/Dili","TM|Asia/Ashgabat","TN|Africa/Tunis","TO|Pacific/Tongatapu","TR|Europe/Istanbul","TT|America/Puerto_Rico America/Port_of_Spain","TV|Pacific/Tarawa Pacific/Funafuti","TW|Asia/Taipei","TZ|Africa/Nairobi Africa/Dar_es_Salaam","UA|Europe/Simferopol Europe/Kyiv","UG|Africa/Nairobi Africa/Kampala","UM|Pacific/Pago_Pago Pacific/Tarawa Pacific/Midway Pacific/Wake","US|America/New_York America/Detroit America/Kentucky/Louisville America/Kentucky/Monticello America/Indiana/Indianapolis America/Indiana/Vincennes America/Indiana/Winamac America/Indiana/Marengo America/Indiana/Petersburg America/Indiana/Vevay America/Chicago America/Indiana/Tell_City America/Indiana/Knox America/Menominee America/North_Dakota/Center America/North_Dakota/New_Salem America/North_Dakota/Beulah America/Denver America/Boise America/Phoenix America/Los_Angeles America/Anchorage America/Juneau America/Sitka America/Metlakatla America/Yakutat America/Nome America/Adak Pacific/Honolulu","UY|America/Montevideo","UZ|Asia/Samarkand Asia/Tashkent","VA|Europe/Rome Europe/Vatican","VC|America/Puerto_Rico America/St_Vincent","VE|America/Caracas","VG|America/Puerto_Rico America/Tortola","VI|America/Puerto_Rico America/St_Thomas","VN|Asia/Bangkok Asia/Ho_Chi_Minh","VU|Pacific/Efate","WF|Pacific/Tarawa Pacific/Wallis","WS|Pacific/Apia","YE|Asia/Riyadh Asia/Aden","YT|Africa/Nairobi Indian/Mayotte","ZA|Africa/Johannesburg","ZM|Africa/Maputo Africa/Lusaka","ZW|Africa/Maputo Africa/Harare"]}),M})});var t0=F((z0,J)=>{(function(M,n){"use strict";typeof J=="object"&&J.exports?J.exports=n(a0()):typeof define=="function"&&define.amd?define(["moment"],n):n(M.moment)})(z0,function(M){"use strict";if(!M.tz)throw new Error("moment-timezone-utils.js must be loaded after moment-timezone.js");var n="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX",e=1e-6;function q(A,z){for(var r=".",t="",p;z>0;)z-=1,A*=60,p=Math.floor(A+e),r+=n[p],A-=p,p&&(t+=r,r="");return t}function u(A,z){for(var r="",t=Math.abs(A),p=Math.floor(t),O=q(t-p,Math.min(~~z,10));p>0;)r=n[p%60]+r,p=Math.floor(p/60);return A<0&&(r="-"+r),r&&O?r+O:!O&&r==="-"?"0":r||O||"0"}function W(A){var z=[],r=0,t;for(t=0;t<A.length-1;t++)z[t]=u(Math.round((A[t]-r)/1e3)/60,1),r=A[t];return z.join(" ")}function E(A){var z=0,r=[],t=[],p=[],O={},f,N;for(f=0;f<A.abbrs.length;f++)N=A.abbrs[f]+"|"+A.offsets[f],O[N]===void 0&&(O[N]=z,r[z]=A.abbrs[f],t[z]=u(Math.round(A.offsets[f]*60)/60,1),z++),p[f]=u(O[N],0);return r.join(" ")+"|"+t.join(" ")+"|"+p.join("")}function I(A){if(!A)return"";if(A<1e3)return A;var z=String(A|0).length-2,r=Math.round(A/Math.pow(10,z));return r+"e"+z}function Y(A){return A?A.join(" "):""}function _(A){if(!A.name)throw new Error("Missing name");if(!A.abbrs)throw new Error("Missing abbrs");if(!A.untils)throw new Error("Missing untils");if(!A.offsets)throw new Error("Missing offsets");if(A.offsets.length!==A.untils.length||A.offsets.length!==A.abbrs.length)throw new Error("Mismatched array lengths")}function w(A){return _(A),[A.name,E(A),W(A.untils),I(A.population)].join("|")}function K(A){return[A.name,A.zones.join(" ")].join("|")}function k(A,z){var r;if(A.length!==z.length)return!1;for(r=0;r<A.length;r++)if(A[r]!==z[r])return!1;return!0}function y(A,z){return k(A.offsets,z.offsets)&&k(A.abbrs,z.abbrs)&&k(A.untils,z.untils)}function Z(A,z,r,t){var p,O,f,N,X,h,P=[];for(p=0;p<A.length;p++){for(h=!1,f=A[p],O=0;O<P.length;O++)X=P[O],N=X[0],y(f,N)&&(f.population>N.population||f.population===N.population&&t&&t[f.name]?X.unshift(f):X.push(f),h=!0);h||P.push([f])}for(p=0;p<P.length;p++)for(X=P[p],z.push(X[0]),O=1;O<X.length;O++)r.push(X[0].name+"|"+X[O].name)}function v(A,z){var r=[],t=[];return A.links&&(t=A.links.slice()),Z(A.zones,r,t,z),{version:A.version,zones:r,links:t.sort()}}function U(A,z,r){var t=0,p=A.length+1,O,f;for(r||(r=z),z>r&&(f=z,z=r,r=f),f=0;f<A.length;f++)A[f]!=null&&(O=new Date(A[f]).getUTCFullYear(),O<z&&(t=f+1),O>r&&(p=Math.min(p,f+1)));return[t,p]}function C(A,z,r){var t=Array.prototype.slice,p=U(A.untils,z,r),O=t.apply(A.untils,p);return O[O.length-1]=null,{name:A.name,abbrs:t.apply(A.abbrs,p),untils:O,offsets:t.apply(A.offsets,p),population:A.population,countries:A.countries}}function Q(A,z,r,t){var p,O=A.zones,f=[],N;for(p=0;p<O.length;p++)f[p]=C(O[p],z,r);for(N=v({zones:f,links:A.links.slice(),version:A.version},t),p=0;p<N.zones.length;p++)N.zones[p]=w(N.zones[p]);return N.countries=A.countries?A.countries.map(function(X){return K(X)}):[],N}return M.tz.pack=w,M.tz.packBase60=u,M.tz.createLinks=v,M.tz.filterYears=C,M.tz.filterLinkPack=Q,M.tz.packCountry=K,M})});var q0=F((Y0,f0)=>{f0.exports=window.wp.deprecated});var F0={};C0(F0,{__experimentalGetSettings:()=>k0,date:()=>w0,dateI18n:()=>v0,format:()=>H,getDate:()=>H0,getSettings:()=>d0,gmdate:()=>K0,gmdateI18n:()=>s0,humanTimeDiff:()=>U0,isInTheFuture:()=>G0,setSettings:()=>_0});var l=V(M0(),1),Z0=V(a0(),1),Q0=V(t0(),1),O0=V(q0(),1),S="WP",D0=/^[+-][0-1][0-9](:?[0-9][0-9])?$/,g={l10n:{locale:"en",months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],meridiem:{am:"am",pm:"pm",AM:"AM",PM:"PM"},relative:{future:"%s from now",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},startOfWeek:0},formats:{time:"g:i a",date:"F j, Y",datetime:"F j, Y g:i a",datetimeAbbreviated:"M j, Y g:i a"},timezone:{offset:0,offsetFormatted:"0",string:"",abbr:""}};function _0(M){if(g=M,l0(),l.default.locales().includes(M.l10n.locale))if(l.default.localeData(M.l10n.locale).longDateFormat("LTS")===null)l.default.defineLocale(M.l10n.locale,null);else return;let n=l.default.locale();l.default.defineLocale(M.l10n.locale,{parentLocale:"en",months:M.l10n.months,monthsShort:M.l10n.monthsShort,weekdays:M.l10n.weekdays,weekdaysShort:M.l10n.weekdaysShort,meridiem(e,q,u){return e<12?u?M.l10n.meridiem.am:M.l10n.meridiem.AM:u?M.l10n.meridiem.pm:M.l10n.meridiem.PM},longDateFormat:{LT:M.formats.time,LTS:l.default.localeData("en").longDateFormat("LTS"),L:l.default.localeData("en").longDateFormat("L"),LL:M.formats.date,LLL:M.formats.datetime,LLLL:l.default.localeData("en").longDateFormat("LLLL")},relativeTime:M.l10n.relative}),l.default.locale(n)}function d0(){return g}function k0(){return(0,O0.default)("wp.date.__experimentalGetSettings",{since:"6.1",alternative:"wp.date.getSettings"}),d0()}function l0(){let M=l.default.tz.zone(g.timezone.string);M?l.default.tz.add(l.default.tz.pack({name:S,abbrs:M.abbrs,untils:M.untils,offsets:M.offsets})):l.default.tz.add(l.default.tz.pack({name:S,abbrs:[S],untils:[null],offsets:[-g.timezone.offset*60||0]}))}var o0=60,y0=60,I0=60*o0,u0={d:"DD",D:"ddd",j:"D",l:"dddd",N:"E",S(M){let n=M.format("D");return M.format("Do").replace(n,"")},w:"d",z(M){return(parseInt(M.format("DDD"),10)-1).toString()},W:"W",F:"MMMM",m:"MM",M:"MMM",n:"M",t(M){return M.daysInMonth()},L(M){return M.isLeapYear()?"1":"0"},o:"GGGG",Y:"YYYY",y:"YY",a:"a",A:"A",B(M){let n=(0,l.default)(M).utcOffset(60),e=parseInt(n.format("s"),10),q=parseInt(n.format("m"),10),u=parseInt(n.format("H"),10);return parseInt(((e+q*o0+u*I0)/86.4).toString(),10)},g:"h",G:"H",h:"hh",H:"HH",i:"mm",s:"ss",u:"SSSSSS",v:"SSS",e:"zz",I(M){return M.isDST()?"1":"0"},O:"ZZ",P:"Z",T:"z",Z(M){let n=M.format("Z"),e=n[0]==="-"?-1:1,q=n.substring(1).split(":").map(u=>parseInt(u,10));return e*(q[0]*y0+q[1])*o0},c:"YYYY-MM-DDTHH:mm:ssZ",r(M){return M.locale("en").format("ddd, DD MMM YYYY HH:mm:ss ZZ")},U:"X"};function H(M,n=new Date){let e,q,u=[],W=(0,l.default)(n);for(e=0;e<M.length;e++){if(q=M[e],q==="\\"){e++,u.push("["+M[e]+"]");continue}if(q in u0){let E=u0[q];typeof E!="string"?u.push("["+E(W)+"]"):u.push(E)}else u.push("["+q+"]")}return W.format(u.join("[]"))}function w0(M,n=new Date,e){let q=N0(n,e);return H(M,q)}function K0(M,n=new Date){let e=(0,l.default)(n).utc();return H(M,e)}function v0(M,n=new Date,e){if(e===!0)return s0(M,n);e===!1&&(e=void 0);let q=N0(n,e);return q.locale(g.l10n.locale),H(M,q)}function s0(M,n=new Date){let e=(0,l.default)(n).utc();return e.locale(g.l10n.locale),H(M,e)}function G0(M){let n=l.default.tz(S);return l.default.tz(M,S).isAfter(n)}function H0(M){return M?l.default.tz(M,S).toDate():l.default.tz(S).toDate()}function U0(M,n){let e=l.default.tz(M,S),q=n?l.default.tz(n,S):l.default.tz(S);return e.from(q)}function N0(M,n=""){let e=(0,l.default)(M);return n!==""?j0(n)?e.utcOffset(n):e.tz(n):g.timezone.string?e.tz(g.timezone.string):e.utcOffset(+g.timezone.offset)}function j0(M){return typeof M=="number"?!0:D0.test(M)}l0();return P0(F0);})(); /*! Bundled license information: moment-timezone/builds/moment-timezone-with-data-1970-2030.js: (*! moment-timezone.js *) (*! version : 0.5.43 *) (*! Copyright (c) JS Foundation and other contributors *) (*! license : MIT *) (*! github.com/moment/moment-timezone *) moment-timezone/moment-timezone-utils.js: (*! moment-timezone-utils.js *) (*! version : 0.5.43 *) (*! Copyright (c) JS Foundation and other contributors *) (*! license : MIT *) (*! github.com/moment/moment-timezone *) */ edit-post.js 0000644 00000352625 15206720414 0007030 0 ustar 00 var wp; (wp ||= {}).editPost = (() => { 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 __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; 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 )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // package-external:@wordpress/blocks var require_blocks = __commonJS({ "package-external:@wordpress/blocks"(exports, module) { module.exports = window.wp.blocks; } }); // package-external:@wordpress/block-library var require_block_library = __commonJS({ "package-external:@wordpress/block-library"(exports, module) { module.exports = window.wp.blockLibrary; } }); // package-external:@wordpress/deprecated var require_deprecated = __commonJS({ "package-external:@wordpress/deprecated"(exports, module) { module.exports = window.wp.deprecated; } }); // package-external:@wordpress/element var require_element = __commonJS({ "package-external:@wordpress/element"(exports, module) { module.exports = window.wp.element; } }); // package-external:@wordpress/data var require_data = __commonJS({ "package-external:@wordpress/data"(exports, module) { module.exports = window.wp.data; } }); // package-external:@wordpress/preferences var require_preferences = __commonJS({ "package-external:@wordpress/preferences"(exports, module) { module.exports = window.wp.preferences; } }); // package-external:@wordpress/widgets var require_widgets = __commonJS({ "package-external:@wordpress/widgets"(exports, module) { module.exports = window.wp.widgets; } }); // package-external:@wordpress/editor var require_editor = __commonJS({ "package-external:@wordpress/editor"(exports, module) { module.exports = window.wp.editor; } }); // package-external:@wordpress/i18n var require_i18n = __commonJS({ "package-external:@wordpress/i18n"(exports, module) { module.exports = window.wp.i18n; } }); // package-external:@wordpress/components var require_components = __commonJS({ "package-external:@wordpress/components"(exports, module) { module.exports = window.wp.components; } }); // vendor-external:react/jsx-runtime var require_jsx_runtime = __commonJS({ "vendor-external:react/jsx-runtime"(exports, module) { module.exports = window.ReactJSXRuntime; } }); // package-external:@wordpress/primitives var require_primitives = __commonJS({ "package-external:@wordpress/primitives"(exports, module) { module.exports = window.wp.primitives; } }); // 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/compose var require_compose = __commonJS({ "package-external:@wordpress/compose"(exports, module) { module.exports = window.wp.compose; } }); // package-external:@wordpress/block-editor var require_block_editor = __commonJS({ "package-external:@wordpress/block-editor"(exports, module) { module.exports = window.wp.blockEditor; } }); // package-external:@wordpress/style-engine var require_style_engine = __commonJS({ "package-external:@wordpress/style-engine"(exports, module) { module.exports = window.wp.styleEngine; } }); // package-external:@wordpress/plugins var require_plugins = __commonJS({ "package-external:@wordpress/plugins"(exports, module) { module.exports = window.wp.plugins; } }); // package-external:@wordpress/notices var require_notices = __commonJS({ "package-external:@wordpress/notices"(exports, module) { module.exports = window.wp.notices; } }); // package-external:@wordpress/commands var require_commands = __commonJS({ "package-external:@wordpress/commands"(exports, module) { module.exports = window.wp.commands; } }); // package-external:@wordpress/url var require_url = __commonJS({ "package-external:@wordpress/url"(exports, module) { module.exports = window.wp.url; } }); // package-external:@wordpress/html-entities var require_html_entities = __commonJS({ "package-external:@wordpress/html-entities"(exports, module) { module.exports = window.wp.htmlEntities; } }); // package-external:@wordpress/core-data var require_core_data = __commonJS({ "package-external:@wordpress/core-data"(exports, module) { module.exports = window.wp.coreData; } }); // package-external:@wordpress/keyboard-shortcuts var require_keyboard_shortcuts = __commonJS({ "package-external:@wordpress/keyboard-shortcuts"(exports, module) { module.exports = window.wp.keyboardShortcuts; } }); // 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/hooks var require_hooks = __commonJS({ "package-external:@wordpress/hooks"(exports, module) { module.exports = window.wp.hooks; } }); // package-external:@wordpress/keycodes var require_keycodes = __commonJS({ "package-external:@wordpress/keycodes"(exports, module) { module.exports = window.wp.keycodes; } }); // packages/edit-post/build-module/index.mjs var index_exports = {}; __export(index_exports, { PluginBlockSettingsMenuItem: () => PluginBlockSettingsMenuItem, PluginDocumentSettingPanel: () => PluginDocumentSettingPanel, PluginMoreMenuItem: () => PluginMoreMenuItem, PluginPostPublishPanel: () => PluginPostPublishPanel, PluginPostStatusInfo: () => PluginPostStatusInfo, PluginPrePublishPanel: () => PluginPrePublishPanel, PluginSidebar: () => PluginSidebar, PluginSidebarMoreMenuItem: () => PluginSidebarMoreMenuItem, __experimentalFullscreenModeClose: () => fullscreen_mode_close_default, __experimentalMainDashboardButton: () => __experimentalMainDashboardButton, __experimentalPluginPostExcerpt: () => __experimentalPluginPostExcerpt, initializeEditor: () => initializeEditor, reinitializeEditor: () => reinitializeEditor, store: () => store }); var import_blocks3 = __toESM(require_blocks(), 1); var import_block_library2 = __toESM(require_block_library(), 1); var import_deprecated4 = __toESM(require_deprecated(), 1); var import_element13 = __toESM(require_element(), 1); var import_data26 = __toESM(require_data(), 1); var import_preferences11 = __toESM(require_preferences(), 1); var import_widgets = __toESM(require_widgets(), 1); var import_editor20 = __toESM(require_editor(), 1); // node_modules/clsx/dist/clsx.mjs function r(e) { var t, f, n = ""; if ("string" == typeof e || "number" == typeof e) n += e; else if ("object" == typeof e) if (Array.isArray(e)) { var o = e.length; for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f); } else for (f in e) e[f] && (n && (n += " "), n += f); return n; } function clsx() { for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t); return n; } var clsx_default = clsx; // packages/admin-ui/build-module/navigable-region/index.mjs var import_element = __toESM(require_element(), 1); var import_jsx_runtime = __toESM(require_jsx_runtime(), 1); var NavigableRegion = (0, import_element.forwardRef)( ({ children, className, ariaLabel, as: Tag = "div", ...props }, ref) => { return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( Tag, { ref, className: clsx_default("admin-ui-navigable-region", className), "aria-label": ariaLabel, role: "region", tabIndex: "-1", ...props, children } ); } ); NavigableRegion.displayName = "NavigableRegion"; var navigable_region_default = NavigableRegion; // packages/icons/build-module/library/arrow-up-left.mjs var import_primitives = __toESM(require_primitives(), 1); var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1); var arrow_up_left_default = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives.Path, { d: "M14 6H6v8h1.5V8.5L17 18l1-1-9.5-9.5H14V6Z" }) }); // packages/icons/build-module/library/chevron-down.mjs var import_primitives2 = __toESM(require_primitives(), 1); var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1); var chevron_down_default = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives2.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives2.Path, { d: "M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z" }) }); // packages/icons/build-module/library/chevron-up.mjs var import_primitives3 = __toESM(require_primitives(), 1); var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1); var chevron_up_default = /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives3.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives3.Path, { d: "M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z" }) }); // packages/icons/build-module/library/fullscreen.mjs var import_primitives4 = __toESM(require_primitives(), 1); var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1); var fullscreen_default = /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives4.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives4.Path, { d: "M6 4a2 2 0 0 0-2 2v3h1.5V6a.5.5 0 0 1 .5-.5h3V4H6Zm3 14.5H6a.5.5 0 0 1-.5-.5v-3H4v3a2 2 0 0 0 2 2h3v-1.5Zm6 1.5v-1.5h3a.5.5 0 0 0 .5-.5v-3H20v3a2 2 0 0 1-2 2h-3Zm3-16a2 2 0 0 1 2 2v3h-1.5V6a.5.5 0 0 0-.5-.5h-3V4h3Z" }) }); // packages/icons/build-module/library/wordpress.mjs var import_primitives5 = __toESM(require_primitives(), 1); var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1); var wordpress_default = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives5.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "-2 -2 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives5.Path, { d: "M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z" }) }); // packages/edit-post/build-module/components/layout/index.mjs var import_editor18 = __toESM(require_editor(), 1); var import_data25 = __toESM(require_data(), 1); var import_block_editor2 = __toESM(require_block_editor(), 1); // packages/global-styles-engine/build-module/utils/common.mjs var import_style_engine = __toESM(require_style_engine(), 1); var ROOT_BLOCK_SELECTOR = "body"; var ROOT_CSS_PROPERTIES_SELECTOR = ":root"; // packages/global-styles-engine/build-module/core/render.mjs var import_blocks = __toESM(require_blocks(), 1); var import_style_engine2 = __toESM(require_style_engine(), 1); var import_data = __toESM(require_data(), 1); // packages/global-styles-engine/build-module/utils/spacing.mjs function getSpacingPresetCssVar(value) { if (!value) { return; } const slug = value.match(/var:preset\|spacing\|(.+)/); if (!slug) { return value; } return `var(--wp--preset--spacing--${slug[1]})`; } // packages/global-styles-engine/build-module/utils/gap.mjs function getGapBoxControlValueFromStyle(blockGapValue) { if (!blockGapValue) { return null; } const isValueString = typeof blockGapValue === "string"; return { top: isValueString ? blockGapValue : blockGapValue?.top, left: isValueString ? blockGapValue : blockGapValue?.left }; } function getGapCSSValue(blockGapValue, defaultValue = "0") { const blockGapBoxControlValue = getGapBoxControlValueFromStyle(blockGapValue); if (!blockGapBoxControlValue) { return null; } const row = getSpacingPresetCssVar(blockGapBoxControlValue?.top) || defaultValue; const column = getSpacingPresetCssVar(blockGapBoxControlValue?.left) || defaultValue; return row === column ? row : `${row} ${column}`; } // packages/global-styles-engine/build-module/utils/layout.mjs var LAYOUT_DEFINITIONS = { 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)", // :is(*, div) instead of just * increases the specificity by 001. rules: { margin: "0" } } ], spacingStyles: [ { selector: "", rules: { gap: null } } ] }, grid: { name: "grid", slug: "grid", className: "is-layout-grid", displayMode: "grid", baseStyles: [ { selector: " > :is(*, div)", // :is(*, div) instead of just * increases the specificity by 001. rules: { margin: "0" } } ], spacingStyles: [ { selector: "", rules: { gap: null } } ] } }; // packages/global-styles-engine/build-module/core/render.mjs function getLayoutStyles({ layoutDefinitions = LAYOUT_DEFINITIONS, style, selector, hasBlockGapSupport, hasFallbackGapSupport, fallbackGapValue }) { let ruleset = ""; let gapValue = hasBlockGapSupport ? getGapCSSValue(style?.spacing?.blockGap) : ""; if (hasFallbackGapSupport) { if (selector === ROOT_BLOCK_SELECTOR) { gapValue = !gapValue ? "0.5em" : gapValue; } else if (!hasBlockGapSupport && fallbackGapValue) { gapValue = fallbackGapValue; } } if (gapValue && layoutDefinitions) { Object.values(layoutDefinitions).forEach( ({ className, name, spacingStyles }) => { if (!hasBlockGapSupport && "flex" !== name && "grid" !== name) { return; } if (spacingStyles?.length) { spacingStyles.forEach((spacingStyle) => { const declarations = []; if (spacingStyle.rules) { Object.entries(spacingStyle.rules).forEach( ([cssProperty, cssValue]) => { declarations.push( `${cssProperty}: ${cssValue ? cssValue : gapValue}` ); } ); } if (declarations.length) { let combinedSelector = ""; if (!hasBlockGapSupport) { combinedSelector = selector === ROOT_BLOCK_SELECTOR ? `:where(.${className}${spacingStyle?.selector || ""})` : `:where(${selector}.${className}${spacingStyle?.selector || ""})`; } else { combinedSelector = selector === ROOT_BLOCK_SELECTOR ? `:root :where(.${className})${spacingStyle?.selector || ""}` : `:root :where(${selector}-${className})${spacingStyle?.selector || ""}`; } ruleset += `${combinedSelector} { ${declarations.join( "; " )}; }`; } }); } } ); if (selector === ROOT_BLOCK_SELECTOR && hasBlockGapSupport) { ruleset += `${ROOT_CSS_PROPERTIES_SELECTOR} { --wp--style--block-gap: ${gapValue}; }`; } } if (selector === ROOT_BLOCK_SELECTOR && layoutDefinitions) { const validDisplayModes = ["block", "flex", "grid"]; Object.values(layoutDefinitions).forEach( ({ className, displayMode, baseStyles }) => { if (displayMode && validDisplayModes.includes(displayMode)) { ruleset += `${selector} .${className} { display:${displayMode}; }`; } if (baseStyles?.length) { baseStyles.forEach((baseStyle) => { const declarations = []; if (baseStyle.rules) { Object.entries(baseStyle.rules).forEach( ([cssProperty, cssValue]) => { declarations.push( `${cssProperty}: ${cssValue}` ); } ); } if (declarations.length) { const combinedSelector = `.${className}${baseStyle?.selector || ""}`; ruleset += `${combinedSelector} { ${declarations.join( "; " )}; }`; } }); } } ); } return ruleset; } // packages/edit-post/build-module/components/layout/index.mjs var import_plugins = __toESM(require_plugins(), 1); var import_i18n14 = __toESM(require_i18n(), 1); var import_element12 = __toESM(require_element(), 1); var import_notices3 = __toESM(require_notices(), 1); var import_preferences10 = __toESM(require_preferences(), 1); var import_commands2 = __toESM(require_commands(), 1); var import_block_library = __toESM(require_block_library(), 1); var import_url5 = __toESM(require_url(), 1); var import_html_entities = __toESM(require_html_entities(), 1); var import_core_data8 = __toESM(require_core_data(), 1); var import_components9 = __toESM(require_components(), 1); var import_compose3 = __toESM(require_compose(), 1); // packages/edit-post/build-module/components/back-button/index.mjs var import_editor2 = __toESM(require_editor(), 1); var import_components2 = __toESM(require_components(), 1); // packages/edit-post/build-module/components/back-button/fullscreen-mode-close.mjs var import_data2 = __toESM(require_data(), 1); var import_components = __toESM(require_components(), 1); var import_i18n = __toESM(require_i18n(), 1); var import_url = __toESM(require_url(), 1); var import_editor = __toESM(require_editor(), 1); var import_core_data = __toESM(require_core_data(), 1); var import_compose = __toESM(require_compose(), 1); var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1); var siteIconVariants = { edit: { clipPath: "inset(0% round 0px)" }, hover: { clipPath: "inset( 22% round 2px )" }, tap: { clipPath: "inset(0% round 0px)" } }; var toggleHomeIconVariants = { edit: { opacity: 0, scale: 0.2 }, hover: { opacity: 1, scale: 1, clipPath: "inset( 22% round 2px )" } }; function FullscreenModeClose({ showTooltip, icon, href, initialPost }) { const { isRequestingSiteIcon, postType, siteIconUrl } = (0, import_data2.useSelect)( (select3) => { const { getCurrentPostType } = select3(import_editor.store); const { getEntityRecord, getPostType, isResolving } = select3(import_core_data.store); const siteData = getEntityRecord("root", "__unstableBase", void 0) || {}; const _postType = initialPost?.type || getCurrentPostType(); return { isRequestingSiteIcon: isResolving("getEntityRecord", [ "root", "__unstableBase", void 0 ]), postType: getPostType(_postType), siteIconUrl: siteData.site_icon_url }; }, [initialPost?.type] ); const disableMotion = (0, import_compose.useReducedMotion)(); const transition = { duration: disableMotion ? 0 : 0.2 }; if (!postType) { return null; } let siteIconContent; if (isRequestingSiteIcon && !siteIconUrl) { siteIconContent = /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "edit-post-fullscreen-mode-close-site-icon__image" }); } else if (siteIconUrl) { siteIconContent = /* @__PURE__ */ (0, import_jsx_runtime7.jsx)( "img", { className: "edit-post-fullscreen-mode-close-site-icon__image", alt: (0, import_i18n.__)("Site Icon"), src: siteIconUrl } ); } else { siteIconContent = /* @__PURE__ */ (0, import_jsx_runtime7.jsx)( import_components.Icon, { className: "edit-post-fullscreen-mode-close-site-icon__icon", icon: wordpress_default, size: 48 } ); } const buttonIcon = icon ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_components.Icon, { size: "36px", icon }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "edit-post-fullscreen-mode-close-site-icon", children: siteIconContent }); const classes = clsx_default("edit-post-fullscreen-mode-close", { "has-icon": siteIconUrl }); const buttonHref = href ?? (0, import_url.addQueryArgs)("edit.php", { post_type: postType.slug }); const buttonLabel = postType?.labels?.view_items ?? (0, import_i18n.__)("Back"); return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)( import_components.__unstableMotion.div, { className: "edit-post-fullscreen-mode-close__view-mode-toggle", animate: "edit", initial: "edit", whileHover: "hover", whileTap: "tap", transition, children: [ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)( import_components.Button, { __next40pxDefaultSize: true, className: classes, href: buttonHref, label: buttonLabel, showTooltip, tooltipPosition: "middle right", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_components.__unstableMotion.div, { variants: !disableMotion && siteIconVariants, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "edit-post-fullscreen-mode-close__view-mode-toggle-icon", children: buttonIcon }) }) } ), /* @__PURE__ */ (0, import_jsx_runtime7.jsx)( import_components.__unstableMotion.div, { className: clsx_default( "edit-post-fullscreen-mode-close__back-icon", { "has-site-icon": siteIconUrl } ), variants: !disableMotion && toggleHomeIconVariants, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_components.Icon, { icon: arrow_up_left_default }) } ) ] } ); } var fullscreen_mode_close_default = FullscreenModeClose; // packages/edit-post/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/edit-post" ); // packages/edit-post/build-module/components/back-button/index.mjs var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1); var { BackButton: BackButtonFill } = unlock(import_editor2.privateApis); var slideX = { hidden: { x: "-100%" }, distractionFreeInactive: { x: 0 }, hover: { x: 0, transition: { type: "tween", delay: 0.2 } } }; function BackButton({ initialPost }) { return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(BackButtonFill, { children: ({ length }) => length <= 1 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)( import_components2.__unstableMotion.div, { variants: slideX, transition: { type: "tween", delay: 0.8 }, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)( fullscreen_mode_close_default, { showTooltip: true, initialPost } ) } ) }); } var back_button_default = BackButton; // packages/edit-post/build-module/components/editor-initialization/listener-hooks.mjs var import_data3 = __toESM(require_data(), 1); var import_element2 = __toESM(require_element(), 1); var import_editor3 = __toESM(require_editor(), 1); var import_core_data2 = __toESM(require_core_data(), 1); // packages/edit-post/build-module/store/constants.mjs var STORE_NAME = "core/edit-post"; var VIEW_AS_LINK_SELECTOR = "#wp-admin-bar-view a"; var VIEW_AS_PREVIEW_LINK_SELECTOR = "#wp-admin-bar-preview a"; // packages/edit-post/build-module/components/editor-initialization/listener-hooks.mjs var useUpdatePostLinkListener = () => { const { isViewable, newPermalink } = (0, import_data3.useSelect)((select3) => { const { getPostType } = select3(import_core_data2.store); const { getCurrentPost, getEditedPostAttribute } = select3(import_editor3.store); const postType = getPostType(getEditedPostAttribute("type")); return { isViewable: postType?.viewable, newPermalink: getCurrentPost().link }; }, []); const nodeToUpdateRef = (0, import_element2.useRef)(); (0, import_element2.useEffect)(() => { nodeToUpdateRef.current = document.querySelector(VIEW_AS_PREVIEW_LINK_SELECTOR) || document.querySelector(VIEW_AS_LINK_SELECTOR); }, []); (0, import_element2.useEffect)(() => { if (!newPermalink || !nodeToUpdateRef.current) { return; } if (!isViewable) { nodeToUpdateRef.current.style.display = "none"; return; } nodeToUpdateRef.current.style.display = ""; nodeToUpdateRef.current.setAttribute("href", newPermalink); }, [newPermalink, isViewable]); }; // packages/edit-post/build-module/components/editor-initialization/index.mjs function EditorInitialization() { useUpdatePostLinkListener(); return null; } // packages/edit-post/build-module/components/keyboard-shortcuts/index.mjs var import_element3 = __toESM(require_element(), 1); var import_data7 = __toESM(require_data(), 1); var import_keyboard_shortcuts = __toESM(require_keyboard_shortcuts(), 1); var import_i18n3 = __toESM(require_i18n(), 1); // packages/edit-post/build-module/store/index.mjs var import_data6 = __toESM(require_data(), 1); // packages/edit-post/build-module/store/reducer.mjs var import_data4 = __toESM(require_data(), 1); function isSavingMetaBoxes(state = false, action) { switch (action.type) { case "REQUEST_META_BOX_UPDATES": return true; case "META_BOX_UPDATES_SUCCESS": case "META_BOX_UPDATES_FAILURE": return false; default: return state; } } function mergeMetaboxes(metaboxes = [], newMetaboxes) { const mergedMetaboxes = [...metaboxes]; for (const metabox of newMetaboxes) { const existing = mergedMetaboxes.findIndex( (box) => box.id === metabox.id ); if (existing !== -1) { mergedMetaboxes[existing] = { ...mergedMetaboxes[existing], ...metabox }; } else { mergedMetaboxes.push(metabox); } } return mergedMetaboxes; } function metaBoxLocations(state = {}, action) { switch (action.type) { case "SET_META_BOXES_PER_LOCATIONS": { const newState = { ...state }; for (const [location, metaboxes] of Object.entries( action.metaBoxesPerLocation )) { newState[location] = mergeMetaboxes( newState[location], metaboxes ); } return newState; } } return state; } function metaBoxesInitialized(state = false, action) { switch (action.type) { case "META_BOXES_INITIALIZED": return true; } return state; } var metaBoxes = (0, import_data4.combineReducers)({ isSaving: isSavingMetaBoxes, locations: metaBoxLocations, initialized: metaBoxesInitialized }); var reducer_default = (0, import_data4.combineReducers)({ metaBoxes }); // packages/edit-post/build-module/store/actions.mjs var actions_exports = {}; __export(actions_exports, { __experimentalSetPreviewDeviceType: () => __experimentalSetPreviewDeviceType, __unstableCreateTemplate: () => __unstableCreateTemplate, closeGeneralSidebar: () => closeGeneralSidebar, closeModal: () => closeModal, closePublishSidebar: () => closePublishSidebar, hideBlockTypes: () => hideBlockTypes, initializeMetaBoxes: () => initializeMetaBoxes, metaBoxUpdatesFailure: () => metaBoxUpdatesFailure, metaBoxUpdatesSuccess: () => metaBoxUpdatesSuccess, openGeneralSidebar: () => openGeneralSidebar, openModal: () => openModal, openPublishSidebar: () => openPublishSidebar, removeEditorPanel: () => removeEditorPanel, requestMetaBoxUpdates: () => requestMetaBoxUpdates, setAvailableMetaBoxesPerLocation: () => setAvailableMetaBoxesPerLocation, setIsEditingTemplate: () => setIsEditingTemplate, setIsInserterOpened: () => setIsInserterOpened, setIsListViewOpened: () => setIsListViewOpened, showBlockTypes: () => showBlockTypes, switchEditorMode: () => switchEditorMode, toggleDistractionFree: () => toggleDistractionFree, toggleEditorPanelEnabled: () => toggleEditorPanelEnabled, toggleEditorPanelOpened: () => toggleEditorPanelOpened, toggleFeature: () => toggleFeature, toggleFullscreenMode: () => toggleFullscreenMode, togglePinnedPluginItem: () => togglePinnedPluginItem, togglePublishSidebar: () => togglePublishSidebar, updatePreferredStyleVariations: () => updatePreferredStyleVariations }); var import_api_fetch = __toESM(require_api_fetch(), 1); var import_preferences = __toESM(require_preferences(), 1); var import_editor4 = __toESM(require_editor(), 1); var import_deprecated = __toESM(require_deprecated(), 1); var import_hooks = __toESM(require_hooks(), 1); var import_core_data3 = __toESM(require_core_data(), 1); var import_notices = __toESM(require_notices(), 1); var import_i18n2 = __toESM(require_i18n(), 1); // packages/edit-post/build-module/utils/meta-boxes.mjs var getMetaBoxContainer = (location) => { const area = document.querySelector( `.edit-post-meta-boxes-area.is-${location} .metabox-location-${location}` ); if (area) { return area; } return document.querySelector("#metaboxes .metabox-location-" + location); }; // packages/edit-post/build-module/store/actions.mjs var { interfaceStore } = unlock(import_editor4.privateApis); var openGeneralSidebar = (name) => ({ registry }) => { registry.dispatch(interfaceStore).enableComplementaryArea("core", name); }; var closeGeneralSidebar = () => ({ registry }) => registry.dispatch(interfaceStore).disableComplementaryArea("core"); var openModal = (name) => ({ registry }) => { (0, import_deprecated.default)("select( 'core/edit-post' ).openModal( name )", { since: "6.3", alternative: "select( 'core/interface').openModal( name )" }); return registry.dispatch(interfaceStore).openModal(name); }; var closeModal = () => ({ registry }) => { (0, import_deprecated.default)("select( 'core/edit-post' ).closeModal()", { since: "6.3", alternative: "select( 'core/interface').closeModal()" }); return registry.dispatch(interfaceStore).closeModal(); }; var openPublishSidebar = () => ({ registry }) => { (0, import_deprecated.default)("dispatch( 'core/edit-post' ).openPublishSidebar", { since: "6.6", alternative: "dispatch( 'core/editor').openPublishSidebar" }); registry.dispatch(import_editor4.store).openPublishSidebar(); }; var closePublishSidebar = () => ({ registry }) => { (0, import_deprecated.default)("dispatch( 'core/edit-post' ).closePublishSidebar", { since: "6.6", alternative: "dispatch( 'core/editor').closePublishSidebar" }); registry.dispatch(import_editor4.store).closePublishSidebar(); }; var togglePublishSidebar = () => ({ registry }) => { (0, import_deprecated.default)("dispatch( 'core/edit-post' ).togglePublishSidebar", { since: "6.6", alternative: "dispatch( 'core/editor').togglePublishSidebar" }); registry.dispatch(import_editor4.store).togglePublishSidebar(); }; var toggleEditorPanelEnabled = (panelName) => ({ registry }) => { (0, import_deprecated.default)("dispatch( 'core/edit-post' ).toggleEditorPanelEnabled", { since: "6.5", alternative: "dispatch( 'core/editor').toggleEditorPanelEnabled" }); registry.dispatch(import_editor4.store).toggleEditorPanelEnabled(panelName); }; var toggleEditorPanelOpened = (panelName) => ({ registry }) => { (0, import_deprecated.default)("dispatch( 'core/edit-post' ).toggleEditorPanelOpened", { since: "6.5", alternative: "dispatch( 'core/editor').toggleEditorPanelOpened" }); registry.dispatch(import_editor4.store).toggleEditorPanelOpened(panelName); }; var removeEditorPanel = (panelName) => ({ registry }) => { (0, import_deprecated.default)("dispatch( 'core/edit-post' ).removeEditorPanel", { since: "6.5", alternative: "dispatch( 'core/editor').removeEditorPanel" }); registry.dispatch(import_editor4.store).removeEditorPanel(panelName); }; var toggleFeature = (feature) => ({ registry }) => registry.dispatch(import_preferences.store).toggle("core/edit-post", feature); var switchEditorMode = (mode) => ({ registry }) => { (0, import_deprecated.default)("dispatch( 'core/edit-post' ).switchEditorMode", { since: "6.6", alternative: "dispatch( 'core/editor').switchEditorMode" }); registry.dispatch(import_editor4.store).switchEditorMode(mode); }; var togglePinnedPluginItem = (pluginName) => ({ registry }) => { const isPinned = registry.select(interfaceStore).isItemPinned("core", pluginName); registry.dispatch(interfaceStore)[isPinned ? "unpinItem" : "pinItem"]("core", pluginName); }; function updatePreferredStyleVariations() { (0, import_deprecated.default)("dispatch( 'core/edit-post' ).updatePreferredStyleVariations", { since: "6.6", hint: "Preferred Style Variations are not supported anymore." }); return { type: "NOTHING" }; } var showBlockTypes = (blockNames) => ({ registry }) => { unlock(registry.dispatch(import_editor4.store)).showBlockTypes(blockNames); }; var hideBlockTypes = (blockNames) => ({ registry }) => { unlock(registry.dispatch(import_editor4.store)).hideBlockTypes(blockNames); }; function setAvailableMetaBoxesPerLocation(metaBoxesPerLocation) { return { type: "SET_META_BOXES_PER_LOCATIONS", metaBoxesPerLocation }; } var requestMetaBoxUpdates = () => async ({ registry, select: select3, dispatch: dispatch2 }) => { dispatch2({ type: "REQUEST_META_BOX_UPDATES" }); if (window.tinyMCE) { window.tinyMCE.triggerSave(); } const baseFormData = new window.FormData( document.querySelector(".metabox-base-form") ); const postId = baseFormData.get("post_ID"); const postType = baseFormData.get("post_type"); const post = registry.select(import_core_data3.store).getEditedEntityRecord("postType", postType, postId); const additionalData = [ post.comment_status ? ["comment_status", post.comment_status] : false, post.ping_status ? ["ping_status", post.ping_status] : false, post.sticky ? ["sticky", post.sticky] : false, post.author ? ["post_author", post.author] : false ].filter(Boolean); const activeMetaBoxLocations = select3.getActiveMetaBoxLocations(); const formDataToMerge = [ baseFormData, ...activeMetaBoxLocations.map( (location) => new window.FormData(getMetaBoxContainer(location)) ) ]; const formData = formDataToMerge.reduce((memo, currentFormData) => { for (const [key, value] of currentFormData) { memo.append(key, value); } return memo; }, new window.FormData()); additionalData.forEach( ([key, value]) => formData.append(key, value) ); try { await (0, import_api_fetch.default)({ url: window._wpMetaBoxUrl, method: "POST", body: formData, parse: false }); dispatch2.metaBoxUpdatesSuccess(); } catch { dispatch2.metaBoxUpdatesFailure(); } }; function metaBoxUpdatesSuccess() { return { type: "META_BOX_UPDATES_SUCCESS" }; } function metaBoxUpdatesFailure() { return { type: "META_BOX_UPDATES_FAILURE" }; } var __experimentalSetPreviewDeviceType = (deviceType) => ({ registry }) => { (0, import_deprecated.default)( "dispatch( 'core/edit-post' ).__experimentalSetPreviewDeviceType", { since: "6.5", version: "6.7", hint: "registry.dispatch( editorStore ).setDeviceType" } ); registry.dispatch(import_editor4.store).setDeviceType(deviceType); }; var setIsInserterOpened = (value) => ({ registry }) => { (0, import_deprecated.default)("dispatch( 'core/edit-post' ).setIsInserterOpened", { since: "6.5", alternative: "dispatch( 'core/editor').setIsInserterOpened" }); registry.dispatch(import_editor4.store).setIsInserterOpened(value); }; var setIsListViewOpened = (isOpen) => ({ registry }) => { (0, import_deprecated.default)("dispatch( 'core/edit-post' ).setIsListViewOpened", { since: "6.5", alternative: "dispatch( 'core/editor').setIsListViewOpened" }); registry.dispatch(import_editor4.store).setIsListViewOpened(isOpen); }; function setIsEditingTemplate() { (0, import_deprecated.default)("dispatch( 'core/edit-post' ).setIsEditingTemplate", { since: "6.5", alternative: "dispatch( 'core/editor').setRenderingMode" }); return { type: "NOTHING" }; } function __unstableCreateTemplate() { (0, import_deprecated.default)("dispatch( 'core/edit-post' ).__unstableCreateTemplate", { since: "6.5" }); return { type: "NOTHING" }; } var metaBoxesInitialized2 = false; var initializeMetaBoxes = () => ({ registry, select: select3, dispatch: dispatch2 }) => { const isEditorReady = registry.select(import_editor4.store).__unstableIsEditorReady(); if (!isEditorReady) { return; } if (metaBoxesInitialized2) { return; } const postType = registry.select(import_editor4.store).getCurrentPostType(); if (window.postboxes.page !== postType) { window.postboxes.add_postbox_toggles(postType); } metaBoxesInitialized2 = true; (0, import_hooks.addAction)( "editor.savePost", "core/edit-post/save-metaboxes", async (post, options) => { if (!options.isAutosave && select3.hasMetaBoxes()) { await dispatch2.requestMetaBoxUpdates(); } } ); dispatch2({ type: "META_BOXES_INITIALIZED" }); }; var toggleDistractionFree = () => ({ registry }) => { (0, import_deprecated.default)("dispatch( 'core/edit-post' ).toggleDistractionFree", { since: "6.6", alternative: "dispatch( 'core/editor').toggleDistractionFree" }); registry.dispatch(import_editor4.store).toggleDistractionFree(); }; var toggleFullscreenMode = () => ({ registry }) => { const isFullscreen = registry.select(import_preferences.store).get("core/edit-post", "fullscreenMode"); registry.dispatch(import_preferences.store).toggle("core/edit-post", "fullscreenMode"); registry.dispatch(import_notices.store).createInfoNotice( isFullscreen ? (0, import_i18n2.__)("Fullscreen mode deactivated.") : (0, import_i18n2.__)("Fullscreen mode activated."), { id: "core/edit-post/toggle-fullscreen-mode/notice", type: "snackbar", actions: [ { label: (0, import_i18n2.__)("Undo"), onClick: () => { registry.dispatch(import_preferences.store).toggle( "core/edit-post", "fullscreenMode" ); } } ] } ); }; // packages/edit-post/build-module/store/selectors.mjs var selectors_exports = {}; __export(selectors_exports, { __experimentalGetInsertionPoint: () => __experimentalGetInsertionPoint, __experimentalGetPreviewDeviceType: () => __experimentalGetPreviewDeviceType, areMetaBoxesInitialized: () => areMetaBoxesInitialized, getActiveGeneralSidebarName: () => getActiveGeneralSidebarName, getActiveMetaBoxLocations: () => getActiveMetaBoxLocations, getAllMetaBoxes: () => getAllMetaBoxes, getEditedPostTemplate: () => getEditedPostTemplate, getEditorMode: () => getEditorMode, getHiddenBlockTypes: () => getHiddenBlockTypes, getMetaBoxesPerLocation: () => getMetaBoxesPerLocation, getPreference: () => getPreference, getPreferences: () => getPreferences, hasMetaBoxes: () => hasMetaBoxes, isEditingTemplate: () => isEditingTemplate, isEditorPanelEnabled: () => isEditorPanelEnabled, isEditorPanelOpened: () => isEditorPanelOpened, isEditorPanelRemoved: () => isEditorPanelRemoved, isEditorSidebarOpened: () => isEditorSidebarOpened, isFeatureActive: () => isFeatureActive, isInserterOpened: () => isInserterOpened, isListViewOpened: () => isListViewOpened, isMetaBoxLocationActive: () => isMetaBoxLocationActive, isMetaBoxLocationVisible: () => isMetaBoxLocationVisible, isModalActive: () => isModalActive, isPluginItemPinned: () => isPluginItemPinned, isPluginSidebarOpened: () => isPluginSidebarOpened, isPublishSidebarOpened: () => isPublishSidebarOpened, isSavingMetaBoxes: () => isSavingMetaBoxes2 }); var import_data5 = __toESM(require_data(), 1); var import_preferences2 = __toESM(require_preferences(), 1); var import_core_data4 = __toESM(require_core_data(), 1); var import_editor5 = __toESM(require_editor(), 1); var import_deprecated2 = __toESM(require_deprecated(), 1); var { interfaceStore: interfaceStore2 } = unlock(import_editor5.privateApis); var EMPTY_ARRAY = []; var EMPTY_OBJECT = {}; var getEditorMode = (0, import_data5.createRegistrySelector)( (select3) => () => select3(import_preferences2.store).get("core", "editorMode") ?? "visual" ); var isEditorSidebarOpened = (0, import_data5.createRegistrySelector)( (select3) => () => { const activeGeneralSidebar = select3(interfaceStore2).getActiveComplementaryArea("core"); return ["edit-post/document", "edit-post/block"].includes( activeGeneralSidebar ); } ); var isPluginSidebarOpened = (0, import_data5.createRegistrySelector)( (select3) => () => { const activeGeneralSidebar = select3(interfaceStore2).getActiveComplementaryArea("core"); return !!activeGeneralSidebar && !["edit-post/document", "edit-post/block"].includes( activeGeneralSidebar ); } ); var getActiveGeneralSidebarName = (0, import_data5.createRegistrySelector)( (select3) => () => { return select3(interfaceStore2).getActiveComplementaryArea("core"); } ); function convertPanelsToOldFormat(inactivePanels, openPanels) { const panelsWithEnabledState = inactivePanels?.reduce( (accumulatedPanels, panelName) => ({ ...accumulatedPanels, [panelName]: { enabled: false } }), {} ); const panels = openPanels?.reduce((accumulatedPanels, panelName) => { const currentPanelState = accumulatedPanels?.[panelName]; return { ...accumulatedPanels, [panelName]: { ...currentPanelState, opened: true } }; }, panelsWithEnabledState ?? {}); return panels ?? panelsWithEnabledState ?? EMPTY_OBJECT; } var getPreferences = (0, import_data5.createRegistrySelector)((select3) => () => { (0, import_deprecated2.default)(`select( 'core/edit-post' ).getPreferences`, { since: "6.0", alternative: `select( 'core/preferences' ).get` }); const corePreferences = ["editorMode", "hiddenBlockTypes"].reduce( (accumulatedPrefs, preferenceKey) => { const value = select3(import_preferences2.store).get( "core", preferenceKey ); return { ...accumulatedPrefs, [preferenceKey]: value }; }, {} ); const inactivePanels = select3(import_preferences2.store).get( "core", "inactivePanels" ); const openPanels = select3(import_preferences2.store).get("core", "openPanels"); const panels = convertPanelsToOldFormat(inactivePanels, openPanels); return { ...corePreferences, panels }; }); function getPreference(state, preferenceKey, defaultValue) { (0, import_deprecated2.default)(`select( 'core/edit-post' ).getPreference`, { since: "6.0", alternative: `select( 'core/preferences' ).get` }); const preferences = getPreferences(state); const value = preferences[preferenceKey]; return value === void 0 ? defaultValue : value; } var getHiddenBlockTypes = (0, import_data5.createRegistrySelector)((select3) => () => { return select3(import_preferences2.store).get("core", "hiddenBlockTypes") ?? EMPTY_ARRAY; }); var isPublishSidebarOpened = (0, import_data5.createRegistrySelector)( (select3) => () => { (0, import_deprecated2.default)(`select( 'core/edit-post' ).isPublishSidebarOpened`, { since: "6.6", alternative: `select( 'core/editor' ).isPublishSidebarOpened` }); return select3(import_editor5.store).isPublishSidebarOpened(); } ); var isEditorPanelRemoved = (0, import_data5.createRegistrySelector)( (select3) => (state, panelName) => { (0, import_deprecated2.default)(`select( 'core/edit-post' ).isEditorPanelRemoved`, { since: "6.5", alternative: `select( 'core/editor' ).isEditorPanelRemoved` }); return select3(import_editor5.store).isEditorPanelRemoved(panelName); } ); var isEditorPanelEnabled = (0, import_data5.createRegistrySelector)( (select3) => (state, panelName) => { (0, import_deprecated2.default)(`select( 'core/edit-post' ).isEditorPanelEnabled`, { since: "6.5", alternative: `select( 'core/editor' ).isEditorPanelEnabled` }); return select3(import_editor5.store).isEditorPanelEnabled(panelName); } ); var isEditorPanelOpened = (0, import_data5.createRegistrySelector)( (select3) => (state, panelName) => { (0, import_deprecated2.default)(`select( 'core/edit-post' ).isEditorPanelOpened`, { since: "6.5", alternative: `select( 'core/editor' ).isEditorPanelOpened` }); return select3(import_editor5.store).isEditorPanelOpened(panelName); } ); var isModalActive = (0, import_data5.createRegistrySelector)( (select3) => (state, modalName) => { (0, import_deprecated2.default)(`select( 'core/edit-post' ).isModalActive`, { since: "6.3", alternative: `select( 'core/interface' ).isModalActive` }); return !!select3(interfaceStore2).isModalActive(modalName); } ); var isFeatureActive = (0, import_data5.createRegistrySelector)( (select3) => (state, feature) => { return !!select3(import_preferences2.store).get("core/edit-post", feature); } ); var isPluginItemPinned = (0, import_data5.createRegistrySelector)( (select3) => (state, pluginName) => { return select3(interfaceStore2).isItemPinned("core", pluginName); } ); var getActiveMetaBoxLocations = (0, import_data5.createSelector)( (state) => { return Object.keys(state.metaBoxes.locations).filter( (location) => isMetaBoxLocationActive(state, location) ); }, (state) => [state.metaBoxes.locations] ); var isMetaBoxLocationVisible = (0, import_data5.createRegistrySelector)( (select3) => (state, location) => { return isMetaBoxLocationActive(state, location) && getMetaBoxesPerLocation(state, location)?.some(({ id }) => { return select3(import_editor5.store).isEditorPanelEnabled( `meta-box-${id}` ); }); } ); function isMetaBoxLocationActive(state, location) { const metaBoxes2 = getMetaBoxesPerLocation(state, location); return !!metaBoxes2 && metaBoxes2.length !== 0; } function getMetaBoxesPerLocation(state, location) { return state.metaBoxes.locations[location]; } var getAllMetaBoxes = (0, import_data5.createSelector)( (state) => { return Object.values(state.metaBoxes.locations).flat(); }, (state) => [state.metaBoxes.locations] ); function hasMetaBoxes(state) { return getActiveMetaBoxLocations(state).length > 0; } function isSavingMetaBoxes2(state) { return state.metaBoxes.isSaving; } var __experimentalGetPreviewDeviceType = (0, import_data5.createRegistrySelector)( (select3) => () => { (0, import_deprecated2.default)( `select( 'core/edit-site' ).__experimentalGetPreviewDeviceType`, { since: "6.5", version: "6.7", alternative: `select( 'core/editor' ).getDeviceType` } ); return select3(import_editor5.store).getDeviceType(); } ); var isInserterOpened = (0, import_data5.createRegistrySelector)((select3) => () => { (0, import_deprecated2.default)(`select( 'core/edit-post' ).isInserterOpened`, { since: "6.5", alternative: `select( 'core/editor' ).isInserterOpened` }); return select3(import_editor5.store).isInserterOpened(); }); var __experimentalGetInsertionPoint = (0, import_data5.createRegistrySelector)( (select3) => () => { (0, import_deprecated2.default)( `select( 'core/edit-post' ).__experimentalGetInsertionPoint`, { since: "6.5", version: "6.7" } ); return unlock(select3(import_editor5.store)).getInserter(); } ); var isListViewOpened = (0, import_data5.createRegistrySelector)((select3) => () => { (0, import_deprecated2.default)(`select( 'core/edit-post' ).isListViewOpened`, { since: "6.5", alternative: `select( 'core/editor' ).isListViewOpened` }); return select3(import_editor5.store).isListViewOpened(); }); var isEditingTemplate = (0, import_data5.createRegistrySelector)((select3) => () => { (0, import_deprecated2.default)(`select( 'core/edit-post' ).isEditingTemplate`, { since: "6.5", alternative: `select( 'core/editor' ).getRenderingMode` }); return select3(import_editor5.store).getCurrentPostType() === "wp_template"; }); function areMetaBoxesInitialized(state) { return state.metaBoxes.initialized; } var getEditedPostTemplate = (0, import_data5.createRegistrySelector)( (select3) => () => { const { id: postId, type: postType } = select3(import_editor5.store).getCurrentPost(); const templateId = unlock(select3(import_core_data4.store)).getTemplateId( postType, postId ); if (!templateId) { return void 0; } return select3(import_core_data4.store).getEditedEntityRecord( "postType", "wp_template", templateId ); } ); // packages/edit-post/build-module/store/index.mjs var store = (0, import_data6.createReduxStore)(STORE_NAME, { reducer: reducer_default, actions: actions_exports, selectors: selectors_exports }); (0, import_data6.register)(store); // packages/edit-post/build-module/components/keyboard-shortcuts/index.mjs function KeyboardShortcuts() { const { toggleFullscreenMode: toggleFullscreenMode2 } = (0, import_data7.useDispatch)(store); const { registerShortcut } = (0, import_data7.useDispatch)(import_keyboard_shortcuts.store); (0, import_element3.useEffect)(() => { registerShortcut({ name: "core/edit-post/toggle-fullscreen", category: "global", description: (0, import_i18n3.__)("Enable or disable fullscreen mode."), keyCombination: { modifier: "secondary", character: "f" } }); }, []); (0, import_keyboard_shortcuts.useShortcut)("core/edit-post/toggle-fullscreen", () => { toggleFullscreenMode2(); }); return null; } var keyboard_shortcuts_default = KeyboardShortcuts; // packages/edit-post/build-module/components/init-pattern-modal/index.mjs var import_data8 = __toESM(require_data(), 1); var import_i18n4 = __toESM(require_i18n(), 1); var import_components3 = __toESM(require_components(), 1); var import_element4 = __toESM(require_element(), 1); var import_editor6 = __toESM(require_editor(), 1); var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1); function InitPatternModal() { const { editPost } = (0, import_data8.useDispatch)(import_editor6.store); const [syncType, setSyncType] = (0, import_element4.useState)(void 0); const [title, setTitle] = (0, import_element4.useState)(""); const isNewPost = (0, import_data8.useSelect)( (select3) => select3(import_editor6.store).isCleanNewPost(), [] ); const [isModalOpen, setIsModalOpen] = (0, import_element4.useState)(() => isNewPost); if (!isNewPost) { return null; } return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_jsx_runtime9.Fragment, { children: isModalOpen && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)( import_components3.Modal, { title: (0, import_i18n4.__)("Create pattern"), onRequestClose: () => { setIsModalOpen(false); }, overlayClassName: "reusable-blocks-menu-items__convert-modal", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)( "form", { onSubmit: (event) => { event.preventDefault(); setIsModalOpen(false); editPost({ title, meta: { wp_pattern_sync_status: syncType } }); }, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_components3.__experimentalVStack, { spacing: "5", children: [ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)( import_components3.TextControl, { label: (0, import_i18n4.__)("Name"), value: title, onChange: setTitle, placeholder: (0, import_i18n4.__)("My pattern"), className: "patterns-create-modal__name-input", __next40pxDefaultSize: true } ), /* @__PURE__ */ (0, import_jsx_runtime9.jsx)( import_components3.ToggleControl, { label: (0, import_i18n4._x)("Synced", "pattern (singular)"), help: (0, import_i18n4.__)( "Sync this pattern across multiple locations." ), checked: !syncType, onChange: () => { setSyncType( !syncType ? "unsynced" : void 0 ); } } ), /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_components3.__experimentalHStack, { justify: "right", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)( import_components3.Button, { __next40pxDefaultSize: true, variant: "primary", type: "submit", disabled: !title, accessibleWhenDisabled: true, children: (0, import_i18n4.__)("Create") } ) }) ] }) } ) } ) }); } // packages/edit-post/build-module/components/browser-url/index.mjs var import_element5 = __toESM(require_element(), 1); var import_data9 = __toESM(require_data(), 1); var import_url2 = __toESM(require_url(), 1); var import_editor7 = __toESM(require_editor(), 1); function getPostEditURL(postId) { return (0, import_url2.addQueryArgs)("post.php", { post: postId, action: "edit" }); } function BrowserURL() { const [historyId, setHistoryId] = (0, import_element5.useState)(null); const { postId, postStatus } = (0, import_data9.useSelect)((select3) => { const { getCurrentPost } = select3(import_editor7.store); const post = getCurrentPost(); let { id, status, type } = post; const isTemplate = ["wp_template", "wp_template_part"].includes( type ); if (isTemplate) { id = post.wp_id; } return { postId: id, postStatus: status }; }, []); (0, import_element5.useEffect)(() => { if (postId && postId !== historyId && postStatus !== "auto-draft") { window.history.replaceState( { id: postId }, "Post " + postId, getPostEditURL(postId) ); setHistoryId(postId); } }, [postId, postStatus, historyId]); return null; } // packages/edit-post/build-module/components/meta-boxes/index.mjs var import_data12 = __toESM(require_data(), 1); // packages/edit-post/build-module/components/meta-boxes/meta-boxes-area/index.mjs var import_element6 = __toESM(require_element(), 1); var import_components4 = __toESM(require_components(), 1); var import_data10 = __toESM(require_data(), 1); var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1); function MetaBoxesArea({ location }) { const container = (0, import_element6.useRef)(null); const formRef = (0, import_element6.useRef)(null); (0, import_element6.useEffect)(() => { formRef.current = document.querySelector( ".metabox-location-" + location ); if (formRef.current) { container.current.appendChild(formRef.current); } return () => { if (formRef.current) { document.querySelector("#metaboxes").appendChild(formRef.current); } }; }, [location]); const isSaving = (0, import_data10.useSelect)((select3) => { return select3(store).isSavingMetaBoxes(); }, []); const classes = clsx_default("edit-post-meta-boxes-area", `is-${location}`, { "is-loading": isSaving }); return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: classes, children: [ isSaving && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_components4.Spinner, {}), /* @__PURE__ */ (0, import_jsx_runtime10.jsx)( "div", { className: "edit-post-meta-boxes-area__container", ref: container } ), /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "edit-post-meta-boxes-area__clear" }) ] }); } var meta_boxes_area_default = MetaBoxesArea; // packages/edit-post/build-module/components/meta-boxes/meta-box-visibility.mjs var import_element7 = __toESM(require_element(), 1); var import_data11 = __toESM(require_data(), 1); var import_editor8 = __toESM(require_editor(), 1); function MetaBoxVisibility({ id }) { const isVisible = (0, import_data11.useSelect)( (select3) => { return select3(import_editor8.store).isEditorPanelEnabled( `meta-box-${id}` ); }, [id] ); (0, import_element7.useEffect)(() => { const element = document.getElementById(id); if (!element) { return; } if (isVisible) { element.classList.remove("is-hidden"); } else { element.classList.add("is-hidden"); } }, [id, isVisible]); return null; } // packages/edit-post/build-module/components/meta-boxes/index.mjs var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1); function MetaBoxes({ location }) { const metaBoxes2 = (0, import_data12.useSelect)( (select3) => select3(store).getMetaBoxesPerLocation(location), [location] ); return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [ (metaBoxes2 ?? []).map(({ id }) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(MetaBoxVisibility, { id }, id)), /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(meta_boxes_area_default, { location }) ] }); } // packages/edit-post/build-module/components/more-menu/index.mjs var import_i18n10 = __toESM(require_i18n(), 1); var import_compose2 = __toESM(require_compose(), 1); var import_editor14 = __toESM(require_editor(), 1); var import_keycodes = __toESM(require_keycodes(), 1); var import_preferences8 = __toESM(require_preferences(), 1); // packages/edit-post/build-module/components/more-menu/manage-patterns-menu-item.mjs var import_components5 = __toESM(require_components(), 1); var import_core_data5 = __toESM(require_core_data(), 1); var import_data13 = __toESM(require_data(), 1); var import_i18n5 = __toESM(require_i18n(), 1); var import_url3 = __toESM(require_url(), 1); var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1); function ManagePatternsMenuItem() { const url = (0, import_data13.useSelect)((select3) => { const { canUser } = select3(import_core_data5.store); const defaultUrl = (0, import_url3.addQueryArgs)("edit.php", { post_type: "wp_block" }); const patternsUrl = (0, import_url3.addQueryArgs)("site-editor.php", { p: "/pattern" }); return canUser("create", { kind: "postType", name: "wp_template" }) ? patternsUrl : defaultUrl; }, []); return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_components5.MenuItem, { role: "menuitem", href: url, children: (0, import_i18n5.__)("Manage patterns") }); } var manage_patterns_menu_item_default = ManagePatternsMenuItem; // packages/edit-post/build-module/components/more-menu/welcome-guide-menu-item.mjs var import_data14 = __toESM(require_data(), 1); var import_preferences3 = __toESM(require_preferences(), 1); var import_i18n6 = __toESM(require_i18n(), 1); var import_editor9 = __toESM(require_editor(), 1); var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1); function WelcomeGuideMenuItem() { const isEditingTemplate2 = (0, import_data14.useSelect)( (select3) => select3(import_editor9.store).getCurrentPostType() === "wp_template", [] ); return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)( import_preferences3.PreferenceToggleMenuItem, { scope: "core/edit-post", name: isEditingTemplate2 ? "welcomeGuideTemplate" : "welcomeGuide", label: (0, import_i18n6.__)("Welcome Guide") } ); } // packages/edit-post/build-module/components/preferences-modal/index.mjs var import_i18n9 = __toESM(require_i18n(), 1); var import_preferences7 = __toESM(require_preferences(), 1); var import_editor13 = __toESM(require_editor(), 1); // packages/edit-post/build-module/components/preferences-modal/meta-boxes-section.mjs var import_i18n8 = __toESM(require_i18n(), 1); var import_data17 = __toESM(require_data(), 1); var import_editor12 = __toESM(require_editor(), 1); var import_preferences6 = __toESM(require_preferences(), 1); // packages/edit-post/build-module/components/preferences-modal/enable-custom-fields.mjs var import_element8 = __toESM(require_element(), 1); var import_i18n7 = __toESM(require_i18n(), 1); var import_components6 = __toESM(require_components(), 1); var import_data15 = __toESM(require_data(), 1); var import_editor10 = __toESM(require_editor(), 1); var import_preferences4 = __toESM(require_preferences(), 1); var import_url4 = __toESM(require_url(), 1); var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1); var { PreferenceBaseOption } = unlock(import_preferences4.privateApis); function submitCustomFieldsForm() { const customFieldsForm = document.getElementById( "toggle-custom-fields-form" ); customFieldsForm.querySelector('[name="_wp_http_referer"]').setAttribute("value", (0, import_url4.getPathAndQueryString)(window.location.href)); customFieldsForm.submit(); } function CustomFieldsConfirmation({ willEnable }) { const [isReloading, setIsReloading] = (0, import_element8.useState)(false); return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "edit-post-preferences-modal__custom-fields-confirmation-message", children: (0, import_i18n7.__)( "A page reload is required for this change. Make sure your content is saved before reloading." ) }), /* @__PURE__ */ (0, import_jsx_runtime14.jsx)( import_components6.Button, { __next40pxDefaultSize: true, variant: "secondary", isBusy: isReloading, accessibleWhenDisabled: true, disabled: isReloading, onClick: () => { setIsReloading(true); submitCustomFieldsForm(); }, children: willEnable ? (0, import_i18n7.__)("Show & Reload Page") : (0, import_i18n7.__)("Hide & Reload Page") } ) ] }); } function EnableCustomFieldsOption({ label }) { const areCustomFieldsEnabled = (0, import_data15.useSelect)((select3) => { return !!select3(import_editor10.store).getEditorSettings().enableCustomFields; }, []); const [isChecked, setIsChecked] = (0, import_element8.useState)(areCustomFieldsEnabled); return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)( PreferenceBaseOption, { label, isChecked, onChange: setIsChecked, children: isChecked !== areCustomFieldsEnabled && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CustomFieldsConfirmation, { willEnable: isChecked }) } ); } // packages/edit-post/build-module/components/preferences-modal/enable-panel.mjs var import_data16 = __toESM(require_data(), 1); var import_editor11 = __toESM(require_editor(), 1); var import_preferences5 = __toESM(require_preferences(), 1); var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1); var { PreferenceBaseOption: PreferenceBaseOption2 } = unlock(import_preferences5.privateApis); function EnablePanelOption(props) { const { toggleEditorPanelEnabled: toggleEditorPanelEnabled2 } = (0, import_data16.useDispatch)(import_editor11.store); const { isChecked, isRemoved } = (0, import_data16.useSelect)( (select3) => { const { isEditorPanelEnabled: isEditorPanelEnabled2, isEditorPanelRemoved: isEditorPanelRemoved2 } = select3(import_editor11.store); return { isChecked: isEditorPanelEnabled2(props.panelName), isRemoved: isEditorPanelRemoved2(props.panelName) }; }, [props.panelName] ); if (isRemoved) { return null; } return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)( PreferenceBaseOption2, { isChecked, onChange: () => toggleEditorPanelEnabled2(props.panelName), ...props } ); } // packages/edit-post/build-module/components/preferences-modal/meta-boxes-section.mjs var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1); var { PreferencesModalSection } = unlock(import_preferences6.privateApis); function MetaBoxesSection({ areCustomFieldsRegistered, metaBoxes: metaBoxes2, ...sectionProps }) { const thirdPartyMetaBoxes = metaBoxes2.filter( ({ id }) => id !== "postcustom" ); if (!areCustomFieldsRegistered && thirdPartyMetaBoxes.length === 0) { return null; } return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(PreferencesModalSection, { ...sectionProps, children: [ areCustomFieldsRegistered && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(EnableCustomFieldsOption, { label: (0, import_i18n8.__)("Custom fields") }), thirdPartyMetaBoxes.map(({ id, title }) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)( EnablePanelOption, { label: title, panelName: `meta-box-${id}` }, id )) ] }); } var meta_boxes_section_default = (0, import_data17.withSelect)((select3) => { const { getEditorSettings } = select3(import_editor12.store); const { getAllMetaBoxes: getAllMetaBoxes2 } = select3(store); return { // This setting should not live in the block editor's store. areCustomFieldsRegistered: getEditorSettings().enableCustomFields !== void 0, metaBoxes: getAllMetaBoxes2() }; })(MetaBoxesSection); // packages/edit-post/build-module/components/preferences-modal/index.mjs var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1); var { PreferenceToggleControl } = unlock(import_preferences7.privateApis); var { PreferencesModal } = unlock(import_editor13.privateApis); function EditPostPreferencesModal() { const extraSections = { general: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(meta_boxes_section_default, { title: (0, import_i18n9.__)("Advanced") }), appearance: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)( PreferenceToggleControl, { scope: "core/edit-post", featureName: "themeStyles", help: (0, import_i18n9.__)("Make the editor look like your theme."), label: (0, import_i18n9.__)("Use theme styles") } ) }; return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(PreferencesModal, { extraSections }); } // packages/edit-post/build-module/components/more-menu/index.mjs var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1); var { ToolsMoreMenuGroup, ViewMoreMenuGroup } = unlock(import_editor14.privateApis); var MoreMenu = () => { const isLargeViewport = (0, import_compose2.useViewportMatch)("large"); return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [ isLargeViewport && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ViewMoreMenuGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)( import_preferences8.PreferenceToggleMenuItem, { scope: "core/edit-post", name: "fullscreenMode", label: (0, import_i18n10.__)("Fullscreen mode"), info: (0, import_i18n10.__)("Show and hide the admin user interface"), messageActivated: (0, import_i18n10.__)("Fullscreen mode activated."), messageDeactivated: (0, import_i18n10.__)( "Fullscreen mode deactivated." ), shortcut: import_keycodes.displayShortcut.secondary("f") } ) }), /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(ToolsMoreMenuGroup, { children: [ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(manage_patterns_menu_item_default, {}), /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(WelcomeGuideMenuItem, {}) ] }), /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(EditPostPreferencesModal, {}) ] }); }; var more_menu_default = MoreMenu; // packages/edit-post/build-module/components/welcome-guide/index.mjs var import_data20 = __toESM(require_data(), 1); // packages/edit-post/build-module/components/welcome-guide/default.mjs var import_data18 = __toESM(require_data(), 1); var import_components7 = __toESM(require_components(), 1); var import_i18n11 = __toESM(require_i18n(), 1); var import_element9 = __toESM(require_element(), 1); // packages/edit-post/build-module/components/welcome-guide/image.mjs var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1); function WelcomeGuideImage({ nonAnimatedSrc, animatedSrc }) { return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("picture", { className: "edit-post-welcome-guide__image", children: [ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)( "source", { srcSet: nonAnimatedSrc, media: "(prefers-reduced-motion: reduce)" } ), /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("img", { src: animatedSrc, width: "312", height: "240", alt: "" }) ] }); } // packages/edit-post/build-module/components/welcome-guide/default.mjs var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1); function WelcomeGuideDefault() { const { toggleFeature: toggleFeature2 } = (0, import_data18.useDispatch)(store); return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)( import_components7.Guide, { className: "edit-post-welcome-guide", contentLabel: (0, import_i18n11.__)("Welcome to the editor"), finishButtonText: (0, import_i18n11.__)("Get started"), onFinish: () => toggleFeature2("welcomeGuide"), pages: [ { image: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)( WelcomeGuideImage, { nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-canvas.svg", animatedSrc: "https://s.w.org/images/block-editor/welcome-canvas.gif" } ), content: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("h1", { className: "edit-post-welcome-guide__heading", children: (0, import_i18n11.__)("Welcome to the editor") }), /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "edit-post-welcome-guide__text", children: (0, import_i18n11.__)( "In the WordPress editor, each paragraph, image, or video is presented as a distinct \u201Cblock\u201D of content." ) }) ] }) }, { image: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)( WelcomeGuideImage, { nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-editor.svg", animatedSrc: "https://s.w.org/images/block-editor/welcome-editor.gif" } ), content: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("h1", { className: "edit-post-welcome-guide__heading", children: (0, import_i18n11.__)("Customize each block") }), /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "edit-post-welcome-guide__text", children: (0, import_i18n11.__)( "Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected." ) }) ] }) }, { image: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)( WelcomeGuideImage, { nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-library.svg", animatedSrc: "https://s.w.org/images/block-editor/welcome-library.gif" } ), content: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("h1", { className: "edit-post-welcome-guide__heading", children: (0, import_i18n11.__)("Explore all blocks") }), /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "edit-post-welcome-guide__text", children: (0, import_element9.createInterpolateElement)( (0, import_i18n11.__)( "All of the blocks available to you live in the block library. You\u2019ll find it wherever you see the <InserterIconImage /> icon." ), { InserterIconImage: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)( "img", { alt: (0, import_i18n11.__)("inserter"), src: "data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='18' height='18' rx='2' fill='%231E1E1E'/%3E%3Cpath d='M9.22727 4V14M4 8.77273H14' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E%0A" } ) } ) }) ] }) }, { image: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)( WelcomeGuideImage, { nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-documentation.svg", animatedSrc: "https://s.w.org/images/block-editor/welcome-documentation.gif" } ), content: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("h1", { className: "edit-post-welcome-guide__heading", children: (0, import_i18n11.__)("Learn more") }), /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "edit-post-welcome-guide__text", children: (0, import_element9.createInterpolateElement)( (0, import_i18n11.__)( "New to the block editor? Want to learn more about using it? <a>Here's a detailed guide.</a>" ), { a: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)( import_components7.ExternalLink, { href: (0, import_i18n11.__)( "https://wordpress.org/documentation/article/wordpress-block-editor/" ) } ) } ) }) ] }) } ] } ); } // packages/edit-post/build-module/components/welcome-guide/template.mjs var import_data19 = __toESM(require_data(), 1); var import_components8 = __toESM(require_components(), 1); var import_i18n12 = __toESM(require_i18n(), 1); var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1); function WelcomeGuideTemplate() { const { toggleFeature: toggleFeature2 } = (0, import_data19.useDispatch)(store); return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)( import_components8.Guide, { className: "edit-template-welcome-guide", contentLabel: (0, import_i18n12.__)("Welcome to the template editor"), finishButtonText: (0, import_i18n12.__)("Get started"), onFinish: () => toggleFeature2("welcomeGuideTemplate"), pages: [ { image: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)( WelcomeGuideImage, { nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-template-editor.svg", animatedSrc: "https://s.w.org/images/block-editor/welcome-template-editor.gif" } ), content: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h1", { className: "edit-post-welcome-guide__heading", children: (0, import_i18n12.__)("Welcome to the template editor") }), /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "edit-post-welcome-guide__text", children: (0, import_i18n12.__)( "Templates help define the layout of the site. You can customize all aspects of your posts and pages using blocks and patterns in this editor." ) }) ] }) } ] } ); } // packages/edit-post/build-module/components/welcome-guide/index.mjs var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1); function WelcomeGuide({ postType }) { const { isActive, isEditingTemplate: isEditingTemplate2 } = (0, import_data20.useSelect)( (select3) => { const { isFeatureActive: isFeatureActive2 } = select3(store); const _isEditingTemplate = postType === "wp_template"; const feature = _isEditingTemplate ? "welcomeGuideTemplate" : "welcomeGuide"; return { isActive: isFeatureActive2(feature), isEditingTemplate: _isEditingTemplate }; }, [postType] ); if (!isActive) { return null; } return isEditingTemplate2 ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(WelcomeGuideTemplate, {}) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(WelcomeGuideDefault, {}); } // packages/edit-post/build-module/commands/use-commands.mjs var import_data21 = __toESM(require_data(), 1); var import_i18n13 = __toESM(require_i18n(), 1); var import_commands = __toESM(require_commands(), 1); var import_preferences9 = __toESM(require_preferences(), 1); var import_notices2 = __toESM(require_notices(), 1); function useCommands() { const { isFullscreen } = (0, import_data21.useSelect)((select3) => { const { get } = select3(import_preferences9.store); return { isFullscreen: get("core/edit-post", "fullscreenMode") }; }, []); const { toggle } = (0, import_data21.useDispatch)(import_preferences9.store); const { createInfoNotice } = (0, import_data21.useDispatch)(import_notices2.store); (0, import_commands.useCommand)({ name: "core/toggle-fullscreen-mode", label: isFullscreen ? (0, import_i18n13.__)("Exit fullscreen") : (0, import_i18n13.__)("Enter fullscreen"), icon: fullscreen_default, category: "command", callback: ({ close }) => { toggle("core/edit-post", "fullscreenMode"); close(); createInfoNotice( isFullscreen ? (0, import_i18n13.__)("Fullscreen off.") : (0, import_i18n13.__)("Fullscreen on."), { id: "core/edit-post/toggle-fullscreen-mode/notice", type: "snackbar", actions: [ { label: (0, import_i18n13.__)("Undo"), onClick: () => { toggle("core/edit-post", "fullscreenMode"); } } ] } ); } }); } // packages/edit-post/build-module/components/layout/use-should-iframe.mjs var import_editor15 = __toESM(require_editor(), 1); var import_data22 = __toESM(require_data(), 1); var import_blocks2 = __toESM(require_blocks(), 1); var import_block_editor = __toESM(require_block_editor(), 1); var isGutenbergPlugin = false ? true : false; function useShouldIframe() { return (0, import_data22.useSelect)((select3) => { const { getCurrentPostType, getDeviceType } = select3(import_editor15.store); const { getClientIdsWithDescendants, getBlockName } = select3(import_block_editor.store); const { getBlockType } = select3(import_blocks2.store); return ( // If the Gutenberg plugin is active, we ALWAYS use the iframe for // consistency across the post and site editor. We plan on enforcing // the iframe in the future, so Gutenberg both serves as way for us // to warn plugin developers and for plugin developers to test their // blocks easily. Before GB v22.5, we only enforced it for // block-based themes (classic themes used the same rules as core). isGutenbergPlugin || // We also still want to iframe all the special // editor features and modes such as device previews, zoom out, and // template/pattern editing. getDeviceType() !== "Desktop" || ["wp_template", "wp_block"].includes(getCurrentPostType()) || unlock(select3(import_block_editor.store)).isZoomOut() || // Finally, still iframe the editor if all present blocks are v3 // (which means they are marked as iframe-compatible). [...new Set(getClientIdsWithDescendants().map(getBlockName))].map(getBlockType).filter(Boolean).every((blockType) => blockType.apiVersion >= 3) ); }, []); } // packages/edit-post/build-module/hooks/use-navigate-to-entity-record.mjs var import_element10 = __toESM(require_element(), 1); var import_data23 = __toESM(require_data(), 1); var import_editor16 = __toESM(require_editor(), 1); var import_core_data6 = __toESM(require_core_data(), 1); function useNavigateToEntityRecord(initialPostId, initialPostType, defaultRenderingMode) { const registry = (0, import_data23.useRegistry)(); const [postHistory, dispatch2] = (0, import_element10.useReducer)( (historyState, { type, post: post2, previousRenderingMode: previousRenderingMode2, selectedBlockClientId }) => { if (type === "push") { const updatedHistory = [...historyState]; const currentIndex = updatedHistory.length - 1; updatedHistory[currentIndex] = { ...updatedHistory[currentIndex], selectedBlockClientId }; return [...updatedHistory, { post: post2, previousRenderingMode: previousRenderingMode2 }]; } if (type === "pop") { if (historyState.length > 1) { return historyState.slice(0, -1); } } return historyState; }, [ { post: { postId: initialPostId, postType: initialPostType } } ] ); const { post, previousRenderingMode } = postHistory[postHistory.length - 1]; const { getRenderingMode } = (0, import_data23.useSelect)(import_editor16.store); const { setRenderingMode } = (0, import_data23.useDispatch)(import_editor16.store); const { editEntityRecord } = (0, import_data23.useDispatch)(import_core_data6.store); const onNavigateToEntityRecord = (0, import_element10.useCallback)( (params) => { const entityEdits = registry.select(import_core_data6.store).getEntityRecordEdits("postType", post.postType, post.postId); const externalClientId = entityEdits?.selection?.selectionStart?.clientId ?? null; dispatch2({ type: "push", post: { postId: params.postId, postType: params.postType }, // Save the current rendering mode so we can restore it when navigating back. previousRenderingMode: getRenderingMode(), selectedBlockClientId: externalClientId }); setRenderingMode(defaultRenderingMode); }, [ registry, post.postType, post.postId, getRenderingMode, setRenderingMode, defaultRenderingMode ] ); const onNavigateToPreviousEntityRecord = (0, import_element10.useCallback)(() => { if (postHistory.length > 1) { const previousItem = postHistory[postHistory.length - 2]; if (previousItem.selectedBlockClientId) { editEntityRecord( "postType", previousItem.post.postType, previousItem.post.postId, { selection: { selectionStart: { clientId: previousItem.selectedBlockClientId }, selectionEnd: { clientId: previousItem.selectedBlockClientId } } }, { undoIgnore: true } ); } } dispatch2({ type: "pop" }); if (previousRenderingMode) { setRenderingMode(previousRenderingMode); } }, [ setRenderingMode, previousRenderingMode, postHistory, editEntityRecord ]); return { currentPost: post, onNavigateToEntityRecord, onNavigateToPreviousEntityRecord: postHistory.length > 1 ? onNavigateToPreviousEntityRecord : void 0 }; } // packages/edit-post/build-module/components/meta-boxes/use-meta-box-initialization.mjs var import_data24 = __toESM(require_data(), 1); var import_editor17 = __toESM(require_editor(), 1); var import_core_data7 = __toESM(require_core_data(), 1); var import_element11 = __toESM(require_element(), 1); var useMetaBoxInitialization = (enabled) => { const { isEnabledAndEditorReady, isCollaborationEnabled, hasIncompatibleMetaBoxes, hasActiveMetaBoxes } = (0, import_data24.useSelect)( (select3) => { const { __unstableIsEditorReady, isCollaborationEnabledForCurrentPost } = unlock(select3(import_editor17.store)); return { isEnabledAndEditorReady: enabled && __unstableIsEditorReady(), isCollaborationEnabled: isCollaborationEnabledForCurrentPost(), hasIncompatibleMetaBoxes: enabled ? select3(store).getAllMetaBoxes().some((metaBox) => !metaBox.__rtc_compatible) : false, hasActiveMetaBoxes: enabled && select3(store).hasMetaBoxes() }; }, [enabled] ); const { setCollaborationSupported } = unlock((0, import_data24.useDispatch)(import_core_data7.store)); const { updateEditorSettings } = (0, import_data24.useDispatch)(import_editor17.store); const { initializeMetaBoxes: initializeMetaBoxes2 } = (0, import_data24.useDispatch)(store); (0, import_element11.useEffect)(() => { if (isEnabledAndEditorReady) { initializeMetaBoxes2(); if (isCollaborationEnabled && hasIncompatibleMetaBoxes) { setCollaborationSupported(false); } if (hasActiveMetaBoxes) { updateEditorSettings({ disableVisualRevisions: true }); } } }, [ isEnabledAndEditorReady, initializeMetaBoxes2, isCollaborationEnabled, setCollaborationSupported, hasIncompatibleMetaBoxes, hasActiveMetaBoxes, updateEditorSettings ]); }; // packages/edit-post/build-module/components/layout/index.mjs var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1); var { useCommandContext } = unlock(import_commands2.privateApis); var { useDrag } = unlock(import_components9.privateApis); var { Editor, FullscreenMode } = unlock(import_editor18.privateApis); var { BlockKeyboardShortcuts } = unlock(import_block_library.privateApis); var DESIGN_POST_TYPES = [ "wp_template", "wp_template_part", "wp_block", "wp_navigation" ]; function useEditorStyles(settings) { const { hasThemeStyleSupport } = (0, import_data25.useSelect)((select3) => { return { hasThemeStyleSupport: select3(store).isFeatureActive("themeStyles") }; }, []); return (0, import_element12.useMemo)(() => { const presetStyles = settings.styles?.filter( (style) => style.__unstableType && style.__unstableType !== "theme" ) ?? []; const defaultEditorStyles = [ ...settings?.defaultEditorStyles ?? [], ...presetStyles ]; const hasThemeStyles = hasThemeStyleSupport && presetStyles.length !== (settings.styles?.length ?? 0); if (!settings.disableLayoutStyles && !hasThemeStyles) { defaultEditorStyles.push({ css: getLayoutStyles({ style: {}, selector: "body", hasBlockGapSupport: false, hasFallbackGapSupport: true, fallbackGapValue: "0.5em" }) }); } return hasThemeStyles ? settings.styles ?? [] : defaultEditorStyles; }, [ settings.defaultEditorStyles, settings.disableLayoutStyles, settings.styles, hasThemeStyleSupport ]); } function MetaBoxesMain({ isLegacy }) { const [isOpen, openHeight, hasAnyVisible] = (0, import_data25.useSelect)((select3) => { const { get } = select3(import_preferences10.store); const { isMetaBoxLocationVisible: isMetaBoxLocationVisible2 } = select3(store); return [ !!get("core/edit-post", "metaBoxesMainIsOpen"), get("core/edit-post", "metaBoxesMainOpenHeight"), isMetaBoxLocationVisible2("normal") || isMetaBoxLocationVisible2("advanced") || isMetaBoxLocationVisible2("side") ]; }, []); const { set: setPreference } = (0, import_data25.useDispatch)(import_preferences10.store); const isShort = (0, import_compose3.useMediaQuery)("(max-height: 549px)"); const [{ min = 0, max }, setHeightConstraints] = (0, import_element12.useState)(() => ({})); const effectSizeConstraints = (0, import_compose3.useRefEffect)((node) => { const container = node.closest( ".interface-interface-skeleton__content" ); if (!container) { return; } const noticeLists = container.querySelectorAll( ":scope > .components-notice-list" ); const resizeHandle = container.querySelector( ".edit-post-meta-boxes-main__presenter" ); const deriveConstraints = () => { const fullHeight = container.offsetHeight; let nextMax = fullHeight; for (const element of noticeLists) { nextMax -= element.offsetHeight; } const nextMin = resizeHandle.offsetHeight; setHeightConstraints({ min: nextMin, max: nextMax }); }; const observer = new window.ResizeObserver(deriveConstraints); observer.observe(container); for (const element of noticeLists) { observer.observe(element); } return () => observer.disconnect(); }, []); const metaBoxesMainRef = (0, import_element12.useRef)(); const setMainRefs = (0, import_compose3.useMergeRefs)([ metaBoxesMainRef, effectSizeConstraints ]); const separatorRef = (0, import_element12.useRef)(); const separatorHelpId = (0, import_element12.useId)(); const heightRef = (0, import_element12.useRef)(); const applyHeight = (candidateHeight = "auto", isPersistent) => { let styleHeight; if (candidateHeight === "auto") { isPersistent = false; styleHeight = candidateHeight; } else { candidateHeight = Math.min(max, Math.max(min, candidateHeight)); heightRef.current = candidateHeight; styleHeight = `${candidateHeight}px`; } if (isPersistent) { setPreference( "core/edit-post", "metaBoxesMainOpenHeight", candidateHeight ); } else { metaBoxesMainRef.current.style.height = styleHeight; if (!isShort) { separatorRef.current.ariaValueNow = getAriaValueNow(candidateHeight); } } }; const bindDragGesture = useDrag( ({ movement, first, last, memo, tap, args }) => { const pane = metaBoxesMainRef.current; const [, yMovement] = movement; if (first) { pane.classList.add("is-resizing"); let fromHeight = heightRef.current ?? pane.offsetHeight; if (isOpen) { if (fromHeight > max) { fromHeight = max; } } else { fromHeight = min; } applyHeight(fromHeight - yMovement); return { fromHeight }; } if (!first && !last && !tap) { applyHeight(memo.fromHeight - yMovement); return memo; } pane.classList.remove("is-resizing"); if (tap) { const [onTap] = args; onTap?.(); return; } const nextIsOpen = heightRef.current > min; persistIsOpen(nextIsOpen); applyHeight(heightRef.current, nextIsOpen); }, { keyboardDisplacement: 20, filterTaps: true } ); if (!hasAnyVisible) { return; } const contents = /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)( "div", { className: "edit-post-layout__metaboxes edit-post-meta-boxes-main__liner", hidden: !isLegacy && !isOpen, children: [ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(MetaBoxes, { location: "normal" }), /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(MetaBoxes, { location: "advanced" }) ] } ); if (isLegacy) { return contents; } const isAutoHeight = openHeight === void 0; const usedOpenHeight = isShort ? "auto" : openHeight; const usedHeight = isOpen ? usedOpenHeight : min; const getAriaValueNow = (height) => Math.round((height - min) / (max - min) * 100); const usedAriaValueNow = max === void 0 || isAutoHeight ? 50 : getAriaValueNow(usedHeight); const persistIsOpen = (to = !isOpen) => setPreference("core/edit-post", "metaBoxesMainIsOpen", to); const paneLabel = (0, import_i18n14.__)("Meta Boxes"); const toggle = /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)( "button", { "aria-expanded": isOpen, onClick: ({ detail }) => { if (isShort || !detail) { persistIsOpen(); } }, ...!isShort && bindDragGesture(persistIsOpen), children: [ paneLabel, /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_components9.Icon, { icon: isOpen ? chevron_up_default : chevron_down_default }) ] } ); const separator = !isShort && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_components9.Tooltip, { text: (0, import_i18n14.__)("Drag to resize"), children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)( "button", { ref: separatorRef, role: "separator", "aria-valuenow": usedAriaValueNow, "aria-label": (0, import_i18n14.__)("Drag to resize"), "aria-describedby": separatorHelpId, ...bindDragGesture() } ) }), /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_components9.VisuallyHidden, { id: separatorHelpId, children: (0, import_i18n14.__)( "Use up and down arrow keys to resize the meta box pane." ) }) ] }); return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)( navigable_region_default, { "aria-label": paneLabel, ref: setMainRefs, className: clsx_default( "edit-post-meta-boxes-main", !isShort && "is-resizable" ), style: { height: usedHeight }, children: [ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "edit-post-meta-boxes-main__presenter", children: [ toggle, separator ] }), contents ] } ); } function Layout({ postId: initialPostId, postType: initialPostType, settings, initialEdits }) { useCommands(); const shouldIframe = useShouldIframe(); const { createErrorNotice } = (0, import_data25.useDispatch)(import_notices3.store); const { currentPost: { postId: currentPostId, postType: currentPostType }, onNavigateToEntityRecord, onNavigateToPreviousEntityRecord } = useNavigateToEntityRecord( initialPostId, initialPostType, "post-only" ); const isEditingTemplate2 = currentPostType === "wp_template"; const { mode, isFullscreenActive, hasResolvedMode, hasActiveMetaboxes, hasBlockSelected, showIconLabels, isDistractionFree, showMetaBoxes, isWelcomeGuideVisible, templateId, isDevicePreview } = (0, import_data25.useSelect)( (select3) => { const { get } = select3(import_preferences10.store); const { isFeatureActive: isFeatureActive2, hasMetaBoxes: hasMetaBoxes2 } = select3(store); const { canUser, getPostType, getTemplateId } = unlock( select3(import_core_data8.store) ); const supportsTemplateMode = settings.supportsTemplateMode; const isViewable = getPostType(currentPostType)?.viewable ?? false; const canViewTemplate = canUser("read", { kind: "postType", name: "wp_template" }); const { getBlockSelectionStart, isZoomOut } = unlock( select3(import_block_editor2.store) ); const { getEditorMode: getEditorMode2, getDefaultRenderingMode, getDeviceType } = unlock(select3(import_editor18.store)); const isNotDesignPostType = !DESIGN_POST_TYPES.includes(currentPostType); const isDirectlyEditingPattern = currentPostType === "wp_block" && !onNavigateToPreviousEntityRecord; const _templateId = getTemplateId(currentPostType, currentPostId); const defaultMode = getDefaultRenderingMode(currentPostType); return { mode: getEditorMode2(), isFullscreenActive: isFeatureActive2("fullscreenMode"), hasActiveMetaboxes: hasMetaBoxes2(), hasResolvedMode: defaultMode === "template-locked" ? !!_templateId : defaultMode !== void 0, hasBlockSelected: !!getBlockSelectionStart(), showIconLabels: get("core", "showIconLabels"), isDistractionFree: get("core", "distractionFree"), showMetaBoxes: isNotDesignPostType && !isZoomOut() || isDirectlyEditingPattern, isWelcomeGuideVisible: isFeatureActive2("welcomeGuide"), templateId: supportsTemplateMode && isViewable && canViewTemplate && !isEditingTemplate2 ? _templateId : null, isDevicePreview: getDeviceType() !== "Desktop" }; }, [ currentPostType, currentPostId, isEditingTemplate2, settings.supportsTemplateMode, onNavigateToPreviousEntityRecord ] ); useMetaBoxInitialization(hasActiveMetaboxes && hasResolvedMode); const commandContext = hasBlockSelected ? "block-selection-edit" : "entity-edit"; useCommandContext(commandContext); const styles = useEditorStyles(settings); const editorSettings = (0, import_element12.useMemo)( () => ({ ...settings, styles, onNavigateToEntityRecord, onNavigateToPreviousEntityRecord, defaultRenderingMode: "post-only" }), [ settings, styles, onNavigateToEntityRecord, onNavigateToPreviousEntityRecord ] ); if (showIconLabels) { document.body.classList.add("show-icon-labels"); } else { document.body.classList.remove("show-icon-labels"); } const navigateRegionsProps = (0, import_components9.__unstableUseNavigateRegions)(); const className = clsx_default("edit-post-layout", "is-mode-" + mode, { "has-metaboxes": hasActiveMetaboxes }); function onPluginAreaError(name) { createErrorNotice( (0, import_i18n14.sprintf)( /* translators: %s: plugin name */ (0, import_i18n14.__)( 'The "%s" plugin has encountered an error and cannot be rendered.' ), name ) ); } const { createSuccessNotice } = (0, import_data25.useDispatch)(import_notices3.store); const onActionPerformed = (0, import_element12.useCallback)( (actionId, items) => { switch (actionId) { case "move-to-trash": { document.location.href = (0, import_url5.addQueryArgs)("edit.php", { trashed: 1, post_type: items[0].type, ids: items[0].id }); } break; case "duplicate-post": { const newItem = items[0]; const title = typeof newItem.title === "string" ? newItem.title : newItem.title?.rendered; createSuccessNotice( (0, import_i18n14.sprintf)( // translators: %s: Title of the created post or template, e.g: "Hello world". (0, import_i18n14.__)('"%s" successfully created.'), (0, import_html_entities.decodeEntities)(title) || (0, import_i18n14.__)("(no title)") ), { type: "snackbar", id: "duplicate-post-action", actions: [ { label: (0, import_i18n14.__)("Edit"), onClick: () => { const postId = newItem.id; document.location.href = (0, import_url5.addQueryArgs)("post.php", { post: postId, action: "edit" }); } } ] } ); } break; } }, [createSuccessNotice] ); const initialPost = (0, import_element12.useMemo)(() => { return { type: initialPostType, id: initialPostId }; }, [initialPostType, initialPostId]); const backButton = (0, import_compose3.useViewportMatch)("medium") && isFullscreenActive ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(back_button_default, { initialPost }) : null; return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_components9.SlotFillProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_editor18.ErrorBoundary, { canCopyContent: true, children: [ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(WelcomeGuide, { postType: currentPostType }), /* @__PURE__ */ (0, import_jsx_runtime23.jsx)( "div", { className: navigateRegionsProps.className, ...navigateRegionsProps, ref: navigateRegionsProps.ref, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)( Editor, { settings: editorSettings, initialEdits, postType: currentPostType, postId: currentPostId, templateId, className, forceIsDirty: hasActiveMetaboxes, disableIframe: !shouldIframe, autoFocus: !isWelcomeGuideVisible, onActionPerformed, extraSidebarPanels: showMetaBoxes && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(MetaBoxes, { location: "side" }), extraContent: !isDistractionFree && showMetaBoxes && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(MetaBoxesMain, { isLegacy: isDevicePreview }), children: [ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_editor18.PostLockedModal, {}), /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(EditorInitialization, {}), /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(FullscreenMode, { isActive: isFullscreenActive }), /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(BrowserURL, {}), /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_editor18.UnsavedChangesWarning, {}), /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_editor18.AutosaveMonitor, {}), /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_editor18.LocalAutosaveMonitor, {}), /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(keyboard_shortcuts_default, {}), /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_editor18.EditorKeyboardShortcutsRegister, {}), /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(BlockKeyboardShortcuts, {}), currentPostType === "wp_block" && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(InitPatternModal, {}), /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_plugins.PluginArea, { onError: onPluginAreaError }), /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(more_menu_default, {}), backButton, /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_notices3.SnackbarNotices, { className: "edit-post-layout__snackbar" }) ] } ) } ) ] }) }); } var layout_default = Layout; // packages/edit-post/build-module/deprecated.mjs var import_editor19 = __toESM(require_editor(), 1); var import_url6 = __toESM(require_url(), 1); var import_deprecated3 = __toESM(require_deprecated(), 1); var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1); var { PluginPostExcerpt } = unlock(import_editor19.privateApis); var isSiteEditor = (0, import_url6.getPath)(window.location.href)?.includes( "site-editor.php" ); var deprecateSlot = (name) => { (0, import_deprecated3.default)(`wp.editPost.${name}`, { since: "6.6", alternative: `wp.editor.${name}` }); }; function PluginBlockSettingsMenuItem(props) { if (isSiteEditor) { return null; } deprecateSlot("PluginBlockSettingsMenuItem"); return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_editor19.PluginBlockSettingsMenuItem, { ...props }); } function PluginDocumentSettingPanel(props) { if (isSiteEditor) { return null; } deprecateSlot("PluginDocumentSettingPanel"); return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_editor19.PluginDocumentSettingPanel, { ...props }); } function PluginMoreMenuItem(props) { if (isSiteEditor) { return null; } deprecateSlot("PluginMoreMenuItem"); return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_editor19.PluginMoreMenuItem, { ...props }); } function PluginPrePublishPanel(props) { if (isSiteEditor) { return null; } deprecateSlot("PluginPrePublishPanel"); return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_editor19.PluginPrePublishPanel, { ...props }); } function PluginPostPublishPanel(props) { if (isSiteEditor) { return null; } deprecateSlot("PluginPostPublishPanel"); return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_editor19.PluginPostPublishPanel, { ...props }); } function PluginPostStatusInfo(props) { if (isSiteEditor) { return null; } deprecateSlot("PluginPostStatusInfo"); return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_editor19.PluginPostStatusInfo, { ...props }); } function PluginSidebar(props) { if (isSiteEditor) { return null; } deprecateSlot("PluginSidebar"); return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_editor19.PluginSidebar, { ...props }); } function PluginSidebarMoreMenuItem(props) { if (isSiteEditor) { return null; } deprecateSlot("PluginSidebarMoreMenuItem"); return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_editor19.PluginSidebarMoreMenuItem, { ...props }); } function __experimentalPluginPostExcerpt() { if (isSiteEditor) { return null; } (0, import_deprecated3.default)("wp.editPost.__experimentalPluginPostExcerpt", { since: "6.6", hint: "Core and custom panels can be access programmatically using their panel name.", link: "https://developer.wordpress.org/block-editor/reference-guides/slotfills/plugin-document-setting-panel/#accessing-a-panel-programmatically" }); return PluginPostExcerpt; } // packages/edit-post/build-module/index.mjs var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1); var { BackButton: __experimentalMainDashboardButton, registerCoreBlockBindingsSources } = unlock(import_editor20.privateApis); function initializeEditor(id, postType, postId, settings, initialEdits) { const isMediumOrBigger = window.matchMedia("(min-width: 782px)").matches; const target = document.getElementById(id); const root = (0, import_element13.createRoot)(target); (0, import_data26.dispatch)(import_preferences11.store).setDefaults("core/edit-post", { fullscreenMode: true, themeStyles: true, welcomeGuide: true, welcomeGuideTemplate: true }); (0, import_data26.dispatch)(import_preferences11.store).setDefaults("core", { allowRightClickOverrides: true, editorMode: "visual", editorTool: "edit", fixedToolbar: false, hiddenBlockTypes: [], inactivePanels: [], openPanels: ["post-status"], showBlockBreadcrumbs: true, showIconLabels: false, showListViewByDefault: false, enableChoosePatternModal: true, isPublishSidebarEnabled: true, showCollaborationCursor: false, showCollaborationNotifications: true }); if (window.__clientSideMediaProcessing) { (0, import_data26.dispatch)(import_preferences11.store).setDefaults("core/media", { requireApproval: true, optimizeOnUpload: true }); } (0, import_data26.dispatch)(import_blocks3.store).reapplyBlockTypeFilters(); if (isMediumOrBigger && (0, import_data26.select)(import_preferences11.store).get("core", "showListViewByDefault") && !(0, import_data26.select)(import_preferences11.store).get("core", "distractionFree")) { (0, import_data26.dispatch)(import_editor20.store).setIsListViewOpened(true); } (0, import_block_library2.registerCoreBlocks)(); registerCoreBlockBindingsSources(); (0, import_widgets.registerLegacyWidgetBlock)({ inserter: false }); (0, import_widgets.registerWidgetGroupBlock)({ inserter: false }); if (false) { (0, import_block_library2.__experimentalRegisterExperimentalCoreBlocks)({ enableFSEBlocks: settings.__unstableEnableFullSiteEditingBlocks }); } const documentMode = document.compatMode === "CSS1Compat" ? "Standards" : "Quirks"; if (documentMode !== "Standards") { console.warn( "Your browser is using Quirks Mode. \nThis can cause rendering issues such as blocks overlaying meta boxes in the editor. Quirks Mode can be triggered by PHP errors or HTML code appearing before the opening <!DOCTYPE html>. Try checking the raw page source or your site's PHP error log and resolving errors there, removing any HTML before the doctype, or disabling plugins." ); } const isIphone = window.navigator.userAgent.indexOf("iPhone") !== -1; if (isIphone) { window.addEventListener("scroll", (event) => { const editorScrollContainer = document.getElementsByClassName( "interface-interface-skeleton__body" )[0]; if (event.target === document) { if (window.scrollY > 100) { editorScrollContainer.scrollTop = editorScrollContainer.scrollTop + window.scrollY; } if (document.getElementsByClassName("is-mode-visual")[0]) { window.scrollTo(0, 0); } } }); } window.addEventListener("dragover", (e) => e.preventDefault(), false); window.addEventListener("drop", (e) => e.preventDefault(), false); root.render( /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_element13.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)( layout_default, { settings, postId, postType, initialEdits } ) }) ); return root; } function reinitializeEditor() { (0, import_deprecated4.default)("wp.editPost.reinitializeEditor", { since: "6.2", version: "6.3" }); } return __toCommonJS(index_exports); })(); a11y.min.js 0000644 00000004644 15206720414 0006450 0 ustar 00 "use strict";var wp;(wp||={}).a11y=(()=>{var v=Object.create;var r=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var C=Object.getPrototypeOf,I=Object.prototype.hasOwnProperty;var d=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),B=(t,e)=>{for(var n in e)r(t,n,{get:e[n],enumerable:!0})},s=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of E(e))!I.call(t,o)&&o!==n&&r(t,o,{get:()=>e[o],enumerable:!(i=A(e,o))||i.enumerable});return t};var p=(t,e,n)=>(n=t!=null?v(C(t)):{},s(e||!t||!t.__esModule?r(n,"default",{value:t,enumerable:!0}):n,t)),T=t=>s(r({},"__esModule",{value:!0}),t);var c=d((P,l)=>{l.exports=window.wp.domReady});var u=d((_,m)=>{m.exports=window.wp.i18n});var N={};B(N,{setup:()=>w,speak:()=>g});var k=p(c(),1);function a(t="polite"){let e=document.createElement("div");e.id=`a11y-speak-${t}`,e.className="a11y-speak-region",e.setAttribute("style","position:absolute;margin:-1px;padding:0;height:1px;width:1px;overflow:hidden;clip-path:inset(50%);border:0;word-wrap:normal !important;"),e.setAttribute("aria-live",t),e.setAttribute("aria-relevant","additions text"),e.setAttribute("aria-atomic","true");let{body:n}=document;return n&&n.appendChild(e),e}var f=p(u(),1);function x(){let t=document.createElement("p");t.id="a11y-speak-intro-text",t.className="a11y-speak-intro-text",t.textContent=(0,f.__)("Notifications"),t.setAttribute("style","position:absolute;margin:-1px;padding:0;height:1px;width:1px;overflow:hidden;clip-path:inset(50%);border:0;word-wrap:normal !important;"),t.setAttribute("hidden","");let{body:e}=document;return e&&e.appendChild(t),t}function y(){let t=document.getElementsByClassName("a11y-speak-region"),e=document.getElementById("a11y-speak-intro-text");for(let n=0;n<t.length;n++)t[n].textContent="";e&&e.setAttribute("hidden","hidden")}var h="";function b(t){return t=t.replace(/<[^<>]+>/g," "),h===t&&(t+="\xA0"),h=t,t}function g(t,e){y(),t=b(t);let n=document.getElementById("a11y-speak-intro-text"),i=document.getElementById("a11y-speak-assertive"),o=document.getElementById("a11y-speak-polite");i&&e==="assertive"?i.textContent=t:o&&(o.textContent=t),n&&n.removeAttribute("hidden")}function w(){let t=document.getElementById("a11y-speak-intro-text"),e=document.getElementById("a11y-speak-assertive"),n=document.getElementById("a11y-speak-polite");t===null&&x(),e===null&&a("assertive"),n===null&&a("polite")}(0,k.default)(w);return T(N);})(); html-entities.js 0000644 00000003225 15206720414 0007673 0 ustar 00 "use strict"; var wp; (wp ||= {}).htmlEntities = (() => { var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; 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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // packages/html-entities/build-module/index.mjs var index_exports = {}; __export(index_exports, { decodeEntities: () => decodeEntities }); var _decodeTextArea; function decodeEntities(html) { if ("string" !== typeof html || -1 === html.indexOf("&")) { return html; } if (void 0 === _decodeTextArea) { if (document.implementation && document.implementation.createHTMLDocument) { _decodeTextArea = document.implementation.createHTMLDocument("").createElement("textarea"); } else { _decodeTextArea = document.createElement("textarea"); } } _decodeTextArea.innerHTML = html; const decoded = _decodeTextArea.textContent ?? ""; _decodeTextArea.innerHTML = ""; return decoded; } return __toCommonJS(index_exports); })(); data.js 0000644 00000245443 15206720414 0006030 0 ustar 00 "use strict"; var wp; (wp ||= {}).data = (() => { 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 __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; 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 )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // package-external:@wordpress/deprecated var require_deprecated = __commonJS({ "package-external:@wordpress/deprecated"(exports, module) { module.exports = window.wp.deprecated; } }); // node_modules/equivalent-key-map/equivalent-key-map.js var require_equivalent_key_map = __commonJS({ "node_modules/equivalent-key-map/equivalent-key-map.js"(exports, module) { "use strict"; function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function(obj2) { return typeof obj2; }; } else { _typeof = function(obj2) { return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function getValuePair(instance, key) { var _map = instance._map, _arrayTreeMap = instance._arrayTreeMap, _objectTreeMap = instance._objectTreeMap; if (_map.has(key)) { return _map.get(key); } var properties = Object.keys(key).sort(); var map = Array.isArray(key) ? _arrayTreeMap : _objectTreeMap; for (var i = 0; i < properties.length; i++) { var property = properties[i]; map = map.get(property); if (map === void 0) { return; } var propertyValue = key[property]; map = map.get(propertyValue); if (map === void 0) { return; } } var valuePair = map.get("_ekm_value"); if (!valuePair) { return; } _map.delete(valuePair[0]); valuePair[0] = key; map.set("_ekm_value", valuePair); _map.set(key, valuePair); return valuePair; } var EquivalentKeyMap3 = /* @__PURE__ */ (function() { function EquivalentKeyMap4(iterable) { _classCallCheck(this, EquivalentKeyMap4); this.clear(); if (iterable instanceof EquivalentKeyMap4) { var iterablePairs = []; iterable.forEach(function(value, key) { iterablePairs.push([key, value]); }); iterable = iterablePairs; } if (iterable != null) { for (var i = 0; i < iterable.length; i++) { this.set(iterable[i][0], iterable[i][1]); } } } _createClass(EquivalentKeyMap4, [{ key: "set", /** * Add or update an element with a specified key and value. * * @param {*} key The key of the element to add. * @param {*} value The value of the element to add. * * @return {EquivalentKeyMap} Map instance. */ value: function set(key, value) { if (key === null || _typeof(key) !== "object") { this._map.set(key, value); return this; } var properties = Object.keys(key).sort(); var valuePair = [key, value]; var map = Array.isArray(key) ? this._arrayTreeMap : this._objectTreeMap; for (var i = 0; i < properties.length; i++) { var property = properties[i]; if (!map.has(property)) { map.set(property, new EquivalentKeyMap4()); } map = map.get(property); var propertyValue = key[property]; if (!map.has(propertyValue)) { map.set(propertyValue, new EquivalentKeyMap4()); } map = map.get(propertyValue); } var previousValuePair = map.get("_ekm_value"); if (previousValuePair) { this._map.delete(previousValuePair[0]); } map.set("_ekm_value", valuePair); this._map.set(key, valuePair); return this; } /** * Returns a specified element. * * @param {*} key The key of the element to return. * * @return {?*} The element associated with the specified key or undefined * if the key can't be found. */ }, { key: "get", value: function get(key) { if (key === null || _typeof(key) !== "object") { return this._map.get(key); } var valuePair = getValuePair(this, key); if (valuePair) { return valuePair[1]; } } /** * Returns a boolean indicating whether an element with the specified key * exists or not. * * @param {*} key The key of the element to test for presence. * * @return {boolean} Whether an element with the specified key exists. */ }, { key: "has", value: function has(key) { if (key === null || _typeof(key) !== "object") { return this._map.has(key); } return getValuePair(this, key) !== void 0; } /** * Removes the specified element. * * @param {*} key The key of the element to remove. * * @return {boolean} Returns true if an element existed and has been * removed, or false if the element does not exist. */ }, { key: "delete", value: function _delete(key) { if (!this.has(key)) { return false; } this.set(key, void 0); return true; } /** * Executes a provided function once per each key/value pair, in insertion * order. * * @param {Function} callback Function to execute for each element. * @param {*} thisArg Value to use as `this` when executing * `callback`. */ }, { key: "forEach", value: function forEach(callback) { var _this = this; var thisArg = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this; this._map.forEach(function(value, key) { if (key !== null && _typeof(key) === "object") { value = value[1]; } callback.call(thisArg, value, key, _this); }); } /** * Removes all elements. */ }, { key: "clear", value: function clear() { this._map = /* @__PURE__ */ new Map(); this._arrayTreeMap = /* @__PURE__ */ new Map(); this._objectTreeMap = /* @__PURE__ */ new Map(); } }, { key: "size", get: function get() { return this._map.size; } }]); return EquivalentKeyMap4; })(); module.exports = EquivalentKeyMap3; } }); // package-external:@wordpress/redux-routine var require_redux_routine = __commonJS({ "package-external:@wordpress/redux-routine"(exports, module) { module.exports = window.wp.reduxRoutine; } }); // package-external:@wordpress/compose var require_compose = __commonJS({ "package-external:@wordpress/compose"(exports, module) { module.exports = window.wp.compose; } }); // package-external:@wordpress/private-apis var require_private_apis = __commonJS({ "package-external:@wordpress/private-apis"(exports, module) { module.exports = window.wp.privateApis; } }); // node_modules/deepmerge/dist/cjs.js var require_cjs = __commonJS({ "node_modules/deepmerge/dist/cjs.js"(exports, module) { "use strict"; var isMergeableObject = function isMergeableObject2(value) { return isNonNullObject(value) && !isSpecial(value); }; function isNonNullObject(value) { return !!value && typeof value === "object"; } function isSpecial(value) { var stringValue = Object.prototype.toString.call(value); return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value); } var canUseSymbol = typeof Symbol === "function" && Symbol.for; var REACT_ELEMENT_TYPE = canUseSymbol ? /* @__PURE__ */ Symbol.for("react.element") : 60103; function isReactElement(value) { return value.$$typeof === REACT_ELEMENT_TYPE; } function emptyTarget(val) { return Array.isArray(val) ? [] : {}; } function cloneUnlessOtherwiseSpecified(value, options) { return options.clone !== false && options.isMergeableObject(value) ? deepmerge2(emptyTarget(value), value, options) : value; } function defaultArrayMerge(target, source, options) { return target.concat(source).map(function(element) { return cloneUnlessOtherwiseSpecified(element, options); }); } function getMergeFunction(key, options) { if (!options.customMerge) { return deepmerge2; } var customMerge = options.customMerge(key); return typeof customMerge === "function" ? customMerge : deepmerge2; } function getEnumerableOwnPropertySymbols(target) { return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) { return Object.propertyIsEnumerable.call(target, symbol); }) : []; } function getKeys(target) { return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target)); } function propertyIsOnObject(object, property) { try { return property in object; } catch (_) { return false; } } function propertyIsUnsafe(target, key) { return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key)); } function mergeObject(target, source, options) { var destination = {}; if (options.isMergeableObject(target)) { getKeys(target).forEach(function(key) { destination[key] = cloneUnlessOtherwiseSpecified(target[key], options); }); } getKeys(source).forEach(function(key) { if (propertyIsUnsafe(target, key)) { return; } if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) { destination[key] = getMergeFunction(key, options)(target[key], source[key], options); } else { destination[key] = cloneUnlessOtherwiseSpecified(source[key], options); } }); return destination; } function deepmerge2(target, source, options) { options = options || {}; options.arrayMerge = options.arrayMerge || defaultArrayMerge; options.isMergeableObject = options.isMergeableObject || isMergeableObject; options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified; var sourceIsArray = Array.isArray(source); var targetIsArray = Array.isArray(target); var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray; if (!sourceAndTargetTypesMatch) { return cloneUnlessOtherwiseSpecified(source, options); } else if (sourceIsArray) { return options.arrayMerge(target, source, options); } else { return mergeObject(target, source, options); } } deepmerge2.all = function deepmergeAll(array, options) { if (!Array.isArray(array)) { throw new Error("first argument should be an array"); } return array.reduce(function(prev, next) { return deepmerge2(prev, next, options); }, {}); }; var deepmerge_1 = deepmerge2; module.exports = deepmerge_1; } }); // package-external:@wordpress/priority-queue var require_priority_queue = __commonJS({ "package-external:@wordpress/priority-queue"(exports, module) { module.exports = window.wp.priorityQueue; } }); // package-external:@wordpress/element var require_element = __commonJS({ "package-external:@wordpress/element"(exports, module) { module.exports = window.wp.element; } }); // package-external:@wordpress/is-shallow-equal var require_is_shallow_equal = __commonJS({ "package-external:@wordpress/is-shallow-equal"(exports, module) { module.exports = window.wp.isShallowEqual; } }); // vendor-external:react/jsx-runtime var require_jsx_runtime = __commonJS({ "vendor-external:react/jsx-runtime"(exports, module) { module.exports = window.ReactJSXRuntime; } }); // packages/data/build-module/index.mjs var index_exports = {}; __export(index_exports, { AsyncModeProvider: () => context_default2, RegistryConsumer: () => RegistryConsumer, RegistryProvider: () => context_default, combineReducers: () => combineReducers2, controls: () => controls, createReduxStore: () => createReduxStore, createRegistry: () => createRegistry, createRegistryControl: () => createRegistryControl, createRegistrySelector: () => createRegistrySelector, createSelector: () => rememo_default, dispatch: () => dispatch2, plugins: () => plugins_exports, register: () => register, registerGenericStore: () => registerGenericStore, registerStore: () => registerStore, resolveSelect: () => resolveSelect2, select: () => select2, subscribe: () => subscribe, suspendSelect: () => suspendSelect, use: () => use, useDispatch: () => use_dispatch_default, useRegistry: () => useRegistry, useSelect: () => useSelect, useSuspenseSelect: () => useSuspenseSelect, withDispatch: () => with_dispatch_default, withRegistry: () => with_registry_default, withSelect: () => with_select_default }); // packages/data/build-module/registry.mjs var import_deprecated2 = __toESM(require_deprecated(), 1); // node_modules/redux/dist/redux.mjs var $$observable = /* @__PURE__ */ (() => typeof Symbol === "function" && Symbol.observable || "@@observable")(); var symbol_observable_default = $$observable; var randomString = () => Math.random().toString(36).substring(7).split("").join("."); var ActionTypes = { INIT: `@@redux/INIT${/* @__PURE__ */ randomString()}`, REPLACE: `@@redux/REPLACE${/* @__PURE__ */ randomString()}`, PROBE_UNKNOWN_ACTION: () => `@@redux/PROBE_UNKNOWN_ACTION${randomString()}` }; var actionTypes_default = ActionTypes; function isPlainObject(obj) { if (typeof obj !== "object" || obj === null) return false; let proto = obj; while (Object.getPrototypeOf(proto) !== null) { proto = Object.getPrototypeOf(proto); } return Object.getPrototypeOf(obj) === proto || Object.getPrototypeOf(obj) === null; } function miniKindOf(val) { if (val === void 0) return "undefined"; if (val === null) return "null"; const type = typeof val; switch (type) { case "boolean": case "string": case "number": case "symbol": case "function": { return type; } } if (Array.isArray(val)) return "array"; if (isDate(val)) return "date"; if (isError(val)) return "error"; const constructorName = ctorName(val); switch (constructorName) { case "Symbol": case "Promise": case "WeakMap": case "WeakSet": case "Map": case "Set": return constructorName; } return Object.prototype.toString.call(val).slice(8, -1).toLowerCase().replace(/\s/g, ""); } function ctorName(val) { return typeof val.constructor === "function" ? val.constructor.name : null; } function isError(val) { return val instanceof Error || typeof val.message === "string" && val.constructor && typeof val.constructor.stackTraceLimit === "number"; } function isDate(val) { if (val instanceof Date) return true; return typeof val.toDateString === "function" && typeof val.getDate === "function" && typeof val.setDate === "function"; } function kindOf(val) { let typeOfVal = typeof val; if (true) { typeOfVal = miniKindOf(val); } return typeOfVal; } function createStore(reducer, preloadedState, enhancer) { if (typeof reducer !== "function") { throw new Error(false ? formatProdErrorMessage(2) : `Expected the root reducer to be a function. Instead, received: '${kindOf(reducer)}'`); } if (typeof preloadedState === "function" && typeof enhancer === "function" || typeof enhancer === "function" && typeof arguments[3] === "function") { throw new Error(false ? formatProdErrorMessage(0) : "It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example."); } if (typeof preloadedState === "function" && typeof enhancer === "undefined") { enhancer = preloadedState; preloadedState = void 0; } if (typeof enhancer !== "undefined") { if (typeof enhancer !== "function") { throw new Error(false ? formatProdErrorMessage(1) : `Expected the enhancer to be a function. Instead, received: '${kindOf(enhancer)}'`); } return enhancer(createStore)(reducer, preloadedState); } let currentReducer = reducer; let currentState = preloadedState; let currentListeners = /* @__PURE__ */ new Map(); let nextListeners = currentListeners; let listenerIdCounter = 0; let isDispatching = false; function ensureCanMutateNextListeners() { if (nextListeners === currentListeners) { nextListeners = /* @__PURE__ */ new Map(); currentListeners.forEach((listener, key) => { nextListeners.set(key, listener); }); } } function getState() { if (isDispatching) { throw new Error(false ? formatProdErrorMessage(3) : "You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store."); } return currentState; } function subscribe2(listener) { if (typeof listener !== "function") { throw new Error(false ? formatProdErrorMessage(4) : `Expected the listener to be a function. Instead, received: '${kindOf(listener)}'`); } if (isDispatching) { throw new Error(false ? formatProdErrorMessage(5) : "You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details."); } let isSubscribed = true; ensureCanMutateNextListeners(); const listenerId = listenerIdCounter++; nextListeners.set(listenerId, listener); return function unsubscribe() { if (!isSubscribed) { return; } if (isDispatching) { throw new Error(false ? formatProdErrorMessage(6) : "You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details."); } isSubscribed = false; ensureCanMutateNextListeners(); nextListeners.delete(listenerId); currentListeners = null; }; } function dispatch3(action) { if (!isPlainObject(action)) { throw new Error(false ? formatProdErrorMessage(7) : `Actions must be plain objects. Instead, the actual type was: '${kindOf(action)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`); } if (typeof action.type === "undefined") { throw new Error(false ? formatProdErrorMessage(8) : 'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.'); } if (typeof action.type !== "string") { throw new Error(false ? formatProdErrorMessage(17) : `Action "type" property must be a string. Instead, the actual type was: '${kindOf(action.type)}'. Value was: '${action.type}' (stringified)`); } if (isDispatching) { throw new Error(false ? formatProdErrorMessage(9) : "Reducers may not dispatch actions."); } try { isDispatching = true; currentState = currentReducer(currentState, action); } finally { isDispatching = false; } const listeners = currentListeners = nextListeners; listeners.forEach((listener) => { listener(); }); return action; } function replaceReducer(nextReducer) { if (typeof nextReducer !== "function") { throw new Error(false ? formatProdErrorMessage(10) : `Expected the nextReducer to be a function. Instead, received: '${kindOf(nextReducer)}`); } currentReducer = nextReducer; dispatch3({ type: actionTypes_default.REPLACE }); } function observable() { const outerSubscribe = subscribe2; return { /** * The minimal observable subscription method. * @param observer Any object that can be used as an observer. * The observer object should have a `next` method. * @returns An object with an `unsubscribe` method that can * be used to unsubscribe the observable from the store, and prevent further * emission of values from the observable. */ subscribe(observer) { if (typeof observer !== "object" || observer === null) { throw new Error(false ? formatProdErrorMessage(11) : `Expected the observer to be an object. Instead, received: '${kindOf(observer)}'`); } function observeState() { const observerAsObserver = observer; if (observerAsObserver.next) { observerAsObserver.next(getState()); } } observeState(); const unsubscribe = outerSubscribe(observeState); return { unsubscribe }; }, [symbol_observable_default]() { return this; } }; } dispatch3({ type: actionTypes_default.INIT }); const store = { dispatch: dispatch3, subscribe: subscribe2, getState, replaceReducer, [symbol_observable_default]: observable }; return store; } function compose(...funcs) { if (funcs.length === 0) { return (arg) => arg; } if (funcs.length === 1) { return funcs[0]; } return funcs.reduce((a, b) => (...args) => a(b(...args))); } function applyMiddleware(...middlewares) { return (createStore2) => (reducer, preloadedState) => { const store = createStore2(reducer, preloadedState); let dispatch3 = () => { throw new Error(false ? formatProdErrorMessage(15) : "Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch."); }; const middlewareAPI = { getState: store.getState, dispatch: (action, ...args) => dispatch3(action, ...args) }; const chain = middlewares.map((middleware) => middleware(middlewareAPI)); dispatch3 = compose(...chain)(store.dispatch); return { ...store, dispatch: dispatch3 }; }; } // packages/data/build-module/redux-store/index.mjs var import_equivalent_key_map2 = __toESM(require_equivalent_key_map(), 1); var import_redux_routine = __toESM(require_redux_routine(), 1); var import_compose = __toESM(require_compose(), 1); // packages/data/build-module/redux-store/combine-reducers.mjs function combineReducers(reducers) { const keys = Object.keys(reducers); return function combinedReducer(state = {}, action) { const nextState = {}; let hasChanged = false; for (const key of keys) { const reducer = reducers[key]; const prevStateForKey = state[key]; const nextStateForKey = reducer(prevStateForKey, action); nextState[key] = nextStateForKey; hasChanged = hasChanged || nextStateForKey !== prevStateForKey; } return hasChanged ? nextState : state; }; } // packages/data/build-module/factory.mjs function createRegistrySelector(registrySelector) { const selectorsByRegistry = /* @__PURE__ */ new WeakMap(); const wrappedSelector = (...args) => { let selector = selectorsByRegistry.get(wrappedSelector.registry); if (!selector) { selector = registrySelector(wrappedSelector.registry.select); selectorsByRegistry.set(wrappedSelector.registry, selector); } return selector(...args); }; wrappedSelector.isRegistrySelector = true; return wrappedSelector; } function createRegistryControl(registryControl) { registryControl.isRegistryControl = true; return registryControl; } // packages/data/build-module/controls.mjs var SELECT = "@@data/SELECT"; var RESOLVE_SELECT = "@@data/RESOLVE_SELECT"; var DISPATCH = "@@data/DISPATCH"; function isObject(object) { return object !== null && typeof object === "object"; } function select(storeNameOrDescriptor, selectorName, ...args) { return { type: SELECT, storeKey: isObject(storeNameOrDescriptor) ? storeNameOrDescriptor.name : storeNameOrDescriptor, selectorName, args }; } function resolveSelect(storeNameOrDescriptor, selectorName, ...args) { return { type: RESOLVE_SELECT, storeKey: isObject(storeNameOrDescriptor) ? storeNameOrDescriptor.name : storeNameOrDescriptor, selectorName, args }; } function dispatch(storeNameOrDescriptor, actionName, ...args) { return { type: DISPATCH, storeKey: isObject(storeNameOrDescriptor) ? storeNameOrDescriptor.name : storeNameOrDescriptor, actionName, args }; } var controls = { select, resolveSelect, dispatch }; var builtinControls = { [SELECT]: createRegistryControl( (registry) => ({ storeKey, selectorName, args }) => registry.select(storeKey)[selectorName](...args) ), [RESOLVE_SELECT]: createRegistryControl( (registry) => ({ storeKey, selectorName, args }) => { const method = registry.select(storeKey)[selectorName].hasResolver ? "resolveSelect" : "select"; return registry[method](storeKey)[selectorName]( ...args ); } ), [DISPATCH]: createRegistryControl( (registry) => ({ storeKey, actionName, args }) => registry.dispatch(storeKey)[actionName](...args) ) }; // packages/data/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/data" ); // node_modules/is-promise/index.mjs function isPromise(obj) { return !!obj && (typeof obj === "object" || typeof obj === "function") && typeof obj.then === "function"; } // packages/data/build-module/promise-middleware.mjs var promiseMiddleware = () => (next) => (action) => { if (isPromise(action)) { return action.then((resolvedAction) => { if (resolvedAction) { return next(resolvedAction); } }); } return next(action); }; var promise_middleware_default = promiseMiddleware; // packages/data/build-module/resolvers-cache-middleware.mjs var createResolversCacheMiddleware = (registry, storeName) => () => (next) => (action) => { const resolvers = registry.select(storeName).getCachedResolvers(); const resolverEntries = Object.entries(resolvers); resolverEntries.forEach(([selectorName, resolversByArgs]) => { const resolver = registry.stores[storeName]?.resolvers?.[selectorName]; if (!resolver || !resolver.shouldInvalidate) { return; } resolversByArgs.forEach((value, args) => { if (value === void 0) { return; } if (value.status !== "finished" && value.status !== "error") { return; } if (!resolver.shouldInvalidate(action, ...args)) { return; } registry.dispatch(storeName).invalidateResolution(selectorName, args); }); }); return next(action); }; var resolvers_cache_middleware_default = createResolversCacheMiddleware; // packages/data/build-module/redux-store/thunk-middleware.mjs function createThunkMiddleware(args) { return () => (next) => (action) => { if (typeof action === "function") { return action(args); } return next(action); }; } // packages/data/build-module/redux-store/metadata/reducer.mjs var import_equivalent_key_map = __toESM(require_equivalent_key_map(), 1); // packages/data/build-module/redux-store/metadata/utils.mjs var onSubKey = (actionProperty) => (reducer) => (state = {}, action) => { const key = action[actionProperty]; if (key === void 0) { return state; } const nextKeyState = reducer(state[key], action); if (nextKeyState === state[key]) { return state; } return { ...state, [key]: nextKeyState }; }; function selectorArgsToStateKey(args) { if (args === void 0 || args === null) { return []; } const len = args.length; let idx = len; while (idx > 0 && args[idx - 1] === void 0) { idx--; } return idx === len ? args : args.slice(0, idx); } // packages/data/build-module/redux-store/metadata/reducer.mjs var subKeysIsResolved = onSubKey("selectorName")((state = new import_equivalent_key_map.default(), action) => { switch (action.type) { case "START_RESOLUTION": { const nextState = new import_equivalent_key_map.default(state); nextState.set(selectorArgsToStateKey(action.args), { status: "resolving" }); return nextState; } case "FINISH_RESOLUTION": { const nextState = new import_equivalent_key_map.default(state); nextState.set(selectorArgsToStateKey(action.args), { status: "finished" }); return nextState; } case "FAIL_RESOLUTION": { const nextState = new import_equivalent_key_map.default(state); nextState.set(selectorArgsToStateKey(action.args), { status: "error", error: action.error }); return nextState; } case "START_RESOLUTIONS": { const nextState = new import_equivalent_key_map.default(state); for (const resolutionArgs of action.args) { nextState.set(selectorArgsToStateKey(resolutionArgs), { status: "resolving" }); } return nextState; } case "FINISH_RESOLUTIONS": { const nextState = new import_equivalent_key_map.default(state); for (const resolutionArgs of action.args) { nextState.set(selectorArgsToStateKey(resolutionArgs), { status: "finished" }); } return nextState; } case "FAIL_RESOLUTIONS": { const nextState = new import_equivalent_key_map.default(state); action.args.forEach((resolutionArgs, idx) => { const resolutionState = { status: "error", error: void 0 }; const error = action.errors[idx]; if (error) { resolutionState.error = error; } nextState.set( selectorArgsToStateKey(resolutionArgs), resolutionState ); }); return nextState; } case "INVALIDATE_RESOLUTION": { const nextState = new import_equivalent_key_map.default(state); nextState.delete(selectorArgsToStateKey(action.args)); return nextState; } } return state; }); var isResolved = (state = {}, action) => { switch (action.type) { case "INVALIDATE_RESOLUTION_FOR_STORE": return {}; case "INVALIDATE_RESOLUTION_FOR_STORE_SELECTOR": { if (action.selectorName in state) { const { [action.selectorName]: removedSelector, ...restState } = state; return restState; } return state; } case "START_RESOLUTION": case "FINISH_RESOLUTION": case "FAIL_RESOLUTION": case "START_RESOLUTIONS": case "FINISH_RESOLUTIONS": case "FAIL_RESOLUTIONS": case "INVALIDATE_RESOLUTION": return subKeysIsResolved(state, action); default: return state; } }; var reducer_default = isResolved; // packages/data/build-module/redux-store/metadata/selectors.mjs var selectors_exports = {}; __export(selectors_exports, { countSelectorsByStatus: () => countSelectorsByStatus, getCachedResolvers: () => getCachedResolvers, getIsResolving: () => getIsResolving, getResolutionError: () => getResolutionError, getResolutionState: () => getResolutionState, hasFinishedResolution: () => hasFinishedResolution, hasResolutionFailed: () => hasResolutionFailed, hasResolvingSelectors: () => hasResolvingSelectors, hasStartedResolution: () => hasStartedResolution, isResolving: () => isResolving }); var import_deprecated = __toESM(require_deprecated(), 1); // node_modules/rememo/rememo.js var LEAF_KEY = {}; function arrayOf(value) { return [value]; } function isObjectLike(value) { return !!value && "object" === typeof value; } function createCache() { var cache = { clear: function() { cache.head = null; } }; return cache; } function isShallowEqual(a, b, fromIndex) { var i; if (a.length !== b.length) { return false; } for (i = fromIndex; i < a.length; i++) { if (a[i] !== b[i]) { return false; } } return true; } function rememo_default(selector, getDependants) { var rootCache; var normalizedGetDependants = getDependants ? getDependants : arrayOf; function getCache(dependants) { var caches = rootCache, isUniqueByDependants = true, i, dependant, map, cache; for (i = 0; i < dependants.length; i++) { dependant = dependants[i]; if (!isObjectLike(dependant)) { isUniqueByDependants = false; break; } if (caches.has(dependant)) { caches = caches.get(dependant); } else { map = /* @__PURE__ */ new WeakMap(); caches.set(dependant, map); caches = map; } } if (!caches.has(LEAF_KEY)) { cache = createCache(); cache.isUniqueByDependants = isUniqueByDependants; caches.set(LEAF_KEY, cache); } return caches.get(LEAF_KEY); } function clear() { rootCache = /* @__PURE__ */ new WeakMap(); } function callSelector() { var len = arguments.length, cache, node, i, args, dependants; args = new Array(len); for (i = 0; i < len; i++) { args[i] = arguments[i]; } dependants = normalizedGetDependants.apply(null, args); cache = getCache(dependants); if (!cache.isUniqueByDependants) { if (cache.lastDependants && !isShallowEqual(dependants, cache.lastDependants, 0)) { cache.clear(); } cache.lastDependants = dependants; } node = cache.head; while (node) { if (!isShallowEqual(node.args, args, 1)) { node = node.next; continue; } if (node !== cache.head) { node.prev.next = node.next; if (node.next) { node.next.prev = node.prev; } node.next = cache.head; node.prev = null; cache.head.prev = node; cache.head = node; } return node.val; } node = /** @type {CacheNode} */ { // Generate the result from original function val: selector.apply(null, args) }; args[0] = null; node.args = args; if (cache.head) { cache.head.prev = node; node.next = cache.head; } cache.head = node; return node.val; } callSelector.getDependants = normalizedGetDependants; callSelector.clear = clear; clear(); return ( /** @type {S & EnhancedSelector} */ callSelector ); } // packages/data/build-module/redux-store/metadata/selectors.mjs function getResolutionState(state, selectorName, args) { const map = state[selectorName]; if (!map) { return; } return map.get(selectorArgsToStateKey(args)); } function getIsResolving(state, selectorName, args) { (0, import_deprecated.default)("wp.data.select( store ).getIsResolving", { since: "6.6", version: "6.8", alternative: "wp.data.select( store ).getResolutionState" }); const resolutionState = getResolutionState(state, selectorName, args); return resolutionState && resolutionState.status === "resolving"; } function hasStartedResolution(state, selectorName, args) { return getResolutionState(state, selectorName, args) !== void 0; } function hasFinishedResolution(state, selectorName, args) { const status = getResolutionState(state, selectorName, args)?.status; return status === "finished" || status === "error"; } function hasResolutionFailed(state, selectorName, args) { return getResolutionState(state, selectorName, args)?.status === "error"; } function getResolutionError(state, selectorName, args) { const resolutionState = getResolutionState(state, selectorName, args); return resolutionState?.status === "error" ? resolutionState.error : null; } function isResolving(state, selectorName, args) { return getResolutionState(state, selectorName, args)?.status === "resolving"; } function getCachedResolvers(state) { return state; } function hasResolvingSelectors(state) { return Object.values(state).some( (selectorState) => ( /** * This uses the internal `_map` property of `EquivalentKeyMap` for * optimization purposes, since the `EquivalentKeyMap` implementation * does not support a `.values()` implementation. * * @see https://github.com/aduth/equivalent-key-map */ Array.from(selectorState._map.values()).some( (resolution) => resolution[1]?.status === "resolving" ) ) ); } var countSelectorsByStatus = rememo_default( (state) => { const selectorsByStatus = {}; Object.values(state).forEach( (selectorState) => ( /** * This uses the internal `_map` property of `EquivalentKeyMap` for * optimization purposes, since the `EquivalentKeyMap` implementation * does not support a `.values()` implementation. * * @see https://github.com/aduth/equivalent-key-map */ Array.from(selectorState._map.values()).forEach( (resolution) => { const currentStatus = resolution[1]?.status ?? "error"; if (!selectorsByStatus[currentStatus]) { selectorsByStatus[currentStatus] = 0; } selectorsByStatus[currentStatus]++; } ) ) ); return selectorsByStatus; }, (state) => [state] ); // packages/data/build-module/redux-store/metadata/actions.mjs var actions_exports = {}; __export(actions_exports, { failResolution: () => failResolution, failResolutions: () => failResolutions, finishResolution: () => finishResolution, finishResolutions: () => finishResolutions, invalidateResolution: () => invalidateResolution, invalidateResolutionForStore: () => invalidateResolutionForStore, invalidateResolutionForStoreSelector: () => invalidateResolutionForStoreSelector, startResolution: () => startResolution, startResolutions: () => startResolutions }); function startResolution(selectorName, args) { return { type: "START_RESOLUTION", selectorName, args }; } function finishResolution(selectorName, args) { return { type: "FINISH_RESOLUTION", selectorName, args }; } function failResolution(selectorName, args, error) { return { type: "FAIL_RESOLUTION", selectorName, args, error }; } function startResolutions(selectorName, args) { return { type: "START_RESOLUTIONS", selectorName, args }; } function finishResolutions(selectorName, args) { return { type: "FINISH_RESOLUTIONS", selectorName, args }; } function failResolutions(selectorName, args, errors) { return { type: "FAIL_RESOLUTIONS", selectorName, args, errors }; } function invalidateResolution(selectorName, args) { return { type: "INVALIDATE_RESOLUTION", selectorName, args }; } function invalidateResolutionForStore() { return { type: "INVALIDATE_RESOLUTION_FOR_STORE" }; } function invalidateResolutionForStoreSelector(selectorName) { return { type: "INVALIDATE_RESOLUTION_FOR_STORE_SELECTOR", selectorName }; } // packages/data/build-module/redux-store/index.mjs var trimUndefinedValues = (array) => { const result = [...array]; for (let i = result.length - 1; i >= 0; i--) { if (result[i] === void 0) { result.splice(i, 1); } } return result; }; var mapValues = (obj, callback) => Object.fromEntries( Object.entries(obj ?? {}).map(([key, value]) => [ key, callback(value, key) ]) ); var devToolsReplacer = (key, state) => { if (state instanceof Map) { return Object.fromEntries(state); } if (state instanceof window.HTMLElement) { return null; } return state; }; function createResolversCache() { const cache = {}; return { isRunning(selectorName, args) { return cache[selectorName] && cache[selectorName].get(trimUndefinedValues(args)); }, clear(selectorName, args) { if (cache[selectorName]) { cache[selectorName].delete(trimUndefinedValues(args)); } }, markAsRunning(selectorName, args) { if (!cache[selectorName]) { cache[selectorName] = new import_equivalent_key_map2.default(); } cache[selectorName].set(trimUndefinedValues(args), true); } }; } function createBindingCache(getItem, bindItem) { const cache = /* @__PURE__ */ new WeakMap(); return { get(itemName) { const item = getItem(itemName); if (!item) { return null; } let boundItem = cache.get(item); if (!boundItem) { boundItem = bindItem(item, itemName); cache.set(item, boundItem); } return boundItem; } }; } function createPrivateProxy(publicItems, privateItems) { return new Proxy(publicItems, { get: (target, itemName) => privateItems.get(itemName) || Reflect.get(target, itemName) }); } function createReduxStore(key, options) { const privateActions = {}; const privateSelectors = {}; const privateRegistrationFunctions = { privateActions, registerPrivateActions: (actions) => { Object.assign(privateActions, actions); }, privateSelectors, registerPrivateSelectors: (selectors) => { Object.assign(privateSelectors, selectors); } }; const storeDescriptor = { name: key, instantiate: (registry) => { const listeners = /* @__PURE__ */ new Set(); const reducer = options.reducer; const thunkArgs = { registry, get dispatch() { return thunkDispatch; }, get select() { return thunkSelect; }, get resolveSelect() { return resolveSelectors; } }; const store = instantiateReduxStore( key, options, registry, thunkArgs ); lock(store, privateRegistrationFunctions); const resolversCache = createResolversCache(); function bindAction(action) { return (...args) => Promise.resolve(store.dispatch(action(...args))); } const actions = { ...mapValues(actions_exports, bindAction), ...mapValues(options.actions, bindAction) }; const allActions = createPrivateProxy( actions, createBindingCache( (name) => privateActions[name], bindAction ) ); const thunkDispatch = new Proxy( (action) => store.dispatch(action), { get: (target, name) => allActions[name] } ); lock(actions, allActions); const resolvers = options.resolvers ? mapValues(options.resolvers, mapResolver) : {}; function bindSelector(selector, selectorName) { if (selector.isRegistrySelector) { selector.registry = registry; } const boundSelector = (...args) => { args = normalize(selector, args); const state = store.__unstableOriginalGetState(); if (selector.isRegistrySelector) { selector.registry = registry; } return selector(state.root, ...args); }; boundSelector.__unstableNormalizeArgs = selector.__unstableNormalizeArgs; const resolver = resolvers[selectorName]; if (!resolver) { boundSelector.hasResolver = false; return boundSelector; } return mapSelectorWithResolver( boundSelector, selectorName, resolver, store, resolversCache, boundMetadataSelectors ); } function bindMetadataSelector(metaDataSelector) { const boundSelector = (selectorName, selectorArgs, ...args) => { if (selectorName) { const targetSelector = options.selectors?.[selectorName]; if (targetSelector) { selectorArgs = normalize( targetSelector, selectorArgs ); } } const state = store.__unstableOriginalGetState(); return metaDataSelector( state.metadata, selectorName, selectorArgs, ...args ); }; boundSelector.hasResolver = false; return boundSelector; } const boundMetadataSelectors = mapValues( selectors_exports, bindMetadataSelector ); const boundSelectors = mapValues(options.selectors, bindSelector); const selectors = { ...boundMetadataSelectors, ...boundSelectors }; const boundPrivateSelectors = createBindingCache( (name) => privateSelectors[name], bindSelector ); const allSelectors = createPrivateProxy( selectors, boundPrivateSelectors ); for (const selectorName of Object.keys(privateSelectors)) { boundPrivateSelectors.get(selectorName); } const thunkSelect = new Proxy( (selector) => selector(store.__unstableOriginalGetState()), { get: (target, name) => allSelectors[name] } ); lock(selectors, allSelectors); const bindResolveSelector = mapResolveSelector( store, resolvers, boundMetadataSelectors ); const resolveSelectors = mapValues( boundSelectors, bindResolveSelector ); const allResolveSelectors = createPrivateProxy( resolveSelectors, createBindingCache( (name) => boundPrivateSelectors.get(name), bindResolveSelector ) ); lock(resolveSelectors, allResolveSelectors); const bindSuspendSelector = mapSuspendSelector( store, boundMetadataSelectors ); const suspendSelectors = { ...boundMetadataSelectors, // no special suspense behavior ...mapValues(boundSelectors, bindSuspendSelector) }; const allSuspendSelectors = createPrivateProxy( suspendSelectors, createBindingCache( (name) => boundPrivateSelectors.get(name), bindSuspendSelector ) ); lock(suspendSelectors, allSuspendSelectors); const getSelectors = () => selectors; const getActions = () => actions; const getResolveSelectors = () => resolveSelectors; const getSuspendSelectors = () => suspendSelectors; store.__unstableOriginalGetState = store.getState; store.getState = () => store.__unstableOriginalGetState().root; const subscribe2 = store && ((listener) => { listeners.add(listener); return () => listeners.delete(listener); }); let lastState = store.__unstableOriginalGetState(); store.subscribe(() => { const state = store.__unstableOriginalGetState(); const hasChanged = state !== lastState; lastState = state; if (hasChanged) { for (const listener of listeners) { listener(); } } }); return { reducer, store, actions, selectors, resolvers, getSelectors, getResolveSelectors, getSuspendSelectors, getActions, subscribe: subscribe2 }; } }; lock(storeDescriptor, privateRegistrationFunctions); return storeDescriptor; } function instantiateReduxStore(key, options, registry, thunkArgs) { const controls2 = { ...options.controls, ...builtinControls }; const normalizedControls = mapValues( controls2, (control) => control.isRegistryControl ? control(registry) : control ); const middlewares = [ resolvers_cache_middleware_default(registry, key), promise_middleware_default, (0, import_redux_routine.default)(normalizedControls), createThunkMiddleware(thunkArgs) ]; const enhancers = [applyMiddleware(...middlewares)]; if (typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION__) { enhancers.push( window.__REDUX_DEVTOOLS_EXTENSION__({ name: key, instanceId: key, serialize: { replacer: devToolsReplacer } }) ); } const { reducer, initialState } = options; const enhancedReducer = combineReducers({ metadata: reducer_default, root: reducer }); return createStore( enhancedReducer, { root: initialState }, (0, import_compose.compose)(enhancers) ); } function mapResolveSelector(store, resolvers, boundMetadataSelectors) { return (selector, selectorName) => { if (!selector.hasResolver) { return async (...args) => selector.apply(null, args); } return (...args) => new Promise((resolve, reject) => { const resolver = resolvers[selectorName]; const hasFinished = () => { return boundMetadataSelectors.hasFinishedResolution( selectorName, args ) || typeof resolver.isFulfilled === "function" && resolver.isFulfilled(store.getState(), ...args); }; const finalize = (result2) => { const hasFailed = boundMetadataSelectors.hasResolutionFailed( selectorName, args ); if (hasFailed) { const error = boundMetadataSelectors.getResolutionError( selectorName, args ); reject(error); } else { resolve(result2); } }; const getResult = () => selector.apply(null, args); const result = getResult(); if (hasFinished()) { return finalize(result); } const unsubscribe = store.subscribe(() => { if (hasFinished()) { unsubscribe(); finalize(getResult()); } }); }); }; } function mapSuspendSelector(store, boundMetadataSelectors) { return (selector, selectorName) => { if (!selector.hasResolver) { return selector; } return (...args) => { const result = selector.apply(null, args); if (boundMetadataSelectors.hasFinishedResolution( selectorName, args )) { if (boundMetadataSelectors.hasResolutionFailed( selectorName, args )) { throw boundMetadataSelectors.getResolutionError( selectorName, args ); } return result; } throw new Promise((resolve) => { const unsubscribe = store.subscribe(() => { if (boundMetadataSelectors.hasFinishedResolution( selectorName, args )) { resolve(); unsubscribe(); } }); }); }; }; } function mapResolver(resolver) { if (resolver.fulfill) { return resolver; } return { ...resolver, // Copy the enumerable properties of the resolver function. fulfill: resolver // Add the fulfill method. }; } function mapSelectorWithResolver(selector, selectorName, resolver, store, resolversCache, boundMetadataSelectors) { function fulfillSelector(args) { if (resolversCache.isRunning(selectorName, args) || boundMetadataSelectors.hasStartedResolution(selectorName, args) || typeof resolver.isFulfilled === "function" && resolver.isFulfilled(store.getState(), ...args)) { return; } resolversCache.markAsRunning(selectorName, args); setTimeout(async () => { resolversCache.clear(selectorName, args); store.dispatch( startResolution(selectorName, args) ); try { const action = resolver.fulfill(...args); if (action) { await store.dispatch(action); } store.dispatch( finishResolution(selectorName, args) ); } catch (error) { store.dispatch( failResolution(selectorName, args, error) ); } }, 0); } const selectorResolver = (...args) => { args = normalize(selector, args); fulfillSelector(args); return selector(...args); }; selectorResolver.hasResolver = true; return selectorResolver; } function normalize(selector, args) { if (selector.__unstableNormalizeArgs && typeof selector.__unstableNormalizeArgs === "function" && args?.length) { return selector.__unstableNormalizeArgs(args); } return args; } // packages/data/build-module/store/index.mjs var coreDataStore = { name: "core/data", instantiate(registry) { const getCoreDataSelector = (selectorName) => (key, ...args) => { return registry.select(key)[selectorName](...args); }; const getCoreDataAction = (actionName) => (key, ...args) => { return registry.dispatch(key)[actionName](...args); }; return { getSelectors() { return Object.fromEntries( [ "getIsResolving", "hasStartedResolution", "hasFinishedResolution", "isResolving", "getCachedResolvers" ].map((selectorName) => [ selectorName, getCoreDataSelector(selectorName) ]) ); }, getActions() { return Object.fromEntries( [ "startResolution", "finishResolution", "invalidateResolution", "invalidateResolutionForStore", "invalidateResolutionForStoreSelector" ].map((actionName) => [ actionName, getCoreDataAction(actionName) ]) ); }, subscribe() { return () => () => { }; } }; } }; var store_default = coreDataStore; // packages/data/build-module/utils/emitter.mjs function createEmitter() { let isPaused = false; let isPending = false; const listeners = /* @__PURE__ */ new Set(); const notifyListeners = () => ( // We use Array.from to clone the listeners Set // This ensures that we don't run a listener // that was added as a response to another listener. Array.from(listeners).forEach((listener) => listener()) ); return { get isPaused() { return isPaused; }, subscribe(listener) { listeners.add(listener); return () => listeners.delete(listener); }, pause() { isPaused = true; }, resume() { isPaused = false; if (isPending) { isPending = false; notifyListeners(); } }, emit() { if (isPaused) { isPending = true; return; } notifyListeners(); } }; } // packages/data/build-module/registry.mjs function getStoreName(storeNameOrDescriptor) { return typeof storeNameOrDescriptor === "string" ? storeNameOrDescriptor : storeNameOrDescriptor.name; } function createRegistry(storeConfigs = {}, parent = null) { const stores = {}; const emitter = createEmitter(); let listeningStores = null; function globalListener() { emitter.emit(); } const subscribe2 = (listener, storeNameOrDescriptor) => { if (!storeNameOrDescriptor) { return emitter.subscribe(listener); } const storeName = getStoreName(storeNameOrDescriptor); const store = stores[storeName]; if (store) { return store.subscribe(listener); } if (!parent) { return emitter.subscribe(listener); } return parent.subscribe(listener, storeNameOrDescriptor); }; function select3(storeNameOrDescriptor) { const storeName = getStoreName(storeNameOrDescriptor); listeningStores?.add(storeName); const store = stores[storeName]; if (store) { return store.getSelectors(); } return parent?.select(storeName); } function __unstableMarkListeningStores(callback, ref) { listeningStores = /* @__PURE__ */ new Set(); try { return callback.call(this); } finally { ref.current = Array.from(listeningStores); listeningStores = null; } } function resolveSelect3(storeNameOrDescriptor) { const storeName = getStoreName(storeNameOrDescriptor); listeningStores?.add(storeName); const store = stores[storeName]; if (store) { return store.getResolveSelectors(); } return parent && parent.resolveSelect(storeName); } function suspendSelect2(storeNameOrDescriptor) { const storeName = getStoreName(storeNameOrDescriptor); listeningStores?.add(storeName); const store = stores[storeName]; if (store) { return store.getSuspendSelectors(); } return parent && parent.suspendSelect(storeName); } function dispatch3(storeNameOrDescriptor) { const storeName = getStoreName(storeNameOrDescriptor); const store = stores[storeName]; if (store) { return store.getActions(); } return parent && parent.dispatch(storeName); } function withPlugins(attributes) { return Object.fromEntries( Object.entries(attributes).map(([key, attribute]) => { if (typeof attribute !== "function") { return [key, attribute]; } return [ key, function() { return registry[key].apply(null, arguments); } ]; }) ); } function registerStoreInstance(name, createStore2) { if (stores[name]) { console.error('Store "' + name + '" is already registered.'); return stores[name]; } const store = createStore2(); if (typeof store.getSelectors !== "function") { throw new TypeError("store.getSelectors must be a function"); } if (typeof store.getActions !== "function") { throw new TypeError("store.getActions must be a function"); } if (typeof store.subscribe !== "function") { throw new TypeError("store.subscribe must be a function"); } store.emitter = createEmitter(); const currentSubscribe = store.subscribe; store.subscribe = (listener) => { const unsubscribeFromEmitter = store.emitter.subscribe(listener); const unsubscribeFromStore = currentSubscribe(() => { if (store.emitter.isPaused) { store.emitter.emit(); return; } listener(); }); return () => { unsubscribeFromStore?.(); unsubscribeFromEmitter?.(); }; }; stores[name] = store; store.subscribe(globalListener); if (parent) { try { unlock(store.store).registerPrivateActions( unlock(parent).privateActionsOf(name) ); unlock(store.store).registerPrivateSelectors( unlock(parent).privateSelectorsOf(name) ); } catch (e) { } } return store; } function register2(store) { registerStoreInstance( store.name, () => store.instantiate(registry) ); } function registerGenericStore2(name, store) { (0, import_deprecated2.default)("wp.data.registerGenericStore", { since: "5.9", alternative: "wp.data.register( storeDescriptor )" }); registerStoreInstance(name, () => store); } function registerStore2(storeName, options) { if (!options.reducer) { throw new TypeError("Must specify store reducer"); } const store = registerStoreInstance( storeName, () => createReduxStore(storeName, options).instantiate(registry) ); return store.store; } function batch(callback) { if (emitter.isPaused) { callback(); return; } emitter.pause(); Object.values(stores).forEach((store) => store.emitter.pause()); try { callback(); } finally { emitter.resume(); Object.values(stores).forEach( (store) => store.emitter.resume() ); } } let registry = { batch, stores, namespaces: stores, // TODO: Deprecate/remove this. subscribe: subscribe2, select: select3, resolveSelect: resolveSelect3, suspendSelect: suspendSelect2, dispatch: dispatch3, use: use2, register: register2, registerGenericStore: registerGenericStore2, registerStore: registerStore2, __unstableMarkListeningStores }; function use2(plugin, options) { if (!plugin) { return; } registry = { ...registry, ...plugin(registry, options) }; return registry; } registry.register(store_default); for (const [name, config] of Object.entries(storeConfigs)) { registry.register(createReduxStore(name, config)); } if (parent) { parent.subscribe(globalListener); } const registryWithPlugins = withPlugins(registry); lock(registryWithPlugins, { privateActionsOf: (name) => { try { return unlock(stores[name].store).privateActions; } catch (e) { return {}; } }, privateSelectorsOf: (name) => { try { return unlock(stores[name].store).privateSelectors; } catch (e) { return {}; } } }); return registryWithPlugins; } // packages/data/build-module/default-registry.mjs var default_registry_default = createRegistry(); // packages/data/build-module/plugins/index.mjs var plugins_exports = {}; __export(plugins_exports, { persistence: () => persistence_default }); // node_modules/is-plain-object/dist/is-plain-object.mjs function isObject2(o) { return Object.prototype.toString.call(o) === "[object Object]"; } function isPlainObject2(o) { var ctor, prot; if (isObject2(o) === false) return false; ctor = o.constructor; if (ctor === void 0) return true; prot = ctor.prototype; if (isObject2(prot) === false) return false; if (prot.hasOwnProperty("isPrototypeOf") === false) { return false; } return true; } // packages/data/build-module/plugins/persistence/index.mjs var import_deepmerge = __toESM(require_cjs(), 1); // packages/data/build-module/plugins/persistence/storage/object.mjs var objectStorage; var storage = { getItem(key) { if (!objectStorage || !objectStorage[key]) { return null; } return objectStorage[key]; }, setItem(key, value) { if (!objectStorage) { storage.clear(); } objectStorage[key] = String(value); }, clear() { objectStorage = /* @__PURE__ */ Object.create(null); } }; var object_default = storage; // packages/data/build-module/plugins/persistence/storage/default.mjs var storage2; try { storage2 = window.localStorage; storage2.setItem("__wpDataTestLocalStorage", ""); storage2.removeItem("__wpDataTestLocalStorage"); } catch (error) { storage2 = object_default; } var default_default = storage2; // packages/data/build-module/plugins/persistence/index.mjs var DEFAULT_STORAGE = default_default; var DEFAULT_STORAGE_KEY = "WP_DATA"; var withLazySameState = (reducer) => (state, action) => { if (action.nextState === state) { return state; } return reducer(state, action); }; function createPersistenceInterface(options) { const { storage: storage3 = DEFAULT_STORAGE, storageKey = DEFAULT_STORAGE_KEY } = options; let data; function getData() { if (data === void 0) { const persisted = storage3.getItem(storageKey); if (persisted === null) { data = {}; } else { try { data = JSON.parse(persisted); } catch (error) { data = {}; } } } return data; } function setData(key, value) { data = { ...data, [key]: value }; storage3.setItem(storageKey, JSON.stringify(data)); } return { get: getData, set: setData }; } function persistencePlugin(registry, pluginOptions) { const persistence = createPersistenceInterface(pluginOptions); function createPersistOnChange(getState, storeName, keys) { let getPersistedState; if (Array.isArray(keys)) { const reducers = keys.reduce( (accumulator, key) => Object.assign(accumulator, { [key]: (state, action) => action.nextState[key] }), {} ); getPersistedState = withLazySameState( combineReducers2(reducers) ); } else { getPersistedState = (state, action) => action.nextState; } let lastState = getPersistedState(void 0, { nextState: getState() }); return () => { const state = getPersistedState(lastState, { nextState: getState() }); if (state !== lastState) { persistence.set(storeName, state); lastState = state; } }; } return { registerStore(storeName, options) { if (!options.persist) { return registry.registerStore(storeName, options); } const persistedState = persistence.get()[storeName]; if (persistedState !== void 0) { let initialState = options.reducer(options.initialState, { type: "@@WP/PERSISTENCE_RESTORE" }); if (isPlainObject2(initialState) && isPlainObject2(persistedState)) { initialState = (0, import_deepmerge.default)(initialState, persistedState, { isMergeableObject: isPlainObject2 }); } else { initialState = persistedState; } options = { ...options, initialState }; } const store = registry.registerStore(storeName, options); store.subscribe( createPersistOnChange( store.getState, storeName, options.persist ) ); return store; } }; } persistencePlugin.__unstableMigrate = () => { }; var persistence_default = persistencePlugin; // packages/data/build-module/components/with-select/index.mjs var import_compose2 = __toESM(require_compose(), 1); // packages/data/build-module/components/use-select/index.mjs var import_priority_queue = __toESM(require_priority_queue(), 1); var import_element5 = __toESM(require_element(), 1); var import_is_shallow_equal = __toESM(require_is_shallow_equal(), 1); // packages/data/build-module/components/registry-provider/use-registry.mjs var import_element2 = __toESM(require_element(), 1); // packages/data/build-module/components/registry-provider/context.mjs var import_element = __toESM(require_element(), 1); var Context = (0, import_element.createContext)(default_registry_default); Context.displayName = "RegistryProviderContext"; var { Consumer, Provider } = Context; var RegistryConsumer = Consumer; var context_default = Provider; // packages/data/build-module/components/registry-provider/use-registry.mjs function useRegistry() { return (0, import_element2.useContext)(Context); } // packages/data/build-module/components/async-mode-provider/use-async-mode.mjs var import_element4 = __toESM(require_element(), 1); // packages/data/build-module/components/async-mode-provider/context.mjs var import_element3 = __toESM(require_element(), 1); var Context2 = (0, import_element3.createContext)(false); Context2.displayName = "AsyncModeContext"; var { Consumer: Consumer2, Provider: Provider2 } = Context2; var context_default2 = Provider2; // packages/data/build-module/components/async-mode-provider/use-async-mode.mjs function useAsyncMode() { return (0, import_element4.useContext)(Context2); } // packages/data/build-module/components/use-select/index.mjs var renderQueue = (0, import_priority_queue.createQueue)(); function warnOnUnstableReference(a, b) { if (!a || !b) { return; } const keys = typeof a === "object" && typeof b === "object" ? Object.keys(a).filter((k) => a[k] !== b[k]) : []; console.warn( "The `useSelect` hook returns different values when called with the same state and parameters.\nThis can lead to unnecessary re-renders and performance issues if not fixed.\n\nNon-equal value keys: %s\n\n", keys.join(", ") ); } function Store(registry, suspense) { const select3 = suspense ? registry.suspendSelect : registry.select; const queueContext = {}; let lastMapSelect; let lastMapResult; let lastMapResultValid = false; let lastIsAsync; let subscriber; let didWarnUnstableReference; const storeStatesOnMount = /* @__PURE__ */ new Map(); function getStoreState(name) { return registry.stores[name]?.store?.getState?.() ?? {}; } const createSubscriber = (stores) => { const activeStores = [...stores]; const activeSubscriptions = /* @__PURE__ */ new Set(); function subscribe2(listener) { if (lastMapResultValid) { for (const name of activeStores) { if (storeStatesOnMount.get(name) !== getStoreState(name)) { lastMapResultValid = false; } } } storeStatesOnMount.clear(); const onStoreChange = () => { lastMapResultValid = false; listener(); }; const onChange = () => { if (lastIsAsync) { renderQueue.add(queueContext, onStoreChange); } else { onStoreChange(); } }; const unsubs = []; function subscribeStore(storeName) { unsubs.push(registry.subscribe(onChange, storeName)); } for (const storeName of activeStores) { subscribeStore(storeName); } activeSubscriptions.add(subscribeStore); return () => { activeSubscriptions.delete(subscribeStore); for (const unsub of unsubs.values()) { unsub?.(); } renderQueue.cancel(queueContext); }; } function updateStores(newStores) { for (const newStore of newStores) { if (activeStores.includes(newStore)) { continue; } activeStores.push(newStore); for (const subscription of activeSubscriptions) { subscription(newStore); } } } return { subscribe: subscribe2, updateStores }; }; return (mapSelect, isAsync) => { function updateValue() { if (lastMapResultValid && mapSelect === lastMapSelect) { return lastMapResult; } const listeningStores = { current: null }; const mapResult = registry.__unstableMarkListeningStores( () => mapSelect(select3, registry), listeningStores ); if (true) { if (!didWarnUnstableReference) { const secondMapResult = mapSelect(select3, registry); if (!(0, import_is_shallow_equal.isShallowEqual)(mapResult, secondMapResult)) { warnOnUnstableReference(mapResult, secondMapResult); didWarnUnstableReference = true; } } } if (!subscriber) { for (const name of listeningStores.current) { storeStatesOnMount.set(name, getStoreState(name)); } subscriber = createSubscriber(listeningStores.current); } else { subscriber.updateStores(listeningStores.current); } if (!(0, import_is_shallow_equal.isShallowEqual)(lastMapResult, mapResult)) { lastMapResult = mapResult; } lastMapSelect = mapSelect; lastMapResultValid = true; } function getValue() { updateValue(); return lastMapResult; } if (lastIsAsync && !isAsync) { lastMapResultValid = false; renderQueue.cancel(queueContext); } updateValue(); lastIsAsync = isAsync; return { subscribe: subscriber.subscribe, getValue }; }; } function _useStaticSelect(storeName) { return useRegistry().select(storeName); } function _useMappingSelect(suspense, mapSelect, deps) { const registry = useRegistry(); const isAsync = useAsyncMode(); const store = (0, import_element5.useMemo)( () => Store(registry, suspense), [registry, suspense] ); const selector = (0, import_element5.useCallback)(mapSelect, deps); const { subscribe: subscribe2, getValue } = store(selector, isAsync); const result = (0, import_element5.useSyncExternalStore)(subscribe2, getValue, getValue); (0, import_element5.useDebugValue)(result); return result; } function useSelect(mapSelect, deps) { const staticSelectMode = typeof mapSelect !== "function"; const staticSelectModeRef = (0, import_element5.useRef)(staticSelectMode); if (staticSelectMode !== staticSelectModeRef.current) { const prevMode = staticSelectModeRef.current ? "static" : "mapping"; const nextMode = staticSelectMode ? "static" : "mapping"; throw new Error( `Switching useSelect from ${prevMode} to ${nextMode} is not allowed` ); } return staticSelectMode ? _useStaticSelect(mapSelect) : _useMappingSelect(false, mapSelect, deps); } function useSuspenseSelect(mapSelect, deps) { return _useMappingSelect(true, mapSelect, deps); } // packages/data/build-module/components/with-select/index.mjs var import_jsx_runtime = __toESM(require_jsx_runtime(), 1); var withSelect = (mapSelectToProps) => (0, import_compose2.createHigherOrderComponent)( (WrappedComponent) => (0, import_compose2.pure)((ownProps) => { const mapSelect = (select3, registry) => mapSelectToProps(select3, ownProps, registry); const mergeProps = useSelect(mapSelect); return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(WrappedComponent, { ...ownProps, ...mergeProps }); }), "withSelect" ); var with_select_default = withSelect; // packages/data/build-module/components/with-dispatch/index.mjs var import_compose4 = __toESM(require_compose(), 1); // packages/data/build-module/components/use-dispatch/use-dispatch.mjs var useDispatch = (storeNameOrDescriptor) => { const { dispatch: dispatch3 } = useRegistry(); return storeNameOrDescriptor === void 0 ? dispatch3 : dispatch3(storeNameOrDescriptor); }; var use_dispatch_default = useDispatch; // packages/data/build-module/components/use-dispatch/use-dispatch-with-map.mjs var import_element6 = __toESM(require_element(), 1); var import_compose3 = __toESM(require_compose(), 1); var useDispatchWithMap = (dispatchMap, deps) => { const registry = useRegistry(); const currentDispatchMapRef = (0, import_element6.useRef)(dispatchMap); (0, import_compose3.useIsomorphicLayoutEffect)(() => { currentDispatchMapRef.current = dispatchMap; }); return (0, import_element6.useMemo)(() => { const currentDispatchProps = currentDispatchMapRef.current( registry.dispatch, registry ); return Object.fromEntries( Object.entries(currentDispatchProps).map( ([propName, dispatcher]) => { if (typeof dispatcher !== "function") { console.warn( `Property ${propName} returned from dispatchMap in useDispatchWithMap must be a function.` ); } return [ propName, (...args) => currentDispatchMapRef.current(registry.dispatch, registry)[propName](...args) ]; } ) ); }, [registry, ...deps]); }; var use_dispatch_with_map_default = useDispatchWithMap; // packages/data/build-module/components/with-dispatch/index.mjs var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1); var withDispatch = (mapDispatchToProps) => (0, import_compose4.createHigherOrderComponent)( (WrappedComponent) => (ownProps) => { const mapDispatch = (dispatch3, registry) => mapDispatchToProps(dispatch3, ownProps, registry); const dispatchProps = use_dispatch_with_map_default(mapDispatch, []); return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(WrappedComponent, { ...ownProps, ...dispatchProps }); }, "withDispatch" ); var with_dispatch_default = withDispatch; // packages/data/build-module/components/with-registry/index.mjs var import_compose5 = __toESM(require_compose(), 1); var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1); var withRegistry = (0, import_compose5.createHigherOrderComponent)( (OriginalComponent) => (props) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(RegistryConsumer, { children: (registry) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(OriginalComponent, { ...props, registry }) }), "withRegistry" ); var with_registry_default = withRegistry; // packages/data/build-module/dispatch.mjs function dispatch2(storeNameOrDescriptor) { return default_registry_default.dispatch(storeNameOrDescriptor); } // packages/data/build-module/select.mjs function select2(storeNameOrDescriptor) { return default_registry_default.select(storeNameOrDescriptor); } // packages/data/build-module/index.mjs var defaultRegistry = default_registry_default; var combineReducers2 = combineReducers; function resolveSelect2(storeNameOrDescriptor) { return defaultRegistry.resolveSelect(storeNameOrDescriptor); } var suspendSelect = (storeNameOrDescriptor) => defaultRegistry.suspendSelect(storeNameOrDescriptor); var subscribe = (listener, storeNameOrDescriptor) => defaultRegistry.subscribe(listener, storeNameOrDescriptor); var registerGenericStore = defaultRegistry.registerGenericStore; var registerStore = defaultRegistry.registerStore; var use = defaultRegistry.use; var register = (store) => defaultRegistry.register(store); return __toCommonJS(index_exports); })(); /*! Bundled license information: is-plain-object/dist/is-plain-object.mjs: (*! * is-plain-object <https://github.com/jonschlinkert/is-plain-object> * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. *) */ api-fetch.min.js 0000644 00000014445 15206720414 0007535 0 ustar 00 "use strict";var wp;(wp||={}).apiFetch=(()=>{var $=Object.create;var w=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var G=Object.getOwnPropertyNames;var V=Object.getPrototypeOf,K=Object.prototype.hasOwnProperty;var A=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),X=(e,r)=>{for(var a in r)w(e,a,{get:r[a],enumerable:!0})},x=(e,r,a,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of G(r))!K.call(e,n)&&n!==a&&w(e,n,{get:()=>r[n],enumerable:!(t=q(r,n))||t.enumerable});return e};var f=(e,r,a)=>(a=e!=null?$(V(e)):{},x(r||!e||!e.__esModule?w(a,"default",{value:e,enumerable:!0}):a,e)),B=e=>x(w({},"__esModule",{value:!0}),e);var v=A((ge,O)=>{O.exports=window.wp.i18n});var p=A((Pe,j)=>{j.exports=window.wp.url});var ve={};X(ve,{default:()=>g});var P=f(v(),1);function Y(e){let r=(a,t)=>{let{headers:n={}}=a;for(let d in n)if(d.toLowerCase()==="x-wp-nonce"&&n[d]===r.nonce)return t(a);return t({...a,headers:{...n,"X-WP-Nonce":r.nonce}})};return r.nonce=e,r}var R=Y;var Z=(e,r)=>{let a=e.path,t,n;return typeof e.namespace=="string"&&typeof e.endpoint=="string"&&(t=e.namespace.replace(/^\/|\/$/g,""),n=e.endpoint.replace(/^\//,""),n?a=t+"/"+n:a=t),delete e.namespace,delete e.endpoint,r({...e,path:a})},_=Z;var W=e=>(r,a)=>_(r,t=>{let n=t.url,d=t.path,i;return typeof d=="string"&&(i=e,e.indexOf("?")!==-1&&(d=d.replace("?","&")),d=d.replace(/^\//,""),typeof i=="string"&&i.indexOf("?")!==-1&&(d=d.replace("?","&")),n=i+d),a({...t,url:n})}),b=W;var m=f(p(),1);function ee(e){let r=Object.fromEntries(Object.entries(e).map(([a,t])=>[(0,m.normalizePath)(a),t]));return(a,t)=>{let{parse:n=!0}=a,d=a.path;if(!d&&a.url){let{rest_route:s,...o}=(0,m.getQueryArgs)(a.url);typeof s=="string"&&(d=(0,m.addQueryArgs)(s,o))}if(typeof d!="string")return t(a);let i=a.method||"GET",l=(0,m.normalizePath)(d);if(i==="GET"&&r[l]){let s=r[l];return delete r[l],U(s,!!n)}else if(i==="OPTIONS"&&r[i]&&r[i][l]){let s=r[i][l];return delete r[i][l],U(s,!!n)}return t(a)}}function U(e,r){if(r)return Promise.resolve(e.body);try{return Promise.resolve(new window.Response(JSON.stringify(e.body),{status:200,statusText:"OK",headers:e.headers}))}catch{return Object.entries(e.headers).forEach(([a,t])=>{a.toLowerCase()==="link"&&(e.headers[a]=t.replace(/<([^>]+)>/,(n,d)=>`<${encodeURI(d)}>`))}),Promise.resolve(r?e.body:new window.Response(JSON.stringify(e.body),{status:200,statusText:"OK",headers:e.headers}))}}var N=ee;var M=f(p(),1);var re=({path:e,url:r,...a},t)=>({...a,url:r&&(0,M.addQueryArgs)(r,t),path:e&&(0,M.addQueryArgs)(e,t)}),L=e=>e.json?e.json():Promise.reject(e),ae=e=>{if(!e)return{};let r=e.match(/<([^>]+)>; rel="next"/);return r?{next:r[1]}:{}},S=e=>{let{next:r}=ae(e.headers.get("link"));return r},te=e=>{let r=!!e.path&&e.path.indexOf("per_page=-1")!==-1,a=!!e.url&&e.url.indexOf("per_page=-1")!==-1;return r||a},de=async(e,r)=>{if(e.parse===!1||!te(e))return r(e);let a=await g({...re(e,{per_page:100}),parse:!1}),t=await L(a);if(!Array.isArray(t))return t;let n=S(a);if(!n)return t;let d=[].concat(t);for(;n;){let i=await g({...e,path:void 0,url:n,parse:!1}),l=await L(i);d=d.concat(l),n=S(i)}return d},E=de;var ne=new Set(["PATCH","PUT","DELETE"]),ie="GET",le=(e,r)=>{let{method:a=ie}=e;return ne.has(a.toUpperCase())&&(e={...e,headers:{...e.headers,"X-HTTP-Method-Override":a,"Content-Type":"application/json"},method:"POST"}),r(e)},H=le;var h=f(p(),1),ce=(e,r)=>(typeof e.url=="string"&&!(0,h.hasQueryArg)(e.url,"_locale")&&(e.url=(0,h.addQueryArgs)(e.url,{_locale:"user"})),typeof e.path=="string"&&!(0,h.hasQueryArg)(e.path,"_locale")&&(e.path=(0,h.addQueryArgs)(e.path,{_locale:"user"})),r(e)),Q=ce;var I=f(v(),1);var C=f(v(),1);async function F(e){try{return await e.json()}catch{throw{code:"invalid_json",message:(0,C.__)("The response is not a valid JSON response.")}}}async function y(e,r=!0){return r?e.status===204?null:await F(e):e}async function T(e,r=!0){throw r?await F(e):e}function oe(e){let r=!!e.method&&e.method==="POST";return(!!e.path&&e.path.indexOf("/wp/v2/media")!==-1||!!e.url&&e.url.indexOf("/wp/v2/media")!==-1)&&r}var ue=(e,r)=>{if(!oe(e))return r(e);let a=0,t=5,n=d=>(a++,r({path:`/wp/v2/media/${d}/post-process`,method:"POST",data:{action:"create-image-subsizes"},parse:!1}).catch(()=>a<t?n(d):(r({path:`/wp/v2/media/${d}?force=true`,method:"DELETE"}),Promise.reject())));return r({...e,parse:!1}).catch(d=>{if(!(d instanceof globalThis.Response))return Promise.reject(d);let i=d.headers.get("x-wp-upload-attachment-id");return d.status>=500&&d.status<600&&i?n(i).catch(()=>e.parse!==!1?Promise.reject({code:"post_process",message:(0,I.__)("Media upload failed. If this is a photo or a large image, please scale it down and try again.")}):Promise.reject(d)):T(d,e.parse)}).then(d=>y(d,e.parse))},z=ue;var u=f(p(),1),se=e=>(r,a)=>{if(typeof r.url=="string"){let t=(0,u.getQueryArg)(r.url,"wp_theme_preview");t===void 0?r.url=(0,u.addQueryArgs)(r.url,{wp_theme_preview:e}):t===""&&(r.url=(0,u.removeQueryArgs)(r.url,"wp_theme_preview"))}if(typeof r.path=="string"){let t=(0,u.getQueryArg)(r.path,"wp_theme_preview");t===void 0?r.path=(0,u.addQueryArgs)(r.path,{wp_theme_preview:e}):t===""&&(r.path=(0,u.removeQueryArgs)(r.path,"wp_theme_preview"))}return a(r)},k=se;var fe={Accept:"application/json, */*;q=0.1"},me={credentials:"include"},J=[Q,_,H,E];function he(e){J.unshift(e)}var pe=e=>{let{url:r,path:a,data:t,parse:n=!0,...d}=e,{body:i,headers:l}=e;return l={...fe,...l},t&&(i=JSON.stringify(t),l["Content-Type"]="application/json"),globalThis.fetch(r||a||window.location.href,{...me,...d,body:i,headers:l}).then(o=>o.ok?y(o,n):T(o,n),o=>{throw o&&o.name==="AbortError"?o:globalThis.navigator.onLine?{code:"fetch_error",message:(0,P.__)("Could not get a valid response from the server.")}:{code:"offline_error",message:(0,P.__)("Unable to connect. Please check your Internet connection.")}})},D=pe;function we(e){D=e}var c=e=>J.reduceRight((a,t)=>n=>t(n,a),D)(e).catch(a=>a.code!=="rest_cookie_invalid_nonce"?Promise.reject(a):globalThis.fetch(c.nonceEndpoint).then(t=>t.ok?t.text():Promise.reject(a)).then(t=>(c.nonceMiddleware.nonce=t,c(e))));c.use=he;c.setFetchHandler=we;c.createNonceMiddleware=R;c.createPreloadingMiddleware=N;c.createRootURLMiddleware=b;c.fetchAllMiddleware=E;c.mediaUploadMiddleware=z;c.createThemePreviewMiddleware=k;var g=c;return B(ve);})(); if (typeof wp.apiFetch === 'object' && wp.apiFetch.default) { wp.apiFetch = wp.apiFetch.default; } warning.js 0000644 00000003027 15206720414 0006552 0 ustar 00 "use strict"; var wp; (wp ||= {}).warning = (() => { var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; 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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // packages/warning/build-module/index.mjs var index_exports = {}; __export(index_exports, { default: () => warning }); // packages/warning/build-module/utils.mjs var logged = /* @__PURE__ */ new Set(); // packages/warning/build-module/index.mjs function isDev() { return true; } function warning(message) { if (!isDev()) { return; } if (logged.has(message)) { return; } console.warn(message); try { throw Error(message); } catch (x) { } logged.add(message); } return __toCommonJS(index_exports); })(); if (typeof wp.warning === 'object' && wp.warning.default) { wp.warning = wp.warning.default; } shortcode.js 0000644 00000017726 15206720414 0007112 0 ustar 00 "use strict"; var wp; (wp ||= {}).shortcode = (() => { var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; 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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // packages/shortcode/build-module/index.mjs var index_exports = {}; __export(index_exports, { attrs: () => attrs, default: () => index_default, fromMatch: () => fromMatch, next: () => next, regexp: () => regexp, replace: () => replace, string: () => string }); // node_modules/memize/dist/index.js function memize(fn, options) { var size = 0; var head; var tail; options = options || {}; function memoized() { var node = head, len = arguments.length, args, i; searchCache: while (node) { if (node.args.length !== arguments.length) { node = node.next; continue; } for (i = 0; i < len; i++) { if (node.args[i] !== arguments[i]) { node = node.next; continue searchCache; } } if (node !== head) { if (node === tail) { tail = node.prev; } node.prev.next = node.next; if (node.next) { node.next.prev = node.prev; } node.next = head; node.prev = null; head.prev = node; head = node; } return node.val; } args = new Array(len); for (i = 0; i < len; i++) { args[i] = arguments[i]; } node = { args, // Generate the result from original function val: fn.apply(null, args) }; if (head) { head.prev = node; node.next = head; } else { tail = node; } if (size === /** @type {MemizeOptions} */ options.maxSize) { tail = /** @type {MemizeCacheNode} */ tail.prev; tail.next = null; } else { size++; } head = node; return node.val; } memoized.clear = function() { head = null; tail = null; size = 0; }; return memoized; } // packages/shortcode/build-module/index.mjs function next(tag, text, index = 0) { const re = regexp(tag); re.lastIndex = index; const match = re.exec(text); if (!match) { return; } if ("[" === match[1] && "]" === match[7]) { return next(tag, text, re.lastIndex); } const result = { index: match.index, content: match[0], shortcode: fromMatch(match) }; if (match[1]) { result.content = result.content.slice(1); result.index++; } if (match[7]) { result.content = result.content.slice(0, -1); } return result; } function replace(tag, text, callback) { return text.replace( regexp(tag), // Let us use spread syntax to capture the arguments object. (...args) => { const match = args[0]; const left = args[1]; const right = args[7]; if (left === "[" && right === "]") { return match; } const result = callback(fromMatch(args)); return result || result === "" ? left + result + right : match; } ); } function string(options) { return new Shortcode(options).string(); } function regexp(tag) { return new RegExp( "\\[(\\[?)(" + tag + ")(?![\\w-])([^\\]\\/]*(?:\\/(?!\\])[^\\]\\/]*)*?)(?:(\\/)\\]|\\](?:([^\\[]*(?:\\[(?!\\/\\2\\])[^\\[]*)*)(\\[\\/\\2\\]))?)(\\]?)", "g" ); } var attrs = memize((text) => { const named = {}; const numeric = []; const pattern = /([\w-]+)\s*=\s*"([^"]*)"(?:\s|$)|([\w-]+)\s*=\s*'([^']*)'(?:\s|$)|([\w-]+)\s*=\s*([^\s'"]+)(?:\s|$)|"([^"]*)"(?:\s|$)|'([^']*)'(?:\s|$)|(\S+)(?:\s|$)/g; text = text.replace(/[\u00a0\u200b]/g, " "); let match; while (match = pattern.exec(text)) { if (match[1]) { named[match[1].toLowerCase()] = match[2]; } else if (match[3]) { named[match[3].toLowerCase()] = match[4]; } else if (match[5]) { named[match[5].toLowerCase()] = match[6]; } else if (match[7]) { numeric.push(match[7]); } else if (match[8]) { numeric.push(match[8]); } else if (match[9]) { numeric.push(match[9]); } } return { named, numeric }; }); function fromMatch(match) { let type; if (match[4]) { type = "self-closing"; } else if (match[6]) { type = "closed"; } else { type = "single"; } return new Shortcode({ tag: match[2], attrs: match[3], type, content: match[5] }); } var Shortcode = class { // Instance properties tag; type; content; attrs; // Static methods static next = next; static replace = replace; static string = string; static regexp = regexp; static attrs = attrs; static fromMatch = fromMatch; constructor(options) { const { tag, attrs: attributes, type, content } = options; this.tag = tag; this.type = type; this.content = content; this.attrs = { named: {}, numeric: [] }; if (!attributes) { return; } if (typeof attributes === "string") { this.attrs = attrs(attributes); } else if ("named" in attributes && "numeric" in attributes && attributes.named !== void 0 && attributes.numeric !== void 0) { this.attrs = attributes; } else { Object.entries(attributes).forEach(([key, value]) => { if (value !== void 0) { this.set(key, String(value)); } }); } } /** * Get a shortcode attribute. * * Automatically detects whether `attr` is named or numeric and routes it * accordingly. * * @param attr Attribute key. * * @return Attribute value. */ get(attr) { if (typeof attr === "number") { return this.attrs.numeric[attr]; } return this.attrs.named[attr]; } /** * Set a shortcode attribute. * * Automatically detects whether `attr` is named or numeric and routes it * accordingly. * * @param attr Attribute key. * @param value Attribute value. * * @return Shortcode instance. */ set(attr, value) { if (typeof attr === "number") { this.attrs.numeric[attr] = value; } else { this.attrs.named[attr] = value; } return this; } /** * Transform the shortcode into a string. * * @return String representation of the shortcode. */ string() { let text = "[" + this.tag; this.attrs.numeric.forEach((value) => { if (/\s/.test(value)) { text += ' "' + value + '"'; } else { text += " " + value; } }); Object.entries(this.attrs.named).forEach(([name, value]) => { text += " " + name + '="' + value + '"'; }); if ("single" === this.type) { return text + "]"; } else if ("self-closing" === this.type) { return text + " /]"; } text += "]"; if (this.content) { text += this.content; } return text + "[/" + this.tag + "]"; } }; var index_default = Shortcode; return __toCommonJS(index_exports); })(); if (typeof wp.shortcode === 'object' && wp.shortcode.default) { wp.shortcode = wp.shortcode.default; } dom.js 0000644 00000105165 15206720414 0005672 0 ustar 00 "use strict"; var wp; (wp ||= {}).dom = (() => { 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 __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; 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 )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // package-external:@wordpress/deprecated var require_deprecated = __commonJS({ "package-external:@wordpress/deprecated"(exports, module) { module.exports = window.wp.deprecated; } }); // packages/dom/build-module/index.mjs var index_exports = {}; __export(index_exports, { __unstableStripHTML: () => stripHTML, computeCaretRect: () => computeCaretRect, documentHasSelection: () => documentHasSelection, documentHasTextSelection: () => documentHasTextSelection, documentHasUncollapsedSelection: () => documentHasUncollapsedSelection, focus: () => focus, getFilesFromDataTransfer: () => getFilesFromDataTransfer, getOffsetParent: () => getOffsetParent, getPhrasingContentSchema: () => getPhrasingContentSchema, getRectangleFromRange: () => getRectangleFromRange, getScrollContainer: () => getScrollContainer, insertAfter: () => insertAfter, isEmpty: () => isEmpty, isEntirelySelected: () => isEntirelySelected, isFormElement: () => isFormElement, isHorizontalEdge: () => isHorizontalEdge, isNumberInput: () => isNumberInput, isPhrasingContent: () => isPhrasingContent, isRTL: () => isRTL, isSelectionForward: () => isSelectionForward, isTextContent: () => isTextContent, isTextField: () => isTextField, isVerticalEdge: () => isVerticalEdge, placeCaretAtHorizontalEdge: () => placeCaretAtHorizontalEdge, placeCaretAtVerticalEdge: () => placeCaretAtVerticalEdge, remove: () => remove, removeInvalidHTML: () => removeInvalidHTML, replace: () => replace, replaceTag: () => replaceTag, safeHTML: () => safeHTML, unwrap: () => unwrap, wrap: () => wrap }); // packages/dom/build-module/focusable.mjs var focusable_exports = {}; __export(focusable_exports, { find: () => find }); function buildSelector(sequential) { return [ sequential ? '[tabindex]:not([tabindex^="-"])' : "[tabindex]", "a[href]", "button:not([disabled])", 'input:not([type="hidden"]):not([disabled])', "select:not([disabled])", "textarea:not([disabled])", 'iframe:not([tabindex^="-"])', "object", "embed", "summary", "area[href]", "[contenteditable]:not([contenteditable=false])" ].join(","); } function isVisible(element) { return element.offsetWidth > 0 || element.offsetHeight > 0 || element.getClientRects().length > 0; } function isValidFocusableArea(element) { const map = element.closest("map[name]"); if (!map) { return false; } const img = element.ownerDocument.querySelector( 'img[usemap="#' + map.name + '"]' ); return !!img && isVisible(img); } function find(context, { sequential = false } = {}) { const elements = context.querySelectorAll(buildSelector(sequential)); return Array.from(elements).filter((element) => { if (!isVisible(element)) { return false; } if (element.closest("[inert]")) { return false; } const { nodeName } = element; if ("AREA" === nodeName) { return isValidFocusableArea( /** @type {HTMLAreaElement} */ element ); } return true; }); } // packages/dom/build-module/tabbable.mjs var tabbable_exports = {}; __export(tabbable_exports, { find: () => find2, findNext: () => findNext, findPrevious: () => findPrevious, isTabbableIndex: () => isTabbableIndex }); function getTabIndex(element) { const tabIndex = element.getAttribute("tabindex"); return tabIndex === null ? 0 : parseInt(tabIndex, 10); } function isTabbableIndex(element) { return getTabIndex(element) !== -1; } function createStatefulCollapseRadioGroup() { const CHOSEN_RADIO_BY_NAME = {}; return function collapseRadioGroup(result, element) { const { nodeName, type, checked, name } = element; if (nodeName !== "INPUT" || type !== "radio" || !name) { return result.concat(element); } const hasChosen = CHOSEN_RADIO_BY_NAME.hasOwnProperty(name); const isChosen = checked || !hasChosen; if (!isChosen) { return result; } if (hasChosen) { const hadChosenElement = CHOSEN_RADIO_BY_NAME[name]; result = result.filter((e) => e !== hadChosenElement); } CHOSEN_RADIO_BY_NAME[name] = element; return result.concat(element); }; } function mapElementToObjectTabbable(element, index) { return { element, index }; } function mapObjectTabbableToElement(object) { return object.element; } function compareObjectTabbables(a, b) { const aTabIndex = getTabIndex(a.element); const bTabIndex = getTabIndex(b.element); if (aTabIndex === bTabIndex) { return a.index - b.index; } return aTabIndex - bTabIndex; } function filterTabbable(focusables) { return focusables.filter(isTabbableIndex).map(mapElementToObjectTabbable).sort(compareObjectTabbables).map(mapObjectTabbableToElement).reduce(createStatefulCollapseRadioGroup(), []); } function find2(context) { return filterTabbable(find(context)); } function findPrevious(element) { return filterTabbable(find(element.ownerDocument.body)).reverse().find( (focusable) => ( // eslint-disable-next-line no-bitwise element.compareDocumentPosition(focusable) & element.DOCUMENT_POSITION_PRECEDING ) ); } function findNext(element) { return filterTabbable(find(element.ownerDocument.body)).find( (focusable) => ( // eslint-disable-next-line no-bitwise element.compareDocumentPosition(focusable) & element.DOCUMENT_POSITION_FOLLOWING ) ); } // packages/dom/build-module/utils/assert-is-defined.mjs function assertIsDefined(val, name) { if (val === void 0 || val === null) { throw new Error( `Expected '${name}' to be defined, but received ${val}` ); } } // packages/dom/build-module/dom/get-rectangle-from-range.mjs function getRectangleFromRange(range) { if (!range.collapsed) { const rects2 = Array.from(range.getClientRects()); if (rects2.length === 1) { return rects2[0]; } const filteredRects = rects2.filter(({ width }) => width > 1); if (filteredRects.length === 0) { return range.getBoundingClientRect(); } if (filteredRects.length === 1) { return filteredRects[0]; } let { top: furthestTop, bottom: furthestBottom, left: furthestLeft, right: furthestRight } = filteredRects[0]; for (const { top, bottom, left, right } of filteredRects) { if (top < furthestTop) { furthestTop = top; } if (bottom > furthestBottom) { furthestBottom = bottom; } if (left < furthestLeft) { furthestLeft = left; } if (right > furthestRight) { furthestRight = right; } } return new window.DOMRect( furthestLeft, furthestTop, furthestRight - furthestLeft, furthestBottom - furthestTop ); } const { startContainer } = range; const { ownerDocument } = startContainer; if (startContainer.nodeName === "BR") { const { parentNode } = startContainer; assertIsDefined(parentNode, "parentNode"); const index = ( /** @type {Node[]} */ Array.from(parentNode.childNodes).indexOf(startContainer) ); assertIsDefined(ownerDocument, "ownerDocument"); range = ownerDocument.createRange(); range.setStart(parentNode, index); range.setEnd(parentNode, index); } const rects = range.getClientRects(); if (rects.length > 1) { return null; } let rect = rects[0]; if (!rect || rect.height === 0) { assertIsDefined(ownerDocument, "ownerDocument"); const padNode = ownerDocument.createTextNode("\u200B"); range = range.cloneRange(); range.insertNode(padNode); rect = range.getClientRects()[0]; assertIsDefined(padNode.parentNode, "padNode.parentNode"); padNode.parentNode.removeChild(padNode); } return rect; } // packages/dom/build-module/dom/compute-caret-rect.mjs function computeCaretRect(win) { const selection = win.getSelection(); assertIsDefined(selection, "selection"); const range = selection.rangeCount ? selection.getRangeAt(0) : null; if (!range) { return null; } return getRectangleFromRange(range); } // packages/dom/build-module/dom/document-has-text-selection.mjs function documentHasTextSelection(doc) { assertIsDefined(doc.defaultView, "doc.defaultView"); const selection = doc.defaultView.getSelection(); assertIsDefined(selection, "selection"); const range = selection.rangeCount ? selection.getRangeAt(0) : null; return !!range && !range.collapsed; } // packages/dom/build-module/dom/is-html-input-element.mjs function isHTMLInputElement(node) { return node?.nodeName === "INPUT"; } // packages/dom/build-module/dom/is-text-field.mjs function isTextField(node) { const nonTextInputs = [ "button", "checkbox", "hidden", "file", "radio", "image", "range", "reset", "submit", "number", "email", "time" ]; return isHTMLInputElement(node) && node.type && !nonTextInputs.includes(node.type) || node.nodeName === "TEXTAREA" || /** @type {HTMLElement} */ node.contentEditable === "true"; } // packages/dom/build-module/dom/input-field-has-uncollapsed-selection.mjs function inputFieldHasUncollapsedSelection(element) { if (!isHTMLInputElement(element) && !isTextField(element)) { return false; } try { const { selectionStart, selectionEnd } = ( /** @type {HTMLInputElement | HTMLTextAreaElement} */ element ); return ( // `null` means the input type doesn't implement selection, thus we // cannot determine whether the selection is collapsed, so we // default to true. selectionStart === null || // when not null, compare the two points selectionStart !== selectionEnd ); } catch (error) { return true; } } // packages/dom/build-module/dom/document-has-uncollapsed-selection.mjs function documentHasUncollapsedSelection(doc) { return documentHasTextSelection(doc) || !!doc.activeElement && inputFieldHasUncollapsedSelection(doc.activeElement); } // packages/dom/build-module/dom/document-has-selection.mjs function documentHasSelection(doc) { return !!doc.activeElement && (isHTMLInputElement(doc.activeElement) || isTextField(doc.activeElement) || documentHasTextSelection(doc)); } // packages/dom/build-module/dom/get-computed-style.mjs function getComputedStyle(element) { assertIsDefined( element.ownerDocument.defaultView, "element.ownerDocument.defaultView" ); return element.ownerDocument.defaultView.getComputedStyle(element); } // packages/dom/build-module/dom/get-scroll-container.mjs function getScrollContainer(node, direction = "vertical") { if (!node) { return void 0; } if (direction === "vertical" || direction === "all") { if (node.scrollHeight > node.clientHeight) { const { overflowY } = getComputedStyle(node); if (/(auto|scroll)/.test(overflowY)) { return node; } } } if (direction === "horizontal" || direction === "all") { if (node.scrollWidth > node.clientWidth) { const { overflowX } = getComputedStyle(node); if (/(auto|scroll)/.test(overflowX)) { return node; } } } if (node.ownerDocument === node.parentNode) { return node; } return getScrollContainer( /** @type {Element} */ node.parentNode, direction ); } // packages/dom/build-module/dom/get-offset-parent.mjs function getOffsetParent(node) { let closestElement; while (closestElement = /** @type {Node} */ node.parentNode) { if (closestElement.nodeType === closestElement.ELEMENT_NODE) { break; } } if (!closestElement) { return null; } if (getComputedStyle( /** @type {Element} */ closestElement ).position !== "static") { return closestElement; } return ( /** @type {Node & { offsetParent: Node }} */ closestElement.offsetParent ); } // packages/dom/build-module/dom/is-input-or-text-area.mjs function isInputOrTextArea(element) { return element.tagName === "INPUT" || element.tagName === "TEXTAREA"; } // packages/dom/build-module/dom/is-entirely-selected.mjs var ZWNBSP = "\uFEFF"; function isEntirelySelected(element) { if (isInputOrTextArea(element)) { return element.selectionStart === 0 && element.value.length === element.selectionEnd; } if (!element.isContentEditable) { return true; } const text = element.textContent || ""; if (text === "" || text === ZWNBSP) { return true; } const { ownerDocument } = element; const { defaultView } = ownerDocument; assertIsDefined(defaultView, "defaultView"); const selection = defaultView.getSelection(); assertIsDefined(selection, "selection"); const range = selection.rangeCount ? selection.getRangeAt(0) : null; if (!range) { return true; } const { startContainer, endContainer, startOffset, endOffset } = range; if (startContainer === element && endContainer === element && startOffset === 0 && endOffset === element.childNodes.length) { return true; } const lastChild = element.lastChild; assertIsDefined(lastChild, "lastChild"); const endContainerContentLength = endContainer.nodeType === endContainer.TEXT_NODE ? ( /** @type {Text} */ endContainer.data.length ) : endContainer.childNodes.length; return isDeepChild(startContainer, element, "firstChild") && isDeepChild(endContainer, element, "lastChild") && startOffset === 0 && endOffset === endContainerContentLength; } function isDeepChild(query, container, propName) { let candidate = container; do { if (query === candidate) { return true; } candidate = candidate[propName]; while (candidate && candidate.nodeType === candidate.TEXT_NODE && candidate.nodeValue === "") { candidate = candidate[propName === "lastChild" ? "previousSibling" : "nextSibling"]; } } while (candidate); return false; } // packages/dom/build-module/dom/is-form-element.mjs function isFormElement(element) { if (!element) { return false; } const { tagName } = element; const checkForInputTextarea = isInputOrTextArea(element); return checkForInputTextarea || tagName === "BUTTON" || tagName === "SELECT"; } // packages/dom/build-module/dom/is-rtl.mjs function isRTL(element) { return getComputedStyle(element).direction === "rtl"; } // packages/dom/build-module/dom/get-range-height.mjs function getRangeHeight(range) { const rects = Array.from(range.getClientRects()); if (!rects.length) { return; } const highestTop = Math.min(...rects.map(({ top }) => top)); const lowestBottom = Math.max(...rects.map(({ bottom }) => bottom)); return lowestBottom - highestTop; } // packages/dom/build-module/dom/is-selection-forward.mjs function isSelectionForward(selection) { const { anchorNode, focusNode, anchorOffset, focusOffset } = selection; assertIsDefined(anchorNode, "anchorNode"); assertIsDefined(focusNode, "focusNode"); const position = anchorNode.compareDocumentPosition(focusNode); if (position & anchorNode.DOCUMENT_POSITION_PRECEDING) { return false; } if (position & anchorNode.DOCUMENT_POSITION_FOLLOWING) { return true; } if (position === 0) { return anchorOffset <= focusOffset; } return true; } // packages/dom/build-module/dom/caret-range-from-point.mjs function caretRangeFromPoint(doc, x, y) { if (doc.caretRangeFromPoint) { return doc.caretRangeFromPoint(x, y); } if (!doc.caretPositionFromPoint) { return null; } const point = doc.caretPositionFromPoint(x, y); if (!point) { return null; } const range = doc.createRange(); range.setStart(point.offsetNode, point.offset); range.collapse(true); return range; } // packages/dom/build-module/dom/hidden-caret-range-from-point.mjs function hiddenCaretRangeFromPoint(doc, x, y, container) { const originalZIndex = container.style.zIndex; const originalPosition = container.style.position; const originalBorderRadius = container.style.borderRadius; const { position = "static" } = getComputedStyle(container); if (position === "static") { container.style.position = "relative"; } container.style.zIndex = "10000"; container.style.borderRadius = "0"; const range = caretRangeFromPoint(doc, x, y); container.style.zIndex = originalZIndex; container.style.position = originalPosition; container.style.borderRadius = originalBorderRadius; return range; } // packages/dom/build-module/dom/scroll-if-no-range.mjs function scrollIfNoRange(container, alignToTop, callback) { let range = callback(); if (!range || !range.startContainer || !container.contains(range.startContainer)) { container.scrollIntoView(alignToTop); range = callback(); if (!range || !range.startContainer || !container.contains(range.startContainer)) { return null; } } return range; } // packages/dom/build-module/dom/is-edge.mjs function isEdge(container, isReverse, onlyVertical = false) { if (isInputOrTextArea(container) && typeof container.selectionStart === "number") { if (container.selectionStart !== container.selectionEnd) { return false; } if (isReverse) { return container.selectionStart === 0; } return container.value.length === container.selectionStart; } if (!container.isContentEditable) { return true; } const { ownerDocument } = container; const { defaultView } = ownerDocument; assertIsDefined(defaultView, "defaultView"); const selection = defaultView.getSelection(); if (!selection || !selection.rangeCount) { return false; } const range = selection.getRangeAt(0); const collapsedRange = range.cloneRange(); const isForward = isSelectionForward(selection); const isCollapsed = selection.isCollapsed; if (!isCollapsed) { collapsedRange.collapse(!isForward); } const collapsedRangeRect = getRectangleFromRange(collapsedRange); const rangeRect = getRectangleFromRange(range); if (!collapsedRangeRect || !rangeRect) { return false; } const rangeHeight = getRangeHeight(range); if (!isCollapsed && rangeHeight && rangeHeight > collapsedRangeRect.height && isForward === isReverse) { return false; } const isReverseDir = isRTL(container) ? !isReverse : isReverse; const containerRect = container.getBoundingClientRect(); const x = isReverseDir ? containerRect.left + 1 : containerRect.right - 1; const y = isReverse ? containerRect.top + 1 : containerRect.bottom - 1; const testRange = scrollIfNoRange( container, isReverse, () => hiddenCaretRangeFromPoint(ownerDocument, x, y, container) ); if (!testRange) { return false; } const testRect = getRectangleFromRange(testRange); if (!testRect) { return false; } const verticalSide = isReverse ? "top" : "bottom"; const horizontalSide = isReverseDir ? "left" : "right"; const verticalDiff = testRect[verticalSide] - rangeRect[verticalSide]; const horizontalDiff = testRect[horizontalSide] - collapsedRangeRect[horizontalSide]; const hasVerticalDiff = Math.abs(verticalDiff) <= 1; const hasHorizontalDiff = Math.abs(horizontalDiff) <= 1; return onlyVertical ? hasVerticalDiff : hasVerticalDiff && hasHorizontalDiff; } // packages/dom/build-module/dom/is-horizontal-edge.mjs function isHorizontalEdge(container, isReverse) { return isEdge(container, isReverse); } // packages/dom/build-module/dom/is-number-input.mjs var import_deprecated = __toESM(require_deprecated(), 1); function isNumberInput(node) { (0, import_deprecated.default)("wp.dom.isNumberInput", { since: "6.1", version: "6.5" }); return isHTMLInputElement(node) && node.type === "number" && !isNaN(node.valueAsNumber); } // packages/dom/build-module/dom/is-vertical-edge.mjs function isVerticalEdge(container, isReverse) { return isEdge(container, isReverse, true); } // packages/dom/build-module/dom/place-caret-at-edge.mjs function getRange(container, isReverse, x) { const { ownerDocument } = container; const isReverseDir = isRTL(container) ? !isReverse : isReverse; const containerRect = container.getBoundingClientRect(); if (x === void 0) { x = isReverse ? containerRect.right - 1 : containerRect.left + 1; } else if (x <= containerRect.left) { x = containerRect.left + 1; } else if (x >= containerRect.right) { x = containerRect.right - 1; } const y = isReverseDir ? containerRect.bottom - 1 : containerRect.top + 1; return hiddenCaretRangeFromPoint(ownerDocument, x, y, container); } function placeCaretAtEdge(container, isReverse, x) { if (!container) { return; } container.focus(); if (isInputOrTextArea(container)) { if (typeof container.selectionStart !== "number") { return; } if (isReverse) { container.selectionStart = container.value.length; container.selectionEnd = container.value.length; } else { container.selectionStart = 0; container.selectionEnd = 0; } return; } if (!container.isContentEditable) { return; } const range = scrollIfNoRange( container, isReverse, () => getRange(container, isReverse, x) ); if (!range) { return; } const { ownerDocument } = container; const { defaultView } = ownerDocument; assertIsDefined(defaultView, "defaultView"); const selection = defaultView.getSelection(); assertIsDefined(selection, "selection"); selection.removeAllRanges(); selection.addRange(range); } // packages/dom/build-module/dom/place-caret-at-horizontal-edge.mjs function placeCaretAtHorizontalEdge(container, isReverse) { return placeCaretAtEdge(container, isReverse, void 0); } // packages/dom/build-module/dom/place-caret-at-vertical-edge.mjs function placeCaretAtVerticalEdge(container, isReverse, rect) { return placeCaretAtEdge(container, isReverse, rect?.left); } // packages/dom/build-module/dom/insert-after.mjs function insertAfter(newNode, referenceNode) { assertIsDefined(referenceNode.parentNode, "referenceNode.parentNode"); referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling); } // packages/dom/build-module/dom/remove.mjs function remove(node) { assertIsDefined(node.parentNode, "node.parentNode"); node.parentNode.removeChild(node); } // packages/dom/build-module/dom/replace.mjs function replace(processedNode, newNode) { assertIsDefined(processedNode.parentNode, "processedNode.parentNode"); insertAfter(newNode, processedNode.parentNode); remove(processedNode); } // packages/dom/build-module/dom/unwrap.mjs function unwrap(node) { const parent = node.parentNode; assertIsDefined(parent, "node.parentNode"); while (node.firstChild) { parent.insertBefore(node.firstChild, node); } parent.removeChild(node); } // packages/dom/build-module/dom/replace-tag.mjs function replaceTag(node, tagName) { const newNode = node.ownerDocument.createElement(tagName); while (node.firstChild) { newNode.appendChild(node.firstChild); } assertIsDefined(node.parentNode, "node.parentNode"); node.parentNode.replaceChild(newNode, node); return newNode; } // packages/dom/build-module/dom/wrap.mjs function wrap(newNode, referenceNode) { assertIsDefined(referenceNode.parentNode, "referenceNode.parentNode"); referenceNode.parentNode.insertBefore(newNode, referenceNode); newNode.appendChild(referenceNode); } // packages/dom/build-module/dom/safe-html.mjs function safeHTML(html) { const { body } = document.implementation.createHTMLDocument(""); body.innerHTML = html; const elements = body.getElementsByTagName("*"); let elementIndex = elements.length; while (elementIndex--) { const element = elements[elementIndex]; if (element.tagName === "SCRIPT") { remove(element); } else { let attributeIndex = element.attributes.length; while (attributeIndex--) { const { name: key } = element.attributes[attributeIndex]; if (key.startsWith("on")) { element.removeAttribute(key); } } } } return body.innerHTML; } // packages/dom/build-module/dom/strip-html.mjs function stripHTML(html) { html = safeHTML(html); const doc = document.implementation.createHTMLDocument(""); doc.body.innerHTML = html; return doc.body.textContent || ""; } // packages/dom/build-module/dom/is-empty.mjs function isEmpty(element) { switch (element.nodeType) { case element.TEXT_NODE: return /^[ \f\n\r\t\v\u00a0]*$/.test(element.nodeValue || ""); case element.ELEMENT_NODE: if (element.hasAttributes()) { return false; } else if (!element.hasChildNodes()) { return true; } return ( /** @type {Element[]} */ Array.from(element.childNodes).every(isEmpty) ); default: return true; } } // packages/dom/build-module/phrasing-content.mjs var textContentSchema = { strong: {}, em: {}, s: {}, del: {}, ins: {}, a: { attributes: ["href", "target", "rel", "id"] }, code: {}, abbr: { attributes: ["title"] }, sub: {}, sup: {}, br: {}, small: {}, // To do: fix blockquote. // cite: {}, q: { attributes: ["cite"] }, dfn: { attributes: ["title"] }, data: { attributes: ["value"] }, time: { attributes: ["datetime"] }, var: {}, samp: {}, kbd: {}, i: {}, b: {}, u: {}, mark: {}, ruby: {}, rt: {}, rp: {}, bdi: { attributes: ["dir"] }, bdo: { attributes: ["dir"] }, wbr: {}, "#text": {} }; var excludedElements = ["#text", "br"]; Object.keys(textContentSchema).filter((element) => !excludedElements.includes(element)).forEach((tag) => { const { [tag]: removedTag, ...restSchema } = textContentSchema; textContentSchema[tag].children = restSchema; }); var embeddedContentSchema = { audio: { attributes: [ "src", "preload", "autoplay", "mediagroup", "loop", "muted" ] }, canvas: { attributes: ["width", "height"] }, embed: { attributes: ["src", "type", "width", "height"] }, img: { attributes: [ "alt", "src", "srcset", "usemap", "ismap", "width", "height" ] }, object: { attributes: [ "data", "type", "name", "usemap", "form", "width", "height" ] }, video: { attributes: [ "src", "poster", "preload", "playsinline", "autoplay", "mediagroup", "loop", "muted", "controls", "width", "height" ] }, math: { attributes: ["display", "xmlns"], children: "*" } }; var phrasingContentSchema = { ...textContentSchema, ...embeddedContentSchema }; function getPhrasingContentSchema(context) { if (context !== "paste") { return phrasingContentSchema; } const { u, // Used to mark misspelling. Shouldn't be pasted. abbr, // Invisible. data, // Invisible. time, // Invisible. wbr, // Invisible. bdi, // Invisible. bdo, // Invisible. ...remainingContentSchema } = { ...phrasingContentSchema, // We shouldn't paste potentially sensitive information which is not // visible to the user when pasted, so strip the attributes. ins: { children: phrasingContentSchema.ins.children }, del: { children: phrasingContentSchema.del.children } }; return remainingContentSchema; } function isPhrasingContent(node) { const tag = node.nodeName.toLowerCase(); return getPhrasingContentSchema().hasOwnProperty(tag) || tag === "span"; } function isTextContent(node) { const tag = node.nodeName.toLowerCase(); return textContentSchema.hasOwnProperty(tag) || tag === "span"; } // packages/dom/build-module/dom/is-element.mjs function isElement(node) { return !!node && node.nodeType === node.ELEMENT_NODE; } // packages/dom/build-module/dom/clean-node-list.mjs var noop = () => { }; function cleanNodeList(nodeList, doc, schema, inline) { Array.from(nodeList).forEach( (node) => { const tag = node.nodeName.toLowerCase(); if (schema.hasOwnProperty(tag) && (!schema[tag].isMatch || schema[tag].isMatch?.(node))) { if (isElement(node)) { const { attributes = [], classes = [], children, require: require2 = [], allowEmpty } = schema[tag]; if (children && !allowEmpty && isEmpty(node)) { remove(node); return; } if (node.hasAttributes()) { Array.from(node.attributes).forEach(({ name }) => { if (name !== "class" && !attributes.includes(name)) { node.removeAttribute(name); } }); if (node.classList && node.classList.length) { const mattchers = classes.map((item) => { if (item === "*") { return () => true; } else if (typeof item === "string") { return (className) => className === item; } else if (item instanceof RegExp) { return (className) => item.test(className); } return noop; }); Array.from(node.classList).forEach((name) => { if (!mattchers.some( (isMatch) => isMatch(name) )) { node.classList.remove(name); } }); if (!node.classList.length) { node.removeAttribute("class"); } } } if (node.hasChildNodes()) { if (children === "*") { return; } if (children) { if (require2.length && !node.querySelector(require2.join(","))) { cleanNodeList( node.childNodes, doc, schema, inline ); unwrap(node); } else if (node.parentNode && node.parentNode.nodeName === "BODY" && isPhrasingContent(node)) { cleanNodeList( node.childNodes, doc, schema, inline ); if (Array.from(node.childNodes).some( (child) => !isPhrasingContent(child) )) { unwrap(node); } } else { cleanNodeList( node.childNodes, doc, children, inline ); } } else { while (node.firstChild) { remove(node.firstChild); } } } } } else { cleanNodeList(node.childNodes, doc, schema, inline); if (inline && !isPhrasingContent(node) && node.nextElementSibling) { insertAfter(doc.createElement("br"), node); } unwrap(node); } } ); } // packages/dom/build-module/dom/remove-invalid-html.mjs function removeInvalidHTML(HTML, schema, inline) { const doc = document.implementation.createHTMLDocument(""); doc.body.innerHTML = HTML; cleanNodeList(doc.body.childNodes, doc, schema, inline); return doc.body.innerHTML; } // packages/dom/build-module/data-transfer.mjs function getFilesFromDataTransfer(dataTransfer) { const files = Array.from(dataTransfer.files); Array.from(dataTransfer.items).forEach((item) => { const file = item.getAsFile(); if (file && !files.find( ({ name, type, size }) => name === file.name && type === file.type && size === file.size )) { files.push(file); } }); return files; } // packages/dom/build-module/index.mjs var focus = { focusable: focusable_exports, tabbable: tabbable_exports }; return __toCommonJS(index_exports); })(); core-data.js 0000644 00002310036 15206720414 0006747 0 ustar 00 "use strict"; var wp; (wp ||= {}).coreData = (() => { 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 __export = (target, all2) => { for (var name in all2) __defProp(target, name, { get: all2[name], enumerable: true }); }; var __copyProps = (to, from2, except, desc) => { if (from2 && typeof from2 === "object" || typeof from2 === "function") { for (let key of __getOwnPropNames(from2)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from2[key], enumerable: !(desc = __getOwnPropDesc(from2, 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 )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // package-external:@wordpress/data var require_data = __commonJS({ "package-external:@wordpress/data"(exports, module) { module.exports = window.wp.data; } }); // node_modules/fast-deep-equal/es6/index.js var require_es6 = __commonJS({ "node_modules/fast-deep-equal/es6/index.js"(exports, module) { "use strict"; module.exports = function equal(a, b) { if (a === b) return true; if (a && b && typeof a == "object" && typeof b == "object") { if (a.constructor !== b.constructor) return false; var length3, i, keys2; if (Array.isArray(a)) { length3 = a.length; if (length3 != b.length) return false; for (i = length3; i-- !== 0; ) if (!equal(a[i], b[i])) return false; return true; } if (a instanceof Map && b instanceof Map) { if (a.size !== b.size) return false; for (i of a.entries()) if (!b.has(i[0])) return false; for (i of a.entries()) if (!equal(i[1], b.get(i[0]))) return false; return true; } if (a instanceof Set && b instanceof Set) { if (a.size !== b.size) return false; for (i of a.entries()) if (!b.has(i[0])) return false; return true; } if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) { length3 = a.length; if (length3 != b.length) return false; for (i = length3; i-- !== 0; ) if (a[i] !== b[i]) return false; return true; } if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags; if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf(); if (a.toString !== Object.prototype.toString) return a.toString() === b.toString(); keys2 = Object.keys(a); length3 = keys2.length; if (length3 !== Object.keys(b).length) return false; for (i = length3; i-- !== 0; ) if (!Object.prototype.hasOwnProperty.call(b, keys2[i])) return false; for (i = length3; i-- !== 0; ) { var key = keys2[i]; if (!equal(a[key], b[key])) return false; } return true; } return a !== a && b !== b; }; } }); // package-external:@wordpress/compose var require_compose = __commonJS({ "package-external:@wordpress/compose"(exports, module) { module.exports = window.wp.compose; } }); // package-external:@wordpress/undo-manager var require_undo_manager = __commonJS({ "package-external:@wordpress/undo-manager"(exports, module) { module.exports = window.wp.undoManager; } }); // node_modules/equivalent-key-map/equivalent-key-map.js var require_equivalent_key_map = __commonJS({ "node_modules/equivalent-key-map/equivalent-key-map.js"(exports, module) { "use strict"; function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function(obj2) { return typeof obj2; }; } else { _typeof = function(obj2) { return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function getValuePair(instance, key) { var _map = instance._map, _arrayTreeMap = instance._arrayTreeMap, _objectTreeMap = instance._objectTreeMap; if (_map.has(key)) { return _map.get(key); } var properties = Object.keys(key).sort(); var map2 = Array.isArray(key) ? _arrayTreeMap : _objectTreeMap; for (var i = 0; i < properties.length; i++) { var property = properties[i]; map2 = map2.get(property); if (map2 === void 0) { return; } var propertyValue = key[property]; map2 = map2.get(propertyValue); if (map2 === void 0) { return; } } var valuePair = map2.get("_ekm_value"); if (!valuePair) { return; } _map.delete(valuePair[0]); valuePair[0] = key; map2.set("_ekm_value", valuePair); _map.set(key, valuePair); return valuePair; } var EquivalentKeyMap2 = /* @__PURE__ */ (function() { function EquivalentKeyMap3(iterable) { _classCallCheck(this, EquivalentKeyMap3); this.clear(); if (iterable instanceof EquivalentKeyMap3) { var iterablePairs = []; iterable.forEach(function(value, key) { iterablePairs.push([key, value]); }); iterable = iterablePairs; } if (iterable != null) { for (var i = 0; i < iterable.length; i++) { this.set(iterable[i][0], iterable[i][1]); } } } _createClass(EquivalentKeyMap3, [{ key: "set", /** * Add or update an element with a specified key and value. * * @param {*} key The key of the element to add. * @param {*} value The value of the element to add. * * @return {EquivalentKeyMap} Map instance. */ value: function set(key, value) { if (key === null || _typeof(key) !== "object") { this._map.set(key, value); return this; } var properties = Object.keys(key).sort(); var valuePair = [key, value]; var map2 = Array.isArray(key) ? this._arrayTreeMap : this._objectTreeMap; for (var i = 0; i < properties.length; i++) { var property = properties[i]; if (!map2.has(property)) { map2.set(property, new EquivalentKeyMap3()); } map2 = map2.get(property); var propertyValue = key[property]; if (!map2.has(propertyValue)) { map2.set(propertyValue, new EquivalentKeyMap3()); } map2 = map2.get(propertyValue); } var previousValuePair = map2.get("_ekm_value"); if (previousValuePair) { this._map.delete(previousValuePair[0]); } map2.set("_ekm_value", valuePair); this._map.set(key, valuePair); return this; } /** * Returns a specified element. * * @param {*} key The key of the element to return. * * @return {?*} The element associated with the specified key or undefined * if the key can't be found. */ }, { key: "get", value: function get(key) { if (key === null || _typeof(key) !== "object") { return this._map.get(key); } var valuePair = getValuePair(this, key); if (valuePair) { return valuePair[1]; } } /** * Returns a boolean indicating whether an element with the specified key * exists or not. * * @param {*} key The key of the element to test for presence. * * @return {boolean} Whether an element with the specified key exists. */ }, { key: "has", value: function has(key) { if (key === null || _typeof(key) !== "object") { return this._map.has(key); } return getValuePair(this, key) !== void 0; } /** * Removes the specified element. * * @param {*} key The key of the element to remove. * * @return {boolean} Returns true if an element existed and has been * removed, or false if the element does not exist. */ }, { key: "delete", value: function _delete(key) { if (!this.has(key)) { return false; } this.set(key, void 0); return true; } /** * Executes a provided function once per each key/value pair, in insertion * order. * * @param {Function} callback Function to execute for each element. * @param {*} thisArg Value to use as `this` when executing * `callback`. */ }, { key: "forEach", value: function forEach2(callback) { var _this = this; var thisArg = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this; this._map.forEach(function(value, key) { if (key !== null && _typeof(key) === "object") { value = value[1]; } callback.call(thisArg, value, key, _this); }); } /** * Removes all elements. */ }, { key: "clear", value: function clear() { this._map = /* @__PURE__ */ new Map(); this._arrayTreeMap = /* @__PURE__ */ new Map(); this._objectTreeMap = /* @__PURE__ */ new Map(); } }, { key: "size", get: function get() { return this._map.size; } }]); return EquivalentKeyMap3; })(); module.exports = EquivalentKeyMap2; } }); // package-external:@wordpress/url var require_url = __commonJS({ "package-external:@wordpress/url"(exports, module) { module.exports = window.wp.url; } }); // 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/blocks var require_blocks = __commonJS({ "package-external:@wordpress/blocks"(exports, module) { module.exports = window.wp.blocks; } }); // package-external:@wordpress/i18n var require_i18n = __commonJS({ "package-external:@wordpress/i18n"(exports, module) { module.exports = window.wp.i18n; } }); // 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/hooks var require_hooks = __commonJS({ "package-external:@wordpress/hooks"(exports, module) { module.exports = window.wp.hooks; } }); // package-external:@wordpress/block-editor var require_block_editor = __commonJS({ "package-external:@wordpress/block-editor"(exports, module) { module.exports = window.wp.blockEditor; } }); // package-external:@wordpress/rich-text var require_rich_text = __commonJS({ "package-external:@wordpress/rich-text"(exports, module) { module.exports = window.wp.richText; } }); // package-external:@wordpress/deprecated var require_deprecated = __commonJS({ "package-external:@wordpress/deprecated"(exports, module) { module.exports = window.wp.deprecated; } }); // package-external:@wordpress/html-entities var require_html_entities = __commonJS({ "package-external:@wordpress/html-entities"(exports, module) { module.exports = window.wp.htmlEntities; } }); // package-external:@wordpress/element var require_element = __commonJS({ "package-external:@wordpress/element"(exports, module) { module.exports = window.wp.element; } }); // vendor-external:react/jsx-runtime var require_jsx_runtime = __commonJS({ "vendor-external:react/jsx-runtime"(exports, module) { module.exports = window.ReactJSXRuntime; } }); // package-external:@wordpress/warning var require_warning = __commonJS({ "package-external:@wordpress/warning"(exports, module) { module.exports = window.wp.warning; } }); // packages/core-data/build-module/index.mjs var index_exports = {}; __export(index_exports, { EntityProvider: () => EntityProvider, __experimentalFetchLinkSuggestions: () => fetchLinkSuggestions, __experimentalFetchUrlData: () => experimental_fetch_url_data_default, __experimentalUseEntityRecord: () => __experimentalUseEntityRecord, __experimentalUseEntityRecords: () => __experimentalUseEntityRecords, __experimentalUseResourcePermissions: () => __experimentalUseResourcePermissions, fetchBlockPatterns: () => fetchBlockPatterns, privateApis: () => privateApis2, store: () => store, useEntityBlockEditor: () => useEntityBlockEditor, useEntityId: () => useEntityId, useEntityProp: () => useEntityProp, useEntityRecord: () => useEntityRecord, useEntityRecords: () => useEntityRecords, useResourcePermissions: () => use_resource_permissions_default }); var import_data16 = __toESM(require_data(), 1); // packages/core-data/build-module/reducer.mjs var import_es66 = __toESM(require_es6(), 1); var import_compose2 = __toESM(require_compose(), 1); var import_data8 = __toESM(require_data(), 1); var import_undo_manager2 = __toESM(require_undo_manager(), 1); // packages/core-data/build-module/utils/conservative-map-item.mjs var import_es6 = __toESM(require_es6(), 1); function conservativeMapItem(item, nextItem) { if (!item) { return nextItem; } let hasChanges = false; const result = {}; for (const key in nextItem) { if ((0, import_es6.default)(item[key], nextItem[key])) { result[key] = item[key]; } else { hasChanges = true; result[key] = nextItem[key]; } } if (!hasChanges) { return item; } for (const key in item) { if (!result.hasOwnProperty(key)) { result[key] = item[key]; } } return result; } // packages/core-data/build-module/utils/get-normalized-comma-separable.mjs function getNormalizedCommaSeparable(value) { if (typeof value === "string") { return value.split(","); } else if (Array.isArray(value)) { return value; } return null; } var get_normalized_comma_separable_default = getNormalizedCommaSeparable; // packages/core-data/build-module/utils/if-matching-action.mjs var ifMatchingAction = (isMatch) => (reducer) => (state, action) => { if (state === void 0 || isMatch(action)) { return reducer(state, action); } return state; }; var if_matching_action_default = ifMatchingAction; // packages/core-data/build-module/utils/forward-resolver.mjs var forwardResolver = (resolverName) => (...args2) => async ({ resolveSelect: resolveSelect2 }) => { await resolveSelect2[resolverName](...args2); }; var forward_resolver_default = forwardResolver; // packages/core-data/build-module/utils/on-sub-key.mjs var onSubKey = (actionProperty) => (reducer) => (state = {}, action) => { const key = action[actionProperty]; if (key === void 0) { return state; } const nextKeyState = reducer(state[key], action); if (nextKeyState === state[key]) { return state; } return { ...state, [key]: nextKeyState }; }; var on_sub_key_default = onSubKey; // packages/core-data/build-module/utils/replace-action.mjs var replaceAction = (replacer) => (reducer) => (state, action) => { return reducer(state, replacer(action)); }; var replace_action_default = replaceAction; // packages/core-data/build-module/utils/with-weak-map-cache.mjs function withWeakMapCache(fn) { const cache3 = /* @__PURE__ */ new WeakMap(); return (key) => { let value; if (cache3.has(key)) { value = cache3.get(key); } else { value = fn(key); if (key !== null && typeof key === "object") { cache3.set(key, value); } } return value; }; } var with_weak_map_cache_default = withWeakMapCache; // packages/core-data/build-module/utils/is-raw-attribute.mjs function isRawAttribute(entity2, attribute) { return (entity2.rawAttributes || []).includes(attribute); } // packages/core-data/build-module/utils/set-nested-value.mjs function setNestedValue(object, path, value) { if (!object || typeof object !== "object") { return object; } const normalizedPath = Array.isArray(path) ? path : path.split("."); normalizedPath.reduce((acc, key, idx) => { if (acc[key] === void 0) { if (Number.isInteger(normalizedPath[idx + 1])) { acc[key] = []; } else { acc[key] = {}; } } if (idx === normalizedPath.length - 1) { acc[key] = value; } return acc[key]; }, object); return object; } // packages/core-data/build-module/utils/get-nested-value.mjs function getNestedValue(object, path, defaultValue) { if (!object || typeof object !== "object" || typeof path !== "string" && !Array.isArray(path)) { return object; } const normalizedPath = Array.isArray(path) ? path : path.split("."); let value = object; normalizedPath.forEach((fieldName) => { value = value?.[fieldName]; }); return value !== void 0 ? value : defaultValue; } // packages/core-data/build-module/utils/is-numeric-id.mjs function isNumericID(id2) { return /^\s*\d+\s*$/.test(id2); } // packages/core-data/build-module/utils/user-permissions.mjs var ALLOWED_RESOURCE_ACTIONS = [ "create", "read", "update", "delete" ]; function getUserPermissionsFromAllowHeader(allowedMethods) { const permissions = {}; if (!allowedMethods) { return permissions; } const methods = { create: "POST", read: "GET", update: "PUT", delete: "DELETE" }; for (const [actionName, methodName] of Object.entries(methods)) { permissions[actionName] = allowedMethods.includes(methodName); } return permissions; } function getUserPermissionCacheKey(action, resource, id2) { const key = (typeof resource === "object" ? [action, resource.kind, resource.name, resource.id] : [action, resource, id2]).filter(Boolean).join("/"); return key; } // packages/core-data/build-module/utils/receive-intermediate-results.mjs var RECEIVE_INTERMEDIATE_RESULTS = /* @__PURE__ */ Symbol( "RECEIVE_INTERMEDIATE_RESULTS" ); // packages/core-data/build-module/queried-data/actions.mjs function receiveItems(items2, edits, meta) { return { type: "RECEIVE_ITEMS", items: items2, persistedEdits: edits, meta }; } function removeItems(kind, name, records, invalidateCache = false) { return { type: "REMOVE_ITEMS", itemIds: Array.isArray(records) ? records : [records], kind, name, invalidateCache }; } function receiveQueriedItems(items2, query = {}, edits, meta) { return { ...receiveItems(items2, edits, meta), query }; } // packages/core-data/build-module/queried-data/selectors.mjs var import_equivalent_key_map = __toESM(require_equivalent_key_map(), 1); var import_data = __toESM(require_data(), 1); // packages/core-data/build-module/queried-data/get-query-parts.mjs var import_url = __toESM(require_url(), 1); function getQueryParts(query) { const parts = { stableKey: "", page: 1, perPage: 10, fields: null, include: null, context: "default" }; const keys2 = Object.keys(query).sort(); for (let i = 0; i < keys2.length; i++) { const key = keys2[i]; let value = query[key]; switch (key) { case "page": parts[key] = Number(value); break; case "per_page": parts.perPage = Number(value); break; case "context": parts.context = value; break; default: if (key === "_fields") { parts.fields = get_normalized_comma_separable_default(value) ?? []; value = parts.fields.join(); } if (key === "include") { if (typeof value === "number") { value = value.toString(); } parts.include = (get_normalized_comma_separable_default(value) ?? []).map(Number); value = parts.include.join(); } parts.stableKey += (parts.stableKey ? "&" : "") + (0, import_url.addQueryArgs)("", { [key]: value }).slice(1); } } return parts; } var get_query_parts_default = with_weak_map_cache_default(getQueryParts); // packages/core-data/build-module/queried-data/selectors.mjs var queriedItemsCacheByState = /* @__PURE__ */ new WeakMap(); function getQueriedItemsUncached(state, query) { const { stableKey, page, perPage, include, fields, context } = get_query_parts_default(query); let itemIds; if (state.queries?.[context]?.[stableKey]) { itemIds = state.queries[context][stableKey].itemIds; } if (!itemIds) { return null; } const startOffset = perPage === -1 ? 0 : (page - 1) * perPage; const endOffset = perPage === -1 ? itemIds.length : Math.min(startOffset + perPage, itemIds.length); const items2 = []; for (let i = startOffset; i < endOffset; i++) { const itemId = itemIds[i]; if (Array.isArray(include) && !include.includes(itemId)) { continue; } if (itemId === void 0) { continue; } if (!state.items[context]?.hasOwnProperty(itemId)) { return null; } const item = state.items[context][itemId]; let filteredItem; if (Array.isArray(fields)) { filteredItem = {}; for (let f = 0; f < fields.length; f++) { const field = fields[f].split("."); let value = item; field.forEach((fieldName) => { value = value?.[fieldName]; }); setNestedValue(filteredItem, field, value); } } else { if (!state.itemIsComplete[context]?.[itemId]) { return null; } filteredItem = item; } items2.push(filteredItem); } return items2; } var getQueriedItems = (0, import_data.createSelector)((state, query = {}) => { let queriedItemsCache = queriedItemsCacheByState.get(state); if (queriedItemsCache) { const queriedItems = queriedItemsCache.get(query); if (queriedItems !== void 0) { return queriedItems; } } else { queriedItemsCache = new import_equivalent_key_map.default(); queriedItemsCacheByState.set(state, queriedItemsCache); } const items2 = getQueriedItemsUncached(state, query); queriedItemsCache.set(query, items2); return items2; }); function getQueriedTotalItems(state, query = {}) { const { stableKey, context } = get_query_parts_default(query); return state.queries?.[context]?.[stableKey]?.meta?.totalItems ?? null; } function getQueriedTotalPages(state, query = {}) { const { stableKey, context } = get_query_parts_default(query); return state.queries?.[context]?.[stableKey]?.meta?.totalPages ?? null; } // packages/core-data/build-module/queried-data/reducer.mjs var import_data7 = __toESM(require_data(), 1); var import_compose = __toESM(require_compose(), 1); // node_modules/tslib/tslib.es6.mjs var __assign = function() { __assign = Object.assign || function __assign2(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; // node_modules/lower-case/dist.es2015/index.js function lowerCase(str) { return str.toLowerCase(); } // node_modules/no-case/dist.es2015/index.js var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g]; var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi; function noCase(input, options) { if (options === void 0) { options = {}; } var _a = options.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options.transform, transform = _c === void 0 ? lowerCase : _c, _d = options.delimiter, delimiter = _d === void 0 ? " " : _d; var result = replace(replace(input, splitRegexp, "$1\0$2"), stripRegexp, "\0"); var start = 0; var end = result.length; while (result.charAt(start) === "\0") start++; while (result.charAt(end - 1) === "\0") end--; return result.slice(start, end).split("\0").map(transform).join(delimiter); } function replace(input, re, value) { if (re instanceof RegExp) return input.replace(re, value); return re.reduce(function(input2, re2) { return input2.replace(re2, value); }, input); } // node_modules/pascal-case/dist.es2015/index.js function pascalCaseTransform(input, index) { var firstChar = input.charAt(0); var lowerChars = input.substr(1).toLowerCase(); if (index > 0 && firstChar >= "0" && firstChar <= "9") { return "_" + firstChar + lowerChars; } return "" + firstChar.toUpperCase() + lowerChars; } function pascalCase(input, options) { if (options === void 0) { options = {}; } return noCase(input, __assign({ delimiter: "", transform: pascalCaseTransform }, options)); } // node_modules/camel-case/dist.es2015/index.js function camelCaseTransform(input, index) { if (index === 0) return input.toLowerCase(); return pascalCaseTransform(input, index); } function camelCase(input, options) { if (options === void 0) { options = {}; } return pascalCase(input, __assign({ transform: camelCaseTransform }, options)); } // node_modules/upper-case-first/dist.es2015/index.js function upperCaseFirst(input) { return input.charAt(0).toUpperCase() + input.substr(1); } // node_modules/capital-case/dist.es2015/index.js function capitalCaseTransform(input) { return upperCaseFirst(input.toLowerCase()); } function capitalCase(input, options) { if (options === void 0) { options = {}; } return noCase(input, __assign({ delimiter: " ", transform: capitalCaseTransform }, options)); } // packages/core-data/build-module/entities.mjs var import_api_fetch2 = __toESM(require_api_fetch(), 1); var import_blocks4 = __toESM(require_blocks(), 1); var import_i18n = __toESM(require_i18n(), 1); // packages/core-data/build-module/awareness/post-editor-awareness.mjs var import_data5 = __toESM(require_data(), 1); // node_modules/yjs/dist/yjs.mjs var yjs_exports = {}; __export(yjs_exports, { AbsolutePosition: () => AbsolutePosition, AbstractConnector: () => AbstractConnector, AbstractStruct: () => AbstractStruct, AbstractType: () => AbstractType, Array: () => YArray, ContentAny: () => ContentAny, ContentBinary: () => ContentBinary, ContentDeleted: () => ContentDeleted, ContentDoc: () => ContentDoc, ContentEmbed: () => ContentEmbed, ContentFormat: () => ContentFormat, ContentJSON: () => ContentJSON, ContentString: () => ContentString, ContentType: () => ContentType, Doc: () => Doc, GC: () => GC, ID: () => ID, Item: () => Item, Map: () => YMap, PermanentUserData: () => PermanentUserData, RelativePosition: () => RelativePosition, Skip: () => Skip, Snapshot: () => Snapshot, Text: () => YText, Transaction: () => Transaction, UndoManager: () => UndoManager, UpdateDecoderV1: () => UpdateDecoderV1, UpdateDecoderV2: () => UpdateDecoderV2, UpdateEncoderV1: () => UpdateEncoderV1, UpdateEncoderV2: () => UpdateEncoderV2, XmlElement: () => YXmlElement, XmlFragment: () => YXmlFragment, XmlHook: () => YXmlHook, XmlText: () => YXmlText, YArrayEvent: () => YArrayEvent, YEvent: () => YEvent, YMapEvent: () => YMapEvent, YTextEvent: () => YTextEvent, YXmlEvent: () => YXmlEvent, applyUpdate: () => applyUpdate, applyUpdateV2: () => applyUpdateV2, cleanupYTextFormatting: () => cleanupYTextFormatting, compareIDs: () => compareIDs, compareRelativePositions: () => compareRelativePositions, convertUpdateFormatV1ToV2: () => convertUpdateFormatV1ToV2, convertUpdateFormatV2ToV1: () => convertUpdateFormatV2ToV1, createAbsolutePositionFromRelativePosition: () => createAbsolutePositionFromRelativePosition, createDeleteSet: () => createDeleteSet, createDeleteSetFromStructStore: () => createDeleteSetFromStructStore, createDocFromSnapshot: () => createDocFromSnapshot, createID: () => createID, createRelativePositionFromJSON: () => createRelativePositionFromJSON, createRelativePositionFromTypeIndex: () => createRelativePositionFromTypeIndex, createSnapshot: () => createSnapshot, decodeRelativePosition: () => decodeRelativePosition, decodeSnapshot: () => decodeSnapshot, decodeSnapshotV2: () => decodeSnapshotV2, decodeStateVector: () => decodeStateVector, decodeUpdate: () => decodeUpdate, decodeUpdateV2: () => decodeUpdateV2, diffUpdate: () => diffUpdate, diffUpdateV2: () => diffUpdateV2, emptySnapshot: () => emptySnapshot, encodeRelativePosition: () => encodeRelativePosition, encodeSnapshot: () => encodeSnapshot, encodeSnapshotV2: () => encodeSnapshotV2, encodeStateAsUpdate: () => encodeStateAsUpdate, encodeStateAsUpdateV2: () => encodeStateAsUpdateV2, encodeStateVector: () => encodeStateVector, encodeStateVectorFromUpdate: () => encodeStateVectorFromUpdate, encodeStateVectorFromUpdateV2: () => encodeStateVectorFromUpdateV2, equalDeleteSets: () => equalDeleteSets, equalSnapshots: () => equalSnapshots, findIndexSS: () => findIndexSS, findRootTypeKey: () => findRootTypeKey, getItem: () => getItem, getItemCleanEnd: () => getItemCleanEnd, getItemCleanStart: () => getItemCleanStart, getState: () => getState, getTypeChildren: () => getTypeChildren, isDeleted: () => isDeleted, isParentOf: () => isParentOf, iterateDeletedStructs: () => iterateDeletedStructs, logType: () => logType, logUpdate: () => logUpdate, logUpdateV2: () => logUpdateV2, mergeDeleteSets: () => mergeDeleteSets, mergeUpdates: () => mergeUpdates, mergeUpdatesV2: () => mergeUpdatesV2, obfuscateUpdate: () => obfuscateUpdate, obfuscateUpdateV2: () => obfuscateUpdateV2, parseUpdateMeta: () => parseUpdateMeta, parseUpdateMetaV2: () => parseUpdateMetaV2, readUpdate: () => readUpdate, readUpdateV2: () => readUpdateV2, relativePositionToJSON: () => relativePositionToJSON, snapshot: () => snapshot, snapshotContainsUpdate: () => snapshotContainsUpdate, transact: () => transact, tryGc: () => tryGc, typeListToArraySnapshot: () => typeListToArraySnapshot, typeMapGetAllSnapshot: () => typeMapGetAllSnapshot, typeMapGetSnapshot: () => typeMapGetSnapshot }); // node_modules/lib0/map.js var create = () => /* @__PURE__ */ new Map(); var copy = (m) => { const r = create(); m.forEach((v, k) => { r.set(k, v); }); return r; }; var setIfUndefined = (map2, key, createT) => { let set = map2.get(key); if (set === void 0) { map2.set(key, set = createT()); } return set; }; var map = (m, f) => { const res = []; for (const [key, value] of m) { res.push(f(value, key)); } return res; }; var any = (m, f) => { for (const [key, value] of m) { if (f(value, key)) { return true; } } return false; }; // node_modules/lib0/set.js var create2 = () => /* @__PURE__ */ new Set(); // node_modules/lib0/array.js var last = (arr) => arr[arr.length - 1]; var appendTo = (dest, src) => { for (let i = 0; i < src.length; i++) { dest.push(src[i]); } }; var from = Array.from; var some = (arr, f) => { for (let i = 0; i < arr.length; i++) { if (f(arr[i], i, arr)) { return true; } } return false; }; var unfold = (len, f) => { const array = new Array(len); for (let i = 0; i < len; i++) { array[i] = f(i, array); } return array; }; var isArray = Array.isArray; // node_modules/lib0/observable.js var ObservableV2 = class { constructor() { this._observers = create(); } /** * @template {keyof EVENTS & string} NAME * @param {NAME} name * @param {EVENTS[NAME]} f */ on(name, f) { setIfUndefined( this._observers, /** @type {string} */ name, create2 ).add(f); return f; } /** * @template {keyof EVENTS & string} NAME * @param {NAME} name * @param {EVENTS[NAME]} f */ once(name, f) { const _f = (...args2) => { this.off( name, /** @type {any} */ _f ); f(...args2); }; this.on( name, /** @type {any} */ _f ); } /** * @template {keyof EVENTS & string} NAME * @param {NAME} name * @param {EVENTS[NAME]} f */ off(name, f) { const observers = this._observers.get(name); if (observers !== void 0) { observers.delete(f); if (observers.size === 0) { this._observers.delete(name); } } } /** * Emit a named event. All registered event listeners that listen to the * specified name will receive the event. * * @todo This should catch exceptions * * @template {keyof EVENTS & string} NAME * @param {NAME} name The event name. * @param {Parameters<EVENTS[NAME]>} args The arguments that are applied to the event listener. */ emit(name, args2) { return from((this._observers.get(name) || create()).values()).forEach((f) => f(...args2)); } destroy() { this._observers = create(); } }; var Observable = class { constructor() { this._observers = create(); } /** * @param {N} name * @param {function} f */ on(name, f) { setIfUndefined(this._observers, name, create2).add(f); } /** * @param {N} name * @param {function} f */ once(name, f) { const _f = (...args2) => { this.off(name, _f); f(...args2); }; this.on(name, _f); } /** * @param {N} name * @param {function} f */ off(name, f) { const observers = this._observers.get(name); if (observers !== void 0) { observers.delete(f); if (observers.size === 0) { this._observers.delete(name); } } } /** * Emit a named event. All registered event listeners that listen to the * specified name will receive the event. * * @todo This should catch exceptions * * @param {N} name The event name. * @param {Array<any>} args The arguments that are applied to the event listener. */ emit(name, args2) { return from((this._observers.get(name) || create()).values()).forEach((f) => f(...args2)); } destroy() { this._observers = create(); } }; // node_modules/lib0/math.js var floor = Math.floor; var abs = Math.abs; var min = (a, b) => a < b ? a : b; var max = (a, b) => a > b ? a : b; var isNaN2 = Number.isNaN; var isNegativeZero = (n) => n !== 0 ? n < 0 : 1 / n < 0; // node_modules/lib0/binary.js var BIT1 = 1; var BIT2 = 2; var BIT3 = 4; var BIT4 = 8; var BIT6 = 32; var BIT7 = 64; var BIT8 = 128; var BIT18 = 1 << 17; var BIT19 = 1 << 18; var BIT20 = 1 << 19; var BIT21 = 1 << 20; var BIT22 = 1 << 21; var BIT23 = 1 << 22; var BIT24 = 1 << 23; var BIT25 = 1 << 24; var BIT26 = 1 << 25; var BIT27 = 1 << 26; var BIT28 = 1 << 27; var BIT29 = 1 << 28; var BIT30 = 1 << 29; var BIT31 = 1 << 30; var BIT32 = 1 << 31; var BITS5 = 31; var BITS6 = 63; var BITS7 = 127; var BITS17 = BIT18 - 1; var BITS18 = BIT19 - 1; var BITS19 = BIT20 - 1; var BITS20 = BIT21 - 1; var BITS21 = BIT22 - 1; var BITS22 = BIT23 - 1; var BITS23 = BIT24 - 1; var BITS24 = BIT25 - 1; var BITS25 = BIT26 - 1; var BITS26 = BIT27 - 1; var BITS27 = BIT28 - 1; var BITS28 = BIT29 - 1; var BITS29 = BIT30 - 1; var BITS30 = BIT31 - 1; var BITS31 = 2147483647; // node_modules/lib0/number.js var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER; var MIN_SAFE_INTEGER = Number.MIN_SAFE_INTEGER; var LOWEST_INT32 = 1 << 31; var isInteger = Number.isInteger || ((num) => typeof num === "number" && isFinite(num) && floor(num) === num); var isNaN3 = Number.isNaN; var parseInt2 = Number.parseInt; // node_modules/lib0/string.js var fromCharCode = String.fromCharCode; var fromCodePoint = String.fromCodePoint; var MAX_UTF16_CHARACTER = fromCharCode(65535); var toLowerCase = (s) => s.toLowerCase(); var trimLeftRegex = /^\s*/g; var trimLeft = (s) => s.replace(trimLeftRegex, ""); var fromCamelCaseRegex = /([A-Z])/g; var fromCamelCase = (s, separator) => trimLeft(s.replace(fromCamelCaseRegex, (match) => `${separator}${toLowerCase(match)}`)); var _encodeUtf8Polyfill = (str) => { const encodedString = unescape(encodeURIComponent(str)); const len = encodedString.length; const buf = new Uint8Array(len); for (let i = 0; i < len; i++) { buf[i] = /** @type {number} */ encodedString.codePointAt(i); } return buf; }; var utf8TextEncoder = ( /** @type {TextEncoder} */ typeof TextEncoder !== "undefined" ? new TextEncoder() : null ); var _encodeUtf8Native = (str) => utf8TextEncoder.encode(str); var encodeUtf8 = utf8TextEncoder ? _encodeUtf8Native : _encodeUtf8Polyfill; var utf8TextDecoder = typeof TextDecoder === "undefined" ? null : new TextDecoder("utf-8", { fatal: true, ignoreBOM: true }); if (utf8TextDecoder && utf8TextDecoder.decode(new Uint8Array()).length === 1) { utf8TextDecoder = null; } var repeat = (source, n) => unfold(n, () => source).join(""); // node_modules/lib0/encoding.js var Encoder = class { constructor() { this.cpos = 0; this.cbuf = new Uint8Array(100); this.bufs = []; } }; var createEncoder = () => new Encoder(); var length = (encoder) => { let len = encoder.cpos; for (let i = 0; i < encoder.bufs.length; i++) { len += encoder.bufs[i].length; } return len; }; var toUint8Array = (encoder) => { const uint8arr = new Uint8Array(length(encoder)); let curPos = 0; for (let i = 0; i < encoder.bufs.length; i++) { const d = encoder.bufs[i]; uint8arr.set(d, curPos); curPos += d.length; } uint8arr.set(new Uint8Array(encoder.cbuf.buffer, 0, encoder.cpos), curPos); return uint8arr; }; var verifyLen = (encoder, len) => { const bufferLen = encoder.cbuf.length; if (bufferLen - encoder.cpos < len) { encoder.bufs.push(new Uint8Array(encoder.cbuf.buffer, 0, encoder.cpos)); encoder.cbuf = new Uint8Array(max(bufferLen, len) * 2); encoder.cpos = 0; } }; var write = (encoder, num) => { const bufferLen = encoder.cbuf.length; if (encoder.cpos === bufferLen) { encoder.bufs.push(encoder.cbuf); encoder.cbuf = new Uint8Array(bufferLen * 2); encoder.cpos = 0; } encoder.cbuf[encoder.cpos++] = num; }; var writeUint8 = write; var writeVarUint = (encoder, num) => { while (num > BITS7) { write(encoder, BIT8 | BITS7 & num); num = floor(num / 128); } write(encoder, BITS7 & num); }; var writeVarInt = (encoder, num) => { const isNegative = isNegativeZero(num); if (isNegative) { num = -num; } write(encoder, (num > BITS6 ? BIT8 : 0) | (isNegative ? BIT7 : 0) | BITS6 & num); num = floor(num / 64); while (num > 0) { write(encoder, (num > BITS7 ? BIT8 : 0) | BITS7 & num); num = floor(num / 128); } }; var _strBuffer = new Uint8Array(3e4); var _maxStrBSize = _strBuffer.length / 3; var _writeVarStringNative = (encoder, str) => { if (str.length < _maxStrBSize) { const written = utf8TextEncoder.encodeInto(str, _strBuffer).written || 0; writeVarUint(encoder, written); for (let i = 0; i < written; i++) { write(encoder, _strBuffer[i]); } } else { writeVarUint8Array(encoder, encodeUtf8(str)); } }; var _writeVarStringPolyfill = (encoder, str) => { const encodedString = unescape(encodeURIComponent(str)); const len = encodedString.length; writeVarUint(encoder, len); for (let i = 0; i < len; i++) { write( encoder, /** @type {number} */ encodedString.codePointAt(i) ); } }; var writeVarString = utf8TextEncoder && /** @type {any} */ utf8TextEncoder.encodeInto ? _writeVarStringNative : _writeVarStringPolyfill; var writeBinaryEncoder = (encoder, append2) => writeUint8Array(encoder, toUint8Array(append2)); var writeUint8Array = (encoder, uint8Array) => { const bufferLen = encoder.cbuf.length; const cpos = encoder.cpos; const leftCopyLen = min(bufferLen - cpos, uint8Array.length); const rightCopyLen = uint8Array.length - leftCopyLen; encoder.cbuf.set(uint8Array.subarray(0, leftCopyLen), cpos); encoder.cpos += leftCopyLen; if (rightCopyLen > 0) { encoder.bufs.push(encoder.cbuf); encoder.cbuf = new Uint8Array(max(bufferLen * 2, rightCopyLen)); encoder.cbuf.set(uint8Array.subarray(leftCopyLen)); encoder.cpos = rightCopyLen; } }; var writeVarUint8Array = (encoder, uint8Array) => { writeVarUint(encoder, uint8Array.byteLength); writeUint8Array(encoder, uint8Array); }; var writeOnDataView = (encoder, len) => { verifyLen(encoder, len); const dview = new DataView(encoder.cbuf.buffer, encoder.cpos, len); encoder.cpos += len; return dview; }; var writeFloat32 = (encoder, num) => writeOnDataView(encoder, 4).setFloat32(0, num, false); var writeFloat64 = (encoder, num) => writeOnDataView(encoder, 8).setFloat64(0, num, false); var writeBigInt64 = (encoder, num) => ( /** @type {any} */ writeOnDataView(encoder, 8).setBigInt64(0, num, false) ); var floatTestBed = new DataView(new ArrayBuffer(4)); var isFloat32 = (num) => { floatTestBed.setFloat32(0, num); return floatTestBed.getFloat32(0) === num; }; var writeAny = (encoder, data) => { switch (typeof data) { case "string": write(encoder, 119); writeVarString(encoder, data); break; case "number": if (isInteger(data) && abs(data) <= BITS31) { write(encoder, 125); writeVarInt(encoder, data); } else if (isFloat32(data)) { write(encoder, 124); writeFloat32(encoder, data); } else { write(encoder, 123); writeFloat64(encoder, data); } break; case "bigint": write(encoder, 122); writeBigInt64(encoder, data); break; case "object": if (data === null) { write(encoder, 126); } else if (isArray(data)) { write(encoder, 117); writeVarUint(encoder, data.length); for (let i = 0; i < data.length; i++) { writeAny(encoder, data[i]); } } else if (data instanceof Uint8Array) { write(encoder, 116); writeVarUint8Array(encoder, data); } else { write(encoder, 118); const keys2 = Object.keys(data); writeVarUint(encoder, keys2.length); for (let i = 0; i < keys2.length; i++) { const key = keys2[i]; writeVarString(encoder, key); writeAny(encoder, data[key]); } } break; case "boolean": write(encoder, data ? 120 : 121); break; default: write(encoder, 127); } }; var RleEncoder = class extends Encoder { /** * @param {function(Encoder, T):void} writer */ constructor(writer) { super(); this.w = writer; this.s = null; this.count = 0; } /** * @param {T} v */ write(v) { if (this.s === v) { this.count++; } else { if (this.count > 0) { writeVarUint(this, this.count - 1); } this.count = 1; this.w(this, v); this.s = v; } } }; var flushUintOptRleEncoder = (encoder) => { if (encoder.count > 0) { writeVarInt(encoder.encoder, encoder.count === 1 ? encoder.s : -encoder.s); if (encoder.count > 1) { writeVarUint(encoder.encoder, encoder.count - 2); } } }; var UintOptRleEncoder = class { constructor() { this.encoder = new Encoder(); this.s = 0; this.count = 0; } /** * @param {number} v */ write(v) { if (this.s === v) { this.count++; } else { flushUintOptRleEncoder(this); this.count = 1; this.s = v; } } /** * Flush the encoded state and transform this to a Uint8Array. * * Note that this should only be called once. */ toUint8Array() { flushUintOptRleEncoder(this); return toUint8Array(this.encoder); } }; var flushIntDiffOptRleEncoder = (encoder) => { if (encoder.count > 0) { const encodedDiff = encoder.diff * 2 + (encoder.count === 1 ? 0 : 1); writeVarInt(encoder.encoder, encodedDiff); if (encoder.count > 1) { writeVarUint(encoder.encoder, encoder.count - 2); } } }; var IntDiffOptRleEncoder = class { constructor() { this.encoder = new Encoder(); this.s = 0; this.count = 0; this.diff = 0; } /** * @param {number} v */ write(v) { if (this.diff === v - this.s) { this.s = v; this.count++; } else { flushIntDiffOptRleEncoder(this); this.count = 1; this.diff = v - this.s; this.s = v; } } /** * Flush the encoded state and transform this to a Uint8Array. * * Note that this should only be called once. */ toUint8Array() { flushIntDiffOptRleEncoder(this); return toUint8Array(this.encoder); } }; var StringEncoder = class { constructor() { this.sarr = []; this.s = ""; this.lensE = new UintOptRleEncoder(); } /** * @param {string} string */ write(string) { this.s += string; if (this.s.length > 19) { this.sarr.push(this.s); this.s = ""; } this.lensE.write(string.length); } toUint8Array() { const encoder = new Encoder(); this.sarr.push(this.s); this.s = ""; writeVarString(encoder, this.sarr.join("")); writeUint8Array(encoder, this.lensE.toUint8Array()); return toUint8Array(encoder); } }; // node_modules/lib0/error.js var create3 = (s) => new Error(s); var methodUnimplemented = () => { throw create3("Method unimplemented"); }; var unexpectedCase = () => { throw create3("Unexpected case"); }; // node_modules/lib0/decoding.js var errorUnexpectedEndOfArray = create3("Unexpected end of array"); var errorIntegerOutOfRange = create3("Integer out of Range"); var Decoder = class { /** * @param {Uint8Array} uint8Array Binary data to decode */ constructor(uint8Array) { this.arr = uint8Array; this.pos = 0; } }; var createDecoder = (uint8Array) => new Decoder(uint8Array); var hasContent = (decoder) => decoder.pos !== decoder.arr.length; var readUint8Array = (decoder, len) => { const view = new Uint8Array(decoder.arr.buffer, decoder.pos + decoder.arr.byteOffset, len); decoder.pos += len; return view; }; var readVarUint8Array = (decoder) => readUint8Array(decoder, readVarUint(decoder)); var readUint8 = (decoder) => decoder.arr[decoder.pos++]; var readVarUint = (decoder) => { let num = 0; let mult = 1; const len = decoder.arr.length; while (decoder.pos < len) { const r = decoder.arr[decoder.pos++]; num = num + (r & BITS7) * mult; mult *= 128; if (r < BIT8) { return num; } if (num > MAX_SAFE_INTEGER) { throw errorIntegerOutOfRange; } } throw errorUnexpectedEndOfArray; }; var readVarInt = (decoder) => { let r = decoder.arr[decoder.pos++]; let num = r & BITS6; let mult = 64; const sign = (r & BIT7) > 0 ? -1 : 1; if ((r & BIT8) === 0) { return sign * num; } const len = decoder.arr.length; while (decoder.pos < len) { r = decoder.arr[decoder.pos++]; num = num + (r & BITS7) * mult; mult *= 128; if (r < BIT8) { return sign * num; } if (num > MAX_SAFE_INTEGER) { throw errorIntegerOutOfRange; } } throw errorUnexpectedEndOfArray; }; var _readVarStringPolyfill = (decoder) => { let remainingLen = readVarUint(decoder); if (remainingLen === 0) { return ""; } else { let encodedString = String.fromCodePoint(readUint8(decoder)); if (--remainingLen < 100) { while (remainingLen--) { encodedString += String.fromCodePoint(readUint8(decoder)); } } else { while (remainingLen > 0) { const nextLen = remainingLen < 1e4 ? remainingLen : 1e4; const bytes = decoder.arr.subarray(decoder.pos, decoder.pos + nextLen); decoder.pos += nextLen; encodedString += String.fromCodePoint.apply( null, /** @type {any} */ bytes ); remainingLen -= nextLen; } } return decodeURIComponent(escape(encodedString)); } }; var _readVarStringNative = (decoder) => ( /** @type any */ utf8TextDecoder.decode(readVarUint8Array(decoder)) ); var readVarString = utf8TextDecoder ? _readVarStringNative : _readVarStringPolyfill; var readFromDataView = (decoder, len) => { const dv = new DataView(decoder.arr.buffer, decoder.arr.byteOffset + decoder.pos, len); decoder.pos += len; return dv; }; var readFloat32 = (decoder) => readFromDataView(decoder, 4).getFloat32(0, false); var readFloat64 = (decoder) => readFromDataView(decoder, 8).getFloat64(0, false); var readBigInt64 = (decoder) => ( /** @type {any} */ readFromDataView(decoder, 8).getBigInt64(0, false) ); var readAnyLookupTable = [ (decoder) => void 0, // CASE 127: undefined (decoder) => null, // CASE 126: null readVarInt, // CASE 125: integer readFloat32, // CASE 124: float32 readFloat64, // CASE 123: float64 readBigInt64, // CASE 122: bigint (decoder) => false, // CASE 121: boolean (false) (decoder) => true, // CASE 120: boolean (true) readVarString, // CASE 119: string (decoder) => { const len = readVarUint(decoder); const obj = {}; for (let i = 0; i < len; i++) { const key = readVarString(decoder); obj[key] = readAny(decoder); } return obj; }, (decoder) => { const len = readVarUint(decoder); const arr = []; for (let i = 0; i < len; i++) { arr.push(readAny(decoder)); } return arr; }, readVarUint8Array // CASE 116: Uint8Array ]; var readAny = (decoder) => readAnyLookupTable[127 - readUint8(decoder)](decoder); var RleDecoder = class extends Decoder { /** * @param {Uint8Array} uint8Array * @param {function(Decoder):T} reader */ constructor(uint8Array, reader) { super(uint8Array); this.reader = reader; this.s = null; this.count = 0; } read() { if (this.count === 0) { this.s = this.reader(this); if (hasContent(this)) { this.count = readVarUint(this) + 1; } else { this.count = -1; } } this.count--; return ( /** @type {T} */ this.s ); } }; var UintOptRleDecoder = class extends Decoder { /** * @param {Uint8Array} uint8Array */ constructor(uint8Array) { super(uint8Array); this.s = 0; this.count = 0; } read() { if (this.count === 0) { this.s = readVarInt(this); const isNegative = isNegativeZero(this.s); this.count = 1; if (isNegative) { this.s = -this.s; this.count = readVarUint(this) + 2; } } this.count--; return ( /** @type {number} */ this.s ); } }; var IntDiffOptRleDecoder = class extends Decoder { /** * @param {Uint8Array} uint8Array */ constructor(uint8Array) { super(uint8Array); this.s = 0; this.count = 0; this.diff = 0; } /** * @return {number} */ read() { if (this.count === 0) { const diff = readVarInt(this); const hasCount = diff & 1; this.diff = floor(diff / 2); this.count = 1; if (hasCount) { this.count = readVarUint(this) + 2; } } this.s += this.diff; this.count--; return this.s; } }; var StringDecoder = class { /** * @param {Uint8Array} uint8Array */ constructor(uint8Array) { this.decoder = new UintOptRleDecoder(uint8Array); this.str = readVarString(this.decoder); this.spos = 0; } /** * @return {string} */ read() { const end = this.spos + this.decoder.read(); const res = this.str.slice(this.spos, end); this.spos = end; return res; } }; // node_modules/lib0/webcrypto.js var subtle = crypto.subtle; var getRandomValues = crypto.getRandomValues.bind(crypto); // node_modules/lib0/random.js var uint32 = () => getRandomValues(new Uint32Array(1))[0]; var uuidv4Template = "10000000-1000-4000-8000" + -1e11; var uuidv4 = () => uuidv4Template.replace( /[018]/g, /** @param {number} c */ (c) => (c ^ uint32() & 15 >> c / 4).toString(16) ); // node_modules/lib0/time.js var getUnixTime = Date.now; // node_modules/lib0/promise.js var create4 = (f) => ( /** @type {Promise<T>} */ new Promise(f) ); var all = Promise.all.bind(Promise); // node_modules/lib0/conditions.js var undefinedToNull = (v) => v === void 0 ? null : v; // node_modules/lib0/storage.js var VarStoragePolyfill = class { constructor() { this.map = /* @__PURE__ */ new Map(); } /** * @param {string} key * @param {any} newValue */ setItem(key, newValue) { this.map.set(key, newValue); } /** * @param {string} key */ getItem(key) { return this.map.get(key); } }; var _localStorage = new VarStoragePolyfill(); var usePolyfill = true; try { if (typeof localStorage !== "undefined" && localStorage) { _localStorage = localStorage; usePolyfill = false; } } catch (e) { } var varStorage = _localStorage; // node_modules/lib0/object.js var assign = Object.assign; var keys = Object.keys; var forEach = (obj, f) => { for (const key in obj) { f(obj[key], key); } }; var length2 = (obj) => keys(obj).length; var size = (obj) => keys(obj).length; var isEmpty = (obj) => { for (const _k in obj) { return false; } return true; }; var every = (obj, f) => { for (const key in obj) { if (!f(obj[key], key)) { return false; } } return true; }; var hasProperty = (obj, key) => Object.prototype.hasOwnProperty.call(obj, key); var equalFlat = (a, b) => a === b || size(a) === size(b) && every(a, (val, key) => (val !== void 0 || hasProperty(b, key)) && b[key] === val); var freeze = Object.freeze; var deepFreeze = (o) => { for (const key in o) { const c = o[key]; if (typeof c === "object" || typeof c === "function") { deepFreeze(o[key]); } } return freeze(o); }; // node_modules/lib0/function.js var callAll = (fs, args2, i = 0) => { try { for (; i < fs.length; i++) { fs[i](...args2); } } finally { if (i < fs.length) { callAll(fs, args2, i + 1); } } }; var id = (a) => a; var equalityStrict = (a, b) => a === b; var equalityDeep = (a, b) => { if (a == null || b == null) { return equalityStrict(a, b); } if (a.constructor !== b.constructor) { return false; } if (a === b) { return true; } switch (a.constructor) { case ArrayBuffer: a = new Uint8Array(a); b = new Uint8Array(b); // eslint-disable-next-line no-fallthrough case Uint8Array: { if (a.byteLength !== b.byteLength) { return false; } for (let i = 0; i < a.length; i++) { if (a[i] !== b[i]) { return false; } } break; } case Set: { if (a.size !== b.size) { return false; } for (const value of a) { if (!b.has(value)) { return false; } } break; } case Map: { if (a.size !== b.size) { return false; } for (const key of a.keys()) { if (!b.has(key) || !equalityDeep(a.get(key), b.get(key))) { return false; } } break; } case Object: if (length2(a) !== length2(b)) { return false; } for (const key in a) { if (!hasProperty(a, key) || !equalityDeep(a[key], b[key])) { return false; } } break; case Array: if (a.length !== b.length) { return false; } for (let i = 0; i < a.length; i++) { if (!equalityDeep(a[i], b[i])) { return false; } } break; default: return false; } return true; }; var isOneOf = (value, options) => options.includes(value); // node_modules/lib0/environment.js var isNode = typeof process !== "undefined" && process.release && /node|io\.js/.test(process.release.name) && Object.prototype.toString.call(typeof process !== "undefined" ? process : 0) === "[object process]"; var isBrowser = typeof window !== "undefined" && typeof document !== "undefined" && !isNode; var isMac = typeof navigator !== "undefined" ? /Mac/.test(navigator.platform) : false; var params; var args = []; var computeParams = () => { if (params === void 0) { if (isNode) { params = create(); const pargs = process.argv; let currParamName = null; for (let i = 0; i < pargs.length; i++) { const parg = pargs[i]; if (parg[0] === "-") { if (currParamName !== null) { params.set(currParamName, ""); } currParamName = parg; } else { if (currParamName !== null) { params.set(currParamName, parg); currParamName = null; } else { args.push(parg); } } } if (currParamName !== null) { params.set(currParamName, ""); } } else if (typeof location === "object") { params = create(); (location.search || "?").slice(1).split("&").forEach((kv) => { if (kv.length !== 0) { const [key, value] = kv.split("="); params.set(`--${fromCamelCase(key, "-")}`, value); params.set(`-${fromCamelCase(key, "-")}`, value); } }); } else { params = create(); } } return params; }; var hasParam = (name) => computeParams().has(name); var getVariable = (name) => isNode ? undefinedToNull(process.env[name.toUpperCase().replaceAll("-", "_")]) : undefinedToNull(varStorage.getItem(name)); var hasConf = (name) => hasParam("--" + name) || getVariable(name) !== null; var production = hasConf("production"); var forceColor = isNode && isOneOf(process.env.FORCE_COLOR, ["true", "1", "2"]); var supportsColor = forceColor || !hasParam("--no-colors") && // @todo deprecate --no-colors !hasConf("no-color") && (!isNode || process.stdout.isTTY) && (!isNode || hasParam("--color") || getVariable("COLORTERM") !== null || (getVariable("TERM") || "").includes("color")); // node_modules/lib0/buffer.js var createUint8ArrayFromLen = (len) => new Uint8Array(len); var createUint8ArrayViewFromArrayBuffer = (buffer, byteOffset, length3) => new Uint8Array(buffer, byteOffset, length3); var toBase64Browser = (bytes) => { let s = ""; for (let i = 0; i < bytes.byteLength; i++) { s += fromCharCode(bytes[i]); } return btoa(s); }; var toBase64Node = (bytes) => Buffer.from(bytes.buffer, bytes.byteOffset, bytes.byteLength).toString("base64"); var fromBase64Browser = (s) => { const a = atob(s); const bytes = createUint8ArrayFromLen(a.length); for (let i = 0; i < a.length; i++) { bytes[i] = a.charCodeAt(i); } return bytes; }; var fromBase64Node = (s) => { const buf = Buffer.from(s, "base64"); return createUint8ArrayViewFromArrayBuffer(buf.buffer, buf.byteOffset, buf.byteLength); }; var toBase64 = isBrowser ? toBase64Browser : toBase64Node; var fromBase64 = isBrowser ? fromBase64Browser : fromBase64Node; var copyUint8Array = (uint8Array) => { const newBuf = createUint8ArrayFromLen(uint8Array.byteLength); newBuf.set(uint8Array); return newBuf; }; // node_modules/lib0/pair.js var Pair = class { /** * @param {L} left * @param {R} right */ constructor(left, right) { this.left = left; this.right = right; } }; var create5 = (left, right) => new Pair(left, right); // node_modules/lib0/dom.js var doc = ( /** @type {Document} */ typeof document !== "undefined" ? document : {} ); var domParser = ( /** @type {DOMParser} */ typeof DOMParser !== "undefined" ? new DOMParser() : null ); var mapToStyleString = (m) => map(m, (value, key) => `${key}:${value};`).join(""); var ELEMENT_NODE = doc.ELEMENT_NODE; var TEXT_NODE = doc.TEXT_NODE; var CDATA_SECTION_NODE = doc.CDATA_SECTION_NODE; var COMMENT_NODE = doc.COMMENT_NODE; var DOCUMENT_NODE = doc.DOCUMENT_NODE; var DOCUMENT_TYPE_NODE = doc.DOCUMENT_TYPE_NODE; var DOCUMENT_FRAGMENT_NODE = doc.DOCUMENT_FRAGMENT_NODE; // node_modules/lib0/symbol.js var create6 = Symbol; // node_modules/lib0/logging.common.js var BOLD = create6(); var UNBOLD = create6(); var BLUE = create6(); var GREY = create6(); var GREEN = create6(); var RED = create6(); var PURPLE = create6(); var ORANGE = create6(); var UNCOLOR = create6(); var computeNoColorLoggingArgs = (args2) => { if (args2.length === 1 && args2[0]?.constructor === Function) { args2 = /** @type {Array<string|Symbol|Object|number>} */ /** @type {[function]} */ args2[0](); } const strBuilder = []; const logArgs = []; let i = 0; for (; i < args2.length; i++) { const arg = args2[i]; if (arg === void 0) { break; } else if (arg.constructor === String || arg.constructor === Number) { strBuilder.push(arg); } else if (arg.constructor === Object) { break; } } if (i > 0) { logArgs.push(strBuilder.join("")); } for (; i < args2.length; i++) { const arg = args2[i]; if (!(arg instanceof Symbol)) { logArgs.push(arg); } } return logArgs; }; var lastLoggingTime = getUnixTime(); // node_modules/lib0/logging.js var _browserStyleMap = { [BOLD]: create5("font-weight", "bold"), [UNBOLD]: create5("font-weight", "normal"), [BLUE]: create5("color", "blue"), [GREEN]: create5("color", "green"), [GREY]: create5("color", "grey"), [RED]: create5("color", "red"), [PURPLE]: create5("color", "purple"), [ORANGE]: create5("color", "orange"), // not well supported in chrome when debugging node with inspector - TODO: deprecate [UNCOLOR]: create5("color", "black") }; var computeBrowserLoggingArgs = (args2) => { if (args2.length === 1 && args2[0]?.constructor === Function) { args2 = /** @type {Array<string|Symbol|Object|number>} */ /** @type {[function]} */ args2[0](); } const strBuilder = []; const styles = []; const currentStyle = create(); let logArgs = []; let i = 0; for (; i < args2.length; i++) { const arg = args2[i]; const style = _browserStyleMap[arg]; if (style !== void 0) { currentStyle.set(style.left, style.right); } else { if (arg === void 0) { break; } if (arg.constructor === String || arg.constructor === Number) { const style2 = mapToStyleString(currentStyle); if (i > 0 || style2.length > 0) { strBuilder.push("%c" + arg); styles.push(style2); } else { strBuilder.push(arg); } } else { break; } } } if (i > 0) { logArgs = styles; logArgs.unshift(strBuilder.join("")); } for (; i < args2.length; i++) { const arg = args2[i]; if (!(arg instanceof Symbol)) { logArgs.push(arg); } } return logArgs; }; var computeLoggingArgs = supportsColor ? computeBrowserLoggingArgs : computeNoColorLoggingArgs; var print = (...args2) => { console.log(...computeLoggingArgs(args2)); vconsoles.forEach((vc) => vc.print(args2)); }; var warn = (...args2) => { console.warn(...computeLoggingArgs(args2)); args2.unshift(ORANGE); vconsoles.forEach((vc) => vc.print(args2)); }; var vconsoles = create2(); // node_modules/lib0/iterator.js var createIterator = (next) => ({ /** * @return {IterableIterator<T>} */ [Symbol.iterator]() { return this; }, // @ts-ignore next }); var iteratorFilter = (iterator, filter) => createIterator(() => { let res; do { res = iterator.next(); } while (!res.done && !filter(res.value)); return res; }); var iteratorMap = (iterator, fmap) => createIterator(() => { const { done, value } = iterator.next(); return { done, value: done ? void 0 : fmap(value) }; }); // node_modules/yjs/dist/yjs.mjs var AbstractConnector = class extends ObservableV2 { /** * @param {Doc} ydoc * @param {any} awareness */ constructor(ydoc, awareness) { super(); this.doc = ydoc; this.awareness = awareness; } }; var DeleteItem = class { /** * @param {number} clock * @param {number} len */ constructor(clock, len) { this.clock = clock; this.len = len; } }; var DeleteSet = class { constructor() { this.clients = /* @__PURE__ */ new Map(); } }; var iterateDeletedStructs = (transaction, ds, f) => ds.clients.forEach((deletes, clientid) => { const structs = ( /** @type {Array<GC|Item>} */ transaction.doc.store.clients.get(clientid) ); if (structs != null) { const lastStruct = structs[structs.length - 1]; const clockState = lastStruct.id.clock + lastStruct.length; for (let i = 0, del = deletes[i]; i < deletes.length && del.clock < clockState; del = deletes[++i]) { iterateStructs(transaction, structs, del.clock, del.len, f); } } }); var findIndexDS = (dis, clock) => { let left = 0; let right = dis.length - 1; while (left <= right) { const midindex = floor((left + right) / 2); const mid = dis[midindex]; const midclock = mid.clock; if (midclock <= clock) { if (clock < midclock + mid.len) { return midindex; } left = midindex + 1; } else { right = midindex - 1; } } return null; }; var isDeleted = (ds, id2) => { const dis = ds.clients.get(id2.client); return dis !== void 0 && findIndexDS(dis, id2.clock) !== null; }; var sortAndMergeDeleteSet = (ds) => { ds.clients.forEach((dels) => { dels.sort((a, b) => a.clock - b.clock); let i, j; for (i = 1, j = 1; i < dels.length; i++) { const left = dels[j - 1]; const right = dels[i]; if (left.clock + left.len >= right.clock) { left.len = max(left.len, right.clock + right.len - left.clock); } else { if (j < i) { dels[j] = right; } j++; } } dels.length = j; }); }; var mergeDeleteSets = (dss) => { const merged = new DeleteSet(); for (let dssI = 0; dssI < dss.length; dssI++) { dss[dssI].clients.forEach((delsLeft, client) => { if (!merged.clients.has(client)) { const dels = delsLeft.slice(); for (let i = dssI + 1; i < dss.length; i++) { appendTo(dels, dss[i].clients.get(client) || []); } merged.clients.set(client, dels); } }); } sortAndMergeDeleteSet(merged); return merged; }; var addToDeleteSet = (ds, client, clock, length3) => { setIfUndefined(ds.clients, client, () => ( /** @type {Array<DeleteItem>} */ [] )).push(new DeleteItem(clock, length3)); }; var createDeleteSet = () => new DeleteSet(); var createDeleteSetFromStructStore = (ss) => { const ds = createDeleteSet(); ss.clients.forEach((structs, client) => { const dsitems = []; for (let i = 0; i < structs.length; i++) { const struct = structs[i]; if (struct.deleted) { const clock = struct.id.clock; let len = struct.length; if (i + 1 < structs.length) { for (let next = structs[i + 1]; i + 1 < structs.length && next.deleted; next = structs[++i + 1]) { len += next.length; } } dsitems.push(new DeleteItem(clock, len)); } } if (dsitems.length > 0) { ds.clients.set(client, dsitems); } }); return ds; }; var writeDeleteSet = (encoder, ds) => { writeVarUint(encoder.restEncoder, ds.clients.size); from(ds.clients.entries()).sort((a, b) => b[0] - a[0]).forEach(([client, dsitems]) => { encoder.resetDsCurVal(); writeVarUint(encoder.restEncoder, client); const len = dsitems.length; writeVarUint(encoder.restEncoder, len); for (let i = 0; i < len; i++) { const item = dsitems[i]; encoder.writeDsClock(item.clock); encoder.writeDsLen(item.len); } }); }; var readDeleteSet = (decoder) => { const ds = new DeleteSet(); const numClients = readVarUint(decoder.restDecoder); for (let i = 0; i < numClients; i++) { decoder.resetDsCurVal(); const client = readVarUint(decoder.restDecoder); const numberOfDeletes = readVarUint(decoder.restDecoder); if (numberOfDeletes > 0) { const dsField = setIfUndefined(ds.clients, client, () => ( /** @type {Array<DeleteItem>} */ [] )); for (let i2 = 0; i2 < numberOfDeletes; i2++) { dsField.push(new DeleteItem(decoder.readDsClock(), decoder.readDsLen())); } } } return ds; }; var readAndApplyDeleteSet = (decoder, transaction, store2) => { const unappliedDS = new DeleteSet(); const numClients = readVarUint(decoder.restDecoder); for (let i = 0; i < numClients; i++) { decoder.resetDsCurVal(); const client = readVarUint(decoder.restDecoder); const numberOfDeletes = readVarUint(decoder.restDecoder); const structs = store2.clients.get(client) || []; const state = getState(store2, client); for (let i2 = 0; i2 < numberOfDeletes; i2++) { const clock = decoder.readDsClock(); const clockEnd = clock + decoder.readDsLen(); if (clock < state) { if (state < clockEnd) { addToDeleteSet(unappliedDS, client, state, clockEnd - state); } let index = findIndexSS(structs, clock); let struct = structs[index]; if (!struct.deleted && struct.id.clock < clock) { structs.splice(index + 1, 0, splitItem(transaction, struct, clock - struct.id.clock)); index++; } while (index < structs.length) { struct = structs[index++]; if (struct.id.clock < clockEnd) { if (!struct.deleted) { if (clockEnd < struct.id.clock + struct.length) { structs.splice(index, 0, splitItem(transaction, struct, clockEnd - struct.id.clock)); } struct.delete(transaction); } } else { break; } } } else { addToDeleteSet(unappliedDS, client, clock, clockEnd - clock); } } } if (unappliedDS.clients.size > 0) { const ds = new UpdateEncoderV2(); writeVarUint(ds.restEncoder, 0); writeDeleteSet(ds, unappliedDS); return ds.toUint8Array(); } return null; }; var equalDeleteSets = (ds1, ds2) => { if (ds1.clients.size !== ds2.clients.size) return false; for (const [client, deleteItems1] of ds1.clients.entries()) { const deleteItems2 = ( /** @type {Array<import('../internals.js').DeleteItem>} */ ds2.clients.get(client) ); if (deleteItems2 === void 0 || deleteItems1.length !== deleteItems2.length) return false; for (let i = 0; i < deleteItems1.length; i++) { const di1 = deleteItems1[i]; const di2 = deleteItems2[i]; if (di1.clock !== di2.clock || di1.len !== di2.len) { return false; } } } return true; }; var generateNewClientId = uint32; var Doc = class _Doc extends ObservableV2 { /** * @param {DocOpts} opts configuration */ constructor({ guid = uuidv4(), collectionid = null, gc = true, gcFilter = () => true, meta = null, autoLoad = false, shouldLoad = true } = {}) { super(); this.gc = gc; this.gcFilter = gcFilter; this.clientID = generateNewClientId(); this.guid = guid; this.collectionid = collectionid; this.share = /* @__PURE__ */ new Map(); this.store = new StructStore(); this._transaction = null; this._transactionCleanups = []; this.subdocs = /* @__PURE__ */ new Set(); this._item = null; this.shouldLoad = shouldLoad; this.autoLoad = autoLoad; this.meta = meta; this.isLoaded = false; this.isSynced = false; this.isDestroyed = false; this.whenLoaded = create4((resolve) => { this.on("load", () => { this.isLoaded = true; resolve(this); }); }); const provideSyncedPromise = () => create4((resolve) => { const eventHandler = (isSynced) => { if (isSynced === void 0 || isSynced === true) { this.off("sync", eventHandler); resolve(); } }; this.on("sync", eventHandler); }); this.on("sync", (isSynced) => { if (isSynced === false && this.isSynced) { this.whenSynced = provideSyncedPromise(); } this.isSynced = isSynced === void 0 || isSynced === true; if (this.isSynced && !this.isLoaded) { this.emit("load", [this]); } }); this.whenSynced = provideSyncedPromise(); } /** * Notify the parent document that you request to load data into this subdocument (if it is a subdocument). * * `load()` might be used in the future to request any provider to load the most current data. * * It is safe to call `load()` multiple times. */ load() { const item = this._item; if (item !== null && !this.shouldLoad) { transact( /** @type {any} */ item.parent.doc, (transaction) => { transaction.subdocsLoaded.add(this); }, null, true ); } this.shouldLoad = true; } getSubdocs() { return this.subdocs; } getSubdocGuids() { return new Set(from(this.subdocs).map((doc2) => doc2.guid)); } /** * Changes that happen inside of a transaction are bundled. This means that * the observer fires _after_ the transaction is finished and that all changes * that happened inside of the transaction are sent as one message to the * other peers. * * @template T * @param {function(Transaction):T} f The function that should be executed as a transaction * @param {any} [origin] Origin of who started the transaction. Will be stored on transaction.origin * @return T * * @public */ transact(f, origin2 = null) { return transact(this, f, origin2); } /** * Define a shared data type. * * Multiple calls of `ydoc.get(name, TypeConstructor)` yield the same result * and do not overwrite each other. I.e. * `ydoc.get(name, Y.Array) === ydoc.get(name, Y.Array)` * * After this method is called, the type is also available on `ydoc.share.get(name)`. * * *Best Practices:* * Define all types right after the Y.Doc instance is created and store them in a separate object. * Also use the typed methods `getText(name)`, `getArray(name)`, .. * * @template {typeof AbstractType<any>} Type * @example * const ydoc = new Y.Doc(..) * const appState = { * document: ydoc.getText('document') * comments: ydoc.getArray('comments') * } * * @param {string} name * @param {Type} TypeConstructor The constructor of the type definition. E.g. Y.Text, Y.Array, Y.Map, ... * @return {InstanceType<Type>} The created type. Constructed with TypeConstructor * * @public */ get(name, TypeConstructor = ( /** @type {any} */ AbstractType )) { const type = setIfUndefined(this.share, name, () => { const t = new TypeConstructor(); t._integrate(this, null); return t; }); const Constr = type.constructor; if (TypeConstructor !== AbstractType && Constr !== TypeConstructor) { if (Constr === AbstractType) { const t = new TypeConstructor(); t._map = type._map; type._map.forEach( /** @param {Item?} n */ (n) => { for (; n !== null; n = n.left) { n.parent = t; } } ); t._start = type._start; for (let n = t._start; n !== null; n = n.right) { n.parent = t; } t._length = type._length; this.share.set(name, t); t._integrate(this, null); return ( /** @type {InstanceType<Type>} */ t ); } else { throw new Error(`Type with the name ${name} has already been defined with a different constructor`); } } return ( /** @type {InstanceType<Type>} */ type ); } /** * @template T * @param {string} [name] * @return {YArray<T>} * * @public */ getArray(name = "") { return ( /** @type {YArray<T>} */ this.get(name, YArray) ); } /** * @param {string} [name] * @return {YText} * * @public */ getText(name = "") { return this.get(name, YText); } /** * @template T * @param {string} [name] * @return {YMap<T>} * * @public */ getMap(name = "") { return ( /** @type {YMap<T>} */ this.get(name, YMap) ); } /** * @param {string} [name] * @return {YXmlElement} * * @public */ getXmlElement(name = "") { return ( /** @type {YXmlElement<{[key:string]:string}>} */ this.get(name, YXmlElement) ); } /** * @param {string} [name] * @return {YXmlFragment} * * @public */ getXmlFragment(name = "") { return this.get(name, YXmlFragment); } /** * Converts the entire document into a js object, recursively traversing each yjs type * Doesn't log types that have not been defined (using ydoc.getType(..)). * * @deprecated Do not use this method and rather call toJSON directly on the shared types. * * @return {Object<string, any>} */ toJSON() { const doc2 = {}; this.share.forEach((value, key) => { doc2[key] = value.toJSON(); }); return doc2; } /** * Emit `destroy` event and unregister all event handlers. */ destroy() { this.isDestroyed = true; from(this.subdocs).forEach((subdoc) => subdoc.destroy()); const item = this._item; if (item !== null) { this._item = null; const content = ( /** @type {ContentDoc} */ item.content ); content.doc = new _Doc({ guid: this.guid, ...content.opts, shouldLoad: false }); content.doc._item = item; transact( /** @type {any} */ item.parent.doc, (transaction) => { const doc2 = content.doc; if (!item.deleted) { transaction.subdocsAdded.add(doc2); } transaction.subdocsRemoved.add(this); }, null, true ); } this.emit("destroyed", [true]); this.emit("destroy", [this]); super.destroy(); } }; var DSDecoderV1 = class { /** * @param {decoding.Decoder} decoder */ constructor(decoder) { this.restDecoder = decoder; } resetDsCurVal() { } /** * @return {number} */ readDsClock() { return readVarUint(this.restDecoder); } /** * @return {number} */ readDsLen() { return readVarUint(this.restDecoder); } }; var UpdateDecoderV1 = class extends DSDecoderV1 { /** * @return {ID} */ readLeftID() { return createID(readVarUint(this.restDecoder), readVarUint(this.restDecoder)); } /** * @return {ID} */ readRightID() { return createID(readVarUint(this.restDecoder), readVarUint(this.restDecoder)); } /** * Read the next client id. * Use this in favor of readID whenever possible to reduce the number of objects created. */ readClient() { return readVarUint(this.restDecoder); } /** * @return {number} info An unsigned 8-bit integer */ readInfo() { return readUint8(this.restDecoder); } /** * @return {string} */ readString() { return readVarString(this.restDecoder); } /** * @return {boolean} isKey */ readParentInfo() { return readVarUint(this.restDecoder) === 1; } /** * @return {number} info An unsigned 8-bit integer */ readTypeRef() { return readVarUint(this.restDecoder); } /** * Write len of a struct - well suited for Opt RLE encoder. * * @return {number} len */ readLen() { return readVarUint(this.restDecoder); } /** * @return {any} */ readAny() { return readAny(this.restDecoder); } /** * @return {Uint8Array} */ readBuf() { return copyUint8Array(readVarUint8Array(this.restDecoder)); } /** * Legacy implementation uses JSON parse. We use any-decoding in v2. * * @return {any} */ readJSON() { return JSON.parse(readVarString(this.restDecoder)); } /** * @return {string} */ readKey() { return readVarString(this.restDecoder); } }; var DSDecoderV2 = class { /** * @param {decoding.Decoder} decoder */ constructor(decoder) { this.dsCurrVal = 0; this.restDecoder = decoder; } resetDsCurVal() { this.dsCurrVal = 0; } /** * @return {number} */ readDsClock() { this.dsCurrVal += readVarUint(this.restDecoder); return this.dsCurrVal; } /** * @return {number} */ readDsLen() { const diff = readVarUint(this.restDecoder) + 1; this.dsCurrVal += diff; return diff; } }; var UpdateDecoderV2 = class extends DSDecoderV2 { /** * @param {decoding.Decoder} decoder */ constructor(decoder) { super(decoder); this.keys = []; readVarUint(decoder); this.keyClockDecoder = new IntDiffOptRleDecoder(readVarUint8Array(decoder)); this.clientDecoder = new UintOptRleDecoder(readVarUint8Array(decoder)); this.leftClockDecoder = new IntDiffOptRleDecoder(readVarUint8Array(decoder)); this.rightClockDecoder = new IntDiffOptRleDecoder(readVarUint8Array(decoder)); this.infoDecoder = new RleDecoder(readVarUint8Array(decoder), readUint8); this.stringDecoder = new StringDecoder(readVarUint8Array(decoder)); this.parentInfoDecoder = new RleDecoder(readVarUint8Array(decoder), readUint8); this.typeRefDecoder = new UintOptRleDecoder(readVarUint8Array(decoder)); this.lenDecoder = new UintOptRleDecoder(readVarUint8Array(decoder)); } /** * @return {ID} */ readLeftID() { return new ID(this.clientDecoder.read(), this.leftClockDecoder.read()); } /** * @return {ID} */ readRightID() { return new ID(this.clientDecoder.read(), this.rightClockDecoder.read()); } /** * Read the next client id. * Use this in favor of readID whenever possible to reduce the number of objects created. */ readClient() { return this.clientDecoder.read(); } /** * @return {number} info An unsigned 8-bit integer */ readInfo() { return ( /** @type {number} */ this.infoDecoder.read() ); } /** * @return {string} */ readString() { return this.stringDecoder.read(); } /** * @return {boolean} */ readParentInfo() { return this.parentInfoDecoder.read() === 1; } /** * @return {number} An unsigned 8-bit integer */ readTypeRef() { return this.typeRefDecoder.read(); } /** * Write len of a struct - well suited for Opt RLE encoder. * * @return {number} */ readLen() { return this.lenDecoder.read(); } /** * @return {any} */ readAny() { return readAny(this.restDecoder); } /** * @return {Uint8Array} */ readBuf() { return readVarUint8Array(this.restDecoder); } /** * This is mainly here for legacy purposes. * * Initial we incoded objects using JSON. Now we use the much faster lib0/any-encoder. This method mainly exists for legacy purposes for the v1 encoder. * * @return {any} */ readJSON() { return readAny(this.restDecoder); } /** * @return {string} */ readKey() { const keyClock = this.keyClockDecoder.read(); if (keyClock < this.keys.length) { return this.keys[keyClock]; } else { const key = this.stringDecoder.read(); this.keys.push(key); return key; } } }; var DSEncoderV1 = class { constructor() { this.restEncoder = createEncoder(); } toUint8Array() { return toUint8Array(this.restEncoder); } resetDsCurVal() { } /** * @param {number} clock */ writeDsClock(clock) { writeVarUint(this.restEncoder, clock); } /** * @param {number} len */ writeDsLen(len) { writeVarUint(this.restEncoder, len); } }; var UpdateEncoderV1 = class extends DSEncoderV1 { /** * @param {ID} id */ writeLeftID(id2) { writeVarUint(this.restEncoder, id2.client); writeVarUint(this.restEncoder, id2.clock); } /** * @param {ID} id */ writeRightID(id2) { writeVarUint(this.restEncoder, id2.client); writeVarUint(this.restEncoder, id2.clock); } /** * Use writeClient and writeClock instead of writeID if possible. * @param {number} client */ writeClient(client) { writeVarUint(this.restEncoder, client); } /** * @param {number} info An unsigned 8-bit integer */ writeInfo(info) { writeUint8(this.restEncoder, info); } /** * @param {string} s */ writeString(s) { writeVarString(this.restEncoder, s); } /** * @param {boolean} isYKey */ writeParentInfo(isYKey) { writeVarUint(this.restEncoder, isYKey ? 1 : 0); } /** * @param {number} info An unsigned 8-bit integer */ writeTypeRef(info) { writeVarUint(this.restEncoder, info); } /** * Write len of a struct - well suited for Opt RLE encoder. * * @param {number} len */ writeLen(len) { writeVarUint(this.restEncoder, len); } /** * @param {any} any */ writeAny(any2) { writeAny(this.restEncoder, any2); } /** * @param {Uint8Array} buf */ writeBuf(buf) { writeVarUint8Array(this.restEncoder, buf); } /** * @param {any} embed */ writeJSON(embed) { writeVarString(this.restEncoder, JSON.stringify(embed)); } /** * @param {string} key */ writeKey(key) { writeVarString(this.restEncoder, key); } }; var DSEncoderV2 = class { constructor() { this.restEncoder = createEncoder(); this.dsCurrVal = 0; } toUint8Array() { return toUint8Array(this.restEncoder); } resetDsCurVal() { this.dsCurrVal = 0; } /** * @param {number} clock */ writeDsClock(clock) { const diff = clock - this.dsCurrVal; this.dsCurrVal = clock; writeVarUint(this.restEncoder, diff); } /** * @param {number} len */ writeDsLen(len) { if (len === 0) { unexpectedCase(); } writeVarUint(this.restEncoder, len - 1); this.dsCurrVal += len; } }; var UpdateEncoderV2 = class extends DSEncoderV2 { constructor() { super(); this.keyMap = /* @__PURE__ */ new Map(); this.keyClock = 0; this.keyClockEncoder = new IntDiffOptRleEncoder(); this.clientEncoder = new UintOptRleEncoder(); this.leftClockEncoder = new IntDiffOptRleEncoder(); this.rightClockEncoder = new IntDiffOptRleEncoder(); this.infoEncoder = new RleEncoder(writeUint8); this.stringEncoder = new StringEncoder(); this.parentInfoEncoder = new RleEncoder(writeUint8); this.typeRefEncoder = new UintOptRleEncoder(); this.lenEncoder = new UintOptRleEncoder(); } toUint8Array() { const encoder = createEncoder(); writeVarUint(encoder, 0); writeVarUint8Array(encoder, this.keyClockEncoder.toUint8Array()); writeVarUint8Array(encoder, this.clientEncoder.toUint8Array()); writeVarUint8Array(encoder, this.leftClockEncoder.toUint8Array()); writeVarUint8Array(encoder, this.rightClockEncoder.toUint8Array()); writeVarUint8Array(encoder, toUint8Array(this.infoEncoder)); writeVarUint8Array(encoder, this.stringEncoder.toUint8Array()); writeVarUint8Array(encoder, toUint8Array(this.parentInfoEncoder)); writeVarUint8Array(encoder, this.typeRefEncoder.toUint8Array()); writeVarUint8Array(encoder, this.lenEncoder.toUint8Array()); writeUint8Array(encoder, toUint8Array(this.restEncoder)); return toUint8Array(encoder); } /** * @param {ID} id */ writeLeftID(id2) { this.clientEncoder.write(id2.client); this.leftClockEncoder.write(id2.clock); } /** * @param {ID} id */ writeRightID(id2) { this.clientEncoder.write(id2.client); this.rightClockEncoder.write(id2.clock); } /** * @param {number} client */ writeClient(client) { this.clientEncoder.write(client); } /** * @param {number} info An unsigned 8-bit integer */ writeInfo(info) { this.infoEncoder.write(info); } /** * @param {string} s */ writeString(s) { this.stringEncoder.write(s); } /** * @param {boolean} isYKey */ writeParentInfo(isYKey) { this.parentInfoEncoder.write(isYKey ? 1 : 0); } /** * @param {number} info An unsigned 8-bit integer */ writeTypeRef(info) { this.typeRefEncoder.write(info); } /** * Write len of a struct - well suited for Opt RLE encoder. * * @param {number} len */ writeLen(len) { this.lenEncoder.write(len); } /** * @param {any} any */ writeAny(any2) { writeAny(this.restEncoder, any2); } /** * @param {Uint8Array} buf */ writeBuf(buf) { writeVarUint8Array(this.restEncoder, buf); } /** * This is mainly here for legacy purposes. * * Initial we incoded objects using JSON. Now we use the much faster lib0/any-encoder. This method mainly exists for legacy purposes for the v1 encoder. * * @param {any} embed */ writeJSON(embed) { writeAny(this.restEncoder, embed); } /** * Property keys are often reused. For example, in y-prosemirror the key `bold` might * occur very often. For a 3d application, the key `position` might occur very often. * * We cache these keys in a Map and refer to them via a unique number. * * @param {string} key */ writeKey(key) { const clock = this.keyMap.get(key); if (clock === void 0) { this.keyClockEncoder.write(this.keyClock++); this.stringEncoder.write(key); } else { this.keyClockEncoder.write(clock); } } }; var writeStructs = (encoder, structs, client, clock) => { clock = max(clock, structs[0].id.clock); const startNewStructs = findIndexSS(structs, clock); writeVarUint(encoder.restEncoder, structs.length - startNewStructs); encoder.writeClient(client); writeVarUint(encoder.restEncoder, clock); const firstStruct = structs[startNewStructs]; firstStruct.write(encoder, clock - firstStruct.id.clock); for (let i = startNewStructs + 1; i < structs.length; i++) { structs[i].write(encoder, 0); } }; var writeClientsStructs = (encoder, store2, _sm) => { const sm = /* @__PURE__ */ new Map(); _sm.forEach((clock, client) => { if (getState(store2, client) > clock) { sm.set(client, clock); } }); getStateVector(store2).forEach((_clock, client) => { if (!_sm.has(client)) { sm.set(client, 0); } }); writeVarUint(encoder.restEncoder, sm.size); from(sm.entries()).sort((a, b) => b[0] - a[0]).forEach(([client, clock]) => { writeStructs( encoder, /** @type {Array<GC|Item>} */ store2.clients.get(client), client, clock ); }); }; var readClientsStructRefs = (decoder, doc2) => { const clientRefs = create(); const numOfStateUpdates = readVarUint(decoder.restDecoder); for (let i = 0; i < numOfStateUpdates; i++) { const numberOfStructs = readVarUint(decoder.restDecoder); const refs = new Array(numberOfStructs); const client = decoder.readClient(); let clock = readVarUint(decoder.restDecoder); clientRefs.set(client, { i: 0, refs }); for (let i2 = 0; i2 < numberOfStructs; i2++) { const info = decoder.readInfo(); switch (BITS5 & info) { case 0: { const len = decoder.readLen(); refs[i2] = new GC(createID(client, clock), len); clock += len; break; } case 10: { const len = readVarUint(decoder.restDecoder); refs[i2] = new Skip(createID(client, clock), len); clock += len; break; } default: { const cantCopyParentInfo = (info & (BIT7 | BIT8)) === 0; const struct = new Item( createID(client, clock), null, // left (info & BIT8) === BIT8 ? decoder.readLeftID() : null, // origin null, // right (info & BIT7) === BIT7 ? decoder.readRightID() : null, // right origin cantCopyParentInfo ? decoder.readParentInfo() ? doc2.get(decoder.readString()) : decoder.readLeftID() : null, // parent cantCopyParentInfo && (info & BIT6) === BIT6 ? decoder.readString() : null, // parentSub readItemContent(decoder, info) // item content ); refs[i2] = struct; clock += struct.length; } } } } return clientRefs; }; var integrateStructs = (transaction, store2, clientsStructRefs) => { const stack = []; let clientsStructRefsIds = from(clientsStructRefs.keys()).sort((a, b) => a - b); if (clientsStructRefsIds.length === 0) { return null; } const getNextStructTarget = () => { if (clientsStructRefsIds.length === 0) { return null; } let nextStructsTarget = ( /** @type {{i:number,refs:Array<GC|Item>}} */ clientsStructRefs.get(clientsStructRefsIds[clientsStructRefsIds.length - 1]) ); while (nextStructsTarget.refs.length === nextStructsTarget.i) { clientsStructRefsIds.pop(); if (clientsStructRefsIds.length > 0) { nextStructsTarget = /** @type {{i:number,refs:Array<GC|Item>}} */ clientsStructRefs.get(clientsStructRefsIds[clientsStructRefsIds.length - 1]); } else { return null; } } return nextStructsTarget; }; let curStructsTarget = getNextStructTarget(); if (curStructsTarget === null) { return null; } const restStructs = new StructStore(); const missingSV = /* @__PURE__ */ new Map(); const updateMissingSv = (client, clock) => { const mclock = missingSV.get(client); if (mclock == null || mclock > clock) { missingSV.set(client, clock); } }; let stackHead = ( /** @type {any} */ curStructsTarget.refs[ /** @type {any} */ curStructsTarget.i++ ] ); const state = /* @__PURE__ */ new Map(); const addStackToRestSS = () => { for (const item of stack) { const client = item.id.client; const inapplicableItems = clientsStructRefs.get(client); if (inapplicableItems) { inapplicableItems.i--; restStructs.clients.set(client, inapplicableItems.refs.slice(inapplicableItems.i)); clientsStructRefs.delete(client); inapplicableItems.i = 0; inapplicableItems.refs = []; } else { restStructs.clients.set(client, [item]); } clientsStructRefsIds = clientsStructRefsIds.filter((c) => c !== client); } stack.length = 0; }; while (true) { if (stackHead.constructor !== Skip) { const localClock = setIfUndefined(state, stackHead.id.client, () => getState(store2, stackHead.id.client)); const offset = localClock - stackHead.id.clock; if (offset < 0) { stack.push(stackHead); updateMissingSv(stackHead.id.client, stackHead.id.clock - 1); addStackToRestSS(); } else { const missing = stackHead.getMissing(transaction, store2); if (missing !== null) { stack.push(stackHead); const structRefs = clientsStructRefs.get( /** @type {number} */ missing ) || { refs: [], i: 0 }; if (structRefs.refs.length === structRefs.i) { updateMissingSv( /** @type {number} */ missing, getState(store2, missing) ); addStackToRestSS(); } else { stackHead = structRefs.refs[structRefs.i++]; continue; } } else if (offset === 0 || offset < stackHead.length) { stackHead.integrate(transaction, offset); state.set(stackHead.id.client, stackHead.id.clock + stackHead.length); } } } if (stack.length > 0) { stackHead = /** @type {GC|Item} */ stack.pop(); } else if (curStructsTarget !== null && curStructsTarget.i < curStructsTarget.refs.length) { stackHead = /** @type {GC|Item} */ curStructsTarget.refs[curStructsTarget.i++]; } else { curStructsTarget = getNextStructTarget(); if (curStructsTarget === null) { break; } else { stackHead = /** @type {GC|Item} */ curStructsTarget.refs[curStructsTarget.i++]; } } } if (restStructs.clients.size > 0) { const encoder = new UpdateEncoderV2(); writeClientsStructs(encoder, restStructs, /* @__PURE__ */ new Map()); writeVarUint(encoder.restEncoder, 0); return { missing: missingSV, update: encoder.toUint8Array() }; } return null; }; var writeStructsFromTransaction = (encoder, transaction) => writeClientsStructs(encoder, transaction.doc.store, transaction.beforeState); var readUpdateV2 = (decoder, ydoc, transactionOrigin, structDecoder = new UpdateDecoderV2(decoder)) => transact(ydoc, (transaction) => { transaction.local = false; let retry = false; const doc2 = transaction.doc; const store2 = doc2.store; const ss = readClientsStructRefs(structDecoder, doc2); const restStructs = integrateStructs(transaction, store2, ss); const pending = store2.pendingStructs; if (pending) { for (const [client, clock] of pending.missing) { if (clock < getState(store2, client)) { retry = true; break; } } if (restStructs) { for (const [client, clock] of restStructs.missing) { const mclock = pending.missing.get(client); if (mclock == null || mclock > clock) { pending.missing.set(client, clock); } } pending.update = mergeUpdatesV2([pending.update, restStructs.update]); } } else { store2.pendingStructs = restStructs; } const dsRest = readAndApplyDeleteSet(structDecoder, transaction, store2); if (store2.pendingDs) { const pendingDSUpdate = new UpdateDecoderV2(createDecoder(store2.pendingDs)); readVarUint(pendingDSUpdate.restDecoder); const dsRest2 = readAndApplyDeleteSet(pendingDSUpdate, transaction, store2); if (dsRest && dsRest2) { store2.pendingDs = mergeUpdatesV2([dsRest, dsRest2]); } else { store2.pendingDs = dsRest || dsRest2; } } else { store2.pendingDs = dsRest; } if (retry) { const update = ( /** @type {{update: Uint8Array}} */ store2.pendingStructs.update ); store2.pendingStructs = null; applyUpdateV2(transaction.doc, update); } }, transactionOrigin, false); var readUpdate = (decoder, ydoc, transactionOrigin) => readUpdateV2(decoder, ydoc, transactionOrigin, new UpdateDecoderV1(decoder)); var applyUpdateV2 = (ydoc, update, transactionOrigin, YDecoder = UpdateDecoderV2) => { const decoder = createDecoder(update); readUpdateV2(decoder, ydoc, transactionOrigin, new YDecoder(decoder)); }; var applyUpdate = (ydoc, update, transactionOrigin) => applyUpdateV2(ydoc, update, transactionOrigin, UpdateDecoderV1); var writeStateAsUpdate = (encoder, doc2, targetStateVector = /* @__PURE__ */ new Map()) => { writeClientsStructs(encoder, doc2.store, targetStateVector); writeDeleteSet(encoder, createDeleteSetFromStructStore(doc2.store)); }; var encodeStateAsUpdateV2 = (doc2, encodedTargetStateVector = new Uint8Array([0]), encoder = new UpdateEncoderV2()) => { const targetStateVector = decodeStateVector(encodedTargetStateVector); writeStateAsUpdate(encoder, doc2, targetStateVector); const updates = [encoder.toUint8Array()]; if (doc2.store.pendingDs) { updates.push(doc2.store.pendingDs); } if (doc2.store.pendingStructs) { updates.push(diffUpdateV2(doc2.store.pendingStructs.update, encodedTargetStateVector)); } if (updates.length > 1) { if (encoder.constructor === UpdateEncoderV1) { return mergeUpdates(updates.map((update, i) => i === 0 ? update : convertUpdateFormatV2ToV1(update))); } else if (encoder.constructor === UpdateEncoderV2) { return mergeUpdatesV2(updates); } } return updates[0]; }; var encodeStateAsUpdate = (doc2, encodedTargetStateVector) => encodeStateAsUpdateV2(doc2, encodedTargetStateVector, new UpdateEncoderV1()); var readStateVector = (decoder) => { const ss = /* @__PURE__ */ new Map(); const ssLength = readVarUint(decoder.restDecoder); for (let i = 0; i < ssLength; i++) { const client = readVarUint(decoder.restDecoder); const clock = readVarUint(decoder.restDecoder); ss.set(client, clock); } return ss; }; var decodeStateVector = (decodedState) => readStateVector(new DSDecoderV1(createDecoder(decodedState))); var writeStateVector = (encoder, sv) => { writeVarUint(encoder.restEncoder, sv.size); from(sv.entries()).sort((a, b) => b[0] - a[0]).forEach(([client, clock]) => { writeVarUint(encoder.restEncoder, client); writeVarUint(encoder.restEncoder, clock); }); return encoder; }; var writeDocumentStateVector = (encoder, doc2) => writeStateVector(encoder, getStateVector(doc2.store)); var encodeStateVectorV2 = (doc2, encoder = new DSEncoderV2()) => { if (doc2 instanceof Map) { writeStateVector(encoder, doc2); } else { writeDocumentStateVector(encoder, doc2); } return encoder.toUint8Array(); }; var encodeStateVector = (doc2) => encodeStateVectorV2(doc2, new DSEncoderV1()); var EventHandler = class { constructor() { this.l = []; } }; var createEventHandler = () => new EventHandler(); var addEventHandlerListener = (eventHandler, f) => eventHandler.l.push(f); var removeEventHandlerListener = (eventHandler, f) => { const l = eventHandler.l; const len = l.length; eventHandler.l = l.filter((g) => f !== g); if (len === eventHandler.l.length) { console.error("[yjs] Tried to remove event handler that doesn't exist."); } }; var callEventHandlerListeners = (eventHandler, arg0, arg1) => callAll(eventHandler.l, [arg0, arg1]); var ID = class { /** * @param {number} client client id * @param {number} clock unique per client id, continuous number */ constructor(client, clock) { this.client = client; this.clock = clock; } }; var compareIDs = (a, b) => a === b || a !== null && b !== null && a.client === b.client && a.clock === b.clock; var createID = (client, clock) => new ID(client, clock); var writeID = (encoder, id2) => { writeVarUint(encoder, id2.client); writeVarUint(encoder, id2.clock); }; var readID = (decoder) => createID(readVarUint(decoder), readVarUint(decoder)); var findRootTypeKey = (type) => { for (const [key, value] of type.doc.share.entries()) { if (value === type) { return key; } } throw unexpectedCase(); }; var isParentOf = (parent, child) => { while (child !== null) { if (child.parent === parent) { return true; } child = /** @type {AbstractType<any>} */ child.parent._item; } return false; }; var logType = (type) => { const res = []; let n = type._start; while (n) { res.push(n); n = n.right; } console.log("Children: ", res); console.log("Children content: ", res.filter((m) => !m.deleted).map((m) => m.content)); }; var PermanentUserData = class { /** * @param {Doc} doc * @param {YMap<any>} [storeType] */ constructor(doc2, storeType = doc2.getMap("users")) { const dss = /* @__PURE__ */ new Map(); this.yusers = storeType; this.doc = doc2; this.clients = /* @__PURE__ */ new Map(); this.dss = dss; const initUser = (user, userDescription) => { const ds = user.get("ds"); const ids = user.get("ids"); const addClientId = ( /** @param {number} clientid */ (clientid) => this.clients.set(clientid, userDescription) ); ds.observe( /** @param {YArrayEvent<any>} event */ (event) => { event.changes.added.forEach((item) => { item.content.getContent().forEach((encodedDs) => { if (encodedDs instanceof Uint8Array) { this.dss.set(userDescription, mergeDeleteSets([this.dss.get(userDescription) || createDeleteSet(), readDeleteSet(new DSDecoderV1(createDecoder(encodedDs)))])); } }); }); } ); this.dss.set(userDescription, mergeDeleteSets(ds.map((encodedDs) => readDeleteSet(new DSDecoderV1(createDecoder(encodedDs)))))); ids.observe( /** @param {YArrayEvent<any>} event */ (event) => event.changes.added.forEach((item) => item.content.getContent().forEach(addClientId)) ); ids.forEach(addClientId); }; storeType.observe((event) => { event.keysChanged.forEach( (userDescription) => initUser(storeType.get(userDescription), userDescription) ); }); storeType.forEach(initUser); } /** * @param {Doc} doc * @param {number} clientid * @param {string} userDescription * @param {Object} conf * @param {function(Transaction, DeleteSet):boolean} [conf.filter] */ setUserMapping(doc2, clientid, userDescription, { filter = () => true } = {}) { const users2 = this.yusers; let user = users2.get(userDescription); if (!user) { user = new YMap(); user.set("ids", new YArray()); user.set("ds", new YArray()); users2.set(userDescription, user); } user.get("ids").push([clientid]); users2.observe((_event) => { setTimeout(() => { const userOverwrite = users2.get(userDescription); if (userOverwrite !== user) { user = userOverwrite; this.clients.forEach((_userDescription, clientid2) => { if (userDescription === _userDescription) { user.get("ids").push([clientid2]); } }); const encoder = new DSEncoderV1(); const ds = this.dss.get(userDescription); if (ds) { writeDeleteSet(encoder, ds); user.get("ds").push([encoder.toUint8Array()]); } } }, 0); }); doc2.on( "afterTransaction", /** @param {Transaction} transaction */ (transaction) => { setTimeout(() => { const yds = user.get("ds"); const ds = transaction.deleteSet; if (transaction.local && ds.clients.size > 0 && filter(transaction, ds)) { const encoder = new DSEncoderV1(); writeDeleteSet(encoder, ds); yds.push([encoder.toUint8Array()]); } }); } ); } /** * @param {number} clientid * @return {any} */ getUserByClientId(clientid) { return this.clients.get(clientid) || null; } /** * @param {ID} id * @return {string | null} */ getUserByDeletedId(id2) { for (const [userDescription, ds] of this.dss.entries()) { if (isDeleted(ds, id2)) { return userDescription; } } return null; } }; var RelativePosition = class { /** * @param {ID|null} type * @param {string|null} tname * @param {ID|null} item * @param {number} assoc */ constructor(type, tname, item, assoc = 0) { this.type = type; this.tname = tname; this.item = item; this.assoc = assoc; } }; var relativePositionToJSON = (rpos) => { const json = {}; if (rpos.type) { json.type = rpos.type; } if (rpos.tname) { json.tname = rpos.tname; } if (rpos.item) { json.item = rpos.item; } if (rpos.assoc != null) { json.assoc = rpos.assoc; } return json; }; var createRelativePositionFromJSON = (json) => new RelativePosition(json.type == null ? null : createID(json.type.client, json.type.clock), json.tname ?? null, json.item == null ? null : createID(json.item.client, json.item.clock), json.assoc == null ? 0 : json.assoc); var AbsolutePosition = class { /** * @param {AbstractType<any>} type * @param {number} index * @param {number} [assoc] */ constructor(type, index, assoc = 0) { this.type = type; this.index = index; this.assoc = assoc; } }; var createAbsolutePosition = (type, index, assoc = 0) => new AbsolutePosition(type, index, assoc); var createRelativePosition = (type, item, assoc) => { let typeid = null; let tname = null; if (type._item === null) { tname = findRootTypeKey(type); } else { typeid = createID(type._item.id.client, type._item.id.clock); } return new RelativePosition(typeid, tname, item, assoc); }; var createRelativePositionFromTypeIndex = (type, index, assoc = 0) => { let t = type._start; if (assoc < 0) { if (index === 0) { return createRelativePosition(type, null, assoc); } index--; } while (t !== null) { if (!t.deleted && t.countable) { if (t.length > index) { return createRelativePosition(type, createID(t.id.client, t.id.clock + index), assoc); } index -= t.length; } if (t.right === null && assoc < 0) { return createRelativePosition(type, t.lastId, assoc); } t = t.right; } return createRelativePosition(type, null, assoc); }; var writeRelativePosition = (encoder, rpos) => { const { type, tname, item, assoc } = rpos; if (item !== null) { writeVarUint(encoder, 0); writeID(encoder, item); } else if (tname !== null) { writeUint8(encoder, 1); writeVarString(encoder, tname); } else if (type !== null) { writeUint8(encoder, 2); writeID(encoder, type); } else { throw unexpectedCase(); } writeVarInt(encoder, assoc); return encoder; }; var encodeRelativePosition = (rpos) => { const encoder = createEncoder(); writeRelativePosition(encoder, rpos); return toUint8Array(encoder); }; var readRelativePosition = (decoder) => { let type = null; let tname = null; let itemID = null; switch (readVarUint(decoder)) { case 0: itemID = readID(decoder); break; case 1: tname = readVarString(decoder); break; case 2: { type = readID(decoder); } } const assoc = hasContent(decoder) ? readVarInt(decoder) : 0; return new RelativePosition(type, tname, itemID, assoc); }; var decodeRelativePosition = (uint8Array) => readRelativePosition(createDecoder(uint8Array)); var getItemWithOffset = (store2, id2) => { const item = getItem(store2, id2); const diff = id2.clock - item.id.clock; return { item, diff }; }; var createAbsolutePositionFromRelativePosition = (rpos, doc2, followUndoneDeletions = true) => { const store2 = doc2.store; const rightID = rpos.item; const typeID = rpos.type; const tname = rpos.tname; const assoc = rpos.assoc; let type = null; let index = 0; if (rightID !== null) { if (getState(store2, rightID.client) <= rightID.clock) { return null; } const res = followUndoneDeletions ? followRedone(store2, rightID) : getItemWithOffset(store2, rightID); const right = res.item; if (!(right instanceof Item)) { return null; } type = /** @type {AbstractType<any>} */ right.parent; if (type._item === null || !type._item.deleted) { index = right.deleted || !right.countable ? 0 : res.diff + (assoc >= 0 ? 0 : 1); let n = right.left; while (n !== null) { if (!n.deleted && n.countable) { index += n.length; } n = n.left; } } } else { if (tname !== null) { type = doc2.get(tname); } else if (typeID !== null) { if (getState(store2, typeID.client) <= typeID.clock) { return null; } const { item } = followUndoneDeletions ? followRedone(store2, typeID) : { item: getItem(store2, typeID) }; if (item instanceof Item && item.content instanceof ContentType) { type = item.content.type; } else { return null; } } else { throw unexpectedCase(); } if (assoc >= 0) { index = type._length; } else { index = 0; } } return createAbsolutePosition(type, index, rpos.assoc); }; var compareRelativePositions = (a, b) => a === b || a !== null && b !== null && a.tname === b.tname && compareIDs(a.item, b.item) && compareIDs(a.type, b.type) && a.assoc === b.assoc; var Snapshot = class { /** * @param {DeleteSet} ds * @param {Map<number,number>} sv state map */ constructor(ds, sv) { this.ds = ds; this.sv = sv; } }; var equalSnapshots = (snap1, snap2) => { const ds1 = snap1.ds.clients; const ds2 = snap2.ds.clients; const sv1 = snap1.sv; const sv2 = snap2.sv; if (sv1.size !== sv2.size || ds1.size !== ds2.size) { return false; } for (const [key, value] of sv1.entries()) { if (sv2.get(key) !== value) { return false; } } for (const [client, dsitems1] of ds1.entries()) { const dsitems2 = ds2.get(client) || []; if (dsitems1.length !== dsitems2.length) { return false; } for (let i = 0; i < dsitems1.length; i++) { const dsitem1 = dsitems1[i]; const dsitem2 = dsitems2[i]; if (dsitem1.clock !== dsitem2.clock || dsitem1.len !== dsitem2.len) { return false; } } } return true; }; var encodeSnapshotV2 = (snapshot2, encoder = new DSEncoderV2()) => { writeDeleteSet(encoder, snapshot2.ds); writeStateVector(encoder, snapshot2.sv); return encoder.toUint8Array(); }; var encodeSnapshot = (snapshot2) => encodeSnapshotV2(snapshot2, new DSEncoderV1()); var decodeSnapshotV2 = (buf, decoder = new DSDecoderV2(createDecoder(buf))) => { return new Snapshot(readDeleteSet(decoder), readStateVector(decoder)); }; var decodeSnapshot = (buf) => decodeSnapshotV2(buf, new DSDecoderV1(createDecoder(buf))); var createSnapshot = (ds, sm) => new Snapshot(ds, sm); var emptySnapshot = createSnapshot(createDeleteSet(), /* @__PURE__ */ new Map()); var snapshot = (doc2) => createSnapshot(createDeleteSetFromStructStore(doc2.store), getStateVector(doc2.store)); var isVisible = (item, snapshot2) => snapshot2 === void 0 ? !item.deleted : snapshot2.sv.has(item.id.client) && (snapshot2.sv.get(item.id.client) || 0) > item.id.clock && !isDeleted(snapshot2.ds, item.id); var splitSnapshotAffectedStructs = (transaction, snapshot2) => { const meta = setIfUndefined(transaction.meta, splitSnapshotAffectedStructs, create2); const store2 = transaction.doc.store; if (!meta.has(snapshot2)) { snapshot2.sv.forEach((clock, client) => { if (clock < getState(store2, client)) { getItemCleanStart(transaction, createID(client, clock)); } }); iterateDeletedStructs(transaction, snapshot2.ds, (_item) => { }); meta.add(snapshot2); } }; var createDocFromSnapshot = (originDoc, snapshot2, newDoc = new Doc()) => { if (originDoc.gc) { throw new Error("Garbage-collection must be disabled in `originDoc`!"); } const { sv, ds } = snapshot2; const encoder = new UpdateEncoderV2(); originDoc.transact((transaction) => { let size2 = 0; sv.forEach((clock) => { if (clock > 0) { size2++; } }); writeVarUint(encoder.restEncoder, size2); for (const [client, clock] of sv) { if (clock === 0) { continue; } if (clock < getState(originDoc.store, client)) { getItemCleanStart(transaction, createID(client, clock)); } const structs = originDoc.store.clients.get(client) || []; const lastStructIndex = findIndexSS(structs, clock - 1); writeVarUint(encoder.restEncoder, lastStructIndex + 1); encoder.writeClient(client); writeVarUint(encoder.restEncoder, 0); for (let i = 0; i <= lastStructIndex; i++) { structs[i].write(encoder, 0); } } writeDeleteSet(encoder, ds); }); applyUpdateV2(newDoc, encoder.toUint8Array(), "snapshot"); return newDoc; }; var snapshotContainsUpdateV2 = (snapshot2, update, YDecoder = UpdateDecoderV2) => { const updateDecoder = new YDecoder(createDecoder(update)); const lazyDecoder = new LazyStructReader(updateDecoder, false); for (let curr = lazyDecoder.curr; curr !== null; curr = lazyDecoder.next()) { if ((snapshot2.sv.get(curr.id.client) || 0) < curr.id.clock + curr.length) { return false; } } const mergedDS = mergeDeleteSets([snapshot2.ds, readDeleteSet(updateDecoder)]); return equalDeleteSets(snapshot2.ds, mergedDS); }; var snapshotContainsUpdate = (snapshot2, update) => snapshotContainsUpdateV2(snapshot2, update, UpdateDecoderV1); var StructStore = class { constructor() { this.clients = /* @__PURE__ */ new Map(); this.pendingStructs = null; this.pendingDs = null; } }; var getStateVector = (store2) => { const sm = /* @__PURE__ */ new Map(); store2.clients.forEach((structs, client) => { const struct = structs[structs.length - 1]; sm.set(client, struct.id.clock + struct.length); }); return sm; }; var getState = (store2, client) => { const structs = store2.clients.get(client); if (structs === void 0) { return 0; } const lastStruct = structs[structs.length - 1]; return lastStruct.id.clock + lastStruct.length; }; var addStruct = (store2, struct) => { let structs = store2.clients.get(struct.id.client); if (structs === void 0) { structs = []; store2.clients.set(struct.id.client, structs); } else { const lastStruct = structs[structs.length - 1]; if (lastStruct.id.clock + lastStruct.length !== struct.id.clock) { throw unexpectedCase(); } } structs.push(struct); }; var findIndexSS = (structs, clock) => { let left = 0; let right = structs.length - 1; let mid = structs[right]; let midclock = mid.id.clock; if (midclock === clock) { return right; } let midindex = floor(clock / (midclock + mid.length - 1) * right); while (left <= right) { mid = structs[midindex]; midclock = mid.id.clock; if (midclock <= clock) { if (clock < midclock + mid.length) { return midindex; } left = midindex + 1; } else { right = midindex - 1; } midindex = floor((left + right) / 2); } throw unexpectedCase(); }; var find = (store2, id2) => { const structs = store2.clients.get(id2.client); return structs[findIndexSS(structs, id2.clock)]; }; var getItem = ( /** @type {function(StructStore,ID):Item} */ find ); var findIndexCleanStart = (transaction, structs, clock) => { const index = findIndexSS(structs, clock); const struct = structs[index]; if (struct.id.clock < clock && struct instanceof Item) { structs.splice(index + 1, 0, splitItem(transaction, struct, clock - struct.id.clock)); return index + 1; } return index; }; var getItemCleanStart = (transaction, id2) => { const structs = ( /** @type {Array<Item>} */ transaction.doc.store.clients.get(id2.client) ); return structs[findIndexCleanStart(transaction, structs, id2.clock)]; }; var getItemCleanEnd = (transaction, store2, id2) => { const structs = store2.clients.get(id2.client); const index = findIndexSS(structs, id2.clock); const struct = structs[index]; if (id2.clock !== struct.id.clock + struct.length - 1 && struct.constructor !== GC) { structs.splice(index + 1, 0, splitItem(transaction, struct, id2.clock - struct.id.clock + 1)); } return struct; }; var replaceStruct = (store2, struct, newStruct) => { const structs = ( /** @type {Array<GC|Item>} */ store2.clients.get(struct.id.client) ); structs[findIndexSS(structs, struct.id.clock)] = newStruct; }; var iterateStructs = (transaction, structs, clockStart, len, f) => { if (len === 0) { return; } const clockEnd = clockStart + len; let index = findIndexCleanStart(transaction, structs, clockStart); let struct; do { struct = structs[index++]; if (clockEnd < struct.id.clock + struct.length) { findIndexCleanStart(transaction, structs, clockEnd); } f(struct); } while (index < structs.length && structs[index].id.clock < clockEnd); }; var Transaction = class { /** * @param {Doc} doc * @param {any} origin * @param {boolean} local */ constructor(doc2, origin2, local) { this.doc = doc2; this.deleteSet = new DeleteSet(); this.beforeState = getStateVector(doc2.store); this.afterState = /* @__PURE__ */ new Map(); this.changed = /* @__PURE__ */ new Map(); this.changedParentTypes = /* @__PURE__ */ new Map(); this._mergeStructs = []; this.origin = origin2; this.meta = /* @__PURE__ */ new Map(); this.local = local; this.subdocsAdded = /* @__PURE__ */ new Set(); this.subdocsRemoved = /* @__PURE__ */ new Set(); this.subdocsLoaded = /* @__PURE__ */ new Set(); this._needFormattingCleanup = false; } }; var writeUpdateMessageFromTransaction = (encoder, transaction) => { if (transaction.deleteSet.clients.size === 0 && !any(transaction.afterState, (clock, client) => transaction.beforeState.get(client) !== clock)) { return false; } sortAndMergeDeleteSet(transaction.deleteSet); writeStructsFromTransaction(encoder, transaction); writeDeleteSet(encoder, transaction.deleteSet); return true; }; var addChangedTypeToTransaction = (transaction, type, parentSub) => { const item = type._item; if (item === null || item.id.clock < (transaction.beforeState.get(item.id.client) || 0) && !item.deleted) { setIfUndefined(transaction.changed, type, create2).add(parentSub); } }; var tryToMergeWithLefts = (structs, pos) => { let right = structs[pos]; let left = structs[pos - 1]; let i = pos; for (; i > 0; right = left, left = structs[--i - 1]) { if (left.deleted === right.deleted && left.constructor === right.constructor) { if (left.mergeWith(right)) { if (right instanceof Item && right.parentSub !== null && /** @type {AbstractType<any>} */ right.parent._map.get(right.parentSub) === right) { right.parent._map.set( right.parentSub, /** @type {Item} */ left ); } continue; } } break; } const merged = pos - i; if (merged) { structs.splice(pos + 1 - merged, merged); } return merged; }; var tryGcDeleteSet = (ds, store2, gcFilter) => { for (const [client, deleteItems] of ds.clients.entries()) { const structs = ( /** @type {Array<GC|Item>} */ store2.clients.get(client) ); for (let di = deleteItems.length - 1; di >= 0; di--) { const deleteItem = deleteItems[di]; const endDeleteItemClock = deleteItem.clock + deleteItem.len; for (let si = findIndexSS(structs, deleteItem.clock), struct = structs[si]; si < structs.length && struct.id.clock < endDeleteItemClock; struct = structs[++si]) { const struct2 = structs[si]; if (deleteItem.clock + deleteItem.len <= struct2.id.clock) { break; } if (struct2 instanceof Item && struct2.deleted && !struct2.keep && gcFilter(struct2)) { struct2.gc(store2, false); } } } } }; var tryMergeDeleteSet = (ds, store2) => { ds.clients.forEach((deleteItems, client) => { const structs = ( /** @type {Array<GC|Item>} */ store2.clients.get(client) ); for (let di = deleteItems.length - 1; di >= 0; di--) { const deleteItem = deleteItems[di]; const mostRightIndexToCheck = min(structs.length - 1, 1 + findIndexSS(structs, deleteItem.clock + deleteItem.len - 1)); for (let si = mostRightIndexToCheck, struct = structs[si]; si > 0 && struct.id.clock >= deleteItem.clock; struct = structs[si]) { si -= 1 + tryToMergeWithLefts(structs, si); } } }); }; var tryGc = (ds, store2, gcFilter) => { tryGcDeleteSet(ds, store2, gcFilter); tryMergeDeleteSet(ds, store2); }; var cleanupTransactions = (transactionCleanups, i) => { if (i < transactionCleanups.length) { const transaction = transactionCleanups[i]; const doc2 = transaction.doc; const store2 = doc2.store; const ds = transaction.deleteSet; const mergeStructs = transaction._mergeStructs; try { sortAndMergeDeleteSet(ds); transaction.afterState = getStateVector(transaction.doc.store); doc2.emit("beforeObserverCalls", [transaction, doc2]); const fs = []; transaction.changed.forEach( (subs, itemtype) => fs.push(() => { if (itemtype._item === null || !itemtype._item.deleted) { itemtype._callObserver(transaction, subs); } }) ); fs.push(() => { transaction.changedParentTypes.forEach((events, type) => { if (type._dEH.l.length > 0 && (type._item === null || !type._item.deleted)) { events = events.filter( (event) => event.target._item === null || !event.target._item.deleted ); events.forEach((event) => { event.currentTarget = type; event._path = null; }); events.sort((event1, event2) => event1.path.length - event2.path.length); fs.push(() => { callEventHandlerListeners(type._dEH, events, transaction); }); } }); fs.push(() => doc2.emit("afterTransaction", [transaction, doc2])); fs.push(() => { if (transaction._needFormattingCleanup) { cleanupYTextAfterTransaction(transaction); } }); }); callAll(fs, []); } finally { if (doc2.gc) { tryGcDeleteSet(ds, store2, doc2.gcFilter); } tryMergeDeleteSet(ds, store2); transaction.afterState.forEach((clock, client) => { const beforeClock = transaction.beforeState.get(client) || 0; if (beforeClock !== clock) { const structs = ( /** @type {Array<GC|Item>} */ store2.clients.get(client) ); const firstChangePos = max(findIndexSS(structs, beforeClock), 1); for (let i2 = structs.length - 1; i2 >= firstChangePos; ) { i2 -= 1 + tryToMergeWithLefts(structs, i2); } } }); for (let i2 = mergeStructs.length - 1; i2 >= 0; i2--) { const { client, clock } = mergeStructs[i2].id; const structs = ( /** @type {Array<GC|Item>} */ store2.clients.get(client) ); const replacedStructPos = findIndexSS(structs, clock); if (replacedStructPos + 1 < structs.length) { if (tryToMergeWithLefts(structs, replacedStructPos + 1) > 1) { continue; } } if (replacedStructPos > 0) { tryToMergeWithLefts(structs, replacedStructPos); } } if (!transaction.local && transaction.afterState.get(doc2.clientID) !== transaction.beforeState.get(doc2.clientID)) { print(ORANGE, BOLD, "[yjs] ", UNBOLD, RED, "Changed the client-id because another client seems to be using it."); doc2.clientID = generateNewClientId(); } doc2.emit("afterTransactionCleanup", [transaction, doc2]); if (doc2._observers.has("update")) { const encoder = new UpdateEncoderV1(); const hasContent2 = writeUpdateMessageFromTransaction(encoder, transaction); if (hasContent2) { doc2.emit("update", [encoder.toUint8Array(), transaction.origin, doc2, transaction]); } } if (doc2._observers.has("updateV2")) { const encoder = new UpdateEncoderV2(); const hasContent2 = writeUpdateMessageFromTransaction(encoder, transaction); if (hasContent2) { doc2.emit("updateV2", [encoder.toUint8Array(), transaction.origin, doc2, transaction]); } } const { subdocsAdded, subdocsLoaded, subdocsRemoved } = transaction; if (subdocsAdded.size > 0 || subdocsRemoved.size > 0 || subdocsLoaded.size > 0) { subdocsAdded.forEach((subdoc) => { subdoc.clientID = doc2.clientID; if (subdoc.collectionid == null) { subdoc.collectionid = doc2.collectionid; } doc2.subdocs.add(subdoc); }); subdocsRemoved.forEach((subdoc) => doc2.subdocs.delete(subdoc)); doc2.emit("subdocs", [{ loaded: subdocsLoaded, added: subdocsAdded, removed: subdocsRemoved }, doc2, transaction]); subdocsRemoved.forEach((subdoc) => subdoc.destroy()); } if (transactionCleanups.length <= i + 1) { doc2._transactionCleanups = []; doc2.emit("afterAllTransactions", [doc2, transactionCleanups]); } else { cleanupTransactions(transactionCleanups, i + 1); } } } }; var transact = (doc2, f, origin2 = null, local = true) => { const transactionCleanups = doc2._transactionCleanups; let initialCall = false; let result = null; if (doc2._transaction === null) { initialCall = true; doc2._transaction = new Transaction(doc2, origin2, local); transactionCleanups.push(doc2._transaction); if (transactionCleanups.length === 1) { doc2.emit("beforeAllTransactions", [doc2]); } doc2.emit("beforeTransaction", [doc2._transaction, doc2]); } try { result = f(doc2._transaction); } finally { if (initialCall) { const finishCleanup = doc2._transaction === transactionCleanups[0]; doc2._transaction = null; if (finishCleanup) { cleanupTransactions(transactionCleanups, 0); } } } return result; }; var StackItem = class { /** * @param {DeleteSet} deletions * @param {DeleteSet} insertions */ constructor(deletions, insertions) { this.insertions = insertions; this.deletions = deletions; this.meta = /* @__PURE__ */ new Map(); } }; var clearUndoManagerStackItem = (tr, um, stackItem) => { iterateDeletedStructs(tr, stackItem.deletions, (item) => { if (item instanceof Item && um.scope.some((type) => type === tr.doc || isParentOf( /** @type {AbstractType<any>} */ type, item ))) { keepItem(item, false); } }); }; var popStackItem = (undoManager2, stack, eventType) => { let _tr = null; const doc2 = undoManager2.doc; const scope = undoManager2.scope; transact(doc2, (transaction) => { while (stack.length > 0 && undoManager2.currStackItem === null) { const store2 = doc2.store; const stackItem = ( /** @type {StackItem} */ stack.pop() ); const itemsToRedo = /* @__PURE__ */ new Set(); const itemsToDelete = []; let performedChange = false; iterateDeletedStructs(transaction, stackItem.insertions, (struct) => { if (struct instanceof Item) { if (struct.redone !== null) { let { item, diff } = followRedone(store2, struct.id); if (diff > 0) { item = getItemCleanStart(transaction, createID(item.id.client, item.id.clock + diff)); } struct = item; } if (!struct.deleted && scope.some((type) => type === transaction.doc || isParentOf( /** @type {AbstractType<any>} */ type, /** @type {Item} */ struct ))) { itemsToDelete.push(struct); } } }); iterateDeletedStructs(transaction, stackItem.deletions, (struct) => { if (struct instanceof Item && scope.some((type) => type === transaction.doc || isParentOf( /** @type {AbstractType<any>} */ type, struct )) && // Never redo structs in stackItem.insertions because they were created and deleted in the same capture interval. !isDeleted(stackItem.insertions, struct.id)) { itemsToRedo.add(struct); } }); itemsToRedo.forEach((struct) => { performedChange = redoItem(transaction, struct, itemsToRedo, stackItem.insertions, undoManager2.ignoreRemoteMapChanges, undoManager2) !== null || performedChange; }); for (let i = itemsToDelete.length - 1; i >= 0; i--) { const item = itemsToDelete[i]; if (undoManager2.deleteFilter(item)) { item.delete(transaction); performedChange = true; } } undoManager2.currStackItem = performedChange ? stackItem : null; } transaction.changed.forEach((subProps, type) => { if (subProps.has(null) && type._searchMarker) { type._searchMarker.length = 0; } }); _tr = transaction; }, undoManager2); const res = undoManager2.currStackItem; if (res != null) { const changedParentTypes = _tr.changedParentTypes; undoManager2.emit("stack-item-popped", [{ stackItem: res, type: eventType, changedParentTypes, origin: undoManager2 }, undoManager2]); undoManager2.currStackItem = null; } return res; }; var UndoManager = class extends ObservableV2 { /** * @param {Doc|AbstractType<any>|Array<AbstractType<any>>} typeScope Limits the scope of the UndoManager. If this is set to a ydoc instance, all changes on that ydoc will be undone. If set to a specific type, only changes on that type or its children will be undone. Also accepts an array of types. * @param {UndoManagerOptions} options */ constructor(typeScope, { captureTimeout = 500, captureTransaction = (_tr) => true, deleteFilter = () => true, trackedOrigins = /* @__PURE__ */ new Set([null]), ignoreRemoteMapChanges = false, doc: doc2 = ( /** @type {Doc} */ isArray(typeScope) ? typeScope[0].doc : typeScope instanceof Doc ? typeScope : typeScope.doc ) } = {}) { super(); this.scope = []; this.doc = doc2; this.addToScope(typeScope); this.deleteFilter = deleteFilter; trackedOrigins.add(this); this.trackedOrigins = trackedOrigins; this.captureTransaction = captureTransaction; this.undoStack = []; this.redoStack = []; this.undoing = false; this.redoing = false; this.currStackItem = null; this.lastChange = 0; this.ignoreRemoteMapChanges = ignoreRemoteMapChanges; this.captureTimeout = captureTimeout; this.afterTransactionHandler = (transaction) => { if (!this.captureTransaction(transaction) || !this.scope.some((type) => transaction.changedParentTypes.has( /** @type {AbstractType<any>} */ type ) || type === this.doc) || !this.trackedOrigins.has(transaction.origin) && (!transaction.origin || !this.trackedOrigins.has(transaction.origin.constructor))) { return; } const undoing = this.undoing; const redoing = this.redoing; const stack = undoing ? this.redoStack : this.undoStack; if (undoing) { this.stopCapturing(); } else if (!redoing) { this.clear(false, true); } const insertions = new DeleteSet(); transaction.afterState.forEach((endClock, client) => { const startClock = transaction.beforeState.get(client) || 0; const len = endClock - startClock; if (len > 0) { addToDeleteSet(insertions, client, startClock, len); } }); const now = getUnixTime(); let didAdd = false; if (this.lastChange > 0 && now - this.lastChange < this.captureTimeout && stack.length > 0 && !undoing && !redoing) { const lastOp = stack[stack.length - 1]; lastOp.deletions = mergeDeleteSets([lastOp.deletions, transaction.deleteSet]); lastOp.insertions = mergeDeleteSets([lastOp.insertions, insertions]); } else { stack.push(new StackItem(transaction.deleteSet, insertions)); didAdd = true; } if (!undoing && !redoing) { this.lastChange = now; } iterateDeletedStructs( transaction, transaction.deleteSet, /** @param {Item|GC} item */ (item) => { if (item instanceof Item && this.scope.some((type) => type === transaction.doc || isParentOf( /** @type {AbstractType<any>} */ type, item ))) { keepItem(item, true); } } ); const changeEvent = [{ stackItem: stack[stack.length - 1], origin: transaction.origin, type: undoing ? "redo" : "undo", changedParentTypes: transaction.changedParentTypes }, this]; if (didAdd) { this.emit("stack-item-added", changeEvent); } else { this.emit("stack-item-updated", changeEvent); } }; this.doc.on("afterTransaction", this.afterTransactionHandler); this.doc.on("destroy", () => { this.destroy(); }); } /** * Extend the scope. * * @param {Array<AbstractType<any> | Doc> | AbstractType<any> | Doc} ytypes */ addToScope(ytypes) { const tmpSet = new Set(this.scope); ytypes = isArray(ytypes) ? ytypes : [ytypes]; ytypes.forEach((ytype) => { if (!tmpSet.has(ytype)) { tmpSet.add(ytype); if (ytype instanceof AbstractType ? ytype.doc !== this.doc : ytype !== this.doc) warn("[yjs#509] Not same Y.Doc"); this.scope.push(ytype); } }); } /** * @param {any} origin */ addTrackedOrigin(origin2) { this.trackedOrigins.add(origin2); } /** * @param {any} origin */ removeTrackedOrigin(origin2) { this.trackedOrigins.delete(origin2); } clear(clearUndoStack = true, clearRedoStack = true) { if (clearUndoStack && this.canUndo() || clearRedoStack && this.canRedo()) { this.doc.transact((tr) => { if (clearUndoStack) { this.undoStack.forEach((item) => clearUndoManagerStackItem(tr, this, item)); this.undoStack = []; } if (clearRedoStack) { this.redoStack.forEach((item) => clearUndoManagerStackItem(tr, this, item)); this.redoStack = []; } this.emit("stack-cleared", [{ undoStackCleared: clearUndoStack, redoStackCleared: clearRedoStack }]); }); } } /** * UndoManager merges Undo-StackItem if they are created within time-gap * smaller than `options.captureTimeout`. Call `um.stopCapturing()` so that the next * StackItem won't be merged. * * * @example * // without stopCapturing * ytext.insert(0, 'a') * ytext.insert(1, 'b') * um.undo() * ytext.toString() // => '' (note that 'ab' was removed) * // with stopCapturing * ytext.insert(0, 'a') * um.stopCapturing() * ytext.insert(0, 'b') * um.undo() * ytext.toString() // => 'a' (note that only 'b' was removed) * */ stopCapturing() { this.lastChange = 0; } /** * Undo last changes on type. * * @return {StackItem?} Returns StackItem if a change was applied */ undo() { this.undoing = true; let res; try { res = popStackItem(this, this.undoStack, "undo"); } finally { this.undoing = false; } return res; } /** * Redo last undo operation. * * @return {StackItem?} Returns StackItem if a change was applied */ redo() { this.redoing = true; let res; try { res = popStackItem(this, this.redoStack, "redo"); } finally { this.redoing = false; } return res; } /** * Are undo steps available? * * @return {boolean} `true` if undo is possible */ canUndo() { return this.undoStack.length > 0; } /** * Are redo steps available? * * @return {boolean} `true` if redo is possible */ canRedo() { return this.redoStack.length > 0; } destroy() { this.trackedOrigins.delete(this); this.doc.off("afterTransaction", this.afterTransactionHandler); super.destroy(); } }; function* lazyStructReaderGenerator(decoder) { const numOfStateUpdates = readVarUint(decoder.restDecoder); for (let i = 0; i < numOfStateUpdates; i++) { const numberOfStructs = readVarUint(decoder.restDecoder); const client = decoder.readClient(); let clock = readVarUint(decoder.restDecoder); for (let i2 = 0; i2 < numberOfStructs; i2++) { const info = decoder.readInfo(); if (info === 10) { const len = readVarUint(decoder.restDecoder); yield new Skip(createID(client, clock), len); clock += len; } else if ((BITS5 & info) !== 0) { const cantCopyParentInfo = (info & (BIT7 | BIT8)) === 0; const struct = new Item( createID(client, clock), null, // left (info & BIT8) === BIT8 ? decoder.readLeftID() : null, // origin null, // right (info & BIT7) === BIT7 ? decoder.readRightID() : null, // right origin // @ts-ignore Force writing a string here. cantCopyParentInfo ? decoder.readParentInfo() ? decoder.readString() : decoder.readLeftID() : null, // parent cantCopyParentInfo && (info & BIT6) === BIT6 ? decoder.readString() : null, // parentSub readItemContent(decoder, info) // item content ); yield struct; clock += struct.length; } else { const len = decoder.readLen(); yield new GC(createID(client, clock), len); clock += len; } } } } var LazyStructReader = class { /** * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder * @param {boolean} filterSkips */ constructor(decoder, filterSkips) { this.gen = lazyStructReaderGenerator(decoder); this.curr = null; this.done = false; this.filterSkips = filterSkips; this.next(); } /** * @return {Item | GC | Skip |null} */ next() { do { this.curr = this.gen.next().value || null; } while (this.filterSkips && this.curr !== null && this.curr.constructor === Skip); return this.curr; } }; var logUpdate = (update) => logUpdateV2(update, UpdateDecoderV1); var logUpdateV2 = (update, YDecoder = UpdateDecoderV2) => { const structs = []; const updateDecoder = new YDecoder(createDecoder(update)); const lazyDecoder = new LazyStructReader(updateDecoder, false); for (let curr = lazyDecoder.curr; curr !== null; curr = lazyDecoder.next()) { structs.push(curr); } print("Structs: ", structs); const ds = readDeleteSet(updateDecoder); print("DeleteSet: ", ds); }; var decodeUpdate = (update) => decodeUpdateV2(update, UpdateDecoderV1); var decodeUpdateV2 = (update, YDecoder = UpdateDecoderV2) => { const structs = []; const updateDecoder = new YDecoder(createDecoder(update)); const lazyDecoder = new LazyStructReader(updateDecoder, false); for (let curr = lazyDecoder.curr; curr !== null; curr = lazyDecoder.next()) { structs.push(curr); } return { structs, ds: readDeleteSet(updateDecoder) }; }; var LazyStructWriter = class { /** * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder */ constructor(encoder) { this.currClient = 0; this.startClock = 0; this.written = 0; this.encoder = encoder; this.clientStructs = []; } }; var mergeUpdates = (updates) => mergeUpdatesV2(updates, UpdateDecoderV1, UpdateEncoderV1); var encodeStateVectorFromUpdateV2 = (update, YEncoder = DSEncoderV2, YDecoder = UpdateDecoderV2) => { const encoder = new YEncoder(); const updateDecoder = new LazyStructReader(new YDecoder(createDecoder(update)), false); let curr = updateDecoder.curr; if (curr !== null) { let size2 = 0; let currClient = curr.id.client; let stopCounting = curr.id.clock !== 0; let currClock = stopCounting ? 0 : curr.id.clock + curr.length; for (; curr !== null; curr = updateDecoder.next()) { if (currClient !== curr.id.client) { if (currClock !== 0) { size2++; writeVarUint(encoder.restEncoder, currClient); writeVarUint(encoder.restEncoder, currClock); } currClient = curr.id.client; currClock = 0; stopCounting = curr.id.clock !== 0; } if (curr.constructor === Skip) { stopCounting = true; } if (!stopCounting) { currClock = curr.id.clock + curr.length; } } if (currClock !== 0) { size2++; writeVarUint(encoder.restEncoder, currClient); writeVarUint(encoder.restEncoder, currClock); } const enc = createEncoder(); writeVarUint(enc, size2); writeBinaryEncoder(enc, encoder.restEncoder); encoder.restEncoder = enc; return encoder.toUint8Array(); } else { writeVarUint(encoder.restEncoder, 0); return encoder.toUint8Array(); } }; var encodeStateVectorFromUpdate = (update) => encodeStateVectorFromUpdateV2(update, DSEncoderV1, UpdateDecoderV1); var parseUpdateMetaV2 = (update, YDecoder = UpdateDecoderV2) => { const from2 = /* @__PURE__ */ new Map(); const to = /* @__PURE__ */ new Map(); const updateDecoder = new LazyStructReader(new YDecoder(createDecoder(update)), false); let curr = updateDecoder.curr; if (curr !== null) { let currClient = curr.id.client; let currClock = curr.id.clock; from2.set(currClient, currClock); for (; curr !== null; curr = updateDecoder.next()) { if (currClient !== curr.id.client) { to.set(currClient, currClock); from2.set(curr.id.client, curr.id.clock); currClient = curr.id.client; } currClock = curr.id.clock + curr.length; } to.set(currClient, currClock); } return { from: from2, to }; }; var parseUpdateMeta = (update) => parseUpdateMetaV2(update, UpdateDecoderV1); var sliceStruct = (left, diff) => { if (left.constructor === GC) { const { client, clock } = left.id; return new GC(createID(client, clock + diff), left.length - diff); } else if (left.constructor === Skip) { const { client, clock } = left.id; return new Skip(createID(client, clock + diff), left.length - diff); } else { const leftItem = ( /** @type {Item} */ left ); const { client, clock } = leftItem.id; return new Item( createID(client, clock + diff), null, createID(client, clock + diff - 1), null, leftItem.rightOrigin, leftItem.parent, leftItem.parentSub, leftItem.content.splice(diff) ); } }; var mergeUpdatesV2 = (updates, YDecoder = UpdateDecoderV2, YEncoder = UpdateEncoderV2) => { if (updates.length === 1) { return updates[0]; } const updateDecoders = updates.map((update) => new YDecoder(createDecoder(update))); let lazyStructDecoders = updateDecoders.map((decoder) => new LazyStructReader(decoder, true)); let currWrite = null; const updateEncoder = new YEncoder(); const lazyStructEncoder = new LazyStructWriter(updateEncoder); while (true) { lazyStructDecoders = lazyStructDecoders.filter((dec) => dec.curr !== null); lazyStructDecoders.sort( /** @type {function(any,any):number} */ (dec1, dec2) => { if (dec1.curr.id.client === dec2.curr.id.client) { const clockDiff = dec1.curr.id.clock - dec2.curr.id.clock; if (clockDiff === 0) { return dec1.curr.constructor === dec2.curr.constructor ? 0 : dec1.curr.constructor === Skip ? 1 : -1; } else { return clockDiff; } } else { return dec2.curr.id.client - dec1.curr.id.client; } } ); if (lazyStructDecoders.length === 0) { break; } const currDecoder = lazyStructDecoders[0]; const firstClient = ( /** @type {Item | GC} */ currDecoder.curr.id.client ); if (currWrite !== null) { let curr = ( /** @type {Item | GC | null} */ currDecoder.curr ); let iterated = false; while (curr !== null && curr.id.clock + curr.length <= currWrite.struct.id.clock + currWrite.struct.length && curr.id.client >= currWrite.struct.id.client) { curr = currDecoder.next(); iterated = true; } if (curr === null || // current decoder is empty curr.id.client !== firstClient || // check whether there is another decoder that has has updates from `firstClient` iterated && curr.id.clock > currWrite.struct.id.clock + currWrite.struct.length) { continue; } if (firstClient !== currWrite.struct.id.client) { writeStructToLazyStructWriter(lazyStructEncoder, currWrite.struct, currWrite.offset); currWrite = { struct: curr, offset: 0 }; currDecoder.next(); } else { if (currWrite.struct.id.clock + currWrite.struct.length < curr.id.clock) { if (currWrite.struct.constructor === Skip) { currWrite.struct.length = curr.id.clock + curr.length - currWrite.struct.id.clock; } else { writeStructToLazyStructWriter(lazyStructEncoder, currWrite.struct, currWrite.offset); const diff = curr.id.clock - currWrite.struct.id.clock - currWrite.struct.length; const struct = new Skip(createID(firstClient, currWrite.struct.id.clock + currWrite.struct.length), diff); currWrite = { struct, offset: 0 }; } } else { const diff = currWrite.struct.id.clock + currWrite.struct.length - curr.id.clock; if (diff > 0) { if (currWrite.struct.constructor === Skip) { currWrite.struct.length -= diff; } else { curr = sliceStruct(curr, diff); } } if (!currWrite.struct.mergeWith( /** @type {any} */ curr )) { writeStructToLazyStructWriter(lazyStructEncoder, currWrite.struct, currWrite.offset); currWrite = { struct: curr, offset: 0 }; currDecoder.next(); } } } } else { currWrite = { struct: ( /** @type {Item | GC} */ currDecoder.curr ), offset: 0 }; currDecoder.next(); } for (let next = currDecoder.curr; next !== null && next.id.client === firstClient && next.id.clock === currWrite.struct.id.clock + currWrite.struct.length && next.constructor !== Skip; next = currDecoder.next()) { writeStructToLazyStructWriter(lazyStructEncoder, currWrite.struct, currWrite.offset); currWrite = { struct: next, offset: 0 }; } } if (currWrite !== null) { writeStructToLazyStructWriter(lazyStructEncoder, currWrite.struct, currWrite.offset); currWrite = null; } finishLazyStructWriting(lazyStructEncoder); const dss = updateDecoders.map((decoder) => readDeleteSet(decoder)); const ds = mergeDeleteSets(dss); writeDeleteSet(updateEncoder, ds); return updateEncoder.toUint8Array(); }; var diffUpdateV2 = (update, sv, YDecoder = UpdateDecoderV2, YEncoder = UpdateEncoderV2) => { const state = decodeStateVector(sv); const encoder = new YEncoder(); const lazyStructWriter = new LazyStructWriter(encoder); const decoder = new YDecoder(createDecoder(update)); const reader = new LazyStructReader(decoder, false); while (reader.curr) { const curr = reader.curr; const currClient = curr.id.client; const svClock = state.get(currClient) || 0; if (reader.curr.constructor === Skip) { reader.next(); continue; } if (curr.id.clock + curr.length > svClock) { writeStructToLazyStructWriter(lazyStructWriter, curr, max(svClock - curr.id.clock, 0)); reader.next(); while (reader.curr && reader.curr.id.client === currClient) { writeStructToLazyStructWriter(lazyStructWriter, reader.curr, 0); reader.next(); } } else { while (reader.curr && reader.curr.id.client === currClient && reader.curr.id.clock + reader.curr.length <= svClock) { reader.next(); } } } finishLazyStructWriting(lazyStructWriter); const ds = readDeleteSet(decoder); writeDeleteSet(encoder, ds); return encoder.toUint8Array(); }; var diffUpdate = (update, sv) => diffUpdateV2(update, sv, UpdateDecoderV1, UpdateEncoderV1); var flushLazyStructWriter = (lazyWriter) => { if (lazyWriter.written > 0) { lazyWriter.clientStructs.push({ written: lazyWriter.written, restEncoder: toUint8Array(lazyWriter.encoder.restEncoder) }); lazyWriter.encoder.restEncoder = createEncoder(); lazyWriter.written = 0; } }; var writeStructToLazyStructWriter = (lazyWriter, struct, offset) => { if (lazyWriter.written > 0 && lazyWriter.currClient !== struct.id.client) { flushLazyStructWriter(lazyWriter); } if (lazyWriter.written === 0) { lazyWriter.currClient = struct.id.client; lazyWriter.encoder.writeClient(struct.id.client); writeVarUint(lazyWriter.encoder.restEncoder, struct.id.clock + offset); } struct.write(lazyWriter.encoder, offset); lazyWriter.written++; }; var finishLazyStructWriting = (lazyWriter) => { flushLazyStructWriter(lazyWriter); const restEncoder = lazyWriter.encoder.restEncoder; writeVarUint(restEncoder, lazyWriter.clientStructs.length); for (let i = 0; i < lazyWriter.clientStructs.length; i++) { const partStructs = lazyWriter.clientStructs[i]; writeVarUint(restEncoder, partStructs.written); writeUint8Array(restEncoder, partStructs.restEncoder); } }; var convertUpdateFormat = (update, blockTransformer, YDecoder, YEncoder) => { const updateDecoder = new YDecoder(createDecoder(update)); const lazyDecoder = new LazyStructReader(updateDecoder, false); const updateEncoder = new YEncoder(); const lazyWriter = new LazyStructWriter(updateEncoder); for (let curr = lazyDecoder.curr; curr !== null; curr = lazyDecoder.next()) { writeStructToLazyStructWriter(lazyWriter, blockTransformer(curr), 0); } finishLazyStructWriting(lazyWriter); const ds = readDeleteSet(updateDecoder); writeDeleteSet(updateEncoder, ds); return updateEncoder.toUint8Array(); }; var createObfuscator = ({ formatting = true, subdocs = true, yxml = true } = {}) => { let i = 0; const mapKeyCache = create(); const nodeNameCache = create(); const formattingKeyCache = create(); const formattingValueCache = create(); formattingValueCache.set(null, null); return (block) => { switch (block.constructor) { case GC: case Skip: return block; case Item: { const item = ( /** @type {Item} */ block ); const content = item.content; switch (content.constructor) { case ContentDeleted: break; case ContentType: { if (yxml) { const type = ( /** @type {ContentType} */ content.type ); if (type instanceof YXmlElement) { type.nodeName = setIfUndefined(nodeNameCache, type.nodeName, () => "node-" + i); } if (type instanceof YXmlHook) { type.hookName = setIfUndefined(nodeNameCache, type.hookName, () => "hook-" + i); } } break; } case ContentAny: { const c = ( /** @type {ContentAny} */ content ); c.arr = c.arr.map(() => i); break; } case ContentBinary: { const c = ( /** @type {ContentBinary} */ content ); c.content = new Uint8Array([i]); break; } case ContentDoc: { const c = ( /** @type {ContentDoc} */ content ); if (subdocs) { c.opts = {}; c.doc.guid = i + ""; } break; } case ContentEmbed: { const c = ( /** @type {ContentEmbed} */ content ); c.embed = {}; break; } case ContentFormat: { const c = ( /** @type {ContentFormat} */ content ); if (formatting) { c.key = setIfUndefined(formattingKeyCache, c.key, () => i + ""); c.value = setIfUndefined(formattingValueCache, c.value, () => ({ i })); } break; } case ContentJSON: { const c = ( /** @type {ContentJSON} */ content ); c.arr = c.arr.map(() => i); break; } case ContentString: { const c = ( /** @type {ContentString} */ content ); c.str = repeat(i % 10 + "", c.str.length); break; } default: unexpectedCase(); } if (item.parentSub) { item.parentSub = setIfUndefined(mapKeyCache, item.parentSub, () => i + ""); } i++; return block; } default: unexpectedCase(); } }; }; var obfuscateUpdate = (update, opts) => convertUpdateFormat(update, createObfuscator(opts), UpdateDecoderV1, UpdateEncoderV1); var obfuscateUpdateV2 = (update, opts) => convertUpdateFormat(update, createObfuscator(opts), UpdateDecoderV2, UpdateEncoderV2); var convertUpdateFormatV1ToV2 = (update) => convertUpdateFormat(update, id, UpdateDecoderV1, UpdateEncoderV2); var convertUpdateFormatV2ToV1 = (update) => convertUpdateFormat(update, id, UpdateDecoderV2, UpdateEncoderV1); var errorComputeChanges = "You must not compute changes after the event-handler fired."; var YEvent = class { /** * @param {T} target The changed type. * @param {Transaction} transaction */ constructor(target, transaction) { this.target = target; this.currentTarget = target; this.transaction = transaction; this._changes = null; this._keys = null; this._delta = null; this._path = null; } /** * Computes the path from `y` to the changed type. * * @todo v14 should standardize on path: Array<{parent, index}> because that is easier to work with. * * The following property holds: * @example * let type = y * event.path.forEach(dir => { * type = type.get(dir) * }) * type === event.target // => true */ get path() { return this._path || (this._path = getPathTo(this.currentTarget, this.target)); } /** * Check if a struct is deleted by this event. * * In contrast to change.deleted, this method also returns true if the struct was added and then deleted. * * @param {AbstractStruct} struct * @return {boolean} */ deletes(struct) { return isDeleted(this.transaction.deleteSet, struct.id); } /** * @type {Map<string, { action: 'add' | 'update' | 'delete', oldValue: any }>} */ get keys() { if (this._keys === null) { if (this.transaction.doc._transactionCleanups.length === 0) { throw create3(errorComputeChanges); } const keys2 = /* @__PURE__ */ new Map(); const target = this.target; const changed = ( /** @type Set<string|null> */ this.transaction.changed.get(target) ); changed.forEach((key) => { if (key !== null) { const item = ( /** @type {Item} */ target._map.get(key) ); let action; let oldValue; if (this.adds(item)) { let prev = item.left; while (prev !== null && this.adds(prev)) { prev = prev.left; } if (this.deletes(item)) { if (prev !== null && this.deletes(prev)) { action = "delete"; oldValue = last(prev.content.getContent()); } else { return; } } else { if (prev !== null && this.deletes(prev)) { action = "update"; oldValue = last(prev.content.getContent()); } else { action = "add"; oldValue = void 0; } } } else { if (this.deletes(item)) { action = "delete"; oldValue = last( /** @type {Item} */ item.content.getContent() ); } else { return; } } keys2.set(key, { action, oldValue }); } }); this._keys = keys2; } return this._keys; } /** * This is a computed property. Note that this can only be safely computed during the * event call. Computing this property after other changes happened might result in * unexpected behavior (incorrect computation of deltas). A safe way to collect changes * is to store the `changes` or the `delta` object. Avoid storing the `transaction` object. * * @type {Array<{insert?: string | Array<any> | object | AbstractType<any>, retain?: number, delete?: number, attributes?: Object<string, any>}>} */ get delta() { return this.changes.delta; } /** * Check if a struct is added by this event. * * In contrast to change.deleted, this method also returns true if the struct was added and then deleted. * * @param {AbstractStruct} struct * @return {boolean} */ adds(struct) { return struct.id.clock >= (this.transaction.beforeState.get(struct.id.client) || 0); } /** * This is a computed property. Note that this can only be safely computed during the * event call. Computing this property after other changes happened might result in * unexpected behavior (incorrect computation of deltas). A safe way to collect changes * is to store the `changes` or the `delta` object. Avoid storing the `transaction` object. * * @type {{added:Set<Item>,deleted:Set<Item>,keys:Map<string,{action:'add'|'update'|'delete',oldValue:any}>,delta:Array<{insert?:Array<any>|string, delete?:number, retain?:number}>}} */ get changes() { let changes = this._changes; if (changes === null) { if (this.transaction.doc._transactionCleanups.length === 0) { throw create3(errorComputeChanges); } const target = this.target; const added = create2(); const deleted = create2(); const delta = []; changes = { added, deleted, delta, keys: this.keys }; const changed = ( /** @type Set<string|null> */ this.transaction.changed.get(target) ); if (changed.has(null)) { let lastOp = null; const packOp = () => { if (lastOp) { delta.push(lastOp); } }; for (let item = target._start; item !== null; item = item.right) { if (item.deleted) { if (this.deletes(item) && !this.adds(item)) { if (lastOp === null || lastOp.delete === void 0) { packOp(); lastOp = { delete: 0 }; } lastOp.delete += item.length; deleted.add(item); } } else { if (this.adds(item)) { if (lastOp === null || lastOp.insert === void 0) { packOp(); lastOp = { insert: [] }; } lastOp.insert = lastOp.insert.concat(item.content.getContent()); added.add(item); } else { if (lastOp === null || lastOp.retain === void 0) { packOp(); lastOp = { retain: 0 }; } lastOp.retain += item.length; } } } if (lastOp !== null && lastOp.retain === void 0) { packOp(); } } this._changes = changes; } return ( /** @type {any} */ changes ); } }; var getPathTo = (parent, child) => { const path = []; while (child._item !== null && child !== parent) { if (child._item.parentSub !== null) { path.unshift(child._item.parentSub); } else { let i = 0; let c = ( /** @type {AbstractType<any>} */ child._item.parent._start ); while (c !== child._item && c !== null) { if (!c.deleted && c.countable) { i += c.length; } c = c.right; } path.unshift(i); } child = /** @type {AbstractType<any>} */ child._item.parent; } return path; }; var warnPrematureAccess = () => { warn("Invalid access: Add Yjs type to a document before reading data."); }; var maxSearchMarker = 80; var globalSearchMarkerTimestamp = 0; var ArraySearchMarker = class { /** * @param {Item} p * @param {number} index */ constructor(p, index) { p.marker = true; this.p = p; this.index = index; this.timestamp = globalSearchMarkerTimestamp++; } }; var refreshMarkerTimestamp = (marker) => { marker.timestamp = globalSearchMarkerTimestamp++; }; var overwriteMarker = (marker, p, index) => { marker.p.marker = false; marker.p = p; p.marker = true; marker.index = index; marker.timestamp = globalSearchMarkerTimestamp++; }; var markPosition = (searchMarker, p, index) => { if (searchMarker.length >= maxSearchMarker) { const marker = searchMarker.reduce((a, b) => a.timestamp < b.timestamp ? a : b); overwriteMarker(marker, p, index); return marker; } else { const pm = new ArraySearchMarker(p, index); searchMarker.push(pm); return pm; } }; var findMarker = (yarray, index) => { if (yarray._start === null || index === 0 || yarray._searchMarker === null) { return null; } const marker = yarray._searchMarker.length === 0 ? null : yarray._searchMarker.reduce((a, b) => abs(index - a.index) < abs(index - b.index) ? a : b); let p = yarray._start; let pindex = 0; if (marker !== null) { p = marker.p; pindex = marker.index; refreshMarkerTimestamp(marker); } while (p.right !== null && pindex < index) { if (!p.deleted && p.countable) { if (index < pindex + p.length) { break; } pindex += p.length; } p = p.right; } while (p.left !== null && pindex > index) { p = p.left; if (!p.deleted && p.countable) { pindex -= p.length; } } while (p.left !== null && p.left.id.client === p.id.client && p.left.id.clock + p.left.length === p.id.clock) { p = p.left; if (!p.deleted && p.countable) { pindex -= p.length; } } if (marker !== null && abs(marker.index - pindex) < /** @type {YText|YArray<any>} */ p.parent.length / maxSearchMarker) { overwriteMarker(marker, p, pindex); return marker; } else { return markPosition(yarray._searchMarker, p, pindex); } }; var updateMarkerChanges = (searchMarker, index, len) => { for (let i = searchMarker.length - 1; i >= 0; i--) { const m = searchMarker[i]; if (len > 0) { let p = m.p; p.marker = false; while (p && (p.deleted || !p.countable)) { p = p.left; if (p && !p.deleted && p.countable) { m.index -= p.length; } } if (p === null || p.marker === true) { searchMarker.splice(i, 1); continue; } m.p = p; p.marker = true; } if (index < m.index || len > 0 && index === m.index) { m.index = max(index, m.index + len); } } }; var getTypeChildren = (t) => { t.doc ?? warnPrematureAccess(); let s = t._start; const arr = []; while (s) { arr.push(s); s = s.right; } return arr; }; var callTypeObservers = (type, transaction, event) => { const changedType = type; const changedParentTypes = transaction.changedParentTypes; while (true) { setIfUndefined(changedParentTypes, type, () => []).push(event); if (type._item === null) { break; } type = /** @type {AbstractType<any>} */ type._item.parent; } callEventHandlerListeners(changedType._eH, event, transaction); }; var AbstractType = class { constructor() { this._item = null; this._map = /* @__PURE__ */ new Map(); this._start = null; this.doc = null; this._length = 0; this._eH = createEventHandler(); this._dEH = createEventHandler(); this._searchMarker = null; } /** * @return {AbstractType<any>|null} */ get parent() { return this._item ? ( /** @type {AbstractType<any>} */ this._item.parent ) : null; } /** * Integrate this type into the Yjs instance. * * * Save this struct in the os * * This type is sent to other client * * Observer functions are fired * * @param {Doc} y The Yjs instance * @param {Item|null} item */ _integrate(y, item) { this.doc = y; this._item = item; } /** * @return {AbstractType<EventType>} */ _copy() { throw methodUnimplemented(); } /** * Makes a copy of this data type that can be included somewhere else. * * Note that the content is only readable _after_ it has been included somewhere in the Ydoc. * * @return {AbstractType<EventType>} */ clone() { throw methodUnimplemented(); } /** * @param {UpdateEncoderV1 | UpdateEncoderV2} _encoder */ _write(_encoder) { } /** * The first non-deleted item */ get _first() { let n = this._start; while (n !== null && n.deleted) { n = n.right; } return n; } /** * Creates YEvent and calls all type observers. * Must be implemented by each type. * * @param {Transaction} transaction * @param {Set<null|string>} _parentSubs Keys changed on this type. `null` if list was modified. */ _callObserver(transaction, _parentSubs) { if (!transaction.local && this._searchMarker) { this._searchMarker.length = 0; } } /** * Observe all events that are created on this type. * * @param {function(EventType, Transaction):void} f Observer function */ observe(f) { addEventHandlerListener(this._eH, f); } /** * Observe all events that are created by this type and its children. * * @param {function(Array<YEvent<any>>,Transaction):void} f Observer function */ observeDeep(f) { addEventHandlerListener(this._dEH, f); } /** * Unregister an observer function. * * @param {function(EventType,Transaction):void} f Observer function */ unobserve(f) { removeEventHandlerListener(this._eH, f); } /** * Unregister an observer function. * * @param {function(Array<YEvent<any>>,Transaction):void} f Observer function */ unobserveDeep(f) { removeEventHandlerListener(this._dEH, f); } /** * @abstract * @return {any} */ toJSON() { } }; var typeListSlice = (type, start, end) => { type.doc ?? warnPrematureAccess(); if (start < 0) { start = type._length + start; } if (end < 0) { end = type._length + end; } let len = end - start; const cs = []; let n = type._start; while (n !== null && len > 0) { if (n.countable && !n.deleted) { const c = n.content.getContent(); if (c.length <= start) { start -= c.length; } else { for (let i = start; i < c.length && len > 0; i++) { cs.push(c[i]); len--; } start = 0; } } n = n.right; } return cs; }; var typeListToArray = (type) => { type.doc ?? warnPrematureAccess(); const cs = []; let n = type._start; while (n !== null) { if (n.countable && !n.deleted) { const c = n.content.getContent(); for (let i = 0; i < c.length; i++) { cs.push(c[i]); } } n = n.right; } return cs; }; var typeListToArraySnapshot = (type, snapshot2) => { const cs = []; let n = type._start; while (n !== null) { if (n.countable && isVisible(n, snapshot2)) { const c = n.content.getContent(); for (let i = 0; i < c.length; i++) { cs.push(c[i]); } } n = n.right; } return cs; }; var typeListForEach = (type, f) => { let index = 0; let n = type._start; type.doc ?? warnPrematureAccess(); while (n !== null) { if (n.countable && !n.deleted) { const c = n.content.getContent(); for (let i = 0; i < c.length; i++) { f(c[i], index++, type); } } n = n.right; } }; var typeListMap = (type, f) => { const result = []; typeListForEach(type, (c, i) => { result.push(f(c, i, type)); }); return result; }; var typeListCreateIterator = (type) => { let n = type._start; let currentContent = null; let currentContentIndex = 0; return { [Symbol.iterator]() { return this; }, next: () => { if (currentContent === null) { while (n !== null && n.deleted) { n = n.right; } if (n === null) { return { done: true, value: void 0 }; } currentContent = n.content.getContent(); currentContentIndex = 0; n = n.right; } const value = currentContent[currentContentIndex++]; if (currentContent.length <= currentContentIndex) { currentContent = null; } return { done: false, value }; } }; }; var typeListGet = (type, index) => { type.doc ?? warnPrematureAccess(); const marker = findMarker(type, index); let n = type._start; if (marker !== null) { n = marker.p; index -= marker.index; } for (; n !== null; n = n.right) { if (!n.deleted && n.countable) { if (index < n.length) { return n.content.getContent()[index]; } index -= n.length; } } }; var typeListInsertGenericsAfter = (transaction, parent, referenceItem, content) => { let left = referenceItem; const doc2 = transaction.doc; const ownClientId = doc2.clientID; const store2 = doc2.store; const right = referenceItem === null ? parent._start : referenceItem.right; let jsonContent = []; const packJsonContent = () => { if (jsonContent.length > 0) { left = new Item(createID(ownClientId, getState(store2, ownClientId)), left, left && left.lastId, right, right && right.id, parent, null, new ContentAny(jsonContent)); left.integrate(transaction, 0); jsonContent = []; } }; content.forEach((c) => { if (c === null) { jsonContent.push(c); } else { switch (c.constructor) { case Number: case Object: case Boolean: case Array: case String: jsonContent.push(c); break; default: packJsonContent(); switch (c.constructor) { case Uint8Array: case ArrayBuffer: left = new Item(createID(ownClientId, getState(store2, ownClientId)), left, left && left.lastId, right, right && right.id, parent, null, new ContentBinary(new Uint8Array( /** @type {Uint8Array} */ c ))); left.integrate(transaction, 0); break; case Doc: left = new Item(createID(ownClientId, getState(store2, ownClientId)), left, left && left.lastId, right, right && right.id, parent, null, new ContentDoc( /** @type {Doc} */ c )); left.integrate(transaction, 0); break; default: if (c instanceof AbstractType) { left = new Item(createID(ownClientId, getState(store2, ownClientId)), left, left && left.lastId, right, right && right.id, parent, null, new ContentType(c)); left.integrate(transaction, 0); } else { throw new Error("Unexpected content type in insert operation"); } } } } }); packJsonContent(); }; var lengthExceeded = () => create3("Length exceeded!"); var typeListInsertGenerics = (transaction, parent, index, content) => { if (index > parent._length) { throw lengthExceeded(); } if (index === 0) { if (parent._searchMarker) { updateMarkerChanges(parent._searchMarker, index, content.length); } return typeListInsertGenericsAfter(transaction, parent, null, content); } const startIndex = index; const marker = findMarker(parent, index); let n = parent._start; if (marker !== null) { n = marker.p; index -= marker.index; if (index === 0) { n = n.prev; index += n && n.countable && !n.deleted ? n.length : 0; } } for (; n !== null; n = n.right) { if (!n.deleted && n.countable) { if (index <= n.length) { if (index < n.length) { getItemCleanStart(transaction, createID(n.id.client, n.id.clock + index)); } break; } index -= n.length; } } if (parent._searchMarker) { updateMarkerChanges(parent._searchMarker, startIndex, content.length); } return typeListInsertGenericsAfter(transaction, parent, n, content); }; var typeListPushGenerics = (transaction, parent, content) => { const marker = (parent._searchMarker || []).reduce((maxMarker, currMarker) => currMarker.index > maxMarker.index ? currMarker : maxMarker, { index: 0, p: parent._start }); let n = marker.p; if (n) { while (n.right) { n = n.right; } } return typeListInsertGenericsAfter(transaction, parent, n, content); }; var typeListDelete = (transaction, parent, index, length3) => { if (length3 === 0) { return; } const startIndex = index; const startLength = length3; const marker = findMarker(parent, index); let n = parent._start; if (marker !== null) { n = marker.p; index -= marker.index; } for (; n !== null && index > 0; n = n.right) { if (!n.deleted && n.countable) { if (index < n.length) { getItemCleanStart(transaction, createID(n.id.client, n.id.clock + index)); } index -= n.length; } } while (length3 > 0 && n !== null) { if (!n.deleted) { if (length3 < n.length) { getItemCleanStart(transaction, createID(n.id.client, n.id.clock + length3)); } n.delete(transaction); length3 -= n.length; } n = n.right; } if (length3 > 0) { throw lengthExceeded(); } if (parent._searchMarker) { updateMarkerChanges( parent._searchMarker, startIndex, -startLength + length3 /* in case we remove the above exception */ ); } }; var typeMapDelete = (transaction, parent, key) => { const c = parent._map.get(key); if (c !== void 0) { c.delete(transaction); } }; var typeMapSet = (transaction, parent, key, value) => { const left = parent._map.get(key) || null; const doc2 = transaction.doc; const ownClientId = doc2.clientID; let content; if (value == null) { content = new ContentAny([value]); } else { switch (value.constructor) { case Number: case Object: case Boolean: case Array: case String: case Date: case BigInt: content = new ContentAny([value]); break; case Uint8Array: content = new ContentBinary( /** @type {Uint8Array} */ value ); break; case Doc: content = new ContentDoc( /** @type {Doc} */ value ); break; default: if (value instanceof AbstractType) { content = new ContentType(value); } else { throw new Error("Unexpected content type"); } } } new Item(createID(ownClientId, getState(doc2.store, ownClientId)), left, left && left.lastId, null, null, parent, key, content).integrate(transaction, 0); }; var typeMapGet = (parent, key) => { parent.doc ?? warnPrematureAccess(); const val = parent._map.get(key); return val !== void 0 && !val.deleted ? val.content.getContent()[val.length - 1] : void 0; }; var typeMapGetAll = (parent) => { const res = {}; parent.doc ?? warnPrematureAccess(); parent._map.forEach((value, key) => { if (!value.deleted) { res[key] = value.content.getContent()[value.length - 1]; } }); return res; }; var typeMapHas = (parent, key) => { parent.doc ?? warnPrematureAccess(); const val = parent._map.get(key); return val !== void 0 && !val.deleted; }; var typeMapGetSnapshot = (parent, key, snapshot2) => { let v = parent._map.get(key) || null; while (v !== null && (!snapshot2.sv.has(v.id.client) || v.id.clock >= (snapshot2.sv.get(v.id.client) || 0))) { v = v.left; } return v !== null && isVisible(v, snapshot2) ? v.content.getContent()[v.length - 1] : void 0; }; var typeMapGetAllSnapshot = (parent, snapshot2) => { const res = {}; parent._map.forEach((value, key) => { let v = value; while (v !== null && (!snapshot2.sv.has(v.id.client) || v.id.clock >= (snapshot2.sv.get(v.id.client) || 0))) { v = v.left; } if (v !== null && isVisible(v, snapshot2)) { res[key] = v.content.getContent()[v.length - 1]; } }); return res; }; var createMapIterator = (type) => { type.doc ?? warnPrematureAccess(); return iteratorFilter( type._map.entries(), /** @param {any} entry */ (entry) => !entry[1].deleted ); }; var YArrayEvent = class extends YEvent { }; var YArray = class _YArray extends AbstractType { constructor() { super(); this._prelimContent = []; this._searchMarker = []; } /** * Construct a new YArray containing the specified items. * @template {Object<string,any>|Array<any>|number|null|string|Uint8Array} T * @param {Array<T>} items * @return {YArray<T>} */ static from(items2) { const a = new _YArray(); a.push(items2); return a; } /** * Integrate this type into the Yjs instance. * * * Save this struct in the os * * This type is sent to other client * * Observer functions are fired * * @param {Doc} y The Yjs instance * @param {Item} item */ _integrate(y, item) { super._integrate(y, item); this.insert( 0, /** @type {Array<any>} */ this._prelimContent ); this._prelimContent = null; } /** * @return {YArray<T>} */ _copy() { return new _YArray(); } /** * Makes a copy of this data type that can be included somewhere else. * * Note that the content is only readable _after_ it has been included somewhere in the Ydoc. * * @return {YArray<T>} */ clone() { const arr = new _YArray(); arr.insert(0, this.toArray().map( (el) => el instanceof AbstractType ? ( /** @type {typeof el} */ el.clone() ) : el )); return arr; } get length() { this.doc ?? warnPrematureAccess(); return this._length; } /** * Creates YArrayEvent and calls observers. * * @param {Transaction} transaction * @param {Set<null|string>} parentSubs Keys changed on this type. `null` if list was modified. */ _callObserver(transaction, parentSubs) { super._callObserver(transaction, parentSubs); callTypeObservers(this, transaction, new YArrayEvent(this, transaction)); } /** * Inserts new content at an index. * * Important: This function expects an array of content. Not just a content * object. The reason for this "weirdness" is that inserting several elements * is very efficient when it is done as a single operation. * * @example * // Insert character 'a' at position 0 * yarray.insert(0, ['a']) * // Insert numbers 1, 2 at position 1 * yarray.insert(1, [1, 2]) * * @param {number} index The index to insert content at. * @param {Array<T>} content The array of content */ insert(index, content) { if (this.doc !== null) { transact(this.doc, (transaction) => { typeListInsertGenerics( transaction, this, index, /** @type {any} */ content ); }); } else { this._prelimContent.splice(index, 0, ...content); } } /** * Appends content to this YArray. * * @param {Array<T>} content Array of content to append. * * @todo Use the following implementation in all types. */ push(content) { if (this.doc !== null) { transact(this.doc, (transaction) => { typeListPushGenerics( transaction, this, /** @type {any} */ content ); }); } else { this._prelimContent.push(...content); } } /** * Prepends content to this YArray. * * @param {Array<T>} content Array of content to prepend. */ unshift(content) { this.insert(0, content); } /** * Deletes elements starting from an index. * * @param {number} index Index at which to start deleting elements * @param {number} length The number of elements to remove. Defaults to 1. */ delete(index, length3 = 1) { if (this.doc !== null) { transact(this.doc, (transaction) => { typeListDelete(transaction, this, index, length3); }); } else { this._prelimContent.splice(index, length3); } } /** * Returns the i-th element from a YArray. * * @param {number} index The index of the element to return from the YArray * @return {T} */ get(index) { return typeListGet(this, index); } /** * Transforms this YArray to a JavaScript Array. * * @return {Array<T>} */ toArray() { return typeListToArray(this); } /** * Returns a portion of this YArray into a JavaScript Array selected * from start to end (end not included). * * @param {number} [start] * @param {number} [end] * @return {Array<T>} */ slice(start = 0, end = this.length) { return typeListSlice(this, start, end); } /** * Transforms this Shared Type to a JSON object. * * @return {Array<any>} */ toJSON() { return this.map((c) => c instanceof AbstractType ? c.toJSON() : c); } /** * Returns an Array with the result of calling a provided function on every * element of this YArray. * * @template M * @param {function(T,number,YArray<T>):M} f Function that produces an element of the new Array * @return {Array<M>} A new array with each element being the result of the * callback function */ map(f) { return typeListMap( this, /** @type {any} */ f ); } /** * Executes a provided function once on every element of this YArray. * * @param {function(T,number,YArray<T>):void} f A function to execute on every element of this YArray. */ forEach(f) { typeListForEach(this, f); } /** * @return {IterableIterator<T>} */ [Symbol.iterator]() { return typeListCreateIterator(this); } /** * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder */ _write(encoder) { encoder.writeTypeRef(YArrayRefID); } }; var readYArray = (_decoder) => new YArray(); var YMapEvent = class extends YEvent { /** * @param {YMap<T>} ymap The YArray that changed. * @param {Transaction} transaction * @param {Set<any>} subs The keys that changed. */ constructor(ymap, transaction, subs) { super(ymap, transaction); this.keysChanged = subs; } }; var YMap = class _YMap extends AbstractType { /** * * @param {Iterable<readonly [string, any]>=} entries - an optional iterable to initialize the YMap */ constructor(entries) { super(); this._prelimContent = null; if (entries === void 0) { this._prelimContent = /* @__PURE__ */ new Map(); } else { this._prelimContent = new Map(entries); } } /** * Integrate this type into the Yjs instance. * * * Save this struct in the os * * This type is sent to other client * * Observer functions are fired * * @param {Doc} y The Yjs instance * @param {Item} item */ _integrate(y, item) { super._integrate(y, item); this._prelimContent.forEach((value, key) => { this.set(key, value); }); this._prelimContent = null; } /** * @return {YMap<MapType>} */ _copy() { return new _YMap(); } /** * Makes a copy of this data type that can be included somewhere else. * * Note that the content is only readable _after_ it has been included somewhere in the Ydoc. * * @return {YMap<MapType>} */ clone() { const map2 = new _YMap(); this.forEach((value, key) => { map2.set(key, value instanceof AbstractType ? ( /** @type {typeof value} */ value.clone() ) : value); }); return map2; } /** * Creates YMapEvent and calls observers. * * @param {Transaction} transaction * @param {Set<null|string>} parentSubs Keys changed on this type. `null` if list was modified. */ _callObserver(transaction, parentSubs) { callTypeObservers(this, transaction, new YMapEvent(this, transaction, parentSubs)); } /** * Transforms this Shared Type to a JSON object. * * @return {Object<string,any>} */ toJSON() { this.doc ?? warnPrematureAccess(); const map2 = {}; this._map.forEach((item, key) => { if (!item.deleted) { const v = item.content.getContent()[item.length - 1]; map2[key] = v instanceof AbstractType ? v.toJSON() : v; } }); return map2; } /** * Returns the size of the YMap (count of key/value pairs) * * @return {number} */ get size() { return [...createMapIterator(this)].length; } /** * Returns the keys for each element in the YMap Type. * * @return {IterableIterator<string>} */ keys() { return iteratorMap( createMapIterator(this), /** @param {any} v */ (v) => v[0] ); } /** * Returns the values for each element in the YMap Type. * * @return {IterableIterator<MapType>} */ values() { return iteratorMap( createMapIterator(this), /** @param {any} v */ (v) => v[1].content.getContent()[v[1].length - 1] ); } /** * Returns an Iterator of [key, value] pairs * * @return {IterableIterator<[string, MapType]>} */ entries() { return iteratorMap( createMapIterator(this), /** @param {any} v */ (v) => ( /** @type {any} */ [v[0], v[1].content.getContent()[v[1].length - 1]] ) ); } /** * Executes a provided function on once on every key-value pair. * * @param {function(MapType,string,YMap<MapType>):void} f A function to execute on every element of this YArray. */ forEach(f) { this.doc ?? warnPrematureAccess(); this._map.forEach((item, key) => { if (!item.deleted) { f(item.content.getContent()[item.length - 1], key, this); } }); } /** * Returns an Iterator of [key, value] pairs * * @return {IterableIterator<[string, MapType]>} */ [Symbol.iterator]() { return this.entries(); } /** * Remove a specified element from this YMap. * * @param {string} key The key of the element to remove. */ delete(key) { if (this.doc !== null) { transact(this.doc, (transaction) => { typeMapDelete(transaction, this, key); }); } else { this._prelimContent.delete(key); } } /** * Adds or updates an element with a specified key and value. * @template {MapType} VAL * * @param {string} key The key of the element to add to this YMap * @param {VAL} value The value of the element to add * @return {VAL} */ set(key, value) { if (this.doc !== null) { transact(this.doc, (transaction) => { typeMapSet( transaction, this, key, /** @type {any} */ value ); }); } else { this._prelimContent.set(key, value); } return value; } /** * Returns a specified element from this YMap. * * @param {string} key * @return {MapType|undefined} */ get(key) { return ( /** @type {any} */ typeMapGet(this, key) ); } /** * Returns a boolean indicating whether the specified key exists or not. * * @param {string} key The key to test. * @return {boolean} */ has(key) { return typeMapHas(this, key); } /** * Removes all elements from this YMap. */ clear() { if (this.doc !== null) { transact(this.doc, (transaction) => { this.forEach(function(_value, key, map2) { typeMapDelete(transaction, map2, key); }); }); } else { this._prelimContent.clear(); } } /** * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder */ _write(encoder) { encoder.writeTypeRef(YMapRefID); } }; var readYMap = (_decoder) => new YMap(); var equalAttrs = (a, b) => a === b || typeof a === "object" && typeof b === "object" && a && b && equalFlat(a, b); var ItemTextListPosition = class { /** * @param {Item|null} left * @param {Item|null} right * @param {number} index * @param {Map<string,any>} currentAttributes */ constructor(left, right, index, currentAttributes) { this.left = left; this.right = right; this.index = index; this.currentAttributes = currentAttributes; } /** * Only call this if you know that this.right is defined */ forward() { if (this.right === null) { unexpectedCase(); } switch (this.right.content.constructor) { case ContentFormat: if (!this.right.deleted) { updateCurrentAttributes( this.currentAttributes, /** @type {ContentFormat} */ this.right.content ); } break; default: if (!this.right.deleted) { this.index += this.right.length; } break; } this.left = this.right; this.right = this.right.right; } }; var findNextPosition = (transaction, pos, count) => { while (pos.right !== null && count > 0) { switch (pos.right.content.constructor) { case ContentFormat: if (!pos.right.deleted) { updateCurrentAttributes( pos.currentAttributes, /** @type {ContentFormat} */ pos.right.content ); } break; default: if (!pos.right.deleted) { if (count < pos.right.length) { getItemCleanStart(transaction, createID(pos.right.id.client, pos.right.id.clock + count)); } pos.index += pos.right.length; count -= pos.right.length; } break; } pos.left = pos.right; pos.right = pos.right.right; } return pos; }; var findPosition = (transaction, parent, index, useSearchMarker) => { const currentAttributes = /* @__PURE__ */ new Map(); const marker = useSearchMarker ? findMarker(parent, index) : null; if (marker) { const pos = new ItemTextListPosition(marker.p.left, marker.p, marker.index, currentAttributes); return findNextPosition(transaction, pos, index - marker.index); } else { const pos = new ItemTextListPosition(null, parent._start, 0, currentAttributes); return findNextPosition(transaction, pos, index); } }; var insertNegatedAttributes = (transaction, parent, currPos, negatedAttributes) => { while (currPos.right !== null && (currPos.right.deleted === true || currPos.right.content.constructor === ContentFormat && equalAttrs( negatedAttributes.get( /** @type {ContentFormat} */ currPos.right.content.key ), /** @type {ContentFormat} */ currPos.right.content.value ))) { if (!currPos.right.deleted) { negatedAttributes.delete( /** @type {ContentFormat} */ currPos.right.content.key ); } currPos.forward(); } const doc2 = transaction.doc; const ownClientId = doc2.clientID; negatedAttributes.forEach((val, key) => { const left = currPos.left; const right = currPos.right; const nextFormat = new Item(createID(ownClientId, getState(doc2.store, ownClientId)), left, left && left.lastId, right, right && right.id, parent, null, new ContentFormat(key, val)); nextFormat.integrate(transaction, 0); currPos.right = nextFormat; currPos.forward(); }); }; var updateCurrentAttributes = (currentAttributes, format) => { const { key, value } = format; if (value === null) { currentAttributes.delete(key); } else { currentAttributes.set(key, value); } }; var minimizeAttributeChanges = (currPos, attributes) => { while (true) { if (currPos.right === null) { break; } else if (currPos.right.deleted || currPos.right.content.constructor === ContentFormat && equalAttrs( attributes[ /** @type {ContentFormat} */ currPos.right.content.key ] ?? null, /** @type {ContentFormat} */ currPos.right.content.value )) ; else { break; } currPos.forward(); } }; var insertAttributes = (transaction, parent, currPos, attributes) => { const doc2 = transaction.doc; const ownClientId = doc2.clientID; const negatedAttributes = /* @__PURE__ */ new Map(); for (const key in attributes) { const val = attributes[key]; const currentVal = currPos.currentAttributes.get(key) ?? null; if (!equalAttrs(currentVal, val)) { negatedAttributes.set(key, currentVal); const { left, right } = currPos; currPos.right = new Item(createID(ownClientId, getState(doc2.store, ownClientId)), left, left && left.lastId, right, right && right.id, parent, null, new ContentFormat(key, val)); currPos.right.integrate(transaction, 0); currPos.forward(); } } return negatedAttributes; }; var insertText = (transaction, parent, currPos, text2, attributes) => { currPos.currentAttributes.forEach((_val, key) => { if (attributes[key] === void 0) { attributes[key] = null; } }); const doc2 = transaction.doc; const ownClientId = doc2.clientID; minimizeAttributeChanges(currPos, attributes); const negatedAttributes = insertAttributes(transaction, parent, currPos, attributes); const content = text2.constructor === String ? new ContentString( /** @type {string} */ text2 ) : text2 instanceof AbstractType ? new ContentType(text2) : new ContentEmbed(text2); let { left, right, index } = currPos; if (parent._searchMarker) { updateMarkerChanges(parent._searchMarker, currPos.index, content.getLength()); } right = new Item(createID(ownClientId, getState(doc2.store, ownClientId)), left, left && left.lastId, right, right && right.id, parent, null, content); right.integrate(transaction, 0); currPos.right = right; currPos.index = index; currPos.forward(); insertNegatedAttributes(transaction, parent, currPos, negatedAttributes); }; var formatText = (transaction, parent, currPos, length3, attributes) => { const doc2 = transaction.doc; const ownClientId = doc2.clientID; minimizeAttributeChanges(currPos, attributes); const negatedAttributes = insertAttributes(transaction, parent, currPos, attributes); iterationLoop: while (currPos.right !== null && (length3 > 0 || negatedAttributes.size > 0 && (currPos.right.deleted || currPos.right.content.constructor === ContentFormat))) { if (!currPos.right.deleted) { switch (currPos.right.content.constructor) { case ContentFormat: { const { key, value } = ( /** @type {ContentFormat} */ currPos.right.content ); const attr = attributes[key]; if (attr !== void 0) { if (equalAttrs(attr, value)) { negatedAttributes.delete(key); } else { if (length3 === 0) { break iterationLoop; } negatedAttributes.set(key, value); } currPos.right.delete(transaction); } else { currPos.currentAttributes.set(key, value); } break; } default: if (length3 < currPos.right.length) { getItemCleanStart(transaction, createID(currPos.right.id.client, currPos.right.id.clock + length3)); } length3 -= currPos.right.length; break; } } currPos.forward(); } if (length3 > 0) { let newlines = ""; for (; length3 > 0; length3--) { newlines += "\n"; } currPos.right = new Item(createID(ownClientId, getState(doc2.store, ownClientId)), currPos.left, currPos.left && currPos.left.lastId, currPos.right, currPos.right && currPos.right.id, parent, null, new ContentString(newlines)); currPos.right.integrate(transaction, 0); currPos.forward(); } insertNegatedAttributes(transaction, parent, currPos, negatedAttributes); }; var cleanupFormattingGap = (transaction, start, curr, startAttributes, currAttributes) => { let end = start; const endFormats = create(); while (end && (!end.countable || end.deleted)) { if (!end.deleted && end.content.constructor === ContentFormat) { const cf = ( /** @type {ContentFormat} */ end.content ); endFormats.set(cf.key, cf); } end = end.right; } let cleanups = 0; let reachedCurr = false; while (start !== end) { if (curr === start) { reachedCurr = true; } if (!start.deleted) { const content = start.content; switch (content.constructor) { case ContentFormat: { const { key, value } = ( /** @type {ContentFormat} */ content ); const startAttrValue = startAttributes.get(key) ?? null; if (endFormats.get(key) !== content || startAttrValue === value) { start.delete(transaction); cleanups++; if (!reachedCurr && (currAttributes.get(key) ?? null) === value && startAttrValue !== value) { if (startAttrValue === null) { currAttributes.delete(key); } else { currAttributes.set(key, startAttrValue); } } } if (!reachedCurr && !start.deleted) { updateCurrentAttributes( currAttributes, /** @type {ContentFormat} */ content ); } break; } } } start = /** @type {Item} */ start.right; } return cleanups; }; var cleanupContextlessFormattingGap = (transaction, item) => { while (item && item.right && (item.right.deleted || !item.right.countable)) { item = item.right; } const attrs = /* @__PURE__ */ new Set(); while (item && (item.deleted || !item.countable)) { if (!item.deleted && item.content.constructor === ContentFormat) { const key = ( /** @type {ContentFormat} */ item.content.key ); if (attrs.has(key)) { item.delete(transaction); } else { attrs.add(key); } } item = item.left; } }; var cleanupYTextFormatting = (type) => { let res = 0; transact( /** @type {Doc} */ type.doc, (transaction) => { let start = ( /** @type {Item} */ type._start ); let end = type._start; let startAttributes = create(); const currentAttributes = copy(startAttributes); while (end) { if (end.deleted === false) { switch (end.content.constructor) { case ContentFormat: updateCurrentAttributes( currentAttributes, /** @type {ContentFormat} */ end.content ); break; default: res += cleanupFormattingGap(transaction, start, end, startAttributes, currentAttributes); startAttributes = copy(currentAttributes); start = end; break; } } end = end.right; } } ); return res; }; var cleanupYTextAfterTransaction = (transaction) => { const needFullCleanup = /* @__PURE__ */ new Set(); const doc2 = transaction.doc; for (const [client, afterClock] of transaction.afterState.entries()) { const clock = transaction.beforeState.get(client) || 0; if (afterClock === clock) { continue; } iterateStructs( transaction, /** @type {Array<Item|GC>} */ doc2.store.clients.get(client), clock, afterClock, (item) => { if (!item.deleted && /** @type {Item} */ item.content.constructor === ContentFormat && item.constructor !== GC) { needFullCleanup.add( /** @type {any} */ item.parent ); } } ); } transact(doc2, (t) => { iterateDeletedStructs(transaction, transaction.deleteSet, (item) => { if (item instanceof GC || !/** @type {YText} */ item.parent._hasFormatting || needFullCleanup.has( /** @type {YText} */ item.parent )) { return; } const parent = ( /** @type {YText} */ item.parent ); if (item.content.constructor === ContentFormat) { needFullCleanup.add(parent); } else { cleanupContextlessFormattingGap(t, item); } }); for (const yText of needFullCleanup) { cleanupYTextFormatting(yText); } }); }; var deleteText = (transaction, currPos, length3) => { const startLength = length3; const startAttrs = copy(currPos.currentAttributes); const start = currPos.right; while (length3 > 0 && currPos.right !== null) { if (currPos.right.deleted === false) { switch (currPos.right.content.constructor) { case ContentType: case ContentEmbed: case ContentString: if (length3 < currPos.right.length) { getItemCleanStart(transaction, createID(currPos.right.id.client, currPos.right.id.clock + length3)); } length3 -= currPos.right.length; currPos.right.delete(transaction); break; } } currPos.forward(); } if (start) { cleanupFormattingGap(transaction, start, currPos.right, startAttrs, currPos.currentAttributes); } const parent = ( /** @type {AbstractType<any>} */ /** @type {Item} */ (currPos.left || currPos.right).parent ); if (parent._searchMarker) { updateMarkerChanges(parent._searchMarker, currPos.index, -startLength + length3); } return currPos; }; var YTextEvent = class extends YEvent { /** * @param {YText} ytext * @param {Transaction} transaction * @param {Set<any>} subs The keys that changed */ constructor(ytext, transaction, subs) { super(ytext, transaction); this.childListChanged = false; this.keysChanged = /* @__PURE__ */ new Set(); subs.forEach((sub) => { if (sub === null) { this.childListChanged = true; } else { this.keysChanged.add(sub); } }); } /** * @type {{added:Set<Item>,deleted:Set<Item>,keys:Map<string,{action:'add'|'update'|'delete',oldValue:any}>,delta:Array<{insert?:Array<any>|string, delete?:number, retain?:number}>}} */ get changes() { if (this._changes === null) { const changes = { keys: this.keys, delta: this.delta, added: /* @__PURE__ */ new Set(), deleted: /* @__PURE__ */ new Set() }; this._changes = changes; } return ( /** @type {any} */ this._changes ); } /** * Compute the changes in the delta format. * A {@link https://quilljs.com/docs/delta/|Quill Delta}) that represents the changes on the document. * * @type {Array<{insert?:string|object|AbstractType<any>, delete?:number, retain?:number, attributes?: Object<string,any>}>} * * @public */ get delta() { if (this._delta === null) { const y = ( /** @type {Doc} */ this.target.doc ); const delta = []; transact(y, (transaction) => { const currentAttributes = /* @__PURE__ */ new Map(); const oldAttributes = /* @__PURE__ */ new Map(); let item = this.target._start; let action = null; const attributes = {}; let insert2 = ""; let retain = 0; let deleteLen = 0; const addOp = () => { if (action !== null) { let op = null; switch (action) { case "delete": if (deleteLen > 0) { op = { delete: deleteLen }; } deleteLen = 0; break; case "insert": if (typeof insert2 === "object" || insert2.length > 0) { op = { insert: insert2 }; if (currentAttributes.size > 0) { op.attributes = {}; currentAttributes.forEach((value, key) => { if (value !== null) { op.attributes[key] = value; } }); } } insert2 = ""; break; case "retain": if (retain > 0) { op = { retain }; if (!isEmpty(attributes)) { op.attributes = assign({}, attributes); } } retain = 0; break; } if (op) delta.push(op); action = null; } }; while (item !== null) { switch (item.content.constructor) { case ContentType: case ContentEmbed: if (this.adds(item)) { if (!this.deletes(item)) { addOp(); action = "insert"; insert2 = item.content.getContent()[0]; addOp(); } } else if (this.deletes(item)) { if (action !== "delete") { addOp(); action = "delete"; } deleteLen += 1; } else if (!item.deleted) { if (action !== "retain") { addOp(); action = "retain"; } retain += 1; } break; case ContentString: if (this.adds(item)) { if (!this.deletes(item)) { if (action !== "insert") { addOp(); action = "insert"; } insert2 += /** @type {ContentString} */ item.content.str; } } else if (this.deletes(item)) { if (action !== "delete") { addOp(); action = "delete"; } deleteLen += item.length; } else if (!item.deleted) { if (action !== "retain") { addOp(); action = "retain"; } retain += item.length; } break; case ContentFormat: { const { key, value } = ( /** @type {ContentFormat} */ item.content ); if (this.adds(item)) { if (!this.deletes(item)) { const curVal = currentAttributes.get(key) ?? null; if (!equalAttrs(curVal, value)) { if (action === "retain") { addOp(); } if (equalAttrs(value, oldAttributes.get(key) ?? null)) { delete attributes[key]; } else { attributes[key] = value; } } else if (value !== null) { item.delete(transaction); } } } else if (this.deletes(item)) { oldAttributes.set(key, value); const curVal = currentAttributes.get(key) ?? null; if (!equalAttrs(curVal, value)) { if (action === "retain") { addOp(); } attributes[key] = curVal; } } else if (!item.deleted) { oldAttributes.set(key, value); const attr = attributes[key]; if (attr !== void 0) { if (!equalAttrs(attr, value)) { if (action === "retain") { addOp(); } if (value === null) { delete attributes[key]; } else { attributes[key] = value; } } else if (attr !== null) { item.delete(transaction); } } } if (!item.deleted) { if (action === "insert") { addOp(); } updateCurrentAttributes( currentAttributes, /** @type {ContentFormat} */ item.content ); } break; } } item = item.right; } addOp(); while (delta.length > 0) { const lastOp = delta[delta.length - 1]; if (lastOp.retain !== void 0 && lastOp.attributes === void 0) { delta.pop(); } else { break; } } }); this._delta = delta; } return ( /** @type {any} */ this._delta ); } }; var YText = class _YText extends AbstractType { /** * @param {String} [string] The initial value of the YText. */ constructor(string) { super(); this._pending = string !== void 0 ? [() => this.insert(0, string)] : []; this._searchMarker = []; this._hasFormatting = false; } /** * Number of characters of this text type. * * @type {number} */ get length() { this.doc ?? warnPrematureAccess(); return this._length; } /** * @param {Doc} y * @param {Item} item */ _integrate(y, item) { super._integrate(y, item); try { this._pending.forEach((f) => f()); } catch (e) { console.error(e); } this._pending = null; } _copy() { return new _YText(); } /** * Makes a copy of this data type that can be included somewhere else. * * Note that the content is only readable _after_ it has been included somewhere in the Ydoc. * * @return {YText} */ clone() { const text2 = new _YText(); text2.applyDelta(this.toDelta()); return text2; } /** * Creates YTextEvent and calls observers. * * @param {Transaction} transaction * @param {Set<null|string>} parentSubs Keys changed on this type. `null` if list was modified. */ _callObserver(transaction, parentSubs) { super._callObserver(transaction, parentSubs); const event = new YTextEvent(this, transaction, parentSubs); callTypeObservers(this, transaction, event); if (!transaction.local && this._hasFormatting) { transaction._needFormattingCleanup = true; } } /** * Returns the unformatted string representation of this YText type. * * @public */ toString() { this.doc ?? warnPrematureAccess(); let str = ""; let n = this._start; while (n !== null) { if (!n.deleted && n.countable && n.content.constructor === ContentString) { str += /** @type {ContentString} */ n.content.str; } n = n.right; } return str; } /** * Returns the unformatted string representation of this YText type. * * @return {string} * @public */ toJSON() { return this.toString(); } /** * Apply a {@link Delta} on this shared YText type. * * @param {Array<any>} delta The changes to apply on this element. * @param {object} opts * @param {boolean} [opts.sanitize] Sanitize input delta. Removes ending newlines if set to true. * * * @public */ applyDelta(delta, { sanitize = true } = {}) { if (this.doc !== null) { transact(this.doc, (transaction) => { const currPos = new ItemTextListPosition(null, this._start, 0, /* @__PURE__ */ new Map()); for (let i = 0; i < delta.length; i++) { const op = delta[i]; if (op.insert !== void 0) { const ins = !sanitize && typeof op.insert === "string" && i === delta.length - 1 && currPos.right === null && op.insert.slice(-1) === "\n" ? op.insert.slice(0, -1) : op.insert; if (typeof ins !== "string" || ins.length > 0) { insertText(transaction, this, currPos, ins, op.attributes || {}); } } else if (op.retain !== void 0) { formatText(transaction, this, currPos, op.retain, op.attributes || {}); } else if (op.delete !== void 0) { deleteText(transaction, currPos, op.delete); } } }); } else { this._pending.push(() => this.applyDelta(delta)); } } /** * Returns the Delta representation of this YText type. * * @param {Snapshot} [snapshot] * @param {Snapshot} [prevSnapshot] * @param {function('removed' | 'added', ID):any} [computeYChange] * @return {any} The Delta representation of this type. * * @public */ toDelta(snapshot2, prevSnapshot, computeYChange) { this.doc ?? warnPrematureAccess(); const ops = []; const currentAttributes = /* @__PURE__ */ new Map(); const doc2 = ( /** @type {Doc} */ this.doc ); let str = ""; let n = this._start; function packStr() { if (str.length > 0) { const attributes = {}; let addAttributes = false; currentAttributes.forEach((value, key) => { addAttributes = true; attributes[key] = value; }); const op = { insert: str }; if (addAttributes) { op.attributes = attributes; } ops.push(op); str = ""; } } const computeDelta = () => { while (n !== null) { if (isVisible(n, snapshot2) || prevSnapshot !== void 0 && isVisible(n, prevSnapshot)) { switch (n.content.constructor) { case ContentString: { const cur = currentAttributes.get("ychange"); if (snapshot2 !== void 0 && !isVisible(n, snapshot2)) { if (cur === void 0 || cur.user !== n.id.client || cur.type !== "removed") { packStr(); currentAttributes.set("ychange", computeYChange ? computeYChange("removed", n.id) : { type: "removed" }); } } else if (prevSnapshot !== void 0 && !isVisible(n, prevSnapshot)) { if (cur === void 0 || cur.user !== n.id.client || cur.type !== "added") { packStr(); currentAttributes.set("ychange", computeYChange ? computeYChange("added", n.id) : { type: "added" }); } } else if (cur !== void 0) { packStr(); currentAttributes.delete("ychange"); } str += /** @type {ContentString} */ n.content.str; break; } case ContentType: case ContentEmbed: { packStr(); const op = { insert: n.content.getContent()[0] }; if (currentAttributes.size > 0) { const attrs = ( /** @type {Object<string,any>} */ {} ); op.attributes = attrs; currentAttributes.forEach((value, key) => { attrs[key] = value; }); } ops.push(op); break; } case ContentFormat: if (isVisible(n, snapshot2)) { packStr(); updateCurrentAttributes( currentAttributes, /** @type {ContentFormat} */ n.content ); } break; } } n = n.right; } packStr(); }; if (snapshot2 || prevSnapshot) { transact(doc2, (transaction) => { if (snapshot2) { splitSnapshotAffectedStructs(transaction, snapshot2); } if (prevSnapshot) { splitSnapshotAffectedStructs(transaction, prevSnapshot); } computeDelta(); }, "cleanup"); } else { computeDelta(); } return ops; } /** * Insert text at a given index. * * @param {number} index The index at which to start inserting. * @param {String} text The text to insert at the specified position. * @param {TextAttributes} [attributes] Optionally define some formatting * information to apply on the inserted * Text. * @public */ insert(index, text2, attributes) { if (text2.length <= 0) { return; } const y = this.doc; if (y !== null) { transact(y, (transaction) => { const pos = findPosition(transaction, this, index, !attributes); if (!attributes) { attributes = {}; pos.currentAttributes.forEach((v, k) => { attributes[k] = v; }); } insertText(transaction, this, pos, text2, attributes); }); } else { this._pending.push(() => this.insert(index, text2, attributes)); } } /** * Inserts an embed at a index. * * @param {number} index The index to insert the embed at. * @param {Object | AbstractType<any>} embed The Object that represents the embed. * @param {TextAttributes} [attributes] Attribute information to apply on the * embed * * @public */ insertEmbed(index, embed, attributes) { const y = this.doc; if (y !== null) { transact(y, (transaction) => { const pos = findPosition(transaction, this, index, !attributes); insertText(transaction, this, pos, embed, attributes || {}); }); } else { this._pending.push(() => this.insertEmbed(index, embed, attributes || {})); } } /** * Deletes text starting from an index. * * @param {number} index Index at which to start deleting. * @param {number} length The number of characters to remove. Defaults to 1. * * @public */ delete(index, length3) { if (length3 === 0) { return; } const y = this.doc; if (y !== null) { transact(y, (transaction) => { deleteText(transaction, findPosition(transaction, this, index, true), length3); }); } else { this._pending.push(() => this.delete(index, length3)); } } /** * Assigns properties to a range of text. * * @param {number} index The position where to start formatting. * @param {number} length The amount of characters to assign properties to. * @param {TextAttributes} attributes Attribute information to apply on the * text. * * @public */ format(index, length3, attributes) { if (length3 === 0) { return; } const y = this.doc; if (y !== null) { transact(y, (transaction) => { const pos = findPosition(transaction, this, index, false); if (pos.right === null) { return; } formatText(transaction, this, pos, length3, attributes); }); } else { this._pending.push(() => this.format(index, length3, attributes)); } } /** * Removes an attribute. * * @note Xml-Text nodes don't have attributes. You can use this feature to assign properties to complete text-blocks. * * @param {String} attributeName The attribute name that is to be removed. * * @public */ removeAttribute(attributeName) { if (this.doc !== null) { transact(this.doc, (transaction) => { typeMapDelete(transaction, this, attributeName); }); } else { this._pending.push(() => this.removeAttribute(attributeName)); } } /** * Sets or updates an attribute. * * @note Xml-Text nodes don't have attributes. You can use this feature to assign properties to complete text-blocks. * * @param {String} attributeName The attribute name that is to be set. * @param {any} attributeValue The attribute value that is to be set. * * @public */ setAttribute(attributeName, attributeValue) { if (this.doc !== null) { transact(this.doc, (transaction) => { typeMapSet(transaction, this, attributeName, attributeValue); }); } else { this._pending.push(() => this.setAttribute(attributeName, attributeValue)); } } /** * Returns an attribute value that belongs to the attribute name. * * @note Xml-Text nodes don't have attributes. You can use this feature to assign properties to complete text-blocks. * * @param {String} attributeName The attribute name that identifies the * queried value. * @return {any} The queried attribute value. * * @public */ getAttribute(attributeName) { return ( /** @type {any} */ typeMapGet(this, attributeName) ); } /** * Returns all attribute name/value pairs in a JSON Object. * * @note Xml-Text nodes don't have attributes. You can use this feature to assign properties to complete text-blocks. * * @return {Object<string, any>} A JSON Object that describes the attributes. * * @public */ getAttributes() { return typeMapGetAll(this); } /** * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder */ _write(encoder) { encoder.writeTypeRef(YTextRefID); } }; var readYText = (_decoder) => new YText(); var YXmlTreeWalker = class { /** * @param {YXmlFragment | YXmlElement} root * @param {function(AbstractType<any>):boolean} [f] */ constructor(root, f = () => true) { this._filter = f; this._root = root; this._currentNode = /** @type {Item} */ root._start; this._firstCall = true; root.doc ?? warnPrematureAccess(); } [Symbol.iterator]() { return this; } /** * Get the next node. * * @return {IteratorResult<YXmlElement|YXmlText|YXmlHook>} The next node. * * @public */ next() { let n = this._currentNode; let type = n && n.content && /** @type {any} */ n.content.type; if (n !== null && (!this._firstCall || n.deleted || !this._filter(type))) { do { type = /** @type {any} */ n.content.type; if (!n.deleted && (type.constructor === YXmlElement || type.constructor === YXmlFragment) && type._start !== null) { n = type._start; } else { while (n !== null) { const nxt = n.next; if (nxt !== null) { n = nxt; break; } else if (n.parent === this._root) { n = null; } else { n = /** @type {AbstractType<any>} */ n.parent._item; } } } } while (n !== null && (n.deleted || !this._filter( /** @type {ContentType} */ n.content.type ))); } this._firstCall = false; if (n === null) { return { value: void 0, done: true }; } this._currentNode = n; return { value: ( /** @type {any} */ n.content.type ), done: false }; } }; var YXmlFragment = class _YXmlFragment extends AbstractType { constructor() { super(); this._prelimContent = []; } /** * @type {YXmlElement|YXmlText|null} */ get firstChild() { const first = this._first; return first ? first.content.getContent()[0] : null; } /** * Integrate this type into the Yjs instance. * * * Save this struct in the os * * This type is sent to other client * * Observer functions are fired * * @param {Doc} y The Yjs instance * @param {Item} item */ _integrate(y, item) { super._integrate(y, item); this.insert( 0, /** @type {Array<any>} */ this._prelimContent ); this._prelimContent = null; } _copy() { return new _YXmlFragment(); } /** * Makes a copy of this data type that can be included somewhere else. * * Note that the content is only readable _after_ it has been included somewhere in the Ydoc. * * @return {YXmlFragment} */ clone() { const el = new _YXmlFragment(); el.insert(0, this.toArray().map((item) => item instanceof AbstractType ? item.clone() : item)); return el; } get length() { this.doc ?? warnPrematureAccess(); return this._prelimContent === null ? this._length : this._prelimContent.length; } /** * Create a subtree of childNodes. * * @example * const walker = elem.createTreeWalker(dom => dom.nodeName === 'div') * for (let node in walker) { * // `node` is a div node * nop(node) * } * * @param {function(AbstractType<any>):boolean} filter Function that is called on each child element and * returns a Boolean indicating whether the child * is to be included in the subtree. * @return {YXmlTreeWalker} A subtree and a position within it. * * @public */ createTreeWalker(filter) { return new YXmlTreeWalker(this, filter); } /** * Returns the first YXmlElement that matches the query. * Similar to DOM's {@link querySelector}. * * Query support: * - tagname * TODO: * - id * - attribute * * @param {CSS_Selector} query The query on the children. * @return {YXmlElement|YXmlText|YXmlHook|null} The first element that matches the query or null. * * @public */ querySelector(query) { query = query.toUpperCase(); const iterator = new YXmlTreeWalker(this, (element2) => element2.nodeName && element2.nodeName.toUpperCase() === query); const next = iterator.next(); if (next.done) { return null; } else { return next.value; } } /** * Returns all YXmlElements that match the query. * Similar to Dom's {@link querySelectorAll}. * * @todo Does not yet support all queries. Currently only query by tagName. * * @param {CSS_Selector} query The query on the children * @return {Array<YXmlElement|YXmlText|YXmlHook|null>} The elements that match this query. * * @public */ querySelectorAll(query) { query = query.toUpperCase(); return from(new YXmlTreeWalker(this, (element2) => element2.nodeName && element2.nodeName.toUpperCase() === query)); } /** * Creates YXmlEvent and calls observers. * * @param {Transaction} transaction * @param {Set<null|string>} parentSubs Keys changed on this type. `null` if list was modified. */ _callObserver(transaction, parentSubs) { callTypeObservers(this, transaction, new YXmlEvent(this, parentSubs, transaction)); } /** * Get the string representation of all the children of this YXmlFragment. * * @return {string} The string representation of all children. */ toString() { return typeListMap(this, (xml) => xml.toString()).join(""); } /** * @return {string} */ toJSON() { return this.toString(); } /** * Creates a Dom Element that mirrors this YXmlElement. * * @param {Document} [_document=document] The document object (you must define * this when calling this method in * nodejs) * @param {Object<string, any>} [hooks={}] Optional property to customize how hooks * are presented in the DOM * @param {any} [binding] You should not set this property. This is * used if DomBinding wants to create a * association to the created DOM type. * @return {Node} The {@link https://developer.mozilla.org/en-US/docs/Web/API/Element|Dom Element} * * @public */ toDOM(_document = document, hooks = {}, binding) { const fragment = _document.createDocumentFragment(); if (binding !== void 0) { binding._createAssociation(fragment, this); } typeListForEach(this, (xmlType) => { fragment.insertBefore(xmlType.toDOM(_document, hooks, binding), null); }); return fragment; } /** * Inserts new content at an index. * * @example * // Insert character 'a' at position 0 * xml.insert(0, [new Y.XmlText('text')]) * * @param {number} index The index to insert content at * @param {Array<YXmlElement|YXmlText>} content The array of content */ insert(index, content) { if (this.doc !== null) { transact(this.doc, (transaction) => { typeListInsertGenerics(transaction, this, index, content); }); } else { this._prelimContent.splice(index, 0, ...content); } } /** * Inserts new content at an index. * * @example * // Insert character 'a' at position 0 * xml.insert(0, [new Y.XmlText('text')]) * * @param {null|Item|YXmlElement|YXmlText} ref The index to insert content at * @param {Array<YXmlElement|YXmlText>} content The array of content */ insertAfter(ref, content) { if (this.doc !== null) { transact(this.doc, (transaction) => { const refItem = ref && ref instanceof AbstractType ? ref._item : ref; typeListInsertGenericsAfter(transaction, this, refItem, content); }); } else { const pc = ( /** @type {Array<any>} */ this._prelimContent ); const index = ref === null ? 0 : pc.findIndex((el) => el === ref) + 1; if (index === 0 && ref !== null) { throw create3("Reference item not found"); } pc.splice(index, 0, ...content); } } /** * Deletes elements starting from an index. * * @param {number} index Index at which to start deleting elements * @param {number} [length=1] The number of elements to remove. Defaults to 1. */ delete(index, length3 = 1) { if (this.doc !== null) { transact(this.doc, (transaction) => { typeListDelete(transaction, this, index, length3); }); } else { this._prelimContent.splice(index, length3); } } /** * Transforms this YArray to a JavaScript Array. * * @return {Array<YXmlElement|YXmlText|YXmlHook>} */ toArray() { return typeListToArray(this); } /** * Appends content to this YArray. * * @param {Array<YXmlElement|YXmlText>} content Array of content to append. */ push(content) { this.insert(this.length, content); } /** * Prepends content to this YArray. * * @param {Array<YXmlElement|YXmlText>} content Array of content to prepend. */ unshift(content) { this.insert(0, content); } /** * Returns the i-th element from a YArray. * * @param {number} index The index of the element to return from the YArray * @return {YXmlElement|YXmlText} */ get(index) { return typeListGet(this, index); } /** * Returns a portion of this YXmlFragment into a JavaScript Array selected * from start to end (end not included). * * @param {number} [start] * @param {number} [end] * @return {Array<YXmlElement|YXmlText>} */ slice(start = 0, end = this.length) { return typeListSlice(this, start, end); } /** * Executes a provided function on once on every child element. * * @param {function(YXmlElement|YXmlText,number, typeof self):void} f A function to execute on every element of this YArray. */ forEach(f) { typeListForEach(this, f); } /** * Transform the properties of this type to binary and write it to an * BinaryEncoder. * * This is called when this Item is sent to a remote peer. * * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder The encoder to write data to. */ _write(encoder) { encoder.writeTypeRef(YXmlFragmentRefID); } }; var readYXmlFragment = (_decoder) => new YXmlFragment(); var YXmlElement = class _YXmlElement extends YXmlFragment { constructor(nodeName = "UNDEFINED") { super(); this.nodeName = nodeName; this._prelimAttrs = /* @__PURE__ */ new Map(); } /** * @type {YXmlElement|YXmlText|null} */ get nextSibling() { const n = this._item ? this._item.next : null; return n ? ( /** @type {YXmlElement|YXmlText} */ /** @type {ContentType} */ n.content.type ) : null; } /** * @type {YXmlElement|YXmlText|null} */ get prevSibling() { const n = this._item ? this._item.prev : null; return n ? ( /** @type {YXmlElement|YXmlText} */ /** @type {ContentType} */ n.content.type ) : null; } /** * Integrate this type into the Yjs instance. * * * Save this struct in the os * * This type is sent to other client * * Observer functions are fired * * @param {Doc} y The Yjs instance * @param {Item} item */ _integrate(y, item) { super._integrate(y, item); /** @type {Map<string, any>} */ this._prelimAttrs.forEach((value, key) => { this.setAttribute(key, value); }); this._prelimAttrs = null; } /** * Creates an Item with the same effect as this Item (without position effect) * * @return {YXmlElement} */ _copy() { return new _YXmlElement(this.nodeName); } /** * Makes a copy of this data type that can be included somewhere else. * * Note that the content is only readable _after_ it has been included somewhere in the Ydoc. * * @return {YXmlElement<KV>} */ clone() { const el = new _YXmlElement(this.nodeName); const attrs = this.getAttributes(); forEach(attrs, (value, key) => { el.setAttribute( key, /** @type {any} */ value ); }); el.insert(0, this.toArray().map((v) => v instanceof AbstractType ? v.clone() : v)); return el; } /** * Returns the XML serialization of this YXmlElement. * The attributes are ordered by attribute-name, so you can easily use this * method to compare YXmlElements * * @return {string} The string representation of this type. * * @public */ toString() { const attrs = this.getAttributes(); const stringBuilder = []; const keys2 = []; for (const key in attrs) { keys2.push(key); } keys2.sort(); const keysLen = keys2.length; for (let i = 0; i < keysLen; i++) { const key = keys2[i]; stringBuilder.push(key + '="' + attrs[key] + '"'); } const nodeName = this.nodeName.toLocaleLowerCase(); const attrsString = stringBuilder.length > 0 ? " " + stringBuilder.join(" ") : ""; return `<${nodeName}${attrsString}>${super.toString()}</${nodeName}>`; } /** * Removes an attribute from this YXmlElement. * * @param {string} attributeName The attribute name that is to be removed. * * @public */ removeAttribute(attributeName) { if (this.doc !== null) { transact(this.doc, (transaction) => { typeMapDelete(transaction, this, attributeName); }); } else { this._prelimAttrs.delete(attributeName); } } /** * Sets or updates an attribute. * * @template {keyof KV & string} KEY * * @param {KEY} attributeName The attribute name that is to be set. * @param {KV[KEY]} attributeValue The attribute value that is to be set. * * @public */ setAttribute(attributeName, attributeValue) { if (this.doc !== null) { transact(this.doc, (transaction) => { typeMapSet(transaction, this, attributeName, attributeValue); }); } else { this._prelimAttrs.set(attributeName, attributeValue); } } /** * Returns an attribute value that belongs to the attribute name. * * @template {keyof KV & string} KEY * * @param {KEY} attributeName The attribute name that identifies the * queried value. * @return {KV[KEY]|undefined} The queried attribute value. * * @public */ getAttribute(attributeName) { return ( /** @type {any} */ typeMapGet(this, attributeName) ); } /** * Returns whether an attribute exists * * @param {string} attributeName The attribute name to check for existence. * @return {boolean} whether the attribute exists. * * @public */ hasAttribute(attributeName) { return ( /** @type {any} */ typeMapHas(this, attributeName) ); } /** * Returns all attribute name/value pairs in a JSON Object. * * @param {Snapshot} [snapshot] * @return {{ [Key in Extract<keyof KV,string>]?: KV[Key]}} A JSON Object that describes the attributes. * * @public */ getAttributes(snapshot2) { return ( /** @type {any} */ snapshot2 ? typeMapGetAllSnapshot(this, snapshot2) : typeMapGetAll(this) ); } /** * Creates a Dom Element that mirrors this YXmlElement. * * @param {Document} [_document=document] The document object (you must define * this when calling this method in * nodejs) * @param {Object<string, any>} [hooks={}] Optional property to customize how hooks * are presented in the DOM * @param {any} [binding] You should not set this property. This is * used if DomBinding wants to create a * association to the created DOM type. * @return {Node} The {@link https://developer.mozilla.org/en-US/docs/Web/API/Element|Dom Element} * * @public */ toDOM(_document = document, hooks = {}, binding) { const dom = _document.createElement(this.nodeName); const attrs = this.getAttributes(); for (const key in attrs) { const value = attrs[key]; if (typeof value === "string") { dom.setAttribute(key, value); } } typeListForEach(this, (yxml) => { dom.appendChild(yxml.toDOM(_document, hooks, binding)); }); if (binding !== void 0) { binding._createAssociation(dom, this); } return dom; } /** * Transform the properties of this type to binary and write it to an * BinaryEncoder. * * This is called when this Item is sent to a remote peer. * * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder The encoder to write data to. */ _write(encoder) { encoder.writeTypeRef(YXmlElementRefID); encoder.writeKey(this.nodeName); } }; var readYXmlElement = (decoder) => new YXmlElement(decoder.readKey()); var YXmlEvent = class extends YEvent { /** * @param {YXmlElement|YXmlText|YXmlFragment} target The target on which the event is created. * @param {Set<string|null>} subs The set of changed attributes. `null` is included if the * child list changed. * @param {Transaction} transaction The transaction instance with which the * change was created. */ constructor(target, subs, transaction) { super(target, transaction); this.childListChanged = false; this.attributesChanged = /* @__PURE__ */ new Set(); subs.forEach((sub) => { if (sub === null) { this.childListChanged = true; } else { this.attributesChanged.add(sub); } }); } }; var YXmlHook = class _YXmlHook extends YMap { /** * @param {string} hookName nodeName of the Dom Node. */ constructor(hookName) { super(); this.hookName = hookName; } /** * Creates an Item with the same effect as this Item (without position effect) */ _copy() { return new _YXmlHook(this.hookName); } /** * Makes a copy of this data type that can be included somewhere else. * * Note that the content is only readable _after_ it has been included somewhere in the Ydoc. * * @return {YXmlHook} */ clone() { const el = new _YXmlHook(this.hookName); this.forEach((value, key) => { el.set(key, value); }); return el; } /** * Creates a Dom Element that mirrors this YXmlElement. * * @param {Document} [_document=document] The document object (you must define * this when calling this method in * nodejs) * @param {Object.<string, any>} [hooks] Optional property to customize how hooks * are presented in the DOM * @param {any} [binding] You should not set this property. This is * used if DomBinding wants to create a * association to the created DOM type * @return {Element} The {@link https://developer.mozilla.org/en-US/docs/Web/API/Element|Dom Element} * * @public */ toDOM(_document = document, hooks = {}, binding) { const hook = hooks[this.hookName]; let dom; if (hook !== void 0) { dom = hook.createDom(this); } else { dom = document.createElement(this.hookName); } dom.setAttribute("data-yjs-hook", this.hookName); if (binding !== void 0) { binding._createAssociation(dom, this); } return dom; } /** * Transform the properties of this type to binary and write it to an * BinaryEncoder. * * This is called when this Item is sent to a remote peer. * * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder The encoder to write data to. */ _write(encoder) { encoder.writeTypeRef(YXmlHookRefID); encoder.writeKey(this.hookName); } }; var readYXmlHook = (decoder) => new YXmlHook(decoder.readKey()); var YXmlText = class _YXmlText extends YText { /** * @type {YXmlElement|YXmlText|null} */ get nextSibling() { const n = this._item ? this._item.next : null; return n ? ( /** @type {YXmlElement|YXmlText} */ /** @type {ContentType} */ n.content.type ) : null; } /** * @type {YXmlElement|YXmlText|null} */ get prevSibling() { const n = this._item ? this._item.prev : null; return n ? ( /** @type {YXmlElement|YXmlText} */ /** @type {ContentType} */ n.content.type ) : null; } _copy() { return new _YXmlText(); } /** * Makes a copy of this data type that can be included somewhere else. * * Note that the content is only readable _after_ it has been included somewhere in the Ydoc. * * @return {YXmlText} */ clone() { const text2 = new _YXmlText(); text2.applyDelta(this.toDelta()); return text2; } /** * Creates a Dom Element that mirrors this YXmlText. * * @param {Document} [_document=document] The document object (you must define * this when calling this method in * nodejs) * @param {Object<string, any>} [hooks] Optional property to customize how hooks * are presented in the DOM * @param {any} [binding] You should not set this property. This is * used if DomBinding wants to create a * association to the created DOM type. * @return {Text} The {@link https://developer.mozilla.org/en-US/docs/Web/API/Element|Dom Element} * * @public */ toDOM(_document = document, hooks, binding) { const dom = _document.createTextNode(this.toString()); if (binding !== void 0) { binding._createAssociation(dom, this); } return dom; } toString() { return this.toDelta().map((delta) => { const nestedNodes = []; for (const nodeName in delta.attributes) { const attrs = []; for (const key in delta.attributes[nodeName]) { attrs.push({ key, value: delta.attributes[nodeName][key] }); } attrs.sort((a, b) => a.key < b.key ? -1 : 1); nestedNodes.push({ nodeName, attrs }); } nestedNodes.sort((a, b) => a.nodeName < b.nodeName ? -1 : 1); let str = ""; for (let i = 0; i < nestedNodes.length; i++) { const node = nestedNodes[i]; str += `<${node.nodeName}`; for (let j = 0; j < node.attrs.length; j++) { const attr = node.attrs[j]; str += ` ${attr.key}="${attr.value}"`; } str += ">"; } str += delta.insert; for (let i = nestedNodes.length - 1; i >= 0; i--) { str += `</${nestedNodes[i].nodeName}>`; } return str; }).join(""); } /** * @return {string} */ toJSON() { return this.toString(); } /** * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder */ _write(encoder) { encoder.writeTypeRef(YXmlTextRefID); } }; var readYXmlText = (decoder) => new YXmlText(); var AbstractStruct = class { /** * @param {ID} id * @param {number} length */ constructor(id2, length3) { this.id = id2; this.length = length3; } /** * @type {boolean} */ get deleted() { throw methodUnimplemented(); } /** * Merge this struct with the item to the right. * This method is already assuming that `this.id.clock + this.length === this.id.clock`. * Also this method does *not* remove right from StructStore! * @param {AbstractStruct} right * @return {boolean} whether this merged with right */ mergeWith(right) { return false; } /** * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder The encoder to write data to. * @param {number} offset * @param {number} encodingRef */ write(encoder, offset, encodingRef) { throw methodUnimplemented(); } /** * @param {Transaction} transaction * @param {number} offset */ integrate(transaction, offset) { throw methodUnimplemented(); } }; var structGCRefNumber = 0; var GC = class extends AbstractStruct { get deleted() { return true; } delete() { } /** * @param {GC} right * @return {boolean} */ mergeWith(right) { if (this.constructor !== right.constructor) { return false; } this.length += right.length; return true; } /** * @param {Transaction} transaction * @param {number} offset */ integrate(transaction, offset) { if (offset > 0) { this.id.clock += offset; this.length -= offset; } addStruct(transaction.doc.store, this); } /** * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder * @param {number} offset */ write(encoder, offset) { encoder.writeInfo(structGCRefNumber); encoder.writeLen(this.length - offset); } /** * @param {Transaction} transaction * @param {StructStore} store * @return {null | number} */ getMissing(transaction, store2) { return null; } }; var ContentBinary = class _ContentBinary { /** * @param {Uint8Array} content */ constructor(content) { this.content = content; } /** * @return {number} */ getLength() { return 1; } /** * @return {Array<any>} */ getContent() { return [this.content]; } /** * @return {boolean} */ isCountable() { return true; } /** * @return {ContentBinary} */ copy() { return new _ContentBinary(this.content); } /** * @param {number} offset * @return {ContentBinary} */ splice(offset) { throw methodUnimplemented(); } /** * @param {ContentBinary} right * @return {boolean} */ mergeWith(right) { return false; } /** * @param {Transaction} transaction * @param {Item} item */ integrate(transaction, item) { } /** * @param {Transaction} transaction */ delete(transaction) { } /** * @param {StructStore} store */ gc(store2) { } /** * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder * @param {number} offset */ write(encoder, offset) { encoder.writeBuf(this.content); } /** * @return {number} */ getRef() { return 3; } }; var readContentBinary = (decoder) => new ContentBinary(decoder.readBuf()); var ContentDeleted = class _ContentDeleted { /** * @param {number} len */ constructor(len) { this.len = len; } /** * @return {number} */ getLength() { return this.len; } /** * @return {Array<any>} */ getContent() { return []; } /** * @return {boolean} */ isCountable() { return false; } /** * @return {ContentDeleted} */ copy() { return new _ContentDeleted(this.len); } /** * @param {number} offset * @return {ContentDeleted} */ splice(offset) { const right = new _ContentDeleted(this.len - offset); this.len = offset; return right; } /** * @param {ContentDeleted} right * @return {boolean} */ mergeWith(right) { this.len += right.len; return true; } /** * @param {Transaction} transaction * @param {Item} item */ integrate(transaction, item) { addToDeleteSet(transaction.deleteSet, item.id.client, item.id.clock, this.len); item.markDeleted(); } /** * @param {Transaction} transaction */ delete(transaction) { } /** * @param {StructStore} store */ gc(store2) { } /** * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder * @param {number} offset */ write(encoder, offset) { encoder.writeLen(this.len - offset); } /** * @return {number} */ getRef() { return 1; } }; var readContentDeleted = (decoder) => new ContentDeleted(decoder.readLen()); var createDocFromOpts = (guid, opts) => new Doc({ guid, ...opts, shouldLoad: opts.shouldLoad || opts.autoLoad || false }); var ContentDoc = class _ContentDoc { /** * @param {Doc} doc */ constructor(doc2) { if (doc2._item) { console.error("This document was already integrated as a sub-document. You should create a second instance instead with the same guid."); } this.doc = doc2; const opts = {}; this.opts = opts; if (!doc2.gc) { opts.gc = false; } if (doc2.autoLoad) { opts.autoLoad = true; } if (doc2.meta !== null) { opts.meta = doc2.meta; } } /** * @return {number} */ getLength() { return 1; } /** * @return {Array<any>} */ getContent() { return [this.doc]; } /** * @return {boolean} */ isCountable() { return true; } /** * @return {ContentDoc} */ copy() { return new _ContentDoc(createDocFromOpts(this.doc.guid, this.opts)); } /** * @param {number} offset * @return {ContentDoc} */ splice(offset) { throw methodUnimplemented(); } /** * @param {ContentDoc} right * @return {boolean} */ mergeWith(right) { return false; } /** * @param {Transaction} transaction * @param {Item} item */ integrate(transaction, item) { this.doc._item = item; transaction.subdocsAdded.add(this.doc); if (this.doc.shouldLoad) { transaction.subdocsLoaded.add(this.doc); } } /** * @param {Transaction} transaction */ delete(transaction) { if (transaction.subdocsAdded.has(this.doc)) { transaction.subdocsAdded.delete(this.doc); } else { transaction.subdocsRemoved.add(this.doc); } } /** * @param {StructStore} store */ gc(store2) { } /** * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder * @param {number} offset */ write(encoder, offset) { encoder.writeString(this.doc.guid); encoder.writeAny(this.opts); } /** * @return {number} */ getRef() { return 9; } }; var readContentDoc = (decoder) => new ContentDoc(createDocFromOpts(decoder.readString(), decoder.readAny())); var ContentEmbed = class _ContentEmbed { /** * @param {Object} embed */ constructor(embed) { this.embed = embed; } /** * @return {number} */ getLength() { return 1; } /** * @return {Array<any>} */ getContent() { return [this.embed]; } /** * @return {boolean} */ isCountable() { return true; } /** * @return {ContentEmbed} */ copy() { return new _ContentEmbed(this.embed); } /** * @param {number} offset * @return {ContentEmbed} */ splice(offset) { throw methodUnimplemented(); } /** * @param {ContentEmbed} right * @return {boolean} */ mergeWith(right) { return false; } /** * @param {Transaction} transaction * @param {Item} item */ integrate(transaction, item) { } /** * @param {Transaction} transaction */ delete(transaction) { } /** * @param {StructStore} store */ gc(store2) { } /** * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder * @param {number} offset */ write(encoder, offset) { encoder.writeJSON(this.embed); } /** * @return {number} */ getRef() { return 5; } }; var readContentEmbed = (decoder) => new ContentEmbed(decoder.readJSON()); var ContentFormat = class _ContentFormat { /** * @param {string} key * @param {Object} value */ constructor(key, value) { this.key = key; this.value = value; } /** * @return {number} */ getLength() { return 1; } /** * @return {Array<any>} */ getContent() { return []; } /** * @return {boolean} */ isCountable() { return false; } /** * @return {ContentFormat} */ copy() { return new _ContentFormat(this.key, this.value); } /** * @param {number} _offset * @return {ContentFormat} */ splice(_offset) { throw methodUnimplemented(); } /** * @param {ContentFormat} _right * @return {boolean} */ mergeWith(_right) { return false; } /** * @param {Transaction} _transaction * @param {Item} item */ integrate(_transaction, item) { const p = ( /** @type {YText} */ item.parent ); p._searchMarker = null; p._hasFormatting = true; } /** * @param {Transaction} transaction */ delete(transaction) { } /** * @param {StructStore} store */ gc(store2) { } /** * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder * @param {number} offset */ write(encoder, offset) { encoder.writeKey(this.key); encoder.writeJSON(this.value); } /** * @return {number} */ getRef() { return 6; } }; var readContentFormat = (decoder) => new ContentFormat(decoder.readKey(), decoder.readJSON()); var ContentJSON = class _ContentJSON { /** * @param {Array<any>} arr */ constructor(arr) { this.arr = arr; } /** * @return {number} */ getLength() { return this.arr.length; } /** * @return {Array<any>} */ getContent() { return this.arr; } /** * @return {boolean} */ isCountable() { return true; } /** * @return {ContentJSON} */ copy() { return new _ContentJSON(this.arr); } /** * @param {number} offset * @return {ContentJSON} */ splice(offset) { const right = new _ContentJSON(this.arr.slice(offset)); this.arr = this.arr.slice(0, offset); return right; } /** * @param {ContentJSON} right * @return {boolean} */ mergeWith(right) { this.arr = this.arr.concat(right.arr); return true; } /** * @param {Transaction} transaction * @param {Item} item */ integrate(transaction, item) { } /** * @param {Transaction} transaction */ delete(transaction) { } /** * @param {StructStore} store */ gc(store2) { } /** * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder * @param {number} offset */ write(encoder, offset) { const len = this.arr.length; encoder.writeLen(len - offset); for (let i = offset; i < len; i++) { const c = this.arr[i]; encoder.writeString(c === void 0 ? "undefined" : JSON.stringify(c)); } } /** * @return {number} */ getRef() { return 2; } }; var readContentJSON = (decoder) => { const len = decoder.readLen(); const cs = []; for (let i = 0; i < len; i++) { const c = decoder.readString(); if (c === "undefined") { cs.push(void 0); } else { cs.push(JSON.parse(c)); } } return new ContentJSON(cs); }; var isDevMode = getVariable("node_env") === "development"; var ContentAny = class _ContentAny { /** * @param {Array<any>} arr */ constructor(arr) { this.arr = arr; isDevMode && deepFreeze(arr); } /** * @return {number} */ getLength() { return this.arr.length; } /** * @return {Array<any>} */ getContent() { return this.arr; } /** * @return {boolean} */ isCountable() { return true; } /** * @return {ContentAny} */ copy() { return new _ContentAny(this.arr); } /** * @param {number} offset * @return {ContentAny} */ splice(offset) { const right = new _ContentAny(this.arr.slice(offset)); this.arr = this.arr.slice(0, offset); return right; } /** * @param {ContentAny} right * @return {boolean} */ mergeWith(right) { this.arr = this.arr.concat(right.arr); return true; } /** * @param {Transaction} transaction * @param {Item} item */ integrate(transaction, item) { } /** * @param {Transaction} transaction */ delete(transaction) { } /** * @param {StructStore} store */ gc(store2) { } /** * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder * @param {number} offset */ write(encoder, offset) { const len = this.arr.length; encoder.writeLen(len - offset); for (let i = offset; i < len; i++) { const c = this.arr[i]; encoder.writeAny(c); } } /** * @return {number} */ getRef() { return 8; } }; var readContentAny = (decoder) => { const len = decoder.readLen(); const cs = []; for (let i = 0; i < len; i++) { cs.push(decoder.readAny()); } return new ContentAny(cs); }; var ContentString = class _ContentString { /** * @param {string} str */ constructor(str) { this.str = str; } /** * @return {number} */ getLength() { return this.str.length; } /** * @return {Array<any>} */ getContent() { return this.str.split(""); } /** * @return {boolean} */ isCountable() { return true; } /** * @return {ContentString} */ copy() { return new _ContentString(this.str); } /** * @param {number} offset * @return {ContentString} */ splice(offset) { const right = new _ContentString(this.str.slice(offset)); this.str = this.str.slice(0, offset); const firstCharCode = this.str.charCodeAt(offset - 1); if (firstCharCode >= 55296 && firstCharCode <= 56319) { this.str = this.str.slice(0, offset - 1) + "\uFFFD"; right.str = "\uFFFD" + right.str.slice(1); } return right; } /** * @param {ContentString} right * @return {boolean} */ mergeWith(right) { this.str += right.str; return true; } /** * @param {Transaction} transaction * @param {Item} item */ integrate(transaction, item) { } /** * @param {Transaction} transaction */ delete(transaction) { } /** * @param {StructStore} store */ gc(store2) { } /** * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder * @param {number} offset */ write(encoder, offset) { encoder.writeString(offset === 0 ? this.str : this.str.slice(offset)); } /** * @return {number} */ getRef() { return 4; } }; var readContentString = (decoder) => new ContentString(decoder.readString()); var typeRefs = [ readYArray, readYMap, readYText, readYXmlElement, readYXmlFragment, readYXmlHook, readYXmlText ]; var YArrayRefID = 0; var YMapRefID = 1; var YTextRefID = 2; var YXmlElementRefID = 3; var YXmlFragmentRefID = 4; var YXmlHookRefID = 5; var YXmlTextRefID = 6; var ContentType = class _ContentType { /** * @param {AbstractType<any>} type */ constructor(type) { this.type = type; } /** * @return {number} */ getLength() { return 1; } /** * @return {Array<any>} */ getContent() { return [this.type]; } /** * @return {boolean} */ isCountable() { return true; } /** * @return {ContentType} */ copy() { return new _ContentType(this.type._copy()); } /** * @param {number} offset * @return {ContentType} */ splice(offset) { throw methodUnimplemented(); } /** * @param {ContentType} right * @return {boolean} */ mergeWith(right) { return false; } /** * @param {Transaction} transaction * @param {Item} item */ integrate(transaction, item) { this.type._integrate(transaction.doc, item); } /** * @param {Transaction} transaction */ delete(transaction) { let item = this.type._start; while (item !== null) { if (!item.deleted) { item.delete(transaction); } else if (item.id.clock < (transaction.beforeState.get(item.id.client) || 0)) { transaction._mergeStructs.push(item); } item = item.right; } this.type._map.forEach((item2) => { if (!item2.deleted) { item2.delete(transaction); } else if (item2.id.clock < (transaction.beforeState.get(item2.id.client) || 0)) { transaction._mergeStructs.push(item2); } }); transaction.changed.delete(this.type); } /** * @param {StructStore} store */ gc(store2) { let item = this.type._start; while (item !== null) { item.gc(store2, true); item = item.right; } this.type._start = null; this.type._map.forEach( /** @param {Item | null} item */ (item2) => { while (item2 !== null) { item2.gc(store2, true); item2 = item2.left; } } ); this.type._map = /* @__PURE__ */ new Map(); } /** * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder * @param {number} offset */ write(encoder, offset) { this.type._write(encoder); } /** * @return {number} */ getRef() { return 7; } }; var readContentType = (decoder) => new ContentType(typeRefs[decoder.readTypeRef()](decoder)); var followRedone = (store2, id2) => { let nextID = id2; let diff = 0; let item; do { if (diff > 0) { nextID = createID(nextID.client, nextID.clock + diff); } item = getItem(store2, nextID); diff = nextID.clock - item.id.clock; nextID = item.redone; } while (nextID !== null && item instanceof Item); return { item, diff }; }; var keepItem = (item, keep) => { while (item !== null && item.keep !== keep) { item.keep = keep; item = /** @type {AbstractType<any>} */ item.parent._item; } }; var splitItem = (transaction, leftItem, diff) => { const { client, clock } = leftItem.id; const rightItem = new Item( createID(client, clock + diff), leftItem, createID(client, clock + diff - 1), leftItem.right, leftItem.rightOrigin, leftItem.parent, leftItem.parentSub, leftItem.content.splice(diff) ); if (leftItem.deleted) { rightItem.markDeleted(); } if (leftItem.keep) { rightItem.keep = true; } if (leftItem.redone !== null) { rightItem.redone = createID(leftItem.redone.client, leftItem.redone.clock + diff); } leftItem.right = rightItem; if (rightItem.right !== null) { rightItem.right.left = rightItem; } transaction._mergeStructs.push(rightItem); if (rightItem.parentSub !== null && rightItem.right === null) { rightItem.parent._map.set(rightItem.parentSub, rightItem); } leftItem.length = diff; return rightItem; }; var isDeletedByUndoStack = (stack, id2) => some( stack, /** @param {StackItem} s */ (s) => isDeleted(s.deletions, id2) ); var redoItem = (transaction, item, redoitems, itemsToDelete, ignoreRemoteMapChanges, um) => { const doc2 = transaction.doc; const store2 = doc2.store; const ownClientID = doc2.clientID; const redone = item.redone; if (redone !== null) { return getItemCleanStart(transaction, redone); } let parentItem = ( /** @type {AbstractType<any>} */ item.parent._item ); let left = null; let right; if (parentItem !== null && parentItem.deleted === true) { if (parentItem.redone === null && (!redoitems.has(parentItem) || redoItem(transaction, parentItem, redoitems, itemsToDelete, ignoreRemoteMapChanges, um) === null)) { return null; } while (parentItem.redone !== null) { parentItem = getItemCleanStart(transaction, parentItem.redone); } } const parentType = parentItem === null ? ( /** @type {AbstractType<any>} */ item.parent ) : ( /** @type {ContentType} */ parentItem.content.type ); if (item.parentSub === null) { left = item.left; right = item; while (left !== null) { let leftTrace = left; while (leftTrace !== null && /** @type {AbstractType<any>} */ leftTrace.parent._item !== parentItem) { leftTrace = leftTrace.redone === null ? null : getItemCleanStart(transaction, leftTrace.redone); } if (leftTrace !== null && /** @type {AbstractType<any>} */ leftTrace.parent._item === parentItem) { left = leftTrace; break; } left = left.left; } while (right !== null) { let rightTrace = right; while (rightTrace !== null && /** @type {AbstractType<any>} */ rightTrace.parent._item !== parentItem) { rightTrace = rightTrace.redone === null ? null : getItemCleanStart(transaction, rightTrace.redone); } if (rightTrace !== null && /** @type {AbstractType<any>} */ rightTrace.parent._item === parentItem) { right = rightTrace; break; } right = right.right; } } else { right = null; if (item.right && !ignoreRemoteMapChanges) { left = item; while (left !== null && left.right !== null && (left.right.redone || isDeleted(itemsToDelete, left.right.id) || isDeletedByUndoStack(um.undoStack, left.right.id) || isDeletedByUndoStack(um.redoStack, left.right.id))) { left = left.right; while (left.redone) left = getItemCleanStart(transaction, left.redone); } if (left && left.right !== null) { return null; } } else { left = parentType._map.get(item.parentSub) || null; } } const nextClock = getState(store2, ownClientID); const nextId = createID(ownClientID, nextClock); const redoneItem = new Item( nextId, left, left && left.lastId, right, right && right.id, parentType, item.parentSub, item.content.copy() ); item.redone = nextId; keepItem(redoneItem, true); redoneItem.integrate(transaction, 0); return redoneItem; }; var Item = class _Item extends AbstractStruct { /** * @param {ID} id * @param {Item | null} left * @param {ID | null} origin * @param {Item | null} right * @param {ID | null} rightOrigin * @param {AbstractType<any>|ID|null} parent Is a type if integrated, is null if it is possible to copy parent from left or right, is ID before integration to search for it. * @param {string | null} parentSub * @param {AbstractContent} content */ constructor(id2, left, origin2, right, rightOrigin, parent, parentSub, content) { super(id2, content.getLength()); this.origin = origin2; this.left = left; this.right = right; this.rightOrigin = rightOrigin; this.parent = parent; this.parentSub = parentSub; this.redone = null; this.content = content; this.info = this.content.isCountable() ? BIT2 : 0; } /** * This is used to mark the item as an indexed fast-search marker * * @type {boolean} */ set marker(isMarked) { if ((this.info & BIT4) > 0 !== isMarked) { this.info ^= BIT4; } } get marker() { return (this.info & BIT4) > 0; } /** * If true, do not garbage collect this Item. */ get keep() { return (this.info & BIT1) > 0; } set keep(doKeep) { if (this.keep !== doKeep) { this.info ^= BIT1; } } get countable() { return (this.info & BIT2) > 0; } /** * Whether this item was deleted or not. * @type {Boolean} */ get deleted() { return (this.info & BIT3) > 0; } set deleted(doDelete) { if (this.deleted !== doDelete) { this.info ^= BIT3; } } markDeleted() { this.info |= BIT3; } /** * Return the creator clientID of the missing op or define missing items and return null. * * @param {Transaction} transaction * @param {StructStore} store * @return {null | number} */ getMissing(transaction, store2) { if (this.origin && this.origin.client !== this.id.client && this.origin.clock >= getState(store2, this.origin.client)) { return this.origin.client; } if (this.rightOrigin && this.rightOrigin.client !== this.id.client && this.rightOrigin.clock >= getState(store2, this.rightOrigin.client)) { return this.rightOrigin.client; } if (this.parent && this.parent.constructor === ID && this.id.client !== this.parent.client && this.parent.clock >= getState(store2, this.parent.client)) { return this.parent.client; } if (this.origin) { this.left = getItemCleanEnd(transaction, store2, this.origin); this.origin = this.left.lastId; } if (this.rightOrigin) { this.right = getItemCleanStart(transaction, this.rightOrigin); this.rightOrigin = this.right.id; } if (this.left && this.left.constructor === GC || this.right && this.right.constructor === GC) { this.parent = null; } else if (!this.parent) { if (this.left && this.left.constructor === _Item) { this.parent = this.left.parent; this.parentSub = this.left.parentSub; } else if (this.right && this.right.constructor === _Item) { this.parent = this.right.parent; this.parentSub = this.right.parentSub; } } else if (this.parent.constructor === ID) { const parentItem = getItem(store2, this.parent); if (parentItem.constructor === GC) { this.parent = null; } else { this.parent = /** @type {ContentType} */ parentItem.content.type; } } return null; } /** * @param {Transaction} transaction * @param {number} offset */ integrate(transaction, offset) { if (offset > 0) { this.id.clock += offset; this.left = getItemCleanEnd(transaction, transaction.doc.store, createID(this.id.client, this.id.clock - 1)); this.origin = this.left.lastId; this.content = this.content.splice(offset); this.length -= offset; } if (this.parent) { if (!this.left && (!this.right || this.right.left !== null) || this.left && this.left.right !== this.right) { let left = this.left; let o; if (left !== null) { o = left.right; } else if (this.parentSub !== null) { o = /** @type {AbstractType<any>} */ this.parent._map.get(this.parentSub) || null; while (o !== null && o.left !== null) { o = o.left; } } else { o = /** @type {AbstractType<any>} */ this.parent._start; } const conflictingItems = /* @__PURE__ */ new Set(); const itemsBeforeOrigin = /* @__PURE__ */ new Set(); while (o !== null && o !== this.right) { itemsBeforeOrigin.add(o); conflictingItems.add(o); if (compareIDs(this.origin, o.origin)) { if (o.id.client < this.id.client) { left = o; conflictingItems.clear(); } else if (compareIDs(this.rightOrigin, o.rightOrigin)) { break; } } else if (o.origin !== null && itemsBeforeOrigin.has(getItem(transaction.doc.store, o.origin))) { if (!conflictingItems.has(getItem(transaction.doc.store, o.origin))) { left = o; conflictingItems.clear(); } } else { break; } o = o.right; } this.left = left; } if (this.left !== null) { const right = this.left.right; this.right = right; this.left.right = this; } else { let r; if (this.parentSub !== null) { r = /** @type {AbstractType<any>} */ this.parent._map.get(this.parentSub) || null; while (r !== null && r.left !== null) { r = r.left; } } else { r = /** @type {AbstractType<any>} */ this.parent._start; this.parent._start = this; } this.right = r; } if (this.right !== null) { this.right.left = this; } else if (this.parentSub !== null) { this.parent._map.set(this.parentSub, this); if (this.left !== null) { this.left.delete(transaction); } } if (this.parentSub === null && this.countable && !this.deleted) { this.parent._length += this.length; } addStruct(transaction.doc.store, this); this.content.integrate(transaction, this); addChangedTypeToTransaction( transaction, /** @type {AbstractType<any>} */ this.parent, this.parentSub ); if ( /** @type {AbstractType<any>} */ this.parent._item !== null && /** @type {AbstractType<any>} */ this.parent._item.deleted || this.parentSub !== null && this.right !== null ) { this.delete(transaction); } } else { new GC(this.id, this.length).integrate(transaction, 0); } } /** * Returns the next non-deleted item */ get next() { let n = this.right; while (n !== null && n.deleted) { n = n.right; } return n; } /** * Returns the previous non-deleted item */ get prev() { let n = this.left; while (n !== null && n.deleted) { n = n.left; } return n; } /** * Computes the last content address of this Item. */ get lastId() { return this.length === 1 ? this.id : createID(this.id.client, this.id.clock + this.length - 1); } /** * Try to merge two items * * @param {Item} right * @return {boolean} */ mergeWith(right) { if (this.constructor === right.constructor && compareIDs(right.origin, this.lastId) && this.right === right && compareIDs(this.rightOrigin, right.rightOrigin) && this.id.client === right.id.client && this.id.clock + this.length === right.id.clock && this.deleted === right.deleted && this.redone === null && right.redone === null && this.content.constructor === right.content.constructor && this.content.mergeWith(right.content)) { const searchMarker = ( /** @type {AbstractType<any>} */ this.parent._searchMarker ); if (searchMarker) { searchMarker.forEach((marker) => { if (marker.p === right) { marker.p = this; if (!this.deleted && this.countable) { marker.index -= this.length; } } }); } if (right.keep) { this.keep = true; } this.right = right.right; if (this.right !== null) { this.right.left = this; } this.length += right.length; return true; } return false; } /** * Mark this Item as deleted. * * @param {Transaction} transaction */ delete(transaction) { if (!this.deleted) { const parent = ( /** @type {AbstractType<any>} */ this.parent ); if (this.countable && this.parentSub === null) { parent._length -= this.length; } this.markDeleted(); addToDeleteSet(transaction.deleteSet, this.id.client, this.id.clock, this.length); addChangedTypeToTransaction(transaction, parent, this.parentSub); this.content.delete(transaction); } } /** * @param {StructStore} store * @param {boolean} parentGCd */ gc(store2, parentGCd) { if (!this.deleted) { throw unexpectedCase(); } this.content.gc(store2); if (parentGCd) { replaceStruct(store2, this, new GC(this.id, this.length)); } else { this.content = new ContentDeleted(this.length); } } /** * Transform the properties of this type to binary and write it to an * BinaryEncoder. * * This is called when this Item is sent to a remote peer. * * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder The encoder to write data to. * @param {number} offset */ write(encoder, offset) { const origin2 = offset > 0 ? createID(this.id.client, this.id.clock + offset - 1) : this.origin; const rightOrigin = this.rightOrigin; const parentSub = this.parentSub; const info = this.content.getRef() & BITS5 | (origin2 === null ? 0 : BIT8) | // origin is defined (rightOrigin === null ? 0 : BIT7) | // right origin is defined (parentSub === null ? 0 : BIT6); encoder.writeInfo(info); if (origin2 !== null) { encoder.writeLeftID(origin2); } if (rightOrigin !== null) { encoder.writeRightID(rightOrigin); } if (origin2 === null && rightOrigin === null) { const parent = ( /** @type {AbstractType<any>} */ this.parent ); if (parent._item !== void 0) { const parentItem = parent._item; if (parentItem === null) { const ykey = findRootTypeKey(parent); encoder.writeParentInfo(true); encoder.writeString(ykey); } else { encoder.writeParentInfo(false); encoder.writeLeftID(parentItem.id); } } else if (parent.constructor === String) { encoder.writeParentInfo(true); encoder.writeString(parent); } else if (parent.constructor === ID) { encoder.writeParentInfo(false); encoder.writeLeftID(parent); } else { unexpectedCase(); } if (parentSub !== null) { encoder.writeString(parentSub); } } this.content.write(encoder, offset); } }; var readItemContent = (decoder, info) => contentRefs[info & BITS5](decoder); var contentRefs = [ () => { unexpectedCase(); }, // GC is not ItemContent readContentDeleted, // 1 readContentJSON, // 2 readContentBinary, // 3 readContentString, // 4 readContentEmbed, // 5 readContentFormat, // 6 readContentType, // 7 readContentAny, // 8 readContentDoc, // 9 () => { unexpectedCase(); } // 10 - Skip is not ItemContent ]; var structSkipRefNumber = 10; var Skip = class extends AbstractStruct { get deleted() { return true; } delete() { } /** * @param {Skip} right * @return {boolean} */ mergeWith(right) { if (this.constructor !== right.constructor) { return false; } this.length += right.length; return true; } /** * @param {Transaction} transaction * @param {number} offset */ integrate(transaction, offset) { unexpectedCase(); } /** * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder * @param {number} offset */ write(encoder, offset) { encoder.writeInfo(structSkipRefNumber); writeVarUint(encoder.restEncoder, this.length - offset); } /** * @param {Transaction} transaction * @param {StructStore} store * @return {null | number} */ getMissing(transaction, store2) { return null; } }; var glo = ( /** @type {any} */ typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {} ); var importIdentifier = "__ $YJS$ __"; if (glo[importIdentifier] === true) { console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438"); } glo[importIdentifier] = true; // packages/sync/node_modules/y-protocols/awareness.js var outdatedTimeout = 3e4; var Awareness = class extends Observable { /** * @param {Y.Doc} doc */ constructor(doc2) { super(); this.doc = doc2; this.clientID = doc2.clientID; this.states = /* @__PURE__ */ new Map(); this.meta = /* @__PURE__ */ new Map(); this._checkInterval = /** @type {any} */ setInterval(() => { const now = getUnixTime(); if (this.getLocalState() !== null && outdatedTimeout / 2 <= now - /** @type {{lastUpdated:number}} */ this.meta.get(this.clientID).lastUpdated) { this.setLocalState(this.getLocalState()); } const remove = []; this.meta.forEach((meta, clientid) => { if (clientid !== this.clientID && outdatedTimeout <= now - meta.lastUpdated && this.states.has(clientid)) { remove.push(clientid); } }); if (remove.length > 0) { removeAwarenessStates(this, remove, "timeout"); } }, floor(outdatedTimeout / 10)); doc2.on("destroy", () => { this.destroy(); }); this.setLocalState({}); } destroy() { this.emit("destroy", [this]); this.setLocalState(null); super.destroy(); clearInterval(this._checkInterval); } /** * @return {Object<string,any>|null} */ getLocalState() { return this.states.get(this.clientID) || null; } /** * @param {Object<string,any>|null} state */ setLocalState(state) { const clientID = this.clientID; const currLocalMeta = this.meta.get(clientID); const clock = currLocalMeta === void 0 ? 0 : currLocalMeta.clock + 1; const prevState = this.states.get(clientID); if (state === null) { this.states.delete(clientID); } else { this.states.set(clientID, state); } this.meta.set(clientID, { clock, lastUpdated: getUnixTime() }); const added = []; const updated = []; const filteredUpdated = []; const removed = []; if (state === null) { removed.push(clientID); } else if (prevState == null) { if (state != null) { added.push(clientID); } } else { updated.push(clientID); if (!equalityDeep(prevState, state)) { filteredUpdated.push(clientID); } } if (added.length > 0 || filteredUpdated.length > 0 || removed.length > 0) { this.emit("change", [{ added, updated: filteredUpdated, removed }, "local"]); } this.emit("update", [{ added, updated, removed }, "local"]); } /** * @param {string} field * @param {any} value */ setLocalStateField(field, value) { const state = this.getLocalState(); if (state !== null) { this.setLocalState({ ...state, [field]: value }); } } /** * @return {Map<number,Object<string,any>>} */ getStates() { return this.states; } }; var removeAwarenessStates = (awareness, clients, origin2) => { const removed = []; for (let i = 0; i < clients.length; i++) { const clientID = clients[i]; if (awareness.states.has(clientID)) { awareness.states.delete(clientID); if (clientID === awareness.clientID) { const curMeta = ( /** @type {MetaClientState} */ awareness.meta.get(clientID) ); awareness.meta.set(clientID, { clock: curMeta.clock + 1, lastUpdated: getUnixTime() }); } removed.push(clientID); } } if (removed.length > 0) { awareness.emit("change", [{ added: [], updated: [], removed }, origin2]); awareness.emit("update", [{ added: [], updated: [], removed }, origin2]); } }; // packages/sync/build-module/config.mjs var CRDT_DOC_VERSION = 1; var CRDT_DOC_META_PERSISTENCE_KEY = "fromPersistence"; var CRDT_RECORD_MAP_KEY = "document"; var CRDT_STATE_MAP_KEY = "state"; var CRDT_STATE_MAP_SAVED_AT_KEY = "savedAt"; var CRDT_STATE_MAP_SAVED_BY_KEY = "savedBy"; var CRDT_STATE_MAP_VERSION_KEY = "version"; var LOCAL_EDITOR_ORIGIN = "gutenberg"; var LOCAL_SYNC_MANAGER_ORIGIN = "syncManager"; var LOCAL_UNDO_IGNORED_ORIGIN = "gutenberg-undo-ignored"; // packages/sync/build-module/errors.mjs var ConnectionErrorCode = /* @__PURE__ */ ((ConnectionErrorCode22) => { ConnectionErrorCode22["AUTHENTICATION_FAILED"] = "authentication-failed"; ConnectionErrorCode22["CONNECTION_EXPIRED"] = "connection-expired"; ConnectionErrorCode22["CONNECTION_LIMIT_EXCEEDED"] = "connection-limit-exceeded"; ConnectionErrorCode22["DOCUMENT_SIZE_LIMIT_EXCEEDED"] = "document-size-limit-exceeded"; ConnectionErrorCode22["UNKNOWN_ERROR"] = "unknown-error"; return ConnectionErrorCode22; })(ConnectionErrorCode || {}); var ConnectionError = class extends Error { constructor(code = "unknown-error", message) { super(message); this.code = code; this.name = "ConnectionError"; } }; // packages/sync/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/sync" ); // packages/sync/build-module/performance.mjs function logPerformanceTiming(fn) { return function(...args2) { const start = performance.now(); const result = fn.apply(this, args2); const end = performance.now(); console.log( `[SyncManager][performance]: ${fn.name} took ${(end - start).toFixed(2)} ms` ); return result; }; } function passThru(fn) { return ((...args2) => fn(...args2)); } function yieldToEventLoop(fn) { return function(...args2) { setTimeout(() => { fn.apply(this, args2); }, 0); }; } // packages/sync/build-module/providers/index.mjs var import_hooks3 = __toESM(require_hooks(), 1); // packages/sync/build-module/providers/http-polling/polling-manager.mjs var import_hooks2 = __toESM(require_hooks(), 1); // packages/sync/node_modules/y-protocols/sync.js var messageYjsSyncStep1 = 0; var messageYjsSyncStep2 = 1; var messageYjsUpdate = 2; var writeSyncStep1 = (encoder, doc2) => { writeVarUint(encoder, messageYjsSyncStep1); const sv = encodeStateVector(doc2); writeVarUint8Array(encoder, sv); }; var writeSyncStep2 = (encoder, doc2, encodedStateVector) => { writeVarUint(encoder, messageYjsSyncStep2); writeVarUint8Array(encoder, encodeStateAsUpdate(doc2, encodedStateVector)); }; var readSyncStep1 = (decoder, encoder, doc2) => writeSyncStep2(encoder, doc2, readVarUint8Array(decoder)); var readSyncStep2 = (decoder, doc2, transactionOrigin, errorHandler) => { try { applyUpdate(doc2, readVarUint8Array(decoder), transactionOrigin); } catch (error) { if (errorHandler != null) errorHandler( /** @type {Error} */ error ); console.error("Caught error while handling a Yjs update", error); } }; var readUpdate2 = readSyncStep2; var readSyncMessage = (decoder, encoder, doc2, transactionOrigin, errorHandler) => { const messageType = readVarUint(decoder); switch (messageType) { case messageYjsSyncStep1: readSyncStep1(decoder, encoder, doc2); break; case messageYjsSyncStep2: readSyncStep2(decoder, doc2, transactionOrigin, errorHandler); break; case messageYjsUpdate: readUpdate2(decoder, doc2, transactionOrigin, errorHandler); break; default: throw new Error("Unknown message type"); } return messageType; }; // packages/sync/build-module/providers/http-polling/config.mjs var import_hooks = __toESM(require_hooks(), 1); var DEFAULT_CLIENT_LIMIT_PER_ROOM = 3; var ERROR_RETRY_DELAYS_SOLO_MS = [ 2e3, 4e3, 8e3, 12e3 // Solo: 26s total retry time solo before dialog ]; var ERROR_RETRY_DELAYS_WITH_COLLABORATORS_MS = [ 1e3, 2e3, 4e3, 8e3 // With collaborators: 15s total retry time before dialog ]; var DISCONNECT_DIALOG_RETRY_MS = 3e4; var MANUAL_RETRY_INTERVAL_MS = 15e3; var MAX_UPDATE_SIZE_IN_BYTES = 1 * 1024 * 1024; var MAX_ROOMS_PER_REQUEST = 50; var POLLING_INTERVAL_IN_MS = (0, import_hooks.applyFilters)( "sync.pollingManager.pollingInterval", 4e3 // 4 seconds ); var POLLING_INTERVAL_WITH_COLLABORATORS_IN_MS = (0, import_hooks.applyFilters)( "sync.pollingManager.pollingIntervalWithCollaborators", 1e3 // 1 second ); var POLLING_INTERVAL_BACKGROUND_TAB_IN_MS = 25 * 1e3; // packages/sync/build-module/providers/http-polling/types.mjs var SyncUpdateType = /* @__PURE__ */ ((SyncUpdateType2) => { SyncUpdateType2["COMPACTION"] = "compaction"; SyncUpdateType2["SYNC_STEP_1"] = "sync_step1"; SyncUpdateType2["SYNC_STEP_2"] = "sync_step2"; SyncUpdateType2["UPDATE"] = "update"; return SyncUpdateType2; })(SyncUpdateType || {}); // packages/sync/build-module/providers/http-polling/utils.mjs var import_api_fetch = __toESM(require_api_fetch(), 1); var SYNC_API_PATH = "/wp-sync/v1/updates"; function uint8ArrayToBase64(data) { let binary = ""; const len = data.byteLength; for (let i = 0; i < len; i++) { binary += String.fromCharCode(data[i]); } return globalThis.btoa(binary); } function base64ToUint8Array(base64) { const binaryString = globalThis.atob(base64); const len = binaryString.length; const bytes = new Uint8Array(len); for (let i = 0; i < len; i++) { bytes[i] = binaryString.charCodeAt(i); } return bytes; } function createSyncUpdate(data, type) { return { data: uint8ArrayToBase64(data), type }; } function createUpdateQueue(initial = [], paused = true) { let isPaused = paused; const updates = [...initial]; return { add(update) { updates.push(update); }, addBulk(bulkUpdates) { if (0 === bulkUpdates.length) { return; } updates.push(...bulkUpdates); }, clear() { updates.splice(0, updates.length); }, get() { if (isPaused) { return []; } return updates.splice(0, updates.length); }, pause() { isPaused = true; }, restore(restoredUpdates) { const filtered = restoredUpdates.filter( (u) => u.type !== SyncUpdateType.COMPACTION ); if (0 === filtered.length) { return; } updates.unshift(...filtered); }, resume() { isPaused = false; }, size() { return updates.length; } }; } async function postSyncUpdate(payload) { const response = await (0, import_api_fetch.default)({ body: JSON.stringify(payload), headers: { "Content-Type": "application/json" }, method: "POST", parse: false, path: SYNC_API_PATH }); if (!response.ok) { throw new Error( `Sync update failed with status ${response.status}` ); } return await response.json(); } function postSyncUpdateNonBlocking(payload) { if (payload.rooms.length === 0) { return; } (0, import_api_fetch.default)({ body: JSON.stringify(payload), headers: { "Content-Type": "application/json" }, keepalive: true, method: "POST", parse: false, path: SYNC_API_PATH }).catch(() => { }); } function intValueOrDefault(value, defaultValue) { const intValue = parseInt(String(value), 10); return isNaN(intValue) ? defaultValue : intValue; } function rotateWindow(items2, offset, size2) { if (items2.length === 0) { return { window: [], nextOffset: 0 }; } const start = (offset % items2.length + items2.length) % items2.length; const wrapped = [...items2.slice(start), ...items2.slice(0, start)]; return { window: wrapped.slice(0, Math.max(0, size2)), nextOffset: (start + Math.max(0, size2)) % items2.length }; } // packages/sync/build-module/providers/http-polling/polling-manager.mjs var POLLING_MANAGER_ORIGIN = "polling-manager"; function isForbiddenError(error) { return error?.data?.status === 403; } function identifyForbiddenRoom(error, rooms) { const message = typeof error.message === "string" ? error.message : ""; const sortedRooms = [...rooms].sort((a, b) => b.length - a.length); for (const room of sortedRooms) { if (message.includes(room)) { return room; } } return null; } function handleForbiddenError(error, requestedRooms) { const forbiddenRoom = identifyForbiddenRoom( error, requestedRooms.map((r) => r.room) ); if (forbiddenRoom) { const state = roomStates.get(forbiddenRoom); if (state) { state.log( "Permission denied, unregistering room", { error }, "error", true // force ); unregisterRoom(forbiddenRoom, { sendDisconnectSignal: false }); } for (const room of requestedRooms) { if (room.room === forbiddenRoom || !roomStates.has(room.room)) { continue; } const remainingState = roomStates.get(room.room); if (room.updates.length > 0) { remainingState.updateQueue.restore(room.updates); } } } else { const rooms = [...roomStates.keys()]; for (const room of rooms) { const state = roomStates.get(room); if (state) { state.log( "Permission denied, unregistering room", { error }, "error", true // force ); unregisterRoom(room, { sendDisconnectSignal: false }); } } } } var roomStates = /* @__PURE__ */ new Map(); function createDeprecatedCompactionUpdate(updates) { const mergeable = updates.filter( (u) => [SyncUpdateType.COMPACTION, SyncUpdateType.UPDATE].includes( u.type ) ).map((u) => base64ToUint8Array(u.data)); return createSyncUpdate( mergeUpdatesV2(mergeable), SyncUpdateType.COMPACTION ); } function createSyncStep1Update(doc2) { const encoder = createEncoder(); writeSyncStep1(encoder, doc2); return createSyncUpdate( toUint8Array(encoder), SyncUpdateType.SYNC_STEP_1 ); } function createSyncStep2Update(doc2, step1) { const decoder = createDecoder(step1); const encoder = createEncoder(); readSyncMessage( decoder, encoder, doc2, POLLING_MANAGER_ORIGIN ); return createSyncUpdate( toUint8Array(encoder), SyncUpdateType.SYNC_STEP_2 ); } function processAwarenessUpdate(state, awareness) { const currentStates = awareness.getStates(); const added = /* @__PURE__ */ new Set(); const updated = /* @__PURE__ */ new Set(); const removed = new Set( Array.from(currentStates.keys()).filter( (clientId) => !state[clientId] ) ); Object.entries(state).forEach(([clientIdString, awarenessState]) => { const clientId = Number(clientIdString); if (clientId === awareness.clientID) { return; } if (null === awarenessState) { currentStates.delete(clientId); removed.add(clientId); return; } if (!currentStates.has(clientId)) { currentStates.set(clientId, awarenessState); added.add(clientId); return; } const currentState = currentStates.get(clientId); if (JSON.stringify(currentState) !== JSON.stringify(awarenessState)) { currentStates.set(clientId, awarenessState); updated.add(clientId); } }); if (added.size + updated.size > 0) { awareness.emit("change", [ { added: Array.from(added), updated: Array.from(updated), // Left blank on purpose, as the removal of clients is handled in the if condition below. removed: [] } ]); } if (removed.size > 0) { removeAwarenessStates( awareness, Array.from(removed), POLLING_MANAGER_ORIGIN ); } } function processDocUpdate(update, doc2, onSync) { const data = base64ToUint8Array(update.data); switch (update.type) { case SyncUpdateType.SYNC_STEP_1: { return createSyncStep2Update(doc2, data); } case SyncUpdateType.SYNC_STEP_2: { const decoder = createDecoder(data); const encoder = createEncoder(); readSyncMessage( decoder, encoder, doc2, POLLING_MANAGER_ORIGIN ); onSync(); return; } case SyncUpdateType.COMPACTION: case SyncUpdateType.UPDATE: { applyUpdateV2(doc2, data, POLLING_MANAGER_ORIGIN); } } } function checkConnectionLimit(awareness, roomState) { if (!roomState.isPrimaryRoom || hasCheckedConnectionLimit) { return false; } hasCheckedConnectionLimit = true; const maxClientsPerRoom = (0, import_hooks2.applyFilters)( "sync.pollingProvider.maxClientsPerRoom", DEFAULT_CLIENT_LIMIT_PER_ROOM, roomState.room ); const clientCount = Object.keys(awareness).length; const validatedLimit = intValueOrDefault( maxClientsPerRoom, DEFAULT_CLIENT_LIMIT_PER_ROOM ); if (clientCount > validatedLimit) { roomState.log("Connection limit exceeded", { clientCount, maxClientsPerRoom: validatedLimit, room: roomState.room }); return true; } return false; } var areListenersRegistered = false; var consecutiveFailures = 0; var hasCheckedConnectionLimit = false; var isManualRetry = false; var hasCollaborators = false; var isActiveBrowser = "visible" === document.visibilityState; var isPolling = false; var isUnloadPending = false; var pollInterval = POLLING_INTERVAL_IN_MS; var pollingTimeoutId = null; var roomOverflowOffset = 0; function handleBeforeUnload() { isUnloadPending = true; } function handlePageHide() { const rooms = Array.from(roomStates.entries()).map( ([room, state]) => ({ after: 0, awareness: null, client_id: state.clientId, room, updates: [] }) ); for (let i = 0; i < rooms.length; i += MAX_ROOMS_PER_REQUEST) { postSyncUpdateNonBlocking({ rooms: rooms.slice(i, i + MAX_ROOMS_PER_REQUEST) }); } } function handleVisibilityChange() { const wasActive = isActiveBrowser; isActiveBrowser = document.visibilityState === "visible"; if (isActiveBrowser && !wasActive) { if (pollingTimeoutId) { clearTimeout(pollingTimeoutId); pollingTimeoutId = null; poll(); } } } function selectRoomsForRequest() { const allRooms = Array.from(roomStates.values()); if (allRooms.length <= MAX_ROOMS_PER_REQUEST) { return allRooms; } const primaryRoom = allRooms.find((state) => state.isPrimaryRoom); const overflowRooms = allRooms.filter((state) => state !== primaryRoom); const overflowSlotsPerRequest = MAX_ROOMS_PER_REQUEST - (primaryRoom ? 1 : 0); const { window: overflowSlice, nextOffset } = rotateWindow( overflowRooms, roomOverflowOffset, overflowSlotsPerRequest ); roomOverflowOffset = nextOffset; if (primaryRoom) { return [primaryRoom, ...overflowSlice]; } return overflowSlice; } function poll() { isPolling = true; pollingTimeoutId = null; async function start() { if (0 === roomStates.size) { isPolling = false; return; } isUnloadPending = false; const roomsInRequest = selectRoomsForRequest(); const payload = { rooms: roomsInRequest.map((state) => ({ after: state.endCursor ?? 0, awareness: state.localAwarenessState, client_id: state.clientId, room: state.room, updates: state.updateQueue.get() })) }; roomsInRequest.forEach((state) => { state.onStatusChange({ status: "connecting" }); }); try { const { rooms } = await postSyncUpdate(payload); consecutiveFailures = 0; isManualRetry = false; roomsInRequest.forEach((state) => { if (roomStates.get(state.room) !== state) { return; } state.onStatusChange({ status: "connected" }); }); hasCollaborators = false; rooms.forEach((room) => { if (!roomStates.has(room.room)) { return; } const roomState = roomStates.get(room.room); roomState.endCursor = room.end_cursor; if (checkConnectionLimit(room.awareness, roomState)) { roomState.onStatusChange({ status: "disconnected", error: new ConnectionError( ConnectionErrorCode.CONNECTION_LIMIT_EXCEEDED, "Connection limit exceeded" ) }); unregisterRoom(room.room); return; } roomState.processAwarenessUpdate(room.awareness); if (roomState.isPrimaryRoom && Object.keys(room.awareness).length > 1) { hasCollaborators = true; roomStates.forEach((state) => { state.updateQueue.resume(); }); } const responseUpdates = []; for (const update of room.updates) { try { const response = roomState.processDocUpdate(update); if (response) { responseUpdates.push(response); } } catch (error) { roomState.log( "Failed to apply sync update", { error, update }, "error", true // force ); } } roomState.updateQueue.addBulk(responseUpdates); if (room.should_compact) { roomState.log("Server requested compaction update"); roomState.updateQueue.clear(); roomState.updateQueue.add( roomState.createCompactionUpdate() ); } else if (room.compaction_request) { roomState.log("Server requested (old) compaction update"); roomState.updateQueue.add( createDeprecatedCompactionUpdate( room.compaction_request ) ); } }); if (isActiveBrowser && hasCollaborators) { pollInterval = POLLING_INTERVAL_WITH_COLLABORATORS_IN_MS; } else if (isActiveBrowser) { pollInterval = POLLING_INTERVAL_IN_MS; } else { pollInterval = POLLING_INTERVAL_BACKGROUND_TAB_IN_MS; } } catch (error) { if (isForbiddenError(error)) { handleForbiddenError(error, payload.rooms); if (roomStates.size === 0) { isPolling = false; return; } } else { consecutiveFailures++; const retrySchedule = hasCollaborators ? ERROR_RETRY_DELAYS_WITH_COLLABORATORS_MS : ERROR_RETRY_DELAYS_SOLO_MS; if (consecutiveFailures <= retrySchedule.length) { pollInterval = retrySchedule[consecutiveFailures - 1]; } else { pollInterval = DISCONNECT_DIALOG_RETRY_MS; } if (isManualRetry) { pollInterval = MANUAL_RETRY_INTERVAL_MS; isManualRetry = false; } for (const room of payload.rooms) { if (!roomStates.has(room.room)) { continue; } const state = roomStates.get(room.room); if (room.updates.length > 0 && state.endCursor > 0) { state.updateQueue.clear(); state.updateQueue.add(state.createCompactionUpdate()); } else if (room.updates.length > 0) { state.updateQueue.restore(room.updates); } state.log( "Error posting sync update, will retry with backoff", { error, nextPoll: pollInterval }, "error", true // force ); } if (!isUnloadPending) { const backgroundRetriesFailed = consecutiveFailures > retrySchedule.length; roomsInRequest.forEach((state) => { if (roomStates.get(state.room) !== state) { return; } state.onStatusChange({ status: "disconnected", canManuallyRetry: true, consecutiveFailures, backgroundRetriesFailed, willAutoRetryInMs: pollInterval }); }); } } } pollingTimeoutId = setTimeout(poll, pollInterval); } void start(); } function registerRoom({ room, doc: doc2, awareness, log, onSync, onStatusChange }) { if (roomStates.has(room)) { return; } const updateQueue = createUpdateQueue([createSyncStep1Update(doc2)]); const isPrimaryRoom = 0 === roomStates.size; function onAwarenessUpdate() { roomState.localAwarenessState = awareness.getLocalState() ?? {}; } function onDocUpdate(update, origin2) { if (POLLING_MANAGER_ORIGIN === origin2) { return; } if (update.byteLength > MAX_UPDATE_SIZE_IN_BYTES) { const state = roomStates.get(room); if (!state) { return; } state.log("Document size limit exceeded", { maxUpdateSizeInBytes: MAX_UPDATE_SIZE_IN_BYTES, updateSizeInBytes: update.byteLength }); state.onStatusChange({ status: "disconnected", error: new ConnectionError( ConnectionErrorCode.DOCUMENT_SIZE_LIMIT_EXCEEDED, "Document size limit exceeded" ) }); unregisterRoom(room); } updateQueue.add(createSyncUpdate(update, SyncUpdateType.UPDATE)); } function unregister() { doc2.off("updateV2", onDocUpdate); awareness.off("change", onAwarenessUpdate); updateQueue.clear(); } const roomState = { clientId: doc2.clientID, createCompactionUpdate: () => createSyncUpdate( encodeStateAsUpdateV2(doc2), SyncUpdateType.COMPACTION ), endCursor: 0, isPrimaryRoom, localAwarenessState: awareness.getLocalState() ?? {}, log, onStatusChange, processAwarenessUpdate: (state) => processAwarenessUpdate(state, awareness), processDocUpdate: (update) => processDocUpdate(update, doc2, onSync), room, unregister, updateQueue }; doc2.on("updateV2", onDocUpdate); awareness.on("change", onAwarenessUpdate); roomStates.set(room, roomState); if (!areListenersRegistered) { window.addEventListener("beforeunload", handleBeforeUnload); window.addEventListener("pagehide", handlePageHide); document.addEventListener("visibilitychange", handleVisibilityChange); areListenersRegistered = true; } if (!isPolling) { poll(); } } function unregisterRoom(room, { sendDisconnectSignal = true } = {}) { const state = roomStates.get(room); if (state) { if (sendDisconnectSignal) { const rooms = [ { after: 0, awareness: null, client_id: state.clientId, room, updates: [] } ]; postSyncUpdateNonBlocking({ rooms }); } state.unregister(); roomStates.delete(room); } if (0 === roomStates.size && areListenersRegistered) { window.removeEventListener("beforeunload", handleBeforeUnload); window.removeEventListener("pagehide", handlePageHide); document.removeEventListener( "visibilitychange", handleVisibilityChange ); areListenersRegistered = false; hasCheckedConnectionLimit = false; consecutiveFailures = 0; roomOverflowOffset = 0; } } function retryNow() { isManualRetry = true; if (pollingTimeoutId) { clearTimeout(pollingTimeoutId); pollingTimeoutId = null; poll(); } } var pollingManager = { registerRoom, retryNow, unregisterRoom }; // packages/sync/build-module/providers/http-polling/http-polling-provider.mjs var HttpPollingProvider = class extends ObservableV2 { constructor(options) { super(); this.options = options; this.log("Initializing", { room: options.room }); this.awareness = options.awareness ?? new Awareness(options.ydoc); this.connect(); } awareness; status = "disconnected"; synced = false; /** * Connect to the endpoint and initialize sync. */ connect() { this.log("Connecting"); pollingManager.registerRoom({ room: this.options.room, doc: this.options.ydoc, awareness: this.awareness, log: this.log, onStatusChange: this.emitStatus, onSync: this.onSync }); } /** * Destroy the provider and cleanup resources. */ destroy() { this.disconnect(); super.destroy(); } /** * Disconnect the provider and allow reconnection later. */ disconnect() { this.log("Disconnecting"); pollingManager.unregisterRoom(this.options.room); this.emitStatus({ status: "disconnected" }); } /** * Emit connection status, passing the full object through so that * additional fields (e.g. `willAutoRetryInMs`) are preserved for consumers. * * @param connectionStatus The connection status object */ emitStatus = (connectionStatus) => { const { status } = connectionStatus; const error = status === "disconnected" ? connectionStatus.error : void 0; if (this.status === status && !error) { return; } if (status === "connecting" && this.status !== "disconnected") { return; } this.log("Status change", { status, error }); this.status = status; this.emit("status", [connectionStatus]); }; /** * Log debug messages if debugging is enabled. * * @param message The debug message * @param debug Additional debug information * @param errorLevel The console method to use for logging * @param force Whether to force logging regardless of debug setting */ log = (message, debug = {}, errorLevel = "log", force = false) => { if (!this.options.debug && !force) { return; } const logFn = console[errorLevel] || console.log; logFn(`[${this.constructor.name}]: ${message}`, { room: this.options.room, ...debug }); }; /** * Handle synchronization events from the polling manager. */ onSync = () => { if (!this.synced) { this.synced = true; this.log("Synced"); } }; }; function createHttpPollingProvider() { return async ({ awareness, objectType, objectId, ydoc }) => { const room = objectId ? `${objectType}:${objectId}` : objectType; const provider = new HttpPollingProvider({ awareness, // debug: true, room, ydoc }); return { destroy: () => provider.destroy(), // Adapter: ObservableV2.on is compatible with ProviderOn // The callback receives data as the first parameter on: (event, callback) => { provider.on(event, callback); } }; }; } // packages/sync/build-module/providers/index.mjs var providerCreators = null; function getDefaultProviderCreators() { return [createHttpPollingProvider()]; } function isProviderCreator(creator) { return "function" === typeof creator; } function getProviderCreators() { if (providerCreators) { return providerCreators; } if (!window._wpCollaborationEnabled) { return []; } const filteredProviderCreators = (0, import_hooks3.applyFilters)( "sync.providers", getDefaultProviderCreators() ); if (!Array.isArray(filteredProviderCreators)) { providerCreators = []; return providerCreators; } providerCreators = filteredProviderCreators.filter(isProviderCreator); return providerCreators; } // packages/sync/build-module/y-utilities/y-multidoc-undomanager.mjs var popStackItem2 = (mum, type) => { const stack = type === "undo" ? mum.undoStack : mum.redoStack; while (stack.length > 0) { const um = ( /** @type {Y.UndoManager} */ stack.pop() ); const prevUmStack = type === "undo" ? um.undoStack : um.redoStack; const stackItem = ( /** @type {any} */ prevUmStack.pop() ); let actionPerformed = false; if (type === "undo") { um.undoStack = [stackItem]; actionPerformed = um.undo() !== null; um.undoStack = prevUmStack; } else { um.redoStack = [stackItem]; actionPerformed = um.redo() !== null; um.redoStack = prevUmStack; } if (actionPerformed) { return stackItem; } } return null; }; var YMultiDocUndoManager = class extends Observable { /** * @param {Y.AbstractType<any>|Array<Y.AbstractType<any>>} typeScope Accepts either a single type, or an array of types * @param {ConstructorParameters<typeof Y.UndoManager>[1]} opts */ constructor(typeScope = [], opts = {}) { super(); this.docs = /* @__PURE__ */ new Map(); this.trackedOrigins = opts.trackedOrigins || /* @__PURE__ */ new Set([null]); opts.trackedOrigins = this.trackedOrigins; this._defaultOpts = opts; this.undoStack = []; this.redoStack = []; this.addToScope(typeScope); } /** * @param {Array<Y.AbstractType<any>> | Y.AbstractType<any>} ytypes */ addToScope(ytypes) { ytypes = isArray(ytypes) ? ytypes : [ytypes]; ytypes.forEach((ytype) => { const ydoc = ( /** @type {Y.Doc} */ ytype.doc ); const um = setIfUndefined(this.docs, ydoc, () => { const um2 = new UndoManager([ytype], this._defaultOpts); um2.on( "stack-cleared", /** @param {any} opts */ ({ undoStackCleared, redoStackCleared }) => { this.clear(undoStackCleared, redoStackCleared); } ); ydoc.on("destroy", () => { this.docs.delete(ydoc); this.undoStack = this.undoStack.filter( (um3) => um3.doc !== ydoc ); this.redoStack = this.redoStack.filter( (um3) => um3.doc !== ydoc ); }); um2.on( "stack-item-added", /** @param {any} change */ (change) => { const stack = change.type === "undo" ? this.undoStack : this.redoStack; stack.push(um2); this.emit("stack-item-added", [ { ...change, ydoc }, this ]); } ); um2.on( "stack-item-updated", /** @param {any} change */ (change) => { this.emit("stack-item-updated", [ { ...change, ydoc }, this ]); } ); um2.on( "stack-item-popped", /** @param {any} change */ (change) => { this.emit("stack-item-popped", [ { ...change, ydoc }, this ]); } ); return um2; }); if (um.scope.every((yt) => yt !== ytype)) { um.scope.push(ytype); } }); } /** * @param {any} origin */ /* c8 ignore next 3 */ addTrackedOrigin(origin2) { this.trackedOrigins.add(origin2); } /** * @param {any} origin */ /* c8 ignore next 3 */ removeTrackedOrigin(origin2) { this.trackedOrigins.delete(origin2); } /** * Undo last changes on type. * * @return {any?} Returns StackItem if a change was applied */ undo() { return popStackItem2(this, "undo"); } /** * Redo last undo operation. * * @return {any?} Returns StackItem if a change was applied */ redo() { return popStackItem2(this, "redo"); } clear(clearUndoStack = true, clearRedoStack = true) { if (clearUndoStack && this.canUndo() || clearRedoStack && this.canRedo()) { this.docs.forEach((um) => { clearUndoStack && (this.undoStack = []); clearRedoStack && (this.redoStack = []); um.clear(clearUndoStack, clearRedoStack); }); this.emit("stack-cleared", [ { undoStackCleared: clearUndoStack, redoStackCleared: clearRedoStack } ]); } } /* c8 ignore next 5 */ stopCapturing() { this.docs.forEach((um) => { um.stopCapturing(); }); } /** * Are undo steps available? * * @return {boolean} `true` if undo is possible */ canUndo() { return this.undoStack.length > 0; } /** * Are redo steps available? * * @return {boolean} `true` if redo is possible */ canRedo() { return this.redoStack.length > 0; } destroy() { this.docs.forEach((um) => um.destroy()); super.destroy(); } }; // packages/sync/build-module/undo-manager.mjs function createUndoManager() { const yUndoManager = new YMultiDocUndoManager([], { // Throttle undo/redo captures after 500ms of inactivity. // 500 was selected from subjective local UX testing, shorter timeouts // may cause mid-word undo stack items. captureTimeout: 500, // Ensure that we only scope the undo/redo to the current editor. // The yjs document's clientID is added once it's available. trackedOrigins: /* @__PURE__ */ new Set([LOCAL_EDITOR_ORIGIN]) }); return { /** * Record changes into the history. * Since Yjs automatically tracks changes, this method translates the WordPress * HistoryRecord format into Yjs operations. * * @param _record A record of changes to record. * @param _isStaged Whether to immediately create an undo point or not. */ addRecord(_record, _isStaged = false) { }, /** * Add a Yjs map to the scope of the undo manager. * * @param {Y.Map< any >} ymap The Yjs map to add to the scope. * @param handlers * @param handlers.addUndoMeta * @param handlers.restoreUndoMeta */ addToScope(ymap, handlers) { if (ymap.doc === null) { return; } const ydoc = ymap.doc; yUndoManager.addToScope(ymap); const { addUndoMeta, restoreUndoMeta } = handlers; yUndoManager.on("stack-item-added", (event) => { addUndoMeta(ydoc, event.stackItem.meta); }); yUndoManager.on("stack-item-popped", (event) => { restoreUndoMeta(ydoc, event.stackItem.meta); }); }, /** * Undo the last recorded changes. * */ undo() { if (!yUndoManager.canUndo()) { return; } yUndoManager.undo(); return []; }, /** * Redo the last undone changes. */ redo() { if (!yUndoManager.canRedo()) { return; } yUndoManager.redo(); return []; }, /** * Check if there are changes that can be undone. * * @return {boolean} Whether there are changes to undo. */ hasUndo() { return yUndoManager.canUndo(); }, /** * Check if there are changes that can be redone. * * @return {boolean} Whether there are changes to redo. */ hasRedo() { return yUndoManager.canRedo(); }, /** * Stop capturing changes into the current undo item. * The next change will create a new undo item. */ stopCapturing() { yUndoManager.stopCapturing(); } }; } // packages/sync/build-module/utils.mjs function createYjsDoc(documentMeta = {}) { const metaMap = new Map( Object.entries(documentMeta) ); return new Doc({ meta: metaMap }); } function initializeYjsDoc(ydoc) { const stateMap = ydoc.getMap(CRDT_STATE_MAP_KEY); stateMap.set(CRDT_STATE_MAP_VERSION_KEY, CRDT_DOC_VERSION); } function markEntityAsSaved(ydoc) { const recordMeta = ydoc.getMap(CRDT_STATE_MAP_KEY); recordMeta.set(CRDT_STATE_MAP_SAVED_AT_KEY, Date.now()); recordMeta.set(CRDT_STATE_MAP_SAVED_BY_KEY, ydoc.clientID); } function pseudoRandomID() { return Math.floor(Math.random() * 1e9); } function serializeCrdtDoc(crdtDoc) { return JSON.stringify({ document: toBase64(encodeStateAsUpdateV2(crdtDoc)), updateId: pseudoRandomID() // helps with debugging }); } function deserializeCrdtDoc(serializedCrdtDoc) { try { const { document: document2 } = JSON.parse(serializedCrdtDoc); const docMeta = { [CRDT_DOC_META_PERSISTENCE_KEY]: true }; const ydoc = createYjsDoc(docMeta); const yupdate = fromBase64(document2); applyUpdateV2(ydoc, yupdate); ydoc.clientID = pseudoRandomID(); return ydoc; } catch (e) { return null; } } // packages/sync/build-module/manager.mjs function getEntityId(objectType, objectId) { return `${objectType}_${objectId}`; } function createSyncManager(debug = false) { const debugWrap = debug ? logPerformanceTiming : passThru; const collectionStates = /* @__PURE__ */ new Map(); const entityStates = /* @__PURE__ */ new Map(); let undoManager2; function log(component, message, entityId, context = {}) { if (!debug) { return; } console.log(`[SyncManager][${component}]: ${message}`, { ...context, entityId }); } async function loadEntity(syncConfig, objectType, objectId, record, handlers) { const providerCreators2 = getProviderCreators(); const entityId = getEntityId(objectType, objectId); if (0 === providerCreators2.length) { log("loadEntity", "no providers, skipping", entityId); return; } if (entityStates.has(entityId)) { log("loadEntity", "already loaded", entityId); return; } if (false === syncConfig.shouldSync?.(objectType, objectId)) { log("loadEntity", "shouldSync false, skipping", entityId); return; } log("loadEntity", "loading", entityId); handlers = { addUndoMeta: debugWrap(handlers.addUndoMeta), editRecord: debugWrap(handlers.editRecord), getEditedRecord: debugWrap(handlers.getEditedRecord), onStatusChange: debugWrap(handlers.onStatusChange), persistCRDTDoc: debugWrap(handlers.persistCRDTDoc), refetchRecord: debugWrap(handlers.refetchRecord), restoreUndoMeta: debugWrap(handlers.restoreUndoMeta) }; const ydoc = createYjsDoc({ objectType }); const recordMap = ydoc.getMap(CRDT_RECORD_MAP_KEY); const stateMap = ydoc.getMap(CRDT_STATE_MAP_KEY); const now = Date.now(); const unload = () => { log("loadEntity", "unloading", entityId); providerResults.forEach((result) => result.destroy()); handlers.onStatusChange(null); recordMap.unobserveDeep(onRecordUpdate); stateMap.unobserve(onStateMapUpdate); ydoc.destroy(); entityStates.delete(entityId); }; const awareness = syncConfig.createAwareness?.(ydoc, objectId); const onRecordUpdate = (_events, transaction) => { if (transaction.local && !(transaction.origin instanceof UndoManager)) { return; } void internal.updateEntityRecord(objectType, objectId); }; const onStateMapUpdate = (event, transaction) => { if (transaction.local) { return; } event.keysChanged.forEach((key) => { switch (key) { case CRDT_STATE_MAP_SAVED_AT_KEY: const newValue = stateMap.get(CRDT_STATE_MAP_SAVED_AT_KEY); if ("number" === typeof newValue && newValue > now) { log("loadEntity", "refetching record", entityId); void handlers.refetchRecord().catch(() => { }); } break; } }); }; if (!undoManager2) { undoManager2 = createUndoManager(); } const { addUndoMeta, restoreUndoMeta } = handlers; undoManager2.addToScope(recordMap, { addUndoMeta, restoreUndoMeta }); const entityState = { awareness, handlers, objectId, objectType, syncConfig, unload, ydoc }; entityStates.set(entityId, entityState); log("loadEntity", "connecting", entityId); const providerResults = await Promise.all( providerCreators2.map(async (create9) => { const provider = await create9({ objectType, objectId, ydoc, awareness }); provider.on("status", handlers.onStatusChange); return provider; }) ); recordMap.observeDeep(onRecordUpdate); stateMap.observe(onStateMapUpdate); initializeYjsDoc(ydoc); internal.applyPersistedCrdtDoc(objectType, objectId, record); } async function loadCollection(syncConfig, objectType, handlers) { const providerCreators2 = getProviderCreators(); const entityId = getEntityId(objectType, null); if (0 === providerCreators2.length) { log("loadCollection", "no providers, skipping", entityId); return; } if (collectionStates.has(objectType)) { log("loadCollection", "already loaded", entityId); return; } if (false === syncConfig.shouldSync?.(objectType, null)) { log("loadCollection", "shouldSync false, skipping", entityId); return; } log("loadCollection", "loading", entityId); const ydoc = createYjsDoc({ collection: true, objectType }); const stateMap = ydoc.getMap(CRDT_STATE_MAP_KEY); const now = Date.now(); const unload = () => { log("loadCollection", "unloading", entityId); providerResults.forEach((result) => result.destroy()); handlers.onStatusChange(null); stateMap.unobserve(onStateMapUpdate); ydoc.destroy(); collectionStates.delete(objectType); }; const onStateMapUpdate = (event, transaction) => { if (transaction.local) { return; } event.keysChanged.forEach((key) => { switch (key) { case CRDT_STATE_MAP_SAVED_AT_KEY: const newValue = stateMap.get(CRDT_STATE_MAP_SAVED_AT_KEY); if ("number" === typeof newValue && newValue > now) { void handlers.refetchRecords().catch(() => { }); } break; } }); }; const awareness = syncConfig.createAwareness?.(ydoc); const collectionState = { awareness, handlers, syncConfig, unload, ydoc }; collectionStates.set(objectType, collectionState); log("loadCollection", "connecting", entityId); const providerResults = await Promise.all( providerCreators2.map(async (create9) => { const provider = await create9({ awareness, objectType, objectId: null, ydoc }); provider.on("status", handlers.onStatusChange); return provider; }) ); stateMap.observe(onStateMapUpdate); initializeYjsDoc(ydoc); } function unloadEntity(objectType, objectId) { const entityId = getEntityId(objectType, objectId); log("unloadEntity", "unloading", entityId); entityStates.get(entityId)?.unload(); updateCRDTDoc(objectType, null, {}, origin, { isSave: true }); } function getAwareness(objectType, objectId) { const entityId = getEntityId(objectType, objectId); const entityState = entityStates.get(entityId); if (!entityState || !entityState.awareness) { return void 0; } return entityState.awareness; } function _applyPersistedCrdtDoc(objectType, objectId, record) { const entityId = getEntityId(objectType, objectId); const entityState = entityStates.get(entityId); if (!entityState) { log("applyPersistedCrdtDoc", "no entity state", entityId); return; } const { handlers, syncConfig: { applyChangesToCRDTDoc, getChangesFromCRDTDoc, getPersistedCRDTDoc }, ydoc: targetDoc } = entityState; const serialized = getPersistedCRDTDoc?.(record); const tempDoc = serialized ? deserializeCrdtDoc(serialized) : null; if (!tempDoc) { log("applyPersistedCrdtDoc", "no persisted doc", entityId); targetDoc.transact(() => { applyChangesToCRDTDoc(targetDoc, record); handlers.persistCRDTDoc(); }, LOCAL_SYNC_MANAGER_ORIGIN); return; } const update = encodeStateAsUpdateV2(tempDoc); applyUpdateV2(targetDoc, update); const invalidations = getChangesFromCRDTDoc(tempDoc, record); const invalidatedKeys = Object.keys(invalidations); tempDoc.destroy(); if (0 === invalidatedKeys.length) { log("applyPersistedCrdtDoc", "valid persisted doc", entityId); return; } log("applyPersistedCrdtDoc", "invalidated keys", entityId, { invalidatedKeys }); const changes = invalidatedKeys.reduce( (acc, key) => Object.assign(acc, { [key]: record[key] }), {} ); targetDoc.transact(() => { applyChangesToCRDTDoc(targetDoc, changes); handlers.persistCRDTDoc(); }, LOCAL_SYNC_MANAGER_ORIGIN); } function updateCRDTDoc(objectType, objectId, changes, origin2, options = {}) { const { isSave = false, isNewUndoLevel = false } = options; const entityId = getEntityId(objectType, objectId); const entityState = entityStates.get(entityId); const collectionState = collectionStates.get(objectType); if (entityState) { const { syncConfig, ydoc } = entityState; if (isNewUndoLevel && undoManager2) { undoManager2.stopCapturing?.(); } ydoc.transact(() => { log("updateCRDTDoc", "applying changes", entityId, { changedKeys: Object.keys(changes) }); syncConfig.applyChangesToCRDTDoc(ydoc, changes); if (isSave) { markEntityAsSaved(ydoc); } }, origin2); } if (collectionState && isSave) { collectionState.ydoc.transact(() => { markEntityAsSaved(collectionState.ydoc); }, origin2); } } async function _updateEntityRecord(objectType, objectId) { const entityId = getEntityId(objectType, objectId); const entityState = entityStates.get(entityId); if (!entityState) { log("updateEntityRecord", "no entity state", entityId); return; } const { handlers, syncConfig, ydoc } = entityState; const changes = syncConfig.getChangesFromCRDTDoc( ydoc, await handlers.getEditedRecord() ); const changedKeys = Object.keys(changes); if (0 === changedKeys.length) { return; } log("updateEntityRecord", "changes", entityId, { changedKeys }); handlers.editRecord(changes); } async function createPersistedCRDTDoc(objectType, objectId) { const entityId = getEntityId(objectType, objectId); const entityState = entityStates.get(entityId); if (!entityState?.ydoc) { return null; } await new Promise((resolve) => setTimeout(resolve, 0)); return serializeCrdtDoc(entityState.ydoc); } const internal = { applyPersistedCrdtDoc: debugWrap(_applyPersistedCrdtDoc), updateEntityRecord: debugWrap(_updateEntityRecord) }; return { createPersistedCRDTDoc: debugWrap(createPersistedCRDTDoc), getAwareness, load: debugWrap(loadEntity), loadCollection: debugWrap(loadCollection), // Use getter to ensure we always return the current value of `undoManager`. get undoManager() { return undoManager2; }, unload: debugWrap(unloadEntity), update: debugWrap(yieldToEventLoop(updateCRDTDoc)) }; } // packages/sync/node_modules/diff/libesm/diff/base.js var Diff = class { diff(oldStr, newStr, options = {}) { let callback; if (typeof options === "function") { callback = options; options = {}; } else if ("callback" in options) { callback = options.callback; } const oldString = this.castInput(oldStr, options); const newString = this.castInput(newStr, options); const oldTokens = this.removeEmpty(this.tokenize(oldString, options)); const newTokens = this.removeEmpty(this.tokenize(newString, options)); return this.diffWithOptionsObj(oldTokens, newTokens, options, callback); } diffWithOptionsObj(oldTokens, newTokens, options, callback) { var _a; const done = (value) => { value = this.postProcess(value, options); if (callback) { setTimeout(function() { callback(value); }, 0); return void 0; } else { return value; } }; const newLen = newTokens.length, oldLen = oldTokens.length; let editLength = 1; let maxEditLength = newLen + oldLen; if (options.maxEditLength != null) { maxEditLength = Math.min(maxEditLength, options.maxEditLength); } const maxExecutionTime = (_a = options.timeout) !== null && _a !== void 0 ? _a : Infinity; const abortAfterTimestamp = Date.now() + maxExecutionTime; const bestPath = [{ oldPos: -1, lastComponent: void 0 }]; let newPos = this.extractCommon(bestPath[0], newTokens, oldTokens, 0, options); if (bestPath[0].oldPos + 1 >= oldLen && newPos + 1 >= newLen) { return done(this.buildValues(bestPath[0].lastComponent, newTokens, oldTokens)); } let minDiagonalToConsider = -Infinity, maxDiagonalToConsider = Infinity; const execEditLength = () => { for (let diagonalPath = Math.max(minDiagonalToConsider, -editLength); diagonalPath <= Math.min(maxDiagonalToConsider, editLength); diagonalPath += 2) { let basePath; const removePath = bestPath[diagonalPath - 1], addPath = bestPath[diagonalPath + 1]; if (removePath) { bestPath[diagonalPath - 1] = void 0; } let canAdd = false; if (addPath) { const addPathNewPos = addPath.oldPos - diagonalPath; canAdd = addPath && 0 <= addPathNewPos && addPathNewPos < newLen; } const canRemove = removePath && removePath.oldPos + 1 < oldLen; if (!canAdd && !canRemove) { bestPath[diagonalPath] = void 0; continue; } if (!canRemove || canAdd && removePath.oldPos < addPath.oldPos) { basePath = this.addToPath(addPath, true, false, 0, options); } else { basePath = this.addToPath(removePath, false, true, 1, options); } newPos = this.extractCommon(basePath, newTokens, oldTokens, diagonalPath, options); if (basePath.oldPos + 1 >= oldLen && newPos + 1 >= newLen) { return done(this.buildValues(basePath.lastComponent, newTokens, oldTokens)) || true; } else { bestPath[diagonalPath] = basePath; if (basePath.oldPos + 1 >= oldLen) { maxDiagonalToConsider = Math.min(maxDiagonalToConsider, diagonalPath - 1); } if (newPos + 1 >= newLen) { minDiagonalToConsider = Math.max(minDiagonalToConsider, diagonalPath + 1); } } } editLength++; }; if (callback) { (function exec() { setTimeout(function() { if (editLength > maxEditLength || Date.now() > abortAfterTimestamp) { return callback(void 0); } if (!execEditLength()) { exec(); } }, 0); })(); } else { while (editLength <= maxEditLength && Date.now() <= abortAfterTimestamp) { const ret = execEditLength(); if (ret) { return ret; } } } } addToPath(path, added, removed, oldPosInc, options) { const last2 = path.lastComponent; if (last2 && !options.oneChangePerToken && last2.added === added && last2.removed === removed) { return { oldPos: path.oldPos + oldPosInc, lastComponent: { count: last2.count + 1, added, removed, previousComponent: last2.previousComponent } }; } else { return { oldPos: path.oldPos + oldPosInc, lastComponent: { count: 1, added, removed, previousComponent: last2 } }; } } extractCommon(basePath, newTokens, oldTokens, diagonalPath, options) { const newLen = newTokens.length, oldLen = oldTokens.length; let oldPos = basePath.oldPos, newPos = oldPos - diagonalPath, commonCount = 0; while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(oldTokens[oldPos + 1], newTokens[newPos + 1], options)) { newPos++; oldPos++; commonCount++; if (options.oneChangePerToken) { basePath.lastComponent = { count: 1, previousComponent: basePath.lastComponent, added: false, removed: false }; } } if (commonCount && !options.oneChangePerToken) { basePath.lastComponent = { count: commonCount, previousComponent: basePath.lastComponent, added: false, removed: false }; } basePath.oldPos = oldPos; return newPos; } equals(left, right, options) { if (options.comparator) { return options.comparator(left, right); } else { return left === right || !!options.ignoreCase && left.toLowerCase() === right.toLowerCase(); } } removeEmpty(array) { const ret = []; for (let i = 0; i < array.length; i++) { if (array[i]) { ret.push(array[i]); } } return ret; } // eslint-disable-next-line @typescript-eslint/no-unused-vars castInput(value, options) { return value; } // eslint-disable-next-line @typescript-eslint/no-unused-vars tokenize(value, options) { return Array.from(value); } join(chars) { return chars.join(""); } postProcess(changeObjects, options) { return changeObjects; } get useLongestToken() { return false; } buildValues(lastComponent, newTokens, oldTokens) { const components = []; let nextComponent; while (lastComponent) { components.push(lastComponent); nextComponent = lastComponent.previousComponent; delete lastComponent.previousComponent; lastComponent = nextComponent; } components.reverse(); const componentLen = components.length; let componentPos = 0, newPos = 0, oldPos = 0; for (; componentPos < componentLen; componentPos++) { const component = components[componentPos]; if (!component.removed) { if (!component.added && this.useLongestToken) { let value = newTokens.slice(newPos, newPos + component.count); value = value.map(function(value2, i) { const oldValue = oldTokens[oldPos + i]; return oldValue.length > value2.length ? oldValue : value2; }); component.value = this.join(value); } else { component.value = this.join(newTokens.slice(newPos, newPos + component.count)); } newPos += component.count; if (!component.added) { oldPos += component.count; } } else { component.value = this.join(oldTokens.slice(oldPos, oldPos + component.count)); oldPos += component.count; } } return components; } }; // packages/sync/node_modules/diff/libesm/diff/character.js var CharacterDiff = class extends Diff { }; var characterDiff = new CharacterDiff(); function diffChars(oldStr, newStr, options) { return characterDiff.diff(oldStr, newStr, options); } // packages/sync/node_modules/diff/libesm/diff/line.js var LineDiff = class extends Diff { constructor() { super(...arguments); this.tokenize = tokenize; } equals(left, right, options) { if (options.ignoreWhitespace) { if (!options.newlineIsToken || !left.includes("\n")) { left = left.trim(); } if (!options.newlineIsToken || !right.includes("\n")) { right = right.trim(); } } else if (options.ignoreNewlineAtEof && !options.newlineIsToken) { if (left.endsWith("\n")) { left = left.slice(0, -1); } if (right.endsWith("\n")) { right = right.slice(0, -1); } } return super.equals(left, right, options); } }; var lineDiff = new LineDiff(); function diffLines(oldStr, newStr, options) { return lineDiff.diff(oldStr, newStr, options); } function tokenize(value, options) { if (options.stripTrailingCr) { value = value.replace(/\r\n/g, "\n"); } const retLines = [], linesAndNewlines = value.split(/(\n|\r\n)/); if (!linesAndNewlines[linesAndNewlines.length - 1]) { linesAndNewlines.pop(); } for (let i = 0; i < linesAndNewlines.length; i++) { const line = linesAndNewlines[i]; if (i % 2 && !options.newlineIsToken) { retLines[retLines.length - 1] += line; } else { retLines.push(line); } } return retLines; } // packages/sync/build-module/quill-delta/Delta.mjs var import_es63 = __toESM(require_es6(), 1); // packages/sync/build-module/quill-delta/AttributeMap.mjs var import_es62 = __toESM(require_es6(), 1); function cloneDeep(value) { return JSON.parse(JSON.stringify(value)); } var AttributeMap; ((AttributeMap2) => { function compose3(a = {}, b = {}, keepNull = false) { if (typeof a !== "object") { a = {}; } if (typeof b !== "object") { b = {}; } let attributes = cloneDeep(b); if (!keepNull) { attributes = Object.keys(attributes).reduce( (copy2, key) => { if (attributes[key] !== null || attributes[key] !== void 0) { copy2[key] = attributes[key]; } return copy2; }, {} ); } for (const key in a) { if (a[key] !== void 0 && b[key] === void 0) { attributes[key] = a[key]; } } return Object.keys(attributes).length > 0 ? attributes : void 0; } AttributeMap2.compose = compose3; function diff(a = {}, b = {}) { if (typeof a !== "object") { a = {}; } if (typeof b !== "object") { b = {}; } const attributes = Object.keys(a).concat(Object.keys(b)).reduce((attrs, key) => { if (!(0, import_es62.default)(a[key], b[key])) { attrs[key] = b[key] === void 0 ? null : b[key]; } return attrs; }, {}); return Object.keys(attributes).length > 0 ? attributes : void 0; } AttributeMap2.diff = diff; function invert(attr = {}, base = {}) { attr = attr || {}; const baseInverted = Object.keys(base).reduce( (memo, key) => { if (base[key] !== attr[key] && attr[key] !== void 0) { memo[key] = base[key]; } return memo; }, {} ); return Object.keys(attr).reduce((memo, key) => { if (attr[key] !== base[key] && base[key] === void 0) { memo[key] = null; } return memo; }, baseInverted); } AttributeMap2.invert = invert; function transform(a, b, priority = false) { if (typeof a !== "object") { return b; } if (typeof b !== "object") { return void 0; } if (!priority) { return b; } const attributes = Object.keys(b).reduce( (attrs, key) => { if (a[key] === void 0) { attrs[key] = b[key]; } return attrs; }, {} ); return Object.keys(attributes).length > 0 ? attributes : void 0; } AttributeMap2.transform = transform; })(AttributeMap || (AttributeMap = {})); var AttributeMap_default = AttributeMap; // packages/sync/build-module/quill-delta/Op.mjs var Op; ((Op2) => { function length3(op) { if (typeof op.delete === "number") { return op.delete; } else if (typeof op.retain === "number") { return op.retain; } else if (typeof op.retain === "object" && op.retain !== null) { return 1; } return typeof op.insert === "string" ? op.insert.length : 1; } Op2.length = length3; })(Op || (Op = {})); var Op_default = Op; // packages/sync/build-module/quill-delta/OpIterator.mjs var Iterator2 = class { ops; index; offset; constructor(ops) { this.ops = ops; this.index = 0; this.offset = 0; } hasNext() { return this.peekLength() < Infinity; } next(length3) { if (!length3) { length3 = Infinity; } const nextOp = this.ops[this.index]; if (nextOp) { const offset = this.offset; const opLength = Op_default.length(nextOp); if (length3 >= opLength - offset) { length3 = opLength - offset; this.index += 1; this.offset = 0; } else { this.offset += length3; } if (typeof nextOp.delete === "number") { return { delete: length3 }; } const retOp = {}; if (nextOp.attributes) { retOp.attributes = nextOp.attributes; } if (typeof nextOp.retain === "number") { retOp.retain = length3; } else if (typeof nextOp.retain === "object" && nextOp.retain !== null) { retOp.retain = nextOp.retain; } else if (typeof nextOp.insert === "string") { retOp.insert = nextOp.insert.substr(offset, length3); } else { retOp.insert = nextOp.insert; } return retOp; } return { retain: Infinity }; } peek() { return this.ops[this.index]; } peekLength() { if (this.ops[this.index]) { return Op_default.length(this.ops[this.index]) - this.offset; } return Infinity; } peekType() { const op = this.ops[this.index]; if (op) { if (typeof op.delete === "number") { return "delete"; } else if (typeof op.retain === "number" || typeof op.retain === "object" && op.retain !== null) { return "retain"; } return "insert"; } return "retain"; } rest() { if (!this.hasNext()) { return []; } else if (this.offset === 0) { return this.ops.slice(this.index); } const offset = this.offset; const index = this.index; const next = this.next(); const rest = this.ops.slice(this.index); this.offset = offset; this.index = index; return [next].concat(rest); } }; // packages/sync/build-module/quill-delta/Delta.mjs function cloneDeep2(value) { return JSON.parse(JSON.stringify(value)); } var NULL_CHARACTER = String.fromCharCode(0); var STRING_TOO_LARGE_THRESHOLD = 1e4; function normalizeChangeCounts(changes) { return changes.map((change) => ({ ...change, count: change.value.length })); } var getEmbedTypeAndData = (a, b) => { if (typeof a !== "object" || a === null) { throw new Error(`cannot retain a ${typeof a}`); } if (typeof b !== "object" || b === null) { throw new Error(`cannot retain a ${typeof b}`); } const embedType = Object.keys(a)[0]; if (!embedType || embedType !== Object.keys(b)[0]) { throw new Error( `embed types not matched: ${embedType} != ${Object.keys(b)[0]}` ); } return [embedType, a[embedType], b[embedType]]; }; var Delta = class _Delta { static Op = Op_default; static OpIterator = Iterator2; static AttributeMap = AttributeMap_default; static handlers = {}; static registerEmbed(embedType, handler) { this.handlers[embedType] = handler; } static unregisterEmbed(embedType) { delete this.handlers[embedType]; } static getHandler(embedType) { const handler = this.handlers[embedType]; if (!handler) { throw new Error(`no handlers for embed type "${embedType}"`); } return handler; } ops; constructor(ops) { if (Array.isArray(ops)) { this.ops = ops; } else if (ops !== null && ops !== void 0 && Array.isArray(ops.ops)) { this.ops = ops.ops; } else { this.ops = []; } } insert(arg, attributes) { const newOp = {}; if (typeof arg === "string" && arg.length === 0) { return this; } newOp.insert = arg; if (attributes !== null && attributes !== void 0 && typeof attributes === "object" && Object.keys(attributes).length > 0) { newOp.attributes = attributes; } return this.push(newOp); } delete(length3) { if (length3 <= 0) { return this; } return this.push({ delete: length3 }); } retain(length3, attributes) { if (typeof length3 === "number" && length3 <= 0) { return this; } const newOp = { retain: length3 }; if (attributes !== null && attributes !== void 0 && typeof attributes === "object" && Object.keys(attributes).length > 0) { newOp.attributes = attributes; } return this.push(newOp); } push(newOp) { let index = this.ops.length; let lastOp = this.ops[index - 1]; newOp = cloneDeep2(newOp); if (typeof lastOp === "object") { if (typeof newOp.delete === "number" && typeof lastOp.delete === "number") { this.ops[index - 1] = { delete: lastOp.delete + newOp.delete }; return this; } if (typeof lastOp.delete === "number" && newOp.insert !== null && newOp.insert !== void 0) { index -= 1; lastOp = this.ops[index - 1]; if (typeof lastOp !== "object") { this.ops.unshift(newOp); return this; } } if ((0, import_es63.default)(newOp.attributes, lastOp.attributes)) { if (typeof newOp.insert === "string" && typeof lastOp.insert === "string") { this.ops[index - 1] = { insert: lastOp.insert + newOp.insert }; if (typeof newOp.attributes === "object") { this.ops[index - 1].attributes = newOp.attributes; } return this; } else if (typeof newOp.retain === "number" && typeof lastOp.retain === "number") { this.ops[index - 1] = { retain: lastOp.retain + newOp.retain }; if (typeof newOp.attributes === "object") { this.ops[index - 1].attributes = newOp.attributes; } return this; } } } if (index === this.ops.length) { this.ops.push(newOp); } else { this.ops.splice(index, 0, newOp); } return this; } chop() { const lastOp = this.ops[this.ops.length - 1]; if (lastOp && typeof lastOp.retain === "number" && !lastOp.attributes) { this.ops.pop(); } return this; } filter(predicate) { return this.ops.filter(predicate); } forEach(predicate) { this.ops.forEach(predicate); } map(predicate) { return this.ops.map(predicate); } partition(predicate) { const passed = []; const failed = []; this.forEach((op) => { const target = predicate(op) ? passed : failed; target.push(op); }); return [passed, failed]; } reduce(predicate, initialValue) { return this.ops.reduce(predicate, initialValue); } changeLength() { return this.reduce((length3, elem) => { if (elem.insert) { return length3 + Op_default.length(elem); } else if (elem.delete) { return length3 - elem.delete; } return length3; }, 0); } length() { return this.reduce((length3, elem) => { return length3 + Op_default.length(elem); }, 0); } slice(start = 0, end = Infinity) { const ops = []; const iter = new Iterator2(this.ops); let index = 0; while (index < end && iter.hasNext()) { let nextOp; if (index < start) { nextOp = iter.next(start - index); } else { nextOp = iter.next(end - index); ops.push(nextOp); } index += Op_default.length(nextOp); } return new _Delta(ops); } compose(other) { const thisIter = new Iterator2(this.ops); const otherIter = new Iterator2(other.ops); const ops = []; const firstOther = otherIter.peek(); if (firstOther !== null && firstOther !== void 0 && typeof firstOther.retain === "number" && (firstOther.attributes === null || firstOther.attributes === void 0)) { let firstLeft = firstOther.retain; while (thisIter.peekType() === "insert" && thisIter.peekLength() <= firstLeft) { firstLeft -= thisIter.peekLength(); ops.push(thisIter.next()); } if (firstOther.retain - firstLeft > 0) { otherIter.next(firstOther.retain - firstLeft); } } const delta = new _Delta(ops); while (thisIter.hasNext() || otherIter.hasNext()) { if (otherIter.peekType() === "insert") { delta.push(otherIter.next()); } else if (thisIter.peekType() === "delete") { delta.push(thisIter.next()); } else { const length3 = Math.min( thisIter.peekLength(), otherIter.peekLength() ); const thisOp = thisIter.next(length3); const otherOp = otherIter.next(length3); if (otherOp.retain) { const newOp = {}; if (typeof thisOp.retain === "number") { newOp.retain = typeof otherOp.retain === "number" ? length3 : otherOp.retain; } else if (typeof otherOp.retain === "number") { if (thisOp.retain === null || thisOp.retain === void 0) { newOp.insert = thisOp.insert; } else { newOp.retain = thisOp.retain; } } else { const action = thisOp.retain === null || thisOp.retain === void 0 ? "insert" : "retain"; const [embedType, thisData, otherData] = getEmbedTypeAndData( thisOp[action], otherOp.retain ); const handler = _Delta.getHandler(embedType); newOp[action] = { [embedType]: handler.compose( thisData, otherData, action === "retain" ) }; } const attributes = AttributeMap_default.compose( thisOp.attributes, otherOp.attributes, typeof thisOp.retain === "number" ); if (attributes) { newOp.attributes = attributes; } delta.push(newOp); if (!otherIter.hasNext() && (0, import_es63.default)(delta.ops[delta.ops.length - 1], newOp)) { const rest = new _Delta(thisIter.rest()); return delta.concat(rest).chop(); } } else if (typeof otherOp.delete === "number" && (typeof thisOp.retain === "number" || typeof thisOp.retain === "object" && thisOp.retain !== null)) { delta.push(otherOp); } } } return delta.chop(); } concat(other) { const delta = new _Delta(this.ops.slice()); if (other.ops.length > 0) { delta.push(other.ops[0]); delta.ops = delta.ops.concat(other.ops.slice(1)); } return delta; } diff(other) { if (this.ops === other.ops) { return new _Delta(); } const strings = this.deltasToStrings(other); const diffResult = normalizeChangeCounts( diffChars(strings[0], strings[1]) ); const thisIter = new Iterator2(this.ops); const otherIter = new Iterator2(other.ops); const retDelta = this.convertChangesToDelta( diffResult, thisIter, otherIter ); return retDelta.chop(); } eachLine(predicate, newline = "\n") { const iter = new Iterator2(this.ops); let line = new _Delta(); let i = 0; while (iter.hasNext()) { if (iter.peekType() !== "insert") { return; } const thisOp = iter.peek(); const start = Op_default.length(thisOp) - iter.peekLength(); const index = typeof thisOp.insert === "string" ? thisOp.insert.indexOf(newline, start) - start : -1; if (index < 0) { line.push(iter.next()); } else if (index > 0) { line.push(iter.next(index)); } else { if (predicate(line, iter.next(1).attributes || {}, i) === false) { return; } i += 1; line = new _Delta(); } } if (line.length() > 0) { predicate(line, {}, i); } } invert(base) { const inverted = new _Delta(); this.reduce((baseIndex, op) => { if (op.insert) { inverted.delete(Op_default.length(op)); } else if (typeof op.retain === "number" && (op.attributes === null || op.attributes === void 0)) { inverted.retain(op.retain); return baseIndex + op.retain; } else if (op.delete || typeof op.retain === "number") { const length3 = op.delete || op.retain; const slice = base.slice(baseIndex, baseIndex + length3); slice.forEach((baseOp) => { if (op.delete) { inverted.push(baseOp); } else if (op.retain && op.attributes) { inverted.retain( Op_default.length(baseOp), AttributeMap_default.invert( op.attributes, baseOp.attributes ) ); } }); return baseIndex + length3; } else if (typeof op.retain === "object" && op.retain !== null) { const slice = base.slice(baseIndex, baseIndex + 1); const baseOp = new Iterator2(slice.ops).next(); const [embedType, opData, baseOpData] = getEmbedTypeAndData( op.retain, baseOp.insert ); const handler = _Delta.getHandler(embedType); inverted.retain( { [embedType]: handler.invert(opData, baseOpData) }, AttributeMap_default.invert(op.attributes, baseOp.attributes) ); return baseIndex + 1; } return baseIndex; }, 0); return inverted.chop(); } transform(arg, priority = false) { priority = !!priority; if (typeof arg === "number") { return this.transformPosition(arg, priority); } const other = arg; const thisIter = new Iterator2(this.ops); const otherIter = new Iterator2(other.ops); const delta = new _Delta(); while (thisIter.hasNext() || otherIter.hasNext()) { if (thisIter.peekType() === "insert" && (priority || otherIter.peekType() !== "insert")) { delta.retain(Op_default.length(thisIter.next())); } else if (otherIter.peekType() === "insert") { delta.push(otherIter.next()); } else { const length3 = Math.min( thisIter.peekLength(), otherIter.peekLength() ); const thisOp = thisIter.next(length3); const otherOp = otherIter.next(length3); if (thisOp.delete) { continue; } else if (otherOp.delete) { delta.push(otherOp); } else { const thisData = thisOp.retain; const otherData = otherOp.retain; let transformedData = typeof otherData === "object" && otherData !== null ? otherData : length3; if (typeof thisData === "object" && thisData !== null && typeof otherData === "object" && otherData !== null) { const embedType = Object.keys(thisData)[0]; if (embedType === Object.keys(otherData)[0]) { const handler = _Delta.getHandler(embedType); if (handler) { transformedData = { [embedType]: handler.transform( thisData[embedType], otherData[embedType], priority ) }; } } } delta.retain( transformedData, AttributeMap_default.transform( thisOp.attributes, otherOp.attributes, priority ) ); } } } return delta.chop(); } transformPosition(index, priority = false) { priority = !!priority; const thisIter = new Iterator2(this.ops); let offset = 0; while (thisIter.hasNext() && offset <= index) { const length3 = thisIter.peekLength(); const nextType = thisIter.peekType(); thisIter.next(); if (nextType === "delete") { index -= Math.min(length3, index - offset); continue; } else if (nextType === "insert" && (offset < index || !priority)) { index += length3; } offset += length3; } return index; } /** * Given a Delta and a cursor position, do a diff and attempt to adjust * the diff to place insertions or deletions at the cursor position. * * @param other - The other Delta to diff against. * @param cursorAfterChange - The cursor position index after the change. * @return A Delta that attempts to place insertions or deletions at the cursor position. */ diffWithCursor(other, cursorAfterChange) { if (this.ops === other.ops) { return new _Delta(); } const strings = this.deltasToStrings(other); const maxStringLength = Math.max( ...strings.map((str) => str.length) ); if (maxStringLength > STRING_TOO_LARGE_THRESHOLD) { const diffResult = normalizeChangeCounts( diffLines(strings[0], strings[1]) ); const thisIterLarge = new Iterator2(this.ops); const otherIterLarge = new Iterator2(other.ops); return this.convertChangesToDelta( diffResult, thisIterLarge, otherIterLarge ).chop(); } else if (cursorAfterChange === null) { return this.diff(other); } let diffs = normalizeChangeCounts( diffChars(strings[0], strings[1]) ); let lastDiffPosition = 0; const adjustedDiffs = []; for (let i = 0; i < diffs.length; i++) { const diff = diffs[i]; const segmentStart = lastDiffPosition; const segmentEnd = lastDiffPosition + (diff.count ?? 0); const isCursorInSegment = cursorAfterChange > segmentStart && cursorAfterChange <= segmentEnd; const isUnchangedSegment = !diff.added && !diff.removed; const isRemovalSegment = diff.removed && !diff.added; const nextDiff = diffs[i + 1]; const isNextDiffAnInsert = nextDiff && nextDiff.added && !nextDiff.removed; if (isUnchangedSegment && isCursorInSegment && isNextDiffAnInsert) { const movedSegments = this.tryMoveInsertionToCursor( diff, nextDiff, cursorAfterChange, segmentStart ); if (movedSegments) { adjustedDiffs.push(...movedSegments); i++; lastDiffPosition = segmentEnd; continue; } } if (isRemovalSegment) { const movedSegments = this.tryMoveDeletionToCursor( diff, adjustedDiffs, cursorAfterChange, lastDiffPosition ); if (movedSegments) { adjustedDiffs.pop(); adjustedDiffs.push(...movedSegments); lastDiffPosition += diff.count ?? 0; continue; } } adjustedDiffs.push(diff); if (!diff.added) { lastDiffPosition += diff.count ?? 0; } } diffs = adjustedDiffs; const thisIter = new Iterator2(this.ops); const otherIter = new Iterator2(other.ops); const retDelta = this.convertChangesToDelta( diffs, thisIter, otherIter ); return retDelta.chop(); } /** * Try to move an insertion operation from after an unchanged segment to the cursor position within it. * This is a "look-ahead" strategy. * * @param diff - The current unchanged diff segment. * @param nextDiff - The next diff segment (expected to be an insertion). * @param cursorAfterChange - The cursor position after the change. * @param segmentStart - The start position of the current segment. * @return An array of adjusted diff segments if the insertion was successfully moved, null otherwise. */ tryMoveInsertionToCursor(diff, nextDiff, cursorAfterChange, segmentStart) { const nextDiffInsert = nextDiff.value; const insertLength = nextDiffInsert.length; const insertOffset = cursorAfterChange - segmentStart - insertLength; const textAtCursor = diff.value.substring( insertOffset, insertOffset + nextDiffInsert.length ); const isInsertMoveable = textAtCursor === nextDiffInsert; if (!isInsertMoveable) { return null; } const beforeCursor = diff.value.substring(0, insertOffset); const afterCursor = diff.value.substring(insertOffset); const result = []; if (beforeCursor.length > 0) { result.push({ value: beforeCursor, count: beforeCursor.length, added: false, removed: false }); } result.push(nextDiff); if (afterCursor.length > 0) { result.push({ value: afterCursor, count: afterCursor.length, added: false, removed: false }); } return result; } /** * Try to move a deletion operation to the cursor position by looking back at the previous unchanged segment. * This is a "look-back" strategy. * * @param diff - The current deletion diff segment. * @param adjustedDiffs - The array of previously processed diff segments. * @param cursorAfterChange - The cursor position after the change. * @param lastDiffPosition - The position in the document up to (but not including) the current diff. * @return An array of adjusted diff segments if the deletion was successfully moved, null otherwise. */ tryMoveDeletionToCursor(diff, adjustedDiffs, cursorAfterChange, lastDiffPosition) { const prevDiff = adjustedDiffs[adjustedDiffs.length - 1]; if (!prevDiff || prevDiff.added || prevDiff.removed) { return null; } const prevSegmentStart = lastDiffPosition - (prevDiff.count ?? 0); const prevSegmentEnd = lastDiffPosition; if (cursorAfterChange < prevSegmentStart || cursorAfterChange >= prevSegmentEnd) { return null; } const deletedChars = diff.value; const deleteOffset = cursorAfterChange - prevSegmentStart; const textAtCursor = prevDiff.value.substring( deleteOffset, deleteOffset + deletedChars.length ); const canBePlacedHere = textAtCursor === deletedChars; if (!canBePlacedHere) { return null; } const beforeCursor = prevDiff.value.substring(0, deleteOffset); const atAndAfterCursor = prevDiff.value.substring(deleteOffset); const deletionLength = diff.count ?? 0; const afterDeletion = atAndAfterCursor.substring(deletionLength); const result = []; if (beforeCursor.length > 0) { result.push({ value: beforeCursor, count: beforeCursor.length, added: false, removed: false }); } result.push(diff); if (afterDeletion.length > 0) { result.push({ value: afterDeletion, count: afterDeletion.length, added: false, removed: false }); } return result; } /** * Convert two Deltas to string representations for diffing. * * @param other - The other Delta to convert. * @return A tuple of [thisString, otherString]. */ deltasToStrings(other) { return [this, other].map((delta) => { return delta.map((op) => { if (op.insert !== null || op.insert !== void 0) { return typeof op.insert === "string" ? op.insert : NULL_CHARACTER; } const prep = delta === other ? "on" : "with"; throw new Error( "diff() called " + prep + " non-document" ); }).join(""); }); } /** * Process diff changes and convert them to Delta operations. * * @param changes - The array of changes from the diff algorithm. * @param thisIter - Iterator for this Delta's operations. * @param otherIter - Iterator for the other Delta's operations. * @return A Delta containing the processed diff operations. */ convertChangesToDelta(changes, thisIter, otherIter) { const retDelta = new _Delta(); changes.forEach((component) => { let length3 = component.count ?? 0; while (length3 > 0) { let opLength = 0; if (component.added) { opLength = Math.min(otherIter.peekLength(), length3); retDelta.push(otherIter.next(opLength)); } else if (component.removed) { opLength = Math.min(length3, thisIter.peekLength()); thisIter.next(opLength); retDelta.delete(opLength); } else { opLength = Math.min( thisIter.peekLength(), otherIter.peekLength(), length3 ); const thisOp = thisIter.next(opLength); const otherOp = otherIter.next(opLength); if ((0, import_es63.default)(thisOp.insert, otherOp.insert)) { retDelta.retain( opLength, AttributeMap_default.diff( thisOp.attributes, otherOp.attributes ) ); } else { retDelta.push(otherOp).delete(opLength); } } length3 -= opLength; } }); return retDelta; } }; var Delta_default = Delta; // packages/sync/build-module/private-apis.mjs var privateApis = {}; lock(privateApis, { ConnectionErrorCode, createSyncManager, Delta: Delta_default, CRDT_DOC_META_PERSISTENCE_KEY, CRDT_RECORD_MAP_KEY, LOCAL_EDITOR_ORIGIN, LOCAL_UNDO_IGNORED_ORIGIN, retrySyncConnection: () => pollingManager.retryNow() }); // packages/core-data/build-module/awareness/post-editor-awareness.mjs var import_block_editor3 = __toESM(require_block_editor(), 1); // packages/core-data/build-module/awareness/base-awareness.mjs var import_data2 = __toESM(require_data(), 1); // packages/core-data/build-module/awareness/config.mjs var AWARENESS_CURSOR_UPDATE_THROTTLE_IN_MS = 100; var LOCAL_CURSOR_UPDATE_DEBOUNCE_IN_MS = 5; var REMOVAL_DELAY_IN_MS = 5e3; // packages/core-data/build-module/awareness/utils.mjs function getBrowserName() { const userAgent = window.navigator.userAgent; let browserName = "Unknown"; if (userAgent.includes("Firefox")) { browserName = "Firefox"; } else if (userAgent.includes("Edg")) { browserName = "Microsoft Edge"; } else if (userAgent.includes("Chrome") && !userAgent.includes("Edg")) { browserName = "Chrome"; } else if (userAgent.includes("Safari") && !userAgent.includes("Chrome")) { browserName = "Safari"; } else if (userAgent.includes("MSIE") || userAgent.includes("Trident")) { browserName = "Internet Explorer"; } else if (userAgent.includes("Opera") || userAgent.includes("OPR")) { browserName = "Opera"; } return browserName; } function areMapsEqual(map1, map2, comparatorFn) { if (map1.size !== map2.size) { return false; } for (const [key, value1] of map1.entries()) { if (!map2.has(key)) { return false; } if (!comparatorFn(value1, map2.get(key))) { return false; } } return true; } function areCollaboratorInfosEqual(collaboratorInfo1, collaboratorInfo2) { if (!collaboratorInfo1 || !collaboratorInfo2) { return collaboratorInfo1 === collaboratorInfo2; } if (Object.keys(collaboratorInfo1).length !== Object.keys(collaboratorInfo2).length) { return false; } return Object.entries(collaboratorInfo1).every(([key, value]) => { return value === collaboratorInfo2[key]; }); } function generateCollaboratorInfo(currentCollaborator) { const { avatar_urls, id: id2, name, slug } = currentCollaborator; return { avatar_urls, // eslint-disable-line camelcase browserType: getBrowserName(), enteredAt: Date.now(), id: id2, name, slug }; } function getRecordValue(obj, key) { if ("object" === typeof obj && null !== obj && key in obj) { return obj[key]; } return null; } function getTypedKeys(obj) { return Object.keys(obj); } // packages/core-data/build-module/awareness/typed-awareness.mjs var TypedAwareness = class extends Awareness { /** * Get the states from an awareness document. */ getStates() { return super.getStates(); } /** * Get a local state field from an awareness document. * @param field */ getLocalStateField(field) { const state = this.getLocalState(); return getRecordValue(state, field); } /** * Set a local state field on an awareness document. * @param field * @param value */ setLocalStateField(field, value) { super.setLocalStateField(field, value); } }; // packages/core-data/build-module/awareness/awareness-state.mjs var AwarenessWithEqualityChecks = class extends TypedAwareness { /** OVERRIDDEN METHODS */ /** * Set a local state field on an awareness document. Calling this method may * trigger rerenders of any subscribed components. * * Equality checks are provided by the abstract `equalityFieldChecks` property. * @param field - The field to set. * @param value - The value to set. */ setLocalStateField(field, value) { if (this.isFieldEqual( field, value, this.getLocalStateField(field) ?? void 0 )) { return; } super.setLocalStateField(field, value); } /** CUSTOM METHODS */ /** * Determine if a field value has changed using the provided equality checks. * @param field - The field to check. * @param value1 - The first value to compare. * @param value2 - The second value to compare. */ isFieldEqual(field, value1, value2) { if (["clientId", "isConnected", "isMe"].includes(field)) { return value1 === value2; } if (field in this.equalityFieldChecks) { const fn = this.equalityFieldChecks[field]; return fn(value1, value2); } throw new Error( `No equality check implemented for awareness state field "${field.toString()}".` ); } /** * Determine if two states are equal by comparing each field using the * provided equality checks. * @param state1 - The first state to compare. * @param state2 - The second state to compare. */ isStateEqual(state1, state2) { return [ .../* @__PURE__ */ new Set([ ...getTypedKeys(state1), ...getTypedKeys(state2) ]) ].every((field) => { const value1 = state1[field]; const value2 = state2[field]; return this.isFieldEqual(field, value1, value2); }); } }; var AwarenessState = class extends AwarenessWithEqualityChecks { /** CUSTOM PROPERTIES */ /** * Whether the setUp method has been called, to avoid running it multiple * times. */ hasSetupRun = false; /** * We keep track of all seen states during the current session for two reasons: * * 1. So that we can represent recently disconnected collaborators in our UI, even * after they have been removed from the awareness document. * 2. So that we can provide debug information about all collaborators seen during * the session. */ disconnectedCollaborators = /* @__PURE__ */ new Set(); seenStates = /* @__PURE__ */ new Map(); /** * Hold a snapshot of the previous awareness state allows us to compare the * state values and avoid unnecessary updates to subscribers. */ previousSnapshot = /* @__PURE__ */ new Map(); stateSubscriptions = []; /** * In some cases, we may want to throttle setting local state fields to avoid * overwhelming the awareness document with rapid updates. At the same time, we * want to ensure that when we read our own state locally, we get the latest * value -- even if it hasn't yet been set on the awareness instance. */ myThrottledState = {}; throttleTimeouts = /* @__PURE__ */ new Map(); /** CUSTOM METHODS */ /** * Set up the awareness state. This method is idempotent and will only run * once. Subclasses should override `onSetUp()` instead of this method to * add their own setup logic. * * This is defined as a readonly arrow function property to prevent * subclasses from overriding it. */ setUp = () => { if (this.hasSetupRun) { return; } this.hasSetupRun = true; this.onSetUp(); this.on( "change", ({ added, removed, updated }) => { [...added, ...updated].forEach((id2) => { this.disconnectedCollaborators.delete(id2); }); removed.forEach((id2) => { this.disconnectedCollaborators.add(id2); setTimeout(() => { this.disconnectedCollaborators.delete(id2); this.updateSubscribers( true /* force update */ ); }, REMOVAL_DELAY_IN_MS); }); this.updateSubscribers(); } ); }; /** * Get the most recent state from the last processed change event. * * @return An array of EnhancedState< State >. */ getCurrentState() { return Array.from(this.previousSnapshot.values()); } /** * Get all seen states in this session to enable debug reporting. */ getSeenStates() { return this.seenStates; } /** * Allow external code to subscribe to awareness state changes. * @param callback - The callback to subscribe to. */ onStateChange(callback) { this.stateSubscriptions.push(callback); return () => { this.stateSubscriptions = this.stateSubscriptions.filter( (cb) => cb !== callback ); }; } /** * Set a local state field on an awareness document with throttle. See caveats * of this.setLocalStateField. * @param field - The field to set. * @param value - The value to set. * @param wait - The wait time in milliseconds. */ setThrottledLocalStateField(field, value, wait) { this.setLocalStateField(field, value); this.throttleTimeouts.set( field, setTimeout(() => { this.throttleTimeouts.delete(field); if (this.myThrottledState[field]) { this.setLocalStateField( field, this.myThrottledState[field] ); delete this.myThrottledState[field]; } }, wait) ); } /** * Set the current collaborator's connection status as awareness state. * @param isConnected - The connection status. */ setConnectionStatus(isConnected) { if (isConnected) { this.disconnectedCollaborators.delete(this.clientID); } else { this.disconnectedCollaborators.add(this.clientID); } this.updateSubscribers( true /* force update */ ); } /** * Update all subscribed listeners with the latest awareness state. * @param forceUpdate - Whether to force an update. */ updateSubscribers(forceUpdate = false) { if (!this.stateSubscriptions.length) { return; } const states = this.getStates(); this.seenStates = new Map([ ...this.seenStates.entries(), ...states.entries() ]); const updatedStates = new Map( [...this.disconnectedCollaborators, ...states.keys()].filter((clientId) => { return Object.keys(this.seenStates.get(clientId) ?? {}).length > 0; }).map((clientId) => { const rawState = this.seenStates.get(clientId); const isConnected = !this.disconnectedCollaborators.has(clientId); const isMe = clientId === this.clientID; const myState = isMe ? this.myThrottledState : {}; const state = { ...rawState, ...myState, clientId, isConnected, isMe }; return [clientId, state]; }) ); if (!forceUpdate) { if (areMapsEqual( this.previousSnapshot, updatedStates, this.isStateEqual.bind(this) )) { return; } } this.previousSnapshot = updatedStates; this.stateSubscriptions.forEach((callback) => { callback(Array.from(updatedStates.values())); }); } }; // packages/core-data/build-module/name.mjs var STORE_NAME = "core"; // packages/core-data/build-module/awareness/base-awareness.mjs var BaseAwarenessState = class extends AwarenessState { onSetUp() { void this.setCurrentCollaboratorInfo(); } /** * Set the current collaborator info in the local state. */ async setCurrentCollaboratorInfo() { const currentUser2 = await (0, import_data2.resolveSelect)(STORE_NAME).getCurrentUser(); const collaboratorInfo = generateCollaboratorInfo(currentUser2); this.setLocalStateField("collaboratorInfo", collaboratorInfo); } }; var baseEqualityFieldChecks = { collaboratorInfo: areCollaboratorInfosEqual }; var BaseAwareness = class extends BaseAwarenessState { equalityFieldChecks = baseEqualityFieldChecks; }; // packages/core-data/build-module/awareness/block-lookup.mjs var import_data3 = __toESM(require_data(), 1); var import_block_editor = __toESM(require_block_editor(), 1); function getBlockPathInYdoc(yType) { const path = []; let current = yType; while (current) { const parentArray = current.parent; if (!parentArray || !(parentArray instanceof yjs_exports.Array)) { return null; } let index = -1; for (let i = 0; i < parentArray.length; i++) { if (parentArray.get(i) === current) { index = i; break; } } if (index === -1) { return null; } path.unshift(index); const grandparent = parentArray.parent; if (grandparent instanceof yjs_exports.Map && grandparent.get("clientId") !== void 0) { current = grandparent; } else { break; } } return path; } function resolveBlockClientIdByPath(path) { if (path.length === 0) { return null; } const { getBlocks } = (0, import_data3.select)(import_block_editor.store); const postContentBlocks = getPostContentBlocks(getBlocks(), getBlocks); let blocks = postContentBlocks; for (let i = 0; i < path.length; i++) { const block = blocks[path[i]]; if (!block) { return null; } if (i === path.length - 1) { return block.clientId; } blocks = block.innerBlocks; } return null; } function getPostContentBlocks(rootBlocks, getBlocks) { const postContentBlock = findBlockByName(rootBlocks, "core/post-content"); if (postContentBlock) { return getBlocks(postContentBlock.clientId); } return rootBlocks; } function findBlockByName(blocks, name) { for (const block of blocks) { if (block.name === name) { return block; } if (block.innerBlocks?.length) { const found = findBlockByName(block.innerBlocks, name); if (found) { return found; } } } return null; } // packages/core-data/build-module/utils/crdt-utils.mjs var import_rich_text = __toESM(require_rich_text(), 1); // packages/core-data/build-module/lock-unlock.mjs var import_private_apis3 = __toESM(require_private_apis(), 1); var { lock: lock2, unlock: unlock2 } = (0, import_private_apis3.__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/core-data" ); // packages/core-data/build-module/sync.mjs var { ConnectionErrorCode: ConnectionErrorCode2, createSyncManager: createSyncManager2, Delta: Delta2, CRDT_DOC_META_PERSISTENCE_KEY: CRDT_DOC_META_PERSISTENCE_KEY2, CRDT_RECORD_MAP_KEY: CRDT_RECORD_MAP_KEY2, LOCAL_EDITOR_ORIGIN: LOCAL_EDITOR_ORIGIN2, LOCAL_UNDO_IGNORED_ORIGIN: LOCAL_UNDO_IGNORED_ORIGIN2, retrySyncConnection } = unlock2(privateApis); var syncManager; function getSyncManager() { if (syncManager) { return syncManager; } syncManager = createSyncManager2(); return syncManager; } // packages/core-data/build-module/utils/crdt-utils.mjs function getRootMap(doc2, key) { return doc2.getMap(key); } function createYMap(partial = {}) { return new yjs_exports.Map(Object.entries(partial)); } function isYMap(value) { return value instanceof yjs_exports.Map; } function findBlockByClientIdInDoc(blockId, ydoc) { const ymap = getRootMap(ydoc, CRDT_RECORD_MAP_KEY2); const blocks = ymap.get("blocks"); if (!(blocks instanceof yjs_exports.Array)) { return null; } return findBlockByClientIdInBlocks(blockId, blocks); } var MARKER_START = 57344; function pickMarker(text2) { const tryCount = 16; for (let code = MARKER_START; code < MARKER_START + tryCount; code++) { const candidate = String.fromCharCode(code); if (!text2.includes(candidate)) { return candidate; } } return null; } function htmlIndexToRichTextOffset(html, htmlIndex) { if (!html.includes("<") && !html.includes("&")) { return htmlIndex; } const marker = pickMarker(html); if (!marker) { return htmlIndex; } const withMarker = html.slice(0, htmlIndex) + marker + html.slice(htmlIndex); const value = (0, import_rich_text.create)({ html: withMarker }); const markerPos = value.text.indexOf(marker); return markerPos === -1 ? htmlIndex : markerPos; } function richTextOffsetToHtmlIndex(html, richTextOffset) { if (!html.includes("<") && !html.includes("&")) { return richTextOffset; } const marker = pickMarker(html); if (!marker) { return richTextOffset; } const value = (0, import_rich_text.create)({ html }); const markerValue = (0, import_rich_text.create)({ text: marker }); if (value.formats[richTextOffset]) { markerValue.formats[0] = value.formats[richTextOffset]; } const withMarker = (0, import_rich_text.insert)( value, markerValue, richTextOffset, richTextOffset ); const htmlWithMarker = (0, import_rich_text.toHTMLString)({ value: withMarker }); const markerIndex = htmlWithMarker.indexOf(marker); return markerIndex === -1 ? richTextOffset : markerIndex; } function findBlockByClientIdInBlocks(blockId, blocks) { for (const block of blocks) { if (block.get("clientId") === blockId) { return block; } const innerBlocks = block.get("innerBlocks"); if (innerBlocks && innerBlocks.length > 0) { const innerBlock = findBlockByClientIdInBlocks( blockId, innerBlocks ); if (innerBlock) { return innerBlock; } } } return null; } // packages/core-data/build-module/utils/crdt-user-selections.mjs var import_data4 = __toESM(require_data(), 1); var import_block_editor2 = __toESM(require_block_editor(), 1); var SelectionType = /* @__PURE__ */ ((SelectionType2) => { SelectionType2["None"] = "none"; SelectionType2["Cursor"] = "cursor"; SelectionType2["SelectionInOneBlock"] = "selection-in-one-block"; SelectionType2["SelectionInMultipleBlocks"] = "selection-in-multiple-blocks"; SelectionType2["WholeBlock"] = "whole-block"; return SelectionType2; })(SelectionType || {}); var SelectionDirection = /* @__PURE__ */ ((SelectionDirection2) => { SelectionDirection2["Forward"] = "f"; SelectionDirection2["Backward"] = "b"; return SelectionDirection2; })(SelectionDirection || {}); function getSelectionState(selectionStart, selectionEnd, yDoc, options) { const { selectionDirection } = options ?? {}; const ymap = getRootMap(yDoc, CRDT_RECORD_MAP_KEY2); const yBlocks = ymap.get("blocks"); const isSelectionEmpty = Object.keys(selectionStart).length === 0; const noSelection = { type: "none" /* None */ }; if (isSelectionEmpty || !yBlocks) { return noSelection; } const isSelectionInOneBlock = selectionStart.clientId === selectionEnd.clientId; const isCursorOnly = isSelectionInOneBlock && selectionStart.offset === selectionEnd.offset; const isSelectionAWholeBlock = isSelectionInOneBlock && selectionStart.offset === void 0 && selectionEnd.offset === void 0; if (isSelectionAWholeBlock) { const path = getBlockPathForLocalClientId(selectionStart.clientId); const blockPosition = path ? createRelativePositionForBlockPath(path, yBlocks) : null; if (!blockPosition) { return noSelection; } return { type: "whole-block", blockPosition }; } else if (isCursorOnly) { const cursorPosition = getCursorPosition(selectionStart, yBlocks); if (!cursorPosition) { return noSelection; } return { type: "cursor", cursorPosition }; } else if (isSelectionInOneBlock) { const cursorStartPosition2 = getCursorPosition( selectionStart, yBlocks ); const cursorEndPosition2 = getCursorPosition(selectionEnd, yBlocks); if (!cursorStartPosition2 || !cursorEndPosition2) { return noSelection; } return { type: "selection-in-one-block", cursorStartPosition: cursorStartPosition2, cursorEndPosition: cursorEndPosition2, selectionDirection }; } const cursorStartPosition = getCursorPosition(selectionStart, yBlocks); const cursorEndPosition = getCursorPosition(selectionEnd, yBlocks); if (!cursorStartPosition || !cursorEndPosition) { return noSelection; } return { type: "selection-in-multiple-blocks", cursorStartPosition, cursorEndPosition, selectionDirection }; } function getCursorPosition(selection, blocks) { const path = getBlockPathForLocalClientId(selection.clientId); const block = path ? findBlockByPath(path, blocks) : null; if (!block || !selection.attributeKey || void 0 === selection.offset) { return null; } const attributes = block.get("attributes"); const currentYText = attributes?.get(selection.attributeKey); if (!(currentYText instanceof yjs_exports.Text)) { return null; } const relativePosition = yjs_exports.createRelativePositionFromTypeIndex( currentYText, richTextOffsetToHtmlIndex(currentYText.toString(), selection.offset) ); return { relativePosition, absoluteOffset: selection.offset }; } function getBlockPathForLocalClientId(clientId) { const { getBlockIndex, getBlockRootClientId, getBlockName } = (0, import_data4.select)(import_block_editor2.store); const path = []; let current = clientId; while (current) { const index = getBlockIndex(current); if (index === -1) { return null; } path.unshift(index); const parent = getBlockRootClientId(current); if (!parent) { break; } const parentName = getBlockName(parent); if (parentName === "core/post-content") { break; } current = parent; } return path.length > 0 ? path : null; } function findBlockByPath(path, blocks) { let currentBlocks = blocks; for (let i = 0; i < path.length; i++) { if (path[i] >= currentBlocks.length) { return null; } const block = currentBlocks.get(path[i]); if (!block) { return null; } if (i === path.length - 1) { return block; } currentBlocks = block.get("innerBlocks") ?? new yjs_exports.Array(); } return null; } function createRelativePositionForBlockPath(path, blocks) { let currentBlocks = blocks; for (let i = 0; i < path.length; i++) { if (path[i] >= currentBlocks.length) { return null; } if (i === path.length - 1) { return yjs_exports.createRelativePositionFromTypeIndex( currentBlocks, path[i] ); } const block = currentBlocks.get(path[i]); currentBlocks = block?.get("innerBlocks") ?? new yjs_exports.Array(); } return null; } function areSelectionsStatesEqual(selection1, selection2) { if (selection1.type !== selection2.type) { return false; } switch (selection1.type) { case "none": return true; case "cursor": return areCursorPositionsEqual( selection1.cursorPosition, selection2.cursorPosition ); case "selection-in-one-block": return areCursorPositionsEqual( selection1.cursorStartPosition, selection2.cursorStartPosition ) && areCursorPositionsEqual( selection1.cursorEndPosition, selection2.cursorEndPosition ) && selection1.selectionDirection === selection2.selectionDirection; case "selection-in-multiple-blocks": return areCursorPositionsEqual( selection1.cursorStartPosition, selection2.cursorStartPosition ) && areCursorPositionsEqual( selection1.cursorEndPosition, selection2.cursorEndPosition ) && selection1.selectionDirection === selection2.selectionDirection; case "whole-block": return yjs_exports.compareRelativePositions( selection1.blockPosition, selection2.blockPosition ); default: return false; } } function areCursorPositionsEqual(cursorPosition1, cursorPosition2) { const isRelativePositionEqual = yjs_exports.compareRelativePositions( cursorPosition1.relativePosition, cursorPosition2.relativePosition ); const isAbsoluteOffsetEqual = cursorPosition1.absoluteOffset === cursorPosition2.absoluteOffset; return isRelativePositionEqual && isAbsoluteOffsetEqual; } // packages/core-data/build-module/awareness/post-editor-awareness.mjs var PostEditorAwareness = class extends BaseAwarenessState { constructor(doc2, kind, name, postId) { super(doc2); this.kind = kind; this.name = name; this.postId = postId; } equalityFieldChecks = { ...baseEqualityFieldChecks, editorState: this.areEditorStatesEqual }; onSetUp() { super.onSetUp(); this.subscribeToCollaboratorSelectionChanges(); } /** * Subscribe to collaborator selection changes and update the selection state. */ subscribeToCollaboratorSelectionChanges() { const { getSelectionStart, getSelectionEnd, getSelectedBlocksInitialCaretPosition } = (0, import_data5.select)(import_block_editor3.store); let selectionStart = getSelectionStart(); let selectionEnd = getSelectionEnd(); let localCursorTimeout = null; let selectionBeforeDebounce = null; (0, import_data5.subscribe)(() => { const newSelectionStart = getSelectionStart(); const newSelectionEnd = getSelectionEnd(); if (newSelectionStart === selectionStart && newSelectionEnd === selectionEnd) { return; } if (!selectionBeforeDebounce) { selectionBeforeDebounce = { start: selectionStart, end: selectionEnd }; } selectionStart = newSelectionStart; selectionEnd = newSelectionEnd; const initialPosition = getSelectedBlocksInitialCaretPosition(); void this.updateSelectionInEntityRecord( selectionStart, selectionEnd, initialPosition ); if (localCursorTimeout) { clearTimeout(localCursorTimeout); } localCursorTimeout = setTimeout(() => { const selectionStateOptions = {}; if (selectionBeforeDebounce) { selectionStateOptions.selectionDirection = detectSelectionDirection( selectionBeforeDebounce.start, selectionBeforeDebounce.end, selectionStart, selectionEnd ); selectionBeforeDebounce = null; } const selectionState = getSelectionState( selectionStart, selectionEnd, this.doc, selectionStateOptions ); this.setThrottledLocalStateField( "editorState", { selection: selectionState }, AWARENESS_CURSOR_UPDATE_THROTTLE_IN_MS ); }, LOCAL_CURSOR_UPDATE_DEBOUNCE_IN_MS); }); } /** * Update the entity record with the current collaborator's selection. * * @param selectionStart - The start position of the selection. * @param selectionEnd - The end position of the selection. * @param initialPosition - The initial position of the selection. */ async updateSelectionInEntityRecord(selectionStart, selectionEnd, initialPosition) { const edits = { selection: { selectionStart, selectionEnd, initialPosition } }; const options = { undoIgnore: true }; (0, import_data5.dispatch)(STORE_NAME).editEntityRecord( this.kind, this.name, this.postId, edits, options ); } /** * Check if two editor states are equal. * * @param state1 - The first editor state. * @param state2 - The second editor state. * @return True if the editor states are equal, false otherwise. */ areEditorStatesEqual(state1, state2) { if (!state1 || !state2) { return state1 === state2; } if (!state1.selection || !state2.selection) { return state1.selection === state2.selection; } return areSelectionsStatesEqual(state1.selection, state2.selection); } /** * Resolve a selection state to a text index and block client ID. * * For text-based selections, navigates up from the resolved Y.Text via * AbstractType.parent to find the containing block, then resolves the * local clientId via the block's tree path. * For WholeBlock selections, resolves the block's relative position and * then finds the local clientId via tree path. * * Tree-path resolution is used instead of reading the clientId directly * from the Yjs block because the local block-editor store may use different * clientIds (e.g. in "Show Template" mode where blocks are cloned). * * @param selection - The selection state. * @return The rich-text offset and block client ID, or nulls if not resolvable. */ convertSelectionStateToAbsolute(selection) { if (selection.type === SelectionType.None) { return { richTextOffset: null, localClientId: null }; } if (selection.type === SelectionType.WholeBlock) { const absolutePos = yjs_exports.createAbsolutePositionFromRelativePosition( selection.blockPosition, this.doc ); let localClientId2 = null; if (absolutePos && absolutePos.type instanceof yjs_exports.Array) { const parentArray = absolutePos.type; const block = parentArray.get(absolutePos.index); if (block instanceof yjs_exports.Map) { const path2 = getBlockPathInYdoc(block); localClientId2 = path2 ? resolveBlockClientIdByPath(path2) : null; } } return { richTextOffset: null, localClientId: localClientId2 }; } const cursorPos = "cursorPosition" in selection ? selection.cursorPosition : selection.cursorStartPosition; const absolutePosition = yjs_exports.createAbsolutePositionFromRelativePosition( cursorPos.relativePosition, this.doc ); if (!absolutePosition) { return { richTextOffset: null, localClientId: null }; } const yType = absolutePosition.type.parent?.parent; const path = yType instanceof yjs_exports.Map ? getBlockPathInYdoc(yType) : null; const localClientId = path ? resolveBlockClientIdByPath(path) : null; return { richTextOffset: htmlIndexToRichTextOffset( absolutePosition.type.toString(), absolutePosition.index ), localClientId }; } /** * Type guard to check if a struct is a Y.Item (not Y.GC) * @param struct - The struct to check. * @return True if the struct is a Y.Item, false otherwise. */ isYItem(struct) { return "content" in struct; } /** * Get data for debugging, using the awareness state. * * @return {YDocDebugData} The debug data. */ getDebugData() { const ydoc = this.doc; const docData = Object.fromEntries( Array.from(ydoc.share, ([key, value]) => [ key, value.toJSON() ]) ); const collaboratorMapData = new Map( Array.from(this.getSeenStates().entries()).map( ([clientId, collaboratorState]) => [ String(clientId), { name: collaboratorState.collaboratorInfo.name, wpUserId: collaboratorState.collaboratorInfo.id } ] ) ); const serializableClientItems = {}; ydoc.store.clients.forEach((structs, clientId) => { const items2 = structs.filter(this.isYItem); serializableClientItems[clientId] = items2.map((item) => { const { left, right, ...rest } = item; return { ...rest, left: left ? { id: left.id, length: left.length, origin: left.origin, content: left.content } : null, right: right ? { id: right.id, length: right.length, origin: right.origin, content: right.content } : null }; }); }); return { doc: docData, clients: serializableClientItems, collaboratorMap: Object.fromEntries(collaboratorMapData) }; } }; function detectSelectionDirection(prevStart, prevEnd, newStart, newEnd) { const startMoved = !areBlockSelectionsEqual(prevStart, newStart); const endMoved = !areBlockSelectionsEqual(prevEnd, newEnd); if (startMoved && !endMoved) { return SelectionDirection.Backward; } return SelectionDirection.Forward; } function areBlockSelectionsEqual(a, b) { return a.clientId === b.clientId && a.attributeKey === b.attributeKey && a.offset === b.offset; } // packages/core-data/build-module/utils/crdt.mjs var import_es65 = __toESM(require_es6(), 1); var import_blocks3 = __toESM(require_blocks(), 1); // node_modules/uuid/dist/esm-browser/rng.js var getRandomValues2; var rnds8 = new Uint8Array(16); function rng() { if (!getRandomValues2) { getRandomValues2 = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto); if (!getRandomValues2) { throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported"); } } return getRandomValues2(rnds8); } // node_modules/uuid/dist/esm-browser/stringify.js var byteToHex = []; for (let i = 0; i < 256; ++i) { byteToHex.push((i + 256).toString(16).slice(1)); } function unsafeStringify(arr, offset = 0) { return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]; } // node_modules/uuid/dist/esm-browser/native.js var randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto); var native_default = { randomUUID }; // node_modules/uuid/dist/esm-browser/v4.js function v4(options, buf, offset) { if (native_default.randomUUID && !buf && !options) { return native_default.randomUUID(); } options = options || {}; const rnds = options.random || (options.rng || rng)(); rnds[6] = rnds[6] & 15 | 64; rnds[8] = rnds[8] & 63 | 128; if (buf) { offset = offset || 0; for (let i = 0; i < 16; ++i) { buf[offset + i] = rnds[i]; } return buf; } return unsafeStringify(rnds); } var v4_default = v4; // packages/core-data/build-module/utils/crdt-blocks.mjs var import_es64 = __toESM(require_es6(), 1); var import_blocks = __toESM(require_blocks(), 1); var import_rich_text3 = __toESM(require_rich_text(), 1); // packages/core-data/build-module/utils/crdt-text.mjs var import_rich_text2 = __toESM(require_rich_text(), 1); var RICH_TEXT_CACHE_MAX_SIZE = 500; function createRichTextDataCache(maxSize) { const cache3 = /* @__PURE__ */ new Map(); return function(value) { const cached = cache3.get(value); if (cached) { return cached; } const result = import_rich_text2.RichTextData.fromHTMLString(value); if (cache3.size >= maxSize) { cache3.delete(cache3.keys().next().value); } cache3.set(value, result); return result; }; } var getCachedRichTextData = createRichTextDataCache( RICH_TEXT_CACHE_MAX_SIZE ); // packages/core-data/build-module/utils/crdt-blocks.mjs var serializableBlocksCache = /* @__PURE__ */ new WeakMap(); function serializeAttributeValue(value) { if (value instanceof import_rich_text3.RichTextData) { return value.valueOf(); } if (Array.isArray(value)) { return value.map(serializeAttributeValue); } if (value && typeof value === "object") { const result = {}; for (const [k, v] of Object.entries(value)) { result[k] = serializeAttributeValue(v); } return result; } return value; } function makeBlockAttributesSerializable(blockName, attributes) { const newAttributes = { ...attributes }; for (const [key, value] of Object.entries(attributes)) { if (isLocalAttribute(blockName, key)) { delete newAttributes[key]; continue; } newAttributes[key] = serializeAttributeValue(value); } return newAttributes; } function makeBlocksSerializable(blocks) { return blocks.map((block) => { const { name, innerBlocks, attributes, ...rest } = block; delete rest.validationIssues; return { ...rest, name, attributes: makeBlockAttributesSerializable(name, attributes), innerBlocks: makeBlocksSerializable(innerBlocks) }; }); } function deserializeAttributeValue(schema, value) { if (schema?.type === "rich-text" && typeof value === "string") { return getCachedRichTextData(value); } if (Array.isArray(value)) { return value.map( (item) => deserializeAttributeValue(schema, item) ); } if (value && typeof value === "object") { const result = {}; for (const [key, innerValue] of Object.entries( value )) { result[key] = deserializeAttributeValue( schema?.query?.[key], innerValue ); } return result; } return value; } function deserializeBlockAttributes(blocks) { return blocks.map((block) => { const { name, innerBlocks, attributes, ...rest } = block; const newAttributes = { ...attributes }; for (const [key, value] of Object.entries(attributes)) { const schema = getBlockAttributeType(name, key); if (schema) { newAttributes[key] = deserializeAttributeValue( schema, value ); } } return { ...rest, name, attributes: newAttributes, innerBlocks: deserializeBlockAttributes(innerBlocks ?? []) }; }); } function areBlocksEqual(gblock, yblock) { const yblockAsJson = yblock.toJSON(); const overwrites = { innerBlocks: null, clientId: null }; const res = (0, import_es64.default)( Object.assign({}, gblock, overwrites), Object.assign({}, yblockAsJson, overwrites) ); const inners = gblock.innerBlocks || []; const yinners = yblock.get("innerBlocks"); return res && inners.length === yinners?.length && inners.every( (block, i) => areBlocksEqual(block, yinners.get(i)) ); } function createNewYAttributeMap(blockName, attributes) { return new yjs_exports.Map( Object.entries(attributes).map( ([attributeName, attributeValue]) => { return [ attributeName, createNewYAttributeValue( blockName, attributeName, attributeValue ) ]; } ) ); } function createNewYAttributeValue(blockName, attributeName, attributeValue) { const isRichText = isRichTextAttribute(blockName, attributeName); if (isRichText) { return new yjs_exports.Text(attributeValue?.toString() ?? ""); } return attributeValue; } function createNewYBlock(block) { return createYMap( Object.fromEntries( Object.entries(block).map(([key, value]) => { switch (key) { case "attributes": { return [ key, createNewYAttributeMap(block.name, value) ]; } case "innerBlocks": { const innerBlocks = new yjs_exports.Array(); if (!Array.isArray(value)) { return [key, innerBlocks]; } innerBlocks.insert( 0, value.map( (innerBlock) => createNewYBlock(innerBlock) ) ); return [key, innerBlocks]; } default: return [key, value]; } }) ) ); } function mergeCrdtBlocks(yblocks, incomingBlocks, cursorPosition) { if (!serializableBlocksCache.has(incomingBlocks)) { serializableBlocksCache.set( incomingBlocks, makeBlocksSerializable(incomingBlocks) ); } const blocksToSync = serializableBlocksCache.get(incomingBlocks) ?? []; const numOfCommonEntries = Math.min( blocksToSync.length ?? 0, yblocks.length ); let left = 0; let right = 0; for (; left < numOfCommonEntries && areBlocksEqual(blocksToSync[left], yblocks.get(left)); left++) { } for (; right < numOfCommonEntries - left && areBlocksEqual( blocksToSync[blocksToSync.length - right - 1], yblocks.get(yblocks.length - right - 1) ); right++) { } const numOfUpdatesNeeded = numOfCommonEntries - left - right; const numOfInsertionsNeeded = Math.max( 0, blocksToSync.length - yblocks.length ); const numOfDeletionsNeeded = Math.max( 0, yblocks.length - blocksToSync.length ); for (let i = 0; i < numOfUpdatesNeeded; i++, left++) { const block = blocksToSync[left]; const yblock = yblocks.get(left); Object.entries(block).forEach(([key, value]) => { switch (key) { case "attributes": { const currentAttributes = yblock.get(key); if (!currentAttributes) { yblock.set( key, createNewYAttributeMap(block.name, value) ); break; } Object.entries(value).forEach( ([attributeName, attributeValue]) => { const currentAttribute = currentAttributes?.get(attributeName); const isExpectedType = isExpectedAttributeType( block.name, attributeName, currentAttribute ); const isAttributeChanged = !isExpectedType || !(0, import_es64.default)( currentAttribute, attributeValue ); if (isAttributeChanged) { updateYBlockAttribute( block.name, attributeName, attributeValue, currentAttributes, cursorPosition ); } } ); currentAttributes.forEach( (_attrValue, attrName) => { if (!value.hasOwnProperty(attrName)) { currentAttributes.delete(attrName); } } ); break; } case "innerBlocks": { let yInnerBlocks = yblock.get(key); if (!(yInnerBlocks instanceof yjs_exports.Array)) { yInnerBlocks = new yjs_exports.Array(); yblock.set(key, yInnerBlocks); } mergeCrdtBlocks( yInnerBlocks, value ?? [], cursorPosition ); break; } default: if (!(0, import_es64.default)(block[key], yblock.get(key))) { yblock.set(key, value); } } }); yblock.forEach((_v, k) => { if (!block.hasOwnProperty(k)) { yblock.delete(k); } }); } yblocks.delete(left, numOfDeletionsNeeded); for (let i = 0; i < numOfInsertionsNeeded; i++, left++) { const newBlock = [createNewYBlock(blocksToSync[left])]; yblocks.insert(left, newBlock); } const knownClientIds = /* @__PURE__ */ new Set(); for (let j = 0; j < yblocks.length; j++) { const yblock = yblocks.get(j); let clientId = yblock.get("clientId"); if (!clientId) { continue; } if (knownClientIds.has(clientId)) { clientId = v4_default(); yblock.set("clientId", clientId); } knownClientIds.add(clientId); } } function updateYBlockAttribute(blockName, attributeName, attributeValue, currentAttributes, cursorPosition) { const isRichText = isRichTextAttribute(blockName, attributeName); const currentAttribute = currentAttributes.get(attributeName); if (isRichText && "string" === typeof attributeValue && currentAttributes.has(attributeName) && currentAttribute instanceof yjs_exports.Text) { mergeRichTextUpdate(currentAttribute, attributeValue, cursorPosition); } else { currentAttributes.set( attributeName, createNewYAttributeValue(blockName, attributeName, attributeValue) ); } } var cachedBlockAttributeTypes; function getBlockAttributeType(blockName, attributeName) { if (!cachedBlockAttributeTypes) { cachedBlockAttributeTypes = /* @__PURE__ */ new Map(); for (const blockType of (0, import_blocks.getBlockTypes)()) { cachedBlockAttributeTypes.set( blockType.name, new Map( Object.entries(blockType.attributes ?? {}).map( ([name, definition]) => { const { role, type, query } = definition; return [name, { role, type, query }]; } ) ) ); } } return cachedBlockAttributeTypes.get(blockName)?.get(attributeName); } function isExpectedAttributeType(blockName, attributeName, attributeValue) { const expectedAttributeType = getBlockAttributeType( blockName, attributeName )?.type; if (expectedAttributeType === "rich-text") { return attributeValue instanceof yjs_exports.Text; } if (expectedAttributeType === "string") { return typeof attributeValue === "string"; } return true; } function isLocalAttribute(blockName, attributeName) { return "local" === getBlockAttributeType(blockName, attributeName)?.role; } function isRichTextAttribute(blockName, attributeName) { return "rich-text" === getBlockAttributeType(blockName, attributeName)?.type; } var localDoc; function mergeRichTextUpdate(blockYText, updatedValue, cursorPosition = null) { if (!localDoc) { localDoc = new yjs_exports.Doc(); } const localYText = localDoc.getText("temporary-text"); localYText.delete(0, localYText.length); localYText.insert(0, updatedValue); const currentValueAsDelta = new Delta2(blockYText.toDelta()); const updatedValueAsDelta = new Delta2(localYText.toDelta()); const deltaDiff = currentValueAsDelta.diffWithCursor( updatedValueAsDelta, cursorPosition ); blockYText.applyDelta(deltaDiff.ops); } // packages/core-data/build-module/utils/crdt-selection.mjs var import_data6 = __toESM(require_data(), 1); var import_block_editor4 = __toESM(require_block_editor(), 1); var import_blocks2 = __toESM(require_blocks(), 1); // packages/core-data/build-module/utils/block-selection-history.mjs var SELECTION_HISTORY_DEFAULT_SIZE = 5; var YSelectionType = /* @__PURE__ */ ((YSelectionType2) => { YSelectionType2["RelativeSelection"] = "RelativeSelection"; YSelectionType2["BlockSelection"] = "BlockSelection"; return YSelectionType2; })(YSelectionType || {}); function createBlockSelectionHistory(ydoc, historySize = SELECTION_HISTORY_DEFAULT_SIZE) { let history = []; const getSelectionHistory2 = () => { return history.slice(0); }; const updateSelection = (newSelection) => { if (!newSelection?.selectionStart?.clientId || !newSelection?.selectionEnd?.clientId) { return; } const { selectionStart, selectionEnd } = newSelection; const start = convertWPBlockSelectionToSelection( selectionStart, ydoc ); const end = convertWPBlockSelectionToSelection(selectionEnd, ydoc); addToHistory({ start, end }); }; const addToHistory = (yFullSelection) => { const startClientId = yFullSelection.start.clientId; const endClientId = yFullSelection.end.clientId; history = history.filter((entry) => { const isSameBlockCombination = entry.start.clientId === startClientId && entry.end.clientId === endClientId; return !isSameBlockCombination; }); history.unshift(yFullSelection); if (history.length > historySize + 1) { history = history.slice(0, historySize + 1); } }; return { getSelectionHistory: getSelectionHistory2, updateSelection }; } function convertWPBlockSelectionToSelection(selection, ydoc) { const clientId = selection.clientId; const block = findBlockByClientIdInDoc(clientId, ydoc); const attributes = block?.get("attributes"); const attributeKey = selection.attributeKey; const changedYText = attributeKey ? attributes?.get(attributeKey) : void 0; const isYText = changedYText instanceof yjs_exports.Text; const isFullyDefinedSelection = attributeKey && clientId; if (!isYText || !isFullyDefinedSelection) { return { type: "BlockSelection", clientId }; } const offset = selection.offset ?? 0; const relativePosition = yjs_exports.createRelativePositionFromTypeIndex( changedYText, richTextOffsetToHtmlIndex(changedYText.toString(), offset) ); return { type: "RelativeSelection", attributeKey, relativePosition, clientId, offset }; } // packages/core-data/build-module/utils/crdt-selection.mjs var selectionHistoryMap = /* @__PURE__ */ new WeakMap(); function getBlockSelectionHistory(ydoc) { let history = selectionHistoryMap.get(ydoc); if (!history) { history = createBlockSelectionHistory(ydoc); selectionHistoryMap.set(ydoc, history); } return history; } function getSelectionHistory(ydoc) { return getBlockSelectionHistory(ydoc).getSelectionHistory(); } function updateSelectionHistory(ydoc, wpSelection) { return getBlockSelectionHistory(ydoc).updateSelection(wpSelection); } function convertYSelectionToBlockSelection(ySelection, ydoc) { if (ySelection.type === YSelectionType.RelativeSelection) { const { relativePosition, attributeKey, clientId } = ySelection; const absolutePosition = yjs_exports.createAbsolutePositionFromRelativePosition( relativePosition, ydoc ); if (absolutePosition) { return { clientId, attributeKey, offset: htmlIndexToRichTextOffset( absolutePosition.type.toString(), absolutePosition.index ) }; } } else if (ySelection.type === YSelectionType.BlockSelection) { return { clientId: ySelection.clientId, attributeKey: void 0, offset: void 0 }; } return null; } function convertYFullSelectionToWPSelection(yFullSelection, ydoc) { const { start, end } = yFullSelection; const startBlock = findBlockByClientIdInDoc(start.clientId, ydoc); const endBlock = findBlockByClientIdInDoc(end.clientId, ydoc); if (!startBlock || !endBlock) { return null; } const startBlockSelection = convertYSelectionToBlockSelection( start, ydoc ); const endBlockSelection = convertYSelectionToBlockSelection(end, ydoc); if (startBlockSelection === null || endBlockSelection === null) { return null; } return { selectionStart: startBlockSelection, selectionEnd: endBlockSelection }; } function findSelectionFromHistory(ydoc, selectionHistory) { for (const positionToTry of selectionHistory) { const result = convertYFullSelectionToWPSelection( positionToTry, ydoc ); if (result !== null) { return result; } } return null; } function restoreSelection(selectionHistory, ydoc) { const selectionToRestore = findSelectionFromHistory( ydoc, selectionHistory ); if (selectionToRestore === null) { return; } const { getBlock } = (0, import_data6.select)(import_block_editor4.store); const { resetSelection } = (0, import_data6.dispatch)(import_block_editor4.store); const { selectionStart, selectionEnd } = selectionToRestore; const isSelectionInSameBlock = selectionStart.clientId === selectionEnd.clientId; if (isSelectionInSameBlock) { const block = getBlock(selectionStart.clientId); const isBlockEmpty = block && (0, import_blocks2.isUnmodifiedBlock)(block); const isBeginningOfEmptyBlock = 0 === selectionStart.offset && 0 === selectionEnd.offset && isBlockEmpty && !selectionStart.attributeKey && !selectionEnd.attributeKey; if (isBeginningOfEmptyBlock) { const selectionStartWithoutOffset = { clientId: selectionStart.clientId }; const selectionEndWithoutOffset = { clientId: selectionEnd.clientId }; resetSelection( selectionStartWithoutOffset, selectionEndWithoutOffset, 0 ); } else { resetSelection(selectionStart, selectionEnd, 0); } } else { resetSelection(selectionEnd, selectionEnd, 0); } } function getShiftedSelection(ydoc, selectionHistory) { if (selectionHistory.length === 0) { return null; } const { start, end } = selectionHistory[0]; if (start.type === YSelectionType.BlockSelection || end.type === YSelectionType.BlockSelection) { return null; } const selectionStart = convertYSelectionToBlockSelection(start, ydoc); const selectionEnd = convertYSelectionToBlockSelection(end, ydoc); if (!selectionStart || !selectionEnd) { return null; } const startShifted = selectionStart.offset !== start.offset; const endShifted = selectionEnd.offset !== end.offset; if (!startShifted && !endShifted) { return null; } return { selectionStart, selectionEnd }; } // packages/core-data/build-module/utils/crdt.mjs var POST_META_KEY_FOR_CRDT_DOC_PERSISTENCE = "_crdt_document"; var disallowedPostMetaKeys = /* @__PURE__ */ new Set([ POST_META_KEY_FOR_CRDT_DOC_PERSISTENCE ]); function defaultApplyChangesToCRDTDoc(ydoc, changes) { const ymap = getRootMap(ydoc, CRDT_RECORD_MAP_KEY2); Object.entries(changes).forEach(([key, newValue]) => { if ("function" === typeof newValue) { return; } switch (key) { // Add support for additional data types here. default: { const currentValue = ymap.get(key); updateMapValue(ymap, key, currentValue, newValue); } } }); } function applyPostChangesToCRDTDoc(ydoc, changes, syncedProperties) { const ymap = getRootMap(ydoc, CRDT_RECORD_MAP_KEY2); Object.keys(changes).forEach((key) => { if (!syncedProperties.has(key)) { return; } const newValue = changes[key]; if ("function" === typeof newValue) { return; } switch (key) { case "blocks": { if (!newValue) { ymap.set(key, void 0); break; } let currentBlocks = ymap.get(key); if (!(currentBlocks instanceof yjs_exports.Array)) { currentBlocks = new yjs_exports.Array(); ymap.set(key, currentBlocks); } const cursorPosition = changes.selection?.selectionStart?.offset ?? null; mergeCrdtBlocks(currentBlocks, newValue, cursorPosition); break; } case "content": case "excerpt": case "title": { const currentValue = ymap.get(key); let rawValue = getRawValue(newValue); if (key === "title" && !currentValue?.toString() && "Auto Draft" === rawValue) { rawValue = ""; } if (currentValue instanceof yjs_exports.Text) { mergeRichTextUpdate(currentValue, rawValue ?? ""); } else { const newYText = new yjs_exports.Text(rawValue ?? ""); ymap.set(key, newYText); } break; } // "Meta" is overloaded term; here, it refers to post meta. case "meta": { let metaMap = ymap.get("meta"); if (!isYMap(metaMap)) { metaMap = createYMap(); ymap.set("meta", metaMap); } Object.entries(newValue ?? {}).forEach( ([metaKey, metaValue]) => { if (disallowedPostMetaKeys.has(metaKey)) { return; } updateMapValue( metaMap, metaKey, metaMap.get(metaKey), // current value in CRDT metaValue // new value from changes ); } ); break; } case "slug": { if (!newValue) { break; } const currentValue = ymap.get(key); updateMapValue(ymap, key, currentValue, newValue); break; } // Add support for additional properties here. default: { const currentValue = ymap.get(key); updateMapValue(ymap, key, currentValue, newValue); } } }); if (changes.selection) { const selection = changes.selection; setTimeout(() => { updateSelectionHistory(ydoc, selection); }, 0); } } function defaultGetChangesFromCRDTDoc(crdtDoc) { return getRootMap(crdtDoc, CRDT_RECORD_MAP_KEY2).toJSON(); } function getPostChangesFromCRDTDoc(ydoc, editedRecord, syncedProperties) { const ymap = getRootMap(ydoc, CRDT_RECORD_MAP_KEY2); let allowedMetaChanges = {}; const changes = Object.fromEntries( Object.entries(ymap.toJSON()).filter(([key, newValue]) => { if (!syncedProperties.has(key)) { return false; } const currentValue = editedRecord[key]; switch (key) { case "blocks": { if (ydoc.meta?.get(CRDT_DOC_META_PERSISTENCE_KEY2) && editedRecord.content) { const blocksJson = ymap.get("blocks")?.toJSON() ?? []; return (0, import_blocks3.__unstableSerializeAndClean)(blocksJson).trim() !== getRawValue(editedRecord.content); } return true; } case "date": { const currentDateIsFloating = null === currentValue || editedRecord.modified === currentValue; if (currentDateIsFloating) { return false; } return haveValuesChanged(currentValue, newValue); } case "meta": { const currentMeta = currentValue ?? {}; allowedMetaChanges = Object.fromEntries( Object.entries(newValue ?? {}).filter( ([metaKey]) => { if (disallowedPostMetaKeys.has(metaKey)) { return false; } return metaKey in currentMeta; } ) ); const mergedValue = { ...currentMeta, ...allowedMetaChanges }; return haveValuesChanged(currentValue, mergedValue); } case "status": { if ("auto-draft" === newValue) { return false; } return haveValuesChanged(currentValue, newValue); } case "content": case "excerpt": case "title": { return haveValuesChanged( getRawValue(currentValue), newValue ); } // Add support for additional data types here. default: { return haveValuesChanged(currentValue, newValue); } } }) ); if (changes.blocks) { changes.blocks = deserializeBlockAttributes( changes.blocks ); } if ("object" === typeof changes.meta) { changes.meta = { ...editedRecord.meta, ...allowedMetaChanges }; } const selectionHistory = getSelectionHistory(ydoc); const shiftedSelection = getShiftedSelection(ydoc, selectionHistory); if (shiftedSelection) { changes.selection = { ...shiftedSelection, initialPosition: 0 }; } return changes; } var defaultSyncConfig = { applyChangesToCRDTDoc: defaultApplyChangesToCRDTDoc, createAwareness: (ydoc) => new BaseAwareness(ydoc), getChangesFromCRDTDoc: defaultGetChangesFromCRDTDoc }; var defaultCollectionSyncConfig = { applyChangesToCRDTDoc: () => { }, getChangesFromCRDTDoc: () => ({}), shouldSync: (_, objectId) => null === objectId }; function getRawValue(value) { if ("string" === typeof value) { return value; } if (value && "object" === typeof value && "raw" in value && "string" === typeof value.raw) { return value.raw; } return void 0; } function haveValuesChanged(currentValue, newValue) { return !(0, import_es65.default)(currentValue, newValue); } function updateMapValue(map2, key, currentValue, newValue) { if (void 0 === newValue) { map2.delete(key); return; } if (haveValuesChanged(currentValue, newValue)) { map2.set(key, newValue); } } // packages/core-data/build-module/entities.mjs var DEFAULT_ENTITY_KEY = "id"; var POST_RAW_ATTRIBUTES = ["title", "excerpt", "content"]; var blocksTransientEdits = { blocks: { read: (record) => (0, import_blocks4.parse)(record.content?.raw ?? ""), write: (record) => ({ content: (0, import_blocks4.__unstableSerializeAndClean)(record.blocks) }) } }; var rootEntitiesConfig = [ { label: (0, import_i18n.__)("Base"), kind: "root", key: false, name: "__unstableBase", baseURL: "/", baseURLParams: { // Please also change the preload path when changing this. // @see lib/compat/wordpress-7.0/preload.php _fields: [ "description", "gmt_offset", "home", "image_sizes", "image_size_threshold", "image_output_formats", "jpeg_interlaced", "png_interlaced", "gif_interlaced", "name", "site_icon", "site_icon_url", "site_logo", "timezone_string", "url", "page_for_posts", "page_on_front", "show_on_front" ].join(",") }, // The entity doesn't support selecting multiple records. // The property is maintained for backward compatibility. plural: "__unstableBases" }, { label: (0, import_i18n.__)("Post Type"), name: "postType", kind: "root", key: "slug", baseURL: "/wp/v2/types", baseURLParams: { context: "edit" }, plural: "postTypes" }, { name: "media", kind: "root", baseURL: "/wp/v2/media", baseURLParams: { context: "edit" }, plural: "mediaItems", label: (0, import_i18n.__)("Media"), rawAttributes: ["caption", "title", "description"], supportsPagination: true }, { name: "taxonomy", kind: "root", key: "slug", baseURL: "/wp/v2/taxonomies", baseURLParams: { context: "edit" }, plural: "taxonomies", label: (0, import_i18n.__)("Taxonomy") }, { name: "sidebar", kind: "root", baseURL: "/wp/v2/sidebars", baseURLParams: { context: "edit" }, plural: "sidebars", transientEdits: { blocks: true }, label: (0, import_i18n.__)("Widget areas") }, { name: "widget", kind: "root", baseURL: "/wp/v2/widgets", baseURLParams: { context: "edit" }, plural: "widgets", transientEdits: { blocks: true }, label: (0, import_i18n.__)("Widgets") }, { name: "widgetType", kind: "root", baseURL: "/wp/v2/widget-types", baseURLParams: { context: "edit" }, plural: "widgetTypes", label: (0, import_i18n.__)("Widget types") }, { label: (0, import_i18n.__)("User"), name: "user", kind: "root", baseURL: "/wp/v2/users", getTitle: (record) => record?.name || record?.slug, baseURLParams: { context: "edit" }, plural: "users", supportsPagination: true }, { name: "comment", kind: "root", baseURL: "/wp/v2/comments", baseURLParams: { context: "edit" }, plural: "comments", label: (0, import_i18n.__)("Comment"), supportsPagination: true, syncConfig: defaultCollectionSyncConfig }, { name: "menu", kind: "root", baseURL: "/wp/v2/menus", baseURLParams: { context: "edit" }, plural: "menus", label: (0, import_i18n.__)("Menu"), supportsPagination: true }, { name: "menuItem", kind: "root", baseURL: "/wp/v2/menu-items", baseURLParams: { context: "edit" }, plural: "menuItems", label: (0, import_i18n.__)("Menu Item"), rawAttributes: ["title"], supportsPagination: true }, { name: "menuLocation", kind: "root", baseURL: "/wp/v2/menu-locations", baseURLParams: { context: "edit" }, plural: "menuLocations", label: (0, import_i18n.__)("Menu Location"), key: "name" }, { label: (0, import_i18n.__)("Global Styles"), name: "globalStyles", kind: "root", baseURL: "/wp/v2/global-styles", baseURLParams: { context: "edit" }, plural: "globalStylesVariations", // Should be different from name. getTitle: () => (0, import_i18n.__)("Custom Styles"), getRevisionsUrl: (parentId, revisionId) => `/wp/v2/global-styles/${parentId}/revisions${revisionId ? "/" + revisionId : ""}`, supportsPagination: true }, { label: (0, import_i18n.__)("Themes"), name: "theme", kind: "root", baseURL: "/wp/v2/themes", baseURLParams: { context: "edit" }, plural: "themes", key: "stylesheet" }, { label: (0, import_i18n.__)("Plugins"), name: "plugin", kind: "root", baseURL: "/wp/v2/plugins", baseURLParams: { context: "edit" }, plural: "plugins", key: "plugin" }, { label: (0, import_i18n.__)("Status"), name: "status", kind: "root", baseURL: "/wp/v2/statuses", baseURLParams: { context: "edit" }, plural: "statuses", key: "slug" }, { label: (0, import_i18n.__)("Registered Templates"), name: "registeredTemplate", kind: "root", baseURL: "/wp/v2/registered-templates", key: "id" }, { label: (0, import_i18n.__)("Font Collections"), name: "fontCollection", kind: "root", baseURL: "/wp/v2/font-collections", baseURLParams: { context: "view" }, plural: "fontCollections", key: "slug" }, { label: (0, import_i18n.__)("Icons"), name: "icon", kind: "root", baseURL: "/wp/v2/icons", baseURLParams: { context: "view" }, plural: "icons", key: "name" } ]; var deprecatedEntities = { root: { media: { since: "6.9", alternative: { kind: "postType", name: "attachment" } } } }; var additionalEntityConfigLoaders = [ { kind: "postType", loadEntities: loadPostTypeEntities }, { kind: "taxonomy", loadEntities: loadTaxonomyEntities }, { kind: "root", name: "site", plural: "sites", loadEntities: loadSiteEntity } ]; var prePersistPostType = async (persistedRecord, edits, name, isTemplate) => { const newEdits = {}; if (!isTemplate && persistedRecord?.status === "auto-draft") { if (!edits.status && !newEdits.status) { newEdits.status = "draft"; } if ((!edits.title || edits.title === "Auto Draft") && !newEdits.title && (!persistedRecord?.title || persistedRecord?.title === "Auto Draft")) { newEdits.title = ""; } } if (persistedRecord) { const objectType = `postType/${name}`; const objectId = persistedRecord.id; const serializedDoc = await getSyncManager()?.createPersistedCRDTDoc( objectType, objectId ); if (serializedDoc) { newEdits.meta = { ...edits.meta, [POST_META_KEY_FOR_CRDT_DOC_PERSISTENCE]: serializedDoc }; } } return newEdits; }; async function loadPostTypeEntities() { const postTypesPromise = (0, import_api_fetch2.default)({ path: "/wp/v2/types?context=view" }); const taxonomiesPromise = window._wpCollaborationEnabled ? (0, import_api_fetch2.default)({ path: "/wp/v2/taxonomies?context=view" }) : Promise.resolve({}); const [postTypes, taxonomies] = await Promise.all([ postTypesPromise, taxonomiesPromise ]); return Object.entries(postTypes ?? {}).map(([name, postType]) => { const isTemplate = ["wp_template", "wp_template_part"].includes( name ); const namespace = postType?.rest_namespace ?? "wp/v2"; const syncedProperties = /* @__PURE__ */ new Set([ "author", "blocks", "content", "comment_status", "date", "excerpt", "featured_media", "format", "meta", "ping_status", "slug", "status", "sticky", "template", "title", ...postType.taxonomies?.map((taxonomy) => taxonomies?.[taxonomy]?.rest_base)?.filter(Boolean) ?? [] ]); const entity2 = { kind: "postType", baseURL: `/${namespace}/${postType.rest_base}`, baseURLParams: { context: "edit" }, name, label: postType.name, transientEdits: { ...blocksTransientEdits, selection: true }, mergedEdits: { meta: true }, rawAttributes: POST_RAW_ATTRIBUTES, getTitle: (record) => record?.title?.rendered || record?.title || (isTemplate ? capitalCase(record.slug ?? "") : String(record.id)), __unstablePrePersist: (persistedRecord, edits) => prePersistPostType(persistedRecord, edits, name, isTemplate), __unstable_rest_base: postType.rest_base, supportsPagination: true, getRevisionsUrl: (parentId, revisionId) => `/${namespace}/${postType.rest_base}/${parentId}/revisions${revisionId ? "/" + revisionId : ""}`, revisionKey: isTemplate && !window?.__experimentalTemplateActivate ? "wp_id" : DEFAULT_ENTITY_KEY }; entity2.syncConfig = { /** * Apply changes from the local editor to the local CRDT document so * that those changes can be synced to other peers (via the provider). * * @param {import('@wordpress/sync').CRDTDoc} crdtDoc * @param {Partial< import('@wordpress/sync').ObjectData >} changes * @return {void} */ applyChangesToCRDTDoc: (crdtDoc, changes) => applyPostChangesToCRDTDoc(crdtDoc, changes, syncedProperties), /** * Create the awareness instance for the entity's CRDT document. * * @param {import('@wordpress/sync').CRDTDoc} ydoc * @param {import('@wordpress/sync').ObjectID} objectId * @return {import('@wordpress/sync').Awareness} Awareness instance */ createAwareness: (ydoc, objectId) => { const kind = "postType"; const id2 = parseInt(objectId, 10); return new PostEditorAwareness(ydoc, kind, name, id2); }, /** * Extract changes from a CRDT document that can be used to update the * local editor state. * * @param {import('@wordpress/sync').CRDTDoc} crdtDoc * @param {import('@wordpress/sync').ObjectData} editedRecord * @return {Partial< import('@wordpress/sync').ObjectData >} Changes to record */ getChangesFromCRDTDoc: (crdtDoc, editedRecord) => getPostChangesFromCRDTDoc( crdtDoc, editedRecord, syncedProperties ), /** * Extract changes from a CRDT document that can be used to update the * local editor state. * * @param {import('@wordpress/sync').ObjectData} record * @return {Partial< import('@wordpress/sync').ObjectData >} Changes to record */ getPersistedCRDTDoc: (record) => { return record?.meta?.[POST_META_KEY_FOR_CRDT_DOC_PERSISTENCE] || null; } }; return entity2; }); } async function loadTaxonomyEntities() { const taxonomies = await (0, import_api_fetch2.default)({ path: "/wp/v2/taxonomies?context=view" }); return Object.entries(taxonomies ?? {}).map(([name, taxonomy]) => { const namespace = taxonomy?.rest_namespace ?? "wp/v2"; const entity2 = { kind: "taxonomy", baseURL: `/${namespace}/${taxonomy.rest_base}`, baseURLParams: { context: "edit" }, name, label: taxonomy.name, getTitle: (record) => record?.name, supportsPagination: true }; entity2.syncConfig = defaultSyncConfig; return entity2; }); } async function loadSiteEntity() { const entity2 = { label: (0, import_i18n.__)("Site"), name: "site", kind: "root", key: false, baseURL: "/wp/v2/settings", meta: {} }; const site = await (0, import_api_fetch2.default)({ path: entity2.baseURL, method: "OPTIONS" }); const labels = {}; Object.entries(site?.schema?.properties ?? {}).forEach( ([key, value]) => { if (typeof value === "object" && value.title) { labels[key] = value.title; } } ); return [{ ...entity2, meta: { labels } }]; } var getMethodName = (kind, name, prefix = "get") => { const kindPrefix = kind === "root" ? "" : pascalCase(kind); const suffix = pascalCase(name); return `${prefix}${kindPrefix}${suffix}`; }; // packages/core-data/build-module/queried-data/reducer.mjs function getContextFromAction(action) { const { query } = action; if (!query) { return "default"; } const queryParts = get_query_parts_default(query); return queryParts.context; } function getMergedItemIds(itemIds, nextItemIds, page, perPage) { const receivedAllIds = page === 1 && perPage === -1; if (receivedAllIds) { return nextItemIds; } const nextItemIdsStartIndex = (page - 1) * perPage; const size2 = Math.max( itemIds?.length ?? 0, nextItemIdsStartIndex + nextItemIds.length ); const mergedItemIds = new Array(size2); for (let i = 0; i < size2; i++) { const isInNextItemsRange = i >= nextItemIdsStartIndex && i < nextItemIdsStartIndex + perPage; mergedItemIds[i] = isInNextItemsRange ? nextItemIds[i - nextItemIdsStartIndex] : itemIds?.[i]; } return mergedItemIds; } function removeEntitiesById(entities2, ids) { return Object.fromEntries( Object.entries(entities2).filter( ([id2]) => !ids.some((itemId) => { if (Number.isInteger(itemId)) { return itemId === +id2; } return itemId === id2; }) ) ); } function items(state = {}, action) { switch (action.type) { case "RECEIVE_ITEMS": { const context = getContextFromAction(action); const key = action.key || DEFAULT_ENTITY_KEY; const itemsList = Array.isArray(action.items) ? action.items : [action.items]; return { ...state, [context]: { ...state[context], ...Object.fromEntries( itemsList.map((item) => [ item?.[key], conservativeMapItem( state?.[context]?.[item?.[key]], item ) ]) ) } }; } case "REMOVE_ITEMS": return Object.fromEntries( Object.entries(state).map(([itemId, contextState]) => [ itemId, removeEntitiesById(contextState, action.itemIds) ]) ); } return state; } function itemIsComplete(state = {}, action) { switch (action.type) { case "RECEIVE_ITEMS": { const context = getContextFromAction(action); const { query, key = DEFAULT_ENTITY_KEY } = action; const itemsList = Array.isArray(action.items) ? action.items : [action.items]; const queryParts = query ? get_query_parts_default(query) : {}; const isCompleteQuery = !query || !Array.isArray(queryParts.fields); return { ...state, [context]: { ...state[context], ...itemsList.reduce((result, item) => { const itemId = item?.[key]; result[itemId] = state?.[context]?.[itemId] || isCompleteQuery; return result; }, {}) } }; } case "REMOVE_ITEMS": return Object.fromEntries( Object.entries(state).map(([itemId, contextState]) => [ itemId, removeEntitiesById(contextState, action.itemIds) ]) ); } return state; } var receiveQueries = (0, import_compose.compose)([ // Limit to matching action type so we don't attempt to replace action on // an unhandled action. if_matching_action_default((action) => "query" in action), // Inject query parts into action for use both in `onSubKey` and reducer. replace_action_default((action) => { if (action.query) { return { ...action, ...get_query_parts_default(action.query) }; } return action; }), on_sub_key_default("context"), // Queries shape is shared, but keyed by query `stableKey` part. Original // reducer tracks only a single query object. on_sub_key_default("stableKey") ])((state = {}, action) => { if (action.type !== "RECEIVE_ITEMS") { return state; } if (!Array.isArray(action.items)) { return state; } const key = action.key ?? DEFAULT_ENTITY_KEY; return { itemIds: getMergedItemIds( state?.itemIds || [], action.items.map((item) => item?.[key]).filter(Boolean), action.page, action.perPage ), meta: action.meta }; }); var queries = (state = {}, action) => { switch (action.type) { case "RECEIVE_ITEMS": return receiveQueries(state, action); case "REMOVE_ITEMS": const removedItems = action.itemIds.reduce((result, itemId) => { result[itemId] = true; return result; }, {}); return Object.fromEntries( Object.entries(state).map( ([queryGroup, contextQueries]) => [ queryGroup, Object.fromEntries( Object.entries(contextQueries).map( ([query, queryItems]) => [ query, { ...queryItems, itemIds: queryItems.itemIds.filter( (queryId) => !removedItems[queryId] ) } ] ) ) ] ) ); default: return state; } }; var reducer_default = (0, import_data7.combineReducers)({ items, itemIsComplete, queries }); // packages/core-data/build-module/reducer.mjs function users(state = { byId: {}, queries: {} }, action) { switch (action.type) { case "RECEIVE_USER_QUERY": return { byId: { ...state.byId, // Key users by their ID. ...action.users.reduce( (newUsers, user) => ({ ...newUsers, [user.id]: user }), {} ) }, queries: { ...state.queries, [action.queryID]: action.users.map((user) => user.id) } }; } return state; } function currentUser(state = {}, action) { switch (action.type) { case "RECEIVE_CURRENT_USER": return action.currentUser; } return state; } function currentTheme(state = void 0, action) { switch (action.type) { case "RECEIVE_CURRENT_THEME": return action.currentTheme.stylesheet; } return state; } function currentGlobalStylesId(state = void 0, action) { switch (action.type) { case "RECEIVE_CURRENT_GLOBAL_STYLES_ID": return action.id; } return state; } function themeBaseGlobalStyles(state = {}, action) { switch (action.type) { case "RECEIVE_THEME_GLOBAL_STYLES": return { ...state, [action.stylesheet]: action.globalStyles }; } return state; } function themeGlobalStyleVariations(state = {}, action) { switch (action.type) { case "RECEIVE_THEME_GLOBAL_STYLE_VARIATIONS": return { ...state, [action.stylesheet]: action.variations }; } return state; } var withMultiEntityRecordEdits = (reducer) => (state, action) => { if (action.type === "UNDO" || action.type === "REDO") { const { record } = action; let newState = state; record.forEach(({ id: { kind, name, recordId }, changes }) => { newState = reducer(newState, { type: "EDIT_ENTITY_RECORD", kind, name, recordId, edits: Object.entries(changes).reduce( (acc, [key, value]) => { acc[key] = action.type === "UNDO" ? value.from : value.to; return acc; }, {} ) }); }); return newState; } return reducer(state, action); }; function entity(entityConfig) { return (0, import_compose2.compose)([ withMultiEntityRecordEdits, // Limit to matching action type so we don't attempt to replace action on // an unhandled action. if_matching_action_default( (action) => action.name && action.kind && action.name === entityConfig.name && action.kind === entityConfig.kind ), // Inject the entity config into the action. replace_action_default((action) => { return { key: entityConfig.key || DEFAULT_ENTITY_KEY, ...action }; }) ])( (0, import_data8.combineReducers)({ queriedData: reducer_default, edits: (state = {}, action) => { switch (action.type) { case "RECEIVE_ITEMS": const context = action?.query?.context ?? "default"; if (context !== "default") { return state; } const nextState = { ...state }; const itemsList = Array.isArray(action.items) ? action.items : [action.items]; for (const record of itemsList) { const recordId = record?.[action.key]; const edits = nextState[recordId]; if (!edits) { continue; } const nextEdits2 = Object.keys(edits).reduce( (acc, key) => { if ( // Edits are the "raw" attribute values, but records may have // objects with more properties, so we use `get` here for the // comparison. !(0, import_es66.default)( edits[key], record[key]?.raw ?? record[key] ) && // Sometimes the server alters the sent value which means // we need to also remove the edits before the api request. (!action.persistedEdits || !(0, import_es66.default)( edits[key], action.persistedEdits[key] )) ) { acc[key] = edits[key]; } return acc; }, {} ); if (Object.keys(nextEdits2).length) { nextState[recordId] = nextEdits2; } else { delete nextState[recordId]; } } return nextState; case "EDIT_ENTITY_RECORD": const nextEdits = { ...state[action.recordId], ...action.edits }; Object.keys(nextEdits).forEach((key) => { if (nextEdits[key] === void 0) { delete nextEdits[key]; } }); return { ...state, [action.recordId]: nextEdits }; } return state; }, saving: (state = {}, action) => { switch (action.type) { case "SAVE_ENTITY_RECORD_START": case "SAVE_ENTITY_RECORD_FINISH": return { ...state, [action.recordId]: { pending: action.type === "SAVE_ENTITY_RECORD_START", error: action.error, isAutosave: action.isAutosave } }; } return state; }, deleting: (state = {}, action) => { switch (action.type) { case "DELETE_ENTITY_RECORD_START": case "DELETE_ENTITY_RECORD_FINISH": return { ...state, [action.recordId]: { pending: action.type === "DELETE_ENTITY_RECORD_START", error: action.error } }; } return state; }, revisions: (state = {}, action) => { if (action.type === "RECEIVE_ITEM_REVISIONS") { const recordKey = action.recordKey; delete action.recordKey; const newState = reducer_default(state[recordKey], { ...action, type: "RECEIVE_ITEMS" }); return { ...state, [recordKey]: newState }; } if (action.type === "REMOVE_ITEMS") { return Object.fromEntries( Object.entries(state).filter( ([id2]) => !action.itemIds.some((itemId) => { if (Number.isInteger(itemId)) { return itemId === +id2; } return itemId === id2; }) ) ); } return state; } }) ); } function entitiesConfig(state = rootEntitiesConfig, action) { switch (action.type) { case "ADD_ENTITIES": return [...state, ...action.entities]; } return state; } var entities = (state = {}, action) => { const newConfig = entitiesConfig(state.config, action); let entitiesDataReducer = state.reducer; if (!entitiesDataReducer || newConfig !== state.config) { const entitiesByKind = newConfig.reduce((acc, record) => { const { kind } = record; if (!acc[kind]) { acc[kind] = []; } acc[kind].push(record); return acc; }, {}); entitiesDataReducer = (0, import_data8.combineReducers)( Object.fromEntries( Object.entries(entitiesByKind).map( ([kind, subEntities]) => { const kindReducer = (0, import_data8.combineReducers)( Object.fromEntries( subEntities.map((entityConfig) => [ entityConfig.name, entity(entityConfig) ]) ) ); return [kind, kindReducer]; } ) ) ); } const newData = entitiesDataReducer(state.records, action); if (newData === state.records && newConfig === state.config && entitiesDataReducer === state.reducer) { return state; } return { reducer: entitiesDataReducer, records: newData, config: newConfig }; }; function undoManager(state = (0, import_undo_manager2.createUndoManager)()) { return state; } function editsReference(state = {}, action) { switch (action.type) { case "EDIT_ENTITY_RECORD": case "UNDO": case "REDO": return {}; } return state; } function embedPreviews(state = {}, action) { switch (action.type) { case "RECEIVE_EMBED_PREVIEW": const { url, preview } = action; return { ...state, [url]: preview }; } return state; } function userPermissions(state = {}, action) { switch (action.type) { case "RECEIVE_USER_PERMISSION": return { ...state, [action.key]: action.isAllowed }; case "RECEIVE_USER_PERMISSIONS": return { ...state, ...action.permissions }; } return state; } function autosaves(state = {}, action) { switch (action.type) { case "RECEIVE_AUTOSAVES": const { postId, autosaves: autosavesData } = action; return { ...state, [postId]: autosavesData }; } return state; } function blockPatterns(state = [], action) { switch (action.type) { case "RECEIVE_BLOCK_PATTERNS": return action.patterns; } return state; } function blockPatternCategories(state = [], action) { switch (action.type) { case "RECEIVE_BLOCK_PATTERN_CATEGORIES": return action.categories; } return state; } function userPatternCategories(state = [], action) { switch (action.type) { case "RECEIVE_USER_PATTERN_CATEGORIES": return action.patternCategories; } return state; } function navigationFallbackId(state = null, action) { switch (action.type) { case "RECEIVE_NAVIGATION_FALLBACK_ID": return action.fallbackId; } return state; } function themeGlobalStyleRevisions(state = {}, action) { switch (action.type) { case "RECEIVE_THEME_GLOBAL_STYLE_REVISIONS": return { ...state, [action.currentId]: action.revisions }; } return state; } function defaultTemplates(state = {}, action) { switch (action.type) { case "RECEIVE_DEFAULT_TEMPLATE": return { ...state, [JSON.stringify(action.query)]: action.templateId }; } return state; } function registeredPostMeta(state = {}, action) { switch (action.type) { case "RECEIVE_REGISTERED_POST_META": return { ...state, [action.postType]: action.registeredPostMeta }; } return state; } function editorSettings(state = null, action) { switch (action.type) { case "RECEIVE_EDITOR_SETTINGS": return action.settings; } return state; } function editorAssets(state = null, action) { switch (action.type) { case "RECEIVE_EDITOR_ASSETS": return action.assets; } return state; } function syncConnectionStatuses(state = {}, action) { switch (action.type) { case "SET_SYNC_CONNECTION_STATUS": { const key = `${action.kind}/${action.name}:${action.key}`; return { ...state, [key]: action.status }; } case "CLEAR_SYNC_CONNECTION_STATUS": { const key = `${action.kind}/${action.name}:${action.key}`; const { [key]: _, ...rest } = state; return rest; } } return state; } function collaborationSupported(state = true, action) { switch (action.type) { case "SET_COLLABORATION_SUPPORTED": return action.supported; case "SET_SYNC_CONNECTION_STATUS": if (ConnectionErrorCode2.DOCUMENT_SIZE_LIMIT_EXCEEDED === action.status?.error?.code) { return false; } return state; } return state; } var reducer_default2 = (0, import_data8.combineReducers)({ users, currentTheme, currentGlobalStylesId, currentUser, themeGlobalStyleVariations, themeBaseGlobalStyles, themeGlobalStyleRevisions, entities, editsReference, undoManager, embedPreviews, userPermissions, autosaves, blockPatterns, blockPatternCategories, userPatternCategories, navigationFallbackId, defaultTemplates, registeredPostMeta, editorSettings, editorAssets, syncConnectionStatuses, collaborationSupported }); // packages/core-data/build-module/selectors.mjs var selectors_exports = {}; __export(selectors_exports, { __experimentalGetCurrentGlobalStylesId: () => __experimentalGetCurrentGlobalStylesId, __experimentalGetCurrentThemeBaseGlobalStyles: () => __experimentalGetCurrentThemeBaseGlobalStyles, __experimentalGetCurrentThemeGlobalStylesVariations: () => __experimentalGetCurrentThemeGlobalStylesVariations, __experimentalGetDirtyEntityRecords: () => __experimentalGetDirtyEntityRecords, __experimentalGetEntitiesBeingSaved: () => __experimentalGetEntitiesBeingSaved, __experimentalGetEntityRecordNoResolver: () => __experimentalGetEntityRecordNoResolver, canUser: () => canUser, canUserEditEntityRecord: () => canUserEditEntityRecord, getAuthors: () => getAuthors, getAutosave: () => getAutosave, getAutosaves: () => getAutosaves, getBlockPatternCategories: () => getBlockPatternCategories, getBlockPatterns: () => getBlockPatterns, getCurrentTheme: () => getCurrentTheme, getCurrentThemeGlobalStylesRevisions: () => getCurrentThemeGlobalStylesRevisions, getCurrentUser: () => getCurrentUser, getDefaultTemplateId: () => getDefaultTemplateId, getEditedEntityRecord: () => getEditedEntityRecord, getEmbedPreview: () => getEmbedPreview, getEntitiesByKind: () => getEntitiesByKind, getEntitiesConfig: () => getEntitiesConfig, getEntity: () => getEntity, getEntityConfig: () => getEntityConfig, getEntityRecord: () => getEntityRecord, getEntityRecordEdits: () => getEntityRecordEdits, getEntityRecordNonTransientEdits: () => getEntityRecordNonTransientEdits, getEntityRecords: () => getEntityRecords, getEntityRecordsTotalItems: () => getEntityRecordsTotalItems, getEntityRecordsTotalPages: () => getEntityRecordsTotalPages, getLastEntityDeleteError: () => getLastEntityDeleteError, getLastEntitySaveError: () => getLastEntitySaveError, getRawEntityRecord: () => getRawEntityRecord, getRedoEdit: () => getRedoEdit, getReferenceByDistinctEdits: () => getReferenceByDistinctEdits, getRevision: () => getRevision, getRevisions: () => getRevisions, getThemeSupports: () => getThemeSupports, getUndoEdit: () => getUndoEdit, getUserPatternCategories: () => getUserPatternCategories, getUserQueryResults: () => getUserQueryResults, hasEditsForEntityRecord: () => hasEditsForEntityRecord, hasEntityRecord: () => hasEntityRecord, hasEntityRecords: () => hasEntityRecords, hasFetchedAutosaves: () => hasFetchedAutosaves, hasRedo: () => hasRedo, hasUndo: () => hasUndo, isAutosavingEntityRecord: () => isAutosavingEntityRecord, isDeletingEntityRecord: () => isDeletingEntityRecord, isPreviewEmbedFallback: () => isPreviewEmbedFallback, isRequestingEmbedPreview: () => isRequestingEmbedPreview, isSavingEntityRecord: () => isSavingEntityRecord }); var import_data10 = __toESM(require_data(), 1); var import_url2 = __toESM(require_url(), 1); var import_deprecated2 = __toESM(require_deprecated(), 1); // packages/core-data/build-module/private-selectors.mjs var private_selectors_exports = {}; __export(private_selectors_exports, { getBlockPatternsForPostType: () => getBlockPatternsForPostType, getEditorAssets: () => getEditorAssets, getEditorSettings: () => getEditorSettings, getEntityRecordPermissions: () => getEntityRecordPermissions, getEntityRecordsPermissions: () => getEntityRecordsPermissions, getHomePage: () => getHomePage, getNavigationFallbackId: () => getNavigationFallbackId, getPostsPageId: () => getPostsPageId, getRegisteredPostMeta: () => getRegisteredPostMeta, getSyncConnectionStatus: () => getSyncConnectionStatus, getTemplateId: () => getTemplateId, getUndoManager: () => getUndoManager, isCollaborationSupported: () => isCollaborationSupported }); var import_data9 = __toESM(require_data(), 1); // packages/core-data/build-module/utils/log-entity-deprecation.mjs var import_deprecated = __toESM(require_deprecated(), 1); var loggedAlready = false; function logEntityDeprecation(kind, name, functionName, { alternativeFunctionName, isShorthandSelector = false } = {}) { const deprecation = deprecatedEntities[kind]?.[name]; if (!deprecation) { return; } if (!loggedAlready) { const { alternative } = deprecation; const message = isShorthandSelector ? `'${functionName}'` : `The '${kind}', '${name}' entity (used via '${functionName}')`; let alternativeMessage = `the '${alternative.kind}', '${alternative.name}' entity`; if (alternativeFunctionName) { alternativeMessage += ` via the '${alternativeFunctionName}' function`; } (0, import_deprecated.default)(message, { ...deprecation, alternative: alternativeMessage }); } loggedAlready = true; setTimeout(() => { loggedAlready = false; }, 0); } // packages/core-data/build-module/private-selectors.mjs function getUndoManager(state) { return getSyncManager()?.undoManager ?? state.undoManager; } function getNavigationFallbackId(state) { return state.navigationFallbackId; } var getBlockPatternsForPostType = (0, import_data9.createRegistrySelector)( (select5) => (0, import_data9.createSelector)( (state, postType) => select5(STORE_NAME).getBlockPatterns().filter( ({ postTypes }) => !postTypes || Array.isArray(postTypes) && postTypes.includes(postType) ), () => [select5(STORE_NAME).getBlockPatterns()] ) ); var getEntityRecordsPermissions = (0, import_data9.createRegistrySelector)( (select5) => (0, import_data9.createSelector)( (state, kind, name, ids) => { const normalizedIds = Array.isArray(ids) ? ids : [ids]; return normalizedIds.map((id2) => ({ delete: select5(STORE_NAME).canUser("delete", { kind, name, id: id2 }), update: select5(STORE_NAME).canUser("update", { kind, name, id: id2 }) })); }, (state) => [state.userPermissions] ) ); function getEntityRecordPermissions(state, kind, name, id2) { logEntityDeprecation(kind, name, "getEntityRecordPermissions"); return getEntityRecordsPermissions(state, kind, name, id2)[0]; } function getRegisteredPostMeta(state, postType) { return state.registeredPostMeta?.[postType] ?? {}; } function normalizePageId(value) { if (!value || !["number", "string"].includes(typeof value)) { return null; } if (Number(value) === 0) { return null; } return value.toString(); } var getHomePage = (0, import_data9.createRegistrySelector)( (select5) => (0, import_data9.createSelector)( () => { const siteData = select5(STORE_NAME).getEntityRecord( "root", "__unstableBase" ); if (!siteData) { return null; } const homepageId = siteData?.show_on_front === "page" ? normalizePageId(siteData.page_on_front) : null; if (homepageId) { return { postType: "page", postId: homepageId }; } const frontPageTemplateId = select5( STORE_NAME ).getDefaultTemplateId({ slug: "front-page" }); if (!frontPageTemplateId) { return null; } return { postType: "wp_template", postId: frontPageTemplateId }; }, (state) => [ // Even though getDefaultTemplateId.shouldInvalidate returns true when root/site changes, // it doesn't seem to invalidate this cache, I'm not sure why. getEntityRecord(state, "root", "site"), getEntityRecord(state, "root", "__unstableBase"), getDefaultTemplateId(state, { slug: "front-page" }) ] ) ); var getPostsPageId = (0, import_data9.createRegistrySelector)((select5) => () => { const siteData = select5(STORE_NAME).getEntityRecord( "root", "__unstableBase" ); return siteData?.show_on_front === "page" ? normalizePageId(siteData.page_for_posts) : null; }); var getTemplateId = (0, import_data9.createRegistrySelector)( (select5) => (state, postType, postId) => { const homepage = unlock2(select5(STORE_NAME)).getHomePage(); if (!homepage) { return; } if (postType === "page" && postType === homepage?.postType && postId.toString() === homepage?.postId) { const templates = select5(STORE_NAME).getEntityRecords( "postType", "wp_template", { per_page: -1 } ); if (!templates) { return; } const id2 = templates.find(({ slug }) => slug === "front-page")?.id; if (id2) { return id2; } } const editedEntity = select5(STORE_NAME).getEditedEntityRecord( "postType", postType, postId ); if (!editedEntity) { return; } const postsPageId = unlock2(select5(STORE_NAME)).getPostsPageId(); if (postType === "page" && postsPageId === postId.toString()) { return select5(STORE_NAME).getDefaultTemplateId({ slug: "home" }); } const currentTemplateSlug = editedEntity.template; if (currentTemplateSlug) { const currentTemplate = select5(STORE_NAME).getEntityRecords("postType", "wp_template", { per_page: -1 })?.find(({ slug }) => slug === currentTemplateSlug); if (currentTemplate) { return currentTemplate.id; } } let slugToCheck; if (editedEntity.slug) { slugToCheck = postType === "page" ? `${postType}-${editedEntity.slug}` : `single-${postType}-${editedEntity.slug}`; } else { slugToCheck = postType === "page" ? "page" : `single-${postType}`; } return select5(STORE_NAME).getDefaultTemplateId({ slug: slugToCheck }); } ); function getEditorSettings(state) { return state.editorSettings; } function getEditorAssets(state) { return state.editorAssets; } function isCollaborationSupported(state) { return state.collaborationSupported; } function getSyncConnectionStatus(state) { if (!state.syncConnectionStatuses) { return void 0; } const PRIORITIZED_STATUSES = ["disconnected", "connecting", "connected"]; let coalesced; for (const status of Object.values(state.syncConnectionStatuses)) { if (!coalesced || PRIORITIZED_STATUSES.indexOf(status.status) < PRIORITIZED_STATUSES.indexOf(coalesced.status)) { coalesced = status; } } return coalesced; } // packages/core-data/build-module/selectors.mjs var EMPTY_OBJECT = {}; var isRequestingEmbedPreview = (0, import_data10.createRegistrySelector)( (select5) => (state, url) => { return select5(STORE_NAME).isResolving("getEmbedPreview", [ url ]); } ); function getAuthors(state, query) { (0, import_deprecated2.default)("select( 'core' ).getAuthors()", { since: "5.9", alternative: "select( 'core' ).getUsers({ who: 'authors' })" }); const path = (0, import_url2.addQueryArgs)( "/wp/v2/users/?who=authors&per_page=100", query ); return getUserQueryResults(state, path); } function getCurrentUser(state) { return state.currentUser; } var getUserQueryResults = (0, import_data10.createSelector)( (state, queryID) => { const queryResults = state.users.queries[queryID] ?? []; return queryResults.map((id2) => state.users.byId[id2]); }, (state, queryID) => [ state.users.queries[queryID], state.users.byId ] ); function getEntitiesByKind(state, kind) { (0, import_deprecated2.default)("wp.data.select( 'core' ).getEntitiesByKind()", { since: "6.0", alternative: "wp.data.select( 'core' ).getEntitiesConfig()" }); return getEntitiesConfig(state, kind); } var getEntitiesConfig = (0, import_data10.createSelector)( (state, kind) => state.entities.config.filter((entity2) => entity2.kind === kind), /* eslint-disable @typescript-eslint/no-unused-vars */ (state, kind) => state.entities.config /* eslint-enable @typescript-eslint/no-unused-vars */ ); function getEntity(state, kind, name) { (0, import_deprecated2.default)("wp.data.select( 'core' ).getEntity()", { since: "6.0", alternative: "wp.data.select( 'core' ).getEntityConfig()" }); return getEntityConfig(state, kind, name); } function getEntityConfig(state, kind, name) { logEntityDeprecation(kind, name, "getEntityConfig"); return state.entities.config?.find( (config) => config.kind === kind && config.name === name ); } var getEntityRecord = (0, import_data10.createSelector)( ((state, kind, name, key, query) => { logEntityDeprecation(kind, name, "getEntityRecord"); const queriedState = state.entities.records?.[kind]?.[name]?.queriedData; if (!queriedState) { return void 0; } const context = query?.context ?? "default"; if (!query || !query._fields) { if (!queriedState.itemIsComplete[context]?.[key]) { return void 0; } return queriedState.items[context][key]; } const item = queriedState.items[context]?.[key]; if (!item) { return item; } const filteredItem = {}; const fields = get_normalized_comma_separable_default(query._fields) ?? []; for (let f = 0; f < fields.length; f++) { const field = fields[f].split("."); let value = item; field.forEach((fieldName) => { value = value?.[fieldName]; }); setNestedValue(filteredItem, field, value); } return filteredItem; }), (state, kind, name, recordId, query) => { const context = query?.context ?? "default"; const queriedState = state.entities.records?.[kind]?.[name]?.queriedData; return [ queriedState?.items[context]?.[recordId], queriedState?.itemIsComplete[context]?.[recordId] ]; } ); getEntityRecord.__unstableNormalizeArgs = (args2) => { const newArgs = [...args2]; const recordKey = newArgs?.[2]; newArgs[2] = isNumericID(recordKey) ? Number(recordKey) : recordKey; return newArgs; }; function hasEntityRecord(state, kind, name, key, query) { const queriedState = state.entities.records?.[kind]?.[name]?.queriedData; if (!queriedState) { return false; } const context = query?.context ?? "default"; if (!query || !query._fields) { return !!queriedState.itemIsComplete[context]?.[key]; } const item = queriedState.items[context]?.[key]; if (!item) { return false; } const fields = get_normalized_comma_separable_default(query._fields) ?? []; for (let i = 0; i < fields.length; i++) { const path = fields[i].split("."); let value = item; for (let p = 0; p < path.length; p++) { const part = path[p]; if (!value || !Object.hasOwn(value, part)) { return false; } value = value[part]; } } return true; } function __experimentalGetEntityRecordNoResolver(state, kind, name, key) { return getEntityRecord(state, kind, name, key); } var getRawEntityRecord = (0, import_data10.createSelector)( (state, kind, name, key) => { logEntityDeprecation(kind, name, "getRawEntityRecord"); const record = getEntityRecord( state, kind, name, key ); return record && Object.keys(record).reduce((accumulator, _key) => { if (isRawAttribute(getEntityConfig(state, kind, name), _key)) { accumulator[_key] = record[_key]?.raw !== void 0 ? record[_key]?.raw : record[_key]; } else { accumulator[_key] = record[_key]; } return accumulator; }, {}); }, (state, kind, name, recordId, query) => { const context = query?.context ?? "default"; return [ state.entities.config, state.entities.records?.[kind]?.[name]?.queriedData?.items[context]?.[recordId], state.entities.records?.[kind]?.[name]?.queriedData?.itemIsComplete[context]?.[recordId] ]; } ); function hasEntityRecords(state, kind, name, query) { logEntityDeprecation(kind, name, "hasEntityRecords"); return Array.isArray(getEntityRecords(state, kind, name, query)); } var getEntityRecords = ((state, kind, name, query) => { logEntityDeprecation(kind, name, "getEntityRecords"); const queriedState = state.entities.records?.[kind]?.[name]?.queriedData; if (!queriedState) { return null; } return getQueriedItems(queriedState, query); }); var getEntityRecordsTotalItems = (state, kind, name, query) => { logEntityDeprecation(kind, name, "getEntityRecordsTotalItems"); const queriedState = state.entities.records?.[kind]?.[name]?.queriedData; if (!queriedState) { return null; } return getQueriedTotalItems(queriedState, query); }; var getEntityRecordsTotalPages = (state, kind, name, query) => { logEntityDeprecation(kind, name, "getEntityRecordsTotalPages"); const queriedState = state.entities.records?.[kind]?.[name]?.queriedData; if (!queriedState) { return null; } if (query?.per_page === -1) { return 1; } const totalItems = getQueriedTotalItems(queriedState, query); if (!totalItems) { return totalItems; } if (!query?.per_page) { return getQueriedTotalPages(queriedState, query); } return Math.ceil(totalItems / query.per_page); }; var __experimentalGetDirtyEntityRecords = (0, import_data10.createSelector)( (state) => { const { entities: { records } } = state; const dirtyRecords = []; Object.keys(records).forEach((kind) => { Object.keys(records[kind]).forEach((name) => { const primaryKeys = Object.keys(records[kind][name].edits).filter( (primaryKey) => ( // The entity record must exist (not be deleted), // and it must have edits. getEntityRecord(state, kind, name, primaryKey) && hasEditsForEntityRecord(state, kind, name, primaryKey) ) ); if (primaryKeys.length) { const entityConfig = getEntityConfig(state, kind, name); primaryKeys.forEach((primaryKey) => { const entityRecord = getEditedEntityRecord( state, kind, name, primaryKey ); dirtyRecords.push({ // We avoid using primaryKey because it's transformed into a string // when it's used as an object key. key: entityRecord ? entityRecord[entityConfig.key || DEFAULT_ENTITY_KEY] : void 0, title: entityConfig?.getTitle?.(entityRecord) || "", name, kind }); }); } }); }); return dirtyRecords; }, (state) => [state.entities.records] ); var __experimentalGetEntitiesBeingSaved = (0, import_data10.createSelector)( (state) => { const { entities: { records } } = state; const recordsBeingSaved = []; Object.keys(records).forEach((kind) => { Object.keys(records[kind]).forEach((name) => { const primaryKeys = Object.keys(records[kind][name].saving).filter( (primaryKey) => isSavingEntityRecord(state, kind, name, primaryKey) ); if (primaryKeys.length) { const entityConfig = getEntityConfig(state, kind, name); primaryKeys.forEach((primaryKey) => { const entityRecord = getEditedEntityRecord( state, kind, name, primaryKey ); recordsBeingSaved.push({ // We avoid using primaryKey because it's transformed into a string // when it's used as an object key. key: entityRecord ? entityRecord[entityConfig.key || DEFAULT_ENTITY_KEY] : void 0, title: entityConfig?.getTitle?.(entityRecord) || "", name, kind }); }); } }); }); return recordsBeingSaved; }, (state) => [state.entities.records] ); function getEntityRecordEdits(state, kind, name, recordId) { logEntityDeprecation(kind, name, "getEntityRecordEdits"); return state.entities.records?.[kind]?.[name]?.edits?.[recordId]; } var getEntityRecordNonTransientEdits = (0, import_data10.createSelector)( (state, kind, name, recordId) => { logEntityDeprecation(kind, name, "getEntityRecordNonTransientEdits"); const { transientEdits } = getEntityConfig(state, kind, name) || {}; const edits = getEntityRecordEdits(state, kind, name, recordId) || {}; if (!transientEdits) { return edits; } return Object.keys(edits).reduce((acc, key) => { if (!transientEdits[key]) { acc[key] = edits[key]; } return acc; }, {}); }, (state, kind, name, recordId) => [ state.entities.config, state.entities.records?.[kind]?.[name]?.edits?.[recordId] ] ); function hasEditsForEntityRecord(state, kind, name, recordId) { logEntityDeprecation(kind, name, "hasEditsForEntityRecord"); return isSavingEntityRecord(state, kind, name, recordId) || Object.keys( getEntityRecordNonTransientEdits(state, kind, name, recordId) ).length > 0; } var getEditedEntityRecord = (0, import_data10.createSelector)( (state, kind, name, recordId) => { logEntityDeprecation(kind, name, "getEditedEntityRecord"); const raw = getRawEntityRecord(state, kind, name, recordId); const edited = getEntityRecordEdits(state, kind, name, recordId); if (!raw && !edited) { return false; } return { ...raw, ...edited }; }, (state, kind, name, recordId, query) => { const context = query?.context ?? "default"; return [ state.entities.config, state.entities.records?.[kind]?.[name]?.queriedData.items[context]?.[recordId], state.entities.records?.[kind]?.[name]?.queriedData.itemIsComplete[context]?.[recordId], state.entities.records?.[kind]?.[name]?.edits?.[recordId] ]; } ); function isAutosavingEntityRecord(state, kind, name, recordId) { logEntityDeprecation(kind, name, "isAutosavingEntityRecord"); const { pending, isAutosave } = state.entities.records?.[kind]?.[name]?.saving?.[recordId] ?? {}; return Boolean(pending && isAutosave); } function isSavingEntityRecord(state, kind, name, recordId) { logEntityDeprecation(kind, name, "isSavingEntityRecord"); return state.entities.records?.[kind]?.[name]?.saving?.[recordId]?.pending ?? false; } function isDeletingEntityRecord(state, kind, name, recordId) { logEntityDeprecation(kind, name, "isDeletingEntityRecord"); return state.entities.records?.[kind]?.[name]?.deleting?.[recordId]?.pending ?? false; } function getLastEntitySaveError(state, kind, name, recordId) { logEntityDeprecation(kind, name, "getLastEntitySaveError"); return state.entities.records?.[kind]?.[name]?.saving?.[recordId]?.error; } function getLastEntityDeleteError(state, kind, name, recordId) { logEntityDeprecation(kind, name, "getLastEntityDeleteError"); return state.entities.records?.[kind]?.[name]?.deleting?.[recordId]?.error; } function getUndoEdit(state) { (0, import_deprecated2.default)("select( 'core' ).getUndoEdit()", { since: "6.3" }); return void 0; } function getRedoEdit(state) { (0, import_deprecated2.default)("select( 'core' ).getRedoEdit()", { since: "6.3" }); return void 0; } function hasUndo(state) { return getUndoManager(state).hasUndo(); } function hasRedo(state) { return getUndoManager(state).hasRedo(); } function getCurrentTheme(state) { if (!state.currentTheme) { return null; } return getEntityRecord(state, "root", "theme", state.currentTheme); } function __experimentalGetCurrentGlobalStylesId(state) { return state.currentGlobalStylesId; } function getThemeSupports(state) { return getCurrentTheme(state)?.theme_supports ?? EMPTY_OBJECT; } function getEmbedPreview(state, url) { return state.embedPreviews[url]; } function isPreviewEmbedFallback(state, url) { const preview = state.embedPreviews[url]; const oEmbedLinkCheck = '<a href="' + url + '">' + url + "</a>"; if (!preview) { return false; } return preview.html === oEmbedLinkCheck; } function canUser(state, action, resource, id2) { const isEntity = typeof resource === "object"; if (isEntity && (!resource.kind || !resource.name)) { return false; } if (isEntity) { logEntityDeprecation(resource.kind, resource.name, "canUser"); } const key = getUserPermissionCacheKey(action, resource, id2); return state.userPermissions[key]; } function canUserEditEntityRecord(state, kind, name, recordId) { (0, import_deprecated2.default)(`wp.data.select( 'core' ).canUserEditEntityRecord()`, { since: "6.7", alternative: `wp.data.select( 'core' ).canUser( 'update', { kind, name, id } )` }); return canUser(state, "update", { kind, name, id: recordId }); } function getAutosaves(state, postType, postId) { return state.autosaves[postId]; } function getAutosave(state, postType, postId, authorId) { if (authorId === void 0) { return; } const autosaves2 = state.autosaves[postId]; return autosaves2?.find( (autosave) => autosave.author === authorId ); } var hasFetchedAutosaves = (0, import_data10.createRegistrySelector)( (select5) => (state, postType, postId) => { return select5(STORE_NAME).hasFinishedResolution("getAutosaves", [ postType, postId ]); } ); function getReferenceByDistinctEdits(state) { return state.editsReference; } function __experimentalGetCurrentThemeBaseGlobalStyles(state) { const currentTheme2 = getCurrentTheme(state); if (!currentTheme2) { return null; } return state.themeBaseGlobalStyles[currentTheme2.stylesheet]; } function __experimentalGetCurrentThemeGlobalStylesVariations(state) { const currentTheme2 = getCurrentTheme(state); if (!currentTheme2) { return null; } return state.themeGlobalStyleVariations[currentTheme2.stylesheet]; } function getBlockPatterns(state) { return state.blockPatterns; } function getBlockPatternCategories(state) { return state.blockPatternCategories; } function getUserPatternCategories(state) { return state.userPatternCategories; } function getCurrentThemeGlobalStylesRevisions(state) { (0, import_deprecated2.default)("select( 'core' ).getCurrentThemeGlobalStylesRevisions()", { since: "6.5.0", alternative: "select( 'core' ).getRevisions( 'root', 'globalStyles', ${ recordKey } )" }); const currentGlobalStylesId2 = __experimentalGetCurrentGlobalStylesId(state); if (!currentGlobalStylesId2) { return null; } return state.themeGlobalStyleRevisions[currentGlobalStylesId2]; } function getDefaultTemplateId(state, query) { return state.defaultTemplates[JSON.stringify(query)]; } var getRevisions = (state, kind, name, recordKey, query) => { logEntityDeprecation(kind, name, "getRevisions"); const queriedStateRevisions = state.entities.records?.[kind]?.[name]?.revisions?.[recordKey]; if (!queriedStateRevisions) { return null; } return getQueriedItems(queriedStateRevisions, query); }; var getRevision = (0, import_data10.createSelector)( (state, kind, name, recordKey, revisionKey, query) => { logEntityDeprecation(kind, name, "getRevision"); const queriedState = state.entities.records?.[kind]?.[name]?.revisions?.[recordKey]; if (!queriedState) { return void 0; } const context = query?.context ?? "default"; if (!query || !query._fields) { if (!queriedState.itemIsComplete[context]?.[revisionKey]) { return void 0; } return queriedState.items[context][revisionKey]; } const item = queriedState.items[context]?.[revisionKey]; if (!item) { return item; } const filteredItem = {}; const fields = get_normalized_comma_separable_default(query._fields) ?? []; for (let f = 0; f < fields.length; f++) { const field = fields[f].split("."); let value = item; field.forEach((fieldName) => { value = value?.[fieldName]; }); setNestedValue(filteredItem, field, value); } return filteredItem; }, (state, kind, name, recordKey, revisionKey, query) => { const context = query?.context ?? "default"; const queriedState = state.entities.records?.[kind]?.[name]?.revisions?.[recordKey]; return [ queriedState?.items?.[context]?.[revisionKey], queriedState?.itemIsComplete?.[context]?.[revisionKey] ]; } ); // packages/core-data/build-module/actions.mjs var actions_exports = {}; __export(actions_exports, { __experimentalBatch: () => __experimentalBatch, __experimentalReceiveCurrentGlobalStylesId: () => __experimentalReceiveCurrentGlobalStylesId, __experimentalReceiveThemeBaseGlobalStyles: () => __experimentalReceiveThemeBaseGlobalStyles, __experimentalReceiveThemeGlobalStyleVariations: () => __experimentalReceiveThemeGlobalStyleVariations, __experimentalSaveSpecifiedEntityEdits: () => __experimentalSaveSpecifiedEntityEdits, __unstableCreateUndoLevel: () => __unstableCreateUndoLevel, addEntities: () => addEntities, clearEntityRecordEdits: () => clearEntityRecordEdits, deleteEntityRecord: () => deleteEntityRecord, editEntityRecord: () => editEntityRecord, receiveAutosaves: () => receiveAutosaves, receiveCurrentTheme: () => receiveCurrentTheme, receiveCurrentUser: () => receiveCurrentUser, receiveDefaultTemplateId: () => receiveDefaultTemplateId, receiveEmbedPreview: () => receiveEmbedPreview, receiveEntityRecords: () => receiveEntityRecords, receiveNavigationFallbackId: () => receiveNavigationFallbackId, receiveRevisions: () => receiveRevisions, receiveThemeGlobalStyleRevisions: () => receiveThemeGlobalStyleRevisions, receiveThemeSupports: () => receiveThemeSupports, receiveUploadPermissions: () => receiveUploadPermissions, receiveUserPermission: () => receiveUserPermission, receiveUserPermissions: () => receiveUserPermissions, receiveUserQuery: () => receiveUserQuery, redo: () => redo, saveEditedEntityRecord: () => saveEditedEntityRecord, saveEntityRecord: () => saveEntityRecord, undo: () => undo }); var import_es67 = __toESM(require_es6(), 1); var import_api_fetch4 = __toESM(require_api_fetch(), 1); var import_url3 = __toESM(require_url(), 1); var import_deprecated3 = __toESM(require_deprecated(), 1); // packages/core-data/build-module/batch/default-processor.mjs var import_api_fetch3 = __toESM(require_api_fetch(), 1); var maxItems = null; function chunk(arr, chunkSize) { const tmp = [...arr]; const cache3 = []; while (tmp.length) { cache3.push(tmp.splice(0, chunkSize)); } return cache3; } async function defaultProcessor(requests) { if (maxItems === null) { const preflightResponse = await (0, import_api_fetch3.default)({ path: "/batch/v1", method: "OPTIONS" }); maxItems = preflightResponse.endpoints[0].args.requests.maxItems; } const results = []; for (const batchRequests of chunk(requests, maxItems)) { const batchResponse = await (0, import_api_fetch3.default)({ path: "/batch/v1", method: "POST", data: { validation: "require-all-validate", requests: batchRequests.map((request) => ({ path: request.path, body: request.data, // Rename 'data' to 'body'. method: request.method, headers: request.headers })) } }); let batchResults; if (batchResponse.failed) { batchResults = batchResponse.responses.map((response) => ({ error: response?.body })); } else { batchResults = batchResponse.responses.map((response) => { const result = {}; if (response.status >= 200 && response.status < 300) { result.output = response.body; } else { result.error = response.body; } return result; }); } results.push(...batchResults); } return results; } // packages/core-data/build-module/batch/create-batch.mjs function createBatch(processor = defaultProcessor) { let lastId = 0; let queue = []; const pending = new ObservableSet(); return { /** * Adds an input to the batch and returns a promise that is resolved or * rejected when the input is processed by `batch.run()`. * * You may also pass a thunk which allows inputs to be added * asynchronously. * * ``` * // Both are allowed: * batch.add( { path: '/v1/books', ... } ); * batch.add( ( add ) => add( { path: '/v1/books', ... } ) ); * ``` * * If a thunk is passed, `batch.run()` will pause until either: * * - The thunk calls its `add` argument, or; * - The thunk returns a promise and that promise resolves, or; * - The thunk returns a non-promise. * * @param {any|Function} inputOrThunk Input to add or thunk to execute. * * @return {Promise|any} If given an input, returns a promise that * is resolved or rejected when the batch is * processed. If given a thunk, returns the return * value of that thunk. */ add(inputOrThunk) { const id2 = ++lastId; pending.add(id2); const add = (input) => new Promise((resolve, reject) => { queue.push({ input, resolve, reject }); pending.delete(id2); }); if (typeof inputOrThunk === "function") { return Promise.resolve(inputOrThunk(add)).finally(() => { pending.delete(id2); }); } return add(inputOrThunk); }, /** * Runs the batch. This calls `batchProcessor` and resolves or rejects * all promises returned by `add()`. * * @return {Promise<boolean>} A promise that resolves to a boolean that is true * if the processor returned no errors. */ async run() { if (pending.size) { await new Promise((resolve) => { const unsubscribe = pending.subscribe(() => { if (!pending.size) { unsubscribe(); resolve(void 0); } }); }); } let results; try { results = await processor( queue.map(({ input }) => input) ); if (results.length !== queue.length) { throw new Error( "run: Array returned by processor must be same size as input array." ); } } catch (error) { for (const { reject } of queue) { reject(error); } throw error; } let isSuccess = true; results.forEach((result, key) => { const queueItem = queue[key]; if (result?.error) { queueItem?.reject(result.error); isSuccess = false; } else { queueItem?.resolve(result?.output ?? result); } }); queue = []; return isSuccess; } }; } var ObservableSet = class { constructor(...args2) { this.set = new Set(...args2); this.subscribers = /* @__PURE__ */ new Set(); } get size() { return this.set.size; } add(value) { this.set.add(value); this.subscribers.forEach((subscriber) => subscriber()); return this; } delete(value) { const isSuccess = this.set.delete(value); this.subscribers.forEach((subscriber) => subscriber()); return isSuccess; } subscribe(subscriber) { this.subscribers.add(subscriber); return () => { this.subscribers.delete(subscriber); }; } }; // packages/core-data/build-module/actions.mjs function addTitleToAutoDraft(record) { return record.status === "auto-draft" ? { ...record, title: "" } : record; } function receiveUserQuery(queryID, users2) { return { type: "RECEIVE_USER_QUERY", users: Array.isArray(users2) ? users2 : [users2], queryID }; } function receiveCurrentUser(currentUser2) { return { type: "RECEIVE_CURRENT_USER", currentUser: currentUser2 }; } function addEntities(entities2) { return { type: "ADD_ENTITIES", entities: entities2 }; } function receiveEntityRecords(kind, name, records, query = void 0, invalidateCache = false, edits = void 0, meta = void 0) { if (kind === "postType") { records = Array.isArray(records) ? records.map(addTitleToAutoDraft) : addTitleToAutoDraft(records); } let action; if (query) { action = receiveQueriedItems(records, query, edits, meta); } else { action = receiveItems(records, edits, meta); } return { ...action, kind, name, invalidateCache }; } function receiveCurrentTheme(currentTheme2) { return { type: "RECEIVE_CURRENT_THEME", currentTheme: currentTheme2 }; } function __experimentalReceiveCurrentGlobalStylesId(currentGlobalStylesId2) { return { type: "RECEIVE_CURRENT_GLOBAL_STYLES_ID", id: currentGlobalStylesId2 }; } function __experimentalReceiveThemeBaseGlobalStyles(stylesheet, globalStyles) { return { type: "RECEIVE_THEME_GLOBAL_STYLES", stylesheet, globalStyles }; } function __experimentalReceiveThemeGlobalStyleVariations(stylesheet, variations) { return { type: "RECEIVE_THEME_GLOBAL_STYLE_VARIATIONS", stylesheet, variations }; } function receiveThemeSupports() { (0, import_deprecated3.default)("wp.data.dispatch( 'core' ).receiveThemeSupports", { since: "5.9" }); return { type: "DO_NOTHING" }; } function receiveThemeGlobalStyleRevisions(currentId, revisions) { (0, import_deprecated3.default)( "wp.data.dispatch( 'core' ).receiveThemeGlobalStyleRevisions()", { since: "6.5.0", alternative: "wp.data.dispatch( 'core' ).receiveRevisions" } ); return { type: "RECEIVE_THEME_GLOBAL_STYLE_REVISIONS", currentId, revisions }; } function receiveEmbedPreview(url, preview) { return { type: "RECEIVE_EMBED_PREVIEW", url, preview }; } var deleteEntityRecord = (kind, name, recordId, query, { __unstableFetch = import_api_fetch4.default, throwOnError = false } = {}) => async ({ dispatch: dispatch3, resolveSelect: resolveSelect2 }) => { logEntityDeprecation(kind, name, "deleteEntityRecord"); const configs = await resolveSelect2.getEntitiesConfig(kind); const entityConfig = configs.find( (config) => config.kind === kind && config.name === name ); let error; let deletedRecord = false; if (!entityConfig) { return; } const lock3 = await dispatch3.__unstableAcquireStoreLock( STORE_NAME, ["entities", "records", kind, name, recordId], { exclusive: true } ); try { dispatch3({ type: "DELETE_ENTITY_RECORD_START", kind, name, recordId }); let hasError = false; let { baseURL } = entityConfig; if (kind === "postType" && name === "wp_template" && (recordId && typeof recordId === "string" && !/^\d+$/.test(recordId) || !window?.__experimentalTemplateActivate)) { baseURL = baseURL.slice(0, baseURL.lastIndexOf("/")) + "/templates"; } try { let path = `${baseURL}/${recordId}`; if (query) { path = (0, import_url3.addQueryArgs)(path, query); } deletedRecord = await __unstableFetch({ path, method: "DELETE" }); await dispatch3(removeItems(kind, name, recordId, true)); if (entityConfig.syncConfig) { const objectType = `${kind}/${name}`; const objectId = recordId; getSyncManager()?.unload(objectType, objectId); } } catch (_error) { hasError = true; error = _error; } dispatch3({ type: "DELETE_ENTITY_RECORD_FINISH", kind, name, recordId, error }); if (hasError && throwOnError) { throw error; } return deletedRecord; } finally { dispatch3.__unstableReleaseStoreLock(lock3); } }; var editEntityRecord = (kind, name, recordId, edits, options = {}) => ({ select: select5, dispatch: dispatch3 }) => { logEntityDeprecation(kind, name, "editEntityRecord"); const entityConfig = select5.getEntityConfig(kind, name); if (!entityConfig) { throw new Error( `The entity being edited (${kind}, ${name}) does not have a loaded config.` ); } const { mergedEdits = {} } = entityConfig; const record = select5.getRawEntityRecord(kind, name, recordId); const editedRecord = select5.getEditedEntityRecord( kind, name, recordId ); const editsWithMerges = Object.keys(edits).reduce((acc, key) => { acc[key] = mergedEdits[key] ? { ...editedRecord[key], ...edits[key] } : edits[key]; return acc; }, {}); const edit = { kind, name, recordId, // Clear edits when they are equal to their persisted counterparts // so that the property is not considered dirty. edits: Object.keys(edits).reduce((acc, key) => { const recordValue = record[key]; const value = editsWithMerges[key]; acc[key] = (0, import_es67.default)(recordValue, value) ? void 0 : value; return acc; }, {}) }; if (entityConfig.syncConfig) { const objectType = `${kind}/${name}`; const objectId = recordId; const isNewUndoLevel = options.undoIgnore ? false : !options.isCached; const origin2 = options.undoIgnore ? LOCAL_UNDO_IGNORED_ORIGIN2 : LOCAL_EDITOR_ORIGIN2; getSyncManager()?.update( objectType, objectId, editsWithMerges, origin2, { isNewUndoLevel } ); } if (!options.undoIgnore) { select5.getUndoManager().addRecord( [ { id: { kind, name, recordId }, changes: Object.keys(edits).reduce((acc, key) => { acc[key] = { from: editedRecord[key], to: edits[key] }; return acc; }, {}) } ], options.isCached ); } dispatch3({ type: "EDIT_ENTITY_RECORD", ...edit }); }; var clearEntityRecordEdits = (kind, name, recordId) => ({ select: select5, dispatch: dispatch3 }) => { const entityConfig = select5.getEntityConfig(kind, name); logEntityDeprecation(kind, name, "clearEntityRecordEdits"); if (!entityConfig) { throw new Error( `The entity being edited (${kind}, ${name}) does not have a loaded config.` ); } const currentEdits = select5.getEntityRecordEdits( kind, name, recordId ); if (!currentEdits) { return; } const clearedEdits = Object.keys(currentEdits).reduce( (acc, key) => { acc[key] = void 0; return acc; }, {} ); dispatch3({ type: "EDIT_ENTITY_RECORD", kind, name, recordId, edits: clearedEdits }); }; var undo = () => ({ select: select5, dispatch: dispatch3 }) => { const undoRecord = select5.getUndoManager().undo(); if (!undoRecord) { return; } dispatch3({ type: "UNDO", record: undoRecord }); }; var redo = () => ({ select: select5, dispatch: dispatch3 }) => { const redoRecord = select5.getUndoManager().redo(); if (!redoRecord) { return; } dispatch3({ type: "REDO", record: redoRecord }); }; var __unstableCreateUndoLevel = () => ({ select: select5 }) => { select5.getUndoManager().addRecord(); }; var saveEntityRecord = (kind, name, record, { isAutosave = false, __unstableFetch = import_api_fetch4.default, throwOnError = false } = {}) => async ({ select: select5, resolveSelect: resolveSelect2, dispatch: dispatch3 }) => { logEntityDeprecation(kind, name, "saveEntityRecord"); const configs = await resolveSelect2.getEntitiesConfig(kind); const entityConfig = configs.find( (config) => config.kind === kind && config.name === name ); if (!entityConfig) { return; } const entityIdKey = entityConfig.key ?? DEFAULT_ENTITY_KEY; const recordId = record[entityIdKey]; const isNewRecord = !!entityIdKey && !recordId; const lock3 = await dispatch3.__unstableAcquireStoreLock( STORE_NAME, ["entities", "records", kind, name, recordId || v4_default()], { exclusive: true } ); try { for (const [key, value] of Object.entries(record)) { if (typeof value === "function") { const evaluatedValue = value( select5.getEditedEntityRecord(kind, name, recordId) ); dispatch3.editEntityRecord( kind, name, recordId, { [key]: evaluatedValue }, { undoIgnore: true } ); record[key] = evaluatedValue; } } dispatch3({ type: "SAVE_ENTITY_RECORD_START", kind, name, recordId, isAutosave }); let updatedRecord; let error; let hasError = false; let { baseURL } = entityConfig; if (kind === "postType" && name === "wp_template" && (recordId && typeof recordId === "string" && !/^\d+$/.test(recordId) || !window?.__experimentalTemplateActivate)) { baseURL = baseURL.slice(0, baseURL.lastIndexOf("/")) + "/templates"; } try { const path = `${baseURL}${recordId ? "/" + recordId : ""}`; const persistedRecord = !isNewRecord ? select5.getRawEntityRecord(kind, name, recordId) : {}; if (isAutosave) { const currentUser2 = select5.getCurrentUser(); const currentUserId = currentUser2 ? currentUser2.id : void 0; const autosavePost = await resolveSelect2.getAutosave( persistedRecord.type, persistedRecord.id, currentUserId ); let data = { ...persistedRecord, ...autosavePost, ...record }; data = Object.keys(data).reduce( (acc, key) => { if ([ "title", "excerpt", "content", "meta" ].includes(key)) { acc[key] = data[key]; } return acc; }, { // Do not update the `status` if we have edited it when auto saving. // It's very important to let the user explicitly save this change, // because it can lead to unexpected results. An example would be to // have a draft post and change the status to publish. status: data.status === "auto-draft" ? "draft" : void 0 } ); updatedRecord = await __unstableFetch({ path: `${path}/autosaves`, method: "POST", data }); if (persistedRecord.id === updatedRecord.id) { let newRecord = { ...persistedRecord, ...data, ...updatedRecord }; newRecord = Object.keys(newRecord).reduce( (acc, key) => { if (["title", "excerpt", "content"].includes( key )) { acc[key] = newRecord[key]; } else if (key === "status") { acc[key] = persistedRecord.status === "auto-draft" && newRecord.status === "draft" ? newRecord.status : persistedRecord.status; } else { acc[key] = persistedRecord[key]; } return acc; }, {} ); dispatch3.receiveEntityRecords( kind, name, newRecord, void 0, true ); } else { dispatch3.receiveAutosaves( persistedRecord.id, updatedRecord ); } } else { let edits = record; if (entityConfig.__unstablePrePersist) { edits = { ...edits, ...await entityConfig.__unstablePrePersist( persistedRecord, edits ) }; } updatedRecord = await __unstableFetch({ path, method: recordId ? "PUT" : "POST", data: edits }); dispatch3.receiveEntityRecords( kind, name, updatedRecord, void 0, true, edits ); if (entityConfig.syncConfig) { getSyncManager()?.update( `${kind}/${name}`, recordId, updatedRecord, LOCAL_UNDO_IGNORED_ORIGIN2, { isSave: true } ); } } } catch (_error) { hasError = true; error = _error; } dispatch3({ type: "SAVE_ENTITY_RECORD_FINISH", kind, name, recordId, error, isAutosave }); if (hasError && throwOnError) { throw error; } return updatedRecord; } finally { dispatch3.__unstableReleaseStoreLock(lock3); } }; var __experimentalBatch = (requests) => async ({ dispatch: dispatch3 }) => { const batch = createBatch(); const api = { saveEntityRecord(kind, name, record, options) { return batch.add( (add) => dispatch3.saveEntityRecord(kind, name, record, { ...options, __unstableFetch: add }) ); }, saveEditedEntityRecord(kind, name, recordId, options) { return batch.add( (add) => dispatch3.saveEditedEntityRecord(kind, name, recordId, { ...options, __unstableFetch: add }) ); }, deleteEntityRecord(kind, name, recordId, query, options) { return batch.add( (add) => dispatch3.deleteEntityRecord(kind, name, recordId, query, { ...options, __unstableFetch: add }) ); } }; const resultPromises = requests.map((request) => request(api)); const [, ...results] = await Promise.all([ batch.run(), ...resultPromises ]); return results; }; var saveEditedEntityRecord = (kind, name, recordId, options) => async ({ select: select5, dispatch: dispatch3, resolveSelect: resolveSelect2 }) => { logEntityDeprecation(kind, name, "saveEditedEntityRecord"); if (!select5.hasEditsForEntityRecord(kind, name, recordId)) { return; } const configs = await resolveSelect2.getEntitiesConfig(kind); const entityConfig = configs.find( (config) => config.kind === kind && config.name === name ); if (!entityConfig) { return; } const entityIdKey = entityConfig.key || DEFAULT_ENTITY_KEY; const edits = select5.getEntityRecordNonTransientEdits( kind, name, recordId ); const record = { [entityIdKey]: recordId, ...edits }; return await dispatch3.saveEntityRecord(kind, name, record, options); }; var __experimentalSaveSpecifiedEntityEdits = (kind, name, recordId, itemsToSave, options) => async ({ select: select5, dispatch: dispatch3, resolveSelect: resolveSelect2 }) => { logEntityDeprecation( kind, name, "__experimentalSaveSpecifiedEntityEdits" ); if (!select5.hasEditsForEntityRecord(kind, name, recordId)) { return; } const edits = select5.getEntityRecordNonTransientEdits( kind, name, recordId ); const editsToSave = {}; for (const item of itemsToSave) { setNestedValue(editsToSave, item, getNestedValue(edits, item)); } const configs = await resolveSelect2.getEntitiesConfig(kind); const entityConfig = configs.find( (config) => config.kind === kind && config.name === name ); const entityIdKey = entityConfig?.key || DEFAULT_ENTITY_KEY; if (recordId) { editsToSave[entityIdKey] = recordId; } return await dispatch3.saveEntityRecord( kind, name, editsToSave, options ); }; function receiveUploadPermissions(hasUploadPermissions) { (0, import_deprecated3.default)("wp.data.dispatch( 'core' ).receiveUploadPermissions", { since: "5.9", alternative: "receiveUserPermission" }); return receiveUserPermission("create/media", hasUploadPermissions); } function receiveUserPermission(key, isAllowed) { return { type: "RECEIVE_USER_PERMISSION", key, isAllowed }; } function receiveUserPermissions(permissions) { return { type: "RECEIVE_USER_PERMISSIONS", permissions }; } function receiveAutosaves(postId, autosaves2) { return { type: "RECEIVE_AUTOSAVES", postId, autosaves: Array.isArray(autosaves2) ? autosaves2 : [autosaves2] }; } function receiveNavigationFallbackId(fallbackId) { return { type: "RECEIVE_NAVIGATION_FALLBACK_ID", fallbackId }; } function receiveDefaultTemplateId(query, templateId) { return { type: "RECEIVE_DEFAULT_TEMPLATE", query, templateId }; } var receiveRevisions = (kind, name, recordKey, records, query, invalidateCache = false, meta) => async ({ dispatch: dispatch3, resolveSelect: resolveSelect2 }) => { logEntityDeprecation(kind, name, "receiveRevisions"); const configs = await resolveSelect2.getEntitiesConfig(kind); const entityConfig = configs.find( (config) => config.kind === kind && config.name === name ); const key = entityConfig && entityConfig?.revisionKey ? entityConfig.revisionKey : DEFAULT_ENTITY_KEY; dispatch3({ type: "RECEIVE_ITEM_REVISIONS", key, items: records, recordKey, meta, query, kind, name, invalidateCache }); }; // packages/core-data/build-module/private-actions.mjs var private_actions_exports = {}; __export(private_actions_exports, { editMediaEntity: () => editMediaEntity, receiveEditorAssets: () => receiveEditorAssets, receiveEditorSettings: () => receiveEditorSettings, receiveRegisteredPostMeta: () => receiveRegisteredPostMeta, setCollaborationSupported: () => setCollaborationSupported, setSyncConnectionStatus: () => setSyncConnectionStatus }); var import_api_fetch5 = __toESM(require_api_fetch(), 1); function receiveRegisteredPostMeta(postType, registeredPostMeta2) { return { type: "RECEIVE_REGISTERED_POST_META", postType, registeredPostMeta: registeredPostMeta2 }; } var editMediaEntity = (recordId, edits = {}, { __unstableFetch = import_api_fetch5.default, throwOnError = false } = {}) => async ({ dispatch: dispatch3, resolveSelect: resolveSelect2 }) => { if (!recordId) { return; } const kind = "postType"; const name = "attachment"; const configs = await resolveSelect2.getEntitiesConfig(kind); const entityConfig = configs.find( (config) => config.kind === kind && config.name === name ); if (!entityConfig) { return; } const lock3 = await dispatch3.__unstableAcquireStoreLock( STORE_NAME, ["entities", "records", kind, name, recordId], { exclusive: true } ); let updatedRecord; let error; let hasError = false; try { dispatch3({ type: "SAVE_ENTITY_RECORD_START", kind, name, recordId }); try { const path = `${entityConfig.baseURL}/${recordId}/edit`; const newRecord = await __unstableFetch({ path, method: "POST", data: { ...edits } }); if (newRecord) { dispatch3.receiveEntityRecords( kind, name, newRecord, void 0, true, void 0, void 0 ); updatedRecord = newRecord; } } catch (e) { error = e; hasError = true; } dispatch3({ type: "SAVE_ENTITY_RECORD_FINISH", kind, name, recordId, error }); if (hasError && throwOnError) { throw error; } return updatedRecord; } finally { dispatch3.__unstableReleaseStoreLock(lock3); } }; function receiveEditorSettings(settings) { return { type: "RECEIVE_EDITOR_SETTINGS", settings }; } function receiveEditorAssets(assets) { return { type: "RECEIVE_EDITOR_ASSETS", assets }; } var setCollaborationSupported = (supported) => ({ dispatch: dispatch3 }) => { dispatch3({ type: "SET_COLLABORATION_SUPPORTED", supported }); }; function setSyncConnectionStatus(kind, name, key, status) { if (!status) { return { type: "CLEAR_SYNC_CONNECTION_STATUS", kind, name, key }; } return { type: "SET_SYNC_CONNECTION_STATUS", kind, name, key, status }; } // packages/core-data/build-module/resolvers.mjs var resolvers_exports = {}; __export(resolvers_exports, { __experimentalGetCurrentGlobalStylesId: () => __experimentalGetCurrentGlobalStylesId2, __experimentalGetCurrentThemeBaseGlobalStyles: () => __experimentalGetCurrentThemeBaseGlobalStyles2, __experimentalGetCurrentThemeGlobalStylesVariations: () => __experimentalGetCurrentThemeGlobalStylesVariations2, canUser: () => canUser2, canUserEditEntityRecord: () => canUserEditEntityRecord2, getAuthors: () => getAuthors2, getAutosave: () => getAutosave2, getAutosaves: () => getAutosaves2, getBlockPatternCategories: () => getBlockPatternCategories2, getBlockPatterns: () => getBlockPatterns2, getCurrentTheme: () => getCurrentTheme2, getCurrentThemeGlobalStylesRevisions: () => getCurrentThemeGlobalStylesRevisions2, getCurrentUser: () => getCurrentUser2, getDefaultTemplateId: () => getDefaultTemplateId2, getEditedEntityRecord: () => getEditedEntityRecord2, getEditorAssets: () => getEditorAssets2, getEditorSettings: () => getEditorSettings2, getEmbedPreview: () => getEmbedPreview2, getEntitiesConfig: () => getEntitiesConfig2, getEntityRecord: () => getEntityRecord2, getEntityRecords: () => getEntityRecords2, getEntityRecordsTotalItems: () => getEntityRecordsTotalItems2, getEntityRecordsTotalPages: () => getEntityRecordsTotalPages2, getNavigationFallbackId: () => getNavigationFallbackId2, getRawEntityRecord: () => getRawEntityRecord2, getRegisteredPostMeta: () => getRegisteredPostMeta2, getRevision: () => getRevision2, getRevisions: () => getRevisions2, getThemeSupports: () => getThemeSupports2, getUserPatternCategories: () => getUserPatternCategories2 }); var import_url6 = __toESM(require_url(), 1); var import_html_entities2 = __toESM(require_html_entities(), 1); var import_api_fetch9 = __toESM(require_api_fetch(), 1); // packages/core-data/build-module/fetch/index.mjs var import_api_fetch8 = __toESM(require_api_fetch(), 1); // packages/core-data/build-module/fetch/__experimental-fetch-link-suggestions.mjs var import_api_fetch6 = __toESM(require_api_fetch(), 1); var import_url4 = __toESM(require_url(), 1); var import_html_entities = __toESM(require_html_entities(), 1); var import_i18n2 = __toESM(require_i18n(), 1); async function fetchLinkSuggestions(search, searchOptions = {}, editorSettings2 = {}) { const searchOptionsToUse = searchOptions.isInitialSuggestions && searchOptions.initialSuggestionsSearchOptions ? { ...searchOptions, ...searchOptions.initialSuggestionsSearchOptions } : searchOptions; const { type, subtype, page, perPage = searchOptions.isInitialSuggestions ? 3 : 20 } = searchOptionsToUse; const { disablePostFormats = false } = editorSettings2; const queries2 = []; if (!type || type === "post") { queries2.push( (0, import_api_fetch6.default)({ path: (0, import_url4.addQueryArgs)("/wp/v2/search", { search, page, per_page: perPage, type: "post", subtype }) }).then((results2) => { return results2.map((result) => { return { id: result.id, url: result.url, title: (0, import_html_entities.decodeEntities)(result.title || "") || (0, import_i18n2.__)("(no title)"), type: result.subtype || result.type, kind: "post-type" }; }); }).catch(() => []) // Fail by returning no results. ); } if (!type || type === "term") { queries2.push( (0, import_api_fetch6.default)({ path: (0, import_url4.addQueryArgs)("/wp/v2/search", { search, page, per_page: perPage, type: "term", subtype }) }).then((results2) => { return results2.map((result) => { return { id: result.id, url: result.url, title: (0, import_html_entities.decodeEntities)(result.title || "") || (0, import_i18n2.__)("(no title)"), type: result.subtype || result.type, kind: "taxonomy" }; }); }).catch(() => []) // Fail by returning no results. ); } if (!disablePostFormats && (!type || type === "post-format")) { queries2.push( (0, import_api_fetch6.default)({ path: (0, import_url4.addQueryArgs)("/wp/v2/search", { search, page, per_page: perPage, type: "post-format", subtype }) }).then((results2) => { return results2.map((result) => { return { id: result.id, url: result.url, title: (0, import_html_entities.decodeEntities)(result.title || "") || (0, import_i18n2.__)("(no title)"), type: result.subtype || result.type, kind: "taxonomy" }; }); }).catch(() => []) // Fail by returning no results. ); } if (!type || type === "attachment") { queries2.push( (0, import_api_fetch6.default)({ path: (0, import_url4.addQueryArgs)("/wp/v2/media", { search, page, per_page: perPage }) }).then((results2) => { return results2.map((result) => { return { id: result.id, url: result.source_url, title: (0, import_html_entities.decodeEntities)(result.title.rendered || "") || (0, import_i18n2.__)("(no title)"), type: result.type, kind: "media" }; }); }).catch(() => []) // Fail by returning no results. ); } const responses = await Promise.all(queries2); let results = responses.flat(); results = results.filter((result) => !!result.id); results = sortResults(results, search); results = results.slice(0, perPage); return results; } function sortResults(results, search) { const searchTokens = tokenize2(search); const scores = {}; for (const result of results) { if (result.title) { const titleTokens = tokenize2(result.title); const exactMatchingTokens = titleTokens.filter( (titleToken) => searchTokens.some( (searchToken) => titleToken === searchToken ) ); const subMatchingTokens = titleTokens.filter( (titleToken) => searchTokens.some( (searchToken) => titleToken !== searchToken && titleToken.includes(searchToken) ) ); const exactMatchScore = exactMatchingTokens.length / titleTokens.length * 10; const subMatchScore = subMatchingTokens.length / titleTokens.length; scores[result.id] = exactMatchScore + subMatchScore; } else { scores[result.id] = 0; } } return results.sort((a, b) => scores[b.id] - scores[a.id]); } function tokenize2(text2) { return text2.toLowerCase().match(/[\p{L}\p{N}]+/gu) || []; } // packages/core-data/build-module/fetch/__experimental-fetch-url-data.mjs var import_api_fetch7 = __toESM(require_api_fetch(), 1); var import_url5 = __toESM(require_url(), 1); var CACHE = /* @__PURE__ */ new Map(); var fetchUrlData = async (url, options = {}) => { const endpoint = "/wp-block-editor/v1/url-details"; const args2 = { url: (0, import_url5.prependHTTP)(url) }; if (!(0, import_url5.isURL)(url)) { return Promise.reject(`${url} is not a valid URL.`); } const protocol = (0, import_url5.getProtocol)(url); if (!protocol || !(0, import_url5.isValidProtocol)(protocol) || !protocol.startsWith("http") || !/^https?:\/\/[^\/\s]/i.test(url)) { return Promise.reject( `${url} does not have a valid protocol. URLs must be "http" based` ); } if (CACHE.has(url)) { return CACHE.get(url); } return (0, import_api_fetch7.default)({ path: (0, import_url5.addQueryArgs)(endpoint, args2), ...options }).then((res) => { CACHE.set(url, res); return res; }); }; var experimental_fetch_url_data_default = fetchUrlData; // packages/core-data/build-module/fetch/index.mjs async function fetchBlockPatterns() { const restPatterns = await (0, import_api_fetch8.default)({ path: "/wp/v2/block-patterns/patterns" }); if (!restPatterns) { return []; } return restPatterns.map( (pattern) => Object.fromEntries( Object.entries(pattern).map(([key, value]) => [ camelCase(key), value ]) ) ); } // packages/core-data/build-module/resolvers.mjs var getAuthors2 = (query) => async ({ dispatch: dispatch3 }) => { const path = (0, import_url6.addQueryArgs)( "/wp/v2/users/?who=authors&per_page=100", query ); const users2 = await (0, import_api_fetch9.default)({ path }); dispatch3.receiveUserQuery(path, users2); }; var getCurrentUser2 = () => async ({ dispatch: dispatch3 }) => { const currentUser2 = await (0, import_api_fetch9.default)({ path: "/wp/v2/users/me" }); dispatch3.receiveCurrentUser(currentUser2); }; var getEntityRecord2 = (kind, name, key = "", query) => async ({ select: select5, dispatch: dispatch3, registry, resolveSelect: resolveSelect2 }) => { const configs = await resolveSelect2.getEntitiesConfig(kind); const entityConfig = configs.find( (config) => config.name === name && config.kind === kind ); if (!entityConfig) { return; } const lock3 = await dispatch3.__unstableAcquireStoreLock( STORE_NAME, ["entities", "records", kind, name, key], { exclusive: false } ); try { if (query !== void 0 && query._fields) { query = { ...query, _fields: [ .../* @__PURE__ */ new Set([ ...get_normalized_comma_separable_default(query._fields) || [], entityConfig.key || DEFAULT_ENTITY_KEY ]) ].join() }; } if (query !== void 0 && query._fields) { const hasRecord = select5.hasEntityRecord( kind, name, key, query ); if (hasRecord) { return; } } let { baseURL } = entityConfig; if (kind === "postType" && name === "wp_template" && (key && typeof key === "string" && !/^\d+$/.test(key) || !window?.__experimentalTemplateActivate)) { baseURL = baseURL.slice(0, baseURL.lastIndexOf("/")) + "/templates"; } const path = (0, import_url6.addQueryArgs)(baseURL + (key ? "/" + key : ""), { ...entityConfig.baseURLParams, ...query }); const response = await (0, import_api_fetch9.default)({ path, parse: false }); const record = await response.json(); const permissions = getUserPermissionsFromAllowHeader( response.headers?.get("allow") ); const canUserResolutionsArgs = []; const receiveUserPermissionArgs = {}; for (const action of ALLOWED_RESOURCE_ACTIONS) { receiveUserPermissionArgs[getUserPermissionCacheKey(action, { kind, name, id: key })] = permissions[action]; canUserResolutionsArgs.push([ action, { kind, name, id: key } ]); } if (entityConfig.syncConfig && isNumericID(key) && !query) { const objectType = `${kind}/${name}`; const objectId = key; const recordWithTransients = { ...record }; Object.entries(entityConfig.transientEdits ?? {}).filter( ([propName, transientConfig]) => void 0 === recordWithTransients[propName] && transientConfig && "object" === typeof transientConfig && "read" in transientConfig && "function" === typeof transientConfig.read ).forEach(([propName, transientConfig]) => { recordWithTransients[propName] = transientConfig.read(recordWithTransients); }); void getSyncManager()?.load( entityConfig.syncConfig, objectType, objectId, recordWithTransients, { // Handle edits sourced from the sync manager. editRecord: (edits, options = {}) => { if (!Object.keys(edits).length) { return; } dispatch3({ type: "EDIT_ENTITY_RECORD", kind, name, recordId: key, edits, meta: { undo: void 0 }, options }); }, // Get the current entity record (with edits) getEditedRecord: async () => await resolveSelect2.getEditedEntityRecord( kind, name, key ), // Handle sync connection status changes. onStatusChange: (status) => { dispatch3.setSyncConnectionStatus( kind, name, key, status ); }, // Refetch the current entity record from the database. refetchRecord: async () => { dispatch3.receiveEntityRecords( kind, name, await (0, import_api_fetch9.default)({ path, parse: true }), query ); }, // Persist the CRDT document. // // TODO: Currently, persisted CRDT documents are stored in post meta. // This effectively means that only post entities support CRDT // persistence. As we add support for syncing additional entity, // we'll need to revisit where persisted CRDT documents are stored. persistCRDTDoc: () => { resolveSelect2.getEditedEntityRecord(kind, name, key).then((editedRecord) => { const { meta, status } = editedRecord; if ("auto-draft" === status || !meta) { return; } dispatch3.saveEntityRecord( kind, name, editedRecord ); }); }, addUndoMeta: (ydoc, meta) => { const selectionHistory = getSelectionHistory(ydoc); if (selectionHistory) { meta.set( "selectionHistory", selectionHistory ); } }, restoreUndoMeta: (ydoc, meta) => { const selectionHistory = meta.get("selectionHistory"); if (selectionHistory) { setTimeout(() => { restoreSelection(selectionHistory, ydoc); }, 0); } } } ); } registry.batch(() => { dispatch3.receiveEntityRecords(kind, name, record, query); dispatch3.receiveUserPermissions(receiveUserPermissionArgs); dispatch3.finishResolutions("canUser", canUserResolutionsArgs); }); } finally { dispatch3.__unstableReleaseStoreLock(lock3); } }; getEntityRecord2.shouldInvalidate = (action, kind, name) => { return kind === "root" && name === "site" && (action.type === "RECEIVE_ITEMS" && // Making sure persistedEdits is set seems to be the only way of // knowing whether it's an update or fetch. Only an update would // have persistedEdits. action.persistedEdits && action.persistedEdits.status !== "auto-draft" || action.type === "REMOVE_ITEMS") && action.kind === "postType" && action.name === "wp_template"; }; var getRawEntityRecord2 = forward_resolver_default("getEntityRecord"); var getEditedEntityRecord2 = forward_resolver_default("getEntityRecord"); var getEntityRecords2 = (kind, name, query = {}) => async ({ dispatch: dispatch3, registry, resolveSelect: resolveSelect2 }) => { const configs = await resolveSelect2.getEntitiesConfig(kind); const entityConfig = configs.find( (config) => config.name === name && config.kind === kind ); if (!entityConfig) { return; } const lock3 = await dispatch3.__unstableAcquireStoreLock( STORE_NAME, ["entities", "records", kind, name], { exclusive: false } ); const rawQuery = { ...query }; const key = entityConfig.key || DEFAULT_ENTITY_KEY; function getResolutionsArgs(records, recordsQuery) { const queryArgs = Object.fromEntries( Object.entries(recordsQuery).filter(([k, v]) => { return ["context", "_fields"].includes(k) && !!v; }) ); return records.filter((record) => record?.[key]).map((record) => [ kind, name, record[key], Object.keys(queryArgs).length > 0 ? queryArgs : void 0 ]); } try { if (query._fields) { query = { ...query, _fields: [ .../* @__PURE__ */ new Set([ ...get_normalized_comma_separable_default(query._fields) || [], key ]) ].join() }; } let { baseURL } = entityConfig; const { combinedTemplates = true } = query; if (kind === "postType" && name === "wp_template" && combinedTemplates) { baseURL = baseURL.slice(0, baseURL.lastIndexOf("/")) + "/templates"; } const path = (0, import_url6.addQueryArgs)(baseURL, { ...entityConfig.baseURLParams, ...query }); let records = [], meta; if (entityConfig.supportsPagination && query.per_page !== -1) { const response = await (0, import_api_fetch9.default)({ path, parse: false }); records = Object.values(await response.json()); meta = { totalItems: parseInt( response.headers.get("X-WP-Total") ), totalPages: parseInt( response.headers.get("X-WP-TotalPages") ) }; } else if (query.per_page === -1 && query[RECEIVE_INTERMEDIATE_RESULTS] === true) { let page = 1; let totalPages; do { const response = await (0, import_api_fetch9.default)({ path: (0, import_url6.addQueryArgs)(path, { page, per_page: 100 }), parse: false }); const pageRecords = Object.values(await response.json()); totalPages = parseInt( response.headers.get("X-WP-TotalPages") ); if (!meta) { meta = { totalItems: parseInt( response.headers.get("X-WP-Total") ), totalPages: 1 }; } records.push(...pageRecords); registry.batch(() => { dispatch3.receiveEntityRecords( kind, name, records, query, false, void 0, meta ); dispatch3.finishResolutions( "getEntityRecord", getResolutionsArgs(pageRecords, rawQuery) ); }); page++; } while (page <= totalPages); } else { records = Object.values(await (0, import_api_fetch9.default)({ path })); meta = { totalItems: records.length, totalPages: 1 }; } if (entityConfig.syncConfig && -1 === query.per_page) { const objectType = `${kind}/${name}`; getSyncManager()?.loadCollection( entityConfig.syncConfig, objectType, { onStatusChange: (status) => { dispatch3.setSyncConnectionStatus( kind, name, null, status ); }, refetchRecords: async () => { dispatch3.receiveEntityRecords( kind, name, await (0, import_api_fetch9.default)({ path, parse: true }), query ); } } ); } if (query._fields) { records = records.map((record) => { query._fields.split(",").forEach((field) => { if (!record.hasOwnProperty(field)) { record[field] = void 0; } }); return record; }); } registry.batch(() => { dispatch3.receiveEntityRecords( kind, name, records, query, false, void 0, meta ); const targetHints = records.filter( (record) => !!record?.[key] && !!record?._links?.self?.[0]?.targetHints?.allow ).map((record) => ({ id: record[key], permissions: getUserPermissionsFromAllowHeader( record._links.self[0].targetHints.allow ) })); const canUserResolutionsArgs = []; const receiveUserPermissionArgs = {}; for (const targetHint of targetHints) { for (const action of ALLOWED_RESOURCE_ACTIONS) { canUserResolutionsArgs.push([ action, { kind, name, id: targetHint.id } ]); receiveUserPermissionArgs[getUserPermissionCacheKey(action, { kind, name, id: targetHint.id })] = targetHint.permissions[action]; } } if (targetHints.length > 0) { dispatch3.receiveUserPermissions( receiveUserPermissionArgs ); dispatch3.finishResolutions( "canUser", canUserResolutionsArgs ); } dispatch3.finishResolutions( "getEntityRecord", getResolutionsArgs(records, rawQuery) ); dispatch3.__unstableReleaseStoreLock(lock3); }); } catch (e) { dispatch3.__unstableReleaseStoreLock(lock3); } }; getEntityRecords2.shouldInvalidate = (action, kind, name) => { return (action.type === "RECEIVE_ITEMS" || action.type === "REMOVE_ITEMS") && action.invalidateCache && kind === action.kind && name === action.name; }; var getEntityRecordsTotalItems2 = forward_resolver_default("getEntityRecords"); var getEntityRecordsTotalPages2 = forward_resolver_default("getEntityRecords"); var getCurrentTheme2 = () => async ({ dispatch: dispatch3, resolveSelect: resolveSelect2 }) => { const activeThemes = await resolveSelect2.getEntityRecords( "root", "theme", { status: "active" } ); dispatch3.receiveCurrentTheme(activeThemes[0]); }; var getThemeSupports2 = forward_resolver_default("getCurrentTheme"); var getEmbedPreview2 = (url) => async ({ dispatch: dispatch3 }) => { try { const embedProxyResponse = await (0, import_api_fetch9.default)({ path: (0, import_url6.addQueryArgs)("/oembed/1.0/proxy", { url }) }); dispatch3.receiveEmbedPreview(url, embedProxyResponse); } catch (error) { dispatch3.receiveEmbedPreview(url, false); } }; var canUser2 = (requestedAction, resource, id2) => async ({ dispatch: dispatch3, registry, resolveSelect: resolveSelect2 }) => { if (!ALLOWED_RESOURCE_ACTIONS.includes(requestedAction)) { throw new Error(`'${requestedAction}' is not a valid action.`); } const { hasStartedResolution } = registry.select(STORE_NAME); for (const relatedAction of ALLOWED_RESOURCE_ACTIONS) { if (relatedAction === requestedAction) { continue; } const isAlreadyResolving = hasStartedResolution("canUser", [ relatedAction, resource, id2 ]); if (isAlreadyResolving) { return; } } let resourcePath = null; if (typeof resource === "object") { if (!resource.kind || !resource.name) { throw new Error("The entity resource object is not valid."); } const configs = await resolveSelect2.getEntitiesConfig( resource.kind ); const entityConfig = configs.find( (config) => config.name === resource.name && config.kind === resource.kind ); if (!entityConfig) { return; } resourcePath = entityConfig.baseURL + (resource.id ? "/" + resource.id : ""); } else { resourcePath = `/wp/v2/${resource}` + (id2 ? "/" + id2 : ""); } let response; try { response = await (0, import_api_fetch9.default)({ path: resourcePath, method: "OPTIONS", parse: false }); } catch (error) { return; } const permissions = getUserPermissionsFromAllowHeader( response.headers?.get("allow") ); registry.batch(() => { for (const action of ALLOWED_RESOURCE_ACTIONS) { const key = getUserPermissionCacheKey(action, resource, id2); dispatch3.receiveUserPermission(key, permissions[action]); if (action !== requestedAction) { dispatch3.finishResolution("canUser", [ action, resource, id2 ]); } } }); }; var canUserEditEntityRecord2 = (kind, name, recordId) => async ({ dispatch: dispatch3 }) => { await dispatch3(canUser2("update", { kind, name, id: recordId })); }; var getAutosaves2 = (postType, postId) => async ({ dispatch: dispatch3, resolveSelect: resolveSelect2 }) => { const { rest_base: restBase, rest_namespace: restNamespace = "wp/v2", supports } = await resolveSelect2.getPostType(postType); if (!supports?.autosave) { return; } const autosaves2 = await (0, import_api_fetch9.default)({ path: `/${restNamespace}/${restBase}/${postId}/autosaves?context=edit` }); if (autosaves2 && autosaves2.length) { dispatch3.receiveAutosaves(postId, autosaves2); } }; var getAutosave2 = (postType, postId) => async ({ resolveSelect: resolveSelect2 }) => { await resolveSelect2.getAutosaves(postType, postId); }; var __experimentalGetCurrentGlobalStylesId2 = () => async ({ dispatch: dispatch3, resolveSelect: resolveSelect2 }) => { const activeThemes = await resolveSelect2.getEntityRecords( "root", "theme", { status: "active" } ); const globalStylesURL = activeThemes?.[0]?._links?.["wp:user-global-styles"]?.[0]?.href; if (!globalStylesURL) { return; } const matches = globalStylesURL.match(/\/(\d+)(?:\?|$)/); const id2 = matches ? Number(matches[1]) : null; if (id2) { dispatch3.__experimentalReceiveCurrentGlobalStylesId(id2); } }; var __experimentalGetCurrentThemeBaseGlobalStyles2 = () => async ({ resolveSelect: resolveSelect2, dispatch: dispatch3 }) => { const currentTheme2 = await resolveSelect2.getCurrentTheme(); const themeGlobalStyles = await (0, import_api_fetch9.default)({ path: `/wp/v2/global-styles/themes/${currentTheme2.stylesheet}?context=view` }); dispatch3.__experimentalReceiveThemeBaseGlobalStyles( currentTheme2.stylesheet, themeGlobalStyles ); }; var __experimentalGetCurrentThemeGlobalStylesVariations2 = () => async ({ resolveSelect: resolveSelect2, dispatch: dispatch3 }) => { const currentTheme2 = await resolveSelect2.getCurrentTheme(); const variations = await (0, import_api_fetch9.default)({ path: `/wp/v2/global-styles/themes/${currentTheme2.stylesheet}/variations?context=view` }); dispatch3.__experimentalReceiveThemeGlobalStyleVariations( currentTheme2.stylesheet, variations ); }; var getCurrentThemeGlobalStylesRevisions2 = () => async ({ resolveSelect: resolveSelect2, dispatch: dispatch3 }) => { const globalStylesId = await resolveSelect2.__experimentalGetCurrentGlobalStylesId(); const record = globalStylesId ? await resolveSelect2.getEntityRecord( "root", "globalStyles", globalStylesId ) : void 0; const revisionsURL = record?._links?.["version-history"]?.[0]?.href; if (revisionsURL) { const resetRevisions = await (0, import_api_fetch9.default)({ url: revisionsURL }); const revisions = resetRevisions?.map( (revision) => Object.fromEntries( Object.entries(revision).map(([key, value]) => [ camelCase(key), value ]) ) ); dispatch3.receiveThemeGlobalStyleRevisions( globalStylesId, revisions ); } }; getCurrentThemeGlobalStylesRevisions2.shouldInvalidate = (action) => { return action.type === "SAVE_ENTITY_RECORD_FINISH" && action.kind === "root" && !action.error && action.name === "globalStyles"; }; var getBlockPatterns2 = () => async ({ dispatch: dispatch3 }) => { const patterns = await fetchBlockPatterns(); dispatch3({ type: "RECEIVE_BLOCK_PATTERNS", patterns }); }; var getBlockPatternCategories2 = () => async ({ dispatch: dispatch3 }) => { const categories = await (0, import_api_fetch9.default)({ path: "/wp/v2/block-patterns/categories" }); dispatch3({ type: "RECEIVE_BLOCK_PATTERN_CATEGORIES", categories }); }; var getUserPatternCategories2 = () => async ({ dispatch: dispatch3, resolveSelect: resolveSelect2 }) => { const patternCategories = await resolveSelect2.getEntityRecords( "taxonomy", "wp_pattern_category", { per_page: -1, _fields: "id,name,description,slug", context: "view" } ); const mappedPatternCategories = patternCategories?.map((userCategory) => ({ ...userCategory, label: (0, import_html_entities2.decodeEntities)(userCategory.name), name: userCategory.slug })) || []; dispatch3({ type: "RECEIVE_USER_PATTERN_CATEGORIES", patternCategories: mappedPatternCategories }); }; var getNavigationFallbackId2 = () => async ({ dispatch: dispatch3, select: select5, registry }) => { const fallback = await (0, import_api_fetch9.default)({ path: (0, import_url6.addQueryArgs)("/wp-block-editor/v1/navigation-fallback", { _embed: true }) }); const record = fallback?._embedded?.self; registry.batch(() => { dispatch3.receiveNavigationFallbackId(fallback?.id); if (!record) { return; } const existingFallbackEntityRecord = select5.getEntityRecord( "postType", "wp_navigation", fallback.id ); const invalidateNavigationQueries = !existingFallbackEntityRecord; dispatch3.receiveEntityRecords( "postType", "wp_navigation", record, void 0, invalidateNavigationQueries ); dispatch3.finishResolution("getEntityRecord", [ "postType", "wp_navigation", fallback.id ]); }); }; var getDefaultTemplateId2 = (query) => async ({ dispatch: dispatch3, registry, resolveSelect: resolveSelect2 }) => { const template = await (0, import_api_fetch9.default)({ path: (0, import_url6.addQueryArgs)("/wp/v2/templates/lookup", query) }); await resolveSelect2.getEntitiesConfig("postType"); const id2 = window?.__experimentalTemplateActivate ? template?.wp_id || template?.id : template?.id; if (id2) { template.id = id2; registry.batch(() => { dispatch3.receiveDefaultTemplateId(query, id2); dispatch3.receiveEntityRecords( "postType", template.type, template ); dispatch3.finishResolution("getEntityRecord", [ "postType", template.type, id2 ]); }); } }; getDefaultTemplateId2.shouldInvalidate = (action) => { return action.type === "RECEIVE_ITEMS" && action.kind === "root" && action.name === "site"; }; var getRevisions2 = (kind, name, recordKey, query = {}) => async ({ dispatch: dispatch3, registry, resolveSelect: resolveSelect2 }) => { const configs = await resolveSelect2.getEntitiesConfig(kind); const entityConfig = configs.find( (config) => config.name === name && config.kind === kind ); if (!entityConfig) { return; } if (query._fields) { query = { ...query, _fields: [ .../* @__PURE__ */ new Set([ ...get_normalized_comma_separable_default(query._fields) || [], entityConfig.revisionKey || DEFAULT_ENTITY_KEY ]) ].join() }; } const path = (0, import_url6.addQueryArgs)( entityConfig.getRevisionsUrl(recordKey), query ); let records, response; const meta = {}; const isPaginated = entityConfig.supportsPagination && query.per_page !== -1; try { response = await (0, import_api_fetch9.default)({ path, parse: !isPaginated }); } catch (error) { return; } if (response) { if (isPaginated) { records = Object.values(await response.json()); meta.totalItems = parseInt( response.headers.get("X-WP-Total") ); } else { records = Object.values(response); } if (query._fields) { records = records.map((record) => { query._fields.split(",").forEach((field) => { if (!record.hasOwnProperty(field)) { record[field] = void 0; } }); return record; }); } registry.batch(() => { dispatch3.receiveRevisions( kind, name, recordKey, records, query, false, meta ); if (!query?._fields && !query.context) { const key = entityConfig.revisionKey || DEFAULT_ENTITY_KEY; const resolutionsArgs = records.filter((record) => record[key]).map((record) => [ kind, name, recordKey, record[key] ]); dispatch3.finishResolutions( "getRevision", resolutionsArgs ); } }); } }; getRevisions2.shouldInvalidate = (action, kind, name, recordKey) => action.type === "SAVE_ENTITY_RECORD_FINISH" && name === action.name && kind === action.kind && !action.error && recordKey === action.recordId; var getRevision2 = (kind, name, recordKey, revisionKey, query) => async ({ dispatch: dispatch3, resolveSelect: resolveSelect2 }) => { const configs = await resolveSelect2.getEntitiesConfig(kind); const entityConfig = configs.find( (config) => config.name === name && config.kind === kind ); if (!entityConfig) { return; } if (query !== void 0 && query._fields) { query = { ...query, _fields: [ .../* @__PURE__ */ new Set([ ...get_normalized_comma_separable_default(query._fields) || [], entityConfig.revisionKey || DEFAULT_ENTITY_KEY ]) ].join() }; } const path = (0, import_url6.addQueryArgs)( entityConfig.getRevisionsUrl(recordKey, revisionKey), query ); let record; try { record = await (0, import_api_fetch9.default)({ path }); } catch (error) { return; } if (record) { dispatch3.receiveRevisions(kind, name, recordKey, record, query); } }; var getRegisteredPostMeta2 = (postType) => async ({ dispatch: dispatch3, resolveSelect: resolveSelect2 }) => { let options; try { const { rest_namespace: restNamespace = "wp/v2", rest_base: restBase } = await resolveSelect2.getPostType(postType) || {}; options = await (0, import_api_fetch9.default)({ path: `${restNamespace}/${restBase}/?context=edit`, method: "OPTIONS" }); } catch (error) { return; } if (options) { dispatch3.receiveRegisteredPostMeta( postType, options?.schema?.properties?.meta?.properties ); } }; var getEntitiesConfig2 = (kind) => async ({ dispatch: dispatch3 }) => { const loader = additionalEntityConfigLoaders.find( (l) => l.kind === kind ); if (!loader) { return; } try { const configs = await loader.loadEntities(); if (!configs.length) { return; } dispatch3.addEntities(configs); } catch { } }; var getEditorSettings2 = () => async ({ dispatch: dispatch3 }) => { const settings = await (0, import_api_fetch9.default)({ path: "/wp-block-editor/v1/settings" }); dispatch3.receiveEditorSettings(settings); }; var getEditorAssets2 = () => async ({ dispatch: dispatch3 }) => { const assets = await (0, import_api_fetch9.default)({ path: "/wp-block-editor/v1/assets" }); dispatch3.receiveEditorAssets(assets); }; // packages/core-data/build-module/locks/utils.mjs function deepCopyLocksTreePath(tree, path) { const newTree = { ...tree }; let currentNode = newTree; for (const branchName of path) { currentNode.children = { ...currentNode.children, [branchName]: { locks: [], children: {}, ...currentNode.children[branchName] } }; currentNode = currentNode.children[branchName]; } return newTree; } function getNode(tree, path) { let currentNode = tree; for (const branchName of path) { const nextNode = currentNode.children[branchName]; if (!nextNode) { return null; } currentNode = nextNode; } return currentNode; } function* iteratePath(tree, path) { let currentNode = tree; yield currentNode; for (const branchName of path) { const nextNode = currentNode.children[branchName]; if (!nextNode) { break; } yield nextNode; currentNode = nextNode; } } function* iterateDescendants(node) { const stack = Object.values(node.children); while (stack.length) { const childNode = stack.pop(); yield childNode; stack.push(...Object.values(childNode.children)); } } function hasConflictingLock({ exclusive }, locks2) { if (exclusive && locks2.length) { return true; } if (!exclusive && locks2.filter((lock3) => lock3.exclusive).length) { return true; } return false; } // packages/core-data/build-module/locks/reducer.mjs var DEFAULT_STATE = { requests: [], tree: { locks: [], children: {} } }; function locks(state = DEFAULT_STATE, action) { switch (action.type) { case "ENQUEUE_LOCK_REQUEST": { const { request } = action; return { ...state, requests: [request, ...state.requests] }; } case "GRANT_LOCK_REQUEST": { const { lock: lock3, request } = action; const { store: store2, path } = request; const storePath = [store2, ...path]; const newTree = deepCopyLocksTreePath(state.tree, storePath); const node = getNode(newTree, storePath); node.locks = [...node.locks, lock3]; return { ...state, requests: state.requests.filter((r) => r !== request), tree: newTree }; } case "RELEASE_LOCK": { const { lock: lock3 } = action; const storePath = [lock3.store, ...lock3.path]; const newTree = deepCopyLocksTreePath(state.tree, storePath); const node = getNode(newTree, storePath); node.locks = node.locks.filter((l) => l !== lock3); return { ...state, tree: newTree }; } } return state; } // packages/core-data/build-module/locks/selectors.mjs function getPendingLockRequests(state) { return state.requests; } function isLockAvailable(state, store2, path, { exclusive }) { const storePath = [store2, ...path]; const locks2 = state.tree; for (const node2 of iteratePath(locks2, storePath)) { if (hasConflictingLock({ exclusive }, node2.locks)) { return false; } } const node = getNode(locks2, storePath); if (!node) { return true; } for (const descendant of iterateDescendants(node)) { if (hasConflictingLock({ exclusive }, descendant.locks)) { return false; } } return true; } // packages/core-data/build-module/locks/engine.mjs function createLocks() { let state = locks(void 0, { type: "@@INIT" }); function processPendingLockRequests() { for (const request of getPendingLockRequests(state)) { const { store: store2, path, exclusive, notifyAcquired } = request; if (isLockAvailable(state, store2, path, { exclusive })) { const lock3 = { store: store2, path, exclusive }; state = locks(state, { type: "GRANT_LOCK_REQUEST", lock: lock3, request }); notifyAcquired(lock3); } } } function acquire(store2, path, exclusive) { return new Promise((resolve) => { state = locks(state, { type: "ENQUEUE_LOCK_REQUEST", request: { store: store2, path, exclusive, notifyAcquired: resolve } }); processPendingLockRequests(); }); } function release(lock3) { state = locks(state, { type: "RELEASE_LOCK", lock: lock3 }); processPendingLockRequests(); } return { acquire, release }; } // packages/core-data/build-module/locks/actions.mjs function createLocksActions() { const locks2 = createLocks(); function __unstableAcquireStoreLock(store2, path, { exclusive }) { return () => locks2.acquire(store2, path, exclusive); } function __unstableReleaseStoreLock(lock3) { return () => locks2.release(lock3); } return { __unstableAcquireStoreLock, __unstableReleaseStoreLock }; } // packages/core-data/build-module/dynamic-entities.mjs var dynamicActions; var dynamicSelectors; // packages/core-data/build-module/entity-provider.mjs var import_element2 = __toESM(require_element(), 1); // packages/core-data/build-module/entity-context.mjs var import_element = __toESM(require_element(), 1); var EntityContext = (0, import_element.createContext)({}); EntityContext.displayName = "EntityContext"; // packages/core-data/build-module/entity-provider.mjs var import_jsx_runtime = __toESM(require_jsx_runtime(), 1); function EntityProvider({ kind, type: name, id: id2, revisionId, children }) { const parent = (0, import_element2.useContext)(EntityContext); const childContext = (0, import_element2.useMemo)( () => ({ ...parent, ...kind && { [kind]: { ...parent?.[kind], [name]: id2 } }, ...revisionId !== void 0 && { revisionId } }), [parent, kind, name, id2, revisionId] ); return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EntityContext.Provider, { value: childContext, children }); } // packages/core-data/build-module/hooks/use-entity-record.mjs var import_data12 = __toESM(require_data(), 1); var import_deprecated4 = __toESM(require_deprecated(), 1); var import_element3 = __toESM(require_element(), 1); // packages/core-data/build-module/hooks/use-query-select.mjs var import_data11 = __toESM(require_data(), 1); // node_modules/memize/dist/index.js function memize(fn, options) { var size2 = 0; var head; var tail; options = options || {}; function memoized() { var node = head, len = arguments.length, args2, i; searchCache: while (node) { if (node.args.length !== arguments.length) { node = node.next; continue; } for (i = 0; i < len; i++) { if (node.args[i] !== arguments[i]) { node = node.next; continue searchCache; } } if (node !== head) { if (node === tail) { tail = node.prev; } node.prev.next = node.next; if (node.next) { node.next.prev = node.prev; } node.next = head; node.prev = null; head.prev = node; head = node; } return node.val; } args2 = new Array(len); for (i = 0; i < len; i++) { args2[i] = arguments[i]; } node = { args: args2, // Generate the result from original function val: fn.apply(null, args2) }; if (head) { head.prev = node; node.next = head; } else { tail = node; } if (size2 === /** @type {MemizeOptions} */ options.maxSize) { tail = /** @type {MemizeCacheNode} */ tail.prev; tail.next = null; } else { size2++; } head = node; return node.val; } memoized.clear = function() { head = null; tail = null; size2 = 0; }; return memoized; } // packages/core-data/build-module/hooks/memoize.mjs var memoize_default = memize; // packages/core-data/build-module/hooks/constants.mjs var Status = /* @__PURE__ */ ((Status2) => { Status2["Idle"] = "IDLE"; Status2["Resolving"] = "RESOLVING"; Status2["Error"] = "ERROR"; Status2["Success"] = "SUCCESS"; return Status2; })(Status || {}); // packages/core-data/build-module/hooks/use-query-select.mjs var META_SELECTORS = [ "getIsResolving", "hasStartedResolution", "hasFinishedResolution", "isResolving", "getCachedResolvers" ]; function useQuerySelect(mapQuerySelect, deps) { return (0, import_data11.useSelect)((select5, registry) => { const resolve = (store2) => enrichSelectors(select5(store2)); return mapQuerySelect(resolve, registry); }, deps); } var enrichSelectors = memoize_default(((selectors) => { const resolvers = {}; for (const selectorName in selectors) { if (META_SELECTORS.includes(selectorName)) { continue; } Object.defineProperty(resolvers, selectorName, { get: () => (...args2) => { const data = selectors[selectorName](...args2); const resolutionStatus = selectors.getResolutionState( selectorName, args2 )?.status; let status; switch (resolutionStatus) { case "resolving": status = Status.Resolving; break; case "finished": status = Status.Success; break; case "error": status = Status.Error; break; case void 0: status = Status.Idle; break; } return { data, status, isResolving: status === Status.Resolving, hasStarted: status !== Status.Idle, hasResolved: status === Status.Success || status === Status.Error }; } }); } return resolvers; })); // packages/core-data/build-module/hooks/use-entity-record.mjs var EMPTY_OBJECT2 = {}; function useEntityRecord(kind, name, recordId, options = { enabled: true }) { const { editEntityRecord: editEntityRecord2, saveEditedEntityRecord: saveEditedEntityRecord2 } = (0, import_data12.useDispatch)(store); const mutations = (0, import_element3.useMemo)( () => ({ edit: (record2, editOptions = {}) => editEntityRecord2(kind, name, recordId, record2, editOptions), save: (saveOptions = {}) => saveEditedEntityRecord2(kind, name, recordId, { throwOnError: true, ...saveOptions }) }), [editEntityRecord2, kind, name, recordId, saveEditedEntityRecord2] ); const { editedRecord, hasEdits, edits } = (0, import_data12.useSelect)( (select5) => { if (!options.enabled) { return { editedRecord: EMPTY_OBJECT2, hasEdits: false, edits: EMPTY_OBJECT2 }; } return { editedRecord: select5(store).getEditedEntityRecord( kind, name, recordId ), hasEdits: select5(store).hasEditsForEntityRecord( kind, name, recordId ), edits: select5(store).getEntityRecordNonTransientEdits( kind, name, recordId ) }; }, [kind, name, recordId, options.enabled] ); const { data: record, ...querySelectRest } = useQuerySelect( (query) => { if (!options.enabled) { return { data: null }; } return query(store).getEntityRecord(kind, name, recordId); }, [kind, name, recordId, options.enabled] ); return { record, editedRecord, hasEdits, edits, ...querySelectRest, ...mutations }; } function __experimentalUseEntityRecord(kind, name, recordId, options) { (0, import_deprecated4.default)(`wp.data.__experimentalUseEntityRecord`, { alternative: "wp.data.useEntityRecord", since: "6.1" }); return useEntityRecord(kind, name, recordId, options); } // packages/core-data/build-module/hooks/use-entity-records.mjs var import_url7 = __toESM(require_url(), 1); var import_deprecated5 = __toESM(require_deprecated(), 1); var import_data13 = __toESM(require_data(), 1); var import_element4 = __toESM(require_element(), 1); var EMPTY_ARRAY = []; function useEntityRecords(kind, name, queryArgs = {}, options = { enabled: true }) { const queryAsString = (0, import_url7.addQueryArgs)("", queryArgs); const { data: records, ...rest } = useQuerySelect( (query) => { if (!options.enabled) { return { // Avoiding returning a new reference on every execution. data: EMPTY_ARRAY }; } return query(store).getEntityRecords(kind, name, queryArgs); }, [kind, name, queryAsString, options.enabled] ); const { totalItems, totalPages } = (0, import_data13.useSelect)( (select5) => { if (!options.enabled) { return { totalItems: null, totalPages: null }; } return { totalItems: select5(store).getEntityRecordsTotalItems( kind, name, queryArgs ), totalPages: select5(store).getEntityRecordsTotalPages( kind, name, queryArgs ) }; }, [kind, name, queryAsString, options.enabled] ); return { records, totalItems, totalPages, ...rest }; } function __experimentalUseEntityRecords(kind, name, queryArgs, options) { (0, import_deprecated5.default)(`wp.data.__experimentalUseEntityRecords`, { alternative: "wp.data.useEntityRecords", since: "6.1" }); return useEntityRecords(kind, name, queryArgs, options); } function useEntityRecordsWithPermissions(kind, name, queryArgs = {}, options = { enabled: true }) { const entityConfig = (0, import_data13.useSelect)( (select5) => select5(store).getEntityConfig(kind, name), [kind, name] ); const { records: data, ...ret } = useEntityRecords( kind, name, { ...queryArgs, // If _fields is provided, we need to include _links in the request for permission caching to work. ...queryArgs._fields ? { _fields: [ .../* @__PURE__ */ new Set([ ...get_normalized_comma_separable_default( queryArgs._fields ) || [], "_links" ]) ].join() } : {} }, options ); const ids = (0, import_element4.useMemo)( () => data?.map( // @ts-ignore (record) => record[entityConfig?.key ?? "id"] ) ?? [], [data, entityConfig?.key] ); const permissions = (0, import_data13.useSelect)( (select5) => { const { getEntityRecordsPermissions: getEntityRecordsPermissions2 } = unlock2( select5(store) ); return getEntityRecordsPermissions2(kind, name, ids); }, [ids, kind, name] ); const dataWithPermissions = (0, import_element4.useMemo)( () => data?.map((record, index) => ({ // @ts-ignore ...record, permissions: permissions[index] })) ?? [], [data, permissions] ); return { records: dataWithPermissions, ...ret }; } // packages/core-data/build-module/hooks/use-resource-permissions.mjs var import_deprecated6 = __toESM(require_deprecated(), 1); var import_warning = __toESM(require_warning(), 1); function useResourcePermissions(resource, id2) { const isEntity = typeof resource === "object"; const resourceAsString = isEntity ? JSON.stringify(resource) : resource; if (isEntity && typeof id2 !== "undefined") { (0, import_warning.default)( `When 'resource' is an entity object, passing 'id' as a separate argument isn't supported.` ); } return useQuerySelect( (resolve) => { const hasId = isEntity ? !!resource.id : !!id2; const { canUser: canUser3 } = resolve(store); const create9 = canUser3( "create", isEntity ? { kind: resource.kind, name: resource.name } : resource ); if (!hasId) { const read2 = canUser3("read", resource); const isResolving2 = create9.isResolving || read2.isResolving; const hasResolved2 = create9.hasResolved && read2.hasResolved; let status2 = Status.Idle; if (isResolving2) { status2 = Status.Resolving; } else if (hasResolved2) { status2 = Status.Success; } return { status: status2, isResolving: isResolving2, hasResolved: hasResolved2, canCreate: create9.hasResolved && create9.data, canRead: read2.hasResolved && read2.data }; } const read = canUser3("read", resource, id2); const update = canUser3("update", resource, id2); const _delete = canUser3("delete", resource, id2); const isResolving = read.isResolving || create9.isResolving || update.isResolving || _delete.isResolving; const hasResolved = read.hasResolved && create9.hasResolved && update.hasResolved && _delete.hasResolved; let status = Status.Idle; if (isResolving) { status = Status.Resolving; } else if (hasResolved) { status = Status.Success; } return { status, isResolving, hasResolved, canRead: hasResolved && read.data, canCreate: hasResolved && create9.data, canUpdate: hasResolved && update.data, canDelete: hasResolved && _delete.data }; }, [resourceAsString, id2] ); } var use_resource_permissions_default = useResourcePermissions; function __experimentalUseResourcePermissions(resource, id2) { (0, import_deprecated6.default)(`wp.data.__experimentalUseResourcePermissions`, { alternative: "wp.data.useResourcePermissions", since: "6.1" }); return useResourcePermissions(resource, id2); } // packages/core-data/build-module/hooks/use-entity-block-editor.mjs var import_element6 = __toESM(require_element(), 1); var import_data14 = __toESM(require_data(), 1); var import_blocks5 = __toESM(require_blocks(), 1); // packages/core-data/build-module/hooks/use-entity-id.mjs var import_element5 = __toESM(require_element(), 1); function useEntityId(kind, name) { const context = (0, import_element5.useContext)(EntityContext); return context?.[kind]?.[name]; } // packages/core-data/build-module/footnotes/index.mjs var import_rich_text4 = __toESM(require_rich_text(), 1); // packages/core-data/build-module/footnotes/get-rich-text-values-cached.mjs var import_block_editor5 = __toESM(require_block_editor(), 1); var unlockedApis; var cache = /* @__PURE__ */ new WeakMap(); function getRichTextValuesCached(block) { if (!unlockedApis) { unlockedApis = unlock2(import_block_editor5.privateApis); } if (!cache.has(block)) { const values = unlockedApis.getRichTextValues([block]); cache.set(block, values); } return cache.get(block); } // packages/core-data/build-module/footnotes/get-footnotes-order.mjs var cache2 = /* @__PURE__ */ new WeakMap(); function getBlockFootnotesOrder(block) { if (!cache2.has(block)) { const order = []; for (const value of getRichTextValuesCached(block)) { if (!value) { continue; } value.replacements.forEach(({ type, attributes }) => { if (type === "core/footnote") { order.push(attributes["data-fn"]); } }); } cache2.set(block, order); } return cache2.get(block); } function getFootnotesOrder(blocks) { return blocks.flatMap(getBlockFootnotesOrder); } // packages/core-data/build-module/footnotes/index.mjs var oldFootnotes = {}; function updateFootnotesFromMeta(blocks, meta) { const output = { blocks }; if (!meta) { return output; } if (meta.footnotes === void 0) { return output; } const newOrder = getFootnotesOrder(blocks); const footnotes = meta.footnotes ? JSON.parse(meta.footnotes) : []; const currentOrder = footnotes.map((fn) => fn.id); if (currentOrder.join("") === newOrder.join("")) { return output; } const newFootnotes = newOrder.map( (fnId) => footnotes.find((fn) => fn.id === fnId) || oldFootnotes[fnId] || { id: fnId, content: "" } ); function updateAttributes(attributes) { if (!attributes || Array.isArray(attributes) || typeof attributes !== "object") { return attributes; } attributes = { ...attributes }; for (const key in attributes) { const value = attributes[key]; if (Array.isArray(value)) { attributes[key] = value.map(updateAttributes); continue; } if (typeof value !== "string" && !(value instanceof import_rich_text4.RichTextData)) { continue; } const richTextValue = typeof value === "string" ? import_rich_text4.RichTextData.fromHTMLString(value) : new import_rich_text4.RichTextData(value); let hasFootnotes = false; richTextValue.replacements.forEach((replacement) => { if (replacement.type === "core/footnote") { const id2 = replacement.attributes["data-fn"]; const index = newOrder.indexOf(id2); const countValue = (0, import_rich_text4.create)({ html: replacement.innerHTML }); countValue.text = String(index + 1); countValue.formats = Array.from( { length: countValue.text.length }, () => countValue.formats[0] ); countValue.replacements = Array.from( { length: countValue.text.length }, () => countValue.replacements[0] ); replacement.innerHTML = (0, import_rich_text4.toHTMLString)({ value: countValue }); hasFootnotes = true; } }); if (hasFootnotes) { attributes[key] = typeof value === "string" ? richTextValue.toHTMLString() : richTextValue; } } return attributes; } function updateBlocksAttributes(__blocks) { return __blocks.map((block) => { return { ...block, attributes: updateAttributes(block.attributes), innerBlocks: updateBlocksAttributes(block.innerBlocks) }; }); } const newBlocks = updateBlocksAttributes(blocks); oldFootnotes = { ...oldFootnotes, ...footnotes.reduce((acc, fn) => { if (!newOrder.includes(fn.id)) { acc[fn.id] = fn; } return acc; }, {}) }; return { meta: { ...meta, footnotes: JSON.stringify(newFootnotes) }, blocks: newBlocks }; } // packages/core-data/build-module/hooks/use-entity-block-editor.mjs var EMPTY_ARRAY2 = []; var parsedBlocksCache = /* @__PURE__ */ new Map(); function useEntityBlockEditor(kind, name, { id: _id } = {}) { const providerId = useEntityId(kind, name); const id2 = _id ?? providerId; const { content, editedBlocks, meta } = (0, import_data14.useSelect)( (select5) => { if (!id2) { return {}; } const { getEditedEntityRecord: getEditedEntityRecord3 } = select5(STORE_NAME); const editedRecord = getEditedEntityRecord3(kind, name, id2); return { editedBlocks: editedRecord.blocks, content: editedRecord.content, meta: editedRecord.meta }; }, [kind, name, id2] ); const { __unstableCreateUndoLevel: __unstableCreateUndoLevel2, editEntityRecord: editEntityRecord2 } = (0, import_data14.useDispatch)(STORE_NAME); const blocks = (0, import_element6.useMemo)(() => { if (!id2) { return void 0; } if (editedBlocks) { return editedBlocks; } if (!content || typeof content !== "string") { return EMPTY_ARRAY2; } const cacheKey = `${kind}:${name}:${id2}`; const cached = parsedBlocksCache.get(cacheKey); let _blocks; if (cached && cached.content === content) { _blocks = cached.blocks; } else { _blocks = (0, import_blocks5.parse)(content); parsedBlocksCache.set(cacheKey, { content, blocks: _blocks }); } return _blocks; }, [kind, name, id2, editedBlocks, content]); const onChange = (0, import_element6.useCallback)( (newBlocks, options) => { const noChange = blocks === newBlocks; if (noChange) { return __unstableCreateUndoLevel2(kind, name, id2); } const { selection, ...rest } = options; const edits = { selection, content: ({ blocks: blocksForSerialization = [] }) => (0, import_blocks5.__unstableSerializeAndClean)(blocksForSerialization), ...updateFootnotesFromMeta(newBlocks, meta) }; editEntityRecord2(kind, name, id2, edits, { isCached: false, ...rest }); }, [ kind, name, id2, blocks, meta, __unstableCreateUndoLevel2, editEntityRecord2 ] ); const onInput = (0, import_element6.useCallback)( (newBlocks, options) => { const { selection, ...rest } = options; const edits = { selection, ...updateFootnotesFromMeta(newBlocks, meta) }; editEntityRecord2(kind, name, id2, edits, { isCached: true, ...rest }); }, [kind, name, id2, meta, editEntityRecord2] ); return [blocks, onInput, onChange]; } // packages/core-data/build-module/hooks/use-entity-prop.mjs var import_element7 = __toESM(require_element(), 1); var import_data15 = __toESM(require_data(), 1); function useEntityProp(kind, name, prop, _id) { const providerId = useEntityId(kind, name); const id2 = _id ?? providerId; const context = (0, import_element7.useContext)(EntityContext); const revisionId = context?.revisionId; const { value, fullValue } = (0, import_data15.useSelect)( (select5) => { if (revisionId) { const revisions = select5(STORE_NAME).getRevisions( kind, name, id2, { per_page: -1, context: "edit", _fields: "id,date,author,meta,title.raw,excerpt.raw,content.raw" } ); const entityConfig = select5(STORE_NAME).getEntityConfig( kind, name ); const revKey = entityConfig?.revisionKey || DEFAULT_ENTITY_KEY; const revision = revisions?.find( (r) => r[revKey] === revisionId ); return revision ? { value: revision[prop]?.raw ?? revision[prop], fullValue: revision[prop] } : {}; } const { getEntityRecord: getEntityRecord3, getEditedEntityRecord: getEditedEntityRecord3 } = select5(STORE_NAME); const record = getEntityRecord3(kind, name, id2); const editedRecord = getEditedEntityRecord3(kind, name, id2); return record && editedRecord ? { value: editedRecord[prop], fullValue: record[prop] } : {}; }, [kind, name, id2, prop, revisionId] ); const { editEntityRecord: editEntityRecord2 } = (0, import_data15.useDispatch)(STORE_NAME); const setValue = (0, import_element7.useCallback)( (newValue) => { if (revisionId) { return; } editEntityRecord2(kind, name, id2, { [prop]: newValue }); }, [editEntityRecord2, kind, name, id2, prop, revisionId] ); return [value, setValue, fullValue]; } // packages/core-data/build-module/hooks/use-post-editor-awareness-state.mjs var import_compose3 = __toESM(require_compose(), 1); var import_element8 = __toESM(require_element(), 1); var defaultResolvedSelection = { richTextOffset: null, localClientId: null }; var defaultState = { activeCollaborators: [], resolveSelection: () => defaultResolvedSelection, getDebugData: () => ({ doc: {}, clients: {}, collaboratorMap: {} }), isCurrentCollaboratorDisconnected: false }; function getAwarenessState(awareness, newState) { const activeCollaborators = newState ?? awareness.getCurrentState(); return { activeCollaborators, resolveSelection: (selection) => awareness.convertSelectionStateToAbsolute(selection), getDebugData: () => awareness.getDebugData(), isCurrentCollaboratorDisconnected: activeCollaborators.find((collaborator) => collaborator.isMe)?.isConnected === false }; } function usePostEditorAwarenessState(postId, postType) { const [state, setState] = (0, import_element8.useState)(defaultState); (0, import_element8.useEffect)(() => { if (null === postId || null === postType) { setState(defaultState); return; } const objectType = `postType/${postType}`; const objectId = postId.toString(); const awareness = getSyncManager()?.getAwareness( objectType, objectId ); if (!awareness) { setState(defaultState); return; } awareness.setUp(); setState(getAwarenessState(awareness)); const unsubscribe = awareness?.onStateChange( (newState) => { setState(getAwarenessState(awareness, newState)); } ); return unsubscribe; }, [postId, postType]); return state; } function useActiveCollaborators(postId, postType) { return usePostEditorAwarenessState(postId, postType).activeCollaborators; } function useResolvedSelection(postId, postType) { return usePostEditorAwarenessState(postId, postType).resolveSelection; } function useLastPostSave(postId, postType) { const [lastSave, setLastSave] = (0, import_element8.useState)(null); (0, import_element8.useEffect)(() => { if (null === postId || null === postType) { setLastSave(null); return; } const awareness = getSyncManager()?.getAwareness( `postType/${postType}`, postId.toString() ); if (!awareness) { setLastSave(null); return; } awareness.setUp(); const stateMap = awareness.doc.getMap("state"); const recordMap = awareness.doc.getMap("document"); const setupTime = Date.now(); const observer = (event) => { if (event.keysChanged.has("savedAt")) { const savedAt = stateMap.get("savedAt"); const savedByClientId = stateMap.get("savedBy"); if (typeof savedAt === "number" && typeof savedByClientId === "number" && savedAt > setupTime) { const postStatus = recordMap.get("status"); setLastSave({ savedAt, savedByClientId, postStatus }); } } }; stateMap.observe(observer); return () => { stateMap.unobserve(observer); }; }, [postId, postType]); return lastSave; } function useOnCollaboratorJoin(postId, postType, callback) { const { activeCollaborators } = usePostEditorAwarenessState( postId, postType ); const prevCollaborators = (0, import_compose3.usePrevious)(activeCollaborators); (0, import_element8.useEffect)(() => { if (!prevCollaborators || prevCollaborators.length === 0) { return; } const prevMap = new Map( prevCollaborators.map((collaborator) => [ collaborator.clientId, collaborator ]) ); const me = activeCollaborators.find( (collaborator) => collaborator.isMe ); for (const collaborator of activeCollaborators) { if (!prevMap.has(collaborator.clientId) && !collaborator.isMe) { callback(collaborator, me); } } }, [activeCollaborators, prevCollaborators, callback]); } function useOnCollaboratorLeave(postId, postType, callback) { const { activeCollaborators } = usePostEditorAwarenessState( postId, postType ); const prevCollaborators = (0, import_compose3.usePrevious)(activeCollaborators); (0, import_element8.useEffect)(() => { if (!prevCollaborators || prevCollaborators.length === 0) { return; } const newMap = new Map( activeCollaborators.map((collaborator) => [ collaborator.clientId, collaborator ]) ); for (const prevCollab of prevCollaborators) { if (prevCollab.isMe || !prevCollab.isConnected) { continue; } const newCollab = newMap.get(prevCollab.clientId); if (!newCollab?.isConnected) { callback(prevCollab); } } }, [activeCollaborators, prevCollaborators, callback]); } function useOnPostSave(postId, postType, callback) { const { activeCollaborators } = usePostEditorAwarenessState( postId, postType ); const lastPostSave = useLastPostSave(postId, postType); const prevPostSave = (0, import_compose3.usePrevious)(lastPostSave); (0, import_element8.useEffect)(() => { if (!lastPostSave) { return; } if (prevPostSave && lastPostSave.savedAt === prevPostSave.savedAt) { return; } const saver = activeCollaborators.find( (collaborator) => collaborator.clientId === lastPostSave.savedByClientId && !collaborator.isMe ); if (!saver) { return; } callback(lastPostSave, saver, prevPostSave ?? null); }, [lastPostSave, prevPostSave, activeCollaborators, callback]); } // packages/core-data/build-module/private-apis.mjs var lockedApis = { useEntityRecordsWithPermissions, RECEIVE_INTERMEDIATE_RESULTS, retrySyncConnection, useActiveCollaborators, useResolvedSelection, useOnCollaboratorJoin, useOnCollaboratorLeave, useOnPostSave, SelectionType, SelectionDirection }; var privateApis2 = {}; lock2(privateApis2, lockedApis); // packages/core-data/build-module/index.mjs var entitiesConfig2 = [ ...rootEntitiesConfig, ...additionalEntityConfigLoaders.filter((config) => !!config.name) ]; var entitySelectors = entitiesConfig2.reduce((result, entity2) => { const { kind, name, plural } = entity2; const getEntityRecordMethodName = getMethodName(kind, name); result[getEntityRecordMethodName] = (state, key, query) => { logEntityDeprecation(kind, name, getEntityRecordMethodName, { isShorthandSelector: true, alternativeFunctionName: "getEntityRecord" }); return getEntityRecord(state, kind, name, key, query); }; if (plural) { const getEntityRecordsMethodName = getMethodName(kind, plural, "get"); result[getEntityRecordsMethodName] = (state, query) => { logEntityDeprecation(kind, name, getEntityRecordsMethodName, { isShorthandSelector: true, alternativeFunctionName: "getEntityRecords" }); return getEntityRecords(state, kind, name, query); }; } return result; }, {}); var entityResolvers = entitiesConfig2.reduce((result, entity2) => { const { kind, name, plural } = entity2; const getEntityRecordMethodName = getMethodName(kind, name); result[getEntityRecordMethodName] = (key, query) => { logEntityDeprecation(kind, name, getEntityRecordMethodName, { isShorthandSelector: true, alternativeFunctionName: "getEntityRecord" }); return getEntityRecord2(kind, name, key, query); }; if (plural) { const getEntityRecordsMethodName = getMethodName(kind, plural, "get"); result[getEntityRecordsMethodName] = (...args2) => { logEntityDeprecation(kind, plural, getEntityRecordsMethodName, { isShorthandSelector: true, alternativeFunctionName: "getEntityRecords" }); return getEntityRecords2(kind, name, ...args2); }; result[getEntityRecordsMethodName].shouldInvalidate = (action) => getEntityRecords2.shouldInvalidate(action, kind, name); } return result; }, {}); var entityActions = entitiesConfig2.reduce((result, entity2) => { const { kind, name } = entity2; const saveEntityRecordMethodName = getMethodName(kind, name, "save"); result[saveEntityRecordMethodName] = (record, options) => { logEntityDeprecation(kind, name, saveEntityRecordMethodName, { isShorthandSelector: true, alternativeFunctionName: "saveEntityRecord" }); return saveEntityRecord(kind, name, record, options); }; const deleteEntityRecordMethodName = getMethodName(kind, name, "delete"); result[deleteEntityRecordMethodName] = (key, query, options) => { logEntityDeprecation(kind, name, deleteEntityRecordMethodName, { isShorthandSelector: true, alternativeFunctionName: "deleteEntityRecord" }); return deleteEntityRecord(kind, name, key, query, options); }; return result; }, {}); var storeConfig = () => ({ reducer: reducer_default2, actions: { ...dynamicActions, ...actions_exports, ...entityActions, ...createLocksActions() }, selectors: { ...dynamicSelectors, ...selectors_exports, ...entitySelectors }, resolvers: { ...resolvers_exports, ...entityResolvers } }); var store = (0, import_data16.createReduxStore)(STORE_NAME, storeConfig()); unlock2(store).registerPrivateSelectors(private_selectors_exports); unlock2(store).registerPrivateActions(private_actions_exports); (0, import_data16.register)(store); return __toCommonJS(index_exports); })(); notices.js 0000644 00000024164 15206720414 0006556 0 ustar 00 "use strict"; var wp; (wp ||= {}).notices = (() => { 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 __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; 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 )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // package-external:@wordpress/data var require_data = __commonJS({ "package-external:@wordpress/data"(exports, module) { module.exports = window.wp.data; } }); // package-external:@wordpress/components var require_components = __commonJS({ "package-external:@wordpress/components"(exports, module) { module.exports = window.wp.components; } }); // vendor-external:react/jsx-runtime var require_jsx_runtime = __commonJS({ "vendor-external:react/jsx-runtime"(exports, module) { module.exports = window.ReactJSXRuntime; } }); // packages/notices/build-module/index.mjs var index_exports = {}; __export(index_exports, { InlineNotices: () => InlineNotices, SnackbarNotices: () => SnackbarNotices, store: () => store }); // packages/notices/build-module/store/index.mjs var import_data = __toESM(require_data(), 1); // packages/notices/build-module/store/utils/on-sub-key.mjs var onSubKey = (actionProperty) => (reducer) => (state = {}, action) => { const key = action[actionProperty]; if (key === void 0) { return state; } const nextKeyState = reducer(state[key], action); if (nextKeyState === state[key]) { return state; } return { ...state, [key]: nextKeyState }; }; var on_sub_key_default = onSubKey; // packages/notices/build-module/store/reducer.mjs var notices = on_sub_key_default("context")((state = [], action) => { switch (action.type) { case "CREATE_NOTICE": return [ ...state.filter(({ id }) => id !== action.notice.id), action.notice ]; case "REMOVE_NOTICE": return state.filter(({ id }) => id !== action.id); case "REMOVE_NOTICES": return state.filter(({ id }) => !action.ids.includes(id)); case "REMOVE_ALL_NOTICES": return state.filter(({ type }) => type !== action.noticeType); default: return state; } }); var reducer_default = notices; // packages/notices/build-module/store/actions.mjs var actions_exports = {}; __export(actions_exports, { createErrorNotice: () => createErrorNotice, createInfoNotice: () => createInfoNotice, createNotice: () => createNotice, createSuccessNotice: () => createSuccessNotice, createWarningNotice: () => createWarningNotice, removeAllNotices: () => removeAllNotices, removeNotice: () => removeNotice, removeNotices: () => removeNotices }); // packages/notices/build-module/store/constants.mjs var DEFAULT_CONTEXT = "global"; var DEFAULT_STATUS = "info"; // packages/notices/build-module/store/actions.mjs var uniqueId = 0; function createNotice(status = DEFAULT_STATUS, content, options = {}) { const { speak = true, isDismissible = true, context = DEFAULT_CONTEXT, id = `${context}${++uniqueId}`, actions = [], type = "default", __unstableHTML, icon = null, explicitDismiss = false, onDismiss } = options; content = String(content); return { type: "CREATE_NOTICE", context, notice: { id, status, content, spokenMessage: speak ? content : null, __unstableHTML, isDismissible, actions, type, icon, explicitDismiss, onDismiss } }; } function createSuccessNotice(content, options) { return createNotice("success", content, options); } function createInfoNotice(content, options) { return createNotice("info", content, options); } function createErrorNotice(content, options) { return createNotice("error", content, options); } function createWarningNotice(content, options) { return createNotice("warning", content, options); } function removeNotice(id, context = DEFAULT_CONTEXT) { return { type: "REMOVE_NOTICE", id, context }; } function removeAllNotices(noticeType = "default", context = DEFAULT_CONTEXT) { return { type: "REMOVE_ALL_NOTICES", noticeType, context }; } function removeNotices(ids, context = DEFAULT_CONTEXT) { return { type: "REMOVE_NOTICES", ids, context }; } // packages/notices/build-module/store/selectors.mjs var selectors_exports = {}; __export(selectors_exports, { getNotices: () => getNotices }); var DEFAULT_NOTICES = []; function getNotices(state, context = DEFAULT_CONTEXT) { return state[context] || DEFAULT_NOTICES; } // packages/notices/build-module/store/index.mjs var store = (0, import_data.createReduxStore)("core/notices", { reducer: reducer_default, actions: actions_exports, selectors: selectors_exports }); (0, import_data.register)(store); // node_modules/clsx/dist/clsx.mjs function r(e) { var t, f, n = ""; if ("string" == typeof e || "number" == typeof e) n += e; else if ("object" == typeof e) if (Array.isArray(e)) { var o = e.length; for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f); } else for (f in e) e[f] && (n && (n += " "), n += f); return n; } function clsx() { for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t); return n; } var clsx_default = clsx; // packages/notices/build-module/components/inline-notices/index.mjs var import_components = __toESM(require_components(), 1); var import_data2 = __toESM(require_data(), 1); var import_jsx_runtime = __toESM(require_jsx_runtime(), 1); if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='51ef33823e']")) { const style = document.createElement("style"); style.setAttribute("data-wp-hash", "51ef33823e"); style.appendChild(document.createTextNode(".components-notices__dismissible,.components-notices__pinned{color:#1e1e1e}.components-notices__dismissible .components-notice,.components-notices__pinned .components-notice{border-bottom:1px solid #0003;box-sizing:border-box;min-height:64px;padding:0 12px}.components-notices__dismissible .components-notice .components-notice__dismiss,.components-notices__pinned .components-notice .components-notice__dismiss{margin-top:12px}")); document.head.appendChild(style); } function InlineNotices({ children, pinnedNoticesClassName, dismissibleNoticesClassName, context }) { const notices2 = (0, import_data2.useSelect)( (select) => select(store).getNotices(context), [context] ); const { removeNotice: removeNotice2 } = (0, import_data2.useDispatch)(store); const dismissibleNotices = notices2.filter( ({ isDismissible, type }) => isDismissible && type === "default" ); const nonDismissibleNotices = notices2.filter( ({ isDismissible, type }) => !isDismissible && type === "default" ); return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime.jsx)( import_components.NoticeList, { notices: nonDismissibleNotices, className: clsx_default( "components-notices__pinned", pinnedNoticesClassName ) } ), /* @__PURE__ */ (0, import_jsx_runtime.jsx)( import_components.NoticeList, { notices: dismissibleNotices, className: clsx_default( "components-notices__dismissible", dismissibleNoticesClassName ), onRemove: (id) => removeNotice2(id, context), children } ) ] }); } // packages/notices/build-module/components/snackbar-notices/index.mjs var import_components2 = __toESM(require_components(), 1); var import_data3 = __toESM(require_data(), 1); var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1); var MAX_VISIBLE_NOTICES = -3; function SnackbarNotices({ className, context }) { const notices2 = (0, import_data3.useSelect)( (select) => select(store).getNotices(context), [context] ); const { removeNotice: removeNotice2 } = (0, import_data3.useDispatch)(store); const snackbarNotices = notices2.filter(({ type }) => type === "snackbar").slice(MAX_VISIBLE_NOTICES); return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)( import_components2.SnackbarList, { notices: snackbarNotices, className: clsx_default("components-notices__snackbar", className), onRemove: (id) => removeNotice2(id, context) } ); } return __toCommonJS(index_exports); })(); token-list.js 0000644 00000014166 15206720414 0007204 0 ustar 00 "use strict"; var wp; (wp ||= {}).tokenList = (() => { var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; 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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // packages/token-list/build-module/index.mjs var index_exports = {}; __export(index_exports, { default: () => TokenList }); var TokenList = class { _currentValue; _valueAsArray; /** * Constructs a new instance of TokenList. * * @param initialValue Initial value to assign. */ constructor(initialValue = "") { this._currentValue = ""; this._valueAsArray = []; this.value = initialValue; } entries(...args) { return this._valueAsArray.entries(...args); } forEach(...args) { return this._valueAsArray.forEach(...args); } keys(...args) { return this._valueAsArray.keys(...args); } values(...args) { return this._valueAsArray.values(...args); } /** * Returns the associated set as string. * * @see https://dom.spec.whatwg.org/#dom-domtokenlist-value * * @return Token set as string. */ get value() { return this._currentValue; } /** * Replaces the associated set with a new string value. * * @see https://dom.spec.whatwg.org/#dom-domtokenlist-value * * @param value New token set as string. */ set value(value) { value = String(value); this._valueAsArray = [ ...new Set(value.split(/\s+/g).filter(Boolean)) ]; this._currentValue = this._valueAsArray.join(" "); } /** * Returns the number of tokens. * * @see https://dom.spec.whatwg.org/#dom-domtokenlist-length * * @return Number of tokens. */ get length() { return this._valueAsArray.length; } /** * Returns the stringified form of the TokenList. * * @see https://dom.spec.whatwg.org/#DOMTokenList-stringification-behavior * @see https://www.ecma-international.org/ecma-262/9.0/index.html#sec-tostring * * @return Token set as string. */ toString() { return this.value; } /** * Returns an iterator for the TokenList, iterating items of the set. * * @see https://dom.spec.whatwg.org/#domtokenlist * * @return TokenList iterator. */ *[Symbol.iterator]() { return yield* this._valueAsArray; } /** * Returns the token with index `index`. * * @see https://dom.spec.whatwg.org/#dom-domtokenlist-item * * @param index Index at which to return token. * * @return Token at index. */ item(index) { return this._valueAsArray[index]; } /** * Returns true if `token` is present, and false otherwise. * * @see https://dom.spec.whatwg.org/#dom-domtokenlist-contains * * @param item Token to test. * * @return Whether token is present. */ contains(item) { return this._valueAsArray.indexOf(item) !== -1; } /** * Adds all arguments passed, except those already present. * * @see https://dom.spec.whatwg.org/#dom-domtokenlist-add * * @param items Items to add. */ add(...items) { this.value += " " + items.join(" "); } /** * Removes arguments passed, if they are present. * * @see https://dom.spec.whatwg.org/#dom-domtokenlist-remove * * @param items Items to remove. */ remove(...items) { this.value = this._valueAsArray.filter((val) => !items.includes(val)).join(" "); } /** * If `force` is not given, "toggles" `token`, removing it if it’s present * and adding it if it’s not present. If `force` is true, adds token (same * as add()). If force is false, removes token (same as remove()). Returns * true if `token` is now present, and false otherwise. * * @see https://dom.spec.whatwg.org/#dom-domtokenlist-toggle * * @param token Token to toggle. * @param [force] Presence to force. * * @return Whether token is present after toggle. */ toggle(token, force) { if (void 0 === force) { force = !this.contains(token); } if (force) { this.add(token); } else { this.remove(token); } return force; } /** * Replaces `token` with `newToken`. Returns true if `token` was replaced * with `newToken`, and false otherwise. * * @see https://dom.spec.whatwg.org/#dom-domtokenlist-replace * * @param token Token to replace with `newToken`. * @param newToken Token to use in place of `token`. * * @return Whether replacement occurred. */ replace(token, newToken) { if (!this.contains(token)) { return false; } this.remove(token); this.add(newToken); return true; } /* eslint-disable @typescript-eslint/no-unused-vars */ /** * Returns true if `token` is in the associated attribute’s supported * tokens. Returns false otherwise. * * Always returns `true` in this implementation. * * @param _token * @see https://dom.spec.whatwg.org/#dom-domtokenlist-supports * * @return Whether token is supported. */ supports(_token) { return true; } /* eslint-enable @typescript-eslint/no-unused-vars */ }; return __toCommonJS(index_exports); })(); if (typeof wp.tokenList === 'object' && wp.tokenList.default) { wp.tokenList = wp.tokenList.default; } shortcode.min.js 0000644 00000006376 15206720414 0007673 0 ustar 00 "use strict";var wp;(wp||={}).shortcode=(()=>{var h=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var $=(e,n)=>{for(var s in n)h(e,s,{get:n[s],enumerable:!0})},z=(e,n,s,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of y(n))!b.call(e,t)&&t!==s&&h(e,t,{get:()=>n[t],enumerable:!(i=w(n,t))||i.enumerable});return e};var E=e=>z(h({},"__esModule",{value:!0}),e);var C={};$(C,{attrs:()=>p,default:()=>S,fromMatch:()=>u,next:()=>g,regexp:()=>f,replace:()=>x,string:()=>v});function d(e,n){var s=0,i,t;n=n||{};function c(){var r=i,o=arguments.length,l,a;e:for(;r;){if(r.args.length!==arguments.length){r=r.next;continue}for(a=0;a<o;a++)if(r.args[a]!==arguments[a]){r=r.next;continue e}return r!==i&&(r===t&&(t=r.prev),r.prev.next=r.next,r.next&&(r.next.prev=r.prev),r.next=i,r.prev=null,i.prev=r,i=r),r.val}for(l=new Array(o),a=0;a<o;a++)l[a]=arguments[a];return r={args:l,val:e.apply(null,l)},i?(i.prev=r,r.next=i):t=r,s===n.maxSize?(t=t.prev,t.next=null):s++,i=r,r.val}return c.clear=function(){i=null,t=null,s=0},c}function g(e,n,s=0){let i=f(e);i.lastIndex=s;let t=i.exec(n);if(!t)return;if(t[1]==="["&&t[7]==="]")return g(e,n,i.lastIndex);let c={index:t.index,content:t[0],shortcode:u(t)};return t[1]&&(c.content=c.content.slice(1),c.index++),t[7]&&(c.content=c.content.slice(0,-1)),c}function x(e,n,s){return n.replace(f(e),(...i)=>{let t=i[0],c=i[1],r=i[7];if(c==="["&&r==="]")return t;let o=s(u(i));return o||o===""?c+o+r:t})}function v(e){return new m(e).string()}function f(e){return new RegExp("\\[(\\[?)("+e+")(?![\\w-])([^\\]\\/]*(?:\\/(?!\\])[^\\]\\/]*)*?)(?:(\\/)\\]|\\](?:([^\\[]*(?:\\[(?!\\/\\2\\])[^\\[]*)*)(\\[\\/\\2\\]))?)(\\]?)","g")}var p=d(e=>{let n={},s=[],i=/([\w-]+)\s*=\s*"([^"]*)"(?:\s|$)|([\w-]+)\s*=\s*'([^']*)'(?:\s|$)|([\w-]+)\s*=\s*([^\s'"]+)(?:\s|$)|"([^"]*)"(?:\s|$)|'([^']*)'(?:\s|$)|(\S+)(?:\s|$)/g;e=e.replace(/[\u00a0\u200b]/g," ");let t;for(;t=i.exec(e);)t[1]?n[t[1].toLowerCase()]=t[2]:t[3]?n[t[3].toLowerCase()]=t[4]:t[5]?n[t[5].toLowerCase()]=t[6]:t[7]?s.push(t[7]):t[8]?s.push(t[8]):t[9]&&s.push(t[9]);return{named:n,numeric:s}});function u(e){let n;return e[4]?n="self-closing":e[6]?n="closed":n="single",new m({tag:e[2],attrs:e[3],type:n,content:e[5]})}var m=class{tag;type;content;attrs;static next=g;static replace=x;static string=v;static regexp=f;static attrs=p;static fromMatch=u;constructor(e){let{tag:n,attrs:s,type:i,content:t}=e;this.tag=n,this.type=i,this.content=t,this.attrs={named:{},numeric:[]},s&&(typeof s=="string"?this.attrs=p(s):"named"in s&&"numeric"in s&&s.named!==void 0&&s.numeric!==void 0?this.attrs=s:Object.entries(s).forEach(([c,r])=>{r!==void 0&&this.set(c,String(r))}))}get(e){return typeof e=="number"?this.attrs.numeric[e]:this.attrs.named[e]}set(e,n){return typeof e=="number"?this.attrs.numeric[e]=n:this.attrs.named[e]=n,this}string(){let e="["+this.tag;return this.attrs.numeric.forEach(n=>{/\s/.test(n)?e+=' "'+n+'"':e+=" "+n}),Object.entries(this.attrs.named).forEach(([n,s])=>{e+=" "+n+'="'+s+'"'}),this.type==="single"?e+"]":this.type==="self-closing"?e+" /]":(e+="]",this.content&&(e+=this.content),e+"[/"+this.tag+"]")}},S=m;return E(C);})(); if (typeof wp.shortcode === 'object' && wp.shortcode.default) { wp.shortcode = wp.shortcode.default; } priority-queue.min.js 0000644 00000006505 15206720414 0010676 0 ustar 00 "use strict";var wp;(wp||={}).priorityQueue=(()=>{var P=Object.create;var p=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var Q=Object.getOwnPropertyNames;var W=Object.getPrototypeOf,B=Object.prototype.hasOwnProperty;var G=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),H=(e,t)=>{for(var i in t)p(e,i,{get:t[i],enumerable:!0})},A=(e,t,i,f)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Q(t))!B.call(e,n)&&n!==i&&p(e,n,{get:()=>t[n],enumerable:!(f=_(t,n))||f.enumerable});return e};var J=(e,t,i)=>(i=e!=null?P(W(e)):{},A(t||!e||!e.__esModule?p(i,"default",{value:e,enumerable:!0}):i,e)),K=e=>A(p({},"__esModule",{value:!0}),e);var z=G((Y,w)=>{(function(e){typeof define=="function"&&define.amd?define([],e):typeof w=="object"&&w.exports?w.exports=e():window.idleCallbackShim=e()})(function(){"use strict";var e,t,i,f,n=typeof window<"u"?window:typeof global!=null?global:this||{},I=n.cancelRequestAnimationFrame&&n.requestAnimationFrame||setTimeout,y=n.cancelRequestAnimationFrame||clearTimeout,a=[],o=0,s=!1,k=7,v=35,g=125,C=0,h=0,T=0,D={get didTimeout(){return!1},timeRemaining:function(){var r=k-(Date.now()-h);return r<0?0:r}},F=O(function(){k=22,g=66,v=0});function O(r){var l,c,u=99,b=function(){var m=Date.now()-c;m<u?l=setTimeout(b,u-m):(l=null,r())};return function(){c=Date.now(),l||(l=setTimeout(b,u))}}function S(){s&&(f&&y(f),i&&clearTimeout(i),s=!1)}function d(){g!=125&&(k=7,g=125,v=35,s&&(S(),R())),F()}function M(){f=null,i=setTimeout(j,0)}function L(){i=null,I(M)}function R(){s||(t=g-(Date.now()-h),e=Date.now(),s=!0,v&&t<v&&(t=v),t>9?i=setTimeout(L,t):(t=0,L()))}function j(){var r,l,c,u=k>9?9:1;if(h=Date.now(),s=!1,i=null,o>2||h-t-50<e)for(l=0,c=a.length;l<c&&D.timeRemaining()>u;l++)r=a.shift(),T++,r&&r(D);a.length?R():o=0}function E(r){return C++,a.push(r),R(),C}function x(r){var l=r-1-T;a[l]&&(a[l]=null)}if(!n.requestIdleCallback||!n.cancelIdleCallback)n.requestIdleCallback=E,n.cancelIdleCallback=x,n.document&&document.addEventListener&&(n.addEventListener("scroll",d,!0),n.addEventListener("resize",d),document.addEventListener("focus",d,!0),document.addEventListener("mouseover",d,!0),["click","keypress","touchstart","mousedown"].forEach(function(r){document.addEventListener(r,d,{capture:!0,passive:!0})}),n.MutationObserver&&new MutationObserver(d).observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0}));else try{n.requestIdleCallback(function(){},{timeout:0})}catch{(function(l){var c,u;if(n.requestIdleCallback=function(b,m){return m&&typeof m.timeout=="number"?l(b,m.timeout):l(b)},n.IdleCallbackDeadline&&(c=IdleCallbackDeadline.prototype)){if(u=Object.getOwnPropertyDescriptor(c,"timeRemaining"),!u||!u.configurable||!u.get)return;Object.defineProperty(c,"timeRemaining",{value:function(){return u.get.call(this)},enumerable:!0,configurable:!0})}})(n.requestIdleCallback)}return{request:E,cancel:x}})});var V={};H(V,{createQueue:()=>U});var Z=J(z(),1);function N(){return typeof window>"u"?e=>{setTimeout(()=>e(Date.now()),0)}:window.requestIdleCallback}var q=N();var U=()=>{let e=new Map,t=!1,i=a=>{for(let[o,s]of e)if(e.delete(o),s(),typeof a=="number"||a.timeRemaining()<=0)break;if(e.size===0){t=!1;return}q(i)};return{add:(a,o)=>{e.set(a,o),t||(t=!0,q(i))},flush:a=>{let o=e.get(a);return o===void 0?!1:(e.delete(a),o(),!0)},cancel:a=>e.delete(a),reset:()=>{e.clear(),t=!1}}};return K(V);})(); react-i18n.min.js 0000644 00000002767 15206720414 0007554 0 ustar 00 "use strict";var wp;(wp||={}).reactI18n=(()=>{var I=Object.create;var a=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var N=Object.getOwnPropertyNames;var T=Object.getPrototypeOf,y=Object.prototype.hasOwnProperty;var i=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports),P=(e,n)=>{for(var t in n)a(e,t,{get:n[t],enumerable:!0})},p=(e,n,t,s)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of N(n))!y.call(e,r)&&r!==t&&a(e,r,{get:()=>n[r],enumerable:!(s=R(n,r))||s.enumerable});return e};var d=(e,n,t)=>(t=e!=null?I(T(e)):{},p(n||!e||!e.__esModule?a(t,"default",{value:e,enumerable:!0}):t,e)),E=e=>p(a({},"__esModule",{value:!0}),e);var f=i((M,x)=>{x.exports=window.wp.element});var _=i((S,l)=>{l.exports=window.wp.i18n});var b=i((U,w)=>{w.exports=window.ReactJSXRuntime});var k={};P(k,{I18nProvider:()=>L,useI18n:()=>C,withI18n:()=>j});var o=d(f(),1),u=d(_(),1),c=d(b(),1);function h(e){return{__:e.__.bind(e),_x:e._x.bind(e),_n:e._n.bind(e),_nx:e._nx.bind(e),isRTL:e.isRTL.bind(e),hasTranslation:e.hasTranslation.bind(e)}}var m=(0,o.createContext)(h(u.defaultI18n));m.displayName="I18nContext";function L(e){let{children:n,i18n:t=u.defaultI18n}=e,[s,r]=(0,o.useReducer)(()=>[],[]);(0,o.useEffect)(()=>t.subscribe(r),[t]);let v=(0,o.useMemo)(()=>h(t),[t,s]);return(0,c.jsx)(m.Provider,{value:v,children:n})}var C=()=>(0,o.useContext)(m);function j(e){let n=s=>{let r=C();return(0,c.jsx)(e,{...s,...r})},t=e.displayName||e.name||"Component";return n.displayName=`WithI18n(${t})`,n}return E(k);})(); viewport.js 0000644 00000015155 15206720414 0006771 0 ustar 00 var wp; (wp ||= {}).viewport = (() => { 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 __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; 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 )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // package-external:@wordpress/compose var require_compose = __commonJS({ "package-external:@wordpress/compose"(exports, module) { module.exports = window.wp.compose; } }); // package-external:@wordpress/data var require_data = __commonJS({ "package-external:@wordpress/data"(exports, module) { module.exports = window.wp.data; } }); // vendor-external:react/jsx-runtime var require_jsx_runtime = __commonJS({ "vendor-external:react/jsx-runtime"(exports, module) { module.exports = window.ReactJSXRuntime; } }); // packages/viewport/build-module/index.mjs var index_exports = {}; __export(index_exports, { ifViewportMatches: () => if_viewport_matches_default, store: () => store, withViewportMatch: () => with_viewport_match_default }); // packages/viewport/build-module/listener.mjs var import_compose = __toESM(require_compose(), 1); var import_data2 = __toESM(require_data(), 1); // packages/viewport/build-module/store/index.mjs var import_data = __toESM(require_data(), 1); // packages/viewport/build-module/store/reducer.mjs function reducer(state = {}, action) { switch (action.type) { case "SET_IS_MATCHING": return action.values; } return state; } var reducer_default = reducer; // packages/viewport/build-module/store/actions.mjs var actions_exports = {}; __export(actions_exports, { setIsMatching: () => setIsMatching }); function setIsMatching(values) { return { type: "SET_IS_MATCHING", values }; } // packages/viewport/build-module/store/selectors.mjs var selectors_exports = {}; __export(selectors_exports, { isViewportMatch: () => isViewportMatch }); function isViewportMatch(state, query) { if (query.indexOf(" ") === -1) { query = ">= " + query; } return !!state[query]; } // packages/viewport/build-module/store/index.mjs var STORE_NAME = "core/viewport"; var store = (0, import_data.createReduxStore)(STORE_NAME, { reducer: reducer_default, actions: actions_exports, selectors: selectors_exports }); (0, import_data.register)(store); // packages/viewport/build-module/listener.mjs var addDimensionsEventListener = (breakpoints, operators) => { const setIsMatching2 = (0, import_compose.debounce)( () => { const values = Object.fromEntries( queries.map(([key, query]) => [key, query.matches]) ); (0, import_data2.dispatch)(store).setIsMatching(values); }, 0, { leading: true } ); const operatorEntries = Object.entries(operators); const queries = Object.entries(breakpoints).flatMap( ([name, width]) => { return operatorEntries.map(([operator, condition]) => { const list = window.matchMedia( `(${condition}: ${width}px)` ); list.addEventListener("change", setIsMatching2); return [`${operator} ${name}`, list]; }); } ); window.addEventListener("orientationchange", setIsMatching2); setIsMatching2(); setIsMatching2.flush(); }; var listener_default = addDimensionsEventListener; // packages/viewport/build-module/if-viewport-matches.mjs var import_compose3 = __toESM(require_compose(), 1); // packages/viewport/build-module/with-viewport-match.mjs var import_compose2 = __toESM(require_compose(), 1); var import_jsx_runtime = __toESM(require_jsx_runtime(), 1); var withViewportMatch = (queries) => { const queryEntries = Object.entries(queries); const useViewPortQueriesResult = () => Object.fromEntries( queryEntries.map(([key, query]) => { let [operator, breakpointName] = query.split(" "); if (breakpointName === void 0) { breakpointName = operator; operator = ">="; } return [key, (0, import_compose2.useViewportMatch)(breakpointName, operator)]; }) ); return (0, import_compose2.createHigherOrderComponent)((WrappedComponent) => { return (0, import_compose2.pure)((props) => { const queriesResult = useViewPortQueriesResult(); return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(WrappedComponent, { ...props, ...queriesResult }); }); }, "withViewportMatch"); }; var with_viewport_match_default = withViewportMatch; // packages/viewport/build-module/if-viewport-matches.mjs var ifViewportMatches = (query) => (0, import_compose3.createHigherOrderComponent)( (0, import_compose3.compose)([ with_viewport_match_default({ isViewportMatch: query }), (0, import_compose3.ifCondition)((props) => props.isViewportMatch) ]), "ifViewportMatches" ); var if_viewport_matches_default = ifViewportMatches; // packages/viewport/build-module/index.mjs var BREAKPOINTS = { huge: 1440, wide: 1280, large: 960, medium: 782, small: 600, mobile: 480 }; var OPERATORS = { "<": "max-width", ">=": "min-width" }; listener_default(BREAKPOINTS, OPERATORS); return __toCommonJS(index_exports); })(); undo-manager.js 0000644 00000012456 15206720414 0007470 0 ustar 00 "use strict"; var wp; (wp ||= {}).undoManager = (() => { 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 __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; 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 )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // package-external:@wordpress/is-shallow-equal var require_is_shallow_equal = __commonJS({ "package-external:@wordpress/is-shallow-equal"(exports, module) { module.exports = window.wp.isShallowEqual; } }); // packages/undo-manager/build-module/index.mjs var index_exports = {}; __export(index_exports, { createUndoManager: () => createUndoManager }); var import_is_shallow_equal = __toESM(require_is_shallow_equal(), 1); function mergeHistoryChanges(changes1, changes2) { const newChanges = { ...changes1 }; Object.entries(changes2).forEach(([key, value]) => { if (newChanges[key]) { newChanges[key] = { ...newChanges[key], to: value.to }; } else { newChanges[key] = value; } }); return newChanges; } var addHistoryChangesIntoRecord = (record, changes) => { const existingChangesIndex = record?.findIndex( ({ id: recordIdentifier }) => { return typeof recordIdentifier === "string" ? recordIdentifier === changes.id : (0, import_is_shallow_equal.isShallowEqual)(recordIdentifier, changes.id); } ); const nextRecord = [...record]; if (existingChangesIndex !== -1) { nextRecord[existingChangesIndex] = { id: changes.id, changes: mergeHistoryChanges( nextRecord[existingChangesIndex].changes, changes.changes ) }; } else { nextRecord.push(changes); } return nextRecord; }; function createUndoManager() { let history = []; let stagedRecord = []; let offset = 0; const dropPendingRedos = () => { history = history.slice(0, offset || void 0); offset = 0; }; const appendStagedRecordToLatestHistoryRecord = () => { const index = history.length === 0 ? 0 : history.length - 1; let latestRecord = history[index] ?? []; stagedRecord.forEach((changes) => { latestRecord = addHistoryChangesIntoRecord(latestRecord, changes); }); stagedRecord = []; history[index] = latestRecord; }; const isRecordEmpty = (record) => { const filteredRecord = record.filter(({ changes }) => { return Object.values(changes).some( ({ from, to }) => typeof from !== "function" && typeof to !== "function" && !(0, import_is_shallow_equal.isShallowEqual)(from, to) ); }); return !filteredRecord.length; }; return { addRecord(record, isStaged = false) { const isEmpty = !record || isRecordEmpty(record); if (isStaged) { if (isEmpty) { return; } record.forEach((changes) => { stagedRecord = addHistoryChangesIntoRecord( stagedRecord, changes ); }); } else { dropPendingRedos(); if (stagedRecord.length) { appendStagedRecordToLatestHistoryRecord(); } if (isEmpty) { return; } history.push(record); } }, undo() { if (stagedRecord.length) { dropPendingRedos(); appendStagedRecordToLatestHistoryRecord(); } const undoRecord = history[history.length - 1 + offset]; if (!undoRecord) { return; } offset -= 1; return undoRecord; }, redo() { const redoRecord = history[history.length + offset]; if (!redoRecord) { return; } offset += 1; return redoRecord; }, hasUndo() { return !!history[history.length - 1 + offset]; }, hasRedo() { return !!history[history.length + offset]; } }; } return __toCommonJS(index_exports); })(); keyboard-shortcuts.min.js 0000644 00000006644 15206720414 0011533 0 ustar 00 var wp;(wp||={}).keyboardShortcuts=(()=>{var B=Object.create;var d=Object.defineProperty;var F=Object.getOwnPropertyDescriptor;var J=Object.getOwnPropertyNames;var X=Object.getPrototypeOf,q=Object.prototype.hasOwnProperty;var l=(t,r)=>()=>(r||t((r={exports:{}}).exports,r),r.exports),w=(t,r)=>{for(var e in r)d(t,e,{get:r[e],enumerable:!0})},k=(t,r,e,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of J(r))!q.call(t,n)&&n!==e&&d(t,n,{get:()=>r[n],enumerable:!(o=F(r,n))||o.enumerable});return t};var i=(t,r,e)=>(e=t!=null?B(X(t)):{},k(r||!t||!t.__esModule?d(e,"default",{value:t,enumerable:!0}):e,t)),Q=t=>k(d({},"__esModule",{value:!0}),t);var p=l((st,_)=>{_.exports=window.wp.data});var b=l((mt,A)=>{A.exports=window.wp.keycodes});var y=l((pt,N)=>{N.exports=window.wp.element});var j=l((bt,P)=>{P.exports=window.ReactJSXRuntime});var ut={};w(ut,{ShortcutProvider:()=>Y,__unstableUseShortcutEventMatch:()=>R,store:()=>c,useShortcut:()=>D});var h=i(p(),1);function V(t={},r){switch(r.type){case"REGISTER_SHORTCUT":return{...t,[r.name]:{category:r.category,keyCombination:r.keyCombination,aliases:r.aliases,description:r.description}};case"UNREGISTER_SHORTCUT":let{[r.name]:e,...o}=t;return o}return t}var K=V;var v={};w(v,{registerShortcut:()=>W,unregisterShortcut:()=>Z});function W({name:t,category:r,description:e,keyCombination:o,aliases:n}){return{type:"REGISTER_SHORTCUT",name:t,category:r,keyCombination:o,aliases:n,description:e}}function Z(t){return{type:"UNREGISTER_SHORTCUT",name:t}}var g={};w(g,{getAllShortcutKeyCombinations:()=>U,getAllShortcutRawKeyCombinations:()=>ot,getCategoryShortcuts:()=>nt,getShortcutAliases:()=>O,getShortcutDescription:()=>et,getShortcutKeyCombination:()=>x,getShortcutRepresentation:()=>rt});var S=i(p(),1),u=i(b(),1),$=[],tt={display:u.displayShortcut,raw:u.rawShortcut,ariaLabel:u.shortcutAriaLabel};function M(t,r){return t?t.modifier?tt[r][t.modifier](t.character):t.character:null}function x(t,r){return t[r]?t[r].keyCombination:null}function rt(t,r,e="display"){let o=x(t,r);return M(o,e)}function et(t,r){return t[r]?t[r].description:null}function O(t,r){return t[r]&&t[r].aliases?t[r].aliases:$}var U=(0,S.createSelector)((t,r)=>[x(t,r),...O(t,r)].filter(Boolean),(t,r)=>[t[r]]),ot=(0,S.createSelector)((t,r)=>U(t,r).map(e=>M(e,"raw")),(t,r)=>[t[r]]),nt=(0,S.createSelector)((t,r)=>Object.entries(t).filter(([,e])=>e.category===r).map(([e])=>e),t=>[t]);var it="core/keyboard-shortcuts",c=(0,h.createReduxStore)(it,{reducer:K,actions:v,selectors:g});(0,h.register)(c);var a=i(y(),1);var G=i(p(),1),H=i(b(),1);function R(){let{getAllShortcutKeyCombinations:t}=(0,G.useSelect)(c);function r(e,o){return t(e).some(({modifier:n,character:m})=>H.isKeyboardEvent[n](o,m))}return r}var L=i(y(),1),s=new Set,I=t=>{for(let r of s)r(t)},f=(0,L.createContext)({add:t=>{s.size===0&&document.addEventListener("keydown",I),s.add(t)},delete:t=>{s.delete(t),s.size===0&&document.removeEventListener("keydown",I)}});f.displayName="KeyboardShortcutsContext";function D(t,r,{isDisabled:e=!1}={}){let o=(0,a.useContext)(f),n=R(),m=(0,a.useRef)();(0,a.useEffect)(()=>{m.current=r},[r]),(0,a.useEffect)(()=>{if(e)return;function T(C){n(t,C)&&m.current(C)}return o.add(T),()=>{o.delete(T)}},[t,e,o])}var z=i(y(),1);var E=i(j(),1),{Provider:at}=f;function Y(t){let[r]=(0,z.useState)(()=>new Set);function e(o){t.onKeyDown&&t.onKeyDown(o);for(let n of r)n(o)}return(0,E.jsx)(at,{value:r,children:(0,E.jsx)("div",{...t,onKeyDown:e})})}return Q(ut);})(); edit-post.min.js 0000644 00000142111 15206720414 0007575 0 ustar 00 var wp;(wp||={}).editPost=(()=>{var ls=Object.create;var He=Object.defineProperty;var ds=Object.getOwnPropertyDescriptor;var fs=Object.getOwnPropertyNames;var us=Object.getPrototypeOf,ms=Object.prototype.hasOwnProperty;var y=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),wt=(e,t)=>{for(var r in t)He(e,r,{get:t[r],enumerable:!0})},fo=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of fs(t))!ms.call(e,s)&&s!==r&&He(e,s,{get:()=>t[s],enumerable:!(a=ds(t,s))||a.enumerable});return e};var o=(e,t,r)=>(r=e!=null?ls(us(e)):{},fo(t||!e||!e.__esModule?He(r,"default",{value:e,enumerable:!0}):r,e)),cs=e=>fo(He({},"__esModule",{value:!0}),e);var qe=y((vn,uo)=>{uo.exports=window.wp.blocks});var St=y((bn,mo)=>{mo.exports=window.wp.blockLibrary});var Ce=y((wn,co)=>{co.exports=window.wp.deprecated});var O=y((Sn,po)=>{po.exports=window.wp.element});var h=y((xn,go)=>{go.exports=window.wp.data});var U=y((En,ho)=>{ho.exports=window.wp.preferences});var vo=y((_n,yo)=>{yo.exports=window.wp.widgets});var P=y((Pn,bo)=>{bo.exports=window.wp.editor});var R=y((kn,So)=>{So.exports=window.wp.i18n});var Z=y((Tn,xo)=>{xo.exports=window.wp.components});var v=y((In,Eo)=>{Eo.exports=window.ReactJSXRuntime});var Ee=y((Rn,ko)=>{ko.exports=window.wp.primitives});var Io=y((Un,To)=>{To.exports=window.wp.privateApis});var Je=y((Wn,Bo)=>{Bo.exports=window.wp.compose});var At=y((Kn,Co)=>{Co.exports=window.wp.blockEditor});var Ot=y((Yn,Ro)=>{Ro.exports=window.wp.styleEngine});var jo=y((hl,Vo)=>{Vo.exports=window.wp.plugins});var et=y((yl,Do)=>{Do.exports=window.wp.notices});var Vt=y((vl,No)=>{No.exports=window.wp.commands});var pe=y((bl,$o)=>{$o.exports=window.wp.url});var zo=y((wl,Go)=>{Go.exports=window.wp.htmlEntities});var ee=y((Sl,Uo)=>{Uo.exports=window.wp.coreData});var dr=y((Ll,lr)=>{lr.exports=window.wp.keyboardShortcuts});var mr=y((Vl,ur)=>{ur.exports=window.wp.apiFetch});var pr=y((jl,cr)=>{cr.exports=window.wp.hooks});var Nr=y((ad,Dr)=>{Dr.exports=window.wp.keycodes});var hn={};wt(hn,{PluginBlockSettingsMenuItem:()=>on,PluginDocumentSettingPanel:()=>rn,PluginMoreMenuItem:()=>an,PluginPostPublishPanel:()=>nn,PluginPostStatusInfo:()=>ln,PluginPrePublishPanel:()=>sn,PluginSidebar:()=>dn,PluginSidebarMoreMenuItem:()=>fn,__experimentalFullscreenModeClose:()=>tt,__experimentalMainDashboardButton:()=>mn,__experimentalPluginPostExcerpt:()=>un,initializeEditor:()=>pn,reinitializeEditor:()=>gn,store:()=>w});var qa=o(qe(),1),Ka=o(St(),1),Ya=o(Ce(),1),ht=o(O(),1),se=o(h(),1),Ie=o(U(),1),yt=o(vo(),1),vt=o(P(),1);function wo(e){var t,r,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=wo(e[t]))&&(a&&(a+=" "),a+=r)}else for(r in e)e[r]&&(a&&(a+=" "),a+=r);return a}function ps(){for(var e,t,r=0,a="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=wo(e))&&(a&&(a+=" "),a+=t);return a}var Q=ps;var _o=o(O(),1),Po=o(v(),1),Mo=(0,_o.forwardRef)(({children:e,className:t,ariaLabel:r,as:a="div",...s},n)=>(0,Po.jsx)(a,{ref:n,className:Q("admin-ui-navigable-region",t),"aria-label":r,role:"region",tabIndex:"-1",...s,children:e}));Mo.displayName="NavigableRegion";var xt=Mo;var Ke=o(Ee(),1),Et=o(v(),1),_t=(0,Et.jsx)(Ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Et.jsx)(Ke.Path,{d:"M14 6H6v8h1.5V8.5L17 18l1-1-9.5-9.5H14V6Z"})});var Ye=o(Ee(),1),Pt=o(v(),1),Mt=(0,Pt.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Pt.jsx)(Ye.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})});var Xe=o(Ee(),1),kt=o(v(),1),Tt=(0,kt.jsx)(Xe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,kt.jsx)(Xe.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})});var Qe=o(Ee(),1),It=o(v(),1),Bt=(0,It.jsx)(Qe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,It.jsx)(Qe.Path,{d:"M6 4a2 2 0 0 0-2 2v3h1.5V6a.5.5 0 0 1 .5-.5h3V4H6Zm3 14.5H6a.5.5 0 0 1-.5-.5v-3H4v3a2 2 0 0 0 2 2h3v-1.5Zm6 1.5v-1.5h3a.5.5 0 0 0 .5-.5v-3H20v3a2 2 0 0 1-2 2h-3Zm3-16a2 2 0 0 1 2 2v3h-1.5V6a.5.5 0 0 0-.5-.5h-3V4h3Z"})});var Ze=o(Ee(),1),Ct=o(v(),1),Rt=(0,Ct.jsx)(Ze.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24",children:(0,Ct.jsx)(Ze.Path,{d:"M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z"})});var B=o(P(),1),fe=o(h(),1),Da=o(At(),1);var gs=o(Ot(),1);var _e="body",Ao=":root";var Re=o(qe(),1),Fo=o(Ot(),1),ys=o(h(),1);function Lt(e){if(!e)return;let t=e.match(/var:preset\|spacing\|(.+)/);return t?`var(--wp--preset--spacing--${t[1]})`:e}function hs(e){if(!e)return null;let t=typeof e=="string";return{top:t?e:e?.top,left:t?e:e?.left}}function Oo(e,t="0"){let r=hs(e);if(!r)return null;let a=Lt(r?.top)||t,s=Lt(r?.left)||t;return a===s?a:`${a} ${s}`}var Lo={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}}]}};function Ft({layoutDefinitions:e=Lo,style:t,selector:r,hasBlockGapSupport:a,hasFallbackGapSupport:s,fallbackGapValue:n}){let i="",l=a?Oo(t?.spacing?.blockGap):"";if(s&&(r===_e?l=l||"0.5em":!a&&n&&(l=n)),l&&e&&(Object.values(e).forEach(({className:c,name:g,spacingStyles:m})=>{!a&&g!=="flex"&&g!=="grid"||m?.length&&m.forEach(p=>{let _=[];if(p.rules&&Object.entries(p.rules).forEach(([u,S])=>{_.push(`${u}: ${S||l}`)}),_.length){let u="";a?u=r===_e?`:root :where(.${c})${p?.selector||""}`:`:root :where(${r}-${c})${p?.selector||""}`:u=r===_e?`:where(.${c}${p?.selector||""})`:`:where(${r}.${c}${p?.selector||""})`,i+=`${u} { ${_.join("; ")}; }`}})}),r===_e&&a&&(i+=`${Ao} { --wp--style--block-gap: ${l}; }`)),r===_e&&e){let c=["block","flex","grid"];Object.values(e).forEach(({className:g,displayMode:m,baseStyles:p})=>{m&&c.includes(m)&&(i+=`${r} .${g} { display:${m}; }`),p?.length&&p.forEach(_=>{let u=[];if(_.rules&&Object.entries(_.rules).forEach(([S,V])=>{u.push(`${S}: ${V}`)}),u.length){let S=`.${g}${_?.selector||""}`;i+=`${S} { ${u.join("; ")}; }`}})})}return i}var Na=o(jo(),1),q=o(R(),1),F=o(O(),1);var ze=o(et(),1),gt=o(U(),1),$a=o(Vt(),1),Ga=o(St(),1),ro=o(pe(),1),za=o(zo(),1),Ua=o(ee(),1),K=o(Z(),1),ue=o(Je(),1);var Qo=o(P(),1),Zo=o(Z(),1);var Wo=o(h(),1),J=o(Z(),1),jt=o(R(),1),Ho=o(pe(),1);var qo=o(P(),1),Ko=o(ee(),1),Yo=o(Je(),1),$=o(v(),1),vs={edit:{clipPath:"inset(0% round 0px)"},hover:{clipPath:"inset( 22% round 2px )"},tap:{clipPath:"inset(0% round 0px)"}},bs={edit:{opacity:0,scale:.2},hover:{opacity:1,scale:1,clipPath:"inset( 22% round 2px )"}};function ws({showTooltip:e,icon:t,href:r,initialPost:a}){let{isRequestingSiteIcon:s,postType:n,siteIconUrl:i}=(0,Wo.useSelect)(S=>{let{getCurrentPostType:V}=S(qo.store),{getEntityRecord:ie,getPostType:ne,isResolving:Y}=S(Ko.store),ce=ie("root","__unstableBase",void 0)||{},be=a?.type||V();return{isRequestingSiteIcon:Y("getEntityRecord",["root","__unstableBase",void 0]),postType:ne(be),siteIconUrl:ce.site_icon_url}},[a?.type]),l=(0,Yo.useReducedMotion)(),c={duration:l?0:.2};if(!n)return null;let g;s&&!i?g=(0,$.jsx)("div",{className:"edit-post-fullscreen-mode-close-site-icon__image"}):i?g=(0,$.jsx)("img",{className:"edit-post-fullscreen-mode-close-site-icon__image",alt:(0,jt.__)("Site Icon"),src:i}):g=(0,$.jsx)(J.Icon,{className:"edit-post-fullscreen-mode-close-site-icon__icon",icon:Rt,size:48});let m=t?(0,$.jsx)(J.Icon,{size:"36px",icon:t}):(0,$.jsx)("div",{className:"edit-post-fullscreen-mode-close-site-icon",children:g}),p=Q("edit-post-fullscreen-mode-close",{"has-icon":i}),_=r??(0,Ho.addQueryArgs)("edit.php",{post_type:n.slug}),u=n?.labels?.view_items??(0,jt.__)("Back");return(0,$.jsxs)(J.__unstableMotion.div,{className:"edit-post-fullscreen-mode-close__view-mode-toggle",animate:"edit",initial:"edit",whileHover:"hover",whileTap:"tap",transition:c,children:[(0,$.jsx)(J.Button,{__next40pxDefaultSize:!0,className:p,href:_,label:u,showTooltip:e,tooltipPosition:"middle right",children:(0,$.jsx)(J.__unstableMotion.div,{variants:!l&&vs,children:(0,$.jsx)("div",{className:"edit-post-fullscreen-mode-close__view-mode-toggle-icon",children:m})})}),(0,$.jsx)(J.__unstableMotion.div,{className:Q("edit-post-fullscreen-mode-close__back-icon",{"has-site-icon":i}),variants:!l&&bs,children:(0,$.jsx)(J.Icon,{icon:_t})})]})}var tt=ws;var Xo=o(Io(),1),{lock:Pl,unlock:d}=(0,Xo.__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/edit-post");var ot=o(v(),1),{BackButton:Ss}=d(Qo.privateApis),xs={hidden:{x:"-100%"},distractionFreeInactive:{x:0},hover:{x:0,transition:{type:"tween",delay:.2}}};function Es({initialPost:e}){return(0,ot.jsx)(Ss,{children:({length:t})=>t<=1&&(0,ot.jsx)(Zo.__unstableMotion.div,{variants:xs,transition:{type:"tween",delay:.8},children:(0,ot.jsx)(tt,{showTooltip:!0,initialPost:e})})})}var Jo=Es;var rr=o(h(),1),Ae=o(O(),1),ar=o(P(),1),sr=o(ee(),1);var er="core/edit-post",tr="#wp-admin-bar-view a",or="#wp-admin-bar-preview a";var ir=()=>{let{isViewable:e,newPermalink:t}=(0,rr.useSelect)(a=>{let{getPostType:s}=a(sr.store),{getCurrentPost:n,getEditedPostAttribute:i}=a(ar.store);return{isViewable:s(i("type"))?.viewable,newPermalink:n().link}},[]),r=(0,Ae.useRef)();(0,Ae.useEffect)(()=>{r.current=document.querySelector(or)||document.querySelector(tr)},[]),(0,Ae.useEffect)(()=>{if(!(!t||!r.current)){if(!e){r.current.style.display="none";return}r.current.style.display="",r.current.setAttribute("href",t)}},[t,e])};function nr(){return ir(),null}var Er=o(O(),1),Wt=o(h(),1),st=o(dr(),1),_r=o(R(),1);var at=o(h(),1);var Dt=o(h(),1);function _s(e=!1,t){switch(t.type){case"REQUEST_META_BOX_UPDATES":return!0;case"META_BOX_UPDATES_SUCCESS":case"META_BOX_UPDATES_FAILURE":return!1;default:return e}}function Ps(e=[],t){let r=[...e];for(let a of t){let s=r.findIndex(n=>n.id===a.id);s!==-1?r[s]={...r[s],...a}:r.push(a)}return r}function Ms(e={},t){switch(t.type){case"SET_META_BOXES_PER_LOCATIONS":{let r={...e};for(let[a,s]of Object.entries(t.metaBoxesPerLocation))r[a]=Ps(r[a],s);return r}}return e}function ks(e=!1,t){return t.type==="META_BOXES_INITIALIZED"?!0:e}var Ts=(0,Dt.combineReducers)({isSaving:_s,locations:Ms,initialized:ks}),fr=(0,Dt.combineReducers)({metaBoxes:Ts});var Nt={};wt(Nt,{__experimentalSetPreviewDeviceType:()=>Ys,__unstableCreateTemplate:()=>Js,closeGeneralSidebar:()=>Bs,closeModal:()=>Rs,closePublishSidebar:()=>Os,hideBlockTypes:()=>Us,initializeMetaBoxes:()=>ei,metaBoxUpdatesFailure:()=>Ks,metaBoxUpdatesSuccess:()=>qs,openGeneralSidebar:()=>Is,openModal:()=>Cs,openPublishSidebar:()=>As,removeEditorPanel:()=>js,requestMetaBoxUpdates:()=>Hs,setAvailableMetaBoxesPerLocation:()=>Ws,setIsEditingTemplate:()=>Zs,setIsInserterOpened:()=>Xs,setIsListViewOpened:()=>Qs,showBlockTypes:()=>zs,switchEditorMode:()=>Ns,toggleDistractionFree:()=>ti,toggleEditorPanelEnabled:()=>Fs,toggleEditorPanelOpened:()=>Vs,toggleFeature:()=>Ds,toggleFullscreenMode:()=>oi,togglePinnedPluginItem:()=>$s,togglePublishSidebar:()=>Ls,updatePreferredStyleVariations:()=>Gs});var yr=o(mr(),1),Oe=o(U(),1),M=o(P(),1),I=o(Ce(),1),vr=o(pr(),1),br=o(ee(),1),wr=o(et(),1),rt=o(R(),1);var gr=e=>{let t=document.querySelector(`.edit-post-meta-boxes-area.is-${e} .metabox-location-${e}`);return t||document.querySelector("#metaboxes .metabox-location-"+e)};var{interfaceStore:Pe}=d(M.privateApis),Is=e=>({registry:t})=>{t.dispatch(Pe).enableComplementaryArea("core",e)},Bs=()=>({registry:e})=>e.dispatch(Pe).disableComplementaryArea("core"),Cs=e=>({registry:t})=>((0,I.default)("select( 'core/edit-post' ).openModal( name )",{since:"6.3",alternative:"select( 'core/interface').openModal( name )"}),t.dispatch(Pe).openModal(e)),Rs=()=>({registry:e})=>((0,I.default)("select( 'core/edit-post' ).closeModal()",{since:"6.3",alternative:"select( 'core/interface').closeModal()"}),e.dispatch(Pe).closeModal()),As=()=>({registry:e})=>{(0,I.default)("dispatch( 'core/edit-post' ).openPublishSidebar",{since:"6.6",alternative:"dispatch( 'core/editor').openPublishSidebar"}),e.dispatch(M.store).openPublishSidebar()},Os=()=>({registry:e})=>{(0,I.default)("dispatch( 'core/edit-post' ).closePublishSidebar",{since:"6.6",alternative:"dispatch( 'core/editor').closePublishSidebar"}),e.dispatch(M.store).closePublishSidebar()},Ls=()=>({registry:e})=>{(0,I.default)("dispatch( 'core/edit-post' ).togglePublishSidebar",{since:"6.6",alternative:"dispatch( 'core/editor').togglePublishSidebar"}),e.dispatch(M.store).togglePublishSidebar()},Fs=e=>({registry:t})=>{(0,I.default)("dispatch( 'core/edit-post' ).toggleEditorPanelEnabled",{since:"6.5",alternative:"dispatch( 'core/editor').toggleEditorPanelEnabled"}),t.dispatch(M.store).toggleEditorPanelEnabled(e)},Vs=e=>({registry:t})=>{(0,I.default)("dispatch( 'core/edit-post' ).toggleEditorPanelOpened",{since:"6.5",alternative:"dispatch( 'core/editor').toggleEditorPanelOpened"}),t.dispatch(M.store).toggleEditorPanelOpened(e)},js=e=>({registry:t})=>{(0,I.default)("dispatch( 'core/edit-post' ).removeEditorPanel",{since:"6.5",alternative:"dispatch( 'core/editor').removeEditorPanel"}),t.dispatch(M.store).removeEditorPanel(e)},Ds=e=>({registry:t})=>t.dispatch(Oe.store).toggle("core/edit-post",e),Ns=e=>({registry:t})=>{(0,I.default)("dispatch( 'core/edit-post' ).switchEditorMode",{since:"6.6",alternative:"dispatch( 'core/editor').switchEditorMode"}),t.dispatch(M.store).switchEditorMode(e)},$s=e=>({registry:t})=>{let r=t.select(Pe).isItemPinned("core",e);t.dispatch(Pe)[r?"unpinItem":"pinItem"]("core",e)};function Gs(){return(0,I.default)("dispatch( 'core/edit-post' ).updatePreferredStyleVariations",{since:"6.6",hint:"Preferred Style Variations are not supported anymore."}),{type:"NOTHING"}}var zs=e=>({registry:t})=>{d(t.dispatch(M.store)).showBlockTypes(e)},Us=e=>({registry:t})=>{d(t.dispatch(M.store)).hideBlockTypes(e)};function Ws(e){return{type:"SET_META_BOXES_PER_LOCATIONS",metaBoxesPerLocation:e}}var Hs=()=>async({registry:e,select:t,dispatch:r})=>{r({type:"REQUEST_META_BOX_UPDATES"}),window.tinyMCE&&window.tinyMCE.triggerSave();let a=new window.FormData(document.querySelector(".metabox-base-form")),s=a.get("post_ID"),n=a.get("post_type"),i=e.select(br.store).getEditedEntityRecord("postType",n,s),l=[i.comment_status?["comment_status",i.comment_status]:!1,i.ping_status?["ping_status",i.ping_status]:!1,i.sticky?["sticky",i.sticky]:!1,i.author?["post_author",i.author]:!1].filter(Boolean),c=t.getActiveMetaBoxLocations(),m=[a,...c.map(p=>new window.FormData(gr(p)))].reduce((p,_)=>{for(let[u,S]of _)p.append(u,S);return p},new window.FormData);l.forEach(([p,_])=>m.append(p,_));try{await(0,yr.default)({url:window._wpMetaBoxUrl,method:"POST",body:m,parse:!1}),r.metaBoxUpdatesSuccess()}catch{r.metaBoxUpdatesFailure()}};function qs(){return{type:"META_BOX_UPDATES_SUCCESS"}}function Ks(){return{type:"META_BOX_UPDATES_FAILURE"}}var Ys=e=>({registry:t})=>{(0,I.default)("dispatch( 'core/edit-post' ).__experimentalSetPreviewDeviceType",{since:"6.5",version:"6.7",hint:"registry.dispatch( editorStore ).setDeviceType"}),t.dispatch(M.store).setDeviceType(e)},Xs=e=>({registry:t})=>{(0,I.default)("dispatch( 'core/edit-post' ).setIsInserterOpened",{since:"6.5",alternative:"dispatch( 'core/editor').setIsInserterOpened"}),t.dispatch(M.store).setIsInserterOpened(e)},Qs=e=>({registry:t})=>{(0,I.default)("dispatch( 'core/edit-post' ).setIsListViewOpened",{since:"6.5",alternative:"dispatch( 'core/editor').setIsListViewOpened"}),t.dispatch(M.store).setIsListViewOpened(e)};function Zs(){return(0,I.default)("dispatch( 'core/edit-post' ).setIsEditingTemplate",{since:"6.5",alternative:"dispatch( 'core/editor').setRenderingMode"}),{type:"NOTHING"}}function Js(){return(0,I.default)("dispatch( 'core/edit-post' ).__unstableCreateTemplate",{since:"6.5"}),{type:"NOTHING"}}var hr=!1,ei=()=>({registry:e,select:t,dispatch:r})=>{if(!e.select(M.store).__unstableIsEditorReady()||hr)return;let s=e.select(M.store).getCurrentPostType();window.postboxes.page!==s&&window.postboxes.add_postbox_toggles(s),hr=!0,(0,vr.addAction)("editor.savePost","core/edit-post/save-metaboxes",async(n,i)=>{!i.isAutosave&&t.hasMetaBoxes()&&await r.requestMetaBoxUpdates()}),r({type:"META_BOXES_INITIALIZED"})},ti=()=>({registry:e})=>{(0,I.default)("dispatch( 'core/edit-post' ).toggleDistractionFree",{since:"6.6",alternative:"dispatch( 'core/editor').toggleDistractionFree"}),e.dispatch(M.store).toggleDistractionFree()},oi=()=>({registry:e})=>{let t=e.select(Oe.store).get("core/edit-post","fullscreenMode");e.dispatch(Oe.store).toggle("core/edit-post","fullscreenMode"),e.dispatch(wr.store).createInfoNotice(t?(0,rt.__)("Fullscreen mode deactivated."):(0,rt.__)("Fullscreen mode activated."),{id:"core/edit-post/toggle-fullscreen-mode/notice",type:"snackbar",actions:[{label:(0,rt.__)("Undo"),onClick:()=>{e.dispatch(Oe.store).toggle("core/edit-post","fullscreenMode")}}]})};var Ut={};wt(Ut,{__experimentalGetInsertionPoint:()=>Pi,__experimentalGetPreviewDeviceType:()=>Ei,areMetaBoxesInitialized:()=>Ti,getActiveGeneralSidebarName:()=>li,getActiveMetaBoxLocations:()=>xr,getAllMetaBoxes:()=>wi,getEditedPostTemplate:()=>Ii,getEditorMode:()=>si,getHiddenBlockTypes:()=>ui,getMetaBoxesPerLocation:()=>zt,getPreference:()=>fi,getPreferences:()=>Sr,hasMetaBoxes:()=>Si,isEditingTemplate:()=>ki,isEditorPanelEnabled:()=>pi,isEditorPanelOpened:()=>gi,isEditorPanelRemoved:()=>ci,isEditorSidebarOpened:()=>ii,isFeatureActive:()=>yi,isInserterOpened:()=>_i,isListViewOpened:()=>Mi,isMetaBoxLocationActive:()=>Gt,isMetaBoxLocationVisible:()=>bi,isModalActive:()=>hi,isPluginItemPinned:()=>vi,isPluginSidebarOpened:()=>ni,isPublishSidebarOpened:()=>mi,isSavingMetaBoxes:()=>xi});var x=o(h(),1),ge=o(U(),1),$t=o(ee(),1),L=o(P(),1),G=o(Ce(),1);var{interfaceStore:Le}=d(L.privateApis),ri=[],ai={},si=(0,x.createRegistrySelector)(e=>()=>e(ge.store).get("core","editorMode")??"visual"),ii=(0,x.createRegistrySelector)(e=>()=>{let t=e(Le).getActiveComplementaryArea("core");return["edit-post/document","edit-post/block"].includes(t)}),ni=(0,x.createRegistrySelector)(e=>()=>{let t=e(Le).getActiveComplementaryArea("core");return!!t&&!["edit-post/document","edit-post/block"].includes(t)}),li=(0,x.createRegistrySelector)(e=>()=>e(Le).getActiveComplementaryArea("core"));function di(e,t){let r=e?.reduce((s,n)=>({...s,[n]:{enabled:!1}}),{});return t?.reduce((s,n)=>{let i=s?.[n];return{...s,[n]:{...i,opened:!0}}},r??{})??r??ai}var Sr=(0,x.createRegistrySelector)(e=>()=>{(0,G.default)("select( 'core/edit-post' ).getPreferences",{since:"6.0",alternative:"select( 'core/preferences' ).get"});let t=["editorMode","hiddenBlockTypes"].reduce((n,i)=>{let l=e(ge.store).get("core",i);return{...n,[i]:l}},{}),r=e(ge.store).get("core","inactivePanels"),a=e(ge.store).get("core","openPanels"),s=di(r,a);return{...t,panels:s}});function fi(e,t,r){(0,G.default)("select( 'core/edit-post' ).getPreference",{since:"6.0",alternative:"select( 'core/preferences' ).get"});let s=Sr(e)[t];return s===void 0?r:s}var ui=(0,x.createRegistrySelector)(e=>()=>e(ge.store).get("core","hiddenBlockTypes")??ri),mi=(0,x.createRegistrySelector)(e=>()=>((0,G.default)("select( 'core/edit-post' ).isPublishSidebarOpened",{since:"6.6",alternative:"select( 'core/editor' ).isPublishSidebarOpened"}),e(L.store).isPublishSidebarOpened())),ci=(0,x.createRegistrySelector)(e=>(t,r)=>((0,G.default)("select( 'core/edit-post' ).isEditorPanelRemoved",{since:"6.5",alternative:"select( 'core/editor' ).isEditorPanelRemoved"}),e(L.store).isEditorPanelRemoved(r))),pi=(0,x.createRegistrySelector)(e=>(t,r)=>((0,G.default)("select( 'core/edit-post' ).isEditorPanelEnabled",{since:"6.5",alternative:"select( 'core/editor' ).isEditorPanelEnabled"}),e(L.store).isEditorPanelEnabled(r))),gi=(0,x.createRegistrySelector)(e=>(t,r)=>((0,G.default)("select( 'core/edit-post' ).isEditorPanelOpened",{since:"6.5",alternative:"select( 'core/editor' ).isEditorPanelOpened"}),e(L.store).isEditorPanelOpened(r))),hi=(0,x.createRegistrySelector)(e=>(t,r)=>((0,G.default)("select( 'core/edit-post' ).isModalActive",{since:"6.3",alternative:"select( 'core/interface' ).isModalActive"}),!!e(Le).isModalActive(r))),yi=(0,x.createRegistrySelector)(e=>(t,r)=>!!e(ge.store).get("core/edit-post",r)),vi=(0,x.createRegistrySelector)(e=>(t,r)=>e(Le).isItemPinned("core",r)),xr=(0,x.createSelector)(e=>Object.keys(e.metaBoxes.locations).filter(t=>Gt(e,t)),e=>[e.metaBoxes.locations]),bi=(0,x.createRegistrySelector)(e=>(t,r)=>Gt(t,r)&&zt(t,r)?.some(({id:a})=>e(L.store).isEditorPanelEnabled(`meta-box-${a}`)));function Gt(e,t){let r=zt(e,t);return!!r&&r.length!==0}function zt(e,t){return e.metaBoxes.locations[t]}var wi=(0,x.createSelector)(e=>Object.values(e.metaBoxes.locations).flat(),e=>[e.metaBoxes.locations]);function Si(e){return xr(e).length>0}function xi(e){return e.metaBoxes.isSaving}var Ei=(0,x.createRegistrySelector)(e=>()=>((0,G.default)("select( 'core/edit-site' ).__experimentalGetPreviewDeviceType",{since:"6.5",version:"6.7",alternative:"select( 'core/editor' ).getDeviceType"}),e(L.store).getDeviceType())),_i=(0,x.createRegistrySelector)(e=>()=>((0,G.default)("select( 'core/edit-post' ).isInserterOpened",{since:"6.5",alternative:"select( 'core/editor' ).isInserterOpened"}),e(L.store).isInserterOpened())),Pi=(0,x.createRegistrySelector)(e=>()=>((0,G.default)("select( 'core/edit-post' ).__experimentalGetInsertionPoint",{since:"6.5",version:"6.7"}),d(e(L.store)).getInserter())),Mi=(0,x.createRegistrySelector)(e=>()=>((0,G.default)("select( 'core/edit-post' ).isListViewOpened",{since:"6.5",alternative:"select( 'core/editor' ).isListViewOpened"}),e(L.store).isListViewOpened())),ki=(0,x.createRegistrySelector)(e=>()=>((0,G.default)("select( 'core/edit-post' ).isEditingTemplate",{since:"6.5",alternative:"select( 'core/editor' ).getRenderingMode"}),e(L.store).getCurrentPostType()==="wp_template"));function Ti(e){return e.metaBoxes.initialized}var Ii=(0,x.createRegistrySelector)(e=>()=>{let{id:t,type:r}=e(L.store).getCurrentPost(),a=d(e($t.store)).getTemplateId(r,t);if(a)return e($t.store).getEditedEntityRecord("postType","wp_template",a)});var w=(0,at.createReduxStore)(er,{reducer:fr,actions:Nt,selectors:Ut});(0,at.register)(w);function Bi(){let{toggleFullscreenMode:e}=(0,Wt.useDispatch)(w),{registerShortcut:t}=(0,Wt.useDispatch)(st.store);return(0,Er.useEffect)(()=>{t({name:"core/edit-post/toggle-fullscreen",category:"global",description:(0,_r.__)("Enable or disable fullscreen mode."),keyCombination:{modifier:"secondary",character:"f"}})},[]),(0,st.useShortcut)("core/edit-post/toggle-fullscreen",()=>{e()}),null}var Pr=Bi;var nt=o(h(),1),de=o(R(),1),H=o(Z(),1),it=o(O(),1),Ht=o(P(),1),W=o(v(),1);function Mr(){let{editPost:e}=(0,nt.useDispatch)(Ht.store),[t,r]=(0,it.useState)(void 0),[a,s]=(0,it.useState)(""),n=(0,nt.useSelect)(c=>c(Ht.store).isCleanNewPost(),[]),[i,l]=(0,it.useState)(()=>n);return n?(0,W.jsx)(W.Fragment,{children:i&&(0,W.jsx)(H.Modal,{title:(0,de.__)("Create pattern"),onRequestClose:()=>{l(!1)},overlayClassName:"reusable-blocks-menu-items__convert-modal",children:(0,W.jsx)("form",{onSubmit:c=>{c.preventDefault(),l(!1),e({title:a,meta:{wp_pattern_sync_status:t}})},children:(0,W.jsxs)(H.__experimentalVStack,{spacing:"5",children:[(0,W.jsx)(H.TextControl,{label:(0,de.__)("Name"),value:a,onChange:s,placeholder:(0,de.__)("My pattern"),className:"patterns-create-modal__name-input",__next40pxDefaultSize:!0}),(0,W.jsx)(H.ToggleControl,{label:(0,de._x)("Synced","pattern (singular)"),help:(0,de.__)("Sync this pattern across multiple locations."),checked:!t,onChange:()=>{r(t?void 0:"unsynced")}}),(0,W.jsx)(H.__experimentalHStack,{justify:"right",children:(0,W.jsx)(H.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",disabled:!a,accessibleWhenDisabled:!0,children:(0,de.__)("Create")})})]})})})}):null}var lt=o(O(),1),kr=o(h(),1),Tr=o(pe(),1),Ir=o(P(),1);function Ci(e){return(0,Tr.addQueryArgs)("post.php",{post:e,action:"edit"})}function Br(){let[e,t]=(0,lt.useState)(null),{postId:r,postStatus:a}=(0,kr.useSelect)(s=>{let{getCurrentPost:n}=s(Ir.store),i=n(),{id:l,status:c,type:g}=i;return["wp_template","wp_template_part"].includes(g)&&(l=i.wp_id),{postId:l,postStatus:c}},[]);return(0,lt.useEffect)(()=>{r&&r!==e&&a!=="auto-draft"&&(window.history.replaceState({id:r},"Post "+r,Ci(r)),t(r))},[r,a,e]),null}var jr=o(h(),1);var Fe=o(O(),1),Cr=o(Z(),1),Rr=o(h(),1);var Me=o(v(),1);function Ri({location:e}){let t=(0,Fe.useRef)(null),r=(0,Fe.useRef)(null);(0,Fe.useEffect)(()=>(r.current=document.querySelector(".metabox-location-"+e),r.current&&t.current.appendChild(r.current),()=>{r.current&&document.querySelector("#metaboxes").appendChild(r.current)}),[e]);let a=(0,Rr.useSelect)(n=>n(w).isSavingMetaBoxes(),[]),s=Q("edit-post-meta-boxes-area",`is-${e}`,{"is-loading":a});return(0,Me.jsxs)("div",{className:s,children:[a&&(0,Me.jsx)(Cr.Spinner,{}),(0,Me.jsx)("div",{className:"edit-post-meta-boxes-area__container",ref:t}),(0,Me.jsx)("div",{className:"edit-post-meta-boxes-area__clear"})]})}var Ar=Ri;var Or=o(O(),1),Lr=o(h(),1),Fr=o(P(),1);function Vr({id:e}){let t=(0,Lr.useSelect)(r=>r(Fr.store).isEditorPanelEnabled(`meta-box-${e}`),[e]);return(0,Or.useEffect)(()=>{let r=document.getElementById(e);r&&(t?r.classList.remove("is-hidden"):r.classList.add("is-hidden"))},[e,t]),null}var he=o(v(),1);function dt({location:e}){let t=(0,jr.useSelect)(r=>r(w).getMetaBoxesPerLocation(e),[e]);return(0,he.jsxs)(he.Fragment,{children:[(t??[]).map(({id:r})=>(0,he.jsx)(Vr,{id:r},r)),(0,he.jsx)(Ar,{location:e})]})}var je=o(R(),1),ha=o(Je(),1),ya=o(P(),1),va=o(Nr(),1),ba=o(U(),1);var $r=o(Z(),1),Gr=o(ee(),1),zr=o(h(),1),Ur=o(R(),1),qt=o(pe(),1),Wr=o(v(),1);function Ai(){let e=(0,zr.useSelect)(t=>{let{canUser:r}=t(Gr.store),a=(0,qt.addQueryArgs)("edit.php",{post_type:"wp_block"}),s=(0,qt.addQueryArgs)("site-editor.php",{p:"/pattern"});return r("create",{kind:"postType",name:"wp_template"})?s:a},[]);return(0,Wr.jsx)($r.MenuItem,{role:"menuitem",href:e,children:(0,Ur.__)("Manage patterns")})}var Hr=Ai;var qr=o(h(),1),Kr=o(U(),1),Yr=o(R(),1),Xr=o(P(),1),Qr=o(v(),1);function Zr(){let e=(0,qr.useSelect)(t=>t(Xr.store).getCurrentPostType()==="wp_template",[]);return(0,Qr.jsx)(Kr.PreferenceToggleMenuItem,{scope:"core/edit-post",name:e?"welcomeGuideTemplate":"welcomeGuide",label:(0,Yr.__)("Welcome Guide")})}var mt=o(R(),1),ca=o(U(),1),pa=o(P(),1);var la=o(R(),1),da=o(h(),1),fa=o(P(),1),ua=o(U(),1);var Kt=o(O(),1),ft=o(R(),1),Jr=o(Z(),1),ea=o(h(),1),ta=o(P(),1),oa=o(U(),1),ra=o(pe(),1);var te=o(v(),1),{PreferenceBaseOption:Oi}=d(oa.privateApis);function Li(){let e=document.getElementById("toggle-custom-fields-form");e.querySelector('[name="_wp_http_referer"]').setAttribute("value",(0,ra.getPathAndQueryString)(window.location.href)),e.submit()}function Fi({willEnable:e}){let[t,r]=(0,Kt.useState)(!1);return(0,te.jsxs)(te.Fragment,{children:[(0,te.jsx)("p",{className:"edit-post-preferences-modal__custom-fields-confirmation-message",children:(0,ft.__)("A page reload is required for this change. Make sure your content is saved before reloading.")}),(0,te.jsx)(Jr.Button,{__next40pxDefaultSize:!0,variant:"secondary",isBusy:t,accessibleWhenDisabled:!0,disabled:t,onClick:()=>{r(!0),Li()},children:e?(0,ft.__)("Show & Reload Page"):(0,ft.__)("Hide & Reload Page")})]})}function aa({label:e}){let t=(0,ea.useSelect)(s=>!!s(ta.store).getEditorSettings().enableCustomFields,[]),[r,a]=(0,Kt.useState)(t);return(0,te.jsx)(Oi,{label:e,isChecked:r,onChange:a,children:r!==t&&(0,te.jsx)(Fi,{willEnable:r})})}var ut=o(h(),1),Yt=o(P(),1),sa=o(U(),1);var ia=o(v(),1),{PreferenceBaseOption:Vi}=d(sa.privateApis);function na(e){let{toggleEditorPanelEnabled:t}=(0,ut.useDispatch)(Yt.store),{isChecked:r,isRemoved:a}=(0,ut.useSelect)(s=>{let{isEditorPanelEnabled:n,isEditorPanelRemoved:i}=s(Yt.store);return{isChecked:n(e.panelName),isRemoved:i(e.panelName)}},[e.panelName]);return a?null:(0,ia.jsx)(Vi,{isChecked:r,onChange:()=>t(e.panelName),...e})}var Ve=o(v(),1),{PreferencesModalSection:ji}=d(ua.privateApis);function Di({areCustomFieldsRegistered:e,metaBoxes:t,...r}){let a=t.filter(({id:s})=>s!=="postcustom");return!e&&a.length===0?null:(0,Ve.jsxs)(ji,{...r,children:[e&&(0,Ve.jsx)(aa,{label:(0,la.__)("Custom fields")}),a.map(({id:s,title:n})=>(0,Ve.jsx)(na,{label:n,panelName:`meta-box-${s}`},s))]})}var ma=(0,da.withSelect)(e=>{let{getEditorSettings:t}=e(fa.store),{getAllMetaBoxes:r}=e(w);return{areCustomFieldsRegistered:t().enableCustomFields!==void 0,metaBoxes:r()}})(Di);var ct=o(v(),1),{PreferenceToggleControl:Ni}=d(ca.privateApis),{PreferencesModal:$i}=d(pa.privateApis);function ga(){let e={general:(0,ct.jsx)(ma,{title:(0,mt.__)("Advanced")}),appearance:(0,ct.jsx)(Ni,{scope:"core/edit-post",featureName:"themeStyles",help:(0,mt.__)("Make the editor look like your theme."),label:(0,mt.__)("Use theme styles")})};return(0,ct.jsx)($i,{extraSections:e})}var X=o(v(),1),{ToolsMoreMenuGroup:Gi,ViewMoreMenuGroup:zi}=d(ya.privateApis),Ui=()=>{let e=(0,ha.useViewportMatch)("large");return(0,X.jsxs)(X.Fragment,{children:[e&&(0,X.jsx)(zi,{children:(0,X.jsx)(ba.PreferenceToggleMenuItem,{scope:"core/edit-post",name:"fullscreenMode",label:(0,je.__)("Fullscreen mode"),info:(0,je.__)("Show and hide the admin user interface"),messageActivated:(0,je.__)("Fullscreen mode activated."),messageDeactivated:(0,je.__)("Fullscreen mode deactivated."),shortcut:va.displayShortcut.secondary("f")})}),(0,X.jsxs)(Gi,{children:[(0,X.jsx)(Hr,{}),(0,X.jsx)(Zr,{})]}),(0,X.jsx)(ga,{})]})},wa=Ui;var Ma=o(h(),1);var Sa=o(h(),1),pt=o(Z(),1),z=o(R(),1),Xt=o(O(),1);var De=o(v(),1);function ye({nonAnimatedSrc:e,animatedSrc:t}){return(0,De.jsxs)("picture",{className:"edit-post-welcome-guide__image",children:[(0,De.jsx)("source",{srcSet:e,media:"(prefers-reduced-motion: reduce)"}),(0,De.jsx)("img",{src:t,width:"312",height:"240",alt:""})]})}var b=o(v(),1);function xa(){let{toggleFeature:e}=(0,Sa.useDispatch)(w);return(0,b.jsx)(pt.Guide,{className:"edit-post-welcome-guide",contentLabel:(0,z.__)("Welcome to the editor"),finishButtonText:(0,z.__)("Get started"),onFinish:()=>e("welcomeGuide"),pages:[{image:(0,b.jsx)(ye,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-canvas.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-canvas.gif"}),content:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("h1",{className:"edit-post-welcome-guide__heading",children:(0,z.__)("Welcome to the editor")}),(0,b.jsx)("p",{className:"edit-post-welcome-guide__text",children:(0,z.__)("In the WordPress editor, each paragraph, image, or video is presented as a distinct \u201Cblock\u201D of content.")})]})},{image:(0,b.jsx)(ye,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-editor.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-editor.gif"}),content:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("h1",{className:"edit-post-welcome-guide__heading",children:(0,z.__)("Customize each block")}),(0,b.jsx)("p",{className:"edit-post-welcome-guide__text",children:(0,z.__)("Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected.")})]})},{image:(0,b.jsx)(ye,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-library.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-library.gif"}),content:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("h1",{className:"edit-post-welcome-guide__heading",children:(0,z.__)("Explore all blocks")}),(0,b.jsx)("p",{className:"edit-post-welcome-guide__text",children:(0,Xt.createInterpolateElement)((0,z.__)("All of the blocks available to you live in the block library. You\u2019ll find it wherever you see the <InserterIconImage /> icon."),{InserterIconImage:(0,b.jsx)("img",{alt:(0,z.__)("inserter"),src:"data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='18' height='18' rx='2' fill='%231E1E1E'/%3E%3Cpath d='M9.22727 4V14M4 8.77273H14' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E%0A"})})})]})},{image:(0,b.jsx)(ye,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.gif"}),content:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("h1",{className:"edit-post-welcome-guide__heading",children:(0,z.__)("Learn more")}),(0,b.jsx)("p",{className:"edit-post-welcome-guide__text",children:(0,Xt.createInterpolateElement)((0,z.__)("New to the block editor? Want to learn more about using it? <a>Here's a detailed guide.</a>"),{a:(0,b.jsx)(pt.ExternalLink,{href:(0,z.__)("https://wordpress.org/documentation/article/wordpress-block-editor/")})})})]})}]})}var Ea=o(h(),1),_a=o(Z(),1),Ne=o(R(),1);var oe=o(v(),1);function Pa(){let{toggleFeature:e}=(0,Ea.useDispatch)(w);return(0,oe.jsx)(_a.Guide,{className:"edit-template-welcome-guide",contentLabel:(0,Ne.__)("Welcome to the template editor"),finishButtonText:(0,Ne.__)("Get started"),onFinish:()=>e("welcomeGuideTemplate"),pages:[{image:(0,oe.jsx)(ye,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-template-editor.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-template-editor.gif"}),content:(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)("h1",{className:"edit-post-welcome-guide__heading",children:(0,Ne.__)("Welcome to the template editor")}),(0,oe.jsx)("p",{className:"edit-post-welcome-guide__text",children:(0,Ne.__)("Templates help define the layout of the site. You can customize all aspects of your posts and pages using blocks and patterns in this editor.")})]})}]})}var Qt=o(v(),1);function ka({postType:e}){let{isActive:t,isEditingTemplate:r}=(0,Ma.useSelect)(a=>{let{isFeatureActive:s}=a(w),n=e==="wp_template";return{isActive:s(n?"welcomeGuideTemplate":"welcomeGuide"),isEditingTemplate:n}},[e]);return t?r?(0,Qt.jsx)(Pa,{}):(0,Qt.jsx)(xa,{}):null}var $e=o(h(),1),ke=o(R(),1);var Ta=o(Vt(),1),Zt=o(U(),1),Ia=o(et(),1);function Ba(){let{isFullscreen:e}=(0,$e.useSelect)(a=>{let{get:s}=a(Zt.store);return{isFullscreen:s("core/edit-post","fullscreenMode")}},[]),{toggle:t}=(0,$e.useDispatch)(Zt.store),{createInfoNotice:r}=(0,$e.useDispatch)(Ia.store);(0,Ta.useCommand)({name:"core/toggle-fullscreen-mode",label:e?(0,ke.__)("Exit fullscreen"):(0,ke.__)("Enter fullscreen"),icon:Bt,category:"command",callback:({close:a})=>{t("core/edit-post","fullscreenMode"),a(),r(e?(0,ke.__)("Fullscreen off."):(0,ke.__)("Fullscreen on."),{id:"core/edit-post/toggle-fullscreen-mode/notice",type:"snackbar",actions:[{label:(0,ke.__)("Undo"),onClick:()=>{t("core/edit-post","fullscreenMode")}}]})}})}var Ca=o(P(),1),Ra=o(h(),1),Aa=o(qe(),1),Jt=o(At(),1);var Wi=!1;function Oa(){return(0,Ra.useSelect)(e=>{let{getCurrentPostType:t,getDeviceType:r}=e(Ca.store),{getClientIdsWithDescendants:a,getBlockName:s}=e(Jt.store),{getBlockType:n}=e(Aa.store);return Wi||r()!=="Desktop"||["wp_template","wp_block"].includes(t())||d(e(Jt.store)).isZoomOut()||[...new Set(a().map(s))].map(n).filter(Boolean).every(i=>i.apiVersion>=3)},[])}var Ge=o(O(),1),ve=o(h(),1),eo=o(P(),1),to=o(ee(),1);function La(e,t,r){let a=(0,ve.useRegistry)(),[s,n]=(0,Ge.useReducer)((u,{type:S,post:V,previousRenderingMode:ie,selectedBlockClientId:ne})=>{if(S==="push"){let Y=[...u],ce=Y.length-1;return Y[ce]={...Y[ce],selectedBlockClientId:ne},[...Y,{post:V,previousRenderingMode:ie}]}return S==="pop"&&u.length>1?u.slice(0,-1):u},[{post:{postId:e,postType:t}}]),{post:i,previousRenderingMode:l}=s[s.length-1],{getRenderingMode:c}=(0,ve.useSelect)(eo.store),{setRenderingMode:g}=(0,ve.useDispatch)(eo.store),{editEntityRecord:m}=(0,ve.useDispatch)(to.store),p=(0,Ge.useCallback)(u=>{let V=a.select(to.store).getEntityRecordEdits("postType",i.postType,i.postId)?.selection?.selectionStart?.clientId??null;n({type:"push",post:{postId:u.postId,postType:u.postType},previousRenderingMode:c(),selectedBlockClientId:V}),g(r)},[a,i.postType,i.postId,c,g,r]),_=(0,Ge.useCallback)(()=>{if(s.length>1){let u=s[s.length-2];u.selectedBlockClientId&&m("postType",u.post.postType,u.post.postId,{selection:{selectionStart:{clientId:u.selectedBlockClientId},selectionEnd:{clientId:u.selectedBlockClientId}}},{undoIgnore:!0})}n({type:"pop"}),l&&g(l)},[g,l,s,m]);return{currentPost:i,onNavigateToEntityRecord:p,onNavigateToPreviousEntityRecord:s.length>1?_:void 0}}var Te=o(h(),1),oo=o(P(),1),Fa=o(ee(),1),Va=o(O(),1);var ja=e=>{let{isEnabledAndEditorReady:t,isCollaborationEnabled:r,hasIncompatibleMetaBoxes:a,hasActiveMetaBoxes:s}=(0,Te.useSelect)(c=>{let{__unstableIsEditorReady:g,isCollaborationEnabledForCurrentPost:m}=d(c(oo.store));return{isEnabledAndEditorReady:e&&g(),isCollaborationEnabled:m(),hasIncompatibleMetaBoxes:e?c(w).getAllMetaBoxes().some(p=>!p.__rtc_compatible):!1,hasActiveMetaBoxes:e&&c(w).hasMetaBoxes()}},[e]),{setCollaborationSupported:n}=d((0,Te.useDispatch)(Fa.store)),{updateEditorSettings:i}=(0,Te.useDispatch)(oo.store),{initializeMetaBoxes:l}=(0,Te.useDispatch)(w);(0,Va.useEffect)(()=>{t&&(l(),r&&a&&n(!1),s&&i({disableVisualRevisions:!0}))},[t,l,r,n,a,s,i])};var f=o(v(),1),{useCommandContext:Hi}=d($a.privateApis),{useDrag:qi}=d(K.privateApis),{Editor:Ki,FullscreenMode:Yi}=d(B.privateApis),{BlockKeyboardShortcuts:Xi}=d(Ga.privateApis),Qi=["wp_template","wp_template_part","wp_block","wp_navigation"];function Zi(e){let{hasThemeStyleSupport:t}=(0,fe.useSelect)(r=>({hasThemeStyleSupport:r(w).isFeatureActive("themeStyles")}),[]);return(0,F.useMemo)(()=>{let r=e.styles?.filter(n=>n.__unstableType&&n.__unstableType!=="theme")??[],a=[...e?.defaultEditorStyles??[],...r],s=t&&r.length!==(e.styles?.length??0);return!e.disableLayoutStyles&&!s&&a.push({css:Ft({style:{},selector:"body",hasBlockGapSupport:!1,hasFallbackGapSupport:!0,fallbackGapValue:"0.5em"})}),s?e.styles??[]:a},[e.defaultEditorStyles,e.disableLayoutStyles,e.styles,t])}function Ji({isLegacy:e}){let[t,r,a]=(0,fe.useSelect)(E=>{let{get:T}=E(gt.store),{isMetaBoxLocationVisible:A}=E(w);return[!!T("core/edit-post","metaBoxesMainIsOpen"),T("core/edit-post","metaBoxesMainOpenHeight"),A("normal")||A("advanced")||A("side")]},[]),{set:s}=(0,fe.useDispatch)(gt.store),n=(0,ue.useMediaQuery)("(max-height: 549px)"),[{min:i=0,max:l},c]=(0,F.useState)(()=>({})),g=(0,ue.useRefEffect)(E=>{let T=E.closest(".interface-interface-skeleton__content");if(!T)return;let A=T.querySelectorAll(":scope > .components-notice-list"),Se=T.querySelector(".edit-post-meta-boxes-main__presenter"),xe=()=>{let D=T.offsetHeight;for(let N of A)D-=N.offsetHeight;let le=Se.offsetHeight;c({min:le,max:D})},C=new window.ResizeObserver(xe);C.observe(T);for(let j of A)C.observe(j);return()=>C.disconnect()},[]),m=(0,F.useRef)(),p=(0,ue.useMergeRefs)([m,g]),_=(0,F.useRef)(),u=(0,F.useId)(),S=(0,F.useRef)(),V=(E="auto",T)=>{let A;E==="auto"?(T=!1,A=E):(E=Math.min(l,Math.max(i,E)),S.current=E,A=`${E}px`),T?s("core/edit-post","metaBoxesMainOpenHeight",E):(m.current.style.height=A,n||(_.current.ariaValueNow=Ue(E)))},ie=qi(({movement:E,first:T,last:A,memo:Se,tap:xe,args:C})=>{let j=m.current,[,D]=E;if(T){j.classList.add("is-resizing");let N=S.current??j.offsetHeight;return t?N>l&&(N=l):N=i,V(N-D),{fromHeight:N}}if(!T&&!A&&!xe)return V(Se.fromHeight-D),Se;if(j.classList.remove("is-resizing"),xe){let[N]=C;N?.();return}let le=S.current>i;we(le),V(S.current,le)},{keyboardDisplacement:20,filterTaps:!0});if(!a)return;let ne=(0,f.jsxs)("div",{className:"edit-post-layout__metaboxes edit-post-meta-boxes-main__liner",hidden:!e&&!t,children:[(0,f.jsx)(dt,{location:"normal"}),(0,f.jsx)(dt,{location:"advanced"})]});if(e)return ne;let Y=r===void 0,be=t?n?"auto":r:i,Ue=E=>Math.round((E-i)/(l-i)*100),io=l===void 0||Y?50:Ue(be),we=(E=!t)=>s("core/edit-post","metaBoxesMainIsOpen",E),We=(0,q.__)("Meta Boxes"),Be=(0,f.jsxs)("button",{"aria-expanded":t,onClick:({detail:E})=>{(n||!E)&&we()},...!n&&ie(we),children:[We,(0,f.jsx)(K.Icon,{icon:t?Tt:Mt})]}),bt=!n&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(K.Tooltip,{text:(0,q.__)("Drag to resize"),children:(0,f.jsx)("button",{ref:_,role:"separator","aria-valuenow":io,"aria-label":(0,q.__)("Drag to resize"),"aria-describedby":u,...ie()})}),(0,f.jsx)(K.VisuallyHidden,{id:u,children:(0,q.__)("Use up and down arrow keys to resize the meta box pane.")})]});return(0,f.jsxs)(xt,{"aria-label":We,ref:p,className:Q("edit-post-meta-boxes-main",!n&&"is-resizable"),style:{height:be},children:[(0,f.jsxs)("div",{className:"edit-post-meta-boxes-main__presenter",children:[Be,bt]}),ne]})}function en({postId:e,postType:t,settings:r,initialEdits:a}){Ba();let s=Oa(),{createErrorNotice:n}=(0,fe.useDispatch)(ze.store),{currentPost:{postId:i,postType:l},onNavigateToEntityRecord:c,onNavigateToPreviousEntityRecord:g}=La(e,t,"post-only"),m=l==="wp_template",{mode:p,isFullscreenActive:_,hasResolvedMode:u,hasActiveMetaboxes:S,hasBlockSelected:V,showIconLabels:ie,isDistractionFree:ne,showMetaBoxes:Y,isWelcomeGuideVisible:ce,templateId:be,isDevicePreview:Ue}=(0,fe.useSelect)(C=>{let{get:j}=C(gt.store),{isFeatureActive:D,hasMetaBoxes:le}=C(w),{canUser:N,getPostType:Xa,getTemplateId:Qa}=d(C(Ua.store)),Za=r.supportsTemplateMode,Ja=Xa(l)?.viewable??!1,es=N("read",{kind:"postType",name:"wp_template"}),{getBlockSelectionStart:ts,isZoomOut:os}=d(C(Da.store)),{getEditorMode:rs,getDefaultRenderingMode:as,getDeviceType:ss}=d(C(B.store)),is=!Qi.includes(l),ns=l==="wp_block"&&!g,no=Qa(l,i),lo=as(l);return{mode:rs(),isFullscreenActive:D("fullscreenMode"),hasActiveMetaboxes:le(),hasResolvedMode:lo==="template-locked"?!!no:lo!==void 0,hasBlockSelected:!!ts(),showIconLabels:j("core","showIconLabels"),isDistractionFree:j("core","distractionFree"),showMetaBoxes:is&&!os()||ns,isWelcomeGuideVisible:D("welcomeGuide"),templateId:Za&&Ja&&es&&!m?no:null,isDevicePreview:ss()!=="Desktop"}},[l,i,m,r.supportsTemplateMode,g]);ja(S&&u),Hi(V?"block-selection-edit":"entity-edit");let we=Zi(r),We=(0,F.useMemo)(()=>({...r,styles:we,onNavigateToEntityRecord:c,onNavigateToPreviousEntityRecord:g,defaultRenderingMode:"post-only"}),[r,we,c,g]);ie?document.body.classList.add("show-icon-labels"):document.body.classList.remove("show-icon-labels");let Be=(0,K.__unstableUseNavigateRegions)(),bt=Q("edit-post-layout","is-mode-"+p,{"has-metaboxes":S});function E(C){n((0,q.sprintf)((0,q.__)('The "%s" plugin has encountered an error and cannot be rendered.'),C))}let{createSuccessNotice:T}=(0,fe.useDispatch)(ze.store),A=(0,F.useCallback)((C,j)=>{switch(C){case"move-to-trash":document.location.href=(0,ro.addQueryArgs)("edit.php",{trashed:1,post_type:j[0].type,ids:j[0].id});break;case"duplicate-post":{let D=j[0],le=typeof D.title=="string"?D.title:D.title?.rendered;T((0,q.sprintf)((0,q.__)('"%s" successfully created.'),(0,za.decodeEntities)(le)||(0,q.__)("(no title)")),{type:"snackbar",id:"duplicate-post-action",actions:[{label:(0,q.__)("Edit"),onClick:()=>{let N=D.id;document.location.href=(0,ro.addQueryArgs)("post.php",{post:N,action:"edit"})}}]})}break}},[T]),Se=(0,F.useMemo)(()=>({type:t,id:e}),[t,e]),xe=(0,ue.useViewportMatch)("medium")&&_?(0,f.jsx)(Jo,{initialPost:Se}):null;return(0,f.jsx)(K.SlotFillProvider,{children:(0,f.jsxs)(B.ErrorBoundary,{canCopyContent:!0,children:[(0,f.jsx)(ka,{postType:l}),(0,f.jsx)("div",{className:Be.className,...Be,ref:Be.ref,children:(0,f.jsxs)(Ki,{settings:We,initialEdits:a,postType:l,postId:i,templateId:be,className:bt,forceIsDirty:S,disableIframe:!s,autoFocus:!ce,onActionPerformed:A,extraSidebarPanels:Y&&(0,f.jsx)(dt,{location:"side"}),extraContent:!ne&&Y&&(0,f.jsx)(Ji,{isLegacy:Ue}),children:[(0,f.jsx)(B.PostLockedModal,{}),(0,f.jsx)(nr,{}),(0,f.jsx)(Yi,{isActive:_}),(0,f.jsx)(Br,{}),(0,f.jsx)(B.UnsavedChangesWarning,{}),(0,f.jsx)(B.AutosaveMonitor,{}),(0,f.jsx)(B.LocalAutosaveMonitor,{}),(0,f.jsx)(Pr,{}),(0,f.jsx)(B.EditorKeyboardShortcutsRegister,{}),(0,f.jsx)(Xi,{}),l==="wp_block"&&(0,f.jsx)(Mr,{}),(0,f.jsx)(Na.PluginArea,{onError:E}),(0,f.jsx)(wa,{}),xe,(0,f.jsx)(ze.SnackbarNotices,{className:"edit-post-layout__snackbar"})]})})]})})}var Wa=en;var k=o(P(),1),Ha=o(pe(),1),ao=o(Ce(),1);var re=o(v(),1),{PluginPostExcerpt:tn}=d(k.privateApis),ae=(0,Ha.getPath)(window.location.href)?.includes("site-editor.php"),me=e=>{(0,ao.default)(`wp.editPost.${e}`,{since:"6.6",alternative:`wp.editor.${e}`})};function on(e){return ae?null:(me("PluginBlockSettingsMenuItem"),(0,re.jsx)(k.PluginBlockSettingsMenuItem,{...e}))}function rn(e){return ae?null:(me("PluginDocumentSettingPanel"),(0,re.jsx)(k.PluginDocumentSettingPanel,{...e}))}function an(e){return ae?null:(me("PluginMoreMenuItem"),(0,re.jsx)(k.PluginMoreMenuItem,{...e}))}function sn(e){return ae?null:(me("PluginPrePublishPanel"),(0,re.jsx)(k.PluginPrePublishPanel,{...e}))}function nn(e){return ae?null:(me("PluginPostPublishPanel"),(0,re.jsx)(k.PluginPostPublishPanel,{...e}))}function ln(e){return ae?null:(me("PluginPostStatusInfo"),(0,re.jsx)(k.PluginPostStatusInfo,{...e}))}function dn(e){return ae?null:(me("PluginSidebar"),(0,re.jsx)(k.PluginSidebar,{...e}))}function fn(e){return ae?null:(me("PluginSidebarMoreMenuItem"),(0,re.jsx)(k.PluginSidebarMoreMenuItem,{...e}))}function un(){return ae?null:((0,ao.default)("wp.editPost.__experimentalPluginPostExcerpt",{since:"6.6",hint:"Core and custom panels can be access programmatically using their panel name.",link:"https://developer.wordpress.org/block-editor/reference-guides/slotfills/plugin-document-setting-panel/#accessing-a-panel-programmatically"}),tn)}var so=o(v(),1),{BackButton:mn,registerCoreBlockBindingsSources:cn}=d(vt.privateApis);function pn(e,t,r,a,s){let n=window.matchMedia("(min-width: 782px)").matches,i=document.getElementById(e),l=(0,ht.createRoot)(i);return(0,se.dispatch)(Ie.store).setDefaults("core/edit-post",{fullscreenMode:!0,themeStyles:!0,welcomeGuide:!0,welcomeGuideTemplate:!0}),(0,se.dispatch)(Ie.store).setDefaults("core",{allowRightClickOverrides:!0,editorMode:"visual",editorTool:"edit",fixedToolbar:!1,hiddenBlockTypes:[],inactivePanels:[],openPanels:["post-status"],showBlockBreadcrumbs:!0,showIconLabels:!1,showListViewByDefault:!1,enableChoosePatternModal:!0,isPublishSidebarEnabled:!0,showCollaborationCursor:!1,showCollaborationNotifications:!0}),window.__clientSideMediaProcessing&&(0,se.dispatch)(Ie.store).setDefaults("core/media",{requireApproval:!0,optimizeOnUpload:!0}),(0,se.dispatch)(qa.store).reapplyBlockTypeFilters(),n&&(0,se.select)(Ie.store).get("core","showListViewByDefault")&&!(0,se.select)(Ie.store).get("core","distractionFree")&&(0,se.dispatch)(vt.store).setIsListViewOpened(!0),(0,Ka.registerCoreBlocks)(),cn(),(0,yt.registerLegacyWidgetBlock)({inserter:!1}),(0,yt.registerWidgetGroupBlock)({inserter:!1}),(document.compatMode==="CSS1Compat"?"Standards":"Quirks")!=="Standards"&&console.warn(`Your browser is using Quirks Mode. This can cause rendering issues such as blocks overlaying meta boxes in the editor. Quirks Mode can be triggered by PHP errors or HTML code appearing before the opening <!DOCTYPE html>. Try checking the raw page source or your site's PHP error log and resolving errors there, removing any HTML before the doctype, or disabling plugins.`),window.navigator.userAgent.indexOf("iPhone")!==-1&&window.addEventListener("scroll",m=>{let p=document.getElementsByClassName("interface-interface-skeleton__body")[0];m.target===document&&(window.scrollY>100&&(p.scrollTop=p.scrollTop+window.scrollY),document.getElementsByClassName("is-mode-visual")[0]&&window.scrollTo(0,0))}),window.addEventListener("dragover",m=>m.preventDefault(),!1),window.addEventListener("drop",m=>m.preventDefault(),!1),l.render((0,so.jsx)(ht.StrictMode,{children:(0,so.jsx)(Wa,{settings:a,postId:r,postType:t,initialEdits:s})})),l}function gn(){(0,Ya.default)("wp.editPost.reinitializeEditor",{since:"6.2",version:"6.3"})}return cs(hn);})(); list-reusable-blocks.min.js 0000644 00000012324 15206720414 0011715 0 ustar 00 var wp;(wp||={}).listReusableBlocks=(()=>{var ie=Object.create;var F=Object.defineProperty;var ae=Object.getOwnPropertyDescriptor;var se=Object.getOwnPropertyNames;var ce=Object.getPrototypeOf,ue=Object.prototype.hasOwnProperty;var u=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var le=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of se(e))!ue.call(r,o)&&o!==t&&F(r,o,{get:()=>e[o],enumerable:!(n=ae(e,o))||n.enumerable});return r};var i=(r,e,t)=>(t=r!=null?ie(ce(r)):{},le(e||!r||!r.__esModule?F(t,"default",{value:r,enumerable:!0}):t,r));var T=u((be,L)=>{L.exports=window.wp.element});var h=u((he,k)=>{k.exports=window.wp.i18n});var C=u((Ie,z)=>{z.exports=window.wp.apiFetch});var Z=u((Re,G)=>{G.exports=window.wp.blob});var R=u((Ae,V)=>{V.exports=window.wp.compose});var D=u((Fe,H)=>{H.exports=window.wp.components});var v=u((Je,Q)=>{Q.exports=window.ReactJSXRuntime});var S=i(T(),1),oe=i(h(),1);var m=function(){return m=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},m.apply(this,arguments)};function B(r){return r.toLowerCase()}var fe=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],pe=/[^A-Z0-9]+/gi;function M(r,e){e===void 0&&(e={});for(var t=e.splitRegexp,n=t===void 0?fe:t,o=e.stripRegexp,a=o===void 0?pe:o,s=e.transform,c=s===void 0?B:s,p=e.delimiter,j=p===void 0?" ":p,d=J(J(r,n,"$1\0$2"),a,"\0"),w=0,_=d.length;d.charAt(w)==="\0";)w++;for(;d.charAt(_-1)==="\0";)_--;return d.slice(w,_).split("\0").map(c).join(j)}function J(r,e,t){return e instanceof RegExp?r.replace(e,t):e.reduce(function(n,o){return n.replace(o,t)},r)}function $(r,e){return e===void 0&&(e={}),M(r,m({delimiter:"."},e))}function U(r,e){return e===void 0&&(e={}),$(r,m({delimiter:"-"},e))}var I=i(C(),1),q=i(Z(),1);async function de(r){let e=await(0,I.default)({path:"/wp/v2/types/wp_block"}),t=await(0,I.default)({path:`/wp/v2/${e.rest_base}/${r}?context=edit`}),n=t.title.raw,o=t.content.raw,a=t.wp_pattern_sync_status,s=JSON.stringify({__file:"wp_block",title:n,content:o,syncStatus:a},null,2),c=U(n)+".json";(0,q.downloadBlob)(c,s,"application/json")}var X=de;var te=i(R(),1),re=i(h(),1),O=i(D(),1);var y=i(T(),1),Y=i(R(),1),l=i(h(),1),g=i(D(),1);var N=i(C(),1);function K(r){let e=new window.FileReader;return new Promise(t=>{e.onload=()=>{t(e.result)},e.readAsText(r)})}async function me(r){let e=await K(r),t;try{t=JSON.parse(e)}catch{throw new Error("Invalid JSON file")}if(t.__file!=="wp_block"||!t.title||!t.content||typeof t.title!="string"||typeof t.content!="string"||t.syncStatus&&typeof t.syncStatus!="string")throw new Error("Invalid pattern JSON file");let n=await(0,N.default)({path:"/wp/v2/types/wp_block"});return await(0,N.default)({path:`/wp/v2/${n.rest_base}`,data:{title:t.title,content:t.content,status:"publish",meta:t.syncStatus==="unsynced"?{wp_pattern_sync_status:t.syncStatus}:void 0},method:"POST"})}var W=me;var f=i(v(),1);function ye({instanceId:r,onUpload:e}){let t="list-reusable-blocks-import-form-"+r,n=(0,y.useRef)(),[o,a]=(0,y.useState)(!1),[s,c]=(0,y.useState)(null),[p,j]=(0,y.useState)(null),d=E=>{j(E.target.files[0]),c(null)},w=E=>{E.preventDefault(),p&&(a({isLoading:!0}),W(p).then(P=>{n&&(a(!1),e(P))}).catch(P=>{if(!n)return;let b;switch(P.message){case"Invalid JSON file":b=(0,l.__)("Invalid JSON file");break;case"Invalid pattern JSON file":b=(0,l.__)("Invalid pattern JSON file");break;default:b=(0,l.__)("Unknown error")}a(!1),c(b)}))},_=()=>{c(null)};return(0,f.jsxs)("form",{className:"list-reusable-blocks-import-form",onSubmit:w,ref:n,children:[s&&(0,f.jsx)(g.Notice,{status:"error",onRemove:()=>_(),children:s}),(0,f.jsx)("label",{htmlFor:t,className:"list-reusable-blocks-import-form__label",children:(0,l.__)("File")}),(0,f.jsx)("input",{id:t,type:"file",onChange:d}),(0,f.jsx)(g.Button,{__next40pxDefaultSize:!0,type:"submit",isBusy:o,accessibleWhenDisabled:!0,disabled:!p||o,variant:"secondary",className:"list-reusable-blocks-import-form__button",children:(0,l._x)("Import","button label")})]})}var ee=(0,Y.withInstanceId)(ye);var x=i(v(),1);function we({onUpload:r}){return(0,x.jsx)(O.Dropdown,{popoverProps:{placement:"bottom-start"},contentClassName:"list-reusable-blocks-import-dropdown__content",renderToggle:({isOpen:e,onToggle:t})=>(0,x.jsx)(O.Button,{size:"compact",className:"list-reusable-blocks-import-dropdown__button","aria-expanded":e,onClick:t,variant:"primary",children:(0,re.__)("Import from JSON")}),renderContent:({onClose:e})=>(0,x.jsx)(ee,{onUpload:(0,te.pipe)(e,r)})})}var ne=we;var A=i(v(),1);document.body.addEventListener("click",r=>{r.target.classList.contains("wp-list-reusable-blocks__export")&&(r.preventDefault(),X(r.target.dataset.id))});document.addEventListener("DOMContentLoaded",()=>{let r=document.querySelector(".page-title-action");if(!r)return;let e=()=>{let n=document.createElement("div");n.className="notice notice-success is-dismissible",n.innerHTML=`<p>${(0,oe.__)("Pattern imported successfully!")}</p>`;let o=document.querySelector(".wp-header-end");o&&o.parentNode.insertBefore(n,o)},t=document.createElement("div");t.className="list-reusable-blocks__container",r.parentNode.insertBefore(t,r),(0,S.createRoot)(t).render((0,A.jsx)(S.StrictMode,{children:(0,A.jsx)(ne,{onUpload:e})}))});})(); dom-ready.js 0000644 00000002744 15206720414 0006773 0 ustar 00 "use strict"; var wp; (wp ||= {}).domReady = (() => { var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; 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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // packages/dom-ready/build-module/index.mjs var index_exports = {}; __export(index_exports, { default: () => domReady }); function domReady(callback) { if (typeof document === "undefined") { return; } if (document.readyState === "complete" || // DOMContentLoaded + Images/Styles/etc loaded, so we call directly. document.readyState === "interactive") { return void callback(); } document.addEventListener("DOMContentLoaded", callback); } return __toCommonJS(index_exports); })(); if (typeof wp.domReady === 'object' && wp.domReady.default) { wp.domReady = wp.domReady.default; } core-data.min.js 0000644 00000644671 15206720414 0007546 0 ustar 00 "use strict";var wp;(wp||={}).coreData=(()=>{var Nh=Object.create;var Bn=Object.defineProperty;var Vh=Object.getOwnPropertyDescriptor;var Bh=Object.getOwnPropertyNames;var jh=Object.getPrototypeOf,Fh=Object.prototype.hasOwnProperty;var z=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),bt=(t,e)=>{for(var r in e)Bn(t,r,{get:e[r],enumerable:!0})},Hc=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Bh(e))!Fh.call(t,o)&&o!==r&&Bn(t,o,{get:()=>e[o],enumerable:!(n=Vh(e,o))||n.enumerable});return t};var w=(t,e,r)=>(r=t!=null?Nh(jh(t)):{},Hc(e||!t||!t.__esModule?Bn(r,"default",{value:t,enumerable:!0}):r,t)),Yh=t=>Hc(Bn({},"__esModule",{value:!0}),t);var W=z((m_,qc)=>{qc.exports=window.wp.data});var Qe=z((y_,Wc)=>{"use strict";Wc.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,o,s;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(o=n;o--!==0;)if(!t(e[o],r[o]))return!1;return!0}if(e instanceof Map&&r instanceof Map){if(e.size!==r.size)return!1;for(o of e.entries())if(!r.has(o[0]))return!1;for(o of e.entries())if(!t(o[1],r.get(o[0])))return!1;return!0}if(e instanceof Set&&r instanceof Set){if(e.size!==r.size)return!1;for(o of e.entries())if(!r.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(r)){if(n=e.length,n!=r.length)return!1;for(o=n;o--!==0;)if(e[o]!==r[o])return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(r).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[o]))return!1;for(o=n;o--!==0;){var i=s[o];if(!t(e[i],r[i]))return!1}return!0}return e!==e&&r!==r}});var jn=z((E_,Jc)=>{Jc.exports=window.wp.compose});var Xc=z((w_,Qc)=>{Qc.exports=window.wp.undoManager});var sa=z((q_,oa)=>{"use strict";function Tt(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Tt=function(e){return typeof e}:Tt=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Tt(t)}function Wh(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ra(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Jh(t,e,r){return e&&ra(t.prototype,e),r&&ra(t,r),t}function na(t,e){var r=t._map,n=t._arrayTreeMap,o=t._objectTreeMap;if(r.has(e))return r.get(e);for(var s=Object.keys(e).sort(),i=Array.isArray(e)?n:o,c=0;c<s.length;c++){var a=s[c];if(i=i.get(a),i===void 0)return;var u=e[a];if(i=i.get(u),i===void 0)return}var l=i.get("_ekm_value");if(l)return r.delete(l[0]),l[0]=e,i.set("_ekm_value",l),r.set(e,l),l}var Qh=(function(){function t(e){if(Wh(this,t),this.clear(),e instanceof t){var r=[];e.forEach(function(o,s){r.push([s,o])}),e=r}if(e!=null)for(var n=0;n<e.length;n++)this.set(e[n][0],e[n][1])}return Jh(t,[{key:"set",value:function(r,n){if(r===null||Tt(r)!=="object")return this._map.set(r,n),this;for(var o=Object.keys(r).sort(),s=[r,n],i=Array.isArray(r)?this._arrayTreeMap:this._objectTreeMap,c=0;c<o.length;c++){var a=o[c];i.has(a)||i.set(a,new t),i=i.get(a);var u=r[a];i.has(u)||i.set(u,new t),i=i.get(u)}var l=i.get("_ekm_value");return l&&this._map.delete(l[0]),i.set("_ekm_value",s),this._map.set(r,s),this}},{key:"get",value:function(r){if(r===null||Tt(r)!=="object")return this._map.get(r);var n=na(this,r);if(n)return n[1]}},{key:"has",value:function(r){return r===null||Tt(r)!=="object"?this._map.has(r):na(this,r)!==void 0}},{key:"delete",value:function(r){return this.has(r)?(this.set(r,void 0),!0):!1}},{key:"forEach",value:function(r){var n=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this;this._map.forEach(function(s,i){i!==null&&Tt(i)==="object"&&(s=s[1]),r.call(o,s,i,n)})}},{key:"clear",value:function(){this._map=new Map,this._arrayTreeMap=new Map,this._objectTreeMap=new Map}},{key:"size",get:function(){return this._map.size}}]),t})();oa.exports=Qh});var Ze=z((W_,ia)=>{ia.exports=window.wp.url});var Ae=z((yS,ma)=>{ma.exports=window.wp.apiFetch});var nr=z((ES,ya)=>{ya.exports=window.wp.blocks});var _s=z((wS,Ea)=>{Ea.exports=window.wp.i18n});var Ai=z((ob,pu)=>{pu.exports=window.wp.privateApis});var Co=z((ab,_u)=>{_u.exports=window.wp.hooks});var Ar=z((gv,ed)=>{ed.exports=window.wp.blockEditor});var bn=z((Nv,gd)=>{gd.exports=window.wp.richText});var er=z((XC,pf)=>{pf.exports=window.wp.deprecated});var kc=z((xR,Of)=>{Of.exports=window.wp.htmlEntities});var We=z((XR,Qf)=>{Qf.exports=window.wp.element});var eh=z((eT,Zf)=>{Zf.exports=window.ReactJSXRuntime});var gh=z((ET,ph)=>{ph.exports=window.wp.warning});var p_={};bt(p_,{EntityProvider:()=>rh,__experimentalFetchLinkSuggestions:()=>Lf,__experimentalFetchUrlData:()=>Mf,__experimentalUseEntityRecord:()=>lh,__experimentalUseEntityRecords:()=>fh,__experimentalUseResourcePermissions:()=>_h,fetchBlockPatterns:()=>Uc,privateApis:()=>Lh,store:()=>q,useEntityBlockEditor:()=>Th,useEntityId:()=>Nr,useEntityProp:()=>xh,useEntityRecord:()=>Nc,useEntityRecords:()=>ss,useResourcePermissions:()=>wh});var ds=w(W(),1);var gc=w(Qe(),1),df=w(jn(),1),In=w(W(),1),ff=w(Xc(),1);var Zc=w(Qe(),1);function fs(t,e){if(!t)return e;let r=!1,n={};for(let o in e)(0,Zc.default)(t[o],e[o])?n[o]=t[o]:(r=!0,n[o]=e[o]);if(!r)return t;for(let o in t)n.hasOwnProperty(o)||(n[o]=t[o]);return n}function Gh(t){return typeof t=="string"?t.split(","):Array.isArray(t)?t:null}var ie=Gh;var $h=t=>e=>(r,n)=>r===void 0||t(n)?e(r,n):r,Br=$h;var zh=t=>(...e)=>async({resolveSelect:r})=>{await r[t](...e)},vt=zh;var Kh=t=>e=>(r={},n)=>{let o=n[t];if(o===void 0)return r;let s=e(r[o],n);return s===r[o]?r:{...r,[o]:s}},Fn=Kh;var Hh=t=>e=>(r,n)=>e(r,t(n)),jr=Hh;function qh(t){let e=new WeakMap;return r=>{let n;return e.has(r)?n=e.get(r):(n=t(r),r!==null&&typeof r=="object"&&e.set(r,n)),n}}var hs=qh;function ps(t,e){return(t.rawAttributes||[]).includes(e)}function Xe(t,e,r){if(!t||typeof t!="object")return t;let n=Array.isArray(e)?e:e.split(".");return n.reduce((o,s,i)=>(o[s]===void 0&&(Number.isInteger(n[i+1])?o[s]=[]:o[s]={}),i===n.length-1&&(o[s]=r),o[s]),t),t}function gs(t,e,r){if(!t||typeof t!="object"||typeof e!="string"&&!Array.isArray(e))return t;let n=Array.isArray(e)?e:e.split("."),o=t;return n.forEach(s=>{o=o?.[s]}),o!==void 0?o:r}function Fr(t){return/^\s*\d+\s*$/.test(t)}var Ct=["create","read","update","delete"];function Yr(t){let e={};if(!t)return e;let r={create:"POST",read:"GET",update:"PUT",delete:"DELETE"};for(let[n,o]of Object.entries(r))e[n]=t.includes(o);return e}function Rt(t,e,r){return(typeof e=="object"?[t,e.kind,e.name,e.id]:[t,e,r]).filter(Boolean).join("/")}var Gr=Symbol("RECEIVE_INTERMEDIATE_RESULTS");function ms(t,e,r){return{type:"RECEIVE_ITEMS",items:t,persistedEdits:e,meta:r}}function ea(t,e,r,n=!1){return{type:"REMOVE_ITEMS",itemIds:Array.isArray(r)?r:[r],kind:t,name:e,invalidateCache:n}}function ta(t,e={},r,n){return{...ms(t,r,n),query:e}}var la=w(sa(),1),ua=w(W(),1);var ca=w(Ze(),1);function Xh(t){let e={stableKey:"",page:1,perPage:10,fields:null,include:null,context:"default"},r=Object.keys(t).sort();for(let n=0;n<r.length;n++){let o=r[n],s=t[o];switch(o){case"page":e[o]=Number(s);break;case"per_page":e.perPage=Number(s);break;case"context":e.context=s;break;default:o==="_fields"&&(e.fields=ie(s)??[],s=e.fields.join()),o==="include"&&(typeof s=="number"&&(s=s.toString()),e.include=(ie(s)??[]).map(Number),s=e.include.join()),e.stableKey+=(e.stableKey?"&":"")+(0,ca.addQueryArgs)("",{[o]:s}).slice(1)}}return e}var et=hs(Xh);var aa=new WeakMap;function Zh(t,e){let{stableKey:r,page:n,perPage:o,include:s,fields:i,context:c}=et(e),a;if(t.queries?.[c]?.[r]&&(a=t.queries[c][r].itemIds),!a)return null;let u=o===-1?0:(n-1)*o,l=o===-1?a.length:Math.min(u+o,a.length),d=[];for(let f=u;f<l;f++){let h=a[f];if(Array.isArray(s)&&!s.includes(h)||h===void 0)continue;if(!t.items[c]?.hasOwnProperty(h))return null;let p=t.items[c][h],g;if(Array.isArray(i)){g={};for(let m=0;m<i.length;m++){let y=i[m].split("."),E=p;y.forEach(_=>{E=E?.[_]}),Xe(g,y,E)}}else{if(!t.itemIsComplete[c]?.[h])return null;g=p}d.push(g)}return d}var ys=(0,ua.createSelector)((t,e={})=>{let r=aa.get(t);if(r){let o=r.get(e);if(o!==void 0)return o}else r=new la.default,aa.set(t,r);let n=Zh(t,e);return r.set(e,n),n});function Es(t,e={}){let{stableKey:r,context:n}=et(e);return t.queries?.[n]?.[r]?.meta?.totalItems??null}function da(t,e={}){let{stableKey:r,context:n}=et(e);return t.queries?.[n]?.[r]?.meta?.totalPages??null}var cf=w(W(),1),af=w(jn(),1);var tt=function(){return tt=Object.assign||function(e){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},tt.apply(this,arguments)};function fa(t){return t.toLowerCase()}var ep=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],tp=/[^A-Z0-9]+/gi;function Yn(t,e){e===void 0&&(e={});for(var r=e.splitRegexp,n=r===void 0?ep:r,o=e.stripRegexp,s=o===void 0?tp:o,i=e.transform,c=i===void 0?fa:i,a=e.delimiter,u=a===void 0?" ":a,l=ha(ha(t,n,"$1\0$2"),s,"\0"),d=0,f=l.length;l.charAt(d)==="\0";)d++;for(;l.charAt(f-1)==="\0";)f--;return l.slice(d,f).split("\0").map(c).join(u)}function ha(t,e,r){return e instanceof RegExp?t.replace(e,r):e.reduce(function(n,o){return n.replace(o,r)},t)}function ws(t,e){var r=t.charAt(0),n=t.substr(1).toLowerCase();return e>0&&r>="0"&&r<="9"?"_"+r+n:""+r.toUpperCase()+n}function $r(t,e){return e===void 0&&(e={}),Yn(t,tt({delimiter:"",transform:ws},e))}function rp(t,e){return e===0?t.toLowerCase():ws(t,e)}function Gn(t,e){return e===void 0&&(e={}),$r(t,tt({transform:rp},e))}function pa(t){return t.charAt(0).toUpperCase()+t.substr(1)}function np(t){return pa(t.toLowerCase())}function ga(t,e){return e===void 0&&(e={}),Yn(t,tt({delimiter:" ",transform:np},e))}var xn=w(Ae(),1),Ho=w(nr(),1),B=w(_s(),1);var Or=w(W(),1);var C={};bt(C,{AbsolutePosition:()=>so,AbstractConnector:()=>Xs,AbstractStruct:()=>br,AbstractType:()=>F,Array:()=>Ft,ContentAny:()=>ft,ContentBinary:()=>zt,ContentDeleted:()=>vr,ContentDoc:()=>Kt,ContentEmbed:()=>Ke,ContentFormat:()=>Y,ContentJSON:()=>gn,ContentString:()=>Te,ContentType:()=>we,Doc:()=>Me,GC:()=>oe,ID:()=>$e,Item:()=>k,Map:()=>Yt,PermanentUserData:()=>ei,RelativePosition:()=>_r,Skip:()=>X,Snapshot:()=>ln,Text:()=>Sr,Transaction:()=>co,UndoManager:()=>Vt,UpdateDecoderV1:()=>he,UpdateDecoderV2:()=>ae,UpdateEncoderV1:()=>Ne,UpdateEncoderV2:()=>ge,XmlElement:()=>$t,XmlFragment:()=>Gt,XmlHook:()=>pn,XmlText:()=>go,YArrayEvent:()=>uo,YEvent:()=>jt,YMapEvent:()=>fo,YTextEvent:()=>ho,YXmlEvent:()=>po,applyUpdate:()=>fi,applyUpdateV2:()=>Be,cleanupYTextFormatting:()=>ou,compareIDs:()=>Ut,compareRelativePositions:()=>wg,convertUpdateFormatV1ToV2:()=>jg,convertUpdateFormatV2ToV1:()=>Fl,createAbsolutePositionFromRelativePosition:()=>Eg,createDeleteSet:()=>yo,createDeleteSetFromStructStore:()=>li,createDocFromSnapshot:()=>Rg,createID:()=>R,createRelativePositionFromJSON:()=>ug,createRelativePositionFromTypeIndex:()=>fg,createSnapshot:()=>Ei,decodeRelativePosition:()=>mg,decodeSnapshot:()=>bg,decodeSnapshotV2:()=>Il,decodeStateVector:()=>pi,decodeUpdate:()=>Ug,decodeUpdateV2:()=>Pl,diffUpdate:()=>Ng,diffUpdateV2:()=>wi,emptySnapshot:()=>vg,encodeRelativePosition:()=>pg,encodeSnapshot:()=>Sg,encodeSnapshotV2:()=>xl,encodeStateAsUpdate:()=>hi,encodeStateAsUpdateV2:()=>ht,encodeStateVector:()=>mi,encodeStateVectorFromUpdate:()=>Lg,encodeStateVectorFromUpdateV2:()=>Nl,equalDeleteSets:()=>vl,equalSnapshots:()=>_g,findIndexSS:()=>Ee,findRootTypeKey:()=>yi,getItem:()=>Lt,getItemCleanEnd:()=>ni,getItemCleanStart:()=>ne,getState:()=>L,getTypeChildren:()=>$g,isDeleted:()=>Ht,isParentOf:()=>an,iterateDeletedStructs:()=>Pt,logType:()=>ag,logUpdate:()=>Og,logUpdateV2:()=>Ll,mergeDeleteSets:()=>Mt,mergeUpdates:()=>Ml,mergeUpdatesV2:()=>Bt,obfuscateUpdate:()=>Vg,obfuscateUpdateV2:()=>Bg,parseUpdateMeta:()=>Pg,parseUpdateMetaV2:()=>Vl,readUpdate:()=>og,readUpdateV2:()=>di,relativePositionToJSON:()=>lg,snapshot:()=>Cg,snapshotContainsUpdate:()=>xg,transact:()=>D,tryGc:()=>Dg,typeListToArraySnapshot:()=>zg,typeMapGetAllSnapshot:()=>Zl,typeMapGetSnapshot:()=>qg});var V=()=>new Map,$n=t=>{let e=V();return t.forEach((r,n)=>{e.set(n,r)}),e},K=(t,e,r)=>{let n=t.get(e);return n===void 0&&t.set(e,n=r()),n},wa=(t,e)=>{let r=[];for(let[n,o]of t)r.push(e(o,n));return r},_a=(t,e)=>{for(let[r,n]of t)if(e(n,r))return!0;return!1};var De=()=>new Set;var zn=t=>t[t.length-1];var Sa=(t,e)=>{for(let r=0;r<e.length;r++)t.push(e[r])},ve=Array.from;var ba=(t,e)=>{for(let r=0;r<t.length;r++)if(e(t[r],r,t))return!0;return!1};var va=(t,e)=>{let r=new Array(t);for(let n=0;n<t;n++)r[n]=e(n,r);return r};var xt=Array.isArray;var rt=class{constructor(){this._observers=V()}on(e,r){return K(this._observers,e,De).add(r),r}once(e,r){let n=(...o)=>{this.off(e,n),r(...o)};this.on(e,n)}off(e,r){let n=this._observers.get(e);n!==void 0&&(n.delete(r),n.size===0&&this._observers.delete(e))}emit(e,r){return ve((this._observers.get(e)||V()).values()).forEach(n=>n(...r))}destroy(){this._observers=V()}},sr=class{constructor(){this._observers=V()}on(e,r){K(this._observers,e,De).add(r)}once(e,r){let n=(...o)=>{this.off(e,n),r(...o)};this.on(e,n)}off(e,r){let n=this._observers.get(e);n!==void 0&&(n.delete(r),n.size===0&&this._observers.delete(e))}emit(e,r){return ve((this._observers.get(e)||V()).values()).forEach(n=>n(...r))}destroy(){this._observers=V()}};var fe=Math.floor;var ir=Math.abs;var Kn=(t,e)=>t<e?t:e,Ge=(t,e)=>t>e?t:e,SS=Number.isNaN;var Hn=t=>t!==0?t<0:1/t<0;var bs=Number.MAX_SAFE_INTEGER,bS=Number.MIN_SAFE_INTEGER,vS=1<<31;var Ca=Number.isInteger||(t=>typeof t=="number"&&isFinite(t)&&fe(t)===t),CS=Number.isNaN,RS=Number.parseInt;var vs=String.fromCharCode,TS=String.fromCodePoint,xS=vs(65535),op=t=>t.toLowerCase(),sp=/^\s*/g,ip=t=>t.replace(sp,""),cp=/([A-Z])/g,Cs=(t,e)=>ip(t.replace(cp,r=>`${e}${op(r)}`));var ap=t=>{let e=unescape(encodeURIComponent(t)),r=e.length,n=new Uint8Array(r);for(let o=0;o<r;o++)n[o]=e.codePointAt(o);return n},ar=typeof TextEncoder<"u"?new TextEncoder:null,lp=t=>ar.encode(t),Ta=ar?lp:ap;var cr=typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});cr&&cr.decode(new Uint8Array).length===1&&(cr=null);var xa=(t,e)=>va(e,()=>t).join("");var It=class{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}},Ce=()=>new It;var up=t=>{let e=t.cpos;for(let r=0;r<t.bufs.length;r++)e+=t.bufs[r].length;return e};var re=t=>{let e=new Uint8Array(up(t)),r=0;for(let n=0;n<t.bufs.length;n++){let o=t.bufs[n];e.set(o,r),r+=o.length}return e.set(new Uint8Array(t.cbuf.buffer,0,t.cpos),r),e},dp=(t,e)=>{let r=t.cbuf.length;r-t.cpos<e&&(t.bufs.push(new Uint8Array(t.cbuf.buffer,0,t.cpos)),t.cbuf=new Uint8Array(Ge(r,e)*2),t.cpos=0)},H=(t,e)=>{let r=t.cbuf.length;t.cpos===r&&(t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(r*2),t.cpos=0),t.cbuf[t.cpos++]=e};var fr=H;var v=(t,e)=>{for(;e>127;)H(t,128|127&e),e=fe(e/128);H(t,127&e)},Wr=(t,e)=>{let r=Hn(e);for(r&&(e=-e),H(t,(e>63?128:0)|(r?64:0)|63&e),e=fe(e/64);e>0;)H(t,(e>127?128:0)|127&e),e=fe(e/128)},Rs=new Uint8Array(3e4),fp=Rs.length/3,hp=(t,e)=>{if(e.length<fp){let r=ar.encodeInto(e,Rs).written||0;v(t,r);for(let n=0;n<r;n++)H(t,Rs[n])}else J(t,Ta(e))},pp=(t,e)=>{let r=unescape(encodeURIComponent(e)),n=r.length;v(t,n);for(let o=0;o<n;o++)H(t,r.codePointAt(o))},nt=ar&&ar.encodeInto?hp:pp;var Oa=(t,e)=>hr(t,re(e)),hr=(t,e)=>{let r=t.cbuf.length,n=t.cpos,o=Kn(r-n,e.length),s=e.length-o;t.cbuf.set(e.subarray(0,o),n),t.cpos+=o,s>0&&(t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(Ge(r*2,s)),t.cbuf.set(e.subarray(o)),t.cpos=s)},J=(t,e)=>{v(t,e.byteLength),hr(t,e)},Ts=(t,e)=>{dp(t,e);let r=new DataView(t.cbuf.buffer,t.cpos,e);return t.cpos+=e,r},gp=(t,e)=>Ts(t,4).setFloat32(0,e,!1),mp=(t,e)=>Ts(t,8).setFloat64(0,e,!1),yp=(t,e)=>Ts(t,8).setBigInt64(0,e,!1);var Aa=new DataView(new ArrayBuffer(4)),Ep=t=>(Aa.setFloat32(0,t),Aa.getFloat32(0)===t),ur=(t,e)=>{switch(typeof e){case"string":H(t,119),nt(t,e);break;case"number":Ca(e)&&ir(e)<=2147483647?(H(t,125),Wr(t,e)):Ep(e)?(H(t,124),gp(t,e)):(H(t,123),mp(t,e));break;case"bigint":H(t,122),yp(t,e);break;case"object":if(e===null)H(t,126);else if(xt(e)){H(t,117),v(t,e.length);for(let r=0;r<e.length;r++)ur(t,e[r])}else if(e instanceof Uint8Array)H(t,116),J(t,e);else{H(t,118);let r=Object.keys(e);v(t,r.length);for(let n=0;n<r.length;n++){let o=r[n];nt(t,o),ur(t,e[o])}}break;case"boolean":H(t,e?120:121);break;default:H(t,127)}},qr=class extends It{constructor(e){super(),this.w=e,this.s=null,this.count=0}write(e){this.s===e?this.count++:(this.count>0&&v(this,this.count-1),this.count=1,this.w(this,e),this.s=e)}};var Da=t=>{t.count>0&&(Wr(t.encoder,t.count===1?t.s:-t.s),t.count>1&&v(t.encoder,t.count-2))},At=class{constructor(){this.encoder=new It,this.s=0,this.count=0}write(e){this.s===e?this.count++:(Da(this),this.count=1,this.s=e)}toUint8Array(){return Da(this),re(this.encoder)}};var ka=t=>{if(t.count>0){let e=t.diff*2+(t.count===1?0:1);Wr(t.encoder,e),t.count>1&&v(t.encoder,t.count-2)}},dr=class{constructor(){this.encoder=new It,this.s=0,this.count=0,this.diff=0}write(e){this.diff===e-this.s?(this.s=e,this.count++):(ka(this),this.count=1,this.diff=e-this.s,this.s=e)}toUint8Array(){return ka(this),re(this.encoder)}},qn=class{constructor(){this.sarr=[],this.s="",this.lensE=new At}write(e){this.s+=e,this.s.length>19&&(this.sarr.push(this.s),this.s=""),this.lensE.write(e.length)}toUint8Array(){let e=new It;return this.sarr.push(this.s),this.s="",nt(e,this.sarr.join("")),hr(e,this.lensE.toUint8Array()),re(e)}};var ke=t=>new Error(t),Re=()=>{throw ke("Method unimplemented")},ce=()=>{throw ke("Unexpected case")};var La=ke("Unexpected end of array"),Pa=ke("Integer out of Range"),pr=class{constructor(e){this.arr=e,this.pos=0}},G=t=>new pr(t),Is=t=>t.pos!==t.arr.length;var wp=(t,e)=>{let r=new Uint8Array(t.arr.buffer,t.pos+t.arr.byteOffset,e);return t.pos+=e,r},Q=t=>wp(t,T(t));var Dt=t=>t.arr[t.pos++];var T=t=>{let e=0,r=1,n=t.arr.length;for(;t.pos<n;){let o=t.arr[t.pos++];if(e=e+(o&127)*r,r*=128,o<128)return e;if(e>bs)throw Pa}throw La},Qr=t=>{let e=t.arr[t.pos++],r=e&63,n=64,o=(e&64)>0?-1:1;if((e&128)===0)return o*r;let s=t.arr.length;for(;t.pos<s;){if(e=t.arr[t.pos++],r=r+(e&127)*n,n*=128,e<128)return o*r;if(r>bs)throw Pa}throw La};var _p=t=>{let e=T(t);if(e===0)return"";{let r=String.fromCodePoint(Dt(t));if(--e<100)for(;e--;)r+=String.fromCodePoint(Dt(t));else for(;e>0;){let n=e<1e4?e:1e4,o=t.arr.subarray(t.pos,t.pos+n);t.pos+=n,r+=String.fromCodePoint.apply(null,o),e-=n}return decodeURIComponent(escape(r))}},Sp=t=>cr.decode(Q(t)),st=cr?Sp:_p;var As=(t,e)=>{let r=new DataView(t.arr.buffer,t.arr.byteOffset+t.pos,e);return t.pos+=e,r},bp=t=>As(t,4).getFloat32(0,!1),vp=t=>As(t,8).getFloat64(0,!1),Cp=t=>As(t,8).getBigInt64(0,!1);var Rp=[t=>{},t=>null,Qr,bp,vp,Cp,t=>!1,t=>!0,st,t=>{let e=T(t),r={};for(let n=0;n<e;n++){let o=st(t);r[o]=gr(t)}return r},t=>{let e=T(t),r=[];for(let n=0;n<e;n++)r.push(gr(t));return r},Q],gr=t=>Rp[127-Dt(t)](t),Jr=class extends pr{constructor(e,r){super(e),this.reader=r,this.s=null,this.count=0}read(){return this.count===0&&(this.s=this.reader(this),Is(this)?this.count=T(this)+1:this.count=-1),this.count--,this.s}};var kt=class extends pr{constructor(e){super(e),this.s=0,this.count=0}read(){if(this.count===0){this.s=Qr(this);let e=Hn(this.s);this.count=1,e&&(this.s=-this.s,this.count=T(this)+2)}return this.count--,this.s}};var mr=class extends pr{constructor(e){super(e),this.s=0,this.count=0,this.diff=0}read(){if(this.count===0){let e=Qr(this),r=e&1;this.diff=fe(e/2),this.count=1,r&&(this.count=T(this)+2)}return this.s+=this.diff,this.count--,this.s}},Wn=class{constructor(e){this.decoder=new kt(e),this.str=st(this.decoder),this.spos=0}read(){let e=this.spos+this.decoder.read(),r=this.str.slice(this.spos,e);return this.spos=e,r}};var DS=crypto.subtle,Ma=crypto.getRandomValues.bind(crypto);var ks=()=>Ma(new Uint32Array(1))[0];var Tp="10000000-1000-4000-8000"+-1e11,Na=()=>Tp.replace(/[018]/g,t=>(t^ks()&15>>t/4).toString(16));var it=Date.now;var Us=t=>new Promise(t);var US=Promise.all.bind(Promise);var Ls=t=>t===void 0?null:t;var Ps=class{constructor(){this.map=new Map}setItem(e,r){this.map.set(e,r)}getItem(e){return this.map.get(e)}},Va=new Ps,Dp=!0;try{typeof localStorage<"u"&&localStorage&&(Va=localStorage,Dp=!1)}catch{}var Ba=Va;var Fa=Object.assign,Ya=Object.keys,Ga=(t,e)=>{for(let r in t)e(t[r],r)};var Ms=t=>Ya(t).length,ja=t=>Ya(t).length;var $a=t=>{for(let e in t)return!1;return!0},Op=(t,e)=>{for(let r in t)if(!e(t[r],r))return!1;return!0},Ns=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),Vs=(t,e)=>t===e||ja(t)===ja(e)&&Op(t,(r,n)=>(r!==void 0||Ns(e,n))&&e[n]===r),Up=Object.freeze,Bs=t=>{for(let e in t){let r=t[e];(typeof r=="object"||typeof r=="function")&&Bs(t[e])}return Up(t)};var Zr=(t,e,r=0)=>{try{for(;r<t.length;r++)t[r](...e)}finally{r<t.length&&Zr(t,e,r+1)}};var js=t=>t,Lp=(t,e)=>t===e;var Xr=(t,e)=>{if(t==null||e==null)return Lp(t,e);if(t.constructor!==e.constructor)return!1;if(t===e)return!0;switch(t.constructor){case ArrayBuffer:t=new Uint8Array(t),e=new Uint8Array(e);case Uint8Array:{if(t.byteLength!==e.byteLength)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[r])return!1;break}case Set:{if(t.size!==e.size)return!1;for(let r of t)if(!e.has(r))return!1;break}case Map:{if(t.size!==e.size)return!1;for(let r of t.keys())if(!e.has(r)||!Xr(t.get(r),e.get(r)))return!1;break}case Object:if(Ms(t)!==Ms(e))return!1;for(let r in t)if(!Ns(t,r)||!Xr(t[r],e[r]))return!1;break;case Array:if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(!Xr(t[r],e[r]))return!1;break;default:return!1}return!0},Ka=(t,e)=>e.includes(t);var yr=typeof process<"u"&&process.release&&/node|io\.js/.test(process.release.name)&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]",Jn=typeof window<"u"&&typeof document<"u"&&!yr,LS=typeof navigator<"u"?/Mac/.test(navigator.platform):!1,Oe,Pp=[],Mp=()=>{if(Oe===void 0)if(yr){Oe=V();let t=process.argv,e=null;for(let r=0;r<t.length;r++){let n=t[r];n[0]==="-"?(e!==null&&Oe.set(e,""),e=n):e!==null?(Oe.set(e,n),e=null):Pp.push(n)}e!==null&&Oe.set(e,"")}else typeof location=="object"?(Oe=V(),(location.search||"?").slice(1).split("&").forEach(t=>{if(t.length!==0){let[e,r]=t.split("=");Oe.set(`--${Cs(e,"-")}`,r),Oe.set(`-${Cs(e,"-")}`,r)}})):Oe=V();return Oe},Ys=t=>Mp().has(t);var en=t=>yr?Ls(process.env[t.toUpperCase().replaceAll("-","_")]):Ls(Ba.getItem(t));var Ha=t=>Ys("--"+t)||en(t)!==null,PS=Ha("production"),Np=yr&&Ka(process.env.FORCE_COLOR,["true","1","2"]),qa=Np||!Ys("--no-colors")&&!Ha("no-color")&&(!yr||process.stdout.isTTY)&&(!yr||Ys("--color")||en("COLORTERM")!==null||(en("TERM")||"").includes("color"));var Wa=t=>new Uint8Array(t),Vp=(t,e,r)=>new Uint8Array(t,e,r);var Bp=t=>{let e="";for(let r=0;r<t.byteLength;r++)e+=vs(t[r]);return btoa(e)},jp=t=>Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("base64"),Fp=t=>{let e=atob(t),r=Wa(e.length);for(let n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return r},Yp=t=>{let e=Buffer.from(t,"base64");return Vp(e.buffer,e.byteOffset,e.byteLength)},Ja=Jn?Bp:jp,Qa=Jn?Fp:Yp;var Xa=t=>{let e=Wa(t.byteLength);return e.set(t),e};var $s=class{constructor(e,r){this.left=e,this.right=r}},Ue=(t,e)=>new $s(t,e);var Ot=typeof document<"u"?document:{};var MS=typeof DOMParser<"u"?new DOMParser:null;var el=t=>wa(t,(e,r)=>`${r}:${e};`).join("");var NS=Ot.ELEMENT_NODE,VS=Ot.TEXT_NODE,BS=Ot.CDATA_SECTION_NODE,jS=Ot.COMMENT_NODE,FS=Ot.DOCUMENT_NODE,YS=Ot.DOCUMENT_TYPE_NODE,GS=Ot.DOCUMENT_FRAGMENT_NODE;var Le=Symbol;var tn=Le(),rn=Le(),zs=Le(),Ks=Le(),Hs=Le(),nn=Le(),qs=Le(),Er=Le(),Ws=Le(),tl=t=>{t.length===1&&t[0]?.constructor===Function&&(t=t[0]());let e=[],r=[],n=0;for(;n<t.length;n++){let o=t[n];if(o===void 0)break;if(o.constructor===String||o.constructor===Number)e.push(o);else if(o.constructor===Object)break}for(n>0&&r.push(e.join(""));n<t.length;n++){let o=t[n];o instanceof Symbol||r.push(o)}return r};var $S=it();var Hp={[tn]:Ue("font-weight","bold"),[rn]:Ue("font-weight","normal"),[zs]:Ue("color","blue"),[Hs]:Ue("color","green"),[Ks]:Ue("color","grey"),[nn]:Ue("color","red"),[qs]:Ue("color","purple"),[Er]:Ue("color","orange"),[Ws]:Ue("color","black")},qp=t=>{t.length===1&&t[0]?.constructor===Function&&(t=t[0]());let e=[],r=[],n=V(),o=[],s=0;for(;s<t.length;s++){let i=t[s],c=Hp[i];if(c!==void 0)n.set(c.left,c.right);else{if(i===void 0)break;if(i.constructor===String||i.constructor===Number){let a=el(n);s>0||a.length>0?(e.push("%c"+i),r.push(a)):e.push(i)}else break}}for(s>0&&(o=r,o.unshift(e.join("")));s<t.length;s++){let i=t[s];i instanceof Symbol||o.push(i)}return o},rl=qa?qp:tl,Qn=(...t)=>{console.log(...rl(t)),nl.forEach(e=>e.print(t))},Js=(...t)=>{console.warn(...rl(t)),t.unshift(Er),nl.forEach(e=>e.print(t))};var nl=De();var ol=t=>({[Symbol.iterator](){return this},next:t}),sl=(t,e)=>ol(()=>{let r;do r=t.next();while(!r.done&&!e(r.value));return r}),Xn=(t,e)=>ol(()=>{let{done:r,value:n}=t.next();return{done:r,value:r?void 0:e(n)}});var Xs=class extends rt{constructor(e,r){super(),this.doc=e,this.awareness=r}},sn=class{constructor(e,r){this.clock=e,this.len=r}},ut=class{constructor(){this.clients=new Map}},Pt=(t,e,r)=>e.clients.forEach((n,o)=>{let s=t.doc.store.clients.get(o);if(s!=null){let i=s[s.length-1],c=i.id.clock+i.length;for(let a=0,u=n[a];a<n.length&&u.clock<c;u=n[++a])Dl(t,s,u.clock,u.len,r)}}),Zp=(t,e)=>{let r=0,n=t.length-1;for(;r<=n;){let o=fe((r+n)/2),s=t[o],i=s.clock;if(i<=e){if(e<i+s.len)return o;r=o+1}else n=o-1}return null},Ht=(t,e)=>{let r=t.clients.get(e.client);return r!==void 0&&Zp(r,e.clock)!==null},ai=t=>{t.clients.forEach(e=>{e.sort((o,s)=>o.clock-s.clock);let r,n;for(r=1,n=1;r<e.length;r++){let o=e[n-1],s=e[r];o.clock+o.len>=s.clock?o.len=Ge(o.len,s.clock+s.len-o.clock):(n<r&&(e[n]=s),n++)}e.length=n})},Mt=t=>{let e=new ut;for(let r=0;r<t.length;r++)t[r].clients.forEach((n,o)=>{if(!e.clients.has(o)){let s=n.slice();for(let i=r+1;i<t.length;i++)Sa(s,t[i].clients.get(o)||[]);e.clients.set(o,s)}});return ai(e),e},cn=(t,e,r,n)=>{K(t.clients,e,()=>[]).push(new sn(r,n))},yo=()=>new ut,li=t=>{let e=yo();return t.clients.forEach((r,n)=>{let o=[];for(let s=0;s<r.length;s++){let i=r[s];if(i.deleted){let c=i.id.clock,a=i.length;if(s+1<r.length)for(let u=r[s+1];s+1<r.length&&u.deleted;u=r[++s+1])a+=u.length;o.push(new sn(c,a))}}o.length>0&&e.clients.set(n,o)}),e},Pe=(t,e)=>{v(t.restEncoder,e.clients.size),ve(e.clients.entries()).sort((r,n)=>n[0]-r[0]).forEach(([r,n])=>{t.resetDsCurVal(),v(t.restEncoder,r);let o=n.length;v(t.restEncoder,o);for(let s=0;s<o;s++){let i=n[s];t.writeDsClock(i.clock),t.writeDsLen(i.len)}})},ze=t=>{let e=new ut,r=T(t.restDecoder);for(let n=0;n<r;n++){t.resetDsCurVal();let o=T(t.restDecoder),s=T(t.restDecoder);if(s>0){let i=K(e.clients,o,()=>[]);for(let c=0;c<s;c++)i.push(new sn(t.readDsClock(),t.readDsLen()))}}return e},al=(t,e,r)=>{let n=new ut,o=T(t.restDecoder);for(let s=0;s<o;s++){t.resetDsCurVal();let i=T(t.restDecoder),c=T(t.restDecoder),a=r.clients.get(i)||[],u=L(r,i);for(let l=0;l<c;l++){let d=t.readDsClock(),f=d+t.readDsLen();if(d<u){u<f&&cn(n,i,u,f-u);let h=Ee(a,d),p=a[h];for(!p.deleted&&p.id.clock<d&&(a.splice(h+1,0,mo(e,p,d-p.id.clock)),h++);h<a.length&&(p=a[h++],p.id.clock<f);)p.deleted||(f<p.id.clock+p.length&&a.splice(h,0,mo(e,p,f-p.id.clock)),p.delete(e))}else cn(n,i,d,f-d)}}if(n.clients.size>0){let s=new ge;return v(s.restEncoder,0),Pe(s,n),s.toUint8Array()}return null},vl=(t,e)=>{if(t.clients.size!==e.clients.size)return!1;for(let[r,n]of t.clients.entries()){let o=e.clients.get(r);if(o===void 0||n.length!==o.length)return!1;for(let s=0;s<n.length;s++){let i=n[s],c=o[s];if(i.clock!==c.clock||i.len!==c.len)return!1}}return!0},Cl=ks,Me=class t extends rt{constructor({guid:e=Na(),collectionid:r=null,gc:n=!0,gcFilter:o=()=>!0,meta:s=null,autoLoad:i=!1,shouldLoad:c=!0}={}){super(),this.gc=n,this.gcFilter=o,this.clientID=Cl(),this.guid=e,this.collectionid=r,this.share=new Map,this.store=new io,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=c,this.autoLoad=i,this.meta=s,this.isLoaded=!1,this.isSynced=!1,this.isDestroyed=!1,this.whenLoaded=Us(u=>{this.on("load",()=>{this.isLoaded=!0,u(this)})});let a=()=>Us(u=>{let l=d=>{(d===void 0||d===!0)&&(this.off("sync",l),u())};this.on("sync",l)});this.on("sync",u=>{u===!1&&this.isSynced&&(this.whenSynced=a()),this.isSynced=u===void 0||u===!0,this.isSynced&&!this.isLoaded&&this.emit("load",[this])}),this.whenSynced=a()}load(){let e=this._item;e!==null&&!this.shouldLoad&&D(e.parent.doc,r=>{r.subdocsLoaded.add(this)},null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(ve(this.subdocs).map(e=>e.guid))}transact(e,r=null){return D(this,e,r)}get(e,r=F){let n=K(this.share,e,()=>{let s=new r;return s._integrate(this,null),s}),o=n.constructor;if(r!==F&&o!==r)if(o===F){let s=new r;s._map=n._map,n._map.forEach(i=>{for(;i!==null;i=i.left)i.parent=s}),s._start=n._start;for(let i=s._start;i!==null;i=i.right)i.parent=s;return s._length=n._length,this.share.set(e,s),s._integrate(this,null),s}else throw new Error(`Type with the name ${e} has already been defined with a different constructor`);return n}getArray(e=""){return this.get(e,Ft)}getText(e=""){return this.get(e,Sr)}getMap(e=""){return this.get(e,Yt)}getXmlElement(e=""){return this.get(e,$t)}getXmlFragment(e=""){return this.get(e,Gt)}toJSON(){let e={};return this.share.forEach((r,n)=>{e[n]=r.toJSON()}),e}destroy(){this.isDestroyed=!0,ve(this.subdocs).forEach(r=>r.destroy());let e=this._item;if(e!==null){this._item=null;let r=e.content;r.doc=new t({guid:this.guid,...r.opts,shouldLoad:!1}),r.doc._item=e,D(e.parent.doc,n=>{let o=r.doc;e.deleted||n.subdocsAdded.add(o),n.subdocsRemoved.add(this)},null,!0)}this.emit("destroyed",[!0]),this.emit("destroy",[this]),super.destroy()}},Nt=class{constructor(e){this.restDecoder=e}resetDsCurVal(){}readDsClock(){return T(this.restDecoder)}readDsLen(){return T(this.restDecoder)}},he=class extends Nt{readLeftID(){return R(T(this.restDecoder),T(this.restDecoder))}readRightID(){return R(T(this.restDecoder),T(this.restDecoder))}readClient(){return T(this.restDecoder)}readInfo(){return Dt(this.restDecoder)}readString(){return st(this.restDecoder)}readParentInfo(){return T(this.restDecoder)===1}readTypeRef(){return T(this.restDecoder)}readLen(){return T(this.restDecoder)}readAny(){return gr(this.restDecoder)}readBuf(){return Xa(Q(this.restDecoder))}readJSON(){return JSON.parse(st(this.restDecoder))}readKey(){return st(this.restDecoder)}},oo=class{constructor(e){this.dsCurrVal=0,this.restDecoder=e}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=T(this.restDecoder),this.dsCurrVal}readDsLen(){let e=T(this.restDecoder)+1;return this.dsCurrVal+=e,e}},ae=class extends oo{constructor(e){super(e),this.keys=[],T(e),this.keyClockDecoder=new mr(Q(e)),this.clientDecoder=new kt(Q(e)),this.leftClockDecoder=new mr(Q(e)),this.rightClockDecoder=new mr(Q(e)),this.infoDecoder=new Jr(Q(e),Dt),this.stringDecoder=new Wn(Q(e)),this.parentInfoDecoder=new Jr(Q(e),Dt),this.typeRefDecoder=new kt(Q(e)),this.lenDecoder=new kt(Q(e))}readLeftID(){return new $e(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new $e(this.clientDecoder.read(),this.rightClockDecoder.read())}readClient(){return this.clientDecoder.read()}readInfo(){return this.infoDecoder.read()}readString(){return this.stringDecoder.read()}readParentInfo(){return this.parentInfoDecoder.read()===1}readTypeRef(){return this.typeRefDecoder.read()}readLen(){return this.lenDecoder.read()}readAny(){return gr(this.restDecoder)}readBuf(){return Q(this.restDecoder)}readJSON(){return gr(this.restDecoder)}readKey(){let e=this.keyClockDecoder.read();if(e<this.keys.length)return this.keys[e];{let r=this.stringDecoder.read();return this.keys.push(r),r}}},dt=class{constructor(){this.restEncoder=Ce()}toUint8Array(){return re(this.restEncoder)}resetDsCurVal(){}writeDsClock(e){v(this.restEncoder,e)}writeDsLen(e){v(this.restEncoder,e)}},Ne=class extends dt{writeLeftID(e){v(this.restEncoder,e.client),v(this.restEncoder,e.clock)}writeRightID(e){v(this.restEncoder,e.client),v(this.restEncoder,e.clock)}writeClient(e){v(this.restEncoder,e)}writeInfo(e){fr(this.restEncoder,e)}writeString(e){nt(this.restEncoder,e)}writeParentInfo(e){v(this.restEncoder,e?1:0)}writeTypeRef(e){v(this.restEncoder,e)}writeLen(e){v(this.restEncoder,e)}writeAny(e){ur(this.restEncoder,e)}writeBuf(e){J(this.restEncoder,e)}writeJSON(e){nt(this.restEncoder,JSON.stringify(e))}writeKey(e){nt(this.restEncoder,e)}},wr=class{constructor(){this.restEncoder=Ce(),this.dsCurrVal=0}toUint8Array(){return re(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(e){let r=e-this.dsCurrVal;this.dsCurrVal=e,v(this.restEncoder,r)}writeDsLen(e){e===0&&ce(),v(this.restEncoder,e-1),this.dsCurrVal+=e}},ge=class extends wr{constructor(){super(),this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new dr,this.clientEncoder=new At,this.leftClockEncoder=new dr,this.rightClockEncoder=new dr,this.infoEncoder=new qr(fr),this.stringEncoder=new qn,this.parentInfoEncoder=new qr(fr),this.typeRefEncoder=new At,this.lenEncoder=new At}toUint8Array(){let e=Ce();return v(e,0),J(e,this.keyClockEncoder.toUint8Array()),J(e,this.clientEncoder.toUint8Array()),J(e,this.leftClockEncoder.toUint8Array()),J(e,this.rightClockEncoder.toUint8Array()),J(e,re(this.infoEncoder)),J(e,this.stringEncoder.toUint8Array()),J(e,re(this.parentInfoEncoder)),J(e,this.typeRefEncoder.toUint8Array()),J(e,this.lenEncoder.toUint8Array()),hr(e,re(this.restEncoder)),re(e)}writeLeftID(e){this.clientEncoder.write(e.client),this.leftClockEncoder.write(e.clock)}writeRightID(e){this.clientEncoder.write(e.client),this.rightClockEncoder.write(e.clock)}writeClient(e){this.clientEncoder.write(e)}writeInfo(e){this.infoEncoder.write(e)}writeString(e){this.stringEncoder.write(e)}writeParentInfo(e){this.parentInfoEncoder.write(e?1:0)}writeTypeRef(e){this.typeRefEncoder.write(e)}writeLen(e){this.lenEncoder.write(e)}writeAny(e){ur(this.restEncoder,e)}writeBuf(e){J(this.restEncoder,e)}writeJSON(e){ur(this.restEncoder,e)}writeKey(e){let r=this.keyMap.get(e);r===void 0?(this.keyClockEncoder.write(this.keyClock++),this.stringEncoder.write(e)):this.keyClockEncoder.write(r)}},eg=(t,e,r,n)=>{n=Ge(n,e[0].id.clock);let o=Ee(e,n);v(t.restEncoder,e.length-o),t.writeClient(r),v(t.restEncoder,n);let s=e[o];s.write(t,n-s.id.clock);for(let i=o+1;i<e.length;i++)e[i].write(t,0)},ui=(t,e,r)=>{let n=new Map;r.forEach((o,s)=>{L(e,s)>o&&n.set(s,o)}),mn(e).forEach((o,s)=>{r.has(s)||n.set(s,0)}),v(t.restEncoder,n.size),ve(n.entries()).sort((o,s)=>s[0]-o[0]).forEach(([o,s])=>{eg(t,e.clients.get(o),o,s)})},tg=(t,e)=>{let r=V(),n=T(t.restDecoder);for(let o=0;o<n;o++){let s=T(t.restDecoder),i=new Array(s),c=t.readClient(),a=T(t.restDecoder);r.set(c,{i:0,refs:i});for(let u=0;u<s;u++){let l=t.readInfo();switch(31&l){case 0:{let d=t.readLen();i[u]=new oe(R(c,a),d),a+=d;break}case 10:{let d=T(t.restDecoder);i[u]=new X(R(c,a),d),a+=d;break}default:{let d=(l&192)===0,f=new k(R(c,a),null,(l&128)===128?t.readLeftID():null,null,(l&64)===64?t.readRightID():null,d?t.readParentInfo()?e.get(t.readString()):t.readLeftID():null,d&&(l&32)===32?t.readString():null,cu(t,l));i[u]=f,a+=f.length}}}}return r},rg=(t,e,r)=>{let n=[],o=ve(r.keys()).sort((h,p)=>h-p);if(o.length===0)return null;let s=()=>{if(o.length===0)return null;let h=r.get(o[o.length-1]);for(;h.refs.length===h.i;)if(o.pop(),o.length>0)h=r.get(o[o.length-1]);else return null;return h},i=s();if(i===null)return null;let c=new io,a=new Map,u=(h,p)=>{let g=a.get(h);(g==null||g>p)&&a.set(h,p)},l=i.refs[i.i++],d=new Map,f=()=>{for(let h of n){let p=h.id.client,g=r.get(p);g?(g.i--,c.clients.set(p,g.refs.slice(g.i)),r.delete(p),g.i=0,g.refs=[]):c.clients.set(p,[h]),o=o.filter(m=>m!==p)}n.length=0};for(;;){if(l.constructor!==X){let p=K(d,l.id.client,()=>L(e,l.id.client))-l.id.clock;if(p<0)n.push(l),u(l.id.client,l.id.clock-1),f();else{let g=l.getMissing(t,e);if(g!==null){n.push(l);let m=r.get(g)||{refs:[],i:0};if(m.refs.length===m.i)u(g,L(e,g)),f();else{l=m.refs[m.i++];continue}}else(p===0||p<l.length)&&(l.integrate(t,p),d.set(l.id.client,l.id.clock+l.length))}}if(n.length>0)l=n.pop();else if(i!==null&&i.i<i.refs.length)l=i.refs[i.i++];else{if(i=s(),i===null)break;l=i.refs[i.i++]}}if(c.clients.size>0){let h=new ge;return ui(h,c,new Map),v(h.restEncoder,0),{missing:a,update:h.toUint8Array()}}return null},ng=(t,e)=>ui(t,e.doc.store,e.beforeState),di=(t,e,r,n=new ae(t))=>D(e,o=>{o.local=!1;let s=!1,i=o.doc,c=i.store,a=tg(n,i),u=rg(o,c,a),l=c.pendingStructs;if(l){for(let[f,h]of l.missing)if(h<L(c,f)){s=!0;break}if(u){for(let[f,h]of u.missing){let p=l.missing.get(f);(p==null||p>h)&&l.missing.set(f,h)}l.update=Bt([l.update,u.update])}}else c.pendingStructs=u;let d=al(n,o,c);if(c.pendingDs){let f=new ae(G(c.pendingDs));T(f.restDecoder);let h=al(f,o,c);d&&h?c.pendingDs=Bt([d,h]):c.pendingDs=d||h}else c.pendingDs=d;if(s){let f=c.pendingStructs.update;c.pendingStructs=null,Be(o.doc,f)}},r,!1),og=(t,e,r)=>di(t,e,r,new he(t)),Be=(t,e,r,n=ae)=>{let o=G(e);di(o,t,r,new n(o))},fi=(t,e,r)=>Be(t,e,r,he),sg=(t,e,r=new Map)=>{ui(t,e.store,r),Pe(t,li(e.store))},ht=(t,e=new Uint8Array([0]),r=new ge)=>{let n=pi(e);sg(r,t,n);let o=[r.toUint8Array()];if(t.store.pendingDs&&o.push(t.store.pendingDs),t.store.pendingStructs&&o.push(wi(t.store.pendingStructs.update,e)),o.length>1){if(r.constructor===Ne)return Ml(o.map((s,i)=>i===0?s:Fl(s)));if(r.constructor===ge)return Bt(o)}return o[0]},hi=(t,e)=>ht(t,e,new Ne),Rl=t=>{let e=new Map,r=T(t.restDecoder);for(let n=0;n<r;n++){let o=T(t.restDecoder),s=T(t.restDecoder);e.set(o,s)}return e},pi=t=>Rl(new Nt(G(t))),gi=(t,e)=>(v(t.restEncoder,e.size),ve(e.entries()).sort((r,n)=>n[0]-r[0]).forEach(([r,n])=>{v(t.restEncoder,r),v(t.restEncoder,n)}),t),ig=(t,e)=>gi(t,mn(e.store)),cg=(t,e=new wr)=>(t instanceof Map?gi(e,t):ig(e,t),e.toUint8Array()),mi=t=>cg(t,new dt),Zs=class{constructor(){this.l=[]}},ll=()=>new Zs,ul=(t,e)=>t.l.push(e),dl=(t,e)=>{let r=t.l,n=r.length;t.l=r.filter(o=>e!==o),n===t.l.length&&console.error("[yjs] Tried to remove event handler that doesn't exist.")},Tl=(t,e,r)=>Zr(t.l,[e,r]),$e=class{constructor(e,r){this.client=e,this.clock=r}},Ut=(t,e)=>t===e||t!==null&&e!==null&&t.client===e.client&&t.clock===e.clock,R=(t,e)=>new $e(t,e),fl=(t,e)=>{v(t,e.client),v(t,e.clock)},hl=t=>R(T(t),T(t)),yi=t=>{for(let[e,r]of t.doc.share.entries())if(r===t)return e;throw ce()},an=(t,e)=>{for(;e!==null;){if(e.parent===t)return!0;e=e.parent._item}return!1},ag=t=>{let e=[],r=t._start;for(;r;)e.push(r),r=r.right;console.log("Children: ",e),console.log("Children content: ",e.filter(n=>!n.deleted).map(n=>n.content))},ei=class{constructor(e,r=e.getMap("users")){let n=new Map;this.yusers=r,this.doc=e,this.clients=new Map,this.dss=n;let o=(s,i)=>{let c=s.get("ds"),a=s.get("ids"),u=l=>this.clients.set(l,i);c.observe(l=>{l.changes.added.forEach(d=>{d.content.getContent().forEach(f=>{f instanceof Uint8Array&&this.dss.set(i,Mt([this.dss.get(i)||yo(),ze(new Nt(G(f)))]))})})}),this.dss.set(i,Mt(c.map(l=>ze(new Nt(G(l)))))),a.observe(l=>l.changes.added.forEach(d=>d.content.getContent().forEach(u))),a.forEach(u)};r.observe(s=>{s.keysChanged.forEach(i=>o(r.get(i),i))}),r.forEach(o)}setUserMapping(e,r,n,{filter:o=()=>!0}={}){let s=this.yusers,i=s.get(n);i||(i=new Yt,i.set("ids",new Ft),i.set("ds",new Ft),s.set(n,i)),i.get("ids").push([r]),s.observe(c=>{setTimeout(()=>{let a=s.get(n);if(a!==i){i=a,this.clients.forEach((d,f)=>{n===d&&i.get("ids").push([f])});let u=new dt,l=this.dss.get(n);l&&(Pe(u,l),i.get("ds").push([u.toUint8Array()]))}},0)}),e.on("afterTransaction",c=>{setTimeout(()=>{let a=i.get("ds"),u=c.deleteSet;if(c.local&&u.clients.size>0&&o(c,u)){let l=new dt;Pe(l,u),a.push([l.toUint8Array()])}})})}getUserByClientId(e){return this.clients.get(e)||null}getUserByDeletedId(e){for(let[r,n]of this.dss.entries())if(Ht(n,e))return r;return null}},_r=class{constructor(e,r,n,o=0){this.type=e,this.tname=r,this.item=n,this.assoc=o}},lg=t=>{let e={};return t.type&&(e.type=t.type),t.tname&&(e.tname=t.tname),t.item&&(e.item=t.item),t.assoc!=null&&(e.assoc=t.assoc),e},ug=t=>new _r(t.type==null?null:R(t.type.client,t.type.clock),t.tname??null,t.item==null?null:R(t.item.client,t.item.clock),t.assoc==null?0:t.assoc),so=class{constructor(e,r,n=0){this.type=e,this.index=r,this.assoc=n}},dg=(t,e,r=0)=>new so(t,e,r),Zn=(t,e,r)=>{let n=null,o=null;return t._item===null?o=yi(t):n=R(t._item.id.client,t._item.id.clock),new _r(n,o,e,r)},fg=(t,e,r=0)=>{let n=t._start;if(r<0){if(e===0)return Zn(t,null,r);e--}for(;n!==null;){if(!n.deleted&&n.countable){if(n.length>e)return Zn(t,R(n.id.client,n.id.clock+e),r);e-=n.length}if(n.right===null&&r<0)return Zn(t,n.lastId,r);n=n.right}return Zn(t,null,r)},hg=(t,e)=>{let{type:r,tname:n,item:o,assoc:s}=e;if(o!==null)v(t,0),fl(t,o);else if(n!==null)fr(t,1),nt(t,n);else if(r!==null)fr(t,2),fl(t,r);else throw ce();return Wr(t,s),t},pg=t=>{let e=Ce();return hg(e,t),re(e)},gg=t=>{let e=null,r=null,n=null;switch(T(t)){case 0:n=hl(t);break;case 1:r=st(t);break;case 2:e=hl(t)}let o=Is(t)?Qr(t):0;return new _r(e,r,n,o)},mg=t=>gg(G(t)),yg=(t,e)=>{let r=Lt(t,e),n=e.clock-r.id.clock;return{item:r,diff:n}},Eg=(t,e,r=!0)=>{let n=e.store,o=t.item,s=t.type,i=t.tname,c=t.assoc,a=null,u=0;if(o!==null){if(L(n,o.client)<=o.clock)return null;let l=r?ii(n,o):yg(n,o),d=l.item;if(!(d instanceof k))return null;if(a=d.parent,a._item===null||!a._item.deleted){u=d.deleted||!d.countable?0:l.diff+(c>=0?0:1);let f=d.left;for(;f!==null;)!f.deleted&&f.countable&&(u+=f.length),f=f.left}}else{if(i!==null)a=e.get(i);else if(s!==null){if(L(n,s.client)<=s.clock)return null;let{item:l}=r?ii(n,s):{item:Lt(n,s)};if(l instanceof k&&l.content instanceof we)a=l.content.type;else return null}else throw ce();c>=0?u=a._length:u=0}return dg(a,u,t.assoc)},wg=(t,e)=>t===e||t!==null&&e!==null&&t.tname===e.tname&&Ut(t.item,e.item)&&Ut(t.type,e.type)&&t.assoc===e.assoc,ln=class{constructor(e,r){this.ds=e,this.sv=r}},_g=(t,e)=>{let r=t.ds.clients,n=e.ds.clients,o=t.sv,s=e.sv;if(o.size!==s.size||r.size!==n.size)return!1;for(let[i,c]of o.entries())if(s.get(i)!==c)return!1;for(let[i,c]of r.entries()){let a=n.get(i)||[];if(c.length!==a.length)return!1;for(let u=0;u<c.length;u++){let l=c[u],d=a[u];if(l.clock!==d.clock||l.len!==d.len)return!1}}return!0},xl=(t,e=new wr)=>(Pe(e,t.ds),gi(e,t.sv),e.toUint8Array()),Sg=t=>xl(t,new dt),Il=(t,e=new oo(G(t)))=>new ln(ze(e),Rl(e)),bg=t=>Il(t,new Nt(G(t))),Ei=(t,e)=>new ln(t,e),vg=Ei(yo(),new Map),Cg=t=>Ei(li(t.store),mn(t.store)),ct=(t,e)=>e===void 0?!t.deleted:e.sv.has(t.id.client)&&(e.sv.get(t.id.client)||0)>t.id.clock&&!Ht(e.ds,t.id),ti=(t,e)=>{let r=K(t.meta,ti,De),n=t.doc.store;r.has(e)||(e.sv.forEach((o,s)=>{o<L(n,s)&&ne(t,R(s,o))}),Pt(t,e.ds,o=>{}),r.add(e))},Rg=(t,e,r=new Me)=>{if(t.gc)throw new Error("Garbage-collection must be disabled in `originDoc`!");let{sv:n,ds:o}=e,s=new ge;return t.transact(i=>{let c=0;n.forEach(a=>{a>0&&c++}),v(s.restEncoder,c);for(let[a,u]of n){if(u===0)continue;u<L(t.store,a)&&ne(i,R(a,u));let l=t.store.clients.get(a)||[],d=Ee(l,u-1);v(s.restEncoder,d+1),s.writeClient(a),v(s.restEncoder,0);for(let f=0;f<=d;f++)l[f].write(s,0)}Pe(s,o)}),Be(r,s.toUint8Array(),"snapshot"),r},Tg=(t,e,r=ae)=>{let n=new r(G(e)),o=new Ve(n,!1);for(let i=o.curr;i!==null;i=o.next())if((t.sv.get(i.id.client)||0)<i.id.clock+i.length)return!1;let s=Mt([t.ds,ze(n)]);return vl(t.ds,s)},xg=(t,e)=>Tg(t,e,he),io=class{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}},mn=t=>{let e=new Map;return t.clients.forEach((r,n)=>{let o=r[r.length-1];e.set(n,o.id.clock+o.length)}),e},L=(t,e)=>{let r=t.clients.get(e);if(r===void 0)return 0;let n=r[r.length-1];return n.id.clock+n.length},Al=(t,e)=>{let r=t.clients.get(e.id.client);if(r===void 0)r=[],t.clients.set(e.id.client,r);else{let n=r[r.length-1];if(n.id.clock+n.length!==e.id.clock)throw ce()}r.push(e)},Ee=(t,e)=>{let r=0,n=t.length-1,o=t[n],s=o.id.clock;if(s===e)return n;let i=fe(e/(s+o.length-1)*n);for(;r<=n;){if(o=t[i],s=o.id.clock,s<=e){if(e<s+o.length)return i;r=i+1}else n=i-1;i=fe((r+n)/2)}throw ce()},Ig=(t,e)=>{let r=t.clients.get(e.client);return r[Ee(r,e.clock)]},Lt=Ig,ri=(t,e,r)=>{let n=Ee(e,r),o=e[n];return o.id.clock<r&&o instanceof k?(e.splice(n+1,0,mo(t,o,r-o.id.clock)),n+1):n},ne=(t,e)=>{let r=t.doc.store.clients.get(e.client);return r[ri(t,r,e.clock)]},ni=(t,e,r)=>{let n=e.clients.get(r.client),o=Ee(n,r.clock),s=n[o];return r.clock!==s.id.clock+s.length-1&&s.constructor!==oe&&n.splice(o+1,0,mo(t,s,r.clock-s.id.clock+1)),s},Ag=(t,e,r)=>{let n=t.clients.get(e.id.client);n[Ee(n,e.id.clock)]=r},Dl=(t,e,r,n,o)=>{if(n===0)return;let s=r+n,i=ri(t,e,r),c;do c=e[i++],s<c.id.clock+c.length&&ri(t,e,s),o(c);while(i<e.length&&e[i].id.clock<s)},co=class{constructor(e,r,n){this.doc=e,this.deleteSet=new ut,this.beforeState=mn(e.store),this.afterState=new Map,this.changed=new Map,this.changedParentTypes=new Map,this._mergeStructs=[],this.origin=r,this.meta=new Map,this.local=n,this.subdocsAdded=new Set,this.subdocsRemoved=new Set,this.subdocsLoaded=new Set,this._needFormattingCleanup=!1}},pl=(t,e)=>e.deleteSet.clients.size===0&&!_a(e.afterState,(r,n)=>e.beforeState.get(n)!==r)?!1:(ai(e.deleteSet),ng(t,e),Pe(t,e.deleteSet),!0),gl=(t,e,r)=>{let n=e._item;(n===null||n.id.clock<(t.beforeState.get(n.id.client)||0)&&!n.deleted)&&K(t.changed,e,De).add(r)},ro=(t,e)=>{let r=t[e],n=t[e-1],o=e;for(;o>0;r=n,n=t[--o-1]){if(n.deleted===r.deleted&&n.constructor===r.constructor&&n.mergeWith(r)){r instanceof k&&r.parentSub!==null&&r.parent._map.get(r.parentSub)===r&&r.parent._map.set(r.parentSub,n);continue}break}let s=e-o;return s&&t.splice(e+1-s,s),s},kl=(t,e,r)=>{for(let[n,o]of t.clients.entries()){let s=e.clients.get(n);for(let i=o.length-1;i>=0;i--){let c=o[i],a=c.clock+c.len;for(let u=Ee(s,c.clock),l=s[u];u<s.length&&l.id.clock<a;l=s[++u]){let d=s[u];if(c.clock+c.len<=d.id.clock)break;d instanceof k&&d.deleted&&!d.keep&&r(d)&&d.gc(e,!1)}}}},Ol=(t,e)=>{t.clients.forEach((r,n)=>{let o=e.clients.get(n);for(let s=r.length-1;s>=0;s--){let i=r[s],c=Kn(o.length-1,1+Ee(o,i.clock+i.len-1));for(let a=c,u=o[a];a>0&&u.id.clock>=i.clock;u=o[a])a-=1+ro(o,a)}})},Dg=(t,e,r)=>{kl(t,e,r),Ol(t,e)},Ul=(t,e)=>{if(e<t.length){let r=t[e],n=r.doc,o=n.store,s=r.deleteSet,i=r._mergeStructs;try{ai(s),r.afterState=mn(r.doc.store),n.emit("beforeObserverCalls",[r,n]);let c=[];r.changed.forEach((a,u)=>c.push(()=>{(u._item===null||!u._item.deleted)&&u._callObserver(r,a)})),c.push(()=>{r.changedParentTypes.forEach((a,u)=>{u._dEH.l.length>0&&(u._item===null||!u._item.deleted)&&(a=a.filter(l=>l.target._item===null||!l.target._item.deleted),a.forEach(l=>{l.currentTarget=u,l._path=null}),a.sort((l,d)=>l.path.length-d.path.length),c.push(()=>{Tl(u._dEH,a,r)}))}),c.push(()=>n.emit("afterTransaction",[r,n])),c.push(()=>{r._needFormattingCleanup&&Xg(r)})}),Zr(c,[])}finally{n.gc&&kl(s,o,n.gcFilter),Ol(s,o),r.afterState.forEach((l,d)=>{let f=r.beforeState.get(d)||0;if(f!==l){let h=o.clients.get(d),p=Ge(Ee(h,f),1);for(let g=h.length-1;g>=p;)g-=1+ro(h,g)}});for(let l=i.length-1;l>=0;l--){let{client:d,clock:f}=i[l].id,h=o.clients.get(d),p=Ee(h,f);p+1<h.length&&ro(h,p+1)>1||p>0&&ro(h,p)}if(!r.local&&r.afterState.get(n.clientID)!==r.beforeState.get(n.clientID)&&(Qn(Er,tn,"[yjs] ",rn,nn,"Changed the client-id because another client seems to be using it."),n.clientID=Cl()),n.emit("afterTransactionCleanup",[r,n]),n._observers.has("update")){let l=new Ne;pl(l,r)&&n.emit("update",[l.toUint8Array(),r.origin,n,r])}if(n._observers.has("updateV2")){let l=new ge;pl(l,r)&&n.emit("updateV2",[l.toUint8Array(),r.origin,n,r])}let{subdocsAdded:c,subdocsLoaded:a,subdocsRemoved:u}=r;(c.size>0||u.size>0||a.size>0)&&(c.forEach(l=>{l.clientID=n.clientID,l.collectionid==null&&(l.collectionid=n.collectionid),n.subdocs.add(l)}),u.forEach(l=>n.subdocs.delete(l)),n.emit("subdocs",[{loaded:a,added:c,removed:u},n,r]),u.forEach(l=>l.destroy())),t.length<=e+1?(n._transactionCleanups=[],n.emit("afterAllTransactions",[n,t])):Ul(t,e+1)}}},D=(t,e,r=null,n=!0)=>{let o=t._transactionCleanups,s=!1,i=null;t._transaction===null&&(s=!0,t._transaction=new co(t,r,n),o.push(t._transaction),o.length===1&&t.emit("beforeAllTransactions",[t]),t.emit("beforeTransaction",[t._transaction,t]));try{i=e(t._transaction)}finally{if(s){let c=t._transaction===o[0];t._transaction=null,c&&Ul(o,0)}}return i},oi=class{constructor(e,r){this.insertions=r,this.deletions=e,this.meta=new Map}},ml=(t,e,r)=>{Pt(t,r.deletions,n=>{n instanceof k&&e.scope.some(o=>o===t.doc||an(o,n))&&Ci(n,!1)})},yl=(t,e,r)=>{let n=null,o=t.doc,s=t.scope;D(o,c=>{for(;e.length>0&&t.currStackItem===null;){let a=o.store,u=e.pop(),l=new Set,d=[],f=!1;Pt(c,u.insertions,h=>{if(h instanceof k){if(h.redone!==null){let{item:p,diff:g}=ii(a,h.id);g>0&&(p=ne(c,R(p.id.client,p.id.clock+g))),h=p}!h.deleted&&s.some(p=>p===c.doc||an(p,h))&&d.push(h)}}),Pt(c,u.deletions,h=>{h instanceof k&&s.some(p=>p===c.doc||an(p,h))&&!Ht(u.insertions,h.id)&&l.add(h)}),l.forEach(h=>{f=iu(c,h,l,u.insertions,t.ignoreRemoteMapChanges,t)!==null||f});for(let h=d.length-1;h>=0;h--){let p=d[h];t.deleteFilter(p)&&(p.delete(c),f=!0)}t.currStackItem=f?u:null}c.changed.forEach((a,u)=>{a.has(null)&&u._searchMarker&&(u._searchMarker.length=0)}),n=c},t);let i=t.currStackItem;if(i!=null){let c=n.changedParentTypes;t.emit("stack-item-popped",[{stackItem:i,type:r,changedParentTypes:c,origin:t},t]),t.currStackItem=null}return i},Vt=class extends rt{constructor(e,{captureTimeout:r=500,captureTransaction:n=a=>!0,deleteFilter:o=()=>!0,trackedOrigins:s=new Set([null]),ignoreRemoteMapChanges:i=!1,doc:c=xt(e)?e[0].doc:e instanceof Me?e:e.doc}={}){super(),this.scope=[],this.doc=c,this.addToScope(e),this.deleteFilter=o,s.add(this),this.trackedOrigins=s,this.captureTransaction=n,this.undoStack=[],this.redoStack=[],this.undoing=!1,this.redoing=!1,this.currStackItem=null,this.lastChange=0,this.ignoreRemoteMapChanges=i,this.captureTimeout=r,this.afterTransactionHandler=a=>{if(!this.captureTransaction(a)||!this.scope.some(m=>a.changedParentTypes.has(m)||m===this.doc)||!this.trackedOrigins.has(a.origin)&&(!a.origin||!this.trackedOrigins.has(a.origin.constructor)))return;let u=this.undoing,l=this.redoing,d=u?this.redoStack:this.undoStack;u?this.stopCapturing():l||this.clear(!1,!0);let f=new ut;a.afterState.forEach((m,y)=>{let E=a.beforeState.get(y)||0,_=m-E;_>0&&cn(f,y,E,_)});let h=it(),p=!1;if(this.lastChange>0&&h-this.lastChange<this.captureTimeout&&d.length>0&&!u&&!l){let m=d[d.length-1];m.deletions=Mt([m.deletions,a.deleteSet]),m.insertions=Mt([m.insertions,f])}else d.push(new oi(a.deleteSet,f)),p=!0;!u&&!l&&(this.lastChange=h),Pt(a,a.deleteSet,m=>{m instanceof k&&this.scope.some(y=>y===a.doc||an(y,m))&&Ci(m,!0)});let g=[{stackItem:d[d.length-1],origin:a.origin,type:u?"redo":"undo",changedParentTypes:a.changedParentTypes},this];p?this.emit("stack-item-added",g):this.emit("stack-item-updated",g)},this.doc.on("afterTransaction",this.afterTransactionHandler),this.doc.on("destroy",()=>{this.destroy()})}addToScope(e){let r=new Set(this.scope);e=xt(e)?e:[e],e.forEach(n=>{r.has(n)||(r.add(n),(n instanceof F?n.doc!==this.doc:n!==this.doc)&&Js("[yjs#509] Not same Y.Doc"),this.scope.push(n))})}addTrackedOrigin(e){this.trackedOrigins.add(e)}removeTrackedOrigin(e){this.trackedOrigins.delete(e)}clear(e=!0,r=!0){(e&&this.canUndo()||r&&this.canRedo())&&this.doc.transact(n=>{e&&(this.undoStack.forEach(o=>ml(n,this,o)),this.undoStack=[]),r&&(this.redoStack.forEach(o=>ml(n,this,o)),this.redoStack=[]),this.emit("stack-cleared",[{undoStackCleared:e,redoStackCleared:r}])})}stopCapturing(){this.lastChange=0}undo(){this.undoing=!0;let e;try{e=yl(this,this.undoStack,"undo")}finally{this.undoing=!1}return e}redo(){this.redoing=!0;let e;try{e=yl(this,this.redoStack,"redo")}finally{this.redoing=!1}return e}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}destroy(){this.trackedOrigins.delete(this),this.doc.off("afterTransaction",this.afterTransactionHandler),super.destroy()}};function*kg(t){let e=T(t.restDecoder);for(let r=0;r<e;r++){let n=T(t.restDecoder),o=t.readClient(),s=T(t.restDecoder);for(let i=0;i<n;i++){let c=t.readInfo();if(c===10){let a=T(t.restDecoder);yield new X(R(o,s),a),s+=a}else if((31&c)!==0){let a=(c&192)===0,u=new k(R(o,s),null,(c&128)===128?t.readLeftID():null,null,(c&64)===64?t.readRightID():null,a?t.readParentInfo()?t.readString():t.readLeftID():null,a&&(c&32)===32?t.readString():null,cu(t,c));yield u,s+=u.length}else{let a=t.readLen();yield new oe(R(o,s),a),s+=a}}}}var Ve=class{constructor(e,r){this.gen=kg(e),this.curr=null,this.done=!1,this.filterSkips=r,this.next()}next(){do this.curr=this.gen.next().value||null;while(this.filterSkips&&this.curr!==null&&this.curr.constructor===X);return this.curr}},Og=t=>Ll(t,he),Ll=(t,e=ae)=>{let r=[],n=new e(G(t)),o=new Ve(n,!1);for(let i=o.curr;i!==null;i=o.next())r.push(i);Qn("Structs: ",r);let s=ze(n);Qn("DeleteSet: ",s)},Ug=t=>Pl(t,he),Pl=(t,e=ae)=>{let r=[],n=new e(G(t)),o=new Ve(n,!1);for(let s=o.curr;s!==null;s=o.next())r.push(s);return{structs:r,ds:ze(n)}},un=class{constructor(e){this.currClient=0,this.startClock=0,this.written=0,this.encoder=e,this.clientStructs=[]}},Ml=t=>Bt(t,he,Ne),Nl=(t,e=wr,r=ae)=>{let n=new e,o=new Ve(new r(G(t)),!1),s=o.curr;if(s!==null){let i=0,c=s.id.client,a=s.id.clock!==0,u=a?0:s.id.clock+s.length;for(;s!==null;s=o.next())c!==s.id.client&&(u!==0&&(i++,v(n.restEncoder,c),v(n.restEncoder,u)),c=s.id.client,u=0,a=s.id.clock!==0),s.constructor===X&&(a=!0),a||(u=s.id.clock+s.length);u!==0&&(i++,v(n.restEncoder,c),v(n.restEncoder,u));let l=Ce();return v(l,i),Oa(l,n.restEncoder),n.restEncoder=l,n.toUint8Array()}else return v(n.restEncoder,0),n.toUint8Array()},Lg=t=>Nl(t,dt,he),Vl=(t,e=ae)=>{let r=new Map,n=new Map,o=new Ve(new e(G(t)),!1),s=o.curr;if(s!==null){let i=s.id.client,c=s.id.clock;for(r.set(i,c);s!==null;s=o.next())i!==s.id.client&&(n.set(i,c),r.set(s.id.client,s.id.clock),i=s.id.client),c=s.id.clock+s.length;n.set(i,c)}return{from:r,to:n}},Pg=t=>Vl(t,he),Mg=(t,e)=>{if(t.constructor===oe){let{client:r,clock:n}=t.id;return new oe(R(r,n+e),t.length-e)}else if(t.constructor===X){let{client:r,clock:n}=t.id;return new X(R(r,n+e),t.length-e)}else{let r=t,{client:n,clock:o}=r.id;return new k(R(n,o+e),null,R(n,o+e-1),null,r.rightOrigin,r.parent,r.parentSub,r.content.splice(e))}},Bt=(t,e=ae,r=ge)=>{if(t.length===1)return t[0];let n=t.map(l=>new e(G(l))),o=n.map(l=>new Ve(l,!0)),s=null,i=new r,c=new un(i);for(;o=o.filter(f=>f.curr!==null),o.sort((f,h)=>{if(f.curr.id.client===h.curr.id.client){let p=f.curr.id.clock-h.curr.id.clock;return p===0?f.curr.constructor===h.curr.constructor?0:f.curr.constructor===X?1:-1:p}else return h.curr.id.client-f.curr.id.client}),o.length!==0;){let l=o[0],d=l.curr.id.client;if(s!==null){let f=l.curr,h=!1;for(;f!==null&&f.id.clock+f.length<=s.struct.id.clock+s.struct.length&&f.id.client>=s.struct.id.client;)f=l.next(),h=!0;if(f===null||f.id.client!==d||h&&f.id.clock>s.struct.id.clock+s.struct.length)continue;if(d!==s.struct.id.client)at(c,s.struct,s.offset),s={struct:f,offset:0},l.next();else if(s.struct.id.clock+s.struct.length<f.id.clock)if(s.struct.constructor===X)s.struct.length=f.id.clock+f.length-s.struct.id.clock;else{at(c,s.struct,s.offset);let p=f.id.clock-s.struct.id.clock-s.struct.length;s={struct:new X(R(d,s.struct.id.clock+s.struct.length),p),offset:0}}else{let p=s.struct.id.clock+s.struct.length-f.id.clock;p>0&&(s.struct.constructor===X?s.struct.length-=p:f=Mg(f,p)),s.struct.mergeWith(f)||(at(c,s.struct,s.offset),s={struct:f,offset:0},l.next())}}else s={struct:l.curr,offset:0},l.next();for(let f=l.curr;f!==null&&f.id.client===d&&f.id.clock===s.struct.id.clock+s.struct.length&&f.constructor!==X;f=l.next())at(c,s.struct,s.offset),s={struct:f,offset:0}}s!==null&&(at(c,s.struct,s.offset),s=null),_i(c);let a=n.map(l=>ze(l)),u=Mt(a);return Pe(i,u),i.toUint8Array()},wi=(t,e,r=ae,n=ge)=>{let o=pi(e),s=new n,i=new un(s),c=new r(G(t)),a=new Ve(c,!1);for(;a.curr;){let l=a.curr,d=l.id.client,f=o.get(d)||0;if(a.curr.constructor===X){a.next();continue}if(l.id.clock+l.length>f)for(at(i,l,Ge(f-l.id.clock,0)),a.next();a.curr&&a.curr.id.client===d;)at(i,a.curr,0),a.next();else for(;a.curr&&a.curr.id.client===d&&a.curr.id.clock+a.curr.length<=f;)a.next()}_i(i);let u=ze(c);return Pe(s,u),s.toUint8Array()},Ng=(t,e)=>wi(t,e,he,Ne),Bl=t=>{t.written>0&&(t.clientStructs.push({written:t.written,restEncoder:re(t.encoder.restEncoder)}),t.encoder.restEncoder=Ce(),t.written=0)},at=(t,e,r)=>{t.written>0&&t.currClient!==e.id.client&&Bl(t),t.written===0&&(t.currClient=e.id.client,t.encoder.writeClient(e.id.client),v(t.encoder.restEncoder,e.id.clock+r)),e.write(t.encoder,r),t.written++},_i=t=>{Bl(t);let e=t.encoder.restEncoder;v(e,t.clientStructs.length);for(let r=0;r<t.clientStructs.length;r++){let n=t.clientStructs[r];v(e,n.written),hr(e,n.restEncoder)}},Eo=(t,e,r,n)=>{let o=new r(G(t)),s=new Ve(o,!1),i=new n,c=new un(i);for(let u=s.curr;u!==null;u=s.next())at(c,e(u),0);_i(c);let a=ze(o);return Pe(i,a),i.toUint8Array()},jl=({formatting:t=!0,subdocs:e=!0,yxml:r=!0}={})=>{let n=0,o=V(),s=V(),i=V(),c=V();return c.set(null,null),a=>{switch(a.constructor){case oe:case X:return a;case k:{let u=a,l=u.content;switch(l.constructor){case vr:break;case we:{if(r){let d=l.type;d instanceof $t&&(d.nodeName=K(s,d.nodeName,()=>"node-"+n)),d instanceof pn&&(d.hookName=K(s,d.hookName,()=>"hook-"+n))}break}case ft:{let d=l;d.arr=d.arr.map(()=>n);break}case zt:{let d=l;d.content=new Uint8Array([n]);break}case Kt:{let d=l;e&&(d.opts={},d.doc.guid=n+"");break}case Ke:{let d=l;d.embed={};break}case Y:{let d=l;t&&(d.key=K(i,d.key,()=>n+""),d.value=K(c,d.value,()=>({i:n})));break}case gn:{let d=l;d.arr=d.arr.map(()=>n);break}case Te:{let d=l;d.str=xa(n%10+"",d.str.length);break}default:ce()}return u.parentSub&&(u.parentSub=K(o,u.parentSub,()=>n+"")),n++,a}default:ce()}}},Vg=(t,e)=>Eo(t,jl(e),he,Ne),Bg=(t,e)=>Eo(t,jl(e),ae,ge),jg=t=>Eo(t,js,he,ge),Fl=t=>Eo(t,js,ae,Ne),El="You must not compute changes after the event-handler fired.",jt=class{constructor(e,r){this.target=e,this.currentTarget=e,this.transaction=r,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||(this._path=Fg(this.currentTarget,this.target))}deletes(e){return Ht(this.transaction.deleteSet,e.id)}get keys(){if(this._keys===null){if(this.transaction.doc._transactionCleanups.length===0)throw ke(El);let e=new Map,r=this.target;this.transaction.changed.get(r).forEach(o=>{if(o!==null){let s=r._map.get(o),i,c;if(this.adds(s)){let a=s.left;for(;a!==null&&this.adds(a);)a=a.left;if(this.deletes(s))if(a!==null&&this.deletes(a))i="delete",c=zn(a.content.getContent());else return;else a!==null&&this.deletes(a)?(i="update",c=zn(a.content.getContent())):(i="add",c=void 0)}else if(this.deletes(s))i="delete",c=zn(s.content.getContent());else return;e.set(o,{action:i,oldValue:c})}}),this._keys=e}return this._keys}get delta(){return this.changes.delta}adds(e){return e.id.clock>=(this.transaction.beforeState.get(e.id.client)||0)}get changes(){let e=this._changes;if(e===null){if(this.transaction.doc._transactionCleanups.length===0)throw ke(El);let r=this.target,n=De(),o=De(),s=[];if(e={added:n,deleted:o,delta:s,keys:this.keys},this.transaction.changed.get(r).has(null)){let c=null,a=()=>{c&&s.push(c)};for(let u=r._start;u!==null;u=u.right)u.deleted?this.deletes(u)&&!this.adds(u)&&((c===null||c.delete===void 0)&&(a(),c={delete:0}),c.delete+=u.length,o.add(u)):this.adds(u)?((c===null||c.insert===void 0)&&(a(),c={insert:[]}),c.insert=c.insert.concat(u.content.getContent()),n.add(u)):((c===null||c.retain===void 0)&&(a(),c={retain:0}),c.retain+=u.length);c!==null&&c.retain===void 0&&a()}this._changes=e}return e}},Fg=(t,e)=>{let r=[];for(;e._item!==null&&e!==t;){if(e._item.parentSub!==null)r.unshift(e._item.parentSub);else{let n=0,o=e._item.parent._start;for(;o!==e._item&&o!==null;)!o.deleted&&o.countable&&(n+=o.length),o=o.right;r.unshift(n)}e=e._item.parent}return r},Z=()=>{Js("Invalid access: Add Yjs type to a document before reading data.")},Yl=80,Si=0,si=class{constructor(e,r){e.marker=!0,this.p=e,this.index=r,this.timestamp=Si++}},Yg=t=>{t.timestamp=Si++},Gl=(t,e,r)=>{t.p.marker=!1,t.p=e,e.marker=!0,t.index=r,t.timestamp=Si++},Gg=(t,e,r)=>{if(t.length>=Yl){let n=t.reduce((o,s)=>o.timestamp<s.timestamp?o:s);return Gl(n,e,r),n}else{let n=new si(e,r);return t.push(n),n}},wo=(t,e)=>{if(t._start===null||e===0||t._searchMarker===null)return null;let r=t._searchMarker.length===0?null:t._searchMarker.reduce((s,i)=>ir(e-s.index)<ir(e-i.index)?s:i),n=t._start,o=0;for(r!==null&&(n=r.p,o=r.index,Yg(r));n.right!==null&&o<e;){if(!n.deleted&&n.countable){if(e<o+n.length)break;o+=n.length}n=n.right}for(;n.left!==null&&o>e;)n=n.left,!n.deleted&&n.countable&&(o-=n.length);for(;n.left!==null&&n.left.id.client===n.id.client&&n.left.id.clock+n.left.length===n.id.clock;)n=n.left,!n.deleted&&n.countable&&(o-=n.length);return r!==null&&ir(r.index-o)<n.parent.length/Yl?(Gl(r,n,o),r):Gg(t._searchMarker,n,o)},dn=(t,e,r)=>{for(let n=t.length-1;n>=0;n--){let o=t[n];if(r>0){let s=o.p;for(s.marker=!1;s&&(s.deleted||!s.countable);)s=s.left,s&&!s.deleted&&s.countable&&(o.index-=s.length);if(s===null||s.marker===!0){t.splice(n,1);continue}o.p=s,s.marker=!0}(e<o.index||r>0&&e===o.index)&&(o.index=Ge(e,o.index+r))}},$g=t=>{t.doc??Z();let e=t._start,r=[];for(;e;)r.push(e),e=e.right;return r},_o=(t,e,r)=>{let n=t,o=e.changedParentTypes;for(;K(o,t,()=>[]).push(r),t._item!==null;)t=t._item.parent;Tl(n._eH,r,e)},F=class{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=ll(),this._dEH=ll(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(e,r){this.doc=e,this._item=r}_copy(){throw Re()}clone(){throw Re()}_write(e){}get _first(){let e=this._start;for(;e!==null&&e.deleted;)e=e.right;return e}_callObserver(e,r){!e.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(e){ul(this._eH,e)}observeDeep(e){ul(this._dEH,e)}unobserve(e){dl(this._eH,e)}unobserveDeep(e){dl(this._dEH,e)}toJSON(){}},$l=(t,e,r)=>{t.doc??Z(),e<0&&(e=t._length+e),r<0&&(r=t._length+r);let n=r-e,o=[],s=t._start;for(;s!==null&&n>0;){if(s.countable&&!s.deleted){let i=s.content.getContent();if(i.length<=e)e-=i.length;else{for(let c=e;c<i.length&&n>0;c++)o.push(i[c]),n--;e=0}}s=s.right}return o},zl=t=>{t.doc??Z();let e=[],r=t._start;for(;r!==null;){if(r.countable&&!r.deleted){let n=r.content.getContent();for(let o=0;o<n.length;o++)e.push(n[o])}r=r.right}return e},zg=(t,e)=>{let r=[],n=t._start;for(;n!==null;){if(n.countable&&ct(n,e)){let o=n.content.getContent();for(let s=0;s<o.length;s++)r.push(o[s])}n=n.right}return r},fn=(t,e)=>{let r=0,n=t._start;for(t.doc??Z();n!==null;){if(n.countable&&!n.deleted){let o=n.content.getContent();for(let s=0;s<o.length;s++)e(o[s],r++,t)}n=n.right}},Kl=(t,e)=>{let r=[];return fn(t,(n,o)=>{r.push(e(n,o,t))}),r},Kg=t=>{let e=t._start,r=null,n=0;return{[Symbol.iterator](){return this},next:()=>{if(r===null){for(;e!==null&&e.deleted;)e=e.right;if(e===null)return{done:!0,value:void 0};r=e.content.getContent(),n=0,e=e.right}let o=r[n++];return r.length<=n&&(r=null),{done:!1,value:o}}}},Hl=(t,e)=>{t.doc??Z();let r=wo(t,e),n=t._start;for(r!==null&&(n=r.p,e-=r.index);n!==null;n=n.right)if(!n.deleted&&n.countable){if(e<n.length)return n.content.getContent()[e];e-=n.length}},ao=(t,e,r,n)=>{let o=r,s=t.doc,i=s.clientID,c=s.store,a=r===null?e._start:r.right,u=[],l=()=>{u.length>0&&(o=new k(R(i,L(c,i)),o,o&&o.lastId,a,a&&a.id,e,null,new ft(u)),o.integrate(t,0),u=[])};n.forEach(d=>{if(d===null)u.push(d);else switch(d.constructor){case Number:case Object:case Boolean:case Array:case String:u.push(d);break;default:switch(l(),d.constructor){case Uint8Array:case ArrayBuffer:o=new k(R(i,L(c,i)),o,o&&o.lastId,a,a&&a.id,e,null,new zt(new Uint8Array(d))),o.integrate(t,0);break;case Me:o=new k(R(i,L(c,i)),o,o&&o.lastId,a,a&&a.id,e,null,new Kt(d)),o.integrate(t,0);break;default:if(d instanceof F)o=new k(R(i,L(c,i)),o,o&&o.lastId,a,a&&a.id,e,null,new we(d)),o.integrate(t,0);else throw new Error("Unexpected content type in insert operation")}}}),l()},ql=()=>ke("Length exceeded!"),Wl=(t,e,r,n)=>{if(r>e._length)throw ql();if(r===0)return e._searchMarker&&dn(e._searchMarker,r,n.length),ao(t,e,null,n);let o=r,s=wo(e,r),i=e._start;for(s!==null&&(i=s.p,r-=s.index,r===0&&(i=i.prev,r+=i&&i.countable&&!i.deleted?i.length:0));i!==null;i=i.right)if(!i.deleted&&i.countable){if(r<=i.length){r<i.length&&ne(t,R(i.id.client,i.id.clock+r));break}r-=i.length}return e._searchMarker&&dn(e._searchMarker,o,n.length),ao(t,e,i,n)},Hg=(t,e,r)=>{let o=(e._searchMarker||[]).reduce((s,i)=>i.index>s.index?i:s,{index:0,p:e._start}).p;if(o)for(;o.right;)o=o.right;return ao(t,e,o,r)},Jl=(t,e,r,n)=>{if(n===0)return;let o=r,s=n,i=wo(e,r),c=e._start;for(i!==null&&(c=i.p,r-=i.index);c!==null&&r>0;c=c.right)!c.deleted&&c.countable&&(r<c.length&&ne(t,R(c.id.client,c.id.clock+r)),r-=c.length);for(;n>0&&c!==null;)c.deleted||(n<c.length&&ne(t,R(c.id.client,c.id.clock+n)),c.delete(t),n-=c.length),c=c.right;if(n>0)throw ql();e._searchMarker&&dn(e._searchMarker,o,-s+n)},lo=(t,e,r)=>{let n=e._map.get(r);n!==void 0&&n.delete(t)},bi=(t,e,r,n)=>{let o=e._map.get(r)||null,s=t.doc,i=s.clientID,c;if(n==null)c=new ft([n]);else switch(n.constructor){case Number:case Object:case Boolean:case Array:case String:case Date:case BigInt:c=new ft([n]);break;case Uint8Array:c=new zt(n);break;case Me:c=new Kt(n);break;default:if(n instanceof F)c=new we(n);else throw new Error("Unexpected content type")}new k(R(i,L(s.store,i)),o,o&&o.lastId,null,null,e,r,c).integrate(t,0)},vi=(t,e)=>{t.doc??Z();let r=t._map.get(e);return r!==void 0&&!r.deleted?r.content.getContent()[r.length-1]:void 0},Ql=t=>{let e={};return t.doc??Z(),t._map.forEach((r,n)=>{r.deleted||(e[n]=r.content.getContent()[r.length-1])}),e},Xl=(t,e)=>{t.doc??Z();let r=t._map.get(e);return r!==void 0&&!r.deleted},qg=(t,e,r)=>{let n=t._map.get(e)||null;for(;n!==null&&(!r.sv.has(n.id.client)||n.id.clock>=(r.sv.get(n.id.client)||0));)n=n.left;return n!==null&&ct(n,r)?n.content.getContent()[n.length-1]:void 0},Zl=(t,e)=>{let r={};return t._map.forEach((n,o)=>{let s=n;for(;s!==null&&(!e.sv.has(s.id.client)||s.id.clock>=(e.sv.get(s.id.client)||0));)s=s.left;s!==null&&ct(s,e)&&(r[o]=s.content.getContent()[s.length-1])}),r},eo=t=>(t.doc??Z(),sl(t._map.entries(),e=>!e[1].deleted)),uo=class extends jt{},Ft=class t extends F{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(e){let r=new t;return r.push(e),r}_integrate(e,r){super._integrate(e,r),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new t}clone(){let e=new t;return e.insert(0,this.toArray().map(r=>r instanceof F?r.clone():r)),e}get length(){return this.doc??Z(),this._length}_callObserver(e,r){super._callObserver(e,r),_o(this,e,new uo(this,e))}insert(e,r){this.doc!==null?D(this.doc,n=>{Wl(n,this,e,r)}):this._prelimContent.splice(e,0,...r)}push(e){this.doc!==null?D(this.doc,r=>{Hg(r,this,e)}):this._prelimContent.push(...e)}unshift(e){this.insert(0,e)}delete(e,r=1){this.doc!==null?D(this.doc,n=>{Jl(n,this,e,r)}):this._prelimContent.splice(e,r)}get(e){return Hl(this,e)}toArray(){return zl(this)}slice(e=0,r=this.length){return $l(this,e,r)}toJSON(){return this.map(e=>e instanceof F?e.toJSON():e)}map(e){return Kl(this,e)}forEach(e){fn(this,e)}[Symbol.iterator](){return Kg(this)}_write(e){e.writeTypeRef(gm)}},Wg=t=>new Ft,fo=class extends jt{constructor(e,r,n){super(e,r),this.keysChanged=n}},Yt=class t extends F{constructor(e){super(),this._prelimContent=null,e===void 0?this._prelimContent=new Map:this._prelimContent=new Map(e)}_integrate(e,r){super._integrate(e,r),this._prelimContent.forEach((n,o)=>{this.set(o,n)}),this._prelimContent=null}_copy(){return new t}clone(){let e=new t;return this.forEach((r,n)=>{e.set(n,r instanceof F?r.clone():r)}),e}_callObserver(e,r){_o(this,e,new fo(this,e,r))}toJSON(){this.doc??Z();let e={};return this._map.forEach((r,n)=>{if(!r.deleted){let o=r.content.getContent()[r.length-1];e[n]=o instanceof F?o.toJSON():o}}),e}get size(){return[...eo(this)].length}keys(){return Xn(eo(this),e=>e[0])}values(){return Xn(eo(this),e=>e[1].content.getContent()[e[1].length-1])}entries(){return Xn(eo(this),e=>[e[0],e[1].content.getContent()[e[1].length-1]])}forEach(e){this.doc??Z(),this._map.forEach((r,n)=>{r.deleted||e(r.content.getContent()[r.length-1],n,this)})}[Symbol.iterator](){return this.entries()}delete(e){this.doc!==null?D(this.doc,r=>{lo(r,this,e)}):this._prelimContent.delete(e)}set(e,r){return this.doc!==null?D(this.doc,n=>{bi(n,this,e,r)}):this._prelimContent.set(e,r),r}get(e){return vi(this,e)}has(e){return Xl(this,e)}clear(){this.doc!==null?D(this.doc,e=>{this.forEach(function(r,n,o){lo(e,o,n)})}):this._prelimContent.clear()}_write(e){e.writeTypeRef(mm)}},Jg=t=>new Yt,lt=(t,e)=>t===e||typeof t=="object"&&typeof e=="object"&&t&&e&&Vs(t,e),hn=class{constructor(e,r,n,o){this.left=e,this.right=r,this.index=n,this.currentAttributes=o}forward(){this.right===null&&ce(),this.right.content.constructor===Y?this.right.deleted||Cr(this.currentAttributes,this.right.content):this.right.deleted||(this.index+=this.right.length),this.left=this.right,this.right=this.right.right}},wl=(t,e,r)=>{for(;e.right!==null&&r>0;)e.right.content.constructor===Y?e.right.deleted||Cr(e.currentAttributes,e.right.content):e.right.deleted||(r<e.right.length&&ne(t,R(e.right.id.client,e.right.id.clock+r)),e.index+=e.right.length,r-=e.right.length),e.left=e.right,e.right=e.right.right;return e},to=(t,e,r,n)=>{let o=new Map,s=n?wo(e,r):null;if(s){let i=new hn(s.p.left,s.p,s.index,o);return wl(t,i,r-s.index)}else{let i=new hn(null,e._start,0,o);return wl(t,i,r)}},eu=(t,e,r,n)=>{for(;r.right!==null&&(r.right.deleted===!0||r.right.content.constructor===Y&<(n.get(r.right.content.key),r.right.content.value));)r.right.deleted||n.delete(r.right.content.key),r.forward();let o=t.doc,s=o.clientID;n.forEach((i,c)=>{let a=r.left,u=r.right,l=new k(R(s,L(o.store,s)),a,a&&a.lastId,u,u&&u.id,e,null,new Y(c,i));l.integrate(t,0),r.right=l,r.forward()})},Cr=(t,e)=>{let{key:r,value:n}=e;n===null?t.delete(r):t.set(r,n)},tu=(t,e)=>{for(;t.right!==null;){if(!(t.right.deleted||t.right.content.constructor===Y&<(e[t.right.content.key]??null,t.right.content.value)))break;t.forward()}},ru=(t,e,r,n)=>{let o=t.doc,s=o.clientID,i=new Map;for(let c in n){let a=n[c],u=r.currentAttributes.get(c)??null;if(!lt(u,a)){i.set(c,u);let{left:l,right:d}=r;r.right=new k(R(s,L(o.store,s)),l,l&&l.lastId,d,d&&d.id,e,null,new Y(c,a)),r.right.integrate(t,0),r.forward()}}return i},Qs=(t,e,r,n,o)=>{r.currentAttributes.forEach((f,h)=>{o[h]===void 0&&(o[h]=null)});let s=t.doc,i=s.clientID;tu(r,o);let c=ru(t,e,r,o),a=n.constructor===String?new Te(n):n instanceof F?new we(n):new Ke(n),{left:u,right:l,index:d}=r;e._searchMarker&&dn(e._searchMarker,r.index,a.getLength()),l=new k(R(i,L(s.store,i)),u,u&&u.lastId,l,l&&l.id,e,null,a),l.integrate(t,0),r.right=l,r.index=d,r.forward(),eu(t,e,r,c)},_l=(t,e,r,n,o)=>{let s=t.doc,i=s.clientID;tu(r,o);let c=ru(t,e,r,o);e:for(;r.right!==null&&(n>0||c.size>0&&(r.right.deleted||r.right.content.constructor===Y));){if(!r.right.deleted)switch(r.right.content.constructor){case Y:{let{key:a,value:u}=r.right.content,l=o[a];if(l!==void 0){if(lt(l,u))c.delete(a);else{if(n===0)break e;c.set(a,u)}r.right.delete(t)}else r.currentAttributes.set(a,u);break}default:n<r.right.length&&ne(t,R(r.right.id.client,r.right.id.clock+n)),n-=r.right.length;break}r.forward()}if(n>0){let a="";for(;n>0;n--)a+=` `;r.right=new k(R(i,L(s.store,i)),r.left,r.left&&r.left.lastId,r.right,r.right&&r.right.id,e,null,new Te(a)),r.right.integrate(t,0),r.forward()}eu(t,e,r,c)},nu=(t,e,r,n,o)=>{let s=e,i=V();for(;s&&(!s.countable||s.deleted);){if(!s.deleted&&s.content.constructor===Y){let u=s.content;i.set(u.key,u)}s=s.right}let c=0,a=!1;for(;e!==s;){if(r===e&&(a=!0),!e.deleted){let u=e.content;if(u.constructor===Y){let{key:l,value:d}=u,f=n.get(l)??null;(i.get(l)!==u||f===d)&&(e.delete(t),c++,!a&&(o.get(l)??null)===d&&f!==d&&(f===null?o.delete(l):o.set(l,f))),!a&&!e.deleted&&Cr(o,u)}}e=e.right}return c},Qg=(t,e)=>{for(;e&&e.right&&(e.right.deleted||!e.right.countable);)e=e.right;let r=new Set;for(;e&&(e.deleted||!e.countable);){if(!e.deleted&&e.content.constructor===Y){let n=e.content.key;r.has(n)?e.delete(t):r.add(n)}e=e.left}},ou=t=>{let e=0;return D(t.doc,r=>{let n=t._start,o=t._start,s=V(),i=$n(s);for(;o;)o.deleted===!1&&(o.content.constructor===Y?Cr(i,o.content):(e+=nu(r,n,o,s,i),s=$n(i),n=o)),o=o.right}),e},Xg=t=>{let e=new Set,r=t.doc;for(let[n,o]of t.afterState.entries()){let s=t.beforeState.get(n)||0;o!==s&&Dl(t,r.store.clients.get(n),s,o,i=>{!i.deleted&&i.content.constructor===Y&&i.constructor!==oe&&e.add(i.parent)})}D(r,n=>{Pt(t,t.deleteSet,o=>{if(o instanceof oe||!o.parent._hasFormatting||e.has(o.parent))return;let s=o.parent;o.content.constructor===Y?e.add(s):Qg(n,o)});for(let o of e)ou(o)})},Sl=(t,e,r)=>{let n=r,o=$n(e.currentAttributes),s=e.right;for(;r>0&&e.right!==null;){if(e.right.deleted===!1)switch(e.right.content.constructor){case we:case Ke:case Te:r<e.right.length&&ne(t,R(e.right.id.client,e.right.id.clock+r)),r-=e.right.length,e.right.delete(t);break}e.forward()}s&&nu(t,s,e.right,o,e.currentAttributes);let i=(e.left||e.right).parent;return i._searchMarker&&dn(i._searchMarker,e.index,-n+r),e},ho=class extends jt{constructor(e,r,n){super(e,r),this.childListChanged=!1,this.keysChanged=new Set,n.forEach(o=>{o===null?this.childListChanged=!0:this.keysChanged.add(o)})}get changes(){if(this._changes===null){let e={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set};this._changes=e}return this._changes}get delta(){if(this._delta===null){let e=this.target.doc,r=[];D(e,n=>{let o=new Map,s=new Map,i=this.target._start,c=null,a={},u="",l=0,d=0,f=()=>{if(c!==null){let h=null;switch(c){case"delete":d>0&&(h={delete:d}),d=0;break;case"insert":(typeof u=="object"||u.length>0)&&(h={insert:u},o.size>0&&(h.attributes={},o.forEach((p,g)=>{p!==null&&(h.attributes[g]=p)}))),u="";break;case"retain":l>0&&(h={retain:l},$a(a)||(h.attributes=Fa({},a))),l=0;break}h&&r.push(h),c=null}};for(;i!==null;){switch(i.content.constructor){case we:case Ke:this.adds(i)?this.deletes(i)||(f(),c="insert",u=i.content.getContent()[0],f()):this.deletes(i)?(c!=="delete"&&(f(),c="delete"),d+=1):i.deleted||(c!=="retain"&&(f(),c="retain"),l+=1);break;case Te:this.adds(i)?this.deletes(i)||(c!=="insert"&&(f(),c="insert"),u+=i.content.str):this.deletes(i)?(c!=="delete"&&(f(),c="delete"),d+=i.length):i.deleted||(c!=="retain"&&(f(),c="retain"),l+=i.length);break;case Y:{let{key:h,value:p}=i.content;if(this.adds(i)){if(!this.deletes(i)){let g=o.get(h)??null;lt(g,p)?p!==null&&i.delete(n):(c==="retain"&&f(),lt(p,s.get(h)??null)?delete a[h]:a[h]=p)}}else if(this.deletes(i)){s.set(h,p);let g=o.get(h)??null;lt(g,p)||(c==="retain"&&f(),a[h]=g)}else if(!i.deleted){s.set(h,p);let g=a[h];g!==void 0&&(lt(g,p)?g!==null&&i.delete(n):(c==="retain"&&f(),p===null?delete a[h]:a[h]=p))}i.deleted||(c==="insert"&&f(),Cr(o,i.content));break}}i=i.right}for(f();r.length>0;){let h=r[r.length-1];if(h.retain!==void 0&&h.attributes===void 0)r.pop();else break}}),this._delta=r}return this._delta}},Sr=class t extends F{constructor(e){super(),this._pending=e!==void 0?[()=>this.insert(0,e)]:[],this._searchMarker=[],this._hasFormatting=!1}get length(){return this.doc??Z(),this._length}_integrate(e,r){super._integrate(e,r);try{this._pending.forEach(n=>n())}catch(n){console.error(n)}this._pending=null}_copy(){return new t}clone(){let e=new t;return e.applyDelta(this.toDelta()),e}_callObserver(e,r){super._callObserver(e,r);let n=new ho(this,e,r);_o(this,e,n),!e.local&&this._hasFormatting&&(e._needFormattingCleanup=!0)}toString(){this.doc??Z();let e="",r=this._start;for(;r!==null;)!r.deleted&&r.countable&&r.content.constructor===Te&&(e+=r.content.str),r=r.right;return e}toJSON(){return this.toString()}applyDelta(e,{sanitize:r=!0}={}){this.doc!==null?D(this.doc,n=>{let o=new hn(null,this._start,0,new Map);for(let s=0;s<e.length;s++){let i=e[s];if(i.insert!==void 0){let c=!r&&typeof i.insert=="string"&&s===e.length-1&&o.right===null&&i.insert.slice(-1)===` `?i.insert.slice(0,-1):i.insert;(typeof c!="string"||c.length>0)&&Qs(n,this,o,c,i.attributes||{})}else i.retain!==void 0?_l(n,this,o,i.retain,i.attributes||{}):i.delete!==void 0&&Sl(n,o,i.delete)}}):this._pending.push(()=>this.applyDelta(e))}toDelta(e,r,n){this.doc??Z();let o=[],s=new Map,i=this.doc,c="",a=this._start;function u(){if(c.length>0){let d={},f=!1;s.forEach((p,g)=>{f=!0,d[g]=p});let h={insert:c};f&&(h.attributes=d),o.push(h),c=""}}let l=()=>{for(;a!==null;){if(ct(a,e)||r!==void 0&&ct(a,r))switch(a.content.constructor){case Te:{let d=s.get("ychange");e!==void 0&&!ct(a,e)?(d===void 0||d.user!==a.id.client||d.type!=="removed")&&(u(),s.set("ychange",n?n("removed",a.id):{type:"removed"})):r!==void 0&&!ct(a,r)?(d===void 0||d.user!==a.id.client||d.type!=="added")&&(u(),s.set("ychange",n?n("added",a.id):{type:"added"})):d!==void 0&&(u(),s.delete("ychange")),c+=a.content.str;break}case we:case Ke:{u();let d={insert:a.content.getContent()[0]};if(s.size>0){let f={};d.attributes=f,s.forEach((h,p)=>{f[p]=h})}o.push(d);break}case Y:ct(a,e)&&(u(),Cr(s,a.content));break}a=a.right}u()};return e||r?D(i,d=>{e&&ti(d,e),r&&ti(d,r),l()},"cleanup"):l(),o}insert(e,r,n){if(r.length<=0)return;let o=this.doc;o!==null?D(o,s=>{let i=to(s,this,e,!n);n||(n={},i.currentAttributes.forEach((c,a)=>{n[a]=c})),Qs(s,this,i,r,n)}):this._pending.push(()=>this.insert(e,r,n))}insertEmbed(e,r,n){let o=this.doc;o!==null?D(o,s=>{let i=to(s,this,e,!n);Qs(s,this,i,r,n||{})}):this._pending.push(()=>this.insertEmbed(e,r,n||{}))}delete(e,r){if(r===0)return;let n=this.doc;n!==null?D(n,o=>{Sl(o,to(o,this,e,!0),r)}):this._pending.push(()=>this.delete(e,r))}format(e,r,n){if(r===0)return;let o=this.doc;o!==null?D(o,s=>{let i=to(s,this,e,!1);i.right!==null&&_l(s,this,i,r,n)}):this._pending.push(()=>this.format(e,r,n))}removeAttribute(e){this.doc!==null?D(this.doc,r=>{lo(r,this,e)}):this._pending.push(()=>this.removeAttribute(e))}setAttribute(e,r){this.doc!==null?D(this.doc,n=>{bi(n,this,e,r)}):this._pending.push(()=>this.setAttribute(e,r))}getAttribute(e){return vi(this,e)}getAttributes(){return Ql(this)}_write(e){e.writeTypeRef(ym)}},Zg=t=>new Sr,on=class{constructor(e,r=()=>!0){this._filter=r,this._root=e,this._currentNode=e._start,this._firstCall=!0,e.doc??Z()}[Symbol.iterator](){return this}next(){let e=this._currentNode,r=e&&e.content&&e.content.type;if(e!==null&&(!this._firstCall||e.deleted||!this._filter(r)))do if(r=e.content.type,!e.deleted&&(r.constructor===$t||r.constructor===Gt)&&r._start!==null)e=r._start;else for(;e!==null;){let n=e.next;if(n!==null){e=n;break}else e.parent===this._root?e=null:e=e.parent._item}while(e!==null&&(e.deleted||!this._filter(e.content.type)));return this._firstCall=!1,e===null?{value:void 0,done:!0}:(this._currentNode=e,{value:e.content.type,done:!1})}},Gt=class t extends F{constructor(){super(),this._prelimContent=[]}get firstChild(){let e=this._first;return e?e.content.getContent()[0]:null}_integrate(e,r){super._integrate(e,r),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new t}clone(){let e=new t;return e.insert(0,this.toArray().map(r=>r instanceof F?r.clone():r)),e}get length(){return this.doc??Z(),this._prelimContent===null?this._length:this._prelimContent.length}createTreeWalker(e){return new on(this,e)}querySelector(e){e=e.toUpperCase();let n=new on(this,o=>o.nodeName&&o.nodeName.toUpperCase()===e).next();return n.done?null:n.value}querySelectorAll(e){return e=e.toUpperCase(),ve(new on(this,r=>r.nodeName&&r.nodeName.toUpperCase()===e))}_callObserver(e,r){_o(this,e,new po(this,r,e))}toString(){return Kl(this,e=>e.toString()).join("")}toJSON(){return this.toString()}toDOM(e=document,r={},n){let o=e.createDocumentFragment();return n!==void 0&&n._createAssociation(o,this),fn(this,s=>{o.insertBefore(s.toDOM(e,r,n),null)}),o}insert(e,r){this.doc!==null?D(this.doc,n=>{Wl(n,this,e,r)}):this._prelimContent.splice(e,0,...r)}insertAfter(e,r){if(this.doc!==null)D(this.doc,n=>{let o=e&&e instanceof F?e._item:e;ao(n,this,o,r)});else{let n=this._prelimContent,o=e===null?0:n.findIndex(s=>s===e)+1;if(o===0&&e!==null)throw ke("Reference item not found");n.splice(o,0,...r)}}delete(e,r=1){this.doc!==null?D(this.doc,n=>{Jl(n,this,e,r)}):this._prelimContent.splice(e,r)}toArray(){return zl(this)}push(e){this.insert(this.length,e)}unshift(e){this.insert(0,e)}get(e){return Hl(this,e)}slice(e=0,r=this.length){return $l(this,e,r)}forEach(e){fn(this,e)}_write(e){e.writeTypeRef(wm)}},em=t=>new Gt,$t=class t extends Gt{constructor(e="UNDEFINED"){super(),this.nodeName=e,this._prelimAttrs=new Map}get nextSibling(){let e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){let e=this._item?this._item.prev:null;return e?e.content.type:null}_integrate(e,r){super._integrate(e,r),this._prelimAttrs.forEach((n,o)=>{this.setAttribute(o,n)}),this._prelimAttrs=null}_copy(){return new t(this.nodeName)}clone(){let e=new t(this.nodeName),r=this.getAttributes();return Ga(r,(n,o)=>{e.setAttribute(o,n)}),e.insert(0,this.toArray().map(n=>n instanceof F?n.clone():n)),e}toString(){let e=this.getAttributes(),r=[],n=[];for(let c in e)n.push(c);n.sort();let o=n.length;for(let c=0;c<o;c++){let a=n[c];r.push(a+'="'+e[a]+'"')}let s=this.nodeName.toLocaleLowerCase(),i=r.length>0?" "+r.join(" "):"";return`<${s}${i}>${super.toString()}</${s}>`}removeAttribute(e){this.doc!==null?D(this.doc,r=>{lo(r,this,e)}):this._prelimAttrs.delete(e)}setAttribute(e,r){this.doc!==null?D(this.doc,n=>{bi(n,this,e,r)}):this._prelimAttrs.set(e,r)}getAttribute(e){return vi(this,e)}hasAttribute(e){return Xl(this,e)}getAttributes(e){return e?Zl(this,e):Ql(this)}toDOM(e=document,r={},n){let o=e.createElement(this.nodeName),s=this.getAttributes();for(let i in s){let c=s[i];typeof c=="string"&&o.setAttribute(i,c)}return fn(this,i=>{o.appendChild(i.toDOM(e,r,n))}),n!==void 0&&n._createAssociation(o,this),o}_write(e){e.writeTypeRef(Em),e.writeKey(this.nodeName)}},tm=t=>new $t(t.readKey()),po=class extends jt{constructor(e,r,n){super(e,n),this.childListChanged=!1,this.attributesChanged=new Set,r.forEach(o=>{o===null?this.childListChanged=!0:this.attributesChanged.add(o)})}},pn=class t extends Yt{constructor(e){super(),this.hookName=e}_copy(){return new t(this.hookName)}clone(){let e=new t(this.hookName);return this.forEach((r,n)=>{e.set(n,r)}),e}toDOM(e=document,r={},n){let o=r[this.hookName],s;return o!==void 0?s=o.createDom(this):s=document.createElement(this.hookName),s.setAttribute("data-yjs-hook",this.hookName),n!==void 0&&n._createAssociation(s,this),s}_write(e){e.writeTypeRef(_m),e.writeKey(this.hookName)}},rm=t=>new pn(t.readKey()),go=class t extends Sr{get nextSibling(){let e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){let e=this._item?this._item.prev:null;return e?e.content.type:null}_copy(){return new t}clone(){let e=new t;return e.applyDelta(this.toDelta()),e}toDOM(e=document,r,n){let o=e.createTextNode(this.toString());return n!==void 0&&n._createAssociation(o,this),o}toString(){return this.toDelta().map(e=>{let r=[];for(let o in e.attributes){let s=[];for(let i in e.attributes[o])s.push({key:i,value:e.attributes[o][i]});s.sort((i,c)=>i.key<c.key?-1:1),r.push({nodeName:o,attrs:s})}r.sort((o,s)=>o.nodeName<s.nodeName?-1:1);let n="";for(let o=0;o<r.length;o++){let s=r[o];n+=`<${s.nodeName}`;for(let i=0;i<s.attrs.length;i++){let c=s.attrs[i];n+=` ${c.key}="${c.value}"`}n+=">"}n+=e.insert;for(let o=r.length-1;o>=0;o--)n+=`</${r[o].nodeName}>`;return n}).join("")}toJSON(){return this.toString()}_write(e){e.writeTypeRef(Sm)}},nm=t=>new go,br=class{constructor(e,r){this.id=e,this.length=r}get deleted(){throw Re()}mergeWith(e){return!1}write(e,r,n){throw Re()}integrate(e,r){throw Re()}},om=0,oe=class extends br{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor!==e.constructor?!1:(this.length+=e.length,!0)}integrate(e,r){r>0&&(this.id.clock+=r,this.length-=r),Al(e.doc.store,this)}write(e,r){e.writeInfo(om),e.writeLen(this.length-r)}getMissing(e,r){return null}},zt=class t{constructor(e){this.content=e}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new t(this.content)}splice(e){throw Re()}mergeWith(e){return!1}integrate(e,r){}delete(e){}gc(e){}write(e,r){e.writeBuf(this.content)}getRef(){return 3}},sm=t=>new zt(t.readBuf()),vr=class t{constructor(e){this.len=e}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new t(this.len)}splice(e){let r=new t(this.len-e);return this.len=e,r}mergeWith(e){return this.len+=e.len,!0}integrate(e,r){cn(e.deleteSet,r.id.client,r.id.clock,this.len),r.markDeleted()}delete(e){}gc(e){}write(e,r){e.writeLen(this.len-r)}getRef(){return 1}},im=t=>new vr(t.readLen()),su=(t,e)=>new Me({guid:t,...e,shouldLoad:e.shouldLoad||e.autoLoad||!1}),Kt=class t{constructor(e){e._item&&console.error("This document was already integrated as a sub-document. You should create a second instance instead with the same guid."),this.doc=e;let r={};this.opts=r,e.gc||(r.gc=!1),e.autoLoad&&(r.autoLoad=!0),e.meta!==null&&(r.meta=e.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new t(su(this.doc.guid,this.opts))}splice(e){throw Re()}mergeWith(e){return!1}integrate(e,r){this.doc._item=r,e.subdocsAdded.add(this.doc),this.doc.shouldLoad&&e.subdocsLoaded.add(this.doc)}delete(e){e.subdocsAdded.has(this.doc)?e.subdocsAdded.delete(this.doc):e.subdocsRemoved.add(this.doc)}gc(e){}write(e,r){e.writeString(this.doc.guid),e.writeAny(this.opts)}getRef(){return 9}},cm=t=>new Kt(su(t.readString(),t.readAny())),Ke=class t{constructor(e){this.embed=e}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new t(this.embed)}splice(e){throw Re()}mergeWith(e){return!1}integrate(e,r){}delete(e){}gc(e){}write(e,r){e.writeJSON(this.embed)}getRef(){return 5}},am=t=>new Ke(t.readJSON()),Y=class t{constructor(e,r){this.key=e,this.value=r}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new t(this.key,this.value)}splice(e){throw Re()}mergeWith(e){return!1}integrate(e,r){let n=r.parent;n._searchMarker=null,n._hasFormatting=!0}delete(e){}gc(e){}write(e,r){e.writeKey(this.key),e.writeJSON(this.value)}getRef(){return 6}},lm=t=>new Y(t.readKey(),t.readJSON()),gn=class t{constructor(e){this.arr=e}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new t(this.arr)}splice(e){let r=new t(this.arr.slice(e));return this.arr=this.arr.slice(0,e),r}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,r){}delete(e){}gc(e){}write(e,r){let n=this.arr.length;e.writeLen(n-r);for(let o=r;o<n;o++){let s=this.arr[o];e.writeString(s===void 0?"undefined":JSON.stringify(s))}}getRef(){return 2}},um=t=>{let e=t.readLen(),r=[];for(let n=0;n<e;n++){let o=t.readString();o==="undefined"?r.push(void 0):r.push(JSON.parse(o))}return new gn(r)},dm=en("node_env")==="development",ft=class t{constructor(e){this.arr=e,dm&&Bs(e)}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new t(this.arr)}splice(e){let r=new t(this.arr.slice(e));return this.arr=this.arr.slice(0,e),r}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,r){}delete(e){}gc(e){}write(e,r){let n=this.arr.length;e.writeLen(n-r);for(let o=r;o<n;o++){let s=this.arr[o];e.writeAny(s)}}getRef(){return 8}},fm=t=>{let e=t.readLen(),r=[];for(let n=0;n<e;n++)r.push(t.readAny());return new ft(r)},Te=class t{constructor(e){this.str=e}getLength(){return this.str.length}getContent(){return this.str.split("")}isCountable(){return!0}copy(){return new t(this.str)}splice(e){let r=new t(this.str.slice(e));this.str=this.str.slice(0,e);let n=this.str.charCodeAt(e-1);return n>=55296&&n<=56319&&(this.str=this.str.slice(0,e-1)+"\uFFFD",r.str="\uFFFD"+r.str.slice(1)),r}mergeWith(e){return this.str+=e.str,!0}integrate(e,r){}delete(e){}gc(e){}write(e,r){e.writeString(r===0?this.str:this.str.slice(r))}getRef(){return 4}},hm=t=>new Te(t.readString()),pm=[Wg,Jg,Zg,tm,em,rm,nm],gm=0,mm=1,ym=2,Em=3,wm=4,_m=5,Sm=6,we=class t{constructor(e){this.type=e}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new t(this.type._copy())}splice(e){throw Re()}mergeWith(e){return!1}integrate(e,r){this.type._integrate(e.doc,r)}delete(e){let r=this.type._start;for(;r!==null;)r.deleted?r.id.clock<(e.beforeState.get(r.id.client)||0)&&e._mergeStructs.push(r):r.delete(e),r=r.right;this.type._map.forEach(n=>{n.deleted?n.id.clock<(e.beforeState.get(n.id.client)||0)&&e._mergeStructs.push(n):n.delete(e)}),e.changed.delete(this.type)}gc(e){let r=this.type._start;for(;r!==null;)r.gc(e,!0),r=r.right;this.type._start=null,this.type._map.forEach(n=>{for(;n!==null;)n.gc(e,!0),n=n.left}),this.type._map=new Map}write(e,r){this.type._write(e)}getRef(){return 7}},bm=t=>new we(pm[t.readTypeRef()](t)),ii=(t,e)=>{let r=e,n=0,o;do n>0&&(r=R(r.client,r.clock+n)),o=Lt(t,r),n=r.clock-o.id.clock,r=o.redone;while(r!==null&&o instanceof k);return{item:o,diff:n}},Ci=(t,e)=>{for(;t!==null&&t.keep!==e;)t.keep=e,t=t.parent._item},mo=(t,e,r)=>{let{client:n,clock:o}=e.id,s=new k(R(n,o+r),e,R(n,o+r-1),e.right,e.rightOrigin,e.parent,e.parentSub,e.content.splice(r));return e.deleted&&s.markDeleted(),e.keep&&(s.keep=!0),e.redone!==null&&(s.redone=R(e.redone.client,e.redone.clock+r)),e.right=s,s.right!==null&&(s.right.left=s),t._mergeStructs.push(s),s.parentSub!==null&&s.right===null&&s.parent._map.set(s.parentSub,s),e.length=r,s},bl=(t,e)=>ba(t,r=>Ht(r.deletions,e)),iu=(t,e,r,n,o,s)=>{let i=t.doc,c=i.store,a=i.clientID,u=e.redone;if(u!==null)return ne(t,u);let l=e.parent._item,d=null,f;if(l!==null&&l.deleted===!0){if(l.redone===null&&(!r.has(l)||iu(t,l,r,n,o,s)===null))return null;for(;l.redone!==null;)l=ne(t,l.redone)}let h=l===null?e.parent:l.content.type;if(e.parentSub===null){for(d=e.left,f=e;d!==null;){let y=d;for(;y!==null&&y.parent._item!==l;)y=y.redone===null?null:ne(t,y.redone);if(y!==null&&y.parent._item===l){d=y;break}d=d.left}for(;f!==null;){let y=f;for(;y!==null&&y.parent._item!==l;)y=y.redone===null?null:ne(t,y.redone);if(y!==null&&y.parent._item===l){f=y;break}f=f.right}}else if(f=null,e.right&&!o){for(d=e;d!==null&&d.right!==null&&(d.right.redone||Ht(n,d.right.id)||bl(s.undoStack,d.right.id)||bl(s.redoStack,d.right.id));)for(d=d.right;d.redone;)d=ne(t,d.redone);if(d&&d.right!==null)return null}else d=h._map.get(e.parentSub)||null;let p=L(c,a),g=R(a,p),m=new k(g,d,d&&d.lastId,f,f&&f.id,h,e.parentSub,e.content.copy());return e.redone=g,Ci(m,!0),m.integrate(t,0),m},k=class t extends br{constructor(e,r,n,o,s,i,c,a){super(e,a.getLength()),this.origin=n,this.left=r,this.right=o,this.rightOrigin=s,this.parent=i,this.parentSub=c,this.redone=null,this.content=a,this.info=this.content.isCountable()?2:0}set marker(e){(this.info&8)>0!==e&&(this.info^=8)}get marker(){return(this.info&8)>0}get keep(){return(this.info&1)>0}set keep(e){this.keep!==e&&(this.info^=1)}get countable(){return(this.info&2)>0}get deleted(){return(this.info&4)>0}set deleted(e){this.deleted!==e&&(this.info^=4)}markDeleted(){this.info|=4}getMissing(e,r){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=L(r,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=L(r,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===$e&&this.id.client!==this.parent.client&&this.parent.clock>=L(r,this.parent.client))return this.parent.client;if(this.origin&&(this.left=ni(e,r,this.origin),this.origin=this.left.lastId),this.rightOrigin&&(this.right=ne(e,this.rightOrigin),this.rightOrigin=this.right.id),this.left&&this.left.constructor===oe||this.right&&this.right.constructor===oe)this.parent=null;else if(!this.parent)this.left&&this.left.constructor===t?(this.parent=this.left.parent,this.parentSub=this.left.parentSub):this.right&&this.right.constructor===t&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);else if(this.parent.constructor===$e){let n=Lt(r,this.parent);n.constructor===oe?this.parent=null:this.parent=n.content.type}return null}integrate(e,r){if(r>0&&(this.id.clock+=r,this.left=ni(e,e.doc.store,R(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(r),this.length-=r),this.parent){if(!this.left&&(!this.right||this.right.left!==null)||this.left&&this.left.right!==this.right){let n=this.left,o;if(n!==null)o=n.right;else if(this.parentSub!==null)for(o=this.parent._map.get(this.parentSub)||null;o!==null&&o.left!==null;)o=o.left;else o=this.parent._start;let s=new Set,i=new Set;for(;o!==null&&o!==this.right;){if(i.add(o),s.add(o),Ut(this.origin,o.origin)){if(o.id.client<this.id.client)n=o,s.clear();else if(Ut(this.rightOrigin,o.rightOrigin))break}else if(o.origin!==null&&i.has(Lt(e.doc.store,o.origin)))s.has(Lt(e.doc.store,o.origin))||(n=o,s.clear());else break;o=o.right}this.left=n}if(this.left!==null){let n=this.left.right;this.right=n,this.left.right=this}else{let n;if(this.parentSub!==null)for(n=this.parent._map.get(this.parentSub)||null;n!==null&&n.left!==null;)n=n.left;else n=this.parent._start,this.parent._start=this;this.right=n}this.right!==null?this.right.left=this:this.parentSub!==null&&(this.parent._map.set(this.parentSub,this),this.left!==null&&this.left.delete(e)),this.parentSub===null&&this.countable&&!this.deleted&&(this.parent._length+=this.length),Al(e.doc.store,this),this.content.integrate(e,this),gl(e,this.parent,this.parentSub),(this.parent._item!==null&&this.parent._item.deleted||this.parentSub!==null&&this.right!==null)&&this.delete(e)}else new oe(this.id,this.length).integrate(e,0)}get next(){let e=this.right;for(;e!==null&&e.deleted;)e=e.right;return e}get prev(){let e=this.left;for(;e!==null&&e.deleted;)e=e.left;return e}get lastId(){return this.length===1?this.id:R(this.id.client,this.id.clock+this.length-1)}mergeWith(e){if(this.constructor===e.constructor&&Ut(e.origin,this.lastId)&&this.right===e&&Ut(this.rightOrigin,e.rightOrigin)&&this.id.client===e.id.client&&this.id.clock+this.length===e.id.clock&&this.deleted===e.deleted&&this.redone===null&&e.redone===null&&this.content.constructor===e.content.constructor&&this.content.mergeWith(e.content)){let r=this.parent._searchMarker;return r&&r.forEach(n=>{n.p===e&&(n.p=this,!this.deleted&&this.countable&&(n.index-=this.length))}),e.keep&&(this.keep=!0),this.right=e.right,this.right!==null&&(this.right.left=this),this.length+=e.length,!0}return!1}delete(e){if(!this.deleted){let r=this.parent;this.countable&&this.parentSub===null&&(r._length-=this.length),this.markDeleted(),cn(e.deleteSet,this.id.client,this.id.clock,this.length),gl(e,r,this.parentSub),this.content.delete(e)}}gc(e,r){if(!this.deleted)throw ce();this.content.gc(e),r?Ag(e,this,new oe(this.id,this.length)):this.content=new vr(this.length)}write(e,r){let n=r>0?R(this.id.client,this.id.clock+r-1):this.origin,o=this.rightOrigin,s=this.parentSub,i=this.content.getRef()&31|(n===null?0:128)|(o===null?0:64)|(s===null?0:32);if(e.writeInfo(i),n!==null&&e.writeLeftID(n),o!==null&&e.writeRightID(o),n===null&&o===null){let c=this.parent;if(c._item!==void 0){let a=c._item;if(a===null){let u=yi(c);e.writeParentInfo(!0),e.writeString(u)}else e.writeParentInfo(!1),e.writeLeftID(a.id)}else c.constructor===String?(e.writeParentInfo(!0),e.writeString(c)):c.constructor===$e?(e.writeParentInfo(!1),e.writeLeftID(c)):ce();s!==null&&e.writeString(s)}this.content.write(e,r)}},cu=(t,e)=>vm[e&31](t),vm=[()=>{ce()},im,um,sm,hm,am,lm,bm,fm,cm,()=>{ce()}],Cm=10,X=class extends br{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor!==e.constructor?!1:(this.length+=e.length,!0)}integrate(e,r){ce()}write(e,r){e.writeInfo(Cm),v(e.restEncoder,this.length-r)}getMissing(e,r){return null}},au=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:{},lu="__ $YJS$ __";au[lu]===!0&&console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438");au[lu]=!0;var Ri=3e4,qt=class extends sr{constructor(e){super(),this.doc=e,this.clientID=e.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval(()=>{let r=it();this.getLocalState()!==null&&Ri/2<=r-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());let n=[];this.meta.forEach((o,s)=>{s!==this.clientID&&Ri<=r-o.lastUpdated&&this.states.has(s)&&n.push(s)}),n.length>0&&Ti(this,n,"timeout")},fe(Ri/10)),e.on("destroy",()=>{this.destroy()}),this.setLocalState({})}destroy(){this.emit("destroy",[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(e){let r=this.clientID,n=this.meta.get(r),o=n===void 0?0:n.clock+1,s=this.states.get(r);e===null?this.states.delete(r):this.states.set(r,e),this.meta.set(r,{clock:o,lastUpdated:it()});let i=[],c=[],a=[],u=[];e===null?u.push(r):s==null?e!=null&&i.push(r):(c.push(r),Xr(s,e)||a.push(r)),(i.length>0||a.length>0||u.length>0)&&this.emit("change",[{added:i,updated:a,removed:u},"local"]),this.emit("update",[{added:i,updated:c,removed:u},"local"])}setLocalStateField(e,r){let n=this.getLocalState();n!==null&&this.setLocalState({...n,[e]:r})}getStates(){return this.states}},Ti=(t,e,r)=>{let n=[];for(let o=0;o<e.length;o++){let s=e[o];if(t.states.has(s)){if(t.states.delete(s),s===t.clientID){let i=t.meta.get(s);t.meta.set(s,{clock:i.clock+1,lastUpdated:it()})}n.push(s)}}n.length>0&&(t.emit("change",[{added:[],updated:[],removed:n},r]),t.emit("update",[{added:[],updated:[],removed:n},r]))};var uu=1,So="fromPersistence",bo="document",Rr="state",Wt="savedAt",du="savedBy",fu="version",vo="gutenberg",xi="syncManager",hu="gutenberg-undo-ignored";var Tr=(t=>(t.AUTHENTICATION_FAILED="authentication-failed",t.CONNECTION_EXPIRED="connection-expired",t.CONNECTION_LIMIT_EXCEEDED="connection-limit-exceeded",t.DOCUMENT_SIZE_LIMIT_EXCEEDED="document-size-limit-exceeded",t.UNKNOWN_ERROR="unknown-error",t))(Tr||{}),Ii=class extends Error{constructor(t="unknown-error",e){super(e),this.code=t,this.name="ConnectionError"}};var gu=w(Ai(),1),{lock:mu,unlock:sb}=(0,gu.__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/sync");function yu(t){return function(...e){let r=performance.now(),n=t.apply(this,e),o=performance.now();return console.log(`[SyncManager][performance]: ${t.name} took ${(o-r).toFixed(2)} ms`),n}}function Eu(t){return((...e)=>t(...e))}function wu(t){return function(...e){setTimeout(()=>{t.apply(this,e)},0)}}var Fu=w(Co(),1);var Mu=w(Co(),1);var Su=0,bu=1,Rm=2,vu=(t,e)=>{v(t,Su);let r=mi(e);J(t,r)},Tm=(t,e,r)=>{v(t,bu),J(t,hi(e,r))},xm=(t,e,r)=>Tm(e,r,Q(t)),Cu=(t,e,r,n)=>{try{fi(e,Q(t),r)}catch(o){n?.(o),console.error("Caught error while handling a Yjs update",o)}};var Im=Cu,Di=(t,e,r,n,o)=>{let s=T(t);switch(s){case Su:xm(t,e,r);break;case bu:Cu(t,r,n,o);break;case Rm:Im(t,r,n,o);break;default:throw new Error("Unknown message type")}return s};var ki=w(Co(),1),Oi=3,Ru=[2e3,4e3,8e3,12e3],Tu=[1e3,2e3,4e3,8e3],xu=3e4,Iu=15e3,Ui=1*1024*1024,yn=50,Li=(0,ki.applyFilters)("sync.pollingManager.pollingInterval",4e3),Au=(0,ki.applyFilters)("sync.pollingManager.pollingIntervalWithCollaborators",1e3),Du=25*1e3;var le=(t=>(t.COMPACTION="compaction",t.SYNC_STEP_1="sync_step1",t.SYNC_STEP_2="sync_step2",t.UPDATE="update",t))(le||{});var Pi=w(Ae(),1);var ku="/wp-sync/v1/updates";function Dm(t){let e="",r=t.byteLength;for(let n=0;n<r;n++)e+=String.fromCharCode(t[n]);return globalThis.btoa(e)}function Mi(t){let e=globalThis.atob(t),r=e.length,n=new Uint8Array(r);for(let o=0;o<r;o++)n[o]=e.charCodeAt(o);return n}function xr(t,e){return{data:Dm(t),type:e}}function Ou(t=[],e=!0){let r=e,n=[...t];return{add(o){n.push(o)},addBulk(o){o.length!==0&&n.push(...o)},clear(){n.splice(0,n.length)},get(){return r?[]:n.splice(0,n.length)},pause(){r=!0},restore(o){let s=o.filter(i=>i.type!==le.COMPACTION);s.length!==0&&n.unshift(...s)},resume(){r=!1},size(){return n.length}}}async function Uu(t){let e=await(0,Pi.default)({body:JSON.stringify(t),headers:{"Content-Type":"application/json"},method:"POST",parse:!1,path:ku});if(!e.ok)throw new Error(`Sync update failed with status ${e.status}`);return await e.json()}function Ni(t){t.rooms.length!==0&&(0,Pi.default)({body:JSON.stringify(t),headers:{"Content-Type":"application/json"},keepalive:!0,method:"POST",parse:!1,path:ku}).catch(()=>{})}function Lu(t,e){let r=parseInt(String(t),10);return isNaN(r)?e:r}function Pu(t,e,r){if(t.length===0)return{window:[],nextOffset:0};let n=(e%t.length+t.length)%t.length;return{window:[...t.slice(n),...t.slice(0,n)].slice(0,Math.max(0,r)),nextOffset:(n+Math.max(0,r))%t.length}}var wn="polling-manager";function km(t){return t?.data?.status===403}function Om(t,e){let r=typeof t.message=="string"?t.message:"",n=[...e].sort((o,s)=>s.length-o.length);for(let o of n)if(r.includes(o))return o;return null}function Um(t,e){let r=Om(t,e.map(n=>n.room));if(r){let n=P.get(r);n&&(n.log("Permission denied, unregistering room",{error:t},"error",!0),_n(r,{sendDisconnectSignal:!1}));for(let o of e){if(o.room===r||!P.has(o.room))continue;let s=P.get(o.room);o.updates.length>0&&s.updateQueue.restore(o.updates)}}else{let n=[...P.keys()];for(let o of n){let s=P.get(o);s&&(s.log("Permission denied, unregistering room",{error:t},"error",!0),_n(o,{sendDisconnectSignal:!1}))}}}var P=new Map;function Lm(t){let e=t.filter(r=>[le.COMPACTION,le.UPDATE].includes(r.type)).map(r=>Mi(r.data));return xr(Bt(e),le.COMPACTION)}function Pm(t){let e=Ce();return vu(e,t),xr(re(e),le.SYNC_STEP_1)}function Mm(t,e){let r=G(e),n=Ce();return Di(r,n,t,wn),xr(re(n),le.SYNC_STEP_2)}function Nm(t,e){let r=e.getStates(),n=new Set,o=new Set,s=new Set(Array.from(r.keys()).filter(i=>!t[i]));Object.entries(t).forEach(([i,c])=>{let a=Number(i);if(a===e.clientID)return;if(c===null){r.delete(a),s.add(a);return}if(!r.has(a)){r.set(a,c),n.add(a);return}let u=r.get(a);JSON.stringify(u)!==JSON.stringify(c)&&(r.set(a,c),o.add(a))}),n.size+o.size>0&&e.emit("change",[{added:Array.from(n),updated:Array.from(o),removed:[]}]),s.size>0&&Ti(e,Array.from(s),wn)}function Vm(t,e,r){let n=Mi(t.data);switch(t.type){case le.SYNC_STEP_1:return Mm(e,n);case le.SYNC_STEP_2:{let o=G(n),s=Ce();Di(o,s,e,wn),r();return}case le.COMPACTION:case le.UPDATE:Be(e,n,wn)}}function Bm(t,e){if(!e.isPrimaryRoom||Vi)return!1;Vi=!0;let r=(0,Mu.applyFilters)("sync.pollingProvider.maxClientsPerRoom",Oi,e.room),n=Object.keys(t).length,o=Lu(r,Oi);return n>o?(e.log("Connection limit exceeded",{clientCount:n,maxClientsPerRoom:o,room:e.room}),!0):!1}var Io=!1,Jt=0,Vi=!1,To=!1,Ro=!1,En=document.visibilityState==="visible",xo=!1,Bi=!1,He=Li,pt=null,ji=0;function Nu(){Bi=!0}function Vu(){let t=Array.from(P.entries()).map(([e,r])=>({after:0,awareness:null,client_id:r.clientId,room:e,updates:[]}));for(let e=0;e<t.length;e+=yn)Ni({rooms:t.slice(e,e+yn)})}function Bu(){let t=En;En=document.visibilityState==="visible",En&&!t&&pt&&(clearTimeout(pt),pt=null,Ao())}function jm(){let t=Array.from(P.values());if(t.length<=yn)return t;let e=t.find(i=>i.isPrimaryRoom),r=t.filter(i=>i!==e),n=yn-(e?1:0),{window:o,nextOffset:s}=Pu(r,ji,n);return ji=s,e?[e,...o]:o}function Ao(){xo=!0,pt=null;async function t(){if(P.size===0){xo=!1;return}Bi=!1;let e=jm(),r={rooms:e.map(n=>({after:n.endCursor??0,awareness:n.localAwarenessState,client_id:n.clientId,room:n.room,updates:n.updateQueue.get()}))};e.forEach(n=>{n.onStatusChange({status:"connecting"})});try{let{rooms:n}=await Uu(r);Jt=0,To=!1,e.forEach(o=>{P.get(o.room)===o&&o.onStatusChange({status:"connected"})}),Ro=!1,n.forEach(o=>{if(!P.has(o.room))return;let s=P.get(o.room);if(s.endCursor=o.end_cursor,Bm(o.awareness,s)){s.onStatusChange({status:"disconnected",error:new Ii(Tr.CONNECTION_LIMIT_EXCEEDED,"Connection limit exceeded")}),_n(o.room);return}s.processAwarenessUpdate(o.awareness),s.isPrimaryRoom&&Object.keys(o.awareness).length>1&&(Ro=!0,P.forEach(c=>{c.updateQueue.resume()}));let i=[];for(let c of o.updates)try{let a=s.processDocUpdate(c);a&&i.push(a)}catch(a){s.log("Failed to apply sync update",{error:a,update:c},"error",!0)}s.updateQueue.addBulk(i),o.should_compact?(s.log("Server requested compaction update"),s.updateQueue.clear(),s.updateQueue.add(s.createCompactionUpdate())):o.compaction_request&&(s.log("Server requested (old) compaction update"),s.updateQueue.add(Lm(o.compaction_request)))}),En&&Ro?He=Au:En?He=Li:He=Du}catch(n){if(km(n)){if(Um(n,r.rooms),P.size===0){xo=!1;return}}else{Jt++;let o=Ro?Tu:Ru;Jt<=o.length?He=o[Jt-1]:He=xu,To&&(He=Iu,To=!1);for(let s of r.rooms){if(!P.has(s.room))continue;let i=P.get(s.room);s.updates.length>0&&i.endCursor>0?(i.updateQueue.clear(),i.updateQueue.add(i.createCompactionUpdate())):s.updates.length>0&&i.updateQueue.restore(s.updates),i.log("Error posting sync update, will retry with backoff",{error:n,nextPoll:He},"error",!0)}if(!Bi){let s=Jt>o.length;e.forEach(i=>{P.get(i.room)===i&&i.onStatusChange({status:"disconnected",canManuallyRetry:!0,consecutiveFailures:Jt,backgroundRetriesFailed:s,willAutoRetryInMs:He})})}}}pt=setTimeout(Ao,He)}t()}function Fm({room:t,doc:e,awareness:r,log:n,onSync:o,onStatusChange:s}){if(P.has(t))return;let i=Ou([Pm(e)]),c=P.size===0;function a(){d.localAwarenessState=r.getLocalState()??{}}function u(f,h){if(wn!==h){if(f.byteLength>Ui){let p=P.get(t);if(!p)return;p.log("Document size limit exceeded",{maxUpdateSizeInBytes:Ui,updateSizeInBytes:f.byteLength}),p.onStatusChange({status:"disconnected",error:new Ii(Tr.DOCUMENT_SIZE_LIMIT_EXCEEDED,"Document size limit exceeded")}),_n(t)}i.add(xr(f,le.UPDATE))}}function l(){e.off("updateV2",u),r.off("change",a),i.clear()}let d={clientId:e.clientID,createCompactionUpdate:()=>xr(ht(e),le.COMPACTION),endCursor:0,isPrimaryRoom:c,localAwarenessState:r.getLocalState()??{},log:n,onStatusChange:s,processAwarenessUpdate:f=>Nm(f,r),processDocUpdate:f=>Vm(f,e,o),room:t,unregister:l,updateQueue:i};e.on("updateV2",u),r.on("change",a),P.set(t,d),Io||(window.addEventListener("beforeunload",Nu),window.addEventListener("pagehide",Vu),document.addEventListener("visibilitychange",Bu),Io=!0),xo||Ao()}function _n(t,{sendDisconnectSignal:e=!0}={}){let r=P.get(t);if(r){if(e){let n=[{after:0,awareness:null,client_id:r.clientId,room:t,updates:[]}];Ni({rooms:n})}r.unregister(),P.delete(t)}P.size===0&&Io&&(window.removeEventListener("beforeunload",Nu),window.removeEventListener("pagehide",Vu),document.removeEventListener("visibilitychange",Bu),Io=!1,Vi=!1,Jt=0,ji=0)}function Ym(){To=!0,pt&&(clearTimeout(pt),pt=null,Ao())}var Sn={registerRoom:Fm,retryNow:Ym,unregisterRoom:_n};var Gm=class extends rt{constructor(t){super(),this.options=t,this.log("Initializing",{room:t.room}),this.awareness=t.awareness??new qt(t.ydoc),this.connect()}awareness;status="disconnected";synced=!1;connect(){this.log("Connecting"),Sn.registerRoom({room:this.options.room,doc:this.options.ydoc,awareness:this.awareness,log:this.log,onStatusChange:this.emitStatus,onSync:this.onSync})}destroy(){this.disconnect(),super.destroy()}disconnect(){this.log("Disconnecting"),Sn.unregisterRoom(this.options.room),this.emitStatus({status:"disconnected"})}emitStatus=t=>{let{status:e}=t,r=e==="disconnected"?t.error:void 0;this.status===e&&!r||e==="connecting"&&this.status!=="disconnected"||(this.log("Status change",{status:e,error:r}),this.status=e,this.emit("status",[t]))};log=(t,e={},r="log",n=!1)=>{if(!this.options.debug&&!n)return;(console[r]||console.log)(`[${this.constructor.name}]: ${t}`,{room:this.options.room,...e})};onSync=()=>{this.synced||(this.synced=!0,this.log("Synced"))}};function ju(){return async({awareness:t,objectType:e,objectId:r,ydoc:n})=>{let o=r?`${e}:${r}`:e,s=new Gm({awareness:t,room:o,ydoc:n});return{destroy:()=>s.destroy(),on:(i,c)=>{s.on(i,c)}}}}var Ir=null;function $m(){return[ju()]}function zm(t){return typeof t=="function"}function Fi(){if(Ir)return Ir;if(!window._wpCollaborationEnabled)return[];let t=(0,Fu.applyFilters)("sync.providers",$m());return Array.isArray(t)?(Ir=t.filter(zm),Ir):(Ir=[],Ir)}var Yu=(t,e)=>{let r=e==="undo"?t.undoStack:t.redoStack;for(;r.length>0;){let n=r.pop(),o=e==="undo"?n.undoStack:n.redoStack,s=o.pop(),i=!1;if(e==="undo"?(n.undoStack=[s],i=n.undo()!==null,n.undoStack=o):(n.redoStack=[s],i=n.redo()!==null,n.redoStack=o),i)return s}return null},Gu=class extends sr{constructor(t=[],e={}){super(),this.docs=new Map,this.trackedOrigins=e.trackedOrigins||new Set([null]),e.trackedOrigins=this.trackedOrigins,this._defaultOpts=e,this.undoStack=[],this.redoStack=[],this.addToScope(t)}addToScope(t){t=xt(t)?t:[t],t.forEach(e=>{let r=e.doc,n=K(this.docs,r,()=>{let o=new Vt([e],this._defaultOpts);return o.on("stack-cleared",({undoStackCleared:s,redoStackCleared:i})=>{this.clear(s,i)}),r.on("destroy",()=>{this.docs.delete(r),this.undoStack=this.undoStack.filter(s=>s.doc!==r),this.redoStack=this.redoStack.filter(s=>s.doc!==r)}),o.on("stack-item-added",s=>{(s.type==="undo"?this.undoStack:this.redoStack).push(o),this.emit("stack-item-added",[{...s,ydoc:r},this])}),o.on("stack-item-updated",s=>{this.emit("stack-item-updated",[{...s,ydoc:r},this])}),o.on("stack-item-popped",s=>{this.emit("stack-item-popped",[{...s,ydoc:r},this])}),o});n.scope.every(o=>o!==e)&&n.scope.push(e)})}addTrackedOrigin(t){this.trackedOrigins.add(t)}removeTrackedOrigin(t){this.trackedOrigins.delete(t)}undo(){return Yu(this,"undo")}redo(){return Yu(this,"redo")}clear(t=!0,e=!0){(t&&this.canUndo()||e&&this.canRedo())&&(this.docs.forEach(r=>{t&&(this.undoStack=[]),e&&(this.redoStack=[]),r.clear(t,e)}),this.emit("stack-cleared",[{undoStackCleared:t,redoStackCleared:e}]))}stopCapturing(){this.docs.forEach(t=>{t.stopCapturing()})}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}destroy(){this.docs.forEach(t=>t.destroy()),super.destroy()}};function $u(){let t=new Gu([],{captureTimeout:500,trackedOrigins:new Set([vo])});return{addRecord(e,r=!1){},addToScope(e,r){if(e.doc===null)return;let n=e.doc;t.addToScope(e);let{addUndoMeta:o,restoreUndoMeta:s}=r;t.on("stack-item-added",i=>{o(n,i.stackItem.meta)}),t.on("stack-item-popped",i=>{s(n,i.stackItem.meta)})},undo(){if(t.canUndo())return t.undo(),[]},redo(){if(t.canRedo())return t.redo(),[]},hasUndo(){return t.canUndo()},hasRedo(){return t.canRedo()},stopCapturing(){t.stopCapturing()}}}function Do(t={}){let e=new Map(Object.entries(t));return new Me({meta:e})}function Yi(t){t.getMap(Rr).set(fu,uu)}function Gi(t){let e=t.getMap(Rr);e.set(Wt,Date.now()),e.set(du,t.clientID)}function zu(){return Math.floor(Math.random()*1e9)}function Ku(t){return JSON.stringify({document:Ja(ht(t)),updateId:zu()})}function Hu(t){try{let{document:e}=JSON.parse(t),r={[So]:!0},n=Do(r),o=Qa(e);return Be(n,o),n.clientID=zu(),n}catch{return null}}function gt(t,e){return`${t}_${e}`}function qu(t=!1){let e=t?yu:Eu,r=new Map,n=new Map,o;function s(g,m,y,E={}){t&&console.log(`[SyncManager][${g}]: ${m}`,{...E,entityId:y})}async function i(g,m,y,E,_){let S=Fi(),b=gt(m,y);if(S.length===0){s("loadEntity","no providers, skipping",b);return}if(n.has(b)){s("loadEntity","already loaded",b);return}if(g.shouldSync?.(m,y)===!1){s("loadEntity","shouldSync false, skipping",b);return}s("loadEntity","loading",b),_={addUndoMeta:e(_.addUndoMeta),editRecord:e(_.editRecord),getEditedRecord:e(_.getEditedRecord),onStatusChange:e(_.onStatusChange),persistCRDTDoc:e(_.persistCRDTDoc),refetchRecord:e(_.refetchRecord),restoreUndoMeta:e(_.restoreUndoMeta)};let I=Do({objectType:m}),O=I.getMap(bo),U=I.getMap(Rr),$=Date.now(),j=()=>{s("loadEntity","unloading",b),Ph.forEach(rr=>rr.destroy()),_.onStatusChange(null),O.unobserveDeep(Ie),U.unobserve(be),I.destroy(),n.delete(b)},de=g.createAwareness?.(I,y),Ie=(rr,St)=>{St.local&&!(St.origin instanceof Vt)||p.updateEntityRecord(m,y)},be=(rr,St)=>{St.local||rr.keysChanged.forEach(Mh=>{if(Mh===Wt){let Kc=U.get(Wt);typeof Kc=="number"&&Kc>$&&(s("loadEntity","refetching record",b),_.refetchRecord().catch(()=>{}))}})};o||(o=$u());let{addUndoMeta:Vr,restoreUndoMeta:tr}=_;o.addToScope(O,{addUndoMeta:Vr,restoreUndoMeta:tr});let Vn={awareness:de,handlers:_,objectId:y,objectType:m,syncConfig:g,unload:j,ydoc:I};n.set(b,Vn),s("loadEntity","connecting",b);let Ph=await Promise.all(S.map(async rr=>{let St=await rr({objectType:m,objectId:y,ydoc:I,awareness:de});return St.on("status",_.onStatusChange),St}));O.observeDeep(Ie),U.observe(be),Yi(I),p.applyPersistedCrdtDoc(m,y,E)}async function c(g,m,y){let E=Fi(),_=gt(m,null);if(E.length===0){s("loadCollection","no providers, skipping",_);return}if(r.has(m)){s("loadCollection","already loaded",_);return}if(g.shouldSync?.(m,null)===!1){s("loadCollection","shouldSync false, skipping",_);return}s("loadCollection","loading",_);let S=Do({collection:!0,objectType:m}),b=S.getMap(Rr),I=Date.now(),O=()=>{s("loadCollection","unloading",_),de.forEach(Ie=>Ie.destroy()),y.onStatusChange(null),b.unobserve(U),S.destroy(),r.delete(m)},U=(Ie,be)=>{be.local||Ie.keysChanged.forEach(Vr=>{if(Vr===Wt){let tr=b.get(Wt);typeof tr=="number"&&tr>I&&y.refetchRecords().catch(()=>{})}})},$=g.createAwareness?.(S),j={awareness:$,handlers:y,syncConfig:g,unload:O,ydoc:S};r.set(m,j),s("loadCollection","connecting",_);let de=await Promise.all(E.map(async Ie=>{let be=await Ie({awareness:$,objectType:m,objectId:null,ydoc:S});return be.on("status",y.onStatusChange),be}));b.observe(U),Yi(S)}function a(g,m){let y=gt(g,m);s("unloadEntity","unloading",y),n.get(y)?.unload(),d(g,null,{},origin,{isSave:!0})}function u(g,m){let y=gt(g,m),E=n.get(y);if(!(!E||!E.awareness))return E.awareness}function l(g,m,y){let E=gt(g,m),_=n.get(E);if(!_){s("applyPersistedCrdtDoc","no entity state",E);return}let{handlers:S,syncConfig:{applyChangesToCRDTDoc:b,getChangesFromCRDTDoc:I,getPersistedCRDTDoc:O},ydoc:U}=_,$=O?.(y),j=$?Hu($):null;if(!j){s("applyPersistedCrdtDoc","no persisted doc",E),U.transact(()=>{b(U,y),S.persistCRDTDoc()},xi);return}let de=ht(j);Be(U,de);let Ie=I(j,y),be=Object.keys(Ie);if(j.destroy(),be.length===0){s("applyPersistedCrdtDoc","valid persisted doc",E);return}s("applyPersistedCrdtDoc","invalidated keys",E,{invalidatedKeys:be});let Vr=be.reduce((tr,Vn)=>Object.assign(tr,{[Vn]:y[Vn]}),{});U.transact(()=>{b(U,Vr),S.persistCRDTDoc()},xi)}function d(g,m,y,E,_={}){let{isSave:S=!1,isNewUndoLevel:b=!1}=_,I=gt(g,m),O=n.get(I),U=r.get(g);if(O){let{syncConfig:$,ydoc:j}=O;b&&o&&o.stopCapturing?.(),j.transact(()=>{s("updateCRDTDoc","applying changes",I,{changedKeys:Object.keys(y)}),$.applyChangesToCRDTDoc(j,y),S&&Gi(j)},E)}U&&S&&U.ydoc.transact(()=>{Gi(U.ydoc)},E)}async function f(g,m){let y=gt(g,m),E=n.get(y);if(!E){s("updateEntityRecord","no entity state",y);return}let{handlers:_,syncConfig:S,ydoc:b}=E,I=S.getChangesFromCRDTDoc(b,await _.getEditedRecord()),O=Object.keys(I);O.length!==0&&(s("updateEntityRecord","changes",y,{changedKeys:O}),_.editRecord(I))}async function h(g,m){let y=gt(g,m),E=n.get(y);return E?.ydoc?(await new Promise(_=>setTimeout(_,0)),Ku(E.ydoc)):null}let p={applyPersistedCrdtDoc:e(l),updateEntityRecord:e(f)};return{createPersistedCRDTDoc:e(h),getAwareness:u,load:e(i),loadCollection:e(c),get undoManager(){return o},unload:e(a),update:e(wu(d))}}var Qt=class{diff(e,r,n={}){let o;typeof n=="function"?(o=n,n={}):"callback"in n&&(o=n.callback);let s=this.castInput(e,n),i=this.castInput(r,n),c=this.removeEmpty(this.tokenize(s,n)),a=this.removeEmpty(this.tokenize(i,n));return this.diffWithOptionsObj(c,a,n,o)}diffWithOptionsObj(e,r,n,o){var s;let i=E=>{if(E=this.postProcess(E,n),o){setTimeout(function(){o(E)},0);return}else return E},c=r.length,a=e.length,u=1,l=c+a;n.maxEditLength!=null&&(l=Math.min(l,n.maxEditLength));let d=(s=n.timeout)!==null&&s!==void 0?s:1/0,f=Date.now()+d,h=[{oldPos:-1,lastComponent:void 0}],p=this.extractCommon(h[0],r,e,0,n);if(h[0].oldPos+1>=a&&p+1>=c)return i(this.buildValues(h[0].lastComponent,r,e));let g=-1/0,m=1/0,y=()=>{for(let E=Math.max(g,-u);E<=Math.min(m,u);E+=2){let _,S=h[E-1],b=h[E+1];S&&(h[E-1]=void 0);let I=!1;if(b){let U=b.oldPos-E;I=b&&0<=U&&U<c}let O=S&&S.oldPos+1<a;if(!I&&!O){h[E]=void 0;continue}if(!O||I&&S.oldPos<b.oldPos?_=this.addToPath(b,!0,!1,0,n):_=this.addToPath(S,!1,!0,1,n),p=this.extractCommon(_,r,e,E,n),_.oldPos+1>=a&&p+1>=c)return i(this.buildValues(_.lastComponent,r,e))||!0;h[E]=_,_.oldPos+1>=a&&(m=Math.min(m,E-1)),p+1>=c&&(g=Math.max(g,E+1))}u++};if(o)(function E(){setTimeout(function(){if(u>l||Date.now()>f)return o(void 0);y()||E()},0)})();else for(;u<=l&&Date.now()<=f;){let E=y();if(E)return E}}addToPath(e,r,n,o,s){let i=e.lastComponent;return i&&!s.oneChangePerToken&&i.added===r&&i.removed===n?{oldPos:e.oldPos+o,lastComponent:{count:i.count+1,added:r,removed:n,previousComponent:i.previousComponent}}:{oldPos:e.oldPos+o,lastComponent:{count:1,added:r,removed:n,previousComponent:i}}}extractCommon(e,r,n,o,s){let i=r.length,c=n.length,a=e.oldPos,u=a-o,l=0;for(;u+1<i&&a+1<c&&this.equals(n[a+1],r[u+1],s);)u++,a++,l++,s.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return l&&!s.oneChangePerToken&&(e.lastComponent={count:l,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=a,u}equals(e,r,n){return n.comparator?n.comparator(e,r):e===r||!!n.ignoreCase&&e.toLowerCase()===r.toLowerCase()}removeEmpty(e){let r=[];for(let n=0;n<e.length;n++)e[n]&&r.push(e[n]);return r}castInput(e,r){return e}tokenize(e,r){return Array.from(e)}join(e){return e.join("")}postProcess(e,r){return e}get useLongestToken(){return!1}buildValues(e,r,n){let o=[],s;for(;e;)o.push(e),s=e.previousComponent,delete e.previousComponent,e=s;o.reverse();let i=o.length,c=0,a=0,u=0;for(;c<i;c++){let l=o[c];if(l.removed)l.value=this.join(n.slice(u,u+l.count)),u+=l.count;else{if(!l.added&&this.useLongestToken){let d=r.slice(a,a+l.count);d=d.map(function(f,h){let p=n[u+h];return p.length>f.length?p:f}),l.value=this.join(d)}else l.value=this.join(r.slice(a,a+l.count));a+=l.count,l.added||(u+=l.count)}}return o}};var $i=class extends Qt{},Wu=new $i;function ko(t,e,r){return Wu.diff(t,e,r)}var zi=class extends Qt{constructor(){super(...arguments),this.tokenize=Km}equals(e,r,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(` `))&&(e=e.trim()),(!n.newlineIsToken||!r.includes(` `))&&(r=r.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith(` `)&&(e=e.slice(0,-1)),r.endsWith(` `)&&(r=r.slice(0,-1))),super.equals(e,r,n)}},Ju=new zi;function Ki(t,e,r){return Ju.diff(t,e,r)}function Km(t,e){e.stripTrailingCr&&(t=t.replace(/\r\n/g,` `));let r=[],n=t.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(let o=0;o<n.length;o++){let s=n[o];o%2&&!e.newlineIsToken?r[r.length-1]+=s:r.push(s)}return r}var Oo=w(Qe(),1);var Qu=w(Qe(),1);function Hm(t){return JSON.parse(JSON.stringify(t))}var Hi;(t=>{function e(s={},i={},c=!1){typeof s!="object"&&(s={}),typeof i!="object"&&(i={});let a=Hm(i);c||(a=Object.keys(a).reduce((u,l)=>((a[l]!==null||a[l]!==void 0)&&(u[l]=a[l]),u),{}));for(let u in s)s[u]!==void 0&&i[u]===void 0&&(a[u]=s[u]);return Object.keys(a).length>0?a:void 0}t.compose=e;function r(s={},i={}){typeof s!="object"&&(s={}),typeof i!="object"&&(i={});let c=Object.keys(s).concat(Object.keys(i)).reduce((a,u)=>((0,Qu.default)(s[u],i[u])||(a[u]=i[u]===void 0?null:i[u]),a),{});return Object.keys(c).length>0?c:void 0}t.diff=r;function n(s={},i={}){s=s||{};let c=Object.keys(i).reduce((a,u)=>(i[u]!==s[u]&&s[u]!==void 0&&(a[u]=i[u]),a),{});return Object.keys(s).reduce((a,u)=>(s[u]!==i[u]&&i[u]===void 0&&(a[u]=null),a),c)}t.invert=n;function o(s,i,c=!1){if(typeof s!="object")return i;if(typeof i!="object")return;if(!c)return i;let a=Object.keys(i).reduce((u,l)=>(s[l]===void 0&&(u[l]=i[l]),u),{});return Object.keys(a).length>0?a:void 0}t.transform=o})(Hi||(Hi={}));var Xt=Hi;var qi;(t=>{function e(r){return typeof r.delete=="number"?r.delete:typeof r.retain=="number"?r.retain:typeof r.retain=="object"&&r.retain!==null?1:typeof r.insert=="string"?r.insert.length:1}t.length=e})(qi||(qi={}));var _e=qi;var se=class{ops;index;offset;constructor(t){this.ops=t,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(t){t||(t=1/0);let e=this.ops[this.index];if(e){let r=this.offset,n=_e.length(e);if(t>=n-r?(t=n-r,this.index+=1,this.offset=0):this.offset+=t,typeof e.delete=="number")return{delete:t};let o={};return e.attributes&&(o.attributes=e.attributes),typeof e.retain=="number"?o.retain=t:typeof e.retain=="object"&&e.retain!==null?o.retain=e.retain:typeof e.insert=="string"?o.insert=e.insert.substr(r,t):o.insert=e.insert,o}return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?_e.length(this.ops[this.index])-this.offset:1/0}peekType(){let t=this.ops[this.index];return t?typeof t.delete=="number"?"delete":typeof t.retain=="number"||typeof t.retain=="object"&&t.retain!==null?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index)}else return[];let t=this.offset,e=this.index,r=this.next(),n=this.ops.slice(this.index);return this.offset=t,this.index=e,[r].concat(n)}};function qm(t){return JSON.parse(JSON.stringify(t))}var Wm="\0",Jm=1e4;function Wi(t){return t.map(e=>({...e,count:e.value.length}))}var Xu=(t,e)=>{if(typeof t!="object"||t===null)throw new Error(`cannot retain a ${typeof t}`);if(typeof e!="object"||e===null)throw new Error(`cannot retain a ${typeof e}`);let r=Object.keys(t)[0];if(!r||r!==Object.keys(e)[0])throw new Error(`embed types not matched: ${r} != ${Object.keys(e)[0]}`);return[r,t[r],e[r]]},Qm=class ue{static Op=_e;static OpIterator=se;static AttributeMap=Xt;static handlers={};static registerEmbed(e,r){this.handlers[e]=r}static unregisterEmbed(e){delete this.handlers[e]}static getHandler(e){let r=this.handlers[e];if(!r)throw new Error(`no handlers for embed type "${e}"`);return r}ops;constructor(e){Array.isArray(e)?this.ops=e:e!=null&&Array.isArray(e.ops)?this.ops=e.ops:this.ops=[]}insert(e,r){let n={};return typeof e=="string"&&e.length===0?this:(n.insert=e,r!=null&&typeof r=="object"&&Object.keys(r).length>0&&(n.attributes=r),this.push(n))}delete(e){return e<=0?this:this.push({delete:e})}retain(e,r){if(typeof e=="number"&&e<=0)return this;let n={retain:e};return r!=null&&typeof r=="object"&&Object.keys(r).length>0&&(n.attributes=r),this.push(n)}push(e){let r=this.ops.length,n=this.ops[r-1];if(e=qm(e),typeof n=="object"){if(typeof e.delete=="number"&&typeof n.delete=="number")return this.ops[r-1]={delete:n.delete+e.delete},this;if(typeof n.delete=="number"&&e.insert!==null&&e.insert!==void 0&&(r-=1,n=this.ops[r-1],typeof n!="object"))return this.ops.unshift(e),this;if((0,Oo.default)(e.attributes,n.attributes)){if(typeof e.insert=="string"&&typeof n.insert=="string")return this.ops[r-1]={insert:n.insert+e.insert},typeof e.attributes=="object"&&(this.ops[r-1].attributes=e.attributes),this;if(typeof e.retain=="number"&&typeof n.retain=="number")return this.ops[r-1]={retain:n.retain+e.retain},typeof e.attributes=="object"&&(this.ops[r-1].attributes=e.attributes),this}}return r===this.ops.length?this.ops.push(e):this.ops.splice(r,0,e),this}chop(){let e=this.ops[this.ops.length-1];return e&&typeof e.retain=="number"&&!e.attributes&&this.ops.pop(),this}filter(e){return this.ops.filter(e)}forEach(e){this.ops.forEach(e)}map(e){return this.ops.map(e)}partition(e){let r=[],n=[];return this.forEach(o=>{(e(o)?r:n).push(o)}),[r,n]}reduce(e,r){return this.ops.reduce(e,r)}changeLength(){return this.reduce((e,r)=>r.insert?e+_e.length(r):r.delete?e-r.delete:e,0)}length(){return this.reduce((e,r)=>e+_e.length(r),0)}slice(e=0,r=1/0){let n=[],o=new se(this.ops),s=0;for(;s<r&&o.hasNext();){let i;s<e?i=o.next(e-s):(i=o.next(r-s),n.push(i)),s+=_e.length(i)}return new ue(n)}compose(e){let r=new se(this.ops),n=new se(e.ops),o=[],s=n.peek();if(s!=null&&typeof s.retain=="number"&&(s.attributes===null||s.attributes===void 0)){let c=s.retain;for(;r.peekType()==="insert"&&r.peekLength()<=c;)c-=r.peekLength(),o.push(r.next());s.retain-c>0&&n.next(s.retain-c)}let i=new ue(o);for(;r.hasNext()||n.hasNext();)if(n.peekType()==="insert")i.push(n.next());else if(r.peekType()==="delete")i.push(r.next());else{let c=Math.min(r.peekLength(),n.peekLength()),a=r.next(c),u=n.next(c);if(u.retain){let l={};if(typeof a.retain=="number")l.retain=typeof u.retain=="number"?c:u.retain;else if(typeof u.retain=="number")a.retain===null||a.retain===void 0?l.insert=a.insert:l.retain=a.retain;else{let f=a.retain===null||a.retain===void 0?"insert":"retain",[h,p,g]=Xu(a[f],u.retain),m=ue.getHandler(h);l[f]={[h]:m.compose(p,g,f==="retain")}}let d=Xt.compose(a.attributes,u.attributes,typeof a.retain=="number");if(d&&(l.attributes=d),i.push(l),!n.hasNext()&&(0,Oo.default)(i.ops[i.ops.length-1],l)){let f=new ue(r.rest());return i.concat(f).chop()}}else typeof u.delete=="number"&&(typeof a.retain=="number"||typeof a.retain=="object"&&a.retain!==null)&&i.push(u)}return i.chop()}concat(e){let r=new ue(this.ops.slice());return e.ops.length>0&&(r.push(e.ops[0]),r.ops=r.ops.concat(e.ops.slice(1))),r}diff(e){if(this.ops===e.ops)return new ue;let r=this.deltasToStrings(e),n=Wi(ko(r[0],r[1])),o=new se(this.ops),s=new se(e.ops);return this.convertChangesToDelta(n,o,s).chop()}eachLine(e,r=` `){let n=new se(this.ops),o=new ue,s=0;for(;n.hasNext();){if(n.peekType()!=="insert")return;let i=n.peek(),c=_e.length(i)-n.peekLength(),a=typeof i.insert=="string"?i.insert.indexOf(r,c)-c:-1;if(a<0)o.push(n.next());else if(a>0)o.push(n.next(a));else{if(e(o,n.next(1).attributes||{},s)===!1)return;s+=1,o=new ue}}o.length()>0&&e(o,{},s)}invert(e){let r=new ue;return this.reduce((n,o)=>{if(o.insert)r.delete(_e.length(o));else{if(typeof o.retain=="number"&&(o.attributes===null||o.attributes===void 0))return r.retain(o.retain),n+o.retain;if(o.delete||typeof o.retain=="number"){let s=o.delete||o.retain;return e.slice(n,n+s).forEach(c=>{o.delete?r.push(c):o.retain&&o.attributes&&r.retain(_e.length(c),Xt.invert(o.attributes,c.attributes))}),n+s}else if(typeof o.retain=="object"&&o.retain!==null){let s=e.slice(n,n+1),i=new se(s.ops).next(),[c,a,u]=Xu(o.retain,i.insert),l=ue.getHandler(c);return r.retain({[c]:l.invert(a,u)},Xt.invert(o.attributes,i.attributes)),n+1}}return n},0),r.chop()}transform(e,r=!1){if(r=!!r,typeof e=="number")return this.transformPosition(e,r);let n=e,o=new se(this.ops),s=new se(n.ops),i=new ue;for(;o.hasNext()||s.hasNext();)if(o.peekType()==="insert"&&(r||s.peekType()!=="insert"))i.retain(_e.length(o.next()));else if(s.peekType()==="insert")i.push(s.next());else{let c=Math.min(o.peekLength(),s.peekLength()),a=o.next(c),u=s.next(c);if(a.delete)continue;if(u.delete)i.push(u);else{let l=a.retain,d=u.retain,f=typeof d=="object"&&d!==null?d:c;if(typeof l=="object"&&l!==null&&typeof d=="object"&&d!==null){let h=Object.keys(l)[0];if(h===Object.keys(d)[0]){let p=ue.getHandler(h);p&&(f={[h]:p.transform(l[h],d[h],r)})}}i.retain(f,Xt.transform(a.attributes,u.attributes,r))}}return i.chop()}transformPosition(e,r=!1){r=!!r;let n=new se(this.ops),o=0;for(;n.hasNext()&&o<=e;){let s=n.peekLength(),i=n.peekType();if(n.next(),i==="delete"){e-=Math.min(s,e-o);continue}else i==="insert"&&(o<e||!r)&&(e+=s);o+=s}return e}diffWithCursor(e,r){if(this.ops===e.ops)return new ue;let n=this.deltasToStrings(e);if(Math.max(...n.map(d=>d.length))>Jm){let d=Wi(Ki(n[0],n[1])),f=new se(this.ops),h=new se(e.ops);return this.convertChangesToDelta(d,f,h).chop()}else if(r===null)return this.diff(e);let s=Wi(ko(n[0],n[1])),i=0,c=[];for(let d=0;d<s.length;d++){let f=s[d],h=i,p=i+(f.count??0),g=r>h&&r<=p,m=!f.added&&!f.removed,y=f.removed&&!f.added,E=s[d+1],_=E&&E.added&&!E.removed;if(m&&g&&_){let S=this.tryMoveInsertionToCursor(f,E,r,h);if(S){c.push(...S),d++,i=p;continue}}if(y){let S=this.tryMoveDeletionToCursor(f,c,r,i);if(S){c.pop(),c.push(...S),i+=f.count??0;continue}}c.push(f),f.added||(i+=f.count??0)}s=c;let a=new se(this.ops),u=new se(e.ops);return this.convertChangesToDelta(s,a,u).chop()}tryMoveInsertionToCursor(e,r,n,o){let s=r.value,i=s.length,c=n-o-i;if(!(e.value.substring(c,c+s.length)===s))return null;let l=e.value.substring(0,c),d=e.value.substring(c),f=[];return l.length>0&&f.push({value:l,count:l.length,added:!1,removed:!1}),f.push(r),d.length>0&&f.push({value:d,count:d.length,added:!1,removed:!1}),f}tryMoveDeletionToCursor(e,r,n,o){let s=r[r.length-1];if(!s||s.added||s.removed)return null;let i=o-(s.count??0),c=o;if(n<i||n>=c)return null;let a=e.value,u=n-i;if(!(s.value.substring(u,u+a.length)===a))return null;let f=s.value.substring(0,u),h=s.value.substring(u),p=e.count??0,g=h.substring(p),m=[];return f.length>0&&m.push({value:f,count:f.length,added:!1,removed:!1}),m.push(e),g.length>0&&m.push({value:g,count:g.length,added:!1,removed:!1}),m}deltasToStrings(e){return[this,e].map(r=>r.map(n=>{if(n.insert!==null||n.insert!==void 0)return typeof n.insert=="string"?n.insert:Wm;let o=r===e?"on":"with";throw new Error("diff() called "+o+" non-document")}).join(""))}convertChangesToDelta(e,r,n){let o=new ue;return e.forEach(s=>{let i=s.count??0;for(;i>0;){let c=0;if(s.added)c=Math.min(n.peekLength(),i),o.push(n.next(c));else if(s.removed)c=Math.min(i,r.peekLength()),r.next(c),o.delete(c);else{c=Math.min(r.peekLength(),n.peekLength(),i);let a=r.next(c),u=n.next(c);(0,Oo.default)(a.insert,u.insert)?o.retain(c,Xt.diff(a.attributes,u.attributes)):o.push(u).delete(c)}i-=c}}),o}},Zu=Qm;var Uo={};mu(Uo,{ConnectionErrorCode:Tr,createSyncManager:qu,Delta:Zu,CRDT_DOC_META_PERSISTENCE_KEY:So,CRDT_RECORD_MAP_KEY:bo,LOCAL_EDITOR_ORIGIN:vo,LOCAL_UNDO_IGNORED_ORIGIN:hu,retrySyncConnection:()=>Sn.retryNow()});var Od=w(Ar(),1);var ud=w(W(),1);var td=100,rd=5,nd=5e3;function Xm(){let t=window.navigator.userAgent,e="Unknown";return t.includes("Firefox")?e="Firefox":t.includes("Edg")?e="Microsoft Edge":t.includes("Chrome")&&!t.includes("Edg")?e="Chrome":t.includes("Safari")&&!t.includes("Chrome")?e="Safari":t.includes("MSIE")||t.includes("Trident")?e="Internet Explorer":(t.includes("Opera")||t.includes("OPR"))&&(e="Opera"),e}function od(t,e,r){if(t.size!==e.size)return!1;for(let[n,o]of t.entries())if(!e.has(n)||!r(o,e.get(n)))return!1;return!0}function sd(t,e){return!t||!e?t===e:Object.keys(t).length!==Object.keys(e).length?!1:Object.entries(t).every(([r,n])=>n===e[r])}function id(t){let{avatar_urls:e,id:r,name:n,slug:o}=t;return{avatar_urls:e,browserType:Xm(),enteredAt:Date.now(),id:r,name:n,slug:o}}function cd(t,e){return typeof t=="object"&&t!==null&&e in t?t[e]:null}function Ji(t){return Object.keys(t)}var ad=class extends qt{getStates(){return super.getStates()}getLocalStateField(t){let e=this.getLocalState();return cd(e,t)}setLocalStateField(t,e){super.setLocalStateField(t,e)}};var Zm=class extends ad{setLocalStateField(t,e){this.isFieldEqual(t,e,this.getLocalStateField(t)??void 0)||super.setLocalStateField(t,e)}isFieldEqual(t,e,r){if(["clientId","isConnected","isMe"].includes(t))return e===r;if(t in this.equalityFieldChecks){let n=this.equalityFieldChecks[t];return n(e,r)}throw new Error(`No equality check implemented for awareness state field "${t.toString()}".`)}isStateEqual(t,e){return[...new Set([...Ji(t),...Ji(e)])].every(r=>{let n=t[r],o=e[r];return this.isFieldEqual(r,n,o)})}},ld=class extends Zm{hasSetupRun=!1;disconnectedCollaborators=new Set;seenStates=new Map;previousSnapshot=new Map;stateSubscriptions=[];myThrottledState={};throttleTimeouts=new Map;setUp=()=>{this.hasSetupRun||(this.hasSetupRun=!0,this.onSetUp(),this.on("change",({added:t,removed:e,updated:r})=>{[...t,...r].forEach(n=>{this.disconnectedCollaborators.delete(n)}),e.forEach(n=>{this.disconnectedCollaborators.add(n),setTimeout(()=>{this.disconnectedCollaborators.delete(n),this.updateSubscribers(!0)},nd)}),this.updateSubscribers()}))};getCurrentState(){return Array.from(this.previousSnapshot.values())}getSeenStates(){return this.seenStates}onStateChange(t){return this.stateSubscriptions.push(t),()=>{this.stateSubscriptions=this.stateSubscriptions.filter(e=>e!==t)}}setThrottledLocalStateField(t,e,r){this.setLocalStateField(t,e),this.throttleTimeouts.set(t,setTimeout(()=>{this.throttleTimeouts.delete(t),this.myThrottledState[t]&&(this.setLocalStateField(t,this.myThrottledState[t]),delete this.myThrottledState[t])},r))}setConnectionStatus(t){t?this.disconnectedCollaborators.delete(this.clientID):this.disconnectedCollaborators.add(this.clientID),this.updateSubscribers(!0)}updateSubscribers(t=!1){if(!this.stateSubscriptions.length)return;let e=this.getStates();this.seenStates=new Map([...this.seenStates.entries(),...e.entries()]);let r=new Map([...this.disconnectedCollaborators,...e.keys()].filter(n=>Object.keys(this.seenStates.get(n)??{}).length>0).map(n=>{let o=this.seenStates.get(n),s=!this.disconnectedCollaborators.has(n),i=n===this.clientID,c=i?this.myThrottledState:{},a={...o,...c,clientId:n,isConnected:s,isMe:i};return[n,a]}));!t&&od(this.previousSnapshot,r,this.isStateEqual.bind(this))||(this.previousSnapshot=r,this.stateSubscriptions.forEach(n=>{n(Array.from(r.values()))}))}};var x="core";var Qi=class extends ld{onSetUp(){this.setCurrentCollaboratorInfo()}async setCurrentCollaboratorInfo(){let t=await(0,ud.resolveSelect)(x).getCurrentUser(),e=id(t);this.setLocalStateField("collaboratorInfo",e)}},Xi={collaboratorInfo:sd},dd=class extends Qi{equalityFieldChecks=Xi};var fd=w(W(),1);var hd=w(Ar(),1);function Zi(t){let e=[],r=t;for(;r;){let n=r.parent;if(!n||!(n instanceof C.Array))return null;let o=-1;for(let i=0;i<n.length;i++)if(n.get(i)===r){o=i;break}if(o===-1)return null;e.unshift(o);let s=n.parent;if(s instanceof C.Map&&s.get("clientId")!==void 0)r=s;else break}return e}function ec(t){if(t.length===0)return null;let{getBlocks:e}=(0,fd.select)(hd.store),n=ey(e(),e);for(let o=0;o<t.length;o++){let s=n[t[o]];if(!s)return null;if(o===t.length-1)return s.clientId;n=s.innerBlocks}return null}function ey(t,e){let r=pd(t,"core/post-content");return r?e(r.clientId):t}function pd(t,e){for(let r of t){if(r.name===e)return r;if(r.innerBlocks?.length){let n=pd(r.innerBlocks,e);if(n)return n}}return null}var mt=w(bn(),1);var md=w(Ai(),1),{lock:yd,unlock:Se}=(0,md.__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/core-data");var{ConnectionErrorCode:Ed,createSyncManager:ty,Delta:tc,CRDT_DOC_META_PERSISTENCE_KEY:wd,CRDT_RECORD_MAP_KEY:qe,LOCAL_EDITOR_ORIGIN:_d,LOCAL_UNDO_IGNORED_ORIGIN:rc,retrySyncConnection:Sd}=Se(Uo),Lo;function pe(){return Lo||(Lo=ty(),Lo)}function yt(t,e){return t.getMap(e)}function Po(t={}){return new C.Map(Object.entries(t))}function vd(t){return t instanceof C.Map}function vn(t,e){let n=yt(e,qe).get("blocks");return n instanceof C.Array?Rd(t,n):null}var bd=57344;function Cd(t){for(let r=bd;r<bd+16;r++){let n=String.fromCharCode(r);if(!t.includes(n))return n}return null}function Mo(t,e){if(!t.includes("<")&&!t.includes("&"))return e;let r=Cd(t);if(!r)return e;let n=t.slice(0,e)+r+t.slice(e),s=(0,mt.create)({html:n}).text.indexOf(r);return s===-1?e:s}function No(t,e){if(!t.includes("<")&&!t.includes("&"))return e;let r=Cd(t);if(!r)return e;let n=(0,mt.create)({html:t}),o=(0,mt.create)({text:r});n.formats[e]&&(o.formats[0]=n.formats[e]);let s=(0,mt.insert)(n,o,e,e),c=(0,mt.toHTMLString)({value:s}).indexOf(r);return c===-1?e:c}function Rd(t,e){for(let r of e){if(r.get("clientId")===t)return r;let n=r.get("innerBlocks");if(n&&n.length>0){let o=Rd(t,n);if(o)return o}}return null}var Td=w(W(),1);var xd=w(Ar(),1);var Dr=(t=>(t.None="none",t.Cursor="cursor",t.SelectionInOneBlock="selection-in-one-block",t.SelectionInMultipleBlocks="selection-in-multiple-blocks",t.WholeBlock="whole-block",t))(Dr||{}),kr=(t=>(t.Forward="f",t.Backward="b",t))(kr||{});function Id(t,e,r,n){let{selectionDirection:o}=n??{},i=yt(r,qe).get("blocks"),c=Object.keys(t).length===0,a={type:"none"};if(c||!i)return a;let u=t.clientId===e.clientId,l=u&&t.offset===e.offset;if(u&&t.offset===void 0&&e.offset===void 0){let p=Ad(t.clientId),g=p?ny(p,i):null;return g?{type:"whole-block",blockPosition:g}:a}else if(l){let p=Cn(t,i);return p?{type:"cursor",cursorPosition:p}:a}else if(u){let p=Cn(t,i),g=Cn(e,i);return!p||!g?a:{type:"selection-in-one-block",cursorStartPosition:p,cursorEndPosition:g,selectionDirection:o}}let f=Cn(t,i),h=Cn(e,i);return!f||!h?a:{type:"selection-in-multiple-blocks",cursorStartPosition:f,cursorEndPosition:h,selectionDirection:o}}function Cn(t,e){let r=Ad(t.clientId),n=r?ry(r,e):null;if(!n||!t.attributeKey||t.offset===void 0)return null;let s=n.get("attributes")?.get(t.attributeKey);return s instanceof C.Text?{relativePosition:C.createRelativePositionFromTypeIndex(s,No(s.toString(),t.offset)),absoluteOffset:t.offset}:null}function Ad(t){let{getBlockIndex:e,getBlockRootClientId:r,getBlockName:n}=(0,Td.select)(xd.store),o=[],s=t;for(;s;){let i=e(s);if(i===-1)return null;o.unshift(i);let c=r(s);if(!c||n(c)==="core/post-content")break;s=c}return o.length>0?o:null}function ry(t,e){let r=e;for(let n=0;n<t.length;n++){if(t[n]>=r.length)return null;let o=r.get(t[n]);if(!o)return null;if(n===t.length-1)return o;r=o.get("innerBlocks")??new C.Array}return null}function ny(t,e){let r=e;for(let n=0;n<t.length;n++){if(t[n]>=r.length)return null;if(n===t.length-1)return C.createRelativePositionFromTypeIndex(r,t[n]);r=r.get(t[n])?.get("innerBlocks")??new C.Array}return null}function Dd(t,e){if(t.type!==e.type)return!1;switch(t.type){case"none":return!0;case"cursor":return Rn(t.cursorPosition,e.cursorPosition);case"selection-in-one-block":return Rn(t.cursorStartPosition,e.cursorStartPosition)&&Rn(t.cursorEndPosition,e.cursorEndPosition)&&t.selectionDirection===e.selectionDirection;case"selection-in-multiple-blocks":return Rn(t.cursorStartPosition,e.cursorStartPosition)&&Rn(t.cursorEndPosition,e.cursorEndPosition)&&t.selectionDirection===e.selectionDirection;case"whole-block":return C.compareRelativePositions(t.blockPosition,e.blockPosition);default:return!1}}function Rn(t,e){let r=C.compareRelativePositions(t.relativePosition,e.relativePosition),n=t.absoluteOffset===e.absoluteOffset;return r&&n}var Ud=class extends Qi{constructor(t,e,r,n){super(t),this.kind=e,this.name=r,this.postId=n}equalityFieldChecks={...Xi,editorState:this.areEditorStatesEqual};onSetUp(){super.onSetUp(),this.subscribeToCollaboratorSelectionChanges()}subscribeToCollaboratorSelectionChanges(){let{getSelectionStart:t,getSelectionEnd:e,getSelectedBlocksInitialCaretPosition:r}=(0,Or.select)(Od.store),n=t(),o=e(),s=null,i=null;(0,Or.subscribe)(()=>{let c=t(),a=e();if(c===n&&a===o)return;i||(i={start:n,end:o}),n=c,o=a;let u=r();this.updateSelectionInEntityRecord(n,o,u),s&&clearTimeout(s),s=setTimeout(()=>{let l={};i&&(l.selectionDirection=oy(i.start,i.end,n,o),i=null);let d=Id(n,o,this.doc,l);this.setThrottledLocalStateField("editorState",{selection:d},td)},rd)})}async updateSelectionInEntityRecord(t,e,r){let n={selection:{selectionStart:t,selectionEnd:e,initialPosition:r}},o={undoIgnore:!0};(0,Or.dispatch)(x).editEntityRecord(this.kind,this.name,this.postId,n,o)}areEditorStatesEqual(t,e){return!t||!e?t===e:!t.selection||!e.selection?t.selection===e.selection:Dd(t.selection,e.selection)}convertSelectionStateToAbsolute(t){if(t.type===Dr.None)return{richTextOffset:null,localClientId:null};if(t.type===Dr.WholeBlock){let i=C.createAbsolutePositionFromRelativePosition(t.blockPosition,this.doc),c=null;if(i&&i.type instanceof C.Array){let u=i.type.get(i.index);if(u instanceof C.Map){let l=Zi(u);c=l?ec(l):null}}return{richTextOffset:null,localClientId:c}}let e="cursorPosition"in t?t.cursorPosition:t.cursorStartPosition,r=C.createAbsolutePositionFromRelativePosition(e.relativePosition,this.doc);if(!r)return{richTextOffset:null,localClientId:null};let n=r.type.parent?.parent,o=n instanceof C.Map?Zi(n):null,s=o?ec(o):null;return{richTextOffset:Mo(r.type.toString(),r.index),localClientId:s}}isYItem(t){return"content"in t}getDebugData(){let t=this.doc,e=Object.fromEntries(Array.from(t.share,([o,s])=>[o,s.toJSON()])),r=new Map(Array.from(this.getSeenStates().entries()).map(([o,s])=>[String(o),{name:s.collaboratorInfo.name,wpUserId:s.collaboratorInfo.id}])),n={};return t.store.clients.forEach((o,s)=>{let i=o.filter(this.isYItem);n[s]=i.map(c=>{let{left:a,right:u,...l}=c;return{...l,left:a?{id:a.id,length:a.length,origin:a.origin,content:a.content}:null,right:u?{id:u.id,length:u.length,origin:u.origin,content:u.content}:null}})}),{doc:e,clients:n,collaboratorMap:Object.fromEntries(r)}}};function oy(t,e,r,n){let o=!kd(t,r),s=!kd(e,n);return o&&!s?kr.Backward:kr.Forward}function kd(t,e){return t.clientId===e.clientId&&t.attributeKey===e.attributeKey&&t.offset===e.offset}var Xd=w(Qe(),1),Zd=w(nr(),1);var Vo,sy=new Uint8Array(16);function nc(){if(!Vo&&(Vo=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Vo))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Vo(sy)}var ee=[];for(let t=0;t<256;++t)ee.push((t+256).toString(16).slice(1));function Ld(t,e=0){return ee[t[e+0]]+ee[t[e+1]]+ee[t[e+2]]+ee[t[e+3]]+"-"+ee[t[e+4]]+ee[t[e+5]]+"-"+ee[t[e+6]]+ee[t[e+7]]+"-"+ee[t[e+8]]+ee[t[e+9]]+"-"+ee[t[e+10]]+ee[t[e+11]]+ee[t[e+12]]+ee[t[e+13]]+ee[t[e+14]]+ee[t[e+15]]}var iy=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),oc={randomUUID:iy};function cy(t,e,r){if(oc.randomUUID&&!e&&!t)return oc.randomUUID();t=t||{};let n=t.random||(t.rng||nc)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){r=r||0;for(let o=0;o<16;++o)e[r+o]=n[o];return e}return Ld(n)}var Tn=cy;var jo=w(Qe(),1),Nd=w(nr(),1),Vd=w(bn(),1);var Pd=w(bn(),1),ay=500;function ly(t){let e=new Map;return function(r){let n=e.get(r);if(n)return n;let o=Pd.RichTextData.fromHTMLString(r);return e.size>=t&&e.delete(e.keys().next().value),e.set(r,o),o}}var Md=ly(ay);var sc=new WeakMap;function cc(t){if(t instanceof Vd.RichTextData)return t.valueOf();if(Array.isArray(t))return t.map(cc);if(t&&typeof t=="object"){let e={};for(let[r,n]of Object.entries(t))e[r]=cc(n);return e}return t}function uy(t,e){let r={...e};for(let[n,o]of Object.entries(e)){if(hy(t,n)){delete r[n];continue}r[n]=cc(o)}return r}function Bd(t){return t.map(e=>{let{name:r,innerBlocks:n,attributes:o,...s}=e;return delete s.validationIssues,{...s,name:r,attributes:uy(r,o),innerBlocks:Bd(n)}})}function ac(t,e){if(t?.type==="rich-text"&&typeof e=="string")return Md(e);if(Array.isArray(e))return e.map(r=>ac(t,r));if(e&&typeof e=="object"){let r={};for(let[n,o]of Object.entries(e))r[n]=ac(t?.query?.[n],o);return r}return e}function uc(t){return t.map(e=>{let{name:r,innerBlocks:n,attributes:o,...s}=e,i={...o};for(let[c,a]of Object.entries(o)){let u=Fo(r,c);u&&(i[c]=ac(u,a))}return{...s,name:r,attributes:i,innerBlocks:uc(n??[])}})}function lc(t,e){let r=e.toJSON(),n={innerBlocks:null,clientId:null},o=(0,jo.default)(Object.assign({},t,n),Object.assign({},r,n)),s=t.innerBlocks||[],i=e.get("innerBlocks");return o&&s.length===i?.length&&s.every((c,a)=>lc(c,i.get(a)))}function jd(t,e){return new C.Map(Object.entries(e).map(([r,n])=>[r,Fd(t,r,n)]))}function Fd(t,e,r){return Gd(t,e)?new C.Text(r?.toString()??""):r}function Yd(t){return Po(Object.fromEntries(Object.entries(t).map(([e,r])=>{switch(e){case"attributes":return[e,jd(t.name,r)];case"innerBlocks":{let n=new C.Array;return Array.isArray(r)?(n.insert(0,r.map(o=>Yd(o))),[e,n]):[e,n]}default:return[e,r]}})))}function dc(t,e,r){sc.has(e)||sc.set(e,Bd(e));let n=sc.get(e)??[],o=Math.min(n.length??0,t.length),s=0,i=0;for(;s<o&&lc(n[s],t.get(s));s++);for(;i<o-s&&lc(n[n.length-i-1],t.get(t.length-i-1));i++);let c=o-s-i,a=Math.max(0,n.length-t.length),u=Math.max(0,t.length-n.length);for(let d=0;d<c;d++,s++){let f=n[s],h=t.get(s);Object.entries(f).forEach(([p,g])=>{switch(p){case"attributes":{let m=h.get(p);if(!m){h.set(p,jd(f.name,g));break}Object.entries(g).forEach(([y,E])=>{let _=m?.get(y);(!fy(f.name,y,_)||!(0,jo.default)(_,E))&&dy(f.name,y,E,m,r)}),m.forEach((y,E)=>{g.hasOwnProperty(E)||m.delete(E)});break}case"innerBlocks":{let m=h.get(p);m instanceof C.Array||(m=new C.Array,h.set(p,m)),dc(m,g??[],r);break}default:(0,jo.default)(f[p],h.get(p))||h.set(p,g)}}),h.forEach((p,g)=>{f.hasOwnProperty(g)||h.delete(g)})}t.delete(s,u);for(let d=0;d<a;d++,s++){let f=[Yd(n[s])];t.insert(s,f)}let l=new Set;for(let d=0;d<t.length;d++){let f=t.get(d),h=f.get("clientId");h&&(l.has(h)&&(h=Tn(),f.set("clientId",h)),l.add(h))}}function dy(t,e,r,n,o){let s=Gd(t,e),i=n.get(e);s&&typeof r=="string"&&n.has(e)&&i instanceof C.Text?fc(i,r,o):n.set(e,Fd(t,e,r))}var Bo;function Fo(t,e){if(!Bo){Bo=new Map;for(let r of(0,Nd.getBlockTypes)())Bo.set(r.name,new Map(Object.entries(r.attributes??{}).map(([n,o])=>{let{role:s,type:i,query:c}=o;return[n,{role:s,type:i,query:c}]})))}return Bo.get(t)?.get(e)}function fy(t,e,r){let n=Fo(t,e)?.type;return n==="rich-text"?r instanceof C.Text:n==="string"?typeof r=="string":!0}function hy(t,e){return Fo(t,e)?.role==="local"}function Gd(t,e){return Fo(t,e)?.type==="rich-text"}var ic;function fc(t,e,r=null){ic||(ic=new C.Doc);let n=ic.getText("temporary-text");n.delete(0,n.length),n.insert(0,e);let o=new tc(t.toDelta()),s=new tc(n.toDelta()),i=o.diffWithCursor(s,r);t.applyDelta(i.ops)}var Go=w(W(),1),hc=w(Ar(),1),Hd=w(nr(),1);var py=5,Ur=(t=>(t.RelativeSelection="RelativeSelection",t.BlockSelection="BlockSelection",t))(Ur||{});function zd(t,e=py){let r=[],n=()=>r.slice(0),o=i=>{if(!i?.selectionStart?.clientId||!i?.selectionEnd?.clientId)return;let{selectionStart:c,selectionEnd:a}=i,u=$d(c,t),l=$d(a,t);s({start:u,end:l})},s=i=>{let c=i.start.clientId,a=i.end.clientId;r=r.filter(u=>!(u.start.clientId===c&&u.end.clientId===a)),r.unshift(i),r.length>e+1&&(r=r.slice(0,e+1))};return{getSelectionHistory:n,updateSelection:o}}function $d(t,e){let r=t.clientId,o=vn(r,e)?.get("attributes"),s=t.attributeKey,i=s?o?.get(s):void 0;if(!(i instanceof C.Text)||!(s&&r))return{type:"BlockSelection",clientId:r};let u=t.offset??0,l=C.createRelativePositionFromTypeIndex(i,No(i.toString(),u));return{type:"RelativeSelection",attributeKey:s,relativePosition:l,clientId:r,offset:u}}var Kd=new WeakMap;function qd(t){let e=Kd.get(t);return e||(e=zd(t),Kd.set(t,e)),e}function $o(t){return qd(t).getSelectionHistory()}function Wd(t,e){return qd(t).updateSelection(e)}function Yo(t,e){if(t.type===Ur.RelativeSelection){let{relativePosition:r,attributeKey:n,clientId:o}=t,s=C.createAbsolutePositionFromRelativePosition(r,e);if(s)return{clientId:o,attributeKey:n,offset:Mo(s.type.toString(),s.index)}}else if(t.type===Ur.BlockSelection)return{clientId:t.clientId,attributeKey:void 0,offset:void 0};return null}function gy(t,e){let{start:r,end:n}=t,o=vn(r.clientId,e),s=vn(n.clientId,e);if(!o||!s)return null;let i=Yo(r,e),c=Yo(n,e);return i===null||c===null?null:{selectionStart:i,selectionEnd:c}}function my(t,e){for(let r of e){let n=gy(r,t);if(n!==null)return n}return null}function Jd(t,e){let r=my(e,t);if(r===null)return;let{getBlock:n}=(0,Go.select)(hc.store),{resetSelection:o}=(0,Go.dispatch)(hc.store),{selectionStart:s,selectionEnd:i}=r;if(s.clientId===i.clientId){let a=n(s.clientId),u=a&&(0,Hd.isUnmodifiedBlock)(a);if(s.offset===0&&i.offset===0&&u&&!s.attributeKey&&!i.attributeKey){let d={clientId:s.clientId},f={clientId:i.clientId};o(d,f,0)}else o(s,i,0)}else o(i,i,0)}function Qd(t,e){if(e.length===0)return null;let{start:r,end:n}=e[0];if(r.type===Ur.BlockSelection||n.type===Ur.BlockSelection)return null;let o=Yo(r,t),s=Yo(n,t);if(!o||!s)return null;let i=o.offset!==r.offset,c=s.offset!==n.offset;return!i&&!c?null:{selectionStart:o,selectionEnd:s}}var Ko="_crdt_document",ef=new Set([Ko]);function yy(t,e){let r=yt(t,qe);Object.entries(e).forEach(([n,o])=>{if(typeof o!="function"){let s=r.get(n);zo(r,n,s,o)}})}function tf(t,e,r){let n=yt(t,qe);if(Object.keys(e).forEach(o=>{if(!r.has(o))return;let s=e[o];if(typeof s!="function")switch(o){case"blocks":{if(!s){n.set(o,void 0);break}let i=n.get(o);i instanceof C.Array||(i=new C.Array,n.set(o,i));let c=e.selection?.selectionStart?.offset??null;dc(i,s,c);break}case"content":case"excerpt":case"title":{let i=n.get(o),c=pc(s);if(o==="title"&&!i?.toString()&&c==="Auto Draft"&&(c=""),i instanceof C.Text)fc(i,c??"");else{let a=new C.Text(c??"");n.set(o,a)}break}case"meta":{let i=n.get("meta");vd(i)||(i=Po(),n.set("meta",i)),Object.entries(s??{}).forEach(([c,a])=>{ef.has(c)||zo(i,c,i.get(c),a)});break}case"slug":{if(!s)break;let i=n.get(o);zo(n,o,i,s);break}default:{let i=n.get(o);zo(n,o,i,s)}}}),e.selection){let o=e.selection;setTimeout(()=>{Wd(t,o)},0)}}function Ey(t){return yt(t,qe).toJSON()}function rf(t,e,r){let n=yt(t,qe),o={},s=Object.fromEntries(Object.entries(n.toJSON()).filter(([a,u])=>{if(!r.has(a))return!1;let l=e[a];switch(a){case"blocks":{if(t.meta?.get(wd)&&e.content){let d=n.get("blocks")?.toJSON()??[];return(0,Zd.__unstableSerializeAndClean)(d).trim()!==pc(e.content)}return!0}case"date":return l===null||e.modified===l?!1:Lr(l,u);case"meta":{let d=l??{};o=Object.fromEntries(Object.entries(u??{}).filter(([h])=>ef.has(h)?!1:h in d));let f={...d,...o};return Lr(l,f)}case"status":return u==="auto-draft"?!1:Lr(l,u);case"content":case"excerpt":case"title":return Lr(pc(l),u);default:return Lr(l,u)}}));s.blocks&&(s.blocks=uc(s.blocks)),typeof s.meta=="object"&&(s.meta={...e.meta,...o});let i=$o(t),c=Qd(t,i);return c&&(s.selection={...c,initialPosition:0}),s}var nf={applyChangesToCRDTDoc:yy,createAwareness:t=>new dd(t),getChangesFromCRDTDoc:Ey},of={applyChangesToCRDTDoc:()=>{},getChangesFromCRDTDoc:()=>({}),shouldSync:(t,e)=>e===null};function pc(t){if(typeof t=="string")return t;if(t&&typeof t=="object"&&"raw"in t&&typeof t.raw=="string")return t.raw}function Lr(t,e){return!(0,Xd.default)(t,e)}function zo(t,e,r,n){if(n===void 0){t.delete(e);return}Lr(r,n)&&t.set(e,n)}var M="id",wy=["title","excerpt","content"],_y={blocks:{read:t=>(0,Ho.parse)(t.content?.raw??""),write:t=>({content:(0,Ho.__unstableSerializeAndClean)(t.blocks)})}},qo=[{label:(0,B.__)("Base"),kind:"root",key:!1,name:"__unstableBase",baseURL:"/",baseURLParams:{_fields:["description","gmt_offset","home","image_sizes","image_size_threshold","image_output_formats","jpeg_interlaced","png_interlaced","gif_interlaced","name","site_icon","site_icon_url","site_logo","timezone_string","url","page_for_posts","page_on_front","show_on_front"].join(",")},plural:"__unstableBases"},{label:(0,B.__)("Post Type"),name:"postType",kind:"root",key:"slug",baseURL:"/wp/v2/types",baseURLParams:{context:"edit"},plural:"postTypes"},{name:"media",kind:"root",baseURL:"/wp/v2/media",baseURLParams:{context:"edit"},plural:"mediaItems",label:(0,B.__)("Media"),rawAttributes:["caption","title","description"],supportsPagination:!0},{name:"taxonomy",kind:"root",key:"slug",baseURL:"/wp/v2/taxonomies",baseURLParams:{context:"edit"},plural:"taxonomies",label:(0,B.__)("Taxonomy")},{name:"sidebar",kind:"root",baseURL:"/wp/v2/sidebars",baseURLParams:{context:"edit"},plural:"sidebars",transientEdits:{blocks:!0},label:(0,B.__)("Widget areas")},{name:"widget",kind:"root",baseURL:"/wp/v2/widgets",baseURLParams:{context:"edit"},plural:"widgets",transientEdits:{blocks:!0},label:(0,B.__)("Widgets")},{name:"widgetType",kind:"root",baseURL:"/wp/v2/widget-types",baseURLParams:{context:"edit"},plural:"widgetTypes",label:(0,B.__)("Widget types")},{label:(0,B.__)("User"),name:"user",kind:"root",baseURL:"/wp/v2/users",getTitle:t=>t?.name||t?.slug,baseURLParams:{context:"edit"},plural:"users",supportsPagination:!0},{name:"comment",kind:"root",baseURL:"/wp/v2/comments",baseURLParams:{context:"edit"},plural:"comments",label:(0,B.__)("Comment"),supportsPagination:!0,syncConfig:of},{name:"menu",kind:"root",baseURL:"/wp/v2/menus",baseURLParams:{context:"edit"},plural:"menus",label:(0,B.__)("Menu"),supportsPagination:!0},{name:"menuItem",kind:"root",baseURL:"/wp/v2/menu-items",baseURLParams:{context:"edit"},plural:"menuItems",label:(0,B.__)("Menu Item"),rawAttributes:["title"],supportsPagination:!0},{name:"menuLocation",kind:"root",baseURL:"/wp/v2/menu-locations",baseURLParams:{context:"edit"},plural:"menuLocations",label:(0,B.__)("Menu Location"),key:"name"},{label:(0,B.__)("Global Styles"),name:"globalStyles",kind:"root",baseURL:"/wp/v2/global-styles",baseURLParams:{context:"edit"},plural:"globalStylesVariations",getTitle:()=>(0,B.__)("Custom Styles"),getRevisionsUrl:(t,e)=>`/wp/v2/global-styles/${t}/revisions${e?"/"+e:""}`,supportsPagination:!0},{label:(0,B.__)("Themes"),name:"theme",kind:"root",baseURL:"/wp/v2/themes",baseURLParams:{context:"edit"},plural:"themes",key:"stylesheet"},{label:(0,B.__)("Plugins"),name:"plugin",kind:"root",baseURL:"/wp/v2/plugins",baseURLParams:{context:"edit"},plural:"plugins",key:"plugin"},{label:(0,B.__)("Status"),name:"status",kind:"root",baseURL:"/wp/v2/statuses",baseURLParams:{context:"edit"},plural:"statuses",key:"slug"},{label:(0,B.__)("Registered Templates"),name:"registeredTemplate",kind:"root",baseURL:"/wp/v2/registered-templates",key:"id"},{label:(0,B.__)("Font Collections"),name:"fontCollection",kind:"root",baseURL:"/wp/v2/font-collections",baseURLParams:{context:"view"},plural:"fontCollections",key:"slug"},{label:(0,B.__)("Icons"),name:"icon",kind:"root",baseURL:"/wp/v2/icons",baseURLParams:{context:"view"},plural:"icons",key:"name"}],sf={root:{media:{since:"6.9",alternative:{kind:"postType",name:"attachment"}}}},Wo=[{kind:"postType",loadEntities:by},{kind:"taxonomy",loadEntities:vy},{kind:"root",name:"site",plural:"sites",loadEntities:Cy}],Sy=async(t,e,r,n)=>{let o={};if(!n&&t?.status==="auto-draft"&&(!e.status&&!o.status&&(o.status="draft"),(!e.title||e.title==="Auto Draft")&&!o.title&&(!t?.title||t?.title==="Auto Draft")&&(o.title="")),t){let s=`postType/${r}`,i=t.id,c=await pe()?.createPersistedCRDTDoc(s,i);c&&(o.meta={...e.meta,[Ko]:c})}return o};async function by(){let t=(0,xn.default)({path:"/wp/v2/types?context=view"}),e=window._wpCollaborationEnabled?(0,xn.default)({path:"/wp/v2/taxonomies?context=view"}):Promise.resolve({}),[r,n]=await Promise.all([t,e]);return Object.entries(r??{}).map(([o,s])=>{let i=["wp_template","wp_template_part"].includes(o),c=s?.rest_namespace??"wp/v2",a=new Set(["author","blocks","content","comment_status","date","excerpt","featured_media","format","meta","ping_status","slug","status","sticky","template","title",...s.taxonomies?.map(l=>n?.[l]?.rest_base)?.filter(Boolean)??[]]),u={kind:"postType",baseURL:`/${c}/${s.rest_base}`,baseURLParams:{context:"edit"},name:o,label:s.name,transientEdits:{..._y,selection:!0},mergedEdits:{meta:!0},rawAttributes:wy,getTitle:l=>l?.title?.rendered||l?.title||(i?ga(l.slug??""):String(l.id)),__unstablePrePersist:(l,d)=>Sy(l,d,o,i),__unstable_rest_base:s.rest_base,supportsPagination:!0,getRevisionsUrl:(l,d)=>`/${c}/${s.rest_base}/${l}/revisions${d?"/"+d:""}`,revisionKey:i&&!window?.__experimentalTemplateActivate?"wp_id":M};return u.syncConfig={applyChangesToCRDTDoc:(l,d)=>tf(l,d,a),createAwareness:(l,d)=>{let f="postType",h=parseInt(d,10);return new Ud(l,f,o,h)},getChangesFromCRDTDoc:(l,d)=>rf(l,d,a),getPersistedCRDTDoc:l=>l?.meta?.[Ko]||null},u})}async function vy(){let t=await(0,xn.default)({path:"/wp/v2/taxonomies?context=view"});return Object.entries(t??{}).map(([e,r])=>{let o={kind:"taxonomy",baseURL:`/${r?.rest_namespace??"wp/v2"}/${r.rest_base}`,baseURLParams:{context:"edit"},name:e,label:r.name,getTitle:s=>s?.name,supportsPagination:!0};return o.syncConfig=nf,o})}async function Cy(){let t={label:(0,B.__)("Site"),name:"site",kind:"root",key:!1,baseURL:"/wp/v2/settings",meta:{}},e=await(0,xn.default)({path:t.baseURL,method:"OPTIONS"}),r={};return Object.entries(e?.schema?.properties??{}).forEach(([n,o])=>{typeof o=="object"&&o.title&&(r[n]=o.title)}),[{...t,meta:{labels:r}}]}var Zt=(t,e,r="get")=>{let n=t==="root"?"":$r(t),o=$r(e);return`${r}${n}${o}`};function lf(t){let{query:e}=t;return e?et(e).context:"default"}function Ry(t,e,r,n){if(r===1&&n===-1)return e;let s=(r-1)*n,i=Math.max(t?.length??0,s+e.length),c=new Array(i);for(let a=0;a<i;a++){let u=a>=s&&a<s+n;c[a]=u?e[a-s]:t?.[a]}return c}function uf(t,e){return Object.fromEntries(Object.entries(t).filter(([r])=>!e.some(n=>Number.isInteger(n)?n===+r:n===r)))}function Ty(t={},e){switch(e.type){case"RECEIVE_ITEMS":{let r=lf(e),n=e.key||M,o=Array.isArray(e.items)?e.items:[e.items];return{...t,[r]:{...t[r],...Object.fromEntries(o.map(s=>[s?.[n],fs(t?.[r]?.[s?.[n]],s)]))}}}case"REMOVE_ITEMS":return Object.fromEntries(Object.entries(t).map(([r,n])=>[r,uf(n,e.itemIds)]))}return t}function xy(t={},e){switch(e.type){case"RECEIVE_ITEMS":{let r=lf(e),{query:n,key:o=M}=e,s=Array.isArray(e.items)?e.items:[e.items],i=n?et(n):{},c=!n||!Array.isArray(i.fields);return{...t,[r]:{...t[r],...s.reduce((a,u)=>{let l=u?.[o];return a[l]=t?.[r]?.[l]||c,a},{})}}}case"REMOVE_ITEMS":return Object.fromEntries(Object.entries(t).map(([r,n])=>[r,uf(n,e.itemIds)]))}return t}var Iy=(0,af.compose)([Br(t=>"query"in t),jr(t=>t.query?{...t,...et(t.query)}:t),Fn("context"),Fn("stableKey")])((t={},e)=>{if(e.type!=="RECEIVE_ITEMS"||!Array.isArray(e.items))return t;let r=e.key??M;return{itemIds:Ry(t?.itemIds||[],e.items.map(n=>n?.[r]).filter(Boolean),e.page,e.perPage),meta:e.meta}}),Ay=(t={},e)=>{switch(e.type){case"RECEIVE_ITEMS":return Iy(t,e);case"REMOVE_ITEMS":let r=e.itemIds.reduce((n,o)=>(n[o]=!0,n),{});return Object.fromEntries(Object.entries(t).map(([n,o])=>[n,Object.fromEntries(Object.entries(o).map(([s,i])=>[s,{...i,itemIds:i.itemIds.filter(c=>!r[c])}]))]));default:return t}},Jo=(0,cf.combineReducers)({items:Ty,itemIsComplete:xy,queries:Ay});function Dy(t={byId:{},queries:{}},e){return e.type==="RECEIVE_USER_QUERY"?{byId:{...t.byId,...e.users.reduce((r,n)=>({...r,[n.id]:n}),{})},queries:{...t.queries,[e.queryID]:e.users.map(r=>r.id)}}:t}function ky(t={},e){return e.type==="RECEIVE_CURRENT_USER"?e.currentUser:t}function Oy(t=void 0,e){return e.type==="RECEIVE_CURRENT_THEME"?e.currentTheme.stylesheet:t}function Uy(t=void 0,e){return e.type==="RECEIVE_CURRENT_GLOBAL_STYLES_ID"?e.id:t}function Ly(t={},e){return e.type==="RECEIVE_THEME_GLOBAL_STYLES"?{...t,[e.stylesheet]:e.globalStyles}:t}function Py(t={},e){return e.type==="RECEIVE_THEME_GLOBAL_STYLE_VARIATIONS"?{...t,[e.stylesheet]:e.variations}:t}var My=t=>(e,r)=>{if(r.type==="UNDO"||r.type==="REDO"){let{record:n}=r,o=e;return n.forEach(({id:{kind:s,name:i,recordId:c},changes:a})=>{o=t(o,{type:"EDIT_ENTITY_RECORD",kind:s,name:i,recordId:c,edits:Object.entries(a).reduce((u,[l,d])=>(u[l]=r.type==="UNDO"?d.from:d.to,u),{})})}),o}return t(e,r)};function Ny(t){return(0,df.compose)([My,Br(e=>e.name&&e.kind&&e.name===t.name&&e.kind===t.kind),jr(e=>({key:t.key||M,...e}))])((0,In.combineReducers)({queriedData:Jo,edits:(e={},r)=>{switch(r.type){case"RECEIVE_ITEMS":if((r?.query?.context??"default")!=="default")return e;let o={...e},s=Array.isArray(r.items)?r.items:[r.items];for(let c of s){let a=c?.[r.key],u=o[a];if(!u)continue;let l=Object.keys(u).reduce((d,f)=>(!(0,gc.default)(u[f],c[f]?.raw??c[f])&&(!r.persistedEdits||!(0,gc.default)(u[f],r.persistedEdits[f]))&&(d[f]=u[f]),d),{});Object.keys(l).length?o[a]=l:delete o[a]}return o;case"EDIT_ENTITY_RECORD":let i={...e[r.recordId],...r.edits};return Object.keys(i).forEach(c=>{i[c]===void 0&&delete i[c]}),{...e,[r.recordId]:i}}return e},saving:(e={},r)=>{switch(r.type){case"SAVE_ENTITY_RECORD_START":case"SAVE_ENTITY_RECORD_FINISH":return{...e,[r.recordId]:{pending:r.type==="SAVE_ENTITY_RECORD_START",error:r.error,isAutosave:r.isAutosave}}}return e},deleting:(e={},r)=>{switch(r.type){case"DELETE_ENTITY_RECORD_START":case"DELETE_ENTITY_RECORD_FINISH":return{...e,[r.recordId]:{pending:r.type==="DELETE_ENTITY_RECORD_START",error:r.error}}}return e},revisions:(e={},r)=>{if(r.type==="RECEIVE_ITEM_REVISIONS"){let n=r.recordKey;delete r.recordKey;let o=Jo(e[n],{...r,type:"RECEIVE_ITEMS"});return{...e,[n]:o}}return r.type==="REMOVE_ITEMS"?Object.fromEntries(Object.entries(e).filter(([n])=>!r.itemIds.some(o=>Number.isInteger(o)?o===+n:o===n))):e}}))}function Vy(t=qo,e){return e.type==="ADD_ENTITIES"?[...t,...e.entities]:t}var By=(t={},e)=>{let r=Vy(t.config,e),n=t.reducer;if(!n||r!==t.config){let s=r.reduce((i,c)=>{let{kind:a}=c;return i[a]||(i[a]=[]),i[a].push(c),i},{});n=(0,In.combineReducers)(Object.fromEntries(Object.entries(s).map(([i,c])=>{let a=(0,In.combineReducers)(Object.fromEntries(c.map(u=>[u.name,Ny(u)])));return[i,a]})))}let o=n(t.records,e);return o===t.records&&r===t.config&&n===t.reducer?t:{reducer:n,records:o,config:r}};function jy(t=(0,ff.createUndoManager)()){return t}function Fy(t={},e){switch(e.type){case"EDIT_ENTITY_RECORD":case"UNDO":case"REDO":return{}}return t}function Yy(t={},e){if(e.type==="RECEIVE_EMBED_PREVIEW"){let{url:r,preview:n}=e;return{...t,[r]:n}}return t}function Gy(t={},e){switch(e.type){case"RECEIVE_USER_PERMISSION":return{...t,[e.key]:e.isAllowed};case"RECEIVE_USER_PERMISSIONS":return{...t,...e.permissions}}return t}function $y(t={},e){if(e.type==="RECEIVE_AUTOSAVES"){let{postId:r,autosaves:n}=e;return{...t,[r]:n}}return t}function zy(t=[],e){return e.type==="RECEIVE_BLOCK_PATTERNS"?e.patterns:t}function Ky(t=[],e){return e.type==="RECEIVE_BLOCK_PATTERN_CATEGORIES"?e.categories:t}function Hy(t=[],e){return e.type==="RECEIVE_USER_PATTERN_CATEGORIES"?e.patternCategories:t}function qy(t=null,e){return e.type==="RECEIVE_NAVIGATION_FALLBACK_ID"?e.fallbackId:t}function Wy(t={},e){return e.type==="RECEIVE_THEME_GLOBAL_STYLE_REVISIONS"?{...t,[e.currentId]:e.revisions}:t}function Jy(t={},e){return e.type==="RECEIVE_DEFAULT_TEMPLATE"?{...t,[JSON.stringify(e.query)]:e.templateId}:t}function Qy(t={},e){return e.type==="RECEIVE_REGISTERED_POST_META"?{...t,[e.postType]:e.registeredPostMeta}:t}function Xy(t=null,e){return e.type==="RECEIVE_EDITOR_SETTINGS"?e.settings:t}function Zy(t=null,e){return e.type==="RECEIVE_EDITOR_ASSETS"?e.assets:t}function eE(t={},e){switch(e.type){case"SET_SYNC_CONNECTION_STATUS":{let r=`${e.kind}/${e.name}:${e.key}`;return{...t,[r]:e.status}}case"CLEAR_SYNC_CONNECTION_STATUS":{let r=`${e.kind}/${e.name}:${e.key}`,{[r]:n,...o}=t;return o}}return t}function tE(t=!0,e){switch(e.type){case"SET_COLLABORATION_SUPPORTED":return e.supported;case"SET_SYNC_CONNECTION_STATUS":return Ed.DOCUMENT_SIZE_LIMIT_EXCEEDED===e.status?.error?.code?!1:t}return t}var hf=(0,In.combineReducers)({users:Dy,currentTheme:Oy,currentGlobalStylesId:Uy,currentUser:ky,themeGlobalStyleVariations:Py,themeBaseGlobalStyles:Ly,themeGlobalStyleRevisions:Wy,entities:By,editsReference:Fy,undoManager:jy,embedPreviews:Yy,userPermissions:Gy,autosaves:$y,blockPatterns:zy,blockPatternCategories:Ky,userPatternCategories:Hy,navigationFallbackId:qy,defaultTemplates:Jy,registeredPostMeta:Qy,editorSettings:Xy,editorAssets:Zy,syncConnectionStatuses:eE,collaborationSupported:tE});var bc={};bt(bc,{__experimentalGetCurrentGlobalStylesId:()=>Cf,__experimentalGetCurrentThemeBaseGlobalStyles:()=>YE,__experimentalGetCurrentThemeGlobalStylesVariations:()=>GE,__experimentalGetDirtyEntityRecords:()=>CE,__experimentalGetEntitiesBeingSaved:()=>RE,__experimentalGetEntityRecordNoResolver:()=>_E,canUser:()=>Rf,canUserEditEntityRecord:()=>NE,getAuthors:()=>gE,getAutosave:()=>BE,getAutosaves:()=>VE,getBlockPatternCategories:()=>zE,getBlockPatterns:()=>$E,getCurrentTheme:()=>Zo,getCurrentThemeGlobalStylesRevisions:()=>HE,getCurrentUser:()=>mE,getDefaultTemplateId:()=>Ec,getEditedEntityRecord:()=>_c,getEmbedPreview:()=>PE,getEntitiesByKind:()=>yE,getEntitiesConfig:()=>_f,getEntity:()=>EE,getEntityConfig:()=>Pr,getEntityRecord:()=>xe,getEntityRecordEdits:()=>wc,getEntityRecordNonTransientEdits:()=>bf,getEntityRecords:()=>Xo,getEntityRecordsTotalItems:()=>bE,getEntityRecordsTotalPages:()=>vE,getLastEntityDeleteError:()=>AE,getLastEntitySaveError:()=>IE,getRawEntityRecord:()=>Sf,getRedoEdit:()=>kE,getReferenceByDistinctEdits:()=>FE,getRevision:()=>WE,getRevisions:()=>qE,getThemeSupports:()=>LE,getUndoEdit:()=>DE,getUserPatternCategories:()=>KE,getUserQueryResults:()=>wf,hasEditsForEntityRecord:()=>vf,hasEntityRecord:()=>wE,hasEntityRecords:()=>SE,hasFetchedAutosaves:()=>jE,hasRedo:()=>UE,hasUndo:()=>OE,isAutosavingEntityRecord:()=>TE,isDeletingEntityRecord:()=>xE,isPreviewEmbedFallback:()=>ME,isRequestingEmbedPreview:()=>pE,isSavingEntityRecord:()=>Sc});var me=w(W(),1),Ef=w(Ze(),1),Et=w(er(),1);var yc={};bt(yc,{getBlockPatternsForPostType:()=>nE,getEditorAssets:()=>uE,getEditorSettings:()=>lE,getEntityRecordPermissions:()=>oE,getEntityRecordsPermissions:()=>mf,getHomePage:()=>iE,getNavigationFallbackId:()=>rE,getPostsPageId:()=>cE,getRegisteredPostMeta:()=>sE,getSyncConnectionStatus:()=>fE,getTemplateId:()=>aE,getUndoManager:()=>Qo,isCollaborationSupported:()=>dE});var je=w(W(),1);var gf=w(er(),1);var mc=!1;function A(t,e,r,{alternativeFunctionName:n,isShorthandSelector:o=!1}={}){let s=sf[t]?.[e];if(s){if(!mc){let{alternative:i}=s,c=o?`'${r}'`:`The '${t}', '${e}' entity (used via '${r}')`,a=`the '${i.kind}', '${i.name}' entity`;n&&(a+=` via the '${n}' function`),(0,gf.default)(c,{...s,alternative:a})}mc=!0,setTimeout(()=>{mc=!1},0)}}function Qo(t){return pe()?.undoManager??t.undoManager}function rE(t){return t.navigationFallbackId}var nE=(0,je.createRegistrySelector)(t=>(0,je.createSelector)((e,r)=>t(x).getBlockPatterns().filter(({postTypes:n})=>!n||Array.isArray(n)&&n.includes(r)),()=>[t(x).getBlockPatterns()])),mf=(0,je.createRegistrySelector)(t=>(0,je.createSelector)((e,r,n,o)=>(Array.isArray(o)?o:[o]).map(i=>({delete:t(x).canUser("delete",{kind:r,name:n,id:i}),update:t(x).canUser("update",{kind:r,name:n,id:i})})),e=>[e.userPermissions]));function oE(t,e,r,n){return A(e,r,"getEntityRecordPermissions"),mf(t,e,r,n)[0]}function sE(t,e){return t.registeredPostMeta?.[e]??{}}function yf(t){return!t||!["number","string"].includes(typeof t)||Number(t)===0?null:t.toString()}var iE=(0,je.createRegistrySelector)(t=>(0,je.createSelector)(()=>{let e=t(x).getEntityRecord("root","__unstableBase");if(!e)return null;let r=e?.show_on_front==="page"?yf(e.page_on_front):null;if(r)return{postType:"page",postId:r};let n=t(x).getDefaultTemplateId({slug:"front-page"});return n?{postType:"wp_template",postId:n}:null},e=>[xe(e,"root","site"),xe(e,"root","__unstableBase"),Ec(e,{slug:"front-page"})])),cE=(0,je.createRegistrySelector)(t=>()=>{let e=t(x).getEntityRecord("root","__unstableBase");return e?.show_on_front==="page"?yf(e.page_for_posts):null}),aE=(0,je.createRegistrySelector)(t=>(e,r,n)=>{let o=Se(t(x)).getHomePage();if(!o)return;if(r==="page"&&r===o?.postType&&n.toString()===o?.postId){let u=t(x).getEntityRecords("postType","wp_template",{per_page:-1});if(!u)return;let l=u.find(({slug:d})=>d==="front-page")?.id;if(l)return l}let s=t(x).getEditedEntityRecord("postType",r,n);if(!s)return;let i=Se(t(x)).getPostsPageId();if(r==="page"&&i===n.toString())return t(x).getDefaultTemplateId({slug:"home"});let c=s.template;if(c){let u=t(x).getEntityRecords("postType","wp_template",{per_page:-1})?.find(({slug:l})=>l===c);if(u)return u.id}let a;return s.slug?a=r==="page"?`${r}-${s.slug}`:`single-${r}-${s.slug}`:a=r==="page"?"page":`single-${r}`,t(x).getDefaultTemplateId({slug:a})});function lE(t){return t.editorSettings}function uE(t){return t.editorAssets}function dE(t){return t.collaborationSupported}function fE(t){if(!t.syncConnectionStatuses)return;let e=["disconnected","connecting","connected"],r;for(let n of Object.values(t.syncConnectionStatuses))(!r||e.indexOf(n.status)<e.indexOf(r.status))&&(r=n);return r}var hE={},pE=(0,me.createRegistrySelector)(t=>(e,r)=>t(x).isResolving("getEmbedPreview",[r]));function gE(t,e){(0,Et.default)("select( 'core' ).getAuthors()",{since:"5.9",alternative:"select( 'core' ).getUsers({ who: 'authors' })"});let r=(0,Ef.addQueryArgs)("/wp/v2/users/?who=authors&per_page=100",e);return wf(t,r)}function mE(t){return t.currentUser}var wf=(0,me.createSelector)((t,e)=>(t.users.queries[e]??[]).map(n=>t.users.byId[n]),(t,e)=>[t.users.queries[e],t.users.byId]);function yE(t,e){return(0,Et.default)("wp.data.select( 'core' ).getEntitiesByKind()",{since:"6.0",alternative:"wp.data.select( 'core' ).getEntitiesConfig()"}),_f(t,e)}var _f=(0,me.createSelector)((t,e)=>t.entities.config.filter(r=>r.kind===e),(t,e)=>t.entities.config);function EE(t,e,r){return(0,Et.default)("wp.data.select( 'core' ).getEntity()",{since:"6.0",alternative:"wp.data.select( 'core' ).getEntityConfig()"}),Pr(t,e,r)}function Pr(t,e,r){return A(e,r,"getEntityConfig"),t.entities.config?.find(n=>n.kind===e&&n.name===r)}var xe=(0,me.createSelector)(((t,e,r,n,o)=>{A(e,r,"getEntityRecord");let s=t.entities.records?.[e]?.[r]?.queriedData;if(!s)return;let i=o?.context??"default";if(!o||!o._fields)return s.itemIsComplete[i]?.[n]?s.items[i][n]:void 0;let c=s.items[i]?.[n];if(!c)return c;let a={},u=ie(o._fields)??[];for(let l=0;l<u.length;l++){let d=u[l].split("."),f=c;d.forEach(h=>{f=f?.[h]}),Xe(a,d,f)}return a}),(t,e,r,n,o)=>{let s=o?.context??"default",i=t.entities.records?.[e]?.[r]?.queriedData;return[i?.items[s]?.[n],i?.itemIsComplete[s]?.[n]]});xe.__unstableNormalizeArgs=t=>{let e=[...t],r=e?.[2];return e[2]=Fr(r)?Number(r):r,e};function wE(t,e,r,n,o){let s=t.entities.records?.[e]?.[r]?.queriedData;if(!s)return!1;let i=o?.context??"default";if(!o||!o._fields)return!!s.itemIsComplete[i]?.[n];let c=s.items[i]?.[n];if(!c)return!1;let a=ie(o._fields)??[];for(let u=0;u<a.length;u++){let l=a[u].split("."),d=c;for(let f=0;f<l.length;f++){let h=l[f];if(!d||!Object.hasOwn(d,h))return!1;d=d[h]}}return!0}function _E(t,e,r,n){return xe(t,e,r,n)}var Sf=(0,me.createSelector)((t,e,r,n)=>{A(e,r,"getRawEntityRecord");let o=xe(t,e,r,n);return o&&Object.keys(o).reduce((s,i)=>(ps(Pr(t,e,r),i)?s[i]=o[i]?.raw!==void 0?o[i]?.raw:o[i]:s[i]=o[i],s),{})},(t,e,r,n,o)=>{let s=o?.context??"default";return[t.entities.config,t.entities.records?.[e]?.[r]?.queriedData?.items[s]?.[n],t.entities.records?.[e]?.[r]?.queriedData?.itemIsComplete[s]?.[n]]});function SE(t,e,r,n){return A(e,r,"hasEntityRecords"),Array.isArray(Xo(t,e,r,n))}var Xo=((t,e,r,n)=>{A(e,r,"getEntityRecords");let o=t.entities.records?.[e]?.[r]?.queriedData;return o?ys(o,n):null}),bE=(t,e,r,n)=>{A(e,r,"getEntityRecordsTotalItems");let o=t.entities.records?.[e]?.[r]?.queriedData;return o?Es(o,n):null},vE=(t,e,r,n)=>{A(e,r,"getEntityRecordsTotalPages");let o=t.entities.records?.[e]?.[r]?.queriedData;if(!o)return null;if(n?.per_page===-1)return 1;let s=Es(o,n);return s&&(n?.per_page?Math.ceil(s/n.per_page):da(o,n))},CE=(0,me.createSelector)(t=>{let{entities:{records:e}}=t,r=[];return Object.keys(e).forEach(n=>{Object.keys(e[n]).forEach(o=>{let s=Object.keys(e[n][o].edits).filter(i=>xe(t,n,o,i)&&vf(t,n,o,i));if(s.length){let i=Pr(t,n,o);s.forEach(c=>{let a=_c(t,n,o,c);r.push({key:a?a[i.key||M]:void 0,title:i?.getTitle?.(a)||"",name:o,kind:n})})}})}),r},t=>[t.entities.records]),RE=(0,me.createSelector)(t=>{let{entities:{records:e}}=t,r=[];return Object.keys(e).forEach(n=>{Object.keys(e[n]).forEach(o=>{let s=Object.keys(e[n][o].saving).filter(i=>Sc(t,n,o,i));if(s.length){let i=Pr(t,n,o);s.forEach(c=>{let a=_c(t,n,o,c);r.push({key:a?a[i.key||M]:void 0,title:i?.getTitle?.(a)||"",name:o,kind:n})})}})}),r},t=>[t.entities.records]);function wc(t,e,r,n){return A(e,r,"getEntityRecordEdits"),t.entities.records?.[e]?.[r]?.edits?.[n]}var bf=(0,me.createSelector)((t,e,r,n)=>{A(e,r,"getEntityRecordNonTransientEdits");let{transientEdits:o}=Pr(t,e,r)||{},s=wc(t,e,r,n)||{};return o?Object.keys(s).reduce((i,c)=>(o[c]||(i[c]=s[c]),i),{}):s},(t,e,r,n)=>[t.entities.config,t.entities.records?.[e]?.[r]?.edits?.[n]]);function vf(t,e,r,n){return A(e,r,"hasEditsForEntityRecord"),Sc(t,e,r,n)||Object.keys(bf(t,e,r,n)).length>0}var _c=(0,me.createSelector)((t,e,r,n)=>{A(e,r,"getEditedEntityRecord");let o=Sf(t,e,r,n),s=wc(t,e,r,n);return!o&&!s?!1:{...o,...s}},(t,e,r,n,o)=>{let s=o?.context??"default";return[t.entities.config,t.entities.records?.[e]?.[r]?.queriedData.items[s]?.[n],t.entities.records?.[e]?.[r]?.queriedData.itemIsComplete[s]?.[n],t.entities.records?.[e]?.[r]?.edits?.[n]]});function TE(t,e,r,n){A(e,r,"isAutosavingEntityRecord");let{pending:o,isAutosave:s}=t.entities.records?.[e]?.[r]?.saving?.[n]??{};return!!(o&&s)}function Sc(t,e,r,n){return A(e,r,"isSavingEntityRecord"),t.entities.records?.[e]?.[r]?.saving?.[n]?.pending??!1}function xE(t,e,r,n){return A(e,r,"isDeletingEntityRecord"),t.entities.records?.[e]?.[r]?.deleting?.[n]?.pending??!1}function IE(t,e,r,n){return A(e,r,"getLastEntitySaveError"),t.entities.records?.[e]?.[r]?.saving?.[n]?.error}function AE(t,e,r,n){return A(e,r,"getLastEntityDeleteError"),t.entities.records?.[e]?.[r]?.deleting?.[n]?.error}function DE(t){(0,Et.default)("select( 'core' ).getUndoEdit()",{since:"6.3"})}function kE(t){(0,Et.default)("select( 'core' ).getRedoEdit()",{since:"6.3"})}function OE(t){return Qo(t).hasUndo()}function UE(t){return Qo(t).hasRedo()}function Zo(t){return t.currentTheme?xe(t,"root","theme",t.currentTheme):null}function Cf(t){return t.currentGlobalStylesId}function LE(t){return Zo(t)?.theme_supports??hE}function PE(t,e){return t.embedPreviews[e]}function ME(t,e){let r=t.embedPreviews[e],n='<a href="'+e+'">'+e+"</a>";return r?r.html===n:!1}function Rf(t,e,r,n){let o=typeof r=="object";if(o&&(!r.kind||!r.name))return!1;o&&A(r.kind,r.name,"canUser");let s=Rt(e,r,n);return t.userPermissions[s]}function NE(t,e,r,n){return(0,Et.default)("wp.data.select( 'core' ).canUserEditEntityRecord()",{since:"6.7",alternative:"wp.data.select( 'core' ).canUser( 'update', { kind, name, id } )"}),Rf(t,"update",{kind:e,name:r,id:n})}function VE(t,e,r){return t.autosaves[r]}function BE(t,e,r,n){return n===void 0?void 0:t.autosaves[r]?.find(s=>s.author===n)}var jE=(0,me.createRegistrySelector)(t=>(e,r,n)=>t(x).hasFinishedResolution("getAutosaves",[r,n]));function FE(t){return t.editsReference}function YE(t){let e=Zo(t);return e?t.themeBaseGlobalStyles[e.stylesheet]:null}function GE(t){let e=Zo(t);return e?t.themeGlobalStyleVariations[e.stylesheet]:null}function $E(t){return t.blockPatterns}function zE(t){return t.blockPatternCategories}function KE(t){return t.userPatternCategories}function HE(t){(0,Et.default)("select( 'core' ).getCurrentThemeGlobalStylesRevisions()",{since:"6.5.0",alternative:"select( 'core' ).getRevisions( 'root', 'globalStyles', ${ recordKey } )"});let e=Cf(t);return e?t.themeGlobalStyleRevisions[e]:null}function Ec(t,e){return t.defaultTemplates[JSON.stringify(e)]}var qE=(t,e,r,n,o)=>{A(e,r,"getRevisions");let s=t.entities.records?.[e]?.[r]?.revisions?.[n];return s?ys(s,o):null},WE=(0,me.createSelector)((t,e,r,n,o,s)=>{A(e,r,"getRevision");let i=t.entities.records?.[e]?.[r]?.revisions?.[n];if(!i)return;let c=s?.context??"default";if(!s||!s._fields)return i.itemIsComplete[c]?.[o]?i.items[c][o]:void 0;let a=i.items[c]?.[o];if(!a)return a;let u={},l=ie(s._fields)??[];for(let d=0;d<l.length;d++){let f=l[d].split("."),h=a;f.forEach(p=>{h=h?.[p]}),Xe(u,f,h)}return u},(t,e,r,n,o,s)=>{let i=s?.context??"default",c=t.entities.records?.[e]?.[r]?.revisions?.[n];return[c?.items?.[i]?.[o],c?.itemIsComplete?.[i]?.[o]]});var Ac={};bt(Ac,{__experimentalBatch:()=>pw,__experimentalReceiveCurrentGlobalStylesId:()=>nw,__experimentalReceiveThemeBaseGlobalStyles:()=>ow,__experimentalReceiveThemeGlobalStyleVariations:()=>sw,__experimentalSaveSpecifiedEntityEdits:()=>mw,__unstableCreateUndoLevel:()=>hw,addEntities:()=>ew,clearEntityRecordEdits:()=>uw,deleteEntityRecord:()=>xc,editEntityRecord:()=>lw,receiveAutosaves:()=>ww,receiveCurrentTheme:()=>rw,receiveCurrentUser:()=>ZE,receiveDefaultTemplateId:()=>Sw,receiveEmbedPreview:()=>aw,receiveEntityRecords:()=>tw,receiveNavigationFallbackId:()=>_w,receiveRevisions:()=>bw,receiveThemeGlobalStyleRevisions:()=>cw,receiveThemeSupports:()=>iw,receiveUploadPermissions:()=>yw,receiveUserPermission:()=>Df,receiveUserPermissions:()=>Ew,receiveUserQuery:()=>XE,redo:()=>fw,saveEditedEntityRecord:()=>gw,saveEntityRecord:()=>Ic,undo:()=>dw});var If=w(Qe(),1);var Tc=w(Ae(),1),Af=w(Ze(),1),es=w(er(),1);var Cc=w(Ae(),1),vc=null;function JE(t,e){let r=[...t],n=[];for(;r.length;)n.push(r.splice(0,e));return n}async function Tf(t){vc===null&&(vc=(await(0,Cc.default)({path:"/batch/v1",method:"OPTIONS"})).endpoints[0].args.requests.maxItems);let e=[];for(let r of JE(t,vc)){let n=await(0,Cc.default)({path:"/batch/v1",method:"POST",data:{validation:"require-all-validate",requests:r.map(s=>({path:s.path,body:s.data,method:s.method,headers:s.headers}))}}),o;n.failed?o=n.responses.map(s=>({error:s?.body})):o=n.responses.map(s=>{let i={};return s.status>=200&&s.status<300?i.output=s.body:i.error=s.body,i}),e.push(...o)}return e}function Rc(t=Tf){let e=0,r=[],n=new QE;return{add(o){let s=++e;n.add(s);let i=c=>new Promise((a,u)=>{r.push({input:c,resolve:a,reject:u}),n.delete(s)});return typeof o=="function"?Promise.resolve(o(i)).finally(()=>{n.delete(s)}):i(o)},async run(){n.size&&await new Promise(i=>{let c=n.subscribe(()=>{n.size||(c(),i(void 0))})});let o;try{if(o=await t(r.map(({input:i})=>i)),o.length!==r.length)throw new Error("run: Array returned by processor must be same size as input array.")}catch(i){for(let{reject:c}of r)c(i);throw i}let s=!0;return o.forEach((i,c)=>{let a=r[c];i?.error?(a?.reject(i.error),s=!1):a?.resolve(i?.output??i)}),r=[],s}}}var QE=class{constructor(...t){this.set=new Set(...t),this.subscribers=new Set}get size(){return this.set.size}add(t){return this.set.add(t),this.subscribers.forEach(e=>e()),this}delete(t){let e=this.set.delete(t);return this.subscribers.forEach(r=>r()),e}subscribe(t){return this.subscribers.add(t),()=>{this.subscribers.delete(t)}}};function xf(t){return t.status==="auto-draft"?{...t,title:""}:t}function XE(t,e){return{type:"RECEIVE_USER_QUERY",users:Array.isArray(e)?e:[e],queryID:t}}function ZE(t){return{type:"RECEIVE_CURRENT_USER",currentUser:t}}function ew(t){return{type:"ADD_ENTITIES",entities:t}}function tw(t,e,r,n=void 0,o=!1,s=void 0,i=void 0){t==="postType"&&(r=Array.isArray(r)?r.map(xf):xf(r));let c;return n?c=ta(r,n,s,i):c=ms(r,s,i),{...c,kind:t,name:e,invalidateCache:o}}function rw(t){return{type:"RECEIVE_CURRENT_THEME",currentTheme:t}}function nw(t){return{type:"RECEIVE_CURRENT_GLOBAL_STYLES_ID",id:t}}function ow(t,e){return{type:"RECEIVE_THEME_GLOBAL_STYLES",stylesheet:t,globalStyles:e}}function sw(t,e){return{type:"RECEIVE_THEME_GLOBAL_STYLE_VARIATIONS",stylesheet:t,variations:e}}function iw(){return(0,es.default)("wp.data.dispatch( 'core' ).receiveThemeSupports",{since:"5.9"}),{type:"DO_NOTHING"}}function cw(t,e){return(0,es.default)("wp.data.dispatch( 'core' ).receiveThemeGlobalStyleRevisions()",{since:"6.5.0",alternative:"wp.data.dispatch( 'core' ).receiveRevisions"}),{type:"RECEIVE_THEME_GLOBAL_STYLE_REVISIONS",currentId:t,revisions:e}}function aw(t,e){return{type:"RECEIVE_EMBED_PREVIEW",url:t,preview:e}}var xc=(t,e,r,n,{__unstableFetch:o=Tc.default,throwOnError:s=!1}={})=>async({dispatch:i,resolveSelect:c})=>{A(t,e,"deleteEntityRecord");let u=(await c.getEntitiesConfig(t)).find(h=>h.kind===t&&h.name===e),l,d=!1;if(!u)return;let f=await i.__unstableAcquireStoreLock(x,["entities","records",t,e,r],{exclusive:!0});try{i({type:"DELETE_ENTITY_RECORD_START",kind:t,name:e,recordId:r});let h=!1,{baseURL:p}=u;t==="postType"&&e==="wp_template"&&(r&&typeof r=="string"&&!/^\d+$/.test(r)||!window?.__experimentalTemplateActivate)&&(p=p.slice(0,p.lastIndexOf("/"))+"/templates");try{let g=`${p}/${r}`;if(n&&(g=(0,Af.addQueryArgs)(g,n)),d=await o({path:g,method:"DELETE"}),await i(ea(t,e,r,!0)),u.syncConfig){let m=`${t}/${e}`,y=r;pe()?.unload(m,y)}}catch(g){h=!0,l=g}if(i({type:"DELETE_ENTITY_RECORD_FINISH",kind:t,name:e,recordId:r,error:l}),h&&s)throw l;return d}finally{i.__unstableReleaseStoreLock(f)}},lw=(t,e,r,n,o={})=>({select:s,dispatch:i})=>{A(t,e,"editEntityRecord");let c=s.getEntityConfig(t,e);if(!c)throw new Error(`The entity being edited (${t}, ${e}) does not have a loaded config.`);let{mergedEdits:a={}}=c,u=s.getRawEntityRecord(t,e,r),l=s.getEditedEntityRecord(t,e,r),d=Object.keys(n).reduce((h,p)=>(h[p]=a[p]?{...l[p],...n[p]}:n[p],h),{}),f={kind:t,name:e,recordId:r,edits:Object.keys(n).reduce((h,p)=>{let g=u[p],m=d[p];return h[p]=(0,If.default)(g,m)?void 0:m,h},{})};if(c.syncConfig){let h=`${t}/${e}`,p=r,g=o.undoIgnore?!1:!o.isCached,m=o.undoIgnore?rc:_d;pe()?.update(h,p,d,m,{isNewUndoLevel:g})}o.undoIgnore||s.getUndoManager().addRecord([{id:{kind:t,name:e,recordId:r},changes:Object.keys(n).reduce((h,p)=>(h[p]={from:l[p],to:n[p]},h),{})}],o.isCached),i({type:"EDIT_ENTITY_RECORD",...f})},uw=(t,e,r)=>({select:n,dispatch:o})=>{let s=n.getEntityConfig(t,e);if(A(t,e,"clearEntityRecordEdits"),!s)throw new Error(`The entity being edited (${t}, ${e}) does not have a loaded config.`);let i=n.getEntityRecordEdits(t,e,r);if(!i)return;let c=Object.keys(i).reduce((a,u)=>(a[u]=void 0,a),{});o({type:"EDIT_ENTITY_RECORD",kind:t,name:e,recordId:r,edits:c})},dw=()=>({select:t,dispatch:e})=>{let r=t.getUndoManager().undo();r&&e({type:"UNDO",record:r})},fw=()=>({select:t,dispatch:e})=>{let r=t.getUndoManager().redo();r&&e({type:"REDO",record:r})},hw=()=>({select:t})=>{t.getUndoManager().addRecord()},Ic=(t,e,r,{isAutosave:n=!1,__unstableFetch:o=Tc.default,throwOnError:s=!1}={})=>async({select:i,resolveSelect:c,dispatch:a})=>{A(t,e,"saveEntityRecord");let l=(await c.getEntitiesConfig(t)).find(g=>g.kind===t&&g.name===e);if(!l)return;let d=l.key??M,f=r[d],h=!!d&&!f,p=await a.__unstableAcquireStoreLock(x,["entities","records",t,e,f||Tn()],{exclusive:!0});try{for(let[_,S]of Object.entries(r))if(typeof S=="function"){let b=S(i.getEditedEntityRecord(t,e,f));a.editEntityRecord(t,e,f,{[_]:b},{undoIgnore:!0}),r[_]=b}a({type:"SAVE_ENTITY_RECORD_START",kind:t,name:e,recordId:f,isAutosave:n});let g,m,y=!1,{baseURL:E}=l;t==="postType"&&e==="wp_template"&&(f&&typeof f=="string"&&!/^\d+$/.test(f)||!window?.__experimentalTemplateActivate)&&(E=E.slice(0,E.lastIndexOf("/"))+"/templates");try{let _=`${E}${f?"/"+f:""}`,S=h?{}:i.getRawEntityRecord(t,e,f);if(n){let b=i.getCurrentUser(),I=b?b.id:void 0,O=await c.getAutosave(S.type,S.id,I),U={...S,...O,...r};if(U=Object.keys(U).reduce(($,j)=>(["title","excerpt","content","meta"].includes(j)&&($[j]=U[j]),$),{status:U.status==="auto-draft"?"draft":void 0}),g=await o({path:`${_}/autosaves`,method:"POST",data:U}),S.id===g.id){let $={...S,...U,...g};$=Object.keys($).reduce((j,de)=>(["title","excerpt","content"].includes(de)?j[de]=$[de]:de==="status"?j[de]=S.status==="auto-draft"&&$.status==="draft"?$.status:S.status:j[de]=S[de],j),{}),a.receiveEntityRecords(t,e,$,void 0,!0)}else a.receiveAutosaves(S.id,g)}else{let b=r;l.__unstablePrePersist&&(b={...b,...await l.__unstablePrePersist(S,b)}),g=await o({path:_,method:f?"PUT":"POST",data:b}),a.receiveEntityRecords(t,e,g,void 0,!0,b),l.syncConfig&&pe()?.update(`${t}/${e}`,f,g,rc,{isSave:!0})}}catch(_){y=!0,m=_}if(a({type:"SAVE_ENTITY_RECORD_FINISH",kind:t,name:e,recordId:f,error:m,isAutosave:n}),y&&s)throw m;return g}finally{a.__unstableReleaseStoreLock(p)}},pw=t=>async({dispatch:e})=>{let r=Rc(),n={saveEntityRecord(i,c,a,u){return r.add(l=>e.saveEntityRecord(i,c,a,{...u,__unstableFetch:l}))},saveEditedEntityRecord(i,c,a,u){return r.add(l=>e.saveEditedEntityRecord(i,c,a,{...u,__unstableFetch:l}))},deleteEntityRecord(i,c,a,u,l){return r.add(d=>e.deleteEntityRecord(i,c,a,u,{...l,__unstableFetch:d}))}},o=t.map(i=>i(n)),[,...s]=await Promise.all([r.run(),...o]);return s},gw=(t,e,r,n)=>async({select:o,dispatch:s,resolveSelect:i})=>{if(A(t,e,"saveEditedEntityRecord"),!o.hasEditsForEntityRecord(t,e,r))return;let a=(await i.getEntitiesConfig(t)).find(f=>f.kind===t&&f.name===e);if(!a)return;let u=a.key||M,l=o.getEntityRecordNonTransientEdits(t,e,r),d={[u]:r,...l};return await s.saveEntityRecord(t,e,d,n)},mw=(t,e,r,n,o)=>async({select:s,dispatch:i,resolveSelect:c})=>{if(A(t,e,"__experimentalSaveSpecifiedEntityEdits"),!s.hasEditsForEntityRecord(t,e,r))return;let a=s.getEntityRecordNonTransientEdits(t,e,r),u={};for(let h of n)Xe(u,h,gs(a,h));let f=(await c.getEntitiesConfig(t)).find(h=>h.kind===t&&h.name===e)?.key||M;return r&&(u[f]=r),await i.saveEntityRecord(t,e,u,o)};function yw(t){return(0,es.default)("wp.data.dispatch( 'core' ).receiveUploadPermissions",{since:"5.9",alternative:"receiveUserPermission"}),Df("create/media",t)}function Df(t,e){return{type:"RECEIVE_USER_PERMISSION",key:t,isAllowed:e}}function Ew(t){return{type:"RECEIVE_USER_PERMISSIONS",permissions:t}}function ww(t,e){return{type:"RECEIVE_AUTOSAVES",postId:t,autosaves:Array.isArray(e)?e:[e]}}function _w(t){return{type:"RECEIVE_NAVIGATION_FALLBACK_ID",fallbackId:t}}function Sw(t,e){return{type:"RECEIVE_DEFAULT_TEMPLATE",query:t,templateId:e}}var bw=(t,e,r,n,o,s=!1,i)=>async({dispatch:c,resolveSelect:a})=>{A(t,e,"receiveRevisions");let l=(await a.getEntitiesConfig(t)).find(f=>f.kind===t&&f.name===e),d=l&&l?.revisionKey?l.revisionKey:M;c({type:"RECEIVE_ITEM_REVISIONS",key:d,items:n,recordKey:r,meta:i,query:o,kind:t,name:e,invalidateCache:s})};var Dc={};bt(Dc,{editMediaEntity:()=>Cw,receiveEditorAssets:()=>Tw,receiveEditorSettings:()=>Rw,receiveRegisteredPostMeta:()=>vw,setCollaborationSupported:()=>xw,setSyncConnectionStatus:()=>Iw});var kf=w(Ae(),1);function vw(t,e){return{type:"RECEIVE_REGISTERED_POST_META",postType:t,registeredPostMeta:e}}var Cw=(t,e={},{__unstableFetch:r=kf.default,throwOnError:n=!1}={})=>async({dispatch:o,resolveSelect:s})=>{if(!t)return;let i="postType",c="attachment",u=(await s.getEntitiesConfig(i)).find(p=>p.kind===i&&p.name===c);if(!u)return;let l=await o.__unstableAcquireStoreLock(x,["entities","records",i,c,t],{exclusive:!0}),d,f,h=!1;try{o({type:"SAVE_ENTITY_RECORD_START",kind:i,name:c,recordId:t});try{let p=`${u.baseURL}/${t}/edit`,g=await r({path:p,method:"POST",data:{...e}});g&&(o.receiveEntityRecords(i,c,g,void 0,!0,void 0,void 0),d=g)}catch(p){f=p,h=!0}if(o({type:"SAVE_ENTITY_RECORD_FINISH",kind:i,name:c,recordId:t,error:f}),h&&n)throw f;return d}finally{o.__unstableReleaseStoreLock(l)}};function Rw(t){return{type:"RECEIVE_EDITOR_SETTINGS",settings:t}}function Tw(t){return{type:"RECEIVE_EDITOR_ASSETS",assets:t}}var xw=t=>({dispatch:e})=>{e({type:"SET_COLLABORATION_SUPPORTED",supported:t})};function Iw(t,e,r,n){return n?{type:"SET_SYNC_CONNECTION_STATUS",kind:t,name:e,key:r,status:n}:{type:"CLEAR_SYNC_CONNECTION_STATUS",kind:t,name:e,key:r}}var Lc={};bt(Lc,{__experimentalGetCurrentGlobalStylesId:()=>Gw,__experimentalGetCurrentThemeBaseGlobalStyles:()=>$w,__experimentalGetCurrentThemeGlobalStylesVariations:()=>zw,canUser:()=>Bf,canUserEditEntityRecord:()=>jw,getAuthors:()=>kw,getAutosave:()=>Yw,getAutosaves:()=>Fw,getBlockPatternCategories:()=>Hw,getBlockPatterns:()=>Kw,getCurrentTheme:()=>Nw,getCurrentThemeGlobalStylesRevisions:()=>jf,getCurrentUser:()=>Ow,getDefaultTemplateId:()=>Ff,getEditedEntityRecord:()=>Lw,getEditorAssets:()=>e_,getEditorSettings:()=>Zw,getEmbedPreview:()=>Bw,getEntitiesConfig:()=>Xw,getEntityRecord:()=>ts,getEntityRecords:()=>Un,getEntityRecordsTotalItems:()=>Pw,getEntityRecordsTotalPages:()=>Mw,getNavigationFallbackId:()=>Ww,getRawEntityRecord:()=>Uw,getRegisteredPostMeta:()=>Qw,getRevision:()=>Jw,getRevisions:()=>Yf,getThemeSupports:()=>Vw,getUserPatternCategories:()=>qw});var Ye=w(Ze(),1),Vf=w(kc(),1),N=w(Ae(),1);var Nf=w(Ae(),1);var An=w(Ae(),1),Dn=w(Ze(),1),kn=w(kc(),1),On=w(_s(),1);async function Lf(t,e={},r={}){let n=e.isInitialSuggestions&&e.initialSuggestionsSearchOptions?{...e,...e.initialSuggestionsSearchOptions}:e,{type:o,subtype:s,page:i,perPage:c=e.isInitialSuggestions?3:20}=n,{disablePostFormats:a=!1}=r,u=[];(!o||o==="post")&&u.push((0,An.default)({path:(0,Dn.addQueryArgs)("/wp/v2/search",{search:t,page:i,per_page:c,type:"post",subtype:s})}).then(f=>f.map(h=>({id:h.id,url:h.url,title:(0,kn.decodeEntities)(h.title||"")||(0,On.__)("(no title)"),type:h.subtype||h.type,kind:"post-type"}))).catch(()=>[])),(!o||o==="term")&&u.push((0,An.default)({path:(0,Dn.addQueryArgs)("/wp/v2/search",{search:t,page:i,per_page:c,type:"term",subtype:s})}).then(f=>f.map(h=>({id:h.id,url:h.url,title:(0,kn.decodeEntities)(h.title||"")||(0,On.__)("(no title)"),type:h.subtype||h.type,kind:"taxonomy"}))).catch(()=>[])),!a&&(!o||o==="post-format")&&u.push((0,An.default)({path:(0,Dn.addQueryArgs)("/wp/v2/search",{search:t,page:i,per_page:c,type:"post-format",subtype:s})}).then(f=>f.map(h=>({id:h.id,url:h.url,title:(0,kn.decodeEntities)(h.title||"")||(0,On.__)("(no title)"),type:h.subtype||h.type,kind:"taxonomy"}))).catch(()=>[])),(!o||o==="attachment")&&u.push((0,An.default)({path:(0,Dn.addQueryArgs)("/wp/v2/media",{search:t,page:i,per_page:c})}).then(f=>f.map(h=>({id:h.id,url:h.source_url,title:(0,kn.decodeEntities)(h.title.rendered||"")||(0,On.__)("(no title)"),type:h.type,kind:"media"}))).catch(()=>[]));let d=(await Promise.all(u)).flat();return d=d.filter(f=>!!f.id),d=Aw(d,t),d=d.slice(0,c),d}function Aw(t,e){let r=Uf(e),n={};for(let o of t)if(o.title){let s=Uf(o.title),i=s.filter(l=>r.some(d=>l===d)),c=s.filter(l=>r.some(d=>l!==d&&l.includes(d))),a=i.length/s.length*10,u=c.length/s.length;n[o.id]=a+u}else n[o.id]=0;return t.sort((o,s)=>n[s.id]-n[o.id])}function Uf(t){return t.toLowerCase().match(/[\p{L}\p{N}]+/gu)||[]}var Pf=w(Ae(),1),Fe=w(Ze(),1),Oc=new Map,Dw=async(t,e={})=>{let r="/wp-block-editor/v1/url-details",n={url:(0,Fe.prependHTTP)(t)};if(!(0,Fe.isURL)(t))return Promise.reject(`${t} is not a valid URL.`);let o=(0,Fe.getProtocol)(t);return!o||!(0,Fe.isValidProtocol)(o)||!o.startsWith("http")||!/^https?:\/\/[^\/\s]/i.test(t)?Promise.reject(`${t} does not have a valid protocol. URLs must be "http" based`):Oc.has(t)?Oc.get(t):(0,Pf.default)({path:(0,Fe.addQueryArgs)(r,n),...e}).then(s=>(Oc.set(t,s),s))},Mf=Dw;async function Uc(){let t=await(0,Nf.default)({path:"/wp/v2/block-patterns/patterns"});return t?t.map(e=>Object.fromEntries(Object.entries(e).map(([r,n])=>[Gn(r),n]))):[]}var kw=t=>async({dispatch:e})=>{let r=(0,Ye.addQueryArgs)("/wp/v2/users/?who=authors&per_page=100",t),n=await(0,N.default)({path:r});e.receiveUserQuery(r,n)},Ow=()=>async({dispatch:t})=>{let e=await(0,N.default)({path:"/wp/v2/users/me"});t.receiveCurrentUser(e)},ts=(t,e,r="",n)=>async({select:o,dispatch:s,registry:i,resolveSelect:c})=>{let u=(await c.getEntitiesConfig(t)).find(d=>d.name===e&&d.kind===t);if(!u)return;let l=await s.__unstableAcquireStoreLock(x,["entities","records",t,e,r],{exclusive:!1});try{if(n!==void 0&&n._fields&&(n={...n,_fields:[...new Set([...ie(n._fields)||[],u.key||M])].join()}),n!==void 0&&n._fields&&o.hasEntityRecord(t,e,r,n))return;let{baseURL:d}=u;t==="postType"&&e==="wp_template"&&(r&&typeof r=="string"&&!/^\d+$/.test(r)||!window?.__experimentalTemplateActivate)&&(d=d.slice(0,d.lastIndexOf("/"))+"/templates");let f=(0,Ye.addQueryArgs)(d+(r?"/"+r:""),{...u.baseURLParams,...n}),h=await(0,N.default)({path:f,parse:!1}),p=await h.json(),g=Yr(h.headers?.get("allow")),m=[],y={};for(let E of Ct)y[Rt(E,{kind:t,name:e,id:r})]=g[E],m.push([E,{kind:t,name:e,id:r}]);if(u.syncConfig&&Fr(r)&&!n){let E=`${t}/${e}`,_=r,S={...p};Object.entries(u.transientEdits??{}).filter(([b,I])=>S[b]===void 0&&I&&typeof I=="object"&&"read"in I&&typeof I.read=="function").forEach(([b,I])=>{S[b]=I.read(S)}),pe()?.load(u.syncConfig,E,_,S,{editRecord:(b,I={})=>{Object.keys(b).length&&s({type:"EDIT_ENTITY_RECORD",kind:t,name:e,recordId:r,edits:b,meta:{undo:void 0},options:I})},getEditedRecord:async()=>await c.getEditedEntityRecord(t,e,r),onStatusChange:b=>{s.setSyncConnectionStatus(t,e,r,b)},refetchRecord:async()=>{s.receiveEntityRecords(t,e,await(0,N.default)({path:f,parse:!0}),n)},persistCRDTDoc:()=>{c.getEditedEntityRecord(t,e,r).then(b=>{let{meta:I,status:O}=b;O==="auto-draft"||!I||s.saveEntityRecord(t,e,b)})},addUndoMeta:(b,I)=>{let O=$o(b);O&&I.set("selectionHistory",O)},restoreUndoMeta:(b,I)=>{let O=I.get("selectionHistory");O&&setTimeout(()=>{Jd(O,b)},0)}})}i.batch(()=>{s.receiveEntityRecords(t,e,p,n),s.receiveUserPermissions(y),s.finishResolutions("canUser",m)})}finally{s.__unstableReleaseStoreLock(l)}};ts.shouldInvalidate=(t,e,r)=>e==="root"&&r==="site"&&(t.type==="RECEIVE_ITEMS"&&t.persistedEdits&&t.persistedEdits.status!=="auto-draft"||t.type==="REMOVE_ITEMS")&&t.kind==="postType"&&t.name==="wp_template";var Uw=vt("getEntityRecord"),Lw=vt("getEntityRecord"),Un=(t,e,r={})=>async({dispatch:n,registry:o,resolveSelect:s})=>{let c=(await s.getEntitiesConfig(t)).find(f=>f.name===e&&f.kind===t);if(!c)return;let a=await n.__unstableAcquireStoreLock(x,["entities","records",t,e],{exclusive:!1}),u={...r},l=c.key||M;function d(f,h){let p=Object.fromEntries(Object.entries(h).filter(([g,m])=>["context","_fields"].includes(g)&&!!m));return f.filter(g=>g?.[l]).map(g=>[t,e,g[l],Object.keys(p).length>0?p:void 0])}try{r._fields&&(r={...r,_fields:[...new Set([...ie(r._fields)||[],l])].join()});let{baseURL:f}=c,{combinedTemplates:h=!0}=r;t==="postType"&&e==="wp_template"&&h&&(f=f.slice(0,f.lastIndexOf("/"))+"/templates");let p=(0,Ye.addQueryArgs)(f,{...c.baseURLParams,...r}),g=[],m;if(c.supportsPagination&&r.per_page!==-1){let y=await(0,N.default)({path:p,parse:!1});g=Object.values(await y.json()),m={totalItems:parseInt(y.headers.get("X-WP-Total")),totalPages:parseInt(y.headers.get("X-WP-TotalPages"))}}else if(r.per_page===-1&&r[Gr]===!0){let y=1,E;do{let _=await(0,N.default)({path:(0,Ye.addQueryArgs)(p,{page:y,per_page:100}),parse:!1}),S=Object.values(await _.json());E=parseInt(_.headers.get("X-WP-TotalPages")),m||(m={totalItems:parseInt(_.headers.get("X-WP-Total")),totalPages:1}),g.push(...S),o.batch(()=>{n.receiveEntityRecords(t,e,g,r,!1,void 0,m),n.finishResolutions("getEntityRecord",d(S,u))}),y++}while(y<=E)}else g=Object.values(await(0,N.default)({path:p})),m={totalItems:g.length,totalPages:1};if(c.syncConfig&&r.per_page===-1){let y=`${t}/${e}`;pe()?.loadCollection(c.syncConfig,y,{onStatusChange:E=>{n.setSyncConnectionStatus(t,e,null,E)},refetchRecords:async()=>{n.receiveEntityRecords(t,e,await(0,N.default)({path:p,parse:!0}),r)}})}r._fields&&(g=g.map(y=>(r._fields.split(",").forEach(E=>{y.hasOwnProperty(E)||(y[E]=void 0)}),y))),o.batch(()=>{n.receiveEntityRecords(t,e,g,r,!1,void 0,m);let y=g.filter(S=>!!S?.[l]&&!!S?._links?.self?.[0]?.targetHints?.allow).map(S=>({id:S[l],permissions:Yr(S._links.self[0].targetHints.allow)})),E=[],_={};for(let S of y)for(let b of Ct)E.push([b,{kind:t,name:e,id:S.id}]),_[Rt(b,{kind:t,name:e,id:S.id})]=S.permissions[b];y.length>0&&(n.receiveUserPermissions(_),n.finishResolutions("canUser",E)),n.finishResolutions("getEntityRecord",d(g,u)),n.__unstableReleaseStoreLock(a)})}catch{n.__unstableReleaseStoreLock(a)}};Un.shouldInvalidate=(t,e,r)=>(t.type==="RECEIVE_ITEMS"||t.type==="REMOVE_ITEMS")&&t.invalidateCache&&e===t.kind&&r===t.name;var Pw=vt("getEntityRecords"),Mw=vt("getEntityRecords"),Nw=()=>async({dispatch:t,resolveSelect:e})=>{let r=await e.getEntityRecords("root","theme",{status:"active"});t.receiveCurrentTheme(r[0])},Vw=vt("getCurrentTheme"),Bw=t=>async({dispatch:e})=>{try{let r=await(0,N.default)({path:(0,Ye.addQueryArgs)("/oembed/1.0/proxy",{url:t})});e.receiveEmbedPreview(t,r)}catch{e.receiveEmbedPreview(t,!1)}},Bf=(t,e,r)=>async({dispatch:n,registry:o,resolveSelect:s})=>{if(!Ct.includes(t))throw new Error(`'${t}' is not a valid action.`);let{hasStartedResolution:i}=o.select(x);for(let l of Ct){if(l===t)continue;if(i("canUser",[l,e,r]))return}let c=null;if(typeof e=="object"){if(!e.kind||!e.name)throw new Error("The entity resource object is not valid.");let d=(await s.getEntitiesConfig(e.kind)).find(f=>f.name===e.name&&f.kind===e.kind);if(!d)return;c=d.baseURL+(e.id?"/"+e.id:"")}else c=`/wp/v2/${e}`+(r?"/"+r:"");let a;try{a=await(0,N.default)({path:c,method:"OPTIONS",parse:!1})}catch{return}let u=Yr(a.headers?.get("allow"));o.batch(()=>{for(let l of Ct){let d=Rt(l,e,r);n.receiveUserPermission(d,u[l]),l!==t&&n.finishResolution("canUser",[l,e,r])}})},jw=(t,e,r)=>async({dispatch:n})=>{await n(Bf("update",{kind:t,name:e,id:r}))},Fw=(t,e)=>async({dispatch:r,resolveSelect:n})=>{let{rest_base:o,rest_namespace:s="wp/v2",supports:i}=await n.getPostType(t);if(!i?.autosave)return;let c=await(0,N.default)({path:`/${s}/${o}/${e}/autosaves?context=edit`});c&&c.length&&r.receiveAutosaves(e,c)},Yw=(t,e)=>async({resolveSelect:r})=>{await r.getAutosaves(t,e)},Gw=()=>async({dispatch:t,resolveSelect:e})=>{let n=(await e.getEntityRecords("root","theme",{status:"active"}))?.[0]?._links?.["wp:user-global-styles"]?.[0]?.href;if(!n)return;let o=n.match(/\/(\d+)(?:\?|$)/),s=o?Number(o[1]):null;s&&t.__experimentalReceiveCurrentGlobalStylesId(s)},$w=()=>async({resolveSelect:t,dispatch:e})=>{let r=await t.getCurrentTheme(),n=await(0,N.default)({path:`/wp/v2/global-styles/themes/${r.stylesheet}?context=view`});e.__experimentalReceiveThemeBaseGlobalStyles(r.stylesheet,n)},zw=()=>async({resolveSelect:t,dispatch:e})=>{let r=await t.getCurrentTheme(),n=await(0,N.default)({path:`/wp/v2/global-styles/themes/${r.stylesheet}/variations?context=view`});e.__experimentalReceiveThemeGlobalStyleVariations(r.stylesheet,n)},jf=()=>async({resolveSelect:t,dispatch:e})=>{let r=await t.__experimentalGetCurrentGlobalStylesId(),o=(r?await t.getEntityRecord("root","globalStyles",r):void 0)?._links?.["version-history"]?.[0]?.href;if(o){let i=(await(0,N.default)({url:o}))?.map(c=>Object.fromEntries(Object.entries(c).map(([a,u])=>[Gn(a),u])));e.receiveThemeGlobalStyleRevisions(r,i)}};jf.shouldInvalidate=t=>t.type==="SAVE_ENTITY_RECORD_FINISH"&&t.kind==="root"&&!t.error&&t.name==="globalStyles";var Kw=()=>async({dispatch:t})=>{let e=await Uc();t({type:"RECEIVE_BLOCK_PATTERNS",patterns:e})},Hw=()=>async({dispatch:t})=>{let e=await(0,N.default)({path:"/wp/v2/block-patterns/categories"});t({type:"RECEIVE_BLOCK_PATTERN_CATEGORIES",categories:e})},qw=()=>async({dispatch:t,resolveSelect:e})=>{let n=(await e.getEntityRecords("taxonomy","wp_pattern_category",{per_page:-1,_fields:"id,name,description,slug",context:"view"}))?.map(o=>({...o,label:(0,Vf.decodeEntities)(o.name),name:o.slug}))||[];t({type:"RECEIVE_USER_PATTERN_CATEGORIES",patternCategories:n})},Ww=()=>async({dispatch:t,select:e,registry:r})=>{let n=await(0,N.default)({path:(0,Ye.addQueryArgs)("/wp-block-editor/v1/navigation-fallback",{_embed:!0})}),o=n?._embedded?.self;r.batch(()=>{if(t.receiveNavigationFallbackId(n?.id),!o)return;let i=!e.getEntityRecord("postType","wp_navigation",n.id);t.receiveEntityRecords("postType","wp_navigation",o,void 0,i),t.finishResolution("getEntityRecord",["postType","wp_navigation",n.id])})},Ff=t=>async({dispatch:e,registry:r,resolveSelect:n})=>{let o=await(0,N.default)({path:(0,Ye.addQueryArgs)("/wp/v2/templates/lookup",t)});await n.getEntitiesConfig("postType");let s=window?.__experimentalTemplateActivate&&o?.wp_id||o?.id;s&&(o.id=s,r.batch(()=>{e.receiveDefaultTemplateId(t,s),e.receiveEntityRecords("postType",o.type,o),e.finishResolution("getEntityRecord",["postType",o.type,s])}))};Ff.shouldInvalidate=t=>t.type==="RECEIVE_ITEMS"&&t.kind==="root"&&t.name==="site";var Yf=(t,e,r,n={})=>async({dispatch:o,registry:s,resolveSelect:i})=>{let a=(await i.getEntitiesConfig(t)).find(p=>p.name===e&&p.kind===t);if(!a)return;n._fields&&(n={...n,_fields:[...new Set([...ie(n._fields)||[],a.revisionKey||M])].join()});let u=(0,Ye.addQueryArgs)(a.getRevisionsUrl(r),n),l,d,f={},h=a.supportsPagination&&n.per_page!==-1;try{d=await(0,N.default)({path:u,parse:!h})}catch{return}d&&(h?(l=Object.values(await d.json()),f.totalItems=parseInt(d.headers.get("X-WP-Total"))):l=Object.values(d),n._fields&&(l=l.map(p=>(n._fields.split(",").forEach(g=>{p.hasOwnProperty(g)||(p[g]=void 0)}),p))),s.batch(()=>{if(o.receiveRevisions(t,e,r,l,n,!1,f),!n?._fields&&!n.context){let p=a.revisionKey||M,g=l.filter(m=>m[p]).map(m=>[t,e,r,m[p]]);o.finishResolutions("getRevision",g)}}))};Yf.shouldInvalidate=(t,e,r,n)=>t.type==="SAVE_ENTITY_RECORD_FINISH"&&r===t.name&&e===t.kind&&!t.error&&n===t.recordId;var Jw=(t,e,r,n,o)=>async({dispatch:s,resolveSelect:i})=>{let a=(await i.getEntitiesConfig(t)).find(d=>d.name===e&&d.kind===t);if(!a)return;o!==void 0&&o._fields&&(o={...o,_fields:[...new Set([...ie(o._fields)||[],a.revisionKey||M])].join()});let u=(0,Ye.addQueryArgs)(a.getRevisionsUrl(r,n),o),l;try{l=await(0,N.default)({path:u})}catch{return}l&&s.receiveRevisions(t,e,r,l,o)},Qw=t=>async({dispatch:e,resolveSelect:r})=>{let n;try{let{rest_namespace:o="wp/v2",rest_base:s}=await r.getPostType(t)||{};n=await(0,N.default)({path:`${o}/${s}/?context=edit`,method:"OPTIONS"})}catch{return}n&&e.receiveRegisteredPostMeta(t,n?.schema?.properties?.meta?.properties)},Xw=t=>async({dispatch:e})=>{let r=Wo.find(n=>n.kind===t);if(r)try{let n=await r.loadEntities();if(!n.length)return;e.addEntities(n)}catch{}},Zw=()=>async({dispatch:t})=>{let e=await(0,N.default)({path:"/wp-block-editor/v1/settings"});t.receiveEditorSettings(e)},e_=()=>async({dispatch:t})=>{let e=await(0,N.default)({path:"/wp-block-editor/v1/assets"});t.receiveEditorAssets(e)};function Pc(t,e){let r={...t},n=r;for(let o of e)n.children={...n.children,[o]:{locks:[],children:{},...n.children[o]}},n=n.children[o];return r}function Ln(t,e){let r=t;for(let n of e){let o=r.children[n];if(!o)return null;r=o}return r}function*Gf(t,e){let r=t;yield r;for(let n of e){let o=r.children[n];if(!o)break;yield o,r=o}}function*$f(t){let e=Object.values(t.children);for(;e.length;){let r=e.pop();yield r,e.push(...Object.values(r.children))}}function Mc({exclusive:t},e){return!!(t&&e.length||!t&&e.filter(r=>r.exclusive).length)}var t_={requests:[],tree:{locks:[],children:{}}};function Pn(t=t_,e){switch(e.type){case"ENQUEUE_LOCK_REQUEST":{let{request:r}=e;return{...t,requests:[r,...t.requests]}}case"GRANT_LOCK_REQUEST":{let{lock:r,request:n}=e,{store:o,path:s}=n,i=[o,...s],c=Pc(t.tree,i),a=Ln(c,i);return a.locks=[...a.locks,r],{...t,requests:t.requests.filter(u=>u!==n),tree:c}}case"RELEASE_LOCK":{let{lock:r}=e,n=[r.store,...r.path],o=Pc(t.tree,n),s=Ln(o,n);return s.locks=s.locks.filter(i=>i!==r),{...t,tree:o}}}return t}function zf(t){return t.requests}function Kf(t,e,r,{exclusive:n}){let o=[e,...r],s=t.tree;for(let c of Gf(s,o))if(Mc({exclusive:n},c.locks))return!1;let i=Ln(s,o);if(!i)return!0;for(let c of $f(i))if(Mc({exclusive:n},c.locks))return!1;return!0}function Hf(){let t=Pn(void 0,{type:"@@INIT"});function e(){for(let o of zf(t)){let{store:s,path:i,exclusive:c,notifyAcquired:a}=o;if(Kf(t,s,i,{exclusive:c})){let u={store:s,path:i,exclusive:c};t=Pn(t,{type:"GRANT_LOCK_REQUEST",lock:u,request:o}),a(u)}}}function r(o,s,i){return new Promise(c=>{t=Pn(t,{type:"ENQUEUE_LOCK_REQUEST",request:{store:o,path:s,exclusive:i,notifyAcquired:c}}),e()})}function n(o){t=Pn(t,{type:"RELEASE_LOCK",lock:o}),e()}return{acquire:r,release:n}}function qf(){let t=Hf();function e(n,o,{exclusive:s}){return()=>t.acquire(n,o,s)}function r(n){return()=>t.release(n)}return{__unstableAcquireStoreLock:e,__unstableReleaseStoreLock:r}}var Wf,Jf;var rs=w(We(),1);var Xf=w(We(),1),wt=(0,Xf.createContext)({});wt.displayName="EntityContext";var th=w(eh(),1);function rh({kind:t,type:e,id:r,revisionId:n,children:o}){let s=(0,rs.useContext)(wt),i=(0,rs.useMemo)(()=>({...s,...t&&{[t]:{...s?.[t],[e]:r}},...n!==void 0&&{revisionId:n}}),[s,t,e,r,n]);return(0,th.jsx)(wt.Provider,{value:i,children:o})}var ns=w(W(),1),ch=w(er(),1),ah=w(We(),1);var sh=w(W(),1);function nh(t,e){var r=0,n,o;e=e||{};function s(){var i=n,c=arguments.length,a,u;e:for(;i;){if(i.args.length!==arguments.length){i=i.next;continue}for(u=0;u<c;u++)if(i.args[u]!==arguments[u]){i=i.next;continue e}return i!==n&&(i===o&&(o=i.prev),i.prev.next=i.next,i.next&&(i.next.prev=i.prev),i.next=n,i.prev=null,n.prev=i,n=i),i.val}for(a=new Array(c),u=0;u<c;u++)a[u]=arguments[u];return i={args:a,val:t.apply(null,a)},n?(n.prev=i,i.next=n):o=i,r===e.maxSize?(o=o.prev,o.next=null):r++,n=i,i.val}return s.clear=function(){n=null,o=null,r=0},s}var oh=nh;var te=(t=>(t.Idle="IDLE",t.Resolving="RESOLVING",t.Error="ERROR",t.Success="SUCCESS",t))(te||{});var r_=["getIsResolving","hasStartedResolution","hasFinishedResolution","isResolving","getCachedResolvers"];function Mr(t,e){return(0,sh.useSelect)((r,n)=>t(s=>n_(r(s)),n),e)}var n_=oh((t=>{let e={};for(let r in t)r_.includes(r)||Object.defineProperty(e,r,{get:()=>(...n)=>{let o=t[r](...n),s=t.getResolutionState(r,n)?.status,i;switch(s){case"resolving":i=te.Resolving;break;case"finished":i=te.Success;break;case"error":i=te.Error;break;case void 0:i=te.Idle;break}return{data:o,status:i,isResolving:i===te.Resolving,hasStarted:i!==te.Idle,hasResolved:i===te.Success||i===te.Error}}});return e}));var ih={};function Nc(t,e,r,n={enabled:!0}){let{editEntityRecord:o,saveEditedEntityRecord:s}=(0,ns.useDispatch)(q),i=(0,ah.useMemo)(()=>({edit:(f,h={})=>o(t,e,r,f,h),save:(f={})=>s(t,e,r,{throwOnError:!0,...f})}),[o,t,e,r,s]),{editedRecord:c,hasEdits:a,edits:u}=(0,ns.useSelect)(f=>n.enabled?{editedRecord:f(q).getEditedEntityRecord(t,e,r),hasEdits:f(q).hasEditsForEntityRecord(t,e,r),edits:f(q).getEntityRecordNonTransientEdits(t,e,r)}:{editedRecord:ih,hasEdits:!1,edits:ih},[t,e,r,n.enabled]),{data:l,...d}=Mr(f=>n.enabled?f(q).getEntityRecord(t,e,r):{data:null},[t,e,r,n.enabled]);return{record:l,editedRecord:c,hasEdits:a,edits:u,...d,...i}}function lh(t,e,r,n){return(0,ch.default)("wp.data.__experimentalUseEntityRecord",{alternative:"wp.data.useEntityRecord",since:"6.1"}),Nc(t,e,r,n)}var uh=w(Ze(),1),dh=w(er(),1),os=w(W(),1),Vc=w(We(),1);var o_=[];function ss(t,e,r={},n={enabled:!0}){let o=(0,uh.addQueryArgs)("",r),{data:s,...i}=Mr(u=>n.enabled?u(q).getEntityRecords(t,e,r):{data:o_},[t,e,o,n.enabled]),{totalItems:c,totalPages:a}=(0,os.useSelect)(u=>n.enabled?{totalItems:u(q).getEntityRecordsTotalItems(t,e,r),totalPages:u(q).getEntityRecordsTotalPages(t,e,r)}:{totalItems:null,totalPages:null},[t,e,o,n.enabled]);return{records:s,totalItems:c,totalPages:a,...i}}function fh(t,e,r,n){return(0,dh.default)("wp.data.__experimentalUseEntityRecords",{alternative:"wp.data.useEntityRecords",since:"6.1"}),ss(t,e,r,n)}function hh(t,e,r={},n={enabled:!0}){let o=(0,os.useSelect)(l=>l(q).getEntityConfig(t,e),[t,e]),{records:s,...i}=ss(t,e,{...r,...r._fields?{_fields:[...new Set([...ie(r._fields)||[],"_links"])].join()}:{}},n),c=(0,Vc.useMemo)(()=>s?.map(l=>l[o?.key??"id"])??[],[s,o?.key]),a=(0,os.useSelect)(l=>{let{getEntityRecordsPermissions:d}=Se(l(q));return d(t,e,c)},[c,t,e]);return{records:(0,Vc.useMemo)(()=>s?.map((l,d)=>({...l,permissions:a[d]}))??[],[s,a]),...i}}var mh=w(er(),1),yh=w(gh(),1);function Eh(t,e){let r=typeof t=="object",n=r?JSON.stringify(t):t;return r&&typeof e<"u"&&(0,yh.default)("When 'resource' is an entity object, passing 'id' as a separate argument isn't supported."),Mr(o=>{let s=r?!!t.id:!!e,{canUser:i}=o(q),c=i("create",r?{kind:t.kind,name:t.name}:t);if(!s){let p=i("read",t),g=c.isResolving||p.isResolving,m=c.hasResolved&&p.hasResolved,y=te.Idle;return g?y=te.Resolving:m&&(y=te.Success),{status:y,isResolving:g,hasResolved:m,canCreate:c.hasResolved&&c.data,canRead:p.hasResolved&&p.data}}let a=i("read",t,e),u=i("update",t,e),l=i("delete",t,e),d=a.isResolving||c.isResolving||u.isResolving||l.isResolving,f=a.hasResolved&&c.hasResolved&&u.hasResolved&&l.hasResolved,h=te.Idle;return d?h=te.Resolving:f&&(h=te.Success),{status:h,isResolving:d,hasResolved:f,canRead:f&&a.data,canCreate:f&&c.data,canUpdate:f&&u.data,canDelete:f&&l.data}},[n,e])}var wh=Eh;function _h(t,e){return(0,mh.default)("wp.data.__experimentalUseResourcePermissions",{alternative:"wp.data.useResourcePermissions",since:"6.1"}),Eh(t,e)}var Mn=w(We(),1),is=w(W(),1),cs=w(nr(),1);var Sh=w(We(),1);function Nr(t,e){return(0,Sh.useContext)(wt)?.[t]?.[e]}var _t=w(bn(),1);var bh=w(Ar(),1);var Bc,jc=new WeakMap;function vh(t){if(Bc||(Bc=Se(bh.privateApis)),!jc.has(t)){let e=Bc.getRichTextValues([t]);jc.set(t,e)}return jc.get(t)}var Fc=new WeakMap;function s_(t){if(!Fc.has(t)){let e=[];for(let r of vh(t))r&&r.replacements.forEach(({type:n,attributes:o})=>{n==="core/footnote"&&e.push(o["data-fn"])});Fc.set(t,e)}return Fc.get(t)}function Ch(t){return t.flatMap(s_)}var Yc={};function Gc(t,e){let r={blocks:t};if(!e||e.footnotes===void 0)return r;let n=Ch(t),o=e.footnotes?JSON.parse(e.footnotes):[];if(o.map(l=>l.id).join("")===n.join(""))return r;let i=n.map(l=>o.find(d=>d.id===l)||Yc[l]||{id:l,content:""});function c(l){if(!l||Array.isArray(l)||typeof l!="object")return l;l={...l};for(let d in l){let f=l[d];if(Array.isArray(f)){l[d]=f.map(c);continue}if(typeof f!="string"&&!(f instanceof _t.RichTextData))continue;let h=typeof f=="string"?_t.RichTextData.fromHTMLString(f):new _t.RichTextData(f),p=!1;h.replacements.forEach(g=>{if(g.type==="core/footnote"){let m=g.attributes["data-fn"],y=n.indexOf(m),E=(0,_t.create)({html:g.innerHTML});E.text=String(y+1),E.formats=Array.from({length:E.text.length},()=>E.formats[0]),E.replacements=Array.from({length:E.text.length},()=>E.replacements[0]),g.innerHTML=(0,_t.toHTMLString)({value:E}),p=!0}}),p&&(l[d]=typeof f=="string"?h.toHTMLString():h)}return l}function a(l){return l.map(d=>({...d,attributes:c(d.attributes),innerBlocks:a(d.innerBlocks)}))}let u=a(t);return Yc={...Yc,...o.reduce((l,d)=>(n.includes(d.id)||(l[d.id]=d),l),{})},{meta:{...e,footnotes:JSON.stringify(i)},blocks:u}}var i_=[],Rh=new Map;function Th(t,e,{id:r}={}){let n=Nr(t,e),o=r??n,{content:s,editedBlocks:i,meta:c}=(0,is.useSelect)(h=>{if(!o)return{};let{getEditedEntityRecord:p}=h(x),g=p(t,e,o);return{editedBlocks:g.blocks,content:g.content,meta:g.meta}},[t,e,o]),{__unstableCreateUndoLevel:a,editEntityRecord:u}=(0,is.useDispatch)(x),l=(0,Mn.useMemo)(()=>{if(!o)return;if(i)return i;if(!s||typeof s!="string")return i_;let h=`${t}:${e}:${o}`,p=Rh.get(h),g;return p&&p.content===s?g=p.blocks:(g=(0,cs.parse)(s),Rh.set(h,{content:s,blocks:g})),g},[t,e,o,i,s]),d=(0,Mn.useCallback)((h,p)=>{if(l===h)return a(t,e,o);let{selection:m,...y}=p,E={selection:m,content:({blocks:_=[]})=>(0,cs.__unstableSerializeAndClean)(_),...Gc(h,c)};u(t,e,o,E,{isCached:!1,...y})},[t,e,o,l,c,a,u]),f=(0,Mn.useCallback)((h,p)=>{let{selection:g,...m}=p,y={selection:g,...Gc(h,c)};u(t,e,o,y,{isCached:!0,...m})},[t,e,o,c,u]);return[l,f,d]}var as=w(We(),1),ls=w(W(),1);function xh(t,e,r,n){let o=Nr(t,e),s=n??o,c=(0,as.useContext)(wt)?.revisionId,{value:a,fullValue:u}=(0,ls.useSelect)(f=>{if(c){let y=f(x).getRevisions(t,e,s,{per_page:-1,context:"edit",_fields:"id,date,author,meta,title.raw,excerpt.raw,content.raw"}),_=f(x).getEntityConfig(t,e)?.revisionKey||M,S=y?.find(b=>b[_]===c);return S?{value:S[r]?.raw??S[r],fullValue:S[r]}:{}}let{getEntityRecord:h,getEditedEntityRecord:p}=f(x),g=h(t,e,s),m=p(t,e,s);return g&&m?{value:m[r],fullValue:g[r]}:{}},[t,e,s,r,c]),{editEntityRecord:l}=(0,ls.useDispatch)(x),d=(0,as.useCallback)(f=>{c||l(t,e,s,{[r]:f})},[l,t,e,s,r,c]);return[a,d,u]}var us=w(jn(),1),Je=w(We(),1);var c_={richTextOffset:null,localClientId:null},$c={activeCollaborators:[],resolveSelection:()=>c_,getDebugData:()=>({doc:{},clients:{},collaboratorMap:{}}),isCurrentCollaboratorDisconnected:!1};function Ih(t,e){let r=e??t.getCurrentState();return{activeCollaborators:r,resolveSelection:n=>t.convertSelectionStateToAbsolute(n),getDebugData:()=>t.getDebugData(),isCurrentCollaboratorDisconnected:r.find(n=>n.isMe)?.isConnected===!1}}function Nn(t,e){let[r,n]=(0,Je.useState)($c);return(0,Je.useEffect)(()=>{if(t===null||e===null){n($c);return}let o=`postType/${e}`,s=t.toString(),i=pe()?.getAwareness(o,s);if(!i){n($c);return}return i.setUp(),n(Ih(i)),i?.onStateChange(a=>{n(Ih(i,a))})},[t,e]),r}function Ah(t,e){return Nn(t,e).activeCollaborators}function Dh(t,e){return Nn(t,e).resolveSelection}function a_(t,e){let[r,n]=(0,Je.useState)(null);return(0,Je.useEffect)(()=>{if(t===null||e===null){n(null);return}let o=pe()?.getAwareness(`postType/${e}`,t.toString());if(!o){n(null);return}o.setUp();let s=o.doc.getMap("state"),i=o.doc.getMap("document"),c=Date.now(),a=u=>{if(u.keysChanged.has("savedAt")){let l=s.get("savedAt"),d=s.get("savedBy");if(typeof l=="number"&&typeof d=="number"&&l>c){let f=i.get("status");n({savedAt:l,savedByClientId:d,postStatus:f})}}};return s.observe(a),()=>{s.unobserve(a)}},[t,e]),r}function kh(t,e,r){let{activeCollaborators:n}=Nn(t,e),o=(0,us.usePrevious)(n);(0,Je.useEffect)(()=>{if(!o||o.length===0)return;let s=new Map(o.map(c=>[c.clientId,c])),i=n.find(c=>c.isMe);for(let c of n)!s.has(c.clientId)&&!c.isMe&&r(c,i)},[n,o,r])}function Oh(t,e,r){let{activeCollaborators:n}=Nn(t,e),o=(0,us.usePrevious)(n);(0,Je.useEffect)(()=>{if(!o||o.length===0)return;let s=new Map(n.map(i=>[i.clientId,i]));for(let i of o){if(i.isMe||!i.isConnected)continue;s.get(i.clientId)?.isConnected||r(i)}},[n,o,r])}function Uh(t,e,r){let{activeCollaborators:n}=Nn(t,e),o=a_(t,e),s=(0,us.usePrevious)(o);(0,Je.useEffect)(()=>{if(!o||s&&o.savedAt===s.savedAt)return;let i=n.find(c=>c.clientId===o.savedByClientId&&!c.isMe);i&&r(o,i,s??null)},[o,s,n,r])}var l_={useEntityRecordsWithPermissions:hh,RECEIVE_INTERMEDIATE_RESULTS:Gr,retrySyncConnection:Sd,useActiveCollaborators:Ah,useResolvedSelection:Dh,useOnCollaboratorJoin:kh,useOnCollaboratorLeave:Oh,useOnPostSave:Uh,SelectionType:Dr,SelectionDirection:kr},Lh={};yd(Lh,l_);var zc=[...qo,...Wo.filter(t=>!!t.name)],u_=zc.reduce((t,e)=>{let{kind:r,name:n,plural:o}=e,s=Zt(r,n);if(t[s]=(i,c,a)=>(A(r,n,s,{isShorthandSelector:!0,alternativeFunctionName:"getEntityRecord"}),xe(i,r,n,c,a)),o){let i=Zt(r,o,"get");t[i]=(c,a)=>(A(r,n,i,{isShorthandSelector:!0,alternativeFunctionName:"getEntityRecords"}),Xo(c,r,n,a))}return t},{}),d_=zc.reduce((t,e)=>{let{kind:r,name:n,plural:o}=e,s=Zt(r,n);if(t[s]=(i,c)=>(A(r,n,s,{isShorthandSelector:!0,alternativeFunctionName:"getEntityRecord"}),ts(r,n,i,c)),o){let i=Zt(r,o,"get");t[i]=(...c)=>(A(r,o,i,{isShorthandSelector:!0,alternativeFunctionName:"getEntityRecords"}),Un(r,n,...c)),t[i].shouldInvalidate=c=>Un.shouldInvalidate(c,r,n)}return t},{}),f_=zc.reduce((t,e)=>{let{kind:r,name:n}=e,o=Zt(r,n,"save");t[o]=(i,c)=>(A(r,n,o,{isShorthandSelector:!0,alternativeFunctionName:"saveEntityRecord"}),Ic(r,n,i,c));let s=Zt(r,n,"delete");return t[s]=(i,c,a)=>(A(r,n,s,{isShorthandSelector:!0,alternativeFunctionName:"deleteEntityRecord"}),xc(r,n,i,c,a)),t},{}),h_=()=>({reducer:hf,actions:{...Wf,...Ac,...f_,...qf()},selectors:{...Jf,...bc,...u_},resolvers:{...Lc,...d_}}),q=(0,ds.createReduxStore)(x,h_());Se(q).registerPrivateSelectors(yc);Se(q).registerPrivateActions(Dc);(0,ds.register)(q);return Yh(p_);})(); notices.min.js 0000644 00000010546 15206720414 0007337 0 ustar 00 "use strict";var wp;(wp||={}).notices=(()=>{var $=Object.create;var d=Object.defineProperty;var z=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var H=Object.getPrototypeOf,J=Object.prototype.hasOwnProperty;var S=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),y=(e,t)=>{for(var o in t)d(e,o,{get:t[o],enumerable:!0})},h=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of B(t))!J.call(e,n)&&n!==o&&d(e,n,{get:()=>t[n],enumerable:!(r=z(t,n))||r.enumerable});return e};var m=(e,t,o)=>(o=e!=null?$(H(e)):{},h(t||!e||!e.__esModule?d(o,"default",{value:e,enumerable:!0}):o,e)),W=e=>h(d({},"__esModule",{value:!0}),e);var _=S((ue,I)=>{I.exports=window.wp.data});var O=S((Se,k)=>{k.exports=window.wp.components});var A=S((ye,M)=>{M.exports=window.ReactJSXRuntime});var ae={};y(ae,{InlineNotices:()=>U,SnackbarNotices:()=>X,store:()=>c});var E=m(_(),1);var G=e=>t=>(o={},r)=>{let n=r[e];if(n===void 0)return o;let i=t(o[n],r);return i===o[n]?o:{...o,[n]:i}},L=G;var P=L("context")((e=[],t)=>{switch(t.type){case"CREATE_NOTICE":return[...e.filter(({id:o})=>o!==t.notice.id),t.notice];case"REMOVE_NOTICE":return e.filter(({id:o})=>o!==t.id);case"REMOVE_NOTICES":return e.filter(({id:o})=>!t.ids.includes(o));case"REMOVE_ALL_NOTICES":return e.filter(({type:o})=>o!==t.noticeType);default:return e}}),R=P;var v={};y(v,{createErrorNotice:()=>ee,createInfoNotice:()=>Z,createNotice:()=>f,createSuccessNotice:()=>Y,createWarningNotice:()=>te,removeAllNotices:()=>re,removeNotice:()=>oe,removeNotices:()=>ne});var a="global",w="info";var Q=0;function f(e=w,t,o={}){let{speak:r=!0,isDismissible:n=!0,context:i=a,id:x=`${i}${++Q}`,actions:b=[],type:s="default",__unstableHTML:u,icon:j=null,explicitDismiss:K=!1,onDismiss:q}=o;return t=String(t),{type:"CREATE_NOTICE",context:i,notice:{id:x,status:e,content:t,spokenMessage:r?t:null,__unstableHTML:u,isDismissible:n,actions:b,type:s,icon:j,explicitDismiss:K,onDismiss:q}}}function Y(e,t){return f("success",e,t)}function Z(e,t){return f("info",e,t)}function ee(e,t){return f("error",e,t)}function te(e,t){return f("warning",e,t)}function oe(e,t=a){return{type:"REMOVE_NOTICE",id:e,context:t}}function re(e="default",t=a){return{type:"REMOVE_ALL_NOTICES",noticeType:e,context:t}}function ne(e,t=a){return{type:"REMOVE_NOTICES",ids:e,context:t}}var g={};y(g,{getNotices:()=>se});var ie=[];function se(e,t=a){return e[t]||ie}var c=(0,E.createReduxStore)("core/notices",{reducer:R,actions:v,selectors:g});(0,E.register)(c);function D(e){var t,o,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var n=e.length;for(t=0;t<n;t++)e[t]&&(o=D(e[t]))&&(r&&(r+=" "),r+=o)}else for(o in e)e[o]&&(r&&(r+=" "),r+=o);return r}function ce(){for(var e,t,o=0,r="",n=arguments.length;o<n;o++)(e=arguments[o])&&(t=D(e))&&(r&&(r+=" "),r+=t);return r}var l=ce;var C=m(O(),1),N=m(_(),1);var p=m(A(),1);if(typeof document<"u"&&!document.head.querySelector("style[data-wp-hash='51ef33823e']")){let e=document.createElement("style");e.setAttribute("data-wp-hash","51ef33823e"),e.appendChild(document.createTextNode(".components-notices__dismissible,.components-notices__pinned{color:#1e1e1e}.components-notices__dismissible .components-notice,.components-notices__pinned .components-notice{border-bottom:1px solid #0003;box-sizing:border-box;min-height:64px;padding:0 12px}.components-notices__dismissible .components-notice .components-notice__dismiss,.components-notices__pinned .components-notice .components-notice__dismiss{margin-top:12px}")),document.head.appendChild(e)}function U({children:e,pinnedNoticesClassName:t,dismissibleNoticesClassName:o,context:r}){let n=(0,N.useSelect)(s=>s(c).getNotices(r),[r]),{removeNotice:i}=(0,N.useDispatch)(c),x=n.filter(({isDismissible:s,type:u})=>s&&u==="default"),b=n.filter(({isDismissible:s,type:u})=>!s&&u==="default");return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(C.NoticeList,{notices:b,className:l("components-notices__pinned",t)}),(0,p.jsx)(C.NoticeList,{notices:x,className:l("components-notices__dismissible",o),onRemove:s=>i(s,r),children:e})]})}var F=m(O(),1),T=m(_(),1);var V=m(A(),1),me=-3;function X({className:e,context:t}){let o=(0,T.useSelect)(i=>i(c).getNotices(t),[t]),{removeNotice:r}=(0,T.useDispatch)(c),n=o.filter(({type:i})=>i==="snackbar").slice(me);return(0,V.jsx)(F.SnackbarList,{notices:n,className:l("components-notices__snackbar",e),onRemove:i=>r(i,t)})}return W(ae);})(); i18n.js 0000644 00000036466 15206720414 0005701 0 ustar 00 "use strict"; var wp; (wp ||= {}).i18n = (() => { 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 __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; 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 )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // package-external:@wordpress/hooks var require_hooks = __commonJS({ "package-external:@wordpress/hooks"(exports, module) { module.exports = window.wp.hooks; } }); // packages/i18n/build-module/index.mjs var index_exports = {}; __export(index_exports, { __: () => __, _n: () => _n, _nx: () => _nx, _x: () => _x, createI18n: () => createI18n, defaultI18n: () => default_i18n_default, getLocaleData: () => getLocaleData, hasTranslation: () => hasTranslation, isRTL: () => isRTL, resetLocaleData: () => resetLocaleData, setLocaleData: () => setLocaleData, sprintf: () => sprintf2, subscribe: () => subscribe }); // node_modules/@tannin/sprintf/src/index.js var PATTERN = /%(((\d+)\$)|(\(([$_a-zA-Z][$_a-zA-Z0-9]*)\)))?[ +0#-]*\d*(\.(\d+|\*))?(ll|[lhqL])?([cduxXefgsp%])/g; function sprintf(string, ...args) { var i = 0; if (Array.isArray(args[0])) { args = /** @type {import('../types').SprintfArgs<T>[]} */ /** @type {unknown} */ args[0]; } return string.replace(PATTERN, function() { var index, name, precision, type, value; index = arguments[3]; name = arguments[5]; precision = arguments[7]; type = arguments[9]; if (type === "%") { return "%"; } if (precision === "*") { precision = args[i]; i++; } if (name === void 0) { if (index === void 0) { index = i + 1; } i++; value = args[index - 1]; } else if (args[0] && typeof args[0] === "object" && args[0].hasOwnProperty(name)) { value = args[0][name]; } if (type === "f") { value = parseFloat(value) || 0; } else if (type === "d") { value = parseInt(value) || 0; } if (precision !== void 0) { if (type === "f") { value = value.toFixed(precision); } else if (type === "s") { value = value.substr(0, precision); } } return value !== void 0 && value !== null ? value : ""; }); } // packages/i18n/build-module/sprintf.mjs function sprintf2(format, ...args) { return sprintf(format, ...args); } // node_modules/@tannin/postfix/index.js var PRECEDENCE; var OPENERS; var TERMINATORS; var PATTERN2; PRECEDENCE = { "(": 9, "!": 8, "*": 7, "/": 7, "%": 7, "+": 6, "-": 6, "<": 5, "<=": 5, ">": 5, ">=": 5, "==": 4, "!=": 4, "&&": 3, "||": 2, "?": 1, "?:": 1 }; OPENERS = ["(", "?"]; TERMINATORS = { ")": ["("], ":": ["?", "?:"] }; PATTERN2 = /<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/; function postfix(expression) { var terms = [], stack = [], match, operator, term, element; while (match = expression.match(PATTERN2)) { operator = match[0]; term = expression.substr(0, match.index).trim(); if (term) { terms.push(term); } while (element = stack.pop()) { if (TERMINATORS[operator]) { if (TERMINATORS[operator][0] === element) { operator = TERMINATORS[operator][1] || operator; break; } } else if (OPENERS.indexOf(element) >= 0 || PRECEDENCE[element] < PRECEDENCE[operator]) { stack.push(element); break; } terms.push(element); } if (!TERMINATORS[operator]) { stack.push(operator); } expression = expression.substr(match.index + operator.length); } expression = expression.trim(); if (expression) { terms.push(expression); } return terms.concat(stack.reverse()); } // node_modules/@tannin/evaluate/index.js var OPERATORS = { "!": function(a) { return !a; }, "*": function(a, b) { return a * b; }, "/": function(a, b) { return a / b; }, "%": function(a, b) { return a % b; }, "+": function(a, b) { return a + b; }, "-": function(a, b) { return a - b; }, "<": function(a, b) { return a < b; }, "<=": function(a, b) { return a <= b; }, ">": function(a, b) { return a > b; }, ">=": function(a, b) { return a >= b; }, "==": function(a, b) { return a === b; }, "!=": function(a, b) { return a !== b; }, "&&": function(a, b) { return a && b; }, "||": function(a, b) { return a || b; }, "?:": function(a, b, c) { if (a) { throw b; } return c; } }; function evaluate(postfix2, variables) { var stack = [], i, j, args, getOperatorResult, term, value; for (i = 0; i < postfix2.length; i++) { term = postfix2[i]; getOperatorResult = OPERATORS[term]; if (getOperatorResult) { j = getOperatorResult.length; args = Array(j); while (j--) { args[j] = stack.pop(); } try { value = getOperatorResult.apply(null, args); } catch (earlyReturn) { return earlyReturn; } } else if (variables.hasOwnProperty(term)) { value = variables[term]; } else { value = +term; } stack.push(value); } return stack[0]; } // node_modules/@tannin/compile/index.js function compile(expression) { var terms = postfix(expression); return function(variables) { return evaluate(terms, variables); }; } // node_modules/@tannin/plural-forms/index.js function pluralForms(expression) { var evaluate2 = compile(expression); return function(n) { return +evaluate2({ n }); }; } // node_modules/tannin/index.js var DEFAULT_OPTIONS = { contextDelimiter: "", onMissingKey: null }; function getPluralExpression(pf) { var parts, i, part; parts = pf.split(";"); for (i = 0; i < parts.length; i++) { part = parts[i].trim(); if (part.indexOf("plural=") === 0) { return part.substr(7); } } } function Tannin(data, options) { var key; this.data = data; this.pluralForms = {}; this.options = {}; for (key in DEFAULT_OPTIONS) { this.options[key] = options !== void 0 && key in options ? options[key] : DEFAULT_OPTIONS[key]; } } Tannin.prototype.getPluralForm = function(domain, n) { var getPluralForm = this.pluralForms[domain], config, plural, pf; if (!getPluralForm) { config = this.data[domain][""]; pf = config["Plural-Forms"] || config["plural-forms"] || // Ignore reason: As known, there's no way to document the empty // string property on a key to guarantee this as metadata. // @ts-ignore config.plural_forms; if (typeof pf !== "function") { plural = getPluralExpression( config["Plural-Forms"] || config["plural-forms"] || // Ignore reason: As known, there's no way to document the empty // string property on a key to guarantee this as metadata. // @ts-ignore config.plural_forms ); pf = pluralForms(plural); } getPluralForm = this.pluralForms[domain] = pf; } return getPluralForm(n); }; Tannin.prototype.dcnpgettext = function(domain, context, singular, plural, n) { var index, key, entry; if (n === void 0) { index = 0; } else { index = this.getPluralForm(domain, n); } key = singular; if (context) { key = context + this.options.contextDelimiter + singular; } entry = this.data[domain][key]; if (entry && entry[index]) { return entry[index]; } if (this.options.onMissingKey) { this.options.onMissingKey(singular, domain); } return index === 0 ? singular : plural; }; // packages/i18n/build-module/create-i18n.mjs var DEFAULT_LOCALE_DATA = { "": { plural_forms(n) { return n === 1 ? 0 : 1; } } }; var I18N_HOOK_REGEXP = /^i18n\.(n?gettext|has_translation)(_|$)/; var createI18n = (initialData, initialDomain, hooks) => { const tannin = new Tannin({}); const listeners = /* @__PURE__ */ new Set(); const notifyListeners = () => { listeners.forEach((listener) => listener()); }; const subscribe2 = (callback) => { listeners.add(callback); return () => listeners.delete(callback); }; const getLocaleData2 = (domain = "default") => tannin.data[domain]; const doSetLocaleData = (data, domain = "default") => { tannin.data[domain] = { ...tannin.data[domain], ...data }; tannin.data[domain][""] = { ...DEFAULT_LOCALE_DATA[""], ...tannin.data[domain]?.[""] }; delete tannin.pluralForms[domain]; }; const setLocaleData2 = (data, domain) => { doSetLocaleData(data, domain); notifyListeners(); }; const addLocaleData = (data, domain = "default") => { tannin.data[domain] = { ...tannin.data[domain], ...data, // Populate default domain configuration (supported locale date which omits // a plural forms expression). "": { ...DEFAULT_LOCALE_DATA[""], ...tannin.data[domain]?.[""], ...data?.[""] } }; delete tannin.pluralForms[domain]; notifyListeners(); }; const resetLocaleData2 = (data, domain) => { tannin.data = {}; tannin.pluralForms = {}; setLocaleData2(data, domain); }; const dcnpgettext = (domain = "default", context, single, plural, number) => { if (!tannin.data[domain]) { doSetLocaleData(void 0, domain); } return tannin.dcnpgettext(domain, context, single, plural, number); }; const getFilterDomain = (domain) => domain || "default"; const __2 = (text, domain) => { let translation = dcnpgettext(domain, void 0, text); if (!hooks) { return translation; } translation = hooks.applyFilters( "i18n.gettext", translation, text, domain ); return hooks.applyFilters( "i18n.gettext_" + getFilterDomain(domain), translation, text, domain ); }; const _x2 = (text, context, domain) => { let translation = dcnpgettext(domain, context, text); if (!hooks) { return translation; } translation = hooks.applyFilters( "i18n.gettext_with_context", translation, text, context, domain ); return hooks.applyFilters( "i18n.gettext_with_context_" + getFilterDomain(domain), translation, text, context, domain ); }; const _n2 = (single, plural, number, domain) => { let translation = dcnpgettext( domain, void 0, single, plural, number ); if (!hooks) { return translation; } translation = hooks.applyFilters( "i18n.ngettext", translation, single, plural, number, domain ); return hooks.applyFilters( "i18n.ngettext_" + getFilterDomain(domain), translation, single, plural, number, domain ); }; const _nx2 = (single, plural, number, context, domain) => { let translation = dcnpgettext( domain, context, single, plural, number ); if (!hooks) { return translation; } translation = hooks.applyFilters( "i18n.ngettext_with_context", translation, single, plural, number, context, domain ); return hooks.applyFilters( "i18n.ngettext_with_context_" + getFilterDomain(domain), translation, single, plural, number, context, domain ); }; const isRTL2 = () => { return "rtl" === _x2("ltr", "text direction"); }; const hasTranslation2 = (single, context, domain) => { const key = context ? context + "" + single : single; let result = !!tannin.data?.[domain ?? "default"]?.[key]; if (hooks) { result = hooks.applyFilters( "i18n.has_translation", result, single, context, domain ); result = hooks.applyFilters( "i18n.has_translation_" + getFilterDomain(domain), result, single, context, domain ); } return result; }; if (initialData) { setLocaleData2(initialData, initialDomain); } if (hooks) { const onHookAddedOrRemoved = (hookName) => { if (I18N_HOOK_REGEXP.test(hookName)) { notifyListeners(); } }; hooks.addAction("hookAdded", "core/i18n", onHookAddedOrRemoved); hooks.addAction("hookRemoved", "core/i18n", onHookAddedOrRemoved); } return { getLocaleData: getLocaleData2, setLocaleData: setLocaleData2, addLocaleData, resetLocaleData: resetLocaleData2, subscribe: subscribe2, __: __2, _x: _x2, _n: _n2, _nx: _nx2, isRTL: isRTL2, hasTranslation: hasTranslation2 }; }; // packages/i18n/build-module/default-i18n.mjs var import_hooks = __toESM(require_hooks(), 1); var i18n = createI18n(void 0, void 0, import_hooks.defaultHooks); var default_i18n_default = i18n; var getLocaleData = i18n.getLocaleData.bind(i18n); var setLocaleData = i18n.setLocaleData.bind(i18n); var resetLocaleData = i18n.resetLocaleData.bind(i18n); var subscribe = i18n.subscribe.bind(i18n); var __ = i18n.__.bind(i18n); var _x = i18n._x.bind(i18n); var _n = i18n._n.bind(i18n); var _nx = i18n._nx.bind(i18n); var isRTL = i18n.isRTL.bind(i18n); var hasTranslation = i18n.hasTranslation.bind(i18n); return __toCommonJS(index_exports); })(); annotations.min.js 0000644 00000013126 15206720414 0010225 0 ustar 00 var wp;(wp||={}).annotations=(()=>{var X=Object.create;var l=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var z=Object.getOwnPropertyNames;var J=Object.getPrototypeOf,K=Object.prototype.hasOwnProperty;var m=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),_=(t,e)=>{for(var n in e)l(t,n,{get:e[n],enumerable:!0})},S=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of z(e))!K.call(t,o)&&o!==n&&l(t,o,{get:()=>e[o],enumerable:!(r=q(e,o))||r.enumerable});return t};var s=(t,e,n)=>(n=t!=null?X(J(t)):{},S(e||!t||!t.__esModule?l(n,"default",{value:t,enumerable:!0}):n,t)),Q=t=>S(l({},"__esModule",{value:!0}),t);var g=m((Nt,D)=>{D.exports=window.wp.richText});var M=m((Tt,C)=>{C.exports=window.wp.i18n});var F=m((Ot,G)=>{G.exports=window.wp.hooks});var d=m((ht,B)=>{B.exports=window.wp.data});var _t={};_(_t,{store:()=>b});var k=s(g(),1);var P=s(M(),1),T=s(g(),1);var p="core/annotations";var E="core/annotation",N="annotation-text-";function Z(t,e=[]){return e.forEach(n=>{let{start:r,end:o}=n;r>t.text.length&&(r=t.text.length),o>t.text.length&&(o=t.text.length);let i=N+n.source,u=N+n.id;t=(0,T.applyFormat)(t,{type:E,attributes:{className:i,id:u}},r,o)}),t}function $(t){let e={};return t.forEach((n,r)=>{n=n||[],n=n.filter(o=>o.type===E),n.forEach(o=>{let{id:i}=o.attributes;i=i.replace(N,""),e.hasOwnProperty(i)||(e[i]={start:r}),e[i].end=r+1})}),e}function tt(t,e,{removeAnnotation:n,updateAnnotationRange:r}){t.forEach(o=>{let i=e[o.id];if(!i){n(o.id);return}let{start:u,end:x}=o;(u!==i.start||x!==i.end)&&r(o.id,i.start,i.end)})}var V={name:E,title:(0,P.__)("Annotation"),tagName:"mark",className:"annotation-text",attributes:{className:"class",id:"id"},edit(){return null},__experimentalGetPropsForEditableTreePreparation(t,{richTextIdentifier:e,blockClientId:n}){return{annotations:t(p).__experimentalGetAnnotationsForRichText(n,e)}},__experimentalCreatePrepareEditableTree({annotations:t}){return(e,n)=>{if(t.length===0)return e;let r={formats:e,text:n};return r=Z(r,t),r.formats}},__experimentalGetPropsForEditableTreeChangeHandler(t){return{removeAnnotation:t(p).__experimentalRemoveAnnotation,updateAnnotationRange:t(p).__experimentalUpdateAnnotationRange}},__experimentalCreateOnChangeEditableValue(t){return e=>{let n=$(e),{removeAnnotation:r,updateAnnotationRange:o,annotations:i}=t;tt(i,n,{removeAnnotation:r,updateAnnotationRange:o})}}};var{name:et,...nt}=V;(0,k.registerFormatType)(et,nt);var j=s(F(),1),H=s(d(),1);var rt=t=>(0,H.withSelect)((e,{clientId:n,className:r})=>({className:e(p).__experimentalGetAnnotationsForBlock(n).map(i=>"is-annotated-by-"+i.source).concat(r).filter(Boolean).join(" ")}))(t);(0,j.addFilter)("editor.BlockListBlock","core/annotations",rt);var f=s(d(),1);function L(t,e){let n=t.filter(e);return t.length===n.length?t:n}var v=(t,e)=>Object.entries(t).reduce((n,[r,o])=>({...n,[r]:e(o)}),{});function ot(t){return typeof t.start=="number"&&typeof t.end=="number"&&t.start<=t.end}function it(t={},e){switch(e.type){case"ANNOTATION_ADD":let n=e.blockClientId,r={id:e.id,blockClientId:n,richTextIdentifier:e.richTextIdentifier,source:e.source,selector:e.selector,range:e.range};if(r.selector==="range"&&!ot(r.range))return t;let o=t?.[n]??[];return{...t,[n]:[...o,r]};case"ANNOTATION_REMOVE":return v(t,i=>L(i,u=>u.id!==e.annotationId));case"ANNOTATION_UPDATE_RANGE":return v(t,i=>{let u=!1,x=i.map(A=>A.id===e.annotationId?(u=!0,{...A,range:{start:e.start,end:e.end}}):A);return u?x:i});case"ANNOTATION_REMOVE_SOURCE":return v(t,i=>L(i,u=>u.source!==e.source))}return t}var W=it;var O={};_(O,{__experimentalGetAllAnnotationsForBlock:()=>ut,__experimentalGetAnnotations:()=>st,__experimentalGetAnnotationsForBlock:()=>at,__experimentalGetAnnotationsForRichText:()=>pt});var R=s(d(),1),y=[],at=(0,R.createSelector)((t,e)=>(t?.[e]??[]).filter(n=>n.selector==="block"),(t,e)=>[t?.[e]??y]);function ut(t,e){return t?.[e]??y}var pt=(0,R.createSelector)((t,e,n)=>(t?.[e]??[]).filter(r=>r.selector==="range"&&n===r.richTextIdentifier).map(r=>{let{range:o,...i}=r;return{...o,...i}}),(t,e)=>[t?.[e]??y]);function st(t){return Object.values(t).flat()}var U={};_(U,{__experimentalAddAnnotation:()=>ct,__experimentalRemoveAnnotation:()=>ft,__experimentalRemoveAnnotationsBySource:()=>At,__experimentalUpdateAnnotationRange:()=>xt});var c,lt=new Uint8Array(16);function h(){if(!c&&(c=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!c))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return c(lt)}var a=[];for(let t=0;t<256;++t)a.push((t+256).toString(16).slice(1));function Y(t,e=0){return a[t[e+0]]+a[t[e+1]]+a[t[e+2]]+a[t[e+3]]+"-"+a[t[e+4]]+a[t[e+5]]+"-"+a[t[e+6]]+a[t[e+7]]+"-"+a[t[e+8]]+a[t[e+9]]+"-"+a[t[e+10]]+a[t[e+11]]+a[t[e+12]]+a[t[e+13]]+a[t[e+14]]+a[t[e+15]]}var mt=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),I={randomUUID:mt};function dt(t,e,n){if(I.randomUUID&&!e&&!t)return I.randomUUID();t=t||{};let r=t.random||(t.rng||h)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,e){n=n||0;for(let o=0;o<16;++o)e[n+o]=r[o];return e}return Y(r)}var w=dt;function ct({blockClientId:t,richTextIdentifier:e=null,range:n=null,selector:r="range",source:o="default",id:i=w()}){let u={type:"ANNOTATION_ADD",id:i,blockClientId:t,richTextIdentifier:e,source:o,selector:r};return r==="range"&&(u.range=n),u}function ft(t){return{type:"ANNOTATION_REMOVE",annotationId:t}}function xt(t,e,n){return{type:"ANNOTATION_UPDATE_RANGE",annotationId:t,start:e,end:n}}function At(t){return{type:"ANNOTATION_REMOVE_SOURCE",source:t}}var b=(0,f.createReduxStore)(p,{reducer:W,selectors:O,actions:U});(0,f.register)(b);return Q(_t);})(); preferences-persistence.js 0000644 00000042335 15206720414 0011735 0 ustar 00 var wp; (wp ||= {}).preferencesPersistence = (() => { 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 __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; 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 )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // package-external:@wordpress/api-fetch var require_api_fetch = __commonJS({ "package-external:@wordpress/api-fetch"(exports, module) { module.exports = window.wp.apiFetch; } }); // packages/preferences-persistence/build-module/index.mjs var index_exports = {}; __export(index_exports, { __unstableCreatePersistenceLayer: () => __unstableCreatePersistenceLayer, create: () => create }); // packages/preferences-persistence/build-module/create/index.mjs var import_api_fetch = __toESM(require_api_fetch(), 1); // packages/preferences-persistence/build-module/create/debounce-async.mjs function debounceAsync(func, delayMS) { let timeoutId; let activePromise; return async function debounced(...args) { if (!activePromise && !timeoutId) { return new Promise((resolve, reject) => { activePromise = func(...args).then((...thenArgs) => { resolve(...thenArgs); }).catch((error) => { reject(error); }).finally(() => { activePromise = null; }); }); } if (activePromise) { await activePromise; } if (timeoutId) { clearTimeout(timeoutId); timeoutId = null; } return new Promise((resolve, reject) => { timeoutId = setTimeout(() => { activePromise = func(...args).then((...thenArgs) => { resolve(...thenArgs); }).catch((error) => { reject(error); }).finally(() => { activePromise = null; timeoutId = null; }); }, delayMS); }); }; } // packages/preferences-persistence/build-module/create/index.mjs var EMPTY_OBJECT = {}; var localStorage = window.localStorage; function create({ preloadedData, localStorageRestoreKey = "WP_PREFERENCES_RESTORE_DATA", requestDebounceMS = 2500 } = {}) { let cache = preloadedData; const debouncedApiFetch = debounceAsync(import_api_fetch.default, requestDebounceMS); async function get() { if (cache) { return cache; } const user = await (0, import_api_fetch.default)({ path: "/wp/v2/users/me?context=edit" }); const serverData = user?.meta?.persisted_preferences; const localData = JSON.parse( localStorage.getItem(localStorageRestoreKey) ); const serverTimestamp = Date.parse(serverData?._modified) || 0; const localTimestamp = Date.parse(localData?._modified) || 0; if (serverData && serverTimestamp >= localTimestamp) { cache = serverData; } else if (localData) { cache = localData; } else { cache = EMPTY_OBJECT; } return cache; } function set(newData) { const dataWithTimestamp = { ...newData, _modified: (/* @__PURE__ */ new Date()).toISOString() }; cache = dataWithTimestamp; localStorage.setItem( localStorageRestoreKey, JSON.stringify(dataWithTimestamp) ); debouncedApiFetch({ path: "/wp/v2/users/me", method: "PUT", // `keepalive` will still send the request in the background, // even when a browser unload event might interrupt it. // This should hopefully make things more resilient. // This does have a size limit of 64kb, but the data is usually // much less. keepalive: true, data: { meta: { persisted_preferences: dataWithTimestamp } } }).catch(() => { }); } return { get, set }; } // packages/preferences-persistence/build-module/migrations/legacy-local-storage-data/move-feature-preferences.mjs function moveFeaturePreferences(state, sourceStoreName) { const preferencesStoreName = "core/preferences"; const interfaceStoreName = "core/interface"; const interfaceFeatures = state?.[interfaceStoreName]?.preferences?.features?.[sourceStoreName]; const sourceFeatures = state?.[sourceStoreName]?.preferences?.features; const featuresToMigrate = interfaceFeatures ? interfaceFeatures : sourceFeatures; if (!featuresToMigrate) { return state; } const existingPreferences = state?.[preferencesStoreName]?.preferences; if (existingPreferences?.[sourceStoreName]) { return state; } let updatedInterfaceState; if (interfaceFeatures) { const otherInterfaceState = state?.[interfaceStoreName]; const otherInterfaceScopes = state?.[interfaceStoreName]?.preferences?.features; updatedInterfaceState = { [interfaceStoreName]: { ...otherInterfaceState, preferences: { features: { ...otherInterfaceScopes, [sourceStoreName]: void 0 } } } }; } let updatedSourceState; if (sourceFeatures) { const otherSourceState = state?.[sourceStoreName]; const sourcePreferences = state?.[sourceStoreName]?.preferences; updatedSourceState = { [sourceStoreName]: { ...otherSourceState, preferences: { ...sourcePreferences, features: void 0 } } }; } return { ...state, [preferencesStoreName]: { preferences: { ...existingPreferences, [sourceStoreName]: featuresToMigrate } }, ...updatedInterfaceState, ...updatedSourceState }; } // packages/preferences-persistence/build-module/migrations/legacy-local-storage-data/move-third-party-feature-preferences.mjs function moveThirdPartyFeaturePreferencesToPreferences(state) { const interfaceStoreName = "core/interface"; const preferencesStoreName = "core/preferences"; const interfaceScopes = state?.[interfaceStoreName]?.preferences?.features; const interfaceScopeKeys = interfaceScopes ? Object.keys(interfaceScopes) : []; if (!interfaceScopeKeys?.length) { return state; } return interfaceScopeKeys.reduce(function(convertedState, scope) { if (scope.startsWith("core")) { return convertedState; } const featuresToMigrate = interfaceScopes?.[scope]; if (!featuresToMigrate) { return convertedState; } const existingMigratedData = convertedState?.[preferencesStoreName]?.preferences?.[scope]; if (existingMigratedData) { return convertedState; } const otherPreferencesScopes = convertedState?.[preferencesStoreName]?.preferences; const otherInterfaceState = convertedState?.[interfaceStoreName]; const otherInterfaceScopes = convertedState?.[interfaceStoreName]?.preferences?.features; return { ...convertedState, [preferencesStoreName]: { preferences: { ...otherPreferencesScopes, [scope]: featuresToMigrate } }, [interfaceStoreName]: { ...otherInterfaceState, preferences: { features: { ...otherInterfaceScopes, [scope]: void 0 } } } }; }, state); } // packages/preferences-persistence/build-module/migrations/legacy-local-storage-data/move-individual-preference.mjs var identity = (arg) => arg; function moveIndividualPreferenceToPreferences(state, { from: sourceStoreName, to: scope }, key, convert = identity) { const preferencesStoreName = "core/preferences"; const sourcePreference = state?.[sourceStoreName]?.preferences?.[key]; if (sourcePreference === void 0) { return state; } const targetPreference = state?.[preferencesStoreName]?.preferences?.[scope]?.[key]; if (targetPreference) { return state; } const otherScopes = state?.[preferencesStoreName]?.preferences; const otherPreferences = state?.[preferencesStoreName]?.preferences?.[scope]; const otherSourceState = state?.[sourceStoreName]; const allSourcePreferences = state?.[sourceStoreName]?.preferences; const convertedPreferences = convert({ [key]: sourcePreference }); return { ...state, [preferencesStoreName]: { preferences: { ...otherScopes, [scope]: { ...otherPreferences, ...convertedPreferences } } }, [sourceStoreName]: { ...otherSourceState, preferences: { ...allSourcePreferences, [key]: void 0 } } }; } // packages/preferences-persistence/build-module/migrations/legacy-local-storage-data/move-interface-enable-items.mjs function moveInterfaceEnableItems(state) { const interfaceStoreName = "core/interface"; const preferencesStoreName = "core/preferences"; const sourceEnableItems = state?.[interfaceStoreName]?.enableItems; if (!sourceEnableItems) { return state; } const allPreferences = state?.[preferencesStoreName]?.preferences ?? {}; const sourceComplementaryAreas = sourceEnableItems?.singleEnableItems?.complementaryArea ?? {}; const preferencesWithConvertedComplementaryAreas = Object.keys( sourceComplementaryAreas ).reduce((accumulator, scope) => { const data = sourceComplementaryAreas[scope]; if (accumulator?.[scope]?.complementaryArea) { return accumulator; } return { ...accumulator, [scope]: { ...accumulator[scope], complementaryArea: data } }; }, allPreferences); const sourcePinnedItems = sourceEnableItems?.multipleEnableItems?.pinnedItems ?? {}; const allConvertedData = Object.keys(sourcePinnedItems).reduce( (accumulator, scope) => { const data = sourcePinnedItems[scope]; if (accumulator?.[scope]?.pinnedItems) { return accumulator; } return { ...accumulator, [scope]: { ...accumulator[scope], pinnedItems: data } }; }, preferencesWithConvertedComplementaryAreas ); const otherInterfaceItems = state[interfaceStoreName]; return { ...state, [preferencesStoreName]: { preferences: allConvertedData }, [interfaceStoreName]: { ...otherInterfaceItems, enableItems: void 0 } }; } // packages/preferences-persistence/build-module/migrations/legacy-local-storage-data/convert-edit-post-panels.mjs function convertEditPostPanels(preferences) { const panels = preferences?.panels ?? {}; return Object.keys(panels).reduce( (convertedData, panelName) => { const panel = panels[panelName]; if (panel?.enabled === false) { convertedData.inactivePanels.push(panelName); } if (panel?.opened === true) { convertedData.openPanels.push(panelName); } return convertedData; }, { inactivePanels: [], openPanels: [] } ); } // packages/preferences-persistence/build-module/migrations/legacy-local-storage-data/index.mjs function getLegacyData(userId) { const key = `WP_DATA_USER_${userId}`; const unparsedData = window.localStorage.getItem(key); return JSON.parse(unparsedData); } function convertLegacyData(data) { if (!data) { return; } data = moveFeaturePreferences(data, "core/edit-widgets"); data = moveFeaturePreferences(data, "core/customize-widgets"); data = moveFeaturePreferences(data, "core/edit-post"); data = moveFeaturePreferences(data, "core/edit-site"); data = moveThirdPartyFeaturePreferencesToPreferences(data); data = moveInterfaceEnableItems(data); data = moveIndividualPreferenceToPreferences( data, { from: "core/edit-post", to: "core/edit-post" }, "hiddenBlockTypes" ); data = moveIndividualPreferenceToPreferences( data, { from: "core/edit-post", to: "core/edit-post" }, "editorMode" ); data = moveIndividualPreferenceToPreferences( data, { from: "core/edit-post", to: "core/edit-post" }, "panels", convertEditPostPanels ); data = moveIndividualPreferenceToPreferences( data, { from: "core/editor", to: "core" }, "isPublishSidebarEnabled" ); data = moveIndividualPreferenceToPreferences( data, { from: "core/edit-post", to: "core" }, "isPublishSidebarEnabled" ); data = moveIndividualPreferenceToPreferences( data, { from: "core/edit-site", to: "core/edit-site" }, "editorMode" ); return data?.["core/preferences"]?.preferences; } function convertLegacyLocalStorageData(userId) { const data = getLegacyData(userId); return convertLegacyData(data); } // packages/preferences-persistence/build-module/migrations/preferences-package-data/convert-complementary-areas.mjs function convertComplementaryAreas(state) { return Object.keys(state).reduce((stateAccumulator, scope) => { const scopeData = state[scope]; if (scopeData?.complementaryArea) { const updatedScopeData = { ...scopeData }; delete updatedScopeData.complementaryArea; updatedScopeData.isComplementaryAreaVisible = true; stateAccumulator[scope] = updatedScopeData; return stateAccumulator; } return stateAccumulator; }, state); } // packages/preferences-persistence/build-module/migrations/preferences-package-data/convert-editor-settings.mjs function convertEditorSettings(data) { let newData = data; const settingsToMoveToCore = [ "allowRightClickOverrides", "distractionFree", "editorMode", "fixedToolbar", "focusMode", "hiddenBlockTypes", "inactivePanels", "keepCaretInsideBlock", "mostUsedBlocks", "openPanels", "showBlockBreadcrumbs", "showIconLabels", "showListViewByDefault", "isPublishSidebarEnabled", "isComplementaryAreaVisible", "pinnedItems" ]; settingsToMoveToCore.forEach((setting) => { if (data?.["core/edit-post"]?.[setting] !== void 0) { newData = { ...newData, core: { ...newData?.core, [setting]: data["core/edit-post"][setting] } }; delete newData["core/edit-post"][setting]; } if (data?.["core/edit-site"]?.[setting] !== void 0) { delete newData["core/edit-site"][setting]; } }); if (Object.keys(newData?.["core/edit-post"] ?? {})?.length === 0) { delete newData["core/edit-post"]; } if (Object.keys(newData?.["core/edit-site"] ?? {})?.length === 0) { delete newData["core/edit-site"]; } return newData; } // packages/preferences-persistence/build-module/migrations/preferences-package-data/index.mjs function convertPreferencesPackageData(data) { let newData = convertComplementaryAreas(data); newData = convertEditorSettings(newData); return newData; } // packages/preferences-persistence/build-module/index.mjs function __unstableCreatePersistenceLayer(serverData, userId) { const localStorageRestoreKey = `WP_PREFERENCES_USER_${userId}`; const localData = JSON.parse( window.localStorage.getItem(localStorageRestoreKey) ); const serverModified = Date.parse(serverData && serverData._modified) || 0; const localModified = Date.parse(localData && localData._modified) || 0; let preloadedData; if (serverData && serverModified >= localModified) { preloadedData = convertPreferencesPackageData(serverData); } else if (localData) { preloadedData = convertPreferencesPackageData(localData); } else { preloadedData = convertLegacyLocalStorageData(userId); } return create({ preloadedData, localStorageRestoreKey }); } return __toCommonJS(index_exports); })(); upload-media.min.js 0000644 00000056023 15206720414 0010234 0 ustar 00 "use strict";var wp;(wp||={}).uploadMedia=(()=>{var Xe=Object.create;var N=Object.defineProperty;var Ze=Object.getOwnPropertyDescriptor;var Ke=Object.getOwnPropertyNames;var Je=Object.getPrototypeOf,et=Object.prototype.hasOwnProperty;var tt=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var S=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),M=(e,t)=>{for(var r in t)N(e,r,{get:t[r],enumerable:!0})},pe=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Ke(t))!et.call(e,n)&&n!==r&&N(e,n,{get:()=>t[n],enumerable:!(o=Ze(t,n))||o.enumerable});return e};var y=(e,t,r)=>(r=e!=null?Xe(Je(e)):{},pe(t||!e||!e.__esModule?N(r,"default",{value:e,enumerable:!0}):r,e)),rt=e=>pe(N({},"__esModule",{value:!0}),e);var q=S((ur,me)=>{me.exports=window.wp.data});var he=S((_r,ye)=>{ye.exports=window.wp.url});var D=S((Pr,Ue)=>{Ue.exports=window.wp.i18n});var Oe=S((Hr,Fe)=>{Fe.exports=window.wp.blob});var De=S((no,Me)=>{Me.exports=window.wp.privateApis});var se=S((po,Ne)=>{Ne.exports=window.wp.element});var ke=S((mo,qe)=>{qe.exports=window.wp.compose});var ue=S((fo,Le)=>{Le.exports=window.ReactJSXRuntime});var ar={};M(ar,{MediaUploadProvider:()=>je,UploadError:()=>v,clearFeatureDetectionCache:()=>Ye,detectClientSideMediaSupport:()=>ce,isClientSideMediaSupported:()=>He,store:()=>P});var O=y(q(),1);var s=(e=>(e.Unknown="REDUX_UNKNOWN",e.Add="ADD_ITEM",e.Prepare="PREPARE_ITEM",e.Cancel="CANCEL_ITEM",e.Remove="REMOVE_ITEM",e.RetryItem="RETRY_ITEM",e.PauseItem="PAUSE_ITEM",e.ResumeItem="RESUME_ITEM",e.PauseQueue="PAUSE_QUEUE",e.ResumeQueue="RESUME_QUEUE",e.OperationStart="OPERATION_START",e.OperationFinish="OPERATION_FINISH",e.AddOperations="ADD_OPERATIONS",e.CacheBlobUrl="CACHE_BLOB_URL",e.RevokeBlobUrls="REVOKE_BLOB_URLS",e.UpdateProgress="UPDATE_PROGRESS",e.UpdateSettings="UPDATE_SETTINGS",e))(s||{}),w=(e=>(e.Queued="QUEUED",e.Processing="PROCESSING",e.Paused="PAUSED",e.Uploaded="UPLOADED",e.Error="ERROR",e))(w||{}),u=(e=>(e.Prepare="PREPARE",e.Upload="UPLOAD",e.ResizeCrop="RESIZE_CROP",e.Rotate="ROTATE",e.TranscodeImage="TRANSCODE_IMAGE",e.ThumbnailGeneration="THUMBNAIL_GENERATION",e.Finalize="FINALIZE",e))(u||{});var k="core/upload-media",de=5,fe=2,ge=["image/jpeg","image/png","image/gif","image/webp","image/avif"];var ot=()=>{},nt={queue:[],queueStatus:"active",blobUrls:{},settings:{mediaUpload:ot,maxConcurrentUploads:de,maxConcurrentImageProcessing:fe}};function it(e=nt,t={type:s.Unknown}){switch(t.type){case s.PauseQueue:return{...e,queueStatus:"paused"};case s.ResumeQueue:return{...e,queueStatus:"active"};case s.PauseItem:return{...e,queue:e.queue.map(r=>r.id===t.id?{...r,status:w.Paused}:r)};case s.ResumeItem:return{...e,queue:e.queue.map(r=>r.id===t.id?{...r,status:w.Processing}:r)};case s.Add:return{...e,queue:[...e.queue,t.item]};case s.Cancel:return{...e,queue:e.queue.map(r=>r.id===t.id?{...r,error:t.error}:r)};case s.RetryItem:return{...e,queue:e.queue.map(r=>r.id===t.id?{...r,status:w.Processing,error:void 0,retryCount:(r.retryCount??0)+1}:r)};case s.Remove:return{...e,queue:e.queue.filter(r=>r.id!==t.id)};case s.OperationStart:return{...e,queue:e.queue.map(r=>r.id===t.id?{...r,currentOperation:t.operation}:r)};case s.AddOperations:return{...e,queue:e.queue.map(r=>r.id!==t.id?r:{...r,operations:[...r.operations||[],...t.operations]})};case s.OperationFinish:return{...e,queue:e.queue.map(r=>{if(r.id!==t.id)return r;let o=r.operations?r.operations.slice(1):[],n=r.attachment||t.item.attachment?{...r.attachment,...t.item.attachment}:void 0;return{...r,currentOperation:void 0,operations:o,...t.item,attachment:n,additionalData:{...r.additionalData,...t.item.additionalData}}})};case s.CacheBlobUrl:{let r=e.blobUrls[t.id]||[];return{...e,blobUrls:{...e.blobUrls,[t.id]:[...r,t.blobUrl]}}}case s.RevokeBlobUrls:{let r={...e.blobUrls};return delete r[t.id],{...e,blobUrls:r}}case s.UpdateProgress:return{...e,queue:e.queue.map(r=>r.id===t.id?{...r,progress:t.progress}:r)};case s.UpdateSettings:return{...e,settings:{...e.settings,...t.settings}}}return e}var Z=it;var L={};M(L,{getItems:()=>at,getSettings:()=>lt,isUploading:()=>st,isUploadingById:()=>ct,isUploadingByUrl:()=>ut});function at(e){return e.queue}function st(e){return e.queue.length>=1}function ut(e,t){return e.queue.some(r=>r.attachment?.url===t||r.sourceUrl===t)}function ct(e,t){return e.queue.some(r=>r.attachment?.id===t||r.sourceAttachmentId===t)}function lt(e){return e.settings}var K={};M(K,{getActiveImageProcessingCount:()=>vt,getActiveUploadCount:()=>ht,getAllItems:()=>pt,getBlobUrls:()=>yt,getFailedItems:()=>wt,getItem:()=>mt,getItemProgress:()=>Et,getPausedUploadForPost:()=>gt,getPendingImageProcessing:()=>bt,getPendingUploads:()=>Ut,hasPendingItemsByParentId:()=>Rt,isBatchUploaded:()=>dt,isPaused:()=>It,isUploadingToPost:()=>ft});function pt(e){return e.queue}function mt(e,t){return e.queue.find(r=>r.id===t)}function dt(e,t){return e.queue.filter(o=>t===o.batchId).length===0}function ft(e,t){return e.queue.some(r=>r.currentOperation===u.Upload&&r.additionalData.post===t)}function gt(e,t){return e.queue.find(r=>r.status===w.Paused&&r.additionalData.post===t)}function It(e){return e.queueStatus==="paused"}function yt(e,t){return e.blobUrls[t]||[]}function ht(e){return e.queue.filter(t=>t.currentOperation===u.Upload).length}function Ut(e){return e.queue.filter(t=>(Array.isArray(t.operations?.[0])?t.operations[0][0]:t.operations?.[0])===u.Upload&&t.currentOperation!==u.Upload)}function vt(e){return e.queue.filter(t=>t.currentOperation===u.ResizeCrop||t.currentOperation===u.Rotate).length}function bt(e){return e.queue.filter(t=>{let r=Array.isArray(t.operations?.[0])?t.operations[0][0]:t.operations?.[0];return(r===u.ResizeCrop||r===u.Rotate)&&t.currentOperation!==u.ResizeCrop&&t.currentOperation!==u.Rotate})}function wt(e){return e.queue.filter(t=>t.error!==void 0)}function Rt(e,t){return e.queue.some(r=>r.parentId===t)}function Et(e,t){return e.queue.find(o=>o.id===t)?.progress}var H={};M(H,{addItems:()=>Ft,cancelItem:()=>Ot,retryItem:()=>Tt});var W,St=new Uint8Array(16);function J(){if(!W&&(W=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!W))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return W(St)}var I=[];for(let e=0;e<256;++e)I.push((e+256).toString(16).slice(1));function Ie(e,t=0){return I[e[t+0]]+I[e[t+1]]+I[e[t+2]]+I[e[t+3]]+"-"+I[e[t+4]]+I[e[t+5]]+"-"+I[e[t+6]]+I[e[t+7]]+"-"+I[e[t+8]]+I[e[t+9]]+"-"+I[e[t+10]]+I[e[t+11]]+I[e[t+12]]+I[e[t+13]]+I[e[t+14]]+I[e[t+15]]}var _t=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),ee={randomUUID:_t};function Pt(e,t,r){if(ee.randomUUID&&!t&&!e)return ee.randomUUID();e=e||{};let o=e.random||(e.rng||J)();if(o[6]=o[6]&15|64,o[8]=o[8]&63|128,t){r=r||0;for(let n=0;n<16;++n)t[r+n]=o[n];return t}return Ie(o)}var _=Pt;var te=class extends File{width=0;height=0;originalWidth=0;originalHeight=0;get wasResized(){return(this.originalWidth||0)>this.width||(this.originalHeight||0)>this.height}constructor(e,t,r,o,n){super([e],e.name,{type:e.type,lastModified:e.lastModified}),this.width=t,this.height=r,this.originalWidth=o,this.originalHeight=n}};var At=y(he(),1),Ct=y(D(),1);function ve(e){if(e instanceof File)return e;if("name"in e&&typeof e.name=="string")return new File([e],e.name,{type:e.type,lastModified:e.lastModified});let t=e.type.split("/")[1],r=e.type==="application/pdf"?"document":e.type.split("/")[0];return new File([e],`${r}.${t}`,{type:e.type})}function G(e,t){return new File([e],t,{type:e.type,lastModified:e.lastModified})}function re(e){return G(e,e.name)}function Q(e){return e.includes(".")?e.split(".").slice(0,-1).join("."):e}var oe,z;function $(){return oe||(oe=import("@wordpress/vips/worker").then(e=>(z=e,e))),oe}async function be(e,t,r,o,n){let{vipsConvertImageFormat:i}=await $(),a=await i(e,await t.arrayBuffer(),t.type,r,o,n),c=r.split("/")[1],l=`${Q(t.name)}.${c}`;return new File([new Blob([a])],l,{type:r})}async function we(e){let{vipsHasTransparency:t}=await $(),r=await fetch(e);if(!r.ok)throw new Error(`Failed to fetch image: ${r.status}`);return t(await r.arrayBuffer())}async function Re(e,t,r,o,n,i,a,c){if(i?.aborted)throw new Error("Operation aborted");let{vipsResizeImage:l}=await $(),{buffer:d,width:p,height:f,originalWidth:m,originalHeight:h}=await l(e,await t.arrayBuffer(),t.type,r,o,c),U=t.name;if(m>p||h>f){let R=Q(t.name);a?U=t.name.replace(R,`${R}-scaled`):n&&(U=t.name.replace(R,`${R}-${p}x${f}`))}return new te(new File([new Blob([d],{type:t.type})],U,{type:t.type}),p,f,m,h)}async function ne(e,t,r,o){if(o?.aborted)throw new Error("Operation aborted");if(r===1)return t;let{vipsRotateImage:n}=await $(),{buffer:i,width:a,height:c}=await n(e,await t.arrayBuffer(),t.type,r),l=Q(t.name),d=t.name.replace(l,`${l}-rotated`);return new te(new File([new Blob([i],{type:t.type})],d,{type:t.type}),a,c)}async function Ee(e){return z?z.vipsCancelOperations(e):!1}function Se(){z&&z.terminateVipsWorker()}var V=y(D(),1);var v=class extends Error{code;file;constructor({code:e,message:t,file:r,cause:o}){super(t,{cause:o}),Object.setPrototypeOf(this,new.target.prototype),this.code=e,this.file=r}};function _e(e,t){if(!t)return;let r=t.some(o=>o.includes("/")?o===e.type:e.type.startsWith(`${o}/`));if(e.type&&!r)throw new v({code:"MIME_TYPE_NOT_SUPPORTED",message:(0,V.sprintf)((0,V.__)("%s: Sorry, this file type is not supported here."),e.name),file:e})}var j=y(D(),1);function Pe(e){return e?Object.entries(e).flatMap(([t,r])=>{let[o]=r.split("/"),n=t.split("|");return[r,...n.map(i=>`${o}/${i}`)]}):null}function Ae(e,t){let r=Pe(t);if(!r)return;let o=r.includes(e.type);if(e.type&&!o)throw new v({code:"MIME_TYPE_NOT_ALLOWED_FOR_USER",message:(0,j.sprintf)((0,j.__)("%s: Sorry, you are not allowed to upload this file type."),e.name),file:e})}var F=y(D(),1);function Ce(e,t){if(e.size<=0)throw new v({code:"EMPTY_FILE",message:(0,F.sprintf)((0,F.__)("%s: This file is empty."),e.name),file:e});if(t&&e.size>t)throw new v({code:"SIZE_ABOVE_LIMIT",message:(0,F.sprintf)((0,F.__)("%s: This file exceeds the maximum upload size for this site."),e.name),file:e})}function Ft({files:e,onChange:t,onSuccess:r,onError:o,onBatchSuccess:n,additionalData:i,allowedTypes:a}){return async({select:c,dispatch:l})=>{let d=_();for(let p of e){try{_e(p,a),Ae(p,c.getSettings().allowedMimeTypes)}catch(f){o?.(f);continue}try{Ce(p,c.getSettings().maxUploadFileSize)}catch(f){o?.(f);continue}l.addItem({file:p,batchId:d,onChange:t,onSuccess:r,onBatchSuccess:n,onError:o,additionalData:i})}}}function Ot(e,t,r=!1){return async({select:o,dispatch:n})=>{let i=o.getItem(e);if(i){if(i.abortController?.abort(),await Ee(e),!r){let{onError:a}=i;a?.(t??new Error("Upload cancelled")),!a&&t&&console.error("Upload cancelled",t)}n({type:s.Cancel,id:e,error:t}),n.removeItem(e),n.revokeBlobUrls(e),i.batchId&&o.isBatchUploaded(i.batchId)&&i.onBatchSuccess?.()}}}function Tt(e){return async({select:t,dispatch:r})=>{let o=t.getItem(e);o&&o.error&&(r({type:s.RetryItem,id:e}),r.processItem(e))}}var ae={};M(ae,{addItem:()=>Mt,addSideloadItem:()=>Dt,finalizeItem:()=>Jt,finishOperation:()=>Wt,generateThumbnails:()=>Kt,getTranscodeImageOperation:()=>ie,pauseItem:()=>qt,pauseQueue:()=>Bt,prepareItem:()=>Vt,processItem:()=>zt,removeItem:()=>Lt,resizeCropItem:()=>Yt,resumeItemByPostId:()=>kt,resumeQueue:()=>Nt,revokeBlobUrls:()=>er,rotateItem:()=>Xt,sideloadItem:()=>Ht,transcodeImageItem:()=>Zt,updateItemProgress:()=>tr,updateSettings:()=>rr,uploadItem:()=>jt});var b=y(Oe(),1);var Te=class extends File{constructor(e="stub-file"){super([],e)}};var xe=.82;function xt(e,t,r){return t!==u.Upload||!e.parentId||!e.additionalData.post?!1:r.isUploadingToPost(e.additionalData.post)}function Mt({file:e,batchId:t,onChange:r,onSuccess:o,onBatchSuccess:n,onError:i,additionalData:a={},sourceUrl:c,sourceAttachmentId:l,abortController:d,operations:p}){return async({dispatch:f})=>{let m=_(),h=ve(e),U;h instanceof Te||(U=(0,b.createBlobURL)(h),f({type:s.CacheBlobUrl,id:m,blobUrl:U})),f({type:s.Add,item:{id:m,batchId:t,status:w.Processing,sourceFile:re(h),file:h,attachment:{url:U},additionalData:{convert_format:!1,generate_sub_sizes:!1,...a},onChange:r,onSuccess:o,onBatchSuccess:n,onError:i,sourceUrl:c,sourceAttachmentId:l,abortController:d||new AbortController,operations:Array.isArray(p)?p:[u.Prepare]}}),f.processItem(m)}}function Dt({file:e,onChange:t,additionalData:r,operations:o,batchId:n,parentId:i}){return({dispatch:a})=>{let c=_();a({type:s.Add,item:{id:c,batchId:n,status:w.Processing,sourceFile:re(e),file:e,onChange:t,additionalData:{...r},parentId:i,operations:Array.isArray(o)?o:[u.Prepare],abortController:new AbortController}}),a.processItem(c)}}function zt(e){return async({select:t,dispatch:r})=>{if(t.isPaused())return;let o=t.getItem(e);if(!o)return;let{attachment:n,onChange:i,onSuccess:a,onBatchSuccess:c,batchId:l,parentId:d}=o,p=Array.isArray(o.operations?.[0])?o.operations[0][0]:o.operations?.[0],f=Array.isArray(o.operations?.[0])?o.operations[0][1]:void 0;if(xt(o,p,t)){r({type:s.PauseItem,id:e});return}if(p===u.Upload){let m=t.getSettings();if(t.getActiveUploadCount()>=m.maxConcurrentUploads)return}if(p===u.ResizeCrop||p===u.Rotate){let m=t.getSettings();if(t.getActiveImageProcessingCount()>=m.maxConcurrentImageProcessing)return}if(n&&i?.([n]),!p){if((d||!d&&!t.hasPendingItemsByParentId(e))&&(n&&a?.([n]),r.removeItem(e),r.revokeBlobUrls(e),l&&t.isBatchUploaded(l)&&c?.()),d&&l&&t.isBatchUploaded(l)){let m=t.getItem(d);if(!m)return;if(m.operations&&m.operations.length>0){r.processItem(d);return}n&&m.onSuccess?.([n]),r.removeItem(d),r.revokeBlobUrls(d),m.batchId&&t.isBatchUploaded(m.batchId)&&m.onBatchSuccess?.()}return}if(!(p===u.Finalize&&t.hasPendingItemsByParentId(e)))switch(r({type:s.OperationStart,id:e,operation:p}),p){case u.Prepare:r.prepareItem(o.id);break;case u.ResizeCrop:r.resizeCropItem(o.id,f);break;case u.Rotate:r.rotateItem(o.id,f);break;case u.TranscodeImage:r.transcodeImageItem(o.id,f);break;case u.Upload:o.parentId?r.sideloadItem(e):r.uploadItem(e);break;case u.ThumbnailGeneration:r.generateThumbnails(e);break;case u.Finalize:r.finalizeItem(e);break}}}function Bt(){return{type:s.PauseQueue}}function Nt(){return async({select:e,dispatch:t})=>{t({type:s.ResumeQueue});for(let r of e.getAllItems())t.processItem(r.id)}}function qt(e){return async({dispatch:t})=>{t({type:s.PauseItem,id:e})}}function kt(e){return async({select:t,dispatch:r})=>{let o=t.getPausedUploadForPost(e);o&&(r({type:s.ResumeItem,id:o.id}),r.processItem(o.id))}}function Lt(e){return async({select:t,dispatch:r})=>{t.getItem(e)&&(r({type:s.Remove,id:e}),t.getAllItems().length===0&&Se())}}function Wt(e,t){return async({select:r,dispatch:o})=>{let i=r.getItem(e)?.currentOperation;if(o({type:s.OperationFinish,id:e,item:t}),o.processItem(e),i===u.Upload){let a=r.getPendingUploads();for(let c of a)o.processItem(c.id)}if(i===u.ResizeCrop||i===u.Rotate){let a=r.getPendingImageProcessing();for(let c of a)o.processItem(c.id)}}}var Gt=["jpeg","webp","avif","png","gif"];function Qt(e){return Gt.includes(e)}function $t(e,t){switch(e){case"image/jpeg":return t.jpegInterlaced??!1;case"image/png":return t.pngInterlaced??!1;case"image/gif":return t.gifInterlaced??!1;default:return!1}}async function ie(e,t,r){if(e.type==="image/png"&&t==="image/jpeg"){let n=(0,b.createBlobURL)(e);try{if(await we(n))return null}catch{return null}finally{(0,b.revokeBlobURL)(n)}}let o=t.split("/")[1];return Qt(o)?[u.TranscodeImage,{outputFormat:o,outputQuality:xe,interlaced:$t(t,r)}]:null}function Vt(e){return async({select:t,dispatch:r})=>{let o=t.getItem(e);if(!o)return;let{file:n}=o,i=[],a=t.getSettings(),c=n.type.startsWith("image/"),l=ge.includes(n.type);if(c&&l){let{imageOutputFormats:p}=a,f=p?.[n.type];if(f&&f!==n.type){let m=await ie(n,f,a);m&&i.push(m)}i.push(u.Upload,u.ThumbnailGeneration,u.Finalize)}else i.push(u.Upload);r({type:s.AddOperations,id:e,operations:i});let d=!l||!c?{additionalData:{...o.additionalData,generate_sub_sizes:!0,convert_format:!0}}:{};r.finishOperation(e,d)}}function jt(e){return async({select:t,dispatch:r})=>{let o=t.getItem(e);o&&t.getSettings().mediaUpload({filesList:[o.file],additionalData:o.additionalData,signal:o.abortController?.signal,onFileChange:([n])=>{n&&!(0,b.isBlobURL)(n.url)&&r.finishOperation(e,{attachment:n})},onSuccess:([n])=>{r.finishOperation(e,{attachment:n})},onError:n=>{r.cancelItem(e,n)}})}}function Ht(e){return async({select:t,dispatch:r})=>{let o=t.getItem(e);if(!o)return;let{post:n,...i}=o.additionalData,a=t.getSettings().mediaSideload;if(!a){r.finishOperation(e,{});return}a({file:o.file,attachmentId:n,additionalData:i,signal:o.abortController?.signal,onFileChange:([c])=>{r.finishOperation(e,{attachment:c}),r.resumeItemByPostId(n)},onError:c=>{r.cancelItem(e,c),r.resumeItemByPostId(n)}})}}function Yt(e,t){return async({select:r,dispatch:o})=>{let n=r.getItem(e);if(!n)return;if(!t?.resize){o.finishOperation(e,{file:n.file});return}let i=!!n.parentId,a=!!t.isThresholdResize;try{let c=await Re(n.id,n.file,t.resize,!1,i,n.abortController?.signal,a),l=(0,b.createBlobURL)(c);o({type:s.CacheBlobUrl,id:e,blobUrl:l}),o.finishOperation(e,{file:c,attachment:{url:l}})}catch(c){o.cancelItem(e,new v({code:"IMAGE_TRANSCODING_ERROR",message:"File could not be uploaded",file:n.file,cause:c instanceof Error?c:void 0}))}}}function Xt(e,t){return async({select:r,dispatch:o})=>{let n=r.getItem(e);if(n){if(!t?.orientation||t.orientation===1){o.finishOperation(e,{file:n.file});return}try{let i=await ne(n.id,n.file,t.orientation,n.abortController?.signal),a=(0,b.createBlobURL)(i);o({type:s.CacheBlobUrl,id:e,blobUrl:a}),o.finishOperation(e,{file:i,attachment:{url:a}})}catch(i){o.cancelItem(e,new v({code:"IMAGE_ROTATION_ERROR",message:"Image could not be rotated",file:n.file,cause:i instanceof Error?i:void 0}))}}}}function Zt(e,t){return async({select:r,dispatch:o})=>{let n=r.getItem(e);if(!n)return;if(!t?.outputFormat){o.finishOperation(e,{file:n.file});return}let i=`image/${t.outputFormat}`,a=t.outputQuality??xe,c=t.interlaced??!1;try{let l=await be(n.id,n.file,i,a,c),d=(0,b.createBlobURL)(l);o({type:s.CacheBlobUrl,id:e,blobUrl:d}),o.finishOperation(e,{file:l,attachment:{url:d}})}catch(l){o.cancelItem(e,new v({code:"MEDIA_TRANSCODING_ERROR",message:"Image could not be transcoded to the target format",file:n.file,cause:l instanceof Error?l:void 0}))}}}function Kt(e){return async({select:t,dispatch:r})=>{let o=t.getItem(e);if(!o)return;if(!o.attachment){r.finishOperation(e,{});return}let n=o.attachment;if(n.exif_orientation&&n.exif_orientation!==1&&!o.file.name.includes("-scaled")&&n.id)try{let a=await ne(o.id,o.sourceFile,n.exif_orientation,o.abortController?.signal);r.addSideloadItem({file:a,batchId:_(),parentId:o.id,additionalData:{post:n.id,image_size:"original",convert_format:!1},operations:[u.Upload]})}catch{console.warn("Failed to rotate image, continuing with thumbnails")}if(!o.parentId&&n.missing_image_sizes&&n.missing_image_sizes.length>0){let a=t.getSettings(),c=a.allImageSizes||{},l=n.missing_image_sizes,d=n.filename?G(o.sourceFile,n.filename):o.sourceFile,p=_(),{imageOutputFormats:f}=a,m=o.sourceFile.type,h=f?.[m],U=null;h&&h!==m&&(U=await ie(o.sourceFile,h,a));for(let E of l){let R=c[E];if(!R){console.warn(`Image size "${E}" not found in configuration`);continue}let x=[[u.ResizeCrop,{resize:R}]];U&&x.push(U),x.push(u.Upload),r.addSideloadItem({file:d,onChange:([C])=>{(0,b.isBlobURL)(C.url)||o.onChange?.([C])},batchId:p,parentId:o.id,additionalData:{post:n.id,image_size:E,convert_format:!1},operations:x})}let{bigImageSizeThreshold:A}=a;if(A&&n.id){let E=await createImageBitmap(o.sourceFile),R=E.width>A||E.height>A;if(E.close(),R){let x=n.filename?G(o.sourceFile,n.filename):o.sourceFile,C=[[u.ResizeCrop,{resize:{width:A,height:A},isThresholdResize:!0}]];U&&C.push(U),C.push(u.Upload),r.addSideloadItem({file:x,onChange:([le])=>{(0,b.isBlobURL)(le.url)||o.onChange?.([le])},batchId:p,parentId:o.id,additionalData:{post:n.id,image_size:"scaled",convert_format:!1},operations:C})}}}r.finishOperation(e,{})}}function Jt(e){return async({select:t,dispatch:r})=>{let o=t.getItem(e);if(!o)return;let n=o.attachment,{mediaFinalize:i}=t.getSettings();if(n?.id&&i)try{await i(n.id)}catch(a){console.warn("Media finalization failed:",a)}r.finishOperation(e,{})}}function er(e){return async({select:t,dispatch:r})=>{let o=t.getBlobUrls(e);for(let n of o)(0,b.revokeBlobURL)(n);r({type:s.RevokeBlobUrls,id:e})}}function tr(e,t){return async({dispatch:r})=>{r({type:s.UpdateProgress,id:e,progress:t})}}function rr(e){return{type:s.UpdateSettings,settings:e}}var ze=y(De(),1),{lock:io,unlock:B}=(0,ze.__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/upload-media");var Be={reducer:Z,selectors:L,actions:H},P=(0,O.createReduxStore)(k,{reducer:Z,selectors:L,actions:H});(0,O.select)(P)||(0,O.register)(P);B(P).registerPrivateActions(ae);B(P).registerPrivateSelectors(K);var $e=y(se(),1),Ve=y(q(),1);var We=y(se(),1),T=y(q(),1),Ge=y(ke(),1);var Y=y(ue(),1);function or(e,t,r){if(!r)return t;let o=e.get(t);return o||(o=(0,T.createRegistry)({},t),o.registerStore(k,Be),e.set(t,o)),o}var nr=(0,Ge.createHigherOrderComponent)(e=>({useSubRegistry:t=!0,...r})=>{let o=(0,T.useRegistry)(),[n]=(0,We.useState)(()=>new WeakMap),i=or(n,o,t);return i===o?(0,Y.jsx)(e,{registry:o,...r}):(0,Y.jsx)(T.RegistryProvider,{value:i,children:(0,Y.jsx)(e,{registry:i,...r})})},"withRegistryProvider"),Qe=nr;var X=y(ue(),1),ir=Qe(e=>{let{children:t,settings:r}=e,{updateSettings:o}=B((0,Ve.useDispatch)(P));return(0,$e.useEffect)(()=>{o(r)},[r,o]),(0,X.jsx)(X.Fragment,{children:t})}),je=ir;var g=null;function ce(){if(g!==null)return g;if(typeof WebAssembly>"u")return g={supported:!1,reason:"WebAssembly is not supported in this browser."},g;if(typeof SharedArrayBuffer>"u")return g={supported:!1,reason:"SharedArrayBuffer is not available. This may be due to missing cross-origin isolation headers."},g;if(typeof Worker>"u")return g={supported:!1,reason:"Web Workers are not supported in this browser."},g;if(typeof navigator<"u"&&"deviceMemory"in navigator&&navigator.deviceMemory<=2)return g={supported:!1,reason:"Device has insufficient memory for client-side media processing."},g;if(typeof navigator<"u"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency<2)return g={supported:!1,reason:"Device has insufficient CPU cores for client-side media processing."},g;if(typeof navigator<"u"){let e=navigator.connection;if(e){if(e.saveData)return g={supported:!1,reason:"Data saver mode is enabled."},g;if(e.effectiveType==="slow-2g"||e.effectiveType==="2g")return g={supported:!1,reason:"Network connection is too slow for client-side media processing."},g}}if(typeof window<"u")try{let e=new Blob([""],{type:"application/javascript"}),t=URL.createObjectURL(e);try{new Worker(t).terminate()}finally{URL.revokeObjectURL(t)}}catch{return g={supported:!1,reason:"The site's Content Security Policy (CSP) does not allow blob: workers. The worker-src directive must include blob: to enable client-side media processing."},g}return g={supported:!0},g}function He(){return ce().supported}function Ye(){g=null}return rt(ar);})(); api-fetch.js 0000644 00000042723 15206720414 0006753 0 ustar 00 "use strict"; var wp; (wp ||= {}).apiFetch = (() => { 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 __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; 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 )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // package-external:@wordpress/i18n var require_i18n = __commonJS({ "package-external:@wordpress/i18n"(exports, module) { module.exports = window.wp.i18n; } }); // package-external:@wordpress/url var require_url = __commonJS({ "package-external:@wordpress/url"(exports, module) { module.exports = window.wp.url; } }); // packages/api-fetch/build-module/index.mjs var index_exports = {}; __export(index_exports, { default: () => index_default }); var import_i18n3 = __toESM(require_i18n(), 1); // packages/api-fetch/build-module/middlewares/nonce.mjs function createNonceMiddleware(nonce) { const middleware = (options, next) => { const { headers = {} } = options; for (const headerName in headers) { if (headerName.toLowerCase() === "x-wp-nonce" && headers[headerName] === middleware.nonce) { return next(options); } } return next({ ...options, headers: { ...headers, "X-WP-Nonce": middleware.nonce } }); }; middleware.nonce = nonce; return middleware; } var nonce_default = createNonceMiddleware; // packages/api-fetch/build-module/middlewares/namespace-endpoint.mjs var namespaceAndEndpointMiddleware = (options, next) => { let path = options.path; let namespaceTrimmed, endpointTrimmed; if (typeof options.namespace === "string" && typeof options.endpoint === "string") { namespaceTrimmed = options.namespace.replace(/^\/|\/$/g, ""); endpointTrimmed = options.endpoint.replace(/^\//, ""); if (endpointTrimmed) { path = namespaceTrimmed + "/" + endpointTrimmed; } else { path = namespaceTrimmed; } } delete options.namespace; delete options.endpoint; return next({ ...options, path }); }; var namespace_endpoint_default = namespaceAndEndpointMiddleware; // packages/api-fetch/build-module/middlewares/root-url.mjs var createRootURLMiddleware = (rootURL) => (options, next) => { return namespace_endpoint_default(options, (optionsWithPath) => { let url = optionsWithPath.url; let path = optionsWithPath.path; let apiRoot; if (typeof path === "string") { apiRoot = rootURL; if (-1 !== rootURL.indexOf("?")) { path = path.replace("?", "&"); } path = path.replace(/^\//, ""); if ("string" === typeof apiRoot && -1 !== apiRoot.indexOf("?")) { path = path.replace("?", "&"); } url = apiRoot + path; } return next({ ...optionsWithPath, url }); }); }; var root_url_default = createRootURLMiddleware; // packages/api-fetch/build-module/middlewares/preloading.mjs var import_url = __toESM(require_url(), 1); function createPreloadingMiddleware(preloadedData) { const cache = Object.fromEntries( Object.entries(preloadedData).map(([path, data]) => [ (0, import_url.normalizePath)(path), data ]) ); return (options, next) => { const { parse = true } = options; let rawPath = options.path; if (!rawPath && options.url) { const { rest_route: pathFromQuery, ...queryArgs } = (0, import_url.getQueryArgs)( options.url ); if (typeof pathFromQuery === "string") { rawPath = (0, import_url.addQueryArgs)(pathFromQuery, queryArgs); } } if (typeof rawPath !== "string") { return next(options); } const method = options.method || "GET"; const path = (0, import_url.normalizePath)(rawPath); if ("GET" === method && cache[path]) { const cacheData = cache[path]; delete cache[path]; return prepareResponse(cacheData, !!parse); } else if ("OPTIONS" === method && cache[method] && cache[method][path]) { const cacheData = cache[method][path]; delete cache[method][path]; return prepareResponse(cacheData, !!parse); } return next(options); }; } function prepareResponse(responseData, parse) { if (parse) { return Promise.resolve(responseData.body); } try { return Promise.resolve( new window.Response(JSON.stringify(responseData.body), { status: 200, statusText: "OK", headers: responseData.headers }) ); } catch { Object.entries( responseData.headers ).forEach(([key, value]) => { if (key.toLowerCase() === "link") { responseData.headers[key] = value.replace( /<([^>]+)>/, (_, url) => `<${encodeURI(url)}>` ); } }); return Promise.resolve( parse ? responseData.body : new window.Response(JSON.stringify(responseData.body), { status: 200, statusText: "OK", headers: responseData.headers }) ); } } var preloading_default = createPreloadingMiddleware; // packages/api-fetch/build-module/middlewares/fetch-all-middleware.mjs var import_url2 = __toESM(require_url(), 1); var modifyQuery = ({ path, url, ...options }, queryArgs) => ({ ...options, url: url && (0, import_url2.addQueryArgs)(url, queryArgs), path: path && (0, import_url2.addQueryArgs)(path, queryArgs) }); var parseResponse = (response) => response.json ? response.json() : Promise.reject(response); var parseLinkHeader = (linkHeader) => { if (!linkHeader) { return {}; } const match = linkHeader.match(/<([^>]+)>; rel="next"/); return match ? { next: match[1] } : {}; }; var getNextPageUrl = (response) => { const { next } = parseLinkHeader(response.headers.get("link")); return next; }; var requestContainsUnboundedQuery = (options) => { const pathIsUnbounded = !!options.path && options.path.indexOf("per_page=-1") !== -1; const urlIsUnbounded = !!options.url && options.url.indexOf("per_page=-1") !== -1; return pathIsUnbounded || urlIsUnbounded; }; var fetchAllMiddleware = async (options, next) => { if (options.parse === false) { return next(options); } if (!requestContainsUnboundedQuery(options)) { return next(options); } const response = await index_default({ ...modifyQuery(options, { per_page: 100 }), // Ensure headers are returned for page 1. parse: false }); const results = await parseResponse(response); if (!Array.isArray(results)) { return results; } let nextPage = getNextPageUrl(response); if (!nextPage) { return results; } let mergedResults = [].concat(results); while (nextPage) { const nextResponse = await index_default({ ...options, // Ensure the URL for the next page is used instead of any provided path. path: void 0, url: nextPage, // Ensure we still get headers so we can identify the next page. parse: false }); const nextResults = await parseResponse(nextResponse); mergedResults = mergedResults.concat(nextResults); nextPage = getNextPageUrl(nextResponse); } return mergedResults; }; var fetch_all_middleware_default = fetchAllMiddleware; // packages/api-fetch/build-module/middlewares/http-v1.mjs var OVERRIDE_METHODS = /* @__PURE__ */ new Set(["PATCH", "PUT", "DELETE"]); var DEFAULT_METHOD = "GET"; var httpV1Middleware = (options, next) => { const { method = DEFAULT_METHOD } = options; if (OVERRIDE_METHODS.has(method.toUpperCase())) { options = { ...options, headers: { ...options.headers, "X-HTTP-Method-Override": method, "Content-Type": "application/json" }, method: "POST" }; } return next(options); }; var http_v1_default = httpV1Middleware; // packages/api-fetch/build-module/middlewares/user-locale.mjs var import_url3 = __toESM(require_url(), 1); var userLocaleMiddleware = (options, next) => { if (typeof options.url === "string" && !(0, import_url3.hasQueryArg)(options.url, "_locale")) { options.url = (0, import_url3.addQueryArgs)(options.url, { _locale: "user" }); } if (typeof options.path === "string" && !(0, import_url3.hasQueryArg)(options.path, "_locale")) { options.path = (0, import_url3.addQueryArgs)(options.path, { _locale: "user" }); } return next(options); }; var user_locale_default = userLocaleMiddleware; // packages/api-fetch/build-module/middlewares/media-upload.mjs var import_i18n2 = __toESM(require_i18n(), 1); // packages/api-fetch/build-module/utils/response.mjs var import_i18n = __toESM(require_i18n(), 1); async function parseJsonAndNormalizeError(response) { try { return await response.json(); } catch { throw { code: "invalid_json", message: (0, import_i18n.__)("The response is not a valid JSON response.") }; } } async function parseResponseAndNormalizeError(response, shouldParseResponse = true) { if (!shouldParseResponse) { return response; } if (response.status === 204) { return null; } return await parseJsonAndNormalizeError(response); } async function parseAndThrowError(response, shouldParseResponse = true) { if (!shouldParseResponse) { throw response; } throw await parseJsonAndNormalizeError(response); } // packages/api-fetch/build-module/middlewares/media-upload.mjs function isMediaUploadRequest(options) { const isCreateMethod = !!options.method && options.method === "POST"; const isMediaEndpoint = !!options.path && options.path.indexOf("/wp/v2/media") !== -1 || !!options.url && options.url.indexOf("/wp/v2/media") !== -1; return isMediaEndpoint && isCreateMethod; } var mediaUploadMiddleware = (options, next) => { if (!isMediaUploadRequest(options)) { return next(options); } let retries = 0; const maxRetries = 5; const postProcess = (attachmentId) => { retries++; return next({ path: `/wp/v2/media/${attachmentId}/post-process`, method: "POST", data: { action: "create-image-subsizes" }, parse: false }).catch(() => { if (retries < maxRetries) { return postProcess(attachmentId); } next({ path: `/wp/v2/media/${attachmentId}?force=true`, method: "DELETE" }); return Promise.reject(); }); }; return next({ ...options, parse: false }).catch((response) => { if (!(response instanceof globalThis.Response)) { return Promise.reject(response); } const attachmentId = response.headers.get( "x-wp-upload-attachment-id" ); if (response.status >= 500 && response.status < 600 && attachmentId) { return postProcess(attachmentId).catch(() => { if (options.parse !== false) { return Promise.reject({ code: "post_process", message: (0, import_i18n2.__)( "Media upload failed. If this is a photo or a large image, please scale it down and try again." ) }); } return Promise.reject(response); }); } return parseAndThrowError(response, options.parse); }).then( (response) => parseResponseAndNormalizeError(response, options.parse) ); }; var media_upload_default = mediaUploadMiddleware; // packages/api-fetch/build-module/middlewares/theme-preview.mjs var import_url4 = __toESM(require_url(), 1); var createThemePreviewMiddleware = (themePath) => (options, next) => { if (typeof options.url === "string") { const wpThemePreview = (0, import_url4.getQueryArg)( options.url, "wp_theme_preview" ); if (wpThemePreview === void 0) { options.url = (0, import_url4.addQueryArgs)(options.url, { wp_theme_preview: themePath }); } else if (wpThemePreview === "") { options.url = (0, import_url4.removeQueryArgs)( options.url, "wp_theme_preview" ); } } if (typeof options.path === "string") { const wpThemePreview = (0, import_url4.getQueryArg)( options.path, "wp_theme_preview" ); if (wpThemePreview === void 0) { options.path = (0, import_url4.addQueryArgs)(options.path, { wp_theme_preview: themePath }); } else if (wpThemePreview === "") { options.path = (0, import_url4.removeQueryArgs)( options.path, "wp_theme_preview" ); } } return next(options); }; var theme_preview_default = createThemePreviewMiddleware; // packages/api-fetch/build-module/index.mjs var DEFAULT_HEADERS = { // The backend uses the Accept header as a condition for considering an // incoming request as a REST request. // // See: https://core.trac.wordpress.org/ticket/44534 Accept: "application/json, */*;q=0.1" }; var DEFAULT_OPTIONS = { credentials: "include" }; var middlewares = [ user_locale_default, namespace_endpoint_default, http_v1_default, fetch_all_middleware_default ]; function registerMiddleware(middleware) { middlewares.unshift(middleware); } var defaultFetchHandler = (nextOptions) => { const { url, path, data, parse = true, ...remainingOptions } = nextOptions; let { body, headers } = nextOptions; headers = { ...DEFAULT_HEADERS, ...headers }; if (data) { body = JSON.stringify(data); headers["Content-Type"] = "application/json"; } const responsePromise = globalThis.fetch( // Fall back to explicitly passing `window.location` which is the behavior if `undefined` is passed. url || path || window.location.href, { ...DEFAULT_OPTIONS, ...remainingOptions, body, headers } ); return responsePromise.then( (response) => { if (!response.ok) { return parseAndThrowError(response, parse); } return parseResponseAndNormalizeError(response, parse); }, (err) => { if (err && err.name === "AbortError") { throw err; } if (!globalThis.navigator.onLine) { throw { code: "offline_error", message: (0, import_i18n3.__)( "Unable to connect. Please check your Internet connection." ) }; } throw { code: "fetch_error", message: (0, import_i18n3.__)( "Could not get a valid response from the server." ) }; } ); }; var fetchHandler = defaultFetchHandler; function setFetchHandler(newFetchHandler) { fetchHandler = newFetchHandler; } var apiFetch = (options) => { const enhancedHandler = middlewares.reduceRight( (next, middleware) => { return (workingOptions) => middleware(workingOptions, next); }, fetchHandler ); return enhancedHandler(options).catch((error) => { if (error.code !== "rest_cookie_invalid_nonce") { return Promise.reject(error); } return globalThis.fetch(apiFetch.nonceEndpoint).then((response) => { if (!response.ok) { return Promise.reject(error); } return response.text(); }).then((text) => { apiFetch.nonceMiddleware.nonce = text; return apiFetch(options); }); }); }; apiFetch.use = registerMiddleware; apiFetch.setFetchHandler = setFetchHandler; apiFetch.createNonceMiddleware = nonce_default; apiFetch.createPreloadingMiddleware = preloading_default; apiFetch.createRootURLMiddleware = root_url_default; apiFetch.fetchAllMiddleware = fetch_all_middleware_default; apiFetch.mediaUploadMiddleware = media_upload_default; apiFetch.createThemePreviewMiddleware = theme_preview_default; var index_default = apiFetch; return __toCommonJS(index_exports); })(); if (typeof wp.apiFetch === 'object' && wp.apiFetch.default) { wp.apiFetch = wp.apiFetch.default; } edit-widgets.min.js 0000644 00000173515 15206720414 0010272 0 ustar 00 var wp;(wp||={}).editWidgets=(()=>{var hd=Object.create;var St=Object.defineProperty;var wd=Object.getOwnPropertyDescriptor;var bd=Object.getOwnPropertyNames;var vd=Object.getPrototypeOf,_d=Object.prototype.hasOwnProperty;var _=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),we=(e,t)=>{for(var o in t)St(e,o,{get:t[o],enumerable:!0})},Oo=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of bd(t))!_d.call(e,i)&&i!==o&&St(e,i,{get:()=>t[i],enumerable:!(a=wd(t,i))||a.enumerable});return e};var r=(e,t,o)=>(o=e!=null?hd(vd(e)):{},Oo(t||!e||!e.__esModule?St(o,"default",{value:e,enumerable:!0}):o,e)),yd=e=>Oo(St({},"__esModule",{value:!0}),e);var kt=_((Sn,Vo)=>{Vo.exports=window.wp.blocks});var w=_((kn,Fo)=>{Fo.exports=window.wp.data});var $e=_((An,jo)=>{jo.exports=window.wp.deprecated});var y=_((xn,Go)=>{Go.exports=window.wp.element});var Nr=_((In,zo)=>{zo.exports=window.wp.blockLibrary});var G=_((En,Ho)=>{Ho.exports=window.wp.coreData});var Fe=_((Cn,Uo)=>{Uo.exports=window.wp.widgets});var J=_((Tn,Ko)=>{Ko.exports=window.wp.preferences});var $o=_((Wn,Yo)=>{Yo.exports=window.wp.apiFetch});var A=_((Bn,Qo)=>{Qo.exports=window.wp.i18n});var At=_((Nn,Xo)=>{Xo.exports=window.wp.notices});var k=_((Pn,ea)=>{ea.exports=window.wp.components});var F=_((Dn,ta)=>{ta.exports=window.wp.primitives});var f=_((Mn,ra)=>{ra.exports=window.ReactJSXRuntime});var aa=_((fm,oa)=>{oa.exports=window.wp.viewport});var z=_((cm,ia)=>{ia.exports=window.wp.compose});var Ot=_((um,sa)=>{sa.exports=window.wp.plugins});var Ta=_((Um,Ca)=>{Ca.exports=window.wp.privateApis});var L=_((af,Ba)=>{Ba.exports=window.wp.blockEditor});var Jt=_((Af,ja)=>{ja.exports=window.wp.hooks});var po=_((If,Ka)=>{Ka.exports=window.wp.mediaUtils});var li=_((Gf,di)=>{di.exports=window.wp.patterns});var nt=_((zf,ni)=>{ni.exports=window.wp.keyboardShortcuts});var De=_((Hf,mi)=>{mi.exports=window.wp.keycodes});var Ci=_((ac,Ei)=>{Ei.exports=window.wp.url});var Wi=_((ic,Ti)=>{Ti.exports=window.wp.dom});var _n={};we(_n,{initialize:()=>wn,initializeEditor:()=>dd,reinitializeEditor:()=>bn,store:()=>c});var Te=r(kt(),1),Ro=r(w(),1),ad=r($e(),1),Wr=r(y(),1),Lr=r(Nr(),1),id=r(G(),1),Ye=r(Fe(),1),sd=r(J(),1);var Fa=r($o(),1),Xt=r(w(),1);var qo=r(w(),1);function Sd(e={},t){let{type:o}=t;switch(o){case"SET_WIDGET_AREAS_OPEN_STATE":return t.widgetAreasOpenState;case"SET_IS_WIDGET_AREA_OPEN":{let{clientId:a,isOpen:i}=t;return{...e,[a]:i}}default:return e}}function kd(e=!1,t){switch(t.type){case"SET_IS_LIST_VIEW_OPENED":return t.isOpen?!1:e;case"SET_IS_INSERTER_OPENED":return t.value}return e}function Ad(e=!1,t){switch(t.type){case"SET_IS_INSERTER_OPENED":return t.value?!1:e;case"SET_IS_LIST_VIEW_OPENED":return t.isOpen}return e}function xd(e={current:null}){return e}function Id(e={current:null}){return e}function Ed(e={},t){switch(t.type){case"LOCK_WIDGET_SAVING":return{...e,[t.lockName]:!0};case"UNLOCK_WIDGET_SAVING":{let{[t.lockName]:o,...a}=e;return a}}return e}var Zo=(0,qo.combineReducers)({blockInserterPanel:kd,inserterSidebarToggleRef:Id,listViewPanel:Ad,listViewToggleRef:xd,widgetAreasOpenState:Sd,widgetSavingLock:Ed});var fo={};we(fo,{getWidgetAreas:()=>wl,getWidgets:()=>bl});var Ma=r(kt(),1),mo=r(G(),1);var no={};we(no,{closeGeneralSidebar:()=>ul,lockWidgetSaving:()=>hl,moveBlockToWidgetArea:()=>pl,persistStubPost:()=>dt,saveEditedWidgetAreas:()=>il,saveWidgetArea:()=>dl,saveWidgetAreas:()=>sl,setIsInserterOpened:()=>fl,setIsListViewOpened:()=>cl,setIsWidgetAreaOpen:()=>ml,setWidgetAreasOpenState:()=>lo,setWidgetIdForClientId:()=>nl,unlockWidgetSaving:()=>gl});var Re=r(A(),1),so=r(At(),1);function Jo(e){var t,o,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(o=Jo(e[t]))&&(a&&(a+=" "),a+=o)}else for(o in e)e[o]&&(a&&(a+=" "),a+=o);return a}function Cd(){for(var e,t,o=0,a="",i=arguments.length;o<i;o++)(e=arguments[o])&&(t=Jo(e))&&(a&&(a+=" "),a+=t);return a}var V=Cd;var K=r(k(),1),ot=r(w(),1),$t=r(A(),1);var xt=r(F(),1),Rr=r(f(),1),Pr=(0,Rr.jsx)(xt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Rr.jsx)(xt.Path,{d:"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"})});var It=r(F(),1),Dr=r(f(),1),qe=(0,Dr.jsx)(It.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Dr.jsx)(It.Path,{d:"M16.5 7.5 10 13.9l-2.5-2.4-1 1 3.5 3.6 7.5-7.6z"})});var Et=r(F(),1),Mr=r(f(),1),Ze=(0,Mr.jsx)(Et.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Mr.jsx)(Et.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"})});var Ct=r(F(),1),Or=r(f(),1),Vr=(0,Or.jsx)(Ct.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Or.jsx)(Ct.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zM8.5 18.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h2.5v13zm10-.5c0 .3-.2.5-.5.5h-8v-13h8c.3 0 .5.2.5.5v12z"})});var Tt=r(F(),1),Fr=r(f(),1),jr=(0,Fr.jsx)(Tt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Fr.jsx)(Tt.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4 14.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h8v13zm4.5-.5c0 .3-.2.5-.5.5h-2.5v-13H18c.3 0 .5.2.5.5v12z"})});var Wt=r(F(),1),Gr=r(f(),1),zr=(0,Gr.jsx)(Wt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Gr.jsx)(Wt.Path,{d:"M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z"})});var Lt=r(F(),1),Hr=r(f(),1),Ur=(0,Hr.jsx)(Lt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Hr.jsx)(Lt.Path,{d:"M3 6h11v1.5H3V6Zm3.5 5.5h11V13h-11v-1.5ZM21 17H10v1.5h11V17Z"})});var Bt=r(F(),1),Kr=r(f(),1),Yr=(0,Kr.jsx)(Bt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Kr.jsx)(Bt.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})});var Nt=r(F(),1),$r=r(f(),1),qr=(0,$r.jsx)(Nt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$r.jsx)(Nt.Path,{d:"M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"})});var Rt=r(F(),1),Zr=r(f(),1),Qe=(0,Zr.jsx)(Rt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Zr.jsx)(Rt.Path,{d:"M15.6 6.5l-1.1 1 2.9 3.3H8c-.9 0-1.7.3-2.3.9-1.4 1.5-1.4 4.2-1.4 5.6v.2h1.5v-.3c0-1.1 0-3.5 1-4.5.3-.3.7-.5 1.3-.5h9.2L14.5 15l1.1 1.1 4.6-4.6-4.6-5z"})});var Pt=r(F(),1),Qr=r(f(),1),Xr=(0,Qr.jsx)(Pt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Qr.jsx)(Pt.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z"})});var Dt=r(F(),1),Jr=r(f(),1),eo=(0,Jr.jsx)(Dt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Jr.jsx)(Dt.Path,{d:"M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z"})});var Mt=r(F(),1),to=r(f(),1),Xe=(0,to.jsx)(Mt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,to.jsx)(Mt.Path,{d:"M18.3 11.7c-.6-.6-1.4-.9-2.3-.9H6.7l2.9-3.3-1.1-1-4.5 5L8.5 16l1-1-2.7-2.7H16c.5 0 .9.2 1.3.5 1 1 1 3.4 1 4.5v.3h1.5v-.2c0-1.5 0-4.3-1.5-5.7z"})});var se=r(y(),1),ao=r(aa(),1),ya=r(J(),1),ve=r(z(),1),Sa=r(Ot(),1);var fa=r(k(),1),Gt=r(w(),1),ca=r(Ot(),1);var jt=r(w(),1);var ro={};we(ro,{closeModal:()=>Od,disableComplementaryArea:()=>Ld,enableComplementaryArea:()=>Wd,openModal:()=>Md,pinItem:()=>Bd,setDefaultComplementaryArea:()=>Td,setFeatureDefaults:()=>Dd,setFeatureValue:()=>Pd,toggleFeature:()=>Rd,unpinItem:()=>Nd});var Ft=r($e(),1),U=r(J(),1);var Vt=r($e(),1);function ie(e){return["core/edit-post","core/edit-site"].includes(e)?((0,Vt.default)(`${e} interface scope`,{alternative:"core interface scope",hint:"core/edit-post and core/edit-site are merging.",version:"6.6"}),"core"):e}function Le(e,t){return e==="core"&&t==="edit-site/template"?((0,Vt.default)("edit-site/template sidebar",{alternative:"edit-post/document",version:"6.6"}),"edit-post/document"):e==="core"&&t==="edit-site/block-inspector"?((0,Vt.default)("edit-site/block-inspector sidebar",{alternative:"edit-post/block",version:"6.6"}),"edit-post/block"):t}var Td=(e,t)=>(e=ie(e),t=Le(e,t),{type:"SET_DEFAULT_COMPLEMENTARY_AREA",scope:e,area:t}),Wd=(e,t)=>({registry:o,dispatch:a})=>{if(!t)return;e=ie(e),t=Le(e,t),o.select(U.store).get(e,"isComplementaryAreaVisible")||o.dispatch(U.store).set(e,"isComplementaryAreaVisible",!0),a({type:"ENABLE_COMPLEMENTARY_AREA",scope:e,area:t})},Ld=e=>({registry:t})=>{e=ie(e),t.select(U.store).get(e,"isComplementaryAreaVisible")&&t.dispatch(U.store).set(e,"isComplementaryAreaVisible",!1)},Bd=(e,t)=>({registry:o})=>{if(!t)return;e=ie(e),t=Le(e,t);let a=o.select(U.store).get(e,"pinnedItems");a?.[t]!==!0&&o.dispatch(U.store).set(e,"pinnedItems",{...a,[t]:!0})},Nd=(e,t)=>({registry:o})=>{if(!t)return;e=ie(e),t=Le(e,t);let a=o.select(U.store).get(e,"pinnedItems");o.dispatch(U.store).set(e,"pinnedItems",{...a,[t]:!1})};function Rd(e,t){return function({registry:o}){(0,Ft.default)("dispatch( 'core/interface' ).toggleFeature",{since:"6.0",alternative:"dispatch( 'core/preferences' ).toggle"}),o.dispatch(U.store).toggle(e,t)}}function Pd(e,t,o){return function({registry:a}){(0,Ft.default)("dispatch( 'core/interface' ).setFeatureValue",{since:"6.0",alternative:"dispatch( 'core/preferences' ).set"}),a.dispatch(U.store).set(e,t,!!o)}}function Dd(e,t){return function({registry:o}){(0,Ft.default)("dispatch( 'core/interface' ).setFeatureDefaults",{since:"6.0",alternative:"dispatch( 'core/preferences' ).setDefaults"}),o.dispatch(U.store).setDefaults(e,t)}}function Md(e){return{type:"OPEN_MODAL",name:e}}function Od(){return{type:"CLOSE_MODAL"}}var oo={};we(oo,{getActiveComplementaryArea:()=>Vd,isComplementaryAreaLoading:()=>Fd,isFeatureActive:()=>Gd,isItemPinned:()=>jd,isModalActive:()=>zd});var Je=r(w(),1),da=r($e(),1),et=r(J(),1);var Vd=(0,Je.createRegistrySelector)(e=>(t,o)=>{o=ie(o);let a=e(et.store).get(o,"isComplementaryAreaVisible");if(a!==void 0)return a===!1?null:t?.complementaryAreas?.[o]}),Fd=(0,Je.createRegistrySelector)(e=>(t,o)=>{o=ie(o);let a=e(et.store).get(o,"isComplementaryAreaVisible"),i=t?.complementaryAreas?.[o];return a&&i===void 0}),jd=(0,Je.createRegistrySelector)(e=>(t,o,a)=>(o=ie(o),a=Le(o,a),e(et.store).get(o,"pinnedItems")?.[a]??!0)),Gd=(0,Je.createRegistrySelector)(e=>(t,o,a)=>((0,da.default)("select( 'core/interface' ).isFeatureActive( scope, featureName )",{since:"6.0",alternative:"select( 'core/preferences' ).get( scope, featureName )"}),!!e(et.store).get(o,a)));function zd(e,t){return e.activeModal===t}var la=r(w(),1);function Hd(e={},t){switch(t.type){case"SET_DEFAULT_COMPLEMENTARY_AREA":{let{scope:o,area:a}=t;return e[o]?e:{...e,[o]:a}}case"ENABLE_COMPLEMENTARY_AREA":{let{scope:o,area:a}=t;return{...e,[o]:a}}}return e}function Ud(e=null,t){switch(t.type){case"OPEN_MODAL":return t.name;case"CLOSE_MODAL":return null}return e}var na=(0,la.combineReducers)({complementaryAreas:Hd,activeModal:Ud});var ma="core/interface";var B=(0,jt.createReduxStore)(ma,{reducer:na,actions:ro,selectors:oo});(0,jt.register)(B);var ua=r(f(),1);function Kd(e){return["checkbox","option","radio","switch","menuitemcheckbox","menuitemradio","treeitem"].includes(e)}function je({as:e=fa.Button,scope:t,identifier:o,icon:a,selectedIcon:i,name:s,shortcut:l,...d}){let n=e,m=(0,ca.usePluginContext)(),b=a||m.icon,p=o||`${m.name}/${s}`,h=(0,Gt.useSelect)(M=>M(B).getActiveComplementaryArea(t)===p,[p,t]),{enableComplementaryArea:E,disableComplementaryArea:D}=(0,Gt.useDispatch)(B);return(0,ua.jsx)(n,{icon:i&&h?i:b,"aria-controls":p.replace("/",":"),"aria-checked":Kd(d.role)?h:void 0,onClick:()=>{h?D(t):E(t,p)},shortcut:l,...d})}var zt=r(f(),1),Yd=({children:e,className:t,toggleButtonProps:o})=>{let a=(0,zt.jsx)(je,{icon:Ze,...o});return(0,zt.jsxs)("div",{className:V("components-panel__header","interface-complementary-area-header",t),tabIndex:-1,children:[e,a]})},pa=Yd;var ba=r(k(),1);var be=r(k(),1),Ht=r(y(),1),tt=r(f(),1),ga=()=>{};function $d({name:e,as:t=be.MenuGroup,fillProps:o={},bubblesVirtually:a,...i}){return(0,tt.jsx)(be.Slot,{name:e,bubblesVirtually:a,fillProps:o,children:s=>{if(!Ht.Children.toArray(s).length)return null;let l=[];Ht.Children.forEach(s,({props:{__unstableExplicitMenuItem:n,__unstableTarget:m}})=>{m&&n&&l.push(m)});let d=Ht.Children.map(s,n=>!n.props.__unstableExplicitMenuItem&&l.includes(n.props.__unstableTarget)?null:n);return(0,tt.jsx)(t,{...i,children:d})}})}function ha({name:e,as:t=be.Button,onClick:o,...a}){return(0,tt.jsx)(be.Fill,{name:e,children:({onClick:i})=>(0,tt.jsx)(t,{onClick:o||i?(...s)=>{(o||ga)(...s),(i||ga)(...s)}:void 0,...a})})}ha.Slot=$d;var wa=ha;var Ut=r(f(),1),qd=({__unstableExplicitMenuItem:e,__unstableTarget:t,...o})=>(0,Ut.jsx)(ba.MenuItem,{...o});function va({scope:e,target:t,__unstableExplicitMenuItem:o,...a}){return(0,Ut.jsx)(je,{as:i=>(0,Ut.jsx)(wa,{__unstableExplicitMenuItem:o,__unstableTarget:`${e}/${t}`,as:qd,name:`${e}/plugin-more-menu`,...i}),role:"menuitemcheckbox",selectedIcon:qe,name:t,scope:e,...a})}var Yt=r(k(),1),Kt=r(f(),1);function _a({scope:e,...t}){return(0,Kt.jsx)(Yt.Fill,{name:`PinnedItems/${e}`,...t})}function Zd({scope:e,className:t,...o}){return(0,Kt.jsx)(Yt.Slot,{name:`PinnedItems/${e}`,...o,children:a=>a?.length>0&&(0,Kt.jsx)("div",{className:V(t,"interface-pinned-items"),children:a})})}_a.Slot=Zd;var rt=_a;var C=r(f(),1),Qd=.3;function Xd({scope:e,...t}){return(0,C.jsx)(K.Slot,{name:`ComplementaryArea/${e}`,...t})}var ka=280,Jd={open:{width:ka},closed:{width:0},mobileOpen:{width:"100vw"}};function el({activeArea:e,isActive:t,scope:o,children:a,className:i,id:s}){let l=(0,ve.useReducedMotion)(),d=(0,ve.useViewportMatch)("medium","<"),n=(0,ve.usePrevious)(e),m=(0,ve.usePrevious)(t),[,b]=(0,se.useState)({});(0,se.useEffect)(()=>{b({})},[t]);let p={type:"tween",duration:l||d||n&&e&&e!==n?0:Qd,ease:[.6,0,.4,1]};return(0,C.jsx)(K.Fill,{name:`ComplementaryArea/${o}`,children:(0,C.jsx)(K.__unstableAnimatePresence,{initial:!1,children:(m||t)&&(0,C.jsx)(K.__unstableMotion.div,{variants:Jd,initial:"closed",animate:d?"mobileOpen":"open",exit:"closed",transition:p,className:"interface-complementary-area__fill",children:(0,C.jsx)("div",{id:s,className:i,style:{width:d?"100vw":ka},children:a})})})})}function tl(e,t,o,a,i){let s=(0,se.useRef)(!1),l=(0,se.useRef)(!1),{enableComplementaryArea:d,disableComplementaryArea:n}=(0,ot.useDispatch)(B);(0,se.useEffect)(()=>{a&&i&&!s.current?(n(e),l.current=!0):l.current&&!i&&s.current?(l.current=!1,d(e,t)):l.current&&o&&o!==t&&(l.current=!1),i!==s.current&&(s.current=i)},[a,i,e,t,o,n,d])}function Aa({children:e,className:t,closeLabel:o=(0,$t.__)("Close plugin"),identifier:a,header:i,headerClassName:s,icon:l,isPinnable:d=!0,panelClassName:n,scope:m,name:b,title:p,toggleShortcut:h,isActiveByDefault:E}){let D=(0,Sa.usePluginContext)(),M=l||D.icon,u=a||`${D.name}/${b}`,[v,O]=(0,se.useState)(!1),{isLoading:H,isActive:X,isPinned:ce,activeArea:We,isSmall:vt,isLarge:ld,showIconLabels:_t}=(0,ot.useSelect)(yt=>{let{getActiveComplementaryArea:cd,isComplementaryAreaLoading:ud,isItemPinned:pd}=yt(B),{get:gd}=yt(ya.store),Mo=cd(m);return{isLoading:ud(m),isActive:Mo===u,isPinned:pd(m,u),activeArea:Mo,isSmall:yt(ao.store).isViewportMatch("< medium"),isLarge:yt(ao.store).isViewportMatch("large"),showIconLabels:gd("core","showIconLabels")}},[u,m]),nd=(0,ve.useViewportMatch)("medium","<");tl(m,u,We,X,vt);let{enableComplementaryArea:Do,disableComplementaryArea:Br,pinItem:md,unpinItem:fd}=(0,ot.useDispatch)(B);if((0,se.useEffect)(()=>{E&&We===void 0&&!vt?Do(m,u):We===void 0&&vt&&Br(m,u),O(!0)},[We,E,m,u,vt,Do,Br]),!!v)return(0,C.jsxs)(C.Fragment,{children:[d&&(0,C.jsx)(rt,{scope:m,children:ce&&(0,C.jsx)(je,{scope:m,identifier:u,isPressed:X&&(!_t||ld),"aria-expanded":X,"aria-disabled":H,label:p,icon:_t?qe:M,showTooltip:!_t,variant:_t?"tertiary":void 0,size:"compact",shortcut:h})}),b&&d&&(0,C.jsx)(va,{target:b,scope:m,icon:M,identifier:u,children:p}),(0,C.jsxs)(el,{activeArea:We,isActive:X,className:V("interface-complementary-area",t),scope:m,id:u.replace("/",":"),children:[(0,C.jsx)(pa,{className:s,closeLabel:o,onClose:()=>Br(m),toggleButtonProps:{label:o,size:"compact",shortcut:h,scope:m,identifier:u},children:i||(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("h2",{className:"interface-complementary-area-header__title",children:p}),d&&!nd&&(0,C.jsx)(K.Button,{className:"interface-complementary-area__pin-unpin-item",icon:ce?eo:Xr,label:ce?(0,$t.__)("Unpin from toolbar"):(0,$t.__)("Pin to toolbar"),onClick:()=>(ce?fd:md)(m,u),isPressed:ce,"aria-expanded":ce,size:"compact"})]})}),(0,C.jsx)(K.Panel,{className:n,children:e})]})]})}Aa.Slot=Xd;var at=Aa;var xa=r(y(),1),Ia=r(f(),1),Ea=(0,xa.forwardRef)(({children:e,className:t,ariaLabel:o,as:a="div",...i},s)=>(0,Ia.jsx)(a,{ref:s,className:V("admin-ui-navigable-region",t),"aria-label":o,role:"region",tabIndex:"-1",...i,children:e}));Ea.displayName="NavigableRegion";var _e=Ea;var qt=r(y(),1),Be=r(k(),1),ye=r(A(),1),Ge=r(z(),1),P=r(f(),1),La=.25,Wa={type:"tween",duration:La,ease:[.6,0,.4,1]};function rl(e){(0,qt.useEffect)(()=>{let t=document&&document.querySelector(`html:not(.${e})`);if(t)return t.classList.toggle(e),()=>{t.classList.toggle(e)}},[e])}var ol={hidden:{opacity:1,marginTop:-60},visible:{opacity:1,marginTop:0},distractionFreeHover:{opacity:1,marginTop:0,transition:{...Wa,delay:.2,delayChildren:.2}},distractionFreeHidden:{opacity:0,marginTop:-60},distractionFreeDisabled:{opacity:0,marginTop:0,transition:{...Wa,delay:.8,delayChildren:.8}}};function al({isDistractionFree:e,footer:t,header:o,editorNotices:a,sidebar:i,secondarySidebar:s,content:l,actions:d,labels:n,className:m},b){let[p,h]=(0,Ge.useResizeObserver)(),E=(0,Ge.useViewportMatch)("medium","<"),M={type:"tween",duration:(0,Ge.useReducedMotion)()?0:La,ease:[.6,0,.4,1]};rl("interface-interface-skeleton__html-container");let v={...{header:(0,ye._x)("Header","header landmark area"),body:(0,ye.__)("Content"),secondarySidebar:(0,ye.__)("Block Library"),sidebar:(0,ye._x)("Settings","settings landmark area"),actions:(0,ye.__)("Publish"),footer:(0,ye.__)("Footer")},...n};return(0,P.jsxs)("div",{ref:b,className:V(m,"interface-interface-skeleton",!!t&&"has-footer"),children:[(0,P.jsxs)("div",{className:"interface-interface-skeleton__editor",children:[(0,P.jsx)(Be.__unstableAnimatePresence,{initial:!1,children:!!o&&(0,P.jsx)(_e,{as:Be.__unstableMotion.div,className:"interface-interface-skeleton__header","aria-label":v.header,initial:e&&!E?"distractionFreeHidden":"hidden",whileHover:e&&!E?"distractionFreeHover":"visible",animate:e&&!E?"distractionFreeDisabled":"visible",exit:e&&!E?"distractionFreeHidden":"hidden",variants:ol,transition:M,children:o})}),e&&(0,P.jsx)("div",{className:"interface-interface-skeleton__header",children:a}),(0,P.jsxs)("div",{className:"interface-interface-skeleton__body",children:[(0,P.jsx)(Be.__unstableAnimatePresence,{initial:!1,children:!!s&&(0,P.jsx)(_e,{className:"interface-interface-skeleton__secondary-sidebar",ariaLabel:v.secondarySidebar,as:Be.__unstableMotion.div,initial:"closed",animate:"open",exit:"closed",variants:{open:{width:h.width},closed:{width:0}},transition:M,children:(0,P.jsxs)(Be.__unstableMotion.div,{style:{position:"absolute",width:E?"100vw":"fit-content",height:"100%",left:0},variants:{open:{x:0},closed:{x:"-100%"}},transition:M,children:[p,s]})})}),(0,P.jsx)(_e,{className:"interface-interface-skeleton__content",ariaLabel:v.body,children:l}),!!i&&(0,P.jsx)(_e,{className:"interface-interface-skeleton__sidebar",ariaLabel:v.sidebar,children:i}),!!d&&(0,P.jsx)(_e,{className:"interface-interface-skeleton__actions",ariaLabel:v.actions,children:d})]})]}),!!t&&(0,P.jsx)(_e,{className:"interface-interface-skeleton__footer",ariaLabel:v.footer,children:t})]})}var io=(0,qt.forwardRef)(al);var Da=r(Fe(),1),te=r(G(),1),st=r(L(),1);var Ne=r(kt(),1),Zt=r(Fe(),1);function Na(e){if(e.id_base==="block"){let o=(0,Ne.parse)(e.instance.raw.content,{__unstableSkipAutop:!0});return o.length?(0,Zt.addWidgetIdToBlock)(o[0],e.id):(0,Zt.addWidgetIdToBlock)((0,Ne.createBlock)("core/paragraph",{},[]),e.id)}let t;return e._embedded.about[0].is_multi?t={idBase:e.id_base,instance:e.instance}:t={id:e.id},(0,Zt.addWidgetIdToBlock)((0,Ne.createBlock)("core/legacy-widget",t,[]),e.id)}function Ra(e,t={}){let o;return e.name==="core/legacy-widget"&&(e.attributes.id||e.attributes.instance)?o={...t,id:e.attributes.id??t.id,id_base:e.attributes.idBase??t.id_base,instance:e.attributes.instance??t.instance}:o={...t,id_base:"block",instance:{raw:{content:(0,Ne.serialize)(e)}}},delete o.rendered,delete o.rendered_form,o}var x="root",de="sidebar",j="postType",ue=e=>`widget-area-${e}`,Se=()=>"widget-areas";function ze(){return{per_page:-1}}function it(){return{per_page:-1,_embed:"about"}}var Pa=(e,t)=>({id:e,slug:e,status:"draft",type:"page",blocks:t,meta:{widgetAreaId:e}});var ee="core/edit-widgets";var dt=(e,t)=>({registry:o})=>{let a=Pa(e,t);return o.dispatch(te.store).receiveEntityRecords(x,j,a,{id:a.id},!1),a},il=()=>async({select:e,dispatch:t,registry:o})=>{let a=e.getEditedWidgetAreas();if(a?.length)try{await t.saveWidgetAreas(a),o.dispatch(so.store).createSuccessNotice((0,Re.__)("Widgets saved."),{type:"snackbar"})}catch(i){o.dispatch(so.store).createErrorNotice((0,Re.sprintf)((0,Re.__)("There was an error. %s"),i.message),{type:"snackbar"})}},sl=e=>async({dispatch:t,registry:o})=>{try{for(let a of e)await t.saveWidgetArea(a.id)}finally{await o.dispatch(te.store).finishResolution("getEntityRecord",x,de,ze())}},dl=e=>async({dispatch:t,select:o,registry:a})=>{let i=o.getWidgets(),s=a.select(te.store).getEditedEntityRecord(x,j,ue(e)),l=Object.values(i).filter(({sidebar:u})=>u===e),d=[],n=s.blocks.filter(u=>{let{id:v}=u.attributes;if(u.name==="core/legacy-widget"&&v){if(d.includes(v))return!1;d.push(v)}return!0}),m=[];for(let u of l)o.getWidgetAreaForWidgetId(u.id)||m.push(u);let b=[],p=[],h=[];for(let u=0;u<n.length;u++){let v=n[u],O=(0,Da.getWidgetIdFromBlock)(v),H=i[O],X=Ra(v,H);if(h.push(O),H){if(a.dispatch(te.store).editEntityRecord("root","widget",O,{...X,sidebar:e},{undoIgnore:!0}),!a.select(te.store).hasEditsForEntityRecord("root","widget",O))continue;p.push(({saveEditedEntityRecord:We})=>We("root","widget",O))}else p.push(({saveEntityRecord:ce})=>ce("root","widget",{...X,sidebar:e}));b.push({block:v,position:u,clientId:v.clientId})}for(let u of m)p.push(({deleteEntityRecord:v})=>v("root","widget",u.id,{force:!0}));let D=(await a.dispatch(te.store).__experimentalBatch(p)).filter(u=>!u.hasOwnProperty("deleted")),M=[];for(let u=0;u<D.length;u++){let v=D[u],{block:O,position:H}=b[u];s.blocks[H].attributes.__internalWidgetId=v.id,a.select(te.store).getLastEntitySaveError("root","widget",v.id)&&M.push(O.attributes?.name||O?.name),h[H]||(h[H]=v.id)}if(M.length)throw new Error((0,Re.sprintf)((0,Re.__)("Could not save the following widgets: %s."),M.join(", ")));a.dispatch(te.store).editEntityRecord(x,de,e,{widgets:h},{undoIgnore:!0}),t(ll(e)),a.dispatch(te.store).receiveEntityRecords(x,j,s,void 0)},ll=e=>({registry:t})=>{t.dispatch(te.store).saveEditedEntityRecord(x,de,e,{throwOnError:!0})};function nl(e,t){return{type:"SET_WIDGET_ID_FOR_CLIENT_ID",clientId:e,widgetId:t}}function lo(e){return{type:"SET_WIDGET_AREAS_OPEN_STATE",widgetAreasOpenState:e}}function ml(e,t){return{type:"SET_IS_WIDGET_AREA_OPEN",clientId:e,isOpen:t}}function fl(e){return{type:"SET_IS_INSERTER_OPENED",value:e}}function cl(e){return{type:"SET_IS_LIST_VIEW_OPENED",isOpen:e}}var ul=()=>({registry:e})=>{e.dispatch(B).disableComplementaryArea(ee)},pl=(e,t)=>async({dispatch:o,select:a,registry:i})=>{let s=i.select(st.store).getBlockRootClientId(e),n=i.select(st.store).getBlocks().find(({attributes:h})=>h.id===t).clientId,b=i.select(st.store).getBlockOrder(n).length;a.getIsWidgetAreaOpen(n)||o.setIsWidgetAreaOpen(n,!0),i.dispatch(st.store).moveBlocksToPosition([e],s,n,b)};function gl(e){return{type:"UNLOCK_WIDGET_SAVING",lockName:e}}function hl(e){return{type:"LOCK_WIDGET_SAVING",lockName:e}}var wl=()=>async({dispatch:e,registry:t})=>{let o=ze(),a=await t.resolveSelect(mo.store).getEntityRecords(x,de,o),i=[],s=a.sort((d,n)=>d.id==="wp_inactive_widgets"?1:n.id==="wp_inactive_widgets"?-1:0);for(let d of s)i.push((0,Ma.createBlock)("core/widget-area",{id:d.id,name:d.name})),d.widgets.length||e(dt(ue(d.id),[]));let l={};i.forEach((d,n)=>{l[d.clientId]=n===0}),e(lo(l)),e(dt(Se(),i))},bl=()=>async({dispatch:e,registry:t})=>{let o=it(),a=await t.resolveSelect(mo.store).getEntityRecords("root","widget",o),i={};for(let s of a){let l=Na(s);i[s.sidebar]=i[s.sidebar]||[],i[s.sidebar].push(l)}for(let s in i)i.hasOwnProperty(s)&&e(dt(ue(s),i[s]))};var co={};we(co,{__experimentalGetInsertionPoint:()=>Wl,canInsertBlockInWidgetArea:()=>Ll,getEditedWidgetAreas:()=>xl,getIsWidgetAreaOpen:()=>Cl,getParentWidgetAreaBlock:()=>Al,getReferenceWidgetBlocks:()=>Il,getWidget:()=>yl,getWidgetAreaForWidgetId:()=>kl,getWidgetAreas:()=>Sl,getWidgets:()=>_l,isInserterOpened:()=>Tl,isListViewOpened:()=>Bl,isSavingWidgetAreas:()=>El,isWidgetSavingLocked:()=>Nl});var Y=r(w(),1),Oa=r(Fe(),1),le=r(G(),1),Qt=r(L(),1);var vl={rootClientId:void 0,insertionIndex:void 0},_l=(0,Y.createRegistrySelector)(e=>(0,Y.createSelector)(()=>e(le.store).getEntityRecords("root","widget",it())?.reduce((o,a)=>({...o,[a.id]:a}),{})??{},()=>[e(le.store).getEntityRecords("root","widget",it())])),yl=(0,Y.createRegistrySelector)(e=>(t,o)=>e(ee).getWidgets()[o]),Sl=(0,Y.createRegistrySelector)(e=>()=>{let t=ze();return e(le.store).getEntityRecords(x,de,t)}),kl=(0,Y.createRegistrySelector)(e=>(t,o)=>e(ee).getWidgetAreas().find(i=>e(le.store).getEditedEntityRecord(x,j,ue(i.id)).blocks.map(d=>(0,Oa.getWidgetIdFromBlock)(d)).includes(o))),Al=(0,Y.createRegistrySelector)(e=>(t,o)=>{let{getBlock:a,getBlockName:i,getBlockParents:s}=e(Qt.store),d=s(o).find(n=>i(n)==="core/widget-area");return a(d)}),xl=(0,Y.createRegistrySelector)(e=>(t,o)=>{let a=e(ee).getWidgetAreas();return a?(o&&(a=a.filter(({id:i})=>o.includes(i))),a.filter(({id:i})=>e(le.store).hasEditsForEntityRecord(x,j,ue(i))).map(({id:i})=>e(le.store).getEditedEntityRecord(x,de,i))):[]}),Il=(0,Y.createRegistrySelector)(e=>(t,o=null)=>{let a=[],i=e(ee).getWidgetAreas();for(let s of i){let l=e(le.store).getEditedEntityRecord(x,j,ue(s.id));for(let d of l.blocks)d.name==="core/legacy-widget"&&(!o||d.attributes?.referenceWidgetName===o)&&a.push(d)}return a}),El=(0,Y.createRegistrySelector)(e=>()=>{let t=e(ee).getWidgetAreas()?.map(({id:a})=>a);if(!t)return!1;for(let a of t)if(e(le.store).isSavingEntityRecord(x,de,a))return!0;let o=[...Object.keys(e(ee).getWidgets()),void 0];for(let a of o)if(e(le.store).isSavingEntityRecord("root","widget",a))return!0;return!1}),Cl=(e,t)=>{let{widgetAreasOpenState:o}=e;return!!o[t]};function Tl(e){return!!e.blockInserterPanel}function Wl(e){return typeof e.blockInserterPanel=="boolean"?vl:e.blockInserterPanel}var Ll=(0,Y.createRegistrySelector)(e=>(t,o)=>{let a=e(Qt.store).getBlocks(),[i]=a;return e(Qt.store).canInsertBlockType(o,i.clientId)});function Bl(e){return e.listViewPanel}function Nl(e){return Object.keys(e.widgetSavingLock).length>0}var uo={};we(uo,{getInserterSidebarToggleRef:()=>Pl,getListViewToggleRef:()=>Rl});function Rl(e){return e.listViewToggleRef}function Pl(e){return e.inserterSidebarToggleRef}var Va=r(Ta(),1),{lock:bf,unlock:$}=(0,Va.__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/edit-widgets");var Dl={reducer:Zo,selectors:co,resolvers:fo,actions:no},c=(0,Xt.createReduxStore)(ee,Dl);(0,Xt.register)(c);Fa.default.use(function(e,t){return e.path?.indexOf("/wp/v2/types/widget-area")===0?Promise.resolve({}):t(e)});$(c).registerPrivateSelectors(uo);var Ga=r(L(),1),za=r(z(),1),er=r(w(),1),Ha=r(Jt(),1),Ua=r(Fe(),1);var ke=r(f(),1),Ml=(0,za.createHigherOrderComponent)(e=>t=>{let{clientId:o,name:a}=t,{widgetAreas:i,currentWidgetAreaId:s,canInsertBlockInWidgetArea:l}=(0,er.useSelect)(b=>{if(a==="core/widget-area")return{};let p=b(c),h=p.getParentWidgetAreaBlock(o);return{widgetAreas:p.getWidgetAreas(),currentWidgetAreaId:h?.attributes?.id,canInsertBlockInWidgetArea:p.canInsertBlockInWidgetArea(a)}},[o,a]),{moveBlockToWidgetArea:d}=(0,er.useDispatch)(c),n=i?.length>1,m=a!=="core/widget-area"&&n&&l;return(0,ke.jsxs)(ke.Fragment,{children:[(0,ke.jsx)(e,{...t},"edit"),m&&(0,ke.jsx)(Ga.BlockControls,{children:(0,ke.jsx)(Ua.MoveToWidgetArea,{widgetAreas:i,currentWidgetAreaId:s,onSelect:b=>{d(t.clientId,b)}})})]})},"withMoveToWidgetAreaToolbarItem");(0,Ha.addFilter)("editor.BlockEdit","core/edit-widgets/block-edit",Ml);var Ya=r(Jt(),1),$a=r(po(),1),Ol=()=>$a.MediaUpload;(0,Ya.addFilter)("editor.MediaUpload","core/edit-widgets/replace-media-upload",Ol);var bo={};we(bo,{metadata:()=>go,name:()=>Gl,settings:()=>zl});var wo=r(A(),1);var go={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/widget-area",title:"Widget Area",category:"widgets",attributes:{id:{type:"string"},name:{type:"string"}},supports:{html:!1,inserter:!1,customClassName:!1,reusable:!1,renaming:!1,visibility:!1,__experimentalToolbar:!1,__experimentalParentSelector:!1,__experimentalDisableBlockOverlay:!0},editorStyle:"wp-block-widget-area-editor",style:"wp-block-widget-area"};var ne=r(y(),1),ar=r(w(),1),Xa=r(G(),1),He=r(k(),1),Ja=r(L(),1);var qa=r(G(),1),or=r(L(),1),Za=r(y(),1);var tr=r(y(),1),Fl=e=>{let[t,o]=(0,tr.useState)(!1);return(0,tr.useEffect)(()=>{let{ownerDocument:a}=e.current;function i(d){l(d)}function s(){o(!1)}function l(d){e.current.contains(d.target)?o(!0):o(!1)}return a.addEventListener("dragstart",i),a.addEventListener("dragend",s),a.addEventListener("dragenter",l),()=>{a.removeEventListener("dragstart",i),a.removeEventListener("dragend",s),a.removeEventListener("dragenter",l)}},[]),t},rr=Fl;var ho=r(f(),1);function Qa({id:e}){let[t,o,a]=(0,qa.useEntityBlockEditor)("root","postType"),i=(0,Za.useRef)(),l=rr(i),d=(0,or.useInnerBlocksProps)({ref:i},{value:t,onInput:o,onChange:a,templateLock:!1,renderAppender:or.InnerBlocks.ButtonBlockAppender});return(0,ho.jsx)("div",{"data-widget-area-id":e,className:V("wp-block-widget-area__inner-blocks block-editor-inner-blocks editor-styles-wrapper",{"wp-block-widget-area__highlight-drop-zone":l}),children:(0,ho.jsx)("div",{...d})})}var Pe=r(f(),1);function ei({clientId:e,attributes:{id:t,name:o}}){let a=(0,ar.useSelect)(h=>h(c).getIsWidgetAreaOpen(e),[e]),{setIsWidgetAreaOpen:i}=(0,ar.useDispatch)(c),s=(0,ne.useRef)(),l=(0,ne.useCallback)(h=>i(e,h),[e]),d=jl(s),n=rr(s),[m,b]=(0,ne.useState)(!1);(0,ne.useEffect)(()=>{if(!d){b(!1);return}n&&!a?(l(!0),b(!0)):!n&&a&&m&&l(!1)},[a,d,n,m]);let p=(0,Ja.useBlockProps)();return(0,Pe.jsx)("div",{...p,children:(0,Pe.jsx)(He.Panel,{ref:s,children:(0,Pe.jsx)(He.PanelBody,{title:o,opened:a,onToggle:()=>{i(e,!a)},scrollAfterOpen:!d,children:({opened:h})=>(0,Pe.jsx)(He.__unstableDisclosureContent,{className:"wp-block-widget-area__panel-body-content",visible:h,children:(0,Pe.jsx)(Xa.EntityProvider,{kind:"root",type:"postType",id:`widget-area-${t}`,children:(0,Pe.jsx)(Qa,{id:t})})})})})})}var jl=e=>{let[t,o]=(0,ne.useState)(!1);return(0,ne.useEffect)(()=>{let{ownerDocument:a}=e.current;function i(){o(!0)}function s(){o(!1)}return a.addEventListener("dragstart",i),a.addEventListener("dragend",s),()=>{a.removeEventListener("dragstart",i),a.removeEventListener("dragend",s)}},[]),t};var{name:Gl}=go,zl={title:(0,wo.__)("Widget Area"),description:(0,wo.__)("A widget area container."),__experimentalLabel:({name:e})=>e,edit:ei};var Tr=r(A(),1),Js=r(w(),1),ed=r(Ot(),1),td=r(At(),1),rd=r(k(),1);var ti=r(y(),1),vo=r(A(),1),ri=r(k(),1),oi=r(L(),1),ai=r(z(),1),ii=r(Jt(),1),lt=r(f(),1);function Hl({text:e,children:t}){let o=(0,ai.useCopyToClipboard)(e);return(0,lt.jsx)(ri.Button,{__next40pxDefaultSize:!0,variant:"secondary",ref:o,children:t})}function Ul({message:e,error:t}){let o=[(0,lt.jsx)(Hl,{text:t.stack,children:(0,vo.__)("Copy Error")},"copy-error")];return(0,lt.jsx)(oi.Warning,{className:"edit-widgets-error-boundary",actions:o,children:e})}var si=class extends ti.Component{constructor(){super(...arguments),this.state={error:null}}componentDidCatch(e){(0,ii.doAction)("editor.ErrorBoundary.errorLogged",e)}static getDerivedStateFromError(e){return{error:e}}render(){return this.state.error?(0,lt.jsx)(Ul,{message:(0,vo.__)("The editor has encountered an unexpected error."),error:this.state.error}):this.props.children}};var vi=r(k(),1),_i=r(z(),1),yi=r(po(),1),lr=r(w(),1),nr=r(G(),1),Si=r(y(),1),ki=r(L(),1),Ai=r(li(),1),_o=r(J(),1),xi=r(Nr(),1);var fi=r(y(),1),Ue=r(nt(),1),ci=r(De(),1),ir=r(w(),1),Me=r(A(),1),ui=r(G(),1);function pi(){let{redo:e,undo:t}=(0,ir.useDispatch)(ui.store),{saveEditedWidgetAreas:o}=(0,ir.useDispatch)(c);return(0,Ue.useShortcut)("core/edit-widgets/undo",a=>{t(),a.preventDefault()}),(0,Ue.useShortcut)("core/edit-widgets/redo",a=>{e(),a.preventDefault()}),(0,Ue.useShortcut)("core/edit-widgets/save",a=>{a.preventDefault(),o()}),null}function Kl(){let{registerShortcut:e}=(0,ir.useDispatch)(Ue.store);return(0,fi.useEffect)(()=>{e({name:"core/edit-widgets/undo",category:"global",description:(0,Me.__)("Undo your last changes."),keyCombination:{modifier:"primary",character:"z"}}),e({name:"core/edit-widgets/redo",category:"global",description:(0,Me.__)("Redo your last undo."),keyCombination:{modifier:"primaryShift",character:"z"},aliases:(0,ci.isAppleOS)()?[]:[{modifier:"primary",character:"y"}]}),e({name:"core/edit-widgets/save",category:"global",description:(0,Me.__)("Save your changes."),keyCombination:{modifier:"primary",character:"s"}}),e({name:"core/edit-widgets/keyboard-shortcuts",category:"main",description:(0,Me.__)("Display these keyboard shortcuts."),keyCombination:{modifier:"access",character:"h"}}),e({name:"core/edit-widgets/next-region",category:"global",description:(0,Me.__)("Navigate to the next part of the editor."),keyCombination:{modifier:"ctrl",character:"`"},aliases:[{modifier:"access",character:"n"}]}),e({name:"core/edit-widgets/previous-region",category:"global",description:(0,Me.__)("Navigate to the previous part of the editor."),keyCombination:{modifier:"ctrlShift",character:"`"},aliases:[{modifier:"access",character:"p"},{modifier:"ctrlShift",character:"~"}]})},[e]),null}pi.Register=Kl;var sr=pi;var gi=r(w(),1),hi=r(L(),1),wi=r(G(),1);var Yl=()=>(0,gi.useSelect)(e=>{let{getBlockSelectionEnd:t,getBlockName:o}=e(hi.store),a=t();if(o(a)==="core/widget-area")return a;let{getParentWidgetAreaBlock:i}=e(c),l=i(a)?.clientId;if(l)return l;let{getEntityRecord:d}=e(wi.store);return d(x,j,Se())?.blocks[0]?.clientId},[]),bi=Yl;var dr=!1;var Oe=r(f(),1),{ExperimentalBlockEditorProvider:$l}=$(ki.privateApis),{PatternsMenuItems:ql}=$(Ai.privateApis),{BlockKeyboardShortcuts:Zl}=$(xi.privateApis),Ql=[];function Ii({blockEditorSettings:e,children:t,...o}){let a=(0,_i.useViewportMatch)("medium"),{hasUploadPermissions:i,reusableBlocks:s,isFixedToolbarActive:l,keepCaretInsideBlock:d,pageOnFront:n,pageForPosts:m}=(0,lr.useSelect)(u=>{let{canUser:v,getEntityRecord:O,getEntityRecords:H}=u(nr.store),X=v("read",{kind:"root",name:"site"})?O("root","site"):void 0;return{hasUploadPermissions:v("create",{kind:"postType",name:"attachment"})??!0,reusableBlocks:dr?H("postType","wp_block"):Ql,isFixedToolbarActive:!!u(_o.store).get("core/edit-widgets","fixedToolbar"),keepCaretInsideBlock:!!u(_o.store).get("core/edit-widgets","keepCaretInsideBlock"),pageOnFront:X?.page_on_front,pageForPosts:X?.page_for_posts}},[]),{setIsInserterOpened:b}=(0,lr.useDispatch)(c),p=(0,Si.useMemo)(()=>{let u;return i&&(u=({onError:v,...O})=>{(0,yi.uploadMedia)({wpAllowedMimeTypes:e.allowedMimeTypes,onError:({message:H})=>v(H),...O})}),{...e,__experimentalReusableBlocks:s,hasFixedToolbar:l||!a,keepCaretInsideBlock:d,mediaUpload:u,templateLock:"all",__experimentalSetIsInserterOpened:b,pageOnFront:n,pageForPosts:m,editorTool:"edit"}},[i,e,l,a,d,s,b,n,m]),h=bi(),[E,D,M]=(0,nr.useEntityBlockEditor)(x,j,{id:Se()});return(0,Oe.jsxs)(vi.SlotFillProvider,{children:[(0,Oe.jsx)(sr.Register,{}),(0,Oe.jsx)(Zl,{}),(0,Oe.jsxs)($l,{value:E,onInput:D,onChange:M,settings:p,useSubRegistry:!1,...o,children:[t,(0,Oe.jsx)(ql,{rootClientId:h})]})]})}var xe=r(y(),1),Ae=r(A(),1);var mr=r(L(),1);var Oi=r(k(),1),ut=r(w(),1);var Li=r(w(),1),Bi=r(y(),1);var Ni=r(L(),1),Ri=r(k(),1),mt=r(A(),1),Pi=r(Ci(),1),Di=r(Wi(),1);var pe=r(f(),1);function Mi({selectedWidgetAreaId:e}){let t=(0,Li.useSelect)(i=>i(c).getWidgetAreas(),[]),o=(0,Bi.useMemo)(()=>e&&t?.find(i=>i.id===e),[e,t]),a;return o?e==="wp_inactive_widgets"?a=(0,mt.__)("Blocks in this Widget Area will not be displayed in your site."):a=o.description:a=(0,mt.__)("Widget Areas are global parts in your site\u2019s layout that can accept blocks. These vary by theme, but are typically parts like your Sidebar or Footer."),(0,pe.jsx)("div",{className:"edit-widgets-widget-areas",children:(0,pe.jsxs)("div",{className:"edit-widgets-widget-areas__top-container",children:[(0,pe.jsx)(Ni.BlockIcon,{icon:Pr}),(0,pe.jsxs)("div",{children:[(0,pe.jsx)("p",{dangerouslySetInnerHTML:{__html:(0,Di.safeHTML)(a)}}),t?.length===0&&(0,pe.jsx)("p",{children:(0,mt.__)("Your theme does not contain any Widget Areas.")}),!o&&(0,pe.jsx)(Ri.Button,{__next40pxDefaultSize:!0,href:(0,Pi.addQueryArgs)("customize.php",{"autofocus[panel]":"widgets",return:window.location.pathname}),variant:"tertiary",children:(0,mt.__)("Manage with live preview")})]})]})})}var R=r(f(),1),Xl=xe.Platform.select({web:!0,native:!1}),ft="edit-widgets/block-inspector",ct="edit-widgets/block-areas",{Tabs:ge}=$(Oi.privateApis);function Jl({selectedWidgetAreaBlock:e}){return(0,R.jsxs)(ge.TabList,{children:[(0,R.jsx)(ge.Tab,{tabId:ct,children:e?e.attributes.name:(0,Ae.__)("Widget Areas")}),(0,R.jsx)(ge.Tab,{tabId:ft,children:(0,Ae.__)("Block")})]})}function en({hasSelectedNonAreaBlock:e,currentArea:t,isGeneralSidebarOpen:o,selectedWidgetAreaBlock:a}){let{enableComplementaryArea:i}=(0,ut.useDispatch)(B);(0,xe.useEffect)(()=>{e&&t===ct&&o&&i("core/edit-widgets",ft),!e&&t===ft&&o&&i("core/edit-widgets",ct)},[e,i]);let s=(0,xe.useContext)(ge.Context);return(0,R.jsx)(at,{className:"edit-widgets-sidebar",header:(0,R.jsx)(ge.Context.Provider,{value:s,children:(0,R.jsx)(Jl,{selectedWidgetAreaBlock:a})}),headerClassName:"edit-widgets-sidebar__panel-tabs",title:(0,Ae.__)("Settings"),closeLabel:(0,Ae.__)("Close Settings"),scope:"core/edit-widgets",identifier:t,icon:(0,Ae.isRTL)()?Vr:jr,isActiveByDefault:Xl,children:(0,R.jsxs)(ge.Context.Provider,{value:s,children:[(0,R.jsx)(ge.TabPanel,{tabId:ct,focusable:!1,children:(0,R.jsx)(Mi,{selectedWidgetAreaId:a?.attributes.id})}),(0,R.jsx)(ge.TabPanel,{tabId:ft,focusable:!1,children:e?(0,R.jsx)(mr.BlockInspector,{}):(0,R.jsx)("span",{className:"block-editor-block-inspector__no-blocks",children:(0,Ae.__)("No block selected.")})})]})})}function Vi(){let{currentArea:e,hasSelectedNonAreaBlock:t,isGeneralSidebarOpen:o,selectedWidgetAreaBlock:a}=(0,ut.useSelect)(l=>{let{getSelectedBlock:d,getBlock:n,getBlockParentsByBlockName:m}=l(mr.store),{getActiveComplementaryArea:b}=l(B),p=d(),h=b(c.name),E=h;E||(p?E=ft:E=ct);let D;return p&&(p.name==="core/widget-area"?D=p:D=n(m(p.clientId,"core/widget-area")[0])),{currentArea:E,hasSelectedNonAreaBlock:!!(p&&p.name!=="core/widget-area"),isGeneralSidebarOpen:!!h,selectedWidgetAreaBlock:D}},[]),{enableComplementaryArea:i}=(0,ut.useDispatch)(B),s=(0,xe.useCallback)(l=>{l&&i(c.name,l)},[i]);return(0,R.jsx)(ge,{selectedTabId:o?e:null,onSelect:s,selectOnMove:!1,children:(0,R.jsx)(en,{hasSelectedNonAreaBlock:t,currentArea:e,isGeneralSidebarOpen:o,selectedWidgetAreaBlock:a})})}var Wo=r(z(),1),Us=r(L(),1),Lo=r(y(),1),Er=r(w(),1);var Ce=r(A(),1),Ks=r(J(),1);var _s=r(L(),1),ys=r(w(),1),Ss=r(y(),1),Io=r(A(),1),yr=r(k(),1);var ks=r(z(),1),As=r(J(),1);var gr=r(w(),1),gt=r(A(),1),Ie=r(k(),1),qi=r(L(),1);var ko=r(y(),1),Zi=r(z(),1);var fr=r(A(),1),Fi=r(k(),1),cr=r(w(),1);var ji=r(De(),1),yo=r(G(),1),Gi=r(y(),1),zi=r(f(),1);function tn(e,t){let o=(0,cr.useSelect)(i=>i(yo.store).hasUndo(),[]),{undo:a}=(0,cr.useDispatch)(yo.store);return(0,zi.jsx)(Fi.Button,{...e,ref:t,icon:(0,fr.isRTL)()?Qe:Xe,label:(0,fr.__)("Undo"),shortcut:ji.displayShortcut.primary("z"),"aria-disabled":!o,onClick:o?a:void 0,size:"compact"})}var Hi=(0,Gi.forwardRef)(tn);var ur=r(A(),1),Ui=r(k(),1),pr=r(w(),1);var pt=r(De(),1),So=r(G(),1),Ki=r(y(),1),Yi=r(f(),1);function rn(e,t){let o=(0,pt.isAppleOS)()?pt.displayShortcut.primaryShift("z"):pt.displayShortcut.primary("y"),a=(0,pr.useSelect)(s=>s(So.store).hasRedo(),[]),{redo:i}=(0,pr.useDispatch)(So.store);return(0,Yi.jsx)(Ui.Button,{...e,ref:t,icon:(0,ur.isRTL)()?Xe:Qe,label:(0,ur.__)("Redo"),shortcut:o,"aria-disabled":!a,onClick:a?i:void 0,size:"compact"})}var $i=(0,Ki.forwardRef)(rn);var me=r(f(),1);function on(){let e=(0,Zi.useViewportMatch)("medium"),{isInserterOpen:t,isListViewOpen:o,inserterSidebarToggleRef:a,listViewToggleRef:i}=(0,gr.useSelect)(m=>{let{isInserterOpened:b,getInserterSidebarToggleRef:p,isListViewOpened:h,getListViewToggleRef:E}=$(m(c));return{isInserterOpen:b(),isListViewOpen:h(),inserterSidebarToggleRef:p(),listViewToggleRef:E()}},[]),{setIsInserterOpened:s,setIsListViewOpened:l}=(0,gr.useDispatch)(c),d=(0,ko.useCallback)(()=>l(!o),[l,o]),n=(0,ko.useCallback)(()=>s(!t),[s,t]);return(0,me.jsxs)(qi.NavigableToolbar,{className:"edit-widgets-header-toolbar","aria-label":(0,gt.__)("Document tools"),variant:"unstyled",children:[(0,me.jsx)(Ie.ToolbarItem,{ref:a,as:Ie.Button,className:"edit-widgets-header-toolbar__inserter-toggle",variant:"primary",isPressed:t,onMouseDown:m=>{m.preventDefault()},onClick:n,icon:qr,label:(0,gt._x)("Block Inserter","Generic label for block inserter button"),size:"compact"}),e&&(0,me.jsxs)(me.Fragment,{children:[(0,me.jsx)(Ie.ToolbarItem,{as:Hi}),(0,me.jsx)(Ie.ToolbarItem,{as:$i}),(0,me.jsx)(Ie.ToolbarItem,{as:Ie.Button,className:"edit-widgets-header-toolbar__list-view-toggle",icon:Ur,isPressed:o,label:(0,gt.__)("List View"),onClick:d,ref:i,size:"compact"})]})]})}var Qi=on;var Xi=r(k(),1),Ao=r(A(),1),hr=r(w(),1);var Ji=r(f(),1);function an(){let{hasEditedWidgetAreaIds:e,isSaving:t,isWidgetSaveLocked:o}=(0,hr.useSelect)(s=>{let{getEditedWidgetAreas:l,isSavingWidgetAreas:d,isWidgetSavingLocked:n}=s(c);return{hasEditedWidgetAreaIds:l()?.length>0,isSaving:d(),isWidgetSaveLocked:n()}},[]),{saveEditedWidgetAreas:a}=(0,hr.useDispatch)(c),i=o||t||!e;return(0,Ji.jsx)(Xi.Button,{variant:"primary",isBusy:t,"aria-disabled":i,onClick:i?void 0:a,size:"compact",children:t?(0,Ao.__)("Saving\u2026"):(0,Ao.__)("Update")})}var es=an;var re=r(k(),1),gs=r(y(),1),S=r(A(),1);var Ke=r(J(),1),hs=r(De(),1),ws=r(nt(),1),bs=r(z(),1);var ls=r(k(),1),he=r(A(),1),_r=r(nt(),1),ns=r(w(),1);var q=r(A(),1),ts=[{keyCombination:{modifier:"primary",character:"b"},description:(0,q.__)("Make the selected text bold.")},{keyCombination:{modifier:"primary",character:"i"},description:(0,q.__)("Make the selected text italic.")},{keyCombination:{modifier:"primary",character:"k"},description:(0,q.__)("Convert the selected text into a link.")},{keyCombination:{modifier:"primaryShift",character:"k"},description:(0,q.__)("Remove a link.")},{keyCombination:{character:"[["},description:(0,q.__)("Insert a link to a post or page.")},{keyCombination:{modifier:"primary",character:"u"},description:(0,q.__)("Underline the selected text.")},{keyCombination:{modifier:"access",character:"d"},description:(0,q.__)("Strikethrough the selected text.")},{keyCombination:{modifier:"access",character:"x"},description:(0,q.__)("Make the selected text inline code.")},{keyCombination:{modifier:"access",character:"0"},aliases:[{modifier:"access",character:"7"}],description:(0,q.__)("Convert the current heading to a paragraph.")},{keyCombination:{modifier:"access",character:"1-6"},description:(0,q.__)("Convert the current paragraph or heading to a heading of level 1 to 6.")},{keyCombination:{modifier:"primaryShift",character:"SPACE"},description:(0,q.__)("Add non breaking space.")}];var os=r(y(),1),wr=r(De(),1),Z=r(f(),1);function rs({keyCombination:e,forceAriaLabel:t}){let o=e.modifier?wr.displayShortcutList[e.modifier](e.character):e.character,a=e.modifier?wr.shortcutAriaLabel[e.modifier](e.character):e.character,i=Array.isArray(o)?o:[o];return(0,Z.jsx)("kbd",{className:"edit-widgets-keyboard-shortcut-help-modal__shortcut-key-combination","aria-label":t||a,children:i.map((s,l)=>s==="+"?(0,Z.jsx)(os.Fragment,{children:s},l):(0,Z.jsx)("kbd",{className:"edit-widgets-keyboard-shortcut-help-modal__shortcut-key",children:s},l))})}function sn({description:e,keyCombination:t,aliases:o=[],ariaLabel:a}){return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)("div",{className:"edit-widgets-keyboard-shortcut-help-modal__shortcut-description",children:e}),(0,Z.jsxs)("div",{className:"edit-widgets-keyboard-shortcut-help-modal__shortcut-term",children:[(0,Z.jsx)(rs,{keyCombination:t,forceAriaLabel:a}),o.map((i,s)=>(0,Z.jsx)(rs,{keyCombination:i,forceAriaLabel:a},s))]})]})}var br=sn;var as=r(w(),1),is=r(nt(),1);var ss=r(f(),1);function dn({name:e}){let{keyCombination:t,description:o,aliases:a}=(0,as.useSelect)(i=>{let{getShortcutKeyCombination:s,getShortcutDescription:l,getShortcutAliases:d}=i(is.store);return{keyCombination:s(e),aliases:d(e),description:l(e)}},[e]);return t?(0,ss.jsx)(br,{keyCombination:t,description:o,aliases:a}):null}var ds=dn;var N=r(f(),1),ln=({shortcuts:e})=>(0,N.jsx)("ul",{className:"edit-widgets-keyboard-shortcut-help-modal__shortcut-list",role:"list",children:e.map((t,o)=>(0,N.jsx)("li",{className:"edit-widgets-keyboard-shortcut-help-modal__shortcut",children:typeof t=="string"?(0,N.jsx)(ds,{name:t}):(0,N.jsx)(br,{...t})},o))}),xo=({title:e,shortcuts:t,className:o})=>(0,N.jsxs)("section",{className:V("edit-widgets-keyboard-shortcut-help-modal__section",o),children:[!!e&&(0,N.jsx)("h2",{className:"edit-widgets-keyboard-shortcut-help-modal__section-title",children:e}),(0,N.jsx)(ln,{shortcuts:t})]}),vr=({title:e,categoryName:t,additionalShortcuts:o=[]})=>{let a=(0,ns.useSelect)(i=>i(_r.store).getCategoryShortcuts(t),[t]);return(0,N.jsx)(xo,{title:e,shortcuts:a.concat(o)})};function ms({isModalActive:e,toggleModal:t}){return(0,_r.useShortcut)("core/edit-widgets/keyboard-shortcuts",t,{bindGlobal:!0}),e?(0,N.jsxs)(ls.Modal,{className:"edit-widgets-keyboard-shortcut-help-modal",title:(0,he.__)("Keyboard shortcuts"),onRequestClose:t,children:[(0,N.jsx)(xo,{className:"edit-widgets-keyboard-shortcut-help-modal__main-shortcuts",shortcuts:["core/edit-widgets/keyboard-shortcuts"]}),(0,N.jsx)(vr,{title:(0,he.__)("Global shortcuts"),categoryName:"global"}),(0,N.jsx)(vr,{title:(0,he.__)("Selection shortcuts"),categoryName:"selection"}),(0,N.jsx)(vr,{title:(0,he.__)("Block shortcuts"),categoryName:"block",additionalShortcuts:[{keyCombination:{character:"/"},description:(0,he.__)("Change the block type after adding a new paragraph."),ariaLabel:(0,he.__)("Forward-slash")}]}),(0,N.jsx)(xo,{title:(0,he.__)("Text formatting"),shortcuts:ts}),(0,N.jsx)(vr,{title:(0,he.__)("List View shortcuts"),categoryName:"list-view"})]}):null}var fs=r(k(),1),cs=r(f(),1),{Fill:us,Slot:nn}=(0,fs.createSlotFill)("EditWidgetsToolsMoreMenuGroup");us.Slot=({fillProps:e})=>(0,cs.jsx)(nn,{fillProps:e,children:t=>t.length>0&&t});var ps=us;var I=r(f(),1);function vs(){let[e,t]=(0,gs.useState)(!1),o=()=>t(!e);(0,ws.useShortcut)("core/edit-widgets/keyboard-shortcuts",o);let a=(0,bs.useViewportMatch)("medium");return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(re.DropdownMenu,{icon:Yr,label:(0,S.__)("Options"),popoverProps:{placement:"bottom-end",className:"more-menu-dropdown__content"},toggleProps:{tooltipPosition:"bottom",size:"compact"},children:i=>(0,I.jsxs)(I.Fragment,{children:[a&&(0,I.jsx)(re.MenuGroup,{label:(0,S._x)("View","noun"),children:(0,I.jsx)(Ke.PreferenceToggleMenuItem,{scope:"core/edit-widgets",name:"fixedToolbar",label:(0,S.__)("Top toolbar"),info:(0,S.__)("Access all block and document tools in a single place"),messageActivated:(0,S.__)("Top toolbar activated"),messageDeactivated:(0,S.__)("Top toolbar deactivated")})}),(0,I.jsxs)(re.MenuGroup,{label:(0,S.__)("Tools"),children:[(0,I.jsx)(re.MenuItem,{onClick:()=>{t(!0)},shortcut:hs.displayShortcut.access("h"),children:(0,S.__)("Keyboard shortcuts")}),(0,I.jsx)(Ke.PreferenceToggleMenuItem,{scope:"core/edit-widgets",name:"welcomeGuide",label:(0,S.__)("Welcome Guide")}),(0,I.jsxs)(re.MenuItem,{role:"menuitem",icon:zr,href:(0,S.__)("https://wordpress.org/documentation/article/block-based-widgets-editor/"),target:"_blank",rel:"noopener noreferrer",children:[(0,S.__)("Help"),(0,I.jsx)(re.VisuallyHidden,{as:"span",children:(0,S.__)("(opens in a new tab)")})]}),(0,I.jsx)(ps.Slot,{fillProps:{onClose:i}})]}),(0,I.jsxs)(re.MenuGroup,{label:(0,S.__)("Preferences"),children:[(0,I.jsx)(Ke.PreferenceToggleMenuItem,{scope:"core/edit-widgets",name:"keepCaretInsideBlock",label:(0,S.__)("Contain text cursor inside block"),info:(0,S.__)("Aids screen readers by stopping text caret from leaving blocks."),messageActivated:(0,S.__)("Contain text cursor inside block activated"),messageDeactivated:(0,S.__)("Contain text cursor inside block deactivated")}),(0,I.jsx)(Ke.PreferenceToggleMenuItem,{scope:"core/edit-widgets",name:"themeStyles",info:(0,S.__)("Make the editor look like your theme."),label:(0,S.__)("Use theme styles")}),a&&(0,I.jsx)(Ke.PreferenceToggleMenuItem,{scope:"core/edit-widgets",name:"showBlockBreadcrumbs",label:(0,S.__)("Display block breadcrumbs"),info:(0,S.__)("Shows block breadcrumbs at the bottom of the editor."),messageActivated:(0,S.__)("Display block breadcrumbs activated"),messageDeactivated:(0,S.__)("Display block breadcrumbs deactivated")})]})]})}),(0,I.jsx)(ms,{isModalActive:e,toggleModal:o})]})}var W=r(f(),1);function mn(){let e=(0,ks.useViewportMatch)("medium"),t=(0,Ss.useRef)(),{hasFixedToolbar:o}=(0,ys.useSelect)(a=>({hasFixedToolbar:!!a(As.store).get("core/edit-widgets","fixedToolbar")}),[]);return(0,W.jsx)(W.Fragment,{children:(0,W.jsxs)("div",{className:"edit-widgets-header",children:[(0,W.jsxs)("div",{className:"edit-widgets-header__navigable-toolbar-wrapper",children:[e&&(0,W.jsx)("h1",{className:"edit-widgets-header__title",children:(0,Io.__)("Widgets")}),!e&&(0,W.jsx)(yr.VisuallyHidden,{as:"h1",className:"edit-widgets-header__title",children:(0,Io.__)("Widgets")}),(0,W.jsx)(Qi,{}),o&&e&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)("div",{className:"selected-block-tools-wrapper",children:(0,W.jsx)(_s.BlockToolbar,{hideDragHandle:!0})}),(0,W.jsx)(yr.Popover.Slot,{ref:t,name:"block-toolbar"})]})]}),(0,W.jsxs)("div",{className:"edit-widgets-header__actions",children:[(0,W.jsx)(rt.Slot,{scope:"core/edit-widgets"}),(0,W.jsx)(es,{}),(0,W.jsx)(vs,{})]})]})})}var xs=mn;var Q=r(L(),1),Es=r(z(),1),Cs=r(w(),1),Ts=r(y(),1),Ws=r(J(),1);var Sr=r(At(),1),Ve=r(f(),1);function fn(){return(0,Ve.jsxs)(Ve.Fragment,{children:[(0,Ve.jsx)(Sr.InlineNotices,{pinnedNoticesClassName:"edit-widgets-notices__pinned",dismissibleNoticesClassName:"edit-widgets-notices__dismissible"}),(0,Ve.jsx)(Sr.SnackbarNotices,{className:"edit-widgets-notices__snackbar"})]})}var Is=fn;var oe=r(f(),1);function Ls({blockEditorSettings:e}){let t=(0,Cs.useSelect)(i=>!!i(Ws.store).get("core/edit-widgets","themeStyles"),[]),o=(0,Es.useViewportMatch)("medium"),a=(0,Ts.useMemo)(()=>t?e.styles:[],[e,t]);return(0,oe.jsxs)("div",{className:"edit-widgets-block-editor",children:[(0,oe.jsx)(Is,{}),!o&&(0,oe.jsx)(Q.BlockToolbar,{hideDragHandle:!0}),(0,oe.jsxs)(Q.BlockTools,{children:[(0,oe.jsx)(sr,{}),(0,oe.jsx)(Q.__unstableEditorStyles,{styles:a,scope:":where(.editor-styles-wrapper)"}),(0,oe.jsx)(Q.BlockSelectionClearer,{children:(0,oe.jsx)(Q.WritingFlow,{children:(0,oe.jsx)(Q.BlockList,{className:"edit-widgets-main-block-list"})})})]})]})}var zs=r(w(),1);var Ps=r(L(),1),Ds=r(z(),1),Ar=r(y(),1),Ms=r(w(),1);var Eo=r(w(),1),Bs=r(L(),1),Ns=r(G(),1);var cn=()=>{let e=(0,Eo.useSelect)(t=>{let{getEntityRecord:o}=t(Ns.store);return o(x,j,Se())?.blocks[0]?.clientId},[]);return(0,Eo.useSelect)(t=>{let{getBlockRootClientId:o,getBlockSelectionEnd:a,getBlockOrder:i,getBlockIndex:s}=t(Bs.store),l=t(c).__experimentalGetInsertionPoint();if(l.rootClientId)return l;let d=a()||e,n=o(d);return d&&n===""?{rootClientId:d,insertionIndex:i(d).length}:{rootClientId:n,insertionIndex:s(d)+1}},[e])},Rs=cn;var kr=r(f(),1);function Os(){let e=(0,Ds.useViewportMatch)("medium","<"),{rootClientId:t,insertionIndex:o}=Rs(),{setIsInserterOpened:a}=(0,Ms.useDispatch)(c),i=(0,Ar.useCallback)(()=>a(!1),[a]),s=(0,Ar.useRef)();return(0,kr.jsx)("div",{className:"edit-widgets-layout__inserter-panel",children:(0,kr.jsx)("div",{className:"edit-widgets-layout__inserter-panel-content",children:(0,kr.jsx)(Ps.__experimentalLibrary,{showInserterHelpPanel:!0,shouldFocusBlock:e,rootClientId:t,__experimentalInsertionIndex:o,ref:s,onClose:i})})})}var Vs=r(L(),1),Fs=r(k(),1),xr=r(z(),1),Ir=r(w(),1),ht=r(y(),1),Co=r(A(),1);var js=r(De(),1);var Ee=r(f(),1);function Gs(){let{setIsListViewOpened:e}=(0,Ir.useDispatch)(c),{getListViewToggleRef:t}=$((0,Ir.useSelect)(c)),[o,a]=(0,ht.useState)(null),i=(0,xr.useFocusOnMount)("firstElement"),s=(0,ht.useCallback)(()=>{e(!1),t().current?.focus()},[t,e]),l=(0,ht.useCallback)(d=>{d.keyCode===js.ESCAPE&&!d.defaultPrevented&&(d.preventDefault(),s())},[s]);return(0,Ee.jsxs)("div",{className:"edit-widgets-editor__list-view-panel",onKeyDown:l,children:[(0,Ee.jsxs)("div",{className:"edit-widgets-editor__list-view-panel-header",children:[(0,Ee.jsx)("strong",{children:(0,Co.__)("List View")}),(0,Ee.jsx)(Fs.Button,{icon:Ze,label:(0,Co.__)("Close"),onClick:s,size:"compact"})]}),(0,Ee.jsx)("div",{className:"edit-widgets-editor__list-view-panel-content",ref:(0,xr.useMergeRefs)([i,a]),children:(0,Ee.jsx)(Vs.__experimentalListView,{dropZoneElement:o})})]})}var To=r(f(),1);function Hs(){let{isInserterOpen:e,isListViewOpen:t}=(0,zs.useSelect)(o=>{let{isInserterOpened:a,isListViewOpened:i}=o(c);return{isInserterOpen:a(),isListViewOpen:i()}},[]);return e?(0,To.jsx)(Os,{}):t?(0,To.jsx)(Gs,{}):null}var ae=r(f(),1),un={header:(0,Ce.__)("Widgets top bar"),body:(0,Ce.__)("Widgets and blocks"),sidebar:(0,Ce.__)("Widgets settings"),footer:(0,Ce.__)("Widgets footer")};function pn({blockEditorSettings:e}){let t=(0,Wo.useViewportMatch)("medium","<"),o=(0,Wo.useViewportMatch)("huge",">="),{setIsInserterOpened:a,setIsListViewOpened:i,closeGeneralSidebar:s}=(0,Er.useDispatch)(c),{hasBlockBreadCrumbsEnabled:l,hasSidebarEnabled:d,isInserterOpened:n,isListViewOpened:m}=(0,Er.useSelect)(h=>({hasSidebarEnabled:!!h(B).getActiveComplementaryArea(c.name),isInserterOpened:!!h(c).isInserterOpened(),isListViewOpened:!!h(c).isListViewOpened(),hasBlockBreadCrumbsEnabled:!!h(Ks.store).get("core/edit-widgets","showBlockBreadcrumbs")}),[]);(0,Lo.useEffect)(()=>{d&&!o&&(a(!1),i(!1))},[d,o]),(0,Lo.useEffect)(()=>{(n||m)&&!o&&s()},[n,m,o]);let b=m?(0,Ce.__)("List View"):(0,Ce.__)("Block Library"),p=m||n;return(0,ae.jsx)(io,{labels:{...un,secondarySidebar:b},header:(0,ae.jsx)(xs,{}),secondarySidebar:p&&(0,ae.jsx)(Hs,{}),sidebar:(0,ae.jsx)(at.Slot,{scope:"core/edit-widgets"}),content:(0,ae.jsx)(ae.Fragment,{children:(0,ae.jsx)(Ls,{blockEditorSettings:e})}),footer:l&&!t&&(0,ae.jsx)("div",{className:"edit-widgets-layout__footer",children:(0,ae.jsx)(Us.BlockBreadcrumb,{rootLabelText:(0,Ce.__)("Widgets")})})})}var Ys=pn;var $s=r(A(),1),qs=r(y(),1),Zs=r(w(),1);function Qs(){let e=(0,Zs.useSelect)(t=>{let{getEditedWidgetAreas:o}=t(c);return o()?.length>0},[]);return(0,qs.useEffect)(()=>{let t=o=>{if(e)return o.returnValue=(0,$s.__)("You have unsaved changes. If you proceed, they will be lost."),o.returnValue};return window.addEventListener("beforeunload",t),()=>{window.removeEventListener("beforeunload",t)}},[e]),null}var wt=r(w(),1),bt=r(k(),1),T=r(A(),1),Bo=r(y(),1),No=r(J(),1);var g=r(f(),1);function Xs(){let e=(0,wt.useSelect)(s=>!!s(No.store).get("core/edit-widgets","welcomeGuide"),[]),{toggle:t}=(0,wt.useDispatch)(No.store),o=(0,wt.useSelect)(s=>s(c).getWidgetAreas({per_page:-1}),[]);if(!e)return null;let a=o?.every(s=>s.id==="wp_inactive_widgets"||s.widgets.every(l=>l.startsWith("block-"))),i=o?.filter(s=>s.id!=="wp_inactive_widgets").length??0;return(0,g.jsx)(bt.Guide,{className:"edit-widgets-welcome-guide",contentLabel:(0,T.__)("Welcome to block Widgets"),finishButtonText:(0,T.__)("Get started"),onFinish:()=>t("core/edit-widgets","welcomeGuide"),pages:[{image:(0,g.jsx)(Cr,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-canvas.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-canvas.gif"}),content:(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("h1",{className:"edit-widgets-welcome-guide__heading",children:(0,T.__)("Welcome to block Widgets")}),a?(0,g.jsx)(g.Fragment,{children:(0,g.jsx)("p",{className:"edit-widgets-welcome-guide__text",children:(0,T.sprintf)((0,T._n)("Your theme provides %s \u201Cblock\u201D area for you to add and edit content.\xA0Try adding a search bar, social icons, or other types of blocks here and see how they\u2019ll look on your site.","Your theme provides %s different \u201Cblock\u201D areas for you to add and edit content.\xA0Try adding a search bar, social icons, or other types of blocks here and see how they\u2019ll look on your site.",i),i)})}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("p",{className:"edit-widgets-welcome-guide__text",children:(0,T.__)("You can now add any block to your site\u2019s widget areas. Don\u2019t worry, all of your favorite widgets still work flawlessly.")}),(0,g.jsxs)("p",{className:"edit-widgets-welcome-guide__text",children:[(0,g.jsx)("strong",{children:(0,T.__)("Want to stick with the old widgets?")})," ",(0,g.jsx)(bt.ExternalLink,{href:(0,T.__)("https://wordpress.org/plugins/classic-widgets/"),children:(0,T.__)("Get the Classic Widgets plugin.")})]})]})]})},{image:(0,g.jsx)(Cr,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-editor.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-editor.gif"}),content:(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("h1",{className:"edit-widgets-welcome-guide__heading",children:(0,T.__)("Customize each block")}),(0,g.jsx)("p",{className:"edit-widgets-welcome-guide__text",children:(0,T.__)("Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected.")})]})},{image:(0,g.jsx)(Cr,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-library.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-library.gif"}),content:(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("h1",{className:"edit-widgets-welcome-guide__heading",children:(0,T.__)("Explore all blocks")}),(0,g.jsx)("p",{className:"edit-widgets-welcome-guide__text",children:(0,Bo.createInterpolateElement)((0,T.__)("All of the blocks available to you live in the block library. You\u2019ll find it wherever you see the <InserterIconImage /> icon."),{InserterIconImage:(0,g.jsx)("img",{className:"edit-widgets-welcome-guide__inserter-icon",alt:(0,T.__)("inserter"),src:"data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='18' height='18' rx='2' fill='%231E1E1E'/%3E%3Cpath d='M9.22727 4V14M4 8.77273H14' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E%0A"})})})]})},{image:(0,g.jsx)(Cr,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.gif"}),content:(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("h1",{className:"edit-widgets-welcome-guide__heading",children:(0,T.__)("Learn more")}),(0,g.jsx)("p",{className:"edit-widgets-welcome-guide__text",children:(0,Bo.createInterpolateElement)((0,T.__)("New to the block editor? Want to learn more about using it? <a>Here's a detailed guide.</a>"),{a:(0,g.jsx)(bt.ExternalLink,{href:(0,T.__)("https://wordpress.org/documentation/article/wordpress-block-editor/")})})})]})}]})}function Cr({nonAnimatedSrc:e,animatedSrc:t}){return(0,g.jsxs)("picture",{className:"edit-widgets-welcome-guide__image",children:[(0,g.jsx)("source",{srcSet:e,media:"(prefers-reduced-motion: reduce)"}),(0,g.jsx)("img",{src:t,width:"312",height:"240",alt:""})]})}var fe=r(f(),1);function gn({blockEditorSettings:e}){let{createErrorNotice:t}=(0,Js.useDispatch)(td.store);function o(i){t((0,Tr.sprintf)((0,Tr.__)('The "%s" plugin has encountered an error and cannot be rendered.'),i))}let a=(0,rd.__unstableUseNavigateRegions)();return(0,fe.jsx)(si,{children:(0,fe.jsx)("div",{className:a.className,...a,ref:a.ref,children:(0,fe.jsxs)(Ii,{blockEditorSettings:e,children:[(0,fe.jsx)(Ys,{blockEditorSettings:e}),(0,fe.jsx)(Vi,{}),(0,fe.jsx)(ed.PluginArea,{onError:o}),(0,fe.jsx)(Qs,{}),(0,fe.jsx)(Xs,{})]})})})}var od=gn;var Po=r(f(),1),hn=["core/more","core/freeform","core/template-part",...dr?[]:["core/block"]];function dd(e,t){let o=document.getElementById(e),a=(0,Wr.createRoot)(o),i=(0,Lr.__experimentalGetCoreBlocks)().filter(s=>!(hn.includes(s.name)||s.name.startsWith("core/post")||s.name.startsWith("core/query")||s.name.startsWith("core/site")||s.name.startsWith("core/navigation")||s.name.startsWith("core/term")));return(0,Ro.dispatch)(sd.store).setDefaults("core/edit-widgets",{fixedToolbar:!1,welcomeGuide:!0,showBlockBreadcrumbs:!0,themeStyles:!0}),(0,Ro.dispatch)(Te.store).reapplyBlockTypeFilters(),(0,Lr.registerCoreBlocks)(i),(0,Ye.registerLegacyWidgetBlock)(),(0,Ye.registerLegacyWidgetVariations)(t),vn(bo),(0,Ye.registerWidgetGroupBlock)(),t.__experimentalFetchLinkSuggestions=(s,l)=>(0,id.__experimentalFetchLinkSuggestions)(s,l,t),(0,Te.setFreeformContentHandlerName)("core/html"),a.render((0,Po.jsx)(Wr.StrictMode,{children:(0,Po.jsx)(od,{blockEditorSettings:t})})),a}var wn=dd;function bn(){(0,ad.default)("wp.editWidgets.reinitializeEditor",{since:"6.2",version:"6.3"})}var vn=e=>{if(!e)return;let{metadata:t,settings:o,name:a}=e;t&&(0,Te.unstable__bootstrapServerSideBlockDefinitions)({[a]:t}),(0,Te.registerBlockType)(a,o)};return yd(_n);})(); preferences.js 0000644 00000052106 15206720414 0007410 0 ustar 00 "use strict"; var wp; (wp ||= {}).preferences = (() => { 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 __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; 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 )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // package-external:@wordpress/data var require_data = __commonJS({ "package-external:@wordpress/data"(exports, module) { module.exports = window.wp.data; } }); // package-external:@wordpress/components var require_components = __commonJS({ "package-external:@wordpress/components"(exports, module) { module.exports = window.wp.components; } }); // package-external:@wordpress/i18n var require_i18n = __commonJS({ "package-external:@wordpress/i18n"(exports, module) { module.exports = window.wp.i18n; } }); // package-external:@wordpress/element var require_element = __commonJS({ "package-external:@wordpress/element"(exports, module) { module.exports = window.wp.element; } }); // 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/a11y var require_a11y = __commonJS({ "package-external:@wordpress/a11y"(exports, module) { module.exports = window.wp.a11y; } }); // package-external:@wordpress/deprecated var require_deprecated = __commonJS({ "package-external:@wordpress/deprecated"(exports, module) { module.exports = window.wp.deprecated; } }); // package-external:@wordpress/compose var require_compose = __commonJS({ "package-external:@wordpress/compose"(exports, module) { module.exports = window.wp.compose; } }); // package-external:@wordpress/private-apis var require_private_apis = __commonJS({ "package-external:@wordpress/private-apis"(exports, module) { module.exports = window.wp.privateApis; } }); // packages/preferences/build-module/index.mjs var index_exports = {}; __export(index_exports, { PreferenceToggleMenuItem: () => PreferenceToggleMenuItem, privateApis: () => privateApis, store: () => store }); // packages/preferences/build-module/components/preference-toggle-menu-item/index.mjs var import_data3 = __toESM(require_data(), 1); var import_components = __toESM(require_components(), 1); var import_i18n = __toESM(require_i18n(), 1); // packages/icons/build-module/icon/index.mjs var import_element = __toESM(require_element(), 1); var icon_default = (0, import_element.forwardRef)( ({ icon, size = 24, ...props }, ref) => { return (0, import_element.cloneElement)(icon, { width: size, height: size, ...props, ref }); } ); // packages/icons/build-module/library/check.mjs var import_primitives = __toESM(require_primitives(), 1); var import_jsx_runtime = __toESM(require_jsx_runtime(), 1); var check_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: "M16.5 7.5 10 13.9l-2.5-2.4-1 1 3.5 3.6 7.5-7.6z" }) }); // packages/icons/build-module/library/chevron-left.mjs var import_primitives2 = __toESM(require_primitives(), 1); var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1); var chevron_left_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: "M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z" }) }); // packages/icons/build-module/library/chevron-right.mjs var import_primitives3 = __toESM(require_primitives(), 1); var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1); var chevron_right_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: "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z" }) }); // packages/preferences/build-module/components/preference-toggle-menu-item/index.mjs var import_a11y = __toESM(require_a11y(), 1); // packages/preferences/build-module/store/index.mjs var import_data2 = __toESM(require_data(), 1); // packages/preferences/build-module/store/reducer.mjs var import_data = __toESM(require_data(), 1); function defaults(state = {}, action) { if (action.type === "SET_PREFERENCE_DEFAULTS") { const { scope, defaults: values } = action; return { ...state, [scope]: { ...state[scope], ...values } }; } return state; } function withPersistenceLayer(reducer) { let persistenceLayer; return (state, action) => { if (action.type === "SET_PERSISTENCE_LAYER") { const { persistenceLayer: persistence, persistedData } = action; persistenceLayer = persistence; return persistedData; } const nextState = reducer(state, action); if (action.type === "SET_PREFERENCE_VALUE") { persistenceLayer?.set(nextState); } return nextState; }; } var preferences = withPersistenceLayer((state = {}, action) => { if (action.type === "SET_PREFERENCE_VALUE") { const { scope, name, value } = action; return { ...state, [scope]: { ...state[scope], [name]: value } }; } return state; }); var reducer_default = (0, import_data.combineReducers)({ defaults, preferences }); // packages/preferences/build-module/store/actions.mjs var actions_exports = {}; __export(actions_exports, { set: () => set, setDefaults: () => setDefaults, setPersistenceLayer: () => setPersistenceLayer, toggle: () => toggle }); function toggle(scope, name) { return function({ select, dispatch }) { const currentValue = select.get(scope, name); dispatch.set(scope, name, !currentValue); }; } function set(scope, name, value) { return { type: "SET_PREFERENCE_VALUE", scope, name, value }; } function setDefaults(scope, defaults2) { return { type: "SET_PREFERENCE_DEFAULTS", scope, defaults: defaults2 }; } async function setPersistenceLayer(persistenceLayer) { const persistedData = await persistenceLayer.get(); return { type: "SET_PERSISTENCE_LAYER", persistenceLayer, persistedData }; } // packages/preferences/build-module/store/selectors.mjs var selectors_exports = {}; __export(selectors_exports, { get: () => get }); var import_deprecated = __toESM(require_deprecated(), 1); var withDeprecatedKeys = (originalGet) => (state, scope, name) => { const settingsToMoveToCore = [ "allowRightClickOverrides", "distractionFree", "editorMode", "fixedToolbar", "focusMode", "hiddenBlockTypes", "inactivePanels", "keepCaretInsideBlock", "mostUsedBlocks", "openPanels", "showBlockBreadcrumbs", "showIconLabels", "showListViewByDefault", "isPublishSidebarEnabled", "isComplementaryAreaVisible", "pinnedItems" ]; if (settingsToMoveToCore.includes(name) && ["core/edit-post", "core/edit-site"].includes(scope)) { (0, import_deprecated.default)( `wp.data.select( 'core/preferences' ).get( '${scope}', '${name}' )`, { since: "6.5", alternative: `wp.data.select( 'core/preferences' ).get( 'core', '${name}' )` } ); return originalGet(state, "core", name); } return originalGet(state, scope, name); }; var get = withDeprecatedKeys( (state, scope, name) => { const value = state.preferences[scope]?.[name]; return value !== void 0 ? value : state.defaults[scope]?.[name]; } ); // packages/preferences/build-module/store/constants.mjs var STORE_NAME = "core/preferences"; // packages/preferences/build-module/store/index.mjs var store = (0, import_data2.createReduxStore)(STORE_NAME, { reducer: reducer_default, actions: actions_exports, selectors: selectors_exports }); (0, import_data2.register)(store); // packages/preferences/build-module/components/preference-toggle-menu-item/index.mjs var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1); function PreferenceToggleMenuItem({ scope, name, label, info, messageActivated, messageDeactivated, shortcut, handleToggling = true, onToggle = () => null, disabled = false }) { const isActive = (0, import_data3.useSelect)( (select) => !!select(store).get(scope, name), [scope, name] ); const { toggle: toggle2 } = (0, import_data3.useDispatch)(store); const speakMessage = () => { if (isActive) { const message = messageDeactivated || (0, import_i18n.sprintf)( /* translators: %s: preference name, e.g. 'Fullscreen mode' */ (0, import_i18n.__)("Preference deactivated - %s"), label ); (0, import_a11y.speak)(message); } else { const message = messageActivated || (0, import_i18n.sprintf)( /* translators: %s: preference name, e.g. 'Fullscreen mode' */ (0, import_i18n.__)("Preference activated - %s"), label ); (0, import_a11y.speak)(message); } }; return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)( import_components.MenuItem, { icon: isActive ? check_default : null, isSelected: isActive, onClick: () => { onToggle(); if (handleToggling) { toggle2(scope, name); } speakMessage(); }, role: "menuitemcheckbox", info, shortcut, disabled, children: label } ); } // packages/preferences/build-module/components/preference-base-option/index.mjs var import_components2 = __toESM(require_components(), 1); var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1); function BaseOption({ help, label, isChecked, onChange, children }) { return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "preference-base-option", children: [ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)( import_components2.ToggleControl, { help, label, checked: isChecked, onChange } ), children ] }); } var preference_base_option_default = BaseOption; // packages/preferences/build-module/components/preference-toggle-control/index.mjs var import_data4 = __toESM(require_data(), 1); var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1); function PreferenceToggleControl(props) { const { scope, featureName, onToggle = () => { }, ...remainingProps } = props; const isChecked = (0, import_data4.useSelect)( (select) => !!select(store).get(scope, featureName), [scope, featureName] ); const { toggle: toggle2 } = (0, import_data4.useDispatch)(store); const onChange = () => { onToggle(); toggle2(scope, featureName); }; return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)( preference_base_option_default, { ...remainingProps, onChange, isChecked } ); } var preference_toggle_control_default = PreferenceToggleControl; // packages/preferences/build-module/components/preferences-modal/index.mjs var import_components3 = __toESM(require_components(), 1); var import_i18n2 = __toESM(require_i18n(), 1); var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1); function PreferencesModal({ closeModal, children }) { return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)( import_components3.Modal, { className: "preferences-modal", title: (0, import_i18n2.__)("Preferences"), onRequestClose: closeModal, children } ); } // packages/preferences/build-module/components/preferences-modal-section/index.mjs var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1); var Section = ({ description, title, children }) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("fieldset", { className: "preferences-modal__section", children: [ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("legend", { className: "preferences-modal__section-legend", children: [ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("h2", { className: "preferences-modal__section-title", children: title }), description && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "preferences-modal__section-description", children: description }) ] }), /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "preferences-modal__section-content", children }) ] }); var preferences_modal_section_default = Section; // packages/preferences/build-module/components/preferences-modal-tabs/index.mjs var import_compose = __toESM(require_compose(), 1); var import_components4 = __toESM(require_components(), 1); var import_element2 = __toESM(require_element(), 1); var import_i18n3 = __toESM(require_i18n(), 1); // packages/preferences/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/preferences" ); // packages/preferences/build-module/components/preferences-modal-tabs/index.mjs var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1); var { Tabs } = unlock(import_components4.privateApis); var PREFERENCES_MENU = "preferences-menu"; function PreferencesModalTabs({ sections }) { const isLargeViewport = (0, import_compose.useViewportMatch)("medium"); const [activeMenu, setActiveMenu] = (0, import_element2.useState)(PREFERENCES_MENU); const { tabs, sectionsContentMap } = (0, import_element2.useMemo)(() => { let mappedTabs = { tabs: [], sectionsContentMap: {} }; if (sections.length) { mappedTabs = sections.reduce( (accumulator, { name, tabLabel: title, content }) => { accumulator.tabs.push({ name, title }); accumulator.sectionsContentMap[name] = content; return accumulator; }, { tabs: [], sectionsContentMap: {} } ); } return mappedTabs; }, [sections]); let modalContent; if (isLargeViewport) { modalContent = /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "preferences__tabs", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)( Tabs, { defaultTabId: activeMenu !== PREFERENCES_MENU ? activeMenu : void 0, onSelect: setActiveMenu, orientation: "vertical", children: [ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Tabs.TabList, { className: "preferences__tabs-tablist", children: tabs.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)( Tabs.Tab, { tabId: tab.name, className: "preferences__tabs-tab", children: tab.title }, tab.name )) }), tabs.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)( Tabs.TabPanel, { tabId: tab.name, className: "preferences__tabs-tabpanel", focusable: false, children: sectionsContentMap[tab.name] || null }, tab.name )) ] } ) }); } else { modalContent = /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_components4.Navigator, { initialPath: "/", className: "preferences__provider", children: [ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_components4.Navigator.Screen, { path: "/", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_components4.Card, { isBorderless: true, size: "small", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_components4.CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_components4.__experimentalItemGroup, { children: tabs.map((tab) => { return ( // @ts-expect-error: Navigator.Button is currently typed in a way that prevents Item from being passed in /* @__PURE__ */ (0, import_jsx_runtime9.jsx)( import_components4.Navigator.Button, { path: `/${tab.name}`, as: import_components4.__experimentalItem, isAction: true, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_components4.__experimentalHStack, { justify: "space-between", children: [ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_components4.FlexItem, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_components4.__experimentalTruncate, { children: tab.title }) }), /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_components4.FlexItem, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)( icon_default, { icon: (0, import_i18n3.isRTL)() ? chevron_left_default : chevron_right_default } ) }) ] }) }, tab.name ) ); }) }) }) }) }), sections.length && sections.map((section) => { return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)( import_components4.Navigator.Screen, { path: `/${section.name}`, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_components4.Card, { isBorderless: true, size: "large", children: [ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)( import_components4.CardHeader, { isBorderless: false, justify: "left", size: "small", gap: "6", as: "div", children: [ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)( import_components4.Navigator.BackButton, { icon: (0, import_i18n3.isRTL)() ? chevron_right_default : chevron_left_default, label: (0, import_i18n3.__)("Back") } ), /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_components4.__experimentalText, { size: "16", children: section.tabLabel }) ] } ), /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_components4.CardBody, { children: section.content }) ] }) }, `${section.name}-menu` ); }) ] }); } return modalContent; } // packages/preferences/build-module/private-apis.mjs var privateApis = {}; lock(privateApis, { PreferenceBaseOption: preference_base_option_default, PreferenceToggleControl: preference_toggle_control_default, PreferencesModal, PreferencesModalSection: preferences_modal_section_default, PreferencesModalTabs }); return __toCommonJS(index_exports); })(); react-i18n.js 0000644 00000007637 15206720414 0006773 0 ustar 00 "use strict"; var wp; (wp ||= {}).reactI18n = (() => { 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 __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; 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 )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // 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/react-i18n/build-module/index.mjs var index_exports = {}; __export(index_exports, { I18nProvider: () => I18nProvider, useI18n: () => useI18n, withI18n: () => withI18n }); var import_element = __toESM(require_element(), 1); var import_i18n = __toESM(require_i18n(), 1); var import_jsx_runtime = __toESM(require_jsx_runtime(), 1); function makeContextValue(i18n) { return { __: i18n.__.bind(i18n), _x: i18n._x.bind(i18n), _n: i18n._n.bind(i18n), _nx: i18n._nx.bind(i18n), isRTL: i18n.isRTL.bind(i18n), hasTranslation: i18n.hasTranslation.bind(i18n) }; } var I18nContext = (0, import_element.createContext)(makeContextValue(import_i18n.defaultI18n)); I18nContext.displayName = "I18nContext"; function I18nProvider(props) { const { children, i18n = import_i18n.defaultI18n } = props; const [update, forceUpdate] = (0, import_element.useReducer)(() => [], []); (0, import_element.useEffect)(() => i18n.subscribe(forceUpdate), [i18n]); const value = (0, import_element.useMemo)(() => makeContextValue(i18n), [i18n, update]); return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(I18nContext.Provider, { value, children }); } var useI18n = () => (0, import_element.useContext)(I18nContext); function withI18n(InnerComponent) { const EnhancedComponent = (props) => { const i18nProps = useI18n(); return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(InnerComponent, { ...props, ...i18nProps }); }; const innerComponentName = InnerComponent.displayName || InnerComponent.name || "Component"; EnhancedComponent.displayName = `WithI18n(${innerComponentName})`; return EnhancedComponent; } return __toCommonJS(index_exports); })(); block-library.min.js 0000644 00004271733 15206720414 0010442 0 ustar 00 "use strict";var wp;(wp||={}).blockLibrary=(()=>{var qpe=Object.create;var Bb=Object.defineProperty;var Zpe=Object.getOwnPropertyDescriptor;var Kpe=Object.getOwnPropertyNames;var Qpe=Object.getPrototypeOf,Ype=Object.prototype.hasOwnProperty;var Xpe=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Ce=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Z=(e,t)=>{for(var r in t)Bb(e,r,{get:t[r],enumerable:!0})},ER=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Kpe(t))!Ype.call(e,n)&&n!==r&&Bb(e,n,{get:()=>t[n],enumerable:!(a=Zpe(t,n))||a.enumerable});return e};var o=(e,t,r)=>(r=e!=null?qpe(Qpe(e)):{},ER(t||!e||!e.__esModule?Bb(r,"default",{value:e,enumerable:!0}):r,e)),Jpe=e=>ER(Bb({},"__esModule",{value:!0}),e);var W=Ce((ECe,DR)=>{DR.exports=window.wp.blocks});var me=Ce((DCe,LR)=>{LR.exports=window.wp.compose});var V=Ce((LCe,MR)=>{MR.exports=window.wp.data});var T=Ce((MCe,AR)=>{AR.exports=window.wp.blockEditor});var Fu=Ce((ACe,RR)=>{RR.exports=window.wp.serverSideRender});var P=Ce((RCe,zR)=>{zR.exports=window.wp.i18n});var Z7=Ce(rr=>{"use strict";Object.defineProperty(rr,"__esModule",{value:!0});rr.Doctype=rr.CDATA=rr.Tag=rr.Style=rr.Script=rr.Comment=rr.Directive=rr.Text=rr.Root=rr.isTag=rr.ElementType=void 0;var ri;(function(e){e.Root="root",e.Text="text",e.Directive="directive",e.Comment="comment",e.Script="script",e.Style="style",e.Tag="tag",e.CDATA="cdata",e.Doctype="doctype"})(ri=rr.ElementType||(rr.ElementType={}));function tde(e){return e.type===ri.Tag||e.type===ri.Script||e.type===ri.Style}rr.isTag=tde;rr.Root=ri.Root;rr.Text=ri.Text;rr.Directive=ri.Directive;rr.Comment=ri.Comment;rr.Script=ri.Script;rr.Style=ri.Style;rr.Tag=ri.Tag;rr.CDATA=ri.CDATA;rr.Doctype=ri.Doctype});var X7=Ce(Ue=>{"use strict";var Hu=Ue&&Ue.__extends||(function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,n){a.__proto__=n}||function(a,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(a[i]=n[i])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function a(){this.constructor=t}t.prototype=r===null?Object.create(r):(a.prototype=r.prototype,new a)}})(),d0=Ue&&Ue.__assign||function(){return d0=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},d0.apply(this,arguments)};Object.defineProperty(Ue,"__esModule",{value:!0});Ue.cloneNode=Ue.hasChildren=Ue.isDocument=Ue.isDirective=Ue.isComment=Ue.isText=Ue.isCDATA=Ue.isTag=Ue.Element=Ue.Document=Ue.CDATA=Ue.NodeWithChildren=Ue.ProcessingInstruction=Ue.Comment=Ue.Text=Ue.DataNode=Ue.Node=void 0;var wn=Z7(),Q7=(function(){function e(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(e.prototype,"parentNode",{get:function(){return this.parent},set:function(t){this.parent=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"previousSibling",{get:function(){return this.prev},set:function(t){this.prev=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextSibling",{get:function(){return this.next},set:function(t){this.next=t},enumerable:!1,configurable:!0}),e.prototype.cloneNode=function(t){return t===void 0&&(t=!1),Y7(this,t)},e})();Ue.Node=Q7;var Ib=(function(e){Hu(t,e);function t(r){var a=e.call(this)||this;return a.data=r,a}return Object.defineProperty(t.prototype,"nodeValue",{get:function(){return this.data},set:function(r){this.data=r},enumerable:!1,configurable:!0}),t})(Q7);Ue.DataNode=Ib;var FR=(function(e){Hu(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=wn.ElementType.Text,r}return Object.defineProperty(t.prototype,"nodeType",{get:function(){return 3},enumerable:!1,configurable:!0}),t})(Ib);Ue.Text=FR;var HR=(function(e){Hu(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=wn.ElementType.Comment,r}return Object.defineProperty(t.prototype,"nodeType",{get:function(){return 8},enumerable:!1,configurable:!0}),t})(Ib);Ue.Comment=HR;var OR=(function(e){Hu(t,e);function t(r,a){var n=e.call(this,a)||this;return n.name=r,n.type=wn.ElementType.Directive,n}return Object.defineProperty(t.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),t})(Ib);Ue.ProcessingInstruction=OR;var Nb=(function(e){Hu(t,e);function t(r){var a=e.call(this)||this;return a.children=r,a}return Object.defineProperty(t.prototype,"firstChild",{get:function(){var r;return(r=this.children[0])!==null&&r!==void 0?r:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"childNodes",{get:function(){return this.children},set:function(r){this.children=r},enumerable:!1,configurable:!0}),t})(Q7);Ue.NodeWithChildren=Nb;var jR=(function(e){Hu(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=wn.ElementType.CDATA,r}return Object.defineProperty(t.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),t})(Nb);Ue.CDATA=jR;var UR=(function(e){Hu(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=wn.ElementType.Root,r}return Object.defineProperty(t.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),t})(Nb);Ue.Document=UR;var GR=(function(e){Hu(t,e);function t(r,a,n,i){n===void 0&&(n=[]),i===void 0&&(i=r==="script"?wn.ElementType.Script:r==="style"?wn.ElementType.Style:wn.ElementType.Tag);var l=e.call(this,n)||this;return l.name=r,l.attribs=a,l.type=i,l}return Object.defineProperty(t.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tagName",{get:function(){return this.name},set:function(r){this.name=r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"attributes",{get:function(){var r=this;return Object.keys(this.attribs).map(function(a){var n,i;return{name:a,value:r.attribs[a],namespace:(n=r["x-attribsNamespace"])===null||n===void 0?void 0:n[a],prefix:(i=r["x-attribsPrefix"])===null||i===void 0?void 0:i[a]}})},enumerable:!1,configurable:!0}),t})(Nb);Ue.Element=GR;function WR(e){return(0,wn.isTag)(e)}Ue.isTag=WR;function $R(e){return e.type===wn.ElementType.CDATA}Ue.isCDATA=$R;function qR(e){return e.type===wn.ElementType.Text}Ue.isText=qR;function ZR(e){return e.type===wn.ElementType.Comment}Ue.isComment=ZR;function KR(e){return e.type===wn.ElementType.Directive}Ue.isDirective=KR;function QR(e){return e.type===wn.ElementType.Root}Ue.isDocument=QR;function rde(e){return Object.prototype.hasOwnProperty.call(e,"children")}Ue.hasChildren=rde;function Y7(e,t){t===void 0&&(t=!1);var r;if(qR(e))r=new FR(e.data);else if(ZR(e))r=new HR(e.data);else if(WR(e)){var a=t?K7(e.children):[],n=new GR(e.name,d0({},e.attribs),a);a.forEach(function(c){return c.parent=n}),e.namespace!=null&&(n.namespace=e.namespace),e["x-attribsNamespace"]&&(n["x-attribsNamespace"]=d0({},e["x-attribsNamespace"])),e["x-attribsPrefix"]&&(n["x-attribsPrefix"]=d0({},e["x-attribsPrefix"])),r=n}else if($R(e)){var a=t?K7(e.children):[],i=new jR(a);a.forEach(function(u){return u.parent=i}),r=i}else if(QR(e)){var a=t?K7(e.children):[],l=new UR(a);a.forEach(function(u){return u.parent=l}),e["x-mode"]&&(l["x-mode"]=e["x-mode"]),r=l}else if(KR(e)){var s=new OR(e.name,e.data);e["x-name"]!=null&&(s["x-name"]=e["x-name"],s["x-publicId"]=e["x-publicId"],s["x-systemId"]=e["x-systemId"]),r=s}else throw new Error("Not implemented yet: ".concat(e.type));return r.startIndex=e.startIndex,r.endIndex=e.endIndex,e.sourceCodeLocation!=null&&(r.sourceCodeLocation=e.sourceCodeLocation),r}Ue.cloneNode=Y7;function K7(e){for(var t=e.map(function(a){return Y7(a,!0)}),r=1;r<t.length;r++)t[r].prev=t[r-1],t[r-1].next=t[r];return t}});var JR=Ce(Is=>{"use strict";var ode=Is&&Is.__createBinding||(Object.create?(function(e,t,r,a){a===void 0&&(a=r);var n=Object.getOwnPropertyDescriptor(t,r);(!n||("get"in n?!t.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,a,n)}):(function(e,t,r,a){a===void 0&&(a=r),e[a]=t[r]})),ade=Is&&Is.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&ode(t,e,r)};Object.defineProperty(Is,"__esModule",{value:!0});Is.DomHandler=void 0;var J7=Z7(),Ou=X7();ade(X7(),Is);var YR={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},XR=(function(){function e(t,r,a){this.dom=[],this.root=new Ou.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof r=="function"&&(a=r,r=YR),typeof t=="object"&&(r=t,t=void 0),this.callback=t??null,this.options=r??YR,this.elementCB=a??null}return e.prototype.onparserinit=function(t){this.parser=t},e.prototype.onreset=function(){this.dom=[],this.root=new Ou.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},e.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},e.prototype.onerror=function(t){this.handleCallback(t)},e.prototype.onclosetag=function(){this.lastNode=null;var t=this.tagStack.pop();this.options.withEndIndices&&(t.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(t)},e.prototype.onopentag=function(t,r){var a=this.options.xmlMode?J7.ElementType.Tag:void 0,n=new Ou.Element(t,r,void 0,a);this.addNode(n),this.tagStack.push(n)},e.prototype.ontext=function(t){var r=this.lastNode;if(r&&r.type===J7.ElementType.Text)r.data+=t,this.options.withEndIndices&&(r.endIndex=this.parser.endIndex);else{var a=new Ou.Text(t);this.addNode(a),this.lastNode=a}},e.prototype.oncomment=function(t){if(this.lastNode&&this.lastNode.type===J7.ElementType.Comment){this.lastNode.data+=t;return}var r=new Ou.Comment(t);this.addNode(r),this.lastNode=r},e.prototype.oncommentend=function(){this.lastNode=null},e.prototype.oncdatastart=function(){var t=new Ou.Text(""),r=new Ou.CDATA([t]);this.addNode(r),t.parent=r,this.lastNode=t},e.prototype.oncdataend=function(){this.lastNode=null},e.prototype.onprocessinginstruction=function(t,r){var a=new Ou.ProcessingInstruction(t,r);this.addNode(a)},e.prototype.handleCallback=function(t){if(typeof this.callback=="function")this.callback(t,this.dom);else if(t)throw t},e.prototype.addNode=function(t){var r=this.tagStack[this.tagStack.length-1],a=r.children[r.children.length-1];this.options.withStartIndices&&(t.startIndex=this.parser.startIndex),this.options.withEndIndices&&(t.endIndex=this.parser.endIndex),r.children.push(t),a&&(t.prev=a,a.next=t),t.parent=r,this.lastNode=null},e})();Is.DomHandler=XR;Is.default=XR});var ez=Ce(jo=>{"use strict";Object.defineProperty(jo,"__esModule",{value:!0});jo.CARRIAGE_RETURN_PLACEHOLDER_REGEX=jo.CARRIAGE_RETURN_PLACEHOLDER=jo.CARRIAGE_RETURN_REGEX=jo.CARRIAGE_RETURN=jo.CASE_SENSITIVE_TAG_NAMES_MAP=jo.CASE_SENSITIVE_TAG_NAMES=void 0;jo.CASE_SENSITIVE_TAG_NAMES=["animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"];jo.CASE_SENSITIVE_TAG_NAMES_MAP=jo.CASE_SENSITIVE_TAG_NAMES.reduce(function(e,t){return e[t.toLowerCase()]=t,e},{});jo.CARRIAGE_RETURN="\r";jo.CARRIAGE_RETURN_REGEX=new RegExp(jo.CARRIAGE_RETURN,"g");jo.CARRIAGE_RETURN_PLACEHOLDER="__HTML_DOM_PARSER_CARRIAGE_RETURN_PLACEHOLDER_".concat(Date.now(),"__");jo.CARRIAGE_RETURN_PLACEHOLDER_REGEX=new RegExp(jo.CARRIAGE_RETURN_PLACEHOLDER,"g")});var eS=Ce(Sf=>{"use strict";Object.defineProperty(Sf,"__esModule",{value:!0});Sf.formatAttributes=tz;Sf.escapeSpecialCharacters=lde;Sf.revertEscapedCharacters=rz;Sf.formatDOM=oz;var Eb=JR(),f0=ez();function nde(e){return f0.CASE_SENSITIVE_TAG_NAMES_MAP[e]}function tz(e){for(var t={},r=0,a=e.length;r<a;r++){var n=e[r];t[n.name]=n.value}return t}function ide(e){e=e.toLowerCase();var t=nde(e);return t||e}function lde(e){return e.replace(f0.CARRIAGE_RETURN_REGEX,f0.CARRIAGE_RETURN_PLACEHOLDER)}function rz(e){return e.replace(f0.CARRIAGE_RETURN_PLACEHOLDER_REGEX,f0.CARRIAGE_RETURN)}function oz(e,t,r){t===void 0&&(t=null);for(var a=[],n,i=0,l=e.length;i<l;i++){var s=e[i];switch(s.nodeType){case 1:{var c=ide(s.nodeName);n=new Eb.Element(c,tz(s.attributes)),n.children=oz(c==="template"?s.content.childNodes:s.childNodes,n);break}case 3:n=new Eb.Text(rz(s.nodeValue));break;case 8:n=new Eb.Comment(s.nodeValue);break;default:continue}var u=a[i-1]||null;u&&(u.next=n),n.parent=t,n.prev=u,n.next=null,a.push(n)}return r&&(n=new Eb.ProcessingInstruction(r.substring(0,r.indexOf(" ")).toLowerCase(),r),n.next=a[0]||null,n.parent=t,a.unshift(n),a[1]&&(a[1].prev=a[0])),a}});var mz=Ce(oS=>{"use strict";Object.defineProperty(oS,"__esModule",{value:!0});oS.default=ude;var sde=eS(),az="html",nz="head",Db="body",cde=/<([a-zA-Z]+[0-9]?)/,iz=/<head[^]*>/i,lz=/<body[^]*>/i,Mb=function(e,t){throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},tS=function(e,t){throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")},sz=typeof window=="object"&&window.DOMParser;typeof sz=="function"&&(cz=new sz,uz="text/html",tS=function(e,t){return t&&(e="<".concat(t,">").concat(e,"</").concat(t,">")),cz.parseFromString(e,uz)},Mb=tS);var cz,uz;typeof document=="object"&&document.implementation&&(h0=document.implementation.createHTMLDocument(),Mb=function(e,t){if(t){var r=h0.documentElement.querySelector(t);return r&&(r.innerHTML=e),h0}return h0.documentElement.innerHTML=e,h0});var h0,Lb=typeof document=="object"&&document.createElement("template"),rS;Lb&&Lb.content&&(rS=function(e){return Lb.innerHTML=e,Lb.content.childNodes});function ude(e){var t,r;e=(0,sde.escapeSpecialCharacters)(e);var a=e.match(cde),n=a&&a[1]?a[1].toLowerCase():"";switch(n){case az:{var i=tS(e);if(!iz.test(e)){var l=i.querySelector(nz);(t=l?.parentNode)===null||t===void 0||t.removeChild(l)}if(!lz.test(e)){var l=i.querySelector(Db);(r=l?.parentNode)===null||r===void 0||r.removeChild(l)}return i.querySelectorAll(az)}case nz:case Db:{var s=Mb(e).querySelectorAll(n);return lz.test(e)&&iz.test(e)?s[0].parentNode.childNodes:s}default:{if(rS)return rS(e);var l=Mb(e,Db).querySelector(Db);return l.childNodes}}}});var pz=Ce(g0=>{"use strict";var mde=g0&&g0.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(g0,"__esModule",{value:!0});g0.default=hde;var pde=mde(mz()),dde=eS(),fde=/<(![a-zA-Z\s]+)>/;function hde(e){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];var t=e.match(fde),r=t?t[1]:void 0;return(0,dde.formatDOM)((0,pde.default)(e),null,r)}});var dz=Ce(Ab=>{var gde=0;Ab.SAME=gde;var vde=1;Ab.CAMELCASE=vde;Ab.possibleStandardNames={accept:0,acceptCharset:1,"accept-charset":"acceptCharset",accessKey:1,action:0,allowFullScreen:1,alt:0,as:0,async:0,autoCapitalize:1,autoComplete:1,autoCorrect:1,autoFocus:1,autoPlay:1,autoSave:1,capture:0,cellPadding:1,cellSpacing:1,challenge:0,charSet:1,checked:0,children:0,cite:0,class:"className",classID:1,className:1,cols:0,colSpan:1,content:0,contentEditable:1,contextMenu:1,controls:0,controlsList:1,coords:0,crossOrigin:1,dangerouslySetInnerHTML:1,data:0,dateTime:1,default:0,defaultChecked:1,defaultValue:1,defer:0,dir:0,disabled:0,disablePictureInPicture:1,disableRemotePlayback:1,download:0,draggable:0,encType:1,enterKeyHint:1,for:"htmlFor",form:0,formMethod:1,formAction:1,formEncType:1,formNoValidate:1,formTarget:1,frameBorder:1,headers:0,height:0,hidden:0,high:0,href:0,hrefLang:1,htmlFor:1,httpEquiv:1,"http-equiv":"httpEquiv",icon:0,id:0,innerHTML:1,inputMode:1,integrity:0,is:0,itemID:1,itemProp:1,itemRef:1,itemScope:1,itemType:1,keyParams:1,keyType:1,kind:0,label:0,lang:0,list:0,loop:0,low:0,manifest:0,marginWidth:1,marginHeight:1,max:0,maxLength:1,media:0,mediaGroup:1,method:0,min:0,minLength:1,multiple:0,muted:0,name:0,noModule:1,nonce:0,noValidate:1,open:0,optimum:0,pattern:0,placeholder:0,playsInline:1,poster:0,preload:0,profile:0,radioGroup:1,readOnly:1,referrerPolicy:1,rel:0,required:0,reversed:0,role:0,rows:0,rowSpan:1,sandbox:0,scope:0,scoped:0,scrolling:0,seamless:0,selected:0,shape:0,size:0,sizes:0,span:0,spellCheck:1,src:0,srcDoc:1,srcLang:1,srcSet:1,start:0,step:0,style:0,summary:0,tabIndex:1,target:0,title:0,type:0,useMap:1,value:0,width:0,wmode:0,wrap:0,about:0,accentHeight:1,"accent-height":"accentHeight",accumulate:0,additive:0,alignmentBaseline:1,"alignment-baseline":"alignmentBaseline",allowReorder:1,alphabetic:0,amplitude:0,arabicForm:1,"arabic-form":"arabicForm",ascent:0,attributeName:1,attributeType:1,autoReverse:1,azimuth:0,baseFrequency:1,baselineShift:1,"baseline-shift":"baselineShift",baseProfile:1,bbox:0,begin:0,bias:0,by:0,calcMode:1,capHeight:1,"cap-height":"capHeight",clip:0,clipPath:1,"clip-path":"clipPath",clipPathUnits:1,clipRule:1,"clip-rule":"clipRule",color:0,colorInterpolation:1,"color-interpolation":"colorInterpolation",colorInterpolationFilters:1,"color-interpolation-filters":"colorInterpolationFilters",colorProfile:1,"color-profile":"colorProfile",colorRendering:1,"color-rendering":"colorRendering",contentScriptType:1,contentStyleType:1,cursor:0,cx:0,cy:0,d:0,datatype:0,decelerate:0,descent:0,diffuseConstant:1,direction:0,display:0,divisor:0,dominantBaseline:1,"dominant-baseline":"dominantBaseline",dur:0,dx:0,dy:0,edgeMode:1,elevation:0,enableBackground:1,"enable-background":"enableBackground",end:0,exponent:0,externalResourcesRequired:1,fill:0,fillOpacity:1,"fill-opacity":"fillOpacity",fillRule:1,"fill-rule":"fillRule",filter:0,filterRes:1,filterUnits:1,floodOpacity:1,"flood-opacity":"floodOpacity",floodColor:1,"flood-color":"floodColor",focusable:0,fontFamily:1,"font-family":"fontFamily",fontSize:1,"font-size":"fontSize",fontSizeAdjust:1,"font-size-adjust":"fontSizeAdjust",fontStretch:1,"font-stretch":"fontStretch",fontStyle:1,"font-style":"fontStyle",fontVariant:1,"font-variant":"fontVariant",fontWeight:1,"font-weight":"fontWeight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:1,"glyph-name":"glyphName",glyphOrientationHorizontal:1,"glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphOrientationVertical:1,"glyph-orientation-vertical":"glyphOrientationVertical",glyphRef:1,gradientTransform:1,gradientUnits:1,hanging:0,horizAdvX:1,"horiz-adv-x":"horizAdvX",horizOriginX:1,"horiz-origin-x":"horizOriginX",ideographic:0,imageRendering:1,"image-rendering":"imageRendering",in2:0,in:0,inlist:0,intercept:0,k1:0,k2:0,k3:0,k4:0,k:0,kernelMatrix:1,kernelUnitLength:1,kerning:0,keyPoints:1,keySplines:1,keyTimes:1,lengthAdjust:1,letterSpacing:1,"letter-spacing":"letterSpacing",lightingColor:1,"lighting-color":"lightingColor",limitingConeAngle:1,local:0,markerEnd:1,"marker-end":"markerEnd",markerHeight:1,markerMid:1,"marker-mid":"markerMid",markerStart:1,"marker-start":"markerStart",markerUnits:1,markerWidth:1,mask:0,maskContentUnits:1,maskUnits:1,mathematical:0,mode:0,numOctaves:1,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:1,"overline-position":"overlinePosition",overlineThickness:1,"overline-thickness":"overlineThickness",paintOrder:1,"paint-order":"paintOrder",panose1:0,"panose-1":"panose1",pathLength:1,patternContentUnits:1,patternTransform:1,patternUnits:1,pointerEvents:1,"pointer-events":"pointerEvents",points:0,pointsAtX:1,pointsAtY:1,pointsAtZ:1,prefix:0,preserveAlpha:1,preserveAspectRatio:1,primitiveUnits:1,property:0,r:0,radius:0,refX:1,refY:1,renderingIntent:1,"rendering-intent":"renderingIntent",repeatCount:1,repeatDur:1,requiredExtensions:1,requiredFeatures:1,resource:0,restart:0,result:0,results:0,rotate:0,rx:0,ry:0,scale:0,security:0,seed:0,shapeRendering:1,"shape-rendering":"shapeRendering",slope:0,spacing:0,specularConstant:1,specularExponent:1,speed:0,spreadMethod:1,startOffset:1,stdDeviation:1,stemh:0,stemv:0,stitchTiles:1,stopColor:1,"stop-color":"stopColor",stopOpacity:1,"stop-opacity":"stopOpacity",strikethroughPosition:1,"strikethrough-position":"strikethroughPosition",strikethroughThickness:1,"strikethrough-thickness":"strikethroughThickness",string:0,stroke:0,strokeDasharray:1,"stroke-dasharray":"strokeDasharray",strokeDashoffset:1,"stroke-dashoffset":"strokeDashoffset",strokeLinecap:1,"stroke-linecap":"strokeLinecap",strokeLinejoin:1,"stroke-linejoin":"strokeLinejoin",strokeMiterlimit:1,"stroke-miterlimit":"strokeMiterlimit",strokeWidth:1,"stroke-width":"strokeWidth",strokeOpacity:1,"stroke-opacity":"strokeOpacity",suppressContentEditableWarning:1,suppressHydrationWarning:1,surfaceScale:1,systemLanguage:1,tableValues:1,targetX:1,targetY:1,textAnchor:1,"text-anchor":"textAnchor",textDecoration:1,"text-decoration":"textDecoration",textLength:1,textRendering:1,"text-rendering":"textRendering",to:0,transform:0,typeof:0,u1:0,u2:0,underlinePosition:1,"underline-position":"underlinePosition",underlineThickness:1,"underline-thickness":"underlineThickness",unicode:0,unicodeBidi:1,"unicode-bidi":"unicodeBidi",unicodeRange:1,"unicode-range":"unicodeRange",unitsPerEm:1,"units-per-em":"unitsPerEm",unselectable:0,vAlphabetic:1,"v-alphabetic":"vAlphabetic",values:0,vectorEffect:1,"vector-effect":"vectorEffect",version:0,vertAdvY:1,"vert-adv-y":"vertAdvY",vertOriginX:1,"vert-origin-x":"vertOriginX",vertOriginY:1,"vert-origin-y":"vertOriginY",vHanging:1,"v-hanging":"vHanging",vIdeographic:1,"v-ideographic":"vIdeographic",viewBox:1,viewTarget:1,visibility:0,vMathematical:1,"v-mathematical":"vMathematical",vocab:0,widths:0,wordSpacing:1,"word-spacing":"wordSpacing",writingMode:1,"writing-mode":"writingMode",x1:0,x2:0,x:0,xChannelSelector:1,xHeight:1,"x-height":"xHeight",xlinkActuate:1,"xlink:actuate":"xlinkActuate",xlinkArcrole:1,"xlink:arcrole":"xlinkArcrole",xlinkHref:1,"xlink:href":"xlinkHref",xlinkRole:1,"xlink:role":"xlinkRole",xlinkShow:1,"xlink:show":"xlinkShow",xlinkTitle:1,"xlink:title":"xlinkTitle",xlinkType:1,"xlink:type":"xlinkType",xmlBase:1,"xml:base":"xmlBase",xmlLang:1,"xml:lang":"xmlLang",xmlns:0,"xml:space":"xmlSpace",xmlnsXlink:1,"xmlns:xlink":"xmlnsXlink",xmlSpace:1,y1:0,y2:0,y:0,yChannelSelector:1,z:0,zoomAndPan:1}});var hz=Ce(Pl=>{"use strict";function bde(e){return Uo.hasOwnProperty(e)?Uo[e]:null}function Ua(e,t,r,a,n,i,l){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=a,this.attributeNamespace=n,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=l}var Uo={},yde=["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"];yde.forEach(e=>{Uo[e]=new Ua(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(([e,t])=>{Uo[e]=new Ua(e,1,!1,t,null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(e=>{Uo[e]=new Ua(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(e=>{Uo[e]=new Ua(e,2,!1,e,null,!1,!1)});["allowFullScreen","async","autoFocus","autoPlay","controls","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"].forEach(e=>{Uo[e]=new Ua(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(e=>{Uo[e]=new Ua(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(e=>{Uo[e]=new Ua(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(e=>{Uo[e]=new Ua(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(e=>{Uo[e]=new Ua(e,5,!1,e.toLowerCase(),null,!1,!1)});var aS=/[\-\:]([a-z])/g,nS=e=>e[1].toUpperCase();["accent-height","alignment-baseline","arabic-form","baseline-shift","cap-height","clip-path","clip-rule","color-interpolation","color-interpolation-filters","color-profile","color-rendering","dominant-baseline","enable-background","fill-opacity","fill-rule","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","glyph-name","glyph-orientation-horizontal","glyph-orientation-vertical","horiz-adv-x","horiz-origin-x","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","overline-position","overline-thickness","paint-order","panose-1","pointer-events","rendering-intent","shape-rendering","stop-color","stop-opacity","strikethrough-position","strikethrough-thickness","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-rendering","underline-position","underline-thickness","unicode-bidi","unicode-range","units-per-em","v-alphabetic","v-hanging","v-ideographic","v-mathematical","vector-effect","vert-adv-y","vert-origin-x","vert-origin-y","word-spacing","writing-mode","xmlns:xlink","x-height"].forEach(e=>{let t=e.replace(aS,nS);Uo[t]=new Ua(t,1,!1,e,null,!1,!1)});["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(e=>{let t=e.replace(aS,nS);Uo[t]=new Ua(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(e=>{let t=e.replace(aS,nS);Uo[t]=new Ua(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(e=>{Uo[e]=new Ua(e,1,!1,e.toLowerCase(),null,!1,!1)});var _de="xlinkHref";Uo[_de]=new Ua("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(e=>{Uo[e]=new Ua(e,1,!1,e.toLowerCase(),null,!0,!0)});var{CAMELCASE:xde,SAME:kde,possibleStandardNames:fz}=dz(),wde=":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",Cde=wde+"\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",Sde=RegExp.prototype.test.bind(new RegExp("^(data|aria)-["+Cde+"]*$")),Tde=Object.keys(fz).reduce((e,t)=>{let r=fz[t];return r===kde?e[t]=t:r===xde?e[t.toLowerCase()]=t:e[t]=r,e},{});Pl.BOOLEAN=3;Pl.BOOLEANISH_STRING=2;Pl.NUMERIC=5;Pl.OVERLOADED_BOOLEAN=4;Pl.POSITIVE_NUMERIC=6;Pl.RESERVED=0;Pl.STRING=1;Pl.getPropertyInfo=bde;Pl.isCustomAttribute=Sde;Pl.possibleStandardNames=Tde});var iS=Ce((qCe,gz)=>{gz.exports=window.React});var kz=Ce((ZCe,xz)=>{"use strict";var vz=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Pde=/\n/g,Bde=/^\s*/,Ide=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Nde=/^:\s*/,Ede=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Dde=/^[;\s]*/,Lde=/^\s+|\s+$/g,Mde=` `,bz="/",yz="*",pp="",Ade="comment",Rde="declaration";function zde(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var r=1,a=1;function n(h){var g=h.match(Pde);g&&(r+=g.length);var b=h.lastIndexOf(Mde);a=~b?h.length-b:a+h.length}function i(){var h={line:r,column:a};return function(g){return g.position=new l(h),u(),g}}function l(h){this.start=h,this.end={line:r,column:a},this.source=t.source}l.prototype.content=e;function s(h){var g=new Error(t.source+":"+r+":"+a+": "+h);if(g.reason=h,g.filename=t.source,g.line=r,g.column=a,g.source=e,!t.silent)throw g}function c(h){var g=h.exec(e);if(g){var b=g[0];return n(b),e=e.slice(b.length),g}}function u(){c(Bde)}function m(h){var g;for(h=h||[];g=p();)g!==!1&&h.push(g);return h}function p(){var h=i();if(!(bz!=e.charAt(0)||yz!=e.charAt(1))){for(var g=2;pp!=e.charAt(g)&&(yz!=e.charAt(g)||bz!=e.charAt(g+1));)++g;if(g+=2,pp===e.charAt(g-1))return s("End of comment missing");var b=e.slice(2,g-2);return a+=2,n(b),e=e.slice(g),a+=2,h({type:Ade,comment:b})}}function d(){var h=i(),g=c(Ide);if(g){if(p(),!c(Nde))return s("property missing ':'");var b=c(Ede),y=h({type:Rde,property:_z(g[0].replace(vz,pp)),value:b?_z(b[0].replace(vz,pp)):pp});return c(Dde),y}}function f(){var h=[];m(h);for(var g;g=d();)g!==!1&&(h.push(g),m(h));return h}return u(),f()}function _z(e){return e?e.replace(Lde,pp):pp}xz.exports=zde});var wz=Ce(v0=>{"use strict";var Vde=v0&&v0.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(v0,"__esModule",{value:!0});v0.default=Hde;var Fde=Vde(kz());function Hde(e,t){let r=null;if(!e||typeof e!="string")return r;let a=(0,Fde.default)(e),n=typeof t=="function";return a.forEach(i=>{if(i.type!=="declaration")return;let{property:l,value:s}=i;n?t(l,s,i):s&&(r=r||{},r[l]=s)}),r}});var Sz=Ce(Rb=>{"use strict";Object.defineProperty(Rb,"__esModule",{value:!0});Rb.camelCase=void 0;var Ode=/^--[a-zA-Z0-9_-]+$/,jde=/-([a-z])/g,Ude=/^[^-]+$/,Gde=/^-(webkit|moz|ms|o|khtml)-/,Wde=/^-(ms)-/,$de=function(e){return!e||Ude.test(e)||Ode.test(e)},qde=function(e,t){return t.toUpperCase()},Cz=function(e,t){return"".concat(t,"-")},Zde=function(e,t){return t===void 0&&(t={}),$de(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(Wde,Cz):e=e.replace(Gde,Cz),e.replace(jde,qde))};Rb.camelCase=Zde});var Pz=Ce((sS,Tz)=>{"use strict";var Kde=sS&&sS.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Qde=Kde(wz()),Yde=Sz();function lS(e,t){var r={};return!e||typeof e!="string"||(0,Qde.default)(e,function(a,n){a&&n&&(r[(0,Yde.camelCase)(a,t)]=n)}),r}lS.default=lS;Tz.exports=lS});var cS=Ce(Ga=>{"use strict";var Xde=Ga&&Ga.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ga,"__esModule",{value:!0});Ga.returnFirstArg=Ga.canTextBeChildOfNode=Ga.ELEMENTS_WITH_NO_TEXT_CHILDREN=Ga.PRESERVE_CUSTOM_ATTRIBUTES=void 0;Ga.isCustomComponent=rfe;Ga.setStyleProp=afe;var Jde=iS(),efe=Xde(Pz()),tfe=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]);function rfe(e,t){return e.includes("-")?!tfe.has(e):!!(t&&typeof t.is=="string")}var ofe={reactCompat:!0};function afe(e,t){if(typeof e=="string"){if(!e.trim()){t.style={};return}try{t.style=(0,efe.default)(e,ofe)}catch{t.style={}}}}Ga.PRESERVE_CUSTOM_ATTRIBUTES=Number(Jde.version.split(".")[0])>=16;Ga.ELEMENTS_WITH_NO_TEXT_CHILDREN=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]);var nfe=function(e){return!Ga.ELEMENTS_WITH_NO_TEXT_CHILDREN.has(e.name)};Ga.canTextBeChildOfNode=nfe;var ife=function(e){return e};Ga.returnFirstArg=ife});var mS=Ce(uS=>{"use strict";Object.defineProperty(uS,"__esModule",{value:!0});uS.default=ufe;var b0=hz(),Bz=cS(),lfe=["checked","value"],sfe=["input","select","textarea"],cfe={reset:!0,submit:!0};function ufe(e,t){e===void 0&&(e={});var r={},a=!!(e.type&&cfe[e.type]);for(var n in e){var i=e[n];if((0,b0.isCustomAttribute)(n)){r[n]=i;continue}var l=n.toLowerCase(),s=Iz(l);if(s){var c=(0,b0.getPropertyInfo)(s);switch(lfe.includes(s)&&sfe.includes(t)&&!a&&(s=Iz("default"+l)),r[s]=i,c&&c.type){case b0.BOOLEAN:r[s]=!0;break;case b0.OVERLOADED_BOOLEAN:i===""&&(r[s]=!0);break}continue}Bz.PRESERVE_CUSTOM_ATTRIBUTES&&(r[n]=i)}return(0,Bz.setStyleProp)(e.style,r),r}function Iz(e){return b0.possibleStandardNames[e]}});var Ez=Ce(_0=>{"use strict";var mfe=_0&&_0.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_0,"__esModule",{value:!0});_0.default=Nz;var pS=iS(),pfe=mfe(mS()),y0=cS(),dfe={cloneElement:pS.cloneElement,createElement:pS.createElement,isValidElement:pS.isValidElement};function Nz(e,t){t===void 0&&(t={});for(var r=[],a=typeof t.replace=="function",n=t.transform||y0.returnFirstArg,i=t.library||dfe,l=i.cloneElement,s=i.createElement,c=i.isValidElement,u=e.length,m=0;m<u;m++){var p=e[m];if(a){var d=t.replace(p,m);if(c(d)){u>1&&(d=l(d,{key:d.key||m})),r.push(n(d,p,m));continue}}if(p.type==="text"){var f=!p.data.trim().length;if(f&&p.parent&&!(0,y0.canTextBeChildOfNode)(p.parent)||t.trim&&f)continue;r.push(n(p.data,p,m));continue}var h=p,g={};ffe(h)?((0,y0.setStyleProp)(h.attribs.style,h.attribs),g=h.attribs):h.attribs&&(g=(0,pfe.default)(h.attribs,h.name));var b=void 0;switch(p.type){case"script":case"style":p.children[0]&&(g.dangerouslySetInnerHTML={__html:p.children[0].data});break;case"tag":p.name==="textarea"&&p.children[0]?g.defaultValue=p.children[0].data:p.children&&p.children.length&&(b=Nz(p.children,t));break;default:continue}u>1&&(g.key=m),r.push(n(s(p.name,g,b),p,m))}return r.length===1?r[0]:r}function ffe(e){return y0.PRESERVE_CUSTOM_ATTRIBUTES&&e.type==="tag"&&(0,y0.isCustomComponent)(e.name,e.attribs)}});var dS=Ce(or=>{"use strict";Object.defineProperty(or,"__esModule",{value:!0});or.Doctype=or.CDATA=or.Tag=or.Style=or.Script=or.Comment=or.Directive=or.Text=or.Root=or.isTag=or.ElementType=void 0;var oi;(function(e){e.Root="root",e.Text="text",e.Directive="directive",e.Comment="comment",e.Script="script",e.Style="style",e.Tag="tag",e.CDATA="cdata",e.Doctype="doctype"})(oi=or.ElementType||(or.ElementType={}));function hfe(e){return e.type===oi.Tag||e.type===oi.Script||e.type===oi.Style}or.isTag=hfe;or.Root=oi.Root;or.Text=oi.Text;or.Directive=oi.Directive;or.Comment=oi.Comment;or.Script=oi.Script;or.Style=oi.Style;or.Tag=oi.Tag;or.CDATA=oi.CDATA;or.Doctype=oi.Doctype});var vS=Ce(Ge=>{"use strict";var ju=Ge&&Ge.__extends||(function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,n){a.__proto__=n}||function(a,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(a[i]=n[i])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function a(){this.constructor=t}t.prototype=r===null?Object.create(r):(a.prototype=r.prototype,new a)}})(),x0=Ge&&Ge.__assign||function(){return x0=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},x0.apply(this,arguments)};Object.defineProperty(Ge,"__esModule",{value:!0});Ge.cloneNode=Ge.hasChildren=Ge.isDocument=Ge.isDirective=Ge.isComment=Ge.isText=Ge.isCDATA=Ge.isTag=Ge.Element=Ge.Document=Ge.CDATA=Ge.NodeWithChildren=Ge.ProcessingInstruction=Ge.Comment=Ge.Text=Ge.DataNode=Ge.Node=void 0;var Cn=dS(),hS=(function(){function e(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(e.prototype,"parentNode",{get:function(){return this.parent},set:function(t){this.parent=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"previousSibling",{get:function(){return this.prev},set:function(t){this.prev=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextSibling",{get:function(){return this.next},set:function(t){this.next=t},enumerable:!1,configurable:!0}),e.prototype.cloneNode=function(t){return t===void 0&&(t=!1),gS(this,t)},e})();Ge.Node=hS;var zb=(function(e){ju(t,e);function t(r){var a=e.call(this)||this;return a.data=r,a}return Object.defineProperty(t.prototype,"nodeValue",{get:function(){return this.data},set:function(r){this.data=r},enumerable:!1,configurable:!0}),t})(hS);Ge.DataNode=zb;var Dz=(function(e){ju(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=Cn.ElementType.Text,r}return Object.defineProperty(t.prototype,"nodeType",{get:function(){return 3},enumerable:!1,configurable:!0}),t})(zb);Ge.Text=Dz;var Lz=(function(e){ju(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=Cn.ElementType.Comment,r}return Object.defineProperty(t.prototype,"nodeType",{get:function(){return 8},enumerable:!1,configurable:!0}),t})(zb);Ge.Comment=Lz;var Mz=(function(e){ju(t,e);function t(r,a){var n=e.call(this,a)||this;return n.name=r,n.type=Cn.ElementType.Directive,n}return Object.defineProperty(t.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),t})(zb);Ge.ProcessingInstruction=Mz;var Vb=(function(e){ju(t,e);function t(r){var a=e.call(this)||this;return a.children=r,a}return Object.defineProperty(t.prototype,"firstChild",{get:function(){var r;return(r=this.children[0])!==null&&r!==void 0?r:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"childNodes",{get:function(){return this.children},set:function(r){this.children=r},enumerable:!1,configurable:!0}),t})(hS);Ge.NodeWithChildren=Vb;var Az=(function(e){ju(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=Cn.ElementType.CDATA,r}return Object.defineProperty(t.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),t})(Vb);Ge.CDATA=Az;var Rz=(function(e){ju(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=Cn.ElementType.Root,r}return Object.defineProperty(t.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),t})(Vb);Ge.Document=Rz;var zz=(function(e){ju(t,e);function t(r,a,n,i){n===void 0&&(n=[]),i===void 0&&(i=r==="script"?Cn.ElementType.Script:r==="style"?Cn.ElementType.Style:Cn.ElementType.Tag);var l=e.call(this,n)||this;return l.name=r,l.attribs=a,l.type=i,l}return Object.defineProperty(t.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tagName",{get:function(){return this.name},set:function(r){this.name=r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"attributes",{get:function(){var r=this;return Object.keys(this.attribs).map(function(a){var n,i;return{name:a,value:r.attribs[a],namespace:(n=r["x-attribsNamespace"])===null||n===void 0?void 0:n[a],prefix:(i=r["x-attribsPrefix"])===null||i===void 0?void 0:i[a]}})},enumerable:!1,configurable:!0}),t})(Vb);Ge.Element=zz;function Vz(e){return(0,Cn.isTag)(e)}Ge.isTag=Vz;function Fz(e){return e.type===Cn.ElementType.CDATA}Ge.isCDATA=Fz;function Hz(e){return e.type===Cn.ElementType.Text}Ge.isText=Hz;function Oz(e){return e.type===Cn.ElementType.Comment}Ge.isComment=Oz;function jz(e){return e.type===Cn.ElementType.Directive}Ge.isDirective=jz;function Uz(e){return e.type===Cn.ElementType.Root}Ge.isDocument=Uz;function gfe(e){return Object.prototype.hasOwnProperty.call(e,"children")}Ge.hasChildren=gfe;function gS(e,t){t===void 0&&(t=!1);var r;if(Hz(e))r=new Dz(e.data);else if(Oz(e))r=new Lz(e.data);else if(Vz(e)){var a=t?fS(e.children):[],n=new zz(e.name,x0({},e.attribs),a);a.forEach(function(c){return c.parent=n}),e.namespace!=null&&(n.namespace=e.namespace),e["x-attribsNamespace"]&&(n["x-attribsNamespace"]=x0({},e["x-attribsNamespace"])),e["x-attribsPrefix"]&&(n["x-attribsPrefix"]=x0({},e["x-attribsPrefix"])),r=n}else if(Fz(e)){var a=t?fS(e.children):[],i=new Az(a);a.forEach(function(u){return u.parent=i}),r=i}else if(Uz(e)){var a=t?fS(e.children):[],l=new Rz(a);a.forEach(function(u){return u.parent=l}),e["x-mode"]&&(l["x-mode"]=e["x-mode"]),r=l}else if(jz(e)){var s=new Mz(e.name,e.data);e["x-name"]!=null&&(s["x-name"]=e["x-name"],s["x-publicId"]=e["x-publicId"],s["x-systemId"]=e["x-systemId"]),r=s}else throw new Error("Not implemented yet: ".concat(e.type));return r.startIndex=e.startIndex,r.endIndex=e.endIndex,e.sourceCodeLocation!=null&&(r.sourceCodeLocation=e.sourceCodeLocation),r}Ge.cloneNode=gS;function fS(e){for(var t=e.map(function(a){return gS(a,!0)}),r=1;r<t.length;r++)t[r].prev=t[r-1],t[r-1].next=t[r];return t}});var $z=Ce(Ns=>{"use strict";var vfe=Ns&&Ns.__createBinding||(Object.create?(function(e,t,r,a){a===void 0&&(a=r);var n=Object.getOwnPropertyDescriptor(t,r);(!n||("get"in n?!t.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,a,n)}):(function(e,t,r,a){a===void 0&&(a=r),e[a]=t[r]})),bfe=Ns&&Ns.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&vfe(t,e,r)};Object.defineProperty(Ns,"__esModule",{value:!0});Ns.DomHandler=void 0;var bS=dS(),Uu=vS();bfe(vS(),Ns);var Gz={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},Wz=(function(){function e(t,r,a){this.dom=[],this.root=new Uu.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof r=="function"&&(a=r,r=Gz),typeof t=="object"&&(r=t,t=void 0),this.callback=t??null,this.options=r??Gz,this.elementCB=a??null}return e.prototype.onparserinit=function(t){this.parser=t},e.prototype.onreset=function(){this.dom=[],this.root=new Uu.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},e.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},e.prototype.onerror=function(t){this.handleCallback(t)},e.prototype.onclosetag=function(){this.lastNode=null;var t=this.tagStack.pop();this.options.withEndIndices&&(t.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(t)},e.prototype.onopentag=function(t,r){var a=this.options.xmlMode?bS.ElementType.Tag:void 0,n=new Uu.Element(t,r,void 0,a);this.addNode(n),this.tagStack.push(n)},e.prototype.ontext=function(t){var r=this.lastNode;if(r&&r.type===bS.ElementType.Text)r.data+=t,this.options.withEndIndices&&(r.endIndex=this.parser.endIndex);else{var a=new Uu.Text(t);this.addNode(a),this.lastNode=a}},e.prototype.oncomment=function(t){if(this.lastNode&&this.lastNode.type===bS.ElementType.Comment){this.lastNode.data+=t;return}var r=new Uu.Comment(t);this.addNode(r),this.lastNode=r},e.prototype.oncommentend=function(){this.lastNode=null},e.prototype.oncdatastart=function(){var t=new Uu.Text(""),r=new Uu.CDATA([t]);this.addNode(r),t.parent=r,this.lastNode=t},e.prototype.oncdataend=function(){this.lastNode=null},e.prototype.onprocessinginstruction=function(t,r){var a=new Uu.ProcessingInstruction(t,r);this.addNode(a)},e.prototype.handleCallback=function(t){if(typeof this.callback=="function")this.callback(t,this.dom);else if(t)throw t},e.prototype.addNode=function(t){var r=this.tagStack[this.tagStack.length-1],a=r.children[r.children.length-1];this.options.withStartIndices&&(t.startIndex=this.parser.startIndex),this.options.withEndIndices&&(t.endIndex=this.parser.endIndex),r.children.push(t),a&&(t.prev=a,a.next=t),t.parent=r,this.lastNode=null},e})();Ns.DomHandler=Wz;Ns.default=Wz});var _S=Ce(co=>{"use strict";var yS=co&&co.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(co,"__esModule",{value:!0});co.htmlToDOM=co.domToReact=co.attributesToProps=co.Text=co.ProcessingInstruction=co.Element=co.Comment=void 0;co.default=xfe;var qz=yS(pz());co.htmlToDOM=qz.default;var yfe=yS(mS());co.attributesToProps=yfe.default;var Zz=yS(Ez());co.domToReact=Zz.default;var Fb=$z();Object.defineProperty(co,"Comment",{enumerable:!0,get:function(){return Fb.Comment}});Object.defineProperty(co,"Element",{enumerable:!0,get:function(){return Fb.Element}});Object.defineProperty(co,"ProcessingInstruction",{enumerable:!0,get:function(){return Fb.ProcessingInstruction}});Object.defineProperty(co,"Text",{enumerable:!0,get:function(){return Fb.Text}});var _fe={lowerCaseAttributeNames:!1};function xfe(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");return e?(0,Zz.default)((0,qz.default)(e,t?.htmlparser2||_fe),t):[]}});var ai=Ce((n6e,Qz)=>{Qz.exports=window.wp.dom});var v=Ce((i6e,Yz)=>{Yz.exports=window.ReactJSXRuntime});var U=Ce((u6e,eV)=>{eV.exports=window.wp.element});var L=Ce((p6e,tV)=>{tV.exports=window.wp.primitives});var M=Ce((oPe,rV)=>{rV.exports=window.wp.components});var Rr=Ce((aPe,oV)=>{oV.exports=window.wp.blob});var Q=Ce((nPe,aV)=>{aV.exports=window.wp.coreData});var mr=Ce((tBe,FV)=>{FV.exports=window.wp.url});var Wo=Ce((aBe,GV)=>{GV.exports=window.wp.htmlEntities});var xr=Ce((gBe,aF)=>{aF.exports=window.wp.notices});var iF=Ce((_Be,nF)=>{nF.exports=window.wp.privateApis});var As=Ce((cIe,RF)=>{RF.exports=window.wp.keycodes});var Ff=Ce((fIe,FF)=>{FF.exports=window.wp.deprecated});var em=Ce((zIe,QF)=>{QF.exports=window.wp.richText});var Lk=Ce((BDe,WO)=>{WO.exports=window.wp.date});var G1=Ce((iLe,ij)=>{ij.exports=window.wp.apiFetch});var Yc=Ce((LMe,VU)=>{VU.exports=window.wp.hooks});var rv=Ce((XRe,D5)=>{var uW={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u1EA4:"A",\u1EAE:"A",\u1EB2:"A",\u1EB4:"A",\u1EB6:"A",\u00C6:"AE",\u1EA6:"A",\u1EB0:"A",\u0202:"A",\u1EA2:"A",\u1EA0:"A",\u1EA8:"A",\u1EAA:"A",\u1EAC:"A",\u00C7:"C",\u1E08:"C",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u1EBE:"E",\u1E16:"E",\u1EC0:"E",\u1E14:"E",\u1E1C:"E",\u0206:"E",\u1EBA:"E",\u1EBC:"E",\u1EB8:"E",\u1EC2:"E",\u1EC4:"E",\u1EC6:"E",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u1E2E:"I",\u020A:"I",\u1EC8:"I",\u1ECA:"I",\u00D0:"D",\u00D1:"N",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u1ED0:"O",\u1E4C:"O",\u1E52:"O",\u020E:"O",\u1ECE:"O",\u1ECC:"O",\u1ED4:"O",\u1ED6:"O",\u1ED8:"O",\u1EDC:"O",\u1EDE:"O",\u1EE0:"O",\u1EDA:"O",\u1EE2:"O",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u1EE6:"U",\u1EE4:"U",\u1EEC:"U",\u1EEE:"U",\u1EF0:"U",\u00DD:"Y",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u1EA5:"a",\u1EAF:"a",\u1EB3:"a",\u1EB5:"a",\u1EB7:"a",\u00E6:"ae",\u1EA7:"a",\u1EB1:"a",\u0203:"a",\u1EA3:"a",\u1EA1:"a",\u1EA9:"a",\u1EAB:"a",\u1EAD:"a",\u00E7:"c",\u1E09:"c",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u1EBF:"e",\u1E17:"e",\u1EC1:"e",\u1E15:"e",\u1E1D:"e",\u0207:"e",\u1EBB:"e",\u1EBD:"e",\u1EB9:"e",\u1EC3:"e",\u1EC5:"e",\u1EC7:"e",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u1E2F:"i",\u020B:"i",\u1EC9:"i",\u1ECB:"i",\u00F0:"d",\u00F1:"n",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u1ED1:"o",\u1E4D:"o",\u1E53:"o",\u020F:"o",\u1ECF:"o",\u1ECD:"o",\u1ED5:"o",\u1ED7:"o",\u1ED9:"o",\u1EDD:"o",\u1EDF:"o",\u1EE1:"o",\u1EDB:"o",\u1EE3:"o",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u1EE7:"u",\u1EE5:"u",\u1EED:"u",\u1EEF:"u",\u1EF1:"u",\u00FD:"y",\u00FF:"y",\u0100:"A",\u0101:"a",\u0102:"A",\u0103:"a",\u0104:"A",\u0105:"a",\u0106:"C",\u0107:"c",\u0108:"C",\u0109:"c",\u010A:"C",\u010B:"c",\u010C:"C",\u010D:"c",C\u0306:"C",c\u0306:"c",\u010E:"D",\u010F:"d",\u0110:"D",\u0111:"d",\u0112:"E",\u0113:"e",\u0114:"E",\u0115:"e",\u0116:"E",\u0117:"e",\u0118:"E",\u0119:"e",\u011A:"E",\u011B:"e",\u011C:"G",\u01F4:"G",\u011D:"g",\u01F5:"g",\u011E:"G",\u011F:"g",\u0120:"G",\u0121:"g",\u0122:"G",\u0123:"g",\u0124:"H",\u0125:"h",\u0126:"H",\u0127:"h",\u1E2A:"H",\u1E2B:"h",\u0128:"I",\u0129:"i",\u012A:"I",\u012B:"i",\u012C:"I",\u012D:"i",\u012E:"I",\u012F:"i",\u0130:"I",\u0131:"i",\u0132:"IJ",\u0133:"ij",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u1E30:"K",\u1E31:"k",K\u0306:"K",k\u0306:"k",\u0139:"L",\u013A:"l",\u013B:"L",\u013C:"l",\u013D:"L",\u013E:"l",\u013F:"L",\u0140:"l",\u0141:"l",\u0142:"l",\u1E3E:"M",\u1E3F:"m",M\u0306:"M",m\u0306:"m",\u0143:"N",\u0144:"n",\u0145:"N",\u0146:"n",\u0147:"N",\u0148:"n",\u0149:"n",N\u0306:"N",n\u0306:"n",\u014C:"O",\u014D:"o",\u014E:"O",\u014F:"o",\u0150:"O",\u0151:"o",\u0152:"OE",\u0153:"oe",P\u0306:"P",p\u0306:"p",\u0154:"R",\u0155:"r",\u0156:"R",\u0157:"r",\u0158:"R",\u0159:"r",R\u0306:"R",r\u0306:"r",\u0212:"R",\u0213:"r",\u015A:"S",\u015B:"s",\u015C:"S",\u015D:"s",\u015E:"S",\u0218:"S",\u0219:"s",\u015F:"s",\u0160:"S",\u0161:"s",\u0162:"T",\u0163:"t",\u021B:"t",\u021A:"T",\u0164:"T",\u0165:"t",\u0166:"T",\u0167:"t",T\u0306:"T",t\u0306:"t",\u0168:"U",\u0169:"u",\u016A:"U",\u016B:"u",\u016C:"U",\u016D:"u",\u016E:"U",\u016F:"u",\u0170:"U",\u0171:"u",\u0172:"U",\u0173:"u",\u0216:"U",\u0217:"u",V\u0306:"V",v\u0306:"v",\u0174:"W",\u0175:"w",\u1E82:"W",\u1E83:"w",X\u0306:"X",x\u0306:"x",\u0176:"Y",\u0177:"y",\u0178:"Y",Y\u0306:"Y",y\u0306:"y",\u0179:"Z",\u017A:"z",\u017B:"Z",\u017C:"z",\u017D:"Z",\u017E:"z",\u017F:"s",\u0192:"f",\u01A0:"O",\u01A1:"o",\u01AF:"U",\u01B0:"u",\u01CD:"A",\u01CE:"a",\u01CF:"I",\u01D0:"i",\u01D1:"O",\u01D2:"o",\u01D3:"U",\u01D4:"u",\u01D5:"U",\u01D6:"u",\u01D7:"U",\u01D8:"u",\u01D9:"U",\u01DA:"u",\u01DB:"U",\u01DC:"u",\u1EE8:"U",\u1EE9:"u",\u1E78:"U",\u1E79:"u",\u01FA:"A",\u01FB:"a",\u01FC:"AE",\u01FD:"ae",\u01FE:"O",\u01FF:"o",\u00DE:"TH",\u00FE:"th",\u1E54:"P",\u1E55:"p",\u1E64:"S",\u1E65:"s",X\u0301:"X",x\u0301:"x",\u0403:"\u0413",\u0453:"\u0433",\u040C:"\u041A",\u045C:"\u043A",A\u030B:"A",a\u030B:"a",E\u030B:"E",e\u030B:"e",I\u030B:"I",i\u030B:"i",\u01F8:"N",\u01F9:"n",\u1ED2:"O",\u1ED3:"o",\u1E50:"O",\u1E51:"o",\u1EEA:"U",\u1EEB:"u",\u1E80:"W",\u1E81:"w",\u1EF2:"Y",\u1EF3:"y",\u0200:"A",\u0201:"a",\u0204:"E",\u0205:"e",\u0208:"I",\u0209:"i",\u020C:"O",\u020D:"o",\u0210:"R",\u0211:"r",\u0214:"U",\u0215:"u",B\u030C:"B",b\u030C:"b",\u010C\u0323:"C",\u010D\u0323:"c",\u00CA\u030C:"E",\u00EA\u030C:"e",F\u030C:"F",f\u030C:"f",\u01E6:"G",\u01E7:"g",\u021E:"H",\u021F:"h",J\u030C:"J",\u01F0:"j",\u01E8:"K",\u01E9:"k",M\u030C:"M",m\u030C:"m",P\u030C:"P",p\u030C:"p",Q\u030C:"Q",q\u030C:"q",\u0158\u0329:"R",\u0159\u0329:"r",\u1E66:"S",\u1E67:"s",V\u030C:"V",v\u030C:"v",W\u030C:"W",w\u030C:"w",X\u030C:"X",x\u030C:"x",Y\u030C:"Y",y\u030C:"y",A\u0327:"A",a\u0327:"a",B\u0327:"B",b\u0327:"b",\u1E10:"D",\u1E11:"d",\u0228:"E",\u0229:"e",\u0190\u0327:"E",\u025B\u0327:"e",\u1E28:"H",\u1E29:"h",I\u0327:"I",i\u0327:"i",\u0197\u0327:"I",\u0268\u0327:"i",M\u0327:"M",m\u0327:"m",O\u0327:"O",o\u0327:"o",Q\u0327:"Q",q\u0327:"q",U\u0327:"U",u\u0327:"u",X\u0327:"X",x\u0327:"x",Z\u0327:"Z",z\u0327:"z",\u0439:"\u0438",\u0419:"\u0418",\u0451:"\u0435",\u0401:"\u0415"},mW=Object.keys(uW).join("|"),X1e=new RegExp(mW,"g"),J1e=new RegExp(mW,"");function eve(e){return uW[e]}var pW=function(e){return e.replace(X1e,eve)},tve=function(e){return!!e.match(J1e)};D5.exports=pW;D5.exports.has=tve;D5.exports.remove=pW});var Eq=Ce((pHe,Nq)=>{Nq.exports=window.wp.uploadMedia});var bv=Ce((FOe,DZ)=>{DZ.exports=window.wp.a11y});var cD=Ce((bWe,RY)=>{RY.exports=window.wp.escapeHtml});var wre=Ce((VXe,kre)=>{kre.exports=window.wp.wordcount});var Ene=Ce((Drt,Nne)=>{Nne.exports=window.wp.patterns});var kie=Ce((Vot,xie)=>{xie.exports=window.wp.autop});var Kse=Ce((_lt,Zse)=>{"use strict";Zse.exports=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var a,n,i;if(Array.isArray(t)){if(a=t.length,a!=r.length)return!1;for(n=a;n--!==0;)if(!e(t[n],r[n]))return!1;return!0}if(t instanceof Map&&r instanceof Map){if(t.size!==r.size)return!1;for(n of t.entries())if(!r.has(n[0]))return!1;for(n of t.entries())if(!e(n[1],r.get(n[0])))return!1;return!0}if(t instanceof Set&&r instanceof Set){if(t.size!==r.size)return!1;for(n of t.entries())if(!r.has(n[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(r)){if(a=t.length,a!=r.length)return!1;for(n=a;n--!==0;)if(t[n]!==r[n])return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(i=Object.keys(t),a=i.length,a!==Object.keys(r).length)return!1;for(n=a;n--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[n]))return!1;for(n=a;n--!==0;){var l=i[n];if(!e(t[l],r[l]))return!1}return!0}return t!==t&&r!==r}});var Npe=Ce((tpt,Ipe)=>{Ipe.exports=window.wp.keyboardShortcuts});var BCe={};Z(BCe,{__experimentalGetCoreBlocks:()=>Vpe,__experimentalRegisterExperimentalCoreBlocks:()=>PCe,privateApis:()=>PR,registerCoreBlocks:()=>TCe});var Cl=o(W(),1),Mpe=o(me(),1),Ape=o(V(),1),Rpe=o(T(),1),zpe=o(Fu(),1),yb=o(P(),1);function VR(e){var t,r,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var n=e.length;for(t=0;t<n;t++)e[t]&&(r=VR(e[t]))&&(a&&(a+=" "),a+=r)}else for(r in e)e[r]&&(a&&(a+=" "),a+=r);return a}function ede(){for(var e,t,r=0,a="",n=arguments.length;r<n;r++)(e=arguments[r])&&(t=VR(e))&&(a&&(a+=" "),a+=t);return a}var w=ede;var xS=o(_S(),1),Bl=o(_S(),1),Kz=xS.default.default||xS.default;var Xz=o(ai(),1),Jz=o(v(),1),kfe=({wrapperProps:e={},html:t=""})=>{let r={replace:({name:i,type:l,attribs:s,parent:c,children:u})=>{if(l==="tag"&&i){let m=(0,Bl.attributesToProps)(s||{}),p=i;if(!c){let d={...m,...e,className:w(m.className,e.className),style:{...m.style||{},...e.style||{}}};return(0,Jz.jsx)(p,{...d,children:(0,Bl.domToReact)(u,r)})}}}},a=(0,Xz.safeHTML)(t);return Kz(a,r)},uo=kfe;var GB={};Z(GB,{init:()=>Tfe,metadata:()=>Bx,name:()=>mV,settings:()=>pV});var UB=o(P(),1);var Hb=o(U(),1),Wa=(0,Hb.forwardRef)(({icon:e,size:t=24,...r},a)=>(0,Hb.cloneElement)(e,{width:t,height:t,...r,ref:a}));var k0=o(L(),1),w0=o(v(),1),kS=(0,w0.jsxs)(k0.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,w0.jsx)(k0.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M19.5 12.75L9.5 12.75L9.5 11.25L19.5 11.25L19.5 12.75Z"}),(0,w0.jsx)(k0.Path,{d:"M4.5 9.5L8.5 12L4.5 14.5L4.5 9.5Z"})]});var dp=o(L(),1),fp=o(v(),1),wS=(0,fp.jsxs)(dp.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,fp.jsx)(dp.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M19.5 9.5L9.5 9.5L9.5 8L19.5 8L19.5 9.5Z"}),(0,fp.jsx)(dp.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M19.5 13L9.5 13L9.5 11.5L19.5 11.5L19.5 13Z"}),(0,fp.jsx)(dp.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M19.5 16.3999L9.5 16.3999L9.5 14.8999L19.5 14.8999L19.5 16.3999Z"}),(0,fp.jsx)(dp.Path,{d:"M4.5 6.25L8.5 8.75L4.5 11.25L4.5 6.25Z"})]});var hp=o(L(),1),gp=o(v(),1),CS=(0,gp.jsxs)(hp.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,gp.jsx)(hp.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M19.5 9.25L9.5 9.25L9.5 7.75L19.5 7.75L19.5 9.25Z"}),(0,gp.jsx)(hp.Path,{d:"M4.5 6L8.5 8.5L4.5 11L4.5 6Z"}),(0,gp.jsx)(hp.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M19.5 16.25L9.5 16.25L9.5 14.75L19.5 14.75L19.5 16.25Z"}),(0,gp.jsx)(hp.Path,{d:"M4.5 13L8.5 15.5L4.5 18L4.5 13Z"})]});var Ob=o(L(),1),SS=o(v(),1),vp=(0,SS.jsx)(Ob.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,SS.jsx)(Ob.Path,{d:"M2 12c0 3.6 2.4 5.5 6 5.5h.5V19l3-2.5-3-2.5v2H8c-2.5 0-4.5-1.5-4.5-4s2-4.5 4.5-4.5h3.5V6H8c-3.6 0-6 2.4-6 6zm19.5-1h-8v1.5h8V11zm0 5h-8v1.5h8V16zm0-10h-8v1.5h8V6z"})});var jb=o(L(),1),TS=o(v(),1),PS=(0,TS.jsx)(jb.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,TS.jsx)(jb.Path,{d:"M7.5 5.5h9V4h-9v1.5Zm-3.5 7h16V11H4v1.5Zm3.5 7h9V18h-9v1.5Z"})});var Ub=o(L(),1),BS=o(v(),1),IS=(0,BS.jsx)(Ub.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,BS.jsx)(Ub.Path,{d:"M13 5.5H4V4h9v1.5Zm7 7H4V11h16v1.5Zm-7 7H4V18h9v1.5Z"})});var Gb=o(L(),1),NS=o(v(),1),ES=(0,NS.jsx)(Gb.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,NS.jsx)(Gb.Path,{d:"M19 5.5H5V4h14v1.5ZM19 20H5v-1.5h14V20ZM5 9h14v6H5V9Z"})});var Wb=o(L(),1),DS=o(v(),1),LS=(0,DS.jsx)(Wb.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,DS.jsx)(Wb.Path,{d:"M11.111 5.5H20V4h-8.889v1.5ZM4 12.5h16V11H4v1.5Zm7.111 7H20V18h-8.889v1.5Z"})});var $b=o(L(),1),MS=o(v(),1),AS=(0,MS.jsx)($b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,MS.jsx)($b.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M11.934 7.406a1 1 0 0 0 .914.594H19a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5h5.764a.5.5 0 0 1 .447.276l.723 1.63Zm1.064-1.216a.5.5 0 0 0 .462.31H19a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h5.764a2 2 0 0 1 1.789 1.106l.445 1.084ZM8.5 10.5h7V12h-7v-1.5Zm7 3.5h-7v1.5h7V14Z"})});var qb=o(L(),1),RS=o(v(),1),ni=(0,RS.jsx)(qb.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,RS.jsx)(qb.Path,{d:"M17.7 4.3c-1.2 0-2.8 0-3.8 1-.6.6-.9 1.5-.9 2.6V14c-.6-.6-1.5-1-2.5-1C8.6 13 7 14.6 7 16.5S8.6 20 10.5 20c1.5 0 2.8-1 3.3-2.3.5-.8.7-1.8.7-2.5V7.9c0-.7.2-1.2.5-1.6.6-.6 1.8-.6 2.8-.6h.3V4.3h-.4z"})});var Zb=o(L(),1),zS=o(v(),1),VS=(0,zS.jsx)(Zb.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,zS.jsx)(Zb.Path,{d:"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"})});var Kb=o(L(),1),FS=o(v(),1),C0=(0,FS.jsx)(Kb.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,FS.jsx)(Kb.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v3.5h-15V5c0-.3.2-.5.5-.5zm8 5.5h6.5v3.5H13V10zm-1.5 3.5h-7V10h7v3.5zm-7 5.5v-4h7v4.5H5c-.3 0-.5-.2-.5-.5zm14.5.5h-6V15h6.5v4c0 .3-.2.5-.5.5z"})});var Qb=o(L(),1),HS=o(v(),1),OS=(0,HS.jsx)(Qb.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,HS.jsx)(Qb.Path,{d:"M4 13.5h3v-3H4v3Zm6-3.5 2 2-2 2 1 1 3-3-3-3-1 1Zm7 .5v3h3v-3h-3Z"})});var Yb=o(L(),1),jS=o(v(),1),US=(0,jS.jsx)(Yb.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,jS.jsx)(Yb.Path,{d:"M8 12.5h8V11H8v1.5Z M19 6.5H5a2 2 0 0 0-2 2V15a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8.5a2 2 0 0 0-2-2ZM5 8h14a.5.5 0 0 1 .5.5V15a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V8.5A.5.5 0 0 1 5 8Z"})});var Xb=o(L(),1),GS=o(v(),1),WS=(0,GS.jsx)(Xb.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,GS.jsx)(Xb.Path,{d:"M14.5 17.5H9.5V16H14.5V17.5Z M14.5 8H9.5V6.5H14.5V8Z M7 3.5H17C18.1046 3.5 19 4.39543 19 5.5V9C19 10.1046 18.1046 11 17 11H7C5.89543 11 5 10.1046 5 9V5.5C5 4.39543 5.89543 3.5 7 3.5ZM17 5H7C6.72386 5 6.5 5.22386 6.5 5.5V9C6.5 9.27614 6.72386 9.5 7 9.5H17C17.2761 9.5 17.5 9.27614 17.5 9V5.5C17.5 5.22386 17.2761 5 17 5Z M7 13H17C18.1046 13 19 13.8954 19 15V18.5C19 19.6046 18.1046 20.5 17 20.5H7C5.89543 20.5 5 19.6046 5 18.5V15C5 13.8954 5.89543 13 7 13ZM17 14.5H7C6.72386 14.5 6.5 14.7239 6.5 15V18.5C6.5 18.7761 6.72386 19 7 19H17C17.2761 19 17.5 18.7761 17.5 18.5V15C17.5 14.7239 17.2761 14.5 17 14.5Z"})});var Jb=o(L(),1),$S=o(v(),1),S0=(0,$S.jsx)(Jb.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$S.jsx)(Jb.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V7h15v12zM9 10H7v2h2v-2zm0 4H7v2h2v-2zm4-4h-2v2h2v-2zm4 0h-2v2h2v-2zm-4 4h-2v2h2v-2zm4 0h-2v2h2v-2z"})});var ey=o(L(),1),qS=o(v(),1),ZS=(0,qS.jsx)(ey.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,qS.jsx)(ey.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M6 5.5h12a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H6a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5ZM4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6Zm4 10h2v-1.5H8V16Zm5 0h-2v-1.5h2V16Zm1 0h2v-1.5h-2V16Z"})});var ty=o(L(),1),KS=o(v(),1),Gu=(0,KS.jsx)(ty.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,KS.jsx)(ty.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M6 5.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM4 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2V6zm11-.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5h-3a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM13 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2h-3a2 2 0 01-2-2V6zm5 8.5h-3a.5.5 0 00-.5.5v3a.5.5 0 00.5.5h3a.5.5 0 00.5-.5v-3a.5.5 0 00-.5-.5zM15 13a2 2 0 00-2 2v3a2 2 0 002 2h3a2 2 0 002-2v-3a2 2 0 00-2-2h-3zm-9 1.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5v-3a.5.5 0 01.5-.5zM4 15a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2v-3z"})});var ry=o(L(),1),QS=o(v(),1),bp=(0,QS.jsx)(ry.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,QS.jsx)(ry.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})});var oy=o(L(),1),YS=o(v(),1),XS=(0,YS.jsx)(oy.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,YS.jsx)(oy.Path,{d:"m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z"})});var ay=o(L(),1),JS=o(v(),1),ny=(0,JS.jsx)(ay.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,JS.jsx)(ay.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})});var iy=o(L(),1),e9=o(v(),1),t9=(0,e9.jsx)(iy.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,e9.jsx)(iy.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"})});var ly=o(L(),1),r9=o(v(),1),sy=(0,r9.jsx)(ly.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,r9.jsx)(ly.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})});var cy=o(L(),1),o9=o(v(),1),T0=(0,o9.jsx)(cy.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o9.jsx)(cy.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})});var uy=o(L(),1),a9=o(v(),1),P0=(0,a9.jsx)(uy.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,a9.jsx)(uy.Path,{d:"M20 6H4c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5H4c-.3 0-.5-.2-.5-.5V8c0-.3.2-.5.5-.5h16c.3 0 .5.2.5.5v9zM10 10H8v2h2v-2zm-5 2h2v-2H5v2zm8-2h-2v2h2v-2zm-5 6h8v-2H8v2zm6-4h2v-2h-2v2zm3 0h2v-2h-2v2zm0 4h2v-2h-2v2zM5 16h2v-2H5v2z"})});var my=o(L(),1),n9=o(v(),1),yp=(0,n9.jsx)(my.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,n9.jsx)(my.Path,{d:"m13.06 12 6.47-6.47-1.06-1.06L12 10.94 5.53 4.47 4.47 5.53 10.94 12l-6.47 6.47 1.06 1.06L12 13.06l6.47 6.47 1.06-1.06L13.06 12Z"})});var py=o(L(),1),i9=o(v(),1),B0=(0,i9.jsx)(py.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i9.jsx)(py.Path,{d:"M20.8 10.7l-4.3-4.3-1.1 1.1 4.3 4.3c.1.1.1.3 0 .4l-4.3 4.3 1.1 1.1 4.3-4.3c.7-.8.7-1.9 0-2.6zM4.2 11.8l4.3-4.3-1-1-4.3 4.3c-.7.7-.7 1.8 0 2.5l4.3 4.3 1.1-1.1-4.3-4.3c-.2-.1-.2-.3-.1-.4z"})});var dy=o(L(),1),l9=o(v(),1),s9=(0,l9.jsx)(dy.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,l9.jsx)(dy.Path,{d:"M19 6H6c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zM6 17.5c-.3 0-.5-.2-.5-.5V8c0-.3.2-.5.5-.5h3v10H6zm13.5-.5c0 .3-.2.5-.5.5h-3v-10h3c.3 0 .5.2.5.5v9z"})});var fy=o(L(),1),c9=o(v(),1),u9=(0,c9.jsx)(fy.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c9.jsx)(fy.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M15 7.5h-5v10h5v-10Zm1.5 0v10H19a.5.5 0 0 0 .5-.5V8a.5.5 0 0 0-.5-.5h-2.5ZM6 7.5h2.5v10H6a.5.5 0 0 1-.5-.5V8a.5.5 0 0 1 .5-.5ZM6 6h13a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2Z"})});var hy=o(L(),1),m9=o(v(),1),I0=(0,m9.jsx)(hy.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,m9.jsx)(hy.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M7.25 16.437a6.5 6.5 0 1 1 9.5 0V16A2.75 2.75 0 0 0 14 13.25h-4A2.75 2.75 0 0 0 7.25 16v.437Zm1.5 1.193a6.47 6.47 0 0 0 3.25.87 6.47 6.47 0 0 0 3.25-.87V16c0-.69-.56-1.25-1.25-1.25h-4c-.69 0-1.25.56-1.25 1.25v1.63ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm10-2a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z"})});var _p=o(L(),1),Tf=o(v(),1),p9=(0,Tf.jsxs)(_p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,Tf.jsx)(_p.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M18 4H6c-1.1 0-2 .9-2 2v12.9c0 .6.5 1.1 1.1 1.1.3 0 .5-.1.8-.3L8.5 17H18c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5H7.9l-2.4 2.4V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v9z"}),(0,Tf.jsx)(_p.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M15 15V15C15 13.8954 14.1046 13 13 13L11 13C9.89543 13 9 13.8954 9 15V15"}),(0,Tf.jsx)(_p.Circle,{cx:"12",cy:"9",r:"2",fillRule:"evenodd",clipRule:"evenodd"})]});var gy=o(L(),1),d9=o(v(),1),f9=(0,d9.jsx)(gy.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,d9.jsx)(gy.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M6.68822 16.625L5.5 17.8145L5.5 5.5L18.5 5.5L18.5 16.625L6.68822 16.625ZM7.31 18.125L19 18.125C19.5523 18.125 20 17.6773 20 17.125L20 5C20 4.44772 19.5523 4 19 4H5C4.44772 4 4 4.44772 4 5V19.5247C4 19.8173 4.16123 20.086 4.41935 20.2237C4.72711 20.3878 5.10601 20.3313 5.35252 20.0845L7.31 18.125ZM16 9.99997H8V8.49997H16V9.99997ZM8 14H13V12.5H8V14Z"})});var vy=o(L(),1),h9=o(v(),1),g9=(0,h9.jsx)(vy.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,h9.jsx)(vy.Path,{d:"m6.249 11.065.44-.44h3.186l-1.5 1.5H7.31l-1.957 1.96A.792.792 0 0 1 4 13.524V5a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v1.5L12.5 8V5.5h-7v6.315l.749-.75ZM20 19.75H7v-1.5h13v1.5Zm0-12.653-8.967 9.064L8 17l.867-2.935L17.833 5 20 7.097Z"})});var by=o(L(),1),v9=o(v(),1),b9=(0,v9.jsx)(by.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,v9.jsx)(by.Path,{d:"M6.68822 10.625L6.24878 11.0649L5.5 11.8145L5.5 5.5L12.5 5.5V8L14 6.5V5C14 4.44772 13.5523 4 13 4H5C4.44772 4 4 4.44771 4 5V13.5247C4 13.8173 4.16123 14.086 4.41935 14.2237C4.72711 14.3878 5.10601 14.3313 5.35252 14.0845L7.31 12.125H8.375L9.875 10.625H7.31H6.68822ZM14.5605 10.4983L11.6701 13.75H16.9975C17.9963 13.75 18.7796 14.1104 19.3553 14.7048C19.9095 15.2771 20.2299 16.0224 20.4224 16.7443C20.7645 18.0276 20.7543 19.4618 20.7487 20.2544C20.7481 20.345 20.7475 20.4272 20.7475 20.4999L19.2475 20.5001C19.2475 20.4191 19.248 20.3319 19.2484 20.2394V20.2394C19.2526 19.4274 19.259 18.2035 18.973 17.1307C18.8156 16.5401 18.586 16.0666 18.2778 15.7483C17.9909 15.4521 17.5991 15.25 16.9975 15.25H11.8106L14.5303 17.9697L13.4696 19.0303L8.96956 14.5303L13.4394 9.50171L14.5605 10.4983Z"})});var yy=o(L(),1),y9=o(v(),1),N0=(0,y9.jsx)(yy.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,y9.jsx)(yy.Path,{d:"M18 4H6c-1.1 0-2 .9-2 2v12.9c0 .6.5 1.1 1.1 1.1.3 0 .5-.1.8-.3L8.5 17H18c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5H7.9l-2.4 2.4V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v9z"})});var _y=o(L(),1),_9=o(v(),1),E0=(0,_9.jsx)(_y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_9.jsx)(_y.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M8.10417 6.00024H6.5C5.39543 6.00024 4.5 6.89567 4.5 8.00024V10.3336H6V8.00024C6 7.7241 6.22386 7.50024 6.5 7.50024H8.10417V6.00024ZM4.5 13.6669V16.0002C4.5 17.1048 5.39543 18.0002 6.5 18.0002H8.10417V16.5002H6.5C6.22386 16.5002 6 16.2764 6 16.0002V13.6669H4.5ZM10.3958 6.00024V7.50024H13.6042V6.00024H10.3958ZM15.8958 6.00024V7.50024H17.5C17.7761 7.50024 18 7.7241 18 8.00024V10.3336H19.5V8.00024C19.5 6.89567 18.6046 6.00024 17.5 6.00024H15.8958ZM19.5 13.6669H18V16.0002C18 16.2764 17.7761 16.5002 17.5 16.5002H15.8958V18.0002H17.5C18.6046 18.0002 19.5 17.1048 19.5 16.0002V13.6669ZM13.6042 18.0002V16.5002H10.3958V18.0002H13.6042Z"})});var xy=o(L(),1),x9=o(v(),1),xp=(0,x9.jsx)(xy.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,x9.jsx)(xy.Path,{d:"M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h6.2v8.9l2.5-3.1 2.5 3.1V4.5h2.2c.4 0 .8.4.8.8v13.4z"})});var ky=o(L(),1),k9=o(v(),1),D0=(0,k9.jsx)(ky.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,k9.jsx)(ky.Path,{d:"M18 20v-2h2v-1.5H7.75a.25.25 0 0 1-.25-.25V4H6v2H4v1.5h2v8.75c0 .966.784 1.75 1.75 1.75h8.75v2H18ZM9.273 7.5h6.977a.25.25 0 0 1 .25.25v6.977H18V7.75A1.75 1.75 0 0 0 16.25 6H9.273v1.5Z"})});var wy=o(L(),1),w9=o(v(),1),L0=(0,w9.jsx)(wy.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,w9.jsx)(wy.Path,{d:"M12.5 14.5h-1V16h1c2.2 0 4-1.8 4-4s-1.8-4-4-4h-1v1.5h1c1.4 0 2.5 1.1 2.5 2.5s-1.1 2.5-2.5 2.5zm-4 1.5v-1.5h-1C6.1 14.5 5 13.4 5 12s1.1-2.5 2.5-2.5h1V8h-1c-2.2 0-4 1.8-4 4s1.8 4 4 4h1zm-1-3.2h5v-1.5h-5v1.5zM18 4H9c-1.1 0-2 .9-2 2v.5h1.5V6c0-.3.2-.5.5-.5h9c.3 0 .5.2.5.5v12c0 .3-.2.5-.5.5H9c-.3 0-.5-.2-.5-.5v-.5H7v.5c0 1.1.9 2 2 2h9c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2z"})});var Cy=o(L(),1),C9=o(v(),1),S9=(0,C9.jsx)(Cy.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,C9.jsx)(Cy.Path,{d:"M4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4zm.8-4l.7.7 2-2V12h1V9.2l2 2 .7-.7-2-2H12v-1H9.2l2-2-.7-.7-2 2V4h-1v2.8l-2-2-.7.7 2 2H4v1h2.8l-2 2z"})});var M0=o(L(),1),A0=o(v(),1),T9=(0,A0.jsxs)(M0.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,A0.jsx)(M0.Path,{d:"M4 16h10v1.5H4V16Zm0-4.5h16V13H4v-1.5ZM10 7h10v1.5H10V7Z",fillRule:"evenodd",clipRule:"evenodd"}),(0,A0.jsx)(M0.Path,{d:"m4 5.25 4 2.5-4 2.5v-5Z"})]});var Sy=o(L(),1),P9=o(v(),1),B9=(0,P9.jsx)(Sy.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,P9.jsx)(Sy.Path,{d:"M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z"})});var Ty=o(L(),1),I9=o(v(),1),R0=(0,I9.jsx)(Ty.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,I9.jsx)(Ty.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12.848 8a1 1 0 0 1-.914-.594l-.723-1.63a.5.5 0 0 0-.447-.276H5a.5.5 0 0 0-.5.5v11.5a.5.5 0 0 0 .5.5h14a.5.5 0 0 0 .5-.5v-9A.5.5 0 0 0 19 8h-6.152Zm.612-1.5a.5.5 0 0 1-.462-.31l-.445-1.084A2 2 0 0 0 10.763 4H5a2 2 0 0 0-2 2v11.5a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-9a2 2 0 0 0-2-2h-5.54Z"})});var Py=o(L(),1),N9=o(v(),1),E9=(0,N9.jsx)(Py.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,N9.jsx)(Py.Path,{fillRule:"evenodd",d:"M18 5.5h-8v8h8.5V6a.5.5 0 00-.5-.5zm-9.5 8h-3V6a.5.5 0 01.5-.5h2.5v8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})});var By=o(L(),1),D9=o(v(),1),L9=(0,D9.jsx)(By.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,D9.jsx)(By.Path,{d:"M20 5.5H4V4H20V5.5ZM12 12.5H4V11H12V12.5ZM20 20V18.5H4V20H20ZM20.0303 9.03033L17.0607 12L20.0303 14.9697L18.9697 16.0303L15.4697 12.5303L14.9393 12L15.4697 11.4697L18.9697 7.96967L20.0303 9.03033Z"})});var Iy=o(L(),1),M9=o(v(),1),A9=(0,M9.jsx)(Iy.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,M9.jsx)(Iy.Path,{d:"M4 7.2v1.5h16V7.2H4zm8 8.6h8v-1.5h-8v1.5zm-8-3.5l3 3-3 3 1 1 4-4-4-4-1 1z"})});var Ny=o(L(),1),R9=o(v(),1),z0=(0,R9.jsx)(Ny.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,R9.jsx)(Ny.Path,{d:"M4 8.8h8.9V7.2H4v1.6zm0 7h8.9v-1.5H4v1.5zM18 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"})});var Ey=o(L(),1),z9=o(v(),1),V0=(0,z9.jsx)(Ey.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,z9.jsx)(Ey.Path,{d:"M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM6 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-7c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})});var Dy=o(L(),1),V9=o(v(),1),F0=(0,V9.jsx)(Dy.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,V9.jsx)(Dy.Path,{d:"M3.8 15.8h8.9v-1.5H3.8v1.5zm0-7h8.9V7.2H3.8v1.6zm14.7-2.1V10h1V5.3l-2.2.7.3 1 .9-.3zm1.2 6.1c-.5-.6-1.2-.5-1.7-.4-.3.1-.5.2-.7.3l.1 1.1c.2-.2.5-.4.8-.5.3-.1.6 0 .7.1.2.3 0 .8-.2 1.1-.5.8-.9 1.6-1.4 2.5H20v-1h-.9c.3-.6.8-1.4.9-2.1 0-.3 0-.8-.3-1.1z"})});var Ly=o(L(),1),F9=o(v(),1),Ki=(0,F9.jsx)(Ly.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,F9.jsx)(Ly.Path,{d:"M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM5 6.7V10h1V5.3L3.8 6l.4 1 .8-.3zm-.4 5.7c-.3.1-.5.2-.7.3l.1 1.1c.2-.2.5-.4.8-.5.3-.1.6 0 .7.1.2.3 0 .8-.2 1.1-.5.8-.9 1.6-1.4 2.5h2.7v-1h-1c.3-.6.8-1.4.9-2.1.1-.3 0-.8-.2-1.1-.5-.6-1.3-.5-1.7-.4z"})});var My=o(L(),1),H9=o(v(),1),O9=(0,H9.jsx)(My.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,H9.jsx)(My.Path,{d:"M3 9c0 2.8 2.2 5 5 5v-.2V20h1.5V5.5H12V20h1.5V5.5h3V4H8C5.2 4 3 6.2 3 9Zm15.9-1-1.1 1 2.6 3-2.6 3 1.1 1 3.4-4-3.4-4Z"})});var Ay=o(L(),1),j9=o(v(),1),H0=(0,j9.jsx)(Ay.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,j9.jsx)(Ay.Path,{d:"M20 5.5H4V4H20V5.5ZM12 12.5H4V11H12V12.5ZM20 20V18.5H4V20H20ZM15.4697 14.9697L18.4393 12L15.4697 9.03033L16.5303 7.96967L20.0303 11.4697L20.5607 12L20.0303 12.5303L16.5303 16.0303L15.4697 14.9697Z"})});var Ry=o(L(),1),U9=o(v(),1),O0=(0,U9.jsx)(Ry.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U9.jsx)(Ry.Path,{d:"M4 7.2v1.5h16V7.2H4zm8 8.6h8v-1.5h-8v1.5zm-4-4.6l-4 4 4 4 1-1-3-3 3-3-1-1z"})});var zy=o(L(),1),G9=o(v(),1),kp=(0,G9.jsx)(zy.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,G9.jsx)(zy.Path,{d:"M6 4a2 2 0 0 0-2 2v3h1.5V6a.5.5 0 0 1 .5-.5h3V4H6Zm3 14.5H6a.5.5 0 0 1-.5-.5v-3H4v3a2 2 0 0 0 2 2h3v-1.5Zm6 1.5v-1.5h3a.5.5 0 0 0 .5-.5v-3H20v3a2 2 0 0 1-2 2h-3Zm3-16a2 2 0 0 1 2 2v3h-1.5V6a.5.5 0 0 0-.5-.5h-3V4h3Z"})});var Vy=o(L(),1),W9=o(v(),1),j0=(0,W9.jsx)(Vy.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,W9.jsx)(Vy.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M16.375 4.5H4.625a.125.125 0 0 0-.125.125v8.254l2.859-1.54a.75.75 0 0 1 .68-.016l2.384 1.142 2.89-2.074a.75.75 0 0 1 .874 0l2.313 1.66V4.625a.125.125 0 0 0-.125-.125Zm.125 9.398-2.75-1.975-2.813 2.02a.75.75 0 0 1-.76.067l-2.444-1.17L4.5 14.583v1.792c0 .069.056.125.125.125h11.75a.125.125 0 0 0 .125-.125v-2.477ZM4.625 3C3.728 3 3 3.728 3 4.625v11.75C3 17.273 3.728 18 4.625 18h11.75c.898 0 1.625-.727 1.625-1.625V4.625C18 3.728 17.273 3 16.375 3H4.625ZM20 8v11c0 .69-.31 1-.999 1H6v1.5h13.001c1.52 0 2.499-.982 2.499-2.5V8H20Z"})});var Fy=o(L(),1),$9=o(v(),1),Il=(0,$9.jsx)(Fy.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$9.jsx)(Fy.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"m3 5c0-1.10457.89543-2 2-2h13.5c1.1046 0 2 .89543 2 2v13.5c0 1.1046-.8954 2-2 2h-13.5c-1.10457 0-2-.8954-2-2zm2-.5h6v6.5h-6.5v-6c0-.27614.22386-.5.5-.5zm-.5 8v6c0 .2761.22386.5.5.5h6v-6.5zm8 0v6.5h6c.2761 0 .5-.2239.5-.5v-6zm0-8v6.5h6.5v-6c0-.27614-.2239-.5-.5-.5z"})});var Hy=o(L(),1),q9=o(v(),1),wp=(0,q9.jsx)(Hy.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,q9.jsx)(Hy.Path,{d:"M18 4h-7c-1.1 0-2 .9-2 2v3H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-3h3c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h3V13c0 1.1.9 2 2 2h2.5v3zm0-4.5H11c-.3 0-.5-.2-.5-.5v-2.5H13c.3 0 .5.2.5.5v2.5zm5-.5c0 .3-.2.5-.5.5h-3V11c0-1.1-.9-2-2-2h-2.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7z"})});var Oy=o(L(),1),Z9=o(v(),1),K9=(0,Z9.jsx)(Oy.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Z9.jsx)(Oy.Path,{d:"M18.5 10.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 jy=o(L(),1),Q9=o(v(),1),Y9=(0,Q9.jsx)(jy.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Q9.jsx)(jy.Path,{d:"M17.6 7c-.6.9-1.5 1.7-2.6 2v1h2v7h2V7h-1.4zM11 11H7V7H5v10h2v-4h4v4h2V7h-2v4z"})});var Uy=o(L(),1),X9=o(v(),1),J9=(0,X9.jsx)(Uy.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,X9.jsx)(Uy.Path,{d:"M9 11.1H5v-4H3v10h2v-4h4v4h2v-10H9v4zm8 4c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6v1.5h8v-2H17z"})});var Gy=o(L(),1),eT=o(v(),1),tT=(0,eT.jsx)(Gy.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,eT.jsx)(Gy.Path,{d:"M9 11H5V7H3v10h2v-4h4v4h2V7H9v4zm11.3 1.7c-.4-.4-1-.7-1.6-.8v-.1c.6-.2 1.1-.5 1.5-.9.3-.4.5-.8.5-1.3 0-.4-.1-.8-.3-1.1-.2-.3-.5-.6-.8-.8-.4-.2-.8-.4-1.2-.5-.6-.1-1.1-.2-1.6-.2-.6 0-1.3.1-1.8.3s-1.1.5-1.6.9l1.2 1.4c.4-.2.7-.4 1.1-.6.3-.2.7-.3 1.1-.3.4 0 .8.1 1.1.3.3.2.4.5.4.8 0 .4-.2.7-.6.9-.7.3-1.5.5-2.2.4v1.6c.5 0 1 0 1.5.1.3.1.7.2 1 .3.2.1.4.2.5.4s.1.4.1.6c0 .3-.2.7-.5.8-.4.2-.9.3-1.4.3s-1-.1-1.4-.3c-.4-.2-.8-.4-1.2-.7L13 15.6c.5.4 1 .8 1.6 1 .7.3 1.5.4 2.3.4.6 0 1.1-.1 1.6-.2.4-.1.9-.2 1.3-.5.4-.2.7-.5.9-.9.2-.4.3-.8.3-1.2 0-.6-.3-1.1-.7-1.5z"})});var Wy=o(L(),1),rT=o(v(),1),oT=(0,rT.jsx)(Wy.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,rT.jsx)(Wy.Path,{d:"M20 13V7h-3l-4 6v2h5v2h2v-2h1v-2h-1zm-2 0h-2.8L18 9v4zm-9-2H5V7H3v10h2v-4h4v4h2V7H9v4z"})});var $y=o(L(),1),aT=o(v(),1),nT=(0,aT.jsx)($y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,aT.jsx)($y.Path,{d:"M9 11H5V7H3v10h2v-4h4v4h2V7H9v4zm11.7 1.2c-.2-.3-.5-.7-.8-.9-.3-.3-.7-.5-1.1-.6-.5-.1-.9-.2-1.4-.2-.2 0-.5.1-.7.1-.2.1-.5.1-.7.2l.1-1.9h4.3V7H14l-.3 5 1 .6.5-.2.4-.1c.1-.1.3-.1.4-.1h.5c.5 0 1 .1 1.4.4.4.2.6.7.6 1.1 0 .4-.2.8-.6 1.1-.4.3-.9.4-1.4.4-.4 0-.9-.1-1.3-.3-.4-.2-.7-.4-1.1-.7 0 0-1.1 1.4-1 1.5.5.4 1 .8 1.6 1 .7.3 1.5.4 2.3.4.5 0 1-.1 1.5-.3s.9-.4 1.3-.7c.4-.3.7-.7.9-1.1s.3-.9.3-1.4-.1-1-.3-1.4z"})});var qy=o(L(),1),iT=o(v(),1),lT=(0,iT.jsx)(qy.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,iT.jsx)(qy.Path,{d:"M20.7 12.4c-.2-.3-.4-.6-.7-.9s-.6-.5-1-.6c-.4-.2-.8-.2-1.2-.2-.5 0-.9.1-1.3.3s-.8.5-1.2.8c0-.5 0-.9.2-1.4l.6-.9c.2-.2.5-.4.8-.5.6-.2 1.3-.2 1.9 0 .3.1.6.3.8.5 0 0 1.3-1.3 1.3-1.4-.4-.3-.9-.6-1.4-.8-.6-.2-1.3-.3-2-.3-.6 0-1.1.1-1.7.4-.5.2-1 .5-1.4.9-.4.4-.8 1-1 1.6-.3.7-.4 1.5-.4 2.3s.1 1.5.3 2.1c.2.6.6 1.1 1 1.5.4.4.9.7 1.4.9 1 .3 2 .3 3 0 .4-.1.8-.3 1.2-.6.3-.3.6-.6.8-1 .2-.5.3-.9.3-1.4s-.1-.9-.3-1.3zm-2 2.1c-.1.2-.3.4-.4.5-.1.1-.3.2-.5.2-.2.1-.4.1-.6.1-.2.1-.5 0-.7-.1-.2 0-.3-.2-.5-.3-.1-.2-.3-.4-.4-.6-.2-.3-.3-.7-.3-1 .3-.3.6-.5 1-.7.3-.1.7-.2 1-.2.4 0 .8.1 1.1.3.3.3.4.7.4 1.1 0 .2 0 .5-.1.7zM9 11H5V7H3v10h2v-4h4v4h2V7H9v4z"})});var Zy=o(L(),1),sT=o(v(),1),cT=(0,sT.jsx)(Zy.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,sT.jsx)(Zy.Path,{d:"M6 5V18.5911L12 13.8473L18 18.5911V5H6Z"})});var Ky=o(L(),1),uT=o(v(),1),mT=(0,uT.jsx)(Ky.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,uT.jsx)(Ky.Path,{d:"M12 4L4 7.9V20h16V7.9L12 4zm6.5 14.5H14V13h-4v5.5H5.5V8.8L12 5.7l6.5 3.1v9.7z"})});var Qy=o(L(),1),pT=o(v(),1),dT=(0,pT.jsx)(Qy.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,pT.jsx)(Qy.Path,{d:"M4.8 11.4H2.1V9H1v6h1.1v-2.6h2.7V15h1.1V9H4.8v2.4zm1.9-1.3h1.7V15h1.1v-4.9h1.7V9H6.7v1.1zM16.2 9l-1.5 2.7L13.3 9h-.9l-.8 6h1.1l.5-4 1.5 2.8 1.5-2.8.5 4h1.1L17 9h-.8zm3.8 5V9h-1.1v6h3.6v-1H20z"})});var Yy=o(L(),1),fT=o(v(),1),Wu=(0,fT.jsx)(Yy.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,fT.jsx)(Yy.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v8.4l-3-2.9c-.3-.3-.8-.3-1 0L11.9 14 9 12c-.3-.2-.6-.2-.8 0l-3.6 2.6V5c-.1-.3.1-.5.4-.5zm14 15H5c-.3 0-.5-.2-.5-.5v-2.4l4.1-3 3 1.9c.3.2.7.2.9-.1L16 12l3.5 3.4V19c0 .3-.2.5-.5.5z"})});var Xy=o(L(),1),hT=o(v(),1),gT=(0,hT.jsx)(Xy.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,hT.jsx)(Xy.Path,{d:"m6.734 16.106 2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.158 1.093-1.028-2.176-2.38h2.811c1.125 0 2.25.03 3.374 0 1.428-.001 3.362-.25 4.963-1.277 1.66-1.065 2.868-2.906 2.868-5.859 0-2.479-1.327-4.896-3.65-5.93-1.82-.813-3.044-.8-4.806-.788l-.567.002v1.5c.184 0 .368 0 .553-.002 1.82-.007 2.704-.014 4.21.657 1.854.827 2.76 2.657 2.76 4.561 0 2.472-.973 3.824-2.178 4.596-1.258.807-2.864 1.04-4.163 1.04h-.02c-1.115.03-2.229 0-3.344 0H6.734Z"})});var Jy=o(L(),1),vT=o(v(),1),Cp=(0,vT.jsx)(Jy.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,vT.jsx)(Jy.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 e_=o(L(),1),bT=o(v(),1),U0=(0,bT.jsx)(e_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,bT.jsx)(e_.Path,{d:"M17.031 4.703 15.576 4l-1.56 3H14v.03l-2.324 4.47H9.5V13h1.396l-1.502 2.889h-.95a3.694 3.694 0 0 1 0-7.389H10V7H8.444a5.194 5.194 0 1 0 0 10.389h.17L7.5 19.53l1.416.719L15.049 8.5h.507a3.694 3.694 0 0 1 0 7.39H14v1.5h1.556a5.194 5.194 0 0 0 .273-10.383l1.202-2.304Z"})});var t_=o(L(),1),yT=o(v(),1),ii=(0,yT.jsx)(t_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,yT.jsx)(t_.Path,{d:"M10 17.389H8.444A5.194 5.194 0 1 1 8.444 7H10v1.5H8.444a3.694 3.694 0 0 0 0 7.389H10v1.5ZM14 7h1.556a5.194 5.194 0 0 1 0 10.39H14v-1.5h1.556a3.694 3.694 0 0 0 0-7.39H14V7Zm-4.5 6h5v-1.5h-5V13Z"})});var r_=o(L(),1),_T=o(v(),1),xT=(0,_T.jsx)(r_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_T.jsx)(r_.Path,{d:"M12 11v1.5h8V11h-8zm-6-1c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})});var o_=o(L(),1),kT=o(v(),1),Nl=(0,kT.jsx)(o_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,kT.jsx)(o_.Path,{d:"M4 4v1.5h16V4H4zm8 8.5h8V11h-8v1.5zM4 20h16v-1.5H4V20zm4-8c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2z"})});var a_=o(L(),1),wT=o(v(),1),CT=(0,wT.jsx)(a_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,wT.jsx)(a_.Path,{d:"M11 14.5l1.1 1.1 3-3 .5-.5-.6-.6-3-3-1 1 1.7 1.7H5v1.5h7.7L11 14.5zM16.8 5h-7c-1.1 0-2 .9-2 2v1.5h1.5V7c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v10c0 .3-.2.5-.5.5h-7c-.3 0-.5-.2-.5-.5v-1.5H7.8V17c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2z"})});var n_=o(L(),1),ST=o(v(),1),Sp=(0,ST.jsx)(n_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,ST.jsx)(n_.Path,{d:"M18.1823 11.6392C18.1823 13.0804 17.0139 14.2487 15.5727 14.2487C14.3579 14.2487 13.335 13.4179 13.0453 12.2922L13.0377 12.2625L13.0278 12.2335L12.3985 10.377L12.3942 10.3785C11.8571 8.64997 10.246 7.39405 8.33961 7.39405C5.99509 7.39405 4.09448 9.29465 4.09448 11.6392C4.09448 13.9837 5.99509 15.8843 8.33961 15.8843C8.88499 15.8843 9.40822 15.781 9.88943 15.5923L9.29212 14.0697C8.99812 14.185 8.67729 14.2487 8.33961 14.2487C6.89838 14.2487 5.73003 13.0804 5.73003 11.6392C5.73003 10.1979 6.89838 9.02959 8.33961 9.02959C9.55444 9.02959 10.5773 9.86046 10.867 10.9862L10.8772 10.9836L11.4695 12.7311C11.9515 14.546 13.6048 15.8843 15.5727 15.8843C17.9172 15.8843 19.8178 13.9837 19.8178 11.6392C19.8178 9.29465 17.9172 7.39404 15.5727 7.39404C15.0287 7.39404 14.5066 7.4968 14.0264 7.6847L14.6223 9.20781C14.9158 9.093 15.2358 9.02959 15.5727 9.02959C17.0139 9.02959 18.1823 10.1979 18.1823 11.6392Z"})});var i_=o(L(),1),TT=o(v(),1),PT=(0,TT.jsx)(i_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,TT.jsx)(i_.Path,{d:"M12 9c-.8 0-1.5.7-1.5 1.5S11.2 12 12 12s1.5-.7 1.5-1.5S12.8 9 12 9zm0-5c-3.6 0-6.5 2.8-6.5 6.2 0 .8.3 1.8.9 3.1.5 1.1 1.2 2.3 2 3.6.7 1 3 3.8 3.2 3.9l.4.5.4-.5c.2-.2 2.6-2.9 3.2-3.9.8-1.2 1.5-2.5 2-3.6.6-1.3.9-2.3.9-3.1C18.5 6.8 15.6 4 12 4zm4.3 8.7c-.5 1-1.1 2.2-1.9 3.4-.5.7-1.7 2.2-2.4 3-.7-.8-1.9-2.3-2.4-3-.8-1.2-1.4-2.3-1.9-3.3-.6-1.4-.7-2.2-.7-2.5 0-2.6 2.2-4.7 5-4.7s5 2.1 5 4.7c0 .2-.1 1-.7 2.4z"})});var l_=o(L(),1),BT=o(v(),1),IT=(0,BT.jsx)(l_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,BT.jsx)(l_.Path,{d:"M11.2 6.8c-.7 0-1.4.5-1.6 1.1l-2.8 7.5-1.2-1.8c-.1-.2-.4-.3-.6-.3H3v1.5h1.6l1.2 1.8c.6.9 1.9.7 2.2-.3l2.9-7.9s.1-.2.2-.2h7.8V6.7h-7.8Zm5.3 3.4-1.9 1.9-1.9-1.9-1.1 1.1 1.9 1.9-1.9 1.9 1.1 1.1 1.9-1.9 1.9 1.9 1.1-1.1-1.9-1.9 1.9-1.9-1.1-1.1Z"})});var s_=o(L(),1),NT=o(v(),1),ET=(0,NT.jsx)(s_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,NT.jsx)(s_.Path,{d:"M3 6v11.5h8V6H3Zm11 3h7V7.5h-7V9Zm7 3.5h-7V11h7v1.5ZM14 16h7v-1.5h-7V16Z"})});var G0=o(L(),1),W0=o(v(),1),$0=(0,W0.jsxs)(G0.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,W0.jsx)(G0.Path,{d:"m7 6.5 4 2.5-4 2.5z"}),(0,W0.jsx)(G0.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"m5 3c-1.10457 0-2 .89543-2 2v14c0 1.1046.89543 2 2 2h14c1.1046 0 2-.8954 2-2v-14c0-1.10457-.8954-2-2-2zm14 1.5h-14c-.27614 0-.5.22386-.5.5v10.7072l3.62953-2.6465c.25108-.1831.58905-.1924.84981-.0234l2.92666 1.8969 3.5712-3.4719c.2911-.2831.7545-.2831 1.0456 0l2.9772 2.8945v-9.3568c0-.27614-.2239-.5-.5-.5zm-14.5 14.5v-1.4364l4.09643-2.987 2.99567 1.9417c.2936.1903.6798.1523.9307-.0917l3.4772-3.3806 3.4772 3.3806.0228-.0234v2.5968c0 .2761-.2239.5-.5.5h-14c-.27614 0-.5-.2239-.5-.5z"})]});var c_=o(L(),1),DT=o(v(),1),LT=(0,DT.jsx)(c_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,DT.jsx)(c_.Path,{d:"M5 5v1.5h14V5H5zm0 7.8h14v-1.5H5v1.5zM5 19h14v-1.5H5V19z"})});var u_=o(L(),1),MT=o(v(),1),q0=(0,MT.jsx)(u_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,MT.jsx)(u_.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})});var m_=o(L(),1),AT=o(v(),1),RT=(0,AT.jsx)(m_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,AT.jsx)(m_.Path,{d:"M4 9v1.5h16V9H4zm12 5.5h4V13h-4v1.5zm-6 0h4V13h-4v1.5zm-6 0h4V13H4v1.5z"})});var p_=o(L(),1),zT=o(v(),1),VT=(0,zT.jsx)(p_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,zT.jsx)(p_.Path,{d:"M18.5 10a1.5 1.5 0 0 1 1.5 1.5v7a1.5 1.5 0 0 1-1.5 1.5h-7a1.5 1.5 0 0 1-1.5-1.5v-7a1.5 1.5 0 0 1 1.5-1.5zM16 4a2 2 0 0 1 2 2v2h-1.5V6a.5.5 0 0 0-.5-.5H6a.5.5 0 0 0-.5.5v3H8v1.5H5.5V16a.5.5 0 0 0 .5.5h2V18H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z"})});var d_=o(L(),1),FT=o(v(),1),Tp=(0,FT.jsx)(d_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,FT.jsx)(d_.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 f_=o(L(),1),HT=o(v(),1),OT=(0,HT.jsx)(f_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,HT.jsx)(f_.Path,{d:"M6.6 6L5.4 7l4.5 5-4.5 5 1.1 1 5.5-6-5.4-6zm6 0l-1.1 1 4.5 5-4.5 5 1.1 1 5.5-6-5.5-6z"})});var h_=o(L(),1),jT=o(v(),1),UT=(0,jT.jsx)(h_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,jT.jsx)(h_.Path,{d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12-9.8c.4 0 .8-.3.9-.7l1.1-3h3.6l.5 1.7h1.9L13 9h-2.2l-3.4 9.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v12H20V6c0-1.1-.9-2-2-2zm-6 7l1.4 3.9h-2.7L12 11z"})});var g_=o(L(),1),GT=o(v(),1),WT=(0,GT.jsx)(g_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,GT.jsx)(g_.Path,{d:"M17.5 9V6a2 2 0 0 0-2-2h-7a2 2 0 0 0-2 2v3H8V6a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 .5.5v3h1.5Zm0 6.5V18a2 2 0 0 1-2 2h-7a2 2 0 0 1-2-2v-2.5H8V18a.5.5 0 0 0 .5.5h7a.5.5 0 0 0 .5-.5v-2.5h1.5ZM4 13h16v-1.5H4V13Z"})});var Z0=o(L(),1),K0=o(v(),1),Fc=(0,K0.jsxs)(Z0.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,K0.jsx)(Z0.Path,{d:"M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z"}),(0,K0.jsx)(Z0.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 Pf=o(L(),1),Bf=o(v(),1),$T=(0,Bf.jsxs)(Pf.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,Bf.jsx)(Pf.Path,{d:"M14.5 5.5h-7V7h7V5.5ZM7.5 9h7v1.5h-7V9Zm7 3.5h-7V14h7v-1.5Z"}),(0,Bf.jsx)(Pf.Path,{d:"M16 2H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2ZM6 3.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H6a.5.5 0 0 1-.5-.5V4a.5.5 0 0 1 .5-.5Z"}),(0,Bf.jsx)(Pf.Path,{d:"M20 8v11c0 .69-.31 1-.999 1H6v1.5h13.001c1.52 0 2.499-.982 2.499-2.5V8H20Z"})]});var v_=o(L(),1),qT=o(v(),1),ZT=(0,qT.jsx)(v_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,qT.jsx)(v_.Path,{d:"m9.99609 14v-.2251l.00391.0001v6.225h1.5v-14.5h2.5v14.5h1.5v-14.5h3v-1.5h-8.50391c-2.76142 0-5 2.23858-5 5 0 2.7614 2.23858 5 5 5z"})});var b_=o(L(),1),KT=o(v(),1),Pp=(0,KT.jsx)(b_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,KT.jsx)(b_.Path,{d:"m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z"})});var y_=o(L(),1),QT=o(v(),1),Q0=(0,QT.jsx)(y_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,QT.jsx)(y_.Path,{d:"m21.5 9.1-6.6-6.6-4.2 5.6c-1.2-.1-2.4.1-3.6.7-.1 0-.1.1-.2.1-.5.3-.9.6-1.2.9l3.7 3.7-5.7 5.7v1.1h1.1l5.7-5.7 3.7 3.7c.4-.4.7-.8.9-1.2.1-.1.1-.2.2-.3.6-1.1.8-2.4.6-3.6l5.6-4.1zm-7.3 3.5.1.9c.1.9 0 1.8-.4 2.6l-6-6c.8-.4 1.7-.5 2.6-.4l.9.1L15 4.9 19.1 9l-4.9 3.6z"})});var __=o(L(),1),YT=o(v(),1),XT=(0,YT.jsx)(__.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,YT.jsx)(__.Path,{d:"M10.5 4v4h3V4H15v4h1.5a1 1 0 011 1v4l-3 4v2a1 1 0 01-1 1h-3a1 1 0 01-1-1v-2l-3-4V9a1 1 0 011-1H9V4h1.5zm.5 12.5v2h2v-2l3-4v-3H8v3l3 4z"})});var x_=o(L(),1),JT=o(v(),1),If=(0,JT.jsx)(x_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,JT.jsx)(x_.Path,{d:"M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"})});var k_=o(L(),1),eP=o(v(),1),tP=(0,eP.jsx)(k_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,eP.jsx)(k_.Path,{d:"M19 5.5H5V4h14v1.5ZM19 20H5v-1.5h14V20ZM7 9h10v6H7V9Z"})});var w_=o(L(),1),rP=o(v(),1),oP=(0,rP.jsx)(w_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,rP.jsx)(w_.Path,{d:"M5 5.5h8V4H5v1.5ZM5 20h8v-1.5H5V20ZM19 9H5v6h14V9Z"})});var C_=o(L(),1),aP=o(v(),1),nP=(0,aP.jsx)(C_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,aP.jsx)(C_.Path,{d:"M19 5.5h-8V4h8v1.5ZM19 20h-8v-1.5h8V20ZM5 9h14v6H5V9Z"})});var S_=o(L(),1),iP=o(v(),1),Bp=(0,iP.jsx)(S_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,iP.jsx)(S_.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M10 4.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0zm2.25 7.5v-1A2.75 2.75 0 0011 8.25H7A2.75 2.75 0 004.25 11v1h1.5v-1c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v1h1.5zM4 20h9v-1.5H4V20zm16-4H4v-1.5h16V16z"})});var T_=o(L(),1),lP=o(v(),1),Nf=(0,lP.jsx)(T_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,lP.jsx)(T_.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M20 4H4v1.5h16V4zm-2 9h-3c-1.1 0-2 .9-2 2v3c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2v-3c0-1.1-.9-2-2-2zm.5 5c0 .3-.2.5-.5.5h-3c-.3 0-.5-.2-.5-.5v-3c0-.3.2-.5.5-.5h3c.3 0 .5.2.5.5v3zM4 9.5h9V8H4v1.5zM9 13H6c-1.1 0-2 .9-2 2v3c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2v-3c0-1.1-.9-2-2-2zm.5 5c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-3c0-.3.2-.5.5-.5h3c.3 0 .5.2.5.5v3z"})});var P_=o(L(),1),sP=o(v(),1),Y0=(0,sP.jsx)(P_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,sP.jsx)(P_.Path,{d:"M13 8H4v1.5h9V8zM4 4v1.5h16V4H4zm9 8H5c-.6 0-1 .4-1 1v8.3c0 .3.2.7.6.8.1.1.2.1.3.1.2 0 .5-.1.6-.3l1.8-1.8H13c.6 0 1-.4 1-1V13c0-.6-.4-1-1-1zm-2.2 6.6H7l1.6-2.2c.3-.4.5-.7.6-.9.1-.2.2-.4.2-.5 0-.2-.1-.3-.1-.4-.1-.1-.2-.1-.4-.1s-.4 0-.6.1c-.3.1-.5.3-.7.4l-.2.2-.2-1.2.1-.1c.3-.2.5-.3.8-.4.3-.1.6-.1.9-.1.3 0 .6.1.9.2.2.1.4.3.6.5.1.2.2.5.2.7 0 .3-.1.6-.2.9-.1.3-.4.7-.7 1.1l-.5.6h1.6v1.2z"})});var B_=o(L(),1),cP=o(v(),1),uP=(0,cP.jsx)(B_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,cP.jsx)(B_.Path,{d:"M13 8H4v1.5h9V8zM4 4v1.5h16V4H4zm9 8H5c-.6 0-1 .4-1 1v8.3c0 .3.2.7.6.8.1.1.2.1.3.1.2 0 .5-.1.6-.3l1.8-1.8H13c.6 0 1-.4 1-1V13c0-.6-.4-1-1-1zm-.5 6.6H6.7l-1.2 1.2v-6.3h7v5.1z"})});var I_=o(L(),1),mP=o(v(),1),pP=(0,mP.jsx)(I_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,mP.jsx)(I_.Path,{d:"M14 10.1V4c0-.6-.4-1-1-1H5c-.6 0-1 .4-1 1v8.3c0 .3.2.7.6.8.1.1.2.1.3.1.2 0 .5-.1.6-.3l1.8-1.8H13c.6 0 1-.4 1-1zm-1.5-.5H6.7l-1.2 1.2V4.5h7v5.1zM19 12h-8c-.6 0-1 .4-1 1v6.1c0 .6.4 1 1 1h5.7l1.8 1.8c.1.2.4.3.6.3.1 0 .2 0 .3-.1.4-.1.6-.5.6-.8V13c0-.6-.4-1-1-1zm-.5 7.8l-1.2-1.2h-5.8v-5.1h7v6.3z"})});var N_=o(L(),1),dP=o(v(),1),fP=(0,dP.jsx)(N_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,dP.jsx)(N_.Path,{d:"M4 6h12V4.5H4V6Zm16 4.5H4V9h16v1.5ZM4 15h16v-1.5H4V15Zm0 4.5h16V18H4v1.5Z"})});var X0=o(L(),1),J0=o(v(),1),e1=(0,J0.jsxs)(X0.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,J0.jsx)(X0.Path,{d:"M11.696 13.972c.356-.546.599-.958.728-1.235a1.79 1.79 0 00.203-.783c0-.264-.077-.47-.23-.618-.148-.153-.354-.23-.618-.23-.295 0-.569.07-.82.212a3.413 3.413 0 00-.738.571l-.147-1.188c.289-.234.59-.41.903-.526.313-.117.66-.175 1.041-.175.375 0 .695.08.959.24.264.153.46.362.59.626.135.265.203.556.203.876 0 .362-.08.734-.24 1.115-.154.381-.427.87-.82 1.466l-.756 1.152H14v1.106h-4l1.696-2.609z"}),(0,J0.jsx)(X0.Path,{d:"M19.5 7h-15v12a.5.5 0 00.5.5h14a.5.5 0 00.5-.5V7zM3 7V5a2 2 0 012-2h14a2 2 0 012 2v14a2 2 0 01-2 2H5a2 2 0 01-2-2V7z"})]});var E_=o(L(),1),hP=o(v(),1),gP=(0,hP.jsx)(E_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,hP.jsx)(E_.Path,{d:"M8.001 3.984V9.47c0 1.518-.98 2.5-2.499 2.5h-.5v-1.5h.5c.69 0 1-.31 1-1V6.984H4v-3h4.001ZM4 20h9v-1.5H4V20Zm16-4H4v-1.5h16V16ZM13.001 3.984V9.47c0 1.518-.98 2.5-2.499 2.5h-.5v-1.5h.5c.69 0 1-.31 1-1V6.984H9v-3h4.001Z"})});var D_=o(L(),1),vP=o(v(),1),bP=(0,vP.jsx)(D_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,vP.jsx)(D_.Path,{d:"M19 3H5c-.6 0-1 .4-1 1v7c0 .5.4 1 1 1h14c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1zM5.5 10.5v-.4l1.8-1.3 1.3.8c.3.2.7.2.9-.1L11 8.1l2.4 2.4H5.5zm13 0h-2.9l-4-4c-.3-.3-.8-.3-1.1 0L8.9 8l-1.2-.8c-.3-.2-.6-.2-.9 0l-1.3 1V4.5h13v6zM4 20h9v-1.5H4V20zm0-4h16v-1.5H4V16z"})});var L_=o(L(),1),yP=o(v(),1),t1=(0,yP.jsx)(L_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,yP.jsx)(L_.Path,{d:"M18 5.5H6a.5.5 0 0 0-.5.5v12a.5.5 0 0 0 .5.5h12a.5.5 0 0 0 .5-.5V6a.5.5 0 0 0-.5-.5ZM6 4h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2Zm1 5h1.5v1.5H7V9Zm1.5 4.5H7V15h1.5v-1.5ZM10 9h7v1.5h-7V9Zm7 4.5h-7V15h7v-1.5Z"})});var M_=o(L(),1),_P=o(v(),1),xP=(0,_P.jsx)(M_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_P.jsx)(M_.Path,{d:"M8.1 12.3c.1.1.3.3.5.3.2.1.4.1.6.1.2 0 .4 0 .6-.1.2-.1.4-.2.5-.3l3-3c.3-.3.5-.7.5-1.1 0-.4-.2-.8-.5-1.1L9.7 3.5c-.1-.2-.3-.3-.5-.3H5c-.4 0-.8.4-.8.8v4.2c0 .2.1.4.2.5l3.7 3.6zM5.8 4.8h3.1l3.4 3.4v.1l-3 3 .5.5-.7-.5-3.3-3.4V4.8zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z"})});var A_=o(L(),1),kP=o(v(),1),wP=(0,kP.jsx)(A_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,kP.jsx)(A_.Path,{d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v12zM7 16.5h6V15H7v1.5zm4-4h6V11h-6v1.5zM9 11H7v1.5h2V11zm6 5.5h2V15h-2v1.5z"})});var R_=o(L(),1),CP=o(v(),1),SP=(0,CP.jsx)(R_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,CP.jsx)(R_.Path,{d:"M11.6 7l-1.1-1L5 12l5.5 6 1.1-1L7 12l4.6-5zm6 0l-1.1-1-5.5 6 5.5 6 1.1-1-4.6-5 4.6-5z"})});var z_=o(L(),1),TP=o(v(),1),PP=(0,TP.jsx)(z_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,TP.jsx)(z_.Path,{d:"M4 18h6V6H4v12zm9-9.5V10h7V8.5h-7zm0 7h7V14h-7v1.5z"})});var V_=o(L(),1),BP=o(v(),1),IP=(0,BP.jsx)(V_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,BP.jsx)(V_.Path,{d:"M14 6v12h6V6h-6zM4 10h7V8.5H4V10zm0 5.5h7V14H4v1.5z"})});var F_=o(L(),1),NP=o(v(),1),EP=(0,NP.jsx)(F_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,NP.jsx)(F_.Path,{d:"M18 8H6c-1.1 0-2 .9-2 2v4c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-4c0-1.1-.9-2-2-2zm.5 6c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-4c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v4zM4 4v1.5h16V4H4zm0 16h16v-1.5H4V20z"})});var H_=o(L(),1),DP=o(v(),1),r1=(0,DP.jsx)(H_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,DP.jsx)(H_.Path,{d:"M5 13.5h3v-3H5v3zm5 0h3v-3h-3v3zM17 9l-1 1 2 2-2 2 1 1 3-3-3-3z"})});var O_=o(L(),1),LP=o(v(),1),o1=(0,LP.jsx)(O_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,LP.jsx)(O_.Path,{d:"M4 13.5h6v-3H4v3zm8.2-2.5.8-.3V14h1V9.3l-2.2.7.4 1zm7.1-1.2c-.5-.6-1.2-.5-1.7-.4-.3.1-.5.2-.7.3l.1 1.1c.2-.2.5-.4.8-.5.3-.1.6 0 .7.1.2.3 0 .8-.2 1.1-.5.8-.9 1.6-1.4 2.5h2.7v-1h-.9c.3-.6.8-1.4.9-2.1 0-.3-.1-.8-.3-1.1z"})});var j_=o(L(),1),MP=o(v(),1),a1=(0,MP.jsx)(j_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,MP.jsx)(j_.Path,{d:"M16 10.5v3h3v-3h-3zm-5 3h3v-3h-3v3zM7 9l-3 3 3 3 1-1-2-2 2-2-1-1z"})});var U_=o(L(),1),AP=o(v(),1),n1=(0,AP.jsx)(U_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,AP.jsx)(U_.Path,{d:"M4 13.5h6v-3H4v3zm8 0h3v-3h-3v3zm5-3v3h3v-3h-3z"})});var G_=o(L(),1),RP=o(v(),1),zP=(0,RP.jsx)(G_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,RP.jsx)(G_.Path,{d:"M13 6v6h5.2v4c0 .8-.2 1.4-.5 1.7-.6.6-1.6.6-2.5.5h-.3v1.5h.5c1 0 2.3-.1 3.3-1 .6-.6 1-1.6 1-2.8V6H13zm-9 6h5.2v4c0 .8-.2 1.4-.5 1.7-.6.6-1.6.6-2.5.5h-.3v1.5h.5c1 0 2.3-.1 3.3-1 .6-.6 1-1.6 1-2.8V6H4v6z"})});var W_=o(L(),1),VP=o(v(),1),FP=(0,VP.jsx)(W_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,VP.jsx)(W_.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"m13.955 20.748 8-17.5-.91-.416L19.597 6H13.5v1.5h5.411l-1.6 3.5H13.5v1.5h3.126l-1.6 3.5H13.5l.028 1.5h.812l-1.295 2.832.91.416ZM17.675 16l-.686 1.5h4.539L21.5 16h-3.825Zm2.286-5-.686 1.5H21.5V11h-1.54ZM2 12c0 3.58 2.42 5.5 6 5.5h.5V19l3-2.5-3-2.5v2H8c-2.48 0-4.5-1.52-4.5-4S5.52 7.5 8 7.5h3.5V6H8c-3.58 0-6 2.42-6 6Z"})});var $_=o(L(),1),HP=o(v(),1),OP=(0,HP.jsx)($_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,HP.jsx)($_.Path,{d:"M7 18h4.5v1.5h-7v-7H6V17L17 6h-4.5V4.5h7v7H18V7L7 18Z"})});var q_=o(L(),1),jP=o(v(),1),UP=(0,jP.jsx)(q_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,jP.jsx)(q_.Path,{d:"M4 6.5h5a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H4V16h5a.5.5 0 0 0 .5-.5v-7A.5.5 0 0 0 9 8H4V6.5Zm16 0h-5a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h5V16h-5a.5.5 0 0 1-.5-.5v-7A.5.5 0 0 1 15 8h5V6.5Z"})});var Z_=o(L(),1),GP=o(v(),1),i1=(0,GP.jsx)(Z_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,GP.jsx)(Z_.Path,{d:"M5 10.2h-.8v1.5H5c1.9 0 3.8.8 5.1 2.1 1.4 1.4 2.1 3.2 2.1 5.1v.8h1.5V19c0-2.3-.9-4.5-2.6-6.2-1.6-1.6-3.8-2.6-6.1-2.6zm10.4-1.6C12.6 5.8 8.9 4.2 5 4.2h-.8v1.5H5c3.5 0 6.9 1.4 9.4 3.9s3.9 5.8 3.9 9.4v.8h1.5V19c0-3.9-1.6-7.6-4.4-10.4zM4 20h3v-3H4v3z"})});var K_=o(L(),1),WP=o(v(),1),l1=(0,WP.jsx)(K_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,WP.jsx)(K_.Path,{d:"M13 5c-3.3 0-6 2.7-6 6 0 1.4.5 2.7 1.3 3.7l-3.8 3.8 1.1 1.1 3.8-3.8c1 .8 2.3 1.3 3.7 1.3 3.3 0 6-2.7 6-6S16.3 5 13 5zm0 10.5c-2.5 0-4.5-2-4.5-4.5s2-4.5 4.5-4.5 4.5 2 4.5 4.5-2 4.5-4.5 4.5z"})});var Q_=o(L(),1),$P=o(v(),1),qP=(0,$P.jsx)(Q_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,$P.jsx)(Q_.Path,{d:"M4.5 12.5v4H3V7h1.5v3.987h15V7H21v9.5h-1.5v-4h-15Z"})});var Y_=o(L(),1),ZP=o(v(),1),s1=(0,ZP.jsx)(Y_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,ZP.jsx)(Y_.Path,{d:"M9 11.8l6.1-4.5c.1.4.4.7.9.7h2c.6 0 1-.4 1-1V5c0-.6-.4-1-1-1h-2c-.6 0-1 .4-1 1v.4l-6.4 4.8c-.2-.1-.4-.2-.6-.2H6c-.6 0-1 .4-1 1v2c0 .6.4 1 1 1h2c.2 0 .4-.1.6-.2l6.4 4.8v.4c0 .6.4 1 1 1h2c.6 0 1-.4 1-1v-2c0-.6-.4-1-1-1h-2c-.5 0-.8.3-.9.7L9 12.2v-.4z"})});var X_=o(L(),1),KP=o(v(),1),c1=(0,KP.jsx)(X_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,KP.jsx)(X_.Path,{d:"M16 4.2v1.5h2.5v12.5H16v1.5h4V4.2h-4zM4.2 19.8h4v-1.5H5.8V5.8h2.5V4.2h-4l-.1 15.6zm5.1-3.1l1.4.6 4-10-1.4-.6-4 10z"})});var J_=o(L(),1),QP=o(v(),1),YP=(0,QP.jsx)(J_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,QP.jsx)(J_.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.5zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})});var ex=o(L(),1),XP=o(v(),1),JP=(0,XP.jsx)(ex.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,XP.jsx)(ex.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 1.5c3.4 0 6.2 2.7 6.5 6l-1.2-.6-.8-.4c-.1 0-.2 0-.3-.1H16c-.1-.2-.4-.2-.7 0l-2.9 2.1L9 11.3h-.7L5.5 13v-1.1c0-3.6 2.9-6.5 6.5-6.5Zm0 13c-2.7 0-5-1.7-6-4l2.8-1.7 3.5 1.2h.4s.2 0 .4-.2l2.9-2.1.4.2c.6.3 1.4.7 2.1 1.1-.5 3.1-3.2 5.4-6.4 5.4Z"})});var tx=o(L(),1),eB=o(v(),1),tB=(0,eB.jsx)(tx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,eB.jsx)(tx.Path,{fill:"none",d:"M5.75 12.75V18.25H11.25M12.75 5.75H18.25V11.25",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"square"})});var rx=o(L(),1),rB=o(v(),1),oB=(0,rB.jsx)(rx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,rB.jsx)(rx.Path,{d:"M17.5 4v5a2 2 0 0 1-2 2h-7a2 2 0 0 1-2-2V4H8v5a.5.5 0 0 0 .5.5h7A.5.5 0 0 0 16 9V4h1.5Zm0 16v-5a2 2 0 0 0-2-2h-7a2 2 0 0 0-2 2v5H8v-5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 .5.5v5h1.5Z"})});var ox=o(L(),1),aB=o(v(),1),u1=(0,aB.jsx)(ox.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,aB.jsx)(ox.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 ax=o(L(),1),nB=o(v(),1),iB=(0,nB.jsx)(ax.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,nB.jsx)(ax.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 nx=o(L(),1),lB=o(v(),1),sB=(0,lB.jsx)(nx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,lB.jsx)(nx.Path,{d:"M4 16.5h13V15H4v1.5ZM4 12v1.5h16V12H4Zm1.5-4.2c0-.1.1-.2.2-.2h3.5c.1 0 .2.1.2.2v2.5h1.5V7.8c0-1-.8-1.8-1.8-1.8H5.6c-1 0-1.8.8-1.8 1.8v2.5h1.5V7.8Z"})});var ix=o(L(),1),cB=o(v(),1),uB=(0,cB.jsx)(ix.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,cB.jsx)(ix.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14.2c.1.9.9 1.7 1.8 1.8H19.2c1-.1 1.8-1 1.8-2V5c0-1.1-.9-2-2-2ZM8.5 19.5H5c-.3 0-.5-.2-.5-.5v-3.5h4v4Zm0-5.5h-4v-4h4v4Zm0-5.5h-4V5c0-.3.2-.5.5-.5h3.5v4Zm11 10.5c0 .3-.2.5-.5.5h-9v-15h9c.3 0 .5.2.5.5v14Zm-4-10.8H14v3h-3v1.5h3v3h1.5v-3h3v-1.5h-3v-3Z"})});var lx=o(L(),1),mB=o(v(),1),pB=(0,mB.jsx)(lx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,mB.jsx)(lx.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1 .8 1.9 1.8 2H19.2c.9-.1 1.7-.9 1.8-1.8V5c0-1.1-.9-2-2-2Zm-5 16.5H5c-.3 0-.5-.2-.5-.5V5c0-.3.2-.5.5-.5h9v15Zm5.5-.5c0 .3-.2.5-.5.5h-3.5v-4h4V19Zm0-5h-4v-4h4v4Zm0-5.5h-4v-4H19c.3 0 .5.2.5.5v3.5Zm-11 7.3H10v-3h3v-1.5h-3v-3H8.5v3h-3v1.5h3v3Z"})});var sx=o(L(),1),dB=o(v(),1),fB=(0,dB.jsx)(sx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,dB.jsx)(sx.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14.2c.1.9.9 1.7 1.8 1.8H19.2c1-.1 1.8-1 1.8-2V5c0-1.1-.9-2-2-2ZM8.5 19.5H5c-.3 0-.5-.2-.5-.5V5c0-.3.2-.5.5-.5h3.5v15Zm11-.5c0 .3-.2.5-.5.5h-9v-15h9c.3 0 .5.2.5.5v14ZM16.9 8.8l-2.1 2.1-2.1-2.1-1.1 1.1 2.1 2.1-2.1 2.1 1.1 1.1 2.1-2.1 2.1 2.1 1.1-1.1-2.1-2.1L18 9.9l-1.1-1.1Z"})});var m1=o(L(),1),p1=o(v(),1),d1=(0,p1.jsxs)(m1.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,p1.jsx)(m1.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M20 9.484h-8.889v-1.5H20v1.5Zm0 7h-4.889v-1.5H20v1.5Zm-14 .032a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 1a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z"}),(0,p1.jsx)(m1.Path,{d:"M13 15.516a2 2 0 1 1-4 0 2 2 0 0 1 4 0ZM8 8.484a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z"})]});var cx=o(L(),1),hB=o(v(),1),gB=(0,hB.jsx)(cx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,hB.jsx)(cx.Path,{d:"M19 3H4.8c-.9.1-1.7.9-1.8 1.8V19.2c.1 1 1 1.8 2 1.8h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2Zm-9 1.5h4v4h-4v-4ZM4.5 5c0-.3.2-.5.5-.5h3.5v4h-4V5Zm15 14c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-9h15v9Zm0-10.5h-4v-4H19c.3 0 .5.2.5.5v3.5Zm-8.3 10h1.5v-3h3V14h-3v-3h-1.5v3h-3v1.5h3v3Z"})});var ux=o(L(),1),vB=o(v(),1),bB=(0,vB.jsx)(ux.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,vB.jsx)(ux.Path,{d:"M21 5c0-1.1-.9-2-2-2H5c-1 0-1.9.8-2 1.8V19.2c.1.9.9 1.7 1.8 1.8H19c1.1 0 2-.9 2-2V5ZM4.5 14V5c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v9h-15Zm4 5.5H5c-.3 0-.5-.2-.5-.5v-3.5h4v4Zm5.5 0h-4v-4h4v4Zm5.5-.5c0 .3-.2.5-.5.5h-3.5v-4h4V19ZM11.2 10h-3V8.5h3v-3h1.5v3h3V10h-3v3h-1.5v-3Z"})});var mx=o(L(),1),yB=o(v(),1),_B=(0,yB.jsx)(mx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,yB.jsx)(mx.Path,{d:"M19 3H4.8c-.9.1-1.7.9-1.8 1.8V19.2c.1 1 1 1.8 2 1.8h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2Zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-9h15v9Zm0-10.5h-15V5c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v3.5Zm-9.6 9.4 2.1-2.1 2.1 2.1 1.1-1.1-2.1-2.1 2.1-2.1-1.1-1.1-2.1 2.1-2.1-2.1-1.1 1.1 2.1 2.1-2.1 2.1 1.1 1.1Z"})});var px=o(L(),1),xB=o(v(),1),kB=(0,xB.jsx)(px.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,xB.jsx)(px.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2Zm.5 2v6.2h-6.8V4.4h6.2c.3 0 .5.2.5.5ZM5 4.5h6.2v6.8H4.4V5.1c0-.3.2-.5.5-.5ZM4.5 19v-6.2h6.8v6.8H5.1c-.3 0-.5-.2-.5-.5Zm14.5.5h-6.2v-6.8h6.8v6.2c0 .3-.2.5-.5.5Z"})});var dx=o(L(),1),wB=o(v(),1),CB=(0,wB.jsx)(dx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,wB.jsx)(dx.Path,{d:"M14 11.25a.25.25 0 0 0-.25-.25h-3.5a.25.25 0 0 0-.25.25v2.5H8.5v-2.5c0-.966.784-1.75 1.75-1.75h3.5c.966 0 1.75.784 1.75 1.75v2.5H14v-2.5Z"})});var fx=o(L(),1),SB=o(v(),1),TB=(0,SB.jsx)(fx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,SB.jsx)(fx.Path,{d:"M18.2 9.5h-3.5c-1 0-1.8.8-1.8 1.8v2.5h1.5v-2.5c0-.1.1-.2.2-.2h3.5c.1 0 .2.1.2.2v2.5h1.5v-2.5c0-1-.8-1.8-1.8-1.8Zm-9 0H5.7c-1 0-1.8.8-1.8 1.8v2.5h7v-2.5c0-1-.8-1.8-1.8-1.8Z"})});var hx=o(L(),1),PB=o(v(),1),BB=(0,PB.jsx)(hx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,PB.jsx)(hx.Path,{d:"M4 16.5h13V15H4v1.5Zm0-3h16V12H4v1.5ZM18.2 6h-3.5c-1 0-1.8.8-1.8 1.8v2.5h1.5V7.8c0-.1.1-.2.2-.2h3.5c.1 0 .2.1.2.2v2.5h1.5V7.8c0-1-.8-1.8-1.8-1.8ZM11 7.8c0-1-.8-1.8-1.8-1.8H5.7c-1 0-1.8.8-1.8 1.8v2.5h7V7.8Z"})});var gx=o(L(),1),IB=o(v(),1),f1=(0,IB.jsx)(gx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,IB.jsx)(gx.Path,{d:"M4.75 4a.75.75 0 0 0-.75.75v7.826c0 .2.08.39.22.53l6.72 6.716a2.313 2.313 0 0 0 3.276-.001l5.61-5.611-.531-.53.532.528a2.315 2.315 0 0 0 0-3.264L13.104 4.22a.75.75 0 0 0-.53-.22H4.75ZM19 12.576a.815.815 0 0 1-.236.574l-5.61 5.611a.814.814 0 0 1-1.153 0L5.5 12.264V5.5h6.763l6.5 6.502a.816.816 0 0 1 .237.574ZM8.75 9.75a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"})});var h1=o(L(),1),g1=o(v(),1),NB=(0,g1.jsxs)(h1.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,g1.jsx)(h1.Path,{d:"M 12.841306,16.677917 12.001264,12.71529 Q 11.835801,11.930402 11.695793,11.417042 11.560029,10.89944 11.398809,10.568514 11.237588,10.237588 11,10 10.635133,9.6351329 10.219354,9.6351329 9.8078183,9.6308902 9.4387086,10 8.9932313,10.445477 8.8574668,11.022476 8.7259449,11.595233 8.7259449,12.155262 L 7.4955791,11.196425 Q 7.5719467,10.509117 7.8307477,9.9109045 8.0937915,9.3084495 8.6410921,8.7611489 9.1799075,8.2223335 9.7569066,8.086569 q 0.5812414,-0.1400071 1.1242994,0.046669 0.543058,0.1866762 0.975808,0.6194255 0.335168,0.3351686 0.581242,0.767918 0.24183,0.4285067 0.436992,1.0564174 0.195161,0.619426 0.381837,1.527351 l 0.364867,1.756453 1.883733,-1.883732 1.018234,1.018233 z"}),(0,g1.jsx)(h1.Path,{d:"M12.574 4a.75.75 0 0 1 .53.22l6.723 6.724a2.315 2.315 0 0 1 0 3.264l-.532-.528.531.53-5.61 5.611a2.31 2.31 0 0 1-3.276.001l-6.72-6.716a.75.75 0 0 1-.22-.53V4.75A.75.75 0 0 1 4.75 4h7.824ZM5.5 5.5v6.764l6.501 6.497a.817.817 0 0 0 .889.178.816.816 0 0 0 .264-.178l5.61-5.61a.816.816 0 0 0-.001-1.149l-6.5-6.502H5.5Z"})]});var vx=o(L(),1),EB=o(v(),1),DB=(0,EB.jsx)(vx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,EB.jsx)(vx.Path,{d:"M6.08 10.103h2.914L9.657 12h1.417L8.23 4H6.846L4 12h1.417l.663-1.897Zm1.463-4.137.994 2.857h-2l1.006-2.857ZM11 16H4v-1.5h7V16Zm1 0h8v-1.5h-8V16Zm-4 4H4v-1.5h4V20Zm7-1.5V20H9v-1.5h6Z"})});var v1=o(L(),1),b1=o(v(),1),LB=(0,b1.jsxs)(v1.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,b1.jsx)(v1.Path,{d:"m14.95 13.889-1.061 1.061-5.552-5.553 1.06-1.06 5.552 5.552Z"}),(0,b1.jsx)(v1.Path,{d:"M12.574 4a.75.75 0 0 1 .53.22l6.723 6.724a2.315 2.315 0 0 1 0 3.264l-.532-.528.531.53-5.61 5.611a2.31 2.31 0 0 1-3.276.001l-6.72-6.716a.75.75 0 0 1-.22-.53V4.75A.75.75 0 0 1 4.75 4h7.824ZM5.5 5.5v6.764l6.501 6.497a.817.817 0 0 0 .889.178.816.816 0 0 0 .264-.178l5.61-5.61a.816.816 0 0 0-.001-1.149l-6.5-6.502H5.5Z"})]});var bx=o(L(),1),MB=o(v(),1),y1=(0,MB.jsx)(bx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,MB.jsx)(bx.Path,{d:"M12 3c-5 0-9 4-9 9s4 9 9 9 9-4 9-9-4-9-9-9zm0 16.5c-4.1 0-7.5-3.4-7.5-7.5S7.9 4.5 12 4.5s7.5 3.4 7.5 7.5-3.4 7.5-7.5 7.5zM12 7l-1 5c0 .3.2.6.4.8l4.2 2.8-2.7-4.1L12 7z"})});var yx=o(L(),1),AB=o(v(),1),El=(0,AB.jsx)(yx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,AB.jsx)(yx.Path,{d:"m4 5.5h2v6.5h1.5v-6.5h2v-1.5h-5.5zm16 10.5h-16v-1.5h16zm-7 4h-9v-1.5h9z"})});var _x=o(L(),1),RB=o(v(),1),Hc=(0,RB.jsx)(_x.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,RB.jsx)(_x.Path,{d:"M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z"})});var xx=o(L(),1),zB=o(v(),1),_1=(0,zB.jsx)(xx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,zB.jsx)(xx.Path,{d:"M17.8 2l-.9.3c-.1 0-3.6 1-5.2 2.1C10 5.5 9.3 6.5 8.9 7.1c-.6.9-1.7 4.7-1.7 6.3l-.9 2.3c-.2.4 0 .8.4 1 .1 0 .2.1.3.1.3 0 .6-.2.7-.5l.6-1.5c.3 0 .7-.1 1.2-.2.7-.1 1.4-.3 2.2-.5.8-.2 1.6-.5 2.4-.8.7-.3 1.4-.7 1.9-1.2s.8-1.2 1-1.9c.2-.7.3-1.6.4-2.4.1-.8.1-1.7.2-2.5 0-.8.1-1.5.2-2.1V2zm-1.9 5.6c-.1.8-.2 1.5-.3 2.1-.2.6-.4 1-.6 1.3-.3.3-.8.6-1.4.9-.7.3-1.4.5-2.2.8-.6.2-1.3.3-1.8.4L15 7.5c.3-.3.6-.7 1-1.1 0 .4 0 .8-.1 1.2zM6 20h8v-1.5H6V20z"})});var kx=o(L(),1),VB=o(v(),1),Ef=(0,VB.jsx)(kx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,VB.jsx)(kx.Path,{d:"M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h13.4c.4 0 .8.4.8.8v13.4zM10 15l5-3-5-3v6z"})});var wx=o(L(),1),FB=o(v(),1),HB=(0,FB.jsx)(wx.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,FB.jsx)(wx.Path,{d:"M19 5c1.1 0 2 .9 2 2v10c0 1.1-.9 2-2 2H5c-1.1 0-2-.9-2-2V7c0-1.1.9-2 2-2zM5 6.5c-.3 0-.5.2-.5.5v10c0 .3.2.5.5.5h14c.3 0 .5-.2.5-.5V7c0-.3-.2-.5-.5-.5zM14.734 9q.714 0 1.15.253.437.247.639.84.2.591.2 1.61v1.15q0 .402.036.667.04.258.172.39.138.127.437.127h.104l-.162.828h-.08q-.5 0-.776-.097a.9.9 0 0 1-.414-.283 2 2 0 0 1-.259-.448q-.316.367-.748.598-.43.23-.977.23-.524 0-.914-.213a1.56 1.56 0 0 1-.61-.58 1.65 1.65 0 0 1-.213-.84q0-.477.207-.817.213-.345.564-.568.357-.23.794-.363.437-.139.902-.196.471-.062.902-.068 0-.805-.315-1.053-.316-.247-.915-.247-.316 0-.678.098-.356.097-.805.408l-.15-.84a2.8 2.8 0 0 1 .846-.419A3.4 3.4 0 0 1 14.734 9m-5.877 1.669H9.86l.59-1.531h.689l-.585 1.53h.898l-.249.727h-.922l-.337.866h1.019l-.354.773h-.962l-.681 1.804h-.701l.69-1.804h-.999l-.693 1.804h-.69l.685-1.804H6.3l.34-.773h.915l.333-.866h-.994l.244-.726H8.16l.594-1.531h.693zm6.832 1.264q-.823.029-1.335.16-.506.133-.74.397-.236.265-.236.685 0 .454.241.66.248.202.632.202.414 0 .8-.207.39-.207.637-.552zm-7.441.328h1l.34-.866h-1z"})});var ya=o(T(),1),li=o(P(),1),To=o(M(),1),Df=o(V(),1),Tx=o(W(),1);var Cx=o(V(),1),Ip=o(U(),1),$u=o(Rr(),1),OB=o(T(),1),nV=o(Q(),1),iV=o(me(),1);function Sx(e,t,r){return(0,Cx.useSelect)(a=>a(nV.store).canUser("update",{kind:e,name:t,id:r}),[e,t,r])}function Es(e={}){let t=(0,Ip.useRef)(e),r=(0,Ip.useRef)(!1),{getSettings:a}=(0,Cx.useSelect)(OB.store);(0,Ip.useLayoutEffect)(()=>{t.current=e}),(0,Ip.useEffect)(()=>{if(r.current||!t.current.url||!(0,$u.isBlobURL)(t.current.url))return;let n=(0,$u.getBlobByURL)(t.current.url);if(!n)return;let{url:i,allowedTypes:l,onChange:s,onError:c}=t.current,{mediaUpload:u}=a();u&&(r.current=!0,u({filesList:[n],allowedTypes:l,onFileChange:([m])=>{(0,$u.isBlobURL)(m?.url)||((0,$u.revokeBlobURL)(i),s(m),r.current=!1)},onError:m=>{(0,$u.revokeBlobURL)(i),c(m),r.current=!1}}))},[a])}function x1(){return(0,Cx.useSelect)(t=>{let{getSettings:r}=t(OB.store),{__experimentalDiscussionSettings:a}=r();return a?.avatarURL??""},[])}function q(){return(0,iV.useViewportMatch)("medium","<")?{}:{popoverProps:{placement:"left-start",offset:259}}}var _r=o(v(),1),jB="core/accordion-item",wfe="core/accordion-heading",Cfe={name:jB};function lV({attributes:{autoclose:e,iconPosition:t,showIcon:r,headingLevel:a,levelOptions:n},clientId:i,setAttributes:l,isSelected:s}){let c=(0,Df.useRegistry)(),{getBlockOrder:u}=(0,Df.useSelect)(ya.store),m=(0,ya.useBlockProps)({role:"group"}),p=q(),{updateBlockAttributes:d,insertBlock:f}=(0,Df.useDispatch)(ya.store),g=(0,ya.useBlockEditingMode)()==="contentOnly",b=(0,ya.useInnerBlocksProps)(m,{template:[[jB]],defaultBlock:Cfe,directInsert:!0,templateInsertUpdatesSelection:!0});return(0,_r.jsxs)(_r.Fragment,{children:[s&&!g&&(0,_r.jsxs)(_r.Fragment,{children:[(0,_r.jsx)(ya.BlockControls,{children:(0,_r.jsx)(To.ToolbarGroup,{children:(0,_r.jsx)(ya.HeadingLevelDropdown,{value:a,options:n,onChange:_=>{let x=u(i),S=[];x.forEach(C=>{let N=u(C);S.push(...N)}),c.batch(()=>{l({headingLevel:_}),d(S,{level:_})})}})})}),(0,_r.jsx)(ya.BlockControls,{group:"other",children:(0,_r.jsx)(To.ToolbarButton,{onClick:()=>{let _=(0,Tx.createBlock)(jB,{},[(0,Tx.createBlock)(wfe,{level:a}),(0,Tx.createBlock)("core/accordion-panel",{})]);f(_,void 0,i)},children:(0,li.__)("Add item")})})]}),(0,_r.jsx)(ya.InspectorControls,{children:(0,_r.jsxs)(To.__experimentalToolsPanel,{label:(0,li.__)("Settings"),resetAll:()=>{l({autoclose:!1,showIcon:!0,iconPosition:"right"})},dropdownMenuProps:p,children:[(0,_r.jsx)(To.__experimentalToolsPanelItem,{label:(0,li.__)("Auto-close"),isShownByDefault:!0,hasValue:()=>!!e,onDeselect:()=>l({autoclose:!1}),children:(0,_r.jsx)(To.ToggleControl,{isBlock:!0,label:(0,li.__)("Auto-close"),onChange:_=>{l({autoclose:_})},checked:e,help:(0,li.__)("Automatically close accordions when a new one is opened.")})}),(0,_r.jsx)(To.__experimentalToolsPanelItem,{label:(0,li.__)("Show icon"),isShownByDefault:!0,hasValue:()=>!r,onDeselect:()=>l({showIcon:!0}),children:(0,_r.jsx)(To.ToggleControl,{isBlock:!0,label:(0,li.__)("Show icon"),onChange:_=>{l({showIcon:_,iconPosition:_?t:"right"})},checked:r,help:(0,li.__)("Display a plus icon next to the accordion header.")})}),r&&(0,_r.jsx)(To.__experimentalToolsPanelItem,{label:(0,li.__)("Icon Position"),isShownByDefault:!0,hasValue:()=>t!=="right",onDeselect:()=>l({iconPosition:"right"}),children:(0,_r.jsxs)(To.__experimentalToggleGroupControl,{__next40pxDefaultSize:!0,isBlock:!0,label:(0,li.__)("Icon Position"),value:t,onChange:_=>{l({iconPosition:_})},children:[(0,_r.jsx)(To.__experimentalToggleGroupControlOption,{label:(0,li.__)("Left"),value:"left"}),(0,_r.jsx)(To.__experimentalToggleGroupControlOption,{label:(0,li.__)("Right"),value:"right"})]})})]})},"setting"),(0,_r.jsx)("div",{...b})]})}var Px=o(T(),1),sV=o(v(),1);function cV(){let e=Px.useBlockProps.save({role:"group"});return(0,sV.jsx)("div",{...Px.useInnerBlocksProps.save(e)})}var Bx={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/accordion",title:"Accordion",category:"design",description:"Displays a foldable layout that groups content in collapsible sections.",example:{},supports:{anchor:!0,html:!1,align:["wide","full"],background:{backgroundImage:!0,backgroundSize:!0,__experimentalDefaultControls:{backgroundImage:!0}},color:{background:!0,gradients:!0},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,radius:!0,style:!0,width:!0}},spacing:{padding:!0,margin:["top","bottom"],blockGap:!0},shadow:!0,layout:!0,ariaLabel:!0,interactivity:!0,typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},contentRole:!0,listView:!0},attributes:{iconPosition:{type:"string",default:"right"},showIcon:{type:"boolean",default:!0},autoclose:{type:"boolean",default:!1},headingLevel:{type:"number",default:3},levelOptions:{type:"array"}},providesContext:{"core/accordion-icon-position":"iconPosition","core/accordion-show-icon":"showIcon","core/accordion-heading-level":"headingLevel"},allowedBlocks:["core/accordion-item"],textdomain:"default",viewScriptModule:"@wordpress/block-library/accordion/view"};var uV=o(W(),1);function E(e){if(!e)return;let{metadata:t,settings:r,name:a}=e;return(0,uV.registerBlockType)({name:a,...t},r)}var{name:mV}=Bx,pV={icon:CS,example:{innerBlocks:[{name:"core/accordion-item",innerBlocks:[{name:"core/accordion-heading",attributes:{title:(0,UB.__)("Lorem ipsum dolor sit amet, consectetur.")}}]},{name:"core/accordion-item",innerBlocks:[{name:"core/accordion-heading",attributes:{title:(0,UB.__)("Suspendisse commodo lacus, interdum et.")}}]}]},edit:lV,save:cV},Tfe=()=>E({name:mV,metadata:Bx,settings:pV});var WB={};Z(WB,{init:()=>Ife,metadata:()=>Nx,name:()=>vV,settings:()=>bV});var k1=o(P(),1),qu=o(T(),1),dV=o(V(),1),Lf=o(M(),1);var Ds=o(v(),1),Pfe=[["core/accordion-heading"],["core/accordion-panel"]];function fV({attributes:e,clientId:t,setAttributes:r,isSelected:a}){let{openByDefault:n}=e,i=q(),{isSelected:l}=(0,dV.useSelect)(u=>a||n?{isSelected:!0}:{isSelected:u(qu.store).hasSelectedInnerBlock(t,!0)},[t,a,n]),s=(0,qu.useBlockProps)({className:w({"is-open":n||l})}),c=(0,qu.useInnerBlocksProps)(s,{template:Pfe,templateLock:"all",directInsert:!0,templateInsertUpdatesSelection:!0});return(0,Ds.jsxs)(Ds.Fragment,{children:[(0,Ds.jsx)(qu.InspectorControls,{children:(0,Ds.jsx)(Lf.__experimentalToolsPanel,{label:(0,k1.__)("Settings"),resetAll:()=>{r({openByDefault:!1})},dropdownMenuProps:i,children:(0,Ds.jsx)(Lf.__experimentalToolsPanelItem,{label:(0,k1.__)("Open by default"),isShownByDefault:!0,hasValue:()=>!!n,onDeselect:()=>{r({openByDefault:!1})},children:(0,Ds.jsx)(Lf.ToggleControl,{label:(0,k1.__)("Open by default"),onChange:u=>{r({openByDefault:u})},checked:n,help:(0,k1.__)("Accordion content will be displayed by default.")})})})},"setting"),(0,Ds.jsx)("div",{...c})]})}var Ix=o(T(),1);var hV=o(v(),1);function gV({attributes:e}){let{openByDefault:t}=e,r=Ix.useBlockProps.save({className:w({"is-open":t})}),a=Ix.useInnerBlocksProps.save(r);return(0,hV.jsx)("div",{...a})}var Nx={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/accordion-item",title:"Accordion Item",category:"design",description:"Wraps the heading and panel in one unit.",parent:["core/accordion"],allowedBlocks:["core/accordion-heading","core/accordion-panel"],supports:{html:!1,color:{background:!0,gradients:!0},interactivity:!0,spacing:{margin:["top","bottom"],blockGap:!0},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,radius:!0,style:!0,width:!0}},shadow:!0,layout:{allowEditing:!1},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},contentRole:!0},attributes:{openByDefault:{type:"boolean",default:!1}},providesContext:{"core/accordion-open-by-default":"openByDefault"},textdomain:"default",style:"wp-block-accordion-item"};var{name:vV}=Nx,bV={icon:wS,edit:fV,save:gV},Ife=()=>E({name:vV,metadata:Nx,settings:bV});var $B={};Z($B,{init:()=>Lfe,metadata:()=>Ex,name:()=>SV,settings:()=>TV});var yV=o(P(),1),_V=o(U(),1),Qi=o(T(),1),xV=o(V(),1),Np=o(v(),1);function kV({attributes:e,setAttributes:t,context:r}){let{title:a}=e,{"core/accordion-icon-position":n,"core/accordion-show-icon":i,"core/accordion-heading-level":l}=r,s="h"+l,{__unstableMarkNextChangeAsNotPersistent:c}=(0,xV.useDispatch)(Qi.store);(0,_V.useEffect)(()=>{n!==void 0&&i!==void 0&&(c(),t({iconPosition:n,showIcon:i}))},[n,i,t,c]);let[u,m]=(0,Qi.useSettings)("typography.fluid","layout"),p=(0,Qi.getTypographyClassesAndStyles)(e,{typography:{fluid:u},layout:{wideSize:m?.wideSize}}),d=(0,Qi.useBlockProps)(),f=(0,Qi.__experimentalGetSpacingClassesAndStyles)(e);return(0,Np.jsx)(s,{...d,children:(0,Np.jsxs)("button",{className:"wp-block-accordion-heading__toggle",style:f.style,tabIndex:"-1",children:[i&&n==="left"&&(0,Np.jsx)("span",{className:"wp-block-accordion-heading__toggle-icon","aria-hidden":"true",children:"+"}),(0,Np.jsx)(Qi.RichText,{withoutInteractiveFormatting:!0,disableLineBreaks:!0,tagName:"span",value:a,onChange:h=>t({title:h}),placeholder:(0,yV.__)("Accordion title"),className:"wp-block-accordion-heading__toggle-title",style:{letterSpacing:p.style.letterSpacing,textDecoration:p.style.textDecoration}}),i&&n==="right"&&(0,Np.jsx)("span",{className:"wp-block-accordion-heading__toggle-icon","aria-hidden":"true",children:"+"})]})})}var Zu=o(T(),1),Ep=o(v(),1);function wV({attributes:e}){let{level:t,title:r,iconPosition:a,showIcon:n}=e,i="h"+(t||3),l=(0,Zu.getTypographyClassesAndStyles)(e),s=Zu.useBlockProps.save(),c=(0,Zu.__experimentalGetSpacingClassesAndStyles)(e);return(0,Ep.jsx)(i,{...s,children:(0,Ep.jsxs)("button",{type:"button",className:"wp-block-accordion-heading__toggle",style:c.style,children:[n&&a==="left"&&(0,Ep.jsx)("span",{className:"wp-block-accordion-heading__toggle-icon","aria-hidden":"true",children:"+"}),(0,Ep.jsx)(Zu.RichText.Content,{className:"wp-block-accordion-heading__toggle-title",tagName:"span",value:r,style:{letterSpacing:l.style.letterSpacing,textDecoration:l.style.textDecoration}}),n&&a==="right"&&(0,Ep.jsx)("span",{className:"wp-block-accordion-heading__toggle-icon","aria-hidden":"true",children:"+"})]})})}var Ex={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/accordion-heading",title:"Accordion Heading",category:"design",description:"Displays a heading that toggles the accordion panel.",parent:["core/accordion-item"],usesContext:["core/accordion-icon-position","core/accordion-show-icon","core/accordion-heading-level"],supports:{anchor:!0,color:{background:!0,gradients:!0},align:!1,interactivity:!0,spacing:{padding:!0,__experimentalDefaultControls:{padding:!0},__experimentalSkipSerialization:!0,__experimentalSelector:".wp-block-accordion-heading__toggle"},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,radius:!0,style:!0,width:!0}},typography:{__experimentalSkipSerialization:["textDecoration","letterSpacing"],fontSize:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0,fontFamily:!0}},shadow:!0,visibility:!1,lock:!1},selectors:{typography:{letterSpacing:".wp-block-accordion-heading .wp-block-accordion-heading__toggle-title",textDecoration:".wp-block-accordion-heading .wp-block-accordion-heading__toggle-title"}},attributes:{openByDefault:{type:"boolean",default:!1},title:{type:"rich-text",source:"rich-text",selector:".wp-block-accordion-heading__toggle-title",role:"content"},level:{type:"number"},iconPosition:{type:"string",enum:["left","right"],default:"right"},showIcon:{type:"boolean",default:!0}},textdomain:"default"};var Dl=o(T(),1),Yi=o(v(),1),Efe={attributes:{openByDefault:{type:"boolean",default:!1},title:{type:"rich-text",source:"rich-text",selector:".wp-block-accordion-heading__toggle-title",role:"content"},level:{type:"number"},iconPosition:{type:"string",enum:["left","right"],default:"right"},showIcon:{type:"boolean",default:!0}},supports:{anchor:!0,color:{background:!0,gradients:!0},align:!1,interactivity:!0,spacing:{padding:!0,__experimentalDefaultControls:{padding:!0},__experimentalSkipSerialization:!0,__experimentalSelector:".wp-block-accordion-heading__toggle"},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,radius:!0,style:!0,width:!0}},typography:{fontSize:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0,fontFamily:!0}},shadow:!0,visibility:!1},save({attributes:e}){let{level:t,title:r,iconPosition:a,showIcon:n}=e,i="h"+(t||3),l=Dl.useBlockProps.save(),s=(0,Dl.__experimentalGetSpacingClassesAndStyles)(e);return(0,Yi.jsx)(i,{...l,children:(0,Yi.jsxs)("button",{className:"wp-block-accordion-heading__toggle",style:s.style,children:[n&&a==="left"&&(0,Yi.jsx)("span",{className:"wp-block-accordion-heading__toggle-icon","aria-hidden":"true",children:"+"}),(0,Yi.jsx)(Dl.RichText.Content,{className:"wp-block-accordion-heading__toggle-title",tagName:"span",value:r}),n&&a==="right"&&(0,Yi.jsx)("span",{className:"wp-block-accordion-heading__toggle-icon","aria-hidden":"true",children:"+"})]})})}},Dfe={attributes:{openByDefault:{type:"boolean",default:!1},title:{type:"rich-text",source:"rich-text",selector:".wp-block-accordion-heading__toggle-title",role:"content"},level:{type:"number"},iconPosition:{type:"string",enum:["left","right"],default:"right"},showIcon:{type:"boolean",default:!0}},supports:{anchor:!0,color:{background:!0,gradients:!0},align:!1,interactivity:!0,spacing:{padding:!0,__experimentalDefaultControls:{padding:!0},__experimentalSkipSerialization:!0,__experimentalSelector:".wp-block-accordion-heading__toggle"},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,radius:!0,style:!0,width:!0}},typography:{__experimentalSkipSerialization:["textDecoration","letterSpacing"],fontSize:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0,fontFamily:!0}},shadow:!0,visibility:!1,lock:!1},save({attributes:e}){let{level:t,title:r,iconPosition:a,showIcon:n}=e,i="h"+(t||3),l=(0,Dl.getTypographyClassesAndStyles)(e),s=Dl.useBlockProps.save(),c=(0,Dl.__experimentalGetSpacingClassesAndStyles)(e);return(0,Yi.jsx)(i,{...s,children:(0,Yi.jsxs)("button",{className:"wp-block-accordion-heading__toggle",style:c.style,children:[n&&a==="left"&&(0,Yi.jsx)("span",{className:"wp-block-accordion-heading__toggle-icon","aria-hidden":"true",children:"+"}),(0,Yi.jsx)(Dl.RichText.Content,{className:"wp-block-accordion-heading__toggle-title",tagName:"span",value:r,style:{letterSpacing:l.style.letterSpacing,textDecoration:l.style.textDecoration}}),n&&a==="right"&&(0,Yi.jsx)("span",{className:"wp-block-accordion-heading__toggle-icon","aria-hidden":"true",children:"+"})]})})}},CV=[Efe,Dfe];var{name:SV}=Ex,TV={icon:kS,edit:kV,save:wV,deprecated:CV},Lfe=()=>E({name:SV,metadata:Ex,settings:TV});var qB={};Z(qB,{init:()=>Afe,metadata:()=>Lx,name:()=>DV,settings:()=>LV});var Mf=o(T(),1),PV=o(V(),1),BV=o(v(),1);function IV({attributes:e,context:t,clientId:r,isSelected:a}){let{allowedBlocks:n,templateLock:i}=e,l=t["core/accordion-open-by-default"],{hasSelection:s}=(0,PV.useSelect)(m=>{if(a||l)return{hasSelection:!0};let{getBlockRootClientId:p,isBlockSelected:d,hasSelectedInnerBlock:f}=m(Mf.store),h=p(r);return{hasSelection:d(h)||f(h,!0)}},[r,a,l]),c=(0,Mf.useBlockProps)({"aria-hidden":!s,role:"region"}),u=(0,Mf.useInnerBlocksProps)(c,{allowedBlocks:n,template:[["core/paragraph",{}]],templateLock:i});return(0,BV.jsx)("div",{...u})}var Dx=o(T(),1),NV=o(v(),1);function EV(){let e=Dx.useBlockProps.save({role:"region"}),t=Dx.useInnerBlocksProps.save(e);return(0,NV.jsx)("div",{...t})}var Lx={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/accordion-panel",title:"Accordion Panel",category:"design",description:"Contains the hidden or revealed content beneath the heading.",parent:["core/accordion-item"],usesContext:["core/accordion-open-by-default"],supports:{html:!1,color:{background:!0,gradients:!0},interactivity:!0,spacing:{padding:!0,blockGap:!0,__experimentalDefaultControls:{padding:!0,blockGap:!0}},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,radius:!0,style:!0,width:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},shadow:!0,layout:{allowEditing:!1},visibility:!1,contentRole:!0,allowedBlocks:!0,lock:!1},attributes:{templateLock:{type:["string","boolean"],enum:["all","insert","contentOnly",!1],default:!1}},textdomain:"default",style:"wp-block-accordion-panel"};var{name:DV}=Lx,LV={icon:E0,edit:IV,save:EV},Afe=()=>E({name:DV,metadata:Lx,settings:LV});var ZB={};Z(ZB,{init:()=>zfe,metadata:()=>Mx,name:()=>zV,settings:()=>VV});var Mx={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/archives",title:"Archives",category:"widgets",description:"Display a date archive of your posts.",textdomain:"default",attributes:{displayAsDropdown:{type:"boolean",default:!1},showLabel:{type:"boolean",default:!0},showPostCounts:{type:"boolean",default:!1},type:{type:"string",default:"monthly"}},supports:{anchor:!0,align:!0,__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0},html:!1,spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},interactivity:{clientNavigation:!0}}};var $a=o(M(),1),Go=o(P(),1),Ax=o(T(),1),MV=o(Fu(),1),AV=o(me(),1);var Zr=o(v(),1);function RV({attributes:e,setAttributes:t,name:r}){let{showLabel:a,showPostCounts:n,displayAsDropdown:i,type:l}=e,s=q(),{content:c,status:u,error:m}=(0,MV.useServerSideRender)({attributes:e,skipBlockSupportAttributes:!0,block:r}),p=(0,AV.useDisabled)(),d=(0,Ax.useBlockProps)({ref:p});return(0,Zr.jsxs)(Zr.Fragment,{children:[(0,Zr.jsx)(Ax.InspectorControls,{children:(0,Zr.jsxs)($a.__experimentalToolsPanel,{label:(0,Go.__)("Settings"),resetAll:()=>{t({displayAsDropdown:!1,showLabel:!0,showPostCounts:!1,type:"monthly"})},dropdownMenuProps:s,children:[(0,Zr.jsx)($a.__experimentalToolsPanelItem,{label:(0,Go.__)("Display as dropdown"),isShownByDefault:!0,hasValue:()=>i,onDeselect:()=>t({displayAsDropdown:!1}),children:(0,Zr.jsx)($a.ToggleControl,{label:(0,Go.__)("Display as dropdown"),checked:i,onChange:()=>t({displayAsDropdown:!i})})}),i&&(0,Zr.jsx)($a.__experimentalToolsPanelItem,{label:(0,Go.__)("Show label"),isShownByDefault:!0,hasValue:()=>!a,onDeselect:()=>t({showLabel:!0}),children:(0,Zr.jsx)($a.ToggleControl,{label:(0,Go.__)("Show label"),checked:a,onChange:()=>t({showLabel:!a})})}),(0,Zr.jsx)($a.__experimentalToolsPanelItem,{label:(0,Go.__)("Show post counts"),isShownByDefault:!0,hasValue:()=>n,onDeselect:()=>t({showPostCounts:!1}),children:(0,Zr.jsx)($a.ToggleControl,{label:(0,Go.__)("Show post counts"),checked:n,onChange:()=>t({showPostCounts:!n})})}),(0,Zr.jsx)($a.__experimentalToolsPanelItem,{label:(0,Go.__)("Group by"),isShownByDefault:!0,hasValue:()=>l!=="monthly",onDeselect:()=>t({type:"monthly"}),children:(0,Zr.jsx)($a.SelectControl,{__next40pxDefaultSize:!0,label:(0,Go.__)("Group by"),options:[{label:(0,Go.__)("Year"),value:"yearly"},{label:(0,Go.__)("Month"),value:"monthly"},{label:(0,Go.__)("Week"),value:"weekly"},{label:(0,Go.__)("Day"),value:"daily"}],value:l,onChange:f=>t({type:f})})})]})}),u==="loading"&&(0,Zr.jsx)("div",{...d,children:(0,Zr.jsx)($a.Spinner,{})}),u==="error"&&(0,Zr.jsx)("div",{...d,children:(0,Zr.jsx)("p",{children:(0,Go.sprintf)((0,Go.__)("Error: %s"),m)})}),u==="success"&&(0,Zr.jsx)(uo,{wrapperProps:d,html:c})]})}var{name:zV}=Mx,VV={icon:AS,example:{},edit:RV},zfe=()=>E({name:zV,metadata:Mx,settings:VV});var QB={};Z(QB,{init:()=>Ufe,metadata:()=>Rx,name:()=>tF,settings:()=>rF});var Rx={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/avatar",title:"Avatar",category:"theme",description:"Add a user\u2019s avatar.",textdomain:"default",attributes:{userId:{type:"number"},size:{type:"number",default:96},isLink:{type:"boolean",default:!1},linkTarget:{type:"string",default:"_self"}},usesContext:["postType","postId","commentId"],supports:{anchor:!0,html:!1,align:!0,alignWide:!1,spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},__experimentalBorder:{__experimentalSkipSerialization:!0,radius:!0,width:!0,color:!0,style:!0,__experimentalDefaultControls:{radius:!0}},color:{text:!1,background:!1},filter:{duotone:!0},interactivity:{clientNavigation:!0}},selectors:{border:".wp-block-avatar img",filter:{duotone:".wp-block-avatar img"}},editorStyle:"wp-block-avatar-editor",style:"wp-block-avatar"};var Dp=o(T(),1),Sn=o(M(),1),Xi=o(P(),1),Vx=o(mr(),1);var w1=o(Q(),1),Ku=o(P(),1),HV=o(V(),1);function OV(e){let t=e?e[0]:24,r=e?e[e.length-1]:96,a=Math.floor(r*2.5);return{minSize:t,maxSize:a}}function jV({commentId:e}){let[t]=(0,w1.useEntityProp)("root","comment","author_avatar_urls",e),[r]=(0,w1.useEntityProp)("root","comment","author_name",e),a=t?Object.values(t):null,n=t?Object.keys(t):null,{minSize:i,maxSize:l}=OV(n),s=x1();return{src:a?a[a.length-1]:s,minSize:i,maxSize:l,alt:r?(0,Ku.sprintf)((0,Ku.__)("%s Avatar"),r):(0,Ku.__)("Default Avatar")}}function UV({userId:e,postId:t,postType:r}){let{authorDetails:a}=(0,HV.useSelect)(u=>{let{getEditedEntityRecord:m,getUser:p}=u(w1.store);if(e)return{authorDetails:p(e)};let d=m("postType",r,t)?.author;return{authorDetails:d?p(d):null}},[r,t,e]),n=a?.avatar_urls?Object.values(a.avatar_urls):null,i=a?.avatar_urls?Object.keys(a.avatar_urls):null,{minSize:l,maxSize:s}=OV(i),c=x1();return{src:n?n[n.length-1]:c,minSize:l,maxSize:s,alt:a?(0,Ku.sprintf)((0,Ku.__)("%s Avatar"),a?.name):(0,Ku.__)("Default Avatar")}}var KB=o(P(),1),WV=o(M(),1),$V=o(V(),1),qV=o(Q(),1),zx=o(U(),1),ZV=o(me(),1),KV=o(Wo(),1),QV=o(v(),1),Ffe={who:"authors",per_page:100,_fields:"id,name",context:"view"};function YV({value:e,onChange:t}){let[r,a]=(0,zx.useState)(""),{authors:n,isLoading:i}=(0,$V.useSelect)(s=>{let{getUsers:c,isResolving:u}=s(qV.store),m={...Ffe};return r&&(m.search=r,m.search_columns=["name"]),{authors:c(m),isLoading:u("getUsers",[m])}},[r]),l=(0,zx.useMemo)(()=>(n??[]).map(s=>({value:s.id,label:(0,KV.decodeEntities)(s.name)})),[n]);return(0,QV.jsx)(WV.ComboboxControl,{__next40pxDefaultSize:!0,label:(0,KB.__)("User"),help:(0,KB.__)("Select the avatar user to display, if it is blank it will use the post/page author."),value:e,onChange:t,options:l,onFilterValueChange:(0,ZV.debounce)(a,300),isLoading:i})}var Mt=o(v(),1),XV=({setAttributes:e,avatar:t,attributes:r,selectUser:a})=>{let n=q();return(0,Mt.jsx)(Dp.InspectorControls,{children:(0,Mt.jsxs)(Sn.__experimentalToolsPanel,{label:(0,Xi.__)("Settings"),resetAll:()=>{e({size:96,isLink:!1,linkTarget:"_self",userId:void 0})},dropdownMenuProps:n,children:[(0,Mt.jsx)(Sn.__experimentalToolsPanelItem,{label:(0,Xi.__)("Image size"),isShownByDefault:!0,hasValue:()=>r?.size!==96,onDeselect:()=>e({size:96}),children:(0,Mt.jsx)(Sn.RangeControl,{__next40pxDefaultSize:!0,label:(0,Xi.__)("Image size"),onChange:i=>e({size:i}),min:t.minSize,max:t.maxSize,initialPosition:r?.size,value:r?.size})}),(0,Mt.jsx)(Sn.__experimentalToolsPanelItem,{label:(0,Xi.__)("Link to user profile"),isShownByDefault:!0,hasValue:()=>r?.isLink,onDeselect:()=>e({isLink:!1}),children:(0,Mt.jsx)(Sn.ToggleControl,{label:(0,Xi.__)("Link to user profile"),onChange:()=>e({isLink:!r.isLink}),checked:r.isLink})}),r.isLink&&(0,Mt.jsx)(Sn.__experimentalToolsPanelItem,{label:(0,Xi.__)("Open in new tab"),isShownByDefault:!0,hasValue:()=>r?.linkTarget!=="_self",onDeselect:()=>e({linkTarget:"_self"}),children:(0,Mt.jsx)(Sn.ToggleControl,{label:(0,Xi.__)("Open in new tab"),onChange:i=>e({linkTarget:i?"_blank":"_self"}),checked:r.linkTarget==="_blank"})}),a&&(0,Mt.jsx)(Sn.__experimentalToolsPanelItem,{label:(0,Xi.__)("User"),isShownByDefault:!0,hasValue:()=>!!r?.userId,onDeselect:()=>e({userId:void 0}),children:(0,Mt.jsx)(YV,{value:r?.userId,onChange:i=>{e({userId:i})}})})]})})},Hfe=({children:e,isLink:t})=>t?(0,Mt.jsx)("a",{href:"#avatar-pseudo-link",className:"wp-block-avatar__link",onClick:r=>r.preventDefault(),children:e}):e,JV=({setAttributes:e,attributes:t,avatar:r,blockProps:a,isSelected:n})=>{let i=(0,Dp.__experimentalUseBorderProps)(t),l=(0,Vx.addQueryArgs)((0,Vx.removeQueryArgs)(r?.src,["s"]),{s:t?.size*2});return(0,Mt.jsx)("div",{...a,children:(0,Mt.jsx)(Hfe,{isLink:t.isLink,children:(0,Mt.jsx)(Sn.ResizableBox,{size:{width:t.size,height:t.size},showHandle:n,onResizeStop:(s,c,u,m)=>{e({size:parseInt(t.size+(m.height||m.width),10)})},lockAspectRatio:!0,enable:{top:!1,right:!(0,Xi.isRTL)(),bottom:!0,left:(0,Xi.isRTL)()},minWidth:r.minSize,maxWidth:r.maxSize,children:(0,Mt.jsx)("img",{src:l,alt:r.alt,className:w("avatar","avatar-"+t.size,"photo","wp-block-avatar__image",i.className),style:i.style})})})})},Ofe=({attributes:e,context:t,setAttributes:r,isSelected:a})=>{let{commentId:n}=t,i=(0,Dp.useBlockProps)(),l=jV({commentId:n});return(0,Mt.jsxs)(Mt.Fragment,{children:[(0,Mt.jsx)(XV,{avatar:l,setAttributes:r,attributes:e,selectUser:!1}),(0,Mt.jsx)(JV,{attributes:e,avatar:l,blockProps:i,isSelected:a,setAttributes:r})]})},jfe=({attributes:e,context:t,setAttributes:r,isSelected:a})=>{let{postId:n,postType:i}=t,l=UV({userId:e?.userId,postId:n,postType:i}),s=(0,Dp.useBlockProps)();return(0,Mt.jsxs)(Mt.Fragment,{children:[(0,Mt.jsx)(XV,{selectUser:!0,attributes:e,avatar:l,setAttributes:r}),(0,Mt.jsx)(JV,{attributes:e,avatar:l,blockProps:s,isSelected:a,setAttributes:r})]})};function eF(e){return e?.context?.commentId||e?.context?.commentId===null?(0,Mt.jsx)(Ofe,{...e}):(0,Mt.jsx)(jfe,{...e})}var{name:tF}=Rx,rF={icon:I0,edit:eF,example:{}},Ufe=()=>E({name:tF,metadata:Rx,settings:rF});var aI={};Z(aI,{init:()=>the,metadata:()=>Ox,name:()=>PF,settings:()=>jx});var oI=o(P(),1);var TF=o(W(),1);var YB=o(T(),1),C1=o(v(),1),oF=[{attributes:{src:{type:"string",source:"attribute",selector:"audio",attribute:"src"},caption:{type:"string",source:"html",selector:"figcaption"},id:{type:"number"},autoplay:{type:"boolean",source:"attribute",selector:"audio",attribute:"autoplay"},loop:{type:"boolean",source:"attribute",selector:"audio",attribute:"loop"},preload:{type:"string",source:"attribute",selector:"audio",attribute:"preload"}},supports:{align:!0},save({attributes:e}){let{autoplay:t,caption:r,loop:a,preload:n,src:i}=e;return(0,C1.jsxs)("figure",{children:[(0,C1.jsx)("audio",{controls:"controls",src:i,autoPlay:t,loop:a,preload:n}),!YB.RichText.isEmpty(r)&&(0,C1.jsx)(YB.RichText.Content,{tagName:"figcaption",value:r})]})}}];var vF=o(Rr(),1),Za=o(M(),1),Tn=o(T(),1),qa=o(P(),1),bF=o(V(),1);var yF=o(xr(),1),_F=o(U(),1);function Af(e,t){var r=0,a,n;t=t||{};function i(){var l=a,s=arguments.length,c,u;e:for(;l;){if(l.args.length!==arguments.length){l=l.next;continue}for(u=0;u<s;u++)if(l.args[u]!==arguments[u]){l=l.next;continue e}return l!==a&&(l===n&&(n=l.prev),l.prev.next=l.next,l.next&&(l.next.prev=l.prev),l.next=a,l.prev=null,a.prev=l,a=l),l.val}for(c=new Array(s),u=0;u<s;u++)c[u]=arguments[u];return l={args:c,val:e.apply(null,c)},a?(a.prev=l,l.next=a):n=l,r===t.maxSize?(n=n.prev,n.next=null):r++,a=l,l.val}return i.clear=function(){a=null,n=null,r=0},i}var cF=o(M(),1),JB=o(U(),1),Ms=o(W(),1);var Ls={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/embed",title:"Embed",category:"embed",description:"Add a block that displays content pulled from other sites, like Twitter or YouTube.",textdomain:"default",attributes:{url:{type:"string",role:"content"},caption:{type:"rich-text",source:"rich-text",selector:"figcaption",role:"content"},type:{type:"string",role:"content"},providerNameSlug:{type:"string",role:"content"},allowResponsive:{type:"boolean",default:!0},responsive:{type:"boolean",default:!1,role:"content"},previewable:{type:"boolean",default:!0,role:"content"}},supports:{anchor:!0,align:!0,spacing:{margin:!0},interactivity:{clientNavigation:!0}},editorStyle:"wp-block-embed-editor",style:"wp-block-embed"};var S1=[{ratio:"2.33",className:"wp-embed-aspect-21-9"},{ratio:"2.00",className:"wp-embed-aspect-18-9"},{ratio:"1.78",className:"wp-embed-aspect-16-9"},{ratio:"1.33",className:"wp-embed-aspect-4-3"},{ratio:"1.00",className:"wp-embed-aspect-1-1"},{ratio:"0.56",className:"wp-embed-aspect-9-16"},{ratio:"0.50",className:"wp-embed-aspect-1-2"}],XB="wp-embed";var lF=o(iF(),1),{lock:sF,unlock:K}=(0,lF.__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/block-library");var Fx=o(v(),1),{name:Rf}=Ls,{kebabCase:Wfe}=K(cF.privateApis),uF=e=>(0,Ms.getBlockVariations)(Rf)?.find(({name:t})=>t===e),eI=(e,t=[])=>t.some(r=>e.match(r)),$fe=e=>(0,Ms.getBlockVariations)(Rf)?.find(({patterns:t})=>eI(e,t)),mF=e=>e&&e.includes('class="wp-embedded-content"'),pF=e=>{let t=e.url||e.thumbnail_url,r=(0,Fx.jsx)("p",{children:(0,Fx.jsx)("img",{src:t,alt:e.title,width:"100%"})});return(0,JB.renderToString)(r)},Yu=(e,t={})=>{let{preview:r,attributes:a={}}=e,{url:n,providerNameSlug:i,type:l,...s}=a;if(!n||!(0,Ms.getBlockType)(Rf))return;let c=$fe(n),u=i==="wordpress"||l===XB;if(!u&&c&&(c.attributes.providerNameSlug!==i||!i))return(0,Ms.createBlock)(Rf,{url:n,...s,...c.attributes});let p=(0,Ms.getBlockVariations)(Rf)?.find(({name:d})=>d==="wordpress");if(!(!p||!r||!mF(r.html)||u))return(0,Ms.createBlock)(Rf,{url:n,...p.attributes,...t})},qfe=e=>e?S1.some(({className:t})=>e.includes(t)):!1,Qu=e=>{if(!e)return e;let t=S1.reduce((a,{className:n})=>(a.push(n),a),["wp-has-aspect-ratio"]),r=e;for(let a of t)r=r.replace(a,"");return r.trim()};function Zfe(e){return/padding-(top|bottom)\s*:\s*[\d.]+%/i.test(e)}function tI(e,t,r=!0){if(!r||Zfe(e))return Qu(t);let a=document.implementation.createHTMLDocument("");a.body.innerHTML=e;let n=a.body.querySelector("iframe");if(n&&n.height&&n.width){let i=(n.width/n.height).toFixed(2);for(let l=0;l<S1.length;l++){let s=S1[l];if(i>=s.ratio)return i-s.ratio>.1?Qu(t):w(Qu(t),s.className,"wp-has-aspect-ratio")}}return t}function dF(e,t){t((0,Ms.createBlock)("core/paragraph",{content:(0,JB.renderToString)((0,Fx.jsx)("a",{href:e,children:e}))}))}var Kfe=Af((e,t,r,a,n=!0)=>{if(!e)return{};let i={},{type:l="rich"}=e,{html:s,provider_name:c}=e,u=Wfe((c||t).toLowerCase());return mF(s)&&(l=XB),(s||l==="photo")&&(i.type=l,i.providerNameSlug=u),qfe(r)||(i.className=tI(s,r,a&&n)),i}),fF=(e,t,r,a)=>{let{allowResponsive:n,className:i}=e;return{...e,...Kfe(t,r,i,a,n)}};var Lp=o(U(),1),hF=o(me(),1),T1=o(P(),1),Oc=o(T(),1),gF=o(M(),1);var Hx=o(W(),1),Xu=o(v(),1);function _a({attributeKey:e="caption",attributes:t,setAttributes:r,isSelected:a,insertBlocksAfter:n,placeholder:i=(0,T1.__)("Add caption"),label:l=(0,T1.__)("Caption text"),showToolbarButton:s=!0,excludeElementClassName:c,className:u,readOnly:m,tagName:p="figcaption",addLabel:d=(0,T1.__)("Add caption"),removeLabel:f=(0,T1.__)("Remove caption"),icon:h=ZS,...g}){let b=t[e],y=(0,hF.usePrevious)(b),k=Oc.RichText.isEmpty(b),_=Oc.RichText.isEmpty(y),[x,S]=(0,Lp.useState)(!k);(0,Lp.useEffect)(()=>{!k&&_&&S(!0)},[k,_]),(0,Lp.useEffect)(()=>{!a&&k&&S(!1)},[a,k]);let C=(0,Lp.useCallback)(N=>{N&&k&&N.focus()},[k]);return(0,Xu.jsxs)(Xu.Fragment,{children:[s&&(0,Xu.jsx)(Oc.BlockControls,{group:"block",children:(0,Xu.jsx)(gF.ToolbarButton,{onClick:()=>{S(!x),x&&b&&r({[e]:void 0})},icon:h,isPressed:x,label:x?f:d})}),x&&(!Oc.RichText.isEmpty(b)||a)&&(0,Xu.jsx)(Oc.RichText,{identifier:e,tagName:p,className:w(u,c?"":(0,Oc.__experimentalGetElementClassName)("caption")),ref:C,"aria-label":l,placeholder:i,value:b,onChange:N=>r({[e]:N}),inlineToolbar:!0,__unstableOnSplitAtEnd:()=>n((0,Hx.createBlock)((0,Hx.getDefaultBlockName)())),readOnly:m,...g})]})}var kr=o(v(),1),rI=["audio"];function Qfe({attributes:e,className:t,setAttributes:r,onReplace:a,isSelected:n,insertBlocksAfter:i}){let{id:l,autoplay:s,loop:c,preload:u,src:m}=e,[p,d]=(0,_F.useState)(e.blob),h=(0,Tn.useBlockEditingMode)()==="default";Es({url:p,allowedTypes:rI,onChange:x,onError:k});function g(B){return D=>{r({[B]:D})}}function b(B){if(B!==m){let D=Yu({attributes:{url:B}});if(D!==void 0&&a){a(D);return}r({src:B,id:void 0,blob:void 0}),d()}}let{createErrorNotice:y}=(0,bF.useDispatch)(yF.store);function k(B){y(B,{type:"snackbar"})}function _(B){return B?(0,qa.__)("Autoplay may cause usability issues for some users."):null}function x(B){if(!B||!B.url){r({src:void 0,id:void 0,caption:void 0,blob:void 0}),d();return}if((0,vF.isBlobURL)(B.url)){d(B.url);return}r({blob:void 0,src:B.url,id:B.id,caption:B.caption}),d()}let S=w(t,{"is-transient":!!p}),C=(0,Tn.useBlockProps)({className:S}),N=q();return!m&&!p?(0,kr.jsx)("div",{...C,children:(0,kr.jsx)(Tn.MediaPlaceholder,{icon:(0,kr.jsx)(Tn.BlockIcon,{icon:ni}),onSelect:x,onSelectURL:b,accept:"audio/*",allowedTypes:rI,value:e,onError:k})}):(0,kr.jsxs)(kr.Fragment,{children:[n&&(0,kr.jsx)(Tn.BlockControls,{group:"other",children:(0,kr.jsx)(Tn.MediaReplaceFlow,{mediaId:l,mediaURL:m,allowedTypes:rI,accept:"audio/*",onSelect:x,onSelectURL:b,onError:k,onReset:()=>x(void 0),variant:"toolbar"})}),(0,kr.jsx)(Tn.InspectorControls,{children:(0,kr.jsxs)(Za.__experimentalToolsPanel,{label:(0,qa.__)("Settings"),resetAll:()=>{r({autoplay:!1,loop:!1,preload:void 0})},dropdownMenuProps:N,children:[(0,kr.jsx)(Za.__experimentalToolsPanelItem,{label:(0,qa.__)("Autoplay"),isShownByDefault:!0,hasValue:()=>!!s,onDeselect:()=>r({autoplay:!1}),children:(0,kr.jsx)(Za.ToggleControl,{label:(0,qa.__)("Autoplay"),onChange:g("autoplay"),checked:!!s,help:_})}),(0,kr.jsx)(Za.__experimentalToolsPanelItem,{label:(0,qa.__)("Loop"),isShownByDefault:!0,hasValue:()=>!!c,onDeselect:()=>r({loop:!1}),children:(0,kr.jsx)(Za.ToggleControl,{label:(0,qa.__)("Loop"),onChange:g("loop"),checked:!!c})}),(0,kr.jsx)(Za.__experimentalToolsPanelItem,{label:(0,qa.__)("Preload"),isShownByDefault:!0,hasValue:()=>!!u,onDeselect:()=>r({preload:void 0}),children:(0,kr.jsx)(Za.SelectControl,{__next40pxDefaultSize:!0,label:(0,qa._x)("Preload","noun; Audio block parameter"),value:u||"",onChange:B=>r({preload:B||void 0}),options:[{value:"",label:(0,qa.__)("Browser default")},{value:"auto",label:(0,qa.__)("Auto")},{value:"metadata",label:(0,qa.__)("Metadata")},{value:"none",label:(0,qa._x)("None","Preload value")}]})})]})}),(0,kr.jsxs)("figure",{...C,children:[(0,kr.jsx)(Za.Disabled,{isDisabled:!n,children:(0,kr.jsx)("audio",{controls:"controls",src:m??p})}),!!p&&(0,kr.jsx)(Za.Spinner,{}),(0,kr.jsx)(_a,{attributes:e,setAttributes:r,isSelected:n,insertBlocksAfter:i,label:(0,qa.__)("Audio caption text"),showToolbarButton:n&&h})]})]})}var xF=Qfe;var Ox={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/audio",title:"Audio",category:"media",description:"Embed a simple audio player.",keywords:["music","sound","podcast","recording"],textdomain:"default",attributes:{blob:{type:"string",role:"local"},src:{type:"string",source:"attribute",selector:"audio",attribute:"src",role:"content"},caption:{type:"rich-text",source:"rich-text",selector:"figcaption",role:"content"},id:{type:"number",role:"content"},autoplay:{type:"boolean",source:"attribute",selector:"audio",attribute:"autoplay"},loop:{type:"boolean",source:"attribute",selector:"audio",attribute:"loop"},preload:{type:"string",source:"attribute",selector:"audio",attribute:"preload"}},supports:{anchor:!0,align:!0,spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},interactivity:{clientNavigation:!0}},editorStyle:"wp-block-audio-editor",style:"wp-block-audio"};var Mp=o(T(),1),P1=o(v(),1);function kF({attributes:e}){let{autoplay:t,caption:r,loop:a,preload:n,src:i}=e;return i&&(0,P1.jsxs)("figure",{...Mp.useBlockProps.save(),children:[(0,P1.jsx)("audio",{controls:"controls",src:i,autoPlay:t,loop:a,preload:n}),!Mp.RichText.isEmpty(r)&&(0,P1.jsx)(Mp.RichText.Content,{tagName:"figcaption",value:r,className:(0,Mp.__experimentalGetElementClassName)("caption")})]})}var wF=o(Rr(),1),CF=o(W(),1),Xfe={from:[{type:"files",isMatch(e){return e.length===1&&e[0].type.indexOf("audio/")===0},transform(e){let t=e[0];return(0,CF.createBlock)("core/audio",{blob:(0,wF.createBlobURL)(t)})}},{type:"shortcode",tag:"audio",attributes:{src:{type:"string",shortcode:({named:{src:e,mp3:t,m4a:r,ogg:a,wav:n,wma:i}})=>e||t||r||a||n||i},loop:{type:"string",shortcode:({named:{loop:e}})=>e},autoplay:{type:"string",shortcode:({named:{autoplay:e}})=>e},preload:{type:"string",shortcode:({named:{preload:e}})=>e}}}]},SF=Xfe;var{fieldsKey:Jfe,formKey:ehe}=K(TF.privateApis),{name:PF}=Ox,jx={icon:ni,example:{attributes:{src:"https://upload.wikimedia.org/wikipedia/commons/d/dd/Armstrong_Small_Step.ogg"},viewportWidth:350},transforms:SF,deprecated:oF,edit:xF,save:kF};window.__experimentalContentOnlyInspectorFields&&(jx[Jfe]=[{id:"audio",label:(0,oI.__)("Audio"),type:"media",Edit:{control:"media",allowedTypes:["audio"],multiple:!1},getValue:({item:e})=>({id:e.id,url:e.src}),setValue:({value:e})=>({id:e.id,src:e.url})},{id:"caption",label:(0,oI.__)("Caption"),type:"text",Edit:"rich-text"}],jx[ehe]={fields:["audio","caption"]});var the=()=>E({name:PF,metadata:Ox,settings:jx});var nI={};Z(nI,{init:()=>ohe,metadata:()=>Ux,name:()=>DF,settings:()=>LF});var Ux={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/breadcrumbs",title:"Breadcrumbs",category:"theme",description:"Display a breadcrumb trail showing the path to the current page.",textdomain:"default",attributes:{prefersTaxonomy:{type:"boolean",default:!1},separator:{type:"string",default:"/"},showHomeItem:{type:"boolean",default:!0},showCurrentItem:{type:"boolean",default:!0},showOnHomePage:{type:"boolean",default:!1}},usesContext:["postId","postType","templateSlug"],supports:{anchor:!0,html:!1,align:["wide","full"],spacing:{margin:!0,padding:!0},color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!1,color:!0,width:!0,style:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}},style:"wp-block-breadcrumbs"};var zr=o(P(),1),B1=o(T(),1),$o=o(M(),1),BF=o(V(),1),Wx=o(Q(),1),jc=o(U(),1),IF=o(Fu(),1),NF=o(me(),1);var wt=o(v(),1),Gx="/";function EF({attributes:e,setAttributes:t,name:r,context:{postId:a,postType:n,templateSlug:i}}){let{separator:l,showHomeItem:s,showCurrentItem:c,prefersTaxonomy:u,showOnHomePage:m}=e,{post:p,isPostTypeHierarchical:d,postTypeHasTaxonomies:f,hasTermsAssigned:h,isLoading:g}=(0,BF.useSelect)(I=>{if(!n)return{};let R=I(Wx.store).getEntityRecord("postType",n,a),$=I(Wx.store).getPostType(n),j=$&&$.taxonomies.length,G;return j&&(G=I(Wx.store).getTaxonomies({type:n,per_page:-1})),{post:R,isPostTypeHierarchical:$?.hierarchical,postTypeHasTaxonomies:j,hasTermsAssigned:R&&(G||[]).filter(({visibility:O})=>O?.publicly_queryable).some(O=>!!R[O.rest_base]?.length),isLoading:a&&!R||!$||j&&!G}},[n,a]),[b,y]=(0,jc.useState)(0);(0,jc.useEffect)(()=>{y(I=>I+1)},[p]);let k=q(),{content:_,status:x,error:S}=(0,IF.useServerSideRender)({attributes:e,skipBlockSupportAttributes:!0,block:r,urlQueryArgs:{post_id:a,invalidationKey:b}}),C=(0,jc.useRef)("");(0,jc.useEffect)(()=>{x==="success"&&(C.current=_)},[_,x]);let[N,B]=(0,jc.useState)(!1);(0,jc.useEffect)(()=>{if(x!=="loading")return;let I=setTimeout(()=>{B(!0)},400);return()=>{clearTimeout(I),B(!1)}},[x]);let D=(0,NF.useDisabled)(),A=(0,B1.useBlockProps)({ref:D});if(g)return(0,wt.jsx)("div",{...A,children:(0,wt.jsx)($o.Spinner,{})});let H;!d&&!p?.parent?H=!0:f?H=u:H=!1;let F=null,z=!a||!n||i&&!n||!H&&!d||H&&!h;if(z){let I=[];s&&I.push((0,zr.__)("Home")),i&&!a?I.push((0,zr.__)("Page")):H?I.push((0,zr.__)("Category")):I.push((0,zr.__)("Ancestor"),(0,zr.__)("Parent")),F=(0,wt.jsx)("nav",{...A,style:{"--separator":`"${l.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`,...A.style},children:(0,wt.jsxs)("ol",{children:[I.map((R,$)=>(0,wt.jsx)("li",{children:(0,wt.jsx)("a",{href:`#breadcrumbs-pseudo-link-${$}`,children:R})},$)),c&&(0,wt.jsx)("li",{children:(0,wt.jsx)("span",{"aria-current":"page",children:(0,zr.__)("Current")})})]})})}return(0,wt.jsxs)(wt.Fragment,{children:[(0,wt.jsx)(B1.InspectorControls,{children:(0,wt.jsxs)($o.__experimentalToolsPanel,{label:(0,zr.__)("Settings"),resetAll:()=>{t({separator:Gx,showHomeItem:!0,showCurrentItem:!0})},dropdownMenuProps:k,children:[(0,wt.jsx)($o.__experimentalToolsPanelItem,{label:(0,zr.__)("Show home breadcrumb"),isShownByDefault:!0,hasValue:()=>!s,onDeselect:()=>t({showHomeItem:!0}),children:(0,wt.jsx)($o.ToggleControl,{label:(0,zr.__)("Show home breadcrumb"),onChange:I=>t({showHomeItem:I}),checked:s})}),(0,wt.jsx)($o.__experimentalToolsPanelItem,{label:(0,zr.__)("Show current breadcrumb"),isShownByDefault:!0,hasValue:()=>!c,onDeselect:()=>t({showCurrentItem:!0}),children:(0,wt.jsx)($o.ToggleControl,{label:(0,zr.__)("Show current breadcrumb"),onChange:I=>t({showCurrentItem:I}),checked:c})}),(0,wt.jsx)($o.__experimentalToolsPanelItem,{label:(0,zr.__)("Separator"),isShownByDefault:!0,hasValue:()=>l!==Gx,onDeselect:()=>t({separator:Gx}),children:(0,wt.jsx)($o.TextControl,{__next40pxDefaultSize:!0,autoComplete:"off",label:(0,zr.__)("Separator"),value:l,onChange:I=>t({separator:I}),onBlur:()=>{l||t({separator:Gx})}})})]})}),(0,wt.jsxs)(B1.InspectorControls,{group:"advanced",children:[(0,wt.jsx)($o.CheckboxControl,{label:(0,zr.__)("Show on homepage"),checked:m,onChange:I=>t({showOnHomePage:I}),help:(0,zr.__)("If this breadcrumbs block appears in a template or template part that\u2019s shown on the homepage, enable this option to display the breadcrumb trail. Otherwise, this setting has no effect.")}),(0,wt.jsx)($o.CheckboxControl,{label:(0,zr.__)("Prefer taxonomy terms"),checked:u,onChange:I=>t({prefersTaxonomy:I}),help:(0,zr.__)("The exact type of breadcrumbs shown will vary automatically depending on the page in which this block is displayed. In the specific case of a hierarchical post type with taxonomies, the breadcrumbs can either reflect its post hierarchy (default) or the hierarchy of its assigned taxonomy terms.")})]}),x==="loading"&&!z&&(C.current?(0,wt.jsx)(uo,{wrapperProps:{...A,style:{...A.style,opacity:N?.3:1}},html:C.current}):(0,wt.jsx)("div",{...A,children:(0,wt.jsx)($o.Spinner,{})})),x==="error"&&(0,wt.jsx)("div",{...A,children:(0,wt.jsx)("p",{children:(0,zr.sprintf)((0,zr.__)("Error: %s"),S)})}),z&&F,!z&&x==="success"&&(0,wt.jsx)(uo,{wrapperProps:A,html:_})]})}var{name:DF}=Ux,LF={icon:OS,example:{},edit:EF},ohe=()=>E({name:DF,metadata:Ux,settings:LF});var cI={};Z(cI,{init:()=>yhe,metadata:()=>Kx,name:()=>qF,settings:()=>Yx});var Qx=o(P(),1);var $F=o(W(),1);var ve=o(T(),1),I1=o(me(),1);var MF=o(T(),1);var{cleanEmptyObject:ahe}=K(MF.privateApis);function Ot(e){if(!e?.style?.typography?.fontFamily)return e;let{fontFamily:t,...r}=e.style.typography;return{...e,style:ahe({...e.style,typography:r}),fontFamily:t.split("|").pop()}}function We(e){let{textAlign:t,...r}=e;return t?{...r,style:{...e.style,typography:{...e.style?.typography,textAlign:t}}}:e}var Kt=o(v(),1),zf=e=>{let{borderRadius:t,...r}=e,a=[t,r.style?.border?.radius].find(n=>typeof n=="number"&&n!==0);return a?{...r,style:{...r.style,border:{...r.style?.border,radius:`${a}px`}}}:r};function nhe(e){if(!e.align)return e;let{align:t,...r}=e;return{...r,className:w(r.className,`align${e.align}`)}}var lI=e=>{if(!e.customTextColor&&!e.customBackgroundColor&&!e.customGradient)return e;let t={color:{}};e.customTextColor&&(t.color.text=e.customTextColor),e.customBackgroundColor&&(t.color.background=e.customBackgroundColor),e.customGradient&&(t.color.gradient=e.customGradient);let{customTextColor:r,customBackgroundColor:a,customGradient:n,...i}=e;return{...i,style:t}},iI=e=>{let{color:t,textColor:r,...a}={...e,customTextColor:e.textColor&&e.textColor[0]==="#"?e.textColor:void 0,customBackgroundColor:e.color&&e.color[0]==="#"?e.color:void 0};return lI(a)},Uc={url:{type:"string",source:"attribute",selector:"a",attribute:"href"},title:{type:"string",source:"attribute",selector:"a",attribute:"title"},text:{type:"string",source:"html",selector:"a"}},ihe={attributes:{tagName:{type:"string",enum:["a","button"],default:"a"},type:{type:"string",default:"button"},textAlign:{type:"string"},url:{type:"string",source:"attribute",selector:"a",attribute:"href",role:"content"},title:{type:"string",source:"attribute",selector:"a,button",attribute:"title",role:"content"},text:{type:"rich-text",source:"rich-text",selector:"a,button",role:"content"},linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target",role:"content"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel",role:"content"},placeholder:{type:"string"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},width:{type:"number"}},supports:{anchor:!0,align:!0,alignWide:!1,color:{__experimentalSkipSerialization:!0,gradients:!0,__experimentalDefaultControls:{background:!0,text:!0}},typography:{__experimentalSkipSerialization:["fontSize","lineHeight","fontFamily","fontWeight","fontStyle","textTransform","textDecoration","letterSpacing"],fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalWritingMode:!0,__experimentalDefaultControls:{fontSize:!0}},reusable:!1,shadow:{__experimentalSkipSerialization:!0},spacing:{__experimentalSkipSerialization:!0,padding:["horizontal","vertical"],__experimentalDefaultControls:{padding:!0}},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0,__experimentalSkipSerialization:!0,__experimentalDefaultControls:{color:!0,radius:!0,style:!0,width:!0}},interactivity:{clientNavigation:!0}},selectors:{root:".wp-block-button .wp-block-button__link",typography:{writingMode:".wp-block-button"}},save({attributes:e,className:t}){let{tagName:r,type:a,textAlign:n,fontSize:i,linkTarget:l,rel:s,style:c,text:u,title:m,url:p,width:d}=e,f=r||"a",h=f==="button",g=a||"button",b=(0,ve.__experimentalGetBorderClassesAndStyles)(e),y=(0,ve.__experimentalGetColorClassesAndStyles)(e),k=(0,ve.__experimentalGetSpacingClassesAndStyles)(e),_=(0,ve.__experimentalGetShadowClassesAndStyles)(e),x=(0,ve.getTypographyClassesAndStyles)(e),S=w("wp-block-button__link",y.className,b.className,x.className,{[`has-text-align-${n}`]:n,"no-border-radius":c?.border?.radius===0,"has-custom-font-size":i||c?.typography?.fontSize},(0,ve.__experimentalGetElementClassName)("button")),C={...b.style,...y.style,...k.style,..._.style,...x.style,writingMode:void 0},N=w(t,{[`has-custom-width wp-block-button__width-${d}`]:d});return(0,Kt.jsx)("div",{...ve.useBlockProps.save({className:N}),children:(0,Kt.jsx)(ve.RichText.Content,{tagName:f,type:h?g:null,className:S,href:h?null:p,title:m,style:C,value:u,target:h?null:l,rel:h?null:s})})},isEligible(e){return!!e.textAlign},migrate:We},lhe={attributes:{tagName:{type:"string",enum:["a","button"],default:"a"},type:{type:"string",default:"button"},textAlign:{type:"string"},url:{type:"string",source:"attribute",selector:"a",attribute:"href"},title:{type:"string",source:"attribute",selector:"a,button",attribute:"title",role:"content"},text:{type:"rich-text",source:"rich-text",selector:"a,button",role:"content"},linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target",role:"content"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel",role:"content"},placeholder:{type:"string"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},width:{type:"number"}},supports:{anchor:!0,align:!0,alignWide:!1,color:{__experimentalSkipSerialization:!0,gradients:!0,__experimentalDefaultControls:{background:!0,text:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalWritingMode:!0,__experimentalDefaultControls:{fontSize:!0}},reusable:!1,shadow:{__experimentalSkipSerialization:!0},spacing:{__experimentalSkipSerialization:!0,padding:["horizontal","vertical"],__experimentalDefaultControls:{padding:!0}},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0,__experimentalSkipSerialization:!0,__experimentalDefaultControls:{color:!0,radius:!0,style:!0,width:!0}},__experimentalSelector:".wp-block-button__link",interactivity:{clientNavigation:!0}},save({attributes:e,className:t}){let{tagName:r,type:a,textAlign:n,fontSize:i,linkTarget:l,rel:s,style:c,text:u,title:m,url:p,width:d}=e,f=r||"a",h=f==="button",g=a||"button",b=(0,ve.__experimentalGetBorderClassesAndStyles)(e),y=(0,ve.__experimentalGetColorClassesAndStyles)(e),k=(0,ve.__experimentalGetSpacingClassesAndStyles)(e),_=(0,ve.__experimentalGetShadowClassesAndStyles)(e),x=w("wp-block-button__link",y.className,b.className,{[`has-text-align-${n}`]:n,"no-border-radius":c?.border?.radius===0},(0,ve.__experimentalGetElementClassName)("button")),S={...b.style,...y.style,...k.style,..._.style},C=w(t,{[`has-custom-width wp-block-button__width-${d}`]:d,"has-custom-font-size":i||c?.typography?.fontSize});return(0,Kt.jsx)("div",{...ve.useBlockProps.save({className:C}),children:(0,Kt.jsx)(ve.RichText.Content,{tagName:f,type:h?g:null,className:x,href:h?null:p,title:m,style:S,value:u,target:h?null:l,rel:h?null:s})})}},she={attributes:{url:{type:"string",source:"attribute",selector:"a",attribute:"href"},title:{type:"string",source:"attribute",selector:"a",attribute:"title"},text:{type:"string",source:"html",selector:"a"},linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},width:{type:"number"}},supports:{anchor:!0,align:!0,alignWide:!1,color:{__experimentalSkipSerialization:!0,gradients:!0,__experimentalDefaultControls:{background:!0,text:!0}},typography:{fontSize:!0,__experimentalFontFamily:!0,__experimentalDefaultControls:{fontSize:!0}},reusable:!1,spacing:{__experimentalSkipSerialization:!0,padding:["horizontal","vertical"],__experimentalDefaultControls:{padding:!0}},__experimentalBorder:{radius:!0,__experimentalSkipSerialization:!0,__experimentalDefaultControls:{radius:!0}},__experimentalSelector:".wp-block-button__link"},save({attributes:e,className:t}){let{fontSize:r,linkTarget:a,rel:n,style:i,text:l,title:s,url:c,width:u}=e;if(!l)return null;let m=(0,ve.__experimentalGetBorderClassesAndStyles)(e),p=(0,ve.__experimentalGetColorClassesAndStyles)(e),d=(0,ve.__experimentalGetSpacingClassesAndStyles)(e),f=w("wp-block-button__link",p.className,m.className,{"no-border-radius":i?.border?.radius===0}),h={...m.style,...p.style,...d.style},g=w(t,{[`has-custom-width wp-block-button__width-${u}`]:u,"has-custom-font-size":r||i?.typography?.fontSize});return(0,Kt.jsx)("div",{...ve.useBlockProps.save({className:g}),children:(0,Kt.jsx)(ve.RichText.Content,{tagName:"a",className:f,href:c,title:s,style:h,value:l,target:a,rel:n})})}},che={attributes:{url:{type:"string",source:"attribute",selector:"a",attribute:"href"},title:{type:"string",source:"attribute",selector:"a",attribute:"title"},text:{type:"string",source:"html",selector:"a"},linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},width:{type:"number"}},supports:{anchor:!0,align:!0,alignWide:!1,color:{__experimentalSkipSerialization:!0,gradients:!0},typography:{fontSize:!0,__experimentalFontFamily:!0},reusable:!1,spacing:{__experimentalSkipSerialization:!0,padding:["horizontal","vertical"],__experimentalDefaultControls:{padding:!0}},__experimentalBorder:{radius:!0,__experimentalSkipSerialization:!0},__experimentalSelector:".wp-block-button__link"},save({attributes:e,className:t}){let{fontSize:r,linkTarget:a,rel:n,style:i,text:l,title:s,url:c,width:u}=e;if(!l)return null;let m=(0,ve.__experimentalGetBorderClassesAndStyles)(e),p=(0,ve.__experimentalGetColorClassesAndStyles)(e),d=(0,ve.__experimentalGetSpacingClassesAndStyles)(e),f=w("wp-block-button__link",p.className,m.className,{"no-border-radius":i?.border?.radius===0}),h={...m.style,...p.style,...d.style},g=w(t,{[`has-custom-width wp-block-button__width-${u}`]:u,"has-custom-font-size":r||i?.typography?.fontSize});return(0,Kt.jsx)("div",{...ve.useBlockProps.save({className:g}),children:(0,Kt.jsx)(ve.RichText.Content,{tagName:"a",className:f,href:c,title:s,style:h,value:l,target:a,rel:n})})},migrate:Ot,isEligible({style:e}){return e?.typography?.fontFamily}},uhe=[ihe,lhe,she,che,{supports:{anchor:!0,align:!0,alignWide:!1,color:{__experimentalSkipSerialization:!0,gradients:!0},typography:{fontSize:!0,__experimentalFontFamily:!0},reusable:!1,__experimentalSelector:".wp-block-button__link"},attributes:{...Uc,linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},width:{type:"number"}},isEligible({style:e}){return typeof e?.border?.radius=="number"},save({attributes:e,className:t}){let{fontSize:r,linkTarget:a,rel:n,style:i,text:l,title:s,url:c,width:u}=e;if(!l)return null;let m=i?.border?.radius,p=(0,ve.__experimentalGetColorClassesAndStyles)(e),d=w("wp-block-button__link",p.className,{"no-border-radius":i?.border?.radius===0}),f={borderRadius:m||void 0,...p.style},h=w(t,{[`has-custom-width wp-block-button__width-${u}`]:u,"has-custom-font-size":r||i?.typography?.fontSize});return(0,Kt.jsx)("div",{...ve.useBlockProps.save({className:h}),children:(0,Kt.jsx)(ve.RichText.Content,{tagName:"a",className:d,href:c,title:s,style:f,value:l,target:a,rel:n})})},migrate:(0,I1.compose)(Ot,zf)},{supports:{anchor:!0,align:!0,alignWide:!1,color:{__experimentalSkipSerialization:!0},reusable:!1,__experimentalSelector:".wp-block-button__link"},attributes:{...Uc,linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},borderRadius:{type:"number"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},style:{type:"object"},width:{type:"number"}},save({attributes:e,className:t}){let{borderRadius:r,linkTarget:a,rel:n,text:i,title:l,url:s,width:c}=e,u=(0,ve.__experimentalGetColorClassesAndStyles)(e),m=w("wp-block-button__link",u.className,{"no-border-radius":r===0}),p={borderRadius:r?r+"px":void 0,...u.style},d=w(t,{[`has-custom-width wp-block-button__width-${c}`]:c});return(0,Kt.jsx)("div",{...ve.useBlockProps.save({className:d}),children:(0,Kt.jsx)(ve.RichText.Content,{tagName:"a",className:m,href:s,title:l,style:p,value:i,target:a,rel:n})})},migrate:(0,I1.compose)(Ot,zf)},{supports:{anchor:!0,align:!0,alignWide:!1,color:{__experimentalSkipSerialization:!0},reusable:!1,__experimentalSelector:".wp-block-button__link"},attributes:{...Uc,linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},borderRadius:{type:"number"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},style:{type:"object"},width:{type:"number"}},save({attributes:e,className:t}){let{borderRadius:r,linkTarget:a,rel:n,text:i,title:l,url:s,width:c}=e,u=(0,ve.__experimentalGetColorClassesAndStyles)(e),m=w("wp-block-button__link",u.className,{"no-border-radius":r===0}),p={borderRadius:r?r+"px":void 0,...u.style},d=w(t,{[`has-custom-width wp-block-button__width-${c}`]:c});return(0,Kt.jsx)("div",{...ve.useBlockProps.save({className:d}),children:(0,Kt.jsx)(ve.RichText.Content,{tagName:"a",className:m,href:s,title:l,style:p,value:i,target:a,rel:n})})},migrate:(0,I1.compose)(Ot,zf)},{supports:{align:!0,alignWide:!1,color:{gradients:!0}},attributes:{...Uc,linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},borderRadius:{type:"number"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},style:{type:"object"}},save({attributes:e}){let{borderRadius:t,linkTarget:r,rel:a,text:n,title:i,url:l}=e,s=w("wp-block-button__link",{"no-border-radius":t===0}),c={borderRadius:t?t+"px":void 0};return(0,Kt.jsx)(ve.RichText.Content,{tagName:"a",className:s,href:l,title:i,style:c,value:n,target:r,rel:a})},migrate:zf},{supports:{align:!0,alignWide:!1},attributes:{...Uc,linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},borderRadius:{type:"number"},backgroundColor:{type:"string"},textColor:{type:"string"},customBackgroundColor:{type:"string"},customTextColor:{type:"string"},customGradient:{type:"string"},gradient:{type:"string"}},isEligible:e=>!!e.customTextColor||!!e.customBackgroundColor||!!e.customGradient||!!e.align,migrate:(0,I1.compose)(zf,lI,nhe),save({attributes:e}){let{backgroundColor:t,borderRadius:r,customBackgroundColor:a,customTextColor:n,customGradient:i,linkTarget:l,gradient:s,rel:c,text:u,textColor:m,title:p,url:d}=e,f=(0,ve.getColorClassName)("color",m),h=!i&&(0,ve.getColorClassName)("background-color",t),g=(0,ve.__experimentalGetGradientClass)(s),b=w("wp-block-button__link",{"has-text-color":m||n,[f]:f,"has-background":t||a||i||s,[h]:h,"no-border-radius":r===0,[g]:g}),y={background:i||void 0,backgroundColor:h||i||s?void 0:a,color:f?void 0:n,borderRadius:r?r+"px":void 0};return(0,Kt.jsx)("div",{children:(0,Kt.jsx)(ve.RichText.Content,{tagName:"a",className:b,href:d,title:p,style:y,value:u,target:l,rel:c})})}},{attributes:{...Uc,align:{type:"string",default:"none"},backgroundColor:{type:"string"},textColor:{type:"string"},customBackgroundColor:{type:"string"},customTextColor:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"}},isEligible(e){return e.className&&e.className.includes("is-style-squared")},migrate(e){let t=e.className;return t&&(t=t.replace(/is-style-squared[\s]?/,"").trim()),zf(lI({...e,className:t||void 0,borderRadius:0}))},save({attributes:e}){let{backgroundColor:t,customBackgroundColor:r,customTextColor:a,linkTarget:n,rel:i,text:l,textColor:s,title:c,url:u}=e,m=(0,ve.getColorClassName)("color",s),p=(0,ve.getColorClassName)("background-color",t),d=w("wp-block-button__link",{"has-text-color":s||a,[m]:m,"has-background":t||r,[p]:p}),f={backgroundColor:p?void 0:r,color:m?void 0:a};return(0,Kt.jsx)("div",{children:(0,Kt.jsx)(ve.RichText.Content,{tagName:"a",className:d,href:u,title:c,style:f,value:l,target:n,rel:i})})}},{attributes:{...Uc,align:{type:"string",default:"none"},backgroundColor:{type:"string"},textColor:{type:"string"},customBackgroundColor:{type:"string"},customTextColor:{type:"string"}},migrate:iI,save({attributes:e}){let{url:t,text:r,title:a,backgroundColor:n,textColor:i,customBackgroundColor:l,customTextColor:s}=e,c=(0,ve.getColorClassName)("color",i),u=(0,ve.getColorClassName)("background-color",n),m=w("wp-block-button__link",{"has-text-color":i||s,[c]:c,"has-background":n||l,[u]:u}),p={backgroundColor:u?void 0:l,color:c?void 0:s};return(0,Kt.jsx)("div",{children:(0,Kt.jsx)(ve.RichText.Content,{tagName:"a",className:m,href:t,title:a,style:p,value:r})})}},{attributes:{...Uc,color:{type:"string"},textColor:{type:"string"},align:{type:"string",default:"none"}},save({attributes:e}){let{url:t,text:r,title:a,align:n,color:i,textColor:l}=e,s={backgroundColor:i,color:l};return(0,Kt.jsx)("div",{className:`align${n}`,children:(0,Kt.jsx)(ve.RichText.Content,{tagName:"a",className:"wp-block-button__link",href:t,title:a,style:s,value:r})})},migrate:iI},{attributes:{...Uc,color:{type:"string"},textColor:{type:"string"},align:{type:"string",default:"none"}},save({attributes:e}){let{url:t,text:r,title:a,align:n,color:i,textColor:l}=e;return(0,Kt.jsx)("div",{className:`align${n}`,style:{backgroundColor:i},children:(0,Kt.jsx)(ve.RichText.Content,{tagName:"a",href:t,title:a,style:{color:l},value:r})})},migrate:iI}],AF=uhe;var qo=o(P(),1),Pn=o(U(),1),xa=o(M(),1),it=o(T(),1),Ju=o(As(),1);var Gc=o(W(),1),E1=o(me(),1),D1=o(V(),1);var $x="noreferrer noopener",qx="_blank",Vf="nofollow";var zF=o(mr(),1);function VF({rel:e="",url:t="",opensInNewTab:r,nofollow:a}){let n,i=e;if(r)n=qx,i=i?.includes($x)?i:i+` ${$x}`;else{let l=new RegExp(`\\b${$x}\\s*`,"g");i=i?.replace(l,"").trim()}if(a)i=i?.includes(Vf)?i:(i+` ${Vf}`).trim();else{let l=new RegExp(`\\b${Vf}\\s*`,"g");i=i?.replace(l,"").trim()}return{url:(0,zF.prependHTTPS)(t),linkTarget:n,rel:i||void 0}}function N1(e){return e.toString().replace(/<\/?a[^>]*>/g,"")}var HF=o(me(),1),Zx=o(U(),1),OF=o(Ff(),1),jF=o(V(),1),UF=o(T(),1);function Kr(e){let{name:t,attributes:r,setAttributes:a}=e,{textAlign:n}=r,{__unstableMarkNextChangeAsNotPersistent:i}=(0,jF.useDispatch)(UF.store),l=(0,HF.useEvent)(()=>{(0,OF.default)(`textAlign attribute in ${t}`,{alternative:"style.typography.textAlign",since:"7.0"}),i(),a(c=>({style:{...c.style,typography:{...c.style?.typography,textAlign:n}}}))}),s=(0,Zx.useRef)();(0,Zx.useEffect)(()=>{n!==s.current&&(s.current=n,l())},[n,l])}var Pr=o(v(),1),{HTMLElementControl:mhe}=K(it.privateApis),phe=[...it.LinkControl.DEFAULT_LINK_SETTINGS,{id:"nofollow",title:(0,qo.__)("Mark as nofollow")}];function dhe(e){let{replaceBlocks:t,selectionChange:r}=(0,D1.useDispatch)(it.store),{getBlock:a,getBlockRootClientId:n,getBlockIndex:i}=(0,D1.useSelect)(it.store),l=(0,Pn.useRef)(e);return l.current=e,(0,E1.useRefEffect)(s=>{function c(u){if(u.defaultPrevented||u.keyCode!==Ju.ENTER)return;let{content:m,clientId:p}=l.current;if(m.length)return;u.preventDefault();let d=a(n(p)),f=i(p),h=(0,Gc.cloneBlock)({...d,innerBlocks:d.innerBlocks.slice(0,f)}),g=(0,Gc.createBlock)((0,Gc.getDefaultBlockName)()),b=d.innerBlocks.slice(f+1),y=b.length?[(0,Gc.cloneBlock)({...d,innerBlocks:b})]:[];t(d.clientId,[h,g,...y],1),r(g.clientId)}return s.addEventListener("keydown",c),()=>{s.removeEventListener("keydown",c)}},[])}function fhe({selectedWidth:e,setAttributes:t}){let r=q();return(0,Pr.jsx)(xa.__experimentalToolsPanel,{label:(0,qo.__)("Settings"),resetAll:()=>t({width:void 0}),dropdownMenuProps:r,children:(0,Pr.jsx)(xa.__experimentalToolsPanelItem,{label:(0,qo.__)("Width"),isShownByDefault:!0,hasValue:()=>!!e,onDeselect:()=>t({width:void 0}),children:(0,Pr.jsx)(xa.__experimentalToggleGroupControl,{label:(0,qo.__)("Width"),value:e,onChange:a=>t({width:a}),isBlock:!0,__next40pxDefaultSize:!0,children:[25,50,75,100].map(a=>(0,Pr.jsx)(xa.__experimentalToggleGroupControlOption,{value:a,label:(0,qo.sprintf)((0,qo.__)("%d%%"),a)},a))})})})}function hhe(e){let{attributes:t,setAttributes:r,className:a,isSelected:n,onReplace:i,mergeBlocks:l,clientId:s,context:c}=e,{tagName:u,linkTarget:m,placeholder:p,rel:d,style:f,text:h,url:g,width:b,metadata:y}=t;Kr(e);let k=u||"a";function _(ke){Ju.isKeyboardEvent.primary(ke,"k")?ne(ke):Ju.isKeyboardEvent.primaryShift(ke,"k")&&(le(),H.current?.focus())}let[x,S]=(0,Pn.useState)(null),C=(0,it.__experimentalUseBorderProps)(t),N=(0,it.__experimentalUseColorProps)(t),B=(0,it.__experimentalGetSpacingClassesAndStyles)(t),D=(0,it.__experimentalGetShadowClassesAndStyles)(t),A=(0,Pn.useRef)(),H=(0,Pn.useRef)(),F=(0,it.useBlockProps)({ref:(0,E1.useMergeRefs)([S,A]),onKeyDown:_}),z=(0,it.useBlockEditingMode)(),[I,R]=(0,Pn.useState)(!1),$=!!g,j=m===qx,G=!!d?.includes(Vf),O=k==="a",{createPageEntity:J,userCanCreatePages:ee,lockUrlControls:oe=!1}=(0,D1.useSelect)(ke=>{if(!n)return{};let je=ke(it.store).getSettings(),de=(0,Gc.getBlockBindingsSource)(y?.bindings?.url?.source);return{createPageEntity:je.__experimentalCreatePageEntity,userCanCreatePages:je.__experimentalUserCanCreatePages,lockUrlControls:!!y?.bindings?.url&&!de?.canUserEditValue?.({select:ke,context:c,args:y?.bindings?.url?.args})}},[c,n,y?.bindings?.url]);async function X(ke){let je=await J({title:ke,status:"draft"});return{id:je.id,type:je.type,title:je.title.rendered,url:je.link,kind:"post-type"}}function te(ke){return(0,Pn.createInterpolateElement)((0,qo.sprintf)((0,qo.__)("Create page: <mark>%s</mark>"),ke),{mark:(0,Pr.jsx)("mark",{})})}function ne(ke){ke.preventDefault(),R(!0)}function le(){r({url:void 0,linkTarget:void 0,rel:void 0}),R(!1)}(0,Pn.useEffect)(()=>{n||R(!1)},[n]);let pe=(0,Pn.useMemo)(()=>({url:g,opensInNewTab:j,nofollow:G}),[g,j,G]),Ie=dhe({content:h,clientId:s}),Ne=(0,E1.useMergeRefs)([Ie,H]),[ae,Re]=(0,it.useSettings)("typography.fluid","layout"),Ee=(0,it.getTypographyClassesAndStyles)(t,{typography:{fluid:ae},layout:{wideSize:Re?.wideSize}}),fe=z==="default"||O&&!oe;return(0,Pr.jsxs)(Pr.Fragment,{children:[(0,Pr.jsx)("div",{...F,className:w(F.className,{[`has-custom-width wp-block-button__width-${b}`]:b}),children:(0,Pr.jsx)(it.RichText,{ref:Ne,"aria-label":(0,qo.__)("Button text"),placeholder:p||(0,qo.__)("Add text\u2026"),value:h,onChange:ke=>r({text:N1(ke)}),withoutInteractiveFormatting:!0,className:w(a,"wp-block-button__link",N.className,C.className,Ee.className,{"no-border-radius":f?.border?.radius===0,"has-custom-font-size":F.style.fontSize},(0,it.__experimentalGetElementClassName)("button")),style:{...C.style,...N.style,...B.style,...D.style,...Ee.style,writingMode:void 0},onReplace:i,onMerge:l,identifier:"text"})}),fe&&(0,Pr.jsx)(it.BlockControls,{group:"block",children:O&&!oe&&(0,Pr.jsx)(xa.ToolbarButton,{name:"link",icon:$?U0:ii,title:$?(0,qo.__)("Unlink"):(0,qo.__)("Link"),shortcut:$?Ju.displayShortcut.primaryShift("k"):Ju.displayShortcut.primary("k"),onClick:$?le:ne,isActive:$})}),O&&n&&(I||$)&&!oe&&(0,Pr.jsx)(xa.Popover,{placement:"bottom",onClose:()=>{R(!1),H.current?.focus()},anchor:x,focusOnMount:I?"firstElement":!1,__unstableSlotName:"__unstable-block-tools-after",shift:!0,children:(0,Pr.jsx)(it.LinkControl,{value:pe,onChange:({url:ke,opensInNewTab:je,nofollow:de})=>r(VF({rel:d,url:ke,opensInNewTab:je,nofollow:de})),onRemove:()=>{le(),H.current?.focus()},forceIsEditingLink:I,settings:phe,createSuggestion:J&&X,withCreateSuggestion:ee,createSuggestionButtonText:te})}),(0,Pr.jsx)(it.InspectorControls,{children:(0,Pr.jsx)(fhe,{selectedWidth:b,setAttributes:r})}),(0,Pr.jsxs)(it.InspectorControls,{group:"advanced",children:[(0,Pr.jsx)(mhe,{tagName:u,onChange:ke=>r({tagName:ke}),options:[{label:(0,qo.__)("Default (<a>)"),value:"a"},{label:"<button>",value:"button"}]}),O&&(0,Pr.jsx)(xa.TextControl,{__next40pxDefaultSize:!0,label:(0,qo.__)("Link relation"),help:(0,Pn.createInterpolateElement)((0,qo.__)("The <a>Link Relation</a> attribute defines the relationship between a linked resource and the current document."),{a:(0,Pr.jsx)(xa.ExternalLink,{href:"https://developer.mozilla.org/docs/Web/HTML/Attributes/rel"})}),value:d||"",onChange:ke=>r({rel:ke})})]})]})}var GF=hhe;var Kx={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/button",title:"Button",category:"design",parent:["core/buttons"],description:"Prompt visitors to take action with a button-style link.",keywords:["link"],textdomain:"default",attributes:{tagName:{type:"string",enum:["a","button"],default:"a"},type:{type:"string",default:"button"},url:{type:"string",source:"attribute",selector:"a",attribute:"href",role:"content"},title:{type:"string",source:"attribute",selector:"a,button",attribute:"title",role:"content"},text:{type:"rich-text",source:"rich-text",selector:"a,button",role:"content"},linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target",role:"content"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel",role:"content"},placeholder:{type:"string"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},width:{type:"number"}},supports:{anchor:!0,splitting:!0,align:!1,alignWide:!1,color:{__experimentalSkipSerialization:!0,gradients:!0,__experimentalDefaultControls:{background:!0,text:!0}},typography:{__experimentalSkipSerialization:["fontSize","lineHeight","textAlign","fontFamily","fontWeight","fontStyle","textTransform","textDecoration","letterSpacing"],fontSize:!0,lineHeight:!0,textAlign:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalWritingMode:!0,__experimentalDefaultControls:{fontSize:!0}},reusable:!1,shadow:{__experimentalSkipSerialization:!0},spacing:{__experimentalSkipSerialization:!0,padding:["horizontal","vertical"],__experimentalDefaultControls:{padding:!0}},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0,__experimentalSkipSerialization:!0,__experimentalDefaultControls:{color:!0,radius:!0,style:!0,width:!0}},interactivity:{clientNavigation:!0}},styles:[{name:"fill",label:"Fill",isDefault:!0},{name:"outline",label:"Outline"}],editorStyle:"wp-block-button-editor",style:"wp-block-button",selectors:{root:".wp-block-button .wp-block-button__link",typography:{writingMode:".wp-block-button"}}};var ka=o(T(),1),sI=o(v(),1);function WF({attributes:e,className:t}){let{tagName:r,type:a,fontSize:n,linkTarget:i,rel:l,style:s,text:c,title:u,url:m,width:p}=e,d=r||"a",f=d==="button",h=a||"button",g=(0,ka.__experimentalGetBorderClassesAndStyles)(e),b=(0,ka.__experimentalGetColorClassesAndStyles)(e),y=(0,ka.__experimentalGetSpacingClassesAndStyles)(e),k=(0,ka.__experimentalGetShadowClassesAndStyles)(e),_=(0,ka.getTypographyClassesAndStyles)(e),x=w("wp-block-button__link",b.className,g.className,_.className,{"no-border-radius":s?.border?.radius===0,"has-custom-font-size":n||s?.typography?.fontSize},(0,ka.__experimentalGetElementClassName)("button")),S={...g.style,...b.style,...y.style,...k.style,..._.style,writingMode:void 0},C=w(t,{[`has-custom-width wp-block-button__width-${p}`]:p});return(0,sI.jsx)("div",{...ka.useBlockProps.save({className:C}),children:(0,sI.jsx)(ka.RichText.Content,{tagName:d,type:f?h:null,className:x,href:f?null:m,title:u,style:S,value:c,target:f?null:i,rel:f?null:l})})}var{fieldsKey:vhe,formKey:bhe}=K($F.privateApis),{name:qF}=Kx,Yx={icon:US,example:{attributes:{className:"is-style-fill",text:(0,Qx.__)("Call to action")}},edit:GF,save:WF,deprecated:AF,merge:(e,{text:t=""})=>({...e,text:(e.text||"")+t}),__experimentalLabel(e,{context:t}){let{text:r}=e,a=e?.metadata?.name,n=r?.trim().length>0;if(t==="list-view"&&(a||n))return a||r;if(t==="breadcrumb"&&a)return a}};window.__experimentalContentOnlyInspectorFields&&(Yx[vhe]=[{id:"text",label:(0,Qx.__)("Content"),type:"text",Edit:"rich-text"},{id:"link",label:(0,Qx.__)("Link"),type:"url",Edit:"link",getValue:({item:e})=>({url:e.url,rel:e.rel,linkTarget:e.linkTarget}),setValue:({value:e})=>({url:e.url,rel:e.rel,linkTarget:e.linkTarget})}],Yx[bhe]={fields:["text","link"]});var yhe=()=>E({name:qF,metadata:Kx,settings:Yx});var pI={};Z(pI,{init:()=>She,metadata:()=>Jx,name:()=>aH,settings:()=>nH});var mI=o(P(),1);var M1=o(T(),1),L1=o(v(),1),ZF=e=>{if(e.layout)return e;let{contentJustification:t,orientation:r,...a}=e;return(t||r)&&Object.assign(a,{layout:{type:"flex",...t&&{justifyContent:t},...r&&{orientation:r}}}),a},_he=[{attributes:{contentJustification:{type:"string"},orientation:{type:"string",default:"horizontal"}},supports:{anchor:!0,align:["wide","full"],__experimentalExposeControlsToChildren:!0,spacing:{blockGap:!0,margin:["top","bottom"],__experimentalDefaultControls:{blockGap:!0}}},isEligible:({contentJustification:e,orientation:t})=>!!e||!!t,migrate:ZF,save({attributes:{contentJustification:e,orientation:t}}){return(0,L1.jsx)("div",{...M1.useBlockProps.save({className:w({[`is-content-justification-${e}`]:e,"is-vertical":t==="vertical"})}),children:(0,L1.jsx)(M1.InnerBlocks.Content,{})})}},{supports:{align:["center","left","right"],anchor:!0},save(){return(0,L1.jsx)("div",{children:(0,L1.jsx)(M1.InnerBlocks.Content,{})})},isEligible({align:e}){return e&&["center","left","right"].includes(e)},migrate(e){return ZF({...e,align:void 0,contentJustification:e.align})}}],KF=_he;var R1=o(W(),1),uI=o(em(),1);var A1=o(W(),1);function Wc(e,t,r=null){if(!e)return;let a=(0,A1.getBlockType)(t);if(!a)return;let n={};if((0,A1.hasBlockSupport)(a,"anchor")&&e.anchor&&(n.anchor=e.anchor),(0,A1.hasBlockSupport)(a,"ariaLabel")&&e.ariaLabel&&(n.ariaLabel=e.ariaLabel),e.metadata){let i=[];if(r&&i.push("id","bindings"),i.length>0){let l=Object.entries(e.metadata).reduce((s,[c,u])=>(i.includes(c)&&(s[c]=c==="bindings"?r(u):u),s),{});Object.keys(l).length>0&&(n.metadata=l)}}if(Object.keys(n).length!==0)return n}var xhe={from:[{type:"block",isMultiBlock:!0,blocks:["core/button"],transform:e=>(0,R1.createBlock)("core/buttons",{},e.map(t=>(0,R1.createBlock)("core/button",t)))},{type:"block",isMultiBlock:!0,blocks:["core/paragraph"],transform:e=>(0,R1.createBlock)("core/buttons",{},e.map(t=>{let{content:r}=t,a=(0,uI.__unstableCreateElement)(document,r),n=a.innerText||"",l=a.querySelector("a")?.getAttribute("href");return(0,R1.createBlock)("core/button",{...t,...Wc(t,"core/button",({content:s})=>({text:s})),text:n,url:l})})),isMatch:e=>e.every(t=>{let r=(0,uI.__unstableCreateElement)(document,t.content),a=r.innerText||"",n=r.querySelectorAll("a");return a.length<=30&&n.length<=1})}]},YF=xhe;var Xx=o(T(),1),XF=o(V(),1),JF=o(W(),1),eH=o(v(),1),khe={name:"core/button",attributesToCopy:["backgroundColor","border","className","fontFamily","fontSize","gradient","style","textColor","width"]};function whe({attributes:e,className:t}){let{fontSize:r,layout:a,style:n}=e,i=(0,Xx.useBlockProps)({className:w(t,{"has-custom-font-size":r||n?.typography?.fontSize})}),{hasButtonVariations:l}=(0,XF.useSelect)(c=>({hasButtonVariations:c(JF.store).getBlockVariations("core/button","inserter").length>0}),[]),s=(0,Xx.useInnerBlocksProps)(i,{defaultBlock:khe,directInsert:!l,template:[["core/button"]],templateInsertUpdatesSelection:!0,orientation:a?.orientation??"horizontal"});return(0,eH.jsx)("div",{...s})}var tH=whe;var Jx={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/buttons",title:"Buttons",category:"design",allowedBlocks:["core/button"],description:"Prompt visitors to take action with a group of button-style links.",keywords:["link"],textdomain:"default",supports:{anchor:!0,align:["wide","full"],html:!1,__experimentalExposeControlsToChildren:!0,color:{gradients:!0,text:!1,__experimentalDefaultControls:{background:!0}},spacing:{blockGap:["horizontal","vertical"],padding:!0,margin:["top","bottom"],__experimentalDefaultControls:{blockGap:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,radius:!0,style:!0,width:!0}},layout:{allowSwitching:!1,allowInheriting:!1,default:{type:"flex"}},interactivity:{clientNavigation:!0},listView:!0,contentRole:!0},editorStyle:"wp-block-buttons-editor",style:"wp-block-buttons"};var ek=o(T(),1),rH=o(v(),1);function oH({attributes:e,className:t}){let{fontSize:r,style:a}=e,n=ek.useBlockProps.save({className:w(t,{"has-custom-font-size":r||a?.typography?.fontSize})}),i=ek.useInnerBlocksProps.save(n);return(0,rH.jsx)("div",{...i})}var{name:aH}=Jx,nH={icon:WS,example:{attributes:{layout:{type:"flex",justifyContent:"center"}},innerBlocks:[{name:"core/button",attributes:{text:(0,mI.__)("Find out more")}},{name:"core/button",attributes:{text:(0,mI.__)("Contact us")}}]},deprecated:KF,transforms:YF,edit:tH,save:oH},She=()=>E({name:aH,metadata:Jx,settings:nH});var fI={};Z(fI,{init:()=>Ihe,metadata:()=>tk,name:()=>dH,settings:()=>fH});var tk={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/calendar",title:"Calendar",category:"widgets",description:"A calendar of your site\u2019s posts.",keywords:["posts","archive"],textdomain:"default",attributes:{month:{type:"integer"},year:{type:"integer"}},supports:{anchor:!0,align:!0,html:!1,color:{link:!0,__experimentalSkipSerialization:["text","background"],__experimentalDefaultControls:{background:!0,text:!0},__experimentalSelector:"table, th"},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}},style:"wp-block-calendar"};var z1=o(M(),1),iH=o(V(),1),lH=o(Fu(),1),sH=o(T(),1),cH=o(Q(),1),Hf=o(P(),1),uH=o(me(),1);var si=o(v(),1),Phe=Af(e=>{if(!e)return{};let t=new Date(e);return{year:t.getFullYear(),month:t.getMonth()+1}});function mH({attributes:e,name:t}){let{date:r,hasPosts:a,hasPostsResolved:n}=(0,iH.useSelect)(m=>{let{getEntityRecords:p,hasFinishedResolution:d}=m(cH.store),f={status:"publish",per_page:1},h=p("postType","post",f),g=d("getEntityRecords",["postType","post",f]),b,y=m("core/editor");return y&&y.getEditedPostAttribute("type")==="post"&&(b=y.getEditedPostAttribute("date")),{date:b,hasPostsResolved:g,hasPosts:g&&h?.length===1}},[]),{content:i,status:l,error:s}=(0,lH.useServerSideRender)({attributes:{...e,...Phe(r)},block:t}),c=(0,uH.useDisabled)(),u=(0,sH.useBlockProps)({ref:c});return a?(0,si.jsxs)(si.Fragment,{children:[l==="loading"&&(0,si.jsx)("div",{...u,children:(0,si.jsx)(z1.Spinner,{})}),l==="error"&&(0,si.jsx)("div",{...u,children:(0,si.jsx)("p",{children:(0,Hf.sprintf)((0,Hf.__)("Error: %s"),s)})}),l==="success"&&(0,si.jsx)(uo,{wrapperProps:u,html:i})]}):(0,si.jsx)("div",{...u,children:(0,si.jsx)(z1.Placeholder,{icon:S0,label:(0,Hf.__)("Calendar"),children:n?(0,Hf.__)("No published posts found."):(0,si.jsx)(z1.Spinner,{})})})}var dI=o(W(),1),Bhe={from:[{type:"block",blocks:["core/archives"],transform:()=>(0,dI.createBlock)("core/calendar")}],to:[{type:"block",blocks:["core/archives"],transform:()=>(0,dI.createBlock)("core/archives")}]},pH=Bhe;var{name:dH}=tk,fH={icon:S0,example:{},edit:mH,transforms:pH},Ihe=()=>E({name:dH,metadata:tk,settings:fH});var vI={};Z(vI,{init:()=>Dhe,metadata:()=>rk,name:()=>_H,settings:()=>xH});var rk={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/categories",title:"Terms List",category:"widgets",description:"Display a list of all terms of a given taxonomy.",keywords:["categories"],textdomain:"default",attributes:{taxonomy:{type:"string",default:"category"},displayAsDropdown:{type:"boolean",default:!1},showHierarchy:{type:"boolean",default:!1},showPostCounts:{type:"boolean",default:!1},showOnlyTopLevel:{type:"boolean",default:!1},showEmpty:{type:"boolean",default:!1},label:{type:"string",role:"content"},showLabel:{type:"boolean",default:!0}},usesContext:["enhancedPagination"],supports:{anchor:!0,align:!0,html:!1,spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}}},editorStyle:"wp-block-categories-editor",style:"wp-block-categories"};var ar=o(M(),1),hH=o(me(),1),Of=o(T(),1),gH=o(Wo(),1),wr=o(P(),1);var hI=o(Q(),1),vH=o(V(),1),bH=o(xr(),1);var pt=o(v(),1);function gI({attributes:{displayAsDropdown:e,showHierarchy:t,showPostCounts:r,showOnlyTopLevel:a,showEmpty:n,label:i,showLabel:l,taxonomy:s},setAttributes:c,className:u,clientId:m}){let p=(0,hH.useInstanceId)(gI,"blocks-category-select"),{records:d,isResolvingTaxonomies:f}=(0,hI.useEntityRecords)("root","taxonomy",{per_page:-1}),h=d?.filter(j=>j.visibility.public),g=h?.find(j=>j.slug===s),b=!f&&g?.hierarchical,y={per_page:-1,hide_empty:!n,context:"view"};b&&a&&(y.parent=0);let{records:k,isResolving:_}=(0,hI.useEntityRecords)("taxonomy",s,y),{createWarningNotice:x}=(0,vH.useDispatch)(bH.store),S=j=>{j.preventDefault(),x((0,wr.__)("Links are disabled in the editor."),{id:`block-library/core/categories/redirection-prevented/${m}`,type:"snackbar"})},C=j=>k?.length?j===null?k:k.filter(({parent:G})=>G===j):[],N=j=>G=>c({[j]:G}),B=j=>j?(0,gH.decodeEntities)(j).trim():(0,wr.__)("(Untitled)"),D=()=>C(b&&t?0:null).map(O=>A(O)),A=j=>{let G=C(j.id),{id:O,link:J,count:ee,name:oe}=j;return(0,pt.jsxs)("li",{className:`cat-item cat-item-${O}`,children:[(0,pt.jsx)("a",{href:J,onClick:S,children:B(oe)}),r&&` (${ee})`,b&&t&&!!G.length&&(0,pt.jsx)("ul",{className:"children",children:G.map(X=>A(X))})]},O)},H=()=>{let G=C(b&&t?0:null);return(0,pt.jsxs)(pt.Fragment,{children:[l?(0,pt.jsx)(Of.RichText,{className:"wp-block-categories__label","aria-label":(0,wr.__)("Label text"),placeholder:g?.name,withoutInteractiveFormatting:!0,value:i,onChange:O=>c({label:O})}):(0,pt.jsx)(ar.VisuallyHidden,{as:"label",htmlFor:p,children:i||g?.name}),(0,pt.jsxs)("select",{id:p,children:[(0,pt.jsx)("option",{children:(0,wr.sprintf)((0,wr.__)("Select %s"),g?.labels?.singular_name)}),G.map(O=>F(O,0))]})]})},F=(j,G)=>{let{id:O,count:J,name:ee}=j,oe=C(O);return[(0,pt.jsxs)("option",{className:`level-${G}`,children:[Array.from({length:G*3}).map(()=>"\xA0"),B(ee),r&&` (${J})`]},O),b&&t&&!!oe.length&&oe.map(X=>F(X,G+1))]},z=k?.length&&!e&&!_?"ul":"div",I=w(u,`wp-block-categories-taxonomy-${s}`,{"wp-block-categories-list":!!k?.length&&!e&&!_,"wp-block-categories-dropdown":!!k?.length&&e&&!_}),R=(0,Of.useBlockProps)({className:I}),$=q();return(0,pt.jsxs)(z,{...R,children:[(0,pt.jsx)(Of.InspectorControls,{children:(0,pt.jsxs)(ar.__experimentalToolsPanel,{label:(0,wr.__)("Settings"),resetAll:()=>{c({taxonomy:"category",displayAsDropdown:!1,showHierarchy:!1,showPostCounts:!1,showOnlyTopLevel:!1,showEmpty:!1,showLabel:!0})},dropdownMenuProps:$,children:[Array.isArray(h)&&(0,pt.jsx)(ar.__experimentalToolsPanelItem,{hasValue:()=>s!=="category",label:(0,wr.__)("Taxonomy"),onDeselect:()=>{c({taxonomy:"category"})},isShownByDefault:!0,children:(0,pt.jsx)(ar.SelectControl,{__next40pxDefaultSize:!0,label:(0,wr.__)("Taxonomy"),options:h.map(j=>({label:j.name,value:j.slug})),value:s,onChange:j=>c({taxonomy:j})})}),(0,pt.jsx)(ar.__experimentalToolsPanelItem,{hasValue:()=>!!e,label:(0,wr.__)("Display as dropdown"),onDeselect:()=>c({displayAsDropdown:!1}),isShownByDefault:!0,children:(0,pt.jsx)(ar.ToggleControl,{label:(0,wr.__)("Display as dropdown"),checked:e,onChange:N("displayAsDropdown")})}),e&&(0,pt.jsx)(ar.__experimentalToolsPanelItem,{hasValue:()=>!l,label:(0,wr.__)("Show label"),onDeselect:()=>c({showLabel:!0}),isShownByDefault:!0,children:(0,pt.jsx)(ar.ToggleControl,{className:"wp-block-categories__indentation",label:(0,wr.__)("Show label"),checked:l,onChange:N("showLabel")})}),(0,pt.jsx)(ar.__experimentalToolsPanelItem,{hasValue:()=>!!r,label:(0,wr.__)("Show post counts"),onDeselect:()=>c({showPostCounts:!1}),isShownByDefault:!0,children:(0,pt.jsx)(ar.ToggleControl,{label:(0,wr.__)("Show post counts"),checked:r,onChange:N("showPostCounts")})}),b&&(0,pt.jsx)(ar.__experimentalToolsPanelItem,{hasValue:()=>!!a,label:(0,wr.__)("Show only top level terms"),onDeselect:()=>c({showOnlyTopLevel:!1}),isShownByDefault:!0,children:(0,pt.jsx)(ar.ToggleControl,{label:(0,wr.__)("Show only top level terms"),checked:a,onChange:N("showOnlyTopLevel")})}),(0,pt.jsx)(ar.__experimentalToolsPanelItem,{hasValue:()=>!!n,label:(0,wr.__)("Show empty terms"),onDeselect:()=>c({showEmpty:!1}),isShownByDefault:!0,children:(0,pt.jsx)(ar.ToggleControl,{label:(0,wr.__)("Show empty terms"),checked:n,onChange:N("showEmpty")})}),b&&!a&&(0,pt.jsx)(ar.__experimentalToolsPanelItem,{hasValue:()=>!!t,label:(0,wr.__)("Show hierarchy"),onDeselect:()=>c({showHierarchy:!1}),isShownByDefault:!0,children:(0,pt.jsx)(ar.ToggleControl,{label:(0,wr.__)("Show hierarchy"),checked:t,onChange:N("showHierarchy")})})]})}),_&&(0,pt.jsx)(ar.Placeholder,{icon:Q0,label:(0,wr.__)("Terms"),children:(0,pt.jsx)(ar.Spinner,{})}),!_&&k?.length===0&&(0,pt.jsx)("p",{children:g.labels.no_terms}),!_&&k?.length>0&&(e?H():D())]})}var ok=o(P(),1);var Ehe=[{name:"terms",title:(0,ok.__)("Terms List"),icon:Gu,attributes:{taxonomy:"post_tag"},isActive:e=>e.taxonomy!=="category"},{name:"categories",title:(0,ok.__)("Categories List"),description:(0,ok.__)("Display a list of all categories."),icon:Gu,attributes:{taxonomy:"category"},isActive:["taxonomy"],isDefault:!0}],yH=Ehe;var{name:_H}=rk,xH={icon:Gu,example:{},edit:gI,variations:yH},Dhe=()=>E({name:_H,metadata:rk,settings:xH});var yI={};Z(yI,{init:()=>zhe,metadata:()=>lk,name:()=>F1,settings:()=>AH});var $c=o(T(),1),NH=o(V(),1),qc=o(M(),1),Uf=o(U(),1),V1=o(P(),1);var kH=o(P(),1),wH=o(M(),1),ak=o(V(),1),nk=o(W(),1),bI=o(T(),1),CH=o(v(),1),Lhe=({clientId:e})=>{let{replaceBlocks:t}=(0,ak.useDispatch)(bI.store),r=(0,ak.useSelect)(a=>a(bI.store).getBlock(e),[e]);return(0,CH.jsx)(wH.ToolbarButton,{onClick:()=>t(r.clientId,(0,nk.rawHandler)({HTML:(0,nk.serialize)(r)})),children:(0,kH.__)("Convert to blocks")})},SH=Lhe;var TH=o(T(),1),Ll=o(M(),1),ik=o(U(),1),jf=o(P(),1),PH=o(V(),1);var BH=o(me(),1),Ji=o(v(),1);function Mhe({onClick:e,isModalFullScreen:t}){return(0,BH.useViewportMatch)("small","<")?null:(0,Ji.jsx)(Ll.Button,{size:"compact",onClick:e,icon:kp,isPressed:t,label:t?(0,jf.__)("Exit fullscreen"):(0,jf.__)("Enter fullscreen")})}function Ahe(e){let t=(0,PH.useSelect)(r=>r(TH.store).getSettings().styles);return(0,ik.useEffect)(()=>{let{baseURL:r,suffix:a,settings:n}=window.wpEditorL10n.tinymce;return window.tinymce.EditorManager.overrideDefaults({base_url:r,suffix:a}),window.wp.oldEditor.initialize(e.id,{tinymce:{...n,setup(i){i.on("init",()=>{let l=i.getDoc();t.forEach(({css:s})=>{let c=l.createElement("style");c.innerHTML=s,l.head.appendChild(c)})})}}}),()=>{window.wp.oldEditor.remove(e.id)}},[]),(0,Ji.jsx)("textarea",{...e})}function IH({clientId:e,content:t,onClose:r,onChange:a}){let[n,i]=(0,ik.useState)(!1),l=`editor-${e}`;return(0,Ji.jsxs)(Ll.Modal,{title:(0,jf.__)("Classic Editor"),onRequestClose:r,shouldCloseOnClickOutside:!1,overlayClassName:"block-editor-freeform-modal",isFullScreen:n,className:"block-editor-freeform-modal__content",headerActions:(0,Ji.jsx)(Mhe,{onClick:()=>i(!n),isModalFullScreen:n}),children:[(0,Ji.jsx)(Ahe,{id:l,defaultValue:t}),(0,Ji.jsxs)(Ll.Flex,{className:"block-editor-freeform-modal__actions",justify:"flex-end",expanded:!1,children:[(0,Ji.jsx)(Ll.FlexItem,{children:(0,Ji.jsx)(Ll.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:r,children:(0,jf.__)("Cancel")})}),(0,Ji.jsx)(Ll.FlexItem,{children:(0,Ji.jsx)(Ll.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:()=>{a(window.wp.oldEditor.getContent(l)),r()},children:(0,jf.__)("Save")})})]})]})}var Zo=o(v(),1);function EH({attributes:e,setAttributes:t,clientId:r}){let{content:a}=e,[n,i]=(0,Uf.useState)(!1),l=(0,Uf.useRef)(null),s=(0,NH.useSelect)(c=>c($c.store).canRemoveBlock(r),[r]);return(0,Zo.jsxs)(Zo.Fragment,{children:[s&&(0,Zo.jsx)($c.BlockControls,{children:(0,Zo.jsx)(qc.ToolbarGroup,{children:(0,Zo.jsx)(SH,{clientId:r})})}),(0,Zo.jsx)($c.BlockControls,{children:(0,Zo.jsx)(qc.ToolbarGroup,{children:(0,Zo.jsx)(qc.ToolbarButton,{ref:l,onClick:()=>i(!0),children:(0,V1.__)("Edit")})})}),(0,Zo.jsxs)("div",{...(0,$c.useBlockProps)(),children:[a?(0,Zo.jsx)(Uf.RawHTML,{children:a}):(0,Zo.jsx)(qc.Placeholder,{icon:(0,Zo.jsx)($c.BlockIcon,{icon:P0}),label:(0,V1.__)("Classic"),instructions:(0,V1.__)("Use the classic editor to add content."),children:(0,Zo.jsx)(qc.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:()=>i(!0),children:(0,V1.__)("Edit contents")})}),n&&(0,Zo.jsx)(IH,{clientId:r,content:a,onClose:()=>{i(!1),l.current&&l.current.focus()},onChange:c=>t({content:c})})]})]})}var lk={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/freeform",title:"Classic",category:"text",description:"Use the classic WordPress editor.",textdomain:"default",attributes:{content:{type:"string",source:"raw"}},supports:{className:!1,customClassName:!1,lock:!1,reusable:!1,renaming:!1,visibility:!1,customCSS:!1},editorStyle:"wp-block-freeform-editor"};var DH=o(U(),1),LH=o(v(),1);function MH({attributes:e}){let{content:t}=e;return(0,LH.jsx)(DH.RawHTML,{children:t})}var{name:F1}=lk,AH={icon:P0,edit:EH,save:MH},zhe=()=>E({name:F1,metadata:lk,settings:AH});var CI={};Z(CI,{init:()=>Ghe,metadata:()=>uk,name:()=>jH,settings:()=>dk});var wI=o(P(),1);var OH=o(W(),1);var _I=o(P(),1),sk=o(T(),1),ck=o(W(),1),xI=o(v(),1);function RH({attributes:e,setAttributes:t,onRemove:r,insertBlocksAfter:a,mergeBlocks:n}){let i=(0,sk.useBlockProps)();return(0,xI.jsx)("pre",{...i,children:(0,xI.jsx)(sk.RichText,{tagName:"code",identifier:"content",value:e.content,onChange:l=>t({content:l}),onRemove:r,onMerge:n,placeholder:(0,_I.__)("Write code\u2026"),"aria-label":(0,_I.__)("Code"),preserveWhiteSpace:!0,__unstablePastePlainText:!0,__unstableOnSplitAtDoubleLineEnd:()=>a((0,ck.createBlock)((0,ck.getDefaultBlockName)()))})})}var uk={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/code",title:"Code",category:"text",description:"Display code snippets that respect your spacing and tabs.",textdomain:"default",attributes:{content:{type:"rich-text",source:"rich-text",selector:"code",__unstablePreserveWhiteSpace:!0,role:"content"}},supports:{align:["wide"],anchor:!0,typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},spacing:{margin:["top","bottom"],padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{width:!0,color:!0}},color:{text:!0,background:!0,gradients:!0,__experimentalDefaultControls:{background:!0,text:!0}},interactivity:{clientNavigation:!0}},style:"wp-block-code"};var mk=o(T(),1);var zH=o(me(),1);function VH(e){return(0,zH.pipe)(Fhe,Hhe)(e||"")}function Fhe(e){return e.replace(/\[/g,"[")}function Hhe(e){return e.replace(/^(\s*https?:)\/\/([^\s<>"]+\s*)$/m,"$1//$2")}var kI=o(v(),1);function FH({attributes:e}){return(0,kI.jsx)("pre",{...mk.useBlockProps.save(),children:(0,kI.jsx)(mk.RichText.Content,{tagName:"code",value:VH(typeof e.content=="string"?e.content:e.content.toHTMLString({preserveWhiteSpace:!0}))})})}var H1=o(W(),1),pk=o(em(),1);var Ohe={from:[{type:"input",regExp:/^```$/,transform:()=>(0,H1.createBlock)("core/code")},{type:"block",blocks:["core/paragraph"],transform:e=>{let{content:t}=e;return(0,H1.createBlock)("core/code",{...e,...Wc(e,"core/code"),content:t})}},{type:"block",blocks:["core/html"],transform:e=>{let{content:t}=e;return(0,H1.createBlock)("core/code",{...e,...Wc(e,"core/code"),content:(0,pk.toHTMLString)({value:(0,pk.create)({text:t})})})}},{type:"raw",isMatch:e=>e.nodeName==="PRE"&&e.children.length===1&&e.firstChild.nodeName==="CODE",schema:{pre:{children:{code:{children:{"#text":{}}}}}}}],to:[{type:"block",blocks:["core/paragraph"],transform:e=>{let{content:t}=e;return(0,H1.createBlock)("core/paragraph",{...Wc(e,"core/paragraph"),content:t})}}]},HH=Ohe;var{fieldsKey:jhe,formKey:Uhe}=K(OH.privateApis),{name:jH}=uk,dk={icon:B0,example:{attributes:{content:(0,wI.__)(`// A \u201Cblock\u201D is the abstract term used // to describe units of markup that // when composed together, form the // content or layout of a page. registerBlockType( name, settings );`)}},merge(e,t){return{content:e.content+` `+t.content}},transforms:HH,edit:RH,save:FH};window.__experimentalContentOnlyInspectorFields&&(dk[jhe]=[{id:"content",label:(0,wI.__)("Code"),type:"text",Edit:"rich-text"}],dk[Uhe]={fields:["content"]});var Ghe=()=>E({name:jH,metadata:uk,settings:dk});var TI={};Z(TI,{init:()=>Khe,metadata:()=>hk,name:()=>ZH,settings:()=>KH});var UH=o(T(),1),SI=o(v(),1),Whe=[{attributes:{verticalAlignment:{type:"string"},width:{type:"number",min:0,max:100}},isEligible({width:e}){return isFinite(e)},migrate(e){return{...e,width:`${e.width}%`}},save({attributes:e}){let{verticalAlignment:t,width:r}=e,a=w({[`is-vertically-aligned-${t}`]:t}),n={flexBasis:r+"%"};return(0,SI.jsx)("div",{className:a,style:n,children:(0,SI.jsx)(UH.InnerBlocks.Content,{})})}}],GH=Whe;var Ko=o(T(),1),tm=o(M(),1),fk=o(V(),1),Ap=o(P(),1);var ci=o(v(),1);function $he({width:e,setAttributes:t}){let[r]=(0,Ko.useSettings)("spacing.units"),a=(0,tm.__experimentalUseCustomUnits)({availableUnits:r||["%","px","em","rem","vw"]}),n=q();return(0,ci.jsx)(tm.__experimentalToolsPanel,{label:(0,Ap.__)("Settings"),resetAll:()=>{t({width:void 0})},dropdownMenuProps:n,children:(0,ci.jsx)(tm.__experimentalToolsPanelItem,{hasValue:()=>e!==void 0,label:(0,Ap.__)("Width"),onDeselect:()=>t({width:void 0}),isShownByDefault:!0,children:(0,ci.jsx)(tm.__experimentalUnitControl,{label:(0,Ap.__)("Width"),__unstableInputWidth:"calc(50% - 8px)",__next40pxDefaultSize:!0,value:e||"",onChange:i=>{i=0>parseFloat(i)?"0":i,t({width:i})},units:a})})})}function qhe({attributes:{verticalAlignment:e,width:t,templateLock:r,allowedBlocks:a},setAttributes:n,clientId:i}){let l=w("block-core-columns",{[`is-vertically-aligned-${e}`]:e}),{columnsIds:s,hasChildBlocks:c,rootClientId:u}=(0,fk.useSelect)(k=>{let{getBlockOrder:_,getBlockRootClientId:x}=k(Ko.store),S=x(i);return{hasChildBlocks:_(i).length>0,rootClientId:S,columnsIds:_(S)}},[i]),{updateBlockAttributes:m}=(0,fk.useDispatch)(Ko.store),p=k=>{n({verticalAlignment:k}),m(u,{verticalAlignment:null})},d=Number.isFinite(t)?t+"%":t,f=(0,Ko.useBlockProps)({className:l,style:d?{flexBasis:d}:void 0}),h=s.length,g=s.indexOf(i)+1,b=(0,Ap.sprintf)((0,Ap.__)("%1$s (%2$d of %3$d)"),f["aria-label"],g,h),y=(0,Ko.useInnerBlocksProps)({...f,"aria-label":b},{templateLock:r,allowedBlocks:a,renderAppender:c?void 0:Ko.InnerBlocks.ButtonBlockAppender});return(0,ci.jsxs)(ci.Fragment,{children:[(0,ci.jsx)(Ko.BlockControls,{children:(0,ci.jsx)(Ko.BlockVerticalAlignmentToolbar,{onChange:p,value:e,controls:["top","center","bottom","stretch"]})}),(0,ci.jsx)(Ko.InspectorControls,{children:(0,ci.jsx)($he,{width:t,setAttributes:n})}),(0,ci.jsx)("div",{...y})]})}var WH=qhe;var hk={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/column",title:"Column",category:"design",parent:["core/columns"],description:"A single column within a columns block.",textdomain:"default",attributes:{verticalAlignment:{type:"string"},width:{type:"string"},templateLock:{type:["string","boolean"],enum:["all","insert","contentOnly",!1]}},supports:{__experimentalOnEnter:!0,anchor:!0,reusable:!1,html:!1,color:{gradients:!0,heading:!0,button:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},shadow:!0,spacing:{blockGap:!0,padding:!0,__experimentalDefaultControls:{padding:!0,blockGap:!0}},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,radius:!0,style:!0,width:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},layout:!0,interactivity:{clientNavigation:!0},allowedBlocks:!0}};var gk=o(T(),1),$H=o(v(),1);function qH({attributes:e}){let{verticalAlignment:t,width:r}=e,a=w({[`is-vertically-aligned-${t}`]:t}),n;if(r&&/\d/.test(r)){let s=Number.isFinite(r)?r+"%":r;!Number.isFinite(r)&&r?.endsWith("%")&&(s=Math.round(Number.parseFloat(r)*1e12)/1e12+"%"),n={flexBasis:s}}let i=gk.useBlockProps.save({className:a,style:n}),l=gk.useInnerBlocksProps.save(i);return(0,$H.jsx)("div",{...l})}var{name:ZH}=hk,KH={icon:s9,edit:WH,save:qH,deprecated:GH},Khe=()=>E({name:ZH,metadata:hk,settings:KH});var II={};Z(II,{init:()=>sge,metadata:()=>yk,name:()=>nO,settings:()=>iO});var O1=o(P(),1);var QH=o(W(),1),zp=o(T(),1),Rp=o(v(),1);function vk(e){let{doc:t}=vk;t||(t=document.implementation.createHTMLDocument(""),vk.doc=t);let r;t.body.innerHTML=e;for(let a of t.body.firstChild.classList)if(r=a.match(/^layout-column-(\d+)$/))return Number(r[1])-1}var Qhe=e=>{if(!e.customTextColor&&!e.customBackgroundColor)return e;let t={color:{}};e.customTextColor&&(t.color.text=e.customTextColor),e.customBackgroundColor&&(t.color.background=e.customBackgroundColor);let{customTextColor:r,customBackgroundColor:a,...n}=e;return{...n,style:t,isStackedOnMobile:!0}},YH=[{attributes:{verticalAlignment:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},customTextColor:{type:"string"},textColor:{type:"string"}},migrate:Qhe,save({attributes:e}){let{verticalAlignment:t,backgroundColor:r,customBackgroundColor:a,textColor:n,customTextColor:i}=e,l=(0,zp.getColorClassName)("background-color",r),s=(0,zp.getColorClassName)("color",n),c=w({"has-background":r||a,"has-text-color":n||i,[l]:l,[s]:s,[`are-vertically-aligned-${t}`]:t});return(0,Rp.jsx)("div",{className:c||void 0,style:{backgroundColor:l?void 0:a,color:s?void 0:i},children:(0,Rp.jsx)(zp.InnerBlocks.Content,{})})}},{attributes:{columns:{type:"number",default:2}},isEligible(e,t){return t.some(a=>/layout-column-\d+/.test(a.originalContent))?t.some(a=>vk(a.originalContent)!==void 0):!1},migrate(e,t){let a=t.reduce((l,s)=>{let{originalContent:c}=s,u=vk(c);return u===void 0&&(u=0),l[u]||(l[u]=[]),l[u].push(s),l},[]).map(l=>(0,QH.createBlock)("core/column",{},l)),{columns:n,...i}=e;return[{...i,isStackedOnMobile:!0},a]},save({attributes:e}){let{columns:t}=e;return(0,Rp.jsx)("div",{className:`has-${t}-columns`,children:(0,Rp.jsx)(zp.InnerBlocks.Content,{})})}},{attributes:{columns:{type:"number",default:2}},migrate(e,t){let{columns:r,...a}=e;return e={...a,isStackedOnMobile:!0},[e,t]},save({attributes:e}){let{verticalAlignment:t,columns:r}=e,a=w(`has-${r}-columns`,{[`are-vertically-aligned-${t}`]:t});return(0,Rp.jsx)("div",{className:a,children:(0,Rp.jsx)(zp.InnerBlocks.Content,{})})}}];var Vp=o(P(),1),tl=o(M(),1),Vr=o(T(),1),el=o(V(),1),Fp=o(W(),1);var bk=e=>{let t=parseFloat(e);return Number.isFinite(t)?parseFloat(t.toFixed(2)):void 0};function XH(e,t){let{width:r=100/t}=e.attributes;return bk(r)}function Yhe(e,t=e.length){return e.reduce((r,a)=>r+XH(a,t),0)}function Xhe(e,t=e.length){return e.reduce((r,a)=>{let n=XH(a,t);return Object.assign(r,{[a.clientId]:n})},{})}function PI(e,t,r=e.length){let a=Yhe(e,r);return Object.fromEntries(Object.entries(Xhe(e,r)).map(([n,i])=>{let l=t*i/a;return[n,bk(l)]}))}function JH(e){return e.every(t=>{let r=t.attributes.width;return Number.isFinite(r?.endsWith?.("%")?parseFloat(r):r)})}function BI(e,t){return e.map(r=>({...r,attributes:{...r.attributes,width:`${t[r.clientId]}%`}}))}var mo=o(v(),1),Jhe={name:"core/column"};function ege({clientId:e,setAttributes:t,isStackedOnMobile:r}){let{count:a,canInsertColumnBlock:n,minCount:i}=(0,el.useSelect)(m=>{let{canInsertBlockType:p,canRemoveBlock:d,getBlockOrder:f}=m(Vr.store),h=f(e),g=h.reduce((b,y,k)=>(d(y)||b.push(k),b),[]);return{count:h.length,canInsertColumnBlock:p("core/column",e),minCount:Math.max(...g)+1}},[e]),{getBlocks:l}=(0,el.useSelect)(Vr.store),{replaceInnerBlocks:s}=(0,el.useDispatch)(Vr.store);function c(m,p){let d=l(e),f=JH(d),h=p>m;if(h&&f){let g=bk(100/p),b=p-m,y=PI(d,100-g*b);d=[...BI(d,y),...Array.from({length:b}).map(()=>(0,Fp.createBlock)("core/column",{width:`${g}%`}))]}else if(h)d=[...d,...Array.from({length:p-m}).map(()=>(0,Fp.createBlock)("core/column"))];else if(p<m&&(d=d.slice(0,-(m-p)),f)){let g=PI(d,100);d=BI(d,g)}s(e,d)}let u=q();return(0,mo.jsxs)(tl.__experimentalToolsPanel,{label:(0,Vp.__)("Settings"),resetAll:()=>{t({isStackedOnMobile:!0})},dropdownMenuProps:u,children:[n&&(0,mo.jsxs)(tl.__experimentalVStack,{spacing:4,style:{gridColumn:"1 / -1"},children:[(0,mo.jsx)(tl.RangeControl,{__next40pxDefaultSize:!0,label:(0,Vp.__)("Columns"),value:a,onChange:m=>c(a,Math.max(i,m)),min:Math.max(1,i),max:Math.max(6,a)}),a>6&&(0,mo.jsx)(tl.Notice,{status:"warning",isDismissible:!1,children:(0,Vp.__)("This column count exceeds the recommended amount and may cause visual breakage.")})]}),(0,mo.jsx)(tl.__experimentalToolsPanelItem,{label:(0,Vp.__)("Stack on mobile"),isShownByDefault:!0,hasValue:()=>r!==!0,onDeselect:()=>t({isStackedOnMobile:!0}),children:(0,mo.jsx)(tl.ToggleControl,{label:(0,Vp.__)("Stack on mobile"),checked:r,onChange:()=>t({isStackedOnMobile:!r})})})]})}function tge({attributes:e,setAttributes:t,clientId:r}){let{isStackedOnMobile:a,verticalAlignment:n,templateLock:i}=e,l=(0,el.useRegistry)(),{getBlockOrder:s}=(0,el.useSelect)(Vr.store),{updateBlockAttributes:c}=(0,el.useDispatch)(Vr.store),u=w({[`are-vertically-aligned-${n}`]:n,"is-not-stacked-on-mobile":!a}),m=(0,Vr.useBlockProps)({className:u}),p=(0,Vr.useInnerBlocksProps)(m,{defaultBlock:Jhe,directInsert:!0,orientation:"horizontal",renderAppender:!1,templateLock:i});function d(f){let h=s(r);l.batch(()=>{t({verticalAlignment:f}),c(h,{verticalAlignment:f})})}return(0,mo.jsxs)(mo.Fragment,{children:[(0,mo.jsx)(Vr.BlockControls,{children:(0,mo.jsx)(Vr.BlockVerticalAlignmentToolbar,{onChange:d,value:n})}),(0,mo.jsx)(Vr.InspectorControls,{children:(0,mo.jsx)(ege,{clientId:r,setAttributes:t,isStackedOnMobile:a})}),(0,mo.jsx)("div",{...p})]})}function rge({clientId:e,name:t,setAttributes:r}){let{blockType:a,defaultVariation:n,variations:i}=(0,el.useSelect)(c=>{let{getBlockVariations:u,getBlockType:m,getDefaultBlockVariation:p}=c(Fp.store);return{blockType:m(t),defaultVariation:p(t,"block"),variations:u(t,"block")}},[t]),{replaceInnerBlocks:l}=(0,el.useDispatch)(Vr.store),s=(0,Vr.useBlockProps)();return(0,mo.jsx)("div",{...s,children:(0,mo.jsx)(Vr.__experimentalBlockVariationPicker,{icon:a?.icon?.src,label:a?.title,variations:i,instructions:(0,Vp.__)("Divide into columns. Select a layout:"),onSelect:(c=n)=>{c.attributes&&r(c.attributes),c.innerBlocks&&l(e,(0,Fp.createBlocksFromInnerBlocksTemplate)(c.innerBlocks),!0)},allowSkip:!0})})}var oge=e=>{let{clientId:t}=e,a=(0,el.useSelect)(n=>n(Vr.store).getBlocks(t).length>0,[t])?tge:rge;return(0,mo.jsx)(a,{...e})},eO=oge;var yk={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/columns",title:"Columns",category:"design",allowedBlocks:["core/column"],description:"Display content in multiple columns, with blocks added to each column.",textdomain:"default",attributes:{verticalAlignment:{type:"string"},isStackedOnMobile:{type:"boolean",default:!0},templateLock:{type:["string","boolean"],enum:["all","insert","contentOnly",!1]}},supports:{anchor:!0,align:["wide","full"],html:!1,color:{gradients:!0,link:!0,heading:!0,button:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{blockGap:{__experimentalDefault:"2em",sides:["horizontal","vertical"]},margin:["top","bottom"],padding:!0,__experimentalDefaultControls:{padding:!0,blockGap:!0}},layout:{allowSwitching:!1,allowInheriting:!1,allowEditing:!1,default:{type:"flex",flexWrap:"nowrap"}},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,radius:!0,style:!0,width:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},shadow:!0},editorStyle:"wp-block-columns-editor",style:"wp-block-columns"};var _k=o(T(),1),tO=o(v(),1);function rO({attributes:e}){let{isStackedOnMobile:t,verticalAlignment:r}=e,a=w({[`are-vertically-aligned-${r}`]:r,"is-not-stacked-on-mobile":!t}),n=_k.useBlockProps.save({className:a}),i=_k.useInnerBlocksProps.save(n);return(0,tO.jsx)("div",{...i})}var Bn=o(M(),1),ui=o(P(),1),mi=o(v(),1),nge=[{name:"one-column-full",title:(0,ui.__)("100"),description:(0,ui.__)("One column"),icon:(0,mi.jsx)(Bn.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 48 48",children:(0,mi.jsx)(Bn.Path,{d:"M0 10a2 2 0 0 1 2-2h44a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Z"})}),innerBlocks:[["core/column"]],scope:["block"]},{name:"two-columns-equal",title:(0,ui.__)("50 / 50"),description:(0,ui.__)("Two columns; equal split"),icon:(0,mi.jsx)(Bn.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 48 48",children:(0,mi.jsx)(Bn.Path,{d:"M0 10a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Zm25 0a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H27a2 2 0 0 1-2-2V10Z"})}),isDefault:!0,innerBlocks:[["core/column"],["core/column"]],scope:["block"]},{name:"two-columns-one-third-two-thirds",title:(0,ui.__)("33 / 66"),description:(0,ui.__)("Two columns; one-third, two-thirds split"),icon:(0,mi.jsx)(Bn.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 48 48",children:(0,mi.jsx)(Bn.Path,{d:"M0 10a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Zm17 0a2 2 0 0 1 2-2h27a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H19a2 2 0 0 1-2-2V10Z"})}),innerBlocks:[["core/column",{width:"33.33%"}],["core/column",{width:"66.66%"}]],scope:["block"]},{name:"two-columns-two-thirds-one-third",title:(0,ui.__)("66 / 33"),description:(0,ui.__)("Two columns; two-thirds, one-third split"),icon:(0,mi.jsx)(Bn.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 48 48",children:(0,mi.jsx)(Bn.Path,{d:"M0 10a2 2 0 0 1 2-2h27a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Zm33 0a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H35a2 2 0 0 1-2-2V10Z"})}),innerBlocks:[["core/column",{width:"66.66%"}],["core/column",{width:"33.33%"}]],scope:["block"]},{name:"three-columns-equal",title:(0,ui.__)("33 / 33 / 33"),description:(0,ui.__)("Three columns; equal split"),icon:(0,mi.jsx)(Bn.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 48 48",children:(0,mi.jsx)(Bn.Path,{d:"M0 10a2 2 0 0 1 2-2h10.531c1.105 0 1.969.895 1.969 2v28c0 1.105-.864 2-1.969 2H2a2 2 0 0 1-2-2V10Zm16.5 0c0-1.105.864-2 1.969-2H29.53c1.105 0 1.969.895 1.969 2v28c0 1.105-.864 2-1.969 2H18.47c-1.105 0-1.969-.895-1.969-2V10Zm17 0c0-1.105.864-2 1.969-2H46a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H35.469c-1.105 0-1.969-.895-1.969-2V10Z"})}),innerBlocks:[["core/column"],["core/column"],["core/column"]],scope:["block"]},{name:"three-columns-wider-center",title:(0,ui.__)("25 / 50 / 25"),description:(0,ui.__)("Three columns; wide center column"),icon:(0,mi.jsx)(Bn.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 48 48",children:(0,mi.jsx)(Bn.Path,{d:"M0 10a2 2 0 0 1 2-2h7.531c1.105 0 1.969.895 1.969 2v28c0 1.105-.864 2-1.969 2H2a2 2 0 0 1-2-2V10Zm13.5 0c0-1.105.864-2 1.969-2H32.53c1.105 0 1.969.895 1.969 2v28c0 1.105-.864 2-1.969 2H15.47c-1.105 0-1.969-.895-1.969-2V10Zm23 0c0-1.105.864-2 1.969-2H46a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2h-7.531c-1.105 0-1.969-.895-1.969-2V10Z"})}),innerBlocks:[["core/column",{width:"25%"}],["core/column",{width:"50%"}],["core/column",{width:"25%"}]],scope:["block"]}],oO=nge;var Gf=o(W(),1),ige=6,lge={from:[{type:"block",isMultiBlock:!0,blocks:["*"],__experimentalConvert:e=>{let t=+(100/e.length).toFixed(2),r=e.map(({name:a,attributes:n,innerBlocks:i})=>["core/column",{width:`${t}%`},[[a,{...n},i]]]);return(0,Gf.createBlock)("core/columns",{},(0,Gf.createBlocksFromInnerBlocksTemplate)(r))},isMatch:({length:e},t)=>t.length===1&&t[0].name==="core/columns"?!1:e&&e<=ige},{type:"block",blocks:["core/media-text"],priority:1,transform:(e,t)=>{let{align:r,backgroundColor:a,textColor:n,style:i,mediaAlt:l,mediaId:s,mediaPosition:c,mediaSizeSlug:u,mediaType:m,mediaUrl:p,mediaWidth:d,verticalAlignment:f}=e,h;if(m==="image"||!m){let b={id:s,alt:l,url:p,sizeSlug:u},y={href:e.href,linkClass:e.linkClass,linkDestination:e.linkDestination,linkTarget:e.linkTarget,rel:e.rel};h=["core/image",{...b,...y}]}else h=["core/video",{id:s,src:p}];let g=[["core/column",{width:`${d}%`},[h]],["core/column",{width:`${100-d}%`},t]];return c==="right"&&g.reverse(),(0,Gf.createBlock)("core/columns",{align:r,backgroundColor:a,textColor:n,style:i,verticalAlignment:f},(0,Gf.createBlocksFromInnerBlocksTemplate)(g))}}],ungroup:(e,t)=>t.flatMap(r=>r.innerBlocks)},aO=lge;var{name:nO}=yk,iO={icon:u9,variations:oO,example:{viewportWidth:782,innerBlocks:[{name:"core/column",innerBlocks:[{name:"core/paragraph",attributes:{content:(0,O1.__)("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent et eros eu felis.")}},{name:"core/image",attributes:{url:"https://s.w.org/images/core/5.3/Windbuchencom.jpg"}},{name:"core/paragraph",attributes:{content:(0,O1.__)("Suspendisse commodo neque lacus, a dictum orci interdum et.")}}]},{name:"core/column",innerBlocks:[{name:"core/paragraph",attributes:{content:(0,O1.__)("Etiam et egestas lorem. Vivamus sagittis sit amet dolor quis lobortis. Integer sed fermentum arcu, id vulputate lacus. Etiam fermentum sem eu quam hendrerit.")}},{name:"core/paragraph",attributes:{content:(0,O1.__)("Nam risus massa, ullamcorper consectetur eros fermentum, porta aliquet ligula. Sed vel mauris nec enim.")}}]}]},deprecated:YH,edit:eO,save:rO,transforms:aO},sge=()=>E({name:nO,metadata:yk,settings:iO});var LI={};Z(LI,{init:()=>fge,metadata:()=>xk,name:()=>CO,settings:()=>SO});var xk={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/comments",title:"Comments",category:"theme",description:"An advanced block that allows displaying post comments using different visual configurations.",textdomain:"default",attributes:{tagName:{type:"string",default:"div"},legacy:{type:"boolean",default:!1}},supports:{anchor:!0,align:["wide","full"],html:!1,color:{gradients:!0,heading:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}}},editorStyle:"wp-block-comments-editor",usesContext:["postId","postType"]};var kk=o(T(),1),NI=o(v(),1),uge={attributes:{tagName:{type:"string",default:"div"}},apiVersion:3,supports:{align:["wide","full"],html:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}}},save({attributes:{tagName:e}}){let t=kk.useBlockProps.save(),{className:r}=t,n=(r?.split(" ")||[])?.filter(l=>l!=="wp-block-comments"),i={...t,className:n.join(" ")};return(0,NI.jsx)(e,{...i,children:(0,NI.jsx)(kk.InnerBlocks.Content,{})})}},lO=[uge];var Tk=o(T(),1);var sO=o(P(),1),j1=o(T(),1);var wk=o(v(),1),{HTMLElementControl:mge}=K(j1.privateApis);function cO({attributes:{tagName:e},setAttributes:t}){return(0,wk.jsx)(j1.InspectorControls,{children:(0,wk.jsx)(j1.InspectorControls,{group:"advanced",children:(0,wk.jsx)(mge,{tagName:e,onChange:r=>t({tagName:r}),options:[{label:(0,sO.__)("Default (<div>)"),value:"div"},{label:"<section>",value:"section"},{label:"<aside>",value:"aside"}]})})})}var om=o(T(),1),DI=o(P(),1),bO=o(M(),1);var dO=o(T(),1),Qr=o(P(),1),fO=o(V(),1),hO=o(Q(),1),gO=o(U(),1);var rl=o(P(),1),rm=o(T(),1),uO=o(M(),1),mO=o(me(),1),Ck=o(Q(),1),EI=o(V(),1),Ka=o(v(),1),pO=()=>{let e=(0,mO.useInstanceId)(pO);return(0,Ka.jsxs)("div",{className:"comment-respond",children:[(0,Ka.jsx)("h3",{className:"comment-reply-title",children:(0,rl.__)("Leave a Reply")}),(0,Ka.jsxs)("form",{noValidate:!0,className:"comment-form",onSubmit:t=>t.preventDefault(),children:[(0,Ka.jsxs)("p",{children:[(0,Ka.jsx)("label",{htmlFor:`comment-${e}`,children:(0,rl.__)("Comment")}),(0,Ka.jsx)("textarea",{id:`comment-${e}`,name:"comment",cols:"45",rows:"8",readOnly:!0})]}),(0,Ka.jsx)("p",{className:"form-submit wp-block-button",children:(0,Ka.jsx)("input",{name:"submit",type:"submit",className:w("wp-block-button__link",(0,rm.__experimentalGetElementClassName)("button")),label:(0,rl.__)("Post Comment"),value:(0,rl.__)("Post Comment"),"aria-disabled":"true"})})]})]})},pge=({postId:e,postType:t})=>{let[r,a]=(0,Ck.useEntityProp)("postType",t,"comment_status",e),n=t===void 0||e===void 0,i=(0,EI.useSelect)(s=>s(rm.store).getSettings().__experimentalDiscussionSettings?.defaultCommentStatus,[]),l=(0,EI.useSelect)(s=>t?!!s(Ck.store).getPostType(t)?.supports.comments:!1);if(!n&&r!=="open")if(r==="closed"){let s=[(0,Ka.jsx)(uO.Button,{__next40pxDefaultSize:!0,onClick:()=>a("open"),variant:"primary",children:(0,rl._x)("Enable comments","action that affects the current post")},"enableComments")];return(0,Ka.jsx)(rm.Warning,{actions:s,children:(0,rl.__)("Post Comments Form block: Comments are not enabled for this item.")})}else if(l){if(i!=="open")return(0,Ka.jsx)(rm.Warning,{children:(0,rl.__)("Post Comments Form block: Comments are not enabled.")})}else return(0,Ka.jsx)(rm.Warning,{children:(0,rl.sprintf)((0,rl.__)("Post Comments Form block: Comments are not enabled for this post type (%s)."),t)});return(0,Ka.jsx)(pO,{})},Sk=pge;var et=o(v(),1);function vO({postType:e,postId:t}){let[r]=(0,hO.useEntityProp)("postType",e,"title",t);r=r||(0,Qr.__)("Post Title");let a=(0,fO.useSelect)(n=>n(dO.store).getSettings().__experimentalDiscussionSettings?.avatarURL,[]);return(0,et.jsxs)("div",{className:"wp-block-comments__legacy-placeholder",inert:"true",children:[(0,et.jsx)("h3",{children:(0,Qr.sprintf)((0,Qr.__)("One response to %s"),r)}),(0,et.jsxs)("div",{className:"navigation",children:[(0,et.jsx)("div",{className:"alignleft",children:(0,et.jsxs)("a",{href:"#top",children:["\xAB ",(0,Qr.__)("Older Comments")]})}),(0,et.jsx)("div",{className:"alignright",children:(0,et.jsxs)("a",{href:"#top",children:[(0,Qr.__)("Newer Comments")," \xBB"]})})]}),(0,et.jsx)("ol",{className:"commentlist",children:(0,et.jsx)("li",{className:"comment even thread-even depth-1",children:(0,et.jsxs)("article",{className:"comment-body",children:[(0,et.jsxs)("footer",{className:"comment-meta",children:[(0,et.jsxs)("div",{className:"comment-author vcard",children:[(0,et.jsx)("img",{alt:(0,Qr.__)("Commenter Avatar"),src:a,className:"avatar avatar-32 photo",height:"32",width:"32",loading:"lazy"}),(0,et.jsx)("b",{className:"fn",children:(0,et.jsx)("a",{href:"#top",className:"url",children:(0,Qr.__)("A WordPress Commenter")})})," ",(0,et.jsxs)("span",{className:"says",children:[(0,Qr.__)("says"),":"]})]}),(0,et.jsxs)("div",{className:"comment-metadata",children:[(0,et.jsx)("a",{href:"#top",children:(0,et.jsx)("time",{dateTime:"2000-01-01T00:00:00+00:00",children:(0,Qr.__)("January 1, 2000 at 00:00 am")})})," ",(0,et.jsx)("span",{className:"edit-link",children:(0,et.jsx)("a",{className:"comment-edit-link",href:"#top",children:(0,Qr.__)("Edit")})})]})]}),(0,et.jsx)("div",{className:"comment-content",children:(0,et.jsxs)("p",{children:[(0,Qr.__)("Hi, this is a comment."),(0,et.jsx)("br",{}),(0,Qr.__)("To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard."),(0,et.jsx)("br",{}),(0,gO.createInterpolateElement)((0,Qr.__)("Commenter avatars come from <a>Gravatar</a>."),{a:(0,et.jsx)("a",{href:"https://gravatar.com/"})})]})}),(0,et.jsx)("div",{className:"reply",children:(0,et.jsx)("a",{className:"comment-reply-link",href:"#top","aria-label":(0,Qr.__)("Reply to A WordPress Commenter"),children:(0,Qr._x)("Reply","verb")})})]})})}),(0,et.jsxs)("div",{className:"navigation",children:[(0,et.jsx)("div",{className:"alignleft",children:(0,et.jsxs)("a",{href:"#top",children:["\xAB ",(0,Qr.__)("Older Comments")]})}),(0,et.jsx)("div",{className:"alignright",children:(0,et.jsxs)("a",{href:"#top",children:[(0,Qr.__)("Newer Comments")," \xBB"]})})]}),(0,et.jsx)(Sk,{postId:t,postType:e})]})}var Ml=o(v(),1);function yO({attributes:e,setAttributes:t,context:{postType:r,postId:a}}){let{textAlign:n}=e,i=[(0,Ml.jsx)(bO.Button,{__next40pxDefaultSize:!0,onClick:()=>{t({legacy:!1})},variant:"primary",children:(0,DI.__)("Switch to editable mode")},"convert")],l=(0,om.useBlockProps)({className:w({[`has-text-align-${n}`]:n})});return(0,Ml.jsxs)(Ml.Fragment,{children:[(0,Ml.jsx)(om.BlockControls,{group:"block",children:(0,Ml.jsx)(om.AlignmentControl,{value:n,onChange:s=>{t({textAlign:s})}})}),(0,Ml.jsxs)("div",{...l,children:[(0,Ml.jsx)(om.Warning,{actions:i,children:(0,DI.__)("Comments block: You\u2019re currently using the legacy version of the block. The following is just a placeholder - the final styling will likely look different. For a better representation and more customization options, switch the block to its editable mode.")}),(0,Ml.jsx)(vO,{postId:a,postType:r})]})]})}var dge=[["core/comments-title"],["core/comment-template",{},[["core/columns",{},[["core/column",{width:"40px"},[["core/avatar",{size:40,style:{border:{radius:"20px"}}}]]],["core/column",{},[["core/comment-author-name",{fontSize:"small"}],["core/group",{layout:{type:"flex"},style:{spacing:{margin:{top:"0px",bottom:"0px"}}}},[["core/comment-date",{fontSize:"small"}],["core/comment-edit-link",{fontSize:"small"}]]],["core/comment-content"],["core/comment-reply-link",{fontSize:"small"}]]]]]]],["core/comments-pagination"],["core/post-comments-form"]],_O=dge;var am=o(v(),1);function xO(e){let{attributes:t,setAttributes:r,clientId:a}=e,{tagName:n,legacy:i}=t,l=(0,Tk.useBlockProps)(),s=(0,Tk.useInnerBlocksProps)(l,{template:_O});return i?(0,am.jsx)(yO,{...e}):(0,am.jsxs)(am.Fragment,{children:[(0,am.jsx)(cO,{attributes:t,setAttributes:r,clientId:a}),(0,am.jsx)(n,{...s})]})}var Pk=o(T(),1),kO=o(v(),1);function wO({attributes:{tagName:e,legacy:t}}){let r=Pk.useBlockProps.save(),a=Pk.useInnerBlocksProps.save(r);return t?null:(0,kO.jsx)(e,{...a})}var{name:CO}=xk,SO={icon:pP,example:{},edit:xO,save:wO,deprecated:lO},fge=()=>E({name:CO,metadata:xk,settings:SO});var AI={};Z(AI,{init:()=>gge,metadata:()=>Bk,name:()=>BO,settings:()=>IO});var Bk={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,__experimental:"fse",name:"core/comment-author-avatar",title:"Comment Author Avatar (deprecated)",category:"theme",ancestor:["core/comment-template"],description:"This block is deprecated. Please use the Avatar block instead.",textdomain:"default",attributes:{width:{type:"number",default:96},height:{type:"number",default:96}},usesContext:["commentId"],supports:{html:!1,inserter:!1,__experimentalBorder:{radius:!0,width:!0,color:!0,style:!0},color:{background:!0,text:!1,__experimentalDefaultControls:{background:!0}},spacing:{__experimentalSkipSerialization:!0,margin:!0,padding:!0},interactivity:{clientNavigation:!0}}};var nm=o(T(),1),Wf=o(M(),1),MI=o(Q(),1),TO=o(V(),1),Hp=o(P(),1),Al=o(v(),1);function PO({attributes:e,context:{commentId:t},setAttributes:r,isSelected:a}){let{height:n,width:i}=e,[l]=(0,MI.useEntityProp)("root","comment","author_avatar_urls",t),[s]=(0,MI.useEntityProp)("root","comment","author_name",t),c=l?Object.values(l):null,u=l?Object.keys(l):null,m=u?u[0]:24,p=u?u[u.length-1]:96,d=(0,nm.useBlockProps)(),f=(0,nm.__experimentalGetSpacingClassesAndStyles)(e),h=Math.floor(p*2.5),g=(0,TO.useSelect)(k=>{let{__experimentalDiscussionSettings:_}=k(nm.store).getSettings();return _?.avatarURL},[]),b=(0,Al.jsx)(nm.InspectorControls,{children:(0,Al.jsx)(Wf.PanelBody,{title:(0,Hp.__)("Settings"),children:(0,Al.jsx)(Wf.RangeControl,{__next40pxDefaultSize:!0,label:(0,Hp.__)("Image size"),onChange:k=>r({width:k,height:k}),min:m,max:h,initialPosition:i,value:i})})}),y=(0,Al.jsx)(Wf.ResizableBox,{size:{width:i,height:n},showHandle:a,onResizeStop:(k,_,x,S)=>{r({height:parseInt(n+S.height,10),width:parseInt(i+S.width,10)})},lockAspectRatio:!0,enable:{top:!1,right:!(0,Hp.isRTL)(),bottom:!0,left:(0,Hp.isRTL)()},minWidth:m,maxWidth:h,children:(0,Al.jsx)("img",{src:c?c[c.length-1]:g,alt:`${s} ${(0,Hp.__)("Avatar")}`,...d})});return(0,Al.jsxs)(Al.Fragment,{children:[b,(0,Al.jsx)("div",{...f,children:y})]})}var{name:BO}=Bk,IO={icon:I0,edit:PO},gge=()=>E({name:BO,metadata:Bk,settings:IO});var RI={};Z(RI,{init:()=>_ge,metadata:()=>Ik,name:()=>MO,settings:()=>AO});var Ik={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/comment-author-name",title:"Comment Author Name",category:"theme",ancestor:["core/comment-template"],description:"Displays the name of the author of the comment.",textdomain:"default",attributes:{isLink:{type:"boolean",default:!0},linkTarget:{type:"string",default:"_self"}},usesContext:["commentId"],supports:{anchor:!0,html:!1,spacing:{margin:!0,padding:!0},color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},typography:{fontSize:!0,lineHeight:!0,textAlign:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}}},style:"wp-block-comment-author-name"};var Zc=o(P(),1),NO=o(V(),1),Nk=o(T(),1),EO=o(Q(),1),im=o(M(),1);var pi=o(v(),1);function DO(e){let{attributes:{isLink:t,linkTarget:r},context:{commentId:a},setAttributes:n}=e;Kr(e);let i=q(),l=(0,Nk.useBlockProps)(),s=(0,NO.useSelect)(m=>{let{getEntityRecord:p}=m(EO.store),d=p("root","comment",a),f=d?.author_name;return d&&!f?p("root","user",d.author)?.name??(0,Zc.__)("Anonymous"):f??""},[a]),c=(0,pi.jsx)(Nk.InspectorControls,{children:(0,pi.jsxs)(im.__experimentalToolsPanel,{label:(0,Zc.__)("Settings"),resetAll:()=>{n({isLink:!0,linkTarget:"_self"})},dropdownMenuProps:i,children:[(0,pi.jsx)(im.__experimentalToolsPanelItem,{label:(0,Zc.__)("Link to authors URL"),isShownByDefault:!0,hasValue:()=>!t,onDeselect:()=>n({isLink:!0}),children:(0,pi.jsx)(im.ToggleControl,{label:(0,Zc.__)("Link to authors URL"),onChange:()=>n({isLink:!t}),checked:t})}),t&&(0,pi.jsx)(im.__experimentalToolsPanelItem,{label:(0,Zc.__)("Open in new tab"),isShownByDefault:!0,hasValue:()=>r!=="_self",onDeselect:()=>n({linkTarget:"_self"}),children:(0,pi.jsx)(im.ToggleControl,{label:(0,Zc.__)("Open in new tab"),onChange:m=>n({linkTarget:m?"_blank":"_self"}),checked:r==="_blank"})})]})});return(!a||!s)&&(s=(0,Zc._x)("Comment Author","block title")),(0,pi.jsxs)(pi.Fragment,{children:[c,(0,pi.jsx)("div",{...l,children:t?(0,pi.jsx)("a",{href:"#comment-author-pseudo-link",onClick:m=>m.preventDefault(),children:s}):s})]})}var bge={attributes:{isLink:{type:"boolean",default:!0},linkTarget:{type:"string",default:"_self"},textAlign:{type:"string"}},usesContext:["commentId"],supports:{html:!1,spacing:{margin:!0,padding:!0},color:{gradients:!0,link:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0}},save(){return null},migrate:We,isEligible(e){return!!e.textAlign||!!e.className?.match(/\bhas-text-align-(left|center|right)\b/)}},yge={attributes:{isLink:{type:"boolean",default:!1},linkTarget:{type:"string",default:"_self"}},supports:{html:!1,color:{gradients:!0,link:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalLetterSpacing:!0}},save(){return null},migrate:Ot,isEligible({style:e}){return e?.typography?.fontFamily}},LO=[bge,yge];var{name:MO}=Ik,AO={icon:p9,edit:DO,deprecated:LO,example:{}},_ge=()=>E({name:MO,metadata:Ik,settings:AO});var zI={};Z(zI,{init:()=>wge,metadata:()=>Ek,name:()=>UO,settings:()=>GO});var Ek={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/comment-content",title:"Comment Content",category:"theme",ancestor:["core/comment-template"],description:"Displays the contents of a comment.",textdomain:"default",usesContext:["commentId"],supports:{anchor:!0,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},typography:{fontSize:!0,lineHeight:!0,textAlign:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}},spacing:{padding:["horizontal","vertical"],__experimentalDefaultControls:{padding:!0}},html:!1},style:"wp-block-comment-content"};var RO=o(P(),1),zO=o(U(),1),VO=o(M(),1),FO=o(Q(),1),HO=o(T(),1);var Rl=o(v(),1);function OO(e){let{context:{commentId:t}}=e;Kr(e);let r=(0,HO.useBlockProps)(),[a]=(0,FO.useEntityProp)("root","comment","content",t);return!t||!a?(0,Rl.jsx)(Rl.Fragment,{children:(0,Rl.jsx)("div",{...r,children:(0,Rl.jsx)("p",{children:(0,RO._x)("Comment Content","block title")})})}):(0,Rl.jsx)(Rl.Fragment,{children:(0,Rl.jsx)("div",{...r,children:(0,Rl.jsx)(VO.Disabled,{children:(0,Rl.jsx)(zO.RawHTML,{children:a.rendered},"html")})})})}var kge={attributes:{textAlign:{type:"string"}},usesContext:["commentId"],supports:{anchor:!0,color:{gradients:!0,link:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0},spacing:{padding:["horizontal","vertical"]},html:!1},save(){return null},migrate:We,isEligible(e){return!!e.textAlign||!!e.className?.match(/\bhas-text-align-(left|center|right)\b/)}},jO=[kge];var{name:UO}=Ek,GO={icon:f9,edit:OO,deprecated:jO,example:{}},wge=()=>E({name:UO,metadata:Ek,settings:GO});var FI={};Z(FI,{init:()=>Tge,metadata:()=>Dk,name:()=>ZO,settings:()=>KO});var Dk={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/comment-date",title:"Comment Date",category:"theme",ancestor:["core/comment-template"],description:"Displays the date on which the comment was posted.",textdomain:"default",attributes:{format:{type:"string"},isLink:{type:"boolean",default:!0}},usesContext:["commentId"],supports:{anchor:!0,html:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,textAlign:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}}},style:"wp-block-comment-date"};var VI=o(Q(),1),jp=o(Lk(),1),$f=o(T(),1),Up=o(M(),1),Op=o(P(),1);var Qa=o(v(),1);function $O({attributes:{format:e,isLink:t},context:{commentId:r},setAttributes:a}){let n=(0,$f.useBlockProps)(),i=q(),[l]=(0,VI.useEntityProp)("root","comment","date",r),[s=(0,jp.getSettings)().formats.date]=(0,VI.useEntityProp)("root","site","date_format"),c=(0,Qa.jsx)($f.InspectorControls,{children:(0,Qa.jsxs)(Up.__experimentalToolsPanel,{label:(0,Op.__)("Settings"),resetAll:()=>{a({format:void 0,isLink:!0})},dropdownMenuProps:i,children:[(0,Qa.jsx)(Up.__experimentalToolsPanelItem,{label:(0,Op.__)("Date format"),hasValue:()=>e!==void 0,onDeselect:()=>a({format:void 0}),isShownByDefault:!0,children:(0,Qa.jsx)($f.__experimentalDateFormatPicker,{format:e,defaultFormat:s,onChange:m=>a({format:m})})}),(0,Qa.jsx)(Up.__experimentalToolsPanelItem,{label:(0,Op.__)("Link to comment"),hasValue:()=>!t,onDeselect:()=>a({isLink:!0}),isShownByDefault:!0,children:(0,Qa.jsx)(Up.ToggleControl,{label:(0,Op.__)("Link to comment"),onChange:()=>a({isLink:!t}),checked:t})})]})});(!r||!l)&&(l=(0,Op._x)("Comment Date","block title"));let u=l instanceof Date?(0,Qa.jsx)("time",{dateTime:(0,jp.dateI18n)("c",l),children:e==="human-diff"?(0,jp.humanTimeDiff)(l):(0,jp.dateI18n)(e||s,l)}):(0,Qa.jsx)("time",{children:l});return t&&(u=(0,Qa.jsx)("a",{href:"#comment-date-pseudo-link",onClick:m=>m.preventDefault(),children:u})),(0,Qa.jsxs)(Qa.Fragment,{children:[c,(0,Qa.jsx)("div",{...n,children:u})]})}var Sge={attributes:{format:{type:"string"},isLink:{type:"boolean",default:!1}},supports:{html:!1,color:{gradients:!0,link:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalLetterSpacing:!0}},save(){return null},migrate:Ot,isEligible({style:e}){return e?.typography?.fontFamily}},qO=[Sge];var{name:ZO}=Dk,KO={icon:e1,edit:$O,deprecated:qO,example:{}},Tge=()=>E({name:ZO,metadata:Dk,settings:KO});var HI={};Z(HI,{init:()=>Ige,metadata:()=>Mk,name:()=>XO,settings:()=>JO});var Mk={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/comment-edit-link",title:"Comment Edit Link",category:"theme",ancestor:["core/comment-template"],description:"Displays a link to edit the comment in the WordPress Dashboard. This link is only visible to users with the edit comment capability.",textdomain:"default",usesContext:["commentId"],attributes:{linkTarget:{type:"string",default:"_self"}},supports:{anchor:!0,html:!1,color:{link:!0,gradients:!0,text:!1,__experimentalDefaultControls:{background:!0,link:!0}},spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},typography:{fontSize:!0,lineHeight:!0,textAlign:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0}},style:"wp-block-comment-edit-link"};var Ak=o(T(),1),qf=o(M(),1),U1=o(P(),1);var zl=o(v(),1);function QO(e){let{attributes:t,setAttributes:r}=e,{linkTarget:a}=t;Kr(e);let n=(0,Ak.useBlockProps)(),i=q(),l=(0,zl.jsx)(Ak.InspectorControls,{children:(0,zl.jsx)(qf.__experimentalToolsPanel,{label:(0,U1.__)("Settings"),resetAll:()=>{r({linkTarget:"_self"})},dropdownMenuProps:i,children:(0,zl.jsx)(qf.__experimentalToolsPanelItem,{label:(0,U1.__)("Open in new tab"),isShownByDefault:!0,hasValue:()=>a==="_blank",onDeselect:()=>r({linkTarget:"_self"}),children:(0,zl.jsx)(qf.ToggleControl,{label:(0,U1.__)("Open in new tab"),onChange:s=>r({linkTarget:s?"_blank":"_self"}),checked:a==="_blank"})})})});return(0,zl.jsxs)(zl.Fragment,{children:[l,(0,zl.jsx)("div",{...n,children:(0,zl.jsx)("a",{href:"#edit-comment-pseudo-link",onClick:s=>s.preventDefault(),children:(0,U1.__)("Edit")})})]})}var Bge={attributes:{linkTarget:{type:"string",default:"_self"},textAlign:{type:"string"}},usesContext:["commentId"],supports:{anchor:!0,html:!1,color:{link:!0,gradients:!0,text:!1},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0}},save(){return null},migrate:We,isEligible(e){return!!e.textAlign||!!e.className?.match(/\bhas-text-align-(left|center|right)\b/)}},YO=[Bge];var{name:XO}=Mk,JO={icon:g9,edit:QO,deprecated:YO,example:{}},Ige=()=>E({name:XO,metadata:Mk,settings:JO});var OI={};Z(OI,{init:()=>Lge,metadata:()=>Rk,name:()=>aj,settings:()=>nj});var Rk={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/comment-reply-link",title:"Comment Reply Link",category:"theme",ancestor:["core/comment-template"],description:"Displays a link to reply to a comment.",textdomain:"default",usesContext:["commentId"],supports:{anchor:!0,color:{gradients:!0,link:!0,text:!1,__experimentalDefaultControls:{background:!0,link:!0}},spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},typography:{fontSize:!0,lineHeight:!0,textAlign:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0},html:!1},style:"wp-block-comment-reply-link"};var ej=o(P(),1),tj=o(T(),1);var Zf=o(v(),1);function Ege(e){Kr(e);let t=(0,tj.useBlockProps)();return(0,Zf.jsx)(Zf.Fragment,{children:(0,Zf.jsx)("div",{...t,children:(0,Zf.jsx)("a",{href:"#comment-reply-pseudo-link",onClick:r=>r.preventDefault(),children:(0,ej._x)("Reply","verb")})})})}var rj=Ege;var Dge={attributes:{textAlign:{type:"string"}},usesContext:["commentId"],supports:{anchor:!0,color:{gradients:!0,link:!0,text:!1},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0},html:!1},save(){return null},migrate:We,isEligible(e){return!!e.textAlign||!!e.className?.match(/\bhas-text-align-(left|center|right)\b/)}},oj=[Dge];var{name:aj}=Rk,nj={edit:rj,icon:b9,deprecated:oj,example:{}},Lge=()=>E({name:aj,metadata:Rk,settings:nj});var UI={};Z(UI,{init:()=>Oge,metadata:()=>zk,name:()=>kj,settings:()=>wj});var zk={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/comment-template",title:"Comment Template",category:"design",parent:["core/comments"],description:"Contains the block elements used to display a comment, like the title, date, author, avatar and more.",textdomain:"default",usesContext:["postId"],supports:{anchor:!0,align:!0,html:!1,reusable:!1,spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}}},style:"wp-block-comment-template"};var Vk=o(U(),1),jI=o(V(),1),fj=o(P(),1),Vl=o(T(),1),hj=o(M(),1),gj=o(Q(),1);var Gp=o(U(),1),sj=o(V(),1),cj=o(T(),1),uj=o(mr(),1),mj=o(G1(),1),lj=100,pj=({postId:e})=>{let t={status:"approve",order:"asc",context:"embed",parent:0,_embed:"children"},{pageComments:r,commentsPerPage:a,defaultCommentsPage:n}=(0,sj.useSelect)(s=>{let{getSettings:c}=s(cj.store),{__experimentalDiscussionSettings:u}=c();return u??{}},[]),i=r?Math.min(a,lj):lj,l=Age({defaultPage:n,postId:e,perPage:i,queryArgs:t});return(0,Gp.useMemo)(()=>l?{...t,post:e,per_page:i,page:l}:null,[e,i,l])},Age=({defaultPage:e,postId:t,perPage:r,queryArgs:a})=>{let[n,i]=(0,Gp.useState)({}),l=`${t}_${r}`,s=n[l]||0;return(0,Gp.useEffect)(()=>{s||e!=="newest"||(0,mj.default)({path:(0,uj.addQueryArgs)("/wp/v2/comments",{...a,post:t,per_page:r,_fields:"id"}),method:"HEAD",parse:!1}).then(c=>{let u=parseInt(c.headers.get("X-WP-TotalPages"));i({...n,[l]:u<=1?1:u})}).catch(()=>{i({...n,[l]:1})})},[e,t,r,i]),e==="newest"?s:1},dj=e=>(0,Gp.useMemo)(()=>e?.map(({id:r,_embedded:a})=>{let[n]=a?.children||[[]];return{commentId:r,children:n.map(i=>({commentId:i.id}))}}),[e]);var di=o(v(),1),Rge=[["core/avatar"],["core/comment-author-name"],["core/comment-date"],["core/comment-content"],["core/comment-reply-link"],["core/comment-edit-link"]],zge=({perPage:e,pageComments:t,threadComments:r,threadCommentsDepth:a})=>{let n=r?Math.min(a,3):1,i=s=>{if(s<n){let c=s+1;return[{commentId:-(s+3),children:i(c)}]}return[]},l=[{commentId:-1,children:i(1)}];return(!t||e>=2)&&n<3&&l.push({commentId:-2,children:[]}),(!t||e>=3)&&n<2&&l.push({commentId:-3,children:[]}),l};function Vge({comment:e,activeCommentId:t,setActiveCommentId:r,firstCommentId:a,blocks:n}){let{children:i,...l}=(0,Vl.useInnerBlocksProps)({},{template:Rge});return(0,di.jsxs)("li",{...l,children:[e.commentId===(t||a)?i:null,(0,di.jsx)(Hge,{blocks:n,commentId:e.commentId,setActiveCommentId:r,isHidden:e.commentId===(t||a)}),e?.children?.length>0?(0,di.jsx)(vj,{comments:e.children,activeCommentId:t,setActiveCommentId:r,blocks:n,firstCommentId:a}):null]})}var Fge=({blocks:e,commentId:t,setActiveCommentId:r,isHidden:a})=>{let n=(0,Vl.__experimentalUseBlockPreview)({blocks:e}),i=()=>{r(t)};return(0,di.jsx)("div",{...n,tabIndex:0,role:"button",style:{display:a?"none":void 0},onClick:i,onKeyPress:i})},Hge=(0,Vk.memo)(Fge),vj=({comments:e,blockProps:t,activeCommentId:r,setActiveCommentId:a,blocks:n,firstCommentId:i})=>(0,di.jsx)("ol",{...t,children:e&&e.map(({commentId:l,...s},c)=>(0,di.jsx)(Vl.BlockContextProvider,{value:{commentId:l<0?null:l},children:(0,di.jsx)(Vge,{comment:{commentId:l,...s},activeCommentId:r,setActiveCommentId:a,blocks:n,firstCommentId:i})},s.commentId||c))});function bj({clientId:e,context:{postId:t}}){let r=(0,Vl.useBlockProps)(),[a,n]=(0,Vk.useState)(),{commentOrder:i,threadCommentsDepth:l,threadComments:s,commentsPerPage:c,pageComments:u}=(0,jI.useSelect)(h=>{let{getSettings:g}=h(Vl.store);return g().__experimentalDiscussionSettings??{}},[]),m=pj({postId:t}),{topLevelComments:p,blocks:d}=(0,jI.useSelect)(h=>{let{getEntityRecords:g}=h(gj.store),{getBlocks:b}=h(Vl.store);return{topLevelComments:m?g("root","comment",m):null,blocks:b(e)}},[e,m]),f=dj(i==="desc"&&p?[...p].reverse():p);return p?(t||(f=zge({perPage:c,pageComments:u,threadComments:s,threadCommentsDepth:l})),f.length?(0,di.jsx)(vj,{comments:f,blockProps:r,blocks:d,activeCommentId:a,setActiveCommentId:n,firstCommentId:f[0]?.commentId}):(0,di.jsx)("p",{...r,children:(0,fj.__)("No results found.")})):(0,di.jsx)("p",{...r,children:(0,di.jsx)(hj.Spinner,{})})}var yj=o(T(),1),_j=o(v(),1);function xj(){return(0,_j.jsx)(yj.InnerBlocks.Content,{})}var{name:kj}=zk,wj={icon:Cp,edit:bj,save:xj},Oge=()=>E({name:kj,metadata:zk,settings:wj});var WI={};Z(WI,{init:()=>Gge,metadata:()=>Fk,name:()=>Tj,settings:()=>Pj});var Sj=o(P(),1);var Fk={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/comments-pagination-previous",title:"Comments Previous Page",category:"theme",parent:["core/comments-pagination"],description:"Displays the previous comment's page link.",textdomain:"default",attributes:{label:{type:"string"}},usesContext:["postId","comments/paginationArrow"],supports:{anchor:!0,reusable:!1,html:!1,color:{gradients:!0,text:!1,__experimentalDefaultControls:{background:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}}};var GI=o(P(),1),Hk=o(T(),1),W1=o(v(),1),Uge={none:"",arrow:"\u2190",chevron:"\xAB"};function Cj({attributes:{label:e},setAttributes:t,context:{"comments/paginationArrow":r}}){let a=Uge[r];return(0,W1.jsxs)("a",{href:"#comments-pagination-previous-pseudo-link",onClick:n=>n.preventDefault(),...(0,Hk.useBlockProps)(),children:[a&&(0,W1.jsx)("span",{className:`wp-block-comments-pagination-previous-arrow is-arrow-${r}`,children:a}),(0,W1.jsx)(Hk.PlainText,{__experimentalVersion:2,tagName:"span","aria-label":(0,GI.__)("Older comments page link"),placeholder:(0,GI.__)("Older Comments"),value:e,onChange:n=>t({label:n})})]})}var{name:Tj}=Fk,Pj={icon:a1,edit:Cj,example:{attributes:{label:(0,Sj.__)("Older Comments")}}},Gge=()=>E({name:Tj,metadata:Fk,settings:Pj});var qI={};Z(qI,{init:()=>qge,metadata:()=>Ok,name:()=>Lj,settings:()=>Mj});var Ok={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/comments-pagination",title:"Comments Pagination",category:"theme",parent:["core/comments"],allowedBlocks:["core/comments-pagination-previous","core/comments-pagination-numbers","core/comments-pagination-next"],description:"Displays a paginated navigation to next/previous set of comments, when applicable.",textdomain:"default",attributes:{paginationArrow:{type:"string",default:"none"}},example:{attributes:{paginationArrow:"none"}},providesContext:{"comments/paginationArrow":"paginationArrow"},supports:{anchor:!0,align:!0,reusable:!1,html:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},layout:{allowSwitching:!1,allowInheriting:!1,default:{type:"flex"}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}},editorStyle:"wp-block-comments-pagination-editor",style:"wp-block-comments-pagination"};var jk=o(P(),1),Hl=o(T(),1),$I=o(V(),1),Uk=o(M(),1);var Wp=o(P(),1),Kf=o(M(),1),Qf=o(v(),1);function Bj({value:e,onChange:t}){return(0,Qf.jsxs)(Kf.__experimentalToggleGroupControl,{__next40pxDefaultSize:!0,label:(0,Wp.__)("Arrow"),value:e,onChange:t,help:(0,Wp.__)("A decorative arrow appended to the next and previous comments link."),isBlock:!0,children:[(0,Qf.jsx)(Kf.__experimentalToggleGroupControlOption,{value:"none",label:(0,Wp._x)("None","Arrow option for Comments Pagination Next/Previous blocks")}),(0,Qf.jsx)(Kf.__experimentalToggleGroupControlOption,{value:"arrow",label:(0,Wp._x)("Arrow","Arrow option for Comments Pagination Next/Previous blocks")}),(0,Qf.jsx)(Kf.__experimentalToggleGroupControlOption,{value:"chevron",label:(0,Wp._x)("Chevron","Arrow option for Comments Pagination Next/Previous blocks")})]})}var Fl=o(v(),1),$ge=[["core/comments-pagination-previous"],["core/comments-pagination-numbers"],["core/comments-pagination-next"]];function Ij({attributes:{paginationArrow:e},setAttributes:t,clientId:r}){let a=(0,$I.useSelect)(c=>{let{getBlocks:u}=c(Hl.store);return u(r)?.find(p=>["core/comments-pagination-previous","core/comments-pagination-next"].includes(p.name))},[]),n=(0,Hl.useBlockProps)(),i=q(),l=(0,Hl.useInnerBlocksProps)(n,{template:$ge});return(0,$I.useSelect)(c=>{let{getSettings:u}=c(Hl.store),{__experimentalDiscussionSettings:m}=u();return m?.pageComments},[])?(0,Fl.jsxs)(Fl.Fragment,{children:[a&&(0,Fl.jsx)(Hl.InspectorControls,{children:(0,Fl.jsx)(Uk.__experimentalToolsPanel,{label:(0,jk.__)("Settings"),dropdownMenuProps:i,resetAll:()=>t({paginationArrow:"none"}),children:(0,Fl.jsx)(Uk.__experimentalToolsPanelItem,{label:(0,jk.__)("Arrow"),hasValue:()=>e!=="none",onDeselect:()=>t({paginationArrow:"none"}),isShownByDefault:!0,children:(0,Fl.jsx)(Bj,{value:e,onChange:c=>{t({paginationArrow:c})}})})})}),(0,Fl.jsx)("div",{...l})]}):(0,Fl.jsx)(Hl.Warning,{children:(0,jk.__)("Comments Pagination block: paging comments is disabled in the Discussion Settings")})}var Nj=o(T(),1),Ej=o(v(),1);function Dj(){return(0,Ej.jsx)(Nj.InnerBlocks.Content,{})}var{name:Lj}=Ok,Mj={icon:n1,edit:Ij,save:Dj},qge=()=>E({name:Lj,metadata:Ok,settings:Mj});var KI={};Z(KI,{init:()=>Qge,metadata:()=>Gk,name:()=>zj,settings:()=>Vj});var Rj=o(P(),1);var Gk={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/comments-pagination-next",title:"Comments Next Page",category:"theme",parent:["core/comments-pagination"],description:"Displays the next comment's page link.",textdomain:"default",attributes:{label:{type:"string"}},usesContext:["postId","comments/paginationArrow"],supports:{anchor:!0,reusable:!1,html:!1,color:{gradients:!0,text:!1,__experimentalDefaultControls:{background:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}}};var ZI=o(P(),1),Wk=o(T(),1),$1=o(v(),1),Kge={none:"",arrow:"\u2192",chevron:"\xBB"};function Aj({attributes:{label:e},setAttributes:t,context:{"comments/paginationArrow":r}}){let a=Kge[r];return(0,$1.jsxs)("a",{href:"#comments-pagination-next-pseudo-link",onClick:n=>n.preventDefault(),...(0,Wk.useBlockProps)(),children:[(0,$1.jsx)(Wk.PlainText,{__experimentalVersion:2,tagName:"span","aria-label":(0,ZI.__)("Newer comments page link"),placeholder:(0,ZI.__)("Newer Comments"),value:e,onChange:n=>t({label:n})}),a&&(0,$1.jsx)("span",{className:`wp-block-comments-pagination-next-arrow is-arrow-${r}`,children:a})]})}var{name:zj}=Gk,Vj={icon:r1,edit:Aj,example:{attributes:{label:(0,Rj.__)("Newer Comments")}}},Qge=()=>E({name:zj,metadata:Gk,settings:Vj});var QI={};Z(QI,{init:()=>Xge,metadata:()=>$k,name:()=>Oj,settings:()=>jj});var $k={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/comments-pagination-numbers",title:"Comments Page Numbers",category:"theme",parent:["core/comments-pagination"],description:"Displays a list of page numbers for comments pagination.",textdomain:"default",usesContext:["postId"],supports:{anchor:!0,reusable:!1,html:!1,color:{gradients:!0,text:!1,__experimentalDefaultControls:{background:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{padding:!0}}}};var Fj=o(T(),1),ol=o(v(),1),$p=({content:e,tag:t="a",extraClass:r=""})=>t==="a"?(0,ol.jsx)(t,{className:`page-numbers ${r}`,href:"#comments-pagination-numbers-pseudo-link",onClick:a=>a.preventDefault(),children:e}):(0,ol.jsx)(t,{className:`page-numbers ${r}`,children:e});function Hj(){return(0,ol.jsxs)("div",{...(0,Fj.useBlockProps)(),children:[(0,ol.jsx)($p,{content:"1"}),(0,ol.jsx)($p,{content:"2"}),(0,ol.jsx)($p,{content:"3",tag:"span",extraClass:"current"}),(0,ol.jsx)($p,{content:"4"}),(0,ol.jsx)($p,{content:"5"}),(0,ol.jsx)($p,{content:"...",tag:"span",extraClass:"dots"}),(0,ol.jsx)($p,{content:"8"})]})}var{name:Oj}=$k,jj={icon:o1,edit:Hj,example:{}},Xge=()=>E({name:Oj,metadata:$k,settings:jj});var YI={};Z(YI,{init:()=>r0e,metadata:()=>qk,name:()=>Kj,settings:()=>Qj});var qk={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/comments-title",title:"Comments Title",category:"theme",ancestor:["core/comments"],description:"Displays a title with the number of comments.",textdomain:"default",usesContext:["postId","postType"],attributes:{showPostTitle:{type:"boolean",default:!0},showCommentsCount:{type:"boolean",default:!0},level:{type:"number",default:2},levelOptions:{type:"array"}},supports:{anchor:!0,align:!0,html:!1,__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0},color:{gradients:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,textAlign:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0,__experimentalFontFamily:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0}},interactivity:{clientNavigation:!0}}};var Rs=o(T(),1),Br=o(P(),1),Uj=o(Q(),1),lm=o(M(),1),Zk=o(U(),1),Gj=o(V(),1),Wj=o(G1(),1),$j=o(mr(),1);var In=o(v(),1);function qj(e){Kr(e);let{attributes:t,setAttributes:r,context:a}=e,{showPostTitle:n,showCommentsCount:i,level:l=2,levelOptions:s}=t,{postId:c,postType:u}=a,m="h"+l,[p,d]=(0,Zk.useState)(),[f]=(0,Uj.useEntityProp)("postType",u,"title",c),h=typeof c>"u",g=(0,Rs.useBlockProps)(),{threadCommentsDepth:b,threadComments:y,commentsPerPage:k,pageComments:_}=(0,Gj.useSelect)(D=>{let{getSettings:A}=D(Rs.store);return A().__experimentalDiscussionSettings??{}},[]),x=q();(0,Zk.useEffect)(()=>{if(h){let A=y?Math.min(b,3)-1:0,H=_?k:3,F=parseInt(A)+parseInt(H);d(Math.min(F,3));return}let D=c;(0,Wj.default)({path:(0,$j.addQueryArgs)("/wp/v2/comments",{post:c,_fields:"id"}),method:"HEAD",parse:!1}).then(A=>{D===c&&d(parseInt(A.headers.get("X-WP-Total")))}).catch(()=>{d(0)})},[c]);let S=(0,In.jsx)(Rs.BlockControls,{group:"block",children:(0,In.jsx)(Rs.HeadingLevelDropdown,{value:l,options:s,onChange:D=>r({level:D})})}),C=(0,In.jsx)(Rs.InspectorControls,{children:(0,In.jsxs)(lm.__experimentalToolsPanel,{label:(0,Br.__)("Settings"),resetAll:()=>{r({showPostTitle:!0,showCommentsCount:!0})},dropdownMenuProps:x,children:[(0,In.jsx)(lm.__experimentalToolsPanelItem,{label:(0,Br.__)("Show post title"),isShownByDefault:!0,hasValue:()=>!n,onDeselect:()=>r({showPostTitle:!0}),children:(0,In.jsx)(lm.ToggleControl,{label:(0,Br.__)("Show post title"),checked:n,onChange:D=>r({showPostTitle:D})})}),(0,In.jsx)(lm.__experimentalToolsPanelItem,{label:(0,Br.__)("Show comments count"),isShownByDefault:!0,hasValue:()=>!i,onDeselect:()=>r({showCommentsCount:!0}),children:(0,In.jsx)(lm.ToggleControl,{label:(0,Br.__)("Show comments count"),checked:i,onChange:D=>r({showCommentsCount:D})})})]})}),N=h?(0,Br.__)("Post Title"):f,B;return i&&p!==void 0?n?p===1?B=(0,Br.sprintf)((0,Br.__)('One response to "%s"'),N):B=(0,Br.sprintf)((0,Br._n)('%1$s response to "%2$s"','%1$s responses to "%2$s"',p),p,N):p===1?B=(0,Br.__)("One response"):B=(0,Br.sprintf)((0,Br._n)("%s response","%s responses",p),p):n?p===1?B=(0,Br.sprintf)((0,Br.__)('Response to "%s"'),N):B=(0,Br.sprintf)((0,Br.__)('Responses to "%s"'),N):p===1?B=(0,Br.__)("Response"):B=(0,Br.__)("Responses"),(0,In.jsxs)(In.Fragment,{children:[S,C,(0,In.jsx)(m,{...g,children:B})]})}var e0e={attributes:{textAlign:{type:"string"},showPostTitle:{type:"boolean",default:!0},showCommentsCount:{type:"boolean",default:!0},level:{type:"number",default:2},levelOptions:{type:"array"}},supports:{anchor:!0,align:!0,html:!1,__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0},color:{gradients:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0,__experimentalFontFamily:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0}},interactivity:{clientNavigation:!0}},migrate:e=>{let{singleCommentLabel:t,multipleCommentsLabel:r,...a}=e;return We(a)},isEligible(e){return!!e.textAlign||!!e.className?.match(/\bhas-text-align-(left|center|right)\b/)},save:()=>null},t0e={attributes:{textAlign:{type:"string"},showPostTitle:{type:"boolean",default:!0},showCommentsCount:{type:"boolean",default:!0},level:{type:"number",default:2},levelOptions:{type:"array"},singleCommentLabel:{type:"string"},multipleCommentsLabel:{type:"string"}},supports:{anchor:!0,align:!0,html:!1,__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0},color:{gradients:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0,__experimentalFontFamily:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0}},interactivity:{clientNavigation:!0}},migrate:e=>{let{singleCommentLabel:t,multipleCommentsLabel:r,...a}=e;return We(a)},isEligible:({multipleCommentsLabel:e,singleCommentLabel:t})=>e||t,save:()=>null},Zj=[e0e,t0e];var{name:Kj}=qk,Qj={icon:El,edit:qj,deprecated:Zj,example:{}},r0e=()=>E({name:Kj,metadata:qk,settings:Qj});var hN={};Z(hN,{init:()=>h1e,metadata:()=>u5,name:()=>KU,settings:()=>p5});var fN=o(P(),1);var ZU=o(W(),1);var Yk=o(W(),1),_e=o(T(),1),Xk=o(P(),1),q1=o(me(),1);var Kk=o(Rr(),1),o0e={"top left":"is-position-top-left","top center":"is-position-top-center","top right":"is-position-top-right","center left":"is-position-center-left","center center":"is-position-center-center",center:"is-position-center-center","center right":"is-position-center-right","bottom left":"is-position-bottom-left","bottom center":"is-position-bottom-center","bottom right":"is-position-bottom-right"},Qt="image",Cr="video",Kc="embed-video",Yj=50;var a0e={x:.5,y:.5},Qk=["image","video"];function Qo({x:e,y:t}=a0e){return`${Math.round(e*100)}% ${Math.round(t*100)}%`}function al(e){return e===50||e===void 0?null:"has-background-dim-"+10*Math.round(e/10)}function Xj(e){if(!e||!e.url&&!e.src)return{url:void 0,id:void 0};(0,Kk.isBlobURL)(e.url)&&(e.type=(0,Kk.getBlobTypeByURL)(e.url));let t;if(e.media_type)e.media_type===Qt?t=Qt:t=Cr;else if(e.type&&(e.type===Qt||e.type===Cr))t=e.type;else return;return{url:e.url||e.src,id:e.id,alt:e?.alt,backgroundType:t,...t===Cr?{hasParallax:void 0}:{}}}function Ya(e){return!e||e==="center center"||e==="center"}function Nn(e){return Ya(e)?"":o0e[e]}var se=o(v(),1);function zs(e){return e?{backgroundImage:`url(${e})`}:{}}function qp(e){return e===0||e===50||!e?null:"has-background-dim-"+10*Math.round(e/10)}function Jk(e){return{...e,dimRatio:e.url?e.dimRatio:100}}function sm(e){return e.tagName||(e={...e,tagName:"div"}),{...e}}var Zp={url:{type:"string"},id:{type:"number"},hasParallax:{type:"boolean",default:!1},dimRatio:{type:"number",default:50},overlayColor:{type:"string"},customOverlayColor:{type:"string"},backgroundType:{type:"string",default:"image"},focalPoint:{type:"object"}},Z1={url:{type:"string"},id:{type:"number"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""},hasParallax:{type:"boolean",default:!1},isRepeated:{type:"boolean",default:!1},dimRatio:{type:"number",default:100},overlayColor:{type:"string"},customOverlayColor:{type:"string"},backgroundType:{type:"string",default:"image"},focalPoint:{type:"object"},minHeight:{type:"number"},minHeightUnit:{type:"string"},gradient:{type:"string"},customGradient:{type:"string"},contentPosition:{type:"string"},isDark:{type:"boolean",default:!0},allowedBlocks:{type:"array"},templateLock:{type:["string","boolean"],enum:["all","insert",!1]}},XI={...Z1,useFeaturedImage:{type:"boolean",default:!1},tagName:{type:"string",default:"div"}},n0e={...XI,isUserOverlayColor:{type:"boolean"},sizeSlug:{type:"string"},alt:{type:"string",default:""}},Yf={anchor:!0,align:!0,html:!1,spacing:{padding:!0,__experimentalDefaultControls:{padding:!0}},color:{__experimentalDuotone:"> .wp-block-cover__image-background, > .wp-block-cover__video-background",text:!1,background:!1}},JI={...Yf,spacing:{padding:!0,margin:["top","bottom"],blockGap:!0,__experimentalDefaultControls:{padding:!0,blockGap:!0}},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,radius:!0,style:!0,width:!0}},color:{__experimentalDuotone:"> .wp-block-cover__image-background, > .wp-block-cover__video-background",heading:!0,text:!0,background:!1,__experimentalSkipSerialization:["gradients"],enableContrastChecker:!1},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},layout:{allowJustification:!1}},i0e={...JI,shadow:!0,dimensions:{aspectRatio:!0},interactivity:{clientNavigation:!0}},l0e={attributes:n0e,supports:i0e,save({attributes:e}){let{backgroundType:t,gradient:r,contentPosition:a,customGradient:n,customOverlayColor:i,dimRatio:l,focalPoint:s,useFeaturedImage:c,hasParallax:u,isDark:m,isRepeated:p,overlayColor:d,url:f,alt:h,id:g,minHeight:b,minHeightUnit:y,tagName:k,sizeSlug:_}=e,x=(0,_e.getColorClassName)("background-color",d),S=(0,_e.__experimentalGetGradientClass)(r),C=b&&y?`${b}${y}`:b,N=Qt===t,B=Cr===t,D=!(u||p),A={minHeight:C||void 0},H={backgroundColor:x?void 0:i,background:n||void 0},F=s&&D?Qo(s):void 0,z=f?`url(${f})`:void 0,I=Qo(s),R=w({"is-light":!m,"has-parallax":u,"is-repeated":p,"has-custom-content-position":!Ya(a)},Nn(a)),$=w("wp-block-cover__image-background",g?`wp-image-${g}`:null,{[`size-${_}`]:_,"has-parallax":u,"is-repeated":p}),j=r||n;return(0,se.jsxs)(k,{..._e.useBlockProps.save({className:R,style:A}),children:[(0,se.jsx)("span",{"aria-hidden":"true",className:w("wp-block-cover__background",x,al(l),{"has-background-dim":l!==void 0,"wp-block-cover__gradient-background":f&&j&&l!==0,"has-background-gradient":j,[S]:S}),style:H}),!c&&N&&f&&(D?(0,se.jsx)("img",{className:$,alt:h,src:f,style:{objectPosition:F},"data-object-fit":"cover","data-object-position":F}):(0,se.jsx)("div",{role:h?"img":void 0,"aria-label":h||void 0,className:$,style:{backgroundPosition:I,backgroundImage:z}})),B&&f&&(0,se.jsx)("video",{className:w("wp-block-cover__video-background","intrinsic-ignore"),autoPlay:!0,muted:!0,loop:!0,playsInline:!0,src:f,style:{objectPosition:F},"data-object-fit":"cover","data-object-position":F}),(0,se.jsx)("div",{..._e.useInnerBlocksProps.save({className:"wp-block-cover__inner-container"})})]})}},s0e={attributes:XI,supports:JI,save({attributes:e}){let{backgroundType:t,gradient:r,contentPosition:a,customGradient:n,customOverlayColor:i,dimRatio:l,focalPoint:s,useFeaturedImage:c,hasParallax:u,isDark:m,isRepeated:p,overlayColor:d,url:f,alt:h,id:g,minHeight:b,minHeightUnit:y,tagName:k}=e,_=(0,_e.getColorClassName)("background-color",d),x=(0,_e.__experimentalGetGradientClass)(r),S=b&&y?`${b}${y}`:b,C=Qt===t,N=Cr===t,B=!(u||p),D={minHeight:S||void 0},A={backgroundColor:_?void 0:i,background:n||void 0},H=s&&B?Qo(s):void 0,F=f?`url(${f})`:void 0,z=Qo(s),I=w({"is-light":!m,"has-parallax":u,"is-repeated":p,"has-custom-content-position":!Ya(a)},Nn(a)),R=w("wp-block-cover__image-background",g?`wp-image-${g}`:null,{"has-parallax":u,"is-repeated":p}),$=r||n;return(0,se.jsxs)(k,{..._e.useBlockProps.save({className:I,style:D}),children:[(0,se.jsx)("span",{"aria-hidden":"true",className:w("wp-block-cover__background",_,al(l),{"has-background-dim":l!==void 0,"wp-block-cover__gradient-background":f&&$&&l!==0,"has-background-gradient":$,[x]:x}),style:A}),!c&&C&&f&&(B?(0,se.jsx)("img",{className:R,alt:h,src:f,style:{objectPosition:H},"data-object-fit":"cover","data-object-position":H}):(0,se.jsx)("div",{role:"img",className:R,style:{backgroundPosition:z,backgroundImage:F}})),N&&f&&(0,se.jsx)("video",{className:w("wp-block-cover__video-background","intrinsic-ignore"),autoPlay:!0,muted:!0,loop:!0,playsInline:!0,src:f,style:{objectPosition:H},"data-object-fit":"cover","data-object-position":H}),(0,se.jsx)("div",{..._e.useInnerBlocksProps.save({className:"wp-block-cover__inner-container"})})]})}},c0e={attributes:XI,supports:JI,isEligible(e){return(e.customOverlayColor!==void 0||e.overlayColor!==void 0)&&e.isUserOverlayColor===void 0},migrate(e){return{...e,isUserOverlayColor:!0}},save({attributes:e}){let{backgroundType:t,gradient:r,contentPosition:a,customGradient:n,customOverlayColor:i,dimRatio:l,focalPoint:s,useFeaturedImage:c,hasParallax:u,isDark:m,isRepeated:p,overlayColor:d,url:f,alt:h,id:g,minHeight:b,minHeightUnit:y,tagName:k}=e,_=(0,_e.getColorClassName)("background-color",d),x=(0,_e.__experimentalGetGradientClass)(r),S=b&&y?`${b}${y}`:b,C=Qt===t,N=Cr===t,B=!(u||p),D={minHeight:S||void 0},A={backgroundColor:_?void 0:i,background:n||void 0},H=s&&B?Qo(s):void 0,F=f?`url(${f})`:void 0,z=Qo(s),I=w({"is-light":!m,"has-parallax":u,"is-repeated":p,"has-custom-content-position":!Ya(a)},Nn(a)),R=w("wp-block-cover__image-background",g?`wp-image-${g}`:null,{"has-parallax":u,"is-repeated":p}),$=r||n;return(0,se.jsxs)(k,{..._e.useBlockProps.save({className:I,style:D}),children:[(0,se.jsx)("span",{"aria-hidden":"true",className:w("wp-block-cover__background",_,al(l),{"has-background-dim":l!==void 0,"wp-block-cover__gradient-background":f&&$&&l!==0,"has-background-gradient":$,[x]:x}),style:A}),!c&&C&&f&&(B?(0,se.jsx)("img",{className:R,alt:h,src:f,style:{objectPosition:H},"data-object-fit":"cover","data-object-position":H}):(0,se.jsx)("div",{role:"img",className:R,style:{backgroundPosition:z,backgroundImage:F}})),N&&f&&(0,se.jsx)("video",{className:w("wp-block-cover__video-background","intrinsic-ignore"),autoPlay:!0,muted:!0,loop:!0,playsInline:!0,src:f,style:{objectPosition:H},"data-object-fit":"cover","data-object-position":H}),(0,se.jsx)("div",{..._e.useInnerBlocksProps.save({className:"wp-block-cover__inner-container"})})]})}},u0e={attributes:Z1,supports:Yf,save({attributes:e}){let{backgroundType:t,gradient:r,contentPosition:a,customGradient:n,customOverlayColor:i,dimRatio:l,focalPoint:s,useFeaturedImage:c,hasParallax:u,isDark:m,isRepeated:p,overlayColor:d,url:f,alt:h,id:g,minHeight:b,minHeightUnit:y}=e,k=(0,_e.getColorClassName)("background-color",d),_=(0,_e.__experimentalGetGradientClass)(r),x=b&&y?`${b}${y}`:b,S=Qt===t,C=Cr===t,N=!(u||p),B={minHeight:x||void 0},D={backgroundColor:k?void 0:i,background:n||void 0},A=s&&N?Qo(s):void 0,H=f?`url(${f})`:void 0,F=Qo(s),z=w({"is-light":!m,"has-parallax":u,"is-repeated":p,"has-custom-content-position":!Ya(a)},Nn(a)),I=w("wp-block-cover__image-background",g?`wp-image-${g}`:null,{"has-parallax":u,"is-repeated":p}),R=r||n;return(0,se.jsxs)("div",{..._e.useBlockProps.save({className:z,style:B}),children:[(0,se.jsx)("span",{"aria-hidden":"true",className:w("wp-block-cover__background",k,al(l),{"has-background-dim":l!==void 0,"wp-block-cover__gradient-background":f&&R&&l!==0,"has-background-gradient":R,[_]:_}),style:D}),!c&&S&&f&&(N?(0,se.jsx)("img",{className:I,alt:h,src:f,style:{objectPosition:A},"data-object-fit":"cover","data-object-position":A}):(0,se.jsx)("div",{role:"img",className:I,style:{backgroundPosition:F,backgroundImage:H}})),C&&f&&(0,se.jsx)("video",{className:w("wp-block-cover__video-background","intrinsic-ignore"),autoPlay:!0,muted:!0,loop:!0,playsInline:!0,src:f,style:{objectPosition:A},"data-object-fit":"cover","data-object-position":A}),(0,se.jsx)("div",{..._e.useInnerBlocksProps.save({className:"wp-block-cover__inner-container"})})]})},migrate:sm},m0e={attributes:Z1,supports:Yf,save({attributes:e}){let{backgroundType:t,gradient:r,contentPosition:a,customGradient:n,customOverlayColor:i,dimRatio:l,focalPoint:s,useFeaturedImage:c,hasParallax:u,isDark:m,isRepeated:p,overlayColor:d,url:f,alt:h,id:g,minHeight:b,minHeightUnit:y}=e,k=(0,_e.getColorClassName)("background-color",d),_=(0,_e.__experimentalGetGradientClass)(r),x=b&&y?`${b}${y}`:b,S=Qt===t,C=Cr===t,N=!(u||p),B={...S&&!N&&!c?zs(f):{},minHeight:x||void 0},D={backgroundColor:k?void 0:i,background:n||void 0},A=s&&N?`${Math.round(s.x*100)}% ${Math.round(s.y*100)}%`:void 0,H=w({"is-light":!m,"has-parallax":u,"is-repeated":p,"has-custom-content-position":!Ya(a)},Nn(a)),F=r||n;return(0,se.jsxs)("div",{..._e.useBlockProps.save({className:H,style:B}),children:[(0,se.jsx)("span",{"aria-hidden":"true",className:w("wp-block-cover__background",k,al(l),{"has-background-dim":l!==void 0,"wp-block-cover__gradient-background":f&&F&&l!==0,"has-background-gradient":F,[_]:_}),style:D}),!c&&S&&N&&f&&(0,se.jsx)("img",{className:w("wp-block-cover__image-background",g?`wp-image-${g}`:null),alt:h,src:f,style:{objectPosition:A},"data-object-fit":"cover","data-object-position":A}),C&&f&&(0,se.jsx)("video",{className:w("wp-block-cover__video-background","intrinsic-ignore"),autoPlay:!0,muted:!0,loop:!0,playsInline:!0,src:f,style:{objectPosition:A},"data-object-fit":"cover","data-object-position":A}),(0,se.jsx)("div",{..._e.useInnerBlocksProps.save({className:"wp-block-cover__inner-container"})})]})},migrate:sm},p0e={attributes:Z1,supports:Yf,save({attributes:e}){let{backgroundType:t,gradient:r,contentPosition:a,customGradient:n,customOverlayColor:i,dimRatio:l,focalPoint:s,hasParallax:c,isDark:u,isRepeated:m,overlayColor:p,url:d,alt:f,id:h,minHeight:g,minHeightUnit:b}=e,y=(0,_e.getColorClassName)("background-color",p),k=(0,_e.__experimentalGetGradientClass)(r),_=b?`${g}${b}`:g,x=Qt===t,S=Cr===t,C=!(c||m),N={...x&&!C?zs(d):{},minHeight:_||void 0},B={backgroundColor:y?void 0:i,background:n||void 0},D=s&&C?`${Math.round(s.x*100)}% ${Math.round(s.y*100)}%`:void 0,A=w({"is-light":!u,"has-parallax":c,"is-repeated":m,"has-custom-content-position":!Ya(a)},Nn(a)),H=r||n;return(0,se.jsxs)("div",{..._e.useBlockProps.save({className:A,style:N}),children:[(0,se.jsx)("span",{"aria-hidden":"true",className:w("wp-block-cover__background",y,al(l),{"has-background-dim":l!==void 0,"wp-block-cover__gradient-background":d&&H&&l!==0,"has-background-gradient":H,[k]:k}),style:B}),x&&C&&d&&(0,se.jsx)("img",{className:w("wp-block-cover__image-background",h?`wp-image-${h}`:null),alt:f,src:d,style:{objectPosition:D},"data-object-fit":"cover","data-object-position":D}),S&&d&&(0,se.jsx)("video",{className:w("wp-block-cover__video-background","intrinsic-ignore"),autoPlay:!0,muted:!0,loop:!0,playsInline:!0,src:d,style:{objectPosition:D},"data-object-fit":"cover","data-object-position":D}),(0,se.jsx)("div",{..._e.useInnerBlocksProps.save({className:"wp-block-cover__inner-container"})})]})},migrate:sm},d0e={attributes:Z1,supports:Yf,save({attributes:e}){let{backgroundType:t,gradient:r,contentPosition:a,customGradient:n,customOverlayColor:i,dimRatio:l,focalPoint:s,hasParallax:c,isDark:u,isRepeated:m,overlayColor:p,url:d,alt:f,id:h,minHeight:g,minHeightUnit:b}=e,y=(0,_e.getColorClassName)("background-color",p),k=(0,_e.__experimentalGetGradientClass)(r),_=b?`${g}${b}`:g,x=Qt===t,S=Cr===t,C=!(c||m),N={...x&&!C?zs(d):{},minHeight:_||void 0},B={backgroundColor:y?void 0:i,background:n||void 0},D=s&&C?`${Math.round(s.x*100)}% ${Math.round(s.y*100)}%`:void 0,A=w({"is-light":!u,"has-parallax":c,"is-repeated":m,"has-custom-content-position":!Ya(a)},Nn(a));return(0,se.jsxs)("div",{..._e.useBlockProps.save({className:A,style:N}),children:[(0,se.jsx)("span",{"aria-hidden":"true",className:w(y,al(l),"wp-block-cover__gradient-background",k,{"has-background-dim":l!==void 0,"has-background-gradient":r||n,[k]:!d&&k}),style:B}),x&&C&&d&&(0,se.jsx)("img",{className:w("wp-block-cover__image-background",h?`wp-image-${h}`:null),alt:f,src:d,style:{objectPosition:D},"data-object-fit":"cover","data-object-position":D}),S&&d&&(0,se.jsx)("video",{className:w("wp-block-cover__video-background","intrinsic-ignore"),autoPlay:!0,muted:!0,loop:!0,playsInline:!0,src:d,style:{objectPosition:D},"data-object-fit":"cover","data-object-position":D}),(0,se.jsx)("div",{..._e.useInnerBlocksProps.save({className:"wp-block-cover__inner-container"})})]})},migrate:sm},f0e={attributes:{...Zp,isRepeated:{type:"boolean",default:!1},minHeight:{type:"number"},minHeightUnit:{type:"string"},gradient:{type:"string"},customGradient:{type:"string"},contentPosition:{type:"string"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""}},supports:Yf,save({attributes:e}){let{backgroundType:t,gradient:r,contentPosition:a,customGradient:n,customOverlayColor:i,dimRatio:l,focalPoint:s,hasParallax:c,isRepeated:u,overlayColor:m,url:p,alt:d,id:f,minHeight:h,minHeightUnit:g}=e,b=(0,_e.getColorClassName)("background-color",m),y=(0,_e.__experimentalGetGradientClass)(r),k=g?`${h}${g}`:h,_=Qt===t,x=Cr===t,S=!(c||u),C={..._&&!S?zs(p):{},backgroundColor:b?void 0:i,background:n&&!p?n:void 0,minHeight:k||void 0},N=s&&S?`${Math.round(s.x*100)}% ${Math.round(s.y*100)}%`:void 0,B=w(qp(l),b,{"has-background-dim":l!==0,"has-parallax":c,"is-repeated":u,"has-background-gradient":r||n,[y]:!p&&y,"has-custom-content-position":!Ya(a)},Nn(a));return(0,se.jsxs)("div",{..._e.useBlockProps.save({className:B,style:C}),children:[p&&(r||n)&&l!==0&&(0,se.jsx)("span",{"aria-hidden":"true",className:w("wp-block-cover__gradient-background",y),style:n?{background:n}:void 0}),_&&S&&p&&(0,se.jsx)("img",{className:w("wp-block-cover__image-background",f?`wp-image-${f}`:null),alt:d,src:p,style:{objectPosition:N},"data-object-fit":"cover","data-object-position":N}),x&&p&&(0,se.jsx)("video",{className:w("wp-block-cover__video-background","intrinsic-ignore"),autoPlay:!0,muted:!0,loop:!0,playsInline:!0,src:p,style:{objectPosition:N},"data-object-fit":"cover","data-object-position":N}),(0,se.jsx)("div",{className:"wp-block-cover__inner-container",children:(0,se.jsx)(_e.InnerBlocks.Content,{})})]})},migrate:(0,q1.compose)(Jk,sm)},h0e={attributes:{...Zp,isRepeated:{type:"boolean",default:!1},minHeight:{type:"number"},minHeightUnit:{type:"string"},gradient:{type:"string"},customGradient:{type:"string"},contentPosition:{type:"string"}},supports:{align:!0},save({attributes:e}){let{backgroundType:t,gradient:r,contentPosition:a,customGradient:n,customOverlayColor:i,dimRatio:l,focalPoint:s,hasParallax:c,isRepeated:u,overlayColor:m,url:p,minHeight:d,minHeightUnit:f}=e,h=(0,_e.getColorClassName)("background-color",m),g=(0,_e.__experimentalGetGradientClass)(r),b=f?`${d}${f}`:d,y=Qt===t,k=Cr===t,_=y?zs(p):{},x={};h||(_.backgroundColor=i),n&&!p&&(_.background=n),_.minHeight=b||void 0;let S;s&&(S=`${Math.round(s.x*100)}% ${Math.round(s.y*100)}%`,y&&!c&&(_.backgroundPosition=S),k&&(x.objectPosition=S));let C=w(qp(l),h,{"has-background-dim":l!==0,"has-parallax":c,"is-repeated":u,"has-background-gradient":r||n,[g]:!p&&g,"has-custom-content-position":!Ya(a)},Nn(a));return(0,se.jsxs)("div",{..._e.useBlockProps.save({className:C,style:_}),children:[p&&(r||n)&&l!==0&&(0,se.jsx)("span",{"aria-hidden":"true",className:w("wp-block-cover__gradient-background",g),style:n?{background:n}:void 0}),k&&p&&(0,se.jsx)("video",{className:"wp-block-cover__video-background",autoPlay:!0,muted:!0,loop:!0,playsInline:!0,src:p,style:x}),(0,se.jsx)("div",{className:"wp-block-cover__inner-container",children:(0,se.jsx)(_e.InnerBlocks.Content,{})})]})},migrate:(0,q1.compose)(Jk,sm)},g0e={attributes:{...Zp,minHeight:{type:"number"},gradient:{type:"string"},customGradient:{type:"string"}},supports:{align:!0},save({attributes:e}){let{backgroundType:t,gradient:r,customGradient:a,customOverlayColor:n,dimRatio:i,focalPoint:l,hasParallax:s,overlayColor:c,url:u,minHeight:m}=e,p=(0,_e.getColorClassName)("background-color",c),d=(0,_e.__experimentalGetGradientClass)(r),f=t===Qt?zs(u):{};p||(f.backgroundColor=n),l&&!s&&(f.backgroundPosition=`${Math.round(l.x*100)}% ${Math.round(l.y*100)}%`),a&&!u&&(f.background=a),f.minHeight=m||void 0;let h=w(qp(i),p,{"has-background-dim":i!==0,"has-parallax":s,"has-background-gradient":a,[d]:!u&&d});return(0,se.jsxs)("div",{className:h,style:f,children:[u&&(r||a)&&i!==0&&(0,se.jsx)("span",{"aria-hidden":"true",className:w("wp-block-cover__gradient-background",d),style:a?{background:a}:void 0}),Cr===t&&u&&(0,se.jsx)("video",{className:"wp-block-cover__video-background",autoPlay:!0,muted:!0,loop:!0,src:u}),(0,se.jsx)("div",{className:"wp-block-cover__inner-container",children:(0,se.jsx)(_e.InnerBlocks.Content,{})})]})},migrate:(0,q1.compose)(Jk,sm)},v0e={attributes:{...Zp,minHeight:{type:"number"},gradient:{type:"string"},customGradient:{type:"string"}},supports:{align:!0},save({attributes:e}){let{backgroundType:t,gradient:r,customGradient:a,customOverlayColor:n,dimRatio:i,focalPoint:l,hasParallax:s,overlayColor:c,url:u,minHeight:m}=e,p=(0,_e.getColorClassName)("background-color",c),d=(0,_e.__experimentalGetGradientClass)(r),f=t===Qt?zs(u):{};p||(f.backgroundColor=n),l&&!s&&(f.backgroundPosition=`${l.x*100}% ${l.y*100}%`),a&&!u&&(f.background=a),f.minHeight=m||void 0;let h=w(qp(i),p,{"has-background-dim":i!==0,"has-parallax":s,"has-background-gradient":a,[d]:!u&&d});return(0,se.jsxs)("div",{className:h,style:f,children:[u&&(r||a)&&i!==0&&(0,se.jsx)("span",{"aria-hidden":"true",className:w("wp-block-cover__gradient-background",d),style:a?{background:a}:void 0}),Cr===t&&u&&(0,se.jsx)("video",{className:"wp-block-cover__video-background",autoPlay:!0,muted:!0,loop:!0,src:u}),(0,se.jsx)("div",{className:"wp-block-cover__inner-container",children:(0,se.jsx)(_e.InnerBlocks.Content,{})})]})},migrate:(0,q1.compose)(Jk,sm)},b0e={attributes:{...Zp,title:{type:"string",source:"html",selector:"p"},contentAlign:{type:"string",default:"center"}},supports:{align:!0},save({attributes:e}){let{backgroundType:t,contentAlign:r,customOverlayColor:a,dimRatio:n,focalPoint:i,hasParallax:l,overlayColor:s,title:c,url:u}=e,m=(0,_e.getColorClassName)("background-color",s),p=t===Qt?zs(u):{};m||(p.backgroundColor=a),i&&!l&&(p.backgroundPosition=`${i.x*100}% ${i.y*100}%`);let d=w(qp(n),m,{"has-background-dim":n!==0,"has-parallax":l,[`has-${r}-content`]:r!=="center"});return(0,se.jsxs)("div",{className:d,style:p,children:[Cr===t&&u&&(0,se.jsx)("video",{className:"wp-block-cover__video-background",autoPlay:!0,muted:!0,loop:!0,src:u}),!_e.RichText.isEmpty(c)&&(0,se.jsx)(_e.RichText.Content,{tagName:"p",className:"wp-block-cover-text",value:c})]})},migrate(e){let t={...e,dimRatio:e.url?e.dimRatio:100,tagName:e.tagName?e.tagName:"div"},{title:r,contentAlign:a,...n}=t;return[n,[(0,Yk.createBlock)("core/paragraph",{content:e.title,style:{typography:{textAlign:e.contentAlign}},fontSize:"large",placeholder:(0,Xk.__)("Write title\u2026")})]]}},y0e={attributes:{...Zp,title:{type:"string",source:"html",selector:"p"},contentAlign:{type:"string",default:"center"},align:{type:"string"}},supports:{className:!1},save({attributes:e}){let{url:t,title:r,hasParallax:a,dimRatio:n,align:i,contentAlign:l,overlayColor:s,customOverlayColor:c}=e,u=(0,_e.getColorClassName)("background-color",s),m=zs(t);u||(m.backgroundColor=c);let p=w("wp-block-cover-image",qp(n),u,{"has-background-dim":n!==0,"has-parallax":a,[`has-${l}-content`]:l!=="center"},i?`align${i}`:null);return(0,se.jsx)("div",{className:p,style:m,children:!_e.RichText.isEmpty(r)&&(0,se.jsx)(_e.RichText.Content,{tagName:"p",className:"wp-block-cover-image-text",value:r})})},migrate(e){let t={...e,dimRatio:e.url?e.dimRatio:100,tagName:e.tagName?e.tagName:"div"},{title:r,contentAlign:a,align:n,...i}=t;return[i,[(0,Yk.createBlock)("core/paragraph",{content:e.title,style:{typography:{textAlign:e.contentAlign}},fontSize:"large",placeholder:(0,Xk.__)("Write title\u2026")})]]}},_0e={attributes:{...Zp,title:{type:"string",source:"html",selector:"h2"},align:{type:"string"},contentAlign:{type:"string",default:"center"}},supports:{className:!1},save({attributes:e}){let{url:t,title:r,hasParallax:a,dimRatio:n,align:i}=e,l=zs(t),s=w("wp-block-cover-image",qp(n),{"has-background-dim":n!==0,"has-parallax":a},i?`align${i}`:null);return(0,se.jsx)("section",{className:s,style:l,children:(0,se.jsx)(_e.RichText.Content,{tagName:"h2",value:r})})},migrate(e){let t={...e,dimRatio:e.url?e.dimRatio:100,tagName:e.tagName?e.tagName:"div"},{title:r,contentAlign:a,align:n,...i}=t;return[i,[(0,Yk.createBlock)("core/paragraph",{content:e.title,style:{typography:{textAlign:e.contentAlign}},fontSize:"large",placeholder:(0,Xk.__)("Write title\u2026")})]]}},Jj=[l0e,s0e,c0e,u0e,m0e,p0e,d0e,f0e,h0e,g0e,v0e,b0e,y0e,_0e];var J1=o(Q(),1),jl=o(U(),1),Yp=o(M(),1),c5=o(me(),1),Bo=o(T(),1),pN=o(P(),1),um=o(V(),1),OU=o(Rr(),1),jU=o(xr(),1);var nU=o(U(),1),jt=o(M(),1),iU=o(me(),1),Yo=o(T(),1),po=o(P(),1),eN=o(V(),1),lU=o(Q(),1);var Xf="full";var Jf=o(T(),1),tU=o(xr(),1),Xa=o(M(),1),rU=o(Rr(),1),fi=o(P(),1),e5=o(U(),1),oU=o(me(),1),t5=o(V(),1),wa=o(v(),1),eU=["image"];function aU({poster:e,onChange:t}){let r=(0,e5.useRef)(),[a,n]=(0,e5.useState)(!1),i=(0,oU.useInstanceId)(aU,"block-library-poster-image-description"),{getSettings:l}=(0,t5.useSelect)(Jf.store),{createErrorNotice:s}=(0,t5.useDispatch)(tU.store),c=m=>{l().mediaUpload({allowedTypes:eU,filesList:m,onFileChange:([p])=>{if((0,rU.isBlobURL)(p?.url)){n(!0);return}p&&t(p),n(!1)},onError:p=>{s(p,{id:"poster-image-upload-notice",type:"snackbar"}),n(!1)},multiple:!1})},u=()=>!e&&a?(0,wa.jsx)(Xa.Spinner,{}):e?(0,fi.__)("Replace"):(0,fi.__)("Set poster image");return(0,wa.jsx)(Jf.MediaUploadCheck,{children:(0,wa.jsxs)(Xa.__experimentalToolsPanelItem,{label:(0,fi.__)("Poster image"),isShownByDefault:!0,hasValue:()=>!!e,onDeselect:()=>t(void 0),children:[(0,wa.jsx)(Xa.BaseControl.VisualLabel,{children:(0,fi.__)("Poster image")}),(0,wa.jsx)(Jf.MediaUpload,{title:(0,fi.__)("Select poster image"),onSelect:t,allowedTypes:eU,render:({open:m})=>(0,wa.jsxs)("div",{className:"block-library-poster-image__container",children:[e&&(0,wa.jsxs)(Xa.Button,{__next40pxDefaultSize:!0,onClick:m,"aria-haspopup":"dialog","aria-label":(0,fi.__)("Edit or replace the poster image."),className:"block-library-poster-image__preview",disabled:a,accessibleWhenDisabled:!0,children:[(0,wa.jsx)("img",{src:e,alt:(0,fi.__)("Poster image preview"),className:"block-library-poster-image__preview-image"}),a&&(0,wa.jsx)(Xa.Spinner,{})]}),(0,wa.jsxs)(Xa.__experimentalHStack,{className:w("block-library-poster-image__actions",{"block-library-poster-image__actions-select":!e}),children:[(0,wa.jsx)(Xa.Button,{__next40pxDefaultSize:!0,onClick:m,ref:r,className:"block-library-poster-image__action","aria-describedby":i,"aria-haspopup":"dialog",variant:e?void 0:"secondary",disabled:a,accessibleWhenDisabled:!0,children:u()}),(0,wa.jsx)("p",{id:i,hidden:!0,children:e?(0,fi.sprintf)((0,fi.__)("The current poster image url is %s."),e):(0,fi.__)("There is no poster image currently selected.")}),!!e&&(0,wa.jsx)(Xa.Button,{__next40pxDefaultSize:!0,onClick:()=>{t(void 0),r.current.focus()},className:"block-library-poster-image__action",disabled:a,accessibleWhenDisabled:!0,children:(0,fi.__)("Remove")})]}),(0,wa.jsx)(Xa.DropZone,{onFilesDrop:c})]})})]})})}var r5=aU;var dt=o(v(),1),{cleanEmptyObject:x0e,ResolutionTool:k0e,HTMLElementControl:w0e}=K(Yo.privateApis);function C0e({onChange:e,onUnitChange:t,unit:r="px",value:a=""}){let i=`block-cover-height-input-${(0,iU.useInstanceId)(jt.__experimentalUnitControl)}`,l=r==="px",[s]=(0,Yo.useSettings)("spacing.units"),c=(0,jt.__experimentalUseCustomUnits)({availableUnits:s||["px","em","rem","vw","vh"],defaultValues:{px:430,"%":20,em:20,rem:20,vw:20,vh:50}}),u=d=>{let f=d!==""?parseFloat(d):void 0;isNaN(f)&&f!==void 0||e(f)},m=(0,nU.useMemo)(()=>{let[d]=(0,jt.__experimentalParseQuantityAndUnitFromRawValue)(a);return[d,r].join("")},[r,a]),p=l?Yj:0;return(0,dt.jsx)(jt.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:(0,po.__)("Minimum height"),id:i,isResetValueOnUnitChange:!0,min:p,onChange:u,onUnitChange:t,units:c,value:m})}function sU({attributes:e,setAttributes:t,clientId:r,setOverlayColor:a,coverRef:n,currentSettings:i,updateDimRatio:l,featuredImage:s}){let{useFeaturedImage:c,id:u,dimRatio:m,focalPoint:p,hasParallax:d,isRepeated:f,minHeight:h,minHeightUnit:g,alt:b,tagName:y,poster:k}=e,{isVideoBackground:_,isImageBackground:x,mediaElement:S,url:C,overlayColor:N}=i,B=e.sizeSlug||Xf,{gradientValue:D,setGradient:A}=(0,Yo.__experimentalUseGradient)(),{getSettings:H}=(0,eN.useSelect)(Yo.store),F=H()?.imageSizes,z=(0,eN.useSelect)(X=>u&&x?X(lU.store).getEntityRecord("postType","attachment",u,{context:"view"}):null,[u,x]),I=c?s:z;function R(X){let te=I?.media_details?.sizes?.[X]?.source_url;if(!te)return null;t({url:te,sizeSlug:X})}let $=F?.filter(({slug:X})=>I?.media_details?.sizes?.[X]?.source_url)?.map(({name:X,slug:te})=>({value:te,label:X})),j=()=>{t({hasParallax:!d,...d?{}:{focalPoint:void 0}})},G=()=>{t({isRepeated:!f})},O=_||x,J=X=>{let[te,ne]=S.current?[S.current.style,"objectPosition"]:[n.current.style,"backgroundPosition"];te[ne]=Qo(X)},ee=(0,Yo.__experimentalUseMultipleOriginColorsAndGradients)(),oe=q();return(0,dt.jsxs)(dt.Fragment,{children:[(0,dt.jsx)(Yo.InspectorControls,{children:(!!C||c)&&(0,dt.jsxs)(jt.__experimentalToolsPanel,{label:(0,po.__)("Settings"),resetAll:()=>{t({hasParallax:!1,focalPoint:void 0,isRepeated:!1,alt:"",poster:void 0}),R(Xf)},dropdownMenuProps:oe,children:[x&&(0,dt.jsxs)(dt.Fragment,{children:[(0,dt.jsx)(jt.__experimentalToolsPanelItem,{label:(0,po.__)("Fixed background"),isShownByDefault:!0,hasValue:()=>!!d,onDeselect:()=>t({hasParallax:!1,focalPoint:void 0}),children:(0,dt.jsx)(jt.ToggleControl,{label:(0,po.__)("Fixed background"),checked:!!d,onChange:j})}),(0,dt.jsx)(jt.__experimentalToolsPanelItem,{label:(0,po.__)("Repeated background"),isShownByDefault:!0,hasValue:()=>f,onDeselect:()=>t({isRepeated:!1}),children:(0,dt.jsx)(jt.ToggleControl,{label:(0,po.__)("Repeated background"),checked:f,onChange:G})})]}),O&&(0,dt.jsx)(jt.__experimentalToolsPanelItem,{label:(0,po.__)("Focal point"),isShownByDefault:!0,hasValue:()=>!!p,onDeselect:()=>t({focalPoint:void 0}),children:(0,dt.jsx)(jt.FocalPointPicker,{label:(0,po.__)("Focal point"),url:C,value:p,onDragStart:J,onDrag:J,onChange:X=>t({focalPoint:X})})}),_&&(0,dt.jsx)(r5,{poster:k,onChange:X=>t({poster:X?.url})}),!c&&C&&!_&&(0,dt.jsx)(jt.__experimentalToolsPanelItem,{label:(0,po.__)("Alternative text"),isShownByDefault:!0,hasValue:()=>!!b,onDeselect:()=>t({alt:""}),children:(0,dt.jsx)(jt.TextareaControl,{label:(0,po.__)("Alternative text"),value:b,onChange:X=>t({alt:X}),help:(0,dt.jsxs)(dt.Fragment,{children:[(0,dt.jsx)(jt.ExternalLink,{href:(0,po.__)("https://www.w3.org/WAI/tutorials/images/decision-tree/"),children:(0,po.__)("Describe the purpose of the image.")}),(0,dt.jsx)("br",{}),(0,po.__)("Leave empty if decorative.")]})})}),!!$?.length&&(0,dt.jsx)(k0e,{value:B,onChange:R,options:$,defaultValue:Xf})]})}),ee.hasColorsOrGradients&&(0,dt.jsxs)(Yo.InspectorControls,{group:"color",children:[(0,dt.jsx)(Yo.__experimentalColorGradientSettingsDropdown,{__experimentalIsRenderedInSidebar:!0,settings:[{colorValue:N.color,gradientValue:D,label:(0,po.__)("Overlay"),onColorChange:a,onGradientChange:A,isShownByDefault:!0,resetAllFilter:()=>({overlayColor:void 0,customOverlayColor:void 0,gradient:void 0,customGradient:void 0}),clearable:!0}],panelId:r,...ee}),(0,dt.jsx)(jt.__experimentalToolsPanelItem,{hasValue:()=>m===void 0?!1:m!==(C?50:100),label:(0,po.__)("Overlay opacity"),onDeselect:()=>l(C?50:100),resetAllFilter:()=>({dimRatio:C?50:100}),isShownByDefault:!0,panelId:r,children:(0,dt.jsx)(jt.RangeControl,{label:(0,po.__)("Overlay opacity"),value:m,onChange:X=>l(X),min:0,max:100,step:10,required:!0,__next40pxDefaultSize:!0})})]}),(0,dt.jsx)(Yo.InspectorControls,{group:"dimensions",children:(0,dt.jsx)(jt.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>!!h,label:(0,po.__)("Minimum height"),onDeselect:()=>t({minHeight:void 0,minHeightUnit:void 0}),resetAllFilter:()=>({minHeight:void 0,minHeightUnit:void 0}),isShownByDefault:!0,panelId:r,children:(0,dt.jsx)(C0e,{value:e?.style?.dimensions?.aspectRatio?"":h,unit:g,onChange:X=>t({minHeight:X,style:x0e({...e?.style,dimensions:{...e?.style?.dimensions,aspectRatio:void 0}})}),onUnitChange:X=>t({minHeightUnit:X})})})}),(0,dt.jsx)(Yo.InspectorControls,{group:"advanced",children:(0,dt.jsx)(w0e,{tagName:y,onChange:X=>t({tagName:X}),clientId:r,options:[{label:(0,po.__)("Default (<div>)"),value:"div"},{label:"<header>",value:"header"},{label:"<main>",value:"main"},{label:"<section>",value:"section"},{label:"<article>",value:"article"},{label:"<aside>",value:"aside"},{label:"<footer>",value:"footer"}]})})]})}var o5=o(U(),1),Ol=o(T(),1),K1=o(P(),1),dU=o(M(),1);var tN=o(U(),1),cm=o(M(),1),Kp=o(P(),1);var cU=o(W(),1);var S0e="core/embed",T0e=["youtube","vimeo","videopress","animoto","tiktok","wordpress-tv"];function uU(e){return e?P0e(e)!==null:!1}function P0e(e){let t=(0,cU.getBlockVariations)(S0e);if(!t)return null;let r=t.find(({patterns:a})=>eI(e,a));return!r||!T0e.includes(r.name)?null:r}function mU(e){let t=e?.match(/src=["']([^"']+)["']/);if(!t)return null;let r=t[1],a=I0e(r);return e.replace(r,a)}function B0e(e){if(!e)return null;let t=e.toLowerCase();return t.includes("youtube.com")||t.includes("youtu.be")?"youtube":t.includes("vimeo.com")?"vimeo":t.includes("videopress.com")?"videopress":t.includes("animoto.com")?"animoto":t.includes("tiktok.com")?"tiktok":t.includes("wordpress.tv")?"wordpress-tv":null}function I0e(e){if(!e)return e;try{let t=new URL(e);switch(B0e(e)){case"youtube":t.searchParams.set("autoplay","1"),t.searchParams.set("mute","1"),t.searchParams.set("loop","1"),t.searchParams.set("controls","0"),t.searchParams.set("showinfo","0"),t.searchParams.set("modestbranding","1"),t.searchParams.set("playsinline","1"),t.searchParams.set("rel","0");let a=t.pathname.split("/").pop();a&&t.searchParams.set("playlist",a);break;case"vimeo":t.searchParams.set("autoplay","1"),t.searchParams.set("muted","1"),t.searchParams.set("loop","1"),t.searchParams.set("background","1"),t.searchParams.set("controls","0");break;case"videopress":case"wordpress-tv":t.searchParams.set("autoplay","1"),t.searchParams.set("loop","1"),t.searchParams.set("muted","1");break;default:t.searchParams.set("autoplay","1"),t.searchParams.set("muted","1"),t.searchParams.set("loop","1");break}return t.toString()}catch{return e}}var eh=o(v(),1);function pU({onSubmit:e,onClose:t,initialUrl:r=""}){let[a,n]=(0,tN.useState)(r),[i,l]=(0,tN.useState)("");return(0,eh.jsx)(cm.__experimentalConfirmDialog,{isOpen:!0,onConfirm:()=>{if(!a){l((0,Kp.__)("Please enter a URL."));return}if(!uU(a)){l((0,Kp.__)("This URL is not supported. Please enter a valid video link from a supported provider."));return}e(a),t()},onCancel:t,confirmButtonText:(0,Kp.__)("Add video"),size:"medium",children:(0,eh.jsxs)(cm.__experimentalVStack,{spacing:4,children:[i&&(0,eh.jsx)(cm.Notice,{status:"error",isDismissible:!1,children:i}),(0,eh.jsx)(cm.TextControl,{type:"url",__next40pxDefaultSize:!0,label:(0,Kp.__)("Video URL"),value:a,onChange:c=>{n(c),l("")},placeholder:(0,Kp.__)("Enter YouTube, Vimeo, or other video URL"),help:(0,Kp.__)("Add a background video to the cover block that will autoplay in a loop.")})]})})}var nl=o(v(),1),{cleanEmptyObject:N0e}=K(Ol.privateApis);function fU({attributes:e,setAttributes:t,onSelectMedia:r,currentSettings:a,toggleUseFeaturedImage:n,onClearMedia:i,onSelectEmbedUrl:l,blockEditingMode:s}){let{contentPosition:c,id:u,useFeaturedImage:m,minHeight:p,minHeightUnit:d,backgroundType:f}=e,{hasInnerBlocks:h,url:g}=a,[b,y]=(0,o5.useState)(p),[k,_]=(0,o5.useState)(d),[x,S]=(0,o5.useState)(!1),C=d==="vh"&&p===100&&!e?.style?.dimensions?.aspectRatio,N=s==="contentOnly",B=()=>C?t(k==="vh"&&b===100?{minHeight:void 0,minHeightUnit:void 0}:{minHeight:b,minHeightUnit:k}):(y(p),_(d),t({minHeight:100,minHeightUnit:"vh",style:N0e({...e?.style,dimensions:{...e?.style?.dimensions,aspectRatio:void 0}})}));return(0,nl.jsxs)(nl.Fragment,{children:[!N&&(0,nl.jsxs)(Ol.BlockControls,{group:"block",children:[(0,nl.jsx)(Ol.__experimentalBlockAlignmentMatrixControl,{label:(0,K1.__)("Change content position"),value:c,onChange:D=>t({contentPosition:D}),isDisabled:!h}),(0,nl.jsx)(Ol.__experimentalBlockFullHeightAligmentControl,{isActive:C,onToggle:B,isDisabled:!h})]}),(0,nl.jsx)(Ol.BlockControls,{group:"other",children:(0,nl.jsx)(Ol.MediaReplaceFlow,{mediaId:u,mediaURL:g,allowedTypes:Qk,onSelect:r,onToggleFeaturedImage:n,useFeaturedImage:m,name:g?(0,K1.__)("Replace"):(0,K1.__)("Add media"),onReset:i,variant:"toolbar",children:({onClose:D})=>(0,nl.jsx)(dU.MenuItem,{icon:ii,onClick:()=>{S(!0),D()},children:(0,K1.__)("Embed video from URL")})})}),x&&(0,nl.jsx)(pU,{onSubmit:D=>{l(D)},onClose:()=>S(!1),initialUrl:f===Kc?g:""})]})}var a5=o(T(),1),hU=o(P(),1);var rN=o(v(),1);function oN({disableMediaButtons:e=!1,children:t,onSelectMedia:r,onError:a,style:n,toggleUseFeaturedImage:i}){return(0,rN.jsx)(a5.MediaPlaceholder,{icon:(0,rN.jsx)(a5.BlockIcon,{icon:xp}),labels:{title:(0,hU.__)("Cover")},onSelect:r,allowedTypes:Qk,disableMediaButtons:e,onToggleFeaturedImage:i,onError:a,style:n,children:t})}var gU=o(U(),1),vU=o(T(),1);var bU=o(v(),1),E0e={top:!1,right:!1,bottom:!0,left:!1,topRight:!1,bottomRight:!1,bottomLeft:!1,topLeft:!1},{ResizableBoxPopover:D0e}=K(vU.privateApis);function aN({className:e,height:t,minHeight:r,onResize:a,onResizeStart:n,onResizeStop:i,showHandle:l,size:s,width:c,...u}){let[m,p]=(0,gU.useState)(!1),d={className:w(e,{"is-resizing":m}),enable:E0e,onResizeStart:(f,h,g)=>{n(g.clientHeight),a(g.clientHeight)},onResize:(f,h,g)=>{a(g.clientHeight),m||p(!0)},onResizeStop:(f,h,g)=>{i(g.clientHeight),p(!1)},showHandle:l,size:s,__experimentalShowTooltip:!0,__experimentalTooltipProps:{axis:"y",position:"bottom",isVisible:m}};return(0,bU.jsx)(D0e,{className:"block-library-cover__resizable-box-popover",resizableBoxProps:d,...u})}var L0e={grad:.9,turn:360,rad:360/(2*Math.PI)},Qc=function(e){return typeof e=="string"?e.length>0:typeof e=="number"},Po=function(e,t,r){return t===void 0&&(t=0),r===void 0&&(r=Math.pow(10,t)),Math.round(r*e)/r+0},il=function(e,t,r){return t===void 0&&(t=0),r===void 0&&(r=1),e>r?r:e>t?e:t},TU=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},yU=function(e){return{r:il(e.r,0,255),g:il(e.g,0,255),b:il(e.b,0,255),a:il(e.a)}},nN=function(e){return{r:Po(e.r),g:Po(e.g),b:Po(e.b),a:Po(e.a,3)}},M0e=/^#([0-9a-f]{3,8})$/i,n5=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},PU=function(e){var t=e.r,r=e.g,a=e.b,n=e.a,i=Math.max(t,r,a),l=i-Math.min(t,r,a),s=l?i===t?(r-a)/l:i===r?2+(a-t)/l:4+(t-r)/l:0;return{h:60*(s<0?s+6:s),s:i?l/i*100:0,v:i/255*100,a:n}},BU=function(e){var t=e.h,r=e.s,a=e.v,n=e.a;t=t/360*6,r/=100,a/=100;var i=Math.floor(t),l=a*(1-r),s=a*(1-(t-i)*r),c=a*(1-(1-t+i)*r),u=i%6;return{r:255*[a,s,l,l,c,a][u],g:255*[c,a,a,s,l,l][u],b:255*[l,l,c,a,a,s][u],a:n}},_U=function(e){return{h:TU(e.h),s:il(e.s,0,100),l:il(e.l,0,100),a:il(e.a)}},xU=function(e){return{h:Po(e.h),s:Po(e.s),l:Po(e.l),a:Po(e.a,3)}},kU=function(e){return BU((r=(t=e).s,{h:t.h,s:(r*=((a=t.l)<50?a:100-a)/100)>0?2*r/(a+r)*100:0,v:a+r,a:t.a}));var t,r,a},Q1=function(e){return{h:(t=PU(e)).h,s:(n=(200-(r=t.s))*(a=t.v)/100)>0&&n<200?r*a/100/(n<=100?n:200-n)*100:0,l:n/2,a:t.a};var t,r,a,n},A0e=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,R0e=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,z0e=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,V0e=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,sN={string:[[function(e){var t=M0e.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?Po(parseInt(e[3]+e[3],16)/255,2):1}:e.length===6||e.length===8?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:e.length===8?Po(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=z0e.exec(e)||V0e.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:yU({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=A0e.exec(e)||R0e.exec(e);if(!t)return null;var r,a,n=_U({h:(r=t[1],a=t[2],a===void 0&&(a="deg"),Number(r)*(L0e[a]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return kU(n)},"hsl"]],object:[[function(e){var t=e.r,r=e.g,a=e.b,n=e.a,i=n===void 0?1:n;return Qc(t)&&Qc(r)&&Qc(a)?yU({r:Number(t),g:Number(r),b:Number(a),a:Number(i)}):null},"rgb"],[function(e){var t=e.h,r=e.s,a=e.l,n=e.a,i=n===void 0?1:n;if(!Qc(t)||!Qc(r)||!Qc(a))return null;var l=_U({h:Number(t),s:Number(r),l:Number(a),a:Number(i)});return kU(l)},"hsl"],[function(e){var t=e.h,r=e.s,a=e.v,n=e.a,i=n===void 0?1:n;if(!Qc(t)||!Qc(r)||!Qc(a))return null;var l=(function(s){return{h:TU(s.h),s:il(s.s,0,100),v:il(s.v,0,100),a:il(s.a)}})({h:Number(t),s:Number(r),v:Number(a),a:Number(i)});return BU(l)},"hsv"]]},wU=function(e,t){for(var r=0;r<t.length;r++){var a=t[r][0](e);if(a)return[a,t[r][1]]}return[null,void 0]},F0e=function(e){return typeof e=="string"?wU(e.trim(),sN.string):typeof e=="object"&&e!==null?wU(e,sN.object):[null,void 0]};var iN=function(e,t){var r=Q1(e);return{h:r.h,s:il(r.s+100*t,0,100),l:r.l,a:r.a}},lN=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},CU=function(e,t){var r=Q1(e);return{h:r.h,s:r.s,l:il(r.l+100*t,0,100),a:r.a}},cN=(function(){function e(t){this.parsed=F0e(t)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return this.parsed!==null},e.prototype.brightness=function(){return Po(lN(this.rgba),2)},e.prototype.isDark=function(){return lN(this.rgba)<.5},e.prototype.isLight=function(){return lN(this.rgba)>=.5},e.prototype.toHex=function(){return t=nN(this.rgba),r=t.r,a=t.g,n=t.b,l=(i=t.a)<1?n5(Po(255*i)):"","#"+n5(r)+n5(a)+n5(n)+l;var t,r,a,n,i,l},e.prototype.toRgb=function(){return nN(this.rgba)},e.prototype.toRgbString=function(){return t=nN(this.rgba),r=t.r,a=t.g,n=t.b,(i=t.a)<1?"rgba("+r+", "+a+", "+n+", "+i+")":"rgb("+r+", "+a+", "+n+")";var t,r,a,n,i},e.prototype.toHsl=function(){return xU(Q1(this.rgba))},e.prototype.toHslString=function(){return t=xU(Q1(this.rgba)),r=t.h,a=t.s,n=t.l,(i=t.a)<1?"hsla("+r+", "+a+"%, "+n+"%, "+i+")":"hsl("+r+", "+a+"%, "+n+"%)";var t,r,a,n,i},e.prototype.toHsv=function(){return t=PU(this.rgba),{h:Po(t.h),s:Po(t.s),v:Po(t.v),a:Po(t.a,3)};var t},e.prototype.invert=function(){return Ja({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},e.prototype.saturate=function(t){return t===void 0&&(t=.1),Ja(iN(this.rgba,t))},e.prototype.desaturate=function(t){return t===void 0&&(t=.1),Ja(iN(this.rgba,-t))},e.prototype.grayscale=function(){return Ja(iN(this.rgba,-1))},e.prototype.lighten=function(t){return t===void 0&&(t=.1),Ja(CU(this.rgba,t))},e.prototype.darken=function(t){return t===void 0&&(t=.1),Ja(CU(this.rgba,-t))},e.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},e.prototype.alpha=function(t){return typeof t=="number"?Ja({r:(r=this.rgba).r,g:r.g,b:r.b,a:t}):Po(this.rgba.a,3);var r},e.prototype.hue=function(t){var r=Q1(this.rgba);return typeof t=="number"?Ja({h:t,s:r.s,l:r.l,a:r.a}):Po(r.h)},e.prototype.isEqual=function(t){return this.toHex()===Ja(t).toHex()},e})(),Ja=function(e){return e instanceof cN?e:new cN(e)},SU=[],IU=function(e){e.forEach(function(t){SU.indexOf(t)<0&&(t(cN,sN),SU.push(t))})};function NU(e,t){var r={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},a={};for(var n in r)a[r[n]]=n;var i={};e.prototype.toName=function(l){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var s,c,u=a[this.toHex()];if(u)return u;if(l?.closest){var m=this.toRgb(),p=1/0,d="black";if(!i.length)for(var f in r)i[f]=new e(r[f]).toRgb();for(var h in r){var g=(s=m,c=i[h],Math.pow(s.r-c.r,2)+Math.pow(s.g-c.g,2)+Math.pow(s.b-c.b,2));g<p&&(p=g,d=h)}return d}},t.string.push([function(l){var s=l.toLowerCase(),c=s==="transparent"?"#0000":r[s];return c?new e(c).toRgb():null},"name"])}function H0e(e){var t=e.toString(16);return t.length===1?"0"+t:t}function EU(e){return"#"+e.map(H0e).join("")}function O0e(e){var t=(e[0]*299+e[1]*587+e[2]*114)/1e3;return t<128}function j0e(e){return e?U0e(e)?e:[e]:[]}function U0e(e){return Array.isArray(e[0])}function mN(e,t,r){for(var a=0;a<r.length;a++)if(G0e(e,t,r[a]))return!0;return!1}function G0e(e,t,r){switch(r.length){case 3:if(W0e(e,t,r))return!0;break;case 4:if($0e(e,t,r))return!0;break;case 5:if(q0e(e,t,r))return!0;break;default:return!1}}function W0e(e,t,r){return e[t+3]!==255||e[t]===r[0]&&e[t+1]===r[1]&&e[t+2]===r[2]}function $0e(e,t,r){return e[t+3]&&r[3]?e[t]===r[0]&&e[t+1]===r[1]&&e[t+2]===r[2]&&e[t+3]===r[3]:e[t+3]===r[3]}function i5(e,t,r){return e>=t-r&&e<=t+r}function q0e(e,t,r){var a=r[0],n=r[1],i=r[2],l=r[3],s=r[4],c=e[t+3],u=i5(c,l,s);return l?!!(!c&&u||i5(e[t],a,s)&&i5(e[t+1],n,s)&&i5(e[t+2],i,s)&&u):u}function Z0e(e,t,r){for(var a={},n=24,i=r.ignoredColor,l=r.step,s=[0,0,0,0,0],c=0;c<t;c+=l){var u=e[c],m=e[c+1],p=e[c+2],d=e[c+3];if(!(i&&mN(e,c,i))){var f=Math.round(u/n)+","+Math.round(m/n)+","+Math.round(p/n);a[f]?a[f]=[a[f][0]+u*d,a[f][1]+m*d,a[f][2]+p*d,a[f][3]+d,a[f][4]+1]:a[f]=[u*d,m*d,p*d,d,1],s[4]<a[f][4]&&(s=a[f])}}var h=s[0],g=s[1],b=s[2],y=s[3],k=s[4];return y?[Math.round(h/y),Math.round(g/y),Math.round(b/y),Math.round(y/k)]:r.defaultColor}function K0e(e,t,r){for(var a=0,n=0,i=0,l=0,s=0,c=r.ignoredColor,u=r.step,m=0;m<t;m+=u){var p=e[m+3],d=e[m]*p,f=e[m+1]*p,h=e[m+2]*p;c&&mN(e,m,c)||(a+=d,n+=f,i+=h,l+=p,s++)}return l?[Math.round(a/l),Math.round(n/l),Math.round(i/l),Math.round(l/s)]:r.defaultColor}function Q0e(e,t,r){for(var a=0,n=0,i=0,l=0,s=0,c=r.ignoredColor,u=r.step,m=0;m<t;m+=u){var p=e[m],d=e[m+1],f=e[m+2],h=e[m+3];c&&mN(e,m,c)||(a+=p*p*h,n+=d*d*h,i+=f*f*h,l+=h,s++)}return l?[Math.round(Math.sqrt(a/l)),Math.round(Math.sqrt(n/l)),Math.round(Math.sqrt(i/l)),Math.round(l/s)]:r.defaultColor}function DU(e){return X1(e,"defaultColor",[0,0,0,0])}function X1(e,t,r){return e[t]===void 0?r:e[t]}var LU=10,uN=100;function Y0e(e){return e.search(/\.svg(\?|$)/i)!==-1}function X0e(e){if(AU(e)){var t=e.naturalWidth,r=e.naturalHeight;return!e.naturalWidth&&Y0e(e.src)&&(t=r=uN),{width:t,height:r}}return e1e(e)?{width:e.videoWidth,height:e.videoHeight}:{width:e.width,height:e.height}}function MU(e){return t1e(e)?"canvas":J0e(e)?"offscreencanvas":r1e(e)?"imagebitmap":e.src}function AU(e){return typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement}function J0e(e){return typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas}function e1e(e){return typeof HTMLVideoElement<"u"&&e instanceof HTMLVideoElement}function t1e(e){return typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement}function r1e(e){return typeof ImageBitmap<"u"&&e instanceof ImageBitmap}function o1e(e,t){var r=X1(t,"left",0),a=X1(t,"top",0),n=X1(t,"width",e.width),i=X1(t,"height",e.height),l=n,s=i;if(t.mode==="precision")return{srcLeft:r,srcTop:a,srcWidth:n,srcHeight:i,destWidth:l,destHeight:s};var c;return n>i?(c=n/i,l=uN,s=Math.round(l/c)):(c=i/n,s=uN,l=Math.round(s/c)),(l>n||s>i||l<LU||s<LU)&&(l=n,s=i),{srcLeft:r,srcTop:a,srcWidth:n,srcHeight:i,destWidth:l,destHeight:s}}var a1e=typeof window>"u";function n1e(){return a1e?new OffscreenCanvas(1,1):document.createElement("canvas")}var RU="FastAverageColor: ";function l5(e,t,r){t||(console.error(RU+e),r&&console.error(r))}function Y1(e){return Error(RU+e)}var zU=(function(){function e(){this.canvas=null,this.ctx=null}return e.prototype.getColorAsync=function(t,r){if(!t)return Promise.reject(Y1("call .getColorAsync() without resource."));if(typeof t=="string"){if(typeof Image>"u")return Promise.reject(Y1("resource as string is not supported in this environment"));var a=new Image;return a.crossOrigin=r&&r.crossOrigin||"",a.src=t,this.bindImageEvents(a,r)}else{if(AU(t)&&!t.complete)return this.bindImageEvents(t,r);var n=this.getColor(t,r);return n.error?Promise.reject(n.error):Promise.resolve(n)}},e.prototype.getColor=function(t,r){r=r||{};var a=DU(r);if(!t)return l5("call .getColor(null) without resource",r.silent),this.prepareResult(a);var n=X0e(t),i=o1e(n,r);if(!i.srcWidth||!i.srcHeight||!i.destWidth||!i.destHeight)return l5('incorrect sizes for resource "'.concat(MU(t),'"'),r.silent),this.prepareResult(a);if(this.canvas||(this.canvas=n1e()),!this.ctx&&(this.ctx=this.canvas.getContext&&this.canvas.getContext("2d"),!this.ctx))return l5("Canvas Context 2D is not supported in this browser",r.silent),this.prepareResult(a);this.canvas.width=i.destWidth,this.canvas.height=i.destHeight;var l=a;try{this.ctx.clearRect(0,0,i.destWidth,i.destHeight),this.ctx.drawImage(t,i.srcLeft,i.srcTop,i.srcWidth,i.srcHeight,0,0,i.destWidth,i.destHeight);var s=this.ctx.getImageData(0,0,i.destWidth,i.destHeight).data;l=this.getColorFromArray4(s,r)}catch(c){l5("security error (CORS) for resource ".concat(MU(t),`. Details: https://developer.mozilla.org/en/docs/Web/HTML/CORS_enabled_image`),r.silent,c)}return this.prepareResult(l)},e.prototype.getColorFromArray4=function(t,r){r=r||{};var a=4,n=t.length,i=DU(r);if(n<a)return i;var l=n-n%a,s=(r.step||1)*a,c;switch(r.algorithm||"sqrt"){case"simple":c=K0e;break;case"sqrt":c=Q0e;break;case"dominant":c=Z0e;break;default:throw Y1("".concat(r.algorithm," is unknown algorithm"))}return c(t,l,{defaultColor:i,ignoredColor:j0e(r.ignoredColor),step:s})},e.prototype.prepareResult=function(t){var r=t.slice(0,3),a=[t[0],t[1],t[2],t[3]/255],n=O0e(t);return{value:[t[0],t[1],t[2],t[3]],rgb:"rgb("+r.join(",")+")",rgba:"rgba("+a.join(",")+")",hex:EU(r),hexa:EU(t),isDark:n,isLight:!n}},e.prototype.destroy=function(){this.canvas&&(this.canvas.width=1,this.canvas.height=1,this.canvas=null),this.ctx=null},e.prototype.bindImageEvents=function(t,r){var a=this;return new Promise(function(n,i){var l=function(){u();var m=a.getColor(t,r);m.error?i(m.error):n(m)},s=function(){u(),i(Y1('Error loading image "'.concat(t.src,'".')))},c=function(){u(),i(Y1('Image "'.concat(t.src,'" loading aborted')))},u=function(){t.removeEventListener("load",l),t.removeEventListener("error",s),t.removeEventListener("abort",c)};t.addEventListener("load",l),t.addEventListener("error",s),t.addEventListener("abort",c)})},e})();var FU=o(Yc(),1);IU([NU]);var th="#FFF",HU="#000";function i1e(e,t){return{r:e.r*e.a+t.r*t.a*(1-e.a),g:e.g*e.a+t.g*t.a*(1-e.a),b:e.b*e.a+t.b*t.a*(1-e.a),a:e.a+t.a*(1-e.a)}}function s5(){return s5.fastAverageColor||(s5.fastAverageColor=new zU),s5.fastAverageColor}var rh=Af(async e=>{if(!e)return th;let{r:t,g:r,b:a,a:n}=Ja(th).toRgb();try{let i=(0,FU.applyFilters)("media.crossOrigin",void 0,e);return(await s5().getColorAsync(e,{defaultColor:[t,r,a,n*255],silent:!0,crossOrigin:i})).hex}catch{return th}});function Qp(e,t,r){if(t===r||e===100)return Ja(t).isDark();let a=Ja(t).alpha(e/100).toRgb(),n=Ja(r).toRgb(),i=i1e(a,n);return Ja(i).isDark()}var Ut=o(v(),1);function l1e(e){return[["core/paragraph",{style:{typography:{textAlign:"center"}},placeholder:(0,pN.__)("Write title\u2026"),...e}]]}var s1e=(e,t)=>!e&&(0,OU.isBlobURL)(t);function c1e({attributes:e,clientId:t,isSelected:r,overlayColor:a,setAttributes:n,setOverlayColor:i,toggleSelection:l,context:{postId:s,postType:c}}){let{contentPosition:u,id:m,url:p,backgroundType:d,useFeaturedImage:f,dimRatio:h,focalPoint:g,hasParallax:b,isDark:y,isRepeated:k,minHeight:_,minHeightUnit:x,alt:S,allowedBlocks:C,templateLock:N,tagName:B="div",isUserOverlayColor:D,sizeSlug:A,poster:H}=e,[F]=(0,J1.useEntityProp)("postType",c,"featured_media",s),{getSettings:z}=(0,um.useSelect)(Bo.store),{__unstableMarkNextChangeAsNotPersistent:I}=(0,um.useDispatch)(Bo.store),R=(0,jl.useRef)({attributes:e,overlayColor:a});(0,jl.useLayoutEffect)(()=>{R.current={attributes:e,overlayColor:a}});let{media:$}=(0,um.useSelect)(Pe=>({media:F&&f?Pe(J1.store).getEntityRecord("postType","attachment",F,{context:"view"}):void 0}),[F,f]),j=$?.media_details?.sizes?.[A]?.source_url??$?.source_url;(0,jl.useEffect)(()=>{(async()=>{if(!f)return;let Pe=await rh(j),{attributes:Ht,overlayColor:qr}=R.current,Co=qr.color;Ht.isUserOverlayColor||(Co=Pe,I(),i(Co));let So=Qp(Ht.dimRatio,Co,Pe);I(),n({isDark:So,isUserOverlayColor:Ht.isUserOverlayColor||!1})})()},[j,I,n,i,f]);let G=f?j:p?.replaceAll("&","&"),O=f?Qt:d,{createErrorNotice:J}=(0,um.useDispatch)(jU.store),{gradientClass:ee,gradientValue:oe}=(0,Bo.__experimentalUseGradient)(),X=async Pe=>{let Ht=Xj(Pe),qr=[Pe?.type,Pe?.media_type].includes(Qt),Co=await rh(qr?Pe?.url:void 0),{attributes:So,overlayColor:Sl}=R.current,qi=Sl.color;So.isUserOverlayColor||(qi=Co,i(qi),I());let Zi=So.url===void 0&&So.dimRatio===100?50:So.dimRatio,vf=Qp(Zi,qi,Co);if(O===Qt&&Ht?.id){let{imageDefaultSize:zc}=z();A&&(Pe?.sizes?.[A]||Pe?.media_details?.sizes?.[A])?(Ht.sizeSlug=A,Ht.url=Pe?.sizes?.[A]?.url||Pe?.media_details?.sizes?.[A]?.source_url):Pe?.sizes?.[zc]||Pe?.media_details?.sizes?.[zc]?(Ht.sizeSlug=zc,Ht.url=Pe?.sizes?.[zc]?.url||Pe?.media_details?.sizes?.[zc]?.source_url):Ht.sizeSlug=Xf}n({...Ht,focalPoint:void 0,useFeaturedImage:void 0,dimRatio:Zi,isDark:vf,isUserOverlayColor:So.isUserOverlayColor||!1})},te=()=>{let Pe=a.color;D||(Pe=HU,i(void 0),I());let Ht=Qp(h,Pe,th);n({url:void 0,id:void 0,backgroundType:void 0,focalPoint:void 0,hasParallax:void 0,isRepeated:void 0,useFeaturedImage:void 0,isDark:Ht})},ne=async Pe=>{let Ht=await rh(G),{attributes:qr}=R.current,Co=Qp(qr.dimRatio,Pe,Ht);i(Pe),I(),n({isUserOverlayColor:!0,isDark:Co})},le=async Pe=>{let Ht=await rh(G),{overlayColor:qr}=R.current,Co=Qp(Pe,qr.color,Ht);n({dimRatio:Pe,isDark:Co})},pe=Pe=>{J(Pe,{type:"snackbar"})},Ie=Pe=>{n({url:Pe,backgroundType:Kc,dimRatio:p===void 0&&h===100?50:h,id:void 0,focalPoint:void 0,hasParallax:void 0,isRepeated:void 0,useFeaturedImage:void 0})},{embedPreview:Ne,isFetchingEmbed:ae}=(0,um.useSelect)(Pe=>{if(O!==Kc||!G)return{embedPreview:void 0,isFetchingEmbed:!1};let{getEmbedPreview:Ht,isRequestingEmbedPreview:qr}=Pe(J1.store);return{embedPreview:Ht(G),isFetchingEmbed:qr(G)}},[G,O]),Re=(0,jl.useMemo)(()=>O!==Kc||!Ne?.html?null:mU(Ne.html),[Ne,O]),Ee=s1e(m,G),ie=Qt===O,fe=Cr===O,ke=Kc===O,je=(0,Bo.useBlockEditingMode)(),de=je==="default",[ct,{height:at,width:kt}]=(0,c5.useResizeObserver)(),Wr=(0,jl.useMemo)(()=>({height:x==="px"&&_?_:"auto",width:"auto"}),[_,x]),ut=_&&x?`${_}${x}`:_,br=!(b||k),mt={minHeight:ut||void 0},wo=G?`url(${G})`:void 0,Y=Qo(g),ze={backgroundColor:a.color},Me={objectPosition:g&&br?Qo(g):void 0},Xe=!!(G||a.color||oe),Te=(0,um.useSelect)(Pe=>Pe(Bo.store).getBlock(t).innerBlocks.length>0,[t]),Bt=(0,jl.useRef)(),yr=(0,Bo.useBlockProps)({ref:Bt}),[xn]=(0,Bo.useSettings)("typography.fontSizes"),Je=xn?.length>0,$r=l1e({fontSize:Je?"large":void 0}),ip=(0,Bo.useInnerBlocksProps)({className:"wp-block-cover__inner-container"},{template:Te?void 0:$r,templateInsertUpdatesSelection:!0,allowedBlocks:C,templateLock:N,dropZoneElement:Bt.current}),Cs=(0,jl.useRef)(),Ru={isVideoBackground:fe,isImageBackground:ie,mediaElement:Cs,hasInnerBlocks:Te,url:G,isImgElement:br,overlayColor:a},kn=async()=>{let Pe=!f,Ht=Pe?await rh(j):th,{attributes:qr,overlayColor:Co}=R.current,So=qr.isUserOverlayColor?Co.color:Ht;qr.isUserOverlayColor||(i(Pe?So:void 0),I());let Sl=qr.dimRatio===100?50:qr.dimRatio,qi=Qp(Sl,So,Ht);n({id:void 0,url:void 0,useFeaturedImage:Pe,dimRatio:Sl,backgroundType:f?Qt:void 0,isDark:qi})},ja=(0,Ut.jsx)(fU,{attributes:e,setAttributes:n,onSelectMedia:X,onSelectEmbedUrl:Ie,currentSettings:Ru,toggleUseFeaturedImage:kn,onClearMedia:te,blockEditingMode:je}),gf=(0,Ut.jsx)(sU,{attributes:e,setAttributes:n,clientId:t,setOverlayColor:ne,coverRef:Bt,currentSettings:Ru,toggleUseFeaturedImage:kn,updateDimRatio:le,onClearMedia:te,featuredImage:$}),zu={className:"block-library-cover__resize-container",clientId:t,height:at,minHeight:ut,onResizeStart:()=>{n({minHeightUnit:"px"}),l(!1)},onResize:Pe=>{n({minHeight:Pe})},onResizeStop:Pe=>{l(!0),n({minHeight:Pe})},showHandle:!e.style?.dimensions?.aspectRatio,size:Wr,width:kt};if(!f&&!Te&&!Xe)return(0,Ut.jsxs)(Ut.Fragment,{children:[ja,gf,de&&r&&(0,Ut.jsx)(aN,{...zu}),(0,Ut.jsxs)(B,{...yr,className:w("is-placeholder",yr.className),style:{...yr.style,minHeight:ut||void 0},children:[ct,(0,Ut.jsx)(oN,{onSelectMedia:X,onError:pe,toggleUseFeaturedImage:kn,children:(0,Ut.jsx)("div",{className:"wp-block-cover__placeholder-background-options",children:(0,Ut.jsx)(Bo.ColorPalette,{disableCustomColors:!0,value:a.color,onChange:ne,clearable:!1,asButtons:!0,"aria-label":(0,pN.__)("Overlay color")})})})]})]});let Ss=w({"is-dark-theme":y,"is-light":!y,"is-transient":Ee,"has-parallax":b,"is-repeated":k,"has-custom-content-position":!Ya(u)},Nn(u)),Ts=G||!f||f&&!G;return(0,Ut.jsxs)(Ut.Fragment,{children:[ja,gf,(0,Ut.jsxs)(B,{...yr,className:w(Ss,yr.className),style:{...mt,...yr.style},"data-url":G,children:[ct,!G&&f&&(0,Ut.jsx)(Yp.Placeholder,{className:"wp-block-cover__image--placeholder-image",withIllustration:!0}),G&&ie&&(br?(0,Ut.jsx)("img",{ref:Cs,className:"wp-block-cover__image-background",alt:S,src:G,style:Me}):(0,Ut.jsx)("div",{ref:Cs,role:S?"img":void 0,"aria-label":S||void 0,className:w(Ss,"wp-block-cover__image-background"),style:{backgroundImage:wo,backgroundPosition:Y}})),G&&fe&&(0,Ut.jsx)("video",{ref:Cs,className:"wp-block-cover__video-background",autoPlay:!0,muted:!0,loop:!0,src:G,poster:H,style:Me}),ke&&Re&&(0,Ut.jsx)("div",{ref:Cs,className:"wp-block-cover__video-background wp-block-cover__embed-background",style:Me,children:(0,Ut.jsx)(Yp.SandBox,{allowSameOrigin:!0,html:Re,title:"Background video",styles:["iframe{position:fixed;top:0;left:0;width:100%;height:100%;}"]})}),ke&&!Re&&ae&&(0,Ut.jsx)(Yp.Spinner,{}),Ts&&(0,Ut.jsx)("span",{"aria-hidden":"true",className:w("wp-block-cover__background",al(h),{[a.class]:a.class,"has-background-dim":h!==void 0,"wp-block-cover__gradient-background":G&&oe&&h!==0,"has-background-gradient":oe,[ee]:ee}),style:{backgroundImage:oe,...ze}}),Ee&&(0,Ut.jsx)(Yp.Spinner,{}),(0,Ut.jsx)(oN,{disableMediaButtons:!0,onSelectMedia:X,onError:pe,toggleUseFeaturedImage:kn}),(0,Ut.jsx)("div",{...ip})]}),de&&r&&(0,Ut.jsx)(aN,{...zu})]})}var UU=(0,c5.compose)([(0,Bo.withColors)({overlayColor:"background-color"})])(c1e);var u5={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/cover",title:"Cover",category:"media",description:"Add an image or video with a text overlay.",textdomain:"default",attributes:{url:{type:"string",role:"content"},useFeaturedImage:{type:"boolean",default:!1},id:{type:"number"},alt:{type:"string",default:""},hasParallax:{type:"boolean",default:!1},isRepeated:{type:"boolean",default:!1},dimRatio:{type:"number",default:100},overlayColor:{type:"string"},customOverlayColor:{type:"string"},isUserOverlayColor:{type:"boolean"},backgroundType:{type:"string",default:"image"},focalPoint:{type:"object"},minHeight:{type:"number"},minHeightUnit:{type:"string"},gradient:{type:"string"},customGradient:{type:"string"},contentPosition:{type:"string"},isDark:{type:"boolean",default:!0},templateLock:{type:["string","boolean"],enum:["all","insert","contentOnly",!1]},tagName:{type:"string",default:"div"},sizeSlug:{type:"string"},poster:{type:"string",source:"attribute",selector:"video",attribute:"poster"}},usesContext:["postId","postType"],supports:{anchor:!0,align:!0,html:!1,shadow:!0,spacing:{padding:!0,margin:["top","bottom"],blockGap:!0,__experimentalDefaultControls:{padding:!0,blockGap:!0}},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,radius:!0,style:!0,width:!0}},color:{heading:!0,text:!0,background:!1,__experimentalSkipSerialization:["gradients"],enableContrastChecker:!1},dimensions:{aspectRatio:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},layout:{allowJustification:!1},interactivity:{clientNavigation:!0},filter:{duotone:!0},allowedBlocks:!0},selectors:{filter:{duotone:".wp-block-cover > .wp-block-cover__image-background, .wp-block-cover > .wp-block-cover__video-background"}},editorStyle:"wp-block-cover-editor",style:"wp-block-cover"};var mm=o(T(),1);var Vs=o(v(),1);function GU({attributes:e}){let{backgroundType:t,gradient:r,contentPosition:a,customGradient:n,customOverlayColor:i,dimRatio:l,focalPoint:s,useFeaturedImage:c,hasParallax:u,isDark:m,isRepeated:p,overlayColor:d,url:f,alt:h,id:g,minHeight:b,minHeightUnit:y,tagName:k,sizeSlug:_,poster:x}=e,S=(0,mm.getColorClassName)("background-color",d),C=(0,mm.__experimentalGetGradientClass)(r),N=b&&y?`${b}${y}`:b,B=Qt===t,D=Cr===t,A=Kc===t,H=!(u||p),F={minHeight:N||void 0},z={backgroundColor:S?void 0:i,background:n||void 0},I=s&&H?Qo(s):void 0,R=f?`url(${f})`:void 0,$=Qo(s),j=w({"is-light":!m,"has-parallax":u,"is-repeated":p,"has-custom-content-position":!Ya(a)},Nn(a)),G=w("wp-block-cover__image-background",g?`wp-image-${g}`:null,{[`size-${_}`]:_,"has-parallax":u,"is-repeated":p}),O=r||n;return(0,Vs.jsxs)(k,{...mm.useBlockProps.save({className:j,style:F}),children:[!c&&B&&f&&(H?(0,Vs.jsx)("img",{className:G,alt:h,src:f,style:{objectPosition:I},"data-object-fit":"cover","data-object-position":I}):(0,Vs.jsx)("div",{role:h?"img":void 0,"aria-label":h||void 0,className:G,style:{backgroundPosition:$,backgroundImage:R}})),D&&f&&(0,Vs.jsx)("video",{className:w("wp-block-cover__video-background","intrinsic-ignore"),autoPlay:!0,muted:!0,loop:!0,playsInline:!0,src:f,poster:x,style:{objectPosition:I},"data-object-fit":"cover","data-object-position":I}),A&&f&&(0,Vs.jsx)("figure",{className:w("wp-block-cover__video-background","wp-block-cover__embed-background","wp-block-embed"),children:(0,Vs.jsx)("div",{className:"wp-block-embed__wrapper",children:f})}),(0,Vs.jsx)("span",{"aria-hidden":"true",className:w("wp-block-cover__background",S,al(l),{"has-background-dim":l!==void 0,"wp-block-cover__gradient-background":f&&O&&l!==0,"has-background-gradient":O,[C]:C}),style:z}),(0,Vs.jsx)("div",{...mm.useInnerBlocksProps.save({className:"wp-block-cover__inner-container"})})]})}var hi=o(W(),1),WU=o(T(),1);var{cleanEmptyObject:m5}=K(WU.privateApis),m1e={from:[{type:"block",blocks:["core/image"],transform:({caption:e,url:t,alt:r,align:a,id:n,anchor:i,style:l})=>(0,hi.createBlock)("core/cover",{dimRatio:50,url:t,alt:r,align:a,id:n,anchor:i,style:{color:{duotone:l?.color?.duotone}}},[(0,hi.createBlock)("core/paragraph",{content:e,fontSize:"large",style:{typography:{textAlign:"center"}}})])},{type:"block",blocks:["core/video"],transform:({caption:e,src:t,align:r,id:a,anchor:n})=>(0,hi.createBlock)("core/cover",{dimRatio:50,url:t,align:r,id:a,backgroundType:Cr,anchor:n},[(0,hi.createBlock)("core/paragraph",{content:e,fontSize:"large",style:{typography:{textAlign:"center"}}})])},{type:"block",blocks:["core/group"],transform:(e,t)=>{let{align:r,anchor:a,backgroundColor:n,gradient:i,style:l}=e;if(t?.length===1&&t[0]?.name==="core/cover")return(0,hi.createBlock)("core/cover",t[0].attributes,t[0].innerBlocks);let s=n||i||l?.color?.background||l?.color?.gradient?void 0:50,c={align:r,anchor:a,dimRatio:s,overlayColor:n,customOverlayColor:l?.color?.background,gradient:i,customGradient:l?.color?.gradient},u={...e,backgroundColor:void 0,gradient:void 0,style:m5({...e?.style,color:l?.color?{...l?.color,background:void 0,gradient:void 0}:void 0})};return(0,hi.createBlock)("core/cover",c,[(0,hi.createBlock)("core/group",u,t)])}}],to:[{type:"block",blocks:["core/image"],isMatch:({backgroundType:e,url:t,overlayColor:r,customOverlayColor:a,gradient:n,customGradient:i})=>t?e===Qt:!r&&!a&&!n&&!i,transform:({title:e,url:t,alt:r,align:a,id:n,anchor:i,style:l})=>(0,hi.createBlock)("core/image",{caption:e,url:t,alt:r,align:a,id:n,anchor:i,style:{color:{duotone:l?.color?.duotone}}})},{type:"block",blocks:["core/video"],isMatch:({backgroundType:e,url:t,overlayColor:r,customOverlayColor:a,gradient:n,customGradient:i})=>t?e===Cr:!r&&!a&&!n&&!i,transform:({title:e,url:t,align:r,id:a,anchor:n})=>(0,hi.createBlock)("core/video",{caption:e,src:t,id:a,align:r,anchor:n})},{type:"block",blocks:["core/group"],isMatch:({url:e,useFeaturedImage:t})=>!(e||t),transform:(e,t)=>{let r={backgroundColor:e?.overlayColor,gradient:e?.gradient,style:m5({...e?.style,color:e?.customOverlayColor||e?.customGradient||e?.style?.color?{background:e?.customOverlayColor,gradient:e?.customGradient,...e?.style?.color}:void 0})};if(t?.length===1&&t[0]?.name==="core/group"){let a=m5(t[0].attributes||{});return a?.backgroundColor||a?.gradient||a?.style?.color?.background||a?.style?.color?.gradient?(0,hi.createBlock)("core/group",a,t[0]?.innerBlocks):(0,hi.createBlock)("core/group",{...r,...a,style:m5({...a?.style,color:r?.style?.color||a?.style?.color?{...r?.style?.color,...a?.style?.color}:void 0})},t[0]?.innerBlocks)}return(0,hi.createBlock)("core/group",{...e,...r},t)}}]},$U=m1e;var dN=o(P(),1);var p1e=[{name:"cover",title:(0,dN.__)("Cover"),description:(0,dN.__)("Add an image or video with a text overlay."),attributes:{layout:{type:"constrained"}},isDefault:!0,icon:xp}],qU=p1e;var{fieldsKey:d1e,formKey:f1e}=K(ZU.privateApis),{name:KU}=u5,p5={icon:xp,example:{attributes:{customOverlayColor:"#065174",dimRatio:40,url:"https://s.w.org/images/core/5.3/Windbuchencom.jpg",style:{typography:{fontSize:48},color:{text:"white"}}},innerBlocks:[{name:"core/paragraph",attributes:{content:`<strong>${(0,fN.__)("Snow Patrol")}</strong>`,style:{typography:{textAlign:"center"}}}}]},transforms:$U,save:GU,edit:UU,deprecated:Jj,variations:qU};window.__experimentalContentOnlyInspectorFields&&(p5[d1e]=[{id:"background",label:(0,fN.__)("Background"),type:"media",Edit:{control:"media",allowedTypes:["image","video"],multiple:!1,useFeaturedImage:!0},getValue:({item:e})=>({id:e.id,url:e.url,alt:e.alt,mediaType:e.backgroundType,featuredImage:e.useFeaturedImage}),setValue:({value:e})=>({id:e.id,url:e.url,alt:e.alt,mediaType:e.backgroundType,useFeaturedImage:e.featuredImage})}],p5[f1e]={fields:["background"]});var h1e=()=>E({name:KU,metadata:u5,settings:p5});var gN={};Z(gN,{init:()=>k1e,metadata:()=>d5,name:()=>rG,settings:()=>h5});var pm=o(P(),1),tG=o(W(),1);var d5={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/details",title:"Details",category:"text",description:"Hide and show additional content.",keywords:["summary","toggle","disclosure"],textdomain:"default",attributes:{showContent:{type:"boolean",default:!1},summary:{type:"rich-text",source:"rich-text",selector:"summary",role:"content"},name:{type:"string",source:"attribute",attribute:"name",selector:".wp-block-details"},placeholder:{type:"string"}},supports:{__experimentalOnEnter:!0,align:["wide","full"],anchor:!0,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},__experimentalBorder:{color:!0,width:!0,style:!0},html:!1,spacing:{margin:!0,padding:!0,blockGap:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},layout:{allowEditing:!1},interactivity:{clientNavigation:!0},allowedBlocks:!0},editorStyle:"wp-block-details-editor",style:"wp-block-details"};var Ul=o(T(),1),Fs=o(M(),1),Xc=o(P(),1),QU=o(U(),1),YU=o(V(),1);var En=o(v(),1),{withIgnoreIMEEvents:v1e}=K(Fs.privateApis),b1e=[["core/paragraph",{placeholder:(0,Xc.__)("Type / to add a hidden block")}]];function y1e({attributes:e,setAttributes:t,clientId:r}){let{name:a,showContent:n,summary:i,allowedBlocks:l,placeholder:s}=e,c=(0,Ul.useBlockProps)(),u=(0,Ul.useInnerBlocksProps)(c,{template:b1e,__experimentalCaptureToolbars:!0,allowedBlocks:l}),[m,p]=(0,QU.useState)(n),d=q(),f=(0,YU.useSelect)(b=>b(Ul.store).hasSelectedInnerBlock(r,!0),[r]),h=b=>{b.key==="Enter"&&!b.shiftKey&&(p(y=>!y),b.preventDefault())},g=b=>{b.key===" "&&b.preventDefault()};return(0,En.jsxs)(En.Fragment,{children:[(0,En.jsx)(Ul.InspectorControls,{children:(0,En.jsx)(Fs.__experimentalToolsPanel,{label:(0,Xc.__)("Settings"),resetAll:()=>{t({showContent:!1})},dropdownMenuProps:d,children:(0,En.jsx)(Fs.__experimentalToolsPanelItem,{isShownByDefault:!0,label:(0,Xc.__)("Open by default"),hasValue:()=>n,onDeselect:()=>{t({showContent:!1})},children:(0,En.jsx)(Fs.ToggleControl,{label:(0,Xc.__)("Open by default"),checked:n,onChange:()=>t({showContent:!n})})})})}),(0,En.jsx)(Ul.InspectorControls,{group:"advanced",children:(0,En.jsx)(Fs.TextControl,{__next40pxDefaultSize:!0,label:(0,Xc.__)("Name attribute"),value:a||"",onChange:b=>t({name:b}),help:(0,Xc.__)("Enables multiple Details blocks with the same name attribute to be connected, with only one open at a time.")})}),(0,En.jsxs)("details",{...u,open:m||f,onToggle:b=>p(b.target.open),name:a||"",children:[(0,En.jsx)("summary",{onKeyDown:v1e(h),onKeyUp:g,children:(0,En.jsx)(Ul.RichText,{identifier:"summary","aria-label":(0,Xc.__)("Write summary. Press Enter to expand or collapse the details."),placeholder:s||(0,Xc.__)("Write summary\u2026"),withoutInteractiveFormatting:!0,value:i,onChange:b=>t({summary:b})})}),u.children]})]})}var XU=y1e;var ah=o(T(),1),oh=o(v(),1);function JU({attributes:e}){let{name:t,showContent:r}=e,a=e.summary?e.summary:"Details",n=ah.useBlockProps.save();return(0,oh.jsxs)("details",{...n,name:t||void 0,open:r,children:[(0,oh.jsx)("summary",{children:(0,oh.jsx)(ah.RichText.Content,{value:a})}),(0,oh.jsx)(ah.InnerBlocks.Content,{})]})}var f5=o(W(),1),eG={from:[{type:"block",isMultiBlock:!0,blocks:["*"],isMatch({},e){return!(e.length===1&&e[0].name==="core/details")},__experimentalConvert(e){return(0,f5.createBlock)("core/details",{},e.map(t=>(0,f5.cloneBlock)(t)))}}]};var{fieldsKey:_1e,formKey:x1e}=K(tG.privateApis),{name:rG}=d5,h5={icon:T9,example:{attributes:{summary:(0,pm.__)("La Mancha"),showContent:!0},innerBlocks:[{name:"core/paragraph",attributes:{content:(0,pm.__)("In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing.")}}]},__experimentalLabel(e,{context:t}){let{summary:r}=e,a=e?.metadata?.name,n=r?.trim().length>0;if(t==="list-view"&&(a||n))return a||r;if(t==="breadcrumb"&&a)return a;if(t==="accessibility")return n?(0,pm.sprintf)((0,pm.__)("Details. %s"),r):(0,pm.__)("Details. Empty.")},save:JU,edit:XU,transforms:eG};window.__experimentalContentOnlyInspectorFields&&(h5[_1e]=[{id:"summary",label:(0,pm.__)("Summary"),type:"text",Edit:"rich-text"}],h5[x1e]={fields:["summary"]});var k1e=()=>E({name:rG,metadata:d5,settings:h5});var wN={};Z(wN,{init:()=>M1e,metadata:()=>Ls,name:()=>FG,settings:()=>HG});var Xp=o(P(),1),Hs=o(M(),1),g5=o(T(),1);var ll=o(v(),1);function w1e(e){return e?(0,Xp.__)("This embed will preserve its aspect ratio when the browser is resized."):(0,Xp.__)("This embed may not preserve its aspect ratio when the browser is resized.")}var C1e=({blockSupportsResponsive:e,showEditButton:t,themeSupportsResponsive:r,allowResponsive:a,toggleResponsive:n,switchBackToURLInput:i})=>{let l=q();return(0,ll.jsxs)(ll.Fragment,{children:[(0,ll.jsx)(g5.BlockControls,{children:(0,ll.jsx)(Hs.ToolbarGroup,{children:t&&(0,ll.jsx)(Hs.ToolbarButton,{className:"components-toolbar__control",label:(0,Xp.__)("Edit URL"),icon:Pp,onClick:i})})}),r&&e&&(0,ll.jsx)(g5.InspectorControls,{children:(0,ll.jsx)(Hs.__experimentalToolsPanel,{label:(0,Xp.__)("Media settings"),resetAll:()=>{n(!0)},dropdownMenuProps:l,children:(0,ll.jsx)(Hs.__experimentalToolsPanelItem,{label:(0,Xp.__)("Media settings"),isShownByDefault:!0,hasValue:()=>!a,onDeselect:()=>{n(!a)},children:(0,ll.jsx)(Hs.ToggleControl,{label:(0,Xp.__)("Resize for smaller devices"),checked:a,help:w1e,onChange:n})})})})]})},oG=C1e;var ye=o(M(),1),xe=o(v(),1),Gl=(0,xe.jsx)(ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,xe.jsx)(ye.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V9.8l4.7-5.3H19c.3 0 .5.2.5.5v14zm-6-9.5L16 12l-2.5 2.8 1.1 1L18 12l-3.5-3.5-1 1zm-3 0l-1-1L6 12l3.5 3.8 1.1-1L8 12l2.5-2.5z"})}),v5=(0,xe.jsx)(ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,xe.jsx)(ye.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V9.8l4.7-5.3H19c.3 0 .5.2.5.5v14zM13.2 7.7c-.4.4-.7 1.1-.7 1.9v3.7c-.4-.3-.8-.4-1.3-.4-1.2 0-2.2 1-2.2 2.2 0 1.2 1 2.2 2.2 2.2.5 0 1-.2 1.4-.5.9-.6 1.4-1.6 1.4-2.6V9.6c0-.4.1-.6.2-.8.3-.3 1-.3 1.6-.3h.2V7h-.2c-.7 0-1.8 0-2.6.7z"})}),vN=(0,xe.jsx)(ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,xe.jsx)(ye.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9.2 4.5H19c.3 0 .5.2.5.5v8.4l-3-2.9c-.3-.3-.8-.3-1 0L11.9 14 9 12c-.3-.2-.6-.2-.8 0l-3.6 2.6V9.8l4.6-5.3zm9.8 15H5c-.3 0-.5-.2-.5-.5v-2.4l4.1-3 3 1.9c.3.2.7.2.9-.1L16 12l3.5 3.4V19c0 .3-.2.5-.5.5z"})}),nh=(0,xe.jsx)(ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,xe.jsx)(ye.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V9.8l4.7-5.3H19c.3 0 .5.2.5.5v14zM10 15l5-3-5-3v6z"})}),aG={foreground:"#000000",src:(0,xe.jsx)(ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,xe.jsx)(ye.Path,{d:"M13.982 10.622 20.54 3h-1.554l-5.693 6.618L8.745 3H3.5l6.876 10.007L3.5 21h1.554l6.012-6.989L15.868 21h5.245l-7.131-10.378Zm-2.128 2.474-.697-.997-5.543-7.93H8l4.474 6.4.697.996 5.815 8.318h-2.387l-4.745-6.787Z"})})},nG={foreground:"#ff0000",src:(0,xe.jsx)(ye.SVG,{viewBox:"0 0 24 24",children:(0,xe.jsx)(ye.Path,{d:"M21.8 8s-.195-1.377-.795-1.984c-.76-.797-1.613-.8-2.004-.847-2.798-.203-6.996-.203-6.996-.203h-.01s-4.197 0-6.996.202c-.39.046-1.242.05-2.003.846C2.395 6.623 2.2 8 2.2 8S2 9.62 2 11.24v1.517c0 1.618.2 3.237.2 3.237s.195 1.378.795 1.985c.76.797 1.76.77 2.205.855 1.6.153 6.8.2 6.8.2s4.203-.005 7-.208c.392-.047 1.244-.05 2.005-.847.6-.607.795-1.985.795-1.985s.2-1.618.2-3.237v-1.517C22 9.62 21.8 8 21.8 8zM9.935 14.595v-5.62l5.403 2.82-5.403 2.8z"})})},iG={foreground:"#3b5998",src:(0,xe.jsx)(ye.SVG,{viewBox:"0 0 24 24",children:(0,xe.jsx)(ye.Path,{d:"M20 3H4c-.6 0-1 .4-1 1v16c0 .5.4 1 1 1h8.6v-7h-2.3v-2.7h2.3v-2c0-2.3 1.4-3.6 3.5-3.6 1 0 1.8.1 2.1.1v2.4h-1.4c-1.1 0-1.3.5-1.3 1.3v1.7h2.7l-.4 2.8h-2.3v7H20c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1z"})})},lG=(0,xe.jsx)(ye.SVG,{viewBox:"0 0 24 24",children:(0,xe.jsx)(ye.G,{children:(0,xe.jsx)(ye.Path,{d:"M12 4.622c2.403 0 2.688.01 3.637.052.877.04 1.354.187 1.67.31.42.163.72.358 1.036.673.315.315.51.615.673 1.035.123.317.27.794.31 1.67.043.95.052 1.235.052 3.638s-.01 2.688-.052 3.637c-.04.877-.187 1.354-.31 1.67-.163.42-.358.72-.673 1.036-.315.315-.615.51-1.035.673-.317.123-.794.27-1.67.31-.95.043-1.234.052-3.638.052s-2.688-.01-3.637-.052c-.877-.04-1.354-.187-1.67-.31-.42-.163-.72-.358-1.036-.673-.315-.315-.51-.615-.673-1.035-.123-.317-.27-.794-.31-1.67-.043-.95-.052-1.235-.052-3.638s.01-2.688.052-3.637c.04-.877.187-1.354.31-1.67.163-.42.358-.72.673-1.036.315-.315.615-.51 1.035-.673.317-.123.794-.27 1.67-.31.95-.043 1.235-.052 3.638-.052M12 3c-2.444 0-2.75.01-3.71.054s-1.613.196-2.185.418c-.592.23-1.094.538-1.594 1.04-.5.5-.807 1-1.037 1.593-.223.572-.375 1.226-.42 2.184C3.01 9.25 3 9.555 3 12s.01 2.75.054 3.71.196 1.613.418 2.186c.23.592.538 1.094 1.038 1.594s1.002.808 1.594 1.038c.572.222 1.227.375 2.185.418.96.044 1.266.054 3.71.054s2.75-.01 3.71-.054 1.613-.196 2.186-.418c.592-.23 1.094-.538 1.594-1.038s.808-1.002 1.038-1.594c.222-.572.375-1.227.418-2.185.044-.96.054-1.266.054-3.71s-.01-2.75-.054-3.71-.196-1.613-.418-2.186c-.23-.592-.538-1.094-1.038-1.594s-1.002-.808-1.594-1.038c-.572-.222-1.227-.375-2.185-.418C14.75 3.01 14.445 3 12 3zm0 4.378c-2.552 0-4.622 2.07-4.622 4.622s2.07 4.622 4.622 4.622 4.622-2.07 4.622-4.622S14.552 7.378 12 7.378zM12 15c-1.657 0-3-1.343-3-3s1.343-3 3-3 3 1.343 3 3-1.343 3-3 3zm4.804-8.884c-.596 0-1.08.484-1.08 1.08s.484 1.08 1.08 1.08c.596 0 1.08-.484 1.08-1.08s-.483-1.08-1.08-1.08z"})})}),sG={foreground:"#0073AA",src:(0,xe.jsx)(ye.SVG,{viewBox:"0 0 24 24",children:(0,xe.jsx)(ye.G,{children:(0,xe.jsx)(ye.Path,{d:"M12.158 12.786l-2.698 7.84c.806.236 1.657.365 2.54.365 1.047 0 2.05-.18 2.986-.51-.024-.037-.046-.078-.065-.123l-2.762-7.57zM3.008 12c0 3.56 2.07 6.634 5.068 8.092L3.788 8.342c-.5 1.117-.78 2.354-.78 3.658zm15.06-.454c0-1.112-.398-1.88-.74-2.48-.456-.74-.883-1.368-.883-2.11 0-.825.627-1.595 1.51-1.595.04 0 .078.006.116.008-1.598-1.464-3.73-2.36-6.07-2.36-3.14 0-5.904 1.613-7.512 4.053.21.008.41.012.58.012.94 0 2.395-.114 2.395-.114.484-.028.54.684.057.74 0 0-.487.058-1.03.086l3.275 9.74 1.968-5.902-1.4-3.838c-.485-.028-.944-.085-.944-.085-.486-.03-.43-.77.056-.742 0 0 1.484.114 2.368.114.94 0 2.397-.114 2.397-.114.486-.028.543.684.058.74 0 0-.488.058-1.03.086l3.25 9.665.897-2.997c.456-1.17.684-2.137.684-2.907zm1.82-3.86c.04.286.06.593.06.924 0 .912-.17 1.938-.683 3.22l-2.746 7.94c2.672-1.558 4.47-4.454 4.47-7.77 0-1.564-.4-3.033-1.1-4.314zM12 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10z"})})})},cG={foreground:"#1db954",src:(0,xe.jsx)(ye.SVG,{viewBox:"0 0 24 24",children:(0,xe.jsx)(ye.Path,{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2m4.586 14.424c-.18.295-.563.387-.857.207-2.35-1.434-5.305-1.76-8.786-.963-.335.077-.67-.133-.746-.47-.077-.334.132-.67.47-.745 3.808-.87 7.076-.496 9.712 1.115.293.18.386.563.206.857M17.81 13.7c-.226.367-.706.482-1.072.257-2.687-1.652-6.785-2.13-9.965-1.166-.413.127-.848-.106-.973-.517-.125-.413.108-.848.52-.973 3.632-1.102 8.147-.568 11.234 1.328.366.226.48.707.256 1.072m.105-2.835C14.692 8.95 9.375 8.775 6.297 9.71c-.493.15-1.016-.13-1.166-.624-.148-.495.13-1.017.625-1.167 3.532-1.073 9.404-.866 13.115 1.337.445.264.59.838.327 1.282-.264.443-.838.59-1.282.325"})})},uG=(0,xe.jsx)(ye.SVG,{viewBox:"0 0 24 24",children:(0,xe.jsx)(ye.Path,{d:"m6.5 7c-2.75 0-5 2.25-5 5s2.25 5 5 5 5-2.25 5-5-2.25-5-5-5zm11 0c-2.75 0-5 2.25-5 5s2.25 5 5 5 5-2.25 5-5-2.25-5-5-5z"})}),mG={foreground:"#1ab7ea",src:(0,xe.jsx)(ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,xe.jsx)(ye.G,{children:(0,xe.jsx)(ye.Path,{d:"M22.396 7.164c-.093 2.026-1.507 4.8-4.245 8.32C15.323 19.16 12.93 21 10.97 21c-1.214 0-2.24-1.12-3.08-3.36-.56-2.052-1.118-4.105-1.68-6.158-.622-2.24-1.29-3.36-2.004-3.36-.156 0-.7.328-1.634.98l-.978-1.26c1.027-.903 2.04-1.806 3.037-2.71C6 3.95 7.03 3.328 7.716 3.265c1.62-.156 2.616.95 2.99 3.32.404 2.558.685 4.148.84 4.77.468 2.12.982 3.18 1.543 3.18.435 0 1.09-.687 1.963-2.064.872-1.376 1.34-2.422 1.402-3.142.125-1.187-.343-1.782-1.4-1.782-.5 0-1.013.115-1.542.34 1.023-3.35 2.977-4.976 5.862-4.883 2.14.063 3.148 1.45 3.024 4.16z"})})})},pG=(0,xe.jsx)(ye.SVG,{viewBox:"0 0 24 24",children:(0,xe.jsx)(ye.Path,{d:"M22 12.068a2.184 2.184 0 0 0-2.186-2.186c-.592 0-1.13.233-1.524.609-1.505-1.075-3.566-1.774-5.86-1.864l1.004-4.695 3.261.699A1.56 1.56 0 1 0 18.255 3c-.61-.001-1.147.357-1.398.877l-3.638-.77a.382.382 0 0 0-.287.053.348.348 0 0 0-.161.251l-1.112 5.233c-2.33.072-4.426.77-5.95 1.864a2.201 2.201 0 0 0-1.523-.61 2.184 2.184 0 0 0-.896 4.176c-.036.215-.053.43-.053.663 0 3.37 3.924 6.111 8.763 6.111s8.763-2.724 8.763-6.11c0-.216-.017-.449-.053-.664A2.207 2.207 0 0 0 22 12.068Zm-15.018 1.56a1.56 1.56 0 0 1 3.118 0c0 .86-.699 1.558-1.559 1.558-.86.018-1.559-.699-1.559-1.559Zm8.728 4.139c-1.076 1.075-3.119 1.147-3.71 1.147-.61 0-2.652-.09-3.71-1.147a.4.4 0 0 1 0-.573.4.4 0 0 1 .574 0c.68.68 2.114.914 3.136.914 1.022 0 2.473-.233 3.136-.914a.4.4 0 0 1 .574 0 .436.436 0 0 1 0 .573Zm-.287-2.563a1.56 1.56 0 0 1 0-3.118c.86 0 1.56.699 1.56 1.56 0 .841-.7 1.558-1.56 1.558Z"})}),dG={foreground:"#35465c",src:(0,xe.jsx)(ye.SVG,{viewBox:"0 0 24 24",children:(0,xe.jsx)(ye.Path,{d:"M19 3H5a2 2 0 00-2 2v14c0 1.1.9 2 2 2h14a2 2 0 002-2V5a2 2 0 00-2-2zm-5.69 14.66c-2.72 0-3.1-1.9-3.1-3.16v-3.56H8.49V8.99c1.7-.62 2.54-1.99 2.64-2.87 0-.06.06-.41.06-.58h1.9v3.1h2.17v2.3h-2.18v3.1c0 .47.13 1.3 1.2 1.26h1.1v2.36c-1.01.02-2.07 0-2.07 0z"})})},fG=(0,xe.jsxs)(ye.SVG,{viewBox:"0 0 24 24",children:[(0,xe.jsx)(ye.Path,{d:"M18.42 14.58c-.51-.66-1.05-1.23-1.05-2.5V7.87c0-1.8.15-3.45-1.2-4.68-1.05-1.02-2.79-1.35-4.14-1.35-2.6 0-5.52.96-6.12 4.14-.06.36.18.54.4.57l2.66.3c.24-.03.42-.27.48-.5.24-1.12 1.17-1.63 2.2-1.63.56 0 1.22.21 1.55.7.4.56.33 1.31.33 1.97v.36c-1.59.18-3.66.27-5.16.93a4.63 4.63 0 0 0-2.93 4.44c0 2.82 1.8 4.23 4.1 4.23 1.95 0 3.03-.45 4.53-1.98.51.72.66 1.08 1.59 1.83.18.09.45.09.63-.1v.04l2.1-1.8c.24-.21.2-.48.03-.75zm-5.4-1.2c-.45.75-1.14 1.23-1.92 1.23-1.05 0-1.65-.81-1.65-1.98 0-2.31 2.1-2.73 4.08-2.73v.6c0 1.05.03 1.92-.5 2.88z"}),(0,xe.jsx)(ye.Path,{d:"M21.69 19.2a17.62 17.62 0 0 1-21.6-1.57c-.23-.2 0-.5.28-.33a23.88 23.88 0 0 0 20.93 1.3c.45-.19.84.3.39.6z"}),(0,xe.jsx)(ye.Path,{d:"M22.8 17.96c-.36-.45-2.22-.2-3.1-.12-.23.03-.3-.18-.05-.36 1.5-1.05 3.96-.75 4.26-.39.3.36-.1 2.82-1.5 4.02-.21.18-.42.1-.3-.15.3-.8 1.02-2.58.69-3z"})]}),hG=(0,xe.jsxs)(ye.SVG,{viewBox:"0 0 24 24",children:[(0,xe.jsx)(ye.Path,{d:"m.0206909 21 19.8160091-13.07806 3.5831 6.20826z",fill:"#4bc7ee"}),(0,xe.jsx)(ye.Path,{d:"m23.7254 19.0205-10.1074-17.18468c-.6421-1.114428-1.7087-1.114428-2.3249 0l-11.2931 19.16418h22.5655c1.279 0 1.8019-.8905 1.1599-1.9795z",fill:"#d4cdcb"}),(0,xe.jsx)(ye.Path,{d:"m.0206909 21 15.2439091-16.38571 4.3029 7.32271z",fill:"#c3d82e"}),(0,xe.jsx)(ye.Path,{d:"m13.618 1.83582c-.6421-1.114428-1.7087-1.114428-2.3249 0l-11.2931 19.16418 15.2646-16.38573z",fill:"#e4ecb0"}),(0,xe.jsx)(ye.Path,{d:"m.0206909 21 19.5468091-9.063 1.6621 2.8344z",fill:"#209dbd"}),(0,xe.jsx)(ye.Path,{d:"m.0206909 21 17.9209091-11.82623 1.6259 2.76323z",fill:"#7cb3c9"})]}),gG=(0,xe.jsx)(ye.SVG,{viewBox:"0 0 24 24",children:(0,xe.jsx)(ye.Path,{d:"M11.903 16.568c-1.82 0-3.124-1.281-3.124-2.967a2.987 2.987 0 0 1 2.989-2.989c1.663 0 2.944 1.304 2.944 3.034 0 1.663-1.281 2.922-2.81 2.922ZM17.997 3l-3.308.73v5.107c-.809-1.034-2.045-1.37-3.505-1.37-1.529 0-2.9.561-4.023 1.662-1.259 1.214-1.933 2.764-1.933 4.495 0 1.888.72 3.506 2.113 4.742 1.056.944 2.314 1.415 3.775 1.415 1.438 0 2.517-.382 3.573-1.415v1.415h3.308V3Z",fill:"#333436"})}),vG=(0,xe.jsx)(ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,xe.jsx)(ye.Path,{d:"M12.289,2C6.617,2,3.606,5.648,3.606,9.622c0,1.846,1.025,4.146,2.666,4.878c0.25,0.111,0.381,0.063,0.439-0.169 c0.044-0.175,0.267-1.029,0.365-1.428c0.032-0.128,0.017-0.237-0.091-0.362C6.445,11.911,6.01,10.75,6.01,9.668 c0-2.777,2.194-5.464,5.933-5.464c3.23,0,5.49,2.108,5.49,5.122c0,3.407-1.794,5.768-4.13,5.768c-1.291,0-2.257-1.021-1.948-2.277 c0.372-1.495,1.089-3.112,1.089-4.191c0-0.967-0.542-1.775-1.663-1.775c-1.319,0-2.379,1.309-2.379,3.059 c0,1.115,0.394,1.869,0.394,1.869s-1.302,5.279-1.54,6.261c-0.405,1.666,0.053,4.368,0.094,4.604 c0.021,0.126,0.167,0.169,0.25,0.063c0.129-0.165,1.699-2.419,2.142-4.051c0.158-0.59,0.817-2.995,0.817-2.995 c0.43,0.784,1.681,1.446,3.013,1.446c3.963,0,6.822-3.494,6.822-7.833C20.394,5.112,16.849,2,12.289,2"})}),bG=(0,xe.jsx)(ye.SVG,{viewBox:"0 0 44 44",children:(0,xe.jsx)(ye.Path,{d:"M32.59521,22.001l4.31885-4.84473-6.34131-1.38379.646-6.459-5.94336,2.61035L22,6.31934l-3.27344,5.60351L12.78418,9.3125l.645,6.458L7.08643,17.15234,11.40479,21.999,7.08594,26.84375l6.34131,1.38379-.64551,6.458,5.94287-2.60938L22,37.68066l3.27344-5.60351,5.94287,2.61035-.64551-6.458,6.34277-1.38183Zm.44385,2.75244L30.772,23.97827l-1.59558-2.07391,1.97888.735Zm-8.82147,6.1579L22.75,33.424V30.88977l1.52228-2.22168ZM18.56226,13.48816,19.819,15.09534l-2.49219-.88642L15.94037,12.337Zm6.87719.00116,2.62043-1.15027-1.38654,1.86981L24.183,15.0946Zm3.59357,2.6029-1.22546,1.7381.07525-2.73486,1.44507-1.94867ZM22,29.33008l-2.16406-3.15686L22,23.23688l2.16406,2.93634Zm-4.25458-9.582-.10528-3.836,3.60986,1.284v3.73242Zm5.00458-2.552,3.60986-1.284-.10528,3.836L22.75,20.92853Zm-7.78174-1.10559-.29352-2.94263,1.44245,1.94739.07519,2.73321Zm2.30982,5.08319,3.50817,1.18164-2.16247,2.9342-3.678-1.08447Zm2.4486,7.49285L21.25,30.88977v2.53485L19.78052,30.91Zm3.48707-6.31121,3.50817-1.18164,2.33228,3.03137-3.678,1.08447Zm10.87219-4.28113-2.714,3.04529L28.16418,19.928l1.92176-2.72565ZM24.06036,12.81769l-2.06012,2.6322-2.059-2.63318L22,9.292ZM9.91455,18.07227l4.00079-.87195,1.921,2.72735-3.20794,1.19019Zm2.93024,4.565,1.9801-.73462L13.228,23.97827l-2.26838.77429Zm-1.55591,3.58819L13.701,25.4021l2.64935.78058-2.14447.67853Zm3.64868,1.977L18.19,27.17334l.08313,3.46332L14.52979,32.2793Zm10.7876,2.43549.08447-3.464,3.25165,1.03052.407,4.07684Zm4.06824-3.77478-2.14545-.68,2.65063-.781,2.41266.825Z"})}),yG={foreground:"#f43e37",src:(0,xe.jsxs)(ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,xe.jsx)(ye.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M24,12A12,12,0,1,1,12,0,12,12,0,0,1,24,12Z"}),(0,xe.jsx)(ye.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M2.67,12a9.33,9.33,0,0,1,18.66,0H19a7,7,0,1,0-7,7v2.33A9.33,9.33,0,0,1,2.67,12ZM12,17.6A5.6,5.6,0,1,1,17.6,12h-2A3.56,3.56,0,1,0,12,15.56Z",fill:"#fff"})]})},_G=(0,xe.jsx)(ye.SVG,{viewBox:"0 0 24 24",children:(0,xe.jsx)(ye.Path,{fill:"#0a7aff",d:"M6.3,4.2c2.3,1.7,4.8,5.3,5.7,7.2.9-1.9,3.4-5.4,5.7-7.2,1.7-1.3,4.3-2.2,4.3.9s-.4,5.2-.6,5.9c-.7,2.6-3.3,3.2-5.6,2.8,4,.7,5.1,3,2.9,5.3-5,5.2-6.7-2.8-6.7-2.8,0,0-1.7,8-6.7,2.8-2.2-2.3-1.2-4.6,2.9-5.3-2.3.4-4.9-.3-5.6-2.8-.2-.7-.6-5.3-.6-5.9,0-3.1,2.7-2.1,4.3-.9h0Z"})});var xG=o(M(),1),bN=o(v(),1),S1e=()=>(0,bN.jsx)("div",{className:"wp-block-embed is-loading",children:(0,bN.jsx)(xG.Spinner,{})}),kG=S1e;var Os=o(P(),1),Ln=o(M(),1),wG=o(T(),1),Dn=o(v(),1),T1e=({icon:e,label:t,value:r,onSubmit:a,onChange:n,cannotEmbed:i,fallback:l,tryAgain:s})=>(0,Dn.jsxs)(Ln.Placeholder,{icon:(0,Dn.jsx)(wG.BlockIcon,{icon:e,showColors:!0}),label:t,className:"wp-block-embed",instructions:(0,Os.__)("Paste a link to the content you want to display on your site."),children:[(0,Dn.jsxs)("form",{onSubmit:a,children:[(0,Dn.jsx)(Ln.__experimentalInputControl,{__next40pxDefaultSize:!0,type:"url",value:r||"",className:"wp-block-embed__placeholder-input",label:t,hideLabelFromVision:!0,placeholder:(0,Os.__)("Enter URL to embed here\u2026"),onChange:n}),(0,Dn.jsx)(Ln.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",children:(0,Os._x)("Embed","button label")})]}),(0,Dn.jsx)("div",{className:"wp-block-embed__learn-more",children:(0,Dn.jsx)(Ln.ExternalLink,{href:(0,Os.__)("https://wordpress.org/documentation/article/embeds/"),children:(0,Os.__)("Learn more about embeds")})}),i&&(0,Dn.jsxs)(Ln.__experimentalVStack,{spacing:3,className:"components-placeholder__error",children:[(0,Dn.jsx)("div",{className:"components-placeholder__instructions",children:(0,Os.__)("Sorry, this content could not be embedded.")}),(0,Dn.jsxs)(Ln.__experimentalHStack,{expanded:!1,spacing:3,justify:"flex-start",children:[(0,Dn.jsx)(Ln.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:s,children:(0,Os._x)("Try again","button label")})," ",(0,Dn.jsx)(Ln.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:l,children:(0,Os._x)("Convert to link","button label")})]})]})]}),CG=T1e;var lh=o(P(),1),y5=o(M(),1),TG=o(T(),1),PG=o(U(),1),BG=o(mr(),1);var b5=o(me(),1),ih=o(U(),1),yN=o(v(),1),P1e={class:"className",frameborder:"frameBorder",marginheight:"marginHeight",marginwidth:"marginWidth"};function SG({html:e}){let t=(0,ih.useRef)(),r=(0,ih.useMemo)(()=>{let n=new window.DOMParser().parseFromString(e,"text/html").querySelector("iframe"),i={};return n&&Array.from(n.attributes).forEach(({name:l,value:s})=>{l!=="style"&&(i[P1e[l]||l]=s)}),i},[e]);return(0,ih.useEffect)(()=>{let{ownerDocument:a}=t.current,{defaultView:n}=a;function i({data:{secret:l,message:s,value:c}={}}){s!=="height"||l!==r["data-secret"]||(t.current.height=c)}return n.addEventListener("message",i),()=>{n.removeEventListener("message",i)}},[]),(0,yN.jsx)("div",{className:"wp-block-embed__wrapper",children:(0,yN.jsx)("iframe",{ref:(0,b5.useMergeRefs)([t,(0,b5.useFocusableIframe)()]),title:r.title,...r})})}var Mn=o(v(),1);function IG({preview:e,previewable:t,url:r,type:a,isSelected:n,className:i,icon:l,label:s}){let[c,u]=(0,PG.useState)(!1);!n&&c&&u(!1);let m=()=>{u(!0)},{scripts:p}=e,d=a==="photo"?pF(e):e.html,f=(0,BG.getAuthority)(r),h=(0,lh.sprintf)((0,lh.__)("Embedded content from %s"),f),g=w(a,i,"wp-block-embed__wrapper");return(0,Mn.jsx)(Mn.Fragment,{children:t?a==="wp-embed"?(0,Mn.jsx)(SG,{html:d}):(0,Mn.jsxs)("div",{className:"wp-block-embed__wrapper",children:[(0,Mn.jsx)(y5.SandBox,{allowSameOrigin:!0,html:d,scripts:p,title:h,type:g,onFocus:m}),!c&&(0,Mn.jsx)("div",{className:"block-library-embed__interactive-overlay",onMouseUp:m})]}):(0,Mn.jsxs)(y5.Placeholder,{icon:(0,Mn.jsx)(TG.BlockIcon,{icon:l,showColors:!0}),label:s,children:[(0,Mn.jsx)("p",{className:"components-placeholder__error",children:(0,Mn.jsx)("a",{href:r,children:r})}),(0,Mn.jsx)("p",{className:"components-placeholder__error",children:(0,lh.sprintf)((0,lh.__)("Embedded content from %s can't be previewed in the editor."),f)})]})})}var ed=o(P(),1),Jp=o(U(),1),_5=o(V(),1),NG=o(T(),1),_N=o(Q(),1),xN=o(L(),1),EG=o(mr(),1);var gi=o(v(),1),B1e=e=>{let{attributes:{providerNameSlug:t,previewable:r,responsive:a,url:n},attributes:i,isSelected:l,onReplace:s,setAttributes:c,insertBlocksAfter:u,onFocus:m}=e,p={title:(0,ed._x)("Embed","block title"),icon:Gl},{icon:d,title:f}=uF(t)||p,[h,g]=(0,Jp.useState)(n),[b,y]=(0,Jp.useState)(!1),{invalidateResolution:k}=(0,_5.useDispatch)(_N.store),{preview:_,fetching:x,themeSupportsResponsive:S,cannotEmbed:C,hasResolved:N}=(0,_5.useSelect)(G=>{let{getEmbedPreview:O,isPreviewEmbedFallback:J,isRequestingEmbedPreview:ee,getThemeSupports:oe,hasFinishedResolution:X}=G(_N.store);if(!n)return{fetching:!1,cannotEmbed:!1};let te=O(n),ne=J(n),le=te?.html===!1&&te?.type===void 0,pe=te?.data?.status===404,Ie=!!te&&!le&&!pe;return{preview:Ie?te:void 0,fetching:ee(n),themeSupportsResponsive:oe()["responsive-embeds"],cannotEmbed:!Ie||ne,hasResolved:X("getEmbedPreview",[n])}},[n]),B=()=>fF(i,_,f,a);function D(G){let{className:O}=i,{html:J}=_;c({allowResponsive:G,className:tI(J,O,a&&G)})}(0,Jp.useEffect)(()=>{if(_?.html||!C||!N)return;let G=n.replace(/\/$/,"");g(G),y(!1),c({url:G})},[_?.html,n,C,N,c]),(0,Jp.useEffect)(()=>{if(!(!C||x||!h)&&(0,EG.getAuthority)(h)==="x.com"){let G=new URL(h);G.host="twitter.com",c({url:G.toString()})}},[h,C,x,c]),(0,Jp.useEffect)(()=>{if(_&&!b){let G=B();if(Object.keys(G).some(J=>G[J]!==i[J])&&c(G),s){let J=Yu(e,G);J&&s(J)}}},[_,b]);let A=(0,NG.useBlockProps)();if(x)return(0,gi.jsx)(xN.View,{...A,children:(0,gi.jsx)(kG,{})});let H=(0,ed.sprintf)((0,ed.__)("%s URL"),f);if(!_||C||b)return(0,gi.jsx)(xN.View,{...A,children:(0,gi.jsx)(CG,{icon:d,label:H,onFocus:m,onSubmit:G=>{G&&G.preventDefault();let O=Qu(i.className);y(!1),c({url:h,className:O})},value:h,cannotEmbed:C,onChange:G=>g(G),fallback:()=>dF(h,s),tryAgain:()=>{k("getEmbedPreview",[h])}})});let{caption:z,type:I,allowResponsive:R,className:$}=B(),j=w($,e.className);return(0,gi.jsxs)(gi.Fragment,{children:[(0,gi.jsx)(oG,{showEditButton:_&&!C,themeSupportsResponsive:S,blockSupportsResponsive:a,allowResponsive:R,toggleResponsive:D,switchBackToURLInput:()=>y(!0)}),(0,gi.jsxs)("figure",{...A,className:w(A.className,j,{[`is-type-${I}`]:I,[`is-provider-${t}`]:t,[`wp-block-embed-${t}`]:t}),children:[(0,gi.jsx)(IG,{preview:_,previewable:r,className:j,url:h,type:I,caption:z,onCaptionChange:G=>c({caption:G}),isSelected:l,icon:d,label:H,insertBlocksAfter:u,attributes:i,setAttributes:c}),(0,gi.jsx)(_a,{attributes:i,setAttributes:c,isSelected:l,insertBlocksAfter:u,label:(0,ed.__)("Embed caption text"),showToolbarButton:l})]})]})},DG=B1e;var td=o(T(),1),ev=o(v(),1);function LG({attributes:e}){let{url:t,caption:r,type:a,providerNameSlug:n}=e;if(!t)return null;let i=w("wp-block-embed",{[`is-type-${a}`]:a,[`is-provider-${n}`]:n,[`wp-block-embed-${n}`]:n});return(0,ev.jsxs)("figure",{...td.useBlockProps.save({className:i}),children:[(0,ev.jsx)("div",{className:"wp-block-embed__wrapper",children:` ${t} `}),!td.RichText.isEmpty(r)&&(0,ev.jsx)(td.RichText.Content,{className:(0,td.__experimentalGetElementClassName)("caption"),tagName:"figcaption",value:r})]})}var kN=o(W(),1);var{name:I1e}=Ls,N1e={from:[{type:"raw",isMatch:e=>e.nodeName==="P"&&/^\s*(https?:\/\/\S+)\s*$/i.test(e.textContent)&&e.textContent?.match(/https/gi)?.length===1,transform:e=>(0,kN.createBlock)(I1e,{url:e.textContent.trim()})}],to:[{type:"block",blocks:["core/paragraph"],isMatch:({url:e})=>!!e,transform:({url:e,caption:t,className:r})=>{let a=`<a href="${e}">${e}</a>`;return t?.trim()&&(a+=`<br />${t}`),(0,kN.createBlock)("core/paragraph",{content:a,className:Qu(r)})}}]},MG=N1e;var ue=o(P(),1);function ft(e){return(0,ue.sprintf)((0,ue.__)("%s Embed"),e)}var AG=[{name:"twitter",title:ft("X"),icon:aG,keywords:["x","twitter","tweet",(0,ue.__)("social")],description:(0,ue.__)("Embed an X post."),patterns:[/^https?:\/\/(www\.)?twitter\.com\/.+/i],attributes:{providerNameSlug:"twitter",responsive:!0}},{name:"youtube",title:ft("YouTube"),icon:nG,keywords:[(0,ue.__)("music"),(0,ue.__)("video")],description:(0,ue.__)("Embed a YouTube video."),patterns:[/^https?:\/\/((m|www)\.)?youtube\.com\/.+/i,/^https?:\/\/youtu\.be\/.+/i],attributes:{providerNameSlug:"youtube",responsive:!0}},{name:"facebook",title:ft("Facebook"),icon:iG,keywords:[(0,ue.__)("social")],description:(0,ue.__)("Embed a Facebook post."),scope:["block"],patterns:[],attributes:{providerNameSlug:"facebook",previewable:!1,responsive:!0}},{name:"instagram",title:ft("Instagram"),icon:lG,keywords:[(0,ue.__)("image"),(0,ue.__)("social")],description:(0,ue.__)("Embed an Instagram post."),scope:["block"],patterns:[],attributes:{providerNameSlug:"instagram",responsive:!0}},{name:"wordpress",title:ft("WordPress"),icon:sG,keywords:[(0,ue.__)("post"),(0,ue.__)("blog")],description:(0,ue.__)("Embed a WordPress post."),attributes:{providerNameSlug:"wordpress"}},{name:"soundcloud",title:ft("SoundCloud"),icon:v5,keywords:[(0,ue.__)("music"),(0,ue.__)("audio")],description:(0,ue.__)("Embed SoundCloud content."),patterns:[/^https?:\/\/(www\.)?soundcloud\.com\/.+/i],attributes:{providerNameSlug:"soundcloud",responsive:!0}},{name:"spotify",title:ft("Spotify"),icon:cG,keywords:[(0,ue.__)("music"),(0,ue.__)("audio")],description:(0,ue.__)("Embed Spotify content."),patterns:[/^https?:\/\/(open|play)\.spotify\.com\/.+/i],attributes:{providerNameSlug:"spotify",responsive:!0}},{name:"flickr",title:ft("Flickr"),icon:uG,keywords:[(0,ue.__)("image")],description:(0,ue.__)("Embed Flickr content."),patterns:[/^https?:\/\/(www\.)?flickr\.com\/.+/i,/^https?:\/\/flic\.kr\/.+/i],attributes:{providerNameSlug:"flickr",responsive:!0}},{name:"vimeo",title:ft("Vimeo"),icon:mG,keywords:[(0,ue.__)("video")],description:(0,ue.__)("Embed a Vimeo video."),patterns:[/^https?:\/\/(www\.)?vimeo\.com\/.+/i],attributes:{providerNameSlug:"vimeo",responsive:!0}},{name:"animoto",title:ft("Animoto"),icon:hG,description:(0,ue.__)("Embed an Animoto video."),patterns:[/^https?:\/\/(www\.)?(animoto|video214)\.com\/.+/i],attributes:{providerNameSlug:"animoto",responsive:!0}},{name:"cloudup",title:ft("Cloudup"),icon:Gl,description:(0,ue.__)("Embed Cloudup content."),patterns:[/^https?:\/\/cloudup\.com\/.+/i],attributes:{providerNameSlug:"cloudup",responsive:!0}},{name:"collegehumor",title:ft("CollegeHumor"),icon:nh,description:(0,ue.__)("Embed CollegeHumor content."),scope:["block"],patterns:[],attributes:{providerNameSlug:"collegehumor",responsive:!0}},{name:"crowdsignal",title:ft("Crowdsignal"),icon:Gl,keywords:["polldaddy",(0,ue.__)("survey")],description:(0,ue.__)("Embed Crowdsignal (formerly Polldaddy) content."),patterns:[/^https?:\/\/((.+\.)?polldaddy\.com|poll\.fm|.+\.crowdsignal\.net|.+\.survey\.fm)\/.+/i],attributes:{providerNameSlug:"crowdsignal",responsive:!0}},{name:"dailymotion",title:ft("Dailymotion"),icon:gG,keywords:[(0,ue.__)("video")],description:(0,ue.__)("Embed a Dailymotion video."),patterns:[/^https?:\/\/(www\.)?dailymotion\.com\/.+/i],attributes:{providerNameSlug:"dailymotion",responsive:!0}},{name:"imgur",title:ft("Imgur"),icon:vN,description:(0,ue.__)("Embed Imgur content."),patterns:[/^https?:\/\/(.+\.)?imgur\.com\/.+/i],attributes:{providerNameSlug:"imgur",responsive:!0}},{name:"issuu",title:ft("Issuu"),icon:Gl,description:(0,ue.__)("Embed Issuu content."),patterns:[/^https?:\/\/(www\.)?issuu\.com\/.+/i],attributes:{providerNameSlug:"issuu",responsive:!0}},{name:"kickstarter",title:ft("Kickstarter"),icon:Gl,description:(0,ue.__)("Embed Kickstarter content."),patterns:[/^https?:\/\/(www\.)?kickstarter\.com\/.+/i,/^https?:\/\/kck\.st\/.+/i],attributes:{providerNameSlug:"kickstarter",responsive:!0}},{name:"mixcloud",title:ft("Mixcloud"),icon:v5,keywords:[(0,ue.__)("music"),(0,ue.__)("audio")],description:(0,ue.__)("Embed Mixcloud content."),patterns:[/^https?:\/\/(www\.)?mixcloud\.com\/.+/i],attributes:{providerNameSlug:"mixcloud",responsive:!0}},{name:"pocket-casts",title:ft("Pocket Casts"),icon:yG,keywords:[(0,ue.__)("podcast"),(0,ue.__)("audio")],description:(0,ue.__)("Embed a podcast player from Pocket Casts."),patterns:[/^https:\/\/pca.st\/\w+/i],attributes:{providerNameSlug:"pocket-casts",responsive:!0}},{name:"reddit",title:ft("Reddit"),icon:pG,description:(0,ue.__)("Embed a Reddit thread."),patterns:[/^https?:\/\/(www\.)?reddit\.com\/.+/i],attributes:{providerNameSlug:"reddit",responsive:!0}},{name:"reverbnation",title:ft("ReverbNation"),icon:v5,description:(0,ue.__)("Embed ReverbNation content."),patterns:[/^https?:\/\/(www\.)?reverbnation\.com\/.+/i],attributes:{providerNameSlug:"reverbnation",responsive:!0}},{name:"scribd",title:ft("Scribd"),icon:Gl,description:(0,ue.__)("Embed Scribd content."),patterns:[/^https?:\/\/(www\.)?scribd\.com\/.+/i],attributes:{providerNameSlug:"scribd",responsive:!0}},{name:"smugmug",title:ft("SmugMug"),icon:vN,description:(0,ue.__)("Embed SmugMug content."),patterns:[/^https?:\/\/(.+\.)?smugmug\.com\/.*/i],attributes:{providerNameSlug:"smugmug",previewable:!1,responsive:!0}},{name:"speaker-deck",title:ft("Speaker Deck"),icon:Gl,description:(0,ue.__)("Embed Speaker Deck content."),patterns:[/^https?:\/\/(www\.)?speakerdeck\.com\/.+/i],attributes:{providerNameSlug:"speaker-deck",responsive:!0}},{name:"tiktok",title:ft("TikTok"),icon:nh,keywords:[(0,ue.__)("video")],description:(0,ue.__)("Embed a TikTok video."),patterns:[/^https?:\/\/(www\.)?tiktok\.com\/.+/i],attributes:{providerNameSlug:"tiktok",responsive:!0}},{name:"ted",title:ft("TED"),icon:nh,description:(0,ue.__)("Embed a TED video."),patterns:[/^https?:\/\/(www\.|embed\.)?ted\.com\/.+/i],attributes:{providerNameSlug:"ted",responsive:!0}},{name:"tumblr",title:ft("Tumblr"),icon:dG,keywords:[(0,ue.__)("social")],description:(0,ue.__)("Embed a Tumblr post."),patterns:[/^https?:\/\/(.+)\.tumblr\.com\/.+/i],attributes:{providerNameSlug:"tumblr",responsive:!0}},{name:"videopress",title:ft("VideoPress"),icon:nh,keywords:[(0,ue.__)("video")],description:(0,ue.__)("Embed a VideoPress video."),patterns:[/^https?:\/\/videopress\.com\/.+/i],attributes:{providerNameSlug:"videopress",responsive:!0}},{name:"wordpress-tv",title:ft("WordPress.tv"),icon:nh,description:(0,ue.__)("Embed a WordPress.tv video."),patterns:[/^https?:\/\/wordpress\.tv\/.+/i],attributes:{providerNameSlug:"wordpress-tv",responsive:!0}},{name:"amazon-kindle",title:ft("Amazon Kindle"),icon:fG,keywords:[(0,ue.__)("ebook")],description:(0,ue.__)("Embed Amazon Kindle content."),patterns:[/^https?:\/\/([a-z0-9-]+\.)?(amazon|amzn)(\.[a-z]{2,4})+\/.+/i,/^https?:\/\/(www\.)?(a\.co|z\.cn)\/.+/i],attributes:{providerNameSlug:"amazon-kindle"}},{name:"pinterest",title:ft("Pinterest"),icon:vG,keywords:[(0,ue.__)("social"),(0,ue.__)("bookmark")],description:(0,ue.__)("Embed Pinterest pins, boards, and profiles."),patterns:[/^https?:\/\/([a-z]{2}|www)\.pinterest\.com(\.(au|mx))?\/.*/i],attributes:{providerNameSlug:"pinterest"}},{name:"wolfram-cloud",title:ft("Wolfram"),icon:bG,description:(0,ue.__)("Embed Wolfram notebook content."),patterns:[/^https?:\/\/(www\.)?wolframcloud\.com\/obj\/.+/i],attributes:{providerNameSlug:"wolfram-cloud",responsive:!0}},{name:"bluesky",title:ft("Bluesky"),icon:_G,description:(0,ue.__)("Embed a Bluesky post."),patterns:[/^https?:\/\/bsky\.app\/profile\/.+\/post\/.+/i],attributes:{providerNameSlug:"bluesky"}}];AG.forEach(e=>{e.isActive||(e.isActive=(t,r)=>t.providerNameSlug===r.providerNameSlug)});var RG=AG;var rd=o(T(),1),od=o(v(),1),{attributes:zG}=Ls,E1e={attributes:zG,save({attributes:e}){let{url:t,caption:r,type:a,providerNameSlug:n}=e;if(!t)return null;let i=w("wp-block-embed",{[`is-type-${a}`]:a,[`is-provider-${n}`]:n,[`wp-block-embed-${n}`]:n});return(0,od.jsxs)("figure",{...rd.useBlockProps.save({className:i}),children:[(0,od.jsx)("div",{className:"wp-block-embed__wrapper",children:` ${t} `}),!rd.RichText.isEmpty(r)&&(0,od.jsx)(rd.RichText.Content,{tagName:"figcaption",value:r})]})}},D1e={attributes:zG,save({attributes:{url:e,caption:t,type:r,providerNameSlug:a}}){if(!e)return null;let n=w("wp-block-embed",{[`is-type-${r}`]:r,[`is-provider-${a}`]:a});return(0,od.jsxs)("figure",{className:n,children:[` ${e} `,!rd.RichText.isEmpty(t)&&(0,od.jsx)(rd.RichText.Content,{tagName:"figcaption",value:t})]})}},L1e=[E1e,D1e],VG=L1e;var{name:FG}=Ls,HG={icon:Gl,edit:DG,save:LG,transforms:MG,variations:RG,deprecated:VG},M1e=()=>E({name:FG,metadata:Ls,settings:HG});var PN={};Z(PN,{init:()=>W1e,metadata:()=>w5,name:()=>eW,settings:()=>T5});var uh=o(P(),1);var JG=o(W(),1);var fo=o(T(),1),Wl=o(P(),1),Gt=o(v(),1),A1e={attributes:{id:{type:"number"},href:{type:"string"},fileId:{type:"string",source:"attribute",selector:"a:not([download])",attribute:"id"},fileName:{type:"string",source:"html",selector:"a:not([download])"},textLinkHref:{type:"string",source:"attribute",selector:"a:not([download])",attribute:"href"},textLinkTarget:{type:"string",source:"attribute",selector:"a:not([download])",attribute:"target"},showDownloadButton:{type:"boolean",default:!0},downloadButtonText:{type:"string",source:"html",selector:"a[download]"},displayPreview:{type:"boolean"},previewHeight:{type:"number",default:600}},supports:{anchor:!0,align:!0},save({attributes:e}){let{href:t,fileId:r,fileName:a,textLinkHref:n,textLinkTarget:i,showDownloadButton:l,downloadButtonText:s,displayPreview:c,previewHeight:u}=e,m=fo.RichText.isEmpty(a)?(0,Wl.__)("PDF embed"):(0,Wl.sprintf)((0,Wl.__)("Embed of %s."),a),p=!fo.RichText.isEmpty(a),d=p?r:void 0;return t&&(0,Gt.jsxs)("div",{...fo.useBlockProps.save(),children:[c&&(0,Gt.jsx)(Gt.Fragment,{children:(0,Gt.jsx)("object",{className:"wp-block-file__embed",data:t,type:"application/pdf",style:{width:"100%",height:`${u}px`},"aria-label":m})}),p&&(0,Gt.jsx)("a",{id:d,href:n,target:i,rel:i?"noreferrer noopener":void 0,children:(0,Gt.jsx)(fo.RichText.Content,{value:a})}),l&&(0,Gt.jsx)("a",{href:t,className:w("wp-block-file__button",(0,fo.__experimentalGetElementClassName)("button")),download:!0,"aria-describedby":d,children:(0,Gt.jsx)(fo.RichText.Content,{value:s})})]})}},R1e={attributes:{id:{type:"number"},href:{type:"string"},fileId:{type:"string",source:"attribute",selector:"a:not([download])",attribute:"id"},fileName:{type:"string",source:"html",selector:"a:not([download])"},textLinkHref:{type:"string",source:"attribute",selector:"a:not([download])",attribute:"href"},textLinkTarget:{type:"string",source:"attribute",selector:"a:not([download])",attribute:"target"},showDownloadButton:{type:"boolean",default:!0},downloadButtonText:{type:"string",source:"html",selector:"a[download]"},displayPreview:{type:"boolean"},previewHeight:{type:"number",default:600}},supports:{anchor:!0,align:!0},save({attributes:e}){let{href:t,fileId:r,fileName:a,textLinkHref:n,textLinkTarget:i,showDownloadButton:l,downloadButtonText:s,displayPreview:c,previewHeight:u}=e,m=fo.RichText.isEmpty(a)?(0,Wl.__)("PDF embed"):(0,Wl.sprintf)((0,Wl.__)("Embed of %s."),a),p=!fo.RichText.isEmpty(a),d=p?r:void 0;return t&&(0,Gt.jsxs)("div",{...fo.useBlockProps.save(),children:[c&&(0,Gt.jsx)(Gt.Fragment,{children:(0,Gt.jsx)("object",{className:"wp-block-file__embed",data:t,type:"application/pdf",style:{width:"100%",height:`${u}px`},"aria-label":m})}),p&&(0,Gt.jsx)("a",{id:d,href:n,target:i,rel:i?"noreferrer noopener":void 0,children:(0,Gt.jsx)(fo.RichText.Content,{value:a})}),l&&(0,Gt.jsx)("a",{href:t,className:"wp-block-file__button",download:!0,"aria-describedby":d,children:(0,Gt.jsx)(fo.RichText.Content,{value:s})})]})}},z1e={attributes:{id:{type:"number"},href:{type:"string"},fileName:{type:"string",source:"html",selector:"a:not([download])"},textLinkHref:{type:"string",source:"attribute",selector:"a:not([download])",attribute:"href"},textLinkTarget:{type:"string",source:"attribute",selector:"a:not([download])",attribute:"target"},showDownloadButton:{type:"boolean",default:!0},downloadButtonText:{type:"string",source:"html",selector:"a[download]"},displayPreview:{type:"boolean"},previewHeight:{type:"number",default:600}},supports:{anchor:!0,align:!0},save({attributes:e}){let{href:t,fileName:r,textLinkHref:a,textLinkTarget:n,showDownloadButton:i,downloadButtonText:l,displayPreview:s,previewHeight:c}=e,u=fo.RichText.isEmpty(r)?(0,Wl.__)("PDF embed"):(0,Wl.sprintf)((0,Wl.__)("Embed of %s."),r);return t&&(0,Gt.jsxs)("div",{...fo.useBlockProps.save(),children:[s&&(0,Gt.jsx)(Gt.Fragment,{children:(0,Gt.jsx)("object",{className:"wp-block-file__embed",data:t,type:"application/pdf",style:{width:"100%",height:`${c}px`},"aria-label":u})}),!fo.RichText.isEmpty(r)&&(0,Gt.jsx)("a",{href:a,target:n,rel:n?"noreferrer noopener":void 0,children:(0,Gt.jsx)(fo.RichText.Content,{value:r})}),i&&(0,Gt.jsx)("a",{href:t,className:"wp-block-file__button",download:!0,children:(0,Gt.jsx)(fo.RichText.Content,{value:l})})]})}},V1e=[A1e,R1e,z1e],OG=V1e;var SN=o(Rr(),1),ch=o(M(),1),sh=o(V(),1),No=o(T(),1),k5=o(U(),1),$G=o(me(),1),$l=o(P(),1);var qG=o(Q(),1),TN=o(xr(),1),ZG=o(mr(),1);var Xo=o(P(),1),Jo=o(M(),1),jG=o(T(),1);var Io=o(v(),1);function UG({hrefs:e,openInNewWindow:t,showDownloadButton:r,changeLinkDestinationOption:a,changeOpenInNewWindow:n,changeShowDownloadButton:i,displayPreview:l,changeDisplayPreview:s,previewHeight:c,changePreviewHeight:u}){let{href:m,textLinkHref:p,attachmentPage:d}=e,f=q(),h=[{value:m,label:(0,Xo.__)("URL")}];return d&&(h=[{value:m,label:(0,Xo.__)("Media file")},{value:d,label:(0,Xo.__)("Attachment page")}]),(0,Io.jsx)(Io.Fragment,{children:(0,Io.jsxs)(jG.InspectorControls,{children:[m.endsWith(".pdf")&&(0,Io.jsxs)(Jo.__experimentalToolsPanel,{label:(0,Xo.__)("PDF settings"),resetAll:()=>{s(!0),u(600)},dropdownMenuProps:f,children:[(0,Io.jsx)(Jo.__experimentalToolsPanelItem,{label:(0,Xo.__)("Show inline embed"),isShownByDefault:!0,hasValue:()=>!l,onDeselect:()=>s(!0),children:(0,Io.jsx)(Jo.ToggleControl,{label:(0,Xo.__)("Show inline embed"),help:l?(0,Xo.__)("Note: Most phone and tablet browsers won't display embedded PDFs."):null,checked:!!l,onChange:s})}),l&&(0,Io.jsx)(Jo.__experimentalToolsPanelItem,{label:(0,Xo.__)("Height in pixels"),isShownByDefault:!0,hasValue:()=>c!==600,onDeselect:()=>u(600),children:(0,Io.jsx)(Jo.RangeControl,{__next40pxDefaultSize:!0,label:(0,Xo.__)("Height in pixels"),min:x5,max:Math.max(CN,c),value:c,onChange:u})})]}),(0,Io.jsxs)(Jo.__experimentalToolsPanel,{label:(0,Xo.__)("Settings"),resetAll:()=>{a(m),n(!1),i(!0)},dropdownMenuProps:f,children:[(0,Io.jsx)(Jo.__experimentalToolsPanelItem,{label:(0,Xo.__)("Link to"),isShownByDefault:!0,hasValue:()=>p!==m,onDeselect:()=>a(m),children:(0,Io.jsx)(Jo.SelectControl,{__next40pxDefaultSize:!0,label:(0,Xo.__)("Link to"),value:p,options:h,onChange:a})}),(0,Io.jsx)(Jo.__experimentalToolsPanelItem,{label:(0,Xo.__)("Open in new tab"),isShownByDefault:!0,hasValue:()=>!!t,onDeselect:()=>n(!1),children:(0,Io.jsx)(Jo.ToggleControl,{label:(0,Xo.__)("Open in new tab"),checked:t,onChange:n})}),(0,Io.jsx)(Jo.__experimentalToolsPanelItem,{label:(0,Xo.__)("Show download button"),isShownByDefault:!0,hasValue:()=>!r,onDeselect:()=>i(!0),children:(0,Io.jsx)(Jo.ToggleControl,{label:(0,Xo.__)("Show download button"),checked:r,onChange:i})})]})]})})}var WG=()=>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)&&!(GG("AcroPDF.PDF")||GG("PDF.PdfCtrl"))),GG=e=>{let t;try{t=new window.ActiveXObject(e)}catch{t=void 0}return t};var Fr=o(v(),1),x5=200,CN=2e3;function F1e({text:e,disabled:t}){let{createNotice:r}=(0,sh.useDispatch)(TN.store),a=(0,$G.useCopyToClipboard)(e,()=>{r("info",(0,$l.__)("Copied URL to clipboard."),{isDismissible:!0,type:"snackbar"})});return(0,Fr.jsx)(ch.ToolbarButton,{className:"components-clipboard-toolbar-button",ref:a,disabled:t,children:(0,$l.__)("Copy URL")})}function H1e({attributes:e,isSelected:t,setAttributes:r,clientId:a}){let{id:n,fileName:i,href:l,textLinkHref:s,textLinkTarget:c,showDownloadButton:u,downloadButtonText:m,displayPreview:p,previewHeight:d}=e,[f,h]=(0,k5.useState)(e.blob),{media:g}=(0,sh.useSelect)(I=>({media:n===void 0?void 0:I(qG.store).getEntityRecord("postType","attachment",n)}),[n]),{createErrorNotice:b}=(0,sh.useDispatch)(TN.store),{toggleSelection:y,__unstableMarkNextChangeAsNotPersistent:k}=(0,sh.useDispatch)(No.store);Es({url:f,onChange:_,onError:x}),(0,k5.useEffect)(()=>{No.RichText.isEmpty(m)&&(k(),r({downloadButtonText:(0,$l._x)("Download","button label")}))},[]);function _(I){if(!I||!I.url){r({href:void 0,fileName:void 0,textLinkHref:void 0,id:void 0,fileId:void 0,displayPreview:void 0,previewHeight:void 0}),h();return}if((0,SN.isBlobURL)(I.url)){h(I.url);return}let R=(I.mime||I.mime_type)==="application/pdf"||(0,ZG.getFilename)(I.url).toLowerCase().endsWith(".pdf"),$={displayPreview:R?e.displayPreview??!0:void 0,previewHeight:R?e.previewHeight??600:void 0};r({href:I.url,fileName:I.title,textLinkHref:I.url,id:I.id,fileId:`wp-block-file--media-${a}`,blob:void 0,...$}),h()}function x(I){r({href:void 0}),b(I,{type:"snackbar"})}function S(I){r({textLinkHref:I})}function C(I){r({textLinkTarget:I?"_blank":!1})}function N(I){r({showDownloadButton:I})}function B(I){r({displayPreview:I})}function D(I,R,$,j){y(!0);let G=parseInt(d+j.height,10);r({previewHeight:G})}function A(I){let R=Math.max(parseInt(I,10),x5);r({previewHeight:R})}let H=g&&g.link,F=(0,No.useBlockProps)({className:w(!!f&&(0,ch.__unstableGetAnimateClassName)({type:"loading"}),{"is-transient":!!f})}),z=WG()&&p;return!l&&!f?(0,Fr.jsx)("div",{...F,children:(0,Fr.jsx)(No.MediaPlaceholder,{icon:(0,Fr.jsx)(No.BlockIcon,{icon:R0}),labels:{title:(0,$l.__)("File"),instructions:(0,$l.__)("Drag and drop a file, upload, or choose from your library.")},onSelect:_,onError:x,accept:"*"})}):(0,Fr.jsxs)(Fr.Fragment,{children:[(0,Fr.jsx)(UG,{hrefs:{href:l||f,textLinkHref:s,attachmentPage:H},openInNewWindow:!!c,showDownloadButton:u,changeLinkDestinationOption:S,changeOpenInNewWindow:C,changeShowDownloadButton:N,displayPreview:p,changeDisplayPreview:B,previewHeight:d,changePreviewHeight:A}),(0,Fr.jsxs)(No.BlockControls,{group:"other",children:[(0,Fr.jsx)(No.MediaReplaceFlow,{mediaId:n,mediaURL:l,accept:"*",onSelect:_,onError:x,onReset:()=>_(void 0)}),(0,Fr.jsx)(F1e,{text:l,disabled:(0,SN.isBlobURL)(l)})]}),(0,Fr.jsxs)("div",{...F,children:[z&&(0,Fr.jsxs)(ch.ResizableBox,{size:{height:d,width:"100%"},minHeight:x5,maxHeight:CN,grid:[1,10],enable:{top:!1,right:!1,bottom:!0,left:!1,topRight:!1,bottomRight:!1,bottomLeft:!1,topLeft:!1},onResizeStart:()=>y(!1),onResizeStop:D,showHandle:t,children:[(0,Fr.jsx)("object",{className:"wp-block-file__preview",data:l,type:"application/pdf","aria-label":(0,$l.__)("Embed of the selected PDF file.")}),!t&&(0,Fr.jsx)("div",{className:"wp-block-file__preview-overlay"})]}),(0,Fr.jsxs)("div",{className:"wp-block-file__content-wrapper",children:[(0,Fr.jsx)(No.RichText,{identifier:"fileName",tagName:"a",value:i,placeholder:(0,$l.__)("Write file name\u2026"),withoutInteractiveFormatting:!0,onChange:I=>r({fileName:N1(I)}),href:s}),u&&(0,Fr.jsx)("div",{className:"wp-block-file__button-richtext-wrapper",children:(0,Fr.jsx)(No.RichText,{identifier:"downloadButtonText",tagName:"div","aria-label":(0,$l.__)("Download button text"),className:w("wp-block-file__button",(0,No.__experimentalGetElementClassName)("button")),value:m,withoutInteractiveFormatting:!0,placeholder:(0,$l.__)("Add text\u2026"),onChange:I=>r({downloadButtonText:N1(I)})})})]})]})]})}var KG=H1e;var w5={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/file",title:"File",category:"media",description:"Add a link to a downloadable file.",keywords:["document","pdf","download"],textdomain:"default",attributes:{id:{type:"number"},blob:{type:"string",role:"local"},href:{type:"string",role:"content"},fileId:{type:"string",source:"attribute",selector:"a:not([download])",attribute:"id"},fileName:{type:"rich-text",source:"rich-text",selector:"a:not([download])",role:"content"},textLinkHref:{type:"string",source:"attribute",selector:"a:not([download])",attribute:"href",role:"content"},textLinkTarget:{type:"string",source:"attribute",selector:"a:not([download])",attribute:"target"},showDownloadButton:{type:"boolean",default:!0},downloadButtonText:{type:"rich-text",source:"rich-text",selector:"a[download]",role:"content"},displayPreview:{type:"boolean"},previewHeight:{type:"number",default:600}},supports:{anchor:!0,align:!0,spacing:{margin:!0,padding:!0},color:{gradients:!0,link:!0,text:!1,__experimentalDefaultControls:{background:!0,link:!0}},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}},interactivity:!0},editorStyle:"wp-block-file-editor",style:"wp-block-file"};var Jc=o(T(),1),ql=o(v(),1);function QG({attributes:e}){let{href:t,fileId:r,fileName:a,textLinkHref:n,textLinkTarget:i,showDownloadButton:l,downloadButtonText:s,displayPreview:c,previewHeight:u}=e,m=Jc.RichText.isEmpty(a)?"PDF embed":a.toString(),p=!Jc.RichText.isEmpty(a),d=p?r:void 0;return t&&(0,ql.jsxs)("div",{...Jc.useBlockProps.save(),children:[c&&(0,ql.jsx)(ql.Fragment,{children:(0,ql.jsx)("object",{className:"wp-block-file__embed",data:t,type:"application/pdf",style:{width:"100%",height:`${u}px`},"aria-label":m})}),p&&(0,ql.jsx)("a",{id:d,href:n,target:i,rel:i?"noreferrer noopener":void 0,children:(0,ql.jsx)(Jc.RichText.Content,{value:a})}),l&&(0,ql.jsx)("a",{href:t,className:w("wp-block-file__button",(0,Jc.__experimentalGetElementClassName)("button")),download:!0,"aria-describedby":d,children:(0,ql.jsx)(Jc.RichText.Content,{value:s})})]})}var tv=o(Rr(),1),Zl=o(W(),1),C5=o(V(),1),S5=o(Q(),1),YG=o(mr(),1),j1e={from:[{type:"files",isMatch(e){return e.length>0},priority:15,transform:e=>{let t=[];return e.forEach(r=>{let a=(0,tv.createBlobURL)(r);r.type.startsWith("video/")?t.push((0,Zl.createBlock)("core/video",{blob:(0,tv.createBlobURL)(r)})):r.type.startsWith("image/")?t.push((0,Zl.createBlock)("core/image",{blob:(0,tv.createBlobURL)(r)})):r.type.startsWith("audio/")?t.push((0,Zl.createBlock)("core/audio",{blob:(0,tv.createBlobURL)(r)})):t.push((0,Zl.createBlock)("core/file",{blob:a,fileName:r.name}))}),t}},{type:"block",blocks:["core/audio"],transform:e=>(0,Zl.createBlock)("core/file",{href:e.src,fileName:e.caption,textLinkHref:e.src,id:e.id,anchor:e.anchor})},{type:"block",blocks:["core/video"],transform:e=>(0,Zl.createBlock)("core/file",{href:e.src,fileName:e.caption,textLinkHref:e.src,id:e.id,anchor:e.anchor})},{type:"block",blocks:["core/image"],transform:e=>(0,Zl.createBlock)("core/file",{href:e.url,fileName:e.caption||(0,YG.getFilename)(e.url),textLinkHref:e.url,id:e.id,anchor:e.anchor})}],to:[{type:"block",blocks:["core/audio"],isMatch:({id:e})=>{if(!e)return!1;let{getEntityRecord:t}=(0,C5.select)(S5.store),r=t("postType","attachment",e);return!!r&&r.mime_type.includes("audio")},transform:e=>(0,Zl.createBlock)("core/audio",{src:e.href,caption:e.fileName,id:e.id,anchor:e.anchor})},{type:"block",blocks:["core/video"],isMatch:({id:e})=>{if(!e)return!1;let{getEntityRecord:t}=(0,C5.select)(S5.store),r=t("postType","attachment",e);return!!r&&r.mime_type.includes("video")},transform:e=>(0,Zl.createBlock)("core/video",{src:e.href,caption:e.fileName,id:e.id,anchor:e.anchor})},{type:"block",blocks:["core/image"],isMatch:({id:e})=>{if(!e)return!1;let{getEntityRecord:t}=(0,C5.select)(S5.store),r=t("postType","attachment",e);return!!r&&r.mime_type.includes("image")},transform:e=>(0,Zl.createBlock)("core/image",{url:e.href,caption:e.fileName,id:e.id,anchor:e.anchor})}]},XG=j1e;var{fieldsKey:U1e,formKey:G1e}=K(JG.privateApis),{name:eW}=w5,T5={icon:R0,example:{attributes:{href:"https://upload.wikimedia.org/wikipedia/commons/d/dd/Armstrong_Small_Step.ogg",fileName:(0,uh._x)("Armstrong_Small_Step","Name of the file")}},transforms:XG,deprecated:OG,edit:KG,save:QG};window.__experimentalContentOnlyInspectorFields&&(T5[U1e]=[{id:"file",label:(0,uh.__)("File"),type:"media",Edit:{control:"media",allowedTypes:[],multiple:!1},getValue:({item:e})=>({id:e.id,url:e.href}),setValue:({value:e})=>({id:e.id,href:e.url})},{id:"fileName",label:(0,uh.__)("Filename"),type:"text",Edit:"rich-text"},{id:"downloadButtonText",label:(0,uh.__)("Button Text"),type:"text",Edit:"rich-text"}],T5[G1e]={fields:["file","fileName","downloadButtonText"]});var W1e=()=>E({name:eW,metadata:w5,settings:T5});var DN={};Z(DN,{init:()=>Y1e,metadata:()=>I5,name:()=>sW,settings:()=>cW});var lW=o(Yc(),1);var Eo=o(P(),1),Kl=o(T(),1),Ql=o(M(),1),tW=o(V(),1);var BN=o(P(),1),P5=["core/form-submission-notification",{type:"success"},[["core/paragraph",{content:'<mark style="background-color:rgba(0, 0, 0, 0);color:#345C00" class="has-inline-color">'+(0,BN.__)("Your form has been submitted successfully")+"</mark>"}]]],B5=["core/form-submission-notification",{type:"error"},[["core/paragraph",{content:'<mark style="background-color:rgba(0, 0, 0, 0);color:#CF2E2E" class="has-inline-color">'+(0,BN.__)("There was an error submitting your form.")+"</mark>"}]]];var en=o(v(),1),$1e=[P5,B5,["core/form-input",{type:"text",label:(0,Eo.__)("Name"),required:!0}],["core/form-input",{type:"email",label:(0,Eo.__)("Email"),required:!0}],["core/form-input",{type:"textarea",label:(0,Eo.__)("Comment"),required:!0}],["core/form-submit-button",{}]],q1e=({attributes:e,setAttributes:t,clientId:r})=>{let a=q(),n=()=>{t({submissionMethod:"email",email:void 0,action:void 0,method:"post"})},{action:i,method:l,email:s,submissionMethod:c}=e,u=(0,Kl.useBlockProps)(),{hasInnerBlocks:m}=(0,tW.useSelect)(d=>{let{getBlock:f}=d(Kl.store),h=f(r);return{hasInnerBlocks:!!(h&&h.innerBlocks.length)}},[r]),p=(0,Kl.useInnerBlocksProps)(u,{template:$1e,renderAppender:m?void 0:Kl.InnerBlocks.ButtonBlockAppender});return(0,en.jsxs)(en.Fragment,{children:[(0,en.jsx)(Kl.InspectorControls,{children:(0,en.jsxs)(Ql.__experimentalToolsPanel,{dropdownMenuProps:a,label:(0,Eo.__)("Settings"),resetAll:n,children:[(0,en.jsx)(Ql.__experimentalToolsPanelItem,{hasValue:()=>c!=="email",label:(0,Eo.__)("Submissions method"),onDeselect:()=>t({submissionMethod:"email"}),isShownByDefault:!0,children:(0,en.jsx)(Ql.SelectControl,{__next40pxDefaultSize:!0,label:(0,Eo.__)("Submissions method"),options:[{label:(0,Eo.__)("Send email"),value:"email"},{label:(0,Eo.__)("- Custom -"),value:"custom"}],value:c,onChange:d=>t({submissionMethod:d}),help:c==="custom"?(0,Eo.__)('Select the method to use for form submissions. Additional options for the "custom" mode can be found in the "Advanced" section.'):(0,Eo.__)("Select the method to use for form submissions.")})}),c==="email"&&(0,en.jsx)(Ql.__experimentalToolsPanelItem,{hasValue:()=>!!s,label:(0,Eo.__)("Email for form submissions"),onDeselect:()=>t({email:void 0,action:void 0,method:"post"}),isShownByDefault:!0,children:(0,en.jsx)(Ql.TextControl,{__next40pxDefaultSize:!0,autoComplete:"off",label:(0,Eo.__)("Email for form submissions"),value:s||"",required:!0,onChange:d=>{t({email:d}),t({action:`mailto:${d}`}),t({method:"post"})},help:(0,Eo.__)("The email address where form submissions will be sent. Separate multiple email addresses with a comma."),type:"email"})})]})}),c!=="email"&&(0,en.jsxs)(Kl.InspectorControls,{group:"advanced",children:[(0,en.jsx)(Ql.SelectControl,{__next40pxDefaultSize:!0,label:(0,Eo.__)("Method"),options:[{label:"Get",value:"get"},{label:"Post",value:"post"}],value:l,onChange:d=>t({method:d}),help:(0,Eo.__)("Select the method to use for form submissions.")}),(0,en.jsx)(Ql.TextControl,{__next40pxDefaultSize:!0,autoComplete:"off",label:(0,Eo.__)("Form action"),value:i,onChange:d=>{t({action:d})},help:(0,Eo.__)("The URL where the form should be submitted."),type:"url"})]}),(0,en.jsx)("form",{...p,encType:c==="email"?"text/plain":null})]})},rW=q1e;var I5={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,__experimental:!0,name:"core/form",title:"Form",category:"common",allowedBlocks:["core/paragraph","core/heading","core/form-input","core/form-submit-button","core/form-submission-notification","core/group","core/columns"],description:"A form.",keywords:["container","wrapper","row","section"],textdomain:"default",attributes:{submissionMethod:{type:"string",default:"email"},method:{type:"string",default:"post"},action:{type:"string"},email:{type:"string"}},supports:{anchor:!0,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalTextDecoration:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0}}}};var N5=o(T(),1),IN=o(v(),1);function oW({attributes:e}){let t=N5.useBlockProps.save(),{submissionMethod:r}=e;return(0,IN.jsx)("form",{...t,encType:r==="email"?"text/plain":null,children:(0,IN.jsx)(N5.InnerBlocks.Content,{})})}var sl=o(P(),1);var K1e=[{name:"comment-form",title:(0,sl.__)("Experimental Comment form"),description:(0,sl.__)("A comment form for posts and pages."),attributes:{submissionMethod:"custom",action:"{SITE_URL}/wp-comments-post.php",method:"post",anchor:"comment-form"},isDefault:!1,innerBlocks:[["core/form-input",{type:"text",name:"author",label:(0,sl.__)("Name"),required:!0,visibilityPermissions:"logged-out"}],["core/form-input",{type:"email",name:"email",label:(0,sl.__)("Email"),required:!0,visibilityPermissions:"logged-out"}],["core/form-input",{type:"textarea",name:"comment",label:(0,sl.__)("Comment"),required:!0,visibilityPermissions:"all"}],["core/form-submit-button",{}]],scope:["inserter","transform"],isActive:e=>!e?.type||e?.type==="text"},{name:"wp-privacy-form",title:(0,sl.__)("Experimental Privacy Request Form"),keywords:["GDPR"],description:(0,sl.__)("A form to request data exports and/or deletion."),attributes:{submissionMethod:"custom",action:"",method:"post",anchor:"gdpr-form"},isDefault:!1,innerBlocks:[P5,B5,["core/paragraph",{content:(0,sl.__)("To request an export or deletion of your personal data on this site, please fill-in the form below. You can define the type of request you wish to perform, and your email address. Once the form is submitted, you will receive a confirmation email with instructions on the next steps.")}],["core/form-input",{type:"email",name:"email",label:(0,sl.__)("Enter your email address."),required:!0,visibilityPermissions:"all"}],["core/form-input",{type:"checkbox",name:"export_personal_data",label:(0,sl.__)("Request data export"),required:!1,visibilityPermissions:"all"}],["core/form-input",{type:"checkbox",name:"remove_personal_data",label:(0,sl.__)("Request data deletion"),required:!1,visibilityPermissions:"all"}],["core/form-submit-button",{}],["core/form-input",{type:"hidden",name:"wp-action",value:"wp_privacy_send_request"}],["core/form-input",{type:"hidden",name:"wp-privacy-request",value:"1"}]],scope:["inserter","transform"],isActive:e=>!e?.type||e?.type==="text"}],aW=K1e;var js=o(T(),1),NN=o(v(),1),Q1e={supports:{},attributes:{submissionMethod:{type:"string",default:"email"},method:{type:"string",default:"post"},action:{type:"string"},email:{type:"string"},anchor:{type:"string",source:"attribute",attribute:"id",selector:"*"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},style:{type:"object"},fontFamily:{type:"string"},fontSize:{type:"string"}},save({attributes:e}){let{submissionMethod:t}=e,r=(0,js.__experimentalGetColorClassesAndStyles)(e),a=(0,js.getTypographyClassesAndStyles)(e),n=(0,js.__experimentalGetSpacingClassesAndStyles)(e),i=js.useBlockProps.save({style:{...r.style,...a.style,...n.style},id:e.anchor});return(0,NN.jsx)("form",{...i,className:"wp-block-form",encType:t==="email"?"text/plain":null,children:(0,NN.jsx)(js.InnerBlocks.Content,{})})}},nW=[Q1e];var E5=o(L(),1),EN=o(v(),1),iW=(0,EN.jsx)(E5.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,EN.jsx)(E5.Path,{d:"M18 16H6c-1.1 0-2 .9-2 2s.9 2 2 2h12c1.1 0 2-.9 2-2s-.9-2-2-2Zm0 2.5H6c-.3 0-.5-.2-.5-.5s.2-.5.5-.5h12c.3 0 .5.2.5.5s-.2.5-.5.5ZM13 13H4v1.5h9V13Zm-7-2h12c1.1 0 2-.9 2-2s-.9-2-2-2H6c-1.1 0-2 .9-2 2s.9 2 2 2Zm0-2.5h12c.3 0 .5.2.5.5s-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5s.2-.5.5-.5ZM13 4H4v1.5h9V4Z"})});var{name:sW}=I5,cW={icon:iW,edit:rW,save:oW,deprecated:nW,variations:aW,example:{}},Y1e=()=>{let e=["core/form"];return(0,lW.addFilter)("blockEditor.__unstableCanInsertBlockType","core/block-library/preventInsertingFormIntoAnotherForm",(t,r,a,{getBlock:n,getBlockParentsByBlockName:i})=>{if(r.name!=="core/form")return t;for(let l of e)if(n(a)?.name===l||i(a,l).length)return!1;return!0}),E({name:sW,metadata:I5,settings:cW})};var MN={};Z(MN,{init:()=>cve,metadata:()=>L5,name:()=>CW,settings:()=>SW});var dW=o(rv(),1),Yl=o(T(),1),fW=o(ai(),1),vi=o(v(),1),hW=e=>(0,dW.default)((0,fW.__unstableStripHTML)(e)).replace(/[^\p{L}\p{N}]+/gu,"-").toLowerCase().replace(/(^-+)|(-+$)/g,""),rve={attributes:{type:{type:"string",default:"text"},name:{type:"string"},label:{type:"string",default:"Label",selector:".wp-block-form-input__label-content",source:"html",role:"content"},inlineLabel:{type:"boolean",default:!1},required:{type:"boolean",default:!1,selector:".wp-block-form-input__input",source:"attribute",attribute:"required"},placeholder:{type:"string",selector:".wp-block-form-input__input",source:"attribute",attribute:"placeholder",role:"content"},value:{type:"string",default:"",selector:"input",source:"attribute",attribute:"value"},visibilityPermissions:{type:"string",default:"all"}},supports:{anchor:!0,reusable:!1,spacing:{margin:["top","bottom"]},__experimentalBorder:{radius:!0,__experimentalSkipSerialization:!0,__experimentalDefaultControls:{radius:!0}}},save({attributes:e}){let{type:t,name:r,label:a,inlineLabel:n,required:i,placeholder:l,value:s}=e,c=(0,Yl.__experimentalGetBorderClassesAndStyles)(e),u=(0,Yl.__experimentalGetColorClassesAndStyles)(e),m={...c.style,...u.style},p=w("wp-block-form-input__input",u.className,c.className),d=t==="textarea"?"textarea":"input",f=Yl.useBlockProps.save();return t==="hidden"?(0,vi.jsx)("input",{type:t,name:r,value:s}):(0,vi.jsx)("div",{...f,children:(0,vi.jsxs)("label",{className:w("wp-block-form-input__label",{"is-label-inline":n}),children:[(0,vi.jsx)("span",{className:"wp-block-form-input__label-content",children:(0,vi.jsx)(Yl.RichText.Content,{value:a})}),(0,vi.jsx)(d,{className:p,type:t==="textarea"?void 0:t,name:r||hW(a),required:i,"aria-required":i,placeholder:l||void 0,style:m})]})})}},ove={attributes:{type:{type:"string",default:"text"},name:{type:"string"},label:{type:"string",default:"Label",selector:".wp-block-form-input__label-content",source:"html",role:"content"},inlineLabel:{type:"boolean",default:!1},required:{type:"boolean",default:!1,selector:".wp-block-form-input__input",source:"attribute",attribute:"required"},placeholder:{type:"string",selector:".wp-block-form-input__input",source:"attribute",attribute:"placeholder",role:"content"},value:{type:"string",default:"",selector:"input",source:"attribute",attribute:"value"},visibilityPermissions:{type:"string",default:"all"}},supports:{className:!1,anchor:!0,reusable:!1,spacing:{margin:["top","bottom"]},__experimentalBorder:{radius:!0,__experimentalSkipSerialization:!0,__experimentalDefaultControls:{radius:!0}}},save({attributes:e}){let{type:t,name:r,label:a,inlineLabel:n,required:i,placeholder:l,value:s}=e,c=(0,Yl.__experimentalGetBorderClassesAndStyles)(e),u=(0,Yl.__experimentalGetColorClassesAndStyles)(e),m={...c.style,...u.style},p=w("wp-block-form-input__input",u.className,c.className),d=t==="textarea"?"textarea":"input";return t==="hidden"?(0,vi.jsx)("input",{type:t,name:r,value:s}):(0,vi.jsxs)("label",{className:w("wp-block-form-input__label",{"is-label-inline":n}),children:[(0,vi.jsx)("span",{className:"wp-block-form-input__label-content",children:(0,vi.jsx)(Yl.RichText.Content,{value:a})}),(0,vi.jsx)(d,{className:p,type:t==="textarea"?void 0:t,name:r||hW(a),required:i,"aria-required":i,placeholder:l||void 0,style:m})]})}},ave=[rve,ove],gW=ave;var An=o(P(),1),Xl=o(T(),1),Us=o(M(),1),vW=o(U(),1);var Yr=o(v(),1);function nve({attributes:e,setAttributes:t,className:r}){let{type:a,name:n,label:i,inlineLabel:l,required:s,placeholder:c,value:u}=e,m=(0,Xl.useBlockProps)(),p=q(),d=(0,vW.useRef)(),f=a==="textarea"?"textarea":"input",h=(0,Xl.__experimentalUseBorderProps)(e),g=(0,Xl.__experimentalUseColorProps)(e);d.current&&d.current.focus();let b=a==="checkbox"||a==="radio",y=(0,Yr.jsxs)(Yr.Fragment,{children:[a!=="hidden"&&(0,Yr.jsx)(Xl.InspectorControls,{children:(0,Yr.jsxs)(Us.__experimentalToolsPanel,{label:(0,An.__)("Settings"),resetAll:()=>{t({inlineLabel:!1,required:!1})},dropdownMenuProps:p,children:[a!=="checkbox"&&(0,Yr.jsx)(Us.__experimentalToolsPanelItem,{label:(0,An.__)("Inline label"),hasValue:()=>!!l,onDeselect:()=>t({inlineLabel:!1}),isShownByDefault:!0,children:(0,Yr.jsx)(Us.CheckboxControl,{label:(0,An.__)("Inline label"),checked:l,onChange:_=>{t({inlineLabel:_})}})}),(0,Yr.jsx)(Us.__experimentalToolsPanelItem,{label:(0,An.__)("Required"),hasValue:()=>!!s,onDeselect:()=>t({required:!1}),isShownByDefault:!0,children:(0,Yr.jsx)(Us.CheckboxControl,{label:(0,An.__)("Required"),checked:s,onChange:_=>{t({required:_})}})})]})}),(0,Yr.jsx)(Xl.InspectorControls,{group:"advanced",children:(0,Yr.jsx)(Us.TextControl,{__next40pxDefaultSize:!0,autoComplete:"off",label:(0,An.__)("Name"),value:n,onChange:_=>{t({name:_})},help:(0,An.__)('Affects the "name" attribute of the input element, and is used as a name for the form submission results.')})})]}),k=(0,Yr.jsx)(Xl.RichText,{tagName:"span",className:"wp-block-form-input__label-content",value:i,onChange:_=>t({label:_}),"aria-label":i?(0,An.__)("Label"):(0,An.__)("Empty label"),"data-empty":!i,placeholder:(0,An.__)("Type the label for this input")});return a==="hidden"?(0,Yr.jsxs)(Yr.Fragment,{children:[y,(0,Yr.jsx)("input",{type:"hidden",className:w(r,"wp-block-form-input__input",g.className,h.className),"aria-label":(0,An.__)("Value"),value:u,onChange:_=>t({value:_.target.value})})]}):(0,Yr.jsxs)("div",{...m,children:[y,(0,Yr.jsxs)("span",{className:w("wp-block-form-input__label",{"is-label-inline":l||a==="checkbox"}),children:[!b&&k,(0,Yr.jsx)(f,{type:a==="textarea"?void 0:a,className:w(r,"wp-block-form-input__input",g.className,h.className),"aria-label":(0,An.__)("Optional placeholder text"),placeholder:c?void 0:(0,An.__)("Optional placeholder\u2026"),value:c,onChange:_=>t({placeholder:_.target.value}),"aria-required":s,style:{...h.style,...g.style}}),b&&k]})]})}var bW=nve;var L5={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,__experimental:!0,name:"core/form-input",title:"Input Field",category:"common",ancestor:["core/form"],description:"The basic building block for forms.",keywords:["input","form"],textdomain:"default",attributes:{type:{type:"string",default:"text"},name:{type:"string"},label:{type:"rich-text",default:"Label",selector:".wp-block-form-input__label-content",source:"rich-text",role:"content"},inlineLabel:{type:"boolean",default:!1},required:{type:"boolean",default:!1,selector:".wp-block-form-input__input",source:"attribute",attribute:"required"},placeholder:{type:"string",selector:".wp-block-form-input__input",source:"attribute",attribute:"placeholder",role:"content"},value:{type:"string",default:"",selector:"input",source:"attribute",attribute:"value"},visibilityPermissions:{type:"string",default:"all"}},supports:{anchor:!0,reusable:!1,spacing:{margin:["top","bottom"]},__experimentalBorder:{radius:!0,__experimentalSkipSerialization:!0,__experimentalDefaultControls:{radius:!0}}},style:["wp-block-form-input"]};var yW=o(rv(),1),eu=o(T(),1),_W=o(ai(),1),Gs=o(v(),1),lve=e=>(0,yW.default)((0,_W.__unstableStripHTML)(e)).replace(/[^\p{L}\p{N}]+/gu,"-").toLowerCase().replace(/(^-+)|(-+$)/g,"");function xW({attributes:e}){let{type:t,name:r,label:a,inlineLabel:n,required:i,placeholder:l,value:s}=e,c=(0,eu.__experimentalGetBorderClassesAndStyles)(e),u=(0,eu.__experimentalGetColorClassesAndStyles)(e),m={...c.style,...u.style},p=w("wp-block-form-input__input",u.className,c.className),d=t==="textarea"?"textarea":"input",f=eu.useBlockProps.save(),h=t==="checkbox"||t==="radio";return t==="hidden"?(0,Gs.jsx)("input",{type:t,name:r,value:s}):(0,Gs.jsx)("div",{...f,children:(0,Gs.jsxs)("label",{className:w("wp-block-form-input__label",{"is-label-inline":n}),children:[!h&&(0,Gs.jsx)("span",{className:"wp-block-form-input__label-content",children:(0,Gs.jsx)(eu.RichText.Content,{value:a})}),(0,Gs.jsx)(d,{className:p,type:t==="textarea"?void 0:t,name:r||lve(a),required:i,"aria-required":i,placeholder:l||void 0,style:m}),h&&(0,Gs.jsx)("span",{className:"wp-block-form-input__label-content",children:(0,Gs.jsx)(eu.RichText.Content,{value:a})})]})})}var tn=o(P(),1),sve=[{name:"text",title:(0,tn.__)("Text Input"),description:(0,tn.__)("A generic text input."),attributes:{type:"text"},isDefault:!0,scope:["inserter","transform"],isActive:e=>!e?.type||e?.type==="text"},{name:"textarea",title:(0,tn.__)("Textarea Input"),description:(0,tn.__)("A textarea input to allow entering multiple lines of text."),attributes:{type:"textarea"},isDefault:!0,scope:["inserter","transform"],isActive:e=>e?.type==="textarea"},{name:"checkbox",title:(0,tn.__)("Checkbox Input"),description:(0,tn.__)("A simple checkbox input."),attributes:{type:"checkbox",inlineLabel:!0},isDefault:!0,scope:["inserter","transform"],isActive:e=>e?.type==="checkbox"},{name:"email",title:(0,tn.__)("Email Input"),description:(0,tn.__)("Used for email addresses."),attributes:{type:"email"},isDefault:!0,scope:["inserter","transform"],isActive:e=>e?.type==="email"},{name:"url",title:(0,tn.__)("URL Input"),description:(0,tn.__)("Used for URLs."),attributes:{type:"url"},isDefault:!0,scope:["inserter","transform"],isActive:e=>e?.type==="url"},{name:"tel",title:(0,tn.__)("Telephone Input"),description:(0,tn.__)("Used for phone numbers."),attributes:{type:"tel"},isDefault:!0,scope:["inserter","transform"],isActive:e=>e?.type==="tel"},{name:"number",title:(0,tn.__)("Number Input"),description:(0,tn.__)("A numeric input."),attributes:{type:"number"},isDefault:!0,scope:["inserter","transform"],isActive:e=>e?.type==="number"}],kW=sve;var M5=o(L(),1),LN=o(v(),1),wW=(0,LN.jsx)(M5.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,LN.jsx)(M5.Path,{d:"M5.547 18.892A.99.99 0 0 0 6 19h.72v1H6a1.99 1.99 0 0 1-.908-.22l.455-.888ZM9.12 20H7.68v-1h1.44v1Zm2.4 0h-1.44v-1h1.44v1Zm2.4 0h-1.44v-1h1.44v1Zm2.4 0h-1.44v-1h1.44v1Zm2.587-.22c-.272.14-.58.22-.907.22h-.72v-1H18a.99.99 0 0 0 .453-.108l.454.888ZM5.108 17.547a.99.99 0 0 0 0 .906l-.89.454a1.99 1.99 0 0 1 0-1.815l.89.455Zm14.672-.455a1.99 1.99 0 0 1 0 1.815l-.888-.454a.99.99 0 0 0 0-.906l.888-.455ZM6.72 17H6a.99.99 0 0 0-.453.108l-.455-.89A1.99 1.99 0 0 1 6 16h.72v1ZM18 16c.327 0 .635.08.907.219l-.454.89A.99.99 0 0 0 18 17h-.72v-1H18Zm-8.88 1H7.68v-1h1.44v1Zm2.4 0h-1.44v-1h1.44v1Zm2.4 0h-1.44v-1h1.44v1Zm2.4 0h-1.44v-1h1.44v1ZM5.5 14.28H4.25v-1H5.5v1Zm2.5 0H6.5v-1H8v1Zm2.5 0H9v-1h1.5v1Zm2.25 0H11.5v-1h1.25v1ZM18 7a2 2 0 1 1 0 4H6a2 2 0 1 1 0-4h12ZM6 8.5a.5.5 0 0 0 0 1h12a.5.5 0 0 0 0-1H6Zm7-3H4V4h9v1.5Z"})});var{name:CW}=L5,SW={icon:wW,deprecated:gW,edit:bW,save:xW,variations:kW,example:{}},cve=()=>E({name:CW,metadata:L5,settings:SW});var RN={};Z(RN,{init:()=>dve,metadata:()=>R5,name:()=>NW,settings:()=>EW});var TW=o(P(),1),A5=o(T(),1),PW=o(v(),1),uve=[["core/buttons",{},[["core/button",{text:(0,TW.__)("Submit"),tagName:"button",type:"submit"}]]]],mve=()=>{let e=(0,A5.useBlockProps)(),t=(0,A5.useInnerBlocksProps)(e,{template:uve,templateLock:"all"});return(0,PW.jsx)("div",{className:"wp-block-form-submit-wrapper",...t})},BW=mve;var R5={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,__experimental:!0,name:"core/form-submit-button",title:"Form Submit Button",category:"common",icon:"button",ancestor:["core/form"],allowedBlocks:["core/buttons","core/button"],description:"A submission button for forms.",keywords:["submit","button","form"],textdomain:"default",style:["wp-block-form-submit-button"]};var z5=o(T(),1),AN=o(v(),1);function IW(){let e=z5.useBlockProps.save();return(0,AN.jsx)("div",{className:"wp-block-form-submit-wrapper",...e,children:(0,AN.jsx)(z5.InnerBlocks.Content,{})})}var{name:NW}=R5,EW={edit:BW,save:IW,example:{}},dve=()=>E({name:NW,metadata:R5,settings:EW});var zN={};Z(zN,{init:()=>bve,metadata:()=>F5,name:()=>VW,settings:()=>FW});var V5=o(P(),1),dm=o(T(),1),DW=o(V(),1);var LW=o(v(),1),fve=[["core/paragraph",{content:(0,V5.__)("Enter the message you wish displayed for form submission error/success, and select the type of the message (success/error) from the block's options.")}]],hve=({attributes:e,clientId:t})=>{let{type:r}=e,a=(0,dm.useBlockProps)({className:w("wp-block-form-submission-notification",{[`form-notification-type-${r}`]:r})}),{hasInnerBlocks:n}=(0,DW.useSelect)(l=>{let{getBlock:s}=l(dm.store),c=s(t);return{hasInnerBlocks:!!(c&&c.innerBlocks.length)}},[t]),i=(0,dm.useInnerBlocksProps)(a,{template:fve,renderAppender:n?void 0:dm.InnerBlocks.ButtonBlockAppender});return(0,LW.jsx)("div",{...i,"data-message-success":(0,V5.__)("Submission success notification"),"data-message-error":(0,V5.__)("Submission error notification")})},MW=hve;var F5={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,__experimental:!0,name:"core/form-submission-notification",title:"Form Submission Notification",category:"common",ancestor:["core/form"],description:"Provide a notification message after the form has been submitted.",keywords:["form","feedback","notification","message"],textdomain:"default",icon:"feedback",attributes:{type:{type:"string",default:"success"}}};var H5=o(T(),1);var AW=o(v(),1);function RW({attributes:e}){let{type:t}=e;return(0,AW.jsx)("div",{...H5.useInnerBlocksProps.save(H5.useBlockProps.save({className:w("wp-block-form-submission-notification",{[`form-notification-type-${t}`]:t})}))})}var ad=o(P(),1),vve=[{name:"form-submission-success",title:(0,ad.__)("Form Submission Success"),description:(0,ad.__)("Success message for form submissions."),attributes:{type:"success"},isDefault:!0,innerBlocks:[["core/paragraph",{content:(0,ad.__)("Your form has been submitted successfully."),backgroundColor:"#00D084",textColor:"#000000",style:{elements:{link:{color:{text:"#000000"}}}}}]],scope:["inserter","transform"],isActive:e=>!e?.type||e?.type==="success"},{name:"form-submission-error",title:(0,ad.__)("Form Submission Error"),description:(0,ad.__)("Error/failure message for form submissions."),attributes:{type:"error"},isDefault:!1,innerBlocks:[["core/paragraph",{content:(0,ad.__)("There was an error submitting your form."),backgroundColor:"#CF2E2E",textColor:"#FFFFFF",style:{elements:{link:{color:{text:"#FFFFFF"}}}}}]],scope:["inserter","transform"],isActive:e=>!e?.type||e?.type==="error"}],zW=vve;var{name:VW}=F5,FW={icon:wp,edit:MW,save:RW,variations:zW,example:{}},bve=()=>E({name:VW,metadata:F5,settings:FW});var ZN={};Z(ZN,{init:()=>Fve,metadata:()=>j5,name:()=>b$,settings:()=>y$});var Ir=o(T(),1),jW=o(W(),1);var Ws="none",$s="media",ov="lightbox",qs="attachment",HW="file",OW="post",av="large";var Fe=o(v(),1),UW="file",GW="post";function mh(e){return Math.min(3,e?.images?.length)}function yve(e,t){switch(t){case UW:return{href:e?.source_url||e?.url,linkDestination:$s};case GW:return{href:e?.link,linkDestination:qs};case $s:return{href:e?.source_url||e?.url,linkDestination:$s};case qs:return{href:e?.link,linkDestination:qs};case Ws:return{href:void 0,linkDestination:Ws}}return{}}function ph(e){let t=e.linkTo?e.linkTo:"none";t==="post"?t="attachment":t==="file"&&(t="media");let r=e.images.map(l=>_ve(l,e.sizeSlug,t)),{images:a,ids:n,...i}=e;return[{...i,linkTo:t,allowResize:!1},r]}function _ve(e,t,r){return(0,jW.createBlock)("core/image",{...e.id&&{id:parseInt(e.id)},url:e.url,alt:e.alt,caption:e.caption,sizeSlug:t,...yve(e,r)})}var xve={attributes:{images:{type:"array",default:[],source:"query",selector:".blocks-gallery-item",query:{url:{type:"string",source:"attribute",selector:"img",attribute:"src"},fullUrl:{type:"string",source:"attribute",selector:"img",attribute:"data-full-url"},link:{type:"string",source:"attribute",selector:"img",attribute:"data-link"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""},id:{type:"string",source:"attribute",selector:"img",attribute:"data-id"},caption:{type:"string",source:"html",selector:".blocks-gallery-item__caption"}}},ids:{type:"array",items:{type:"number"},default:[]},shortCodeTransforms:{type:"array",default:[],items:{type:"object"}},columns:{type:"number",minimum:1,maximum:8},caption:{type:"string",source:"html",selector:".blocks-gallery-caption"},imageCrop:{type:"boolean",default:!0},fixedHeight:{type:"boolean",default:!0},linkTarget:{type:"string"},linkTo:{type:"string"},sizeSlug:{type:"string",default:"large"},allowResize:{type:"boolean",default:!1}},save({attributes:e}){let{caption:t,columns:r,imageCrop:a}=e,n=w("has-nested-images",{[`columns-${r}`]:r!==void 0,"columns-default":r===void 0,"is-cropped":a}),i=Ir.useBlockProps.save({className:n}),l=Ir.useInnerBlocksProps.save(i);return(0,Fe.jsxs)("figure",{...l,children:[l.children,!Ir.RichText.isEmpty(t)&&(0,Fe.jsx)(Ir.RichText.Content,{tagName:"figcaption",className:"blocks-gallery-caption",value:t})]})}},kve={attributes:{images:{type:"array",default:[],source:"query",selector:".blocks-gallery-item",query:{url:{type:"string",source:"attribute",selector:"img",attribute:"src"},fullUrl:{type:"string",source:"attribute",selector:"img",attribute:"data-full-url"},link:{type:"string",source:"attribute",selector:"img",attribute:"data-link"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""},id:{type:"string",source:"attribute",selector:"img",attribute:"data-id"},caption:{type:"string",source:"html",selector:".blocks-gallery-item__caption"}}},ids:{type:"array",items:{type:"number"},default:[]},columns:{type:"number",minimum:1,maximum:8},caption:{type:"string",source:"html",selector:".blocks-gallery-caption"},imageCrop:{type:"boolean",default:!0},fixedHeight:{type:"boolean",default:!0},linkTo:{type:"string"},sizeSlug:{type:"string",default:"large"}},supports:{anchor:!0,align:!0},save({attributes:e}){let{images:t,columns:r=mh(e),imageCrop:a,caption:n,linkTo:i}=e,l=`columns-${r} ${a?"is-cropped":""}`;return(0,Fe.jsxs)("figure",{...Ir.useBlockProps.save({className:l}),children:[(0,Fe.jsx)("ul",{className:"blocks-gallery-grid",children:t.map(s=>{let c;switch(i){case UW:c=s.fullUrl||s.url;break;case GW:c=s.link;break}let u=(0,Fe.jsx)("img",{src:s.url,alt:s.alt,"data-id":s.id,"data-full-url":s.fullUrl,"data-link":s.link,className:s.id?`wp-image-${s.id}`:null});return(0,Fe.jsx)("li",{className:"blocks-gallery-item",children:(0,Fe.jsxs)("figure",{children:[c?(0,Fe.jsx)("a",{href:c,children:u}):u,!Ir.RichText.isEmpty(s.caption)&&(0,Fe.jsx)(Ir.RichText.Content,{tagName:"figcaption",className:"blocks-gallery-item__caption",value:s.caption})]})},s.id||s.url)})}),!Ir.RichText.isEmpty(n)&&(0,Fe.jsx)(Ir.RichText.Content,{tagName:"figcaption",className:"blocks-gallery-caption",value:n})]})},migrate(e){return ph(e)}},wve={attributes:{images:{type:"array",default:[],source:"query",selector:".blocks-gallery-item",query:{url:{type:"string",source:"attribute",selector:"img",attribute:"src"},fullUrl:{type:"string",source:"attribute",selector:"img",attribute:"data-full-url"},link:{type:"string",source:"attribute",selector:"img",attribute:"data-link"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""},id:{type:"string",source:"attribute",selector:"img",attribute:"data-id"},caption:{type:"string",source:"html",selector:".blocks-gallery-item__caption"}}},ids:{type:"array",items:{type:"number"},default:[]},columns:{type:"number",minimum:1,maximum:8},caption:{type:"string",source:"html",selector:".blocks-gallery-caption"},imageCrop:{type:"boolean",default:!0},linkTo:{type:"string",default:"none"},sizeSlug:{type:"string",default:"large"}},supports:{align:!0},isEligible({linkTo:e}){return!e||e==="attachment"||e==="media"},migrate(e){return ph(e)},save({attributes:e}){let{images:t,columns:r=mh(e),imageCrop:a,caption:n,linkTo:i}=e;return(0,Fe.jsxs)("figure",{className:`columns-${r} ${a?"is-cropped":""}`,children:[(0,Fe.jsx)("ul",{className:"blocks-gallery-grid",children:t.map(l=>{let s;switch(i){case"media":s=l.fullUrl||l.url;break;case"attachment":s=l.link;break}let c=(0,Fe.jsx)("img",{src:l.url,alt:l.alt,"data-id":l.id,"data-full-url":l.fullUrl,"data-link":l.link,className:l.id?`wp-image-${l.id}`:null});return(0,Fe.jsx)("li",{className:"blocks-gallery-item",children:(0,Fe.jsxs)("figure",{children:[s?(0,Fe.jsx)("a",{href:s,children:c}):c,!Ir.RichText.isEmpty(l.caption)&&(0,Fe.jsx)(Ir.RichText.Content,{tagName:"figcaption",className:"blocks-gallery-item__caption",value:l.caption})]})},l.id||l.url)})}),!Ir.RichText.isEmpty(n)&&(0,Fe.jsx)(Ir.RichText.Content,{tagName:"figcaption",className:"blocks-gallery-caption",value:n})]})}},Cve={attributes:{images:{type:"array",default:[],source:"query",selector:".blocks-gallery-item",query:{url:{source:"attribute",selector:"img",attribute:"src"},fullUrl:{source:"attribute",selector:"img",attribute:"data-full-url"},link:{source:"attribute",selector:"img",attribute:"data-link"},alt:{source:"attribute",selector:"img",attribute:"alt",default:""},id:{source:"attribute",selector:"img",attribute:"data-id"},caption:{type:"string",source:"html",selector:".blocks-gallery-item__caption"}}},ids:{type:"array",default:[]},columns:{type:"number"},caption:{type:"string",source:"html",selector:".blocks-gallery-caption"},imageCrop:{type:"boolean",default:!0},linkTo:{type:"string",default:"none"}},supports:{align:!0},isEligible({ids:e}){return e&&e.some(t=>typeof t=="string")},migrate(e){return ph(e)},save({attributes:e}){let{images:t,columns:r=mh(e),imageCrop:a,caption:n,linkTo:i}=e;return(0,Fe.jsxs)("figure",{className:`columns-${r} ${a?"is-cropped":""}`,children:[(0,Fe.jsx)("ul",{className:"blocks-gallery-grid",children:t.map(l=>{let s;switch(i){case"media":s=l.fullUrl||l.url;break;case"attachment":s=l.link;break}let c=(0,Fe.jsx)("img",{src:l.url,alt:l.alt,"data-id":l.id,"data-full-url":l.fullUrl,"data-link":l.link,className:l.id?`wp-image-${l.id}`:null});return(0,Fe.jsx)("li",{className:"blocks-gallery-item",children:(0,Fe.jsxs)("figure",{children:[s?(0,Fe.jsx)("a",{href:s,children:c}):c,!Ir.RichText.isEmpty(l.caption)&&(0,Fe.jsx)(Ir.RichText.Content,{tagName:"figcaption",className:"blocks-gallery-item__caption",value:l.caption})]})},l.id||l.url)})}),!Ir.RichText.isEmpty(n)&&(0,Fe.jsx)(Ir.RichText.Content,{tagName:"figcaption",className:"blocks-gallery-caption",value:n})]})}},Sve={attributes:{images:{type:"array",default:[],source:"query",selector:"ul.wp-block-gallery .blocks-gallery-item",query:{url:{source:"attribute",selector:"img",attribute:"src"},fullUrl:{source:"attribute",selector:"img",attribute:"data-full-url"},alt:{source:"attribute",selector:"img",attribute:"alt",default:""},id:{source:"attribute",selector:"img",attribute:"data-id"},link:{source:"attribute",selector:"img",attribute:"data-link"},caption:{type:"string",source:"html",selector:"figcaption"}}},ids:{type:"array",default:[]},columns:{type:"number"},imageCrop:{type:"boolean",default:!0},linkTo:{type:"string",default:"none"}},supports:{align:!0},save({attributes:e}){let{images:t,columns:r=mh(e),imageCrop:a,linkTo:n}=e;return(0,Fe.jsx)("ul",{className:`columns-${r} ${a?"is-cropped":""}`,children:t.map(i=>{let l;switch(n){case"media":l=i.fullUrl||i.url;break;case"attachment":l=i.link;break}let s=(0,Fe.jsx)("img",{src:i.url,alt:i.alt,"data-id":i.id,"data-full-url":i.fullUrl,"data-link":i.link,className:i.id?`wp-image-${i.id}`:null});return(0,Fe.jsx)("li",{className:"blocks-gallery-item",children:(0,Fe.jsxs)("figure",{children:[l?(0,Fe.jsx)("a",{href:l,children:s}):s,i.caption&&i.caption.length>0&&(0,Fe.jsx)(Ir.RichText.Content,{tagName:"figcaption",value:i.caption})]})},i.id||i.url)})})},migrate(e){return ph(e)}},Tve={attributes:{images:{type:"array",default:[],source:"query",selector:"ul.wp-block-gallery .blocks-gallery-item",query:{url:{source:"attribute",selector:"img",attribute:"src"},alt:{source:"attribute",selector:"img",attribute:"alt",default:""},id:{source:"attribute",selector:"img",attribute:"data-id"},link:{source:"attribute",selector:"img",attribute:"data-link"},caption:{type:"string",source:"html",selector:"figcaption"}}},columns:{type:"number"},imageCrop:{type:"boolean",default:!0},linkTo:{type:"string",default:"none"}},isEligible({images:e,ids:t}){return e&&e.length>0&&(!t&&e||t&&e&&t.length!==e.length||e.some((r,a)=>!r&&t[a]!==null?!0:parseInt(r,10)!==t[a]))},migrate(e){return ph(e)},supports:{align:!0},save({attributes:e}){let{images:t,columns:r=mh(e),imageCrop:a,linkTo:n}=e;return(0,Fe.jsx)("ul",{className:`columns-${r} ${a?"is-cropped":""}`,children:t.map(i=>{let l;switch(n){case"media":l=i.url;break;case"attachment":l=i.link;break}let s=(0,Fe.jsx)("img",{src:i.url,alt:i.alt,"data-id":i.id,"data-link":i.link,className:i.id?`wp-image-${i.id}`:null});return(0,Fe.jsx)("li",{className:"blocks-gallery-item",children:(0,Fe.jsxs)("figure",{children:[l?(0,Fe.jsx)("a",{href:l,children:s}):s,i.caption&&i.caption.length>0&&(0,Fe.jsx)(Ir.RichText.Content,{tagName:"figcaption",value:i.caption})]})},i.id||i.url)})})}},Pve={attributes:{images:{type:"array",default:[],source:"query",selector:"div.wp-block-gallery figure.blocks-gallery-image img",query:{url:{source:"attribute",attribute:"src"},alt:{source:"attribute",attribute:"alt",default:""},id:{source:"attribute",attribute:"data-id"}}},columns:{type:"number"},imageCrop:{type:"boolean",default:!0},linkTo:{type:"string",default:"none"},align:{type:"string",default:"none"}},supports:{align:!0},save({attributes:e}){let{images:t,columns:r=mh(e),align:a,imageCrop:n,linkTo:i}=e,l=w(`columns-${r}`,{alignnone:a==="none","is-cropped":n});return(0,Fe.jsx)("div",{className:l,children:t.map(s=>{let c;switch(i){case"media":c=s.url;break;case"attachment":c=s.link;break}let u=(0,Fe.jsx)("img",{src:s.url,alt:s.alt,"data-id":s.id});return(0,Fe.jsx)("figure",{className:"blocks-gallery-image",children:c?(0,Fe.jsx)("a",{href:c,children:u}):u},s.id||s.url)})})},migrate(e){return ph(e)}},WW=[xve,kve,wve,Cve,Sve,Tve,Pve];var Ke=o(M(),1),Do=o(T(),1),ea=o(U(),1),he=o(P(),1),sv=o(V(),1),m$=o(L(),1),p$=o(W(),1),$N=o(Rr(),1),d$=o(xr(),1);var $W=o(T(),1);var qW=o(v(),1),ZW=(0,qW.jsx)($W.BlockIcon,{icon:j0});function VN(e){return e?Math.min(3,e):3}var KW=(e,t="large")=>{let r=Object.fromEntries(Object.entries(e??{}).filter(([n])=>["alt","id","link"].includes(n)));r.url=e?.sizes?.[t]?.url||e?.media_details?.sizes?.[t]?.source_url||e?.url||e?.source_url;let a=e?.sizes?.full?.url||e?.media_details?.sizes?.full?.source_url;return a&&(r.fullUrl=a),r};var Zs=20,nd="none",dh="media",fh="attachment",FN="custom",QW=["noreferrer","noopener"],tu=["image"];var HN=["flex","grid"],nv="full";function ON(e,t,r,a,n){switch(r||t){case HW:case $s:return{href:e?.source_url||e?.url,linkDestination:dh,lightbox:n?.enabled?{...a?.lightbox,enabled:!1}:void 0};case OW:case qs:return{href:e?.link,linkDestination:fh,lightbox:n?.enabled?{...a?.lightbox,enabled:!1}:void 0};case ov:return{href:void 0,lightbox:n?.enabled?void 0:{...a?.lightbox,enabled:!0},linkDestination:nd};case Ws:return{href:void 0,linkDestination:nd,lightbox:void 0}}return{}}function YW(e){let[t,r=1]=e.split("/").map(Number),a=t/r;return a===1/0||a===0?NaN:a}function Bve(e){let t=e;return e!==void 0&&t&&(QW.forEach(r=>{let a=new RegExp("\\b"+r+"\\b","gi");t=t.replace(a,"")}),t!==e&&(t=t.trim()),t||(t=void 0)),t}function jN(e,{rel:t}){let r=e?"_blank":void 0,a;return!r&&!t?a=void 0:a=Bve(t),{linkTarget:r,rel:a}}function XW(e,t){let r=e?.media_details?.sizes?.[t]?.source_url;return r?{url:r,width:void 0,height:void 0,sizeSlug:t}:{}}function UN(e){return tu.some(t=>e.type.indexOf(t)===0)}function iv({x:e,y:t}={x:.5,y:.5}){return`${Math.round(e*100)}% ${Math.round(t*100)}%`}var GN=o(P(),1),JW=o(L(),1);var lv=o(v(),1);function e$(e){let{attributes:t,isSelected:r,setAttributes:a,mediaPlaceholder:n,insertBlocksAfter:i,blockProps:l,__unstableLayoutClassNames:s,isContentLocked:c,multiGallerySelection:u}=e,{align:m,columns:p,imageCrop:d}=t;return(0,lv.jsxs)("figure",{...l,className:w(l.className,s,"blocks-gallery-grid",{[`align${m}`]:m,[`columns-${p}`]:p!==void 0,"columns-default":p===void 0,"is-cropped":d}),children:[l.children,r&&!l.children&&(0,lv.jsx)(JW.View,{className:"blocks-gallery-media-placeholder-wrapper",children:n}),(0,lv.jsx)(_a,{attributes:t,setAttributes:a,isSelected:r,insertBlocksAfter:i,showToolbarButton:!u&&!c,className:"blocks-gallery-caption",label:(0,GN.__)("Gallery caption text"),placeholder:(0,GN.__)("Add gallery caption")})]})}var t$=o(U(),1);function r$(e,t,r){return(0,t$.useMemo)(()=>a(),[e,t]);function a(){if(!e||e.length===0)return;let{imageSizes:n}=r(),i={};t&&(i=e.reduce((s,c)=>{if(!c.id)return s;let u=n.reduce((m,p)=>{let d=c.sizes?.[p.slug]?.url,f=c.media_details?.sizes?.[p.slug]?.source_url;return{...m,[p.slug]:d||f}},{});return{...s,[parseInt(c.id,10)]:u}},{}));let l=Object.values(i);return n.filter(({slug:s})=>l.some(c=>c[s])).map(({name:s,slug:c})=>({value:c,label:s}))}}var O5=o(U(),1);function o$(e,t){let[r,a]=(0,O5.useState)([]);return(0,O5.useMemo)(()=>n(),[e,t]);function n(){let i=!1,l=r.filter(c=>e.find(u=>c.clientId===u.clientId));l.length<r.length&&(i=!0),e.forEach(c=>{c.fromSavedContent&&!l.find(u=>u.id===c.id)&&(i=!0,l.push(c))});let s=e.filter(c=>!l.find(u=>c.clientId&&u.clientId===c.clientId)&&t?.find(u=>u.id===c.id)&&!c.fromSavedContent);return(i||s?.length>0)&&a([...l,...s]),s.length>0?s:null}}var n$=o(V(),1),i$=o(Q(),1),a$=[];function l$(e){return(0,n$.useSelect)(t=>{let r=e.map(a=>a.attributes.id).filter(a=>a!==void 0);return r.length===0?a$:t(i$.store).getEntityRecords("postType","attachment",{include:r.join(","),per_page:-1,orderby:"include"})??a$},[e])}var id=o(T(),1);function s$({blockGap:e,clientId:t}){let r="var( --wp--style--gallery-gap-default, var( --gallery-block--gutter-size, var( --wp--style--block-gap, 0.5em ) ) )",a=r,n=r,i;e&&(i=typeof e=="string"?(0,id.__experimentalGetGapCSSValue)(e):(0,id.__experimentalGetGapCSSValue)(e?.top)||r,n=typeof e=="string"?(0,id.__experimentalGetGapCSSValue)(e):(0,id.__experimentalGetGapCSSValue)(e?.left)||r,a=i===n?i:`${i} ${n}`);let l=`#block-${t} { --wp--style--unstable-gallery-gap: ${n==="0"?"0px":n}; gap: ${a} }`;return(0,id.useStyleOverride)({css:l}),null}var He=o(v(),1),c$=8,u$=[{icon:L0,label:(0,he.__)("Link images to attachment pages"),value:qs,noticeText:(0,he.__)("Attachment Pages")},{icon:Wu,label:(0,he.__)("Link images to media files"),value:$s,noticeText:(0,he.__)("Media Files")},{icon:kp,label:(0,he.__)("Enlarge on click"),value:ov,noticeText:(0,he.__)("Lightbox effect"),infoText:(0,he.__)("Scale images with a lightbox effect")},{icon:U0,label:(0,he._x)("None","Media item link option"),value:Ws,noticeText:(0,he.__)("None")}],Ive=[{label:(0,he.__)("Icon"),value:"icon"},{label:(0,he.__)("Text"),value:"text"},{label:(0,he.__)("Both"),value:"both"}],WN=["image"],Nve=ea.Platform.isNative?(0,he.__)("Add media"):(0,he.__)("Drag and drop images, upload, or choose from your library."),Eve=ea.Platform.isNative?{type:"stepper"}:{},Dve={name:"core/image"},Lve=[];function f$(e){let{setAttributes:t,attributes:r,className:a,clientId:n,isSelected:i,insertBlocksAfter:l,isContentLocked:s,onFocus:c}=e,[u,m,p,d]=(0,Do.useSettings)("blocks.core/image.lightbox","dimensions.aspectRatios.default","dimensions.aspectRatios.theme","dimensions.defaultAspectRatios"),f=u?.allowEditing?u$:u$.filter(Y=>Y.value!==ov),{navigationButtonType:h,columns:g,imageCrop:b,randomOrder:y,linkTarget:k,linkTo:_,sizeSlug:x,aspectRatio:S}=r,{__unstableMarkNextChangeAsNotPersistent:C,replaceInnerBlocks:N,updateBlockAttributes:B,selectBlock:D}=(0,sv.useDispatch)(Do.store),{createSuccessNotice:A,createErrorNotice:H}=(0,sv.useDispatch)(d$.store),{getBlock:F,getSettings:z,innerBlockImages:I,blockWasJustInserted:R,multiGallerySelection:$}=(0,sv.useSelect)(Y=>{let{getBlockName:ze,getMultiSelectedBlockClientIds:Me,getSettings:Xe,getBlock:Te,wasBlockJustInserted:Bt}=Y(Do.store),yr=Me();return{getBlock:Te,getSettings:Xe,innerBlockImages:Te(n)?.innerBlocks??Lve,blockWasJustInserted:Bt(n,"inserter_menu"),multiGallerySelection:yr.length&&yr.every(xn=>ze(xn)==="core/gallery")}},[n]),j=(0,ea.useMemo)(()=>I?.map(Y=>({clientId:Y.clientId,id:Y.attributes.id,url:Y.attributes.url,attributes:Y.attributes,fromSavedContent:!!Y.originalContent})),[I]),G=l$(I),O=o$(j,G),J=u?.enabled?j.filter(Y=>Y.attributes?.lightbox?.enabled===void 0||Y.attributes?.lightbox?.enabled===!0).length>0:j.filter(Y=>Y.attributes.lightbox?.enabled).length>0,ee=p?.map(({name:Y,ratio:ze})=>({label:Y,value:ze})),oe=m?.map(({name:Y,ratio:ze})=>({label:Y,value:ze})),X=[{label:(0,he._x)("Original","Aspect ratio option for dimensions control"),value:"auto"},...d?oe||[]:[],...ee||[]];(0,ea.useEffect)(()=>{O?.forEach(Y=>{C(),B(Y.clientId,{...ne(Y.attributes),id:Y.id,align:void 0})})},[O]);let te=r$(G,i,z);function ne(Y){let ze=Y.id?G.find(({id:Te})=>Te===Y.id):null,Me;Y.className&&Y.className!==""&&(Me=Y.className);let Xe;return Y.linkTarget||Y.rel?Xe={linkTarget:Y.linkTarget,rel:Y.rel}:Xe=jN(k,r),{...KW(ze,x),...ON(ze,_,Y?.linkDestination),...Xe,className:Me,sizeSlug:x,caption:Y.caption.length>0?Y.caption:ze.caption?.raw,alt:Y.alt||ze.alt_text,aspectRatio:S==="auto"?void 0:S}}function le(Y){let ze=ea.Platform.isNative&&Y.id?G.find(({id:Xe})=>Xe===Y.id):null,Me=ze?ze?.media_type:Y.type;return WN.some(Xe=>Me?.indexOf(Xe)===0)||Y.blob}function pe(Y){let ze=Object.prototype.toString.call(Y)==="[object FileList]",Me=ze?Array.from(Y).map(Je=>Je.url?Je:{blob:(0,$N.createBlobURL)(Je)}):Y;Me.every(le)||H((0,he.__)("If uploading to a gallery all files need to be image formats"),{id:"gallery-upload-invalid-file",type:"snackbar"});let Xe=Me.filter(Je=>Je.url||le(Je)).map(Je=>Je.url?Je:{blob:Je.blob||(0,$N.createBlobURL)(Je)}),Te=Xe.reduce((Je,$r,ip)=>(Je[$r.id]=ip,Je),{}),Bt=ze?I:I.filter(Je=>Xe.find($r=>$r.id===Je.attributes.id)),xn=Xe.filter(Je=>!Bt.find($r=>Je.id===$r.attributes.id)).map(Je=>(0,p$.createBlock)("core/image",{id:Je.id,blob:Je.blob,url:Je.url,caption:Je.caption,alt:Je.alt}));N(n,Bt.concat(xn).sort((Je,$r)=>Te[Je.attributes.id]-Te[$r.attributes.id])),xn?.length>0&&D(xn[0].clientId)}function Ie(Y){H(Y,{type:"snackbar"})}function Ne(Y){t({linkTo:Y});let ze={},Me=[];F(n).innerBlocks.forEach(Te=>{Me.push(Te.clientId);let Bt=Te.attributes.id?G.find(({id:yr})=>yr===Te.attributes.id):null;ze[Te.clientId]=ON(Bt,Y,!1,Te.attributes,u)}),B(Me,ze,{uniqueByBlock:!0});let Xe=[...f].find(Te=>Te.value===Y);A((0,he.sprintf)((0,he.__)("All gallery image links updated to: %s"),Xe.noticeText),{id:"gallery-attributes-linkTo",type:"snackbar"})}function ae(Y){t({columns:Y})}function Re(){t({imageCrop:!b})}function Ee(){t({randomOrder:!y})}function ie(Y){let ze=Y?"_blank":void 0;t({linkTarget:ze});let Me={},Xe=[];F(n).innerBlocks.forEach(Bt=>{Xe.push(Bt.clientId),Me[Bt.clientId]=jN(ze,Bt.attributes)}),B(Xe,Me,{uniqueByBlock:!0});let Te=Y?(0,he.__)("All gallery images updated to open in new tab"):(0,he.__)("All gallery images updated to not open in new tab");A(Te,{id:"gallery-attributes-openInNewTab",type:"snackbar"})}function fe(Y){t({sizeSlug:Y});let ze={},Me=[];F(n).innerBlocks.forEach(Te=>{Me.push(Te.clientId);let Bt=Te.attributes.id?G.find(({id:yr})=>yr===Te.attributes.id):null;ze[Te.clientId]=XW(Bt,Y)}),B(Me,ze,{uniqueByBlock:!0});let Xe=te.find(Te=>Te.value===Y);A((0,he.sprintf)((0,he.__)("All gallery image sizes updated to: %s"),Xe?.label??Y),{id:"gallery-attributes-sizeSlug",type:"snackbar"})}function ke(Y){t({aspectRatio:Y});let ze={},Me=[];F(n).innerBlocks.forEach(Te=>{Me.push(Te.clientId),ze[Te.clientId]={aspectRatio:Y==="auto"?void 0:Y}}),B(Me,ze,!0);let Xe=X.find(Te=>Te.value===Y);A((0,he.sprintf)((0,he.__)("All gallery images updated to aspect ratio: %s"),Xe?.label||Y),{id:"gallery-attributes-aspectRatio",type:"snackbar"})}(0,ea.useEffect)(()=>{_||(C(),t({linkTo:window?.wp?.media?.view?.settings?.defaultProps?.link||Ws}))},[_]);let je=!!j.length,de=je&&j.some(Y=>!!Y.id),ct=j.some(Y=>ea.Platform.isNative?Y.url?.indexOf("file:")===0:!Y.id&&Y.url?.indexOf("blob:")===0),at=ea.Platform.select({web:{addToGallery:!1,disableMediaButtons:ct,value:{}},native:{addToGallery:de,isAppender:je,disableMediaButtons:je&&!i||ct,value:de?j:{},autoOpenMediaUpload:!je&&i&&R,onFocus:c}}),kt=(0,He.jsx)(Do.MediaPlaceholder,{handleUpload:!1,icon:ZW,labels:{title:(0,he.__)("Gallery"),instructions:Nve},onSelect:pe,allowedTypes:WN,multiple:!0,onError:Ie,...at}),Wr=(0,Do.useBlockProps)({className:w(a,"has-nested-images")}),ut=ea.Platform.isNative&&{marginHorizontal:0,marginVertical:0},br=(0,Do.useInnerBlocksProps)(Wr,{defaultBlock:Dve,directInsert:!0,orientation:"horizontal",renderAppender:!1,...ut}),mt=q();if(!je)return(0,He.jsxs)(m$.View,{...br,children:[br.children,kt]});let wo=_&&_!=="none";return(0,He.jsxs)(He.Fragment,{children:[(0,He.jsxs)(Do.InspectorControls,{children:[ea.Platform.isWeb&&(0,He.jsxs)(Ke.__experimentalToolsPanel,{label:(0,he.__)("Settings"),resetAll:()=>{t({navigationButtonType:"icon",columns:void 0,imageCrop:!0,randomOrder:!1}),ke("auto"),x!==av&&fe(av),k&&ie(!1)},dropdownMenuProps:mt,children:[j.length>1&&(0,He.jsx)(Ke.__experimentalToolsPanelItem,{isShownByDefault:!0,label:(0,he.__)("Columns"),hasValue:()=>!!g&&g!==j.length,onDeselect:()=>ae(void 0),children:(0,He.jsx)(Ke.RangeControl,{label:(0,he.__)("Columns"),value:g||VN(j.length),onChange:ae,min:1,max:Math.min(c$,j.length),required:!0,__next40pxDefaultSize:!0})}),te?.length>0&&(0,He.jsx)(Ke.__experimentalToolsPanelItem,{isShownByDefault:!0,label:(0,he.__)("Resolution"),hasValue:()=>x!==av,onDeselect:()=>fe(av),children:(0,He.jsx)(Ke.SelectControl,{label:(0,he.__)("Resolution"),help:(0,he.__)("Select the size of the source images."),value:x,options:te,onChange:fe,hideCancelButton:!0,size:"__unstable-large"})}),(0,He.jsx)(Ke.__experimentalToolsPanelItem,{isShownByDefault:!0,label:(0,he.__)("Crop images to fit"),hasValue:()=>!b,onDeselect:()=>t({imageCrop:!0}),children:(0,He.jsx)(Ke.ToggleControl,{label:(0,he.__)("Crop images to fit"),checked:!!b,onChange:Re})}),(0,He.jsx)(Ke.__experimentalToolsPanelItem,{isShownByDefault:!0,label:(0,he.__)("Randomize order"),hasValue:()=>!!y,onDeselect:()=>t({randomOrder:!1}),children:(0,He.jsx)(Ke.ToggleControl,{label:(0,he.__)("Randomize order"),checked:!!y,onChange:Ee})}),wo&&(0,He.jsx)(Ke.__experimentalToolsPanelItem,{isShownByDefault:!0,label:(0,he.__)("Open images in new tab"),hasValue:()=>!!k,onDeselect:()=>ie(!1),children:(0,He.jsx)(Ke.ToggleControl,{label:(0,he.__)("Open images in new tab"),checked:k==="_blank",onChange:ie})}),X.length>1&&(0,He.jsx)(Ke.__experimentalToolsPanelItem,{hasValue:()=>!!S&&S!=="auto",label:(0,he.__)("Aspect ratio"),onDeselect:()=>ke("auto"),isShownByDefault:!0,children:(0,He.jsx)(Ke.SelectControl,{__next40pxDefaultSize:!0,label:(0,he.__)("Aspect ratio"),help:(0,he.__)("Set a consistent aspect ratio for all images in the gallery."),value:S,options:X,onChange:ke})}),(0,He.jsx)(Ke.__experimentalToolsPanelItem,{label:(0,he.__)("Navigation button type"),isShownByDefault:!0,hasValue:()=>h!=="icon",onDeselect:()=>t({navigationButtonType:"icon"}),children:J&&(0,He.jsx)(Ke.__experimentalToggleGroupControl,{label:(0,he.__)("Navigation button type"),value:h,onChange:Y=>t({navigationButtonType:Y}),isBlock:!0,__next40pxDefaultSize:!0,help:(0,he.__)("Adjust the appearance of buttons in the lightbox."),children:Ive.map(Y=>(0,He.jsx)(Ke.__experimentalToggleGroupControlOption,{value:Y.value,label:Y.label},Y.value))})})]}),ea.Platform.isNative&&(0,He.jsxs)(Ke.PanelBody,{title:(0,he.__)("Settings"),children:[j.length>1&&(0,He.jsx)(Ke.RangeControl,{label:(0,he.__)("Columns"),value:g||VN(j.length),onChange:ae,min:1,max:Math.min(c$,j.length),...Eve,required:!0,__next40pxDefaultSize:!0}),te?.length>0&&(0,He.jsx)(Ke.SelectControl,{label:(0,he.__)("Resolution"),help:(0,he.__)("Select the size of the source images."),value:x,options:te,onChange:fe,hideCancelButton:!0,size:"__unstable-large"}),(0,He.jsx)(Ke.SelectControl,{label:(0,he.__)("Link"),value:_,onChange:Ne,options:f,hideCancelButton:!0,size:"__unstable-large"}),(0,He.jsx)(Ke.ToggleControl,{label:(0,he.__)("Crop images to fit"),checked:!!b,onChange:Re}),(0,He.jsx)(Ke.ToggleControl,{label:(0,he.__)("Randomize order"),checked:!!y,onChange:Ee}),wo&&(0,He.jsx)(Ke.ToggleControl,{label:(0,he.__)("Open images in new tab"),checked:k==="_blank",onChange:ie}),X.length>1&&(0,He.jsx)(Ke.SelectControl,{label:(0,he.__)("Aspect Ratio"),help:(0,he.__)("Set a consistent aspect ratio for all images in the gallery."),value:S,options:X,onChange:ke,hideCancelButton:!0,size:"__unstable-large"})]})]}),ea.Platform.isWeb?(0,He.jsx)(Do.BlockControls,{group:"block",children:(0,He.jsx)(Ke.ToolbarDropdownMenu,{icon:ii,label:(0,he.__)("Link"),children:({onClose:Y})=>(0,He.jsx)(Ke.MenuGroup,{children:f.map(ze=>{let Me=_===ze.value;return(0,He.jsx)(Ke.MenuItem,{isSelected:Me,className:w("components-dropdown-menu__menu-item",{"is-active":Me}),iconPosition:"left",icon:ze.icon,onClick:()=>{Ne(ze.value),Y()},role:"menuitemradio",info:ze.infoText,children:ze.label},ze.value)})})})}):null,ea.Platform.isWeb&&(0,He.jsxs)(He.Fragment,{children:[!$&&(0,He.jsx)(Do.BlockControls,{group:"other",children:(0,He.jsx)(Do.MediaReplaceFlow,{allowedTypes:WN,handleUpload:!1,onSelect:pe,name:(0,he.__)("Add"),multiple:!0,mediaIds:j.filter(Y=>Y.id).map(Y=>Y.id),addToGallery:de,variant:"toolbar"})}),(0,He.jsx)(s$,{blockGap:r.style?.spacing?.blockGap,clientId:n})]}),(0,He.jsx)(e$,{...e,isContentLocked:s,images:j,mediaPlaceholder:!je||ea.Platform.isNative?kt:void 0,blockProps:br,insertBlocksAfter:l,multiGallerySelection:$})]})}var j5={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/gallery",title:"Gallery",category:"media",usesContext:["galleryId"],allowedBlocks:["core/image"],description:"Display multiple images in a rich gallery.",keywords:["images","photos"],textdomain:"default",attributes:{images:{type:"array",default:[],source:"query",selector:".blocks-gallery-item",query:{url:{type:"string",source:"attribute",selector:"img",attribute:"src"},fullUrl:{type:"string",source:"attribute",selector:"img",attribute:"data-full-url"},link:{type:"string",source:"attribute",selector:"img",attribute:"data-link"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""},id:{type:"string",source:"attribute",selector:"img",attribute:"data-id"},caption:{type:"rich-text",source:"rich-text",selector:".blocks-gallery-item__caption"}}},ids:{type:"array",items:{type:"number"},default:[]},navigationButtonType:{type:"string",default:"icon",enum:["icon","text","both"]},shortCodeTransforms:{type:"array",items:{type:"object"},default:[]},columns:{type:"number",minimum:1,maximum:8},caption:{type:"rich-text",source:"rich-text",selector:".blocks-gallery-caption",role:"content"},imageCrop:{type:"boolean",default:!0},randomOrder:{type:"boolean",default:!1},fixedHeight:{type:"boolean",default:!0},linkTarget:{type:"string"},linkTo:{type:"string"},sizeSlug:{type:"string",default:"large"},allowResize:{type:"boolean",default:!1},aspectRatio:{type:"string",default:"auto"}},providesContext:{allowResize:"allowResize",imageCrop:"imageCrop",fixedHeight:"fixedHeight",navigationButtonType:"navigationButtonType"},supports:{anchor:!0,align:!0,__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{color:!0,radius:!0}},html:!1,units:["px","em","rem","vh","vw"],spacing:{margin:!0,padding:!0,blockGap:["horizontal","vertical"],__experimentalSkipSerialization:["blockGap"],__experimentalDefaultControls:{blockGap:!0,margin:!1,padding:!1}},color:{text:!1,background:!0,gradients:!0},layout:{allowSwitching:!1,allowInheriting:!1,allowEditing:!1,default:{type:"flex"}},interactivity:{clientNavigation:!0},listView:!0},editorStyle:"wp-block-gallery-editor",style:"wp-block-gallery"};var ru=o(T(),1),U5=o(v(),1);function h$({attributes:e}){let{caption:t,columns:r,imageCrop:a}=e,n=w("has-nested-images",{[`columns-${r}`]:r!==void 0,"columns-default":r===void 0,"is-cropped":a}),i=ru.useBlockProps.save({className:n}),l=ru.useInnerBlocksProps.save(i);return(0,U5.jsxs)("figure",{...l,children:[l.children,!ru.RichText.isEmpty(t)&&(0,U5.jsx)(ru.RichText.Content,{tagName:"figcaption",className:w("blocks-gallery-caption",(0,ru.__experimentalGetElementClassName)("caption")),value:t})]})}var Ks=o(W(),1),g$=o(Rr(),1),qN=o(Yc(),1);var Ave=e=>e?e.split(",").map(t=>parseInt(t,10)):[];function Rve(e){if(e.name==="core/gallery"&&e.attributes?.images.length>0){let t=e.attributes.images.map(({url:r,id:a,alt:n})=>(0,Ks.createBlock)("core/image",{url:r,id:a?parseInt(a,10):null,alt:n,sizeSlug:e.attributes.sizeSlug,linkDestination:e.attributes.linkDestination}));delete e.attributes.ids,delete e.attributes.images,e.innerBlocks=t}return e}(0,qN.addFilter)("blocks.switchToBlockType.transformedBlock","core/gallery/update-third-party-transform-to",Rve);function zve(e,t){let a=(Array.isArray(t)?t:[t]).find(n=>n.name==="core/gallery"&&n.innerBlocks.length>0&&!n.attributes.images?.length>0&&!e.name.includes("core/"));if(a){let n=a.innerBlocks.map(({attributes:{url:l,id:s,alt:c}})=>({url:l,id:s?parseInt(s,10):null,alt:c})),i=n.map(({id:l})=>l);a.attributes.images=n,a.attributes.ids=i}return e}(0,qN.addFilter)("blocks.switchToBlockType.transformedBlock","core/gallery/update-third-party-transform-from",zve);var Vve={from:[{type:"block",isMultiBlock:!0,blocks:["core/image"],transform:e=>{let{align:t,sizeSlug:r}=e[0];t=e.every(i=>i.align===t)?t:void 0,r=e.every(i=>i.sizeSlug===r)?r:void 0;let n=e.filter(({url:i})=>i).map(i=>(i.width=void 0,i.height=void 0,(0,Ks.createBlock)("core/image",i)));return(0,Ks.createBlock)("core/gallery",{align:t,sizeSlug:r},n)}},{type:"shortcode",tag:"gallery",transform({named:{ids:e,columns:t=3,link:r,orderby:a,size:n}}){let i=Ave(e).map(c=>parseInt(c,10)),l=Ws;return r==="post"?l=qs:r==="file"&&(l=$s),(0,Ks.createBlock)("core/gallery",{columns:parseInt(t,10),linkTo:l,randomOrder:a==="rand",...n&&{sizeSlug:n}},i.map(c=>(0,Ks.createBlock)("core/image",{id:c,...n&&{sizeSlug:n}})))},isMatch({named:e}){return e.ids!==void 0}},{type:"files",priority:1,isMatch(e){return e.length!==1&&e.every(t=>t.type.indexOf("image/")===0)},transform(e){let t=e.map(r=>(0,Ks.createBlock)("core/image",{blob:(0,g$.createBlobURL)(r)}));return(0,Ks.createBlock)("core/gallery",{},t)}}],to:[{type:"block",blocks:["core/image"],transform:({align:e},t)=>t.length>0?t.map(({attributes:{url:r,alt:a,caption:n,title:i,href:l,rel:s,linkClass:c,id:u,sizeSlug:m,linkDestination:p,linkTarget:d,anchor:f,className:h}})=>(0,Ks.createBlock)("core/image",{align:e,url:r,alt:a,caption:n,title:i,href:l,rel:s,linkClass:c,id:u,sizeSlug:m,linkDestination:p,linkTarget:d,anchor:f,className:h})):(0,Ks.createBlock)("core/image",{align:e})}]},v$=Vve;var{name:b$}=j5,y$={icon:j0,example:{attributes:{columns:2},innerBlocks:[{name:"core/image",attributes:{url:"https://s.w.org/images/core/5.3/Glacial_lakes%2C_Bhutan.jpg"}},{name:"core/image",attributes:{url:"https://s.w.org/images/core/5.3/Sediment_off_the_Yucatan_Peninsula.jpg"}}]},transforms:v$,edit:f$,save:h$,deprecated:WW},Fve=()=>E({name:b$,metadata:j5,settings:y$});var JN={};Z(JN,{init:()=>Kve,metadata:()=>W5,name:()=>Z5,settings:()=>M$});var q5=o(P(),1);var Ca=o(T(),1),bi=o(v(),1),KN=e=>{if(e.tagName||(e={...e,tagName:"div"}),!e.customTextColor&&!e.customBackgroundColor)return e;let t={color:{}};e.customTextColor&&(t.color.text=e.customTextColor),e.customBackgroundColor&&(t.color.background=e.customBackgroundColor);let{customTextColor:r,customBackgroundColor:a,...n}=e;return{...n,style:t}},Hve=[{attributes:{tagName:{type:"string",default:"div"},templateLock:{type:["string","boolean"],enum:["all","insert",!1]}},supports:{__experimentalOnEnter:!0,__experimentalSettings:!0,align:["wide","full"],anchor:!0,ariaLabel:!0,html:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:["top","bottom"],padding:!0,blockGap:!0,__experimentalDefaultControls:{padding:!0,blockGap:!0}},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,radius:!0,style:!0,width:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0}},layout:!0},save({attributes:{tagName:e}}){return(0,bi.jsx)(e,{...Ca.useInnerBlocksProps.save(Ca.useBlockProps.save())})},isEligible:({layout:e})=>e?.inherit||e?.contentSize&&e?.type!=="constrained",migrate:e=>{let{layout:t=null}=e;if(t?.inherit||t?.contentSize)return{...e,layout:{...t,type:"constrained"}}}},{attributes:{tagName:{type:"string",default:"div"},templateLock:{type:["string","boolean"],enum:["all","insert",!1]}},supports:{align:["wide","full"],anchor:!0,color:{gradients:!0,link:!0},spacing:{padding:!0},__experimentalBorder:{radius:!0}},save({attributes:e}){let{tagName:t}=e;return(0,bi.jsx)(t,{...Ca.useBlockProps.save(),children:(0,bi.jsx)("div",{className:"wp-block-group__inner-container",children:(0,bi.jsx)(Ca.InnerBlocks.Content,{})})})}},{attributes:{backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},textColor:{type:"string"},customTextColor:{type:"string"}},supports:{align:["wide","full"],anchor:!0,html:!1},migrate:KN,save({attributes:e}){let{backgroundColor:t,customBackgroundColor:r,textColor:a,customTextColor:n}=e,i=(0,Ca.getColorClassName)("background-color",t),l=(0,Ca.getColorClassName)("color",a),s=w(i,l,{"has-text-color":a||n,"has-background":t||r});return(0,bi.jsx)("div",{className:s,style:{backgroundColor:i?void 0:r,color:l?void 0:n},children:(0,bi.jsx)("div",{className:"wp-block-group__inner-container",children:(0,bi.jsx)(Ca.InnerBlocks.Content,{})})})}},{attributes:{backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},textColor:{type:"string"},customTextColor:{type:"string"}},migrate:KN,supports:{align:["wide","full"],anchor:!0,html:!1},save({attributes:e}){let{backgroundColor:t,customBackgroundColor:r,textColor:a,customTextColor:n}=e,i=(0,Ca.getColorClassName)("background-color",t),l=(0,Ca.getColorClassName)("color",a),s=w(i,{"has-text-color":a||n,"has-background":t||r});return(0,bi.jsx)("div",{className:s,style:{backgroundColor:i?void 0:r,color:l?void 0:n},children:(0,bi.jsx)("div",{className:"wp-block-group__inner-container",children:(0,bi.jsx)(Ca.InnerBlocks.Content,{})})})}},{attributes:{backgroundColor:{type:"string"},customBackgroundColor:{type:"string"}},supports:{align:["wide","full"],anchor:!0,html:!1},migrate:KN,save({attributes:e}){let{backgroundColor:t,customBackgroundColor:r}=e,a=(0,Ca.getColorClassName)("background-color",t),n=w(a,{"has-background":t||r});return(0,bi.jsx)("div",{className:n,style:{backgroundColor:a?void 0:r},children:(0,bi.jsx)(Ca.InnerBlocks.Content,{})})}}],_$=Hve;var G5=o(V(),1),_i=o(T(),1),T$=o(U(),1),P$=o(P(),1),B$=o(L(),1);var x$=o(V(),1),k$=o(T(),1),QN=o(P(),1),w$=o(W(),1),zn=o(M(),1),cv=o(U(),1),Rn=o(v(),1),Ove=(e="group")=>({group:(0,Rn.jsx)(zn.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 48 48",children:(0,Rn.jsx)(zn.Path,{d:"M0 10a2 2 0 0 1 2-2h44a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Z"})}),"group-row":(0,Rn.jsx)(zn.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 48 48",children:(0,Rn.jsx)(zn.Path,{d:"M0 10a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Zm25 0a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H27a2 2 0 0 1-2-2V10Z"})}),"group-stack":(0,Rn.jsx)(zn.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 48 48",children:(0,Rn.jsx)(zn.Path,{d:"M0 10a2 2 0 0 1 2-2h44a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Zm0 17a2 2 0 0 1 2-2h44a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V27Z"})}),"group-grid":(0,Rn.jsx)(zn.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 48 48",children:(0,Rn.jsx)(zn.Path,{d:"M0 10a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Zm25 0a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H27a2 2 0 0 1-2-2V10ZM0 27a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V27Zm25 0a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H27a2 2 0 0 1-2-2V27Z"})})})?.[e];function C$({attributes:e={style:void 0,backgroundColor:void 0,textColor:void 0,fontSize:void 0},usedLayoutType:t="",hasInnerBlocks:r=!1}){let{style:a,backgroundColor:n,textColor:i,fontSize:l}=e,[s,c]=(0,cv.useState)(!r&&!n&&!l&&!i&&!a&&t!=="flex"&&t!=="grid");return(0,cv.useEffect)(()=>{(r||n||l||i||a||t==="flex")&&c(!1)},[n,l,i,a,t,r]),[s,c]}function jve({name:e,onSelect:t}){let r=(0,x$.useSelect)(n=>n(w$.store).getBlockVariations(e,"block"),[e]),a=(0,k$.useBlockProps)({className:"wp-block-group__placeholder"});return(0,cv.useEffect)(()=>{r&&r.length===1&&t(r[0])},[t,r]),(0,Rn.jsx)("div",{...a,children:(0,Rn.jsx)(zn.Placeholder,{instructions:(0,QN.__)("Group blocks together. Select a layout:"),children:(0,Rn.jsx)("ul",{role:"list",className:"wp-block-group-placeholder__variations","aria-label":(0,QN.__)("Block variations"),children:r.map(n=>(0,Rn.jsx)("li",{children:(0,Rn.jsx)(zn.Button,{__next40pxDefaultSize:!0,variant:"tertiary",icon:Ove(n.name),iconSize:48,onClick:()=>t(n),className:"wp-block-group-placeholder__variation-button",label:`${n.title}: ${n.description}`})},n.name))})})})}var S$=jve;var yi=o(v(),1),{HTMLElementControl:Uve}=K(_i.privateApis);function Gve({tagName:e,onSelectTagName:t,clientId:r}){return(0,yi.jsx)(_i.InspectorControls,{group:"advanced",children:(0,yi.jsx)(Uve,{tagName:e,onChange:t,clientId:r,options:[{label:(0,P$.__)("Default (<div>)"),value:"div"},{label:"<header>",value:"header"},{label:"<main>",value:"main"},{label:"<section>",value:"section"},{label:"<article>",value:"article"},{label:"<aside>",value:"aside"},{label:"<footer>",value:"footer"}]})})}function Wve({attributes:e,name:t,setAttributes:r,clientId:a}){let{hasInnerBlocks:n,themeSupportsLayout:i}=(0,G5.useSelect)(x=>{let{getBlock:S,getSettings:C}=x(_i.store),N=S(a);return{hasInnerBlocks:!!(N&&N.innerBlocks.length),themeSupportsLayout:C()?.supportsLayout}},[a]),{tagName:l="div",templateLock:s,allowedBlocks:c,layout:u={}}=e,{type:m="default"}=u,p=i||m==="flex"||m==="grid",d=(0,T$.useRef)(),f=(0,_i.useBlockProps)({ref:d}),[h,g]=C$({attributes:e,usedLayoutType:m,hasInnerBlocks:n}),b;h?b=!1:n||(b=_i.InnerBlocks.ButtonBlockAppender);let y=(0,_i.useInnerBlocksProps)(p?f:{className:"wp-block-group__inner-container"},{dropZoneElement:d.current,templateLock:s,allowedBlocks:c,renderAppender:b}),{selectBlock:k}=(0,G5.useDispatch)(_i.store),_=x=>{r(x.attributes),k(a,-1),g(!1)};return(0,yi.jsxs)(yi.Fragment,{children:[(0,yi.jsx)(Gve,{tagName:l,onSelectTagName:x=>r({tagName:x}),clientId:a}),h&&(0,yi.jsxs)(B$.View,{children:[y.children,(0,yi.jsx)(S$,{name:t,onSelect:_})]}),p&&!h&&(0,yi.jsx)(l,{...y}),!p&&!h&&(0,yi.jsx)(l,{...f,children:(0,yi.jsx)("div",{...y})})]})}var I$=Wve;var W5={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/group",title:"Group",category:"design",description:"Gather blocks in a layout container.",keywords:["container","wrapper","row","section"],textdomain:"default",attributes:{tagName:{type:"string",default:"div"},templateLock:{type:["string","boolean"],enum:["all","insert","contentOnly",!1]}},supports:{__experimentalOnEnter:!0,__experimentalOnMerge:!0,__experimentalSettings:!0,align:["wide","full"],anchor:!0,ariaLabel:!0,html:!1,background:{backgroundImage:!0,backgroundSize:!0,__experimentalDefaultControls:{backgroundImage:!0}},color:{gradients:!0,heading:!0,button:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},shadow:!0,spacing:{margin:["top","bottom"],padding:!0,blockGap:!0,__experimentalDefaultControls:{padding:!0,blockGap:!0}},dimensions:{minHeight:!0},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,radius:!0,style:!0,width:!0}},position:{sticky:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},layout:{allowSizingOnChildren:!0},interactivity:{clientNavigation:!0},allowedBlocks:!0},editorStyle:"wp-block-group-editor",style:"wp-block-group"};var $5=o(T(),1),N$=o(v(),1);function E$({attributes:{tagName:e}}){return(0,N$.jsx)(e,{...$5.useInnerBlocksProps.save($5.useBlockProps.save())})}var YN=o(W(),1),qve={from:[{type:"block",isMultiBlock:!0,blocks:["*"],__experimentalConvert(e){let t=["wide","full"],r=e.reduce((n,i)=>{let{align:l}=i.attributes;return t.indexOf(l)>t.indexOf(n)?l:n},void 0),a=e.map(n=>(0,YN.createBlock)(n.name,n.attributes,n.innerBlocks));return(0,YN.createBlock)("core/group",{align:r,layout:{type:"constrained"}},a)}}]},D$=qve;var Sa=o(P(),1);var XN={innerBlocks:[{name:"core/paragraph",attributes:{content:(0,Sa.__)("One.")}},{name:"core/paragraph",attributes:{content:(0,Sa.__)("Two.")}},{name:"core/paragraph",attributes:{content:(0,Sa.__)("Three.")}},{name:"core/paragraph",attributes:{content:(0,Sa.__)("Four.")}},{name:"core/paragraph",attributes:{content:(0,Sa.__)("Five.")}},{name:"core/paragraph",attributes:{content:(0,Sa.__)("Six.")}}]},Zve=[{name:"group",title:(0,Sa.__)("Group"),description:(0,Sa.__)("Gather blocks in a container."),attributes:{layout:{type:"constrained"}},isDefault:!0,scope:["block","inserter","transform"],icon:wp},{name:"group-row",title:(0,Sa._x)("Row","single horizontal line"),description:(0,Sa.__)("Arrange blocks horizontally."),attributes:{layout:{type:"flex",flexWrap:"nowrap"}},scope:["block","inserter","transform"],isActive:["layout.type"],icon:UP,example:XN},{name:"group-stack",title:(0,Sa.__)("Stack"),description:(0,Sa.__)("Arrange blocks vertically."),attributes:{layout:{type:"flex",orientation:"vertical"}},scope:["block","inserter","transform"],isActive:["layout.type","layout.orientation"],icon:oB,example:XN},{name:"group-grid",title:(0,Sa.__)("Grid"),description:(0,Sa.__)("Arrange blocks in a grid."),attributes:{layout:{type:"grid"}},scope:["block","inserter","transform"],isActive:["layout.type"],icon:Il,example:XN}],L$=Zve;var{name:Z5}=W5,M$={icon:wp,example:{attributes:{layout:{type:"constrained",justifyContent:"center"},style:{spacing:{padding:{top:"4em",right:"3em",bottom:"4em",left:"3em"}}}},innerBlocks:[{name:"core/heading",attributes:{content:(0,q5.__)("La Mancha"),style:{typography:{textAlign:"center"}}}},{name:"core/paragraph",attributes:{style:{typography:{textAlign:"center"}},content:(0,q5.__)("In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing.")}},{name:"core/spacer",attributes:{height:"10px"}},{name:"core/button",attributes:{text:(0,q5.__)("Read more")}}],viewportWidth:600},transforms:D$,edit:I$,save:E$,deprecated:_$,variations:L$},Kve=()=>E({name:Z5,metadata:W5,settings:M$});var aE={};Z(aE,{init:()=>p2e,metadata:()=>J5,name:()=>t4,settings:()=>r4});var hm=o(P(),1),vh=o(W(),1);var rn=o(T(),1);var Qs=o(v(),1),eE={className:!1,anchor:!0},K5={align:{type:"string"},content:{type:"string",source:"html",selector:"h1,h2,h3,h4,h5,h6",default:""},level:{type:"number",default:2},placeholder:{type:"string"}},hh=e=>{if(!e.customTextColor)return e;let t={color:{text:e.customTextColor}},{customTextColor:r,...a}=e;return{...a,style:t}},A$=["left","right","center"],gh=e=>{let{align:t,...r}=e;return A$.includes(t)?{...r,textAlign:t}:e},Qve={supports:eE,attributes:{...K5,customTextColor:{type:"string"},textColor:{type:"string"}},migrate:e=>We(hh(gh(e))),save({attributes:e}){let{align:t,level:r,content:a,textColor:n,customTextColor:i}=e,l="h"+r,s=(0,rn.getColorClassName)("color",n),c=w({[s]:s});return(0,Qs.jsx)(rn.RichText.Content,{className:c||void 0,tagName:l,style:{textAlign:t,color:s?void 0:i},value:a})}},Yve={attributes:{...K5,customTextColor:{type:"string"},textColor:{type:"string"}},migrate:e=>We(hh(gh(e))),save({attributes:e}){let{align:t,content:r,customTextColor:a,level:n,textColor:i}=e,l="h"+n,s=(0,rn.getColorClassName)("color",i),c=w({[s]:s,[`has-text-align-${t}`]:t});return(0,Qs.jsx)(rn.RichText.Content,{className:c||void 0,tagName:l,style:{color:s?void 0:a},value:r})},supports:eE},Xve={supports:eE,attributes:{...K5,customTextColor:{type:"string"},textColor:{type:"string"}},migrate:e=>We(hh(gh(e))),save({attributes:e}){let{align:t,content:r,customTextColor:a,level:n,textColor:i}=e,l="h"+n,s=(0,rn.getColorClassName)("color",i),c=w({[s]:s,"has-text-color":i||a,[`has-text-align-${t}`]:t});return(0,Qs.jsx)(rn.RichText.Content,{className:c||void 0,tagName:l,style:{color:s?void 0:a},value:r})}},Jve={supports:{align:["wide","full"],anchor:!0,className:!1,color:{link:!0},fontSize:!0,lineHeight:!0,__experimentalSelector:{"core/heading/h1":"h1","core/heading/h2":"h2","core/heading/h3":"h3","core/heading/h4":"h4","core/heading/h5":"h5","core/heading/h6":"h6"},__unstablePasteTextInline:!0},attributes:K5,isEligible:({align:e})=>A$.includes(e),migrate:e=>We(hh(gh(e))),save({attributes:e}){let{align:t,content:r,level:a}=e,n="h"+a,i=w({[`has-text-align-${t}`]:t});return(0,Qs.jsx)(n,{...rn.useBlockProps.save({className:i}),children:(0,Qs.jsx)(rn.RichText.Content,{value:r})})}},e2e={supports:{align:["wide","full"],anchor:!0,className:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalDefaultControls:{fontSize:!0,fontAppearance:!0,textTransform:!0}},__experimentalSelector:"h1,h2,h3,h4,h5,h6",__unstablePasteTextInline:!0,__experimentalSlashInserter:!0},attributes:{textAlign:{type:"string"},content:{type:"string",source:"html",selector:"h1,h2,h3,h4,h5,h6",default:"",role:"content"},level:{type:"number",default:2},placeholder:{type:"string"}},save({attributes:e}){let{textAlign:t,content:r,level:a}=e,n="h"+a,i=w({[`has-text-align-${t}`]:t});return(0,Qs.jsx)(n,{...rn.useBlockProps.save({className:i}),children:(0,Qs.jsx)(rn.RichText.Content,{value:r})})},migrate:e=>We(hh(gh(e)))},t2e={supports:{align:["wide","full"],anchor:!0,className:!0,splitting:!0,__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0},color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalWritingMode:!0,fitText:!0,__experimentalDefaultControls:{fontSize:!0}},__unstablePasteTextInline:!0,__experimentalSlashInserter:!0,interactivity:{clientNavigation:!0}},attributes:{textAlign:{type:"string"},content:{type:"string",source:"html",selector:"h1,h2,h3,h4,h5,h6",default:"",role:"content"},level:{type:"number",default:2},levelOptions:{type:"array"},placeholder:{type:"string"}},save({attributes:e}){let{textAlign:t,content:r,level:a}=e,n="h"+a,i=w({[`has-text-align-${t}`]:t});return(0,Qs.jsx)(n,{...rn.useBlockProps.save({className:i}),children:(0,Qs.jsx)(rn.RichText.Content,{value:r})})},migrate:e=>We(hh(gh(e))),isEligible(e){return!!e.textAlign||!!e.className?.match(/\bhas-text-align-(left|center|right)\b/)}},r2e=[t2e,e2e,Jve,Xve,Yve,Qve],R$=r2e;var V$=o(P(),1),Y5=o(U(),1),X5=o(V(),1),ld=o(T(),1);var z$=o(rv(),1),tE={},o2e=e=>{let t=document.createElement("div");return t.innerHTML=e,t.innerText},a2e=e=>(0,z$.default)(o2e(e)).replace(/[^\p{L}\p{N}]+/gu,"-").toLowerCase().replace(/(^-+)|(-+$)/g,""),Q5=(e,t)=>{let r=a2e(t);if(r==="")return null;delete tE[e];let a=r,n=0;for(;Object.values(tE).includes(a);)n+=1,a=r+"-"+n;return a},rE=(e,t)=>{tE[e]=t};var uv=o(v(),1);function n2e(e){let{attributes:t,setAttributes:r,mergeBlocks:a,onReplace:n,style:i,clientId:l}=e;Kr(e);let{content:s,level:c,placeholder:u,anchor:m}=t,p="h"+c,d=(0,ld.useBlockProps)({style:i}),{canGenerateAnchors:f}=(0,X5.useSelect)(b=>{let{getGlobalBlockCount:y,getSettings:k}=b(ld.store);return{canGenerateAnchors:!!k().generateAnchors||y("core/table-of-contents")>0}},[]),{__unstableMarkNextChangeAsNotPersistent:h}=(0,X5.useDispatch)(ld.store);return(0,Y5.useEffect)(()=>{if(f)return!m&&s&&(h(),r({anchor:Q5(l,s)})),rE(l,m),()=>rE(l,null)},[m,s,l,f]),(0,uv.jsx)(uv.Fragment,{children:(0,uv.jsx)(ld.RichText,{identifier:"content",tagName:p,value:s,onChange:b=>{let y={content:b};f&&(!m||!b||Q5(l,s)===m)&&(y.anchor=Q5(l,b)),r(y)},onMerge:a,onReplace:n,onRemove:()=>n([]),placeholder:u||(0,V$.__)("Heading"),...Y5.Platform.isNative&&{deleteEnter:!0},...d})})}var F$=n2e;var J5={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/heading",title:"Heading",category:"text",description:"Introduce new sections and organize content to help visitors (and search engines) understand the structure of your content.",keywords:["title","subtitle"],textdomain:"default",attributes:{content:{type:"rich-text",source:"rich-text",selector:"h1,h2,h3,h4,h5,h6",role:"content"},level:{type:"number",default:2},levelOptions:{type:"array"},placeholder:{type:"string"}},supports:{align:["wide","full"],anchor:!0,className:!0,splitting:!0,__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0},color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},typography:{fontSize:!0,lineHeight:!0,textAlign:!0,__experimentalFontFamily:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalWritingMode:!0,fitText:!0,__experimentalDefaultControls:{fontSize:!0}},__unstablePasteTextInline:!0,__experimentalSlashInserter:!0,interactivity:{clientNavigation:!0}},editorStyle:"wp-block-heading-editor",style:"wp-block-heading"};var e4=o(T(),1),oE=o(v(),1);function H$({attributes:e}){let{content:t,level:r}=e,a="h"+r;return(0,oE.jsx)(a,{...e4.useBlockProps.save(),children:(0,oE.jsx)(e4.RichText.Content,{value:t})})}var fm=o(W(),1);function O$(e){return Number(e.substr(1))}var l2e={from:[{type:"block",isMultiBlock:!0,blocks:["core/paragraph"],transform:e=>e.map(t=>{let{content:r,anchor:a,style:n}=t,i=n?.typography?.textAlign;return(0,fm.createBlock)("core/heading",{...Wc(t,"core/heading",({content:l})=>({content:l})),content:r,anchor:a,...i&&{style:{typography:{textAlign:i}}}})})},{type:"raw",selector:"h1,h2,h3,h4,h5,h6",schema:({phrasingContentSchema:e,isPaste:t})=>{let r={children:e,attributes:t?[]:["style","id"]};return{h1:r,h2:r,h3:r,h4:r,h5:r,h6:r}},transform(e){let t=(0,fm.getBlockAttributes)("core/heading",e.outerHTML),{textAlign:r}=e.style||{};return t.level=O$(e.nodeName),(r==="left"||r==="center"||r==="right")&&(t.style={...t.style,typography:{...t.style?.typography,textAlign:r}}),(0,fm.createBlock)("core/heading",t)}},...[1,2,3,4,5,6].map(e=>({type:"prefix",prefix:Array(e+1).join("#"),transform(t){return(0,fm.createBlock)("core/heading",{level:e,content:t})}})),...[1,2,3,4,5,6].map(e=>({type:"enter",regExp:new RegExp(`^/(h|H)${e}$`),transform:()=>(0,fm.createBlock)("core/heading",{level:e})}))],to:[{type:"block",isMultiBlock:!0,blocks:["core/paragraph"],transform:e=>e.map(t=>{let{content:r,style:a}=t,n=a?.typography?.textAlign;return(0,fm.createBlock)("core/paragraph",{...Wc(t,"core/paragraph",({content:i})=>({content:i})),content:r,...n&&{style:{typography:{textAlign:n}}}})})}]},j$=l2e;var mv=o(P(),1);var s2e=[Y9,J9,tT,oT,nT,lT],c2e=[...[1,2,3,4,5,6].map(e=>({name:`h${e}`,title:(0,mv.sprintf)((0,mv.__)("Heading %d"),e),description:(0,mv.__)("Introduce new sections and organize content to help visitors (and search engines) understand the structure of your content."),icon:s2e[e-1],attributes:{level:e},scope:["block","transform"],keywords:[`h${e}`],isActive:t=>t.level===e}))],U$=c2e;var{fieldsKey:u2e,formKey:m2e}=K(vh.privateApis),{name:t4}=J5,r4={icon:cT,example:{attributes:{content:(0,hm.__)("Code is Poetry"),level:2,style:{typography:{textAlign:"center"}}}},__experimentalLabel(e,{context:t}){let{content:r,level:a}=e,n=e?.metadata?.name,i=r?.trim().length>0;if(t==="list-view"&&(n||i))return n||r;if(t==="breadcrumb"&&n)return n;if(t==="accessibility")return i?(0,hm.sprintf)((0,hm.__)("Level %1$s. %2$s"),a,r):(0,hm.sprintf)((0,hm.__)("Level %s. Empty."),a)},transforms:j$,deprecated:R$,merge(e,t){return{content:(e.content||"")+(t.content||"")}},edit:F$,save:H$,variations:U$};window.__experimentalContentOnlyInspectorFields&&(r4[u2e]=[{id:"content",label:(0,hm.__)("Content"),type:"text",Edit:"rich-text"}],r4[m2e]={fields:["content"]});var p2e=()=>{let e=E({name:t4,metadata:J5,settings:r4}),t=(0,vh.getBlockType)(t4)?.attributes?.levelOptions?.default;return t&&[1,2,3,4,5,6].forEach(r=>{t.includes(r)||(0,vh.unregisterBlockVariation)(t4,`h${r}`)}),e};var nE={};Z(nE,{init:()=>h2e,metadata:()=>o4,name:()=>Y$,settings:()=>X$});var Q$=o(P(),1);var o4={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/home-link",category:"design",parent:["core/navigation"],title:"Home Link",description:"Create a link that always points to the homepage of the site. Usually not necessary if there is already a site title link present in the header.",textdomain:"default",attributes:{label:{type:"string",role:"content"}},usesContext:["textColor","customTextColor","backgroundColor","customBackgroundColor","fontSize","customFontSize","style"],supports:{anchor:!0,reusable:!1,html:!1,typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}},editorStyle:"wp-block-home-link-editor",style:"wp-block-home-link"};var i4=o(T(),1),a4=o(P(),1),G$=o(V(),1),W$=o(Q(),1),n4=o(v(),1),f2e=e=>e.preventDefault();function $$({attributes:e,setAttributes:t,context:r}){let a=(0,G$.useSelect)(c=>c(W$.store).getEntityRecord("root","__unstableBase")?.home,[]),{textColor:n,backgroundColor:i,style:l}=r,s=(0,i4.useBlockProps)({className:w("wp-block-navigation-item",{"has-text-color":!!n||!!l?.color?.text,[`has-${n}-color`]:!!n,"has-background":!!i||!!l?.color?.background,[`has-${i}-background-color`]:!!i}),style:{color:l?.color?.text,backgroundColor:l?.color?.background}});return(0,n4.jsx)("div",{...s,children:(0,n4.jsx)("a",{className:"wp-block-home-link__content wp-block-navigation-item__content",href:a,onClick:f2e,children:(0,n4.jsx)(i4.RichText,{identifier:"label",className:"wp-block-home-link__label",value:e.label??(0,a4.__)("Home"),onChange:c=>{t({label:c})},"aria-label":(0,a4.__)("Home link text"),placeholder:(0,a4.__)("Add home link"),withoutInteractiveFormatting:!0})})})}var q$=o(T(),1),Z$=o(v(),1);function K$(){return(0,Z$.jsx)(q$.InnerBlocks.Content,{})}var{name:Y$}=o4,X$={icon:mT,edit:$$,save:K$,example:{attributes:{label:(0,Q$._x)("Home Link","block example")}}},h2e=()=>E({name:Y$,metadata:o4,settings:X$});var sE={};Z(sE,{init:()=>y2e,metadata:()=>c4,name:()=>hq,settings:()=>gq});var fq=o(P(),1);var yh=o(P(),1),iq=o(U(),1),vm=o(T(),1),Jl=o(M(),1);var J$=o(U(),1),l4=o(T(),1),eq=o(M(),1),tq=o(V(),1),rq=o(P(),1),sd=o(v(),1),g2e=` html,body,:root { margin: 0 !important; padding: 0 !important; overflow: visible !important; min-height: auto !important; } `;function s4({content:e,isSelected:t}){let r=(0,tq.useSelect)(n=>n(l4.store).getSettings().styles,[]),a=(0,J$.useMemo)(()=>[g2e,...(0,l4.transformStyles)((r??[]).filter(n=>n.css))],[r]);return(0,sd.jsxs)(sd.Fragment,{children:[(0,sd.jsx)(eq.SandBox,{html:e,styles:a,title:(0,rq.__)("Custom HTML Preview"),tabIndex:-1}),!t&&(0,sd.jsx)("div",{className:"block-library-html__preview-overlay"})]})}var xi=o(P(),1),pv=o(U(),1),aq=o(V(),1),ta=o(M(),1),bh=o(T(),1);var nq=o(me(),1);function oq(e=""){if(!e||!e.trim())return{html:"",css:"",js:""};let t=document.implementation.createHTMLDocument("");t.body.innerHTML=e;let r=t.body.querySelector('style[data-wp-block-html="css"]'),a=r?r.textContent.trim():"";r&&r.remove();let n=t.body.querySelector('script[data-wp-block-html="js"]'),i=n?n.textContent.trim():"";return n&&n.remove(),{html:t.body.innerHTML.trim(),css:a,js:i}}function iE({html:e="",css:t="",js:r=""}){let a=[];return t.trim()&&a.push(`<style data-wp-block-html="css"> ${t} </style>`),r.trim()&&a.push(`<script data-wp-block-html="js"> ${r} <\/script>`),e.trim()&&a.push(e),a.join(` `)}var Ct=o(v(),1),{Tabs:gm}=K(ta.privateApis);function lE({isOpen:e,onRequestClose:t,content:r,setAttributes:a}){let{html:n,css:i,js:l}=oq(r),[s,c]=(0,pv.useState)(n),[u,m]=(0,pv.useState)(i),[p,d]=(0,pv.useState)(l),[f,h]=(0,pv.useState)(!1),g=(0,nq.useViewportMatch)("small","<"),{canUserUseUnfilteredHTML:b}=(0,aq.useSelect)(S=>({canUserUseUnfilteredHTML:S(bh.store).getSettings().__experimentalCanUserUseUnfilteredHTML}),[]),y=!b&&(i.trim()||l.trim());if(!e)return null;let k=()=>{a({content:iE({html:s,css:b?u:"",js:b?p:""})})},_=()=>{k(),t()},x=()=>{h(S=>!S)};return(0,Ct.jsx)(Ct.Fragment,{children:(0,Ct.jsx)(ta.Modal,{title:(0,xi.__)("Edit HTML"),onRequestClose:t,className:"block-library-html__modal",size:"large",isDismissible:!1,shouldCloseOnClickOutside:!1,isFullScreen:f,__experimentalHideHeader:!0,children:(0,Ct.jsx)(gm,{orientation:"horizontal",defaultTabId:"html",children:(0,Ct.jsxs)(ta.__experimentalVStack,{expanded:!0,children:[(0,Ct.jsxs)(ta.__experimentalHStack,{justify:"space-between",className:"block-library-html__modal-header",children:[(0,Ct.jsx)("div",{children:(0,Ct.jsxs)(gm.TabList,{children:[(0,Ct.jsx)(gm.Tab,{tabId:"html",children:"HTML"}),b&&(0,Ct.jsx)(gm.Tab,{tabId:"css",children:"CSS"}),b&&(0,Ct.jsx)(gm.Tab,{tabId:"js",children:(0,xi.__)("JavaScript")})]})}),!g&&(0,Ct.jsx)("div",{children:(0,Ct.jsx)(ta.Button,{__next40pxDefaultSize:!0,icon:f?tB:kp,label:(0,xi.__)("Enable/disable fullscreen"),onClick:x,variant:"tertiary"})})]}),y&&(0,Ct.jsx)(ta.Notice,{status:"warning",isDismissible:!1,className:"block-library-html__modal-notice",children:(0,xi.__)("This block contains CSS or JavaScript that will be removed when you save because you do not have permission to use unfiltered HTML.")}),(0,Ct.jsxs)(ta.Flex,{direction:g?"column":"row",className:"block-library-html__modal-tabs",align:"stretch",gap:8,children:[(0,Ct.jsxs)("div",{className:"block-library-html__modal-content",children:[(0,Ct.jsx)(gm.TabPanel,{tabId:"html",focusable:!1,className:"block-library-html__modal-tab",children:(0,Ct.jsx)(bh.PlainText,{value:s,onChange:c,placeholder:(0,xi.__)("Write HTML\u2026"),"aria-label":(0,xi.__)("HTML"),className:"block-library-html__modal-editor"})}),b&&(0,Ct.jsx)(gm.TabPanel,{tabId:"css",focusable:!1,className:"block-library-html__modal-tab",children:(0,Ct.jsx)(bh.PlainText,{value:u,onChange:m,placeholder:(0,xi.__)("Write CSS\u2026"),"aria-label":(0,xi.__)("CSS"),className:"block-library-html__modal-editor"})}),b&&(0,Ct.jsx)(gm.TabPanel,{tabId:"js",focusable:!1,className:"block-library-html__modal-tab",children:(0,Ct.jsx)(bh.PlainText,{value:p,onChange:d,placeholder:(0,xi.__)("Write JavaScript\u2026"),"aria-label":(0,xi.__)("JavaScript"),className:"block-library-html__modal-editor"})})]}),(0,Ct.jsx)("div",{className:"block-library-html__preview",children:(0,Ct.jsx)(s4,{content:iE({html:s,css:u,js:p})})})]}),(0,Ct.jsxs)(ta.__experimentalHStack,{alignment:"center",justify:"flex-end",spacing:4,className:"block-library-html__modal-footer",children:[(0,Ct.jsx)(ta.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:t,children:(0,xi.__)("Cancel")}),(0,Ct.jsx)(ta.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:_,children:(0,xi.__)("Update")})]})]})})})})}var Ta=o(v(),1);function lq({attributes:e,setAttributes:t,isSelected:r}){let[a,n]=(0,iq.useState)(!1),i=(0,vm.useBlockProps)({className:"block-library-html__edit"});return e.content?.trim()?(0,Ta.jsxs)("div",{...i,children:[(0,Ta.jsx)(vm.BlockControls,{children:(0,Ta.jsx)(Jl.ToolbarGroup,{children:(0,Ta.jsx)(Jl.ToolbarButton,{onClick:()=>n(!0),children:(0,yh.__)("Edit code")})})}),(0,Ta.jsx)(vm.InspectorControls,{children:(0,Ta.jsx)(Jl.__experimentalVStack,{className:"block-editor-block-inspector-edit-contents",expanded:!0,children:(0,Ta.jsx)(Jl.Button,{className:"block-editor-block-inspector-edit-contents__button",__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>n(!0),children:(0,yh.__)("Edit code")})})}),(0,Ta.jsx)(s4,{content:e.content,isSelected:r}),(0,Ta.jsx)(lE,{isOpen:a,onRequestClose:()=>n(!1),content:e.content,setAttributes:t})]}):(0,Ta.jsxs)("div",{...i,children:[(0,Ta.jsx)(Jl.Placeholder,{icon:(0,Ta.jsx)(vm.BlockIcon,{icon:B0}),label:(0,yh.__)("Custom HTML"),instructions:(0,yh.__)("Add custom HTML code and preview how it looks."),children:(0,Ta.jsx)(Jl.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:()=>n(!0),children:(0,yh.__)("Edit HTML")})}),(0,Ta.jsx)(lE,{isOpen:a,onRequestClose:()=>n(!1),content:e.content,setAttributes:t})]})}var c4={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/html",title:"Custom HTML",category:"widgets",description:"Add custom HTML code and preview it as you edit.",keywords:["embed"],textdomain:"default",attributes:{content:{type:"string",source:"raw",role:"content"}},supports:{customClassName:!1,className:!1,html:!1,interactivity:{clientNavigation:!0},customCSS:!1,visibility:!1},editorStyle:"wp-block-html-editor"};var sq=o(U(),1),cq=o(v(),1);function uq({attributes:e}){return(0,cq.jsx)(sq.RawHTML,{children:e.content})}var mq=o(W(),1),pq=o(em(),1),b2e={from:[{type:"block",blocks:["core/code"],transform:({content:e})=>(0,mq.createBlock)("core/html",{content:(0,pq.create)({html:e}).text})}]},dq=b2e;var{name:hq}=c4,gq={icon:dT,example:{attributes:{content:"<marquee>"+(0,fq.__)("Welcome to the wonderful world of blocks\u2026")+"</marquee>"}},edit:lq,save:uq,transforms:dq},y2e=()=>E({name:hq,metadata:c4,settings:gq});var pE={};Z(pE,{init:()=>S2e,metadata:()=>m4,name:()=>Pq,settings:()=>Bq});var Xs=o(P(),1),ki=o(M(),1),ra=o(T(),1),kq=o(U(),1),kh=o(L(),1),wq=o(V(),1),Cq=o(Q(),1);var _q=o(P(),1),u4=o(M(),1),xh=o(U(),1),xq=o(me(),1);var cE=o(P(),1),vq=o(M(),1);var Ys=o(v(),1);function bq({icons:e,onChange:t,attributes:r}){return(0,Ys.jsx)("div",{className:"wp-block-icon__inserter-grid",children:e?.length?(0,Ys.jsx)("div",{className:"wp-block-icon__inserter-grid-icons-list","aria-label":(0,cE.__)("Icon library"),children:e.map(a=>(0,Ys.jsxs)(vq.Button,{className:"wp-block-icon__inserter-grid-icons-list-item",onClick:()=>t(a.name),variant:a.name===r?.icon?"primary":void 0,__next40pxDefaultSize:!0,children:[(0,Ys.jsx)("span",{className:"wp-block-icon__inserter-grid-icons-list-item-icon",children:(0,Ys.jsx)(uo,{html:a.content,wrapperProps:{style:{width:"24px"}}})}),(0,Ys.jsx)("span",{className:"wp-block-icon__inserter-grid-icons-list-item-title",children:a.label})]},a.name))}):(0,Ys.jsx)("div",{className:"wp-block-icon__inserter-grid-no-results",children:(0,Ys.jsx)("p",{children:(0,cE.__)("No results found.")})})})}var yq=o(rv(),1);function _h(e=""){return e=(0,yq.default)(e),e=e.trim().toLowerCase(),e}function _2e(e,t){let r=_h(t),a=_h(e.title),n=0;return r===a?n+=30:a.startsWith(r)?n+=20:r.split(" ").every(s=>a.includes(s))&&(n+=10),n}function dv(e=[],t=""){if(!t)return e;let r=e.map(a=>[a,_2e(a,t)]).filter(([,a])=>a>0);return r.sort(([,a],[,n])=>n-a),r.map(([a])=>a)}var cd=o(v(),1);function uE({icons:e=[],setInserterOpen:t,attributes:r,setAttributes:a}){let[n,i]=(0,xh.useState)(""),l=(0,xq.useDebounce)(i,300),s=(0,xh.useCallback)(u=>{a({icon:u}),t(!1)},[a,t]),c=(0,xh.useMemo)(()=>{if(n){let u=_h(n);return e.filter(m=>{let p=_h(m.name),d=_h(m.label);return p.includes(u)||d.includes(u)})}return e},[n,e]);return(0,cd.jsx)(u4.Modal,{className:"wp-block-icon__inserter-modal",title:(0,_q.__)("Icon library"),onRequestClose:()=>t(!1),isFullScreen:!0,children:(0,cd.jsxs)("div",{className:"wp-block-icon__inserter",children:[(0,cd.jsx)("div",{className:"wp-block-icon__inserter-header",children:(0,cd.jsx)(u4.SearchControl,{value:n,onChange:l})}),(0,cd.jsx)(bq,{icons:c,onChange:s,attributes:r})]})})}var Yt=o(v(),1),x2e=({className:e,style:t})=>(0,Yt.jsxs)(kh.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 60 60",preserveAspectRatio:"none",fill:"none","aria-hidden":"true",className:w("wp-block-icon__placeholder",e),style:t,children:[(0,Yt.jsx)(kh.Rect,{width:"60",height:"60",fill:"currentColor",fillOpacity:.1}),(0,Yt.jsx)(kh.Path,{vectorEffect:"non-scaling-stroke",stroke:"currentColor",strokeOpacity:.25,d:"M60 60 0 0"})]});function k2e({attributes:e,setAttributes:t}){let{icon:r,ariaLabel:a}=e,[n,i]=(0,kq.useState)(!1),l=(0,ra.useBlockEditingMode)()==="contentOnly",s=(0,ra.__experimentalUseColorProps)(e),c=(0,ra.__experimentalGetSpacingClassesAndStyles)(e),u=(0,ra.__experimentalUseBorderProps)(e),m=(0,ra.getDimensionsClassesAndStyles)(e),{selectedIcon:p,allIcons:d=[]}=(0,wq.useSelect)(y=>{let{getEntityRecord:k,getEntityRecords:_}=y(Cq.store);return{selectedIcon:r?k("root","icon",r):null,allIcons:n?_("root","icon",{per_page:-1}):void 0}},[n,r]),f=p?.content||"",h=(0,Yt.jsxs)(Yt.Fragment,{children:[(0,Yt.jsx)(ra.BlockControls,{group:l?"inline":"other",children:(0,Yt.jsx)(ki.ToolbarButton,{onClick:()=>{i(!0)},children:r?(0,Xs.__)("Replace"):(0,Xs.__)("Choose icon")})}),l&&r&&(0,Yt.jsx)(ra.BlockControls,{group:"other",children:(0,Yt.jsx)(ki.ToolbarGroup,{className:"components-toolbar-group",children:(0,Yt.jsx)(ki.DropdownMenu,{icon:"",popoverProps:{className:"is-alternate"},text:(0,Xs.__)("Label"),children:()=>(0,Yt.jsx)(ki.TextControl,{className:"wp-block-icon__toolbar-content",label:(0,Xs.__)("Label"),value:a||"",onChange:y=>t({ariaLabel:y}),help:(0,Xs.__)("Briefly describe the icon to help screen reader users. Leave blank for decorative icons."),__next40pxDefaultSize:!0})})})})]}),g=q(),b=r&&(0,Yt.jsx)(Yt.Fragment,{children:(0,Yt.jsx)(ra.InspectorControls,{group:"settings",children:(0,Yt.jsx)(ki.__experimentalToolsPanel,{label:(0,Xs.__)("Settings"),resetAll:()=>t({ariaLabel:void 0}),dropdownMenuProps:g,children:(0,Yt.jsx)(ki.__experimentalToolsPanelItem,{label:(0,Xs.__)("Label"),isShownByDefault:!0,hasValue:()=>!!a,onDeselect:()=>t({ariaLabel:void 0}),children:(0,Yt.jsx)(ki.TextControl,{label:(0,Xs.__)("Label"),help:(0,Xs.__)("Briefly describe the icon to help screen reader users. Leave blank for decorative icons."),value:a||"",onChange:y=>t({ariaLabel:y}),__next40pxDefaultSize:!0})})})})});return(0,Yt.jsxs)(Yt.Fragment,{children:[h,b,(0,Yt.jsx)("div",{...(0,ra.useBlockProps)(),children:r?(0,Yt.jsx)(uo,{html:f,wrapperProps:{className:w(s.className,u.className,c.className,m.className),style:{...s.style,...u.style,...c.style,...m.style}}}):(0,Yt.jsx)(x2e,{className:w(u.className,c.className,m.className),style:{...u.style,...c.style,...m.style,height:"auto"}})}),n&&(0,Yt.jsx)(uE,{icons:d,setInserterOpen:i,attributes:e,setAttributes:t})]})}var Sq=k2e;var m4={apiVersion:3,$schema:"https://schemas.wp.org/trunk/block.json",name:"core/icon",title:"Icon",category:"media",description:"Insert an SVG icon.",keywords:["icon","svg"],textdomain:"default",attributes:{icon:{type:"string",role:"content"}},supports:{anchor:!0,ariaLabel:{__experimentalSkipSerialization:!0},align:["left","center","right"],html:!1,color:{background:!0,text:!0,__experimentalSkipSerialization:!0},interactivity:{clientNavigation:!0},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0,__experimentalSkipSerialization:!0,__experimentalDefaultControls:{color:!1,radius:!1,style:!1,width:!1}},spacing:{padding:!0,margin:!0,__experimentalSkipSerialization:["padding"],__experimentalDefaultControls:{margin:!1,padding:!1}},dimensions:{width:!0,__experimentalSkipSerialization:["width"],__experimentalDefaultControls:{width:!0}}},selectors:{root:".wp-block-icon svg",css:".wp-block-icon",spacing:{margin:".wp-block-icon"}},style:"wp-block-icon",editorStyle:"wp-block-icon-editor"};var p4=o(M(),1),mE=o(v(),1),C2e=(0,mE.jsx)(p4.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",children:(0,mE.jsx)(p4.Path,{d:"M6 9.5h3.5V6H6v3.5Zm5 .5a1 1 0 0 1-.898.995L10 11H5.5l-.103-.005a1 1 0 0 1-.892-.893L4.5 10V5.5a1 1 0 0 1 1-1H10a1 1 0 0 1 1 1V10ZM18.25 7.75a2 2 0 1 0-4 0 2 2 0 0 0 4 0Zm1.5 0a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0ZM6.88 13.535a1 1 0 0 1 1.74 0l2.534 4.472a1 1 0 0 1-.87 1.493H5.216a1 1 0 0 1-.87-1.493l2.534-4.472ZM6.074 18h3.352L7.75 15.041l-1.676 2.96ZM14.952 13h2.596a1 1 0 0 1 .866.5l1.298 2.25a1 1 0 0 1 0 1L18.414 19l-.074.11a1 1 0 0 1-.792.39h-2.596a1 1 0 0 1-.792-.39l-.074-.11-1.298-2.25a1.001 1.001 0 0 1 0-1l1.298-2.25a1 1 0 0 1 .866-.5Zm-.72 3.25 1.01 1.75h2.017l1.009-1.75-1.01-1.75h-2.017l-1.01 1.75Z"})}),Tq=C2e;var{name:Pq}=m4,Bq={icon:Tq,example:{attributes:{icon:"core/audio",style:{dimensions:{width:"48px"}}}},edit:Sq},S2e=()=>E({name:Pq,metadata:m4,settings:Bq});var gE={};Z(gE,{init:()=>$2e,metadata:()=>b4,name:()=>Jq,settings:()=>_4});var md=o(P(),1);var Xq=o(W(),1);var vt=o(T(),1),De=o(v(),1),T2e={attributes:{url:{type:"string",source:"attribute",selector:"img",attribute:"src"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""},caption:{type:"array",source:"children",selector:"figcaption"},href:{type:"string",source:"attribute",selector:"a",attribute:"href"},id:{type:"number"},align:{type:"string"},width:{type:"number"},height:{type:"number"}},save({attributes:e}){let{url:t,alt:r,caption:a,align:n,href:i,width:l,height:s}=e,u=(0,De.jsx)("img",{src:t,alt:r,...l||s?{width:l,height:s}:{}}),m={};return l?m={width:l}:(n==="left"||n==="right")&&(m={maxWidth:"50%"}),(0,De.jsxs)("figure",{className:n?`align${n}`:null,style:m,children:[i?(0,De.jsx)("a",{href:i,children:u}):u,!vt.RichText.isEmpty(a)&&(0,De.jsx)(vt.RichText.Content,{tagName:"figcaption",value:a})]})}},P2e={attributes:{url:{type:"string",source:"attribute",selector:"img",attribute:"src"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""},caption:{type:"array",source:"children",selector:"figcaption"},href:{type:"string",source:"attribute",selector:"a",attribute:"href"},id:{type:"number"},align:{type:"string"},width:{type:"number"},height:{type:"number"}},save({attributes:e}){let{url:t,alt:r,caption:a,align:n,href:i,width:l,height:s,id:c}=e,u=(0,De.jsx)("img",{src:t,alt:r,className:c?`wp-image-${c}`:null,width:l,height:s});return(0,De.jsxs)("figure",{className:n?`align${n}`:null,children:[i?(0,De.jsx)("a",{href:i,children:u}):u,!vt.RichText.isEmpty(a)&&(0,De.jsx)(vt.RichText.Content,{tagName:"figcaption",value:a})]})}},B2e={attributes:{url:{type:"string",source:"attribute",selector:"img",attribute:"src"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""},caption:{type:"array",source:"children",selector:"figcaption"},href:{type:"string",source:"attribute",selector:"figure > a",attribute:"href"},id:{type:"number"},align:{type:"string"},width:{type:"number"},height:{type:"number"},linkDestination:{type:"string",default:"none"}},save({attributes:e}){let{url:t,alt:r,caption:a,align:n,href:i,width:l,height:s,id:c}=e,u=w({[`align${n}`]:n,"is-resized":l||s}),m=(0,De.jsx)("img",{src:t,alt:r,className:c?`wp-image-${c}`:null,width:l,height:s});return(0,De.jsxs)("figure",{className:u,children:[i?(0,De.jsx)("a",{href:i,children:m}):m,!vt.RichText.isEmpty(a)&&(0,De.jsx)(vt.RichText.Content,{tagName:"figcaption",value:a})]})}},I2e={attributes:{align:{type:"string"},url:{type:"string",source:"attribute",selector:"img",attribute:"src"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""},caption:{type:"string",source:"html",selector:"figcaption"},title:{type:"string",source:"attribute",selector:"img",attribute:"title"},href:{type:"string",source:"attribute",selector:"figure > a",attribute:"href"},rel:{type:"string",source:"attribute",selector:"figure > a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure > a",attribute:"class"},id:{type:"number"},width:{type:"number"},height:{type:"number"},sizeSlug:{type:"string"},linkDestination:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"figure > a",attribute:"target"}},supports:{anchor:!0},save({attributes:e}){let{url:t,alt:r,caption:a,align:n,href:i,rel:l,linkClass:s,width:c,height:u,id:m,linkTarget:p,sizeSlug:d,title:f}=e,h=l||void 0,g=w({[`align${n}`]:n,[`size-${d}`]:d,"is-resized":c||u}),b=(0,De.jsx)("img",{src:t,alt:r,className:m?`wp-image-${m}`:null,width:c,height:u,title:f}),y=(0,De.jsxs)(De.Fragment,{children:[i?(0,De.jsx)("a",{className:s,href:i,target:p,rel:h,children:b}):b,!vt.RichText.isEmpty(a)&&(0,De.jsx)(vt.RichText.Content,{tagName:"figcaption",value:a})]});return n==="left"||n==="right"||n==="center"?(0,De.jsx)("div",{...vt.useBlockProps.save(),children:(0,De.jsx)("figure",{className:g,children:y})}):(0,De.jsx)("figure",{...vt.useBlockProps.save({className:g}),children:y})}},N2e={attributes:{align:{type:"string"},url:{type:"string",source:"attribute",selector:"img",attribute:"src"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""},caption:{type:"string",source:"html",selector:"figcaption"},title:{type:"string",source:"attribute",selector:"img",attribute:"title"},href:{type:"string",source:"attribute",selector:"figure > a",attribute:"href"},rel:{type:"string",source:"attribute",selector:"figure > a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure > a",attribute:"class"},id:{type:"number"},width:{type:"number"},height:{type:"number"},sizeSlug:{type:"string"},linkDestination:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"figure > a",attribute:"target"}},supports:{anchor:!0,color:{__experimentalDuotone:"img",text:!1,background:!1},__experimentalBorder:{radius:!0,__experimentalDefaultControls:{radius:!0}},__experimentalStyle:{spacing:{margin:"0 0 1em 0"}}},save({attributes:e}){let{url:t,alt:r,caption:a,align:n,href:i,rel:l,linkClass:s,width:c,height:u,id:m,linkTarget:p,sizeSlug:d,title:f}=e,h=l||void 0,g=w({[`align${n}`]:n,[`size-${d}`]:d,"is-resized":c||u}),b=(0,De.jsx)("img",{src:t,alt:r,className:m?`wp-image-${m}`:null,width:c,height:u,title:f}),y=(0,De.jsxs)(De.Fragment,{children:[i?(0,De.jsx)("a",{className:s,href:i,target:p,rel:h,children:b}):b,!vt.RichText.isEmpty(a)&&(0,De.jsx)(vt.RichText.Content,{tagName:"figcaption",value:a})]});return(0,De.jsx)("figure",{...vt.useBlockProps.save({className:g}),children:y})}},E2e={attributes:{align:{type:"string"},url:{type:"string",source:"attribute",selector:"img",attribute:"src",role:"content"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:"",role:"content"},caption:{type:"string",source:"html",selector:"figcaption",role:"content"},title:{type:"string",source:"attribute",selector:"img",attribute:"title",role:"content"},href:{type:"string",source:"attribute",selector:"figure > a",attribute:"href",role:"content"},rel:{type:"string",source:"attribute",selector:"figure > a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure > a",attribute:"class"},id:{type:"number",role:"content"},width:{type:"number"},height:{type:"number"},aspectRatio:{type:"string"},scale:{type:"string"},sizeSlug:{type:"string"},linkDestination:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"figure > a",attribute:"target"}},supports:{anchor:!0,color:{text:!1,background:!1},filter:{duotone:!0},__experimentalBorder:{color:!0,radius:!0,width:!0,__experimentalSkipSerialization:!0,__experimentalDefaultControls:{color:!0,radius:!0,width:!0}}},migrate(e){let{height:t,width:r}=e;return{...e,width:typeof r=="number"?`${r}px`:r,height:typeof t=="number"?`${t}px`:t}},save({attributes:e}){let{url:t,alt:r,caption:a,align:n,href:i,rel:l,linkClass:s,width:c,height:u,aspectRatio:m,scale:p,id:d,linkTarget:f,sizeSlug:h,title:g}=e,b=l||void 0,y=(0,vt.__experimentalGetBorderClassesAndStyles)(e),k=w({[`align${n}`]:n,[`size-${h}`]:h,"is-resized":c||u,"has-custom-border":!!y.className||y.style&&Object.keys(y.style).length>0}),_=w(y.className,{[`wp-image-${d}`]:!!d}),x=(0,De.jsx)("img",{src:t,alt:r,className:_||void 0,style:{...y.style,aspectRatio:m,objectFit:p},width:c,height:u,title:g}),S=(0,De.jsxs)(De.Fragment,{children:[i?(0,De.jsx)("a",{className:s,href:i,target:f,rel:b,children:x}):x,!vt.RichText.isEmpty(a)&&(0,De.jsx)(vt.RichText.Content,{className:(0,vt.__experimentalGetElementClassName)("caption"),tagName:"figcaption",value:a})]});return(0,De.jsx)("figure",{...vt.useBlockProps.save({className:k}),children:S})}},D2e={attributes:{align:{type:"string"},url:{type:"string",source:"attribute",selector:"img",attribute:"src",role:"content"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:"",role:"content"},caption:{type:"string",source:"html",selector:"figcaption",role:"content"},title:{type:"string",source:"attribute",selector:"img",attribute:"title",role:"content"},href:{type:"string",source:"attribute",selector:"figure > a",attribute:"href",role:"content"},rel:{type:"string",source:"attribute",selector:"figure > a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure > a",attribute:"class"},id:{type:"number",role:"content"},width:{type:"number"},height:{type:"number"},aspectRatio:{type:"string"},scale:{type:"string"},sizeSlug:{type:"string"},linkDestination:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"figure > a",attribute:"target"}},supports:{anchor:!0,color:{text:!1,background:!1},filter:{duotone:!0},__experimentalBorder:{color:!0,radius:!0,width:!0,__experimentalSkipSerialization:!0,__experimentalDefaultControls:{color:!0,radius:!0,width:!0}}},migrate({width:e,height:t,...r}){return{...r,width:`${e}px`,height:`${t}px`}},save({attributes:e}){let{url:t,alt:r,caption:a,align:n,href:i,rel:l,linkClass:s,width:c,height:u,aspectRatio:m,scale:p,id:d,linkTarget:f,sizeSlug:h,title:g}=e,b=l||void 0,y=(0,vt.__experimentalGetBorderClassesAndStyles)(e),k=w({[`align${n}`]:n,[`size-${h}`]:h,"is-resized":c||u,"has-custom-border":!!y.className||y.style&&Object.keys(y.style).length>0}),_=w(y.className,{[`wp-image-${d}`]:!!d}),x=(0,De.jsx)("img",{src:t,alt:r,className:_||void 0,style:{...y.style,aspectRatio:m,objectFit:p,width:c,height:u},width:c,height:u,title:g}),S=(0,De.jsxs)(De.Fragment,{children:[i?(0,De.jsx)("a",{className:s,href:i,target:f,rel:b,children:x}):x,!vt.RichText.isEmpty(a)&&(0,De.jsx)(vt.RichText.Content,{className:(0,vt.__experimentalGetElementClassName)("caption"),tagName:"figcaption",value:a})]});return(0,De.jsx)("figure",{...vt.useBlockProps.save({className:k}),children:S})}},L2e={attributes:{align:{type:"string"},behaviors:{type:"object"},url:{type:"string",source:"attribute",selector:"img",attribute:"src",role:"content"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:"",role:"content"},caption:{type:"string",source:"html",selector:"figcaption",role:"content"},title:{type:"string",source:"attribute",selector:"img",attribute:"title",role:"content"},href:{type:"string",source:"attribute",selector:"figure > a",attribute:"href",role:"content"},rel:{type:"string",source:"attribute",selector:"figure > a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure > a",attribute:"class"},id:{type:"number",role:"content"},width:{type:"string"},height:{type:"string"},aspectRatio:{type:"string"},scale:{type:"string"},sizeSlug:{type:"string"},linkDestination:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"figure > a",attribute:"target"}},supports:{anchor:!0,color:{text:!1,background:!1},filter:{duotone:!0},__experimentalBorder:{color:!0,radius:!0,width:!0,__experimentalSkipSerialization:!0,__experimentalDefaultControls:{color:!0,radius:!0,width:!0}}},migrate({width:e,height:t,...r}){if(!r.behaviors?.lightbox)return r;let{behaviors:{lightbox:{enabled:a}}}=r,n={...r,lightbox:{enabled:a}};return delete n.behaviors,n},isEligible(e){return!!e.behaviors},save({attributes:e}){let{url:t,alt:r,caption:a,align:n,href:i,rel:l,linkClass:s,width:c,height:u,aspectRatio:m,scale:p,id:d,linkTarget:f,sizeSlug:h,title:g}=e,b=l||void 0,y=(0,vt.__experimentalGetBorderClassesAndStyles)(e),k=w({[`align${n}`]:n,[`size-${h}`]:h,"is-resized":c||u,"has-custom-border":!!y.className||y.style&&Object.keys(y.style).length>0}),_=w(y.className,{[`wp-image-${d}`]:!!d}),x=(0,De.jsx)("img",{src:t,alt:r,className:_||void 0,style:{...y.style,aspectRatio:m,objectFit:p,width:c,height:u},title:g}),S=(0,De.jsxs)(De.Fragment,{children:[i?(0,De.jsx)("a",{className:s,href:i,target:f,rel:b,children:x}):x,!vt.RichText.isEmpty(a)&&(0,De.jsx)(vt.RichText.Content,{className:(0,vt.__experimentalGetElementClassName)("caption"),tagName:"figcaption",value:a})]});return(0,De.jsx)("figure",{...vt.useBlockProps.save({className:k}),children:S})}},Iq=[L2e,D2e,E2e,N2e,I2e,B2e,P2e,T2e];var hv=o(Rr(),1),fv=o(W(),1),Gq=o(M(),1),ud=o(V(),1),on=o(T(),1),bm=o(U(),1),Js=o(P(),1);var Wq=o(xr(),1),$q=o(me(),1),v4=o(mr(),1),qq=o(Eq(),1);var Rq=o(Rr(),1),Le=o(M(),1),Ch=o(me(),1),ou=o(V(),1),yt=o(T(),1),Nr=o(U(),1),Se=o(P(),1),fE=o(mr(),1),wh=o(W(),1);var zq=o(xr(),1),h4=o(Q(),1);var Vn=o(M(),1),d4=o(T(),1),Dq=o(P(),1),Lq=o(V(),1),wi=o(v(),1);function dE({url:e,alt:t,filename:r,itemGroupProps:a,className:n}){return(0,wi.jsx)(Vn.__experimentalItemGroup,{...a,as:"span",children:(0,wi.jsxs)(Vn.__experimentalHStack,{justify:"flex-start",as:"span",children:[(0,wi.jsx)("img",{src:e,alt:t}),(0,wi.jsx)(Vn.FlexItem,{as:"span",children:(0,wi.jsx)(Vn.__experimentalTruncate,{numberOfLines:1,className:n,children:r})})]})})}function f4({mediaId:e,mediaUrl:t,alt:r="",filename:a,allowedTypes:n,onSelect:i,onSelectURL:l,onError:s,onReset:c,isUploading:u=!1,emptyLabel:m=(0,Dq.__)("Add media")}){let{getSettings:p}=(0,Lq.useSelect)(d4.store);return(0,wi.jsxs)("div",{className:"block-library-utils__media-control",children:[(0,wi.jsx)(d4.MediaReplaceFlow,{mediaId:e,mediaURL:t,allowedTypes:n,onSelect:i,onSelectURL:l,onError:s,name:t?(0,wi.jsx)(dE,{url:t,alt:r,filename:a}):m,renderToggle:f=>(0,wi.jsx)(Vn.Button,{...f,__next40pxDefaultSize:!0,children:u?(0,wi.jsx)(Vn.Spinner,{}):f.children}),onReset:c}),(0,wi.jsx)(Vn.DropZone,{onFilesDrop:f=>{let{mediaUpload:h}=p();h&&h({allowedTypes:n,filesList:f,onFileChange([g]){i(g)},onError:s,multiple:!1})}})]})}var re=o(v(),1),{DimensionsTool:Mq,ResolutionTool:M2e}=K(yt.privateApis),A2e=[{value:"cover",label:(0,Se._x)("Cover","Scale option for dimensions control"),help:(0,Se.__)("Image covers the space evenly.")},{value:"contain",label:(0,Se._x)("Contain","Scale option for dimensions control"),help:(0,Se.__)("Image is contained without distortion.")}],R2e={placement:"bottom-start"},Aq=({href:e,children:t})=>e?(0,re.jsx)("a",{href:e,onClick:r=>r.preventDefault(),"aria-disabled":!0,style:{pointerEvents:"none",cursor:"default",display:"inline"},children:t}):t;function z2e({attributes:e,setAttributes:t,lockAltControls:r,lockAltControlsMessage:a,lockTitleControls:n,lockTitleControlsMessage:i}){let[l,s]=(0,Nr.useState)(null),[c,u]=(0,Nr.useState)(!1),[m,p]=(0,Nr.useState)(!1);return(0,re.jsxs)(re.Fragment,{children:[(0,re.jsx)(Le.ToolbarItem,{ref:s,children:d=>(0,re.jsx)(Le.DropdownMenu,{icon:bp,label:(0,Se.__)("More"),toggleProps:{...d,description:(0,Se.__)("Displays more controls.")},popoverProps:R2e,children:({onClose:f})=>(0,re.jsxs)(re.Fragment,{children:[(0,re.jsx)(Le.MenuItem,{onClick:()=>{u(!0),f()},"aria-haspopup":"dialog",children:(0,Se._x)("Alternative text","Alternative text for an image. Block toolbar label, a low character count is preferred.")}),(0,re.jsx)(Le.MenuItem,{onClick:()=>{p(!0),f()},"aria-haspopup":"dialog",children:(0,Se.__)("Title text")})]})})}),c&&(0,re.jsx)(Le.Popover,{placement:"bottom-start",anchor:l,onClose:()=>u(!1),offset:13,variant:"toolbar",children:(0,re.jsx)("div",{className:"wp-block-image__toolbar_content_textarea__container",children:(0,re.jsx)(Le.TextareaControl,{className:"wp-block-image__toolbar_content_textarea",label:(0,Se.__)("Alternative text"),value:e.alt||"",onChange:d=>t({alt:d}),disabled:r,help:r?(0,re.jsx)(re.Fragment,{children:a}):(0,re.jsxs)(re.Fragment,{children:[(0,re.jsx)(Le.ExternalLink,{href:(0,Se.__)("https://www.w3.org/WAI/tutorials/images/decision-tree/"),children:(0,Se.__)("Describe the purpose of the image.")}),(0,re.jsx)("br",{}),(0,Se.__)("Leave empty if decorative.")]})})})}),m&&(0,re.jsx)(Le.Popover,{placement:"bottom-start",anchor:l,onClose:()=>p(!1),offset:13,variant:"toolbar",children:(0,re.jsx)("div",{className:"wp-block-image__toolbar_content_textarea__container",children:(0,re.jsx)(Le.TextControl,{__next40pxDefaultSize:!0,className:"wp-block-image__toolbar_content_textarea",label:(0,Se.__)("Title attribute"),value:e.title||"",onChange:d=>t({title:d}),disabled:n,help:n?(0,re.jsx)(re.Fragment,{children:i}):(0,Nr.createInterpolateElement)((0,Se.__)("Describe the role of this image on the page. <a>(Note: many devices and browsers do not display this text.)</a>"),{a:(0,re.jsx)(Le.ExternalLink,{href:"https://www.w3.org/TR/html52/dom.html#the-title-attribute"})})})})})]})}function Vq({temporaryURL:e,isSideloading:t,attributes:r,setAttributes:a,isSingleSelected:n,insertBlocksAfter:i,onReplace:l,onSelectImage:s,onSelectURL:c,onUploadError:u,context:m,clientId:p,blockEditingMode:d,parentLayoutType:f,maxContentWidth:h}){let{url:g="",alt:b,align:y,id:k,href:_,rel:x,linkClass:S,linkDestination:C,title:N,width:B,height:D,aspectRatio:A,scale:H,focalPoint:F,linkTarget:z,sizeSlug:I,lightbox:R,metadata:$}=r,[j,G]=(0,Nr.useState)(),[O,J]=(0,Nr.useState)(null),[ee,oe]=(0,Nr.useState)({}),[X,te]=(0,Nr.useState)(0),ne=(0,Ch.useResizeObserver)(([ge])=>{if(!O){let[Lt]=ge.borderBoxSize;oe({width:Lt.inlineSize,height:Lt.blockSize})}te(ge.target.offsetTop)}),le=(0,Nr.useCallback)(()=>{te(j?.offsetTop??0)},[j]),pe=(0,Ch.useMergeRefs)([G,ne]),{allowResize:Ie=!0}=m,{image:Ne,canUserEdit:ae}=(0,ou.useSelect)(ge=>{let Lt=k&&n?ge(h4.store).getEntityRecord("postType","attachment",k,{context:"view"}):null,ti=!1;if(k&&n&&window?.__experimentalMediaEditor){let{getEntityRecordPermissions:ba}=K(ge(h4.store));ti=ba("postType","attachment",k)?.update||!1}return{image:Lt,canUserEdit:ti}},[k,n]),{canInsertCover:Re,imageEditing:Ee,imageSizes:ie,maxWidth:fe}=(0,ou.useSelect)(ge=>{let{getBlockRootClientId:Lt,canInsertBlockType:ti,getSettings:ba}=ge(yt.store),wf=Lt(p),mp=ba();return{imageEditing:mp.imageEditing,imageSizes:mp.imageSizes,maxWidth:mp.maxWidth,canInsertCover:ti("core/cover",wf)}},[p]),{getBlock:ke,getSettings:je}=(0,ou.useSelect)(yt.store),de=je().onNavigateToEntityRecord,{replaceBlocks:ct,toggleSelection:at}=(0,ou.useDispatch)(yt.store),{createErrorNotice:kt,createSuccessNotice:Wr}=(0,ou.useDispatch)(zq.store),{editEntityRecord:ut}=(0,ou.useDispatch)(h4.store),br=(0,Ch.useViewportMatch)("medium"),mt=["wide","full"].includes(y),[{loadedNaturalWidth:wo,loadedNaturalHeight:Y},ze]=(0,Nr.useState)({}),[Me,Xe]=(0,Nr.useState)(!1),[Te,Bt]=(0,Nr.useState)(),[yr,xn]=(0,Nr.useState)(!1),Je=d==="default",$r=d==="contentOnly",ip=Ie&&Je,Cs=Ie&&Je&&!mt&&br,Ru=ie.filter(({slug:ge})=>Ne?.media_details?.sizes?.[ge]?.source_url).map(({name:ge,slug:Lt})=>({value:Lt,label:ge}));(0,Nr.useEffect)(()=>{if(!g4(k,g)||!n||!je().mediaUpload){Bt();return}Te||window.fetch(g.includes("?")?g:g+"?").then(ge=>ge.blob()).then(ge=>Bt(ge)).catch(()=>{})},[k,g,n,Te,je]);let{naturalWidth:kn,naturalHeight:ja}=(0,Nr.useMemo)(()=>({naturalWidth:j?.naturalWidth||wo||void 0,naturalHeight:j?.naturalHeight||Y||void 0}),[wo,Y,j?.complete]);function gf(){xn(!0);let ge=Yu({attributes:{url:g}});ge!==void 0&&l(ge)}function zu(ge){xn(!1),ze({loadedNaturalWidth:ge.target?.naturalWidth,loadedNaturalHeight:ge.target?.naturalHeight})}function Ss(ge){a(ge)}function Ts(ge){ge&&!Ps?.enabled?a({lightbox:{enabled:!0}}):!ge&&Ps?.enabled?a({lightbox:{enabled:!1}}):a({lightbox:void 0})}function Pe(){Ps?.enabled&&Ps?.allowEditing?a({lightbox:{enabled:!1}}):a({lightbox:void 0})}function Ht(ge){a({title:ge})}function qr(ge){a({alt:ge})}let Co=ge=>{j&&j.style.setProperty("object-position",iv(ge))};function So(ge){let Lt=Ne?.media_details?.sizes?.[ge]?.source_url;if(!Lt)return null;a({url:Lt,sizeSlug:ge})}function Sl(){let{mediaUpload:ge}=je();ge&&ge({filesList:[Te],onFileChange([Lt]){s(Lt),!(0,Rq.isBlobURL)(Lt.url)&&(Bt(),Wr((0,Se.__)("Image uploaded."),{type:"snackbar"}))},allowedTypes:tu,onError(Lt){kt(Lt,{type:"snackbar"})}})}(0,Nr.useEffect)(()=>{n||Xe(!1)},[n]);let qi=k&&kn&&ja&&Ee,Zi=n&&qi&&!Me&&!$r;function vf(){ct(p,(0,wh.switchToBlockType)(ke(p),"core/cover"))}let zc=(0,Le.__experimentalUseCustomUnits)({availableUnits:["px"]}),[Ps]=(0,yt.useSettings)("lightbox"),bf=!!R&&R?.enabled!==Ps?.enabled||Ps?.allowEditing,lp=!!R?.enabled||!R&&!!Ps?.enabled,sp=q(),yf=ip&&(HN.includes(f)?(0,re.jsx)(Mq,{panelId:p,value:{aspectRatio:A},onChange:({aspectRatio:ge})=>{a({aspectRatio:ge,scale:"cover"})},defaultAspectRatio:"auto",tools:["aspectRatio"]}):(0,re.jsx)(Mq,{panelId:p,value:{width:B,height:D,scale:H,aspectRatio:A},onChange:({width:ge,height:Lt,scale:ti,aspectRatio:ba})=>{a({width:!ge&&Lt?"auto":ge,height:Lt,scale:ti,aspectRatio:ba})},defaultScale:"cover",defaultAspectRatio:"auto",scaleOptions:A2e,unitsOptions:zc,tools:mt?["aspectRatio","scale"]:["aspectRatio","widthHeight","scale"]})),j7=()=>{a({lightbox:void 0}),So(nv)},_b=$?.bindings?.__default?.source==="core/pattern-overrides",{lockUrlControls:Vc=!1,lockHrefControls:xb=!1,lockAltControls:p0=!1,lockAltControlsMessage:kb,lockTitleControls:_f=!1,lockTitleControlsMessage:cp,hideCaptionControls:xf=!1}=(0,ou.useSelect)(ge=>{if(!n)return{};let{url:Lt,alt:ti,title:ba,caption:wf}=$?.bindings||{},mp=!!m["pattern/overrides"],$7=(0,wh.getBlockBindingsSource)(Lt?.source),Cf=(0,wh.getBlockBindingsSource)(ti?.source),Vu=(0,wh.getBlockBindingsSource)(ba?.source);return{lockUrlControls:!!Lt&&!$7?.canUserEditValue?.({select:ge,context:m,args:Lt?.args}),lockHrefControls:mp||_b,hideCaptionControls:!!wf,lockAltControls:!!ti&&!Cf?.canUserEditValue?.({select:ge,context:m,args:ti?.args}),lockAltControlsMessage:Cf?.label?(0,Se.sprintf)((0,Se.__)("Connected to %s"),Cf.label):(0,Se.__)("Connected to dynamic data"),lockTitleControls:!!ba&&!Vu?.canUserEditValue?.({select:ge,context:m,args:ba?.args}),lockTitleControlsMessage:Vu?.label?(0,Se.sprintf)((0,Se.__)("Connected to %s"),Vu.label):(0,Se.__)("Connected to dynamic data")}},[_b,m,n,$?.bindings]),up=n&&!Me&&!xb&&!Vc,wb=n&&Re&&!$r,tr=up||Zi||wb,Tl=n&&!Me&&!Vc&&(0,re.jsx)(yt.BlockControls,{group:$r?"inline":"other",children:(0,re.jsx)(yt.MediaReplaceFlow,{mediaId:k,mediaURL:g,allowedTypes:tu,onSelect:s,onSelectURL:c,onError:u,name:g?(0,Se.__)("Replace"):(0,Se.__)("Add image"),onReset:()=>s(void 0),variant:"toolbar"})}),Bs=window?.__experimentalContentOnlyInspectorFields,U7=window?.__experimentalMediaEditor&&k&&n&&ae&&!g4(k,g)&&!Me&&de&&(0,re.jsx)(yt.BlockControls,{group:"other",children:(0,re.jsx)(Le.ToolbarButton,{onClick:()=>{de({postId:k,postType:"attachment"})},children:(0,Se.__)("Edit media")})}),G7=(0,re.jsxs)(re.Fragment,{children:[tr&&(0,re.jsxs)(yt.BlockControls,{group:"block",children:[up&&(0,re.jsx)(yt.__experimentalImageURLInputUI,{url:_||"",onChangeUrl:Ss,linkDestination:C,mediaUrl:Ne&&Ne.source_url||g,mediaLink:Ne&&Ne.link,linkTarget:z,linkClass:S,rel:x,showLightboxSetting:bf,lightboxEnabled:lp,onSetLightbox:Ts,resetLightbox:Pe}),Zi&&(0,re.jsx)(Le.ToolbarButton,{onClick:()=>Xe(!0),icon:D0,label:(0,Se.__)("Crop")}),wb&&(0,re.jsx)(Le.ToolbarButton,{icon:UT,label:(0,Se.__)("Add text over image"),onClick:vf})]}),n&&Te&&(0,re.jsx)(yt.BlockControls,{children:(0,re.jsx)(Le.ToolbarGroup,{children:(0,re.jsx)(Le.ToolbarButton,{onClick:Sl,icon:Hc,label:(0,Se.__)("Upload to Media Library")})})}),$r&&(0,re.jsx)(yt.BlockControls,{group:"block",children:(0,re.jsx)(z2e,{attributes:r,setAttributes:a,lockAltControls:p0,lockAltControlsMessage:kb,lockTitleControls:_f,lockTitleControlsMessage:cp})}),!Bs&&n&&(0,re.jsx)(yt.InspectorControls,{group:"content",children:(0,re.jsxs)(Le.__experimentalToolsPanel,{label:(0,Se.__)("Media"),resetAll:()=>s(void 0),dropdownMenuProps:sp,children:[!Vc&&(0,re.jsx)(Le.__experimentalToolsPanelItem,{label:(0,Se.__)("Image"),hasValue:()=>!!g,onDeselect:()=>s(void 0),isShownByDefault:!0,children:(0,re.jsx)(f4,{mediaId:k,mediaUrl:g,alt:b,filename:Ne?.media_details?.sizes?.full?.file||Ne?.slug||(0,fE.getFilename)(g),allowedTypes:tu,onSelect:s,onSelectURL:c,onError:u,onReset:()=>s(void 0),isUploading:!!e||t,emptyLabel:(0,Se.__)("Add image")})}),(0,re.jsx)(Le.__experimentalToolsPanelItem,{label:(0,Se.__)("Alternative text"),isShownByDefault:!0,hasValue:()=>!!b,onDeselect:()=>a({alt:void 0}),children:(0,re.jsx)(Le.TextareaControl,{label:(0,Se.__)("Alternative text"),value:b||"",onChange:qr,readOnly:p0,help:p0?(0,re.jsx)(re.Fragment,{children:kb}):(0,re.jsxs)(re.Fragment,{children:[(0,re.jsx)(Le.ExternalLink,{href:(0,Se.__)("https://www.w3.org/WAI/tutorials/images/decision-tree/"),children:(0,Se.__)("Describe the purpose of the image.")}),(0,re.jsx)("br",{}),(0,Se.__)("Leave empty if decorative.")]})})})]})}),(0,re.jsxs)(yt.InspectorControls,{group:"dimensions",resetAllFilter:ge=>({...ge,aspectRatio:void 0,width:void 0,height:void 0,scale:void 0,focalPoint:void 0}),children:[yf,g&&H&&(0,re.jsx)(Le.__experimentalToolsPanelItem,{label:(0,Se.__)("Focal point"),isShownByDefault:!0,hasValue:()=>!!F,onDeselect:()=>a({focalPoint:void 0}),panelId:p,children:(0,re.jsx)(Le.FocalPointPicker,{label:(0,Se.__)("Focal point"),url:g,value:F,onDragStart:Co,onDrag:Co,onChange:ge=>a({focalPoint:ge})})})]}),!!Ru.length&&(0,re.jsx)(yt.InspectorControls,{children:(0,re.jsx)(Le.__experimentalToolsPanel,{label:(0,Se.__)("Settings"),resetAll:j7,dropdownMenuProps:sp,children:(0,re.jsx)(M2e,{value:I,defaultValue:nv,onChange:So,options:Ru})})}),(0,re.jsx)(yt.InspectorControls,{group:"advanced",children:(0,re.jsx)(Le.TextControl,{__next40pxDefaultSize:!0,label:(0,Se.__)("Title attribute"),value:N||"",onChange:Ht,readOnly:_f,help:_f?(0,re.jsx)(re.Fragment,{children:cp}):(0,Nr.createInterpolateElement)((0,Se.__)("Describe the role of this image on the page. <a>(Note: many devices and browsers do not display this text.)</a>"),{a:(0,re.jsx)(Le.ExternalLink,{href:"https://www.w3.org/TR/html52/dom.html#the-title-attribute"})})})})]}),kf=(0,fE.getFilename)(g),Cb;b?Cb=b:kf?Cb=(0,Se.sprintf)((0,Se.__)("This image has an empty alt attribute; its file name is %s"),kf):Cb=(0,Se.__)("This image has an empty alt attribute");let W7=(0,yt.__experimentalUseBorderProps)(r),Fpe=(0,yt.__experimentalGetShadowClassesAndStyles)(r),Hpe=r.className?.includes("is-style-rounded"),{postType:Ope,postId:BR,queryId:jpe}=m,Upe=Number.isFinite(jpe),Sb=e&&yr?(0,re.jsx)(Le.Placeholder,{className:"wp-block-image__placeholder",withIllustration:!0,children:(0,re.jsx)(Le.Spinner,{})}):(0,re.jsxs)(re.Fragment,{children:[(0,re.jsx)("img",{src:e||g,alt:Cb,onError:gf,onLoad:zu,ref:pe,className:W7.className,width:kn,height:ja,style:{aspectRatio:A,...O?{width:ee.width+O.width,height:ee.height+O.height}:{width:B,height:D},objectFit:H,objectPosition:F&&H?iv(F):void 0,...W7.style,...Fpe.style}}),(e||t)&&(0,re.jsx)(Le.Spinner,{})]});qi&&Me?Sb=(0,re.jsx)(Aq,{href:_,children:(0,re.jsx)(yt.__experimentalImageEditor,{id:k,url:g,...ee,naturalHeight:ja,naturalWidth:kn,onSaveImage:ge=>a(ge),onFinishEditing:()=>{Xe(!1)},borderProps:Hpe?void 0:W7})}):Sb=(0,re.jsx)(Aq,{href:_,children:Sb});let IR;if(Cs&&n&&!Me&&!HN.includes(f)){let ge=A&&YW(A),Lt=ee.width/ee.height,ti=kn/ja,ba=ge||Lt||ti||1,wf=kn<ja?Zs:Zs*ba,mp=ja<kn?Zs:Zs/ba,$7=fe*2.5,Cf=h||$7,Vu=!1,Tb=!1;y==="center"?(Vu=!0,Tb=!0):(0,Se.isRTL)()?y==="left"?Vu=!0:Tb=!0:y==="right"?Tb=!0:Vu=!0,IR=(0,re.jsx)(Le.ResizableBox,{ref:le,style:{position:"absolute",inset:`${X}px 0 0 0`},size:ee,minWidth:wf,maxWidth:Cf,minHeight:mp,maxHeight:Cf/ba,lockAspectRatio:ba,enable:{top:!1,right:Vu,bottom:!0,left:Tb},onResizeStart:()=>{at(!1)},onResize:(Wpe,$pe,q7,Pb)=>{J(Pb)},onResizeStop:(Wpe,$pe,q7,Pb)=>{if(at(!0),J(null),oe(NR=>({width:NR.width+Pb.width,height:NR.height+Pb.height})),h&&kn>=h&&Math.abs(q7.offsetWidth-h)<10){a({width:void 0,height:void 0});return}a({width:`${q7.offsetWidth}px`,height:"auto",aspectRatio:ba===ti?void 0:String(ba)})},resizeRatio:y==="center"?2:1})}if(!g&&!e)return(0,re.jsxs)(re.Fragment,{children:[Tl,G7]});let Gpe=()=>{ut("postType",Ope,BR,{featured_media:k}),Wr((0,Se.__)("Post featured image updated."),{type:"snackbar"})};return(0,re.jsxs)(re.Fragment,{children:[U7,Tl,G7,!Upe&&BR&&k?(0,re.jsx)(yt.BlockSettingsMenuControls,{children:({canEdit:ge,selectedClientIds:Lt})=>ge&&Lt.length===1&&p===Lt[0]&&(0,re.jsx)(Le.MenuItem,{onClick:Gpe,children:(0,Se.__)("Set as featured image")})}):null,Sb,IR,(0,re.jsx)(_a,{attributes:r,setAttributes:a,isSelected:n,insertBlocksAfter:i,label:(0,Se.__)("Image caption text"),showToolbarButton:n&&(Je||$r)&&!xf})]})}var Fq=o(U(),1),Hq=o(me(),1),Oq=o(v(),1);function jq(){let[e,{width:t}]=(0,Hq.useResizeObserver)(),r=(0,Fq.useRef)();return[(0,Oq.jsx)("div",{className:"wp-block","aria-hidden":"true",style:{position:"absolute",inset:0,width:"100%",height:0,margin:0},ref:r,children:e}),t]}var es=o(v(),1),V2e=(e,t)=>{let r=Object.fromEntries(Object.entries(e??{}).filter(([a])=>["alt","id","link","caption"].includes(a)));return r.url=e?.sizes?.[t]?.url||e?.media_details?.sizes?.[t]?.source_url||e.url,r},g4=(e,t)=>t&&!e&&!(0,hv.isBlobURL)(t);function Uq(e,t){return"url"in(e?.sizes?.[t]??{})||"source_url"in(e?.media_details?.sizes?.[t]??{})}function F2e({attributes:e,setAttributes:t,isSelected:r,className:a,insertBlocksAfter:n,onReplace:i,context:l,clientId:s,__unstableParentLayout:c}){let{url:u="",caption:m,id:p,width:d,height:f,sizeSlug:h,aspectRatio:g,scale:b,align:y,metadata:k}=e,[_,x]=(0,bm.useState)(e.blob),S=(0,bm.useRef)(),C=c?.type||c?.default?.type,N=!C||C!=="flex"&&C!=="grid",[B,D]=jq(),[A,{width:H}]=(0,$q.useResizeObserver)(),F=H&&H<160,z=(0,bm.useRef)();(0,bm.useEffect)(()=>{z.current=m},[m]);let{__unstableMarkNextChangeAsNotPersistent:I,replaceBlock:R}=(0,ud.useDispatch)(on.store);(0,bm.useEffect)(()=>{["wide","full"].includes(y)&&(I(),t({width:void 0,height:void 0,aspectRatio:void 0,scale:void 0}))},[I,y,t]);let{getSettings:$,getBlockRootClientId:j,getBlockName:G,canInsertBlockType:O}=(0,ud.useSelect)(on.store),J=(0,on.useBlockEditingMode)(),{createErrorNotice:ee}=(0,ud.useDispatch)(Wq.store);function oe(de){ee(de,{type:"snackbar"}),t({src:void 0,id:void 0,url:void 0,blob:void 0})}function X(de){let ct=S.current?.ownerDocument.defaultView;if(de.every(at=>at instanceof ct.File)){let at=de,kt=j(s);at.some(ut=>!UN(ut))&&ee((0,Js.__)("If uploading to a gallery all files need to be image formats"),{id:"gallery-upload-invalid-file",type:"snackbar"});let Wr=at.filter(ut=>UN(ut)).map(ut=>(0,fv.createBlock)("core/image",{blob:(0,hv.createBlobURL)(ut)}));if(G(kt)==="core/gallery")R(s,Wr);else if(O("core/gallery",kt)){let ut=(0,fv.createBlock)("core/gallery",{},Wr);R(s,ut)}}}function te(de){if(Array.isArray(de)){X(de);return}if(!de||!de.url){t({url:void 0,alt:void 0,id:void 0,title:void 0,caption:void 0,blob:void 0}),x();return}if((0,hv.isBlobURL)(de.url)){x(de.url);return}let{imageDefaultSize:ct}=$(),at=nv;h&&Uq(de,h)?at=h:Uq(de,ct)&&(at=ct);let kt=V2e(de,at);if(typeof kt.caption=="string"&&kt.caption.includes(` `)&&(kt.caption=kt.caption.replace(/\n/g,"<br>")),z.current&&!kt.caption){let{caption:mt,...wo}=kt;kt=wo}let Wr;(!de.id||de.id!==p)&&(Wr={sizeSlug:at});let ut=e.linkDestination;if(!ut)switch(window?.wp?.media?.view?.settings?.defaultProps?.link||nd){case"file":case dh:ut=dh;break;case"post":case fh:ut=fh;break;case FN:ut=FN;break;case nd:ut=nd;break}let br;switch(ut){case dh:br=de.url;break;case fh:br=de.link;break}kt.href=br,t({blob:void 0,...kt,...Wr,linkDestination:ut}),x()}function ne(de){let ct=(0,v4.getProtocol)(de)?de:(0,v4.prependHTTPS)(de);ct!==u&&(t({blob:void 0,url:ct,id:void 0,sizeSlug:$().imageDefaultSize}),x())}Es({url:_,allowedTypes:tu,onChange:te,onError:oe});let pe=g4(p,u)?u:void 0,Ie=(0,ud.useSelect)(de=>!window.__clientSideMediaProcessing||!p?!1:de(qq.store).isUploadingById(p),[p]),Ne=!!u&&(0,es.jsx)("img",{alt:(0,Js.__)("Edit image"),title:(0,Js.__)("Edit image"),className:"edit-image-preview",src:u}),ae=(0,on.__experimentalUseBorderProps)(e),Re=(0,on.__experimentalGetShadowClassesAndStyles)(e),Ee=w(a,{"is-transient":!!_||Ie,"is-resized":!!d||!!f,[`size-${h}`]:h,"has-custom-border":!!ae.className||ae.style&&Object.keys(ae.style).length>0}),ie=(0,on.useBlockProps)({ref:S,className:Ee}),{lockUrlControls:fe=!1,lockUrlControlsMessage:ke}=(0,ud.useSelect)(de=>{if(!r)return{};let ct=(0,fv.getBlockBindingsSource)(k?.bindings?.url?.source);return{lockUrlControls:!!k?.bindings?.url&&!ct?.canUserEditValue?.({select:de,context:l,args:k?.bindings?.url?.args}),lockUrlControlsMessage:ct?.label?(0,Js.sprintf)((0,Js.__)("Connected to %s"),ct.label):(0,Js.__)("Connected to dynamic data")}},[l,r,k?.bindings?.url]);return(0,es.jsxs)(es.Fragment,{children:[(0,es.jsxs)("figure",{...ie,children:[(0,es.jsx)(Vq,{temporaryURL:_,isSideloading:Ie,attributes:e,setAttributes:t,isSingleSelected:r,insertBlocksAfter:n,onReplace:i,onSelectImage:te,onSelectURL:ne,onUploadError:oe,context:l,clientId:s,blockEditingMode:J,parentLayoutType:C,maxContentWidth:D}),(0,es.jsx)(on.MediaPlaceholder,{icon:(0,es.jsx)(on.BlockIcon,{icon:Wu}),onSelect:te,onSelectURL:ne,onError:oe,placeholder:de=>(0,es.jsxs)(Gq.Placeholder,{className:w("block-editor-media-placeholder",{[ae.className]:!!ae.className&&!r}),icon:!F&&(fe?XT:Wu),withIllustration:!r||F,label:!F&&(0,Js.__)("Image"),instructions:!fe&&!F&&(0,Js.__)("Drag and drop an image, upload, or choose from your library."),style:{aspectRatio:!(d&&f)&&g?g:void 0,width:f&&g?"100%":d,height:d&&g?"100%":f,objectFit:b,...ae.style,...Re.style},children:[fe&&!F&&ke,!fe&&!F&&de,A]}),allowedTypes:tu,handleUpload:de=>de.length===1,value:{id:p,src:pe},mediaPreview:Ne,disableMediaButtons:_||u})]}),r&&N&&B]})}var Zq=F2e;var b4={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/image",title:"Image",category:"media",usesContext:["allowResize","imageCrop","fixedHeight","navigationButtonType","postId","postType","queryId","galleryId"],description:"Insert an image to make a visual statement.",keywords:["img","photo","picture"],textdomain:"default",attributes:{blob:{type:"string",role:"local"},url:{type:"string",source:"attribute",selector:"img",attribute:"src",role:"content"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:"",role:"content"},caption:{type:"rich-text",source:"rich-text",selector:"figcaption",role:"content"},lightbox:{type:"object",enabled:{type:"boolean"}},title:{type:"string",source:"attribute",selector:"img",attribute:"title",role:"content"},href:{type:"string",source:"attribute",selector:"figure > a",attribute:"href",role:"content"},rel:{type:"string",source:"attribute",selector:"figure > a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure > a",attribute:"class"},id:{type:"number",role:"content"},width:{type:"string"},height:{type:"string"},aspectRatio:{type:"string"},scale:{type:"string"},focalPoint:{type:"object"},sizeSlug:{type:"string"},linkDestination:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"figure > a",attribute:"target"}},supports:{interactivity:!0,align:["left","center","right","wide","full"],anchor:!0,color:{text:!1,background:!1},filter:{duotone:!0},spacing:{margin:!0},__experimentalBorder:{color:!0,radius:!0,width:!0,__experimentalSkipSerialization:!0,__experimentalDefaultControls:{color:!0,radius:!0,width:!0}},shadow:{__experimentalSkipSerialization:!0}},selectors:{border:".wp-block-image img, .wp-block-image .wp-block-image__crop-area, .wp-block-image .components-placeholder",shadow:".wp-block-image img, .wp-block-image .wp-block-image__crop-area, .wp-block-image .components-placeholder",filter:{duotone:".wp-block-image img, .wp-block-image .components-placeholder"}},styles:[{name:"default",label:"Default",isDefault:!0},{name:"rounded",label:"Rounded"}],editorStyle:"wp-block-image-editor",style:"wp-block-image"};var ts=o(T(),1);var au=o(v(),1);function Kq({attributes:e}){let{url:t,alt:r,caption:a,align:n,href:i,rel:l,linkClass:s,width:c,height:u,aspectRatio:m,scale:p,focalPoint:d,id:f,linkTarget:h,sizeSlug:g,title:b,metadata:{bindings:y={}}={}}=e,k=l||void 0,_=(0,ts.__experimentalGetBorderClassesAndStyles)(e),x=(0,ts.__experimentalGetShadowClassesAndStyles)(e),S=w({alignnone:n==="none",[`size-${g}`]:g,"is-resized":c||u,"has-custom-border":!!_.className||_.style&&Object.keys(_.style).length>0}),C=w(_.className,{[`wp-image-${f}`]:!!f}),N=(0,au.jsx)("img",{src:t,alt:r,className:C||void 0,style:{..._.style,...x.style,aspectRatio:m,objectFit:p,objectPosition:d&&p?iv(d):void 0,width:c,height:u},title:b}),B=!ts.RichText.isEmpty(a)||y.caption||y?.__default?.source==="core/pattern-overrides",D=(0,au.jsxs)(au.Fragment,{children:[i?(0,au.jsx)("a",{className:s,href:i,target:h,rel:k,children:N}):N,B&&(0,au.jsx)(ts.RichText.Content,{className:(0,ts.__experimentalGetElementClassName)("caption"),tagName:"figcaption",value:a})]});return(0,au.jsx)("figure",{...ts.useBlockProps.save({className:S}),children:D})}var y4=o(Rr(),1),gv=o(W(),1);function O2e(e,{shortcode:t}){let{body:r}=document.implementation.createHTMLDocument("");r.innerHTML=t.content;let a=r.querySelector("img");for(;a&&a.parentNode&&a.parentNode!==r;)a=a.parentNode;return a&&a.parentNode.removeChild(a),r.innerHTML.trim()}function hE(e,t){let{body:r}=document.implementation.createHTMLDocument("");r.innerHTML=e;let{firstElementChild:a}=r;if(a&&a.nodeName==="A")return a.getAttribute(t)||void 0}var Qq={img:{attributes:["src","alt","title"],classes:["alignleft","aligncenter","alignright","alignnone",/^wp-image-\d+$/]}},j2e=({phrasingContentSchema:e})=>({figure:{require:["img"],children:{...Qq,a:{attributes:["href","rel","target"],classes:["*"],children:Qq},figcaption:{children:e}}}}),U2e={from:[{type:"raw",isMatch:e=>e.nodeName==="FIGURE"&&!!e.querySelector("img"),schema:j2e,transform:e=>{let t=e.className+" "+e.querySelector("img").className,r=/(?:^|\s)align(left|center|right)(?:$|\s)/.exec(t),a=e.id===""?void 0:e.id,n=r?r[1]:void 0,i=/(?:^|\s)wp-image-(\d+)(?:$|\s)/.exec(t),l=i?Number(i[1]):void 0,s=e.querySelector("a"),c=s&&s.href?"custom":void 0,u=s&&s.href?s.href:void 0,m=s&&s.rel?s.rel:void 0,p=s&&s.className?s.className:void 0,d=(0,gv.getBlockAttributes)("core/image",e.outerHTML,{align:n,id:l,linkDestination:c,href:u,rel:m,linkClass:p,anchor:a});return(0,y4.isBlobURL)(d.url)&&(d.blob=d.url,delete d.url),(0,gv.createBlock)("core/image",d)}},{type:"files",isMatch(e){return e.every(t=>t.type.indexOf("image/")===0)},transform(e){return e.map(r=>(0,gv.createBlock)("core/image",{blob:(0,y4.createBlobURL)(r)}))}},{type:"shortcode",tag:"caption",attributes:{url:{type:"string",source:"attribute",attribute:"src",selector:"img"},alt:{type:"string",source:"attribute",attribute:"alt",selector:"img"},caption:{shortcode:O2e},href:{shortcode:(e,{shortcode:t})=>hE(t.content,"href")},rel:{shortcode:(e,{shortcode:t})=>hE(t.content,"rel")},linkClass:{shortcode:(e,{shortcode:t})=>hE(t.content,"class")},id:{type:"number",shortcode:({named:{id:e}})=>{if(e)return parseInt(e.replace("attachment_",""),10)}},align:{type:"string",shortcode:({named:{align:e="alignnone"}})=>e.replace("align","")}}}]},Yq=U2e;var{fieldsKey:G2e,formKey:W2e}=K(Xq.privateApis),{name:Jq}=b4,_4={icon:Wu,example:{attributes:{sizeSlug:"large",url:"https://s.w.org/images/core/5.3/MtBlanc1.jpg",caption:(0,md.__)("Mont Blanc appears\u2014still, snowy, and serene.")}},__experimentalLabel(e,{context:t}){let r=e?.metadata?.name;if((t==="list-view"||t==="breadcrumb")&&r)return r;if(t==="accessibility"){let{caption:a,alt:n,url:i}=e;return i?n?n+(a?". "+a:""):a||"":(0,md.__)("Empty")}},getEditWrapperProps(e){return{"data-align":e.align}},transforms:Yq,edit:Zq,save:Kq,deprecated:Iq};window.__experimentalContentOnlyInspectorFields&&(_4[G2e]=[{id:"image",label:(0,md.__)("Image"),type:"media",Edit:{control:"media",allowedTypes:["image"],multiple:!1},getValue:({item:e})=>({id:e.id,url:e.url,alt:e.alt,caption:e.caption}),setValue:({value:e})=>({id:e.id,url:e.url,alt:e.alt,caption:e.caption})},{id:"link",label:(0,md.__)("Link"),type:"url",Edit:"link",getValue:({item:e})=>({url:e.href,rel:e.rel,linkTarget:e.linkTarget}),setValue:({value:e})=>({href:e.url,rel:e.rel,linkTarget:e.linkTarget})},{id:"caption",label:(0,md.__)("Caption"),type:"text",Edit:"rich-text"},{id:"alt",label:(0,md.__)("Alt text"),type:"text"}],_4[W2e]={fields:["image","link","caption","alt"]});var $2e=()=>E({name:Jq,metadata:b4,settings:_4});var vE={};Z(vE,{init:()=>Y2e,metadata:()=>x4,name:()=>aZ,settings:()=>nZ});var x4={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/latest-comments",title:"Latest Comments",category:"widgets",description:"Display a list of your most recent comments.",keywords:["recent comments"],textdomain:"default",attributes:{commentsToShow:{type:"number",default:5,minimum:1,maximum:100},displayAvatar:{type:"boolean",default:!0},displayDate:{type:"boolean",default:!0},displayContent:{type:"string",default:"excerpt",enum:["none","excerpt","full"]}},supports:{anchor:!0,align:!0,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},html:!1,spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}},style:"wp-block-latest-comments"};var k4=o(T(),1),Ba=o(M(),1),Pa=o(P(),1),eZ=o(Fu(),1),tZ=o(me(),1);var Xr=o(v(),1),Z2e=1,K2e=100;function rZ({attributes:e,setAttributes:t,name:r}){let{commentsToShow:a,displayAvatar:n,displayDate:i,displayContent:l}=e,s=q(),{content:c,status:u,error:m}=(0,eZ.useServerSideRender)({attributes:e,skipBlockSupportAttributes:!0,block:r,urlQueryArgs:{_locale:"site"}}),p=(0,tZ.useDisabled)(),d=(0,k4.useBlockProps)({ref:p});return(0,Xr.jsxs)(Xr.Fragment,{children:[(0,Xr.jsx)(k4.InspectorControls,{children:(0,Xr.jsxs)(Ba.__experimentalToolsPanel,{label:(0,Pa.__)("Settings"),resetAll:()=>{t({commentsToShow:5,displayAvatar:!0,displayDate:!0,displayContent:"excerpt"})},dropdownMenuProps:s,children:[(0,Xr.jsx)(Ba.__experimentalToolsPanelItem,{hasValue:()=>!n,label:(0,Pa.__)("Display avatar"),onDeselect:()=>t({displayAvatar:!0}),isShownByDefault:!0,children:(0,Xr.jsx)(Ba.ToggleControl,{label:(0,Pa.__)("Display avatar"),checked:n,onChange:()=>t({displayAvatar:!n})})}),(0,Xr.jsx)(Ba.__experimentalToolsPanelItem,{hasValue:()=>!i,label:(0,Pa.__)("Display date"),onDeselect:()=>t({displayDate:!0}),isShownByDefault:!0,children:(0,Xr.jsx)(Ba.ToggleControl,{label:(0,Pa.__)("Display date"),checked:i,onChange:()=>t({displayDate:!i})})}),(0,Xr.jsx)(Ba.__experimentalToolsPanelItem,{hasValue:()=>l!=="excerpt",label:(0,Pa.__)("Display content"),onDeselect:()=>t({displayContent:"excerpt"}),isShownByDefault:!0,children:(0,Xr.jsx)(Ba.SelectControl,{__next40pxDefaultSize:!0,label:(0,Pa.__)("Display content"),value:l,options:[{label:(0,Pa.__)("No content"),value:"none"},{label:(0,Pa.__)("Excerpt"),value:"excerpt"},{label:(0,Pa.__)("Full content"),value:"full"}],onChange:f=>t({displayContent:f})})}),(0,Xr.jsx)(Ba.__experimentalToolsPanelItem,{hasValue:()=>a!==5,label:(0,Pa.__)("Number of comments"),onDeselect:()=>t({commentsToShow:5}),isShownByDefault:!0,children:(0,Xr.jsx)(Ba.RangeControl,{__next40pxDefaultSize:!0,label:(0,Pa.__)("Number of comments"),value:a,onChange:f=>t({commentsToShow:f}),min:Z2e,max:K2e,required:!0})})]})}),u==="loading"&&(0,Xr.jsx)("div",{...d,children:(0,Xr.jsx)(Ba.Spinner,{})}),u==="error"&&(0,Xr.jsx)("div",{...d,children:(0,Xr.jsx)("p",{children:(0,Pa.sprintf)((0,Pa.__)("Error: %s"),m)})}),u==="success"&&(0,Xr.jsx)(uo,{wrapperProps:d,html:c})]})}var Q2e={attributes:{commentsToShow:{type:"number",default:5,minimum:1,maximum:100},displayAvatar:{type:"boolean",default:!0},displayDate:{type:"boolean",default:!0},displayExcerpt:{type:"boolean",default:!0}},supports:{align:!0,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},html:!1,spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}},isEligible(e){return e?.displayExcerpt===!1},migrate(e){return{...e,displayContent:e.displayExcerpt?"excerpt":"none"}}},oZ=[Q2e];var{name:aZ}=x4,nZ={icon:N0,example:{},edit:rZ,deprecated:oZ},Y2e=()=>E({name:aZ,metadata:x4,settings:nZ});var xE={};Z(xE,{init:()=>ibe,metadata:()=>Sh,name:()=>pZ,settings:()=>dZ});var Sh={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/latest-posts",title:"Latest Posts",category:"widgets",description:"Display a list of your most recent posts.",keywords:["recent posts"],textdomain:"default",attributes:{categories:{type:"array",items:{type:"object"}},selectedAuthor:{type:"number"},postsToShow:{type:"number",default:5},displayPostContent:{type:"boolean",default:!1},displayPostContentRadio:{type:"string",default:"excerpt"},excerptLength:{type:"number",default:55},displayAuthor:{type:"boolean",default:!1},displayPostDate:{type:"boolean",default:!1},postLayout:{type:"string",default:"list"},columns:{type:"number",default:3},order:{type:"string",default:"desc"},orderBy:{type:"string",default:"date"},displayFeaturedImage:{type:"boolean",default:!1},featuredImageAlign:{type:"string",enum:["left","center","right"]},featuredImageSizeSlug:{type:"string",default:"thumbnail"},featuredImageSizeWidth:{type:"number",default:null},featuredImageSizeHeight:{type:"number",default:null},addLinkToFeaturedImage:{type:"boolean",default:!1}},supports:{anchor:!0,align:!0,html:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}},interactivity:{clientNavigation:!0}},editorStyle:"wp-block-latest-posts-editor",style:"wp-block-latest-posts"};var{attributes:J2e}=Sh,iZ=[{attributes:{...J2e,categories:{type:"string"}},supports:{align:!0,html:!1},migrate:e=>({...e,categories:[{id:Number(e.categories)}]}),isEligible:({categories:e})=>e&&typeof e=="string",save:()=>null}];var $e=o(M(),1),Ve=o(P(),1),Th=o(Lk(),1),ec=o(T(),1),vv=o(V(),1);var yE=o(Q(),1),cZ=o(xr(),1),uZ=o(me(),1),mZ=o(U(),1);var lZ=10,sZ=100,bE=6,w4=55;var be=o(v(),1),ebe={per_page:-1,_fields:"id,name",context:"view"},tbe={per_page:-1,has_published_posts:["post"],context:"view"},rbe=[{value:"none",icon:ES,label:(0,Ve.__)("None")},{value:"left",icon:oP,label:(0,Ve.__)("Left")},{value:"center",icon:tP,label:(0,Ve.__)("Center")},{value:"right",icon:nP,label:(0,Ve.__)("Right")}];function obe(e,t){let r=e._embedded?.["wp:featuredmedia"]?.["0"];return{url:r?.media_details?.sizes?.[t]?.source_url??r?.source_url,alt:r?.alt_text}}function abe(e){return e._embedded?.author?.[0]}function nbe({attributes:e,setAttributes:t,postCount:r}){let{postsToShow:a,order:n,orderBy:i,categories:l,selectedAuthor:s,displayFeaturedImage:c,displayPostContentRadio:u,displayPostContent:m,displayPostDate:p,displayAuthor:d,postLayout:f,columns:h,excerptLength:g,featuredImageAlign:b,featuredImageSizeSlug:y,featuredImageSizeWidth:k,featuredImageSizeHeight:_,addLinkToFeaturedImage:x}=e,{imageSizes:S,defaultImageWidth:C,defaultImageHeight:N,categoriesList:B,authorList:D}=(0,vv.useSelect)(I=>{let{getEntityRecords:R,getUsers:$}=I(yE.store),j=I(ec.store).getSettings();return{defaultImageWidth:j.imageDimensions?.[y]?.width??0,defaultImageHeight:j.imageDimensions?.[y]?.height??0,imageSizes:j.imageSizes,categoriesList:R("taxonomy","category",ebe),authorList:$(tbe)}},[y]),A=q(),H=S.filter(({slug:I})=>I!=="full").map(({name:I,slug:R})=>({value:R,label:I})),F=B?.reduce((I,R)=>({...I,[R.name]:R}),{})??{},z=I=>{if(I.some(j=>typeof j=="string"&&!F[j]))return;let $=I.map(j=>typeof j=="string"?F[j]:j);if($.includes(null))return!1;t({categories:$})};return(0,be.jsxs)(be.Fragment,{children:[(0,be.jsxs)($e.__experimentalToolsPanel,{label:(0,Ve.__)("Post content"),resetAll:()=>t({displayPostContent:!1,displayPostContentRadio:"excerpt",excerptLength:w4}),dropdownMenuProps:A,children:[(0,be.jsx)($e.__experimentalToolsPanelItem,{hasValue:()=>!!m,label:(0,Ve.__)("Display post content"),onDeselect:()=>t({displayPostContent:!1}),isShownByDefault:!0,children:(0,be.jsx)($e.ToggleControl,{label:(0,Ve.__)("Display post content"),checked:m,onChange:I=>t({displayPostContent:I})})}),m&&(0,be.jsx)($e.__experimentalToolsPanelItem,{hasValue:()=>u!=="excerpt",label:(0,Ve.__)("Content length"),onDeselect:()=>t({displayPostContentRadio:"excerpt"}),isShownByDefault:!0,children:(0,be.jsx)($e.RadioControl,{label:(0,Ve.__)("Content length"),selected:u,options:[{label:(0,Ve.__)("Excerpt"),value:"excerpt"},{label:(0,Ve.__)("Full post"),value:"full_post"}],onChange:I=>t({displayPostContentRadio:I})})}),m&&u==="excerpt"&&(0,be.jsx)($e.__experimentalToolsPanelItem,{hasValue:()=>g!==w4,label:(0,Ve.__)("Max number of words"),onDeselect:()=>t({excerptLength:w4}),isShownByDefault:!0,children:(0,be.jsx)($e.RangeControl,{__next40pxDefaultSize:!0,label:(0,Ve.__)("Max number of words"),value:g,onChange:I=>t({excerptLength:I}),min:lZ,max:sZ})})]}),(0,be.jsxs)($e.__experimentalToolsPanel,{label:(0,Ve.__)("Post meta"),resetAll:()=>t({displayAuthor:!1,displayPostDate:!1}),dropdownMenuProps:A,children:[(0,be.jsx)($e.__experimentalToolsPanelItem,{hasValue:()=>!!d,label:(0,Ve.__)("Display author name"),onDeselect:()=>t({displayAuthor:!1}),isShownByDefault:!0,children:(0,be.jsx)($e.ToggleControl,{label:(0,Ve.__)("Display author name"),checked:d,onChange:I=>t({displayAuthor:I})})}),(0,be.jsx)($e.__experimentalToolsPanelItem,{hasValue:()=>!!p,label:(0,Ve.__)("Display post date"),onDeselect:()=>t({displayPostDate:!1}),isShownByDefault:!0,children:(0,be.jsx)($e.ToggleControl,{label:(0,Ve.__)("Display post date"),checked:p,onChange:I=>t({displayPostDate:I})})})]}),(0,be.jsxs)($e.__experimentalToolsPanel,{label:(0,Ve.__)("Featured image"),resetAll:()=>t({displayFeaturedImage:!1,featuredImageAlign:void 0,featuredImageSizeSlug:"thumbnail",featuredImageSizeWidth:null,featuredImageSizeHeight:null,addLinkToFeaturedImage:!1}),dropdownMenuProps:A,children:[(0,be.jsx)($e.__experimentalToolsPanelItem,{hasValue:()=>!!c,label:(0,Ve.__)("Display featured image"),onDeselect:()=>t({displayFeaturedImage:!1}),isShownByDefault:!0,children:(0,be.jsx)($e.ToggleControl,{label:(0,Ve.__)("Display featured image"),checked:c,onChange:I=>t({displayFeaturedImage:I})})}),c&&(0,be.jsxs)(be.Fragment,{children:[(0,be.jsx)($e.__experimentalToolsPanelItem,{hasValue:()=>y!=="thumbnail"||k!==null||_!==null,label:(0,Ve.__)("Image size"),onDeselect:()=>t({featuredImageSizeSlug:"thumbnail",featuredImageSizeWidth:null,featuredImageSizeHeight:null}),isShownByDefault:!0,children:(0,be.jsx)(ec.__experimentalImageSizeControl,{onChange:I=>{let R={};I.hasOwnProperty("width")&&(R.featuredImageSizeWidth=I.width),I.hasOwnProperty("height")&&(R.featuredImageSizeHeight=I.height),t(R)},slug:y,width:k,height:_,imageWidth:C,imageHeight:N,imageSizeOptions:H,imageSizeHelp:(0,Ve.__)("Select the size of the source image."),onChangeImage:I=>t({featuredImageSizeSlug:I,featuredImageSizeWidth:void 0,featuredImageSizeHeight:void 0})})}),(0,be.jsx)($e.__experimentalToolsPanelItem,{hasValue:()=>!!b,label:(0,Ve.__)("Image alignment"),onDeselect:()=>t({featuredImageAlign:void 0}),isShownByDefault:!0,children:(0,be.jsx)($e.__experimentalToggleGroupControl,{className:"editor-latest-posts-image-alignment-control",__next40pxDefaultSize:!0,label:(0,Ve.__)("Image alignment"),value:b||"none",onChange:I=>t({featuredImageAlign:I!=="none"?I:void 0}),children:rbe.map(({value:I,icon:R,label:$})=>(0,be.jsx)($e.__experimentalToggleGroupControlOptionIcon,{value:I,icon:R,label:$},I))})}),(0,be.jsx)($e.__experimentalToolsPanelItem,{hasValue:()=>!!x,label:(0,Ve.__)("Add link to featured image"),onDeselect:()=>t({addLinkToFeaturedImage:!1}),isShownByDefault:!0,children:(0,be.jsx)($e.ToggleControl,{label:(0,Ve.__)("Add link to featured image"),checked:x,onChange:I=>t({addLinkToFeaturedImage:I})})})]})]}),(0,be.jsxs)($e.__experimentalToolsPanel,{label:(0,Ve.__)("Sorting and filtering"),resetAll:()=>t({order:"desc",orderBy:"date",postsToShow:5,categories:void 0,selectedAuthor:void 0,columns:3}),dropdownMenuProps:A,children:[(0,be.jsx)($e.__experimentalToolsPanelItem,{hasValue:()=>n!=="desc"||i!=="date"||a!==5||l?.length>0||!!s,label:(0,Ve.__)("Sort and filter"),onDeselect:()=>t({order:"desc",orderBy:"date",postsToShow:5,categories:void 0,selectedAuthor:void 0}),isShownByDefault:!0,children:(0,be.jsx)($e.QueryControls,{order:n,orderBy:i,numberOfItems:a,onOrderChange:I=>t({order:I}),onOrderByChange:I=>t({orderBy:I}),onNumberOfItemsChange:I=>t({postsToShow:I}),categorySuggestions:F,onCategoryChange:z,selectedCategories:l,onAuthorChange:I=>t({selectedAuthor:I!==""?Number(I):void 0}),authorList:D??[],selectedAuthorId:s})}),f==="grid"&&(0,be.jsx)($e.__experimentalToolsPanelItem,{hasValue:()=>h!==3,label:(0,Ve.__)("Columns"),onDeselect:()=>t({columns:3}),isShownByDefault:!0,children:(0,be.jsx)($e.RangeControl,{__next40pxDefaultSize:!0,label:(0,Ve.__)("Columns"),value:h,onChange:I=>t({columns:I}),min:2,max:r?Math.min(bE,r):bE,required:!0})})]})]})}function _E({attributes:e,setAttributes:t}){let r=(0,uZ.useInstanceId)(_E),{postsToShow:a,order:n,orderBy:i,categories:l,selectedAuthor:s,displayFeaturedImage:c,displayPostContentRadio:u,displayPostContent:m,displayPostDate:p,displayAuthor:d,postLayout:f,columns:h,excerptLength:g,featuredImageAlign:b,featuredImageSizeSlug:y,featuredImageSizeWidth:k,featuredImageSizeHeight:_,addLinkToFeaturedImage:x}=e,{latestPosts:S}=(0,vv.useSelect)(I=>{let{getEntityRecords:R}=I(yE.store),$=l&&l.length>0?l.map(G=>G.id):[],j=Object.fromEntries(Object.entries({categories:$,author:s,order:n,orderby:i,per_page:a,_embed:"author,wp:featuredmedia",ignore_sticky:!0}).filter(([,G])=>typeof G<"u"));return{latestPosts:R("postType","post",j)}},[a,n,i,l,s]),{createWarningNotice:C}=(0,vv.useDispatch)(cZ.store),N=I=>{I.preventDefault(),C((0,Ve.__)("Links are disabled in the editor."),{id:`block-library/core/latest-posts/redirection-prevented/${r}`,type:"snackbar"})},B=!!S?.length,D=(0,be.jsx)(ec.InspectorControls,{children:(0,be.jsx)(nbe,{attributes:e,setAttributes:t,postCount:S?.length??0})}),A=(0,ec.useBlockProps)({className:w({"wp-block-latest-posts__list":!0,"is-grid":f==="grid","has-dates":p,"has-author":d,[`columns-${h}`]:f==="grid"})});if(!B)return(0,be.jsxs)("div",{...A,children:[D,(0,be.jsx)($e.Placeholder,{icon:Q0,label:(0,Ve.__)("Latest Posts"),children:Array.isArray(S)?(0,Ve.__)("No posts found."):(0,be.jsx)($e.Spinner,{})})]});let H=S.length>a?S.slice(0,a):S,F=[{icon:Nl,title:(0,Ve._x)("List view","Latest posts block display setting"),onClick:()=>t({postLayout:"list"}),isActive:f==="list"},{icon:Il,title:(0,Ve._x)("Grid view","Latest posts block display setting"),onClick:()=>t({postLayout:"grid"}),isActive:f==="grid"}],z=(0,Th.getSettings)().formats.date;return(0,be.jsxs)(be.Fragment,{children:[D,(0,be.jsx)(ec.BlockControls,{children:(0,be.jsx)($e.ToolbarGroup,{controls:F})}),(0,be.jsx)("ul",{...A,children:H.map(I=>{let R=I.title.rendered.trim(),$=I.excerpt.rendered,j=abe(I),G=document.createElement("div");G.innerHTML=$,$=G.textContent||G.innerText||"";let{url:O,alt:J}=obe(I,y),ee=w({"wp-block-latest-posts__featured-image":!0,[`align${b}`]:!!b}),oe=c&&O,X=oe&&(0,be.jsx)("img",{src:O,alt:J,style:{maxWidth:k,maxHeight:_}}),ne=g<$.trim().split(" ").length&&I.excerpt.raw===""?(0,be.jsxs)(be.Fragment,{children:[$.trim().split(" ",g).join(" "),(0,mZ.createInterpolateElement)((0,Ve.sprintf)((0,Ve.__)("\u2026 <a>Read more<span>: %1$s</span></a>"),R||(0,Ve.__)("(no title)")),{a:(0,be.jsx)("a",{className:"wp-block-latest-posts__read-more",href:I.link,rel:"noopener noreferrer",onClick:N}),span:(0,be.jsx)("span",{className:"screen-reader-text"})})]}):$;return(0,be.jsxs)("li",{children:[oe&&(0,be.jsx)("div",{className:ee,children:x?(0,be.jsx)("a",{href:I.link,onClick:N,children:X}):X}),(0,be.jsx)("a",{className:"wp-block-latest-posts__post-title",href:I.link,dangerouslySetInnerHTML:R?{__html:R}:void 0,onClick:N,children:R?null:(0,Ve.__)("(no title)")}),d&&j&&(0,be.jsx)("div",{className:"wp-block-latest-posts__post-author",children:(0,Ve.sprintf)((0,Ve.__)("by %s"),j.name)}),p&&I.date_gmt&&(0,be.jsx)("time",{dateTime:(0,Th.format)("c",I.date_gmt),className:"wp-block-latest-posts__post-date",children:(0,Th.dateI18n)(z,I.date_gmt)}),m&&u==="excerpt"&&(0,be.jsx)("div",{className:"wp-block-latest-posts__post-excerpt",children:ne}),m&&u==="full_post"&&(0,be.jsx)("div",{className:"wp-block-latest-posts__post-full-content",dangerouslySetInnerHTML:{__html:I.content.raw.trim()}})]},I.id)})})]})}var{name:pZ}=Sh,dZ={icon:t1,example:{},edit:_E,deprecated:iZ},ibe=()=>E({name:pZ,metadata:Sh,settings:dZ});var SE={};Z(SE,{init:()=>_be,metadata:()=>P4,name:()=>NZ,settings:()=>EZ});var Ih=o(P(),1);var rs=o(T(),1);var Ph=o(W(),1),C4={A:"upper-alpha",a:"lower-alpha",I:"upper-roman",i:"lower-roman"};function kE(e){let t=e.getAttribute("type"),r={ordered:e.tagName==="OL",anchor:e.id?e.id:void 0,start:e.getAttribute("start")?parseInt(e.getAttribute("start"),10):void 0,reversed:e.hasAttribute("reversed")?!0:void 0,type:t&&C4[t]?C4[t]:void 0},a=Array.from(e.children).map(n=>{let i=Array.from(n.childNodes).filter(d=>d.nodeType!==d.TEXT_NODE||d.textContent.trim().length!==0);i.reverse();let[l,...s]=i;if(!(l?.tagName==="UL"||l?.tagName==="OL"))return(0,Ph.createBlock)("core/list-item",{content:n.innerHTML});let u=s.map(d=>d.nodeType===d.TEXT_NODE?d.textContent:d.outerHTML);u.reverse();let m={content:u.join("").trim()},p=[kE(l)];return(0,Ph.createBlock)("core/list-item",m,p)});return(0,Ph.createBlock)("core/list",r,a)}function S4(e){let{values:t,start:r,reversed:a,ordered:n,type:i,...l}=e,s=document.createElement(n?"ol":"ul");s.innerHTML=t,r&&s.setAttribute("start",r),a&&s.setAttribute("reversed",!0),i&&s.setAttribute("type",i);let[c]=(0,Ph.rawHandler)({HTML:s.outerHTML});return[{...l,...c.attributes},c.innerBlocks]}function fZ(e){let{type:t}=e;return t&&C4[t]?{...e,type:C4[t]}:e}var nu=o(v(),1),lbe={attributes:{ordered:{type:"boolean",default:!1,role:"content"},values:{type:"string",source:"html",selector:"ol,ul",multiline:"li",__unstableMultilineWrapperTags:["ol","ul"],default:"",role:"content"},type:{type:"string"},start:{type:"number"},reversed:{type:"boolean"},placeholder:{type:"string"}},supports:{anchor:!0,className:!1,typography:{fontSize:!0,__experimentalFontFamily:!0},color:{gradients:!0,link:!0},__unstablePasteTextInline:!0,__experimentalSelector:"ol,ul",__experimentalSlashInserter:!0},save({attributes:e}){let{ordered:t,values:r,type:a,reversed:n,start:i}=e;return(0,nu.jsx)(t?"ol":"ul",{...rs.useBlockProps.save({type:a,reversed:n,start:i}),children:(0,nu.jsx)(rs.RichText.Content,{value:r,multiline:"li"})})},migrate:Ot,isEligible({style:e}){return e?.typography?.fontFamily}},sbe={attributes:{ordered:{type:"boolean",default:!1,role:"content"},values:{type:"string",source:"html",selector:"ol,ul",multiline:"li",__unstableMultilineWrapperTags:["ol","ul"],default:"",role:"content"},type:{type:"string"},start:{type:"number"},reversed:{type:"boolean"},placeholder:{type:"string"}},supports:{anchor:!0,className:!1,typography:{fontSize:!0,__experimentalFontFamily:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0}},color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},__unstablePasteTextInline:!0,__experimentalSelector:"ol,ul",__experimentalSlashInserter:!0},save({attributes:e}){let{ordered:t,values:r,type:a,reversed:n,start:i}=e;return(0,nu.jsx)(t?"ol":"ul",{...rs.useBlockProps.save({type:a,reversed:n,start:i}),children:(0,nu.jsx)(rs.RichText.Content,{value:r,multiline:"li"})})},migrate:S4},cbe={attributes:{ordered:{type:"boolean",default:!1,role:"content"},values:{type:"string",source:"html",selector:"ol,ul",multiline:"li",__unstableMultilineWrapperTags:["ol","ul"],default:"",role:"content"},type:{type:"string"},start:{type:"number"},reversed:{type:"boolean"},placeholder:{type:"string"}},supports:{anchor:!0,className:!1,typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},__unstablePasteTextInline:!0,__experimentalSelector:"ol,ul",__experimentalSlashInserter:!0},isEligible({type:e}){return!!e},save({attributes:e}){let{ordered:t,type:r,reversed:a,start:n}=e;return(0,nu.jsx)(t?"ol":"ul",{...rs.useBlockProps.save({type:r,reversed:a,start:n}),children:(0,nu.jsx)(rs.InnerBlocks.Content,{})})},migrate:fZ},ube={attributes:{ordered:{type:"boolean",default:!1,role:"content"},values:{type:"string",source:"html",selector:"ol,ul",multiline:"li",__unstableMultilineWrapperTags:["ol","ul"],default:"",role:"content"},type:{type:"string"},start:{type:"number"},reversed:{type:"boolean"},placeholder:{type:"string"}},supports:{anchor:!0,className:!1,typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},__unstablePasteTextInline:!0,__experimentalSelector:"ol,ul",__experimentalOnMerge:"true",__experimentalSlashInserter:!0},save({attributes:e}){let{ordered:t,type:r,reversed:a,start:n}=e;return(0,nu.jsx)(t?"ol":"ul",{...rs.useBlockProps.save({reversed:a,start:n,style:{listStyleType:t&&r!=="decimal"?r:void 0}}),children:(0,nu.jsx)(rs.InnerBlocks.Content,{})})}},hZ=[ube,cbe,sbe,lbe];var as=o(T(),1),T4=o(M(),1),ym=o(V(),1),os=o(P(),1);var CZ=o(W(),1),pd=o(U(),1),SZ=o(Ff(),1);var oa=o(P(),1),vZ=o(T(),1),aa=o(M(),1),bZ=o(U(),1);var Fn=o(v(),1),gZ=[{label:(0,oa.__)("Numbers"),value:"decimal"},{label:(0,oa.__)("Uppercase letters"),value:"upper-alpha"},{label:(0,oa.__)("Lowercase letters"),value:"lower-alpha"},{label:(0,oa.__)("Uppercase Roman numerals"),value:"upper-roman"},{label:(0,oa.__)("Lowercase Roman numerals"),value:"lower-roman"}],mbe=({setAttributes:e,reversed:t,start:r,type:a})=>{let n=q();return(0,Fn.jsx)(vZ.InspectorControls,{children:bZ.Platform.isNative?(0,Fn.jsxs)(aa.PanelBody,{title:(0,oa.__)("Settings"),children:[(0,Fn.jsx)(aa.SelectControl,{__next40pxDefaultSize:!0,label:(0,oa.__)("List style"),options:gZ,value:a,onChange:i=>e({type:i})}),(0,Fn.jsx)(aa.TextControl,{__next40pxDefaultSize:!0,label:(0,oa.__)("Start value"),type:"number",onChange:i=>{let l=parseInt(i,10);e({start:isNaN(l)?void 0:l})},value:Number.isInteger(r)?r.toString(10):"",step:"1"}),(0,Fn.jsx)(aa.ToggleControl,{label:(0,oa.__)("Reverse order"),checked:t||!1,onChange:i=>{e({reversed:i||void 0})}})]}):(0,Fn.jsxs)(aa.__experimentalToolsPanel,{label:(0,oa.__)("Settings"),resetAll:()=>{e({type:void 0,start:void 0,reversed:void 0})},dropdownMenuProps:n,children:[(0,Fn.jsx)(aa.__experimentalToolsPanelItem,{label:(0,oa.__)("List style"),isShownByDefault:!0,hasValue:()=>!!a,onDeselect:()=>e({type:void 0}),children:(0,Fn.jsx)(aa.SelectControl,{__next40pxDefaultSize:!0,label:(0,oa.__)("List style"),options:gZ,value:a||"decimal",onChange:i=>e({type:i})})}),(0,Fn.jsx)(aa.__experimentalToolsPanelItem,{label:(0,oa.__)("Start value"),isShownByDefault:!0,hasValue:()=>!!r,onDeselect:()=>e({start:void 0}),children:(0,Fn.jsx)(aa.TextControl,{__next40pxDefaultSize:!0,label:(0,oa.__)("Start value"),type:"number",onChange:i=>{let l=parseInt(i,10);e({start:isNaN(l)?void 0:l})},value:Number.isInteger(r)?r.toString(10):"",step:"1"})}),(0,Fn.jsx)(aa.__experimentalToolsPanelItem,{label:(0,oa.__)("Reverse order"),isShownByDefault:!0,hasValue:()=>!!t,onDeselect:()=>e({reversed:void 0}),children:(0,Fn.jsx)(aa.ToggleControl,{label:(0,oa.__)("Reverse order"),checked:t||!1,onChange:i=>{e({reversed:i||void 0})}})})]})})},yZ=mbe;var _Z=o(U(),1),xZ=o(v(),1);function pbe(e,t){let{ordered:r,...a}=e;return(0,xZ.jsx)(r?"ol":"ul",{ref:t,...a})}var kZ=(0,_Z.forwardRef)(pbe);var Hn=o(v(),1),dbe={name:"core/list-item"},fbe=[["core/list-item"]],wZ=8;function hbe(e,t){let r=(0,ym.useRegistry)(),{updateBlockAttributes:a,replaceInnerBlocks:n}=(0,ym.useDispatch)(as.store);(0,pd.useEffect)(()=>{if(!e.values)return;let[i,l]=S4(e);(0,SZ.default)("Value attribute on the list block",{since:"6.0",version:"6.5",alternative:"inner blocks"}),r.batch(()=>{a(t,i),n(t,l)})},[e.values])}function gbe(e){let{replaceBlocks:t,selectionChange:r}=(0,ym.useDispatch)(as.store),{getBlockRootClientId:a,getBlockAttributes:n,getBlock:i}=(0,ym.useSelect)(as.store);return(0,pd.useCallback)(()=>{let l=a(e),s=n(l),c=(0,CZ.createBlock)("core/list-item",s),{innerBlocks:u}=i(e);t([l],[c,...u]),r(u[u.length-1].clientId)},[e])}function vbe({clientId:e}){let t=gbe(e),r=(0,ym.useSelect)(a=>{let{getBlockRootClientId:n,getBlockName:i}=a(as.store);return i(n(e))==="core/list-item"},[e]);return(0,Hn.jsx)(Hn.Fragment,{children:(0,Hn.jsx)(T4.ToolbarButton,{icon:(0,os.isRTL)()?H0:O0,title:(0,os.__)("Outdent"),description:(0,os.__)("Outdent list item"),disabled:!r,onClick:t})})}function TZ({attributes:e,setAttributes:t,clientId:r,style:a}){let{ordered:n,type:i,reversed:l,start:s}=e,c=(0,as.useBlockProps)({style:{...pd.Platform.isNative&&a,listStyleType:n&&i!=="decimal"?i:void 0}}),u=(0,as.useInnerBlocksProps)(c,{defaultBlock:dbe,directInsert:!0,template:fbe,templateLock:!1,templateInsertUpdatesSelection:!0,...pd.Platform.isNative&&{marginVertical:wZ,marginHorizontal:wZ,renderAppender:!1},__experimentalCaptureToolbars:!0});hbe(e,r);let m=(0,Hn.jsxs)(as.BlockControls,{group:"block",children:[(0,Hn.jsx)(T4.ToolbarButton,{icon:(0,os.isRTL)()?z0:V0,title:(0,os.__)("Unordered"),description:(0,os.__)("Convert to unordered list"),isActive:n===!1,onClick:()=>{t({ordered:!1})}}),(0,Hn.jsx)(T4.ToolbarButton,{icon:(0,os.isRTL)()?F0:Ki,title:(0,os.__)("Ordered"),description:(0,os.__)("Convert to ordered list"),isActive:n===!0,onClick:()=>{t({ordered:!0})}}),(0,Hn.jsx)(vbe,{clientId:r})]});return(0,Hn.jsxs)(Hn.Fragment,{children:[(0,Hn.jsx)(kZ,{ordered:n,reversed:l,start:s,...u}),m,n&&(0,Hn.jsx)(yZ,{setAttributes:t,reversed:l,start:s,type:i})]})}var P4={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/list",title:"List",category:"text",allowedBlocks:["core/list-item"],description:"An organized collection of items displayed in a specific order.",keywords:["bullet list","ordered list","numbered list"],textdomain:"default",attributes:{ordered:{type:"boolean",default:!1,role:"content"},values:{type:"string",source:"html",selector:"ol,ul",multiline:"li",default:"",role:"content"},type:{type:"string"},start:{type:"number"},reversed:{type:"boolean"},placeholder:{type:"string"}},supports:{anchor:!0,html:!1,__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},__unstablePasteTextInline:!0,__experimentalOnMerge:!0,__experimentalSlashInserter:!0,interactivity:{clientNavigation:!0},listView:!0},selectors:{border:".wp-block-list:not(.wp-block-list .wp-block-list)"},editorStyle:"wp-block-list-editor",style:"wp-block-list"};var B4=o(T(),1),wE=o(v(),1);function PZ({attributes:e}){let{ordered:t,type:r,reversed:a,start:n}=e;return(0,wE.jsx)(t?"ol":"ul",{...B4.useBlockProps.save({reversed:a,start:n,style:{listStyleType:t&&r!=="decimal"?r:void 0}}),children:(0,wE.jsx)(B4.InnerBlocks.Content,{})})}var iu=o(W(),1),Bh=o(em(),1);function BZ({phrasingContentSchema:e}){let t={...e,ul:{},ol:{attributes:["type","start","reversed"]}};return["ul","ol"].forEach(r=>{t[r].children={li:{children:t}}}),t}function CE(e){return e.flatMap(({name:t,attributes:r,innerBlocks:a=[]})=>t==="core/list-item"?[r.content,...CE(a)]:CE(a))}var ybe={from:[{type:"block",isMultiBlock:!0,blocks:["core/paragraph","core/heading"],transform:e=>{let t=[];if(e.length>1)t=e.map(({content:r})=>(0,iu.createBlock)("core/list-item",{content:r}));else if(e.length===1){let r=(0,Bh.create)({html:e[0].content});t=(0,Bh.split)(r,` `).map(a=>(0,iu.createBlock)("core/list-item",{content:(0,Bh.toHTMLString)({value:a})}))}return(0,iu.createBlock)("core/list",{anchor:e.anchor},t)}},{type:"raw",selector:"ol,ul",schema:e=>({ol:BZ(e).ol,ul:BZ(e).ul}),transform:kE},...["*","-"].map(e=>({type:"prefix",prefix:e,transform(t){return(0,iu.createBlock)("core/list",{},[(0,iu.createBlock)("core/list-item",{content:t})])}})),...["1.","1)"].map(e=>({type:"prefix",prefix:e,transform(t){return(0,iu.createBlock)("core/list",{ordered:!0},[(0,iu.createBlock)("core/list-item",{content:t})])}}))],to:[...["core/paragraph","core/heading"].map(e=>({type:"block",blocks:[e],transform:(t,r)=>CE(r).map(a=>(0,iu.createBlock)(e,{content:a}))}))]},IZ=ybe;var{name:NZ}=P4,EZ={icon:Nl,example:{innerBlocks:[{name:"core/list-item",attributes:{content:(0,Ih.__)("Alice.")}},{name:"core/list-item",attributes:{content:(0,Ih.__)("The White Rabbit.")}},{name:"core/list-item",attributes:{content:(0,Ih.__)("The Cheshire Cat.")}},{name:"core/list-item",attributes:{content:(0,Ih.__)("The Mad Hatter.")}},{name:"core/list-item",attributes:{content:(0,Ih.__)("The Queen of Hearts.")}}]},transforms:IZ,edit:TZ,save:PZ,deprecated:hZ},_be=()=>E({name:NZ,metadata:P4,settings:EZ});var PE={};Z(PE,{init:()=>Cbe,metadata:()=>N4,name:()=>OZ,settings:()=>jZ});var _m=o(P(),1),I4=o(T(),1),km=o(M(),1),xm=o(U(),1),LZ=o(V(),1),MZ=o(bv(),1);var Ci=o(v(),1),{Badge:xbe}=K(km.privateApis);function AZ({attributes:e,setAttributes:t,isSelected:r}){let{latex:a,mathML:n}=e,[i,l]=(0,xm.useState)(),[s,c]=(0,xm.useState)(null),[u,m]=(0,xm.useState)(),p=(0,xm.useRef)(a),{__unstableMarkNextChangeAsNotPersistent:d}=(0,LZ.useDispatch)(I4.store);(0,xm.useEffect)(()=>{import("@wordpress/latex-to-mathml").then(h=>{m(()=>h.default),p.current&&(d(),t({mathML:h.default(p.current,{displayMode:!0})}))})},[p,t,d]);let f=(0,I4.useBlockProps)({ref:l,position:"relative"});return(0,Ci.jsxs)("div",{...f,children:[n?(0,Ci.jsx)("math",{display:"block",dangerouslySetInnerHTML:{__html:n}}):"\u200B",r&&(0,Ci.jsx)(km.Popover,{placement:"bottom-start",offset:8,anchor:i,focusOnMount:!1,__unstableSlotName:"__unstable-block-tools-after",children:(0,Ci.jsx)("div",{style:{padding:"4px",minWidth:"300px"},children:(0,Ci.jsxs)(km.__experimentalVStack,{spacing:1,children:[(0,Ci.jsx)(km.TextareaControl,{__next40pxDefaultSize:!0,label:(0,_m.__)("LaTeX math syntax"),hideLabelFromVision:!0,value:a,className:"wp-block-math__textarea-control",onChange:h=>{if(!u){t({latex:h});return}let g="";try{g=u(h,{displayMode:!0}),c(null)}catch(b){c(b.message),(0,MZ.speak)((0,_m.sprintf)((0,_m.__)("Error parsing mathematical expression: %s"),b.message))}t({mathML:g,latex:h})},placeholder:(0,_m.__)("e.g., x^2, \\frac{a}{b}")}),s&&(0,Ci.jsxs)(Ci.Fragment,{children:[(0,Ci.jsx)(xbe,{intent:"error",className:"wp-block-math__error",children:(0,_m.sprintf)((0,_m.__)("Error: %s"),s)}),(0,Ci.jsx)("style",{children:".wp-block-math__error .components-badge__content{white-space:normal}"})]})]})})})]})}var N4={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/math",title:"Math",category:"text",description:"Display mathematical notation using LaTeX.",keywords:["equation","formula","latex","mathematics"],textdomain:"default",supports:{anchor:!0,html:!1,__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0},color:{gradients:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},typography:{fontSize:!0,__experimentalDefaultControls:{fontSize:!0}}},attributes:{latex:{type:"string",role:"content"},mathML:{type:"string",source:"html",selector:"math"}}};var RZ=o(T(),1),TE=o(v(),1);function zZ({attributes:e}){let{latex:t,mathML:r}=e;return t?(0,TE.jsx)("div",{...RZ.useBlockProps.save(),children:(0,TE.jsx)("math",{display:"block",dangerouslySetInnerHTML:{__html:r}})}):null}var VZ=o(T(),1),FZ=o(v(),1),wbe={attributes:{latex:{type:"string",role:"content"},mathML:{type:"string",source:"html",selector:"math"}},save({attributes:e}){let{latex:t,mathML:r}=e;return t?(0,FZ.jsx)("math",{...VZ.useBlockProps.save(),display:"block",dangerouslySetInnerHTML:{__html:r}}):null}},HZ=[wbe];var{name:OZ}=N4,jZ={icon:IT,example:{attributes:{latex:"x = \\frac{-b \\pm \\sqrt{b^2-4ac}}{2a}",mathML:'<semantics><mrow><mi>x</mi><mo>=</mo><mfrac><mrow><mo lspace="0em" rspace="0em">\u2212</mo><mi>b</mi><mo>\xB1</mo><msqrt><mrow><msup><mi>b</mi><mn>2</mn></msup><mo>\u2212</mo><mn>4</mn><mi>a</mi><mi>c</mi></mrow></msqrt></mrow><mrow><mn>2</mn><mi>a</mi></mrow></mfrac></mrow><annotation encoding="application/x-tex">x = \\frac{-b \\pm \\sqrt{b^2-4ac}}{2a}</annotation></semantics>'},viewportWidth:300},edit:AZ,save:zZ,deprecated:HZ},Cbe=()=>E({name:OZ,metadata:N4,settings:jZ});var RE={};Z(RE,{init:()=>Nbe,metadata:()=>E4,name:()=>sK,settings:()=>A4});var nK=o(P(),1);var iK=o(T(),1),lK=o(W(),1);var E4={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/list-item",title:"List Item",category:"text",parent:["core/list"],allowedBlocks:["core/list"],description:"An individual item within a list.",textdomain:"default",attributes:{placeholder:{type:"string"},content:{type:"rich-text",source:"rich-text",selector:"li",role:"content"}},supports:{anchor:!0,className:!1,splitting:!0,__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0},color:{gradients:!0,link:!0,background:!0,__experimentalDefaultControls:{text:!0}},spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}},selectors:{root:".wp-block-list > li",border:".wp-block-list:not(.wp-block-list .wp-block-list) > li"}};var rc=o(T(),1),tc=o(P(),1),AE=o(M(),1);var JZ=o(me(),1),eK=o(V(),1),tK=o(As(),1);var UZ=o(U(),1),Nh=o(V(),1),BE=o(T(),1),GZ=o(W(),1);function lu(){let e=(0,Nh.useRegistry)(),{moveBlocksToPosition:t,removeBlock:r,insertBlock:a,updateBlockListSettings:n}=(0,Nh.useDispatch)(BE.store),{getBlockRootClientId:i,getBlockName:l,getBlockOrder:s,getBlockIndex:c,getSelectedBlockClientIds:u,getBlock:m,getBlockListSettings:p}=(0,Nh.useSelect)(BE.store);function d(f){let h=i(f),g=i(h);if(g&&l(g)==="core/list-item")return g}return(0,UZ.useCallback)((f=u())=>{if(Array.isArray(f)||(f=[f]),!f.length)return;let h=f[0];if(l(h)!=="core/list-item")return;let g=d(h);if(!g)return;let b=i(h),y=f[f.length-1],_=s(b).slice(c(y)+1);return e.batch(()=>{if(_.length){let x=s(h)[0];if(!x){let S=(0,GZ.cloneBlock)(m(b),{},[]);x=S.clientId,a(S,0,h,!1),n(x,p(b))}t(_,b,x)}t(f,b,i(g),c(g)+1),s(b).length||r(b,!1)}),!0},[])}var WZ=o(U(),1),D4=o(V(),1),IE=o(T(),1),yv=o(W(),1);function _v(e){let{replaceBlocks:t,selectionChange:r,multiSelect:a}=(0,D4.useDispatch)(IE.store),{getBlock:n,getPreviousBlockClientId:i,getSelectionStart:l,getSelectionEnd:s,hasMultiSelection:c,getMultiSelectedBlockClientIds:u}=(0,D4.useSelect)(IE.store);return(0,WZ.useCallback)(()=>{let m=c(),p=m?u():[e],d=p.map(y=>(0,yv.cloneBlock)(n(y))),f=i(e),h=(0,yv.cloneBlock)(n(f));h.innerBlocks?.length||(h.innerBlocks=[(0,yv.createBlock)("core/list")]),h.innerBlocks[h.innerBlocks.length-1].innerBlocks.push(...d);let g=l(),b=s();return t([f,...p],[h]),m?a(d[0].clientId,d[d.length-1].clientId):r(d[0].clientId,b.attributeKey,b.clientId===g.clientId?g.offset:b.offset,b.offset),!0},[e])}var dd=o(W(),1),$Z=o(U(),1),qZ=o(me(),1),ZZ=o(As(),1),L4=o(V(),1),NE=o(T(),1);function EE(e){let{replaceBlocks:t,selectionChange:r}=(0,L4.useDispatch)(NE.store),{getBlock:a,getBlockRootClientId:n,getBlockIndex:i,getBlockName:l}=(0,L4.useSelect)(NE.store),s=(0,$Z.useRef)(e);s.current=e;let c=lu();return(0,qZ.useRefEffect)(u=>{function m(p){if(p.defaultPrevented||p.keyCode!==ZZ.ENTER)return;let{content:d,clientId:f}=s.current;if(d.length)return;if(p.preventDefault(),l(n(n(s.current.clientId)))==="core/list-item"){c();return}let g=a(n(f)),b=i(f),y=(0,dd.cloneBlock)({...g,innerBlocks:g.innerBlocks.slice(0,b)}),k=(0,dd.createBlock)((0,dd.getDefaultBlockName)()),_=[...g.innerBlocks[b].innerBlocks[0]?.innerBlocks||[],...g.innerBlocks.slice(b+1)],x=_.length?[(0,dd.cloneBlock)({...g,innerBlocks:_})]:[];t(g.clientId,[y,k,...x],1),r(k.clientId)}return u.addEventListener("keydown",m),()=>{u.removeEventListener("keydown",m)}},[])}var KZ=o(me(),1),xv=o(As(),1),QZ=o(T(),1),YZ=o(V(),1);function DE(e){let{getSelectionStart:t,getSelectionEnd:r,getBlockIndex:a}=(0,YZ.useSelect)(QZ.store),n=_v(e),i=lu();return(0,KZ.useRefEffect)(l=>{function s(c){let{keyCode:u,shiftKey:m,altKey:p,metaKey:d,ctrlKey:f}=c;if(c.defaultPrevented||u!==xv.SPACE&&u!==xv.TAB||p||d||f)return;let h=t(),g=r();h.offset===0&&g.offset===0&&(m?u===xv.TAB&&i()&&c.preventDefault():a(e)!==0&&n()&&c.preventDefault())}return l.addEventListener("keydown",s),()=>{l.removeEventListener("keydown",s)}},[e,n])}var Eh=o(V(),1),LE=o(T(),1),XZ=o(W(),1);function ME(e,t){let r=(0,Eh.useRegistry)(),{getPreviousBlockClientId:a,getNextBlockClientId:n,getBlockOrder:i,getBlockRootClientId:l,getBlockName:s,getBlock:c}=(0,Eh.useSelect)(LE.store),{mergeBlocks:u,moveBlocksToPosition:m,removeBlock:p}=(0,Eh.useDispatch)(LE.store),d=lu();function f(y){let k=i(y);return k.length?f(k[k.length-1]):y}function h(y){let k=l(y),_=l(k);if(_&&s(_)==="core/list-item")return _}function g(y){let k=n(y);if(k)return k;let _=h(y);if(_)return g(_)}function b(y){let k=i(y);return k.length?i(k[0])[0]:g(y)}return y=>{function k(_,x){r.batch(()=>{let[S]=i(x);S&&(a(x)===_&&!i(_).length?m([S],x,_):m(i(S),S,l(_))),u(_,x)})}if(y){let _=b(e);if(!_){t(y);return}h(_)?d(_):k(e,_)}else{if(h(e)){d(e);return}let _=a(e);if(_){let S=f(_);k(S,e);return}let x=i(e);(0,XZ.isUnmodifiedBlock)(c(e),"content")&&x.length>0?r.batch(()=>{d(i(x[0])),p(e,!0)}):t(y)}}}var Si=o(v(),1);function Tbe({clientId:e}){let t=_v(e),r=lu(),{canIndent:a,canOutdent:n}=(0,eK.useSelect)(i=>{let{getBlockIndex:l,getBlockRootClientId:s,getBlockName:c}=i(rc.store);return{canIndent:l(e)>0,canOutdent:c(s(s(e)))==="core/list-item"}},[e]);return(0,Si.jsxs)(Si.Fragment,{children:[(0,Si.jsx)(AE.ToolbarButton,{icon:(0,tc.isRTL)()?H0:O0,title:(0,tc.__)("Outdent"),shortcut:tK.displayShortcut.shift("Tab"),description:(0,tc.__)("Outdent list item"),disabled:!n,onClick:()=>r()}),(0,Si.jsx)(AE.ToolbarButton,{icon:(0,tc.isRTL)()?L9:A9,title:(0,tc.__)("Indent"),shortcut:"Tab",description:(0,tc.__)("Indent list item"),disabled:!a,onClick:()=>t()})]})}function rK({attributes:e,setAttributes:t,clientId:r,mergeBlocks:a}){let{placeholder:n,content:i}=e,l=(0,rc.useBlockProps)(),s=(0,rc.useInnerBlocksProps)(l,{renderAppender:!1,__unstableDisableDropZone:!0}),c=EE({content:i,clientId:r}),u=DE(r),m=ME(r,a);return(0,Si.jsxs)(Si.Fragment,{children:[(0,Si.jsxs)("li",{...s,children:[(0,Si.jsx)(rc.RichText,{ref:(0,JZ.useMergeRefs)([c,u]),identifier:"content",tagName:"div",onChange:p=>t({content:p}),value:i,"aria-label":(0,tc.__)("List text"),placeholder:n||(0,tc.__)("List"),onMerge:m}),s.children]}),(0,Si.jsx)(rc.BlockControls,{group:"block",children:(0,Si.jsx)(Tbe,{clientId:r})})]})}var Dh=o(T(),1),kv=o(v(),1);function oK({attributes:e}){return(0,kv.jsxs)("li",{...Dh.useBlockProps.save(),children:[(0,kv.jsx)(Dh.RichText.Content,{value:e.content}),(0,kv.jsx)(Dh.InnerBlocks.Content,{})]})}var M4=o(W(),1),Pbe={to:[{type:"block",blocks:["core/paragraph"],transform:(e,t=[])=>[(0,M4.createBlock)("core/paragraph",e),...t.map(r=>(0,M4.cloneBlock)(r))]}]},aK=Pbe;var{fieldsKey:Bbe,formKey:Ibe}=K(lK.privateApis),{name:sK}=E4,A4={icon:xT,edit:rK,save:oK,merge(e,t){return{...e,content:e.content+t.content}},transforms:aK,[K(iK.privateApis).requiresWrapperOnCopy]:!0,__experimentalLabel(e,{context:t}){let{content:r}=e,a=e?.metadata?.name,n=r?.trim().length>0;if(t==="list-view"&&(a||n))return a||r;if(t==="breadcrumb"&&a)return a}};window.__experimentalContentOnlyInspectorFields&&(A4[Bbe]=[{id:"content",label:(0,nK.__)("Content"),type:"text",Edit:"rich-text"}],A4[Ibe]={fields:["content"]});var Nbe=()=>E({name:sK,metadata:E4,settings:A4});var zE={};Z(zE,{init:()=>Dbe,metadata:()=>z4,name:()=>uK,settings:()=>mK});var R4=o(T(),1),wm=o(M(),1),fd=o(P(),1);var Ti=o(v(),1);function cK({attributes:e,setAttributes:t}){let{displayLoginAsForm:r,redirectToCurrent:a}=e,n=q();return(0,Ti.jsxs)(Ti.Fragment,{children:[(0,Ti.jsx)(R4.InspectorControls,{children:(0,Ti.jsxs)(wm.__experimentalToolsPanel,{label:(0,fd.__)("Settings"),resetAll:()=>{t({displayLoginAsForm:!1,redirectToCurrent:!0})},dropdownMenuProps:n,children:[(0,Ti.jsx)(wm.__experimentalToolsPanelItem,{label:(0,fd.__)("Display login as form"),isShownByDefault:!0,hasValue:()=>r,onDeselect:()=>t({displayLoginAsForm:!1}),children:(0,Ti.jsx)(wm.ToggleControl,{label:(0,fd.__)("Display login as form"),checked:r,onChange:()=>t({displayLoginAsForm:!r})})}),(0,Ti.jsx)(wm.__experimentalToolsPanelItem,{label:(0,fd.__)("Redirect to current URL"),isShownByDefault:!0,hasValue:()=>!a,onDeselect:()=>t({redirectToCurrent:!0}),children:(0,Ti.jsx)(wm.ToggleControl,{label:(0,fd.__)("Redirect to current URL"),checked:a,onChange:()=>t({redirectToCurrent:!a})})})]})}),(0,Ti.jsx)("div",{...(0,R4.useBlockProps)({className:"logged-in"}),children:(0,Ti.jsx)("a",{href:"#login-pseudo-link",children:(0,fd.__)("Log out")})})]})}var z4={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/loginout",title:"Login/out",category:"theme",description:"Show login & logout links.",keywords:["login","logout","form"],textdomain:"default",attributes:{displayLoginAsForm:{type:"boolean",default:!1},redirectToCurrent:{type:"boolean",default:!0}},example:{viewportWidth:350},supports:{anchor:!0,className:!0,color:{background:!0,text:!1,gradients:!0,link:!0},spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0},interactivity:{clientNavigation:!0}},style:"wp-block-loginout"};var{name:uK}=z4,mK={icon:CT,edit:cK},Dbe=()=>E({name:uK,metadata:z4,settings:mK});var UE={};Z(UE,{init:()=>tye,metadata:()=>q4,name:()=>LK,settings:()=>Z4});var Sv=o(P(),1);var DK=o(W(),1);var pr=o(T(),1),VE=o(me(),1);var pK=o(P(),1),oc="full",wv=15,V4="none",F4="media",H4="attachment",dK=[["core/paragraph",{placeholder:(0,pK._x)("Content\u2026","content placeholder")}]];var we=o(v(),1),O4=(e,t)=>e?{backgroundImage:`url(${e})`,backgroundPosition:t?`${t.x*100}% ${t.y*100}%`:"50% 50%"}:{},fK=(e,t)=>e?{backgroundImage:`url(${e})`,backgroundPosition:t?`${Math.round(t.x*100)}% ${Math.round(t.y*100)}%`:"50% 50%"}:{},hd=50,ac=()=>{},hK=e=>{if(!e.customBackgroundColor)return e;let t={color:{background:e.customBackgroundColor}},{customBackgroundColor:r,...a}=e;return{...a,style:t}},Lh=e=>e.align?e:{...e,align:"wide"},j4={align:{type:"string",default:"wide"},mediaAlt:{type:"string",source:"attribute",selector:"figure img",attribute:"alt",default:""},mediaPosition:{type:"string",default:"left"},mediaId:{type:"number"},mediaType:{type:"string"},mediaWidth:{type:"number",default:50},isStackedOnMobile:{type:"boolean",default:!1}},FE={...j4,isStackedOnMobile:{type:"boolean",default:!0},mediaUrl:{type:"string",source:"attribute",selector:"figure video,figure img",attribute:"src"},mediaLink:{type:"string"},linkDestination:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"figure a",attribute:"target"},href:{type:"string",source:"attribute",selector:"figure a",attribute:"href"},rel:{type:"string",source:"attribute",selector:"figure a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure a",attribute:"class"},mediaSizeSlug:{type:"string"},verticalAlignment:{type:"string"},imageFill:{type:"boolean"},focalPoint:{type:"object"}},gK={...FE,mediaAlt:{type:"string",source:"attribute",selector:"figure img",attribute:"alt",default:"",role:"content"},mediaId:{type:"number",role:"content"},mediaUrl:{type:"string",source:"attribute",selector:"figure video,figure img",attribute:"src",role:"content"},href:{type:"string",source:"attribute",selector:"figure a",attribute:"href",role:"content"},mediaType:{type:"string",role:"content"}},Lbe={...gK,align:{type:"string",default:"none"},useFeaturedImage:{type:"boolean",default:!1}},HE={anchor:!0,align:["wide","full"],html:!1,color:{gradients:!0,link:!0}},vK={...HE,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}}},Mbe={...vK,__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,radius:!0,style:!0,width:!0}},color:{gradients:!0,heading:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},interactivity:{clientNavigation:!0}},Abe={attributes:Lbe,supports:Mbe,usesContext:["postId","postType"],save({attributes:e}){let{isStackedOnMobile:t,mediaAlt:r,mediaPosition:a,mediaType:n,mediaUrl:i,mediaWidth:l,mediaId:s,verticalAlignment:c,imageFill:u,focalPoint:m,linkClass:p,href:d,linkTarget:f,rel:h}=e,g=e.mediaSizeSlug||oc,b=h||void 0,y=w({[`wp-image-${s}`]:s&&n==="image",[`size-${g}`]:s&&n==="image"}),k=i?(0,we.jsx)("img",{src:i,alt:r,className:y||null}):null;d&&(k=(0,we.jsx)("a",{className:p,href:d,target:f,rel:b,children:k}));let _={image:()=>k,video:()=>(0,we.jsx)("video",{controls:!0,src:i})},x=w({"has-media-on-the-right":a==="right","is-stacked-on-mobile":t,[`is-vertically-aligned-${c}`]:c,"is-image-fill":u}),S=u?fK(i,m):{},C;l!==hd&&(C=a==="right"?`auto ${l}%`:`${l}% auto`);let N={gridTemplateColumns:C};return a==="right"?(0,we.jsxs)("div",{...pr.useBlockProps.save({className:x,style:N}),children:[(0,we.jsx)("div",{...pr.useInnerBlocksProps.save({className:"wp-block-media-text__content"})}),(0,we.jsx)("figure",{className:"wp-block-media-text__media",style:S,children:(_[n]||ac)()})]}):(0,we.jsxs)("div",{...pr.useBlockProps.save({className:x,style:N}),children:[(0,we.jsx)("figure",{className:"wp-block-media-text__media",style:S,children:(_[n]||ac)()}),(0,we.jsx)("div",{...pr.useInnerBlocksProps.save({className:"wp-block-media-text__content"})})]})}},Rbe={attributes:gK,supports:vK,save({attributes:e}){let{isStackedOnMobile:t,mediaAlt:r,mediaPosition:a,mediaType:n,mediaUrl:i,mediaWidth:l,mediaId:s,verticalAlignment:c,imageFill:u,focalPoint:m,linkClass:p,href:d,linkTarget:f,rel:h}=e,g=e.mediaSizeSlug||oc,b=h||void 0,y=w({[`wp-image-${s}`]:s&&n==="image",[`size-${g}`]:s&&n==="image"}),k=(0,we.jsx)("img",{src:i,alt:r,className:y||null});d&&(k=(0,we.jsx)("a",{className:p,href:d,target:f,rel:b,children:k}));let _={image:()=>k,video:()=>(0,we.jsx)("video",{controls:!0,src:i})},x=w({"has-media-on-the-right":a==="right","is-stacked-on-mobile":t,[`is-vertically-aligned-${c}`]:c,"is-image-fill":u}),S=u?fK(i,m):{},C;l!==hd&&(C=a==="right"?`auto ${l}%`:`${l}% auto`);let N={gridTemplateColumns:C};return a==="right"?(0,we.jsxs)("div",{...pr.useBlockProps.save({className:x,style:N}),children:[(0,we.jsx)("div",{...pr.useInnerBlocksProps.save({className:"wp-block-media-text__content"})}),(0,we.jsx)("figure",{className:"wp-block-media-text__media",style:S,children:(_[n]||ac)()})]}):(0,we.jsxs)("div",{...pr.useBlockProps.save({className:x,style:N}),children:[(0,we.jsx)("figure",{className:"wp-block-media-text__media",style:S,children:(_[n]||ac)()}),(0,we.jsx)("div",{...pr.useInnerBlocksProps.save({className:"wp-block-media-text__content"})})]})},migrate:Lh,isEligible(e,t,{block:r}){let{attributes:a}=r;return e.align===void 0&&!!a.className?.includes("alignwide")}},zbe={attributes:FE,supports:HE,save({attributes:e}){let{isStackedOnMobile:t,mediaAlt:r,mediaPosition:a,mediaType:n,mediaUrl:i,mediaWidth:l,mediaId:s,verticalAlignment:c,imageFill:u,focalPoint:m,linkClass:p,href:d,linkTarget:f,rel:h}=e,g=e.mediaSizeSlug||oc,b=h||void 0,y=w({[`wp-image-${s}`]:s&&n==="image",[`size-${g}`]:s&&n==="image"}),k=(0,we.jsx)("img",{src:i,alt:r,className:y||null});d&&(k=(0,we.jsx)("a",{className:p,href:d,target:f,rel:b,children:k}));let _={image:()=>k,video:()=>(0,we.jsx)("video",{controls:!0,src:i})},x=w({"has-media-on-the-right":a==="right","is-stacked-on-mobile":t,[`is-vertically-aligned-${c}`]:c,"is-image-fill":u}),S=u?O4(i,m):{},C;l!==hd&&(C=a==="right"?`auto ${l}%`:`${l}% auto`);let N={gridTemplateColumns:C};return a==="right"?(0,we.jsxs)("div",{...pr.useBlockProps.save({className:x,style:N}),children:[(0,we.jsx)("div",{...pr.useInnerBlocksProps.save({className:"wp-block-media-text__content"})}),(0,we.jsx)("figure",{className:"wp-block-media-text__media",style:S,children:(_[n]||ac)()})]}):(0,we.jsxs)("div",{...pr.useBlockProps.save({className:x,style:N}),children:[(0,we.jsx)("figure",{className:"wp-block-media-text__media",style:S,children:(_[n]||ac)()}),(0,we.jsx)("div",{...pr.useInnerBlocksProps.save({className:"wp-block-media-text__content"})})]})},migrate:Lh},Vbe={attributes:FE,supports:HE,save({attributes:e}){let{isStackedOnMobile:t,mediaAlt:r,mediaPosition:a,mediaType:n,mediaUrl:i,mediaWidth:l,mediaId:s,verticalAlignment:c,imageFill:u,focalPoint:m,linkClass:p,href:d,linkTarget:f,rel:h}=e,g=e.mediaSizeSlug||oc,b=h||void 0,y=w({[`wp-image-${s}`]:s&&n==="image",[`size-${g}`]:s&&n==="image"}),k=(0,we.jsx)("img",{src:i,alt:r,className:y||null});d&&(k=(0,we.jsx)("a",{className:p,href:d,target:f,rel:b,children:k}));let _={image:()=>k,video:()=>(0,we.jsx)("video",{controls:!0,src:i})},x=w({"has-media-on-the-right":a==="right","is-stacked-on-mobile":t,[`is-vertically-aligned-${c}`]:c,"is-image-fill":u}),S=u?O4(i,m):{},C;l!==hd&&(C=a==="right"?`auto ${l}%`:`${l}% auto`);let N={gridTemplateColumns:C};return(0,we.jsxs)("div",{...pr.useBlockProps.save({className:x,style:N}),children:[(0,we.jsx)("figure",{className:"wp-block-media-text__media",style:S,children:(_[n]||ac)()}),(0,we.jsx)("div",{...pr.useInnerBlocksProps.save({className:"wp-block-media-text__content"})})]})},migrate:Lh},Fbe={attributes:{...j4,isStackedOnMobile:{type:"boolean",default:!0},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},mediaLink:{type:"string"},linkDestination:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"figure a",attribute:"target"},href:{type:"string",source:"attribute",selector:"figure a",attribute:"href"},rel:{type:"string",source:"attribute",selector:"figure a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure a",attribute:"class"},verticalAlignment:{type:"string"},imageFill:{type:"boolean"},focalPoint:{type:"object"}},migrate:(0,VE.compose)(hK,Lh),save({attributes:e}){let{backgroundColor:t,customBackgroundColor:r,isStackedOnMobile:a,mediaAlt:n,mediaPosition:i,mediaType:l,mediaUrl:s,mediaWidth:c,mediaId:u,verticalAlignment:m,imageFill:p,focalPoint:d,linkClass:f,href:h,linkTarget:g,rel:b}=e,y=b||void 0,k=(0,we.jsx)("img",{src:s,alt:n,className:u&&l==="image"?`wp-image-${u}`:null});h&&(k=(0,we.jsx)("a",{className:f,href:h,target:g,rel:y,children:k}));let _={image:()=>k,video:()=>(0,we.jsx)("video",{controls:!0,src:s})},x=(0,pr.getColorClassName)("background-color",t),S=w({"has-media-on-the-right":i==="right","has-background":x||r,[x]:x,"is-stacked-on-mobile":a,[`is-vertically-aligned-${m}`]:m,"is-image-fill":p}),C=p?O4(s,d):{},N;return c!==hd&&(N=i==="right"?`auto ${c}%`:`${c}% auto`),(0,we.jsxs)("div",{className:S,style:{backgroundColor:x?void 0:r,gridTemplateColumns:N},children:[(0,we.jsx)("figure",{className:"wp-block-media-text__media",style:C,children:(_[l]||ac)()}),(0,we.jsx)("div",{className:"wp-block-media-text__content",children:(0,we.jsx)(pr.InnerBlocks.Content,{})})]})}},Hbe={attributes:{...j4,backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},mediaUrl:{type:"string",source:"attribute",selector:"figure video,figure img",attribute:"src"},verticalAlignment:{type:"string"},imageFill:{type:"boolean"},focalPoint:{type:"object"}},migrate:(0,VE.compose)(hK,Lh),save({attributes:e}){let{backgroundColor:t,customBackgroundColor:r,isStackedOnMobile:a,mediaAlt:n,mediaPosition:i,mediaType:l,mediaUrl:s,mediaWidth:c,mediaId:u,verticalAlignment:m,imageFill:p,focalPoint:d}=e,f={image:()=>(0,we.jsx)("img",{src:s,alt:n,className:u&&l==="image"?`wp-image-${u}`:null}),video:()=>(0,we.jsx)("video",{controls:!0,src:s})},h=(0,pr.getColorClassName)("background-color",t),g=w({"has-media-on-the-right":i==="right",[h]:h,"is-stacked-on-mobile":a,[`is-vertically-aligned-${m}`]:m,"is-image-fill":p}),b=p?O4(s,d):{},y;return c!==hd&&(y=i==="right"?`auto ${c}%`:`${c}% auto`),(0,we.jsxs)("div",{className:g,style:{backgroundColor:h?void 0:r,gridTemplateColumns:y},children:[(0,we.jsx)("figure",{className:"wp-block-media-text__media",style:b,children:(f[l]||ac)()}),(0,we.jsx)("div",{className:"wp-block-media-text__content",children:(0,we.jsx)(pr.InnerBlocks.Content,{})})]})}},Obe={attributes:{...j4,backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},mediaUrl:{type:"string",source:"attribute",selector:"figure video,figure img",attribute:"src"}},migrate:Lh,save({attributes:e}){let{backgroundColor:t,customBackgroundColor:r,isStackedOnMobile:a,mediaAlt:n,mediaPosition:i,mediaType:l,mediaUrl:s,mediaWidth:c}=e,u={image:()=>(0,we.jsx)("img",{src:s,alt:n}),video:()=>(0,we.jsx)("video",{controls:!0,src:s})},m=(0,pr.getColorClassName)("background-color",t),p=w({"has-media-on-the-right":i==="right",[m]:m,"is-stacked-on-mobile":a}),d;return c!==hd&&(d=i==="right"?`auto ${c}%`:`${c}% auto`),(0,we.jsxs)("div",{className:p,style:{backgroundColor:m?void 0:r,gridTemplateColumns:d},children:[(0,we.jsx)("figure",{className:"wp-block-media-text__media",children:(u[l]||ac)()}),(0,we.jsx)("div",{className:"wp-block-media-text__content",children:(0,we.jsx)(pr.InnerBlocks.Content,{})})]})}},bK=[Abe,Rbe,zbe,Vbe,Fbe,Hbe,Obe];var na=o(P(),1),G4=o(V(),1),W4=o(U(),1),Lo=o(T(),1),Er=o(M(),1),$4=o(Rr(),1);var Cv=o(Q(),1);var Mh=o(M(),1),nc=o(T(),1),_K=o(P(),1),xK=o(me(),1),OE=o(V(),1),jE=o(U(),1),kK=o(Rr(),1),wK=o(xr(),1);function U4(e,t){return e?{objectPosition:t?`${Math.round(t.x*100)}% ${Math.round(t.y*100)}%`:"50% 50%"}:{}}var Ia=o(v(),1),CK=["image","video"],jbe=()=>{},Ube=(0,jE.forwardRef)(({isSelected:e,isStackedOnMobile:t,...r},a)=>{let n=(0,xK.useViewportMatch)("small","<");return(0,Ia.jsx)(Mh.ResizableBox,{ref:a,showHandle:e&&(!n||!t),...r})});function Gbe({mediaId:e,mediaUrl:t,onSelectMedia:r,toggleUseFeaturedImage:a,useFeaturedImage:n}){return(0,Ia.jsx)(nc.BlockControls,{group:"other",children:(0,Ia.jsx)(nc.MediaReplaceFlow,{mediaId:e,mediaURL:t,allowedTypes:CK,onSelect:r,onToggleFeaturedImage:a,useFeaturedImage:n,onReset:()=>r(void 0)})})}function yK({className:e,mediaUrl:t,onSelectMedia:r,toggleUseFeaturedImage:a}){let{createErrorNotice:n}=(0,OE.useDispatch)(wK.store),i=l=>{n(l,{type:"snackbar"})};return(0,Ia.jsx)(nc.MediaPlaceholder,{icon:(0,Ia.jsx)(nc.BlockIcon,{icon:$0}),labels:{title:(0,_K.__)("Media area")},className:e,onSelect:r,onToggleFeaturedImage:a,allowedTypes:CK,onError:i,disableMediaButtons:t})}function Wbe(e,t){let{className:r,commitWidthChange:a,focalPoint:n,imageFill:i,isSelected:l,isStackedOnMobile:s,mediaAlt:c,mediaId:u,mediaPosition:m,mediaType:p,mediaUrl:d,mediaWidth:f,onSelectMedia:h,onWidthChange:g,enableResize:b,toggleUseFeaturedImage:y,useFeaturedImage:k,featuredImageURL:_,featuredImageAlt:x,refMedia:S}=e,C=!u&&(0,kK.isBlobURL)(d),{toggleSelection:N}=(0,OE.useDispatch)(nc.store);if(d||_||k){let B=()=>{N(!1)},D=(I,R,$)=>{g(parseInt($.style.width))},A=(I,R,$)=>{N(!0),a(parseInt($.style.width))},H={right:b&&m==="left",left:b&&m==="right"},F=p==="image"&&i?U4(d||_,n):{},z={image:()=>k&&_?(0,Ia.jsx)("img",{ref:S,src:_,alt:x,style:F}):d&&(0,Ia.jsx)("img",{ref:S,src:d,alt:c,style:F}),video:()=>(0,Ia.jsx)("video",{controls:!0,ref:S,src:d})};return(0,Ia.jsxs)(Ube,{as:"figure",className:w(r,"editor-media-container__resizer",{"is-transient":C}),size:{width:f+"%"},minWidth:"10%",maxWidth:"100%",enable:H,onResizeStart:B,onResize:D,onResizeStop:A,axis:"x",isSelected:l,isStackedOnMobile:s,ref:t,children:[(0,Ia.jsx)(Gbe,{onSelectMedia:h,mediaUrl:k&&_?_:d,mediaId:u,toggleUseFeaturedImage:y,useFeaturedImage:k}),(z[p]||jbe)(),C&&(0,Ia.jsx)(Mh.Spinner,{}),!k&&(0,Ia.jsx)(yK,{...e}),!_&&k&&(0,Ia.jsx)(Mh.Placeholder,{className:"wp-block-media-text--placeholder-image",style:F,withIllustration:!0})]})}return(0,Ia.jsx)(yK,{...e})}var SK=(0,jE.forwardRef)(Wbe);var lt=o(v(),1),{ResolutionTool:$be}=K(Lo.privateApis),TK=e=>Math.max(wv,Math.min(e,100-wv));function PK(e,t){return e?.media_details?.sizes?.[t]?.source_url}function qbe({attributes:{linkDestination:e,href:t},setAttributes:r}){return a=>{if(!a||!a.url){r({mediaAlt:void 0,mediaId:void 0,mediaType:void 0,mediaUrl:void 0,mediaLink:void 0,href:void 0,focalPoint:void 0,useFeaturedImage:!1});return}(0,$4.isBlobURL)(a.url)&&(a.type=(0,$4.getBlobTypeByURL)(a.url));let n,i;a.media_type?a.media_type==="image"?n="image":n="video":n=a.type,n==="image"&&(i=a.sizes?.large?.url||a.media_details?.sizes?.large?.source_url);let l=e,s=t;if(n==="image"){if(!l)switch(window?.wp?.media?.view?.settings?.defaultProps?.link||V4){case"file":case F4:l=F4;break;case"post":case H4:l=H4;break;case V4:default:l=V4;break}switch(l){case F4:s=a.url;break;case H4:s=a.link;break}}r({mediaAlt:a.alt,mediaId:a.id,mediaType:n,mediaUrl:i||a.url,mediaLink:a.link||void 0,href:s,linkDestination:l,focalPoint:void 0,useFeaturedImage:!1})}}function Zbe({image:e,value:t,onChange:r}){let{imageSizes:a}=(0,G4.useSelect)(i=>{let{getSettings:l}=i(Lo.store);return{imageSizes:l().imageSizes}},[]);if(!a?.length)return null;let n=a.filter(({slug:i})=>PK(e,i)).map(({name:i,slug:l})=>({value:l,label:i}));return(0,lt.jsx)($be,{value:t,defaultValue:oc,options:n,onChange:r})}function Kbe({attributes:e,isSelected:t,setAttributes:r,context:{postId:a,postType:n}}){let{focalPoint:i,href:l,imageFill:s,isStackedOnMobile:c,linkClass:u,linkDestination:m,linkTarget:p,mediaAlt:d,mediaId:f,mediaPosition:h,mediaType:g,mediaUrl:b,mediaWidth:y,mediaSizeSlug:k,rel:_,verticalAlignment:x,allowedBlocks:S,useFeaturedImage:C}=e,[N]=(0,Cv.useEntityProp)("postType",n,"featured_media",a),{featuredImageMedia:B}=(0,G4.useSelect)(ie=>({featuredImageMedia:N&&C?ie(Cv.store).getEntityRecord("postType","attachment",N,{context:"view"}):void 0}),[N,C]),{image:D}=(0,G4.useSelect)(ie=>({image:f&&t?ie(Cv.store).getEntityRecord("postType","attachment",f,{context:"view"}):null}),[t,f]),A=C?B?.source_url:"",H=C?B?.alt_text:"",F=()=>{r({imageFill:!1,mediaType:"image",mediaId:void 0,mediaUrl:void 0,mediaAlt:void 0,mediaLink:void 0,linkDestination:void 0,linkTarget:void 0,linkClass:void 0,rel:void 0,href:void 0,useFeaturedImage:!C})},z=(0,W4.useRef)(),I=ie=>{let{style:fe}=z.current,{x:ke,y:je}=ie;fe.objectPosition=`${ke*100}% ${je*100}%`},[R,$]=(0,W4.useState)(null),j=qbe({attributes:e,setAttributes:r}),G=ie=>{r(ie)},O=ie=>{$(TK(ie))},J=ie=>{r({mediaWidth:TK(ie)}),$(null)},ee=w({"has-media-on-the-right":h==="right","is-selected":t,"is-stacked-on-mobile":c,[`is-vertically-aligned-${x}`]:x,"is-image-fill-element":s}),oe=`${R||y}%`,X=h==="right"?`1fr ${oe}`:`${oe} 1fr`,te={gridTemplateColumns:X,msGridColumns:X},ne=ie=>{r({mediaAlt:ie})},le=ie=>{r({verticalAlignment:ie})},pe=ie=>{let fe=PK(D,ie);if(!fe)return null;r({mediaUrl:fe,mediaSizeSlug:ie})},Ie=q(),Ne=(0,lt.jsxs)(Er.__experimentalToolsPanel,{label:(0,na.__)("Settings"),resetAll:()=>{r({isStackedOnMobile:!0,imageFill:!1,mediaAlt:"",focalPoint:void 0,mediaWidth:50}),pe(oc)},dropdownMenuProps:Ie,children:[(0,lt.jsx)(Er.__experimentalToolsPanelItem,{label:(0,na.__)("Media width"),isShownByDefault:!0,hasValue:()=>y!==50,onDeselect:()=>r({mediaWidth:50}),children:(0,lt.jsx)(Er.RangeControl,{__next40pxDefaultSize:!0,label:(0,na.__)("Media width"),value:R||y,onChange:J,min:wv,max:100-wv})}),(0,lt.jsx)(Er.__experimentalToolsPanelItem,{label:(0,na.__)("Stack on mobile"),isShownByDefault:!0,hasValue:()=>!c,onDeselect:()=>r({isStackedOnMobile:!0}),children:(0,lt.jsx)(Er.ToggleControl,{label:(0,na.__)("Stack on mobile"),checked:c,onChange:()=>r({isStackedOnMobile:!c})})}),g==="image"&&(0,lt.jsx)(Er.__experimentalToolsPanelItem,{label:(0,na.__)("Crop image to fill"),isShownByDefault:!0,hasValue:()=>!!s,onDeselect:()=>r({imageFill:!1}),children:(0,lt.jsx)(Er.ToggleControl,{label:(0,na.__)("Crop image to fill"),checked:!!s,onChange:()=>r({imageFill:!s})})}),s&&(b||A)&&g==="image"&&(0,lt.jsx)(Er.__experimentalToolsPanelItem,{label:(0,na.__)("Focal point"),isShownByDefault:!0,hasValue:()=>!!i,onDeselect:()=>r({focalPoint:void 0}),children:(0,lt.jsx)(Er.FocalPointPicker,{label:(0,na.__)("Focal point"),url:C&&A?A:b,value:i,onChange:ie=>r({focalPoint:ie}),onDragStart:I,onDrag:I})}),g==="image"&&b&&!C&&(0,lt.jsx)(Er.__experimentalToolsPanelItem,{label:(0,na.__)("Alternative text"),isShownByDefault:!0,hasValue:()=>!!d,onDeselect:()=>r({mediaAlt:""}),children:(0,lt.jsx)(Er.TextareaControl,{label:(0,na.__)("Alternative text"),value:d,onChange:ne,help:(0,lt.jsxs)(lt.Fragment,{children:[(0,lt.jsx)(Er.ExternalLink,{href:(0,na.__)("https://www.w3.org/WAI/tutorials/images/decision-tree/"),children:(0,na.__)("Describe the purpose of the image.")}),(0,lt.jsx)("br",{}),(0,na.__)("Leave empty if decorative.")]})})}),g==="image"&&!C&&(0,lt.jsx)(Zbe,{image:D,value:k,onChange:pe})]}),ae=(0,Lo.useBlockProps)({className:ee,style:te}),Re=(0,Lo.useInnerBlocksProps)({className:"wp-block-media-text__content"},{template:dK,allowedBlocks:S}),Ee=(0,Lo.useBlockEditingMode)();return(0,lt.jsxs)(lt.Fragment,{children:[(0,lt.jsx)(Lo.InspectorControls,{children:Ne}),(0,lt.jsxs)(Lo.BlockControls,{group:"block",children:[Ee==="default"&&(0,lt.jsxs)(lt.Fragment,{children:[(0,lt.jsx)(Lo.BlockVerticalAlignmentControl,{onChange:le,value:x}),(0,lt.jsx)(Er.ToolbarButton,{icon:PP,title:(0,na.__)("Show media on left"),isActive:h==="left",onClick:()=>r({mediaPosition:"left"})}),(0,lt.jsx)(Er.ToolbarButton,{icon:IP,title:(0,na.__)("Show media on right"),isActive:h==="right",onClick:()=>r({mediaPosition:"right"})})]}),g==="image"&&!C&&(0,lt.jsx)(Lo.__experimentalImageURLInputUI,{url:l||"",onChangeUrl:G,linkDestination:m,mediaType:g,mediaUrl:D&&D.source_url,mediaLink:D&&D.link,linkTarget:p,linkClass:u,rel:_})]}),(0,lt.jsxs)("div",{...ae,children:[h==="right"&&(0,lt.jsx)("div",{...Re}),(0,lt.jsx)(SK,{className:"wp-block-media-text__media",onSelectMedia:j,onWidthChange:O,commitWidthChange:J,refMedia:z,enableResize:Ee==="default",toggleUseFeaturedImage:F,focalPoint:i,imageFill:s,isSelected:t,isStackedOnMobile:c,mediaAlt:d,mediaId:f,mediaPosition:h,mediaType:g,mediaUrl:b,mediaWidth:y,useFeaturedImage:C,featuredImageURL:A,featuredImageAlt:H}),h!=="right"&&(0,lt.jsx)("div",{...Re})]})]})}var BK=Kbe;var q4={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/media-text",title:"Media & Text",category:"media",description:"Set media and words side-by-side for a richer layout.",keywords:["image","video"],textdomain:"default",attributes:{align:{type:"string",default:"none"},mediaAlt:{type:"string",source:"attribute",selector:"figure img",attribute:"alt",default:"",role:"content"},mediaPosition:{type:"string",default:"left"},mediaId:{type:"number",role:"content"},mediaUrl:{type:"string",source:"attribute",selector:"figure video,figure img",attribute:"src",role:"content"},mediaLink:{type:"string"},linkDestination:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"figure a",attribute:"target"},href:{type:"string",source:"attribute",selector:"figure a",attribute:"href",role:"content"},rel:{type:"string",source:"attribute",selector:"figure a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure a",attribute:"class"},mediaType:{type:"string",role:"content"},mediaWidth:{type:"number",default:50},mediaSizeSlug:{type:"string"},isStackedOnMobile:{type:"boolean",default:!0},verticalAlignment:{type:"string"},imageFill:{type:"boolean"},focalPoint:{type:"object"},useFeaturedImage:{type:"boolean",default:!1}},usesContext:["postId","postType"],supports:{anchor:!0,align:["wide","full"],html:!1,__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,radius:!0,style:!0,width:!0}},color:{gradients:!0,heading:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},allowedBlocks:!0},editorStyle:"wp-block-media-text-editor",style:"wp-block-media-text"};var Ah=o(T(),1);var ns=o(v(),1),Ybe=50,IK=()=>{};function NK({attributes:e}){let{isStackedOnMobile:t,mediaAlt:r,mediaPosition:a,mediaType:n,mediaUrl:i,mediaWidth:l,mediaId:s,verticalAlignment:c,imageFill:u,focalPoint:m,linkClass:p,href:d,linkTarget:f,rel:h}=e,g=e.mediaSizeSlug||oc,b=h||void 0,y=w({[`wp-image-${s}`]:s&&n==="image",[`size-${g}`]:s&&n==="image"}),k=u?U4(i,m):{},_=i?(0,ns.jsx)("img",{src:i,alt:r,className:y||null,style:k}):null;d&&(_=(0,ns.jsx)("a",{className:p,href:d,target:f,rel:b,children:_}));let x={image:()=>_,video:()=>(0,ns.jsx)("video",{controls:!0,src:i})},S=w({"has-media-on-the-right":a==="right","is-stacked-on-mobile":t,[`is-vertically-aligned-${c}`]:c,"is-image-fill-element":u}),C;l!==Ybe&&(C=a==="right"?`auto ${l}%`:`${l}% auto`);let N={gridTemplateColumns:C};return a==="right"?(0,ns.jsxs)("div",{...Ah.useBlockProps.save({className:S,style:N}),children:[(0,ns.jsx)("div",{...Ah.useInnerBlocksProps.save({className:"wp-block-media-text__content"})}),(0,ns.jsx)("figure",{className:"wp-block-media-text__media",children:(x[n]||IK)()})]}):(0,ns.jsxs)("div",{...Ah.useBlockProps.save({className:S,style:N}),children:[(0,ns.jsx)("figure",{className:"wp-block-media-text__media",children:(x[n]||IK)()}),(0,ns.jsx)("div",{...Ah.useInnerBlocksProps.save({className:"wp-block-media-text__content"})})]})}var gd=o(W(),1),Xbe={from:[{type:"block",blocks:["core/image"],transform:({alt:e,url:t,id:r,anchor:a})=>(0,gd.createBlock)("core/media-text",{mediaAlt:e,mediaId:r,mediaUrl:t,mediaType:"image",anchor:a})},{type:"block",blocks:["core/video"],transform:({src:e,id:t,anchor:r})=>(0,gd.createBlock)("core/media-text",{mediaId:t,mediaUrl:e,mediaType:"video",anchor:r})},{type:"block",blocks:["core/cover"],transform:({align:e,alt:t,anchor:r,backgroundType:a,customGradient:n,customOverlayColor:i,gradient:l,id:s,overlayColor:c,style:u,textColor:m,url:p,useFeaturedImage:d},f)=>{let h={};return n?h={style:{color:{gradient:n}}}:i&&(h={style:{color:{background:i}}}),u?.color?.text&&(h.style={color:{...h.style?.color,text:u.color.text}}),(0,gd.createBlock)("core/media-text",{align:e,anchor:r,backgroundColor:c,gradient:l,mediaAlt:t,mediaId:s,mediaType:a,mediaUrl:p,textColor:m,useFeaturedImage:d,...h},f)}}],to:[{type:"block",blocks:["core/image"],isMatch:({mediaType:e,mediaUrl:t})=>!t||e==="image",transform:({mediaAlt:e,mediaId:t,mediaUrl:r,anchor:a})=>(0,gd.createBlock)("core/image",{alt:e,id:t,url:r,anchor:a})},{type:"block",blocks:["core/video"],isMatch:({mediaType:e,mediaUrl:t})=>!t||e==="video",transform:({mediaId:e,mediaUrl:t,anchor:r})=>(0,gd.createBlock)("core/video",{id:e,src:t,anchor:r})},{type:"block",blocks:["core/cover"],transform:({align:e,anchor:t,backgroundColor:r,focalPoint:a,gradient:n,mediaAlt:i,mediaId:l,mediaType:s,mediaUrl:c,style:u,textColor:m,useFeaturedImage:p},d)=>{let f={};u?.color?.gradient?f.customGradient=u.color.gradient:u?.color?.background&&(f.customOverlayColor=u.color.background),u?.color?.text&&(f.style={color:{text:u.color.text}});let h={align:e,alt:i,anchor:t,backgroundType:s,dimRatio:c||p?50:100,focalPoint:a,gradient:n,id:l,overlayColor:r,textColor:m,url:c,useFeaturedImage:p,...f};return(0,gd.createBlock)("core/cover",h,d)}}]},EK=Xbe;var{fieldsKey:Jbe,formKey:eye}=K(DK.privateApis),{name:LK}=q4,Z4={icon:ET,example:{viewportWidth:601,attributes:{mediaType:"image",mediaUrl:"https://s.w.org/images/core/5.3/Biologia_Centrali-Americana_-_Cantorchilus_semibadius_1902.jpg"},innerBlocks:[{name:"core/paragraph",attributes:{content:(0,Sv.__)("The wren<br>Earns his living<br>Noiselessly.")}},{name:"core/paragraph",attributes:{content:(0,Sv.__)("\u2014 Kobayashi Issa (\u4E00\u8336)")}}]},transforms:EK,edit:BK,save:NK,deprecated:bK};window.__experimentalContentOnlyInspectorFields&&(Z4[Jbe]=[{id:"media",label:(0,Sv.__)("Media"),type:"media",Edit:{control:"media",allowedTypes:["image","video"],multiple:!1},getValue:({item:e})=>({id:e.mediaId,url:e.mediaUrl,mediaType:e.mediaType,link:e.mediaLink}),setValue:({value:e})=>({mediaId:e.id,mediaUrl:e.url,mediaType:e.mediaType,mediaLink:e.link})},{id:"link",label:(0,Sv.__)("Link"),type:"url",Edit:"link",getValue:({item:e})=>({url:e.href,rel:e.rel,linkTarget:e.linkTarget}),setValue:({value:e})=>({href:e.url,rel:e.rel,linkTarget:e.linkTarget})}],Z4[eye]={fields:["media","link"]});var tye=()=>E({name:LK,metadata:q4,settings:Z4});var GE={};Z(GE,{init:()=>oye,metadata:()=>Q4,name:()=>Tv,settings:()=>UK});var jK=o(W(),1);var su=o(P(),1),MK=o(U(),1),AK=o(M(),1),RK=o(W(),1),K4=o(V(),1),vd=o(T(),1),zK=o(ai(),1),Rh=o(v(),1);function VK({attributes:e,clientId:t}){let{originalName:r,originalUndelimitedContent:a}=e,n=!!a,{hasFreeformBlock:i,hasHTMLBlock:l}=(0,K4.useSelect)(d=>{let{canInsertBlockType:f,getBlockRootClientId:h}=d(vd.store);return{hasFreeformBlock:f("core/freeform",h(t)),hasHTMLBlock:f("core/html",h(t))}},[t]),{replaceBlock:s}=(0,K4.useDispatch)(vd.store);function c(){s(t,(0,RK.createBlock)("core/html",{content:a}))}let u=[],m,p=(0,Rh.jsx)(AK.Button,{__next40pxDefaultSize:!0,onClick:c,variant:"primary",children:(0,su.__)("Keep as HTML")},"convert");return n&&!i&&(!r||r==="core/freeform")?l?(m=(0,su.__)("It appears you are trying to use the deprecated Classic block. You can leave this block intact, convert its content to a Custom HTML block, or remove it entirely. Alternatively, if you have unsaved changes, you can save them and refresh to use the Classic block."),u.push(p)):m=(0,su.__)("It appears you are trying to use the deprecated Classic block. You can leave this block intact, or remove it entirely. Alternatively, if you have unsaved changes, you can save them and refresh to use the Classic block."):n&&l?(m=(0,su.sprintf)((0,su.__)('Your site doesn\u2019t include support for the "%s" block. You can leave it as-is, convert it to custom HTML, or remove it.'),r),u.push(p)):m=(0,su.sprintf)((0,su.__)('Your site doesn\u2019t include support for the "%s" block. You can leave it as-is or remove it.'),r),(0,Rh.jsxs)("div",{...(0,vd.useBlockProps)({className:"has-warning"}),children:[(0,Rh.jsx)(vd.Warning,{actions:u,children:m}),(0,Rh.jsx)(MK.RawHTML,{children:(0,zK.safeHTML)(a)})]})}var Q4={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/missing",title:"Unsupported",category:"text",description:"Your site doesn\u2019t include support for this block.",textdomain:"default",attributes:{originalName:{type:"string"},originalUndelimitedContent:{type:"string"},originalContent:{type:"string",source:"raw"}},supports:{className:!1,customClassName:!1,inserter:!1,html:!1,lock:!1,reusable:!1,renaming:!1,visibility:!1,interactivity:{clientNavigation:!0},customCSS:!1}};var FK=o(U(),1),HK=o(v(),1);function OK({attributes:e}){return(0,HK.jsx)(FK.RawHTML,{children:e.originalContent})}var{name:Tv}=Q4,UK={name:Tv,__experimentalLabel(e,{context:t}){if(t==="accessibility"){let{originalName:r}=e,a=r?(0,jK.getBlockType)(r):void 0;return a?a.settings.title||r:""}},edit:VK,save:OK},oye=()=>E({name:Tv,metadata:Q4,settings:UK});var WE={};Z(WE,{init:()=>cye,metadata:()=>X4,name:()=>XK,settings:()=>J4});var QK=o(P(),1),YK=o(W(),1);var Cm=o(P(),1),zh=o(M(),1),Vh=o(T(),1),Y4=o(W(),1);var is=o(v(),1),aye=(0,Cm.__)("Read more");function GK({attributes:{customText:e,noTeaser:t},insertBlocksAfter:r,setAttributes:a}){let n=q();return(0,is.jsxs)(is.Fragment,{children:[(0,is.jsx)(Vh.InspectorControls,{children:(0,is.jsx)(zh.__experimentalToolsPanel,{label:(0,Cm.__)("Settings"),resetAll:()=>{a({noTeaser:!1})},dropdownMenuProps:n,children:(0,is.jsx)(zh.__experimentalToolsPanelItem,{label:(0,Cm.__)("Hide excerpt"),isShownByDefault:!0,hasValue:()=>t,onDeselect:()=>a({noTeaser:!1}),children:(0,is.jsx)(zh.ToggleControl,{label:(0,Cm.__)("Hide the excerpt on the full content page"),checked:!!t,onChange:()=>a({noTeaser:!t}),help:i=>i?(0,Cm.__)("The excerpt is hidden."):(0,Cm.__)("The excerpt is visible.")})})})}),(0,is.jsx)("div",{...(0,Vh.useBlockProps)(),children:(0,is.jsx)(Vh.PlainText,{__experimentalVersion:2,tagName:"span","aria-label":(0,Cm.__)('"Read more" text'),value:e,placeholder:aye,onChange:i=>a({customText:i}),disableLineBreaks:!0,__unstableOnSplitAtEnd:()=>r((0,Y4.createBlock)((0,Y4.getDefaultBlockName)()))})})]})}var X4={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/more",title:"More",category:"design",description:"Content before this block will be shown in the excerpt on your archives page.",keywords:["read more"],textdomain:"default",attributes:{customText:{type:"string",default:"",role:"content"},noTeaser:{type:"boolean",default:!1}},supports:{customClassName:!1,className:!1,html:!1,multiple:!1,visibility:!1,interactivity:{clientNavigation:!0},customCSS:!1},editorStyle:"wp-block-more-editor"};var WK=o(U(),1),$K=o(v(),1);function qK({attributes:{customText:e,noTeaser:t}}){let r=e?`<!--more ${e}-->`:"<!--more-->";return(0,$K.jsx)(WK.RawHTML,{children:[r,t?"<!--noteaser-->":""].filter(Boolean).join(` `)})}var ZK=o(W(),1),iye={from:[{type:"raw",schema:{"wp-block":{attributes:["data-block"]}},isMatch:e=>e.dataset&&e.dataset.block==="core/more",transform(e){let{customText:t,noTeaser:r}=e.dataset,a={};return t&&(a.customText=t),r===""&&(a.noTeaser=!0),(0,ZK.createBlock)("core/more",a)}}]},KK=iye;var{fieldsKey:lye,formKey:sye}=K(YK.privateApis),{name:XK}=X4,J4={icon:RT,example:{},__experimentalLabel(e,{context:t}){let r=e?.metadata?.name;if((t==="list-view"||t==="breadcrumb")&&r)return r;if(t==="accessibility")return e.customText},transforms:KK,edit:GK,save:qK};window.__experimentalContentOnlyInspectorFields&&(J4[lye]=[{id:"customText",label:(0,QK.__)("Content"),type:"text",Edit:"rich-text"}],J4[sye]={fields:["customText"]});var cye=()=>E({name:XK,metadata:X4,settings:J4});var TD={};Z(TD,{init:()=>p_e,metadata:()=>e3,name:()=>kX,settings:()=>wX});var $3=o(P(),1);var yX=o(V(),1),_X=o(Q(),1),xX=o(Wo(),1);var e3={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/navigation",title:"Navigation",category:"theme",allowedBlocks:["core/navigation-link","core/search","core/social-links","core/page-list","core/spacer","core/home-link","core/icon","core/site-title","core/site-logo","core/navigation-submenu","core/loginout","core/buttons"],description:"A collection of blocks that allow visitors to get around your site.",keywords:["menu","navigation","links"],textdomain:"default",attributes:{ref:{type:"number"},textColor:{type:"string"},customTextColor:{type:"string"},rgbTextColor:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},rgbBackgroundColor:{type:"string"},showSubmenuIcon:{type:"boolean",default:!0},submenuVisibility:{type:"string",enum:["hover","click","always"],default:"hover"},overlayMenu:{type:"string",default:"mobile"},overlay:{type:"string"},icon:{type:"string",default:"handle"},hasIcon:{type:"boolean",default:!0},__unstableLocation:{type:"string"},overlayBackgroundColor:{type:"string"},customOverlayBackgroundColor:{type:"string"},overlayTextColor:{type:"string"},customOverlayTextColor:{type:"string"},maxNestingLevel:{type:"number",default:5},templateLock:{type:["string","boolean"],enum:["all","insert","contentOnly",!1]}},providesContext:{textColor:"textColor",customTextColor:"customTextColor",backgroundColor:"backgroundColor",customBackgroundColor:"customBackgroundColor",overlayTextColor:"overlayTextColor",customOverlayTextColor:"customOverlayTextColor",overlayBackgroundColor:"overlayBackgroundColor",customOverlayBackgroundColor:"customOverlayBackgroundColor",fontSize:"fontSize",customFontSize:"customFontSize",showSubmenuIcon:"showSubmenuIcon",submenuVisibility:"submenuVisibility",openSubmenusOnClick:"openSubmenusOnClick",style:"style",maxNestingLevel:"maxNestingLevel"},supports:{anchor:!0,align:["wide","full"],ariaLabel:!0,contentRole:!0,html:!1,inserter:!0,typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalTextTransform:!0,__experimentalFontFamily:!0,__experimentalLetterSpacing:!0,__experimentalTextDecoration:!0,__experimentalSkipSerialization:["textDecoration"],__experimentalDefaultControls:{fontSize:!0}},spacing:{blockGap:!0,units:["px","em","rem","vh","vw"],__experimentalDefaultControls:{blockGap:!0}},layout:{allowSwitching:!1,allowInheriting:!1,allowVerticalAlignment:!1,allowSizingOnChildren:!0,default:{type:"flex"}},interactivity:!0,renaming:!1},editorStyle:"wp-block-navigation-editor",style:"wp-block-navigation"};var $t=o(U(),1),tt=o(T(),1),Td=o(Q(),1),ss=o(V(),1),Hr=o(M(),1),It=o(P(),1),U3=o(bv(),1);var pX=o(W(),1),dX=o(me(),1);var Fh=o(Q(),1),tQ=o(V(),1);var Pi={name:"core/navigation-link",attributes:{kind:"post-type",type:"page"}},JK=["core/navigation-link/page","core/navigation-link"],$E={per_page:100,status:["publish","draft"],order:"desc",orderby:"date"},eQ=["postType","wp_navigation",$E],ic="navigation-overlay";function Hh(e){let t=(0,Fh.useResourcePermissions)({kind:"postType",name:"wp_navigation",id:e}),{navigationMenu:r,isNavigationMenuResolved:a,isNavigationMenuMissing:n}=(0,tQ.useSelect)(h=>mye(h,e),[e]),{canCreate:i,canUpdate:l,canDelete:s,isResolving:c,hasResolved:u}=t,{records:m,isResolving:p,hasResolved:d}=(0,Fh.useEntityRecords)("postType","wp_navigation",$E),f=e?m?.length>1:m?.length>0;return{navigationMenu:r,isNavigationMenuResolved:a,isNavigationMenuMissing:n,navigationMenus:m,isResolvingNavigationMenus:p,hasResolvedNavigationMenus:d,canSwitchNavigationMenu:f,canUserCreateNavigationMenus:i,isResolvingCanUserCreateNavigationMenus:c,hasResolvedCanUserCreateNavigationMenus:u,canUserUpdateNavigationMenu:l,hasResolvedCanUserUpdateNavigationMenu:e?u:void 0,canUserDeleteNavigationMenu:s,hasResolvedCanUserDeleteNavigationMenu:e?u:void 0}}function mye(e,t){if(!t)return{isNavigationMenuResolved:!1,isNavigationMenuMissing:!0};let{getEntityRecord:r,getEditedEntityRecord:a,hasFinishedResolution:n}=e(Fh.store),i=["postType","wp_navigation",t],l=r(...i),s=a(...i),c=n("getEditedEntityRecord",i),u=s.status==="publish"||s.status==="draft";return{isNavigationMenuResolved:c,isNavigationMenuMissing:c&&(!l||!u),navigationMenu:u?s:null}}var t3=o(Q(),1);function Oh(e){let{records:t,isResolving:r,hasResolved:a}=(0,t3.useEntityRecords)("root","menu",{per_page:-1,context:"view"}),{records:n,isResolving:i,hasResolved:l}=(0,t3.useEntityRecords)("postType","page",{parent:0,order:"asc",orderby:"id",per_page:-1,context:"view"}),{records:s,hasResolved:c}=(0,t3.useEntityRecords)("root","menuItem",{menus:e,per_page:-1,context:"view"},{enabled:!!e});return{pages:n,isResolvingPages:i,hasResolvedPages:l,hasPages:!!(l&&n?.length),menus:t,isResolvingMenus:r,hasResolvedMenus:a,hasMenus:!!(a&&t?.length),menuItems:s,hasResolvedMenuItems:c}}var Uh=o(M(),1),Iv=o(P(),1);var qE=o(bv(),1),aQ=o(U(),1);var rQ=o(P(),1),Pv=o(v(),1),pye=({isVisible:e=!0})=>(0,Pv.jsx)("div",{"aria-hidden":e?void 0:!0,className:"wp-block-navigation-placeholder__preview",children:(0,Pv.jsxs)("div",{className:"wp-block-navigation-placeholder__actions__indicator",children:[(0,Pv.jsx)(Wa,{icon:Tp}),(0,rQ.__)("Navigation")]})}),r3=pye;var ls=o(M(),1);var an=o(P(),1),o3=o(Wo(),1),jh=o(U(),1),oQ=o(Q(),1);var cl=o(v(),1);function dye(e,t,r){return e?r==="publish"?(0,o3.decodeEntities)(e):(0,an.sprintf)((0,an.__)("%1$s (%2$s)"),(0,o3.decodeEntities)(e),r):(0,an.sprintf)((0,an.__)("(no title %s)"),t)}function fye({currentMenuId:e,onSelectNavigationMenu:t,onSelectClassicMenu:r,onCreateNew:a,actionLabel:n,createNavigationMenuIsSuccess:i,createNavigationMenuIsError:l}){let s=(0,an.__)("Create from '%s'"),[c,u]=(0,jh.useState)(!1);n=n||s;let{menus:m}=Oh(),{navigationMenus:p,isResolvingNavigationMenus:d,hasResolvedNavigationMenus:f,canUserCreateNavigationMenus:h,canSwitchNavigationMenu:g,isNavigationMenuMissing:b}=Hh(e),[y]=(0,oQ.useEntityProp)("postType","wp_navigation","title",e),k=(0,jh.useMemo)(()=>p?.map(({id:z,title:I,status:R},$)=>{let j=dye(I?.rendered,$+1,R);return{value:z,label:j,ariaLabel:(0,an.sprintf)(n,j),disabled:c||d||!f}})||[],[p,n,d,f,c]),_=!!p?.length,x=!!m?.length,S=!!g,C=!!h,N=_&&!e,B=!_&&f,D=f&&e===null,A=e&&b,H="";return d?H=(0,an.__)("Loading\u2026"):N||B||D||A?H=(0,an.__)("Choose or create a Navigation Menu"):H=y,(0,jh.useEffect)(()=>{c&&(i||l)&&u(!1)},[f,i,h,l,c,D,B,N]),(0,cl.jsx)(ls.DropdownMenu,{label:H,icon:q0,toggleProps:{size:"small"},children:({onClose:z})=>(0,cl.jsxs)(cl.Fragment,{children:[S&&_&&(0,cl.jsx)(ls.MenuGroup,{label:(0,an.__)("Menus"),children:(0,cl.jsx)(ls.MenuItemsChoice,{value:e,onSelect:I=>{t(I),z()},choices:k})}),C&&x&&(0,cl.jsx)(ls.MenuGroup,{label:(0,an.__)("Import Classic Menus"),children:m?.map(I=>{let R=(0,o3.decodeEntities)(I.name);return(0,cl.jsx)(ls.MenuItem,{onClick:async()=>{u(!0),await r(I),u(!1),z()},"aria-label":(0,an.sprintf)(s,R),disabled:c||d||!f,children:R},I.id)})}),h&&(0,cl.jsx)(ls.MenuGroup,{label:(0,an.__)("Tools"),children:(0,cl.jsx)(ls.MenuItem,{onClick:async()=>{u(!0),await a(),u(!1),z()},disabled:c||d||!f,children:(0,an.__)("Create new Menu")})})]})})}var Bv=fye;var Na=o(v(),1);function nQ({isSelected:e,currentMenuId:t,clientId:r,canUserCreateNavigationMenus:a=!1,isResolvingCanUserCreateNavigationMenus:n,onSelectNavigationMenu:i,onSelectClassicMenu:l,onCreateEmpty:s}){let{isResolvingMenus:c,hasResolvedMenus:u}=Oh();(0,aQ.useEffect)(()=>{e&&(c&&(0,qE.speak)((0,Iv.__)("Loading navigation block setup options\u2026")),u&&(0,qE.speak)((0,Iv.__)("Navigation block setup options ready.")))},[u,c,e]);let m=c&&n;return(0,Na.jsx)(Na.Fragment,{children:(0,Na.jsxs)(Uh.Placeholder,{className:"wp-block-navigation-placeholder",children:[(0,Na.jsx)(r3,{isVisible:!e}),(0,Na.jsx)("div",{"aria-hidden":e?void 0:!0,className:"wp-block-navigation-placeholder__controls",children:(0,Na.jsxs)("div",{className:"wp-block-navigation-placeholder__actions",children:[(0,Na.jsxs)("div",{className:"wp-block-navigation-placeholder__actions__indicator",children:[(0,Na.jsx)(Wa,{icon:Tp})," ",(0,Iv.__)("Navigation")]}),(0,Na.jsx)("hr",{}),m&&(0,Na.jsx)(Uh.Spinner,{}),(0,Na.jsx)(Bv,{currentMenuId:t,clientId:r,onSelectNavigationMenu:i,onSelectClassicMenu:l}),(0,Na.jsx)("hr",{}),a&&(0,Na.jsx)(Uh.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:s,children:(0,Iv.__)("Start empty")})]})})]})})}var ZE=o(M(),1),Wh=o(P(),1),KE=o(T(),1),iQ=o(V(),1),lQ=o(Q(),1);var Nv=o(L(),1);var Gh=o(v(),1);function lc({icon:e}){return e==="menu"?(0,Gh.jsx)(Wa,{icon:LT}):(0,Gh.jsxs)(Nv.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true",focusable:"false",children:[(0,Gh.jsx)(Nv.Rect,{x:"4",y:"7.5",width:"16",height:"1.5"}),(0,Gh.jsx)(Nv.Rect,{x:"4",y:"15",width:"16",height:"1.5"})]})}function nn(e,t){return e&&t?e+"//"+t:null}var Bi=o(v(),1);function QE({children:e,id:t,isOpen:r,isResponsive:a,onToggle:n,isHiddenByDefault:i,overlayBackgroundColor:l,overlayTextColor:s,hasIcon:c,icon:u,overlay:m,onNavigateToEntityRecord:p}){let d=(0,iQ.useSelect)(x=>x(lQ.store).getCurrentTheme()?.stylesheet,[]);if(!a)return e;let f=!!m,h=w("wp-block-navigation__responsive-container",!f&&{"has-text-color":!!s.color||!!s?.class,[(0,KE.getColorClassName)("color",s?.slug)]:!!s?.slug,"has-background":!!l.color||l?.class,[(0,KE.getColorClassName)("background-color",l?.slug)]:!!l?.slug},{"is-menu-open":r,"hidden-by-default":i}),g=f?{}:{color:!s?.slug&&s?.color,backgroundColor:!l?.slug&&l?.color&&l.color},b=w("wp-block-navigation__responsive-container-open",{"always-shown":i}),y=`${t}-modal`,k={className:"wp-block-navigation__responsive-dialog",...r&&{role:"dialog","aria-modal":!0,"aria-label":(0,Wh.__)("Menu")}},_=()=>{if(m&&p){let x=nn(d,m);p({postId:x,postType:"wp_template_part"});return}n(!0)};return(0,Bi.jsxs)(Bi.Fragment,{children:[!r&&(0,Bi.jsxs)(ZE.Button,{__next40pxDefaultSize:!0,"aria-haspopup":"true","aria-label":c&&(0,Wh.__)("Open menu"),className:b,onClick:_,children:[c&&(0,Bi.jsx)(lc,{icon:u}),!c&&(0,Wh.__)("Menu")]}),(0,Bi.jsx)("div",{className:h,style:g,id:y,children:(0,Bi.jsx)("div",{className:"wp-block-navigation__responsive-close",tabIndex:"-1",children:(0,Bi.jsxs)("div",{...k,children:[(0,Bi.jsxs)(ZE.Button,{__next40pxDefaultSize:!0,className:"wp-block-navigation__responsive-container-close","aria-label":c&&(0,Wh.__)("Close menu"),onClick:()=>n(!1),children:[c&&(0,Bi.jsx)(Wa,{icon:yp}),!c&&(0,Wh.__)("Close")]}),(0,Bi.jsx)("div",{className:"wp-block-navigation__responsive-container-content",id:`${y}-content`,children:e})]})})})]})}var sQ=o(Q(),1),$h=o(T(),1),cQ=o(V(),1),uQ=o(U(),1);var YE=o(v(),1);function mQ({clientId:e,hasCustomPlaceholder:t,orientation:r,templateLock:a}){let{isImmediateParentOfSelectedBlock:n,selectedBlockHasChildren:i,isSelected:l,hasSelectedDescendant:s}=(0,cQ.useSelect)(b=>{let{getBlockCount:y,hasSelectedInnerBlock:k,getSelectedBlockClientId:_}=b($h.store),x=_();return{isImmediateParentOfSelectedBlock:k(e,!1),selectedBlockHasChildren:!!y(x),hasSelectedDescendant:k(e,!0),isSelected:x===e}},[e]),[c,u,m]=(0,sQ.useEntityBlockEditor)("postType","wp_navigation"),p=l||n&&!i,d=(0,uQ.useMemo)(()=>(0,YE.jsx)(r3,{}),[]),f=!!c?.length,h=!t&&!f&&!l,g=(0,$h.useInnerBlocksProps)({className:"wp-block-navigation__container"},{value:c,onInput:u,onChange:m,prioritizedInserterBlocks:JK,defaultBlock:Pi,directInsert:!0,orientation:r,templateLock:a,renderAppender:l||n&&!i||s||p?$h.InnerBlocks.ButtonBlockAppender:!1,placeholder:h?d:void 0,__experimentalCaptureToolbars:!0,__unstableDisableLayoutClassNames:!0});return(0,YE.jsx)("div",{...g})}var pQ=o(M(),1),dQ=o(Q(),1),fQ=o(P(),1),hQ=o(v(),1);function gQ(){let[e,t]=(0,dQ.useEntityProp)("postType","wp_navigation","title");return(0,hQ.jsx)(pQ.TextControl,{__next40pxDefaultSize:!0,label:(0,fQ.__)("Menu name"),value:e,onChange:t})}var yQ=o(T(),1),XE=o(M(),1),_Q=o(Q(),1),xQ=o(V(),1),bd=o(U(),1);function vQ(e,t){return!bQ(e,t,(r,a)=>{if(a?.name==="core/page-list"&&r==="innerBlocks")return!0})}var bQ=(e,t,r)=>{if(e===t)return!0;if(typeof e=="object"&&e!==null&&e!==void 0&&typeof t=="object"&&t!==null&&t!==void 0){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let a in e)if(t.hasOwnProperty(a)){if(r&&r(a,e))return!0;if(!bQ(e[a],t[a],r))return!1}else return!1;return!0}return!1};var kQ=o(v(),1),hye={};function wQ({blocks:e,createNavigationMenu:t,hasSelection:r}){let a=(0,bd.useRef)();(0,bd.useEffect)(()=>{a?.current||(a.current=e)},[e]);let n=vQ(a?.current,e),i=(0,bd.useContext)(XE.Disabled.Context),l=(0,yQ.useInnerBlocksProps)({className:"wp-block-navigation__container"},{renderAppender:r?void 0:!1,defaultBlock:Pi,directInsert:!0}),{isSaving:s,hasResolvedAllNavigationMenus:c}=(0,xQ.useSelect)(m=>{if(i)return hye;let{hasFinishedResolution:p,isSavingEntityRecord:d}=m(_Q.store);return{isSaving:d("postType","wp_navigation"),hasResolvedAllNavigationMenus:p("getEntityRecords",eQ)}},[i]);return(0,bd.useEffect)(()=>{i||s||!c||!r||!n||t(null,e)},[e,t,i,s,c,n,r]),(0,kQ.jsx)(s?XE.Disabled:"div",{...l})}var n3=o(M(),1),i3=o(Q(),1),CQ=o(V(),1),SQ=o(U(),1),a3=o(P(),1),yd=o(v(),1);function TQ({onDelete:e}){let[t,r]=(0,SQ.useState)(!1),a=(0,i3.useEntityId)("postType","wp_navigation"),{deleteEntityRecord:n}=(0,CQ.useDispatch)(i3.store);return(0,yd.jsxs)(yd.Fragment,{children:[(0,yd.jsx)(n3.Button,{__next40pxDefaultSize:!0,className:"wp-block-navigation-delete-menu-button",variant:"secondary",isDestructive:!0,onClick:()=>{r(!0)},children:(0,a3.__)("Delete menu")}),t&&(0,yd.jsx)(n3.__experimentalConfirmDialog,{isOpen:!0,onConfirm:()=>{n("postType","wp_navigation",a,{force:!0}),e()},onCancel:()=>{r(!1)},confirmButtonText:(0,a3.__)("Delete"),size:"medium",children:(0,a3.__)("Are you sure you want to delete this Navigation Menu?")})]})}var Ev=o(U(),1),PQ=o(V(),1),BQ=o(xr(),1);function gye({name:e,message:t=""}={}){let r=(0,Ev.useRef)(),{createWarningNotice:a,removeNotice:n}=(0,PQ.useDispatch)(BQ.store),i=(0,Ev.useCallback)(s=>{r.current||(r.current=e,a(s||t,{id:r.current,type:"snackbar"}))},[r,a,t,e]),l=(0,Ev.useCallback)(()=>{r.current&&(n(r.current),r.current=null)},[r,n]);return[i,l]}var l3=gye;var sc=o(M(),1),Sm=o(P(),1);var Ii=o(v(),1);function IQ({setAttributes:e,hasIcon:t,icon:r}){return(0,Ii.jsxs)(Ii.Fragment,{children:[(0,Ii.jsx)(sc.__experimentalToolsPanelItem,{label:(0,Sm.__)("Show icon button"),isShownByDefault:!0,hasValue:()=>!t,onDeselect:()=>e({hasIcon:!0}),children:(0,Ii.jsx)(sc.ToggleControl,{label:(0,Sm.__)("Show icon button"),help:(0,Sm.__)("Configure the visual appearance of the button that toggles the overlay menu."),onChange:a=>e({hasIcon:a}),checked:t})}),(0,Ii.jsx)(sc.__experimentalToolsPanelItem,{label:(0,Sm.__)("Icon"),isShownByDefault:!0,hasValue:()=>r!=="handle",onDeselect:()=>e({icon:"handle"}),children:(0,Ii.jsxs)(sc.__experimentalToggleGroupControl,{__next40pxDefaultSize:!0,className:"wp-block-navigation__overlay-menu-icon-toggle-group",label:(0,Sm.__)("Icon"),value:r,onChange:a=>e({icon:a}),isBlock:!0,children:[(0,Ii.jsx)(sc.__experimentalToggleGroupControlOption,{value:"handle","aria-label":(0,Sm.__)("handle"),label:(0,Ii.jsx)(lc,{icon:"handle"})}),(0,Ii.jsx)(sc.__experimentalToggleGroupControlOption,{value:"menu","aria-label":(0,Sm.__)("menu"),label:(0,Ii.jsx)(lc,{icon:"menu"})})]})})]})}var v3=o(M(),1),rY=o(P(),1),oY=o(U(),1);var ul=o(U(),1),WQ=o(me(),1),d3=o(Q(),1),f3=o(V(),1),ln=o(M(),1),ia=o(P(),1),tD=o(Wo(),1),$Q=o(xr(),1);var zQ=o(U(),1),m3=o(V(),1),VQ=o(Q(),1),FQ=o(T(),1),HQ=o(P(),1),xd=o(W(),1);var Tm=function(){return Tm=Object.assign||function(t){for(var r,a=1,n=arguments.length;a<n;a++){r=arguments[a];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},Tm.apply(this,arguments)};function NQ(e){return e.toLowerCase()}var vye=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],bye=/[^A-Z0-9]+/gi;function s3(e,t){t===void 0&&(t={});for(var r=t.splitRegexp,a=r===void 0?vye:r,n=t.stripRegexp,i=n===void 0?bye:n,l=t.transform,s=l===void 0?NQ:l,c=t.delimiter,u=c===void 0?" ":c,m=EQ(EQ(e,a,"$1\0$2"),i,"\0"),p=0,d=m.length;m.charAt(p)==="\0";)p++;for(;m.charAt(d-1)==="\0";)d--;return m.slice(p,d).split("\0").map(s).join(u)}function EQ(e,t,r){return t instanceof RegExp?e.replace(t,r):t.reduce(function(a,n){return a.replace(n,r)},e)}function DQ(e){return e.charAt(0).toUpperCase()+e.substr(1)}function yye(e){return DQ(e.toLowerCase())}function LQ(e,t){return t===void 0&&(t={}),s3(e,Tm({delimiter:" ",transform:yye},t))}function MQ(e,t){return t===void 0&&(t={}),s3(e,Tm({delimiter:"."},t))}function c3(e,t){return t===void 0&&(t={}),MQ(e,Tm({delimiter:"-"},t))}function JE(e){return e.ownerDocument.defaultView.getComputedStyle(e)}function eD(e,t,r){if(!e)return;t(JE(e).color);let a=e,n=JE(a).backgroundColor;for(;n==="rgba(0, 0, 0, 0)"&&a.parentNode&&a.parentNode.nodeType===a.parentNode.ELEMENT_NODE;)a=a.parentNode,n=JE(a).backgroundColor;r(n)}function _d(e,t){let{textColor:r,customTextColor:a,backgroundColor:n,customBackgroundColor:i,overlayTextColor:l,customOverlayTextColor:s,overlayBackgroundColor:c,customOverlayBackgroundColor:u,style:m}=e,p={};return t&&s?p.customTextColor=s:t&&l?p.textColor=l:a?p.customTextColor=a:r?p.textColor=r:m?.color?.text&&(p.customTextColor=m.color.text),t&&u?p.customBackgroundColor=u:t&&c?p.backgroundColor=c:i?p.customBackgroundColor=i:n?p.backgroundColor=n:m?.color?.background&&(p.customTextColor=m.color.background),p}function u3(e){return{className:w("wp-block-navigation__submenu-container",{"has-text-color":!!(e.textColor||e.customTextColor),[`has-${e.textColor}-color`]:!!e.textColor,"has-background":!!(e.backgroundColor||e.customBackgroundColor),[`has-${e.backgroundColor}-background-color`]:!!e.backgroundColor}),style:{color:e.customTextColor,backgroundColor:e.customBackgroundColor}}}var AQ=(e,t)=>{let r=e.toLowerCase(),a=t.map(i=>i.title.rendered.toLowerCase());if(!a.includes(r))return e;let n=2;for(;a.includes(`${r} ${n}`);)n++;return`${e} ${n}`},RQ=e=>c3(e).replace(/[^\w-]+/g,"")||"wp-custom-part";function OQ(e){let{saveEntityRecord:t}=(0,m3.useDispatch)(VQ.store),r=(0,m3.useSelect)(n=>K(n(FQ.store)).getPatternBySlug("core/navigation-overlay"),[]);return(0,zQ.useCallback)(async()=>{let n=e.filter(u=>u.title?.rendered),i=AQ((0,HQ.__)("Navigation Overlay"),n),l=RQ(i),s="";if(r?.content){let u=(0,xd.parse)(r.content,{__unstableSkipMigrationLogs:!0});s=(0,xd.serialize)(u)}else s=(0,xd.serialize)([(0,xd.createBlock)("core/paragraph")]);return await t("postType","wp_template_part",{slug:l,title:i,content:s,area:ic},{throwOnError:!0})},[e,t,r])}var Dv=o(M(),1),jQ=o(P(),1),UQ=o(U(),1),p3=o(v(),1);function _ye({onClear:e,onCreate:t,isCreating:r=!1}){let a=(0,UQ.createInterpolateElement)((0,jQ.__)("The selected overlay template part is missing or has been deleted. <clearButton>Reset to default overlay</clearButton> or <createButton>create a new overlay</createButton>."),{clearButton:(0,p3.jsx)(Dv.Button,{__next40pxDefaultSize:!0,onClick:e,variant:"link",disabled:r,accessibleWhenDisabled:!0}),createButton:(0,p3.jsx)(Dv.Button,{__next40pxDefaultSize:!0,onClick:t,variant:"link",disabled:r,accessibleWhenDisabled:!0,isBusy:r})});return(0,p3.jsx)(Dv.Notice,{status:"warning",isDismissible:!1,className:"wp-block-navigation__deleted-overlay-warning",children:a})}var GQ=_ye;var ho=o(v(),1);function rD({overlay:e,overlayMenu:t,setAttributes:r,onNavigateToEntityRecord:a,isCreatingOverlay:n,setIsCreatingOverlay:i}){let l=(0,WQ.useInstanceId)(rD,"wp-block-navigation__overlay-selector-heading"),{records:s,isResolving:c,hasResolved:u}=(0,d3.useEntityRecords)("postType","wp_template_part",{per_page:-1}),{createErrorNotice:m}=(0,f3.useDispatch)($Q.store),p=(0,f3.useSelect)(F=>F(d3.store).getCurrentTheme()?.stylesheet,[]),[d,f]=(0,ul.useState)(!1),h=n!==void 0?n:d,g=i!==void 0?i:f,b=(0,ul.useMemo)(()=>s?s.filter(F=>F.area===ic):[],[s]),y=OQ(b),k=(0,ul.useMemo)(()=>!e||!b?null:b.find(F=>F.slug===e),[e,b]),_=(0,ul.useMemo)(()=>{let F=[{label:(0,ia.__)("Default"),value:""}];if(!u||c)return F;let z=b.map(I=>({label:I.title?.rendered?(0,tD.decodeEntities)(I.title.rendered):I.slug,value:I.slug}));return e&&!k&&z.unshift({label:(0,ia.sprintf)((0,ia.__)("%s (missing)"),e),value:e}),[...F,...z]},[b,u,c,e,k]),x=F=>{r({overlay:F||void 0})},S=()=>{if(!e||!k||!a)return;let F=k.theme||p,I={postId:nn(F,e),postType:"wp_template_part"};t==="mobile"&&(I.viewport="mobile"),a(I)},C=(0,ul.useCallback)(async()=>{try{g(!0);let F=await y();if(r({overlay:F.slug}),a){let z=F.theme||p,R={postId:nn(z,F.slug),postType:"wp_template_part"};t==="mobile"&&(R.viewport="mobile"),a(R)}else g(!1)}catch(F){let z=F instanceof Error&&"code"in F&&F.message&&F.code!=="unknown_error"?F.message:(0,ia.__)("An error occurred while creating the overlay.");m(z,{type:"snackbar"}),g(!1)}},[y,r,a,m,p,g,t]),N=(0,ul.useCallback)(()=>{r({overlay:void 0})},[r]),B=c||h,D=(0,ul.useMemo)(()=>e&&u&&!c&&!k,[e,u,c,k]),A=(0,ul.useMemo)(()=>b.length===0&&u?(0,ia.__)("No overlays found."):(0,ia.__)("Select an overlay for navigation."),[b.length,u]),H=(0,ul.useMemo)(()=>k?(0,ia.sprintf)((0,ia.__)("Edit overlay: %s"),k.title?.rendered?(0,tD.decodeEntities)(k.title.rendered):k.slug):(0,ia.__)("Edit overlay"),[k]);return(0,ho.jsxs)("div",{className:"wp-block-navigation__overlay-selector",children:[(0,ho.jsx)("h3",{id:l,className:"wp-block-navigation__overlay-selector-header",children:(0,ia.__)("Overlay template")}),u&&(b.length===0||h&&b.length===1)?(0,ho.jsx)(ho.Fragment,{children:(0,ho.jsx)(ln.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:C,disabled:B,accessibleWhenDisabled:!0,isBusy:h,className:"wp-block-navigation__overlay-create-button-prominent",children:(0,ia.__)("Create overlay")})}):(0,ho.jsxs)(ho.Fragment,{children:[(0,ho.jsx)(ln.Button,{size:"small",icon:If,onClick:C,disabled:B,accessibleWhenDisabled:!0,isBusy:h,label:(0,ia.__)("Create new overlay template"),showTooltip:!0,className:"wp-block-navigation__overlay-create-button"}),(0,ho.jsxs)(ln.__experimentalHStack,{alignment:"flex-start",className:"wp-block-navigation__overlay-selector-controls",children:[(0,ho.jsx)(ln.FlexBlock,{children:(0,ho.jsx)(ln.SelectControl,{__next40pxDefaultSize:!0,label:(0,ia.__)("Overlay template"),hideLabelFromVision:!0,"aria-labelledby":l,value:e||"",options:_,onChange:x,disabled:c,accessibleWhenDisabled:!0,help:A})}),e&&u&&k&&(0,ho.jsx)(ln.FlexItem,{children:(0,ho.jsx)(ln.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:S,disabled:!a,accessibleWhenDisabled:!0,label:H,showTooltip:!0,className:"wp-block-navigation__overlay-edit-button",children:(0,ia.__)("Edit")})})]}),D&&(0,ho.jsx)(GQ,{onClear:N,onCreate:C,isCreating:h})]}),(0,ho.jsx)(ln.__experimentalHStack,{alignment:"flex-start",className:"wp-block-navigation__overlay-help-text-wrapper",children:(0,ho.jsx)(ln.__experimentalText,{variant:"muted",isBlock:!0,className:"wp-block-navigation__overlay-help-text",children:(0,ia.__)("An overlay template allows you to customize the appearance of the dialog that opens when the menu button is pressed.")})})]})}var qh=o(M(),1),kd=o(P(),1),Zh=o(v(),1);function qQ({overlayMenu:e,setAttributes:t}){return(0,Zh.jsxs)(qh.__experimentalToggleGroupControl,{__next40pxDefaultSize:!0,label:(0,kd.__)("Overlay Visibility"),"aria-label":(0,kd.__)("Configure overlay visibility"),value:e,help:(0,kd.__)("Collapses the navigation options in a menu icon opening an overlay."),onChange:r=>t({overlayMenu:r}),isBlock:!0,children:[(0,Zh.jsx)(qh.__experimentalToggleGroupControlOption,{value:"never",label:(0,kd.__)("Off")}),(0,Zh.jsx)(qh.__experimentalToggleGroupControlOption,{value:"mobile",label:(0,kd.__)("Mobile")}),(0,Zh.jsx)(qh.__experimentalToggleGroupControlOption,{value:"always",label:(0,kd.__)("Always")})]})}var g3=o(M(),1),h3=o(P(),1);var uu=o(M(),1),Kh=o(P(),1);var cu=o(v(),1);function ZQ({hasIcon:e,icon:t,setAttributes:r}){return(0,cu.jsxs)(uu.__experimentalVStack,{spacing:4,children:[(0,cu.jsx)(uu.ToggleControl,{label:(0,Kh.__)("Show icon button"),help:(0,Kh.__)("Configure the visual appearance of the button that toggles the overlay menu."),onChange:a=>r({hasIcon:a}),checked:e}),(0,cu.jsxs)(uu.__experimentalToggleGroupControl,{__next40pxDefaultSize:!0,className:"wp-block-navigation__overlay-menu-icon-toggle-group",label:(0,Kh.__)("Icon"),value:t,onChange:a=>r({icon:a}),isBlock:!0,children:[(0,cu.jsx)(uu.__experimentalToggleGroupControlOption,{value:"handle","aria-label":(0,Kh.__)("handle"),label:(0,cu.jsx)(lc,{icon:"handle"})}),(0,cu.jsx)(uu.__experimentalToggleGroupControlOption,{value:"menu","aria-label":(0,Kh.__)("menu"),label:(0,cu.jsx)(lc,{icon:"menu"})})]})]})}var Ea=o(v(),1);function KQ({isResponsive:e,overlayMenuPreview:t,setOverlayMenuPreview:r,hasIcon:a,icon:n,setAttributes:i,overlayMenuPreviewClasses:l,overlayMenuPreviewId:s,containerStyle:c}){return e?(0,Ea.jsxs)(Ea.Fragment,{children:[(0,Ea.jsxs)(g3.Button,{__next40pxDefaultSize:!0,className:l,onClick:()=>r(!t),"aria-label":(0,h3.__)("Overlay menu controls"),"aria-controls":s,"aria-expanded":t,children:[a&&(0,Ea.jsxs)(Ea.Fragment,{children:[(0,Ea.jsx)(lc,{icon:n}),(0,Ea.jsx)(Wa,{icon:yp})]}),!a&&(0,Ea.jsxs)(Ea.Fragment,{children:[(0,Ea.jsx)("span",{children:(0,h3.__)("Menu")}),(0,Ea.jsx)("span",{children:(0,h3.__)("Close")})]})]}),t&&(0,Ea.jsx)(g3.__experimentalVStack,{id:s,spacing:4,style:c,children:(0,Ea.jsx)(ZQ,{hasIcon:a,icon:n,setAttributes:i})})]}):null}var QQ=o(V(),1),YQ=o(Q(),1),oD=o(U(),1),XQ=o(W(),1),JQ=o(M(),1),eY=o(P(),1),aD=o(T(),1);var wd=o(v(),1);function tY({overlay:e,currentTheme:t}){let r=(0,oD.useMemo)(()=>!e||!t?null:nn(t,e),[t,e]),{content:a,editedBlocks:n,hasResolved:i}=(0,QQ.useSelect)(s=>{if(!r)return{content:null,editedBlocks:null,hasResolved:!0};let{getEditedEntityRecord:c,hasFinishedResolution:u}=s(YQ.store),m=c("postType","wp_template_part",r,{context:"view"});return{content:m?.content,editedBlocks:m?.blocks,hasResolved:u("getEditedEntityRecord",["postType","wp_template_part",r,{context:"view"}])}},[r]),l=(0,oD.useMemo)(()=>r?n&&n.length>0?n:a&&typeof a=="string"?(0,XQ.parse)(a):[]:null,[r,n,a]);return e?i?(0,wd.jsx)("div",{className:"wp-block-navigation__overlay-preview","aria-label":(0,eY.__)("Navigation Overlay template part preview"),role:"region",children:(0,wd.jsx)(aD.BlockPreview.Async,{placeholder:(0,wd.jsx)("div",{className:"wp-block-navigation__overlay-preview-placeholder"}),children:(0,wd.jsx)(aD.BlockPreview,{blocks:l,viewportWidth:400,minHeight:200})})}):(0,wd.jsx)("div",{className:"wp-block-navigation__overlay-preview-loading",children:(0,wd.jsx)(JQ.Spinner,{})}):null}var Pm=o(v(),1);function aY({overlayMenu:e,overlay:t,setAttributes:r,onNavigateToEntityRecord:a,overlayMenuPreview:n,setOverlayMenuPreview:i,hasIcon:l,icon:s,overlayMenuPreviewClasses:c,overlayMenuPreviewId:u,isResponsive:m,currentTheme:p,hasOverlays:d}){let[f,h]=(0,oY.useState)(!1);return(0,Pm.jsx)(v3.PanelBody,{title:(0,rY.__)("Overlay"),initialOpen:!0,children:(0,Pm.jsxs)(v3.__experimentalVStack,{spacing:4,children:[(0,Pm.jsx)(qQ,{overlayMenu:e,setAttributes:r}),e!=="never"&&(0,Pm.jsx)(KQ,{isResponsive:m,overlayMenuPreview:n,setOverlayMenuPreview:i,hasIcon:l,icon:s,setAttributes:r,overlayMenuPreviewClasses:c,overlayMenuPreviewId:u}),e!=="never"&&(0,Pm.jsx)(rD,{overlay:t,overlayMenu:e,setAttributes:r,onNavigateToEntityRecord:a,isCreatingOverlay:f,setIsCreatingOverlay:h}),e!=="never"&&t&&d&&!f&&(0,Pm.jsx)(tY,{overlay:t,currentTheme:p})]})})}var x3=o(V(),1),iD=o(Q(),1),Yh=o(U(),1),cc=o(P(),1);var Lv=o(W(),1),lY=o(Yc(),1);var nD=o(U(),1),b3=o(T(),1),nY=o(V(),1),iY=o(Q(),1);function Qh(e){if(e===void 0)throw new Error('buildNavigationLinkEntityBinding requires a kind parameter. Only "post-type" and "taxonomy" are supported.');if(e!=="post-type"&&e!=="taxonomy")throw new Error(`Invalid kind "${e}" provided to buildNavigationLinkEntityBinding. Only 'post-type' and 'taxonomy' are supported.`);return{url:{source:e==="taxonomy"?"core/term-data":"core/post-data",args:{field:"link"}}}}function Ni({clientId:e,attributes:t}){let{updateBlockBindings:r}=(0,b3.useBlockBindingsUtils)(e),{metadata:a,id:n,kind:i,type:l}=t,s=(0,b3.useBlockEditingMode)(),c=!!a?.bindings?.url&&!!n,u=i==="post-type"?"core/post-data":"core/term-data",m=c&&a?.bindings?.url?.source===u,{isBoundEntityAvailable:p,entityRecord:d}=(0,nY.useSelect)(g=>{if(!m||!n)return{isBoundEntityAvailable:!1,entityRecord:null};let b=i==="post-type",y=i==="taxonomy";if(!b&&!y)return{isBoundEntityAvailable:!1,entityRecord:null};if(s==="disabled")return{isBoundEntityAvailable:!0,entityRecord:null};let{getEntityRecord:k,hasFinishedResolution:_}=g(iY.store),x=y?"taxonomy":"postType",S=l==="tag"?"post_tag":l,C=k(x,S,n);return{isBoundEntityAvailable:_("getEntityRecord",[x,S,n])?C!==void 0:!0,entityRecord:C||null}},[i,l,n,m,s]),f=(0,nD.useCallback)(()=>{c&&r({url:void 0})},[r,c]),h=(0,nD.useCallback)(g=>{let b=g?.kind??i;if(b)try{let y=Qh(b);r(y)}catch(y){console.warn("Failed to create entity binding:",y.message)}},[r,i]);return{hasUrlBinding:m,isBoundEntityAvailable:p,entityRecord:d,clearBinding:f,createBinding:h}}function sY(e){if(!e)return null;let t=kye(e),r=cY(t);return(0,lY.applyFilters)("blocks.navigation.__unstableMenuItemsToBlocks",r,e)}function cY(e,t=0){let r={};return{innerBlocks:[...e].sort((i,l)=>i.menu_order-l.menu_order).map(i=>{if(i.type==="block"){let[p]=(0,Lv.parse)(i.content.raw);return p||(0,Lv.createBlock)("core/freeform",{content:i.content})}let l=i.children?.length?"core/navigation-submenu":"core/navigation-link",s=xye(i,l,t),{innerBlocks:c=[],mapping:u={}}=i.children?.length?cY(i.children,t+1):{};r={...r,...u};let m=(0,Lv.createBlock)(l,s,c);return r[i.id]=m.clientId,m}),mapping:r}}function xye({title:e,xfn:t,classes:r,attr_title:a,object:n,object_id:i,description:l,url:s,type:c,target:u},m,p){n&&n==="post_tag"&&(n="tag");let d=c?.replace("_","-")||"custom";return{label:e?.rendered||"",...n?.length&&{type:n},kind:d,url:s||"",...t?.length&&t.join(" ").trim()&&{rel:t.join(" ").trim()},...r?.length&&r.join(" ").trim()&&{className:r.join(" ").trim()},...a?.length&&{title:a},...i&&(d==="post-type"||d==="taxonomy")&&{id:i,metadata:{bindings:Qh(d)}},...l?.length&&{description:l},...u==="_blank"&&{opensInNewTab:!0},...m==="core/navigation-submenu"&&{isTopLevelItem:p===0},...m==="core/navigation-link"&&{isTopLevelLink:p===0}}}function kye(e,t="id",r="parent"){let a=Object.create(null),n=[];for(let i of e)a[i[t]]={...i,children:[]},i[r]?(a[i[r]]=a[i[r]]||{},a[i[r]].children=a[i[r]].children||[],a[i[r]].children.push(a[i[t]])):n.push(a[i[t]]);return n}var lD="success",_3="error",k3="pending",wye="idle",y3=null;function Cye(e,{throwOnError:t=!1}={}){let r=(0,x3.useRegistry)(),{editEntityRecord:a}=(0,x3.useDispatch)(iD.store),[n,i]=(0,Yh.useState)(wye),[l,s]=(0,Yh.useState)(null),c=(0,Yh.useCallback)(async(m,p,d="publish")=>{let f,h;try{h=await r.resolveSelect(iD.store).getMenuItems({menus:m,per_page:-1,context:"view"})}catch(b){throw new Error((0,cc.sprintf)((0,cc.__)('Unable to fetch classic menu "%s" from API.'),p),{cause:b})}if(h===null)throw new Error((0,cc.sprintf)((0,cc.__)('Unable to fetch classic menu "%s" from API.'),p));let{innerBlocks:g}=sY(h);try{f=await e(p,g,d),await a("postType","wp_navigation",f.id,{status:"publish"},{throwOnError:!0})}catch(b){throw new Error((0,cc.sprintf)((0,cc.__)('Unable to create Navigation Menu "%s".'),p),{cause:b})}return f},[e,a,r]);return{convert:(0,Yh.useCallback)(async(m,p,d)=>{if(y3!==m){if(y3=m,!m||!p){s("Unable to convert menu. Missing menu details."),i(_3);return}return i(k3),s(null),await c(m,p,d).then(f=>(i(lD),y3=null,f)).catch(f=>{if(s(f?.message),i(_3),y3=null,t)throw new Error((0,cc.sprintf)((0,cc.__)('Unable to create Navigation Menu "%s".'),p),{cause:f})})}},[c,t]),status:n,error:l}}var uY=Cye;var kY=o(W(),1),wY=o(Q(),1),CY=o(V(),1),Jh=o(U(),1);var hY=o(M(),1),gY=o(Q(),1),vY=o(V(),1),w3=o(U(),1),Mv=o(P(),1);var mY=o(T(),1),pY=o(Q(),1),dY=o(V(),1);var Xh=e=>e==="header"?K9:e==="footer"?E9:e==="sidebar"?YP:e==="navigation-overlay"?VT:u1;function fY(e){return(0,dY.useSelect)(t=>{if(!e)return;let{getBlock:r,getBlockParentsByBlockName:a}=t(mY.store),i=a(e,"core/template-part",!0);if(!i?.length)return;let{getCurrentTheme:l,getEditedEntityRecord:s}=t(pY.store),c=l(),m=(c?.default_template_part_areas||[]).map(p=>({...p,icon:Xh(p.icon)}));for(let p of i){let d=r(p),{theme:f=c?.stylesheet,slug:h}=d.attributes,g=nn(f,h),b=s("postType","wp_template_part",g);if(b?.area)return m.find(y=>y.area!=="uncategorized"&&y.area===b.area)?.label}},[e])}var Sye=["postType","wp_navigation",{status:"draft",per_page:-1}],Tye=["postType","wp_navigation",{per_page:-1,status:"publish"}];function bY(e){let t=(0,w3.useContext)(hY.Disabled.Context),r=fY(t?void 0:e),a=(0,vY.useRegistry)();return(0,w3.useCallback)(async()=>{if(t)return"";let{getEntityRecords:n}=a.resolveSelect(gY.store),[i,l]=await Promise.all([n(...Sye),n(...Tye)]),s=r?(0,Mv.sprintf)((0,Mv.__)("%s menu"),r):(0,Mv.__)("Menu"),c=[...i,...l].reduce((m,p)=>p?.title?.raw?.startsWith(s)?m+1:m,0);return(c>0?`${s} ${c+1}`:s)||""},[t,r,a])}var yY="success",C3="error",_Y="pending",xY="idle";function SY(e){let[t,r]=(0,Jh.useState)(xY),[a,n]=(0,Jh.useState)(null),[i,l]=(0,Jh.useState)(null),{saveEntityRecord:s,editEntityRecord:c}=(0,CY.useDispatch)(wY.store),u=bY(e);return{create:(0,Jh.useCallback)(async(p=null,d=[],f)=>{if(p&&typeof p!="string")throw l("Invalid title supplied when creating Navigation Menu."),r(C3),new Error("Value of supplied title argument was not a string.");r(_Y),n(null),l(null),p||(p=await u().catch(g=>{throw l(g?.message),r(C3),new Error("Failed to create title when saving new Navigation Menu.",{cause:g})}));let h={title:p,content:(0,kY.serialize)(d),status:f};return s("postType","wp_navigation",h).then(g=>(n(g),r(yY),f!=="publish"&&c("postType","wp_navigation",g.id,{status:"publish"}),g)).catch(g=>{throw l(g?.message),r(C3),new Error("Unable to save new Navigation Menu",{cause:g})})},[s,c,u]),status:t,value:a,error:i,isIdle:t===xY,isPending:t===_Y,isSuccess:t===yY,isError:t===C3}}var TY=o(V(),1),PY=o(T(),1),Pye=[];function BY(e){return(0,TY.useSelect)(t=>{let{getBlock:r,getBlocks:a,hasSelectedInnerBlock:n}=t(PY.store),i=r(e).innerBlocks,l=!!i?.length,s=l?Pye:a(e);return{innerBlocks:l?i:s,hasUncontrolledInnerBlocks:l,uncontrolledInnerBlocks:i,controlledInnerBlocks:s,isInnerBlockSelected:n(e,!0)}},[e])}var IY=o(mr(),1),S3=o(M(),1),NY=o(P(),1),EY=o(v(),1),Bye=({className:e="",disabled:t,isMenuItem:r=!1})=>{let a=S3.Button;return r&&(a=S3.MenuItem),(0,EY.jsx)(a,{variant:"link",disabled:t,className:e,href:(0,IY.addQueryArgs)("edit.php",{post_type:"wp_navigation"}),children:(0,NY.__)("Manage menus")})},DY=Bye;var fu=o(T(),1),hu=o(M(),1),Zv=o(V(),1),du=o(P(),1),iX=o(U(),1);var LY=o(T(),1),P3=o(M(),1),MY=o(P(),1),B3=o(U(),1),T3=o(v(),1);function Iye({onCreateNew:e,isNotice:t=!1}){let[r,a]=(0,B3.useState)(!1),n=()=>{a(!0),e()},i=(0,B3.createInterpolateElement)((0,MY.__)("Navigation Menu has been deleted or is unavailable. <button>Create a new Menu?</button>"),{button:(0,T3.jsx)(P3.Button,{__next40pxDefaultSize:!0,onClick:n,variant:"link",disabled:r,accessibleWhenDisabled:!0})});return t?(0,T3.jsx)(P3.Notice,{status:"warning",isDismissible:!1,children:i}):(0,T3.jsx)(LY.Warning,{children:i})}var I3=Iye;var sD=o(W(),1);var uc=o(M(),1),Av=o(V(),1),Bm=o(P(),1),eg=o(T(),1);var Ei=o(v(),1),Nye={className:"block-editor-block-settings-menu__popover",placement:"bottom-start"},Eye=["core/navigation-link","core/navigation-submenu"];function Dye({block:e,onClose:t,expandedState:r,expand:a,setInsertedBlock:n}){let{insertBlock:i,replaceBlock:l,replaceInnerBlocks:s}=(0,Av.useDispatch)(eg.store),c=e.clientId,u=!Eye.includes(e.name);return(0,Ei.jsx)(uc.MenuItem,{icon:vp,disabled:u,onClick:()=>{let p=(0,sD.createBlock)(Pi.name,Pi.attributes);if(e.name==="core/navigation-submenu")i(p,e.innerBlocks.length,c,!1);else{let d=(0,sD.createBlock)("core/navigation-submenu",e.attributes,e.innerBlocks);l(c,d),s(d.clientId,[p],!1)}n(p),r[e.clientId]||a(e.clientId),t()},children:(0,Bm.__)("Add submenu link")})}function AY(e){let{block:t}=e,{clientId:r}=t,{moveBlocksDown:a,moveBlocksUp:n,removeBlocks:i}=(0,Av.useDispatch)(eg.store),l=(0,Bm.sprintf)((0,Bm.__)("Remove %s"),(0,eg.BlockTitle)({clientId:r,maximumLength:25})),s=(0,Av.useSelect)(c=>{let{getBlockRootClientId:u}=c(eg.store);return u(r)},[r]);return(0,Ei.jsx)(uc.DropdownMenu,{icon:q0,label:(0,Bm.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:Nye,noIcons:!0,...e,children:({onClose:c})=>(0,Ei.jsxs)(Ei.Fragment,{children:[(0,Ei.jsxs)(uc.MenuGroup,{children:[(0,Ei.jsx)(uc.MenuItem,{icon:T0,onClick:()=>{n([r],s),c()},children:(0,Bm.__)("Move up")}),(0,Ei.jsx)(uc.MenuItem,{icon:bp,onClick:()=>{a([r],s),c()},children:(0,Bm.__)("Move down")}),(0,Ei.jsx)(Dye,{block:t,onClose:c,expandedState:e.expandedState,expand:e.expand,setInsertedBlock:e.setInsertedBlock})]}),(0,Ei.jsx)(uc.MenuGroup,{children:(0,Ei.jsx)(uc.MenuItem,{onClick:()=>{i([r],!1),c()},children:l})})]})})}var Ao=o(M(),1),Wt=o(P(),1),JY=o(ai(),1),jv=o(T(),1),z3=o(V(),1),eX=o(Q(),1);var zY=o(U(),1),VY=o(V(),1),FY=o(T(),1),HY=o(ai(),1),OY=o(cD(),1);var uD=o(cD(),1),Rv=o(mr(),1),Lye=(e,t)=>{if(!e||!t)return!1;let r=h=>h?h.replace(/\/+$/,""):"",a=(h,g=null)=>{try{let b=g||(typeof window<"u"?window.location.origin:"https://wordpress.org");return new URL(h,b)}catch{return null}},n=a(e);if(!n)return!0;let i=a(t,e);if(!i)return!0;let l=n.hostname,s=i.hostname,c=r((0,Rv.getPath)(n.toString())),u=r((0,Rv.getPath)(i.toString()));if(l!==s||c!==u)return!0;let m=n.searchParams.get("p"),p=i.searchParams.get("p");if(m&&p&&m!==p)return!0;let d=n.searchParams.get("page_id"),f=i.searchParams.get("page_id");return!!(d&&f&&d!==f||m&&f||d&&p)},zv=(e={},t,r={})=>{let{label:a="",kind:n="",type:i=""}=r,{title:l="",label:s="",url:c,opensInNewTab:u,id:m,kind:p=n,type:d=i}=e,f=l||s,h=f.replace(/http(s?):\/\//gi,""),g=c?.replace(/http(s?):\/\//gi,"")??"",y=f&&f!==a&&h!==g?(0,uD.escapeHTML)(f):a||(0,uD.escapeHTML)(g),k=d==="post_tag"?"tag":d.replace("-","_"),_=["post","page","tag","category"].indexOf(k)>-1,S=!p&&!_||p==="custom"?"custom":p,C={...c!==void 0?{url:c&&encodeURI((0,Rv.safeDecodeURI)(c))}:{},...y&&{label:y},...u!==void 0&&{opensInNewTab:u},...S&&{kind:S},...k&&k!=="URL"&&{type:k}};c&&!m&&r.id?Lye(r.url,c)&&(C.id=void 0,C.kind="custom",C.type="custom"):m&&Number.isInteger(m)?C.id=m:r.id&&(C.kind=S,C.type=k),t(C);let N="id"in C?C.id:r.id,B="kind"in C?C.kind:r.kind;return{isEntityLink:!!N&&B!=="custom",attributes:C}};function Cd({clientId:e,attributes:t,setAttributes:r,allowTextUpdate:a=!1}){let{updateBlockAttributes:n}=(0,VY.useDispatch)(FY.store),{hasUrlBinding:i,createBinding:l,clearBinding:s}=Ni({clientId:e,attributes:t});return(0,zY.useCallback)(c=>{if(!c)return;let u={url:c.url,kind:c.kind,type:c.type,id:c.id},m=t.label?(0,HY.__unstableStripHTML)(t.label):"",p=c.title??"",d=a&&c.title!==void 0&&p!==m,f=d?{label:(0,OY.escapeHTML)(p)}:{};if((!t.label||t.label===""||d)&&(u.title=c.title),!c.id&&i)s(),n(e,{url:c.url,kind:"custom",type:"custom",id:void 0,...f});else{let{isEntityLink:g,attributes:b}=zv(u,r,t);g?l(b):s(),Object.keys(f).length&&n(e,f)}},[t,a,e,i,l,s,r,n])}var A3=o(ai(),1),mu=o(M(),1),Hv=o(P(),1),R3=o(T(),1),Da=o(U(),1),$Y=o(Q(),1);var gD=o(me(),1),qY=o(mr(),1);var On=o(M(),1),Di=o(P(),1),Fv=o(V(),1),L3=o(Q(),1),jY=o(xr(),1),pD=o(Wo(),1),dD=o(U(),1);var N3=o(M(),1),E3=o(P(),1);var Vv=o(me(),1),Im=o(v(),1);function Mye({className:e,onBack:t}){return(0,Im.jsx)(N3.Button,{className:e,icon:(0,E3.isRTL)()?t9:XS,onClick:r=>{r.preventDefault(),t()},size:"small",children:(0,E3.__)("Back")})}function mD({className:e,title:t,description:r,onBack:a,children:n}){let i=(0,Vv.useInstanceId)(mD,"link-ui-dialog-title"),l=(0,Vv.useInstanceId)(mD,"link-ui-dialog-description"),s=(0,Vv.useFocusOnMount)("firstElement"),c=`${e}__back`;return(0,Im.jsxs)("div",{className:e,role:"dialog","aria-labelledby":i,"aria-describedby":l,ref:s,children:[(0,Im.jsxs)(N3.VisuallyHidden,{children:[(0,Im.jsx)("h2",{id:i,children:t}),(0,Im.jsx)("p",{id:l,children:r})]}),(0,Im.jsx)(Mye,{className:c,onBack:a}),n]})}var D3=mD;var ml=o(v(),1);function UY({postType:e,onBack:t,onPageCreated:r,initialTitle:a=""}){let[n,i]=(0,dD.useState)(a),[l,s]=(0,dD.useState)(!0),c=n.trim().length>0,{lastError:u,isSaving:m}=(0,Fv.useSelect)(b=>({lastError:b(L3.store).getLastEntitySaveError("postType",e),isSaving:b(L3.store).isSavingEntityRecord("postType",e)}),[e]),{saveEntityRecord:p}=(0,Fv.useDispatch)(L3.store),{createSuccessNotice:d,createErrorNotice:f}=(0,Fv.useDispatch)(jY.store);async function h(b){if(b.preventDefault(),!(m||!c))try{let y=await p("postType",e,{title:n,status:l?"publish":"draft"},{throwOnError:!0});if(y){let k={id:y.id,type:e,title:(0,pD.decodeEntities)(y.title.rendered),url:y.link,kind:"post-type"};d((0,Di.sprintf)((0,Di.__)("%s page created successfully."),(0,pD.decodeEntities)(y.title.rendered)),{type:"snackbar",id:"page-created-success"}),r(k)}}catch{f((0,Di.__)("Failed to create page. Please try again."),{type:"snackbar",id:"page-created-error"})}}let g=m||!c;return(0,ml.jsx)(D3,{className:"link-ui-page-creator",title:(0,Di.__)("Create page"),description:(0,Di.__)("Create a new page to add to your Navigation."),onBack:t,children:(0,ml.jsx)(On.__experimentalVStack,{className:"link-ui-page-creator__inner",spacing:4,children:(0,ml.jsx)("form",{onSubmit:h,children:(0,ml.jsxs)(On.__experimentalVStack,{spacing:4,children:[(0,ml.jsx)(On.TextControl,{__next40pxDefaultSize:!0,label:(0,Di.__)("Title"),onChange:i,placeholder:(0,Di.__)("No title"),value:n}),(0,ml.jsx)(On.CheckboxControl,{label:(0,Di.__)("Publish"),help:(0,Di.__)("Turn off to save as a draft. Drafts won't appear on your site until published."),checked:l,onChange:s}),u&&(0,ml.jsx)(On.Notice,{status:"error",isDismissible:!1,children:u.message}),(0,ml.jsxs)(On.__experimentalHStack,{spacing:2,justify:"flex-end",children:[(0,ml.jsx)(On.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:t,disabled:m,accessibleWhenDisabled:!0,children:(0,Di.__)("Cancel")}),(0,ml.jsx)(On.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",isBusy:m,"aria-disabled":g,children:(0,Di.__)("Create page")})]})]})})})})}var fD=o(P(),1),GY=o(V(),1),M3=o(T(),1);var hD=o(v(),1),{PrivateQuickInserter:Aye}=K(M3.privateApis);function Rye({clientId:e,onBack:t,onBlockInsert:r}){let{rootBlockClientId:a}=(0,GY.useSelect)(n=>{let{getBlockRootClientId:i}=n(M3.store);return{rootBlockClientId:i(e)}},[e]);return e?(0,hD.jsx)(D3,{className:"link-ui-block-inserter",title:(0,fD.__)("Add block"),description:(0,fD.__)("Choose a block to add to your Navigation."),onBack:t,children:(0,hD.jsx)(Aye,{rootClientId:a,clientId:e,isAppender:!1,prioritizePatterns:!1,selectBlockOnInsert:!r,onSelect:r||void 0,hasSearch:!1})}):null}var WY=Rye;var jn=o(v(),1);function vD(e,t){switch(e){case"post":case"page":return{type:"post",subtype:e,perPage:20};case"category":return{type:"term",subtype:"category",perPage:20};case"tag":return{type:"term",subtype:"post_tag",perPage:20};case"post_format":return{type:"post-format",perPage:20};default:return t==="taxonomy"?{type:"term",subtype:e,perPage:20}:t==="post-type"?{type:"post",subtype:e,perPage:20}:{initialSuggestionsSearchOptions:{type:"post",subtype:"page",perPage:20}}}}function zye(e,t){let{label:r,url:a,opensInNewTab:n,type:i,kind:l,id:s}=e.link,{entityRecord:c,hasBinding:u,isEntityAvailable:m}=e.entity||{},{image:p,badges:d}=Ov({url:a,entityRecord:c,type:i,hasBinding:u,isEntityAvailable:m}),{clientId:f}=e,h=i||"page",[g,b]=(0,Da.useState)(!1),[y,k]=(0,Da.useState)(!1),[_,x]=(0,Da.useState)(null),[S,C]=(0,Da.useState)(""),N=(0,Da.useRef)(""),B=O=>{N.current=O,C(O)},D=(0,Da.useRef)(),A=(0,Da.useRef)(),H=(0,Da.useRef)(),F=(0,$Y.useResourcePermissions)({kind:"postType",name:h}),{isBoundEntityAvailable:z}=Ni({clientId:f,attributes:e.link}),I=(0,Da.useMemo)(()=>({url:a,opensInNewTab:n,title:r&&(0,A3.__unstableStripHTML)(r),kind:l,type:i,id:s,image:p,badges:d}),[r,n,a,l,i,s,p,d]),R=O=>{e.onChange(O),k(!1),x(!0),B("")},$=(0,gD.useInstanceId)(pu,"link-ui-link-control__title"),j=(0,gD.useInstanceId)(pu,"link-ui-link-control__description");(0,Da.useEffect)(()=>{_&&D.current&&(_?.current?_.current.focus():(A3.focus.tabbable.find(D.current)[0]||D.current).focus(),x(!1))},[_]);let G=(0,R3.useBlockEditingMode)();return(0,jn.jsxs)(mu.Popover,{ref:t,placement:"bottom",onClose:e.onClose,anchor:e.anchor,shift:!0,children:[!g&&!y&&(0,jn.jsxs)("div",{ref:D,role:"dialog","aria-labelledby":$,"aria-describedby":j,children:[(0,jn.jsxs)(mu.VisuallyHidden,{children:[(0,jn.jsx)("h2",{id:$,children:(0,Hv.__)("Add link")}),(0,jn.jsx)("p",{id:j,children:(0,Hv.__)("Search for and add a link to your Navigation.")})]}),(0,jn.jsx)(R3.LinkControl,{hasTextControl:!0,hasRichPreviews:!0,value:I,showInitialSuggestions:!0,withCreateSuggestion:!1,noDirectEntry:!!i,noURLSuggestion:!!i,suggestionsQuery:vD(i,l),onChange:e.onChange,onInputChange:O=>{N.current=O},inputValue:S,onRemove:e.onRemove,onCancel:e.onCancel,handleEntities:z,forceIsEditingLink:I?.url?!1:void 0,renderControlBottom:()=>I?.url?.length?null:(0,jn.jsx)(Vye,{addPageButtonRef:A,addBlockButtonRef:H,setAddingBlock:()=>{b(!0)},setAddingPage:()=>{k(!0)},canAddPage:F?.canCreate&&i==="page",canAddBlock:G==="default"})})]}),g&&(0,jn.jsx)(WY,{clientId:e.clientId,onBack:()=>{b(!1),x(H),B(N.current)},onBlockInsert:e?.onBlockInsert}),y&&(0,jn.jsx)(UY,{postType:h,onBack:()=>{k(!1),x(A),B(N.current)},onPageCreated:R,initialTitle:N.current&&!(0,qY.isURL)(N.current)?N.current:""})]})}var pu=(0,Da.forwardRef)(zye),Vye=({addPageButtonRef:e,addBlockButtonRef:t,setAddingBlock:r,setAddingPage:a,canAddPage:n,canAddBlock:i})=>{let l="listbox";return!n&&!i?null:(0,jn.jsxs)(mu.__experimentalVStack,{spacing:0,className:"link-ui-tools",children:[n&&(0,jn.jsx)(mu.Button,{__next40pxDefaultSize:!0,ref:e,icon:If,onClick:s=>{s.preventDefault(),a(!0)},"aria-haspopup":l,children:(0,Hv.__)("Create page")}),i&&(0,jn.jsx)(mu.Button,{__next40pxDefaultSize:!0,ref:t,icon:If,onClick:s=>{s.preventDefault(),r(!0)},"aria-haspopup":l,children:(0,Hv.__)("Add block")})]})};var sn=o(P(),1),_D=o(mr(),1),ZY=o(T(),1),bD=o(V(),1),yD=o(Q(),1);var{useRemoteUrlData:Fye,isHashLink:KY,isRelativePath:Hye}=K(ZY.privateApis);function Oye(e){return e.charAt(0).toUpperCase()+e.slice(1)}function jye({linkUrl:e,homeUrl:t}={}){if(!e)return{displayUrl:"",isExternal:!1};let r=(0,_D.safeDecodeURI)(e),a=!1;if(Hye(e)||KY(e))return{displayUrl:r,isExternal:!1};try{let n=new URL(e),i=new URL(t).host;if(n.host===i){let l=n.pathname+n.search+n.hash;l.endsWith("/")&&l.length>1&&(l=l.slice(0,-1)),r=l}else a=!0}catch{a=!0}return{displayUrl:r,isExternal:a}}function Uye({url:e,type:t,isExternal:r,entityStatus:a,hasBinding:n,isEntityAvailable:i}){let l=[];if(e&&(r?l.push({label:(0,sn.__)("External link"),intent:"default"}):KY(e)?l.push({label:(0,sn.__)("Internal link"),intent:"default"}):t&&t!=="custom"?l.push({label:Oye(t),intent:"default"}):l.push({label:(0,sn.__)("Page"),intent:"default"})),n&&!i)l.push({label:(0,sn.sprintf)((0,sn.__)("Missing %s"),t),intent:"error"});else if(!e)l.push({label:(0,sn.__)("No link selected"),intent:"error"});else if(a){let c={publish:{label:(0,sn.__)("Published"),intent:"success"},future:{label:(0,sn.__)("Scheduled"),intent:"warning"},draft:{label:(0,sn.__)("Draft"),intent:"warning"},pending:{label:(0,sn.__)("Pending"),intent:"warning"},private:{label:(0,sn.__)("Private"),intent:"default"},trash:{label:(0,sn.__)("Trash"),intent:"error"}}[a];c&&l.push(c)}return l}function Ov({url:e,entityRecord:t,type:r,hasBinding:a,isEntityAvailable:n}){let i=(0,bD.useSelect)(f=>f(yD.store).getEntityRecord("root","__unstableBase")?.home,[]),l=t?.title?.rendered||t?.title||t?.name,{richData:s}=Fye(l?null:e),{displayUrl:c,isExternal:u}=jye({linkUrl:e,homeUrl:i}),m=(0,bD.useSelect)(f=>{if(!t?.featured_media)return null;let{getEntityRecord:h}=f(yD.store),g=h("postType","attachment",t.featured_media);return g?.media_details?.sizes?.thumbnail?.source_url||g?.media_details?.sizes?.medium?.source_url||g?.source_url||null},[t?.featured_media]),p=Uye({url:e,type:r,isExternal:u,entityStatus:t?.status,hasBinding:a,isEntityAvailable:n});return{title:e?l||s?.title||(0,_D.safeDecodeURI)(e):(0,sn.__)("Add link"),url:c,image:m,badges:p}}var QY=o(V(),1),YY=o(Q(),1),XY=o(T(),1),Sd=(e,t,r,a)=>{let n=e==="post-type"||t==="post"||t==="page",i=Number.isInteger(r),l=(0,XY.useBlockEditingMode)(),{postStatus:s,isDeleted:c}=(0,QY.useSelect)(p=>{if(!n)return{postStatus:null,isDeleted:!1};if(l==="disabled"||!a)return{postStatus:null,isDeleted:!1};let{getEntityRecord:d,hasFinishedResolution:f}=p(YY.store),h=d("postType",t,r),b=f("getEntityRecord",["postType",t,r])&&h===void 0;return{postStatus:h?.status,isDeleted:b}},[n,l,a,t,r]);return[n&&i&&(c||s&&s==="trash"),s==="draft"]};var Mo=o(v(),1),{LinkPicker:Gye,isHashLink:Wye,isRelativePath:$ye}=K(jv.privateApis);function qye(e,t){if(t==="post-type")switch(e){case"post":return(0,Wt.__)("post");case"page":return(0,Wt.__)("page");default:return e||(0,Wt.__)("post")}if(t==="taxonomy")switch(e){case"category":return(0,Wt.__)("category");case"tag":return(0,Wt.__)("tag");default:return e||(0,Wt.__)("term")}return e||(0,Wt.__)("item")}function Uv({attributes:e,setAttributes:t,clientId:r,isLinkEditable:a=!0}){let{label:n,url:i,description:l,rel:s,opensInNewTab:c}=e,u=q(),{hasUrlBinding:m,isBoundEntityAvailable:p,entityRecord:d}=Ni({clientId:r,attributes:e}),[f,h]=Sd(e.kind,e.type,d?.id,m),g="";f||m&&!p?g=V3():h&&(g=Zye({type:e.type,kind:e.kind}));let b=Cd({clientId:r,attributes:e,setAttributes:t}),y=(0,z3.useSelect)(B=>B(jv.store).getSettings().onNavigateToEntityRecord,[]),k=(0,z3.useSelect)(B=>B(eX.store).getEntityRecord("root","__unstableBase")?.home,[]),x=(0,z3.useSelect)(B=>B(jv.store).getBlockEditingMode(r),[r])==="contentOnly",S=Ov({url:i,entityRecord:d,type:e.type,hasBinding:m,isEntityAvailable:p}),C=!!i&&(!Wye(i)||$ye(i)&&!i.startsWith("/")),N=C&&i.startsWith("/")&&k?k+i:i;return(0,Mo.jsxs)(Ao.__experimentalToolsPanel,{label:(0,Wt.__)("Settings"),resetAll:()=>{t({label:"",url:"",description:"",rel:"",opensInNewTab:!1})},dropdownMenuProps:u,children:[(0,Mo.jsx)(Ao.__experimentalToolsPanelItem,{hasValue:()=>!!n,label:(0,Wt.__)("Text"),onDeselect:()=>t({label:""}),isShownByDefault:!0,children:(0,Mo.jsx)(Ao.TextControl,{__next40pxDefaultSize:!0,label:(0,Wt.__)("Text"),value:n?(0,JY.__unstableStripHTML)(n):"",onChange:B=>{t({label:B})},autoComplete:"off"})}),a&&(0,Mo.jsxs)(Mo.Fragment,{children:[(0,Mo.jsx)(Ao.__experimentalToolsPanelItem,{hasValue:()=>!!i,label:(0,Wt.__)("Link to"),onDeselect:()=>t({url:void 0,id:void 0,kind:void 0,type:void 0}),isShownByDefault:!0,children:(0,Mo.jsx)(Gye,{preview:S,onSelect:b,suggestionsQuery:vD(e.type,e.kind),label:(0,Wt.__)("Link to"),help:g||void 0})}),(0,Mo.jsx)(Ao.__experimentalToolsPanelItem,{hasValue:()=>!!c,label:(0,Wt.__)("Open in new tab"),onDeselect:()=>t({opensInNewTab:!1}),isShownByDefault:!0,children:(0,Mo.jsx)(Ao.CheckboxControl,{label:(0,Wt.__)("Open in new tab"),checked:c,onChange:B=>t({opensInNewTab:B})})}),!!i&&m&&p&&d?.id&&e.kind==="post-type"&&y&&(0,Mo.jsx)(Ao.Button,{variant:"secondary",onClick:()=>{y({postId:d.id,postType:e.type})},__next40pxDefaultSize:!0,className:"navigation-link-to__action-button",children:(0,Wt.__)("Edit")}),C&&(0,Mo.jsx)(Ao.Button,{variant:"secondary",href:N,target:"_blank",icon:B9,iconPosition:"right",__next40pxDefaultSize:!0,className:"navigation-link-to__action-button",children:(0,Wt.__)("View")})]}),(0,Mo.jsx)(Ao.__experimentalToolsPanelItem,{hasValue:()=>!!l,label:(0,Wt.__)("Description"),onDeselect:()=>t({description:""}),isShownByDefault:!x,children:(0,Mo.jsx)(Ao.TextareaControl,{label:(0,Wt.__)("Description"),value:l||"",onChange:B=>{t({description:B})},help:(0,Wt.__)("The description will be displayed in the menu if the current theme supports it.")})}),(0,Mo.jsx)(Ao.__experimentalToolsPanelItem,{hasValue:()=>!!s,label:(0,Wt.__)("Rel attribute"),onDeselect:()=>t({rel:""}),isShownByDefault:!x,children:(0,Mo.jsx)(Ao.TextControl,{__next40pxDefaultSize:!0,label:(0,Wt.__)("Rel attribute"),value:s||"",onChange:B=>{t({rel:B})},autoComplete:"off",help:(0,Wt.__)("The relationship of the linked URL as space-separated link types.")})})]})}function V3(){return(0,Wt.__)("This link is invalid and will not appear on your site. Please update the link.")}function Zye({type:e,kind:t}){let r=qye(e,t);return(0,Wt.sprintf)((0,Wt.__)("This link is to a draft %1$s and will not appear on your site until the %1$s is published."),r)}var xD=o(P(),1),tX=o(Wo(),1),kD=o(v(),1);function Gv({label:e,isInvalid:t,isDraft:r,className:a="wp-block-navigation-link__label"}){if(!t&&!r)return null;let n=t?(0,xD.__)("Invalid"):(0,xD.__)("Draft");return(0,kD.jsx)("div",{className:w("wp-block-navigation-link__placeholder-text",a,{"is-invalid":t,"is-draft":r}),children:(0,kD.jsx)("span",{children:`${(0,tX.decodeEntities)(e)} (${n})`.trim()})})}var rX=o(V(),1),oX=o(T(),1);function Wv(e){return(0,rX.useSelect)(t=>{let{getSelectedBlockClientId:r,hasSelectedInnerBlock:a,getBlockParentsByBlockName:n}=t(oX.store),i=r(),l=n(e,"core/navigation")[0];return i===l||a(l,!0)},[e])}var F3=o(U(),1),$v=e=>{let[t,r]=(0,F3.useState)(!1);return(0,F3.useEffect)(()=>{let{ownerDocument:a}=e.current;function n(s){l(s)}function i(){r(!1)}function l(s){e.current.contains(s.target)?r(!0):r(!1)}return a.addEventListener("dragstart",n),a.addEventListener("dragend",i),a.addEventListener("dragenter",l),()=>{a.removeEventListener("dragstart",n),a.removeEventListener("dragend",i),a.removeEventListener("dragenter",l)}},[e]),t};function qv(e){e.current.focus();let{ownerDocument:t}=e.current,{defaultView:r}=t,a=r.getSelection(),n=t.createRange();n.selectNodeContents(e.current),a.removeAllRanges(),a.addRange(n)}var Ro=o(v(),1),aX=(0,du.__)("Switch to '%s'"),Kye=["core/navigation-link","core/navigation-submenu"],{PrivateListView:Qye,useBlockDisplayTitle:Yye,PrivateBlockContext:Xye,useListViewPanelState:Jye}=K(fu.privateApis);function e_e({block:e,insertedBlock:t,setInsertedBlock:r}){let{updateBlockAttributes:a,removeBlock:n}=(0,Zv.useDispatch)(fu.store),i=Kye?.includes(t?.name),l=t?.clientId===e.clientId,s=i&&l,{createBinding:c,clearBinding:u}=Ni({clientId:t?.clientId,attributes:t?.attributes||{}});if(!s)return null;let m=()=>{!t?.attributes?.url&&t?.clientId&&n(t.clientId,!1),r(null)},p=f=>h=>{f&&a(f,h)},d=f=>{t?.clientId&&f&&n(t.clientId,!1),r(f)};return(0,Ro.jsx)(pu,{clientId:t?.clientId,link:t?.attributes,onBlockInsert:d,onClose:()=>{m()},onChange:f=>{let{isEntityLink:h,attributes:g}=zv(f,p(t?.clientId),t?.attributes);h?c(g):u(),r(null)}})}var nX=({clientId:e,currentMenuId:t,isLoading:r,isNavigationMenuMissing:a,onCreateNew:n,expandRevision:i})=>{let l=(0,Zv.useSelect)(m=>!!m(fu.store).getBlockCount(e),[e]),{openListViewContentPanel:s}=K((0,Zv.useDispatch)(fu.store)),{navigationMenu:c}=Hh(t);if(t&&a)return(0,Ro.jsx)(I3,{onCreateNew:n,isNotice:!0});if(r)return(0,Ro.jsx)(hu.Spinner,{});let u=c?(0,du.sprintf)((0,du.__)("Structure for Navigation Menu: %s"),c?.title||(0,du.__)("Untitled menu")):(0,du.__)("You have not yet created any menus. Displaying a list of your Pages");return(0,Ro.jsxs)("div",{className:"wp-block-navigation__menu-inspector-controls",children:[!l&&(0,Ro.jsx)("p",{className:"wp-block-navigation__menu-inspector-controls__empty-message",children:(0,du.__)("This Navigation Menu is empty.")}),(0,Ro.jsx)(Qye,{rootClientId:e,isExpanded:!0,description:u,showAppender:!0,blockSettingsMenu:AY,additionalBlockContent:e_e,onSelect:s},`${e}-${i}`)]})},t_e=e=>{let{clientId:t,createNavigationMenuIsSuccess:r,createNavigationMenuIsError:a,currentMenuId:n=null,onCreateNew:i,onSelectClassicMenu:l,onSelectNavigationMenu:s,isManageMenusButtonDisabled:c,blockEditingMode:u}=e,{isSelectionWithinCurrentSection:m}=(0,iX.useContext)(Xye),p=Yye({clientId:t,context:"list-view"}),d=m,{isOpened:f,expandRevision:h,handleToggle:g}=Jye(t);return d?(0,Ro.jsx)(fu.InspectorControls,{group:"list",children:(0,Ro.jsxs)(hu.PanelBody,{title:(0,du.__)("Navigation"),opened:f,onToggle:g,children:[u==="default"&&(0,Ro.jsx)(Bv,{currentMenuId:n,onSelectClassicMenu:l,onSelectNavigationMenu:s,onCreateNew:i,createNavigationMenuIsSuccess:r,createNavigationMenuIsError:a,actionLabel:aX,isManageMenusButtonDisabled:c}),(0,Ro.jsx)(nX,{...e,expandRevision:h})]})}):(0,Ro.jsx)(fu.InspectorControls,{group:"list",children:(0,Ro.jsxs)(hu.PanelBody,{title:null,children:[(0,Ro.jsxs)(hu.__experimentalHStack,{className:"wp-block-navigation-off-canvas-editor__header",children:[(0,Ro.jsx)(hu.__experimentalHeading,{className:"wp-block-navigation-off-canvas-editor__title",level:2,children:p}),u==="default"&&(0,Ro.jsx)(Bv,{currentMenuId:n,onSelectClassicMenu:l,onSelectNavigationMenu:s,onCreateNew:i,createNavigationMenuIsSuccess:r,createNavigationMenuIsError:a,actionLabel:aX,isManageMenusButtonDisabled:c})]}),(0,Ro.jsx)(nX,{...e,expandRevision:h})]})})},H3=t_e;var lX=o(M(),1),wD=o(v(),1);function O3({id:e,children:t}){return(0,wD.jsx)(lX.VisuallyHidden,{children:(0,wD.jsx)("div",{id:e,className:"wp-block-navigation__description",children:t})})}var sX=o(Q(),1),j3=o(P(),1);var cX=o(v(),1);function uX({id:e}){let[t]=(0,sX.useEntityProp)("postType","wp_navigation","title"),r=(0,j3.sprintf)((0,j3.__)('Navigation Menu: "%s"'),t);return(0,cX.jsx)(O3,{id:e,children:r})}var CD=o(V(),1),mX=o(Q(),1);function Kv(){let e=(0,CD.select)("core/editor");if(!e)return!1;let{getCurrentPostType:t,getCurrentPostId:r}=e,{getEditedEntityRecord:a}=(0,CD.select)(mX.store),n=t?.(),i=r?.();return n==="wp_template_part"&&i?a("postType","wp_template_part",i)?.area===ic:!1}var ce=o(v(),1);function r_e({clientId:e}){let{insertBlock:t}=(0,ss.useDispatch)(tt.store),{getBlockCount:r}=(0,ss.useSelect)(tt.store),a=(0,$t.useCallback)(()=>{let n=r(e),i=(0,pX.createBlock)(Pi.name,{kind:Pi.attributes.kind,type:Pi.attributes.type});t(i,n,e)},[e,t,r]);return(0,ce.jsx)(tt.BlockControls,{children:(0,ce.jsx)(Hr.ToolbarGroup,{children:(0,ce.jsx)(Hr.ToolbarButton,{name:"add-page",icon:Fc,onClick:a,children:(0,It.__)("Add page")})})})}function o_e({textColor:e,setTextColor:t,backgroundColor:r,setBackgroundColor:a,overlayTextColor:n,setOverlayTextColor:i,overlayBackgroundColor:l,setOverlayBackgroundColor:s,clientId:c,navRef:u,hasCustomOverlay:m}){let[p,d]=(0,$t.useState)(),[f,h]=(0,$t.useState)(),[g,b]=(0,$t.useState)(),[y,k]=(0,$t.useState)(),_=(0,ss.useSelect)(()=>Kv(),[]),x=$t.Platform.OS==="web";(0,$t.useEffect)(()=>{if(!x)return;eD(u.current,h,d);let N=u.current?.querySelector('[data-type="core/navigation-submenu"] [data-type="core/navigation-link"]');N&&(n.color||l.color)&&eD(N,k,b)},[x,n.color,l.color,u]);let S=(0,tt.__experimentalUseMultipleOriginColorsAndGradients)();if(!S.hasColorsOrGradients)return null;let C=[{colorValue:e.color,label:(0,It.__)("Text"),onColorChange:t,resetAllFilter:()=>t(),clearable:!0,enableAlpha:!0},{colorValue:r.color,label:(0,It.__)("Background"),onColorChange:a,resetAllFilter:()=>a(),clearable:!0,enableAlpha:!0}];return C.push({colorValue:n.color,label:m||_?(0,It.__)("Submenu text"):(0,It.__)("Submenu & overlay text"),onColorChange:i,resetAllFilter:()=>i(),clearable:!0,enableAlpha:!0},{colorValue:l.color,label:m||_?(0,It.__)("Submenu background"):(0,It.__)("Submenu & overlay background"),onColorChange:s,resetAllFilter:()=>s(),clearable:!0,enableAlpha:!0}),(0,ce.jsxs)(ce.Fragment,{children:[(0,ce.jsx)(tt.__experimentalColorGradientSettingsDropdown,{__experimentalIsRenderedInSidebar:!0,settings:C,panelId:c,...S,gradients:[],disableCustomGradients:!0}),x&&(0,ce.jsxs)(ce.Fragment,{children:[(0,ce.jsx)(tt.ContrastChecker,{backgroundColor:p,textColor:f}),(0,ce.jsx)(tt.ContrastChecker,{backgroundColor:g,textColor:y})]})]})}function a_e({attributes:e,setAttributes:t,clientId:r,isSelected:a,className:n,backgroundColor:i,setBackgroundColor:l,textColor:s,setTextColor:c,overlayBackgroundColor:u,setOverlayBackgroundColor:m,overlayTextColor:p,setOverlayTextColor:d,customPlaceholder:f=null,__unstableLayoutClassNames:h}){let{submenuVisibility:g,overlayMenu:b,overlay:y,showSubmenuIcon:k,templateLock:_,layout:{justifyContent:x,orientation:S="horizontal",flexWrap:C="wrap"}={},hasIcon:N,icon:B="handle"}=e,D=e.ref,A=(0,$t.useCallback)(tr=>{t({ref:tr})},[t]);(0,$t.useEffect)(()=>{S==="horizontal"&&g==="always"&&t({submenuVisibility:"hover",showSubmenuIcon:!0})},[S,g,t]);let H=`navigationMenu/${D}`,F=(0,tt.useHasRecursion)(H),{isPreviewMode:z,onNavigateToEntityRecord:I,currentTheme:R}=(0,ss.useSelect)(tr=>{let{getSettings:Tl}=tr(tt.store),Bs=Tl();return{isPreviewMode:Bs.isPreviewMode,onNavigateToEntityRecord:Bs?.onNavigateToEntityRecord,currentTheme:tr(Td.store).getCurrentTheme()?.stylesheet}},[]),$=z?!1:F,j=(0,tt.useBlockEditingMode)(),{menus:G}=Oh(),[O,J]=l3({name:"block-library/core/navigation/status"}),[ee,oe]=l3({name:"block-library/core/navigation/classic-menu-conversion"}),[X,te]=l3({name:"block-library/core/navigation/permissions/update"}),{create:ne,status:le,error:pe,value:Ie,isPending:Ne,isSuccess:ae,isError:Re}=SY(r),Ee=async()=>{await ne("")},{hasUncontrolledInnerBlocks:ie,uncontrolledInnerBlocks:fe,isInnerBlockSelected:ke,innerBlocks:je}=BY(r),de=(0,$t.useRef)(!1),ct=(0,ss.useSelect)(tr=>{if(je.some(kf=>kf.name==="core/navigation-submenu"))return!0;let Bs=je.find(kf=>kf.name==="core/page-list");if(!Bs)return de.current=!1,!1;if(de.current)return!0;let{getBlocks:U7}=tr(tt.store);return U7(Bs.clientId).length>0?(de.current=!0,!0):!1},[je]),{records:at}=(0,Td.useEntityRecords)("postType","wp_template_part",{per_page:-1}),kt=at?.some(tr=>tr.area===ic)??!1,{replaceInnerBlocks:Wr,selectBlock:ut,__unstableMarkNextChangeAsNotPersistent:br}=(0,ss.useDispatch)(tt.store),[mt,wo]=(0,$t.useState)(!1),[Y,ze]=(0,$t.useState)(!1),{hasResolvedNavigationMenus:Me,isNavigationMenuResolved:Xe,isNavigationMenuMissing:Te,canUserUpdateNavigationMenu:Bt,hasResolvedCanUserUpdateNavigationMenu:yr,canUserDeleteNavigationMenu:xn,hasResolvedCanUserDeleteNavigationMenu:Je,canUserCreateNavigationMenus:$r,isResolvingCanUserCreateNavigationMenus:ip,hasResolvedCanUserCreateNavigationMenus:Cs}=Hh(D),Ru=Me&&Te,{convert:kn,status:ja,error:gf}=uY(ne),zu=ja===k3,Ss=(0,$t.useCallback)((tr,Tl={focusNavigationBlock:!1})=>{let{focusNavigationBlock:Bs}=Tl;A(tr),Bs&&ut(r)},[ut,r,A]),Ts=!Te&&Xe,Pe=ie&&!Ts,{getNavigationFallbackId:Ht}=K((0,ss.useSelect)(Td.store)),qr=D||Pe?null:Ht();(0,$t.useEffect)(()=>{D||Pe||!qr||(br(),A(qr))},[D,A,Pe,qr,br]);let Co=(0,$t.useRef)(),So=(0,ss.useSelect)(()=>Kv(),[]),Sl=So?"div":"nav",qi=!D&&!Ne&&!zu&&Me&&G?.length===0&&!ie,Zi=!Me||Ne||zu||!!(D&&!Ts&&!zu),vf=e.style?.typography?.textDecoration,zc=(0,ss.useSelect)(tr=>tr(tt.store).__unstableHasActiveBlockOverlayActive(r),[r]),Ps=(0,$t.useRef)(!1);(0,$t.useEffect)(()=>{So&&(b!=="never"&&t({overlayMenu:"never"}),!Ps.current&&!D&&(Ps.current=!0,t({submenuVisibility:"always",layout:{...e.layout,orientation:"vertical"},showSubmenuIcon:!1})))},[e.layout,So,b,D,t]);let bf=b!=="never",lp=(0,tt.useBlockProps)({ref:Co,className:w(n,{"items-justified-right":x==="right","items-justified-space-between":x==="space-between","items-justified-left":x==="left","items-justified-center":x==="center","is-vertical":S==="vertical","no-wrap":C==="nowrap","is-responsive":bf,"has-text-color":!!s.color||!!s?.class,[(0,tt.getColorClassName)("color",s?.slug)]:!!s?.slug,"has-background":!!i.color||i.class,[(0,tt.getColorClassName)("background-color",i?.slug)]:!!i?.slug,[`has-text-decoration-${vf}`]:vf,"block-editor-block-content-overlay":zc},h),style:{color:!s?.slug&&s?.color,backgroundColor:!i?.slug&&i?.color}}),sp=async tr=>kn(tr.id,tr.name,"draft"),yf=tr=>{Ss(tr)};(0,$t.useEffect)(()=>{J(),Ne&&(0,U3.speak)((0,It.__)("Creating Navigation Menu.")),ae&&(Ss(Ie?.id,{focusNavigationBlock:!0}),O((0,It.__)("Navigation Menu successfully created."))),Re&&O((0,It.__)("Failed to create Navigation Menu."))},[le,pe,Ie?.id,Re,ae,Ne,Ss,J,O]),(0,$t.useEffect)(()=>{oe(),ja===k3&&(0,U3.speak)((0,It.__)("Classic menu importing.")),ja===lD&&(ee((0,It.__)("Classic menu imported successfully.")),Ss(Ie?.id,{focusNavigationBlock:!0})),ja===_3&&ee((0,It.__)("Classic menu import failed."))},[ja,gf,oe,ee,Ie?.id,Ss]),(0,$t.useEffect)(()=>{!a&&!ke&&te(),(a||ke)&&(D&&!Ru&&yr&&!Bt&&X((0,It.__)("You do not have permission to edit this Menu. Any changes made will not be saved.")),!D&&Cs&&!$r&&X((0,It.__)("You do not have permission to create Navigation Menus.")))},[a,ke,Bt,yr,$r,Cs,D,te,X,Ru]);let j7=$r||Bt,_b=w("wp-block-navigation__overlay-menu-preview",{open:Y}),Vc=!k&&g!=="click"&&g!=="always"?(0,It.__)('The current menu options offer reduced accessibility for users and are not recommended. Enabling either "Open on Click" or "Show arrow" offers enhanced accessibility by allowing keyboard users to browse submenus selectively.'):"",xb=(0,$t.useRef)(!0);(0,$t.useEffect)(()=>{!xb.current&&Vc&&(0,U3.speak)(Vc),xb.current=!1},[Vc]);let p0=(0,dX.useInstanceId)(IQ,"overlay-menu-preview"),kb=q(),_f=(0,ce.jsxs)(ce.Fragment,{children:[(0,ce.jsx)(tt.InspectorControls,{children:ct&&(0,ce.jsx)(Hr.__experimentalToolsPanel,{label:(0,It.__)("Display"),resetAll:()=>{t({showSubmenuIcon:!0,submenuVisibility:"hover",overlayMenu:"mobile",hasIcon:!0,icon:"handle"})},dropdownMenuProps:kb,children:ct&&(0,ce.jsxs)(ce.Fragment,{children:[(0,ce.jsx)("h3",{className:"wp-block-navigation__submenu-header",children:(0,It.__)("Submenus")}),(0,ce.jsx)(Hr.__experimentalToolsPanelItem,{hasValue:()=>g!=="hover",label:(0,It.__)("Submenu Visibility"),onDeselect:()=>t({submenuVisibility:"hover"}),isShownByDefault:!0,children:(0,ce.jsxs)(Hr.__experimentalToggleGroupControl,{__next40pxDefaultSize:!0,label:(0,It.__)("Submenu Visibility"),value:g,onChange:tr=>{let Tl={submenuVisibility:tr};tr==="always"?Tl.showSubmenuIcon=!1:(tr==="click"||g==="always")&&(Tl.showSubmenuIcon=!0),t(Tl)},isBlock:!0,children:[(0,ce.jsx)(Hr.__experimentalToggleGroupControlOption,{value:"hover",label:(0,It.__)("Hover")}),(0,ce.jsx)(Hr.__experimentalToggleGroupControlOption,{value:"click",label:(0,It.__)("Click")}),S==="vertical"&&(0,ce.jsx)(Hr.__experimentalToggleGroupControlOption,{value:"always",label:(0,It.__)("Always")})]})}),(0,ce.jsx)(Hr.__experimentalToolsPanelItem,{hasValue:()=>!k,label:(0,It.__)("Show arrow"),onDeselect:()=>t({showSubmenuIcon:!0}),isDisabled:g==="click"||g==="always",isShownByDefault:!0,children:(0,ce.jsx)(Hr.ToggleControl,{checked:k,onChange:tr=>{t({showSubmenuIcon:tr})},disabled:g==="click"||g==="always",label:(0,It.__)("Show arrow")})}),Vc&&(0,ce.jsx)(Hr.Notice,{spokenMessage:null,status:"warning",isDismissible:!1,className:"wp-block-navigation__submenu-accessibility-notice",children:Vc})]})})}),!So&&(0,ce.jsx)(tt.InspectorControls,{children:(0,ce.jsx)(aY,{overlayMenu:b,overlay:y,setAttributes:t,onNavigateToEntityRecord:I,overlayMenuPreview:Y,setOverlayMenuPreview:ze,hasIcon:N,icon:B,overlayMenuPreviewClasses:_b,overlayMenuPreviewId:p0,isResponsive:bf,currentTheme:R,hasOverlays:kt})}),(0,ce.jsx)(tt.InspectorControls,{group:"color",children:(0,ce.jsx)(o_e,{textColor:s,setTextColor:c,backgroundColor:i,setBackgroundColor:l,overlayTextColor:p,setOverlayTextColor:d,overlayBackgroundColor:u,setOverlayBackgroundColor:m,clientId:r,navRef:Co,hasCustomOverlay:!!y})})]}),cp=`${r}-desc`,xf=b==="always",up=!j7||!Me;if(Pe&&!Ne)return(0,ce.jsxs)(ce.Fragment,{children:[(0,ce.jsx)(H3,{clientId:r,createNavigationMenuIsSuccess:ae,createNavigationMenuIsError:Re,currentMenuId:D,isNavigationMenuMissing:Te,isManageMenusButtonDisabled:up,onCreateNew:Ee,onSelectClassicMenu:sp,onSelectNavigationMenu:yf,isLoading:Zi,blockEditingMode:j}),j==="default"&&_f,(0,ce.jsxs)(Sl,{...lp,"aria-describedby":qi?void 0:cp,children:[(0,ce.jsx)(O3,{id:cp,children:(0,It.__)("Unsaved Navigation Menu.")}),(0,ce.jsx)(QE,{id:r,onToggle:wo,isOpen:mt,hasIcon:N,icon:B,isResponsive:bf,isHiddenByDefault:xf,overlayBackgroundColor:u,overlayTextColor:p,overlay:y,onNavigateToEntityRecord:I,children:(0,ce.jsx)(wQ,{createNavigationMenu:ne,blocks:fe,hasSelection:a||ke})})]})]});if(D&&Te)return(0,ce.jsxs)(ce.Fragment,{children:[(0,ce.jsx)(H3,{clientId:r,createNavigationMenuIsSuccess:ae,createNavigationMenuIsError:Re,currentMenuId:D,isNavigationMenuMissing:Te,isManageMenusButtonDisabled:up,onCreateNew:Ee,onSelectClassicMenu:sp,onSelectNavigationMenu:yf,isLoading:Zi,blockEditingMode:j}),(0,ce.jsx)(Sl,{...lp,children:(0,ce.jsx)(I3,{onCreateNew:Ee})})]});if(Ts&&$)return(0,ce.jsx)("div",{...lp,children:(0,ce.jsx)(tt.Warning,{children:(0,It.__)("Block cannot be rendered inside itself.")})});let wb=f||nQ;return qi&&f?(0,ce.jsx)(Sl,{...lp,children:(0,ce.jsx)(wb,{isSelected:a,currentMenuId:D,clientId:r,canUserCreateNavigationMenus:$r,isResolvingCanUserCreateNavigationMenus:ip,onSelectNavigationMenu:yf,onSelectClassicMenu:sp,onCreateEmpty:Ee})}):(0,ce.jsxs)(ce.Fragment,{children:[(0,ce.jsx)(H3,{clientId:r,createNavigationMenuIsSuccess:ae,createNavigationMenuIsError:Re,currentMenuId:D,isNavigationMenuMissing:Te,isManageMenusButtonDisabled:up,onCreateNew:Ee,onSelectClassicMenu:sp,onSelectNavigationMenu:yf,isLoading:Zi,blockEditingMode:j}),j==="default"&&_f,(0,ce.jsx)(Td.EntityProvider,{kind:"postType",type:"wp_navigation",id:D,children:(0,ce.jsxs)(tt.RecursionProvider,{uniqueId:H,children:[j==="contentOnly"&&Ts&&(0,ce.jsx)(r_e,{clientId:r}),j==="default"&&Ts&&(0,ce.jsxs)(tt.InspectorControls,{group:"advanced",children:[yr&&Bt&&(0,ce.jsx)(gQ,{}),Je&&xn&&(0,ce.jsx)(TQ,{onDelete:()=>{Wr(r,[]),O((0,It.__)("Navigation Menu successfully deleted."))}}),(0,ce.jsx)(DY,{disabled:up,className:"wp-block-navigation-manage-menus-button"})]}),(0,ce.jsxs)(Sl,{...lp,"aria-describedby":!qi&&!Zi?cp:void 0,children:[Zi&&!xf&&(0,ce.jsx)("div",{className:"wp-block-navigation__loading-indicator-container",children:(0,ce.jsx)(Hr.Spinner,{className:"wp-block-navigation__loading-indicator"})}),(!Zi||xf)&&(0,ce.jsxs)(ce.Fragment,{children:[(0,ce.jsx)(uX,{id:cp}),(0,ce.jsx)(QE,{id:r,onToggle:wo,hasIcon:N,icon:B,isOpen:mt,isResponsive:bf,isHiddenByDefault:xf,overlayBackgroundColor:u,overlayTextColor:p,overlay:y,onNavigateToEntityRecord:I,children:Ts&&(0,ce.jsx)(mQ,{clientId:r,hasCustomPlaceholder:!!f,templateLock:_,orientation:S})})]})]})]})})]})}var fX=(0,tt.withColors)({textColor:"color"},{backgroundColor:"color"},{overlayBackgroundColor:"color"},{overlayTextColor:"color"})(a_e);var hX=o(T(),1),gX=o(v(),1);function vX({attributes:e}){if(!e.ref)return(0,gX.jsx)(hX.InnerBlocks.Content,{})}var Nm=o(T(),1),tg=o(me(),1);var Em=o(v(),1),SD={fontStyle:"var:preset|font-style|",fontWeight:"var:preset|font-weight|",textDecoration:"var:preset|text-decoration|",textTransform:"var:preset|text-transform|"},rg=({navigationMenuId:e,...t})=>({...t,ref:e}),G3=e=>{if(e.layout)return e;let{itemsJustification:t,orientation:r,...a}=e;return(t||r)&&Object.assign(a,{layout:{type:"flex",...t&&{justifyContent:t},...r&&{orientation:r}}}),a},W3=e=>{let{openSubmenusOnClick:t,...r}=e;return t==null?e:{...r,submenuVisibility:r.submenuVisibility??(t?"click":"hover")}},n_e={attributes:{ref:{type:"number"},textColor:{type:"string"},customTextColor:{type:"string"},rgbTextColor:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},rgbBackgroundColor:{type:"string"},showSubmenuIcon:{type:"boolean",default:!0},openSubmenusOnClick:{type:"boolean",default:!1},overlayMenu:{type:"string",default:"mobile"},icon:{type:"string",default:"handle"},hasIcon:{type:"boolean",default:!0},__unstableLocation:{type:"string"},overlayBackgroundColor:{type:"string"},customOverlayBackgroundColor:{type:"string"},overlayTextColor:{type:"string"},customOverlayTextColor:{type:"string"},maxNestingLevel:{type:"number",default:5},templateLock:{type:["string","boolean"],enum:["all","insert","contentOnly",!1]}},supports:{align:["wide","full"],anchor:!0,html:!1,inserter:!0,typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalTextTransform:!0,__experimentalFontFamily:!0,__experimentalLetterSpacing:!0,__experimentalTextDecoration:!0,__experimentalSkipSerialization:["textDecoration"],__experimentalDefaultControls:{fontSize:!0}},spacing:{blockGap:!0,units:["px","em","rem","vh","vw"],__experimentalDefaultControls:{blockGap:!0}},layout:{allowSwitching:!1,allowInheriting:!1,allowVerticalAlignment:!1,allowSizingOnChildren:!0,default:{type:"flex"}},interactivity:!0,renaming:!1},save(){return(0,Em.jsx)(Nm.InnerBlocks.Content,{})},isEligible:({openSubmenusOnClick:e})=>e!=null,migrate:W3},i_e={attributes:{navigationMenuId:{type:"number"},textColor:{type:"string"},customTextColor:{type:"string"},rgbTextColor:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},rgbBackgroundColor:{type:"string"},showSubmenuIcon:{type:"boolean",default:!0},overlayMenu:{type:"string",default:"mobile"},__unstableLocation:{type:"string"},overlayBackgroundColor:{type:"string"},customOverlayBackgroundColor:{type:"string"},overlayTextColor:{type:"string"},customOverlayTextColor:{type:"string"}},supports:{align:["wide","full"],anchor:!0,html:!1,inserter:!0,typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalTextTransform:!0,__experimentalFontFamily:!0,__experimentalTextDecoration:!0,__experimentalDefaultControls:{fontSize:!0}},spacing:{blockGap:!0,units:["px","em","rem","vh","vw"],__experimentalDefaultControls:{blockGap:!0}},layout:{allowSwitching:!1,allowInheriting:!1,default:{type:"flex"}}},save(){return(0,Em.jsx)(Nm.InnerBlocks.Content,{})},isEligible:({navigationMenuId:e})=>!!e,migrate:rg},l_e={attributes:{navigationMenuId:{type:"number"},orientation:{type:"string",default:"horizontal"},textColor:{type:"string"},customTextColor:{type:"string"},rgbTextColor:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},rgbBackgroundColor:{type:"string"},itemsJustification:{type:"string"},showSubmenuIcon:{type:"boolean",default:!0},openSubmenusOnClick:{type:"boolean",default:!1},overlayMenu:{type:"string",default:"never"},__unstableLocation:{type:"string"},overlayBackgroundColor:{type:"string"},customOverlayBackgroundColor:{type:"string"},overlayTextColor:{type:"string"},customOverlayTextColor:{type:"string"}},supports:{align:["wide","full"],anchor:!0,html:!1,inserter:!0,typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalTextTransform:!0,__experimentalFontFamily:!0,__experimentalTextDecoration:!0,__experimentalDefaultControls:{fontSize:!0}},spacing:{blockGap:!0,units:["px","em","rem","vh","vw"],__experimentalDefaultControls:{blockGap:!0}}},save(){return(0,Em.jsx)(Nm.InnerBlocks.Content,{})},isEligible:({itemsJustification:e,orientation:t})=>!!e||!!t,migrate:(0,tg.compose)(rg,G3,W3)},s_e={attributes:{orientation:{type:"string",default:"horizontal"},textColor:{type:"string"},customTextColor:{type:"string"},rgbTextColor:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},rgbBackgroundColor:{type:"string"},itemsJustification:{type:"string"},showSubmenuIcon:{type:"boolean",default:!0},openSubmenusOnClick:{type:"boolean",default:!1},overlayMenu:{type:"string",default:"never"},__unstableLocation:{type:"string"},overlayBackgroundColor:{type:"string"},customOverlayBackgroundColor:{type:"string"},overlayTextColor:{type:"string"},customOverlayTextColor:{type:"string"}},supports:{align:["wide","full"],anchor:!0,html:!1,inserter:!0,typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalTextTransform:!0,__experimentalFontFamily:!0,__experimentalTextDecoration:!0},spacing:{blockGap:!0,units:["px","em","rem","vh","vw"],__experimentalDefaultControls:{blockGap:!0}}},save(){return(0,Em.jsx)(Nm.InnerBlocks.Content,{})},migrate:(0,tg.compose)(rg,G3,Ot,W3),isEligible({style:e}){return e?.typography?.fontFamily}},c_e=function(e){return delete e.isResponsive,{...e,overlayMenu:"mobile"}},u_e=function(e){return{...e,style:{...e.style,typography:Object.fromEntries(Object.entries(e.style.typography??{}).map(([t,r])=>{let a=SD[t];if(a&&r.startsWith(a)){let n=r.slice(a.length);return t==="textDecoration"&&n==="strikethrough"?[t,"line-through"]:[t,n]}return[t,r]}))}}},m_e=[n_e,i_e,l_e,s_e,{attributes:{orientation:{type:"string",default:"horizontal"},textColor:{type:"string"},customTextColor:{type:"string"},rgbTextColor:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},rgbBackgroundColor:{type:"string"},itemsJustification:{type:"string"},showSubmenuIcon:{type:"boolean",default:!0},openSubmenusOnClick:{type:"boolean",default:!1},isResponsive:{type:"boolean",default:"false"},__unstableLocation:{type:"string"},overlayBackgroundColor:{type:"string"},customOverlayBackgroundColor:{type:"string"},overlayTextColor:{type:"string"},customOverlayTextColor:{type:"string"}},supports:{align:["wide","full"],anchor:!0,html:!1,inserter:!0,typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalTextTransform:!0,__experimentalFontFamily:!0,__experimentalTextDecoration:!0}},isEligible(e){return e.isResponsive},migrate:(0,tg.compose)(rg,G3,Ot,c_e,W3),save(){return(0,Em.jsx)(Nm.InnerBlocks.Content,{})}},{attributes:{orientation:{type:"string"},textColor:{type:"string"},customTextColor:{type:"string"},rgbTextColor:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},rgbBackgroundColor:{type:"string"},itemsJustification:{type:"string"},showSubmenuIcon:{type:"boolean",default:!0}},supports:{align:["wide","full"],anchor:!0,html:!1,inserter:!0,fontSize:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalTextTransform:!0,color:!0,__experimentalFontFamily:!0,__experimentalTextDecoration:!0},save(){return(0,Em.jsx)(Nm.InnerBlocks.Content,{})},isEligible(e){if(!e.style||!e.style.typography)return!1;for(let t in SD){let r=e.style.typography[t];if(r&&r.startsWith(SD[t]))return!0}return!1},migrate:(0,tg.compose)(rg,G3,Ot,u_e)},{attributes:{className:{type:"string"},textColor:{type:"string"},rgbTextColor:{type:"string"},backgroundColor:{type:"string"},rgbBackgroundColor:{type:"string"},fontSize:{type:"string"},customFontSize:{type:"number"},itemsJustification:{type:"string"},showSubmenuIcon:{type:"boolean"}},isEligible(e){return e.rgbTextColor||e.rgbBackgroundColor},supports:{align:["wide","full"],anchor:!0,html:!1,inserter:!0},migrate:(0,tg.compose)(rg,e=>{let{rgbTextColor:t,rgbBackgroundColor:r,...a}=e;return{...a,customTextColor:e.textColor?void 0:e.rgbTextColor,customBackgroundColor:e.backgroundColor?void 0:e.rgbBackgroundColor}}),save(){return(0,Em.jsx)(Nm.InnerBlocks.Content,{})}}],bX=m_e;var{name:kX}=e3,wX={icon:Tp,example:{attributes:{overlayMenu:"never"},innerBlocks:[{name:"core/navigation-link",attributes:{label:(0,$3.__)("Home"),url:"https://make.wordpress.org/"}},{name:"core/navigation-link",attributes:{label:(0,$3.__)("About"),url:"https://make.wordpress.org/"}},{name:"core/navigation-link",attributes:{label:(0,$3.__)("Contact"),url:"https://make.wordpress.org/"}}]},edit:fX,save:vX,__experimentalLabel:({ref:e})=>{if(!e)return;let t=(0,yX.select)(_X.store).getEditedEntityRecord("postType","wp_navigation",e);if(t?.title)return(0,xX.decodeEntities)(t.title)},deprecated:bX},p_e=()=>E({name:kX,metadata:e3,settings:wX});var BD={};Z(BD,{init:()=>x_e,metadata:()=>q3,name:()=>LX,settings:()=>X3});var Dm=o(P(),1);var IX=o(T(),1),NX=o(Yc(),1),EX=o(W(),1);var q3={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/navigation-link",title:"Custom Link",category:"design",parent:["core/navigation"],allowedBlocks:["core/navigation-link","core/navigation-submenu","core/page-list"],description:"Add a page, link, or another item to your navigation.",textdomain:"default",attributes:{label:{type:"string",role:"content"},type:{type:"string"},description:{type:"string"},rel:{type:"string"},id:{type:"number"},opensInNewTab:{type:"boolean",default:!1},url:{type:"string",role:"content"},title:{type:"string"},kind:{type:"string"},isTopLevelLink:{type:"boolean"}},usesContext:["textColor","customTextColor","backgroundColor","customBackgroundColor","overlayTextColor","customOverlayTextColor","overlayBackgroundColor","customOverlayBackgroundColor","fontSize","customFontSize","showSubmenuIcon","maxNestingLevel","style"],supports:{anchor:!0,reusable:!1,html:!1,__experimentalSlashInserter:!0,typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},renaming:!1,interactivity:{clientNavigation:!0}},editorStyle:"wp-block-navigation-link-editor",style:"wp-block-navigation-link"};var Z3=o(W(),1),Qv=o(V(),1),Pd=o(M(),1),K3=o(As(),1),pl=o(P(),1),la=o(T(),1),Q3=o(mr(),1),cn=o(U(),1);var Y3=o(me(),1);var nr=o(v(),1),f_e={name:"core/navigation-link"},h_e=["core/navigation-link","core/navigation-submenu"];function g_e(e){let t="";switch(e){case"post":t=(0,pl.__)("Select post");break;case"page":t=(0,pl.__)("Select page");break;case"category":t=(0,pl.__)("Select category");break;case"tag":t=(0,pl.__)("Select tag");break;default:t=(0,pl.__)("Add link")}return t}function PD({attributes:e,isSelected:t,setAttributes:r,insertBlocksAfter:a,mergeBlocks:n,onReplace:i,context:l,clientId:s}){let{id:c,label:u,type:m,url:p,description:d,kind:f,metadata:h}=e,{maxNestingLevel:g}=l,{replaceBlock:b,__unstableMarkNextChangeAsNotPersistent:y,selectBlock:k}=(0,Qv.useDispatch)(la.store),[_,x]=(0,cn.useState)(t&&!p),[S,C]=(0,cn.useState)(null),N=(0,cn.useRef)(null),B=$v(N),D=(0,pl.__)("Add label\u2026"),A=(0,cn.useRef)(),H=(0,cn.useRef)(),F=(0,cn.useRef)(u===void 0),z=(0,cn.useRef)(!1),{isAtMaxNesting:I,isTopLevelLink:R,isParentOfSelectedBlock:$,hasChildren:j,parentBlockClientId:G,isSubmenu:O}=(0,Qv.useSelect)(mt=>{let{getBlockCount:wo,getBlockName:Y,getBlockRootClientId:ze,hasSelectedInnerBlock:Me,getBlockParentsByBlockName:Xe}=mt(la.store),Te=ze(s),Bt=Y(Te),yr=Bt==="core/navigation",xn=yr?Te:Xe(s,"core/navigation")[0],Je=Bt==="core/navigation-submenu"?Te:xn;return{isAtMaxNesting:Xe(s,h_e).length>=g,isTopLevelLink:yr,isParentOfSelectedBlock:Me(s,!0),hasChildren:!!wo(s),parentBlockClientId:Je,isSubmenu:Bt==="core/navigation-submenu"}},[s,g]),J=Wv(s),{getBlocks:ee}=(0,Qv.useSelect)(la.store),{hasUrlBinding:oe,isBoundEntityAvailable:X,entityRecord:te}=Ni({clientId:s,attributes:e}),ne=Cd({clientId:s,attributes:e,setAttributes:r,allowTextUpdate:!0}),[le,pe]=Sd(f,m,c,J),Ie=(0,cn.useCallback)(()=>{let mt=ee(s);mt.length===0&&(mt=[(0,Z3.createBlock)("core/navigation-link")],k(mt[0].clientId));let wo=(0,Z3.createBlock)("core/navigation-submenu",e,mt);b(s,wo)},[ee,s,k,b,e]);(0,cn.useEffect)(()=>{F.current&&t&&k(G)},[]),(0,cn.useEffect)(()=>{j&&(y(),Ie())},[j,y,Ie]),(0,cn.useEffect)(()=>{if(!(!F.current||!p||!_)){if(F.current=!1,(0,Q3.isURL)((0,Q3.prependHTTP)(u))&&/^.+\.[a-z]+/.test(u))qv(A);else if(k(s,null),O){let mt=ee(G);mt.length===1&&mt[0].clientId===s&&(z.current=!0)}}},[p,_,F,u]);function Ne(){r({url:void 0,label:void 0,id:void 0,kind:void 0,type:void 0,opensInNewTab:!1}),x(!1)}let{textColor:ae,customTextColor:Re,backgroundColor:Ee,customBackgroundColor:ie}=_d(l,!R);function fe(mt){K3.isKeyboardEvent.primary(mt,"k")&&(mt.preventDefault(),mt.stopPropagation(),x(!0))}let ke=(0,Y3.useInstanceId)(PD),je=oe&&!X,de=je?(0,pl.sprintf)("navigation-link-edit-%d-desc",ke):void 0,ct=(0,la.useBlockProps)({ref:(0,Y3.useMergeRefs)([C,N]),className:w("wp-block-navigation-item",{"is-editing":t||$,"is-dragging-within":B,"has-link":!!p,"has-child":j,"has-text-color":!!ae||!!Re,[(0,la.getColorClassName)("color",ae)]:!!ae,"has-background":!!Ee||ie,[(0,la.getColorClassName)("background-color",Ee)]:!!Ee}),"aria-describedby":de,"aria-invalid":je,style:{color:!ae&&Re,backgroundColor:!Ee&&ie},onKeyDown:fe}),at=(0,la.useInnerBlocksProps)({...ct,className:"remove-outline"},{defaultBlock:f_e,directInsert:!0,renderAppender:!1}),kt=!p&&!(oe&&X)||le||pe||oe&&!X;kt&&(ct.onClick=()=>{x(!0)});let Wr=w("wp-block-navigation-item__content",{"wp-block-navigation-link__placeholder":kt}),ut=g_e(m),br=V3();return(0,nr.jsxs)(nr.Fragment,{children:[(0,nr.jsx)(la.BlockControls,{children:(0,nr.jsxs)(Pd.ToolbarGroup,{children:[(0,nr.jsx)(Pd.ToolbarButton,{name:"link",icon:ii,title:(0,pl.__)("Link"),shortcut:K3.displayShortcut.primary("k"),onClick:()=>{x(!0)}}),!I&&(0,nr.jsx)(Pd.ToolbarButton,{name:"submenu",icon:vp,title:(0,pl.__)("Add submenu"),onClick:Ie})]})}),(0,nr.jsx)(la.InspectorControls,{group:"content",children:(0,nr.jsx)(Uv,{attributes:e,setAttributes:r,clientId:s})}),(0,nr.jsxs)("div",{...ct,children:[je&&(0,nr.jsx)(Pd.VisuallyHidden,{id:de,children:br}),(0,nr.jsxs)("a",{className:Wr,children:[!p&&!h?.bindings?.url?(0,nr.jsx)("div",{className:"wp-block-navigation-link__placeholder-text",children:(0,nr.jsx)("span",{children:ut})}):(0,nr.jsxs)(nr.Fragment,{children:[!le&&!pe&&(0,nr.jsxs)(nr.Fragment,{children:[(0,nr.jsx)(la.RichText,{ref:A,identifier:"label",className:"wp-block-navigation-item__label",value:u,onChange:mt=>r({label:mt}),onMerge:n,onReplace:i,__unstableOnSplitAtEnd:()=>a((0,Z3.createBlock)("core/navigation-link")),"aria-label":(0,pl.__)("Navigation link text"),placeholder:D,withoutInteractiveFormatting:!0}),d&&(0,nr.jsx)("span",{className:"wp-block-navigation-item__description",children:d})]}),(le||pe)&&(0,nr.jsx)(Gv,{label:u,isInvalid:le,isDraft:pe,className:"wp-block-navigation-link__label"})]}),_&&(0,nr.jsx)(pu,{ref:H,clientId:s,link:e,entity:{entityRecord:te,hasBinding:oe,isEntityAvailable:X},onClose:()=>{if(x(!1),!p&&!oe){i([]);return}if(z.current&&(z.current=!1,N.current?.nextElementSibling)){let mt=N.current.nextElementSibling.querySelector(".block-editor-button-block-appender");mt&&mt.focus()}},anchor:S,onRemove:Ne,onChange:ne})]}),(0,nr.jsx)("div",{...at})]})]})}var CX=o(T(),1),SX=o(v(),1);function TX(){return(0,SX.jsx)(CX.InnerBlocks.Content,{})}function v_e(e){switch(e){case"post":return t1;case"page":return Fc;case"tag":return f1;case"category":return Gu;default:return S9}}function PX(e,t){if(t!=="core/navigation-link")return e;if(e.variations){let r=(n,i)=>n.type===i.type,a=e.variations.map(n=>({...n,...!n.icon&&{icon:v_e(n.name)},...!n.isActive&&{isActive:r}}));return{...e,variations:a}}return e}var sa=o(W(),1),b_e={from:[{type:"block",blocks:["core/site-logo"],transform:()=>(0,sa.createBlock)("core/navigation-link")},{type:"block",blocks:["core/spacer"],transform:()=>(0,sa.createBlock)("core/navigation-link")},{type:"block",blocks:["core/home-link"],transform:()=>(0,sa.createBlock)("core/navigation-link")},{type:"block",blocks:["core/social-links"],transform:()=>(0,sa.createBlock)("core/navigation-link")},{type:"block",blocks:["core/search"],transform:()=>(0,sa.createBlock)("core/navigation-link")},{type:"block",blocks:["core/page-list"],transform:()=>(0,sa.createBlock)("core/navigation-link")},{type:"block",blocks:["core/buttons"],transform:()=>(0,sa.createBlock)("core/navigation-link")}],to:[{type:"block",blocks:["core/navigation-submenu"],transform:(e,t)=>(0,sa.createBlock)("core/navigation-submenu",e,t)},{type:"block",blocks:["core/spacer"],transform:()=>(0,sa.createBlock)("core/spacer")},{type:"block",blocks:["core/site-logo"],transform:()=>(0,sa.createBlock)("core/site-logo")},{type:"block",blocks:["core/home-link"],transform:()=>(0,sa.createBlock)("core/home-link")},{type:"block",blocks:["core/social-links"],transform:()=>(0,sa.createBlock)("core/social-links")},{type:"block",blocks:["core/search"],transform:()=>(0,sa.createBlock)("core/search",{showLabel:!1,buttonUseIcon:!0,buttonPosition:"button-inside"})},{type:"block",blocks:["core/page-list"],transform:()=>(0,sa.createBlock)("core/page-list")},{type:"block",blocks:["core/buttons"],transform:({label:e,url:t,rel:r,title:a,opensInNewTab:n})=>(0,sa.createBlock)("core/buttons",{},[(0,sa.createBlock)("core/button",{text:e,url:t,rel:r,title:a,linkTarget:n?"_blank":void 0})])}]},BX=b_e;var DX=o(v(),1),{fieldsKey:y_e,formKey:__e}=K(EX.privateApis),{name:LX}=q3,X3={icon:L0,__experimentalLabel(e,{context:t}){if(t==="list-view")return e?.label;if(t==="appender"){let r=e?.type||"link";return(0,Dm.sprintf)((0,Dm._x)("Add %s","add default block type"),r)}return e?.label},merge(e,{label:t=""}){return{...e,label:e.label+t}},edit:PD,save:TX,example:{attributes:{label:(0,Dm._x)("Example Link","navigation link preview example"),url:"https://example.com"}},deprecated:[{isEligible(e){return e.nofollow},attributes:{label:{type:"string"},type:{type:"string"},nofollow:{type:"boolean"},description:{type:"string"},id:{type:"number"},opensInNewTab:{type:"boolean",default:!1},url:{type:"string"}},migrate({nofollow:e,...t}){return{rel:e?"nofollow":"",...t}},save(){return(0,DX.jsx)(IX.InnerBlocks.Content,{})}}],transforms:BX};window.__experimentalContentOnlyInspectorFields&&(X3[y_e]=[{id:"label",label:(0,Dm.__)("Label"),type:"text",Edit:"rich-text"},{id:"link",label:(0,Dm.__)("Link"),type:"url",Edit:"link",getValue:({item:e})=>({url:e.url,rel:e.rel}),setValue:({value:e})=>({url:e.url,rel:e.rel})}],X3[__e]={fields:["label","link"]});var x_e=()=>((0,NX.addFilter)("blocks.registerBlockType","core/navigation-link",PX),E({name:LX,metadata:q3,settings:X3}));var ND={};Z(ND,{init:()=>T_e,metadata:()=>J3,name:()=>GX,settings:()=>nw});var Xv=o(P(),1),UX=o(W(),1);var J3={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/navigation-submenu",title:"Submenu",category:"design",parent:["core/navigation"],description:"Add a submenu to your navigation.",textdomain:"default",attributes:{label:{type:"string",role:"content"},type:{type:"string"},description:{type:"string"},rel:{type:"string"},id:{type:"number"},opensInNewTab:{type:"boolean",default:!1},url:{type:"string",role:"content"},title:{type:"string"},kind:{type:"string"},isTopLevelItem:{type:"boolean"}},usesContext:["textColor","customTextColor","backgroundColor","customBackgroundColor","overlayTextColor","customOverlayTextColor","overlayBackgroundColor","customOverlayBackgroundColor","fontSize","customFontSize","showSubmenuIcon","maxNestingLevel","openSubmenusOnClick","submenuVisibility","style"],supports:{anchor:!0,reusable:!1,html:!1,typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}},editorStyle:"wp-block-navigation-submenu-editor",style:"wp-block-navigation-submenu"};var tw=o(V(),1),Yv=o(M(),1),rw=o(As(),1),og=o(P(),1),Jr=o(T(),1),ow=o(mr(),1),cs=o(U(),1);var RX=o(bv(),1),zX=o(W(),1),aw=o(me(),1);var ew=o(M(),1),ID=o(v(),1),MX=()=>(0,ID.jsx)(ew.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:(0,ID.jsx)(ew.Path,{d:"M1.50002 4L6.00002 8L10.5 4",strokeWidth:"1.5"})});var Dr=o(v(),1),AX=["core/navigation-link","core/navigation-submenu","core/page-list"];function VX({attributes:e,isSelected:t,setAttributes:r,mergeBlocks:a,onReplace:n,context:i,clientId:l}){let{label:s,url:c,description:u,kind:m,type:p,id:d}=e,{showSubmenuIcon:f,maxNestingLevel:h,submenuVisibility:g}=i,y=(0,Jr.useBlockEditingMode)()!=="default"?!0:g==="click",{hasUrlBinding:k,isBoundEntityAvailable:_,entityRecord:x}=Ni({clientId:l,attributes:e}),S=Cd({clientId:l,attributes:e,setAttributes:r,allowTextUpdate:!0}),{__unstableMarkNextChangeAsNotPersistent:C,replaceBlock:N}=(0,tw.useDispatch)(Jr.store),[B,D]=(0,cs.useState)(!1),[A,H]=(0,cs.useState)(null),F=(0,cs.useRef)(null),z=$v(F),I=(0,og.__)("Add text\u2026"),R=(0,cs.useRef)(),{parentCount:$,isParentOfSelectedBlock:j,isImmediateParentOfSelectedBlock:G,hasChildren:O,selectedBlockHasChildren:J,onlyDescendantIsEmptyLink:ee}=(0,tw.useSelect)(at=>{let{hasSelectedInnerBlock:kt,getSelectedBlockClientId:Wr,getBlockParentsByBlockName:ut,getBlock:br,getBlockCount:mt,getBlockOrder:wo}=at(Jr.store),Y,ze=Wr(),Me=wo(ze);if(Me?.length===1){let Xe=br(Me[0]);Y=Xe?.name==="core/navigation-link"&&!Xe?.attributes?.label}return{parentCount:ut(l,"core/navigation-submenu").length,isParentOfSelectedBlock:kt(l,!0),isImmediateParentOfSelectedBlock:kt(l,!1),hasChildren:!!mt(l),selectedBlockHasChildren:!!Me?.length,onlyDescendantIsEmptyLink:Y}},[l]),oe=Wv(l),X=(0,aw.usePrevious)(O),[te,ne]=Sd(m,p,d,oe);(0,cs.useEffect)(()=>{!y&&!c&&D(!0)},[]),(0,cs.useEffect)(()=>{t||D(!1)},[t]),(0,cs.useEffect)(()=>{B&&c&&(0,ow.isURL)((0,ow.prependHTTP)(s))&&/^.+\.[a-z]+/.test(s)&&qv(R)},[c]);let{textColor:le,customTextColor:pe,backgroundColor:Ie,customBackgroundColor:Ne}=_d(i,$>0);function ae(at){rw.isKeyboardEvent.primary(at,"k")&&(at.preventDefault(),at.stopPropagation(),D(!0))}let Re=(0,Jr.useBlockProps)({ref:(0,aw.useMergeRefs)([H,F]),className:w("wp-block-navigation-item",{"is-editing":t||j,"is-dragging-within":z,"has-link":!!c,"has-child":O,"has-text-color":!!le||!!pe,[(0,Jr.getColorClassName)("color",le)]:!!le,"has-background":!!Ie||Ne,[(0,Jr.getColorClassName)("background-color",Ie)]:!!Ie,"open-on-click":y,"open-always":g==="always"}),style:{color:!le&&pe,backgroundColor:!Ie&&Ne},onKeyDown:ae}),Ee=_d(i,!0),ie=$>=h?AX.filter(at=>at!=="core/navigation-submenu"):AX,fe=u3(Ee),ke=(0,Jr.useInnerBlocksProps)(fe,{allowedBlocks:ie,defaultBlock:Pi,directInsert:!0,__experimentalCaptureToolbars:!0,renderAppender:t||G&&!J||O?Jr.InnerBlocks.ButtonBlockAppender:!1}),je=y?"button":"a";function de(){let at=(0,zX.createBlock)("core/navigation-link",e);N(l,at)}(0,cs.useEffect)(()=>{!O&&X&&(C(),de())},[O,X]);let ct=!J||ee;return(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsx)(Jr.BlockControls,{children:(0,Dr.jsxs)(Yv.ToolbarGroup,{children:[!y&&(0,Dr.jsx)(Yv.ToolbarButton,{name:"link",icon:ii,title:(0,og.__)("Link"),shortcut:rw.displayShortcut.primary("k"),onClick:()=>{D(!0)}}),(0,Dr.jsx)(Yv.ToolbarButton,{name:"revert",icon:FP,title:(0,og.__)("Convert to Link"),onClick:de,className:"wp-block-navigation__submenu__revert",disabled:!ct})]})}),(0,Dr.jsx)(Jr.InspectorControls,{group:"content",children:(0,Dr.jsx)(Uv,{attributes:e,setAttributes:r,clientId:l,isLinkEditable:!y})}),(0,Dr.jsxs)("div",{...Re,children:[(0,Dr.jsxs)(je,{className:"wp-block-navigation-item__content",children:[!te&&!ne&&(0,Dr.jsxs)(Dr.Fragment,{children:[(0,Dr.jsx)(Jr.RichText,{ref:R,identifier:"label",className:"wp-block-navigation-item__label",value:s,onChange:at=>r({label:at}),onMerge:a,onReplace:n,"aria-label":(0,og.__)("Navigation link text"),placeholder:I,withoutInteractiveFormatting:!0,onClick:()=>{!y&&!c&&D(!0)}}),u&&(0,Dr.jsx)("span",{className:"wp-block-navigation-item__description",children:u})]}),(te||ne)&&(0,Dr.jsx)(Gv,{label:s,isInvalid:te,isDraft:ne,className:"wp-block-navigation-item__label"}),!y&&B&&(0,Dr.jsx)(pu,{clientId:l,link:e,entity:{entityRecord:x,hasBinding:k,isEntityAvailable:_},onClose:()=>{D(!1)},anchor:A,onRemove:()=>{r({url:""}),(0,RX.speak)((0,og.__)("Link removed."),"assertive")},onChange:S})]}),(f||y)&&(0,Dr.jsx)("span",{className:"wp-block-navigation__submenu-icon",children:(0,Dr.jsx)(MX,{})}),(0,Dr.jsx)("div",{...ke})]})]})}var FX=o(T(),1),HX=o(v(),1);function OX(){return(0,HX.jsx)(FX.InnerBlocks.Content,{})}var Bd=o(W(),1),w_e={to:[{type:"block",blocks:["core/navigation-link"],isMatch:(e,t)=>t?.innerBlocks?.length===0,transform:e=>(0,Bd.createBlock)("core/navigation-link",e)},{type:"block",blocks:["core/spacer"],isMatch:(e,t)=>t?.innerBlocks?.length===0,transform:()=>(0,Bd.createBlock)("core/spacer")},{type:"block",blocks:["core/site-logo"],isMatch:(e,t)=>t?.innerBlocks?.length===0,transform:()=>(0,Bd.createBlock)("core/site-logo")},{type:"block",blocks:["core/home-link"],isMatch:(e,t)=>t?.innerBlocks?.length===0,transform:()=>(0,Bd.createBlock)("core/home-link")},{type:"block",blocks:["core/social-links"],isMatch:(e,t)=>t?.innerBlocks?.length===0,transform:()=>(0,Bd.createBlock)("core/social-links")},{type:"block",blocks:["core/search"],isMatch:(e,t)=>t?.innerBlocks?.length===0,transform:()=>(0,Bd.createBlock)("core/search")}]},jX=w_e;var{fieldsKey:C_e,formKey:S_e}=K(UX.privateApis),{name:GX}=J3,nw={icon:({context:e})=>e==="list-view"?Fc:vp,__experimentalLabel(e,{context:t}){let{label:r}=e,a=e?.metadata?.name;return(t==="list-view"||t==="breadcrumb")&&a?a:r},edit:VX,example:{attributes:{label:(0,Xv._x)("About","Example link text for Navigation Submenu"),type:"page"}},save:OX,transforms:jX};window.__experimentalContentOnlyInspectorFields&&(nw[C_e]=[{id:"label",label:(0,Xv.__)("Label"),type:"text",Edit:"rich-text"},{id:"link",label:(0,Xv.__)("Link"),type:"url",Edit:"link",getValue:({item:e})=>({url:e.url,rel:e.rel}),setValue:({value:e})=>({url:e.url,rel:e.rel})}],nw[S_e]={fields:["label","link"]});var T_e=()=>E({name:GX,metadata:J3,settings:nw});var DD={};Z(DD,{init:()=>I_e,metadata:()=>iw,name:()=>JX,settings:()=>eJ});var WX=o(P(),1),$X=o(T(),1),ED=o(v(),1);function qX(){return(0,ED.jsx)("div",{...(0,$X.useBlockProps)(),children:(0,ED.jsx)("span",{children:(0,WX.__)("Page break")})})}var iw={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/nextpage",title:"Page Break",category:"design",description:"Separate your content into a multi-page experience.",keywords:["next page","pagination"],parent:["core/post-content"],textdomain:"default",supports:{customClassName:!1,className:!1,html:!1,visibility:!1,interactivity:{clientNavigation:!0},customCSS:!1},editorStyle:"wp-block-nextpage-editor"};var ZX=o(U(),1),KX=o(v(),1);function QX(){return(0,KX.jsx)(ZX.RawHTML,{children:"<!--nextpage-->"})}var YX=o(W(),1),B_e={from:[{type:"raw",schema:{"wp-block":{attributes:["data-block"]}},isMatch:e=>e.dataset&&e.dataset.block==="core/nextpage",transform(){return(0,YX.createBlock)("core/nextpage",{})}}]},XX=B_e;var{name:JX}=iw,eJ={icon:WT,example:{},transforms:XX,edit:qX,save:QX},I_e=()=>E({name:JX,metadata:iw,settings:eJ});var MD={};Z(MD,{init:()=>E_e,metadata:()=>lw,name:()=>aJ,settings:()=>nJ});var oJ=o(Yc(),1);var ag=o(T(),1),mc=o(M(),1),gu=o(P(),1);var un=o(v(),1);function tJ({attributes:e,setAttributes:t}){let{displayMode:r,text:a}=e,n=r==="icon"||r==="both",i=r==="text"||r==="both",l=a||(0,gu.__)("Close"),s=(0,ag.useBlockProps)({className:"wp-block-navigation-overlay-close"}),c=q();return(0,un.jsxs)(un.Fragment,{children:[(0,un.jsx)(ag.InspectorControls,{children:(0,un.jsx)(mc.__experimentalToolsPanel,{label:(0,gu.__)("Settings"),resetAll:()=>t({displayMode:"icon"}),dropdownMenuProps:c,children:(0,un.jsx)(mc.__experimentalToolsPanelItem,{label:(0,gu.__)("Display Mode"),isShownByDefault:!0,hasValue:()=>r!=="icon",onDeselect:()=>t({displayMode:"icon"}),children:(0,un.jsxs)(mc.__experimentalToggleGroupControl,{label:(0,gu.__)("Display Mode"),value:r,onChange:u=>t({displayMode:u}),isBlock:!0,__next40pxDefaultSize:!0,children:[(0,un.jsx)(mc.__experimentalToggleGroupControlOption,{value:"icon",label:(0,gu.__)("Icon")}),(0,un.jsx)(mc.__experimentalToggleGroupControlOption,{value:"text",label:(0,gu.__)("Text")}),(0,un.jsx)(mc.__experimentalToggleGroupControlOption,{value:"both",label:(0,gu.__)("Both")})]})})})}),(0,un.jsxs)("button",{...s,type:"button","aria-label":i?void 0:(0,gu.__)("Close"),children:[n&&(0,un.jsx)(Wa,{icon:yp}),i&&(0,un.jsx)(ag.RichText,{identifier:"text",value:l,onChange:u=>t({text:u}),tagName:"span",className:"wp-block-navigation-overlay-close__text",allowedFormats:["core/bold","core/italic"]})]})]})}var lw={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/navigation-overlay-close",title:"Navigation Overlay Close",category:"design",description:"A customizable button to close overlays.",keywords:["close","overlay","navigation","menu"],textdomain:"default",attributes:{displayMode:{type:"string",enum:["icon","text","both"],default:"icon"},text:{type:"string"}},supports:{color:{gradients:!1,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{padding:!0,__experimentalDefaultControls:{padding:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}}},style:"wp-block-navigation-overlay-close"};var sw=o(L(),1),LD=o(v(),1),rJ=(0,LD.jsx)(sw.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,LD.jsx)(sw.Path,{d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2Zm.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v12ZM15 8l-3 3-3-3-1.1 1.1 3 3-3 3L9 16.2l3-3 3 3 1.1-1.1-3-3 3-3L15 8Z"})});var{name:aJ}=lw,nJ={icon:rJ,edit:tJ},E_e=()=>((0,oJ.addFilter)("blockEditor.__unstableCanInsertBlockType","core/navigation-overlay-close/restrict-to-overlay-template-parts",(e,t)=>t.name!=="core/navigation-overlay-close"||!e?e:Kv()),E({name:aJ,metadata:lw,settings:nJ}));var RD={};Z(RD,{init:()=>R_e,metadata:()=>cw,name:()=>pJ,settings:()=>dJ});var cw={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/pattern",title:"Pattern Placeholder",category:"theme",description:"Show a block pattern.",supports:{html:!1,inserter:!1,renaming:!1,visibility:!1,interactivity:{clientNavigation:!0}},textdomain:"default",attributes:{slug:{type:"string"}}};var cJ=o(W(),1),Lm=o(V(),1),mw=o(U(),1),Mm=o(T(),1),uJ=o(Q(),1),pw=o(P(),1);var iJ=o(V(),1),AD=new WeakMap;function lJ(){let e=(0,iJ.useRegistry)();if(!AD.has(e)){let t=new Map;AD.set(e,L_e.bind(null,t))}return AD.get(e)}function L_e(e,{name:t,blocks:r}){let a=[...r];for(;a.length;){let n=a.shift();for(let i of n.innerBlocks??[])a.unshift(i);n.name==="core/pattern"&&M_e(e,t,n.attributes.slug)}}function M_e(e,t,r){if(e.has(t)||e.set(t,new Set),e.get(t).add(r),sJ(e,t))throw new TypeError(`Pattern ${t} has a circular dependency and cannot be rendered.`)}function sJ(e,t,r=new Set,a=new Set){r.add(t),a.add(t);let n=e.get(t)??new Set;for(let i of n)if(r.has(i)){if(a.has(i))return!0}else if(sJ(e,i,r,a))return!0;return a.delete(t),!1}var uw=o(v(),1),A_e=({attributes:e,clientId:t})=>{let r=(0,Lm.useRegistry)(),a=(0,Lm.useSelect)(g=>g(Mm.store).__experimentalGetParsedPattern(e.slug),[e.slug]),n=(0,Lm.useSelect)(g=>g(uJ.store).getCurrentTheme()?.stylesheet,[]),{replaceBlocks:i,setBlockEditingMode:l,__unstableMarkNextChangeAsNotPersistent:s}=(0,Lm.useDispatch)(Mm.store),{getBlockRootClientId:c,getBlockEditingMode:u}=(0,Lm.useSelect)(Mm.store),[m,p]=(0,mw.useState)(!1),d=lJ();function f(g){return g.innerBlocks.find(b=>b.name==="core/template-part")&&(g.innerBlocks=g.innerBlocks.map(b=>(b.name==="core/template-part"&&b.attributes.theme===void 0&&(b.attributes.theme=n),b))),g.name==="core/template-part"&&g.attributes.theme===void 0&&(g.attributes.theme=n),g}(0,mw.useEffect)(()=>{if(!m&&a?.blocks){try{d(a)}catch{p(!0);return}window.queueMicrotask(()=>{let g=c(t),b=a.blocks.map(k=>(0,cJ.cloneBlock)(f(k)));b.length===1&&a.categories?.length>0&&(b[0].attributes={...b[0].attributes,metadata:{...b[0].attributes.metadata,categories:a.categories,patternName:a.name,name:b[0].attributes.metadata.name||a.title}});let y=u(g);r.batch(()=>{s(),l(g,"default"),s(),i(t,b),s(),l(g,y)})})}},[t,m,a,s,i,u,l,c]);let h=(0,Mm.useBlockProps)();return m?(0,uw.jsx)("div",{...h,children:(0,uw.jsx)(Mm.Warning,{children:(0,pw.sprintf)((0,pw.__)('Pattern "%s" cannot be rendered inside itself.'),a?.name)})}):(0,uw.jsx)("div",{...h})},mJ=A_e;var{name:pJ}=cw,dJ={edit:mJ},R_e=()=>E({name:pJ,metadata:cw,settings:dJ});var HD={};Z(HD,{init:()=>O_e,metadata:()=>dw,name:()=>wJ,settings:()=>CJ});var dw={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/page-list",title:"Page List",category:"widgets",allowedBlocks:["core/page-list-item"],description:"Display a list of all pages.",keywords:["menu","navigation"],textdomain:"default",attributes:{parentPageID:{type:"integer",default:0},isNested:{type:"boolean",default:!1}},usesContext:["textColor","customTextColor","backgroundColor","customBackgroundColor","overlayTextColor","customOverlayTextColor","overlayBackgroundColor","customOverlayBackgroundColor","fontSize","customFontSize","showSubmenuIcon","style","openSubmenusOnClick","submenuVisibility"],supports:{anchor:!0,reusable:!1,html:!1,typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},color:{text:!0,background:!0,link:!0,gradients:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0},spacing:{padding:!0,margin:!0,__experimentalDefaultControls:{padding:!1,margin:!1}},contentRole:!0},editorStyle:"wp-block-page-list-editor",style:"wp-block-page-list"};var _J=o(W(),1),Aa=o(T(),1),Ma=o(M(),1),La=o(P(),1),us=o(U(),1),xJ=o(Q(),1),hw=o(V(),1);var zD=o(W(),1),fJ=o(V(),1),hJ=o(T(),1);function V_e(e=[]){let t="post-type",r={},a=[];return e.forEach(({id:n,title:i,link:l,type:s,parent:c})=>{let u=r[n]?.innerBlocks??[];r[n]=(0,zD.createBlock)("core/navigation-link",{id:n,label:i.rendered,url:l,type:s,kind:t,metadata:{bindings:Qh(t)}},u),c?(r[c]||(r[c]={innerBlocks:[]}),r[c].innerBlocks.push(r[n])):a.push(r[n])}),a}function gJ(e,t){for(let r of e){if(r.attributes.id===t)return r;if(r.innerBlocks&&r.innerBlocks.length){let a=gJ(r.innerBlocks,t);if(a)return a}}return null}function F_e(e=[],t=null){let r=V_e(e);if(t){let n=gJ(r,t);n&&n.innerBlocks&&(r=n.innerBlocks)}let a=n=>{n.forEach((i,l,s)=>{let{attributes:c,innerBlocks:u}=i;if(u.length!==0){a(u);let m=(0,zD.createBlock)("core/navigation-submenu",c,u);s[l]=m}})};return a(r),r}function vJ({clientId:e,pages:t,parentClientId:r,parentPageID:a}){let{replaceBlock:n,selectBlock:i}=(0,fJ.useDispatch)(hJ.store);return()=>{let l=F_e(t,a);n(e,l),i(r)}}var e2=o(M(),1),VD=o(me(),1),Jv=o(P(),1),Id=o(v(),1),FD=(0,Jv.__)("This Navigation Menu displays your website's pages. Editing it will enable you to add, delete, or reorder pages. However, new pages will no longer be added automatically.");function fw({onClick:e,onClose:t,disabled:r}){return(0,Id.jsxs)(e2.Modal,{onRequestClose:t,title:(0,Jv.__)("Edit Page List"),className:"wp-block-page-list-modal",aria:{describedby:(0,VD.useInstanceId)(fw,"wp-block-page-list-modal__description")},children:[(0,Id.jsx)("p",{id:(0,VD.useInstanceId)(fw,"wp-block-page-list-modal__description"),children:FD}),(0,Id.jsxs)("div",{className:"wp-block-page-list-modal-buttons",children:[(0,Id.jsx)(e2.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:t,children:(0,Jv.__)("Cancel")}),(0,Id.jsx)(e2.Button,{__next40pxDefaultSize:!0,variant:"primary",accessibleWhenDisabled:!0,disabled:r,onClick:e,children:(0,Jv.__)("Edit")})]})]})}var St=o(v(),1),bJ=100,yJ=()=>{};function H_e({blockProps:e,innerBlocksProps:t,hasResolvedPages:r,blockList:a,pages:n,parentPageID:i}){if(!r)return(0,St.jsx)("div",{...e,children:(0,St.jsx)("div",{className:"wp-block-page-list__loading-indicator-container",children:(0,St.jsx)(Ma.Spinner,{className:"wp-block-page-list__loading-indicator"})})});if(n===null)return(0,St.jsx)("div",{...e,children:(0,St.jsx)(Ma.Notice,{status:"warning",isDismissible:!1,children:(0,La.__)("Page List: Cannot retrieve Pages.")})});if(n.length===0)return(0,St.jsx)("div",{...e,children:(0,St.jsx)(Ma.Notice,{status:"info",isDismissible:!1,children:(0,La.__)("Page List: Cannot retrieve Pages.")})});if(a.length===0){let l=n.find(s=>s.id===i);return l?.title?.rendered?(0,St.jsx)("div",{...e,children:(0,St.jsx)(Aa.Warning,{children:(0,La.sprintf)((0,La.__)('Page List: "%s" page has no children.'),l.title.rendered)})}):(0,St.jsx)("div",{...e,children:(0,St.jsx)(Ma.Notice,{status:"warning",isDismissible:!1,children:(0,La.__)("Page List: Cannot retrieve Pages.")})})}if(n.length>0)return(0,St.jsx)("ul",{...t})}function kJ({context:e,clientId:t,attributes:r,setAttributes:a}){let{parentPageID:n}=r,[i,l]=(0,us.useState)(!1),s=(0,us.useCallback)(()=>l(!0),[]),c=()=>l(!1),u=q(),{records:m,hasResolved:p}=(0,xJ.useEntityRecords)("postType","page",{per_page:bJ,_fields:["id","link","menu_order","parent","title","type"],orderby:"menu_order",order:"asc"}),d="showSubmenuIcon"in e&&m?.length>0&&m?.length<=bJ,f=(0,us.useMemo)(()=>m===null?new Map:m.sort((A,H)=>A.menu_order===H.menu_order?A.title.rendered.localeCompare(H.title.rendered):A.menu_order-H.menu_order).reduce((A,H)=>{let{parent:F}=H;return A.has(F)?A.get(F).push(H):A.set(F,[H]),A},new Map),[m]),h=(0,Aa.useBlockProps)({className:w("wp-block-page-list",{"has-text-color":!!e.textColor,[(0,Aa.getColorClassName)("color",e.textColor)]:!!e.textColor,"has-background":!!e.backgroundColor,[(0,Aa.getColorClassName)("background-color",e.backgroundColor)]:!!e.backgroundColor,"open-on-click":e.submenuVisibility==="click","open-always":e.submenuVisibility==="always"}),style:{...e.style?.color}}),g=(0,us.useMemo)(function D(A=0,H=0){let F=f.get(A);return F?.length?F.reduce((z,I)=>{let R=f.has(I.id),$={value:I.id,label:"\u2014 ".repeat(H)+I.title.rendered,rawName:I.title.rendered};return z.push($),R&&z.push(...D(I.id,H+1)),z},[]):[]},[f]),b=(0,us.useMemo)(function D(A=n){let H=f.get(A);return H?.length?H.reduce((F,z)=>{let I=f.has(z.id),R={id:z.id,label:z.title?.rendered?.trim()!==""?z.title?.rendered:(0,La.__)("(no title)"),title:z.title?.rendered?.trim()!==""?z.title?.rendered:(0,La.__)("(no title)"),link:z.url,hasChildren:I},$=null,j=D(z.id);return $=(0,_J.createBlock)("core/page-list-item",R,j),F.push($),F},[]):[]},[f,n]),{isNested:y,hasSelectedChild:k,parentClientId:_,hasDraggedChild:x,isChildOfNavigation:S}=(0,hw.useSelect)(D=>{let{getBlockParentsByBlockName:A,hasSelectedInnerBlock:H,hasDraggedInnerBlock:F}=D(Aa.store),z=A(t,"core/navigation-submenu",!0),I=A(t,"core/navigation",!0);return{isNested:z.length>0,isChildOfNavigation:I.length>0,hasSelectedChild:H(t,!0),hasDraggedChild:F(t,!0),parentClientId:I[0]}},[t]),C=vJ({clientId:t,pages:m,parentClientId:_,parentPageID:n}),N=(0,Aa.useInnerBlocksProps)(h,{renderAppender:!1,__unstableDisableDropZone:!0,templateLock:S?!1:"all",onInput:yJ,onChange:yJ,value:b}),{selectBlock:B}=(0,hw.useDispatch)(Aa.store);return(0,us.useEffect)(()=>{(k||x)&&(s(),B(_))},[k,x,_,B,s]),(0,us.useEffect)(()=>{a({isNested:y})},[y,a]),(0,St.jsxs)(St.Fragment,{children:[(g.length>0||d)&&(0,St.jsx)(Aa.InspectorControls,{children:(0,St.jsxs)(Ma.__experimentalToolsPanel,{label:(0,La.__)("Settings"),resetAll:()=>{a({parentPageID:0})},dropdownMenuProps:u,children:[g.length>0&&(0,St.jsx)(Ma.__experimentalToolsPanelItem,{label:(0,La.__)("Parent Page"),hasValue:()=>n!==0,onDeselect:()=>a({parentPageID:0}),isShownByDefault:!0,children:(0,St.jsx)(Ma.ComboboxControl,{__next40pxDefaultSize:!0,className:"editor-page-attributes__parent",label:(0,La.__)("Parent"),value:n,options:g,onChange:D=>a({parentPageID:D??0}),help:(0,La.__)("Choose a page to show only its subpages.")})}),d&&(0,St.jsxs)("div",{style:{gridColumn:"1 / -1"},children:[(0,St.jsx)("p",{children:FD}),(0,St.jsx)(Ma.Button,{__next40pxDefaultSize:!0,variant:"primary",accessibleWhenDisabled:!0,disabled:!p,onClick:C,children:(0,La.__)("Edit")})]})]})}),d&&(0,St.jsxs)(St.Fragment,{children:[(0,St.jsx)(Aa.BlockControls,{group:"other",children:(0,St.jsx)(Ma.ToolbarButton,{title:(0,La.__)("Edit"),onClick:s,children:(0,La.__)("Edit")})}),i&&(0,St.jsx)(fw,{onClick:C,onClose:c,disabled:!p})]}),(0,St.jsx)(H_e,{blockProps:h,innerBlocksProps:N,hasResolvedPages:p,blockList:b,pages:m,parentPageID:n})]})}var{name:wJ}=dw,CJ={icon:$T,example:{},edit:kJ},O_e=()=>E({name:wJ,metadata:dw,settings:CJ});var WD={};Z(WD,{init:()=>G_e,metadata:()=>gw,name:()=>PJ,settings:()=>BJ});var gw={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/page-list-item",title:"Page List Item",category:"widgets",parent:["core/page-list"],description:"Displays a page inside a list of all pages.",keywords:["page","menu","navigation"],textdomain:"default",attributes:{id:{type:"number"},label:{type:"string"},title:{type:"string"},link:{type:"string"},hasChildren:{type:"boolean"}},usesContext:["textColor","customTextColor","backgroundColor","customBackgroundColor","overlayTextColor","customOverlayTextColor","overlayBackgroundColor","customOverlayBackgroundColor","fontSize","customFontSize","showSubmenuIcon","style","openSubmenusOnClick","submenuVisibility"],supports:{anchor:!0,reusable:!1,html:!1,lock:!1,inserter:!1,__experimentalToolbar:!1,interactivity:{clientNavigation:!0}},editorStyle:"wp-block-page-list-editor",style:"wp-block-page-list"};var bw=o(T(),1),SJ=o(V(),1),UD=o(Q(),1),GD=o(ai(),1);var vw=o(M(),1),OD=o(v(),1),jD=()=>(0,OD.jsx)(vw.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:(0,OD.jsx)(vw.Path,{d:"M1.50002 4L6.00002 8L10.5 4",strokeWidth:"1.5"})});var mn=o(v(),1);function U_e(){return(0,SJ.useSelect)(e=>{if(!e(UD.store).canUser("read",{kind:"root",name:"site"}))return;let r=e(UD.store).getEntityRecord("root","site");return r?.show_on_front==="page"&&r?.page_on_front},[])}function TJ({context:e,attributes:t}){let{id:r,label:a,link:n,hasChildren:i,title:l}=t,s="showSubmenuIcon"in e,c=U_e(),u=e.submenuVisibility,m=u==="click",p=_d(e,!0),d=u3(p),f=(0,bw.useBlockProps)(d,{className:"wp-block-pages-list__item"}),h=(0,bw.useInnerBlocksProps)(f);return(0,mn.jsxs)("li",{className:w("wp-block-pages-list__item",{"has-child":i,"wp-block-navigation-item":s,"open-on-click":m,"open-always":u==="always","open-on-hover-click":u==="hover"&&e.showSubmenuIcon,"menu-item-home":r===c}),children:[i&&m?(0,mn.jsxs)(mn.Fragment,{children:[(0,mn.jsx)("button",{type:"button",className:"wp-block-navigation-item__content wp-block-navigation-submenu__toggle","aria-expanded":"false",dangerouslySetInnerHTML:{__html:(0,GD.safeHTML)(a)}}),(0,mn.jsx)("span",{className:"wp-block-page-list__submenu-icon wp-block-navigation__submenu-icon",children:(0,mn.jsx)(jD,{})})]}):(0,mn.jsx)("a",{className:w("wp-block-pages-list__item__link",{"wp-block-navigation-item__content":s}),href:n,dangerouslySetInnerHTML:{__html:(0,GD.safeHTML)(l)}}),i&&(0,mn.jsxs)(mn.Fragment,{children:[!m&&e.showSubmenuIcon&&(0,mn.jsx)("button",{className:"wp-block-navigation-item__content wp-block-navigation-submenu__toggle wp-block-page-list__submenu-icon wp-block-navigation__submenu-icon","aria-expanded":"false",type:"button",children:(0,mn.jsx)(jD,{})}),(0,mn.jsx)("ul",{...h})]})]},r)}var{name:PJ}=gw,BJ={__experimentalLabel:({label:e})=>e,icon:Fc,example:{},edit:TJ},G_e=()=>E({name:PJ,metadata:gw,settings:BJ});var YD={};Z(YD,{init:()=>J_e,metadata:()=>ug,name:()=>Sw,settings:()=>Cw});var ww=o(P(),1);var $J=o(W(),1);var IJ=o(U(),1),go=o(T(),1),$D=o(P(),1),pc=o(v(),1),ng={className:!1},qD={align:{type:"string"},content:{type:"string",source:"html",selector:"p",default:""},dropCap:{type:"boolean",default:!1},placeholder:{type:"string"},textColor:{type:"string"},backgroundColor:{type:"string"},fontSize:{type:"string"},direction:{type:"string",enum:["ltr","rtl"]},style:{type:"object"}},yw=e=>{if(!e.customTextColor&&!e.customBackgroundColor&&!e.customFontSize)return e;let t={};(e.customTextColor||e.customBackgroundColor)&&(t.color={}),e.customTextColor&&(t.color.text=e.customTextColor),e.customBackgroundColor&&(t.color.background=e.customBackgroundColor),e.customFontSize&&(t.typography={fontSize:e.customFontSize});let{customTextColor:r,customBackgroundColor:a,customFontSize:n,...i}=e;return{...i,style:t}},ig=e=>{let{align:t,...r}=e;return t?{...r,style:{...e.style,typography:{...e.style?.typography,textAlign:t}}}:e},{style:zZe,...t2}=qD,W_e=[{supports:{className:!1,typography:{fontSize:!0}},attributes:qD,isEligible(e){return!!e.align||!!e.className?.match(/\bhas-text-align-(left|center|right)\b/)},save({attributes:e}){let{align:t,content:r,dropCap:a,direction:n}=e,i=w({"has-drop-cap":t===((0,$D.isRTL)()?"left":"right")||t==="center"?!1:a,[`has-text-align-${t}`]:t});return(0,pc.jsx)("p",{...go.useBlockProps.save({className:i,dir:n}),children:(0,pc.jsx)(go.RichText.Content,{value:r})})},migrate:ig},{supports:ng,attributes:{...t2,customTextColor:{type:"string"},customBackgroundColor:{type:"string"},customFontSize:{type:"number"}},migrate:ig,save({attributes:e}){let{align:t,content:r,dropCap:a,direction:n}=e,i=w({"has-drop-cap":t===((0,$D.isRTL)()?"left":"right")||t==="center"?!1:a,[`has-text-align-${t}`]:t});return(0,pc.jsx)("p",{...go.useBlockProps.save({className:i,dir:n}),children:(0,pc.jsx)(go.RichText.Content,{value:r})})}},{supports:ng,attributes:{...t2,customTextColor:{type:"string"},customBackgroundColor:{type:"string"},customFontSize:{type:"number"}},migrate(e){return yw(ig(e))},save({attributes:e}){let{align:t,content:r,dropCap:a,backgroundColor:n,textColor:i,customBackgroundColor:l,customTextColor:s,fontSize:c,customFontSize:u,direction:m}=e,p=(0,go.getColorClassName)("color",i),d=(0,go.getColorClassName)("background-color",n),f=(0,go.getFontSizeClass)(c),h=w({"has-text-color":i||s,"has-background":n||l,"has-drop-cap":a,[`has-text-align-${t}`]:t,[f]:f,[p]:p,[d]:d}),g={backgroundColor:d?void 0:l,color:p?void 0:s,fontSize:f?void 0:u};return(0,pc.jsx)(go.RichText.Content,{tagName:"p",style:g,className:h||void 0,value:r,dir:m})}},{supports:ng,attributes:{...t2,customTextColor:{type:"string"},customBackgroundColor:{type:"string"},customFontSize:{type:"number"}},migrate(e){return yw(ig(e))},save({attributes:e}){let{align:t,content:r,dropCap:a,backgroundColor:n,textColor:i,customBackgroundColor:l,customTextColor:s,fontSize:c,customFontSize:u,direction:m}=e,p=(0,go.getColorClassName)("color",i),d=(0,go.getColorClassName)("background-color",n),f=(0,go.getFontSizeClass)(c),h=w({"has-text-color":i||s,"has-background":n||l,"has-drop-cap":a,[f]:f,[p]:p,[d]:d}),g={backgroundColor:d?void 0:l,color:p?void 0:s,fontSize:f?void 0:u,textAlign:t};return(0,pc.jsx)(go.RichText.Content,{tagName:"p",style:g,className:h||void 0,value:r,dir:m})}},{supports:ng,attributes:{...t2,customTextColor:{type:"string"},customBackgroundColor:{type:"string"},customFontSize:{type:"number"},width:{type:"string"}},migrate(e){return yw(ig(e))},save({attributes:e}){let{width:t,align:r,content:a,dropCap:n,backgroundColor:i,textColor:l,customBackgroundColor:s,customTextColor:c,fontSize:u,customFontSize:m}=e,p=(0,go.getColorClassName)("color",l),d=(0,go.getColorClassName)("background-color",i),f=u&&`is-${u}-text`,h=w({[`align${t}`]:t,"has-background":i||s,"has-drop-cap":n,[f]:f,[p]:p,[d]:d}),g={backgroundColor:d?void 0:s,color:p?void 0:c,fontSize:f?void 0:m,textAlign:r};return(0,pc.jsx)(go.RichText.Content,{tagName:"p",style:g,className:h||void 0,value:a})}},{supports:ng,attributes:{...t2,fontSize:{type:"number"}},save({attributes:e}){let{width:t,align:r,content:a,dropCap:n,backgroundColor:i,textColor:l,fontSize:s}=e,c=w({[`align${t}`]:t,"has-background":i,"has-drop-cap":n});return(0,pc.jsx)("p",{style:{backgroundColor:i,color:l,fontSize:s,textAlign:r},className:c||void 0,children:a})},migrate(e){return yw(ig({...e,customFontSize:Number.isFinite(e.fontSize)?e.fontSize:void 0,customTextColor:e.textColor&&e.textColor[0]==="#"?e.textColor:void 0,customBackgroundColor:e.backgroundColor&&e.backgroundColor[0]==="#"?e.backgroundColor:void 0}))}},{supports:ng,attributes:{...qD,content:{type:"string",source:"html",default:""}},save({attributes:e}){return(0,pc.jsx)(IJ.RawHTML,{children:e.content})},migrate:e=>e}],NJ=W_e;var Un=o(P(),1),cg=o(M(),1),Gn=o(T(),1),HJ=o(W(),1);var EJ=o(U(),1),DJ=o(me(),1),LJ=o(As(),1),lg=o(V(),1),ZD=o(T(),1),sg=o(W(),1);function MJ(e){let{batch:t}=(0,lg.useRegistry)(),{moveBlocksToPosition:r,replaceInnerBlocks:a,duplicateBlocks:n,insertBlock:i}=(0,lg.useDispatch)(ZD.store),{getBlockRootClientId:l,getBlockIndex:s,getBlockOrder:c,getBlockName:u,getBlock:m,getNextBlockClientId:p,canInsertBlockType:d}=(0,lg.useSelect)(ZD.store),f=(0,EJ.useRef)(e);return f.current=e,(0,DJ.useRefEffect)(h=>{function g(b){if(b.defaultPrevented||b.keyCode!==LJ.ENTER)return;let{content:y,clientId:k}=f.current;if(y.length)return;let _=l(k);if(!(0,sg.hasBlockSupport)(u(_),"__experimentalOnEnter",!1))return;let x=c(_),S=x.indexOf(k);if(S===x.length-1){let B=_;for(;!d(u(k),l(B));)B=l(B);typeof B=="string"&&(b.preventDefault(),r([k],_,l(B),s(B)+1));return}let C=(0,sg.getDefaultBlockName)();if(!d(C,l(_)))return;b.preventDefault();let N=m(_);t(()=>{n([_]);let B=s(_);a(_,N.innerBlocks.slice(0,S)),a(p(_),N.innerBlocks.slice(S+1)),i((0,sg.createBlock)(C),B+1,l(_),!0)})}return h.addEventListener("keydown",g),()=>{h.removeEventListener("keydown",g)}},[])}var AJ=o(me(),1),_w=o(U(),1),RJ=o(Ff(),1),zJ=o(V(),1),VJ=o(T(),1);function FJ(e,t,r){let{__unstableMarkNextChangeAsNotPersistent:a}=(0,zJ.useDispatch)(VJ.store),n=(0,AJ.useEvent)(()=>{(0,RJ.default)("align attribute in paragraph block",{alternative:"style.typography.textAlign",since:"7.0"}),a(),r({style:{...t,typography:{...t?.typography,textAlign:e}}})}),i=(0,_w.useRef)();(0,_w.useEffect)(()=>{e==="full"||e==="wide"||e===i.current||(i.current=e,n())},[e,n])}var Li=o(v(),1);function $_e({direction:e,setDirection:t}){return(0,Un.isRTL)()&&(0,Li.jsx)(cg.ToolbarButton,{icon:O9,title:(0,Un._x)("Left to right","editor button"),isActive:e==="ltr",onClick:()=>{t(e==="ltr"?void 0:"ltr")}})}function KD(e){return e===((0,Un.isRTL)()?"left":"right")||e==="center"}function q_e({clientId:e,attributes:t,setAttributes:r,name:a}){let[n]=(0,Gn.useSettings)("typography.dropCap");if(!n)return null;let{style:i,dropCap:l}=t,s=i?.typography?.textAlign,c;KD(s)?c=(0,Un.__)("Not available for aligned text."):l?c=(0,Un.__)("Showing large initial letter."):c=(0,Un.__)("Show a large initial letter.");let u=(0,HJ.getBlockSupport)(a,"typography.defaultControls.dropCap",!1);return(0,Li.jsx)(Gn.InspectorControls,{group:"typography",children:(0,Li.jsx)(cg.__experimentalToolsPanelItem,{hasValue:()=>!!l,label:(0,Un.__)("Drop cap"),isShownByDefault:u,onDeselect:()=>r({dropCap:!1}),resetAllFilter:()=>({dropCap:!1}),panelId:e,children:(0,Li.jsx)(cg.ToggleControl,{label:(0,Un.__)("Drop cap"),checked:!!l,onChange:()=>r({dropCap:!l}),help:c,disabled:KD(s)})})})}function Z_e({attributes:e,mergeBlocks:t,onReplace:r,onRemove:a,setAttributes:n,clientId:i,isSelected:l,name:s}){let{content:c,direction:u,dropCap:m,placeholder:p,style:d}=e,f=d?.typography?.textAlign;FJ(e.align,d,n);let h=(0,Gn.useBlockProps)({ref:MJ({clientId:i,content:c}),className:w({"has-drop-cap":KD(f)?!1:m}),style:{direction:u}}),g=(0,Gn.useBlockEditingMode)();return(0,Li.jsxs)(Li.Fragment,{children:[g==="default"&&(0,Li.jsx)(Gn.BlockControls,{group:"block",children:(0,Li.jsx)($_e,{direction:u,setDirection:b=>n({direction:b})})}),l&&(0,Li.jsx)(q_e,{name:s,clientId:i,attributes:e,setAttributes:n}),(0,Li.jsx)(Gn.RichText,{identifier:"content",tagName:"p",...h,value:c,onChange:b=>n({content:b}),onMerge:t,onReplace:r,onRemove:a,"aria-label":Gn.RichText.isEmpty(c)?(0,Un.__)("Empty block; start writing or type forward slash to choose a block"):(0,Un.__)("Block: Paragraph"),"data-empty":Gn.RichText.isEmpty(c),placeholder:p||(0,Un.__)("Type / to choose a block"),"data-custom-placeholder":p?!0:void 0,__unstableEmbedURLOnPaste:!0,__unstableAllowPrefixTransformations:!0})]})}var OJ=Z_e;var ug={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/paragraph",title:"Paragraph",category:"text",description:"Start with the basic building block of all narrative.",keywords:["text"],textdomain:"default",attributes:{content:{type:"rich-text",source:"rich-text",selector:"p",role:"content"},dropCap:{type:"boolean",default:!1},placeholder:{type:"string"},direction:{type:"string",enum:["ltr","rtl"]}},supports:{align:["wide","full"],splitting:!0,anchor:!0,className:!1,__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0},color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},typography:{fontSize:!0,lineHeight:!0,textAlign:!0,textColumns:!0,textIndent:!0,__experimentalFontFamily:!0,__experimentalTextDecoration:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalWritingMode:!0,fitText:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalSelector:"p",__unstablePasteTextInline:!0,interactivity:{clientNavigation:!0}},selectors:{root:"p",typography:{textIndent:".wp-block-paragraph + .wp-block-paragraph"}},editorStyle:"wp-block-paragraph-editor",style:"wp-block-paragraph"};var xw=o(T(),1),jJ=o(P(),1),QD=o(v(),1);function UJ({attributes:e}){let{content:t,dropCap:r,direction:a,style:n}=e,i=n?.typography?.textAlign,l=w({"has-drop-cap":i===((0,jJ.isRTL)()?"left":"right")||i==="center"?!1:r});return(0,QD.jsx)("p",{...xw.useBlockProps.save({className:l,dir:a}),children:(0,QD.jsx)(xw.RichText.Content,{value:t})})}var kw=o(W(),1);var{name:GJ}=ug,Q_e={from:[{type:"raw",priority:20,selector:"p",schema:({phrasingContentSchema:e,isPaste:t})=>({p:{children:e,attributes:t?[]:["style","id"]}}),transform(e){let t=(0,kw.getBlockAttributes)(GJ,e.outerHTML),{textAlign:r}=e.style||{};return(r==="left"||r==="center"||r==="right")&&(t.style={...t.style,typography:{...t.style?.typography,textAlign:r}}),(0,kw.createBlock)(GJ,t)}}]},WJ=Q_e;var{fieldsKey:Y_e,formKey:X_e}=K($J.privateApis),{name:Sw}=ug,Cw={icon:ZT,example:{attributes:{content:(0,ww.__)("In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing.")}},__experimentalLabel(e,{context:t}){let r=e?.metadata?.name;if((t==="list-view"||t==="breadcrumb")&&r)return r;if(t==="accessibility"){if(r)return r;let{content:a}=e;return!a||a.length===0?(0,ww.__)("Empty"):a}},transforms:WJ,deprecated:NJ,merge(e,t){return{content:(e.content||"")+(t.content||"")}},edit:OJ,save:UJ};window.__experimentalContentOnlyInspectorFields&&(Cw[Y_e]=[{id:"content",label:(0,ww.__)("Content"),type:"text",Edit:"rich-text"}],Cw[X_e]={fields:["content"]});var J_e=()=>E({name:Sw,metadata:ug,settings:Cw});var eL={};Z(eL,{init:()=>ixe,metadata:()=>Tw,name:()=>JJ,settings:()=>eee});var Tw={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,__experimental:!0,name:"core/playlist",title:"Playlist",category:"media",description:"Embed a simple playlist.",keywords:["music","sound"],textdomain:"default",allowedBlocks:["core/playlist-track"],attributes:{currentTrack:{type:"string"},type:{type:"string",default:"audio"},order:{type:"string",default:"asc"},showTracklist:{type:"boolean",default:!0},showImages:{type:"boolean",default:!0},showArtists:{type:"boolean",default:!0},showNumbers:{type:"boolean",default:!0},caption:{type:"string"}},providesContext:{showArtists:"showArtists",currentTrack:"currentTrack"},supports:{anchor:!0,align:!0,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,radius:!0,style:!0,width:!0}},interactivity:!0,spacing:{margin:!0,padding:!0}},editorStyle:"wp-block-playlist-editor",style:"wp-block-playlist"};var Pw,txe=new Uint8Array(16);function XD(){if(!Pw&&(Pw=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Pw))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Pw(txe)}var ca=[];for(let e=0;e<256;++e)ca.push((e+256).toString(16).slice(1));function qJ(e,t=0){return ca[e[t+0]]+ca[e[t+1]]+ca[e[t+2]]+ca[e[t+3]]+"-"+ca[e[t+4]]+ca[e[t+5]]+"-"+ca[e[t+6]]+ca[e[t+7]]+"-"+ca[e[t+8]]+ca[e[t+9]]+"-"+ca[e[t+10]]+ca[e[t+11]]+ca[e[t+12]]+ca[e[t+13]]+ca[e[t+14]]+ca[e[t+15]]}var rxe=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),JD={randomUUID:rxe};function oxe(e,t,r){if(JD.randomUUID&&!t&&!e)return JD.randomUUID();e=e||{};let a=e.random||(e.rng||XD)();if(a[6]=a[6]&15|64,a[8]=a[8]&63|128,t){r=r||0;for(let n=0;n<16;++n)t[r+n]=a[n];return t}return qJ(a)}var Am=oxe;var vu=o(U(),1),Or=o(T(),1),vo=o(M(),1),Nd=o(V(),1),KJ=o(xr(),1),At=o(P(),1);var Rm=o(ai(),1),QJ=o(W(),1);var Oe=o(v(),1),ZJ=["audio"],axe=({track:e,showImages:t,onTrackEnd:r})=>{let a={dangerouslySetInnerHTML:{__html:(0,Rm.safeHTML)(e?.title?e.title:(0,At.__)("Untitled"))}},n={dangerouslySetInnerHTML:{__html:(0,Rm.safeHTML)(e?.artist?e.artist:(0,At.__)("Unknown artist"))}},i={dangerouslySetInnerHTML:{__html:(0,Rm.safeHTML)(e?.album?e.album:(0,At.__)("Unknown album"))}},l;return e?.title&&e?.artist&&e?.album?l=(0,Rm.__unstableStripHTML)((0,At.sprintf)((0,At._x)("%1$s by %2$s from the album %3$s","track title, artist name, album name"),e?.title,e?.artist,e?.album)):e?.title?l=(0,Rm.__unstableStripHTML)(e.title):l=(0,Rm.__unstableStripHTML)((0,At.__)("Untitled")),(0,Oe.jsxs)(Oe.Fragment,{children:[(0,Oe.jsxs)("div",{className:"wp-block-playlist__current-item",children:[t&&e?.image&&(0,Oe.jsx)("img",{className:"wp-block-playlist__item-image",src:e.image,alt:"",width:"70px",height:"70px"}),(0,Oe.jsxs)("div",{children:[e?.title?(0,Oe.jsx)("span",{className:"wp-block-playlist__item-title",...a}):(0,Oe.jsx)("span",{className:"wp-block-playlist__item-title",children:(0,Oe.jsx)(vo.Spinner,{})}),(0,Oe.jsxs)("div",{className:"wp-block-playlist__current-item-artist-album",children:[(0,Oe.jsx)("span",{className:"wp-block-playlist__item-artist",...n}),(0,Oe.jsx)("span",{className:"wp-block-playlist__item-album",...i})]})]})]}),(0,Oe.jsx)("audio",{controls:"controls",src:e?.url?e.url:"",onEnded:r,"aria-label":l,tabIndex:0})]})},nxe=({attributes:e,setAttributes:t,isSelected:r,insertBlocksAfter:a,clientId:n})=>{let{order:i,showTracklist:l,showNumbers:s,showImages:c,showArtists:u,currentTrack:m}=e,[p,d]=(0,vu.useState)(0),f=(0,Or.useBlockProps)(),{replaceInnerBlocks:h,__unstableMarkNextChangeAsNotPersistent:g}=(0,Nd.useDispatch)(Or.store),{createErrorNotice:b}=(0,Nd.useDispatch)(KJ.store),y=q();function k(R){b(R,{type:"snackbar"})}let{updateBlockAttributes:_}=(0,Nd.useDispatch)(Or.store),{innerBlockTracks:x}=(0,Nd.useSelect)(R=>{let{getBlock:$}=R(Or.store);return{innerBlockTracks:$(n)?.innerBlocks??[]}},[n]);(0,vu.useEffect)(()=>{let R=new Set,$=!1,j=x.map(G=>R.has(G.attributes.uniqueId)?($=!0,{...G,attributes:{...G.attributes,uniqueId:Am()}}):(R.add(G.attributes.uniqueId),G));$&&h(n,j)},[x,n,h]);let S=x.filter(R=>!!R.attributes.uniqueId),C=S.map(R=>R.attributes),N=S[0]?.attributes?.uniqueId;(0,vu.useEffect)(()=>{C.length===0?m!==null&&_(n,{currentTrack:null}):N&&N!==m&&_(n,{currentTrack:N})},[C,m,N,n,_]);let B=(0,vu.useCallback)(R=>{if(!R)return;Array.isArray(R)||(R=[R]);let $=O=>({id:O.id||O.url,uniqueId:Am(),src:O.url,title:O.title,artist:O.artist||O?.meta?.artist||O?.media_details?.artist||(0,At.__)("Unknown artist"),album:O.album||O?.meta?.album||O?.media_details?.album||(0,At.__)("Unknown album"),length:O?.fileLength||O?.media_details?.length_formatted,image:O?.image?.src&&O?.image?.src.endsWith("/images/media/audio.svg")?"":O?.image?.src}),j=R.map($);g(),t({currentTrack:j.length>0?j[0].uniqueId:null});let G=j.map(O=>(0,QJ.createBlock)("core/playlist-track",O));h(n,G)},[g,t,h,n]),D=(0,vu.useCallback)(()=>{if(p<C.length-1)C[p+1]?.uniqueId&&(d(p+1),t({currentTrack:C[p+1].uniqueId}));else if(d(0),C[0].uniqueId)t({currentTrack:C[0].uniqueId});else if(C.length>0){let R=C.find($=>$.uniqueId!==void 0);R&&t({currentTrack:R.uniqueId})}},[t,p,C]),A=(0,vu.useCallback)(R=>{let $=[...x].sort((G,O)=>{let J=G.attributes.title||"",ee=O.attributes.title||"";return R==="asc"?J.localeCompare(ee):ee.localeCompare(J)}),j=$.map(G=>G.attributes);h(n,$),t({order:R,currentTrack:j.length>0&&j[0].uniqueId!==m?j[0].uniqueId:m})},[n,m,x,h,t]);function H(R){return $=>{t({[R]:$})}}let F=(0,Nd.useSelect)(R=>R(Or.store).hasSelectedInnerBlock(n),[n]),I=(0,Or.useInnerBlocksProps)(f,{__experimentalAppenderTagName:"li",renderAppender:(r||F)&&Or.InnerBlocks.ButtonBlockAppender});return!C||Array.isArray(C)&&C.length===0?(0,Oe.jsx)("div",{...f,className:w("is-placeholder",f.className),children:(0,Oe.jsx)(Or.MediaPlaceholder,{icon:(0,Oe.jsx)(Or.BlockIcon,{icon:ni}),labels:{title:(0,At.__)("Playlist"),instructions:(0,At.__)("Upload an audio file or pick one from your media library.")},onSelect:B,accept:"audio/*",multiple:!0,allowedTypes:ZJ,onError:k})}):(0,Oe.jsxs)(Oe.Fragment,{children:[(0,Oe.jsx)(Or.BlockControls,{group:"other",children:(0,Oe.jsx)(Or.MediaReplaceFlow,{name:(0,At.__)("Edit"),onSelect:B,accept:"audio/*",multiple:!0,mediaIds:C.filter(R=>R.id).map(R=>R.id),allowedTypes:ZJ,onError:k})}),(0,Oe.jsx)(Or.InspectorControls,{children:(0,Oe.jsxs)(vo.__experimentalToolsPanel,{label:(0,At.__)("Settings"),resetAll:()=>{t({showTracklist:!0,showArtists:!0,showNumbers:!0,showImages:!0,order:"asc"})},dropdownMenuProps:y,children:[(0,Oe.jsx)(vo.__experimentalToolsPanelItem,{label:(0,At.__)("Show Tracklist"),isShownByDefault:!0,hasValue:()=>l!==!0,onDeselect:()=>t({showTracklist:!0}),children:(0,Oe.jsx)(vo.ToggleControl,{label:(0,At.__)("Show Tracklist"),onChange:H("showTracklist"),checked:l})}),l&&(0,Oe.jsxs)(Oe.Fragment,{children:[(0,Oe.jsx)(vo.__experimentalToolsPanelItem,{label:(0,At.__)("Show artist name in Tracklist"),isShownByDefault:!0,hasValue:()=>u!==!0,onDeselect:()=>t({showArtists:!0}),children:(0,Oe.jsx)(vo.ToggleControl,{label:(0,At.__)("Show artist name in Tracklist"),onChange:H("showArtists"),checked:u})}),(0,Oe.jsx)(vo.__experimentalToolsPanelItem,{label:(0,At.__)("Show number in Tracklist"),isShownByDefault:!0,hasValue:()=>s!==!0,onDeselect:()=>t({showNumbers:!0}),children:(0,Oe.jsx)(vo.ToggleControl,{label:(0,At.__)("Show number in Tracklist"),onChange:H("showNumbers"),checked:s})})]}),(0,Oe.jsx)(vo.__experimentalToolsPanelItem,{label:(0,At.__)("Show images"),isShownByDefault:!0,hasValue:()=>c!==!0,onDeselect:()=>t({showImages:!0}),children:(0,Oe.jsx)(vo.ToggleControl,{label:(0,At.__)("Show images"),onChange:H("showImages"),checked:c})}),(0,Oe.jsx)(vo.__experimentalToolsPanelItem,{label:(0,At.__)("Order"),isShownByDefault:!0,hasValue:()=>i!=="asc",onDeselect:()=>t({order:"asc"}),children:(0,Oe.jsx)(vo.SelectControl,{__next40pxDefaultSize:!0,label:(0,At.__)("Order"),value:i,options:[{label:(0,At.__)("Descending"),value:"desc"},{label:(0,At.__)("Ascending"),value:"asc"}],onChange:R=>A(R)})})]})}),(0,Oe.jsxs)("figure",{...f,children:[(0,Oe.jsx)(vo.Disabled,{isDisabled:!r,children:(0,Oe.jsx)(axe,{track:C[p],showImages:c,onTrackEnd:D})}),l&&(0,Oe.jsx)("ol",{className:w("wp-block-playlist__tracklist",{"wp-block-playlist__tracklist-show-numbers":s}),children:I.children}),(0,Oe.jsx)(_a,{attributes:e,setAttributes:t,isSelected:r,insertBlocksAfter:a,label:(0,At.__)("Playlist caption text"),showToolbarButton:r,style:{marginTop:16}})]})]})},YJ=nxe;var bu=o(T(),1),r2=o(v(),1);function XJ({attributes:e}){let{caption:t,showNumbers:r,showTracklist:a,showArtists:n}=e,i=bu.useBlockProps.save(),l=bu.useInnerBlocksProps.save(i);return(0,r2.jsxs)("figure",{...l,children:[(0,r2.jsx)("ol",{className:w("wp-block-playlist__tracklist",{"wp-block-playlist__tracklist-is-hidden":!a,"wp-block-playlist__tracklist-artist-is-hidden":!n,"wp-block-playlist__tracklist-show-numbers":r}),children:l.children}),!bu.RichText.isEmpty(t)&&(0,r2.jsx)(bu.RichText.Content,{tagName:"figcaption",className:(0,bu.__experimentalGetElementClassName)("caption"),value:t})]})}var{name:JJ}=Tw,eee={icon:ni,edit:YJ,save:XJ},ixe=()=>E({name:JJ,metadata:Tw,settings:eee});var rL={};Z(rL,{init:()=>uxe,metadata:()=>Bw,name:()=>nee,settings:()=>iee});var Bw={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,__experimental:!0,name:"core/playlist-track",title:"Playlist track",category:"media",parent:["core/playlist"],description:"Playlist track.",keywords:["music","sound"],textdomain:"default",usesContext:["showArtists","currentTrack"],attributes:{blob:{type:"string",role:"local"},id:{type:"number"},uniqueId:{type:"string"},src:{type:"string"},type:{type:"string",default:"audio"},album:{type:"string"},artist:{type:"string"},image:{type:"string"},length:{type:"string"},title:{type:"string"}},supports:{html:!1,interactivity:{clientNavigation:!0},reusable:!1},style:"wp-block-playlist-track"};var tee=o(Rr(),1),Iw=o(U(),1),bo=o(T(),1),Mi=o(M(),1),ree=o(V(),1),oee=o(xr(),1),eo=o(P(),1);var o2=o(ai(),1);var _t=o(v(),1),tL=["audio"],sxe=["image"],cxe=({attributes:e,setAttributes:t,context:r})=>{let{id:a,uniqueId:n,src:i,album:l,artist:s,image:c,length:u,title:m}=e,[p,d]=(0,Iw.useState)(e.blob),f=r?.showArtists,h=r?.currentTrack,g=(0,Iw.useRef)(),b=(0,bo.useBlockProps)(),{createErrorNotice:y}=(0,ree.useDispatch)(oee.store);function k(C){y(C,{type:"snackbar"})}Es({src:p,allowedTypes:tL,onChange:_,onError:k});function _(C){if(!C||!C.url){t({blob:void 0,id:void 0,uniqueId:void 0,artist:void 0,album:void 0,image:void 0,length:void 0,title:void 0,url:void 0}),d();return}if((0,tee.isBlobURL)(C.url)){d(C.url);return}t({blob:void 0,id:C.id,uniqueId:Am(),src:C.url,artist:C.artist||C?.meta?.artist||C?.media_details?.artist||(0,eo.__)("Unknown artist"),album:C.album||C?.meta?.album||C?.media_details?.album||(0,eo.__)("Unknown album"),image:C?.image?.src&&C?.image?.src.endsWith("/images/media/audio.svg")?"":C?.image?.src,length:C?.fileLength||C?.media_details?.length_formatted,title:C.title}),d()}function x(C){t({image:C.url})}function S(){t({image:void 0}),g.current.focus()}return!i&&!p?(0,_t.jsx)("div",{...b,children:(0,_t.jsx)(bo.MediaPlaceholder,{icon:(0,_t.jsx)(bo.BlockIcon,{icon:ni}),labels:{title:(0,eo.__)("Track"),instructions:(0,eo.__)("Upload an audio file or pick one from your media library.")},onSelect:_,accept:"audio/*",allowedTypes:tL,value:e,onError:k})}):(0,_t.jsxs)(_t.Fragment,{children:[(0,_t.jsx)(bo.BlockControls,{group:"other",children:(0,_t.jsx)(bo.MediaReplaceFlow,{name:(0,eo.__)("Replace"),onSelect:_,accept:"audio/*",mediaId:a,mediaURL:i,allowedTypes:tL,onError:k})}),(0,_t.jsx)(bo.InspectorControls,{children:(0,_t.jsxs)(Mi.PanelBody,{title:(0,eo.__)("Settings"),children:[(0,_t.jsx)(Mi.TextControl,{__next40pxDefaultSize:!0,label:(0,eo.__)("Artist"),value:s?(0,o2.__unstableStripHTML)(s):"",onChange:C=>{t({artist:C})}}),(0,_t.jsx)(Mi.TextControl,{__next40pxDefaultSize:!0,label:(0,eo.__)("Album"),value:l?(0,o2.__unstableStripHTML)(l):"",onChange:C=>{t({album:C})}}),(0,_t.jsx)(Mi.TextControl,{__next40pxDefaultSize:!0,label:(0,eo.__)("Title"),value:m?(0,o2.__unstableStripHTML)(m):"",placeholder:m?(0,o2.__unstableStripHTML)(m):"",onChange:C=>{t({title:C})}}),(0,_t.jsx)(bo.MediaUploadCheck,{children:(0,_t.jsxs)("div",{className:"editor-video-poster-control",children:[(0,_t.jsx)(Mi.BaseControl.VisualLabel,{children:(0,eo.__)("Album cover image")}),!!c&&(0,_t.jsx)("img",{src:c,alt:(0,eo.__)("Preview of the album cover image")}),(0,_t.jsx)(bo.MediaUpload,{title:(0,eo.__)("Select image"),onSelect:x,allowedTypes:sxe,render:({open:C})=>(0,_t.jsx)(Mi.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:C,ref:g,children:c?(0,eo.__)("Replace"):(0,eo.__)("Select")})}),!!c&&(0,_t.jsx)(Mi.Button,{__next40pxDefaultSize:!0,onClick:S,variant:"tertiary",children:(0,eo.__)("Remove")})]})})]})}),(0,_t.jsxs)("li",{...b,children:[!!p&&(0,_t.jsx)(Mi.Spinner,{}),(0,_t.jsxs)("button",{className:"wp-block-playlist-track__button","data-wp-context":JSON.stringify({uniqueId:n}),"aria-current":h===n?"true":"false",children:[(0,_t.jsxs)("span",{className:"wp-block-playlist-track__content",children:[(0,_t.jsx)(bo.RichText,{tagName:"span",className:"wp-block-playlist-track__title",value:m,placeholder:(0,eo.__)("Add title"),onChange:C=>{t({title:C})},allowedFormats:[],withoutInteractiveFormatting:!0}),f&&(0,_t.jsx)(bo.RichText,{tagName:"span",className:"wp-block-playlist-track__artist",value:s,placeholder:(0,eo.__)("Add artist"),onChange:C=>t({artist:C}),allowedFormats:[],withoutInteractiveFormatting:!0})]}),(0,_t.jsxs)("span",{className:"wp-block-playlist-track__length",children:[u&&(0,_t.jsx)("span",{className:"screen-reader-text",children:(0,eo.__)("Length:")}),u]}),(0,_t.jsx)("span",{className:"screen-reader-text",children:(0,eo.__)("Select to play this track")})]})]})]})},aee=cxe;var{name:nee}=Bw,iee={icon:ni,edit:aee},uxe=()=>E({name:nee,metadata:Bw,settings:iee});var aL={};Z(aL,{init:()=>gxe,metadata:()=>Nw,name:()=>hee,settings:()=>gee});var fee=o(P(),1);var Nw={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/post-author",title:"Author (deprecated)",category:"theme",description:"This block is deprecated. Please use the Avatar block, the Author Name block, and the Author Biography block instead.",textdomain:"default",attributes:{textAlign:{type:"string"},avatarSize:{type:"number",default:48},showAvatar:{type:"boolean",default:!0},showBio:{type:"boolean"},byline:{type:"string"},isLink:{type:"boolean",default:!1,role:"content"},linkTarget:{type:"string",default:"_self",role:"content"}},usesContext:["postType","postId","queryId"],supports:{inserter:!1,anchor:!0,html:!1,spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}},filter:{duotone:!0}},selectors:{filter:{duotone:".wp-block-post-author .wp-block-post-author__avatar img"}},editorStyle:"wp-block-post-author-editor",style:"wp-block-post-author"};var pn=o(T(),1),Tr=o(M(),1),mee=o(me(),1),Ew=o(Q(),1),Dd=o(V(),1),Dw=o(U(),1),oL=o(Wo(),1),Sr=o(P(),1),pee=o(W(),1);var Ed=o(W(),1),see=o(P(),1),cee=o(T(),1);var{cleanEmptyObject:lee}=K(cee.privateApis);function uee(e,t){let{avatarSize:r,byline:a,showAvatar:n,showBio:i,isLink:l,linkTarget:s,textAlign:c,style:u,...m}=e,p=n&&t.some(g=>g.name==="core/avatar"),d=a&&t.some(g=>g.name==="core/paragraph"),f=t.some(g=>g.name==="core/post-author-name"),h=i&&t.some(g=>g.name==="core/post-author-biography");return(0,Ed.createBlock)("core/group",{...m,style:lee({...u,spacing:{...u?.spacing,blockGap:"1em"},color:{...u?.color,duotone:void 0}}),layout:{type:"flex",flexWrap:"nowrap",verticalAlignment:"top"}},[p&&(0,Ed.createBlock)("core/avatar",{size:r,style:lee({border:{radius:"0px"},color:{duotone:u?.color?.duotone}})}),(0,Ed.createBlock)("core/group",{style:{layout:{selfStretch:"fill",flexSize:null},spacing:{blockGap:"0"}},layout:{type:"flex",orientation:"vertical",justifyContent:"stretch"}},[d&&(0,Ed.createBlock)("core/paragraph",{content:a,placeholder:(0,see.__)("Write byline\u2026"),style:{typography:{fontSize:"0.5em",textAlign:c}}}),f&&(0,Ed.createBlock)("core/post-author-name",{isLink:l,linkTarget:s,style:{typography:{fontSize:"1em",textAlign:c}}}),h&&(0,Ed.createBlock)("core/post-author-biography",{style:{typography:{fontSize:"0.7em",textAlign:c}}})].filter(Boolean))].filter(Boolean))}var nt=o(v(),1),{InspectorControlsLastItem:pxe}=K(pn.privateApis),dxe={who:"authors",per_page:100,_fields:"id,name",context:"view"};function fxe({value:e,onChange:t}){let[r,a]=(0,Dw.useState)(""),{authors:n,isLoading:i}=(0,Dd.useSelect)(s=>{let{getUsers:c,isResolving:u}=s(Ew.store),m={...dxe};return r&&(m.search=r,m.search_columns=["name"]),{authors:c(m),isLoading:u("getUsers",[m])}},[r]),l=(0,Dw.useMemo)(()=>{let s=(n??[]).map(m=>({value:m.id,label:(0,oL.decodeEntities)(m.name)})),c=s.findIndex(m=>e?.id===m.value),u=[];return c<0&&e?u=[{value:e.id,label:(0,oL.decodeEntities)(e.name)}]:c<0&&!e&&(u=[{value:0,label:(0,Sr.__)("(No author)")}]),[...u,...s]},[n,e]);return(0,nt.jsx)(Tr.ComboboxControl,{__next40pxDefaultSize:!0,label:(0,Sr.__)("Author"),options:l,value:e?.id,onFilterValueChange:(0,mee.debounce)(a,300),onChange:t,allowReset:!1,isLoading:i})}function hxe({isSelected:e,context:{postType:t,postId:r,queryId:a},attributes:n,setAttributes:i,clientId:l}){let s=Number.isFinite(a),c=q(),u=x1(),{authorDetails:m,canAssignAuthor:p,supportsAuthor:d}=(0,Dd.useSelect)(z=>{let{getEditedEntityRecord:I,getUser:R,getPostType:$}=z(Ew.store),j=I("postType",t,r),G=j?.author;return{authorDetails:G?R(G,{context:"view"}):null,supportsAuthor:$(t)?.supports?.author??!1,canAssignAuthor:!!j?._links?.["wp:action-assign-author"]}},[t,r]),f=(0,Dd.useSelect)(z=>z(pee.store).getBlockTypes(),[]),{editEntityRecord:h}=(0,Dd.useDispatch)(Ew.store),{replaceBlock:g}=(0,Dd.useDispatch)(pn.store),{textAlign:b,showAvatar:y,showBio:k,byline:_,isLink:x,linkTarget:S,avatarSize:C}=n,N=[],B=m?.name||(0,Sr.__)("Post Author");m?.avatar_urls&&Object.keys(m.avatar_urls).forEach(z=>{N.push({value:z,label:`${z} x ${z}`})});let D=(0,pn.useBlockProps)({className:w({[`has-text-align-${b}`]:b})}),A=z=>{h("postType",t,r,{author:z})},H=!!r&&!s&&p;if(!d&&t!==void 0)return(0,nt.jsx)("div",{...D,children:(0,Sr.sprintf)((0,Sr.__)("This post type (%s) does not support the author."),t)});function F(){g(l,uee(n,f))}return(0,nt.jsxs)(nt.Fragment,{children:[(0,nt.jsx)(pn.InspectorControls,{children:(0,nt.jsxs)(Tr.__experimentalToolsPanel,{label:(0,Sr.__)("Settings"),resetAll:()=>{i({avatarSize:48,showAvatar:!0,isLink:!1,linkTarget:"_self"})},dropdownMenuProps:c,children:[H&&(0,nt.jsx)("div",{style:{gridColumn:"1 / -1"},children:(0,nt.jsx)(fxe,{value:m,onChange:A})}),(0,nt.jsx)(Tr.__experimentalToolsPanelItem,{label:(0,Sr.__)("Show avatar"),isShownByDefault:!0,hasValue:()=>!y,onDeselect:()=>i({showAvatar:!0}),children:(0,nt.jsx)(Tr.ToggleControl,{label:(0,Sr.__)("Show avatar"),checked:y,onChange:()=>i({showAvatar:!y})})}),y&&(0,nt.jsx)(Tr.__experimentalToolsPanelItem,{label:(0,Sr.__)("Avatar size"),isShownByDefault:!0,hasValue:()=>C!==48,onDeselect:()=>i({avatarSize:48}),children:(0,nt.jsx)(Tr.SelectControl,{__next40pxDefaultSize:!0,label:(0,Sr.__)("Avatar size"),value:C,options:N,onChange:z=>{i({avatarSize:Number(z)})}})}),(0,nt.jsx)(Tr.__experimentalToolsPanelItem,{label:(0,Sr.__)("Show bio"),isShownByDefault:!0,hasValue:()=>!!k,onDeselect:()=>i({showBio:void 0}),children:(0,nt.jsx)(Tr.ToggleControl,{label:(0,Sr.__)("Show bio"),checked:!!k,onChange:()=>i({showBio:!k})})}),(0,nt.jsx)(Tr.__experimentalToolsPanelItem,{label:(0,Sr.__)("Link author name to author page"),isShownByDefault:!0,hasValue:()=>!!x,onDeselect:()=>i({isLink:!1}),children:(0,nt.jsx)(Tr.ToggleControl,{label:(0,Sr.__)("Link author name to author page"),checked:x,onChange:()=>i({isLink:!x})})}),x&&(0,nt.jsx)(Tr.__experimentalToolsPanelItem,{label:(0,Sr.__)("Link target"),isShownByDefault:!0,hasValue:()=>S!=="_self",onDeselect:()=>i({linkTarget:"_self"}),children:(0,nt.jsx)(Tr.ToggleControl,{label:(0,Sr.__)("Open in new tab"),onChange:z=>i({linkTarget:z?"_blank":"_self"}),checked:S==="_blank"})})]})}),f.some(z=>z.name==="core/group")&&(0,nt.jsx)(pxe,{children:(0,nt.jsxs)(Tr.__experimentalVStack,{className:"wp-block-post-author__transform",alignment:"left",spacing:4,children:[(0,nt.jsx)(Tr.__experimentalText,{as:"p",children:(0,Sr.__)("This block is no longer supported. Recreate its design with the Avatar, Author Name and Author Biography blocks.")}),(0,nt.jsx)(Tr.Button,{variant:"primary",onClick:F,__next40pxDefaultSize:!0,children:(0,Sr.__)("Recreate")})]})}),(0,nt.jsx)(pn.BlockControls,{group:"block",children:(0,nt.jsx)(pn.AlignmentControl,{value:b,onChange:z=>{i({textAlign:z})}})}),(0,nt.jsxs)("div",{...D,children:[y&&(0,nt.jsx)("div",{className:"wp-block-post-author__avatar",children:(0,nt.jsx)("img",{width:C,src:m?.avatar_urls?.[C]||u,alt:m?.name||(0,Sr.__)("Default Avatar")})}),(0,nt.jsxs)("div",{className:"wp-block-post-author__content",children:[(!pn.RichText.isEmpty(_)||e)&&(0,nt.jsx)(pn.RichText,{identifier:"byline",className:"wp-block-post-author__byline","aria-label":(0,Sr.__)("Post author byline text"),placeholder:(0,Sr.__)("Write byline\u2026"),value:_,onChange:z=>i({byline:z})}),(0,nt.jsx)("p",{className:"wp-block-post-author__name",children:x?(0,nt.jsx)("a",{href:"#post-author-pseudo-link",onClick:z=>z.preventDefault(),children:B}):B}),k&&(0,nt.jsx)("p",{className:"wp-block-post-author__bio",dangerouslySetInnerHTML:{__html:m?.description}})]})]})]})}var dee=hxe;var{name:hee}=Nw,gee={icon:Bp,example:{viewportWidth:350,attributes:{showBio:!0,byline:(0,fee.__)("Posted by")}},edit:dee},gxe=()=>E({name:hee,metadata:Nw,settings:gee});var nL={};Z(nL,{init:()=>xxe,metadata:()=>Lw,name:()=>wee,settings:()=>Cee});var Lw={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/post-author-name",title:"Author Name",category:"theme",description:"The author name.",textdomain:"default",attributes:{isLink:{type:"boolean",default:!1,role:"content"},linkTarget:{type:"string",default:"_self",role:"content"}},usesContext:["postType","postId"],example:{viewportWidth:350},supports:{anchor:!0,html:!1,spacing:{margin:!0,padding:!0},color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},typography:{fontSize:!0,lineHeight:!0,textAlign:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}}},style:"wp-block-post-author-name"};var Mw=o(T(),1),vee=o(V(),1),dc=o(P(),1),bee=o(Q(),1),zm=o(M(),1);var Ai=o(v(),1);function bxe(e){Kr(e);let{attributes:{isLink:t,linkTarget:r},setAttributes:a,context:{postType:n,postId:i}}=e,{authorName:l,supportsAuthor:s}=(0,vee.useSelect)(d=>{let{getEditedEntityRecord:f,getUser:h,getPostType:g}=d(bee.store),b=f("postType",n,i)?.author;return{authorName:b?h(b):null,supportsAuthor:g(n)?.supports?.author??!1}},[n,i]),c=(0,Mw.useBlockProps)(),u=l?.name||(0,dc.__)("Author Name"),m=t?(0,Ai.jsx)("a",{href:"#author-pseudo-link",onClick:d=>d.preventDefault(),className:"wp-block-post-author-name__link",children:u}):u,p=q();return(0,Ai.jsxs)(Ai.Fragment,{children:[(0,Ai.jsx)(Mw.InspectorControls,{children:(0,Ai.jsxs)(zm.__experimentalToolsPanel,{label:(0,dc.__)("Settings"),resetAll:()=>{a({isLink:!1,linkTarget:"_self"})},dropdownMenuProps:p,children:[(0,Ai.jsx)(zm.__experimentalToolsPanelItem,{label:(0,dc.__)("Link to author archive"),isShownByDefault:!0,hasValue:()=>t,onDeselect:()=>a({isLink:!1}),children:(0,Ai.jsx)(zm.ToggleControl,{label:(0,dc.__)("Link to author archive"),onChange:()=>a({isLink:!t}),checked:t})}),t&&(0,Ai.jsx)(zm.__experimentalToolsPanelItem,{label:(0,dc.__)("Open in new tab"),isShownByDefault:!0,hasValue:()=>r!=="_self",onDeselect:()=>a({linkTarget:"_self"}),children:(0,Ai.jsx)(zm.ToggleControl,{label:(0,dc.__)("Open in new tab"),onChange:d=>a({linkTarget:d?"_blank":"_self"}),checked:r==="_blank"})})]})}),(0,Ai.jsx)("div",{...c,children:!s&&n!==void 0?(0,dc.sprintf)((0,dc.__)("This post type (%s) does not support the author."),n):m})]})}var yee=bxe;var yxe={attributes:{isLink:{type:"boolean",default:!1,role:"content"},linkTarget:{type:"string",default:"_self",role:"content"},textAlign:{type:"string"}},supports:{anchor:!0,html:!1,spacing:{margin:!0,padding:!0},color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}}},migrate:We,isEligible(e){return!!e.textAlign||!!e.className?.match(/\bhas-text-align-(left|center|right)\b/)},save:()=>null},_ee=[yxe];var xee=o(W(),1),_xe={from:[{type:"block",blocks:["core/post-author"],transform:({textAlign:e})=>(0,xee.createBlock)("core/post-author-name",{style:{typography:{textAlign:e}}})}]},kee=_xe;var{name:wee}=Lw,Cee={icon:Bp,transforms:kee,edit:yee,deprecated:_ee},xxe=()=>E({name:wee,metadata:Lw,settings:Cee});var iL={};Z(iL,{init:()=>Sxe,metadata:()=>Aw,name:()=>Eee,settings:()=>Dee});var Aw={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/post-author-biography",title:"Author Biography",category:"theme",description:"The author biography.",textdomain:"default",usesContext:["postType","postId"],example:{viewportWidth:350},supports:{anchor:!0,spacing:{margin:!0,padding:!0},color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},typography:{fontSize:!0,lineHeight:!0,textAlign:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}}},style:"wp-block-post-author-biography"};var See=o(T(),1),Tee=o(V(),1),Pee=o(P(),1),Bee=o(Q(),1);var a2=o(v(),1);function wxe(e){Kr(e);let{context:{postType:t,postId:r}}=e,{authorDetails:a}=(0,Tee.useSelect)(l=>{let{getEditedEntityRecord:s,getUser:c}=l(Bee.store),u=s("postType",t,r)?.author;return{authorDetails:u?c(u):null}},[t,r]),n=(0,See.useBlockProps)(),i=a?.description||(0,Pee.__)("Author Biography");return(0,a2.jsx)(a2.Fragment,{children:(0,a2.jsx)("div",{...n,dangerouslySetInnerHTML:{__html:i}})})}var Iee=wxe;var Cxe={attributes:{textAlign:{type:"string"}},supports:{anchor:!0,spacing:{margin:!0,padding:!0},color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}}},migrate:We,isEligible(e){return!!e.textAlign||!!e.className?.match(/\bhas-text-align-(left|center|right)\b/)},save:()=>null},Nee=[Cxe];var{name:Eee}=Aw,Dee={icon:Bp,edit:Iee,deprecated:Nee},Sxe=()=>E({name:Eee,metadata:Aw,settings:Dee});var lL={};Z(lL,{init:()=>Bxe,metadata:()=>Rw,name:()=>zee,settings:()=>Vee});var Rw={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,__experimental:"fse",name:"core/post-comment",title:"Comment (deprecated)",category:"theme",allowedBlocks:["core/avatar","core/comment-author-name","core/comment-content","core/comment-date","core/comment-edit-link","core/comment-reply-link"],description:"This block is deprecated. Please use the Comments block instead.",textdomain:"default",attributes:{commentId:{type:"number"}},providesContext:{commentId:"commentId"},supports:{html:!1,inserter:!1,interactivity:{clientNavigation:!0}}};var n2=o(P(),1),mg=o(M(),1),Lee=o(U(),1);var zw=o(T(),1),Ld=o(v(),1),Pxe=[["core/avatar"],["core/comment-author-name"],["core/comment-date"],["core/comment-content"],["core/comment-reply-link"],["core/comment-edit-link"]];function Mee({attributes:{commentId:e},setAttributes:t}){let[r,a]=(0,Lee.useState)(e),n=(0,zw.useBlockProps)(),i=(0,zw.useInnerBlocksProps)(n,{template:Pxe});return e?(0,Ld.jsx)("div",{...i}):(0,Ld.jsx)("div",{...n,children:(0,Ld.jsxs)(mg.Placeholder,{icon:VS,label:(0,n2._x)("Post Comment","block title"),instructions:(0,n2.__)("To show a comment, input the comment ID."),children:[(0,Ld.jsx)(mg.TextControl,{__next40pxDefaultSize:!0,value:e,onChange:l=>a(parseInt(l))}),(0,Ld.jsx)(mg.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:()=>{t({commentId:r})},children:(0,n2.__)("Save")})]})})}var Vw=o(T(),1),Aee=o(v(),1);function Ree(){let e=Vw.useBlockProps.save(),t=Vw.useInnerBlocksProps.save(e);return(0,Aee.jsx)("div",{...t})}var{name:zee}=Rw,Vee={icon:N0,edit:Mee,save:Ree},Bxe=()=>E({name:zee,metadata:Rw,settings:Vee});var sL={};Z(sL,{init:()=>Dxe,metadata:()=>Fw,name:()=>qee,settings:()=>Zee});var Fw={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/post-comments-count",title:"Comments Count",category:"theme",description:"Display a post's comments count.",textdomain:"default",usesContext:["postId"],example:{viewportWidth:350},supports:{anchor:!0,html:!1,color:{gradients:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,textAlign:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0},interactivity:{clientNavigation:!0}},style:"wp-block-post-comments-count"};var Fee=o(T(),1),Hw=o(U(),1),Hee=o(G1(),1),Oee=o(mr(),1),jee=o(v(),1);function Uee({context:e}){let{postId:t}=e,[r,a]=(0,Hw.useState)(),n=(0,Fee.useBlockProps)();(0,Hw.useEffect)(()=>{if(!t)return;let s=t;(0,Hee.default)({path:(0,Oee.addQueryArgs)("/wp/v2/comments",{post:t}),parse:!1}).then(c=>{s===t&&a(c.headers.get("X-WP-Total"))})},[t]);let i=t&&r!==void 0,l={...n.style,textDecoration:i?n.style?.textDecoration:void 0};return(0,jee.jsx)("div",{...n,style:l,children:i?r:"0"})}var Gee=o(W(),1),Nxe={to:[{type:"block",blocks:["core/post-comments-link"],transform:({style:e})=>{let t=e?.typography?.textAlign;return(0,Gee.createBlock)("core/post-comments-link",{...t&&{style:{typography:{textAlign:t}}}})}}]},Wee=Nxe;var Exe={attributes:{textAlign:{type:"string"}},supports:{anchor:!0,html:!1,spacing:{margin:!0,padding:!0},color:{gradients:!0,__experimentalDefaultControls:{background:!0,text:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0}},migrate:We,isEligible(e){return!!e.textAlign||!!e.className?.match(/\bhas-text-align-(left|center|right)\b/)},save:()=>null},$ee=[Exe];var{name:qee}=Fw,Zee={icon:Y0,edit:Uee,transforms:Wee,deprecated:$ee},Dxe=()=>E({name:qee,metadata:Fw,settings:Zee});var uL={};Z(uL,{init:()=>Axe,metadata:()=>Ow,name:()=>Jee,settings:()=>ete});var Ow={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/post-comments-form",title:"Comments Form",category:"theme",description:"Display a post's comments form.",textdomain:"default",usesContext:["postId","postType"],supports:{anchor:!0,html:!1,color:{gradients:!0,heading:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,textAlign:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}}},editorStyle:"wp-block-post-comments-form-editor",style:["wp-block-post-comments-form","wp-block-buttons","wp-block-button"],example:{attributes:{style:{typography:{textAlign:"center"}}}}};var Kee=o(T(),1),Qee=o(M(),1),Yee=o(me(),1),jw=o(P(),1);var i2=o(v(),1);function cL({context:e}){let{postId:t,postType:r}=e,a=(0,Yee.useInstanceId)(cL),n=(0,jw.sprintf)("comments-form-edit-%d-desc",a),i=(0,Kee.useBlockProps)({"aria-describedby":n});return(0,i2.jsxs)("div",{...i,children:[(0,i2.jsx)(Sk,{postId:t,postType:r}),(0,i2.jsx)(Qee.VisuallyHidden,{id:n,children:(0,jw.__)("Comments form disabled in editor.")})]})}var Mxe={attributes:{textAlign:{type:"string"}},supports:{anchor:!0,html:!1,spacing:{margin:!0,padding:!0},color:{gradients:!0,heading:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}}},migrate:We,isEligible(e){return!!e.textAlign||!!e.className?.match(/\bhas-text-align-(left|center|right)\b/)},save:()=>null},Xee=[Mxe];var{name:Jee}=Ow,ete={icon:uP,edit:cL,deprecated:Xee},Axe=()=>E({name:Jee,metadata:Ow,settings:ete});var mL={};Z(mL,{init:()=>Hxe,metadata:()=>Uw,name:()=>ute,settings:()=>mte});var Uw={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/post-comments-link",title:"Comments Link",category:"theme",description:"Displays the link to the current post comments.",textdomain:"default",usesContext:["postType","postId"],example:{viewportWidth:350},supports:{anchor:!0,html:!1,color:{link:!0,text:!1,__experimentalDefaultControls:{background:!0,link:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,textAlign:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}}},style:"wp-block-post-comments-link"};var tte=o(T(),1),Ww=o(U(),1),rte=o(V(),1),ote=o(G1(),1),ate=o(mr(),1),Md=o(P(),1),nte=o(Q(),1),Gw=o(v(),1);function zxe({context:e}){let{postType:t,postId:r}=e,[a,n]=(0,Ww.useState)(),i=(0,tte.useBlockProps)();(0,Ww.useEffect)(()=>{if(!r)return;let c=r;(0,ote.default)({path:(0,ate.addQueryArgs)("/wp/v2/comments",{post:r}),parse:!1}).then(u=>{c===r&&n(u.headers.get("X-WP-Total"))})},[r]);let l=(0,rte.useSelect)(c=>c(nte.store).getEditedEntityRecord("postType",t,r),[t,r]),s;if(a!==void 0){let c=parseInt(a);c===0?s=(0,Md.__)("No comments"):s=(0,Md.sprintf)((0,Md._n)("%s comment","%s comments",c),c.toLocaleString())}return(0,Gw.jsx)("div",{...i,children:l?.link&&s!==void 0?(0,Gw.jsx)("a",{href:l?.link+"#comments",onClick:c=>c.preventDefault(),children:s}):(0,Gw.jsx)("a",{href:"#post-comments-link-pseudo-link",onClick:c=>c.preventDefault(),children:(0,Md.__)("No comments")})})}var ite=zxe;var lte=o(W(),1),Vxe={to:[{type:"block",blocks:["core/post-comments-count"],transform:({style:e})=>{let t=e?.typography?.textAlign;return(0,lte.createBlock)("core/post-comments-count",{...t&&{style:{typography:{textAlign:t}}}})}}]},ste=Vxe;var Fxe={attributes:{textAlign:{type:"string"}},supports:{anchor:!0,html:!1,spacing:{margin:!0,padding:!0},color:{link:!0,text:!1,__experimentalDefaultControls:{background:!0,link:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}}},migrate:We,isEligible(e){return!!e.textAlign||!!e.className?.match(/\bhas-text-align-(left|center|right)\b/)},save:()=>null},cte=[Fxe];var{name:ute}=Uw,mte={edit:ite,icon:Y0,transforms:ste,deprecated:cte},Hxe=()=>E({name:ute,metadata:Uw,settings:mte});var pL={};Z(pL,{init:()=>Kxe,metadata:()=>$w,name:()=>gte,settings:()=>vte});var $w={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/post-content",title:"Content",category:"theme",description:"Displays the contents of a post or page.",textdomain:"default",usesContext:["postId","postType","queryId"],attributes:{tagName:{type:"string",default:"div"}},example:{viewportWidth:350},supports:{anchor:!0,align:["wide","full"],html:!1,layout:!0,background:{backgroundImage:!0,backgroundSize:!0,__experimentalDefaultControls:{backgroundImage:!0}},dimensions:{minHeight:!0},spacing:{blockGap:!0,padding:!0,margin:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},color:{gradients:!0,heading:!0,link:!0,__experimentalDefaultControls:{background:!1,text:!1}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}}},style:"wp-block-post-content",editorStyle:"wp-block-post-content-editor"};var Ad=o(P(),1),to=o(T(),1),pte=o(W(),1),pg=o(Q(),1),dte=o(V(),1),fte=o(U(),1);var ir=o(v(),1),{HTMLElementControl:jxe}=K(to.privateApis);function Uxe({parentLayout:e,layoutClassNames:t,userCanEdit:r,postType:a,postId:n,tagName:i="div"}){let[,,l]=(0,pg.useEntityProp)("postType",a,"content",n),s=(0,to.useBlockProps)({className:t}),c=(0,fte.useMemo)(()=>l?.raw?(0,pte.parse)(l.raw):[],[l?.raw]),u=(0,to.__experimentalUseBlockPreview)({blocks:c,props:s,layout:e});return r?(0,ir.jsx)("div",{...u}):l?.protected?(0,ir.jsx)(i,{...s,children:(0,ir.jsx)(to.Warning,{children:(0,Ad.__)("This content is password protected.")})}):(0,ir.jsx)(i,{...s,dangerouslySetInnerHTML:{__html:l?.rendered}})}function Gxe({context:e={},tagName:t="div"}){let{postType:r,postId:a}=e,[n,i,l]=(0,pg.useEntityBlockEditor)("postType",r,{id:a}),c=!!(0,dte.useSelect)(p=>p(pg.store).getEntityRecord("postType",r,a),[r,a])?.content?.raw||n?.length,u=[["core/paragraph"]],m=(0,to.useInnerBlocksProps)((0,to.useBlockProps)({className:"entry-content"}),{value:n,onInput:i,onChange:l,template:c?void 0:u});return(0,ir.jsx)(t,{...m})}function Wxe(e){let{context:{queryId:t,postType:r,postId:a}={},layoutClassNames:n,tagName:i}=e,l=Sx("postType",r,a);if(l===void 0)return null;let s=Number.isFinite(t);return l&&!s?(0,ir.jsx)(Gxe,{...e}):(0,ir.jsx)(Uxe,{parentLayout:e.parentLayout,layoutClassNames:n,userCanEdit:l,postType:r,postId:a,tagName:i})}function $xe({layoutClassNames:e}){let t=(0,to.useBlockProps)({className:e});return(0,ir.jsxs)("div",{...t,children:[(0,ir.jsx)("p",{children:(0,Ad.__)("This is the Content block, it will display all the blocks in any single post or page.")}),(0,ir.jsx)("p",{children:(0,Ad.__)("That might be a simple arrangement like consecutive paragraphs in a blog post, or a more elaborate composition that includes image galleries, videos, tables, columns, and any other block types.")}),(0,ir.jsx)("p",{children:(0,Ad.__)("If there are any Custom Post Types registered at your site, the Content block can display the contents of those entries as well.")})]})}function qxe(){let e=(0,to.useBlockProps)();return(0,ir.jsx)("div",{...e,children:(0,ir.jsx)(to.Warning,{children:(0,Ad.__)("Block cannot be rendered inside itself.")})})}function Zxe({tagName:e,onSelectTagName:t,clientId:r}){return(0,ir.jsx)(to.InspectorControls,{group:"advanced",children:(0,ir.jsx)(jxe,{tagName:e,onChange:t,clientId:r,options:[{label:(0,Ad.__)("Default (<div>)"),value:"div"},{label:"<main>",value:"main"},{label:"<section>",value:"section"},{label:"<article>",value:"article"}]})})}function hte({context:e,attributes:{tagName:t="div"},setAttributes:r,clientId:a,__unstableLayoutClassNames:n,__unstableParentLayout:i}){let{postId:l,postType:s}=e,c=(0,to.useHasRecursion)(l);return l&&s&&c?(0,ir.jsx)(qxe,{}):(0,ir.jsxs)(ir.Fragment,{children:[(0,ir.jsx)(Zxe,{tagName:t,onSelectTagName:m=>{r({tagName:m})},clientId:a}),(0,ir.jsx)(to.RecursionProvider,{uniqueId:l,children:l&&s?(0,ir.jsx)(Wxe,{context:e,parentLayout:i,layoutClassNames:n}):(0,ir.jsx)($xe,{layoutClassNames:n})})]})}var{name:gte}=$w,vte={icon:fP,edit:hte},Kxe=()=>E({name:gte,metadata:$w,settings:vte});var dL={};Z(dL,{init:()=>rke,metadata:()=>qw,name:()=>Cte,settings:()=>Ste});var qw={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/post-date",title:"Date",category:"theme",description:"Display a custom date.",textdomain:"default",attributes:{datetime:{type:"string",role:"content"},textAlign:{type:"string"},format:{type:"string"},isLink:{type:"boolean",default:!1,role:"content"}},usesContext:["postId","postType","queryId"],example:{viewportWidth:350},supports:{anchor:!0,html:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}}}};var bte=o(Q(),1),dg=o(U(),1),Rd=o(Lk(),1),Ra=o(T(),1),Ri=o(M(),1),dn=o(P(),1);var yte=o(As(),1),l2=o(V(),1),_te=o(W(),1);var ro=o(v(),1);function xte({attributes:e,context:{postType:t,queryId:r},setAttributes:a,name:n}){let{datetime:i,textAlign:l,format:s,isLink:c}=e,u=(0,Ra.useBlockProps)({className:w({[`has-text-align-${l}`]:l})}),m=q(),[p,d]=(0,dg.useState)(null),f=(0,dg.useMemo)(()=>({anchor:p}),[p]),{__unstableMarkNextChangeAsNotPersistent:h}=(0,l2.useDispatch)(Ra.store);(0,dg.useEffect)(()=>{i===void 0&&(h(),a({datetime:new Date}))},[i]);let g=Number.isFinite(r),b=(0,Rd.getSettings)(),{postType:y,siteFormat:k=b.formats.date,siteTimeFormat:_=b.formats.time}=(0,l2.useSelect)(N=>{let{getPostType:B,getEntityRecord:D}=N(bte.store),A=D("root","site");return{siteFormat:A?.date_format,siteTimeFormat:A?.time_format,postType:t?B(t):null}},[t]),x=(0,l2.useSelect)(N=>N(_te.store).getActiveBlockVariation(n,e)?.name,[n,e]),S=(0,Ra.useBlockEditingMode)(),C=(0,ro.jsx)("time",{dateTime:(0,Rd.dateI18n)("c",i),ref:d,children:s==="human-diff"?(0,Rd.humanTimeDiff)(i):(0,Rd.dateI18n)(s||k,i)});return c&&i&&(C=(0,ro.jsx)("a",{href:"#post-date-pseudo-link",onClick:N=>N.preventDefault(),children:C})),(0,ro.jsxs)(ro.Fragment,{children:[(S==="default"||!g)&&(0,ro.jsxs)(Ra.BlockControls,{group:"block",children:[(0,ro.jsx)(Ra.AlignmentControl,{value:l,onChange:N=>{a({textAlign:N})}}),x!=="post-date-modified"&&(!g||!x)&&(0,ro.jsx)(Ri.ToolbarGroup,{children:(0,ro.jsx)(Ri.Dropdown,{popoverProps:f,renderContent:({onClose:N})=>(0,ro.jsx)(Ra.__experimentalPublishDateTimePicker,{title:x==="post-date"?(0,dn.__)("Publish Date"):(0,dn.__)("Date"),currentDate:i,onChange:B=>a({datetime:B}),is12Hour:Yxe(_),onClose:N,dateOrder:(0,dn._x)("dmy","date order")}),renderToggle:({isOpen:N,onToggle:B})=>{let D=A=>{!N&&A.keyCode===yte.DOWN&&(A.preventDefault(),B())};return(0,ro.jsx)(Ri.ToolbarButton,{"aria-expanded":N,icon:Pp,title:(0,dn.__)("Change Date"),onClick:B,onKeyDown:D})}})})]}),(0,ro.jsx)(Ra.InspectorControls,{children:(0,ro.jsxs)(Ri.__experimentalToolsPanel,{label:(0,dn.__)("Settings"),resetAll:()=>{a({datetime:void 0,format:void 0,isLink:!1})},dropdownMenuProps:m,children:[(0,ro.jsx)(Ri.__experimentalToolsPanelItem,{hasValue:()=>!!s,label:(0,dn.__)("Date Format"),onDeselect:()=>a({format:void 0}),isShownByDefault:!0,children:(0,ro.jsx)(Ra.__experimentalDateFormatPicker,{format:s,defaultFormat:k,onChange:N=>a({format:N})})}),(0,ro.jsx)(Ri.__experimentalToolsPanelItem,{hasValue:()=>c!==!1,label:y?.labels.singular_name?(0,dn.sprintf)((0,dn.__)("Link to %s"),y.labels.singular_name.toLowerCase()):(0,dn.__)("Link to post"),onDeselect:()=>a({isLink:!1}),isShownByDefault:!0,children:(0,ro.jsx)(Ri.ToggleControl,{label:y?.labels.singular_name?(0,dn.sprintf)((0,dn.__)("Link to %s"),y.labels.singular_name.toLowerCase()):(0,dn.__)("Link to post"),onChange:()=>a({isLink:!c}),checked:c})})]})}),(0,ro.jsx)("div",{...u,children:C})]})}function Yxe(e){return/(?:^|[^\\])[aAgh]/.test(e)}var Xxe={attributes:{datetime:{type:"string",role:"content"},textAlign:{type:"string"},format:{type:"string"},isLink:{type:"boolean",default:!1,role:"content"}},supports:{html:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}}},save(){return null},migrate({metadata:{bindings:{datetime:{source:e,args:{key:t,...r}},...a},...n},...i}){return{metadata:{bindings:{datetime:{source:e,args:{field:t,...r}},...a},...n},...i}},isEligible(e){return e?.metadata?.bindings?.datetime?.source==="core/post-data"&&!!e?.metadata?.bindings?.datetime?.args?.key}},Jxe={attributes:{textAlign:{type:"string"},format:{type:"string"},isLink:{type:"boolean",default:!1,role:"content"},displayType:{type:"string",default:"date"}},supports:{html:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}}},save(){return null},migrate({className:e,displayType:t,metadata:r,...a}){if(t==="date"||t==="modified")return t==="modified"&&(e=w(e,"wp-block-post-date__modified-date")),{...a,className:e,metadata:{...r,bindings:{datetime:{source:"core/post-data",args:{field:t}}}}}},isEligible(e){return!e.datetime&&!e?.metadata?.bindings?.datetime}},eke={attributes:{textAlign:{type:"string"},format:{type:"string"},isLink:{type:"boolean",default:!1}},supports:{html:!1,color:{gradients:!0,link:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalLetterSpacing:!0}},save(){return null},migrate:Ot,isEligible({style:e}){return e?.typography?.fontFamily}},kte=[Xxe,Jxe,eke];var s2=o(P(),1),tke=[{name:"post-date",title:(0,s2.__)("Post Date"),description:(0,s2.__)("Display a post's publish date."),attributes:{metadata:{bindings:{datetime:{source:"core/post-data",args:{field:"date"}}}}},scope:["inserter","transform"],isActive:e=>e?.metadata?.bindings?.datetime?.source==="core/post-data"&&e?.metadata?.bindings?.datetime?.args?.field==="date"},{name:"post-date-modified",title:(0,s2.__)("Modified Date"),description:(0,s2.__)("Display a post's last updated date."),attributes:{metadata:{bindings:{datetime:{source:"core/post-data",args:{field:"modified"}}}},className:"wp-block-post-date__modified-date"},scope:["inserter","transform"],isActive:e=>e?.metadata?.bindings?.datetime?.source==="core/post-data"&&e?.metadata?.bindings?.datetime?.args?.field==="modified"}],wte=tke;var{name:Cte}=qw,Ste={icon:e1,edit:xte,deprecated:kte,variations:wte},rke=()=>E({name:Cte,metadata:qw,settings:Ste});var hL={};Z(hL,{init:()=>nke,metadata:()=>Zw,name:()=>Ete,settings:()=>Dte});var Zw={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/post-excerpt",title:"Excerpt",category:"theme",description:"Display the excerpt.",textdomain:"default",attributes:{textAlign:{type:"string"},moreText:{type:"string",role:"content"},showMoreOnNewLine:{type:"boolean",default:!0},excerptLength:{type:"number",default:55}},usesContext:["postId","postType","queryId"],example:{viewportWidth:350},supports:{anchor:!0,html:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,textColumns:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}}},editorStyle:"wp-block-post-excerpt-editor",style:"wp-block-post-excerpt"};var Kw=o(Q(),1),Pte=o(U(),1),ua=o(T(),1),yu=o(M(),1),fn=o(P(),1),Bte=o(V(),1);var Xt=o(v(),1),Tte="\u2026";function Ite({attributes:{textAlign:e,moreText:t,showMoreOnNewLine:r,excerptLength:a},setAttributes:n,isSelected:i,context:{postId:l,postType:s,queryId:c}}){let m=(0,ua.useBlockEditingMode)()==="default",p=Number.isFinite(c),d=Sx("postType",s,l),[f,h,{rendered:g,protected:b}={}]=(0,Kw.useEntityProp)("postType",s,"excerpt",l),y=q(),k=(0,Bte.useSelect)(z=>s==="page"?!0:!!z(Kw.store).getPostType(s)?.supports?.excerpt,[s]),_=d&&!p&&k,x=(0,ua.useBlockProps)({className:w({[`has-text-align-${e}`]:e})}),S=(0,fn._x)("words","Word count type. Do not translate!"),C=(0,Pte.useMemo)(()=>{if(!g)return"";let z=new window.DOMParser().parseFromString(g,"text/html");return z.body.textContent||z.body.innerText||""},[g]);if(!s||!l)return(0,Xt.jsxs)(Xt.Fragment,{children:[(0,Xt.jsx)(ua.BlockControls,{children:(0,Xt.jsx)(ua.AlignmentToolbar,{value:e,onChange:z=>n({textAlign:z})})}),(0,Xt.jsx)("div",{...x,children:(0,Xt.jsx)("p",{children:(0,fn.__)("This block will display the excerpt.")})})]});if(b&&!d)return(0,Xt.jsx)("div",{...x,children:(0,Xt.jsx)(ua.Warning,{children:(0,fn.__)("The content is currently protected and does not have the available excerpt.")})});let N=(0,Xt.jsx)(ua.RichText,{identifier:"moreText",className:"wp-block-post-excerpt__more-link",tagName:"a","aria-label":(0,fn.__)("\u201CRead more\u201D link text"),placeholder:(0,fn.__)('Add "read more" link text'),value:t,onChange:z=>n({moreText:z}),withoutInteractiveFormatting:!0}),B=w("wp-block-post-excerpt__excerpt",{"is-inline":!r}),D=(f||C).trim(),A="";if(S==="words")A=D.split(/\s+/,a).join(" ");else if(S==="characters_excluding_spaces"){let z=D.split("",a).join(""),I=z.length-z.replaceAll(" ","").length;A=D.split("",a+I).join("")}else S==="characters_including_spaces"&&(A=D.split("",a).join(""));let H=A!==D,F=_?(0,Xt.jsx)(ua.RichText,{className:B,"aria-label":(0,fn.__)("Excerpt text"),value:i?D:(H?A+Tte:D)||(0,fn.__)("No excerpt found"),onChange:h,tagName:"p",allowedFormats:[],preserveWhiteSpace:!0}):(0,Xt.jsx)("p",{className:B,children:H?A+Tte:D||(0,fn.__)("No excerpt found")});return(0,Xt.jsxs)(Xt.Fragment,{children:[m&&(0,Xt.jsx)(ua.BlockControls,{children:(0,Xt.jsx)(ua.AlignmentToolbar,{value:e,onChange:z=>n({textAlign:z})})}),(0,Xt.jsx)(ua.InspectorControls,{children:(0,Xt.jsxs)(yu.__experimentalToolsPanel,{label:(0,fn.__)("Settings"),resetAll:()=>{n({showMoreOnNewLine:!0,excerptLength:55})},dropdownMenuProps:y,children:[(0,Xt.jsx)(yu.__experimentalToolsPanelItem,{hasValue:()=>r!==!0,label:(0,fn.__)("Show link on new line"),onDeselect:()=>n({showMoreOnNewLine:!0}),isShownByDefault:!0,children:(0,Xt.jsx)(yu.ToggleControl,{label:(0,fn.__)("Show link on new line"),checked:r,onChange:z=>n({showMoreOnNewLine:z})})}),(0,Xt.jsx)(yu.__experimentalToolsPanelItem,{hasValue:()=>a!==55,label:(0,fn.__)("Max number of words"),onDeselect:()=>n({excerptLength:55}),isShownByDefault:!0,children:(0,Xt.jsx)(yu.RangeControl,{__next40pxDefaultSize:!0,label:(0,fn.__)("Max number of words"),value:a,onChange:z=>{n({excerptLength:z})},min:"10",max:"100"})})]})}),(0,Xt.jsxs)("div",{...x,children:[F,!r&&" ",r?(0,Xt.jsx)("p",{className:"wp-block-post-excerpt__more-text",children:N}):N]})]})}var fL=o(W(),1),ake={from:[{type:"block",blocks:["core/post-content"],transform:()=>(0,fL.createBlock)("core/post-excerpt")}],to:[{type:"block",blocks:["core/post-content"],transform:()=>(0,fL.createBlock)("core/post-content")}]},Nte=ake;var{name:Ete}=Zw,Dte={icon:gP,transforms:Nte,edit:Ite},nke=()=>E({name:Ete,metadata:Zw,settings:Dte});var bL={};Z(bL,{init:()=>fke,metadata:()=>Qw,name:()=>Wte,settings:()=>$te});var Qw={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/post-featured-image",title:"Featured Image",category:"theme",description:"Display a post's featured image.",textdomain:"default",attributes:{isLink:{type:"boolean",default:!1,role:"content"},aspectRatio:{type:"string"},width:{type:"string"},height:{type:"string"},scale:{type:"string",default:"cover"},sizeSlug:{type:"string"},rel:{type:"string",attribute:"rel",default:"",role:"content"},linkTarget:{type:"string",default:"_self",role:"content"},overlayColor:{type:"string"},customOverlayColor:{type:"string"},dimRatio:{type:"number",default:0},gradient:{type:"string"},customGradient:{type:"string"},useFirstImageFromPost:{type:"boolean",default:!1}},usesContext:["postId","postType","queryId"],example:{viewportWidth:350},supports:{anchor:!0,align:["left","right","center","wide","full"],color:{text:!1,background:!1},__experimentalBorder:{color:!0,radius:!0,width:!0,__experimentalSkipSerialization:!0,__experimentalDefaultControls:{color:!0,radius:!0,width:!0}},filter:{duotone:!0},shadow:{__experimentalSkipSerialization:!0},html:!1,spacing:{margin:!0,padding:!0},interactivity:{clientNavigation:!0}},selectors:{border:".wp-block-post-featured-image img, .wp-block-post-featured-image .block-editor-media-placeholder, .wp-block-post-featured-image .wp-block-post-featured-image__overlay",shadow:".wp-block-post-featured-image img, .wp-block-post-featured-image .components-placeholder",filter:{duotone:".wp-block-post-featured-image img, .wp-block-post-featured-image .wp-block-post-featured-image__placeholder, .wp-block-post-featured-image .components-placeholder__illustration, .wp-block-post-featured-image .components-placeholder::before"}},editorStyle:"wp-block-post-featured-image-editor",style:"wp-block-post-featured-image"};var Ote=o(Rr(),1),c2=o(Q(),1),u2=o(V(),1),yo=o(M(),1),Lr=o(T(),1),Om=o(U(),1),Fo=o(P(),1);var jte=o(xr(),1);var za=o(P(),1),Vo=o(M(),1),Lte=o(T(),1),zo=o(v(),1),lke=(0,zo.jsxs)(zo.Fragment,{children:[(0,zo.jsx)(Vo.__experimentalToggleGroupControlOption,{value:"cover",label:(0,za._x)("Cover","Scale option for Image dimension control")}),(0,zo.jsx)(Vo.__experimentalToggleGroupControlOption,{value:"contain",label:(0,za._x)("Contain","Scale option for Image dimension control")}),(0,zo.jsx)(Vo.__experimentalToggleGroupControlOption,{value:"fill",label:(0,za._x)("Fill","Scale option for Image dimension control")})]}),gL="cover",ske={cover:(0,za.__)("Image is scaled and cropped to fill the entire space without being distorted."),contain:(0,za.__)("Image is scaled to fill the space without clipping nor distorting."),fill:(0,za.__)("Image will be stretched and distorted to completely fill the space.")},cke=({clientId:e,attributes:{aspectRatio:t,width:r,height:a,scale:n},setAttributes:i})=>{let[l,s,c,u]=(0,Lte.useSettings)("spacing.units","dimensions.aspectRatios.default","dimensions.aspectRatios.theme","dimensions.defaultAspectRatios"),m=(0,Vo.__experimentalUseCustomUnits)({availableUnits:l||["px","%","vw","em","rem"]}),p=(y,k)=>{let _=parseFloat(k);isNaN(_)&&k||i({[y]:_<0?"0":k})},d=(0,za._x)("Scale","Image scaling options"),f=a||t&&t!=="auto",h=c?.map(({name:y,ratio:k})=>({label:y,value:k})),g=s?.map(({name:y,ratio:k})=>({label:y,value:k})),b=[{label:(0,za._x)("Original","Aspect ratio option for dimensions control"),value:"auto"},...u?g:[],...h||[]];return(0,zo.jsxs)(zo.Fragment,{children:[(0,zo.jsx)(Vo.__experimentalToolsPanelItem,{hasValue:()=>!!t,label:(0,za.__)("Aspect ratio"),onDeselect:()=>i({aspectRatio:void 0}),resetAllFilter:()=>({aspectRatio:void 0}),isShownByDefault:!0,panelId:e,children:(0,zo.jsx)(Vo.SelectControl,{__next40pxDefaultSize:!0,label:(0,za.__)("Aspect ratio"),value:t||"auto",options:b,onChange:y=>i({aspectRatio:y})})}),(0,zo.jsx)(Vo.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>!!a,label:(0,za.__)("Height"),onDeselect:()=>i({height:void 0}),resetAllFilter:()=>({height:void 0}),isShownByDefault:!0,panelId:e,children:(0,zo.jsx)(Vo.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:(0,za.__)("Height"),labelPosition:"top",value:a||"",min:0,onChange:y=>p("height",y),units:m})}),(0,zo.jsx)(Vo.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>!!r,label:(0,za.__)("Width"),onDeselect:()=>i({width:void 0}),resetAllFilter:()=>({width:void 0}),isShownByDefault:!0,panelId:e,children:(0,zo.jsx)(Vo.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:(0,za.__)("Width"),labelPosition:"top",value:r||"",min:0,onChange:y=>p("width",y),units:m})}),f&&(0,zo.jsx)(Vo.__experimentalToolsPanelItem,{hasValue:()=>!!n&&n!==gL,label:d,onDeselect:()=>i({scale:gL}),resetAllFilter:()=>({scale:gL}),isShownByDefault:!0,panelId:e,children:(0,zo.jsx)(Vo.__experimentalToggleGroupControl,{__next40pxDefaultSize:!0,label:d,value:n,help:ske[n],onChange:y=>i({scale:y}),isBlock:!0,children:lke})})]})},Mte=cke;var Xw=o(M(),1),Fm=o(T(),1),Ate=o(me(),1),Yw=o(P(),1),Vm=o(v(),1),uke=({clientId:e,attributes:t,setAttributes:r,overlayColor:a,setOverlayColor:n})=>{let{dimRatio:i}=t,{gradientValue:l,setGradient:s}=(0,Fm.__experimentalUseGradient)(),c=(0,Fm.__experimentalUseMultipleOriginColorsAndGradients)();return c.hasColorsOrGradients?(0,Vm.jsxs)(Vm.Fragment,{children:[(0,Vm.jsx)(Fm.__experimentalColorGradientSettingsDropdown,{__experimentalIsRenderedInSidebar:!0,settings:[{colorValue:a.color,gradientValue:l,label:(0,Yw.__)("Overlay"),onColorChange:n,onGradientChange:s,isShownByDefault:!0,resetAllFilter:()=>({overlayColor:void 0,customOverlayColor:void 0,gradient:void 0,customGradient:void 0}),clearable:!0}],panelId:e,...c}),(0,Vm.jsx)(Xw.__experimentalToolsPanelItem,{hasValue:()=>i!==void 0,label:(0,Yw.__)("Overlay opacity"),onDeselect:()=>r({dimRatio:0}),resetAllFilter:()=>({dimRatio:0}),isShownByDefault:!0,panelId:e,children:(0,Vm.jsx)(Xw.RangeControl,{label:(0,Yw.__)("Overlay opacity"),value:i,onChange:u=>r({dimRatio:u}),min:0,max:100,step:10,required:!0,__next40pxDefaultSize:!0})})]}):null},Rte=(0,Ate.compose)([(0,Fm.withColors)({overlayColor:"background-color"})])(uke);var Hm=o(T(),1),Vte=o(me(),1);function zte(e){return e===void 0?null:"has-background-dim-"+10*Math.round(e/10)}var Fte=o(v(),1),mke=({attributes:e,overlayColor:t})=>{let{dimRatio:r}=e,{gradientClass:a,gradientValue:n}=(0,Hm.__experimentalUseGradient)(),i=(0,Hm.__experimentalUseMultipleOriginColorsAndGradients)(),l=(0,Hm.__experimentalUseBorderProps)(e),s={backgroundColor:t.color,backgroundImage:n,...l.style};return!i.hasColorsOrGradients||!r?null:(0,Fte.jsx)("span",{"aria-hidden":"true",className:w("wp-block-post-featured-image__overlay",zte(r),{[t.class]:t.class,"has-background-dim":r!==void 0,"has-background-gradient":n,[a]:a},l.className),style:s})},vL=(0,Vte.compose)([(0,Hm.withColors)({overlayColor:"background-color"})])(mke);var qe=o(v(),1),Hte=["image"],{ResolutionTool:pke}=K(Lr.privateApis),Ute="full";function dke({image:e,value:t,onChange:r}){let{imageSizes:a}=(0,u2.useSelect)(i=>{let{getSettings:l}=i(Lr.store);return{imageSizes:l().imageSizes}},[]);if(!a?.length)return null;let n=a.filter(({slug:i})=>e?.media_details?.sizes?.[i]?.source_url).map(({name:i,slug:l})=>({value:l,label:i}));return(0,qe.jsx)(pke,{value:t,defaultValue:Ute,options:n,onChange:r})}function Gte({clientId:e,attributes:t,setAttributes:r,context:{postId:a,postType:n,queryId:i}}){let l=Number.isFinite(i),{isLink:s,aspectRatio:c,height:u,width:m,scale:p,sizeSlug:d,rel:f,linkTarget:h,useFirstImageFromPost:g}=t,[b,y]=(0,Om.useState)(),[k,_]=(0,c2.useEntityProp)("postType",n,"featured_media",a),[x]=(0,c2.useEntityProp)("postType",n,"content",a),S=(0,Om.useMemo)(()=>{if(k)return k;if(!g)return;let te=/<!--\s+wp:(?:core\/)?image\s+(?<attrs>{(?:(?:[^}]+|}+(?=})|(?!}\s+\/?-->).)*)?}\s+)?-->/.exec(x);return te?.groups?.attrs&&JSON.parse(te.groups.attrs)?.id},[k,g,x]),{media:C,postType:N,postPermalink:B}=(0,u2.useSelect)(te=>{let{getEntityRecord:ne,getPostType:le,getEditedEntityRecord:pe}=te(c2.store);return{media:S&&ne("postType","attachment",S,{context:"view"}),postType:n&&le(n),postPermalink:pe("postType",n,a)?.link}},[S,n,a]),D=C?.media_details?.sizes?.[d]?.source_url||C?.source_url,A=(0,Lr.useBlockProps)({style:{width:m,height:u,aspectRatio:c},className:w({"is-transient":b})}),H=(0,Lr.__experimentalUseBorderProps)(t),F=(0,Lr.__experimentalGetShadowClassesAndStyles)(t),z=(0,Lr.useBlockEditingMode)(),I=te=>(0,qe.jsx)(yo.Placeholder,{className:w("block-editor-media-placeholder",H.className),withIllustration:!0,style:{height:!!c&&"100%",width:!!c&&"100%",...H.style,...F.style},children:te}),R=te=>{te?.id&&_(te.id),te?.url&&(0,Ote.isBlobURL)(te.url)&&y(te.url)},$=()=>{r({isLink:!1,linkTarget:"_self",rel:"",sizeSlug:void 0}),_(0)};(0,Om.useEffect)(()=>{D&&b&&y()},[D,b]);let{createErrorNotice:j}=(0,u2.useDispatch)(jte.store),G=te=>{j(te,{type:"snackbar"}),y()},O=q(),J=z==="default"&&(0,qe.jsxs)(qe.Fragment,{children:[(0,qe.jsx)(Lr.InspectorControls,{group:"color",children:(0,qe.jsx)(Rte,{attributes:t,setAttributes:r,clientId:e})}),(0,qe.jsx)(Lr.InspectorControls,{group:"dimensions",children:(0,qe.jsx)(Mte,{clientId:e,attributes:t,setAttributes:r,media:C})}),(S||l||!a)&&(0,qe.jsx)(Lr.InspectorControls,{children:(0,qe.jsxs)(yo.__experimentalToolsPanel,{label:(0,Fo.__)("Settings"),resetAll:()=>{r({isLink:!1,linkTarget:"_self",rel:"",sizeSlug:Ute})},dropdownMenuProps:O,children:[(0,qe.jsx)(yo.__experimentalToolsPanelItem,{label:N?.labels.singular_name?(0,Fo.sprintf)((0,Fo.__)("Link to %s"),N.labels.singular_name):(0,Fo.__)("Link to post"),isShownByDefault:!0,hasValue:()=>!!s,onDeselect:()=>r({isLink:!1}),children:(0,qe.jsx)(yo.ToggleControl,{label:N?.labels.singular_name?(0,Fo.sprintf)((0,Fo.__)("Link to %s"),N.labels.singular_name):(0,Fo.__)("Link to post"),onChange:()=>r({isLink:!s}),checked:s})}),s&&(0,qe.jsx)(yo.__experimentalToolsPanelItem,{label:(0,Fo.__)("Open in new tab"),isShownByDefault:!0,hasValue:()=>h!=="_self",onDeselect:()=>r({linkTarget:"_self"}),children:(0,qe.jsx)(yo.ToggleControl,{label:(0,Fo.__)("Open in new tab"),onChange:te=>r({linkTarget:te?"_blank":"_self"}),checked:h==="_blank"})}),s&&(0,qe.jsx)(yo.__experimentalToolsPanelItem,{label:(0,Fo.__)("Link relation"),isShownByDefault:!0,hasValue:()=>!!f,onDeselect:()=>r({rel:""}),children:(0,qe.jsx)(yo.TextControl,{__next40pxDefaultSize:!0,label:(0,Fo.__)("Link relation"),help:(0,Om.createInterpolateElement)((0,Fo.__)("The <a>Link Relation</a> attribute defines the relationship between a linked resource and the current document."),{a:(0,qe.jsx)(yo.ExternalLink,{href:"https://developer.mozilla.org/docs/Web/HTML/Attributes/rel"})}),value:f,onChange:te=>r({rel:te})})}),!!C&&(0,qe.jsx)(dke,{image:C,value:d,onChange:te=>r({sizeSlug:te})})]})})]}),ee;if(!S&&(l||!a))return(0,qe.jsxs)(qe.Fragment,{children:[J,(0,qe.jsxs)("div",{...A,children:[s?(0,qe.jsx)("a",{href:B,target:h,children:I()}):I(),(0,qe.jsx)(vL,{attributes:t,setAttributes:r,clientId:e})]})]});let oe=(0,Fo.__)("Add a featured image"),X={...H.style,...F.style,height:c?"100%":u,width:!!c&&"100%",objectFit:!!(u||c)&&p};return!S&&!b?ee=(0,qe.jsx)(Lr.MediaPlaceholder,{onSelect:R,accept:"image/*",allowedTypes:Hte,onError:G,placeholder:I,mediaLibraryButton:({open:te})=>(0,qe.jsx)(yo.Button,{__next40pxDefaultSize:!0,icon:Hc,variant:"primary",label:oe,showTooltip:!0,tooltipPosition:"top center",onClick:()=>{te()}})}):ee=!C&&!b?I():(0,qe.jsxs)(qe.Fragment,{children:[(0,qe.jsx)("img",{className:H.className,src:b||D,alt:C&&C?.alt_text?(0,Fo.sprintf)((0,Fo.__)("Featured image: %s"),C.alt_text):(0,Fo.__)("Featured image"),style:X}),b&&(0,qe.jsx)(yo.Spinner,{})]}),(0,qe.jsxs)(qe.Fragment,{children:[!b&&J,!!C&&!l&&(0,qe.jsx)(Lr.BlockControls,{group:"other",children:(0,qe.jsx)(Lr.MediaReplaceFlow,{mediaId:S,mediaURL:D,allowedTypes:Hte,accept:"image/*",onSelect:R,onError:G,onReset:$})}),(0,qe.jsxs)("figure",{...A,children:[s?(0,qe.jsx)("a",{href:B,target:h,children:ee}):ee,(0,qe.jsx)(vL,{attributes:t,setAttributes:r,clientId:e})]})]})}var{name:Wte}=Qw,$te={icon:bP,edit:Gte},fke=()=>E({name:Wte,metadata:Qw,settings:$te});var yL={};Z(yL,{init:()=>gke,metadata:()=>Jw,name:()=>Jte,settings:()=>ere});var Xte=o(P(),1);var Jw={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/post-navigation-link",title:"Post Navigation Link",category:"theme",description:"Displays the next or previous post link that is adjacent to the current post.",textdomain:"default",attributes:{textAlign:{type:"string"},type:{type:"string",default:"next"},label:{type:"string",role:"content"},showTitle:{type:"boolean",default:!1},linkLabel:{type:"boolean",default:!1},arrow:{type:"string",default:"none"},taxonomy:{type:"string",default:""}},usesContext:["postType"],supports:{anchor:!0,reusable:!1,html:!1,color:{link:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalWritingMode:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}},style:"wp-block-post-navigation-link"};var ma=o(M(),1),zi=o(T(),1),dr=o(P(),1),qte=o(V(),1),Zte=o(Q(),1);var lr=o(v(),1);function Kte({context:{postType:e},attributes:{type:t,label:r,showTitle:a,textAlign:n,linkLabel:i,arrow:l,taxonomy:s},setAttributes:c}){let m=(0,zi.useBlockEditingMode)()==="default",p=t==="next",d=p?(0,dr.__)("Next"):(0,dr.__)("Previous"),h={none:"",arrow:p?"\u2192":"\u2190",chevron:p?"\xBB":"\xAB"}[l];a&&(d=p?(0,dr.__)("Next: "):(0,dr.__)("Previous: "));let g=p?(0,dr.__)("Next post"):(0,dr.__)("Previous post"),b=(0,zi.useBlockProps)({className:w({[`has-text-align-${n}`]:n})}),y=(0,qte.useSelect)(x=>{let{getTaxonomies:S}=x(Zte.store);return S({type:e,per_page:-1})},[e]),k=()=>{let x={label:(0,dr.__)("Unfiltered"),value:""},S=(y??[]).filter(({visibility:C})=>!!C?.publicly_queryable).map(C=>({value:C.slug,label:C.name}));return[x,...S]},_=q();return(0,lr.jsxs)(lr.Fragment,{children:[(0,lr.jsx)(zi.InspectorControls,{children:(0,lr.jsxs)(ma.__experimentalToolsPanel,{label:(0,dr.__)("Settings"),resetAll:()=>{c({showTitle:!1,linkLabel:!1,arrow:"none"})},dropdownMenuProps:_,children:[(0,lr.jsx)(ma.__experimentalToolsPanelItem,{label:(0,dr.__)("Display the title as a link"),isShownByDefault:!0,hasValue:()=>a,onDeselect:()=>c({showTitle:!1}),children:(0,lr.jsx)(ma.ToggleControl,{label:(0,dr.__)("Display the title as a link"),help:(0,dr.__)("If you have entered a custom label, it will be prepended before the title."),checked:!!a,onChange:()=>c({showTitle:!a})})}),a&&(0,lr.jsx)(ma.__experimentalToolsPanelItem,{label:(0,dr.__)("Include the label as part of the link"),isShownByDefault:!0,hasValue:()=>!!i,onDeselect:()=>c({linkLabel:!1}),children:(0,lr.jsx)(ma.ToggleControl,{label:(0,dr.__)("Include the label as part of the link"),checked:!!i,onChange:()=>c({linkLabel:!i})})}),(0,lr.jsx)(ma.__experimentalToolsPanelItem,{label:(0,dr.__)("Arrow"),isShownByDefault:!0,hasValue:()=>l!=="none",onDeselect:()=>c({arrow:"none"}),children:(0,lr.jsxs)(ma.__experimentalToggleGroupControl,{__next40pxDefaultSize:!0,label:(0,dr.__)("Arrow"),value:l,onChange:x=>{c({arrow:x})},help:(0,dr.__)("A decorative arrow for the next and previous link."),isBlock:!0,children:[(0,lr.jsx)(ma.__experimentalToggleGroupControlOption,{value:"none",label:(0,dr._x)("None","Arrow option for Next/Previous link")}),(0,lr.jsx)(ma.__experimentalToggleGroupControlOption,{value:"arrow",label:(0,dr._x)("Arrow","Arrow option for Next/Previous link")}),(0,lr.jsx)(ma.__experimentalToggleGroupControlOption,{value:"chevron",label:(0,dr._x)("Chevron","Arrow option for Next/Previous link")})]})})]})}),(0,lr.jsx)(zi.InspectorControls,{group:"advanced",children:(0,lr.jsx)(ma.SelectControl,{__next40pxDefaultSize:!0,label:(0,dr.__)("Filter by taxonomy"),value:s,options:k(),onChange:x=>c({taxonomy:x}),help:(0,dr.__)("Only link to posts that have the same taxonomy terms as the current post. For example the same tags or categories.")})}),m&&(0,lr.jsx)(zi.BlockControls,{children:(0,lr.jsx)(zi.AlignmentToolbar,{value:n,onChange:x=>{c({textAlign:x})}})}),(0,lr.jsxs)("div",{...b,children:[!p&&h&&(0,lr.jsx)("span",{className:`wp-block-post-navigation-link__arrow-previous is-arrow-${l}`,children:h}),(0,lr.jsx)(zi.RichText,{tagName:"a",identifier:"label","aria-label":g,placeholder:d,value:r,withoutInteractiveFormatting:!0,onChange:x=>c({label:x})}),a&&(0,lr.jsx)("a",{href:"#post-navigation-pseudo-link",onClick:x=>x.preventDefault(),children:(0,dr.__)("An example title")}),p&&h&&(0,lr.jsx)("span",{className:`wp-block-post-navigation-link__arrow-next is-arrow-${l}`,"aria-hidden":!0,children:h})]})]})}var zd=o(P(),1);var Qte=[{name:"post-previous",title:(0,zd.__)("Previous Post"),description:(0,zd.__)("Displays the post link that precedes the current post."),icon:SP,attributes:{type:"previous"},scope:["inserter","transform"],example:{attributes:{label:(0,zd.__)("Previous post"),arrow:"arrow"}}},{isDefault:!0,name:"post-next",title:(0,zd.__)("Next Post"),description:(0,zd.__)("Displays the post link that follows the current post."),icon:OT,attributes:{type:"next"},scope:["inserter","transform"],example:{attributes:{label:(0,zd.__)("Next post"),arrow:"arrow"}}}];Qte.forEach(e=>{e.isActive||(e.isActive=(t,r)=>t.type===r.type)});var Yte=Qte;var{name:Jte}=Jw,ere={edit:Kte,variations:Yte,example:{attributes:{label:(0,Xte.__)("Next post"),arrow:"arrow"}}},gke=()=>E({name:Jte,metadata:Jw,settings:ere});var _L={};Z(_L,{init:()=>kke,metadata:()=>eC,name:()=>lre,settings:()=>sre});var eC={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/post-template",title:"Post Template",category:"theme",ancestor:["core/query"],description:"Contains the block elements used to render a post, like the title, date, featured image, content or excerpt, and more.",textdomain:"default",usesContext:["queryId","query","displayLayout","templateSlug","previewPostType","enhancedPagination","postType"],supports:{anchor:!0,reusable:!1,html:!1,align:["wide","full"],layout:!0,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},spacing:{margin:!0,padding:!0,blockGap:{__experimentalDefault:"1.25em"},__experimentalDefaultControls:{blockGap:!0,padding:!1,margin:!1}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0}},style:"wp-block-post-template",editorStyle:"wp-block-post-template-editor"};var fg=o(U(),1),tre=o(V(),1),m2=o(P(),1),dl=o(T(),1),tC=o(M(),1),rre=o(Q(),1);var Va=o(v(),1),bke=[["core/post-title"],["core/post-date",{metadata:{bindings:{datetime:{source:"core/post-data",args:{field:"date"}}}}}],["core/post-excerpt"]];function yke({classList:e}){let t=(0,dl.useInnerBlocksProps)({className:w("wp-block-post",e)},{template:bke,__unstableDisableLayoutClassNames:!0});return(0,Va.jsx)("li",{...t})}function _ke({blocks:e,blockContextId:t,classList:r,isHidden:a,setActiveBlockContextId:n}){let i=(0,dl.__experimentalUseBlockPreview)({blocks:e,props:{className:w("wp-block-post",r)}}),l=()=>{n(t)};return(0,Va.jsx)("li",{...i,tabIndex:0,role:"button",onClick:l,onKeyPress:l,style:{display:a?"none":void 0}})}var xke=(0,fg.memo)(_ke);function ore({setAttributes:e,clientId:t,context:{query:{perPage:r,offset:a=0,postType:n,order:i,orderBy:l,author:s,search:c,exclude:u,sticky:m,inherit:p,taxQuery:d,parents:f,pages:h,format:g,...b}={},templateSlug:y,previewPostType:k},attributes:{layout:_},__unstableLayoutClassNames:x}){let{type:S,columnCount:C=3}=_||{},[N,B]=(0,fg.useState)(),{posts:D,blocks:A}=(0,tre.useSelect)(R=>{let{getEntityRecords:$,getTaxonomies:j}=R(rre.store),{getBlocks:G}=R(dl.store),O=p&&y?.startsWith("category-")&&$("taxonomy","category",{context:"view",per_page:1,_fields:["id"],slug:y.replace("category-","")}),J=p&&y?.startsWith("tag-")&&$("taxonomy","post_tag",{context:"view",per_page:1,_fields:["id"],slug:y.replace("tag-","")}),ee={offset:a||0,order:i,orderby:l};if(d&&!p){let te=j({type:n,per_page:-1,context:"view"}),ne=(pe,Ie="")=>Object.entries(pe||{}).reduce((Ne,[ae,Re])=>{let Ee=te?.find(({slug:ie})=>ie===ae);return Ee?.rest_base&&Re?.length&&(Ne[Ee.rest_base+Ie]=Re),Ne},{}),le=ne(d.include);d.exclude&&Object.assign(le,ne(d.exclude,"_exclude")),Object.keys(le).length&&Object.assign(ee,le)}r&&(ee.per_page=r),s&&(ee.author=s),c&&(ee.search=c),u?.length&&(ee.exclude=u),f?.length&&(ee.parent=f),g?.length&&(ee.format=g),["exclude","only"].includes(m)&&(ee.sticky=m==="only"),["","ignore"].includes(m)&&(delete ee.sticky,ee.ignore_sticky=m==="ignore");let oe=n;return p&&(y?.startsWith("archive-")?(ee.postType=y.replace("archive-",""),oe=ee.postType):O?ee.categories=O[0]?.id:J?ee.tags=J[0]?.id:y?.startsWith("taxonomy-post_format")&&(ee.format=y.replace("taxonomy-post_format-post-format-",""))),{posts:$("postType",k||oe,{...ee,...b}),blocks:G(t)}},[r,a,i,l,t,s,c,n,u,m,p,y,d,f,g,b,k]),H=(0,fg.useMemo)(()=>D?.map(R=>({postType:R.type,postId:R.id,classList:R.class_list??""})),[D]),F=(0,dl.useBlockProps)({className:w(x,{[`columns-${C}`]:S==="grid"&&C})});if(!D)return(0,Va.jsx)("p",{...F,children:(0,Va.jsx)(tC.Spinner,{})});if(!D.length)return(0,Va.jsxs)("p",{...F,children:[" ",(0,m2.__)("No results found.")]});let z=R=>e({layout:{..._,...R}}),I=[{icon:Nl,title:(0,m2._x)("List view","Post template block display setting"),onClick:()=>z({type:"default"}),isActive:S==="default"||S==="constrained"},{icon:Il,title:(0,m2._x)("Grid view","Post template block display setting"),onClick:()=>z({type:"grid",columnCount:C}),isActive:S==="grid"}];return(0,Va.jsxs)(Va.Fragment,{children:[(0,Va.jsx)(dl.BlockControls,{children:(0,Va.jsx)(tC.ToolbarGroup,{controls:I})}),(0,Va.jsx)("ul",{...F,children:H&&H.map(R=>(0,Va.jsxs)(dl.BlockContextProvider,{value:R,children:[R.postId===(N||H[0]?.postId)?(0,Va.jsx)(yke,{classList:R.classList}):null,(0,Va.jsx)(xke,{blocks:A,blockContextId:R.postId,classList:R.classList,setActiveBlockContextId:B,isHidden:R.postId===(N||H[0]?.postId)})]},R.postId))})]})}var are=o(T(),1),nre=o(v(),1);function ire(){return(0,nre.jsx)(are.InnerBlocks.Content,{})}var{name:lre}=eC,sre={icon:Cp,edit:ore,save:ire},kke=()=>E({name:lre,metadata:eC,settings:sre});var xL={};Z(xL,{init:()=>Pke,metadata:()=>rC,name:()=>_re,settings:()=>xre});var yre=o(Yc(),1);var rC={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/post-terms",title:"Post Terms",category:"theme",description:"Post terms.",textdomain:"default",attributes:{term:{type:"string"},separator:{type:"string",default:", "},prefix:{type:"string",default:"",role:"content"},suffix:{type:"string",default:"",role:"content"}},usesContext:["postId","postType"],example:{viewportWidth:350},supports:{anchor:!0,html:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,textAlign:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}}},style:"wp-block-post-terms"};var _u=o(T(),1),oC=o(W(),1),aC=o(M(),1),dre=o(V(),1),fre=o(Wo(),1),jm=o(P(),1),hre=o(Q(),1);var cre=o(Q(),1),ure=o(V(),1),Cke=[];function mre({postId:e,term:t}){let{slug:r}=t;return(0,ure.useSelect)(a=>{if(!t?.visibility?.publicly_queryable||!e)return{postTerms:Cke,isLoading:!1,hasPostTerms:!1};let{getEntityRecords:i,isResolving:l}=a(cre.store),s=["taxonomy",r,{post:e,per_page:-1,context:"view"}],c=i(...s);return{postTerms:c,isLoading:l("getEntityRecords",s),hasPostTerms:!!c?.length}},[e,t?.visibility?.publicly_queryable,r])}var Fa=o(v(),1),pre=["core/bold","core/image","core/italic","core/link","core/strikethrough","core/text-color"];function gre({attributes:e,clientId:t,context:r,isSelected:a,setAttributes:n,insertBlocksAfter:i}){let{term:l,separator:s,prefix:c,suffix:u}=e,{postId:m,postType:p}=r,d=(0,dre.useSelect)(_=>{if(!l)return{};let{getTaxonomy:x}=_(hre.store),S=x(l);return S?.visibility?.publicly_queryable?S:{}},[l]),{postTerms:f,hasPostTerms:h,isLoading:g}=mre({postId:m,term:d}),b=m&&p,y=(0,_u.useBlockDisplayInformation)(t),k=(0,_u.useBlockProps)({className:l&&`taxonomy-${l}`});return(0,Fa.jsxs)(Fa.Fragment,{children:[(0,Fa.jsx)(_u.InspectorControls,{group:"advanced",children:(0,Fa.jsx)(aC.TextControl,{__next40pxDefaultSize:!0,autoComplete:"off",label:(0,jm.__)("Separator"),value:s||"",onChange:_=>{n({separator:_})},help:(0,jm.__)("Enter character(s) used to separate terms.")})}),(0,Fa.jsxs)("div",{...k,children:[g&&b&&(0,Fa.jsx)(aC.Spinner,{}),!g&&(a||c)&&(0,Fa.jsx)(_u.RichText,{identifier:"prefix",allowedFormats:pre,className:"wp-block-post-terms__prefix","aria-label":(0,jm.__)("Prefix"),placeholder:(0,jm.__)("Prefix")+" ",value:c,onChange:_=>n({prefix:_}),tagName:"span"}),(!b||!l)&&(0,Fa.jsx)("span",{children:y.title}),b&&!g&&h&&f.map(_=>(0,Fa.jsx)("a",{href:_.link,onClick:x=>x.preventDefault(),rel:"tag",children:(0,fre.decodeEntities)(_.name)},_.id)).reduce((_,x)=>(0,Fa.jsxs)(Fa.Fragment,{children:[_,(0,Fa.jsx)("span",{className:"wp-block-post-terms__separator",children:s||" "}),x]})),b&&!g&&!h&&(d?.labels?.no_terms||(0,jm.__)("Term items not found.")),!g&&(a||u)&&(0,Fa.jsx)(_u.RichText,{identifier:"suffix",allowedFormats:pre,className:"wp-block-post-terms__suffix","aria-label":(0,jm.__)("Suffix"),placeholder:" "+(0,jm.__)("Suffix"),value:u,onChange:_=>n({suffix:_}),tagName:"span",__unstableOnSplitAtEnd:()=>i((0,oC.createBlock)((0,oC.getDefaultBlockName)()))})]})]})}var Ske={category:Nf,post_tag:xP};function vre(e,t){if(t!=="core/post-terms")return e;let r=e.variations.map(a=>({...a,icon:Ske[a.name]??Nf}));return{...e,variations:r}}var Tke={attributes:{textAlign:{type:"string"},term:{type:"string"},separator:{type:"string",default:", "},prefix:{type:"string",default:"",role:"content"},suffix:{type:"string",default:"",role:"content"}},supports:{anchor:!0,html:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}}},migrate:We,isEligible(e){return!!e.textAlign||!!e.className?.match(/\bhas-text-align-(left|center|right)\b/)},save:()=>null},bre=[Tke];var{name:_re}=rC,xre={icon:Nf,edit:gre,deprecated:bre},Pke=()=>((0,yre.addFilter)("blocks.registerBlockType","core/template-part",vre),E({name:_re,metadata:rC,settings:xre}));var kL={};Z(kL,{init:()=>Dke,metadata:()=>nC,name:()=>Nre,settings:()=>Ere});var nC={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/post-time-to-read",title:"Time to Read",category:"theme",description:"Show minutes required to finish reading the post. Can also show a word count.",textdomain:"default",usesContext:["postId","postType"],attributes:{displayAsRange:{type:"boolean",default:!0},displayMode:{type:"string",default:"time"},averageReadingSpeed:{type:"number",default:189}},supports:{anchor:!0,color:{gradients:!0,__experimentalDefaultControls:{background:!0,text:!0}},html:!1,spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},typography:{fontSize:!0,lineHeight:!0,textAlign:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0}}};var Ha=o(P(),1),Cre=o(U(),1),iC=o(T(),1),hg=o(M(),1),Sre=o(W(),1),lC=o(Q(),1),Tre=o(wre(),1);var fc=o(v(),1);function Ike({attributes:e,setAttributes:t,context:r}){let{displayAsRange:a,displayMode:n,averageReadingSpeed:i}=e,{postId:l,postType:s}=r,c=q(),[u]=(0,lC.useEntityProp)("postType",s,"content",l),[m]=(0,lC.useEntityBlockEditor)("postType",s,{id:l}),p=(0,Cre.useMemo)(()=>{let f;u instanceof Function?f=u({blocks:m}):m?f=(0,Sre.__unstableSerializeAndClean)(m):f=u;let h=(0,Ha._x)("words","Word count type. Do not translate!"),g=(0,Tre.count)(f||"",h);if(n==="time"){if(a){let y=Math.max(1,Math.round(g/i*1.2)),k=Math.max(1,Math.round(g/i*.8));k===y&&(y=y+1);let _=(0,Ha._x)("%1$s\u2013%2$s minutes","Range of minutes to read");return(0,Ha.sprintf)(_,k,y)}let b=Math.max(1,Math.round(g/i));return(0,Ha.sprintf)((0,Ha._n)("%s minute","%s minutes",b),b)}if(n==="words")return h==="words"?(0,Ha.sprintf)((0,Ha._n)("%s word","%s words",g),g.toLocaleString()):(0,Ha.sprintf)((0,Ha._n)("%s character","%s characters",g),g.toLocaleString())},[u,m,a,n,i]),d=(0,iC.useBlockProps)();return(0,fc.jsxs)(fc.Fragment,{children:[n==="time"&&(0,fc.jsx)(iC.InspectorControls,{children:(0,fc.jsx)(hg.__experimentalToolsPanel,{label:(0,Ha.__)("Settings"),resetAll:()=>{t({displayAsRange:!0})},dropdownMenuProps:c,children:(0,fc.jsx)(hg.__experimentalToolsPanelItem,{isShownByDefault:!0,label:(0,Ha._x)("Display as range","Turns reading time range display on or off"),hasValue:()=>!a,onDeselect:()=>{t({displayAsRange:!0})},children:(0,fc.jsx)(hg.ToggleControl,{label:(0,Ha.__)("Display as range"),checked:!!a,onChange:()=>t({displayAsRange:!a})})})})}),(0,fc.jsx)("div",{...d,children:p})]})}var Pre=Ike;var p2=o(P(),1);var Nke=[{name:"time-to-read",title:(0,p2.__)("Time to Read"),description:(0,p2.__)("Show minutes required to finish reading the post."),attributes:{displayMode:"time"},scope:["inserter","transform"],isActive:e=>e?.displayMode==="time",icon:y1,isDefault:!0},{name:"word-count",title:(0,p2.__)("Word Count"),description:(0,p2.__)("Show the number of words in the post."),attributes:{displayMode:"words"},scope:["inserter","transform"],isActive:e=>e?.displayMode==="words",icon:HB}],Bre=Nke;var Eke={attributes:{textAlign:{type:"string"},displayAsRange:{type:"boolean",default:!0},displayMode:{type:"string",default:"time"},averageReadingSpeed:{type:"number",default:189}},supports:{anchor:!0,color:{gradients:!0,__experimentalDefaultControls:{background:!0,text:!0}},html:!1,typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0}},migrate:We,isEligible(e){return!!e.textAlign||!!e.className?.match(/\bhas-text-align-(left|center|right)\b/)},save:()=>null},Ire=[Eke];var{name:Nre}=nC,Ere={icon:y1,edit:Pre,variations:Bre,example:{},deprecated:Ire},Dke=()=>E({name:Nre,metadata:nC,settings:Ere});var wL={};Z(wL,{init:()=>Ake,metadata:()=>sC,name:()=>Rre,settings:()=>zre});var sC={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/post-title",title:"Title",category:"theme",description:"Displays the title of a post, page, or any other content-type.",textdomain:"default",usesContext:["postId","postType","queryId"],attributes:{textAlign:{type:"string"},level:{type:"number",default:2},levelOptions:{type:"array"},isLink:{type:"boolean",default:!1,role:"content"},rel:{type:"string",attribute:"rel",default:"",role:"content"},linkTarget:{type:"string",default:"_self",role:"content"}},example:{viewportWidth:350},supports:{anchor:!0,align:["wide","full"],html:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}}},style:"wp-block-post-title"};var hn=o(T(),1),Vi=o(M(),1),Wn=o(P(),1),cC=o(W(),1),d2=o(Q(),1),Dre=o(V(),1),Lre=o(U(),1);var Rt=o(v(),1);function Mre({attributes:{level:e,levelOptions:t,textAlign:r,isLink:a,rel:n,linkTarget:i},setAttributes:l,context:{postType:s,postId:c,queryId:u},insertBlocksAfter:m}){let p=e===0?"p":`h${e}`,d=Number.isFinite(u),f=(0,Dre.useSelect)(N=>d?!1:N(d2.store).canUser("update",{kind:"postType",name:s,id:c}),[d,s,c]),[h="",g,b]=(0,d2.useEntityProp)("postType",s,"title",c),[y]=(0,d2.useEntityProp)("postType",s,"link",c),k=()=>{m((0,cC.createBlock)((0,cC.getDefaultBlockName)()))},_=(0,hn.useBlockProps)({className:w({[`has-text-align-${r}`]:r})}),x=(0,hn.useBlockEditingMode)(),S=q(),C=(0,Rt.jsx)(p,{..._,children:(0,Wn.__)("Title")});return s&&c&&(C=f?(0,Rt.jsx)(hn.PlainText,{tagName:p,placeholder:(0,Wn.__)("(no title)"),value:h,onChange:g,__experimentalVersion:2,__unstableOnSplitAtEnd:k,..._}):(0,Rt.jsx)(p,{..._,dangerouslySetInnerHTML:{__html:b?.rendered||(0,Wn.__)("(no title)")}})),a&&s&&c&&(C=f?(0,Rt.jsx)(p,{..._,children:(0,Rt.jsx)(hn.PlainText,{tagName:"a",href:y,target:i,rel:n,placeholder:h.length?null:(0,Wn.__)("(no title)"),value:h,onChange:g,__experimentalVersion:2,__unstableOnSplitAtEnd:k})}):(0,Rt.jsx)(p,{..._,children:(0,Rt.jsx)("a",{href:y,target:i,rel:n,onClick:N=>N.preventDefault(),dangerouslySetInnerHTML:{__html:b?.rendered||(0,Wn.__)("(no title)")}})})),(0,Rt.jsxs)(Rt.Fragment,{children:[x==="default"&&(0,Rt.jsxs)(Rt.Fragment,{children:[(0,Rt.jsxs)(hn.BlockControls,{group:"block",children:[(0,Rt.jsx)(hn.HeadingLevelDropdown,{value:e,options:t,onChange:N=>l({level:N})}),(0,Rt.jsx)(hn.AlignmentControl,{value:r,onChange:N=>{l({textAlign:N})}})]}),(0,Rt.jsx)(hn.InspectorControls,{children:(0,Rt.jsxs)(Vi.__experimentalToolsPanel,{label:(0,Wn.__)("Settings"),resetAll:()=>{l({rel:"",linkTarget:"_self",isLink:!1})},dropdownMenuProps:S,children:[(0,Rt.jsx)(Vi.__experimentalToolsPanelItem,{label:(0,Wn.__)("Make title a link"),isShownByDefault:!0,hasValue:()=>a,onDeselect:()=>l({isLink:!1}),children:(0,Rt.jsx)(Vi.ToggleControl,{label:(0,Wn.__)("Make title a link"),onChange:()=>l({isLink:!a}),checked:a})}),a&&(0,Rt.jsxs)(Rt.Fragment,{children:[(0,Rt.jsx)(Vi.__experimentalToolsPanelItem,{label:(0,Wn.__)("Open in new tab"),isShownByDefault:!0,hasValue:()=>i==="_blank",onDeselect:()=>l({linkTarget:"_self"}),children:(0,Rt.jsx)(Vi.ToggleControl,{label:(0,Wn.__)("Open in new tab"),onChange:N=>l({linkTarget:N?"_blank":"_self"}),checked:i==="_blank"})}),(0,Rt.jsx)(Vi.__experimentalToolsPanelItem,{label:(0,Wn.__)("Link relation"),isShownByDefault:!0,hasValue:()=>!!n,onDeselect:()=>l({rel:""}),children:(0,Rt.jsx)(Vi.TextControl,{__next40pxDefaultSize:!0,label:(0,Wn.__)("Link relation"),help:(0,Lre.createInterpolateElement)((0,Wn.__)("The <a>Link Relation</a> attribute defines the relationship between a linked resource and the current document."),{a:(0,Rt.jsx)(Vi.ExternalLink,{href:"https://developer.mozilla.org/docs/Web/HTML/Attributes/rel"})}),value:n,onChange:N=>l({rel:N})})})]})]})})]}),C]})}var Mke={attributes:{textAlign:{type:"string"},level:{type:"number",default:2},isLink:{type:"boolean",default:!1},rel:{type:"string",attribute:"rel",default:""},linkTarget:{type:"string",default:"_self"}},supports:{align:["wide","full"],html:!1,color:{gradients:!0,link:!0},spacing:{margin:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0}},save(){return null},migrate:Ot,isEligible({style:e}){return e?.typography?.fontFamily}},Are=[Mke];var{name:Rre}=sC,zre={icon:El,edit:Mre,deprecated:Are},Ake=()=>E({name:Rre,metadata:sC,settings:zre});var PL={};Z(PL,{init:()=>Hke,metadata:()=>pC,name:()=>Ure,settings:()=>fC});var TL=o(P(),1);var jre=o(W(),1);var CL=o(P(),1),uC=o(T(),1),mC=o(W(),1),Vre=o(v(),1);function Fre({attributes:e,mergeBlocks:t,setAttributes:r,onRemove:a,insertBlocksAfter:n,style:i}){let{content:l}=e,s=(0,uC.useBlockProps)({style:i});return(0,Vre.jsx)(uC.RichText,{tagName:"pre",identifier:"content",preserveWhiteSpace:!0,value:l,onChange:c=>{r({content:c})},onRemove:a,"aria-label":(0,CL.__)("Preformatted text"),placeholder:(0,CL.__)("Write preformatted text\u2026"),onMerge:t,...s,__unstablePastePlainText:!0,__unstableOnSplitAtDoubleLineEnd:()=>n((0,mC.createBlock)((0,mC.getDefaultBlockName)()))})}var pC={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/preformatted",title:"Preformatted",category:"text",description:"Add text that respects your spacing and tabs, and also allows styling.",textdomain:"default",attributes:{content:{type:"rich-text",source:"rich-text",selector:"pre",__unstablePreserveWhiteSpace:!0,role:"content"}},supports:{anchor:!0,color:{gradients:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{padding:!0,margin:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}}},style:"wp-block-preformatted"};var dC=o(T(),1),SL=o(v(),1);function Hre({attributes:e}){let{content:t}=e;return(0,SL.jsx)("pre",{...dC.useBlockProps.save(),children:(0,SL.jsx)(dC.RichText.Content,{value:t})})}var f2=o(W(),1),zke={from:[{type:"block",blocks:["core/code","core/paragraph","core/verse"],transform:({content:e,anchor:t})=>(0,f2.createBlock)("core/preformatted",{content:e,anchor:t})},{type:"raw",isMatch:e=>e.nodeName==="PRE"&&!(e.children.length===1&&e.firstChild.nodeName==="CODE"),schema:({phrasingContentSchema:e})=>({pre:{children:e}})}],to:[{type:"block",blocks:["core/paragraph"],transform:e=>(0,f2.createBlock)("core/paragraph",e)},{type:"block",blocks:["core/code"],transform:e=>(0,f2.createBlock)("core/code",e)},{type:"block",blocks:["core/verse"],transform:e=>(0,f2.createBlock)("core/verse",e)}]},Ore=zke;var{fieldsKey:Vke,formKey:Fke}=K(jre.privateApis),{name:Ure}=pC,fC={icon:wP,example:{attributes:{content:(0,TL.__)(`EXT. XANADU - FAINT DAWN - 1940 (MINIATURE) Window, very small in the distance, illuminated. All around this is an almost totally black screen. Now, as the camera moves slowly towards the window which is almost a postage stamp in the frame, other forms appear;`)}},transforms:Ore,edit:Fre,save:Hre,merge(e,t){return{content:e.content+` `+t.content}}};window.__experimentalContentOnlyInspectorFields&&(fC[Vke]=[{id:"content",label:(0,TL.__)("Content"),type:"text",Edit:"rich-text"}],fC[Fke]={fields:["content"]});var Hke=()=>E({name:Ure,metadata:pC,settings:fC});var BL={};Z(BL,{init:()=>Jke,metadata:()=>gC,name:()=>eoe,settings:()=>vC});var v2=o(P(),1);var Jre=o(W(),1);var ht=o(T(),1),Wre=o(V(),1);var Vd="is-style-solid-color";var fr=o(v(),1),h2={value:{type:"string",source:"html",selector:"blockquote",multiline:"p"},citation:{type:"string",source:"html",selector:"cite",default:""},mainColor:{type:"string"},customMainColor:{type:"string"},textColor:{type:"string"},customTextColor:{type:"string"}};function Gre(e){if(!e)return;let t=e.match(/border-color:([^;]+)[;]?/);if(t&&t[1])return t[1]}function Fd(e){e=e||"<p></p>";let r=`</p>${e}<p>`.split("</p><p>");return r.shift(),r.pop(),r.join("<br>")}var Oke={attributes:{value:{type:"string",source:"html",selector:"blockquote",multiline:"p",role:"content"},citation:{type:"string",source:"html",selector:"cite",default:"",role:"content"},textAlign:{type:"string"}},supports:{anchor:!0,align:["left","right","wide","full"],color:{gradients:!0,background:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0,fontAppearance:!0}},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,radius:!0,style:!0,width:!0}},__experimentalStyle:{typography:{fontSize:"1.5em",lineHeight:"1.6"}}},save({attributes:e}){let{textAlign:t,citation:r,value:a}=e,n=!ht.RichText.isEmpty(r);return(0,fr.jsx)("figure",{...ht.useBlockProps.save({className:w({[`has-text-align-${t}`]:t})}),children:(0,fr.jsxs)("blockquote",{children:[(0,fr.jsx)(ht.RichText.Content,{value:a,multiline:!0}),n&&(0,fr.jsx)(ht.RichText.Content,{tagName:"cite",value:r})]})})},migrate({value:e,...t}){return{value:Fd(e),...t}}},jke={attributes:{...h2},supports:{anchor:!0,align:["left","right","wide","full"],color:{gradients:!0,background:!0,link:!0},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0}},save({attributes:e}){let{mainColor:t,customMainColor:r,customTextColor:a,textColor:n,value:i,citation:l,className:s}=e,c=s?.includes(Vd),u,m;if(c){let h=(0,ht.getColorClassName)("background-color",t);u=w({"has-background":h||r,[h]:h}),m={backgroundColor:h?void 0:r}}else r&&(m={borderColor:r});let p=(0,ht.getColorClassName)("color",n),d=w({"has-text-color":n||a,[p]:p}),f=p?void 0:{color:a};return(0,fr.jsx)("figure",{...ht.useBlockProps.save({className:u,style:m}),children:(0,fr.jsxs)("blockquote",{className:d,style:f,children:[(0,fr.jsx)(ht.RichText.Content,{value:i,multiline:!0}),!ht.RichText.isEmpty(l)&&(0,fr.jsx)(ht.RichText.Content,{tagName:"cite",value:l})]})})},migrate({value:e,className:t,mainColor:r,customMainColor:a,customTextColor:n,...i}){let l=t?.includes(Vd),s;return a&&(l?s={color:{background:a}}:s={border:{color:a}}),n&&s&&(s.color={...s.color,text:n}),{value:Fd(e),className:t,backgroundColor:l?r:void 0,borderColor:l?void 0:r,textAlign:l?"left":void 0,...i,style:s}}},Uke={attributes:{...h2,figureStyle:{source:"attribute",selector:"figure",attribute:"style"}},save({attributes:e}){let{mainColor:t,customMainColor:r,textColor:a,customTextColor:n,value:i,citation:l,className:s,figureStyle:c}=e,u=s?.includes(Vd),m,p;if(u){let g=(0,ht.getColorClassName)("background-color",t);m=w({"has-background":g||r,[g]:g}),p={backgroundColor:g?void 0:r}}else r?p={borderColor:r}:t&&(p={borderColor:Gre(c)});let d=(0,ht.getColorClassName)("color",a),f=(a||n)&&w("has-text-color",{[d]:d});return(0,fr.jsx)("figure",{className:m,style:p,children:(0,fr.jsxs)("blockquote",{className:f,style:d?void 0:{color:n},children:[(0,fr.jsx)(ht.RichText.Content,{value:i,multiline:!0}),!ht.RichText.isEmpty(l)&&(0,fr.jsx)(ht.RichText.Content,{tagName:"cite",value:l})]})})},migrate({value:e,className:t,figureStyle:r,mainColor:a,customMainColor:n,customTextColor:i,...l}){let s=t?.includes(Vd),c;if(n&&(s?c={color:{background:n}}:c={border:{color:n}}),i&&c&&(c.color={...c.color,text:i}),!s&&a&&r){let u=Gre(r);if(u)return{value:Fd(e),...l,className:t,style:{border:{color:u}}}}return{value:Fd(e),className:t,backgroundColor:s?a:void 0,borderColor:s?void 0:a,textAlign:s?"left":void 0,...l,style:c}}},Gke={attributes:h2,save({attributes:e}){let{mainColor:t,customMainColor:r,textColor:a,customTextColor:n,value:i,citation:l,className:s}=e,c=s?.includes(Vd),u,m;if(c)u=(0,ht.getColorClassName)("background-color",t),u||(m={backgroundColor:r});else if(r)m={borderColor:r};else if(t){let h=(0,Wre.select)(ht.store).getSettings().colors??[];m={borderColor:(0,ht.getColorObjectByAttributeValues)(h,t).color}}let p=(0,ht.getColorClassName)("color",a),d=a||n?w("has-text-color",{[p]:p}):void 0;return(0,fr.jsx)("figure",{className:u,style:m,children:(0,fr.jsxs)("blockquote",{className:d,style:p?void 0:{color:n},children:[(0,fr.jsx)(ht.RichText.Content,{value:i,multiline:!0}),!ht.RichText.isEmpty(l)&&(0,fr.jsx)(ht.RichText.Content,{tagName:"cite",value:l})]})})},migrate({value:e,className:t,mainColor:r,customMainColor:a,customTextColor:n,...i}){let l=t?.includes(Vd),s={};return a&&(l?s={color:{background:a}}:s={border:{color:a}}),n&&s&&(s.color={...s.color,text:n}),{value:Fd(e),className:t,backgroundColor:l?r:void 0,borderColor:l?void 0:r,textAlign:l?"left":void 0,...i,style:s}}},Wke={attributes:{...h2},save({attributes:e}){let{value:t,citation:r}=e;return(0,fr.jsxs)("blockquote",{children:[(0,fr.jsx)(ht.RichText.Content,{value:t,multiline:!0}),!ht.RichText.isEmpty(r)&&(0,fr.jsx)(ht.RichText.Content,{tagName:"cite",value:r})]})},migrate({value:e,...t}){return{value:Fd(e),...t}}},$ke={attributes:{...h2,citation:{type:"string",source:"html",selector:"footer"},align:{type:"string",default:"none"}},save({attributes:e}){let{value:t,citation:r,align:a}=e;return(0,fr.jsxs)("blockquote",{className:`align${a}`,children:[(0,fr.jsx)(ht.RichText.Content,{value:t,multiline:!0}),!ht.RichText.isEmpty(r)&&(0,fr.jsx)(ht.RichText.Content,{tagName:"footer",value:r})]})},migrate({value:e,...t}){return{value:Fd(e),...t}}},$re=[Oke,jke,Uke,Gke,Wke,$ke];var g2=o(P(),1),hc=o(T(),1),hC=o(W(),1),Kre=o(U(),1);var qre="figure";var Zre="blockquote";var ms=o(v(),1),qke=Kre.Platform.OS==="web";function Zke({attributes:e,setAttributes:t,isSelected:r,insertBlocksAfter:a}){let{textAlign:n,citation:i,value:l}=e,s=(0,hc.useBlockProps)({className:w({[`has-text-align-${n}`]:n})}),c=!hc.RichText.isEmpty(i)||r;return(0,ms.jsxs)(ms.Fragment,{children:[(0,ms.jsx)(hc.BlockControls,{group:"block",children:(0,ms.jsx)(hc.AlignmentControl,{value:n,onChange:u=>{t({textAlign:u})}})}),(0,ms.jsx)(qre,{...s,children:(0,ms.jsxs)(Zre,{children:[(0,ms.jsx)(hc.RichText,{identifier:"value",tagName:"p",value:l,onChange:u=>t({value:u}),"aria-label":(0,g2.__)("Pullquote text"),placeholder:(0,g2.__)("Add quote"),textAlign:"center"}),c&&(0,ms.jsx)(hc.RichText,{identifier:"citation",tagName:qke?"cite":void 0,style:{display:"block"},value:i,"aria-label":(0,g2.__)("Pullquote citation text"),placeholder:(0,g2.__)("Add citation"),onChange:u=>t({citation:u}),className:"wp-block-pullquote__citation",__unstableMobileNoFocusOnMount:!0,textAlign:"center",__unstableOnSplitAtEnd:()=>a((0,hC.createBlock)((0,hC.getDefaultBlockName)()))})]})})]})}var Qre=Zke;var gC={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/pullquote",title:"Pullquote",category:"text",description:"Give special visual emphasis to a quote from your text.",textdomain:"default",attributes:{value:{type:"rich-text",source:"rich-text",selector:"p",role:"content"},citation:{type:"rich-text",source:"rich-text",selector:"cite",role:"content"},textAlign:{type:"string"}},supports:{anchor:!0,align:["left","right","wide","full"],background:{backgroundImage:!0,backgroundSize:!0,__experimentalDefaultControls:{backgroundImage:!0}},color:{gradients:!0,background:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},dimensions:{minHeight:!0,__experimentalDefaultControls:{minHeight:!1}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,radius:!0,style:!0,width:!0}},__experimentalStyle:{typography:{fontSize:"1.5em",lineHeight:"1.6"}},interactivity:{clientNavigation:!0}},editorStyle:"wp-block-pullquote-editor",style:"wp-block-pullquote"};var gg=o(T(),1),vg=o(v(),1);function Yre({attributes:e}){let{textAlign:t,citation:r,value:a}=e,n=!gg.RichText.isEmpty(r);return(0,vg.jsx)("figure",{...gg.useBlockProps.save({className:w({[`has-text-align-${t}`]:t})}),children:(0,vg.jsxs)("blockquote",{children:[(0,vg.jsx)(gg.RichText.Content,{tagName:"p",value:a}),n&&(0,vg.jsx)(gg.RichText.Content,{tagName:"cite",value:r})]})})}var xu=o(W(),1),bg=o(em(),1),Qke={from:[{type:"block",isMultiBlock:!0,blocks:["core/paragraph"],transform:e=>(0,xu.createBlock)("core/pullquote",{value:(0,bg.toHTMLString)({value:(0,bg.join)(e.map(({content:t})=>(0,bg.create)({html:t})),` `)}),anchor:e.anchor})},{type:"block",blocks:["core/heading"],transform:({content:e,anchor:t})=>(0,xu.createBlock)("core/pullquote",{value:e,anchor:t})}],to:[{type:"block",blocks:["core/paragraph"],transform:({value:e,citation:t})=>{let r=[];return e&&r.push((0,xu.createBlock)("core/paragraph",{content:e})),t&&r.push((0,xu.createBlock)("core/paragraph",{content:t})),r.length===0?(0,xu.createBlock)("core/paragraph",{content:""}):r}},{type:"block",blocks:["core/heading"],transform:({value:e,citation:t})=>{if(!e)return(0,xu.createBlock)("core/heading",{content:t});let r=(0,xu.createBlock)("core/heading",{content:e});return t?[r,(0,xu.createBlock)("core/heading",{content:t})]:r}}]},Xre=Qke;var{fieldsKey:Yke,formKey:Xke}=K(Jre.privateApis),{name:eoe}=gC,vC={icon:EP,example:{attributes:{value:(0,v2.__)("One of the hardest things to do in technology is disrupt yourself."),citation:(0,v2.__)("Matt Mullenweg")}},transforms:Xre,edit:Qre,save:Yre,deprecated:$re};window.__experimentalContentOnlyInspectorFields&&(vC[Yke]=[{id:"value",label:(0,v2.__)("Content"),type:"text",Edit:"rich-text"},{id:"citation",label:(0,v2.__)("Citation"),type:"text",Edit:"rich-text"}],vC[Xke]={fields:["value","citation"]});var Jke=()=>E({name:eoe,metadata:gC,settings:vC});var UL={};Z(UL,{init:()=>N5e,metadata:()=>bC,name:()=>Nae,settings:()=>Eae});var bC={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/query",title:"Query Loop",category:"theme",description:"An advanced block that allows displaying post types based on different query parameters and visual configurations.",keywords:["posts","list","blog","blogs","custom post types"],textdomain:"default",attributes:{queryId:{type:"number"},query:{type:"object",default:{perPage:null,pages:0,offset:0,postType:"post",order:"desc",orderBy:"date",author:"",search:"",exclude:[],sticky:"",inherit:!0,taxQuery:null,parents:[],format:[]}},tagName:{type:"string",default:"div"},namespace:{type:"string"},enhancedPagination:{type:"boolean",default:!1}},usesContext:["templateSlug"],providesContext:{queryId:"queryId",query:"query",displayLayout:"displayLayout",enhancedPagination:"enhancedPagination"},supports:{anchor:!0,align:["wide","full"],html:!1,layout:!0,interactivity:!0},editorStyle:"wp-block-query-editor"};var hae=o(V(),1),gae=o(U(),1),vae=o(T(),1);var EC=o(V(),1),uae=o(me(),1),w2=o(U(),1),hl=o(T(),1),mae=o(P(),1),pae=o(Q(),1);var moe=o(M(),1),kC=o(P(),1);var gc=o(V(),1),Od=o(U(),1),b2=o(Q(),1),yC=o(T(),1),toe=o(Wo(),1),Hd=o(P(),1),ku=o(W(),1),y2=e=>{let t=e?.reduce((r,a)=>{let{mapById:n,mapByName:i,names:l}=r;return n[a.id]=a,i[a.name]=a,l.push(a.name),r},{mapById:{},mapByName:{},names:[]});return{entities:e,...t}},t5e=(e,t)=>{let r=t.split("."),a=e;return r.forEach(n=>{a=a?.[n]}),a},IL=(e,t)=>(e||[]).map(r=>({...r,name:(0,toe.decodeEntities)(t5e(r,t))})),roe=()=>{let e=(0,gc.useSelect)(n=>{let{getPostTypes:i}=n(b2.store),l=["attachment"];return i({per_page:-1})?.filter(({viewable:c,slug:u})=>c&&!l.includes(u))},[]),t=(0,Od.useMemo)(()=>{if(e?.length)return e.reduce((n,i)=>(n[i.slug]=i.taxonomies,n),{})},[e]),r=(0,Od.useMemo)(()=>(e||[]).map(({labels:n,slug:i})=>({label:n.singular_name,value:i})),[e]),a=(0,Od.useMemo)(()=>e?.length?e.reduce((n,i)=>(n[i.slug]=i.supports?.["post-formats"]||!1,n),{}):{},[e]);return{postTypesTaxonomiesMap:t,postTypesSelectOptions:r,postTypeFormatSupportMap:a}},_C=e=>{let t=(0,gc.useSelect)(r=>{let{getTaxonomies:a,getPostType:n}=r(b2.store);return n(e)?.taxonomies?.length>0?a({type:e,per_page:-1}):[]},[e]);return(0,Od.useMemo)(()=>t?.filter(({visibility:r})=>!!r?.publicly_queryable),[t])};function ooe(e){return(0,gc.useSelect)(t=>{let r=t(b2.store).getPostType(e);return r?.viewable&&r?.hierarchical},[e])}function aoe(e){let t=(0,gc.useSelect)(r=>!!r(b2.store).getPostType(e)?.supports?.["page-attributes"],[e]);return(0,Od.useMemo)(()=>{let r=[{label:(0,Hd.__)("Newest to oldest"),value:"date/desc"},{label:(0,Hd.__)("Oldest to newest"),value:"date/asc"},{label:(0,Hd.__)("A \u2192 Z"),value:"title/asc"},{label:(0,Hd.__)("Z \u2192 A"),value:"title/desc"}];return t&&r.push({label:(0,Hd.__)("Ascending by order"),value:"menu_order/asc"},{label:(0,Hd.__)("Descending by order"),value:"menu_order/desc"}),r},[t])}function noe(e){return(0,gc.useSelect)(t=>t(ku.store).getActiveBlockVariation("core/query",e)?.allowedControls,[e])}function Fi(e,t){return e?e.includes(t):!0}var ioe=(e,t)=>{let{query:{postType:r,inherit:a},namespace:n}=t,i=e.map(c=>(0,ku.cloneBlock)(c)),l=[],s=[...i];for(;s.length>0;){let c=s.shift();c.name==="core/query"&&(c.attributes.query={...c.attributes.query,postType:r,inherit:a},n&&(c.attributes.namespace=n),l.push(c.clientId)),c.innerBlocks?.forEach(u=>{s.push(u)})}return{newBlocks:i,queryClientIds:l}};function loe(e,t){return(0,gc.useSelect)(r=>{let a=r(ku.store).getActiveBlockVariation("core/query",t)?.name;if(!a)return"core/query";let{getBlockRootClientId:n,getPatternsByBlockTypes:i}=r(yC.store),l=n(e);return i(`core/query/${a}`,l).length>0?`core/query/${a}`:"core/query"},[e,t])}function soe(e){let{activeVariationName:t,blockVariations:r}=(0,gc.useSelect)(n=>{let{getActiveBlockVariation:i,getBlockVariations:l}=n(ku.store);return{activeVariationName:i("core/query",e)?.name,blockVariations:l("core/query","block")}},[e]);return(0,Od.useMemo)(()=>{let n=l=>!l.attributes?.namespace;if(!t)return r.filter(n);let i=r.filter(l=>l.attributes?.namespace?.includes(t));return i.length?i:r.filter(n)},[t,r])}var coe=(e,t)=>(0,gc.useSelect)(r=>{let{getBlockRootClientId:a,getPatternsByBlockTypes:n}=r(yC.store),i=a(e);return n(t,i)},[t,e]),xC=e=>(0,gc.useSelect)(t=>{let{getClientIdsOfDescendants:r,getBlockName:a}=t(yC.store);return r(e).some(n=>{let i=a(n),l=Object.is((0,ku.getBlockSupport)(i,"interactivity"),!0),s=(0,ku.getBlockSupport)(i,"interactivity.clientNavigation");return!l&&!s})},[e]);function uoe(e){if(!e)return{isSingular:!0};let t=!1,r=e==="wp"?"custom":e,a=["404","blank","single","page","custom"],n=e.includes("-")?e.split("-",1)[0]:e;return e.includes("-")&&e.split("-").slice(1).join("-")&&(r=n),t=a.includes(r),{isSingular:t,templateType:r}}var _2=o(v(),1);function poe({enhancedPagination:e,setAttributes:t,clientId:r}){let a=xC(r),n=(0,kC.__)("Reload the full page\u2014instead of just the posts list\u2014when visitors navigate between pages.");return a&&(n=(0,kC.__)("Enhancement disabled because there are non-compatible blocks inside the Query block.")),(0,_2.jsx)(_2.Fragment,{children:(0,_2.jsx)(moe.ToggleControl,{label:(0,kC.__)("Reload full page"),help:n,checked:!e,disabled:a,onChange:i=>{t({enhancedPagination:!i})}})})}var bt=o(M(),1),tae=o(V(),1),rae=o(Q(),1),hr=o(P(),1),oae=o(me(),1),SC=o(U(),1);var doe=o(M(),1),yg=o(P(),1),foe=o(v(),1),r5e=[{label:(0,yg.__)("Newest to oldest"),value:"date/desc"},{label:(0,yg.__)("Oldest to newest"),value:"date/asc"},{label:(0,yg.__)("A \u2192 Z"),value:"title/asc"},{label:(0,yg.__)("Z \u2192 A"),value:"title/desc"}];function o5e({order:e,orderBy:t,orderByOptions:r=r5e,onChange:a}){return(0,foe.jsx)(doe.SelectControl,{__next40pxDefaultSize:!0,label:(0,yg.__)("Order by"),value:`${t}/${e}`,options:r,onChange:n=>{let[i,l]=n.split("/");a({order:l,orderBy:i})}})}var hoe=o5e;var goe=o(P(),1),voe=o(M(),1),boe=o(V(),1),yoe=o(Q(),1);var _oe=o(v(),1),a5e={who:"authors",per_page:-1,_fields:"id,name",context:"view"};function n5e({value:e,onChange:t}){let r=(0,boe.useSelect)(c=>{let{getUsers:u}=c(yoe.store);return u(a5e)},[]);if(!r)return null;let a=y2(r),i=(e?e.toString().split(","):[]).reduce((c,u)=>{let m=a.mapById[u];return m&&c.push({id:u,value:m.name}),c},[]),l=(c,u)=>{let m=u?.id||c[u]?.id;if(m)return m},s=c=>{let u=Array.from(c.reduce((m,p)=>{let d=l(a.mapByName,p);return d&&m.add(d),m},new Set));t({author:u.join(",")})};return(0,_oe.jsx)(voe.FormTokenField,{label:(0,goe.__)("Authors"),value:i,suggestions:a.names,onChange:s,__experimentalShowHowTo:!1,__next40pxDefaultSize:!0})}var xoe=n5e;var woe=o(P(),1),Coe=o(M(),1),NL=o(V(),1),EL=o(Q(),1),wu=o(U(),1),Soe=o(me(),1);var Toe=o(v(),1),jd=[],koe={order:"asc",_fields:"id,title",context:"view"};function i5e({parents:e,postType:t,onChange:r}){let[a,n]=(0,wu.useState)(""),[i,l]=(0,wu.useState)(jd),[s,c]=(0,wu.useState)(jd),u=(0,Soe.useDebounce)(n,250),{searchResults:m,searchHasResolved:p}=(0,NL.useSelect)(b=>{if(!a)return{searchResults:jd,searchHasResolved:!0};let{getEntityRecords:y,hasFinishedResolution:k}=b(EL.store),_=["postType",t,{...koe,search:a,orderby:"relevance",exclude:e,per_page:20}];return{searchResults:y(..._),searchHasResolved:k("getEntityRecords",_)}},[a,t,e]),d=(0,NL.useSelect)(b=>{if(!e?.length)return jd;let{getEntityRecords:y}=b(EL.store);return y("postType",t,{...koe,include:e,per_page:e.length})},[e,t]);(0,wu.useEffect)(()=>{if(e?.length||l(jd),!d?.length)return;let b=y2(IL(d,"title.rendered")),y=e.reduce((k,_)=>{let x=b.mapById[_];return x&&k.push({id:_,value:x.name}),k},[]);l(y)},[e,d]);let f=(0,wu.useMemo)(()=>m?.length?y2(IL(m,"title.rendered")):jd,[m]);(0,wu.useEffect)(()=>{p&&c(f.names)},[f.names,p]);let h=(b,y)=>{let k=y?.id||b?.[y]?.id;if(k)return k},g=b=>{let y=Array.from(b.reduce((k,_)=>{let x=h(f.mapByName,_);return x&&k.add(x),k},new Set));c(jd),r({parents:y})};return(0,Toe.jsx)(Coe.FormTokenField,{__next40pxDefaultSize:!0,label:(0,woe.__)("Parents"),value:i,onInputChange:u,suggestions:s,onChange:g,__experimentalShowHowTo:!1})}var Poe=i5e;var wC=o(M(),1),DL=o(V(),1),LL=o(Q(),1),Cu=o(U(),1),Noe=o(me(),1),Eoe=o(Wo(),1),CC=o(P(),1);var Um=o(v(),1),_g=[],Boe={order:"asc",_fields:"id,name",context:"view"},l5e=(e,t)=>{let r=t?.id||e?.find(n=>n.name===t)?.id;if(r)return r;let a=t.toLocaleLowerCase();return e?.find(n=>n.name.toLocaleLowerCase()===a)?.id};function Doe({onChange:e,query:t}){let{postType:r,taxQuery:a}=t,n=_C(r);return n?.length?(0,Um.jsx)(wC.__experimentalVStack,{spacing:4,children:n.map(i=>{let l=a?.include?.[i.slug]||[],s=a?.exclude?.[i.slug]||[],c=(u,m)=>{let p={...a?.[m],[i.slug]:u};u.length||delete p[i.slug];let d={...a,[m]:Object.keys(p).length?p:void 0};e({taxQuery:Object.values(d).every(f=>!f)?void 0:d})};return(0,Um.jsxs)(Cu.Fragment,{children:[(0,Um.jsx)(Ioe,{taxonomy:i,termIds:l,oppositeTermIds:s,onChange:u=>c(u,"include"),label:i.name}),(0,Um.jsx)(Ioe,{taxonomy:i,termIds:s,oppositeTermIds:l,onChange:u=>c(u,"exclude"),label:(0,CC.sprintf)((0,CC.__)("Exclude: %s"),i.name)})]},i.slug)})}):null}function Ioe({taxonomy:e,termIds:t,oppositeTermIds:r,onChange:a,label:n}){let[i,l]=(0,Cu.useState)(""),[s,c]=(0,Cu.useState)(_g),[u,m]=(0,Cu.useState)(_g),p=(0,Noe.useDebounce)(l,250),{searchResults:d,searchHasResolved:f}=(0,DL.useSelect)(b=>{if(!i)return{searchResults:_g,searchHasResolved:!0};let{getEntityRecords:y,hasFinishedResolution:k}=b(LL.store),_=[...t,...r],x=["taxonomy",e.slug,{...Boe,search:i,orderby:"name",exclude:_,per_page:20}];return{searchResults:y(...x),searchHasResolved:k("getEntityRecords",x)}},[i,e.slug,t,r]),h=(0,DL.useSelect)(b=>{if(!t?.length)return _g;let{getEntityRecords:y}=b(LL.store);return y("taxonomy",e.slug,{...Boe,include:t,per_page:t.length})},[e.slug,t]);return(0,Cu.useEffect)(()=>{if(t?.length||c(_g),!h?.length)return;let b=t.reduce((y,k)=>{let _=h.find(x=>x.id===k);return _&&y.push({id:k,value:_.name}),y},[]);c(b)},[t,h]),(0,Cu.useEffect)(()=>{f&&m(d.map(b=>b.name))},[d,f]),(0,Um.jsx)("div",{className:"block-library-query-inspector__taxonomy-control",children:(0,Um.jsx)(wC.FormTokenField,{label:n,value:s,onInputChange:p,suggestions:u,displayTransform:Eoe.decodeEntities,onChange:b=>{let y=new Set;for(let k of b){let _=l5e(d,k);_&&y.add(_)}m(_g),a(Array.from(y))},__experimentalShowHowTo:!1,__next40pxDefaultSize:!0})})}var Loe=o(M(),1),Moe=o(V(),1),Aoe=o(Q(),1),fl=o(P(),1),Roe=o(v(),1),s5e=[{value:"aside",label:(0,fl.__)("Aside")},{value:"audio",label:(0,fl.__)("Audio")},{value:"chat",label:(0,fl.__)("Chat")},{value:"gallery",label:(0,fl.__)("Gallery")},{value:"image",label:(0,fl.__)("Image")},{value:"link",label:(0,fl.__)("Link")},{value:"quote",label:(0,fl.__)("Quote")},{value:"standard",label:(0,fl.__)("Standard")},{value:"status",label:(0,fl.__)("Status")},{value:"video",label:(0,fl.__)("Video")}].sort((e,t)=>{let r=e.label.toUpperCase(),a=t.label.toUpperCase();return r<a?-1:r>a?1:0});function c5e(e,t){return e.map(r=>t.find(a=>a.label.toLocaleLowerCase()===r.toLocaleLowerCase())?.value).filter(Boolean)}function zoe({onChange:e,query:{format:t}}){let r=Array.isArray(t)?t:[t],{supportedFormats:a}=(0,Moe.useSelect)(s=>({supportedFormats:s(Aoe.store).getThemeSupports().formats}),[]),n=s5e.filter(s=>a.includes(s.value)),i=r.map(s=>n.find(c=>c.value===s)?.label).filter(Boolean),l=n.filter(s=>!r.includes(s.value)).map(s=>s.label);return(0,Roe.jsx)(Loe.FormTokenField,{label:(0,fl.__)("Formats"),value:i,suggestions:l,onChange:s=>{e({format:c5e(s,n)})},__experimentalShowHowTo:!1,__experimentalExpandOnFocus:!0,__next40pxDefaultSize:!0})}var Voe=o(M(),1),Ud=o(P(),1),Foe=o(v(),1),u5e=[{label:(0,Ud.__)("Include"),value:""},{label:(0,Ud.__)("Ignore"),value:"ignore"},{label:(0,Ud.__)("Exclude"),value:"exclude"},{label:(0,Ud.__)("Only"),value:"only"}];function Hoe({value:e,onChange:t}){return(0,Foe.jsx)(Voe.SelectControl,{__next40pxDefaultSize:!0,label:(0,Ud.__)("Sticky posts"),options:u5e,value:e,onChange:t,help:(0,Ud.__)("Sticky posts always appear first, regardless of their publish date.")})}var Uoe=o(M(),1),Goe=o(P(),1),Woe=o(v(),1),Ooe=1,joe=100,m5e=({perPage:e,offset:t=0,onChange:r})=>(0,Woe.jsx)(Uoe.RangeControl,{__next40pxDefaultSize:!0,label:(0,Goe.__)("Items per page"),min:Ooe,max:joe,onChange:a=>{isNaN(a)||a<Ooe||a>joe||r({perPage:a,offset:t})},value:parseInt(e,10)}),$oe=m5e;var Zoe=o(M(),1),Koe=o(P(),1),Qoe=o(v(),1),qoe=0,p5e=100,d5e=({offset:e=0,onChange:t})=>(0,Qoe.jsx)(Zoe.__experimentalNumberControl,{__next40pxDefaultSize:!0,label:(0,Koe.__)("Offset"),value:e,min:qoe,onChange:r=>{isNaN(r)||r<qoe||r>p5e||t({offset:r})}}),Yoe=d5e;var Xoe=o(M(),1),ML=o(P(),1),Joe=o(v(),1),f5e=({pages:e,onChange:t})=>(0,Joe.jsx)(Xoe.__experimentalNumberControl,{__next40pxDefaultSize:!0,label:(0,ML.__)("Max pages to show"),value:e,min:0,onChange:r=>{isNaN(r)||r<0||t({pages:r})},help:(0,ML.__)("Limit the pages you want to show, even if the query has more results. To show all pages use 0 (zero).")}),eae=f5e;var Qe=o(v(),1);function aae(e){let{attributes:t,setQuery:r,isSingular:a}=e,{query:n}=t,{order:i,orderBy:l,author:s,pages:c,postType:u,perPage:m,offset:p,sticky:d,inherit:f,taxQuery:h,parents:g,format:b}=n,y=noe(t),k=u==="post",{postTypesTaxonomiesMap:_,postTypesSelectOptions:x,postTypeFormatSupportMap:S}=roe(),C=_C(u),N=ooe(u),B=ie=>{let fe={postType:ie},ke=_[ie];if(ke?.length&&h){let de=Wr=>Object.entries(Wr||{}).reduce((ut,[br,mt])=>(ke.includes(br)&&(ut[br]=mt),ut),{}),ct={},at=de(h.include);Object.keys(at).length&&(ct.include=at);let kt=de(h.exclude);Object.keys(kt).length&&(ct.exclude=kt),fe.taxQuery=Object.keys(ct).length?ct:void 0}ie!=="post"&&(fe.sticky=""),fe.parents=[],S[ie]||(fe.format=[]),r(fe)},[D,A]=(0,SC.useState)(n.search),H=(0,SC.useMemo)(()=>(0,oae.debounce)(ie=>{r({search:ie})},250),[r]),F=aoe(u),z=Fi(y,"inherit"),I=!f&&Fi(y,"postType"),R=(0,hr.__)("Post type"),$=(0,hr.__)("Select the type of content to display: posts, pages, or custom post types."),j=!f&&Fi(y,"order"),G=!f&&k&&Fi(y,"sticky"),O=z||I||j||G,J=!!C?.length&&Fi(y,"taxQuery"),ee=Fi(y,"author"),oe=Fi(y,"search"),X=Fi(y,"parents")&&N,te=S[u],ne=(0,tae.useSelect)(ie=>{if(!te||!Fi(y,"format"))return!1;let fe=ie(rae.store).getThemeSupports();return fe.formats&&fe.formats.length>0&&fe.formats.some(ke=>ke!=="standard")},[y,te]),le=J||ee||oe||X||ne,pe=q(),Ie=Fi(y,"postCount"),Ne=Fi(y,"offset"),ae=Fi(y,"pages"),Re=Ie||Ne||ae,Ee=a&&f;return(0,Qe.jsxs)(Qe.Fragment,{children:[O&&(0,Qe.jsxs)(bt.__experimentalToolsPanel,{label:(0,hr.__)("Settings"),resetAll:()=>{r({postType:"post",order:"desc",orderBy:"date",sticky:"",inherit:!0})},dropdownMenuProps:pe,children:[z&&(0,Qe.jsx)(bt.__experimentalToolsPanelItem,{hasValue:()=>!f,label:(0,hr.__)("Query type"),onDeselect:()=>r({inherit:!0}),isShownByDefault:!0,children:(0,Qe.jsxs)(bt.__experimentalVStack,{spacing:4,children:[(0,Qe.jsxs)(bt.__experimentalToggleGroupControl,{__next40pxDefaultSize:!0,label:(0,hr.__)("Query type"),isBlock:!0,onChange:ie=>{r({inherit:ie==="default"})},help:f?(0,hr.__)("Display a list of posts or custom post types based on the current template."):(0,hr.__)("Display a list of posts or custom post types based on specific criteria."),value:f?"default":"custom",children:[(0,Qe.jsx)(bt.__experimentalToggleGroupControlOption,{value:"default",label:(0,hr.__)("Default")}),(0,Qe.jsx)(bt.__experimentalToggleGroupControlOption,{value:"custom",label:(0,hr.__)("Custom")})]}),Ee&&(0,Qe.jsx)(bt.Notice,{status:"warning",isDismissible:!1,children:(0,hr.__)("Cannot inherit the current template query when placed inside the singular content (e.g., post, page, 404, blank).")})]})}),I&&(0,Qe.jsx)(bt.__experimentalToolsPanelItem,{hasValue:()=>u!=="post",label:R,onDeselect:()=>B("post"),isShownByDefault:!0,children:x.length>2?(0,Qe.jsx)(bt.SelectControl,{__next40pxDefaultSize:!0,options:x,value:u,label:R,onChange:B,help:$}):(0,Qe.jsx)(bt.__experimentalToggleGroupControl,{__next40pxDefaultSize:!0,isBlock:!0,value:u,label:R,onChange:B,help:$,children:x.map(ie=>(0,Qe.jsx)(bt.__experimentalToggleGroupControlOption,{value:ie.value,label:ie.label},ie.value))})}),j&&(0,Qe.jsx)(bt.__experimentalToolsPanelItem,{hasValue:()=>i!=="desc"||l!=="date",label:(0,hr.__)("Order by"),onDeselect:()=>r({order:"desc",orderBy:"date"}),isShownByDefault:!0,children:(0,Qe.jsx)(hoe,{order:i,orderBy:l,orderByOptions:F,onChange:r})}),G&&(0,Qe.jsx)(bt.__experimentalToolsPanelItem,{hasValue:()=>!!d,label:(0,hr.__)("Sticky posts"),onDeselect:()=>r({sticky:""}),isShownByDefault:!0,children:(0,Qe.jsx)(Hoe,{value:d,onChange:ie=>r({sticky:ie})})})]}),!f&&Re&&(0,Qe.jsxs)(bt.__experimentalToolsPanel,{className:"block-library-query-toolspanel__display",label:(0,hr.__)("Display"),resetAll:()=>{r({offset:0,pages:0})},dropdownMenuProps:pe,children:[(0,Qe.jsx)(bt.__experimentalToolsPanelItem,{label:(0,hr.__)("Items per page"),hasValue:()=>m>0,children:(0,Qe.jsx)($oe,{perPage:m,offset:p,onChange:r})}),(0,Qe.jsx)(bt.__experimentalToolsPanelItem,{label:(0,hr.__)("Offset"),hasValue:()=>p>0,onDeselect:()=>r({offset:0}),children:(0,Qe.jsx)(Yoe,{offset:p,onChange:r})}),(0,Qe.jsx)(bt.__experimentalToolsPanelItem,{label:(0,hr.__)("Max pages to show"),hasValue:()=>c>0,onDeselect:()=>r({pages:0}),children:(0,Qe.jsx)(eae,{pages:c,onChange:r})})]}),!f&&le&&(0,Qe.jsxs)(bt.__experimentalToolsPanel,{className:"block-library-query-toolspanel__filters",label:(0,hr.__)("Filters"),resetAll:()=>{r({author:"",parents:[],search:"",taxQuery:null,format:[]}),A("")},dropdownMenuProps:pe,children:[J&&(0,Qe.jsx)(bt.__experimentalToolsPanelItem,{label:(0,hr.__)("Taxonomies"),hasValue:()=>Object.values(h||{}).some(ie=>Object.values(ie||{}).some(fe=>!!fe?.length)),onDeselect:()=>r({taxQuery:null}),children:(0,Qe.jsx)(Doe,{onChange:r,query:n})}),ee&&(0,Qe.jsx)(bt.__experimentalToolsPanelItem,{hasValue:()=>!!s,label:(0,hr.__)("Authors"),onDeselect:()=>r({author:""}),children:(0,Qe.jsx)(xoe,{value:s,onChange:r})}),oe&&(0,Qe.jsx)(bt.__experimentalToolsPanelItem,{hasValue:()=>!!D,label:(0,hr.__)("Keyword"),onDeselect:()=>{r({search:""}),A("")},children:(0,Qe.jsx)(bt.TextControl,{__next40pxDefaultSize:!0,label:(0,hr.__)("Keyword"),value:D,onChange:ie=>{H(ie),A(ie)}})}),X&&(0,Qe.jsx)(bt.__experimentalToolsPanelItem,{hasValue:()=>!!g?.length,label:(0,hr.__)("Parents"),onDeselect:()=>r({parents:[]}),children:(0,Qe.jsx)(Poe,{parents:g,postType:u,onChange:r})}),ne&&(0,Qe.jsx)(bt.__experimentalToolsPanelItem,{hasValue:()=>!!b?.length,label:(0,hr.__)("Formats"),onDeselect:()=>r({format:[]}),children:(0,Qe.jsx)(zoe,{onChange:r,query:n})})]})]})}var kg=o(M(),1),x2=o(P(),1),TC=o(U(),1);var xg=o(v(),1),nae="wp-block-query-enhanced-pagination-modal__description";function iae({clientId:e,attributes:{enhancedPagination:t},setAttributes:r}){let[a,n]=(0,TC.useState)(!1),i=xC(e);(0,TC.useEffect)(()=>{t&&i&&(r({enhancedPagination:!1}),n(!0))},[t,i,r]);let l=()=>{n(!1)},s=(0,x2.__)("Currently, avoiding full page reloads is not possible when non-interactive or non-client Navigation compatible blocks from plugins are present inside the Query block.")+" "+(0,x2.__)('If you still want to prevent full page reloads, remove that block, then disable "Reload full page" again in the Query Block settings.');return a&&(0,xg.jsx)(kg.Modal,{title:(0,x2.__)("Query block: Reload full page enabled"),className:"wp-block-query__enhanced-pagination-modal",aria:{describedby:nae},role:"alertdialog",focusOnMount:"firstElement",isDismissible:!1,onRequestClose:l,children:(0,xg.jsxs)(kg.__experimentalVStack,{alignment:"right",spacing:5,children:[(0,xg.jsx)("span",{id:nae,children:s}),(0,xg.jsx)(kg.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:l,children:(0,x2.__)("OK")})]})})}var Sg=o(M(),1),RL=o(P(),1),cae=o(V(),1),IC=o(T(),1);var wg=o(U(),1),lae=o(V(),1),BC=o(M(),1),Cg=o(T(),1),PC=o(P(),1);var Su=o(v(),1);function sae({clientId:e,attributes:t,setIsPatternSelectionModalOpen:r}){return(0,Su.jsx)(BC.Modal,{overlayClassName:"block-library-query-pattern__selection-modal",title:(0,PC.__)("Choose a pattern"),onRequestClose:()=>r(!1),isFullScreen:!0,children:(0,Su.jsx)(AL,{clientId:e,attributes:t})})}function k2(e,t){let r=loe(e,t),a=coe(e,r);return(0,wg.useMemo)(()=>a.filter(i=>i.blocks?.[0]?.name==="core/query"),[a])}function AL({clientId:e,attributes:t,showTitlesAsTooltip:r=!1,showSearch:a=!0}){let[n,i]=(0,wg.useState)(""),{replaceBlock:l,selectBlock:s}=(0,lae.useDispatch)(Cg.store),c=k2(e,t),u=(0,wg.useMemo)(()=>({previewPostType:t.query.postType}),[t.query.postType]),m=(0,wg.useMemo)(()=>dv(c,n),[c,n]),p=(d,f)=>{let{newBlocks:h,queryClientIds:g}=ioe(f,t);l(e,h),g[0]&&s(g[0])};return(0,Su.jsxs)("div",{className:"block-library-query-pattern__selection-content",children:[a&&(0,Su.jsx)("div",{className:"block-library-query-pattern__selection-search",children:(0,Su.jsx)(BC.SearchControl,{onChange:i,value:n,label:(0,PC.__)("Search"),placeholder:(0,PC.__)("Search")})}),(0,Su.jsx)(Cg.BlockContextProvider,{value:u,children:(0,Su.jsx)(Cg.__experimentalBlockPatternsList,{blockPatterns:m,onClickPattern:p,showTitlesAsTooltip:r})})]})}var Gd=o(v(),1);function h5e({clientId:e,attributes:t,hasInnerBlocks:r}){if(!k2(e,t).length)return null;let n=r?(0,RL.__)("Change design"):(0,RL.__)("Choose pattern");return(0,Gd.jsx)(IC.BlockControls,{group:"other",children:(0,Gd.jsx)(Sg.__experimentalDropdownContentWrapper,{children:(0,Gd.jsx)(Sg.Dropdown,{contentClassName:"block-editor-block-settings-menu__popover",focusOnMount:"firstElement",expandOnMobile:!0,renderToggle:({isOpen:i,onToggle:l})=>(0,Gd.jsx)(Sg.ToolbarButton,{"aria-haspopup":"true","aria-expanded":i,onClick:l,children:n}),renderContent:()=>(0,Gd.jsx)(AL,{clientId:e,attributes:t,showSearch:!1,showTitlesAsTooltip:!0})})})})}function NC(e){return(0,cae.useSelect)(r=>{let{isLockedBlock:a}=K(r(IC.store));return a(e.clientId)},[e.clientId])?null:(0,Gd.jsx)(h5e,{...e})}var Hi=o(v(),1),{HTMLElementControl:g5e}=K(hl.privateApis),v5e=3,b5e=[["core/post-template"]];function zL({attributes:e,setAttributes:t,clientId:r,context:a,name:n,isSelected:i}){let{queryId:l,query:s,enhancedPagination:c,tagName:u="div",query:{inherit:m}={}}=e,{templateSlug:p}=a,{isSingular:d}=uoe(p),{__unstableMarkNextChangeAsNotPersistent:f}=(0,EC.useDispatch)(hl.store),h=(0,uae.useInstanceId)(zL),g=(0,hl.useBlockProps)(),b=(0,hl.useInnerBlocksProps)(g,{template:b5e}),{postsPerPage:y}=(0,EC.useSelect)(_=>{let{getSettings:x}=_(hl.store),{getEntityRecord:S,getEntityRecordEdits:C,canUser:N}=_(pae.store),B=N("read",{kind:"root",name:"site"})?+S("root","site")?.posts_per_page:+x().postsPerPage;return{postsPerPage:+C("root","site")?.posts_per_page||B||v5e}},[]),k=(0,w2.useCallback)(_=>t(x=>({query:{...x.query,..._}})),[t]);return(0,w2.useEffect)(()=>{let _={};(m&&s.perPage!==y||!s.perPage&&y)&&(_.perPage=y),Object.keys(_).length&&(f(),k(_))},[s.perPage,m,y,f,k]),(0,w2.useEffect)(()=>{Number.isFinite(l)||(f(),t({queryId:h}))},[l,h,f,t]),(0,Hi.jsxs)(Hi.Fragment,{children:[i&&(0,Hi.jsx)(NC,{clientId:r,attributes:e,hasInnerBlocks:!0}),(0,Hi.jsx)(iae,{attributes:e,setAttributes:t,clientId:r}),(0,Hi.jsx)(hl.InspectorControls,{children:(0,Hi.jsx)(aae,{name:n,attributes:e,setQuery:k,setAttributes:t,clientId:r,isSingular:d})}),(0,Hi.jsxs)(hl.InspectorControls,{group:"advanced",children:[(0,Hi.jsx)(g5e,{tagName:u,onChange:_=>t({tagName:_}),clientId:r,options:[{label:(0,mae.__)("Default (<div>)"),value:"div"},{label:"<main>",value:"main"},{label:"<section>",value:"section"},{label:"<aside>",value:"aside"}]}),(0,Hi.jsx)(poe,{enhancedPagination:c,setAttributes:t,clientId:r})]}),(0,Hi.jsx)(u,{...b})]})}var LC=o(V(),1),MC=o(W(),1),VL=o(U(),1),Wd=o(T(),1),C2=o(M(),1),DC=o(P(),1),dae=o(me(),1);var vc=o(v(),1);function fae({attributes:e,clientId:t,name:r,openPatternSelectionModal:a,isSelected:n}){let[i,l]=(0,VL.useState)(!1),[s,c]=(0,VL.useState)(0),u=(0,dae.useResizeObserver)(([k])=>{c(k.contentRect.width)}),p=s>0&&s<160,{blockType:d,activeBlockVariation:f}=(0,LC.useSelect)(k=>{let{getActiveBlockVariation:_,getBlockType:x}=k(MC.store);return{blockType:x(r),activeBlockVariation:_(r,e)}},[r,e]),h=!!k2(t,e).length,g=f?.icon?.src||f?.icon||d?.icon?.src,b=f?.title||d?.title,y=(0,Wd.useBlockProps)({ref:u});return i?(0,vc.jsx)(y5e,{clientId:t,attributes:e,icon:g,label:b}):(0,vc.jsxs)("div",{...y,children:[n&&(0,vc.jsx)(NC,{clientId:t,attributes:e,hasInnerBlocks:!1}),(0,vc.jsxs)(C2.Placeholder,{className:"block-editor-media-placeholder",icon:!p&&g,label:!p&&b,instructions:!p&&(0,DC.__)("Choose a pattern for the query loop or start blank."),withIllustration:p,children:[!!h&&!p&&(0,vc.jsx)(C2.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:a,children:(0,DC.__)("Choose")}),!p&&(0,vc.jsx)(C2.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>{l(!0)},children:(0,DC.__)("Start blank")})]})]})}function y5e({clientId:e,attributes:t,icon:r,label:a}){let n=soe(t),{replaceInnerBlocks:i}=(0,LC.useDispatch)(Wd.store),l=(0,Wd.useBlockProps)();return(0,vc.jsx)("div",{...l,children:(0,vc.jsx)(Wd.__experimentalBlockVariationPicker,{icon:r,label:a,variations:n,onSelect:s=>{s.innerBlocks&&i(e,(0,MC.createBlocksFromInnerBlocksTemplate)(s.innerBlocks),!1)}})})}var $d=o(v(),1),_5e=e=>{let{clientId:t,attributes:r}=e,[a,n]=(0,gae.useState)(!1),l=(0,hae.useSelect)(s=>!!s(vae.store).getBlocks(t).length,[t])?zL:fae;return(0,$d.jsxs)($d.Fragment,{children:[(0,$d.jsx)(l,{...e,openPatternSelectionModal:()=>n(!0)}),a&&(0,$d.jsx)(sae,{clientId:t,attributes:r,setIsPatternSelectionModalOpen:n})]})},bae=_5e;var AC=o(T(),1),yae=o(v(),1);function _ae({attributes:{tagName:e="div"}}){let t=AC.useBlockProps.save(),r=AC.useInnerBlocksProps.save(t);return(0,yae.jsx)(e,{...r})}var S2=o(P(),1);var bc=o(M(),1),Tu=o(v(),1),xae=(0,Tu.jsx)(bc.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48",children:(0,Tu.jsx)(bc.Path,{d:"M41 9H7v3h34V9zm-22 5H7v1h12v-1zM7 26h12v1H7v-1zm34-5H7v3h34v-3zM7 38h12v1H7v-1zm34-5H7v3h34v-3z"})}),kae=(0,Tu.jsx)(bc.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48",children:(0,Tu.jsx)(bc.Path,{d:"M41 9H7v3h34V9zm-4 5H7v1h30v-1zm4 3H7v1h34v-1zM7 20h30v1H7v-1zm0 12h30v1H7v-1zm34 3H7v1h34v-1zM7 38h30v1H7v-1zm34-11H7v3h34v-3z"})}),wae=(0,Tu.jsx)(bc.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48",children:(0,Tu.jsx)(bc.Path,{d:"M41 9H7v3h34V9zm-22 5H7v1h12v-1zm22 3H7v1h34v-1zM7 20h34v1H7v-1zm0 12h12v1H7v-1zm34 3H7v1h34v-1zM7 38h34v1H7v-1zm34-11H7v3h34v-3z"})}),Cae=(0,Tu.jsx)(bc.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48",children:(0,Tu.jsx)(bc.Path,{d:"M7 9h34v6H7V9zm12 8H7v1h12v-1zm18 3H7v1h30v-1zm0 18H7v1h30v-1zM7 35h12v1H7v-1zm34-8H7v6h34v-6z"})});var FL=["core/post-date",{metadata:{bindings:{datetime:{source:"core/post-data",args:{field:"date"}}}}}],x5e=[{name:"title-date",title:(0,S2.__)("Title & Date"),icon:xae,attributes:{},innerBlocks:[["core/post-template",{},[["core/post-title"],FL]],["core/query-pagination"],["core/query-no-results"]],scope:["block"]},{name:"title-excerpt",title:(0,S2.__)("Title & Excerpt"),icon:kae,attributes:{},innerBlocks:[["core/post-template",{},[["core/post-title"],["core/post-excerpt"]]],["core/query-pagination"],["core/query-no-results"]],scope:["block"]},{name:"title-date-excerpt",title:(0,S2.__)("Title, Date, & Excerpt"),icon:wae,attributes:{},innerBlocks:[["core/post-template",{},[["core/post-title"],FL,["core/post-excerpt"]]],["core/query-pagination"],["core/query-no-results"]],scope:["block"]},{name:"image-date-title",title:(0,S2.__)("Image, Date, & Title"),icon:Cae,attributes:{},innerBlocks:[["core/post-template",{},[["core/post-featured-image"],FL,["core/post-title"]]],["core/query-pagination"],["core/query-no-results"]],scope:["block"]}],Sae=x5e;var RC=o(W(),1),Oa=o(T(),1);var qd=o(v(),1),{cleanEmptyObject:HL}=K(Oa.privateApis),OL=e=>{let{query:t}=e,{categoryIds:r,tagIds:a,taxQuery:n,...i}=t;return(r?.length||a?.length)&&(i.taxQuery={include:{category:r?.length?r:void 0,post_tag:a?.length?a:void 0}}),Object.keys(n||{}).length&&(i.taxQuery={include:n}),{...e,query:i}},Tae=(e,t)=>{let{style:r,backgroundColor:a,gradient:n,textColor:i,...l}=e;if(!(a||n||i||r?.color||r?.elements?.link))return[e,t];if(r&&(l.style=HL({...r,color:void 0,elements:{...r.elements,link:void 0}})),k5e(t)){let u=t[0],p=r?.color||r?.elements?.link||u.attributes.style?HL({...u.attributes.style,color:r?.color,elements:r?.elements?.link?{link:r?.elements?.link}:void 0}):void 0,d=(0,RC.createBlock)("core/group",{...u.attributes,backgroundColor:a,gradient:n,textColor:i,style:p},u.innerBlocks);return[l,[d]]}let c=(0,RC.createBlock)("core/group",{backgroundColor:a,gradient:n,textColor:i,style:HL({color:r?.color,elements:r?.elements?.link?{link:r?.elements?.link}:void 0})},t);return[l,[c]]},k5e=(e=[])=>e.length===1&&e[0].name==="core/group",jL=e=>{let{layout:t=null}=e;if(!t)return e;let{inherit:r=null,contentSize:a=null,...n}=t;return r||a?{...e,layout:{...n,contentSize:a,type:"constrained"}}:e},Pae=(e=[])=>{let t=null;for(let r of e)if(r.name==="core/post-template"){t=r;break}else r.innerBlocks.length&&(t=Pae(r.innerBlocks));return t},Bae=(e=[],t)=>(e.forEach((r,a)=>{r.name==="core/post-template"?e.splice(a,1,t):r.innerBlocks.length&&(r.innerBlocks=Bae(r.innerBlocks,t))}),e),Tg=(e,t)=>{let{displayLayout:r=null,...a}=e;if(!r)return[e,t];let n=Pae(t);if(!n)return[e,t];let{type:i,columns:l}=r,s=i==="flex"?"grid":"default",c=(0,RC.createBlock)("core/post-template",{...n.attributes,layout:{type:s,...l&&{columnCount:l}}},n.innerBlocks);return[a,Bae(t,c)]},w5e={attributes:{queryId:{type:"number"},query:{type:"object",default:{perPage:null,pages:0,offset:0,postType:"post",categoryIds:[],tagIds:[],order:"desc",orderBy:"date",author:"",search:"",exclude:[],sticky:"",inherit:!0}},layout:{type:"object",default:{type:"list"}}},supports:{html:!1},migrate(e,t){let r=OL(e),{layout:a,...n}=r,i={...n,displayLayout:r.layout};return Tg(i,t)},save(){return(0,qd.jsx)(Oa.InnerBlocks.Content,{})}},C5e={attributes:{queryId:{type:"number"},query:{type:"object",default:{perPage:null,pages:0,offset:0,postType:"post",categoryIds:[],tagIds:[],order:"desc",orderBy:"date",author:"",search:"",exclude:[],sticky:"",inherit:!0}},tagName:{type:"string",default:"div"},displayLayout:{type:"object",default:{type:"list"}}},supports:{align:["wide","full"],html:!1,color:{gradients:!0,link:!0},layout:!0},isEligible:({query:{categoryIds:e,tagIds:t}={}})=>e||t,migrate(e,t){let r=OL(e),[a,n]=Tae(r,t),i=jL(a);return Tg(i,n)},save({attributes:{tagName:e="div"}}){let t=Oa.useBlockProps.save(),r=Oa.useInnerBlocksProps.save(t);return(0,qd.jsx)(e,{...r})}},S5e={attributes:{queryId:{type:"number"},query:{type:"object",default:{perPage:null,pages:0,offset:0,postType:"post",order:"desc",orderBy:"date",author:"",search:"",exclude:[],sticky:"",inherit:!0,taxQuery:null,parents:[]}},tagName:{type:"string",default:"div"},displayLayout:{type:"object",default:{type:"list"}},namespace:{type:"string"}},supports:{align:["wide","full"],html:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},layout:!0},isEligible(e){let{style:t,backgroundColor:r,gradient:a,textColor:n}=e;return r||a||n||t?.color||t?.elements?.link},migrate(e,t){let[r,a]=Tae(e,t),n=jL(r);return Tg(n,a)},save({attributes:{tagName:e="div"}}){let t=Oa.useBlockProps.save(),r=Oa.useInnerBlocksProps.save(t);return(0,qd.jsx)(e,{...r})}},T5e={attributes:{queryId:{type:"number"},query:{type:"object",default:{perPage:null,pages:0,offset:0,postType:"post",order:"desc",orderBy:"date",author:"",search:"",exclude:[],sticky:"",inherit:!0,taxQuery:null,parents:[]}},tagName:{type:"string",default:"div"},displayLayout:{type:"object",default:{type:"list"}},namespace:{type:"string"}},supports:{align:["wide","full"],html:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},layout:!0},save({attributes:{tagName:e="div"}}){let t=Oa.useBlockProps.save(),r=Oa.useInnerBlocksProps.save(t);return(0,qd.jsx)(e,{...r})},isEligible:({layout:e})=>e?.inherit||e?.contentSize&&e?.type!=="constrained",migrate(e,t){let r=jL(e);return Tg(r,t)}},P5e={attributes:{queryId:{type:"number"},query:{type:"object",default:{perPage:null,pages:0,offset:0,postType:"post",order:"desc",orderBy:"date",author:"",search:"",exclude:[],sticky:"",inherit:!0,taxQuery:null,parents:[]}},tagName:{type:"string",default:"div"},displayLayout:{type:"object",default:{type:"list"}},namespace:{type:"string"}},supports:{align:["wide","full"],anchor:!0,html:!1,layout:!0},save({attributes:{tagName:e="div"}}){let t=Oa.useBlockProps.save(),r=Oa.useInnerBlocksProps.save(t);return(0,qd.jsx)(e,{...r})},isEligible:({displayLayout:e})=>!!e,migrate:Tg},B5e={attributes:{queryId:{type:"number"},query:{type:"object",default:{perPage:null,pages:0,offset:0,postType:"post",order:"desc",orderBy:"date",author:"",search:"",exclude:[],sticky:"",inherit:!0,taxQuery:null,parents:[],format:[]}},tagName:{type:"string",default:"div"},namespace:{type:"string"},enhancedPagination:{type:"boolean",default:!1}},supports:{align:["wide","full"],html:!1,layout:!0,interactivity:!0,contentRole:!0},save({attributes:{tagName:e="div"}}){let t=Oa.useBlockProps.save(),r=Oa.useInnerBlocksProps.save(t);return(0,qd.jsx)(e,{...r})},isEligible:({query:{taxQuery:e}={}})=>!!e&&Object.keys(e).some(t=>!["include","exclude"].includes(t)),migrate(e,t){let r=OL(e);return Tg(r,t)}},I5e=[B5e,P5e,T5e,S5e,C5e,w5e],Iae=I5e;var{name:Nae}=bC,Eae={icon:Sp,edit:bae,example:{viewportWidth:650,attributes:{namespace:"core/posts-list",query:{perPage:4,pages:1,offset:0,postType:"post",order:"desc",orderBy:"date",author:"",search:"",sticky:"exclude",inherit:!1}},innerBlocks:[{name:"core/post-template",attributes:{layout:{type:"grid",columnCount:2}},innerBlocks:[{name:"core/post-title"},{name:"core/post-date",attributes:{metadata:{bindings:{datetime:{source:"core/post-data",args:{field:"date"}}}}}},{name:"core/post-excerpt"}]}]},save:_ae,variations:Sae,deprecated:Iae},N5e=()=>E({name:Nae,metadata:bC,settings:Eae});var GL={};Z(GL,{init:()=>L5e,metadata:()=>zC,name:()=>Fae,settings:()=>Hae});var Vae=o(P(),1);var zC={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/query-no-results",title:"No Results",category:"theme",description:"Contains the block elements used to render content when no query results are found.",ancestor:["core/query"],textdomain:"default",usesContext:["queryId","query"],supports:{anchor:!0,align:!0,reusable:!1,html:!1,color:{gradients:!0,link:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}}};var VC=o(T(),1),Dae=o(P(),1),Lae=o(v(),1),D5e=[["core/paragraph",{placeholder:(0,Dae.__)("Add text or blocks that will display when a query returns no results.")}]];function Mae(){let e=(0,VC.useBlockProps)(),t=(0,VC.useInnerBlocksProps)(e,{template:D5e});return(0,Lae.jsx)("div",{...t})}var Aae=o(T(),1),Rae=o(v(),1);function zae(){return(0,Rae.jsx)(Aae.InnerBlocks.Content,{})}var{name:Fae}=zC,Hae={icon:Sp,edit:Mae,save:zae,example:{innerBlocks:[{name:"core/paragraph",attributes:{content:(0,Vae.__)("No posts were found.")}}]}},L5e=()=>E({name:Fae,metadata:zC,settings:Hae});var qL={};Z(qL,{init:()=>z5e,metadata:()=>FC,name:()=>Yae,settings:()=>Xae});var FC={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/query-pagination",title:"Pagination",category:"theme",ancestor:["core/query"],allowedBlocks:["core/query-pagination-previous","core/query-pagination-numbers","core/query-pagination-next"],description:"Displays a paginated navigation to next/previous set of posts, when applicable.",textdomain:"default",attributes:{paginationArrow:{type:"string",default:"none"},showLabel:{type:"boolean",default:!0}},usesContext:["queryId","query"],providesContext:{paginationArrow:"paginationArrow",showLabel:"showLabel"},supports:{anchor:!0,align:!0,reusable:!1,html:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},layout:{allowSwitching:!1,allowInheriting:!1,default:{type:"flex"}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}},editorStyle:"wp-block-query-pagination-editor",style:"wp-block-query-pagination"};var HC=o(P(),1),Pu=o(T(),1),OC=o(V(),1),T2=o(M(),1),Wae=o(U(),1);var Zd=o(P(),1),Pg=o(M(),1),Bg=o(v(),1);function Oae({value:e,onChange:t}){return(0,Bg.jsxs)(Pg.__experimentalToggleGroupControl,{__next40pxDefaultSize:!0,label:(0,Zd.__)("Arrow"),value:e,onChange:t,help:(0,Zd.__)("A decorative arrow appended to the next and previous page link."),isBlock:!0,children:[(0,Bg.jsx)(Pg.__experimentalToggleGroupControlOption,{value:"none",label:(0,Zd._x)("None","Arrow option for Query Pagination Next/Previous blocks")}),(0,Bg.jsx)(Pg.__experimentalToggleGroupControlOption,{value:"arrow",label:(0,Zd._x)("Arrow","Arrow option for Query Pagination Next/Previous blocks")}),(0,Bg.jsx)(Pg.__experimentalToggleGroupControlOption,{value:"chevron",label:(0,Zd._x)("Chevron","Arrow option for Query Pagination Next/Previous blocks")})]})}var WL=o(P(),1),jae=o(M(),1),Uae=o(v(),1);function Gae({value:e,onChange:t}){return(0,Uae.jsx)(jae.ToggleControl,{label:(0,WL.__)("Show label text"),help:(0,WL.__)('Make label text visible, e.g. "Next Page".'),onChange:t,checked:e===!0})}var gl=o(v(),1),A5e=[["core/query-pagination-previous"],["core/query-pagination-numbers"],["core/query-pagination-next"]];function $ae({attributes:{paginationArrow:e,showLabel:t},setAttributes:r,clientId:a}){let n=(0,OC.useSelect)(u=>{let{getBlocks:m}=u(Pu.store);return m(a)?.find(d=>["core/query-pagination-next","core/query-pagination-previous"].includes(d.name))},[a]),{__unstableMarkNextChangeAsNotPersistent:i}=(0,OC.useDispatch)(Pu.store),l=q(),s=(0,Pu.useBlockProps)(),c=(0,Pu.useInnerBlocksProps)(s,{template:A5e});return(0,Wae.useEffect)(()=>{e==="none"&&!t&&(i(),r({showLabel:!0}))},[e,r,t,i]),(0,gl.jsxs)(gl.Fragment,{children:[n&&(0,gl.jsx)(Pu.InspectorControls,{children:(0,gl.jsxs)(T2.__experimentalToolsPanel,{label:(0,HC.__)("Settings"),resetAll:()=>{r({paginationArrow:"none",showLabel:!0})},dropdownMenuProps:l,children:[(0,gl.jsx)(T2.__experimentalToolsPanelItem,{hasValue:()=>e!=="none",label:(0,HC.__)("Pagination arrow"),onDeselect:()=>r({paginationArrow:"none"}),isShownByDefault:!0,children:(0,gl.jsx)(Oae,{value:e,onChange:u=>{r({paginationArrow:u})}})}),e!=="none"&&(0,gl.jsx)(T2.__experimentalToolsPanelItem,{hasValue:()=>!t,label:(0,HC.__)("Show text"),onDeselect:()=>r({showLabel:!0}),isShownByDefault:!0,children:(0,gl.jsx)(Gae,{value:t,onChange:u=>{r({showLabel:u})}})})]})}),(0,gl.jsx)("nav",{...c})]})}var qae=o(T(),1),Zae=o(v(),1);function Kae(){return(0,Zae.jsx)(qae.InnerBlocks.Content,{})}var jC=o(T(),1),$L=o(v(),1),R5e=[{save(){return(0,$L.jsx)("div",{...jC.useBlockProps.save(),children:(0,$L.jsx)(jC.InnerBlocks.Content,{})})}}],Qae=R5e;var{name:Yae}=FC,Xae={icon:n1,edit:$ae,save:Kae,deprecated:Qae},z5e=()=>E({name:Yae,metadata:FC,settings:Xae});var KL={};Z(KL,{init:()=>H5e,metadata:()=>UC,name:()=>ene,settings:()=>tne});var UC={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/query-pagination-next",title:"Next Page",category:"theme",parent:["core/query-pagination"],description:"Displays the next posts page link.",textdomain:"default",attributes:{label:{type:"string"}},usesContext:["queryId","query","paginationArrow","showLabel","enhancedPagination"],supports:{anchor:!0,reusable:!1,html:!1,color:{gradients:!0,text:!1,__experimentalDefaultControls:{background:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}}};var ZL=o(P(),1),GC=o(T(),1),P2=o(v(),1),F5e={none:"",arrow:"\u2192",chevron:"\xBB"};function Jae({attributes:{label:e},setAttributes:t,context:{paginationArrow:r,showLabel:a}}){let n=F5e[r];return(0,P2.jsxs)("a",{href:"#pagination-next-pseudo-link",onClick:i=>i.preventDefault(),...(0,GC.useBlockProps)(),children:[a&&(0,P2.jsx)(GC.PlainText,{__experimentalVersion:2,tagName:"span","aria-label":(0,ZL.__)("Next page link"),placeholder:(0,ZL.__)("Next Page"),value:e,onChange:i=>t({label:i})}),n&&(0,P2.jsx)("span",{className:`wp-block-query-pagination-next-arrow is-arrow-${r}`,"aria-hidden":!0,children:n})]})}var{name:ene}=UC,tne={icon:r1,edit:Jae},H5e=()=>E({name:ene,metadata:UC,settings:tne});var QL={};Z(QL,{init:()=>U5e,metadata:()=>WC,name:()=>one,settings:()=>ane});var WC={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/query-pagination-numbers",title:"Page Numbers",category:"theme",parent:["core/query-pagination"],description:"Displays a list of page numbers for pagination.",textdomain:"default",attributes:{midSize:{type:"number",default:2}},usesContext:["queryId","query","enhancedPagination"],supports:{anchor:!0,reusable:!1,html:!1,color:{gradients:!0,text:!1,__experimentalDefaultControls:{background:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}},editorStyle:"wp-block-query-pagination-numbers-editor"};var I2=o(P(),1),$C=o(T(),1),Ig=o(M(),1);var Oi=o(v(),1),B2=(e,t="a",r="")=>(0,Oi.jsx)(t,{className:`page-numbers ${r}`,children:e},e),j5e=e=>{let t=[];for(let r=1;r<=e;r++)t.push(B2(r));t.push(B2(e+1,"span","current"));for(let r=1;r<=e;r++)t.push(B2(e+1+r));return t.push(B2("...","span","dots")),t.push(B2(e*2+3)),(0,Oi.jsx)(Oi.Fragment,{children:t})};function rne({attributes:e,setAttributes:t}){let{midSize:r}=e,a=j5e(parseInt(r,10)),n=q();return(0,Oi.jsxs)(Oi.Fragment,{children:[(0,Oi.jsx)($C.InspectorControls,{children:(0,Oi.jsx)(Ig.__experimentalToolsPanel,{label:(0,I2.__)("Settings"),resetAll:()=>t({midSize:2}),dropdownMenuProps:n,children:(0,Oi.jsx)(Ig.__experimentalToolsPanelItem,{label:(0,I2.__)("Number of links"),hasValue:()=>r!==2,onDeselect:()=>t({midSize:2}),isShownByDefault:!0,children:(0,Oi.jsx)(Ig.RangeControl,{__next40pxDefaultSize:!0,label:(0,I2.__)("Number of links"),help:(0,I2.__)("Specify how many links can appear before and after the current page number. Links to the first, current and last page are always visible."),value:r,onChange:i=>{t({midSize:parseInt(i,10)})},min:0,max:5,withInputField:!1})})})}),(0,Oi.jsx)("div",{...(0,$C.useBlockProps)(),children:a})]})}var{name:one}=WC,ane={icon:o1,edit:rne,example:{}},U5e=()=>E({name:one,metadata:WC,settings:ane});var XL={};Z(XL,{init:()=>$5e,metadata:()=>qC,name:()=>ine,settings:()=>lne});var qC={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/query-pagination-previous",title:"Previous Page",category:"theme",parent:["core/query-pagination"],description:"Displays the previous posts page link.",textdomain:"default",attributes:{label:{type:"string"}},usesContext:["queryId","query","paginationArrow","showLabel","enhancedPagination"],supports:{anchor:!0,reusable:!1,html:!1,color:{gradients:!0,text:!1,__experimentalDefaultControls:{background:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}}};var YL=o(P(),1),ZC=o(T(),1),N2=o(v(),1),W5e={none:"",arrow:"\u2190",chevron:"\xAB"};function nne({attributes:{label:e},setAttributes:t,context:{paginationArrow:r,showLabel:a}}){let n=W5e[r];return(0,N2.jsxs)("a",{href:"#pagination-previous-pseudo-link",onClick:i=>i.preventDefault(),...(0,ZC.useBlockProps)(),children:[n&&(0,N2.jsx)("span",{className:`wp-block-query-pagination-previous-arrow is-arrow-${r}`,"aria-hidden":!0,children:n}),a&&(0,N2.jsx)(ZC.PlainText,{__experimentalVersion:2,tagName:"span","aria-label":(0,YL.__)("Previous page link"),placeholder:(0,YL.__)("Previous Page"),value:e,onChange:i=>t({label:i})})]})}var{name:ine}=qC,lne={icon:a1,edit:nne},$5e=()=>E({name:ine,metadata:qC,settings:lne});var rM={};Z(rM,{init:()=>Q5e,metadata:()=>KC,name:()=>hne,settings:()=>gne});var KC={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/query-title",title:"Query Title",category:"theme",description:"Display the query title.",textdomain:"default",attributes:{type:{type:"string"},textAlign:{type:"string"},level:{type:"number",default:1},levelOptions:{type:"array"},showPrefix:{type:"boolean",default:!0},showSearchTerm:{type:"boolean",default:!0}},example:{attributes:{type:"search"}},usesContext:["query"],supports:{anchor:!0,align:["wide","full"],html:!1,color:{gradients:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}}},style:"wp-block-query-title"};var $n=o(T(),1),vl=o(M(),1),qt=o(P(),1);var JL=o(Q(),1),eM=o(V(),1);function sne(){let e=(0,eM.useSelect)(l=>{let{getCurrentPostId:s,getCurrentPostType:c,getCurrentTemplateId:u}=l("core/editor"),m=c(),p=u()||(m==="wp_template"?s():null);return p?l(JL.store).getEditedEntityRecord("postType","wp_template",p)?.slug:null},[]),t=e?.match(/^(category|tag|taxonomy-([^-]+))$|^(((category|tag)|taxonomy-([^-]+))-(.+))$/),r,a,n=!1,i;if(t)t[1]?r=t[2]?t[2]:t[1]:t[3]&&(r=t[6]?t[6]:t[4],a=t[7]),r=r==="tag"?"post_tag":r;else{let l=e?.match(/^(author)$|^author-(.+)$/);l&&(n=!0,l[2]&&(i=l[2]))}return(0,eM.useSelect)(l=>{let{getEntityRecords:s,getTaxonomy:c,getAuthors:u}=l(JL.store),m,p;if(r&&(m=c(r)?.labels?.singular_name),a){let d=s("taxonomy",r,{slug:a,per_page:1});d&&d[0]&&(p=d[0].name)}if(n&&(m="Author",i)){let d=u({slug:i});d&&d[0]&&(p=d[0].name)}return{archiveTypeLabel:m,archiveNameLabel:p}},[i,n,r,a])}var cne=o(Q(),1),tM=o(V(),1);function une(e){let t=(0,tM.useSelect)(r=>{let{getCurrentPostType:a}=r("core/editor");return a()},[]);return(0,tM.useSelect)(r=>{let{getPostType:a}=r(cne.store),i=a(e||t);return{postTypeLabel:i?i.labels.singular_name:""}},[e,t])}var xt=o(v(),1),Z5e=["archive","search","post-type"];function mne({attributes:{type:e,level:t,levelOptions:r,textAlign:a,showPrefix:n,showSearchTerm:i},setAttributes:l,context:{query:s}}){let{archiveTypeLabel:c,archiveNameLabel:u}=sne(),{postTypeLabel:m}=une(s?.postType),p=q(),d=t===0?"p":`h${t}`,f=(0,$n.useBlockProps)({className:w("wp-block-query-title__placeholder",{[`has-text-align-${a}`]:a})});if(!Z5e.includes(e))return(0,xt.jsx)("div",{...f,children:(0,xt.jsx)($n.Warning,{children:(0,qt.__)("Provided type is not supported.")})});let h;if(e==="archive"){let g;c?n?u?g=(0,qt.sprintf)((0,qt._x)("%1$s: %2$s","archive label"),c,u):g=(0,qt.sprintf)((0,qt.__)("%s: Name"),c):u?g=u:g=(0,qt.sprintf)((0,qt.__)("%s name"),c):g=n?(0,qt.__)("Archive type: Name"):(0,qt.__)("Archive title"),h=(0,xt.jsxs)(xt.Fragment,{children:[(0,xt.jsx)($n.InspectorControls,{children:(0,xt.jsx)(vl.__experimentalToolsPanel,{label:(0,qt.__)("Settings"),resetAll:()=>l({showPrefix:!0}),dropdownMenuProps:p,children:(0,xt.jsx)(vl.__experimentalToolsPanelItem,{hasValue:()=>!n,label:(0,qt.__)("Show archive type in title"),onDeselect:()=>l({showPrefix:!0}),isShownByDefault:!0,children:(0,xt.jsx)(vl.ToggleControl,{label:(0,qt.__)("Show archive type in title"),onChange:()=>l({showPrefix:!n}),checked:n})})})}),(0,xt.jsx)(d,{...f,children:g})]})}if(e==="search"&&(h=(0,xt.jsxs)(xt.Fragment,{children:[(0,xt.jsx)($n.InspectorControls,{children:(0,xt.jsx)(vl.__experimentalToolsPanel,{label:(0,qt.__)("Settings"),resetAll:()=>l({showSearchTerm:!0}),dropdownMenuProps:p,children:(0,xt.jsx)(vl.__experimentalToolsPanelItem,{hasValue:()=>!i,label:(0,qt.__)("Show search term in title"),onDeselect:()=>l({showSearchTerm:!0}),isShownByDefault:!0,children:(0,xt.jsx)(vl.ToggleControl,{label:(0,qt.__)("Show search term in title"),onChange:()=>l({showSearchTerm:!i}),checked:i})})})}),(0,xt.jsx)(d,{...f,children:i?(0,qt.__)("Search results for: \u201Csearch term\u201D"):(0,qt.__)("Search results")})]})),e==="post-type"){let g;m?n?g=(0,qt.sprintf)((0,qt.__)('Post Type: "%s"'),m):g=m:g=n?(0,qt.__)("Post Type: Name"):(0,qt.__)("Name"),h=(0,xt.jsxs)(xt.Fragment,{children:[(0,xt.jsx)($n.InspectorControls,{children:(0,xt.jsx)(vl.__experimentalToolsPanel,{label:(0,qt.__)("Settings"),resetAll:()=>l({showPrefix:!0}),dropdownMenuProps:p,children:(0,xt.jsx)(vl.__experimentalToolsPanelItem,{hasValue:()=>!n,label:(0,qt.__)("Show post type label"),onDeselect:()=>l({showPrefix:!0}),isShownByDefault:!0,children:(0,xt.jsx)(vl.ToggleControl,{label:(0,qt.__)("Show post type label"),onChange:()=>l({showPrefix:!n}),checked:n})})})}),(0,xt.jsx)(d,{...f,children:g})]})}return(0,xt.jsxs)(xt.Fragment,{children:[(0,xt.jsxs)($n.BlockControls,{group:"block",children:[(0,xt.jsx)($n.HeadingLevelDropdown,{value:t,options:r,onChange:g=>l({level:g})}),(0,xt.jsx)($n.AlignmentControl,{value:a,onChange:g=>{l({textAlign:g})}})]}),h]})}var Kd=o(P(),1);var pne=[{isDefault:!0,name:"archive-title",title:(0,Kd.__)("Archive Title"),description:(0,Kd.__)("Display the archive title based on the queried object."),icon:El,attributes:{type:"archive"},scope:["inserter"]},{isDefault:!1,name:"search-title",title:(0,Kd.__)("Search Results Title"),description:(0,Kd.__)("Display the search results title based on the queried object."),icon:El,attributes:{type:"search"},scope:["inserter"]},{isDefault:!1,name:"post-type-label",title:(0,Kd.__)("Post Type Label"),description:(0,Kd.__)("Display the post type label based on the queried object."),icon:El,attributes:{type:"post-type"},scope:["inserter"]}];pne.forEach(e=>{e.isActive||(e.isActive=(t,r)=>t.type===r.type)});var dne=pne;var K5e={attributes:{type:{type:"string"},textAlign:{type:"string"},level:{type:"number",default:1}},supports:{align:["wide","full"],html:!1,color:{gradients:!0},spacing:{margin:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0}},save(){return null},migrate:Ot,isEligible({style:e}){return e?.typography?.fontFamily}},fne=[K5e];var{name:hne}=KC,gne={icon:El,edit:mne,variations:dne,deprecated:fne},Q5e=()=>E({name:hne,metadata:KC,settings:gne});var nM={};Z(nM,{init:()=>X5e,metadata:()=>QC,name:()=>yne,settings:()=>_ne});var QC={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/query-total",title:"Query Total",category:"theme",ancestor:["core/query"],description:"Display the total number of results in a query.",textdomain:"default",attributes:{displayType:{type:"string",default:"total-results"}},usesContext:["queryId","query"],supports:{anchor:!0,align:["wide","full"],html:!1,spacing:{margin:!0,padding:!0},color:{gradients:!0,__experimentalDefaultControls:{background:!0,text:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}},interactivity:{clientNavigation:!0}},style:"wp-block-query-total"};var YC=o(T(),1),XC=o(M(),1),Ng=o(P(),1);var Gm=o(M(),1),Qd=o(v(),1),oM=(0,Qd.jsx)(Gm.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true",focusable:"false",children:(0,Qd.jsx)(Gm.Path,{d:"M4 11h4v2H4v-2zm6 0h6v2h-6v-2zm8 0h2v2h-2v-2z"})}),aM=(0,Qd.jsx)(Gm.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true",focusable:"false",children:(0,Qd.jsx)(Gm.Path,{d:"M4 13h2v-2H4v2zm4 0h10v-2H8v2zm12 0h2v-2h-2v2z"})}),vne=(0,Qd.jsx)(Gm.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true",focusable:"false",children:(0,Qd.jsx)(Gm.Path,{d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2Zm.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v12Zm-7-6-4.1 5h8.8v-3h-1.5v1.5h-4.2l2.9-3.5-2.9-3.5h4.2V10h1.5V7H7.4l4.1 5Z"})});var ps=o(v(),1);function bne({attributes:e,setAttributes:t}){let{displayType:r}=e,a=(0,YC.useBlockProps)(),n=()=>{switch(r){case"total-results":return oM;case"range-display":return aM}},i=[{role:"menuitemradio",title:(0,Ng.__)("Total results"),isActive:r==="total-results",icon:oM,onClick:()=>{t({displayType:"total-results"})}},{role:"menuitemradio",title:(0,Ng.__)("Range display"),isActive:r==="range-display",icon:aM,onClick:()=>{t({displayType:"range-display"})}}],l=(0,ps.jsx)(YC.BlockControls,{children:(0,ps.jsx)(XC.ToolbarGroup,{children:(0,ps.jsx)(XC.ToolbarDropdownMenu,{icon:n(),label:(0,Ng.__)("Change display type"),controls:i})})});return(0,ps.jsxs)("div",{...a,children:[l,r==="total-results"?(0,ps.jsx)(ps.Fragment,{children:(0,Ng.__)("12 results found")}):r==="range-display"?(0,ps.jsx)(ps.Fragment,{children:(0,Ng.__)("Displaying 1 \u2013 10 of 12")}):null]})}var{name:yne}=QC,_ne={icon:vne,edit:bne},X5e=()=>E({name:yne,metadata:QC,settings:_ne});var lM={};Z(lM,{init:()=>c4e,metadata:()=>r6,name:()=>Bne,settings:()=>Ine});var iM=o(P(),1);var E2=o(W(),1),oo=o(T(),1),pa=o(v(),1),Wm=e=>{let{value:t,...r}=e;return[{...r},t?(0,E2.parseWithAttributeSchema)(t,{type:"array",source:"query",selector:"p",query:{content:{type:"string",source:"html"}}}).map(({content:a})=>(0,E2.createBlock)("core/paragraph",{content:a})):(0,E2.createBlock)("core/paragraph")]},xne=["left","right","center"],Yd=(e,t)=>{let{align:r,...a}=e;return[xne.includes(r)?{...a,textAlign:r}:e,t]},J5e=(e,t)=>[{...e,className:e.className?e.className+" is-style-large":"is-style-large"},t],e4e={attributes:{value:{type:"string",source:"html",selector:"blockquote",multiline:"p",default:"",role:"content"},citation:{type:"string",source:"html",selector:"cite",default:"",role:"content"},align:{type:"string"}},supports:{anchor:!0,html:!1,__experimentalOnEnter:!0,__experimentalOnMerge:!0,typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0,fontAppearance:!0}},color:{gradients:!0,heading:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}}},isEligible:({align:e})=>xne.includes(e),save({attributes:e}){let{align:t,citation:r}=e,a=w({[`has-text-align-${t}`]:t});return(0,pa.jsxs)("blockquote",{...oo.useBlockProps.save({className:a}),children:[(0,pa.jsx)(oo.InnerBlocks.Content,{}),!oo.RichText.isEmpty(r)&&(0,pa.jsx)(oo.RichText.Content,{tagName:"cite",value:r})]})},migrate:Yd},t4e={attributes:{value:{type:"string",source:"html",selector:"blockquote",multiline:"p",default:"",role:"content"},citation:{type:"string",source:"html",selector:"cite",default:"",role:"content"},align:{type:"string"}},supports:{anchor:!0,__experimentalSlashInserter:!0,typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0,fontAppearance:!0}}},save({attributes:e}){let{align:t,value:r,citation:a}=e,n=w({[`has-text-align-${t}`]:t});return(0,pa.jsxs)("blockquote",{...oo.useBlockProps.save({className:n}),children:[(0,pa.jsx)(oo.RichText.Content,{multiline:!0,value:r}),!oo.RichText.isEmpty(a)&&(0,pa.jsx)(oo.RichText.Content,{tagName:"cite",value:a})]})},migrate(e){return Yd(...Wm(e))}},r4e={attributes:{value:{type:"string",source:"html",selector:"blockquote",multiline:"p",default:""},citation:{type:"string",source:"html",selector:"cite",default:""},align:{type:"string"}},migrate(e){return Yd(...Wm(e))},save({attributes:e}){let{align:t,value:r,citation:a}=e;return(0,pa.jsxs)("blockquote",{style:{textAlign:t||null},children:[(0,pa.jsx)(oo.RichText.Content,{multiline:!0,value:r}),!oo.RichText.isEmpty(a)&&(0,pa.jsx)(oo.RichText.Content,{tagName:"cite",value:a})]})}},o4e={attributes:{value:{type:"string",source:"html",selector:"blockquote",multiline:"p",default:""},citation:{type:"string",source:"html",selector:"cite",default:""},align:{type:"string"},style:{type:"number",default:1}},migrate(e){if(e.style===2){let{style:t,...r}=e;return Yd(...J5e(...Wm(r)))}return Yd(...Wm(e))},save({attributes:e}){let{align:t,value:r,citation:a,style:n}=e;return(0,pa.jsxs)("blockquote",{className:n===2?"is-large":"",style:{textAlign:t||null},children:[(0,pa.jsx)(oo.RichText.Content,{multiline:!0,value:r}),!oo.RichText.isEmpty(a)&&(0,pa.jsx)(oo.RichText.Content,{tagName:"cite",value:a})]})}},a4e={attributes:{value:{type:"string",source:"html",selector:"blockquote",multiline:"p",default:""},citation:{type:"string",source:"html",selector:"footer",default:""},align:{type:"string"},style:{type:"number",default:1}},migrate(e){if(!isNaN(parseInt(e.style))){let{style:t,...r}=e;return Yd(...Wm(r))}return Yd(...Wm(e))},save({attributes:e}){let{align:t,value:r,citation:a,style:n}=e;return(0,pa.jsxs)("blockquote",{className:`blocks-quote-style-${n}`,style:{textAlign:t||null},children:[(0,pa.jsx)(oo.RichText.Content,{multiline:!0,value:r}),!oo.RichText.isEmpty(a)&&(0,pa.jsx)(oo.RichText.Content,{tagName:"footer",value:a})]})}},kne=[e4e,t4e,r4e,o4e,a4e];var D2=o(P(),1),yc=o(T(),1),wne=o(M(),1),e6=o(V(),1),t6=o(U(),1),Cne=o(Ff(),1);var Bu=o(v(),1),JC=t6.Platform.OS==="web",n4e=[["core/paragraph",{}]],i4e=(e,t)=>{let r=(0,e6.useRegistry)(),{updateBlockAttributes:a,replaceInnerBlocks:n}=(0,e6.useDispatch)(yc.store);(0,t6.useEffect)(()=>{if(!e.value)return;let[i,l]=Wm(e);(0,Cne.default)("Value attribute on the quote block",{since:"6.0",version:"6.5",alternative:"inner blocks"}),r.batch(()=>{a(t,i),n(t,l)})},[e.value])};function Sne({attributes:e,setAttributes:t,insertBlocksAfter:r,clientId:a,className:n,style:i,isSelected:l}){let{textAlign:s,allowedBlocks:c}=e;i4e(e,a);let u=(0,yc.useBlockProps)({className:w(n,{[`has-text-align-${s}`]:s}),...!JC&&{style:i}}),m=(0,yc.useInnerBlocksProps)(u,{template:n4e,templateInsertUpdatesSelection:!0,__experimentalCaptureToolbars:!0,renderAppender:!1,allowedBlocks:c});return(0,Bu.jsxs)(Bu.Fragment,{children:[(0,Bu.jsx)(yc.BlockControls,{group:"block",children:(0,Bu.jsx)(yc.AlignmentControl,{value:s,onChange:p=>{t({textAlign:p})}})}),(0,Bu.jsxs)(wne.BlockQuotation,{...m,children:[m.children,(0,Bu.jsx)(_a,{attributeKey:"citation",tagName:JC?"cite":"p",style:JC&&{display:"block"},isSelected:l,attributes:e,setAttributes:t,__unstableMobileNoFocusOnMount:!0,icon:_1,label:(0,D2.__)("Quote citation"),placeholder:(0,D2.__)("Add citation"),addLabel:(0,D2.__)("Add citation"),removeLabel:(0,D2.__)("Remove citation"),excludeElementClassName:!0,className:"wp-block-quote__citation",insertBlocksAfter:r,...JC?{}:{textAlign:s}})]})]})}var r6={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/quote",title:"Quote",category:"text",description:'Give quoted text visual emphasis. "In quoting others, we cite ourselves." \u2014 Julio Cort\xE1zar',keywords:["blockquote","cite"],textdomain:"default",attributes:{value:{type:"string",source:"html",selector:"blockquote",multiline:"p",default:"",role:"content"},citation:{type:"rich-text",source:"rich-text",selector:"cite",role:"content"},textAlign:{type:"string"}},supports:{anchor:!0,align:["left","right","wide","full"],html:!1,background:{backgroundImage:!0,backgroundSize:!0,__experimentalDefaultControls:{backgroundImage:!0}},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,radius:!0,style:!0,width:!0}},dimensions:{minHeight:!0,__experimentalDefaultControls:{minHeight:!1}},__experimentalOnEnter:!0,__experimentalOnMerge:!0,typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},color:{gradients:!0,heading:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},layout:{allowEditing:!1},spacing:{blockGap:!0,padding:!0,margin:!0},interactivity:{clientNavigation:!0},allowedBlocks:!0},styles:[{name:"default",label:"Default",isDefault:!0},{name:"plain",label:"Plain"}],editorStyle:"wp-block-quote-editor",style:"wp-block-quote"};var Xd=o(T(),1),L2=o(v(),1);function Tne({attributes:e}){let{textAlign:t,citation:r}=e,a=w({[`has-text-align-${t}`]:t});return(0,L2.jsxs)("blockquote",{...Xd.useBlockProps.save({className:a}),children:[(0,L2.jsx)(Xd.InnerBlocks.Content,{}),!Xd.RichText.isEmpty(r)&&(0,L2.jsx)(Xd.RichText.Content,{tagName:"cite",value:r})]})}var M2=o(T(),1),jr=o(W(),1),s4e={from:[{type:"block",blocks:["core/verse"],transform:({content:e})=>(0,jr.createBlock)("core/quote",{},[(0,jr.createBlock)("core/paragraph",{content:e})])},{type:"block",blocks:["core/pullquote"],transform:({value:e,align:t,citation:r,anchor:a,fontSize:n,style:i})=>(0,jr.createBlock)("core/quote",{align:t,citation:r,anchor:a,fontSize:n,style:i},[(0,jr.createBlock)("core/paragraph",{content:e})])},{type:"prefix",prefix:">",transform:e=>(0,jr.createBlock)("core/quote",{},[(0,jr.createBlock)("core/paragraph",{content:e})])},{type:"raw",schema:()=>({blockquote:{children:"*"}}),selector:"blockquote",transform:(e,t)=>(0,jr.createBlock)("core/quote",{},t({HTML:e.innerHTML,mode:"BLOCKS"}))},{type:"block",isMultiBlock:!0,blocks:["*"],isMatch:({},e)=>e.length===1?["core/paragraph","core/heading","core/list","core/pullquote"].includes(e[0].name):!e.some(({name:t})=>t==="core/quote"),__experimentalConvert:e=>(0,jr.createBlock)("core/quote",{},e.map(t=>(0,jr.createBlock)(t.name,t.attributes,t.innerBlocks)))}],to:[{type:"block",blocks:["core/pullquote"],isMatch:({},e)=>e.innerBlocks.every(({name:t})=>t==="core/paragraph"),transform:({align:e,citation:t,anchor:r,fontSize:a,style:n},i)=>{let l=i.map(({attributes:s})=>`${s.content}`).join("<br>");return(0,jr.createBlock)("core/pullquote",{value:l,align:e,citation:t,anchor:r,fontSize:a,style:n})}},{type:"block",blocks:["core/verse"],isMatch:({},e)=>e.innerBlocks.every(t=>t.name==="core/paragraph"?!0:(0,jr.switchToBlockType)(t,"core/paragraph")!==null),transform:({},e)=>{let r=e.flatMap(a=>a.name==="core/paragraph"?a:(0,jr.switchToBlockType)(a,"core/paragraph")||[]).map(({attributes:a})=>a.content||"").filter(Boolean).join("<br>");return(0,jr.createBlock)("core/verse",{content:r})}},{type:"block",blocks:["core/paragraph"],isMatch:({citation:e},t)=>{let r=t.innerBlocks;return r.length?r.every(a=>a.name==="core/paragraph"?!0:(0,jr.switchToBlockType)(a,"core/paragraph")!==null):!M2.RichText.isEmpty(e)},transform:({citation:e},t)=>{let r=t.flatMap(a=>a.name==="core/paragraph"?a:(0,jr.switchToBlockType)(a,"core/paragraph")||[]);return M2.RichText.isEmpty(e)?r:[...r,(0,jr.createBlock)("core/paragraph",{content:e})]}},{type:"block",blocks:["core/group"],transform:({citation:e,anchor:t},r)=>(0,jr.createBlock)("core/group",{anchor:t},M2.RichText.isEmpty(e)?r:[...r,(0,jr.createBlock)("core/paragraph",{content:e})])}],ungroup:({citation:e},t)=>M2.RichText.isEmpty(e)?t:[...t,(0,jr.createBlock)("core/paragraph",{content:e})]},Pne=s4e;var{name:Bne}=r6,Ine={icon:zP,example:{attributes:{citation:(0,iM.__)("Julio Cort\xE1zar")},innerBlocks:[{name:"core/paragraph",attributes:{content:(0,iM.__)("In quoting others, we cite ourselves.")}}]},transforms:Pne,edit:Sne,save:Tne,deprecated:kne},c4e=()=>E({name:Bne,metadata:r6,settings:Ine});var sM={};Z(sM,{init:()=>k4e,metadata:()=>o6,name:()=>Hne,settings:()=>One});var zne=o(Q(),1),Vne=o(V(),1),Fne=o(Wo(),1);var o6={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/block",title:"Pattern",category:"reusable",description:"Reuse this design across your site.",keywords:["reusable"],textdomain:"default",attributes:{ref:{type:"number"},content:{type:"object",default:{}}},providesContext:{"pattern/overrides":"content"},supports:{customClassName:!1,html:!1,inserter:!1,renaming:!1,interactivity:{clientNavigation:!0},customCSS:!1}};var R2=o(V(),1),z2=o(U(),1),Eg=o(Q(),1),_c=o(M(),1),A2=o(P(),1),Mr=o(T(),1),Lne=o(Ene(),1),Mne=o(W(),1);var gr=o(v(),1),{useLayoutClasses:m4e}=K(Mr.privateApis),{isOverridableBlock:p4e}=K(Lne.privateApis),d4e=["full","wide","left","right"],f4e=(e,t)=>{let r=(0,z2.useRef)();return(0,z2.useMemo)(()=>{if(!e?.length)return{};let a=r.current;if(a===void 0){let i=t?.type==="constrained",l=e.some(s=>d4e.includes(s.attributes.align));a=i&&l?"full":null,r.current=a}return{alignment:a,layout:a?t:void 0}},[e,t])};function h4e(){let e=(0,Mr.useBlockProps)();return(0,gr.jsx)("div",{...e,children:(0,gr.jsx)(Mr.Warning,{children:(0,A2.__)("Block cannot be rendered inside itself.")})})}var Dne=()=>{};function Ane(e){let{ref:t}=e.attributes;return(0,Mr.useHasRecursion)(t)?(0,gr.jsx)(h4e,{}):(0,gr.jsx)(Mr.RecursionProvider,{uniqueId:t,children:(0,gr.jsx)(b4e,{...e})})}function g4e({recordId:e,canOverrideBlocks:t,hasContent:r,handleEditOriginal:a,resetContent:n}){let i=(0,R2.useSelect)(l=>!!l(Eg.store).canUser("update",{kind:"postType",name:"wp_block",id:e}),[e]);return(0,gr.jsxs)(gr.Fragment,{children:[i&&!!a&&(0,gr.jsx)(Mr.BlockControls,{group:"other",children:(0,gr.jsx)(_c.ToolbarGroup,{children:(0,gr.jsx)(_c.ToolbarButton,{onClick:a,children:(0,A2.__)("Edit original")})})}),t&&(0,gr.jsx)(Mr.BlockControls,{group:"other",children:(0,gr.jsx)(_c.ToolbarGroup,{children:(0,gr.jsx)(_c.ToolbarButton,{onClick:n,disabled:!r,children:(0,A2.__)("Reset")})})})]})}var v4e={};function b4e({name:e,attributes:{ref:t,content:r},__unstableParentLayout:a,setAttributes:n}){let{record:i,hasResolved:l}=(0,Eg.useEntityRecord)("postType","wp_block",t),[s]=(0,Eg.useEntityBlockEditor)("postType","wp_block",{id:t}),c=l&&!i,{__unstableMarkLastChangeAsPersistent:u}=(0,R2.useDispatch)(Mr.store),{onNavigateToEntityRecord:m,hasPatternOverridesSource:p,supportedBlockTypesRaw:d}=(0,R2.useSelect)(C=>{let{getSettings:N}=C(Mr.store);return{onNavigateToEntityRecord:N().onNavigateToEntityRecord,hasPatternOverridesSource:!!(0,Mne.getBlockBindingsSource)("core/pattern-overrides"),supportedBlockTypesRaw:N().__experimentalBlockBindingsSupportedAttributes||v4e}},[]),f=(0,z2.useMemo)(()=>{let C=Object.keys(d),N=B=>B.some(D=>C.includes(D.name)&&p4e(D)?!0:N(D.innerBlocks));return p&&N(s)},[p,s,d]),{alignment:h,layout:g}=f4e(s,a),b=m4e({layout:g},e),y=(0,Mr.useBlockProps)({className:w("block-library-block__reusable-block-container",g&&b,{[`align${h}`]:h})}),k=(0,Mr.useInnerBlocksProps)(y,{layout:g,value:s,onInput:Dne,onChange:Dne,renderAppender:s?.length?void 0:Mr.InnerBlocks.ButtonBlockAppender}),_=()=>{m({postId:t,postType:"wp_block"})},x=()=>{r&&(u(),n({content:void 0}))},S=null;return c&&(S=(0,gr.jsx)(Mr.Warning,{children:(0,A2.__)("Block has been deleted or is unavailable.")})),l||(S=(0,gr.jsx)(_c.Placeholder,{children:(0,gr.jsx)(_c.Spinner,{})})),(0,gr.jsxs)(gr.Fragment,{children:[l&&!c&&(0,gr.jsx)(g4e,{recordId:t,canOverrideBlocks:f,hasContent:!!r,handleEditOriginal:m?_:void 0,resetContent:x}),S===null?(0,gr.jsx)("div",{...k}):(0,gr.jsx)("div",{...y,children:S})]})}var y4e=e=>typeof e=="object"&&!Array.isArray(e)&&e!==null,_4e={attributes:{ref:{type:"number"},content:{type:"object"}},supports:{customClassName:!1,html:!1,inserter:!1,renaming:!1},isEligible({content:e}){return!!e&&Object.keys(e).every(t=>e[t].values&&y4e(e[t].values))},migrate(e){let{content:t,...r}=e;if(t&&Object.keys(t).length){let a={...t};for(let n in t)a[n]=t[n].values;return{...r,content:a}}return e}},x4e={attributes:{ref:{type:"number"},overrides:{type:"object"}},supports:{customClassName:!1,html:!1,inserter:!1,renaming:!1},isEligible({overrides:e}){return!!e},migrate(e){let{overrides:t,...r}=e,a={};return Object.keys(t).forEach(n=>{a[n]=t[n]}),{...r,content:a}}},Rne=[_4e,x4e];var{name:Hne}=o6,One={deprecated:Rne,edit:Ane,icon:iB,__experimentalLabel:({ref:e})=>{if(!e)return;let t=(0,Vne.select)(zne.store).getEditedEntityRecord("postType","wp_block",e);if(t?.title)return(0,Fne.decodeEntities)(t.title)}},k4e=()=>E({name:Hne,metadata:o6,settings:One});var cM={};Z(cM,{init:()=>C4e,metadata:()=>a6,name:()=>Gne,settings:()=>Wne});var Une=o(P(),1);var a6={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/read-more",title:"Read More",category:"theme",description:"Displays the link of a post, page, or any other content-type.",textdomain:"default",attributes:{content:{type:"string",role:"content"},linkTarget:{type:"string",default:"_self"}},usesContext:["postId"],supports:{anchor:!0,html:!1,color:{gradients:!0,text:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalLetterSpacing:!0,__experimentalTextDecoration:!0,__experimentalDefaultControls:{fontSize:!0,textDecoration:!0}},spacing:{margin:["top","bottom"],padding:!0,__experimentalDefaultControls:{padding:!0}},__experimentalBorder:{color:!0,radius:!0,width:!0,__experimentalDefaultControls:{width:!0}},interactivity:{clientNavigation:!0}},style:"wp-block-read-more"};var Lg=o(T(),1),Mg=o(M(),1),n6=o(W(),1),Dg=o(P(),1);var xc=o(v(),1);function jne({attributes:{content:e,linkTarget:t},setAttributes:r,insertBlocksAfter:a}){let n=(0,Lg.useBlockProps)(),i=q();return(0,xc.jsxs)(xc.Fragment,{children:[(0,xc.jsx)(Lg.InspectorControls,{children:(0,xc.jsx)(Mg.__experimentalToolsPanel,{label:(0,Dg.__)("Settings"),resetAll:()=>r({linkTarget:"_self"}),dropdownMenuProps:i,children:(0,xc.jsx)(Mg.__experimentalToolsPanelItem,{label:(0,Dg.__)("Open in new tab"),isShownByDefault:!0,hasValue:()=>t!=="_self",onDeselect:()=>r({linkTarget:"_self"}),children:(0,xc.jsx)(Mg.ToggleControl,{label:(0,Dg.__)("Open in new tab"),onChange:l=>r({linkTarget:l?"_blank":"_self"}),checked:t==="_blank"})})})}),(0,xc.jsx)(Lg.RichText,{identifier:"content",tagName:"a","aria-label":(0,Dg.__)("\u201CRead more\u201D link text"),placeholder:(0,Dg.__)("Read more"),value:e,onChange:l=>r({content:l}),__unstableOnSplitAtEnd:()=>a((0,n6.createBlock)((0,n6.getDefaultBlockName)())),withoutInteractiveFormatting:!0,...n})]})}var{name:Gne}=a6,Wne={icon:ii,edit:jne,example:{attributes:{content:(0,Une.__)("Read more")}}},C4e=()=>E({name:Gne,metadata:a6,settings:Wne});var uM={};Z(uM,{init:()=>B4e,metadata:()=>i6,name:()=>Qne,settings:()=>Yne});var i6={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/rss",title:"RSS",category:"widgets",description:"Display entries from any RSS or Atom feed.",keywords:["atom","feed"],textdomain:"default",attributes:{columns:{type:"number",default:2},blockLayout:{type:"string",default:"list"},feedURL:{type:"string",default:"",role:"content"},itemsToShow:{type:"number",default:5},displayExcerpt:{type:"boolean",default:!1},displayAuthor:{type:"boolean",default:!1},displayDate:{type:"boolean",default:!1},excerptLength:{type:"number",default:55},openInNewTab:{type:"boolean",default:!1},rel:{type:"string"}},supports:{anchor:!0,align:!0,html:!1,interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0},spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{padding:!1,margin:!1}},color:{background:!0,text:!0,gradients:!0,link:!0}},editorStyle:"wp-block-rss-editor",style:"wp-block-rss"};var Jd=o(T(),1),gt=o(M(),1),l6=o(U(),1);var Nt=o(P(),1),$ne=o(mr(),1),qne=o(Fu(),1),Zne=o(me(),1);var rt=o(v(),1),T4e=1,P4e=20;function Kne({attributes:e,setAttributes:t,name:r}){let[a,n]=(0,l6.useState)(!e.feedURL),{blockLayout:i,columns:l,displayAuthor:s,displayDate:c,displayExcerpt:u,excerptLength:m,feedURL:p,itemsToShow:d,openInNewTab:f,rel:h}=e,g=q();function b(D){return()=>{let A=e[D];t({[D]:!A})}}function y(D){D.preventDefault(),p&&(t({feedURL:(0,$ne.prependHTTPS)(p)}),n(!1))}let{content:k,status:_,error:x}=(0,qne.useServerSideRender)({attributes:e,skipBlockSupportAttributes:!0,block:r}),S=(0,Zne.useDisabled)(),C=(0,Jd.useBlockProps)({ref:a?null:S}),N=(0,Nt.__)("RSS URL");if(a)return(0,rt.jsx)("div",{...C,children:(0,rt.jsx)(gt.Placeholder,{icon:i1,label:N,instructions:(0,Nt.__)("Display entries from any RSS or Atom feed."),children:(0,rt.jsxs)("form",{onSubmit:y,className:"wp-block-rss__placeholder-form",children:[(0,rt.jsx)(gt.__experimentalInputControl,{__next40pxDefaultSize:!0,label:N,type:"url",hideLabelFromVision:!0,placeholder:(0,Nt.__)("Enter URL here\u2026"),value:p,onChange:D=>t({feedURL:D}),className:"wp-block-rss__placeholder-input"}),(0,rt.jsx)(gt.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",children:(0,Nt.__)("Apply")})]})})});let B=[{icon:Pp,title:(0,Nt.__)("Edit RSS URL"),onClick:()=>n(!0)},{icon:Nl,title:(0,Nt._x)("List view","RSS block display setting"),onClick:()=>t({blockLayout:"list"}),isActive:i==="list"},{icon:Il,title:(0,Nt._x)("Grid view","RSS block display setting"),onClick:()=>t({blockLayout:"grid"}),isActive:i==="grid"}];return(0,rt.jsxs)(rt.Fragment,{children:[(0,rt.jsx)(Jd.BlockControls,{children:(0,rt.jsx)(gt.ToolbarGroup,{controls:B})}),(0,rt.jsx)(Jd.InspectorControls,{children:(0,rt.jsxs)(gt.__experimentalToolsPanel,{label:(0,Nt.__)("Settings"),resetAll:()=>{t({itemsToShow:5,displayAuthor:!1,displayDate:!1,displayExcerpt:!1,excerptLength:55,columns:2,openInNewTab:!1})},dropdownMenuProps:g,children:[(0,rt.jsx)(gt.__experimentalToolsPanelItem,{label:(0,Nt.__)("Number of items"),hasValue:()=>d!==5,onDeselect:()=>t({itemsToShow:5}),isShownByDefault:!0,children:(0,rt.jsx)(gt.RangeControl,{__next40pxDefaultSize:!0,label:(0,Nt.__)("Number of items"),value:d,onChange:D=>t({itemsToShow:D}),min:T4e,max:P4e,required:!0})}),(0,rt.jsx)(gt.__experimentalToolsPanelItem,{label:(0,Nt.__)("Display author"),hasValue:()=>!!s,onDeselect:()=>t({displayAuthor:!1}),isShownByDefault:!0,children:(0,rt.jsx)(gt.ToggleControl,{label:(0,Nt.__)("Display author"),checked:s,onChange:b("displayAuthor")})}),(0,rt.jsx)(gt.__experimentalToolsPanelItem,{label:(0,Nt.__)("Display date"),hasValue:()=>!!c,onDeselect:()=>t({displayDate:!1}),isShownByDefault:!0,children:(0,rt.jsx)(gt.ToggleControl,{label:(0,Nt.__)("Display date"),checked:c,onChange:b("displayDate")})}),(0,rt.jsx)(gt.__experimentalToolsPanelItem,{label:(0,Nt.__)("Display excerpt"),hasValue:()=>!!u,onDeselect:()=>t({displayExcerpt:!1}),isShownByDefault:!0,children:(0,rt.jsx)(gt.ToggleControl,{label:(0,Nt.__)("Display excerpt"),checked:u,onChange:b("displayExcerpt")})}),u&&(0,rt.jsx)(gt.__experimentalToolsPanelItem,{label:(0,Nt.__)("Max number of words in excerpt"),hasValue:()=>m!==55,onDeselect:()=>t({excerptLength:55}),isShownByDefault:!0,children:(0,rt.jsx)(gt.RangeControl,{__next40pxDefaultSize:!0,label:(0,Nt.__)("Max number of words in excerpt"),value:m,onChange:D=>t({excerptLength:D}),min:10,max:100,required:!0})}),i==="grid"&&(0,rt.jsx)(gt.__experimentalToolsPanelItem,{label:(0,Nt.__)("Columns"),hasValue:()=>l!==2,onDeselect:()=>t({columns:2}),isShownByDefault:!0,children:(0,rt.jsx)(gt.RangeControl,{__next40pxDefaultSize:!0,label:(0,Nt.__)("Columns"),value:l,onChange:D=>t({columns:D}),min:2,max:6,required:!0})}),(0,rt.jsx)(gt.__experimentalToolsPanelItem,{label:(0,Nt.__)("Open links in new tab"),hasValue:()=>!!f,onDeselect:()=>t({openInNewTab:!1}),isShownByDefault:!0,children:(0,rt.jsx)(gt.ToggleControl,{label:(0,Nt.__)("Open links in new tab"),checked:f,onChange:D=>t({openInNewTab:D})})})]})}),(0,rt.jsx)(Jd.InspectorControls,{group:"advanced",children:(0,rt.jsx)(gt.TextControl,{__next40pxDefaultSize:!0,label:(0,Nt.__)("Link relation"),help:(0,l6.createInterpolateElement)((0,Nt.__)("The <a>Link Relation</a> attribute defines the relationship between a linked resource and the current document."),{a:(0,rt.jsx)(gt.ExternalLink,{href:"https://developer.mozilla.org/docs/Web/HTML/Attributes/rel"})}),value:h||"",onChange:D=>t({rel:D})})}),_==="loading"&&(0,rt.jsx)("div",{...C,children:(0,rt.jsx)(gt.Spinner,{})}),_==="error"&&(0,rt.jsx)("div",{...C,children:(0,rt.jsx)("p",{children:(0,Nt.sprintf)((0,Nt.__)("Error: %s"),x)})}),_==="success"&&(0,rt.jsx)(uo,{wrapperProps:C,html:k})]})}var{name:Qne}=i6,Yne={icon:i1,example:{attributes:{feedURL:"https://wordpress.org"}},edit:Kne},B4e=()=>E({name:Qne,metadata:i6,settings:Yne});var gM={};Z(gM,{init:()=>L4e,metadata:()=>s6,name:()=>nie,settings:()=>u6});var Ag=o(P(),1);var aie=o(W(),1);var s6={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/search",title:"Search",category:"widgets",description:"Help visitors find your content.",keywords:["find"],textdomain:"default",attributes:{label:{type:"string",role:"content"},showLabel:{type:"boolean",default:!0},placeholder:{type:"string",default:"",role:"content"},width:{type:"number"},widthUnit:{type:"string"},buttonText:{type:"string",role:"content"},buttonPosition:{type:"string",default:"button-outside"},buttonUseIcon:{type:"boolean",default:!1},query:{type:"object",default:{}},isSearchFieldHidden:{type:"boolean",default:!1}},supports:{anchor:!0,align:["left","center","right"],color:{gradients:!0,__experimentalSkipSerialization:!0,__experimentalDefaultControls:{background:!0,text:!0}},interactivity:!0,typography:{__experimentalSkipSerialization:!0,__experimentalSelector:".wp-block-search__label, .wp-block-search__input, .wp-block-search__button",fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalBorder:{color:!0,radius:!0,width:!0,__experimentalSkipSerialization:!0,__experimentalDefaultControls:{color:!0,radius:!0,width:!0}},spacing:{margin:!0},html:!1},editorStyle:"wp-block-search-editor",style:"wp-block-search"};var ao=o(T(),1),c6=o(V(),1),ef=o(U(),1),cr=o(M(),1),eie=o(me(),1);var sr=o(P(),1),tie=o(ai(),1);var mM=50,pM=350,dM=220;function fM(e){return e==="%"}var Et=o(v(),1),Xne="4px",Jne=[25,50,75,100];function rie({className:e,attributes:t,setAttributes:r,toggleSelection:a,isSelected:n,clientId:i}){let{label:l,showLabel:s,placeholder:c,width:u,widthUnit:m,align:p,buttonText:d,buttonPosition:f,buttonUseIcon:h,isSearchFieldHidden:g,style:b}=t,y=(0,c6.useSelect)(ae=>{let{getBlockParentsByBlockName:Re,wasBlockJustInserted:Ee}=ae(ao.store);return!!Re(i,"core/navigation")?.length&&Ee(i)},[i]),{__unstableMarkNextChangeAsNotPersistent:k}=(0,c6.useDispatch)(ao.store);(0,ef.useEffect)(()=>{y&&(k(),r({showLabel:!1,buttonUseIcon:!0,buttonPosition:"button-inside"}))},[k,y,r]);let _=b?.border?.radius,x=(0,ao.__experimentalUseBorderProps)(t);typeof _=="number"&&(x={...x,style:{...x.style,borderRadius:`${_}px`}});let S=(0,ao.__experimentalUseColorProps)(t),[C,N]=(0,ao.useSettings)("typography.fluid","layout"),B=(0,ao.getTypographyClassesAndStyles)(t,{typography:{fluid:C},layout:{wideSize:N?.wideSize}}),A=`wp-block-search__width-${(0,eie.useInstanceId)(cr.__experimentalUnitControl)}`,H=f==="button-inside",F=f==="button-outside",z=f==="no-button",I=f==="button-only",R=(0,ef.useRef)(),$=(0,ef.useRef)(),j=(0,cr.__experimentalUseCustomUnits)({availableUnits:["%","px"],defaultValues:{"%":mM,px:pM}});(0,ef.useEffect)(()=>{I&&!n&&r({isSearchFieldHidden:!0})},[I,n,r]),(0,ef.useEffect)(()=>{!I||!n||r({isSearchFieldHidden:!1})},[I,n,r,u]);let G=()=>w(e,H?"wp-block-search__button-inside":void 0,F?"wp-block-search__button-outside":void 0,z?"wp-block-search__no-button":void 0,I?"wp-block-search__button-only":void 0,!h&&!z?"wp-block-search__text-button":void 0,h&&!z?"wp-block-search__icon-button":void 0,I&&g?"wp-block-search__searchfield-hidden":void 0),O=[{label:(0,sr.__)("Button outside"),value:"button-outside"},{label:(0,sr.__)("Button inside"),value:"button-inside"},{label:(0,sr.__)("No button"),value:"no-button"},{label:(0,sr.__)("Button only"),value:"button-only"}],J=()=>I?{}:{right:p!=="right",left:p==="right"},ee=()=>{let ae=w("wp-block-search__input",H?void 0:x.className,B.className),Re={...H?{borderRadius:x.style?.borderRadius,borderTopLeftRadius:x.style?.borderTopLeftRadius,borderTopRightRadius:x.style?.borderTopRightRadius,borderBottomLeftRadius:x.style?.borderBottomLeftRadius,borderBottomRightRadius:x.style?.borderBottomRightRadius}:x.style,...B.style,textDecoration:void 0};return(0,Et.jsx)("input",{type:"search",className:ae,style:Re,"aria-label":(0,sr.__)("Optional placeholder text"),placeholder:c?void 0:(0,sr.__)("Optional placeholder\u2026"),value:c,onChange:Ee=>r({placeholder:Ee.target.value}),ref:R})},oe=()=>{let ae=w("wp-block-search__button",S.className,B.className,H?void 0:x.className,h?"has-icon":void 0,(0,ao.__experimentalGetElementClassName)("button")),Re={...S.style,...B.style,...H?{borderRadius:x.style?.borderRadius,borderTopLeftRadius:x.style?.borderTopLeftRadius,borderTopRightRadius:x.style?.borderTopRightRadius,borderBottomLeftRadius:x.style?.borderBottomLeftRadius,borderBottomRightRadius:x.style?.borderBottomRightRadius}:x.style},Ee=()=>{I&&r({isSearchFieldHidden:!g})};return(0,Et.jsxs)(Et.Fragment,{children:[h&&(0,Et.jsx)("button",{type:"button",className:ae,style:Re,"aria-label":d?(0,tie.__unstableStripHTML)(d):(0,sr.__)("Search"),onClick:Ee,ref:$,children:(0,Et.jsx)(Wa,{icon:l1})}),!h&&(0,Et.jsx)(ao.RichText,{identifier:"buttonText",className:ae,style:Re,"aria-label":(0,sr.__)("Button text"),placeholder:(0,sr.__)("Add button text\u2026"),withoutInteractiveFormatting:!0,value:d,onChange:ie=>r({buttonText:ie}),onClick:Ee})]})},X=q(),te=(0,Et.jsx)(Et.Fragment,{children:(0,Et.jsx)(ao.InspectorControls,{children:(0,Et.jsxs)(cr.__experimentalToolsPanel,{label:(0,sr.__)("Settings"),resetAll:()=>{r({width:void 0,widthUnit:void 0,showLabel:!0,buttonUseIcon:!1,buttonPosition:"button-outside",isSearchFieldHidden:!1})},dropdownMenuProps:X,children:[(0,Et.jsx)(cr.__experimentalToolsPanelItem,{hasValue:()=>!s,label:(0,sr.__)("Show label"),onDeselect:()=>{r({showLabel:!0})},isShownByDefault:!0,children:(0,Et.jsx)(cr.ToggleControl,{checked:s,label:(0,sr.__)("Show label"),onChange:ae=>r({showLabel:ae})})}),(0,Et.jsx)(cr.__experimentalToolsPanelItem,{hasValue:()=>f!=="button-outside",label:(0,sr.__)("Button position"),onDeselect:()=>{r({buttonPosition:"button-outside",isSearchFieldHidden:!1})},isShownByDefault:!0,children:(0,Et.jsx)(cr.SelectControl,{value:f,__next40pxDefaultSize:!0,label:(0,sr.__)("Button position"),onChange:ae=>{r({buttonPosition:ae,isSearchFieldHidden:ae==="button-only"})},options:O})}),f!=="no-button"&&(0,Et.jsx)(cr.__experimentalToolsPanelItem,{hasValue:()=>!!h,label:(0,sr.__)("Use button with icon"),onDeselect:()=>{r({buttonUseIcon:!1})},isShownByDefault:!0,children:(0,Et.jsx)(cr.ToggleControl,{checked:h,label:(0,sr.__)("Use button with icon"),onChange:ae=>r({buttonUseIcon:ae})})}),(0,Et.jsx)(cr.__experimentalToolsPanelItem,{hasValue:()=>!!u,label:(0,sr.__)("Width"),onDeselect:()=>{r({width:void 0,widthUnit:void 0})},isShownByDefault:!0,children:(0,Et.jsxs)(cr.__experimentalVStack,{children:[(0,Et.jsx)(cr.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:(0,sr.__)("Width"),id:A,min:fM(m)?0:dM,max:fM(m)?100:void 0,step:1,onChange:ae=>{let Re=ae===""?void 0:parseInt(ae,10);r({width:Re})},onUnitChange:ae=>{r({width:ae==="%"?mM:pM,widthUnit:ae})},__unstableInputWidth:"80px",value:`${u}${m}`,units:j}),(0,Et.jsx)(cr.__experimentalToggleGroupControl,{label:(0,sr.__)("Percentage Width"),value:Jne.includes(u)&&m==="%"?u:void 0,hideLabelFromVision:!0,onChange:ae=>{r({width:ae,widthUnit:"%"})},isBlock:!0,__next40pxDefaultSize:!0,children:Jne.map(ae=>(0,Et.jsx)(cr.__experimentalToggleGroupControlOption,{value:ae,label:(0,sr.sprintf)((0,sr.__)("%d%%"),ae)},ae))})]})})]})})}),ne=ae=>ae!==void 0&&parseInt(ae,10)!==0,le=ae=>ne(ae)?`calc(${ae} + ${Xne})`:void 0,pe=()=>{let ae=H?x.style:{borderRadius:x.style?.borderRadius,borderTopLeftRadius:x.style?.borderTopLeftRadius,borderTopRightRadius:x.style?.borderTopRightRadius,borderBottomLeftRadius:x.style?.borderBottomLeftRadius,borderBottomRightRadius:x.style?.borderBottomRightRadius};if(H){if(typeof _=="object"){let{borderTopLeftRadius:Ee,borderTopRightRadius:ie,borderBottomLeftRadius:fe,borderBottomRightRadius:ke}=x.style;return{...ae,borderTopLeftRadius:le(Ee),borderTopRightRadius:le(ie),borderBottomLeftRadius:le(fe),borderBottomRightRadius:le(ke)}}let Re=Number.isInteger(_)?`${_}px`:_;ae.borderRadius=`calc(${Re} + ${Xne})`}return ae},Ie=(0,ao.useBlockProps)({className:G(),style:{...B.style,textDecoration:void 0}}),Ne=w("wp-block-search__label",B.className);return(0,Et.jsxs)("div",{...Ie,children:[te,s&&(0,Et.jsx)(ao.RichText,{identifier:"label",className:Ne,"aria-label":(0,sr.__)("Label text"),placeholder:(0,sr.__)("Add label\u2026"),withoutInteractiveFormatting:!0,value:l,onChange:ae=>r({label:ae}),style:B.style}),(0,Et.jsxs)(cr.ResizableBox,{size:{width:u===void 0?"auto":`${u}${m}`,height:"auto"},className:w("wp-block-search__inside-wrapper",H?x.className:void 0),style:pe(),minWidth:dM,enable:J(),onResizeStart:(ae,Re,Ee)=>{r({width:parseInt(Ee.offsetWidth,10),widthUnit:"px"}),a(!1)},onResizeStop:(ae,Re,Ee,ie)=>{r({width:parseInt(u+ie.width,10)}),a(!0)},showHandle:n,children:[(H||F||I)&&(0,Et.jsxs)(Et.Fragment,{children:[ee(),oe()]}),z&&ee()]})]})}var hM=o(P(),1),N4e=[{name:"default",isDefault:!0,attributes:{buttonText:(0,hM.__)("Search"),label:(0,hM.__)("Search")}}],oie=N4e;var{fieldsKey:E4e,formKey:D4e}=K(aie.privateApis),{name:nie}=s6,u6={icon:l1,example:{attributes:{buttonText:(0,Ag.__)("Search"),label:(0,Ag.__)("Search")},viewportWidth:400},variations:oie,edit:rie};window.__experimentalContentOnlyInspectorFields&&(u6[E4e]=[{id:"label",label:(0,Ag.__)("Label"),type:"text",Edit:"rich-text"},{id:"buttonText",label:(0,Ag.__)("Button text"),type:"text",Edit:"rich-text"},{id:"placeholder",label:(0,Ag.__)("Placeholder"),type:"text",Edit:"rich-text"}],u6[D4e]={fields:["label","buttonText","placeholder"]});var L4e=()=>E({name:nie,metadata:s6,settings:u6});var vM={};Z(vM,{init:()=>V4e,metadata:()=>p6,name:()=>fie,settings:()=>hie});var $m=o(T(),1),m6=o(M(),1),F2=o(P(),1);var V2=o(U(),1),iie=o(me(),1);function lie(e,t,r){let[a,n]=(0,V2.useState)(!1),i=(0,iie.usePrevious)(t);(0,V2.useEffect)(()=>{e==="css"&&!t&&!i&&n(!0)},[t,i,e]),(0,V2.useEffect)(()=>{e==="css"&&(a&&t||i&&t!==i)&&(r({opacity:"alpha-channel"}),n(!1))},[a,t,i])}var Iu=o(v(),1),M4e=({tagName:e,setAttributes:t})=>(0,Iu.jsx)(m6.SelectControl,{label:(0,F2.__)("HTML element"),value:e,onChange:r=>t({tagName:r}),options:[{label:(0,F2.__)("Default (<hr>)"),value:"hr"},{label:"<div>",value:"div"}],help:e==="hr"?(0,F2.__)("Only select <hr> if the separator conveys important information and should be announced by screen readers."):(0,F2.__)("The <div> element should only be used if the block is a design element with no semantic meaning."),__next40pxDefaultSize:!0});function sie({attributes:e,setAttributes:t}){let{backgroundColor:r,opacity:a,style:n,tagName:i}=e,l=(0,$m.__experimentalUseColorProps)(e),s=l?.style?.backgroundColor,c=!!n?.color?.background;lie(a,s,t);let u=(0,$m.getColorClassName)("color",r),m=w({"has-text-color":r||s,[u]:u,"has-css-opacity":a==="css","has-alpha-channel-opacity":a==="alpha-channel"},l.className);return(0,Iu.jsxs)(Iu.Fragment,{children:[(0,Iu.jsx)($m.InspectorControls,{group:"advanced",children:(0,Iu.jsx)(M4e,{tagName:i,setAttributes:t})}),(0,Iu.jsx)(i==="hr"?m6.HorizontalRule:i,{...(0,$m.useBlockProps)({className:m,style:c?{color:s,backgroundColor:s}:void 0})})]})}var p6={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/separator",title:"Separator",category:"design",description:"Create a break between ideas or sections with a horizontal separator.",keywords:["horizontal-line","hr","divider"],textdomain:"default",attributes:{opacity:{type:"string",default:"alpha-channel"},tagName:{type:"string",enum:["hr","div"],default:"hr"}},supports:{anchor:!0,align:["center","wide","full"],color:{enableContrastChecker:!1,__experimentalSkipSerialization:!0,gradients:!0,background:!0,text:!1,__experimentalDefaultControls:{background:!0}},spacing:{margin:["top","bottom"]},interactivity:{clientNavigation:!0}},styles:[{name:"default",label:"Default",isDefault:!0},{name:"wide",label:"Wide Line"},{name:"dots",label:"Dots"}],editorStyle:"wp-block-separator-editor",style:"wp-block-separator"};var Rg=o(T(),1),cie=o(v(),1);function uie({attributes:e}){let{backgroundColor:t,style:r,opacity:a,tagName:n}=e,i=r?.color?.background,l=(0,Rg.__experimentalGetColorClassesAndStyles)(e),s=(0,Rg.getColorClassName)("color",t),c=w({"has-text-color":t||i,[s]:s,"has-css-opacity":a==="css","has-alpha-channel-opacity":a==="alpha-channel"},l.className),u={backgroundColor:l?.style?.backgroundColor,color:s?void 0:i};return(0,cie.jsx)(n,{...Rg.useBlockProps.save({className:c,style:u})})}var zg=o(W(),1),R4e={from:[{type:"input",regExp:/^-{3,}$/,transform:()=>[(0,zg.createBlock)("core/separator"),(0,zg.createBlock)((0,zg.getDefaultBlockName)())]},{type:"raw",selector:"hr",schema:{hr:{}}}],to:[{type:"block",blocks:["core/spacer"],transform:({anchor:e})=>(0,zg.createBlock)("core/spacer",{anchor:e||void 0})}]},mie=R4e;var H2=o(T(),1),pie=o(v(),1),z4e={attributes:{color:{type:"string"},customColor:{type:"string"}},save({attributes:e}){let{color:t,customColor:r}=e,a=(0,H2.getColorClassName)("background-color",t),n=(0,H2.getColorClassName)("color",t),i=w({"has-text-color has-background":t||r,[a]:a,[n]:n}),l={backgroundColor:a?void 0:r,color:n?void 0:r};return(0,pie.jsx)("hr",{...H2.useBlockProps.save({className:i,style:l})})},migrate(e){let{color:t,customColor:r,...a}=e;return{...a,backgroundColor:t||void 0,opacity:"css",style:r?{color:{background:r}}:void 0,tagName:"hr"}}},die=[z4e];var{name:fie}=p6,hie={icon:qP,example:{attributes:{customColor:"#065174",className:"is-style-wide"}},transforms:mie,edit:sie,save:uie,deprecated:die},V4e=()=>E({name:fie,metadata:p6,settings:hie});var yM={};Z(yM,{init:()=>O4e,metadata:()=>v6,name:()=>Cie,settings:()=>Sie});var d6=o(P(),1),h6=o(T(),1),gie=o(me(),1),vie=o(M(),1);var f6=o(v(),1);function bM({attributes:e,setAttributes:t}){let a=`blocks-shortcode-input-${(0,gie.useInstanceId)(bM)}`;return(0,f6.jsx)("div",{...(0,h6.useBlockProps)(),children:(0,f6.jsx)(vie.Placeholder,{icon:c1,label:(0,d6.__)("Shortcode"),children:(0,f6.jsx)(h6.PlainText,{className:"blocks-shortcode__textarea",id:a,value:e.text,"aria-label":(0,d6.__)("Shortcode text"),placeholder:(0,d6.__)("Write shortcode here\u2026"),onChange:n=>t({text:n})})})})}var bie=o(U(),1),yie=o(v(),1);function _ie({attributes:e}){return(0,yie.jsx)(bie.RawHTML,{children:e.text})}var g6=o(kie(),1),F4e={from:[{type:"shortcode",tag:"[a-z][a-z0-9_-]*",attributes:{text:{type:"string",shortcode:(e,{content:t})=>(0,g6.removep)((0,g6.autop)(t))}},priority:20}]},wie=F4e;var v6={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/shortcode",title:"Shortcode",category:"widgets",description:"Insert additional custom elements with a WordPress shortcode.",textdomain:"default",attributes:{text:{type:"string",source:"raw",role:"content"}},supports:{className:!1,customClassName:!1,html:!1,customCSS:!1,visibility:!1},editorStyle:"wp-block-shortcode-editor"};var{name:Cie}=v6,Sie={icon:c1,transforms:wie,edit:bM,save:_ie},O4e=()=>E({name:Cie,metadata:v6,settings:Sie});var xM={};Z(xM,{init:()=>W4e,metadata:()=>b6,name:()=>Eie,settings:()=>Die});var b6={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/site-logo",title:"Site Logo",category:"theme",description:"Display an image to represent this site. Update this block and the changes apply everywhere.",textdomain:"default",attributes:{width:{type:"number"},isLink:{type:"boolean",default:!0,role:"content"},linkTarget:{type:"string",default:"_self",role:"content"},shouldSyncIcon:{type:"boolean"}},example:{viewportWidth:500,attributes:{width:350,className:"block-editor-block-types-list__site-logo-example"}},supports:{anchor:!0,html:!1,align:!0,alignWide:!1,color:{text:!1,background:!1},spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},interactivity:{clientNavigation:!0},filter:{duotone:!0}},styles:[{name:"default",label:"Default",isDefault:!0},{name:"rounded",label:"Rounded"}],selectors:{filter:{duotone:".wp-block-site-logo img, .wp-block-site-logo .components-placeholder__illustration, .wp-block-site-logo .components-placeholder::before"}},editorStyle:"wp-block-site-logo-editor",style:"wp-block-site-logo"};var _M=o(Rr(),1),kc=o(U(),1),no=o(P(),1),Tt=o(M(),1),Tie=o(me(),1),io=o(T(),1),qm=o(V(),1),Vg=o(Q(),1);var Pie=o(xr(),1);var Ae=o(v(),1),y6=["image"],U4e=({alt:e,attributes:{align:t,width:r,height:a,isLink:n,linkTarget:i,shouldSyncIcon:l},isSelected:s,setAttributes:c,setLogo:u,logoUrl:m,siteUrl:p,logoId:d,iconId:f,setIcon:h,canUserEdit:g})=>{let b=(0,Tie.useViewportMatch)("medium"),k=!["wide","full"].includes(t)&&b,[{naturalWidth:_,naturalHeight:x},S]=(0,kc.useState)({}),[C,N]=(0,kc.useState)(!1),{toggleSelection:B}=(0,qm.useDispatch)(io.store),D=q(),H=(0,io.useBlockEditingMode)()==="contentOnly",{imageEditing:F,maxWidth:z,title:I}=(0,qm.useSelect)(fe=>{let ke=fe(io.store).getSettings();return{title:fe(Vg.store).getEntityRecord("root","__unstableBase")?.name,imageEditing:ke.imageEditing,maxWidth:ke.maxWidth}},[]);(0,kc.useEffect)(()=>{l&&d!==f&&c({shouldSyncIcon:!1})},[]),(0,kc.useEffect)(()=>{s||N(!1)},[s]);function R(){B(!1)}function $(){B(!0)}let j=(0,Ae.jsxs)(Ae.Fragment,{children:[(0,Ae.jsx)("img",{className:"custom-logo",src:m,alt:e,onLoad:fe=>{S({naturalWidth:fe.target.naturalWidth,naturalHeight:fe.target.naturalHeight})}}),(0,_M.isBlobURL)(m)&&(0,Ae.jsx)(Tt.Spinner,{})]}),G=j;if(n&&(G=(0,Ae.jsx)("a",{href:p,className:"custom-logo-link",rel:"home",title:I,onClick:fe=>fe.preventDefault(),children:j})),!k||!_||!x)return(0,Ae.jsx)("div",{style:{width:r,height:a},children:G});let O=120,J=r||O,ee=_/x,oe=J/ee,X=_<x?Zs:Math.ceil(Zs*ee),te=x<_?Zs:Math.ceil(Zs/ee),ne=z*2.5,le=!1,pe=!1;t==="center"?(le=!0,pe=!0):(0,no.isRTL)()?t==="left"?le=!0:pe=!0:t==="right"?pe=!0:le=!0;let Ie=d&&_&&x&&F,Ne=!H,ae;Ie&&C?ae=(0,Ae.jsx)(io.__experimentalImageEditor,{id:d,url:m,width:J,height:oe,naturalHeight:x,naturalWidth:_,onSaveImage:fe=>{u(fe.id)},onFinishEditing:()=>{N(!1)}}):ae=(0,Ae.jsx)(Tt.ResizableBox,{size:{width:J,height:oe},showHandle:s&&Ne,minWidth:X,maxWidth:ne,minHeight:te,maxHeight:ne/ee,lockAspectRatio:!0,enable:{top:!1,right:le,bottom:!0,left:pe},onResizeStart:R,onResizeStop:(fe,ke,je,de)=>{$(),c({width:parseInt(J+de.width,10),height:parseInt(oe+de.height,10)})},children:G});let Ee=!window?.__experimentalUseCustomizerSiteLogoUrl?p+"/wp-admin/options-general.php":p+"/wp-admin/customize.php?autofocus[section]=title_tagline",ie=(0,kc.createInterpolateElement)((0,no.__)("Site Icons are what you see in browser tabs, bookmark bars, and within the WordPress mobile apps. To use a custom icon that is different from your site logo, use the <a>Site Icon settings</a>."),{a:(0,Ae.jsx)("a",{href:Ee,target:"_blank",rel:"noopener noreferrer"})});return(0,Ae.jsxs)(Ae.Fragment,{children:[(0,Ae.jsx)(io.InspectorControls,{children:(0,Ae.jsxs)(Tt.__experimentalToolsPanel,{label:(0,no.__)("Settings"),dropdownMenuProps:D,children:[(0,Ae.jsx)(Tt.__experimentalToolsPanelItem,{isShownByDefault:!0,hasValue:()=>!!r,label:(0,no.__)("Image width"),onDeselect:()=>c({width:void 0}),children:(0,Ae.jsx)(Tt.RangeControl,{__next40pxDefaultSize:!0,label:(0,no.__)("Image width"),onChange:fe=>c({width:fe}),min:X,max:ne,initialPosition:Math.min(O,ne),value:r||"",disabled:!k})}),(0,Ae.jsx)(Tt.__experimentalToolsPanelItem,{isShownByDefault:!0,hasValue:()=>!n,label:(0,no.__)("Link image to home"),onDeselect:()=>c({isLink:!0}),children:(0,Ae.jsx)(Tt.ToggleControl,{label:(0,no.__)("Link image to home"),onChange:()=>c({isLink:!n}),checked:n})}),n&&(0,Ae.jsx)(Tt.__experimentalToolsPanelItem,{isShownByDefault:!0,hasValue:()=>i==="_blank",label:(0,no.__)("Open in new tab"),onDeselect:()=>c({linkTarget:"_self"}),children:(0,Ae.jsx)(Tt.ToggleControl,{label:(0,no.__)("Open in new tab"),onChange:fe=>c({linkTarget:fe?"_blank":"_self"}),checked:i==="_blank"})}),g&&(0,Ae.jsx)(Tt.__experimentalToolsPanelItem,{isShownByDefault:!0,hasValue:()=>!!l,label:(0,no.__)("Use as Site Icon"),onDeselect:()=>{c({shouldSyncIcon:!1}),h(void 0)},children:(0,Ae.jsx)(Tt.ToggleControl,{label:(0,no.__)("Use as Site Icon"),onChange:fe=>{c({shouldSyncIcon:fe}),h(fe?d:void 0)},checked:!!l,help:ie})})]})}),Ie&&!C&&Ne&&(0,Ae.jsx)(io.BlockControls,{group:"block",children:(0,Ae.jsx)(Tt.ToolbarButton,{onClick:()=>N(!0),icon:D0,label:(0,no.__)("Crop")})}),ae]})};function Bie({attributes:e,className:t,setAttributes:r,isSelected:a}){let{width:n,shouldSyncIcon:i}=e,{siteLogoId:l,canUserEdit:s,url:c,siteIconId:u,mediaItemData:m,isRequestingMediaItem:p}=(0,qm.useSelect)(O=>{let{canUser:J,getEntityRecord:ee,getEditedEntityRecord:oe}=O(Vg.store),X=J("update",{kind:"root",name:"site"}),te=X?oe("root","site"):void 0,ne=ee("root","__unstableBase"),le=X?te?.site_logo:ne?.site_logo,pe=te?.site_icon,Ie=le&&O(Vg.store).getEntityRecord("postType","attachment",le,{context:"view"}),Ne=!!le&&!O(Vg.store).hasFinishedResolution("getEntityRecord",["postType","attachment",le,{context:"view"}]);return{siteLogoId:le,canUserEdit:X,url:ne?.home,mediaItemData:Ie,isRequestingMediaItem:Ne,siteIconId:pe}},[]),{getSettings:d}=(0,qm.useSelect)(io.store),[f,h]=(0,kc.useState)(),g=q(),{editEntityRecord:b}=(0,qm.useDispatch)(Vg.store),y=(O,J=!1)=>{(i||J)&&k(O),b("root","site",void 0,{site_logo:O})},k=O=>b("root","site",void 0,{site_icon:O??null}),{alt_text:_,source_url:x}=m??{},S=O=>{if(i===void 0){let J=!u;r({shouldSyncIcon:J}),C(O,J);return}C(O)},C=(O,J=!1)=>{if(O){if(!O.id&&O.url){h(O.url),y(void 0);return}y(O.id,J)}},N=()=>{y(null),r({width:void 0})},{createErrorNotice:B}=(0,qm.useDispatch)(Pie.store),D=O=>{B(O,{type:"snackbar"}),h()},A=O=>{d().mediaUpload({allowedTypes:y6,filesList:O,onFileChange([J]){if((0,_M.isBlobURL)(J?.url)){h(J.url);return}S(J)},onError:D,multiple:!1})},H={mediaURL:x,name:x?(0,no.__)("Replace"):(0,no.__)("Choose logo"),onSelect:C,onError:D,onReset:N},F=s&&(0,Ae.jsx)(io.BlockControls,{group:"other",children:(0,Ae.jsx)(io.MediaReplaceFlow,{...H,allowedTypes:y6,variant:"toolbar"})}),z,I=l===void 0||p;I&&(z=(0,Ae.jsx)(Tt.Spinner,{})),(0,kc.useEffect)(()=>{x&&f&&h()},[x,f]),(x||f)&&(z=(0,Ae.jsxs)(Ae.Fragment,{children:[(0,Ae.jsx)(U4e,{alt:_,attributes:e,className:t,isSelected:a,setAttributes:r,logoUrl:f||x,setLogo:y,logoId:m?.id||l,siteUrl:c,setIcon:k,iconId:u,canUserEdit:s}),s&&(0,Ae.jsx)(Tt.DropZone,{onFilesDrop:A})]}));let R=O=>{let J=w("block-editor-media-placeholder",t);return(0,Ae.jsx)(Tt.Placeholder,{className:J,preview:z,withIllustration:!0,style:{width:n},children:O})},$=w(t,{"is-default-size":!n,"is-transient":f}),j=(0,io.useBlockProps)({className:$}),G=(s||x)&&(0,Ae.jsx)(io.InspectorControls,{children:(0,Ae.jsx)(Tt.__experimentalToolsPanel,{label:(0,no.__)("Media"),dropdownMenuProps:g,children:s?(0,Ae.jsx)(Tt.__experimentalToolsPanelItem,{hasValue:()=>!!x,label:(0,no.__)("Logo"),isShownByDefault:!0,children:(0,Ae.jsx)(f4,{mediaId:l,mediaUrl:x,alt:m?.alt_text,filename:m?.media_details?.sizes?.full?.file||m?.slug,allowedTypes:y6,onSelect:C,onError:D,onReset:N,isUploading:!!f,emptyLabel:(0,no.__)("Choose logo")})}):(0,Ae.jsx)("div",{className:"block-library-site-logo__inspector-media-replace-container",style:{gridColumn:"1 / -1"},children:(0,Ae.jsx)(dE,{url:m?.source_url,alt:m?.alt_text,filename:m?.media_details?.sizes?.full?.file||m?.slug,itemGroupProps:{isBordered:!0,className:"block-library-site-logo__inspector-readonly-logo-preview"},className:"block-library-site-logo__inspector-media-replace-title"})})})});return(0,Ae.jsxs)("div",{...j,children:[F,G,(!!x||!!f)&&z,(I||!f&&!x&&!s)&&(0,Ae.jsx)(Tt.Placeholder,{className:"site-logo_placeholder",withIllustration:!0,children:I&&(0,Ae.jsx)("span",{className:"components-placeholder__preview",children:(0,Ae.jsx)(Tt.Spinner,{})})}),!I&&!f&&!x&&s&&(0,Ae.jsx)(io.MediaPlaceholder,{onSelect:S,allowedTypes:y6,onError:D,placeholder:R,mediaLibraryButton:({open:O})=>(0,Ae.jsx)(Tt.Button,{__next40pxDefaultSize:!0,icon:Hc,variant:"primary",label:(0,no.__)("Choose logo"),showTooltip:!0,tooltipPosition:"middle right",onClick:()=>{O()}})})]})}var Iie=o(W(),1),G4e={to:[{type:"block",blocks:["core/site-title"],transform:({isLink:e,linkTarget:t})=>(0,Iie.createBlock)("core/site-title",{isLink:e,linkTarget:t})}]},Nie=G4e;var{name:Eie}=b6,Die={icon:JP,example:{},edit:Bie,transforms:Nie},W4e=()=>E({name:Eie,metadata:b6,settings:Die});var CM={};Z(CM,{init:()=>Z4e,metadata:()=>_6,name:()=>Rie,settings:()=>zie});var _6={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/site-tagline",title:"Site Tagline",category:"theme",description:"Describe in a few words what this site is about. This is important for search results, sharing on social media, and gives overall clarity to visitors.",keywords:["description"],textdomain:"default",attributes:{textAlign:{type:"string"},level:{type:"number",default:0},levelOptions:{type:"array",default:[0,1,2,3,4,5,6]}},example:{viewportWidth:350,attributes:{textAlign:"center"}},supports:{anchor:!0,align:["wide","full"],html:!1,color:{gradients:!0,__experimentalDefaultControls:{background:!0,text:!0}},contentRole:!0,spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalWritingMode:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0}},editorStyle:"wp-block-site-tagline-editor",style:"wp-block-site-tagline"};var k6=o(V(),1),kM=o(Q(),1),Cc=o(T(),1),x6=o(P(),1),w6=o(W(),1),wc=o(v(),1);function Lie({attributes:e,setAttributes:t,insertBlocksAfter:r}){let{textAlign:a,level:n,levelOptions:i}=e,{canUserEdit:l,tagline:s}=(0,k6.useSelect)(f=>{let{canUser:h,getEntityRecord:g,getEditedEntityRecord:b}=f(kM.store),y=h("update",{kind:"root",name:"site"}),k=y?b("root","site"):{},_=g("root","__unstableBase");return{canUserEdit:y,tagline:y?k?.description:_?.description}},[]),c=n===0?"p":`h${n}`,{editEntityRecord:u}=(0,k6.useDispatch)(kM.store);function m(f){u("root","site",void 0,{description:f})}let p=(0,Cc.useBlockProps)({className:w({[`has-text-align-${a}`]:a,"wp-block-site-tagline__placeholder":!l&&!s})}),d=l?(0,wc.jsx)(Cc.RichText,{allowedFormats:[],onChange:m,"aria-label":(0,x6.__)("Site tagline text"),placeholder:(0,x6.__)("Write site tagline\u2026"),tagName:c,value:s,disableLineBreaks:!0,__unstableOnSplitAtEnd:()=>r((0,w6.createBlock)((0,w6.getDefaultBlockName)())),...p}):(0,wc.jsx)(c,{...p,children:s||(0,x6.__)("Site Tagline placeholder")});return(0,wc.jsxs)(wc.Fragment,{children:[(0,wc.jsxs)(Cc.BlockControls,{group:"block",children:[(0,wc.jsx)(Cc.HeadingLevelDropdown,{value:n,options:i,onChange:f=>t({level:f})}),(0,wc.jsx)(Cc.AlignmentControl,{onChange:f=>t({textAlign:f}),value:a})]}),d]})}var C6=o(M(),1),wM=o(v(),1),Mie=(0,wM.jsx)(C6.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",children:(0,wM.jsx)(C6.Path,{d:"M4 10.5h16V9H4v1.5ZM4 15h9v-1.5H4V15Z"})});var q4e={attributes:{textAlign:{type:"string"}},supports:{align:["wide","full"],html:!1,color:{gradients:!0},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalTextTransform:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0}},save(){return null},migrate:Ot,isEligible({style:e}){return e?.typography?.fontFamily}},Aie=[q4e];var{name:Rie}=_6,zie={icon:Mie,edit:Lie,deprecated:Aie},Z4e=()=>E({name:Rie,metadata:_6,settings:zie});var PM={};Z(PM,{init:()=>X4e,metadata:()=>S6,name:()=>jie,settings:()=>Uie});var S6={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/site-title",title:"Site Title",category:"theme",description:"Displays the name of this site. Update the block, and the changes apply everywhere it\u2019s used. This will also appear in the browser title bar and in search results.",textdomain:"default",attributes:{level:{type:"number",default:1},levelOptions:{type:"array",default:[0,1,2,3,4,5,6]},textAlign:{type:"string"},isLink:{type:"boolean",default:!0,role:"content"},linkTarget:{type:"string",default:"_self",role:"content"}},example:{viewportWidth:500},supports:{anchor:!0,align:["wide","full"],html:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},spacing:{padding:!0,margin:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalWritingMode:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0}},editorStyle:"wp-block-site-title-editor",style:"wp-block-site-title"};var T6=o(V(),1),SM=o(Q(),1),Sc=o(P(),1),qn=o(T(),1),Zm=o(M(),1),P6=o(W(),1),TM=o(Wo(),1);var _o=o(v(),1);function Vie({attributes:e,setAttributes:t,insertBlocksAfter:r}){let{level:a,levelOptions:n,textAlign:i,isLink:l,linkTarget:s}=e,{canUserEdit:c,title:u}=(0,T6.useSelect)(y=>{let{canUser:k,getEntityRecord:_,getEditedEntityRecord:x}=y(SM.store),S=k("update",{kind:"root",name:"site"}),C=S?x("root","site"):{},N=_("root","__unstableBase");return{canUserEdit:S,title:S?C?.title:N?.name}},[]),{editEntityRecord:m}=(0,T6.useDispatch)(SM.store),p=q(),d=(0,qn.useBlockEditingMode)();function f(y){m("root","site",void 0,{title:y.trim()})}let h=a===0?"p":`h${a}`,g=(0,qn.useBlockProps)({className:w({[`has-text-align-${i}`]:i,"wp-block-site-title__placeholder":!c&&!u})}),b=c?(0,_o.jsx)(h,{...g,children:(0,_o.jsx)(qn.RichText,{tagName:l?"a":"span",href:l?"#site-title-pseudo-link":void 0,"aria-label":(0,Sc.__)("Site title text"),placeholder:(0,Sc.__)("Write site title\u2026"),value:u,onChange:f,allowedFormats:[],disableLineBreaks:!0,__unstableOnSplitAtEnd:()=>r((0,P6.createBlock)((0,P6.getDefaultBlockName)()))})}):(0,_o.jsx)(h,{...g,children:l?(0,_o.jsx)("a",{href:"#site-title-pseudo-link",onClick:y=>y.preventDefault(),children:(0,TM.decodeEntities)(u)||(0,Sc.__)("Site Title placeholder")}):(0,_o.jsx)("span",{children:(0,TM.decodeEntities)(u)||(0,Sc.__)("Site Title placeholder")})});return(0,_o.jsxs)(_o.Fragment,{children:[d==="default"&&(0,_o.jsxs)(qn.BlockControls,{group:"block",children:[(0,_o.jsx)(qn.HeadingLevelDropdown,{value:a,options:n,onChange:y=>t({level:y})}),(0,_o.jsx)(qn.AlignmentControl,{value:i,onChange:y=>{t({textAlign:y})}})]}),(0,_o.jsx)(qn.InspectorControls,{children:(0,_o.jsxs)(Zm.__experimentalToolsPanel,{label:(0,Sc.__)("Settings"),resetAll:()=>{t({isLink:!0,linkTarget:"_self"})},dropdownMenuProps:p,children:[(0,_o.jsx)(Zm.__experimentalToolsPanelItem,{hasValue:()=>!l,label:(0,Sc.__)("Make title link to home"),onDeselect:()=>t({isLink:!0}),isShownByDefault:!0,children:(0,_o.jsx)(Zm.ToggleControl,{label:(0,Sc.__)("Make title link to home"),onChange:()=>t({isLink:!l}),checked:l})}),l&&(0,_o.jsx)(Zm.__experimentalToolsPanelItem,{hasValue:()=>s!=="_self",label:(0,Sc.__)("Open in new tab"),onDeselect:()=>t({linkTarget:"_self"}),isShownByDefault:!0,children:(0,_o.jsx)(Zm.ToggleControl,{label:(0,Sc.__)("Open in new tab"),onChange:y=>t({linkTarget:y?"_blank":"_self"}),checked:s==="_blank"})})]})}),b]})}var Q4e={attributes:{level:{type:"number",default:1},textAlign:{type:"string"},isLink:{type:"boolean",default:!0},linkTarget:{type:"string",default:"_self"}},supports:{align:["wide","full"],html:!1,color:{gradients:!0,link:!0},spacing:{padding:!0,margin:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalTextTransform:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0}},save(){return null},migrate:Ot,isEligible({style:e}){return e?.typography?.fontFamily}},Fie=[Q4e];var Hie=o(W(),1),Y4e={to:[{type:"block",blocks:["core/site-logo"],transform:({isLink:e,linkTarget:t})=>(0,Hie.createBlock)("core/site-logo",{isLink:e,linkTarget:t})}]},Oie=Y4e;var{name:jie}=S6,Uie={icon:PT,example:{viewportWidth:350,attributes:{textAlign:"center"}},edit:Vie,transforms:Oie,deprecated:Fie},X4e=()=>E({name:jie,metadata:S6,settings:Uie});var CA={};Z(CA,{init:()=>a3e,metadata:()=>w8,name:()=>Gle,settings:()=>C8});var wA=o(P(),1);var Ule=o(W(),1);var Fg=o(As(),1),k8=o(V(),1),gn=o(T(),1),tf=o(U(),1),lo=o(M(),1),Vle=o(me(),1),Zn=o(P(),1);var Fle=o(W(),1);var kA=o(P(),1);var B6=o(L(),1),BM=o(v(),1),Gie=()=>(0,BM.jsx)(B6.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,BM.jsx)(B6.Path,{d:"M13.582,8.182C11.934,8.367,9.78,8.49,8.238,9.166c-1.781,0.769-3.03,2.337-3.03,4.644 c0,2.953,1.86,4.429,4.253,4.429c2.02,0,3.125-0.477,4.685-2.065c0.516,0.747,0.685,1.109,1.629,1.894 c0.212,0.114,0.483,0.103,0.672-0.066l0.006,0.006c0.567-0.505,1.599-1.401,2.18-1.888c0.231-0.188,0.19-0.496,0.009-0.754 c-0.52-0.718-1.072-1.303-1.072-2.634V8.305c0-1.876,0.133-3.599-1.249-4.891C15.23,2.369,13.422,2,12.04,2 C9.336,2,6.318,3.01,5.686,6.351C5.618,6.706,5.877,6.893,6.109,6.945l2.754,0.298C9.121,7.23,9.308,6.977,9.357,6.72 c0.236-1.151,1.2-1.706,2.284-1.706c0.584,0,1.249,0.215,1.595,0.738c0.398,0.584,0.346,1.384,0.346,2.061V8.182z M13.049,14.088 c-0.451,0.8-1.169,1.291-1.967,1.291c-1.09,0-1.728-0.83-1.728-2.061c0-2.42,2.171-2.86,4.227-2.86v0.615 C13.582,12.181,13.608,13.104,13.049,14.088z M20.683,19.339C18.329,21.076,14.917,22,11.979,22c-4.118,0-7.826-1.522-10.632-4.057 c-0.22-0.199-0.024-0.471,0.241-0.317c3.027,1.762,6.771,2.823,10.639,2.823c2.608,0,5.476-0.541,8.115-1.66 C20.739,18.62,21.072,19.051,20.683,19.339z M21.336,21.043c-0.194,0.163-0.379,0.076-0.293-0.139 c0.284-0.71,0.92-2.298,0.619-2.684c-0.301-0.386-1.99-0.183-2.749-0.092c-0.23,0.027-0.266-0.173-0.059-0.319 c1.348-0.946,3.555-0.673,3.811-0.356C22.925,17.773,22.599,19.986,21.336,21.043z"})});var I6=o(L(),1),IM=o(v(),1),Wie=()=>(0,IM.jsx)(I6.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,IM.jsx)(I6.Path,{d:"M15.27 17.289 3 17.289 8.73 6.711 21 6.711 15.27 17.289"})});var N6=o(L(),1),NM=o(v(),1),$ie=()=>(0,NM.jsx)(N6.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,NM.jsx)(N6.Path,{d:"M7.799,5.698c0.589,0,1.12,0.051,1.606,0.156c0.482,0.102,0.894,0.273,1.241,0.507c0.344,0.235,0.612,0.546,0.804,0.938 c0.188,0.387,0.281,0.871,0.281,1.443c0,0.619-0.141,1.137-0.421,1.551c-0.284,0.413-0.7,0.751-1.255,1.014 c0.756,0.218,1.317,0.601,1.689,1.146c0.374,0.549,0.557,1.205,0.557,1.975c0,0.623-0.12,1.161-0.359,1.612 c-0.241,0.457-0.569,0.828-0.973,1.114c-0.408,0.288-0.876,0.5-1.399,0.637C9.052,17.931,8.514,18,7.963,18H2V5.698H7.799 M7.449,10.668c0.481,0,0.878-0.114,1.192-0.345c0.311-0.228,0.463-0.603,0.463-1.119c0-0.286-0.051-0.523-0.152-0.707 C8.848,8.315,8.711,8.171,8.536,8.07C8.362,7.966,8.166,7.894,7.94,7.854c-0.224-0.044-0.457-0.06-0.697-0.06H4.709v2.874H7.449z M7.6,15.905c0.267,0,0.521-0.024,0.759-0.077c0.243-0.053,0.457-0.137,0.637-0.261c0.182-0.12,0.332-0.283,0.441-0.491 C9.547,14.87,9.6,14.602,9.6,14.278c0-0.633-0.18-1.084-0.533-1.357c-0.356-0.27-0.83-0.404-1.413-0.404H4.709v3.388L7.6,15.905z M16.162,15.864c0.367,0.358,0.897,0.538,1.583,0.538c0.493,0,0.92-0.125,1.277-0.374c0.354-0.248,0.571-0.514,0.654-0.79h2.155 c-0.347,1.072-0.872,1.838-1.589,2.299C19.534,18,18.67,18.23,17.662,18.23c-0.701,0-1.332-0.113-1.899-0.337 c-0.567-0.227-1.041-0.544-1.439-0.958c-0.389-0.415-0.689-0.907-0.904-1.484c-0.213-0.574-0.32-1.21-0.32-1.899 c0-0.666,0.11-1.288,0.329-1.863c0.222-0.577,0.529-1.075,0.933-1.492c0.406-0.42,0.885-0.751,1.444-0.994 c0.558-0.241,1.175-0.363,1.857-0.363c0.754,0,1.414,0.145,1.98,0.44c0.563,0.291,1.026,0.686,1.389,1.181 c0.363,0.493,0.622,1.057,0.783,1.69c0.16,0.632,0.217,1.292,0.171,1.983h-6.428C15.557,14.84,15.795,15.506,16.162,15.864 M18.973,11.184c-0.291-0.321-0.783-0.496-1.384-0.496c-0.39,0-0.714,0.066-0.973,0.2c-0.254,0.132-0.461,0.297-0.621,0.491 c-0.157,0.197-0.265,0.405-0.328,0.628c-0.063,0.217-0.101,0.413-0.111,0.587h3.98C19.478,11.969,19.265,11.509,18.973,11.184z M15.057,7.738h4.985V6.524h-4.985L15.057,7.738z"})});var E6=o(L(),1),EM=o(v(),1),qie=()=>(0,EM.jsx)(E6.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,EM.jsx)(E6.Path,{d:"M6.3,4.2c2.3,1.7,4.8,5.3,5.7,7.2.9-1.9,3.4-5.4,5.7-7.2,1.7-1.3,4.3-2.2,4.3.9s-.4,5.2-.6,5.9c-.7,2.6-3.3,3.2-5.6,2.8,4,.7,5.1,3,2.9,5.3-5,5.2-6.7-2.8-6.7-2.8,0,0-1.7,8-6.7,2.8-2.2-2.3-1.2-4.6,2.9-5.3-2.3.4-4.9-.3-5.6-2.8-.2-.7-.6-5.3-.6-5.9,0-3.1,2.7-2.1,4.3-.9h0Z"})});var D6=o(L(),1),DM=o(v(),1),O2=()=>(0,DM.jsx)(D6.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,DM.jsx)(D6.Path,{d:"M15.6 7.2H14v1.5h1.6c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.8 0 5.2-2.3 5.2-5.2 0-2.9-2.3-5.2-5.2-5.2zM4.7 12.4c0-2 1.7-3.7 3.7-3.7H10V7.2H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H10v-1.5H8.4c-2 0-3.7-1.7-3.7-3.7zm4.6.9h5.3v-1.5H9.3v1.5z"})});var L6=o(L(),1),LM=o(v(),1),Zie=()=>(0,LM.jsx)(L6.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,LM.jsx)(L6.Path,{d:"M22.016,8.84c-0.002-0.013-0.005-0.025-0.007-0.037c-0.005-0.025-0.008-0.048-0.015-0.072 c-0.003-0.015-0.01-0.028-0.013-0.042c-0.008-0.02-0.015-0.04-0.023-0.062c-0.007-0.015-0.013-0.028-0.02-0.042 c-0.008-0.02-0.018-0.037-0.03-0.057c-0.007-0.013-0.017-0.027-0.025-0.038c-0.012-0.018-0.023-0.035-0.035-0.052 c-0.01-0.013-0.02-0.025-0.03-0.037c-0.015-0.017-0.028-0.032-0.043-0.045c-0.01-0.012-0.022-0.023-0.035-0.035 c-0.015-0.015-0.032-0.028-0.048-0.04c-0.012-0.01-0.025-0.02-0.037-0.03c-0.005-0.003-0.01-0.008-0.015-0.012l-9.161-6.096 c-0.289-0.192-0.666-0.192-0.955,0L2.359,8.237C2.354,8.24,2.349,8.245,2.344,8.249L2.306,8.277 c-0.017,0.013-0.033,0.027-0.048,0.04C2.246,8.331,2.234,8.342,2.222,8.352c-0.015,0.015-0.028,0.03-0.042,0.047 c-0.012,0.013-0.022,0.023-0.03,0.037C2.139,8.453,2.125,8.471,2.115,8.488C2.107,8.501,2.099,8.514,2.09,8.526 C2.079,8.548,2.069,8.565,2.06,8.585C2.054,8.6,2.047,8.613,2.04,8.626C2.032,8.648,2.025,8.67,2.019,8.69 c-0.005,0.013-0.01,0.027-0.013,0.042C1.999,8.755,1.995,8.778,1.99,8.803C1.989,8.817,1.985,8.828,1.984,8.84 C1.978,8.879,1.975,8.915,1.975,8.954v6.093c0,0.037,0.003,0.075,0.008,0.112c0.002,0.012,0.005,0.025,0.007,0.038 c0.005,0.023,0.008,0.047,0.015,0.072c0.003,0.015,0.008,0.028,0.013,0.04c0.007,0.022,0.013,0.042,0.022,0.063 c0.007,0.015,0.013,0.028,0.02,0.04c0.008,0.02,0.018,0.038,0.03,0.058c0.007,0.013,0.015,0.027,0.025,0.038 c0.012,0.018,0.023,0.035,0.035,0.052c0.01,0.013,0.02,0.025,0.03,0.037c0.013,0.015,0.028,0.032,0.042,0.045 c0.012,0.012,0.023,0.023,0.035,0.035c0.015,0.013,0.032,0.028,0.048,0.04l0.038,0.03c0.005,0.003,0.01,0.007,0.013,0.01 l9.163,6.095C11.668,21.953,11.833,22,12,22c0.167,0,0.332-0.047,0.478-0.144l9.163-6.095l0.015-0.01 c0.013-0.01,0.027-0.02,0.037-0.03c0.018-0.013,0.035-0.028,0.048-0.04c0.013-0.012,0.025-0.023,0.035-0.035 c0.017-0.015,0.03-0.032,0.043-0.045c0.01-0.013,0.02-0.025,0.03-0.037c0.013-0.018,0.025-0.035,0.035-0.052 c0.008-0.013,0.018-0.027,0.025-0.038c0.012-0.02,0.022-0.038,0.03-0.058c0.007-0.013,0.013-0.027,0.02-0.04 c0.008-0.022,0.015-0.042,0.023-0.063c0.003-0.013,0.01-0.027,0.013-0.04c0.007-0.025,0.01-0.048,0.015-0.072 c0.002-0.013,0.005-0.027,0.007-0.037c0.003-0.042,0.007-0.079,0.007-0.117V8.954C22.025,8.915,22.022,8.879,22.016,8.84z M12.862,4.464l6.751,4.49l-3.016,2.013l-3.735-2.492V4.464z M11.138,4.464v4.009l-3.735,2.494L4.389,8.954L11.138,4.464z M3.699,10.562L5.853,12l-2.155,1.438V10.562z M11.138,19.536l-6.749-4.491l3.015-2.011l3.735,2.492V19.536z M12,14.035L8.953,12 L12,9.966L15.047,12L12,14.035z M12.862,19.536v-4.009l3.735-2.492l3.016,2.011L12.862,19.536z M20.303,13.438L18.147,12 l2.156-1.438L20.303,13.438z"})});var M6=o(L(),1),MM=o(v(),1),Kie=()=>(0,MM.jsx)(M6.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,MM.jsx)(M6.Path,{d:"M 18.19 5.636 18.19 2 18.188 2 14.553 2 14.19 2.366 12.474 5.636 11.935 6 5.81 6 5.81 10.994 9.177 10.994 9.477 11.357 5.81 18.363 5.81 22 5.811 22 9.447 22 9.81 21.634 11.526 18.364 12.065 18 18.19 18 18.19 13.006 14.823 13.006 14.523 12.641 18.19 5.636z"})});var A6=o(L(),1),AM=o(v(),1),Qie=()=>(0,AM.jsx)(A6.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,AM.jsx)(A6.Path,{d:"M20.317 4.369A19.88 19.88 0 0 0 15.894 3a14.145 14.145 0 0 0-.719 1.518 19.205 19.205 0 0 0-5.351 0A14.183 14.183 0 0 0 9.104 3 19.896 19.896 0 0 0 4.682 4.369a18.921 18.921 0 0 0-3.012 12.52 19.929 19.929 0 0 0 6.081 3.097c.487-.65.922-1.339 1.3-2.061a12.445 12.445 0 0 1-1.958-.896c.165-.12.326-.246.483-.374a12.445 12.445 0 0 0 8.946 0c.157.128.318.253.483.374-.627.371-1.281.683-1.958.896.379.722.813 1.41 1.3 2.061a19.94 19.94 0 0 0 6.081-3.097 18.921 18.921 0 0 0-3.012-12.52ZM8.12 15.233c-1.202 0-2.184-1.09-2.184-2.431 0-1.34.97-2.431 2.184-2.431 1.213 0 2.202 1.09 2.184 2.431 0 1.341-.97 2.431-2.184 2.431Zm7.757 0c-1.202 0-2.184-1.09-2.184-2.431 0-1.34.97-2.431 2.184-2.431 1.213 0 2.202 1.09 2.184 2.431 0 1.341-.97 2.431-2.184 2.431Z"})});var R6=o(L(),1),RM=o(v(),1),Yie=()=>(0,RM.jsx)(R6.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,RM.jsx)(R6.Path,{d:"M12,22C6.486,22,2,17.514,2,12S6.486,2,12,2c5.514,0,10,4.486,10,10S17.514,22,12,22z M20.434,13.369 c-0.292-0.092-2.644-0.794-5.32-0.365c1.117,3.07,1.572,5.57,1.659,6.09C18.689,17.798,20.053,15.745,20.434,13.369z M15.336,19.876c-0.127-0.749-0.623-3.361-1.822-6.477c-0.019,0.006-0.038,0.013-0.056,0.019c-4.818,1.679-6.547,5.02-6.701,5.334 c1.448,1.129,3.268,1.803,5.243,1.803C13.183,20.555,14.311,20.313,15.336,19.876z M5.654,17.724 c0.193-0.331,2.538-4.213,6.943-5.637c0.111-0.036,0.224-0.07,0.337-0.102c-0.214-0.485-0.448-0.971-0.692-1.45 c-4.266,1.277-8.405,1.223-8.778,1.216c-0.003,0.087-0.004,0.174-0.004,0.261C3.458,14.207,4.29,16.21,5.654,17.724z M3.639,10.264 c0.382,0.005,3.901,0.02,7.897-1.041c-1.415-2.516-2.942-4.631-3.167-4.94C5.979,5.41,4.193,7.613,3.639,10.264z M9.998,3.709 c0.236,0.316,1.787,2.429,3.187,5c3.037-1.138,4.323-2.867,4.477-3.085C16.154,4.286,14.17,3.471,12,3.471 C11.311,3.471,10.641,3.554,9.998,3.709z M18.612,6.612C18.432,6.855,17,8.69,13.842,9.979c0.199,0.407,0.389,0.821,0.567,1.237 c0.063,0.148,0.124,0.295,0.184,0.441c2.842-0.357,5.666,0.215,5.948,0.275C20.522,9.916,19.801,8.065,18.612,6.612z"})});var z6=o(L(),1),zM=o(v(),1),Xie=()=>(0,zM.jsx)(z6.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,zM.jsx)(z6.Path,{d:"M12,6.134L6.069,9.797L2,6.54l5.883-3.843L12,6.134z M2,13.054l5.883,3.843L12,13.459L6.069,9.797L2,13.054z M12,13.459 l4.116,3.439L22,13.054l-4.069-3.257L12,13.459z M22,6.54l-5.884-3.843L12,6.134l5.931,3.663L22,6.54z M12.011,14.2l-4.129,3.426 l-1.767-1.153v1.291l5.896,3.539l5.897-3.539v-1.291l-1.769,1.153L12.011,14.2z"})});var V6=o(L(),1),VM=o(v(),1),Jie=()=>(0,VM.jsx)(V6.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,VM.jsx)(V6.Path,{d:"M9.16033,4.038c0-.27174.02717-.43478.48913-.43478h6.22283c1.087,0,1.68478.92391,2.11957,2.663l.35326,1.38587h1.05978C19.59511,3.712,19.75815,2,19.75815,2s-2.663.29891-4.23913.29891h-7.962L3.29076,2.163v1.1413L4.731,3.57609c1.00543.19022,1.25.40761,1.33152,1.33152,0,0,.08152,2.71739.08152,7.20109s-.08152,7.17391-.08152,7.17391c0,.81522-.32609,1.11413-1.33152,1.30435l-1.44022.27174V22l4.2663-.13587h7.11957c1.60326,0,5.32609.13587,5.32609.13587.08152-.97826.625-5.40761.70652-5.89674H19.7038L18.644,18.52174c-.84239,1.90217-2.06522,2.038-3.42391,2.038H11.1712c-1.3587,0-2.01087-.54348-2.01087-1.712V12.65217s3.0163,0,3.99457.08152c.76087.05435,1.22283.27174,1.46739,1.33152l.32609,1.413h1.16848l-.08152-3.55978.163-3.587H15.02989l-.38043,1.57609c-.24457,1.03261-.40761,1.22283-1.46739,1.33152-1.38587.13587-4.02174.1087-4.02174.1087Z"})});var F6=o(L(),1),FM=o(v(),1),ele=()=>(0,FM.jsx)(F6.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,FM.jsx)(F6.Path,{d:"M12 2C6.5 2 2 6.5 2 12c0 5 3.7 9.1 8.4 9.9v-7H7.9V12h2.5V9.8c0-2.5 1.5-3.9 3.8-3.9 1.1 0 2.2.2 2.2.2v2.5h-1.3c-1.2 0-1.6.8-1.6 1.6V12h2.8l-.4 2.9h-2.3v7C18.3 21.1 22 17 22 12c0-5.5-4.5-10-10-10z"})});var H6=o(L(),1),HM=o(v(),1),tle=()=>(0,HM.jsx)(H6.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,HM.jsx)(H6.Path,{d:"M2,8.667V12c5.515,0,10,4.485,10,10h3.333C15.333,14.637,9.363,8.667,2,8.667z M2,2v3.333 c9.19,0,16.667,7.477,16.667,16.667H22C22,10.955,13.045,2,2,2z M4.5,17C3.118,17,2,18.12,2,19.5S3.118,22,4.5,22S7,20.88,7,19.5 S5.882,17,4.5,17z"})});var O6=o(L(),1),OM=o(v(),1),rle=()=>(0,OM.jsx)(O6.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,OM.jsx)(O6.Path,{d:"M6.94026,15.1412c.00437.01213.108.29862.168.44064a6.55008,6.55008,0,1,0,6.03191-9.09557,6.68654,6.68654,0,0,0-2.58357.51467A8.53914,8.53914,0,0,0,8.21268,8.61344L8.209,8.61725V3.22948l9.0504-.00008c.32934-.0036.32934-.46353.32934-.61466s0-.61091-.33035-.61467L7.47248,2a.43.43,0,0,0-.43131.42692v7.58355c0,.24466.30476.42131.58793.4819.553.11812.68074-.05864.81617-.2457l.018-.02481A10.52673,10.52673,0,0,1,9.32258,9.258a5.35268,5.35268,0,1,1,7.58985,7.54976,5.417,5.417,0,0,1-3.80867,1.56365,5.17483,5.17483,0,0,1-2.69822-.74478l.00342-4.61111a2.79372,2.79372,0,0,1,.71372-1.78792,2.61611,2.61611,0,0,1,1.98282-.89477,2.75683,2.75683,0,0,1,1.95525.79477,2.66867,2.66867,0,0,1,.79656,1.909,2.724,2.724,0,0,1-2.75849,2.748,4.94651,4.94651,0,0,1-.86254-.13719c-.31234-.093-.44519.34058-.48892.48349-.16811.54966.08453.65862.13687.67489a3.75751,3.75751,0,0,0,1.25234.18375,3.94634,3.94634,0,1,0-2.82444-6.742,3.67478,3.67478,0,0,0-1.13028,2.584l-.00041.02323c-.0035.11667-.00579,2.881-.00644,3.78811l-.00407-.00451a6.18521,6.18521,0,0,1-1.0851-1.86092c-.10544-.27856-.34358-.22925-.66857-.12917-.14192.04372-.57386.17677-.47833.489Zm4.65165-1.08338a.51346.51346,0,0,0,.19513.31818l.02276.022a.52945.52945,0,0,0,.3517.18416.24242.24242,0,0,0,.16577-.0611c.05473-.05082.67382-.67812.73287-.738l.69041.68819a.28978.28978,0,0,0,.21437.11032.53239.53239,0,0,0,.35708-.19486c.29792-.30419.14885-.46821.07676-.54751l-.69954-.69975.72952-.73469c.16-.17311.01874-.35708-.12218-.498-.20461-.20461-.402-.25742-.52855-.14083l-.7254.72665-.73354-.73375a.20128.20128,0,0,0-.14179-.05695.54135.54135,0,0,0-.34379.19648c-.22561.22555-.274.38149-.15656.5059l.73374.7315-.72942.73072A.26589.26589,0,0,0,11.59191,14.05782Zm1.59866-9.915A8.86081,8.86081,0,0,0,9.854,4.776a.26169.26169,0,0,0-.16938.22759.92978.92978,0,0,0,.08619.42094c.05682.14524.20779.531.50006.41955a8.40969,8.40969,0,0,1,2.91968-.55484,7.87875,7.87875,0,0,1,3.086.62286,8.61817,8.61817,0,0,1,2.30562,1.49315.2781.2781,0,0,0,.18318.07586c.15529,0,.30425-.15253.43167-.29551.21268-.23861.35873-.4369.1492-.63538a8.50425,8.50425,0,0,0-2.62312-1.694A9.0177,9.0177,0,0,0,13.19058,4.14283ZM19.50945,18.6236h0a.93171.93171,0,0,0-.36642-.25406.26589.26589,0,0,0-.27613.06613l-.06943.06929A7.90606,7.90606,0,0,1,7.60639,18.505a7.57284,7.57284,0,0,1-1.696-2.51537,8.58715,8.58715,0,0,1-.5147-1.77754l-.00871-.04864c-.04939-.25873-.28755-.27684-.62981-.22448-.14234.02178-.5755.088-.53426.39969l.001.00712a9.08807,9.08807,0,0,0,15.406,4.99094c.00193-.00192.04753-.04718.0725-.07436C19.79425,19.16234,19.87422,18.98728,19.50945,18.6236Z"})});var j6=o(L(),1),jM=o(v(),1),ole=()=>(0,jM.jsx)(j6.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,jM.jsx)(j6.Path,{d:"M6.5,7c-2.75,0-5,2.25-5,5s2.25,5,5,5s5-2.25,5-5S9.25,7,6.5,7z M17.5,7c-2.75,0-5,2.25-5,5s2.25,5,5,5s5-2.25,5-5 S20.25,7,17.5,7z"})});var U6=o(L(),1),UM=o(v(),1),ale=()=>(0,UM.jsx)(U6.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,UM.jsx)(U6.Path,{d:"M17.573,2c0,0-9.197,0-10.668,0S5,3.107,5,3.805s0,16.948,0,16.948c0,0.785,0.422,1.077,0.66,1.172 c0.238,0.097,0.892,0.177,1.285-0.275c0,0,5.035-5.843,5.122-5.93c0.132-0.132,0.132-0.132,0.262-0.132h3.26 c1.368,0,1.588-0.977,1.732-1.552c0.078-0.318,0.692-3.428,1.225-6.122l0.675-3.368C19.56,2.893,19.14,2,17.573,2z M16.495,7.22 c-0.053,0.252-0.372,0.518-0.665,0.518c-0.293,0-4.157,0-4.157,0c-0.467,0-0.802,0.318-0.802,0.787v0.508 c0,0.467,0.337,0.798,0.805,0.798c0,0,3.197,0,3.528,0s0.655,0.362,0.583,0.715c-0.072,0.353-0.407,2.102-0.448,2.295 c-0.04,0.193-0.262,0.523-0.655,0.523c-0.33,0-2.88,0-2.88,0c-0.523,0-0.683,0.068-1.033,0.503 c-0.35,0.437-3.505,4.223-3.505,4.223c-0.032,0.035-0.063,0.027-0.063-0.015V4.852c0-0.298,0.26-0.648,0.648-0.648 c0,0,8.228,0,8.562,0c0.315,0,0.61,0.297,0.528,0.683L16.495,7.22z"})});var G6=o(L(),1),GM=o(v(),1),nle=()=>(0,GM.jsx)(G6.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,GM.jsx)(G6.Path,{d:"M17.3,17.5c-0.2,0.8-0.5,1.4-1,1.9c-0.4,0.5-1,0.9-1.7,1.2C13.9,20.9,13.1,21,12,21c-0.6,0-1.3-0.1-1.9-0.2 c-0.6-0.1-1.1-0.4-1.6-0.7c-0.5-0.3-0.9-0.7-1.2-1.2c-0.3-0.5-0.5-1.1-0.5-1.7h1.5c0.1,0.5,0.2,0.9,0.5,1.2 c0.2,0.3,0.5,0.6,0.9,0.8c0.3,0.2,0.7,0.3,1.1,0.4c0.4,0.1,0.8,0.1,1.2,0.1c1.4,0,2.5-0.4,3.1-1.2c0.6-0.8,1-2,1-3.5v-1.7h0 c-0.4,0.8-0.9,1.4-1.6,1.9c-0.7,0.5-1.5,0.7-2.4,0.7c-1,0-1.9-0.2-2.6-0.5C8.7,15,8.1,14.5,7.7,14c-0.5-0.6-0.8-1.3-1-2.1 c-0.2-0.8-0.3-1.6-0.3-2.5c0-0.9,0.1-1.7,0.4-2.5c0.3-0.8,0.6-1.5,1.1-2c0.5-0.6,1.1-1,1.8-1.4C10.3,3.2,11.1,3,12,3 c0.5,0,0.9,0.1,1.3,0.2c0.4,0.1,0.8,0.3,1.1,0.5c0.3,0.2,0.6,0.5,0.9,0.8c0.3,0.3,0.5,0.6,0.6,1h0V3.4h1.5V15 C17.6,15.9,17.5,16.7,17.3,17.5z M13.8,14.1c0.5-0.3,0.9-0.7,1.3-1.1c0.3-0.5,0.6-1,0.8-1.6c0.2-0.6,0.3-1.2,0.3-1.9 c0-0.6-0.1-1.2-0.2-1.9c-0.1-0.6-0.4-1.2-0.7-1.7c-0.3-0.5-0.7-0.9-1.3-1.2c-0.5-0.3-1.1-0.5-1.9-0.5s-1.4,0.2-1.9,0.5 c-0.5,0.3-1,0.7-1.3,1.2C8.5,6.4,8.3,7,8.1,7.6C8,8.2,7.9,8.9,7.9,9.5c0,0.6,0.1,1.3,0.2,1.9C8.3,12,8.6,12.5,8.9,13 c0.3,0.5,0.8,0.8,1.3,1.1c0.5,0.3,1.1,0.4,1.9,0.4C12.7,14.5,13.3,14.4,13.8,14.1z"})});var W6=o(L(),1),WM=o(v(),1),ile=()=>(0,WM.jsx)(W6.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,WM.jsx)(W6.Path,{d:"M12.02,10.18v3.72v0.01h5.51c-0.26,1.57-1.67,4.22-5.5,4.22c-3.31,0-6.01-2.75-6.01-6.12s2.7-6.12,6.01-6.12 c1.87,0,3.13,0.8,3.85,1.48l2.84-2.76C16.99,2.99,14.73,2,12.03,2c-5.52,0-10,4.48-10,10s4.48,10,10,10c5.77,0,9.6-4.06,9.6-9.77 c0-0.83-0.11-1.42-0.25-2.05H12.02z"})});var $6=o(L(),1),$M=o(v(),1),lle=()=>(0,$M.jsx)($6.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,$M.jsx)($6.Path,{d:"M12,2C6.477,2,2,6.477,2,12c0,4.419,2.865,8.166,6.839,9.489c0.5,0.09,0.682-0.218,0.682-0.484 c0-0.236-0.009-0.866-0.014-1.699c-2.782,0.602-3.369-1.34-3.369-1.34c-0.455-1.157-1.11-1.465-1.11-1.465 c-0.909-0.62,0.069-0.608,0.069-0.608c1.004,0.071,1.532,1.03,1.532,1.03c0.891,1.529,2.341,1.089,2.91,0.833 c0.091-0.647,0.349-1.086,0.635-1.337c-2.22-0.251-4.555-1.111-4.555-4.943c0-1.091,0.39-1.984,1.03-2.682 C6.546,8.54,6.202,7.524,6.746,6.148c0,0,0.84-0.269,2.75,1.025C10.295,6.95,11.15,6.84,12,6.836 c0.85,0.004,1.705,0.114,2.504,0.336c1.909-1.294,2.748-1.025,2.748-1.025c0.546,1.376,0.202,2.394,0.1,2.646 c0.64,0.699,1.026,1.591,1.026,2.682c0,3.841-2.337,4.687-4.565,4.935c0.359,0.307,0.679,0.917,0.679,1.852 c0,1.335-0.012,2.415-0.012,2.741c0,0.269,0.18,0.579,0.688,0.481C19.138,20.161,22,16.416,22,12C22,6.477,17.523,2,12,2z"})});var q6=o(L(),1),qM=o(v(),1),sle=()=>(0,qM.jsx)(q6.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,qM.jsx)(q6.Path,{d:"M10.8001 4.69937V10.6494C10.8001 11.1001 10.9791 11.5323 11.2978 11.851C11.6165 12.1697 12.0487 12.3487 12.4994 12.3487C12.9501 12.3487 13.3824 12.1697 13.7011 11.851C14.0198 11.5323 14.1988 11.1001 14.1988 10.6494V6.69089C15.2418 7.05861 16.1371 7.75537 16.7496 8.67617C17.3622 9.59698 17.6589 10.6919 17.595 11.796C17.5311 12.9001 17.1101 13.9535 16.3954 14.7975C15.6807 15.6415 14.711 16.2303 13.6325 16.4753C12.5541 16.7202 11.4252 16.608 10.4161 16.1555C9.40691 15.703 8.57217 14.9348 8.03763 13.9667C7.50308 12.9985 7.29769 11.8828 7.45242 10.7877C7.60714 9.69266 8.11359 8.67755 8.89545 7.89537C9.20904 7.57521 9.38364 7.14426 9.38132 6.69611C9.37899 6.24797 9.19994 5.81884 8.88305 5.50195C8.56616 5.18506 8.13704 5.00601 7.68889 5.00369C7.24075 5.00137 6.80979 5.17597 6.48964 5.48956C5.09907 6.8801 4.23369 8.7098 4.04094 10.6669C3.84819 12.624 4.34 14.5873 5.43257 16.2224C6.52515 17.8575 8.15088 19.0632 10.0328 19.634C11.9146 20.2049 13.9362 20.1055 15.753 19.3529C17.5699 18.6003 19.0695 17.241 19.9965 15.5066C20.9234 13.7722 21.2203 11.7701 20.8366 9.84133C20.4528 7.91259 19.4122 6.17658 17.892 4.92911C16.3717 3.68163 14.466 2.99987 12.4994 3C12.0487 3 11.6165 3.17904 11.2978 3.49773C10.9791 3.81643 10.8001 4.24867 10.8001 4.69937Z"})});var Z6=o(L(),1),ZM=o(v(),1),cle=()=>(0,ZM.jsx)(Z6.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,ZM.jsx)(Z6.Path,{d:"M12,4.622c2.403,0,2.688,0.009,3.637,0.052c0.877,0.04,1.354,0.187,1.671,0.31c0.42,0.163,0.72,0.358,1.035,0.673 c0.315,0.315,0.51,0.615,0.673,1.035c0.123,0.317,0.27,0.794,0.31,1.671c0.043,0.949,0.052,1.234,0.052,3.637 s-0.009,2.688-0.052,3.637c-0.04,0.877-0.187,1.354-0.31,1.671c-0.163,0.42-0.358,0.72-0.673,1.035 c-0.315,0.315-0.615,0.51-1.035,0.673c-0.317,0.123-0.794,0.27-1.671,0.31c-0.949,0.043-1.233,0.052-3.637,0.052 s-2.688-0.009-3.637-0.052c-0.877-0.04-1.354-0.187-1.671-0.31c-0.42-0.163-0.72-0.358-1.035-0.673 c-0.315-0.315-0.51-0.615-0.673-1.035c-0.123-0.317-0.27-0.794-0.31-1.671C4.631,14.688,4.622,14.403,4.622,12 s0.009-2.688,0.052-3.637c0.04-0.877,0.187-1.354,0.31-1.671c0.163-0.42,0.358-0.72,0.673-1.035 c0.315-0.315,0.615-0.51,1.035-0.673c0.317-0.123,0.794-0.27,1.671-0.31C9.312,4.631,9.597,4.622,12,4.622 M12,3 C9.556,3,9.249,3.01,8.289,3.054C7.331,3.098,6.677,3.25,6.105,3.472C5.513,3.702,5.011,4.01,4.511,4.511 c-0.5,0.5-0.808,1.002-1.038,1.594C3.25,6.677,3.098,7.331,3.054,8.289C3.01,9.249,3,9.556,3,12c0,2.444,0.01,2.751,0.054,3.711 c0.044,0.958,0.196,1.612,0.418,2.185c0.23,0.592,0.538,1.094,1.038,1.594c0.5,0.5,1.002,0.808,1.594,1.038 c0.572,0.222,1.227,0.375,2.185,0.418C9.249,20.99,9.556,21,12,21s2.751-0.01,3.711-0.054c0.958-0.044,1.612-0.196,2.185-0.418 c0.592-0.23,1.094-0.538,1.594-1.038c0.5-0.5,0.808-1.002,1.038-1.594c0.222-0.572,0.375-1.227,0.418-2.185 C20.99,14.751,21,14.444,21,12s-0.01-2.751-0.054-3.711c-0.044-0.958-0.196-1.612-0.418-2.185c-0.23-0.592-0.538-1.094-1.038-1.594 c-0.5-0.5-1.002-0.808-1.594-1.038c-0.572-0.222-1.227-0.375-2.185-0.418C14.751,3.01,14.444,3,12,3L12,3z M12,7.378 c-2.552,0-4.622,2.069-4.622,4.622S9.448,16.622,12,16.622s4.622-2.069,4.622-4.622S14.552,7.378,12,7.378z M12,15 c-1.657,0-3-1.343-3-3s1.343-3,3-3s3,1.343,3,3S13.657,15,12,15z M16.804,6.116c-0.596,0-1.08,0.484-1.08,1.08 s0.484,1.08,1.08,1.08c0.596,0,1.08-0.484,1.08-1.08S17.401,6.116,16.804,6.116z"})});var K6=o(L(),1),KM=o(v(),1),ule=()=>(0,KM.jsx)(K6.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,KM.jsx)(K6.Path,{d:"M 12.0002 1.5 C 6.2006 1.5 1.5 6.2011 1.5 11.9998 C 1.5 17.799 6.2006 22.5 12.0002 22.5 C 17.799 22.5 22.5 17.799 22.5 11.9998 C 22.5 6.2011 17.799 1.5 12.0002 1.5 Z M 16.1974 16.2204 C 14.8164 16.2152 13.9346 15.587 13.3345 14.1859 L 13.1816 13.8451 L 11.8541 10.8101 C 11.4271 9.7688 10.3526 9.0712 9.1801 9.0712 C 7.5695 9.0712 6.2593 10.3851 6.2593 12.001 C 6.2593 13.6165 7.5695 14.9303 9.1801 14.9303 C 10.272 14.9303 11.2651 14.3275 11.772 13.3567 C 11.7893 13.3235 11.8239 13.302 11.863 13.3038 C 11.9007 13.3054 11.9353 13.3288 11.9504 13.3632 L 12.4865 14.6046 C 12.5016 14.639 12.4956 14.6778 12.4723 14.7069 C 11.6605 15.6995 10.4602 16.2683 9.1801 16.2683 C 6.8331 16.2683 4.9234 14.3536 4.9234 12.001 C 4.9234 9.6468 6.833 7.732 9.1801 7.732 C 10.9572 7.732 12.3909 8.6907 13.1138 10.3636 C 13.1206 10.3802 13.8412 12.0708 14.4744 13.5191 C 14.8486 14.374 15.1462 14.896 16.1288 14.9292 C 17.0663 14.9613 17.7538 14.4122 17.7538 13.6485 C 17.7538 12.9691 17.3321 12.8004 16.3803 12.4822 C 14.7365 11.9398 13.845 11.3861 13.845 10.0182 C 13.845 8.6809 14.7667 7.8162 16.192 7.8162 C 17.1288 7.8162 17.8155 8.2287 18.2921 9.0768 C 18.305 9.1006 18.3079 9.1281 18.3004 9.1542 C 18.2929 9.1803 18.2748 9.2021 18.2507 9.2138 L 17.3614 9.669 C 17.3178 9.692 17.2643 9.6781 17.2356 9.6385 C 16.9329 9.2135 16.5956 9.0251 16.1423 9.0251 C 15.5512 9.0251 15.122 9.429 15.122 9.9865 C 15.122 10.6738 15.6529 10.8414 16.5339 11.1192 C 16.6491 11.1558 16.7696 11.194 16.8939 11.2343 C 18.2763 11.6865 19.0768 12.2311 19.0768 13.6836 C 19.0769 15.1297 17.8389 16.2204 16.1974 16.2204 Z"})});var Q6=o(L(),1),QM=o(v(),1),mle=()=>(0,QM.jsx)(Q6.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,QM.jsx)(Q6.Path,{d:"M19.7,3H4.3C3.582,3,3,3.582,3,4.3v15.4C3,20.418,3.582,21,4.3,21h15.4c0.718,0,1.3-0.582,1.3-1.3V4.3 C21,3.582,20.418,3,19.7,3z M8.339,18.338H5.667v-8.59h2.672V18.338z M7.004,8.574c-0.857,0-1.549-0.694-1.549-1.548 c0-0.855,0.691-1.548,1.549-1.548c0.854,0,1.547,0.694,1.547,1.548C8.551,7.881,7.858,8.574,7.004,8.574z M18.339,18.338h-2.669 v-4.177c0-0.996-0.017-2.278-1.387-2.278c-1.389,0-1.601,1.086-1.601,2.206v4.249h-2.667v-8.59h2.559v1.174h0.037 c0.356-0.675,1.227-1.387,2.526-1.387c2.703,0,3.203,1.779,3.203,4.092V18.338z"})});var Y6=o(L(),1),YM=o(v(),1),ple=()=>(0,YM.jsx)(Y6.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,YM.jsx)(Y6.Path,{d:"M19 5H5c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm.5 12c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V9.8l7.5 5.6 7.5-5.6V17zm0-9.1L12 13.6 4.5 7.9V7c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v.9z"})});var X6=o(L(),1),XM=o(v(),1),dle=()=>(0,XM.jsx)(X6.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,XM.jsx)(X6.Path,{d:"M23.193 7.879c0-5.206-3.411-6.732-3.411-6.732C18.062.357 15.108.025 12.041 0h-.076c-3.068.025-6.02.357-7.74 1.147 0 0-3.411 1.526-3.411 6.732 0 1.192-.023 2.618.015 4.129.124 5.092.934 10.109 5.641 11.355 2.17.574 4.034.695 5.535.612 2.722-.15 4.25-.972 4.25-.972l-.09-1.975s-1.945.613-4.129.539c-2.165-.074-4.449-.233-4.799-2.891a5.499 5.499 0 0 1-.048-.745s2.125.52 4.817.643c1.646.075 3.19-.097 4.758-.283 3.007-.359 5.625-2.212 5.954-3.905.517-2.665.475-6.507.475-6.507zm-4.024 6.709h-2.497V8.469c0-1.29-.543-1.944-1.628-1.944-1.2 0-1.802.776-1.802 2.312v3.349h-2.483v-3.35c0-1.536-.602-2.312-1.802-2.312-1.085 0-1.628.655-1.628 1.944v6.119H4.832V8.284c0-1.289.328-2.313.987-3.07.68-.758 1.569-1.146 2.674-1.146 1.278 0 2.246.491 2.886 1.474L12 6.585l.622-1.043c.64-.983 1.608-1.474 2.886-1.474 1.104 0 1.994.388 2.674 1.146.658.757.986 1.781.986 3.07v6.304z"})});var J6=o(L(),1),JM=o(v(),1),fle=()=>(0,JM.jsx)(J6.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,JM.jsx)(J6.Path,{d:"M19.24775,14.722a3.57032,3.57032,0,0,1-2.94457,3.52073,3.61886,3.61886,0,0,1-.64652.05634c-.07314-.0008-.10187.02846-.12507.09547A2.38881,2.38881,0,0,1,13.49453,20.094a2.33092,2.33092,0,0,1-1.827-.50716.13635.13635,0,0,0-.19878-.00408,3.191,3.191,0,0,1-2.104.60248,3.26309,3.26309,0,0,1-3.00324-2.71993,2.19076,2.19076,0,0,1-.03512-.30865c-.00156-.08579-.03413-.1189-.11608-.13493a2.86421,2.86421,0,0,1-1.23189-.56111,2.945,2.945,0,0,1-1.166-2.05749,2.97484,2.97484,0,0,1,.87524-2.50774.112.112,0,0,0,.02091-.16107,2.7213,2.7213,0,0,1-.36648-1.48A2.81256,2.81256,0,0,1,6.57673,7.58838a.35764.35764,0,0,0,.28869-.22819,4.2208,4.2208,0,0,1,6.02892-1.90111.25161.25161,0,0,0,.22023.0243,3.65608,3.65608,0,0,1,3.76031.90678A3.57244,3.57244,0,0,1,17.95918,8.626a2.97339,2.97339,0,0,1,.01829.57356.10637.10637,0,0,0,.0853.12792,1.97669,1.97669,0,0,1,1.27939,1.33733,2.00266,2.00266,0,0,1-.57112,2.12652c-.05284.05166-.04168.08328-.01173.13489A3.51189,3.51189,0,0,1,19.24775,14.722Zm-6.35959-.27836a1.6984,1.6984,0,0,0,1.14556,1.61113,3.82039,3.82039,0,0,0,1.036.17935,1.46888,1.46888,0,0,0,.73509-.12255.44082.44082,0,0,0,.26057-.44274.45312.45312,0,0,0-.29211-.43375.97191.97191,0,0,0-.20678-.063c-.21326-.03806-.42754-.0701-.63973-.11215a.54787.54787,0,0,1-.50172-.60926,2.75864,2.75864,0,0,1,.1773-.901c.1763-.535.414-1.045.64183-1.55913A12.686,12.686,0,0,0,15.85,10.47863a1.58461,1.58461,0,0,0,.04861-.87208,1.04531,1.04531,0,0,0-.85432-.83981,1.60658,1.60658,0,0,0-1.23654.16594.27593.27593,0,0,1-.36286-.03413c-.085-.0747-.16594-.15379-.24918-.23055a.98682.98682,0,0,0-1.33577-.04933,6.1468,6.1468,0,0,1-.4989.41615.47762.47762,0,0,1-.51535.03566c-.17448-.09307-.35512-.175-.53531-.25665a1.74949,1.74949,0,0,0-.56476-.2016,1.69943,1.69943,0,0,0-1.61654.91787,8.05815,8.05815,0,0,0-.32952.80126c-.45471,1.2557-.82507,2.53825-1.20838,3.81639a1.24151,1.24151,0,0,0,.51532,1.44389,1.42659,1.42659,0,0,0,1.22008.17166,1.09728,1.09728,0,0,0,.66994-.69764c.44145-1.04111.839-2.09989,1.25981-3.14926.11581-.28876.22792-.57874.35078-.86438a.44548.44548,0,0,1,.69189-.19539.50521.50521,0,0,1,.15044.43836,1.75625,1.75625,0,0,1-.14731.50453c-.27379.69219-.55265,1.38236-.82766,2.074a2.0836,2.0836,0,0,0-.14038.42876.50719.50719,0,0,0,.27082.57722.87236.87236,0,0,0,.66145.02739.99137.99137,0,0,0,.53406-.532q.61571-1.20914,1.228-2.42031.28423-.55863.57585-1.1133a.87189.87189,0,0,1,.29055-.35253.34987.34987,0,0,1,.37634-.01265.30291.30291,0,0,1,.12434.31459.56716.56716,0,0,1-.04655.1915c-.05318.12739-.10286.25669-.16183.38156-.34118.71775-.68754,1.43273-1.02568,2.152A2.00213,2.00213,0,0,0,12.88816,14.44366Zm4.78568,5.28972a.88573.88573,0,0,0-1.77139.00465.8857.8857,0,0,0,1.77139-.00465Zm-14.83838-7.296a.84329.84329,0,1,0,.00827-1.68655.8433.8433,0,0,0-.00827,1.68655Zm10.366-9.43673a.83506.83506,0,1,0-.0091,1.67.83505.83505,0,0,0,.0091-1.67Zm6.85014,5.22a.71651.71651,0,0,0-1.433.0093.71656.71656,0,0,0,1.433-.0093ZM5.37528,6.17908A.63823.63823,0,1,0,6.015,5.54483.62292.62292,0,0,0,5.37528,6.17908Zm6.68214,14.80843a.54949.54949,0,1,0-.55052.541A.54556.54556,0,0,0,12.05742,20.98752Zm8.53235-8.49689a.54777.54777,0,0,0-.54027.54023.53327.53327,0,0,0,.532.52293.51548.51548,0,0,0,.53272-.5237A.53187.53187,0,0,0,20.58977,12.49063ZM7.82846,2.4715a.44927.44927,0,1,0,.44484.44766A.43821.43821,0,0,0,7.82846,2.4715Zm13.775,7.60492a.41186.41186,0,0,0-.40065.39623.40178.40178,0,0,0,.40168.40168A.38994.38994,0,0,0,22,10.48172.39946.39946,0,0,0,21.60349,10.07642ZM5.79193,17.96207a.40469.40469,0,0,0-.397-.39646.399.399,0,0,0-.396.405.39234.39234,0,0,0,.39939.389A.39857.39857,0,0,0,5.79193,17.96207Z"})});var e8=o(L(),1),eA=o(v(),1),hle=()=>(0,eA.jsx)(e8.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,eA.jsx)(e8.Path,{d:"M13.2,12c0,3-2.4,5.4-5.3,5.4S2.6,15,2.6,12s2.4-5.4,5.3-5.4S13.2,9,13.2,12 M19.1,12c0,2.8-1.2,5-2.7,5s-2.7-2.3-2.7-5s1.2-5,2.7-5C17.9,7,19.1,9.2,19.1,12 M21.4,12c0,2.5-0.4,4.5-0.9,4.5c-0.5,0-0.9-2-0.9-4.5s0.4-4.5,0.9-4.5C21,7.5,21.4,9.5,21.4,12"})});var t8=o(L(),1),tA=o(v(),1),gle=()=>(0,tA.jsx)(t8.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,tA.jsx)(t8.Path,{d:"M20 8.40755C19.9969 6.10922 18.2543 4.22555 16.2097 3.54588C13.6708 2.70188 10.3222 2.82421 7.89775 3.99921C4.95932 5.42355 4.03626 8.54355 4.00186 11.6552C3.97363 14.2136 4.2222 20.9517 7.92225 20.9997C10.6715 21.0356 11.0809 17.3967 12.3529 15.6442C13.258 14.3974 14.4233 14.0452 15.8578 13.6806C18.3233 13.0537 20.0036 11.0551 20 8.40755Z"})});var r8=o(L(),1),rA=o(v(),1),vle=()=>(0,rA.jsx)(r8.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,rA.jsx)(r8.Path,{d:"M12.289,2C6.617,2,3.606,5.648,3.606,9.622c0,1.846,1.025,4.146,2.666,4.878c0.25,0.111,0.381,0.063,0.439-0.169 c0.044-0.175,0.267-1.029,0.365-1.428c0.032-0.128,0.017-0.237-0.091-0.362C6.445,11.911,6.01,10.75,6.01,9.668 c0-2.777,2.194-5.464,5.933-5.464c3.23,0,5.49,2.108,5.49,5.122c0,3.407-1.794,5.768-4.13,5.768c-1.291,0-2.257-1.021-1.948-2.277 c0.372-1.495,1.089-3.112,1.089-4.191c0-0.967-0.542-1.775-1.663-1.775c-1.319,0-2.379,1.309-2.379,3.059 c0,1.115,0.394,1.869,0.394,1.869s-1.302,5.279-1.54,6.261c-0.405,1.666,0.053,4.368,0.094,4.604 c0.021,0.126,0.167,0.169,0.25,0.063c0.129-0.165,1.699-2.419,2.142-4.051c0.158-0.59,0.817-2.995,0.817-2.995 c0.43,0.784,1.681,1.446,3.013,1.446c3.963,0,6.822-3.494,6.822-7.833C20.394,5.112,16.849,2,12.289,2"})});var o8=o(L(),1),oA=o(v(),1),ble=()=>(0,oA.jsx)(o8.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,oA.jsx)(o8.Path,{d:"M21.927,4.194C21.667,3.48,20.982,3,20.222,3h-0.01h-1.721H3.839C3.092,3,2.411,3.47,2.145,4.17 C2.066,4.378,2.026,4.594,2.026,4.814v6.035l0.069,1.2c0.29,2.73,1.707,5.115,3.899,6.778c0.039,0.03,0.079,0.059,0.119,0.089 l0.025,0.018c1.175,0.859,2.491,1.441,3.91,1.727c0.655,0.132,1.325,0.2,1.991,0.2c0.615,0,1.232-0.057,1.839-0.17 c0.073-0.014,0.145-0.028,0.219-0.044c0.02-0.004,0.042-0.012,0.064-0.023c1.359-0.297,2.621-0.864,3.753-1.691l0.025-0.018 c0.04-0.029,0.08-0.058,0.119-0.089c2.192-1.664,3.609-4.049,3.898-6.778l0.069-1.2V4.814C22.026,4.605,22,4.398,21.927,4.194z M17.692,10.481l-4.704,4.512c-0.266,0.254-0.608,0.382-0.949,0.382c-0.342,0-0.684-0.128-0.949-0.382l-4.705-4.512 C5.838,9.957,5.82,9.089,6.344,8.542c0.524-0.547,1.392-0.565,1.939-0.04l3.756,3.601l3.755-3.601 c0.547-0.524,1.415-0.506,1.939,0.04C18.256,9.089,18.238,9.956,17.692,10.481z"})});var a8=o(L(),1),aA=o(v(),1),yle=()=>(0,aA.jsx)(a8.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,aA.jsx)(a8.Path,{d:"M5.27 9.221A2.775 2.775 0 0 0 2.498 11.993a2.785 2.785 0 0 0 1.6 2.511 5.337 5.337 0 0 0 2.374 4.11 9.386 9.386 0 0 0 5.539 1.7 9.386 9.386 0 0 0 5.541-1.7 5.331 5.331 0 0 0 2.372-4.114 2.787 2.787 0 0 0 1.583-2.5 2.775 2.775 0 0 0-2.772-2.772 2.742 2.742 0 0 0-1.688.574 9.482 9.482 0 0 0-4.637-1.348v-.008a2.349 2.349 0 0 1 2.011-2.316 1.97 1.97 0 0 0 1.926 1.521 1.98 1.98 0 0 0 1.978-1.978 1.98 1.98 0 0 0-1.978-1.978 1.985 1.985 0 0 0-1.938 1.578 3.183 3.183 0 0 0-2.849 3.172v.011a9.463 9.463 0 0 0-4.59 1.35 2.741 2.741 0 0 0-1.688-.574Zm6.736 9.1a3.162 3.162 0 0 1-2.921-1.944.215.215 0 0 1 .014-.2.219.219 0 0 1 .168-.106 27.327 27.327 0 0 1 2.74-.133 27.357 27.357 0 0 1 2.74.133.219.219 0 0 1 .168.106.215.215 0 0 1 .014.2 3.158 3.158 0 0 1-2.921 1.944Zm3.743-3.157a1.265 1.265 0 0 1-1.4-1.371 1.954 1.954 0 0 1 .482-1.442 1.15 1.15 0 0 1 .842-.379 1.7 1.7 0 0 1 1.49 1.777 1.323 1.323 0 0 1-.325 1.015 1.476 1.476 0 0 1-1.089.4Zm-7.485 0a1.476 1.476 0 0 1-1.086-.4 1.323 1.323 0 0 1-.325-1.016 1.7 1.7 0 0 1 1.49-1.777 1.151 1.151 0 0 1 .843.379 1.951 1.951 0 0 1 .481 1.441 1.276 1.276 0 0 1-1.403 1.373Z"})});var n8=o(L(),1),nA=o(v(),1),_le=()=>(0,nA.jsx)(n8.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,nA.jsx)(n8.Path,{d:"M10.113,2.699c0.033-0.006,0.067-0.013,0.1-0.02c0.033,0.017,0.066,0.033,0.098,0.051L10.113,2.699z M2.72,10.223 c-0.006,0.034-0.011,0.069-0.017,0.103c0.018,0.032,0.033,0.064,0.051,0.095L2.72,10.223z M21.275,13.771 c0.007-0.035,0.011-0.071,0.018-0.106c-0.018-0.031-0.033-0.064-0.052-0.095L21.275,13.771z M13.563,21.199 c0.032,0.019,0.065,0.035,0.096,0.053c0.036-0.006,0.071-0.011,0.105-0.017L13.563,21.199z M22,16.386 c0,1.494-0.581,2.898-1.637,3.953c-1.056,1.057-2.459,1.637-3.953,1.637c-0.967,0-1.914-0.251-2.75-0.725 c0.036-0.006,0.071-0.011,0.105-0.017l-0.202-0.035c0.032,0.019,0.065,0.035,0.096,0.053c-0.543,0.096-1.099,0.147-1.654,0.147 c-1.275,0-2.512-0.25-3.676-0.743c-1.125-0.474-2.135-1.156-3.002-2.023c-0.867-0.867-1.548-1.877-2.023-3.002 c-0.493-1.164-0.743-2.401-0.743-3.676c0-0.546,0.049-1.093,0.142-1.628c0.018,0.032,0.033,0.064,0.051,0.095L2.72,10.223 c-0.006,0.034-0.011,0.069-0.017,0.103C2.244,9.5,2,8.566,2,7.615c0-1.493,0.582-2.898,1.637-3.953 c1.056-1.056,2.46-1.638,3.953-1.638c0.915,0,1.818,0.228,2.622,0.655c-0.033,0.007-0.067,0.013-0.1,0.02l0.199,0.031 c-0.032-0.018-0.066-0.034-0.098-0.051c0.002,0,0.003-0.001,0.004-0.001c0.586-0.112,1.187-0.169,1.788-0.169 c1.275,0,2.512,0.249,3.676,0.742c1.124,0.476,2.135,1.156,3.002,2.024c0.868,0.867,1.548,1.877,2.024,3.002 c0.493,1.164,0.743,2.401,0.743,3.676c0,0.575-0.054,1.15-0.157,1.712c-0.018-0.031-0.033-0.064-0.052-0.095l0.034,0.201 c0.007-0.035,0.011-0.071,0.018-0.106C21.754,14.494,22,15.432,22,16.386z M16.817,14.138c0-1.331-0.613-2.743-3.033-3.282 l-2.209-0.49c-0.84-0.192-1.807-0.444-1.807-1.237c0-0.794,0.679-1.348,1.903-1.348c2.468,0,2.243,1.696,3.468,1.696 c0.645,0,1.209-0.379,1.209-1.031c0-1.521-2.435-2.663-4.5-2.663c-2.242,0-4.63,0.952-4.63,3.488c0,1.221,0.436,2.521,2.839,3.123 l2.984,0.745c0.903,0.223,1.129,0.731,1.129,1.189c0,0.762-0.758,1.507-2.129,1.507c-2.679,0-2.307-2.062-3.743-2.062 c-0.645,0-1.113,0.444-1.113,1.078c0,1.236,1.501,2.886,4.856,2.886C15.236,17.737,16.817,16.199,16.817,14.138z"})});var i8=o(L(),1),iA=o(v(),1),xle=()=>(0,iA.jsx)(i8.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,iA.jsx)(i8.Path,{d:"M12.065,2a5.526,5.526,0,0,1,3.132.892A5.854,5.854,0,0,1,17.326,5.4a5.821,5.821,0,0,1,.351,2.33q0,.612-.117,2.487a.809.809,0,0,0,.365.091,1.93,1.93,0,0,0,.664-.176,1.93,1.93,0,0,1,.664-.176,1.3,1.3,0,0,1,.729.234.7.7,0,0,1,.351.6.839.839,0,0,1-.41.7,2.732,2.732,0,0,1-.9.41,3.192,3.192,0,0,0-.9.378.728.728,0,0,0-.41.618,1.575,1.575,0,0,0,.156.56,6.9,6.9,0,0,0,1.334,1.953,5.6,5.6,0,0,0,1.881,1.315,5.875,5.875,0,0,0,1.042.3.42.42,0,0,1,.365.456q0,.911-2.852,1.341a1.379,1.379,0,0,0-.143.507,1.8,1.8,0,0,1-.182.605.451.451,0,0,1-.429.241,5.878,5.878,0,0,1-.807-.085,5.917,5.917,0,0,0-.833-.085,4.217,4.217,0,0,0-.807.065,2.42,2.42,0,0,0-.82.293,6.682,6.682,0,0,0-.755.5q-.351.267-.755.527a3.886,3.886,0,0,1-.989.436A4.471,4.471,0,0,1,11.831,22a4.307,4.307,0,0,1-1.256-.176,3.784,3.784,0,0,1-.976-.436q-.4-.26-.749-.527a6.682,6.682,0,0,0-.755-.5,2.422,2.422,0,0,0-.807-.293,4.432,4.432,0,0,0-.82-.065,5.089,5.089,0,0,0-.853.1,5,5,0,0,1-.762.1.474.474,0,0,1-.456-.241,1.819,1.819,0,0,1-.182-.618,1.411,1.411,0,0,0-.143-.521q-2.852-.429-2.852-1.341a.42.42,0,0,1,.365-.456,5.793,5.793,0,0,0,1.042-.3,5.524,5.524,0,0,0,1.881-1.315,6.789,6.789,0,0,0,1.334-1.953A1.575,1.575,0,0,0,6,12.9a.728.728,0,0,0-.41-.618,3.323,3.323,0,0,0-.9-.384,2.912,2.912,0,0,1-.9-.41.814.814,0,0,1-.41-.684.71.71,0,0,1,.338-.593,1.208,1.208,0,0,1,.716-.241,1.976,1.976,0,0,1,.625.169,2.008,2.008,0,0,0,.69.169.919.919,0,0,0,.416-.091q-.117-1.849-.117-2.474A5.861,5.861,0,0,1,6.385,5.4,5.516,5.516,0,0,1,8.625,2.819,7.075,7.075,0,0,1,12.062,2Z"})});var l8=o(L(),1),lA=o(v(),1),kle=()=>(0,lA.jsx)(l8.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,lA.jsx)(l8.Path,{d:"M23.994 14.552a3.36 3.36 0 01-3.401 3.171h-8.176a.685.685 0 01-.679-.681V8.238a.749.749 0 01.452-.716S12.942 7 14.526 7a5.357 5.357 0 012.748.755 5.44 5.44 0 012.56 3.546c.282-.08.574-.12.868-.119a3.273 3.273 0 013.292 3.37zM10.718 8.795a.266.266 0 10-.528 0c-.224 2.96-.397 5.735 0 8.685a.265.265 0 00.528 0c.425-2.976.246-5.7 0-8.685zM9.066 9.82a.278.278 0 00-.553 0 33.183 33.183 0 000 7.663.278.278 0 00.55 0c.33-2.544.332-5.12.003-7.664zM7.406 9.56a.269.269 0 00-.535 0c-.253 2.7-.38 5.222 0 7.917a.266.266 0 10.531 0c.394-2.73.272-5.181.004-7.917zM5.754 10.331a.275.275 0 10-.55 0 28.035 28.035 0 000 7.155.272.272 0 00.54 0c.332-2.373.335-4.78.01-7.155zM4.087 12.12a.272.272 0 00-.544 0c-.393 1.843-.208 3.52.016 5.386a.26.26 0 00.512 0c.247-1.892.435-3.53.016-5.386zM2.433 11.838a.282.282 0 00-.56 0c-.349 1.882-.234 3.54.01 5.418.025.285.508.282.54 0 .269-1.907.394-3.517.01-5.418zM.762 12.76a.282.282 0 00-.56 0c-.32 1.264-.22 2.31.023 3.578a.262.262 0 00.521 0c.282-1.293.42-2.317.016-3.578z"})});var s8=o(L(),1),sA=o(v(),1),wle=()=>(0,sA.jsx)(s8.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,sA.jsx)(s8.Path,{d:"M12,2C6.477,2,2,6.477,2,12c0,5.523,4.477,10,10,10c5.523,0,10-4.477,10-10C22,6.477,17.523,2,12,2 M16.586,16.424 c-0.18,0.295-0.563,0.387-0.857,0.207c-2.348-1.435-5.304-1.76-8.785-0.964c-0.335,0.077-0.67-0.133-0.746-0.469 c-0.077-0.335,0.132-0.67,0.469-0.746c3.809-0.871,7.077-0.496,9.713,1.115C16.673,15.746,16.766,16.13,16.586,16.424 M17.81,13.7 c-0.226,0.367-0.706,0.482-1.072,0.257c-2.687-1.652-6.785-2.131-9.965-1.166C6.36,12.917,5.925,12.684,5.8,12.273 C5.675,11.86,5.908,11.425,6.32,11.3c3.632-1.102,8.147-0.568,11.234,1.328C17.92,12.854,18.035,13.335,17.81,13.7 M17.915,10.865 c-3.223-1.914-8.54-2.09-11.618-1.156C5.804,9.859,5.281,9.58,5.131,9.086C4.982,8.591,5.26,8.069,5.755,7.919 c3.532-1.072,9.404-0.865,13.115,1.338c0.445,0.264,0.59,0.838,0.327,1.282C18.933,10.983,18.359,11.129,17.915,10.865"})});var c8=o(L(),1),cA=o(v(),1),Cle=()=>(0,cA.jsx)(c8.SVG,{width:"24",height:"24",viewBox:"0 0 128 128",version:"1.1",children:(0,cA.jsx)(c8.Path,{d:"M28.9700376,63.3244248 C47.6273373,55.1957357 60.0684594,49.8368063 66.2934036,47.2476366 C84.0668845,39.855031 87.7600616,38.5708563 90.1672227,38.528 C90.6966555,38.5191258 91.8804274,38.6503351 92.6472251,39.2725385 C93.294694,39.7979149 93.4728387,40.5076237 93.5580865,41.0057381 C93.6433345,41.5038525 93.7494885,42.63857 93.6651041,43.5252052 C92.7019529,53.6451182 88.5344133,78.2034783 86.4142057,89.5379542 C85.5170662,94.3339958 83.750571,95.9420841 82.0403991,96.0994568 C78.3237996,96.4414641 75.5015827,93.6432685 71.9018743,91.2836143 C66.2690414,87.5912212 63.0868492,85.2926952 57.6192095,81.6896017 C51.3004058,77.5256038 55.3966232,75.2369981 58.9976911,71.4967761 C59.9401076,70.5179421 76.3155302,55.6232293 76.6324771,54.2720454 C76.6721165,54.1030573 76.7089039,53.4731496 76.3346867,53.1405352 C75.9604695,52.8079208 75.4081573,52.921662 75.0095933,53.0121213 C74.444641,53.1403447 65.4461175,59.0880351 48.0140228,70.8551922 C45.4598218,72.6091037 43.1463059,73.4636682 41.0734751,73.4188859 C38.7883453,73.3695169 34.3926725,72.1268388 31.1249416,71.0646282 C27.1169366,69.7617838 23.931454,69.0729605 24.208838,66.8603276 C24.3533167,65.7078514 25.9403832,64.5292172 28.9700376,63.3244248 Z"})});var u8=o(L(),1),uA=o(v(),1),Sle=()=>(0,uA.jsx)(u8.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,uA.jsx)(u8.Path,{d:"M16.3 11.3c-.1 0-.2-.1-.2-.1-.1-2.6-1.5-4-3.9-4-1.4 0-2.6.6-3.3 1.7l1.3.9c.5-.8 1.4-1 2-1 .8 0 1.4.2 1.7.7.3.3.5.8.5 1.3-.7-.1-1.4-.2-2.2-.1-2.2.1-3.7 1.4-3.6 3.2 0 .9.5 1.7 1.3 2.2.7.4 1.5.6 2.4.6 1.2-.1 2.1-.5 2.7-1.3.5-.6.8-1.4.9-2.4.6.3 1 .8 1.2 1.3.4.9.4 2.4-.8 3.6-1.1 1.1-2.3 1.5-4.3 1.5-2.1 0-3.8-.7-4.8-2S5.7 14.3 5.7 12c0-2.3.5-4.1 1.5-5.4 1.1-1.3 2.7-2 4.8-2 2.2 0 3.8.7 4.9 2 .5.7.9 1.5 1.2 2.5l1.5-.4c-.3-1.2-.8-2.2-1.5-3.1-1.3-1.7-3.3-2.6-6-2.6-2.6 0-4.7.9-6 2.6C4.9 7.2 4.3 9.3 4.3 12s.6 4.8 1.9 6.4c1.4 1.7 3.4 2.6 6 2.6 2.3 0 4-.6 5.3-2 1.8-1.8 1.7-4 1.1-5.4-.4-.9-1.2-1.7-2.3-2.3zm-4 3.8c-1 .1-2-.4-2-1.3 0-.7.5-1.5 2.1-1.6h.5c.6 0 1.1.1 1.6.2-.2 2.3-1.3 2.7-2.2 2.7z"})});var m8=o(L(),1),mA=o(v(),1),Tle=()=>(0,mA.jsx)(m8.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,mA.jsx)(m8.Path,{d:"M12.4044 3.01519C13.4086 3 14.4072 3.009 15.4045 3C15.465 4.14812 15.8874 5.31762 16.7472 6.12935C17.6053 6.96134 18.819 7.34217 20 7.47099V10.4912C18.8933 10.4558 17.7814 10.2308 16.7771 9.76499C16.3397 9.57148 15.9323 9.32227 15.5334 9.06745C15.5283 11.2591 15.5426 13.4479 15.5191 15.6305C15.4592 16.679 15.1053 17.7225 14.4814 18.5866C13.4777 20.025 11.7356 20.9627 9.94635 20.992C8.84885 21.0533 7.7525 20.7608 6.81729 20.2219C5.26743 19.3286 4.17683 17.6933 4.01799 15.9382C3.99957 15.563 3.99324 15.1883 4.00878 14.8221C4.14691 13.395 4.86917 12.0297 5.99027 11.101C7.26101 10.0192 9.04107 9.50397 10.7078 9.80886C10.7233 10.9199 10.6778 12.0297 10.6778 13.1407C9.91643 12.9 9.02668 12.9675 8.36139 13.4192C7.87566 13.7269 7.50675 14.1983 7.31453 14.7316C7.15569 15.1118 7.20116 15.5343 7.21036 15.9382C7.3928 17.169 8.60368 18.2035 9.89628 18.0916C10.7532 18.0826 11.5745 17.5965 12.0211 16.8849C12.1655 16.6357 12.3273 16.3809 12.3359 16.0878C12.4113 14.7462 12.3814 13.4102 12.3906 12.0685C12.3969 9.04495 12.3814 6.02979 12.4049 3.01575L12.4044 3.01519Z"})});var p8=o(L(),1),pA=o(v(),1),Ple=()=>(0,pA.jsx)(p8.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,pA.jsx)(p8.Path,{d:"M17.04 21.28h-3.28c-2.84 0-4.94-1.37-4.94-5.02v-5.67H6.08V7.5c2.93-.73 4.11-3.3 4.3-5.48h3.01v4.93h3.47v3.65H13.4v4.93c0 1.47.73 2.01 1.92 2.01h1.73v3.75z"})});var d8=o(L(),1),dA=o(v(),1),Ble=()=>(0,dA.jsx)(d8.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,dA.jsx)(d8.Path,{d:"M16.499,8.089h-1.636v4.91h1.636V8.089z M12,8.089h-1.637v4.91H12V8.089z M4.228,3.178L3,6.451v13.092h4.499V22h2.456 l2.454-2.456h3.681L21,14.636V3.178H4.228z M19.364,13.816l-2.864,2.865H12l-2.453,2.453V16.68H5.863V4.814h13.501V13.816z"})});var f8=o(L(),1),fA=o(v(),1),Ile=()=>(0,fA.jsx)(f8.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,fA.jsx)(f8.Path,{d:"M22.23,5.924c-0.736,0.326-1.527,0.547-2.357,0.646c0.847-0.508,1.498-1.312,1.804-2.27 c-0.793,0.47-1.671,0.812-2.606,0.996C18.324,4.498,17.257,4,16.077,4c-2.266,0-4.103,1.837-4.103,4.103 c0,0.322,0.036,0.635,0.106,0.935C8.67,8.867,5.647,7.234,3.623,4.751C3.27,5.357,3.067,6.062,3.067,6.814 c0,1.424,0.724,2.679,1.825,3.415c-0.673-0.021-1.305-0.206-1.859-0.513c0,0.017,0,0.034,0,0.052c0,1.988,1.414,3.647,3.292,4.023 c-0.344,0.094-0.707,0.144-1.081,0.144c-0.264,0-0.521-0.026-0.772-0.074c0.522,1.63,2.038,2.816,3.833,2.85 c-1.404,1.1-3.174,1.756-5.096,1.756c-0.331,0-0.658-0.019-0.979-0.057c1.816,1.164,3.973,1.843,6.29,1.843 c7.547,0,11.675-6.252,11.675-11.675c0-0.178-0.004-0.355-0.012-0.531C20.985,7.47,21.68,6.747,22.23,5.924z"})});var h8=o(L(),1),hA=o(v(),1),Nle=()=>(0,hA.jsx)(h8.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,hA.jsx)(h8.Path,{d:"M22.396,7.164c-0.093,2.026-1.507,4.799-4.245,8.32C15.322,19.161,12.928,21,10.97,21c-1.214,0-2.24-1.119-3.079-3.359 c-0.56-2.053-1.119-4.106-1.68-6.159C5.588,9.243,4.921,8.122,4.206,8.122c-0.156,0-0.701,0.328-1.634,0.98L1.594,7.841 c1.027-0.902,2.04-1.805,3.037-2.708C6.001,3.95,7.03,3.327,7.715,3.264c1.619-0.156,2.616,0.951,2.99,3.321 c0.404,2.557,0.685,4.147,0.841,4.769c0.467,2.121,0.981,3.181,1.542,3.181c0.435,0,1.09-0.688,1.963-2.065 c0.871-1.376,1.338-2.422,1.401-3.142c0.125-1.187-0.343-1.782-1.401-1.782c-0.498,0-1.012,0.115-1.541,0.341 c1.023-3.35,2.977-4.977,5.862-4.884C21.511,3.066,22.52,4.453,22.396,7.164z"})});var g8=o(L(),1),gA=o(v(),1),Ele=()=>(0,gA.jsx)(g8.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,gA.jsx)(g8.Path,{d:"M22,7.1c0.2,0.4-0.4,1.5-1.6,3.1c-0.2,0.2-0.4,0.5-0.7,0.9c-0.5,0.7-0.9,1.1-0.9,1.4c-0.1,0.3-0.1,0.6,0.1,0.8 c0.1,0.1,0.4,0.4,0.8,0.9h0l0,0c1,0.9,1.6,1.7,2,2.3c0,0,0,0.1,0.1,0.1c0,0.1,0,0.1,0.1,0.3c0,0.1,0,0.2,0,0.4 c0,0.1-0.1,0.2-0.3,0.3c-0.1,0.1-0.4,0.1-0.6,0.1l-2.7,0c-0.2,0-0.4,0-0.6-0.1c-0.2-0.1-0.4-0.1-0.5-0.2l-0.2-0.1 c-0.2-0.1-0.5-0.4-0.7-0.7s-0.5-0.6-0.7-0.8c-0.2-0.2-0.4-0.4-0.6-0.6C14.8,15,14.6,15,14.4,15c0,0,0,0-0.1,0c0,0-0.1,0.1-0.2,0.2 c-0.1,0.1-0.2,0.2-0.2,0.3c-0.1,0.1-0.1,0.3-0.2,0.5c-0.1,0.2-0.1,0.5-0.1,0.8c0,0.1,0,0.2,0,0.3c0,0.1-0.1,0.2-0.1,0.2l0,0.1 c-0.1,0.1-0.3,0.2-0.6,0.2h-1.2c-0.5,0-1,0-1.5-0.2c-0.5-0.1-1-0.3-1.4-0.6s-0.7-0.5-1.1-0.7s-0.6-0.4-0.7-0.6l-0.3-0.3 c-0.1-0.1-0.2-0.2-0.3-0.3s-0.4-0.5-0.7-0.9s-0.7-1-1.1-1.6c-0.4-0.6-0.8-1.3-1.3-2.2C2.9,9.4,2.5,8.5,2.1,7.5C2,7.4,2,7.3,2,7.2 c0-0.1,0-0.1,0-0.2l0-0.1c0.1-0.1,0.3-0.2,0.6-0.2l2.9,0c0.1,0,0.2,0,0.2,0.1S5.9,6.9,5.9,7L6,7c0.1,0.1,0.2,0.2,0.3,0.3 C6.4,7.7,6.5,8,6.7,8.4C6.9,8.8,7,9,7.1,9.2l0.2,0.3c0.2,0.4,0.4,0.8,0.6,1.1c0.2,0.3,0.4,0.5,0.5,0.7s0.3,0.3,0.4,0.4 c0.1,0.1,0.3,0.1,0.4,0.1c0.1,0,0.2,0,0.3-0.1c0,0,0,0,0.1-0.1c0,0,0.1-0.1,0.1-0.2c0.1-0.1,0.1-0.3,0.1-0.5c0-0.2,0.1-0.5,0.1-0.8 c0-0.4,0-0.8,0-1.3c0-0.3,0-0.5-0.1-0.8c0-0.2-0.1-0.4-0.1-0.5L9.6,7.6C9.4,7.3,9.1,7.2,8.7,7.1C8.6,7.1,8.6,7,8.7,6.9 C8.9,6.7,9,6.6,9.1,6.5c0.4-0.2,1.2-0.3,2.5-0.3c0.6,0,1,0.1,1.4,0.1c0.1,0,0.3,0.1,0.3,0.1c0.1,0.1,0.2,0.1,0.2,0.3 c0,0.1,0.1,0.2,0.1,0.3s0,0.3,0,0.5c0,0.2,0,0.4,0,0.6c0,0.2,0,0.4,0,0.7c0,0.3,0,0.6,0,0.9c0,0.1,0,0.2,0,0.4c0,0.2,0,0.4,0,0.5 c0,0.1,0,0.3,0,0.4s0.1,0.3,0.1,0.4c0.1,0.1,0.1,0.2,0.2,0.3c0.1,0,0.1,0,0.2,0c0.1,0,0.2,0,0.3-0.1c0.1-0.1,0.2-0.2,0.4-0.4 s0.3-0.4,0.5-0.7c0.2-0.3,0.5-0.7,0.7-1.1c0.4-0.7,0.8-1.5,1.1-2.3c0-0.1,0.1-0.1,0.1-0.2c0-0.1,0.1-0.1,0.1-0.1l0,0l0.1,0 c0,0,0,0,0.1,0s0.2,0,0.2,0l3,0c0.3,0,0.5,0,0.7,0S21.9,7,21.9,7L22,7.1z"})});var v8=o(L(),1),vA=o(v(),1),Dle=()=>(0,vA.jsx)(v8.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,vA.jsx)(v8.Path,{d:"M 12.011719 2 C 6.5057187 2 2.0234844 6.478375 2.0214844 11.984375 C 2.0204844 13.744375 2.4814687 15.462563 3.3554688 16.976562 L 2 22 L 7.2324219 20.763672 C 8.6914219 21.559672 10.333859 21.977516 12.005859 21.978516 L 12.009766 21.978516 C 17.514766 21.978516 21.995047 17.499141 21.998047 11.994141 C 22.000047 9.3251406 20.962172 6.8157344 19.076172 4.9277344 C 17.190172 3.0407344 14.683719 2.001 12.011719 2 z M 12.009766 4 C 14.145766 4.001 16.153109 4.8337969 17.662109 6.3417969 C 19.171109 7.8517969 20.000047 9.8581875 19.998047 11.992188 C 19.996047 16.396187 16.413812 19.978516 12.007812 19.978516 C 10.674812 19.977516 9.3544062 19.642812 8.1914062 19.007812 L 7.5175781 18.640625 L 6.7734375 18.816406 L 4.8046875 19.28125 L 5.2851562 17.496094 L 5.5019531 16.695312 L 5.0878906 15.976562 C 4.3898906 14.768562 4.0204844 13.387375 4.0214844 11.984375 C 4.0234844 7.582375 7.6067656 4 12.009766 4 z M 8.4765625 7.375 C 8.3095625 7.375 8.0395469 7.4375 7.8105469 7.6875 C 7.5815469 7.9365 6.9355469 8.5395781 6.9355469 9.7675781 C 6.9355469 10.995578 7.8300781 12.182609 7.9550781 12.349609 C 8.0790781 12.515609 9.68175 15.115234 12.21875 16.115234 C 14.32675 16.946234 14.754891 16.782234 15.212891 16.740234 C 15.670891 16.699234 16.690438 16.137687 16.898438 15.554688 C 17.106437 14.971687 17.106922 14.470187 17.044922 14.367188 C 16.982922 14.263188 16.816406 14.201172 16.566406 14.076172 C 16.317406 13.951172 15.090328 13.348625 14.861328 13.265625 C 14.632328 13.182625 14.464828 13.140625 14.298828 13.390625 C 14.132828 13.640625 13.655766 14.201187 13.509766 14.367188 C 13.363766 14.534188 13.21875 14.556641 12.96875 14.431641 C 12.71875 14.305641 11.914938 14.041406 10.960938 13.191406 C 10.218937 12.530406 9.7182656 11.714844 9.5722656 11.464844 C 9.4272656 11.215844 9.5585938 11.079078 9.6835938 10.955078 C 9.7955938 10.843078 9.9316406 10.663578 10.056641 10.517578 C 10.180641 10.371578 10.223641 10.267562 10.306641 10.101562 C 10.389641 9.9355625 10.347156 9.7890625 10.285156 9.6640625 C 10.223156 9.5390625 9.737625 8.3065 9.515625 7.8125 C 9.328625 7.3975 9.131125 7.3878594 8.953125 7.3808594 C 8.808125 7.3748594 8.6425625 7.375 8.4765625 7.375 z"})});var b8=o(L(),1),bA=o(v(),1),Lle=()=>(0,bA.jsx)(b8.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:(0,bA.jsx)(b8.Path,{d:"M12.158,12.786L9.46,20.625c0.806,0.237,1.657,0.366,2.54,0.366c1.047,0,2.051-0.181,2.986-0.51 c-0.024-0.038-0.046-0.079-0.065-0.124L12.158,12.786z M3.009,12c0,3.559,2.068,6.634,5.067,8.092L3.788,8.341 C3.289,9.459,3.009,10.696,3.009,12z M18.069,11.546c0-1.112-0.399-1.881-0.741-2.48c-0.456-0.741-0.883-1.368-0.883-2.109 c0-0.826,0.627-1.596,1.51-1.596c0.04,0,0.078,0.005,0.116,0.007C16.472,3.904,14.34,3.009,12,3.009 c-3.141,0-5.904,1.612-7.512,4.052c0.211,0.007,0.41,0.011,0.579,0.011c0.94,0,2.396-0.114,2.396-0.114 C7.947,6.93,8.004,7.642,7.52,7.699c0,0-0.487,0.057-1.029,0.085l3.274,9.739l1.968-5.901l-1.401-3.838 C9.848,7.756,9.389,7.699,9.389,7.699C8.904,7.67,8.961,6.93,9.446,6.958c0,0,1.484,0.114,2.368,0.114 c0.94,0,2.397-0.114,2.397-0.114c0.485-0.028,0.542,0.684,0.057,0.741c0,0-0.488,0.057-1.029,0.085l3.249,9.665l0.897-2.996 C17.841,13.284,18.069,12.316,18.069,11.546z M19.889,7.686c0.039,0.286,0.06,0.593,0.06,0.924c0,0.912-0.171,1.938-0.684,3.22 l-2.746,7.94c2.673-1.558,4.47-4.454,4.47-7.771C20.991,10.436,20.591,8.967,19.889,7.686z M12,22C6.486,22,2,17.514,2,12 C2,6.486,6.486,2,12,2c5.514,0,10,4.486,10,10C22,17.514,17.514,22,12,22z"})});var y8=o(L(),1),yA=o(v(),1),Mle=()=>(0,yA.jsx)(y8.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,yA.jsx)(y8.Path,{d:"M13.982 10.622 20.54 3h-1.554l-5.693 6.618L8.745 3H3.5l6.876 10.007L3.5 21h1.554l6.012-6.989L15.868 21h5.245l-7.131-10.378Zm-2.128 2.474-.697-.997-5.543-7.93H8l4.474 6.4.697.996 5.815 8.318h-2.387l-4.745-6.787Z"})});var _8=o(L(),1),_A=o(v(),1),Ale=()=>(0,_A.jsx)(_8.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,_A.jsx)(_8.Path,{d:"M12.271,16.718v1.417q-.011,3.257-.067,3.4a.707.707,0,0,1-.569.446,4.637,4.637,0,0,1-2.024-.424A4.609,4.609,0,0,1,7.8,20.565a.844.844,0,0,1-.19-.4.692.692,0,0,1,.044-.29,3.181,3.181,0,0,1,.379-.524q.335-.412,2.019-2.409.011,0,.669-.781a.757.757,0,0,1,.44-.274.965.965,0,0,1,.552.039.945.945,0,0,1,.418.324.732.732,0,0,1,.139.468Zm-1.662-2.8a.783.783,0,0,1-.58.781l-1.339.435q-3.067.981-3.257.981a.711.711,0,0,1-.6-.4,2.636,2.636,0,0,1-.19-.836,9.134,9.134,0,0,1,.011-1.857,3.559,3.559,0,0,1,.335-1.389.659.659,0,0,1,.625-.357,22.629,22.629,0,0,1,2.253.859q.781.324,1.283.524l.937.379a.771.771,0,0,1,.4.34A.982.982,0,0,1,10.609,13.917Zm9.213,3.313a4.467,4.467,0,0,1-1.021,1.8,4.559,4.559,0,0,1-1.512,1.417.671.671,0,0,1-.7-.078q-.156-.112-2.052-3.2l-.524-.859a.761.761,0,0,1-.128-.513.957.957,0,0,1,.217-.513.774.774,0,0,1,.926-.29q.011.011,1.327.446,2.264.736,2.7.887a2.082,2.082,0,0,1,.524.229.673.673,0,0,1,.245.68Zm-7.5-7.049q.056,1.137-.6,1.361-.647.19-1.272-.792L6.237,4.08a.7.7,0,0,1,.212-.691,5.788,5.788,0,0,1,2.314-1,5.928,5.928,0,0,1,2.5-.352.681.681,0,0,1,.547.5q.034.2.245,3.407T12.327,10.181Zm7.384,1.2a.679.679,0,0,1-.29.658q-.167.112-3.67.959-.747.167-1.015.257l.011-.022a.769.769,0,0,1-.513-.044.914.914,0,0,1-.413-.357.786.786,0,0,1,0-.971q.011-.011.836-1.137,1.394-1.908,1.673-2.275a2.423,2.423,0,0,1,.379-.435A.7.7,0,0,1,17.435,8a4.482,4.482,0,0,1,1.372,1.489,4.81,4.81,0,0,1,.9,1.868v.034Z"})});var x8=o(L(),1),xA=o(v(),1),Rle=()=>(0,xA.jsx)(x8.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,xA.jsx)(x8.Path,{d:"M21.8,8.001c0,0-0.195-1.378-0.795-1.985c-0.76-0.797-1.613-0.801-2.004-0.847c-2.799-0.202-6.997-0.202-6.997-0.202 h-0.009c0,0-4.198,0-6.997,0.202C4.608,5.216,3.756,5.22,2.995,6.016C2.395,6.623,2.2,8.001,2.2,8.001S2,9.62,2,11.238v1.517 c0,1.618,0.2,3.237,0.2,3.237s0.195,1.378,0.795,1.985c0.761,0.797,1.76,0.771,2.205,0.855c1.6,0.153,6.8,0.201,6.8,0.201 s4.203-0.006,7.001-0.209c0.391-0.047,1.243-0.051,2.004-0.847c0.6-0.607,0.795-1.985,0.795-1.985s0.2-1.618,0.2-3.237v-1.517 C22,9.62,21.8,8.001,21.8,8.001z M9.935,14.594l-0.001-5.62l5.404,2.82L9.935,14.594z"})});function zle(e){return e?.name?{icon:e?.icon??O2,label:e?.title??(0,kA.__)("Social Icon")}:{icon:O2,label:(0,kA.__)("Social Icon")}}var Zt=o(v(),1),J4e=({url:e,setAttributes:t,setPopover:r,popoverAnchor:a,clientId:n})=>{let{removeBlock:i}=(0,k8.useDispatch)(gn.store);return(0,Zt.jsx)(gn.URLPopover,{anchor:a,"aria-label":(0,Zn.__)("Edit social link"),onClose:()=>{r(!1),a?.focus()},children:(0,Zt.jsx)("form",{className:"block-editor-url-popover__link-editor",onSubmit:l=>{l.preventDefault(),r(!1),a?.focus()},children:(0,Zt.jsx)("div",{className:"block-editor-url-input",children:(0,Zt.jsx)(gn.URLInput,{value:e,onChange:l=>t({url:l}),placeholder:(0,Zn.__)("Enter social link"),label:(0,Zn.__)("Enter social link"),hideLabelFromVision:!0,disableSuggestions:!0,onKeyDown:l=>{e||l.defaultPrevented||![Fg.BACKSPACE,Fg.DELETE].includes(l.keyCode)||i(n)},suffix:(0,Zt.jsx)(lo.__experimentalInputControlSuffixWrapper,{variant:"control",children:(0,Zt.jsx)(lo.Button,{icon:gT,label:(0,Zn.__)("Apply"),type:"submit",size:"small"})})})})})})},e3e=({attributes:e,context:t,isSelected:r,setAttributes:a,clientId:n,name:i})=>{let{url:l,service:s,label:c="",rel:u}=e,m=q(),{showLabels:p,iconColor:d,iconColorValue:f,iconBackgroundColor:h,iconBackgroundColorValue:g}=t,[b,y]=(0,tf.useState)(!1),k=w("wp-social-link","wp-block-social-link","wp-social-link-"+s,{"wp-social-link__is-incomplete":!l,[`has-${d}-color`]:d,[`has-${h}-background-color`]:h}),[_,x]=(0,tf.useState)(null),S=(0,gn.useBlockEditingMode)()==="contentOnly",{activeVariation:C}=(0,k8.useSelect)(F=>{let{getActiveBlockVariation:z}=F(Fle.store);return{activeVariation:z(i,e)}},[i,e]),{icon:N,label:B}=zle(C),D=c.trim()===""?B:c,A=(0,tf.useRef)(),H=(0,gn.useBlockProps)({className:"wp-block-social-link-anchor",ref:(0,Vle.useMergeRefs)([x,A]),onClick:()=>y(!0),onKeyDown:F=>{F.keyCode===Fg.ENTER&&(F.preventDefault(),y(!0))}});return(0,Zt.jsxs)(Zt.Fragment,{children:[S&&p&&(0,Zt.jsx)(gn.BlockControls,{group:"other",children:(0,Zt.jsx)(lo.Dropdown,{popoverProps:{placement:"bottom-start"},renderToggle:({isOpen:F,onToggle:z})=>(0,Zt.jsx)(lo.ToolbarButton,{onClick:z,"aria-haspopup":"true","aria-expanded":F,children:(0,Zn.__)("Text")}),renderContent:()=>(0,Zt.jsx)(lo.TextControl,{__next40pxDefaultSize:!0,className:"wp-block-social-link__toolbar_content_text",label:(0,Zn.__)("Text"),help:(0,Zn.__)("Provide a text label or use the default."),value:c,onChange:F=>a({label:F}),placeholder:B})})}),(0,Zt.jsx)(gn.InspectorControls,{children:(0,Zt.jsx)(lo.__experimentalToolsPanel,{label:(0,Zn.__)("Settings"),resetAll:()=>{a({label:void 0})},dropdownMenuProps:m,children:(0,Zt.jsx)(lo.__experimentalToolsPanelItem,{isShownByDefault:!0,label:(0,Zn.__)("Text"),hasValue:()=>!!c,onDeselect:()=>{a({label:void 0})},children:(0,Zt.jsx)(lo.TextControl,{__next40pxDefaultSize:!0,label:(0,Zn.__)("Text"),help:(0,Zn.__)("The text is visible when enabled from the parent Social Icons block."),value:c,onChange:F=>a({label:F}),placeholder:B})})})}),(0,Zt.jsx)(gn.InspectorControls,{group:"advanced",children:(0,Zt.jsx)(lo.TextControl,{__next40pxDefaultSize:!0,label:(0,Zn.__)("Link relation"),help:(0,tf.createInterpolateElement)((0,Zn.__)("The <a>Link Relation</a> attribute defines the relationship between a linked resource and the current document."),{a:(0,Zt.jsx)(lo.ExternalLink,{href:"https://developer.mozilla.org/docs/Web/HTML/Attributes/rel"})}),value:u||"",onChange:F=>a({rel:F})})}),(0,Zt.jsxs)("li",{role:"presentation",className:k,style:{color:f,backgroundColor:g},children:[(0,Zt.jsxs)("button",{"aria-haspopup":"dialog",...H,role:"button",children:[(0,Zt.jsx)(lo.Icon,{icon:N}),(0,Zt.jsx)("span",{className:w("wp-block-social-link-label",{"screen-reader-text":!p}),children:D})]}),r&&b&&(0,Zt.jsx)(J4e,{url:l,setAttributes:a,setPopover:y,popoverAnchor:_,clientId:n})]})]})},Hle=e3e;var w8={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/social-link",title:"Social Icon",category:"widgets",parent:["core/social-links"],description:"Display an icon linking to a social profile or site.",textdomain:"default",attributes:{url:{type:"string",role:"content"},service:{type:"string"},label:{type:"string",role:"content"},rel:{type:"string"}},usesContext:["openInNewTab","showLabels","iconColor","iconColorValue","iconBackgroundColor","iconBackgroundColorValue"],supports:{anchor:!0,reusable:!1,html:!1,interactivity:{clientNavigation:!0}},editorStyle:"wp-block-social-link-editor"};var Be=o(P(),1);var Ole=[{isDefault:!0,name:"wordpress",attributes:{service:"wordpress"},title:(0,Be._x)("WordPress","social link block variation name"),icon:Lle},{name:"fivehundredpx",attributes:{service:"fivehundredpx"},title:(0,Be._x)("500px","social link block variation name"),icon:rle},{name:"amazon",attributes:{service:"amazon"},title:(0,Be._x)("Amazon","social link block variation name"),icon:Gie},{name:"bandcamp",attributes:{service:"bandcamp"},title:(0,Be._x)("Bandcamp","social link block variation name"),icon:Wie},{name:"behance",attributes:{service:"behance"},title:(0,Be._x)("Behance","social link block variation name"),icon:$ie},{name:"bluesky",attributes:{service:"bluesky"},title:(0,Be._x)("Bluesky","social link block variation name"),icon:qie},{name:"chain",attributes:{service:"chain"},title:(0,Be._x)("Link","social link block variation name"),icon:O2},{name:"codepen",attributes:{service:"codepen"},title:(0,Be._x)("CodePen","social link block variation name"),icon:Zie},{name:"deviantart",attributes:{service:"deviantart"},title:(0,Be._x)("DeviantArt","social link block variation name"),icon:Kie},{name:"discord",attributes:{service:"discord"},title:(0,Be._x)("Discord","social link block variation name"),icon:Qie},{name:"dribbble",attributes:{service:"dribbble"},title:(0,Be._x)("Dribbble","social link block variation name"),icon:Yie},{name:"dropbox",attributes:{service:"dropbox"},title:(0,Be._x)("Dropbox","social link block variation name"),icon:Xie},{name:"etsy",attributes:{service:"etsy"},title:(0,Be._x)("Etsy","social link block variation name"),icon:Jie},{name:"facebook",attributes:{service:"facebook"},title:(0,Be._x)("Facebook","social link block variation name"),icon:ele},{name:"feed",attributes:{service:"feed"},title:(0,Be._x)("RSS Feed","social link block variation name"),icon:tle},{name:"flickr",attributes:{service:"flickr"},title:(0,Be._x)("Flickr","social link block variation name"),icon:ole},{name:"foursquare",attributes:{service:"foursquare"},title:(0,Be._x)("Foursquare","social link block variation name"),icon:ale},{name:"goodreads",attributes:{service:"goodreads"},title:(0,Be._x)("Goodreads","social link block variation name"),icon:nle},{name:"google",attributes:{service:"google"},title:(0,Be._x)("Google","social link block variation name"),icon:ile},{name:"github",attributes:{service:"github"},title:(0,Be._x)("GitHub","social link block variation name"),icon:lle},{name:"gravatar",attributes:{service:"gravatar"},title:(0,Be._x)("Gravatar","social link block variation name"),icon:sle},{name:"instagram",attributes:{service:"instagram"},title:(0,Be._x)("Instagram","social link block variation name"),icon:cle},{name:"lastfm",attributes:{service:"lastfm"},title:(0,Be._x)("Last.fm","social link block variation name"),icon:ule},{name:"linkedin",attributes:{service:"linkedin"},title:(0,Be._x)("LinkedIn","social link block variation name"),icon:mle},{name:"mail",attributes:{service:"mail"},title:(0,Be._x)("Mail","social link block variation name"),keywords:["email","e-mail"],icon:ple},{name:"mastodon",attributes:{service:"mastodon"},title:(0,Be._x)("Mastodon","social link block variation name"),icon:dle},{name:"meetup",attributes:{service:"meetup"},title:(0,Be._x)("Meetup","social link block variation name"),icon:fle},{name:"medium",attributes:{service:"medium"},title:(0,Be._x)("Medium","social link block variation name"),icon:hle},{name:"patreon",attributes:{service:"patreon"},title:(0,Be._x)("Patreon","social link block variation name"),icon:gle},{name:"pinterest",attributes:{service:"pinterest"},title:(0,Be._x)("Pinterest","social link block variation name"),icon:vle},{name:"pocket",attributes:{service:"pocket"},title:(0,Be._x)("Pocket","social link block variation name"),icon:ble},{name:"reddit",attributes:{service:"reddit"},title:(0,Be._x)("Reddit","social link block variation name"),icon:yle},{name:"skype",attributes:{service:"skype"},title:(0,Be._x)("Skype","social link block variation name"),icon:_le,scope:[]},{name:"snapchat",attributes:{service:"snapchat"},title:(0,Be._x)("Snapchat","social link block variation name"),icon:xle},{name:"soundcloud",attributes:{service:"soundcloud"},title:(0,Be._x)("SoundCloud","social link block variation name"),icon:kle},{name:"spotify",attributes:{service:"spotify"},title:(0,Be._x)("Spotify","social link block variation name"),icon:wle},{name:"telegram",attributes:{service:"telegram"},title:(0,Be._x)("Telegram","social link block variation name"),icon:Cle},{name:"threads",attributes:{service:"threads"},title:(0,Be._x)("Threads","social link block variation name"),icon:Sle},{name:"tiktok",attributes:{service:"tiktok"},title:(0,Be._x)("TikTok","social link block variation name"),icon:Tle},{name:"tumblr",attributes:{service:"tumblr"},title:(0,Be._x)("Tumblr","social link block variation name"),icon:Ple},{name:"twitch",attributes:{service:"twitch"},title:(0,Be._x)("Twitch","social link block variation name"),icon:Ble},{name:"twitter",attributes:{service:"twitter"},title:(0,Be._x)("Twitter","social link block variation name"),icon:Ile},{name:"vimeo",attributes:{service:"vimeo"},title:(0,Be._x)("Vimeo","social link block variation name"),icon:Nle},{name:"vk",attributes:{service:"vk"},title:(0,Be._x)("VK","social link block variation name"),icon:Ele},{name:"whatsapp",attributes:{service:"whatsapp"},title:(0,Be._x)("WhatsApp","social link block variation name"),icon:Dle},{name:"x",attributes:{service:"x"},keywords:["twitter"],title:(0,Be._x)("X","social link block variation name"),icon:Mle},{name:"yelp",attributes:{service:"yelp"},title:(0,Be._x)("Yelp","social link block variation name"),icon:Ale},{name:"youtube",attributes:{service:"youtube"},title:(0,Be._x)("YouTube","social link block variation name"),icon:Rle}];Ole.forEach(e=>{e.isActive||(e.isActive=(t,r)=>t.service===r.service)});var jle=Ole;var{fieldsKey:r3e,formKey:o3e}=K(Ule.privateApis),{name:Gle}=w8,C8={icon:s1,edit:Hle,variations:jle};window.__experimentalContentOnlyInspectorFields&&(C8[r3e]=[{id:"link",label:(0,wA.__)("Link"),type:"url",Edit:"link",getValue:({item:e})=>({url:e.url,rel:e.rel}),setValue:({value:e})=>({url:e.url,rel:e.rel})},{id:"label",label:(0,wA.__)("Label"),type:"text"}],C8[o3e]={fields:["link","label"]});var a3e=()=>E({name:Gle,metadata:w8,settings:C8});var TA={};Z(TA,{init:()=>m3e,metadata:()=>T8,name:()=>Yle,settings:()=>Xle});var S8=o(T(),1),SA=o(v(),1),n3e=e=>{if(e.layout)return e;let{className:t}=e,r="items-justified-",a=new RegExp(`\\b${r}[^ ]*[ ]?\\b`,"g"),n={...e,className:t?.replace(a,"").trim()},i=t?.match(a)?.[0]?.trim();return i&&Object.assign(n,{layout:{type:"flex",justifyContent:i.slice(r.length)}}),n},i3e=[{attributes:{iconColor:{type:"string"},customIconColor:{type:"string"},iconColorValue:{type:"string"},iconBackgroundColor:{type:"string"},customIconBackgroundColor:{type:"string"},iconBackgroundColorValue:{type:"string"},openInNewTab:{type:"boolean",default:!1},size:{type:"string"}},providesContext:{openInNewTab:"openInNewTab"},supports:{align:["left","center","right"],anchor:!0},migrate:n3e,save:e=>{let{attributes:{iconBackgroundColorValue:t,iconColorValue:r,itemsJustification:a,size:n}}=e,i=w(n,{"has-icon-color":r,"has-icon-background-color":t,[`items-justified-${a}`]:a}),l={"--wp--social-links--icon-color":r,"--wp--social-links--icon-background-color":t};return(0,SA.jsx)("ul",{...S8.useBlockProps.save({className:i,style:l}),children:(0,SA.jsx)(S8.InnerBlocks.Content,{})})}}],Wle=i3e;var $le=o(U(),1),xo=o(T(),1),ds=o(M(),1),vn=o(P(),1),qle=o(V(),1);var da=o(v(),1),l3e=[{label:(0,vn.__)("Default"),value:""},{label:(0,vn.__)("Small"),value:"has-small-icon-size"},{label:(0,vn.__)("Normal"),value:"has-normal-icon-size"},{label:(0,vn.__)("Large"),value:"has-large-icon-size"},{label:(0,vn.__)("Huge"),value:"has-huge-icon-size"}];function s3e(e){let{clientId:t,attributes:r,iconBackgroundColor:a,iconColor:n,isSelected:i,setAttributes:l,setIconBackgroundColor:s,setIconColor:c}=e,{iconBackgroundColorValue:u,iconColorValue:m,openInNewTab:p,showLabels:d,size:f}=r,{hasSocialIcons:h,hasSelectedChild:g}=(0,qle.useSelect)(B=>{let{getBlockCount:D,hasSelectedInnerBlock:A}=B(xo.store);return{hasSocialIcons:D(t)>0,hasSelectedChild:A(t)}},[t]),b=i||g,y=r.className?.includes("is-style-logos-only"),k=q();(0,$le.useEffect)(()=>{if(y){let B;return l(D=>(B={iconBackgroundColor:D.iconBackgroundColor,iconBackgroundColorValue:D.iconBackgroundColorValue,customIconBackgroundColor:D.customIconBackgroundColor},{iconBackgroundColor:void 0,iconBackgroundColorValue:void 0,customIconBackgroundColor:void 0})),()=>l({...B})}},[y,l]);let _=w(f,{"has-visible-labels":d,"has-icon-color":n.color||m,"has-icon-background-color":a.color||u}),x=(0,xo.useBlockProps)({className:_}),S=(0,xo.useInnerBlocksProps)(x,{templateLock:!1,orientation:r.layout?.orientation??"horizontal",__experimentalAppenderTagName:"li",renderAppender:!h||b?xo.InnerBlocks.ButtonBlockAppender:void 0}),C=[{value:n.color||m,onChange:B=>{c(B),l({iconColorValue:B})},label:(0,vn.__)("Icon color"),resetAllFilter:()=>{c(void 0),l({iconColorValue:void 0})}}];y||C.push({value:a.color||u,onChange:B=>{s(B),l({iconBackgroundColorValue:B})},label:(0,vn.__)("Icon background"),resetAllFilter:()=>{s(void 0),l({iconBackgroundColorValue:void 0})}});let N=(0,xo.__experimentalUseMultipleOriginColorsAndGradients)();return(0,da.jsxs)(da.Fragment,{children:[(0,da.jsx)(xo.InspectorControls,{children:(0,da.jsxs)(ds.__experimentalToolsPanel,{label:(0,vn.__)("Settings"),resetAll:()=>{l({openInNewTab:!1,showLabels:!1,size:void 0})},dropdownMenuProps:k,children:[(0,da.jsx)(ds.__experimentalToolsPanelItem,{isShownByDefault:!0,hasValue:()=>!!f,label:(0,vn.__)("Icon size"),onDeselect:()=>l({size:void 0}),children:(0,da.jsx)(ds.SelectControl,{__next40pxDefaultSize:!0,label:(0,vn.__)("Icon size"),onChange:B=>{l({size:B===""?void 0:B})},value:f??"",options:l3e})}),(0,da.jsx)(ds.__experimentalToolsPanelItem,{isShownByDefault:!0,label:(0,vn.__)("Show text"),hasValue:()=>!!d,onDeselect:()=>l({showLabels:!1}),children:(0,da.jsx)(ds.ToggleControl,{label:(0,vn.__)("Show text"),checked:d,onChange:()=>l({showLabels:!d})})}),(0,da.jsx)(ds.__experimentalToolsPanelItem,{isShownByDefault:!0,label:(0,vn.__)("Open links in new tab"),hasValue:()=>!!p,onDeselect:()=>l({openInNewTab:!1}),children:(0,da.jsx)(ds.ToggleControl,{label:(0,vn.__)("Open links in new tab"),checked:p,onChange:()=>l({openInNewTab:!p})})})]})}),N.hasColorsOrGradients&&(0,da.jsxs)(xo.InspectorControls,{group:"color",children:[C.map(({onChange:B,label:D,value:A,resetAllFilter:H})=>(0,da.jsx)(xo.__experimentalColorGradientSettingsDropdown,{__experimentalIsRenderedInSidebar:!0,settings:[{colorValue:A,label:D,onColorChange:B,isShownByDefault:!0,resetAllFilter:H,enableAlpha:!0,clearable:!0}],panelId:t,...N},`social-links-color-${D}`)),!y&&(0,da.jsx)(xo.ContrastChecker,{textColor:m,backgroundColor:u,isLargeText:!1})]}),(0,da.jsx)("ul",{...S})]})}var c3e={iconColor:"icon-color",iconBackgroundColor:"icon-background-color"},Zle=(0,xo.withColors)(c3e)(s3e);var T8={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/social-links",title:"Social Icons",category:"widgets",allowedBlocks:["core/social-link"],description:"Display icons linking to your social profiles or sites.",keywords:["links"],textdomain:"default",attributes:{iconColor:{type:"string"},customIconColor:{type:"string"},iconColorValue:{type:"string"},iconBackgroundColor:{type:"string"},customIconBackgroundColor:{type:"string"},iconBackgroundColorValue:{type:"string"},openInNewTab:{type:"boolean",default:!1},showLabels:{type:"boolean",default:!1},size:{type:"string"}},providesContext:{openInNewTab:"openInNewTab",showLabels:"showLabels",iconColor:"iconColor",iconColorValue:"iconColorValue",iconBackgroundColor:"iconBackgroundColor",iconBackgroundColorValue:"iconBackgroundColorValue"},supports:{align:["left","center","right"],anchor:!0,html:!1,__experimentalExposeControlsToChildren:!0,layout:{allowSwitching:!1,allowInheriting:!1,allowVerticalAlignment:!1,default:{type:"flex"}},color:{enableContrastChecker:!1,background:!0,gradients:!0,text:!1,__experimentalDefaultControls:{background:!1}},spacing:{blockGap:["horizontal","vertical"],margin:!0,padding:!0,units:["px","em","rem","vh","vw"],__experimentalDefaultControls:{blockGap:!0,margin:!0,padding:!1}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}},contentRole:!0,listView:!0},styles:[{name:"default",label:"Default",isDefault:!0},{name:"logos-only",label:"Logos Only"},{name:"pill-shape",label:"Pill Shape"}],editorStyle:"wp-block-social-links-editor",style:"wp-block-social-links"};var P8=o(T(),1),Kle=o(v(),1);function Qle(e){let{attributes:{iconBackgroundColorValue:t,iconColorValue:r,showLabels:a,size:n}}=e,i=w(n,{"has-visible-labels":a,"has-icon-color":r,"has-icon-background-color":t}),l=P8.useBlockProps.save({className:i}),s=P8.useInnerBlocksProps.save(l);return(0,Kle.jsx)("ul",{...s})}var{name:Yle}=T8,Xle={example:{innerBlocks:[{name:"core/social-link",attributes:{service:"wordpress",url:"https://wordpress.org"}},{name:"core/social-link",attributes:{service:"facebook",url:"https://www.facebook.com/WordPress/"}},{name:"core/social-link",attributes:{service:"twitter",url:"https://twitter.com/WordPress"}}]},icon:s1,edit:Zle,save:Qle,deprecated:Wle},m3e=()=>E({name:Yle,metadata:T8,settings:Xle});var PA={};Z(PA,{init:()=>b3e,metadata:()=>I8,name:()=>fse,settings:()=>hse});var Jle=o(T(),1),ese=o(v(),1),p3e=[{attributes:{height:{type:"number",default:100},width:{type:"number"}},migrate(e){let{height:t,width:r}=e;return{...e,width:r!==void 0?`${r}px`:void 0,height:t!==void 0?`${t}px`:void 0}},save({attributes:e}){return(0,ese.jsx)("div",{...Jle.useBlockProps.save({style:{height:e.height,width:e.width},"aria-hidden":!0})})}}],tse=p3e;var fa=o(T(),1),lse=o(M(),1),Og=o(U(),1),sse=o(L(),1),B8=o(V(),1);var Hg=o(P(),1),Tc=o(T(),1),bl=o(M(),1),ose=o(me(),1),ase=o(L(),1);var j2=0;var Kn=o(v(),1),{useSpacingSizes:d3e}=K(Tc.privateApis);function rse({label:e,onChange:t,isResizing:r,value:a=""}){let n=(0,ose.useInstanceId)(bl.__experimentalUnitControl,"block-spacer-height-input"),i=d3e(),[l]=(0,Tc.useSettings)("spacing.units"),s=l?l.filter(d=>d!=="%"):["px","em","rem","vw","vh"],c=(0,bl.__experimentalUseCustomUnits)({availableUnits:s,defaultValues:{px:100,em:10,rem:10,vw:10,vh:25}}),[u,m]=(0,bl.__experimentalParseQuantityAndUnitFromRawValue)(a),p=(0,Tc.isValueSpacingPreset)(a)?a:[u,r?"px":m].join("");return(0,Kn.jsx)(Kn.Fragment,{children:i?.length<2?(0,Kn.jsx)(bl.__experimentalUnitControl,{id:n,isResetValueOnUnitChange:!0,min:j2,onChange:t,value:p,units:c,label:e,__next40pxDefaultSize:!0}):(0,Kn.jsx)(ase.View,{className:"tools-panel-item-spacing",children:(0,Kn.jsx)(Tc.__experimentalSpacingSizesControl,{values:{all:p},onChange:({all:d})=>{t(d)},label:e,sides:["all"],units:c,allowReset:!1,splitOnAxis:!1,showSideInLabel:!1})})})}function nse({setAttributes:e,orientation:t,height:r,width:a,isResizing:n}){let i=q();return(0,Kn.jsx)(Tc.InspectorControls,{children:(0,Kn.jsxs)(bl.__experimentalToolsPanel,{label:(0,Hg.__)("Settings"),resetAll:()=>{e({width:void 0,height:"100px"})},dropdownMenuProps:i,children:[t==="horizontal"&&(0,Kn.jsx)(bl.__experimentalToolsPanelItem,{label:(0,Hg.__)("Width"),isShownByDefault:!0,hasValue:()=>a!==void 0,onDeselect:()=>e({width:void 0}),children:(0,Kn.jsx)(rse,{label:(0,Hg.__)("Width"),value:a,onChange:l=>e({width:l}),isResizing:n})}),t!=="horizontal"&&(0,Kn.jsx)(bl.__experimentalToolsPanelItem,{label:(0,Hg.__)("Height"),isShownByDefault:!0,hasValue:()=>r!=="100px",onDeselect:()=>e({height:"100px"}),children:(0,Kn.jsx)(rse,{label:(0,Hg.__)("Height"),value:r,onChange:l=>e({height:l}),isResizing:n})})]})})}var yl=o(v(),1),{useSpacingSizes:f3e}=K(fa.privateApis),ise=({orientation:e,onResizeStart:t,onResize:r,onResizeStop:a,isSelected:n,isResizing:i,setIsResizing:l,...s})=>{let c=m=>e==="horizontal"?m.clientWidth:m.clientHeight,u=m=>`${c(m)}px`;return(0,yl.jsx)(lse.ResizableBox,{className:w("block-library-spacer__resize-container",{"resize-horizontal":e==="horizontal","is-resizing":i,"is-selected":n}),onResizeStart:(m,p,d)=>{let f=u(d);t(f),r(f)},onResize:(m,p,d)=>{r(u(d)),i||l(!0)},onResizeStop:(m,p,d)=>{let f=c(d);a(`${f}px`),l(!1)},__experimentalShowTooltip:!0,__experimentalTooltipProps:{axis:e==="horizontal"?"x":"y",position:"corner",isVisible:i},showHandle:n,...s})},h3e=({attributes:e,isSelected:t,setAttributes:r,toggleSelection:a,context:n,__unstableParentLayout:i,className:l})=>{let s=(0,B8.useSelect)(oe=>oe(fa.store).getSettings()?.disableCustomSpacingSizes),{orientation:c}=n,{orientation:u,type:m,default:{type:p}={}}=i||{},d=m==="flex"||!m&&p==="flex",f=!u&&d?"horizontal":u||c,{height:h,width:g,style:b={}}=e,{layout:y={}}=b,{selfStretch:k,flexSize:_}=y,x=f3e(),[S,C]=(0,Og.useState)(!1),[N,B]=(0,Og.useState)(null),[D,A]=(0,Og.useState)(null),H=()=>a(!1),F=()=>a(!0),{__unstableMarkNextChangeAsNotPersistent:z}=(0,B8.useDispatch)(fa.store),I=oe=>{F(),d&&r({style:{...b,layout:{...y,flexSize:oe,selfStretch:"fixed"}}}),r({height:oe}),B(null)},R=oe=>{F(),d&&r({style:{...b,layout:{...y,flexSize:oe,selfStretch:"fixed"}}}),r({width:oe}),A(null)},$=()=>{if(!d)return N||(0,fa.getSpacingPresetCssVar)(h)||void 0},j=()=>{if(!d)return D||(0,fa.getSpacingPresetCssVar)(g)||void 0},G=f==="horizontal"?D||_:N||_,O={height:f==="horizontal"?24:$(),width:f==="horizontal"?j():void 0,minWidth:f==="vertical"&&d?48:void 0,flexBasis:d?G:void 0,flexGrow:d&&S?0:void 0},J=oe=>oe==="horizontal"?(0,yl.jsx)(ise,{minWidth:j2,enable:{top:!1,right:!0,bottom:!1,left:!1,topRight:!1,bottomRight:!1,bottomLeft:!1,topLeft:!1},orientation:oe,onResizeStart:H,onResize:A,onResizeStop:R,isSelected:t,isResizing:S,setIsResizing:C}):(0,yl.jsx)(yl.Fragment,{children:(0,yl.jsx)(ise,{minHeight:j2,enable:{top:!1,right:!1,bottom:!0,left:!1,topRight:!1,bottomRight:!1,bottomLeft:!1,topLeft:!1},orientation:oe,onResizeStart:H,onResize:B,onResizeStop:I,isSelected:t,isResizing:S,setIsResizing:C})});(0,Og.useEffect)(()=>{let oe=X=>{z(),r(X)};if(d&&k!=="fill"&&k!=="fit"&&_===void 0)if(f==="horizontal"){let X=(0,fa.getCustomValueFromPreset)(g,x)||(0,fa.getCustomValueFromPreset)(h,x)||"100px";oe({width:"0px",style:{...b,layout:{...y,flexSize:X,selfStretch:"fixed"}}})}else{let X=(0,fa.getCustomValueFromPreset)(h,x)||(0,fa.getCustomValueFromPreset)(g,x)||"100px";oe({height:"0px",style:{...b,layout:{...y,flexSize:X,selfStretch:"fixed"}}})}else d&&(k==="fill"||k==="fit")?oe(f==="horizontal"?{width:void 0}:{height:void 0}):!d&&(k||_)&&oe({...f==="horizontal"?{width:_}:{height:_},style:{...b,layout:{...y,flexSize:void 0,selfStretch:void 0}}})},[b,_,h,f,d,y,k,r,x,g,z]);let ee=(0,fa.useBlockEditingMode)();return(0,yl.jsxs)(yl.Fragment,{children:[(0,yl.jsx)(sse.View,{...(0,fa.useBlockProps)({style:O,className:w(l,{"custom-sizes-disabled":s})}),children:ee==="default"&&J(f)}),!d&&(0,yl.jsx)(nse,{setAttributes:r,height:N||h,width:D||g,orientation:f,isResizing:S})]})},cse=h3e;var I8={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/spacer",title:"Spacer",category:"design",description:"Add white space between blocks and customize its height.",textdomain:"default",attributes:{height:{type:"string",default:"100px"},width:{type:"string"}},usesContext:["orientation"],supports:{anchor:!0,spacing:{margin:["top","bottom"],__experimentalDefaultControls:{margin:!0}},interactivity:{clientNavigation:!0}},editorStyle:"wp-block-spacer-editor",style:"wp-block-spacer"};var use=o(W(),1),v3e={to:[{type:"block",blocks:["core/separator"],transform:({anchor:e})=>(0,use.createBlock)("core/separator",{anchor:e||void 0})}]},mse=v3e;var U2=o(T(),1),pse=o(v(),1);function dse({attributes:e}){let{height:t,width:r,style:a}=e,{layout:{selfStretch:n}={}}=a||{},i=n==="fill"||n==="fit"?void 0:t;return(0,pse.jsx)("div",{...U2.useBlockProps.save({style:{height:(0,U2.getSpacingPresetCssVar)(i),width:(0,U2.getSpacingPresetCssVar)(r)},"aria-hidden":!0})})}var{name:fse}=I8,hse={icon:OP,transforms:mse,edit:cse,save:dse,deprecated:tse},b3e=()=>E({name:fse,metadata:I8,settings:hse});var BA={};Z(BA,{init:()=>k3e,metadata:()=>j8,name:()=>Sse,settings:()=>Tse});var xse=o(P(),1),rf=o(T(),1),F8=o(V(),1),Nu=o(U(),1);var z8=o(T(),1),jg=o(M(),1),R8=o(P(),1),bse=o(V(),1);var G2=o(P(),1),gse=o(W(),1),W2=o(T(),1),E8=o(M(),1),D8=o(V(),1),N8=o(v(),1);function fs({tabsClientId:e}){let{insertBlock:t}=(0,D8.useDispatch)(W2.store),{tabPanelClientId:r,nextTabIndex:a}=(0,D8.useSelect)(i=>{if(!e)return{tabPanelClientId:null,nextTabIndex:0};let{getBlocks:l}=i(W2.store),c=l(e).find(u=>u.name==="core/tab-panel");return{tabPanelClientId:c?.clientId||null,nextTabIndex:(c?.innerBlocks.length||0)+1}},[e]);return(0,N8.jsx)(W2.BlockControls,{group:"other",children:(0,N8.jsx)(E8.ToolbarGroup,{children:(0,N8.jsx)(E8.ToolbarButton,{className:"components-toolbar__control",onClick:()=>{if(!r)return;let i=(0,gse.createBlock)("core/tab",{anchor:"tab-"+a,label:(0,G2.sprintf)((0,G2.__)("Tab %d"),a)});t(i,void 0,r)},text:(0,G2.__)("Add tab")})})})}var $2=o(T(),1),M8=o(M(),1),vse=o(P(),1),A8=o(V(),1),L8=o(v(),1);function hs({tabsClientId:e}){let{removeBlock:t,updateBlockAttributes:r,selectBlock:a,__unstableMarkNextChangeAsNotPersistent:n}=(0,A8.useDispatch)($2.store),{activeTabClientId:i,tabCount:l,editorActiveTabIndex:s}=(0,A8.useSelect)(m=>{if(!e)return{activeTabClientId:null,tabCount:0,editorActiveTabIndex:0};let{getBlocks:p,getBlockAttributes:d}=m($2.store),f=d(e),h=f?.editorActiveTabIndex??f?.activeTabIndex??0,y=p(e).find(_=>_.name==="core/tab-panel")?.innerBlocks||[];return{activeTabClientId:y[h]?.clientId||null,tabCount:y.length,editorActiveTabIndex:h}},[e]),c=()=>{if(!i||l<=1)return;let m=s>=l-1?l-2:s;n(),r(e,{editorActiveTabIndex:m}),t(i,!1),e&&a(e)},u=l<=1||!i;return(0,L8.jsx)($2.BlockControls,{group:"other",children:(0,L8.jsx)(M8.ToolbarGroup,{children:(0,L8.jsx)(M8.ToolbarButton,{className:"components-toolbar__control",onClick:c,text:(0,vse.__)("Remove tab"),disabled:u})})})}var gs=o(v(),1);function yse({tabsClientId:e,blockIndex:t,isDefaultTab:r}){let{updateBlockAttributes:a}=(0,bse.useDispatch)(z8.store),n=q();return(0,gs.jsxs)(gs.Fragment,{children:[(0,gs.jsx)(fs,{tabsClientId:e}),(0,gs.jsx)(hs,{tabsClientId:e}),(0,gs.jsx)(z8.InspectorControls,{children:(0,gs.jsx)(jg.__experimentalToolsPanel,{label:(0,R8.__)("Settings"),resetAll:()=>{a(e,{activeTabIndex:0})},dropdownMenuProps:n,children:(0,gs.jsx)(jg.__experimentalToolsPanelItem,{label:(0,R8.__)("Default tab"),hasValue:()=>r&&t!==0,onDeselect:()=>{a(e,{activeTabIndex:0})},isShownByDefault:!0,children:(0,gs.jsx)(jg.CheckboxControl,{label:(0,R8.__)("Default tab"),checked:r,onChange:i=>{a(e,{activeTabIndex:i?t:0})}})})})})]})}var _se=o(mr(),1);function V8(e,t){let r=new window.DOMParser().parseFromString(e,"text/html");return r.body?.textContent?(0,_se.cleanForSlug)(r.body.textContent):`tab-panel-${t}`}var H8=o(v(),1),y3e=[["core/paragraph",{placeholder:(0,xse.__)("Type / to choose a block")}]],{cancelAnimationFrame:_3e}=window;function kse({attributes:e,clientId:t,context:r,isSelected:a,__unstableLayoutClassNames:n}){let i=(0,Nu.useRef)(),{anchor:l,label:s}=e,c=r["core/tabs-activeTabIndex"]??0,m=r["core/tabs-editorActiveTabIndex"]??c;(0,Nu.useEffect)(()=>()=>{i.current&&_3e(i.current)},[]);let{blockIndex:p,hasInnerBlocksSelected:d,tabsClientId:f}=(0,F8.useSelect)(N=>{let{getBlockRootClientId:B,getBlockIndex:D,hasSelectedInnerBlock:A}=N(rf.store),H=B(t),F=B(H),z=D(t),I=A(t,!0);return{blockIndex:z,hasInnerBlocksSelected:I,tabsClientId:F}},[t]),{updateBlockAttributes:h,__unstableMarkNextChangeAsNotPersistent:g}=(0,F8.useDispatch)(rf.store);(0,Nu.useEffect)(()=>{(a||d)&&f&&m!==p&&(g(),h(f,{editorActiveTabIndex:p}))},[a,d,f,m,p,h,g]);let b=m===p,y=c===p,k=(0,Nu.useMemo)(()=>!!(a||d||b),[a,d,b]),_=(0,Nu.useMemo)(()=>l||V8(s,p),[l,s,p]),x=(0,Nu.useMemo)(()=>`${_}--tab`,[_]),S=(0,rf.useBlockProps)({hidden:!k,"aria-labelledby":x,id:_,role:"tabpanel",tabIndex:k?0:-1,className:w("wp-block-tab__editor-content",n)}),C=(0,rf.useInnerBlocksProps)(S,{template:y3e});return(0,H8.jsxs)("section",{...C,children:[(0,H8.jsx)(yse,{tabsClientId:f,blockIndex:p,isDefaultTab:y}),k&&C.children]})}var O8=o(T(),1),wse=o(v(),1);function Cse({attributes:e}){let{anchor:t}=e,r=t,a=O8.useBlockProps.save({role:"tabpanel"}),n=O8.useInnerBlocksProps.save(a);return(0,wse.jsx)("section",{...n,id:r})}var j8={$schema:"https://schemas.wp.org/trunk/block.json",__experimental:!0,apiVersion:3,name:"core/tab",title:"Tab",description:"Content for a tab in a tabbed interface.",version:"1.0.0",category:"design",textdomain:"default",attributes:{label:{type:"string",default:""}},parent:["core/tab-panel"],usesContext:["core/tabs-activeTabIndex","core/tabs-editorActiveTabIndex"],supports:{anchor:!0,html:!1,reusable:!1,color:{background:!0,text:!0,__experimentalDefaultControls:{background:!0,text:!0}},layout:!0,spacing:{blockGap:!0,padding:!0,margin:!1},typography:{fontSize:!0,__experimentalFontFamily:!0,__experimentalDefaultControls:{fontSize:!0,__experimentalFontFamily:!0}},renaming:!0},providesContext:{"core/tab-label":"label"},editorScript:"file:./index.js",style:"file:./style-index.css"};var{name:Sse}=j8,Tse={icon:sB,edit:kse,save:Cse},k3e=()=>E({name:Sse,metadata:j8,settings:Tse});var IA={};Z(IA,{init:()=>S3e,metadata:()=>G8,name:()=>Ese,settings:()=>Dse});var Ug=o(T(),1),Pse=o(V(),1);var Km=o(v(),1),w3e=[["core/tab",{}]];function Bse({clientId:e}){let t=(0,Ug.useBlockProps)(),r=(0,Ug.useInnerBlocksProps)(t,{template:w3e,templateLock:!1,renderAppender:!1}),a=(0,Pse.useSelect)(n=>{let{getBlockRootClientId:i}=n(Ug.store);return i(e)},[e]);return(0,Km.jsxs)(Km.Fragment,{children:[(0,Km.jsx)(fs,{tabsClientId:a}),(0,Km.jsx)(hs,{tabsClientId:a}),(0,Km.jsx)("div",{...r})]})}var U8=o(T(),1),Ise=o(v(),1);function Nse(){let e=U8.useBlockProps.save(),t=U8.useInnerBlocksProps.save(e);return(0,Ise.jsx)("div",{...t})}var G8={$schema:"https://schemas.wp.org/trunk/block.json",__experimental:!0,apiVersion:3,name:"core/tab-panel",title:"Tab Panel",description:"Container for tab panel content in a tabbed interface.",version:"1.0.0",category:"design",textdomain:"default",parent:["core/tabs"],allowedBlocks:["core/tab"],attributes:{},supports:{anchor:!1,html:!1,reusable:!1,lock:!1,dimensions:{aspectRatio:!1,height:!1,minHeight:!1,width:!1},color:{background:!0,text:!0,heading:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{blockGap:!1,padding:!0,margin:!0},typography:{fontSize:!0,__experimentalFontFamily:!0},layout:{default:{type:"flex",flexWrap:"nowrap",justifyContent:"stretch",orientation:"vertical"},allowSwitching:!1,allowVerticalAlignment:!1,allowOrientation:!1,allowJustification:!0,allowSizingOnChildren:!1},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0}},editorScript:"file:./index.js",style:"file:./style-index.css"};var{name:Ese}=G8,Dse={icon:E0,edit:Bse,save:Nse},S3e=()=>E({name:Ese,metadata:G8,settings:Dse});var FA={};Z(FA,{init:()=>j3e,metadata:()=>W8,name:()=>Wse,settings:()=>$se});var Pc=o(P(),1);var Jt=o(T(),1),ot=o(v(),1),Lse={"subtle-light-gray":"#f3f4f5","subtle-pale-green":"#e9fbe5","subtle-pale-blue":"#e7f5fe","subtle-pale-pink":"#fcf0ef"},NA={content:{type:"rich-text",source:"rich-text"},tag:{type:"string",default:"td",source:"tag"},scope:{type:"string",source:"attribute",attribute:"scope"},align:{type:"string",source:"attribute",attribute:"data-align"},colspan:{type:"string",source:"attribute",attribute:"colspan"},rowspan:{type:"string",source:"attribute",attribute:"rowspan"}},T3e={attributes:{hasFixedLayout:{type:"boolean",default:!1},caption:{type:"rich-text",source:"rich-text",selector:"figcaption"},head:{type:"array",default:[],source:"query",selector:"thead tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:NA}}},body:{type:"array",default:[],source:"query",selector:"tbody tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:NA}}},foot:{type:"array",default:[],source:"query",selector:"tfoot tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:NA}}}},supports:{anchor:!0,align:!0,color:{__experimentalSkipSerialization:!0,gradients:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalBorder:{__experimentalSkipSerialization:!0,color:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,style:!0,width:!0}},__experimentalSelector:".wp-block-table > table",interactivity:{clientNavigation:!0}},save({attributes:e}){let{hasFixedLayout:t,head:r,body:a,foot:n,caption:i}=e;if(!r.length&&!a.length&&!n.length)return null;let s=(0,Jt.__experimentalGetColorClassesAndStyles)(e),c=(0,Jt.__experimentalGetBorderClassesAndStyles)(e),u=w(s.className,c.className,{"has-fixed-layout":t}),m=!Jt.RichText.isEmpty(i),p=({type:d,rows:f})=>{if(!f.length)return null;let h=`t${d}`;return(0,ot.jsx)(h,{children:f.map(({cells:g},b)=>(0,ot.jsx)("tr",{children:g.map(({content:y,tag:k,scope:_,align:x,colspan:S,rowspan:C},N)=>{let B=w({[`has-text-align-${x}`]:x});return(0,ot.jsx)(Jt.RichText.Content,{className:B||void 0,"data-align":x,tagName:k,value:y,scope:k==="th"?_:void 0,colSpan:S,rowSpan:C},N)})},b))})};return(0,ot.jsxs)("figure",{...Jt.useBlockProps.save(),children:[(0,ot.jsxs)("table",{className:u===""?void 0:u,style:{...s.style,...c.style},children:[(0,ot.jsx)(p,{type:"head",rows:r}),(0,ot.jsx)(p,{type:"body",rows:a}),(0,ot.jsx)(p,{type:"foot",rows:n})]}),m&&(0,ot.jsx)(Jt.RichText.Content,{tagName:"figcaption",value:i,className:(0,Jt.__experimentalGetElementClassName)("caption")})]})}},EA={content:{type:"string",source:"html"},tag:{type:"string",default:"td",source:"tag"},scope:{type:"string",source:"attribute",attribute:"scope"},align:{type:"string",source:"attribute",attribute:"data-align"}},P3e={attributes:{hasFixedLayout:{type:"boolean",default:!1},caption:{type:"string",source:"html",selector:"figcaption",default:""},head:{type:"array",default:[],source:"query",selector:"thead tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:EA}}},body:{type:"array",default:[],source:"query",selector:"tbody tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:EA}}},foot:{type:"array",default:[],source:"query",selector:"tfoot tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:EA}}}},supports:{anchor:!0,align:!0,color:{__experimentalSkipSerialization:!0,gradients:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalBorder:{__experimentalSkipSerialization:!0,color:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,style:!0,width:!0}},__experimentalSelector:".wp-block-table > table"},save({attributes:e}){let{hasFixedLayout:t,head:r,body:a,foot:n,caption:i}=e;if(!r.length&&!a.length&&!n.length)return null;let s=(0,Jt.__experimentalGetColorClassesAndStyles)(e),c=(0,Jt.__experimentalGetBorderClassesAndStyles)(e),u=w(s.className,c.className,{"has-fixed-layout":t}),m=!Jt.RichText.isEmpty(i),p=({type:d,rows:f})=>{if(!f.length)return null;let h=`t${d}`;return(0,ot.jsx)(h,{children:f.map(({cells:g},b)=>(0,ot.jsx)("tr",{children:g.map(({content:y,tag:k,scope:_,align:x},S)=>{let C=w({[`has-text-align-${x}`]:x});return(0,ot.jsx)(Jt.RichText.Content,{className:C||void 0,"data-align":x,tagName:k,value:y,scope:k==="th"?_:void 0},S)})},b))})};return(0,ot.jsxs)("figure",{...Jt.useBlockProps.save(),children:[(0,ot.jsxs)("table",{className:u===""?void 0:u,style:{...s.style,...c.style},children:[(0,ot.jsx)(p,{type:"head",rows:r}),(0,ot.jsx)(p,{type:"body",rows:a}),(0,ot.jsx)(p,{type:"foot",rows:n})]}),m&&(0,ot.jsx)(Jt.RichText.Content,{tagName:"figcaption",value:i})]})}},DA={content:{type:"string",source:"html"},tag:{type:"string",default:"td",source:"tag"},scope:{type:"string",source:"attribute",attribute:"scope"},align:{type:"string",source:"attribute",attribute:"data-align"}},B3e={attributes:{hasFixedLayout:{type:"boolean",default:!1},backgroundColor:{type:"string"},caption:{type:"string",source:"html",selector:"figcaption",default:""},head:{type:"array",default:[],source:"query",selector:"thead tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:DA}}},body:{type:"array",default:[],source:"query",selector:"tbody tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:DA}}},foot:{type:"array",default:[],source:"query",selector:"tfoot tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:DA}}}},supports:{anchor:!0,align:!0,__experimentalSelector:".wp-block-table > table"},save:({attributes:e})=>{let{hasFixedLayout:t,head:r,body:a,foot:n,backgroundColor:i,caption:l}=e;if(!r.length&&!a.length&&!n.length)return null;let c=(0,Jt.getColorClassName)("background-color",i),u=w(c,{"has-fixed-layout":t,"has-background":!!c}),m=!Jt.RichText.isEmpty(l),p=({type:d,rows:f})=>{if(!f.length)return null;let h=`t${d}`;return(0,ot.jsx)(h,{children:f.map(({cells:g},b)=>(0,ot.jsx)("tr",{children:g.map(({content:y,tag:k,scope:_,align:x},S)=>{let C=w({[`has-text-align-${x}`]:x});return(0,ot.jsx)(Jt.RichText.Content,{className:C||void 0,"data-align":x,tagName:k,value:y,scope:k==="th"?_:void 0},S)})},b))})};return(0,ot.jsxs)("figure",{...Jt.useBlockProps.save(),children:[(0,ot.jsxs)("table",{className:u===""?void 0:u,children:[(0,ot.jsx)(p,{type:"head",rows:r}),(0,ot.jsx)(p,{type:"body",rows:a}),(0,ot.jsx)(p,{type:"foot",rows:n})]}),m&&(0,ot.jsx)(Jt.RichText.Content,{tagName:"figcaption",value:l})]})},isEligible:e=>e.backgroundColor&&e.backgroundColor in Lse&&!e.style,migrate:e=>({...e,backgroundColor:void 0,style:{color:{background:Lse[e.backgroundColor]}}})},LA={content:{type:"string",source:"html"},tag:{type:"string",default:"td",source:"tag"},scope:{type:"string",source:"attribute",attribute:"scope"}},I3e={attributes:{hasFixedLayout:{type:"boolean",default:!1},backgroundColor:{type:"string"},head:{type:"array",default:[],source:"query",selector:"thead tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:LA}}},body:{type:"array",default:[],source:"query",selector:"tbody tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:LA}}},foot:{type:"array",default:[],source:"query",selector:"tfoot tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:LA}}}},supports:{align:!0},save({attributes:e}){let{hasFixedLayout:t,head:r,body:a,foot:n,backgroundColor:i}=e;if(!r.length&&!a.length&&!n.length)return null;let s=(0,Jt.getColorClassName)("background-color",i),c=w(s,{"has-fixed-layout":t,"has-background":!!s}),u=({type:m,rows:p})=>{if(!p.length)return null;let d=`t${m}`;return(0,ot.jsx)(d,{children:p.map(({cells:f},h)=>(0,ot.jsx)("tr",{children:f.map(({content:g,tag:b,scope:y},k)=>(0,ot.jsx)(Jt.RichText.Content,{tagName:b,value:g,scope:b==="th"?y:void 0},k))},h))})};return(0,ot.jsxs)("table",{className:c,children:[(0,ot.jsx)(u,{type:"head",rows:r}),(0,ot.jsx)(u,{type:"body",rows:a}),(0,ot.jsx)(u,{type:"foot",rows:n})]})}},Mse=[T3e,P3e,B3e,I3e];var Qn=o(U(),1),ko=o(T(),1),Pt=o(P(),1),Ur=o(M(),1);var N3e=["align"];function Ase({rowCount:e,columnCount:t}){return{body:Array.from({length:e}).map(()=>({cells:Array.from({length:t}).map(()=>({content:"",tag:"td"}))}))}}function E3e(e){if(!Qm(e.head))return e.head[0];if(!Qm(e.body))return e.body[0];if(!Qm(e.foot))return e.foot[0]}function Rse(e,t,r){let{sectionName:a,rowIndex:n,columnIndex:i}=t;return e[a]?.[n]?.cells?.[i]?.[r]}function MA(e,t,r){if(!t)return e;let a=Object.fromEntries(Object.entries(e).filter(([l])=>["head","body","foot"].includes(l))),{sectionName:n,rowIndex:i}=t;return Object.fromEntries(Object.entries(a).map(([l,s])=>n&&n!==l?[l,s]:[l,s.map((c,u)=>i&&i!==u?c:{cells:c.cells.map((m,p)=>D3e({sectionName:l,columnIndex:p,rowIndex:u},t)?r(m):m)})]))}function D3e(e,t){if(!e||!t)return!1;switch(t.type){case"column":return t.type==="column"&&e.columnIndex===t.columnIndex;case"cell":return t.type==="cell"&&e.sectionName===t.sectionName&&e.columnIndex===t.columnIndex&&e.rowIndex===t.rowIndex}}function AA(e,{sectionName:t,rowIndex:r,columnCount:a}){let n=E3e(e),i=a===void 0?n?.cells?.length:a;return i?{[t]:[...e[t].slice(0,r),{cells:Array.from({length:i}).map((l,s)=>{let c=n?.cells?.[s]??{};return{...Object.fromEntries(Object.entries(c).filter(([m])=>N3e.includes(m))),content:"",tag:t==="head"?"th":"td"}})},...e[t].slice(r)]}:e}function zse(e,{sectionName:t,rowIndex:r}){return{[t]:e[t].filter((a,n)=>n!==r)}}function Vse(e,{columnIndex:t}){let r=Object.fromEntries(Object.entries(e).filter(([a])=>["head","body","foot"].includes(a)));return Object.fromEntries(Object.entries(r).map(([a,n])=>Qm(n)?[a,n]:[a,n.map(i=>Hse(i)||i.cells.length<t?i:{cells:[...i.cells.slice(0,t),{content:"",tag:a==="head"?"th":"td"},...i.cells.slice(t)]})]))}function Fse(e,{columnIndex:t}){let r=Object.fromEntries(Object.entries(e).filter(([a])=>["head","body","foot"].includes(a)));return Object.fromEntries(Object.entries(r).map(([a,n])=>Qm(n)?[a,n]:[a,n.map(i=>({cells:i.cells.length>=t?i.cells.filter((l,s)=>s!==t):i.cells})).filter(i=>i.cells.length)]))}function RA(e,t){if(!Qm(e[t]))return{[t]:[]};let r=e.body?.[0]?.cells?.length??1;return AA(e,{sectionName:t,rowIndex:0,columnCount:r})}function Qm(e){return!e||!e.length||e.every(Hse)}function Hse(e){return!(e.cells&&e.cells.length)}var st=o(v(),1),L3e=[{icon:IS,title:(0,Pt.__)("Align column left"),align:"left"},{icon:PS,title:(0,Pt.__)("Align column center"),align:"center"},{icon:LS,title:(0,Pt.__)("Align column right"),align:"right"}],M3e={head:(0,Pt.__)("Header cell text"),body:(0,Pt.__)("Body cell text"),foot:(0,Pt.__)("Footer cell text")},A3e={head:(0,Pt.__)("Header label"),foot:(0,Pt.__)("Footer label")};function R3e({name:e,...t}){let r=`t${e}`;return(0,st.jsx)(r,{...t})}function z3e({attributes:e,setAttributes:t,insertBlocksAfter:r,isSelected:a}){let{hasFixedLayout:n,head:i,foot:l}=e,[s,c]=(0,Qn.useState)(2),[u,m]=(0,Qn.useState)(2),[p,d]=(0,Qn.useState)(),f=(0,ko.__experimentalUseColorProps)(e),h=(0,ko.__experimentalUseBorderProps)(e),g=(0,ko.useBlockEditingMode)(),b=(0,Qn.useRef)(),[y,k]=(0,Qn.useState)(!1),_=q();function x(ne){m(ne)}function S(ne){c(ne)}function C(ne){ne.preventDefault(),t(Ase({rowCount:parseInt(s,10)||2,columnCount:parseInt(u,10)||2})),k(!0)}function N(){t({hasFixedLayout:!n})}let B=(0,Qn.useCallback)(function(ne){p&&t(le=>MA(le,p,pe=>({...pe,content:ne})))},[p,t]);function D(ne){if(!p)return;let le={type:"column",columnIndex:p.columnIndex},pe=MA(e,le,Ie=>({...Ie,align:ne}));t(pe)}function A(){if(p)return Rse(e,p,"align")}function H(){t(RA(e,"head"))}function F(){t(RA(e,"foot"))}function z(ne){if(!p)return;let{sectionName:le,rowIndex:pe}=p,Ie=pe+ne;t(AA(e,{sectionName:le,rowIndex:Ie})),d({sectionName:le,rowIndex:Ie,columnIndex:0,type:"cell"})}function I(){z(0)}function R(){z(1)}function $(){if(!p)return;let{sectionName:ne,rowIndex:le}=p;d(),t(zse(e,{sectionName:ne,rowIndex:le}))}function j(ne=0){if(!p)return;let{columnIndex:le}=p,pe=le+ne;t(Vse(e,{columnIndex:pe})),d({rowIndex:0,columnIndex:pe,type:"cell"})}function G(){j(0)}function O(){j(1)}function J(){if(!p)return;let{sectionName:ne,columnIndex:le}=p;d(),t(Fse(e,{sectionName:ne,columnIndex:le}))}(0,Qn.useEffect)(()=>{a||d()},[a]),(0,Qn.useEffect)(()=>{y&&(b?.current?.querySelector('td div[contentEditable="true"]')?.focus(),k(!1))},[y]);let ee=["head","body","foot"].filter(ne=>!Qm(e[ne])),oe=[{icon:bB,title:(0,Pt.__)("Insert row before"),isDisabled:!p,onClick:I},{icon:gB,title:(0,Pt.__)("Insert row after"),isDisabled:!p,onClick:R},{icon:_B,title:(0,Pt.__)("Delete row"),isDisabled:!p,onClick:$},{icon:pB,title:(0,Pt.__)("Insert column before"),isDisabled:!p,onClick:G},{icon:uB,title:(0,Pt.__)("Insert column after"),isDisabled:!p,onClick:O},{icon:fB,title:(0,Pt.__)("Delete column"),isDisabled:!p,onClick:J}],X=ee.map(ne=>(0,st.jsx)(R3e,{name:ne,children:e[ne].map(({cells:le},pe)=>(0,st.jsx)("tr",{children:le.map((Ie,Ne)=>{let ae=p?.sectionName===ne&&p?.rowIndex===pe&&p?.columnIndex===Ne;return(0,st.jsx)(V3e,{name:ne,rowIndex:pe,columnIndex:Ne,onChange:ae?B:void 0,setSelectedCell:d,...Ie},Ne)})},pe))},ne)),te=!ee.length;return(0,st.jsxs)("figure",{...(0,ko.useBlockProps)({ref:b}),children:[!te&&g==="default"&&(0,st.jsxs)(st.Fragment,{children:[(0,st.jsx)(ko.BlockControls,{group:"block",children:(0,st.jsx)(ko.AlignmentControl,{label:(0,Pt.__)("Change column alignment"),alignmentControls:L3e,value:A(),onChange:ne=>D(ne)})}),(0,st.jsx)(ko.BlockControls,{group:"other",children:(0,st.jsx)(Ur.ToolbarDropdownMenu,{icon:kB,label:(0,Pt.__)("Edit table"),controls:oe})})]}),(0,st.jsx)(ko.InspectorControls,{children:(0,st.jsxs)(Ur.__experimentalToolsPanel,{label:(0,Pt.__)("Settings"),resetAll:()=>{t({hasFixedLayout:!0,head:[],foot:[]})},dropdownMenuProps:_,children:[(0,st.jsx)(Ur.__experimentalToolsPanelItem,{hasValue:()=>n!==!0,label:(0,Pt.__)("Fixed width table cells"),onDeselect:()=>t({hasFixedLayout:!0}),isShownByDefault:!0,children:(0,st.jsx)(Ur.ToggleControl,{label:(0,Pt.__)("Fixed width table cells"),checked:!!n,onChange:N})}),!te&&(0,st.jsxs)(st.Fragment,{children:[(0,st.jsx)(Ur.__experimentalToolsPanelItem,{hasValue:()=>i&&i.length,label:(0,Pt.__)("Header section"),onDeselect:()=>t({head:[]}),isShownByDefault:!0,children:(0,st.jsx)(Ur.ToggleControl,{label:(0,Pt.__)("Header section"),checked:!!(i&&i.length),onChange:H})}),(0,st.jsx)(Ur.__experimentalToolsPanelItem,{hasValue:()=>l&&l.length,label:(0,Pt.__)("Footer section"),onDeselect:()=>t({foot:[]}),isShownByDefault:!0,children:(0,st.jsx)(Ur.ToggleControl,{label:(0,Pt.__)("Footer section"),checked:!!(l&&l.length),onChange:F})})]})]})}),!te&&(0,st.jsx)("table",{className:w(f.className,h.className,{"has-fixed-layout":n,"has-individual-borders":(0,Ur.__experimentalHasSplitBorders)(e?.style?.border)}),style:{...f.style,...h.style},children:X}),te?(0,st.jsx)(Ur.Placeholder,{label:(0,Pt.__)("Table"),icon:(0,st.jsx)(ko.BlockIcon,{icon:C0,showColors:!0}),instructions:(0,Pt.__)("Insert a table for sharing data."),children:(0,st.jsxs)("form",{className:"blocks-table__placeholder-form",onSubmit:C,children:[(0,st.jsx)(Ur.TextControl,{__next40pxDefaultSize:!0,type:"number",label:(0,Pt.__)("Column count"),value:u,onChange:x,min:"1",className:"blocks-table__placeholder-input"}),(0,st.jsx)(Ur.TextControl,{__next40pxDefaultSize:!0,type:"number",label:(0,Pt.__)("Row count"),value:s,onChange:S,min:"1",className:"blocks-table__placeholder-input"}),(0,st.jsx)(Ur.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",children:(0,Pt.__)("Create Table")})]})}):(0,st.jsx)(_a,{attributes:e,setAttributes:t,isSelected:a,insertBlocksAfter:r,label:(0,Pt.__)("Table caption text"),showToolbarButton:a&&g==="default"})]})}var V3e=(0,Qn.memo)(function({tag:e,name:t,scope:r,colspan:a,rowspan:n,rowIndex:i,columnIndex:l,align:s,content:c,onChange:u,setSelectedCell:m}){return(0,st.jsx)(e,{scope:e==="th"?r:void 0,colSpan:a,rowSpan:n,className:w({[`has-text-align-${s}`]:s},"wp-block-table__cell-content"),children:(0,st.jsx)(ko.RichText,{value:c,onChange:u,onFocus:()=>{m({sectionName:t,rowIndex:i,columnIndex:l,type:"cell"})},"aria-label":M3e[t],placeholder:A3e[t]})})}),Ose=z3e;var W8={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/table",title:"Table",category:"text",description:"Create structured content in rows and columns to display information.",textdomain:"default",attributes:{hasFixedLayout:{type:"boolean",default:!0},caption:{type:"rich-text",source:"rich-text",selector:"figcaption",role:"content"},head:{type:"array",default:[],source:"query",selector:"thead tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:{content:{type:"rich-text",source:"rich-text",role:"content"},tag:{type:"string",default:"td",source:"tag"},scope:{type:"string",source:"attribute",attribute:"scope"},align:{type:"string",source:"attribute",attribute:"data-align"},colspan:{type:"string",source:"attribute",attribute:"colspan"},rowspan:{type:"string",source:"attribute",attribute:"rowspan"}}}}},body:{type:"array",default:[],source:"query",selector:"tbody tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:{content:{type:"rich-text",source:"rich-text",role:"content"},tag:{type:"string",default:"td",source:"tag"},scope:{type:"string",source:"attribute",attribute:"scope"},align:{type:"string",source:"attribute",attribute:"data-align"},colspan:{type:"string",source:"attribute",attribute:"colspan"},rowspan:{type:"string",source:"attribute",attribute:"rowspan"}}}}},foot:{type:"array",default:[],source:"query",selector:"tfoot tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:{content:{type:"rich-text",source:"rich-text",role:"content"},tag:{type:"string",default:"td",source:"tag"},scope:{type:"string",source:"attribute",attribute:"scope"},align:{type:"string",source:"attribute",attribute:"data-align"},colspan:{type:"string",source:"attribute",attribute:"colspan"},rowspan:{type:"string",source:"attribute",attribute:"rowspan"}}}}}},supports:{anchor:!0,align:!0,color:{__experimentalSkipSerialization:!0,gradients:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalBorder:{__experimentalSkipSerialization:!0,color:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,style:!0,width:!0}},interactivity:{clientNavigation:!0}},selectors:{root:".wp-block-table > table",spacing:".wp-block-table"},styles:[{name:"regular",label:"Default",isDefault:!0},{name:"stripes",label:"Stripes"}],editorStyle:"wp-block-table-editor",style:"wp-block-table"};var _l=o(T(),1),vs=o(v(),1);function jse({attributes:e}){let{hasFixedLayout:t,head:r,body:a,foot:n,caption:i}=e;if(!r.length&&!a.length&&!n.length)return null;let s=(0,_l.__experimentalGetColorClassesAndStyles)(e),c=(0,_l.__experimentalGetBorderClassesAndStyles)(e),u=w(s.className,c.className,{"has-fixed-layout":t}),m=!_l.RichText.isEmpty(i),p=({type:d,rows:f})=>{if(!f.length)return null;let h=`t${d}`;return(0,vs.jsx)(h,{children:f.map(({cells:g},b)=>(0,vs.jsx)("tr",{children:g.map(({content:y,tag:k,scope:_,align:x,colspan:S,rowspan:C},N)=>{let B=w({[`has-text-align-${x}`]:x});return(0,vs.jsx)(_l.RichText.Content,{className:B||void 0,"data-align":x,tagName:k,value:y,scope:k==="th"?_:void 0,colSpan:S,rowSpan:C},N)})},b))})};return(0,vs.jsxs)("figure",{..._l.useBlockProps.save(),children:[(0,vs.jsxs)("table",{className:u===""?void 0:u,style:{...s.style,...c.style},children:[(0,vs.jsx)(p,{type:"head",rows:r}),(0,vs.jsx)(p,{type:"body",rows:a}),(0,vs.jsx)(p,{type:"foot",rows:n})]}),m&&(0,vs.jsx)(_l.RichText.Content,{tagName:"figcaption",value:i,className:(0,_l.__experimentalGetElementClassName)("caption")})]})}var Use=o(W(),1);function zA(e){let t=parseInt(e,10);if(Number.isInteger(t))return t<0||t===1?void 0:t.toString()}var VA=({phrasingContentSchema:e})=>({tr:{allowEmpty:!0,children:{th:{allowEmpty:!0,children:e,attributes:["scope","colspan","rowspan","style"]},td:{allowEmpty:!0,children:e,attributes:["colspan","rowspan","style"]}}}}),H3e=e=>({table:{children:{thead:{allowEmpty:!0,children:VA(e)},tfoot:{allowEmpty:!0,children:VA(e)},tbody:{allowEmpty:!0,children:VA(e)}}}}),O3e={from:[{type:"raw",selector:"table",schema:H3e,transform:e=>{let t=Array.from(e.children).reduce((r,a)=>{if(!a.children.length)return r;let n=a.nodeName.toLowerCase().slice(1),i=Array.from(a.children).reduce((l,s)=>{if(!s.children.length)return l;let c=Array.from(s.children).reduce((u,m)=>{let p=zA(m.getAttribute("rowspan")),d=zA(m.getAttribute("colspan")),{textAlign:f}=m.style||{},h;return(f==="left"||f==="center"||f==="right")&&(h=f),u.push({tag:m.nodeName.toLowerCase(),content:m.innerHTML,rowspan:p,colspan:d,align:h}),u},[]);return l.push({cells:c}),l},[]);return r[n]=i,r},{});return(0,Use.createBlock)("core/table",t)}}]},Gse=O3e;var{name:Wse}=W8,$se={icon:C0,example:{attributes:{head:[{cells:[{content:(0,Pc.__)("Version"),tag:"th"},{content:(0,Pc.__)("Jazz Musician"),tag:"th"},{content:(0,Pc.__)("Release Date"),tag:"th"}]}],body:[{cells:[{content:"5.2",tag:"td"},{content:(0,Pc.__)("Jaco Pastorius"),tag:"td"},{content:(0,Pc.__)("May 7, 2019"),tag:"td"}]},{cells:[{content:"5.1",tag:"td"},{content:(0,Pc.__)("Betty Carter"),tag:"td"},{content:(0,Pc.__)("February 21, 2019"),tag:"td"}]},{cells:[{content:"5.0",tag:"td"},{content:(0,Pc.__)("Bebo Vald\xE9s"),tag:"td"},{content:(0,Pc.__)("December 6, 2018"),tag:"td"}]}]},viewportWidth:450},transforms:Gse,edit:Ose,save:jse,deprecated:Mse},j3e=()=>E({name:Wse,metadata:W8,settings:$se});var OA={};Z(OA,{init:()=>$3e,metadata:()=>$8,name:()=>lce,settings:()=>sce});var Eu=o(P(),1);var $8={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,__experimental:!0,name:"core/table-of-contents",title:"Table of Contents",category:"design",description:"Summarize your post with a list of headings. Add HTML anchors to Heading blocks to link them here.",keywords:["document outline","summary"],textdomain:"default",attributes:{headings:{type:"array",items:{type:"object"},default:[]},onlyIncludeCurrentPage:{type:"boolean",default:!1},maxLevel:{type:"number"},ordered:{type:"boolean",default:!0}},supports:{anchor:!0,ariaLabel:!0,html:!1,color:{text:!0,background:!0,gradients:!0,link:!0},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}}},style:"wp-block-table-of-contents"};var bs=o(T(),1),tce=o(W(),1),Ho=o(M(),1),K2=o(V(),1),rce=o(U(),1),zt=o(P(),1),oce=o(me(),1),ace=o(xr(),1);var Bc=o(v(),1),qse="wp-block-table-of-contents__entry";function Gg({nestedHeadingList:e,disableLinkActivation:t,onClick:r,ordered:a=!0}){return(0,Bc.jsx)(Bc.Fragment,{children:e.map((n,i)=>{let{content:l,link:s}=n.heading,c=s?(0,Bc.jsx)("a",{className:qse,href:s,"aria-disabled":t||void 0,onClick:t&&typeof r=="function"?r:void 0,children:l}):(0,Bc.jsx)("span",{className:qse,children:l}),u=a?"ol":"ul";return(0,Bc.jsxs)("li",{children:[c,n.children?(0,Bc.jsx)(u,{children:(0,Bc.jsx)(Gg,{nestedHeadingList:n.children,disableLinkActivation:t,onClick:t&&typeof r=="function"?r:void 0,ordered:a})}):null]},i)})})}function q2(e){let t=[];return e.forEach((r,a)=>{if(r.content!==""&&r.level===e[0].level)if(e[a+1]?.level>r.level){let n=e.length;for(let i=a+1;i<e.length;i++)if(e[i].level===r.level){n=i;break}t.push({heading:r,children:q2(e.slice(a+1,n))})}else t.push({heading:r,children:null})}),t}var Qse=o(Kse(),1),Yse=o(V(),1),Xse=o(ai(),1),Jse=o(U(),1),Z2=o(mr(),1),q8=o(T(),1);function G3e(e,t){let{getBlockAttributes:r,getBlockName:a,getBlocksByName:n,getClientIdsOfDescendants:i}=e(q8.store),l=e("core/editor").getPermalink()??null,s=n("core/nextpage").length!==0,{onlyIncludeCurrentPage:c,maxLevel:u}=r(t)??{},[m=""]=n("core/post-content"),p=i(m),d=1;if(s&&c){let b=p.indexOf(t);for(let[y,k]of p.entries()){if(y>=b)break;a(k)==="core/nextpage"&&d++}}let f=[],h=1,g=null;typeof l=="string"&&(g=s?(0,Z2.addQueryArgs)(l,{page:h}):l);for(let b of p){let y=a(b);if(y==="core/nextpage"){if(h++,c&&h>d)break;typeof l=="string"&&(g=(0,Z2.addQueryArgs)((0,Z2.removeQueryArgs)(l,["page"]),{page:h}))}else if((!c||h===d)&&y==="core/heading"){let k=r(b);if(u&&k.level>u)continue;let _=typeof g=="string"&&typeof k.anchor=="string"&&k.anchor!=="";f.push({content:(0,Xse.__unstableStripHTML)(k.content.replace(/(<br *\/?>)+/g," ")),level:k.level,link:_?`${g}#${k.anchor}`:null})}}return f}function W3e(e,t,r){let{getBlockAttributes:a}=e(q8.store),{updateBlockAttributes:n,__unstableMarkNextChangeAsNotPersistent:i}=t(q8.store),l=a(r);if(l===null)return;let s=G3e(e,r);(0,Qse.default)(s,l.headings)||window.queueMicrotask(()=>{i(),n(r,{headings:s})})}function ece(e){let t=(0,Yse.useRegistry)();(0,Jse.useEffect)(()=>t.subscribe(()=>W3e(t.select,t.dispatch,e)),[t,e])}var er=o(v(),1);function HA({attributes:{headings:e=[],onlyIncludeCurrentPage:t,maxLevel:r,ordered:a=!0},clientId:n,setAttributes:i}){ece(n);let l=(0,bs.useBlockProps)(),s=(0,oce.useInstanceId)(HA,"table-of-contents"),{createWarningNotice:c}=(0,K2.useDispatch)(ace.store),u=y=>{y.preventDefault(),c((0,zt.__)("Links are disabled in the editor."),{id:`block-library/core/table-of-contents/redirection-prevented/${s}`,type:"snackbar"})},m=(0,K2.useSelect)(y=>{let{getBlockRootClientId:k,canInsertBlockType:_}=y(bs.store),x=k(n);return _("core/list",x)},[n]),{replaceBlocks:p}=(0,K2.useDispatch)(bs.store),d=q(),f=q2(e),h=(0,er.jsxs)(bs.BlockControls,{children:[(0,er.jsxs)(Ho.ToolbarGroup,{children:[(0,er.jsx)(Ho.ToolbarButton,{icon:(0,zt.isRTL)()?z0:V0,title:(0,zt.__)("Unordered"),description:(0,zt.__)("Convert to unordered list"),onClick:()=>i({ordered:!1}),isActive:a===!1}),(0,er.jsx)(Ho.ToolbarButton,{icon:(0,zt.isRTL)()?F0:Ki,title:(0,zt.__)("Ordered"),description:(0,zt.__)("Convert to ordered list"),onClick:()=>i({ordered:!0}),isActive:a===!0})]}),m&&(0,er.jsx)(Ho.ToolbarGroup,{children:(0,er.jsx)(Ho.ToolbarButton,{onClick:()=>p(n,(0,tce.createBlock)("core/list",{ordered:a,values:(0,rce.renderToString)((0,er.jsx)(Gg,{nestedHeadingList:f,ordered:a}))})),children:(0,zt.__)("Convert to static list")})})]}),g=(0,er.jsx)(bs.InspectorControls,{children:(0,er.jsxs)(Ho.__experimentalToolsPanel,{label:(0,zt.__)("Settings"),resetAll:()=>{i({onlyIncludeCurrentPage:!1,maxLevel:void 0,ordered:!0})},dropdownMenuProps:d,children:[(0,er.jsx)(Ho.__experimentalToolsPanelItem,{hasValue:()=>!!t,label:(0,zt.__)("Only include current page"),onDeselect:()=>i({onlyIncludeCurrentPage:!1}),isShownByDefault:!0,children:(0,er.jsx)(Ho.ToggleControl,{label:(0,zt.__)("Only include current page"),checked:t,onChange:y=>i({onlyIncludeCurrentPage:y}),help:t?(0,zt.__)("Only including headings from the current page (if the post is paginated)."):(0,zt.__)("Include headings from all pages (if the post is paginated).")})}),(0,er.jsx)(Ho.__experimentalToolsPanelItem,{hasValue:()=>!!r,label:(0,zt.__)("Limit heading levels"),onDeselect:()=>i({maxLevel:void 0}),isShownByDefault:!0,children:(0,er.jsx)(Ho.SelectControl,{__next40pxDefaultSize:!0,label:(0,zt.__)("Include headings down to level"),value:r||"",options:[{value:"",label:(0,zt.__)("All levels")},{value:"1",label:(0,zt.__)("Heading 1")},{value:"2",label:(0,zt.__)("Heading 2")},{value:"3",label:(0,zt.__)("Heading 3")},{value:"4",label:(0,zt.__)("Heading 4")},{value:"5",label:(0,zt.__)("Heading 5")},{value:"6",label:(0,zt.__)("Heading 6")}],onChange:y=>i({maxLevel:y?parseInt(y):void 0}),help:r?(0,zt.__)("Only include headings up to and including this level."):(0,zt.__)("Including all heading levels in the table of contents.")})})]})});return e.length===0?(0,er.jsxs)(er.Fragment,{children:[(0,er.jsx)("div",{...l,children:(0,er.jsx)(Ho.Placeholder,{icon:(0,er.jsx)(bs.BlockIcon,{icon:d1}),label:(0,zt.__)("Table of Contents"),instructions:(0,zt.__)("Start adding Heading blocks to create a table of contents. Headings with HTML anchors will be linked here.")})}),g]}):(0,er.jsxs)(er.Fragment,{children:[(0,er.jsx)("nav",{...l,children:(0,er.jsx)(a?"ol":"ul",{children:(0,er.jsx)(Gg,{nestedHeadingList:f,disableLinkActivation:!0,onClick:u,ordered:a})})}),h,g]})}var nce=o(T(),1);var Z8=o(v(),1);function ice({attributes:{headings:e=[],ordered:t=!0}}){if(e.length===0)return null;let r=t?"ol":"ul";return(0,Z8.jsx)("nav",{...nce.useBlockProps.save(),children:(0,Z8.jsx)(r,{children:(0,Z8.jsx)(Gg,{nestedHeadingList:q2(e),ordered:t})})})}var{name:lce}=$8,sce={icon:d1,edit:HA,save:ice,example:{innerBlocks:[{name:"core/heading",attributes:{level:2,content:(0,Eu.__)("Heading")}},{name:"core/heading",attributes:{level:3,content:(0,Eu.__)("Subheading")}},{name:"core/heading",attributes:{level:2,content:(0,Eu.__)("Heading")}},{name:"core/heading",attributes:{level:3,content:(0,Eu.__)("Subheading")}}],attributes:{headings:[{content:(0,Eu.__)("Heading"),level:2},{content:(0,Eu.__)("Subheading"),level:3},{content:(0,Eu.__)("Heading"),level:2},{content:(0,Eu.__)("Subheading"),level:3}]}}},$3e=()=>E({name:lce,metadata:$8,settings:sce});var jA={};Z(jA,{init:()=>Q3e,metadata:()=>Y8,name:()=>fce,settings:()=>hce});var Y2=o(P(),1);var Ym=o(T(),1),uce=o(V(),1),K8=o(U(),1);var of=o(v(),1);function cce({clientId:e}){return(0,of.jsxs)(of.Fragment,{children:[(0,of.jsx)(fs,{tabsClientId:e}),(0,of.jsx)(hs,{tabsClientId:e})]})}var Q2=o(v(),1),q3e=[["core/tabs-menu",{lock:{remove:!0}}],["core/tab-panel",{lock:{remove:!0}},[["core/tab",{anchor:"tab-1",label:"Tab 1"},[["core/paragraph"]]]]]];function Z3e({clientId:e,attributes:t,setAttributes:r,__unstableLayoutClassNames:a}){let{anchor:n,activeTabIndex:i,editorActiveTabIndex:l}=t;(0,K8.useEffect)(()=>{l===void 0&&r({editorActiveTabIndex:i})},[]);let s=(0,uce.useSelect)(p=>{let{getBlocks:d}=p(Ym.store),h=d(e).find(g=>g.name==="core/tab-panel");return h?h.innerBlocks.filter(g=>g.name==="core/tab"):[]},[e]),c=(0,K8.useMemo)(()=>({"core/tabs-list":s.map((d,f)=>({id:d.attributes.anchor||`tab-${f}`,label:d.attributes.label||"",clientId:d.clientId,index:f})),"core/tabs-id":n,"core/tabs-activeTabIndex":i,"core/tabs-editorActiveTabIndex":l}),[s,n,i,l]),u=(0,Ym.useBlockProps)({className:a}),m=(0,Ym.useInnerBlocksProps)(u,{__experimentalCaptureToolbars:!0,template:q3e,templateLock:!1,renderAppender:!1});return(0,Q2.jsx)(Ym.BlockContextProvider,{value:c,children:(0,Q2.jsxs)("div",{...m,children:[(0,Q2.jsx)(cce,{clientId:e,attributes:t,setAttributes:r}),m.children]})})}var mce=Z3e;var Q8=o(T(),1),pce=o(v(),1);function dce({attributes:e}){let{anchor:t}=e,r=t,a=Q8.useBlockProps.save(),n=Q8.useInnerBlocksProps.save(a);return(0,pce.jsx)("div",{...n,id:r})}var Y8={$schema:"https://schemas.wp.org/trunk/block.json",__experimental:!0,apiVersion:3,name:"core/tabs",title:"Tabs",description:"Display content in a tabbed interface to help users navigate detailed content with ease.",version:"1.0.0",category:"design",textdomain:"default",allowedBlocks:["core/tabs-menu","core/tab-panel"],attributes:{activeTabIndex:{type:"number",default:0},editorActiveTabIndex:{type:"number",role:"local"}},supports:{align:!0,anchor:!0,color:{text:!0,background:!0,__experimentalDefaultControls:{text:!0,background:!0}},layout:{default:{type:"flex",flexWrap:"nowrap",justifyContent:"stretch",verticalAlignment:"stretch",orientation:"vertical"},allowSwitching:!1,allowVerticalAlignment:!0,allowJustification:!0,allowOrientation:!0,allowSizingOnChildren:!0},html:!1,interactivity:!0,spacing:{blockGap:!0,margin:!0,padding:!0},typography:{fontSize:!0,__experimentalFontFamily:!0},renaming:!0},providesContext:{"core/tabs-activeTabIndex":"activeTabIndex","core/tabs-editorActiveTabIndex":"editorActiveTabIndex"},usesContext:["core/tabs-list","core/tabs-id"],editorScript:"file:./index.js",editorStyle:"file:./index.css",style:"file:./style-index.css",viewScriptModule:"@wordpress/block-library/tabs/view"};var{name:fce}=Y8,hce={icon:BB,example:{innerBlocks:[{name:"core/tabs-menu",innerBlocks:[{name:"core/tabs-menu-item"}]},{name:"core/tab-panel",innerBlocks:[1,2,3].map(e=>({name:"core/tab",attributes:{label:(0,Y2.sprintf)((0,Y2.__)("Tab %s"),e)},innerBlocks:[{name:"core/paragraph",attributes:{content:(0,Y2.__)("In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing.")}}]}))}]},edit:mce,save:dce},Q3e=()=>E({name:fce,metadata:Y8,settings:hce});var UA={};Z(UA,{init:()=>awe,metadata:()=>J8,name:()=>_ce,settings:()=>xce});var gce=o(P(),1),Yn=o(T(),1),X2=o(V(),1),ji=o(U(),1);var Oo=o(v(),1),Y3e=[["core/tabs-menu-item",{}]],X3e=[];function J3e({blocks:e,blockContextId:t,isHidden:r,setActiveBlockContextId:a}){let n=(0,Yn.__experimentalUseBlockPreview)({blocks:e}),i=()=>{a(t)};return(0,Oo.jsx)("div",{...n,tabIndex:0,role:"button",onClick:i,onKeyDown:i,style:{display:r?"none":"flex"}})}var ewe=(0,ji.memo)(J3e);function twe({wrapperProps:e={},layout:t}){return(0,Yn.useInnerBlocksProps)(e,{template:Y3e,templateLock:"all",renderAppender:!1,layout:t}).children}function rwe({context:e,clientId:t,__unstableLayoutClassNames:r}){let{layout:a}=(0,Yn.useBlockEditContext)(),n=e["core/tabs-id"]||null,i=e["core/tabs-list"]||X3e,l=e["core/tabs-activeTabIndex"]??0,s=e["core/tabs-editorActiveTabIndex"],c=(0,ji.useMemo)(()=>s??l,[s,l]),{__unstableMarkNextChangeAsNotPersistent:u}=(0,X2.useDispatch)(Yn.store),{updateBlockAttributes:m}=(0,X2.useDispatch)(Yn.store),[p,d]=(0,ji.useState)(null),{blocks:f,tabsClientId:h}=(0,X2.useSelect)(_=>{let{getBlocks:x,getBlockRootClientId:S}=_(Yn.store);return{blocks:x(t),tabsClientId:S(t)}},[t]),g=(0,ji.useMemo)(()=>i.map((_,x)=>({"core/tabs-menu-item-index":x,"core/tabs-menu-item-id":_.id||`tab-${x}`,"core/tabs-menu-item-label":_.label||"","core/tabs-menu-item-clientId":_.clientId,"core/tabs-id":n,"core/tabs-list":i,"core/tabs-activeTabIndex":l,"core/tabs-editorActiveTabIndex":s})),[i,n,l,s]),b=(0,ji.useCallback)(_=>`tab-context-${_["core/tabs-menu-item-index"]}`,[]);(0,ji.useEffect)(()=>{g.length>0&&p===null&&d(b(g[0]))},[g,p,b]),(0,ji.useEffect)(()=>{if(g.length>0&&c<g.length){let _=b(g[c]);d(x=>x!==_?_:x)}},[c,g,b]);let y=(0,ji.useCallback)(_=>{h&&_!==c&&(u(),m(h,{editorActiveTabIndex:_}))},[h,c,m,u]),k=(0,Yn.useBlockProps)({className:w(r),role:"tablist"});return i.length===0?(0,Oo.jsxs)(Oo.Fragment,{children:[(0,Oo.jsx)(fs,{tabsClientId:h}),(0,Oo.jsx)(hs,{tabsClientId:h}),(0,Oo.jsx)("div",{...k,children:(0,Oo.jsx)("span",{className:"tabs__tab-label tabs__tab-label--placeholder",children:(0,gce.__)("Add tabs to display menu")})})]}):(0,Oo.jsxs)(Oo.Fragment,{children:[(0,Oo.jsx)(fs,{tabsClientId:h}),(0,Oo.jsx)(hs,{tabsClientId:h}),(0,Oo.jsx)("div",{...k,children:g.map((_,x)=>{let S=b(_),C=S===p;return(0,Oo.jsxs)(Yn.BlockContextProvider,{value:_,children:[C?(0,Oo.jsx)(twe,{wrapperProps:{onClick:()=>y(x)},layout:a}):null,(0,Oo.jsx)(ewe,{blocks:f,blockContextId:S,setActiveBlockContextId:N=>{d(N),y(x)},isHidden:C})]},S)})})]})}var vce=rwe;var X8=o(T(),1),bce=o(v(),1);function yce(){let e=X8.useBlockProps.save({role:"tablist"}),t=X8.useInnerBlocksProps.save(e);return(0,bce.jsx)("div",{...t})}var J8={$schema:"https://schemas.wp.org/trunk/block.json",__experimental:!0,apiVersion:3,name:"core/tabs-menu",title:"Tabs Menu",description:"Display the tab buttons for a tabbed interface.",version:"1.0.0",category:"design",textdomain:"default",parent:["core/tabs"],allowedBlocks:["core/tabs-menu-item"],usesContext:["core/tabs-list","core/tabs-id","core/tabs-activeTabIndex","core/tabs-editorActiveTabIndex"],attributes:{},supports:{html:!1,reusable:!1,lock:!1,dimensions:{aspectRatio:!1,height:!1,minHeight:!1,width:!1},color:{background:!0,text:!0,__experimentalDefaultControls:{background:!0,text:!0}},typography:{fontSize:!0,__experimentalFontFamily:!0},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0},layout:{default:{type:"flex",flexWrap:"nowrap",orientation:"horizontal"},allowSwitching:!1,allowVerticalAlignment:!0,allowJustification:!0,allowOrientation:!0},spacing:{padding:!0,margin:!0,blockGap:!0,__experimentalDefaultControls:{padding:!0,margin:!0,blockGap:!0}}},editorScript:"file:./index.js",editorStyle:"file:./editor.css",style:"file:./style-index.css"};var{name:_ce}=J8,xce={icon:TB,edit:vce,save:yce},awe=()=>E({name:_ce,metadata:J8,settings:xce});var GA={};Z(GA,{init:()=>swe,metadata:()=>r7,name:()=>Pce,settings:()=>Bce});var t7=o(P(),1),Ic=o(T(),1),J2=o(V(),1),af=o(U(),1);var Ui=o(P(),1),ys=o(T(),1),Xm=o(M(),1);var e7=o(V(),1);var ha=o(v(),1);function nwe({tabClientId:e,tabIndex:t,tabsCount:r,tabsMenuClientId:a,tabsClientId:n}){let{moveBlocksUp:i,moveBlocksDown:l,updateBlockAttributes:s,__unstableMarkNextChangeAsNotPersistent:c}=(0,e7.useDispatch)(ys.store),{tabPanelClientId:u,orientation:m}=(0,e7.useSelect)(x=>{let{getBlockRootClientId:S,getBlockAttributes:C}=x(ys.store),N=a?C(a):null;return{tabPanelClientId:S(e),orientation:N?.layout?.orientation||"horizontal"}},[e,a]),p=t===0,d=t===r-1,f=m==="horizontal",h,g,b,y;f?(0,Ui.isRTL)()?(h=sy,g=ny,b=(0,Ui.__)("Move tab right"),y=(0,Ui.__)("Move tab left")):(h=ny,g=sy,b=(0,Ui.__)("Move tab left"),y=(0,Ui.__)("Move tab right")):(h=T0,g=bp,b=(0,Ui.__)("Move tab up"),y=(0,Ui.__)("Move tab down"));let k=()=>{i([e],u),n&&(c(),s(n,{editorActiveTabIndex:t-1}))},_=()=>{l([e],u),n&&(c(),s(n,{editorActiveTabIndex:t+1}))};return r<=1?null:(0,ha.jsx)(ys.BlockControls,{group:"parent",children:(0,ha.jsx)(Xm.ToolbarGroup,{className:w("block-editor-block-mover",{"is-horizontal":f}),children:(0,ha.jsxs)("div",{className:"block-editor-block-mover__move-button-container",children:[(0,ha.jsx)(Xm.ToolbarItem,{children:x=>(0,ha.jsx)(Xm.Button,{className:w("block-editor-block-mover-button","is-up-button"),icon:h,label:b,disabled:p,accessibleWhenDisabled:!0,onClick:k,__next40pxDefaultSize:!0,...x})}),(0,ha.jsx)(Xm.ToolbarItem,{children:x=>(0,ha.jsx)(Xm.Button,{className:w("block-editor-block-mover-button","is-down-button"),icon:g,label:y,disabled:d,accessibleWhenDisabled:!0,onClick:_,__next40pxDefaultSize:!0,...x})})]})})})}function kce({attributes:e,setAttributes:t,clientId:r,tabsClientId:a,tabClientId:n,tabIndex:i,tabsCount:l,tabsMenuClientId:s,activeBackgroundColor:c,setActiveBackgroundColor:u,activeTextColor:m,setActiveTextColor:p,hoverBackgroundColor:d,setHoverBackgroundColor:f,hoverTextColor:h,setHoverTextColor:g}){let{customActiveBackgroundColor:b,customActiveTextColor:y,customHoverBackgroundColor:k,customHoverTextColor:_}=e,x=(0,ys.__experimentalUseMultipleOriginColorsAndGradients)();return(0,ha.jsxs)(ha.Fragment,{children:[(0,ha.jsx)(nwe,{tabClientId:n,tabIndex:i,tabsCount:l,tabsMenuClientId:s,tabsClientId:a}),(0,ha.jsx)(fs,{tabsClientId:a}),(0,ha.jsx)(hs,{tabsClientId:a}),(0,ha.jsx)(ys.InspectorControls,{group:"color",children:(0,ha.jsx)(ys.__experimentalColorGradientSettingsDropdown,{settings:[{label:(0,Ui.__)("Active background"),colorValue:c?.color??b,onColorChange:S=>{u(S),t({customActiveBackgroundColor:S})},resetAllFilter:()=>{u(void 0),t({customActiveBackgroundColor:void 0})},clearable:!0},{label:(0,Ui.__)("Active text"),colorValue:m?.color??y,onColorChange:S=>{p(S),t({customActiveTextColor:S})},resetAllFilter:()=>{p(void 0),t({customActiveTextColor:void 0})},clearable:!0},{label:(0,Ui.__)("Hover background"),colorValue:d?.color??k,onColorChange:S=>{f(S),t({customHoverBackgroundColor:S})},resetAllFilter:()=>{f(void 0),t({customHoverBackgroundColor:void 0})},clearable:!0},{label:(0,Ui.__)("Hover text"),colorValue:h?.color??_,onColorChange:S=>{g(S),t({customHoverTextColor:S})},resetAllFilter:()=>{g(void 0),t({customHoverTextColor:void 0})},clearable:!0}],panelId:r,disableCustomColors:!1,__experimentalIsRenderedInSidebar:!0,__next40pxDefaultSize:!0,...x})})]})}var Jm=o(v(),1);function iwe({attributes:e,setAttributes:t,context:r,clientId:a,activeBackgroundColor:n,setActiveBackgroundColor:i,activeTextColor:l,setActiveTextColor:s,hoverBackgroundColor:c,setHoverBackgroundColor:u,hoverTextColor:m,setHoverTextColor:p,__unstableLayoutClassNames:d}){let f=r["core/tabs-menu-item-index"]??0,h=r["core/tabs-menu-item-id"]??"",g=r["core/tabs-menu-item-label"]??"",b=r["core/tabs-menu-item-clientId"]??"",y=r["core/tabs-list"],k=(0,af.useMemo)(()=>y||[],[y]),_=r["core/tabs-activeTabIndex"]??0,x=r["core/tabs-editorActiveTabIndex"],S=(0,af.useMemo)(()=>x??_,[x,_]),C=f===S,{__unstableMarkNextChangeAsNotPersistent:N}=(0,J2.useDispatch)(Ic.store),{tabsClientId:B,tabsMenuClientId:D,selectedTabClientId:A}=(0,J2.useSelect)(O=>{let{getBlockRootClientId:J,getSelectedBlockClientIds:ee,hasSelectedInnerBlock:oe}=O(Ic.store),X=J(a),te=X?J(X):null,ne=ee(),le=null;for(let pe of k)if(ne.includes(pe.clientId)||oe(pe.clientId,!0)){le=pe.clientId;break}return{tabsClientId:te,tabsMenuClientId:X,selectedTabClientId:le}},[a,k]),H=b===A,{updateBlockAttributes:F}=(0,J2.useDispatch)(Ic.store),z=(0,af.useCallback)(O=>{b&&F(b,{label:O,anchor:V8(O,f)})},[F,b,f]),I=(0,af.useCallback)(O=>{O.preventDefault(),B&&f!==S&&(N(),F(B,{editorActiveTabIndex:f}))},[B,f,S,F,N]),R=(0,af.useMemo)(()=>{let O={},J=n?.color||e.customActiveBackgroundColor,ee=l?.color||e.customActiveTextColor,oe=c?.color||e.customHoverBackgroundColor,X=m?.color||e.customHoverTextColor;return J&&(O["--custom-tab-active-color"]=J),ee&&(O["--custom-tab-active-text-color"]=ee),oe&&(O["--custom-tab-hover-color"]=oe),X&&(O["--custom-tab-hover-text-color"]=X),O},[n?.color,e.customActiveBackgroundColor,l?.color,e.customActiveTextColor,c?.color,e.customHoverBackgroundColor,m?.color,e.customHoverTextColor]),$=h||`tab-${f}`,j=`${$}--tab`,G=(0,Ic.useBlockProps)({className:w(d,{"is-active":C,"is-selected":H}),style:R,"aria-controls":$,"aria-selected":C,id:j,role:"tab",tabIndex:-1,onClick:I});return(0,Jm.jsxs)(Jm.Fragment,{children:[(0,Jm.jsx)(kce,{attributes:e,setAttributes:t,clientId:a,tabsClientId:B,tabClientId:b,tabIndex:f,tabsCount:k.length,tabsMenuClientId:D,activeBackgroundColor:n,setActiveBackgroundColor:i,activeTextColor:l,setActiveTextColor:s,hoverBackgroundColor:c,setHoverBackgroundColor:u,hoverTextColor:m,setHoverTextColor:p}),(0,Jm.jsx)("div",{...G,children:(0,Jm.jsx)(Ic.RichText,{tagName:"span",withoutInteractiveFormatting:!0,placeholder:(0,t7.sprintf)((0,t7.__)("Tab title %d"),f+1),value:g||"",onChange:z})})]})}var wce=(0,Ic.withColors)("activeBackgroundColor","activeTextColor","hoverBackgroundColor","hoverTextColor")(iwe);var Cce=o(T(),1),Sce=o(v(),1);function Tce({attributes:e}){let t={};e.customActiveBackgroundColor&&(t["--custom-tab-active-color"]=e.customActiveBackgroundColor),e.customActiveTextColor&&(t["--custom-tab-active-text-color"]=e.customActiveTextColor),e.customHoverBackgroundColor&&(t["--custom-tab-hover-color"]=e.customHoverBackgroundColor),e.customHoverTextColor&&(t["--custom-tab-hover-text-color"]=e.customHoverTextColor);let r=Cce.useBlockProps.save({className:"wp-block-tabs-menu-item__template",style:t,type:"button",role:"tab"});return(0,Sce.jsx)("button",{...r})}var r7={$schema:"https://schemas.wp.org/trunk/block.json",__experimental:!0,apiVersion:3,name:"core/tabs-menu-item",title:"Tab Menu Item",description:"A single tab button in the tabs menu. Used as a template for styling all tab buttons.",version:"1.0.0",category:"design",textdomain:"default",parent:["core/tabs-menu"],usesContext:["core/tabs-menu-item-index","core/tabs-menu-item-id","core/tabs-menu-item-label","core/tabs-menu-item-clientId","core/tabs-list","core/tabs-activeTabIndex","core/tabs-editorActiveTabIndex"],attributes:{activeBackgroundColor:{type:"string"},customActiveBackgroundColor:{type:"string"},activeTextColor:{type:"string"},customActiveTextColor:{type:"string"},hoverBackgroundColor:{type:"string"},customHoverBackgroundColor:{type:"string"},hoverTextColor:{type:"string"},customHoverTextColor:{type:"string"}},supports:{html:!1,reusable:!1,lock:!1,color:{background:!0,text:!0,__experimentalDefaultControls:{background:!0,text:!0}},shadow:!0,typography:{fontSize:!0,__experimentalFontFamily:!0,textAlign:!0,__experimentalDefaultControls:{fontSize:!0}},layout:{allowEditing:!1},spacing:{padding:!0,__experimentalDefaultControls:{padding:!0}},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0}},editorScript:"file:./index.js",editorStyle:"file:./editor.css",style:"file:./style-index.css"};var{name:Pce}=r7,Bce={icon:CB,edit:wce,save:Tce},swe=()=>E({name:Pce,metadata:r7,settings:Bce});var $A={};Z($A,{init:()=>fwe,metadata:()=>o7,name:()=>zce,settings:()=>Vce});var WA=o(W(),1),cwe={from:[{type:"block",blocks:["core/categories"],transform:()=>(0,WA.createBlock)("core/tag-cloud")}],to:[{type:"block",blocks:["core/categories"],transform:()=>(0,WA.createBlock)("core/categories")}]},Ice=cwe;var o7={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/tag-cloud",title:"Tag Cloud",category:"widgets",description:"A cloud of popular keywords, each sized by how often it appears.",textdomain:"default",attributes:{numberOfTags:{type:"number",default:45,minimum:1,maximum:100},taxonomy:{type:"string",default:"post_tag"},showTagCounts:{type:"boolean",default:!1},smallestFontSize:{type:"string",default:"8pt"},largestFontSize:{type:"string",default:"22pt"}},styles:[{name:"default",label:"Default",isDefault:!0},{name:"outline",label:"Outline"}],supports:{anchor:!0,html:!1,align:!0,spacing:{margin:!0,padding:!0},typography:{lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalLetterSpacing:!0},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}}}};var Vt=o(M(),1),Dce=o(V(),1),bn=o(P(),1),Wg=o(T(),1),Lce=o(Q(),1),Mce=o(Fu(),1),Ace=o(me(),1);var vr=o(v(),1),mwe=1,pwe=100,Nce=.1,Ece=100;function dwe({attributes:e,setAttributes:t,name:r}){let{taxonomy:a,showTagCounts:n,numberOfTags:i,smallestFontSize:l,largestFontSize:s}=e,[c]=(0,Wg.useSettings)("spacing.units"),u=q(),m=(0,Vt.__experimentalUseCustomUnits)({availableUnits:c?[...c,"pt"]:["%","px","em","rem","pt"]}),p=(0,Dce.useSelect)(x=>x(Lce.store).getTaxonomies({per_page:-1}),[]),d=()=>{let x={label:(0,bn.__)("- Select -"),value:"",disabled:!0},S=(p??[]).filter(C=>!!C.show_cloud).map(C=>({value:C.slug,label:C.name}));return[x,...S]},f=(x,S)=>{let[C,N]=(0,Vt.__experimentalParseQuantityAndUnitFromRawValue)(S);if(!Number.isFinite(C))return;let B={[x]:S};Object.entries({smallestFontSize:l,largestFontSize:s}).forEach(([D,A])=>{let[H,F]=(0,Vt.__experimentalParseQuantityAndUnitFromRawValue)(A);D!==x&&F!==N&&(B[D]=`${H}${N}`)}),t(B)},h=(0,vr.jsx)(Wg.InspectorControls,{children:(0,vr.jsxs)(Vt.__experimentalToolsPanel,{label:(0,bn.__)("Settings"),resetAll:()=>{t({taxonomy:"post_tag",showTagCounts:!1,numberOfTags:45,smallestFontSize:"8pt",largestFontSize:"22pt"})},dropdownMenuProps:u,children:[(0,vr.jsx)(Vt.__experimentalToolsPanelItem,{hasValue:()=>a!=="post_tag",label:(0,bn.__)("Taxonomy"),onDeselect:()=>t({taxonomy:"post_tag"}),isShownByDefault:!0,children:(0,vr.jsx)(Vt.SelectControl,{__next40pxDefaultSize:!0,label:(0,bn.__)("Taxonomy"),options:d(),value:a,onChange:x=>t({taxonomy:x})})}),(0,vr.jsx)(Vt.__experimentalToolsPanelItem,{hasValue:()=>l!=="8pt"||s!=="22pt",label:(0,bn.__)("Font size"),onDeselect:()=>t({smallestFontSize:"8pt",largestFontSize:"22pt"}),isShownByDefault:!0,children:(0,vr.jsxs)(Vt.Flex,{gap:4,children:[(0,vr.jsx)(Vt.FlexItem,{isBlock:!0,children:(0,vr.jsx)(Vt.__experimentalUnitControl,{label:(0,bn.__)("Smallest size"),value:l,onChange:x=>{f("smallestFontSize",x)},units:m,min:Nce,max:Ece,size:"__unstable-large"})}),(0,vr.jsx)(Vt.FlexItem,{isBlock:!0,children:(0,vr.jsx)(Vt.__experimentalUnitControl,{label:(0,bn.__)("Largest size"),value:s,onChange:x=>{f("largestFontSize",x)},units:m,min:Nce,max:Ece,size:"__unstable-large"})})]})}),(0,vr.jsx)(Vt.__experimentalToolsPanelItem,{hasValue:()=>i!==45,label:(0,bn.__)("Number of tags"),onDeselect:()=>t({numberOfTags:45}),isShownByDefault:!0,children:(0,vr.jsx)(Vt.RangeControl,{__next40pxDefaultSize:!0,label:(0,bn.__)("Number of tags"),value:i,onChange:x=>t({numberOfTags:x}),min:mwe,max:pwe,required:!0})}),(0,vr.jsx)(Vt.__experimentalToolsPanelItem,{hasValue:()=>n!==!1,label:(0,bn.__)("Show tag counts"),onDeselect:()=>t({showTagCounts:!1}),isShownByDefault:!0,children:(0,vr.jsx)(Vt.ToggleControl,{label:(0,bn.__)("Show tag counts"),checked:n,onChange:()=>t({showTagCounts:!n})})})]})}),{content:g,status:b,error:y}=(0,Mce.useServerSideRender)({attributes:e,skipBlockSupportAttributes:!0,block:r}),k=(0,Ace.useDisabled)(),_=(0,Wg.useBlockProps)({ref:k});return(0,vr.jsxs)(vr.Fragment,{children:[h,b==="loading"&&(0,vr.jsx)("div",{..._,children:(0,vr.jsx)(Vt.Spinner,{})}),b==="error"&&(0,vr.jsx)("div",{..._,children:(0,vr.jsx)("p",{children:(0,bn.sprintf)((0,bn.__)("Error: %s"),y)})}),b==="success"&&(0,vr.jsx)(uo,{wrapperProps:_,html:g})]})}var Rce=dwe;var{name:zce}=o7,Vce={icon:f1,example:{},edit:Rce,transforms:Ice},fwe=()=>E({name:zce,metadata:o7,settings:Vce});var YA={};Z(YA,{init:()=>kwe,metadata:()=>a7,name:()=>wue,settings:()=>Cue});var _ue=o(Q(),1),xue=o(V(),1);var QA=o(Yc(),1),kue=o(Wo(),1);var a7={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/template-part",title:"Template Part",category:"theme",description:"Edit the different global regions of your site, like the header, footer, sidebar, or create your own.",textdomain:"default",attributes:{slug:{type:"string"},theme:{type:"string"},tagName:{type:"string"},area:{type:"string"}},supports:{align:!0,html:!1,reusable:!1,renaming:!1,interactivity:{clientNavigation:!0}},editorStyle:"wp-block-template-part-editor"};var pue=o(W(),1),Xg=o(V(),1),so=o(T(),1),Dc=o(M(),1),Wi=o(P(),1),ab=o(Q(),1),due=o(U(),1),fue=o(xr(),1);var tp=o(P(),1),lf=o(M(),1),Gce=o(U(),1),Wce=o(V(),1),$ce=o(Q(),1);var $g=o(V(),1),n7=o(Q(),1),Fce=o(T(),1),Hce=o(U(),1),Oce=o(W(),1),qA=o(P(),1);function qg(e,t){let{templateParts:r,isResolving:a}=(0,$g.useSelect)(i=>{let{getEntityRecords:l,isResolving:s}=i(n7.store),c={per_page:-1};return{templateParts:l("postType","wp_template_part",c),isResolving:s("getEntityRecords",["postType","wp_template_part",c])}},[]);return{templateParts:(0,Hce.useMemo)(()=>r?r.filter(i=>nn(i.theme,i.slug)!==t&&(!e||e==="uncategorized"||i.area===e))||[]:[],[r,e,t]),isResolving:a}}function Zg(e,t){return(0,$g.useSelect)(r=>{let a=e?`core/template-part/${e}`:"core/template-part",{getBlockRootClientId:n,getPatternsByBlockTypes:i}=r(Fce.store),l=n(t);return i(a,l)},[e,t])}function i7(e,t){let{saveEntityRecord:r}=(0,$g.useDispatch)(n7.store);return async(a=[],n=(0,qA.__)("Untitled Template Part"))=>{let i=c3(n).replace(/[^\w-]+/g,"")||"wp-custom-part",l={title:n,slug:i,content:(0,Oce.serialize)(a),area:e},s=await r("postType","wp_template_part",l);t({slug:s.slug,theme:s.theme,area:void 0})}}function l7(e){return(0,$g.useSelect)(t=>{let r=t(n7.store).getCurrentTheme()?.default_template_part_areas||[],a=r.find(i=>i.area===e),n=r.find(i=>i.area==="uncategorized");return{icon:a?.icon||n?.icon,label:a?.label||(0,qA.__)("Template Part"),tagName:a?.area_tag??"div"}},[e])}var jce=o(U(),1),ep=o(P(),1),_s=o(M(),1),Du=o(v(),1);function Uce({areaLabel:e,onClose:t,onSubmit:r}){let[a,n]=(0,jce.useState)(""),i=l=>{l.preventDefault(),r(a)};return(0,Du.jsx)(_s.Modal,{title:(0,ep.sprintf)((0,ep.__)("Create new %s"),e.toLowerCase()),onRequestClose:t,focusOnMount:"firstContentElement",size:"small",children:(0,Du.jsx)("form",{onSubmit:i,children:(0,Du.jsxs)(_s.__experimentalVStack,{spacing:"5",children:[(0,Du.jsx)(_s.TextControl,{label:(0,ep.__)("Name"),value:a,onChange:n,placeholder:(0,ep.__)("Custom Template Part"),__next40pxDefaultSize:!0}),(0,Du.jsxs)(_s.__experimentalHStack,{justify:"right",children:[(0,Du.jsx)(_s.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{t(),n("")},children:(0,ep.__)("Cancel")}),(0,Du.jsx)(_s.Button,{variant:"primary",type:"submit",accessibleWhenDisabled:!0,disabled:!a.length,__next40pxDefaultSize:!0,children:(0,ep.__)("Create")})]})]})})})}var nf=o(v(),1);function qce({area:e,clientId:t,templatePartId:r,onOpenSelectionModal:a,setAttributes:n}){let{templateParts:i,isResolving:l}=qg(e,r),s=Zg(e,t),{isBlockBasedTheme:c,canCreateTemplatePart:u}=(0,Wce.useSelect)(h=>{let{getCurrentTheme:g,canUser:b}=h($ce.store);return{isBlockBasedTheme:g()?.is_block_theme,canCreateTemplatePart:b("create",{kind:"postType",name:"wp_template_part"})}},[]),[m,p]=(0,Gce.useState)(!1),d=l7(e),f=i7(e,n);return(0,nf.jsxs)(lf.Placeholder,{icon:Xh(d.icon),label:d.label,instructions:c?(0,tp.sprintf)((0,tp.__)("Choose an existing %s or create a new one."),d.label.toLowerCase()):(0,tp.sprintf)((0,tp.__)("Choose an existing %s."),d.label.toLowerCase()),children:[l&&(0,nf.jsx)(lf.Spinner,{}),!l&&!!(i.length||s.length)&&(0,nf.jsx)(lf.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:a,children:(0,tp.__)("Choose")}),!l&&c&&u&&(0,nf.jsx)(lf.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>{p(!0)},children:(0,tp.__)("Start blank")}),m&&(0,nf.jsx)(Uce,{areaLabel:d.label,onClose:()=>p(!1),onSubmit:h=>{f([],h)}})]})}var eb=o(U(),1),rp=o(P(),1),Qce=o(xr(),1),Yce=o(V(),1),Xce=o(T(),1),s7=o(M(),1);var Zce=o(W(),1);function Kce(e){return{name:nn(e.theme,e.slug),title:e.title.rendered,blocks:(0,Zce.parse)(e.content.raw),templatePart:e}}var Nc=o(v(),1);function Jce({setAttributes:e,onClose:t,templatePartId:r=null,area:a,clientId:n}){let[i,l]=(0,eb.useState)(""),{templateParts:s}=qg(a,r),c=(0,eb.useMemo)(()=>{let g=s.map(b=>Kce(b));return dv(g,i)},[s,i]),u=Zg(a,n),m=(0,eb.useMemo)(()=>dv(u,i),[u,i]),{createSuccessNotice:p}=(0,Yce.useDispatch)(Qce.store),d=g=>{e({slug:g.slug,theme:g.theme,area:void 0}),p((0,rp.sprintf)((0,rp.__)('Template Part "%s" inserted.'),g.title?.rendered||g.slug),{type:"snackbar"}),t()},f=!!c.length,h=!!m.length;return(0,Nc.jsxs)("div",{className:"block-library-template-part__selection-content",children:[(0,Nc.jsx)("div",{className:"block-library-template-part__selection-search",children:(0,Nc.jsx)(s7.SearchControl,{onChange:l,value:i,label:(0,rp.__)("Search"),placeholder:(0,rp.__)("Search")})}),f&&(0,Nc.jsxs)("div",{children:[(0,Nc.jsx)("h2",{children:(0,rp.__)("Existing template parts")}),(0,Nc.jsx)(Xce.__experimentalBlockPatternsList,{blockPatterns:c,onClickPattern:g=>{d(g.templatePart)}})]}),!f&&!h&&(0,Nc.jsx)(s7.__experimentalHStack,{alignment:"center",children:(0,Nc.jsx)("p",{children:(0,rp.__)("No results found.")})})]})}var rb=o(Q(),1),c7=o(M(),1),Qg=o(P(),1),nue=o(V(),1),iue=o(T(),1);var Ec=o(P(),1),tb=o(U(),1),Kg=o(V(),1),Gi=o(M(),1),KA=o(Q(),1),oue=o(xr(),1);var Xn=o(W(),1);function eue(e){if(e.id_base!=="block"){let a;return e._embedded.about[0].is_multi?a={idBase:e.id_base,instance:e.instance}:a={id:e.id},tue((0,Xn.createBlock)("core/legacy-widget",a))}let t=(0,Xn.parse)(e.instance.raw.content,{__unstableSkipAutop:!0});if(!t.length)return;let r=t[0];return r.name==="core/widget-group"?(0,Xn.createBlock)((0,Xn.getGroupingBlockName)(),void 0,ZA(r.innerBlocks)):r.innerBlocks.length>0?(0,Xn.cloneBlock)(r,void 0,ZA(r.innerBlocks)):r}function tue(e){let t=(0,Xn.getPossibleBlockTransformations)([e]).filter(r=>{if(!r.transforms)return!0;let a=r.transforms?.from?.find(i=>i.blocks&&i.blocks.includes("*")),n=r.transforms?.to?.find(i=>i.blocks&&i.blocks.includes("*"));return!a&&!n});if(t.length)return(0,Xn.switchToBlockType)(e,t[0].name)}function ZA(e=[]){return e.flatMap(t=>t.name==="core/legacy-widget"?tue(t):(0,Xn.createBlock)(t.name,t.attributes,ZA(t.innerBlocks))).filter(t=>!!t)}var Lu=o(v(),1),rue={per_page:-1,_fields:"id,name,description,status,widgets"};function aue({area:e,setAttributes:t}){let[r,a]=(0,tb.useState)(""),[n,i]=(0,tb.useState)(!1),l=(0,Kg.useRegistry)(),{sidebars:s,hasResolved:c}=(0,Kg.useSelect)(f=>{let{getSidebars:h,hasFinishedResolution:g}=f(KA.store);return{sidebars:h(rue),hasResolved:g("getSidebars",[rue])}},[]),{createErrorNotice:u}=(0,Kg.useDispatch)(oue.store),m=i7(e,t),p=(0,tb.useMemo)(()=>{let f=(s??[]).filter(h=>h.id!=="wp_inactive_widgets"&&h.widgets.length>0).map(h=>({value:h.id,label:h.name}));return f.length?[{value:"",label:(0,Ec.__)("Select widget area")},...f]:[]},[s]);if(!c)return(0,Lu.jsx)(Gi.__experimentalSpacer,{marginBottom:"0"});if(c&&!p.length)return null;async function d(f){if(f.preventDefault(),n||!r)return;i(!0);let h=p.find(({value:_})=>_===r),{getWidgets:g}=l.resolveSelect(KA.store),b=await g({sidebar:h.value,_embed:"about"}),y=new Set,k=b.flatMap(_=>{let x=eue(_);return x||(y.add(_.id_base),[])});await m(k,(0,Ec.sprintf)((0,Ec.__)("Widget area: %s"),h.label)),y.size&&u((0,Ec.sprintf)((0,Ec.__)("Unable to import the following widgets: %s."),Array.from(y).join(", ")),{type:"snackbar"}),i(!1)}return(0,Lu.jsx)(Gi.__experimentalSpacer,{marginBottom:"4",children:(0,Lu.jsxs)(Gi.__experimentalHStack,{as:"form",onSubmit:d,children:[(0,Lu.jsx)(Gi.FlexBlock,{children:(0,Lu.jsx)(Gi.SelectControl,{label:(0,Ec.__)("Import widget area"),value:r,options:p,onChange:f=>a(f),disabled:!p.length,__next40pxDefaultSize:!0})}),(0,Lu.jsx)(Gi.FlexItem,{style:{marginBottom:"8px",marginTop:"auto"},children:(0,Lu.jsx)(Gi.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",isBusy:n,"aria-disabled":n||!r,children:(0,Ec._x)("Import","button label")})})]})})}var xs=o(v(),1),{HTMLElementControl:gwe}=K(iue.privateApis);function lue({tagName:e,setAttributes:t,isEntityAvailable:r,templatePartId:a,defaultWrapper:n,hasInnerBlocks:i,clientId:l}){let[s,c]=(0,rb.useEntityProp)("postType","wp_template_part","area",a),[u,m]=(0,rb.useEntityProp)("postType","wp_template_part","title",a),d=(0,nue.useSelect)(f=>f(rb.store).getCurrentTheme()?.default_template_part_areas||[],[]).map(({label:f,area:h})=>({label:f,value:h}));return(0,xs.jsxs)(xs.Fragment,{children:[r&&(0,xs.jsxs)(xs.Fragment,{children:[(0,xs.jsx)(c7.TextControl,{__next40pxDefaultSize:!0,label:(0,Qg.__)("Title"),value:u,onChange:f=>{m(f)},onFocus:f=>f.target.select()}),(0,xs.jsx)(c7.SelectControl,{__next40pxDefaultSize:!0,label:(0,Qg.__)("Area"),labelPosition:"top",options:d,value:s,onChange:c})]}),(0,xs.jsx)(gwe,{tagName:e||"",onChange:f=>t({tagName:f}),clientId:l,options:[{label:(0,Qg.sprintf)((0,Qg.__)("Default based on area (%s)"),`<${n}>`),value:""},{label:"<header>",value:"header"},{label:"<main>",value:"main"},{label:"<section>",value:"section"},{label:"<article>",value:"article"},{label:"<aside>",value:"aside"},{label:"<footer>",value:"footer"},{label:"<div>",value:"div"}]}),!i&&(0,xs.jsx)(aue,{area:s,setAttributes:t})]})}var Yg=o(Q(),1),Jn=o(T(),1),ob=o(V(),1),sue=o(U(),1),cue=o(W(),1),u7=o(v(),1);function vwe(e){if((0,Jn.useBlockEditingMode)()==="contentOnly")return!1;if(!e)return Jn.InnerBlocks.ButtonBlockAppender}function uue(e){let t=(0,ob.useSelect)(a=>{let{getSettings:n}=a(Jn.store);return n()?.supportsLayout},[]),[r]=(0,Jn.useSettings)("layout");if(t)return e?.inherit?r||{}:e}function bwe({postId:e,layout:t,tagName:r,blockProps:a}){(0,Jn.useBlockEditingMode)("disabled");let{content:n,editedBlocks:i}=(0,ob.useSelect)(c=>{if(!e)return{};let{getEditedEntityRecord:u}=c(Yg.store),m=u("postType","wp_template_part",e,{context:"view"});return{editedBlocks:m.blocks,content:m.content}},[e]),l=(0,sue.useMemo)(()=>{if(e)return i||(!n||typeof n!="string"?[]:(0,cue.parse)(n))},[e,i,n]),s=(0,Jn.useInnerBlocksProps)(a,{value:l,onInput:()=>{},onChange:()=>{},renderAppender:!1,layout:uue(t)});return(0,u7.jsx)(r,{...s})}function ywe({postId:e,hasInnerBlocks:t,layout:r,tagName:a,blockProps:n}){let i=(0,ob.useSelect)(d=>d(Jn.store).getSettings().onNavigateToEntityRecord,[]),[l,s,c]=(0,Yg.useEntityBlockEditor)("postType","wp_template_part",{id:e}),u=(0,Jn.useInnerBlocksProps)(n,{value:l,onInput:s,onChange:c,renderAppender:vwe(t),layout:uue(r)}),p=(0,Jn.useBlockEditingMode)()==="contentOnly"&&i?{onDoubleClick:()=>i({postId:e,postType:"wp_template_part"})}:{};return(0,u7.jsx)(a,{...u,...p})}function mue({postId:e,hasInnerBlocks:t,layout:r,tagName:a,blockProps:n}){let{canViewTemplatePart:i,canEditTemplatePart:l}=(0,ob.useSelect)(c=>({canViewTemplatePart:!!c(Yg.store).canUser("read",{kind:"postType",name:"wp_template_part",id:e}),canEditTemplatePart:!!c(Yg.store).canUser("update",{kind:"postType",name:"wp_template_part",id:e})}),[e]);return i?(0,u7.jsx)(l?ywe:bwe,{postId:e,hasInnerBlocks:t,layout:r,tagName:a,blockProps:n}):null}var Ft=o(v(),1),hue=["header","footer","navigation-overlay"];function _we({isEntityAvailable:e,area:t,templatePartId:r,isTemplatePartSelectionOpen:a,setIsTemplatePartSelectionOpen:n}){let{templateParts:i}=qg(t,r),l=!!i.length;return e&&l&&hue.includes(t)?(0,Ft.jsx)(Dc.MenuItem,{onClick:()=>{n(!0)},"aria-expanded":a,"aria-haspopup":"dialog",children:(0,Wi.__)("Replace")}):null}function xwe({area:e,clientId:t,isEntityAvailable:r,onSelect:a}){let n=Zg(e,t);return r&&!!n.length&&hue.includes(e)?(0,Ft.jsx)(Dc.PanelBody,{title:(0,Wi.__)("Design"),children:(0,Ft.jsx)(so.__experimentalBlockPatternsList,{label:(0,Wi.__)("Templates"),blockPatterns:n,onClickPattern:a,showTitlesAsTooltip:!0})}):null}function gue({attributes:e,setAttributes:t,clientId:r}){let{createSuccessNotice:a}=(0,Xg.useDispatch)(fue.store),{editEntityRecord:n}=(0,Xg.useDispatch)(ab.store),i=(0,Xg.useSelect)(H=>H(ab.store).getCurrentTheme()?.stylesheet,[]),{slug:l,theme:s=i,tagName:c,layout:u={}}=e,m=nn(s,l),p=(0,so.useHasRecursion)(m),[d,f]=(0,due.useState)(!1),{isResolved:h,hasInnerBlocks:g,isMissing:b,area:y,onNavigateToEntityRecord:k,title:_,canUserEdit:x}=(0,Xg.useSelect)(H=>{let{getEditedEntityRecord:F,hasFinishedResolution:z}=H(ab.store),{getBlockCount:I,getSettings:R}=H(so.store),$=["postType","wp_template_part",m],j=m?F(...$):null,G=j?.area||e.area,O=m?z("getEditedEntityRecord",$):!1,J=O?H(ab.store).canUser("update",{kind:"postType",name:"wp_template_part",id:m}):!1;return{hasInnerBlocks:I(r)>0,isResolved:O,isMissing:O&&(!j||Object.keys(j).length===0),area:G,onNavigateToEntityRecord:R().onNavigateToEntityRecord,title:j?.title,canUserEdit:!!J}},[m,e.area,r]),S=l7(y),C=(0,so.useBlockProps)(),N=!l,B=!N&&!b&&h,D=c||S.tagName,A=async H=>{await n("postType","wp_template_part",m,{blocks:H.blocks,content:(0,pue.serialize)(H.blocks)}),a((0,Wi.sprintf)((0,Wi.__)('Template Part "%s" updated.'),_||l),{type:"snackbar"})};return!g&&(l&&!s||l&&b)?(0,Ft.jsx)(D,{...C,children:(0,Ft.jsx)(so.Warning,{children:(0,Wi.sprintf)((0,Wi.__)("Template part has been deleted or is unavailable: %s"),l)})}):B&&p?(0,Ft.jsx)(D,{...C,children:(0,Ft.jsx)(so.Warning,{children:(0,Wi.__)("Block cannot be rendered inside itself.")})}):(0,Ft.jsxs)(Ft.Fragment,{children:[(0,Ft.jsxs)(so.RecursionProvider,{uniqueId:m,children:[B&&k&&x&&(0,Ft.jsx)(so.BlockControls,{group:"other",children:(0,Ft.jsx)(Dc.ToolbarButton,{onClick:()=>{k({postId:m,postType:"wp_template_part"})},children:(0,Wi.__)("Edit original")})}),x&&(0,Ft.jsx)(so.InspectorControls,{group:"advanced",children:(0,Ft.jsx)(lue,{tagName:c,setAttributes:t,isEntityAvailable:B,templatePartId:m,defaultWrapper:S.tagName,hasInnerBlocks:g,clientId:r})}),N&&(0,Ft.jsx)(D,{...C,children:(0,Ft.jsx)(qce,{area:e.area,templatePartId:m,clientId:r,setAttributes:t,onOpenSelectionModal:()=>f(!0)})}),(0,Ft.jsx)(so.BlockSettingsMenuControls,{children:({selectedClientIds:H})=>H.length===1&&r===H[0]?(0,Ft.jsx)(_we,{isEntityAvailable:B,area:y,clientId:r,templatePartId:m,isTemplatePartSelectionOpen:d,setIsTemplatePartSelectionOpen:f}):null}),(0,Ft.jsx)(so.InspectorControls,{group:"settings",children:(0,Ft.jsx)(xwe,{area:y,clientId:r,isEntityAvailable:B,onSelect:H=>A(H)})}),B&&(0,Ft.jsx)(mue,{tagName:D,blockProps:C,postId:m,hasInnerBlocks:g,layout:u}),!N&&!h&&(0,Ft.jsx)(D,{...C,children:(0,Ft.jsx)(Dc.Spinner,{})})]}),d&&(0,Ft.jsx)(Dc.Modal,{overlayClassName:"block-editor-template-part__selection-modal",title:(0,Wi.sprintf)((0,Wi.__)("Choose a %s"),S.label.toLowerCase()),onRequestClose:()=>f(!1),isFullScreen:!0,children:(0,Ft.jsx)(Jce,{templatePartId:m,clientId:r,area:y,setAttributes:t,onClose:()=>f(!1)})})]})}var vue=o(Q(),1),bue=o(V(),1);function yue(e,t){if(t!=="core/template-part")return e;if(e.variations){let r=(n,i)=>{let{area:l,theme:s,slug:c}=n;if(l)return l===i.area;if(!c)return!1;let{getCurrentTheme:u,getEntityRecord:m}=(0,bue.select)(vue.store),p=m("postType","wp_template_part",`${s||u()?.stylesheet}//${c}`);return p?.slug?p.slug===i.slug:p?.area===i.area},a=e.variations.map(n=>({...n,...!n.isActive&&{isActive:r},...typeof n.icon=="string"&&{icon:Xh(n.icon)}}));return{...e,variations:a}}return e}var{name:wue}=a7,Cue={icon:u1,__experimentalLabel:({slug:e,theme:t})=>{if(!e)return;let{getCurrentTheme:r,getEditedEntityRecord:a}=(0,xue.select)(_ue.store),n=a("postType","wp_template_part",(t||r()?.stylesheet)+"//"+e);if(n)return(0,kue.decodeEntities)(n.title)||LQ(n.slug||"")},edit:gue},kwe=()=>{(0,QA.addFilter)("blocks.registerBlockType","core/template-part",yue);let e=["core/post-template","core/post-content"];return(0,QA.addFilter)("blockEditor.__unstableCanInsertBlockType","core/block-library/removeTemplatePartsFromPostTemplates",(t,r,a,{getBlock:n,getBlockParentsByBlockName:i})=>{if(r.name!=="core/template-part")return t;for(let l of e)if(n(a)?.name===l||i(a,l).length)return!1;return!0}),E({name:wue,metadata:a7,settings:Cue})};var tR={};Z(tR,{init:()=>Swe,metadata:()=>m7,name:()=>Due,settings:()=>Lue});var m7={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/term-count",title:"Term Count",category:"theme",description:"Displays the post count of a taxonomy term.",textdomain:"default",usesContext:["termId","taxonomy"],attributes:{bracketType:{type:"string",enum:["none","round","square","curly","angle"],default:"round"}},supports:{anchor:!0,html:!1,color:{gradients:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{color:!0,width:!0,style:!0}}},style:"wp-block-term-count"};var sf=o(P(),1),p7=o(T(),1),Nue=o(M(),1);var xl=o(M(),1),ks=o(v(),1),XA=(0,ks.jsx)(xl.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,ks.jsx)(xl.Path,{d:"M 10 6 L 9.609375 9 L 7 9 L 7 10.5 L 9.4121094 10.5 L 9.0878906 13 L 7 13 L 7 14.5 L 8.890625 14.5 L 8.5 17.5 L 10 17.5 L 10.390625 14.5 L 12.890625 14.5 L 12.5 17.5 L 14 17.5 L 14.390625 14.5 L 17 14.5 L 17 13 L 14.587891 13 L 14.912109 10.5 L 17 10.5 L 17 9 L 15.109375 9 L 15.5 6 L 14 6 L 13.609375 9 L 11.109375 9 L 11.5 6 L 10 6 z M 10.912109 10.5 L 13.412109 10.5 L 13.087891 13 L 10.587891 13 L 10.912109 10.5 z"})}),Sue=(0,ks.jsx)(xl.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,ks.jsx)(xl.Path,{d:"M 10,6 9.609375,9 H 7 v 1.5 H 9.4121094 L 9.0878906,13 H 7 v 1.5 H 8.890625 L 8.5,17.5 H 10 l 0.390625,-3 h 2.5 L 12.5,17.5 H 14 l 0.390625,-3 H 17 V 13 h -2.412109 l 0.324218,-2.5 H 17 V 9 H 15.109375 L 15.5,6 H 14 l -0.390625,3 h -2.5 L 11.5,6 Z m 0.912109,4.5 h 2.5 L 13.087891,13 h -2.5 z M 18.5,3 c 0,0 1.5,4.004036 1.5,9 0,4.995964 -1.5,9 -1.5,9 H 20 c 0,0 1.5,-4.004036 1.5,-9 C 21.5,7.004036 20,3 20,3 Z M 5.5,21 C 5.5,21 4,16.995964 4,12 4,7.0040356 5.5,3 5.5,3 H 4 c 0,0 -1.5,4.004036 -1.5,9 0,4.995964 1.5,9 1.5,9 z"})}),Tue=(0,ks.jsx)(xl.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,ks.jsx)(xl.Path,{d:"M 21.5,21 V 3 H 18 v 1.5 h 2 v 15 H 18 V 21 Z M 2.5,3 V 21 H 6 V 19.5 H 4 V 4.5 H 6 V 3 Z M 10,6 9.609375,9 H 7 v 1.5 H 9.4121094 L 9.0878906,13 H 7 v 1.5 H 8.890625 L 8.5,17.5 H 10 l 0.390625,-3 h 2.5 L 12.5,17.5 H 14 l 0.390625,-3 H 17 V 13 h -2.412109 l 0.324218,-2.5 H 17 V 9 H 15.109375 L 15.5,6 H 14 l -0.390625,3 h -2.5 L 11.5,6 Z m 0.912109,4.5 h 2.5 L 13.087891,13 h -2.5 z"})}),Pue=(0,ks.jsx)(xl.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,ks.jsx)(xl.Path,{d:"M 10,6 9.609375,9 H 7 v 1.5 H 9.4121094 L 9.0878906,13 H 7 v 1.5 H 8.890625 L 8.5,17.5 H 10 l 0.390625,-3 h 2.5 L 12.5,17.5 H 14 l 0.390625,-3 H 17 V 13 h -2.412109 l 0.324218,-2.5 H 17 V 9 H 15.109375 L 15.5,6 H 14 l -0.390625,3 h -2.5 L 11.5,6 Z m 0.912109,4.5 h 2.5 L 13.087891,13 h -2.5 z M 18.5,21 c 1.104567,0 2,-0.895433 2,-2 v -4 c 0,-1.104567 0.895433,-2 2,-2 v -2 c -1.104567,0 -2,-0.895433 -2,-2 V 5 c 0,-1.104567 -0.895433,-2 -2,-2 H 17 v 1.5 h 1.5 A 0.5,0.5 0 0 1 19,5 v 5 c 0,1.104567 0.895433,2 2,2 -1.104567,0 -2,0.895433 -2,2 v 5 c 0,0.276142 -0.223858,0.5 -0.5,0.5 H 17 V 21 Z M 5.5,3 c -1.1045668,0 -2,0.8954327 -2,2 v 4 c 0,1.104567 -0.8954332,2 -2,2 v 2 c 1.1045668,0 2,0.895433 2,2 v 4 c 0,1.104567 0.8954332,2 2,2 H 7 V 19.5 H 5.5 A 0.5,0.5 0 0 1 5,19 V 14 C 5,12.895433 4.1045668,12 3,12 4.1045668,12 5,11.104567 5,10 V 5 C 5,4.7238579 5.2238579,4.5 5.5,4.5 H 7 V 3 Z"})}),Bue=(0,ks.jsx)(xl.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,ks.jsx)(xl.Path,{d:"M 18.970703,16.53125 23.5,12 18.970703,7.46875 17.910156,8.53125 21.378906,12 17.910156,15.46875 Z M 5.0292969,7.46875 0.5,12 5.0292969,16.53125 6.0898438,15.46875 2.6210938,12 6.0898438,8.53125 Z M 10,6 9.609375,9 H 7 v 1.5 H 9.4121094 L 9.0878906,13 H 7 v 1.5 H 8.890625 L 8.5,17.5 H 10 l 0.390625,-3 h 2.5 L 12.5,17.5 H 14 l 0.390625,-3 H 17 V 13 h -2.412109 l 0.324218,-2.5 H 17 V 9 H 15.109375 L 15.5,6 H 14 l -0.390625,3 h -2.5 L 11.5,6 Z m 0.912109,4.5 h 2.5 L 13.087891,13 h -2.5 z"})});var nb=o(Q(),1),JA=o(V(),1);function Iue(e,t){let[r]=(0,nb.useEntityProp)("taxonomy",t,"count",e),a=Cwe(),n=!!(e&&t);return{hasContext:n,termCount:n?r||"":a}}function Cwe(){let t=(0,JA.useSelect)(n=>{let{getCurrentPostId:i,getCurrentPostType:l,getCurrentTemplateId:s}=n("core/editor"),c=l(),u=s()||(c==="wp_template"?i():null);return u?n(nb.store).getEditedEntityRecord("postType","wp_template",u)?.slug:null},[])?.match(/^(category|tag|taxonomy-([^-]+))$|^(((category|tag)|taxonomy-([^-]+))-(.+))$/),r,a;return t&&(t[1]?r=t[2]?t[2]:t[1]:t[3]&&(r=t[6]?t[6]:t[4],a=t[7]),r=r==="tag"?"post_tag":r),(0,JA.useSelect)(n=>{if(!r||!a)return"";let{getEntityRecords:i}=n(nb.store),l=i("taxonomy",r,{slug:a,per_page:1});return l&&l[0]&&l[0].count||""},[r,a])}var op=o(v(),1),eR={none:{label:(0,sf.__)("No brackets"),icon:XA},round:{label:(0,sf.__)("Round brackets"),icon:Sue,before:"(",after:")"},square:{label:(0,sf.__)("Square brackets"),icon:Tue,before:"[",after:"]"},curly:{label:(0,sf.__)("Curly brackets"),icon:Pue,before:"{",after:"}"},angle:{label:(0,sf.__)("Angle brackets"),icon:Bue,before:"<",after:">"}};function Eue({attributes:e,setAttributes:t,context:{termId:r,taxonomy:a}}){let{bracketType:n}=e,l=Iue(r,a)?.termCount||0,s=(0,p7.useBlockProps)(),c=Object.entries(eR).map(([m,{label:p,icon:d}])=>({role:"menuitemradio",title:p,isActive:n===m,icon:d,onClick:()=>{t({bracketType:m})}})),u=(m,p)=>{let{before:d="",after:f=""}=eR[p]||{};return`${d}${m}${f}`};return(0,op.jsxs)(op.Fragment,{children:[(0,op.jsx)(p7.BlockControls,{group:"block",children:(0,op.jsx)(Nue.ToolbarDropdownMenu,{icon:eR[n]?.icon??XA,label:(0,sf.__)("Change bracket type"),controls:c})}),(0,op.jsx)("div",{...s,children:u(l,n)})]})}var{name:Due}=m7,Lue={icon:NB,example:{},edit:Eue},Swe=()=>E({name:Due,metadata:m7,settings:Lue});var oR={};Z(oR,{init:()=>Iwe,metadata:()=>d7,name:()=>Fue,settings:()=>Hue});var d7={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/term-description",title:"Term Description",category:"theme",description:"Display the description of categories, tags and custom taxonomies when viewing an archive.",textdomain:"default",usesContext:["termId","taxonomy"],supports:{anchor:!0,align:["wide","full"],html:!1,color:{link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{padding:!0,margin:!0},typography:{fontSize:!0,lineHeight:!0,textAlign:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}}}};var Aue=o(P(),1),Rue=o(T(),1);var ib=o(Q(),1),rR=o(V(),1);function Mue(e,t){let[r,a,n]=(0,ib.useEntityProp)("taxonomy",t,"description",e),i=Pwe(),l=!!(e&&t);return{hasContext:l,setDescription:a,termDescription:l?n?.rendered||r||"":i}}function Pwe(){let t=(0,rR.useSelect)(n=>{let{getCurrentPostId:i,getCurrentPostType:l,getCurrentTemplateId:s}=n("core/editor"),c=l(),u=s()||(c==="wp_template"?i():null);return u?n(ib.store).getEditedEntityRecord("postType","wp_template",u)?.slug:null},[])?.match(/^(category|tag|taxonomy-([^-]+))$|^(((category|tag)|taxonomy-([^-]+))-(.+))$/),r,a;return t&&(t[1]?r=t[2]?t[2]:t[1]:t[3]&&(r=t[6]?t[6]:t[4],a=t[7]),r=r==="tag"?"post_tag":r),(0,rR.useSelect)(n=>{if(!r||!a)return"";let{getEntityRecords:i}=n(ib.store),l=i("taxonomy",r,{slug:a,per_page:1});return l&&l[0]&&l[0].description||""},[r,a])}var ap=o(v(),1);function zue({context:{termId:e,taxonomy:t}}){let{termDescription:r}=Mue(e,t),a=(0,Rue.useBlockProps)();return(0,ap.jsx)(ap.Fragment,{children:(0,ap.jsx)("div",{...a,children:r?(0,ap.jsx)("div",{dangerouslySetInnerHTML:{__html:r}}):(0,ap.jsx)("div",{className:"wp-block-term-description__placeholder",children:(0,ap.jsx)("span",{children:(0,Aue.__)("Term Description")})})})})}var Bwe={attributes:{textAlign:{type:"string"}},supports:{anchor:!0,align:["wide","full"],html:!1,color:{link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}}},migrate:We,isEligible(e){return!!e.textAlign||!!e.className?.match(/\bhas-text-align-(left|center|right)\b/)},save:()=>null},Vue=[Bwe];var{name:Fue}=d7,Hue={icon:DB,edit:zue,example:{},deprecated:Vue},Iwe=()=>E({name:Fue,metadata:d7,settings:Hue});var aR={};Z(aR,{init:()=>Dwe,metadata:()=>f7,name:()=>Gue,settings:()=>Wue});var f7={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/term-name",title:"Term Name",category:"theme",description:"Displays the name of a taxonomy term.",keywords:["term title"],textdomain:"default",usesContext:["termId","taxonomy"],attributes:{textAlign:{type:"string"},level:{type:"number",default:0},isLink:{type:"boolean",default:!1},levelOptions:{type:"array"}},supports:{anchor:!0,align:["wide","full"],html:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},spacing:{padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{color:!0,width:!0,style:!0}}},style:"wp-block-term-name"};var lb=o(P(),1),Lc=o(T(),1),Jg=o(M(),1),jue=o(Wo(),1);var h7=o(Q(),1),g7=o(V(),1);function Oue(e,t){let r=(0,g7.useSelect)(i=>!e||!t?null:i(h7.store).getEntityRecord("taxonomy",t,e),[e,t]),a=Ewe(),n=!!(e&&t);return{hasContext:n,term:n?r:a}}function Ewe(){let t=(0,g7.useSelect)(n=>{let{getCurrentPostId:i,getCurrentPostType:l,getCurrentTemplateId:s}=n("core/editor"),c=l(),u=s()||(c==="wp_template"?i():null);return u?n(h7.store).getEditedEntityRecord("postType","wp_template",u)?.slug:null},[])?.match(/^(category|tag|taxonomy-([^-]+))$|^(((category|tag)|taxonomy-([^-]+))-(.+))$/),r,a;return t&&(t[3]&&(r=t[6]?t[6]:t[4],a=t[7]),r=r==="tag"?"post_tag":r),(0,g7.useSelect)(n=>{if(!r||!a)return null;let{getEntityRecords:i}=n(h7.store),l=i("taxonomy",r,{slug:a,per_page:1});return l&&l[0]?l[0]:null},[r,a])}var ei=o(v(),1);function Uue({attributes:e,setAttributes:t,context:{termId:r,taxonomy:a}}){let{textAlign:n,level:i=0,isLink:l,levelOptions:s}=e,{term:c}=Oue(r,a),u=c?.name?(0,jue.decodeEntities)(c.name):(0,lb.__)("Term Name"),m=(0,Lc.useBlockProps)({className:w({[`has-text-align-${n}`]:n})}),p=q(),d=i===0?"p":`h${i}`,f=u;return l&&(f=(0,ei.jsx)("a",{href:"#term-name-pseudo-link",onClick:h=>h.preventDefault(),children:u})),(0,ei.jsxs)(ei.Fragment,{children:[(0,ei.jsxs)(Lc.BlockControls,{group:"block",children:[(0,ei.jsx)(Lc.HeadingLevelDropdown,{value:i,options:s,onChange:h=>{t({level:h})}}),(0,ei.jsx)(Lc.AlignmentControl,{value:n,onChange:h=>{t({textAlign:h})}})]}),(0,ei.jsx)(Lc.InspectorControls,{children:(0,ei.jsx)(Jg.__experimentalToolsPanel,{label:(0,lb.__)("Settings"),resetAll:()=>{t({isLink:!1})},dropdownMenuProps:p,children:(0,ei.jsx)(Jg.__experimentalToolsPanelItem,{hasValue:()=>!!l,label:(0,lb.__)("Make term name a link"),onDeselect:()=>t({isLink:!1}),isShownByDefault:!0,children:(0,ei.jsx)(Jg.ToggleControl,{label:(0,lb.__)("Make term name a link"),onChange:()=>t({isLink:!l}),checked:l})})})}),(0,ei.jsx)(d,{...m,children:f})]})}var{name:Gue}=f7,Wue={icon:LB,example:{},edit:Uue},Dwe=()=>E({name:Gue,metadata:f7,settings:Wue});var uR={};Z(uR,{init:()=>Hwe,metadata:()=>v7,name:()=>Dme,settings:()=>Lme});var v7={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/terms-query",title:"Terms Query",category:"theme",description:"An advanced block that allows displaying taxonomy terms based on different query parameters and visual configurations.",keywords:["terms","taxonomy","categories","tags","list"],textdomain:"default",attributes:{termQuery:{type:"object",default:{perPage:10,taxonomy:"category",order:"asc",orderBy:"name",include:[],hideEmpty:!0,showNested:!1,inherit:!1}},tagName:{type:"string",default:"div"}},usesContext:["templateSlug"],providesContext:{termQuery:"termQuery"},supports:{anchor:!0,align:["wide","full"],html:!1,layout:!0,interactivity:!0}};var Cme=o(V(),1),Sme=o(T(),1);var xme=o(U(),1),_7=o(T(),1);var ws=o(P(),1),Mc=o(M(),1),yme=o(T(),1);var $ue=o(Q(),1),que=o(V(),1),Zue=o(U(),1);function b7(){let e=(0,que.useSelect)(t=>t($ue.store).getTaxonomies({per_page:-1}),[]);return(0,Zue.useMemo)(()=>e?.filter(({visibility:t})=>t?.publicly_queryable)||[],[e])}var Kue=o(M(),1);var Que=o(v(),1);function Yue({value:e,onChange:t,...r}){let n=b7().map(i=>({label:i.name,value:i.slug}));return(0,Que.jsx)(Kue.SelectControl,{__next40pxDefaultSize:!0,options:n,value:e,onChange:t,...r})}var sb=o(P(),1),Xue=o(M(),1),Jue=o(v(),1);function eme({orderBy:e,order:t,onChange:r,...a}){return(0,Jue.jsx)(Xue.SelectControl,{__next40pxDefaultSize:!0,options:[{label:(0,sb.__)("Name: A \u2192 Z"),value:"name/asc"},{label:(0,sb.__)("Name: Z \u2192 A"),value:"name/desc"},{label:(0,sb.__)("Count, high to low"),value:"count/desc"},{label:(0,sb.__)("Count, low to high"),value:"count/asc"}],value:e+"/"+t,onChange:n=>{let[i,l]=n.split("/");r(i,l)},...a})}var tme=o(M(),1),rme=o(v(),1);function ome({value:e,onChange:t,...r}){return(0,rme.jsx)(tme.ToggleControl,{checked:!e,onChange:a=>t(!a),...r})}var ame=o(M(),1),nme=o(v(),1);function ime({value:e,onChange:t,...r}){return(0,nme.jsx)(ame.ToggleControl,{checked:e,onChange:t,...r})}var ub=o(M(),1),cb=o(P(),1),mb=o(v(),1);function lme({value:e,onChange:t,label:r}){return(0,mb.jsxs)(ub.__experimentalToggleGroupControl,{__next40pxDefaultSize:!0,label:r,isBlock:!0,onChange:a=>{t({inherit:a==="default"})},help:e?(0,cb.__)("Display terms based on the current taxonomy archive. For hierarchical taxonomies, shows children of the current term. For non-hierarchical taxonomies, shows all terms."):(0,cb.__)("Display terms based on specific criteria."),value:e?"default":"custom",children:[(0,mb.jsx)(ub.__experimentalToggleGroupControlOption,{value:"default",label:(0,cb.__)("Default")}),(0,mb.jsx)(ub.__experimentalToggleGroupControlOption,{value:"custom",label:(0,cb.__)("Custom")})]})}var sme=o(P(),1),cme=o(M(),1),ume=o(v(),1);function mme({value:e,onChange:t,...r}){return(0,ume.jsx)(cme.RangeControl,{__next40pxDefaultSize:!0,value:e,min:0,max:100,onChange:t,help:(0,sme.__)("Limit the number of terms you want to show. To show all terms, use 0 (zero)."),...r})}var pme=o(P(),1),y7=o(T(),1);var nR=o(v(),1),{HTMLElementControl:Mwe}=K(y7.privateApis);function dme({TagName:e,setAttributes:t,clientId:r}){return(0,nR.jsx)(y7.InspectorControls,{group:"advanced",children:(0,nR.jsx)(Mwe,{tagName:e,onChange:a=>t({tagName:a}),clientId:r,options:[{label:(0,pme.__)("Default (<div>)"),value:"div"},{label:"<main>",value:"main"},{label:"<section>",value:"section"},{label:"<aside>",value:"aside"}]})})}var hme=o(M(),1),iR=o(V(),1),lR=o(Q(),1),Mu=o(U(),1),gme=o(me(),1),sR=o(Wo(),1),vme=o(v(),1),cf=[],fme={order:"asc",_fields:"id,name",context:"view"};function bme({value:e,taxonomy:t,onChange:r,...a}){let[n,i]=(0,Mu.useState)(""),[l,s]=(0,Mu.useState)(cf),[c,u]=(0,Mu.useState)(cf),m=(0,gme.useDebounce)(i,250),{searchResults:p,searchHasResolved:d}=(0,iR.useSelect)(y=>{if(!n)return{searchResults:cf,searchHasResolved:!0};let{getEntityRecords:k,hasFinishedResolution:_}=y(lR.store),x=["taxonomy",t,{...fme,search:n,orderby:"name",exclude:e,per_page:20}];return{searchResults:k(...x),searchHasResolved:_("getEntityRecords",x)}},[n,t,e]),f=(0,iR.useSelect)(y=>{if(!e?.length)return cf;let{getEntityRecords:k}=y(lR.store);return k("taxonomy",t,{...fme,include:e,per_page:e.length})},[e,t]);(0,Mu.useEffect)(()=>{if(e?.length||s(cf),!f?.length)return;let y=e.reduce((k,_)=>{let x=f.find(S=>S.id===_);return x&&k.push({id:_,value:(0,sR.decodeEntities)(x.name)}),k},[]);s(y)},[e,f]);let h=(0,Mu.useMemo)(()=>{if(!p?.length)return{names:cf,mapByName:{}};let y=[],k={};return p.forEach(_=>{let x=(0,sR.decodeEntities)(_.name);y.push(x),k[x]=_}),{names:y,mapByName:k}},[p]);(0,Mu.useEffect)(()=>{d&&u(h.names)},[h.names,d]);let g=(y,k)=>k?.id||y?.[k]?.id;return(0,vme.jsx)(hme.FormTokenField,{__next40pxDefaultSize:!0,value:l,onInputChange:m,suggestions:c,onChange:y=>{let k=Array.from(y.reduce((_,x)=>{let S=g(h.mapByName,x);return S&&_.add(S),_},new Set));u(cf),r(k)},__experimentalShowHowTo:!1,...a})}var Ar=o(v(),1);function _me({attributes:e,setQuery:t,setAttributes:r,clientId:a,templateSlug:n}){let{termQuery:i,tagName:l}=e,{taxonomy:s,orderBy:c,order:u,hideEmpty:m,inherit:p,showNested:d,perPage:f,include:h}=i,g=q(),y=b7().find(z=>z.slug===s)?.hierarchical,k=!!p,_=["taxonomy","category","tag","archive"].includes(n)||n?.startsWith("taxonomy-")||n?.startsWith("category-")||n?.startsWith("tag-"),x=y,S=!!h?.length,C=(0,ws.__)("Query type"),N=(0,ws.__)("Taxonomy"),B=(0,ws.__)("Order by"),D=(0,ws.__)("Show empty terms"),A=(0,ws.__)("Show nested terms"),H=(0,ws.__)("Max terms"),F=(0,ws.__)("Selected terms");return(0,Ar.jsxs)(Ar.Fragment,{children:[(0,Ar.jsx)(yme.InspectorControls,{children:(0,Ar.jsxs)(Mc.__experimentalToolsPanel,{label:(0,ws.__)("Settings"),resetAll:()=>{r({termQuery:{taxonomy:"category",order:"asc",orderBy:"name",include:[],hideEmpty:!0,showNested:!1,inherit:!1,perPage:10}})},dropdownMenuProps:g,children:[_&&(0,Ar.jsx)(Mc.__experimentalToolsPanelItem,{hasValue:()=>p!==!1,label:C,onDeselect:()=>t({inherit:!1}),isShownByDefault:!0,children:(0,Ar.jsx)(lme,{label:C,value:p,onChange:t})}),!k&&(0,Ar.jsx)(Mc.__experimentalToolsPanelItem,{hasValue:()=>s!=="category",label:N,onDeselect:()=>{t({taxonomy:"category"})},isShownByDefault:!0,children:(0,Ar.jsx)(Yue,{label:N,value:s,onChange:z=>t({taxonomy:z,include:[]})})}),(0,Ar.jsx)(Mc.__experimentalToolsPanelItem,{hasValue:()=>c!=="name"||u!=="asc",label:B,onDeselect:()=>t({orderBy:"name",order:"asc"}),isShownByDefault:!0,children:(0,Ar.jsx)(eme,{label:B,orderBy:c,order:u,onChange:(z,I)=>{t({orderBy:z,order:I})},disabled:S,help:S?(0,ws.__)("When specific terms are selected, the order is based on their selection order."):void 0})}),!k&&(0,Ar.jsx)(Mc.__experimentalToolsPanelItem,{hasValue:()=>!!h?.length,label:F,onDeselect:()=>t({include:[],orderBy:"name",order:"asc"}),isShownByDefault:!0,children:(0,Ar.jsx)(bme,{label:F,taxonomy:s,value:h,onChange:z=>t({include:z})})}),(0,Ar.jsx)(Mc.__experimentalToolsPanelItem,{hasValue:()=>m!==!0,label:D,onDeselect:()=>t({hideEmpty:!0}),isShownByDefault:!0,children:(0,Ar.jsx)(ome,{label:D,value:m,onChange:z=>t({hideEmpty:z})})}),x&&(0,Ar.jsx)(Mc.__experimentalToolsPanelItem,{hasValue:()=>d!==!1,label:A,onDeselect:()=>t({showNested:!1}),isShownByDefault:!0,children:(0,Ar.jsx)(ime,{label:A,value:d,onChange:z=>t({showNested:z}),disabled:S,help:S?(0,ws.__)("When specific terms are selected, only those are displayed."):void 0})}),(0,Ar.jsx)(Mc.__experimentalToolsPanelItem,{hasValue:()=>f!==10,label:H,onDeselect:()=>t({perPage:10}),isShownByDefault:!0,children:(0,Ar.jsx)(mme,{label:H,value:f,onChange:z=>t({perPage:z})})})]})}),(0,Ar.jsx)(dme,{TagName:l,setAttributes:r,clientId:a})]})}var uf=o(v(),1),Awe=[["core/term-template"]];function kme({attributes:e,setAttributes:t,clientId:r,context:a}){let{tagName:n}=e,i=(0,_7.useBlockProps)(),l=(0,_7.useInnerBlocksProps)(i,{template:Awe}),s=(0,xme.useCallback)(c=>t(u=>({termQuery:{...u.termQuery,...c}})),[t]);return(0,uf.jsxs)(uf.Fragment,{children:[(0,uf.jsx)(_me,{attributes:e,setQuery:s,setAttributes:t,clientId:r,templateSlug:a?.templateSlug}),(0,uf.jsx)(n,{...l})]})}var x7=o(V(),1),k7=o(W(),1),e0=o(T(),1),cR=o(v(),1);function wme({attributes:e,clientId:t,name:r}){let{blockType:a,activeBlockVariation:n,scopeVariations:i}=(0,x7.useSelect)(m=>{let{getActiveBlockVariation:p,getBlockType:d,getBlockVariations:f}=m(k7.store);return{blockType:d(r),activeBlockVariation:p(r,e),scopeVariations:f(r,"block")}},[r,e]),l=n?.icon?.src||n?.icon||a?.icon?.src,s=n?.title||a?.title,{replaceInnerBlocks:c}=(0,x7.useDispatch)(e0.store),u=(0,e0.useBlockProps)();return(0,cR.jsx)("div",{...u,children:(0,cR.jsx)(e0.__experimentalBlockVariationPicker,{icon:l,label:s,variations:i,onSelect:m=>{m.innerBlocks&&c(t,(0,k7.createBlocksFromInnerBlocksTemplate)(m.innerBlocks),!1)}})})}var Tme=o(v(),1),Rwe=e=>{let r=(0,Cme.useSelect)(a=>!!a(Sme.store).getBlocks(e.clientId).length,[e.clientId])?kme:wme;return(0,Tme.jsx)(r,{...e})},Pme=Rwe;var w7=o(T(),1),Bme=o(v(),1);function Ime({attributes:{tagName:e="div"}}){let t=w7.useBlockProps.save(),r=w7.useInnerBlocksProps.save(t);return(0,Bme.jsx)(e,{...r})}var pb=o(P(),1),t0=o(M(),1),db=o(v(),1),zwe=(0,db.jsx)(t0.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48",children:(0,db.jsx)(t0.Path,{d:"M 41,9 H 7 v 3 h 34 z m 0,9 H 7 v 3 h 34 z m 0,18 H 7 v 3 h 34 z m 0,-9 H 7 v 3 h 34 z"})}),Vwe=(0,db.jsx)(t0.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48",children:(0,db.jsx)(t0.Path,{d:"m 36,36 h 5 v 3 h -5 z m 0,-9 h 5 v 3 h -5 z m 0,-9 h 5 v 3 h -5 z m 0,-9 h 5 v 3 H 36 Z M 31,9 H 7 v 3 h 24 z m 0,9 H 7 v 3 h 24 z m 0,18 H 7 v 3 h 24 z m 0,-9 H 7 v 3 h 24 z"})}),Nme=["core/term-name",{isLink:!0}],Fwe=[{name:"name",title:(0,pb.__)("Name"),description:(0,pb.__)("Display the terms' names."),attributes:{},icon:zwe,scope:["block"],innerBlocks:[["core/term-template",{},[Nme]]]},{name:"name-count",title:(0,pb.__)("Name & Count"),description:(0,pb.__)("Display the terms' names and number of posts assigned to each term."),attributes:{},icon:Vwe,scope:["block"],innerBlocks:[["core/term-template",{},[["core/group",{layout:{type:"flex",flexWrap:"nowrap"}},[Nme,["core/term-count"]]]]]]}],Eme=Fwe;var{name:Dme}=v7,Lme={icon:Sp,edit:Pme,save:Ime,example:{},variations:Eme},Hwe=()=>E({name:Dme,metadata:v7,settings:Lme});var mR={};Z(mR,{init:()=>$we,metadata:()=>C7,name:()=>Ome,settings:()=>jme});var C7={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/term-template",title:"Term Template",category:"theme",ancestor:["core/terms-query"],description:"Contains the block elements used to render a taxonomy term, like the name, description, and more.",textdomain:"default",usesContext:["termQuery"],supports:{anchor:!0,reusable:!1,html:!1,align:["wide","full"],layout:!0,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},spacing:{margin:!0,padding:!0,blockGap:{__experimentalDefault:"1.25em"},__experimentalDefaultControls:{blockGap:!0,padding:!1,margin:!1}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0}},style:"wp-block-term-template",editorStyle:"wp-block-term-template-editor"};var Mme=o(M(),1);var r0=o(U(),1),Ame=o(V(),1),fb=o(P(),1),kl=o(T(),1),Rme=o(Q(),1),ga=o(v(),1),jwe=[["core/term-name"]];function Uwe({classList:e}){let t=(0,kl.useInnerBlocksProps)({className:w("wp-block-term",e)},{template:jwe,__unstableDisableLayoutClassNames:!0});return(0,ga.jsx)("li",{...t})}function Gwe({blocks:e,blockContextId:t,classList:r,isHidden:a,setActiveBlockContextId:n}){let i=(0,kl.__experimentalUseBlockPreview)({blocks:e,props:{className:w("wp-block-term",r)}}),l=()=>{n(t)};return(0,ga.jsx)("li",{...i,tabIndex:0,role:"button",onClick:l,onKeyPress:l,style:{display:a?"none":void 0}})}var Wwe=(0,r0.memo)(Gwe);function zme({clientId:e,attributes:{layout:t},setAttributes:r,context:{termQuery:{taxonomy:a,order:n,orderBy:i,hideEmpty:l,showNested:s=!1,perPage:c,include:u}={}},__unstableLayoutClassNames:m}){let{type:p,columnCount:d=3}=t||{},[f,h]=(0,r0.useState)(),g={hide_empty:l,order:n,orderby:i,per_page:c||-1};!s&&!u?.length&&(g.parent=0),u?.length&&(g.include=u,g.orderby="include",g.order="asc");let{records:b}=(0,Rme.useEntityRecords)("taxonomy",a,g),y=(0,Ame.useSelect)(S=>S(kl.store).getBlocks(e),[e]),k=(0,kl.useBlockProps)({className:m}),_=(0,r0.useMemo)(()=>b?.map(S=>({taxonomy:a,termId:S.id,classList:`term-${S.id}`,termData:S})),[b,a]);if(!b)return(0,ga.jsx)("ul",{...k,children:(0,ga.jsx)("li",{className:"wp-block-term term-loading",children:(0,ga.jsx)("div",{className:"term-loading-placeholder"})})});if(!b.length)return(0,ga.jsxs)("p",{...k,children:[" ",(0,fb.__)("No terms found.")]});let x=S=>r(C=>({layout:{...C.layout,...S}}));return(0,ga.jsxs)(ga.Fragment,{children:[(0,ga.jsx)(kl.BlockControls,{children:(0,ga.jsx)(Mme.ToolbarGroup,{controls:[{icon:Nl,title:(0,fb._x)("List view","Term template block display setting"),onClick:()=>x({type:"default"}),isActive:p==="default"||p==="constrained"},{icon:Il,title:(0,fb._x)("Grid view","Term template block display setting"),onClick:()=>x({type:"grid",columnCount:d}),isActive:p==="grid"}]})}),(0,ga.jsx)("ul",{...k,children:_?.map(S=>(0,ga.jsxs)(kl.BlockContextProvider,{value:S,children:[S.termId===(f||_[0]?.termId)?(0,ga.jsx)(Uwe,{classList:S.classList}):null,(0,ga.jsx)(Wwe,{blocks:y,blockContextId:S.termId,classList:S.classList,setActiveBlockContextId:h,isHidden:S.termId===(f||_[0]?.termId)})]},S.termId))})]})}var Vme=o(T(),1),Fme=o(v(),1);function Hme(){return(0,Fme.jsx)(Vme.InnerBlocks.Content,{})}var{name:Ome}=C7,jme={icon:Cp,edit:zme,save:Hme,example:{}},$we=()=>E({name:Ome,metadata:C7,settings:jme});var pR={};Z(pR,{init:()=>Kwe,metadata:()=>T7,name:()=>qme,settings:()=>Zme});var o0=o(P(),1),S7=o(M(),1),Ac=o(T(),1),Ume=o(Ff(),1),$i=o(v(),1);function Gme({attributes:e,setAttributes:t}){let{width:r,content:a,columns:n}=e;return(0,Ume.default)("The Text Columns block",{since:"5.3",alternative:"the Columns block"}),(0,$i.jsxs)($i.Fragment,{children:[(0,$i.jsx)(Ac.BlockControls,{children:(0,$i.jsx)(Ac.BlockAlignmentToolbar,{value:r,onChange:i=>t({width:i}),controls:["center","wide","full"]})}),(0,$i.jsx)(Ac.InspectorControls,{children:(0,$i.jsx)(S7.PanelBody,{children:(0,$i.jsx)(S7.RangeControl,{__next40pxDefaultSize:!0,label:(0,o0.__)("Columns"),value:n,onChange:i=>t({columns:i}),min:2,max:4,required:!0})})}),(0,$i.jsx)("div",{...(0,Ac.useBlockProps)({className:`align${r} columns-${n}`}),children:Array.from({length:n}).map((i,l)=>(0,$i.jsx)("div",{className:"wp-block-column",children:(0,$i.jsx)(Ac.RichText,{tagName:"p",value:a?.[l]?.children,onChange:s=>{t({content:[...a.slice(0,l),{children:s},...a.slice(l+1)]})},"aria-label":(0,o0.sprintf)((0,o0.__)("Column %d text"),l+1),placeholder:(0,o0.__)("New Column")})},`column-${l}`))})]})}var T7={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/text-columns",title:"Text Columns (deprecated)",icon:"columns",category:"design",description:"This block is deprecated. Please use the Columns block instead.",textdomain:"default",attributes:{content:{type:"array",source:"query",selector:"p",query:{children:{type:"string",source:"html"}},default:[{},{}]},columns:{type:"number",default:2},width:{type:"string"}},supports:{inserter:!1,interactivity:{clientNavigation:!0}},editorStyle:"wp-block-text-columns-editor",style:"wp-block-text-columns"};var B7=o(T(),1),P7=o(v(),1);function Wme({attributes:e}){let{width:t,content:r,columns:a}=e;return(0,P7.jsx)("div",{...B7.useBlockProps.save({className:`align${t} columns-${a}`}),children:Array.from({length:a}).map((n,i)=>(0,P7.jsx)("div",{className:"wp-block-column",children:(0,P7.jsx)(B7.RichText.Content,{tagName:"p",value:r?.[i]?.children})},`column-${i}`))})}var I7=o(W(),1),Zwe={to:[{type:"block",blocks:["core/columns"],transform:({className:e,columns:t,content:r,width:a})=>(0,I7.createBlock)("core/columns",{align:a==="wide"||a==="full"?a:void 0,className:e,columns:t},r.map(({children:n})=>(0,I7.createBlock)("core/column",{},[(0,I7.createBlock)("core/paragraph",{content:n})])))}]},$me=Zwe;var{name:qme}=T7,Zme={transforms:$me,getEditWrapperProps(e){let{width:t}=e;if(t==="wide"||t==="full")return{"data-align":t}},edit:Gme,save:Wme},Kwe=()=>E({name:qme,metadata:T7,settings:Zme});var vR={};Z(vR,{init:()=>oCe,metadata:()=>D7,name:()=>tpe,settings:()=>M7});var gR=o(P(),1);var epe=o(W(),1);var mf=o(T(),1);var a0=o(v(),1),Qwe={attributes:{content:{type:"string",source:"html",selector:"pre",default:""},textAlign:{type:"string"}},save({attributes:e}){let{textAlign:t,content:r}=e;return(0,a0.jsx)(mf.RichText.Content,{tagName:"pre",style:{textAlign:t},value:r})},migrate:We},Ywe={attributes:{content:{type:"string",source:"html",selector:"pre",default:"",__unstablePreserveWhiteSpace:!0,role:"content"},textAlign:{type:"string"}},supports:{anchor:!0,color:{gradients:!0,link:!0},typography:{fontSize:!0,__experimentalFontFamily:!0},spacing:{padding:!0}},save({attributes:e}){let{textAlign:t,content:r}=e,a=w({[`has-text-align-${t}`]:t});return(0,a0.jsx)("pre",{...mf.useBlockProps.save({className:a}),children:(0,a0.jsx)(mf.RichText.Content,{value:r})})},migrate(e){return We(Ot(e))},isEligible({style:e,textAlign:t}){return e?.typography?.fontFamily||!!t}},Xwe={attributes:{content:{type:"rich-text",source:"rich-text",selector:"pre",__unstablePreserveWhiteSpace:!0,role:"content"},textAlign:{type:"string"}},supports:{anchor:!0,background:{backgroundImage:!0,backgroundSize:!0},color:{gradients:!0,link:!0},dimensions:{minHeight:!0},typography:{fontSize:!0,__experimentalFontFamily:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalWritingMode:!0},spacing:{margin:!0,padding:!0},__experimentalBorder:{radius:!0,width:!0,color:!0,style:!0},interactivity:{clientNavigation:!0}},save({attributes:e}){let{textAlign:t,content:r}=e,a=w({[`has-text-align-${t}`]:t});return(0,a0.jsx)("pre",{...mf.useBlockProps.save({className:a}),children:(0,a0.jsx)(mf.RichText.Content,{value:r})})},migrate:We,isEligible(e){return!!e.textAlign||!!e.className?.match(/\bhas-text-align-(left|center|right)\b/)}},Kme=[Xwe,Ywe,Qwe];var dR=o(P(),1),N7=o(T(),1),E7=o(W(),1);var Qme=o(v(),1);function Yme(e){let{attributes:t,setAttributes:r,mergeBlocks:a,onRemove:n,insertBlocksAfter:i,style:l}=e,{content:s}=t;Kr(e);let c=(0,N7.useBlockProps)({style:l});return(0,Qme.jsx)(N7.RichText,{tagName:"pre",identifier:"content",preserveWhiteSpace:!0,value:s,onChange:u=>{r({content:u})},"aria-label":(0,dR.__)("Poetry text"),placeholder:(0,dR.__)("Write poetry\u2026"),onRemove:n,onMerge:a,...c,__unstablePastePlainText:!0,__unstableOnSplitAtDoubleLineEnd:()=>i((0,E7.createBlock)((0,E7.getDefaultBlockName)()))})}var D7={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/verse",title:"Poetry",category:"text",description:"Insert poetry. Use special spacing formats. Or quote song lyrics.",keywords:["poetry","poem","verse","stanza","song","lyrics"],textdomain:"default",attributes:{content:{type:"rich-text",source:"rich-text",selector:"pre",__unstablePreserveWhiteSpace:!0,role:"content"}},supports:{anchor:!0,background:{backgroundImage:!0,backgroundSize:!0,__experimentalDefaultControls:{backgroundImage:!0}},color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},dimensions:{minHeight:!0,__experimentalDefaultControls:{minHeight:!1}},typography:{fontSize:!0,__experimentalFontFamily:!0,lineHeight:!0,textAlign:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalWritingMode:!0,__experimentalDefaultControls:{fontSize:!0}},spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},__experimentalBorder:{radius:!0,width:!0,color:!0,style:!0},interactivity:{clientNavigation:!0}},style:"wp-block-verse",editorStyle:"wp-block-verse-editor"};var L7=o(T(),1),fR=o(v(),1);function Xme({attributes:e}){let{content:t}=e;return(0,fR.jsx)("pre",{...L7.useBlockProps.save(),children:(0,fR.jsx)(L7.RichText.Content,{value:t})})}var hR=o(W(),1),eCe={from:[{type:"block",blocks:["core/paragraph"],transform:e=>(0,hR.createBlock)("core/verse",e)}],to:[{type:"block",blocks:["core/paragraph"],transform:e=>(0,hR.createBlock)("core/paragraph",e)}]},Jme=eCe;var{fieldsKey:tCe,formKey:rCe}=K(epe.privateApis),{name:tpe}=D7,M7={icon:_1,example:{attributes:{content:(0,gR.__)(`WHAT was he doing, the great god Pan, Down in the reeds by the river? Spreading ruin and scattering ban, Splashing and paddling with hoofs of a goat, And breaking the golden lilies afloat With the dragon-fly on the river.`)}},transforms:Jme,deprecated:Kme,merge(e,t){return{content:e.content+` `+t.content}},edit:Yme,save:Xme};window.__experimentalContentOnlyInspectorFields&&(M7[tCe]=[{id:"content",label:(0,gR.__)("Content"),type:"text",Edit:"rich-text"}],M7[rCe]={fields:["content"]});var oCe=()=>E({name:tpe,metadata:D7,settings:M7});var _R={};Z(_R,{init:()=>yCe,metadata:()=>n0,name:()=>bpe,settings:()=>z7});var R7=o(P(),1);var vpe=o(W(),1);var hb=o(T(),1);var n0={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/video",title:"Video",category:"media",description:"Embed a video from your media library or upload a new one.",keywords:["movie"],textdomain:"default",attributes:{autoplay:{type:"boolean",source:"attribute",selector:"video",attribute:"autoplay"},caption:{type:"rich-text",source:"rich-text",selector:"figcaption",role:"content"},controls:{type:"boolean",source:"attribute",selector:"video",attribute:"controls",default:!0},id:{type:"number",role:"content"},loop:{type:"boolean",source:"attribute",selector:"video",attribute:"loop"},muted:{type:"boolean",source:"attribute",selector:"video",attribute:"muted"},poster:{type:"string",source:"attribute",selector:"video",attribute:"poster"},preload:{type:"string",source:"attribute",selector:"video",attribute:"preload",default:"metadata"},blob:{type:"string",role:"local"},src:{type:"string",source:"attribute",selector:"video",attribute:"src",role:"content"},playsInline:{type:"boolean",source:"attribute",selector:"video",attribute:"playsinline"},tracks:{role:"content",type:"array",items:{type:"object"},default:[]}},supports:{anchor:!0,align:!0,spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},interactivity:{clientNavigation:!0}},editorStyle:"wp-block-video-editor",style:"wp-block-video"};var rpe=o(v(),1);function i0({tracks:e=[]}){return e.map(t=>{let{id:r,...a}=t;return(0,rpe.jsx)("track",{...a},r??a.src)})}var l0=o(v(),1),{attributes:nCe}=n0,iCe={attributes:nCe,save({attributes:e}){let{autoplay:t,caption:r,controls:a,loop:n,muted:i,poster:l,preload:s,src:c,playsInline:u,tracks:m}=e;return(0,l0.jsxs)("figure",{...hb.useBlockProps.save(),children:[c&&(0,l0.jsx)("video",{autoPlay:t,controls:a,loop:n,muted:i,poster:l,preload:s!=="metadata"?s:void 0,src:c,playsInline:u,children:(0,l0.jsx)(i0,{tracks:m})}),!hb.RichText.isEmpty(r)&&(0,l0.jsx)(hb.RichText.Content,{tagName:"figcaption",value:r})]})}},lCe=[iCe],ope=lCe;var upe=o(Rr(),1),np=o(M(),1),_n=o(T(),1),c0=o(U(),1),gb=o(P(),1),mpe=o(V(),1);var ppe=o(xr(),1),dpe=o(mr(),1);var Gr=o(P(),1),yn=o(M(),1),pf=o(U(),1),va=o(v(),1),sCe=[{value:"auto",label:(0,Gr.__)("Auto")},{value:"metadata",label:(0,Gr.__)("Metadata")},{value:"none",label:(0,Gr._x)("None","Preload value")}],cCe=({setAttributes:e,attributes:t})=>{let{autoplay:r,controls:a,loop:n,muted:i,playsInline:l,preload:s}=t,c=(0,Gr.__)("Autoplay may cause usability issues for some users."),u=pf.Platform.select({web:(0,pf.useCallback)(d=>d?c:null,[]),native:c}),m=(0,pf.useMemo)(()=>{let d=f=>h=>{e({[f]:h,...f==="autoplay"&&{muted:h,playsInline:h}})};return{autoplay:d("autoplay"),loop:d("loop"),muted:d("muted"),controls:d("controls"),playsInline:d("playsInline")}},[]),p=(0,pf.useCallback)(d=>{e({preload:d})},[]);return(0,va.jsxs)(va.Fragment,{children:[(0,va.jsx)(yn.__experimentalToolsPanelItem,{label:(0,Gr.__)("Autoplay"),isShownByDefault:!0,hasValue:()=>!!r,onDeselect:()=>{e({autoplay:!1,muted:!1})},children:(0,va.jsx)(yn.ToggleControl,{label:(0,Gr.__)("Autoplay"),onChange:m.autoplay,checked:!!r,help:u})}),(0,va.jsx)(yn.__experimentalToolsPanelItem,{label:(0,Gr.__)("Loop"),isShownByDefault:!0,hasValue:()=>!!n,onDeselect:()=>{e({loop:!1})},children:(0,va.jsx)(yn.ToggleControl,{label:(0,Gr.__)("Loop"),onChange:m.loop,checked:!!n})}),(0,va.jsx)(yn.__experimentalToolsPanelItem,{label:(0,Gr.__)("Muted"),isShownByDefault:!0,hasValue:()=>!!i,onDeselect:()=>{e({muted:!1})},children:(0,va.jsx)(yn.ToggleControl,{label:(0,Gr.__)("Muted"),onChange:m.muted,checked:!!i,disabled:r,help:r?(0,Gr.__)("Muted because of Autoplay."):null})}),(0,va.jsx)(yn.__experimentalToolsPanelItem,{label:(0,Gr.__)("Playback controls"),isShownByDefault:!0,hasValue:()=>!a,onDeselect:()=>{e({controls:!0})},children:(0,va.jsx)(yn.ToggleControl,{label:(0,Gr.__)("Playback controls"),onChange:m.controls,checked:!!a})}),(0,va.jsx)(yn.__experimentalToolsPanelItem,{label:(0,Gr.__)("Play inline"),isShownByDefault:!0,hasValue:()=>!!l,onDeselect:()=>{e({playsInline:!1})},children:(0,va.jsx)(yn.ToggleControl,{label:(0,Gr.__)("Play inline"),onChange:m.playsInline,checked:!!l,disabled:r,help:r?(0,Gr.__)("Play inline enabled because of Autoplay."):(0,Gr.__)("When enabled, videos will play directly within the webpage on mobile browsers, instead of opening in a fullscreen player.")})}),(0,va.jsx)(yn.__experimentalToolsPanelItem,{label:(0,Gr.__)("Preload"),isShownByDefault:!0,hasValue:()=>s!=="metadata",onDeselect:()=>{e({preload:"metadata"})},children:(0,va.jsx)(yn.SelectControl,{__next40pxDefaultSize:!0,label:(0,Gr.__)("Preload"),value:s,onChange:p,options:sCe,hideCancelButton:!0})})]})},ape=cCe;var Dt=o(P(),1),Ye=o(M(),1),s0=o(T(),1);var ipe=o(V(),1),df=o(U(),1),lpe=o(mr(),1);var Ze=o(v(),1),{Badge:uCe}=K(Ye.privateApis),npe=["text/vtt"],mCe="subtitles",pCe=[{label:(0,Dt.__)("Subtitles"),value:"subtitles"},{label:(0,Dt.__)("Captions"),value:"captions"},{label:(0,Dt.__)("Descriptions"),value:"descriptions"},{label:(0,Dt.__)("Chapters"),value:"chapters"},{label:(0,Dt.__)("Metadata"),value:"metadata"}],spe={src:"",label:"",srcLang:"en",kind:mCe,default:!1};function dCe({tracks:e,onEditPress:t}){let r=e.map((a,n)=>(0,Ze.jsxs)(Ye.__experimentalHStack,{className:"block-library-video-tracks-editor__track-list-track",children:[(0,Ze.jsx)("span",{children:a.label}),(0,Ze.jsxs)(Ye.__experimentalHStack,{justify:"flex-end",children:[a.default&&(0,Ze.jsx)(uCe,{children:(0,Dt.__)("Default")}),(0,Ze.jsx)(Ye.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>t(n),"aria-label":(0,Dt.sprintf)((0,Dt._x)("Edit %s","text tracks"),a.label),children:(0,Dt.__)("Edit")})]})]},a.id??a.src));return(0,Ze.jsx)(Ye.MenuGroup,{label:(0,Dt.__)("Text tracks"),className:"block-library-video-tracks-editor__track-list",children:r})}function fCe({track:e,onChange:t,onClose:r,onRemove:a,allowSettingDefault:n}){let[i,l]=(0,df.useState)({...spe,...e}),{src:s,label:c,srcLang:u,kind:m,default:p}=i,d=s.startsWith("blob:")?"":(0,lpe.getFilename)(s)||"";return(0,Ze.jsxs)(Ye.__experimentalVStack,{className:"block-library-video-tracks-editor__single-track-editor",spacing:"4",children:[(0,Ze.jsx)("span",{className:"block-library-video-tracks-editor__single-track-editor-edit-track-label",children:(0,Dt.__)("Edit track")}),(0,Ze.jsxs)("span",{children:[(0,Dt.__)("File"),": ",(0,Ze.jsx)("b",{children:d})]}),(0,Ze.jsxs)(Ye.__experimentalGrid,{columns:2,gap:4,children:[(0,Ze.jsx)(Ye.TextControl,{__next40pxDefaultSize:!0,onChange:f=>l(h=>({...h,label:f})),label:(0,Dt.__)("Label"),value:c,help:(0,Dt.__)("Title of track")}),(0,Ze.jsx)(Ye.TextControl,{__next40pxDefaultSize:!0,onChange:f=>l(h=>({...h,srcLang:f})),label:(0,Dt.__)("Source language"),value:u,help:(0,Dt.__)("Language tag (en, fr, etc.)")})]}),(0,Ze.jsxs)(Ye.__experimentalVStack,{spacing:"4",children:[(0,Ze.jsx)(Ye.SelectControl,{__next40pxDefaultSize:!0,className:"block-library-video-tracks-editor__single-track-editor-kind-select",options:pCe,value:m,label:(0,Dt.__)("Kind"),onChange:f=>l(h=>({...h,kind:f}))}),(0,Ze.jsx)(Ye.ToggleControl,{__next40pxDefaultSize:!0,label:(0,Dt.__)("Set as default track"),checked:p,disabled:!n,onChange:f=>l(h=>({...h,default:f}))}),(0,Ze.jsxs)(Ye.__experimentalHStack,{className:"block-library-video-tracks-editor__single-track-editor-buttons-container",children:[(0,Ze.jsx)(Ye.Button,{__next40pxDefaultSize:!0,isDestructive:!0,variant:"link",onClick:a,children:(0,Dt.__)("Remove track")}),(0,Ze.jsx)(Ye.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:()=>{t(i),r()},children:(0,Dt.__)("Apply")})]})]})]})}function cpe({tracks:e=[],onChange:t}){let r=(0,ipe.useSelect)(c=>c(s0.store).getSettings().mediaUpload,[]),[a,n]=(0,df.useState)(null),i=(0,df.useRef)(),l=(c=[],u=!1)=>{let m=new Map(e.map(d=>[d.id,d])),p=c.map(({id:d,title:f,url:h})=>m.has(d)?m.get(d):{...spe,id:d,label:f||"",src:h});p.length!==0&&t([...u?e:[],...p])};function s(c){let u=c.target.files;r({allowedTypes:npe,filesList:u,onFileChange:m=>{if(!Array.isArray(m))return;let p=m.filter(d=>!!d?.id);p.length&&l(p,!0)}})}return(0,df.useEffect)(()=>{i.current?.focus()},[a]),r?(0,Ze.jsx)(Ye.Dropdown,{contentClassName:"block-library-video-tracks-editor",focusOnMount:!0,popoverProps:{ref:i},renderToggle:({isOpen:c,onToggle:u})=>(0,Ze.jsx)(Ye.ToolbarGroup,{children:(0,Ze.jsx)(Ye.ToolbarButton,{"aria-expanded":c,"aria-haspopup":"true",onClick:()=>{c||n(null),u()},children:(0,Dt.__)("Text tracks")})}),renderContent:()=>a!==null?(0,Ze.jsx)(fCe,{track:e[a],onChange:c=>{let u=[...e];u[a]=c,t(u)},onClose:()=>n(null),onRemove:()=>{t(e.filter((c,u)=>u!==a)),n(null)},allowSettingDefault:!e.some(c=>c.default)||e[a].default}):(0,Ze.jsxs)(Ze.Fragment,{children:[e.length===0&&(0,Ze.jsxs)("div",{className:"block-library-video-tracks-editor__tracks-informative-message",children:[(0,Ze.jsx)("h2",{className:"block-library-video-tracks-editor__tracks-informative-message-title",children:(0,Dt.__)("Text tracks")}),(0,Ze.jsx)("p",{className:"block-library-video-tracks-editor__tracks-informative-message-description",children:(0,Dt.__)("Tracks can be subtitles, captions, chapters, or descriptions. They help make your content more accessible to a wider range of users.")})]}),(0,Ze.jsxs)(Ye.NavigableMenu,{children:[(0,Ze.jsx)(dCe,{tracks:e,onEditPress:n}),(0,Ze.jsx)(Ye.MenuGroup,{className:"block-library-video-tracks-editor__add-tracks-container",label:(0,Dt.__)("Add tracks"),children:(0,Ze.jsxs)(s0.MediaUploadCheck,{children:[(0,Ze.jsx)(s0.MediaUpload,{onSelect:l,allowedTypes:npe,value:e.map(({id:c})=>c),multiple:!0,render:({open:c})=>(0,Ze.jsx)(Ye.MenuItem,{icon:$0,onClick:c,children:(0,Dt.__)("Open Media Library")})}),(0,Ze.jsx)(Ye.FormFileUpload,{onChange:s,accept:".vtt,text/vtt",multiple:!0,render:({openFileDialog:c})=>(0,Ze.jsx)(Ye.MenuItem,{icon:Hc,onClick:c,children:(0,Dt._x)("Upload","verb")})})]})})]})]})}):null}var ur=o(v(),1),bR=["video"];function hCe({isSelected:e,attributes:t,className:r,setAttributes:a,insertBlocksAfter:n,onReplace:i}){let l=(0,c0.useRef)(),{id:s,controls:c,poster:u,src:m,tracks:p}=t,[d,f]=(0,c0.useState)(t.blob),h=q(),b=(0,_n.useBlockEditingMode)()==="default";Es({url:d,allowedTypes:bR,onChange:y,onError:x}),(0,c0.useEffect)(()=>{l.current&&l.current.load()},[u]);function y(B){if(!B||!B.url){a({src:void 0,id:void 0,poster:void 0,caption:void 0,blob:void 0}),f();return}if((0,upe.isBlobURL)(B.url)){f(B.url);return}a({blob:void 0,src:B.url,id:B.id,poster:B.image?.src!==B.icon?B.image?.src:void 0,caption:B.caption}),f()}function k(B){if(B!==m){let D=(0,dpe.prependHTTPS)(B),A=Yu({attributes:{url:D}});if(A!==void 0&&i){i(A);return}a({blob:void 0,src:D,id:void 0,poster:void 0}),f()}}let{createErrorNotice:_}=(0,mpe.useDispatch)(ppe.store);function x(B){_(B,{type:"snackbar"})}let S=B=>(0,ur.jsx)(np.Placeholder,{className:"block-editor-media-placeholder",withIllustration:!e,icon:Ef,label:(0,gb.__)("Video"),instructions:(0,gb.__)("Drag and drop a video, upload, or choose from your library."),children:B}),C=w(r,{"is-transient":!!d}),N=(0,_n.useBlockProps)({className:C});return!m&&!d?(0,ur.jsx)("div",{...N,children:(0,ur.jsx)(_n.MediaPlaceholder,{icon:(0,ur.jsx)(_n.BlockIcon,{icon:Ef}),onSelect:y,onSelectURL:k,accept:"video/*",allowedTypes:bR,value:t,onError:x,placeholder:S})}):(0,ur.jsxs)(ur.Fragment,{children:[e&&(0,ur.jsxs)(ur.Fragment,{children:[(0,ur.jsx)(_n.BlockControls,{children:(0,ur.jsx)(cpe,{tracks:p,onChange:B=>{a({tracks:B})}})}),(0,ur.jsx)(_n.BlockControls,{group:"other",children:(0,ur.jsx)(_n.MediaReplaceFlow,{mediaId:s,mediaURL:m,allowedTypes:bR,accept:"video/*",onSelect:y,onSelectURL:k,onError:x,onReset:()=>y(void 0),variant:"toolbar"})})]}),(0,ur.jsx)(_n.InspectorControls,{children:(0,ur.jsxs)(np.__experimentalToolsPanel,{label:(0,gb.__)("Settings"),resetAll:()=>{a({autoplay:!1,controls:!0,loop:!1,muted:!1,playsInline:!1,preload:"metadata",poster:void 0})},dropdownMenuProps:h,children:[(0,ur.jsx)(ape,{setAttributes:a,attributes:t}),(0,ur.jsx)(r5,{poster:u,onChange:B=>a({poster:B?.url})})]})}),(0,ur.jsxs)("figure",{...N,children:[(0,ur.jsx)(np.Disabled,{isDisabled:!e,children:(0,ur.jsx)("video",{controls:c,poster:u,src:m||d,ref:l,children:(0,ur.jsx)(i0,{tracks:p})})}),!!d&&(0,ur.jsx)(np.Spinner,{}),(0,ur.jsx)(_a,{attributes:t,setAttributes:a,isSelected:e,insertBlocksAfter:n,label:(0,gb.__)("Video caption text"),showToolbarButton:e&&b})]})]})}var fpe=hCe;var ff=o(T(),1);var u0=o(v(),1);function hpe({attributes:e}){let{autoplay:t,caption:r,controls:a,loop:n,muted:i,poster:l,preload:s,src:c,playsInline:u,tracks:m}=e;return(0,u0.jsxs)("figure",{...ff.useBlockProps.save(),children:[c&&(0,u0.jsx)("video",{autoPlay:t,controls:a,loop:n,muted:i,poster:l,preload:s!=="metadata"?s:void 0,src:c,playsInline:u,children:(0,u0.jsx)(i0,{tracks:m})}),!ff.RichText.isEmpty(r)&&(0,u0.jsx)(ff.RichText.Content,{className:(0,ff.__experimentalGetElementClassName)("caption"),tagName:"figcaption",value:r})]})}var A7=o(Rr(),1),yR=o(W(),1),gCe={from:[{type:"files",isMatch(e){return e.length===1&&e[0].type.indexOf("video/")===0},transform(e){let t=e[0];return(0,yR.createBlock)("core/video",{blob:(0,A7.createBlobURL)(t)})}},{type:"shortcode",tag:"video",attributes:{src:{type:"string",shortcode:({named:{src:e,mp4:t,m4v:r,webm:a,ogv:n,flv:i}})=>e||t||r||a||n||i},poster:{type:"string",shortcode:({named:{poster:e}})=>e},loop:{type:"string",shortcode:({named:{loop:e}})=>e},autoplay:{type:"string",shortcode:({named:{autoplay:e}})=>e},preload:{type:"string",shortcode:({named:{preload:e}})=>e}}},{type:"raw",isMatch:e=>e.nodeName==="P"&&e.children.length===1&&e.firstChild.nodeName==="VIDEO",transform:e=>{let t=e.firstChild,r={autoplay:t.hasAttribute("autoplay")?!0:void 0,controls:t.hasAttribute("controls")?void 0:!1,loop:t.hasAttribute("loop")?!0:void 0,muted:t.hasAttribute("muted")?!0:void 0,preload:t.getAttribute("preload")||void 0,playsInline:t.hasAttribute("playsinline")?!0:void 0,poster:t.getAttribute("poster")||void 0,src:t.getAttribute("src")||void 0};return(0,A7.isBlobURL)(r.src)&&(r.blob=r.src,delete r.src),(0,yR.createBlock)("core/video",r)}}]},gpe=gCe;var{fieldsKey:vCe,formKey:bCe}=K(vpe.privateApis),{name:bpe}=n0,z7={icon:Ef,example:{attributes:{src:"https://upload.wikimedia.org/wikipedia/commons/c/ca/Wood_thrush_in_Central_Park_switch_sides_%2816510%29.webm",caption:(0,R7.__)("Wood thrush singing in Central Park, NYC.")}},transforms:gpe,deprecated:ope,edit:fpe,save:hpe};window.__experimentalContentOnlyInspectorFields&&(z7[vCe]=[{id:"video",label:(0,R7.__)("Video"),type:"media",Edit:{control:"media",allowedTypes:["video"],multiple:!1},getValue:({item:e})=>({id:e.id,url:e.src,caption:e.caption,poster:e.poster}),setValue:({value:e})=>({id:e.id,src:e.url,caption:e.caption,poster:e.poster})},{id:"caption",label:(0,R7.__)("Caption"),type:"text",Edit:"rich-text"}],z7[bCe]={fields:["video","caption"]});var yCe=()=>E({name:bpe,metadata:n0,settings:z7});var CR={};Z(CR,{init:()=>wCe,metadata:()=>V7,name:()=>H7,settings:()=>Ppe});var Tpe=o(em(),1);var hf=o(T(),1),ype=o(Q(),1),vb=o(P(),1),xR=o(M(),1);var wl=o(v(),1);function _pe({context:{postType:e,postId:t}}){let[r,a]=(0,ype.useEntityProp)("postType",e,"meta",t),n=typeof r?.footnotes=="string",i=r?.footnotes?JSON.parse(r.footnotes):[],l=(0,hf.useBlockProps)();return n?i.length?(0,wl.jsx)("ol",{...l,children:i.map(({id:s,content:c})=>(0,wl.jsxs)("li",{onMouseDown:u=>{u.target===u.currentTarget&&(u.target.firstElementChild.focus(),u.preventDefault())},children:[(0,wl.jsx)(hf.RichText,{id:s,tagName:"span",value:c,identifier:s,onFocus:u=>{u.target.textContent.trim()||u.target.scrollIntoView()},onChange:u=>{a({...r,footnotes:JSON.stringify(i.map(m=>m.id===s?{content:u,id:s}:m))})}})," ",(0,wl.jsx)("a",{href:`#${s}-link`,children:"\u21A9\uFE0E"})]},s))}):(0,wl.jsx)("div",{...l,children:(0,wl.jsx)(xR.Placeholder,{icon:(0,wl.jsx)(hf.BlockIcon,{icon:Ki}),label:(0,vb.__)("Footnotes"),instructions:(0,vb.__)("Footnotes found in blocks within this document will be displayed here.")})}):(0,wl.jsx)("div",{...l,children:(0,wl.jsx)(xR.Placeholder,{icon:(0,wl.jsx)(hf.BlockIcon,{icon:Ki}),label:(0,vb.__)("Footnotes"),instructions:(0,vb.__)("Footnotes are not supported here. Add this block to post or page content.")})})}var V7={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/footnotes",title:"Footnotes",category:"text",description:"Display footnotes added to the page.",keywords:["references"],textdomain:"default",usesContext:["postId","postType"],supports:{anchor:!0,__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!1,color:!1,width:!1,style:!1}},color:{background:!0,link:!0,text:!0,__experimentalDefaultControls:{link:!0,text:!0}},html:!1,multiple:!1,reusable:!1,inserter:!1,spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalTextDecoration:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalWritingMode:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}},style:"wp-block-footnotes"};var kR=o(P(),1);var kpe=o(em(),1),Au=o(T(),1),m0=o(V(),1),wpe=o(Q(),1),F7=o(W(),1);var Cpe=o(v(),1),wR="core/footnote",{usesContextKey:xCe}=K(Au.privateApis),xpe="core/post-content",kCe="core/block",Spe={title:(0,kR.__)("Footnote"),tagName:"sup",className:"fn",attributes:{"data-fn":"data-fn"},interactive:!0,contentEditable:!1,[xCe]:["postType","postId"],edit:function({value:t,onChange:r,isObjectActive:a,context:{postType:n,postId:i}}){let l=(0,m0.useRegistry)(),{getSelectedBlockClientId:s,getBlocks:c,getBlockRootClientId:u,getBlockName:m,getBlockParentsByBlockName:p}=l.select(Au.store),d=(0,m0.useSelect)(b=>{if(!b(F7.store).getBlockType("core/footnotes"))return!1;let y=b(Au.store).getSettings().allowedBlockTypes;if(y===!1||Array.isArray(y)&&!y.includes("core/footnotes")||typeof b(wpe.store).getEntityRecord("postType",n,i)?.meta?.footnotes!="string")return!1;let{getBlockParentsByBlockName:_,getSelectedBlockClientId:x,getBlockName:S}=b(Au.store),C=x();if(!C||S(C)===H7)return!1;let N=_(C,kCe);return!N||N.length===0},[n,i]),{selectionChange:f,insertBlock:h}=(0,m0.useDispatch)(Au.store);if(!d)return null;function g(){l.batch(()=>{let b;if(a)b=t.replacements[t.start]?.attributes?.["data-fn"];else{b=Am();let S=(0,kpe.insertObject)(t,{type:wR,attributes:{"data-fn":b},innerHTML:`<a href="#${b}" id="${b}-link">*</a>`},t.end,t.end);S.start=S.end-1,r(S)}let y=s(),k=p(y,xpe),_=k.length?c(k[0]):c(),x=null;{let S=[..._];for(;S.length;){let C=S.shift();if(C.name==="core/footnotes"){x=C;break}S.push(...C.innerBlocks)}}if(!x){let S=u(y);for(;S&&m(S)!==xpe;)S=u(S);x=(0,F7.createBlock)("core/footnotes"),h(x,void 0,S)}f(x.clientId,b,0,0)})}return(0,Cpe.jsx)(Au.RichTextToolbarButton,{icon:Ki,title:(0,kR.__)("Footnote"),onClick:g,isActive:a})}};var{name:H7}=V7,Ppe={icon:Ki,edit:_pe},wCe=()=>{(0,Tpe.registerFormatType)(wR,Spe),E({name:H7,metadata:V7,settings:Ppe})};function Bpe(e){return e&&"__experimental"in e&&e.__experimental!==!1}var Epe=o(U(),1),bb=o(V(),1),Rc=o(Npe(),1),SR=o(P(),1),Dpe=o(W(),1),TR=o(T(),1);function CCe(){let{registerShortcut:e}=(0,bb.useDispatch)(Rc.store),{replaceBlocks:t}=(0,bb.useDispatch)(TR.store),{getBlockName:r,getSelectedBlockClientId:a,getBlockAttributes:n}=(0,bb.useSelect)(TR.store),i=(l,s)=>{l.preventDefault();let c=a();if(c===null)return;let u=r(c),m=u==="core/paragraph",p=u==="core/heading";if(!m&&!p)return;let d=s===0?"core/paragraph":"core/heading",f=n(c);if(m&&s===0||p&&f.level===s)return;let h={content:f.content},g=f.textAlign||f.style?.typography?.textAlign;d==="core/heading"&&(h.level=s),g&&(h.style={typography:{textAlign:g}}),t(c,(0,Dpe.createBlock)(d,h))};return(0,Epe.useEffect)(()=>{e({name:"core/block-editor/transform-heading-to-paragraph",category:"block-library",description:(0,SR.__)("Transform heading to paragraph."),keyCombination:{modifier:"access",character:"0"},aliases:[{modifier:"access",character:"7"}]}),[1,2,3,4,5,6].forEach(l=>{e({name:`core/block-editor/transform-paragraph-to-heading-${l}`,category:"block-library",description:(0,SR.__)("Transform paragraph to heading."),keyCombination:{modifier:"access",character:`${l}`}})})},[e]),(0,Rc.useShortcut)("core/block-editor/transform-heading-to-paragraph",l=>i(l,0)),(0,Rc.useShortcut)("core/block-editor/transform-paragraph-to-heading-1",l=>i(l,1)),(0,Rc.useShortcut)("core/block-editor/transform-paragraph-to-heading-2",l=>i(l,2)),(0,Rc.useShortcut)("core/block-editor/transform-paragraph-to-heading-3",l=>i(l,3)),(0,Rc.useShortcut)("core/block-editor/transform-paragraph-to-heading-4",l=>i(l,4)),(0,Rc.useShortcut)("core/block-editor/transform-paragraph-to-heading-5",l=>i(l,5)),(0,Rc.useShortcut)("core/block-editor/transform-paragraph-to-heading-6",l=>i(l,6)),null}var Lpe=CCe;var PR={};sF(PR,{BlockKeyboardShortcuts:Lpe,NAVIGATION_OVERLAY_TEMPLATE_PART_AREA:ic});var O7=o(v(),1),SCe=()=>{let e=[YD,gE,aE,ZN,SE,RE,lM,GB,WB,$B,qB,ZB,aI,cI,pI,fI,vI,CI,TI,II,AI,hN,gN,wN,PN,JN,sE,PE,vE,xE,UE,GE,WE,DD,HD,WD,RD,PL,BL,sM,uM,gM,vM,yM,CA,TA,PA,FA,$A,pR,vR,_R,CR,TD,BD,ND,xM,PM,CM,UL,YA,QB,wL,hL,bL,pL,aL,nL,lL,sL,mL,dL,xL,yL,_L,kL,qL,KL,QL,XL,GL,nM,cM,LI,RI,zI,FI,HI,OI,UI,YI,qI,KI,QI,WI,uL,OA,nE,pE,zE,MD,tR,oR,aR,uR,mR,rM,iL,nI];return window?.__experimentalEnableFormBlocks&&(e.push(DN),e.push(MN),e.push(RN),e.push(zN)),window?.__experimentalEnableBlockExperiments&&(e.push(BA),e.push(jA),e.push(UA),e.push(GA),e.push(IA),e.push(eL),e.push(rL)),window?.wp?.oldEditor&&(window?.wp?.needsClassicBlock||!window?.__experimentalDisableTinymce||new URLSearchParams(window?.location?.search).get("requiresTinymce"))&&e.push(yI),e.filter(Boolean)},Vpe=()=>SCe().filter(({metadata:e})=>!Bpe(e)),TCe=(e=Vpe())=>{e.forEach(({init:t})=>t()),window.__unstableAutoRegisterBlocks&&window.__unstableAutoRegisterBlocks.forEach(t=>{let r=K((0,Ape.select)(Cl.store)).getBootstrappedBlockType(t);(0,Cl.registerBlockType)(t,{...r,title:r?.title||t,...(r?.apiVersion??0)<3&&{apiVersion:3},edit:function({attributes:n}){let i=(0,Mpe.useDisabled)(),l=(0,Rpe.useBlockProps)({ref:i}),{content:s,status:c,error:u}=(0,zpe.useServerSideRender)({block:t,attributes:n});return c==="loading"?(0,O7.jsx)("div",{...l,children:(0,yb.__)("Loading\u2026")}):c==="error"?(0,O7.jsx)("div",{...l,children:(0,yb.sprintf)((0,yb.__)("Error loading block: %s"),u)}):(0,O7.jsx)(uo,{wrapperProps:l,html:s})},save:()=>null})}),(0,Cl.setDefaultBlockName)(Sw),window.wp&&window.wp.oldEditor&&e.some(({name:t})=>t===F1)&&(0,Cl.setFreeformContentHandlerName)(F1),(0,Cl.setUnregisteredTypeHandlerName)(Tv),(0,Cl.setGroupingBlockName)(Z5)},PCe=void 0;return Jpe(BCe);})(); /*! Bundled license information: fast-average-color/dist/index.esm.js: (*! Fast Average Color | © 2022 Denis Seleznev | MIT License | https://github.com/fast-average-color/fast-average-color *) */ annotations.js 0000644 00000036205 15206720414 0007446 0 ustar 00 var wp; (wp ||= {}).annotations = (() => { 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 __export = (target, all) => { for (var name2 in all) __defProp(target, name2, { get: all[name2], enumerable: true }); }; 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 )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // package-external:@wordpress/rich-text var require_rich_text = __commonJS({ "package-external:@wordpress/rich-text"(exports, module) { module.exports = window.wp.richText; } }); // package-external:@wordpress/i18n var require_i18n = __commonJS({ "package-external:@wordpress/i18n"(exports, module) { module.exports = window.wp.i18n; } }); // package-external:@wordpress/hooks var require_hooks = __commonJS({ "package-external:@wordpress/hooks"(exports, module) { module.exports = window.wp.hooks; } }); // package-external:@wordpress/data var require_data = __commonJS({ "package-external:@wordpress/data"(exports, module) { module.exports = window.wp.data; } }); // packages/annotations/build-module/index.mjs var index_exports = {}; __export(index_exports, { store: () => store }); // packages/annotations/build-module/format/index.mjs var import_rich_text2 = __toESM(require_rich_text(), 1); // packages/annotations/build-module/format/annotation.mjs var import_i18n = __toESM(require_i18n(), 1); var import_rich_text = __toESM(require_rich_text(), 1); // packages/annotations/build-module/store/constants.mjs var STORE_NAME = "core/annotations"; // packages/annotations/build-module/format/annotation.mjs var FORMAT_NAME = "core/annotation"; var ANNOTATION_ATTRIBUTE_PREFIX = "annotation-text-"; function applyAnnotations(record, annotations2 = []) { annotations2.forEach((annotation2) => { let { start, end } = annotation2; if (start > record.text.length) { start = record.text.length; } if (end > record.text.length) { end = record.text.length; } const className = ANNOTATION_ATTRIBUTE_PREFIX + annotation2.source; const id = ANNOTATION_ATTRIBUTE_PREFIX + annotation2.id; record = (0, import_rich_text.applyFormat)( record, { type: FORMAT_NAME, attributes: { className, id } }, start, end ); }); return record; } function retrieveAnnotationPositions(formats) { const positions = {}; formats.forEach((characterFormats, i) => { characterFormats = characterFormats || []; characterFormats = characterFormats.filter( (format) => format.type === FORMAT_NAME ); characterFormats.forEach((format) => { let { id } = format.attributes; id = id.replace(ANNOTATION_ATTRIBUTE_PREFIX, ""); if (!positions.hasOwnProperty(id)) { positions[id] = { start: i }; } positions[id].end = i + 1; }); }); return positions; } function updateAnnotationsWithPositions(annotations2, positions, { removeAnnotation, updateAnnotationRange }) { annotations2.forEach((currentAnnotation) => { const position = positions[currentAnnotation.id]; if (!position) { removeAnnotation(currentAnnotation.id); return; } const { start, end } = currentAnnotation; if (start !== position.start || end !== position.end) { updateAnnotationRange( currentAnnotation.id, position.start, position.end ); } }); } var annotation = { name: FORMAT_NAME, title: (0, import_i18n.__)("Annotation"), tagName: "mark", className: "annotation-text", attributes: { className: "class", id: "id" }, edit() { return null; }, __experimentalGetPropsForEditableTreePreparation(select, { richTextIdentifier, blockClientId }) { return { annotations: select( STORE_NAME ).__experimentalGetAnnotationsForRichText( blockClientId, richTextIdentifier ) }; }, __experimentalCreatePrepareEditableTree({ annotations: annotations2 }) { return (formats, text) => { if (annotations2.length === 0) { return formats; } let record = { formats, text }; record = applyAnnotations(record, annotations2); return record.formats; }; }, __experimentalGetPropsForEditableTreeChangeHandler(dispatch) { return { removeAnnotation: dispatch(STORE_NAME).__experimentalRemoveAnnotation, updateAnnotationRange: dispatch(STORE_NAME).__experimentalUpdateAnnotationRange }; }, __experimentalCreateOnChangeEditableValue(props) { return (formats) => { const positions = retrieveAnnotationPositions(formats); const { removeAnnotation, updateAnnotationRange, annotations: annotations2 } = props; updateAnnotationsWithPositions(annotations2, positions, { removeAnnotation, updateAnnotationRange }); }; } }; // packages/annotations/build-module/format/index.mjs var { name, ...settings } = annotation; (0, import_rich_text2.registerFormatType)(name, settings); // packages/annotations/build-module/block/index.mjs var import_hooks = __toESM(require_hooks(), 1); var import_data = __toESM(require_data(), 1); var addAnnotationClassName = (OriginalComponent) => { return (0, import_data.withSelect)((select, { clientId, className }) => { const annotations2 = select(STORE_NAME).__experimentalGetAnnotationsForBlock( clientId ); return { className: annotations2.map((annotation2) => { return "is-annotated-by-" + annotation2.source; }).concat(className).filter(Boolean).join(" ") }; })(OriginalComponent); }; (0, import_hooks.addFilter)( "editor.BlockListBlock", "core/annotations", addAnnotationClassName ); // packages/annotations/build-module/store/index.mjs var import_data3 = __toESM(require_data(), 1); // packages/annotations/build-module/store/reducer.mjs function filterWithReference(collection, predicate) { const filteredCollection = collection.filter(predicate); return collection.length === filteredCollection.length ? collection : filteredCollection; } var mapValues = (obj, callback) => Object.entries(obj).reduce( (acc, [key, value]) => ({ ...acc, [key]: callback(value) }), {} ); function isValidAnnotationRange(annotation2) { return typeof annotation2.start === "number" && typeof annotation2.end === "number" && annotation2.start <= annotation2.end; } function annotations(state = {}, action) { switch (action.type) { case "ANNOTATION_ADD": const blockClientId = action.blockClientId; const newAnnotation = { id: action.id, blockClientId, richTextIdentifier: action.richTextIdentifier, source: action.source, selector: action.selector, range: action.range }; if (newAnnotation.selector === "range" && !isValidAnnotationRange(newAnnotation.range)) { return state; } const previousAnnotationsForBlock = state?.[blockClientId] ?? []; return { ...state, [blockClientId]: [ ...previousAnnotationsForBlock, newAnnotation ] }; case "ANNOTATION_REMOVE": return mapValues(state, (annotationsForBlock) => { return filterWithReference( annotationsForBlock, (annotation2) => { return annotation2.id !== action.annotationId; } ); }); case "ANNOTATION_UPDATE_RANGE": return mapValues(state, (annotationsForBlock) => { let hasChangedRange = false; const newAnnotations = annotationsForBlock.map( (annotation2) => { if (annotation2.id === action.annotationId) { hasChangedRange = true; return { ...annotation2, range: { start: action.start, end: action.end } }; } return annotation2; } ); return hasChangedRange ? newAnnotations : annotationsForBlock; }); case "ANNOTATION_REMOVE_SOURCE": return mapValues(state, (annotationsForBlock) => { return filterWithReference( annotationsForBlock, (annotation2) => { return annotation2.source !== action.source; } ); }); } return state; } var reducer_default = annotations; // packages/annotations/build-module/store/selectors.mjs var selectors_exports = {}; __export(selectors_exports, { __experimentalGetAllAnnotationsForBlock: () => __experimentalGetAllAnnotationsForBlock, __experimentalGetAnnotations: () => __experimentalGetAnnotations, __experimentalGetAnnotationsForBlock: () => __experimentalGetAnnotationsForBlock, __experimentalGetAnnotationsForRichText: () => __experimentalGetAnnotationsForRichText }); var import_data2 = __toESM(require_data(), 1); var EMPTY_ARRAY = []; var __experimentalGetAnnotationsForBlock = (0, import_data2.createSelector)( (state, blockClientId) => { return (state?.[blockClientId] ?? []).filter((annotation2) => { return annotation2.selector === "block"; }); }, (state, blockClientId) => [state?.[blockClientId] ?? EMPTY_ARRAY] ); function __experimentalGetAllAnnotationsForBlock(state, blockClientId) { return state?.[blockClientId] ?? EMPTY_ARRAY; } var __experimentalGetAnnotationsForRichText = (0, import_data2.createSelector)( (state, blockClientId, richTextIdentifier) => { return (state?.[blockClientId] ?? []).filter((annotation2) => { return annotation2.selector === "range" && richTextIdentifier === annotation2.richTextIdentifier; }).map((annotation2) => { const { range, ...other } = annotation2; return { ...range, ...other }; }); }, (state, blockClientId) => [state?.[blockClientId] ?? EMPTY_ARRAY] ); function __experimentalGetAnnotations(state) { return Object.values(state).flat(); } // packages/annotations/build-module/store/actions.mjs var actions_exports = {}; __export(actions_exports, { __experimentalAddAnnotation: () => __experimentalAddAnnotation, __experimentalRemoveAnnotation: () => __experimentalRemoveAnnotation, __experimentalRemoveAnnotationsBySource: () => __experimentalRemoveAnnotationsBySource, __experimentalUpdateAnnotationRange: () => __experimentalUpdateAnnotationRange }); // node_modules/uuid/dist/esm-browser/rng.js var getRandomValues; var rnds8 = new Uint8Array(16); function rng() { if (!getRandomValues) { getRandomValues = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto); if (!getRandomValues) { throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported"); } } return getRandomValues(rnds8); } // node_modules/uuid/dist/esm-browser/stringify.js var byteToHex = []; for (let i = 0; i < 256; ++i) { byteToHex.push((i + 256).toString(16).slice(1)); } function unsafeStringify(arr, offset = 0) { return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]; } // node_modules/uuid/dist/esm-browser/native.js var randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto); var native_default = { randomUUID }; // node_modules/uuid/dist/esm-browser/v4.js function v4(options, buf, offset) { if (native_default.randomUUID && !buf && !options) { return native_default.randomUUID(); } options = options || {}; const rnds = options.random || (options.rng || rng)(); rnds[6] = rnds[6] & 15 | 64; rnds[8] = rnds[8] & 63 | 128; if (buf) { offset = offset || 0; for (let i = 0; i < 16; ++i) { buf[offset + i] = rnds[i]; } return buf; } return unsafeStringify(rnds); } var v4_default = v4; // packages/annotations/build-module/store/actions.mjs function __experimentalAddAnnotation({ blockClientId, richTextIdentifier = null, range = null, selector = "range", source = "default", id = v4_default() }) { const action = { type: "ANNOTATION_ADD", id, blockClientId, richTextIdentifier, source, selector }; if (selector === "range") { action.range = range; } return action; } function __experimentalRemoveAnnotation(annotationId) { return { type: "ANNOTATION_REMOVE", annotationId }; } function __experimentalUpdateAnnotationRange(annotationId, start, end) { return { type: "ANNOTATION_UPDATE_RANGE", annotationId, start, end }; } function __experimentalRemoveAnnotationsBySource(source) { return { type: "ANNOTATION_REMOVE_SOURCE", source }; } // packages/annotations/build-module/store/index.mjs var store = (0, import_data3.createReduxStore)(STORE_NAME, { reducer: reducer_default, selectors: selectors_exports, actions: actions_exports }); (0, import_data3.register)(store); return __toCommonJS(index_exports); })(); blocks.js 0000644 00001372076 15206720414 0006400 0 ustar 00 var wp; (wp ||= {}).blocks = (() => { 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 __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; 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 )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // package-external:@wordpress/data var require_data = __commonJS({ "package-external:@wordpress/data"(exports, module) { module.exports = window.wp.data; } }); // package-external:@wordpress/i18n var require_i18n = __commonJS({ "package-external:@wordpress/i18n"(exports, module) { module.exports = window.wp.i18n; } }); // package-external:@wordpress/element var require_element = __commonJS({ "package-external:@wordpress/element"(exports, module) { module.exports = window.wp.element; } }); // package-external:@wordpress/dom var require_dom = __commonJS({ "package-external:@wordpress/dom"(exports, module) { module.exports = window.wp.dom; } }); // package-external:@wordpress/rich-text var require_rich_text = __commonJS({ "package-external:@wordpress/rich-text"(exports, module) { module.exports = window.wp.richText; } }); // package-external:@wordpress/deprecated var require_deprecated = __commonJS({ "package-external:@wordpress/deprecated"(exports, module) { module.exports = window.wp.deprecated; } }); // package-external:@wordpress/warning var require_warning = __commonJS({ "package-external:@wordpress/warning"(exports, module) { module.exports = window.wp.warning; } }); // package-external:@wordpress/private-apis var require_private_apis = __commonJS({ "package-external:@wordpress/private-apis"(exports, module) { module.exports = window.wp.privateApis; } }); // node_modules/remove-accents/index.js var require_remove_accents = __commonJS({ "node_modules/remove-accents/index.js"(exports, module) { var characterMap = { "\xC0": "A", "\xC1": "A", "\xC2": "A", "\xC3": "A", "\xC4": "A", "\xC5": "A", "\u1EA4": "A", "\u1EAE": "A", "\u1EB2": "A", "\u1EB4": "A", "\u1EB6": "A", "\xC6": "AE", "\u1EA6": "A", "\u1EB0": "A", "\u0202": "A", "\u1EA2": "A", "\u1EA0": "A", "\u1EA8": "A", "\u1EAA": "A", "\u1EAC": "A", "\xC7": "C", "\u1E08": "C", "\xC8": "E", "\xC9": "E", "\xCA": "E", "\xCB": "E", "\u1EBE": "E", "\u1E16": "E", "\u1EC0": "E", "\u1E14": "E", "\u1E1C": "E", "\u0206": "E", "\u1EBA": "E", "\u1EBC": "E", "\u1EB8": "E", "\u1EC2": "E", "\u1EC4": "E", "\u1EC6": "E", "\xCC": "I", "\xCD": "I", "\xCE": "I", "\xCF": "I", "\u1E2E": "I", "\u020A": "I", "\u1EC8": "I", "\u1ECA": "I", "\xD0": "D", "\xD1": "N", "\xD2": "O", "\xD3": "O", "\xD4": "O", "\xD5": "O", "\xD6": "O", "\xD8": "O", "\u1ED0": "O", "\u1E4C": "O", "\u1E52": "O", "\u020E": "O", "\u1ECE": "O", "\u1ECC": "O", "\u1ED4": "O", "\u1ED6": "O", "\u1ED8": "O", "\u1EDC": "O", "\u1EDE": "O", "\u1EE0": "O", "\u1EDA": "O", "\u1EE2": "O", "\xD9": "U", "\xDA": "U", "\xDB": "U", "\xDC": "U", "\u1EE6": "U", "\u1EE4": "U", "\u1EEC": "U", "\u1EEE": "U", "\u1EF0": "U", "\xDD": "Y", "\xE0": "a", "\xE1": "a", "\xE2": "a", "\xE3": "a", "\xE4": "a", "\xE5": "a", "\u1EA5": "a", "\u1EAF": "a", "\u1EB3": "a", "\u1EB5": "a", "\u1EB7": "a", "\xE6": "ae", "\u1EA7": "a", "\u1EB1": "a", "\u0203": "a", "\u1EA3": "a", "\u1EA1": "a", "\u1EA9": "a", "\u1EAB": "a", "\u1EAD": "a", "\xE7": "c", "\u1E09": "c", "\xE8": "e", "\xE9": "e", "\xEA": "e", "\xEB": "e", "\u1EBF": "e", "\u1E17": "e", "\u1EC1": "e", "\u1E15": "e", "\u1E1D": "e", "\u0207": "e", "\u1EBB": "e", "\u1EBD": "e", "\u1EB9": "e", "\u1EC3": "e", "\u1EC5": "e", "\u1EC7": "e", "\xEC": "i", "\xED": "i", "\xEE": "i", "\xEF": "i", "\u1E2F": "i", "\u020B": "i", "\u1EC9": "i", "\u1ECB": "i", "\xF0": "d", "\xF1": "n", "\xF2": "o", "\xF3": "o", "\xF4": "o", "\xF5": "o", "\xF6": "o", "\xF8": "o", "\u1ED1": "o", "\u1E4D": "o", "\u1E53": "o", "\u020F": "o", "\u1ECF": "o", "\u1ECD": "o", "\u1ED5": "o", "\u1ED7": "o", "\u1ED9": "o", "\u1EDD": "o", "\u1EDF": "o", "\u1EE1": "o", "\u1EDB": "o", "\u1EE3": "o", "\xF9": "u", "\xFA": "u", "\xFB": "u", "\xFC": "u", "\u1EE7": "u", "\u1EE5": "u", "\u1EED": "u", "\u1EEF": "u", "\u1EF1": "u", "\xFD": "y", "\xFF": "y", "\u0100": "A", "\u0101": "a", "\u0102": "A", "\u0103": "a", "\u0104": "A", "\u0105": "a", "\u0106": "C", "\u0107": "c", "\u0108": "C", "\u0109": "c", "\u010A": "C", "\u010B": "c", "\u010C": "C", "\u010D": "c", "C\u0306": "C", "c\u0306": "c", "\u010E": "D", "\u010F": "d", "\u0110": "D", "\u0111": "d", "\u0112": "E", "\u0113": "e", "\u0114": "E", "\u0115": "e", "\u0116": "E", "\u0117": "e", "\u0118": "E", "\u0119": "e", "\u011A": "E", "\u011B": "e", "\u011C": "G", "\u01F4": "G", "\u011D": "g", "\u01F5": "g", "\u011E": "G", "\u011F": "g", "\u0120": "G", "\u0121": "g", "\u0122": "G", "\u0123": "g", "\u0124": "H", "\u0125": "h", "\u0126": "H", "\u0127": "h", "\u1E2A": "H", "\u1E2B": "h", "\u0128": "I", "\u0129": "i", "\u012A": "I", "\u012B": "i", "\u012C": "I", "\u012D": "i", "\u012E": "I", "\u012F": "i", "\u0130": "I", "\u0131": "i", "\u0132": "IJ", "\u0133": "ij", "\u0134": "J", "\u0135": "j", "\u0136": "K", "\u0137": "k", "\u1E30": "K", "\u1E31": "k", "K\u0306": "K", "k\u0306": "k", "\u0139": "L", "\u013A": "l", "\u013B": "L", "\u013C": "l", "\u013D": "L", "\u013E": "l", "\u013F": "L", "\u0140": "l", "\u0141": "l", "\u0142": "l", "\u1E3E": "M", "\u1E3F": "m", "M\u0306": "M", "m\u0306": "m", "\u0143": "N", "\u0144": "n", "\u0145": "N", "\u0146": "n", "\u0147": "N", "\u0148": "n", "\u0149": "n", "N\u0306": "N", "n\u0306": "n", "\u014C": "O", "\u014D": "o", "\u014E": "O", "\u014F": "o", "\u0150": "O", "\u0151": "o", "\u0152": "OE", "\u0153": "oe", "P\u0306": "P", "p\u0306": "p", "\u0154": "R", "\u0155": "r", "\u0156": "R", "\u0157": "r", "\u0158": "R", "\u0159": "r", "R\u0306": "R", "r\u0306": "r", "\u0212": "R", "\u0213": "r", "\u015A": "S", "\u015B": "s", "\u015C": "S", "\u015D": "s", "\u015E": "S", "\u0218": "S", "\u0219": "s", "\u015F": "s", "\u0160": "S", "\u0161": "s", "\u0162": "T", "\u0163": "t", "\u021B": "t", "\u021A": "T", "\u0164": "T", "\u0165": "t", "\u0166": "T", "\u0167": "t", "T\u0306": "T", "t\u0306": "t", "\u0168": "U", "\u0169": "u", "\u016A": "U", "\u016B": "u", "\u016C": "U", "\u016D": "u", "\u016E": "U", "\u016F": "u", "\u0170": "U", "\u0171": "u", "\u0172": "U", "\u0173": "u", "\u0216": "U", "\u0217": "u", "V\u0306": "V", "v\u0306": "v", "\u0174": "W", "\u0175": "w", "\u1E82": "W", "\u1E83": "w", "X\u0306": "X", "x\u0306": "x", "\u0176": "Y", "\u0177": "y", "\u0178": "Y", "Y\u0306": "Y", "y\u0306": "y", "\u0179": "Z", "\u017A": "z", "\u017B": "Z", "\u017C": "z", "\u017D": "Z", "\u017E": "z", "\u017F": "s", "\u0192": "f", "\u01A0": "O", "\u01A1": "o", "\u01AF": "U", "\u01B0": "u", "\u01CD": "A", "\u01CE": "a", "\u01CF": "I", "\u01D0": "i", "\u01D1": "O", "\u01D2": "o", "\u01D3": "U", "\u01D4": "u", "\u01D5": "U", "\u01D6": "u", "\u01D7": "U", "\u01D8": "u", "\u01D9": "U", "\u01DA": "u", "\u01DB": "U", "\u01DC": "u", "\u1EE8": "U", "\u1EE9": "u", "\u1E78": "U", "\u1E79": "u", "\u01FA": "A", "\u01FB": "a", "\u01FC": "AE", "\u01FD": "ae", "\u01FE": "O", "\u01FF": "o", "\xDE": "TH", "\xFE": "th", "\u1E54": "P", "\u1E55": "p", "\u1E64": "S", "\u1E65": "s", "X\u0301": "X", "x\u0301": "x", "\u0403": "\u0413", "\u0453": "\u0433", "\u040C": "\u041A", "\u045C": "\u043A", "A\u030B": "A", "a\u030B": "a", "E\u030B": "E", "e\u030B": "e", "I\u030B": "I", "i\u030B": "i", "\u01F8": "N", "\u01F9": "n", "\u1ED2": "O", "\u1ED3": "o", "\u1E50": "O", "\u1E51": "o", "\u1EEA": "U", "\u1EEB": "u", "\u1E80": "W", "\u1E81": "w", "\u1EF2": "Y", "\u1EF3": "y", "\u0200": "A", "\u0201": "a", "\u0204": "E", "\u0205": "e", "\u0208": "I", "\u0209": "i", "\u020C": "O", "\u020D": "o", "\u0210": "R", "\u0211": "r", "\u0214": "U", "\u0215": "u", "B\u030C": "B", "b\u030C": "b", "\u010C\u0323": "C", "\u010D\u0323": "c", "\xCA\u030C": "E", "\xEA\u030C": "e", "F\u030C": "F", "f\u030C": "f", "\u01E6": "G", "\u01E7": "g", "\u021E": "H", "\u021F": "h", "J\u030C": "J", "\u01F0": "j", "\u01E8": "K", "\u01E9": "k", "M\u030C": "M", "m\u030C": "m", "P\u030C": "P", "p\u030C": "p", "Q\u030C": "Q", "q\u030C": "q", "\u0158\u0329": "R", "\u0159\u0329": "r", "\u1E66": "S", "\u1E67": "s", "V\u030C": "V", "v\u030C": "v", "W\u030C": "W", "w\u030C": "w", "X\u030C": "X", "x\u030C": "x", "Y\u030C": "Y", "y\u030C": "y", "A\u0327": "A", "a\u0327": "a", "B\u0327": "B", "b\u0327": "b", "\u1E10": "D", "\u1E11": "d", "\u0228": "E", "\u0229": "e", "\u0190\u0327": "E", "\u025B\u0327": "e", "\u1E28": "H", "\u1E29": "h", "I\u0327": "I", "i\u0327": "i", "\u0197\u0327": "I", "\u0268\u0327": "i", "M\u0327": "M", "m\u0327": "m", "O\u0327": "O", "o\u0327": "o", "Q\u0327": "Q", "q\u0327": "q", "U\u0327": "U", "u\u0327": "u", "X\u0327": "X", "x\u0327": "x", "Z\u0327": "Z", "z\u0327": "z", "\u0439": "\u0438", "\u0419": "\u0418", "\u0451": "\u0435", "\u0401": "\u0415" }; var chars = Object.keys(characterMap).join("|"); var allAccents = new RegExp(chars, "g"); var firstAccent = new RegExp(chars, ""); function matcher3(match) { return characterMap[match]; } var removeAccents2 = function(string) { return string.replace(allAccents, matcher3); }; var hasAccents = function(string) { return !!string.match(firstAccent); }; module.exports = removeAccents2; module.exports.has = hasAccents; module.exports.remove = removeAccents2; } }); // packages/blocks/node_modules/react-is/cjs/react-is.development.js var require_react_is_development = __commonJS({ "packages/blocks/node_modules/react-is/cjs/react-is.development.js"(exports) { "use strict"; if (true) { (function() { "use strict"; var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.element"); var REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal"); var REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment"); var REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode"); var REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler"); var REACT_PROVIDER_TYPE = /* @__PURE__ */ Symbol.for("react.provider"); var REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context"); var REACT_SERVER_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.server_context"); var REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref"); var REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense"); var REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for("react.suspense_list"); var REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo"); var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy"); var REACT_OFFSCREEN_TYPE = /* @__PURE__ */ Symbol.for("react.offscreen"); var enableScopeAPI = false; var enableCacheElement = false; var enableTransitionTracing = false; var enableLegacyHidden = false; var enableDebugTracing = false; var REACT_MODULE_REFERENCE; { REACT_MODULE_REFERENCE = /* @__PURE__ */ Symbol.for("react.module.reference"); } function isValidElementType2(type) { if (typeof type === "string" || typeof type === "function") { return true; } if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) { return true; } if (typeof type === "object" && type !== null) { if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object // types supported by any Flight configuration anywhere since // we don't know which Flight build this will end up being used // with. type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== void 0) { return true; } } return false; } function typeOf(object) { if (typeof object === "object" && object !== null) { var $$typeof = object.$$typeof; switch ($$typeof) { case REACT_ELEMENT_TYPE: var type = object.type; switch (type) { case REACT_FRAGMENT_TYPE: case REACT_PROFILER_TYPE: case REACT_STRICT_MODE_TYPE: case REACT_SUSPENSE_TYPE: case REACT_SUSPENSE_LIST_TYPE: return type; default: var $$typeofType = type && type.$$typeof; switch ($$typeofType) { case REACT_SERVER_CONTEXT_TYPE: case REACT_CONTEXT_TYPE: case REACT_FORWARD_REF_TYPE: case REACT_LAZY_TYPE: case REACT_MEMO_TYPE: case REACT_PROVIDER_TYPE: return $$typeofType; default: return $$typeof; } } case REACT_PORTAL_TYPE: return $$typeof; } } return void 0; } var ContextConsumer = REACT_CONTEXT_TYPE; var ContextProvider = REACT_PROVIDER_TYPE; var Element = REACT_ELEMENT_TYPE; var ForwardRef = REACT_FORWARD_REF_TYPE; var Fragment = REACT_FRAGMENT_TYPE; var Lazy = REACT_LAZY_TYPE; var Memo = REACT_MEMO_TYPE; var Portal = REACT_PORTAL_TYPE; var Profiler = REACT_PROFILER_TYPE; var StrictMode = REACT_STRICT_MODE_TYPE; var Suspense = REACT_SUSPENSE_TYPE; var SuspenseList = REACT_SUSPENSE_LIST_TYPE; var hasWarnedAboutDeprecatedIsAsyncMode = false; var hasWarnedAboutDeprecatedIsConcurrentMode = false; function isAsyncMode(object) { { if (!hasWarnedAboutDeprecatedIsAsyncMode) { hasWarnedAboutDeprecatedIsAsyncMode = true; console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+."); } } return false; } function isConcurrentMode(object) { { if (!hasWarnedAboutDeprecatedIsConcurrentMode) { hasWarnedAboutDeprecatedIsConcurrentMode = true; console["warn"]("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+."); } } return false; } function isContextConsumer(object) { return typeOf(object) === REACT_CONTEXT_TYPE; } function isContextProvider(object) { return typeOf(object) === REACT_PROVIDER_TYPE; } function isElement(object) { return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; } function isForwardRef(object) { return typeOf(object) === REACT_FORWARD_REF_TYPE; } function isFragment(object) { return typeOf(object) === REACT_FRAGMENT_TYPE; } function isLazy(object) { return typeOf(object) === REACT_LAZY_TYPE; } function isMemo(object) { return typeOf(object) === REACT_MEMO_TYPE; } function isPortal(object) { return typeOf(object) === REACT_PORTAL_TYPE; } function isProfiler(object) { return typeOf(object) === REACT_PROFILER_TYPE; } function isStrictMode(object) { return typeOf(object) === REACT_STRICT_MODE_TYPE; } function isSuspense(object) { return typeOf(object) === REACT_SUSPENSE_TYPE; } function isSuspenseList(object) { return typeOf(object) === REACT_SUSPENSE_LIST_TYPE; } exports.ContextConsumer = ContextConsumer; exports.ContextProvider = ContextProvider; exports.Element = Element; exports.ForwardRef = ForwardRef; exports.Fragment = Fragment; exports.Lazy = Lazy; exports.Memo = Memo; exports.Portal = Portal; exports.Profiler = Profiler; exports.StrictMode = StrictMode; exports.Suspense = Suspense; exports.SuspenseList = SuspenseList; exports.isAsyncMode = isAsyncMode; exports.isConcurrentMode = isConcurrentMode; exports.isContextConsumer = isContextConsumer; exports.isContextProvider = isContextProvider; exports.isElement = isElement; exports.isForwardRef = isForwardRef; exports.isFragment = isFragment; exports.isLazy = isLazy; exports.isMemo = isMemo; exports.isPortal = isPortal; exports.isProfiler = isProfiler; exports.isStrictMode = isStrictMode; exports.isSuspense = isSuspense; exports.isSuspenseList = isSuspenseList; exports.isValidElementType = isValidElementType2; exports.typeOf = typeOf; })(); } } }); // packages/blocks/node_modules/react-is/index.js var require_react_is = __commonJS({ "packages/blocks/node_modules/react-is/index.js"(exports, module) { "use strict"; if (false) { module.exports = null; } else { module.exports = require_react_is_development(); } } }); // package-external:@wordpress/hooks var require_hooks = __commonJS({ "package-external:@wordpress/hooks"(exports, module) { module.exports = window.wp.hooks; } }); // package-external:@wordpress/block-serialization-default-parser var require_block_serialization_default_parser = __commonJS({ "package-external:@wordpress/block-serialization-default-parser"(exports, module) { module.exports = window.wp.blockSerializationDefaultParser; } }); // package-external:@wordpress/autop var require_autop = __commonJS({ "package-external:@wordpress/autop"(exports, module) { module.exports = window.wp.autop; } }); // package-external:@wordpress/is-shallow-equal var require_is_shallow_equal = __commonJS({ "package-external:@wordpress/is-shallow-equal"(exports, module) { module.exports = window.wp.isShallowEqual; } }); // vendor-external:react/jsx-runtime var require_jsx_runtime = __commonJS({ "vendor-external:react/jsx-runtime"(exports, module) { module.exports = window.ReactJSXRuntime; } }); // node_modules/fast-deep-equal/es6/index.js var require_es6 = __commonJS({ "node_modules/fast-deep-equal/es6/index.js"(exports, module) { "use strict"; module.exports = function equal(a2, b2) { if (a2 === b2) return true; if (a2 && b2 && typeof a2 == "object" && typeof b2 == "object") { if (a2.constructor !== b2.constructor) return false; var length, i2, keys; if (Array.isArray(a2)) { length = a2.length; if (length != b2.length) return false; for (i2 = length; i2-- !== 0; ) if (!equal(a2[i2], b2[i2])) return false; return true; } if (a2 instanceof Map && b2 instanceof Map) { if (a2.size !== b2.size) return false; for (i2 of a2.entries()) if (!b2.has(i2[0])) return false; for (i2 of a2.entries()) if (!equal(i2[1], b2.get(i2[0]))) return false; return true; } if (a2 instanceof Set && b2 instanceof Set) { if (a2.size !== b2.size) return false; for (i2 of a2.entries()) if (!b2.has(i2[0])) return false; return true; } if (ArrayBuffer.isView(a2) && ArrayBuffer.isView(b2)) { length = a2.length; if (length != b2.length) return false; for (i2 = length; i2-- !== 0; ) if (a2[i2] !== b2[i2]) return false; return true; } if (a2.constructor === RegExp) return a2.source === b2.source && a2.flags === b2.flags; if (a2.valueOf !== Object.prototype.valueOf) return a2.valueOf() === b2.valueOf(); if (a2.toString !== Object.prototype.toString) return a2.toString() === b2.toString(); keys = Object.keys(a2); length = keys.length; if (length !== Object.keys(b2).length) return false; for (i2 = length; i2-- !== 0; ) if (!Object.prototype.hasOwnProperty.call(b2, keys[i2])) return false; for (i2 = length; i2-- !== 0; ) { var key = keys[i2]; if (!equal(a2[key], b2[key])) return false; } return true; } return a2 !== a2 && b2 !== b2; }; } }); // package-external:@wordpress/html-entities var require_html_entities = __commonJS({ "package-external:@wordpress/html-entities"(exports, module) { module.exports = window.wp.htmlEntities; } }); // package-external:@wordpress/shortcode var require_shortcode = __commonJS({ "package-external:@wordpress/shortcode"(exports, module) { module.exports = window.wp.shortcode; } }); // package-external:@wordpress/blob var require_blob = __commonJS({ "package-external:@wordpress/blob"(exports, module) { module.exports = window.wp.blob; } }); // node_modules/showdown/dist/showdown.js var require_showdown = __commonJS({ "node_modules/showdown/dist/showdown.js"(exports, module) { (function() { function getDefaultOpts(simple) { "use strict"; var defaultOptions = { omitExtraWLInCodeBlocks: { defaultValue: false, describe: "Omit the default extra whiteline added to code blocks", type: "boolean" }, noHeaderId: { defaultValue: false, describe: "Turn on/off generated header id", type: "boolean" }, prefixHeaderId: { defaultValue: false, describe: "Add a prefix to the generated header ids. Passing a string will prefix that string to the header id. Setting to true will add a generic 'section-' prefix", type: "string" }, rawPrefixHeaderId: { defaultValue: false, describe: 'Setting this option to true will prevent showdown from modifying the prefix. This might result in malformed IDs (if, for instance, the " char is used in the prefix)', type: "boolean" }, ghCompatibleHeaderId: { defaultValue: false, describe: "Generate header ids compatible with github style (spaces are replaced with dashes, a bunch of non alphanumeric chars are removed)", type: "boolean" }, rawHeaderId: { defaultValue: false, describe: `Remove only spaces, ' and " from generated header ids (including prefixes), replacing them with dashes (-). WARNING: This might result in malformed ids`, type: "boolean" }, headerLevelStart: { defaultValue: false, describe: "The header blocks level start", type: "integer" }, parseImgDimensions: { defaultValue: false, describe: "Turn on/off image dimension parsing", type: "boolean" }, simplifiedAutoLink: { defaultValue: false, describe: "Turn on/off GFM autolink style", type: "boolean" }, excludeTrailingPunctuationFromURLs: { defaultValue: false, describe: "Excludes trailing punctuation from links generated with autoLinking", type: "boolean" }, literalMidWordUnderscores: { defaultValue: false, describe: "Parse midword underscores as literal underscores", type: "boolean" }, literalMidWordAsterisks: { defaultValue: false, describe: "Parse midword asterisks as literal asterisks", type: "boolean" }, strikethrough: { defaultValue: false, describe: "Turn on/off strikethrough support", type: "boolean" }, tables: { defaultValue: false, describe: "Turn on/off tables support", type: "boolean" }, tablesHeaderId: { defaultValue: false, describe: "Add an id to table headers", type: "boolean" }, ghCodeBlocks: { defaultValue: true, describe: "Turn on/off GFM fenced code blocks support", type: "boolean" }, tasklists: { defaultValue: false, describe: "Turn on/off GFM tasklist support", type: "boolean" }, smoothLivePreview: { defaultValue: false, describe: "Prevents weird effects in live previews due to incomplete input", type: "boolean" }, smartIndentationFix: { defaultValue: false, description: "Tries to smartly fix indentation in es6 strings", type: "boolean" }, disableForced4SpacesIndentedSublists: { defaultValue: false, description: "Disables the requirement of indenting nested sublists by 4 spaces", type: "boolean" }, simpleLineBreaks: { defaultValue: false, description: "Parses simple line breaks as <br> (GFM Style)", type: "boolean" }, requireSpaceBeforeHeadingText: { defaultValue: false, description: "Makes adding a space between `#` and the header text mandatory (GFM Style)", type: "boolean" }, ghMentions: { defaultValue: false, description: "Enables github @mentions", type: "boolean" }, ghMentionsLink: { defaultValue: "https://github.com/{u}", description: "Changes the link generated by @mentions. Only applies if ghMentions option is enabled.", type: "string" }, encodeEmails: { defaultValue: true, description: "Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities", type: "boolean" }, openLinksInNewWindow: { defaultValue: false, description: "Open all links in new windows", type: "boolean" }, backslashEscapesHTMLTags: { defaultValue: false, description: "Support for HTML Tag escaping. ex: <div>foo</div>", type: "boolean" }, emoji: { defaultValue: false, description: "Enable emoji support. Ex: `this is a :smile: emoji`", type: "boolean" }, underline: { defaultValue: false, description: "Enable support for underline. Syntax is double or triple underscores: `__underline word__`. With this option enabled, underscores no longer parses into `<em>` and `<strong>`", type: "boolean" }, completeHTMLDocument: { defaultValue: false, description: "Outputs a complete html document, including `<html>`, `<head>` and `<body>` tags", type: "boolean" }, metadata: { defaultValue: false, description: "Enable support for document metadata (defined at the top of the document between `\xAB\xAB\xAB` and `\xBB\xBB\xBB` or between `---` and `---`).", type: "boolean" }, splitAdjacentBlockquotes: { defaultValue: false, description: "Split adjacent blockquote blocks", type: "boolean" } }; if (simple === false) { return JSON.parse(JSON.stringify(defaultOptions)); } var ret = {}; for (var opt in defaultOptions) { if (defaultOptions.hasOwnProperty(opt)) { ret[opt] = defaultOptions[opt].defaultValue; } } return ret; } function allOptionsOn() { "use strict"; var options = getDefaultOpts(true), ret = {}; for (var opt in options) { if (options.hasOwnProperty(opt)) { ret[opt] = true; } } return ret; } var showdown2 = {}, parsers = {}, extensions = {}, globalOptions = getDefaultOpts(true), setFlavor = "vanilla", flavor = { github: { omitExtraWLInCodeBlocks: true, simplifiedAutoLink: true, excludeTrailingPunctuationFromURLs: true, literalMidWordUnderscores: true, strikethrough: true, tables: true, tablesHeaderId: true, ghCodeBlocks: true, tasklists: true, disableForced4SpacesIndentedSublists: true, simpleLineBreaks: true, requireSpaceBeforeHeadingText: true, ghCompatibleHeaderId: true, ghMentions: true, backslashEscapesHTMLTags: true, emoji: true, splitAdjacentBlockquotes: true }, original: { noHeaderId: true, ghCodeBlocks: false }, ghost: { omitExtraWLInCodeBlocks: true, parseImgDimensions: true, simplifiedAutoLink: true, excludeTrailingPunctuationFromURLs: true, literalMidWordUnderscores: true, strikethrough: true, tables: true, tablesHeaderId: true, ghCodeBlocks: true, tasklists: true, smoothLivePreview: true, simpleLineBreaks: true, requireSpaceBeforeHeadingText: true, ghMentions: false, encodeEmails: true }, vanilla: getDefaultOpts(true), allOn: allOptionsOn() }; showdown2.helper = {}; showdown2.extensions = {}; showdown2.setOption = function(key, value) { "use strict"; globalOptions[key] = value; return this; }; showdown2.getOption = function(key) { "use strict"; return globalOptions[key]; }; showdown2.getOptions = function() { "use strict"; return globalOptions; }; showdown2.resetOptions = function() { "use strict"; globalOptions = getDefaultOpts(true); }; showdown2.setFlavor = function(name) { "use strict"; if (!flavor.hasOwnProperty(name)) { throw Error(name + " flavor was not found"); } showdown2.resetOptions(); var preset = flavor[name]; setFlavor = name; for (var option in preset) { if (preset.hasOwnProperty(option)) { globalOptions[option] = preset[option]; } } }; showdown2.getFlavor = function() { "use strict"; return setFlavor; }; showdown2.getFlavorOptions = function(name) { "use strict"; if (flavor.hasOwnProperty(name)) { return flavor[name]; } }; showdown2.getDefaultOptions = function(simple) { "use strict"; return getDefaultOpts(simple); }; showdown2.subParser = function(name, func) { "use strict"; if (showdown2.helper.isString(name)) { if (typeof func !== "undefined") { parsers[name] = func; } else { if (parsers.hasOwnProperty(name)) { return parsers[name]; } else { throw Error("SubParser named " + name + " not registered!"); } } } }; showdown2.extension = function(name, ext) { "use strict"; if (!showdown2.helper.isString(name)) { throw Error("Extension 'name' must be a string"); } name = showdown2.helper.stdExtName(name); if (showdown2.helper.isUndefined(ext)) { if (!extensions.hasOwnProperty(name)) { throw Error("Extension named " + name + " is not registered!"); } return extensions[name]; } else { if (typeof ext === "function") { ext = ext(); } if (!showdown2.helper.isArray(ext)) { ext = [ext]; } var validExtension = validate(ext, name); if (validExtension.valid) { extensions[name] = ext; } else { throw Error(validExtension.error); } } }; showdown2.getAllExtensions = function() { "use strict"; return extensions; }; showdown2.removeExtension = function(name) { "use strict"; delete extensions[name]; }; showdown2.resetExtensions = function() { "use strict"; extensions = {}; }; function validate(extension, name) { "use strict"; var errMsg = name ? "Error in " + name + " extension->" : "Error in unnamed extension", ret = { valid: true, error: "" }; if (!showdown2.helper.isArray(extension)) { extension = [extension]; } for (var i2 = 0; i2 < extension.length; ++i2) { var baseMsg = errMsg + " sub-extension " + i2 + ": ", ext = extension[i2]; if (typeof ext !== "object") { ret.valid = false; ret.error = baseMsg + "must be an object, but " + typeof ext + " given"; return ret; } if (!showdown2.helper.isString(ext.type)) { ret.valid = false; ret.error = baseMsg + 'property "type" must be a string, but ' + typeof ext.type + " given"; return ret; } var type = ext.type = ext.type.toLowerCase(); if (type === "language") { type = ext.type = "lang"; } if (type === "html") { type = ext.type = "output"; } if (type !== "lang" && type !== "output" && type !== "listener") { ret.valid = false; ret.error = baseMsg + "type " + type + ' is not recognized. Valid values: "lang/language", "output/html" or "listener"'; return ret; } if (type === "listener") { if (showdown2.helper.isUndefined(ext.listeners)) { ret.valid = false; ret.error = baseMsg + '. Extensions of type "listener" must have a property called "listeners"'; return ret; } } else { if (showdown2.helper.isUndefined(ext.filter) && showdown2.helper.isUndefined(ext.regex)) { ret.valid = false; ret.error = baseMsg + type + ' extensions must define either a "regex" property or a "filter" method'; return ret; } } if (ext.listeners) { if (typeof ext.listeners !== "object") { ret.valid = false; ret.error = baseMsg + '"listeners" property must be an object but ' + typeof ext.listeners + " given"; return ret; } for (var ln in ext.listeners) { if (ext.listeners.hasOwnProperty(ln)) { if (typeof ext.listeners[ln] !== "function") { ret.valid = false; ret.error = baseMsg + '"listeners" property must be an hash of [event name]: [callback]. listeners.' + ln + " must be a function but " + typeof ext.listeners[ln] + " given"; return ret; } } } } if (ext.filter) { if (typeof ext.filter !== "function") { ret.valid = false; ret.error = baseMsg + '"filter" must be a function, but ' + typeof ext.filter + " given"; return ret; } } else if (ext.regex) { if (showdown2.helper.isString(ext.regex)) { ext.regex = new RegExp(ext.regex, "g"); } if (!(ext.regex instanceof RegExp)) { ret.valid = false; ret.error = baseMsg + '"regex" property must either be a string or a RegExp object, but ' + typeof ext.regex + " given"; return ret; } if (showdown2.helper.isUndefined(ext.replace)) { ret.valid = false; ret.error = baseMsg + '"regex" extensions must implement a replace string or function'; return ret; } } } return ret; } showdown2.validateExtension = function(ext) { "use strict"; var validateExtension = validate(ext, null); if (!validateExtension.valid) { console.warn(validateExtension.error); return false; } return true; }; if (!showdown2.hasOwnProperty("helper")) { showdown2.helper = {}; } showdown2.helper.isString = function(a2) { "use strict"; return typeof a2 === "string" || a2 instanceof String; }; showdown2.helper.isFunction = function(a2) { "use strict"; var getType = {}; return a2 && getType.toString.call(a2) === "[object Function]"; }; showdown2.helper.isArray = function(a2) { "use strict"; return Array.isArray(a2); }; showdown2.helper.isUndefined = function(value) { "use strict"; return typeof value === "undefined"; }; showdown2.helper.forEach = function(obj, callback) { "use strict"; if (showdown2.helper.isUndefined(obj)) { throw new Error("obj param is required"); } if (showdown2.helper.isUndefined(callback)) { throw new Error("callback param is required"); } if (!showdown2.helper.isFunction(callback)) { throw new Error("callback param must be a function/closure"); } if (typeof obj.forEach === "function") { obj.forEach(callback); } else if (showdown2.helper.isArray(obj)) { for (var i2 = 0; i2 < obj.length; i2++) { callback(obj[i2], i2, obj); } } else if (typeof obj === "object") { for (var prop2 in obj) { if (obj.hasOwnProperty(prop2)) { callback(obj[prop2], prop2, obj); } } } else { throw new Error("obj does not seem to be an array or an iterable object"); } }; showdown2.helper.stdExtName = function(s2) { "use strict"; return s2.replace(/[_?*+\/\\.^-]/g, "").replace(/\s/g, "").toLowerCase(); }; function escapeCharactersCallback(wholeMatch, m1) { "use strict"; var charCodeToEscape = m1.charCodeAt(0); return "\xA8E" + charCodeToEscape + "E"; } showdown2.helper.escapeCharactersCallback = escapeCharactersCallback; showdown2.helper.escapeCharacters = function(text2, charsToEscape, afterBackslash) { "use strict"; var regexString = "([" + charsToEscape.replace(/([\[\]\\])/g, "\\$1") + "])"; if (afterBackslash) { regexString = "\\\\" + regexString; } var regex = new RegExp(regexString, "g"); text2 = text2.replace(regex, escapeCharactersCallback); return text2; }; showdown2.helper.unescapeHTMLEntities = function(txt) { "use strict"; return txt.replace(/"/g, '"').replace(/</g, "<").replace(/>/g, ">").replace(/&/g, "&"); }; var rgxFindMatchPos = function(str, left, right, flags) { "use strict"; var f2 = flags || "", g2 = f2.indexOf("g") > -1, x2 = new RegExp(left + "|" + right, "g" + f2.replace(/g/g, "")), l2 = new RegExp(left, f2.replace(/g/g, "")), pos = [], t3, s2, m2, start, end; do { t3 = 0; while (m2 = x2.exec(str)) { if (l2.test(m2[0])) { if (!t3++) { s2 = x2.lastIndex; start = s2 - m2[0].length; } } else if (t3) { if (!--t3) { end = m2.index + m2[0].length; var obj = { left: { start, end: s2 }, match: { start: s2, end: m2.index }, right: { start: m2.index, end }, wholeMatch: { start, end } }; pos.push(obj); if (!g2) { return pos; } } } } } while (t3 && (x2.lastIndex = s2)); return pos; }; showdown2.helper.matchRecursiveRegExp = function(str, left, right, flags) { "use strict"; var matchPos = rgxFindMatchPos(str, left, right, flags), results = []; for (var i2 = 0; i2 < matchPos.length; ++i2) { results.push([ str.slice(matchPos[i2].wholeMatch.start, matchPos[i2].wholeMatch.end), str.slice(matchPos[i2].match.start, matchPos[i2].match.end), str.slice(matchPos[i2].left.start, matchPos[i2].left.end), str.slice(matchPos[i2].right.start, matchPos[i2].right.end) ]); } return results; }; showdown2.helper.replaceRecursiveRegExp = function(str, replacement, left, right, flags) { "use strict"; if (!showdown2.helper.isFunction(replacement)) { var repStr = replacement; replacement = function() { return repStr; }; } var matchPos = rgxFindMatchPos(str, left, right, flags), finalStr = str, lng = matchPos.length; if (lng > 0) { var bits = []; if (matchPos[0].wholeMatch.start !== 0) { bits.push(str.slice(0, matchPos[0].wholeMatch.start)); } for (var i2 = 0; i2 < lng; ++i2) { bits.push( replacement( str.slice(matchPos[i2].wholeMatch.start, matchPos[i2].wholeMatch.end), str.slice(matchPos[i2].match.start, matchPos[i2].match.end), str.slice(matchPos[i2].left.start, matchPos[i2].left.end), str.slice(matchPos[i2].right.start, matchPos[i2].right.end) ) ); if (i2 < lng - 1) { bits.push(str.slice(matchPos[i2].wholeMatch.end, matchPos[i2 + 1].wholeMatch.start)); } } if (matchPos[lng - 1].wholeMatch.end < str.length) { bits.push(str.slice(matchPos[lng - 1].wholeMatch.end)); } finalStr = bits.join(""); } return finalStr; }; showdown2.helper.regexIndexOf = function(str, regex, fromIndex) { "use strict"; if (!showdown2.helper.isString(str)) { throw "InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string"; } if (regex instanceof RegExp === false) { throw "InvalidArgumentError: second parameter of showdown.helper.regexIndexOf function must be an instance of RegExp"; } var indexOf = str.substring(fromIndex || 0).search(regex); return indexOf >= 0 ? indexOf + (fromIndex || 0) : indexOf; }; showdown2.helper.splitAtIndex = function(str, index) { "use strict"; if (!showdown2.helper.isString(str)) { throw "InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string"; } return [str.substring(0, index), str.substring(index)]; }; showdown2.helper.encodeEmailAddress = function(mail) { "use strict"; var encode = [ function(ch) { return "&#" + ch.charCodeAt(0) + ";"; }, function(ch) { return "&#x" + ch.charCodeAt(0).toString(16) + ";"; }, function(ch) { return ch; } ]; mail = mail.replace(/./g, function(ch) { if (ch === "@") { ch = encode[Math.floor(Math.random() * 2)](ch); } else { var r2 = Math.random(); ch = r2 > 0.9 ? encode[2](ch) : r2 > 0.45 ? encode[1](ch) : encode[0](ch); } return ch; }); return mail; }; showdown2.helper.padEnd = function padEnd(str, targetLength, padString) { "use strict"; targetLength = targetLength >> 0; padString = String(padString || " "); if (str.length > targetLength) { return String(str); } else { targetLength = targetLength - str.length; if (targetLength > padString.length) { padString += padString.repeat(targetLength / padString.length); } return String(str) + padString.slice(0, targetLength); } }; if (typeof console === "undefined") { console = { warn: function(msg) { "use strict"; alert(msg); }, log: function(msg) { "use strict"; alert(msg); }, error: function(msg) { "use strict"; throw msg; } }; } showdown2.helper.regexes = { asteriskDashAndColon: /([*_:~])/g }; showdown2.helper.emojis = { "+1": "\u{1F44D}", "-1": "\u{1F44E}", "100": "\u{1F4AF}", "1234": "\u{1F522}", "1st_place_medal": "\u{1F947}", "2nd_place_medal": "\u{1F948}", "3rd_place_medal": "\u{1F949}", "8ball": "\u{1F3B1}", "a": "\u{1F170}\uFE0F", "ab": "\u{1F18E}", "abc": "\u{1F524}", "abcd": "\u{1F521}", "accept": "\u{1F251}", "aerial_tramway": "\u{1F6A1}", "airplane": "\u2708\uFE0F", "alarm_clock": "\u23F0", "alembic": "\u2697\uFE0F", "alien": "\u{1F47D}", "ambulance": "\u{1F691}", "amphora": "\u{1F3FA}", "anchor": "\u2693\uFE0F", "angel": "\u{1F47C}", "anger": "\u{1F4A2}", "angry": "\u{1F620}", "anguished": "\u{1F627}", "ant": "\u{1F41C}", "apple": "\u{1F34E}", "aquarius": "\u2652\uFE0F", "aries": "\u2648\uFE0F", "arrow_backward": "\u25C0\uFE0F", "arrow_double_down": "\u23EC", "arrow_double_up": "\u23EB", "arrow_down": "\u2B07\uFE0F", "arrow_down_small": "\u{1F53D}", "arrow_forward": "\u25B6\uFE0F", "arrow_heading_down": "\u2935\uFE0F", "arrow_heading_up": "\u2934\uFE0F", "arrow_left": "\u2B05\uFE0F", "arrow_lower_left": "\u2199\uFE0F", "arrow_lower_right": "\u2198\uFE0F", "arrow_right": "\u27A1\uFE0F", "arrow_right_hook": "\u21AA\uFE0F", "arrow_up": "\u2B06\uFE0F", "arrow_up_down": "\u2195\uFE0F", "arrow_up_small": "\u{1F53C}", "arrow_upper_left": "\u2196\uFE0F", "arrow_upper_right": "\u2197\uFE0F", "arrows_clockwise": "\u{1F503}", "arrows_counterclockwise": "\u{1F504}", "art": "\u{1F3A8}", "articulated_lorry": "\u{1F69B}", "artificial_satellite": "\u{1F6F0}", "astonished": "\u{1F632}", "athletic_shoe": "\u{1F45F}", "atm": "\u{1F3E7}", "atom_symbol": "\u269B\uFE0F", "avocado": "\u{1F951}", "b": "\u{1F171}\uFE0F", "baby": "\u{1F476}", "baby_bottle": "\u{1F37C}", "baby_chick": "\u{1F424}", "baby_symbol": "\u{1F6BC}", "back": "\u{1F519}", "bacon": "\u{1F953}", "badminton": "\u{1F3F8}", "baggage_claim": "\u{1F6C4}", "baguette_bread": "\u{1F956}", "balance_scale": "\u2696\uFE0F", "balloon": "\u{1F388}", "ballot_box": "\u{1F5F3}", "ballot_box_with_check": "\u2611\uFE0F", "bamboo": "\u{1F38D}", "banana": "\u{1F34C}", "bangbang": "\u203C\uFE0F", "bank": "\u{1F3E6}", "bar_chart": "\u{1F4CA}", "barber": "\u{1F488}", "baseball": "\u26BE\uFE0F", "basketball": "\u{1F3C0}", "basketball_man": "\u26F9\uFE0F", "basketball_woman": "\u26F9\uFE0F‍\u2640\uFE0F", "bat": "\u{1F987}", "bath": "\u{1F6C0}", "bathtub": "\u{1F6C1}", "battery": "\u{1F50B}", "beach_umbrella": "\u{1F3D6}", "bear": "\u{1F43B}", "bed": "\u{1F6CF}", "bee": "\u{1F41D}", "beer": "\u{1F37A}", "beers": "\u{1F37B}", "beetle": "\u{1F41E}", "beginner": "\u{1F530}", "bell": "\u{1F514}", "bellhop_bell": "\u{1F6CE}", "bento": "\u{1F371}", "biking_man": "\u{1F6B4}", "bike": "\u{1F6B2}", "biking_woman": "\u{1F6B4}‍\u2640\uFE0F", "bikini": "\u{1F459}", "biohazard": "\u2623\uFE0F", "bird": "\u{1F426}", "birthday": "\u{1F382}", "black_circle": "\u26AB\uFE0F", "black_flag": "\u{1F3F4}", "black_heart": "\u{1F5A4}", "black_joker": "\u{1F0CF}", "black_large_square": "\u2B1B\uFE0F", "black_medium_small_square": "\u25FE\uFE0F", "black_medium_square": "\u25FC\uFE0F", "black_nib": "\u2712\uFE0F", "black_small_square": "\u25AA\uFE0F", "black_square_button": "\u{1F532}", "blonde_man": "\u{1F471}", "blonde_woman": "\u{1F471}‍\u2640\uFE0F", "blossom": "\u{1F33C}", "blowfish": "\u{1F421}", "blue_book": "\u{1F4D8}", "blue_car": "\u{1F699}", "blue_heart": "\u{1F499}", "blush": "\u{1F60A}", "boar": "\u{1F417}", "boat": "\u26F5\uFE0F", "bomb": "\u{1F4A3}", "book": "\u{1F4D6}", "bookmark": "\u{1F516}", "bookmark_tabs": "\u{1F4D1}", "books": "\u{1F4DA}", "boom": "\u{1F4A5}", "boot": "\u{1F462}", "bouquet": "\u{1F490}", "bowing_man": "\u{1F647}", "bow_and_arrow": "\u{1F3F9}", "bowing_woman": "\u{1F647}‍\u2640\uFE0F", "bowling": "\u{1F3B3}", "boxing_glove": "\u{1F94A}", "boy": "\u{1F466}", "bread": "\u{1F35E}", "bride_with_veil": "\u{1F470}", "bridge_at_night": "\u{1F309}", "briefcase": "\u{1F4BC}", "broken_heart": "\u{1F494}", "bug": "\u{1F41B}", "building_construction": "\u{1F3D7}", "bulb": "\u{1F4A1}", "bullettrain_front": "\u{1F685}", "bullettrain_side": "\u{1F684}", "burrito": "\u{1F32F}", "bus": "\u{1F68C}", "business_suit_levitating": "\u{1F574}", "busstop": "\u{1F68F}", "bust_in_silhouette": "\u{1F464}", "busts_in_silhouette": "\u{1F465}", "butterfly": "\u{1F98B}", "cactus": "\u{1F335}", "cake": "\u{1F370}", "calendar": "\u{1F4C6}", "call_me_hand": "\u{1F919}", "calling": "\u{1F4F2}", "camel": "\u{1F42B}", "camera": "\u{1F4F7}", "camera_flash": "\u{1F4F8}", "camping": "\u{1F3D5}", "cancer": "\u264B\uFE0F", "candle": "\u{1F56F}", "candy": "\u{1F36C}", "canoe": "\u{1F6F6}", "capital_abcd": "\u{1F520}", "capricorn": "\u2651\uFE0F", "car": "\u{1F697}", "card_file_box": "\u{1F5C3}", "card_index": "\u{1F4C7}", "card_index_dividers": "\u{1F5C2}", "carousel_horse": "\u{1F3A0}", "carrot": "\u{1F955}", "cat": "\u{1F431}", "cat2": "\u{1F408}", "cd": "\u{1F4BF}", "chains": "\u26D3", "champagne": "\u{1F37E}", "chart": "\u{1F4B9}", "chart_with_downwards_trend": "\u{1F4C9}", "chart_with_upwards_trend": "\u{1F4C8}", "checkered_flag": "\u{1F3C1}", "cheese": "\u{1F9C0}", "cherries": "\u{1F352}", "cherry_blossom": "\u{1F338}", "chestnut": "\u{1F330}", "chicken": "\u{1F414}", "children_crossing": "\u{1F6B8}", "chipmunk": "\u{1F43F}", "chocolate_bar": "\u{1F36B}", "christmas_tree": "\u{1F384}", "church": "\u26EA\uFE0F", "cinema": "\u{1F3A6}", "circus_tent": "\u{1F3AA}", "city_sunrise": "\u{1F307}", "city_sunset": "\u{1F306}", "cityscape": "\u{1F3D9}", "cl": "\u{1F191}", "clamp": "\u{1F5DC}", "clap": "\u{1F44F}", "clapper": "\u{1F3AC}", "classical_building": "\u{1F3DB}", "clinking_glasses": "\u{1F942}", "clipboard": "\u{1F4CB}", "clock1": "\u{1F550}", "clock10": "\u{1F559}", "clock1030": "\u{1F565}", "clock11": "\u{1F55A}", "clock1130": "\u{1F566}", "clock12": "\u{1F55B}", "clock1230": "\u{1F567}", "clock130": "\u{1F55C}", "clock2": "\u{1F551}", "clock230": "\u{1F55D}", "clock3": "\u{1F552}", "clock330": "\u{1F55E}", "clock4": "\u{1F553}", "clock430": "\u{1F55F}", "clock5": "\u{1F554}", "clock530": "\u{1F560}", "clock6": "\u{1F555}", "clock630": "\u{1F561}", "clock7": "\u{1F556}", "clock730": "\u{1F562}", "clock8": "\u{1F557}", "clock830": "\u{1F563}", "clock9": "\u{1F558}", "clock930": "\u{1F564}", "closed_book": "\u{1F4D5}", "closed_lock_with_key": "\u{1F510}", "closed_umbrella": "\u{1F302}", "cloud": "\u2601\uFE0F", "cloud_with_lightning": "\u{1F329}", "cloud_with_lightning_and_rain": "\u26C8", "cloud_with_rain": "\u{1F327}", "cloud_with_snow": "\u{1F328}", "clown_face": "\u{1F921}", "clubs": "\u2663\uFE0F", "cocktail": "\u{1F378}", "coffee": "\u2615\uFE0F", "coffin": "\u26B0\uFE0F", "cold_sweat": "\u{1F630}", "comet": "\u2604\uFE0F", "computer": "\u{1F4BB}", "computer_mouse": "\u{1F5B1}", "confetti_ball": "\u{1F38A}", "confounded": "\u{1F616}", "confused": "\u{1F615}", "congratulations": "\u3297\uFE0F", "construction": "\u{1F6A7}", "construction_worker_man": "\u{1F477}", "construction_worker_woman": "\u{1F477}‍\u2640\uFE0F", "control_knobs": "\u{1F39B}", "convenience_store": "\u{1F3EA}", "cookie": "\u{1F36A}", "cool": "\u{1F192}", "policeman": "\u{1F46E}", "copyright": "\xA9\uFE0F", "corn": "\u{1F33D}", "couch_and_lamp": "\u{1F6CB}", "couple": "\u{1F46B}", "couple_with_heart_woman_man": "\u{1F491}", "couple_with_heart_man_man": "\u{1F468}‍\u2764\uFE0F‍\u{1F468}", "couple_with_heart_woman_woman": "\u{1F469}‍\u2764\uFE0F‍\u{1F469}", "couplekiss_man_man": "\u{1F468}‍\u2764\uFE0F‍\u{1F48B}‍\u{1F468}", "couplekiss_man_woman": "\u{1F48F}", "couplekiss_woman_woman": "\u{1F469}‍\u2764\uFE0F‍\u{1F48B}‍\u{1F469}", "cow": "\u{1F42E}", "cow2": "\u{1F404}", "cowboy_hat_face": "\u{1F920}", "crab": "\u{1F980}", "crayon": "\u{1F58D}", "credit_card": "\u{1F4B3}", "crescent_moon": "\u{1F319}", "cricket": "\u{1F3CF}", "crocodile": "\u{1F40A}", "croissant": "\u{1F950}", "crossed_fingers": "\u{1F91E}", "crossed_flags": "\u{1F38C}", "crossed_swords": "\u2694\uFE0F", "crown": "\u{1F451}", "cry": "\u{1F622}", "crying_cat_face": "\u{1F63F}", "crystal_ball": "\u{1F52E}", "cucumber": "\u{1F952}", "cupid": "\u{1F498}", "curly_loop": "\u27B0", "currency_exchange": "\u{1F4B1}", "curry": "\u{1F35B}", "custard": "\u{1F36E}", "customs": "\u{1F6C3}", "cyclone": "\u{1F300}", "dagger": "\u{1F5E1}", "dancer": "\u{1F483}", "dancing_women": "\u{1F46F}", "dancing_men": "\u{1F46F}‍\u2642\uFE0F", "dango": "\u{1F361}", "dark_sunglasses": "\u{1F576}", "dart": "\u{1F3AF}", "dash": "\u{1F4A8}", "date": "\u{1F4C5}", "deciduous_tree": "\u{1F333}", "deer": "\u{1F98C}", "department_store": "\u{1F3EC}", "derelict_house": "\u{1F3DA}", "desert": "\u{1F3DC}", "desert_island": "\u{1F3DD}", "desktop_computer": "\u{1F5A5}", "male_detective": "\u{1F575}\uFE0F", "diamond_shape_with_a_dot_inside": "\u{1F4A0}", "diamonds": "\u2666\uFE0F", "disappointed": "\u{1F61E}", "disappointed_relieved": "\u{1F625}", "dizzy": "\u{1F4AB}", "dizzy_face": "\u{1F635}", "do_not_litter": "\u{1F6AF}", "dog": "\u{1F436}", "dog2": "\u{1F415}", "dollar": "\u{1F4B5}", "dolls": "\u{1F38E}", "dolphin": "\u{1F42C}", "door": "\u{1F6AA}", "doughnut": "\u{1F369}", "dove": "\u{1F54A}", "dragon": "\u{1F409}", "dragon_face": "\u{1F432}", "dress": "\u{1F457}", "dromedary_camel": "\u{1F42A}", "drooling_face": "\u{1F924}", "droplet": "\u{1F4A7}", "drum": "\u{1F941}", "duck": "\u{1F986}", "dvd": "\u{1F4C0}", "e-mail": "\u{1F4E7}", "eagle": "\u{1F985}", "ear": "\u{1F442}", "ear_of_rice": "\u{1F33E}", "earth_africa": "\u{1F30D}", "earth_americas": "\u{1F30E}", "earth_asia": "\u{1F30F}", "egg": "\u{1F95A}", "eggplant": "\u{1F346}", "eight_pointed_black_star": "\u2734\uFE0F", "eight_spoked_asterisk": "\u2733\uFE0F", "electric_plug": "\u{1F50C}", "elephant": "\u{1F418}", "email": "\u2709\uFE0F", "end": "\u{1F51A}", "envelope_with_arrow": "\u{1F4E9}", "euro": "\u{1F4B6}", "european_castle": "\u{1F3F0}", "european_post_office": "\u{1F3E4}", "evergreen_tree": "\u{1F332}", "exclamation": "\u2757\uFE0F", "expressionless": "\u{1F611}", "eye": "\u{1F441}", "eye_speech_bubble": "\u{1F441}‍\u{1F5E8}", "eyeglasses": "\u{1F453}", "eyes": "\u{1F440}", "face_with_head_bandage": "\u{1F915}", "face_with_thermometer": "\u{1F912}", "fist_oncoming": "\u{1F44A}", "factory": "\u{1F3ED}", "fallen_leaf": "\u{1F342}", "family_man_woman_boy": "\u{1F46A}", "family_man_boy": "\u{1F468}‍\u{1F466}", "family_man_boy_boy": "\u{1F468}‍\u{1F466}‍\u{1F466}", "family_man_girl": "\u{1F468}‍\u{1F467}", "family_man_girl_boy": "\u{1F468}‍\u{1F467}‍\u{1F466}", "family_man_girl_girl": "\u{1F468}‍\u{1F467}‍\u{1F467}", "family_man_man_boy": "\u{1F468}‍\u{1F468}‍\u{1F466}", "family_man_man_boy_boy": "\u{1F468}‍\u{1F468}‍\u{1F466}‍\u{1F466}", "family_man_man_girl": "\u{1F468}‍\u{1F468}‍\u{1F467}", "family_man_man_girl_boy": "\u{1F468}‍\u{1F468}‍\u{1F467}‍\u{1F466}", "family_man_man_girl_girl": "\u{1F468}‍\u{1F468}‍\u{1F467}‍\u{1F467}", "family_man_woman_boy_boy": "\u{1F468}‍\u{1F469}‍\u{1F466}‍\u{1F466}", "family_man_woman_girl": "\u{1F468}‍\u{1F469}‍\u{1F467}", "family_man_woman_girl_boy": "\u{1F468}‍\u{1F469}‍\u{1F467}‍\u{1F466}", "family_man_woman_girl_girl": "\u{1F468}‍\u{1F469}‍\u{1F467}‍\u{1F467}", "family_woman_boy": "\u{1F469}‍\u{1F466}", "family_woman_boy_boy": "\u{1F469}‍\u{1F466}‍\u{1F466}", "family_woman_girl": "\u{1F469}‍\u{1F467}", "family_woman_girl_boy": "\u{1F469}‍\u{1F467}‍\u{1F466}", "family_woman_girl_girl": "\u{1F469}‍\u{1F467}‍\u{1F467}", "family_woman_woman_boy": "\u{1F469}‍\u{1F469}‍\u{1F466}", "family_woman_woman_boy_boy": "\u{1F469}‍\u{1F469}‍\u{1F466}‍\u{1F466}", "family_woman_woman_girl": "\u{1F469}‍\u{1F469}‍\u{1F467}", "family_woman_woman_girl_boy": "\u{1F469}‍\u{1F469}‍\u{1F467}‍\u{1F466}", "family_woman_woman_girl_girl": "\u{1F469}‍\u{1F469}‍\u{1F467}‍\u{1F467}", "fast_forward": "\u23E9", "fax": "\u{1F4E0}", "fearful": "\u{1F628}", "feet": "\u{1F43E}", "female_detective": "\u{1F575}\uFE0F‍\u2640\uFE0F", "ferris_wheel": "\u{1F3A1}", "ferry": "\u26F4", "field_hockey": "\u{1F3D1}", "file_cabinet": "\u{1F5C4}", "file_folder": "\u{1F4C1}", "film_projector": "\u{1F4FD}", "film_strip": "\u{1F39E}", "fire": "\u{1F525}", "fire_engine": "\u{1F692}", "fireworks": "\u{1F386}", "first_quarter_moon": "\u{1F313}", "first_quarter_moon_with_face": "\u{1F31B}", "fish": "\u{1F41F}", "fish_cake": "\u{1F365}", "fishing_pole_and_fish": "\u{1F3A3}", "fist_raised": "\u270A", "fist_left": "\u{1F91B}", "fist_right": "\u{1F91C}", "flags": "\u{1F38F}", "flashlight": "\u{1F526}", "fleur_de_lis": "\u269C\uFE0F", "flight_arrival": "\u{1F6EC}", "flight_departure": "\u{1F6EB}", "floppy_disk": "\u{1F4BE}", "flower_playing_cards": "\u{1F3B4}", "flushed": "\u{1F633}", "fog": "\u{1F32B}", "foggy": "\u{1F301}", "football": "\u{1F3C8}", "footprints": "\u{1F463}", "fork_and_knife": "\u{1F374}", "fountain": "\u26F2\uFE0F", "fountain_pen": "\u{1F58B}", "four_leaf_clover": "\u{1F340}", "fox_face": "\u{1F98A}", "framed_picture": "\u{1F5BC}", "free": "\u{1F193}", "fried_egg": "\u{1F373}", "fried_shrimp": "\u{1F364}", "fries": "\u{1F35F}", "frog": "\u{1F438}", "frowning": "\u{1F626}", "frowning_face": "\u2639\uFE0F", "frowning_man": "\u{1F64D}‍\u2642\uFE0F", "frowning_woman": "\u{1F64D}", "middle_finger": "\u{1F595}", "fuelpump": "\u26FD\uFE0F", "full_moon": "\u{1F315}", "full_moon_with_face": "\u{1F31D}", "funeral_urn": "\u26B1\uFE0F", "game_die": "\u{1F3B2}", "gear": "\u2699\uFE0F", "gem": "\u{1F48E}", "gemini": "\u264A\uFE0F", "ghost": "\u{1F47B}", "gift": "\u{1F381}", "gift_heart": "\u{1F49D}", "girl": "\u{1F467}", "globe_with_meridians": "\u{1F310}", "goal_net": "\u{1F945}", "goat": "\u{1F410}", "golf": "\u26F3\uFE0F", "golfing_man": "\u{1F3CC}\uFE0F", "golfing_woman": "\u{1F3CC}\uFE0F‍\u2640\uFE0F", "gorilla": "\u{1F98D}", "grapes": "\u{1F347}", "green_apple": "\u{1F34F}", "green_book": "\u{1F4D7}", "green_heart": "\u{1F49A}", "green_salad": "\u{1F957}", "grey_exclamation": "\u2755", "grey_question": "\u2754", "grimacing": "\u{1F62C}", "grin": "\u{1F601}", "grinning": "\u{1F600}", "guardsman": "\u{1F482}", "guardswoman": "\u{1F482}‍\u2640\uFE0F", "guitar": "\u{1F3B8}", "gun": "\u{1F52B}", "haircut_woman": "\u{1F487}", "haircut_man": "\u{1F487}‍\u2642\uFE0F", "hamburger": "\u{1F354}", "hammer": "\u{1F528}", "hammer_and_pick": "\u2692", "hammer_and_wrench": "\u{1F6E0}", "hamster": "\u{1F439}", "hand": "\u270B", "handbag": "\u{1F45C}", "handshake": "\u{1F91D}", "hankey": "\u{1F4A9}", "hatched_chick": "\u{1F425}", "hatching_chick": "\u{1F423}", "headphones": "\u{1F3A7}", "hear_no_evil": "\u{1F649}", "heart": "\u2764\uFE0F", "heart_decoration": "\u{1F49F}", "heart_eyes": "\u{1F60D}", "heart_eyes_cat": "\u{1F63B}", "heartbeat": "\u{1F493}", "heartpulse": "\u{1F497}", "hearts": "\u2665\uFE0F", "heavy_check_mark": "\u2714\uFE0F", "heavy_division_sign": "\u2797", "heavy_dollar_sign": "\u{1F4B2}", "heavy_heart_exclamation": "\u2763\uFE0F", "heavy_minus_sign": "\u2796", "heavy_multiplication_x": "\u2716\uFE0F", "heavy_plus_sign": "\u2795", "helicopter": "\u{1F681}", "herb": "\u{1F33F}", "hibiscus": "\u{1F33A}", "high_brightness": "\u{1F506}", "high_heel": "\u{1F460}", "hocho": "\u{1F52A}", "hole": "\u{1F573}", "honey_pot": "\u{1F36F}", "horse": "\u{1F434}", "horse_racing": "\u{1F3C7}", "hospital": "\u{1F3E5}", "hot_pepper": "\u{1F336}", "hotdog": "\u{1F32D}", "hotel": "\u{1F3E8}", "hotsprings": "\u2668\uFE0F", "hourglass": "\u231B\uFE0F", "hourglass_flowing_sand": "\u23F3", "house": "\u{1F3E0}", "house_with_garden": "\u{1F3E1}", "houses": "\u{1F3D8}", "hugs": "\u{1F917}", "hushed": "\u{1F62F}", "ice_cream": "\u{1F368}", "ice_hockey": "\u{1F3D2}", "ice_skate": "\u26F8", "icecream": "\u{1F366}", "id": "\u{1F194}", "ideograph_advantage": "\u{1F250}", "imp": "\u{1F47F}", "inbox_tray": "\u{1F4E5}", "incoming_envelope": "\u{1F4E8}", "tipping_hand_woman": "\u{1F481}", "information_source": "\u2139\uFE0F", "innocent": "\u{1F607}", "interrobang": "\u2049\uFE0F", "iphone": "\u{1F4F1}", "izakaya_lantern": "\u{1F3EE}", "jack_o_lantern": "\u{1F383}", "japan": "\u{1F5FE}", "japanese_castle": "\u{1F3EF}", "japanese_goblin": "\u{1F47A}", "japanese_ogre": "\u{1F479}", "jeans": "\u{1F456}", "joy": "\u{1F602}", "joy_cat": "\u{1F639}", "joystick": "\u{1F579}", "kaaba": "\u{1F54B}", "key": "\u{1F511}", "keyboard": "\u2328\uFE0F", "keycap_ten": "\u{1F51F}", "kick_scooter": "\u{1F6F4}", "kimono": "\u{1F458}", "kiss": "\u{1F48B}", "kissing": "\u{1F617}", "kissing_cat": "\u{1F63D}", "kissing_closed_eyes": "\u{1F61A}", "kissing_heart": "\u{1F618}", "kissing_smiling_eyes": "\u{1F619}", "kiwi_fruit": "\u{1F95D}", "koala": "\u{1F428}", "koko": "\u{1F201}", "label": "\u{1F3F7}", "large_blue_circle": "\u{1F535}", "large_blue_diamond": "\u{1F537}", "large_orange_diamond": "\u{1F536}", "last_quarter_moon": "\u{1F317}", "last_quarter_moon_with_face": "\u{1F31C}", "latin_cross": "\u271D\uFE0F", "laughing": "\u{1F606}", "leaves": "\u{1F343}", "ledger": "\u{1F4D2}", "left_luggage": "\u{1F6C5}", "left_right_arrow": "\u2194\uFE0F", "leftwards_arrow_with_hook": "\u21A9\uFE0F", "lemon": "\u{1F34B}", "leo": "\u264C\uFE0F", "leopard": "\u{1F406}", "level_slider": "\u{1F39A}", "libra": "\u264E\uFE0F", "light_rail": "\u{1F688}", "link": "\u{1F517}", "lion": "\u{1F981}", "lips": "\u{1F444}", "lipstick": "\u{1F484}", "lizard": "\u{1F98E}", "lock": "\u{1F512}", "lock_with_ink_pen": "\u{1F50F}", "lollipop": "\u{1F36D}", "loop": "\u27BF", "loud_sound": "\u{1F50A}", "loudspeaker": "\u{1F4E2}", "love_hotel": "\u{1F3E9}", "love_letter": "\u{1F48C}", "low_brightness": "\u{1F505}", "lying_face": "\u{1F925}", "m": "\u24C2\uFE0F", "mag": "\u{1F50D}", "mag_right": "\u{1F50E}", "mahjong": "\u{1F004}\uFE0F", "mailbox": "\u{1F4EB}", "mailbox_closed": "\u{1F4EA}", "mailbox_with_mail": "\u{1F4EC}", "mailbox_with_no_mail": "\u{1F4ED}", "man": "\u{1F468}", "man_artist": "\u{1F468}‍\u{1F3A8}", "man_astronaut": "\u{1F468}‍\u{1F680}", "man_cartwheeling": "\u{1F938}‍\u2642\uFE0F", "man_cook": "\u{1F468}‍\u{1F373}", "man_dancing": "\u{1F57A}", "man_facepalming": "\u{1F926}‍\u2642\uFE0F", "man_factory_worker": "\u{1F468}‍\u{1F3ED}", "man_farmer": "\u{1F468}‍\u{1F33E}", "man_firefighter": "\u{1F468}‍\u{1F692}", "man_health_worker": "\u{1F468}‍\u2695\uFE0F", "man_in_tuxedo": "\u{1F935}", "man_judge": "\u{1F468}‍\u2696\uFE0F", "man_juggling": "\u{1F939}‍\u2642\uFE0F", "man_mechanic": "\u{1F468}‍\u{1F527}", "man_office_worker": "\u{1F468}‍\u{1F4BC}", "man_pilot": "\u{1F468}‍\u2708\uFE0F", "man_playing_handball": "\u{1F93E}‍\u2642\uFE0F", "man_playing_water_polo": "\u{1F93D}‍\u2642\uFE0F", "man_scientist": "\u{1F468}‍\u{1F52C}", "man_shrugging": "\u{1F937}‍\u2642\uFE0F", "man_singer": "\u{1F468}‍\u{1F3A4}", "man_student": "\u{1F468}‍\u{1F393}", "man_teacher": "\u{1F468}‍\u{1F3EB}", "man_technologist": "\u{1F468}‍\u{1F4BB}", "man_with_gua_pi_mao": "\u{1F472}", "man_with_turban": "\u{1F473}", "tangerine": "\u{1F34A}", "mans_shoe": "\u{1F45E}", "mantelpiece_clock": "\u{1F570}", "maple_leaf": "\u{1F341}", "martial_arts_uniform": "\u{1F94B}", "mask": "\u{1F637}", "massage_woman": "\u{1F486}", "massage_man": "\u{1F486}‍\u2642\uFE0F", "meat_on_bone": "\u{1F356}", "medal_military": "\u{1F396}", "medal_sports": "\u{1F3C5}", "mega": "\u{1F4E3}", "melon": "\u{1F348}", "memo": "\u{1F4DD}", "men_wrestling": "\u{1F93C}‍\u2642\uFE0F", "menorah": "\u{1F54E}", "mens": "\u{1F6B9}", "metal": "\u{1F918}", "metro": "\u{1F687}", "microphone": "\u{1F3A4}", "microscope": "\u{1F52C}", "milk_glass": "\u{1F95B}", "milky_way": "\u{1F30C}", "minibus": "\u{1F690}", "minidisc": "\u{1F4BD}", "mobile_phone_off": "\u{1F4F4}", "money_mouth_face": "\u{1F911}", "money_with_wings": "\u{1F4B8}", "moneybag": "\u{1F4B0}", "monkey": "\u{1F412}", "monkey_face": "\u{1F435}", "monorail": "\u{1F69D}", "moon": "\u{1F314}", "mortar_board": "\u{1F393}", "mosque": "\u{1F54C}", "motor_boat": "\u{1F6E5}", "motor_scooter": "\u{1F6F5}", "motorcycle": "\u{1F3CD}", "motorway": "\u{1F6E3}", "mount_fuji": "\u{1F5FB}", "mountain": "\u26F0", "mountain_biking_man": "\u{1F6B5}", "mountain_biking_woman": "\u{1F6B5}‍\u2640\uFE0F", "mountain_cableway": "\u{1F6A0}", "mountain_railway": "\u{1F69E}", "mountain_snow": "\u{1F3D4}", "mouse": "\u{1F42D}", "mouse2": "\u{1F401}", "movie_camera": "\u{1F3A5}", "moyai": "\u{1F5FF}", "mrs_claus": "\u{1F936}", "muscle": "\u{1F4AA}", "mushroom": "\u{1F344}", "musical_keyboard": "\u{1F3B9}", "musical_note": "\u{1F3B5}", "musical_score": "\u{1F3BC}", "mute": "\u{1F507}", "nail_care": "\u{1F485}", "name_badge": "\u{1F4DB}", "national_park": "\u{1F3DE}", "nauseated_face": "\u{1F922}", "necktie": "\u{1F454}", "negative_squared_cross_mark": "\u274E", "nerd_face": "\u{1F913}", "neutral_face": "\u{1F610}", "new": "\u{1F195}", "new_moon": "\u{1F311}", "new_moon_with_face": "\u{1F31A}", "newspaper": "\u{1F4F0}", "newspaper_roll": "\u{1F5DE}", "next_track_button": "\u23ED", "ng": "\u{1F196}", "no_good_man": "\u{1F645}‍\u2642\uFE0F", "no_good_woman": "\u{1F645}", "night_with_stars": "\u{1F303}", "no_bell": "\u{1F515}", "no_bicycles": "\u{1F6B3}", "no_entry": "\u26D4\uFE0F", "no_entry_sign": "\u{1F6AB}", "no_mobile_phones": "\u{1F4F5}", "no_mouth": "\u{1F636}", "no_pedestrians": "\u{1F6B7}", "no_smoking": "\u{1F6AD}", "non-potable_water": "\u{1F6B1}", "nose": "\u{1F443}", "notebook": "\u{1F4D3}", "notebook_with_decorative_cover": "\u{1F4D4}", "notes": "\u{1F3B6}", "nut_and_bolt": "\u{1F529}", "o": "\u2B55\uFE0F", "o2": "\u{1F17E}\uFE0F", "ocean": "\u{1F30A}", "octopus": "\u{1F419}", "oden": "\u{1F362}", "office": "\u{1F3E2}", "oil_drum": "\u{1F6E2}", "ok": "\u{1F197}", "ok_hand": "\u{1F44C}", "ok_man": "\u{1F646}‍\u2642\uFE0F", "ok_woman": "\u{1F646}", "old_key": "\u{1F5DD}", "older_man": "\u{1F474}", "older_woman": "\u{1F475}", "om": "\u{1F549}", "on": "\u{1F51B}", "oncoming_automobile": "\u{1F698}", "oncoming_bus": "\u{1F68D}", "oncoming_police_car": "\u{1F694}", "oncoming_taxi": "\u{1F696}", "open_file_folder": "\u{1F4C2}", "open_hands": "\u{1F450}", "open_mouth": "\u{1F62E}", "open_umbrella": "\u2602\uFE0F", "ophiuchus": "\u26CE", "orange_book": "\u{1F4D9}", "orthodox_cross": "\u2626\uFE0F", "outbox_tray": "\u{1F4E4}", "owl": "\u{1F989}", "ox": "\u{1F402}", "package": "\u{1F4E6}", "page_facing_up": "\u{1F4C4}", "page_with_curl": "\u{1F4C3}", "pager": "\u{1F4DF}", "paintbrush": "\u{1F58C}", "palm_tree": "\u{1F334}", "pancakes": "\u{1F95E}", "panda_face": "\u{1F43C}", "paperclip": "\u{1F4CE}", "paperclips": "\u{1F587}", "parasol_on_ground": "\u26F1", "parking": "\u{1F17F}\uFE0F", "part_alternation_mark": "\u303D\uFE0F", "partly_sunny": "\u26C5\uFE0F", "passenger_ship": "\u{1F6F3}", "passport_control": "\u{1F6C2}", "pause_button": "\u23F8", "peace_symbol": "\u262E\uFE0F", "peach": "\u{1F351}", "peanuts": "\u{1F95C}", "pear": "\u{1F350}", "pen": "\u{1F58A}", "pencil2": "\u270F\uFE0F", "penguin": "\u{1F427}", "pensive": "\u{1F614}", "performing_arts": "\u{1F3AD}", "persevere": "\u{1F623}", "person_fencing": "\u{1F93A}", "pouting_woman": "\u{1F64E}", "phone": "\u260E\uFE0F", "pick": "\u26CF", "pig": "\u{1F437}", "pig2": "\u{1F416}", "pig_nose": "\u{1F43D}", "pill": "\u{1F48A}", "pineapple": "\u{1F34D}", "ping_pong": "\u{1F3D3}", "pisces": "\u2653\uFE0F", "pizza": "\u{1F355}", "place_of_worship": "\u{1F6D0}", "plate_with_cutlery": "\u{1F37D}", "play_or_pause_button": "\u23EF", "point_down": "\u{1F447}", "point_left": "\u{1F448}", "point_right": "\u{1F449}", "point_up": "\u261D\uFE0F", "point_up_2": "\u{1F446}", "police_car": "\u{1F693}", "policewoman": "\u{1F46E}‍\u2640\uFE0F", "poodle": "\u{1F429}", "popcorn": "\u{1F37F}", "post_office": "\u{1F3E3}", "postal_horn": "\u{1F4EF}", "postbox": "\u{1F4EE}", "potable_water": "\u{1F6B0}", "potato": "\u{1F954}", "pouch": "\u{1F45D}", "poultry_leg": "\u{1F357}", "pound": "\u{1F4B7}", "rage": "\u{1F621}", "pouting_cat": "\u{1F63E}", "pouting_man": "\u{1F64E}‍\u2642\uFE0F", "pray": "\u{1F64F}", "prayer_beads": "\u{1F4FF}", "pregnant_woman": "\u{1F930}", "previous_track_button": "\u23EE", "prince": "\u{1F934}", "princess": "\u{1F478}", "printer": "\u{1F5A8}", "purple_heart": "\u{1F49C}", "purse": "\u{1F45B}", "pushpin": "\u{1F4CC}", "put_litter_in_its_place": "\u{1F6AE}", "question": "\u2753", "rabbit": "\u{1F430}", "rabbit2": "\u{1F407}", "racehorse": "\u{1F40E}", "racing_car": "\u{1F3CE}", "radio": "\u{1F4FB}", "radio_button": "\u{1F518}", "radioactive": "\u2622\uFE0F", "railway_car": "\u{1F683}", "railway_track": "\u{1F6E4}", "rainbow": "\u{1F308}", "rainbow_flag": "\u{1F3F3}\uFE0F‍\u{1F308}", "raised_back_of_hand": "\u{1F91A}", "raised_hand_with_fingers_splayed": "\u{1F590}", "raised_hands": "\u{1F64C}", "raising_hand_woman": "\u{1F64B}", "raising_hand_man": "\u{1F64B}‍\u2642\uFE0F", "ram": "\u{1F40F}", "ramen": "\u{1F35C}", "rat": "\u{1F400}", "record_button": "\u23FA", "recycle": "\u267B\uFE0F", "red_circle": "\u{1F534}", "registered": "\xAE\uFE0F", "relaxed": "\u263A\uFE0F", "relieved": "\u{1F60C}", "reminder_ribbon": "\u{1F397}", "repeat": "\u{1F501}", "repeat_one": "\u{1F502}", "rescue_worker_helmet": "\u26D1", "restroom": "\u{1F6BB}", "revolving_hearts": "\u{1F49E}", "rewind": "\u23EA", "rhinoceros": "\u{1F98F}", "ribbon": "\u{1F380}", "rice": "\u{1F35A}", "rice_ball": "\u{1F359}", "rice_cracker": "\u{1F358}", "rice_scene": "\u{1F391}", "right_anger_bubble": "\u{1F5EF}", "ring": "\u{1F48D}", "robot": "\u{1F916}", "rocket": "\u{1F680}", "rofl": "\u{1F923}", "roll_eyes": "\u{1F644}", "roller_coaster": "\u{1F3A2}", "rooster": "\u{1F413}", "rose": "\u{1F339}", "rosette": "\u{1F3F5}", "rotating_light": "\u{1F6A8}", "round_pushpin": "\u{1F4CD}", "rowing_man": "\u{1F6A3}", "rowing_woman": "\u{1F6A3}‍\u2640\uFE0F", "rugby_football": "\u{1F3C9}", "running_man": "\u{1F3C3}", "running_shirt_with_sash": "\u{1F3BD}", "running_woman": "\u{1F3C3}‍\u2640\uFE0F", "sa": "\u{1F202}\uFE0F", "sagittarius": "\u2650\uFE0F", "sake": "\u{1F376}", "sandal": "\u{1F461}", "santa": "\u{1F385}", "satellite": "\u{1F4E1}", "saxophone": "\u{1F3B7}", "school": "\u{1F3EB}", "school_satchel": "\u{1F392}", "scissors": "\u2702\uFE0F", "scorpion": "\u{1F982}", "scorpius": "\u264F\uFE0F", "scream": "\u{1F631}", "scream_cat": "\u{1F640}", "scroll": "\u{1F4DC}", "seat": "\u{1F4BA}", "secret": "\u3299\uFE0F", "see_no_evil": "\u{1F648}", "seedling": "\u{1F331}", "selfie": "\u{1F933}", "shallow_pan_of_food": "\u{1F958}", "shamrock": "\u2618\uFE0F", "shark": "\u{1F988}", "shaved_ice": "\u{1F367}", "sheep": "\u{1F411}", "shell": "\u{1F41A}", "shield": "\u{1F6E1}", "shinto_shrine": "\u26E9", "ship": "\u{1F6A2}", "shirt": "\u{1F455}", "shopping": "\u{1F6CD}", "shopping_cart": "\u{1F6D2}", "shower": "\u{1F6BF}", "shrimp": "\u{1F990}", "signal_strength": "\u{1F4F6}", "six_pointed_star": "\u{1F52F}", "ski": "\u{1F3BF}", "skier": "\u26F7", "skull": "\u{1F480}", "skull_and_crossbones": "\u2620\uFE0F", "sleeping": "\u{1F634}", "sleeping_bed": "\u{1F6CC}", "sleepy": "\u{1F62A}", "slightly_frowning_face": "\u{1F641}", "slightly_smiling_face": "\u{1F642}", "slot_machine": "\u{1F3B0}", "small_airplane": "\u{1F6E9}", "small_blue_diamond": "\u{1F539}", "small_orange_diamond": "\u{1F538}", "small_red_triangle": "\u{1F53A}", "small_red_triangle_down": "\u{1F53B}", "smile": "\u{1F604}", "smile_cat": "\u{1F638}", "smiley": "\u{1F603}", "smiley_cat": "\u{1F63A}", "smiling_imp": "\u{1F608}", "smirk": "\u{1F60F}", "smirk_cat": "\u{1F63C}", "smoking": "\u{1F6AC}", "snail": "\u{1F40C}", "snake": "\u{1F40D}", "sneezing_face": "\u{1F927}", "snowboarder": "\u{1F3C2}", "snowflake": "\u2744\uFE0F", "snowman": "\u26C4\uFE0F", "snowman_with_snow": "\u2603\uFE0F", "sob": "\u{1F62D}", "soccer": "\u26BD\uFE0F", "soon": "\u{1F51C}", "sos": "\u{1F198}", "sound": "\u{1F509}", "space_invader": "\u{1F47E}", "spades": "\u2660\uFE0F", "spaghetti": "\u{1F35D}", "sparkle": "\u2747\uFE0F", "sparkler": "\u{1F387}", "sparkles": "\u2728", "sparkling_heart": "\u{1F496}", "speak_no_evil": "\u{1F64A}", "speaker": "\u{1F508}", "speaking_head": "\u{1F5E3}", "speech_balloon": "\u{1F4AC}", "speedboat": "\u{1F6A4}", "spider": "\u{1F577}", "spider_web": "\u{1F578}", "spiral_calendar": "\u{1F5D3}", "spiral_notepad": "\u{1F5D2}", "spoon": "\u{1F944}", "squid": "\u{1F991}", "stadium": "\u{1F3DF}", "star": "\u2B50\uFE0F", "star2": "\u{1F31F}", "star_and_crescent": "\u262A\uFE0F", "star_of_david": "\u2721\uFE0F", "stars": "\u{1F320}", "station": "\u{1F689}", "statue_of_liberty": "\u{1F5FD}", "steam_locomotive": "\u{1F682}", "stew": "\u{1F372}", "stop_button": "\u23F9", "stop_sign": "\u{1F6D1}", "stopwatch": "\u23F1", "straight_ruler": "\u{1F4CF}", "strawberry": "\u{1F353}", "stuck_out_tongue": "\u{1F61B}", "stuck_out_tongue_closed_eyes": "\u{1F61D}", "stuck_out_tongue_winking_eye": "\u{1F61C}", "studio_microphone": "\u{1F399}", "stuffed_flatbread": "\u{1F959}", "sun_behind_large_cloud": "\u{1F325}", "sun_behind_rain_cloud": "\u{1F326}", "sun_behind_small_cloud": "\u{1F324}", "sun_with_face": "\u{1F31E}", "sunflower": "\u{1F33B}", "sunglasses": "\u{1F60E}", "sunny": "\u2600\uFE0F", "sunrise": "\u{1F305}", "sunrise_over_mountains": "\u{1F304}", "surfing_man": "\u{1F3C4}", "surfing_woman": "\u{1F3C4}‍\u2640\uFE0F", "sushi": "\u{1F363}", "suspension_railway": "\u{1F69F}", "sweat": "\u{1F613}", "sweat_drops": "\u{1F4A6}", "sweat_smile": "\u{1F605}", "sweet_potato": "\u{1F360}", "swimming_man": "\u{1F3CA}", "swimming_woman": "\u{1F3CA}‍\u2640\uFE0F", "symbols": "\u{1F523}", "synagogue": "\u{1F54D}", "syringe": "\u{1F489}", "taco": "\u{1F32E}", "tada": "\u{1F389}", "tanabata_tree": "\u{1F38B}", "taurus": "\u2649\uFE0F", "taxi": "\u{1F695}", "tea": "\u{1F375}", "telephone_receiver": "\u{1F4DE}", "telescope": "\u{1F52D}", "tennis": "\u{1F3BE}", "tent": "\u26FA\uFE0F", "thermometer": "\u{1F321}", "thinking": "\u{1F914}", "thought_balloon": "\u{1F4AD}", "ticket": "\u{1F3AB}", "tickets": "\u{1F39F}", "tiger": "\u{1F42F}", "tiger2": "\u{1F405}", "timer_clock": "\u23F2", "tipping_hand_man": "\u{1F481}‍\u2642\uFE0F", "tired_face": "\u{1F62B}", "tm": "\u2122\uFE0F", "toilet": "\u{1F6BD}", "tokyo_tower": "\u{1F5FC}", "tomato": "\u{1F345}", "tongue": "\u{1F445}", "top": "\u{1F51D}", "tophat": "\u{1F3A9}", "tornado": "\u{1F32A}", "trackball": "\u{1F5B2}", "tractor": "\u{1F69C}", "traffic_light": "\u{1F6A5}", "train": "\u{1F68B}", "train2": "\u{1F686}", "tram": "\u{1F68A}", "triangular_flag_on_post": "\u{1F6A9}", "triangular_ruler": "\u{1F4D0}", "trident": "\u{1F531}", "triumph": "\u{1F624}", "trolleybus": "\u{1F68E}", "trophy": "\u{1F3C6}", "tropical_drink": "\u{1F379}", "tropical_fish": "\u{1F420}", "truck": "\u{1F69A}", "trumpet": "\u{1F3BA}", "tulip": "\u{1F337}", "tumbler_glass": "\u{1F943}", "turkey": "\u{1F983}", "turtle": "\u{1F422}", "tv": "\u{1F4FA}", "twisted_rightwards_arrows": "\u{1F500}", "two_hearts": "\u{1F495}", "two_men_holding_hands": "\u{1F46C}", "two_women_holding_hands": "\u{1F46D}", "u5272": "\u{1F239}", "u5408": "\u{1F234}", "u55b6": "\u{1F23A}", "u6307": "\u{1F22F}\uFE0F", "u6708": "\u{1F237}\uFE0F", "u6709": "\u{1F236}", "u6e80": "\u{1F235}", "u7121": "\u{1F21A}\uFE0F", "u7533": "\u{1F238}", "u7981": "\u{1F232}", "u7a7a": "\u{1F233}", "umbrella": "\u2614\uFE0F", "unamused": "\u{1F612}", "underage": "\u{1F51E}", "unicorn": "\u{1F984}", "unlock": "\u{1F513}", "up": "\u{1F199}", "upside_down_face": "\u{1F643}", "v": "\u270C\uFE0F", "vertical_traffic_light": "\u{1F6A6}", "vhs": "\u{1F4FC}", "vibration_mode": "\u{1F4F3}", "video_camera": "\u{1F4F9}", "video_game": "\u{1F3AE}", "violin": "\u{1F3BB}", "virgo": "\u264D\uFE0F", "volcano": "\u{1F30B}", "volleyball": "\u{1F3D0}", "vs": "\u{1F19A}", "vulcan_salute": "\u{1F596}", "walking_man": "\u{1F6B6}", "walking_woman": "\u{1F6B6}‍\u2640\uFE0F", "waning_crescent_moon": "\u{1F318}", "waning_gibbous_moon": "\u{1F316}", "warning": "\u26A0\uFE0F", "wastebasket": "\u{1F5D1}", "watch": "\u231A\uFE0F", "water_buffalo": "\u{1F403}", "watermelon": "\u{1F349}", "wave": "\u{1F44B}", "wavy_dash": "\u3030\uFE0F", "waxing_crescent_moon": "\u{1F312}", "wc": "\u{1F6BE}", "weary": "\u{1F629}", "wedding": "\u{1F492}", "weight_lifting_man": "\u{1F3CB}\uFE0F", "weight_lifting_woman": "\u{1F3CB}\uFE0F‍\u2640\uFE0F", "whale": "\u{1F433}", "whale2": "\u{1F40B}", "wheel_of_dharma": "\u2638\uFE0F", "wheelchair": "\u267F\uFE0F", "white_check_mark": "\u2705", "white_circle": "\u26AA\uFE0F", "white_flag": "\u{1F3F3}\uFE0F", "white_flower": "\u{1F4AE}", "white_large_square": "\u2B1C\uFE0F", "white_medium_small_square": "\u25FD\uFE0F", "white_medium_square": "\u25FB\uFE0F", "white_small_square": "\u25AB\uFE0F", "white_square_button": "\u{1F533}", "wilted_flower": "\u{1F940}", "wind_chime": "\u{1F390}", "wind_face": "\u{1F32C}", "wine_glass": "\u{1F377}", "wink": "\u{1F609}", "wolf": "\u{1F43A}", "woman": "\u{1F469}", "woman_artist": "\u{1F469}‍\u{1F3A8}", "woman_astronaut": "\u{1F469}‍\u{1F680}", "woman_cartwheeling": "\u{1F938}‍\u2640\uFE0F", "woman_cook": "\u{1F469}‍\u{1F373}", "woman_facepalming": "\u{1F926}‍\u2640\uFE0F", "woman_factory_worker": "\u{1F469}‍\u{1F3ED}", "woman_farmer": "\u{1F469}‍\u{1F33E}", "woman_firefighter": "\u{1F469}‍\u{1F692}", "woman_health_worker": "\u{1F469}‍\u2695\uFE0F", "woman_judge": "\u{1F469}‍\u2696\uFE0F", "woman_juggling": "\u{1F939}‍\u2640\uFE0F", "woman_mechanic": "\u{1F469}‍\u{1F527}", "woman_office_worker": "\u{1F469}‍\u{1F4BC}", "woman_pilot": "\u{1F469}‍\u2708\uFE0F", "woman_playing_handball": "\u{1F93E}‍\u2640\uFE0F", "woman_playing_water_polo": "\u{1F93D}‍\u2640\uFE0F", "woman_scientist": "\u{1F469}‍\u{1F52C}", "woman_shrugging": "\u{1F937}‍\u2640\uFE0F", "woman_singer": "\u{1F469}‍\u{1F3A4}", "woman_student": "\u{1F469}‍\u{1F393}", "woman_teacher": "\u{1F469}‍\u{1F3EB}", "woman_technologist": "\u{1F469}‍\u{1F4BB}", "woman_with_turban": "\u{1F473}‍\u2640\uFE0F", "womans_clothes": "\u{1F45A}", "womans_hat": "\u{1F452}", "women_wrestling": "\u{1F93C}‍\u2640\uFE0F", "womens": "\u{1F6BA}", "world_map": "\u{1F5FA}", "worried": "\u{1F61F}", "wrench": "\u{1F527}", "writing_hand": "\u270D\uFE0F", "x": "\u274C", "yellow_heart": "\u{1F49B}", "yen": "\u{1F4B4}", "yin_yang": "\u262F\uFE0F", "yum": "\u{1F60B}", "zap": "\u26A1\uFE0F", "zipper_mouth_face": "\u{1F910}", "zzz": "\u{1F4A4}", /* special emojis :P */ "octocat": '<img alt=":octocat:" height="20" width="20" align="absmiddle" src="https://assets-cdn.github.com/images/icons/emoji/octocat.png">', "showdown": `<span style="font-family: 'Anonymous Pro', monospace; text-decoration: underline; text-decoration-style: dashed; text-decoration-color: #3e8b8a;text-underline-position: under;">S</span>` }; showdown2.Converter = function(converterOptions) { "use strict"; var options = {}, langExtensions = [], outputModifiers = [], listeners = {}, setConvFlavor = setFlavor, metadata = { parsed: {}, raw: "", format: "" }; _constructor(); function _constructor() { converterOptions = converterOptions || {}; for (var gOpt in globalOptions) { if (globalOptions.hasOwnProperty(gOpt)) { options[gOpt] = globalOptions[gOpt]; } } if (typeof converterOptions === "object") { for (var opt in converterOptions) { if (converterOptions.hasOwnProperty(opt)) { options[opt] = converterOptions[opt]; } } } else { throw Error("Converter expects the passed parameter to be an object, but " + typeof converterOptions + " was passed instead."); } if (options.extensions) { showdown2.helper.forEach(options.extensions, _parseExtension); } } function _parseExtension(ext, name) { name = name || null; if (showdown2.helper.isString(ext)) { ext = showdown2.helper.stdExtName(ext); name = ext; if (showdown2.extensions[ext]) { console.warn("DEPRECATION WARNING: " + ext + " is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!"); legacyExtensionLoading(showdown2.extensions[ext], ext); return; } else if (!showdown2.helper.isUndefined(extensions[ext])) { ext = extensions[ext]; } else { throw Error('Extension "' + ext + '" could not be loaded. It was either not found or is not a valid extension.'); } } if (typeof ext === "function") { ext = ext(); } if (!showdown2.helper.isArray(ext)) { ext = [ext]; } var validExt = validate(ext, name); if (!validExt.valid) { throw Error(validExt.error); } for (var i2 = 0; i2 < ext.length; ++i2) { switch (ext[i2].type) { case "lang": langExtensions.push(ext[i2]); break; case "output": outputModifiers.push(ext[i2]); break; } if (ext[i2].hasOwnProperty("listeners")) { for (var ln in ext[i2].listeners) { if (ext[i2].listeners.hasOwnProperty(ln)) { listen(ln, ext[i2].listeners[ln]); } } } } } function legacyExtensionLoading(ext, name) { if (typeof ext === "function") { ext = ext(new showdown2.Converter()); } if (!showdown2.helper.isArray(ext)) { ext = [ext]; } var valid = validate(ext, name); if (!valid.valid) { throw Error(valid.error); } for (var i2 = 0; i2 < ext.length; ++i2) { switch (ext[i2].type) { case "lang": langExtensions.push(ext[i2]); break; case "output": outputModifiers.push(ext[i2]); break; default: throw Error("Extension loader error: Type unrecognized!!!"); } } } function listen(name, callback) { if (!showdown2.helper.isString(name)) { throw Error("Invalid argument in converter.listen() method: name must be a string, but " + typeof name + " given"); } if (typeof callback !== "function") { throw Error("Invalid argument in converter.listen() method: callback must be a function, but " + typeof callback + " given"); } if (!listeners.hasOwnProperty(name)) { listeners[name] = []; } listeners[name].push(callback); } function rTrimInputText(text2) { var rsp = text2.match(/^\s*/)[0].length, rgx = new RegExp("^\\s{0," + rsp + "}", "gm"); return text2.replace(rgx, ""); } this._dispatch = function dispatch3(evtName, text2, options2, globals) { if (listeners.hasOwnProperty(evtName)) { for (var ei = 0; ei < listeners[evtName].length; ++ei) { var nText = listeners[evtName][ei](evtName, text2, this, options2, globals); if (nText && typeof nText !== "undefined") { text2 = nText; } } } return text2; }; this.listen = function(name, callback) { listen(name, callback); return this; }; this.makeHtml = function(text2) { if (!text2) { return text2; } var globals = { gHtmlBlocks: [], gHtmlMdBlocks: [], gHtmlSpans: [], gUrls: {}, gTitles: {}, gDimensions: {}, gListLevel: 0, hashLinkCounts: {}, langExtensions, outputModifiers, converter: this, ghCodeBlocks: [], metadata: { parsed: {}, raw: "", format: "" } }; text2 = text2.replace(/¨/g, "\xA8T"); text2 = text2.replace(/\$/g, "\xA8D"); text2 = text2.replace(/\r\n/g, "\n"); text2 = text2.replace(/\r/g, "\n"); text2 = text2.replace(/\u00A0/g, " "); if (options.smartIndentationFix) { text2 = rTrimInputText(text2); } text2 = "\n\n" + text2 + "\n\n"; text2 = showdown2.subParser("detab")(text2, options, globals); text2 = text2.replace(/^[ \t]+$/mg, ""); showdown2.helper.forEach(langExtensions, function(ext) { text2 = showdown2.subParser("runExtension")(ext, text2, options, globals); }); text2 = showdown2.subParser("metadata")(text2, options, globals); text2 = showdown2.subParser("hashPreCodeTags")(text2, options, globals); text2 = showdown2.subParser("githubCodeBlocks")(text2, options, globals); text2 = showdown2.subParser("hashHTMLBlocks")(text2, options, globals); text2 = showdown2.subParser("hashCodeTags")(text2, options, globals); text2 = showdown2.subParser("stripLinkDefinitions")(text2, options, globals); text2 = showdown2.subParser("blockGamut")(text2, options, globals); text2 = showdown2.subParser("unhashHTMLSpans")(text2, options, globals); text2 = showdown2.subParser("unescapeSpecialChars")(text2, options, globals); text2 = text2.replace(/¨D/g, "$$"); text2 = text2.replace(/¨T/g, "\xA8"); text2 = showdown2.subParser("completeHTMLDocument")(text2, options, globals); showdown2.helper.forEach(outputModifiers, function(ext) { text2 = showdown2.subParser("runExtension")(ext, text2, options, globals); }); metadata = globals.metadata; return text2; }; this.makeMarkdown = this.makeMd = function(src, HTMLParser) { src = src.replace(/\r\n/g, "\n"); src = src.replace(/\r/g, "\n"); src = src.replace(/>[ \t]+</, ">\xA8NBSP;<"); if (!HTMLParser) { if (window && window.document) { HTMLParser = window.document; } else { throw new Error("HTMLParser is undefined. If in a webworker or nodejs environment, you need to provide a WHATWG DOM and HTML such as JSDOM"); } } var doc = HTMLParser.createElement("div"); doc.innerHTML = src; var globals = { preList: substitutePreCodeTags(doc) }; clean(doc); var nodes = doc.childNodes, mdDoc = ""; for (var i2 = 0; i2 < nodes.length; i2++) { mdDoc += showdown2.subParser("makeMarkdown.node")(nodes[i2], globals); } function clean(node) { for (var n2 = 0; n2 < node.childNodes.length; ++n2) { var child = node.childNodes[n2]; if (child.nodeType === 3) { if (!/\S/.test(child.nodeValue)) { node.removeChild(child); --n2; } else { child.nodeValue = child.nodeValue.split("\n").join(" "); child.nodeValue = child.nodeValue.replace(/(\s)+/g, "$1"); } } else if (child.nodeType === 1) { clean(child); } } } function substitutePreCodeTags(doc2) { var pres = doc2.querySelectorAll("pre"), presPH = []; for (var i3 = 0; i3 < pres.length; ++i3) { if (pres[i3].childElementCount === 1 && pres[i3].firstChild.tagName.toLowerCase() === "code") { var content = pres[i3].firstChild.innerHTML.trim(), language = pres[i3].firstChild.getAttribute("data-language") || ""; if (language === "") { var classes = pres[i3].firstChild.className.split(" "); for (var c2 = 0; c2 < classes.length; ++c2) { var matches = classes[c2].match(/^language-(.+)$/); if (matches !== null) { language = matches[1]; break; } } } content = showdown2.helper.unescapeHTMLEntities(content); presPH.push(content); pres[i3].outerHTML = '<precode language="' + language + '" precodenum="' + i3.toString() + '"></precode>'; } else { presPH.push(pres[i3].innerHTML); pres[i3].innerHTML = ""; pres[i3].setAttribute("prenum", i3.toString()); } } return presPH; } return mdDoc; }; this.setOption = function(key, value) { options[key] = value; }; this.getOption = function(key) { return options[key]; }; this.getOptions = function() { return options; }; this.addExtension = function(extension, name) { name = name || null; _parseExtension(extension, name); }; this.useExtension = function(extensionName) { _parseExtension(extensionName); }; this.setFlavor = function(name) { if (!flavor.hasOwnProperty(name)) { throw Error(name + " flavor was not found"); } var preset = flavor[name]; setConvFlavor = name; for (var option in preset) { if (preset.hasOwnProperty(option)) { options[option] = preset[option]; } } }; this.getFlavor = function() { return setConvFlavor; }; this.removeExtension = function(extension) { if (!showdown2.helper.isArray(extension)) { extension = [extension]; } for (var a2 = 0; a2 < extension.length; ++a2) { var ext = extension[a2]; for (var i2 = 0; i2 < langExtensions.length; ++i2) { if (langExtensions[i2] === ext) { langExtensions[i2].splice(i2, 1); } } for (var ii = 0; ii < outputModifiers.length; ++i2) { if (outputModifiers[ii] === ext) { outputModifiers[ii].splice(i2, 1); } } } }; this.getAllExtensions = function() { return { language: langExtensions, output: outputModifiers }; }; this.getMetadata = function(raw) { if (raw) { return metadata.raw; } else { return metadata.parsed; } }; this.getMetadataFormat = function() { return metadata.format; }; this._setMetadataPair = function(key, value) { metadata.parsed[key] = value; }; this._setMetadataFormat = function(format) { metadata.format = format; }; this._setMetadataRaw = function(raw) { metadata.raw = raw; }; }; showdown2.subParser("anchors", function(text2, options, globals) { "use strict"; text2 = globals.converter._dispatch("anchors.before", text2, options, globals); var writeAnchorTag = function(wholeMatch, linkText, linkId, url, m5, m6, title) { if (showdown2.helper.isUndefined(title)) { title = ""; } linkId = linkId.toLowerCase(); if (wholeMatch.search(/\(<?\s*>? ?(['"].*['"])?\)$/m) > -1) { url = ""; } else if (!url) { if (!linkId) { linkId = linkText.toLowerCase().replace(/ ?\n/g, " "); } url = "#" + linkId; if (!showdown2.helper.isUndefined(globals.gUrls[linkId])) { url = globals.gUrls[linkId]; if (!showdown2.helper.isUndefined(globals.gTitles[linkId])) { title = globals.gTitles[linkId]; } } else { return wholeMatch; } } url = url.replace(showdown2.helper.regexes.asteriskDashAndColon, showdown2.helper.escapeCharactersCallback); var result = '<a href="' + url + '"'; if (title !== "" && title !== null) { title = title.replace(/"/g, """); title = title.replace(showdown2.helper.regexes.asteriskDashAndColon, showdown2.helper.escapeCharactersCallback); result += ' title="' + title + '"'; } if (options.openLinksInNewWindow && !/^#/.test(url)) { result += ' rel="noopener noreferrer" target="\xA8E95Eblank"'; } result += ">" + linkText + "</a>"; return result; }; text2 = text2.replace(/\[((?:\[[^\]]*]|[^\[\]])*)] ?(?:\n *)?\[(.*?)]()()()()/g, writeAnchorTag); text2 = text2.replace( /\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<([^>]*)>(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g, writeAnchorTag ); text2 = text2.replace( /\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g, writeAnchorTag ); text2 = text2.replace(/\[([^\[\]]+)]()()()()()/g, writeAnchorTag); if (options.ghMentions) { text2 = text2.replace(/(^|\s)(\\)?(@([a-z\d]+(?:[a-z\d.-]+?[a-z\d]+)*))/gmi, function(wm, st, escape, mentions, username) { if (escape === "\\") { return st + mentions; } if (!showdown2.helper.isString(options.ghMentionsLink)) { throw new Error("ghMentionsLink option must be a string"); } var lnk = options.ghMentionsLink.replace(/\{u}/g, username), target = ""; if (options.openLinksInNewWindow) { target = ' rel="noopener noreferrer" target="\xA8E95Eblank"'; } return st + '<a href="' + lnk + '"' + target + ">" + mentions + "</a>"; }); } text2 = globals.converter._dispatch("anchors.after", text2, options, globals); return text2; }); var simpleURLRegex = /([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+?\.[^'">\s]+?)()(\1)?(?=\s|$)(?!["<>])/gi, simpleURLRegex2 = /([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+?)([.!?,()\[\]])?(\1)?(?=\s|$)(?!["<>])/gi, delimUrlRegex = /()<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)()>()/gi, simpleMailRegex = /(^|\s)(?:mailto:)?([A-Za-z0-9!#$%&'*+-/=?^_`{|}~.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?=$|\s)/gmi, delimMailRegex = /<()(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi, replaceLink = function(options) { "use strict"; return function(wm, leadingMagicChars, link, m2, m3, trailingPunctuation, trailingMagicChars) { link = link.replace(showdown2.helper.regexes.asteriskDashAndColon, showdown2.helper.escapeCharactersCallback); var lnkTxt = link, append = "", target = "", lmc = leadingMagicChars || "", tmc = trailingMagicChars || ""; if (/^www\./i.test(link)) { link = link.replace(/^www\./i, "http://www."); } if (options.excludeTrailingPunctuationFromURLs && trailingPunctuation) { append = trailingPunctuation; } if (options.openLinksInNewWindow) { target = ' rel="noopener noreferrer" target="\xA8E95Eblank"'; } return lmc + '<a href="' + link + '"' + target + ">" + lnkTxt + "</a>" + append + tmc; }; }, replaceMail = function(options, globals) { "use strict"; return function(wholeMatch, b2, mail) { var href = "mailto:"; b2 = b2 || ""; mail = showdown2.subParser("unescapeSpecialChars")(mail, options, globals); if (options.encodeEmails) { href = showdown2.helper.encodeEmailAddress(href + mail); mail = showdown2.helper.encodeEmailAddress(mail); } else { href = href + mail; } return b2 + '<a href="' + href + '">' + mail + "</a>"; }; }; showdown2.subParser("autoLinks", function(text2, options, globals) { "use strict"; text2 = globals.converter._dispatch("autoLinks.before", text2, options, globals); text2 = text2.replace(delimUrlRegex, replaceLink(options)); text2 = text2.replace(delimMailRegex, replaceMail(options, globals)); text2 = globals.converter._dispatch("autoLinks.after", text2, options, globals); return text2; }); showdown2.subParser("simplifiedAutoLinks", function(text2, options, globals) { "use strict"; if (!options.simplifiedAutoLink) { return text2; } text2 = globals.converter._dispatch("simplifiedAutoLinks.before", text2, options, globals); if (options.excludeTrailingPunctuationFromURLs) { text2 = text2.replace(simpleURLRegex2, replaceLink(options)); } else { text2 = text2.replace(simpleURLRegex, replaceLink(options)); } text2 = text2.replace(simpleMailRegex, replaceMail(options, globals)); text2 = globals.converter._dispatch("simplifiedAutoLinks.after", text2, options, globals); return text2; }); showdown2.subParser("blockGamut", function(text2, options, globals) { "use strict"; text2 = globals.converter._dispatch("blockGamut.before", text2, options, globals); text2 = showdown2.subParser("blockQuotes")(text2, options, globals); text2 = showdown2.subParser("headers")(text2, options, globals); text2 = showdown2.subParser("horizontalRule")(text2, options, globals); text2 = showdown2.subParser("lists")(text2, options, globals); text2 = showdown2.subParser("codeBlocks")(text2, options, globals); text2 = showdown2.subParser("tables")(text2, options, globals); text2 = showdown2.subParser("hashHTMLBlocks")(text2, options, globals); text2 = showdown2.subParser("paragraphs")(text2, options, globals); text2 = globals.converter._dispatch("blockGamut.after", text2, options, globals); return text2; }); showdown2.subParser("blockQuotes", function(text2, options, globals) { "use strict"; text2 = globals.converter._dispatch("blockQuotes.before", text2, options, globals); text2 = text2 + "\n\n"; var rgx = /(^ {0,3}>[ \t]?.+\n(.+\n)*\n*)+/gm; if (options.splitAdjacentBlockquotes) { rgx = /^ {0,3}>[\s\S]*?(?:\n\n)/gm; } text2 = text2.replace(rgx, function(bq) { bq = bq.replace(/^[ \t]*>[ \t]?/gm, ""); bq = bq.replace(/¨0/g, ""); bq = bq.replace(/^[ \t]+$/gm, ""); bq = showdown2.subParser("githubCodeBlocks")(bq, options, globals); bq = showdown2.subParser("blockGamut")(bq, options, globals); bq = bq.replace(/(^|\n)/g, "$1 "); bq = bq.replace(/(\s*<pre>[^\r]+?<\/pre>)/gm, function(wholeMatch, m1) { var pre = m1; pre = pre.replace(/^ /mg, "\xA80"); pre = pre.replace(/¨0/g, ""); return pre; }); return showdown2.subParser("hashBlock")("<blockquote>\n" + bq + "\n</blockquote>", options, globals); }); text2 = globals.converter._dispatch("blockQuotes.after", text2, options, globals); return text2; }); showdown2.subParser("codeBlocks", function(text2, options, globals) { "use strict"; text2 = globals.converter._dispatch("codeBlocks.before", text2, options, globals); text2 += "\xA80"; var pattern = /(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=¨0))/g; text2 = text2.replace(pattern, function(wholeMatch, m1, m2) { var codeblock = m1, nextChar = m2, end = "\n"; codeblock = showdown2.subParser("outdent")(codeblock, options, globals); codeblock = showdown2.subParser("encodeCode")(codeblock, options, globals); codeblock = showdown2.subParser("detab")(codeblock, options, globals); codeblock = codeblock.replace(/^\n+/g, ""); codeblock = codeblock.replace(/\n+$/g, ""); if (options.omitExtraWLInCodeBlocks) { end = ""; } codeblock = "<pre><code>" + codeblock + end + "</code></pre>"; return showdown2.subParser("hashBlock")(codeblock, options, globals) + nextChar; }); text2 = text2.replace(/¨0/, ""); text2 = globals.converter._dispatch("codeBlocks.after", text2, options, globals); return text2; }); showdown2.subParser("codeSpans", function(text2, options, globals) { "use strict"; text2 = globals.converter._dispatch("codeSpans.before", text2, options, globals); if (typeof text2 === "undefined") { text2 = ""; } text2 = text2.replace( /(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm, function(wholeMatch, m1, m2, m3) { var c2 = m3; c2 = c2.replace(/^([ \t]*)/g, ""); c2 = c2.replace(/[ \t]*$/g, ""); c2 = showdown2.subParser("encodeCode")(c2, options, globals); c2 = m1 + "<code>" + c2 + "</code>"; c2 = showdown2.subParser("hashHTMLSpans")(c2, options, globals); return c2; } ); text2 = globals.converter._dispatch("codeSpans.after", text2, options, globals); return text2; }); showdown2.subParser("completeHTMLDocument", function(text2, options, globals) { "use strict"; if (!options.completeHTMLDocument) { return text2; } text2 = globals.converter._dispatch("completeHTMLDocument.before", text2, options, globals); var doctype = "html", doctypeParsed = "<!DOCTYPE HTML>\n", title = "", charset = '<meta charset="utf-8">\n', lang = "", metadata = ""; if (typeof globals.metadata.parsed.doctype !== "undefined") { doctypeParsed = "<!DOCTYPE " + globals.metadata.parsed.doctype + ">\n"; doctype = globals.metadata.parsed.doctype.toString().toLowerCase(); if (doctype === "html" || doctype === "html5") { charset = '<meta charset="utf-8">'; } } for (var meta in globals.metadata.parsed) { if (globals.metadata.parsed.hasOwnProperty(meta)) { switch (meta.toLowerCase()) { case "doctype": break; case "title": title = "<title>" + globals.metadata.parsed.title + "</title>\n"; break; case "charset": if (doctype === "html" || doctype === "html5") { charset = '<meta charset="' + globals.metadata.parsed.charset + '">\n'; } else { charset = '<meta name="charset" content="' + globals.metadata.parsed.charset + '">\n'; } break; case "language": case "lang": lang = ' lang="' + globals.metadata.parsed[meta] + '"'; metadata += '<meta name="' + meta + '" content="' + globals.metadata.parsed[meta] + '">\n'; break; default: metadata += '<meta name="' + meta + '" content="' + globals.metadata.parsed[meta] + '">\n'; } } } text2 = doctypeParsed + "<html" + lang + ">\n<head>\n" + title + charset + metadata + "</head>\n<body>\n" + text2.trim() + "\n</body>\n</html>"; text2 = globals.converter._dispatch("completeHTMLDocument.after", text2, options, globals); return text2; }); showdown2.subParser("detab", function(text2, options, globals) { "use strict"; text2 = globals.converter._dispatch("detab.before", text2, options, globals); text2 = text2.replace(/\t(?=\t)/g, " "); text2 = text2.replace(/\t/g, "\xA8A\xA8B"); text2 = text2.replace(/¨B(.+?)¨A/g, function(wholeMatch, m1) { var leadingText = m1, numSpaces = 4 - leadingText.length % 4; for (var i2 = 0; i2 < numSpaces; i2++) { leadingText += " "; } return leadingText; }); text2 = text2.replace(/¨A/g, " "); text2 = text2.replace(/¨B/g, ""); text2 = globals.converter._dispatch("detab.after", text2, options, globals); return text2; }); showdown2.subParser("ellipsis", function(text2, options, globals) { "use strict"; text2 = globals.converter._dispatch("ellipsis.before", text2, options, globals); text2 = text2.replace(/\.\.\./g, "\u2026"); text2 = globals.converter._dispatch("ellipsis.after", text2, options, globals); return text2; }); showdown2.subParser("emoji", function(text2, options, globals) { "use strict"; if (!options.emoji) { return text2; } text2 = globals.converter._dispatch("emoji.before", text2, options, globals); var emojiRgx = /:([\S]+?):/g; text2 = text2.replace(emojiRgx, function(wm, emojiCode) { if (showdown2.helper.emojis.hasOwnProperty(emojiCode)) { return showdown2.helper.emojis[emojiCode]; } return wm; }); text2 = globals.converter._dispatch("emoji.after", text2, options, globals); return text2; }); showdown2.subParser("encodeAmpsAndAngles", function(text2, options, globals) { "use strict"; text2 = globals.converter._dispatch("encodeAmpsAndAngles.before", text2, options, globals); text2 = text2.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g, "&"); text2 = text2.replace(/<(?![a-z\/?$!])/gi, "<"); text2 = text2.replace(/</g, "<"); text2 = text2.replace(/>/g, ">"); text2 = globals.converter._dispatch("encodeAmpsAndAngles.after", text2, options, globals); return text2; }); showdown2.subParser("encodeBackslashEscapes", function(text2, options, globals) { "use strict"; text2 = globals.converter._dispatch("encodeBackslashEscapes.before", text2, options, globals); text2 = text2.replace(/\\(\\)/g, showdown2.helper.escapeCharactersCallback); text2 = text2.replace(/\\([`*_{}\[\]()>#+.!~=|-])/g, showdown2.helper.escapeCharactersCallback); text2 = globals.converter._dispatch("encodeBackslashEscapes.after", text2, options, globals); return text2; }); showdown2.subParser("encodeCode", function(text2, options, globals) { "use strict"; text2 = globals.converter._dispatch("encodeCode.before", text2, options, globals); text2 = text2.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/([*_{}\[\]\\=~-])/g, showdown2.helper.escapeCharactersCallback); text2 = globals.converter._dispatch("encodeCode.after", text2, options, globals); return text2; }); showdown2.subParser("escapeSpecialCharsWithinTagAttributes", function(text2, options, globals) { "use strict"; text2 = globals.converter._dispatch("escapeSpecialCharsWithinTagAttributes.before", text2, options, globals); var tags = /<\/?[a-z\d_:-]+(?:[\s]+[\s\S]+?)?>/gi, comments = /<!(--(?:(?:[^>-]|-[^>])(?:[^-]|-[^-])*)--)>/gi; text2 = text2.replace(tags, function(wholeMatch) { return wholeMatch.replace(/(.)<\/?code>(?=.)/g, "$1`").replace(/([\\`*_~=|])/g, showdown2.helper.escapeCharactersCallback); }); text2 = text2.replace(comments, function(wholeMatch) { return wholeMatch.replace(/([\\`*_~=|])/g, showdown2.helper.escapeCharactersCallback); }); text2 = globals.converter._dispatch("escapeSpecialCharsWithinTagAttributes.after", text2, options, globals); return text2; }); showdown2.subParser("githubCodeBlocks", function(text2, options, globals) { "use strict"; if (!options.ghCodeBlocks) { return text2; } text2 = globals.converter._dispatch("githubCodeBlocks.before", text2, options, globals); text2 += "\xA80"; text2 = text2.replace(/(?:^|\n)(?: {0,3})(```+|~~~+)(?: *)([^\s`~]*)\n([\s\S]*?)\n(?: {0,3})\1/g, function(wholeMatch, delim, language, codeblock) { var end = options.omitExtraWLInCodeBlocks ? "" : "\n"; codeblock = showdown2.subParser("encodeCode")(codeblock, options, globals); codeblock = showdown2.subParser("detab")(codeblock, options, globals); codeblock = codeblock.replace(/^\n+/g, ""); codeblock = codeblock.replace(/\n+$/g, ""); codeblock = "<pre><code" + (language ? ' class="' + language + " language-" + language + '"' : "") + ">" + codeblock + end + "</code></pre>"; codeblock = showdown2.subParser("hashBlock")(codeblock, options, globals); return "\n\n\xA8G" + (globals.ghCodeBlocks.push({ text: wholeMatch, codeblock }) - 1) + "G\n\n"; }); text2 = text2.replace(/¨0/, ""); return globals.converter._dispatch("githubCodeBlocks.after", text2, options, globals); }); showdown2.subParser("hashBlock", function(text2, options, globals) { "use strict"; text2 = globals.converter._dispatch("hashBlock.before", text2, options, globals); text2 = text2.replace(/(^\n+|\n+$)/g, ""); text2 = "\n\n\xA8K" + (globals.gHtmlBlocks.push(text2) - 1) + "K\n\n"; text2 = globals.converter._dispatch("hashBlock.after", text2, options, globals); return text2; }); showdown2.subParser("hashCodeTags", function(text2, options, globals) { "use strict"; text2 = globals.converter._dispatch("hashCodeTags.before", text2, options, globals); var repFunc = function(wholeMatch, match, left, right) { var codeblock = left + showdown2.subParser("encodeCode")(match, options, globals) + right; return "\xA8C" + (globals.gHtmlSpans.push(codeblock) - 1) + "C"; }; text2 = showdown2.helper.replaceRecursiveRegExp(text2, repFunc, "<code\\b[^>]*>", "</code>", "gim"); text2 = globals.converter._dispatch("hashCodeTags.after", text2, options, globals); return text2; }); showdown2.subParser("hashElement", function(text2, options, globals) { "use strict"; return function(wholeMatch, m1) { var blockText = m1; blockText = blockText.replace(/\n\n/g, "\n"); blockText = blockText.replace(/^\n/, ""); blockText = blockText.replace(/\n+$/g, ""); blockText = "\n\n\xA8K" + (globals.gHtmlBlocks.push(blockText) - 1) + "K\n\n"; return blockText; }; }); showdown2.subParser("hashHTMLBlocks", function(text2, options, globals) { "use strict"; text2 = globals.converter._dispatch("hashHTMLBlocks.before", text2, options, globals); var blockTags = [ "pre", "div", "h1", "h2", "h3", "h4", "h5", "h6", "blockquote", "table", "dl", "ol", "ul", "script", "noscript", "form", "fieldset", "iframe", "math", "style", "section", "header", "footer", "nav", "article", "aside", "address", "audio", "canvas", "figure", "hgroup", "output", "video", "p" ], repFunc = function(wholeMatch, match, left, right) { var txt = wholeMatch; if (left.search(/\bmarkdown\b/) !== -1) { txt = left + globals.converter.makeHtml(match) + right; } return "\n\n\xA8K" + (globals.gHtmlBlocks.push(txt) - 1) + "K\n\n"; }; if (options.backslashEscapesHTMLTags) { text2 = text2.replace(/\\<(\/?[^>]+?)>/g, function(wm, inside) { return "<" + inside + ">"; }); } for (var i2 = 0; i2 < blockTags.length; ++i2) { var opTagPos, rgx1 = new RegExp("^ {0,3}(<" + blockTags[i2] + "\\b[^>]*>)", "im"), patLeft = "<" + blockTags[i2] + "\\b[^>]*>", patRight = "</" + blockTags[i2] + ">"; while ((opTagPos = showdown2.helper.regexIndexOf(text2, rgx1)) !== -1) { var subTexts = showdown2.helper.splitAtIndex(text2, opTagPos), newSubText1 = showdown2.helper.replaceRecursiveRegExp(subTexts[1], repFunc, patLeft, patRight, "im"); if (newSubText1 === subTexts[1]) { break; } text2 = subTexts[0].concat(newSubText1); } } text2 = text2.replace( /(\n {0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g, showdown2.subParser("hashElement")(text2, options, globals) ); text2 = showdown2.helper.replaceRecursiveRegExp(text2, function(txt) { return "\n\n\xA8K" + (globals.gHtmlBlocks.push(txt) - 1) + "K\n\n"; }, "^ {0,3}<!--", "-->", "gm"); text2 = text2.replace( /(?:\n\n)( {0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g, showdown2.subParser("hashElement")(text2, options, globals) ); text2 = globals.converter._dispatch("hashHTMLBlocks.after", text2, options, globals); return text2; }); showdown2.subParser("hashHTMLSpans", function(text2, options, globals) { "use strict"; text2 = globals.converter._dispatch("hashHTMLSpans.before", text2, options, globals); function hashHTMLSpan(html2) { return "\xA8C" + (globals.gHtmlSpans.push(html2) - 1) + "C"; } text2 = text2.replace(/<[^>]+?\/>/gi, function(wm) { return hashHTMLSpan(wm); }); text2 = text2.replace(/<([^>]+?)>[\s\S]*?<\/\1>/g, function(wm) { return hashHTMLSpan(wm); }); text2 = text2.replace(/<([^>]+?)\s[^>]+?>[\s\S]*?<\/\1>/g, function(wm) { return hashHTMLSpan(wm); }); text2 = text2.replace(/<[^>]+?>/gi, function(wm) { return hashHTMLSpan(wm); }); text2 = globals.converter._dispatch("hashHTMLSpans.after", text2, options, globals); return text2; }); showdown2.subParser("unhashHTMLSpans", function(text2, options, globals) { "use strict"; text2 = globals.converter._dispatch("unhashHTMLSpans.before", text2, options, globals); for (var i2 = 0; i2 < globals.gHtmlSpans.length; ++i2) { var repText = globals.gHtmlSpans[i2], limit = 0; while (/¨C(\d+)C/.test(repText)) { var num = RegExp.$1; repText = repText.replace("\xA8C" + num + "C", globals.gHtmlSpans[num]); if (limit === 10) { console.error("maximum nesting of 10 spans reached!!!"); break; } ++limit; } text2 = text2.replace("\xA8C" + i2 + "C", repText); } text2 = globals.converter._dispatch("unhashHTMLSpans.after", text2, options, globals); return text2; }); showdown2.subParser("hashPreCodeTags", function(text2, options, globals) { "use strict"; text2 = globals.converter._dispatch("hashPreCodeTags.before", text2, options, globals); var repFunc = function(wholeMatch, match, left, right) { var codeblock = left + showdown2.subParser("encodeCode")(match, options, globals) + right; return "\n\n\xA8G" + (globals.ghCodeBlocks.push({ text: wholeMatch, codeblock }) - 1) + "G\n\n"; }; text2 = showdown2.helper.replaceRecursiveRegExp(text2, repFunc, "^ {0,3}<pre\\b[^>]*>\\s*<code\\b[^>]*>", "^ {0,3}</code>\\s*</pre>", "gim"); text2 = globals.converter._dispatch("hashPreCodeTags.after", text2, options, globals); return text2; }); showdown2.subParser("headers", function(text2, options, globals) { "use strict"; text2 = globals.converter._dispatch("headers.before", text2, options, globals); var headerLevelStart = isNaN(parseInt(options.headerLevelStart)) ? 1 : parseInt(options.headerLevelStart), setextRegexH1 = options.smoothLivePreview ? /^(.+)[ \t]*\n={2,}[ \t]*\n+/gm : /^(.+)[ \t]*\n=+[ \t]*\n+/gm, setextRegexH2 = options.smoothLivePreview ? /^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm : /^(.+)[ \t]*\n-+[ \t]*\n+/gm; text2 = text2.replace(setextRegexH1, function(wholeMatch, m1) { var spanGamut = showdown2.subParser("spanGamut")(m1, options, globals), hID = options.noHeaderId ? "" : ' id="' + headerId(m1) + '"', hLevel = headerLevelStart, hashBlock = "<h" + hLevel + hID + ">" + spanGamut + "</h" + hLevel + ">"; return showdown2.subParser("hashBlock")(hashBlock, options, globals); }); text2 = text2.replace(setextRegexH2, function(matchFound, m1) { var spanGamut = showdown2.subParser("spanGamut")(m1, options, globals), hID = options.noHeaderId ? "" : ' id="' + headerId(m1) + '"', hLevel = headerLevelStart + 1, hashBlock = "<h" + hLevel + hID + ">" + spanGamut + "</h" + hLevel + ">"; return showdown2.subParser("hashBlock")(hashBlock, options, globals); }); var atxStyle = options.requireSpaceBeforeHeadingText ? /^(#{1,6})[ \t]+(.+?)[ \t]*#*\n+/gm : /^(#{1,6})[ \t]*(.+?)[ \t]*#*\n+/gm; text2 = text2.replace(atxStyle, function(wholeMatch, m1, m2) { var hText = m2; if (options.customizedHeaderId) { hText = m2.replace(/\s?\{([^{]+?)}\s*$/, ""); } var span = showdown2.subParser("spanGamut")(hText, options, globals), hID = options.noHeaderId ? "" : ' id="' + headerId(m2) + '"', hLevel = headerLevelStart - 1 + m1.length, header = "<h" + hLevel + hID + ">" + span + "</h" + hLevel + ">"; return showdown2.subParser("hashBlock")(header, options, globals); }); function headerId(m2) { var title, prefix; if (options.customizedHeaderId) { var match = m2.match(/\{([^{]+?)}\s*$/); if (match && match[1]) { m2 = match[1]; } } title = m2; if (showdown2.helper.isString(options.prefixHeaderId)) { prefix = options.prefixHeaderId; } else if (options.prefixHeaderId === true) { prefix = "section-"; } else { prefix = ""; } if (!options.rawPrefixHeaderId) { title = prefix + title; } if (options.ghCompatibleHeaderId) { title = title.replace(/ /g, "-").replace(/&/g, "").replace(/¨T/g, "").replace(/¨D/g, "").replace(/[&+$,\/:;=?@"#{}|^¨~\[\]`\\*)(%.!'<>]/g, "").toLowerCase(); } else if (options.rawHeaderId) { title = title.replace(/ /g, "-").replace(/&/g, "&").replace(/¨T/g, "\xA8").replace(/¨D/g, "$").replace(/["']/g, "-").toLowerCase(); } else { title = title.replace(/[^\w]/g, "").toLowerCase(); } if (options.rawPrefixHeaderId) { title = prefix + title; } if (globals.hashLinkCounts[title]) { title = title + "-" + globals.hashLinkCounts[title]++; } else { globals.hashLinkCounts[title] = 1; } return title; } text2 = globals.converter._dispatch("headers.after", text2, options, globals); return text2; }); showdown2.subParser("horizontalRule", function(text2, options, globals) { "use strict"; text2 = globals.converter._dispatch("horizontalRule.before", text2, options, globals); var key = showdown2.subParser("hashBlock")("<hr />", options, globals); text2 = text2.replace(/^ {0,2}( ?-){3,}[ \t]*$/gm, key); text2 = text2.replace(/^ {0,2}( ?\*){3,}[ \t]*$/gm, key); text2 = text2.replace(/^ {0,2}( ?_){3,}[ \t]*$/gm, key); text2 = globals.converter._dispatch("horizontalRule.after", text2, options, globals); return text2; }); showdown2.subParser("images", function(text2, options, globals) { "use strict"; text2 = globals.converter._dispatch("images.before", text2, options, globals); var inlineRegExp = /!\[([^\]]*?)][ \t]*()\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g, crazyRegExp = /!\[([^\]]*?)][ \t]*()\([ \t]?<([^>]*)>(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(?:(["'])([^"]*?)\6))?[ \t]?\)/g, base64RegExp = /!\[([^\]]*?)][ \t]*()\([ \t]?<?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g, referenceRegExp = /!\[([^\]]*?)] ?(?:\n *)?\[([\s\S]*?)]()()()()()/g, refShortcutRegExp = /!\[([^\[\]]+)]()()()()()/g; function writeImageTagBase64(wholeMatch, altText, linkId, url, width, height, m5, title) { url = url.replace(/\s/g, ""); return writeImageTag(wholeMatch, altText, linkId, url, width, height, m5, title); } function writeImageTag(wholeMatch, altText, linkId, url, width, height, m5, title) { var gUrls = globals.gUrls, gTitles = globals.gTitles, gDims = globals.gDimensions; linkId = linkId.toLowerCase(); if (!title) { title = ""; } if (wholeMatch.search(/\(<?\s*>? ?(['"].*['"])?\)$/m) > -1) { url = ""; } else if (url === "" || url === null) { if (linkId === "" || linkId === null) { linkId = altText.toLowerCase().replace(/ ?\n/g, " "); } url = "#" + linkId; if (!showdown2.helper.isUndefined(gUrls[linkId])) { url = gUrls[linkId]; if (!showdown2.helper.isUndefined(gTitles[linkId])) { title = gTitles[linkId]; } if (!showdown2.helper.isUndefined(gDims[linkId])) { width = gDims[linkId].width; height = gDims[linkId].height; } } else { return wholeMatch; } } altText = altText.replace(/"/g, """).replace(showdown2.helper.regexes.asteriskDashAndColon, showdown2.helper.escapeCharactersCallback); url = url.replace(showdown2.helper.regexes.asteriskDashAndColon, showdown2.helper.escapeCharactersCallback); var result = '<img src="' + url + '" alt="' + altText + '"'; if (title && showdown2.helper.isString(title)) { title = title.replace(/"/g, """).replace(showdown2.helper.regexes.asteriskDashAndColon, showdown2.helper.escapeCharactersCallback); result += ' title="' + title + '"'; } if (width && height) { width = width === "*" ? "auto" : width; height = height === "*" ? "auto" : height; result += ' width="' + width + '"'; result += ' height="' + height + '"'; } result += " />"; return result; } text2 = text2.replace(referenceRegExp, writeImageTag); text2 = text2.replace(base64RegExp, writeImageTagBase64); text2 = text2.replace(crazyRegExp, writeImageTag); text2 = text2.replace(inlineRegExp, writeImageTag); text2 = text2.replace(refShortcutRegExp, writeImageTag); text2 = globals.converter._dispatch("images.after", text2, options, globals); return text2; }); showdown2.subParser("italicsAndBold", function(text2, options, globals) { "use strict"; text2 = globals.converter._dispatch("italicsAndBold.before", text2, options, globals); function parseInside(txt, left, right) { return left + txt + right; } if (options.literalMidWordUnderscores) { text2 = text2.replace(/\b___(\S[\s\S]*?)___\b/g, function(wm, txt) { return parseInside(txt, "<strong><em>", "</em></strong>"); }); text2 = text2.replace(/\b__(\S[\s\S]*?)__\b/g, function(wm, txt) { return parseInside(txt, "<strong>", "</strong>"); }); text2 = text2.replace(/\b_(\S[\s\S]*?)_\b/g, function(wm, txt) { return parseInside(txt, "<em>", "</em>"); }); } else { text2 = text2.replace(/___(\S[\s\S]*?)___/g, function(wm, m2) { return /\S$/.test(m2) ? parseInside(m2, "<strong><em>", "</em></strong>") : wm; }); text2 = text2.replace(/__(\S[\s\S]*?)__/g, function(wm, m2) { return /\S$/.test(m2) ? parseInside(m2, "<strong>", "</strong>") : wm; }); text2 = text2.replace(/_([^\s_][\s\S]*?)_/g, function(wm, m2) { return /\S$/.test(m2) ? parseInside(m2, "<em>", "</em>") : wm; }); } if (options.literalMidWordAsterisks) { text2 = text2.replace(/([^*]|^)\B\*\*\*(\S[\s\S]*?)\*\*\*\B(?!\*)/g, function(wm, lead, txt) { return parseInside(txt, lead + "<strong><em>", "</em></strong>"); }); text2 = text2.replace(/([^*]|^)\B\*\*(\S[\s\S]*?)\*\*\B(?!\*)/g, function(wm, lead, txt) { return parseInside(txt, lead + "<strong>", "</strong>"); }); text2 = text2.replace(/([^*]|^)\B\*(\S[\s\S]*?)\*\B(?!\*)/g, function(wm, lead, txt) { return parseInside(txt, lead + "<em>", "</em>"); }); } else { text2 = text2.replace(/\*\*\*(\S[\s\S]*?)\*\*\*/g, function(wm, m2) { return /\S$/.test(m2) ? parseInside(m2, "<strong><em>", "</em></strong>") : wm; }); text2 = text2.replace(/\*\*(\S[\s\S]*?)\*\*/g, function(wm, m2) { return /\S$/.test(m2) ? parseInside(m2, "<strong>", "</strong>") : wm; }); text2 = text2.replace(/\*([^\s*][\s\S]*?)\*/g, function(wm, m2) { return /\S$/.test(m2) ? parseInside(m2, "<em>", "</em>") : wm; }); } text2 = globals.converter._dispatch("italicsAndBold.after", text2, options, globals); return text2; }); showdown2.subParser("lists", function(text2, options, globals) { "use strict"; function processListItems(listStr, trimTrailing) { globals.gListLevel++; listStr = listStr.replace(/\n{2,}$/, "\n"); listStr += "\xA80"; var rgx = /(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0| {0,3}([*+-]|\d+[.])[ \t]+))/gm, isParagraphed = /\n[ \t]*\n(?!¨0)/.test(listStr); if (options.disableForced4SpacesIndentedSublists) { rgx = /(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0|\2([*+-]|\d+[.])[ \t]+))/gm; } listStr = listStr.replace(rgx, function(wholeMatch, m1, m2, m3, m4, taskbtn, checked) { checked = checked && checked.trim() !== ""; var item = showdown2.subParser("outdent")(m4, options, globals), bulletStyle = ""; if (taskbtn && options.tasklists) { bulletStyle = ' class="task-list-item" style="list-style-type: none;"'; item = item.replace(/^[ \t]*\[(x|X| )?]/m, function() { var otp = '<input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;"'; if (checked) { otp += " checked"; } otp += ">"; return otp; }); } item = item.replace(/^([-*+]|\d\.)[ \t]+[\S\n ]*/g, function(wm2) { return "\xA8A" + wm2; }); if (m1 || item.search(/\n{2,}/) > -1) { item = showdown2.subParser("githubCodeBlocks")(item, options, globals); item = showdown2.subParser("blockGamut")(item, options, globals); } else { item = showdown2.subParser("lists")(item, options, globals); item = item.replace(/\n$/, ""); item = showdown2.subParser("hashHTMLBlocks")(item, options, globals); item = item.replace(/\n\n+/g, "\n\n"); if (isParagraphed) { item = showdown2.subParser("paragraphs")(item, options, globals); } else { item = showdown2.subParser("spanGamut")(item, options, globals); } } item = item.replace("\xA8A", ""); item = "<li" + bulletStyle + ">" + item + "</li>\n"; return item; }); listStr = listStr.replace(/¨0/g, ""); globals.gListLevel--; if (trimTrailing) { listStr = listStr.replace(/\s+$/, ""); } return listStr; } function styleStartNumber(list, listType) { if (listType === "ol") { var res = list.match(/^ *(\d+)\./); if (res && res[1] !== "1") { return ' start="' + res[1] + '"'; } } return ""; } function parseConsecutiveLists(list, listType, trimTrailing) { var olRgx = options.disableForced4SpacesIndentedSublists ? /^ ?\d+\.[ \t]/gm : /^ {0,3}\d+\.[ \t]/gm, ulRgx = options.disableForced4SpacesIndentedSublists ? /^ ?[*+-][ \t]/gm : /^ {0,3}[*+-][ \t]/gm, counterRxg = listType === "ul" ? olRgx : ulRgx, result = ""; if (list.search(counterRxg) !== -1) { (function parseCL(txt) { var pos = txt.search(counterRxg), style2 = styleStartNumber(list, listType); if (pos !== -1) { result += "\n\n<" + listType + style2 + ">\n" + processListItems(txt.slice(0, pos), !!trimTrailing) + "</" + listType + ">\n"; listType = listType === "ul" ? "ol" : "ul"; counterRxg = listType === "ul" ? olRgx : ulRgx; parseCL(txt.slice(pos)); } else { result += "\n\n<" + listType + style2 + ">\n" + processListItems(txt, !!trimTrailing) + "</" + listType + ">\n"; } })(list); } else { var style = styleStartNumber(list, listType); result = "\n\n<" + listType + style + ">\n" + processListItems(list, !!trimTrailing) + "</" + listType + ">\n"; } return result; } text2 = globals.converter._dispatch("lists.before", text2, options, globals); text2 += "\xA80"; if (globals.gListLevel) { text2 = text2.replace( /^(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm, function(wholeMatch, list, m2) { var listType = m2.search(/[*+-]/g) > -1 ? "ul" : "ol"; return parseConsecutiveLists(list, listType, true); } ); } else { text2 = text2.replace( /(\n\n|^\n?)(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm, function(wholeMatch, m1, list, m3) { var listType = m3.search(/[*+-]/g) > -1 ? "ul" : "ol"; return parseConsecutiveLists(list, listType, false); } ); } text2 = text2.replace(/¨0/, ""); text2 = globals.converter._dispatch("lists.after", text2, options, globals); return text2; }); showdown2.subParser("metadata", function(text2, options, globals) { "use strict"; if (!options.metadata) { return text2; } text2 = globals.converter._dispatch("metadata.before", text2, options, globals); function parseMetadataContents(content) { globals.metadata.raw = content; content = content.replace(/&/g, "&").replace(/"/g, """); content = content.replace(/\n {4}/g, " "); content.replace(/^([\S ]+): +([\s\S]+?)$/gm, function(wm, key, value) { globals.metadata.parsed[key] = value; return ""; }); } text2 = text2.replace(/^\s*«««+(\S*?)\n([\s\S]+?)\n»»»+\n/, function(wholematch, format, content) { parseMetadataContents(content); return "\xA8M"; }); text2 = text2.replace(/^\s*---+(\S*?)\n([\s\S]+?)\n---+\n/, function(wholematch, format, content) { if (format) { globals.metadata.format = format; } parseMetadataContents(content); return "\xA8M"; }); text2 = text2.replace(/¨M/g, ""); text2 = globals.converter._dispatch("metadata.after", text2, options, globals); return text2; }); showdown2.subParser("outdent", function(text2, options, globals) { "use strict"; text2 = globals.converter._dispatch("outdent.before", text2, options, globals); text2 = text2.replace(/^(\t|[ ]{1,4})/gm, "\xA80"); text2 = text2.replace(/¨0/g, ""); text2 = globals.converter._dispatch("outdent.after", text2, options, globals); return text2; }); showdown2.subParser("paragraphs", function(text2, options, globals) { "use strict"; text2 = globals.converter._dispatch("paragraphs.before", text2, options, globals); text2 = text2.replace(/^\n+/g, ""); text2 = text2.replace(/\n+$/g, ""); var grafs = text2.split(/\n{2,}/g), grafsOut = [], end = grafs.length; for (var i2 = 0; i2 < end; i2++) { var str = grafs[i2]; if (str.search(/¨(K|G)(\d+)\1/g) >= 0) { grafsOut.push(str); } else if (str.search(/\S/) >= 0) { str = showdown2.subParser("spanGamut")(str, options, globals); str = str.replace(/^([ \t]*)/g, "<p>"); str += "</p>"; grafsOut.push(str); } } end = grafsOut.length; for (i2 = 0; i2 < end; i2++) { var blockText = "", grafsOutIt = grafsOut[i2], codeFlag = false; while (/¨(K|G)(\d+)\1/.test(grafsOutIt)) { var delim = RegExp.$1, num = RegExp.$2; if (delim === "K") { blockText = globals.gHtmlBlocks[num]; } else { if (codeFlag) { blockText = showdown2.subParser("encodeCode")(globals.ghCodeBlocks[num].text, options, globals); } else { blockText = globals.ghCodeBlocks[num].codeblock; } } blockText = blockText.replace(/\$/g, "$$$$"); grafsOutIt = grafsOutIt.replace(/(\n\n)?¨(K|G)\d+\2(\n\n)?/, blockText); if (/^<pre\b[^>]*>\s*<code\b[^>]*>/.test(grafsOutIt)) { codeFlag = true; } } grafsOut[i2] = grafsOutIt; } text2 = grafsOut.join("\n"); text2 = text2.replace(/^\n+/g, ""); text2 = text2.replace(/\n+$/g, ""); return globals.converter._dispatch("paragraphs.after", text2, options, globals); }); showdown2.subParser("runExtension", function(ext, text2, options, globals) { "use strict"; if (ext.filter) { text2 = ext.filter(text2, globals.converter, options); } else if (ext.regex) { var re = ext.regex; if (!(re instanceof RegExp)) { re = new RegExp(re, "g"); } text2 = text2.replace(re, ext.replace); } return text2; }); showdown2.subParser("spanGamut", function(text2, options, globals) { "use strict"; text2 = globals.converter._dispatch("spanGamut.before", text2, options, globals); text2 = showdown2.subParser("codeSpans")(text2, options, globals); text2 = showdown2.subParser("escapeSpecialCharsWithinTagAttributes")(text2, options, globals); text2 = showdown2.subParser("encodeBackslashEscapes")(text2, options, globals); text2 = showdown2.subParser("images")(text2, options, globals); text2 = showdown2.subParser("anchors")(text2, options, globals); text2 = showdown2.subParser("autoLinks")(text2, options, globals); text2 = showdown2.subParser("simplifiedAutoLinks")(text2, options, globals); text2 = showdown2.subParser("emoji")(text2, options, globals); text2 = showdown2.subParser("underline")(text2, options, globals); text2 = showdown2.subParser("italicsAndBold")(text2, options, globals); text2 = showdown2.subParser("strikethrough")(text2, options, globals); text2 = showdown2.subParser("ellipsis")(text2, options, globals); text2 = showdown2.subParser("hashHTMLSpans")(text2, options, globals); text2 = showdown2.subParser("encodeAmpsAndAngles")(text2, options, globals); if (options.simpleLineBreaks) { if (!/\n\n¨K/.test(text2)) { text2 = text2.replace(/\n+/g, "<br />\n"); } } else { text2 = text2.replace(/ +\n/g, "<br />\n"); } text2 = globals.converter._dispatch("spanGamut.after", text2, options, globals); return text2; }); showdown2.subParser("strikethrough", function(text2, options, globals) { "use strict"; function parseInside(txt) { if (options.simplifiedAutoLink) { txt = showdown2.subParser("simplifiedAutoLinks")(txt, options, globals); } return "<del>" + txt + "</del>"; } if (options.strikethrough) { text2 = globals.converter._dispatch("strikethrough.before", text2, options, globals); text2 = text2.replace(/(?:~){2}([\s\S]+?)(?:~){2}/g, function(wm, txt) { return parseInside(txt); }); text2 = globals.converter._dispatch("strikethrough.after", text2, options, globals); } return text2; }); showdown2.subParser("stripLinkDefinitions", function(text2, options, globals) { "use strict"; var regex = /^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*<?([^>\s]+)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=¨0))/gm, base64Regex = /^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*<?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n\n|(?=¨0)|(?=\n\[))/gm; text2 += "\xA80"; var replaceFunc = function(wholeMatch, linkId, url, width, height, blankLines, title) { linkId = linkId.toLowerCase(); if (url.match(/^data:.+?\/.+?;base64,/)) { globals.gUrls[linkId] = url.replace(/\s/g, ""); } else { globals.gUrls[linkId] = showdown2.subParser("encodeAmpsAndAngles")(url, options, globals); } if (blankLines) { return blankLines + title; } else { if (title) { globals.gTitles[linkId] = title.replace(/"|'/g, """); } if (options.parseImgDimensions && width && height) { globals.gDimensions[linkId] = { width, height }; } } return ""; }; text2 = text2.replace(base64Regex, replaceFunc); text2 = text2.replace(regex, replaceFunc); text2 = text2.replace(/¨0/, ""); return text2; }); showdown2.subParser("tables", function(text2, options, globals) { "use strict"; if (!options.tables) { return text2; } var tableRgx = /^ {0,3}\|?.+\|.+\n {0,3}\|?[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:[-=]){2,}[\s\S]+?(?:\n\n|¨0)/gm, singeColTblRgx = /^ {0,3}\|.+\|[ \t]*\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n( {0,3}\|.+\|[ \t]*\n)*(?:\n|¨0)/gm; function parseStyles(sLine) { if (/^:[ \t]*--*$/.test(sLine)) { return ' style="text-align:left;"'; } else if (/^--*[ \t]*:[ \t]*$/.test(sLine)) { return ' style="text-align:right;"'; } else if (/^:[ \t]*--*[ \t]*:$/.test(sLine)) { return ' style="text-align:center;"'; } else { return ""; } } function parseHeaders(header, style) { var id = ""; header = header.trim(); if (options.tablesHeaderId || options.tableHeaderId) { id = ' id="' + header.replace(/ /g, "_").toLowerCase() + '"'; } header = showdown2.subParser("spanGamut")(header, options, globals); return "<th" + id + style + ">" + header + "</th>\n"; } function parseCells(cell, style) { var subText = showdown2.subParser("spanGamut")(cell, options, globals); return "<td" + style + ">" + subText + "</td>\n"; } function buildTable(headers, cells) { var tb = "<table>\n<thead>\n<tr>\n", tblLgn = headers.length; for (var i2 = 0; i2 < tblLgn; ++i2) { tb += headers[i2]; } tb += "</tr>\n</thead>\n<tbody>\n"; for (i2 = 0; i2 < cells.length; ++i2) { tb += "<tr>\n"; for (var ii = 0; ii < tblLgn; ++ii) { tb += cells[i2][ii]; } tb += "</tr>\n"; } tb += "</tbody>\n</table>\n"; return tb; } function parseTable(rawTable) { var i2, tableLines = rawTable.split("\n"); for (i2 = 0; i2 < tableLines.length; ++i2) { if (/^ {0,3}\|/.test(tableLines[i2])) { tableLines[i2] = tableLines[i2].replace(/^ {0,3}\|/, ""); } if (/\|[ \t]*$/.test(tableLines[i2])) { tableLines[i2] = tableLines[i2].replace(/\|[ \t]*$/, ""); } tableLines[i2] = showdown2.subParser("codeSpans")(tableLines[i2], options, globals); } var rawHeaders = tableLines[0].split("|").map(function(s2) { return s2.trim(); }), rawStyles = tableLines[1].split("|").map(function(s2) { return s2.trim(); }), rawCells = [], headers = [], styles = [], cells = []; tableLines.shift(); tableLines.shift(); for (i2 = 0; i2 < tableLines.length; ++i2) { if (tableLines[i2].trim() === "") { continue; } rawCells.push( tableLines[i2].split("|").map(function(s2) { return s2.trim(); }) ); } if (rawHeaders.length < rawStyles.length) { return rawTable; } for (i2 = 0; i2 < rawStyles.length; ++i2) { styles.push(parseStyles(rawStyles[i2])); } for (i2 = 0; i2 < rawHeaders.length; ++i2) { if (showdown2.helper.isUndefined(styles[i2])) { styles[i2] = ""; } headers.push(parseHeaders(rawHeaders[i2], styles[i2])); } for (i2 = 0; i2 < rawCells.length; ++i2) { var row = []; for (var ii = 0; ii < headers.length; ++ii) { if (showdown2.helper.isUndefined(rawCells[i2][ii])) { } row.push(parseCells(rawCells[i2][ii], styles[ii])); } cells.push(row); } return buildTable(headers, cells); } text2 = globals.converter._dispatch("tables.before", text2, options, globals); text2 = text2.replace(/\\(\|)/g, showdown2.helper.escapeCharactersCallback); text2 = text2.replace(tableRgx, parseTable); text2 = text2.replace(singeColTblRgx, parseTable); text2 = globals.converter._dispatch("tables.after", text2, options, globals); return text2; }); showdown2.subParser("underline", function(text2, options, globals) { "use strict"; if (!options.underline) { return text2; } text2 = globals.converter._dispatch("underline.before", text2, options, globals); if (options.literalMidWordUnderscores) { text2 = text2.replace(/\b___(\S[\s\S]*?)___\b/g, function(wm, txt) { return "<u>" + txt + "</u>"; }); text2 = text2.replace(/\b__(\S[\s\S]*?)__\b/g, function(wm, txt) { return "<u>" + txt + "</u>"; }); } else { text2 = text2.replace(/___(\S[\s\S]*?)___/g, function(wm, m2) { return /\S$/.test(m2) ? "<u>" + m2 + "</u>" : wm; }); text2 = text2.replace(/__(\S[\s\S]*?)__/g, function(wm, m2) { return /\S$/.test(m2) ? "<u>" + m2 + "</u>" : wm; }); } text2 = text2.replace(/(_)/g, showdown2.helper.escapeCharactersCallback); text2 = globals.converter._dispatch("underline.after", text2, options, globals); return text2; }); showdown2.subParser("unescapeSpecialChars", function(text2, options, globals) { "use strict"; text2 = globals.converter._dispatch("unescapeSpecialChars.before", text2, options, globals); text2 = text2.replace(/¨E(\d+)E/g, function(wholeMatch, m1) { var charCodeToReplace = parseInt(m1); return String.fromCharCode(charCodeToReplace); }); text2 = globals.converter._dispatch("unescapeSpecialChars.after", text2, options, globals); return text2; }); showdown2.subParser("makeMarkdown.blockquote", function(node, globals) { "use strict"; var txt = ""; if (node.hasChildNodes()) { var children = node.childNodes, childrenLength = children.length; for (var i2 = 0; i2 < childrenLength; ++i2) { var innerTxt = showdown2.subParser("makeMarkdown.node")(children[i2], globals); if (innerTxt === "") { continue; } txt += innerTxt; } } txt = txt.trim(); txt = "> " + txt.split("\n").join("\n> "); return txt; }); showdown2.subParser("makeMarkdown.codeBlock", function(node, globals) { "use strict"; var lang = node.getAttribute("language"), num = node.getAttribute("precodenum"); return "```" + lang + "\n" + globals.preList[num] + "\n```"; }); showdown2.subParser("makeMarkdown.codeSpan", function(node) { "use strict"; return "`" + node.innerHTML + "`"; }); showdown2.subParser("makeMarkdown.emphasis", function(node, globals) { "use strict"; var txt = ""; if (node.hasChildNodes()) { txt += "*"; var children = node.childNodes, childrenLength = children.length; for (var i2 = 0; i2 < childrenLength; ++i2) { txt += showdown2.subParser("makeMarkdown.node")(children[i2], globals); } txt += "*"; } return txt; }); showdown2.subParser("makeMarkdown.header", function(node, globals, headerLevel) { "use strict"; var headerMark = new Array(headerLevel + 1).join("#"), txt = ""; if (node.hasChildNodes()) { txt = headerMark + " "; var children = node.childNodes, childrenLength = children.length; for (var i2 = 0; i2 < childrenLength; ++i2) { txt += showdown2.subParser("makeMarkdown.node")(children[i2], globals); } } return txt; }); showdown2.subParser("makeMarkdown.hr", function() { "use strict"; return "---"; }); showdown2.subParser("makeMarkdown.image", function(node) { "use strict"; var txt = ""; if (node.hasAttribute("src")) { txt += " + ">"; if (node.hasAttribute("width") && node.hasAttribute("height")) { txt += " =" + node.getAttribute("width") + "x" + node.getAttribute("height"); } if (node.hasAttribute("title")) { txt += ' "' + node.getAttribute("title") + '"'; } txt += ")"; } return txt; }); showdown2.subParser("makeMarkdown.links", function(node, globals) { "use strict"; var txt = ""; if (node.hasChildNodes() && node.hasAttribute("href")) { var children = node.childNodes, childrenLength = children.length; txt = "["; for (var i2 = 0; i2 < childrenLength; ++i2) { txt += showdown2.subParser("makeMarkdown.node")(children[i2], globals); } txt += "]("; txt += "<" + node.getAttribute("href") + ">"; if (node.hasAttribute("title")) { txt += ' "' + node.getAttribute("title") + '"'; } txt += ")"; } return txt; }); showdown2.subParser("makeMarkdown.list", function(node, globals, type) { "use strict"; var txt = ""; if (!node.hasChildNodes()) { return ""; } var listItems = node.childNodes, listItemsLenght = listItems.length, listNum = node.getAttribute("start") || 1; for (var i2 = 0; i2 < listItemsLenght; ++i2) { if (typeof listItems[i2].tagName === "undefined" || listItems[i2].tagName.toLowerCase() !== "li") { continue; } var bullet = ""; if (type === "ol") { bullet = listNum.toString() + ". "; } else { bullet = "- "; } txt += bullet + showdown2.subParser("makeMarkdown.listItem")(listItems[i2], globals); ++listNum; } txt += "\n<!-- -->\n"; return txt.trim(); }); showdown2.subParser("makeMarkdown.listItem", function(node, globals) { "use strict"; var listItemTxt = ""; var children = node.childNodes, childrenLenght = children.length; for (var i2 = 0; i2 < childrenLenght; ++i2) { listItemTxt += showdown2.subParser("makeMarkdown.node")(children[i2], globals); } if (!/\n$/.test(listItemTxt)) { listItemTxt += "\n"; } else { listItemTxt = listItemTxt.split("\n").join("\n ").replace(/^ {4}$/gm, "").replace(/\n\n+/g, "\n\n"); } return listItemTxt; }); showdown2.subParser("makeMarkdown.node", function(node, globals, spansOnly) { "use strict"; spansOnly = spansOnly || false; var txt = ""; if (node.nodeType === 3) { return showdown2.subParser("makeMarkdown.txt")(node, globals); } if (node.nodeType === 8) { return "<!--" + node.data + "-->\n\n"; } if (node.nodeType !== 1) { return ""; } var tagName = node.tagName.toLowerCase(); switch (tagName) { // // BLOCKS // case "h1": if (!spansOnly) { txt = showdown2.subParser("makeMarkdown.header")(node, globals, 1) + "\n\n"; } break; case "h2": if (!spansOnly) { txt = showdown2.subParser("makeMarkdown.header")(node, globals, 2) + "\n\n"; } break; case "h3": if (!spansOnly) { txt = showdown2.subParser("makeMarkdown.header")(node, globals, 3) + "\n\n"; } break; case "h4": if (!spansOnly) { txt = showdown2.subParser("makeMarkdown.header")(node, globals, 4) + "\n\n"; } break; case "h5": if (!spansOnly) { txt = showdown2.subParser("makeMarkdown.header")(node, globals, 5) + "\n\n"; } break; case "h6": if (!spansOnly) { txt = showdown2.subParser("makeMarkdown.header")(node, globals, 6) + "\n\n"; } break; case "p": if (!spansOnly) { txt = showdown2.subParser("makeMarkdown.paragraph")(node, globals) + "\n\n"; } break; case "blockquote": if (!spansOnly) { txt = showdown2.subParser("makeMarkdown.blockquote")(node, globals) + "\n\n"; } break; case "hr": if (!spansOnly) { txt = showdown2.subParser("makeMarkdown.hr")(node, globals) + "\n\n"; } break; case "ol": if (!spansOnly) { txt = showdown2.subParser("makeMarkdown.list")(node, globals, "ol") + "\n\n"; } break; case "ul": if (!spansOnly) { txt = showdown2.subParser("makeMarkdown.list")(node, globals, "ul") + "\n\n"; } break; case "precode": if (!spansOnly) { txt = showdown2.subParser("makeMarkdown.codeBlock")(node, globals) + "\n\n"; } break; case "pre": if (!spansOnly) { txt = showdown2.subParser("makeMarkdown.pre")(node, globals) + "\n\n"; } break; case "table": if (!spansOnly) { txt = showdown2.subParser("makeMarkdown.table")(node, globals) + "\n\n"; } break; // // SPANS // case "code": txt = showdown2.subParser("makeMarkdown.codeSpan")(node, globals); break; case "em": case "i": txt = showdown2.subParser("makeMarkdown.emphasis")(node, globals); break; case "strong": case "b": txt = showdown2.subParser("makeMarkdown.strong")(node, globals); break; case "del": txt = showdown2.subParser("makeMarkdown.strikethrough")(node, globals); break; case "a": txt = showdown2.subParser("makeMarkdown.links")(node, globals); break; case "img": txt = showdown2.subParser("makeMarkdown.image")(node, globals); break; default: txt = node.outerHTML + "\n\n"; } return txt; }); showdown2.subParser("makeMarkdown.paragraph", function(node, globals) { "use strict"; var txt = ""; if (node.hasChildNodes()) { var children = node.childNodes, childrenLength = children.length; for (var i2 = 0; i2 < childrenLength; ++i2) { txt += showdown2.subParser("makeMarkdown.node")(children[i2], globals); } } txt = txt.trim(); return txt; }); showdown2.subParser("makeMarkdown.pre", function(node, globals) { "use strict"; var num = node.getAttribute("prenum"); return "<pre>" + globals.preList[num] + "</pre>"; }); showdown2.subParser("makeMarkdown.strikethrough", function(node, globals) { "use strict"; var txt = ""; if (node.hasChildNodes()) { txt += "~~"; var children = node.childNodes, childrenLength = children.length; for (var i2 = 0; i2 < childrenLength; ++i2) { txt += showdown2.subParser("makeMarkdown.node")(children[i2], globals); } txt += "~~"; } return txt; }); showdown2.subParser("makeMarkdown.strong", function(node, globals) { "use strict"; var txt = ""; if (node.hasChildNodes()) { txt += "**"; var children = node.childNodes, childrenLength = children.length; for (var i2 = 0; i2 < childrenLength; ++i2) { txt += showdown2.subParser("makeMarkdown.node")(children[i2], globals); } txt += "**"; } return txt; }); showdown2.subParser("makeMarkdown.table", function(node, globals) { "use strict"; var txt = "", tableArray = [[], []], headings = node.querySelectorAll("thead>tr>th"), rows = node.querySelectorAll("tbody>tr"), i2, ii; for (i2 = 0; i2 < headings.length; ++i2) { var headContent = showdown2.subParser("makeMarkdown.tableCell")(headings[i2], globals), allign = "---"; if (headings[i2].hasAttribute("style")) { var style = headings[i2].getAttribute("style").toLowerCase().replace(/\s/g, ""); switch (style) { case "text-align:left;": allign = ":---"; break; case "text-align:right;": allign = "---:"; break; case "text-align:center;": allign = ":---:"; break; } } tableArray[0][i2] = headContent.trim(); tableArray[1][i2] = allign; } for (i2 = 0; i2 < rows.length; ++i2) { var r2 = tableArray.push([]) - 1, cols = rows[i2].getElementsByTagName("td"); for (ii = 0; ii < headings.length; ++ii) { var cellContent = " "; if (typeof cols[ii] !== "undefined") { cellContent = showdown2.subParser("makeMarkdown.tableCell")(cols[ii], globals); } tableArray[r2].push(cellContent); } } var cellSpacesCount = 3; for (i2 = 0; i2 < tableArray.length; ++i2) { for (ii = 0; ii < tableArray[i2].length; ++ii) { var strLen = tableArray[i2][ii].length; if (strLen > cellSpacesCount) { cellSpacesCount = strLen; } } } for (i2 = 0; i2 < tableArray.length; ++i2) { for (ii = 0; ii < tableArray[i2].length; ++ii) { if (i2 === 1) { if (tableArray[i2][ii].slice(-1) === ":") { tableArray[i2][ii] = showdown2.helper.padEnd(tableArray[i2][ii].slice(-1), cellSpacesCount - 1, "-") + ":"; } else { tableArray[i2][ii] = showdown2.helper.padEnd(tableArray[i2][ii], cellSpacesCount, "-"); } } else { tableArray[i2][ii] = showdown2.helper.padEnd(tableArray[i2][ii], cellSpacesCount); } } txt += "| " + tableArray[i2].join(" | ") + " |\n"; } return txt.trim(); }); showdown2.subParser("makeMarkdown.tableCell", function(node, globals) { "use strict"; var txt = ""; if (!node.hasChildNodes()) { return ""; } var children = node.childNodes, childrenLength = children.length; for (var i2 = 0; i2 < childrenLength; ++i2) { txt += showdown2.subParser("makeMarkdown.node")(children[i2], globals, true); } return txt.trim(); }); showdown2.subParser("makeMarkdown.txt", function(node) { "use strict"; var txt = node.nodeValue; txt = txt.replace(/ +/g, " "); txt = txt.replace(/¨NBSP;/g, " "); txt = showdown2.helper.unescapeHTMLEntities(txt); txt = txt.replace(/([*_~|`])/g, "\\$1"); txt = txt.replace(/^(\s*)>/g, "\\$1>"); txt = txt.replace(/^#/gm, "\\#"); txt = txt.replace(/^(\s*)([-=]{3,})(\s*)$/, "$1\\$2$3"); txt = txt.replace(/^( {0,3}\d+)\./gm, "$1\\."); txt = txt.replace(/^( {0,3})([+-])/gm, "$1\\$2"); txt = txt.replace(/]([\s]*)\(/g, "\\]$1\\("); txt = txt.replace(/^ {0,3}\[([\S \t]*?)]:/gm, "\\[$1]:"); return txt; }); var root = this; if (typeof define === "function" && define.amd) { define(function() { "use strict"; return showdown2; }); } else if (typeof module !== "undefined" && module.exports) { module.exports = showdown2; } else { root.showdown = showdown2; } }).call(exports); } }); // packages/blocks/build-module/index.mjs var index_exports = {}; __export(index_exports, { __EXPERIMENTAL_ELEMENTS: () => __EXPERIMENTAL_ELEMENTS, __EXPERIMENTAL_PATHS_WITH_OVERRIDE: () => __EXPERIMENTAL_PATHS_WITH_OVERRIDE, __EXPERIMENTAL_STYLE_PROPERTY: () => __EXPERIMENTAL_STYLE_PROPERTY, __experimentalCloneSanitizedBlock: () => __experimentalCloneSanitizedBlock, __experimentalGetAccessibleBlockLabel: () => getAccessibleBlockLabel, __experimentalGetBlockAttributesNamesByRole: () => __experimentalGetBlockAttributesNamesByRole, __experimentalGetBlockLabel: () => getBlockLabel, __experimentalSanitizeBlockAttributes: () => __experimentalSanitizeBlockAttributes, __unstableGetBlockProps: () => getBlockProps, __unstableGetInnerBlocksProps: () => getInnerBlocksProps, __unstableSerializeAndClean: () => __unstableSerializeAndClean, children: () => children_default, cloneBlock: () => cloneBlock, createBlock: () => createBlock, createBlocksFromInnerBlocksTemplate: () => createBlocksFromInnerBlocksTemplate, doBlocksMatchTemplate: () => doBlocksMatchTemplate, findTransform: () => findTransform, getBlockAttributes: () => getBlockAttributes, getBlockAttributesNamesByRole: () => getBlockAttributesNamesByRole, getBlockBindingsSource: () => getBlockBindingsSource, getBlockBindingsSources: () => getBlockBindingsSources, getBlockContent: () => getBlockInnerHTML, getBlockDefaultClassName: () => getBlockDefaultClassName, getBlockFromExample: () => getBlockFromExample, getBlockMenuDefaultClassName: () => getBlockMenuDefaultClassName, getBlockSupport: () => getBlockSupport, getBlockTransforms: () => getBlockTransforms, getBlockType: () => getBlockType, getBlockTypes: () => getBlockTypes, getBlockVariations: () => getBlockVariations, getCategories: () => getCategories2, getChildBlockNames: () => getChildBlockNames, getDefaultBlockName: () => getDefaultBlockName, getFreeformContentHandlerName: () => getFreeformContentHandlerName, getGroupingBlockName: () => getGroupingBlockName, getPhrasingContentSchema: () => deprecatedGetPhrasingContentSchema, getPossibleBlockTransformations: () => getPossibleBlockTransformations, getSaveContent: () => getSaveContent, getSaveElement: () => getSaveElement, getUnregisteredTypeHandlerName: () => getUnregisteredTypeHandlerName, hasBlockSupport: () => hasBlockSupport, hasChildBlocks: () => hasChildBlocks, hasChildBlocksWithInserterSupport: () => hasChildBlocksWithInserterSupport, isReusableBlock: () => isReusableBlock, isTemplatePart: () => isTemplatePart, isUnmodifiedBlock: () => isUnmodifiedBlock, isUnmodifiedDefaultBlock: () => isUnmodifiedDefaultBlock, isValidBlockContent: () => isValidBlockContent, isValidIcon: () => isValidIcon, node: () => node_default, normalizeIconObject: () => normalizeIconObject, parse: () => parse2, parseWithAttributeSchema: () => parseWithAttributeSchema, pasteHandler: () => pasteHandler, privateApis: () => privateApis, rawHandler: () => rawHandler, registerBlockBindingsSource: () => registerBlockBindingsSource, registerBlockCollection: () => registerBlockCollection, registerBlockStyle: () => registerBlockStyle, registerBlockType: () => registerBlockType, registerBlockVariation: () => registerBlockVariation, serialize: () => serialize, serializeRawBlock: () => serializeRawBlock, setCategories: () => setCategories2, setDefaultBlockName: () => setDefaultBlockName, setFreeformContentHandlerName: () => setFreeformContentHandlerName, setGroupingBlockName: () => setGroupingBlockName, setUnregisteredTypeHandlerName: () => setUnregisteredTypeHandlerName, store: () => store, switchToBlockType: () => switchToBlockType, synchronizeBlocksWithTemplate: () => synchronizeBlocksWithTemplate, unregisterBlockBindingsSource: () => unregisterBlockBindingsSource, unregisterBlockStyle: () => unregisterBlockStyle, unregisterBlockType: () => unregisterBlockType, unregisterBlockVariation: () => unregisterBlockVariation, unstable__bootstrapServerSideBlockDefinitions: () => unstable__bootstrapServerSideBlockDefinitions, updateCategory: () => updateCategory2, validateBlock: () => validateBlock, withBlockContentContext: () => withBlockContentContext }); // packages/blocks/build-module/store/index.mjs var import_data5 = __toESM(require_data(), 1); // node_modules/tslib/tslib.es6.mjs var __assign = function() { __assign = Object.assign || function __assign2(t3) { for (var s2, i2 = 1, n2 = arguments.length; i2 < n2; i2++) { s2 = arguments[i2]; for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2)) t3[p2] = s2[p2]; } return t3; }; return __assign.apply(this, arguments); }; // node_modules/lower-case/dist.es2015/index.js function lowerCase(str) { return str.toLowerCase(); } // node_modules/no-case/dist.es2015/index.js var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g]; var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi; function noCase(input, options) { if (options === void 0) { options = {}; } var _a = options.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options.transform, transform = _c === void 0 ? lowerCase : _c, _d = options.delimiter, delimiter = _d === void 0 ? " " : _d; var result = replace(replace(input, splitRegexp, "$1\0$2"), stripRegexp, "\0"); var start = 0; var end = result.length; while (result.charAt(start) === "\0") start++; while (result.charAt(end - 1) === "\0") end--; return result.slice(start, end).split("\0").map(transform).join(delimiter); } function replace(input, re, value) { if (re instanceof RegExp) return input.replace(re, value); return re.reduce(function(input2, re2) { return input2.replace(re2, value); }, input); } // node_modules/pascal-case/dist.es2015/index.js function pascalCaseTransform(input, index) { var firstChar = input.charAt(0); var lowerChars = input.substr(1).toLowerCase(); if (index > 0 && firstChar >= "0" && firstChar <= "9") { return "_" + firstChar + lowerChars; } return "" + firstChar.toUpperCase() + lowerChars; } function pascalCase(input, options) { if (options === void 0) { options = {}; } return noCase(input, __assign({ delimiter: "", transform: pascalCaseTransform }, options)); } // node_modules/camel-case/dist.es2015/index.js function camelCaseTransform(input, index) { if (index === 0) return input.toLowerCase(); return pascalCaseTransform(input, index); } function camelCase(input, options) { if (options === void 0) { options = {}; } return pascalCase(input, __assign({ transform: camelCaseTransform }, options)); } // packages/blocks/build-module/store/reducer.mjs var import_data2 = __toESM(require_data(), 1); var import_i18n3 = __toESM(require_i18n(), 1); // node_modules/colord/index.mjs var r = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }; var t = function(r2) { return "string" == typeof r2 ? r2.length > 0 : "number" == typeof r2; }; var n = function(r2, t3, n2) { return void 0 === t3 && (t3 = 0), void 0 === n2 && (n2 = Math.pow(10, t3)), Math.round(n2 * r2) / n2 + 0; }; var e = function(r2, t3, n2) { return void 0 === t3 && (t3 = 0), void 0 === n2 && (n2 = 1), r2 > n2 ? n2 : r2 > t3 ? r2 : t3; }; var u = function(r2) { return (r2 = isFinite(r2) ? r2 % 360 : 0) > 0 ? r2 : r2 + 360; }; var a = function(r2) { return { r: e(r2.r, 0, 255), g: e(r2.g, 0, 255), b: e(r2.b, 0, 255), a: e(r2.a) }; }; var o = function(r2) { return { r: n(r2.r), g: n(r2.g), b: n(r2.b), a: n(r2.a, 3) }; }; var i = /^#([0-9a-f]{3,8})$/i; var s = function(r2) { var t3 = r2.toString(16); return t3.length < 2 ? "0" + t3 : t3; }; var h = function(r2) { var t3 = r2.r, n2 = r2.g, e2 = r2.b, u2 = r2.a, a2 = Math.max(t3, n2, e2), o3 = a2 - Math.min(t3, n2, e2), i2 = o3 ? a2 === t3 ? (n2 - e2) / o3 : a2 === n2 ? 2 + (e2 - t3) / o3 : 4 + (t3 - n2) / o3 : 0; return { h: 60 * (i2 < 0 ? i2 + 6 : i2), s: a2 ? o3 / a2 * 100 : 0, v: a2 / 255 * 100, a: u2 }; }; var b = function(r2) { var t3 = r2.h, n2 = r2.s, e2 = r2.v, u2 = r2.a; t3 = t3 / 360 * 6, n2 /= 100, e2 /= 100; var a2 = Math.floor(t3), o3 = e2 * (1 - n2), i2 = e2 * (1 - (t3 - a2) * n2), s2 = e2 * (1 - (1 - t3 + a2) * n2), h2 = a2 % 6; return { r: 255 * [e2, i2, o3, o3, s2, e2][h2], g: 255 * [s2, e2, e2, i2, o3, o3][h2], b: 255 * [o3, o3, s2, e2, e2, i2][h2], a: u2 }; }; var g = function(r2) { return { h: u(r2.h), s: e(r2.s, 0, 100), l: e(r2.l, 0, 100), a: e(r2.a) }; }; var d = function(r2) { return { h: n(r2.h), s: n(r2.s), l: n(r2.l), a: n(r2.a, 3) }; }; var f = function(r2) { return b((n2 = (t3 = r2).s, { h: t3.h, s: (n2 *= ((e2 = t3.l) < 50 ? e2 : 100 - e2) / 100) > 0 ? 2 * n2 / (e2 + n2) * 100 : 0, v: e2 + n2, a: t3.a })); var t3, n2, e2; }; var c = function(r2) { return { h: (t3 = h(r2)).h, s: (u2 = (200 - (n2 = t3.s)) * (e2 = t3.v) / 100) > 0 && u2 < 200 ? n2 * e2 / 100 / (u2 <= 100 ? u2 : 200 - u2) * 100 : 0, l: u2 / 2, a: t3.a }; var t3, n2, e2, u2; }; var l = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i; var p = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i; var v = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i; var m = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i; var y = { string: [[function(r2) { var t3 = i.exec(r2); return t3 ? (r2 = t3[1]).length <= 4 ? { r: parseInt(r2[0] + r2[0], 16), g: parseInt(r2[1] + r2[1], 16), b: parseInt(r2[2] + r2[2], 16), a: 4 === r2.length ? n(parseInt(r2[3] + r2[3], 16) / 255, 2) : 1 } : 6 === r2.length || 8 === r2.length ? { r: parseInt(r2.substr(0, 2), 16), g: parseInt(r2.substr(2, 2), 16), b: parseInt(r2.substr(4, 2), 16), a: 8 === r2.length ? n(parseInt(r2.substr(6, 2), 16) / 255, 2) : 1 } : null : null; }, "hex"], [function(r2) { var t3 = v.exec(r2) || m.exec(r2); return t3 ? t3[2] !== t3[4] || t3[4] !== t3[6] ? null : a({ r: Number(t3[1]) / (t3[2] ? 100 / 255 : 1), g: Number(t3[3]) / (t3[4] ? 100 / 255 : 1), b: Number(t3[5]) / (t3[6] ? 100 / 255 : 1), a: void 0 === t3[7] ? 1 : Number(t3[7]) / (t3[8] ? 100 : 1) }) : null; }, "rgb"], [function(t3) { var n2 = l.exec(t3) || p.exec(t3); if (!n2) return null; var e2, u2, a2 = g({ h: (e2 = n2[1], u2 = n2[2], void 0 === u2 && (u2 = "deg"), Number(e2) * (r[u2] || 1)), s: Number(n2[3]), l: Number(n2[4]), a: void 0 === n2[5] ? 1 : Number(n2[5]) / (n2[6] ? 100 : 1) }); return f(a2); }, "hsl"]], object: [[function(r2) { var n2 = r2.r, e2 = r2.g, u2 = r2.b, o3 = r2.a, i2 = void 0 === o3 ? 1 : o3; return t(n2) && t(e2) && t(u2) ? a({ r: Number(n2), g: Number(e2), b: Number(u2), a: Number(i2) }) : null; }, "rgb"], [function(r2) { var n2 = r2.h, e2 = r2.s, u2 = r2.l, a2 = r2.a, o3 = void 0 === a2 ? 1 : a2; if (!t(n2) || !t(e2) || !t(u2)) return null; var i2 = g({ h: Number(n2), s: Number(e2), l: Number(u2), a: Number(o3) }); return f(i2); }, "hsl"], [function(r2) { var n2 = r2.h, a2 = r2.s, o3 = r2.v, i2 = r2.a, s2 = void 0 === i2 ? 1 : i2; if (!t(n2) || !t(a2) || !t(o3)) return null; var h2 = (function(r3) { return { h: u(r3.h), s: e(r3.s, 0, 100), v: e(r3.v, 0, 100), a: e(r3.a) }; })({ h: Number(n2), s: Number(a2), v: Number(o3), a: Number(s2) }); return b(h2); }, "hsv"]] }; var N = function(r2, t3) { for (var n2 = 0; n2 < t3.length; n2++) { var e2 = t3[n2][0](r2); if (e2) return [e2, t3[n2][1]]; } return [null, void 0]; }; var x = function(r2) { return "string" == typeof r2 ? N(r2.trim(), y.string) : "object" == typeof r2 && null !== r2 ? N(r2, y.object) : [null, void 0]; }; var M = function(r2, t3) { var n2 = c(r2); return { h: n2.h, s: e(n2.s + 100 * t3, 0, 100), l: n2.l, a: n2.a }; }; var H = function(r2) { return (299 * r2.r + 587 * r2.g + 114 * r2.b) / 1e3 / 255; }; var $ = function(r2, t3) { var n2 = c(r2); return { h: n2.h, s: n2.s, l: e(n2.l + 100 * t3, 0, 100), a: n2.a }; }; var j = (function() { function r2(r3) { this.parsed = x(r3)[0], this.rgba = this.parsed || { r: 0, g: 0, b: 0, a: 1 }; } return r2.prototype.isValid = function() { return null !== this.parsed; }, r2.prototype.brightness = function() { return n(H(this.rgba), 2); }, r2.prototype.isDark = function() { return H(this.rgba) < 0.5; }, r2.prototype.isLight = function() { return H(this.rgba) >= 0.5; }, r2.prototype.toHex = function() { return r3 = o(this.rgba), t3 = r3.r, e2 = r3.g, u2 = r3.b, i2 = (a2 = r3.a) < 1 ? s(n(255 * a2)) : "", "#" + s(t3) + s(e2) + s(u2) + i2; var r3, t3, e2, u2, a2, i2; }, r2.prototype.toRgb = function() { return o(this.rgba); }, r2.prototype.toRgbString = function() { return r3 = o(this.rgba), t3 = r3.r, n2 = r3.g, e2 = r3.b, (u2 = r3.a) < 1 ? "rgba(" + t3 + ", " + n2 + ", " + e2 + ", " + u2 + ")" : "rgb(" + t3 + ", " + n2 + ", " + e2 + ")"; var r3, t3, n2, e2, u2; }, r2.prototype.toHsl = function() { return d(c(this.rgba)); }, r2.prototype.toHslString = function() { return r3 = d(c(this.rgba)), t3 = r3.h, n2 = r3.s, e2 = r3.l, (u2 = r3.a) < 1 ? "hsla(" + t3 + ", " + n2 + "%, " + e2 + "%, " + u2 + ")" : "hsl(" + t3 + ", " + n2 + "%, " + e2 + "%)"; var r3, t3, n2, e2, u2; }, r2.prototype.toHsv = function() { return r3 = h(this.rgba), { h: n(r3.h), s: n(r3.s), v: n(r3.v), a: n(r3.a, 3) }; var r3; }, r2.prototype.invert = function() { return w({ r: 255 - (r3 = this.rgba).r, g: 255 - r3.g, b: 255 - r3.b, a: r3.a }); var r3; }, r2.prototype.saturate = function(r3) { return void 0 === r3 && (r3 = 0.1), w(M(this.rgba, r3)); }, r2.prototype.desaturate = function(r3) { return void 0 === r3 && (r3 = 0.1), w(M(this.rgba, -r3)); }, r2.prototype.grayscale = function() { return w(M(this.rgba, -1)); }, r2.prototype.lighten = function(r3) { return void 0 === r3 && (r3 = 0.1), w($(this.rgba, r3)); }, r2.prototype.darken = function(r3) { return void 0 === r3 && (r3 = 0.1), w($(this.rgba, -r3)); }, r2.prototype.rotate = function(r3) { return void 0 === r3 && (r3 = 15), this.hue(this.hue() + r3); }, r2.prototype.alpha = function(r3) { return "number" == typeof r3 ? w({ r: (t3 = this.rgba).r, g: t3.g, b: t3.b, a: r3 }) : n(this.rgba.a, 3); var t3; }, r2.prototype.hue = function(r3) { var t3 = c(this.rgba); return "number" == typeof r3 ? w({ h: r3, s: t3.s, l: t3.l, a: t3.a }) : n(t3.h); }, r2.prototype.isEqual = function(r3) { return this.toHex() === w(r3).toHex(); }, r2; })(); var w = function(r2) { return r2 instanceof j ? r2 : new j(r2); }; var S = []; var k = function(r2) { r2.forEach(function(r3) { S.indexOf(r3) < 0 && (r3(j, y), S.push(r3)); }); }; // node_modules/colord/plugins/names.mjs function names_default(e2, f2) { var a2 = { white: "#ffffff", bisque: "#ffe4c4", blue: "#0000ff", cadetblue: "#5f9ea0", chartreuse: "#7fff00", chocolate: "#d2691e", coral: "#ff7f50", antiquewhite: "#faebd7", aqua: "#00ffff", azure: "#f0ffff", whitesmoke: "#f5f5f5", papayawhip: "#ffefd5", plum: "#dda0dd", blanchedalmond: "#ffebcd", black: "#000000", gold: "#ffd700", goldenrod: "#daa520", gainsboro: "#dcdcdc", cornsilk: "#fff8dc", cornflowerblue: "#6495ed", burlywood: "#deb887", aquamarine: "#7fffd4", beige: "#f5f5dc", crimson: "#dc143c", cyan: "#00ffff", darkblue: "#00008b", darkcyan: "#008b8b", darkgoldenrod: "#b8860b", darkkhaki: "#bdb76b", darkgray: "#a9a9a9", darkgreen: "#006400", darkgrey: "#a9a9a9", peachpuff: "#ffdab9", darkmagenta: "#8b008b", darkred: "#8b0000", darkorchid: "#9932cc", darkorange: "#ff8c00", darkslateblue: "#483d8b", gray: "#808080", darkslategray: "#2f4f4f", darkslategrey: "#2f4f4f", deeppink: "#ff1493", deepskyblue: "#00bfff", wheat: "#f5deb3", firebrick: "#b22222", floralwhite: "#fffaf0", ghostwhite: "#f8f8ff", darkviolet: "#9400d3", magenta: "#ff00ff", green: "#008000", dodgerblue: "#1e90ff", grey: "#808080", honeydew: "#f0fff0", hotpink: "#ff69b4", blueviolet: "#8a2be2", forestgreen: "#228b22", lawngreen: "#7cfc00", indianred: "#cd5c5c", indigo: "#4b0082", fuchsia: "#ff00ff", brown: "#a52a2a", maroon: "#800000", mediumblue: "#0000cd", lightcoral: "#f08080", darkturquoise: "#00ced1", lightcyan: "#e0ffff", ivory: "#fffff0", lightyellow: "#ffffe0", lightsalmon: "#ffa07a", lightseagreen: "#20b2aa", linen: "#faf0e6", mediumaquamarine: "#66cdaa", lemonchiffon: "#fffacd", lime: "#00ff00", khaki: "#f0e68c", mediumseagreen: "#3cb371", limegreen: "#32cd32", mediumspringgreen: "#00fa9a", lightskyblue: "#87cefa", lightblue: "#add8e6", midnightblue: "#191970", lightpink: "#ffb6c1", mistyrose: "#ffe4e1", moccasin: "#ffe4b5", mintcream: "#f5fffa", lightslategray: "#778899", lightslategrey: "#778899", navajowhite: "#ffdead", navy: "#000080", mediumvioletred: "#c71585", powderblue: "#b0e0e6", palegoldenrod: "#eee8aa", oldlace: "#fdf5e6", paleturquoise: "#afeeee", mediumturquoise: "#48d1cc", mediumorchid: "#ba55d3", rebeccapurple: "#663399", lightsteelblue: "#b0c4de", mediumslateblue: "#7b68ee", thistle: "#d8bfd8", tan: "#d2b48c", orchid: "#da70d6", mediumpurple: "#9370db", purple: "#800080", pink: "#ffc0cb", skyblue: "#87ceeb", springgreen: "#00ff7f", palegreen: "#98fb98", red: "#ff0000", yellow: "#ffff00", slateblue: "#6a5acd", lavenderblush: "#fff0f5", peru: "#cd853f", palevioletred: "#db7093", violet: "#ee82ee", teal: "#008080", slategray: "#708090", slategrey: "#708090", aliceblue: "#f0f8ff", darkseagreen: "#8fbc8f", darkolivegreen: "#556b2f", greenyellow: "#adff2f", seagreen: "#2e8b57", seashell: "#fff5ee", tomato: "#ff6347", silver: "#c0c0c0", sienna: "#a0522d", lavender: "#e6e6fa", lightgreen: "#90ee90", orange: "#ffa500", orangered: "#ff4500", steelblue: "#4682b4", royalblue: "#4169e1", turquoise: "#40e0d0", yellowgreen: "#9acd32", salmon: "#fa8072", saddlebrown: "#8b4513", sandybrown: "#f4a460", rosybrown: "#bc8f8f", darksalmon: "#e9967a", lightgoldenrodyellow: "#fafad2", snow: "#fffafa", lightgrey: "#d3d3d3", lightgray: "#d3d3d3", dimgray: "#696969", dimgrey: "#696969", olivedrab: "#6b8e23", olive: "#808000" }, r2 = {}; for (var d2 in a2) r2[a2[d2]] = d2; var l2 = {}; e2.prototype.toName = function(f3) { if (!(this.rgba.a || this.rgba.r || this.rgba.g || this.rgba.b)) return "transparent"; var d3, i2, n2 = r2[this.toHex()]; if (n2) return n2; if (null == f3 ? void 0 : f3.closest) { var o3 = this.toRgb(), t3 = 1 / 0, b2 = "black"; if (!l2.length) for (var c2 in a2) l2[c2] = new e2(a2[c2]).toRgb(); for (var g2 in a2) { var u2 = (d3 = o3, i2 = l2[g2], Math.pow(d3.r - i2.r, 2) + Math.pow(d3.g - i2.g, 2) + Math.pow(d3.b - i2.b, 2)); u2 < t3 && (t3 = u2, b2 = g2); } return b2; } }; f2.string.push([function(f3) { var r3 = f3.toLowerCase(), d3 = "transparent" === r3 ? "#0000" : a2[r3]; return d3 ? new e2(d3).toRgb() : null; }, "name"]); } // node_modules/colord/plugins/a11y.mjs var o2 = function(o3) { var t3 = o3 / 255; return t3 < 0.04045 ? t3 / 12.92 : Math.pow((t3 + 0.055) / 1.055, 2.4); }; var t2 = function(t3) { return 0.2126 * o2(t3.r) + 0.7152 * o2(t3.g) + 0.0722 * o2(t3.b); }; function a11y_default(o3) { o3.prototype.luminance = function() { return o4 = t2(this.rgba), void 0 === (r2 = 2) && (r2 = 0), void 0 === n2 && (n2 = Math.pow(10, r2)), Math.round(n2 * o4) / n2 + 0; var o4, r2, n2; }, o3.prototype.contrast = function(r2) { void 0 === r2 && (r2 = "#FFF"); var n2, a2, i2, e2, v2, u2, d2, c2 = r2 instanceof o3 ? r2 : new o3(r2); return e2 = this.rgba, v2 = c2.toRgb(), u2 = t2(e2), d2 = t2(v2), n2 = u2 > d2 ? (u2 + 0.05) / (d2 + 0.05) : (d2 + 0.05) / (u2 + 0.05), void 0 === (a2 = 2) && (a2 = 0), void 0 === i2 && (i2 = Math.pow(10, a2)), Math.floor(i2 * n2) / i2 + 0; }, o3.prototype.isReadable = function(o4, t3) { return void 0 === o4 && (o4 = "#FFF"), void 0 === t3 && (t3 = {}), this.contrast(o4) >= (e2 = void 0 === (i2 = (r2 = t3).size) ? "normal" : i2, "AAA" === (a2 = void 0 === (n2 = r2.level) ? "AA" : n2) && "normal" === e2 ? 7 : "AA" === a2 && "large" === e2 ? 3 : 4.5); var r2, n2, a2, i2, e2; }; } // packages/blocks/build-module/api/utils.mjs var import_element = __toESM(require_element(), 1); var import_i18n2 = __toESM(require_i18n(), 1); var import_dom = __toESM(require_dom(), 1); var import_rich_text = __toESM(require_rich_text(), 1); var import_deprecated = __toESM(require_deprecated(), 1); // packages/blocks/build-module/api/constants.mjs var BLOCK_ICON_DEFAULT = "block-default"; var DEPRECATED_ENTRY_KEYS = [ "attributes", "supports", "save", "migrate", "isEligible", "apiVersion" ]; var __EXPERIMENTAL_STYLE_PROPERTY = { // Kept for back-compatibility purposes. "--wp--style--color--link": { value: ["color", "link"], support: ["color", "link"] }, aspectRatio: { value: ["dimensions", "aspectRatio"], support: ["dimensions", "aspectRatio"], useEngine: true }, background: { value: ["color", "gradient"], support: ["color", "gradients"], useEngine: true }, backgroundColor: { value: ["color", "background"], support: ["color", "background"], requiresOptOut: true, useEngine: true }, backgroundImage: { value: ["background", "backgroundImage"], support: ["background", "backgroundImage"], useEngine: true }, backgroundRepeat: { value: ["background", "backgroundRepeat"], support: ["background", "backgroundRepeat"], useEngine: true }, backgroundSize: { value: ["background", "backgroundSize"], support: ["background", "backgroundSize"], useEngine: true }, backgroundPosition: { value: ["background", "backgroundPosition"], support: ["background", "backgroundPosition"], useEngine: true }, borderColor: { value: ["border", "color"], support: ["__experimentalBorder", "color"], useEngine: true }, borderRadius: { value: ["border", "radius"], support: ["__experimentalBorder", "radius"], properties: { borderTopLeftRadius: "topLeft", borderTopRightRadius: "topRight", borderBottomLeftRadius: "bottomLeft", borderBottomRightRadius: "bottomRight" }, useEngine: true }, borderStyle: { value: ["border", "style"], support: ["__experimentalBorder", "style"], useEngine: true }, borderWidth: { value: ["border", "width"], support: ["__experimentalBorder", "width"], useEngine: true }, borderTopColor: { value: ["border", "top", "color"], support: ["__experimentalBorder", "color"], useEngine: true }, borderTopStyle: { value: ["border", "top", "style"], support: ["__experimentalBorder", "style"], useEngine: true }, borderTopWidth: { value: ["border", "top", "width"], support: ["__experimentalBorder", "width"], useEngine: true }, borderRightColor: { value: ["border", "right", "color"], support: ["__experimentalBorder", "color"], useEngine: true }, borderRightStyle: { value: ["border", "right", "style"], support: ["__experimentalBorder", "style"], useEngine: true }, borderRightWidth: { value: ["border", "right", "width"], support: ["__experimentalBorder", "width"], useEngine: true }, borderBottomColor: { value: ["border", "bottom", "color"], support: ["__experimentalBorder", "color"], useEngine: true }, borderBottomStyle: { value: ["border", "bottom", "style"], support: ["__experimentalBorder", "style"], useEngine: true }, borderBottomWidth: { value: ["border", "bottom", "width"], support: ["__experimentalBorder", "width"], useEngine: true }, borderLeftColor: { value: ["border", "left", "color"], support: ["__experimentalBorder", "color"], useEngine: true }, borderLeftStyle: { value: ["border", "left", "style"], support: ["__experimentalBorder", "style"], useEngine: true }, borderLeftWidth: { value: ["border", "left", "width"], support: ["__experimentalBorder", "width"], useEngine: true }, color: { value: ["color", "text"], support: ["color", "text"], requiresOptOut: true, useEngine: true }, columnCount: { value: ["typography", "textColumns"], support: ["typography", "textColumns"], useEngine: true }, filter: { value: ["filter", "duotone"], support: ["filter", "duotone"] }, linkColor: { value: ["elements", "link", "color", "text"], support: ["color", "link"] }, captionColor: { value: ["elements", "caption", "color", "text"], support: ["color", "caption"] }, buttonColor: { value: ["elements", "button", "color", "text"], support: ["color", "button"] }, buttonBackgroundColor: { value: ["elements", "button", "color", "background"], support: ["color", "button"] }, headingColor: { value: ["elements", "heading", "color", "text"], support: ["color", "heading"] }, headingBackgroundColor: { value: ["elements", "heading", "color", "background"], support: ["color", "heading"] }, fontFamily: { value: ["typography", "fontFamily"], support: ["typography", "__experimentalFontFamily"], useEngine: true }, fontSize: { value: ["typography", "fontSize"], support: ["typography", "fontSize"], useEngine: true }, fontStyle: { value: ["typography", "fontStyle"], support: ["typography", "__experimentalFontStyle"], useEngine: true }, fontWeight: { value: ["typography", "fontWeight"], support: ["typography", "__experimentalFontWeight"], useEngine: true }, lineHeight: { value: ["typography", "lineHeight"], support: ["typography", "lineHeight"], useEngine: true }, margin: { value: ["spacing", "margin"], support: ["spacing", "margin"], properties: { marginTop: "top", marginRight: "right", marginBottom: "bottom", marginLeft: "left" }, useEngine: true }, minHeight: { value: ["dimensions", "minHeight"], support: ["dimensions", "minHeight"], useEngine: true }, height: { value: ["dimensions", "height"], support: ["dimensions", "height"], useEngine: true }, width: { value: ["dimensions", "width"], support: ["dimensions", "width"], useEngine: true }, padding: { value: ["spacing", "padding"], support: ["spacing", "padding"], properties: { paddingTop: "top", paddingRight: "right", paddingBottom: "bottom", paddingLeft: "left" }, useEngine: true }, textAlign: { value: ["typography", "textAlign"], support: ["typography", "textAlign"], useEngine: false }, textDecoration: { value: ["typography", "textDecoration"], support: ["typography", "__experimentalTextDecoration"], useEngine: true }, textTransform: { value: ["typography", "textTransform"], support: ["typography", "__experimentalTextTransform"], useEngine: true }, letterSpacing: { value: ["typography", "letterSpacing"], support: ["typography", "__experimentalLetterSpacing"], useEngine: true }, textIndent: { value: ["typography", "textIndent"], support: ["typography", "textIndent"], useEngine: true }, writingMode: { value: ["typography", "writingMode"], support: ["typography", "__experimentalWritingMode"], useEngine: true }, "--wp--style--root--padding": { value: ["spacing", "padding"], support: ["spacing", "padding"], properties: { "--wp--style--root--padding-top": "top", "--wp--style--root--padding-right": "right", "--wp--style--root--padding-bottom": "bottom", "--wp--style--root--padding-left": "left" }, rootOnly: true } }; var __EXPERIMENTAL_ELEMENTS = { link: "a:where(:not(.wp-element-button))", heading: "h1, h2, h3, h4, h5, h6", h1: "h1", h2: "h2", h3: "h3", h4: "h4", h5: "h5", h6: "h6", button: ".wp-element-button, .wp-block-button__link", caption: ".wp-element-caption, .wp-block-audio figcaption, .wp-block-embed figcaption, .wp-block-gallery figcaption, .wp-block-image figcaption, .wp-block-table figcaption, .wp-block-video figcaption", cite: "cite", select: "select", textInput: "textarea, input:where([type=email],[type=number],[type=password],[type=search],[type=tel],[type=text],[type=url])" }; var __EXPERIMENTAL_PATHS_WITH_OVERRIDE = { "color.duotone": true, "color.gradients": true, "color.palette": true, "dimensions.aspectRatios": true, "typography.fontSizes": true, "spacing.spacingSizes": true }; // packages/blocks/build-module/api/registration.mjs var import_data = __toESM(require_data(), 1); var import_i18n = __toESM(require_i18n(), 1); var import_warning = __toESM(require_warning(), 1); // packages/blocks/build-module/api/i18n-block.json var i18n_block_default = { title: "block title", description: "block description", keywords: ["block keyword"], styles: [ { label: "block style label" } ], variations: [ { title: "block variation title", description: "block variation description", keywords: ["block variation keyword"] } ] }; // packages/blocks/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/blocks" ); // packages/blocks/build-module/api/registration.mjs function isObject(object) { return object !== null && typeof object === "object"; } function unstable__bootstrapServerSideBlockDefinitions(definitions) { const { addBootstrappedBlockType: addBootstrappedBlockType2 } = unlock((0, import_data.dispatch)(store)); for (const [name, blockType] of Object.entries(definitions)) { addBootstrappedBlockType2(name, blockType); } } function getBlockSettingsFromMetadata({ textdomain, ...metadata }) { const allowedFields = [ "apiVersion", "title", "category", "parent", "ancestor", "icon", "description", "keywords", "attributes", "providesContext", "usesContext", "selectors", "supports", "styles", "example", "variations", "blockHooks", "allowedBlocks" ]; const settings = Object.fromEntries( Object.entries(metadata).filter( ([key]) => allowedFields.includes(key) ) ); if (textdomain) { Object.keys(i18n_block_default).forEach((key) => { if (!settings[key]) { return; } settings[key] = translateBlockSettingUsingI18nSchema( i18n_block_default[key], settings[key], textdomain ); }); } return settings; } function registerBlockType(blockNameOrMetadata, settings) { const name = isObject(blockNameOrMetadata) ? blockNameOrMetadata.name : blockNameOrMetadata; if (typeof name !== "string") { (0, import_warning.default)("Block names must be strings."); return; } if (!/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(name)) { (0, import_warning.default)( "Block names must contain a namespace prefix, include only lowercase alphanumeric characters or dashes, and start with a letter. Example: my-plugin/my-custom-block" ); return; } if ((0, import_data.select)(store).getBlockType(name)) { (0, import_warning.default)('Block "' + name + '" is already registered.'); return; } const { addBootstrappedBlockType: addBootstrappedBlockType2, addUnprocessedBlockType: addUnprocessedBlockType2 } = unlock( (0, import_data.dispatch)(store) ); if (isObject(blockNameOrMetadata)) { const metadata = getBlockSettingsFromMetadata(blockNameOrMetadata); addBootstrappedBlockType2(name, metadata); } addUnprocessedBlockType2(name, settings); return (0, import_data.select)(store).getBlockType(name); } function translateBlockSettingUsingI18nSchema(i18nSchema, settingValue, textdomain) { if (typeof i18nSchema === "string" && typeof settingValue === "string") { return (0, import_i18n._x)(settingValue, i18nSchema, textdomain); } if (Array.isArray(i18nSchema) && i18nSchema.length && Array.isArray(settingValue)) { return settingValue.map( (value) => translateBlockSettingUsingI18nSchema( i18nSchema[0], value, textdomain ) ); } if (isObject(i18nSchema) && Object.entries(i18nSchema).length && isObject(settingValue)) { return Object.keys(settingValue).reduce((accumulator, key) => { if (!i18nSchema[key]) { accumulator[key] = settingValue[key]; return accumulator; } accumulator[key] = translateBlockSettingUsingI18nSchema( i18nSchema[key], settingValue[key], textdomain ); return accumulator; }, {}); } return settingValue; } function registerBlockCollection(namespace, { title, icon }) { (0, import_data.dispatch)(store).addBlockCollection(namespace, title, icon); } function unregisterBlockType(name) { const oldBlock = (0, import_data.select)(store).getBlockType(name); if (!oldBlock) { (0, import_warning.default)('Block "' + name + '" is not registered.'); return; } (0, import_data.dispatch)(store).removeBlockTypes(name); return oldBlock; } function setFreeformContentHandlerName(blockName) { (0, import_data.dispatch)(store).setFreeformFallbackBlockName(blockName); } function getFreeformContentHandlerName() { return (0, import_data.select)(store).getFreeformFallbackBlockName(); } function getGroupingBlockName() { return (0, import_data.select)(store).getGroupingBlockName(); } function setUnregisteredTypeHandlerName(blockName) { (0, import_data.dispatch)(store).setUnregisteredFallbackBlockName(blockName); } function getUnregisteredTypeHandlerName() { return (0, import_data.select)(store).getUnregisteredFallbackBlockName(); } function setDefaultBlockName(name) { (0, import_data.dispatch)(store).setDefaultBlockName(name); } function setGroupingBlockName(name) { (0, import_data.dispatch)(store).setGroupingBlockName(name); } function getDefaultBlockName() { return (0, import_data.select)(store).getDefaultBlockName(); } function getBlockType(name) { return (0, import_data.select)(store)?.getBlockType(name); } function getBlockTypes() { return (0, import_data.select)(store).getBlockTypes(); } function getBlockSupport(nameOrType, feature, defaultSupports) { return (0, import_data.select)(store).getBlockSupport( nameOrType, feature, defaultSupports ); } function hasBlockSupport(nameOrType, feature, defaultSupports) { return (0, import_data.select)(store).hasBlockSupport( nameOrType, feature, defaultSupports ); } function isReusableBlock(blockOrType) { return blockOrType?.name === "core/block"; } function isTemplatePart(blockOrType) { return blockOrType?.name === "core/template-part"; } var getChildBlockNames = (blockName) => { return (0, import_data.select)(store).getChildBlockNames(blockName); }; var hasChildBlocks = (blockName) => { return (0, import_data.select)(store).hasChildBlocks(blockName); }; var hasChildBlocksWithInserterSupport = (blockName) => { return (0, import_data.select)(store).hasChildBlocksWithInserterSupport(blockName); }; var registerBlockStyle = (blockNames, styleVariation) => { (0, import_data.dispatch)(store).addBlockStyles(blockNames, styleVariation); }; var unregisterBlockStyle = (blockName, styleVariationName) => { (0, import_data.dispatch)(store).removeBlockStyles(blockName, styleVariationName); }; var getBlockVariations = (blockName, scope) => { return (0, import_data.select)(store).getBlockVariations(blockName, scope); }; var registerBlockVariation = (blockName, variation) => { if (typeof variation.name !== "string") { (0, import_warning.default)("Variation names must be unique strings."); } (0, import_data.dispatch)(store).addBlockVariations(blockName, variation); }; var unregisterBlockVariation = (blockName, variationName) => { (0, import_data.dispatch)(store).removeBlockVariations(blockName, variationName); }; var registerBlockBindingsSource = (source) => { const { name, label, usesContext, getValues, setValues, canUserEditValue, getFieldsList } = source; const existingSource = unlock( (0, import_data.select)(store) ).getBlockBindingsSource(name); const serverProps = ["label", "usesContext"]; for (const prop2 in existingSource) { if (!serverProps.includes(prop2) && existingSource[prop2]) { (0, import_warning.default)( 'Block bindings source "' + name + '" is already registered.' ); return; } } if (!name) { (0, import_warning.default)("Block bindings source must contain a name."); return; } if (typeof name !== "string") { (0, import_warning.default)("Block bindings source name must be a string."); return; } if (/[A-Z]+/.test(name)) { (0, import_warning.default)( "Block bindings source name must not contain uppercase characters." ); return; } if (!/^[a-z0-9/-]+$/.test(name)) { (0, import_warning.default)( "Block bindings source name must contain only valid characters: lowercase characters, hyphens, or digits. Example: my-plugin/my-custom-source." ); return; } if (!/^[a-z0-9-]+\/[a-z0-9-]+$/.test(name)) { (0, import_warning.default)( "Block bindings source name must contain a namespace and valid characters. Example: my-plugin/my-custom-source." ); return; } if (!label && !existingSource?.label) { (0, import_warning.default)("Block bindings source must contain a label."); return; } if (label && typeof label !== "string") { (0, import_warning.default)("Block bindings source label must be a string."); return; } if (label && existingSource?.label && label !== existingSource?.label) { (0, import_warning.default)('Block bindings "' + name + '" source label was overridden.'); } if (usesContext && !Array.isArray(usesContext)) { (0, import_warning.default)("Block bindings source usesContext must be an array."); return; } if (getValues && typeof getValues !== "function") { (0, import_warning.default)("Block bindings source getValues must be a function."); return; } if (setValues && typeof setValues !== "function") { (0, import_warning.default)("Block bindings source setValues must be a function."); return; } if (canUserEditValue && typeof canUserEditValue !== "function") { (0, import_warning.default)("Block bindings source canUserEditValue must be a function."); return; } if (getFieldsList && typeof getFieldsList !== "function") { (0, import_warning.default)("Block bindings source getFieldsList must be a function."); return; } return unlock((0, import_data.dispatch)(store)).addBlockBindingsSource(source); }; function unregisterBlockBindingsSource(name) { const oldSource = getBlockBindingsSource(name); if (!oldSource) { (0, import_warning.default)('Block bindings source "' + name + '" is not registered.'); return; } unlock((0, import_data.dispatch)(store)).removeBlockBindingsSource(name); } function getBlockBindingsSource(name) { return unlock((0, import_data.select)(store)).getBlockBindingsSource(name); } function getBlockBindingsSources() { return unlock((0, import_data.select)(store)).getAllBlockBindingsSources(); } // packages/blocks/build-module/api/utils.mjs k([names_default, a11y_default]); var ICON_COLORS = ["#191e23", "#f8f9f9"]; function isUnmodifiedBlock(block, role) { const blockAttributes = getBlockType(block.name)?.attributes ?? {}; const attributesByRole = role ? Object.entries(blockAttributes).filter(([key, definition]) => { if (role === "content" && key === "metadata") { return Object.keys(block.attributes[key]?.bindings ?? {}).length > 0; } return definition.role === role || definition.__experimentalRole === role; }) : []; const attributesToCheck = !!attributesByRole.length ? attributesByRole : Object.entries(blockAttributes); return attributesToCheck.every(([key, definition]) => { const value = block.attributes[key]; if (definition.hasOwnProperty("default")) { return value === definition.default; } if (definition.type === "rich-text") { return !value?.length; } return value === void 0; }); } function isUnmodifiedDefaultBlock(block, role) { return block.name === getDefaultBlockName() && isUnmodifiedBlock(block, role); } function isValidIcon(icon) { return !!icon && (typeof icon === "string" || (0, import_element.isValidElement)(icon) || typeof icon === "function" || icon instanceof import_element.Component); } function normalizeIconObject(icon) { icon = icon || BLOCK_ICON_DEFAULT; if (isValidIcon(icon)) { return { src: icon }; } if ("background" in icon) { const colordBgColor = w(icon.background); const getColorContrast = (iconColor) => colordBgColor.contrast(iconColor); const maxContrast = Math.max(...ICON_COLORS.map(getColorContrast)); return { ...icon, foreground: icon.foreground ? icon.foreground : ICON_COLORS.find( (iconColor) => getColorContrast(iconColor) === maxContrast ), shadowColor: colordBgColor.alpha(0.3).toRgbString() }; } return icon; } function normalizeBlockType(blockTypeOrName) { if (typeof blockTypeOrName === "string") { return getBlockType(blockTypeOrName); } return blockTypeOrName; } function getBlockLabel(blockType, attributes, context = "visual") { const { __experimentalLabel: getLabel, title } = blockType; const label = getLabel && getLabel(attributes, { context }); if (!label) { return title; } if (label.toPlainText) { return label.toPlainText(); } return (0, import_dom.__unstableStripHTML)(label); } function getAccessibleBlockLabel(blockType, attributes, position, direction = "vertical") { const title = blockType?.title; const label = blockType ? getBlockLabel(blockType, attributes, "accessibility") : ""; const hasPosition = position !== void 0; const hasLabel = label && label !== title; if (hasPosition && direction === "vertical") { if (hasLabel) { return (0, import_i18n2.sprintf)( /* translators: accessibility text. 1: The block title. 2: The block row number. 3: The block label.. */ (0, import_i18n2.__)("%1$s Block. Row %2$d. %3$s"), title, position, label ); } return (0, import_i18n2.sprintf)( /* translators: accessibility text. 1: The block title. 2: The block row number. */ (0, import_i18n2.__)("%1$s Block. Row %2$d"), title, position ); } else if (hasPosition && direction === "horizontal") { if (hasLabel) { return (0, import_i18n2.sprintf)( /* translators: accessibility text. 1: The block title. 2: The block column number. 3: The block label.. */ (0, import_i18n2.__)("%1$s Block. Column %2$d. %3$s"), title, position, label ); } return (0, import_i18n2.sprintf)( /* translators: accessibility text. 1: The block title. 2: The block column number. */ (0, import_i18n2.__)("%1$s Block. Column %2$d"), title, position ); } if (hasLabel) { return (0, import_i18n2.sprintf)( /* translators: accessibility text. 1: The block title. 2: The block label. */ (0, import_i18n2.__)("%1$s Block. %2$s"), title, label ); } return (0, import_i18n2.sprintf)( /* translators: accessibility text. %s: The block title. */ (0, import_i18n2.__)("%s Block"), title ); } function getDefault(attributeSchema) { if (attributeSchema.default !== void 0) { return attributeSchema.default; } if (attributeSchema.type === "rich-text") { return new import_rich_text.RichTextData(); } } function isBlockRegistered(name) { return getBlockType(name) !== void 0; } function __experimentalSanitizeBlockAttributes(name, attributes) { const blockType = getBlockType(name); if (void 0 === blockType) { throw new Error(`Block type '${name}' is not registered.`); } return Object.entries(blockType.attributes).reduce( (accumulator, [key, schema]) => { const value = attributes[key]; if (void 0 !== value) { if (schema.type === "rich-text") { if (value instanceof import_rich_text.RichTextData) { accumulator[key] = value; } else if (typeof value === "string") { accumulator[key] = import_rich_text.RichTextData.fromHTMLString(value); } } else if (schema.type === "string" && value instanceof import_rich_text.RichTextData) { accumulator[key] = value.toHTMLString(); } else { accumulator[key] = value; } } else { const _default = getDefault(schema); if (void 0 !== _default) { accumulator[key] = _default; } } if (["node", "children"].indexOf(schema.source) !== -1) { if (typeof accumulator[key] === "string") { accumulator[key] = [accumulator[key]]; } else if (!Array.isArray(accumulator[key])) { accumulator[key] = []; } } return accumulator; }, {} ); } function getBlockAttributesNamesByRole(name, role) { const attributes = getBlockType(name)?.attributes; if (!attributes) { return []; } const attributesNames = Object.keys(attributes); if (!role) { return attributesNames; } return attributesNames.filter((attributeName) => { const attribute = attributes[attributeName]; if (attribute?.role === role) { return true; } if (attribute?.__experimentalRole === role) { (0, import_deprecated.default)("__experimentalRole attribute", { since: "6.7", version: "6.8", alternative: "role attribute", hint: `Check the block.json of the ${name} block.` }); return true; } return false; }); } var __experimentalGetBlockAttributesNamesByRole = (...args) => { (0, import_deprecated.default)("__experimentalGetBlockAttributesNamesByRole", { since: "6.7", version: "6.8", alternative: "getBlockAttributesNamesByRole" }); return getBlockAttributesNamesByRole(...args); }; function isContentBlock(name) { const blockType = getBlockType(name); const attributes = blockType?.attributes; const supportsContentRole = blockType?.supports?.contentRole; if (supportsContentRole) { return true; } if (!attributes) { return false; } return !!Object.keys(attributes)?.some((attributeKey) => { const attribute = attributes[attributeKey]; return attribute?.role === "content" || attribute?.__experimentalRole === "content"; }); } function omit(object, keys) { return Object.fromEntries( Object.entries(object).filter(([key]) => !keys.includes(key)) ); } // packages/blocks/build-module/store/reducer.mjs var DEFAULT_CATEGORIES = [ { slug: "text", title: (0, import_i18n3.__)("Text") }, { slug: "media", title: (0, import_i18n3.__)("Media") }, { slug: "design", title: (0, import_i18n3.__)("Design") }, { slug: "widgets", title: (0, import_i18n3.__)("Widgets") }, { slug: "theme", title: (0, import_i18n3.__)("Theme") }, { slug: "embed", title: (0, import_i18n3.__)("Embeds") }, { slug: "reusable", title: (0, import_i18n3.__)("Reusable blocks") } ]; function keyBlockTypesByName(types) { return types.reduce( (newBlockTypes, block) => ({ ...newBlockTypes, [block.name]: block }), {} ); } function getUniqueItemsByName(items) { return items.reduce((acc, currentItem) => { if (!acc.some((item) => item.name === currentItem.name)) { acc.push(currentItem); } return acc; }, []); } function bootstrappedBlockTypes(state = {}, action) { switch (action.type) { case "ADD_BOOTSTRAPPED_BLOCK_TYPE": const { name, blockType } = action; const serverDefinition = state[name]; if (serverDefinition) { return state; } const newDefinition = Object.fromEntries( Object.entries(blockType).filter( ([, value]) => value !== null && value !== void 0 ).map(([key, value]) => [camelCase(key), value]) ); newDefinition.name = name; return { ...state, [name]: newDefinition }; case "REMOVE_BLOCK_TYPES": return omit(state, action.names); } return state; } function unprocessedBlockTypes(state = {}, action) { switch (action.type) { case "ADD_UNPROCESSED_BLOCK_TYPE": return { ...state, [action.name]: action.blockType }; case "REMOVE_BLOCK_TYPES": return omit(state, action.names); } return state; } function blockTypes(state = {}, action) { switch (action.type) { case "ADD_BLOCK_TYPES": return { ...state, ...keyBlockTypesByName(action.blockTypes) }; case "REMOVE_BLOCK_TYPES": return omit(state, action.names); } return state; } function blockStyles(state = {}, action) { switch (action.type) { case "ADD_BLOCK_TYPES": return { ...state, ...Object.fromEntries( Object.entries( keyBlockTypesByName(action.blockTypes) ).map(([name, blockType]) => [ name, getUniqueItemsByName([ ...(blockType.styles ?? []).map((style) => ({ ...style, source: "block" })), ...(state[blockType.name] ?? []).filter( ({ source }) => "block" !== source ) ]) ]) ) }; case "ADD_BLOCK_STYLES": const updatedStyles = {}; action.blockNames.forEach((blockName) => { updatedStyles[blockName] = getUniqueItemsByName([ ...state[blockName] ?? [], ...action.styles ]); }); return { ...state, ...updatedStyles }; case "REMOVE_BLOCK_STYLES": return { ...state, [action.blockName]: (state[action.blockName] ?? []).filter( (style) => action.styleNames.indexOf(style.name) === -1 ) }; } return state; } function blockVariations(state = {}, action) { switch (action.type) { case "ADD_BLOCK_TYPES": return { ...state, ...Object.fromEntries( Object.entries( keyBlockTypesByName(action.blockTypes) ).map(([name, blockType]) => { return [ name, getUniqueItemsByName([ ...(blockType.variations ?? []).map( (variation) => ({ ...variation, source: "block" }) ), ...(state[blockType.name] ?? []).filter( ({ source }) => "block" !== source ) ]) ]; }) ) }; case "ADD_BLOCK_VARIATIONS": return { ...state, [action.blockName]: getUniqueItemsByName([ ...state[action.blockName] ?? [], ...action.variations ]) }; case "REMOVE_BLOCK_VARIATIONS": return { ...state, [action.blockName]: (state[action.blockName] ?? []).filter( (variation) => action.variationNames.indexOf(variation.name) === -1 ) }; } return state; } function createBlockNameSetterReducer(setActionType) { return (state = null, action) => { switch (action.type) { case "REMOVE_BLOCK_TYPES": if (action.names.indexOf(state) !== -1) { return null; } return state; case setActionType: return action.name || null; } return state; }; } var defaultBlockName = createBlockNameSetterReducer( "SET_DEFAULT_BLOCK_NAME" ); var freeformFallbackBlockName = createBlockNameSetterReducer( "SET_FREEFORM_FALLBACK_BLOCK_NAME" ); var unregisteredFallbackBlockName = createBlockNameSetterReducer( "SET_UNREGISTERED_FALLBACK_BLOCK_NAME" ); var groupingBlockName = createBlockNameSetterReducer( "SET_GROUPING_BLOCK_NAME" ); function categories(state = DEFAULT_CATEGORIES, action) { switch (action.type) { case "SET_CATEGORIES": const uniqueCategories = /* @__PURE__ */ new Map(); (action.categories || []).forEach((category) => { uniqueCategories.set(category.slug, category); }); return [...uniqueCategories.values()]; case "UPDATE_CATEGORY": { if (!action.category || !Object.keys(action.category).length) { return state; } const categoryToChange = state.find( ({ slug }) => slug === action.slug ); if (categoryToChange) { return state.map((category) => { if (category.slug === action.slug) { return { ...category, ...action.category }; } return category; }); } } } return state; } function collections(state = {}, action) { switch (action.type) { case "ADD_BLOCK_COLLECTION": return { ...state, [action.namespace]: { title: action.title, icon: action.icon } }; case "REMOVE_BLOCK_COLLECTION": return omit(state, action.namespace); } return state; } function getMergedUsesContext(existingUsesContext = [], newUsesContext = []) { const mergedArrays = Array.from( new Set(existingUsesContext.concat(newUsesContext)) ); return mergedArrays.length > 0 ? mergedArrays : void 0; } function blockBindingsSources(state = {}, action) { switch (action.type) { case "ADD_BLOCK_BINDINGS_SOURCE": return { ...state, [action.name]: { label: action.label || state[action.name]?.label, usesContext: getMergedUsesContext( state[action.name]?.usesContext, action.usesContext ), getValues: action.getValues, setValues: action.setValues, // Only set `canUserEditValue` if `setValues` is also defined. canUserEditValue: action.setValues && action.canUserEditValue, getFieldsList: action.getFieldsList } }; case "REMOVE_BLOCK_BINDINGS_SOURCE": return omit(state, action.name); } return state; } var reducer_default = (0, import_data2.combineReducers)({ bootstrappedBlockTypes, unprocessedBlockTypes, blockTypes, blockStyles, blockVariations, defaultBlockName, freeformFallbackBlockName, unregisteredFallbackBlockName, groupingBlockName, categories, collections, blockBindingsSources }); // packages/blocks/build-module/store/selectors.mjs var selectors_exports = {}; __export(selectors_exports, { __experimentalHasContentRoleAttribute: () => __experimentalHasContentRoleAttribute, getActiveBlockVariation: () => getActiveBlockVariation, getBlockStyles: () => getBlockStyles, getBlockSupport: () => getBlockSupport2, getBlockType: () => getBlockType2, getBlockTypes: () => getBlockTypes2, getBlockVariations: () => getBlockVariations2, getCategories: () => getCategories, getChildBlockNames: () => getChildBlockNames2, getCollections: () => getCollections, getDefaultBlockName: () => getDefaultBlockName2, getDefaultBlockVariation: () => getDefaultBlockVariation, getFreeformFallbackBlockName: () => getFreeformFallbackBlockName, getGroupingBlockName: () => getGroupingBlockName2, getUnregisteredFallbackBlockName: () => getUnregisteredFallbackBlockName, hasBlockSupport: () => hasBlockSupport2, hasChildBlocks: () => hasChildBlocks2, hasChildBlocksWithInserterSupport: () => hasChildBlocksWithInserterSupport2, isMatchingSearchTerm: () => isMatchingSearchTerm }); var import_remove_accents = __toESM(require_remove_accents(), 1); var import_data4 = __toESM(require_data(), 1); var import_rich_text2 = __toESM(require_rich_text(), 1); var import_deprecated3 = __toESM(require_deprecated(), 1); // packages/blocks/build-module/store/utils.mjs var getValueFromObjectPath = (object, path, defaultValue) => { const normalizedPath = Array.isArray(path) ? path : path.split("."); let value = object; normalizedPath.forEach((fieldName) => { value = value?.[fieldName]; }); return value ?? defaultValue; }; function isObject2(candidate) { return typeof candidate === "object" && candidate.constructor === Object && candidate !== null; } function matchesAttributes(blockAttributes, variationAttributes) { if (isObject2(blockAttributes) && isObject2(variationAttributes)) { return Object.entries(variationAttributes).every( ([key, value]) => matchesAttributes(blockAttributes?.[key], value) ); } return blockAttributes === variationAttributes; } // packages/blocks/build-module/store/private-selectors.mjs var private_selectors_exports = {}; __export(private_selectors_exports, { getAllBlockBindingsSources: () => getAllBlockBindingsSources, getBlockBindingsSource: () => getBlockBindingsSource2, getBlockBindingsSourceFieldsList: () => getBlockBindingsSourceFieldsList, getBootstrappedBlockType: () => getBootstrappedBlockType, getSupportedStyles: () => getSupportedStyles, getUnprocessedBlockTypes: () => getUnprocessedBlockTypes, hasContentRoleAttribute: () => hasContentRoleAttribute }); var import_data3 = __toESM(require_data(), 1); var import_deprecated2 = __toESM(require_deprecated(), 1); var ROOT_BLOCK_SUPPORTS = [ "background", "backgroundColor", "color", "linkColor", "captionColor", "buttonColor", "headingColor", "fontFamily", "fontSize", "fontStyle", "fontWeight", "lineHeight", "padding", "contentSize", "wideSize", "blockGap", "textAlign", "textDecoration", "textIndent", "textTransform", "letterSpacing" ]; function filterElementBlockSupports(blockSupports, name, element) { return blockSupports.filter((support) => { if (support === "fontSize" && element === "heading") { return false; } if (support === "textDecoration" && !name && element !== "link") { return false; } if (support === "textTransform" && !name && !(["heading", "h1", "h2", "h3", "h4", "h5", "h6"].includes( element ) || element === "button" || element === "caption" || element === "text")) { return false; } if (support === "letterSpacing" && !name && !(["heading", "h1", "h2", "h3", "h4", "h5", "h6"].includes( element ) || element === "button" || element === "caption" || element === "text")) { return false; } if (support === "textIndent" && !name) { return false; } if (support === "textColumns" && !name) { return false; } return true; }); } var getSupportedStyles = (0, import_data3.createSelector)( (state, name, element) => { if (!name) { return filterElementBlockSupports( ROOT_BLOCK_SUPPORTS, name, element ); } const blockType = getBlockType2(state, name); if (!blockType) { return []; } const supportKeys = []; if (blockType?.supports?.spacing?.blockGap) { supportKeys.push("blockGap"); } if (blockType?.supports?.shadow) { supportKeys.push("shadow"); } Object.keys(__EXPERIMENTAL_STYLE_PROPERTY).forEach((styleName) => { if (!__EXPERIMENTAL_STYLE_PROPERTY[styleName].support) { return; } if (__EXPERIMENTAL_STYLE_PROPERTY[styleName].requiresOptOut) { if (__EXPERIMENTAL_STYLE_PROPERTY[styleName].support[0] in blockType.supports && getValueFromObjectPath( blockType.supports, __EXPERIMENTAL_STYLE_PROPERTY[styleName].support ) !== false) { supportKeys.push(styleName); return; } } if (getValueFromObjectPath( blockType.supports, __EXPERIMENTAL_STYLE_PROPERTY[styleName].support, false )) { supportKeys.push(styleName); } }); return filterElementBlockSupports(supportKeys, name, element); }, (state, name) => [state.blockTypes[name]] ); function getBootstrappedBlockType(state, name) { return state.bootstrappedBlockTypes[name]; } function getUnprocessedBlockTypes(state) { return state.unprocessedBlockTypes; } function getAllBlockBindingsSources(state) { return state.blockBindingsSources; } function getBlockBindingsSource2(state, sourceName) { return state.blockBindingsSources[sourceName]; } var getBlockBindingsSourceFieldsList = (0, import_data3.createRegistrySelector)( (select3) => (0, import_data3.createSelector)( (state, source, blockContext) => { if (!source.getFieldsList) { return []; } const context = {}; if (source?.usesContext?.length) { for (const key of source.usesContext) { context[key] = blockContext[key]; } } return source.getFieldsList({ select: select3, context }); }, (state, source, blockContext) => [ source.getFieldsList, source.usesContext, blockContext ] ) ); var hasContentRoleAttribute = (state, blockTypeName) => { const blockType = getBlockType2(state, blockTypeName); if (!blockType) { return false; } return Object.values(blockType.attributes).some( ({ role, __experimentalRole }) => { if (role === "content") { return true; } if (__experimentalRole === "content") { (0, import_deprecated2.default)("__experimentalRole attribute", { since: "6.7", version: "6.8", alternative: "role attribute", hint: `Check the block.json of the ${blockTypeName} block.` }); return true; } return false; } ); }; // packages/blocks/build-module/store/selectors.mjs var getNormalizedBlockType = (state, nameOrType) => "string" === typeof nameOrType ? getBlockType2(state, nameOrType) : nameOrType; var getBlockTypes2 = (0, import_data4.createSelector)( (state) => Object.values(state.blockTypes), (state) => [state.blockTypes] ); function getBlockType2(state, name) { return state.blockTypes[name]; } function getBlockStyles(state, name) { return state.blockStyles[name]; } var getBlockVariations2 = (0, import_data4.createSelector)( (state, blockName, scope) => { const variations = state.blockVariations[blockName]; if (!variations || !scope) { return variations; } return variations.filter((variation) => { return (variation.scope || ["block", "inserter"]).includes( scope ); }); }, (state, blockName) => [state.blockVariations[blockName]] ); function getActiveBlockVariation(state, blockName, attributes, scope) { const variations = getBlockVariations2(state, blockName, scope); if (!variations) { return variations; } const blockType = getBlockType2(state, blockName); const attributeKeys = Object.keys(blockType?.attributes || {}); let match; let maxMatchedAttributes = 0; for (const variation of variations) { if (Array.isArray(variation.isActive)) { const definedAttributes = variation.isActive.filter( (attribute) => { const topLevelAttribute = attribute.split(".")[0]; return attributeKeys.includes(topLevelAttribute); } ); const definedAttributesLength = definedAttributes.length; if (definedAttributesLength === 0) { continue; } const isMatch = definedAttributes.every((attribute) => { const variationAttributeValue = getValueFromObjectPath( variation.attributes, attribute ); if (variationAttributeValue === void 0) { return false; } let blockAttributeValue = getValueFromObjectPath( attributes, attribute ); if (blockAttributeValue instanceof import_rich_text2.RichTextData) { blockAttributeValue = blockAttributeValue.toHTMLString(); } return matchesAttributes( blockAttributeValue, variationAttributeValue ); }); if (isMatch && definedAttributesLength > maxMatchedAttributes) { match = variation; maxMatchedAttributes = definedAttributesLength; } } else if (variation.isActive?.(attributes, variation.attributes)) { return match || variation; } } if (!match && ["block", "transform"].includes(scope)) { match = variations.find( (variation) => variation?.isDefault && !Object.hasOwn(variation, "isActive") ); } return match; } function getDefaultBlockVariation(state, blockName, scope) { const variations = getBlockVariations2(state, blockName, scope); const defaultVariation = [...variations].reverse().find(({ isDefault }) => !!isDefault); return defaultVariation || variations[0]; } function getCategories(state) { return state.categories; } function getCollections(state) { return state.collections; } function getDefaultBlockName2(state) { return state.defaultBlockName; } function getFreeformFallbackBlockName(state) { return state.freeformFallbackBlockName; } function getUnregisteredFallbackBlockName(state) { return state.unregisteredFallbackBlockName; } function getGroupingBlockName2(state) { return state.groupingBlockName; } var getChildBlockNames2 = (0, import_data4.createSelector)( (state, blockName) => { return getBlockTypes2(state).filter((blockType) => { return blockType.parent?.includes(blockName); }).map(({ name }) => name); }, (state) => [state.blockTypes] ); var getBlockSupport2 = (state, nameOrType, feature, defaultSupports) => { const blockType = getNormalizedBlockType(state, nameOrType); if (!blockType?.supports) { return defaultSupports; } return getValueFromObjectPath( blockType.supports, feature, defaultSupports ); }; function hasBlockSupport2(state, nameOrType, feature, defaultSupports) { return !!getBlockSupport2(state, nameOrType, feature, defaultSupports); } function getNormalizedSearchTerm(term) { return (0, import_remove_accents.default)(term ?? "").toLowerCase().trim(); } function isMatchingSearchTerm(state, nameOrType, searchTerm = "") { const blockType = getNormalizedBlockType(state, nameOrType); const normalizedSearchTerm = getNormalizedSearchTerm(searchTerm); const isSearchMatch = (candidate) => getNormalizedSearchTerm(candidate).includes(normalizedSearchTerm); return isSearchMatch(blockType.title) || blockType.keywords?.some(isSearchMatch) || isSearchMatch(blockType.category) || typeof blockType.description === "string" && isSearchMatch(blockType.description); } var hasChildBlocks2 = (state, blockName) => { return getChildBlockNames2(state, blockName).length > 0; }; var hasChildBlocksWithInserterSupport2 = (state, blockName) => { return getChildBlockNames2(state, blockName).some((childBlockName) => { return hasBlockSupport2(state, childBlockName, "inserter", true); }); }; var __experimentalHasContentRoleAttribute = (...args) => { (0, import_deprecated3.default)("__experimentalHasContentRoleAttribute", { since: "6.7", version: "6.8", hint: "This is a private selector." }); return hasContentRoleAttribute(...args); }; // packages/blocks/build-module/store/actions.mjs var actions_exports = {}; __export(actions_exports, { __experimentalReapplyBlockFilters: () => __experimentalReapplyBlockFilters, addBlockCollection: () => addBlockCollection, addBlockStyles: () => addBlockStyles, addBlockTypes: () => addBlockTypes, addBlockVariations: () => addBlockVariations, reapplyBlockTypeFilters: () => reapplyBlockTypeFilters, removeBlockCollection: () => removeBlockCollection, removeBlockStyles: () => removeBlockStyles, removeBlockTypes: () => removeBlockTypes, removeBlockVariations: () => removeBlockVariations, setCategories: () => setCategories, setDefaultBlockName: () => setDefaultBlockName2, setFreeformFallbackBlockName: () => setFreeformFallbackBlockName, setGroupingBlockName: () => setGroupingBlockName2, setUnregisteredFallbackBlockName: () => setUnregisteredFallbackBlockName, updateCategory: () => updateCategory }); var import_deprecated5 = __toESM(require_deprecated(), 1); // node_modules/is-plain-object/dist/is-plain-object.mjs function isObject3(o3) { return Object.prototype.toString.call(o3) === "[object Object]"; } function isPlainObject(o3) { var ctor, prot; if (isObject3(o3) === false) return false; ctor = o3.constructor; if (ctor === void 0) return true; prot = ctor.prototype; if (isObject3(prot) === false) return false; if (prot.hasOwnProperty("isPrototypeOf") === false) { return false; } return true; } // packages/blocks/build-module/store/process-block-type.mjs var import_react_is = __toESM(require_react_is(), 1); var import_deprecated4 = __toESM(require_deprecated(), 1); var import_hooks = __toESM(require_hooks(), 1); var import_warning2 = __toESM(require_warning(), 1); var LEGACY_CATEGORY_MAPPING = { common: "text", formatting: "text", layout: "design" }; function mergeBlockVariations(bootstrappedVariations = [], clientVariations = []) { const result = [...bootstrappedVariations]; clientVariations.forEach((clientVariation) => { const index = result.findIndex( (bootstrappedVariation) => bootstrappedVariation.name === clientVariation.name ); if (index !== -1) { result[index] = { ...result[index], ...clientVariation }; } else { result.push(clientVariation); } }); return result; } var processBlockType = (name, blockSettings) => ({ select: select3 }) => { const bootstrappedBlockType = select3.getBootstrappedBlockType(name); const blockType = { apiVersion: 1, name, icon: BLOCK_ICON_DEFAULT, keywords: [], attributes: {}, providesContext: {}, usesContext: [], selectors: {}, supports: {}, styles: [], blockHooks: {}, save: () => null, ...bootstrappedBlockType, ...blockSettings, // blockType.variations can be defined as a filePath. variations: mergeBlockVariations( Array.isArray(bootstrappedBlockType?.variations) ? bootstrappedBlockType.variations : [], Array.isArray(blockSettings?.variations) ? blockSettings.variations : [] ) }; if (!blockType.attributes || typeof blockType.attributes !== "object") { (0, import_warning2.default)( 'The block "' + name + '" is registering attributes as `null` or `undefined`. Use an empty object (`attributes: {}`) or exclude the `attributes` key.' ); blockType.attributes = {}; } const settings = (0, import_hooks.applyFilters)( "blocks.registerBlockType", blockType, name, null ); if (settings.apiVersion <= 2) { (0, import_deprecated4.default)("Block with API version 2 or lower", { since: "6.9", hint: `The block "${name}" is registered with API version ${settings.apiVersion}. This means that the post editor may work as a non-iframe editor. Since all editors are planned to work as iframes in the future, set the \`apiVersion\` field to 3 and test the block inside the iframe editor.`, link: "https://developer.wordpress.org/block-editor/reference-guides/block-api/block-api-versions/block-migration-for-iframe-editor-compatibility/" }); } if (settings.description && typeof settings.description !== "string") { (0, import_deprecated4.default)("Declaring non-string block descriptions", { since: "6.2" }); } if (settings.deprecated) { settings.deprecated = settings.deprecated.map( (deprecation) => Object.fromEntries( Object.entries( // Only keep valid deprecation keys. (0, import_hooks.applyFilters)( "blocks.registerBlockType", // Merge deprecation keys with pre-filter settings // so that filters that depend on specific keys being // present don't fail. { // Omit deprecation keys here so that deprecations // can opt out of specific keys like "supports". ...omit(blockType, DEPRECATED_ENTRY_KEYS), ...deprecation }, blockType.name, deprecation ) ).filter( ([key]) => DEPRECATED_ENTRY_KEYS.includes(key) ) ) ); } if (!isPlainObject(settings)) { (0, import_warning2.default)("Block settings must be a valid object."); return; } if (typeof settings.save !== "function") { (0, import_warning2.default)('The "save" property must be a valid function.'); return; } if ("edit" in settings && !(0, import_react_is.isValidElementType)(settings.edit)) { (0, import_warning2.default)('The "edit" property must be a valid component.'); return; } if (LEGACY_CATEGORY_MAPPING.hasOwnProperty(settings.category)) { settings.category = LEGACY_CATEGORY_MAPPING[settings.category]; } if ("category" in settings && !select3.getCategories().some(({ slug }) => slug === settings.category)) { (0, import_warning2.default)( 'The block "' + name + '" is registered with an invalid category "' + settings.category + '".' ); delete settings.category; } if (!("title" in settings) || settings.title === "") { (0, import_warning2.default)('The block "' + name + '" must have a title.'); return; } if (typeof settings.title !== "string") { (0, import_warning2.default)("Block titles must be strings."); return; } settings.icon = normalizeIconObject(settings.icon); if (!isValidIcon(settings.icon.src)) { (0, import_warning2.default)( "The icon passed is invalid. The icon should be a string, an element, a function, or an object following the specifications documented in https://developer.wordpress.org/block-editor/developers/block-api/block-registration/#icon-optional" ); return; } if (typeof settings?.parent === "string" || settings?.parent instanceof String) { settings.parent = [settings.parent]; (0, import_warning2.default)( "Parent must be undefined or an array of strings (block types), but it is a string." ); } if (!Array.isArray(settings?.parent) && settings?.parent !== void 0) { (0, import_warning2.default)( "Parent must be undefined or an array of block types, but it is ", settings.parent ); return; } if (1 === settings?.parent?.length && name === settings.parent[0]) { (0, import_warning2.default)( 'Block "' + name + '" cannot be a parent of itself. Please remove the block name from the parent list.' ); return; } return settings; }; // packages/blocks/build-module/store/actions.mjs function addBlockTypes(blockTypes2) { return { type: "ADD_BLOCK_TYPES", blockTypes: Array.isArray(blockTypes2) ? blockTypes2 : [blockTypes2] }; } function reapplyBlockTypeFilters() { return ({ dispatch: dispatch3, select: select3 }) => { const processedBlockTypes = []; for (const [name, settings] of Object.entries( select3.getUnprocessedBlockTypes() )) { const result = dispatch3(processBlockType(name, settings)); if (result) { processedBlockTypes.push(result); } } if (!processedBlockTypes.length) { return; } dispatch3.addBlockTypes(processedBlockTypes); }; } function __experimentalReapplyBlockFilters() { (0, import_deprecated5.default)( 'wp.data.dispatch( "core/blocks" ).__experimentalReapplyBlockFilters', { since: "6.4", alternative: "reapplyBlockFilters" } ); return reapplyBlockTypeFilters(); } function removeBlockTypes(names) { return { type: "REMOVE_BLOCK_TYPES", names: Array.isArray(names) ? names : [names] }; } function addBlockStyles(blockNames, styles) { return { type: "ADD_BLOCK_STYLES", styles: Array.isArray(styles) ? styles : [styles], blockNames: Array.isArray(blockNames) ? blockNames : [blockNames] }; } function removeBlockStyles(blockName, styleNames) { return { type: "REMOVE_BLOCK_STYLES", styleNames: Array.isArray(styleNames) ? styleNames : [styleNames], blockName }; } function addBlockVariations(blockName, variations) { return { type: "ADD_BLOCK_VARIATIONS", variations: Array.isArray(variations) ? variations : [variations], blockName }; } function removeBlockVariations(blockName, variationNames) { return { type: "REMOVE_BLOCK_VARIATIONS", variationNames: Array.isArray(variationNames) ? variationNames : [variationNames], blockName }; } function setDefaultBlockName2(name) { return { type: "SET_DEFAULT_BLOCK_NAME", name }; } function setFreeformFallbackBlockName(name) { return { type: "SET_FREEFORM_FALLBACK_BLOCK_NAME", name }; } function setUnregisteredFallbackBlockName(name) { return { type: "SET_UNREGISTERED_FALLBACK_BLOCK_NAME", name }; } function setGroupingBlockName2(name) { return { type: "SET_GROUPING_BLOCK_NAME", name }; } function setCategories(categories2) { return { type: "SET_CATEGORIES", categories: categories2 }; } function updateCategory(slug, category) { return { type: "UPDATE_CATEGORY", slug, category }; } function addBlockCollection(namespace, title, icon) { return { type: "ADD_BLOCK_COLLECTION", namespace, title, icon }; } function removeBlockCollection(namespace) { return { type: "REMOVE_BLOCK_COLLECTION", namespace }; } // packages/blocks/build-module/store/private-actions.mjs var private_actions_exports = {}; __export(private_actions_exports, { addBlockBindingsSource: () => addBlockBindingsSource, addBootstrappedBlockType: () => addBootstrappedBlockType, addUnprocessedBlockType: () => addUnprocessedBlockType, removeBlockBindingsSource: () => removeBlockBindingsSource }); function addBootstrappedBlockType(name, blockType) { return { type: "ADD_BOOTSTRAPPED_BLOCK_TYPE", name, blockType }; } function addUnprocessedBlockType(name, blockType) { return ({ dispatch: dispatch3 }) => { dispatch3({ type: "ADD_UNPROCESSED_BLOCK_TYPE", name, blockType }); const processedBlockType = dispatch3( processBlockType(name, blockType) ); if (!processedBlockType) { return; } dispatch3.addBlockTypes(processedBlockType); }; } function addBlockBindingsSource(source) { return { type: "ADD_BLOCK_BINDINGS_SOURCE", name: source.name, label: source.label, usesContext: source.usesContext, getValues: source.getValues, setValues: source.setValues, canUserEditValue: source.canUserEditValue, getFieldsList: source.getFieldsList }; } function removeBlockBindingsSource(name) { return { type: "REMOVE_BLOCK_BINDINGS_SOURCE", name }; } // packages/blocks/build-module/store/constants.mjs var STORE_NAME = "core/blocks"; // packages/blocks/build-module/store/index.mjs var store = (0, import_data5.createReduxStore)(STORE_NAME, { reducer: reducer_default, selectors: selectors_exports, actions: actions_exports }); (0, import_data5.register)(store); unlock(store).registerPrivateSelectors(private_selectors_exports); unlock(store).registerPrivateActions(private_actions_exports); // node_modules/uuid/dist/esm-browser/rng.js var getRandomValues; var rnds8 = new Uint8Array(16); function rng() { if (!getRandomValues) { getRandomValues = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto); if (!getRandomValues) { throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported"); } } return getRandomValues(rnds8); } // node_modules/uuid/dist/esm-browser/stringify.js var byteToHex = []; for (let i2 = 0; i2 < 256; ++i2) { byteToHex.push((i2 + 256).toString(16).slice(1)); } function unsafeStringify(arr, offset = 0) { return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]; } // node_modules/uuid/dist/esm-browser/native.js var randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto); var native_default = { randomUUID }; // node_modules/uuid/dist/esm-browser/v4.js function v4(options, buf, offset) { if (native_default.randomUUID && !buf && !options) { return native_default.randomUUID(); } options = options || {}; const rnds = options.random || (options.rng || rng)(); rnds[6] = rnds[6] & 15 | 64; rnds[8] = rnds[8] & 63 | 128; if (buf) { offset = offset || 0; for (let i2 = 0; i2 < 16; ++i2) { buf[offset + i2] = rnds[i2]; } return buf; } return unsafeStringify(rnds); } var v4_default = v4; // packages/blocks/build-module/api/factory.mjs var import_hooks2 = __toESM(require_hooks(), 1); function createBlock(name, attributes = {}, innerBlocks = []) { if (!isBlockRegistered(name)) { return createBlock("core/missing", { originalName: name, originalContent: "", originalUndelimitedContent: "" }); } const sanitizedAttributes = __experimentalSanitizeBlockAttributes( name, attributes ); const clientId = v4_default(); return { clientId, name, isValid: true, attributes: sanitizedAttributes, innerBlocks }; } function createBlocksFromInnerBlocksTemplate(innerBlocksOrTemplate = []) { return innerBlocksOrTemplate.map((innerBlock) => { const innerBlockTemplate = Array.isArray(innerBlock) ? innerBlock : [ innerBlock.name, innerBlock.attributes, innerBlock.innerBlocks ]; const [name, attributes, innerBlocks = []] = innerBlockTemplate; return createBlock( name, attributes, createBlocksFromInnerBlocksTemplate(innerBlocks) ); }); } function __experimentalCloneSanitizedBlock(block, mergeAttributes = {}, newInnerBlocks) { const { name } = block; if (!isBlockRegistered(name)) { return createBlock("core/missing", { originalName: name, originalContent: "", originalUndelimitedContent: "" }); } const clientId = v4_default(); const sanitizedAttributes = __experimentalSanitizeBlockAttributes(name, { ...block.attributes, ...mergeAttributes }); return { ...block, clientId, attributes: sanitizedAttributes, innerBlocks: newInnerBlocks || block.innerBlocks.map( (innerBlock) => __experimentalCloneSanitizedBlock(innerBlock) ) }; } function cloneBlock(block, mergeAttributes = {}, newInnerBlocks) { const clientId = v4_default(); return { ...block, clientId, attributes: { ...block.attributes, ...mergeAttributes }, innerBlocks: newInnerBlocks || block.innerBlocks.map((innerBlock) => cloneBlock(innerBlock)) }; } var isPossibleTransformForSource = (transform, direction, blocks) => { if (!blocks.length) { return false; } const isMultiBlock = blocks.length > 1; const firstBlockName = blocks[0].name; const isValidForMultiBlocks = isWildcardBlockTransform(transform) || !isMultiBlock || transform.isMultiBlock; if (!isValidForMultiBlocks) { return false; } if (!isWildcardBlockTransform(transform) && !blocks.every((block) => block.name === firstBlockName)) { return false; } const isBlockType = transform.type === "block"; if (!isBlockType) { return false; } const sourceBlock = blocks[0]; const hasMatchingName = direction !== "from" || transform.blocks.indexOf(sourceBlock.name) !== -1 || isWildcardBlockTransform(transform); if (!hasMatchingName) { return false; } if (!isMultiBlock && direction === "from" && isContainerGroupBlock(sourceBlock.name) && isContainerGroupBlock(transform.blockName)) { return false; } if (!maybeCheckTransformIsMatch(transform, blocks)) { return false; } return true; }; var getBlockTypesForPossibleFromTransforms = (blocks) => { if (!blocks.length) { return []; } const allBlockTypes = getBlockTypes(); const blockTypesWithPossibleFromTransforms = allBlockTypes.filter( (blockType) => { const fromTransforms = getBlockTransforms("from", blockType.name); return !!findTransform(fromTransforms, (transform) => { return isPossibleTransformForSource( transform, "from", blocks ); }); } ); return blockTypesWithPossibleFromTransforms; }; var getBlockTypesForPossibleToTransforms = (blocks) => { if (!blocks.length) { return []; } const sourceBlock = blocks[0]; const blockType = getBlockType(sourceBlock.name); const transformsTo = blockType ? getBlockTransforms("to", blockType.name) : []; const possibleTransforms = transformsTo.filter((transform) => { return transform && isPossibleTransformForSource(transform, "to", blocks); }); const blockNames = possibleTransforms.map((transformation) => transformation.blocks).flat(); return blockNames.map(getBlockType); }; var isWildcardBlockTransform = (t3) => t3 && t3.type === "block" && Array.isArray(t3.blocks) && t3.blocks.includes("*"); var isContainerGroupBlock = (name) => name === getGroupingBlockName(); function getPossibleBlockTransformations(blocks) { if (!blocks.length) { return []; } const blockTypesForFromTransforms = getBlockTypesForPossibleFromTransforms(blocks); const blockTypesForToTransforms = getBlockTypesForPossibleToTransforms(blocks); return [ .../* @__PURE__ */ new Set([ ...blockTypesForFromTransforms, ...blockTypesForToTransforms ]) ]; } function findTransform(transforms, predicate) { const hooks = (0, import_hooks2.createHooks)(); for (let i2 = 0; i2 < transforms.length; i2++) { const candidate = transforms[i2]; if (predicate(candidate)) { hooks.addFilter( "transform", "transform/" + i2.toString(), (result) => result ? result : candidate, candidate.priority ); } } return hooks.applyFilters("transform", null); } function getBlockTransforms(direction, blockTypeOrName) { if (blockTypeOrName === void 0) { return getBlockTypes().map(({ name }) => getBlockTransforms(direction, name)).flat(); } const blockType = normalizeBlockType(blockTypeOrName); const { name: blockName, transforms } = blockType || {}; if (!transforms || !Array.isArray(transforms[direction])) { return []; } const usingMobileTransformations = transforms.supportedMobileTransforms && Array.isArray(transforms.supportedMobileTransforms); const filteredTransforms = usingMobileTransformations ? transforms[direction].filter((t3) => { if (t3.type === "raw") { return true; } if (t3.type === "prefix") { return true; } if (!t3.blocks || !t3.blocks.length) { return false; } if (isWildcardBlockTransform(t3)) { return true; } return t3.blocks.every( (transformBlockName) => transforms.supportedMobileTransforms.includes( transformBlockName ) ); }) : transforms[direction]; return filteredTransforms.map((transform) => ({ ...transform, blockName, usingMobileTransformations })); } function maybeCheckTransformIsMatch(transform, blocks) { if (typeof transform.isMatch !== "function") { return true; } const sourceBlock = blocks[0]; const attributes = transform.isMultiBlock ? blocks.map((block2) => block2.attributes) : sourceBlock.attributes; const block = transform.isMultiBlock ? blocks : sourceBlock; return transform.isMatch(attributes, block); } function switchToBlockType(blocks, name) { const blocksArray = Array.isArray(blocks) ? blocks : [blocks]; const isMultiBlock = blocksArray.length > 1; const firstBlock = blocksArray[0]; const sourceName = firstBlock.name; const transformationsFrom = getBlockTransforms("from", name); const transformationsTo = getBlockTransforms("to", sourceName); const transformation = findTransform( transformationsTo, (t3) => t3.type === "block" && (isWildcardBlockTransform(t3) || t3.blocks.indexOf(name) !== -1) && (!isMultiBlock || t3.isMultiBlock) && maybeCheckTransformIsMatch(t3, blocksArray) ) || findTransform( transformationsFrom, (t3) => t3.type === "block" && (isWildcardBlockTransform(t3) || t3.blocks.indexOf(sourceName) !== -1) && (!isMultiBlock || t3.isMultiBlock) && maybeCheckTransformIsMatch(t3, blocksArray) ); if (!transformation) { return null; } let transformationResults; if (transformation.isMultiBlock) { if ("__experimentalConvert" in transformation) { transformationResults = transformation.__experimentalConvert(blocksArray); } else { transformationResults = transformation.transform( blocksArray.map((currentBlock) => currentBlock.attributes), blocksArray.map((currentBlock) => currentBlock.innerBlocks) ); } } else if ("__experimentalConvert" in transformation) { transformationResults = transformation.__experimentalConvert(firstBlock); } else { transformationResults = transformation.transform( firstBlock.attributes, firstBlock.innerBlocks ); } if (transformationResults === null || typeof transformationResults !== "object") { return null; } transformationResults = Array.isArray(transformationResults) ? transformationResults : [transformationResults]; if (transformationResults.some( (result) => !getBlockType(result.name) )) { return null; } const hasSwitchedBlock = transformationResults.some( (result) => result.name === name ); if (!hasSwitchedBlock) { return null; } const ret = transformationResults.map((result, index, results) => { return (0, import_hooks2.applyFilters)( "blocks.switchToBlockType.transformedBlock", result, blocks, index, results ); }); return ret; } var getBlockFromExample = (name, example) => createBlock( name, example.attributes, (example.innerBlocks ?? []).map( (innerBlock) => getBlockFromExample(innerBlock.name, innerBlock) ) ); // packages/blocks/build-module/api/parser/index.mjs var import_block_serialization_default_parser = __toESM(require_block_serialization_default_parser(), 1); var import_autop2 = __toESM(require_autop(), 1); // packages/blocks/build-module/api/serializer.mjs var import_element2 = __toESM(require_element(), 1); var import_hooks3 = __toESM(require_hooks(), 1); var import_is_shallow_equal = __toESM(require_is_shallow_equal(), 1); var import_autop = __toESM(require_autop(), 1); var import_deprecated6 = __toESM(require_deprecated(), 1); // packages/blocks/build-module/api/parser/serialize-raw-block.mjs function serializeRawBlock(rawBlock, options = {}) { const { isCommentDelimited = true } = options; const { blockName, attrs = {}, innerBlocks = [], innerContent = [] } = rawBlock; let childIndex = 0; const content = innerContent.map( (item) => ( // `null` denotes a nested block, otherwise we have an HTML fragment. item !== null ? item : serializeRawBlock(innerBlocks[childIndex++], options) ) ).join("\n").replace(/\n+/g, "\n").trim(); return isCommentDelimited ? getCommentDelimitedContent(blockName, attrs, content) : content; } // packages/blocks/build-module/api/serializer.mjs var import_jsx_runtime = __toESM(require_jsx_runtime(), 1); function getBlockDefaultClassName(blockName) { const className = "wp-block-" + blockName.replace(/\//, "-").replace(/^core-/, ""); return (0, import_hooks3.applyFilters)( "blocks.getBlockDefaultClassName", className, blockName ); } function getBlockMenuDefaultClassName(blockName) { const className = "editor-block-list-item-" + blockName.replace(/\//, "-").replace(/^core-/, ""); return (0, import_hooks3.applyFilters)( "blocks.getBlockMenuDefaultClassName", className, blockName ); } var blockPropsProvider = {}; var innerBlocksPropsProvider = {}; function getBlockProps(props = {}) { const { blockType, attributes } = blockPropsProvider; return getBlockProps.skipFilters ? props : (0, import_hooks3.applyFilters)( "blocks.getSaveContent.extraProps", { ...props }, blockType, attributes ); } function getInnerBlocksProps(props = {}) { const { innerBlocks } = innerBlocksPropsProvider; if (!Array.isArray(innerBlocks)) { return { ...props, children: innerBlocks }; } const html2 = serialize(innerBlocks, { isInnerBlocks: true }); const children = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_element2.RawHTML, { children: html2 }); return { ...props, children }; } function getSaveElement(blockTypeOrName, attributes, innerBlocks = []) { const blockType = normalizeBlockType(blockTypeOrName); if (!blockType?.save) { return null; } let { save } = blockType; if (save.prototype instanceof import_element2.Component) { const instance = new save({ attributes }); save = instance.render.bind(instance); } blockPropsProvider.blockType = blockType; blockPropsProvider.attributes = attributes; innerBlocksPropsProvider.innerBlocks = innerBlocks; let element = save({ attributes, innerBlocks }); if (element !== null && typeof element === "object" && (0, import_hooks3.hasFilter)("blocks.getSaveContent.extraProps") && !(blockType.apiVersion > 1)) { const props = (0, import_hooks3.applyFilters)( "blocks.getSaveContent.extraProps", { ...element.props }, blockType, attributes ); if (!(0, import_is_shallow_equal.isShallowEqual)(props, element.props)) { element = (0, import_element2.cloneElement)(element, props); } } return (0, import_hooks3.applyFilters)( "blocks.getSaveElement", element, blockType, attributes ); } function getSaveContent(blockTypeOrName, attributes, innerBlocks) { const blockType = normalizeBlockType(blockTypeOrName); return (0, import_element2.renderToString)( getSaveElement(blockType, attributes, innerBlocks) ); } function getCommentAttributes(blockType, attributes) { return Object.entries(blockType.attributes ?? {}).reduce( (accumulator, [key, attributeSchema]) => { const value = attributes[key]; if (void 0 === value) { return accumulator; } if (attributeSchema.source !== void 0) { return accumulator; } if (attributeSchema.role === "local") { return accumulator; } if (attributeSchema.__experimentalRole === "local") { (0, import_deprecated6.default)("__experimentalRole attribute", { since: "6.7", version: "6.8", alternative: "role attribute", hint: `Check the block.json of the ${blockType?.name} block.` }); return accumulator; } if ("default" in attributeSchema && JSON.stringify(attributeSchema.default) === JSON.stringify(value)) { return accumulator; } accumulator[key] = value; return accumulator; }, {} ); } function serializeAttributes(attributes) { return JSON.stringify(attributes).replaceAll("\\\\", "\\u005c").replaceAll("--", "\\u002d\\u002d").replaceAll("<", "\\u003c").replaceAll(">", "\\u003e").replaceAll("&", "\\u0026").replaceAll('\\"', "\\u0022"); } function getBlockInnerHTML(block) { let saveContent = block.originalContent; if (block.isValid || block.innerBlocks.length) { try { saveContent = getSaveContent( block.name, block.attributes, block.innerBlocks ); } catch (error) { } } return saveContent; } function getCommentDelimitedContent(rawBlockName, attributes, content) { const serializedAttributes = attributes && Object.entries(attributes).length ? serializeAttributes(attributes) + " " : ""; const blockName = rawBlockName?.startsWith("core/") ? rawBlockName.slice(5) : rawBlockName; if (!content) { return `<!-- wp:${blockName} ${serializedAttributes}/-->`; } return `<!-- wp:${blockName} ${serializedAttributes}--> ` + content + ` <!-- /wp:${blockName} -->`; } function serializeBlock(block, { isInnerBlocks = false } = {}) { if (!block.isValid && block.__unstableBlockSource) { return serializeRawBlock(block.__unstableBlockSource); } const blockName = block.name; const saveContent = getBlockInnerHTML(block); if (blockName === getUnregisteredTypeHandlerName() || !isInnerBlocks && blockName === getFreeformContentHandlerName()) { return saveContent; } const blockType = getBlockType(blockName); if (!blockType) { return saveContent; } const saveAttributes = getCommentAttributes(blockType, block.attributes); return getCommentDelimitedContent(blockName, saveAttributes, saveContent); } var __unstableSerializeAndClean = /* @__PURE__ */ (() => { const cache = /* @__PURE__ */ new WeakMap(); return (blocks) => { const cached = cache.get(blocks); if (cached !== void 0) { return cached; } let effectiveBlocks = blocks; if (effectiveBlocks.length === 1 && isUnmodifiedDefaultBlock(effectiveBlocks[0])) { effectiveBlocks = []; } let content = serialize(effectiveBlocks); if (effectiveBlocks.length === 1 && effectiveBlocks[0].name === getFreeformContentHandlerName() && effectiveBlocks[0].name === "core/freeform") { content = (0, import_autop.removep)(content); } cache.set(blocks, content); return content; }; })(); function serialize(blocks, options) { const blocksArray = Array.isArray(blocks) ? blocks : [blocks]; return blocksArray.map((block) => serializeBlock(block, options)).join("\n\n"); } // node_modules/simple-html-tokenizer/dist/es6/index.js var HEXCHARCODE = /^#[xX]([A-Fa-f0-9]+)$/; var CHARCODE = /^#([0-9]+)$/; var NAMED = /^([A-Za-z0-9]+)$/; var EntityParser = ( /** @class */ (function() { function EntityParser2(named) { this.named = named; } EntityParser2.prototype.parse = function(entity) { if (!entity) { return; } var matches = entity.match(HEXCHARCODE); if (matches) { return String.fromCharCode(parseInt(matches[1], 16)); } matches = entity.match(CHARCODE); if (matches) { return String.fromCharCode(parseInt(matches[1], 10)); } matches = entity.match(NAMED); if (matches) { return this.named[matches[1]]; } }; return EntityParser2; })() ); var WSP = /[\t\n\f ]/; var ALPHA = /[A-Za-z]/; var CRLF = /\r\n?/g; function isSpace(char) { return WSP.test(char); } function isAlpha(char) { return ALPHA.test(char); } function preprocessInput(input) { return input.replace(CRLF, "\n"); } var EventedTokenizer = ( /** @class */ (function() { function EventedTokenizer2(delegate, entityParser) { this.delegate = delegate; this.entityParser = entityParser; this.state = "beforeData"; this.line = -1; this.column = -1; this.input = ""; this.index = -1; this.tagNameBuffer = ""; this.states = { beforeData: function() { var char = this.peek(); if (char === "<") { this.transitionTo( "tagOpen" /* tagOpen */ ); this.markTagStart(); this.consume(); } else { if (char === "\n") { var tag = this.tagNameBuffer.toLowerCase(); if (tag === "pre" || tag === "textarea") { this.consume(); } } this.transitionTo( "data" /* data */ ); this.delegate.beginData(); } }, data: function() { var char = this.peek(); if (char === "<") { this.delegate.finishData(); this.transitionTo( "tagOpen" /* tagOpen */ ); this.markTagStart(); this.consume(); } else if (char === "&") { this.consume(); this.delegate.appendToData(this.consumeCharRef() || "&"); } else { this.consume(); this.delegate.appendToData(char); } }, tagOpen: function() { var char = this.consume(); if (char === "!") { this.transitionTo( "markupDeclarationOpen" /* markupDeclarationOpen */ ); } else if (char === "/") { this.transitionTo( "endTagOpen" /* endTagOpen */ ); } else if (char === "@" || char === ":" || isAlpha(char)) { this.transitionTo( "tagName" /* tagName */ ); this.tagNameBuffer = ""; this.delegate.beginStartTag(); this.appendToTagName(char); } }, markupDeclarationOpen: function() { var char = this.consume(); if (char === "-" && this.input.charAt(this.index) === "-") { this.consume(); this.transitionTo( "commentStart" /* commentStart */ ); this.delegate.beginComment(); } }, commentStart: function() { var char = this.consume(); if (char === "-") { this.transitionTo( "commentStartDash" /* commentStartDash */ ); } else if (char === ">") { this.delegate.finishComment(); this.transitionTo( "beforeData" /* beforeData */ ); } else { this.delegate.appendToCommentData(char); this.transitionTo( "comment" /* comment */ ); } }, commentStartDash: function() { var char = this.consume(); if (char === "-") { this.transitionTo( "commentEnd" /* commentEnd */ ); } else if (char === ">") { this.delegate.finishComment(); this.transitionTo( "beforeData" /* beforeData */ ); } else { this.delegate.appendToCommentData("-"); this.transitionTo( "comment" /* comment */ ); } }, comment: function() { var char = this.consume(); if (char === "-") { this.transitionTo( "commentEndDash" /* commentEndDash */ ); } else { this.delegate.appendToCommentData(char); } }, commentEndDash: function() { var char = this.consume(); if (char === "-") { this.transitionTo( "commentEnd" /* commentEnd */ ); } else { this.delegate.appendToCommentData("-" + char); this.transitionTo( "comment" /* comment */ ); } }, commentEnd: function() { var char = this.consume(); if (char === ">") { this.delegate.finishComment(); this.transitionTo( "beforeData" /* beforeData */ ); } else { this.delegate.appendToCommentData("--" + char); this.transitionTo( "comment" /* comment */ ); } }, tagName: function() { var char = this.consume(); if (isSpace(char)) { this.transitionTo( "beforeAttributeName" /* beforeAttributeName */ ); } else if (char === "/") { this.transitionTo( "selfClosingStartTag" /* selfClosingStartTag */ ); } else if (char === ">") { this.delegate.finishTag(); this.transitionTo( "beforeData" /* beforeData */ ); } else { this.appendToTagName(char); } }, beforeAttributeName: function() { var char = this.peek(); if (isSpace(char)) { this.consume(); return; } else if (char === "/") { this.transitionTo( "selfClosingStartTag" /* selfClosingStartTag */ ); this.consume(); } else if (char === ">") { this.consume(); this.delegate.finishTag(); this.transitionTo( "beforeData" /* beforeData */ ); } else if (char === "=") { this.delegate.reportSyntaxError("attribute name cannot start with equals sign"); this.transitionTo( "attributeName" /* attributeName */ ); this.delegate.beginAttribute(); this.consume(); this.delegate.appendToAttributeName(char); } else { this.transitionTo( "attributeName" /* attributeName */ ); this.delegate.beginAttribute(); } }, attributeName: function() { var char = this.peek(); if (isSpace(char)) { this.transitionTo( "afterAttributeName" /* afterAttributeName */ ); this.consume(); } else if (char === "/") { this.delegate.beginAttributeValue(false); this.delegate.finishAttributeValue(); this.consume(); this.transitionTo( "selfClosingStartTag" /* selfClosingStartTag */ ); } else if (char === "=") { this.transitionTo( "beforeAttributeValue" /* beforeAttributeValue */ ); this.consume(); } else if (char === ">") { this.delegate.beginAttributeValue(false); this.delegate.finishAttributeValue(); this.consume(); this.delegate.finishTag(); this.transitionTo( "beforeData" /* beforeData */ ); } else if (char === '"' || char === "'" || char === "<") { this.delegate.reportSyntaxError(char + " is not a valid character within attribute names"); this.consume(); this.delegate.appendToAttributeName(char); } else { this.consume(); this.delegate.appendToAttributeName(char); } }, afterAttributeName: function() { var char = this.peek(); if (isSpace(char)) { this.consume(); return; } else if (char === "/") { this.delegate.beginAttributeValue(false); this.delegate.finishAttributeValue(); this.consume(); this.transitionTo( "selfClosingStartTag" /* selfClosingStartTag */ ); } else if (char === "=") { this.consume(); this.transitionTo( "beforeAttributeValue" /* beforeAttributeValue */ ); } else if (char === ">") { this.delegate.beginAttributeValue(false); this.delegate.finishAttributeValue(); this.consume(); this.delegate.finishTag(); this.transitionTo( "beforeData" /* beforeData */ ); } else { this.delegate.beginAttributeValue(false); this.delegate.finishAttributeValue(); this.transitionTo( "attributeName" /* attributeName */ ); this.delegate.beginAttribute(); this.consume(); this.delegate.appendToAttributeName(char); } }, beforeAttributeValue: function() { var char = this.peek(); if (isSpace(char)) { this.consume(); } else if (char === '"') { this.transitionTo( "attributeValueDoubleQuoted" /* attributeValueDoubleQuoted */ ); this.delegate.beginAttributeValue(true); this.consume(); } else if (char === "'") { this.transitionTo( "attributeValueSingleQuoted" /* attributeValueSingleQuoted */ ); this.delegate.beginAttributeValue(true); this.consume(); } else if (char === ">") { this.delegate.beginAttributeValue(false); this.delegate.finishAttributeValue(); this.consume(); this.delegate.finishTag(); this.transitionTo( "beforeData" /* beforeData */ ); } else { this.transitionTo( "attributeValueUnquoted" /* attributeValueUnquoted */ ); this.delegate.beginAttributeValue(false); this.consume(); this.delegate.appendToAttributeValue(char); } }, attributeValueDoubleQuoted: function() { var char = this.consume(); if (char === '"') { this.delegate.finishAttributeValue(); this.transitionTo( "afterAttributeValueQuoted" /* afterAttributeValueQuoted */ ); } else if (char === "&") { this.delegate.appendToAttributeValue(this.consumeCharRef() || "&"); } else { this.delegate.appendToAttributeValue(char); } }, attributeValueSingleQuoted: function() { var char = this.consume(); if (char === "'") { this.delegate.finishAttributeValue(); this.transitionTo( "afterAttributeValueQuoted" /* afterAttributeValueQuoted */ ); } else if (char === "&") { this.delegate.appendToAttributeValue(this.consumeCharRef() || "&"); } else { this.delegate.appendToAttributeValue(char); } }, attributeValueUnquoted: function() { var char = this.peek(); if (isSpace(char)) { this.delegate.finishAttributeValue(); this.consume(); this.transitionTo( "beforeAttributeName" /* beforeAttributeName */ ); } else if (char === "/") { this.delegate.finishAttributeValue(); this.consume(); this.transitionTo( "selfClosingStartTag" /* selfClosingStartTag */ ); } else if (char === "&") { this.consume(); this.delegate.appendToAttributeValue(this.consumeCharRef() || "&"); } else if (char === ">") { this.delegate.finishAttributeValue(); this.consume(); this.delegate.finishTag(); this.transitionTo( "beforeData" /* beforeData */ ); } else { this.consume(); this.delegate.appendToAttributeValue(char); } }, afterAttributeValueQuoted: function() { var char = this.peek(); if (isSpace(char)) { this.consume(); this.transitionTo( "beforeAttributeName" /* beforeAttributeName */ ); } else if (char === "/") { this.consume(); this.transitionTo( "selfClosingStartTag" /* selfClosingStartTag */ ); } else if (char === ">") { this.consume(); this.delegate.finishTag(); this.transitionTo( "beforeData" /* beforeData */ ); } else { this.transitionTo( "beforeAttributeName" /* beforeAttributeName */ ); } }, selfClosingStartTag: function() { var char = this.peek(); if (char === ">") { this.consume(); this.delegate.markTagAsSelfClosing(); this.delegate.finishTag(); this.transitionTo( "beforeData" /* beforeData */ ); } else { this.transitionTo( "beforeAttributeName" /* beforeAttributeName */ ); } }, endTagOpen: function() { var char = this.consume(); if (char === "@" || char === ":" || isAlpha(char)) { this.transitionTo( "tagName" /* tagName */ ); this.tagNameBuffer = ""; this.delegate.beginEndTag(); this.appendToTagName(char); } } }; this.reset(); } EventedTokenizer2.prototype.reset = function() { this.transitionTo( "beforeData" /* beforeData */ ); this.input = ""; this.index = 0; this.line = 1; this.column = 0; this.delegate.reset(); }; EventedTokenizer2.prototype.transitionTo = function(state) { this.state = state; }; EventedTokenizer2.prototype.tokenize = function(input) { this.reset(); this.tokenizePart(input); this.tokenizeEOF(); }; EventedTokenizer2.prototype.tokenizePart = function(input) { this.input += preprocessInput(input); while (this.index < this.input.length) { var handler = this.states[this.state]; if (handler !== void 0) { handler.call(this); } else { throw new Error("unhandled state " + this.state); } } }; EventedTokenizer2.prototype.tokenizeEOF = function() { this.flushData(); }; EventedTokenizer2.prototype.flushData = function() { if (this.state === "data") { this.delegate.finishData(); this.transitionTo( "beforeData" /* beforeData */ ); } }; EventedTokenizer2.prototype.peek = function() { return this.input.charAt(this.index); }; EventedTokenizer2.prototype.consume = function() { var char = this.peek(); this.index++; if (char === "\n") { this.line++; this.column = 0; } else { this.column++; } return char; }; EventedTokenizer2.prototype.consumeCharRef = function() { var endIndex = this.input.indexOf(";", this.index); if (endIndex === -1) { return; } var entity = this.input.slice(this.index, endIndex); var chars = this.entityParser.parse(entity); if (chars) { var count = entity.length; while (count) { this.consume(); count--; } this.consume(); return chars; } }; EventedTokenizer2.prototype.markTagStart = function() { this.delegate.tagOpen(); }; EventedTokenizer2.prototype.appendToTagName = function(char) { this.tagNameBuffer += char; this.delegate.appendToTagName(char); }; return EventedTokenizer2; })() ); var Tokenizer = ( /** @class */ (function() { function Tokenizer2(entityParser, options) { if (options === void 0) { options = {}; } this.options = options; this.token = null; this.startLine = 1; this.startColumn = 0; this.tokens = []; this.tokenizer = new EventedTokenizer(this, entityParser); this._currentAttribute = void 0; } Tokenizer2.prototype.tokenize = function(input) { this.tokens = []; this.tokenizer.tokenize(input); return this.tokens; }; Tokenizer2.prototype.tokenizePart = function(input) { this.tokens = []; this.tokenizer.tokenizePart(input); return this.tokens; }; Tokenizer2.prototype.tokenizeEOF = function() { this.tokens = []; this.tokenizer.tokenizeEOF(); return this.tokens[0]; }; Tokenizer2.prototype.reset = function() { this.token = null; this.startLine = 1; this.startColumn = 0; }; Tokenizer2.prototype.current = function() { var token = this.token; if (token === null) { throw new Error("token was unexpectedly null"); } if (arguments.length === 0) { return token; } for (var i2 = 0; i2 < arguments.length; i2++) { if (token.type === arguments[i2]) { return token; } } throw new Error("token type was unexpectedly " + token.type); }; Tokenizer2.prototype.push = function(token) { this.token = token; this.tokens.push(token); }; Tokenizer2.prototype.currentAttribute = function() { return this._currentAttribute; }; Tokenizer2.prototype.addLocInfo = function() { if (this.options.loc) { this.current().loc = { start: { line: this.startLine, column: this.startColumn }, end: { line: this.tokenizer.line, column: this.tokenizer.column } }; } this.startLine = this.tokenizer.line; this.startColumn = this.tokenizer.column; }; Tokenizer2.prototype.beginData = function() { this.push({ type: "Chars", chars: "" }); }; Tokenizer2.prototype.appendToData = function(char) { this.current( "Chars" /* Chars */ ).chars += char; }; Tokenizer2.prototype.finishData = function() { this.addLocInfo(); }; Tokenizer2.prototype.beginComment = function() { this.push({ type: "Comment", chars: "" }); }; Tokenizer2.prototype.appendToCommentData = function(char) { this.current( "Comment" /* Comment */ ).chars += char; }; Tokenizer2.prototype.finishComment = function() { this.addLocInfo(); }; Tokenizer2.prototype.tagOpen = function() { }; Tokenizer2.prototype.beginStartTag = function() { this.push({ type: "StartTag", tagName: "", attributes: [], selfClosing: false }); }; Tokenizer2.prototype.beginEndTag = function() { this.push({ type: "EndTag", tagName: "" }); }; Tokenizer2.prototype.finishTag = function() { this.addLocInfo(); }; Tokenizer2.prototype.markTagAsSelfClosing = function() { this.current( "StartTag" /* StartTag */ ).selfClosing = true; }; Tokenizer2.prototype.appendToTagName = function(char) { this.current( "StartTag", "EndTag" /* EndTag */ ).tagName += char; }; Tokenizer2.prototype.beginAttribute = function() { this._currentAttribute = ["", "", false]; }; Tokenizer2.prototype.appendToAttributeName = function(char) { this.currentAttribute()[0] += char; }; Tokenizer2.prototype.beginAttributeValue = function(isQuoted) { this.currentAttribute()[2] = isQuoted; }; Tokenizer2.prototype.appendToAttributeValue = function(char) { this.currentAttribute()[1] += char; }; Tokenizer2.prototype.finishAttributeValue = function() { this.current( "StartTag" /* StartTag */ ).attributes.push(this._currentAttribute); }; Tokenizer2.prototype.reportSyntaxError = function(message) { this.current().syntaxError = message; }; return Tokenizer2; })() ); // packages/blocks/build-module/api/validation/index.mjs var import_es6 = __toESM(require_es6(), 1); var import_deprecated7 = __toESM(require_deprecated(), 1); var import_html_entities = __toESM(require_html_entities(), 1); // packages/blocks/build-module/api/validation/logger.mjs function createLogger() { function createLogHandler(logger) { return (message, ...args) => logger("Block validation: " + message, ...args); } return { // eslint-disable-next-line no-console error: createLogHandler(console.error), // eslint-disable-next-line no-console warning: createLogHandler(console.warn), getItems() { return []; } }; } function createQueuedLogger() { const queue = []; const logger = createLogger(); return { error(...args) { queue.push({ log: logger.error, args }); }, warning(...args) { queue.push({ log: logger.warning, args }); }, getItems() { return queue; } }; } // packages/blocks/build-module/api/validation/index.mjs var identity = (x2) => x2; var REGEXP_WHITESPACE = /[\t\n\r\v\f ]+/g; var REGEXP_ONLY_WHITESPACE = /^[\t\n\r\v\f ]*$/; var REGEXP_STYLE_URL_TYPE = /^url\s*\(['"\s]*(.*?)['"\s]*\)$/; var BOOLEAN_ATTRIBUTES = [ "allowfullscreen", "allowpaymentrequest", "allowusermedia", "async", "autofocus", "autoplay", "checked", "controls", "default", "defer", "disabled", "download", "formnovalidate", "hidden", "ismap", "itemscope", "loop", "multiple", "muted", "nomodule", "novalidate", "open", "playsinline", "readonly", "required", "reversed", "selected", "typemustmatch" ]; var ENUMERATED_ATTRIBUTES = [ "autocapitalize", "autocomplete", "charset", "contenteditable", "crossorigin", "decoding", "dir", "draggable", "enctype", "formenctype", "formmethod", "http-equiv", "inputmode", "kind", "method", "preload", "scope", "shape", "spellcheck", "translate", "type", "wrap" ]; var MEANINGFUL_ATTRIBUTES = [ ...BOOLEAN_ATTRIBUTES, ...ENUMERATED_ATTRIBUTES ]; var TEXT_NORMALIZATIONS = [identity, getTextWithCollapsedWhitespace]; var REGEXP_NAMED_CHARACTER_REFERENCE = /^[\da-z]+$/i; var REGEXP_DECIMAL_CHARACTER_REFERENCE = /^#\d+$/; var REGEXP_HEXADECIMAL_CHARACTER_REFERENCE = /^#x[\da-f]+$/i; function isValidCharacterReference(text2) { return REGEXP_NAMED_CHARACTER_REFERENCE.test(text2) || REGEXP_DECIMAL_CHARACTER_REFERENCE.test(text2) || REGEXP_HEXADECIMAL_CHARACTER_REFERENCE.test(text2); } var DecodeEntityParser = class { /** * Returns a substitute string for an entity string sequence between `&` * and `;`, or undefined if no substitution should occur. * * @param {string} entity Entity fragment discovered in HTML. * * @return {string | undefined} Entity substitute value. */ parse(entity) { if (isValidCharacterReference(entity)) { return (0, import_html_entities.decodeEntities)("&" + entity + ";"); } } }; function getTextPiecesSplitOnWhitespace(text2) { return text2.trim().split(REGEXP_WHITESPACE); } function getTextWithCollapsedWhitespace(text2) { return getTextPiecesSplitOnWhitespace(text2).join(" "); } function getMeaningfulAttributePairs(token) { return token.attributes.filter((pair) => { const [key, value] = pair; return value || key.indexOf("data-") === 0 || MEANINGFUL_ATTRIBUTES.includes(key); }); } function isEquivalentTextTokens(actual, expected, logger = createLogger()) { let actualChars = actual.chars; let expectedChars = expected.chars; for (let i2 = 0; i2 < TEXT_NORMALIZATIONS.length; i2++) { const normalize = TEXT_NORMALIZATIONS[i2]; actualChars = normalize(actualChars); expectedChars = normalize(expectedChars); if (actualChars === expectedChars) { return true; } } logger.warning( "Expected text `%s`, saw `%s`.", expected.chars, actual.chars ); return false; } function getNormalizedLength(value) { if (0 === parseFloat(value)) { return "0"; } if (value.indexOf(".") === 0) { return "0" + value; } return value; } function getNormalizedStyleValue(value) { const textPieces = getTextPiecesSplitOnWhitespace(value); const normalizedPieces = textPieces.map(getNormalizedLength); const result = normalizedPieces.join(" "); return result.replace(REGEXP_STYLE_URL_TYPE, "url($1)"); } function getStyleProperties(text2) { const pairs = text2.replace(/;?\s*$/, "").split(";").map((style) => { const [key, ...valueParts] = style.split(":"); const value = valueParts.join(":"); return [key.trim(), getNormalizedStyleValue(value.trim())]; }); return Object.fromEntries(pairs); } var isEqualAttributesOfName = { class: (actual, expected) => { const [actualPieces, expectedPieces] = [actual, expected].map( getTextPiecesSplitOnWhitespace ); const actualDiff = actualPieces.filter( (c2) => !expectedPieces.includes(c2) ); const expectedDiff = expectedPieces.filter( (c2) => !actualPieces.includes(c2) ); return actualDiff.length === 0 && expectedDiff.length === 0; }, style: (actual, expected) => { return (0, import_es6.default)( ...[actual, expected].map(getStyleProperties) ); }, // For each boolean attribute, mere presence of attribute in both is enough // to assume equivalence. ...Object.fromEntries( BOOLEAN_ATTRIBUTES.map((attribute) => [attribute, () => true]) ) }; function isEqualTagAttributePairs(actual, expected, logger = createLogger()) { if (actual.length !== expected.length) { logger.warning( "Expected attributes %o, instead saw %o.", expected, actual ); return false; } const expectedAttributes = {}; for (let i2 = 0; i2 < expected.length; i2++) { expectedAttributes[expected[i2][0].toLowerCase()] = expected[i2][1]; } for (let i2 = 0; i2 < actual.length; i2++) { const [name, actualValue] = actual[i2]; const nameLower = name.toLowerCase(); if (!expectedAttributes.hasOwnProperty(nameLower)) { logger.warning("Encountered unexpected attribute `%s`.", name); return false; } const expectedValue = expectedAttributes[nameLower]; const isEqualAttributes = isEqualAttributesOfName[nameLower]; if (isEqualAttributes) { if (!isEqualAttributes(actualValue, expectedValue)) { logger.warning( "Expected attribute `%s` of value `%s`, saw `%s`.", name, expectedValue, actualValue ); return false; } } else if (actualValue !== expectedValue) { logger.warning( "Expected attribute `%s` of value `%s`, saw `%s`.", name, expectedValue, actualValue ); return false; } } return true; } var isEqualTokensOfType = { StartTag: (actual, expected, logger = createLogger()) => { if (actual.tagName !== expected.tagName && // Optimization: Use short-circuit evaluation to defer case- // insensitive check on the assumption that the majority case will // have exactly equal tag names. actual.tagName.toLowerCase() !== expected.tagName.toLowerCase()) { logger.warning( "Expected tag name `%s`, instead saw `%s`.", expected.tagName, actual.tagName ); return false; } return isEqualTagAttributePairs( ...[actual, expected].map(getMeaningfulAttributePairs), logger ); }, Chars: isEquivalentTextTokens, Comment: isEquivalentTextTokens }; function getNextNonWhitespaceToken(tokens) { let token; while (token = tokens.shift()) { if (token.type !== "Chars") { return token; } if (!REGEXP_ONLY_WHITESPACE.test(token.chars)) { return token; } } } function getHTMLTokens(html2, logger = createLogger()) { try { return new Tokenizer(new DecodeEntityParser()).tokenize(html2); } catch (e2) { logger.warning("Malformed HTML detected: %s", html2); } return null; } function isClosedByToken(currentToken, nextToken) { if (!currentToken.selfClosing) { return false; } if (nextToken && nextToken.tagName === currentToken.tagName && nextToken.type === "EndTag") { return true; } return false; } function isEquivalentHTML(actual, expected, logger = createLogger()) { if (actual === expected) { return true; } const [actualTokens, expectedTokens] = [actual, expected].map( (html2) => getHTMLTokens(html2, logger) ); if (!actualTokens || !expectedTokens) { return false; } let actualToken, expectedToken; while (actualToken = getNextNonWhitespaceToken(actualTokens)) { expectedToken = getNextNonWhitespaceToken(expectedTokens); if (!expectedToken) { logger.warning( "Expected end of content, instead saw %o.", actualToken ); return false; } if (actualToken.type !== expectedToken.type) { logger.warning( "Expected token of type `%s` (%o), instead saw `%s` (%o).", expectedToken.type, expectedToken, actualToken.type, actualToken ); return false; } const isEqualTokens = isEqualTokensOfType[actualToken.type]; if (isEqualTokens && !isEqualTokens(actualToken, expectedToken, logger)) { return false; } if (isClosedByToken(actualToken, expectedTokens[0])) { getNextNonWhitespaceToken(expectedTokens); } else if (isClosedByToken(expectedToken, actualTokens[0])) { getNextNonWhitespaceToken(actualTokens); } } if (expectedToken = getNextNonWhitespaceToken(expectedTokens)) { logger.warning( "Expected %o, instead saw end of content.", expectedToken ); return false; } return true; } function validateBlock(block, blockTypeOrName = block.name) { const isFallbackBlock = block.name === getFreeformContentHandlerName() || block.name === getUnregisteredTypeHandlerName(); if (isFallbackBlock) { return [true, []]; } const logger = createQueuedLogger(); const blockType = normalizeBlockType(blockTypeOrName); let generatedBlockContent; try { generatedBlockContent = getSaveContent(blockType, block.attributes); } catch (error) { logger.error( "Block validation failed because an error occurred while generating block content:\n\n%s", error.toString() ); return [false, logger.getItems()]; } const isValid = isEquivalentHTML( block.originalContent, generatedBlockContent, logger ); if (!isValid) { logger.error( "Block validation failed for `%s` (%o).\n\nContent generated by `save` function:\n\n%s\n\nContent retrieved from post body:\n\n%s", blockType.name, blockType, generatedBlockContent, block.originalContent ); } return [isValid, logger.getItems()]; } function isValidBlockContent(blockTypeOrName, attributes, originalBlockContent) { (0, import_deprecated7.default)("isValidBlockContent introduces opportunity for data loss", { since: "12.6", plugin: "Gutenberg", alternative: "validateBlock" }); const blockType = normalizeBlockType(blockTypeOrName); const block = { name: blockType.name, attributes, innerBlocks: [], originalContent: originalBlockContent }; const [isValid] = validateBlock(block, blockType); return isValid; } // packages/blocks/build-module/api/parser/convert-legacy-block.mjs function convertLegacyBlockNameAndAttributes(name, attributes) { const newAttributes = { ...attributes }; if ("core/cover-image" === name) { name = "core/cover"; } if ("core/text" === name || "core/cover-text" === name) { name = "core/paragraph"; } if (name && name.indexOf("core/social-link-") === 0) { newAttributes.service = name.substring(17); name = "core/social-link"; } if (name && name.indexOf("core-embed/") === 0) { const providerSlug = name.substring(11); const deprecated12 = { speaker: "speaker-deck", polldaddy: "crowdsignal" }; newAttributes.providerNameSlug = providerSlug in deprecated12 ? deprecated12[providerSlug] : providerSlug; if (!["amazon-kindle", "wordpress"].includes(providerSlug)) { newAttributes.responsive = true; } name = "core/embed"; } if (name === "core/post-comment-author") { name = "core/comment-author-name"; } if (name === "core/post-comment-content") { name = "core/comment-content"; } if (name === "core/post-comment-date") { name = "core/comment-date"; } if (name === "core/comments-query-loop") { name = "core/comments"; const { className = "" } = newAttributes; if (!className.includes("wp-block-comments-query-loop")) { newAttributes.className = [ "wp-block-comments-query-loop", className ].join(" "); } } if (name === "core/post-comments") { name = "core/comments"; newAttributes.legacy = true; } if (attributes.layout?.type === "grid" && typeof attributes.layout?.columnCount === "string") { newAttributes.layout = { ...newAttributes.layout, columnCount: parseInt(attributes.layout.columnCount, 10) }; } if (typeof attributes.style?.layout?.columnSpan === "string") { const columnSpanNumber = parseInt( attributes.style.layout.columnSpan, 10 ); newAttributes.style = { ...newAttributes.style, layout: { ...newAttributes.style.layout, columnSpan: isNaN(columnSpanNumber) ? void 0 : columnSpanNumber } }; } if (typeof attributes.style?.layout?.rowSpan === "string") { const rowSpanNumber = parseInt(attributes.style.layout.rowSpan, 10); newAttributes.style = { ...newAttributes.style, layout: { ...newAttributes.style.layout, rowSpan: isNaN(rowSpanNumber) ? void 0 : rowSpanNumber } }; } return [name, newAttributes]; } // node_modules/hpq/es/get-path.js function getPath(object, path) { var segments = path.split("."); var segment; while (segment = segments.shift()) { if (!(segment in object)) { return; } object = object[segment]; } return object; } // node_modules/hpq/es/index.js var getDocument = /* @__PURE__ */ (function() { var doc; return function() { if (!doc) { doc = document.implementation.createHTMLDocument(""); } return doc; }; })(); function parse(source, matchers) { if (!matchers) { return; } if ("string" === typeof source) { var doc = getDocument(); doc.body.innerHTML = source; source = doc.body; } if ("function" === typeof matchers) { return matchers(source); } if (Object !== matchers.constructor) { return; } return Object.keys(matchers).reduce(function(memo, key) { memo[key] = parse(source, matchers[key]); return memo; }, {}); } function prop(selector, name) { if (1 === arguments.length) { name = selector; selector = void 0; } return function(node) { var match = node; if (selector) { match = node.querySelector(selector); } if (match) { return getPath(match, name); } }; } function attr(selector, name) { if (1 === arguments.length) { name = selector; selector = void 0; } return function(node) { var attributes = prop(selector, "attributes")(node); if (attributes && attributes.hasOwnProperty(name)) { return attributes[name].value; } }; } function text(selector) { return prop(selector, "textContent"); } function query(selector, matchers) { return function(node) { var matches = node.querySelectorAll(selector); return [].map.call(matches, function(match) { return parse(match, matchers); }); }; } // node_modules/memize/dist/index.js function memize(fn, options) { var size = 0; var head; var tail; options = options || {}; function memoized() { var node = head, len = arguments.length, args, i2; searchCache: while (node) { if (node.args.length !== arguments.length) { node = node.next; continue; } for (i2 = 0; i2 < len; i2++) { if (node.args[i2] !== arguments[i2]) { node = node.next; continue searchCache; } } if (node !== head) { if (node === tail) { tail = node.prev; } node.prev.next = node.next; if (node.next) { node.next.prev = node.prev; } node.next = head; node.prev = null; head.prev = node; head = node; } return node.val; } args = new Array(len); for (i2 = 0; i2 < len; i2++) { args[i2] = arguments[i2]; } node = { args, // Generate the result from original function val: fn.apply(null, args) }; if (head) { head.prev = node; node.next = head; } else { tail = node; } if (size === /** @type {MemizeOptions} */ options.maxSize) { tail = /** @type {MemizeCacheNode} */ tail.prev; tail.next = null; } else { size++; } head = node; return node.val; } memoized.clear = function() { head = null; tail = null; size = 0; }; return memoized; } // packages/blocks/build-module/api/parser/get-block-attributes.mjs var import_hooks4 = __toESM(require_hooks(), 1); var import_rich_text4 = __toESM(require_rich_text(), 1); // packages/blocks/build-module/api/matchers.mjs var import_rich_text3 = __toESM(require_rich_text(), 1); // packages/blocks/build-module/api/node.mjs var import_deprecated9 = __toESM(require_deprecated(), 1); // packages/blocks/build-module/api/children.mjs var import_element3 = __toESM(require_element(), 1); var import_deprecated8 = __toESM(require_deprecated(), 1); function getSerializeCapableElement(children) { return children; } function getChildrenArray(children) { (0, import_deprecated8.default)("wp.blocks.children.getChildrenArray", { since: "6.1", version: "6.3", link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/" }); return children; } function concat(...blockNodes) { (0, import_deprecated8.default)("wp.blocks.children.concat", { since: "6.1", version: "6.3", alternative: "wp.richText.concat", link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/" }); const result = []; for (let i2 = 0; i2 < blockNodes.length; i2++) { const blockNode = Array.isArray(blockNodes[i2]) ? blockNodes[i2] : [blockNodes[i2]]; for (let j2 = 0; j2 < blockNode.length; j2++) { const child = blockNode[j2]; const canConcatToPreviousString = typeof child === "string" && typeof result[result.length - 1] === "string"; if (canConcatToPreviousString) { result[result.length - 1] += child; } else { result.push(child); } } } return result; } function fromDOM22(domNodes) { (0, import_deprecated8.default)("wp.blocks.children.fromDOM", { since: "6.1", version: "6.3", alternative: "wp.richText.create", link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/" }); const result = []; for (let i2 = 0; i2 < domNodes.length; i2++) { try { result.push(fromDOM2(domNodes[i2])); } catch (error) { } } return result; } function toHTML(children) { (0, import_deprecated8.default)("wp.blocks.children.toHTML", { since: "6.1", version: "6.3", alternative: "wp.richText.toHTMLString", link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/" }); const element = getSerializeCapableElement(children); return (0, import_element3.renderToString)(element); } function matcher(selector) { (0, import_deprecated8.default)("wp.blocks.children.matcher", { since: "6.1", version: "6.3", alternative: "html source", link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/" }); return (domNode) => { let match = domNode; if (selector) { match = domNode.querySelector(selector); } if (match) { return fromDOM22(match.childNodes); } return []; }; } var children_default = { concat, getChildrenArray, fromDOM: fromDOM22, toHTML, matcher }; // packages/blocks/build-module/api/node.mjs function isNodeOfType(node, type) { (0, import_deprecated9.default)("wp.blocks.node.isNodeOfType", { since: "6.1", version: "6.3", link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/" }); return node && node.type === type; } function getNamedNodeMapAsObject(nodeMap) { const result = {}; for (let i2 = 0; i2 < nodeMap.length; i2++) { const { name, value } = nodeMap[i2]; result[name] = value; } return result; } function fromDOM2(domNode) { (0, import_deprecated9.default)("wp.blocks.node.fromDOM", { since: "6.1", version: "6.3", alternative: "wp.richText.create", link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/" }); if (domNode.nodeType === domNode.TEXT_NODE) { return domNode.nodeValue; } if (domNode.nodeType !== domNode.ELEMENT_NODE) { throw new TypeError( "A block node can only be created from a node of type text or element." ); } return { type: domNode.nodeName.toLowerCase(), props: { ...getNamedNodeMapAsObject(domNode.attributes), children: fromDOM22(domNode.childNodes) } }; } function toHTML2(node) { (0, import_deprecated9.default)("wp.blocks.node.toHTML", { since: "6.1", version: "6.3", alternative: "wp.richText.toHTMLString", link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/" }); return toHTML([node]); } function matcher2(selector) { (0, import_deprecated9.default)("wp.blocks.node.matcher", { since: "6.1", version: "6.3", alternative: "html source", link: "https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/" }); return (domNode) => { let match = domNode; if (selector) { match = domNode.querySelector(selector); } try { return fromDOM2(match); } catch (error) { return null; } }; } var node_default = { isNodeOfType, fromDOM: fromDOM2, toHTML: toHTML2, matcher: matcher2 }; // packages/blocks/build-module/api/matchers.mjs function html(selector, multilineTag) { return (domNode) => { let match = domNode; if (selector) { match = domNode.querySelector(selector); } if (!match) { return ""; } if (multilineTag) { let value = ""; const length = match.children.length; for (let index = 0; index < length; index++) { const child = match.children[index]; if (child.nodeName.toLowerCase() !== multilineTag) { continue; } value += child.outerHTML; } return value; } return match.innerHTML; }; } var richText = (selector, preserveWhiteSpace) => (el) => { const target = selector ? el.querySelector(selector) : el; return target ? import_rich_text3.RichTextData.fromHTMLElement(target, { preserveWhiteSpace }) : import_rich_text3.RichTextData.empty(); }; // packages/blocks/build-module/api/parser/get-block-attributes.mjs var toBooleanAttributeMatcher = (matcher3) => (value) => matcher3(value) !== void 0; function isOfType(value, type) { switch (type) { case "rich-text": return value instanceof import_rich_text4.RichTextData; case "string": return typeof value === "string"; case "boolean": return typeof value === "boolean"; case "object": return !!value && value.constructor === Object; case "null": return value === null; case "array": return Array.isArray(value); case "integer": case "number": return typeof value === "number"; } return true; } function isOfTypes(value, types) { return types.some((type) => isOfType(value, type)); } function getBlockAttribute(attributeKey, attributeSchema, innerDOM, commentAttributes, innerHTML) { let value; switch (attributeSchema.source) { // An undefined source means that it's an attribute serialized to the // block's "comment". case void 0: value = commentAttributes ? commentAttributes[attributeKey] : void 0; break; // raw source means that it's the original raw block content. case "raw": value = innerHTML; break; case "attribute": case "property": case "html": case "text": case "rich-text": case "children": case "node": case "query": case "tag": value = parseWithAttributeSchema(innerDOM, attributeSchema); break; } if (!isValidByType(value, attributeSchema.type) || !isValidByEnum(value, attributeSchema.enum)) { value = void 0; } if (value === void 0) { value = getDefault(attributeSchema); } return value; } function isValidByType(value, type) { return type === void 0 || isOfTypes(value, Array.isArray(type) ? type : [type]); } function isValidByEnum(value, enumSet) { return !Array.isArray(enumSet) || enumSet.includes(value); } var matcherFromSource = memize((sourceConfig) => { switch (sourceConfig.source) { case "attribute": { let matcher3 = attr(sourceConfig.selector, sourceConfig.attribute); if (sourceConfig.type === "boolean") { matcher3 = toBooleanAttributeMatcher(matcher3); } return matcher3; } case "html": return html(sourceConfig.selector, sourceConfig.multiline); case "text": return text(sourceConfig.selector); case "rich-text": return richText( sourceConfig.selector, sourceConfig.__unstablePreserveWhiteSpace ); case "children": return matcher(sourceConfig.selector); case "node": return matcher2(sourceConfig.selector); case "query": const subMatchers = Object.fromEntries( Object.entries(sourceConfig.query).map( ([key, subSourceConfig]) => [ key, matcherFromSource(subSourceConfig) ] ) ); return query(sourceConfig.selector, subMatchers); case "tag": { const matcher3 = prop(sourceConfig.selector, "nodeName"); return (domNode) => matcher3(domNode)?.toLowerCase(); } default: console.error(`Unknown source type "${sourceConfig.source}"`); } }); function parseHtml(innerHTML) { return parse(innerHTML, (h2) => h2); } function parseWithAttributeSchema(innerHTML, attributeSchema) { return matcherFromSource(attributeSchema)(parseHtml(innerHTML)); } function getBlockAttributes(blockTypeOrName, innerHTML, attributes = {}) { const doc = parseHtml(innerHTML); const blockType = normalizeBlockType(blockTypeOrName); const blockAttributes = Object.fromEntries( Object.entries(blockType.attributes ?? {}).map( ([key, schema]) => [ key, getBlockAttribute(key, schema, doc, attributes, innerHTML) ] ) ); return (0, import_hooks4.applyFilters)( "blocks.getBlockAttributes", blockAttributes, blockType, innerHTML, attributes ); } // packages/blocks/build-module/api/parser/fix-custom-classname.mjs var CLASS_ATTR_SCHEMA = { type: "string", source: "attribute", selector: "[data-custom-class-name] > *", attribute: "class" }; function getHTMLRootElementClasses(innerHTML) { const parsed = parseWithAttributeSchema( `<div data-custom-class-name>${innerHTML}</div>`, CLASS_ATTR_SCHEMA ); return parsed ? parsed.trim().split(/\s+/) : []; } function fixCustomClassname(blockAttributes, blockType, innerHTML) { if (!hasBlockSupport(blockType, "customClassName", true)) { return blockAttributes; } const modifiedBlockAttributes = { ...blockAttributes }; const { className: omittedClassName, ...attributesSansClassName } = modifiedBlockAttributes; const serialized = getSaveContent(blockType, attributesSansClassName); const defaultClasses = getHTMLRootElementClasses(serialized); const actualClasses = getHTMLRootElementClasses(innerHTML); const customClasses = actualClasses.filter( (className) => !defaultClasses.includes(className) ); if (customClasses.length) { modifiedBlockAttributes.className = customClasses.join(" "); } else if (serialized) { delete modifiedBlockAttributes.className; } return modifiedBlockAttributes; } // packages/blocks/build-module/api/parser/fix-global-attribute.mjs function getHTMLRootElement(innerHTML, dataAttribute, attributeSchema) { const parsed = parseWithAttributeSchema( `<div ${dataAttribute}>${innerHTML}</div>`, attributeSchema ); return parsed; } function fixGlobalAttribute(blockAttributes, blockType, innerHTML, supportKey, dataAttribute, attributeSchema) { if (!hasBlockSupport(blockType, supportKey, false)) { return blockAttributes; } const modifiedBlockAttributes = { ...blockAttributes }; const attributeValue = getHTMLRootElement( innerHTML, dataAttribute, attributeSchema ); if (attributeValue) { modifiedBlockAttributes[supportKey] = attributeValue; } return modifiedBlockAttributes; } // packages/blocks/build-module/api/parser/apply-built-in-validation-fixes.mjs var ARIA_LABEL_ATTR_SCHEMA = { type: "string", source: "attribute", selector: "[data-aria-label] > *", attribute: "aria-label" }; var ANCHOR_ATTR_SCHEMA = { type: "string", source: "attribute", selector: "[data-anchor] > *", attribute: "id" }; function applyBuiltInValidationFixes(block, blockType) { const { attributes, originalContent } = block; let updatedBlockAttributes = attributes; updatedBlockAttributes = fixCustomClassname( attributes, blockType, originalContent ); updatedBlockAttributes = fixGlobalAttribute( updatedBlockAttributes, blockType, originalContent, "ariaLabel", "data-aria-label", ARIA_LABEL_ATTR_SCHEMA ); updatedBlockAttributes = fixGlobalAttribute( updatedBlockAttributes, blockType, originalContent, "anchor", "data-anchor", ANCHOR_ATTR_SCHEMA ); return { ...block, attributes: updatedBlockAttributes }; } // packages/blocks/build-module/api/parser/apply-block-deprecated-versions.mjs function stubFalse() { return false; } function applyBlockDeprecatedVersions(block, rawBlock, blockType) { const parsedAttributes = rawBlock.attrs; const { deprecated: deprecatedDefinitions } = blockType; if (!deprecatedDefinitions || !deprecatedDefinitions.length) { return block; } for (let i2 = 0; i2 < deprecatedDefinitions.length; i2++) { const { isEligible = stubFalse } = deprecatedDefinitions[i2]; if (block.isValid && !isEligible(parsedAttributes, block.innerBlocks, { blockNode: rawBlock, block })) { continue; } const deprecatedBlockType = Object.assign( omit(blockType, DEPRECATED_ENTRY_KEYS), deprecatedDefinitions[i2] ); let migratedBlock = { ...block, attributes: getBlockAttributes( deprecatedBlockType, block.originalContent, parsedAttributes ) }; let [isValid] = validateBlock(migratedBlock, deprecatedBlockType); if (!isValid) { migratedBlock = applyBuiltInValidationFixes( migratedBlock, deprecatedBlockType ); [isValid] = validateBlock(migratedBlock, deprecatedBlockType); } if (!isValid) { continue; } let migratedInnerBlocks = migratedBlock.innerBlocks; let migratedAttributes = migratedBlock.attributes; const { migrate } = deprecatedBlockType; if (migrate) { let migrated = migrate(migratedAttributes, block.innerBlocks); if (!Array.isArray(migrated)) { migrated = [migrated]; } [ migratedAttributes = parsedAttributes, migratedInnerBlocks = block.innerBlocks ] = migrated; } block = { ...block, attributes: migratedAttributes, innerBlocks: migratedInnerBlocks, isValid: true, validationIssues: [] }; } return block; } // packages/blocks/build-module/api/parser/index.mjs function convertLegacyBlocks(rawBlock) { const [correctName, correctedAttributes] = convertLegacyBlockNameAndAttributes( rawBlock.blockName, rawBlock.attrs ); return { ...rawBlock, blockName: correctName, attrs: correctedAttributes }; } function normalizeRawBlock(rawBlock, options) { const fallbackBlockName = getFreeformContentHandlerName(); const rawBlockName = rawBlock.blockName || getFreeformContentHandlerName(); const rawAttributes = rawBlock.attrs || {}; const rawInnerBlocks = rawBlock.innerBlocks || []; let rawInnerHTML = rawBlock.innerHTML.trim(); if (rawBlockName === fallbackBlockName && rawBlockName === "core/freeform" && !options?.__unstableSkipAutop) { rawInnerHTML = (0, import_autop2.autop)(rawInnerHTML).trim(); } return { ...rawBlock, blockName: rawBlockName, attrs: rawAttributes, innerHTML: rawInnerHTML, innerBlocks: rawInnerBlocks }; } function createMissingBlockType(rawBlock) { const unregisteredFallbackBlock = getUnregisteredTypeHandlerName() || getFreeformContentHandlerName(); const originalUndelimitedContent = serializeRawBlock(rawBlock, { isCommentDelimited: false }); const originalContent = serializeRawBlock(rawBlock, { isCommentDelimited: true }); return { blockName: unregisteredFallbackBlock, attrs: { originalName: rawBlock.blockName, originalContent, originalUndelimitedContent }, innerHTML: rawBlock.blockName ? originalContent : rawBlock.innerHTML, innerBlocks: rawBlock.innerBlocks, innerContent: rawBlock.innerContent }; } function applyBlockValidation(unvalidatedBlock, blockType) { const [isValid] = validateBlock(unvalidatedBlock, blockType); if (isValid) { return { ...unvalidatedBlock, isValid, validationIssues: [] }; } const fixedBlock = applyBuiltInValidationFixes( unvalidatedBlock, blockType ); const [isFixedValid, validationIssues] = validateBlock( fixedBlock, blockType ); return { ...fixedBlock, isValid: isFixedValid, validationIssues }; } function parseRawBlock(rawBlock, options) { let normalizedBlock = normalizeRawBlock(rawBlock, options); normalizedBlock = convertLegacyBlocks(normalizedBlock); let blockType = getBlockType(normalizedBlock.blockName); if (!blockType) { normalizedBlock = createMissingBlockType(normalizedBlock); blockType = getBlockType(normalizedBlock.blockName); } const isFallbackBlock = normalizedBlock.blockName === getFreeformContentHandlerName() || normalizedBlock.blockName === getUnregisteredTypeHandlerName(); if (!blockType || !normalizedBlock.innerHTML && isFallbackBlock) { return; } const parsedInnerBlocks = normalizedBlock.innerBlocks.map((innerBlock) => parseRawBlock(innerBlock, options)).filter((innerBlock) => !!innerBlock); const parsedBlock = createBlock( normalizedBlock.blockName, getBlockAttributes( blockType, normalizedBlock.innerHTML, normalizedBlock.attrs ), parsedInnerBlocks ); parsedBlock.originalContent = normalizedBlock.innerHTML; const validatedBlock = applyBlockValidation(parsedBlock, blockType); const { validationIssues } = validatedBlock; const updatedBlock = applyBlockDeprecatedVersions( validatedBlock, normalizedBlock, blockType ); if (!updatedBlock.isValid) { updatedBlock.__unstableBlockSource = rawBlock; } if (!validatedBlock.isValid && updatedBlock.isValid && !options?.__unstableSkipMigrationLogs) { console.groupCollapsed("Updated Block: %s", blockType.name); console.info( "Block successfully updated for `%s` (%o).\n\nNew content generated by `save` function:\n\n%s\n\nContent retrieved from post body:\n\n%s", blockType.name, blockType, getSaveContent(blockType, updatedBlock.attributes), updatedBlock.originalContent ); console.groupEnd(); } else if (!validatedBlock.isValid && !updatedBlock.isValid) { validationIssues.forEach(({ log: log2, args }) => log2(...args)); } return updatedBlock; } function parse2(content, options) { return (0, import_block_serialization_default_parser.parse)(content).reduce((accumulator, rawBlock) => { const block = parseRawBlock(rawBlock, options); if (block) { accumulator.push(block); } return accumulator; }, []); } // packages/blocks/build-module/api/raw-handling/index.mjs var import_deprecated10 = __toESM(require_deprecated(), 1); var import_dom12 = __toESM(require_dom(), 1); // packages/blocks/build-module/api/raw-handling/html-to-blocks.mjs var import_element4 = __toESM(require_element(), 1); // packages/blocks/build-module/api/raw-handling/get-raw-transforms.mjs function getRawTransforms() { return getBlockTransforms("from").filter(({ type }) => type === "raw").map((transform) => { return transform.isMatch ? transform : { ...transform, isMatch: (node) => transform.selector && node.matches(transform.selector) }; }); } // packages/blocks/build-module/api/raw-handling/html-to-blocks.mjs function htmlToBlocks(html2, handler) { const doc = document.implementation.createHTMLDocument(""); doc.body.innerHTML = html2; return Array.from(doc.body.children).flatMap((node) => { const rawTransform = findTransform( getRawTransforms(), ({ isMatch }) => isMatch(node) ); if (!rawTransform) { if (import_element4.Platform.isNative) { return parse2( `<!-- wp:html -->${node.outerHTML}<!-- /wp:html -->` ); } return createBlock( // Should not be hardcoded. "core/html", getBlockAttributes("core/html", node.outerHTML) ); } const { transform, blockName } = rawTransform; if (transform) { const block = transform(node, handler); if (node.hasAttribute("class")) { block.attributes.className = node.getAttribute("class"); } return block; } return createBlock( blockName, getBlockAttributes(blockName, node.outerHTML) ); }); } // packages/blocks/build-module/api/raw-handling/normalise-blocks.mjs var import_dom2 = __toESM(require_dom(), 1); function normaliseBlocks(HTML, options = {}) { const decuDoc = document.implementation.createHTMLDocument(""); const accuDoc = document.implementation.createHTMLDocument(""); const decu = decuDoc.body; const accu = accuDoc.body; decu.innerHTML = HTML; while (decu.firstChild) { const node = decu.firstChild; if (node.nodeType === node.TEXT_NODE) { if ((0, import_dom2.isEmpty)(node)) { decu.removeChild(node); } else { if (!accu.lastChild || accu.lastChild.nodeName !== "P") { accu.appendChild(accuDoc.createElement("P")); } accu.lastChild.appendChild(node); } } else if (node.nodeType === node.ELEMENT_NODE) { if (node.nodeName === "BR") { if (node.nextSibling && node.nextSibling.nodeName === "BR") { accu.appendChild(accuDoc.createElement("P")); decu.removeChild(node.nextSibling); } if (accu.lastChild && accu.lastChild.nodeName === "P" && accu.lastChild.hasChildNodes()) { accu.lastChild.appendChild(node); } else { decu.removeChild(node); } } else if (node.nodeName === "P") { if ((0, import_dom2.isEmpty)(node) && !options.raw) { decu.removeChild(node); } else { accu.appendChild(node); } } else if ((0, import_dom2.isPhrasingContent)(node)) { if (!accu.lastChild || accu.lastChild.nodeName !== "P") { accu.appendChild(accuDoc.createElement("P")); } accu.lastChild.appendChild(node); } else { accu.appendChild(node); } } else { decu.removeChild(node); } } return accu.innerHTML; } // packages/blocks/build-module/api/raw-handling/special-comment-converter.mjs var import_dom3 = __toESM(require_dom(), 1); function specialCommentConverter(node, doc) { if (node.nodeType !== node.COMMENT_NODE) { return; } if (node.nodeValue !== "nextpage" && node.nodeValue.indexOf("more") !== 0) { return; } const block = createBlock2(node, doc); if (!node.parentNode || node.parentNode.nodeName !== "P") { (0, import_dom3.replace)(node, block); } else { const childNodes = Array.from(node.parentNode.childNodes); const nodeIndex = childNodes.indexOf(node); const wrapperNode = node.parentNode.parentNode || doc.body; const paragraphBuilder = (acc, child) => { if (!acc) { acc = doc.createElement("p"); } acc.appendChild(child); return acc; }; [ childNodes.slice(0, nodeIndex).reduce(paragraphBuilder, null), block, childNodes.slice(nodeIndex + 1).reduce(paragraphBuilder, null) ].forEach( (element) => element && wrapperNode.insertBefore(element, node.parentNode) ); (0, import_dom3.remove)(node.parentNode); } } function createBlock2(commentNode, doc) { if (commentNode.nodeValue === "nextpage") { return createNextpage(doc); } const customText = commentNode.nodeValue.slice(4).trim(); let sibling = commentNode; let noTeaser = false; while (sibling = sibling.nextSibling) { if (sibling.nodeType === sibling.COMMENT_NODE && sibling.nodeValue === "noteaser") { noTeaser = true; (0, import_dom3.remove)(sibling); break; } } return createMore(customText, noTeaser, doc); } function createMore(customText, noTeaser, doc) { const node = doc.createElement("wp-block"); node.dataset.block = "core/more"; if (customText) { node.dataset.customText = customText; } if (noTeaser) { node.dataset.noTeaser = ""; } return node; } function createNextpage(doc) { const node = doc.createElement("wp-block"); node.dataset.block = "core/nextpage"; return node; } // packages/blocks/build-module/api/raw-handling/list-reducer.mjs var import_dom4 = __toESM(require_dom(), 1); function isList(node) { return node.nodeName === "OL" || node.nodeName === "UL"; } function shallowTextContent(element) { return Array.from(element.childNodes).map(({ nodeValue = "" }) => nodeValue).join(""); } function listReducer(node) { if (!isList(node)) { return; } const list = node; const prevElement = node.previousElementSibling; if (prevElement && prevElement.nodeName === node.nodeName && list.children.length === 1) { while (list.firstChild) { prevElement.appendChild(list.firstChild); } list.parentNode.removeChild(list); } const parentElement = node.parentNode; if (parentElement && parentElement.nodeName === "LI" && parentElement.children.length === 1 && !/\S/.test(shallowTextContent(parentElement))) { const parentListItem = parentElement; const prevListItem = parentListItem.previousElementSibling; const parentList = parentListItem.parentNode; if (prevListItem) { prevListItem.appendChild(list); parentList.removeChild(parentListItem); } } if (parentElement && isList(parentElement)) { const prevListItem = node.previousElementSibling; if (prevListItem) { prevListItem.appendChild(node); } else { (0, import_dom4.unwrap)(node); } } } // packages/blocks/build-module/api/raw-handling/blockquote-normaliser.mjs function blockquoteNormaliser(options) { return (node) => { if (node.nodeName !== "BLOCKQUOTE") { return; } node.innerHTML = normaliseBlocks(node.innerHTML, options); }; } // packages/blocks/build-module/api/raw-handling/figure-content-reducer.mjs var import_dom5 = __toESM(require_dom(), 1); function isFigureContent(node, schema) { const tag = node.nodeName.toLowerCase(); if (tag === "figcaption" || (0, import_dom5.isTextContent)(node)) { return false; } return tag in (schema?.figure?.children ?? {}); } function canHaveAnchor(node, schema) { const tag = node.nodeName.toLowerCase(); return tag in (schema?.figure?.children?.a?.children ?? {}); } function wrapFigureContent(element, beforeElement = element) { const figure = element.ownerDocument.createElement("figure"); beforeElement.parentNode.insertBefore(figure, beforeElement); figure.appendChild(element); } function figureContentReducer(node, doc, schema) { if (!isFigureContent(node, schema)) { return; } let nodeToInsert = node; const parentNode = node.parentNode; if (canHaveAnchor(node, schema) && parentNode.nodeName === "A" && parentNode.childNodes.length === 1) { nodeToInsert = node.parentNode; } const wrapper = nodeToInsert.closest("p,div"); if (wrapper) { if (!node.classList) { wrapFigureContent(nodeToInsert, wrapper); } else if (node.classList.contains("alignright") || node.classList.contains("alignleft") || node.classList.contains("aligncenter") || !wrapper.textContent.trim()) { wrapFigureContent(nodeToInsert, wrapper); } } else { wrapFigureContent(nodeToInsert); } } // packages/blocks/build-module/api/raw-handling/shortcode-converter.mjs var import_shortcode = __toESM(require_shortcode(), 1); var castArray = (maybeArray) => Array.isArray(maybeArray) ? maybeArray : [maybeArray]; var beforeLineRegexp = /(\n|<p>)\s*$/; var afterLineRegexp = /^\s*(\n|<\/p>)/; function segmentHTMLToShortcodeBlock(HTML, lastIndex = 0, excludedBlockNames = []) { const transformsFrom = getBlockTransforms("from"); const transformation = findTransform( transformsFrom, (transform) => excludedBlockNames.indexOf(transform.blockName) === -1 && transform.type === "shortcode" && castArray(transform.tag).some( (tag) => (0, import_shortcode.regexp)(tag).test(HTML) ) ); if (!transformation) { return [HTML]; } const transformTags = castArray(transformation.tag); const transformTag = transformTags.find( (tag) => (0, import_shortcode.regexp)(tag).test(HTML) ); let match; const previousIndex = lastIndex; if (match = (0, import_shortcode.next)(transformTag, HTML, lastIndex)) { lastIndex = match.index + match.content.length; const beforeHTML = HTML.substr(0, match.index); const afterHTML = HTML.substr(lastIndex); if (!match.shortcode.content?.includes("<") && !(beforeLineRegexp.test(beforeHTML) && afterLineRegexp.test(afterHTML))) { return segmentHTMLToShortcodeBlock(HTML, lastIndex); } if (transformation.isMatch && !transformation.isMatch(match.shortcode.attrs)) { return segmentHTMLToShortcodeBlock(HTML, previousIndex, [ ...excludedBlockNames, transformation.blockName ]); } let blocks = []; if (typeof transformation.transform === "function") { blocks = [].concat( transformation.transform(match.shortcode.attrs, match) ); blocks = blocks.map((block) => { block.originalContent = match.shortcode.content; return applyBuiltInValidationFixes( block, getBlockType(block.name) ); }); } else { const attributes = Object.fromEntries( Object.entries(transformation.attributes).filter(([, schema]) => schema.shortcode).map(([key, schema]) => [ key, schema.shortcode(match.shortcode.attrs, match) ]) ); const blockType = getBlockType(transformation.blockName); if (!blockType) { return [HTML]; } const transformationBlockType = { ...blockType, attributes: transformation.attributes }; let block = createBlock( transformation.blockName, getBlockAttributes( transformationBlockType, match.shortcode.content, attributes ) ); block.originalContent = match.shortcode.content; block = applyBuiltInValidationFixes( block, transformationBlockType ); blocks = [block]; } return [ ...segmentHTMLToShortcodeBlock( beforeHTML.replace(beforeLineRegexp, "") ), ...blocks, ...segmentHTMLToShortcodeBlock( afterHTML.replace(afterLineRegexp, "") ) ]; } return [HTML]; } var shortcode_converter_default = segmentHTMLToShortcodeBlock; // packages/blocks/build-module/api/raw-handling/utils.mjs var import_dom6 = __toESM(require_dom(), 1); function getBlockContentSchemaFromTransforms(transforms, context) { const phrasingContentSchema = (0, import_dom6.getPhrasingContentSchema)(context); const schemaArgs = { phrasingContentSchema, isPaste: context === "paste" }; const schemas = transforms.map(({ isMatch, blockName, schema }) => { const hasAnchorSupport = hasBlockSupport(blockName, "anchor"); schema = typeof schema === "function" ? schema(schemaArgs) : schema; if (!hasAnchorSupport && !isMatch) { return schema; } if (!schema) { return {}; } return Object.fromEntries( Object.entries(schema).map(([key, value]) => { let attributes = value.attributes || []; if (hasAnchorSupport) { attributes = [...attributes, "id"]; } return [ key, { ...value, attributes, isMatch: isMatch ? isMatch : void 0 } ]; }) ); }); function mergeTagNameSchemaProperties(objValue, srcValue, key) { switch (key) { case "children": { if (objValue === "*" || srcValue === "*") { return "*"; } return { ...objValue, ...srcValue }; } case "attributes": case "require": { return [...objValue || [], ...srcValue || []]; } case "isMatch": { if (!objValue || !srcValue) { return void 0; } return (...args) => { return objValue(...args) || srcValue(...args); }; } } } function mergeTagNameSchemas(a2, b2) { for (const key in b2) { a2[key] = a2[key] ? mergeTagNameSchemaProperties(a2[key], b2[key], key) : { ...b2[key] }; } return a2; } function mergeSchemas(a2, b2) { for (const key in b2) { a2[key] = a2[key] ? mergeTagNameSchemas(a2[key], b2[key]) : { ...b2[key] }; } return a2; } return schemas.reduce(mergeSchemas, {}); } function getBlockContentSchema(context) { return getBlockContentSchemaFromTransforms(getRawTransforms(), context); } function isPlain(HTML) { if (!/<(?!br[ />])/i.test(HTML)) { return true; } const doc = document.implementation.createHTMLDocument(""); doc.body.innerHTML = HTML; if (doc.body.children.length !== 1) { return false; } const wrapper = doc.body.children.item(0); const descendants = wrapper.getElementsByTagName("*"); for (let i2 = 0; i2 < descendants.length; i2++) { if (descendants.item(i2).tagName !== "BR") { return false; } } if (wrapper.tagName !== "SPAN") { return false; } return true; } function deepFilterNodeList(nodeList, filters, doc, schema) { Array.from(nodeList).forEach((node) => { deepFilterNodeList(node.childNodes, filters, doc, schema); filters.forEach((item) => { if (!doc.contains(node)) { return; } item(node, doc, schema); }); }); } function deepFilterHTML(HTML, filters = [], schema) { const doc = document.implementation.createHTMLDocument(""); doc.body.innerHTML = HTML; deepFilterNodeList(doc.body.childNodes, filters, doc, schema); return doc.body.innerHTML; } function getSibling(node, which) { const sibling = node[`${which}Sibling`]; if (sibling && (0, import_dom6.isPhrasingContent)(sibling)) { return sibling; } const { parentNode } = node; if (!parentNode || !(0, import_dom6.isPhrasingContent)(parentNode)) { return; } return getSibling(parentNode, which); } // packages/blocks/build-module/api/raw-handling/paste-handler.mjs var import_dom11 = __toESM(require_dom(), 1); // packages/blocks/build-module/api/raw-handling/comment-remover.mjs var import_dom7 = __toESM(require_dom(), 1); function commentRemover(node) { if (node.nodeType === node.COMMENT_NODE) { (0, import_dom7.remove)(node); } } // packages/blocks/build-module/api/raw-handling/is-inline-content.mjs var import_dom8 = __toESM(require_dom(), 1); function isInline(node, contextTag) { if ((0, import_dom8.isTextContent)(node)) { return true; } if (!contextTag) { return false; } const tag = node.nodeName.toLowerCase(); const inlineAllowedTagGroups = [ ["ul", "li", "ol"], ["h1", "h2", "h3", "h4", "h5", "h6"] ]; return inlineAllowedTagGroups.some( (tagGroup) => [tag, contextTag].filter((t3) => !tagGroup.includes(t3)).length === 0 ); } function deepCheck(nodes, contextTag) { return nodes.every( (node) => isInline(node, contextTag) && deepCheck(Array.from(node.children), contextTag) ); } function isDoubleBR(node) { return node.nodeName === "BR" && node.previousSibling && node.previousSibling.nodeName === "BR"; } function isInlineContent(HTML, contextTag) { const doc = document.implementation.createHTMLDocument(""); doc.body.innerHTML = HTML; const nodes = Array.from(doc.body.children); return !nodes.some(isDoubleBR) && deepCheck(nodes, contextTag); } // packages/blocks/build-module/api/raw-handling/phrasing-content-reducer.mjs var import_dom9 = __toESM(require_dom(), 1); function phrasingContentReducer(node, doc) { if (node.nodeName === "SPAN" && node.style) { const { fontWeight, fontStyle, textDecorationLine, textDecoration, verticalAlign } = node.style; if (fontWeight === "bold" || fontWeight === "700") { (0, import_dom9.wrap)(doc.createElement("strong"), node); } if (fontStyle === "italic") { (0, import_dom9.wrap)(doc.createElement("em"), node); } if (textDecorationLine === "line-through" || textDecoration.includes("line-through")) { (0, import_dom9.wrap)(doc.createElement("s"), node); } if (verticalAlign === "super") { (0, import_dom9.wrap)(doc.createElement("sup"), node); } else if (verticalAlign === "sub") { (0, import_dom9.wrap)(doc.createElement("sub"), node); } } else if (node.nodeName === "B") { node = (0, import_dom9.replaceTag)(node, "strong"); } else if (node.nodeName === "I") { node = (0, import_dom9.replaceTag)(node, "em"); } else if (node.nodeName === "A") { if (node.target && node.target.toLowerCase() === "_blank") { node.rel = "noreferrer noopener"; } else { node.removeAttribute("target"); node.removeAttribute("rel"); } if (node.name && !node.id) { node.id = node.name; } if (node.id && !node.ownerDocument.querySelector(`[href="#${node.id}"]`)) { node.removeAttribute("id"); } } } // packages/blocks/build-module/api/raw-handling/head-remover.mjs function headRemover(node) { if (node.nodeName !== "SCRIPT" && node.nodeName !== "NOSCRIPT" && node.nodeName !== "TEMPLATE" && node.nodeName !== "STYLE") { return; } node.parentNode.removeChild(node); } // packages/blocks/build-module/api/raw-handling/ms-list-ignore.mjs function msListIgnore(node) { if (node.nodeType !== node.ELEMENT_NODE) { return; } const style = node.getAttribute("style"); if (!style || !style.includes("mso-list")) { return; } const rules = style.split(";").reduce((acc, rule) => { const [key, value] = rule.split(":"); if (key && value) { acc[key.trim().toLowerCase()] = value.trim().toLowerCase(); } return acc; }, {}); if (rules["mso-list"] === "ignore") { node.remove(); } } // packages/blocks/build-module/api/raw-handling/ms-list-converter.mjs function isList2(node) { return node.nodeName === "OL" || node.nodeName === "UL"; } function msListConverter(node, doc) { if (node.nodeName !== "P") { return; } const style = node.getAttribute("style"); if (!style || !style.includes("mso-list")) { return; } const prevNode = node.previousElementSibling; if (!prevNode || !isList2(prevNode)) { const type = node.textContent.trim().slice(0, 1); const isNumeric = /[1iIaA]/.test(type); const newListNode = doc.createElement(isNumeric ? "ol" : "ul"); if (isNumeric) { newListNode.setAttribute("type", type); } node.parentNode.insertBefore(newListNode, node); } const listNode = node.previousElementSibling; const listType = listNode.nodeName; const listItem = doc.createElement("li"); let receivingNode = listNode; listItem.innerHTML = deepFilterHTML(node.innerHTML, [msListIgnore]); const matches = /mso-list\s*:[^;]+level([0-9]+)/i.exec(style); let level = matches ? parseInt(matches[1], 10) - 1 || 0 : 0; while (level--) { receivingNode = receivingNode.lastChild || receivingNode; if (isList2(receivingNode)) { receivingNode = receivingNode.lastChild || receivingNode; } } if (!isList2(receivingNode)) { receivingNode = receivingNode.appendChild( doc.createElement(listType) ); } receivingNode.appendChild(listItem); node.parentNode.removeChild(node); } // packages/blocks/build-module/api/raw-handling/image-corrector.mjs var import_blob = __toESM(require_blob(), 1); function imageCorrector(node) { if (node.nodeName !== "IMG") { return; } if (node.src.indexOf("file:") === 0) { node.src = ""; } if (node.src.indexOf("data:") === 0) { const [properties, data] = node.src.split(","); const [type] = properties.slice(5).split(";"); if (!data || !type) { node.src = ""; return; } let decoded; try { decoded = atob(data); } catch (e2) { node.src = ""; return; } const uint8Array = new Uint8Array(decoded.length); for (let i2 = 0; i2 < uint8Array.length; i2++) { uint8Array[i2] = decoded.charCodeAt(i2); } const name = type.replace("/", "."); const file = new window.File([uint8Array], name, { type }); node.src = (0, import_blob.createBlobURL)(file); } if (node.height === 1 || node.width === 1) { node.parentNode.removeChild(node); } } // packages/blocks/build-module/api/raw-handling/div-normaliser.mjs function divNormaliser(node) { if (node.nodeName !== "DIV") { return; } node.innerHTML = normaliseBlocks(node.innerHTML); } // packages/blocks/build-module/api/raw-handling/markdown-converter.mjs var import_showdown = __toESM(require_showdown(), 1); var converter = new import_showdown.default.Converter({ noHeaderId: true, tables: true, literalMidWordUnderscores: true, omitExtraWLInCodeBlocks: true, simpleLineBreaks: true, strikethrough: true }); function slackMarkdownVariantCorrector(text2) { return text2.replace( /((?:^|\n)```)([^\n`]+)(```(?:$|\n))/, (match, p1, p2, p3) => `${p1} ${p2} ${p3}` ); } function bulletsToAsterisks(text2) { return text2.replace(/(^|\n)•( +)/g, "$1*$2"); } function markdownConverter(text2) { return converter.makeHtml( slackMarkdownVariantCorrector(bulletsToAsterisks(text2)) ); } // packages/blocks/build-module/api/raw-handling/iframe-remover.mjs function iframeRemover(node) { if (node.nodeName === "IFRAME") { const text2 = node.ownerDocument.createTextNode(node.src); node.parentNode.replaceChild(text2, node); } } // packages/blocks/build-module/api/raw-handling/google-docs-uid-remover.mjs var import_dom10 = __toESM(require_dom(), 1); function googleDocsUIdRemover(node) { if (!node.id || node.id.indexOf("docs-internal-guid-") !== 0) { return; } if (node.tagName === "B") { (0, import_dom10.unwrap)(node); } else { node.removeAttribute("id"); } } // packages/blocks/build-module/api/raw-handling/html-formatting-remover.mjs function isFormattingSpace(character) { return character === " " || character === "\r" || character === "\n" || character === " "; } function htmlFormattingRemover(node) { if (node.nodeType !== node.TEXT_NODE) { return; } let parent = node; while (parent = parent.parentNode) { if (parent.nodeType === parent.ELEMENT_NODE && parent.nodeName === "PRE") { return; } } let newData = node.data.replace(/[ \r\n\t]+/g, " "); if (newData[0] === " ") { const previousSibling = getSibling(node, "previous"); if (!previousSibling || previousSibling.nodeName === "BR" || previousSibling.textContent.slice(-1) === " ") { newData = newData.slice(1); } } if (newData[newData.length - 1] === " ") { const nextSibling = getSibling(node, "next"); if (!nextSibling || nextSibling.nodeName === "BR" || nextSibling.nodeType === nextSibling.TEXT_NODE && isFormattingSpace(nextSibling.textContent[0])) { newData = newData.slice(0, -1); } } if (!newData) { node.parentNode.removeChild(node); } else { node.data = newData; } } // packages/blocks/build-module/api/raw-handling/br-remover.mjs function brRemover(node) { if (node.nodeName !== "BR") { return; } if (getSibling(node, "next")) { return; } node.parentNode.removeChild(node); } // packages/blocks/build-module/api/raw-handling/empty-paragraph-remover.mjs function emptyParagraphRemover(node) { if (node.nodeName !== "P") { return; } if (node.hasChildNodes()) { return; } node.parentNode.removeChild(node); } // packages/blocks/build-module/api/raw-handling/slack-paragraph-corrector.mjs function slackParagraphCorrector(node) { if (node.nodeName !== "SPAN") { return; } if (node.getAttribute("data-stringify-type") !== "paragraph-break") { return; } const { parentNode } = node; parentNode.insertBefore(node.ownerDocument.createElement("br"), node); parentNode.insertBefore(node.ownerDocument.createElement("br"), node); parentNode.removeChild(node); } // packages/blocks/build-module/api/raw-handling/latex-to-math.mjs function isLatexMathMode(text2) { const lettersRegex = /[\p{L}\s]+/gu; let match; while (match = lettersRegex.exec(text2)) { if (text2[match.index - 1] === "{") { continue; } let sequence = match[0]; if (text2[match.index - 1] === "\\") { sequence = sequence.replace(/^[a-zA-Z]+/, ""); } if (sequence.length < 6) { continue; } return false; } if (/\\[a-zA-Z]+\s*\{/g.test(text2)) { return true; } const softClues = [ (t3) => t3.includes("^") && !t3.startsWith("^"), (t3) => ["=", "+", "-", "/", "*"].some( (operator) => t3.includes(operator) ), (t3) => /\\[a-zA-Z]+/g.test(t3) ]; if (softClues.filter((clue) => clue(text2)).length >= 2) { return true; } return false; } // packages/blocks/build-module/api/raw-handling/heading-transformer.mjs function headingTransformer(node) { if (node.nodeType !== node.ELEMENT_NODE) { return; } if (node.tagName === "P" && node.getAttribute("role") === "heading" && node.hasAttribute("aria-level")) { const level = parseInt(node.getAttribute("aria-level"), 10); if (level >= 1 && level <= 6) { const headingTag = `H${level}`; const newHeading = node.ownerDocument.createElement(headingTag); Array.from(node.attributes).forEach((attr2) => { if (attr2.name !== "role" && attr2.name !== "aria-level") { newHeading.setAttribute(attr2.name, attr2.value); } }); while (node.firstChild) { newHeading.appendChild(node.firstChild); } node.parentNode.replaceChild(newHeading, node); } } } // packages/blocks/build-module/api/raw-handling/paste-handler.mjs var log = (...args) => window?.console?.log?.(...args); function filterInlineHTML(HTML) { HTML = deepFilterHTML(HTML, [ headRemover, googleDocsUIdRemover, msListIgnore, phrasingContentReducer, commentRemover ]); HTML = (0, import_dom11.removeInvalidHTML)(HTML, (0, import_dom11.getPhrasingContentSchema)("paste"), { inline: true }); HTML = deepFilterHTML(HTML, [htmlFormattingRemover, brRemover]); log("Processed inline HTML:\n\n", HTML); return HTML; } function pasteHandler({ HTML = "", plainText = "", mode = "AUTO", tagName }) { log("Received HTML (pasteHandler):\n\n", HTML); log("Received plain text (pasteHandler):\n\n", plainText); HTML = HTML.replace(/<meta[^>]+>/g, ""); HTML = HTML.replace( /^\s*<html[^>]*>\s*<body[^>]*>(?:\s*<!--\s*StartFragment\s*-->)?/i, "" ); HTML = HTML.replace( /(?:<!--\s*EndFragment\s*-->\s*)?<\/body>\s*<\/html>\s*$/i, "" ); if (mode !== "INLINE") { const content = HTML ? HTML : plainText; if (content.indexOf("<!-- wp:") !== -1) { const parseResult = parse2(content); const isSingleFreeFormBlock = parseResult.length === 1 && parseResult[0].name === "core/freeform"; if (!isSingleFreeFormBlock) { return parseResult; } } } if (String.prototype.normalize) { HTML = HTML.normalize(); } HTML = deepFilterHTML(HTML, [slackParagraphCorrector]); const isPlainText = plainText && (!HTML || isPlain(HTML)); if (isPlainText && isLatexMathMode(plainText)) { return [createBlock("core/math", { latex: plainText })]; } if (isPlainText) { HTML = plainText; if (!/^\s+$/.test(plainText)) { HTML = markdownConverter(HTML); } } const pieces = shortcode_converter_default(HTML); const hasShortcodes = pieces.length > 1; if (isPlainText && !hasShortcodes) { if (mode === "AUTO" && plainText.indexOf("\n") === -1 && plainText.indexOf("<p>") !== 0 && HTML.indexOf("<p>") === 0) { mode = "INLINE"; } } if (mode === "INLINE") { return filterInlineHTML(HTML); } if (mode === "AUTO" && !hasShortcodes && isInlineContent(HTML, tagName)) { return filterInlineHTML(HTML); } const phrasingContentSchema = (0, import_dom11.getPhrasingContentSchema)("paste"); const blockContentSchema = getBlockContentSchema("paste"); const blocks = pieces.map((piece) => { if (typeof piece !== "string") { return piece; } const filters = [ googleDocsUIdRemover, msListConverter, headRemover, listReducer, imageCorrector, phrasingContentReducer, specialCommentConverter, commentRemover, iframeRemover, figureContentReducer, blockquoteNormaliser(), divNormaliser, headingTransformer ]; const schema = { ...blockContentSchema, // Keep top-level phrasing content, normalised by `normaliseBlocks`. ...phrasingContentSchema }; piece = deepFilterHTML(piece, filters, blockContentSchema); piece = (0, import_dom11.removeInvalidHTML)(piece, schema); piece = normaliseBlocks(piece); piece = deepFilterHTML( piece, [htmlFormattingRemover, brRemover, emptyParagraphRemover], blockContentSchema ); log("Processed HTML piece:\n\n", piece); return htmlToBlocks(piece, pasteHandler); }).flat().filter(Boolean); if (mode === "AUTO" && blocks.length === 1 && hasBlockSupport(blocks[0].name, "__unstablePasteTextInline", false)) { const trimRegex = /^[\n]+|[\n]+$/g; const trimmedPlainText = plainText.replace(trimRegex, ""); if (trimmedPlainText !== "" && trimmedPlainText.indexOf("\n") === -1) { return (0, import_dom11.removeInvalidHTML)( getBlockInnerHTML(blocks[0]), phrasingContentSchema ).replace(trimRegex, ""); } } return blocks; } // packages/blocks/build-module/api/raw-handling/index.mjs function deprecatedGetPhrasingContentSchema(context) { (0, import_deprecated10.default)("wp.blocks.getPhrasingContentSchema", { since: "5.6", alternative: "wp.dom.getPhrasingContentSchema" }); return (0, import_dom12.getPhrasingContentSchema)(context); } function rawHandler({ HTML = "" }) { if (HTML.indexOf("<!-- wp:") !== -1) { const parseResult = parse2(HTML); const isSingleFreeFormBlock = parseResult.length === 1 && parseResult[0].name === "core/freeform"; if (!isSingleFreeFormBlock) { return parseResult; } } const pieces = shortcode_converter_default(HTML); const blockContentSchema = getBlockContentSchema(); return pieces.map((piece) => { if (typeof piece !== "string") { return piece; } const filters = [ // Needed to adjust invalid lists. listReducer, // Needed to create more and nextpage blocks. specialCommentConverter, // Needed to create media blocks. figureContentReducer, // Needed to create the quote block, which cannot handle text // without wrapper paragraphs. blockquoteNormaliser({ raw: true }) ]; piece = deepFilterHTML(piece, filters, blockContentSchema); piece = normaliseBlocks(piece, { raw: true }); return htmlToBlocks(piece, rawHandler); }).flat().filter(Boolean); } // packages/blocks/build-module/api/categories.mjs var import_data6 = __toESM(require_data(), 1); function getCategories2() { return (0, import_data6.select)(store).getCategories(); } function setCategories2(categories2) { (0, import_data6.dispatch)(store).setCategories(categories2); } function updateCategory2(slug, category) { (0, import_data6.dispatch)(store).updateCategory(slug, category); } // packages/blocks/build-module/api/templates.mjs var import_element5 = __toESM(require_element(), 1); function doBlocksMatchTemplate(blocks = [], template = []) { return blocks.length === template.length && template.every(([name, , innerBlocksTemplate], index) => { const block = blocks[index]; return name === block.name && doBlocksMatchTemplate(block.innerBlocks, innerBlocksTemplate); }); } var isHTMLAttribute = (attributeDefinition) => attributeDefinition?.source === "html"; var isQueryAttribute = (attributeDefinition) => attributeDefinition?.source === "query"; function normalizeAttributes(schema, values) { if (!values) { return {}; } return Object.fromEntries( Object.entries(values).map(([key, value]) => [ key, normalizeAttribute(schema[key], value) ]) ); } function normalizeAttribute(definition, value) { if (isHTMLAttribute(definition) && Array.isArray(value)) { return (0, import_element5.renderToString)(value); } if (isQueryAttribute(definition) && value) { return value.map((subValues) => { return normalizeAttributes(definition.query, subValues); }); } return value; } function synchronizeBlocksWithTemplate(blocks = [], template) { if (!template) { return blocks; } return template.map( ([name, attributes, innerBlocksTemplate], index) => { const block = blocks[index]; if (block && block.name === name) { const innerBlocks = synchronizeBlocksWithTemplate( block.innerBlocks, innerBlocksTemplate ); return { ...block, innerBlocks }; } const blockType = getBlockType(name); const normalizedAttributes = normalizeAttributes( blockType?.attributes ?? {}, attributes ); const [blockName, blockAttributes] = convertLegacyBlockNameAndAttributes( name, normalizedAttributes ); return createBlock( blockName, blockAttributes, synchronizeBlocksWithTemplate([], innerBlocksTemplate) ); } ); } // packages/blocks/build-module/api/index.mjs var fieldsKey = /* @__PURE__ */ Symbol("fields"); var formKey = /* @__PURE__ */ Symbol("form"); var privateApis = {}; lock(privateApis, { isContentBlock, fieldsKey, formKey, parseRawBlock }); // packages/blocks/build-module/deprecated.mjs var import_deprecated11 = __toESM(require_deprecated(), 1); function withBlockContentContext(OriginalComponent) { (0, import_deprecated11.default)("wp.blocks.withBlockContentContext", { since: "6.1" }); return OriginalComponent; } return __toCommonJS(index_exports); })(); /*! Bundled license information: react-is/cjs/react-is.development.js: (** * @license React * react-is.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. *) showdown/dist/showdown.js: (*! showdown v 1.9.1 - 02-11-2019 *) is-plain-object/dist/is-plain-object.mjs: (*! * is-plain-object <https://github.com/jonschlinkert/is-plain-object> * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. *) */ block-serialization-default-parser.min.js 0000644 00000004560 15206720414 0014553 0 ustar 00 "use strict";var wp;(wp||={}).blockSerializationDefaultParser=(()=>{var m=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var B=Object.prototype.hasOwnProperty;var F=(t,e)=>{for(var s in e)m(t,s,{get:e[s],enumerable:!0})},H=(t,e,s,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of T(e))!B.call(t,n)&&n!==s&&m(t,n,{get:()=>e[n],enumerable:!(o=S(e,n))||o.enumerable});return t};var w=t=>H(m({},"__esModule",{value:!0}),t);var L={};F(L,{parse:()=>y});var a,l,i,f,C=/<!--\s+(\/)?wp:([a-z][a-z0-9_-]*\/)?([a-z][a-z0-9_-]*)\s+({(?:(?=([^}]+|}+(?=})|(?!}\s+\/?-->)[^])*)\5|[^]*?)}\s+)?(\/)?-->/g;function k(t,e,s,o,n){return{blockName:t,attrs:e,innerBlocks:s,innerHTML:o,innerContent:n}}function g(t){return k(null,{},[],t,[t])}function N(t,e,s,o,n){return{block:t,tokenStart:e,tokenLength:s,prevOffset:o||e+s,leadingHtmlStart:n}}var y=t=>{a=t,l=0,i=[],f=[],C.lastIndex=0;do;while(A());return i};function A(){let t=f.length,e=J(),[s,o,n,r,c]=e,p=r>l?l:null;switch(s){case"no-more-tokens":if(t===0)return d(),!1;if(t===1)return v(),!1;for(;0<f.length;)v();return!1;case"void-block":return t===0?(p!==null&&i.push(g(a.substr(p,r-p))),i.push(k(o,n,[],"",[])),l=r+c,!0):(z(k(o,n,[],"",[]),r,c),l=r+c,!0);case"block-opener":return f.push(N(k(o,n,[],"",[]),r,c,r+c,p)),l=r+c,!0;case"block-closer":if(t===0)return d(),!1;if(t===1)return v(r),l=r+c,!0;let u=f.pop(),h=a.substr(u.prevOffset,r-u.prevOffset);return u.block.innerHTML+=h,u.block.innerContent.push(h),u.prevOffset=r+c,z(u.block,u.tokenStart,u.tokenLength,r+c),l=r+c,!0;default:return d(),!1}}function I(t){try{return JSON.parse(t)}catch{return null}}function J(){let t=C.exec(a);if(t===null)return["no-more-tokens","",null,0,0];let e=t.index,[s,o,n,r,c,,p]=t,u=s.length,h=!!o,O=!!p,b=(n||"core/")+r,M=!!c,x=M?I(c):{};return O?["void-block",b,x,e,u]:h?["block-closer",b,null,e,u]:["block-opener",b,x,e,u]}function d(t){let e=t||a.length-l;e!==0&&i.push(g(a.substr(l,e)))}function z(t,e,s,o){let n=f[f.length-1];n.block.innerBlocks.push(t);let r=a.substr(n.prevOffset,e-n.prevOffset);r&&(n.block.innerHTML+=r,n.block.innerContent.push(r)),n.block.innerContent.push(null),n.prevOffset=o||e+s}function v(t){let{block:e,leadingHtmlStart:s,prevOffset:o,tokenStart:n}=f.pop(),r=t?a.substr(o,t-o):a.substr(o);r&&(e.innerHTML+=r,e.innerContent.push(r)),s!==null&&i.push(g(a.substr(s,n-s))),i.push(e)}return w(L);})(); reusable-blocks.js 0000644 00000051014 15206720414 0010161 0 ustar 00 var wp; (wp ||= {}).reusableBlocks = (() => { 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 __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; 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 )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // package-external:@wordpress/data var require_data = __commonJS({ "package-external:@wordpress/data"(exports, module) { module.exports = window.wp.data; } }); // package-external:@wordpress/block-editor var require_block_editor = __commonJS({ "package-external:@wordpress/block-editor"(exports, module) { module.exports = window.wp.blockEditor; } }); // package-external:@wordpress/blocks var require_blocks = __commonJS({ "package-external:@wordpress/blocks"(exports, module) { module.exports = window.wp.blocks; } }); // package-external:@wordpress/i18n var require_i18n = __commonJS({ "package-external:@wordpress/i18n"(exports, module) { module.exports = window.wp.i18n; } }); // package-external:@wordpress/element var require_element = __commonJS({ "package-external:@wordpress/element"(exports, module) { module.exports = window.wp.element; } }); // package-external:@wordpress/components var require_components = __commonJS({ "package-external:@wordpress/components"(exports, module) { module.exports = window.wp.components; } }); // 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/notices var require_notices = __commonJS({ "package-external:@wordpress/notices"(exports, module) { module.exports = window.wp.notices; } }); // package-external:@wordpress/core-data var require_core_data = __commonJS({ "package-external:@wordpress/core-data"(exports, module) { module.exports = window.wp.coreData; } }); // package-external:@wordpress/url var require_url = __commonJS({ "package-external:@wordpress/url"(exports, module) { module.exports = window.wp.url; } }); // packages/reusable-blocks/build-module/index.mjs var index_exports = {}; __export(index_exports, { ReusableBlocksMenuItems: () => ReusableBlocksMenuItems, store: () => store }); // packages/reusable-blocks/build-module/store/index.mjs var import_data2 = __toESM(require_data(), 1); // packages/reusable-blocks/build-module/store/actions.mjs var actions_exports = {}; __export(actions_exports, { __experimentalConvertBlockToStatic: () => __experimentalConvertBlockToStatic, __experimentalConvertBlocksToReusable: () => __experimentalConvertBlocksToReusable, __experimentalDeleteReusableBlock: () => __experimentalDeleteReusableBlock, __experimentalSetEditingReusableBlock: () => __experimentalSetEditingReusableBlock }); var import_block_editor = __toESM(require_block_editor(), 1); var import_blocks = __toESM(require_blocks(), 1); var import_i18n = __toESM(require_i18n(), 1); var __experimentalConvertBlockToStatic = (clientId) => ({ registry }) => { const oldBlock = registry.select(import_block_editor.store).getBlock(clientId); const reusableBlock = registry.select("core").getEditedEntityRecord( "postType", "wp_block", oldBlock.attributes.ref ); const newBlocks = (0, import_blocks.parse)( typeof reusableBlock.content === "function" ? reusableBlock.content(reusableBlock) : reusableBlock.content ); registry.dispatch(import_block_editor.store).replaceBlocks(oldBlock.clientId, newBlocks); }; var __experimentalConvertBlocksToReusable = (clientIds, title, syncType) => async ({ registry, dispatch }) => { const meta = syncType === "unsynced" ? { wp_pattern_sync_status: syncType } : void 0; const reusableBlock = { title: title || (0, import_i18n.__)("Untitled pattern block"), content: (0, import_blocks.serialize)( registry.select(import_block_editor.store).getBlocksByClientId(clientIds) ), status: "publish", meta }; const updatedRecord = await registry.dispatch("core").saveEntityRecord("postType", "wp_block", reusableBlock); if (syncType === "unsynced") { return; } const newBlock = (0, import_blocks.createBlock)("core/block", { ref: updatedRecord.id }); registry.dispatch(import_block_editor.store).replaceBlocks(clientIds, newBlock); dispatch.__experimentalSetEditingReusableBlock( newBlock.clientId, true ); }; var __experimentalDeleteReusableBlock = (id) => async ({ registry }) => { const reusableBlock = registry.select("core").getEditedEntityRecord("postType", "wp_block", id); if (!reusableBlock) { return; } const allBlocks = registry.select(import_block_editor.store).getBlocks(); const associatedBlocks = allBlocks.filter( (block) => (0, import_blocks.isReusableBlock)(block) && block.attributes.ref === id ); const associatedBlockClientIds = associatedBlocks.map( (block) => block.clientId ); if (associatedBlockClientIds.length) { registry.dispatch(import_block_editor.store).removeBlocks(associatedBlockClientIds); } await registry.dispatch("core").deleteEntityRecord("postType", "wp_block", id); }; function __experimentalSetEditingReusableBlock(clientId, isEditing) { return { type: "SET_EDITING_REUSABLE_BLOCK", clientId, isEditing }; } // packages/reusable-blocks/build-module/store/reducer.mjs var import_data = __toESM(require_data(), 1); function isEditingReusableBlock(state = {}, action) { if (action?.type === "SET_EDITING_REUSABLE_BLOCK") { return { ...state, [action.clientId]: action.isEditing }; } return state; } var reducer_default = (0, import_data.combineReducers)({ isEditingReusableBlock }); // packages/reusable-blocks/build-module/store/selectors.mjs var selectors_exports = {}; __export(selectors_exports, { __experimentalIsEditingReusableBlock: () => __experimentalIsEditingReusableBlock }); function __experimentalIsEditingReusableBlock(state, clientId) { return state.isEditingReusableBlock[clientId]; } // packages/reusable-blocks/build-module/store/index.mjs var STORE_NAME = "core/reusable-blocks"; var store = (0, import_data2.createReduxStore)(STORE_NAME, { actions: actions_exports, reducer: reducer_default, selectors: selectors_exports }); (0, import_data2.register)(store); // packages/reusable-blocks/build-module/components/reusable-blocks-menu-items/index.mjs var import_block_editor4 = __toESM(require_block_editor(), 1); // packages/reusable-blocks/build-module/components/reusable-blocks-menu-items/reusable-block-convert-button.mjs var import_blocks2 = __toESM(require_blocks(), 1); var import_block_editor2 = __toESM(require_block_editor(), 1); var import_element = __toESM(require_element(), 1); var import_components = __toESM(require_components(), 1); // packages/icons/build-module/library/symbol.mjs var import_primitives = __toESM(require_primitives(), 1); var import_jsx_runtime = __toESM(require_jsx_runtime(), 1); var symbol_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: "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/reusable-blocks/build-module/components/reusable-blocks-menu-items/reusable-block-convert-button.mjs var import_data3 = __toESM(require_data(), 1); var import_i18n2 = __toESM(require_i18n(), 1); var import_notices = __toESM(require_notices(), 1); var import_core_data = __toESM(require_core_data(), 1); var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1); function ReusableBlockConvertButton({ clientIds, rootClientId, onClose }) { const [syncType, setSyncType] = (0, import_element.useState)(void 0); const [isModalOpen, setIsModalOpen] = (0, import_element.useState)(false); const [title, setTitle] = (0, import_element.useState)(""); const canConvert = (0, import_data3.useSelect)( (select) => { const { canUser } = select(import_core_data.store); const { getBlocksByClientId, canInsertBlockType, getBlockRootClientId } = select(import_block_editor2.store); const rootId = rootClientId || (clientIds.length > 0 ? getBlockRootClientId(clientIds[0]) : void 0); const blocks = getBlocksByClientId(clientIds) ?? []; const isReusable = blocks.length === 1 && blocks[0] && (0, import_blocks2.isReusableBlock)(blocks[0]) && !!select(import_core_data.store).getEntityRecord( "postType", "wp_block", blocks[0].attributes.ref ); const _canConvert = ( // Hide when this is already a reusable block. !isReusable && // Hide when reusable blocks are disabled. canInsertBlockType("core/block", rootId) && blocks.every( (block) => ( // Guard against the case where a regular block has *just* been converted. !!block && // Hide on invalid blocks. block.isValid && // Hide when block doesn't support being made reusable. (0, import_blocks2.hasBlockSupport)(block.name, "reusable", true) ) ) && // Hide when current doesn't have permission to do that. // Blocks refers to the wp_block post type, this checks the ability to create a post of that type. !!canUser("create", { kind: "postType", name: "wp_block" }) ); return _canConvert; }, [clientIds, rootClientId] ); const { __experimentalConvertBlocksToReusable: convertBlocksToReusable } = (0, import_data3.useDispatch)(store); const { createSuccessNotice, createErrorNotice } = (0, import_data3.useDispatch)(import_notices.store); const onConvert = (0, import_element.useCallback)( async function(reusableBlockTitle) { try { await convertBlocksToReusable( clientIds, reusableBlockTitle, syncType ); createSuccessNotice( !syncType ? (0, import_i18n2.sprintf)( // translators: %s: the name the user has given to the pattern. (0, import_i18n2.__)("Synced pattern created: %s"), reusableBlockTitle ) : (0, import_i18n2.sprintf)( // translators: %s: the name the user has given to the pattern. (0, import_i18n2.__)("Unsynced pattern created: %s"), reusableBlockTitle ), { type: "snackbar", id: "convert-to-reusable-block-success" } ); } catch (error) { createErrorNotice(error.message, { type: "snackbar", id: "convert-to-reusable-block-error" }); } }, [ convertBlocksToReusable, clientIds, syncType, createSuccessNotice, createErrorNotice ] ); if (!canConvert) { return null; } return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_components.MenuItem, { icon: symbol_default, onClick: () => setIsModalOpen(true), children: (0, import_i18n2.__)("Create pattern") }), isModalOpen && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)( import_components.Modal, { title: (0, import_i18n2.__)("Create pattern"), onRequestClose: () => { setIsModalOpen(false); setTitle(""); }, overlayClassName: "reusable-blocks-menu-items__convert-modal", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)( "form", { onSubmit: (event) => { event.preventDefault(); onConvert(title); setIsModalOpen(false); setTitle(""); onClose(); }, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_components.__experimentalVStack, { spacing: "5", children: [ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)( import_components.TextControl, { __next40pxDefaultSize: true, label: (0, import_i18n2.__)("Name"), value: title, onChange: setTitle, placeholder: (0, import_i18n2.__)("My pattern") } ), /* @__PURE__ */ (0, import_jsx_runtime2.jsx)( import_components.ToggleControl, { label: (0, import_i18n2._x)("Synced", "pattern (singular)"), help: (0, import_i18n2.__)( "Sync this pattern across multiple locations." ), checked: !syncType, onChange: () => { setSyncType( !syncType ? "unsynced" : void 0 ); } } ), /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_components.__experimentalHStack, { justify: "right", children: [ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)( import_components.Button, { __next40pxDefaultSize: true, variant: "tertiary", onClick: () => { setIsModalOpen(false); setTitle(""); }, children: (0, import_i18n2.__)("Cancel") } ), /* @__PURE__ */ (0, import_jsx_runtime2.jsx)( import_components.Button, { __next40pxDefaultSize: true, variant: "primary", type: "submit", children: (0, import_i18n2.__)("Create") } ) ] }) ] }) } ) } ) ] }); } // packages/reusable-blocks/build-module/components/reusable-blocks-menu-items/reusable-blocks-manage-button.mjs var import_components2 = __toESM(require_components(), 1); var import_i18n3 = __toESM(require_i18n(), 1); var import_blocks3 = __toESM(require_blocks(), 1); var import_data4 = __toESM(require_data(), 1); var import_element2 = __toESM(require_element(), 1); var import_block_editor3 = __toESM(require_block_editor(), 1); var import_url = __toESM(require_url(), 1); var import_core_data2 = __toESM(require_core_data(), 1); var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1); function ReusableBlocksManageButton({ clientId }) { const [showConfirmDialog, setShowConfirmDialog] = (0, import_element2.useState)(false); const { canRemove, isVisible, managePatternsUrl } = (0, import_data4.useSelect)( (select) => { const { getBlock, canRemoveBlock } = select(import_block_editor3.store); const { canUser } = select(import_core_data2.store); const reusableBlock = getBlock(clientId); return { canRemove: canRemoveBlock(clientId), isVisible: !!reusableBlock && (0, import_blocks3.isReusableBlock)(reusableBlock) && !!canUser("update", { kind: "postType", name: "wp_block", id: reusableBlock.attributes.ref }), // The site editor and templates both check whether the user // has edit_theme_options capabilities. We can leverage that here // and omit the manage patterns link if the user can't access it. managePatternsUrl: canUser("create", { kind: "postType", name: "wp_template" }) ? (0, import_url.addQueryArgs)("site-editor.php", { p: "/pattern" }) : (0, import_url.addQueryArgs)("edit.php", { post_type: "wp_block" }) }; }, [clientId] ); const { __experimentalConvertBlockToStatic: convertBlockToStatic } = (0, import_data4.useDispatch)(store); if (!isVisible) { return null; } const handleDetach = () => { convertBlockToStatic(clientId); setShowConfirmDialog(false); }; return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_components2.MenuItem, { href: managePatternsUrl, children: (0, import_i18n3.__)("Manage patterns") }), canRemove && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_components2.MenuItem, { onClick: () => setShowConfirmDialog(true), children: (0, import_i18n3.__)("Disconnect pattern") }), /* @__PURE__ */ (0, import_jsx_runtime3.jsx)( import_components2.__experimentalConfirmDialog, { isOpen: showConfirmDialog, onConfirm: handleDetach, onCancel: () => setShowConfirmDialog(false), confirmButtonText: (0, import_i18n3.__)("Disconnect"), size: "medium", title: (0, import_i18n3.__)("Disconnect pattern?"), __experimentalHideHeader: false, children: (0, import_i18n3.__)( "Blocks will be separated from the original pattern and will be fully editable. Future changes to the pattern will not apply here." ) } ) ] }) ] }); } var reusable_blocks_manage_button_default = ReusableBlocksManageButton; // packages/reusable-blocks/build-module/components/reusable-blocks-menu-items/index.mjs var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1); function ReusableBlocksMenuItems({ rootClientId }) { return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_block_editor4.BlockSettingsMenuControls, { children: ({ onClose, selectedClientIds }) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)( ReusableBlockConvertButton, { clientIds: selectedClientIds, rootClientId, onClose } ), selectedClientIds.length === 1 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)( reusable_blocks_manage_button_default, { clientId: selectedClientIds[0] } ) ] }) }); } return __toCommonJS(index_exports); })(); block-serialization-default-parser.js 0000644 00000015047 15206720414 0013773 0 ustar 00 "use strict"; var wp; (wp ||= {}).blockSerializationDefaultParser = (() => { var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; 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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // packages/block-serialization-default-parser/build-module/index.mjs var index_exports = {}; __export(index_exports, { parse: () => parse }); var document; var offset; var output; var stack; var tokenizer = /<!--\s+(\/)?wp:([a-z][a-z0-9_-]*\/)?([a-z][a-z0-9_-]*)\s+({(?:(?=([^}]+|}+(?=})|(?!}\s+\/?-->)[^])*)\5|[^]*?)}\s+)?(\/)?-->/g; function Block(blockName, attrs, innerBlocks, innerHTML, innerContent) { return { blockName, attrs, innerBlocks, innerHTML, innerContent }; } function Freeform(innerHTML) { return Block(null, {}, [], innerHTML, [innerHTML]); } function Frame(block, tokenStart, tokenLength, prevOffset, leadingHtmlStart) { return { block, tokenStart, tokenLength, prevOffset: prevOffset || tokenStart + tokenLength, leadingHtmlStart }; } var parse = (doc) => { document = doc; offset = 0; output = []; stack = []; tokenizer.lastIndex = 0; do { } while (proceed()); return output; }; function proceed() { const stackDepth = stack.length; const next = nextToken(); const [tokenType, blockName, attrs, startOffset, tokenLength] = next; const leadingHtmlStart = startOffset > offset ? offset : null; switch (tokenType) { case "no-more-tokens": if (0 === stackDepth) { addFreeform(); return false; } if (1 === stackDepth) { addBlockFromStack(); return false; } while (0 < stack.length) { addBlockFromStack(); } return false; case "void-block": if (0 === stackDepth) { if (null !== leadingHtmlStart) { output.push( Freeform( document.substr( leadingHtmlStart, startOffset - leadingHtmlStart ) ) ); } output.push(Block(blockName, attrs, [], "", [])); offset = startOffset + tokenLength; return true; } addInnerBlock( Block(blockName, attrs, [], "", []), startOffset, tokenLength ); offset = startOffset + tokenLength; return true; case "block-opener": stack.push( Frame( Block(blockName, attrs, [], "", []), startOffset, tokenLength, startOffset + tokenLength, leadingHtmlStart ) ); offset = startOffset + tokenLength; return true; case "block-closer": if (0 === stackDepth) { addFreeform(); return false; } if (1 === stackDepth) { addBlockFromStack(startOffset); offset = startOffset + tokenLength; return true; } const stackTop = stack.pop(); const html = document.substr( stackTop.prevOffset, startOffset - stackTop.prevOffset ); stackTop.block.innerHTML += html; stackTop.block.innerContent.push(html); stackTop.prevOffset = startOffset + tokenLength; addInnerBlock( stackTop.block, stackTop.tokenStart, stackTop.tokenLength, startOffset + tokenLength ); offset = startOffset + tokenLength; return true; default: addFreeform(); return false; } } function parseJSON(input) { try { return JSON.parse(input); } catch (e) { return null; } } function nextToken() { const matches = tokenizer.exec(document); if (null === matches) { return ["no-more-tokens", "", null, 0, 0]; } const startedAt = matches.index; const [ match, closerMatch, namespaceMatch, nameMatch, attrsMatch, , voidMatch ] = matches; const length = match.length; const isCloser = !!closerMatch; const isVoid = !!voidMatch; const namespace = namespaceMatch || "core/"; const name = namespace + nameMatch; const hasAttrs = !!attrsMatch; const attrs = hasAttrs ? parseJSON(attrsMatch) : {}; if (isCloser && (isVoid || hasAttrs)) { } if (isVoid) { return ["void-block", name, attrs, startedAt, length]; } if (isCloser) { return ["block-closer", name, null, startedAt, length]; } return ["block-opener", name, attrs, startedAt, length]; } function addFreeform(rawLength) { const length = rawLength ? rawLength : document.length - offset; if (0 === length) { return; } output.push(Freeform(document.substr(offset, length))); } function addInnerBlock(block, tokenStart, tokenLength, lastOffset) { const parent = stack[stack.length - 1]; parent.block.innerBlocks.push(block); const html = document.substr( parent.prevOffset, tokenStart - parent.prevOffset ); if (html) { parent.block.innerHTML += html; parent.block.innerContent.push(html); } parent.block.innerContent.push(null); parent.prevOffset = lastOffset ? lastOffset : tokenStart + tokenLength; } function addBlockFromStack(endOffset) { const { block, leadingHtmlStart, prevOffset, tokenStart } = stack.pop(); const html = endOffset ? document.substr(prevOffset, endOffset - prevOffset) : document.substr(prevOffset); if (html) { block.innerHTML += html; block.innerContent.push(html); } if (null !== leadingHtmlStart) { output.push( Freeform( document.substr( leadingHtmlStart, tokenStart - leadingHtmlStart ) ) ); } output.push(block); } return __toCommonJS(index_exports); })(); blob.js 0000644 00000004463 15206720414 0006030 0 ustar 00 "use strict"; var wp; (wp ||= {}).blob = (() => { var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; 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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // packages/blob/build-module/index.mjs var index_exports = {}; __export(index_exports, { createBlobURL: () => createBlobURL, downloadBlob: () => downloadBlob, getBlobByURL: () => getBlobByURL, getBlobTypeByURL: () => getBlobTypeByURL, isBlobURL: () => isBlobURL, revokeBlobURL: () => revokeBlobURL }); var cache = {}; function createBlobURL(file) { const url = window.URL.createObjectURL(file); cache[url] = file; return url; } function getBlobByURL(url) { return cache[url]; } function getBlobTypeByURL(url) { return getBlobByURL(url)?.type.split("/")[0]; } function revokeBlobURL(url) { if (cache[url]) { window.URL.revokeObjectURL(url); } delete cache[url]; } function isBlobURL(url) { if (!url || !url.indexOf) { return false; } return url.indexOf("blob:") === 0; } function downloadBlob(filename, content, contentType = "") { if (!filename || !content) { return; } const file = new window.Blob([content], { type: contentType }); const url = window.URL.createObjectURL(file); const anchorElement = document.createElement("a"); anchorElement.href = url; anchorElement.download = filename; anchorElement.style.display = "none"; document.body.appendChild(anchorElement); anchorElement.click(); document.body.removeChild(anchorElement); window.URL.revokeObjectURL(url); } return __toCommonJS(index_exports); })(); rich-text.js 0000644 00000302046 15206720414 0007017 0 ustar 00 "use strict"; var wp; (wp ||= {}).richText = (() => { 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 __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; 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 )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // package-external:@wordpress/data var require_data = __commonJS({ "package-external:@wordpress/data"(exports, module) { module.exports = window.wp.data; } }); // package-external:@wordpress/escape-html var require_escape_html = __commonJS({ "package-external:@wordpress/escape-html"(exports, module) { module.exports = window.wp.escapeHtml; } }); // package-external:@wordpress/a11y var require_a11y = __commonJS({ "package-external:@wordpress/a11y"(exports, module) { module.exports = window.wp.a11y; } }); // package-external:@wordpress/i18n var require_i18n = __commonJS({ "package-external:@wordpress/i18n"(exports, module) { module.exports = window.wp.i18n; } }); // 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/element var require_element = __commonJS({ "package-external:@wordpress/element"(exports, module) { module.exports = window.wp.element; } }); // package-external:@wordpress/compose var require_compose = __commonJS({ "package-external:@wordpress/compose"(exports, module) { module.exports = window.wp.compose; } }); // package-external:@wordpress/deprecated var require_deprecated = __commonJS({ "package-external:@wordpress/deprecated"(exports, module) { module.exports = window.wp.deprecated; } }); // package-external:@wordpress/keycodes var require_keycodes = __commonJS({ "package-external:@wordpress/keycodes"(exports, module) { module.exports = window.wp.keycodes; } }); // package-external:@wordpress/dom var require_dom = __commonJS({ "package-external:@wordpress/dom"(exports, module) { module.exports = window.wp.dom; } }); // packages/rich-text/build-module/index.mjs var index_exports = {}; __export(index_exports, { RichTextData: () => RichTextData, __experimentalRichText: () => __experimentalRichText, __unstableCreateElement: () => createElement, __unstableToDom: () => toDom, __unstableUseRichText: () => __unstableUseRichText, applyFormat: () => applyFormat, concat: () => concat, create: () => create, getActiveFormat: () => getActiveFormat, getActiveFormats: () => getActiveFormats, getActiveObject: () => getActiveObject, getTextContent: () => getTextContent, insert: () => insert, insertObject: () => insertObject, isCollapsed: () => isCollapsed, isEmpty: () => isEmpty, join: () => join, privateApis: () => privateApis, registerFormatType: () => registerFormatType, remove: () => remove2, removeFormat: () => removeFormat, replace: () => replace2, slice: () => slice, split: () => split, store: () => store, toHTMLString: () => toHTMLString, toggleFormat: () => toggleFormat, unregisterFormatType: () => unregisterFormatType, useAnchor: () => useAnchor, useAnchorRef: () => useAnchorRef }); // packages/rich-text/build-module/store/index.mjs var import_data3 = __toESM(require_data(), 1); // packages/rich-text/build-module/store/reducer.mjs var import_data = __toESM(require_data(), 1); function formatTypes(state = {}, action) { switch (action.type) { case "ADD_FORMAT_TYPES": return { ...state, // Key format types by their name. ...action.formatTypes.reduce( (newFormatTypes, type) => ({ ...newFormatTypes, [type.name]: type }), {} ) }; case "REMOVE_FORMAT_TYPES": return Object.fromEntries( Object.entries(state).filter( ([key]) => !action.names.includes(key) ) ); } return state; } var reducer_default = (0, import_data.combineReducers)({ formatTypes }); // packages/rich-text/build-module/store/selectors.mjs var selectors_exports = {}; __export(selectors_exports, { getFormatType: () => getFormatType, getFormatTypeForBareElement: () => getFormatTypeForBareElement, getFormatTypeForClassName: () => getFormatTypeForClassName, getFormatTypes: () => getFormatTypes }); var import_data2 = __toESM(require_data(), 1); var getFormatTypes = (0, import_data2.createSelector)( (state) => Object.values(state.formatTypes), (state) => [state.formatTypes] ); function getFormatType(state, name) { return state.formatTypes[name]; } function getFormatTypeForBareElement(state, bareElementTagName) { const formatTypes2 = getFormatTypes(state); return formatTypes2.find(({ className, tagName }) => { return className === null && bareElementTagName === tagName; }) || formatTypes2.find(({ className, tagName }) => { return className === null && "*" === tagName; }); } function getFormatTypeForClassName(state, elementClassName) { return getFormatTypes(state).find(({ className }) => { if (className === null) { return false; } return ` ${elementClassName} `.indexOf(` ${className} `) >= 0; }); } // packages/rich-text/build-module/store/actions.mjs var actions_exports = {}; __export(actions_exports, { addFormatTypes: () => addFormatTypes, removeFormatTypes: () => removeFormatTypes }); function addFormatTypes(formatTypes2) { return { type: "ADD_FORMAT_TYPES", formatTypes: Array.isArray(formatTypes2) ? formatTypes2 : [formatTypes2] }; } function removeFormatTypes(names) { return { type: "REMOVE_FORMAT_TYPES", names: Array.isArray(names) ? names : [names] }; } // packages/rich-text/build-module/store/index.mjs var STORE_NAME = "core/rich-text"; var store = (0, import_data3.createReduxStore)(STORE_NAME, { reducer: reducer_default, selectors: selectors_exports, actions: actions_exports }); (0, import_data3.register)(store); // packages/rich-text/build-module/is-format-equal.mjs function isFormatEqual(format1, format2) { if (format1 === format2) { return true; } if (!format1 || !format2) { return false; } if (format1.type !== format2.type) { return false; } const attributes1 = format1.attributes; const attributes2 = format2.attributes; if (attributes1 === attributes2) { return true; } if (!attributes1 || !attributes2) { return false; } const keys1 = Object.keys(attributes1); const keys2 = Object.keys(attributes2); if (keys1.length !== keys2.length) { return false; } const length = keys1.length; for (let i2 = 0; i2 < length; i2++) { const name = keys1[i2]; if (attributes1[name] !== attributes2[name]) { return false; } } return true; } // packages/rich-text/build-module/normalise-formats.mjs function normaliseFormats(value) { const newFormats = value.formats.slice(); newFormats.forEach((formatsAtIndex, index) => { const formatsAtPreviousIndex = newFormats[index - 1]; if (formatsAtPreviousIndex) { const newFormatsAtIndex = formatsAtIndex.slice(); newFormatsAtIndex.forEach((format, formatIndex) => { const previousFormat = formatsAtPreviousIndex[formatIndex]; if (isFormatEqual(format, previousFormat)) { newFormatsAtIndex[formatIndex] = previousFormat; } }); newFormats[index] = newFormatsAtIndex; } }); return { ...value, formats: newFormats }; } // packages/rich-text/build-module/apply-format.mjs function replace(array, index, value) { array = array.slice(); array[index] = value; return array; } function applyFormat(value, format, startIndex = value.start, endIndex = value.end) { const { formats, activeFormats } = value; const newFormats = formats.slice(); if (startIndex === endIndex) { const startFormat = newFormats[startIndex]?.find( ({ type }) => type === format.type ); if (startFormat) { const index = newFormats[startIndex].indexOf(startFormat); while (newFormats[startIndex] && newFormats[startIndex][index] === startFormat) { newFormats[startIndex] = replace( newFormats[startIndex], index, format ); startIndex--; } endIndex++; while (newFormats[endIndex] && newFormats[endIndex][index] === startFormat) { newFormats[endIndex] = replace( newFormats[endIndex], index, format ); endIndex++; } } } else { let position = Infinity; for (let index = startIndex; index < endIndex; index++) { if (newFormats[index]) { newFormats[index] = newFormats[index].filter( ({ type }) => type !== format.type ); const length = newFormats[index].length; if (length < position) { position = length; } } else { newFormats[index] = []; position = 0; } } for (let index = startIndex; index < endIndex; index++) { newFormats[index].splice(position, 0, format); } } return normaliseFormats({ ...value, formats: newFormats, // Always revise active formats. This serves as a placeholder for new // inputs with the format so new input appears with the format applied, // and ensures a format of the same type uses the latest values. activeFormats: [ ...activeFormats?.filter( ({ type }) => type !== format.type ) || [], format ] }); } // packages/rich-text/build-module/create.mjs var import_data5 = __toESM(require_data(), 1); // packages/rich-text/build-module/create-element.mjs function createElement({ implementation }, html) { if (!createElement.body) { createElement.body = implementation.createHTMLDocument("").body; } createElement.body.innerHTML = html; return createElement.body; } // packages/rich-text/build-module/special-characters.mjs var OBJECT_REPLACEMENT_CHARACTER = "\uFFFC"; var ZWNBSP = "\uFEFF"; // packages/rich-text/build-module/to-html-string.mjs var import_escape_html = __toESM(require_escape_html(), 1); // packages/rich-text/build-module/get-active-formats.mjs function getActiveFormats(value, EMPTY_ACTIVE_FORMATS3 = []) { const { formats, start, end, activeFormats } = value; if (start === void 0) { return EMPTY_ACTIVE_FORMATS3; } if (start === end) { if (activeFormats) { return activeFormats; } const formatsBefore = formats[start - 1] || EMPTY_ACTIVE_FORMATS3; const formatsAfter = formats[start] || EMPTY_ACTIVE_FORMATS3; if (formatsBefore.length < formatsAfter.length) { return formatsBefore; } return formatsAfter; } if (!formats[start]) { return EMPTY_ACTIVE_FORMATS3; } const selectedFormats = formats.slice(start, end); const _activeFormats = [...selectedFormats[0]]; let i2 = selectedFormats.length; while (i2--) { const formatsAtIndex = selectedFormats[i2]; if (!formatsAtIndex) { return EMPTY_ACTIVE_FORMATS3; } let ii = _activeFormats.length; while (ii--) { const format = _activeFormats[ii]; if (!formatsAtIndex.find( (_format) => isFormatEqual(format, _format) )) { _activeFormats.splice(ii, 1); } } if (_activeFormats.length === 0) { return EMPTY_ACTIVE_FORMATS3; } } return _activeFormats || EMPTY_ACTIVE_FORMATS3; } // packages/rich-text/build-module/get-format-type.mjs var import_data4 = __toESM(require_data(), 1); function getFormatType2(name) { return (0, import_data4.select)(store).getFormatType(name); } // packages/rich-text/build-module/to-tree.mjs function restoreOnAttributes(attributes, isEditableTree) { if (isEditableTree) { return attributes; } const newAttributes = {}; for (const key in attributes) { let newKey = key; if (key.startsWith("data-disable-rich-text-")) { newKey = key.slice("data-disable-rich-text-".length); } newAttributes[newKey] = attributes[key]; } return newAttributes; } function fromFormat({ type, tagName, attributes, unregisteredAttributes, object, boundaryClass, isEditableTree }) { const formatType = getFormatType2(type); let elementAttributes = {}; if (boundaryClass && isEditableTree) { elementAttributes["data-rich-text-format-boundary"] = "true"; } if (!formatType) { if (attributes) { elementAttributes = { ...attributes, ...elementAttributes }; } return { type, attributes: restoreOnAttributes( elementAttributes, isEditableTree ), object }; } elementAttributes = { ...unregisteredAttributes, ...elementAttributes }; for (const name in attributes) { const key = formatType.attributes ? formatType.attributes[name] : false; if (key) { elementAttributes[key] = attributes[name]; } else { elementAttributes[name] = attributes[name]; } } if (formatType.className) { if (elementAttributes.class) { elementAttributes.class = `${formatType.className} ${elementAttributes.class}`; } else { elementAttributes.class = formatType.className; } } return { type: tagName || formatType.tagName, object: formatType.object, attributes: restoreOnAttributes(elementAttributes, isEditableTree) }; } function isEqualUntil(a2, b2, index) { do { if (a2[index] !== b2[index]) { return false; } } while (index--); return true; } function toTree({ value, preserveWhiteSpace, createEmpty: createEmpty2, append: append3, getLastChild: getLastChild3, getParent: getParent3, isText: isText3, getText: getText3, remove: remove4, appendText: appendText3, onStartIndex, onEndIndex, isEditableTree, placeholder }) { const { formats, replacements, text, start, end } = value; const formatsLength = formats.length + 1; const tree = createEmpty2(); const activeFormats = getActiveFormats(value); const deepestActiveFormat = activeFormats[activeFormats.length - 1]; let lastCharacterFormats; let lastCharacter; append3(tree, ""); for (let i2 = 0; i2 < formatsLength; i2++) { const character = text.charAt(i2); const shouldInsertPadding = isEditableTree && // Pad the line if the line is empty. (!lastCharacter || // Pad the line if the previous character is a line break, otherwise // the line break won't be visible. lastCharacter === "\n"); const characterFormats = formats[i2]; let pointer = getLastChild3(tree); if (characterFormats) { characterFormats.forEach((format, formatIndex) => { if (pointer && lastCharacterFormats && // Reuse the last element if all formats remain the same. isEqualUntil( characterFormats, lastCharacterFormats, formatIndex )) { pointer = getLastChild3(pointer); return; } const { type, tagName, attributes, unregisteredAttributes } = format; const boundaryClass = isEditableTree && format === deepestActiveFormat; const parent = getParent3(pointer); const newNode = append3( parent, fromFormat({ type, tagName, attributes, unregisteredAttributes, boundaryClass, isEditableTree }) ); if (isText3(pointer) && getText3(pointer).length === 0) { remove4(pointer); } pointer = append3(newNode, ""); }); } if (i2 === 0) { if (onStartIndex && start === 0) { onStartIndex(tree, pointer); } if (onEndIndex && end === 0) { onEndIndex(tree, pointer); } } if (character === OBJECT_REPLACEMENT_CHARACTER) { const replacement = replacements[i2]; if (!replacement) { continue; } const { type, attributes, innerHTML } = replacement; const formatType = getFormatType2(type); if (isEditableTree && type === "#comment") { pointer = append3(getParent3(pointer), { type: "span", attributes: { contenteditable: "false", "data-rich-text-comment": attributes["data-rich-text-comment"] } }); append3( append3(pointer, { type: "span" }), attributes["data-rich-text-comment"].trim() ); } else if (!isEditableTree && type === "script") { pointer = append3( getParent3(pointer), fromFormat({ type: "script", isEditableTree }) ); append3(pointer, { html: decodeURIComponent( attributes["data-rich-text-script"] ) }); } else if (formatType?.contentEditable === false) { if (innerHTML || isEditableTree) { pointer = getParent3(pointer); if (isEditableTree) { const attrs = { contenteditable: "false", "data-rich-text-bogus": true }; if (start === i2 && end === i2 + 1) { attrs["data-rich-text-format-boundary"] = true; } pointer = append3(pointer, { type: "span", attributes: attrs }); if (isEditableTree && i2 + 1 === text.length) { append3(getParent3(pointer), ZWNBSP); } } pointer = append3( pointer, fromFormat({ ...replacement, isEditableTree }) ); if (innerHTML) { append3(pointer, { html: innerHTML }); } } } else { pointer = append3( getParent3(pointer), fromFormat({ ...replacement, object: true, isEditableTree }) ); } pointer = append3(getParent3(pointer), ""); } else if (!preserveWhiteSpace && character === "\n") { pointer = append3(getParent3(pointer), { type: "br", attributes: isEditableTree ? { "data-rich-text-line-break": "true" } : void 0, object: true }); pointer = append3(getParent3(pointer), ""); } else if (!isText3(pointer)) { pointer = append3(getParent3(pointer), character); } else { appendText3(pointer, character); } if (onStartIndex && start === i2 + 1) { onStartIndex(tree, pointer); } if (onEndIndex && end === i2 + 1) { onEndIndex(tree, pointer); } if (shouldInsertPadding && i2 === text.length) { append3(getParent3(pointer), ZWNBSP); if (placeholder && text.length === 0) { append3(getParent3(pointer), { type: "span", attributes: { "data-rich-text-placeholder": placeholder, // Necessary to prevent the placeholder from catching // selection and being editable. style: "pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;" } }); } } lastCharacterFormats = characterFormats; lastCharacter = character; } return tree; } // packages/rich-text/build-module/to-html-string.mjs function toHTMLString({ value, preserveWhiteSpace }) { const tree = toTree({ value, preserveWhiteSpace, createEmpty, append, getLastChild, getParent, isText, getText, remove, appendText }); return createChildrenHTML(tree.children); } function createEmpty() { return {}; } function getLastChild({ children }) { return children && children[children.length - 1]; } function append(parent, object) { if (typeof object === "string") { object = { text: object }; } object.parent = parent; parent.children = parent.children || []; parent.children.push(object); return object; } function appendText(object, text) { object.text += text; } function getParent({ parent }) { return parent; } function isText({ text }) { return typeof text === "string"; } function getText({ text }) { return text; } function remove(object) { const index = object.parent.children.indexOf(object); if (index !== -1) { object.parent.children.splice(index, 1); } return object; } function createElementHTML({ type, attributes, object, children }) { if (type === "#comment") { return `<!--${attributes["data-rich-text-comment"]}-->`; } let attributeString = ""; for (const key in attributes) { if (!(0, import_escape_html.isValidAttributeName)(key)) { continue; } attributeString += ` ${key}="${(0, import_escape_html.escapeAttribute)( attributes[key] )}"`; } if (object) { return `<${type}${attributeString}>`; } return `<${type}${attributeString}>${createChildrenHTML( children )}</${type}>`; } function createChildrenHTML(children = []) { return children.map((child) => { if (child.html !== void 0) { return child.html; } return child.text === void 0 ? createElementHTML(child) : (0, import_escape_html.escapeEditableHTML)(child.text); }).join(""); } // packages/rich-text/build-module/get-text-content.mjs function getTextContent({ text }) { return text.replace(OBJECT_REPLACEMENT_CHARACTER, ""); } // packages/rich-text/build-module/create.mjs function createEmptyValue() { return { formats: [], replacements: [], text: "" }; } function toFormat({ tagName, attributes }) { let formatType; if (attributes && attributes.class) { formatType = (0, import_data5.select)(store).getFormatTypeForClassName( attributes.class ); if (formatType) { attributes.class = ` ${attributes.class} `.replace(` ${formatType.className} `, " ").trim(); if (!attributes.class) { delete attributes.class; } } } if (!formatType) { formatType = (0, import_data5.select)(store).getFormatTypeForBareElement(tagName); } if (!formatType) { return attributes ? { type: tagName, attributes } : { type: tagName }; } if (formatType.__experimentalCreatePrepareEditableTree && !formatType.__experimentalCreateOnChangeEditableValue) { return null; } if (!attributes) { return { formatType, type: formatType.name, tagName }; } const registeredAttributes = {}; const unregisteredAttributes = {}; const _attributes = { ...attributes }; for (const key in formatType.attributes) { const name = formatType.attributes[key]; registeredAttributes[key] = _attributes[name]; delete _attributes[name]; if (typeof registeredAttributes[key] === "undefined") { delete registeredAttributes[key]; } } for (const name in _attributes) { unregisteredAttributes[name] = attributes[name]; } if (formatType.contentEditable === false) { delete unregisteredAttributes.contenteditable; } return { formatType, type: formatType.name, tagName, attributes: registeredAttributes, unregisteredAttributes }; } var RichTextData = class _RichTextData { #value; static empty() { return new _RichTextData(); } static fromPlainText(text) { return new _RichTextData(create({ text })); } static fromHTMLString(html) { return new _RichTextData(create({ html })); } /** * Create a RichTextData instance from an HTML element. * * @param {HTMLElement} htmlElement The HTML element to create the instance from. * @param {{preserveWhiteSpace?: boolean}} options Options. * @return {RichTextData} The RichTextData instance. */ static fromHTMLElement(htmlElement, options = {}) { const { preserveWhiteSpace = false } = options; const element = preserveWhiteSpace ? htmlElement : collapseWhiteSpace(htmlElement); const richTextData = new _RichTextData(create({ element })); Object.defineProperty(richTextData, "originalHTML", { value: htmlElement.innerHTML }); return richTextData; } constructor(init = createEmptyValue()) { this.#value = init; } toPlainText() { return getTextContent(this.#value); } // We could expose `toHTMLElement` at some point as well, but we'd only use // it internally. /** * Convert the rich text value to an HTML string. * * @param {{preserveWhiteSpace?: boolean}} options Options. * @return {string} The HTML string. */ toHTMLString({ preserveWhiteSpace } = {}) { return this.originalHTML || toHTMLString({ value: this.#value, preserveWhiteSpace }); } valueOf() { return this.toHTMLString(); } toString() { return this.toHTMLString(); } toJSON() { return this.toHTMLString(); } get length() { return this.text.length; } get formats() { return this.#value.formats; } get replacements() { return this.#value.replacements; } get text() { return this.#value.text; } }; for (const name of Object.getOwnPropertyNames(String.prototype)) { if (RichTextData.prototype.hasOwnProperty(name)) { continue; } Object.defineProperty(RichTextData.prototype, name, { value(...args) { return this.toHTMLString()[name](...args); } }); } function create({ element, text, html, range, __unstableIsEditableTree: isEditableTree } = {}) { if (html instanceof RichTextData) { return { text: html.text, formats: html.formats, replacements: html.replacements }; } if (typeof text === "string" && text.length > 0) { return { formats: Array(text.length), replacements: Array(text.length), text }; } if (typeof html === "string" && html.length > 0) { element = createElement(document, html); } if (typeof element !== "object") { return createEmptyValue(); } return createFromElement({ element, range, isEditableTree }); } function accumulateSelection(accumulator, node, range, value) { if (!range) { return; } const { parentNode } = node; const { startContainer, startOffset, endContainer, endOffset } = range; const currentLength = accumulator.text.length; if (value.start !== void 0) { accumulator.start = currentLength + value.start; } else if (node === startContainer && node.nodeType === node.TEXT_NODE) { accumulator.start = currentLength + startOffset; } else if (parentNode === startContainer && node === startContainer.childNodes[startOffset]) { accumulator.start = currentLength; } else if (parentNode === startContainer && node === startContainer.childNodes[startOffset - 1]) { accumulator.start = currentLength + value.text.length; } else if (node === startContainer) { accumulator.start = currentLength; } if (value.end !== void 0) { accumulator.end = currentLength + value.end; } else if (node === endContainer && node.nodeType === node.TEXT_NODE) { accumulator.end = currentLength + endOffset; } else if (parentNode === endContainer && node === endContainer.childNodes[endOffset - 1]) { accumulator.end = currentLength + value.text.length; } else if (parentNode === endContainer && node === endContainer.childNodes[endOffset]) { accumulator.end = currentLength; } else if (node === endContainer) { accumulator.end = currentLength + endOffset; } } function filterRange(node, range, filter) { if (!range) { return; } const { startContainer, endContainer } = range; let { startOffset, endOffset } = range; if (node === startContainer) { startOffset = filter(node.nodeValue.slice(0, startOffset)).length; } if (node === endContainer) { endOffset = filter(node.nodeValue.slice(0, endOffset)).length; } return { startContainer, startOffset, endContainer, endOffset }; } function collapseWhiteSpace(element, isRoot = true, hasPrecedingSpace = false, hasTrailingSpace = false) { const clone = element.cloneNode(true); clone.normalize(); Array.from(clone.childNodes).forEach((node, i2, nodes) => { if (node.nodeType === node.TEXT_NODE) { let newNodeValue = node.nodeValue; if (/[\n\t\r\f]/.test(newNodeValue)) { newNodeValue = newNodeValue.replace(/[\n\t\r\f]+/g, " "); } if (newNodeValue.indexOf(" ") !== -1) { newNodeValue = newNodeValue.replace(/ {2,}/g, " "); } if (i2 === 0 && newNodeValue.startsWith(" ") && (isRoot || hasPrecedingSpace)) { newNodeValue = newNodeValue.slice(1); } if (i2 === nodes.length - 1 && newNodeValue.endsWith(" ") && (isRoot || hasTrailingSpace)) { newNodeValue = newNodeValue.slice(0, -1); } node.nodeValue = newNodeValue; } else if (node.nodeType === node.ELEMENT_NODE) { const { previousSibling, nextSibling } = node; const prevHasSpace = previousSibling?.textContent.endsWith(" "); const nextHasSpace = nextSibling?.textContent.startsWith(" "); node.replaceWith( collapseWhiteSpace( node, false, previousSibling ? prevHasSpace : isRoot || hasPrecedingSpace, nextSibling ? nextHasSpace : isRoot || hasTrailingSpace ) ); } }); return clone; } var CARRIAGE_RETURN = "\r"; function removeReservedCharacters(string) { return string.replace( new RegExp( `[${ZWNBSP}${OBJECT_REPLACEMENT_CHARACTER}${CARRIAGE_RETURN}]`, "gu" ), "" ); } function createFromElement({ element, range, isEditableTree }) { const accumulator = createEmptyValue(); if (!element) { return accumulator; } if (!element.hasChildNodes()) { accumulateSelection(accumulator, element, range, createEmptyValue()); return accumulator; } const length = element.childNodes.length; for (let index = 0; index < length; index++) { const node = element.childNodes[index]; const tagName = node.nodeName.toLowerCase(); if (node.nodeType === node.TEXT_NODE) { const text = removeReservedCharacters(node.nodeValue); range = filterRange(node, range, removeReservedCharacters); accumulateSelection(accumulator, node, range, { text }); accumulator.formats.length += text.length; accumulator.replacements.length += text.length; accumulator.text += text; continue; } if (node.nodeType === node.COMMENT_NODE || node.nodeType === node.ELEMENT_NODE && node.tagName === "SPAN" && node.hasAttribute("data-rich-text-comment")) { const value2 = { formats: [,], replacements: [ { type: "#comment", attributes: { "data-rich-text-comment": node.nodeType === node.COMMENT_NODE ? node.nodeValue : node.getAttribute( "data-rich-text-comment" ) } } ], text: OBJECT_REPLACEMENT_CHARACTER }; accumulateSelection(accumulator, node, range, value2); mergePair(accumulator, value2); continue; } if (node.nodeType !== node.ELEMENT_NODE) { continue; } if (isEditableTree && // Ignore any line breaks that are not inserted by us. tagName === "br" && !node.getAttribute("data-rich-text-line-break")) { accumulateSelection(accumulator, node, range, createEmptyValue()); continue; } if (tagName === "script") { const value2 = { formats: [,], replacements: [ { type: tagName, attributes: { "data-rich-text-script": node.getAttribute("data-rich-text-script") || encodeURIComponent(node.innerHTML) } } ], text: OBJECT_REPLACEMENT_CHARACTER }; accumulateSelection(accumulator, node, range, value2); mergePair(accumulator, value2); continue; } if (tagName === "br") { accumulateSelection(accumulator, node, range, createEmptyValue()); mergePair(accumulator, create({ text: "\n" })); continue; } const format = toFormat({ tagName, attributes: getAttributes({ element: node }) }); if (format?.formatType?.contentEditable === false) { delete format.formatType; accumulateSelection(accumulator, node, range, createEmptyValue()); mergePair(accumulator, { formats: [,], replacements: [ { ...format, innerHTML: node.innerHTML } ], text: OBJECT_REPLACEMENT_CHARACTER }); continue; } if (format) { delete format.formatType; } const value = createFromElement({ element: node, range, isEditableTree }); accumulateSelection(accumulator, node, range, value); if (!format || node.getAttribute("data-rich-text-placeholder") || node.getAttribute("data-rich-text-bogus")) { mergePair(accumulator, value); } else if (value.text.length === 0) { if (format.attributes) { mergePair(accumulator, { formats: [,], replacements: [format], text: OBJECT_REPLACEMENT_CHARACTER }); } } else { let mergeFormats2 = function(formats) { if (mergeFormats2.formats === formats) { return mergeFormats2.newFormats; } const newFormats = formats ? [format, ...formats] : [format]; mergeFormats2.formats = formats; mergeFormats2.newFormats = newFormats; return newFormats; }; var mergeFormats = mergeFormats2; mergeFormats2.newFormats = [format]; mergePair(accumulator, { ...value, formats: Array.from(value.formats, mergeFormats2) }); } } return accumulator; } function getAttributes({ element }) { if (!element.hasAttributes()) { return; } const length = element.attributes.length; let accumulator; for (let i2 = 0; i2 < length; i2++) { const { name, value } = element.attributes[i2]; if (name.indexOf("data-rich-text-") === 0) { continue; } const safeName = /^on/i.test(name) ? "data-disable-rich-text-" + name : name; accumulator = accumulator || {}; accumulator[safeName] = value; } return accumulator; } // packages/rich-text/build-module/concat.mjs function mergePair(a2, b2) { a2.formats = a2.formats.concat(b2.formats); a2.replacements = a2.replacements.concat(b2.replacements); a2.text += b2.text; return a2; } function concat(...values) { return normaliseFormats(values.reduce(mergePair, create())); } // packages/rich-text/build-module/get-active-format.mjs function getActiveFormat(value, formatType) { return getActiveFormats(value).find( ({ type }) => type === formatType ); } // packages/rich-text/build-module/get-active-object.mjs function getActiveObject({ start, end, replacements, text }) { if (start + 1 !== end || text[start] !== OBJECT_REPLACEMENT_CHARACTER) { return; } return replacements[start]; } // packages/rich-text/build-module/is-collapsed.mjs function isCollapsed({ start, end }) { if (start === void 0 || end === void 0) { return; } return start === end; } // packages/rich-text/build-module/is-empty.mjs function isEmpty({ text }) { return text.length === 0; } // packages/rich-text/build-module/join.mjs function join(values, separator = "") { if (typeof separator === "string") { separator = create({ text: separator }); } return normaliseFormats( values.reduce((accumulator, { formats, replacements, text }) => ({ formats: accumulator.formats.concat(separator.formats, formats), replacements: accumulator.replacements.concat( separator.replacements, replacements ), text: accumulator.text + separator.text + text })) ); } // packages/rich-text/build-module/register-format-type.mjs var import_data6 = __toESM(require_data(), 1); function registerFormatType(name, settings) { settings = { name, ...settings }; if (typeof settings.name !== "string") { window.console.error("Format names must be strings."); return; } if (!/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(settings.name)) { window.console.error( "Format names must contain a namespace prefix, include only lowercase alphanumeric characters or dashes, and start with a letter. Example: my-plugin/my-custom-format" ); return; } if ((0, import_data6.select)(store).getFormatType(settings.name)) { window.console.error( 'Format "' + settings.name + '" is already registered.' ); return; } if (typeof settings.tagName !== "string" || settings.tagName === "") { window.console.error("Format tag names must be a string."); return; } if ((typeof settings.className !== "string" || settings.className === "") && settings.className !== null) { window.console.error( "Format class names must be a string, or null to handle bare elements." ); return; } if (!/^[_a-zA-Z]+[a-zA-Z0-9_-]*$/.test(settings.className)) { window.console.error( "A class name must begin with a letter, followed by any number of hyphens, underscores, letters, or numbers." ); return; } if (settings.className === null) { const formatTypeForBareElement = (0, import_data6.select)( store ).getFormatTypeForBareElement(settings.tagName); if (formatTypeForBareElement && formatTypeForBareElement.name !== "core/unknown") { window.console.error( `Format "${formatTypeForBareElement.name}" is already registered to handle bare tag name "${settings.tagName}".` ); return; } } else { const formatTypeForClassName = (0, import_data6.select)( store ).getFormatTypeForClassName(settings.className); if (formatTypeForClassName) { window.console.error( `Format "${formatTypeForClassName.name}" is already registered to handle class name "${settings.className}".` ); return; } } if (!("title" in settings) || settings.title === "") { window.console.error( 'The format "' + settings.name + '" must have a title.' ); return; } if ("keywords" in settings && settings.keywords.length > 3) { window.console.error( 'The format "' + settings.name + '" can have a maximum of 3 keywords.' ); return; } if (typeof settings.title !== "string") { window.console.error("Format titles must be strings."); return; } (0, import_data6.dispatch)(store).addFormatTypes(settings); return settings; } // packages/rich-text/build-module/remove-format.mjs function removeFormat(value, formatType, startIndex = value.start, endIndex = value.end) { const { formats, activeFormats } = value; const newFormats = formats.slice(); if (startIndex === endIndex) { const format = newFormats[startIndex]?.find( ({ type }) => type === formatType ); if (format) { while (newFormats[startIndex]?.find( (newFormat) => newFormat === format )) { filterFormats(newFormats, startIndex, formatType); startIndex--; } endIndex++; while (newFormats[endIndex]?.find( (newFormat) => newFormat === format )) { filterFormats(newFormats, endIndex, formatType); endIndex++; } } } else { for (let i2 = startIndex; i2 < endIndex; i2++) { if (newFormats[i2]) { filterFormats(newFormats, i2, formatType); } } } return normaliseFormats({ ...value, formats: newFormats, activeFormats: activeFormats?.filter(({ type }) => type !== formatType) || [] }); } function filterFormats(formats, index, formatType) { const newFormats = formats[index].filter( ({ type }) => type !== formatType ); if (newFormats.length) { formats[index] = newFormats; } else { delete formats[index]; } } // packages/rich-text/build-module/insert.mjs function insert(value, valueToInsert, startIndex = value.start, endIndex = value.end) { const { formats, replacements, text } = value; if (typeof valueToInsert === "string") { valueToInsert = create({ text: valueToInsert }); } const index = startIndex + valueToInsert.text.length; return normaliseFormats({ formats: formats.slice(0, startIndex).concat(valueToInsert.formats, formats.slice(endIndex)), replacements: replacements.slice(0, startIndex).concat( valueToInsert.replacements, replacements.slice(endIndex) ), text: text.slice(0, startIndex) + valueToInsert.text + text.slice(endIndex), start: index, end: index }); } // packages/rich-text/build-module/remove.mjs function remove2(value, startIndex, endIndex) { return insert(value, create(), startIndex, endIndex); } // packages/rich-text/build-module/replace.mjs function replace2({ formats, replacements, text, start, end }, pattern, replacement) { text = text.replace(pattern, (match, ...rest) => { const offset = rest[rest.length - 2]; let newText = replacement; let newFormats; let newReplacements; if (typeof newText === "function") { newText = replacement(match, ...rest); } if (typeof newText === "object") { newFormats = newText.formats; newReplacements = newText.replacements; newText = newText.text; } else { newFormats = Array(newText.length); newReplacements = Array(newText.length); if (formats[offset]) { newFormats = newFormats.fill(formats[offset]); } } formats = formats.slice(0, offset).concat(newFormats, formats.slice(offset + match.length)); replacements = replacements.slice(0, offset).concat( newReplacements, replacements.slice(offset + match.length) ); if (start) { start = end = offset + newText.length; } return newText; }); return normaliseFormats({ formats, replacements, text, start, end }); } // packages/rich-text/build-module/insert-object.mjs function insertObject(value, formatToInsert, startIndex, endIndex) { const valueToInsert = { formats: [,], replacements: [formatToInsert], text: OBJECT_REPLACEMENT_CHARACTER }; return insert(value, valueToInsert, startIndex, endIndex); } // packages/rich-text/build-module/slice.mjs function slice(value, startIndex = value.start, endIndex = value.end) { const { formats, replacements, text } = value; if (startIndex === void 0 || endIndex === void 0) { return { ...value }; } return { formats: formats.slice(startIndex, endIndex), replacements: replacements.slice(startIndex, endIndex), text: text.slice(startIndex, endIndex) }; } // packages/rich-text/build-module/split.mjs function split({ formats, replacements, text, start, end }, string) { if (typeof string !== "string") { return splitAtSelection(...arguments); } let nextStart = 0; return text.split(string).map((substring) => { const startIndex = nextStart; const value = { formats: formats.slice(startIndex, startIndex + substring.length), replacements: replacements.slice( startIndex, startIndex + substring.length ), text: substring }; nextStart += string.length + substring.length; if (start !== void 0 && end !== void 0) { if (start >= startIndex && start < nextStart) { value.start = start - startIndex; } else if (start < startIndex && end > startIndex) { value.start = 0; } if (end >= startIndex && end < nextStart) { value.end = end - startIndex; } else if (start < nextStart && end > nextStart) { value.end = substring.length; } } return value; }); } function splitAtSelection({ formats, replacements, text, start, end }, startIndex = start, endIndex = end) { if (start === void 0 || end === void 0) { return; } const before = { formats: formats.slice(0, startIndex), replacements: replacements.slice(0, startIndex), text: text.slice(0, startIndex) }; const after = { formats: formats.slice(endIndex), replacements: replacements.slice(endIndex), text: text.slice(endIndex), start: 0, end: 0 }; return [before, after]; } // packages/rich-text/build-module/is-range-equal.mjs function isRangeEqual(a2, b2) { return a2 === b2 || a2 && b2 && a2.startContainer === b2.startContainer && a2.startOffset === b2.startOffset && a2.endContainer === b2.endContainer && a2.endOffset === b2.endOffset; } // packages/rich-text/build-module/to-dom.mjs var MATHML_NAMESPACE = "http://www.w3.org/1998/Math/MathML"; function createPathToNode(node, rootNode, path) { const parentNode = node.parentNode; let i2 = 0; while (node = node.previousSibling) { i2++; } path = [i2, ...path]; if (parentNode !== rootNode) { path = createPathToNode(parentNode, rootNode, path); } return path; } function getNodeByPath(node, path) { path = [...path]; while (node && path.length > 1) { node = node.childNodes[path.shift()]; } return { node, offset: path[0] }; } function append2(element, child) { if (child.html !== void 0) { return element.innerHTML += child.html; } if (typeof child === "string") { child = element.ownerDocument.createTextNode(child); } const { type, attributes } = child; if (type) { if (type === "#comment") { child = element.ownerDocument.createComment( attributes["data-rich-text-comment"] ); } else { const parentNamespace = element.namespaceURI; if (type === "math") { child = element.ownerDocument.createElementNS( MATHML_NAMESPACE, type ); } else if (parentNamespace === MATHML_NAMESPACE) { if (element.tagName === "MTEXT") { child = element.ownerDocument.createElement(type); } else { child = element.ownerDocument.createElementNS( MATHML_NAMESPACE, type ); } } else { child = element.ownerDocument.createElement(type); } for (const key in attributes) { child.setAttribute(key, attributes[key]); } } } return element.appendChild(child); } function appendText2(node, text) { node.appendData(text); } function getLastChild2({ lastChild }) { return lastChild; } function getParent2({ parentNode }) { return parentNode; } function isText2(node) { return node.nodeType === node.TEXT_NODE; } function getText2({ nodeValue }) { return nodeValue; } function remove3(node) { return node.parentNode.removeChild(node); } function toDom({ value, prepareEditableTree, isEditableTree = true, placeholder, doc = document }) { let startPath = []; let endPath = []; if (prepareEditableTree) { value = { ...value, formats: prepareEditableTree(value) }; } const createEmpty2 = () => createElement(doc, ""); const tree = toTree({ value, createEmpty: createEmpty2, append: append2, getLastChild: getLastChild2, getParent: getParent2, isText: isText2, getText: getText2, remove: remove3, appendText: appendText2, onStartIndex(body, pointer) { startPath = createPathToNode(pointer, body, [ pointer.nodeValue.length ]); }, onEndIndex(body, pointer) { endPath = createPathToNode(pointer, body, [ pointer.nodeValue.length ]); }, isEditableTree, placeholder }); return { body: tree, selection: { startPath, endPath } }; } function apply({ value, current, prepareEditableTree, __unstableDomOnly, placeholder }) { const { body, selection } = toDom({ value, prepareEditableTree, placeholder, doc: current.ownerDocument }); applyValue(body, current); if (value.start !== void 0 && !__unstableDomOnly) { applySelection(selection, current); } } function applyValue(future, current) { let i2 = 0; let futureChild; while (futureChild = future.firstChild) { const currentChild = current.childNodes[i2]; if (!currentChild) { current.appendChild(futureChild); } else if (!currentChild.isEqualNode(futureChild)) { if (currentChild.nodeName !== futureChild.nodeName || currentChild.nodeType === currentChild.TEXT_NODE && currentChild.data !== futureChild.data) { current.replaceChild(futureChild, currentChild); } else { const currentAttributes = currentChild.attributes; const futureAttributes = futureChild.attributes; if (currentAttributes) { let ii = currentAttributes.length; while (ii--) { const { name } = currentAttributes[ii]; if (!futureChild.getAttribute(name)) { currentChild.removeAttribute(name); } } } if (futureAttributes) { for (let ii = 0; ii < futureAttributes.length; ii++) { const { name, value } = futureAttributes[ii]; if (currentChild.getAttribute(name) !== value) { currentChild.setAttribute(name, value); } } } applyValue(futureChild, currentChild); future.removeChild(futureChild); } } else { future.removeChild(futureChild); } i2++; } while (current.childNodes[i2]) { current.removeChild(current.childNodes[i2]); } } function applySelection({ startPath, endPath }, current) { const { node: startContainer, offset: startOffset } = getNodeByPath( current, startPath ); const { node: endContainer, offset: endOffset } = getNodeByPath( current, endPath ); const { ownerDocument } = current; const { defaultView } = ownerDocument; const selection = defaultView.getSelection(); const range = ownerDocument.createRange(); range.setStart(startContainer, startOffset); range.setEnd(endContainer, endOffset); const { activeElement } = ownerDocument; if (selection.rangeCount > 0) { if (isRangeEqual(range, selection.getRangeAt(0))) { return; } selection.removeAllRanges(); } selection.addRange(range); if (activeElement !== ownerDocument.activeElement) { if (activeElement instanceof defaultView.HTMLElement) { activeElement.focus(); } } } // packages/rich-text/build-module/toggle-format.mjs var import_a11y = __toESM(require_a11y(), 1); var import_i18n = __toESM(require_i18n(), 1); function toggleFormat(value, format) { if (getActiveFormat(value, format.type)) { if (format.title) { (0, import_a11y.speak)((0, import_i18n.sprintf)((0, import_i18n.__)("%s removed."), format.title), "assertive"); } return removeFormat(value, format.type); } if (format.title) { (0, import_a11y.speak)((0, import_i18n.sprintf)((0, import_i18n.__)("%s applied."), format.title), "assertive"); } return applyFormat(value, format); } // packages/rich-text/build-module/unregister-format-type.mjs var import_data7 = __toESM(require_data(), 1); function unregisterFormatType(name) { const oldFormat = (0, import_data7.select)(store).getFormatType(name); if (!oldFormat) { window.console.error(`Format ${name} is not registered.`); return; } (0, import_data7.dispatch)(store).removeFormatTypes(name); return oldFormat; } // packages/rich-text/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/rich-text" ); // packages/rich-text/build-module/hook/index.mjs var import_element5 = __toESM(require_element(), 1); var import_compose2 = __toESM(require_compose(), 1); var import_data9 = __toESM(require_data(), 1); var import_deprecated = __toESM(require_deprecated(), 1); // packages/rich-text/build-module/hook/use-default-style.mjs var import_element = __toESM(require_element(), 1); var whiteSpace = "pre-wrap"; function useDefaultStyle() { return (0, import_element.useCallback)((element) => { if (!element) { return; } element.style.whiteSpace = whiteSpace; }, []); } // node_modules/colord/index.mjs var r = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }; var t = function(r2) { return "string" == typeof r2 ? r2.length > 0 : "number" == typeof r2; }; var n = function(r2, t2, n2) { return void 0 === t2 && (t2 = 0), void 0 === n2 && (n2 = Math.pow(10, t2)), Math.round(n2 * r2) / n2 + 0; }; var e = function(r2, t2, n2) { return void 0 === t2 && (t2 = 0), void 0 === n2 && (n2 = 1), r2 > n2 ? n2 : r2 > t2 ? r2 : t2; }; var u = function(r2) { return (r2 = isFinite(r2) ? r2 % 360 : 0) > 0 ? r2 : r2 + 360; }; var a = function(r2) { return { r: e(r2.r, 0, 255), g: e(r2.g, 0, 255), b: e(r2.b, 0, 255), a: e(r2.a) }; }; var o = function(r2) { return { r: n(r2.r), g: n(r2.g), b: n(r2.b), a: n(r2.a, 3) }; }; var i = /^#([0-9a-f]{3,8})$/i; var s = function(r2) { var t2 = r2.toString(16); return t2.length < 2 ? "0" + t2 : t2; }; var h = function(r2) { var t2 = r2.r, n2 = r2.g, e2 = r2.b, u2 = r2.a, a2 = Math.max(t2, n2, e2), o2 = a2 - Math.min(t2, n2, e2), i2 = o2 ? a2 === t2 ? (n2 - e2) / o2 : a2 === n2 ? 2 + (e2 - t2) / o2 : 4 + (t2 - n2) / o2 : 0; return { h: 60 * (i2 < 0 ? i2 + 6 : i2), s: a2 ? o2 / a2 * 100 : 0, v: a2 / 255 * 100, a: u2 }; }; var b = function(r2) { var t2 = r2.h, n2 = r2.s, e2 = r2.v, u2 = r2.a; t2 = t2 / 360 * 6, n2 /= 100, e2 /= 100; var a2 = Math.floor(t2), o2 = e2 * (1 - n2), i2 = e2 * (1 - (t2 - a2) * n2), s2 = e2 * (1 - (1 - t2 + a2) * n2), h2 = a2 % 6; return { r: 255 * [e2, i2, o2, o2, s2, e2][h2], g: 255 * [s2, e2, e2, i2, o2, o2][h2], b: 255 * [o2, o2, s2, e2, e2, i2][h2], a: u2 }; }; var g = function(r2) { return { h: u(r2.h), s: e(r2.s, 0, 100), l: e(r2.l, 0, 100), a: e(r2.a) }; }; var d = function(r2) { return { h: n(r2.h), s: n(r2.s), l: n(r2.l), a: n(r2.a, 3) }; }; var f = function(r2) { return b((n2 = (t2 = r2).s, { h: t2.h, s: (n2 *= ((e2 = t2.l) < 50 ? e2 : 100 - e2) / 100) > 0 ? 2 * n2 / (e2 + n2) * 100 : 0, v: e2 + n2, a: t2.a })); var t2, n2, e2; }; var c = function(r2) { return { h: (t2 = h(r2)).h, s: (u2 = (200 - (n2 = t2.s)) * (e2 = t2.v) / 100) > 0 && u2 < 200 ? n2 * e2 / 100 / (u2 <= 100 ? u2 : 200 - u2) * 100 : 0, l: u2 / 2, a: t2.a }; var t2, n2, e2, u2; }; var l = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i; var p = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i; var v = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i; var m = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i; var y = { string: [[function(r2) { var t2 = i.exec(r2); return t2 ? (r2 = t2[1]).length <= 4 ? { r: parseInt(r2[0] + r2[0], 16), g: parseInt(r2[1] + r2[1], 16), b: parseInt(r2[2] + r2[2], 16), a: 4 === r2.length ? n(parseInt(r2[3] + r2[3], 16) / 255, 2) : 1 } : 6 === r2.length || 8 === r2.length ? { r: parseInt(r2.substr(0, 2), 16), g: parseInt(r2.substr(2, 2), 16), b: parseInt(r2.substr(4, 2), 16), a: 8 === r2.length ? n(parseInt(r2.substr(6, 2), 16) / 255, 2) : 1 } : null : null; }, "hex"], [function(r2) { var t2 = v.exec(r2) || m.exec(r2); return t2 ? t2[2] !== t2[4] || t2[4] !== t2[6] ? null : a({ r: Number(t2[1]) / (t2[2] ? 100 / 255 : 1), g: Number(t2[3]) / (t2[4] ? 100 / 255 : 1), b: Number(t2[5]) / (t2[6] ? 100 / 255 : 1), a: void 0 === t2[7] ? 1 : Number(t2[7]) / (t2[8] ? 100 : 1) }) : null; }, "rgb"], [function(t2) { var n2 = l.exec(t2) || p.exec(t2); if (!n2) return null; var e2, u2, a2 = g({ h: (e2 = n2[1], u2 = n2[2], void 0 === u2 && (u2 = "deg"), Number(e2) * (r[u2] || 1)), s: Number(n2[3]), l: Number(n2[4]), a: void 0 === n2[5] ? 1 : Number(n2[5]) / (n2[6] ? 100 : 1) }); return f(a2); }, "hsl"]], object: [[function(r2) { var n2 = r2.r, e2 = r2.g, u2 = r2.b, o2 = r2.a, i2 = void 0 === o2 ? 1 : o2; return t(n2) && t(e2) && t(u2) ? a({ r: Number(n2), g: Number(e2), b: Number(u2), a: Number(i2) }) : null; }, "rgb"], [function(r2) { var n2 = r2.h, e2 = r2.s, u2 = r2.l, a2 = r2.a, o2 = void 0 === a2 ? 1 : a2; if (!t(n2) || !t(e2) || !t(u2)) return null; var i2 = g({ h: Number(n2), s: Number(e2), l: Number(u2), a: Number(o2) }); return f(i2); }, "hsl"], [function(r2) { var n2 = r2.h, a2 = r2.s, o2 = r2.v, i2 = r2.a, s2 = void 0 === i2 ? 1 : i2; if (!t(n2) || !t(a2) || !t(o2)) return null; var h2 = (function(r3) { return { h: u(r3.h), s: e(r3.s, 0, 100), v: e(r3.v, 0, 100), a: e(r3.a) }; })({ h: Number(n2), s: Number(a2), v: Number(o2), a: Number(s2) }); return b(h2); }, "hsv"]] }; var N = function(r2, t2) { for (var n2 = 0; n2 < t2.length; n2++) { var e2 = t2[n2][0](r2); if (e2) return [e2, t2[n2][1]]; } return [null, void 0]; }; var x = function(r2) { return "string" == typeof r2 ? N(r2.trim(), y.string) : "object" == typeof r2 && null !== r2 ? N(r2, y.object) : [null, void 0]; }; var M = function(r2, t2) { var n2 = c(r2); return { h: n2.h, s: e(n2.s + 100 * t2, 0, 100), l: n2.l, a: n2.a }; }; var H = function(r2) { return (299 * r2.r + 587 * r2.g + 114 * r2.b) / 1e3 / 255; }; var $ = function(r2, t2) { var n2 = c(r2); return { h: n2.h, s: n2.s, l: e(n2.l + 100 * t2, 0, 100), a: n2.a }; }; var j = (function() { function r2(r3) { this.parsed = x(r3)[0], this.rgba = this.parsed || { r: 0, g: 0, b: 0, a: 1 }; } return r2.prototype.isValid = function() { return null !== this.parsed; }, r2.prototype.brightness = function() { return n(H(this.rgba), 2); }, r2.prototype.isDark = function() { return H(this.rgba) < 0.5; }, r2.prototype.isLight = function() { return H(this.rgba) >= 0.5; }, r2.prototype.toHex = function() { return r3 = o(this.rgba), t2 = r3.r, e2 = r3.g, u2 = r3.b, i2 = (a2 = r3.a) < 1 ? s(n(255 * a2)) : "", "#" + s(t2) + s(e2) + s(u2) + i2; var r3, t2, e2, u2, a2, i2; }, r2.prototype.toRgb = function() { return o(this.rgba); }, r2.prototype.toRgbString = function() { return r3 = o(this.rgba), t2 = r3.r, n2 = r3.g, e2 = r3.b, (u2 = r3.a) < 1 ? "rgba(" + t2 + ", " + n2 + ", " + e2 + ", " + u2 + ")" : "rgb(" + t2 + ", " + n2 + ", " + e2 + ")"; var r3, t2, n2, e2, u2; }, r2.prototype.toHsl = function() { return d(c(this.rgba)); }, r2.prototype.toHslString = function() { return r3 = d(c(this.rgba)), t2 = r3.h, n2 = r3.s, e2 = r3.l, (u2 = r3.a) < 1 ? "hsla(" + t2 + ", " + n2 + "%, " + e2 + "%, " + u2 + ")" : "hsl(" + t2 + ", " + n2 + "%, " + e2 + "%)"; var r3, t2, n2, e2, u2; }, r2.prototype.toHsv = function() { return r3 = h(this.rgba), { h: n(r3.h), s: n(r3.s), v: n(r3.v), a: n(r3.a, 3) }; var r3; }, r2.prototype.invert = function() { return w({ r: 255 - (r3 = this.rgba).r, g: 255 - r3.g, b: 255 - r3.b, a: r3.a }); var r3; }, r2.prototype.saturate = function(r3) { return void 0 === r3 && (r3 = 0.1), w(M(this.rgba, r3)); }, r2.prototype.desaturate = function(r3) { return void 0 === r3 && (r3 = 0.1), w(M(this.rgba, -r3)); }, r2.prototype.grayscale = function() { return w(M(this.rgba, -1)); }, r2.prototype.lighten = function(r3) { return void 0 === r3 && (r3 = 0.1), w($(this.rgba, r3)); }, r2.prototype.darken = function(r3) { return void 0 === r3 && (r3 = 0.1), w($(this.rgba, -r3)); }, r2.prototype.rotate = function(r3) { return void 0 === r3 && (r3 = 15), this.hue(this.hue() + r3); }, r2.prototype.alpha = function(r3) { return "number" == typeof r3 ? w({ r: (t2 = this.rgba).r, g: t2.g, b: t2.b, a: r3 }) : n(this.rgba.a, 3); var t2; }, r2.prototype.hue = function(r3) { var t2 = c(this.rgba); return "number" == typeof r3 ? w({ h: r3, s: t2.s, l: t2.l, a: t2.a }) : n(t2.h); }, r2.prototype.isEqual = function(r3) { return this.toHex() === w(r3).toHex(); }, r2; })(); var w = function(r2) { return r2 instanceof j ? r2 : new j(r2); }; // packages/rich-text/build-module/hook/use-boundary-style.mjs var import_element2 = __toESM(require_element(), 1); function useBoundaryStyle({ record }) { const ref = (0, import_element2.useRef)(); const { activeFormats = [], replacements, start } = record.current; const activeReplacement = replacements[start]; (0, import_element2.useEffect)(() => { if ((!activeFormats || !activeFormats.length) && !activeReplacement) { return; } const boundarySelector = "*[data-rich-text-format-boundary]"; const element = ref.current.querySelector(boundarySelector); if (!element) { return; } const { ownerDocument } = element; const { defaultView } = ownerDocument; const computedStyle = defaultView.getComputedStyle(element); const newColor = w(computedStyle.color).alpha(0.2).toRgbString(); const selector = `.rich-text:focus ${boundarySelector}`; const rule = `background-color: ${newColor}`; const style = `${selector} {${rule}}`; const globalStyleId = "rich-text-boundary-style"; let globalStyle = ownerDocument.getElementById(globalStyleId); if (!globalStyle) { globalStyle = ownerDocument.createElement("style"); globalStyle.id = globalStyleId; ownerDocument.head.appendChild(globalStyle); } if (globalStyle.innerHTML !== style) { globalStyle.innerHTML = style; } }, [activeFormats, activeReplacement]); return ref; } // packages/rich-text/build-module/hook/event-listeners/index.mjs var import_element3 = __toESM(require_element(), 1); var import_compose = __toESM(require_compose(), 1); // packages/rich-text/build-module/hook/event-listeners/copy-handler.mjs var copy_handler_default = (props) => (element) => { function onCopy(event) { const { record } = props.current; const { ownerDocument } = element; if (isCollapsed(record.current) || !element.contains(ownerDocument.activeElement)) { return; } const selectedRecord = slice(record.current); const plainText = getTextContent(selectedRecord); const html = toHTMLString({ value: selectedRecord }); event.clipboardData.setData("text/plain", plainText); event.clipboardData.setData("text/html", html); event.clipboardData.setData("rich-text", "true"); event.preventDefault(); if (event.type === "cut") { ownerDocument.execCommand("delete"); } } const { defaultView } = element.ownerDocument; defaultView.addEventListener("copy", onCopy); defaultView.addEventListener("cut", onCopy); return () => { defaultView.removeEventListener("copy", onCopy); defaultView.removeEventListener("cut", onCopy); }; }; // packages/rich-text/build-module/hook/event-listeners/select-object.mjs var select_object_default = () => (element) => { function onClick(event) { const { target } = event; if (target === element || target.textContent && target.isContentEditable) { return; } const { ownerDocument } = target; const { defaultView } = ownerDocument; const selection = defaultView.getSelection(); if (selection.containsNode(target)) { return; } const range = ownerDocument.createRange(); const nodeToSelect = target.isContentEditable ? target : target.closest("[contenteditable]"); range.selectNode(nodeToSelect); selection.removeAllRanges(); selection.addRange(range); event.preventDefault(); } function onFocusIn(event) { if (event.relatedTarget && !element.contains(event.relatedTarget) && event.relatedTarget.tagName === "A") { onClick(event); } } element.addEventListener("click", onClick); element.addEventListener("focusin", onFocusIn); return () => { element.removeEventListener("click", onClick); element.removeEventListener("focusin", onFocusIn); }; }; // packages/rich-text/build-module/hook/event-listeners/format-boundaries.mjs var import_keycodes = __toESM(require_keycodes(), 1); var EMPTY_ACTIVE_FORMATS = []; var format_boundaries_default = (props) => (element) => { function onKeyDown(event) { const { keyCode, shiftKey, altKey, metaKey, ctrlKey } = event; if ( // Only override left and right keys without modifiers pressed. shiftKey || altKey || metaKey || ctrlKey || keyCode !== import_keycodes.LEFT && keyCode !== import_keycodes.RIGHT ) { return; } const { record, applyRecord, forceRender } = props.current; const { text, formats, start, end, activeFormats: currentActiveFormats = [] } = record.current; const collapsed = isCollapsed(record.current); const { ownerDocument } = element; const { defaultView } = ownerDocument; const { direction } = defaultView.getComputedStyle(element); const reverseKey = direction === "rtl" ? import_keycodes.RIGHT : import_keycodes.LEFT; const isReverse = event.keyCode === reverseKey; if (collapsed && currentActiveFormats.length === 0) { if (start === 0 && isReverse) { return; } if (end === text.length && !isReverse) { return; } } if (!collapsed) { return; } const formatsBefore = formats[start - 1] || EMPTY_ACTIVE_FORMATS; const formatsAfter = formats[start] || EMPTY_ACTIVE_FORMATS; const destination = isReverse ? formatsBefore : formatsAfter; const isIncreasing = currentActiveFormats.every( (format, index) => format === destination[index] ); let newActiveFormatsLength = currentActiveFormats.length; if (!isIncreasing) { newActiveFormatsLength--; } else if (newActiveFormatsLength < destination.length) { newActiveFormatsLength++; } if (newActiveFormatsLength === currentActiveFormats.length) { record.current._newActiveFormats = destination; return; } event.preventDefault(); const origin = isReverse ? formatsAfter : formatsBefore; const source = isIncreasing ? destination : origin; const newActiveFormats = source.slice(0, newActiveFormatsLength); const newValue = { ...record.current, activeFormats: newActiveFormats }; record.current = newValue; applyRecord(newValue); forceRender(); } element.addEventListener("keydown", onKeyDown); return () => { element.removeEventListener("keydown", onKeyDown); }; }; // packages/rich-text/build-module/hook/event-listeners/delete.mjs var import_keycodes2 = __toESM(require_keycodes(), 1); var delete_default = (props) => (element) => { function onKeyDown(event) { const { keyCode } = event; const { createRecord, handleChange } = props.current; if (event.defaultPrevented) { return; } if (keyCode !== import_keycodes2.DELETE && keyCode !== import_keycodes2.BACKSPACE) { return; } const currentValue = createRecord(); const { start, end, text } = currentValue; if (start === 0 && end !== 0 && end === text.length) { handleChange(remove2(currentValue)); event.preventDefault(); } } element.addEventListener("keydown", onKeyDown); return () => { element.removeEventListener("keydown", onKeyDown); }; }; // packages/rich-text/build-module/update-formats.mjs function updateFormats({ value, start, end, formats }) { const min = Math.min(start, end); const max = Math.max(start, end); const formatsBefore = value.formats[min - 1] || []; const formatsAfter = value.formats[max] || []; value.activeFormats = formats.map((format, index) => { if (formatsBefore[index]) { if (isFormatEqual(format, formatsBefore[index])) { return formatsBefore[index]; } } else if (formatsAfter[index]) { if (isFormatEqual(format, formatsAfter[index])) { return formatsAfter[index]; } } return format; }); while (--end >= start) { if (value.activeFormats.length > 0) { value.formats[end] = value.activeFormats; } else { delete value.formats[end]; } } return value; } // packages/rich-text/build-module/hook/event-listeners/input-and-selection.mjs var INSERTION_INPUT_TYPES_TO_IGNORE = /* @__PURE__ */ new Set([ "insertParagraph", "insertOrderedList", "insertUnorderedList", "insertHorizontalRule", "insertLink" ]); var EMPTY_ACTIVE_FORMATS2 = []; var PLACEHOLDER_ATTR_NAME = "data-rich-text-placeholder"; function fixPlaceholderSelection(defaultView) { const selection = defaultView.getSelection(); const { anchorNode, anchorOffset } = selection; if (anchorNode.nodeType !== anchorNode.ELEMENT_NODE) { return; } const targetNode = anchorNode.childNodes[anchorOffset]; if (!targetNode || targetNode.nodeType !== targetNode.ELEMENT_NODE || !targetNode.hasAttribute(PLACEHOLDER_ATTR_NAME)) { return; } selection.collapseToStart(); } var input_and_selection_default = (props) => (element) => { const { ownerDocument } = element; const { defaultView } = ownerDocument; let isComposing = false; function onInput(event) { if (isComposing) { return; } let inputType; if (event) { inputType = event.inputType; } const { record, applyRecord, createRecord, handleChange } = props.current; if (inputType && (inputType.indexOf("format") === 0 || INSERTION_INPUT_TYPES_TO_IGNORE.has(inputType))) { applyRecord(record.current); return; } const currentValue = createRecord(); const { start, activeFormats: oldActiveFormats = [] } = record.current; const clearFormats = !isCollapsed(record.current) && currentValue.start <= start; const change = updateFormats({ value: currentValue, start, end: currentValue.start, formats: clearFormats ? [] : oldActiveFormats }); handleChange(change); } function handleSelectionChange() { const { record, applyRecord, createRecord, onSelectionChange } = props.current; if (element.contentEditable !== "true") { return; } if (ownerDocument.activeElement !== element) { ownerDocument.removeEventListener( "selectionchange", handleSelectionChange ); return; } if (isComposing) { return; } const { start, end, text } = createRecord(); const oldRecord = record.current; if (text !== oldRecord.text) { onInput(); return; } if (start === oldRecord.start && end === oldRecord.end) { if (oldRecord.text.length === 0 && start === 0) { fixPlaceholderSelection(defaultView); } return; } const newValue = { ...oldRecord, start, end, // _newActiveFormats may be set on arrow key navigation to control // the right boundary position. If undefined, getActiveFormats will // give the active formats according to the browser. activeFormats: oldRecord._newActiveFormats, _newActiveFormats: void 0 }; const newActiveFormats = getActiveFormats( newValue, EMPTY_ACTIVE_FORMATS2 ); newValue.activeFormats = newActiveFormats; record.current = newValue; applyRecord(newValue, { domOnly: true }); onSelectionChange(start, end); } function onCompositionStart() { isComposing = true; ownerDocument.removeEventListener( "selectionchange", handleSelectionChange ); element.querySelector(`[${PLACEHOLDER_ATTR_NAME}]`)?.remove(); } function onCompositionEnd() { isComposing = false; onInput({ inputType: "insertText" }); ownerDocument.addEventListener( "selectionchange", handleSelectionChange ); } function onFocus() { const { record, isSelected, onSelectionChange, applyRecord } = props.current; if (element.parentElement.closest('[contenteditable="true"]')) { return; } if (!isSelected) { const index = void 0; record.current = { ...record.current, start: index, end: index, activeFormats: EMPTY_ACTIVE_FORMATS2 }; } else { applyRecord(record.current, { domOnly: true }); } onSelectionChange(record.current.start, record.current.end); window.queueMicrotask(handleSelectionChange); ownerDocument.addEventListener( "selectionchange", handleSelectionChange ); } element.addEventListener("input", onInput); element.addEventListener("compositionstart", onCompositionStart); element.addEventListener("compositionend", onCompositionEnd); element.addEventListener("focus", onFocus); return () => { element.removeEventListener("input", onInput); element.removeEventListener("compositionstart", onCompositionStart); element.removeEventListener("compositionend", onCompositionEnd); element.removeEventListener("focus", onFocus); }; }; // packages/rich-text/build-module/hook/event-listeners/selection-change-compat.mjs var selection_change_compat_default = () => (element) => { const { ownerDocument } = element; const { defaultView } = ownerDocument; const selection = defaultView?.getSelection(); let range; function getRange() { return selection.rangeCount ? selection.getRangeAt(0) : null; } function onDown(event) { const type = event.type === "keydown" ? "keyup" : "pointerup"; function onCancel() { ownerDocument.removeEventListener(type, onUp); ownerDocument.removeEventListener("selectionchange", onCancel); ownerDocument.removeEventListener("input", onCancel); } function onUp() { onCancel(); if (isRangeEqual(range, getRange())) { return; } ownerDocument.dispatchEvent(new Event("selectionchange")); } ownerDocument.addEventListener(type, onUp); ownerDocument.addEventListener("selectionchange", onCancel); ownerDocument.addEventListener("input", onCancel); range = getRange(); } element.addEventListener("pointerdown", onDown); element.addEventListener("keydown", onDown); return () => { element.removeEventListener("pointerdown", onDown); element.removeEventListener("keydown", onDown); }; }; // packages/rich-text/build-module/hook/event-listeners/prevent-focus-capture.mjs function preventFocusCapture() { return (element) => { const { ownerDocument } = element; const { defaultView } = ownerDocument; let value = null; function onPointerDown(event) { if (event.defaultPrevented) { return; } if (event.target === element) { return; } if (!event.target.contains(element)) { return; } value = element.getAttribute("contenteditable"); element.setAttribute("contenteditable", "false"); defaultView.getSelection().removeAllRanges(); } function onPointerUp() { if (value !== null) { element.setAttribute("contenteditable", value); value = null; } } defaultView.addEventListener("pointerdown", onPointerDown); defaultView.addEventListener("pointerup", onPointerUp); return () => { defaultView.removeEventListener("pointerdown", onPointerDown); defaultView.removeEventListener("pointerup", onPointerUp); }; }; } // packages/rich-text/build-module/hook/event-listeners/index.mjs var allEventListeners = [ copy_handler_default, select_object_default, format_boundaries_default, delete_default, input_and_selection_default, selection_change_compat_default, preventFocusCapture ]; function useEventListeners(props) { const propsRef = (0, import_element3.useRef)(props); (0, import_element3.useInsertionEffect)(() => { propsRef.current = props; }); const refEffects = (0, import_element3.useMemo)( () => allEventListeners.map((refEffect) => refEffect(propsRef)), [propsRef] ); return (0, import_compose.useRefEffect)( (element) => { const cleanups = refEffects.map((effect) => effect(element)); return () => { cleanups.forEach((cleanup) => cleanup()); }; }, [refEffects] ); } // packages/rich-text/build-module/hook/use-format-types.mjs var import_element4 = __toESM(require_element(), 1); var import_data8 = __toESM(require_data(), 1); function formatTypesSelector(select5) { return select5(store).getFormatTypes(); } var interactiveContentTags = /* @__PURE__ */ new Set([ "a", "audio", "button", "details", "embed", "iframe", "input", "label", "select", "textarea", "video" ]); function prefixSelectKeys(selected, prefix) { if (typeof selected !== "object") { return { [prefix]: selected }; } return Object.fromEntries( Object.entries(selected).map(([key, value]) => [ `${prefix}.${key}`, value ]) ); } function getPrefixedSelectKeys(selected, prefix) { if (selected[prefix]) { return selected[prefix]; } return Object.keys(selected).filter((key) => key.startsWith(prefix + ".")).reduce((accumulator, key) => { accumulator[key.slice(prefix.length + 1)] = selected[key]; return accumulator; }, {}); } function useFormatTypes({ allowedFormats, withoutInteractiveFormatting, __unstableFormatTypeHandlerContext }) { const allFormatTypes = (0, import_data8.useSelect)(formatTypesSelector, []); const formatTypes2 = (0, import_element4.useMemo)(() => { return allFormatTypes.filter(({ name, interactive, tagName }) => { if (allowedFormats && !allowedFormats.includes(name)) { return false; } if (withoutInteractiveFormatting && (interactive || interactiveContentTags.has(tagName))) { return false; } return true; }); }, [allFormatTypes, allowedFormats, withoutInteractiveFormatting]); const keyedSelected = (0, import_data8.useSelect)( (select5) => formatTypes2.reduce((accumulator, type) => { if (!type.__experimentalGetPropsForEditableTreePreparation || !__unstableFormatTypeHandlerContext) { return accumulator; } return { ...accumulator, ...prefixSelectKeys( type.__experimentalGetPropsForEditableTreePreparation( select5, __unstableFormatTypeHandlerContext ), type.name ) }; }, {}), [formatTypes2, __unstableFormatTypeHandlerContext] ); const dispatch3 = (0, import_data8.useDispatch)(); const prepareHandlers = []; const valueHandlers = []; const changeHandlers = []; const dependencies = []; for (const key in keyedSelected) { dependencies.push(keyedSelected[key]); } formatTypes2.forEach((type) => { if (type.__experimentalCreatePrepareEditableTree && __unstableFormatTypeHandlerContext) { const handler = type.__experimentalCreatePrepareEditableTree( getPrefixedSelectKeys(keyedSelected, type.name), __unstableFormatTypeHandlerContext ); if (type.__experimentalCreateOnChangeEditableValue) { valueHandlers.push(handler); } else { prepareHandlers.push(handler); } } if (type.__experimentalCreateOnChangeEditableValue && __unstableFormatTypeHandlerContext) { let dispatchers = {}; if (type.__experimentalGetPropsForEditableTreeChangeHandler) { dispatchers = type.__experimentalGetPropsForEditableTreeChangeHandler( dispatch3, __unstableFormatTypeHandlerContext ); } const selected = getPrefixedSelectKeys(keyedSelected, type.name); changeHandlers.push( type.__experimentalCreateOnChangeEditableValue( { ...typeof selected === "object" ? selected : {}, ...dispatchers }, __unstableFormatTypeHandlerContext ) ); } }); return { formatTypes: formatTypes2, prepareHandlers, valueHandlers, changeHandlers, dependencies }; } // packages/rich-text/build-module/hook/index.mjs function useRichTextBase({ value = "", selectionStart, selectionEnd, placeholder, onSelectionChange, preserveWhiteSpace, onChange, __unstableDisableFormats: disableFormats, __unstableIsSelected: isSelected, __unstableDependencies = [], __unstableAfterParse, __unstableBeforeSerialize, __unstableAddInvisibleFormats }) { const registry = (0, import_data9.useRegistry)(); const [, forceRender] = (0, import_element5.useReducer)(() => ({})); const ref = (0, import_element5.useRef)(); function createRecord() { const { ownerDocument: { defaultView } } = ref.current; const selection = defaultView.getSelection(); const range = selection.rangeCount > 0 ? selection.getRangeAt(0) : null; return create({ element: ref.current, range, __unstableIsEditableTree: true }); } function applyRecord(newRecord, { domOnly } = {}) { apply({ value: newRecord, current: ref.current, prepareEditableTree: __unstableAddInvisibleFormats, __unstableDomOnly: domOnly, placeholder }); } const _valueRef = (0, import_element5.useRef)(value); const recordRef = (0, import_element5.useRef)(); function setRecordFromProps() { const activeFormats = recordRef.current?.activeFormats; _valueRef.current = value; recordRef.current = value; if (!(value instanceof RichTextData)) { recordRef.current = value ? RichTextData.fromHTMLString(value, { preserveWhiteSpace }) : RichTextData.empty(); } recordRef.current = { text: recordRef.current.text, formats: recordRef.current.formats, replacements: recordRef.current.replacements, activeFormats }; if (disableFormats) { recordRef.current.formats = Array(value.length); recordRef.current.replacements = Array(value.length); } if (__unstableAfterParse) { recordRef.current.formats = __unstableAfterParse( recordRef.current ); } recordRef.current.start = selectionStart; recordRef.current.end = selectionEnd; } const hadSelectionUpdateRef = (0, import_element5.useRef)(false); if (!recordRef.current) { hadSelectionUpdateRef.current = isSelected; setRecordFromProps(); } else if (selectionStart !== recordRef.current.start || selectionEnd !== recordRef.current.end) { hadSelectionUpdateRef.current = isSelected; recordRef.current = { ...recordRef.current, start: selectionStart, end: selectionEnd, activeFormats: void 0 }; } function handleChange(newRecord) { recordRef.current = newRecord; applyRecord(newRecord); if (disableFormats) { _valueRef.current = newRecord.text; } else { const newFormats = __unstableBeforeSerialize ? __unstableBeforeSerialize(newRecord) : newRecord.formats; newRecord = { ...newRecord, formats: newFormats }; if (typeof value === "string") { _valueRef.current = toHTMLString({ value: newRecord, preserveWhiteSpace }); } else { _valueRef.current = new RichTextData(newRecord); } } const { start, end, formats, text } = recordRef.current; registry.batch(() => { onSelectionChange(start, end); onChange(_valueRef.current, { __unstableFormats: formats, __unstableText: text }); }); forceRender(); } function applyFromProps() { const previousValue = _valueRef.current; setRecordFromProps(); const contentLengthChanged = previousValue && typeof previousValue === "string" && typeof value === "string" && previousValue.length !== value.length; const hasFocus = ref.current?.contains( ref.current.ownerDocument.activeElement ); const skipSelection = contentLengthChanged && !hasFocus; applyRecord(recordRef.current, { domOnly: skipSelection }); } const didMountRef = (0, import_element5.useRef)(false); (0, import_element5.useLayoutEffect)(() => { if (didMountRef.current && value !== _valueRef.current) { applyFromProps(); forceRender(); } }, [value]); (0, import_element5.useLayoutEffect)(() => { if (!hadSelectionUpdateRef.current) { return; } if (ref.current.ownerDocument.activeElement !== ref.current) { ref.current.focus(); } applyRecord(recordRef.current); hadSelectionUpdateRef.current = false; }, [hadSelectionUpdateRef.current]); const mergedRefs = (0, import_compose2.useMergeRefs)([ ref, useDefaultStyle(), useBoundaryStyle({ record: recordRef }), useEventListeners({ record: recordRef, handleChange, applyRecord, createRecord, isSelected, onSelectionChange, forceRender }), (0, import_compose2.useRefEffect)(() => { applyFromProps(); didMountRef.current = true; }, [placeholder, ...__unstableDependencies]) ]); return { value: recordRef.current, // A function to get the most recent value so event handlers in // useRichText implementations have access to it. For example when // listening to input events, we internally update the state, but this // state is not yet available to the input event handler because React // may re-render asynchronously. getValue: () => recordRef.current, onChange: handleChange, ref: mergedRefs }; } function useRichText({ allowedFormats, withoutInteractiveFormatting, onChange, __unstableDependencies = [], __unstableFormatTypeHandlerContext, ...props }) { const { formatTypes: formatTypes2, prepareHandlers, valueHandlers, changeHandlers, dependencies } = useFormatTypes({ allowedFormats, withoutInteractiveFormatting, __unstableFormatTypeHandlerContext }); function addEditorOnlyFormats(record) { return valueHandlers.reduce( (accumulator, fn) => fn(accumulator, record.text), record.formats ); } function removeEditorOnlyFormats(record) { formatTypes2.forEach((formatType) => { if (formatType.__experimentalCreatePrepareEditableTree) { record = removeFormat( record, formatType.name, 0, record.text.length ); } }); return record.formats; } function addInvisibleFormats(record) { return prepareHandlers.reduce( (accumulator, fn) => fn(accumulator, record.text), record.formats ); } const result = useRichTextBase({ ...props, onChange(value, { __unstableFormats, __unstableText }) { onChange(value, { __unstableFormats, __unstableText }); Object.values(changeHandlers).forEach((changeHandler) => { changeHandler(__unstableFormats, __unstableText); }); }, __unstableDependencies: [...dependencies, ...__unstableDependencies], __unstableAfterParse: addEditorOnlyFormats, __unstableBeforeSerialize: removeEditorOnlyFormats, __unstableAddInvisibleFormats: addInvisibleFormats }); return { ...result, formatTypes: formatTypes2 }; } function __unstableUseRichText(props) { (0, import_deprecated.default)("`__unstableUseRichText` hook", { since: "7.0" }); return useRichTextBase(props); } // packages/rich-text/build-module/private-apis.mjs var privateApis = {}; lock(privateApis, { useRichText }); // packages/rich-text/build-module/hook/use-anchor-ref.mjs var import_element6 = __toESM(require_element(), 1); var import_deprecated2 = __toESM(require_deprecated(), 1); function useAnchorRef({ ref, value, settings = {} }) { (0, import_deprecated2.default)("`useAnchorRef` hook", { since: "6.1", alternative: "`useAnchor` hook" }); const { tagName, className, name } = settings; const activeFormat = name ? getActiveFormat(value, name) : void 0; return (0, import_element6.useMemo)(() => { if (!ref.current) { return; } const { ownerDocument: { defaultView } } = ref.current; const selection = defaultView.getSelection(); if (!selection.rangeCount) { return; } const range = selection.getRangeAt(0); if (!activeFormat) { return range; } let element = range.startContainer; element = element.nextElementSibling || element; while (element.nodeType !== element.ELEMENT_NODE) { element = element.parentNode; } return element.closest( tagName + (className ? "." + className : "") ); }, [activeFormat, value.start, value.end, tagName, className]); } // packages/rich-text/build-module/hook/use-anchor.mjs var import_compose3 = __toESM(require_compose(), 1); var import_element7 = __toESM(require_element(), 1); var import_dom = __toESM(require_dom(), 1); function getFormatElement(range, editableContentElement, tagName, className) { let element = range.startContainer; if (element.nodeType === element.TEXT_NODE && range.startOffset === element.length && element.nextSibling) { element = element.nextSibling; while (element.firstChild) { element = element.firstChild; } } if (element.nodeType !== element.ELEMENT_NODE) { element = element.parentElement; } if (!element) { return; } if (element === editableContentElement) { return; } if (!editableContentElement.contains(element)) { return; } const selector = tagName + (className ? "." + className : ""); while (element !== editableContentElement) { if (element.matches(selector)) { return element; } element = element.parentElement; } } function createVirtualAnchorElement(range, editableContentElement) { return { contextElement: editableContentElement, getBoundingClientRect() { if (editableContentElement.contains(range.startContainer)) { return (0, import_dom.getRectangleFromRange)(range) ?? range.getBoundingClientRect(); } return editableContentElement.getBoundingClientRect(); } }; } function getAnchor(editableContentElement, tagName, className) { if (!editableContentElement) { return; } const { ownerDocument } = editableContentElement; const { defaultView } = ownerDocument; const selection = defaultView.getSelection(); if (!selection) { return; } if (!selection.rangeCount) { return; } const range = selection.getRangeAt(0); if (!range || !range.startContainer) { return; } const formatElement = getFormatElement( range, editableContentElement, tagName, className ); if (formatElement) { return formatElement; } return createVirtualAnchorElement(range, editableContentElement); } function useAnchor({ editableContentElement, settings = {} }) { const { tagName, className, isActive } = settings; const [anchor, setAnchor] = (0, import_element7.useState)( () => getAnchor(editableContentElement, tagName, className) ); const wasActive = (0, import_compose3.usePrevious)(isActive); (0, import_element7.useLayoutEffect)(() => { if (!editableContentElement) { return; } function callback() { setAnchor( getAnchor(editableContentElement, tagName, className) ); } function attach() { ownerDocument.addEventListener("selectionchange", callback); } function detach() { ownerDocument.removeEventListener("selectionchange", callback); } const { ownerDocument } = editableContentElement; if (editableContentElement === ownerDocument.activeElement || // When a link is created, we need to attach the popover to the newly created anchor. !wasActive && isActive || // Sometimes we're _removing_ an active anchor, such as the inline color popover. // When we add the color, it switches from a virtual anchor to a `<mark>` element. // When we _remove_ the color, it switches from a `<mark>` element to a virtual anchor. wasActive && !isActive) { setAnchor( getAnchor(editableContentElement, tagName, className) ); attach(); } editableContentElement.addEventListener("focusin", attach); editableContentElement.addEventListener("focusout", detach); return () => { detach(); editableContentElement.removeEventListener("focusin", attach); editableContentElement.removeEventListener("focusout", detach); }; }, [editableContentElement, tagName, className, isActive, wasActive]); return anchor; } // packages/rich-text/build-module/index.mjs function __experimentalRichText() { } return __toCommonJS(index_exports); })(); core-commands.js 0000644 00000071267 15206720414 0007647 0 ustar 00 var wp; (wp ||= {}).coreCommands = (() => { 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 __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; 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 )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // package-external:@wordpress/element var require_element = __commonJS({ "package-external:@wordpress/element"(exports, module) { module.exports = window.wp.element; } }); // package-external:@wordpress/router var require_router = __commonJS({ "package-external:@wordpress/router"(exports, module) { module.exports = window.wp.router; } }); // package-external:@wordpress/commands var require_commands = __commonJS({ "package-external:@wordpress/commands"(exports, module) { module.exports = window.wp.commands; } }); // package-external:@wordpress/i18n var require_i18n = __commonJS({ "package-external:@wordpress/i18n"(exports, module) { module.exports = window.wp.i18n; } }); // 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/core-data var require_core_data = __commonJS({ "package-external:@wordpress/core-data"(exports, module) { module.exports = window.wp.coreData; } }); // package-external:@wordpress/data var require_data = __commonJS({ "package-external:@wordpress/data"(exports, module) { module.exports = window.wp.data; } }); // package-external:@wordpress/url var require_url = __commonJS({ "package-external:@wordpress/url"(exports, module) { module.exports = window.wp.url; } }); // package-external:@wordpress/compose var require_compose = __commonJS({ "package-external:@wordpress/compose"(exports, module) { module.exports = window.wp.compose; } }); // package-external:@wordpress/html-entities var require_html_entities = __commonJS({ "package-external:@wordpress/html-entities"(exports, module) { module.exports = window.wp.htmlEntities; } }); // package-external:@wordpress/private-apis var require_private_apis = __commonJS({ "package-external:@wordpress/private-apis"(exports, module) { module.exports = window.wp.privateApis; } }); // packages/core-commands/build-module/index.mjs var index_exports = {}; __export(index_exports, { initializeCommandPalette: () => initializeCommandPalette, privateApis: () => privateApis }); var import_element3 = __toESM(require_element(), 1); var import_router2 = __toESM(require_router(), 1); var import_commands3 = __toESM(require_commands(), 1); // packages/core-commands/build-module/admin-navigation-commands.mjs var import_commands = __toESM(require_commands(), 1); var import_i18n = __toESM(require_i18n(), 1); // packages/icons/build-module/library/brush.mjs var import_primitives = __toESM(require_primitives(), 1); var import_jsx_runtime = __toESM(require_jsx_runtime(), 1); var brush_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: "M4 20h8v-1.5H4V20zM18.9 3.5c-.6-.6-1.5-.6-2.1 0l-7.2 7.2c-.4-.1-.7 0-1.1.1-.5.2-1.5.7-1.9 2.2-.4 1.7-.8 2.2-1.1 2.7-.1.1-.2.3-.3.4l-.6 1.1H6c2 0 3.4-.4 4.7-1.4.8-.6 1.2-1.4 1.3-2.3 0-.3 0-.5-.1-.7L19 5.7c.5-.6.5-1.6-.1-2.2zM9.7 14.7c-.7.5-1.5.8-2.4 1 .2-.5.5-1.2.8-2.3.2-.6.4-1 .8-1.1.5-.1 1 .1 1.3.3.2.2.3.5.2.8 0 .3-.1.9-.7 1.3z" }) }); // packages/icons/build-module/library/external.mjs var import_primitives2 = __toESM(require_primitives(), 1); var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1); var external_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: "M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z" }) }); // packages/icons/build-module/library/layout.mjs var import_primitives3 = __toESM(require_primitives(), 1); var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1); var layout_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: "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_primitives4 = __toESM(require_primitives(), 1); var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1); var navigation_default = /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(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: "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_primitives5 = __toESM(require_primitives(), 1); var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1); var page_default = /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(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, { d: "M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z" }), /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives5.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/post.mjs var import_primitives6 = __toESM(require_primitives(), 1); var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1); var post_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: "m7.3 9.7 1.4 1.4c.2-.2.3-.3.4-.5 0 0 0-.1.1-.1.3-.5.4-1.1.3-1.6L12 7 9 4 7.2 6.5c-.6-.1-1.1 0-1.6.3 0 0-.1 0-.1.1-.3.1-.4.2-.6.4l1.4 1.4L4 11v1h1l2.3-2.3zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z" }) }); // packages/icons/build-module/library/styles.mjs var import_primitives7 = __toESM(require_primitives(), 1); var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1); var styles_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, { 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_primitives8 = __toESM(require_primitives(), 1); var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1); var symbol_filled_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: "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_primitives9 = __toESM(require_primitives(), 1); var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1); var symbol_default = /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_primitives9.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_primitives9.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/core-commands/build-module/admin-navigation-commands.mjs var import_element = __toESM(require_element(), 1); var import_core_data = __toESM(require_core_data(), 1); var import_data = __toESM(require_data(), 1); var getViewSiteCommand = () => function useViewSiteCommand() { const homeUrl = (0, import_data.useSelect)((select) => { return select(import_core_data.store).getEntityRecord( "root", "__unstableBase" )?.home; }, []); const commands = (0, import_element.useMemo)(() => { if (!homeUrl) { return []; } return [ { name: "core/view-site", label: (0, import_i18n.__)("View site"), icon: external_default, category: "view", callback: ({ close }) => { close(); window.open(homeUrl, "_blank"); } } ]; }, [homeUrl]); return { isLoading: false, commands }; }; function useAdminNavigationCommands(menuCommands) { const commands = (0, import_element.useMemo)(() => { return (menuCommands ?? []).map((menuCommand) => { const label = (0, import_i18n.sprintf)( /* translators: %s: menu label */ (0, import_i18n.__)("Go to: %s"), menuCommand.label ); return { name: menuCommand.name, label, searchLabel: label, category: "view", callback: ({ close }) => { document.location = menuCommand.url; close(); } }; }); }, [menuCommands]); (0, import_commands.useCommands)(commands); (0, import_commands.useCommandLoader)({ name: "core/view-site", hook: getViewSiteCommand() }); } // packages/core-commands/build-module/site-editor-navigation-commands.mjs var import_commands2 = __toESM(require_commands(), 1); var import_i18n2 = __toESM(require_i18n(), 1); var import_element2 = __toESM(require_element(), 1); var import_data2 = __toESM(require_data(), 1); var import_core_data2 = __toESM(require_core_data(), 1); var import_router = __toESM(require_router(), 1); var import_url = __toESM(require_url(), 1); var import_compose = __toESM(require_compose(), 1); var import_html_entities = __toESM(require_html_entities(), 1); // packages/core-commands/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/core-commands" ); // packages/core-commands/build-module/utils/order-entity-records-by-search.mjs function orderEntityRecordsBySearch(records = [], search = "") { if (!Array.isArray(records) || !records.length) { return []; } if (!search) { return records; } const priority = []; const nonPriority = []; for (let i = 0; i < records.length; i++) { const record = records[i]; if (record?.title?.raw?.toLowerCase()?.includes(search?.toLowerCase())) { priority.push(record); } else { nonPriority.push(record); } } return priority.concat(nonPriority); } // packages/core-commands/build-module/site-editor-navigation-commands.mjs var { useHistory } = unlock(import_router.privateApis); var icons = { post: post_default, page: page_default, wp_template: layout_default, wp_template_part: symbol_filled_default }; function useDebouncedValue(value) { const [debouncedValue, setDebouncedValue] = (0, import_element2.useState)(""); const debounced = (0, import_compose.useDebounce)(setDebouncedValue, 250); (0, import_element2.useEffect)(() => { debounced(value); return () => debounced.cancel(); }, [debounced, value]); return debouncedValue; } var ROUTE_MAPPING = { "/template": "/templates", "/pattern": "/patterns" }; function getSiteEditorPage() { return window.__experimentalExtensibleSiteEditor ? "admin.php?page=site-editor-v2" : "site-editor.php"; } function mapRoute(path) { if (!window.__experimentalExtensibleSiteEditor) { return path; } for (const [oldPath, newPath] of Object.entries(ROUTE_MAPPING)) { if (path === oldPath || path.startsWith(oldPath + "?")) { if (path.includes("postType=wp_template_part")) { return "/template-parts"; } return path.replace(oldPath, newPath); } } return path; } function isInSiteEditor() { const path = (0, import_url.getPath)(window.location.href); return path?.includes("site-editor.php") || path?.includes("page=site-editor-v2"); } var getNavigationCommandLoaderPerPostType = (postType) => function useNavigationCommandLoader({ search }) { const history = useHistory(); const { isBlockBasedTheme, canCreateTemplate } = (0, import_data2.useSelect)( (select) => { return { isBlockBasedTheme: select(import_core_data2.store).getCurrentTheme()?.is_block_theme, canCreateTemplate: select(import_core_data2.store).canUser("create", { kind: "postType", name: "wp_template" }) }; }, [] ); const delayedSearch = useDebouncedValue(search); const { records, isLoading } = (0, import_data2.useSelect)( (select) => { if (!delayedSearch) { return { isLoading: false }; } const query = { search: delayedSearch, per_page: 10, orderby: "relevance", status: [ "publish", "future", "draft", "pending", "private" ] }; return { records: select(import_core_data2.store).getEntityRecords( "postType", postType, query ), isLoading: !select(import_core_data2.store).hasFinishedResolution( "getEntityRecords", ["postType", postType, query] ) }; }, [delayedSearch] ); const commands = (0, import_element2.useMemo)(() => { return (records ?? []).map((record) => { const command = { name: postType + "-" + record.id, searchLabel: record.title?.rendered + " " + record.id, label: record.title?.rendered ? (0, import_html_entities.decodeEntities)(record.title?.rendered) : (0, import_i18n2.__)("(no title)"), icon: icons[postType], category: "edit" }; if (!canCreateTemplate || postType === "post" || postType === "page" && !isBlockBasedTheme) { return { ...command, callback: ({ close }) => { const args = { post: record.id, action: "edit" }; const targetUrl = (0, import_url.addQueryArgs)("post.php", args); document.location = targetUrl; close(); } }; } const isSiteEditor = isInSiteEditor(); return { ...command, callback: ({ close }) => { if (isSiteEditor) { history.navigate( `/${postType}/${record.id}?canvas=edit` ); } else { document.location = (0, import_url.addQueryArgs)( getSiteEditorPage(), { p: `/${postType}/${record.id}`, canvas: "edit" } ); } close(); } }; }); }, [canCreateTemplate, records, isBlockBasedTheme, history]); return { commands, isLoading }; }; var getNavigationCommandLoaderPerTemplate = (templateType) => function useNavigationCommandLoader({ search }) { const history = useHistory(); const { isBlockBasedTheme, canCreateTemplate } = (0, import_data2.useSelect)( (select) => { return { isBlockBasedTheme: select(import_core_data2.store).getCurrentTheme()?.is_block_theme, canCreateTemplate: select(import_core_data2.store).canUser("create", { kind: "postType", name: templateType }) }; }, [] ); const { records, isLoading } = (0, import_data2.useSelect)((select) => { const { getEntityRecords } = select(import_core_data2.store); const query = { per_page: -1 }; return { records: getEntityRecords("postType", templateType, query), isLoading: !select(import_core_data2.store).hasFinishedResolution( "getEntityRecords", ["postType", templateType, query] ) }; }, []); const orderedRecords = (0, import_element2.useMemo)(() => { return orderEntityRecordsBySearch(records, search).slice(0, 10); }, [records, search]); const commands = (0, import_element2.useMemo)(() => { if (!canCreateTemplate || !isBlockBasedTheme && !templateType === "wp_template_part") { return []; } const isSiteEditor = (0, import_url.getPath)(window.location.href)?.includes( "site-editor.php" ); const result = []; result.push( ...orderedRecords.map((record) => { return { name: templateType + "-" + record.id, searchLabel: record.title?.rendered + " " + record.id, label: record.title?.rendered ? record.title?.rendered : (0, import_i18n2.__)("(no title)"), icon: icons[templateType], category: "edit", callback: ({ close }) => { if (isSiteEditor) { history.navigate( `/${templateType}/${record.id}?canvas=edit` ); } else { document.location = (0, import_url.addQueryArgs)( getSiteEditorPage(), { p: `/${templateType}/${record.id}`, canvas: "edit" } ); } close(); } }; }) ); if (orderedRecords?.length > 0 && templateType === "wp_template_part") { result.push({ name: "core/edit-site/open-template-parts", label: (0, import_i18n2.__)("Go to: Template parts"), icon: symbol_filled_default, category: "view", callback: ({ close }) => { if (isSiteEditor) { history.navigate( mapRoute( "/pattern?postType=wp_template_part&categoryId=all-parts" ) ); } else { document.location = (0, import_url.addQueryArgs)( getSiteEditorPage(), { p: mapRoute("/pattern"), postType: "wp_template_part", categoryId: "all-parts" } ); } close(); } }); } return result; }, [canCreateTemplate, isBlockBasedTheme, orderedRecords, history]); return { commands, isLoading }; }; var getSiteEditorBasicNavigationCommands = () => function useSiteEditorBasicNavigationCommands() { const history = useHistory(); const isSiteEditor = isInSiteEditor(); const { isBlockBasedTheme, canCreateTemplate, canCreatePatterns } = (0, import_data2.useSelect)((select) => { return { isBlockBasedTheme: select(import_core_data2.store).getCurrentTheme()?.is_block_theme, canCreateTemplate: select(import_core_data2.store).canUser("create", { kind: "postType", name: "wp_template" }), canCreatePatterns: select(import_core_data2.store).canUser("create", { kind: "postType", name: "wp_block" }) }; }, []); const commands = (0, import_element2.useMemo)(() => { const result = []; if (canCreateTemplate && isBlockBasedTheme) { result.push({ name: "core/edit-site/open-styles", label: (0, import_i18n2.__)("Go to: Styles"), icon: styles_default, category: "view", callback: ({ close }) => { if (isSiteEditor) { history.navigate("/styles"); } else { document.location = (0, import_url.addQueryArgs)( getSiteEditorPage(), { p: "/styles" } ); } close(); } }); result.push({ name: "core/edit-site/open-navigation", label: (0, import_i18n2.__)("Go to: Navigation"), icon: navigation_default, category: "view", callback: ({ close }) => { if (isSiteEditor) { history.navigate("/navigation"); } else { document.location = (0, import_url.addQueryArgs)( getSiteEditorPage(), { p: "/navigation" } ); } close(); } }); result.push({ name: "core/edit-site/open-templates", label: (0, import_i18n2.__)("Go to: Templates"), icon: layout_default, category: "view", callback: ({ close }) => { if (isSiteEditor) { history.navigate(mapRoute("/template")); } else { document.location = (0, import_url.addQueryArgs)( getSiteEditorPage(), { p: mapRoute("/template") } ); } close(); } }); } if (canCreatePatterns) { result.push({ name: "core/edit-site/open-patterns", label: (0, import_i18n2.__)("Go to: Patterns"), icon: symbol_default, category: "view", callback: ({ close }) => { if (canCreateTemplate) { if (isSiteEditor) { history.navigate(mapRoute("/pattern")); } else { document.location = (0, import_url.addQueryArgs)( getSiteEditorPage(), { p: mapRoute("/pattern") } ); } close(); } else { document.location.href = "edit.php?post_type=wp_block"; } } }); } return result; }, [ history, isSiteEditor, canCreateTemplate, canCreatePatterns, isBlockBasedTheme ]); return { commands, isLoading: false }; }; var getGlobalStylesOpenCssCommands = () => function useGlobalStylesOpenCssCommands() { const history = useHistory(); const isSiteEditor = isInSiteEditor(); const { canEditCSS } = (0, import_data2.useSelect)((select) => { const { getEntityRecord, __experimentalGetCurrentGlobalStylesId } = select(import_core_data2.store); const globalStylesId = __experimentalGetCurrentGlobalStylesId(); const globalStyles = globalStylesId ? getEntityRecord("root", "globalStyles", globalStylesId) : void 0; return { canEditCSS: !!globalStyles?._links?.["wp:action-edit-css"] }; }, []); const commands = (0, import_element2.useMemo)(() => { if (!canEditCSS) { return []; } return [ { name: "core/open-styles-css", label: (0, import_i18n2.__)("Open custom CSS"), icon: brush_default, category: "view", callback: ({ close }) => { close(); if (isSiteEditor) { history.navigate("/styles?section=/css"); } else { document.location = (0, import_url.addQueryArgs)( getSiteEditorPage(), { p: "/styles", section: "/css" } ); } } } ]; }, [history, canEditCSS, isSiteEditor]); return { isLoading: false, commands }; }; function useSiteEditorNavigationCommands(isNetworkAdmin) { (0, import_commands2.useCommandLoader)({ name: "core/edit-site/navigate-pages", hook: getNavigationCommandLoaderPerPostType("page"), disabled: isNetworkAdmin }); (0, import_commands2.useCommandLoader)({ name: "core/edit-site/navigate-posts", hook: getNavigationCommandLoaderPerPostType("post"), disabled: isNetworkAdmin }); (0, import_commands2.useCommandLoader)({ name: "core/edit-site/navigate-templates", hook: getNavigationCommandLoaderPerTemplate("wp_template"), disabled: isNetworkAdmin }); (0, import_commands2.useCommandLoader)({ name: "core/edit-site/navigate-template-parts", hook: getNavigationCommandLoaderPerTemplate("wp_template_part"), disabled: isNetworkAdmin }); (0, import_commands2.useCommandLoader)({ name: "core/edit-site/basic-navigation", hook: getSiteEditorBasicNavigationCommands(), context: "site-editor", disabled: isNetworkAdmin }); (0, import_commands2.useCommandLoader)({ name: "core/edit-site/global-styles-css", hook: getGlobalStylesOpenCssCommands(), disabled: isNetworkAdmin }); } // packages/core-commands/build-module/private-apis.mjs function useCommands2() { useAdminNavigationCommands(); useSiteEditorNavigationCommands(); } var privateApis = {}; lock(privateApis, { useCommands: useCommands2 }); // packages/core-commands/build-module/index.mjs var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1); var { RouterProvider } = unlock(import_router2.privateApis); function CommandPalette({ settings }) { const { menu_commands: menuCommands, is_network_admin: isNetworkAdmin } = settings; useAdminNavigationCommands(menuCommands); useSiteEditorNavigationCommands(isNetworkAdmin); return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(RouterProvider, { pathArg: "p", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_commands3.CommandMenu, {}) }); } function initializeCommandPalette(settings) { const root = document.createElement("div"); document.body.appendChild(root); (0, import_element3.createRoot)(root).render( /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_element3.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CommandPalette, { settings }) }) ); } return __toCommonJS(index_exports); })(); vendor/wp-polyfill-inert.min.js 0000644 00000017776 15206720414 0012601 0 ustar 00 !function(e){("object"!=typeof exports||"undefined"==typeof module)&&"function"==typeof define&&define.amd?define("inert",e):e()}(function(){"use strict";var o,r,t,i,s,n,e=function(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),e};function a(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){d(this,u),this._inertManager=t,this._rootElement=e,this._managedNodes=new Set,this._rootElement.hasAttribute("aria-hidden")?this._savedAriaHidden=this._rootElement.getAttribute("aria-hidden"):this._savedAriaHidden=null,this._rootElement.setAttribute("aria-hidden","true"),this._makeSubtreeUnfocusable(this._rootElement),this._observer=new MutationObserver(this._onMutation.bind(this)),this._observer.observe(this._rootElement,{attributes:!0,childList:!0,subtree:!0})}function h(e,t){d(this,h),this._node=e,this._overrodeFocusMethod=!1,this._inertRoots=new Set([t]),this._savedTabIndex=null,this._destroyed=!1,this.ensureUntabbable()}function l(e){if(d(this,l),!e)throw new Error("Missing required argument; InertManager needs to wrap a document.");this._document=e,this._managedNodes=new Map,this._inertRoots=new Map,this._observer=new MutationObserver(this._watchForInert.bind(this)),_(e.head||e.body||e.documentElement),"loading"===e.readyState?e.addEventListener("DOMContentLoaded",this._onDocumentLoaded.bind(this)):this._onDocumentLoaded()}function c(e,t,n){if(e.nodeType==Node.ELEMENT_NODE){var i=e,o=(t&&t(i),i.shadowRoot);if(o)return void c(o,t,o);if("content"==i.localName){for(var o=i,r=o.getDistributedNodes?o.getDistributedNodes():[],s=0;s<r.length;s++)c(r[s],t,n);return}if("slot"==i.localName){for(var o=i,a=o.assignedNodes?o.assignedNodes({flatten:!0}):[],d=0;d<a.length;d++)c(a[d],t,n);return}}for(var u=e.firstChild;null!=u;)c(u,t,n),u=u.nextSibling}function _(e){var t;e.querySelector("style#inert-style, link#inert-style")||((t=document.createElement("style")).setAttribute("id","inert-style"),t.textContent="\n[inert] {\n pointer-events: none;\n cursor: default;\n}\n\n[inert], [inert] * {\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n",e.appendChild(t))}"undefined"!=typeof window&&"undefined"!=typeof Element&&(o=Array.prototype.slice,r=Element.prototype.matches||Element.prototype.msMatchesSelector,t=["a[href]","area[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","details","summary","iframe","object","embed","video","[contenteditable]"].join(","),e(u,[{key:"destructor",value:function(){this._observer.disconnect(),this._rootElement&&(null!==this._savedAriaHidden?this._rootElement.setAttribute("aria-hidden",this._savedAriaHidden):this._rootElement.removeAttribute("aria-hidden")),this._managedNodes.forEach(function(e){this._unmanageNode(e.node)},this),this._observer=null,this._rootElement=null,this._managedNodes=null,this._inertManager=null}},{key:"_makeSubtreeUnfocusable",value:function(e){var t=this,n=(c(e,function(e){return t._visitNode(e)}),document.activeElement);if(!document.body.contains(e)){for(var i=e,o=void 0;i;){if(i.nodeType===Node.DOCUMENT_FRAGMENT_NODE){o=i;break}i=i.parentNode}o&&(n=o.activeElement)}e.contains(n)&&(n.blur(),n===document.activeElement&&document.body.focus())}},{key:"_visitNode",value:function(e){e.nodeType===Node.ELEMENT_NODE&&((e=e)!==this._rootElement&&e.hasAttribute("inert")&&this._adoptInertRoot(e),(r.call(e,t)||e.hasAttribute("tabindex"))&&this._manageNode(e))}},{key:"_manageNode",value:function(e){e=this._inertManager.register(e,this);this._managedNodes.add(e)}},{key:"_unmanageNode",value:function(e){e=this._inertManager.deregister(e,this);e&&this._managedNodes.delete(e)}},{key:"_unmanageSubtree",value:function(e){var t=this;c(e,function(e){return t._unmanageNode(e)})}},{key:"_adoptInertRoot",value:function(e){var t=this._inertManager.getInertRoot(e);t||(this._inertManager.setInert(e,!0),t=this._inertManager.getInertRoot(e)),t.managedNodes.forEach(function(e){this._manageNode(e.node)},this)}},{key:"_onMutation",value:function(e,t){e.forEach(function(e){var t,n=e.target;"childList"===e.type?(o.call(e.addedNodes).forEach(function(e){this._makeSubtreeUnfocusable(e)},this),o.call(e.removedNodes).forEach(function(e){this._unmanageSubtree(e)},this)):"attributes"===e.type&&("tabindex"===e.attributeName?this._manageNode(n):n!==this._rootElement&&"inert"===e.attributeName&&n.hasAttribute("inert")&&(this._adoptInertRoot(n),t=this._inertManager.getInertRoot(n),this._managedNodes.forEach(function(e){n.contains(e.node)&&t._manageNode(e.node)})))},this)}},{key:"managedNodes",get:function(){return new Set(this._managedNodes)}},{key:"hasSavedAriaHidden",get:function(){return null!==this._savedAriaHidden}},{key:"savedAriaHidden",set:function(e){this._savedAriaHidden=e},get:function(){return this._savedAriaHidden}}]),i=u,e(h,[{key:"destructor",value:function(){var e;this._throwIfDestroyed(),this._node&&this._node.nodeType===Node.ELEMENT_NODE&&(e=this._node,null!==this._savedTabIndex?e.setAttribute("tabindex",this._savedTabIndex):e.removeAttribute("tabindex"),this._overrodeFocusMethod&&delete e.focus),this._node=null,this._inertRoots=null,this._destroyed=!0}},{key:"_throwIfDestroyed",value:function(){if(this.destroyed)throw new Error("Trying to access destroyed InertNode")}},{key:"ensureUntabbable",value:function(){var e;this.node.nodeType===Node.ELEMENT_NODE&&(e=this.node,r.call(e,t)?-1===e.tabIndex&&this.hasSavedTabIndex||(e.hasAttribute("tabindex")&&(this._savedTabIndex=e.tabIndex),e.setAttribute("tabindex","-1"),e.nodeType===Node.ELEMENT_NODE&&(e.focus=function(){},this._overrodeFocusMethod=!0)):e.hasAttribute("tabindex")&&(this._savedTabIndex=e.tabIndex,e.removeAttribute("tabindex")))}},{key:"addInertRoot",value:function(e){this._throwIfDestroyed(),this._inertRoots.add(e)}},{key:"removeInertRoot",value:function(e){this._throwIfDestroyed(),this._inertRoots.delete(e),0===this._inertRoots.size&&this.destructor()}},{key:"destroyed",get:function(){return this._destroyed}},{key:"hasSavedTabIndex",get:function(){return null!==this._savedTabIndex}},{key:"node",get:function(){return this._throwIfDestroyed(),this._node}},{key:"savedTabIndex",set:function(e){this._throwIfDestroyed(),this._savedTabIndex=e},get:function(){return this._throwIfDestroyed(),this._savedTabIndex}}]),s=h,e(l,[{key:"setInert",value:function(e,t){if(t){if(!this._inertRoots.has(e)){t=new i(e,this);if(e.setAttribute("inert",""),this._inertRoots.set(e,t),!this._document.body.contains(e))for(var n=e.parentNode;n;)11===n.nodeType&&_(n),n=n.parentNode}}else this._inertRoots.has(e)&&(this._inertRoots.get(e).destructor(),this._inertRoots.delete(e),e.removeAttribute("inert"))}},{key:"getInertRoot",value:function(e){return this._inertRoots.get(e)}},{key:"register",value:function(e,t){var n=this._managedNodes.get(e);return void 0!==n?n.addInertRoot(t):n=new s(e,t),this._managedNodes.set(e,n),n}},{key:"deregister",value:function(e,t){var n=this._managedNodes.get(e);return n?(n.removeInertRoot(t),n.destroyed&&this._managedNodes.delete(e),n):null}},{key:"_onDocumentLoaded",value:function(){o.call(this._document.querySelectorAll("[inert]")).forEach(function(e){this.setInert(e,!0)},this),this._observer.observe(this._document.body||this._document.documentElement,{attributes:!0,subtree:!0,childList:!0})}},{key:"_watchForInert",value:function(e,t){var i=this;e.forEach(function(e){switch(e.type){case"childList":o.call(e.addedNodes).forEach(function(e){var t;e.nodeType===Node.ELEMENT_NODE&&(t=o.call(e.querySelectorAll("[inert]")),r.call(e,"[inert]")&&t.unshift(e),t.forEach(function(e){this.setInert(e,!0)},i))},i);break;case"attributes":if("inert"!==e.attributeName)return;var t=e.target,n=t.hasAttribute("inert");i.setInert(t,n)}},this)}}]),e=l,HTMLElement.prototype.hasOwnProperty("inert")||(n=new e(document),Object.defineProperty(HTMLElement.prototype,"inert",{enumerable:!0,get:function(){return this.hasAttribute("inert")},set:function(e){n.setInert(this,e)}})))}); vendor/wp-polyfill-formdata.min.js 0000644 00000021272 15206720414 0013237 0 ustar 00 /*! formdata-polyfill. MIT License. Jimmy W?rting <https://jimmy.warting.se/opensource> */ ;(function(){var h;function l(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}}var m="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(a==Array.prototype||a==Object.prototype)return a;a[b]=c.value;return a}; function n(a){a=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var b=0;b<a.length;++b){var c=a[b];if(c&&c.Math==Math)return c}throw Error("Cannot find global object");}var q=n(this);function r(a,b){if(b)a:{var c=q;a=a.split(".");for(var d=0;d<a.length-1;d++){var e=a[d];if(!(e in c))break a;c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&m(c,a,{configurable:!0,writable:!0,value:b})}} r("Symbol",function(a){function b(f){if(this instanceof b)throw new TypeError("Symbol is not a constructor");return new c(d+(f||"")+"_"+e++,f)}function c(f,g){this.A=f;m(this,"description",{configurable:!0,writable:!0,value:g})}if(a)return a;c.prototype.toString=function(){return this.A};var d="jscomp_symbol_"+(1E9*Math.random()>>>0)+"_",e=0;return b}); r("Symbol.iterator",function(a){if(a)return a;a=Symbol("Symbol.iterator");for(var b="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),c=0;c<b.length;c++){var d=q[b[c]];"function"===typeof d&&"function"!=typeof d.prototype[a]&&m(d.prototype,a,{configurable:!0,writable:!0,value:function(){return u(l(this))}})}return a});function u(a){a={next:a};a[Symbol.iterator]=function(){return this};return a} function v(a){var b="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return b?b.call(a):{next:l(a)}}var w;if("function"==typeof Object.setPrototypeOf)w=Object.setPrototypeOf;else{var y;a:{var z={a:!0},A={};try{A.__proto__=z;y=A.a;break a}catch(a){}y=!1}w=y?function(a,b){a.__proto__=b;if(a.__proto__!==b)throw new TypeError(a+" is not extensible");return a}:null}var B=w;function C(){this.m=!1;this.j=null;this.v=void 0;this.h=1;this.u=this.C=0;this.l=null} function D(a){if(a.m)throw new TypeError("Generator is already running");a.m=!0}C.prototype.o=function(a){this.v=a};C.prototype.s=function(a){this.l={D:a,F:!0};this.h=this.C||this.u};C.prototype.return=function(a){this.l={return:a};this.h=this.u};function E(a,b){a.h=3;return{value:b}}function F(a){this.g=new C;this.G=a}F.prototype.o=function(a){D(this.g);if(this.g.j)return G(this,this.g.j.next,a,this.g.o);this.g.o(a);return H(this)}; function I(a,b){D(a.g);var c=a.g.j;if(c)return G(a,"return"in c?c["return"]:function(d){return{value:d,done:!0}},b,a.g.return);a.g.return(b);return H(a)}F.prototype.s=function(a){D(this.g);if(this.g.j)return G(this,this.g.j["throw"],a,this.g.o);this.g.s(a);return H(this)}; function G(a,b,c,d){try{var e=b.call(a.g.j,c);if(!(e instanceof Object))throw new TypeError("Iterator result "+e+" is not an object");if(!e.done)return a.g.m=!1,e;var f=e.value}catch(g){return a.g.j=null,a.g.s(g),H(a)}a.g.j=null;d.call(a.g,f);return H(a)}function H(a){for(;a.g.h;)try{var b=a.G(a.g);if(b)return a.g.m=!1,{value:b.value,done:!1}}catch(c){a.g.v=void 0,a.g.s(c)}a.g.m=!1;if(a.g.l){b=a.g.l;a.g.l=null;if(b.F)throw b.D;return{value:b.return,done:!0}}return{value:void 0,done:!0}} function J(a){this.next=function(b){return a.o(b)};this.throw=function(b){return a.s(b)};this.return=function(b){return I(a,b)};this[Symbol.iterator]=function(){return this}}function K(a,b){b=new J(new F(b));B&&a.prototype&&B(b,a.prototype);return b}function L(a,b){a instanceof String&&(a+="");var c=0,d=!1,e={next:function(){if(!d&&c<a.length){var f=c++;return{value:b(f,a[f]),done:!1}}d=!0;return{done:!0,value:void 0}}};e[Symbol.iterator]=function(){return e};return e} r("Array.prototype.entries",function(a){return a?a:function(){return L(this,function(b,c){return[b,c]})}}); if("undefined"!==typeof Blob&&("undefined"===typeof FormData||!FormData.prototype.keys)){var M=function(a,b){for(var c=0;c<a.length;c++)b(a[c])},N=function(a){return a.replace(/\r?\n|\r/g,"\r\n")},O=function(a,b,c){if(b instanceof Blob){c=void 0!==c?String(c+""):"string"===typeof b.name?b.name:"blob";if(b.name!==c||"[object Blob]"===Object.prototype.toString.call(b))b=new File([b],c);return[String(a),b]}return[String(a),String(b)]},P=function(a,b){if(a.length<b)throw new TypeError(b+" argument required, but only "+ a.length+" present.");},Q="object"===typeof globalThis?globalThis:"object"===typeof window?window:"object"===typeof self?self:this,R=Q.FormData,S=Q.XMLHttpRequest&&Q.XMLHttpRequest.prototype.send,T=Q.Request&&Q.fetch,U=Q.navigator&&Q.navigator.sendBeacon,V=Q.Element&&Q.Element.prototype,W=Q.Symbol&&Symbol.toStringTag;W&&(Blob.prototype[W]||(Blob.prototype[W]="Blob"),"File"in Q&&!File.prototype[W]&&(File.prototype[W]="File"));try{new File([],"")}catch(a){Q.File=function(b,c,d){b=new Blob(b,d||{}); Object.defineProperties(b,{name:{value:c},lastModified:{value:+(d&&void 0!==d.lastModified?new Date(d.lastModified):new Date)},toString:{value:function(){return"[object File]"}}});W&&Object.defineProperty(b,W,{value:"File"});return b}}var escape=function(a){return a.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22")},X=function(a){this.i=[];var b=this;a&&M(a.elements,function(c){if(c.name&&!c.disabled&&"submit"!==c.type&&"button"!==c.type&&!c.matches("form fieldset[disabled] *"))if("file"=== c.type){var d=c.files&&c.files.length?c.files:[new File([],"",{type:"application/octet-stream"})];M(d,function(e){b.append(c.name,e)})}else"select-multiple"===c.type||"select-one"===c.type?M(c.options,function(e){!e.disabled&&e.selected&&b.append(c.name,e.value)}):"checkbox"===c.type||"radio"===c.type?c.checked&&b.append(c.name,c.value):(d="textarea"===c.type?N(c.value):c.value,b.append(c.name,d))})};h=X.prototype;h.append=function(a,b,c){P(arguments,2);this.i.push(O(a,b,c))};h.delete=function(a){P(arguments, 1);var b=[];a=String(a);M(this.i,function(c){c[0]!==a&&b.push(c)});this.i=b};h.entries=function b(){var c,d=this;return K(b,function(e){1==e.h&&(c=0);if(3!=e.h)return c<d.i.length?e=E(e,d.i[c]):(e.h=0,e=void 0),e;c++;e.h=2})};h.forEach=function(b,c){P(arguments,1);for(var d=v(this),e=d.next();!e.done;e=d.next()){var f=v(e.value);e=f.next().value;f=f.next().value;b.call(c,f,e,this)}};h.get=function(b){P(arguments,1);var c=this.i;b=String(b);for(var d=0;d<c.length;d++)if(c[d][0]===b)return c[d][1]; return null};h.getAll=function(b){P(arguments,1);var c=[];b=String(b);M(this.i,function(d){d[0]===b&&c.push(d[1])});return c};h.has=function(b){P(arguments,1);b=String(b);for(var c=0;c<this.i.length;c++)if(this.i[c][0]===b)return!0;return!1};h.keys=function c(){var d=this,e,f,g,k,p;return K(c,function(t){1==t.h&&(e=v(d),f=e.next());if(3!=t.h){if(f.done){t.h=0;return}g=f.value;k=v(g);p=k.next().value;return E(t,p)}f=e.next();t.h=2})};h.set=function(c,d,e){P(arguments,2);c=String(c);var f=[],g=O(c, d,e),k=!0;M(this.i,function(p){p[0]===c?k&&(k=!f.push(g)):f.push(p)});k&&f.push(g);this.i=f};h.values=function d(){var e=this,f,g,k,p,t;return K(d,function(x){1==x.h&&(f=v(e),g=f.next());if(3!=x.h){if(g.done){x.h=0;return}k=g.value;p=v(k);p.next();t=p.next().value;return E(x,t)}g=f.next();x.h=2})};X.prototype._asNative=function(){for(var d=new R,e=v(this),f=e.next();!f.done;f=e.next()){var g=v(f.value);f=g.next().value;g=g.next().value;d.append(f,g)}return d};X.prototype._blob=function(){var d="----formdata-polyfill-"+ Math.random(),e=[],f="--"+d+'\r\nContent-Disposition: form-data; name="';this.forEach(function(g,k){return"string"==typeof g?e.push(f+escape(N(k))+('"\r\n\r\n'+N(g)+"\r\n")):e.push(f+escape(N(k))+('"; filename="'+escape(g.name)+'"\r\nContent-Type: '+(g.type||"application/octet-stream")+"\r\n\r\n"),g,"\r\n")});e.push("--"+d+"--");return new Blob(e,{type:"multipart/form-data; boundary="+d})};X.prototype[Symbol.iterator]=function(){return this.entries()};X.prototype.toString=function(){return"[object FormData]"}; V&&!V.matches&&(V.matches=V.matchesSelector||V.mozMatchesSelector||V.msMatchesSelector||V.oMatchesSelector||V.webkitMatchesSelector||function(d){d=(this.document||this.ownerDocument).querySelectorAll(d);for(var e=d.length;0<=--e&&d.item(e)!==this;);return-1<e});W&&(X.prototype[W]="FormData");if(S){var Y=Q.XMLHttpRequest.prototype.setRequestHeader;Q.XMLHttpRequest.prototype.setRequestHeader=function(d,e){Y.call(this,d,e);"content-type"===d.toLowerCase()&&(this.B=!0)};Q.XMLHttpRequest.prototype.send= function(d){d instanceof X?(d=d._blob(),this.B||this.setRequestHeader("Content-Type",d.type),S.call(this,d)):S.call(this,d)}}T&&(Q.fetch=function(d,e){e&&e.body&&e.body instanceof X&&(e.body=e.body._blob());return T.call(this,d,e)});U&&(Q.navigator.sendBeacon=function(d,e){e instanceof X&&(e=e._asNative());return U.call(this,d,e)});Q.FormData=X};})(); vendor/regenerator-runtime.js 0000644 00000061333 15206720414 0012404 0 ustar 00 /** * Copyright (c) 2014-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var runtime = (function (exports) { "use strict"; var Op = Object.prototype; var hasOwn = Op.hasOwnProperty; var defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }; var undefined; // More compressible than void 0. var $Symbol = typeof Symbol === "function" ? Symbol : {}; var iteratorSymbol = $Symbol.iterator || "@@iterator"; var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator"; var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); return obj[key]; } try { // IE 8 has a broken Object.defineProperty that only works on DOM objects. define({}, ""); } catch (err) { define = function(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; var generator = Object.create(protoGenerator.prototype); var context = new Context(tryLocsList || []); // The ._invoke method unifies the implementations of the .next, // .throw, and .return methods. defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }); return generator; } exports.wrap = wrap; // Try/catch helper to minimize deoptimizations. Returns a completion // record like context.tryEntries[i].completion. This interface could // have been (and was previously) designed to take a closure to be // invoked without arguments, but in all the cases we care about we // already have an existing method we want to call, so there's no need // to create a new function object. We can even get away with assuming // the method takes exactly one argument, since that happens to be true // in every case, so we don't have to touch the arguments object. The // only additional allocation required is the completion record, which // has a stable shape and so hopefully should be cheap to allocate. function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } var GenStateSuspendedStart = "suspendedStart"; var GenStateSuspendedYield = "suspendedYield"; var GenStateExecuting = "executing"; var GenStateCompleted = "completed"; // Returning this object from the innerFn has the same effect as // breaking out of the dispatch switch statement. var ContinueSentinel = {}; // Dummy constructor functions that we use as the .constructor and // .constructor.prototype properties for functions that return Generator // objects. For full spec compliance, you may wish to configure your // minifier not to mangle the names of these two functions. function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} // This is a polyfill for %IteratorPrototype% for environments that // don't natively support it. var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf; var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { // This environment has a native %IteratorPrototype%; use it instead // of the polyfill. IteratorPrototype = NativeIteratorPrototype; } var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); GeneratorFunction.prototype = GeneratorFunctionPrototype; defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: true }); defineProperty( GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: true } ); GeneratorFunction.displayName = define( GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction" ); // Helper for defining the .next, .throw, and .return methods of the // Iterator interface in terms of a single ._invoke method. function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function(method) { define(prototype, method, function(arg) { return this._invoke(method, arg); }); }); } exports.isGeneratorFunction = function(genFun) { var ctor = typeof genFun === "function" && genFun.constructor; return ctor ? ctor === GeneratorFunction || // For the native GeneratorFunction constructor, the best we can // do is to check its .name property. (ctor.displayName || ctor.name) === "GeneratorFunction" : false; }; exports.mark = function(genFun) { if (Object.setPrototypeOf) { Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); } else { genFun.__proto__ = GeneratorFunctionPrototype; define(genFun, toStringTagSymbol, "GeneratorFunction"); } genFun.prototype = Object.create(Gp); return genFun; }; // Within the body of any async function, `await x` is transformed to // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test // `hasOwn.call(value, "__await")` to determine if the yielded value is // meant to be awaited. exports.awrap = function(arg) { return { __await: arg }; }; function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if (record.type === "throw") { reject(record.arg); } else { var result = record.arg; var value = result.value; if (value && typeof value === "object" && hasOwn.call(value, "__await")) { return PromiseImpl.resolve(value.__await).then(function(value) { invoke("next", value, resolve, reject); }, function(err) { invoke("throw", err, resolve, reject); }); } return PromiseImpl.resolve(value).then(function(unwrapped) { // When a yielded Promise is resolved, its final value becomes // the .value of the Promise<{value,done}> result for the // current iteration. result.value = unwrapped; resolve(result); }, function(error) { // If a rejected Promise was yielded, throw the rejection back // into the async generator function so it can be handled there. return invoke("throw", error, resolve, reject); }); } } var previousPromise; function enqueue(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function(resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = // If enqueue has been called before, then we want to wait until // all previous Promises have been resolved before calling invoke, // so that results are always delivered in the correct order. If // enqueue has not been called before, then it is important to // call invoke immediately, without waiting on a callback to fire, // so that the async generator function has the opportunity to do // any necessary setup in a predictable way. This predictability // is why the Promise constructor synchronously invokes its // executor callback, and why async functions synchronously // execute code before the first await. Since we implement simple // async functions in terms of async generators, it is especially // important to get this right, even though it requires care. previousPromise ? previousPromise.then( callInvokeWithMethodAndArg, // Avoid propagating failures to Promises returned by later // invocations of the iterator. callInvokeWithMethodAndArg ) : callInvokeWithMethodAndArg(); } // Define the unified helper method that is used to implement .next, // .throw, and .return (see defineIteratorMethods). defineProperty(this, "_invoke", { value: enqueue }); } defineIteratorMethods(AsyncIterator.prototype); define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }); exports.AsyncIterator = AsyncIterator; // Note that simple async functions are implemented on top of // AsyncIterator objects; they just return a Promise for the value of // the final result produced by the iterator. exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) { if (PromiseImpl === void 0) PromiseImpl = Promise; var iter = new AsyncIterator( wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl ); return exports.isGeneratorFunction(outerFn) ? iter // If outerFn is a generator, return the full iterator. : iter.next().then(function(result) { return result.done ? result.value : iter.next(); }); }; function makeInvokeMethod(innerFn, self, context) { var state = GenStateSuspendedStart; return function invoke(method, arg) { if (state === GenStateExecuting) { throw new Error("Generator is already running"); } if (state === GenStateCompleted) { if (method === "throw") { throw arg; } // Be forgiving, per GeneratorResume behavior specified since ES2015: // ES2015 spec, step 3: https://262.ecma-international.org/6.0/#sec-generatorresume // Latest spec, step 2: https://tc39.es/ecma262/#sec-generatorresume return doneResult(); } context.method = method; context.arg = arg; while (true) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if (context.method === "next") { // Setting context._sent for legacy support of Babel's // function.sent implementation. context.sent = context._sent = context.arg; } else if (context.method === "throw") { if (state === GenStateSuspendedStart) { state = GenStateCompleted; throw context.arg; } context.dispatchException(context.arg); } else if (context.method === "return") { context.abrupt("return", context.arg); } state = GenStateExecuting; var record = tryCatch(innerFn, self, context); if (record.type === "normal") { // If an exception is thrown from innerFn, we leave state === // GenStateExecuting and loop back for another invocation. state = context.done ? GenStateCompleted : GenStateSuspendedYield; if (record.arg === ContinueSentinel) { continue; } return { value: record.arg, done: context.done }; } else if (record.type === "throw") { state = GenStateCompleted; // Dispatch the exception by looping back around to the // context.dispatchException(context.arg) call above. context.method = "throw"; context.arg = record.arg; } } }; } // Call delegate.iterator[context.method](context.arg) and handle the // result, either by returning a { value, done } result from the // delegate iterator, or by modifying context.method and context.arg, // setting context.delegate to null, and returning the ContinueSentinel. function maybeInvokeDelegate(delegate, context) { var methodName = context.method; var method = delegate.iterator[methodName]; if (method === undefined) { // A .throw or .return when the delegate iterator has no .throw // method, or a missing .next method, always terminate the // yield* loop. context.delegate = null; // Note: ["return"] must be used for ES3 parsing compatibility. if (methodName === "throw" && delegate.iterator["return"]) { // If the delegate iterator has a return method, give it a // chance to clean up. context.method = "return"; context.arg = undefined; maybeInvokeDelegate(delegate, context); if (context.method === "throw") { // If maybeInvokeDelegate(context) changed context.method from // "return" to "throw", let that override the TypeError below. return ContinueSentinel; } } if (methodName !== "return") { context.method = "throw"; context.arg = new TypeError( "The iterator does not provide a '" + methodName + "' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if (record.type === "throw") { context.method = "throw"; context.arg = record.arg; context.delegate = null; return ContinueSentinel; } var info = record.arg; if (! info) { context.method = "throw"; context.arg = new TypeError("iterator result is not an object"); context.delegate = null; return ContinueSentinel; } if (info.done) { // Assign the result of the finished delegate to the temporary // variable specified by delegate.resultName (see delegateYield). context[delegate.resultName] = info.value; // Resume execution at the desired location (see delegateYield). context.next = delegate.nextLoc; // If context.method was "throw" but the delegate handled the // exception, let the outer generator proceed normally. If // context.method was "next", forget context.arg since it has been // "consumed" by the delegate iterator. If context.method was // "return", allow the original .return call to continue in the // outer generator. if (context.method !== "return") { context.method = "next"; context.arg = undefined; } } else { // Re-yield the result returned by the delegate method. return info; } // The delegate iterator is finished, so forget it and continue with // the outer generator. context.delegate = null; return ContinueSentinel; } // Define Generator.prototype.{next,throw,return} in terms of the // unified ._invoke helper method. defineIteratorMethods(Gp); define(Gp, toStringTagSymbol, "Generator"); // A Generator should always return itself as the iterator object when the // @@iterator function is called on it. Some browsers' implementations of the // iterator prototype chain incorrectly implement this, causing the Generator // object to not be returned from this call. This ensures that doesn't happen. // See https://github.com/facebook/regenerator/issues/274 for more details. define(Gp, iteratorSymbol, function() { return this; }); define(Gp, "toString", function() { return "[object Generator]"; }); function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; if (1 in locs) { entry.catchLoc = locs[1]; } if (2 in locs) { entry.finallyLoc = locs[2]; entry.afterLoc = locs[3]; } this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal"; delete record.arg; entry.completion = record; } function Context(tryLocsList) { // The root entry object (effectively a try statement without a catch // or a finally block) gives us a place to store values thrown from // locations where there is no enclosing try statement. this.tryEntries = [{ tryLoc: "root" }]; tryLocsList.forEach(pushTryEntry, this); this.reset(true); } exports.keys = function(val) { var object = Object(val); var keys = []; for (var key in object) { keys.push(key); } keys.reverse(); // Rather than returning an object with a next method, we keep // things simple and return the next function itself. return function next() { while (keys.length) { var key = keys.pop(); if (key in object) { next.value = key; next.done = false; return next; } } // To avoid creating an additional object, we just hang the .value // and .done properties off the next function object itself. This // also ensures that the minifier will not anonymize the function. next.done = true; return next; }; }; function values(iterable) { if (iterable != null) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) { return iteratorMethod.call(iterable); } if (typeof iterable.next === "function") { return iterable; } if (!isNaN(iterable.length)) { var i = -1, next = function next() { while (++i < iterable.length) { if (hasOwn.call(iterable, i)) { next.value = iterable[i]; next.done = false; return next; } } next.value = undefined; next.done = true; return next; }; return next.next = next; } } throw new TypeError(typeof iterable + " is not iterable"); } exports.values = values; function doneResult() { return { value: undefined, done: true }; } Context.prototype = { constructor: Context, reset: function(skipTempReset) { this.prev = 0; this.next = 0; // Resetting context._sent for legacy support of Babel's // function.sent implementation. this.sent = this._sent = undefined; this.done = false; this.delegate = null; this.method = "next"; this.arg = undefined; this.tryEntries.forEach(resetTryEntry); if (!skipTempReset) { for (var name in this) { // Not sure about the optimal order of these conditions: if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) { this[name] = undefined; } } } }, stop: function() { this.done = true; var rootEntry = this.tryEntries[0]; var rootRecord = rootEntry.completion; if (rootRecord.type === "throw") { throw rootRecord.arg; } return this.rval; }, dispatchException: function(exception) { if (this.done) { throw exception; } var context = this; function handle(loc, caught) { record.type = "throw"; record.arg = exception; context.next = loc; if (caught) { // If the dispatched exception was caught by a catch block, // then let that catch block handle the exception normally. context.method = "next"; context.arg = undefined; } return !! caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; var record = entry.completion; if (entry.tryLoc === "root") { // Exception thrown outside of any try block that could handle // it, so set the completion value of the entire function to // throw the exception. return handle("end"); } if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"); var hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) { return handle(entry.catchLoc, true); } else if (this.prev < entry.finallyLoc) { return handle(entry.finallyLoc); } } else if (hasCatch) { if (this.prev < entry.catchLoc) { return handle(entry.catchLoc, true); } } else if (hasFinally) { if (this.prev < entry.finallyLoc) { return handle(entry.finallyLoc); } } else { throw new Error("try statement without catch or finally"); } } } }, abrupt: function(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) { // Ignore the finally entry if control is not jumping to a // location outside the try/catch block. finallyEntry = null; } var record = finallyEntry ? finallyEntry.completion : {}; record.type = type; record.arg = arg; if (finallyEntry) { this.method = "next"; this.next = finallyEntry.finallyLoc; return ContinueSentinel; } return this.complete(record); }, complete: function(record, afterLoc) { if (record.type === "throw") { throw record.arg; } if (record.type === "break" || record.type === "continue") { this.next = record.arg; } else if (record.type === "return") { this.rval = this.arg = record.arg; this.method = "return"; this.next = "end"; } else if (record.type === "normal" && afterLoc) { this.next = afterLoc; } return ContinueSentinel; }, finish: function(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) { this.complete(entry.completion, entry.afterLoc); resetTryEntry(entry); return ContinueSentinel; } } }, "catch": function(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if (record.type === "throw") { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } // The context.catch method must only be called with a location // argument that corresponds to a known catch block. throw new Error("illegal catch attempt"); }, delegateYield: function(iterable, resultName, nextLoc) { this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }; if (this.method === "next") { // Deliberately forget the last sent value so that we don't // accidentally pass it on to the delegate. this.arg = undefined; } return ContinueSentinel; } }; // Regardless of whether this script is executing as a CommonJS module // or not, return the runtime object so that we can declare the variable // regeneratorRuntime in the outer scope, which allows this module to be // injected easily by `bin/regenerator --include-runtime script.js`. return exports; }( // If this script is executing as a CommonJS module, use module.exports // as the regeneratorRuntime namespace. Otherwise create a new empty // object. Either way, the resulting object will be used to initialize // the regeneratorRuntime variable at the top of this file. typeof module === "object" ? module.exports : {} )); try { regeneratorRuntime = runtime; } catch (accidentalStrictMode) { // This module should not be running in strict mode, so the above // assignment should always work unless something is misconfigured. Just // in case runtime.js accidentally runs in strict mode, in modern engines // we can explicitly access globalThis. In older engines we can escape // strict mode using a global Function call. This could conceivably fail // if a Content Security Policy forbids using Function, but in that case // the proper solution is to fix the accidental strict mode problem. If // you've misconfigured your bundler to force strict mode and applied a // CSP to forbid Function, and you're not willing to fix either of those // problems, please detail your unique predicament in a GitHub issue. if (typeof globalThis === "object") { globalThis.regeneratorRuntime = runtime; } else { Function("r", "regeneratorRuntime = r")(runtime); } } vendor/wp-polyfill-node-contains.min.js 0000644 00000000541 15206720414 0014177 0 ustar 00 !function(){function e(e){if(!(0 in arguments))throw new TypeError("1 argument is required");do{if(this===e)return!0}while(e=e&&e.parentNode);return!1}if("HTMLElement"in self&&"contains"in HTMLElement.prototype)try{delete HTMLElement.prototype.contains}catch(e){}"Node"in self?Node.prototype.contains=e:document.contains=Element.prototype.contains=e}(); vendor/wp-polyfill-object-fit.js 0000644 00000021741 15206720414 0012707 0 ustar 00 /*---------------------------------------- * objectFitPolyfill 2.3.5 * * Made by Constance Chen * Released under the ISC license * * https://github.com/constancecchen/object-fit-polyfill *--------------------------------------*/ (function() { 'use strict'; // if the page is being rendered on the server, don't continue if (typeof window === 'undefined') return; // Workaround for Edge 16-18, which only implemented object-fit for <img> tags var edgeMatch = window.navigator.userAgent.match(/Edge\/(\d{2})\./); var edgeVersion = edgeMatch ? parseInt(edgeMatch[1], 10) : null; var edgePartialSupport = edgeVersion ? edgeVersion >= 16 && edgeVersion <= 18 : false; // If the browser does support object-fit, we don't need to continue var hasSupport = 'objectFit' in document.documentElement.style !== false; if (hasSupport && !edgePartialSupport) { window.objectFitPolyfill = function() { return false; }; return; } /** * Check the container's parent element to make sure it will * correctly handle and clip absolutely positioned children * * @param {node} $container - parent element */ var checkParentContainer = function($container) { var styles = window.getComputedStyle($container, null); var position = styles.getPropertyValue('position'); var overflow = styles.getPropertyValue('overflow'); var display = styles.getPropertyValue('display'); if (!position || position === 'static') { $container.style.position = 'relative'; } if (overflow !== 'hidden') { $container.style.overflow = 'hidden'; } // Guesstimating that people want the parent to act like full width/height wrapper here. // Mostly attempts to target <picture> elements, which default to inline. if (!display || display === 'inline') { $container.style.display = 'block'; } if ($container.clientHeight === 0) { $container.style.height = '100%'; } // Add a CSS class hook, in case people need to override styles for any reason. if ($container.className.indexOf('object-fit-polyfill') === -1) { $container.className = $container.className + ' object-fit-polyfill'; } }; /** * Check for pre-set max-width/height, min-width/height, * positioning, or margins, which can mess up image calculations * * @param {node} $media - img/video element */ var checkMediaProperties = function($media) { var styles = window.getComputedStyle($media, null); var constraints = { 'max-width': 'none', 'max-height': 'none', 'min-width': '0px', 'min-height': '0px', top: 'auto', right: 'auto', bottom: 'auto', left: 'auto', 'margin-top': '0px', 'margin-right': '0px', 'margin-bottom': '0px', 'margin-left': '0px', }; for (var property in constraints) { var constraint = styles.getPropertyValue(property); if (constraint !== constraints[property]) { $media.style[property] = constraints[property]; } } }; /** * Calculate & set object-position * * @param {string} axis - either "x" or "y" * @param {node} $media - img or video element * @param {string} objectPosition - e.g. "50% 50%", "top left" */ var setPosition = function(axis, $media, objectPosition) { var position, other, start, end, side; objectPosition = objectPosition.split(' '); if (objectPosition.length < 2) { objectPosition[1] = objectPosition[0]; } /* istanbul ignore else */ if (axis === 'x') { position = objectPosition[0]; other = objectPosition[1]; start = 'left'; end = 'right'; side = $media.clientWidth; } else if (axis === 'y') { position = objectPosition[1]; other = objectPosition[0]; start = 'top'; end = 'bottom'; side = $media.clientHeight; } else { return; // Neither x or y axis specified } if (position === start || other === start) { $media.style[start] = '0'; return; } if (position === end || other === end) { $media.style[end] = '0'; return; } if (position === 'center' || position === '50%') { $media.style[start] = '50%'; $media.style['margin-' + start] = side / -2 + 'px'; return; } // Percentage values (e.g., 30% 10%) if (position.indexOf('%') >= 0) { position = parseInt(position, 10); if (position < 50) { $media.style[start] = position + '%'; $media.style['margin-' + start] = side * (position / -100) + 'px'; } else { position = 100 - position; $media.style[end] = position + '%'; $media.style['margin-' + end] = side * (position / -100) + 'px'; } return; } // Length-based values (e.g. 10px / 10em) else { $media.style[start] = position; } }; /** * Calculate & set object-fit * * @param {node} $media - img/video/picture element */ var objectFit = function($media) { // IE 10- data polyfill var fit = $media.dataset ? $media.dataset.objectFit : $media.getAttribute('data-object-fit'); var position = $media.dataset ? $media.dataset.objectPosition : $media.getAttribute('data-object-position'); // Default fallbacks fit = fit || 'cover'; position = position || '50% 50%'; // If necessary, make the parent container work with absolutely positioned elements var $container = $media.parentNode; checkParentContainer($container); // Check for any pre-set CSS which could mess up image calculations checkMediaProperties($media); // Reset any pre-set width/height CSS and handle fit positioning $media.style.position = 'absolute'; $media.style.width = 'auto'; $media.style.height = 'auto'; // `scale-down` chooses either `none` or `contain`, whichever is smaller if (fit === 'scale-down') { if ( $media.clientWidth < $container.clientWidth && $media.clientHeight < $container.clientHeight ) { fit = 'none'; } else { fit = 'contain'; } } // `none` (width/height auto) and `fill` (100%) and are straightforward if (fit === 'none') { setPosition('x', $media, position); setPosition('y', $media, position); return; } if (fit === 'fill') { $media.style.width = '100%'; $media.style.height = '100%'; setPosition('x', $media, position); setPosition('y', $media, position); return; } // `cover` and `contain` must figure out which side needs covering, and add CSS positioning & centering $media.style.height = '100%'; if ( (fit === 'cover' && $media.clientWidth > $container.clientWidth) || (fit === 'contain' && $media.clientWidth < $container.clientWidth) ) { $media.style.top = '0'; $media.style.marginTop = '0'; setPosition('x', $media, position); } else { $media.style.width = '100%'; $media.style.height = 'auto'; $media.style.left = '0'; $media.style.marginLeft = '0'; setPosition('y', $media, position); } }; /** * Initialize plugin * * @param {node} media - Optional specific DOM node(s) to be polyfilled */ var objectFitPolyfill = function(media) { if (typeof media === 'undefined' || media instanceof Event) { // If left blank, or a default event, all media on the page will be polyfilled. media = document.querySelectorAll('[data-object-fit]'); } else if (media && media.nodeName) { // If it's a single node, wrap it in an array so it works. media = [media]; } else if (typeof media === 'object' && media.length && media[0].nodeName) { // If it's an array of DOM nodes (e.g. a jQuery selector), it's fine as-is. media = media; } else { // Otherwise, if it's invalid or an incorrect type, return false to let people know. return false; } for (var i = 0; i < media.length; i++) { if (!media[i].nodeName) continue; var mediaType = media[i].nodeName.toLowerCase(); if (mediaType === 'img') { if (edgePartialSupport) continue; // Edge supports object-fit for images (but nothing else), so no need to polyfill if (media[i].complete) { objectFit(media[i]); } else { media[i].addEventListener('load', function() { objectFit(this); }); } } else if (mediaType === 'video') { if (media[i].readyState > 0) { objectFit(media[i]); } else { media[i].addEventListener('loadedmetadata', function() { objectFit(this); }); } } else { objectFit(media[i]); } } return true; }; if (document.readyState === 'loading') { // Loading hasn't finished yet document.addEventListener('DOMContentLoaded', objectFitPolyfill); } else { // `DOMContentLoaded` has already fired objectFitPolyfill(); } window.addEventListener('resize', objectFitPolyfill); window.objectFitPolyfill = objectFitPolyfill; })(); vendor/react-jsx-runtime.min.js 0000644 00000002161 15206720414 0012543 0 ustar 00 "use strict";var ReactJSXRuntime=(()=>{var l=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var u=l((R,p)=>{p.exports=globalThis.React});var c=l(s=>{"use strict";var d=u(),m=Symbol.for("react.element"),O=Symbol.for("react.fragment"),v=Object.prototype.hasOwnProperty,E=d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function _(t,e,f){var r,o={},n=null,i=null;f!==void 0&&(n=""+f),e.key!==void 0&&(n=""+e.key),e.ref!==void 0&&(i=e.ref);for(r in e)v.call(e,r)&&!a.hasOwnProperty(r)&&(o[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps,e)o[r]===void 0&&(o[r]=e[r]);return{$$typeof:m,type:t,key:n,ref:i,props:o,_owner:E.current}}s.Fragment=O;s.jsx=_;s.jsxs=_});var j=l((k,y)=>{y.exports=c()});return j();})(); /*! Bundled license information: react/cjs/react-jsx-runtime.production.min.js: (** * @license React * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. *) */ vendor/moment.min.js 0000644 00000162674 15206720414 0010501 0 ustar 00 !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.moment=t()}(this,function(){"use strict";var H;function _(){return H.apply(null,arguments)}function y(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function F(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function c(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function L(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;for(var t in e)if(c(e,t))return;return 1}function g(e){return void 0===e}function w(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function V(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function G(e,t){for(var n=[],s=e.length,i=0;i<s;++i)n.push(t(e[i],i));return n}function E(e,t){for(var n in t)c(t,n)&&(e[n]=t[n]);return c(t,"toString")&&(e.toString=t.toString),c(t,"valueOf")&&(e.valueOf=t.valueOf),e}function l(e,t,n,s){return Wt(e,t,n,s,!0).utc()}function p(e){return null==e._pf&&(e._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}),e._pf}function A(e){var t,n,s=e._d&&!isNaN(e._d.getTime());return s&&(t=p(e),n=j.call(t.parsedDateParts,function(e){return null!=e}),s=t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||(t.meridiem,n)),e._strict)&&(s=s&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null!=Object.isFrozen&&Object.isFrozen(e)?s:(e._isValid=s,e._isValid)}function I(e){var t=l(NaN);return null!=e?E(p(t),e):p(t).userInvalidated=!0,t}var j=Array.prototype.some||function(e){for(var t=Object(this),n=t.length>>>0,s=0;s<n;s++)if(s in t&&e.call(this,t[s],s,t))return!0;return!1},Z=_.momentProperties=[],z=!1;function q(e,t){var n,s,i,r=Z.length;if(g(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),g(t._i)||(e._i=t._i),g(t._f)||(e._f=t._f),g(t._l)||(e._l=t._l),g(t._strict)||(e._strict=t._strict),g(t._tzm)||(e._tzm=t._tzm),g(t._isUTC)||(e._isUTC=t._isUTC),g(t._offset)||(e._offset=t._offset),g(t._pf)||(e._pf=p(t)),g(t._locale)||(e._locale=t._locale),0<r)for(n=0;n<r;n++)g(i=t[s=Z[n]])||(e[s]=i);return e}function $(e){q(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===z&&(z=!0,_.updateOffset(this),z=!1)}function k(e){return e instanceof $||null!=e&&null!=e._isAMomentObject}function B(e){!1===_.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function e(r,a){var o=!0;return E(function(){if(null!=_.deprecationHandler&&_.deprecationHandler(null,r),o){for(var e,t,n=[],s=arguments.length,i=0;i<s;i++){if(e="","object"==typeof arguments[i]){for(t in e+="\n["+i+"] ",arguments[0])c(arguments[0],t)&&(e+=t+": "+arguments[0][t]+", ");e=e.slice(0,-2)}else e=arguments[i];n.push(e)}B(r+"\nArguments: "+Array.prototype.slice.call(n).join("")+"\n"+(new Error).stack),o=!1}return a.apply(this,arguments)},a)}var J={};function Q(e,t){null!=_.deprecationHandler&&_.deprecationHandler(e,t),J[e]||(B(t),J[e]=!0)}function a(e){return"undefined"!=typeof Function&&e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function X(e,t){var n,s=E({},e);for(n in t)c(t,n)&&(F(e[n])&&F(t[n])?(s[n]={},E(s[n],e[n]),E(s[n],t[n])):null!=t[n]?s[n]=t[n]:delete s[n]);for(n in e)c(e,n)&&!c(t,n)&&F(e[n])&&(s[n]=E({},s[n]));return s}function K(e){null!=e&&this.set(e)}_.suppressDeprecationWarnings=!1,_.deprecationHandler=null;var ee=Object.keys||function(e){var t,n=[];for(t in e)c(e,t)&&n.push(t);return n};function r(e,t,n){var s=""+Math.abs(e);return(0<=e?n?"+":"":"-")+Math.pow(10,Math.max(0,t-s.length)).toString().substr(1)+s}var te=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,ne=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,se={},ie={};function s(e,t,n,s){var i="string"==typeof s?function(){return this[s]()}:s;e&&(ie[e]=i),t&&(ie[t[0]]=function(){return r(i.apply(this,arguments),t[1],t[2])}),n&&(ie[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function re(e,t){return e.isValid()?(t=ae(t,e.localeData()),se[t]=se[t]||function(s){for(var e,i=s.match(te),t=0,r=i.length;t<r;t++)ie[i[t]]?i[t]=ie[i[t]]:i[t]=(e=i[t]).match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"");return function(e){for(var t="",n=0;n<r;n++)t+=a(i[n])?i[n].call(e,s):i[n];return t}}(t),se[t](e)):e.localeData().invalidDate()}function ae(e,t){var n=5;function s(e){return t.longDateFormat(e)||e}for(ne.lastIndex=0;0<=n&&ne.test(e);)e=e.replace(ne,s),ne.lastIndex=0,--n;return e}var oe={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function o(e){return"string"==typeof e?oe[e]||oe[e.toLowerCase()]:void 0}function ue(e){var t,n,s={};for(n in e)c(e,n)&&(t=o(n))&&(s[t]=e[n]);return s}var le={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};var de=/\d/,t=/\d\d/,he=/\d{3}/,ce=/\d{4}/,fe=/[+-]?\d{6}/,n=/\d\d?/,me=/\d\d\d\d?/,_e=/\d\d\d\d\d\d?/,ye=/\d{1,3}/,ge=/\d{1,4}/,we=/[+-]?\d{1,6}/,pe=/\d+/,ke=/[+-]?\d+/,Me=/Z|[+-]\d\d:?\d\d/gi,ve=/Z|[+-]\d\d(?::?\d\d)?/gi,i=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,u=/^[1-9]\d?/,d=/^([1-9]\d|\d)/;function h(e,n,s){Ye[e]=a(n)?n:function(e,t){return e&&s?s:n}}function De(e,t){return c(Ye,e)?Ye[e](t._strict,t._locale):new RegExp(f(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,s,i){return t||n||s||i})))}function f(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function m(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function M(e){var e=+e,t=0;return t=0!=e&&isFinite(e)?m(e):t}var Ye={},Se={};function v(e,n){var t,s,i=n;for("string"==typeof e&&(e=[e]),w(n)&&(i=function(e,t){t[n]=M(e)}),s=e.length,t=0;t<s;t++)Se[e[t]]=i}function Oe(e,i){v(e,function(e,t,n,s){n._w=n._w||{},i(e,n._w,n,s)})}function be(e){return e%4==0&&e%100!=0||e%400==0}var D=0,Y=1,S=2,O=3,b=4,T=5,Te=6,xe=7,Ne=8;function We(e){return be(e)?366:365}s("Y",0,0,function(){var e=this.year();return e<=9999?r(e,4):"+"+e}),s(0,["YY",2],0,function(){return this.year()%100}),s(0,["YYYY",4],0,"year"),s(0,["YYYYY",5],0,"year"),s(0,["YYYYYY",6,!0],0,"year"),h("Y",ke),h("YY",n,t),h("YYYY",ge,ce),h("YYYYY",we,fe),h("YYYYYY",we,fe),v(["YYYYY","YYYYYY"],D),v("YYYY",function(e,t){t[D]=2===e.length?_.parseTwoDigitYear(e):M(e)}),v("YY",function(e,t){t[D]=_.parseTwoDigitYear(e)}),v("Y",function(e,t){t[D]=parseInt(e,10)}),_.parseTwoDigitYear=function(e){return M(e)+(68<M(e)?1900:2e3)};var x,Pe=Re("FullYear",!0);function Re(t,n){return function(e){return null!=e?(Ue(this,t,e),_.updateOffset(this,n),this):Ce(this,t)}}function Ce(e,t){if(!e.isValid())return NaN;var n=e._d,s=e._isUTC;switch(t){case"Milliseconds":return s?n.getUTCMilliseconds():n.getMilliseconds();case"Seconds":return s?n.getUTCSeconds():n.getSeconds();case"Minutes":return s?n.getUTCMinutes():n.getMinutes();case"Hours":return s?n.getUTCHours():n.getHours();case"Date":return s?n.getUTCDate():n.getDate();case"Day":return s?n.getUTCDay():n.getDay();case"Month":return s?n.getUTCMonth():n.getMonth();case"FullYear":return s?n.getUTCFullYear():n.getFullYear();default:return NaN}}function Ue(e,t,n){var s,i,r;if(e.isValid()&&!isNaN(n)){switch(s=e._d,i=e._isUTC,t){case"Milliseconds":return i?s.setUTCMilliseconds(n):s.setMilliseconds(n);case"Seconds":return i?s.setUTCSeconds(n):s.setSeconds(n);case"Minutes":return i?s.setUTCMinutes(n):s.setMinutes(n);case"Hours":return i?s.setUTCHours(n):s.setHours(n);case"Date":return i?s.setUTCDate(n):s.setDate(n);case"FullYear":break;default:return}t=n,r=e.month(),e=29!==(e=e.date())||1!==r||be(t)?e:28,i?s.setUTCFullYear(t,r,e):s.setFullYear(t,r,e)}}function He(e,t){var n;return isNaN(e)||isNaN(t)?NaN:(n=(t%(n=12)+n)%n,e+=(t-n)/12,1==n?be(e)?29:28:31-n%7%2)}x=Array.prototype.indexOf||function(e){for(var t=0;t<this.length;++t)if(this[t]===e)return t;return-1},s("M",["MM",2],"Mo",function(){return this.month()+1}),s("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),s("MMMM",0,0,function(e){return this.localeData().months(this,e)}),h("M",n,u),h("MM",n,t),h("MMM",function(e,t){return t.monthsShortRegex(e)}),h("MMMM",function(e,t){return t.monthsRegex(e)}),v(["M","MM"],function(e,t){t[Y]=M(e)-1}),v(["MMM","MMMM"],function(e,t,n,s){s=n._locale.monthsParse(e,s,n._strict);null!=s?t[Y]=s:p(n).invalidMonth=e});var Fe="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Le="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Ve=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Ge=i,Ee=i;function Ae(e,t){if(e.isValid()){if("string"==typeof t)if(/^\d+$/.test(t))t=M(t);else if(!w(t=e.localeData().monthsParse(t)))return;var n=(n=e.date())<29?n:Math.min(n,He(e.year(),t));e._isUTC?e._d.setUTCMonth(t,n):e._d.setMonth(t,n)}}function Ie(e){return null!=e?(Ae(this,e),_.updateOffset(this,!0),this):Ce(this,"Month")}function je(){function e(e,t){return t.length-e.length}for(var t,n,s=[],i=[],r=[],a=0;a<12;a++)n=l([2e3,a]),t=f(this.monthsShort(n,"")),n=f(this.months(n,"")),s.push(t),i.push(n),r.push(n),r.push(t);s.sort(e),i.sort(e),r.sort(e),this._monthsRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+i.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+s.join("|")+")","i")}function Ze(e,t,n,s,i,r,a){var o;return e<100&&0<=e?(o=new Date(e+400,t,n,s,i,r,a),isFinite(o.getFullYear())&&o.setFullYear(e)):o=new Date(e,t,n,s,i,r,a),o}function ze(e){var t;return e<100&&0<=e?((t=Array.prototype.slice.call(arguments))[0]=e+400,t=new Date(Date.UTC.apply(null,t)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function qe(e,t,n){n=7+t-n;return n-(7+ze(e,0,n).getUTCDay()-t)%7-1}function $e(e,t,n,s,i){var r,t=1+7*(t-1)+(7+n-s)%7+qe(e,s,i),n=t<=0?We(r=e-1)+t:t>We(e)?(r=e+1,t-We(e)):(r=e,t);return{year:r,dayOfYear:n}}function Be(e,t,n){var s,i,r=qe(e.year(),t,n),r=Math.floor((e.dayOfYear()-r-1)/7)+1;return r<1?s=r+N(i=e.year()-1,t,n):r>N(e.year(),t,n)?(s=r-N(e.year(),t,n),i=e.year()+1):(i=e.year(),s=r),{week:s,year:i}}function N(e,t,n){var s=qe(e,t,n),t=qe(e+1,t,n);return(We(e)-s+t)/7}s("w",["ww",2],"wo","week"),s("W",["WW",2],"Wo","isoWeek"),h("w",n,u),h("ww",n,t),h("W",n,u),h("WW",n,t),Oe(["w","ww","W","WW"],function(e,t,n,s){t[s.substr(0,1)]=M(e)});function Je(e,t){return e.slice(t,7).concat(e.slice(0,t))}s("d",0,"do","day"),s("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),s("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),s("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),s("e",0,0,"weekday"),s("E",0,0,"isoWeekday"),h("d",n),h("e",n),h("E",n),h("dd",function(e,t){return t.weekdaysMinRegex(e)}),h("ddd",function(e,t){return t.weekdaysShortRegex(e)}),h("dddd",function(e,t){return t.weekdaysRegex(e)}),Oe(["dd","ddd","dddd"],function(e,t,n,s){s=n._locale.weekdaysParse(e,s,n._strict);null!=s?t.d=s:p(n).invalidWeekday=e}),Oe(["d","e","E"],function(e,t,n,s){t[s]=M(e)});var Qe="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Xe="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Ke="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),et=i,tt=i,nt=i;function st(){function e(e,t){return t.length-e.length}for(var t,n,s,i=[],r=[],a=[],o=[],u=0;u<7;u++)s=l([2e3,1]).day(u),t=f(this.weekdaysMin(s,"")),n=f(this.weekdaysShort(s,"")),s=f(this.weekdays(s,"")),i.push(t),r.push(n),a.push(s),o.push(t),o.push(n),o.push(s);i.sort(e),r.sort(e),a.sort(e),o.sort(e),this._weekdaysRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+i.join("|")+")","i")}function it(){return this.hours()%12||12}function rt(e,t){s(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function at(e,t){return t._meridiemParse}s("H",["HH",2],0,"hour"),s("h",["hh",2],0,it),s("k",["kk",2],0,function(){return this.hours()||24}),s("hmm",0,0,function(){return""+it.apply(this)+r(this.minutes(),2)}),s("hmmss",0,0,function(){return""+it.apply(this)+r(this.minutes(),2)+r(this.seconds(),2)}),s("Hmm",0,0,function(){return""+this.hours()+r(this.minutes(),2)}),s("Hmmss",0,0,function(){return""+this.hours()+r(this.minutes(),2)+r(this.seconds(),2)}),rt("a",!0),rt("A",!1),h("a",at),h("A",at),h("H",n,d),h("h",n,u),h("k",n,u),h("HH",n,t),h("hh",n,t),h("kk",n,t),h("hmm",me),h("hmmss",_e),h("Hmm",me),h("Hmmss",_e),v(["H","HH"],O),v(["k","kk"],function(e,t,n){e=M(e);t[O]=24===e?0:e}),v(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),v(["h","hh"],function(e,t,n){t[O]=M(e),p(n).bigHour=!0}),v("hmm",function(e,t,n){var s=e.length-2;t[O]=M(e.substr(0,s)),t[b]=M(e.substr(s)),p(n).bigHour=!0}),v("hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[O]=M(e.substr(0,s)),t[b]=M(e.substr(s,2)),t[T]=M(e.substr(i)),p(n).bigHour=!0}),v("Hmm",function(e,t,n){var s=e.length-2;t[O]=M(e.substr(0,s)),t[b]=M(e.substr(s))}),v("Hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[O]=M(e.substr(0,s)),t[b]=M(e.substr(s,2)),t[T]=M(e.substr(i))});i=Re("Hours",!0);var ot,ut={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:Fe,monthsShort:Le,week:{dow:0,doy:6},weekdays:Qe,weekdaysMin:Ke,weekdaysShort:Xe,meridiemParse:/[ap]\.?m?\.?/i},W={},lt={};function dt(e){return e&&e.toLowerCase().replace("_","-")}function ht(e){for(var t,n,s,i,r=0;r<e.length;){for(t=(i=dt(e[r]).split("-")).length,n=(n=dt(e[r+1]))?n.split("-"):null;0<t;){if(s=ct(i.slice(0,t).join("-")))return s;if(n&&n.length>=t&&function(e,t){for(var n=Math.min(e.length,t.length),s=0;s<n;s+=1)if(e[s]!==t[s])return s;return n}(i,n)>=t-1)break;t--}r++}return ot}function ct(t){var e,n;if(void 0===W[t]&&"undefined"!=typeof module&&module&&module.exports&&(n=t)&&n.match("^[^/\\\\]*$"))try{e=ot._abbr,require("./locale/"+t),ft(e)}catch(e){W[t]=null}return W[t]}function ft(e,t){return e&&((t=g(t)?P(e):mt(e,t))?ot=t:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),ot._abbr}function mt(e,t){if(null===t)return delete W[e],null;var n,s=ut;if(t.abbr=e,null!=W[e])Q("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),s=W[e]._config;else if(null!=t.parentLocale)if(null!=W[t.parentLocale])s=W[t.parentLocale]._config;else{if(null==(n=ct(t.parentLocale)))return lt[t.parentLocale]||(lt[t.parentLocale]=[]),lt[t.parentLocale].push({name:e,config:t}),null;s=n._config}return W[e]=new K(X(s,t)),lt[e]&<[e].forEach(function(e){mt(e.name,e.config)}),ft(e),W[e]}function P(e){var t;if(!(e=e&&e._locale&&e._locale._abbr?e._locale._abbr:e))return ot;if(!y(e)){if(t=ct(e))return t;e=[e]}return ht(e)}function _t(e){var t=e._a;return t&&-2===p(e).overflow&&(t=t[Y]<0||11<t[Y]?Y:t[S]<1||t[S]>He(t[D],t[Y])?S:t[O]<0||24<t[O]||24===t[O]&&(0!==t[b]||0!==t[T]||0!==t[Te])?O:t[b]<0||59<t[b]?b:t[T]<0||59<t[T]?T:t[Te]<0||999<t[Te]?Te:-1,p(e)._overflowDayOfYear&&(t<D||S<t)&&(t=S),p(e)._overflowWeeks&&-1===t&&(t=xe),p(e)._overflowWeekday&&-1===t&&(t=Ne),p(e).overflow=t),e}var yt=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,gt=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,wt=/Z|[+-]\d\d(?::?\d\d)?/,pt=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],kt=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Mt=/^\/?Date\((-?\d+)/i,vt=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Dt={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Yt(e){var t,n,s,i,r,a,o=e._i,u=yt.exec(o)||gt.exec(o),o=pt.length,l=kt.length;if(u){for(p(e).iso=!0,t=0,n=o;t<n;t++)if(pt[t][1].exec(u[1])){i=pt[t][0],s=!1!==pt[t][2];break}if(null==i)e._isValid=!1;else{if(u[3]){for(t=0,n=l;t<n;t++)if(kt[t][1].exec(u[3])){r=(u[2]||" ")+kt[t][0];break}if(null==r)return void(e._isValid=!1)}if(s||null==r){if(u[4]){if(!wt.exec(u[4]))return void(e._isValid=!1);a="Z"}e._f=i+(r||"")+(a||""),xt(e)}else e._isValid=!1}}else e._isValid=!1}function St(e,t,n,s,i,r){e=[function(e){e=parseInt(e,10);{if(e<=49)return 2e3+e;if(e<=999)return 1900+e}return e}(e),Le.indexOf(t),parseInt(n,10),parseInt(s,10),parseInt(i,10)];return r&&e.push(parseInt(r,10)),e}function Ot(e){var t,n,s=vt.exec(e._i.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,""));s?(t=St(s[4],s[3],s[2],s[5],s[6],s[7]),function(e,t,n){if(!e||Xe.indexOf(e)===new Date(t[0],t[1],t[2]).getDay())return 1;p(n).weekdayMismatch=!0,n._isValid=!1}(s[1],t,e)&&(e._a=t,e._tzm=(t=s[8],n=s[9],s=s[10],t?Dt[t]:n?0:60*(((t=parseInt(s,10))-(n=t%100))/100)+n),e._d=ze.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),p(e).rfc2822=!0)):e._isValid=!1}function bt(e,t,n){return null!=e?e:null!=t?t:n}function Tt(e){var t,n,s,i,r,a,o,u,l,d,h,c=[];if(!e._d){for(s=e,i=new Date(_.now()),n=s._useUTC?[i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()]:[i.getFullYear(),i.getMonth(),i.getDate()],e._w&&null==e._a[S]&&null==e._a[Y]&&(null!=(i=(s=e)._w).GG||null!=i.W||null!=i.E?(u=1,l=4,r=bt(i.GG,s._a[D],Be(R(),1,4).year),a=bt(i.W,1),((o=bt(i.E,1))<1||7<o)&&(d=!0)):(u=s._locale._week.dow,l=s._locale._week.doy,h=Be(R(),u,l),r=bt(i.gg,s._a[D],h.year),a=bt(i.w,h.week),null!=i.d?((o=i.d)<0||6<o)&&(d=!0):null!=i.e?(o=i.e+u,(i.e<0||6<i.e)&&(d=!0)):o=u),a<1||a>N(r,u,l)?p(s)._overflowWeeks=!0:null!=d?p(s)._overflowWeekday=!0:(h=$e(r,a,o,u,l),s._a[D]=h.year,s._dayOfYear=h.dayOfYear)),null!=e._dayOfYear&&(i=bt(e._a[D],n[D]),(e._dayOfYear>We(i)||0===e._dayOfYear)&&(p(e)._overflowDayOfYear=!0),d=ze(i,0,e._dayOfYear),e._a[Y]=d.getUTCMonth(),e._a[S]=d.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=c[t]=n[t];for(;t<7;t++)e._a[t]=c[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[O]&&0===e._a[b]&&0===e._a[T]&&0===e._a[Te]&&(e._nextDay=!0,e._a[O]=0),e._d=(e._useUTC?ze:Ze).apply(null,c),r=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[O]=24),e._w&&void 0!==e._w.d&&e._w.d!==r&&(p(e).weekdayMismatch=!0)}}function xt(e){if(e._f===_.ISO_8601)Yt(e);else if(e._f===_.RFC_2822)Ot(e);else{e._a=[],p(e).empty=!0;for(var t,n,s,i,r,a=""+e._i,o=a.length,u=0,l=ae(e._f,e._locale).match(te)||[],d=l.length,h=0;h<d;h++)n=l[h],(t=(a.match(De(n,e))||[])[0])&&(0<(s=a.substr(0,a.indexOf(t))).length&&p(e).unusedInput.push(s),a=a.slice(a.indexOf(t)+t.length),u+=t.length),ie[n]?(t?p(e).empty=!1:p(e).unusedTokens.push(n),s=n,r=e,null!=(i=t)&&c(Se,s)&&Se[s](i,r._a,r,s)):e._strict&&!t&&p(e).unusedTokens.push(n);p(e).charsLeftOver=o-u,0<a.length&&p(e).unusedInput.push(a),e._a[O]<=12&&!0===p(e).bigHour&&0<e._a[O]&&(p(e).bigHour=void 0),p(e).parsedDateParts=e._a.slice(0),p(e).meridiem=e._meridiem,e._a[O]=function(e,t,n){if(null==n)return t;return null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?((e=e.isPM(n))&&t<12&&(t+=12),t=e||12!==t?t:0):t}(e._locale,e._a[O],e._meridiem),null!==(o=p(e).era)&&(e._a[D]=e._locale.erasConvertYear(o,e._a[D])),Tt(e),_t(e)}}function Nt(e){var t,n,s,i=e._i,r=e._f;if(e._locale=e._locale||P(e._l),null===i||void 0===r&&""===i)return I({nullInput:!0});if("string"==typeof i&&(e._i=i=e._locale.preparse(i)),k(i))return new $(_t(i));if(V(i))e._d=i;else if(y(r)){var a,o,u,l,d,h,c=e,f=!1,m=c._f.length;if(0===m)p(c).invalidFormat=!0,c._d=new Date(NaN);else{for(l=0;l<m;l++)d=0,h=!1,a=q({},c),null!=c._useUTC&&(a._useUTC=c._useUTC),a._f=c._f[l],xt(a),A(a)&&(h=!0),d=(d+=p(a).charsLeftOver)+10*p(a).unusedTokens.length,p(a).score=d,f?d<u&&(u=d,o=a):(null==u||d<u||h)&&(u=d,o=a,h)&&(f=!0);E(c,o||a)}}else if(r)xt(e);else if(g(r=(i=e)._i))i._d=new Date(_.now());else V(r)?i._d=new Date(r.valueOf()):"string"==typeof r?(n=i,null!==(t=Mt.exec(n._i))?n._d=new Date(+t[1]):(Yt(n),!1===n._isValid&&(delete n._isValid,Ot(n),!1===n._isValid)&&(delete n._isValid,n._strict?n._isValid=!1:_.createFromInputFallback(n)))):y(r)?(i._a=G(r.slice(0),function(e){return parseInt(e,10)}),Tt(i)):F(r)?(t=i)._d||(s=void 0===(n=ue(t._i)).day?n.date:n.day,t._a=G([n.year,n.month,s,n.hour,n.minute,n.second,n.millisecond],function(e){return e&&parseInt(e,10)}),Tt(t)):w(r)?i._d=new Date(r):_.createFromInputFallback(i);return A(e)||(e._d=null),e}function Wt(e,t,n,s,i){var r={};return!0!==t&&!1!==t||(s=t,t=void 0),!0!==n&&!1!==n||(s=n,n=void 0),(F(e)&&L(e)||y(e)&&0===e.length)&&(e=void 0),r._isAMomentObject=!0,r._useUTC=r._isUTC=i,r._l=n,r._i=e,r._f=t,r._strict=s,(i=new $(_t(Nt(i=r))))._nextDay&&(i.add(1,"d"),i._nextDay=void 0),i}function R(e,t,n,s){return Wt(e,t,n,s,!1)}_.createFromInputFallback=e("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),_.ISO_8601=function(){},_.RFC_2822=function(){};me=e("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=R.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:I()}),_e=e("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=R.apply(null,arguments);return this.isValid()&&e.isValid()?this<e?this:e:I()});function Pt(e,t){var n,s;if(!(t=1===t.length&&y(t[0])?t[0]:t).length)return R();for(n=t[0],s=1;s<t.length;++s)t[s].isValid()&&!t[s][e](n)||(n=t[s]);return n}var Rt=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Ct(e){var e=ue(e),t=e.year||0,n=e.quarter||0,s=e.month||0,i=e.week||e.isoWeek||0,r=e.day||0,a=e.hour||0,o=e.minute||0,u=e.second||0,l=e.millisecond||0;this._isValid=function(e){var t,n,s=!1,i=Rt.length;for(t in e)if(c(e,t)&&(-1===x.call(Rt,t)||null!=e[t]&&isNaN(e[t])))return!1;for(n=0;n<i;++n)if(e[Rt[n]]){if(s)return!1;parseFloat(e[Rt[n]])!==M(e[Rt[n]])&&(s=!0)}return!0}(e),this._milliseconds=+l+1e3*u+6e4*o+1e3*a*60*60,this._days=+r+7*i,this._months=+s+3*n+12*t,this._data={},this._locale=P(),this._bubble()}function Ut(e){return e instanceof Ct}function Ht(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function Ft(e,n){s(e,0,0,function(){var e=this.utcOffset(),t="+";return e<0&&(e=-e,t="-"),t+r(~~(e/60),2)+n+r(~~e%60,2)})}Ft("Z",":"),Ft("ZZ",""),h("Z",ve),h("ZZ",ve),v(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=Vt(ve,e)});var Lt=/([\+\-]|\d\d)/gi;function Vt(e,t){var t=(t||"").match(e);return null===t?null:0===(t=60*(e=((t[t.length-1]||[])+"").match(Lt)||["-",0,0])[1]+M(e[2]))?0:"+"===e[0]?t:-t}function Gt(e,t){var n;return t._isUTC?(t=t.clone(),n=(k(e)||V(e)?e:R(e)).valueOf()-t.valueOf(),t._d.setTime(t._d.valueOf()+n),_.updateOffset(t,!1),t):R(e).local()}function Et(e){return-Math.round(e._d.getTimezoneOffset())}function At(){return!!this.isValid()&&this._isUTC&&0===this._offset}_.updateOffset=function(){};var It=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,jt=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function C(e,t){var n,s=e;return Ut(e)?s={ms:e._milliseconds,d:e._days,M:e._months}:w(e)||!isNaN(+e)?(s={},t?s[t]=+e:s.milliseconds=+e):(t=It.exec(e))?(n="-"===t[1]?-1:1,s={y:0,d:M(t[S])*n,h:M(t[O])*n,m:M(t[b])*n,s:M(t[T])*n,ms:M(Ht(1e3*t[Te]))*n}):(t=jt.exec(e))?(n="-"===t[1]?-1:1,s={y:Zt(t[2],n),M:Zt(t[3],n),w:Zt(t[4],n),d:Zt(t[5],n),h:Zt(t[6],n),m:Zt(t[7],n),s:Zt(t[8],n)}):null==s?s={}:"object"==typeof s&&("from"in s||"to"in s)&&(t=function(e,t){var n;if(!e.isValid()||!t.isValid())return{milliseconds:0,months:0};t=Gt(t,e),e.isBefore(t)?n=zt(e,t):((n=zt(t,e)).milliseconds=-n.milliseconds,n.months=-n.months);return n}(R(s.from),R(s.to)),(s={}).ms=t.milliseconds,s.M=t.months),n=new Ct(s),Ut(e)&&c(e,"_locale")&&(n._locale=e._locale),Ut(e)&&c(e,"_isValid")&&(n._isValid=e._isValid),n}function Zt(e,t){e=e&&parseFloat(e.replace(",","."));return(isNaN(e)?0:e)*t}function zt(e,t){var n={};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function qt(s,i){return function(e,t){var n;return null===t||isNaN(+t)||(Q(i,"moment()."+i+"(period, number) is deprecated. Please use moment()."+i+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),n=e,e=t,t=n),$t(this,C(e,t),s),this}}function $t(e,t,n,s){var i=t._milliseconds,r=Ht(t._days),t=Ht(t._months);e.isValid()&&(s=null==s||s,t&&Ae(e,Ce(e,"Month")+t*n),r&&Ue(e,"Date",Ce(e,"Date")+r*n),i&&e._d.setTime(e._d.valueOf()+i*n),s)&&_.updateOffset(e,r||t)}C.fn=Ct.prototype,C.invalid=function(){return C(NaN)};Fe=qt(1,"add"),Qe=qt(-1,"subtract");function Bt(e){return"string"==typeof e||e instanceof String}function Jt(e){return k(e)||V(e)||Bt(e)||w(e)||function(t){var e=y(t),n=!1;e&&(n=0===t.filter(function(e){return!w(e)&&Bt(t)}).length);return e&&n}(e)||function(e){var t,n,s=F(e)&&!L(e),i=!1,r=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],a=r.length;for(t=0;t<a;t+=1)n=r[t],i=i||c(e,n);return s&&i}(e)||null==e}function Qt(e,t){var n,s;return e.date()<t.date()?-Qt(t,e):-((n=12*(t.year()-e.year())+(t.month()-e.month()))+(t-(s=e.clone().add(n,"months"))<0?(t-s)/(s-e.clone().add(n-1,"months")):(t-s)/(e.clone().add(1+n,"months")-s)))||0}function Xt(e){return void 0===e?this._locale._abbr:(null!=(e=P(e))&&(this._locale=e),this)}_.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",_.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";Ke=e("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});function Kt(){return this._locale}var en=126227808e5;function tn(e,t){return(e%t+t)%t}function nn(e,t,n){return e<100&&0<=e?new Date(e+400,t,n)-en:new Date(e,t,n).valueOf()}function sn(e,t,n){return e<100&&0<=e?Date.UTC(e+400,t,n)-en:Date.UTC(e,t,n)}function rn(e,t){return t.erasAbbrRegex(e)}function an(){for(var e,t,n,s=[],i=[],r=[],a=[],o=this.eras(),u=0,l=o.length;u<l;++u)e=f(o[u].name),t=f(o[u].abbr),n=f(o[u].narrow),i.push(e),s.push(t),r.push(n),a.push(e),a.push(t),a.push(n);this._erasRegex=new RegExp("^("+a.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+i.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+s.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+r.join("|")+")","i")}function on(e,t){s(0,[e,e.length],0,t)}function un(e,t,n,s,i){var r;return null==e?Be(this,s,i).year:(r=N(e,s,i),function(e,t,n,s,i){e=$e(e,t,n,s,i),t=ze(e.year,0,e.dayOfYear);return this.year(t.getUTCFullYear()),this.month(t.getUTCMonth()),this.date(t.getUTCDate()),this}.call(this,e,t=r<t?r:t,n,s,i))}s("N",0,0,"eraAbbr"),s("NN",0,0,"eraAbbr"),s("NNN",0,0,"eraAbbr"),s("NNNN",0,0,"eraName"),s("NNNNN",0,0,"eraNarrow"),s("y",["y",1],"yo","eraYear"),s("y",["yy",2],0,"eraYear"),s("y",["yyy",3],0,"eraYear"),s("y",["yyyy",4],0,"eraYear"),h("N",rn),h("NN",rn),h("NNN",rn),h("NNNN",function(e,t){return t.erasNameRegex(e)}),h("NNNNN",function(e,t){return t.erasNarrowRegex(e)}),v(["N","NN","NNN","NNNN","NNNNN"],function(e,t,n,s){s=n._locale.erasParse(e,s,n._strict);s?p(n).era=s:p(n).invalidEra=e}),h("y",pe),h("yy",pe),h("yyy",pe),h("yyyy",pe),h("yo",function(e,t){return t._eraYearOrdinalRegex||pe}),v(["y","yy","yyy","yyyy"],D),v(["yo"],function(e,t,n,s){var i;n._locale._eraYearOrdinalRegex&&(i=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[D]=n._locale.eraYearOrdinalParse(e,i):t[D]=parseInt(e,10)}),s(0,["gg",2],0,function(){return this.weekYear()%100}),s(0,["GG",2],0,function(){return this.isoWeekYear()%100}),on("gggg","weekYear"),on("ggggg","weekYear"),on("GGGG","isoWeekYear"),on("GGGGG","isoWeekYear"),h("G",ke),h("g",ke),h("GG",n,t),h("gg",n,t),h("GGGG",ge,ce),h("gggg",ge,ce),h("GGGGG",we,fe),h("ggggg",we,fe),Oe(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,s){t[s.substr(0,2)]=M(e)}),Oe(["gg","GG"],function(e,t,n,s){t[s]=_.parseTwoDigitYear(e)}),s("Q",0,"Qo","quarter"),h("Q",de),v("Q",function(e,t){t[Y]=3*(M(e)-1)}),s("D",["DD",2],"Do","date"),h("D",n,u),h("DD",n,t),h("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),v(["D","DD"],S),v("Do",function(e,t){t[S]=M(e.match(n)[0])});ge=Re("Date",!0);s("DDD",["DDDD",3],"DDDo","dayOfYear"),h("DDD",ye),h("DDDD",he),v(["DDD","DDDD"],function(e,t,n){n._dayOfYear=M(e)}),s("m",["mm",2],0,"minute"),h("m",n,d),h("mm",n,t),v(["m","mm"],b);var ln,ce=Re("Minutes",!1),we=(s("s",["ss",2],0,"second"),h("s",n,d),h("ss",n,t),v(["s","ss"],T),Re("Seconds",!1));for(s("S",0,0,function(){return~~(this.millisecond()/100)}),s(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),s(0,["SSS",3],0,"millisecond"),s(0,["SSSS",4],0,function(){return 10*this.millisecond()}),s(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),s(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),s(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),s(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),s(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),h("S",ye,de),h("SS",ye,t),h("SSS",ye,he),ln="SSSS";ln.length<=9;ln+="S")h(ln,pe);function dn(e,t){t[Te]=M(1e3*("0."+e))}for(ln="S";ln.length<=9;ln+="S")v(ln,dn);fe=Re("Milliseconds",!1),s("z",0,0,"zoneAbbr"),s("zz",0,0,"zoneName");u=$.prototype;function hn(e){return e}u.add=Fe,u.calendar=function(e,t){1===arguments.length&&(arguments[0]?Jt(arguments[0])?(e=arguments[0],t=void 0):function(e){for(var t=F(e)&&!L(e),n=!1,s=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],i=0;i<s.length;i+=1)n=n||c(e,s[i]);return t&&n}(arguments[0])&&(t=arguments[0],e=void 0):t=e=void 0);var e=e||R(),n=Gt(e,this).startOf("day"),n=_.calendarFormat(this,n)||"sameElse",t=t&&(a(t[n])?t[n].call(this,e):t[n]);return this.format(t||this.localeData().calendar(n,this,R(e)))},u.clone=function(){return new $(this)},u.diff=function(e,t,n){var s,i,r;if(!this.isValid())return NaN;if(!(s=Gt(e,this)).isValid())return NaN;switch(i=6e4*(s.utcOffset()-this.utcOffset()),t=o(t)){case"year":r=Qt(this,s)/12;break;case"month":r=Qt(this,s);break;case"quarter":r=Qt(this,s)/3;break;case"second":r=(this-s)/1e3;break;case"minute":r=(this-s)/6e4;break;case"hour":r=(this-s)/36e5;break;case"day":r=(this-s-i)/864e5;break;case"week":r=(this-s-i)/6048e5;break;default:r=this-s}return n?r:m(r)},u.endOf=function(e){var t,n;if(void 0!==(e=o(e))&&"millisecond"!==e&&this.isValid()){switch(n=this._isUTC?sn:nn,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=36e5-tn(t+(this._isUTC?0:6e4*this.utcOffset()),36e5)-1;break;case"minute":t=this._d.valueOf(),t+=6e4-tn(t,6e4)-1;break;case"second":t=this._d.valueOf(),t+=1e3-tn(t,1e3)-1}this._d.setTime(t),_.updateOffset(this,!0)}return this},u.format=function(e){return e=e||(this.isUtc()?_.defaultFormatUtc:_.defaultFormat),e=re(this,e),this.localeData().postformat(e)},u.from=function(e,t){return this.isValid()&&(k(e)&&e.isValid()||R(e).isValid())?C({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},u.fromNow=function(e){return this.from(R(),e)},u.to=function(e,t){return this.isValid()&&(k(e)&&e.isValid()||R(e).isValid())?C({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},u.toNow=function(e){return this.to(R(),e)},u.get=function(e){return a(this[e=o(e)])?this[e]():this},u.invalidAt=function(){return p(this).overflow},u.isAfter=function(e,t){return e=k(e)?e:R(e),!(!this.isValid()||!e.isValid())&&("millisecond"===(t=o(t)||"millisecond")?this.valueOf()>e.valueOf():e.valueOf()<this.clone().startOf(t).valueOf())},u.isBefore=function(e,t){return e=k(e)?e:R(e),!(!this.isValid()||!e.isValid())&&("millisecond"===(t=o(t)||"millisecond")?this.valueOf()<e.valueOf():this.clone().endOf(t).valueOf()<e.valueOf())},u.isBetween=function(e,t,n,s){return e=k(e)?e:R(e),t=k(t)?t:R(t),!!(this.isValid()&&e.isValid()&&t.isValid())&&("("===(s=s||"()")[0]?this.isAfter(e,n):!this.isBefore(e,n))&&(")"===s[1]?this.isBefore(t,n):!this.isAfter(t,n))},u.isSame=function(e,t){var e=k(e)?e:R(e);return!(!this.isValid()||!e.isValid())&&("millisecond"===(t=o(t)||"millisecond")?this.valueOf()===e.valueOf():(e=e.valueOf(),this.clone().startOf(t).valueOf()<=e&&e<=this.clone().endOf(t).valueOf()))},u.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},u.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},u.isValid=function(){return A(this)},u.lang=Ke,u.locale=Xt,u.localeData=Kt,u.max=_e,u.min=me,u.parsingFlags=function(){return E({},p(this))},u.set=function(e,t){if("object"==typeof e)for(var n=function(e){var t,n=[];for(t in e)c(e,t)&&n.push({unit:t,priority:le[t]});return n.sort(function(e,t){return e.priority-t.priority}),n}(e=ue(e)),s=n.length,i=0;i<s;i++)this[n[i].unit](e[n[i].unit]);else if(a(this[e=o(e)]))return this[e](t);return this},u.startOf=function(e){var t,n;if(void 0!==(e=o(e))&&"millisecond"!==e&&this.isValid()){switch(n=this._isUTC?sn:nn,e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=tn(t+(this._isUTC?0:6e4*this.utcOffset()),36e5);break;case"minute":t=this._d.valueOf(),t-=tn(t,6e4);break;case"second":t=this._d.valueOf(),t-=tn(t,1e3)}this._d.setTime(t),_.updateOffset(this,!0)}return this},u.subtract=Qe,u.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},u.toObject=function(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}},u.toDate=function(){return new Date(this.valueOf())},u.toISOString=function(e){var t;return this.isValid()?(t=(e=!0!==e)?this.clone().utc():this).year()<0||9999<t.year()?re(t,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):a(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",re(t,"Z")):re(t,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ"):null},u.inspect=function(){var e,t,n;return this.isValid()?(t="moment",e="",this.isLocal()||(t=0===this.utcOffset()?"moment.utc":"moment.parseZone",e="Z"),t="["+t+'("]',n=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",this.format(t+n+"-MM-DD[T]HH:mm:ss.SSS"+(e+'[")]'))):"moment.invalid(/* "+this._i+" */)"},"undefined"!=typeof Symbol&&null!=Symbol.for&&(u[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),u.toJSON=function(){return this.isValid()?this.toISOString():null},u.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},u.unix=function(){return Math.floor(this.valueOf()/1e3)},u.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},u.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},u.eraName=function(){for(var e,t=this.localeData().eras(),n=0,s=t.length;n<s;++n){if(e=this.clone().startOf("day").valueOf(),t[n].since<=e&&e<=t[n].until)return t[n].name;if(t[n].until<=e&&e<=t[n].since)return t[n].name}return""},u.eraNarrow=function(){for(var e,t=this.localeData().eras(),n=0,s=t.length;n<s;++n){if(e=this.clone().startOf("day").valueOf(),t[n].since<=e&&e<=t[n].until)return t[n].narrow;if(t[n].until<=e&&e<=t[n].since)return t[n].narrow}return""},u.eraAbbr=function(){for(var e,t=this.localeData().eras(),n=0,s=t.length;n<s;++n){if(e=this.clone().startOf("day").valueOf(),t[n].since<=e&&e<=t[n].until)return t[n].abbr;if(t[n].until<=e&&e<=t[n].since)return t[n].abbr}return""},u.eraYear=function(){for(var e,t,n=this.localeData().eras(),s=0,i=n.length;s<i;++s)if(e=n[s].since<=n[s].until?1:-1,t=this.clone().startOf("day").valueOf(),n[s].since<=t&&t<=n[s].until||n[s].until<=t&&t<=n[s].since)return(this.year()-_(n[s].since).year())*e+n[s].offset;return this.year()},u.year=Pe,u.isLeapYear=function(){return be(this.year())},u.weekYear=function(e){return un.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)},u.isoWeekYear=function(e){return un.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},u.quarter=u.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},u.month=Ie,u.daysInMonth=function(){return He(this.year(),this.month())},u.week=u.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},u.isoWeek=u.isoWeeks=function(e){var t=Be(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},u.weeksInYear=function(){var e=this.localeData()._week;return N(this.year(),e.dow,e.doy)},u.weeksInWeekYear=function(){var e=this.localeData()._week;return N(this.weekYear(),e.dow,e.doy)},u.isoWeeksInYear=function(){return N(this.year(),1,4)},u.isoWeeksInISOWeekYear=function(){return N(this.isoWeekYear(),1,4)},u.date=ge,u.day=u.days=function(e){var t,n,s;return this.isValid()?(t=Ce(this,"Day"),null!=e?(n=e,s=this.localeData(),e="string"!=typeof n?n:isNaN(n)?"number"==typeof(n=s.weekdaysParse(n))?n:null:parseInt(n,10),this.add(e-t,"d")):t):null!=e?this:NaN},u.weekday=function(e){var t;return this.isValid()?(t=(this.day()+7-this.localeData()._week.dow)%7,null==e?t:this.add(e-t,"d")):null!=e?this:NaN},u.isoWeekday=function(e){var t,n;return this.isValid()?null!=e?(t=e,n=this.localeData(),n="string"==typeof t?n.weekdaysParse(t)%7||7:isNaN(t)?null:t,this.day(this.day()%7?n:n-7)):this.day()||7:null!=e?this:NaN},u.dayOfYear=function(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},u.hour=u.hours=i,u.minute=u.minutes=ce,u.second=u.seconds=we,u.millisecond=u.milliseconds=fe,u.utcOffset=function(e,t,n){var s,i=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null==e)return this._isUTC?i:Et(this);if("string"==typeof e){if(null===(e=Vt(ve,e)))return this}else Math.abs(e)<16&&!n&&(e*=60);return!this._isUTC&&t&&(s=Et(this)),this._offset=e,this._isUTC=!0,null!=s&&this.add(s,"m"),i!==e&&(!t||this._changeInProgress?$t(this,C(e-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,_.updateOffset(this,!0),this._changeInProgress=null)),this},u.utc=function(e){return this.utcOffset(0,e)},u.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e)&&this.subtract(Et(this),"m"),this},u.parseZone=function(){var e;return null!=this._tzm?this.utcOffset(this._tzm,!1,!0):"string"==typeof this._i&&(null!=(e=Vt(Me,this._i))?this.utcOffset(e):this.utcOffset(0,!0)),this},u.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?R(e).utcOffset():0,(this.utcOffset()-e)%60==0)},u.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},u.isLocal=function(){return!!this.isValid()&&!this._isUTC},u.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},u.isUtc=At,u.isUTC=At,u.zoneAbbr=function(){return this._isUTC?"UTC":""},u.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},u.dates=e("dates accessor is deprecated. Use date instead.",ge),u.months=e("months accessor is deprecated. Use month instead",Ie),u.years=e("years accessor is deprecated. Use year instead",Pe),u.zone=e("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null!=e?(this.utcOffset(e="string"!=typeof e?-e:e,t),this):-this.utcOffset()}),u.isDSTShifted=e("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){var e,t;return g(this._isDSTShifted)&&(q(e={},this),(e=Nt(e))._a?(t=(e._isUTC?l:R)(e._a),this._isDSTShifted=this.isValid()&&0<function(e,t,n){for(var s=Math.min(e.length,t.length),i=Math.abs(e.length-t.length),r=0,a=0;a<s;a++)(n&&e[a]!==t[a]||!n&&M(e[a])!==M(t[a]))&&r++;return r+i}(e._a,t.toArray())):this._isDSTShifted=!1),this._isDSTShifted});d=K.prototype;function cn(e,t,n,s){var i=P(),s=l().set(s,t);return i[n](s,e)}function fn(e,t,n){if(w(e)&&(t=e,e=void 0),e=e||"",null!=t)return cn(e,t,n,"month");for(var s=[],i=0;i<12;i++)s[i]=cn(e,i,n,"month");return s}function mn(e,t,n,s){t=("boolean"==typeof e?w(t)&&(n=t,t=void 0):(t=e,e=!1,w(n=t)&&(n=t,t=void 0)),t||"");var i,r=P(),a=e?r._week.dow:0,o=[];if(null!=n)return cn(t,(n+a)%7,s,"day");for(i=0;i<7;i++)o[i]=cn(t,(i+a)%7,s,"day");return o}d.calendar=function(e,t,n){return a(e=this._calendar[e]||this._calendar.sameElse)?e.call(t,n):e},d.longDateFormat=function(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(te).map(function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e}).join(""),this._longDateFormat[e])},d.invalidDate=function(){return this._invalidDate},d.ordinal=function(e){return this._ordinal.replace("%d",e)},d.preparse=hn,d.postformat=hn,d.relativeTime=function(e,t,n,s){var i=this._relativeTime[n];return a(i)?i(e,t,n,s):i.replace(/%d/i,e)},d.pastFuture=function(e,t){return a(e=this._relativeTime[0<e?"future":"past"])?e(t):e.replace(/%s/i,t)},d.set=function(e){var t,n;for(n in e)c(e,n)&&(a(t=e[n])?this[n]=t:this["_"+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},d.eras=function(e,t){for(var n,s=this._eras||P("en")._eras,i=0,r=s.length;i<r;++i)switch("string"==typeof s[i].since&&(n=_(s[i].since).startOf("day"),s[i].since=n.valueOf()),typeof s[i].until){case"undefined":s[i].until=1/0;break;case"string":n=_(s[i].until).startOf("day").valueOf(),s[i].until=n.valueOf()}return s},d.erasParse=function(e,t,n){var s,i,r,a,o,u=this.eras();for(e=e.toUpperCase(),s=0,i=u.length;s<i;++s)if(r=u[s].name.toUpperCase(),a=u[s].abbr.toUpperCase(),o=u[s].narrow.toUpperCase(),n)switch(t){case"N":case"NN":case"NNN":if(a===e)return u[s];break;case"NNNN":if(r===e)return u[s];break;case"NNNNN":if(o===e)return u[s]}else if(0<=[r,a,o].indexOf(e))return u[s]},d.erasConvertYear=function(e,t){var n=e.since<=e.until?1:-1;return void 0===t?_(e.since).year():_(e.since).year()+(t-e.offset)*n},d.erasAbbrRegex=function(e){return c(this,"_erasAbbrRegex")||an.call(this),e?this._erasAbbrRegex:this._erasRegex},d.erasNameRegex=function(e){return c(this,"_erasNameRegex")||an.call(this),e?this._erasNameRegex:this._erasRegex},d.erasNarrowRegex=function(e){return c(this,"_erasNarrowRegex")||an.call(this),e?this._erasNarrowRegex:this._erasRegex},d.months=function(e,t){return e?(y(this._months)?this._months:this._months[(this._months.isFormat||Ve).test(t)?"format":"standalone"])[e.month()]:y(this._months)?this._months:this._months.standalone},d.monthsShort=function(e,t){return e?(y(this._monthsShort)?this._monthsShort:this._monthsShort[Ve.test(t)?"format":"standalone"])[e.month()]:y(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},d.monthsParse=function(e,t,n){var s,i;if(this._monthsParseExact)return function(e,t,n){var s,i,r,e=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],s=0;s<12;++s)r=l([2e3,s]),this._shortMonthsParse[s]=this.monthsShort(r,"").toLocaleLowerCase(),this._longMonthsParse[s]=this.months(r,"").toLocaleLowerCase();return n?"MMM"===t?-1!==(i=x.call(this._shortMonthsParse,e))?i:null:-1!==(i=x.call(this._longMonthsParse,e))?i:null:"MMM"===t?-1!==(i=x.call(this._shortMonthsParse,e))||-1!==(i=x.call(this._longMonthsParse,e))?i:null:-1!==(i=x.call(this._longMonthsParse,e))||-1!==(i=x.call(this._shortMonthsParse,e))?i:null}.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),s=0;s<12;s++){if(i=l([2e3,s]),n&&!this._longMonthsParse[s]&&(this._longMonthsParse[s]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[s]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),n||this._monthsParse[s]||(i="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[s]=new RegExp(i.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[s].test(e))return s;if(n&&"MMM"===t&&this._shortMonthsParse[s].test(e))return s;if(!n&&this._monthsParse[s].test(e))return s}},d.monthsRegex=function(e){return this._monthsParseExact?(c(this,"_monthsRegex")||je.call(this),e?this._monthsStrictRegex:this._monthsRegex):(c(this,"_monthsRegex")||(this._monthsRegex=Ee),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},d.monthsShortRegex=function(e){return this._monthsParseExact?(c(this,"_monthsRegex")||je.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(c(this,"_monthsShortRegex")||(this._monthsShortRegex=Ge),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},d.week=function(e){return Be(e,this._week.dow,this._week.doy).week},d.firstDayOfYear=function(){return this._week.doy},d.firstDayOfWeek=function(){return this._week.dow},d.weekdays=function(e,t){return t=y(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"],!0===e?Je(t,this._week.dow):e?t[e.day()]:t},d.weekdaysMin=function(e){return!0===e?Je(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin},d.weekdaysShort=function(e){return!0===e?Je(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort},d.weekdaysParse=function(e,t,n){var s,i;if(this._weekdaysParseExact)return function(e,t,n){var s,i,r,e=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],s=0;s<7;++s)r=l([2e3,1]).day(s),this._minWeekdaysParse[s]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[s]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[s]=this.weekdays(r,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(i=x.call(this._weekdaysParse,e))?i:null:"ddd"===t?-1!==(i=x.call(this._shortWeekdaysParse,e))?i:null:-1!==(i=x.call(this._minWeekdaysParse,e))?i:null:"dddd"===t?-1!==(i=x.call(this._weekdaysParse,e))||-1!==(i=x.call(this._shortWeekdaysParse,e))||-1!==(i=x.call(this._minWeekdaysParse,e))?i:null:"ddd"===t?-1!==(i=x.call(this._shortWeekdaysParse,e))||-1!==(i=x.call(this._weekdaysParse,e))||-1!==(i=x.call(this._minWeekdaysParse,e))?i:null:-1!==(i=x.call(this._minWeekdaysParse,e))||-1!==(i=x.call(this._weekdaysParse,e))||-1!==(i=x.call(this._shortWeekdaysParse,e))?i:null}.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),s=0;s<7;s++){if(i=l([2e3,1]).day(s),n&&!this._fullWeekdaysParse[s]&&(this._fullWeekdaysParse[s]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[s]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[s]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[s]||(i="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[s]=new RegExp(i.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[s].test(e))return s;if(n&&"ddd"===t&&this._shortWeekdaysParse[s].test(e))return s;if(n&&"dd"===t&&this._minWeekdaysParse[s].test(e))return s;if(!n&&this._weekdaysParse[s].test(e))return s}},d.weekdaysRegex=function(e){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||st.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(c(this,"_weekdaysRegex")||(this._weekdaysRegex=et),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},d.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||st.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(c(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=tt),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},d.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||st.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(c(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=nt),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},d.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},d.meridiem=function(e,t,n){return 11<e?n?"pm":"PM":n?"am":"AM"},ft("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===M(e%100/10)?"th":1==t?"st":2==t?"nd":3==t?"rd":"th")}}),_.lang=e("moment.lang is deprecated. Use moment.locale instead.",ft),_.langData=e("moment.langData is deprecated. Use moment.localeData instead.",P);var _n=Math.abs;function yn(e,t,n,s){t=C(t,n);return e._milliseconds+=s*t._milliseconds,e._days+=s*t._days,e._months+=s*t._months,e._bubble()}function gn(e){return e<0?Math.floor(e):Math.ceil(e)}function wn(e){return 4800*e/146097}function pn(e){return 146097*e/4800}function kn(e){return function(){return this.as(e)}}de=kn("ms"),t=kn("s"),ye=kn("m"),he=kn("h"),Fe=kn("d"),_e=kn("w"),me=kn("M"),Qe=kn("Q"),i=kn("y"),ce=de;function Mn(e){return function(){return this.isValid()?this._data[e]:NaN}}var we=Mn("milliseconds"),fe=Mn("seconds"),ge=Mn("minutes"),Pe=Mn("hours"),d=Mn("days"),vn=Mn("months"),Dn=Mn("years");var Yn=Math.round,Sn={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function On(e,t,n,s){var i=C(e).abs(),r=Yn(i.as("s")),a=Yn(i.as("m")),o=Yn(i.as("h")),u=Yn(i.as("d")),l=Yn(i.as("M")),d=Yn(i.as("w")),i=Yn(i.as("y")),r=(r<=n.ss?["s",r]:r<n.s&&["ss",r])||(a<=1?["m"]:a<n.m&&["mm",a])||(o<=1?["h"]:o<n.h&&["hh",o])||(u<=1?["d"]:u<n.d&&["dd",u]);return(r=(r=null!=n.w?r||(d<=1?["w"]:d<n.w&&["ww",d]):r)||(l<=1?["M"]:l<n.M&&["MM",l])||(i<=1?["y"]:["yy",i]))[2]=t,r[3]=0<+e,r[4]=s,function(e,t,n,s,i){return i.relativeTime(t||1,!!n,e,s)}.apply(null,r)}var bn=Math.abs;function Tn(e){return(0<e)-(e<0)||+e}function xn(){var e,t,n,s,i,r,a,o,u,l,d;return this.isValid()?(e=bn(this._milliseconds)/1e3,t=bn(this._days),n=bn(this._months),(o=this.asSeconds())?(s=m(e/60),i=m(s/60),e%=60,s%=60,r=m(n/12),n%=12,a=e?e.toFixed(3).replace(/\.?0+$/,""):"",u=Tn(this._months)!==Tn(o)?"-":"",l=Tn(this._days)!==Tn(o)?"-":"",d=Tn(this._milliseconds)!==Tn(o)?"-":"",(o<0?"-":"")+"P"+(r?u+r+"Y":"")+(n?u+n+"M":"")+(t?l+t+"D":"")+(i||s||e?"T":"")+(i?d+i+"H":"")+(s?d+s+"M":"")+(e?d+a+"S":"")):"P0D"):this.localeData().invalidDate()}var U=Ct.prototype;return U.isValid=function(){return this._isValid},U.abs=function(){var e=this._data;return this._milliseconds=_n(this._milliseconds),this._days=_n(this._days),this._months=_n(this._months),e.milliseconds=_n(e.milliseconds),e.seconds=_n(e.seconds),e.minutes=_n(e.minutes),e.hours=_n(e.hours),e.months=_n(e.months),e.years=_n(e.years),this},U.add=function(e,t){return yn(this,e,t,1)},U.subtract=function(e,t){return yn(this,e,t,-1)},U.as=function(e){if(!this.isValid())return NaN;var t,n,s=this._milliseconds;if("month"===(e=o(e))||"quarter"===e||"year"===e)switch(t=this._days+s/864e5,n=this._months+wn(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(pn(this._months)),e){case"week":return t/7+s/6048e5;case"day":return t+s/864e5;case"hour":return 24*t+s/36e5;case"minute":return 1440*t+s/6e4;case"second":return 86400*t+s/1e3;case"millisecond":return Math.floor(864e5*t)+s;default:throw new Error("Unknown unit "+e)}},U.asMilliseconds=de,U.asSeconds=t,U.asMinutes=ye,U.asHours=he,U.asDays=Fe,U.asWeeks=_e,U.asMonths=me,U.asQuarters=Qe,U.asYears=i,U.valueOf=ce,U._bubble=function(){var e=this._milliseconds,t=this._days,n=this._months,s=this._data;return 0<=e&&0<=t&&0<=n||e<=0&&t<=0&&n<=0||(e+=864e5*gn(pn(n)+t),n=t=0),s.milliseconds=e%1e3,e=m(e/1e3),s.seconds=e%60,e=m(e/60),s.minutes=e%60,e=m(e/60),s.hours=e%24,t+=m(e/24),n+=e=m(wn(t)),t-=gn(pn(e)),e=m(n/12),n%=12,s.days=t,s.months=n,s.years=e,this},U.clone=function(){return C(this)},U.get=function(e){return e=o(e),this.isValid()?this[e+"s"]():NaN},U.milliseconds=we,U.seconds=fe,U.minutes=ge,U.hours=Pe,U.days=d,U.weeks=function(){return m(this.days()/7)},U.months=vn,U.years=Dn,U.humanize=function(e,t){var n,s;return this.isValid()?(n=!1,s=Sn,"object"==typeof e&&(t=e,e=!1),"boolean"==typeof e&&(n=e),"object"==typeof t&&(s=Object.assign({},Sn,t),null!=t.s)&&null==t.ss&&(s.ss=t.s-1),e=this.localeData(),t=On(this,!n,s,e),n&&(t=e.pastFuture(+this,t)),e.postformat(t)):this.localeData().invalidDate()},U.toISOString=xn,U.toString=xn,U.toJSON=xn,U.locale=Xt,U.localeData=Kt,U.toIsoString=e("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",xn),U.lang=Ke,s("X",0,0,"unix"),s("x",0,0,"valueOf"),h("x",ke),h("X",/[+-]?\d+(\.\d{1,3})?/),v("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e))}),v("x",function(e,t,n){n._d=new Date(M(e))}),_.version="2.30.1",H=R,_.fn=u,_.min=function(){return Pt("isBefore",[].slice.call(arguments,0))},_.max=function(){return Pt("isAfter",[].slice.call(arguments,0))},_.now=function(){return Date.now?Date.now():+new Date},_.utc=l,_.unix=function(e){return R(1e3*e)},_.months=function(e,t){return fn(e,t,"months")},_.isDate=V,_.locale=ft,_.invalid=I,_.duration=C,_.isMoment=k,_.weekdays=function(e,t,n){return mn(e,t,n,"weekdays")},_.parseZone=function(){return R.apply(null,arguments).parseZone()},_.localeData=P,_.isDuration=Ut,_.monthsShort=function(e,t){return fn(e,t,"monthsShort")},_.weekdaysMin=function(e,t,n){return mn(e,t,n,"weekdaysMin")},_.defineLocale=mt,_.updateLocale=function(e,t){var n,s;return null!=t?(s=ut,null!=W[e]&&null!=W[e].parentLocale?W[e].set(X(W[e]._config,t)):(t=X(s=null!=(n=ct(e))?n._config:s,t),null==n&&(t.abbr=e),(s=new K(t)).parentLocale=W[e],W[e]=s),ft(e)):null!=W[e]&&(null!=W[e].parentLocale?(W[e]=W[e].parentLocale,e===ft()&&ft(e)):null!=W[e]&&delete W[e]),W[e]},_.locales=function(){return ee(W)},_.weekdaysShort=function(e,t,n){return mn(e,t,n,"weekdaysShort")},_.normalizeUnits=o,_.relativeTimeRounding=function(e){return void 0===e?Yn:"function"==typeof e&&(Yn=e,!0)},_.relativeTimeThreshold=function(e,t){return void 0!==Sn[e]&&(void 0===t?Sn[e]:(Sn[e]=t,"s"===e&&(Sn.ss=t-1),!0))},_.calendarFormat=function(e,t){return(e=e.diff(t,"days",!0))<-6?"sameElse":e<-1?"lastWeek":e<0?"lastDay":e<1?"sameDay":e<2?"nextDay":e<7?"nextWeek":"sameElse"},_.prototype=u,_.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},_}); vendor/wp-polyfill-node-contains.js 0000644 00000001203 15206720414 0013411 0 ustar 00 // Node.prototype.contains (function() { function contains(node) { if (!(0 in arguments)) { throw new TypeError('1 argument is required'); } do { if (this === node) { return true; } // eslint-disable-next-line no-cond-assign } while (node = node && node.parentNode); return false; } // IE if ('HTMLElement' in self && 'contains' in HTMLElement.prototype) { try { delete HTMLElement.prototype.contains; // eslint-disable-next-line no-empty } catch (e) {} } if ('Node' in self) { Node.prototype.contains = contains; } else { document.contains = Element.prototype.contains = contains; } }()); vendor/wp-polyfill-url.min.js 0000644 00000133755 15206720414 0012256 0 ustar 00 !function e(t,n,r){function i(o,s){if(!n[o]){if(!t[o]){var l="function"==typeof require&&require;if(!s&&l)return l(o,!0);if(a)return a(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[o]={exports:{}};t[o][0].call(u.exports,(function(e){return i(t[o][1][e]||e)}),u,u.exports,e,t,n,r)}return n[o].exports}for(var a="function"==typeof require&&require,o=0;o<r.length;o++)i(r[o]);return i}({1:[function(e,t,n){t.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},{}],2:[function(e,t,n){var r=e("../internals/is-object");t.exports=function(e){if(!r(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e}},{"../internals/is-object":37}],3:[function(e,t,n){var r=e("../internals/well-known-symbol"),i=e("../internals/object-create"),a=e("../internals/object-define-property"),o=r("unscopables"),s=Array.prototype;null==s[o]&&a.f(s,o,{configurable:!0,value:i(null)}),t.exports=function(e){s[o][e]=!0}},{"../internals/object-create":45,"../internals/object-define-property":47,"../internals/well-known-symbol":77}],4:[function(e,t,n){t.exports=function(e,t,n){if(!(e instanceof t))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return e}},{}],5:[function(e,t,n){var r=e("../internals/is-object");t.exports=function(e){if(!r(e))throw TypeError(String(e)+" is not an object");return e}},{"../internals/is-object":37}],6:[function(e,t,n){"use strict";var r=e("../internals/function-bind-context"),i=e("../internals/to-object"),a=e("../internals/call-with-safe-iteration-closing"),o=e("../internals/is-array-iterator-method"),s=e("../internals/to-length"),l=e("../internals/create-property"),c=e("../internals/get-iterator-method");t.exports=function(e){var t,n,u,f,p,h,b=i(e),d="function"==typeof this?this:Array,y=arguments.length,g=y>1?arguments[1]:void 0,v=void 0!==g,m=c(b),w=0;if(v&&(g=r(g,y>2?arguments[2]:void 0,2)),null==m||d==Array&&o(m))for(n=new d(t=s(b.length));t>w;w++)h=v?g(b[w],w):b[w],l(n,w,h);else for(p=(f=m.call(b)).next,n=new d;!(u=p.call(f)).done;w++)h=v?a(f,g,[u.value,w],!0):u.value,l(n,w,h);return n.length=w,n}},{"../internals/call-with-safe-iteration-closing":8,"../internals/create-property":16,"../internals/function-bind-context":23,"../internals/get-iterator-method":25,"../internals/is-array-iterator-method":35,"../internals/to-length":71,"../internals/to-object":72}],7:[function(e,t,n){var r=e("../internals/to-indexed-object"),i=e("../internals/to-length"),a=e("../internals/to-absolute-index"),o=function(e){return function(t,n,o){var s,l=r(t),c=i(l.length),u=a(o,c);if(e&&n!=n){for(;c>u;)if((s=l[u++])!=s)return!0}else for(;c>u;u++)if((e||u in l)&&l[u]===n)return e||u||0;return!e&&-1}};t.exports={includes:o(!0),indexOf:o(!1)}},{"../internals/to-absolute-index":68,"../internals/to-indexed-object":69,"../internals/to-length":71}],8:[function(e,t,n){var r=e("../internals/an-object");t.exports=function(e,t,n,i){try{return i?t(r(n)[0],n[1]):t(n)}catch(t){var a=e.return;throw void 0!==a&&r(a.call(e)),t}}},{"../internals/an-object":5}],9:[function(e,t,n){var r={}.toString;t.exports=function(e){return r.call(e).slice(8,-1)}},{}],10:[function(e,t,n){var r=e("../internals/to-string-tag-support"),i=e("../internals/classof-raw"),a=e("../internals/well-known-symbol")("toStringTag"),o="Arguments"==i(function(){return arguments}());t.exports=r?i:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),a))?n:o?i(t):"Object"==(r=i(t))&&"function"==typeof t.callee?"Arguments":r}},{"../internals/classof-raw":9,"../internals/to-string-tag-support":74,"../internals/well-known-symbol":77}],11:[function(e,t,n){var r=e("../internals/has"),i=e("../internals/own-keys"),a=e("../internals/object-get-own-property-descriptor"),o=e("../internals/object-define-property");t.exports=function(e,t){for(var n=i(t),s=o.f,l=a.f,c=0;c<n.length;c++){var u=n[c];r(e,u)||s(e,u,l(t,u))}}},{"../internals/has":28,"../internals/object-define-property":47,"../internals/object-get-own-property-descriptor":48,"../internals/own-keys":56}],12:[function(e,t,n){var r=e("../internals/fails");t.exports=!r((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},{"../internals/fails":22}],13:[function(e,t,n){"use strict";var r=e("../internals/iterators-core").IteratorPrototype,i=e("../internals/object-create"),a=e("../internals/create-property-descriptor"),o=e("../internals/set-to-string-tag"),s=e("../internals/iterators"),l=function(){return this};t.exports=function(e,t,n){var c=t+" Iterator";return e.prototype=i(r,{next:a(1,n)}),o(e,c,!1,!0),s[c]=l,e}},{"../internals/create-property-descriptor":15,"../internals/iterators":40,"../internals/iterators-core":39,"../internals/object-create":45,"../internals/set-to-string-tag":62}],14:[function(e,t,n){var r=e("../internals/descriptors"),i=e("../internals/object-define-property"),a=e("../internals/create-property-descriptor");t.exports=r?function(e,t,n){return i.f(e,t,a(1,n))}:function(e,t,n){return e[t]=n,e}},{"../internals/create-property-descriptor":15,"../internals/descriptors":18,"../internals/object-define-property":47}],15:[function(e,t,n){t.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},{}],16:[function(e,t,n){"use strict";var r=e("../internals/to-primitive"),i=e("../internals/object-define-property"),a=e("../internals/create-property-descriptor");t.exports=function(e,t,n){var o=r(t);o in e?i.f(e,o,a(0,n)):e[o]=n}},{"../internals/create-property-descriptor":15,"../internals/object-define-property":47,"../internals/to-primitive":73}],17:[function(e,t,n){"use strict";var r=e("../internals/export"),i=e("../internals/create-iterator-constructor"),a=e("../internals/object-get-prototype-of"),o=e("../internals/object-set-prototype-of"),s=e("../internals/set-to-string-tag"),l=e("../internals/create-non-enumerable-property"),c=e("../internals/redefine"),u=e("../internals/well-known-symbol"),f=e("../internals/is-pure"),p=e("../internals/iterators"),h=e("../internals/iterators-core"),b=h.IteratorPrototype,d=h.BUGGY_SAFARI_ITERATORS,y=u("iterator"),g=function(){return this};t.exports=function(e,t,n,u,h,v,m){i(n,t,u);var w,j,x,k=function(e){if(e===h&&L)return L;if(!d&&e in O)return O[e];switch(e){case"keys":case"values":case"entries":return function(){return new n(this,e)}}return function(){return new n(this)}},S=t+" Iterator",A=!1,O=e.prototype,R=O[y]||O["@@iterator"]||h&&O[h],L=!d&&R||k(h),U="Array"==t&&O.entries||R;if(U&&(w=a(U.call(new e)),b!==Object.prototype&&w.next&&(f||a(w)===b||(o?o(w,b):"function"!=typeof w[y]&&l(w,y,g)),s(w,S,!0,!0),f&&(p[S]=g))),"values"==h&&R&&"values"!==R.name&&(A=!0,L=function(){return R.call(this)}),f&&!m||O[y]===L||l(O,y,L),p[t]=L,h)if(j={values:k("values"),keys:v?L:k("keys"),entries:k("entries")},m)for(x in j)!d&&!A&&x in O||c(O,x,j[x]);else r({target:t,proto:!0,forced:d||A},j);return j}},{"../internals/create-iterator-constructor":13,"../internals/create-non-enumerable-property":14,"../internals/export":21,"../internals/is-pure":38,"../internals/iterators":40,"../internals/iterators-core":39,"../internals/object-get-prototype-of":51,"../internals/object-set-prototype-of":55,"../internals/redefine":59,"../internals/set-to-string-tag":62,"../internals/well-known-symbol":77}],18:[function(e,t,n){var r=e("../internals/fails");t.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},{"../internals/fails":22}],19:[function(e,t,n){var r=e("../internals/global"),i=e("../internals/is-object"),a=r.document,o=i(a)&&i(a.createElement);t.exports=function(e){return o?a.createElement(e):{}}},{"../internals/global":27,"../internals/is-object":37}],20:[function(e,t,n){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},{}],21:[function(e,t,n){var r=e("../internals/global"),i=e("../internals/object-get-own-property-descriptor").f,a=e("../internals/create-non-enumerable-property"),o=e("../internals/redefine"),s=e("../internals/set-global"),l=e("../internals/copy-constructor-properties"),c=e("../internals/is-forced");t.exports=function(e,t){var n,u,f,p,h,b=e.target,d=e.global,y=e.stat;if(n=d?r:y?r[b]||s(b,{}):(r[b]||{}).prototype)for(u in t){if(p=t[u],f=e.noTargetGet?(h=i(n,u))&&h.value:n[u],!c(d?u:b+(y?".":"#")+u,e.forced)&&void 0!==f){if(typeof p==typeof f)continue;l(p,f)}(e.sham||f&&f.sham)&&a(p,"sham",!0),o(n,u,p,e)}}},{"../internals/copy-constructor-properties":11,"../internals/create-non-enumerable-property":14,"../internals/global":27,"../internals/is-forced":36,"../internals/object-get-own-property-descriptor":48,"../internals/redefine":59,"../internals/set-global":61}],22:[function(e,t,n){t.exports=function(e){try{return!!e()}catch(e){return!0}}},{}],23:[function(e,t,n){var r=e("../internals/a-function");t.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},{"../internals/a-function":1}],24:[function(e,t,n){var r=e("../internals/path"),i=e("../internals/global"),a=function(e){return"function"==typeof e?e:void 0};t.exports=function(e,t){return arguments.length<2?a(r[e])||a(i[e]):r[e]&&r[e][t]||i[e]&&i[e][t]}},{"../internals/global":27,"../internals/path":57}],25:[function(e,t,n){var r=e("../internals/classof"),i=e("../internals/iterators"),a=e("../internals/well-known-symbol")("iterator");t.exports=function(e){if(null!=e)return e[a]||e["@@iterator"]||i[r(e)]}},{"../internals/classof":10,"../internals/iterators":40,"../internals/well-known-symbol":77}],26:[function(e,t,n){var r=e("../internals/an-object"),i=e("../internals/get-iterator-method");t.exports=function(e){var t=i(e);if("function"!=typeof t)throw TypeError(String(e)+" is not iterable");return r(t.call(e))}},{"../internals/an-object":5,"../internals/get-iterator-method":25}],27:[function(e,t,n){(function(e){var n=function(e){return e&&e.Math==Math&&e};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof e&&e)||Function("return this")()}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],28:[function(e,t,n){var r={}.hasOwnProperty;t.exports=function(e,t){return r.call(e,t)}},{}],29:[function(e,t,n){t.exports={}},{}],30:[function(e,t,n){var r=e("../internals/get-built-in");t.exports=r("document","documentElement")},{"../internals/get-built-in":24}],31:[function(e,t,n){var r=e("../internals/descriptors"),i=e("../internals/fails"),a=e("../internals/document-create-element");t.exports=!r&&!i((function(){return 7!=Object.defineProperty(a("div"),"a",{get:function(){return 7}}).a}))},{"../internals/descriptors":18,"../internals/document-create-element":19,"../internals/fails":22}],32:[function(e,t,n){var r=e("../internals/fails"),i=e("../internals/classof-raw"),a="".split;t.exports=r((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==i(e)?a.call(e,""):Object(e)}:Object},{"../internals/classof-raw":9,"../internals/fails":22}],33:[function(e,t,n){var r=e("../internals/shared-store"),i=Function.toString;"function"!=typeof r.inspectSource&&(r.inspectSource=function(e){return i.call(e)}),t.exports=r.inspectSource},{"../internals/shared-store":64}],34:[function(e,t,n){var r,i,a,o=e("../internals/native-weak-map"),s=e("../internals/global"),l=e("../internals/is-object"),c=e("../internals/create-non-enumerable-property"),u=e("../internals/has"),f=e("../internals/shared-key"),p=e("../internals/hidden-keys"),h=s.WeakMap;if(o){var b=new h,d=b.get,y=b.has,g=b.set;r=function(e,t){return g.call(b,e,t),t},i=function(e){return d.call(b,e)||{}},a=function(e){return y.call(b,e)}}else{var v=f("state");p[v]=!0,r=function(e,t){return c(e,v,t),t},i=function(e){return u(e,v)?e[v]:{}},a=function(e){return u(e,v)}}t.exports={set:r,get:i,has:a,enforce:function(e){return a(e)?i(e):r(e,{})},getterFor:function(e){return function(t){var n;if(!l(t)||(n=i(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}}},{"../internals/create-non-enumerable-property":14,"../internals/global":27,"../internals/has":28,"../internals/hidden-keys":29,"../internals/is-object":37,"../internals/native-weak-map":43,"../internals/shared-key":63}],35:[function(e,t,n){var r=e("../internals/well-known-symbol"),i=e("../internals/iterators"),a=r("iterator"),o=Array.prototype;t.exports=function(e){return void 0!==e&&(i.Array===e||o[a]===e)}},{"../internals/iterators":40,"../internals/well-known-symbol":77}],36:[function(e,t,n){var r=e("../internals/fails"),i=/#|\.prototype\./,a=function(e,t){var n=s[o(e)];return n==c||n!=l&&("function"==typeof t?r(t):!!t)},o=a.normalize=function(e){return String(e).replace(i,".").toLowerCase()},s=a.data={},l=a.NATIVE="N",c=a.POLYFILL="P";t.exports=a},{"../internals/fails":22}],37:[function(e,t,n){t.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},{}],38:[function(e,t,n){t.exports=!1},{}],39:[function(e,t,n){"use strict";var r,i,a,o=e("../internals/object-get-prototype-of"),s=e("../internals/create-non-enumerable-property"),l=e("../internals/has"),c=e("../internals/well-known-symbol"),u=e("../internals/is-pure"),f=c("iterator"),p=!1;[].keys&&("next"in(a=[].keys())?(i=o(o(a)))!==Object.prototype&&(r=i):p=!0),null==r&&(r={}),u||l(r,f)||s(r,f,(function(){return this})),t.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:p}},{"../internals/create-non-enumerable-property":14,"../internals/has":28,"../internals/is-pure":38,"../internals/object-get-prototype-of":51,"../internals/well-known-symbol":77}],40:[function(e,t,n){arguments[4][29][0].apply(n,arguments)},{dup:29}],41:[function(e,t,n){var r=e("../internals/fails");t.exports=!!Object.getOwnPropertySymbols&&!r((function(){return!String(Symbol())}))},{"../internals/fails":22}],42:[function(e,t,n){var r=e("../internals/fails"),i=e("../internals/well-known-symbol"),a=e("../internals/is-pure"),o=i("iterator");t.exports=!r((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,n="";return e.pathname="c%20d",t.forEach((function(e,r){t.delete("b"),n+=r+e})),a&&!e.toJSON||!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[o]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==n||"x"!==new URL("http://x",void 0).host}))},{"../internals/fails":22,"../internals/is-pure":38,"../internals/well-known-symbol":77}],43:[function(e,t,n){var r=e("../internals/global"),i=e("../internals/inspect-source"),a=r.WeakMap;t.exports="function"==typeof a&&/native code/.test(i(a))},{"../internals/global":27,"../internals/inspect-source":33}],44:[function(e,t,n){"use strict";var r=e("../internals/descriptors"),i=e("../internals/fails"),a=e("../internals/object-keys"),o=e("../internals/object-get-own-property-symbols"),s=e("../internals/object-property-is-enumerable"),l=e("../internals/to-object"),c=e("../internals/indexed-object"),u=Object.assign,f=Object.defineProperty;t.exports=!u||i((function(){if(r&&1!==u({b:1},u(f({},"a",{enumerable:!0,get:function(){f(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol();return e[n]=7,"abcdefghijklmnopqrst".split("").forEach((function(e){t[e]=e})),7!=u({},e)[n]||"abcdefghijklmnopqrst"!=a(u({},t)).join("")}))?function(e,t){for(var n=l(e),i=arguments.length,u=1,f=o.f,p=s.f;i>u;)for(var h,b=c(arguments[u++]),d=f?a(b).concat(f(b)):a(b),y=d.length,g=0;y>g;)h=d[g++],r&&!p.call(b,h)||(n[h]=b[h]);return n}:u},{"../internals/descriptors":18,"../internals/fails":22,"../internals/indexed-object":32,"../internals/object-get-own-property-symbols":50,"../internals/object-keys":53,"../internals/object-property-is-enumerable":54,"../internals/to-object":72}],45:[function(e,t,n){var r,i=e("../internals/an-object"),a=e("../internals/object-define-properties"),o=e("../internals/enum-bug-keys"),s=e("../internals/hidden-keys"),l=e("../internals/html"),c=e("../internals/document-create-element"),u=e("../internals/shared-key"),f=u("IE_PROTO"),p=function(){},h=function(e){return"<script>"+e+"<\/script>"},b=function(){try{r=document.domain&&new ActiveXObject("htmlfile")}catch(e){}var e,t;b=r?function(e){e.write(h("")),e.close();var t=e.parentWindow.Object;return e=null,t}(r):((t=c("iframe")).style.display="none",l.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(h("document.F=Object")),e.close(),e.F);for(var n=o.length;n--;)delete b.prototype[o[n]];return b()};s[f]=!0,t.exports=Object.create||function(e,t){var n;return null!==e?(p.prototype=i(e),n=new p,p.prototype=null,n[f]=e):n=b(),void 0===t?n:a(n,t)}},{"../internals/an-object":5,"../internals/document-create-element":19,"../internals/enum-bug-keys":20,"../internals/hidden-keys":29,"../internals/html":30,"../internals/object-define-properties":46,"../internals/shared-key":63}],46:[function(e,t,n){var r=e("../internals/descriptors"),i=e("../internals/object-define-property"),a=e("../internals/an-object"),o=e("../internals/object-keys");t.exports=r?Object.defineProperties:function(e,t){a(e);for(var n,r=o(t),s=r.length,l=0;s>l;)i.f(e,n=r[l++],t[n]);return e}},{"../internals/an-object":5,"../internals/descriptors":18,"../internals/object-define-property":47,"../internals/object-keys":53}],47:[function(e,t,n){var r=e("../internals/descriptors"),i=e("../internals/ie8-dom-define"),a=e("../internals/an-object"),o=e("../internals/to-primitive"),s=Object.defineProperty;n.f=r?s:function(e,t,n){if(a(e),t=o(t,!0),a(n),i)try{return s(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},{"../internals/an-object":5,"../internals/descriptors":18,"../internals/ie8-dom-define":31,"../internals/to-primitive":73}],48:[function(e,t,n){var r=e("../internals/descriptors"),i=e("../internals/object-property-is-enumerable"),a=e("../internals/create-property-descriptor"),o=e("../internals/to-indexed-object"),s=e("../internals/to-primitive"),l=e("../internals/has"),c=e("../internals/ie8-dom-define"),u=Object.getOwnPropertyDescriptor;n.f=r?u:function(e,t){if(e=o(e),t=s(t,!0),c)try{return u(e,t)}catch(e){}if(l(e,t))return a(!i.f.call(e,t),e[t])}},{"../internals/create-property-descriptor":15,"../internals/descriptors":18,"../internals/has":28,"../internals/ie8-dom-define":31,"../internals/object-property-is-enumerable":54,"../internals/to-indexed-object":69,"../internals/to-primitive":73}],49:[function(e,t,n){var r=e("../internals/object-keys-internal"),i=e("../internals/enum-bug-keys").concat("length","prototype");n.f=Object.getOwnPropertyNames||function(e){return r(e,i)}},{"../internals/enum-bug-keys":20,"../internals/object-keys-internal":52}],50:[function(e,t,n){n.f=Object.getOwnPropertySymbols},{}],51:[function(e,t,n){var r=e("../internals/has"),i=e("../internals/to-object"),a=e("../internals/shared-key"),o=e("../internals/correct-prototype-getter"),s=a("IE_PROTO"),l=Object.prototype;t.exports=o?Object.getPrototypeOf:function(e){return e=i(e),r(e,s)?e[s]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?l:null}},{"../internals/correct-prototype-getter":12,"../internals/has":28,"../internals/shared-key":63,"../internals/to-object":72}],52:[function(e,t,n){var r=e("../internals/has"),i=e("../internals/to-indexed-object"),a=e("../internals/array-includes").indexOf,o=e("../internals/hidden-keys");t.exports=function(e,t){var n,s=i(e),l=0,c=[];for(n in s)!r(o,n)&&r(s,n)&&c.push(n);for(;t.length>l;)r(s,n=t[l++])&&(~a(c,n)||c.push(n));return c}},{"../internals/array-includes":7,"../internals/has":28,"../internals/hidden-keys":29,"../internals/to-indexed-object":69}],53:[function(e,t,n){var r=e("../internals/object-keys-internal"),i=e("../internals/enum-bug-keys");t.exports=Object.keys||function(e){return r(e,i)}},{"../internals/enum-bug-keys":20,"../internals/object-keys-internal":52}],54:[function(e,t,n){"use strict";var r={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,a=i&&!r.call({1:2},1);n.f=a?function(e){var t=i(this,e);return!!t&&t.enumerable}:r},{}],55:[function(e,t,n){var r=e("../internals/an-object"),i=e("../internals/a-possible-prototype");t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),t=n instanceof Array}catch(e){}return function(n,a){return r(n),i(a),t?e.call(n,a):n.__proto__=a,n}}():void 0)},{"../internals/a-possible-prototype":2,"../internals/an-object":5}],56:[function(e,t,n){var r=e("../internals/get-built-in"),i=e("../internals/object-get-own-property-names"),a=e("../internals/object-get-own-property-symbols"),o=e("../internals/an-object");t.exports=r("Reflect","ownKeys")||function(e){var t=i.f(o(e)),n=a.f;return n?t.concat(n(e)):t}},{"../internals/an-object":5,"../internals/get-built-in":24,"../internals/object-get-own-property-names":49,"../internals/object-get-own-property-symbols":50}],57:[function(e,t,n){var r=e("../internals/global");t.exports=r},{"../internals/global":27}],58:[function(e,t,n){var r=e("../internals/redefine");t.exports=function(e,t,n){for(var i in t)r(e,i,t[i],n);return e}},{"../internals/redefine":59}],59:[function(e,t,n){var r=e("../internals/global"),i=e("../internals/create-non-enumerable-property"),a=e("../internals/has"),o=e("../internals/set-global"),s=e("../internals/inspect-source"),l=e("../internals/internal-state"),c=l.get,u=l.enforce,f=String(String).split("String");(t.exports=function(e,t,n,s){var l=!!s&&!!s.unsafe,c=!!s&&!!s.enumerable,p=!!s&&!!s.noTargetGet;"function"==typeof n&&("string"!=typeof t||a(n,"name")||i(n,"name",t),u(n).source=f.join("string"==typeof t?t:"")),e!==r?(l?!p&&e[t]&&(c=!0):delete e[t],c?e[t]=n:i(e,t,n)):c?e[t]=n:o(t,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&c(this).source||s(this)}))},{"../internals/create-non-enumerable-property":14,"../internals/global":27,"../internals/has":28,"../internals/inspect-source":33,"../internals/internal-state":34,"../internals/set-global":61}],60:[function(e,t,n){t.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},{}],61:[function(e,t,n){var r=e("../internals/global"),i=e("../internals/create-non-enumerable-property");t.exports=function(e,t){try{i(r,e,t)}catch(n){r[e]=t}return t}},{"../internals/create-non-enumerable-property":14,"../internals/global":27}],62:[function(e,t,n){var r=e("../internals/object-define-property").f,i=e("../internals/has"),a=e("../internals/well-known-symbol")("toStringTag");t.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,a)&&r(e,a,{configurable:!0,value:t})}},{"../internals/has":28,"../internals/object-define-property":47,"../internals/well-known-symbol":77}],63:[function(e,t,n){var r=e("../internals/shared"),i=e("../internals/uid"),a=r("keys");t.exports=function(e){return a[e]||(a[e]=i(e))}},{"../internals/shared":65,"../internals/uid":75}],64:[function(e,t,n){var r=e("../internals/global"),i=e("../internals/set-global"),a=r["__core-js_shared__"]||i("__core-js_shared__",{});t.exports=a},{"../internals/global":27,"../internals/set-global":61}],65:[function(e,t,n){var r=e("../internals/is-pure"),i=e("../internals/shared-store");(t.exports=function(e,t){return i[e]||(i[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.6.4",mode:r?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},{"../internals/is-pure":38,"../internals/shared-store":64}],66:[function(e,t,n){var r=e("../internals/to-integer"),i=e("../internals/require-object-coercible"),a=function(e){return function(t,n){var a,o,s=String(i(t)),l=r(n),c=s.length;return l<0||l>=c?e?"":void 0:(a=s.charCodeAt(l))<55296||a>56319||l+1===c||(o=s.charCodeAt(l+1))<56320||o>57343?e?s.charAt(l):a:e?s.slice(l,l+2):o-56320+(a-55296<<10)+65536}};t.exports={codeAt:a(!1),charAt:a(!0)}},{"../internals/require-object-coercible":60,"../internals/to-integer":70}],67:[function(e,t,n){"use strict";var r=/[^\0-\u007E]/,i=/[.\u3002\uFF0E\uFF61]/g,a="Overflow: input needs wider integers to process",o=Math.floor,s=String.fromCharCode,l=function(e){return e+22+75*(e<26)},c=function(e,t,n){var r=0;for(e=n?o(e/700):e>>1,e+=o(e/t);e>455;r+=36)e=o(e/35);return o(r+36*e/(e+38))},u=function(e){var t,n,r=[],i=(e=function(e){for(var t=[],n=0,r=e.length;n<r;){var i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){var a=e.charCodeAt(n++);56320==(64512&a)?t.push(((1023&i)<<10)+(1023&a)+65536):(t.push(i),n--)}else t.push(i)}return t}(e)).length,u=128,f=0,p=72;for(t=0;t<e.length;t++)(n=e[t])<128&&r.push(s(n));var h=r.length,b=h;for(h&&r.push("-");b<i;){var d=2147483647;for(t=0;t<e.length;t++)(n=e[t])>=u&&n<d&&(d=n);var y=b+1;if(d-u>o((2147483647-f)/y))throw RangeError(a);for(f+=(d-u)*y,u=d,t=0;t<e.length;t++){if((n=e[t])<u&&++f>2147483647)throw RangeError(a);if(n==u){for(var g=f,v=36;;v+=36){var m=v<=p?1:v>=p+26?26:v-p;if(g<m)break;var w=g-m,j=36-m;r.push(s(l(m+w%j))),g=o(w/j)}r.push(s(l(g))),p=c(f,y,b==h),f=0,++b}}++f,++u}return r.join("")};t.exports=function(e){var t,n,a=[],o=e.toLowerCase().replace(i,".").split(".");for(t=0;t<o.length;t++)n=o[t],a.push(r.test(n)?"xn--"+u(n):n);return a.join(".")}},{}],68:[function(e,t,n){var r=e("../internals/to-integer"),i=Math.max,a=Math.min;t.exports=function(e,t){var n=r(e);return n<0?i(n+t,0):a(n,t)}},{"../internals/to-integer":70}],69:[function(e,t,n){var r=e("../internals/indexed-object"),i=e("../internals/require-object-coercible");t.exports=function(e){return r(i(e))}},{"../internals/indexed-object":32,"../internals/require-object-coercible":60}],70:[function(e,t,n){var r=Math.ceil,i=Math.floor;t.exports=function(e){return isNaN(e=+e)?0:(e>0?i:r)(e)}},{}],71:[function(e,t,n){var r=e("../internals/to-integer"),i=Math.min;t.exports=function(e){return e>0?i(r(e),9007199254740991):0}},{"../internals/to-integer":70}],72:[function(e,t,n){var r=e("../internals/require-object-coercible");t.exports=function(e){return Object(r(e))}},{"../internals/require-object-coercible":60}],73:[function(e,t,n){var r=e("../internals/is-object");t.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},{"../internals/is-object":37}],74:[function(e,t,n){var r={};r[e("../internals/well-known-symbol")("toStringTag")]="z",t.exports="[object z]"===String(r)},{"../internals/well-known-symbol":77}],75:[function(e,t,n){var r=0,i=Math.random();t.exports=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++r+i).toString(36)}},{}],76:[function(e,t,n){var r=e("../internals/native-symbol");t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},{"../internals/native-symbol":41}],77:[function(e,t,n){var r=e("../internals/global"),i=e("../internals/shared"),a=e("../internals/has"),o=e("../internals/uid"),s=e("../internals/native-symbol"),l=e("../internals/use-symbol-as-uid"),c=i("wks"),u=r.Symbol,f=l?u:u&&u.withoutSetter||o;t.exports=function(e){return a(c,e)||(s&&a(u,e)?c[e]=u[e]:c[e]=f("Symbol."+e)),c[e]}},{"../internals/global":27,"../internals/has":28,"../internals/native-symbol":41,"../internals/shared":65,"../internals/uid":75,"../internals/use-symbol-as-uid":76}],78:[function(e,t,n){"use strict";var r=e("../internals/to-indexed-object"),i=e("../internals/add-to-unscopables"),a=e("../internals/iterators"),o=e("../internals/internal-state"),s=e("../internals/define-iterator"),l=o.set,c=o.getterFor("Array Iterator");t.exports=s(Array,"Array",(function(e,t){l(this,{type:"Array Iterator",target:r(e),index:0,kind:t})}),(function(){var e=c(this),t=e.target,n=e.kind,r=e.index++;return!t||r>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:t[r],done:!1}:{value:[r,t[r]],done:!1}}),"values"),a.Arguments=a.Array,i("keys"),i("values"),i("entries")},{"../internals/add-to-unscopables":3,"../internals/define-iterator":17,"../internals/internal-state":34,"../internals/iterators":40,"../internals/to-indexed-object":69}],79:[function(e,t,n){"use strict";var r=e("../internals/string-multibyte").charAt,i=e("../internals/internal-state"),a=e("../internals/define-iterator"),o=i.set,s=i.getterFor("String Iterator");a(String,"String",(function(e){o(this,{type:"String Iterator",string:String(e),index:0})}),(function(){var e,t=s(this),n=t.string,i=t.index;return i>=n.length?{value:void 0,done:!0}:(e=r(n,i),t.index+=e.length,{value:e,done:!1})}))},{"../internals/define-iterator":17,"../internals/internal-state":34,"../internals/string-multibyte":66}],80:[function(e,t,n){"use strict";e("../modules/es.array.iterator");var r=e("../internals/export"),i=e("../internals/get-built-in"),a=e("../internals/native-url"),o=e("../internals/redefine"),s=e("../internals/redefine-all"),l=e("../internals/set-to-string-tag"),c=e("../internals/create-iterator-constructor"),u=e("../internals/internal-state"),f=e("../internals/an-instance"),p=e("../internals/has"),h=e("../internals/function-bind-context"),b=e("../internals/classof"),d=e("../internals/an-object"),y=e("../internals/is-object"),g=e("../internals/object-create"),v=e("../internals/create-property-descriptor"),m=e("../internals/get-iterator"),w=e("../internals/get-iterator-method"),j=e("../internals/well-known-symbol"),x=i("fetch"),k=i("Headers"),S=j("iterator"),A=u.set,O=u.getterFor("URLSearchParams"),R=u.getterFor("URLSearchParamsIterator"),L=/\+/g,U=Array(4),P=function(e){return U[e-1]||(U[e-1]=RegExp("((?:%[\\da-f]{2}){"+e+"})","gi"))},I=function(e){try{return decodeURIComponent(e)}catch(t){return e}},q=function(e){var t=e.replace(L," "),n=4;try{return decodeURIComponent(t)}catch(e){for(;n;)t=t.replace(P(n--),I);return t}},E=/[!'()~]|%20/g,_={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},T=function(e){return _[e]},B=function(e){return encodeURIComponent(e).replace(E,T)},F=function(e,t){if(t)for(var n,r,i=t.split("&"),a=0;a<i.length;)(n=i[a++]).length&&(r=n.split("="),e.push({key:q(r.shift()),value:q(r.join("="))}))},C=function(e){this.entries.length=0,F(this.entries,e)},M=function(e,t){if(e<t)throw TypeError("Not enough arguments")},N=c((function(e,t){A(this,{type:"URLSearchParamsIterator",iterator:m(O(e).entries),kind:t})}),"Iterator",(function(){var e=R(this),t=e.kind,n=e.iterator.next(),r=n.value;return n.done||(n.value="keys"===t?r.key:"values"===t?r.value:[r.key,r.value]),n})),D=function(){f(this,D,"URLSearchParams");var e,t,n,r,i,a,o,s,l,c=arguments.length>0?arguments[0]:void 0,u=this,h=[];if(A(u,{type:"URLSearchParams",entries:h,updateURL:function(){},updateSearchParams:C}),void 0!==c)if(y(c))if("function"==typeof(e=w(c)))for(n=(t=e.call(c)).next;!(r=n.call(t)).done;){if((o=(a=(i=m(d(r.value))).next).call(i)).done||(s=a.call(i)).done||!a.call(i).done)throw TypeError("Expected sequence with length 2");h.push({key:o.value+"",value:s.value+""})}else for(l in c)p(c,l)&&h.push({key:l,value:c[l]+""});else F(h,"string"==typeof c?"?"===c.charAt(0)?c.slice(1):c:c+"")},z=D.prototype;s(z,{append:function(e,t){M(arguments.length,2);var n=O(this);n.entries.push({key:e+"",value:t+""}),n.updateURL()},delete:function(e){M(arguments.length,1);for(var t=O(this),n=t.entries,r=e+"",i=0;i<n.length;)n[i].key===r?n.splice(i,1):i++;t.updateURL()},get:function(e){M(arguments.length,1);for(var t=O(this).entries,n=e+"",r=0;r<t.length;r++)if(t[r].key===n)return t[r].value;return null},getAll:function(e){M(arguments.length,1);for(var t=O(this).entries,n=e+"",r=[],i=0;i<t.length;i++)t[i].key===n&&r.push(t[i].value);return r},has:function(e){M(arguments.length,1);for(var t=O(this).entries,n=e+"",r=0;r<t.length;)if(t[r++].key===n)return!0;return!1},set:function(e,t){M(arguments.length,1);for(var n,r=O(this),i=r.entries,a=!1,o=e+"",s=t+"",l=0;l<i.length;l++)(n=i[l]).key===o&&(a?i.splice(l--,1):(a=!0,n.value=s));a||i.push({key:o,value:s}),r.updateURL()},sort:function(){var e,t,n,r=O(this),i=r.entries,a=i.slice();for(i.length=0,n=0;n<a.length;n++){for(e=a[n],t=0;t<n;t++)if(i[t].key>e.key){i.splice(t,0,e);break}t===n&&i.push(e)}r.updateURL()},forEach:function(e){for(var t,n=O(this).entries,r=h(e,arguments.length>1?arguments[1]:void 0,3),i=0;i<n.length;)r((t=n[i++]).value,t.key,this)},keys:function(){return new N(this,"keys")},values:function(){return new N(this,"values")},entries:function(){return new N(this,"entries")}},{enumerable:!0}),o(z,S,z.entries),o(z,"toString",(function(){for(var e,t=O(this).entries,n=[],r=0;r<t.length;)e=t[r++],n.push(B(e.key)+"="+B(e.value));return n.join("&")}),{enumerable:!0}),l(D,"URLSearchParams"),r({global:!0,forced:!a},{URLSearchParams:D}),a||"function"!=typeof x||"function"!=typeof k||r({global:!0,enumerable:!0,forced:!0},{fetch:function(e){var t,n,r,i=[e];return arguments.length>1&&(t=arguments[1],y(t)&&(n=t.body,"URLSearchParams"===b(n)&&((r=t.headers?new k(t.headers):new k).has("content-type")||r.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),t=g(t,{body:v(0,String(n)),headers:v(0,r)}))),i.push(t)),x.apply(this,i)}}),t.exports={URLSearchParams:D,getState:O}},{"../internals/an-instance":4,"../internals/an-object":5,"../internals/classof":10,"../internals/create-iterator-constructor":13,"../internals/create-property-descriptor":15,"../internals/export":21,"../internals/function-bind-context":23,"../internals/get-built-in":24,"../internals/get-iterator":26,"../internals/get-iterator-method":25,"../internals/has":28,"../internals/internal-state":34,"../internals/is-object":37,"../internals/native-url":42,"../internals/object-create":45,"../internals/redefine":59,"../internals/redefine-all":58,"../internals/set-to-string-tag":62,"../internals/well-known-symbol":77,"../modules/es.array.iterator":78}],81:[function(e,t,n){"use strict";e("../modules/es.string.iterator");var r,i=e("../internals/export"),a=e("../internals/descriptors"),o=e("../internals/native-url"),s=e("../internals/global"),l=e("../internals/object-define-properties"),c=e("../internals/redefine"),u=e("../internals/an-instance"),f=e("../internals/has"),p=e("../internals/object-assign"),h=e("../internals/array-from"),b=e("../internals/string-multibyte").codeAt,d=e("../internals/string-punycode-to-ascii"),y=e("../internals/set-to-string-tag"),g=e("../modules/web.url-search-params"),v=e("../internals/internal-state"),m=s.URL,w=g.URLSearchParams,j=g.getState,x=v.set,k=v.getterFor("URL"),S=Math.floor,A=Math.pow,O=/[A-Za-z]/,R=/[\d+\-.A-Za-z]/,L=/\d/,U=/^(0x|0X)/,P=/^[0-7]+$/,I=/^\d+$/,q=/^[\dA-Fa-f]+$/,E=/[\u0000\u0009\u000A\u000D #%/:?@[\\]]/,_=/[\u0000\u0009\u000A\u000D #/:?@[\\]]/,T=/^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g,B=/[\u0009\u000A\u000D]/g,F=function(e,t){var n,r,i;if("["==t.charAt(0)){if("]"!=t.charAt(t.length-1))return"Invalid host";if(!(n=M(t.slice(1,-1))))return"Invalid host";e.host=n}else if(Y(e)){if(t=d(t),E.test(t))return"Invalid host";if(null===(n=C(t)))return"Invalid host";e.host=n}else{if(_.test(t))return"Invalid host";for(n="",r=h(t),i=0;i<r.length;i++)n+=$(r[i],D);e.host=n}},C=function(e){var t,n,r,i,a,o,s,l=e.split(".");if(l.length&&""==l[l.length-1]&&l.pop(),(t=l.length)>4)return e;for(n=[],r=0;r<t;r++){if(""==(i=l[r]))return e;if(a=10,i.length>1&&"0"==i.charAt(0)&&(a=U.test(i)?16:8,i=i.slice(8==a?1:2)),""===i)o=0;else{if(!(10==a?I:8==a?P:q).test(i))return e;o=parseInt(i,a)}n.push(o)}for(r=0;r<t;r++)if(o=n[r],r==t-1){if(o>=A(256,5-t))return null}else if(o>255)return null;for(s=n.pop(),r=0;r<n.length;r++)s+=n[r]*A(256,3-r);return s},M=function(e){var t,n,r,i,a,o,s,l=[0,0,0,0,0,0,0,0],c=0,u=null,f=0,p=function(){return e.charAt(f)};if(":"==p()){if(":"!=e.charAt(1))return;f+=2,u=++c}for(;p();){if(8==c)return;if(":"!=p()){for(t=n=0;n<4&&q.test(p());)t=16*t+parseInt(p(),16),f++,n++;if("."==p()){if(0==n)return;if(f-=n,c>6)return;for(r=0;p();){if(i=null,r>0){if(!("."==p()&&r<4))return;f++}if(!L.test(p()))return;for(;L.test(p());){if(a=parseInt(p(),10),null===i)i=a;else{if(0==i)return;i=10*i+a}if(i>255)return;f++}l[c]=256*l[c]+i,2!=++r&&4!=r||c++}if(4!=r)return;break}if(":"==p()){if(f++,!p())return}else if(p())return;l[c++]=t}else{if(null!==u)return;f++,u=++c}}if(null!==u)for(o=c-u,c=7;0!=c&&o>0;)s=l[c],l[c--]=l[u+o-1],l[u+--o]=s;else if(8!=c)return;return l},N=function(e){var t,n,r,i;if("number"==typeof e){for(t=[],n=0;n<4;n++)t.unshift(e%256),e=S(e/256);return t.join(".")}if("object"==typeof e){for(t="",r=function(e){for(var t=null,n=1,r=null,i=0,a=0;a<8;a++)0!==e[a]?(i>n&&(t=r,n=i),r=null,i=0):(null===r&&(r=a),++i);return i>n&&(t=r,n=i),t}(e),n=0;n<8;n++)i&&0===e[n]||(i&&(i=!1),r===n?(t+=n?":":"::",i=!0):(t+=e[n].toString(16),n<7&&(t+=":")));return"["+t+"]"}return e},D={},z=p({},D,{" ":1,'"':1,"<":1,">":1,"`":1}),G=p({},z,{"#":1,"?":1,"{":1,"}":1}),W=p({},G,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),$=function(e,t){var n=b(e,0);return n>32&&n<127&&!f(t,e)?e:encodeURIComponent(e)},J={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Y=function(e){return f(J,e.scheme)},X=function(e){return""!=e.username||""!=e.password},Z=function(e){return!e.host||e.cannotBeABaseURL||"file"==e.scheme},H=function(e,t){var n;return 2==e.length&&O.test(e.charAt(0))&&(":"==(n=e.charAt(1))||!t&&"|"==n)},K=function(e){var t;return e.length>1&&H(e.slice(0,2))&&(2==e.length||"/"===(t=e.charAt(2))||"\\"===t||"?"===t||"#"===t)},V=function(e){var t=e.path,n=t.length;!n||"file"==e.scheme&&1==n&&H(t[0],!0)||t.pop()},Q=function(e){return"."===e||"%2e"===e.toLowerCase()},ee={},te={},ne={},re={},ie={},ae={},oe={},se={},le={},ce={},ue={},fe={},pe={},he={},be={},de={},ye={},ge={},ve={},me={},we={},je=function(e,t,n,i){var a,o,s,l,c,u=n||ee,p=0,b="",d=!1,y=!1,g=!1;for(n||(e.scheme="",e.username="",e.password="",e.host=null,e.port=null,e.path=[],e.query=null,e.fragment=null,e.cannotBeABaseURL=!1,t=t.replace(T,"")),t=t.replace(B,""),a=h(t);p<=a.length;){switch(o=a[p],u){case ee:if(!o||!O.test(o)){if(n)return"Invalid scheme";u=ne;continue}b+=o.toLowerCase(),u=te;break;case te:if(o&&(R.test(o)||"+"==o||"-"==o||"."==o))b+=o.toLowerCase();else{if(":"!=o){if(n)return"Invalid scheme";b="",u=ne,p=0;continue}if(n&&(Y(e)!=f(J,b)||"file"==b&&(X(e)||null!==e.port)||"file"==e.scheme&&!e.host))return;if(e.scheme=b,n)return void(Y(e)&&J[e.scheme]==e.port&&(e.port=null));b="","file"==e.scheme?u=he:Y(e)&&i&&i.scheme==e.scheme?u=re:Y(e)?u=se:"/"==a[p+1]?(u=ie,p++):(e.cannotBeABaseURL=!0,e.path.push(""),u=ve)}break;case ne:if(!i||i.cannotBeABaseURL&&"#"!=o)return"Invalid scheme";if(i.cannotBeABaseURL&&"#"==o){e.scheme=i.scheme,e.path=i.path.slice(),e.query=i.query,e.fragment="",e.cannotBeABaseURL=!0,u=we;break}u="file"==i.scheme?he:ae;continue;case re:if("/"!=o||"/"!=a[p+1]){u=ae;continue}u=le,p++;break;case ie:if("/"==o){u=ce;break}u=ge;continue;case ae:if(e.scheme=i.scheme,o==r)e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,e.path=i.path.slice(),e.query=i.query;else if("/"==o||"\\"==o&&Y(e))u=oe;else if("?"==o)e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,e.path=i.path.slice(),e.query="",u=me;else{if("#"!=o){e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,e.path=i.path.slice(),e.path.pop(),u=ge;continue}e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,e.path=i.path.slice(),e.query=i.query,e.fragment="",u=we}break;case oe:if(!Y(e)||"/"!=o&&"\\"!=o){if("/"!=o){e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,u=ge;continue}u=ce}else u=le;break;case se:if(u=le,"/"!=o||"/"!=b.charAt(p+1))continue;p++;break;case le:if("/"!=o&&"\\"!=o){u=ce;continue}break;case ce:if("@"==o){d&&(b="%40"+b),d=!0,s=h(b);for(var v=0;v<s.length;v++){var m=s[v];if(":"!=m||g){var w=$(m,W);g?e.password+=w:e.username+=w}else g=!0}b=""}else if(o==r||"/"==o||"?"==o||"#"==o||"\\"==o&&Y(e)){if(d&&""==b)return"Invalid authority";p-=h(b).length+1,b="",u=ue}else b+=o;break;case ue:case fe:if(n&&"file"==e.scheme){u=de;continue}if(":"!=o||y){if(o==r||"/"==o||"?"==o||"#"==o||"\\"==o&&Y(e)){if(Y(e)&&""==b)return"Invalid host";if(n&&""==b&&(X(e)||null!==e.port))return;if(l=F(e,b))return l;if(b="",u=ye,n)return;continue}"["==o?y=!0:"]"==o&&(y=!1),b+=o}else{if(""==b)return"Invalid host";if(l=F(e,b))return l;if(b="",u=pe,n==fe)return}break;case pe:if(!L.test(o)){if(o==r||"/"==o||"?"==o||"#"==o||"\\"==o&&Y(e)||n){if(""!=b){var j=parseInt(b,10);if(j>65535)return"Invalid port";e.port=Y(e)&&j===J[e.scheme]?null:j,b=""}if(n)return;u=ye;continue}return"Invalid port"}b+=o;break;case he:if(e.scheme="file","/"==o||"\\"==o)u=be;else{if(!i||"file"!=i.scheme){u=ge;continue}if(o==r)e.host=i.host,e.path=i.path.slice(),e.query=i.query;else if("?"==o)e.host=i.host,e.path=i.path.slice(),e.query="",u=me;else{if("#"!=o){K(a.slice(p).join(""))||(e.host=i.host,e.path=i.path.slice(),V(e)),u=ge;continue}e.host=i.host,e.path=i.path.slice(),e.query=i.query,e.fragment="",u=we}}break;case be:if("/"==o||"\\"==o){u=de;break}i&&"file"==i.scheme&&!K(a.slice(p).join(""))&&(H(i.path[0],!0)?e.path.push(i.path[0]):e.host=i.host),u=ge;continue;case de:if(o==r||"/"==o||"\\"==o||"?"==o||"#"==o){if(!n&&H(b))u=ge;else if(""==b){if(e.host="",n)return;u=ye}else{if(l=F(e,b))return l;if("localhost"==e.host&&(e.host=""),n)return;b="",u=ye}continue}b+=o;break;case ye:if(Y(e)){if(u=ge,"/"!=o&&"\\"!=o)continue}else if(n||"?"!=o)if(n||"#"!=o){if(o!=r&&(u=ge,"/"!=o))continue}else e.fragment="",u=we;else e.query="",u=me;break;case ge:if(o==r||"/"==o||"\\"==o&&Y(e)||!n&&("?"==o||"#"==o)){if(".."===(c=(c=b).toLowerCase())||"%2e."===c||".%2e"===c||"%2e%2e"===c?(V(e),"/"==o||"\\"==o&&Y(e)||e.path.push("")):Q(b)?"/"==o||"\\"==o&&Y(e)||e.path.push(""):("file"==e.scheme&&!e.path.length&&H(b)&&(e.host&&(e.host=""),b=b.charAt(0)+":"),e.path.push(b)),b="","file"==e.scheme&&(o==r||"?"==o||"#"==o))for(;e.path.length>1&&""===e.path[0];)e.path.shift();"?"==o?(e.query="",u=me):"#"==o&&(e.fragment="",u=we)}else b+=$(o,G);break;case ve:"?"==o?(e.query="",u=me):"#"==o?(e.fragment="",u=we):o!=r&&(e.path[0]+=$(o,D));break;case me:n||"#"!=o?o!=r&&("'"==o&&Y(e)?e.query+="%27":e.query+="#"==o?"%23":$(o,D)):(e.fragment="",u=we);break;case we:o!=r&&(e.fragment+=$(o,z))}p++}},xe=function(e){var t,n,r=u(this,xe,"URL"),i=arguments.length>1?arguments[1]:void 0,o=String(e),s=x(r,{type:"URL"});if(void 0!==i)if(i instanceof xe)t=k(i);else if(n=je(t={},String(i)))throw TypeError(n);if(n=je(s,o,null,t))throw TypeError(n);var l=s.searchParams=new w,c=j(l);c.updateSearchParams(s.query),c.updateURL=function(){s.query=String(l)||null},a||(r.href=Se.call(r),r.origin=Ae.call(r),r.protocol=Oe.call(r),r.username=Re.call(r),r.password=Le.call(r),r.host=Ue.call(r),r.hostname=Pe.call(r),r.port=Ie.call(r),r.pathname=qe.call(r),r.search=Ee.call(r),r.searchParams=_e.call(r),r.hash=Te.call(r))},ke=xe.prototype,Se=function(){var e=k(this),t=e.scheme,n=e.username,r=e.password,i=e.host,a=e.port,o=e.path,s=e.query,l=e.fragment,c=t+":";return null!==i?(c+="//",X(e)&&(c+=n+(r?":"+r:"")+"@"),c+=N(i),null!==a&&(c+=":"+a)):"file"==t&&(c+="//"),c+=e.cannotBeABaseURL?o[0]:o.length?"/"+o.join("/"):"",null!==s&&(c+="?"+s),null!==l&&(c+="#"+l),c},Ae=function(){var e=k(this),t=e.scheme,n=e.port;if("blob"==t)try{return new URL(t.path[0]).origin}catch(e){return"null"}return"file"!=t&&Y(e)?t+"://"+N(e.host)+(null!==n?":"+n:""):"null"},Oe=function(){return k(this).scheme+":"},Re=function(){return k(this).username},Le=function(){return k(this).password},Ue=function(){var e=k(this),t=e.host,n=e.port;return null===t?"":null===n?N(t):N(t)+":"+n},Pe=function(){var e=k(this).host;return null===e?"":N(e)},Ie=function(){var e=k(this).port;return null===e?"":String(e)},qe=function(){var e=k(this),t=e.path;return e.cannotBeABaseURL?t[0]:t.length?"/"+t.join("/"):""},Ee=function(){var e=k(this).query;return e?"?"+e:""},_e=function(){return k(this).searchParams},Te=function(){var e=k(this).fragment;return e?"#"+e:""},Be=function(e,t){return{get:e,set:t,configurable:!0,enumerable:!0}};if(a&&l(ke,{href:Be(Se,(function(e){var t=k(this),n=String(e),r=je(t,n);if(r)throw TypeError(r);j(t.searchParams).updateSearchParams(t.query)})),origin:Be(Ae),protocol:Be(Oe,(function(e){var t=k(this);je(t,String(e)+":",ee)})),username:Be(Re,(function(e){var t=k(this),n=h(String(e));if(!Z(t)){t.username="";for(var r=0;r<n.length;r++)t.username+=$(n[r],W)}})),password:Be(Le,(function(e){var t=k(this),n=h(String(e));if(!Z(t)){t.password="";for(var r=0;r<n.length;r++)t.password+=$(n[r],W)}})),host:Be(Ue,(function(e){var t=k(this);t.cannotBeABaseURL||je(t,String(e),ue)})),hostname:Be(Pe,(function(e){var t=k(this);t.cannotBeABaseURL||je(t,String(e),fe)})),port:Be(Ie,(function(e){var t=k(this);Z(t)||(""==(e=String(e))?t.port=null:je(t,e,pe))})),pathname:Be(qe,(function(e){var t=k(this);t.cannotBeABaseURL||(t.path=[],je(t,e+"",ye))})),search:Be(Ee,(function(e){var t=k(this);""==(e=String(e))?t.query=null:("?"==e.charAt(0)&&(e=e.slice(1)),t.query="",je(t,e,me)),j(t.searchParams).updateSearchParams(t.query)})),searchParams:Be(_e),hash:Be(Te,(function(e){var t=k(this);""!=(e=String(e))?("#"==e.charAt(0)&&(e=e.slice(1)),t.fragment="",je(t,e,we)):t.fragment=null}))}),c(ke,"toJSON",(function(){return Se.call(this)}),{enumerable:!0}),c(ke,"toString",(function(){return Se.call(this)}),{enumerable:!0}),m){var Fe=m.createObjectURL,Ce=m.revokeObjectURL;Fe&&c(xe,"createObjectURL",(function(e){return Fe.apply(m,arguments)})),Ce&&c(xe,"revokeObjectURL",(function(e){return Ce.apply(m,arguments)}))}y(xe,"URL"),i({global:!0,forced:!o,sham:!a},{URL:xe})},{"../internals/an-instance":4,"../internals/array-from":6,"../internals/descriptors":18,"../internals/export":21,"../internals/global":27,"../internals/has":28,"../internals/internal-state":34,"../internals/native-url":42,"../internals/object-assign":44,"../internals/object-define-properties":46,"../internals/redefine":59,"../internals/set-to-string-tag":62,"../internals/string-multibyte":66,"../internals/string-punycode-to-ascii":67,"../modules/es.string.iterator":79,"../modules/web.url-search-params":80}],82:[function(e,t,n){"use strict";e("../internals/export")({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return URL.prototype.toString.call(this)}})},{"../internals/export":21}],83:[function(e,t,n){e("../modules/web.url"),e("../modules/web.url.to-json"),e("../modules/web.url-search-params");var r=e("../internals/path");t.exports=r.URL},{"../internals/path":57,"../modules/web.url":81,"../modules/web.url-search-params":80,"../modules/web.url.to-json":82}]},{},[83]); vendor/wp-polyfill-inert.js 0000644 00000073016 15206720414 0012004 0 ustar 00 (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory() : typeof define === 'function' && define.amd ? define('inert', factory) : (factory()); }(this, (function () { 'use strict'; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } /** * This work is licensed under the W3C Software and Document License * (http://www.w3.org/Consortium/Legal/2015/copyright-software-and-document). */ (function () { // Return early if we're not running inside of the browser. if (typeof window === 'undefined' || typeof Element === 'undefined') { return; } // Convenience function for converting NodeLists. /** @type {typeof Array.prototype.slice} */ var slice = Array.prototype.slice; /** * IE has a non-standard name for "matches". * @type {typeof Element.prototype.matches} */ var matches = Element.prototype.matches || Element.prototype.msMatchesSelector; /** @type {string} */ var _focusableElementsString = ['a[href]', 'area[href]', 'input:not([disabled])', 'select:not([disabled])', 'textarea:not([disabled])', 'button:not([disabled])', 'details', 'summary', 'iframe', 'object', 'embed', 'video', '[contenteditable]'].join(','); /** * `InertRoot` manages a single inert subtree, i.e. a DOM subtree whose root element has an `inert` * attribute. * * Its main functions are: * * - to create and maintain a set of managed `InertNode`s, including when mutations occur in the * subtree. The `makeSubtreeUnfocusable()` method handles collecting `InertNode`s via registering * each focusable node in the subtree with the singleton `InertManager` which manages all known * focusable nodes within inert subtrees. `InertManager` ensures that a single `InertNode` * instance exists for each focusable node which has at least one inert root as an ancestor. * * - to notify all managed `InertNode`s when this subtree stops being inert (i.e. when the `inert` * attribute is removed from the root node). This is handled in the destructor, which calls the * `deregister` method on `InertManager` for each managed inert node. */ var InertRoot = function () { /** * @param {!HTMLElement} rootElement The HTMLElement at the root of the inert subtree. * @param {!InertManager} inertManager The global singleton InertManager object. */ function InertRoot(rootElement, inertManager) { _classCallCheck(this, InertRoot); /** @type {!InertManager} */ this._inertManager = inertManager; /** @type {!HTMLElement} */ this._rootElement = rootElement; /** * @type {!Set<!InertNode>} * All managed focusable nodes in this InertRoot's subtree. */ this._managedNodes = new Set(); // Make the subtree hidden from assistive technology if (this._rootElement.hasAttribute('aria-hidden')) { /** @type {?string} */ this._savedAriaHidden = this._rootElement.getAttribute('aria-hidden'); } else { this._savedAriaHidden = null; } this._rootElement.setAttribute('aria-hidden', 'true'); // Make all focusable elements in the subtree unfocusable and add them to _managedNodes this._makeSubtreeUnfocusable(this._rootElement); // Watch for: // - any additions in the subtree: make them unfocusable too // - any removals from the subtree: remove them from this inert root's managed nodes // - attribute changes: if `tabindex` is added, or removed from an intrinsically focusable // element, make that node a managed node. this._observer = new MutationObserver(this._onMutation.bind(this)); this._observer.observe(this._rootElement, { attributes: true, childList: true, subtree: true }); } /** * Call this whenever this object is about to become obsolete. This unwinds all of the state * stored in this object and updates the state of all of the managed nodes. */ _createClass(InertRoot, [{ key: 'destructor', value: function destructor() { this._observer.disconnect(); if (this._rootElement) { if (this._savedAriaHidden !== null) { this._rootElement.setAttribute('aria-hidden', this._savedAriaHidden); } else { this._rootElement.removeAttribute('aria-hidden'); } } this._managedNodes.forEach(function (inertNode) { this._unmanageNode(inertNode.node); }, this); // Note we cast the nulls to the ANY type here because: // 1) We want the class properties to be declared as non-null, or else we // need even more casts throughout this code. All bets are off if an // instance has been destroyed and a method is called. // 2) We don't want to cast "this", because we want type-aware optimizations // to know which properties we're setting. this._observer = /** @type {?} */null; this._rootElement = /** @type {?} */null; this._managedNodes = /** @type {?} */null; this._inertManager = /** @type {?} */null; } /** * @return {!Set<!InertNode>} A copy of this InertRoot's managed nodes set. */ }, { key: '_makeSubtreeUnfocusable', /** * @param {!Node} startNode */ value: function _makeSubtreeUnfocusable(startNode) { var _this2 = this; composedTreeWalk(startNode, function (node) { return _this2._visitNode(node); }); var activeElement = document.activeElement; if (!document.body.contains(startNode)) { // startNode may be in shadow DOM, so find its nearest shadowRoot to get the activeElement. var node = startNode; /** @type {!ShadowRoot|undefined} */ var root = undefined; while (node) { if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) { root = /** @type {!ShadowRoot} */node; break; } node = node.parentNode; } if (root) { activeElement = root.activeElement; } } if (startNode.contains(activeElement)) { activeElement.blur(); // In IE11, if an element is already focused, and then set to tabindex=-1 // calling blur() will not actually move the focus. // To work around this we call focus() on the body instead. if (activeElement === document.activeElement) { document.body.focus(); } } } /** * @param {!Node} node */ }, { key: '_visitNode', value: function _visitNode(node) { if (node.nodeType !== Node.ELEMENT_NODE) { return; } var element = /** @type {!HTMLElement} */node; // If a descendant inert root becomes un-inert, its descendants will still be inert because of // this inert root, so all of its managed nodes need to be adopted by this InertRoot. if (element !== this._rootElement && element.hasAttribute('inert')) { this._adoptInertRoot(element); } if (matches.call(element, _focusableElementsString) || element.hasAttribute('tabindex')) { this._manageNode(element); } } /** * Register the given node with this InertRoot and with InertManager. * @param {!Node} node */ }, { key: '_manageNode', value: function _manageNode(node) { var inertNode = this._inertManager.register(node, this); this._managedNodes.add(inertNode); } /** * Unregister the given node with this InertRoot and with InertManager. * @param {!Node} node */ }, { key: '_unmanageNode', value: function _unmanageNode(node) { var inertNode = this._inertManager.deregister(node, this); if (inertNode) { this._managedNodes['delete'](inertNode); } } /** * Unregister the entire subtree starting at `startNode`. * @param {!Node} startNode */ }, { key: '_unmanageSubtree', value: function _unmanageSubtree(startNode) { var _this3 = this; composedTreeWalk(startNode, function (node) { return _this3._unmanageNode(node); }); } /** * If a descendant node is found with an `inert` attribute, adopt its managed nodes. * @param {!HTMLElement} node */ }, { key: '_adoptInertRoot', value: function _adoptInertRoot(node) { var inertSubroot = this._inertManager.getInertRoot(node); // During initialisation this inert root may not have been registered yet, // so register it now if need be. if (!inertSubroot) { this._inertManager.setInert(node, true); inertSubroot = this._inertManager.getInertRoot(node); } inertSubroot.managedNodes.forEach(function (savedInertNode) { this._manageNode(savedInertNode.node); }, this); } /** * Callback used when mutation observer detects subtree additions, removals, or attribute changes. * @param {!Array<!MutationRecord>} records * @param {!MutationObserver} self */ }, { key: '_onMutation', value: function _onMutation(records, self) { records.forEach(function (record) { var target = /** @type {!HTMLElement} */record.target; if (record.type === 'childList') { // Manage added nodes slice.call(record.addedNodes).forEach(function (node) { this._makeSubtreeUnfocusable(node); }, this); // Un-manage removed nodes slice.call(record.removedNodes).forEach(function (node) { this._unmanageSubtree(node); }, this); } else if (record.type === 'attributes') { if (record.attributeName === 'tabindex') { // Re-initialise inert node if tabindex changes this._manageNode(target); } else if (target !== this._rootElement && record.attributeName === 'inert' && target.hasAttribute('inert')) { // If a new inert root is added, adopt its managed nodes and make sure it knows about the // already managed nodes from this inert subroot. this._adoptInertRoot(target); var inertSubroot = this._inertManager.getInertRoot(target); this._managedNodes.forEach(function (managedNode) { if (target.contains(managedNode.node)) { inertSubroot._manageNode(managedNode.node); } }); } } }, this); } }, { key: 'managedNodes', get: function get() { return new Set(this._managedNodes); } /** @return {boolean} */ }, { key: 'hasSavedAriaHidden', get: function get() { return this._savedAriaHidden !== null; } /** @param {?string} ariaHidden */ }, { key: 'savedAriaHidden', set: function set(ariaHidden) { this._savedAriaHidden = ariaHidden; } /** @return {?string} */ , get: function get() { return this._savedAriaHidden; } }]); return InertRoot; }(); /** * `InertNode` initialises and manages a single inert node. * A node is inert if it is a descendant of one or more inert root elements. * * On construction, `InertNode` saves the existing `tabindex` value for the node, if any, and * either removes the `tabindex` attribute or sets it to `-1`, depending on whether the element * is intrinsically focusable or not. * * `InertNode` maintains a set of `InertRoot`s which are descendants of this `InertNode`. When an * `InertRoot` is destroyed, and calls `InertManager.deregister()`, the `InertManager` notifies the * `InertNode` via `removeInertRoot()`, which in turn destroys the `InertNode` if no `InertRoot`s * remain in the set. On destruction, `InertNode` reinstates the stored `tabindex` if one exists, * or removes the `tabindex` attribute if the element is intrinsically focusable. */ var InertNode = function () { /** * @param {!Node} node A focusable element to be made inert. * @param {!InertRoot} inertRoot The inert root element associated with this inert node. */ function InertNode(node, inertRoot) { _classCallCheck(this, InertNode); /** @type {!Node} */ this._node = node; /** @type {boolean} */ this._overrodeFocusMethod = false; /** * @type {!Set<!InertRoot>} The set of descendant inert roots. * If and only if this set becomes empty, this node is no longer inert. */ this._inertRoots = new Set([inertRoot]); /** @type {?number} */ this._savedTabIndex = null; /** @type {boolean} */ this._destroyed = false; // Save any prior tabindex info and make this node untabbable this.ensureUntabbable(); } /** * Call this whenever this object is about to become obsolete. * This makes the managed node focusable again and deletes all of the previously stored state. */ _createClass(InertNode, [{ key: 'destructor', value: function destructor() { this._throwIfDestroyed(); if (this._node && this._node.nodeType === Node.ELEMENT_NODE) { var element = /** @type {!HTMLElement} */this._node; if (this._savedTabIndex !== null) { element.setAttribute('tabindex', this._savedTabIndex); } else { element.removeAttribute('tabindex'); } // Use `delete` to restore native focus method. if (this._overrodeFocusMethod) { delete element.focus; } } // See note in InertRoot.destructor for why we cast these nulls to ANY. this._node = /** @type {?} */null; this._inertRoots = /** @type {?} */null; this._destroyed = true; } /** * @type {boolean} Whether this object is obsolete because the managed node is no longer inert. * If the object has been destroyed, any attempt to access it will cause an exception. */ }, { key: '_throwIfDestroyed', /** * Throw if user tries to access destroyed InertNode. */ value: function _throwIfDestroyed() { if (this.destroyed) { throw new Error('Trying to access destroyed InertNode'); } } /** @return {boolean} */ }, { key: 'ensureUntabbable', /** Save the existing tabindex value and make the node untabbable and unfocusable */ value: function ensureUntabbable() { if (this.node.nodeType !== Node.ELEMENT_NODE) { return; } var element = /** @type {!HTMLElement} */this.node; if (matches.call(element, _focusableElementsString)) { if ( /** @type {!HTMLElement} */element.tabIndex === -1 && this.hasSavedTabIndex) { return; } if (element.hasAttribute('tabindex')) { this._savedTabIndex = /** @type {!HTMLElement} */element.tabIndex; } element.setAttribute('tabindex', '-1'); if (element.nodeType === Node.ELEMENT_NODE) { element.focus = function () {}; this._overrodeFocusMethod = true; } } else if (element.hasAttribute('tabindex')) { this._savedTabIndex = /** @type {!HTMLElement} */element.tabIndex; element.removeAttribute('tabindex'); } } /** * Add another inert root to this inert node's set of managing inert roots. * @param {!InertRoot} inertRoot */ }, { key: 'addInertRoot', value: function addInertRoot(inertRoot) { this._throwIfDestroyed(); this._inertRoots.add(inertRoot); } /** * Remove the given inert root from this inert node's set of managing inert roots. * If the set of managing inert roots becomes empty, this node is no longer inert, * so the object should be destroyed. * @param {!InertRoot} inertRoot */ }, { key: 'removeInertRoot', value: function removeInertRoot(inertRoot) { this._throwIfDestroyed(); this._inertRoots['delete'](inertRoot); if (this._inertRoots.size === 0) { this.destructor(); } } }, { key: 'destroyed', get: function get() { return (/** @type {!InertNode} */this._destroyed ); } }, { key: 'hasSavedTabIndex', get: function get() { return this._savedTabIndex !== null; } /** @return {!Node} */ }, { key: 'node', get: function get() { this._throwIfDestroyed(); return this._node; } /** @param {?number} tabIndex */ }, { key: 'savedTabIndex', set: function set(tabIndex) { this._throwIfDestroyed(); this._savedTabIndex = tabIndex; } /** @return {?number} */ , get: function get() { this._throwIfDestroyed(); return this._savedTabIndex; } }]); return InertNode; }(); /** * InertManager is a per-document singleton object which manages all inert roots and nodes. * * When an element becomes an inert root by having an `inert` attribute set and/or its `inert` * property set to `true`, the `setInert` method creates an `InertRoot` object for the element. * The `InertRoot` in turn registers itself as managing all of the element's focusable descendant * nodes via the `register()` method. The `InertManager` ensures that a single `InertNode` instance * is created for each such node, via the `_managedNodes` map. */ var InertManager = function () { /** * @param {!Document} document */ function InertManager(document) { _classCallCheck(this, InertManager); if (!document) { throw new Error('Missing required argument; InertManager needs to wrap a document.'); } /** @type {!Document} */ this._document = document; /** * All managed nodes known to this InertManager. In a map to allow looking up by Node. * @type {!Map<!Node, !InertNode>} */ this._managedNodes = new Map(); /** * All inert roots known to this InertManager. In a map to allow looking up by Node. * @type {!Map<!Node, !InertRoot>} */ this._inertRoots = new Map(); /** * Observer for mutations on `document.body`. * @type {!MutationObserver} */ this._observer = new MutationObserver(this._watchForInert.bind(this)); // Add inert style. addInertStyle(document.head || document.body || document.documentElement); // Wait for document to be loaded. if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', this._onDocumentLoaded.bind(this)); } else { this._onDocumentLoaded(); } } /** * Set whether the given element should be an inert root or not. * @param {!HTMLElement} root * @param {boolean} inert */ _createClass(InertManager, [{ key: 'setInert', value: function setInert(root, inert) { if (inert) { if (this._inertRoots.has(root)) { // element is already inert return; } var inertRoot = new InertRoot(root, this); root.setAttribute('inert', ''); this._inertRoots.set(root, inertRoot); // If not contained in the document, it must be in a shadowRoot. // Ensure inert styles are added there. if (!this._document.body.contains(root)) { var parent = root.parentNode; while (parent) { if (parent.nodeType === 11) { addInertStyle(parent); } parent = parent.parentNode; } } } else { if (!this._inertRoots.has(root)) { // element is already non-inert return; } var _inertRoot = this._inertRoots.get(root); _inertRoot.destructor(); this._inertRoots['delete'](root); root.removeAttribute('inert'); } } /** * Get the InertRoot object corresponding to the given inert root element, if any. * @param {!Node} element * @return {!InertRoot|undefined} */ }, { key: 'getInertRoot', value: function getInertRoot(element) { return this._inertRoots.get(element); } /** * Register the given InertRoot as managing the given node. * In the case where the node has a previously existing inert root, this inert root will * be added to its set of inert roots. * @param {!Node} node * @param {!InertRoot} inertRoot * @return {!InertNode} inertNode */ }, { key: 'register', value: function register(node, inertRoot) { var inertNode = this._managedNodes.get(node); if (inertNode !== undefined) { // node was already in an inert subtree inertNode.addInertRoot(inertRoot); } else { inertNode = new InertNode(node, inertRoot); } this._managedNodes.set(node, inertNode); return inertNode; } /** * De-register the given InertRoot as managing the given inert node. * Removes the inert root from the InertNode's set of managing inert roots, and remove the inert * node from the InertManager's set of managed nodes if it is destroyed. * If the node is not currently managed, this is essentially a no-op. * @param {!Node} node * @param {!InertRoot} inertRoot * @return {?InertNode} The potentially destroyed InertNode associated with this node, if any. */ }, { key: 'deregister', value: function deregister(node, inertRoot) { var inertNode = this._managedNodes.get(node); if (!inertNode) { return null; } inertNode.removeInertRoot(inertRoot); if (inertNode.destroyed) { this._managedNodes['delete'](node); } return inertNode; } /** * Callback used when document has finished loading. */ }, { key: '_onDocumentLoaded', value: function _onDocumentLoaded() { // Find all inert roots in document and make them actually inert. var inertElements = slice.call(this._document.querySelectorAll('[inert]')); inertElements.forEach(function (inertElement) { this.setInert(inertElement, true); }, this); // Comment this out to use programmatic API only. this._observer.observe(this._document.body || this._document.documentElement, { attributes: true, subtree: true, childList: true }); } /** * Callback used when mutation observer detects attribute changes. * @param {!Array<!MutationRecord>} records * @param {!MutationObserver} self */ }, { key: '_watchForInert', value: function _watchForInert(records, self) { var _this = this; records.forEach(function (record) { switch (record.type) { case 'childList': slice.call(record.addedNodes).forEach(function (node) { if (node.nodeType !== Node.ELEMENT_NODE) { return; } var inertElements = slice.call(node.querySelectorAll('[inert]')); if (matches.call(node, '[inert]')) { inertElements.unshift(node); } inertElements.forEach(function (inertElement) { this.setInert(inertElement, true); }, _this); }, _this); break; case 'attributes': if (record.attributeName !== 'inert') { return; } var target = /** @type {!HTMLElement} */record.target; var inert = target.hasAttribute('inert'); _this.setInert(target, inert); break; } }, this); } }]); return InertManager; }(); /** * Recursively walk the composed tree from |node|. * @param {!Node} node * @param {(function (!HTMLElement))=} callback Callback to be called for each element traversed, * before descending into child nodes. * @param {?ShadowRoot=} shadowRootAncestor The nearest ShadowRoot ancestor, if any. */ function composedTreeWalk(node, callback, shadowRootAncestor) { if (node.nodeType == Node.ELEMENT_NODE) { var element = /** @type {!HTMLElement} */node; if (callback) { callback(element); } // Descend into node: // If it has a ShadowRoot, ignore all child elements - these will be picked // up by the <content> or <shadow> elements. Descend straight into the // ShadowRoot. var shadowRoot = /** @type {!HTMLElement} */element.shadowRoot; if (shadowRoot) { composedTreeWalk(shadowRoot, callback, shadowRoot); return; } // If it is a <content> element, descend into distributed elements - these // are elements from outside the shadow root which are rendered inside the // shadow DOM. if (element.localName == 'content') { var content = /** @type {!HTMLContentElement} */element; // Verifies if ShadowDom v0 is supported. var distributedNodes = content.getDistributedNodes ? content.getDistributedNodes() : []; for (var i = 0; i < distributedNodes.length; i++) { composedTreeWalk(distributedNodes[i], callback, shadowRootAncestor); } return; } // If it is a <slot> element, descend into assigned nodes - these // are elements from outside the shadow root which are rendered inside the // shadow DOM. if (element.localName == 'slot') { var slot = /** @type {!HTMLSlotElement} */element; // Verify if ShadowDom v1 is supported. var _distributedNodes = slot.assignedNodes ? slot.assignedNodes({ flatten: true }) : []; for (var _i = 0; _i < _distributedNodes.length; _i++) { composedTreeWalk(_distributedNodes[_i], callback, shadowRootAncestor); } return; } } // If it is neither the parent of a ShadowRoot, a <content> element, a <slot> // element, nor a <shadow> element recurse normally. var child = node.firstChild; while (child != null) { composedTreeWalk(child, callback, shadowRootAncestor); child = child.nextSibling; } } /** * Adds a style element to the node containing the inert specific styles * @param {!Node} node */ function addInertStyle(node) { if (node.querySelector('style#inert-style, link#inert-style')) { return; } var style = document.createElement('style'); style.setAttribute('id', 'inert-style'); style.textContent = '\n' + '[inert] {\n' + ' pointer-events: none;\n' + ' cursor: default;\n' + '}\n' + '\n' + '[inert], [inert] * {\n' + ' -webkit-user-select: none;\n' + ' -moz-user-select: none;\n' + ' -ms-user-select: none;\n' + ' user-select: none;\n' + '}\n'; node.appendChild(style); } if (!HTMLElement.prototype.hasOwnProperty('inert')) { /** @type {!InertManager} */ var inertManager = new InertManager(document); Object.defineProperty(HTMLElement.prototype, 'inert', { enumerable: true, /** @this {!HTMLElement} */ get: function get() { return this.hasAttribute('inert'); }, /** @this {!HTMLElement} */ set: function set(inert) { inertManager.setInert(this, inert); } }); } })(); }))); vendor/wp-polyfill-fetch.js 0000644 00000046547 15206720414 0011765 0 ustar 00 (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (factory((global.WHATWGFetch = {}))); }(this, (function (exports) { 'use strict'; /* eslint-disable no-prototype-builtins */ var g = (typeof globalThis !== 'undefined' && globalThis) || (typeof self !== 'undefined' && self) || // eslint-disable-next-line no-undef (typeof global !== 'undefined' && global) || {}; var support = { searchParams: 'URLSearchParams' in g, iterable: 'Symbol' in g && 'iterator' in Symbol, blob: 'FileReader' in g && 'Blob' in g && (function() { try { new Blob(); return true } catch (e) { return false } })(), formData: 'FormData' in g, arrayBuffer: 'ArrayBuffer' in g }; function isDataView(obj) { return obj && DataView.prototype.isPrototypeOf(obj) } if (support.arrayBuffer) { var viewClasses = [ '[object Int8Array]', '[object Uint8Array]', '[object Uint8ClampedArray]', '[object Int16Array]', '[object Uint16Array]', '[object Int32Array]', '[object Uint32Array]', '[object Float32Array]', '[object Float64Array]' ]; var isArrayBufferView = ArrayBuffer.isView || function(obj) { return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1 }; } function normalizeName(name) { if (typeof name !== 'string') { name = String(name); } if (/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(name) || name === '') { throw new TypeError('Invalid character in header field name: "' + name + '"') } return name.toLowerCase() } function normalizeValue(value) { if (typeof value !== 'string') { value = String(value); } return value } // Build a destructive iterator for the value list function iteratorFor(items) { var iterator = { next: function() { var value = items.shift(); return {done: value === undefined, value: value} } }; if (support.iterable) { iterator[Symbol.iterator] = function() { return iterator }; } return iterator } function Headers(headers) { this.map = {}; if (headers instanceof Headers) { headers.forEach(function(value, name) { this.append(name, value); }, this); } else if (Array.isArray(headers)) { headers.forEach(function(header) { if (header.length != 2) { throw new TypeError('Headers constructor: expected name/value pair to be length 2, found' + header.length) } this.append(header[0], header[1]); }, this); } else if (headers) { Object.getOwnPropertyNames(headers).forEach(function(name) { this.append(name, headers[name]); }, this); } } Headers.prototype.append = function(name, value) { name = normalizeName(name); value = normalizeValue(value); var oldValue = this.map[name]; this.map[name] = oldValue ? oldValue + ', ' + value : value; }; Headers.prototype['delete'] = function(name) { delete this.map[normalizeName(name)]; }; Headers.prototype.get = function(name) { name = normalizeName(name); return this.has(name) ? this.map[name] : null }; Headers.prototype.has = function(name) { return this.map.hasOwnProperty(normalizeName(name)) }; Headers.prototype.set = function(name, value) { this.map[normalizeName(name)] = normalizeValue(value); }; Headers.prototype.forEach = function(callback, thisArg) { for (var name in this.map) { if (this.map.hasOwnProperty(name)) { callback.call(thisArg, this.map[name], name, this); } } }; Headers.prototype.keys = function() { var items = []; this.forEach(function(value, name) { items.push(name); }); return iteratorFor(items) }; Headers.prototype.values = function() { var items = []; this.forEach(function(value) { items.push(value); }); return iteratorFor(items) }; Headers.prototype.entries = function() { var items = []; this.forEach(function(value, name) { items.push([name, value]); }); return iteratorFor(items) }; if (support.iterable) { Headers.prototype[Symbol.iterator] = Headers.prototype.entries; } function consumed(body) { if (body._noBody) return if (body.bodyUsed) { return Promise.reject(new TypeError('Already read')) } body.bodyUsed = true; } function fileReaderReady(reader) { return new Promise(function(resolve, reject) { reader.onload = function() { resolve(reader.result); }; reader.onerror = function() { reject(reader.error); }; }) } function readBlobAsArrayBuffer(blob) { var reader = new FileReader(); var promise = fileReaderReady(reader); reader.readAsArrayBuffer(blob); return promise } function readBlobAsText(blob) { var reader = new FileReader(); var promise = fileReaderReady(reader); var match = /charset=([A-Za-z0-9_-]+)/.exec(blob.type); var encoding = match ? match[1] : 'utf-8'; reader.readAsText(blob, encoding); return promise } function readArrayBufferAsText(buf) { var view = new Uint8Array(buf); var chars = new Array(view.length); for (var i = 0; i < view.length; i++) { chars[i] = String.fromCharCode(view[i]); } return chars.join('') } function bufferClone(buf) { if (buf.slice) { return buf.slice(0) } else { var view = new Uint8Array(buf.byteLength); view.set(new Uint8Array(buf)); return view.buffer } } function Body() { this.bodyUsed = false; this._initBody = function(body) { /* fetch-mock wraps the Response object in an ES6 Proxy to provide useful test harness features such as flush. However, on ES5 browsers without fetch or Proxy support pollyfills must be used; the proxy-pollyfill is unable to proxy an attribute unless it exists on the object before the Proxy is created. This change ensures Response.bodyUsed exists on the instance, while maintaining the semantic of setting Request.bodyUsed in the constructor before _initBody is called. */ // eslint-disable-next-line no-self-assign this.bodyUsed = this.bodyUsed; this._bodyInit = body; if (!body) { this._noBody = true; this._bodyText = ''; } else if (typeof body === 'string') { this._bodyText = body; } else if (support.blob && Blob.prototype.isPrototypeOf(body)) { this._bodyBlob = body; } else if (support.formData && FormData.prototype.isPrototypeOf(body)) { this._bodyFormData = body; } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) { this._bodyText = body.toString(); } else if (support.arrayBuffer && support.blob && isDataView(body)) { this._bodyArrayBuffer = bufferClone(body.buffer); // IE 10-11 can't handle a DataView body. this._bodyInit = new Blob([this._bodyArrayBuffer]); } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) { this._bodyArrayBuffer = bufferClone(body); } else { this._bodyText = body = Object.prototype.toString.call(body); } if (!this.headers.get('content-type')) { if (typeof body === 'string') { this.headers.set('content-type', 'text/plain;charset=UTF-8'); } else if (this._bodyBlob && this._bodyBlob.type) { this.headers.set('content-type', this._bodyBlob.type); } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) { this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8'); } } }; if (support.blob) { this.blob = function() { var rejected = consumed(this); if (rejected) { return rejected } if (this._bodyBlob) { return Promise.resolve(this._bodyBlob) } else if (this._bodyArrayBuffer) { return Promise.resolve(new Blob([this._bodyArrayBuffer])) } else if (this._bodyFormData) { throw new Error('could not read FormData body as blob') } else { return Promise.resolve(new Blob([this._bodyText])) } }; } this.arrayBuffer = function() { if (this._bodyArrayBuffer) { var isConsumed = consumed(this); if (isConsumed) { return isConsumed } else if (ArrayBuffer.isView(this._bodyArrayBuffer)) { return Promise.resolve( this._bodyArrayBuffer.buffer.slice( this._bodyArrayBuffer.byteOffset, this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength ) ) } else { return Promise.resolve(this._bodyArrayBuffer) } } else if (support.blob) { return this.blob().then(readBlobAsArrayBuffer) } else { throw new Error('could not read as ArrayBuffer') } }; this.text = function() { var rejected = consumed(this); if (rejected) { return rejected } if (this._bodyBlob) { return readBlobAsText(this._bodyBlob) } else if (this._bodyArrayBuffer) { return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer)) } else if (this._bodyFormData) { throw new Error('could not read FormData body as text') } else { return Promise.resolve(this._bodyText) } }; if (support.formData) { this.formData = function() { return this.text().then(decode) }; } this.json = function() { return this.text().then(JSON.parse) }; return this } // HTTP methods whose capitalization should be normalized var methods = ['CONNECT', 'DELETE', 'GET', 'HEAD', 'OPTIONS', 'PATCH', 'POST', 'PUT', 'TRACE']; function normalizeMethod(method) { var upcased = method.toUpperCase(); return methods.indexOf(upcased) > -1 ? upcased : method } function Request(input, options) { if (!(this instanceof Request)) { throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.') } options = options || {}; var body = options.body; if (input instanceof Request) { if (input.bodyUsed) { throw new TypeError('Already read') } this.url = input.url; this.credentials = input.credentials; if (!options.headers) { this.headers = new Headers(input.headers); } this.method = input.method; this.mode = input.mode; this.signal = input.signal; if (!body && input._bodyInit != null) { body = input._bodyInit; input.bodyUsed = true; } } else { this.url = String(input); } this.credentials = options.credentials || this.credentials || 'same-origin'; if (options.headers || !this.headers) { this.headers = new Headers(options.headers); } this.method = normalizeMethod(options.method || this.method || 'GET'); this.mode = options.mode || this.mode || null; this.signal = options.signal || this.signal || (function () { if ('AbortController' in g) { var ctrl = new AbortController(); return ctrl.signal; } }()); this.referrer = null; if ((this.method === 'GET' || this.method === 'HEAD') && body) { throw new TypeError('Body not allowed for GET or HEAD requests') } this._initBody(body); if (this.method === 'GET' || this.method === 'HEAD') { if (options.cache === 'no-store' || options.cache === 'no-cache') { // Search for a '_' parameter in the query string var reParamSearch = /([?&])_=[^&]*/; if (reParamSearch.test(this.url)) { // If it already exists then set the value with the current time this.url = this.url.replace(reParamSearch, '$1_=' + new Date().getTime()); } else { // Otherwise add a new '_' parameter to the end with the current time var reQueryString = /\?/; this.url += (reQueryString.test(this.url) ? '&' : '?') + '_=' + new Date().getTime(); } } } } Request.prototype.clone = function() { return new Request(this, {body: this._bodyInit}) }; function decode(body) { var form = new FormData(); body .trim() .split('&') .forEach(function(bytes) { if (bytes) { var split = bytes.split('='); var name = split.shift().replace(/\+/g, ' '); var value = split.join('=').replace(/\+/g, ' '); form.append(decodeURIComponent(name), decodeURIComponent(value)); } }); return form } function parseHeaders(rawHeaders) { var headers = new Headers(); // Replace instances of \r\n and \n followed by at least one space or horizontal tab with a space // https://tools.ietf.org/html/rfc7230#section-3.2 var preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, ' '); // Avoiding split via regex to work around a common IE11 bug with the core-js 3.6.0 regex polyfill // https://github.com/github/fetch/issues/748 // https://github.com/zloirock/core-js/issues/751 preProcessedHeaders .split('\r') .map(function(header) { return header.indexOf('\n') === 0 ? header.substr(1, header.length) : header }) .forEach(function(line) { var parts = line.split(':'); var key = parts.shift().trim(); if (key) { var value = parts.join(':').trim(); try { headers.append(key, value); } catch (error) { console.warn('Response ' + error.message); } } }); return headers } Body.call(Request.prototype); function Response(bodyInit, options) { if (!(this instanceof Response)) { throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.') } if (!options) { options = {}; } this.type = 'default'; this.status = options.status === undefined ? 200 : options.status; if (this.status < 200 || this.status > 599) { throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].") } this.ok = this.status >= 200 && this.status < 300; this.statusText = options.statusText === undefined ? '' : '' + options.statusText; this.headers = new Headers(options.headers); this.url = options.url || ''; this._initBody(bodyInit); } Body.call(Response.prototype); Response.prototype.clone = function() { return new Response(this._bodyInit, { status: this.status, statusText: this.statusText, headers: new Headers(this.headers), url: this.url }) }; Response.error = function() { var response = new Response(null, {status: 200, statusText: ''}); response.ok = false; response.status = 0; response.type = 'error'; return response }; var redirectStatuses = [301, 302, 303, 307, 308]; Response.redirect = function(url, status) { if (redirectStatuses.indexOf(status) === -1) { throw new RangeError('Invalid status code') } return new Response(null, {status: status, headers: {location: url}}) }; exports.DOMException = g.DOMException; try { new exports.DOMException(); } catch (err) { exports.DOMException = function(message, name) { this.message = message; this.name = name; var error = Error(message); this.stack = error.stack; }; exports.DOMException.prototype = Object.create(Error.prototype); exports.DOMException.prototype.constructor = exports.DOMException; } function fetch(input, init) { return new Promise(function(resolve, reject) { var request = new Request(input, init); if (request.signal && request.signal.aborted) { return reject(new exports.DOMException('Aborted', 'AbortError')) } var xhr = new XMLHttpRequest(); function abortXhr() { xhr.abort(); } xhr.onload = function() { var options = { statusText: xhr.statusText, headers: parseHeaders(xhr.getAllResponseHeaders() || '') }; // This check if specifically for when a user fetches a file locally from the file system // Only if the status is out of a normal range if (request.url.indexOf('file://') === 0 && (xhr.status < 200 || xhr.status > 599)) { options.status = 200; } else { options.status = xhr.status; } options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL'); var body = 'response' in xhr ? xhr.response : xhr.responseText; setTimeout(function() { resolve(new Response(body, options)); }, 0); }; xhr.onerror = function() { setTimeout(function() { reject(new TypeError('Network request failed')); }, 0); }; xhr.ontimeout = function() { setTimeout(function() { reject(new TypeError('Network request timed out')); }, 0); }; xhr.onabort = function() { setTimeout(function() { reject(new exports.DOMException('Aborted', 'AbortError')); }, 0); }; function fixUrl(url) { try { return url === '' && g.location.href ? g.location.href : url } catch (e) { return url } } xhr.open(request.method, fixUrl(request.url), true); if (request.credentials === 'include') { xhr.withCredentials = true; } else if (request.credentials === 'omit') { xhr.withCredentials = false; } if ('responseType' in xhr) { if (support.blob) { xhr.responseType = 'blob'; } else if ( support.arrayBuffer ) { xhr.responseType = 'arraybuffer'; } } if (init && typeof init.headers === 'object' && !(init.headers instanceof Headers || (g.Headers && init.headers instanceof g.Headers))) { var names = []; Object.getOwnPropertyNames(init.headers).forEach(function(name) { names.push(normalizeName(name)); xhr.setRequestHeader(name, normalizeValue(init.headers[name])); }); request.headers.forEach(function(value, name) { if (names.indexOf(name) === -1) { xhr.setRequestHeader(name, value); } }); } else { request.headers.forEach(function(value, name) { xhr.setRequestHeader(name, value); }); } if (request.signal) { request.signal.addEventListener('abort', abortXhr); xhr.onreadystatechange = function() { // DONE (success or failure) if (xhr.readyState === 4) { request.signal.removeEventListener('abort', abortXhr); } }; } xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit); }) } fetch.polyfill = true; if (!g.fetch) { g.fetch = fetch; g.Headers = Headers; g.Request = Request; g.Response = Response; } exports.Headers = Headers; exports.Request = Request; exports.Response = Response; exports.fetch = fetch; Object.defineProperty(exports, '__esModule', { value: true }); }))); vendor/moment.js 0000644 00000530463 15206720414 0007712 0 ustar 00 //! moment.js //! version : 2.30.1 //! authors : Tim Wood, Iskren Chernev, Moment.js contributors //! license : MIT //! momentjs.com ;(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : global.moment = factory() }(this, (function () { 'use strict'; var hookCallback; function hooks() { return hookCallback.apply(null, arguments); } // This is done to register the method called with moment() // without creating circular dependencies. function setHookCallback(callback) { hookCallback = callback; } function isArray(input) { return ( input instanceof Array || Object.prototype.toString.call(input) === '[object Array]' ); } function isObject(input) { // IE8 will treat undefined and null as object if it wasn't for // input != null return ( input != null && Object.prototype.toString.call(input) === '[object Object]' ); } function hasOwnProp(a, b) { return Object.prototype.hasOwnProperty.call(a, b); } function isObjectEmpty(obj) { if (Object.getOwnPropertyNames) { return Object.getOwnPropertyNames(obj).length === 0; } else { var k; for (k in obj) { if (hasOwnProp(obj, k)) { return false; } } return true; } } function isUndefined(input) { return input === void 0; } function isNumber(input) { return ( typeof input === 'number' || Object.prototype.toString.call(input) === '[object Number]' ); } function isDate(input) { return ( input instanceof Date || Object.prototype.toString.call(input) === '[object Date]' ); } function map(arr, fn) { var res = [], i, arrLen = arr.length; for (i = 0; i < arrLen; ++i) { res.push(fn(arr[i], i)); } return res; } function extend(a, b) { for (var i in b) { if (hasOwnProp(b, i)) { a[i] = b[i]; } } if (hasOwnProp(b, 'toString')) { a.toString = b.toString; } if (hasOwnProp(b, 'valueOf')) { a.valueOf = b.valueOf; } return a; } function createUTC(input, format, locale, strict) { return createLocalOrUTC(input, format, locale, strict, true).utc(); } function defaultParsingFlags() { // We need to deep clone this object. return { empty: false, unusedTokens: [], unusedInput: [], overflow: -2, charsLeftOver: 0, nullInput: false, invalidEra: null, invalidMonth: null, invalidFormat: false, userInvalidated: false, iso: false, parsedDateParts: [], era: null, meridiem: null, rfc2822: false, weekdayMismatch: false, }; } function getParsingFlags(m) { if (m._pf == null) { m._pf = defaultParsingFlags(); } return m._pf; } var some; if (Array.prototype.some) { some = Array.prototype.some; } else { some = function (fun) { var t = Object(this), len = t.length >>> 0, i; for (i = 0; i < len; i++) { if (i in t && fun.call(this, t[i], i, t)) { return true; } } return false; }; } function isValid(m) { var flags = null, parsedParts = false, isNowValid = m._d && !isNaN(m._d.getTime()); if (isNowValid) { flags = getParsingFlags(m); parsedParts = some.call(flags.parsedDateParts, function (i) { return i != null; }); isNowValid = flags.overflow < 0 && !flags.empty && !flags.invalidEra && !flags.invalidMonth && !flags.invalidWeekday && !flags.weekdayMismatch && !flags.nullInput && !flags.invalidFormat && !flags.userInvalidated && (!flags.meridiem || (flags.meridiem && parsedParts)); if (m._strict) { isNowValid = isNowValid && flags.charsLeftOver === 0 && flags.unusedTokens.length === 0 && flags.bigHour === undefined; } } if (Object.isFrozen == null || !Object.isFrozen(m)) { m._isValid = isNowValid; } else { return isNowValid; } return m._isValid; } function createInvalid(flags) { var m = createUTC(NaN); if (flags != null) { extend(getParsingFlags(m), flags); } else { getParsingFlags(m).userInvalidated = true; } return m; } // Plugins that add properties should also add the key here (null value), // so we can properly clone ourselves. var momentProperties = (hooks.momentProperties = []), updateInProgress = false; function copyConfig(to, from) { var i, prop, val, momentPropertiesLen = momentProperties.length; if (!isUndefined(from._isAMomentObject)) { to._isAMomentObject = from._isAMomentObject; } if (!isUndefined(from._i)) { to._i = from._i; } if (!isUndefined(from._f)) { to._f = from._f; } if (!isUndefined(from._l)) { to._l = from._l; } if (!isUndefined(from._strict)) { to._strict = from._strict; } if (!isUndefined(from._tzm)) { to._tzm = from._tzm; } if (!isUndefined(from._isUTC)) { to._isUTC = from._isUTC; } if (!isUndefined(from._offset)) { to._offset = from._offset; } if (!isUndefined(from._pf)) { to._pf = getParsingFlags(from); } if (!isUndefined(from._locale)) { to._locale = from._locale; } if (momentPropertiesLen > 0) { for (i = 0; i < momentPropertiesLen; i++) { prop = momentProperties[i]; val = from[prop]; if (!isUndefined(val)) { to[prop] = val; } } } return to; } // Moment prototype object function Moment(config) { copyConfig(this, config); this._d = new Date(config._d != null ? config._d.getTime() : NaN); if (!this.isValid()) { this._d = new Date(NaN); } // Prevent infinite loop in case updateOffset creates new moment // objects. if (updateInProgress === false) { updateInProgress = true; hooks.updateOffset(this); updateInProgress = false; } } function isMoment(obj) { return ( obj instanceof Moment || (obj != null && obj._isAMomentObject != null) ); } function warn(msg) { if ( hooks.suppressDeprecationWarnings === false && typeof console !== 'undefined' && console.warn ) { console.warn('Deprecation warning: ' + msg); } } function deprecate(msg, fn) { var firstTime = true; return extend(function () { if (hooks.deprecationHandler != null) { hooks.deprecationHandler(null, msg); } if (firstTime) { var args = [], arg, i, key, argLen = arguments.length; for (i = 0; i < argLen; i++) { arg = ''; if (typeof arguments[i] === 'object') { arg += '\n[' + i + '] '; for (key in arguments[0]) { if (hasOwnProp(arguments[0], key)) { arg += key + ': ' + arguments[0][key] + ', '; } } arg = arg.slice(0, -2); // Remove trailing comma and space } else { arg = arguments[i]; } args.push(arg); } warn( msg + '\nArguments: ' + Array.prototype.slice.call(args).join('') + '\n' + new Error().stack ); firstTime = false; } return fn.apply(this, arguments); }, fn); } var deprecations = {}; function deprecateSimple(name, msg) { if (hooks.deprecationHandler != null) { hooks.deprecationHandler(name, msg); } if (!deprecations[name]) { warn(msg); deprecations[name] = true; } } hooks.suppressDeprecationWarnings = false; hooks.deprecationHandler = null; function isFunction(input) { return ( (typeof Function !== 'undefined' && input instanceof Function) || Object.prototype.toString.call(input) === '[object Function]' ); } function set(config) { var prop, i; for (i in config) { if (hasOwnProp(config, i)) { prop = config[i]; if (isFunction(prop)) { this[i] = prop; } else { this['_' + i] = prop; } } } this._config = config; // Lenient ordinal parsing accepts just a number in addition to // number + (possibly) stuff coming from _dayOfMonthOrdinalParse. // TODO: Remove "ordinalParse" fallback in next major release. this._dayOfMonthOrdinalParseLenient = new RegExp( (this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) + '|' + /\d{1,2}/.source ); } function mergeConfigs(parentConfig, childConfig) { var res = extend({}, parentConfig), prop; for (prop in childConfig) { if (hasOwnProp(childConfig, prop)) { if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) { res[prop] = {}; extend(res[prop], parentConfig[prop]); extend(res[prop], childConfig[prop]); } else if (childConfig[prop] != null) { res[prop] = childConfig[prop]; } else { delete res[prop]; } } } for (prop in parentConfig) { if ( hasOwnProp(parentConfig, prop) && !hasOwnProp(childConfig, prop) && isObject(parentConfig[prop]) ) { // make sure changes to properties don't modify parent config res[prop] = extend({}, res[prop]); } } return res; } function Locale(config) { if (config != null) { this.set(config); } } var keys; if (Object.keys) { keys = Object.keys; } else { keys = function (obj) { var i, res = []; for (i in obj) { if (hasOwnProp(obj, i)) { res.push(i); } } return res; }; } var defaultCalendar = { sameDay: '[Today at] LT', nextDay: '[Tomorrow at] LT', nextWeek: 'dddd [at] LT', lastDay: '[Yesterday at] LT', lastWeek: '[Last] dddd [at] LT', sameElse: 'L', }; function calendar(key, mom, now) { var output = this._calendar[key] || this._calendar['sameElse']; return isFunction(output) ? output.call(mom, now) : output; } function zeroFill(number, targetLength, forceSign) { var absNumber = '' + Math.abs(number), zerosToFill = targetLength - absNumber.length, sign = number >= 0; return ( (sign ? (forceSign ? '+' : '') : '-') + Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber ); } var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g, localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, formatFunctions = {}, formatTokenFunctions = {}; // token: 'M' // padded: ['MM', 2] // ordinal: 'Mo' // callback: function () { this.month() + 1 } function addFormatToken(token, padded, ordinal, callback) { var func = callback; if (typeof callback === 'string') { func = function () { return this[callback](); }; } if (token) { formatTokenFunctions[token] = func; } if (padded) { formatTokenFunctions[padded[0]] = function () { return zeroFill(func.apply(this, arguments), padded[1], padded[2]); }; } if (ordinal) { formatTokenFunctions[ordinal] = function () { return this.localeData().ordinal( func.apply(this, arguments), token ); }; } } function removeFormattingTokens(input) { if (input.match(/\[[\s\S]/)) { return input.replace(/^\[|\]$/g, ''); } return input.replace(/\\/g, ''); } function makeFormatFunction(format) { var array = format.match(formattingTokens), i, length; for (i = 0, length = array.length; i < length; i++) { if (formatTokenFunctions[array[i]]) { array[i] = formatTokenFunctions[array[i]]; } else { array[i] = removeFormattingTokens(array[i]); } } return function (mom) { var output = '', i; for (i = 0; i < length; i++) { output += isFunction(array[i]) ? array[i].call(mom, format) : array[i]; } return output; }; } // format date using native date object function formatMoment(m, format) { if (!m.isValid()) { return m.localeData().invalidDate(); } format = expandFormat(format, m.localeData()); formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format); return formatFunctions[format](m); } function expandFormat(format, locale) { var i = 5; function replaceLongDateFormatTokens(input) { return locale.longDateFormat(input) || input; } localFormattingTokens.lastIndex = 0; while (i >= 0 && localFormattingTokens.test(format)) { format = format.replace( localFormattingTokens, replaceLongDateFormatTokens ); localFormattingTokens.lastIndex = 0; i -= 1; } return format; } var defaultLongDateFormat = { LTS: 'h:mm:ss A', LT: 'h:mm A', L: 'MM/DD/YYYY', LL: 'MMMM D, YYYY', LLL: 'MMMM D, YYYY h:mm A', LLLL: 'dddd, MMMM D, YYYY h:mm A', }; function longDateFormat(key) { var format = this._longDateFormat[key], formatUpper = this._longDateFormat[key.toUpperCase()]; if (format || !formatUpper) { return format; } this._longDateFormat[key] = formatUpper .match(formattingTokens) .map(function (tok) { if ( tok === 'MMMM' || tok === 'MM' || tok === 'DD' || tok === 'dddd' ) { return tok.slice(1); } return tok; }) .join(''); return this._longDateFormat[key]; } var defaultInvalidDate = 'Invalid date'; function invalidDate() { return this._invalidDate; } var defaultOrdinal = '%d', defaultDayOfMonthOrdinalParse = /\d{1,2}/; function ordinal(number) { return this._ordinal.replace('%d', number); } var defaultRelativeTime = { future: 'in %s', past: '%s ago', s: 'a few seconds', ss: '%d seconds', m: 'a minute', mm: '%d minutes', h: 'an hour', hh: '%d hours', d: 'a day', dd: '%d days', w: 'a week', ww: '%d weeks', M: 'a month', MM: '%d months', y: 'a year', yy: '%d years', }; function relativeTime(number, withoutSuffix, string, isFuture) { var output = this._relativeTime[string]; return isFunction(output) ? output(number, withoutSuffix, string, isFuture) : output.replace(/%d/i, number); } function pastFuture(diff, output) { var format = this._relativeTime[diff > 0 ? 'future' : 'past']; return isFunction(format) ? format(output) : format.replace(/%s/i, output); } var aliases = { D: 'date', dates: 'date', date: 'date', d: 'day', days: 'day', day: 'day', e: 'weekday', weekdays: 'weekday', weekday: 'weekday', E: 'isoWeekday', isoweekdays: 'isoWeekday', isoweekday: 'isoWeekday', DDD: 'dayOfYear', dayofyears: 'dayOfYear', dayofyear: 'dayOfYear', h: 'hour', hours: 'hour', hour: 'hour', ms: 'millisecond', milliseconds: 'millisecond', millisecond: 'millisecond', m: 'minute', minutes: 'minute', minute: 'minute', M: 'month', months: 'month', month: 'month', Q: 'quarter', quarters: 'quarter', quarter: 'quarter', s: 'second', seconds: 'second', second: 'second', gg: 'weekYear', weekyears: 'weekYear', weekyear: 'weekYear', GG: 'isoWeekYear', isoweekyears: 'isoWeekYear', isoweekyear: 'isoWeekYear', w: 'week', weeks: 'week', week: 'week', W: 'isoWeek', isoweeks: 'isoWeek', isoweek: 'isoWeek', y: 'year', years: 'year', year: 'year', }; function normalizeUnits(units) { return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined; } function normalizeObjectUnits(inputObject) { var normalizedInput = {}, normalizedProp, prop; for (prop in inputObject) { if (hasOwnProp(inputObject, prop)) { normalizedProp = normalizeUnits(prop); if (normalizedProp) { normalizedInput[normalizedProp] = inputObject[prop]; } } } return normalizedInput; } var priorities = { date: 9, day: 11, weekday: 11, isoWeekday: 11, dayOfYear: 4, hour: 13, millisecond: 16, minute: 14, month: 8, quarter: 7, second: 15, weekYear: 1, isoWeekYear: 1, week: 5, isoWeek: 5, year: 1, }; function getPrioritizedUnits(unitsObj) { var units = [], u; for (u in unitsObj) { if (hasOwnProp(unitsObj, u)) { units.push({ unit: u, priority: priorities[u] }); } } units.sort(function (a, b) { return a.priority - b.priority; }); return units; } var match1 = /\d/, // 0 - 9 match2 = /\d\d/, // 00 - 99 match3 = /\d{3}/, // 000 - 999 match4 = /\d{4}/, // 0000 - 9999 match6 = /[+-]?\d{6}/, // -999999 - 999999 match1to2 = /\d\d?/, // 0 - 99 match3to4 = /\d\d\d\d?/, // 999 - 9999 match5to6 = /\d\d\d\d\d\d?/, // 99999 - 999999 match1to3 = /\d{1,3}/, // 0 - 999 match1to4 = /\d{1,4}/, // 0 - 9999 match1to6 = /[+-]?\d{1,6}/, // -999999 - 999999 matchUnsigned = /\d+/, // 0 - inf matchSigned = /[+-]?\d+/, // -inf - inf matchOffset = /Z|[+-]\d\d:?\d\d/gi, // +00:00 -00:00 +0000 -0000 or Z matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi, // +00 -00 +00:00 -00:00 +0000 -0000 or Z matchTimestamp = /[+-]?\d+(\.\d{1,3})?/, // 123456789 123456789.123 // any word (or two) characters or numbers including two/three word month in arabic. // includes scottish gaelic two word and hyphenated months matchWord = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i, match1to2NoLeadingZero = /^[1-9]\d?/, // 1-99 match1to2HasZero = /^([1-9]\d|\d)/, // 0-99 regexes; regexes = {}; function addRegexToken(token, regex, strictRegex) { regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) { return isStrict && strictRegex ? strictRegex : regex; }; } function getParseRegexForToken(token, config) { if (!hasOwnProp(regexes, token)) { return new RegExp(unescapeFormat(token)); } return regexes[token](config._strict, config._locale); } // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript function unescapeFormat(s) { return regexEscape( s .replace('\\', '') .replace( /\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) { return p1 || p2 || p3 || p4; } ) ); } function regexEscape(s) { return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); } function absFloor(number) { if (number < 0) { // -0 -> 0 return Math.ceil(number) || 0; } else { return Math.floor(number); } } function toInt(argumentForCoercion) { var coercedNumber = +argumentForCoercion, value = 0; if (coercedNumber !== 0 && isFinite(coercedNumber)) { value = absFloor(coercedNumber); } return value; } var tokens = {}; function addParseToken(token, callback) { var i, func = callback, tokenLen; if (typeof token === 'string') { token = [token]; } if (isNumber(callback)) { func = function (input, array) { array[callback] = toInt(input); }; } tokenLen = token.length; for (i = 0; i < tokenLen; i++) { tokens[token[i]] = func; } } function addWeekParseToken(token, callback) { addParseToken(token, function (input, array, config, token) { config._w = config._w || {}; callback(input, config._w, config, token); }); } function addTimeToArrayFromToken(token, input, config) { if (input != null && hasOwnProp(tokens, token)) { tokens[token](input, config._a, config, token); } } function isLeapYear(year) { return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0; } var YEAR = 0, MONTH = 1, DATE = 2, HOUR = 3, MINUTE = 4, SECOND = 5, MILLISECOND = 6, WEEK = 7, WEEKDAY = 8; // FORMATTING addFormatToken('Y', 0, 0, function () { var y = this.year(); return y <= 9999 ? zeroFill(y, 4) : '+' + y; }); addFormatToken(0, ['YY', 2], 0, function () { return this.year() % 100; }); addFormatToken(0, ['YYYY', 4], 0, 'year'); addFormatToken(0, ['YYYYY', 5], 0, 'year'); addFormatToken(0, ['YYYYYY', 6, true], 0, 'year'); // PARSING addRegexToken('Y', matchSigned); addRegexToken('YY', match1to2, match2); addRegexToken('YYYY', match1to4, match4); addRegexToken('YYYYY', match1to6, match6); addRegexToken('YYYYYY', match1to6, match6); addParseToken(['YYYYY', 'YYYYYY'], YEAR); addParseToken('YYYY', function (input, array) { array[YEAR] = input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input); }); addParseToken('YY', function (input, array) { array[YEAR] = hooks.parseTwoDigitYear(input); }); addParseToken('Y', function (input, array) { array[YEAR] = parseInt(input, 10); }); // HELPERS function daysInYear(year) { return isLeapYear(year) ? 366 : 365; } // HOOKS hooks.parseTwoDigitYear = function (input) { return toInt(input) + (toInt(input) > 68 ? 1900 : 2000); }; // MOMENTS var getSetYear = makeGetSet('FullYear', true); function getIsLeapYear() { return isLeapYear(this.year()); } function makeGetSet(unit, keepTime) { return function (value) { if (value != null) { set$1(this, unit, value); hooks.updateOffset(this, keepTime); return this; } else { return get(this, unit); } }; } function get(mom, unit) { if (!mom.isValid()) { return NaN; } var d = mom._d, isUTC = mom._isUTC; switch (unit) { case 'Milliseconds': return isUTC ? d.getUTCMilliseconds() : d.getMilliseconds(); case 'Seconds': return isUTC ? d.getUTCSeconds() : d.getSeconds(); case 'Minutes': return isUTC ? d.getUTCMinutes() : d.getMinutes(); case 'Hours': return isUTC ? d.getUTCHours() : d.getHours(); case 'Date': return isUTC ? d.getUTCDate() : d.getDate(); case 'Day': return isUTC ? d.getUTCDay() : d.getDay(); case 'Month': return isUTC ? d.getUTCMonth() : d.getMonth(); case 'FullYear': return isUTC ? d.getUTCFullYear() : d.getFullYear(); default: return NaN; // Just in case } } function set$1(mom, unit, value) { var d, isUTC, year, month, date; if (!mom.isValid() || isNaN(value)) { return; } d = mom._d; isUTC = mom._isUTC; switch (unit) { case 'Milliseconds': return void (isUTC ? d.setUTCMilliseconds(value) : d.setMilliseconds(value)); case 'Seconds': return void (isUTC ? d.setUTCSeconds(value) : d.setSeconds(value)); case 'Minutes': return void (isUTC ? d.setUTCMinutes(value) : d.setMinutes(value)); case 'Hours': return void (isUTC ? d.setUTCHours(value) : d.setHours(value)); case 'Date': return void (isUTC ? d.setUTCDate(value) : d.setDate(value)); // case 'Day': // Not real // return void (isUTC ? d.setUTCDay(value) : d.setDay(value)); // case 'Month': // Not used because we need to pass two variables // return void (isUTC ? d.setUTCMonth(value) : d.setMonth(value)); case 'FullYear': break; // See below ... default: return; // Just in case } year = value; month = mom.month(); date = mom.date(); date = date === 29 && month === 1 && !isLeapYear(year) ? 28 : date; void (isUTC ? d.setUTCFullYear(year, month, date) : d.setFullYear(year, month, date)); } // MOMENTS function stringGet(units) { units = normalizeUnits(units); if (isFunction(this[units])) { return this[units](); } return this; } function stringSet(units, value) { if (typeof units === 'object') { units = normalizeObjectUnits(units); var prioritized = getPrioritizedUnits(units), i, prioritizedLen = prioritized.length; for (i = 0; i < prioritizedLen; i++) { this[prioritized[i].unit](units[prioritized[i].unit]); } } else { units = normalizeUnits(units); if (isFunction(this[units])) { return this[units](value); } } return this; } function mod(n, x) { return ((n % x) + x) % x; } var indexOf; if (Array.prototype.indexOf) { indexOf = Array.prototype.indexOf; } else { indexOf = function (o) { // I know var i; for (i = 0; i < this.length; ++i) { if (this[i] === o) { return i; } } return -1; }; } function daysInMonth(year, month) { if (isNaN(year) || isNaN(month)) { return NaN; } var modMonth = mod(month, 12); year += (month - modMonth) / 12; return modMonth === 1 ? isLeapYear(year) ? 29 : 28 : 31 - ((modMonth % 7) % 2); } // FORMATTING addFormatToken('M', ['MM', 2], 'Mo', function () { return this.month() + 1; }); addFormatToken('MMM', 0, 0, function (format) { return this.localeData().monthsShort(this, format); }); addFormatToken('MMMM', 0, 0, function (format) { return this.localeData().months(this, format); }); // PARSING addRegexToken('M', match1to2, match1to2NoLeadingZero); addRegexToken('MM', match1to2, match2); addRegexToken('MMM', function (isStrict, locale) { return locale.monthsShortRegex(isStrict); }); addRegexToken('MMMM', function (isStrict, locale) { return locale.monthsRegex(isStrict); }); addParseToken(['M', 'MM'], function (input, array) { array[MONTH] = toInt(input) - 1; }); addParseToken(['MMM', 'MMMM'], function (input, array, config, token) { var month = config._locale.monthsParse(input, token, config._strict); // if we didn't find a month name, mark the date as invalid. if (month != null) { array[MONTH] = month; } else { getParsingFlags(config).invalidMonth = input; } }); // LOCALES var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split( '_' ), defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/, defaultMonthsShortRegex = matchWord, defaultMonthsRegex = matchWord; function localeMonths(m, format) { if (!m) { return isArray(this._months) ? this._months : this._months['standalone']; } return isArray(this._months) ? this._months[m.month()] : this._months[ (this._months.isFormat || MONTHS_IN_FORMAT).test(format) ? 'format' : 'standalone' ][m.month()]; } function localeMonthsShort(m, format) { if (!m) { return isArray(this._monthsShort) ? this._monthsShort : this._monthsShort['standalone']; } return isArray(this._monthsShort) ? this._monthsShort[m.month()] : this._monthsShort[ MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone' ][m.month()]; } function handleStrictParse(monthName, format, strict) { var i, ii, mom, llc = monthName.toLocaleLowerCase(); if (!this._monthsParse) { // this is not used this._monthsParse = []; this._longMonthsParse = []; this._shortMonthsParse = []; for (i = 0; i < 12; ++i) { mom = createUTC([2000, i]); this._shortMonthsParse[i] = this.monthsShort( mom, '' ).toLocaleLowerCase(); this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase(); } } if (strict) { if (format === 'MMM') { ii = indexOf.call(this._shortMonthsParse, llc); return ii !== -1 ? ii : null; } else { ii = indexOf.call(this._longMonthsParse, llc); return ii !== -1 ? ii : null; } } else { if (format === 'MMM') { ii = indexOf.call(this._shortMonthsParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._longMonthsParse, llc); return ii !== -1 ? ii : null; } else { ii = indexOf.call(this._longMonthsParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._shortMonthsParse, llc); return ii !== -1 ? ii : null; } } } function localeMonthsParse(monthName, format, strict) { var i, mom, regex; if (this._monthsParseExact) { return handleStrictParse.call(this, monthName, format, strict); } if (!this._monthsParse) { this._monthsParse = []; this._longMonthsParse = []; this._shortMonthsParse = []; } // TODO: add sorting // Sorting makes sure if one month (or abbr) is a prefix of another // see sorting in computeMonthsParse for (i = 0; i < 12; i++) { // make the regex if we don't have it already mom = createUTC([2000, i]); if (strict && !this._longMonthsParse[i]) { this._longMonthsParse[i] = new RegExp( '^' + this.months(mom, '').replace('.', '') + '$', 'i' ); this._shortMonthsParse[i] = new RegExp( '^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i' ); } if (!strict && !this._monthsParse[i]) { regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, ''); this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i'); } // test the regex if ( strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName) ) { return i; } else if ( strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName) ) { return i; } else if (!strict && this._monthsParse[i].test(monthName)) { return i; } } } // MOMENTS function setMonth(mom, value) { if (!mom.isValid()) { // No op return mom; } if (typeof value === 'string') { if (/^\d+$/.test(value)) { value = toInt(value); } else { value = mom.localeData().monthsParse(value); // TODO: Another silent failure? if (!isNumber(value)) { return mom; } } } var month = value, date = mom.date(); date = date < 29 ? date : Math.min(date, daysInMonth(mom.year(), month)); void (mom._isUTC ? mom._d.setUTCMonth(month, date) : mom._d.setMonth(month, date)); return mom; } function getSetMonth(value) { if (value != null) { setMonth(this, value); hooks.updateOffset(this, true); return this; } else { return get(this, 'Month'); } } function getDaysInMonth() { return daysInMonth(this.year(), this.month()); } function monthsShortRegex(isStrict) { if (this._monthsParseExact) { if (!hasOwnProp(this, '_monthsRegex')) { computeMonthsParse.call(this); } if (isStrict) { return this._monthsShortStrictRegex; } else { return this._monthsShortRegex; } } else { if (!hasOwnProp(this, '_monthsShortRegex')) { this._monthsShortRegex = defaultMonthsShortRegex; } return this._monthsShortStrictRegex && isStrict ? this._monthsShortStrictRegex : this._monthsShortRegex; } } function monthsRegex(isStrict) { if (this._monthsParseExact) { if (!hasOwnProp(this, '_monthsRegex')) { computeMonthsParse.call(this); } if (isStrict) { return this._monthsStrictRegex; } else { return this._monthsRegex; } } else { if (!hasOwnProp(this, '_monthsRegex')) { this._monthsRegex = defaultMonthsRegex; } return this._monthsStrictRegex && isStrict ? this._monthsStrictRegex : this._monthsRegex; } } function computeMonthsParse() { function cmpLenRev(a, b) { return b.length - a.length; } var shortPieces = [], longPieces = [], mixedPieces = [], i, mom, shortP, longP; for (i = 0; i < 12; i++) { // make the regex if we don't have it already mom = createUTC([2000, i]); shortP = regexEscape(this.monthsShort(mom, '')); longP = regexEscape(this.months(mom, '')); shortPieces.push(shortP); longPieces.push(longP); mixedPieces.push(longP); mixedPieces.push(shortP); } // Sorting makes sure if one month (or abbr) is a prefix of another it // will match the longer piece. shortPieces.sort(cmpLenRev); longPieces.sort(cmpLenRev); mixedPieces.sort(cmpLenRev); this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); this._monthsShortRegex = this._monthsRegex; this._monthsStrictRegex = new RegExp( '^(' + longPieces.join('|') + ')', 'i' ); this._monthsShortStrictRegex = new RegExp( '^(' + shortPieces.join('|') + ')', 'i' ); } function createDate(y, m, d, h, M, s, ms) { // can't just apply() to create a date: // https://stackoverflow.com/q/181348 var date; // the date constructor remaps years 0-99 to 1900-1999 if (y < 100 && y >= 0) { // preserve leap years using a full 400 year cycle, then reset date = new Date(y + 400, m, d, h, M, s, ms); if (isFinite(date.getFullYear())) { date.setFullYear(y); } } else { date = new Date(y, m, d, h, M, s, ms); } return date; } function createUTCDate(y) { var date, args; // the Date.UTC function remaps years 0-99 to 1900-1999 if (y < 100 && y >= 0) { args = Array.prototype.slice.call(arguments); // preserve leap years using a full 400 year cycle, then reset args[0] = y + 400; date = new Date(Date.UTC.apply(null, args)); if (isFinite(date.getUTCFullYear())) { date.setUTCFullYear(y); } } else { date = new Date(Date.UTC.apply(null, arguments)); } return date; } // start-of-first-week - start-of-year function firstWeekOffset(year, dow, doy) { var // first-week day -- which january is always in the first week (4 for iso, 1 for other) fwd = 7 + dow - doy, // first-week day local weekday -- which local weekday is fwd fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7; return -fwdlw + fwd - 1; } // https://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday function dayOfYearFromWeeks(year, week, weekday, dow, doy) { var localWeekday = (7 + weekday - dow) % 7, weekOffset = firstWeekOffset(year, dow, doy), dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset, resYear, resDayOfYear; if (dayOfYear <= 0) { resYear = year - 1; resDayOfYear = daysInYear(resYear) + dayOfYear; } else if (dayOfYear > daysInYear(year)) { resYear = year + 1; resDayOfYear = dayOfYear - daysInYear(year); } else { resYear = year; resDayOfYear = dayOfYear; } return { year: resYear, dayOfYear: resDayOfYear, }; } function weekOfYear(mom, dow, doy) { var weekOffset = firstWeekOffset(mom.year(), dow, doy), week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1, resWeek, resYear; if (week < 1) { resYear = mom.year() - 1; resWeek = week + weeksInYear(resYear, dow, doy); } else if (week > weeksInYear(mom.year(), dow, doy)) { resWeek = week - weeksInYear(mom.year(), dow, doy); resYear = mom.year() + 1; } else { resYear = mom.year(); resWeek = week; } return { week: resWeek, year: resYear, }; } function weeksInYear(year, dow, doy) { var weekOffset = firstWeekOffset(year, dow, doy), weekOffsetNext = firstWeekOffset(year + 1, dow, doy); return (daysInYear(year) - weekOffset + weekOffsetNext) / 7; } // FORMATTING addFormatToken('w', ['ww', 2], 'wo', 'week'); addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek'); // PARSING addRegexToken('w', match1to2, match1to2NoLeadingZero); addRegexToken('ww', match1to2, match2); addRegexToken('W', match1to2, match1to2NoLeadingZero); addRegexToken('WW', match1to2, match2); addWeekParseToken( ['w', 'ww', 'W', 'WW'], function (input, week, config, token) { week[token.substr(0, 1)] = toInt(input); } ); // HELPERS // LOCALES function localeWeek(mom) { return weekOfYear(mom, this._week.dow, this._week.doy).week; } var defaultLocaleWeek = { dow: 0, // Sunday is the first day of the week. doy: 6, // The week that contains Jan 6th is the first week of the year. }; function localeFirstDayOfWeek() { return this._week.dow; } function localeFirstDayOfYear() { return this._week.doy; } // MOMENTS function getSetWeek(input) { var week = this.localeData().week(this); return input == null ? week : this.add((input - week) * 7, 'd'); } function getSetISOWeek(input) { var week = weekOfYear(this, 1, 4).week; return input == null ? week : this.add((input - week) * 7, 'd'); } // FORMATTING addFormatToken('d', 0, 'do', 'day'); addFormatToken('dd', 0, 0, function (format) { return this.localeData().weekdaysMin(this, format); }); addFormatToken('ddd', 0, 0, function (format) { return this.localeData().weekdaysShort(this, format); }); addFormatToken('dddd', 0, 0, function (format) { return this.localeData().weekdays(this, format); }); addFormatToken('e', 0, 0, 'weekday'); addFormatToken('E', 0, 0, 'isoWeekday'); // PARSING addRegexToken('d', match1to2); addRegexToken('e', match1to2); addRegexToken('E', match1to2); addRegexToken('dd', function (isStrict, locale) { return locale.weekdaysMinRegex(isStrict); }); addRegexToken('ddd', function (isStrict, locale) { return locale.weekdaysShortRegex(isStrict); }); addRegexToken('dddd', function (isStrict, locale) { return locale.weekdaysRegex(isStrict); }); addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) { var weekday = config._locale.weekdaysParse(input, token, config._strict); // if we didn't get a weekday name, mark the date as invalid if (weekday != null) { week.d = weekday; } else { getParsingFlags(config).invalidWeekday = input; } }); addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) { week[token] = toInt(input); }); // HELPERS function parseWeekday(input, locale) { if (typeof input !== 'string') { return input; } if (!isNaN(input)) { return parseInt(input, 10); } input = locale.weekdaysParse(input); if (typeof input === 'number') { return input; } return null; } function parseIsoWeekday(input, locale) { if (typeof input === 'string') { return locale.weekdaysParse(input) % 7 || 7; } return isNaN(input) ? null : input; } // LOCALES function shiftWeekdays(ws, n) { return ws.slice(n, 7).concat(ws.slice(0, n)); } var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), defaultWeekdaysRegex = matchWord, defaultWeekdaysShortRegex = matchWord, defaultWeekdaysMinRegex = matchWord; function localeWeekdays(m, format) { var weekdays = isArray(this._weekdays) ? this._weekdays : this._weekdays[ m && m !== true && this._weekdays.isFormat.test(format) ? 'format' : 'standalone' ]; return m === true ? shiftWeekdays(weekdays, this._week.dow) : m ? weekdays[m.day()] : weekdays; } function localeWeekdaysShort(m) { return m === true ? shiftWeekdays(this._weekdaysShort, this._week.dow) : m ? this._weekdaysShort[m.day()] : this._weekdaysShort; } function localeWeekdaysMin(m) { return m === true ? shiftWeekdays(this._weekdaysMin, this._week.dow) : m ? this._weekdaysMin[m.day()] : this._weekdaysMin; } function handleStrictParse$1(weekdayName, format, strict) { var i, ii, mom, llc = weekdayName.toLocaleLowerCase(); if (!this._weekdaysParse) { this._weekdaysParse = []; this._shortWeekdaysParse = []; this._minWeekdaysParse = []; for (i = 0; i < 7; ++i) { mom = createUTC([2000, 1]).day(i); this._minWeekdaysParse[i] = this.weekdaysMin( mom, '' ).toLocaleLowerCase(); this._shortWeekdaysParse[i] = this.weekdaysShort( mom, '' ).toLocaleLowerCase(); this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase(); } } if (strict) { if (format === 'dddd') { ii = indexOf.call(this._weekdaysParse, llc); return ii !== -1 ? ii : null; } else if (format === 'ddd') { ii = indexOf.call(this._shortWeekdaysParse, llc); return ii !== -1 ? ii : null; } else { ii = indexOf.call(this._minWeekdaysParse, llc); return ii !== -1 ? ii : null; } } else { if (format === 'dddd') { ii = indexOf.call(this._weekdaysParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._shortWeekdaysParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._minWeekdaysParse, llc); return ii !== -1 ? ii : null; } else if (format === 'ddd') { ii = indexOf.call(this._shortWeekdaysParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._weekdaysParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._minWeekdaysParse, llc); return ii !== -1 ? ii : null; } else { ii = indexOf.call(this._minWeekdaysParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._weekdaysParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._shortWeekdaysParse, llc); return ii !== -1 ? ii : null; } } } function localeWeekdaysParse(weekdayName, format, strict) { var i, mom, regex; if (this._weekdaysParseExact) { return handleStrictParse$1.call(this, weekdayName, format, strict); } if (!this._weekdaysParse) { this._weekdaysParse = []; this._minWeekdaysParse = []; this._shortWeekdaysParse = []; this._fullWeekdaysParse = []; } for (i = 0; i < 7; i++) { // make the regex if we don't have it already mom = createUTC([2000, 1]).day(i); if (strict && !this._fullWeekdaysParse[i]) { this._fullWeekdaysParse[i] = new RegExp( '^' + this.weekdays(mom, '').replace('.', '\\.?') + '$', 'i' ); this._shortWeekdaysParse[i] = new RegExp( '^' + this.weekdaysShort(mom, '').replace('.', '\\.?') + '$', 'i' ); this._minWeekdaysParse[i] = new RegExp( '^' + this.weekdaysMin(mom, '').replace('.', '\\.?') + '$', 'i' ); } if (!this._weekdaysParse[i]) { regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, ''); this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i'); } // test the regex if ( strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName) ) { return i; } else if ( strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName) ) { return i; } else if ( strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName) ) { return i; } else if (!strict && this._weekdaysParse[i].test(weekdayName)) { return i; } } } // MOMENTS function getSetDayOfWeek(input) { if (!this.isValid()) { return input != null ? this : NaN; } var day = get(this, 'Day'); if (input != null) { input = parseWeekday(input, this.localeData()); return this.add(input - day, 'd'); } else { return day; } } function getSetLocaleDayOfWeek(input) { if (!this.isValid()) { return input != null ? this : NaN; } var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7; return input == null ? weekday : this.add(input - weekday, 'd'); } function getSetISODayOfWeek(input) { if (!this.isValid()) { return input != null ? this : NaN; } // behaves the same as moment#day except // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6) // as a setter, sunday should belong to the previous week. if (input != null) { var weekday = parseIsoWeekday(input, this.localeData()); return this.day(this.day() % 7 ? weekday : weekday - 7); } else { return this.day() || 7; } } function weekdaysRegex(isStrict) { if (this._weekdaysParseExact) { if (!hasOwnProp(this, '_weekdaysRegex')) { computeWeekdaysParse.call(this); } if (isStrict) { return this._weekdaysStrictRegex; } else { return this._weekdaysRegex; } } else { if (!hasOwnProp(this, '_weekdaysRegex')) { this._weekdaysRegex = defaultWeekdaysRegex; } return this._weekdaysStrictRegex && isStrict ? this._weekdaysStrictRegex : this._weekdaysRegex; } } function weekdaysShortRegex(isStrict) { if (this._weekdaysParseExact) { if (!hasOwnProp(this, '_weekdaysRegex')) { computeWeekdaysParse.call(this); } if (isStrict) { return this._weekdaysShortStrictRegex; } else { return this._weekdaysShortRegex; } } else { if (!hasOwnProp(this, '_weekdaysShortRegex')) { this._weekdaysShortRegex = defaultWeekdaysShortRegex; } return this._weekdaysShortStrictRegex && isStrict ? this._weekdaysShortStrictRegex : this._weekdaysShortRegex; } } function weekdaysMinRegex(isStrict) { if (this._weekdaysParseExact) { if (!hasOwnProp(this, '_weekdaysRegex')) { computeWeekdaysParse.call(this); } if (isStrict) { return this._weekdaysMinStrictRegex; } else { return this._weekdaysMinRegex; } } else { if (!hasOwnProp(this, '_weekdaysMinRegex')) { this._weekdaysMinRegex = defaultWeekdaysMinRegex; } return this._weekdaysMinStrictRegex && isStrict ? this._weekdaysMinStrictRegex : this._weekdaysMinRegex; } } function computeWeekdaysParse() { function cmpLenRev(a, b) { return b.length - a.length; } var minPieces = [], shortPieces = [], longPieces = [], mixedPieces = [], i, mom, minp, shortp, longp; for (i = 0; i < 7; i++) { // make the regex if we don't have it already mom = createUTC([2000, 1]).day(i); minp = regexEscape(this.weekdaysMin(mom, '')); shortp = regexEscape(this.weekdaysShort(mom, '')); longp = regexEscape(this.weekdays(mom, '')); minPieces.push(minp); shortPieces.push(shortp); longPieces.push(longp); mixedPieces.push(minp); mixedPieces.push(shortp); mixedPieces.push(longp); } // Sorting makes sure if one weekday (or abbr) is a prefix of another it // will match the longer piece. minPieces.sort(cmpLenRev); shortPieces.sort(cmpLenRev); longPieces.sort(cmpLenRev); mixedPieces.sort(cmpLenRev); this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); this._weekdaysShortRegex = this._weekdaysRegex; this._weekdaysMinRegex = this._weekdaysRegex; this._weekdaysStrictRegex = new RegExp( '^(' + longPieces.join('|') + ')', 'i' ); this._weekdaysShortStrictRegex = new RegExp( '^(' + shortPieces.join('|') + ')', 'i' ); this._weekdaysMinStrictRegex = new RegExp( '^(' + minPieces.join('|') + ')', 'i' ); } // FORMATTING function hFormat() { return this.hours() % 12 || 12; } function kFormat() { return this.hours() || 24; } addFormatToken('H', ['HH', 2], 0, 'hour'); addFormatToken('h', ['hh', 2], 0, hFormat); addFormatToken('k', ['kk', 2], 0, kFormat); addFormatToken('hmm', 0, 0, function () { return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2); }); addFormatToken('hmmss', 0, 0, function () { return ( '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) + zeroFill(this.seconds(), 2) ); }); addFormatToken('Hmm', 0, 0, function () { return '' + this.hours() + zeroFill(this.minutes(), 2); }); addFormatToken('Hmmss', 0, 0, function () { return ( '' + this.hours() + zeroFill(this.minutes(), 2) + zeroFill(this.seconds(), 2) ); }); function meridiem(token, lowercase) { addFormatToken(token, 0, 0, function () { return this.localeData().meridiem( this.hours(), this.minutes(), lowercase ); }); } meridiem('a', true); meridiem('A', false); // PARSING function matchMeridiem(isStrict, locale) { return locale._meridiemParse; } addRegexToken('a', matchMeridiem); addRegexToken('A', matchMeridiem); addRegexToken('H', match1to2, match1to2HasZero); addRegexToken('h', match1to2, match1to2NoLeadingZero); addRegexToken('k', match1to2, match1to2NoLeadingZero); addRegexToken('HH', match1to2, match2); addRegexToken('hh', match1to2, match2); addRegexToken('kk', match1to2, match2); addRegexToken('hmm', match3to4); addRegexToken('hmmss', match5to6); addRegexToken('Hmm', match3to4); addRegexToken('Hmmss', match5to6); addParseToken(['H', 'HH'], HOUR); addParseToken(['k', 'kk'], function (input, array, config) { var kInput = toInt(input); array[HOUR] = kInput === 24 ? 0 : kInput; }); addParseToken(['a', 'A'], function (input, array, config) { config._isPm = config._locale.isPM(input); config._meridiem = input; }); addParseToken(['h', 'hh'], function (input, array, config) { array[HOUR] = toInt(input); getParsingFlags(config).bigHour = true; }); addParseToken('hmm', function (input, array, config) { var pos = input.length - 2; array[HOUR] = toInt(input.substr(0, pos)); array[MINUTE] = toInt(input.substr(pos)); getParsingFlags(config).bigHour = true; }); addParseToken('hmmss', function (input, array, config) { var pos1 = input.length - 4, pos2 = input.length - 2; array[HOUR] = toInt(input.substr(0, pos1)); array[MINUTE] = toInt(input.substr(pos1, 2)); array[SECOND] = toInt(input.substr(pos2)); getParsingFlags(config).bigHour = true; }); addParseToken('Hmm', function (input, array, config) { var pos = input.length - 2; array[HOUR] = toInt(input.substr(0, pos)); array[MINUTE] = toInt(input.substr(pos)); }); addParseToken('Hmmss', function (input, array, config) { var pos1 = input.length - 4, pos2 = input.length - 2; array[HOUR] = toInt(input.substr(0, pos1)); array[MINUTE] = toInt(input.substr(pos1, 2)); array[SECOND] = toInt(input.substr(pos2)); }); // LOCALES function localeIsPM(input) { // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays // Using charAt should be more compatible. return (input + '').toLowerCase().charAt(0) === 'p'; } var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i, // Setting the hour should keep the time, because the user explicitly // specified which hour they want. So trying to maintain the same hour (in // a new timezone) makes sense. Adding/subtracting hours does not follow // this rule. getSetHour = makeGetSet('Hours', true); function localeMeridiem(hours, minutes, isLower) { if (hours > 11) { return isLower ? 'pm' : 'PM'; } else { return isLower ? 'am' : 'AM'; } } var baseConfig = { calendar: defaultCalendar, longDateFormat: defaultLongDateFormat, invalidDate: defaultInvalidDate, ordinal: defaultOrdinal, dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse, relativeTime: defaultRelativeTime, months: defaultLocaleMonths, monthsShort: defaultLocaleMonthsShort, week: defaultLocaleWeek, weekdays: defaultLocaleWeekdays, weekdaysMin: defaultLocaleWeekdaysMin, weekdaysShort: defaultLocaleWeekdaysShort, meridiemParse: defaultLocaleMeridiemParse, }; // internal storage for locale config files var locales = {}, localeFamilies = {}, globalLocale; function commonPrefix(arr1, arr2) { var i, minl = Math.min(arr1.length, arr2.length); for (i = 0; i < minl; i += 1) { if (arr1[i] !== arr2[i]) { return i; } } return minl; } function normalizeLocale(key) { return key ? key.toLowerCase().replace('_', '-') : key; } // pick the locale from the array // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root function chooseLocale(names) { var i = 0, j, next, locale, split; while (i < names.length) { split = normalizeLocale(names[i]).split('-'); j = split.length; next = normalizeLocale(names[i + 1]); next = next ? next.split('-') : null; while (j > 0) { locale = loadLocale(split.slice(0, j).join('-')); if (locale) { return locale; } if ( next && next.length >= j && commonPrefix(split, next) >= j - 1 ) { //the next array item is better than a shallower substring of this one break; } j--; } i++; } return globalLocale; } function isLocaleNameSane(name) { // Prevent names that look like filesystem paths, i.e contain '/' or '\' // Ensure name is available and function returns boolean return !!(name && name.match('^[^/\\\\]*$')); } function loadLocale(name) { var oldLocale = null, aliasedRequire; // TODO: Find a better way to register and load all the locales in Node if ( locales[name] === undefined && typeof module !== 'undefined' && module && module.exports && isLocaleNameSane(name) ) { try { oldLocale = globalLocale._abbr; aliasedRequire = require; aliasedRequire('./locale/' + name); getSetGlobalLocale(oldLocale); } catch (e) { // mark as not found to avoid repeating expensive file require call causing high CPU // when trying to find en-US, en_US, en-us for every format call locales[name] = null; // null means not found } } return locales[name]; } // This function will load locale and then set the global locale. If // no arguments are passed in, it will simply return the current global // locale key. function getSetGlobalLocale(key, values) { var data; if (key) { if (isUndefined(values)) { data = getLocale(key); } else { data = defineLocale(key, values); } if (data) { // moment.duration._locale = moment._locale = data; globalLocale = data; } else { if (typeof console !== 'undefined' && console.warn) { //warn user if arguments are passed but the locale could not be set console.warn( 'Locale ' + key + ' not found. Did you forget to load it?' ); } } } return globalLocale._abbr; } function defineLocale(name, config) { if (config !== null) { var locale, parentConfig = baseConfig; config.abbr = name; if (locales[name] != null) { deprecateSimple( 'defineLocaleOverride', 'use moment.updateLocale(localeName, config) to change ' + 'an existing locale. moment.defineLocale(localeName, ' + 'config) should only be used for creating a new locale ' + 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.' ); parentConfig = locales[name]._config; } else if (config.parentLocale != null) { if (locales[config.parentLocale] != null) { parentConfig = locales[config.parentLocale]._config; } else { locale = loadLocale(config.parentLocale); if (locale != null) { parentConfig = locale._config; } else { if (!localeFamilies[config.parentLocale]) { localeFamilies[config.parentLocale] = []; } localeFamilies[config.parentLocale].push({ name: name, config: config, }); return null; } } } locales[name] = new Locale(mergeConfigs(parentConfig, config)); if (localeFamilies[name]) { localeFamilies[name].forEach(function (x) { defineLocale(x.name, x.config); }); } // backwards compat for now: also set the locale // make sure we set the locale AFTER all child locales have been // created, so we won't end up with the child locale set. getSetGlobalLocale(name); return locales[name]; } else { // useful for testing delete locales[name]; return null; } } function updateLocale(name, config) { if (config != null) { var locale, tmpLocale, parentConfig = baseConfig; if (locales[name] != null && locales[name].parentLocale != null) { // Update existing child locale in-place to avoid memory-leaks locales[name].set(mergeConfigs(locales[name]._config, config)); } else { // MERGE tmpLocale = loadLocale(name); if (tmpLocale != null) { parentConfig = tmpLocale._config; } config = mergeConfigs(parentConfig, config); if (tmpLocale == null) { // updateLocale is called for creating a new locale // Set abbr so it will have a name (getters return // undefined otherwise). config.abbr = name; } locale = new Locale(config); locale.parentLocale = locales[name]; locales[name] = locale; } // backwards compat for now: also set the locale getSetGlobalLocale(name); } else { // pass null for config to unupdate, useful for tests if (locales[name] != null) { if (locales[name].parentLocale != null) { locales[name] = locales[name].parentLocale; if (name === getSetGlobalLocale()) { getSetGlobalLocale(name); } } else if (locales[name] != null) { delete locales[name]; } } } return locales[name]; } // returns locale data function getLocale(key) { var locale; if (key && key._locale && key._locale._abbr) { key = key._locale._abbr; } if (!key) { return globalLocale; } if (!isArray(key)) { //short-circuit everything else locale = loadLocale(key); if (locale) { return locale; } key = [key]; } return chooseLocale(key); } function listLocales() { return keys(locales); } function checkOverflow(m) { var overflow, a = m._a; if (a && getParsingFlags(m).overflow === -2) { overflow = a[MONTH] < 0 || a[MONTH] > 11 ? MONTH : a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE : a[HOUR] < 0 || a[HOUR] > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR : a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE : a[SECOND] < 0 || a[SECOND] > 59 ? SECOND : a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND : -1; if ( getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE) ) { overflow = DATE; } if (getParsingFlags(m)._overflowWeeks && overflow === -1) { overflow = WEEK; } if (getParsingFlags(m)._overflowWeekday && overflow === -1) { overflow = WEEKDAY; } getParsingFlags(m).overflow = overflow; } return m; } // iso 8601 regex // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00) var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/, basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/, tzRegex = /Z|[+-]\d\d(?::?\d\d)?/, isoDates = [ ['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/], ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/], ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/], ['GGGG-[W]WW', /\d{4}-W\d\d/, false], ['YYYY-DDD', /\d{4}-\d{3}/], ['YYYY-MM', /\d{4}-\d\d/, false], ['YYYYYYMMDD', /[+-]\d{10}/], ['YYYYMMDD', /\d{8}/], ['GGGG[W]WWE', /\d{4}W\d{3}/], ['GGGG[W]WW', /\d{4}W\d{2}/, false], ['YYYYDDD', /\d{7}/], ['YYYYMM', /\d{6}/, false], ['YYYY', /\d{4}/, false], ], // iso time formats and regexes isoTimes = [ ['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/], ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/], ['HH:mm:ss', /\d\d:\d\d:\d\d/], ['HH:mm', /\d\d:\d\d/], ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/], ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/], ['HHmmss', /\d\d\d\d\d\d/], ['HHmm', /\d\d\d\d/], ['HH', /\d\d/], ], aspNetJsonRegex = /^\/?Date\((-?\d+)/i, // RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3 rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/, obsOffsets = { UT: 0, GMT: 0, EDT: -4 * 60, EST: -5 * 60, CDT: -5 * 60, CST: -6 * 60, MDT: -6 * 60, MST: -7 * 60, PDT: -7 * 60, PST: -8 * 60, }; // date from iso format function configFromISO(config) { var i, l, string = config._i, match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string), allowTime, dateFormat, timeFormat, tzFormat, isoDatesLen = isoDates.length, isoTimesLen = isoTimes.length; if (match) { getParsingFlags(config).iso = true; for (i = 0, l = isoDatesLen; i < l; i++) { if (isoDates[i][1].exec(match[1])) { dateFormat = isoDates[i][0]; allowTime = isoDates[i][2] !== false; break; } } if (dateFormat == null) { config._isValid = false; return; } if (match[3]) { for (i = 0, l = isoTimesLen; i < l; i++) { if (isoTimes[i][1].exec(match[3])) { // match[2] should be 'T' or space timeFormat = (match[2] || ' ') + isoTimes[i][0]; break; } } if (timeFormat == null) { config._isValid = false; return; } } if (!allowTime && timeFormat != null) { config._isValid = false; return; } if (match[4]) { if (tzRegex.exec(match[4])) { tzFormat = 'Z'; } else { config._isValid = false; return; } } config._f = dateFormat + (timeFormat || '') + (tzFormat || ''); configFromStringAndFormat(config); } else { config._isValid = false; } } function extractFromRFC2822Strings( yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr ) { var result = [ untruncateYear(yearStr), defaultLocaleMonthsShort.indexOf(monthStr), parseInt(dayStr, 10), parseInt(hourStr, 10), parseInt(minuteStr, 10), ]; if (secondStr) { result.push(parseInt(secondStr, 10)); } return result; } function untruncateYear(yearStr) { var year = parseInt(yearStr, 10); if (year <= 49) { return 2000 + year; } else if (year <= 999) { return 1900 + year; } return year; } function preprocessRFC2822(s) { // Remove comments and folding whitespace and replace multiple-spaces with a single space return s .replace(/\([^()]*\)|[\n\t]/g, ' ') .replace(/(\s\s+)/g, ' ') .replace(/^\s\s*/, '') .replace(/\s\s*$/, ''); } function checkWeekday(weekdayStr, parsedInput, config) { if (weekdayStr) { // TODO: Replace the vanilla JS Date object with an independent day-of-week check. var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr), weekdayActual = new Date( parsedInput[0], parsedInput[1], parsedInput[2] ).getDay(); if (weekdayProvided !== weekdayActual) { getParsingFlags(config).weekdayMismatch = true; config._isValid = false; return false; } } return true; } function calculateOffset(obsOffset, militaryOffset, numOffset) { if (obsOffset) { return obsOffsets[obsOffset]; } else if (militaryOffset) { // the only allowed military tz is Z return 0; } else { var hm = parseInt(numOffset, 10), m = hm % 100, h = (hm - m) / 100; return h * 60 + m; } } // date and time from ref 2822 format function configFromRFC2822(config) { var match = rfc2822.exec(preprocessRFC2822(config._i)), parsedArray; if (match) { parsedArray = extractFromRFC2822Strings( match[4], match[3], match[2], match[5], match[6], match[7] ); if (!checkWeekday(match[1], parsedArray, config)) { return; } config._a = parsedArray; config._tzm = calculateOffset(match[8], match[9], match[10]); config._d = createUTCDate.apply(null, config._a); config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm); getParsingFlags(config).rfc2822 = true; } else { config._isValid = false; } } // date from 1) ASP.NET, 2) ISO, 3) RFC 2822 formats, or 4) optional fallback if parsing isn't strict function configFromString(config) { var matched = aspNetJsonRegex.exec(config._i); if (matched !== null) { config._d = new Date(+matched[1]); return; } configFromISO(config); if (config._isValid === false) { delete config._isValid; } else { return; } configFromRFC2822(config); if (config._isValid === false) { delete config._isValid; } else { return; } if (config._strict) { config._isValid = false; } else { // Final attempt, use Input Fallback hooks.createFromInputFallback(config); } } hooks.createFromInputFallback = deprecate( 'value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' + 'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' + 'discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.', function (config) { config._d = new Date(config._i + (config._useUTC ? ' UTC' : '')); } ); // Pick the first defined of two or three arguments. function defaults(a, b, c) { if (a != null) { return a; } if (b != null) { return b; } return c; } function currentDateArray(config) { // hooks is actually the exported moment object var nowValue = new Date(hooks.now()); if (config._useUTC) { return [ nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate(), ]; } return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()]; } // convert an array to a date. // the array should mirror the parameters below // note: all values past the year are optional and will default to the lowest possible value. // [year, month, day , hour, minute, second, millisecond] function configFromArray(config) { var i, date, input = [], currentDate, expectedWeekday, yearToUse; if (config._d) { return; } currentDate = currentDateArray(config); //compute day of the year from weeks and weekdays if (config._w && config._a[DATE] == null && config._a[MONTH] == null) { dayOfYearFromWeekInfo(config); } //if the day of the year is set, figure out what it is if (config._dayOfYear != null) { yearToUse = defaults(config._a[YEAR], currentDate[YEAR]); if ( config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0 ) { getParsingFlags(config)._overflowDayOfYear = true; } date = createUTCDate(yearToUse, 0, config._dayOfYear); config._a[MONTH] = date.getUTCMonth(); config._a[DATE] = date.getUTCDate(); } // Default to current date. // * if no year, month, day of month are given, default to today // * if day of month is given, default month and year // * if month is given, default only year // * if year is given, don't default anything for (i = 0; i < 3 && config._a[i] == null; ++i) { config._a[i] = input[i] = currentDate[i]; } // Zero out whatever was not defaulted, including time for (; i < 7; i++) { config._a[i] = input[i] = config._a[i] == null ? (i === 2 ? 1 : 0) : config._a[i]; } // Check for 24:00:00.000 if ( config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0 ) { config._nextDay = true; config._a[HOUR] = 0; } config._d = (config._useUTC ? createUTCDate : createDate).apply( null, input ); expectedWeekday = config._useUTC ? config._d.getUTCDay() : config._d.getDay(); // Apply timezone offset from input. The actual utcOffset can be changed // with parseZone. if (config._tzm != null) { config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm); } if (config._nextDay) { config._a[HOUR] = 24; } // check for mismatching day of week if ( config._w && typeof config._w.d !== 'undefined' && config._w.d !== expectedWeekday ) { getParsingFlags(config).weekdayMismatch = true; } } function dayOfYearFromWeekInfo(config) { var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow, curWeek; w = config._w; if (w.GG != null || w.W != null || w.E != null) { dow = 1; doy = 4; // TODO: We need to take the current isoWeekYear, but that depends on // how we interpret now (local, utc, fixed offset). So create // a now version of current config (take local/utc/offset flags, and // create now). weekYear = defaults( w.GG, config._a[YEAR], weekOfYear(createLocal(), 1, 4).year ); week = defaults(w.W, 1); weekday = defaults(w.E, 1); if (weekday < 1 || weekday > 7) { weekdayOverflow = true; } } else { dow = config._locale._week.dow; doy = config._locale._week.doy; curWeek = weekOfYear(createLocal(), dow, doy); weekYear = defaults(w.gg, config._a[YEAR], curWeek.year); // Default to current week. week = defaults(w.w, curWeek.week); if (w.d != null) { // weekday -- low day numbers are considered next week weekday = w.d; if (weekday < 0 || weekday > 6) { weekdayOverflow = true; } } else if (w.e != null) { // local weekday -- counting starts from beginning of week weekday = w.e + dow; if (w.e < 0 || w.e > 6) { weekdayOverflow = true; } } else { // default to beginning of week weekday = dow; } } if (week < 1 || week > weeksInYear(weekYear, dow, doy)) { getParsingFlags(config)._overflowWeeks = true; } else if (weekdayOverflow != null) { getParsingFlags(config)._overflowWeekday = true; } else { temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy); config._a[YEAR] = temp.year; config._dayOfYear = temp.dayOfYear; } } // constant that refers to the ISO standard hooks.ISO_8601 = function () {}; // constant that refers to the RFC 2822 form hooks.RFC_2822 = function () {}; // date from string and format string function configFromStringAndFormat(config) { // TODO: Move this to another part of the creation flow to prevent circular deps if (config._f === hooks.ISO_8601) { configFromISO(config); return; } if (config._f === hooks.RFC_2822) { configFromRFC2822(config); return; } config._a = []; getParsingFlags(config).empty = true; // This array is used to make a Date, either with `new Date` or `Date.UTC` var string = '' + config._i, i, parsedInput, tokens, token, skipped, stringLength = string.length, totalParsedInputLength = 0, era, tokenLen; tokens = expandFormat(config._f, config._locale).match(formattingTokens) || []; tokenLen = tokens.length; for (i = 0; i < tokenLen; i++) { token = tokens[i]; parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0]; if (parsedInput) { skipped = string.substr(0, string.indexOf(parsedInput)); if (skipped.length > 0) { getParsingFlags(config).unusedInput.push(skipped); } string = string.slice( string.indexOf(parsedInput) + parsedInput.length ); totalParsedInputLength += parsedInput.length; } // don't parse if it's not a known token if (formatTokenFunctions[token]) { if (parsedInput) { getParsingFlags(config).empty = false; } else { getParsingFlags(config).unusedTokens.push(token); } addTimeToArrayFromToken(token, parsedInput, config); } else if (config._strict && !parsedInput) { getParsingFlags(config).unusedTokens.push(token); } } // add remaining unparsed input length to the string getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength; if (string.length > 0) { getParsingFlags(config).unusedInput.push(string); } // clear _12h flag if hour is <= 12 if ( config._a[HOUR] <= 12 && getParsingFlags(config).bigHour === true && config._a[HOUR] > 0 ) { getParsingFlags(config).bigHour = undefined; } getParsingFlags(config).parsedDateParts = config._a.slice(0); getParsingFlags(config).meridiem = config._meridiem; // handle meridiem config._a[HOUR] = meridiemFixWrap( config._locale, config._a[HOUR], config._meridiem ); // handle era era = getParsingFlags(config).era; if (era !== null) { config._a[YEAR] = config._locale.erasConvertYear(era, config._a[YEAR]); } configFromArray(config); checkOverflow(config); } function meridiemFixWrap(locale, hour, meridiem) { var isPm; if (meridiem == null) { // nothing to do return hour; } if (locale.meridiemHour != null) { return locale.meridiemHour(hour, meridiem); } else if (locale.isPM != null) { // Fallback isPm = locale.isPM(meridiem); if (isPm && hour < 12) { hour += 12; } if (!isPm && hour === 12) { hour = 0; } return hour; } else { // this is not supposed to happen return hour; } } // date from string and array of format strings function configFromStringAndArray(config) { var tempConfig, bestMoment, scoreToBeat, i, currentScore, validFormatFound, bestFormatIsValid = false, configfLen = config._f.length; if (configfLen === 0) { getParsingFlags(config).invalidFormat = true; config._d = new Date(NaN); return; } for (i = 0; i < configfLen; i++) { currentScore = 0; validFormatFound = false; tempConfig = copyConfig({}, config); if (config._useUTC != null) { tempConfig._useUTC = config._useUTC; } tempConfig._f = config._f[i]; configFromStringAndFormat(tempConfig); if (isValid(tempConfig)) { validFormatFound = true; } // if there is any input that was not parsed add a penalty for that format currentScore += getParsingFlags(tempConfig).charsLeftOver; //or tokens currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10; getParsingFlags(tempConfig).score = currentScore; if (!bestFormatIsValid) { if ( scoreToBeat == null || currentScore < scoreToBeat || validFormatFound ) { scoreToBeat = currentScore; bestMoment = tempConfig; if (validFormatFound) { bestFormatIsValid = true; } } } else { if (currentScore < scoreToBeat) { scoreToBeat = currentScore; bestMoment = tempConfig; } } } extend(config, bestMoment || tempConfig); } function configFromObject(config) { if (config._d) { return; } var i = normalizeObjectUnits(config._i), dayOrDate = i.day === undefined ? i.date : i.day; config._a = map( [i.year, i.month, dayOrDate, i.hour, i.minute, i.second, i.millisecond], function (obj) { return obj && parseInt(obj, 10); } ); configFromArray(config); } function createFromConfig(config) { var res = new Moment(checkOverflow(prepareConfig(config))); if (res._nextDay) { // Adding is smart enough around DST res.add(1, 'd'); res._nextDay = undefined; } return res; } function prepareConfig(config) { var input = config._i, format = config._f; config._locale = config._locale || getLocale(config._l); if (input === null || (format === undefined && input === '')) { return createInvalid({ nullInput: true }); } if (typeof input === 'string') { config._i = input = config._locale.preparse(input); } if (isMoment(input)) { return new Moment(checkOverflow(input)); } else if (isDate(input)) { config._d = input; } else if (isArray(format)) { configFromStringAndArray(config); } else if (format) { configFromStringAndFormat(config); } else { configFromInput(config); } if (!isValid(config)) { config._d = null; } return config; } function configFromInput(config) { var input = config._i; if (isUndefined(input)) { config._d = new Date(hooks.now()); } else if (isDate(input)) { config._d = new Date(input.valueOf()); } else if (typeof input === 'string') { configFromString(config); } else if (isArray(input)) { config._a = map(input.slice(0), function (obj) { return parseInt(obj, 10); }); configFromArray(config); } else if (isObject(input)) { configFromObject(config); } else if (isNumber(input)) { // from milliseconds config._d = new Date(input); } else { hooks.createFromInputFallback(config); } } function createLocalOrUTC(input, format, locale, strict, isUTC) { var c = {}; if (format === true || format === false) { strict = format; format = undefined; } if (locale === true || locale === false) { strict = locale; locale = undefined; } if ( (isObject(input) && isObjectEmpty(input)) || (isArray(input) && input.length === 0) ) { input = undefined; } // object construction must be done this way. // https://github.com/moment/moment/issues/1423 c._isAMomentObject = true; c._useUTC = c._isUTC = isUTC; c._l = locale; c._i = input; c._f = format; c._strict = strict; return createFromConfig(c); } function createLocal(input, format, locale, strict) { return createLocalOrUTC(input, format, locale, strict, false); } var prototypeMin = deprecate( 'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/', function () { var other = createLocal.apply(null, arguments); if (this.isValid() && other.isValid()) { return other < this ? this : other; } else { return createInvalid(); } } ), prototypeMax = deprecate( 'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/', function () { var other = createLocal.apply(null, arguments); if (this.isValid() && other.isValid()) { return other > this ? this : other; } else { return createInvalid(); } } ); // Pick a moment m from moments so that m[fn](other) is true for all // other. This relies on the function fn to be transitive. // // moments should either be an array of moment objects or an array, whose // first element is an array of moment objects. function pickBy(fn, moments) { var res, i; if (moments.length === 1 && isArray(moments[0])) { moments = moments[0]; } if (!moments.length) { return createLocal(); } res = moments[0]; for (i = 1; i < moments.length; ++i) { if (!moments[i].isValid() || moments[i][fn](res)) { res = moments[i]; } } return res; } // TODO: Use [].sort instead? function min() { var args = [].slice.call(arguments, 0); return pickBy('isBefore', args); } function max() { var args = [].slice.call(arguments, 0); return pickBy('isAfter', args); } var now = function () { return Date.now ? Date.now() : +new Date(); }; var ordering = [ 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', 'millisecond', ]; function isDurationValid(m) { var key, unitHasDecimal = false, i, orderLen = ordering.length; for (key in m) { if ( hasOwnProp(m, key) && !( indexOf.call(ordering, key) !== -1 && (m[key] == null || !isNaN(m[key])) ) ) { return false; } } for (i = 0; i < orderLen; ++i) { if (m[ordering[i]]) { if (unitHasDecimal) { return false; // only allow non-integers for smallest unit } if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) { unitHasDecimal = true; } } } return true; } function isValid$1() { return this._isValid; } function createInvalid$1() { return createDuration(NaN); } function Duration(duration) { var normalizedInput = normalizeObjectUnits(duration), years = normalizedInput.year || 0, quarters = normalizedInput.quarter || 0, months = normalizedInput.month || 0, weeks = normalizedInput.week || normalizedInput.isoWeek || 0, days = normalizedInput.day || 0, hours = normalizedInput.hour || 0, minutes = normalizedInput.minute || 0, seconds = normalizedInput.second || 0, milliseconds = normalizedInput.millisecond || 0; this._isValid = isDurationValid(normalizedInput); // representation for dateAddRemove this._milliseconds = +milliseconds + seconds * 1e3 + // 1000 minutes * 6e4 + // 1000 * 60 hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978 // Because of dateAddRemove treats 24 hours as different from a // day when working around DST, we need to store them separately this._days = +days + weeks * 7; // It is impossible to translate months into days without knowing // which months you are are talking about, so we have to store // it separately. this._months = +months + quarters * 3 + years * 12; this._data = {}; this._locale = getLocale(); this._bubble(); } function isDuration(obj) { return obj instanceof Duration; } function absRound(number) { if (number < 0) { return Math.round(-1 * number) * -1; } else { return Math.round(number); } } // compare two arrays, return the number of differences function compareArrays(array1, array2, dontConvert) { var len = Math.min(array1.length, array2.length), lengthDiff = Math.abs(array1.length - array2.length), diffs = 0, i; for (i = 0; i < len; i++) { if ( (dontConvert && array1[i] !== array2[i]) || (!dontConvert && toInt(array1[i]) !== toInt(array2[i])) ) { diffs++; } } return diffs + lengthDiff; } // FORMATTING function offset(token, separator) { addFormatToken(token, 0, 0, function () { var offset = this.utcOffset(), sign = '+'; if (offset < 0) { offset = -offset; sign = '-'; } return ( sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~offset % 60, 2) ); }); } offset('Z', ':'); offset('ZZ', ''); // PARSING addRegexToken('Z', matchShortOffset); addRegexToken('ZZ', matchShortOffset); addParseToken(['Z', 'ZZ'], function (input, array, config) { config._useUTC = true; config._tzm = offsetFromString(matchShortOffset, input); }); // HELPERS // timezone chunker // '+10:00' > ['10', '00'] // '-1530' > ['-15', '30'] var chunkOffset = /([\+\-]|\d\d)/gi; function offsetFromString(matcher, string) { var matches = (string || '').match(matcher), chunk, parts, minutes; if (matches === null) { return null; } chunk = matches[matches.length - 1] || []; parts = (chunk + '').match(chunkOffset) || ['-', 0, 0]; minutes = +(parts[1] * 60) + toInt(parts[2]); return minutes === 0 ? 0 : parts[0] === '+' ? minutes : -minutes; } // Return a moment from input, that is local/utc/zone equivalent to model. function cloneWithOffset(input, model) { var res, diff; if (model._isUTC) { res = model.clone(); diff = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf(); // Use low-level api, because this fn is low-level api. res._d.setTime(res._d.valueOf() + diff); hooks.updateOffset(res, false); return res; } else { return createLocal(input).local(); } } function getDateOffset(m) { // On Firefox.24 Date#getTimezoneOffset returns a floating point. // https://github.com/moment/moment/pull/1871 return -Math.round(m._d.getTimezoneOffset()); } // HOOKS // This function will be called whenever a moment is mutated. // It is intended to keep the offset in sync with the timezone. hooks.updateOffset = function () {}; // MOMENTS // keepLocalTime = true means only change the timezone, without // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]--> // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset // +0200, so we adjust the time as needed, to be valid. // // Keeping the time actually adds/subtracts (one hour) // from the actual represented time. That is why we call updateOffset // a second time. In case it wants us to change the offset again // _changeInProgress == true case, then we have to adjust, because // there is no such time in the given timezone. function getSetOffset(input, keepLocalTime, keepMinutes) { var offset = this._offset || 0, localAdjust; if (!this.isValid()) { return input != null ? this : NaN; } if (input != null) { if (typeof input === 'string') { input = offsetFromString(matchShortOffset, input); if (input === null) { return this; } } else if (Math.abs(input) < 16 && !keepMinutes) { input = input * 60; } if (!this._isUTC && keepLocalTime) { localAdjust = getDateOffset(this); } this._offset = input; this._isUTC = true; if (localAdjust != null) { this.add(localAdjust, 'm'); } if (offset !== input) { if (!keepLocalTime || this._changeInProgress) { addSubtract( this, createDuration(input - offset, 'm'), 1, false ); } else if (!this._changeInProgress) { this._changeInProgress = true; hooks.updateOffset(this, true); this._changeInProgress = null; } } return this; } else { return this._isUTC ? offset : getDateOffset(this); } } function getSetZone(input, keepLocalTime) { if (input != null) { if (typeof input !== 'string') { input = -input; } this.utcOffset(input, keepLocalTime); return this; } else { return -this.utcOffset(); } } function setOffsetToUTC(keepLocalTime) { return this.utcOffset(0, keepLocalTime); } function setOffsetToLocal(keepLocalTime) { if (this._isUTC) { this.utcOffset(0, keepLocalTime); this._isUTC = false; if (keepLocalTime) { this.subtract(getDateOffset(this), 'm'); } } return this; } function setOffsetToParsedOffset() { if (this._tzm != null) { this.utcOffset(this._tzm, false, true); } else if (typeof this._i === 'string') { var tZone = offsetFromString(matchOffset, this._i); if (tZone != null) { this.utcOffset(tZone); } else { this.utcOffset(0, true); } } return this; } function hasAlignedHourOffset(input) { if (!this.isValid()) { return false; } input = input ? createLocal(input).utcOffset() : 0; return (this.utcOffset() - input) % 60 === 0; } function isDaylightSavingTime() { return ( this.utcOffset() > this.clone().month(0).utcOffset() || this.utcOffset() > this.clone().month(5).utcOffset() ); } function isDaylightSavingTimeShifted() { if (!isUndefined(this._isDSTShifted)) { return this._isDSTShifted; } var c = {}, other; copyConfig(c, this); c = prepareConfig(c); if (c._a) { other = c._isUTC ? createUTC(c._a) : createLocal(c._a); this._isDSTShifted = this.isValid() && compareArrays(c._a, other.toArray()) > 0; } else { this._isDSTShifted = false; } return this._isDSTShifted; } function isLocal() { return this.isValid() ? !this._isUTC : false; } function isUtcOffset() { return this.isValid() ? this._isUTC : false; } function isUtc() { return this.isValid() ? this._isUTC && this._offset === 0 : false; } // ASP.NET json date format regex var aspNetRegex = /^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/, // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere // and further modified to allow for strings containing both week and day isoRegex = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/; function createDuration(input, key) { var duration = input, // matching against regexp is expensive, do it on demand match = null, sign, ret, diffRes; if (isDuration(input)) { duration = { ms: input._milliseconds, d: input._days, M: input._months, }; } else if (isNumber(input) || !isNaN(+input)) { duration = {}; if (key) { duration[key] = +input; } else { duration.milliseconds = +input; } } else if ((match = aspNetRegex.exec(input))) { sign = match[1] === '-' ? -1 : 1; duration = { y: 0, d: toInt(match[DATE]) * sign, h: toInt(match[HOUR]) * sign, m: toInt(match[MINUTE]) * sign, s: toInt(match[SECOND]) * sign, ms: toInt(absRound(match[MILLISECOND] * 1000)) * sign, // the millisecond decimal point is included in the match }; } else if ((match = isoRegex.exec(input))) { sign = match[1] === '-' ? -1 : 1; duration = { y: parseIso(match[2], sign), M: parseIso(match[3], sign), w: parseIso(match[4], sign), d: parseIso(match[5], sign), h: parseIso(match[6], sign), m: parseIso(match[7], sign), s: parseIso(match[8], sign), }; } else if (duration == null) { // checks for null or undefined duration = {}; } else if ( typeof duration === 'object' && ('from' in duration || 'to' in duration) ) { diffRes = momentsDifference( createLocal(duration.from), createLocal(duration.to) ); duration = {}; duration.ms = diffRes.milliseconds; duration.M = diffRes.months; } ret = new Duration(duration); if (isDuration(input) && hasOwnProp(input, '_locale')) { ret._locale = input._locale; } if (isDuration(input) && hasOwnProp(input, '_isValid')) { ret._isValid = input._isValid; } return ret; } createDuration.fn = Duration.prototype; createDuration.invalid = createInvalid$1; function parseIso(inp, sign) { // We'd normally use ~~inp for this, but unfortunately it also // converts floats to ints. // inp may be undefined, so careful calling replace on it. var res = inp && parseFloat(inp.replace(',', '.')); // apply sign while we're at it return (isNaN(res) ? 0 : res) * sign; } function positiveMomentsDifference(base, other) { var res = {}; res.months = other.month() - base.month() + (other.year() - base.year()) * 12; if (base.clone().add(res.months, 'M').isAfter(other)) { --res.months; } res.milliseconds = +other - +base.clone().add(res.months, 'M'); return res; } function momentsDifference(base, other) { var res; if (!(base.isValid() && other.isValid())) { return { milliseconds: 0, months: 0 }; } other = cloneWithOffset(other, base); if (base.isBefore(other)) { res = positiveMomentsDifference(base, other); } else { res = positiveMomentsDifference(other, base); res.milliseconds = -res.milliseconds; res.months = -res.months; } return res; } // TODO: remove 'name' arg after deprecation is removed function createAdder(direction, name) { return function (val, period) { var dur, tmp; //invert the arguments, but complain about it if (period !== null && !isNaN(+period)) { deprecateSimple( name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' + 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.' ); tmp = val; val = period; period = tmp; } dur = createDuration(val, period); addSubtract(this, dur, direction); return this; }; } function addSubtract(mom, duration, isAdding, updateOffset) { var milliseconds = duration._milliseconds, days = absRound(duration._days), months = absRound(duration._months); if (!mom.isValid()) { // No op return; } updateOffset = updateOffset == null ? true : updateOffset; if (months) { setMonth(mom, get(mom, 'Month') + months * isAdding); } if (days) { set$1(mom, 'Date', get(mom, 'Date') + days * isAdding); } if (milliseconds) { mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding); } if (updateOffset) { hooks.updateOffset(mom, days || months); } } var add = createAdder(1, 'add'), subtract = createAdder(-1, 'subtract'); function isString(input) { return typeof input === 'string' || input instanceof String; } // type MomentInput = Moment | Date | string | number | (number | string)[] | MomentInputObject | void; // null | undefined function isMomentInput(input) { return ( isMoment(input) || isDate(input) || isString(input) || isNumber(input) || isNumberOrStringArray(input) || isMomentInputObject(input) || input === null || input === undefined ); } function isMomentInputObject(input) { var objectTest = isObject(input) && !isObjectEmpty(input), propertyTest = false, properties = [ 'years', 'year', 'y', 'months', 'month', 'M', 'days', 'day', 'd', 'dates', 'date', 'D', 'hours', 'hour', 'h', 'minutes', 'minute', 'm', 'seconds', 'second', 's', 'milliseconds', 'millisecond', 'ms', ], i, property, propertyLen = properties.length; for (i = 0; i < propertyLen; i += 1) { property = properties[i]; propertyTest = propertyTest || hasOwnProp(input, property); } return objectTest && propertyTest; } function isNumberOrStringArray(input) { var arrayTest = isArray(input), dataTypeTest = false; if (arrayTest) { dataTypeTest = input.filter(function (item) { return !isNumber(item) && isString(input); }).length === 0; } return arrayTest && dataTypeTest; } function isCalendarSpec(input) { var objectTest = isObject(input) && !isObjectEmpty(input), propertyTest = false, properties = [ 'sameDay', 'nextDay', 'lastDay', 'nextWeek', 'lastWeek', 'sameElse', ], i, property; for (i = 0; i < properties.length; i += 1) { property = properties[i]; propertyTest = propertyTest || hasOwnProp(input, property); } return objectTest && propertyTest; } function getCalendarFormat(myMoment, now) { var diff = myMoment.diff(now, 'days', true); return diff < -6 ? 'sameElse' : diff < -1 ? 'lastWeek' : diff < 0 ? 'lastDay' : diff < 1 ? 'sameDay' : diff < 2 ? 'nextDay' : diff < 7 ? 'nextWeek' : 'sameElse'; } function calendar$1(time, formats) { // Support for single parameter, formats only overload to the calendar function if (arguments.length === 1) { if (!arguments[0]) { time = undefined; formats = undefined; } else if (isMomentInput(arguments[0])) { time = arguments[0]; formats = undefined; } else if (isCalendarSpec(arguments[0])) { formats = arguments[0]; time = undefined; } } // We want to compare the start of today, vs this. // Getting start-of-today depends on whether we're local/utc/offset or not. var now = time || createLocal(), sod = cloneWithOffset(now, this).startOf('day'), format = hooks.calendarFormat(this, sod) || 'sameElse', output = formats && (isFunction(formats[format]) ? formats[format].call(this, now) : formats[format]); return this.format( output || this.localeData().calendar(format, this, createLocal(now)) ); } function clone() { return new Moment(this); } function isAfter(input, units) { var localInput = isMoment(input) ? input : createLocal(input); if (!(this.isValid() && localInput.isValid())) { return false; } units = normalizeUnits(units) || 'millisecond'; if (units === 'millisecond') { return this.valueOf() > localInput.valueOf(); } else { return localInput.valueOf() < this.clone().startOf(units).valueOf(); } } function isBefore(input, units) { var localInput = isMoment(input) ? input : createLocal(input); if (!(this.isValid() && localInput.isValid())) { return false; } units = normalizeUnits(units) || 'millisecond'; if (units === 'millisecond') { return this.valueOf() < localInput.valueOf(); } else { return this.clone().endOf(units).valueOf() < localInput.valueOf(); } } function isBetween(from, to, units, inclusivity) { var localFrom = isMoment(from) ? from : createLocal(from), localTo = isMoment(to) ? to : createLocal(to); if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) { return false; } inclusivity = inclusivity || '()'; return ( (inclusivity[0] === '(' ? this.isAfter(localFrom, units) : !this.isBefore(localFrom, units)) && (inclusivity[1] === ')' ? this.isBefore(localTo, units) : !this.isAfter(localTo, units)) ); } function isSame(input, units) { var localInput = isMoment(input) ? input : createLocal(input), inputMs; if (!(this.isValid() && localInput.isValid())) { return false; } units = normalizeUnits(units) || 'millisecond'; if (units === 'millisecond') { return this.valueOf() === localInput.valueOf(); } else { inputMs = localInput.valueOf(); return ( this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf() ); } } function isSameOrAfter(input, units) { return this.isSame(input, units) || this.isAfter(input, units); } function isSameOrBefore(input, units) { return this.isSame(input, units) || this.isBefore(input, units); } function diff(input, units, asFloat) { var that, zoneDelta, output; if (!this.isValid()) { return NaN; } that = cloneWithOffset(input, this); if (!that.isValid()) { return NaN; } zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4; units = normalizeUnits(units); switch (units) { case 'year': output = monthDiff(this, that) / 12; break; case 'month': output = monthDiff(this, that); break; case 'quarter': output = monthDiff(this, that) / 3; break; case 'second': output = (this - that) / 1e3; break; // 1000 case 'minute': output = (this - that) / 6e4; break; // 1000 * 60 case 'hour': output = (this - that) / 36e5; break; // 1000 * 60 * 60 case 'day': output = (this - that - zoneDelta) / 864e5; break; // 1000 * 60 * 60 * 24, negate dst case 'week': output = (this - that - zoneDelta) / 6048e5; break; // 1000 * 60 * 60 * 24 * 7, negate dst default: output = this - that; } return asFloat ? output : absFloor(output); } function monthDiff(a, b) { if (a.date() < b.date()) { // end-of-month calculations work correct when the start month has more // days than the end month. return -monthDiff(b, a); } // difference in months var wholeMonthDiff = (b.year() - a.year()) * 12 + (b.month() - a.month()), // b is in (anchor - 1 month, anchor + 1 month) anchor = a.clone().add(wholeMonthDiff, 'months'), anchor2, adjust; if (b - anchor < 0) { anchor2 = a.clone().add(wholeMonthDiff - 1, 'months'); // linear across the month adjust = (b - anchor) / (anchor - anchor2); } else { anchor2 = a.clone().add(wholeMonthDiff + 1, 'months'); // linear across the month adjust = (b - anchor) / (anchor2 - anchor); } //check for negative zero, return zero if negative zero return -(wholeMonthDiff + adjust) || 0; } hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ'; hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]'; function toString() { return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ'); } function toISOString(keepOffset) { if (!this.isValid()) { return null; } var utc = keepOffset !== true, m = utc ? this.clone().utc() : this; if (m.year() < 0 || m.year() > 9999) { return formatMoment( m, utc ? 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYYYY-MM-DD[T]HH:mm:ss.SSSZ' ); } if (isFunction(Date.prototype.toISOString)) { // native implementation is ~50x faster, use it when we can if (utc) { return this.toDate().toISOString(); } else { return new Date(this.valueOf() + this.utcOffset() * 60 * 1000) .toISOString() .replace('Z', formatMoment(m, 'Z')); } } return formatMoment( m, utc ? 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYY-MM-DD[T]HH:mm:ss.SSSZ' ); } /** * Return a human readable representation of a moment that can * also be evaluated to get a new moment which is the same * * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects */ function inspect() { if (!this.isValid()) { return 'moment.invalid(/* ' + this._i + ' */)'; } var func = 'moment', zone = '', prefix, year, datetime, suffix; if (!this.isLocal()) { func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone'; zone = 'Z'; } prefix = '[' + func + '("]'; year = 0 <= this.year() && this.year() <= 9999 ? 'YYYY' : 'YYYYYY'; datetime = '-MM-DD[T]HH:mm:ss.SSS'; suffix = zone + '[")]'; return this.format(prefix + year + datetime + suffix); } function format(inputString) { if (!inputString) { inputString = this.isUtc() ? hooks.defaultFormatUtc : hooks.defaultFormat; } var output = formatMoment(this, inputString); return this.localeData().postformat(output); } function from(time, withoutSuffix) { if ( this.isValid() && ((isMoment(time) && time.isValid()) || createLocal(time).isValid()) ) { return createDuration({ to: this, from: time }) .locale(this.locale()) .humanize(!withoutSuffix); } else { return this.localeData().invalidDate(); } } function fromNow(withoutSuffix) { return this.from(createLocal(), withoutSuffix); } function to(time, withoutSuffix) { if ( this.isValid() && ((isMoment(time) && time.isValid()) || createLocal(time).isValid()) ) { return createDuration({ from: this, to: time }) .locale(this.locale()) .humanize(!withoutSuffix); } else { return this.localeData().invalidDate(); } } function toNow(withoutSuffix) { return this.to(createLocal(), withoutSuffix); } // If passed a locale key, it will set the locale for this // instance. Otherwise, it will return the locale configuration // variables for this instance. function locale(key) { var newLocaleData; if (key === undefined) { return this._locale._abbr; } else { newLocaleData = getLocale(key); if (newLocaleData != null) { this._locale = newLocaleData; } return this; } } var lang = deprecate( 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.', function (key) { if (key === undefined) { return this.localeData(); } else { return this.locale(key); } } ); function localeData() { return this._locale; } var MS_PER_SECOND = 1000, MS_PER_MINUTE = 60 * MS_PER_SECOND, MS_PER_HOUR = 60 * MS_PER_MINUTE, MS_PER_400_YEARS = (365 * 400 + 97) * 24 * MS_PER_HOUR; // actual modulo - handles negative numbers (for dates before 1970): function mod$1(dividend, divisor) { return ((dividend % divisor) + divisor) % divisor; } function localStartOfDate(y, m, d) { // the date constructor remaps years 0-99 to 1900-1999 if (y < 100 && y >= 0) { // preserve leap years using a full 400 year cycle, then reset return new Date(y + 400, m, d) - MS_PER_400_YEARS; } else { return new Date(y, m, d).valueOf(); } } function utcStartOfDate(y, m, d) { // Date.UTC remaps years 0-99 to 1900-1999 if (y < 100 && y >= 0) { // preserve leap years using a full 400 year cycle, then reset return Date.UTC(y + 400, m, d) - MS_PER_400_YEARS; } else { return Date.UTC(y, m, d); } } function startOf(units) { var time, startOfDate; units = normalizeUnits(units); if (units === undefined || units === 'millisecond' || !this.isValid()) { return this; } startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate; switch (units) { case 'year': time = startOfDate(this.year(), 0, 1); break; case 'quarter': time = startOfDate( this.year(), this.month() - (this.month() % 3), 1 ); break; case 'month': time = startOfDate(this.year(), this.month(), 1); break; case 'week': time = startOfDate( this.year(), this.month(), this.date() - this.weekday() ); break; case 'isoWeek': time = startOfDate( this.year(), this.month(), this.date() - (this.isoWeekday() - 1) ); break; case 'day': case 'date': time = startOfDate(this.year(), this.month(), this.date()); break; case 'hour': time = this._d.valueOf(); time -= mod$1( time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), MS_PER_HOUR ); break; case 'minute': time = this._d.valueOf(); time -= mod$1(time, MS_PER_MINUTE); break; case 'second': time = this._d.valueOf(); time -= mod$1(time, MS_PER_SECOND); break; } this._d.setTime(time); hooks.updateOffset(this, true); return this; } function endOf(units) { var time, startOfDate; units = normalizeUnits(units); if (units === undefined || units === 'millisecond' || !this.isValid()) { return this; } startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate; switch (units) { case 'year': time = startOfDate(this.year() + 1, 0, 1) - 1; break; case 'quarter': time = startOfDate( this.year(), this.month() - (this.month() % 3) + 3, 1 ) - 1; break; case 'month': time = startOfDate(this.year(), this.month() + 1, 1) - 1; break; case 'week': time = startOfDate( this.year(), this.month(), this.date() - this.weekday() + 7 ) - 1; break; case 'isoWeek': time = startOfDate( this.year(), this.month(), this.date() - (this.isoWeekday() - 1) + 7 ) - 1; break; case 'day': case 'date': time = startOfDate(this.year(), this.month(), this.date() + 1) - 1; break; case 'hour': time = this._d.valueOf(); time += MS_PER_HOUR - mod$1( time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), MS_PER_HOUR ) - 1; break; case 'minute': time = this._d.valueOf(); time += MS_PER_MINUTE - mod$1(time, MS_PER_MINUTE) - 1; break; case 'second': time = this._d.valueOf(); time += MS_PER_SECOND - mod$1(time, MS_PER_SECOND) - 1; break; } this._d.setTime(time); hooks.updateOffset(this, true); return this; } function valueOf() { return this._d.valueOf() - (this._offset || 0) * 60000; } function unix() { return Math.floor(this.valueOf() / 1000); } function toDate() { return new Date(this.valueOf()); } function toArray() { var m = this; return [ m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond(), ]; } function toObject() { var m = this; return { years: m.year(), months: m.month(), date: m.date(), hours: m.hours(), minutes: m.minutes(), seconds: m.seconds(), milliseconds: m.milliseconds(), }; } function toJSON() { // new Date(NaN).toJSON() === null return this.isValid() ? this.toISOString() : null; } function isValid$2() { return isValid(this); } function parsingFlags() { return extend({}, getParsingFlags(this)); } function invalidAt() { return getParsingFlags(this).overflow; } function creationData() { return { input: this._i, format: this._f, locale: this._locale, isUTC: this._isUTC, strict: this._strict, }; } addFormatToken('N', 0, 0, 'eraAbbr'); addFormatToken('NN', 0, 0, 'eraAbbr'); addFormatToken('NNN', 0, 0, 'eraAbbr'); addFormatToken('NNNN', 0, 0, 'eraName'); addFormatToken('NNNNN', 0, 0, 'eraNarrow'); addFormatToken('y', ['y', 1], 'yo', 'eraYear'); addFormatToken('y', ['yy', 2], 0, 'eraYear'); addFormatToken('y', ['yyy', 3], 0, 'eraYear'); addFormatToken('y', ['yyyy', 4], 0, 'eraYear'); addRegexToken('N', matchEraAbbr); addRegexToken('NN', matchEraAbbr); addRegexToken('NNN', matchEraAbbr); addRegexToken('NNNN', matchEraName); addRegexToken('NNNNN', matchEraNarrow); addParseToken( ['N', 'NN', 'NNN', 'NNNN', 'NNNNN'], function (input, array, config, token) { var era = config._locale.erasParse(input, token, config._strict); if (era) { getParsingFlags(config).era = era; } else { getParsingFlags(config).invalidEra = input; } } ); addRegexToken('y', matchUnsigned); addRegexToken('yy', matchUnsigned); addRegexToken('yyy', matchUnsigned); addRegexToken('yyyy', matchUnsigned); addRegexToken('yo', matchEraYearOrdinal); addParseToken(['y', 'yy', 'yyy', 'yyyy'], YEAR); addParseToken(['yo'], function (input, array, config, token) { var match; if (config._locale._eraYearOrdinalRegex) { match = input.match(config._locale._eraYearOrdinalRegex); } if (config._locale.eraYearOrdinalParse) { array[YEAR] = config._locale.eraYearOrdinalParse(input, match); } else { array[YEAR] = parseInt(input, 10); } }); function localeEras(m, format) { var i, l, date, eras = this._eras || getLocale('en')._eras; for (i = 0, l = eras.length; i < l; ++i) { switch (typeof eras[i].since) { case 'string': // truncate time date = hooks(eras[i].since).startOf('day'); eras[i].since = date.valueOf(); break; } switch (typeof eras[i].until) { case 'undefined': eras[i].until = +Infinity; break; case 'string': // truncate time date = hooks(eras[i].until).startOf('day').valueOf(); eras[i].until = date.valueOf(); break; } } return eras; } function localeErasParse(eraName, format, strict) { var i, l, eras = this.eras(), name, abbr, narrow; eraName = eraName.toUpperCase(); for (i = 0, l = eras.length; i < l; ++i) { name = eras[i].name.toUpperCase(); abbr = eras[i].abbr.toUpperCase(); narrow = eras[i].narrow.toUpperCase(); if (strict) { switch (format) { case 'N': case 'NN': case 'NNN': if (abbr === eraName) { return eras[i]; } break; case 'NNNN': if (name === eraName) { return eras[i]; } break; case 'NNNNN': if (narrow === eraName) { return eras[i]; } break; } } else if ([name, abbr, narrow].indexOf(eraName) >= 0) { return eras[i]; } } } function localeErasConvertYear(era, year) { var dir = era.since <= era.until ? +1 : -1; if (year === undefined) { return hooks(era.since).year(); } else { return hooks(era.since).year() + (year - era.offset) * dir; } } function getEraName() { var i, l, val, eras = this.localeData().eras(); for (i = 0, l = eras.length; i < l; ++i) { // truncate time val = this.clone().startOf('day').valueOf(); if (eras[i].since <= val && val <= eras[i].until) { return eras[i].name; } if (eras[i].until <= val && val <= eras[i].since) { return eras[i].name; } } return ''; } function getEraNarrow() { var i, l, val, eras = this.localeData().eras(); for (i = 0, l = eras.length; i < l; ++i) { // truncate time val = this.clone().startOf('day').valueOf(); if (eras[i].since <= val && val <= eras[i].until) { return eras[i].narrow; } if (eras[i].until <= val && val <= eras[i].since) { return eras[i].narrow; } } return ''; } function getEraAbbr() { var i, l, val, eras = this.localeData().eras(); for (i = 0, l = eras.length; i < l; ++i) { // truncate time val = this.clone().startOf('day').valueOf(); if (eras[i].since <= val && val <= eras[i].until) { return eras[i].abbr; } if (eras[i].until <= val && val <= eras[i].since) { return eras[i].abbr; } } return ''; } function getEraYear() { var i, l, dir, val, eras = this.localeData().eras(); for (i = 0, l = eras.length; i < l; ++i) { dir = eras[i].since <= eras[i].until ? +1 : -1; // truncate time val = this.clone().startOf('day').valueOf(); if ( (eras[i].since <= val && val <= eras[i].until) || (eras[i].until <= val && val <= eras[i].since) ) { return ( (this.year() - hooks(eras[i].since).year()) * dir + eras[i].offset ); } } return this.year(); } function erasNameRegex(isStrict) { if (!hasOwnProp(this, '_erasNameRegex')) { computeErasParse.call(this); } return isStrict ? this._erasNameRegex : this._erasRegex; } function erasAbbrRegex(isStrict) { if (!hasOwnProp(this, '_erasAbbrRegex')) { computeErasParse.call(this); } return isStrict ? this._erasAbbrRegex : this._erasRegex; } function erasNarrowRegex(isStrict) { if (!hasOwnProp(this, '_erasNarrowRegex')) { computeErasParse.call(this); } return isStrict ? this._erasNarrowRegex : this._erasRegex; } function matchEraAbbr(isStrict, locale) { return locale.erasAbbrRegex(isStrict); } function matchEraName(isStrict, locale) { return locale.erasNameRegex(isStrict); } function matchEraNarrow(isStrict, locale) { return locale.erasNarrowRegex(isStrict); } function matchEraYearOrdinal(isStrict, locale) { return locale._eraYearOrdinalRegex || matchUnsigned; } function computeErasParse() { var abbrPieces = [], namePieces = [], narrowPieces = [], mixedPieces = [], i, l, erasName, erasAbbr, erasNarrow, eras = this.eras(); for (i = 0, l = eras.length; i < l; ++i) { erasName = regexEscape(eras[i].name); erasAbbr = regexEscape(eras[i].abbr); erasNarrow = regexEscape(eras[i].narrow); namePieces.push(erasName); abbrPieces.push(erasAbbr); narrowPieces.push(erasNarrow); mixedPieces.push(erasName); mixedPieces.push(erasAbbr); mixedPieces.push(erasNarrow); } this._erasRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); this._erasNameRegex = new RegExp('^(' + namePieces.join('|') + ')', 'i'); this._erasAbbrRegex = new RegExp('^(' + abbrPieces.join('|') + ')', 'i'); this._erasNarrowRegex = new RegExp( '^(' + narrowPieces.join('|') + ')', 'i' ); } // FORMATTING addFormatToken(0, ['gg', 2], 0, function () { return this.weekYear() % 100; }); addFormatToken(0, ['GG', 2], 0, function () { return this.isoWeekYear() % 100; }); function addWeekYearFormatToken(token, getter) { addFormatToken(0, [token, token.length], 0, getter); } addWeekYearFormatToken('gggg', 'weekYear'); addWeekYearFormatToken('ggggg', 'weekYear'); addWeekYearFormatToken('GGGG', 'isoWeekYear'); addWeekYearFormatToken('GGGGG', 'isoWeekYear'); // ALIASES // PARSING addRegexToken('G', matchSigned); addRegexToken('g', matchSigned); addRegexToken('GG', match1to2, match2); addRegexToken('gg', match1to2, match2); addRegexToken('GGGG', match1to4, match4); addRegexToken('gggg', match1to4, match4); addRegexToken('GGGGG', match1to6, match6); addRegexToken('ggggg', match1to6, match6); addWeekParseToken( ['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) { week[token.substr(0, 2)] = toInt(input); } ); addWeekParseToken(['gg', 'GG'], function (input, week, config, token) { week[token] = hooks.parseTwoDigitYear(input); }); // MOMENTS function getSetWeekYear(input) { return getSetWeekYearHelper.call( this, input, this.week(), this.weekday() + this.localeData()._week.dow, this.localeData()._week.dow, this.localeData()._week.doy ); } function getSetISOWeekYear(input) { return getSetWeekYearHelper.call( this, input, this.isoWeek(), this.isoWeekday(), 1, 4 ); } function getISOWeeksInYear() { return weeksInYear(this.year(), 1, 4); } function getISOWeeksInISOWeekYear() { return weeksInYear(this.isoWeekYear(), 1, 4); } function getWeeksInYear() { var weekInfo = this.localeData()._week; return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy); } function getWeeksInWeekYear() { var weekInfo = this.localeData()._week; return weeksInYear(this.weekYear(), weekInfo.dow, weekInfo.doy); } function getSetWeekYearHelper(input, week, weekday, dow, doy) { var weeksTarget; if (input == null) { return weekOfYear(this, dow, doy).year; } else { weeksTarget = weeksInYear(input, dow, doy); if (week > weeksTarget) { week = weeksTarget; } return setWeekAll.call(this, input, week, weekday, dow, doy); } } function setWeekAll(weekYear, week, weekday, dow, doy) { var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy), date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear); this.year(date.getUTCFullYear()); this.month(date.getUTCMonth()); this.date(date.getUTCDate()); return this; } // FORMATTING addFormatToken('Q', 0, 'Qo', 'quarter'); // PARSING addRegexToken('Q', match1); addParseToken('Q', function (input, array) { array[MONTH] = (toInt(input) - 1) * 3; }); // MOMENTS function getSetQuarter(input) { return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + (this.month() % 3)); } // FORMATTING addFormatToken('D', ['DD', 2], 'Do', 'date'); // PARSING addRegexToken('D', match1to2, match1to2NoLeadingZero); addRegexToken('DD', match1to2, match2); addRegexToken('Do', function (isStrict, locale) { // TODO: Remove "ordinalParse" fallback in next major release. return isStrict ? locale._dayOfMonthOrdinalParse || locale._ordinalParse : locale._dayOfMonthOrdinalParseLenient; }); addParseToken(['D', 'DD'], DATE); addParseToken('Do', function (input, array) { array[DATE] = toInt(input.match(match1to2)[0]); }); // MOMENTS var getSetDayOfMonth = makeGetSet('Date', true); // FORMATTING addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear'); // PARSING addRegexToken('DDD', match1to3); addRegexToken('DDDD', match3); addParseToken(['DDD', 'DDDD'], function (input, array, config) { config._dayOfYear = toInt(input); }); // HELPERS // MOMENTS function getSetDayOfYear(input) { var dayOfYear = Math.round( (this.clone().startOf('day') - this.clone().startOf('year')) / 864e5 ) + 1; return input == null ? dayOfYear : this.add(input - dayOfYear, 'd'); } // FORMATTING addFormatToken('m', ['mm', 2], 0, 'minute'); // PARSING addRegexToken('m', match1to2, match1to2HasZero); addRegexToken('mm', match1to2, match2); addParseToken(['m', 'mm'], MINUTE); // MOMENTS var getSetMinute = makeGetSet('Minutes', false); // FORMATTING addFormatToken('s', ['ss', 2], 0, 'second'); // PARSING addRegexToken('s', match1to2, match1to2HasZero); addRegexToken('ss', match1to2, match2); addParseToken(['s', 'ss'], SECOND); // MOMENTS var getSetSecond = makeGetSet('Seconds', false); // FORMATTING addFormatToken('S', 0, 0, function () { return ~~(this.millisecond() / 100); }); addFormatToken(0, ['SS', 2], 0, function () { return ~~(this.millisecond() / 10); }); addFormatToken(0, ['SSS', 3], 0, 'millisecond'); addFormatToken(0, ['SSSS', 4], 0, function () { return this.millisecond() * 10; }); addFormatToken(0, ['SSSSS', 5], 0, function () { return this.millisecond() * 100; }); addFormatToken(0, ['SSSSSS', 6], 0, function () { return this.millisecond() * 1000; }); addFormatToken(0, ['SSSSSSS', 7], 0, function () { return this.millisecond() * 10000; }); addFormatToken(0, ['SSSSSSSS', 8], 0, function () { return this.millisecond() * 100000; }); addFormatToken(0, ['SSSSSSSSS', 9], 0, function () { return this.millisecond() * 1000000; }); // PARSING addRegexToken('S', match1to3, match1); addRegexToken('SS', match1to3, match2); addRegexToken('SSS', match1to3, match3); var token, getSetMillisecond; for (token = 'SSSS'; token.length <= 9; token += 'S') { addRegexToken(token, matchUnsigned); } function parseMs(input, array) { array[MILLISECOND] = toInt(('0.' + input) * 1000); } for (token = 'S'; token.length <= 9; token += 'S') { addParseToken(token, parseMs); } getSetMillisecond = makeGetSet('Milliseconds', false); // FORMATTING addFormatToken('z', 0, 0, 'zoneAbbr'); addFormatToken('zz', 0, 0, 'zoneName'); // MOMENTS function getZoneAbbr() { return this._isUTC ? 'UTC' : ''; } function getZoneName() { return this._isUTC ? 'Coordinated Universal Time' : ''; } var proto = Moment.prototype; proto.add = add; proto.calendar = calendar$1; proto.clone = clone; proto.diff = diff; proto.endOf = endOf; proto.format = format; proto.from = from; proto.fromNow = fromNow; proto.to = to; proto.toNow = toNow; proto.get = stringGet; proto.invalidAt = invalidAt; proto.isAfter = isAfter; proto.isBefore = isBefore; proto.isBetween = isBetween; proto.isSame = isSame; proto.isSameOrAfter = isSameOrAfter; proto.isSameOrBefore = isSameOrBefore; proto.isValid = isValid$2; proto.lang = lang; proto.locale = locale; proto.localeData = localeData; proto.max = prototypeMax; proto.min = prototypeMin; proto.parsingFlags = parsingFlags; proto.set = stringSet; proto.startOf = startOf; proto.subtract = subtract; proto.toArray = toArray; proto.toObject = toObject; proto.toDate = toDate; proto.toISOString = toISOString; proto.inspect = inspect; if (typeof Symbol !== 'undefined' && Symbol.for != null) { proto[Symbol.for('nodejs.util.inspect.custom')] = function () { return 'Moment<' + this.format() + '>'; }; } proto.toJSON = toJSON; proto.toString = toString; proto.unix = unix; proto.valueOf = valueOf; proto.creationData = creationData; proto.eraName = getEraName; proto.eraNarrow = getEraNarrow; proto.eraAbbr = getEraAbbr; proto.eraYear = getEraYear; proto.year = getSetYear; proto.isLeapYear = getIsLeapYear; proto.weekYear = getSetWeekYear; proto.isoWeekYear = getSetISOWeekYear; proto.quarter = proto.quarters = getSetQuarter; proto.month = getSetMonth; proto.daysInMonth = getDaysInMonth; proto.week = proto.weeks = getSetWeek; proto.isoWeek = proto.isoWeeks = getSetISOWeek; proto.weeksInYear = getWeeksInYear; proto.weeksInWeekYear = getWeeksInWeekYear; proto.isoWeeksInYear = getISOWeeksInYear; proto.isoWeeksInISOWeekYear = getISOWeeksInISOWeekYear; proto.date = getSetDayOfMonth; proto.day = proto.days = getSetDayOfWeek; proto.weekday = getSetLocaleDayOfWeek; proto.isoWeekday = getSetISODayOfWeek; proto.dayOfYear = getSetDayOfYear; proto.hour = proto.hours = getSetHour; proto.minute = proto.minutes = getSetMinute; proto.second = proto.seconds = getSetSecond; proto.millisecond = proto.milliseconds = getSetMillisecond; proto.utcOffset = getSetOffset; proto.utc = setOffsetToUTC; proto.local = setOffsetToLocal; proto.parseZone = setOffsetToParsedOffset; proto.hasAlignedHourOffset = hasAlignedHourOffset; proto.isDST = isDaylightSavingTime; proto.isLocal = isLocal; proto.isUtcOffset = isUtcOffset; proto.isUtc = isUtc; proto.isUTC = isUtc; proto.zoneAbbr = getZoneAbbr; proto.zoneName = getZoneName; proto.dates = deprecate( 'dates accessor is deprecated. Use date instead.', getSetDayOfMonth ); proto.months = deprecate( 'months accessor is deprecated. Use month instead', getSetMonth ); proto.years = deprecate( 'years accessor is deprecated. Use year instead', getSetYear ); proto.zone = deprecate( 'moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/', getSetZone ); proto.isDSTShifted = deprecate( 'isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information', isDaylightSavingTimeShifted ); function createUnix(input) { return createLocal(input * 1000); } function createInZone() { return createLocal.apply(null, arguments).parseZone(); } function preParsePostFormat(string) { return string; } var proto$1 = Locale.prototype; proto$1.calendar = calendar; proto$1.longDateFormat = longDateFormat; proto$1.invalidDate = invalidDate; proto$1.ordinal = ordinal; proto$1.preparse = preParsePostFormat; proto$1.postformat = preParsePostFormat; proto$1.relativeTime = relativeTime; proto$1.pastFuture = pastFuture; proto$1.set = set; proto$1.eras = localeEras; proto$1.erasParse = localeErasParse; proto$1.erasConvertYear = localeErasConvertYear; proto$1.erasAbbrRegex = erasAbbrRegex; proto$1.erasNameRegex = erasNameRegex; proto$1.erasNarrowRegex = erasNarrowRegex; proto$1.months = localeMonths; proto$1.monthsShort = localeMonthsShort; proto$1.monthsParse = localeMonthsParse; proto$1.monthsRegex = monthsRegex; proto$1.monthsShortRegex = monthsShortRegex; proto$1.week = localeWeek; proto$1.firstDayOfYear = localeFirstDayOfYear; proto$1.firstDayOfWeek = localeFirstDayOfWeek; proto$1.weekdays = localeWeekdays; proto$1.weekdaysMin = localeWeekdaysMin; proto$1.weekdaysShort = localeWeekdaysShort; proto$1.weekdaysParse = localeWeekdaysParse; proto$1.weekdaysRegex = weekdaysRegex; proto$1.weekdaysShortRegex = weekdaysShortRegex; proto$1.weekdaysMinRegex = weekdaysMinRegex; proto$1.isPM = localeIsPM; proto$1.meridiem = localeMeridiem; function get$1(format, index, field, setter) { var locale = getLocale(), utc = createUTC().set(setter, index); return locale[field](utc, format); } function listMonthsImpl(format, index, field) { if (isNumber(format)) { index = format; format = undefined; } format = format || ''; if (index != null) { return get$1(format, index, field, 'month'); } var i, out = []; for (i = 0; i < 12; i++) { out[i] = get$1(format, i, field, 'month'); } return out; } // () // (5) // (fmt, 5) // (fmt) // (true) // (true, 5) // (true, fmt, 5) // (true, fmt) function listWeekdaysImpl(localeSorted, format, index, field) { if (typeof localeSorted === 'boolean') { if (isNumber(format)) { index = format; format = undefined; } format = format || ''; } else { format = localeSorted; index = format; localeSorted = false; if (isNumber(format)) { index = format; format = undefined; } format = format || ''; } var locale = getLocale(), shift = localeSorted ? locale._week.dow : 0, i, out = []; if (index != null) { return get$1(format, (index + shift) % 7, field, 'day'); } for (i = 0; i < 7; i++) { out[i] = get$1(format, (i + shift) % 7, field, 'day'); } return out; } function listMonths(format, index) { return listMonthsImpl(format, index, 'months'); } function listMonthsShort(format, index) { return listMonthsImpl(format, index, 'monthsShort'); } function listWeekdays(localeSorted, format, index) { return listWeekdaysImpl(localeSorted, format, index, 'weekdays'); } function listWeekdaysShort(localeSorted, format, index) { return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort'); } function listWeekdaysMin(localeSorted, format, index) { return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin'); } getSetGlobalLocale('en', { eras: [ { since: '0001-01-01', until: +Infinity, offset: 1, name: 'Anno Domini', narrow: 'AD', abbr: 'AD', }, { since: '0000-12-31', until: -Infinity, offset: 1, name: 'Before Christ', narrow: 'BC', abbr: 'BC', }, ], dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/, ordinal: function (number) { var b = number % 10, output = toInt((number % 100) / 10) === 1 ? 'th' : b === 1 ? 'st' : b === 2 ? 'nd' : b === 3 ? 'rd' : 'th'; return number + output; }, }); // Side effect imports hooks.lang = deprecate( 'moment.lang is deprecated. Use moment.locale instead.', getSetGlobalLocale ); hooks.langData = deprecate( 'moment.langData is deprecated. Use moment.localeData instead.', getLocale ); var mathAbs = Math.abs; function abs() { var data = this._data; this._milliseconds = mathAbs(this._milliseconds); this._days = mathAbs(this._days); this._months = mathAbs(this._months); data.milliseconds = mathAbs(data.milliseconds); data.seconds = mathAbs(data.seconds); data.minutes = mathAbs(data.minutes); data.hours = mathAbs(data.hours); data.months = mathAbs(data.months); data.years = mathAbs(data.years); return this; } function addSubtract$1(duration, input, value, direction) { var other = createDuration(input, value); duration._milliseconds += direction * other._milliseconds; duration._days += direction * other._days; duration._months += direction * other._months; return duration._bubble(); } // supports only 2.0-style add(1, 's') or add(duration) function add$1(input, value) { return addSubtract$1(this, input, value, 1); } // supports only 2.0-style subtract(1, 's') or subtract(duration) function subtract$1(input, value) { return addSubtract$1(this, input, value, -1); } function absCeil(number) { if (number < 0) { return Math.floor(number); } else { return Math.ceil(number); } } function bubble() { var milliseconds = this._milliseconds, days = this._days, months = this._months, data = this._data, seconds, minutes, hours, years, monthsFromDays; // if we have a mix of positive and negative values, bubble down first // check: https://github.com/moment/moment/issues/2166 if ( !( (milliseconds >= 0 && days >= 0 && months >= 0) || (milliseconds <= 0 && days <= 0 && months <= 0) ) ) { milliseconds += absCeil(monthsToDays(months) + days) * 864e5; days = 0; months = 0; } // The following code bubbles up values, see the tests for // examples of what that means. data.milliseconds = milliseconds % 1000; seconds = absFloor(milliseconds / 1000); data.seconds = seconds % 60; minutes = absFloor(seconds / 60); data.minutes = minutes % 60; hours = absFloor(minutes / 60); data.hours = hours % 24; days += absFloor(hours / 24); // convert days to months monthsFromDays = absFloor(daysToMonths(days)); months += monthsFromDays; days -= absCeil(monthsToDays(monthsFromDays)); // 12 months -> 1 year years = absFloor(months / 12); months %= 12; data.days = days; data.months = months; data.years = years; return this; } function daysToMonths(days) { // 400 years have 146097 days (taking into account leap year rules) // 400 years have 12 months === 4800 return (days * 4800) / 146097; } function monthsToDays(months) { // the reverse of daysToMonths return (months * 146097) / 4800; } function as(units) { if (!this.isValid()) { return NaN; } var days, months, milliseconds = this._milliseconds; units = normalizeUnits(units); if (units === 'month' || units === 'quarter' || units === 'year') { days = this._days + milliseconds / 864e5; months = this._months + daysToMonths(days); switch (units) { case 'month': return months; case 'quarter': return months / 3; case 'year': return months / 12; } } else { // handle milliseconds separately because of floating point math errors (issue #1867) days = this._days + Math.round(monthsToDays(this._months)); switch (units) { case 'week': return days / 7 + milliseconds / 6048e5; case 'day': return days + milliseconds / 864e5; case 'hour': return days * 24 + milliseconds / 36e5; case 'minute': return days * 1440 + milliseconds / 6e4; case 'second': return days * 86400 + milliseconds / 1000; // Math.floor prevents floating point math errors here case 'millisecond': return Math.floor(days * 864e5) + milliseconds; default: throw new Error('Unknown unit ' + units); } } } function makeAs(alias) { return function () { return this.as(alias); }; } var asMilliseconds = makeAs('ms'), asSeconds = makeAs('s'), asMinutes = makeAs('m'), asHours = makeAs('h'), asDays = makeAs('d'), asWeeks = makeAs('w'), asMonths = makeAs('M'), asQuarters = makeAs('Q'), asYears = makeAs('y'), valueOf$1 = asMilliseconds; function clone$1() { return createDuration(this); } function get$2(units) { units = normalizeUnits(units); return this.isValid() ? this[units + 's']() : NaN; } function makeGetter(name) { return function () { return this.isValid() ? this._data[name] : NaN; }; } var milliseconds = makeGetter('milliseconds'), seconds = makeGetter('seconds'), minutes = makeGetter('minutes'), hours = makeGetter('hours'), days = makeGetter('days'), months = makeGetter('months'), years = makeGetter('years'); function weeks() { return absFloor(this.days() / 7); } var round = Math.round, thresholds = { ss: 44, // a few seconds to seconds s: 45, // seconds to minute m: 45, // minutes to hour h: 22, // hours to day d: 26, // days to month/week w: null, // weeks to month M: 11, // months to year }; // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) { return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture); } function relativeTime$1(posNegDuration, withoutSuffix, thresholds, locale) { var duration = createDuration(posNegDuration).abs(), seconds = round(duration.as('s')), minutes = round(duration.as('m')), hours = round(duration.as('h')), days = round(duration.as('d')), months = round(duration.as('M')), weeks = round(duration.as('w')), years = round(duration.as('y')), a = (seconds <= thresholds.ss && ['s', seconds]) || (seconds < thresholds.s && ['ss', seconds]) || (minutes <= 1 && ['m']) || (minutes < thresholds.m && ['mm', minutes]) || (hours <= 1 && ['h']) || (hours < thresholds.h && ['hh', hours]) || (days <= 1 && ['d']) || (days < thresholds.d && ['dd', days]); if (thresholds.w != null) { a = a || (weeks <= 1 && ['w']) || (weeks < thresholds.w && ['ww', weeks]); } a = a || (months <= 1 && ['M']) || (months < thresholds.M && ['MM', months]) || (years <= 1 && ['y']) || ['yy', years]; a[2] = withoutSuffix; a[3] = +posNegDuration > 0; a[4] = locale; return substituteTimeAgo.apply(null, a); } // This function allows you to set the rounding function for relative time strings function getSetRelativeTimeRounding(roundingFunction) { if (roundingFunction === undefined) { return round; } if (typeof roundingFunction === 'function') { round = roundingFunction; return true; } return false; } // This function allows you to set a threshold for relative time strings function getSetRelativeTimeThreshold(threshold, limit) { if (thresholds[threshold] === undefined) { return false; } if (limit === undefined) { return thresholds[threshold]; } thresholds[threshold] = limit; if (threshold === 's') { thresholds.ss = limit - 1; } return true; } function humanize(argWithSuffix, argThresholds) { if (!this.isValid()) { return this.localeData().invalidDate(); } var withSuffix = false, th = thresholds, locale, output; if (typeof argWithSuffix === 'object') { argThresholds = argWithSuffix; argWithSuffix = false; } if (typeof argWithSuffix === 'boolean') { withSuffix = argWithSuffix; } if (typeof argThresholds === 'object') { th = Object.assign({}, thresholds, argThresholds); if (argThresholds.s != null && argThresholds.ss == null) { th.ss = argThresholds.s - 1; } } locale = this.localeData(); output = relativeTime$1(this, !withSuffix, th, locale); if (withSuffix) { output = locale.pastFuture(+this, output); } return locale.postformat(output); } var abs$1 = Math.abs; function sign(x) { return (x > 0) - (x < 0) || +x; } function toISOString$1() { // for ISO strings we do not use the normal bubbling rules: // * milliseconds bubble up until they become hours // * days do not bubble at all // * months bubble up until they become years // This is because there is no context-free conversion between hours and days // (think of clock changes) // and also not between days and months (28-31 days per month) if (!this.isValid()) { return this.localeData().invalidDate(); } var seconds = abs$1(this._milliseconds) / 1000, days = abs$1(this._days), months = abs$1(this._months), minutes, hours, years, s, total = this.asSeconds(), totalSign, ymSign, daysSign, hmsSign; if (!total) { // this is the same as C#'s (Noda) and python (isodate)... // but not other JS (goog.date) return 'P0D'; } // 3600 seconds -> 60 minutes -> 1 hour minutes = absFloor(seconds / 60); hours = absFloor(minutes / 60); seconds %= 60; minutes %= 60; // 12 months -> 1 year years = absFloor(months / 12); months %= 12; // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js s = seconds ? seconds.toFixed(3).replace(/\.?0+$/, '') : ''; totalSign = total < 0 ? '-' : ''; ymSign = sign(this._months) !== sign(total) ? '-' : ''; daysSign = sign(this._days) !== sign(total) ? '-' : ''; hmsSign = sign(this._milliseconds) !== sign(total) ? '-' : ''; return ( totalSign + 'P' + (years ? ymSign + years + 'Y' : '') + (months ? ymSign + months + 'M' : '') + (days ? daysSign + days + 'D' : '') + (hours || minutes || seconds ? 'T' : '') + (hours ? hmsSign + hours + 'H' : '') + (minutes ? hmsSign + minutes + 'M' : '') + (seconds ? hmsSign + s + 'S' : '') ); } var proto$2 = Duration.prototype; proto$2.isValid = isValid$1; proto$2.abs = abs; proto$2.add = add$1; proto$2.subtract = subtract$1; proto$2.as = as; proto$2.asMilliseconds = asMilliseconds; proto$2.asSeconds = asSeconds; proto$2.asMinutes = asMinutes; proto$2.asHours = asHours; proto$2.asDays = asDays; proto$2.asWeeks = asWeeks; proto$2.asMonths = asMonths; proto$2.asQuarters = asQuarters; proto$2.asYears = asYears; proto$2.valueOf = valueOf$1; proto$2._bubble = bubble; proto$2.clone = clone$1; proto$2.get = get$2; proto$2.milliseconds = milliseconds; proto$2.seconds = seconds; proto$2.minutes = minutes; proto$2.hours = hours; proto$2.days = days; proto$2.weeks = weeks; proto$2.months = months; proto$2.years = years; proto$2.humanize = humanize; proto$2.toISOString = toISOString$1; proto$2.toString = toISOString$1; proto$2.toJSON = toISOString$1; proto$2.locale = locale; proto$2.localeData = localeData; proto$2.toIsoString = deprecate( 'toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', toISOString$1 ); proto$2.lang = lang; // FORMATTING addFormatToken('X', 0, 0, 'unix'); addFormatToken('x', 0, 0, 'valueOf'); // PARSING addRegexToken('x', matchSigned); addRegexToken('X', matchTimestamp); addParseToken('X', function (input, array, config) { config._d = new Date(parseFloat(input) * 1000); }); addParseToken('x', function (input, array, config) { config._d = new Date(toInt(input)); }); //! moment.js hooks.version = '2.30.1'; setHookCallback(createLocal); hooks.fn = proto; hooks.min = min; hooks.max = max; hooks.now = now; hooks.utc = createUTC; hooks.unix = createUnix; hooks.months = listMonths; hooks.isDate = isDate; hooks.locale = getSetGlobalLocale; hooks.invalid = createInvalid; hooks.duration = createDuration; hooks.isMoment = isMoment; hooks.weekdays = listWeekdays; hooks.parseZone = createInZone; hooks.localeData = getLocale; hooks.isDuration = isDuration; hooks.monthsShort = listMonthsShort; hooks.weekdaysMin = listWeekdaysMin; hooks.defineLocale = defineLocale; hooks.updateLocale = updateLocale; hooks.locales = listLocales; hooks.weekdaysShort = listWeekdaysShort; hooks.normalizeUnits = normalizeUnits; hooks.relativeTimeRounding = getSetRelativeTimeRounding; hooks.relativeTimeThreshold = getSetRelativeTimeThreshold; hooks.calendarFormat = getCalendarFormat; hooks.prototype = proto; // currently HTML5 input type only supports 24-hour formats hooks.HTML5_FMT = { DATETIME_LOCAL: 'YYYY-MM-DDTHH:mm', // <input type="datetime-local" /> DATETIME_LOCAL_SECONDS: 'YYYY-MM-DDTHH:mm:ss', // <input type="datetime-local" step="1" /> DATETIME_LOCAL_MS: 'YYYY-MM-DDTHH:mm:ss.SSS', // <input type="datetime-local" step="0.001" /> DATE: 'YYYY-MM-DD', // <input type="date" /> TIME: 'HH:mm', // <input type="time" /> TIME_SECONDS: 'HH:mm:ss', // <input type="time" step="1" /> TIME_MS: 'HH:mm:ss.SSS', // <input type="time" step="0.001" /> WEEK: 'GGGG-[W]WW', // <input type="week" /> MONTH: 'YYYY-MM', // <input type="month" /> }; return hooks; }))); vendor/wp-polyfill-dom-rect.min.js 0000644 00000001573 15206720414 0013156 0 ustar 00 !function(e){function n(e){return void 0===e?0:Number(e)}function t(e,n){return e!==n&&!(isNaN(e)&&isNaN(n))}function i(e,i,u,r){var o,f,c,a,m,b,d,g;o=n(e),f=n(i),c=n(u),a=n(r),Object.defineProperties(this,{x:{get:function(){return o},set:function(e){t(o,e)&&(o=e,m=b=void 0)},enumerable:!0},y:{get:function(){return f},set:function(e){t(f,e)&&(f=e,d=g=void 0)},enumerable:!0},width:{get:function(){return c},set:function(e){t(c,e)&&(c=e,m=b=void 0)},enumerable:!0},height:{get:function(){return a},set:function(e){t(a,e)&&(a=e,d=g=void 0)},enumerable:!0},left:{get:function(){return void 0===m&&(m=o+Math.min(0,c)),m},enumerable:!0},right:{get:function(){return void 0===b&&(b=o+Math.max(0,c)),b},enumerable:!0},top:{get:function(){return void 0===d&&(d=f+Math.min(0,a)),d},enumerable:!0},bottom:{get:function(){return void 0===g&&(g=f+Math.max(0,a)),g},enumerable:!0}})}e.DOMRect=i}(self); vendor/wp-polyfill-element-closest.js 0000644 00000000654 15206720414 0013764 0 ustar 00 !function(e){var t=e.Element.prototype;"function"!=typeof t.matches&&(t.matches=t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||function(e){for(var t=(this.document||this.ownerDocument).querySelectorAll(e),o=0;t[o]&&t[o]!==this;)++o;return Boolean(t[o])}),"function"!=typeof t.closest&&(t.closest=function(e){for(var t=this;t&&1===t.nodeType;){if(t.matches(e))return t;t=t.parentNode}return null})}(window); vendor/regenerator-runtime.min.js 0000644 00000014756 15206720414 0013175 0 ustar 00 var runtime=function(a){"use strict";var u,t=Object.prototype,h=t.hasOwnProperty,l=Object.defineProperty||function(t,r,e){t[r]=e.value},r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",e=r.asyncIterator||"@@asyncIterator",o=r.toStringTag||"@@toStringTag";function i(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{i({},"")}catch(t){i=function(t,r,e){return t[r]=e}}function c(t,r,e,n){var o,i,a,c,r=r&&r.prototype instanceof d?r:d,r=Object.create(r.prototype),n=new O(n||[]);return l(r,"_invoke",{value:(o=t,i=e,a=n,c=s,function(t,r){if(c===y)throw new Error("Generator is already running");if(c===g){if("throw"===t)throw r;return{value:u,done:!0}}for(a.method=t,a.arg=r;;){var e=a.delegate;if(e){e=function t(r,e){var n=e.method;var o=r.iterator[n];if(o===u)return e.delegate=null,"throw"===n&&r.iterator.return&&(e.method="return",e.arg=u,t(r,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;n=f(o,r.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,v;o=n.arg;if(!o)return e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,v;{if(!o.done)return o;e[r.resultName]=o.value,e.next=r.nextLoc,"return"!==e.method&&(e.method="next",e.arg=u)}e.delegate=null;return v}(e,a);if(e){if(e===v)continue;return e}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(c===s)throw c=g,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);c=y;e=f(o,i,a);if("normal"===e.type){if(c=a.done?g:p,e.arg!==v)return{value:e.arg,done:a.done}}else"throw"===e.type&&(c=g,a.method="throw",a.arg=e.arg)}})}),r}function f(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}a.wrap=c;var s="suspendedStart",p="suspendedYield",y="executing",g="completed",v={};function d(){}function m(){}function w(){}var r={},b=(i(r,n,function(){return this}),Object.getPrototypeOf),b=b&&b(b(k([]))),L=(b&&b!==t&&h.call(b,n)&&(r=b),w.prototype=d.prototype=Object.create(r));function x(t){["next","throw","return"].forEach(function(r){i(t,r,function(t){return this._invoke(r,t)})})}function E(a,c){var r;l(this,"_invoke",{value:function(e,n){function t(){return new c(function(t,r){!function r(t,e,n,o){var i,t=f(a[t],a,e);if("throw"!==t.type)return(e=(i=t.arg).value)&&"object"==typeof e&&h.call(e,"__await")?c.resolve(e.__await).then(function(t){r("next",t,n,o)},function(t){r("throw",t,n,o)}):c.resolve(e).then(function(t){i.value=t,n(i)},function(t){return r("throw",t,n,o)});o(t.arg)}(e,n,t,r)})}return r=r?r.then(t,t):t()}})}function j(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function _(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function k(r){if(null!=r){var e,t=r[n];if(t)return t.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length))return e=-1,(t=function t(){for(;++e<r.length;)if(h.call(r,e))return t.value=r[e],t.done=!1,t;return t.value=u,t.done=!0,t}).next=t}throw new TypeError(typeof r+" is not iterable")}return l(L,"constructor",{value:m.prototype=w,configurable:!0}),l(w,"constructor",{value:m,configurable:!0}),m.displayName=i(w,o,"GeneratorFunction"),a.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},a.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,i(t,o,"GeneratorFunction")),t.prototype=Object.create(L),t},a.awrap=function(t){return{__await:t}},x(E.prototype),i(E.prototype,e,function(){return this}),a.AsyncIterator=E,a.async=function(t,r,e,n,o){void 0===o&&(o=Promise);var i=new E(c(t,r,e,n),o);return a.isGeneratorFunction(r)?i:i.next().then(function(t){return t.done?t.value:i.next()})},x(L),i(L,o,"Generator"),i(L,n,function(){return this}),i(L,"toString",function(){return"[object Generator]"}),a.keys=function(t){var r,e=Object(t),n=[];for(r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},a.values=k,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=u,this.done=!1,this.delegate=null,this.method="next",this.arg=u,this.tryEntries.forEach(_),!t)for(var r in this)"t"===r.charAt(0)&&h.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=u)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function t(t,r){return i.type="throw",i.arg=e,n.next=t,r&&(n.method="next",n.arg=u),!!r}for(var r=this.tryEntries.length-1;0<=r;--r){var o=this.tryEntries[r],i=o.completion;if("root"===o.tryLoc)return t("end");if(o.tryLoc<=this.prev){var a=h.call(o,"catchLoc"),c=h.call(o,"finallyLoc");if(a&&c){if(this.prev<o.catchLoc)return t(o.catchLoc,!0);if(this.prev<o.finallyLoc)return t(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return t(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return t(o.finallyLoc)}}}},abrupt:function(t,r){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&h.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}var i=(o=o&&("break"===t||"continue"===t)&&o.tryLoc<=r&&r<=o.finallyLoc?null:o)?o.completion:{};return i.type=t,i.arg=r,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(i)},complete:function(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),v},finish:function(t){for(var r=this.tryEntries.length-1;0<=r;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),_(e),v}},catch:function(t){for(var r=this.tryEntries.length-1;0<=r;--r){var e,n,o=this.tryEntries[r];if(o.tryLoc===t)return"throw"===(e=o.completion).type&&(n=e.arg,_(o)),n}throw new Error("illegal catch attempt")},delegateYield:function(t,r,e){return this.delegate={iterator:k(t),resultName:r,nextLoc:e},"next"===this.method&&(this.arg=u),v}},a}("object"==typeof module?module.exports:{});try{regeneratorRuntime=runtime}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=runtime:Function("r","regeneratorRuntime = r")(runtime)} vendor/react.js 0000644 00000326553 15206720414 0007514 0 ustar 00 /** * @license React * react.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = global || self, factory(global.React = {})); }(this, (function (exports) { 'use strict'; var ReactVersion = '18.3.1'; // ATTENTION // When adding new symbols to this file, // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' // The Symbol used to tag the ReactElement-like types. var REACT_ELEMENT_TYPE = Symbol.for('react.element'); var REACT_PORTAL_TYPE = Symbol.for('react.portal'); var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment'); var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode'); var REACT_PROFILER_TYPE = Symbol.for('react.profiler'); var REACT_PROVIDER_TYPE = Symbol.for('react.provider'); var REACT_CONTEXT_TYPE = Symbol.for('react.context'); var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref'); var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense'); var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list'); var REACT_MEMO_TYPE = Symbol.for('react.memo'); var REACT_LAZY_TYPE = Symbol.for('react.lazy'); var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen'); var MAYBE_ITERATOR_SYMBOL = Symbol.iterator; var FAUX_ITERATOR_SYMBOL = '@@iterator'; function getIteratorFn(maybeIterable) { if (maybeIterable === null || typeof maybeIterable !== 'object') { return null; } var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; if (typeof maybeIterator === 'function') { return maybeIterator; } return null; } /** * Keeps track of the current dispatcher. */ var ReactCurrentDispatcher = { /** * @internal * @type {ReactComponent} */ current: null }; /** * Keeps track of the current batch's configuration such as how long an update * should suspend for if it needs to. */ var ReactCurrentBatchConfig = { transition: null }; var ReactCurrentActQueue = { current: null, // Used to reproduce behavior of `batchedUpdates` in legacy mode. isBatchingLegacy: false, didScheduleLegacyUpdate: false }; /** * Keeps track of the current owner. * * The current owner is the component who should own any components that are * currently being constructed. */ var ReactCurrentOwner = { /** * @internal * @type {ReactComponent} */ current: null }; var ReactDebugCurrentFrame = {}; var currentExtraStackFrame = null; function setExtraStackFrame(stack) { { currentExtraStackFrame = stack; } } { ReactDebugCurrentFrame.setExtraStackFrame = function (stack) { { currentExtraStackFrame = stack; } }; // Stack implementation injected by the current renderer. ReactDebugCurrentFrame.getCurrentStack = null; ReactDebugCurrentFrame.getStackAddendum = function () { var stack = ''; // Add an extra top frame while an element is being validated if (currentExtraStackFrame) { stack += currentExtraStackFrame; } // Delegate to the injected renderer-specific implementation var impl = ReactDebugCurrentFrame.getCurrentStack; if (impl) { stack += impl() || ''; } return stack; }; } // ----------------------------------------------------------------------------- var enableScopeAPI = false; // Experimental Create Event Handle API. var enableCacheElement = false; var enableTransitionTracing = false; // No known bugs, but needs performance testing var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber // stuff. Intended to enable React core members to more easily debug scheduling // issues in DEV builds. var enableDebugTracing = false; // Track which Fiber(s) schedule render work. var ReactSharedInternals = { ReactCurrentDispatcher: ReactCurrentDispatcher, ReactCurrentBatchConfig: ReactCurrentBatchConfig, ReactCurrentOwner: ReactCurrentOwner }; { ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame; ReactSharedInternals.ReactCurrentActQueue = ReactCurrentActQueue; } // by calls to these methods by a Babel plugin. // // In PROD (or in packages without access to React internals), // they are left as they are instead. function warn(format) { { { for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } printWarning('warn', format, args); } } } function error(format) { { { for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { args[_key2 - 1] = arguments[_key2]; } printWarning('error', format, args); } } } function printWarning(level, format, args) { // When changing this logic, you might want to also // update consoleWithStackDev.www.js as well. { var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; var stack = ReactDebugCurrentFrame.getStackAddendum(); if (stack !== '') { format += '%s'; args = args.concat([stack]); } // eslint-disable-next-line react-internal/safe-string-coercion var argsWithFormat = args.map(function (item) { return String(item); }); // Careful: RN currently depends on this prefix argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it // breaks IE9: https://github.com/facebook/react/issues/13610 // eslint-disable-next-line react-internal/no-production-logging Function.prototype.apply.call(console[level], console, argsWithFormat); } } var didWarnStateUpdateForUnmountedComponent = {}; function warnNoop(publicInstance, callerName) { { var _constructor = publicInstance.constructor; var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass'; var warningKey = componentName + "." + callerName; if (didWarnStateUpdateForUnmountedComponent[warningKey]) { return; } error("Can't call %s on a component that is not yet mounted. " + 'This is a no-op, but it might indicate a bug in your application. ' + 'Instead, assign to `this.state` directly or define a `state = {};` ' + 'class property with the desired state in the %s component.', callerName, componentName); didWarnStateUpdateForUnmountedComponent[warningKey] = true; } } /** * This is the abstract API for an update queue. */ var ReactNoopUpdateQueue = { /** * Checks whether or not this composite component is mounted. * @param {ReactClass} publicInstance The instance we want to test. * @return {boolean} True if mounted, false otherwise. * @protected * @final */ isMounted: function (publicInstance) { return false; }, /** * Forces an update. This should only be invoked when it is known with * certainty that we are **not** in a DOM transaction. * * You may want to call this when you know that some deeper aspect of the * component's state has changed but `setState` was not called. * * This will not invoke `shouldComponentUpdate`, but it will invoke * `componentWillUpdate` and `componentDidUpdate`. * * @param {ReactClass} publicInstance The instance that should rerender. * @param {?function} callback Called after component is updated. * @param {?string} callerName name of the calling function in the public API. * @internal */ enqueueForceUpdate: function (publicInstance, callback, callerName) { warnNoop(publicInstance, 'forceUpdate'); }, /** * Replaces all of the state. Always use this or `setState` to mutate state. * You should treat `this.state` as immutable. * * There is no guarantee that `this.state` will be immediately updated, so * accessing `this.state` after calling this method may return the old value. * * @param {ReactClass} publicInstance The instance that should rerender. * @param {object} completeState Next state. * @param {?function} callback Called after component is updated. * @param {?string} callerName name of the calling function in the public API. * @internal */ enqueueReplaceState: function (publicInstance, completeState, callback, callerName) { warnNoop(publicInstance, 'replaceState'); }, /** * Sets a subset of the state. This only exists because _pendingState is * internal. This provides a merging strategy that is not available to deep * properties which is confusing. TODO: Expose pendingState or don't use it * during the merge. * * @param {ReactClass} publicInstance The instance that should rerender. * @param {object} partialState Next partial state to be merged with state. * @param {?function} callback Called after component is updated. * @param {?string} Name of the calling function in the public API. * @internal */ enqueueSetState: function (publicInstance, partialState, callback, callerName) { warnNoop(publicInstance, 'setState'); } }; var assign = Object.assign; var emptyObject = {}; { Object.freeze(emptyObject); } /** * Base class helpers for the updating state of a component. */ function Component(props, context, updater) { this.props = props; this.context = context; // If a component has string refs, we will assign a different object later. this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the // renderer. this.updater = updater || ReactNoopUpdateQueue; } Component.prototype.isReactComponent = {}; /** * Sets a subset of the state. Always use this to mutate * state. You should treat `this.state` as immutable. * * There is no guarantee that `this.state` will be immediately updated, so * accessing `this.state` after calling this method may return the old value. * * There is no guarantee that calls to `setState` will run synchronously, * as they may eventually be batched together. You can provide an optional * callback that will be executed when the call to setState is actually * completed. * * When a function is provided to setState, it will be called at some point in * the future (not synchronously). It will be called with the up to date * component arguments (state, props, context). These values can be different * from this.* because your function may be called after receiveProps but before * shouldComponentUpdate, and this new state, props, and context will not yet be * assigned to this. * * @param {object|function} partialState Next partial state or function to * produce next partial state to be merged with current state. * @param {?function} callback Called after state is updated. * @final * @protected */ Component.prototype.setState = function (partialState, callback) { if (typeof partialState !== 'object' && typeof partialState !== 'function' && partialState != null) { throw new Error('setState(...): takes an object of state variables to update or a ' + 'function which returns an object of state variables.'); } this.updater.enqueueSetState(this, partialState, callback, 'setState'); }; /** * Forces an update. This should only be invoked when it is known with * certainty that we are **not** in a DOM transaction. * * You may want to call this when you know that some deeper aspect of the * component's state has changed but `setState` was not called. * * This will not invoke `shouldComponentUpdate`, but it will invoke * `componentWillUpdate` and `componentDidUpdate`. * * @param {?function} callback Called after update is complete. * @final * @protected */ Component.prototype.forceUpdate = function (callback) { this.updater.enqueueForceUpdate(this, callback, 'forceUpdate'); }; /** * Deprecated APIs. These APIs used to exist on classic React classes but since * we would like to deprecate them, we're not going to move them over to this * modern base class. Instead, we define a getter that warns if it's accessed. */ { var deprecatedAPIs = { isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'], replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).'] }; var defineDeprecationWarning = function (methodName, info) { Object.defineProperty(Component.prototype, methodName, { get: function () { warn('%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]); return undefined; } }); }; for (var fnName in deprecatedAPIs) { if (deprecatedAPIs.hasOwnProperty(fnName)) { defineDeprecationWarning(fnName, deprecatedAPIs[fnName]); } } } function ComponentDummy() {} ComponentDummy.prototype = Component.prototype; /** * Convenience component with default shallow equality check for sCU. */ function PureComponent(props, context, updater) { this.props = props; this.context = context; // If a component has string refs, we will assign a different object later. this.refs = emptyObject; this.updater = updater || ReactNoopUpdateQueue; } var pureComponentPrototype = PureComponent.prototype = new ComponentDummy(); pureComponentPrototype.constructor = PureComponent; // Avoid an extra prototype jump for these methods. assign(pureComponentPrototype, Component.prototype); pureComponentPrototype.isPureReactComponent = true; // an immutable object with a single mutable value function createRef() { var refObject = { current: null }; { Object.seal(refObject); } return refObject; } var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare function isArray(a) { return isArrayImpl(a); } /* * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol * and Temporal.* types. See https://github.com/facebook/react/pull/22064. * * The functions in this module will throw an easier-to-understand, * easier-to-debug exception with a clear errors message message explaining the * problem. (Instead of a confusing exception thrown inside the implementation * of the `value` object). */ // $FlowFixMe only called in DEV, so void return is not possible. function typeName(value) { { // toStringTag is needed for namespaced types like Temporal.Instant var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag; var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object'; return type; } } // $FlowFixMe only called in DEV, so void return is not possible. function willCoercionThrow(value) { { try { testStringCoercion(value); return false; } catch (e) { return true; } } } function testStringCoercion(value) { // If you ended up here by following an exception call stack, here's what's // happened: you supplied an object or symbol value to React (as a prop, key, // DOM attribute, CSS property, string ref, etc.) and when React tried to // coerce it to a string using `'' + value`, an exception was thrown. // // The most common types that will cause this exception are `Symbol` instances // and Temporal objects like `Temporal.Instant`. But any object that has a // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this // exception. (Library authors do this to prevent users from using built-in // numeric operators like `+` or comparison operators like `>=` because custom // methods are needed to perform accurate arithmetic or comparison.) // // To fix the problem, coerce this object or symbol value to a string before // passing it to React. The most reliable way is usually `String(value)`. // // To find which value is throwing, check the browser or debugger console. // Before this exception was thrown, there should be `console.error` output // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the // problem and how that type was used: key, atrribute, input value prop, etc. // In most cases, this console output also shows the component and its // ancestor components where the exception happened. // // eslint-disable-next-line react-internal/safe-string-coercion return '' + value; } function checkKeyStringCoercion(value) { { if (willCoercionThrow(value)) { error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value)); return testStringCoercion(value); // throw (to help callers find troubleshooting comments) } } } function getWrappedName(outerType, innerType, wrapperName) { var displayName = outerType.displayName; if (displayName) { return displayName; } var functionName = innerType.displayName || innerType.name || ''; return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName; } // Keep in sync with react-reconciler/getComponentNameFromFiber function getContextName(type) { return type.displayName || 'Context'; } // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead. function getComponentNameFromType(type) { if (type == null) { // Host root, text node or just invalid type. return null; } { if (typeof type.tag === 'number') { error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.'); } } if (typeof type === 'function') { return type.displayName || type.name || null; } if (typeof type === 'string') { return type; } switch (type) { case REACT_FRAGMENT_TYPE: return 'Fragment'; case REACT_PORTAL_TYPE: return 'Portal'; case REACT_PROFILER_TYPE: return 'Profiler'; case REACT_STRICT_MODE_TYPE: return 'StrictMode'; case REACT_SUSPENSE_TYPE: return 'Suspense'; case REACT_SUSPENSE_LIST_TYPE: return 'SuspenseList'; } if (typeof type === 'object') { switch (type.$$typeof) { case REACT_CONTEXT_TYPE: var context = type; return getContextName(context) + '.Consumer'; case REACT_PROVIDER_TYPE: var provider = type; return getContextName(provider._context) + '.Provider'; case REACT_FORWARD_REF_TYPE: return getWrappedName(type, type.render, 'ForwardRef'); case REACT_MEMO_TYPE: var outerName = type.displayName || null; if (outerName !== null) { return outerName; } return getComponentNameFromType(type.type) || 'Memo'; case REACT_LAZY_TYPE: { var lazyComponent = type; var payload = lazyComponent._payload; var init = lazyComponent._init; try { return getComponentNameFromType(init(payload)); } catch (x) { return null; } } // eslint-disable-next-line no-fallthrough } } return null; } var hasOwnProperty = Object.prototype.hasOwnProperty; var RESERVED_PROPS = { key: true, ref: true, __self: true, __source: true }; var specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs; { didWarnAboutStringRefs = {}; } function hasValidRef(config) { { if (hasOwnProperty.call(config, 'ref')) { var getter = Object.getOwnPropertyDescriptor(config, 'ref').get; if (getter && getter.isReactWarning) { return false; } } } return config.ref !== undefined; } function hasValidKey(config) { { if (hasOwnProperty.call(config, 'key')) { var getter = Object.getOwnPropertyDescriptor(config, 'key').get; if (getter && getter.isReactWarning) { return false; } } } return config.key !== undefined; } function defineKeyPropWarningGetter(props, displayName) { var warnAboutAccessingKey = function () { { if (!specialPropKeyWarningShown) { specialPropKeyWarningShown = true; error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName); } } }; warnAboutAccessingKey.isReactWarning = true; Object.defineProperty(props, 'key', { get: warnAboutAccessingKey, configurable: true }); } function defineRefPropWarningGetter(props, displayName) { var warnAboutAccessingRef = function () { { if (!specialPropRefWarningShown) { specialPropRefWarningShown = true; error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName); } } }; warnAboutAccessingRef.isReactWarning = true; Object.defineProperty(props, 'ref', { get: warnAboutAccessingRef, configurable: true }); } function warnIfStringRefCannotBeAutoConverted(config) { { if (typeof config.ref === 'string' && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) { var componentName = getComponentNameFromType(ReactCurrentOwner.current.type); if (!didWarnAboutStringRefs[componentName]) { error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', componentName, config.ref); didWarnAboutStringRefs[componentName] = true; } } } } /** * Factory method to create a new React element. This no longer adheres to * the class pattern, so do not use new to call it. Also, instanceof check * will not work. Instead test $$typeof field against Symbol.for('react.element') to check * if something is a React Element. * * @param {*} type * @param {*} props * @param {*} key * @param {string|object} ref * @param {*} owner * @param {*} self A *temporary* helper to detect places where `this` is * different from the `owner` when React.createElement is called, so that we * can warn. We want to get rid of owner and replace string `ref`s with arrow * functions, and as long as `this` and owner are the same, there will be no * change in behavior. * @param {*} source An annotation object (added by a transpiler or otherwise) * indicating filename, line number, and/or other information. * @internal */ var ReactElement = function (type, key, ref, self, source, owner, props) { var element = { // This tag allows us to uniquely identify this as a React Element $$typeof: REACT_ELEMENT_TYPE, // Built-in properties that belong on the element type: type, key: key, ref: ref, props: props, // Record the component responsible for creating this element. _owner: owner }; { // The validation flag is currently mutative. We put it on // an external backing store so that we can freeze the whole object. // This can be replaced with a WeakMap once they are implemented in // commonly used development environments. element._store = {}; // To make comparing ReactElements easier for testing purposes, we make // the validation flag non-enumerable (where possible, which should // include every environment we run tests in), so the test framework // ignores it. Object.defineProperty(element._store, 'validated', { configurable: false, enumerable: false, writable: true, value: false }); // self and source are DEV only properties. Object.defineProperty(element, '_self', { configurable: false, enumerable: false, writable: false, value: self }); // Two elements created in two different places should be considered // equal for testing purposes and therefore we hide it from enumeration. Object.defineProperty(element, '_source', { configurable: false, enumerable: false, writable: false, value: source }); if (Object.freeze) { Object.freeze(element.props); Object.freeze(element); } } return element; }; /** * Create and return a new ReactElement of the given type. * See https://reactjs.org/docs/react-api.html#createelement */ function createElement(type, config, children) { var propName; // Reserved names are extracted var props = {}; var key = null; var ref = null; var self = null; var source = null; if (config != null) { if (hasValidRef(config)) { ref = config.ref; { warnIfStringRefCannotBeAutoConverted(config); } } if (hasValidKey(config)) { { checkKeyStringCoercion(config.key); } key = '' + config.key; } self = config.__self === undefined ? null : config.__self; source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object for (propName in config) { if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { props[propName] = config[propName]; } } } // Children can be more than one argument, and those are transferred onto // the newly allocated props object. var childrenLength = arguments.length - 2; if (childrenLength === 1) { props.children = children; } else if (childrenLength > 1) { var childArray = Array(childrenLength); for (var i = 0; i < childrenLength; i++) { childArray[i] = arguments[i + 2]; } { if (Object.freeze) { Object.freeze(childArray); } } props.children = childArray; } // Resolve default props if (type && type.defaultProps) { var defaultProps = type.defaultProps; for (propName in defaultProps) { if (props[propName] === undefined) { props[propName] = defaultProps[propName]; } } } { if (key || ref) { var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type; if (key) { defineKeyPropWarningGetter(props, displayName); } if (ref) { defineRefPropWarningGetter(props, displayName); } } } return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props); } function cloneAndReplaceKey(oldElement, newKey) { var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props); return newElement; } /** * Clone and return a new ReactElement using element as the starting point. * See https://reactjs.org/docs/react-api.html#cloneelement */ function cloneElement(element, config, children) { if (element === null || element === undefined) { throw new Error("React.cloneElement(...): The argument must be a React element, but you passed " + element + "."); } var propName; // Original props are copied var props = assign({}, element.props); // Reserved names are extracted var key = element.key; var ref = element.ref; // Self is preserved since the owner is preserved. var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a // transpiler, and the original source is probably a better indicator of the // true owner. var source = element._source; // Owner will be preserved, unless ref is overridden var owner = element._owner; if (config != null) { if (hasValidRef(config)) { // Silently steal the ref from the parent. ref = config.ref; owner = ReactCurrentOwner.current; } if (hasValidKey(config)) { { checkKeyStringCoercion(config.key); } key = '' + config.key; } // Remaining properties override existing props var defaultProps; if (element.type && element.type.defaultProps) { defaultProps = element.type.defaultProps; } for (propName in config) { if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { if (config[propName] === undefined && defaultProps !== undefined) { // Resolve default props props[propName] = defaultProps[propName]; } else { props[propName] = config[propName]; } } } } // Children can be more than one argument, and those are transferred onto // the newly allocated props object. var childrenLength = arguments.length - 2; if (childrenLength === 1) { props.children = children; } else if (childrenLength > 1) { var childArray = Array(childrenLength); for (var i = 0; i < childrenLength; i++) { childArray[i] = arguments[i + 2]; } props.children = childArray; } return ReactElement(element.type, key, ref, self, source, owner, props); } /** * Verifies the object is a ReactElement. * See https://reactjs.org/docs/react-api.html#isvalidelement * @param {?object} object * @return {boolean} True if `object` is a ReactElement. * @final */ function isValidElement(object) { return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; } var SEPARATOR = '.'; var SUBSEPARATOR = ':'; /** * Escape and wrap key so it is safe to use as a reactid * * @param {string} key to be escaped. * @return {string} the escaped key. */ function escape(key) { var escapeRegex = /[=:]/g; var escaperLookup = { '=': '=0', ':': '=2' }; var escapedString = key.replace(escapeRegex, function (match) { return escaperLookup[match]; }); return '$' + escapedString; } /** * TODO: Test that a single child and an array with one item have the same key * pattern. */ var didWarnAboutMaps = false; var userProvidedKeyEscapeRegex = /\/+/g; function escapeUserProvidedKey(text) { return text.replace(userProvidedKeyEscapeRegex, '$&/'); } /** * Generate a key string that identifies a element within a set. * * @param {*} element A element that could contain a manual key. * @param {number} index Index that is used if a manual key is not provided. * @return {string} */ function getElementKey(element, index) { // Do some typechecking here since we call this blindly. We want to ensure // that we don't block potential future ES APIs. if (typeof element === 'object' && element !== null && element.key != null) { // Explicit key { checkKeyStringCoercion(element.key); } return escape('' + element.key); } // Implicit key determined by the index in the set return index.toString(36); } function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) { var type = typeof children; if (type === 'undefined' || type === 'boolean') { // All of the above are perceived as null. children = null; } var invokeCallback = false; if (children === null) { invokeCallback = true; } else { switch (type) { case 'string': case 'number': invokeCallback = true; break; case 'object': switch (children.$$typeof) { case REACT_ELEMENT_TYPE: case REACT_PORTAL_TYPE: invokeCallback = true; } } } if (invokeCallback) { var _child = children; var mappedChild = callback(_child); // If it's the only child, treat the name as if it was wrapped in an array // so that it's consistent if the number of children grows: var childKey = nameSoFar === '' ? SEPARATOR + getElementKey(_child, 0) : nameSoFar; if (isArray(mappedChild)) { var escapedChildKey = ''; if (childKey != null) { escapedChildKey = escapeUserProvidedKey(childKey) + '/'; } mapIntoArray(mappedChild, array, escapedChildKey, '', function (c) { return c; }); } else if (mappedChild != null) { if (isValidElement(mappedChild)) { { // The `if` statement here prevents auto-disabling of the safe // coercion ESLint rule, so we must manually disable it below. // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key if (mappedChild.key && (!_child || _child.key !== mappedChild.key)) { checkKeyStringCoercion(mappedChild.key); } } mappedChild = cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as // traverseAllChildren used to do for objects as children escapedPrefix + ( // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key mappedChild.key && (!_child || _child.key !== mappedChild.key) ? // $FlowFixMe Flow incorrectly thinks existing element's key can be a number // eslint-disable-next-line react-internal/safe-string-coercion escapeUserProvidedKey('' + mappedChild.key) + '/' : '') + childKey); } array.push(mappedChild); } return 1; } var child; var nextName; var subtreeCount = 0; // Count of children found in the current subtree. var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR; if (isArray(children)) { for (var i = 0; i < children.length; i++) { child = children[i]; nextName = nextNamePrefix + getElementKey(child, i); subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback); } } else { var iteratorFn = getIteratorFn(children); if (typeof iteratorFn === 'function') { var iterableChildren = children; { // Warn about using Maps as children if (iteratorFn === iterableChildren.entries) { if (!didWarnAboutMaps) { warn('Using Maps as children is not supported. ' + 'Use an array of keyed ReactElements instead.'); } didWarnAboutMaps = true; } } var iterator = iteratorFn.call(iterableChildren); var step; var ii = 0; while (!(step = iterator.next()).done) { child = step.value; nextName = nextNamePrefix + getElementKey(child, ii++); subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback); } } else if (type === 'object') { // eslint-disable-next-line react-internal/safe-string-coercion var childrenString = String(children); throw new Error("Objects are not valid as a React child (found: " + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + "). " + 'If you meant to render a collection of children, use an array ' + 'instead.'); } } return subtreeCount; } /** * Maps children that are typically specified as `props.children`. * * See https://reactjs.org/docs/react-api.html#reactchildrenmap * * The provided mapFunction(child, index) will be called for each * leaf child. * * @param {?*} children Children tree container. * @param {function(*, int)} func The map function. * @param {*} context Context for mapFunction. * @return {object} Object containing the ordered map of results. */ function mapChildren(children, func, context) { if (children == null) { return children; } var result = []; var count = 0; mapIntoArray(children, result, '', '', function (child) { return func.call(context, child, count++); }); return result; } /** * Count the number of children that are typically specified as * `props.children`. * * See https://reactjs.org/docs/react-api.html#reactchildrencount * * @param {?*} children Children tree container. * @return {number} The number of children. */ function countChildren(children) { var n = 0; mapChildren(children, function () { n++; // Don't return anything }); return n; } /** * Iterates through children that are typically specified as `props.children`. * * See https://reactjs.org/docs/react-api.html#reactchildrenforeach * * The provided forEachFunc(child, index) will be called for each * leaf child. * * @param {?*} children Children tree container. * @param {function(*, int)} forEachFunc * @param {*} forEachContext Context for forEachContext. */ function forEachChildren(children, forEachFunc, forEachContext) { mapChildren(children, function () { forEachFunc.apply(this, arguments); // Don't return anything. }, forEachContext); } /** * Flatten a children object (typically specified as `props.children`) and * return an array with appropriately re-keyed children. * * See https://reactjs.org/docs/react-api.html#reactchildrentoarray */ function toArray(children) { return mapChildren(children, function (child) { return child; }) || []; } /** * Returns the first child in a collection of children and verifies that there * is only one child in the collection. * * See https://reactjs.org/docs/react-api.html#reactchildrenonly * * The current implementation of this function assumes that a single child gets * passed without a wrapper, but the purpose of this helper function is to * abstract away the particular structure of children. * * @param {?object} children Child collection structure. * @return {ReactElement} The first and only `ReactElement` contained in the * structure. */ function onlyChild(children) { if (!isValidElement(children)) { throw new Error('React.Children.only expected to receive a single React element child.'); } return children; } function createContext(defaultValue) { // TODO: Second argument used to be an optional `calculateChangedBits` // function. Warn to reserve for future use? var context = { $$typeof: REACT_CONTEXT_TYPE, // As a workaround to support multiple concurrent renderers, we categorize // some renderers as primary and others as secondary. We only expect // there to be two concurrent renderers at most: React Native (primary) and // Fabric (secondary); React DOM (primary) and React ART (secondary). // Secondary renderers store their context values on separate fields. _currentValue: defaultValue, _currentValue2: defaultValue, // Used to track how many concurrent renderers this context currently // supports within in a single renderer. Such as parallel server rendering. _threadCount: 0, // These are circular Provider: null, Consumer: null, // Add these to use same hidden class in VM as ServerContext _defaultValue: null, _globalName: null }; context.Provider = { $$typeof: REACT_PROVIDER_TYPE, _context: context }; var hasWarnedAboutUsingNestedContextConsumers = false; var hasWarnedAboutUsingConsumerProvider = false; var hasWarnedAboutDisplayNameOnConsumer = false; { // A separate object, but proxies back to the original context object for // backwards compatibility. It has a different $$typeof, so we can properly // warn for the incorrect usage of Context as a Consumer. var Consumer = { $$typeof: REACT_CONTEXT_TYPE, _context: context }; // $FlowFixMe: Flow complains about not setting a value, which is intentional here Object.defineProperties(Consumer, { Provider: { get: function () { if (!hasWarnedAboutUsingConsumerProvider) { hasWarnedAboutUsingConsumerProvider = true; error('Rendering <Context.Consumer.Provider> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Provider> instead?'); } return context.Provider; }, set: function (_Provider) { context.Provider = _Provider; } }, _currentValue: { get: function () { return context._currentValue; }, set: function (_currentValue) { context._currentValue = _currentValue; } }, _currentValue2: { get: function () { return context._currentValue2; }, set: function (_currentValue2) { context._currentValue2 = _currentValue2; } }, _threadCount: { get: function () { return context._threadCount; }, set: function (_threadCount) { context._threadCount = _threadCount; } }, Consumer: { get: function () { if (!hasWarnedAboutUsingNestedContextConsumers) { hasWarnedAboutUsingNestedContextConsumers = true; error('Rendering <Context.Consumer.Consumer> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?'); } return context.Consumer; } }, displayName: { get: function () { return context.displayName; }, set: function (displayName) { if (!hasWarnedAboutDisplayNameOnConsumer) { warn('Setting `displayName` on Context.Consumer has no effect. ' + "You should set it directly on the context with Context.displayName = '%s'.", displayName); hasWarnedAboutDisplayNameOnConsumer = true; } } } }); // $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty context.Consumer = Consumer; } { context._currentRenderer = null; context._currentRenderer2 = null; } return context; } var Uninitialized = -1; var Pending = 0; var Resolved = 1; var Rejected = 2; function lazyInitializer(payload) { if (payload._status === Uninitialized) { var ctor = payload._result; var thenable = ctor(); // Transition to the next state. // This might throw either because it's missing or throws. If so, we treat it // as still uninitialized and try again next time. Which is the same as what // happens if the ctor or any wrappers processing the ctor throws. This might // end up fixing it if the resolution was a concurrency bug. thenable.then(function (moduleObject) { if (payload._status === Pending || payload._status === Uninitialized) { // Transition to the next state. var resolved = payload; resolved._status = Resolved; resolved._result = moduleObject; } }, function (error) { if (payload._status === Pending || payload._status === Uninitialized) { // Transition to the next state. var rejected = payload; rejected._status = Rejected; rejected._result = error; } }); if (payload._status === Uninitialized) { // In case, we're still uninitialized, then we're waiting for the thenable // to resolve. Set it as pending in the meantime. var pending = payload; pending._status = Pending; pending._result = thenable; } } if (payload._status === Resolved) { var moduleObject = payload._result; { if (moduleObject === undefined) { error('lazy: Expected the result of a dynamic imp' + 'ort() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + // Break up imports to avoid accidentally parsing them as dependencies. 'const MyComponent = lazy(() => imp' + "ort('./MyComponent'))\n\n" + 'Did you accidentally put curly braces around the import?', moduleObject); } } { if (!('default' in moduleObject)) { error('lazy: Expected the result of a dynamic imp' + 'ort() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + // Break up imports to avoid accidentally parsing them as dependencies. 'const MyComponent = lazy(() => imp' + "ort('./MyComponent'))", moduleObject); } } return moduleObject.default; } else { throw payload._result; } } function lazy(ctor) { var payload = { // We use these fields to store the result. _status: Uninitialized, _result: ctor }; var lazyType = { $$typeof: REACT_LAZY_TYPE, _payload: payload, _init: lazyInitializer }; { // In production, this would just set it on the object. var defaultProps; var propTypes; // $FlowFixMe Object.defineProperties(lazyType, { defaultProps: { configurable: true, get: function () { return defaultProps; }, set: function (newDefaultProps) { error('React.lazy(...): It is not supported to assign `defaultProps` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.'); defaultProps = newDefaultProps; // Match production behavior more closely: // $FlowFixMe Object.defineProperty(lazyType, 'defaultProps', { enumerable: true }); } }, propTypes: { configurable: true, get: function () { return propTypes; }, set: function (newPropTypes) { error('React.lazy(...): It is not supported to assign `propTypes` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.'); propTypes = newPropTypes; // Match production behavior more closely: // $FlowFixMe Object.defineProperty(lazyType, 'propTypes', { enumerable: true }); } } }); } return lazyType; } function forwardRef(render) { { if (render != null && render.$$typeof === REACT_MEMO_TYPE) { error('forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).'); } else if (typeof render !== 'function') { error('forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render); } else { if (render.length !== 0 && render.length !== 2) { error('forwardRef render functions accept exactly two parameters: props and ref. %s', render.length === 1 ? 'Did you forget to use the ref parameter?' : 'Any additional parameter will be undefined.'); } } if (render != null) { if (render.defaultProps != null || render.propTypes != null) { error('forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?'); } } } var elementType = { $$typeof: REACT_FORWARD_REF_TYPE, render: render }; { var ownName; Object.defineProperty(elementType, 'displayName', { enumerable: false, configurable: true, get: function () { return ownName; }, set: function (name) { ownName = name; // The inner component shouldn't inherit this display name in most cases, // because the component may be used elsewhere. // But it's nice for anonymous functions to inherit the name, // so that our component-stack generation logic will display their frames. // An anonymous function generally suggests a pattern like: // React.forwardRef((props, ref) => {...}); // This kind of inner function is not used elsewhere so the side effect is okay. if (!render.name && !render.displayName) { render.displayName = name; } } }); } return elementType; } var REACT_MODULE_REFERENCE; { REACT_MODULE_REFERENCE = Symbol.for('react.module.reference'); } function isValidElementType(type) { if (typeof type === 'string' || typeof type === 'function') { return true; } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill). if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) { return true; } if (typeof type === 'object' && type !== null) { if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object // types supported by any Flight configuration anywhere since // we don't know which Flight build this will end up being used // with. type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) { return true; } } return false; } function memo(type, compare) { { if (!isValidElementType(type)) { error('memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type); } } var elementType = { $$typeof: REACT_MEMO_TYPE, type: type, compare: compare === undefined ? null : compare }; { var ownName; Object.defineProperty(elementType, 'displayName', { enumerable: false, configurable: true, get: function () { return ownName; }, set: function (name) { ownName = name; // The inner component shouldn't inherit this display name in most cases, // because the component may be used elsewhere. // But it's nice for anonymous functions to inherit the name, // so that our component-stack generation logic will display their frames. // An anonymous function generally suggests a pattern like: // React.memo((props) => {...}); // This kind of inner function is not used elsewhere so the side effect is okay. if (!type.name && !type.displayName) { type.displayName = name; } } }); } return elementType; } function resolveDispatcher() { var dispatcher = ReactCurrentDispatcher.current; { if (dispatcher === null) { error('Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for' + ' one of the following reasons:\n' + '1. You might have mismatching versions of React and the renderer (such as React DOM)\n' + '2. You might be breaking the Rules of Hooks\n' + '3. You might have more than one copy of React in the same app\n' + 'See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.'); } } // Will result in a null access error if accessed outside render phase. We // intentionally don't throw our own error because this is in a hot path. // Also helps ensure this is inlined. return dispatcher; } function useContext(Context) { var dispatcher = resolveDispatcher(); { // TODO: add a more generic warning for invalid values. if (Context._context !== undefined) { var realContext = Context._context; // Don't deduplicate because this legitimately causes bugs // and nobody should be using this in existing code. if (realContext.Consumer === Context) { error('Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be ' + 'removed in a future major release. Did you mean to call useContext(Context) instead?'); } else if (realContext.Provider === Context) { error('Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?'); } } } return dispatcher.useContext(Context); } function useState(initialState) { var dispatcher = resolveDispatcher(); return dispatcher.useState(initialState); } function useReducer(reducer, initialArg, init) { var dispatcher = resolveDispatcher(); return dispatcher.useReducer(reducer, initialArg, init); } function useRef(initialValue) { var dispatcher = resolveDispatcher(); return dispatcher.useRef(initialValue); } function useEffect(create, deps) { var dispatcher = resolveDispatcher(); return dispatcher.useEffect(create, deps); } function useInsertionEffect(create, deps) { var dispatcher = resolveDispatcher(); return dispatcher.useInsertionEffect(create, deps); } function useLayoutEffect(create, deps) { var dispatcher = resolveDispatcher(); return dispatcher.useLayoutEffect(create, deps); } function useCallback(callback, deps) { var dispatcher = resolveDispatcher(); return dispatcher.useCallback(callback, deps); } function useMemo(create, deps) { var dispatcher = resolveDispatcher(); return dispatcher.useMemo(create, deps); } function useImperativeHandle(ref, create, deps) { var dispatcher = resolveDispatcher(); return dispatcher.useImperativeHandle(ref, create, deps); } function useDebugValue(value, formatterFn) { { var dispatcher = resolveDispatcher(); return dispatcher.useDebugValue(value, formatterFn); } } function useTransition() { var dispatcher = resolveDispatcher(); return dispatcher.useTransition(); } function useDeferredValue(value) { var dispatcher = resolveDispatcher(); return dispatcher.useDeferredValue(value); } function useId() { var dispatcher = resolveDispatcher(); return dispatcher.useId(); } function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { var dispatcher = resolveDispatcher(); return dispatcher.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot); } // Helpers to patch console.logs to avoid logging during side-effect free // replaying on render function. This currently only patches the object // lazily which won't cover if the log function was extracted eagerly. // We could also eagerly patch the method. var disabledDepth = 0; var prevLog; var prevInfo; var prevWarn; var prevError; var prevGroup; var prevGroupCollapsed; var prevGroupEnd; function disabledLog() {} disabledLog.__reactDisabledLog = true; function disableLogs() { { if (disabledDepth === 0) { /* eslint-disable react-internal/no-production-logging */ prevLog = console.log; prevInfo = console.info; prevWarn = console.warn; prevError = console.error; prevGroup = console.group; prevGroupCollapsed = console.groupCollapsed; prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099 var props = { configurable: true, enumerable: true, value: disabledLog, writable: true }; // $FlowFixMe Flow thinks console is immutable. Object.defineProperties(console, { info: props, log: props, warn: props, error: props, group: props, groupCollapsed: props, groupEnd: props }); /* eslint-enable react-internal/no-production-logging */ } disabledDepth++; } } function reenableLogs() { { disabledDepth--; if (disabledDepth === 0) { /* eslint-disable react-internal/no-production-logging */ var props = { configurable: true, enumerable: true, writable: true }; // $FlowFixMe Flow thinks console is immutable. Object.defineProperties(console, { log: assign({}, props, { value: prevLog }), info: assign({}, props, { value: prevInfo }), warn: assign({}, props, { value: prevWarn }), error: assign({}, props, { value: prevError }), group: assign({}, props, { value: prevGroup }), groupCollapsed: assign({}, props, { value: prevGroupCollapsed }), groupEnd: assign({}, props, { value: prevGroupEnd }) }); /* eslint-enable react-internal/no-production-logging */ } if (disabledDepth < 0) { error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.'); } } } var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher; var prefix; function describeBuiltInComponentFrame(name, source, ownerFn) { { if (prefix === undefined) { // Extract the VM specific prefix used by each line. try { throw Error(); } catch (x) { var match = x.stack.trim().match(/\n( *(at )?)/); prefix = match && match[1] || ''; } } // We use the prefix to ensure our stacks line up with native stack frames. return '\n' + prefix + name; } } var reentry = false; var componentFrameCache; { var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map; componentFrameCache = new PossiblyWeakMap(); } function describeNativeComponentFrame(fn, construct) { // If something asked for a stack inside a fake render, it should get ignored. if ( !fn || reentry) { return ''; } { var frame = componentFrameCache.get(fn); if (frame !== undefined) { return frame; } } var control; reentry = true; var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined. Error.prepareStackTrace = undefined; var previousDispatcher; { previousDispatcher = ReactCurrentDispatcher$1.current; // Set the dispatcher in DEV because this might be call in the render function // for warnings. ReactCurrentDispatcher$1.current = null; disableLogs(); } try { // This should throw. if (construct) { // Something should be setting the props in the constructor. var Fake = function () { throw Error(); }; // $FlowFixMe Object.defineProperty(Fake.prototype, 'props', { set: function () { // We use a throwing setter instead of frozen or non-writable props // because that won't throw in a non-strict mode function. throw Error(); } }); if (typeof Reflect === 'object' && Reflect.construct) { // We construct a different control for this case to include any extra // frames added by the construct call. try { Reflect.construct(Fake, []); } catch (x) { control = x; } Reflect.construct(fn, [], Fake); } else { try { Fake.call(); } catch (x) { control = x; } fn.call(Fake.prototype); } } else { try { throw Error(); } catch (x) { control = x; } fn(); } } catch (sample) { // This is inlined manually because closure doesn't do it for us. if (sample && control && typeof sample.stack === 'string') { // This extracts the first frame from the sample that isn't also in the control. // Skipping one frame that we assume is the frame that calls the two. var sampleLines = sample.stack.split('\n'); var controlLines = control.stack.split('\n'); var s = sampleLines.length - 1; var c = controlLines.length - 1; while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) { // We expect at least one stack frame to be shared. // Typically this will be the root most one. However, stack frames may be // cut off due to maximum stack limits. In this case, one maybe cut off // earlier than the other. We assume that the sample is longer or the same // and there for cut off earlier. So we should find the root most frame in // the sample somewhere in the control. c--; } for (; s >= 1 && c >= 0; s--, c--) { // Next we find the first one that isn't the same which should be the // frame that called our sample function and the control. if (sampleLines[s] !== controlLines[c]) { // In V8, the first line is describing the message but other VMs don't. // If we're about to return the first line, and the control is also on the same // line, that's a pretty good indicator that our sample threw at same line as // the control. I.e. before we entered the sample frame. So we ignore this result. // This can happen if you passed a class to function component, or non-function. if (s !== 1 || c !== 1) { do { s--; c--; // We may still have similar intermediate frames from the construct call. // The next one that isn't the same should be our match though. if (c < 0 || sampleLines[s] !== controlLines[c]) { // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier. var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled "<anonymous>" // but we have a user-provided "displayName" // splice it in to make the stack more readable. if (fn.displayName && _frame.includes('<anonymous>')) { _frame = _frame.replace('<anonymous>', fn.displayName); } { if (typeof fn === 'function') { componentFrameCache.set(fn, _frame); } } // Return the line we found. return _frame; } } while (s >= 1 && c >= 0); } break; } } } } finally { reentry = false; { ReactCurrentDispatcher$1.current = previousDispatcher; reenableLogs(); } Error.prepareStackTrace = previousPrepareStackTrace; } // Fallback to just using the name if we couldn't make it throw. var name = fn ? fn.displayName || fn.name : ''; var syntheticFrame = name ? describeBuiltInComponentFrame(name) : ''; { if (typeof fn === 'function') { componentFrameCache.set(fn, syntheticFrame); } } return syntheticFrame; } function describeFunctionComponentFrame(fn, source, ownerFn) { { return describeNativeComponentFrame(fn, false); } } function shouldConstruct(Component) { var prototype = Component.prototype; return !!(prototype && prototype.isReactComponent); } function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) { if (type == null) { return ''; } if (typeof type === 'function') { { return describeNativeComponentFrame(type, shouldConstruct(type)); } } if (typeof type === 'string') { return describeBuiltInComponentFrame(type); } switch (type) { case REACT_SUSPENSE_TYPE: return describeBuiltInComponentFrame('Suspense'); case REACT_SUSPENSE_LIST_TYPE: return describeBuiltInComponentFrame('SuspenseList'); } if (typeof type === 'object') { switch (type.$$typeof) { case REACT_FORWARD_REF_TYPE: return describeFunctionComponentFrame(type.render); case REACT_MEMO_TYPE: // Memo may contain any component type so we recursively resolve it. return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn); case REACT_LAZY_TYPE: { var lazyComponent = type; var payload = lazyComponent._payload; var init = lazyComponent._init; try { // Lazy may contain any component type so we recursively resolve it. return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn); } catch (x) {} } } } return ''; } var loggedTypeFailures = {}; var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame; function setCurrentlyValidatingElement(element) { { if (element) { var owner = element._owner; var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null); ReactDebugCurrentFrame$1.setExtraStackFrame(stack); } else { ReactDebugCurrentFrame$1.setExtraStackFrame(null); } } } function checkPropTypes(typeSpecs, values, location, componentName, element) { { // $FlowFixMe This is okay but Flow doesn't know it. var has = Function.call.bind(hasOwnProperty); for (var typeSpecName in typeSpecs) { if (has(typeSpecs, typeSpecName)) { var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to // fail the render phase where it didn't fail before. So we log it. // After these have been cleaned up, we'll let them throw. try { // This is intentionally an invariant that gets caught. It's the same // behavior as without this statement except with a better message. if (typeof typeSpecs[typeSpecName] !== 'function') { // eslint-disable-next-line react-internal/prod-error-codes var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'); err.name = 'Invariant Violation'; throw err; } error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'); } catch (ex) { error$1 = ex; } if (error$1 && !(error$1 instanceof Error)) { setCurrentlyValidatingElement(element); error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1); setCurrentlyValidatingElement(null); } if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) { // Only monitor this failure once because there tends to be a lot of the // same error. loggedTypeFailures[error$1.message] = true; setCurrentlyValidatingElement(element); error('Failed %s type: %s', location, error$1.message); setCurrentlyValidatingElement(null); } } } } } function setCurrentlyValidatingElement$1(element) { { if (element) { var owner = element._owner; var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null); setExtraStackFrame(stack); } else { setExtraStackFrame(null); } } } var propTypesMisspellWarningShown; { propTypesMisspellWarningShown = false; } function getDeclarationErrorAddendum() { if (ReactCurrentOwner.current) { var name = getComponentNameFromType(ReactCurrentOwner.current.type); if (name) { return '\n\nCheck the render method of `' + name + '`.'; } } return ''; } function getSourceInfoErrorAddendum(source) { if (source !== undefined) { var fileName = source.fileName.replace(/^.*[\\\/]/, ''); var lineNumber = source.lineNumber; return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.'; } return ''; } function getSourceInfoErrorAddendumForProps(elementProps) { if (elementProps !== null && elementProps !== undefined) { return getSourceInfoErrorAddendum(elementProps.__source); } return ''; } /** * Warn if there's no key explicitly set on dynamic arrays of children or * object keys are not valid. This allows us to keep track of children between * updates. */ var ownerHasKeyUseWarning = {}; function getCurrentComponentErrorInfo(parentType) { var info = getDeclarationErrorAddendum(); if (!info) { var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name; if (parentName) { info = "\n\nCheck the top-level render call using <" + parentName + ">."; } } return info; } /** * Warn if the element doesn't have an explicit key assigned to it. * This element is in an array. The array could grow and shrink or be * reordered. All children that haven't already been validated are required to * have a "key" property assigned to it. Error statuses are cached so a warning * will only be shown once. * * @internal * @param {ReactElement} element Element that requires a key. * @param {*} parentType element's parent's type. */ function validateExplicitKey(element, parentType) { if (!element._store || element._store.validated || element.key != null) { return; } element._store.validated = true; var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType); if (ownerHasKeyUseWarning[currentComponentErrorInfo]) { return; } ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a // property, it may be the creator of the child that's responsible for // assigning it a key. var childOwner = ''; if (element && element._owner && element._owner !== ReactCurrentOwner.current) { // Give the component that originally created this child. childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + "."; } { setCurrentlyValidatingElement$1(element); error('Each child in a list should have a unique "key" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner); setCurrentlyValidatingElement$1(null); } } /** * Ensure that every element either is passed in a static location, in an * array with an explicit keys property defined, or in an object literal * with valid key property. * * @internal * @param {ReactNode} node Statically passed child of any type. * @param {*} parentType node's parent's type. */ function validateChildKeys(node, parentType) { if (typeof node !== 'object') { return; } if (isArray(node)) { for (var i = 0; i < node.length; i++) { var child = node[i]; if (isValidElement(child)) { validateExplicitKey(child, parentType); } } } else if (isValidElement(node)) { // This element was passed in a valid location. if (node._store) { node._store.validated = true; } } else if (node) { var iteratorFn = getIteratorFn(node); if (typeof iteratorFn === 'function') { // Entry iterators used to provide implicit keys, // but now we print a separate warning for them later. if (iteratorFn !== node.entries) { var iterator = iteratorFn.call(node); var step; while (!(step = iterator.next()).done) { if (isValidElement(step.value)) { validateExplicitKey(step.value, parentType); } } } } } } /** * Given an element, validate that its props follow the propTypes definition, * provided by the type. * * @param {ReactElement} element */ function validatePropTypes(element) { { var type = element.type; if (type === null || type === undefined || typeof type === 'string') { return; } var propTypes; if (typeof type === 'function') { propTypes = type.propTypes; } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here. // Inner props are checked in the reconciler. type.$$typeof === REACT_MEMO_TYPE)) { propTypes = type.propTypes; } else { return; } if (propTypes) { // Intentionally inside to avoid triggering lazy initializers: var name = getComponentNameFromType(type); checkPropTypes(propTypes, element.props, 'prop', name, element); } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) { propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers: var _name = getComponentNameFromType(type); error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown'); } if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) { error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.'); } } } /** * Given a fragment, validate that it can only be provided with fragment props * @param {ReactElement} fragment */ function validateFragmentProps(fragment) { { var keys = Object.keys(fragment.props); for (var i = 0; i < keys.length; i++) { var key = keys[i]; if (key !== 'children' && key !== 'key') { setCurrentlyValidatingElement$1(fragment); error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key); setCurrentlyValidatingElement$1(null); break; } } if (fragment.ref !== null) { setCurrentlyValidatingElement$1(fragment); error('Invalid attribute `ref` supplied to `React.Fragment`.'); setCurrentlyValidatingElement$1(null); } } } function createElementWithValidation(type, props, children) { var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to // succeed and there will likely be errors in render. if (!validType) { var info = ''; if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) { info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports."; } var sourceInfo = getSourceInfoErrorAddendumForProps(props); if (sourceInfo) { info += sourceInfo; } else { info += getDeclarationErrorAddendum(); } var typeString; if (type === null) { typeString = 'null'; } else if (isArray(type)) { typeString = 'array'; } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) { typeString = "<" + (getComponentNameFromType(type.type) || 'Unknown') + " />"; info = ' Did you accidentally export a JSX literal instead of a component?'; } else { typeString = typeof type; } { error('React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info); } } var element = createElement.apply(this, arguments); // The result can be nullish if a mock or a custom function is used. // TODO: Drop this when these are no longer allowed as the type argument. if (element == null) { return element; } // Skip key warning if the type isn't valid since our key validation logic // doesn't expect a non-string/function type and can throw confusing errors. // We don't want exception behavior to differ between dev and prod. // (Rendering will throw with a helpful message and as soon as the type is // fixed, the key warnings will appear.) if (validType) { for (var i = 2; i < arguments.length; i++) { validateChildKeys(arguments[i], type); } } if (type === REACT_FRAGMENT_TYPE) { validateFragmentProps(element); } else { validatePropTypes(element); } return element; } var didWarnAboutDeprecatedCreateFactory = false; function createFactoryWithValidation(type) { var validatedFactory = createElementWithValidation.bind(null, type); validatedFactory.type = type; { if (!didWarnAboutDeprecatedCreateFactory) { didWarnAboutDeprecatedCreateFactory = true; warn('React.createFactory() is deprecated and will be removed in ' + 'a future major release. Consider using JSX ' + 'or use React.createElement() directly instead.'); } // Legacy hook: remove it Object.defineProperty(validatedFactory, 'type', { enumerable: false, get: function () { warn('Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.'); Object.defineProperty(this, 'type', { value: type }); return type; } }); } return validatedFactory; } function cloneElementWithValidation(element, props, children) { var newElement = cloneElement.apply(this, arguments); for (var i = 2; i < arguments.length; i++) { validateChildKeys(arguments[i], newElement.type); } validatePropTypes(newElement); return newElement; } var enableSchedulerDebugging = false; var enableProfiling = false; var frameYieldMs = 5; function push(heap, node) { var index = heap.length; heap.push(node); siftUp(heap, node, index); } function peek(heap) { return heap.length === 0 ? null : heap[0]; } function pop(heap) { if (heap.length === 0) { return null; } var first = heap[0]; var last = heap.pop(); if (last !== first) { heap[0] = last; siftDown(heap, last, 0); } return first; } function siftUp(heap, node, i) { var index = i; while (index > 0) { var parentIndex = index - 1 >>> 1; var parent = heap[parentIndex]; if (compare(parent, node) > 0) { // The parent is larger. Swap positions. heap[parentIndex] = node; heap[index] = parent; index = parentIndex; } else { // The parent is smaller. Exit. return; } } } function siftDown(heap, node, i) { var index = i; var length = heap.length; var halfLength = length >>> 1; while (index < halfLength) { var leftIndex = (index + 1) * 2 - 1; var left = heap[leftIndex]; var rightIndex = leftIndex + 1; var right = heap[rightIndex]; // If the left or right node is smaller, swap with the smaller of those. if (compare(left, node) < 0) { if (rightIndex < length && compare(right, left) < 0) { heap[index] = right; heap[rightIndex] = node; index = rightIndex; } else { heap[index] = left; heap[leftIndex] = node; index = leftIndex; } } else if (rightIndex < length && compare(right, node) < 0) { heap[index] = right; heap[rightIndex] = node; index = rightIndex; } else { // Neither child is smaller. Exit. return; } } } function compare(a, b) { // Compare sort index first, then task id. var diff = a.sortIndex - b.sortIndex; return diff !== 0 ? diff : a.id - b.id; } // TODO: Use symbols? var ImmediatePriority = 1; var UserBlockingPriority = 2; var NormalPriority = 3; var LowPriority = 4; var IdlePriority = 5; function markTaskErrored(task, ms) { } /* eslint-disable no-var */ var getCurrentTime; var hasPerformanceNow = typeof performance === 'object' && typeof performance.now === 'function'; if (hasPerformanceNow) { var localPerformance = performance; getCurrentTime = function () { return localPerformance.now(); }; } else { var localDate = Date; var initialTime = localDate.now(); getCurrentTime = function () { return localDate.now() - initialTime; }; } // Max 31 bit integer. The max integer size in V8 for 32-bit systems. // Math.pow(2, 30) - 1 // 0b111111111111111111111111111111 var maxSigned31BitInt = 1073741823; // Times out immediately var IMMEDIATE_PRIORITY_TIMEOUT = -1; // Eventually times out var USER_BLOCKING_PRIORITY_TIMEOUT = 250; var NORMAL_PRIORITY_TIMEOUT = 5000; var LOW_PRIORITY_TIMEOUT = 10000; // Never times out var IDLE_PRIORITY_TIMEOUT = maxSigned31BitInt; // Tasks are stored on a min heap var taskQueue = []; var timerQueue = []; // Incrementing id counter. Used to maintain insertion order. var taskIdCounter = 1; // Pausing the scheduler is useful for debugging. var currentTask = null; var currentPriorityLevel = NormalPriority; // This is set while performing work, to prevent re-entrance. var isPerformingWork = false; var isHostCallbackScheduled = false; var isHostTimeoutScheduled = false; // Capture local references to native APIs, in case a polyfill overrides them. var localSetTimeout = typeof setTimeout === 'function' ? setTimeout : null; var localClearTimeout = typeof clearTimeout === 'function' ? clearTimeout : null; var localSetImmediate = typeof setImmediate !== 'undefined' ? setImmediate : null; // IE and Node.js + jsdom var isInputPending = typeof navigator !== 'undefined' && navigator.scheduling !== undefined && navigator.scheduling.isInputPending !== undefined ? navigator.scheduling.isInputPending.bind(navigator.scheduling) : null; function advanceTimers(currentTime) { // Check for tasks that are no longer delayed and add them to the queue. var timer = peek(timerQueue); while (timer !== null) { if (timer.callback === null) { // Timer was cancelled. pop(timerQueue); } else if (timer.startTime <= currentTime) { // Timer fired. Transfer to the task queue. pop(timerQueue); timer.sortIndex = timer.expirationTime; push(taskQueue, timer); } else { // Remaining timers are pending. return; } timer = peek(timerQueue); } } function handleTimeout(currentTime) { isHostTimeoutScheduled = false; advanceTimers(currentTime); if (!isHostCallbackScheduled) { if (peek(taskQueue) !== null) { isHostCallbackScheduled = true; requestHostCallback(flushWork); } else { var firstTimer = peek(timerQueue); if (firstTimer !== null) { requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime); } } } } function flushWork(hasTimeRemaining, initialTime) { isHostCallbackScheduled = false; if (isHostTimeoutScheduled) { // We scheduled a timeout but it's no longer needed. Cancel it. isHostTimeoutScheduled = false; cancelHostTimeout(); } isPerformingWork = true; var previousPriorityLevel = currentPriorityLevel; try { if (enableProfiling) { try { return workLoop(hasTimeRemaining, initialTime); } catch (error) { if (currentTask !== null) { var currentTime = getCurrentTime(); markTaskErrored(currentTask, currentTime); currentTask.isQueued = false; } throw error; } } else { // No catch in prod code path. return workLoop(hasTimeRemaining, initialTime); } } finally { currentTask = null; currentPriorityLevel = previousPriorityLevel; isPerformingWork = false; } } function workLoop(hasTimeRemaining, initialTime) { var currentTime = initialTime; advanceTimers(currentTime); currentTask = peek(taskQueue); while (currentTask !== null && !(enableSchedulerDebugging )) { if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) { // This currentTask hasn't expired, and we've reached the deadline. break; } var callback = currentTask.callback; if (typeof callback === 'function') { currentTask.callback = null; currentPriorityLevel = currentTask.priorityLevel; var didUserCallbackTimeout = currentTask.expirationTime <= currentTime; var continuationCallback = callback(didUserCallbackTimeout); currentTime = getCurrentTime(); if (typeof continuationCallback === 'function') { currentTask.callback = continuationCallback; } else { if (currentTask === peek(taskQueue)) { pop(taskQueue); } } advanceTimers(currentTime); } else { pop(taskQueue); } currentTask = peek(taskQueue); } // Return whether there's additional work if (currentTask !== null) { return true; } else { var firstTimer = peek(timerQueue); if (firstTimer !== null) { requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime); } return false; } } function unstable_runWithPriority(priorityLevel, eventHandler) { switch (priorityLevel) { case ImmediatePriority: case UserBlockingPriority: case NormalPriority: case LowPriority: case IdlePriority: break; default: priorityLevel = NormalPriority; } var previousPriorityLevel = currentPriorityLevel; currentPriorityLevel = priorityLevel; try { return eventHandler(); } finally { currentPriorityLevel = previousPriorityLevel; } } function unstable_next(eventHandler) { var priorityLevel; switch (currentPriorityLevel) { case ImmediatePriority: case UserBlockingPriority: case NormalPriority: // Shift down to normal priority priorityLevel = NormalPriority; break; default: // Anything lower than normal priority should remain at the current level. priorityLevel = currentPriorityLevel; break; } var previousPriorityLevel = currentPriorityLevel; currentPriorityLevel = priorityLevel; try { return eventHandler(); } finally { currentPriorityLevel = previousPriorityLevel; } } function unstable_wrapCallback(callback) { var parentPriorityLevel = currentPriorityLevel; return function () { // This is a fork of runWithPriority, inlined for performance. var previousPriorityLevel = currentPriorityLevel; currentPriorityLevel = parentPriorityLevel; try { return callback.apply(this, arguments); } finally { currentPriorityLevel = previousPriorityLevel; } }; } function unstable_scheduleCallback(priorityLevel, callback, options) { var currentTime = getCurrentTime(); var startTime; if (typeof options === 'object' && options !== null) { var delay = options.delay; if (typeof delay === 'number' && delay > 0) { startTime = currentTime + delay; } else { startTime = currentTime; } } else { startTime = currentTime; } var timeout; switch (priorityLevel) { case ImmediatePriority: timeout = IMMEDIATE_PRIORITY_TIMEOUT; break; case UserBlockingPriority: timeout = USER_BLOCKING_PRIORITY_TIMEOUT; break; case IdlePriority: timeout = IDLE_PRIORITY_TIMEOUT; break; case LowPriority: timeout = LOW_PRIORITY_TIMEOUT; break; case NormalPriority: default: timeout = NORMAL_PRIORITY_TIMEOUT; break; } var expirationTime = startTime + timeout; var newTask = { id: taskIdCounter++, callback: callback, priorityLevel: priorityLevel, startTime: startTime, expirationTime: expirationTime, sortIndex: -1 }; if (startTime > currentTime) { // This is a delayed task. newTask.sortIndex = startTime; push(timerQueue, newTask); if (peek(taskQueue) === null && newTask === peek(timerQueue)) { // All tasks are delayed, and this is the task with the earliest delay. if (isHostTimeoutScheduled) { // Cancel an existing timeout. cancelHostTimeout(); } else { isHostTimeoutScheduled = true; } // Schedule a timeout. requestHostTimeout(handleTimeout, startTime - currentTime); } } else { newTask.sortIndex = expirationTime; push(taskQueue, newTask); // wait until the next time we yield. if (!isHostCallbackScheduled && !isPerformingWork) { isHostCallbackScheduled = true; requestHostCallback(flushWork); } } return newTask; } function unstable_pauseExecution() { } function unstable_continueExecution() { if (!isHostCallbackScheduled && !isPerformingWork) { isHostCallbackScheduled = true; requestHostCallback(flushWork); } } function unstable_getFirstCallbackNode() { return peek(taskQueue); } function unstable_cancelCallback(task) { // remove from the queue because you can't remove arbitrary nodes from an // array based heap, only the first one.) task.callback = null; } function unstable_getCurrentPriorityLevel() { return currentPriorityLevel; } var isMessageLoopRunning = false; var scheduledHostCallback = null; var taskTimeoutID = -1; // Scheduler periodically yields in case there is other work on the main // thread, like user events. By default, it yields multiple times per frame. // It does not attempt to align with frame boundaries, since most tasks don't // need to be frame aligned; for those that do, use requestAnimationFrame. var frameInterval = frameYieldMs; var startTime = -1; function shouldYieldToHost() { var timeElapsed = getCurrentTime() - startTime; if (timeElapsed < frameInterval) { // The main thread has only been blocked for a really short amount of time; // smaller than a single frame. Don't yield yet. return false; } // The main thread has been blocked for a non-negligible amount of time. We return true; } function requestPaint() { } function forceFrameRate(fps) { if (fps < 0 || fps > 125) { // Using console['error'] to evade Babel and ESLint console['error']('forceFrameRate takes a positive int between 0 and 125, ' + 'forcing frame rates higher than 125 fps is not supported'); return; } if (fps > 0) { frameInterval = Math.floor(1000 / fps); } else { // reset the framerate frameInterval = frameYieldMs; } } var performWorkUntilDeadline = function () { if (scheduledHostCallback !== null) { var currentTime = getCurrentTime(); // Keep track of the start time so we can measure how long the main thread // has been blocked. startTime = currentTime; var hasTimeRemaining = true; // If a scheduler task throws, exit the current browser task so the // error can be observed. // // Intentionally not using a try-catch, since that makes some debugging // techniques harder. Instead, if `scheduledHostCallback` errors, then // `hasMoreWork` will remain true, and we'll continue the work loop. var hasMoreWork = true; try { hasMoreWork = scheduledHostCallback(hasTimeRemaining, currentTime); } finally { if (hasMoreWork) { // If there's more work, schedule the next message event at the end // of the preceding one. schedulePerformWorkUntilDeadline(); } else { isMessageLoopRunning = false; scheduledHostCallback = null; } } } else { isMessageLoopRunning = false; } // Yielding to the browser will give it a chance to paint, so we can }; var schedulePerformWorkUntilDeadline; if (typeof localSetImmediate === 'function') { // Node.js and old IE. // There's a few reasons for why we prefer setImmediate. // // Unlike MessageChannel, it doesn't prevent a Node.js process from exiting. // (Even though this is a DOM fork of the Scheduler, you could get here // with a mix of Node.js 15+, which has a MessageChannel, and jsdom.) // https://github.com/facebook/react/issues/20756 // // But also, it runs earlier which is the semantic we want. // If other browsers ever implement it, it's better to use it. // Although both of these would be inferior to native scheduling. schedulePerformWorkUntilDeadline = function () { localSetImmediate(performWorkUntilDeadline); }; } else if (typeof MessageChannel !== 'undefined') { // DOM and Worker environments. // We prefer MessageChannel because of the 4ms setTimeout clamping. var channel = new MessageChannel(); var port = channel.port2; channel.port1.onmessage = performWorkUntilDeadline; schedulePerformWorkUntilDeadline = function () { port.postMessage(null); }; } else { // We should only fallback here in non-browser environments. schedulePerformWorkUntilDeadline = function () { localSetTimeout(performWorkUntilDeadline, 0); }; } function requestHostCallback(callback) { scheduledHostCallback = callback; if (!isMessageLoopRunning) { isMessageLoopRunning = true; schedulePerformWorkUntilDeadline(); } } function requestHostTimeout(callback, ms) { taskTimeoutID = localSetTimeout(function () { callback(getCurrentTime()); }, ms); } function cancelHostTimeout() { localClearTimeout(taskTimeoutID); taskTimeoutID = -1; } var unstable_requestPaint = requestPaint; var unstable_Profiling = null; var Scheduler = /*#__PURE__*/Object.freeze({ __proto__: null, unstable_ImmediatePriority: ImmediatePriority, unstable_UserBlockingPriority: UserBlockingPriority, unstable_NormalPriority: NormalPriority, unstable_IdlePriority: IdlePriority, unstable_LowPriority: LowPriority, unstable_runWithPriority: unstable_runWithPriority, unstable_next: unstable_next, unstable_scheduleCallback: unstable_scheduleCallback, unstable_cancelCallback: unstable_cancelCallback, unstable_wrapCallback: unstable_wrapCallback, unstable_getCurrentPriorityLevel: unstable_getCurrentPriorityLevel, unstable_shouldYield: shouldYieldToHost, unstable_requestPaint: unstable_requestPaint, unstable_continueExecution: unstable_continueExecution, unstable_pauseExecution: unstable_pauseExecution, unstable_getFirstCallbackNode: unstable_getFirstCallbackNode, get unstable_now () { return getCurrentTime; }, unstable_forceFrameRate: forceFrameRate, unstable_Profiling: unstable_Profiling }); var ReactSharedInternals$1 = { ReactCurrentDispatcher: ReactCurrentDispatcher, ReactCurrentOwner: ReactCurrentOwner, ReactCurrentBatchConfig: ReactCurrentBatchConfig, // Re-export the schedule API(s) for UMD bundles. // This avoids introducing a dependency on a new UMD global in a minor update, // Since that would be a breaking change (e.g. for all existing CodeSandboxes). // This re-export is only required for UMD bundles; // CJS bundles use the shared NPM package. Scheduler: Scheduler }; { ReactSharedInternals$1.ReactCurrentActQueue = ReactCurrentActQueue; ReactSharedInternals$1.ReactDebugCurrentFrame = ReactDebugCurrentFrame; } function startTransition(scope, options) { var prevTransition = ReactCurrentBatchConfig.transition; ReactCurrentBatchConfig.transition = {}; var currentTransition = ReactCurrentBatchConfig.transition; { ReactCurrentBatchConfig.transition._updatedFibers = new Set(); } try { scope(); } finally { ReactCurrentBatchConfig.transition = prevTransition; { if (prevTransition === null && currentTransition._updatedFibers) { var updatedFibersCount = currentTransition._updatedFibers.size; if (updatedFibersCount > 10) { warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.'); } currentTransition._updatedFibers.clear(); } } } } var didWarnAboutMessageChannel = false; var enqueueTaskImpl = null; function enqueueTask(task) { if (enqueueTaskImpl === null) { try { // read require off the module object to get around the bundlers. // we don't want them to detect a require and bundle a Node polyfill. var requireString = ('require' + Math.random()).slice(0, 7); var nodeRequire = module && module[requireString]; // assuming we're in node, let's try to get node's // version of setImmediate, bypassing fake timers if any. enqueueTaskImpl = nodeRequire.call(module, 'timers').setImmediate; } catch (_err) { // we're in a browser // we can't use regular timers because they may still be faked // so we try MessageChannel+postMessage instead enqueueTaskImpl = function (callback) { { if (didWarnAboutMessageChannel === false) { didWarnAboutMessageChannel = true; if (typeof MessageChannel === 'undefined') { error('This browser does not have a MessageChannel implementation, ' + 'so enqueuing tasks via await act(async () => ...) will fail. ' + 'Please file an issue at https://github.com/facebook/react/issues ' + 'if you encounter this warning.'); } } } var channel = new MessageChannel(); channel.port1.onmessage = callback; channel.port2.postMessage(undefined); }; } } return enqueueTaskImpl(task); } var actScopeDepth = 0; var didWarnNoAwaitAct = false; function act(callback) { { // `act` calls can be nested, so we track the depth. This represents the // number of `act` scopes on the stack. var prevActScopeDepth = actScopeDepth; actScopeDepth++; if (ReactCurrentActQueue.current === null) { // This is the outermost `act` scope. Initialize the queue. The reconciler // will detect the queue and use it instead of Scheduler. ReactCurrentActQueue.current = []; } var prevIsBatchingLegacy = ReactCurrentActQueue.isBatchingLegacy; var result; try { // Used to reproduce behavior of `batchedUpdates` in legacy mode. Only // set to `true` while the given callback is executed, not for updates // triggered during an async event, because this is how the legacy // implementation of `act` behaved. ReactCurrentActQueue.isBatchingLegacy = true; result = callback(); // Replicate behavior of original `act` implementation in legacy mode, // which flushed updates immediately after the scope function exits, even // if it's an async function. if (!prevIsBatchingLegacy && ReactCurrentActQueue.didScheduleLegacyUpdate) { var queue = ReactCurrentActQueue.current; if (queue !== null) { ReactCurrentActQueue.didScheduleLegacyUpdate = false; flushActQueue(queue); } } } catch (error) { popActScope(prevActScopeDepth); throw error; } finally { ReactCurrentActQueue.isBatchingLegacy = prevIsBatchingLegacy; } if (result !== null && typeof result === 'object' && typeof result.then === 'function') { var thenableResult = result; // The callback is an async function (i.e. returned a promise). Wait // for it to resolve before exiting the current scope. var wasAwaited = false; var thenable = { then: function (resolve, reject) { wasAwaited = true; thenableResult.then(function (returnValue) { popActScope(prevActScopeDepth); if (actScopeDepth === 0) { // We've exited the outermost act scope. Recursively flush the // queue until there's no remaining work. recursivelyFlushAsyncActWork(returnValue, resolve, reject); } else { resolve(returnValue); } }, function (error) { // The callback threw an error. popActScope(prevActScopeDepth); reject(error); }); } }; { if (!didWarnNoAwaitAct && typeof Promise !== 'undefined') { // eslint-disable-next-line no-undef Promise.resolve().then(function () {}).then(function () { if (!wasAwaited) { didWarnNoAwaitAct = true; error('You called act(async () => ...) without await. ' + 'This could lead to unexpected testing behaviour, ' + 'interleaving multiple act calls and mixing their ' + 'scopes. ' + 'You should - await act(async () => ...);'); } }); } } return thenable; } else { var returnValue = result; // The callback is not an async function. Exit the current scope // immediately, without awaiting. popActScope(prevActScopeDepth); if (actScopeDepth === 0) { // Exiting the outermost act scope. Flush the queue. var _queue = ReactCurrentActQueue.current; if (_queue !== null) { flushActQueue(_queue); ReactCurrentActQueue.current = null; } // Return a thenable. If the user awaits it, we'll flush again in // case additional work was scheduled by a microtask. var _thenable = { then: function (resolve, reject) { // Confirm we haven't re-entered another `act` scope, in case // the user does something weird like await the thenable // multiple times. if (ReactCurrentActQueue.current === null) { // Recursively flush the queue until there's no remaining work. ReactCurrentActQueue.current = []; recursivelyFlushAsyncActWork(returnValue, resolve, reject); } else { resolve(returnValue); } } }; return _thenable; } else { // Since we're inside a nested `act` scope, the returned thenable // immediately resolves. The outer scope will flush the queue. var _thenable2 = { then: function (resolve, reject) { resolve(returnValue); } }; return _thenable2; } } } } function popActScope(prevActScopeDepth) { { if (prevActScopeDepth !== actScopeDepth - 1) { error('You seem to have overlapping act() calls, this is not supported. ' + 'Be sure to await previous act() calls before making a new one. '); } actScopeDepth = prevActScopeDepth; } } function recursivelyFlushAsyncActWork(returnValue, resolve, reject) { { var queue = ReactCurrentActQueue.current; if (queue !== null) { try { flushActQueue(queue); enqueueTask(function () { if (queue.length === 0) { // No additional work was scheduled. Finish. ReactCurrentActQueue.current = null; resolve(returnValue); } else { // Keep flushing work until there's none left. recursivelyFlushAsyncActWork(returnValue, resolve, reject); } }); } catch (error) { reject(error); } } else { resolve(returnValue); } } } var isFlushing = false; function flushActQueue(queue) { { if (!isFlushing) { // Prevent re-entrance. isFlushing = true; var i = 0; try { for (; i < queue.length; i++) { var callback = queue[i]; do { callback = callback(true); } while (callback !== null); } queue.length = 0; } catch (error) { // If something throws, leave the remaining callbacks on the queue. queue = queue.slice(i + 1); throw error; } finally { isFlushing = false; } } } } var createElement$1 = createElementWithValidation ; var cloneElement$1 = cloneElementWithValidation ; var createFactory = createFactoryWithValidation ; var Children = { map: mapChildren, forEach: forEachChildren, count: countChildren, toArray: toArray, only: onlyChild }; exports.Children = Children; exports.Component = Component; exports.Fragment = REACT_FRAGMENT_TYPE; exports.Profiler = REACT_PROFILER_TYPE; exports.PureComponent = PureComponent; exports.StrictMode = REACT_STRICT_MODE_TYPE; exports.Suspense = REACT_SUSPENSE_TYPE; exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals$1; exports.act = act; exports.cloneElement = cloneElement$1; exports.createContext = createContext; exports.createElement = createElement$1; exports.createFactory = createFactory; exports.createRef = createRef; exports.forwardRef = forwardRef; exports.isValidElement = isValidElement; exports.lazy = lazy; exports.memo = memo; exports.startTransition = startTransition; exports.unstable_act = act; exports.useCallback = useCallback; exports.useContext = useContext; exports.useDebugValue = useDebugValue; exports.useDeferredValue = useDeferredValue; exports.useEffect = useEffect; exports.useId = useId; exports.useImperativeHandle = useImperativeHandle; exports.useInsertionEffect = useInsertionEffect; exports.useLayoutEffect = useLayoutEffect; exports.useMemo = useMemo; exports.useReducer = useReducer; exports.useRef = useRef; exports.useState = useState; exports.useSyncExternalStore = useSyncExternalStore; exports.useTransition = useTransition; exports.version = ReactVersion; }))); vendor/react-dom.min.js 0000644 00000401373 15206720414 0011045 0 ustar 00 /** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ (function(){/* Modernizr 3.0.0pre (Custom Build) | MIT */ 'use strict';(function(Q,zb){"object"===typeof exports&&"undefined"!==typeof module?zb(exports,require("react")):"function"===typeof define&&define.amd?define(["exports","react"],zb):(Q=Q||self,zb(Q.ReactDOM={},Q.React))})(this,function(Q,zb){function m(a){for(var b="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=1;c<arguments.length;c++)b+="&args[]="+encodeURIComponent(arguments[c]);return"Minified React error #"+a+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."} function mb(a,b){Ab(a,b);Ab(a+"Capture",b)}function Ab(a,b){$b[a]=b;for(a=0;a<b.length;a++)cg.add(b[a])}function bj(a){if(Zd.call(dg,a))return!0;if(Zd.call(eg,a))return!1;if(cj.test(a))return dg[a]=!0;eg[a]=!0;return!1}function dj(a,b,c,d){if(null!==c&&0===c.type)return!1;switch(typeof b){case "function":case "symbol":return!0;case "boolean":if(d)return!1;if(null!==c)return!c.acceptsBooleans;a=a.toLowerCase().slice(0,5);return"data-"!==a&&"aria-"!==a;default:return!1}}function ej(a,b,c,d){if(null=== b||"undefined"===typeof b||dj(a,b,c,d))return!0;if(d)return!1;if(null!==c)switch(c.type){case 3:return!b;case 4:return!1===b;case 5:return isNaN(b);case 6:return isNaN(b)||1>b}return!1}function Y(a,b,c,d,e,f,g){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=e;this.mustUseProperty=c;this.propertyName=a;this.type=b;this.sanitizeURL=f;this.removeEmptyString=g}function $d(a,b,c,d){var e=R.hasOwnProperty(b)?R[b]:null;if(null!==e?0!==e.type:d||!(2<b.length)||"o"!== b[0]&&"O"!==b[0]||"n"!==b[1]&&"N"!==b[1])ej(b,c,e,d)&&(c=null),d||null===e?bj(b)&&(null===c?a.removeAttribute(b):a.setAttribute(b,""+c)):e.mustUseProperty?a[e.propertyName]=null===c?3===e.type?!1:"":c:(b=e.attributeName,d=e.attributeNamespace,null===c?a.removeAttribute(b):(e=e.type,c=3===e||4===e&&!0===c?"":""+c,d?a.setAttributeNS(d,b,c):a.setAttribute(b,c)))}function ac(a){if(null===a||"object"!==typeof a)return null;a=fg&&a[fg]||a["@@iterator"];return"function"===typeof a?a:null}function bc(a,b, c){if(void 0===ae)try{throw Error();}catch(d){ae=(b=d.stack.trim().match(/\n( *(at )?)/))&&b[1]||""}return"\n"+ae+a}function be(a,b){if(!a||ce)return"";ce=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(b)if(b=function(){throw Error();},Object.defineProperty(b.prototype,"props",{set:function(){throw Error();}}),"object"===typeof Reflect&&Reflect.construct){try{Reflect.construct(b,[])}catch(n){var d=n}Reflect.construct(a,[],b)}else{try{b.call()}catch(n){d=n}a.call(b.prototype)}else{try{throw Error(); }catch(n){d=n}a()}}catch(n){if(n&&d&&"string"===typeof n.stack){for(var e=n.stack.split("\n"),f=d.stack.split("\n"),g=e.length-1,h=f.length-1;1<=g&&0<=h&&e[g]!==f[h];)h--;for(;1<=g&&0<=h;g--,h--)if(e[g]!==f[h]){if(1!==g||1!==h){do if(g--,h--,0>h||e[g]!==f[h]){var k="\n"+e[g].replace(" at new "," at ");a.displayName&&k.includes("<anonymous>")&&(k=k.replace("<anonymous>",a.displayName));return k}while(1<=g&&0<=h)}break}}}finally{ce=!1,Error.prepareStackTrace=c}return(a=a?a.displayName||a.name:"")?bc(a): ""}function fj(a){switch(a.tag){case 5:return bc(a.type);case 16:return bc("Lazy");case 13:return bc("Suspense");case 19:return bc("SuspenseList");case 0:case 2:case 15:return a=be(a.type,!1),a;case 11:return a=be(a.type.render,!1),a;case 1:return a=be(a.type,!0),a;default:return""}}function de(a){if(null==a)return null;if("function"===typeof a)return a.displayName||a.name||null;if("string"===typeof a)return a;switch(a){case Bb:return"Fragment";case Cb:return"Portal";case ee:return"Profiler";case fe:return"StrictMode"; case ge:return"Suspense";case he:return"SuspenseList"}if("object"===typeof a)switch(a.$$typeof){case gg:return(a.displayName||"Context")+".Consumer";case hg:return(a._context.displayName||"Context")+".Provider";case ie:var b=a.render;a=a.displayName;a||(a=b.displayName||b.name||"",a=""!==a?"ForwardRef("+a+")":"ForwardRef");return a;case je:return b=a.displayName||null,null!==b?b:de(a.type)||"Memo";case Ta:b=a._payload;a=a._init;try{return de(a(b))}catch(c){}}return null}function gj(a){var b=a.type; switch(a.tag){case 24:return"Cache";case 9:return(b.displayName||"Context")+".Consumer";case 10:return(b._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=b.render,a=a.displayName||a.name||"",b.displayName||(""!==a?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return b;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return de(b);case 8:return b===fe?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler"; case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"===typeof b)return b.displayName||b.name||null;if("string"===typeof b)return b}return null}function Ua(a){switch(typeof a){case "boolean":case "number":case "string":case "undefined":return a;case "object":return a;default:return""}}function ig(a){var b=a.type;return(a=a.nodeName)&&"input"===a.toLowerCase()&&("checkbox"===b||"radio"=== b)}function hj(a){var b=ig(a)?"checked":"value",c=Object.getOwnPropertyDescriptor(a.constructor.prototype,b),d=""+a[b];if(!a.hasOwnProperty(b)&&"undefined"!==typeof c&&"function"===typeof c.get&&"function"===typeof c.set){var e=c.get,f=c.set;Object.defineProperty(a,b,{configurable:!0,get:function(){return e.call(this)},set:function(a){d=""+a;f.call(this,a)}});Object.defineProperty(a,b,{enumerable:c.enumerable});return{getValue:function(){return d},setValue:function(a){d=""+a},stopTracking:function(){a._valueTracker= null;delete a[b]}}}}function Pc(a){a._valueTracker||(a._valueTracker=hj(a))}function jg(a){if(!a)return!1;var b=a._valueTracker;if(!b)return!0;var c=b.getValue();var d="";a&&(d=ig(a)?a.checked?"true":"false":a.value);a=d;return a!==c?(b.setValue(a),!0):!1}function Qc(a){a=a||("undefined"!==typeof document?document:void 0);if("undefined"===typeof a)return null;try{return a.activeElement||a.body}catch(b){return a.body}}function ke(a,b){var c=b.checked;return E({},b,{defaultChecked:void 0,defaultValue:void 0, value:void 0,checked:null!=c?c:a._wrapperState.initialChecked})}function kg(a,b){var c=null==b.defaultValue?"":b.defaultValue,d=null!=b.checked?b.checked:b.defaultChecked;c=Ua(null!=b.value?b.value:c);a._wrapperState={initialChecked:d,initialValue:c,controlled:"checkbox"===b.type||"radio"===b.type?null!=b.checked:null!=b.value}}function lg(a,b){b=b.checked;null!=b&&$d(a,"checked",b,!1)}function le(a,b){lg(a,b);var c=Ua(b.value),d=b.type;if(null!=c)if("number"===d){if(0===c&&""===a.value||a.value!= c)a.value=""+c}else a.value!==""+c&&(a.value=""+c);else if("submit"===d||"reset"===d){a.removeAttribute("value");return}b.hasOwnProperty("value")?me(a,b.type,c):b.hasOwnProperty("defaultValue")&&me(a,b.type,Ua(b.defaultValue));null==b.checked&&null!=b.defaultChecked&&(a.defaultChecked=!!b.defaultChecked)}function mg(a,b,c){if(b.hasOwnProperty("value")||b.hasOwnProperty("defaultValue")){var d=b.type;if(!("submit"!==d&&"reset"!==d||void 0!==b.value&&null!==b.value))return;b=""+a._wrapperState.initialValue; c||b===a.value||(a.value=b);a.defaultValue=b}c=a.name;""!==c&&(a.name="");a.defaultChecked=!!a._wrapperState.initialChecked;""!==c&&(a.name=c)}function me(a,b,c){if("number"!==b||Qc(a.ownerDocument)!==a)null==c?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+c&&(a.defaultValue=""+c)}function Db(a,b,c,d){a=a.options;if(b){b={};for(var e=0;e<c.length;e++)b["$"+c[e]]=!0;for(c=0;c<a.length;c++)e=b.hasOwnProperty("$"+a[c].value),a[c].selected!==e&&(a[c].selected=e),e&&d&&(a[c].defaultSelected= !0)}else{c=""+Ua(c);b=null;for(e=0;e<a.length;e++){if(a[e].value===c){a[e].selected=!0;d&&(a[e].defaultSelected=!0);return}null!==b||a[e].disabled||(b=a[e])}null!==b&&(b.selected=!0)}}function ne(a,b){if(null!=b.dangerouslySetInnerHTML)throw Error(m(91));return E({},b,{value:void 0,defaultValue:void 0,children:""+a._wrapperState.initialValue})}function ng(a,b){var c=b.value;if(null==c){c=b.children;b=b.defaultValue;if(null!=c){if(null!=b)throw Error(m(92));if(cc(c)){if(1<c.length)throw Error(m(93)); c=c[0]}b=c}null==b&&(b="");c=b}a._wrapperState={initialValue:Ua(c)}}function og(a,b){var c=Ua(b.value),d=Ua(b.defaultValue);null!=c&&(c=""+c,c!==a.value&&(a.value=c),null==b.defaultValue&&a.defaultValue!==c&&(a.defaultValue=c));null!=d&&(a.defaultValue=""+d)}function pg(a,b){b=a.textContent;b===a._wrapperState.initialValue&&""!==b&&null!==b&&(a.value=b)}function qg(a){switch(a){case "svg":return"http://www.w3.org/2000/svg";case "math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}} function oe(a,b){return null==a||"http://www.w3.org/1999/xhtml"===a?qg(b):"http://www.w3.org/2000/svg"===a&&"foreignObject"===b?"http://www.w3.org/1999/xhtml":a}function rg(a,b,c){return null==b||"boolean"===typeof b||""===b?"":c||"number"!==typeof b||0===b||dc.hasOwnProperty(a)&&dc[a]?(""+b).trim():b+"px"}function sg(a,b){a=a.style;for(var c in b)if(b.hasOwnProperty(c)){var d=0===c.indexOf("--"),e=rg(c,b[c],d);"float"===c&&(c="cssFloat");d?a.setProperty(c,e):a[c]=e}}function pe(a,b){if(b){if(ij[a]&& (null!=b.children||null!=b.dangerouslySetInnerHTML))throw Error(m(137,a));if(null!=b.dangerouslySetInnerHTML){if(null!=b.children)throw Error(m(60));if("object"!==typeof b.dangerouslySetInnerHTML||!("__html"in b.dangerouslySetInnerHTML))throw Error(m(61));}if(null!=b.style&&"object"!==typeof b.style)throw Error(m(62));}}function qe(a,b){if(-1===a.indexOf("-"))return"string"===typeof b.is;switch(a){case "annotation-xml":case "color-profile":case "font-face":case "font-face-src":case "font-face-uri":case "font-face-format":case "font-face-name":case "missing-glyph":return!1; default:return!0}}function re(a){a=a.target||a.srcElement||window;a.correspondingUseElement&&(a=a.correspondingUseElement);return 3===a.nodeType?a.parentNode:a}function tg(a){if(a=ec(a)){if("function"!==typeof se)throw Error(m(280));var b=a.stateNode;b&&(b=Rc(b),se(a.stateNode,a.type,b))}}function ug(a){Eb?Fb?Fb.push(a):Fb=[a]:Eb=a}function vg(){if(Eb){var a=Eb,b=Fb;Fb=Eb=null;tg(a);if(b)for(a=0;a<b.length;a++)tg(b[a])}}function wg(a,b,c){if(te)return a(b,c);te=!0;try{return xg(a,b,c)}finally{if(te= !1,null!==Eb||null!==Fb)yg(),vg()}}function fc(a,b){var c=a.stateNode;if(null===c)return null;var d=Rc(c);if(null===d)return null;c=d[b];a:switch(b){case "onClick":case "onClickCapture":case "onDoubleClick":case "onDoubleClickCapture":case "onMouseDown":case "onMouseDownCapture":case "onMouseMove":case "onMouseMoveCapture":case "onMouseUp":case "onMouseUpCapture":case "onMouseEnter":(d=!d.disabled)||(a=a.type,d=!("button"===a||"input"===a||"select"===a||"textarea"===a));a=!d;break a;default:a=!1}if(a)return null; if(c&&"function"!==typeof c)throw Error(m(231,b,typeof c));return c}function jj(a,b,c,d,e,f,g,h,k){gc=!1;Sc=null;kj.apply(lj,arguments)}function mj(a,b,c,d,e,f,g,h,k){jj.apply(this,arguments);if(gc){if(gc){var n=Sc;gc=!1;Sc=null}else throw Error(m(198));Tc||(Tc=!0,ue=n)}}function nb(a){var b=a,c=a;if(a.alternate)for(;b.return;)b=b.return;else{a=b;do b=a,0!==(b.flags&4098)&&(c=b.return),a=b.return;while(a)}return 3===b.tag?c:null}function zg(a){if(13===a.tag){var b=a.memoizedState;null===b&&(a=a.alternate, null!==a&&(b=a.memoizedState));if(null!==b)return b.dehydrated}return null}function Ag(a){if(nb(a)!==a)throw Error(m(188));}function nj(a){var b=a.alternate;if(!b){b=nb(a);if(null===b)throw Error(m(188));return b!==a?null:a}for(var c=a,d=b;;){var e=c.return;if(null===e)break;var f=e.alternate;if(null===f){d=e.return;if(null!==d){c=d;continue}break}if(e.child===f.child){for(f=e.child;f;){if(f===c)return Ag(e),a;if(f===d)return Ag(e),b;f=f.sibling}throw Error(m(188));}if(c.return!==d.return)c=e,d=f; else{for(var g=!1,h=e.child;h;){if(h===c){g=!0;c=e;d=f;break}if(h===d){g=!0;d=e;c=f;break}h=h.sibling}if(!g){for(h=f.child;h;){if(h===c){g=!0;c=f;d=e;break}if(h===d){g=!0;d=f;c=e;break}h=h.sibling}if(!g)throw Error(m(189));}}if(c.alternate!==d)throw Error(m(190));}if(3!==c.tag)throw Error(m(188));return c.stateNode.current===c?a:b}function Bg(a){a=nj(a);return null!==a?Cg(a):null}function Cg(a){if(5===a.tag||6===a.tag)return a;for(a=a.child;null!==a;){var b=Cg(a);if(null!==b)return b;a=a.sibling}return null} function oj(a,b){if(Ca&&"function"===typeof Ca.onCommitFiberRoot)try{Ca.onCommitFiberRoot(Uc,a,void 0,128===(a.current.flags&128))}catch(c){}}function pj(a){a>>>=0;return 0===a?32:31-(qj(a)/rj|0)|0}function hc(a){switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a& 4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return a}}function Vc(a,b){var c=a.pendingLanes;if(0===c)return 0;var d=0,e=a.suspendedLanes,f=a.pingedLanes,g=c&268435455;if(0!==g){var h=g&~e;0!==h?d=hc(h):(f&=g,0!==f&&(d=hc(f)))}else g=c&~e,0!==g?d=hc(g):0!==f&&(d=hc(f));if(0===d)return 0;if(0!==b&&b!==d&&0===(b&e)&& (e=d&-d,f=b&-b,e>=f||16===e&&0!==(f&4194240)))return b;0!==(d&4)&&(d|=c&16);b=a.entangledLanes;if(0!==b)for(a=a.entanglements,b&=d;0<b;)c=31-ta(b),e=1<<c,d|=a[c],b&=~e;return d}function sj(a,b){switch(a){case 1:case 2:case 4:return b+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return b+5E3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1; case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function tj(a,b){for(var c=a.suspendedLanes,d=a.pingedLanes,e=a.expirationTimes,f=a.pendingLanes;0<f;){var g=31-ta(f),h=1<<g,k=e[g];if(-1===k){if(0===(h&c)||0!==(h&d))e[g]=sj(h,b)}else k<=b&&(a.expiredLanes|=h);f&=~h}}function ve(a){a=a.pendingLanes&-1073741825;return 0!==a?a:a&1073741824?1073741824:0}function Dg(){var a=Wc;Wc<<=1;0===(Wc&4194240)&&(Wc=64);return a}function we(a){for(var b=[],c=0;31>c;c++)b.push(a); return b}function ic(a,b,c){a.pendingLanes|=b;536870912!==b&&(a.suspendedLanes=0,a.pingedLanes=0);a=a.eventTimes;b=31-ta(b);a[b]=c}function uj(a,b){var c=a.pendingLanes&~b;a.pendingLanes=b;a.suspendedLanes=0;a.pingedLanes=0;a.expiredLanes&=b;a.mutableReadLanes&=b;a.entangledLanes&=b;b=a.entanglements;var d=a.eventTimes;for(a=a.expirationTimes;0<c;){var e=31-ta(c),f=1<<e;b[e]=0;d[e]=-1;a[e]=-1;c&=~f}}function xe(a,b){var c=a.entangledLanes|=b;for(a=a.entanglements;c;){var d=31-ta(c),e=1<<d;e&b|a[d]& b&&(a[d]|=b);c&=~e}}function Eg(a){a&=-a;return 1<a?4<a?0!==(a&268435455)?16:536870912:4:1}function Fg(a,b){switch(a){case "focusin":case "focusout":Va=null;break;case "dragenter":case "dragleave":Wa=null;break;case "mouseover":case "mouseout":Xa=null;break;case "pointerover":case "pointerout":jc.delete(b.pointerId);break;case "gotpointercapture":case "lostpointercapture":kc.delete(b.pointerId)}}function lc(a,b,c,d,e,f){if(null===a||a.nativeEvent!==f)return a={blockedOn:b,domEventName:c,eventSystemFlags:d, nativeEvent:f,targetContainers:[e]},null!==b&&(b=ec(b),null!==b&&Gg(b)),a;a.eventSystemFlags|=d;b=a.targetContainers;null!==e&&-1===b.indexOf(e)&&b.push(e);return a}function vj(a,b,c,d,e){switch(b){case "focusin":return Va=lc(Va,a,b,c,d,e),!0;case "dragenter":return Wa=lc(Wa,a,b,c,d,e),!0;case "mouseover":return Xa=lc(Xa,a,b,c,d,e),!0;case "pointerover":var f=e.pointerId;jc.set(f,lc(jc.get(f)||null,a,b,c,d,e));return!0;case "gotpointercapture":return f=e.pointerId,kc.set(f,lc(kc.get(f)||null,a,b, c,d,e)),!0}return!1}function Hg(a){var b=ob(a.target);if(null!==b){var c=nb(b);if(null!==c)if(b=c.tag,13===b){if(b=zg(c),null!==b){a.blockedOn=b;wj(a.priority,function(){xj(c)});return}}else if(3===b&&c.stateNode.current.memoizedState.isDehydrated){a.blockedOn=3===c.tag?c.stateNode.containerInfo:null;return}}a.blockedOn=null}function Xc(a){if(null!==a.blockedOn)return!1;for(var b=a.targetContainers;0<b.length;){var c=ye(a.domEventName,a.eventSystemFlags,b[0],a.nativeEvent);if(null===c){c=a.nativeEvent; var d=new c.constructor(c.type,c);ze=d;c.target.dispatchEvent(d);ze=null}else return b=ec(c),null!==b&&Gg(b),a.blockedOn=c,!1;b.shift()}return!0}function Ig(a,b,c){Xc(a)&&c.delete(b)}function yj(){Ae=!1;null!==Va&&Xc(Va)&&(Va=null);null!==Wa&&Xc(Wa)&&(Wa=null);null!==Xa&&Xc(Xa)&&(Xa=null);jc.forEach(Ig);kc.forEach(Ig)}function mc(a,b){a.blockedOn===b&&(a.blockedOn=null,Ae||(Ae=!0,Jg(Kg,yj)))}function nc(a){if(0<Yc.length){mc(Yc[0],a);for(var b=1;b<Yc.length;b++){var c=Yc[b];c.blockedOn===a&&(c.blockedOn= null)}}null!==Va&&mc(Va,a);null!==Wa&&mc(Wa,a);null!==Xa&&mc(Xa,a);b=function(b){return mc(b,a)};jc.forEach(b);kc.forEach(b);for(b=0;b<Ya.length;b++)c=Ya[b],c.blockedOn===a&&(c.blockedOn=null);for(;0<Ya.length&&(b=Ya[0],null===b.blockedOn);)Hg(b),null===b.blockedOn&&Ya.shift()}function zj(a,b,c,d){var e=z,f=Gb.transition;Gb.transition=null;try{z=1,Be(a,b,c,d)}finally{z=e,Gb.transition=f}}function Aj(a,b,c,d){var e=z,f=Gb.transition;Gb.transition=null;try{z=4,Be(a,b,c,d)}finally{z=e,Gb.transition= f}}function Be(a,b,c,d){if(Zc){var e=ye(a,b,c,d);if(null===e)Ce(a,b,d,$c,c),Fg(a,d);else if(vj(e,a,b,c,d))d.stopPropagation();else if(Fg(a,d),b&4&&-1<Bj.indexOf(a)){for(;null!==e;){var f=ec(e);null!==f&&Cj(f);f=ye(a,b,c,d);null===f&&Ce(a,b,d,$c,c);if(f===e)break;e=f}null!==e&&d.stopPropagation()}else Ce(a,b,d,null,c)}}function ye(a,b,c,d){$c=null;a=re(d);a=ob(a);if(null!==a)if(b=nb(a),null===b)a=null;else if(c=b.tag,13===c){a=zg(b);if(null!==a)return a;a=null}else if(3===c){if(b.stateNode.current.memoizedState.isDehydrated)return 3=== b.tag?b.stateNode.containerInfo:null;a=null}else b!==a&&(a=null);$c=a;return null}function Lg(a){switch(a){case "cancel":case "click":case "close":case "contextmenu":case "copy":case "cut":case "auxclick":case "dblclick":case "dragend":case "dragstart":case "drop":case "focusin":case "focusout":case "input":case "invalid":case "keydown":case "keypress":case "keyup":case "mousedown":case "mouseup":case "paste":case "pause":case "play":case "pointercancel":case "pointerdown":case "pointerup":case "ratechange":case "reset":case "resize":case "seeked":case "submit":case "touchcancel":case "touchend":case "touchstart":case "volumechange":case "change":case "selectionchange":case "textInput":case "compositionstart":case "compositionend":case "compositionupdate":case "beforeblur":case "afterblur":case "beforeinput":case "blur":case "fullscreenchange":case "focus":case "hashchange":case "popstate":case "select":case "selectstart":return 1; case "drag":case "dragenter":case "dragexit":case "dragleave":case "dragover":case "mousemove":case "mouseout":case "mouseover":case "pointermove":case "pointerout":case "pointerover":case "scroll":case "toggle":case "touchmove":case "wheel":case "mouseenter":case "mouseleave":case "pointerenter":case "pointerleave":return 4;case "message":switch(Dj()){case De:return 1;case Mg:return 4;case ad:case Ej:return 16;case Ng:return 536870912;default:return 16}default:return 16}}function Og(){if(bd)return bd; var a,b=Ee,c=b.length,d,e="value"in Za?Za.value:Za.textContent,f=e.length;for(a=0;a<c&&b[a]===e[a];a++);var g=c-a;for(d=1;d<=g&&b[c-d]===e[f-d];d++);return bd=e.slice(a,1<d?1-d:void 0)}function cd(a){var b=a.keyCode;"charCode"in a?(a=a.charCode,0===a&&13===b&&(a=13)):a=b;10===a&&(a=13);return 32<=a||13===a?a:0}function dd(){return!0}function Pg(){return!1}function ka(a){function b(b,d,e,f,g){this._reactName=b;this._targetInst=e;this.type=d;this.nativeEvent=f;this.target=g;this.currentTarget=null; for(var c in a)a.hasOwnProperty(c)&&(b=a[c],this[c]=b?b(f):f[c]);this.isDefaultPrevented=(null!=f.defaultPrevented?f.defaultPrevented:!1===f.returnValue)?dd:Pg;this.isPropagationStopped=Pg;return this}E(b.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():"unknown"!==typeof a.returnValue&&(a.returnValue=!1),this.isDefaultPrevented=dd)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation(): "unknown"!==typeof a.cancelBubble&&(a.cancelBubble=!0),this.isPropagationStopped=dd)},persist:function(){},isPersistent:dd});return b}function Fj(a){var b=this.nativeEvent;return b.getModifierState?b.getModifierState(a):(a=Gj[a])?!!b[a]:!1}function Fe(a){return Fj}function Qg(a,b){switch(a){case "keyup":return-1!==Hj.indexOf(b.keyCode);case "keydown":return 229!==b.keyCode;case "keypress":case "mousedown":case "focusout":return!0;default:return!1}}function Rg(a){a=a.detail;return"object"===typeof a&& "data"in a?a.data:null}function Ij(a,b){switch(a){case "compositionend":return Rg(b);case "keypress":if(32!==b.which)return null;Sg=!0;return Tg;case "textInput":return a=b.data,a===Tg&&Sg?null:a;default:return null}}function Jj(a,b){if(Hb)return"compositionend"===a||!Ge&&Qg(a,b)?(a=Og(),bd=Ee=Za=null,Hb=!1,a):null;switch(a){case "paste":return null;case "keypress":if(!(b.ctrlKey||b.altKey||b.metaKey)||b.ctrlKey&&b.altKey){if(b.char&&1<b.char.length)return b.char;if(b.which)return String.fromCharCode(b.which)}return null; case "compositionend":return Ug&&"ko"!==b.locale?null:b.data;default:return null}}function Vg(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return"input"===b?!!Kj[a.type]:"textarea"===b?!0:!1}function Lj(a){if(!Ia)return!1;a="on"+a;var b=a in document;b||(b=document.createElement("div"),b.setAttribute(a,"return;"),b="function"===typeof b[a]);return b}function Wg(a,b,c,d){ug(d);b=ed(b,"onChange");0<b.length&&(c=new He("onChange","change",null,c,d),a.push({event:c,listeners:b}))}function Mj(a){Xg(a, 0)}function fd(a){var b=Ib(a);if(jg(b))return a}function Nj(a,b){if("change"===a)return b}function Yg(){oc&&(oc.detachEvent("onpropertychange",Zg),pc=oc=null)}function Zg(a){if("value"===a.propertyName&&fd(pc)){var b=[];Wg(b,pc,a,re(a));wg(Mj,b)}}function Oj(a,b,c){"focusin"===a?(Yg(),oc=b,pc=c,oc.attachEvent("onpropertychange",Zg)):"focusout"===a&&Yg()}function Pj(a,b){if("selectionchange"===a||"keyup"===a||"keydown"===a)return fd(pc)}function Qj(a,b){if("click"===a)return fd(b)}function Rj(a,b){if("input"=== a||"change"===a)return fd(b)}function Sj(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}function qc(a,b){if(ua(a,b))return!0;if("object"!==typeof a||null===a||"object"!==typeof b||null===b)return!1;var c=Object.keys(a),d=Object.keys(b);if(c.length!==d.length)return!1;for(d=0;d<c.length;d++){var e=c[d];if(!Zd.call(b,e)||!ua(a[e],b[e]))return!1}return!0}function $g(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function ah(a,b){var c=$g(a);a=0;for(var d;c;){if(3===c.nodeType){d=a+c.textContent.length; if(a<=b&&d>=b)return{node:c,offset:b-a};a=d}a:{for(;c;){if(c.nextSibling){c=c.nextSibling;break a}c=c.parentNode}c=void 0}c=$g(c)}}function bh(a,b){return a&&b?a===b?!0:a&&3===a.nodeType?!1:b&&3===b.nodeType?bh(a,b.parentNode):"contains"in a?a.contains(b):a.compareDocumentPosition?!!(a.compareDocumentPosition(b)&16):!1:!1}function ch(){for(var a=window,b=Qc();b instanceof a.HTMLIFrameElement;){try{var c="string"===typeof b.contentWindow.location.href}catch(d){c=!1}if(c)a=b.contentWindow;else break; b=Qc(a.document)}return b}function Ie(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&("input"===b&&("text"===a.type||"search"===a.type||"tel"===a.type||"url"===a.type||"password"===a.type)||"textarea"===b||"true"===a.contentEditable)}function Tj(a){var b=ch(),c=a.focusedElem,d=a.selectionRange;if(b!==c&&c&&c.ownerDocument&&bh(c.ownerDocument.documentElement,c)){if(null!==d&&Ie(c))if(b=d.start,a=d.end,void 0===a&&(a=b),"selectionStart"in c)c.selectionStart=b,c.selectionEnd=Math.min(a,c.value.length); else if(a=(b=c.ownerDocument||document)&&b.defaultView||window,a.getSelection){a=a.getSelection();var e=c.textContent.length,f=Math.min(d.start,e);d=void 0===d.end?f:Math.min(d.end,e);!a.extend&&f>d&&(e=d,d=f,f=e);e=ah(c,f);var g=ah(c,d);e&&g&&(1!==a.rangeCount||a.anchorNode!==e.node||a.anchorOffset!==e.offset||a.focusNode!==g.node||a.focusOffset!==g.offset)&&(b=b.createRange(),b.setStart(e.node,e.offset),a.removeAllRanges(),f>d?(a.addRange(b),a.extend(g.node,g.offset)):(b.setEnd(g.node,g.offset), a.addRange(b)))}b=[];for(a=c;a=a.parentNode;)1===a.nodeType&&b.push({element:a,left:a.scrollLeft,top:a.scrollTop});"function"===typeof c.focus&&c.focus();for(c=0;c<b.length;c++)a=b[c],a.element.scrollLeft=a.left,a.element.scrollTop=a.top}}function dh(a,b,c){var d=c.window===c?c.document:9===c.nodeType?c:c.ownerDocument;Je||null==Jb||Jb!==Qc(d)||(d=Jb,"selectionStart"in d&&Ie(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d= {anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),rc&&qc(rc,d)||(rc=d,d=ed(Ke,"onSelect"),0<d.length&&(b=new He("onSelect","select",null,b,c),a.push({event:b,listeners:d}),b.target=Jb)))}function gd(a,b){var c={};c[a.toLowerCase()]=b.toLowerCase();c["Webkit"+a]="webkit"+b;c["Moz"+a]="moz"+b;return c}function hd(a){if(Le[a])return Le[a];if(!Kb[a])return a;var b=Kb[a],c;for(c in b)if(b.hasOwnProperty(c)&&c in eh)return Le[a]=b[c];return a}function $a(a, b){fh.set(a,b);mb(b,[a])}function gh(a,b,c){var d=a.type||"unknown-event";a.currentTarget=c;mj(d,b,void 0,a);a.currentTarget=null}function Xg(a,b){b=0!==(b&4);for(var c=0;c<a.length;c++){var d=a[c],e=d.event;d=d.listeners;a:{var f=void 0;if(b)for(var g=d.length-1;0<=g;g--){var h=d[g],k=h.instance,n=h.currentTarget;h=h.listener;if(k!==f&&e.isPropagationStopped())break a;gh(e,h,n);f=k}else for(g=0;g<d.length;g++){h=d[g];k=h.instance;n=h.currentTarget;h=h.listener;if(k!==f&&e.isPropagationStopped())break a; gh(e,h,n);f=k}}}if(Tc)throw a=ue,Tc=!1,ue=null,a;}function B(a,b){var c=b[Me];void 0===c&&(c=b[Me]=new Set);var d=a+"__bubble";c.has(d)||(hh(b,a,2,!1),c.add(d))}function Ne(a,b,c){var d=0;b&&(d|=4);hh(c,a,d,b)}function sc(a){if(!a[id]){a[id]=!0;cg.forEach(function(b){"selectionchange"!==b&&(Uj.has(b)||Ne(b,!1,a),Ne(b,!0,a))});var b=9===a.nodeType?a:a.ownerDocument;null===b||b[id]||(b[id]=!0,Ne("selectionchange",!1,b))}}function hh(a,b,c,d,e){switch(Lg(b)){case 1:e=zj;break;case 4:e=Aj;break;default:e= Be}c=e.bind(null,b,c,a);e=void 0;!Oe||"touchstart"!==b&&"touchmove"!==b&&"wheel"!==b||(e=!0);d?void 0!==e?a.addEventListener(b,c,{capture:!0,passive:e}):a.addEventListener(b,c,!0):void 0!==e?a.addEventListener(b,c,{passive:e}):a.addEventListener(b,c,!1)}function Ce(a,b,c,d,e){var f=d;if(0===(b&1)&&0===(b&2)&&null!==d)a:for(;;){if(null===d)return;var g=d.tag;if(3===g||4===g){var h=d.stateNode.containerInfo;if(h===e||8===h.nodeType&&h.parentNode===e)break;if(4===g)for(g=d.return;null!==g;){var k=g.tag; if(3===k||4===k)if(k=g.stateNode.containerInfo,k===e||8===k.nodeType&&k.parentNode===e)return;g=g.return}for(;null!==h;){g=ob(h);if(null===g)return;k=g.tag;if(5===k||6===k){d=f=g;continue a}h=h.parentNode}}d=d.return}wg(function(){var d=f,e=re(c),g=[];a:{var h=fh.get(a);if(void 0!==h){var k=He,m=a;switch(a){case "keypress":if(0===cd(c))break a;case "keydown":case "keyup":k=Vj;break;case "focusin":m="focus";k=Pe;break;case "focusout":m="blur";k=Pe;break;case "beforeblur":case "afterblur":k=Pe;break; case "click":if(2===c.button)break a;case "auxclick":case "dblclick":case "mousedown":case "mousemove":case "mouseup":case "mouseout":case "mouseover":case "contextmenu":k=ih;break;case "drag":case "dragend":case "dragenter":case "dragexit":case "dragleave":case "dragover":case "dragstart":case "drop":k=Wj;break;case "touchcancel":case "touchend":case "touchmove":case "touchstart":k=Xj;break;case jh:case kh:case lh:k=Yj;break;case mh:k=Zj;break;case "scroll":k=ak;break;case "wheel":k=bk;break;case "copy":case "cut":case "paste":k= ck;break;case "gotpointercapture":case "lostpointercapture":case "pointercancel":case "pointerdown":case "pointermove":case "pointerout":case "pointerover":case "pointerup":k=nh}var l=0!==(b&4),p=!l&&"scroll"===a,w=l?null!==h?h+"Capture":null:h;l=[];for(var A=d,t;null!==A;){t=A;var M=t.stateNode;5===t.tag&&null!==M&&(t=M,null!==w&&(M=fc(A,w),null!=M&&l.push(tc(A,M,t))));if(p)break;A=A.return}0<l.length&&(h=new k(h,m,null,c,e),g.push({event:h,listeners:l}))}}if(0===(b&7)){a:{h="mouseover"===a||"pointerover"=== a;k="mouseout"===a||"pointerout"===a;if(h&&c!==ze&&(m=c.relatedTarget||c.fromElement)&&(ob(m)||m[Ja]))break a;if(k||h){h=e.window===e?e:(h=e.ownerDocument)?h.defaultView||h.parentWindow:window;if(k){if(m=c.relatedTarget||c.toElement,k=d,m=m?ob(m):null,null!==m&&(p=nb(m),m!==p||5!==m.tag&&6!==m.tag))m=null}else k=null,m=d;if(k!==m){l=ih;M="onMouseLeave";w="onMouseEnter";A="mouse";if("pointerout"===a||"pointerover"===a)l=nh,M="onPointerLeave",w="onPointerEnter",A="pointer";p=null==k?h:Ib(k);t=null== m?h:Ib(m);h=new l(M,A+"leave",k,c,e);h.target=p;h.relatedTarget=t;M=null;ob(e)===d&&(l=new l(w,A+"enter",m,c,e),l.target=t,l.relatedTarget=p,M=l);p=M;if(k&&m)b:{l=k;w=m;A=0;for(t=l;t;t=Lb(t))A++;t=0;for(M=w;M;M=Lb(M))t++;for(;0<A-t;)l=Lb(l),A--;for(;0<t-A;)w=Lb(w),t--;for(;A--;){if(l===w||null!==w&&l===w.alternate)break b;l=Lb(l);w=Lb(w)}l=null}else l=null;null!==k&&oh(g,h,k,l,!1);null!==m&&null!==p&&oh(g,p,m,l,!0)}}}a:{h=d?Ib(d):window;k=h.nodeName&&h.nodeName.toLowerCase();if("select"===k||"input"=== k&&"file"===h.type)var ma=Nj;else if(Vg(h))if(ph)ma=Rj;else{ma=Pj;var va=Oj}else(k=h.nodeName)&&"input"===k.toLowerCase()&&("checkbox"===h.type||"radio"===h.type)&&(ma=Qj);if(ma&&(ma=ma(a,d))){Wg(g,ma,c,e);break a}va&&va(a,h,d);"focusout"===a&&(va=h._wrapperState)&&va.controlled&&"number"===h.type&&me(h,"number",h.value)}va=d?Ib(d):window;switch(a){case "focusin":if(Vg(va)||"true"===va.contentEditable)Jb=va,Ke=d,rc=null;break;case "focusout":rc=Ke=Jb=null;break;case "mousedown":Je=!0;break;case "contextmenu":case "mouseup":case "dragend":Je= !1;dh(g,c,e);break;case "selectionchange":if(dk)break;case "keydown":case "keyup":dh(g,c,e)}var ab;if(Ge)b:{switch(a){case "compositionstart":var da="onCompositionStart";break b;case "compositionend":da="onCompositionEnd";break b;case "compositionupdate":da="onCompositionUpdate";break b}da=void 0}else Hb?Qg(a,c)&&(da="onCompositionEnd"):"keydown"===a&&229===c.keyCode&&(da="onCompositionStart");da&&(Ug&&"ko"!==c.locale&&(Hb||"onCompositionStart"!==da?"onCompositionEnd"===da&&Hb&&(ab=Og()):(Za=e,Ee= "value"in Za?Za.value:Za.textContent,Hb=!0)),va=ed(d,da),0<va.length&&(da=new qh(da,a,null,c,e),g.push({event:da,listeners:va}),ab?da.data=ab:(ab=Rg(c),null!==ab&&(da.data=ab))));if(ab=ek?Ij(a,c):Jj(a,c))d=ed(d,"onBeforeInput"),0<d.length&&(e=new fk("onBeforeInput","beforeinput",null,c,e),g.push({event:e,listeners:d}),e.data=ab)}Xg(g,b)})}function tc(a,b,c){return{instance:a,listener:b,currentTarget:c}}function ed(a,b){for(var c=b+"Capture",d=[];null!==a;){var e=a,f=e.stateNode;5===e.tag&&null!== f&&(e=f,f=fc(a,c),null!=f&&d.unshift(tc(a,f,e)),f=fc(a,b),null!=f&&d.push(tc(a,f,e)));a=a.return}return d}function Lb(a){if(null===a)return null;do a=a.return;while(a&&5!==a.tag);return a?a:null}function oh(a,b,c,d,e){for(var f=b._reactName,g=[];null!==c&&c!==d;){var h=c,k=h.alternate,n=h.stateNode;if(null!==k&&k===d)break;5===h.tag&&null!==n&&(h=n,e?(k=fc(c,f),null!=k&&g.unshift(tc(c,k,h))):e||(k=fc(c,f),null!=k&&g.push(tc(c,k,h))));c=c.return}0!==g.length&&a.push({event:b,listeners:g})}function rh(a){return("string"=== typeof a?a:""+a).replace(gk,"\n").replace(hk,"")}function jd(a,b,c,d){b=rh(b);if(rh(a)!==b&&c)throw Error(m(425));}function kd(){}function Qe(a,b){return"textarea"===a||"noscript"===a||"string"===typeof b.children||"number"===typeof b.children||"object"===typeof b.dangerouslySetInnerHTML&&null!==b.dangerouslySetInnerHTML&&null!=b.dangerouslySetInnerHTML.__html}function ik(a){setTimeout(function(){throw a;})}function Re(a,b){var c=b,d=0;do{var e=c.nextSibling;a.removeChild(c);if(e&&8===e.nodeType)if(c= e.data,"/$"===c){if(0===d){a.removeChild(e);nc(b);return}d--}else"$"!==c&&"$?"!==c&&"$!"!==c||d++;c=e}while(c);nc(b)}function Ka(a){for(;null!=a;a=a.nextSibling){var b=a.nodeType;if(1===b||3===b)break;if(8===b){b=a.data;if("$"===b||"$!"===b||"$?"===b)break;if("/$"===b)return null}}return a}function sh(a){a=a.previousSibling;for(var b=0;a;){if(8===a.nodeType){var c=a.data;if("$"===c||"$!"===c||"$?"===c){if(0===b)return a;b--}else"/$"===c&&b++}a=a.previousSibling}return null}function ob(a){var b=a[Da]; if(b)return b;for(var c=a.parentNode;c;){if(b=c[Ja]||c[Da]){c=b.alternate;if(null!==b.child||null!==c&&null!==c.child)for(a=sh(a);null!==a;){if(c=a[Da])return c;a=sh(a)}return b}a=c;c=a.parentNode}return null}function ec(a){a=a[Da]||a[Ja];return!a||5!==a.tag&&6!==a.tag&&13!==a.tag&&3!==a.tag?null:a}function Ib(a){if(5===a.tag||6===a.tag)return a.stateNode;throw Error(m(33));}function Rc(a){return a[uc]||null}function bb(a){return{current:a}}function v(a,b){0>Mb||(a.current=Se[Mb],Se[Mb]=null,Mb--)} function y(a,b,c){Mb++;Se[Mb]=a.current;a.current=b}function Nb(a,b){var c=a.type.contextTypes;if(!c)return cb;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}function ea(a){a=a.childContextTypes;return null!==a&&void 0!==a}function th(a,b,c){if(J.current!==cb)throw Error(m(168)); y(J,b);y(S,c)}function uh(a,b,c){var d=a.stateNode;b=b.childContextTypes;if("function"!==typeof d.getChildContext)return c;d=d.getChildContext();for(var e in d)if(!(e in b))throw Error(m(108,gj(a)||"Unknown",e));return E({},c,d)}function ld(a){a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||cb;pb=J.current;y(J,a);y(S,S.current);return!0}function vh(a,b,c){var d=a.stateNode;if(!d)throw Error(m(169));c?(a=uh(a,b,pb),d.__reactInternalMemoizedMergedChildContext=a,v(S),v(J),y(J,a)):v(S); y(S,c)}function wh(a){null===La?La=[a]:La.push(a)}function jk(a){md=!0;wh(a)}function db(){if(!Te&&null!==La){Te=!0;var a=0,b=z;try{var c=La;for(z=1;a<c.length;a++){var d=c[a];do d=d(!0);while(null!==d)}La=null;md=!1}catch(e){throw null!==La&&(La=La.slice(a+1)),xh(De,db),e;}finally{z=b,Te=!1}}return null}function qb(a,b){Ob[Pb++]=nd;Ob[Pb++]=od;od=a;nd=b}function yh(a,b,c){na[oa++]=Ma;na[oa++]=Na;na[oa++]=rb;rb=a;var d=Ma;a=Na;var e=32-ta(d)-1;d&=~(1<<e);c+=1;var f=32-ta(b)+e;if(30<f){var g=e-e%5; f=(d&(1<<g)-1).toString(32);d>>=g;e-=g;Ma=1<<32-ta(b)+e|c<<e|d;Na=f+a}else Ma=1<<f|c<<e|d,Na=a}function Ue(a){null!==a.return&&(qb(a,1),yh(a,1,0))}function Ve(a){for(;a===od;)od=Ob[--Pb],Ob[Pb]=null,nd=Ob[--Pb],Ob[Pb]=null;for(;a===rb;)rb=na[--oa],na[oa]=null,Na=na[--oa],na[oa]=null,Ma=na[--oa],na[oa]=null}function zh(a,b){var c=pa(5,null,null,0);c.elementType="DELETED";c.stateNode=b;c.return=a;b=a.deletions;null===b?(a.deletions=[c],a.flags|=16):b.push(c)}function Ah(a,b){switch(a.tag){case 5:var c= a.type;b=1!==b.nodeType||c.toLowerCase()!==b.nodeName.toLowerCase()?null:b;return null!==b?(a.stateNode=b,la=a,fa=Ka(b.firstChild),!0):!1;case 6:return b=""===a.pendingProps||3!==b.nodeType?null:b,null!==b?(a.stateNode=b,la=a,fa=null,!0):!1;case 13:return b=8!==b.nodeType?null:b,null!==b?(c=null!==rb?{id:Ma,overflow:Na}:null,a.memoizedState={dehydrated:b,treeContext:c,retryLane:1073741824},c=pa(18,null,null,0),c.stateNode=b,c.return=a,a.child=c,la=a,fa=null,!0):!1;default:return!1}}function We(a){return 0!== (a.mode&1)&&0===(a.flags&128)}function Xe(a){if(D){var b=fa;if(b){var c=b;if(!Ah(a,b)){if(We(a))throw Error(m(418));b=Ka(c.nextSibling);var d=la;b&&Ah(a,b)?zh(d,c):(a.flags=a.flags&-4097|2,D=!1,la=a)}}else{if(We(a))throw Error(m(418));a.flags=a.flags&-4097|2;D=!1;la=a}}}function Bh(a){for(a=a.return;null!==a&&5!==a.tag&&3!==a.tag&&13!==a.tag;)a=a.return;la=a}function pd(a){if(a!==la)return!1;if(!D)return Bh(a),D=!0,!1;var b;(b=3!==a.tag)&&!(b=5!==a.tag)&&(b=a.type,b="head"!==b&&"body"!==b&&!Qe(a.type, a.memoizedProps));if(b&&(b=fa)){if(We(a)){for(a=fa;a;)a=Ka(a.nextSibling);throw Error(m(418));}for(;b;)zh(a,b),b=Ka(b.nextSibling)}Bh(a);if(13===a.tag){a=a.memoizedState;a=null!==a?a.dehydrated:null;if(!a)throw Error(m(317));a:{a=a.nextSibling;for(b=0;a;){if(8===a.nodeType){var c=a.data;if("/$"===c){if(0===b){fa=Ka(a.nextSibling);break a}b--}else"$"!==c&&"$!"!==c&&"$?"!==c||b++}a=a.nextSibling}fa=null}}else fa=la?Ka(a.stateNode.nextSibling):null;return!0}function Qb(){fa=la=null;D=!1}function Ye(a){null=== wa?wa=[a]:wa.push(a)}function vc(a,b,c){a=c.ref;if(null!==a&&"function"!==typeof a&&"object"!==typeof a){if(c._owner){c=c._owner;if(c){if(1!==c.tag)throw Error(m(309));var d=c.stateNode}if(!d)throw Error(m(147,a));var e=d,f=""+a;if(null!==b&&null!==b.ref&&"function"===typeof b.ref&&b.ref._stringRef===f)return b.ref;b=function(a){var b=e.refs;null===a?delete b[f]:b[f]=a};b._stringRef=f;return b}if("string"!==typeof a)throw Error(m(284));if(!c._owner)throw Error(m(290,a));}return a}function qd(a,b){a= Object.prototype.toString.call(b);throw Error(m(31,"[object Object]"===a?"object with keys {"+Object.keys(b).join(", ")+"}":a));}function Ch(a){var b=a._init;return b(a._payload)}function Dh(a){function b(b,c){if(a){var d=b.deletions;null===d?(b.deletions=[c],b.flags|=16):d.push(c)}}function c(c,d){if(!a)return null;for(;null!==d;)b(c,d),d=d.sibling;return null}function d(a,b){for(a=new Map;null!==b;)null!==b.key?a.set(b.key,b):a.set(b.index,b),b=b.sibling;return a}function e(a,b){a=eb(a,b);a.index= 0;a.sibling=null;return a}function f(b,c,d){b.index=d;if(!a)return b.flags|=1048576,c;d=b.alternate;if(null!==d)return d=d.index,d<c?(b.flags|=2,c):d;b.flags|=2;return c}function g(b){a&&null===b.alternate&&(b.flags|=2);return b}function h(a,b,c,d){if(null===b||6!==b.tag)return b=Ze(c,a.mode,d),b.return=a,b;b=e(b,c);b.return=a;return b}function k(a,b,c,d){var f=c.type;if(f===Bb)return l(a,b,c.props.children,d,c.key);if(null!==b&&(b.elementType===f||"object"===typeof f&&null!==f&&f.$$typeof===Ta&& Ch(f)===b.type))return d=e(b,c.props),d.ref=vc(a,b,c),d.return=a,d;d=rd(c.type,c.key,c.props,null,a.mode,d);d.ref=vc(a,b,c);d.return=a;return d}function n(a,b,c,d){if(null===b||4!==b.tag||b.stateNode.containerInfo!==c.containerInfo||b.stateNode.implementation!==c.implementation)return b=$e(c,a.mode,d),b.return=a,b;b=e(b,c.children||[]);b.return=a;return b}function l(a,b,c,d,f){if(null===b||7!==b.tag)return b=sb(c,a.mode,d,f),b.return=a,b;b=e(b,c);b.return=a;return b}function u(a,b,c){if("string"=== typeof b&&""!==b||"number"===typeof b)return b=Ze(""+b,a.mode,c),b.return=a,b;if("object"===typeof b&&null!==b){switch(b.$$typeof){case sd:return c=rd(b.type,b.key,b.props,null,a.mode,c),c.ref=vc(a,null,b),c.return=a,c;case Cb:return b=$e(b,a.mode,c),b.return=a,b;case Ta:var d=b._init;return u(a,d(b._payload),c)}if(cc(b)||ac(b))return b=sb(b,a.mode,c,null),b.return=a,b;qd(a,b)}return null}function r(a,b,c,d){var e=null!==b?b.key:null;if("string"===typeof c&&""!==c||"number"===typeof c)return null!== e?null:h(a,b,""+c,d);if("object"===typeof c&&null!==c){switch(c.$$typeof){case sd:return c.key===e?k(a,b,c,d):null;case Cb:return c.key===e?n(a,b,c,d):null;case Ta:return e=c._init,r(a,b,e(c._payload),d)}if(cc(c)||ac(c))return null!==e?null:l(a,b,c,d,null);qd(a,c)}return null}function p(a,b,c,d,e){if("string"===typeof d&&""!==d||"number"===typeof d)return a=a.get(c)||null,h(b,a,""+d,e);if("object"===typeof d&&null!==d){switch(d.$$typeof){case sd:return a=a.get(null===d.key?c:d.key)||null,k(b,a,d, e);case Cb:return a=a.get(null===d.key?c:d.key)||null,n(b,a,d,e);case Ta:var f=d._init;return p(a,b,c,f(d._payload),e)}if(cc(d)||ac(d))return a=a.get(c)||null,l(b,a,d,e,null);qd(b,d)}return null}function x(e,g,h,k){for(var n=null,m=null,l=g,t=g=0,q=null;null!==l&&t<h.length;t++){l.index>t?(q=l,l=null):q=l.sibling;var A=r(e,l,h[t],k);if(null===A){null===l&&(l=q);break}a&&l&&null===A.alternate&&b(e,l);g=f(A,g,t);null===m?n=A:m.sibling=A;m=A;l=q}if(t===h.length)return c(e,l),D&&qb(e,t),n;if(null===l){for(;t< h.length;t++)l=u(e,h[t],k),null!==l&&(g=f(l,g,t),null===m?n=l:m.sibling=l,m=l);D&&qb(e,t);return n}for(l=d(e,l);t<h.length;t++)q=p(l,e,t,h[t],k),null!==q&&(a&&null!==q.alternate&&l.delete(null===q.key?t:q.key),g=f(q,g,t),null===m?n=q:m.sibling=q,m=q);a&&l.forEach(function(a){return b(e,a)});D&&qb(e,t);return n}function I(e,g,h,k){var n=ac(h);if("function"!==typeof n)throw Error(m(150));h=n.call(h);if(null==h)throw Error(m(151));for(var l=n=null,q=g,t=g=0,A=null,w=h.next();null!==q&&!w.done;t++,w= h.next()){q.index>t?(A=q,q=null):A=q.sibling;var x=r(e,q,w.value,k);if(null===x){null===q&&(q=A);break}a&&q&&null===x.alternate&&b(e,q);g=f(x,g,t);null===l?n=x:l.sibling=x;l=x;q=A}if(w.done)return c(e,q),D&&qb(e,t),n;if(null===q){for(;!w.done;t++,w=h.next())w=u(e,w.value,k),null!==w&&(g=f(w,g,t),null===l?n=w:l.sibling=w,l=w);D&&qb(e,t);return n}for(q=d(e,q);!w.done;t++,w=h.next())w=p(q,e,t,w.value,k),null!==w&&(a&&null!==w.alternate&&q.delete(null===w.key?t:w.key),g=f(w,g,t),null===l?n=w:l.sibling= w,l=w);a&&q.forEach(function(a){return b(e,a)});D&&qb(e,t);return n}function v(a,d,f,h){"object"===typeof f&&null!==f&&f.type===Bb&&null===f.key&&(f=f.props.children);if("object"===typeof f&&null!==f){switch(f.$$typeof){case sd:a:{for(var k=f.key,n=d;null!==n;){if(n.key===k){k=f.type;if(k===Bb){if(7===n.tag){c(a,n.sibling);d=e(n,f.props.children);d.return=a;a=d;break a}}else if(n.elementType===k||"object"===typeof k&&null!==k&&k.$$typeof===Ta&&Ch(k)===n.type){c(a,n.sibling);d=e(n,f.props);d.ref=vc(a, n,f);d.return=a;a=d;break a}c(a,n);break}else b(a,n);n=n.sibling}f.type===Bb?(d=sb(f.props.children,a.mode,h,f.key),d.return=a,a=d):(h=rd(f.type,f.key,f.props,null,a.mode,h),h.ref=vc(a,d,f),h.return=a,a=h)}return g(a);case Cb:a:{for(n=f.key;null!==d;){if(d.key===n)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling);d=e(d,f.children||[]);d.return=a;a=d;break a}else{c(a,d);break}else b(a,d);d=d.sibling}d=$e(f,a.mode,h);d.return=a; a=d}return g(a);case Ta:return n=f._init,v(a,d,n(f._payload),h)}if(cc(f))return x(a,d,f,h);if(ac(f))return I(a,d,f,h);qd(a,f)}return"string"===typeof f&&""!==f||"number"===typeof f?(f=""+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f),d.return=a,a=d):(c(a,d),d=Ze(f,a.mode,h),d.return=a,a=d),g(a)):c(a,d)}return v}function af(){bf=Rb=td=null}function cf(a,b){b=ud.current;v(ud);a._currentValue=b}function df(a,b,c){for(;null!==a;){var d=a.alternate;(a.childLanes&b)!==b?(a.childLanes|=b,null!==d&&(d.childLanes|= b)):null!==d&&(d.childLanes&b)!==b&&(d.childLanes|=b);if(a===c)break;a=a.return}}function Sb(a,b){td=a;bf=Rb=null;a=a.dependencies;null!==a&&null!==a.firstContext&&(0!==(a.lanes&b)&&(ha=!0),a.firstContext=null)}function qa(a){var b=a._currentValue;if(bf!==a)if(a={context:a,memoizedValue:b,next:null},null===Rb){if(null===td)throw Error(m(308));Rb=a;td.dependencies={lanes:0,firstContext:a}}else Rb=Rb.next=a;return b}function ef(a){null===tb?tb=[a]:tb.push(a)}function Eh(a,b,c,d){var e=b.interleaved; null===e?(c.next=c,ef(b)):(c.next=e.next,e.next=c);b.interleaved=c;return Oa(a,d)}function Oa(a,b){a.lanes|=b;var c=a.alternate;null!==c&&(c.lanes|=b);c=a;for(a=a.return;null!==a;)a.childLanes|=b,c=a.alternate,null!==c&&(c.childLanes|=b),c=a,a=a.return;return 3===c.tag?c.stateNode:null}function ff(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Fh(a,b){a=a.updateQueue;b.updateQueue===a&&(b.updateQueue= {baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function Pa(a,b){return{eventTime:a,lane:b,tag:0,payload:null,callback:null,next:null}}function fb(a,b,c){var d=a.updateQueue;if(null===d)return null;d=d.shared;if(0!==(p&2)){var e=d.pending;null===e?b.next=b:(b.next=e.next,e.next=b);d.pending=b;return kk(a,c)}e=d.interleaved;null===e?(b.next=b,ef(d)):(b.next=e.next,e.next=b);d.interleaved=b;return Oa(a,c)}function vd(a,b,c){b= b.updateQueue;if(null!==b&&(b=b.shared,0!==(c&4194240))){var d=b.lanes;d&=a.pendingLanes;c|=d;b.lanes=c;xe(a,c)}}function Gh(a,b){var c=a.updateQueue,d=a.alternate;if(null!==d&&(d=d.updateQueue,c===d)){var e=null,f=null;c=c.firstBaseUpdate;if(null!==c){do{var g={eventTime:c.eventTime,lane:c.lane,tag:c.tag,payload:c.payload,callback:c.callback,next:null};null===f?e=f=g:f=f.next=g;c=c.next}while(null!==c);null===f?e=f=b:f=f.next=b}else e=f=b;c={baseState:d.baseState,firstBaseUpdate:e,lastBaseUpdate:f, shared:d.shared,effects:d.effects};a.updateQueue=c;return}a=c.lastBaseUpdate;null===a?c.firstBaseUpdate=b:a.next=b;c.lastBaseUpdate=b}function wd(a,b,c,d){var e=a.updateQueue;gb=!1;var f=e.firstBaseUpdate,g=e.lastBaseUpdate,h=e.shared.pending;if(null!==h){e.shared.pending=null;var k=h,n=k.next;k.next=null;null===g?f=n:g.next=n;g=k;var l=a.alternate;null!==l&&(l=l.updateQueue,h=l.lastBaseUpdate,h!==g&&(null===h?l.firstBaseUpdate=n:h.next=n,l.lastBaseUpdate=k))}if(null!==f){var m=e.baseState;g=0;l= n=k=null;h=f;do{var r=h.lane,p=h.eventTime;if((d&r)===r){null!==l&&(l=l.next={eventTime:p,lane:0,tag:h.tag,payload:h.payload,callback:h.callback,next:null});a:{var x=a,v=h;r=b;p=c;switch(v.tag){case 1:x=v.payload;if("function"===typeof x){m=x.call(p,m,r);break a}m=x;break a;case 3:x.flags=x.flags&-65537|128;case 0:x=v.payload;r="function"===typeof x?x.call(p,m,r):x;if(null===r||void 0===r)break a;m=E({},m,r);break a;case 2:gb=!0}}null!==h.callback&&0!==h.lane&&(a.flags|=64,r=e.effects,null===r?e.effects= [h]:r.push(h))}else p={eventTime:p,lane:r,tag:h.tag,payload:h.payload,callback:h.callback,next:null},null===l?(n=l=p,k=m):l=l.next=p,g|=r;h=h.next;if(null===h)if(h=e.shared.pending,null===h)break;else r=h,h=r.next,r.next=null,e.lastBaseUpdate=r,e.shared.pending=null}while(1);null===l&&(k=m);e.baseState=k;e.firstBaseUpdate=n;e.lastBaseUpdate=l;b=e.shared.interleaved;if(null!==b){e=b;do g|=e.lane,e=e.next;while(e!==b)}else null===f&&(e.shared.lanes=0);ra|=g;a.lanes=g;a.memoizedState=m}}function Hh(a, b,c){a=b.effects;b.effects=null;if(null!==a)for(b=0;b<a.length;b++){var d=a[b],e=d.callback;if(null!==e){d.callback=null;d=c;if("function"!==typeof e)throw Error(m(191,e));e.call(d)}}}function ub(a){if(a===wc)throw Error(m(174));return a}function gf(a,b){y(xc,b);y(yc,a);y(Ea,wc);a=b.nodeType;switch(a){case 9:case 11:b=(b=b.documentElement)?b.namespaceURI:oe(null,"");break;default:a=8===a?b.parentNode:b,b=a.namespaceURI||null,a=a.tagName,b=oe(b,a)}v(Ea);y(Ea,b)}function Tb(a){v(Ea);v(yc);v(xc)}function Ih(a){ub(xc.current); var b=ub(Ea.current);var c=oe(b,a.type);b!==c&&(y(yc,a),y(Ea,c))}function hf(a){yc.current===a&&(v(Ea),v(yc))}function xd(a){for(var b=a;null!==b;){if(13===b.tag){var c=b.memoizedState;if(null!==c&&(c=c.dehydrated,null===c||"$?"===c.data||"$!"===c.data))return b}else if(19===b.tag&&void 0!==b.memoizedProps.revealOrder){if(0!==(b.flags&128))return b}else if(null!==b.child){b.child.return=b;b=b.child;continue}if(b===a)break;for(;null===b.sibling;){if(null===b.return||b.return===a)return null;b=b.return}b.sibling.return= b.return;b=b.sibling}return null}function jf(){for(var a=0;a<kf.length;a++)kf[a]._workInProgressVersionPrimary=null;kf.length=0}function V(){throw Error(m(321));}function lf(a,b){if(null===b)return!1;for(var c=0;c<b.length&&c<a.length;c++)if(!ua(a[c],b[c]))return!1;return!0}function mf(a,b,c,d,e,f){vb=f;C=b;b.memoizedState=null;b.updateQueue=null;b.lanes=0;yd.current=null===a||null===a.memoizedState?lk:mk;a=c(d,e);if(zc){f=0;do{zc=!1;Ac=0;if(25<=f)throw Error(m(301));f+=1;N=K=null;b.updateQueue=null; yd.current=nk;a=c(d,e)}while(zc)}yd.current=zd;b=null!==K&&null!==K.next;vb=0;N=K=C=null;Ad=!1;if(b)throw Error(m(300));return a}function nf(){var a=0!==Ac;Ac=0;return a}function Fa(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};null===N?C.memoizedState=N=a:N=N.next=a;return N}function sa(){if(null===K){var a=C.alternate;a=null!==a?a.memoizedState:null}else a=K.next;var b=null===N?C.memoizedState:N.next;if(null!==b)N=b,K=a;else{if(null===a)throw Error(m(310));K=a; a={memoizedState:K.memoizedState,baseState:K.baseState,baseQueue:K.baseQueue,queue:K.queue,next:null};null===N?C.memoizedState=N=a:N=N.next=a}return N}function Bc(a,b){return"function"===typeof b?b(a):b}function of(a,b,c){b=sa();c=b.queue;if(null===c)throw Error(m(311));c.lastRenderedReducer=a;var d=K,e=d.baseQueue,f=c.pending;if(null!==f){if(null!==e){var g=e.next;e.next=f.next;f.next=g}d.baseQueue=e=f;c.pending=null}if(null!==e){f=e.next;d=d.baseState;var h=g=null,k=null,n=f;do{var l=n.lane;if((vb& l)===l)null!==k&&(k=k.next={lane:0,action:n.action,hasEagerState:n.hasEagerState,eagerState:n.eagerState,next:null}),d=n.hasEagerState?n.eagerState:a(d,n.action);else{var u={lane:l,action:n.action,hasEagerState:n.hasEagerState,eagerState:n.eagerState,next:null};null===k?(h=k=u,g=d):k=k.next=u;C.lanes|=l;ra|=l}n=n.next}while(null!==n&&n!==f);null===k?g=d:k.next=h;ua(d,b.memoizedState)||(ha=!0);b.memoizedState=d;b.baseState=g;b.baseQueue=k;c.lastRenderedState=d}a=c.interleaved;if(null!==a){e=a;do f= e.lane,C.lanes|=f,ra|=f,e=e.next;while(e!==a)}else null===e&&(c.lanes=0);return[b.memoizedState,c.dispatch]}function pf(a,b,c){b=sa();c=b.queue;if(null===c)throw Error(m(311));c.lastRenderedReducer=a;var d=c.dispatch,e=c.pending,f=b.memoizedState;if(null!==e){c.pending=null;var g=e=e.next;do f=a(f,g.action),g=g.next;while(g!==e);ua(f,b.memoizedState)||(ha=!0);b.memoizedState=f;null===b.baseQueue&&(b.baseState=f);c.lastRenderedState=f}return[f,d]}function Jh(a,b,c){}function Kh(a,b,c){c=C;var d=sa(), e=b(),f=!ua(d.memoizedState,e);f&&(d.memoizedState=e,ha=!0);d=d.queue;qf(Lh.bind(null,c,d,a),[a]);if(d.getSnapshot!==b||f||null!==N&&N.memoizedState.tag&1){c.flags|=2048;Cc(9,Mh.bind(null,c,d,e,b),void 0,null);if(null===O)throw Error(m(349));0!==(vb&30)||Nh(c,b,e)}return e}function Nh(a,b,c){a.flags|=16384;a={getSnapshot:b,value:c};b=C.updateQueue;null===b?(b={lastEffect:null,stores:null},C.updateQueue=b,b.stores=[a]):(c=b.stores,null===c?b.stores=[a]:c.push(a))}function Mh(a,b,c,d){b.value=c;b.getSnapshot= d;Oh(b)&&Ph(a)}function Lh(a,b,c){return c(function(){Oh(b)&&Ph(a)})}function Oh(a){var b=a.getSnapshot;a=a.value;try{var c=b();return!ua(a,c)}catch(d){return!0}}function Ph(a){var b=Oa(a,1);null!==b&&xa(b,a,1,-1)}function Qh(a){var b=Fa();"function"===typeof a&&(a=a());b.memoizedState=b.baseState=a;a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Bc,lastRenderedState:a};b.queue=a;a=a.dispatch=ok.bind(null,C,a);return[b.memoizedState,a]}function Cc(a,b,c,d){a={tag:a,create:b, destroy:c,deps:d,next:null};b=C.updateQueue;null===b?(b={lastEffect:null,stores:null},C.updateQueue=b,b.lastEffect=a.next=a):(c=b.lastEffect,null===c?b.lastEffect=a.next=a:(d=c.next,c.next=a,a.next=d,b.lastEffect=a));return a}function Rh(a){return sa().memoizedState}function Bd(a,b,c,d){var e=Fa();C.flags|=a;e.memoizedState=Cc(1|b,c,void 0,void 0===d?null:d)}function Cd(a,b,c,d){var e=sa();d=void 0===d?null:d;var f=void 0;if(null!==K){var g=K.memoizedState;f=g.destroy;if(null!==d&&lf(d,g.deps)){e.memoizedState= Cc(b,c,f,d);return}}C.flags|=a;e.memoizedState=Cc(1|b,c,f,d)}function Sh(a,b){return Bd(8390656,8,a,b)}function qf(a,b){return Cd(2048,8,a,b)}function Th(a,b){return Cd(4,2,a,b)}function Uh(a,b){return Cd(4,4,a,b)}function Vh(a,b){if("function"===typeof b)return a=a(),b(a),function(){b(null)};if(null!==b&&void 0!==b)return a=a(),b.current=a,function(){b.current=null}}function Wh(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return Cd(4,4,Vh.bind(null,b,a),c)}function rf(a,b){}function Xh(a,b){var c= sa();b=void 0===b?null:b;var d=c.memoizedState;if(null!==d&&null!==b&&lf(b,d[1]))return d[0];c.memoizedState=[a,b];return a}function Yh(a,b){var c=sa();b=void 0===b?null:b;var d=c.memoizedState;if(null!==d&&null!==b&&lf(b,d[1]))return d[0];a=a();c.memoizedState=[a,b];return a}function Zh(a,b,c){if(0===(vb&21))return a.baseState&&(a.baseState=!1,ha=!0),a.memoizedState=c;ua(c,b)||(c=Dg(),C.lanes|=c,ra|=c,a.baseState=!0);return b}function pk(a,b,c){c=z;z=0!==c&&4>c?c:4;a(!0);var d=sf.transition;sf.transition= {};try{a(!1),b()}finally{z=c,sf.transition=d}}function $h(){return sa().memoizedState}function qk(a,b,c){var d=hb(a);c={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};if(ai(a))bi(b,c);else if(c=Eh(a,b,c,d),null!==c){var e=Z();xa(c,a,d,e);ci(c,b,d)}}function ok(a,b,c){var d=hb(a),e={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};if(ai(a))bi(b,e);else{var f=a.alternate;if(0===a.lanes&&(null===f||0===f.lanes)&&(f=b.lastRenderedReducer,null!==f))try{var g=b.lastRenderedState, h=f(g,c);e.hasEagerState=!0;e.eagerState=h;if(ua(h,g)){var k=b.interleaved;null===k?(e.next=e,ef(b)):(e.next=k.next,k.next=e);b.interleaved=e;return}}catch(n){}finally{}c=Eh(a,b,e,d);null!==c&&(e=Z(),xa(c,a,d,e),ci(c,b,d))}}function ai(a){var b=a.alternate;return a===C||null!==b&&b===C}function bi(a,b){zc=Ad=!0;var c=a.pending;null===c?b.next=b:(b.next=c.next,c.next=b);a.pending=b}function ci(a,b,c){if(0!==(c&4194240)){var d=b.lanes;d&=a.pendingLanes;c|=d;b.lanes=c;xe(a,c)}}function ya(a,b){if(a&& a.defaultProps){b=E({},b);a=a.defaultProps;for(var c in a)void 0===b[c]&&(b[c]=a[c]);return b}return b}function tf(a,b,c,d){b=a.memoizedState;c=c(d,b);c=null===c||void 0===c?b:E({},b,c);a.memoizedState=c;0===a.lanes&&(a.updateQueue.baseState=c)}function di(a,b,c,d,e,f,g){a=a.stateNode;return"function"===typeof a.shouldComponentUpdate?a.shouldComponentUpdate(d,f,g):b.prototype&&b.prototype.isPureReactComponent?!qc(c,d)||!qc(e,f):!0}function ei(a,b,c){var d=!1,e=cb;var f=b.contextType;"object"===typeof f&& null!==f?f=qa(f):(e=ea(b)?pb:J.current,d=b.contextTypes,f=(d=null!==d&&void 0!==d)?Nb(a,e):cb);b=new b(c,f);a.memoizedState=null!==b.state&&void 0!==b.state?b.state:null;b.updater=Dd;a.stateNode=b;b._reactInternals=a;d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=e,a.__reactInternalMemoizedMaskedChildContext=f);return b}function fi(a,b,c,d){a=b.state;"function"===typeof b.componentWillReceiveProps&&b.componentWillReceiveProps(c,d);"function"===typeof b.UNSAFE_componentWillReceiveProps&& b.UNSAFE_componentWillReceiveProps(c,d);b.state!==a&&Dd.enqueueReplaceState(b,b.state,null)}function uf(a,b,c,d){var e=a.stateNode;e.props=c;e.state=a.memoizedState;e.refs={};ff(a);var f=b.contextType;"object"===typeof f&&null!==f?e.context=qa(f):(f=ea(b)?pb:J.current,e.context=Nb(a,f));e.state=a.memoizedState;f=b.getDerivedStateFromProps;"function"===typeof f&&(tf(a,b,f,c),e.state=a.memoizedState);"function"===typeof b.getDerivedStateFromProps||"function"===typeof e.getSnapshotBeforeUpdate||"function"!== typeof e.UNSAFE_componentWillMount&&"function"!==typeof e.componentWillMount||(b=e.state,"function"===typeof e.componentWillMount&&e.componentWillMount(),"function"===typeof e.UNSAFE_componentWillMount&&e.UNSAFE_componentWillMount(),b!==e.state&&Dd.enqueueReplaceState(e,e.state,null),wd(a,c,e,d),e.state=a.memoizedState);"function"===typeof e.componentDidMount&&(a.flags|=4194308)}function Ub(a,b){try{var c="",d=b;do c+=fj(d),d=d.return;while(d);var e=c}catch(f){e="\nError generating stack: "+f.message+ "\n"+f.stack}return{value:a,source:b,stack:e,digest:null}}function vf(a,b,c){return{value:a,source:null,stack:null!=c?c:null,digest:null!=b?b:null}}function wf(a,b){try{console.error(b.value)}catch(c){setTimeout(function(){throw c;})}}function gi(a,b,c){c=Pa(-1,c);c.tag=3;c.payload={element:null};var d=b.value;c.callback=function(){Ed||(Ed=!0,xf=d);wf(a,b)};return c}function hi(a,b,c){c=Pa(-1,c);c.tag=3;var d=a.type.getDerivedStateFromError;if("function"===typeof d){var e=b.value;c.payload=function(){return d(e)}; c.callback=function(){wf(a,b)}}var f=a.stateNode;null!==f&&"function"===typeof f.componentDidCatch&&(c.callback=function(){wf(a,b);"function"!==typeof d&&(null===ib?ib=new Set([this]):ib.add(this));var c=b.stack;this.componentDidCatch(b.value,{componentStack:null!==c?c:""})});return c}function ii(a,b,c){var d=a.pingCache;if(null===d){d=a.pingCache=new rk;var e=new Set;d.set(b,e)}else e=d.get(b),void 0===e&&(e=new Set,d.set(b,e));e.has(c)||(e.add(c),a=sk.bind(null,a,b,c),b.then(a,a))}function ji(a){do{var b; if(b=13===a.tag)b=a.memoizedState,b=null!==b?null!==b.dehydrated?!0:!1:!0;if(b)return a;a=a.return}while(null!==a);return null}function ki(a,b,c,d,e){if(0===(a.mode&1))return a===b?a.flags|=65536:(a.flags|=128,c.flags|=131072,c.flags&=-52805,1===c.tag&&(null===c.alternate?c.tag=17:(b=Pa(-1,1),b.tag=2,fb(c,b,1))),c.lanes|=1),a;a.flags|=65536;a.lanes=e;return a}function aa(a,b,c,d){b.child=null===a?li(b,null,c,d):Vb(b,a.child,c,d)}function mi(a,b,c,d,e){c=c.render;var f=b.ref;Sb(b,e);d=mf(a,b,c,d,f, e);c=nf();if(null!==a&&!ha)return b.updateQueue=a.updateQueue,b.flags&=-2053,a.lanes&=~e,Qa(a,b,e);D&&c&&Ue(b);b.flags|=1;aa(a,b,d,e);return b.child}function ni(a,b,c,d,e){if(null===a){var f=c.type;if("function"===typeof f&&!yf(f)&&void 0===f.defaultProps&&null===c.compare&&void 0===c.defaultProps)return b.tag=15,b.type=f,oi(a,b,f,d,e);a=rd(c.type,null,d,b,b.mode,e);a.ref=b.ref;a.return=b;return b.child=a}f=a.child;if(0===(a.lanes&e)){var g=f.memoizedProps;c=c.compare;c=null!==c?c:qc;if(c(g,d)&&a.ref=== b.ref)return Qa(a,b,e)}b.flags|=1;a=eb(f,d);a.ref=b.ref;a.return=b;return b.child=a}function oi(a,b,c,d,e){if(null!==a){var f=a.memoizedProps;if(qc(f,d)&&a.ref===b.ref)if(ha=!1,b.pendingProps=d=f,0!==(a.lanes&e))0!==(a.flags&131072)&&(ha=!0);else return b.lanes=a.lanes,Qa(a,b,e)}return zf(a,b,c,d,e)}function pi(a,b,c){var d=b.pendingProps,e=d.children,f=null!==a?a.memoizedState:null;if("hidden"===d.mode)if(0===(b.mode&1))b.memoizedState={baseLanes:0,cachePool:null,transitions:null},y(Ga,ba),ba|=c; else{if(0===(c&1073741824))return a=null!==f?f.baseLanes|c:c,b.lanes=b.childLanes=1073741824,b.memoizedState={baseLanes:a,cachePool:null,transitions:null},b.updateQueue=null,y(Ga,ba),ba|=a,null;b.memoizedState={baseLanes:0,cachePool:null,transitions:null};d=null!==f?f.baseLanes:c;y(Ga,ba);ba|=d}else null!==f?(d=f.baseLanes|c,b.memoizedState=null):d=c,y(Ga,ba),ba|=d;aa(a,b,e,c);return b.child}function qi(a,b){var c=b.ref;if(null===a&&null!==c||null!==a&&a.ref!==c)b.flags|=512,b.flags|=2097152}function zf(a, b,c,d,e){var f=ea(c)?pb:J.current;f=Nb(b,f);Sb(b,e);c=mf(a,b,c,d,f,e);d=nf();if(null!==a&&!ha)return b.updateQueue=a.updateQueue,b.flags&=-2053,a.lanes&=~e,Qa(a,b,e);D&&d&&Ue(b);b.flags|=1;aa(a,b,c,e);return b.child}function ri(a,b,c,d,e){if(ea(c)){var f=!0;ld(b)}else f=!1;Sb(b,e);if(null===b.stateNode)Fd(a,b),ei(b,c,d),uf(b,c,d,e),d=!0;else if(null===a){var g=b.stateNode,h=b.memoizedProps;g.props=h;var k=g.context,n=c.contextType;"object"===typeof n&&null!==n?n=qa(n):(n=ea(c)?pb:J.current,n=Nb(b, n));var l=c.getDerivedStateFromProps,m="function"===typeof l||"function"===typeof g.getSnapshotBeforeUpdate;m||"function"!==typeof g.UNSAFE_componentWillReceiveProps&&"function"!==typeof g.componentWillReceiveProps||(h!==d||k!==n)&&fi(b,g,d,n);gb=!1;var r=b.memoizedState;g.state=r;wd(b,d,g,e);k=b.memoizedState;h!==d||r!==k||S.current||gb?("function"===typeof l&&(tf(b,c,l,d),k=b.memoizedState),(h=gb||di(b,c,h,d,r,k,n))?(m||"function"!==typeof g.UNSAFE_componentWillMount&&"function"!==typeof g.componentWillMount|| ("function"===typeof g.componentWillMount&&g.componentWillMount(),"function"===typeof g.UNSAFE_componentWillMount&&g.UNSAFE_componentWillMount()),"function"===typeof g.componentDidMount&&(b.flags|=4194308)):("function"===typeof g.componentDidMount&&(b.flags|=4194308),b.memoizedProps=d,b.memoizedState=k),g.props=d,g.state=k,g.context=n,d=h):("function"===typeof g.componentDidMount&&(b.flags|=4194308),d=!1)}else{g=b.stateNode;Fh(a,b);h=b.memoizedProps;n=b.type===b.elementType?h:ya(b.type,h);g.props= n;m=b.pendingProps;r=g.context;k=c.contextType;"object"===typeof k&&null!==k?k=qa(k):(k=ea(c)?pb:J.current,k=Nb(b,k));var p=c.getDerivedStateFromProps;(l="function"===typeof p||"function"===typeof g.getSnapshotBeforeUpdate)||"function"!==typeof g.UNSAFE_componentWillReceiveProps&&"function"!==typeof g.componentWillReceiveProps||(h!==m||r!==k)&&fi(b,g,d,k);gb=!1;r=b.memoizedState;g.state=r;wd(b,d,g,e);var x=b.memoizedState;h!==m||r!==x||S.current||gb?("function"===typeof p&&(tf(b,c,p,d),x=b.memoizedState), (n=gb||di(b,c,n,d,r,x,k)||!1)?(l||"function"!==typeof g.UNSAFE_componentWillUpdate&&"function"!==typeof g.componentWillUpdate||("function"===typeof g.componentWillUpdate&&g.componentWillUpdate(d,x,k),"function"===typeof g.UNSAFE_componentWillUpdate&&g.UNSAFE_componentWillUpdate(d,x,k)),"function"===typeof g.componentDidUpdate&&(b.flags|=4),"function"===typeof g.getSnapshotBeforeUpdate&&(b.flags|=1024)):("function"!==typeof g.componentDidUpdate||h===a.memoizedProps&&r===a.memoizedState||(b.flags|= 4),"function"!==typeof g.getSnapshotBeforeUpdate||h===a.memoizedProps&&r===a.memoizedState||(b.flags|=1024),b.memoizedProps=d,b.memoizedState=x),g.props=d,g.state=x,g.context=k,d=n):("function"!==typeof g.componentDidUpdate||h===a.memoizedProps&&r===a.memoizedState||(b.flags|=4),"function"!==typeof g.getSnapshotBeforeUpdate||h===a.memoizedProps&&r===a.memoizedState||(b.flags|=1024),d=!1)}return Af(a,b,c,d,f,e)}function Af(a,b,c,d,e,f){qi(a,b);var g=0!==(b.flags&128);if(!d&&!g)return e&&vh(b,c,!1), Qa(a,b,f);d=b.stateNode;tk.current=b;var h=g&&"function"!==typeof c.getDerivedStateFromError?null:d.render();b.flags|=1;null!==a&&g?(b.child=Vb(b,a.child,null,f),b.child=Vb(b,null,h,f)):aa(a,b,h,f);b.memoizedState=d.state;e&&vh(b,c,!0);return b.child}function si(a){var b=a.stateNode;b.pendingContext?th(a,b.pendingContext,b.pendingContext!==b.context):b.context&&th(a,b.context,!1);gf(a,b.containerInfo)}function ti(a,b,c,d,e){Qb();Ye(e);b.flags|=256;aa(a,b,c,d);return b.child}function Bf(a){return{baseLanes:a, cachePool:null,transitions:null}}function ui(a,b,c){var d=b.pendingProps,e=F.current,f=!1,g=0!==(b.flags&128),h;(h=g)||(h=null!==a&&null===a.memoizedState?!1:0!==(e&2));if(h)f=!0,b.flags&=-129;else if(null===a||null!==a.memoizedState)e|=1;y(F,e&1);if(null===a){Xe(b);a=b.memoizedState;if(null!==a&&(a=a.dehydrated,null!==a))return 0===(b.mode&1)?b.lanes=1:"$!"===a.data?b.lanes=8:b.lanes=1073741824,null;g=d.children;a=d.fallback;return f?(d=b.mode,f=b.child,g={mode:"hidden",children:g},0===(d&1)&&null!== f?(f.childLanes=0,f.pendingProps=g):f=Gd(g,d,0,null),a=sb(a,d,c,null),f.return=b,a.return=b,f.sibling=a,b.child=f,b.child.memoizedState=Bf(c),b.memoizedState=Cf,a):Df(b,g)}e=a.memoizedState;if(null!==e&&(h=e.dehydrated,null!==h))return uk(a,b,g,d,h,e,c);if(f){f=d.fallback;g=b.mode;e=a.child;h=e.sibling;var k={mode:"hidden",children:d.children};0===(g&1)&&b.child!==e?(d=b.child,d.childLanes=0,d.pendingProps=k,b.deletions=null):(d=eb(e,k),d.subtreeFlags=e.subtreeFlags&14680064);null!==h?f=eb(h,f):(f= sb(f,g,c,null),f.flags|=2);f.return=b;d.return=b;d.sibling=f;b.child=d;d=f;f=b.child;g=a.child.memoizedState;g=null===g?Bf(c):{baseLanes:g.baseLanes|c,cachePool:null,transitions:g.transitions};f.memoizedState=g;f.childLanes=a.childLanes&~c;b.memoizedState=Cf;return d}f=a.child;a=f.sibling;d=eb(f,{mode:"visible",children:d.children});0===(b.mode&1)&&(d.lanes=c);d.return=b;d.sibling=null;null!==a&&(c=b.deletions,null===c?(b.deletions=[a],b.flags|=16):c.push(a));b.child=d;b.memoizedState=null;return d} function Df(a,b,c){b=Gd({mode:"visible",children:b},a.mode,0,null);b.return=a;return a.child=b}function Hd(a,b,c,d){null!==d&&Ye(d);Vb(b,a.child,null,c);a=Df(b,b.pendingProps.children);a.flags|=2;b.memoizedState=null;return a}function uk(a,b,c,d,e,f,g){if(c){if(b.flags&256)return b.flags&=-257,d=vf(Error(m(422))),Hd(a,b,g,d);if(null!==b.memoizedState)return b.child=a.child,b.flags|=128,null;f=d.fallback;e=b.mode;d=Gd({mode:"visible",children:d.children},e,0,null);f=sb(f,e,g,null);f.flags|=2;d.return= b;f.return=b;d.sibling=f;b.child=d;0!==(b.mode&1)&&Vb(b,a.child,null,g);b.child.memoizedState=Bf(g);b.memoizedState=Cf;return f}if(0===(b.mode&1))return Hd(a,b,g,null);if("$!"===e.data){d=e.nextSibling&&e.nextSibling.dataset;if(d)var h=d.dgst;d=h;f=Error(m(419));d=vf(f,d,void 0);return Hd(a,b,g,d)}h=0!==(g&a.childLanes);if(ha||h){d=O;if(null!==d){switch(g&-g){case 4:e=2;break;case 16:e=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:e= 32;break;case 536870912:e=268435456;break;default:e=0}e=0!==(e&(d.suspendedLanes|g))?0:e;0!==e&&e!==f.retryLane&&(f.retryLane=e,Oa(a,e),xa(d,a,e,-1))}Ef();d=vf(Error(m(421)));return Hd(a,b,g,d)}if("$?"===e.data)return b.flags|=128,b.child=a.child,b=vk.bind(null,a),e._reactRetry=b,null;a=f.treeContext;fa=Ka(e.nextSibling);la=b;D=!0;wa=null;null!==a&&(na[oa++]=Ma,na[oa++]=Na,na[oa++]=rb,Ma=a.id,Na=a.overflow,rb=b);b=Df(b,d.children);b.flags|=4096;return b}function vi(a,b,c){a.lanes|=b;var d=a.alternate; null!==d&&(d.lanes|=b);df(a.return,b,c)}function Ff(a,b,c,d,e){var f=a.memoizedState;null===f?a.memoizedState={isBackwards:b,rendering:null,renderingStartTime:0,last:d,tail:c,tailMode:e}:(f.isBackwards=b,f.rendering=null,f.renderingStartTime=0,f.last=d,f.tail=c,f.tailMode=e)}function wi(a,b,c){var d=b.pendingProps,e=d.revealOrder,f=d.tail;aa(a,b,d.children,c);d=F.current;if(0!==(d&2))d=d&1|2,b.flags|=128;else{if(null!==a&&0!==(a.flags&128))a:for(a=b.child;null!==a;){if(13===a.tag)null!==a.memoizedState&& vi(a,c,b);else if(19===a.tag)vi(a,c,b);else if(null!==a.child){a.child.return=a;a=a.child;continue}if(a===b)break a;for(;null===a.sibling;){if(null===a.return||a.return===b)break a;a=a.return}a.sibling.return=a.return;a=a.sibling}d&=1}y(F,d);if(0===(b.mode&1))b.memoizedState=null;else switch(e){case "forwards":c=b.child;for(e=null;null!==c;)a=c.alternate,null!==a&&null===xd(a)&&(e=c),c=c.sibling;c=e;null===c?(e=b.child,b.child=null):(e=c.sibling,c.sibling=null);Ff(b,!1,e,c,f);break;case "backwards":c= null;e=b.child;for(b.child=null;null!==e;){a=e.alternate;if(null!==a&&null===xd(a)){b.child=e;break}a=e.sibling;e.sibling=c;c=e;e=a}Ff(b,!0,c,null,f);break;case "together":Ff(b,!1,null,null,void 0);break;default:b.memoizedState=null}return b.child}function Fd(a,b){0===(b.mode&1)&&null!==a&&(a.alternate=null,b.alternate=null,b.flags|=2)}function Qa(a,b,c){null!==a&&(b.dependencies=a.dependencies);ra|=b.lanes;if(0===(c&b.childLanes))return null;if(null!==a&&b.child!==a.child)throw Error(m(153));if(null!== b.child){a=b.child;c=eb(a,a.pendingProps);b.child=c;for(c.return=b;null!==a.sibling;)a=a.sibling,c=c.sibling=eb(a,a.pendingProps),c.return=b;c.sibling=null}return b.child}function wk(a,b,c){switch(b.tag){case 3:si(b);Qb();break;case 5:Ih(b);break;case 1:ea(b.type)&&ld(b);break;case 4:gf(b,b.stateNode.containerInfo);break;case 10:var d=b.type._context,e=b.memoizedProps.value;y(ud,d._currentValue);d._currentValue=e;break;case 13:d=b.memoizedState;if(null!==d){if(null!==d.dehydrated)return y(F,F.current& 1),b.flags|=128,null;if(0!==(c&b.child.childLanes))return ui(a,b,c);y(F,F.current&1);a=Qa(a,b,c);return null!==a?a.sibling:null}y(F,F.current&1);break;case 19:d=0!==(c&b.childLanes);if(0!==(a.flags&128)){if(d)return wi(a,b,c);b.flags|=128}e=b.memoizedState;null!==e&&(e.rendering=null,e.tail=null,e.lastEffect=null);y(F,F.current);if(d)break;else return null;case 22:case 23:return b.lanes=0,pi(a,b,c)}return Qa(a,b,c)}function Dc(a,b){if(!D)switch(a.tailMode){case "hidden":b=a.tail;for(var c=null;null!== b;)null!==b.alternate&&(c=b),b=b.sibling;null===c?a.tail=null:c.sibling=null;break;case "collapsed":c=a.tail;for(var d=null;null!==c;)null!==c.alternate&&(d=c),c=c.sibling;null===d?b||null===a.tail?a.tail=null:a.tail.sibling=null:d.sibling=null}}function W(a){var b=null!==a.alternate&&a.alternate.child===a.child,c=0,d=0;if(b)for(var e=a.child;null!==e;)c|=e.lanes|e.childLanes,d|=e.subtreeFlags&14680064,d|=e.flags&14680064,e.return=a,e=e.sibling;else for(e=a.child;null!==e;)c|=e.lanes|e.childLanes, d|=e.subtreeFlags,d|=e.flags,e.return=a,e=e.sibling;a.subtreeFlags|=d;a.childLanes=c;return b}function xk(a,b,c){var d=b.pendingProps;Ve(b);switch(b.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return W(b),null;case 1:return ea(b.type)&&(v(S),v(J)),W(b),null;case 3:d=b.stateNode;Tb();v(S);v(J);jf();d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null);if(null===a||null===a.child)pd(b)?b.flags|=4:null===a||a.memoizedState.isDehydrated&&0===(b.flags& 256)||(b.flags|=1024,null!==wa&&(Gf(wa),wa=null));xi(a,b);W(b);return null;case 5:hf(b);var e=ub(xc.current);c=b.type;if(null!==a&&null!=b.stateNode)yk(a,b,c,d,e),a.ref!==b.ref&&(b.flags|=512,b.flags|=2097152);else{if(!d){if(null===b.stateNode)throw Error(m(166));W(b);return null}a=ub(Ea.current);if(pd(b)){d=b.stateNode;c=b.type;var f=b.memoizedProps;d[Da]=b;d[uc]=f;a=0!==(b.mode&1);switch(c){case "dialog":B("cancel",d);B("close",d);break;case "iframe":case "object":case "embed":B("load",d);break; case "video":case "audio":for(e=0;e<Ec.length;e++)B(Ec[e],d);break;case "source":B("error",d);break;case "img":case "image":case "link":B("error",d);B("load",d);break;case "details":B("toggle",d);break;case "input":kg(d,f);B("invalid",d);break;case "select":d._wrapperState={wasMultiple:!!f.multiple};B("invalid",d);break;case "textarea":ng(d,f),B("invalid",d)}pe(c,f);e=null;for(var g in f)if(f.hasOwnProperty(g)){var h=f[g];"children"===g?"string"===typeof h?d.textContent!==h&&(!0!==f.suppressHydrationWarning&& jd(d.textContent,h,a),e=["children",h]):"number"===typeof h&&d.textContent!==""+h&&(!0!==f.suppressHydrationWarning&&jd(d.textContent,h,a),e=["children",""+h]):$b.hasOwnProperty(g)&&null!=h&&"onScroll"===g&&B("scroll",d)}switch(c){case "input":Pc(d);mg(d,f,!0);break;case "textarea":Pc(d);pg(d);break;case "select":case "option":break;default:"function"===typeof f.onClick&&(d.onclick=kd)}d=e;b.updateQueue=d;null!==d&&(b.flags|=4)}else{g=9===e.nodeType?e:e.ownerDocument;"http://www.w3.org/1999/xhtml"=== a&&(a=qg(c));"http://www.w3.org/1999/xhtml"===a?"script"===c?(a=g.createElement("div"),a.innerHTML="<script>\x3c/script>",a=a.removeChild(a.firstChild)):"string"===typeof d.is?a=g.createElement(c,{is:d.is}):(a=g.createElement(c),"select"===c&&(g=a,d.multiple?g.multiple=!0:d.size&&(g.size=d.size))):a=g.createElementNS(a,c);a[Da]=b;a[uc]=d;zk(a,b,!1,!1);b.stateNode=a;a:{g=qe(c,d);switch(c){case "dialog":B("cancel",a);B("close",a);e=d;break;case "iframe":case "object":case "embed":B("load",a);e=d;break; case "video":case "audio":for(e=0;e<Ec.length;e++)B(Ec[e],a);e=d;break;case "source":B("error",a);e=d;break;case "img":case "image":case "link":B("error",a);B("load",a);e=d;break;case "details":B("toggle",a);e=d;break;case "input":kg(a,d);e=ke(a,d);B("invalid",a);break;case "option":e=d;break;case "select":a._wrapperState={wasMultiple:!!d.multiple};e=E({},d,{value:void 0});B("invalid",a);break;case "textarea":ng(a,d);e=ne(a,d);B("invalid",a);break;default:e=d}pe(c,e);h=e;for(f in h)if(h.hasOwnProperty(f)){var k= h[f];"style"===f?sg(a,k):"dangerouslySetInnerHTML"===f?(k=k?k.__html:void 0,null!=k&&yi(a,k)):"children"===f?"string"===typeof k?("textarea"!==c||""!==k)&&Fc(a,k):"number"===typeof k&&Fc(a,""+k):"suppressContentEditableWarning"!==f&&"suppressHydrationWarning"!==f&&"autoFocus"!==f&&($b.hasOwnProperty(f)?null!=k&&"onScroll"===f&&B("scroll",a):null!=k&&$d(a,f,k,g))}switch(c){case "input":Pc(a);mg(a,d,!1);break;case "textarea":Pc(a);pg(a);break;case "option":null!=d.value&&a.setAttribute("value",""+Ua(d.value)); break;case "select":a.multiple=!!d.multiple;f=d.value;null!=f?Db(a,!!d.multiple,f,!1):null!=d.defaultValue&&Db(a,!!d.multiple,d.defaultValue,!0);break;default:"function"===typeof e.onClick&&(a.onclick=kd)}switch(c){case "button":case "input":case "select":case "textarea":d=!!d.autoFocus;break a;case "img":d=!0;break a;default:d=!1}}d&&(b.flags|=4)}null!==b.ref&&(b.flags|=512,b.flags|=2097152)}W(b);return null;case 6:if(a&&null!=b.stateNode)Ak(a,b,a.memoizedProps,d);else{if("string"!==typeof d&&null=== b.stateNode)throw Error(m(166));c=ub(xc.current);ub(Ea.current);if(pd(b)){d=b.stateNode;c=b.memoizedProps;d[Da]=b;if(f=d.nodeValue!==c)if(a=la,null!==a)switch(a.tag){case 3:jd(d.nodeValue,c,0!==(a.mode&1));break;case 5:!0!==a.memoizedProps.suppressHydrationWarning&&jd(d.nodeValue,c,0!==(a.mode&1))}f&&(b.flags|=4)}else d=(9===c.nodeType?c:c.ownerDocument).createTextNode(d),d[Da]=b,b.stateNode=d}W(b);return null;case 13:v(F);d=b.memoizedState;if(null===a||null!==a.memoizedState&&null!==a.memoizedState.dehydrated){if(D&& null!==fa&&0!==(b.mode&1)&&0===(b.flags&128)){for(f=fa;f;)f=Ka(f.nextSibling);Qb();b.flags|=98560;f=!1}else if(f=pd(b),null!==d&&null!==d.dehydrated){if(null===a){if(!f)throw Error(m(318));f=b.memoizedState;f=null!==f?f.dehydrated:null;if(!f)throw Error(m(317));f[Da]=b}else Qb(),0===(b.flags&128)&&(b.memoizedState=null),b.flags|=4;W(b);f=!1}else null!==wa&&(Gf(wa),wa=null),f=!0;if(!f)return b.flags&65536?b:null}if(0!==(b.flags&128))return b.lanes=c,b;d=null!==d;d!==(null!==a&&null!==a.memoizedState)&& d&&(b.child.flags|=8192,0!==(b.mode&1)&&(null===a||0!==(F.current&1)?0===L&&(L=3):Ef()));null!==b.updateQueue&&(b.flags|=4);W(b);return null;case 4:return Tb(),xi(a,b),null===a&&sc(b.stateNode.containerInfo),W(b),null;case 10:return cf(b.type._context),W(b),null;case 17:return ea(b.type)&&(v(S),v(J)),W(b),null;case 19:v(F);f=b.memoizedState;if(null===f)return W(b),null;d=0!==(b.flags&128);g=f.rendering;if(null===g)if(d)Dc(f,!1);else{if(0!==L||null!==a&&0!==(a.flags&128))for(a=b.child;null!==a;){g= xd(a);if(null!==g){b.flags|=128;Dc(f,!1);d=g.updateQueue;null!==d&&(b.updateQueue=d,b.flags|=4);b.subtreeFlags=0;d=c;for(c=b.child;null!==c;)f=c,a=d,f.flags&=14680066,g=f.alternate,null===g?(f.childLanes=0,f.lanes=a,f.child=null,f.subtreeFlags=0,f.memoizedProps=null,f.memoizedState=null,f.updateQueue=null,f.dependencies=null,f.stateNode=null):(f.childLanes=g.childLanes,f.lanes=g.lanes,f.child=g.child,f.subtreeFlags=0,f.deletions=null,f.memoizedProps=g.memoizedProps,f.memoizedState=g.memoizedState, f.updateQueue=g.updateQueue,f.type=g.type,a=g.dependencies,f.dependencies=null===a?null:{lanes:a.lanes,firstContext:a.firstContext}),c=c.sibling;y(F,F.current&1|2);return b.child}a=a.sibling}null!==f.tail&&P()>Hf&&(b.flags|=128,d=!0,Dc(f,!1),b.lanes=4194304)}else{if(!d)if(a=xd(g),null!==a){if(b.flags|=128,d=!0,c=a.updateQueue,null!==c&&(b.updateQueue=c,b.flags|=4),Dc(f,!0),null===f.tail&&"hidden"===f.tailMode&&!g.alternate&&!D)return W(b),null}else 2*P()-f.renderingStartTime>Hf&&1073741824!==c&&(b.flags|= 128,d=!0,Dc(f,!1),b.lanes=4194304);f.isBackwards?(g.sibling=b.child,b.child=g):(c=f.last,null!==c?c.sibling=g:b.child=g,f.last=g)}if(null!==f.tail)return b=f.tail,f.rendering=b,f.tail=b.sibling,f.renderingStartTime=P(),b.sibling=null,c=F.current,y(F,d?c&1|2:c&1),b;W(b);return null;case 22:case 23:return ba=Ga.current,v(Ga),d=null!==b.memoizedState,null!==a&&null!==a.memoizedState!==d&&(b.flags|=8192),d&&0!==(b.mode&1)?0!==(ba&1073741824)&&(W(b),b.subtreeFlags&6&&(b.flags|=8192)):W(b),null;case 24:return null; case 25:return null}throw Error(m(156,b.tag));}function Bk(a,b,c){Ve(b);switch(b.tag){case 1:return ea(b.type)&&(v(S),v(J)),a=b.flags,a&65536?(b.flags=a&-65537|128,b):null;case 3:return Tb(),v(S),v(J),jf(),a=b.flags,0!==(a&65536)&&0===(a&128)?(b.flags=a&-65537|128,b):null;case 5:return hf(b),null;case 13:v(F);a=b.memoizedState;if(null!==a&&null!==a.dehydrated){if(null===b.alternate)throw Error(m(340));Qb()}a=b.flags;return a&65536?(b.flags=a&-65537|128,b):null;case 19:return v(F),null;case 4:return Tb(), null;case 10:return cf(b.type._context),null;case 22:case 23:return ba=Ga.current,v(Ga),null;case 24:return null;default:return null}}function Wb(a,b){var c=a.ref;if(null!==c)if("function"===typeof c)try{c(null)}catch(d){G(a,b,d)}else c.current=null}function If(a,b,c){try{c()}catch(d){G(a,b,d)}}function Ck(a,b){Jf=Zc;a=ch();if(Ie(a)){if("selectionStart"in a)var c={start:a.selectionStart,end:a.selectionEnd};else a:{c=(c=a.ownerDocument)&&c.defaultView||window;var d=c.getSelection&&c.getSelection(); if(d&&0!==d.rangeCount){c=d.anchorNode;var e=d.anchorOffset,f=d.focusNode;d=d.focusOffset;try{c.nodeType,f.nodeType}catch(M){c=null;break a}var g=0,h=-1,k=-1,n=0,q=0,u=a,r=null;b:for(;;){for(var p;;){u!==c||0!==e&&3!==u.nodeType||(h=g+e);u!==f||0!==d&&3!==u.nodeType||(k=g+d);3===u.nodeType&&(g+=u.nodeValue.length);if(null===(p=u.firstChild))break;r=u;u=p}for(;;){if(u===a)break b;r===c&&++n===e&&(h=g);r===f&&++q===d&&(k=g);if(null!==(p=u.nextSibling))break;u=r;r=u.parentNode}u=p}c=-1===h||-1===k?null: {start:h,end:k}}else c=null}c=c||{start:0,end:0}}else c=null;Kf={focusedElem:a,selectionRange:c};Zc=!1;for(l=b;null!==l;)if(b=l,a=b.child,0!==(b.subtreeFlags&1028)&&null!==a)a.return=b,l=a;else for(;null!==l;){b=l;try{var x=b.alternate;if(0!==(b.flags&1024))switch(b.tag){case 0:case 11:case 15:break;case 1:if(null!==x){var v=x.memoizedProps,z=x.memoizedState,w=b.stateNode,A=w.getSnapshotBeforeUpdate(b.elementType===b.type?v:ya(b.type,v),z);w.__reactInternalSnapshotBeforeUpdate=A}break;case 3:var t= b.stateNode.containerInfo;1===t.nodeType?t.textContent="":9===t.nodeType&&t.documentElement&&t.removeChild(t.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(m(163));}}catch(M){G(b,b.return,M)}a=b.sibling;if(null!==a){a.return=b.return;l=a;break}l=b.return}x=zi;zi=!1;return x}function Gc(a,b,c){var d=b.updateQueue;d=null!==d?d.lastEffect:null;if(null!==d){var e=d=d.next;do{if((e.tag&a)===a){var f=e.destroy;e.destroy=void 0;void 0!==f&&If(b,c,f)}e=e.next}while(e!==d)}} function Id(a,b){b=b.updateQueue;b=null!==b?b.lastEffect:null;if(null!==b){var c=b=b.next;do{if((c.tag&a)===a){var d=c.create;c.destroy=d()}c=c.next}while(c!==b)}}function Lf(a){var b=a.ref;if(null!==b){var c=a.stateNode;switch(a.tag){case 5:a=c;break;default:a=c}"function"===typeof b?b(a):b.current=a}}function Ai(a){var b=a.alternate;null!==b&&(a.alternate=null,Ai(b));a.child=null;a.deletions=null;a.sibling=null;5===a.tag&&(b=a.stateNode,null!==b&&(delete b[Da],delete b[uc],delete b[Me],delete b[Dk], delete b[Ek]));a.stateNode=null;a.return=null;a.dependencies=null;a.memoizedProps=null;a.memoizedState=null;a.pendingProps=null;a.stateNode=null;a.updateQueue=null}function Bi(a){return 5===a.tag||3===a.tag||4===a.tag}function Ci(a){a:for(;;){for(;null===a.sibling;){if(null===a.return||Bi(a.return))return null;a=a.return}a.sibling.return=a.return;for(a=a.sibling;5!==a.tag&&6!==a.tag&&18!==a.tag;){if(a.flags&2)continue a;if(null===a.child||4===a.tag)continue a;else a.child.return=a,a=a.child}if(!(a.flags& 2))return a.stateNode}}function Mf(a,b,c){var d=a.tag;if(5===d||6===d)a=a.stateNode,b?8===c.nodeType?c.parentNode.insertBefore(a,b):c.insertBefore(a,b):(8===c.nodeType?(b=c.parentNode,b.insertBefore(a,c)):(b=c,b.appendChild(a)),c=c._reactRootContainer,null!==c&&void 0!==c||null!==b.onclick||(b.onclick=kd));else if(4!==d&&(a=a.child,null!==a))for(Mf(a,b,c),a=a.sibling;null!==a;)Mf(a,b,c),a=a.sibling}function Nf(a,b,c){var d=a.tag;if(5===d||6===d)a=a.stateNode,b?c.insertBefore(a,b):c.appendChild(a); else if(4!==d&&(a=a.child,null!==a))for(Nf(a,b,c),a=a.sibling;null!==a;)Nf(a,b,c),a=a.sibling}function jb(a,b,c){for(c=c.child;null!==c;)Di(a,b,c),c=c.sibling}function Di(a,b,c){if(Ca&&"function"===typeof Ca.onCommitFiberUnmount)try{Ca.onCommitFiberUnmount(Uc,c)}catch(h){}switch(c.tag){case 5:X||Wb(c,b);case 6:var d=T,e=za;T=null;jb(a,b,c);T=d;za=e;null!==T&&(za?(a=T,c=c.stateNode,8===a.nodeType?a.parentNode.removeChild(c):a.removeChild(c)):T.removeChild(c.stateNode));break;case 18:null!==T&&(za? (a=T,c=c.stateNode,8===a.nodeType?Re(a.parentNode,c):1===a.nodeType&&Re(a,c),nc(a)):Re(T,c.stateNode));break;case 4:d=T;e=za;T=c.stateNode.containerInfo;za=!0;jb(a,b,c);T=d;za=e;break;case 0:case 11:case 14:case 15:if(!X&&(d=c.updateQueue,null!==d&&(d=d.lastEffect,null!==d))){e=d=d.next;do{var f=e,g=f.destroy;f=f.tag;void 0!==g&&(0!==(f&2)?If(c,b,g):0!==(f&4)&&If(c,b,g));e=e.next}while(e!==d)}jb(a,b,c);break;case 1:if(!X&&(Wb(c,b),d=c.stateNode,"function"===typeof d.componentWillUnmount))try{d.props= c.memoizedProps,d.state=c.memoizedState,d.componentWillUnmount()}catch(h){G(c,b,h)}jb(a,b,c);break;case 21:jb(a,b,c);break;case 22:c.mode&1?(X=(d=X)||null!==c.memoizedState,jb(a,b,c),X=d):jb(a,b,c);break;default:jb(a,b,c)}}function Ei(a){var b=a.updateQueue;if(null!==b){a.updateQueue=null;var c=a.stateNode;null===c&&(c=a.stateNode=new Fk);b.forEach(function(b){var d=Gk.bind(null,a,b);c.has(b)||(c.add(b),b.then(d,d))})}}function Aa(a,b,c){c=b.deletions;if(null!==c)for(var d=0;d<c.length;d++){var e= c[d];try{var f=a,g=b,h=g;a:for(;null!==h;){switch(h.tag){case 5:T=h.stateNode;za=!1;break a;case 3:T=h.stateNode.containerInfo;za=!0;break a;case 4:T=h.stateNode.containerInfo;za=!0;break a}h=h.return}if(null===T)throw Error(m(160));Di(f,g,e);T=null;za=!1;var k=e.alternate;null!==k&&(k.return=null);e.return=null}catch(n){G(e,b,n)}}if(b.subtreeFlags&12854)for(b=b.child;null!==b;)Fi(b,a),b=b.sibling}function Fi(a,b,c){var d=a.alternate;c=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:Aa(b,a); Ha(a);if(c&4){try{Gc(3,a,a.return),Id(3,a)}catch(I){G(a,a.return,I)}try{Gc(5,a,a.return)}catch(I){G(a,a.return,I)}}break;case 1:Aa(b,a);Ha(a);c&512&&null!==d&&Wb(d,d.return);break;case 5:Aa(b,a);Ha(a);c&512&&null!==d&&Wb(d,d.return);if(a.flags&32){var e=a.stateNode;try{Fc(e,"")}catch(I){G(a,a.return,I)}}if(c&4&&(e=a.stateNode,null!=e)){var f=a.memoizedProps,g=null!==d?d.memoizedProps:f,h=a.type,k=a.updateQueue;a.updateQueue=null;if(null!==k)try{"input"===h&&"radio"===f.type&&null!=f.name&&lg(e,f); qe(h,g);var n=qe(h,f);for(g=0;g<k.length;g+=2){var q=k[g],u=k[g+1];"style"===q?sg(e,u):"dangerouslySetInnerHTML"===q?yi(e,u):"children"===q?Fc(e,u):$d(e,q,u,n)}switch(h){case "input":le(e,f);break;case "textarea":og(e,f);break;case "select":var r=e._wrapperState.wasMultiple;e._wrapperState.wasMultiple=!!f.multiple;var p=f.value;null!=p?Db(e,!!f.multiple,p,!1):r!==!!f.multiple&&(null!=f.defaultValue?Db(e,!!f.multiple,f.defaultValue,!0):Db(e,!!f.multiple,f.multiple?[]:"",!1))}e[uc]=f}catch(I){G(a,a.return, I)}}break;case 6:Aa(b,a);Ha(a);if(c&4){if(null===a.stateNode)throw Error(m(162));e=a.stateNode;f=a.memoizedProps;try{e.nodeValue=f}catch(I){G(a,a.return,I)}}break;case 3:Aa(b,a);Ha(a);if(c&4&&null!==d&&d.memoizedState.isDehydrated)try{nc(b.containerInfo)}catch(I){G(a,a.return,I)}break;case 4:Aa(b,a);Ha(a);break;case 13:Aa(b,a);Ha(a);e=a.child;e.flags&8192&&(f=null!==e.memoizedState,e.stateNode.isHidden=f,!f||null!==e.alternate&&null!==e.alternate.memoizedState||(Of=P()));c&4&&Ei(a);break;case 22:q= null!==d&&null!==d.memoizedState;a.mode&1?(X=(n=X)||q,Aa(b,a),X=n):Aa(b,a);Ha(a);if(c&8192){n=null!==a.memoizedState;if((a.stateNode.isHidden=n)&&!q&&0!==(a.mode&1))for(l=a,q=a.child;null!==q;){for(u=l=q;null!==l;){r=l;p=r.child;switch(r.tag){case 0:case 11:case 14:case 15:Gc(4,r,r.return);break;case 1:Wb(r,r.return);var x=r.stateNode;if("function"===typeof x.componentWillUnmount){c=r;b=r.return;try{d=c,x.props=d.memoizedProps,x.state=d.memoizedState,x.componentWillUnmount()}catch(I){G(c,b,I)}}break; case 5:Wb(r,r.return);break;case 22:if(null!==r.memoizedState){Gi(u);continue}}null!==p?(p.return=r,l=p):Gi(u)}q=q.sibling}a:for(q=null,u=a;;){if(5===u.tag){if(null===q){q=u;try{e=u.stateNode,n?(f=e.style,"function"===typeof f.setProperty?f.setProperty("display","none","important"):f.display="none"):(h=u.stateNode,k=u.memoizedProps.style,g=void 0!==k&&null!==k&&k.hasOwnProperty("display")?k.display:null,h.style.display=rg("display",g))}catch(I){G(a,a.return,I)}}}else if(6===u.tag){if(null===q)try{u.stateNode.nodeValue= n?"":u.memoizedProps}catch(I){G(a,a.return,I)}}else if((22!==u.tag&&23!==u.tag||null===u.memoizedState||u===a)&&null!==u.child){u.child.return=u;u=u.child;continue}if(u===a)break a;for(;null===u.sibling;){if(null===u.return||u.return===a)break a;q===u&&(q=null);u=u.return}q===u&&(q=null);u.sibling.return=u.return;u=u.sibling}}break;case 19:Aa(b,a);Ha(a);c&4&&Ei(a);break;case 21:break;default:Aa(b,a),Ha(a)}}function Ha(a){var b=a.flags;if(b&2){try{a:{for(var c=a.return;null!==c;){if(Bi(c)){var d=c; break a}c=c.return}throw Error(m(160));}switch(d.tag){case 5:var e=d.stateNode;d.flags&32&&(Fc(e,""),d.flags&=-33);var f=Ci(a);Nf(a,f,e);break;case 3:case 4:var g=d.stateNode.containerInfo,h=Ci(a);Mf(a,h,g);break;default:throw Error(m(161));}}catch(k){G(a,a.return,k)}a.flags&=-3}b&4096&&(a.flags&=-4097)}function Hk(a,b,c){l=a;Hi(a,b,c)}function Hi(a,b,c){for(var d=0!==(a.mode&1);null!==l;){var e=l,f=e.child;if(22===e.tag&&d){var g=null!==e.memoizedState||Jd;if(!g){var h=e.alternate,k=null!==h&&null!== h.memoizedState||X;h=Jd;var n=X;Jd=g;if((X=k)&&!n)for(l=e;null!==l;)g=l,k=g.child,22===g.tag&&null!==g.memoizedState?Ii(e):null!==k?(k.return=g,l=k):Ii(e);for(;null!==f;)l=f,Hi(f,b,c),f=f.sibling;l=e;Jd=h;X=n}Ji(a,b,c)}else 0!==(e.subtreeFlags&8772)&&null!==f?(f.return=e,l=f):Ji(a,b,c)}}function Ji(a,b,c){for(;null!==l;){b=l;if(0!==(b.flags&8772)){c=b.alternate;try{if(0!==(b.flags&8772))switch(b.tag){case 0:case 11:case 15:X||Id(5,b);break;case 1:var d=b.stateNode;if(b.flags&4&&!X)if(null===c)d.componentDidMount(); else{var e=b.elementType===b.type?c.memoizedProps:ya(b.type,c.memoizedProps);d.componentDidUpdate(e,c.memoizedState,d.__reactInternalSnapshotBeforeUpdate)}var f=b.updateQueue;null!==f&&Hh(b,f,d);break;case 3:var g=b.updateQueue;if(null!==g){c=null;if(null!==b.child)switch(b.child.tag){case 5:c=b.child.stateNode;break;case 1:c=b.child.stateNode}Hh(b,g,c)}break;case 5:var h=b.stateNode;if(null===c&&b.flags&4){c=h;var k=b.memoizedProps;switch(b.type){case "button":case "input":case "select":case "textarea":k.autoFocus&& c.focus();break;case "img":k.src&&(c.src=k.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(null===b.memoizedState){var n=b.alternate;if(null!==n){var q=n.memoizedState;if(null!==q){var p=q.dehydrated;null!==p&&nc(p)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(m(163));}X||b.flags&512&&Lf(b)}catch(r){G(b,b.return,r)}}if(b===a){l=null;break}c=b.sibling;if(null!==c){c.return=b.return;l=c;break}l=b.return}}function Gi(a){for(;null!==l;){var b=l;if(b=== a){l=null;break}var c=b.sibling;if(null!==c){c.return=b.return;l=c;break}l=b.return}}function Ii(a){for(;null!==l;){var b=l;try{switch(b.tag){case 0:case 11:case 15:var c=b.return;try{Id(4,b)}catch(k){G(b,c,k)}break;case 1:var d=b.stateNode;if("function"===typeof d.componentDidMount){var e=b.return;try{d.componentDidMount()}catch(k){G(b,e,k)}}var f=b.return;try{Lf(b)}catch(k){G(b,f,k)}break;case 5:var g=b.return;try{Lf(b)}catch(k){G(b,g,k)}}}catch(k){G(b,b.return,k)}if(b===a){l=null;break}var h=b.sibling; if(null!==h){h.return=b.return;l=h;break}l=b.return}}function Hc(){Hf=P()+500}function Z(){return 0!==(p&6)?P():-1!==Kd?Kd:Kd=P()}function hb(a){if(0===(a.mode&1))return 1;if(0!==(p&2)&&0!==U)return U&-U;if(null!==Ik.transition)return 0===Ld&&(Ld=Dg()),Ld;a=z;if(0!==a)return a;a=window.event;a=void 0===a?16:Lg(a.type);return a}function xa(a,b,c,d){if(50<Ic)throw Ic=0,Pf=null,Error(m(185));ic(a,c,d);if(0===(p&2)||a!==O)a===O&&(0===(p&2)&&(Md|=c),4===L&&kb(a,U)),ia(a,d),1===c&&0===p&&0===(b.mode&1)&& (Hc(),md&&db())}function ia(a,b){var c=a.callbackNode;tj(a,b);var d=Vc(a,a===O?U:0);if(0===d)null!==c&&Ki(c),a.callbackNode=null,a.callbackPriority=0;else if(b=d&-d,a.callbackPriority!==b){null!=c&&Ki(c);if(1===b)0===a.tag?jk(Li.bind(null,a)):wh(Li.bind(null,a)),Jk(function(){0===(p&6)&&db()}),c=null;else{switch(Eg(d)){case 1:c=De;break;case 4:c=Mg;break;case 16:c=ad;break;case 536870912:c=Ng;break;default:c=ad}c=Mi(c,Ni.bind(null,a))}a.callbackPriority=b;a.callbackNode=c}}function Ni(a,b){Kd=-1; Ld=0;if(0!==(p&6))throw Error(m(327));var c=a.callbackNode;if(Xb()&&a.callbackNode!==c)return null;var d=Vc(a,a===O?U:0);if(0===d)return null;if(0!==(d&30)||0!==(d&a.expiredLanes)||b)b=Nd(a,d);else{b=d;var e=p;p|=2;var f=Oi();if(O!==a||U!==b)Ra=null,Hc(),wb(a,b);do try{Kk();break}catch(h){Pi(a,h)}while(1);af();Od.current=f;p=e;null!==H?b=0:(O=null,U=0,b=L)}if(0!==b){2===b&&(e=ve(a),0!==e&&(d=e,b=Qf(a,e)));if(1===b)throw c=Jc,wb(a,0),kb(a,d),ia(a,P()),c;if(6===b)kb(a,d);else{e=a.current.alternate; if(0===(d&30)&&!Lk(e)&&(b=Nd(a,d),2===b&&(f=ve(a),0!==f&&(d=f,b=Qf(a,f))),1===b))throw c=Jc,wb(a,0),kb(a,d),ia(a,P()),c;a.finishedWork=e;a.finishedLanes=d;switch(b){case 0:case 1:throw Error(m(345));case 2:xb(a,ja,Ra);break;case 3:kb(a,d);if((d&130023424)===d&&(b=Of+500-P(),10<b)){if(0!==Vc(a,0))break;e=a.suspendedLanes;if((e&d)!==d){Z();a.pingedLanes|=a.suspendedLanes&e;break}a.timeoutHandle=Rf(xb.bind(null,a,ja,Ra),b);break}xb(a,ja,Ra);break;case 4:kb(a,d);if((d&4194240)===d)break;b=a.eventTimes; for(e=-1;0<d;){var g=31-ta(d);f=1<<g;g=b[g];g>e&&(e=g);d&=~f}d=e;d=P()-d;d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3E3>d?3E3:4320>d?4320:1960*Mk(d/1960))-d;if(10<d){a.timeoutHandle=Rf(xb.bind(null,a,ja,Ra),d);break}xb(a,ja,Ra);break;case 5:xb(a,ja,Ra);break;default:throw Error(m(329));}}}ia(a,P());return a.callbackNode===c?Ni.bind(null,a):null}function Qf(a,b){var c=Kc;a.current.memoizedState.isDehydrated&&(wb(a,b).flags|=256);a=Nd(a,b);2!==a&&(b=ja,ja=c,null!==b&&Gf(b));return a}function Gf(a){null=== ja?ja=a:ja.push.apply(ja,a)}function Lk(a){for(var b=a;;){if(b.flags&16384){var c=b.updateQueue;if(null!==c&&(c=c.stores,null!==c))for(var d=0;d<c.length;d++){var e=c[d],f=e.getSnapshot;e=e.value;try{if(!ua(f(),e))return!1}catch(g){return!1}}}c=b.child;if(b.subtreeFlags&16384&&null!==c)c.return=b,b=c;else{if(b===a)break;for(;null===b.sibling;){if(null===b.return||b.return===a)return!0;b=b.return}b.sibling.return=b.return;b=b.sibling}}return!0}function kb(a,b){b&=~Sf;b&=~Md;a.suspendedLanes|=b;a.pingedLanes&= ~b;for(a=a.expirationTimes;0<b;){var c=31-ta(b),d=1<<c;a[c]=-1;b&=~d}}function Li(a){if(0!==(p&6))throw Error(m(327));Xb();var b=Vc(a,0);if(0===(b&1))return ia(a,P()),null;var c=Nd(a,b);if(0!==a.tag&&2===c){var d=ve(a);0!==d&&(b=d,c=Qf(a,d))}if(1===c)throw c=Jc,wb(a,0),kb(a,b),ia(a,P()),c;if(6===c)throw Error(m(345));a.finishedWork=a.current.alternate;a.finishedLanes=b;xb(a,ja,Ra);ia(a,P());return null}function Tf(a,b){var c=p;p|=1;try{return a(b)}finally{p=c,0===p&&(Hc(),md&&db())}}function yb(a){null!== lb&&0===lb.tag&&0===(p&6)&&Xb();var b=p;p|=1;var c=ca.transition,d=z;try{if(ca.transition=null,z=1,a)return a()}finally{z=d,ca.transition=c,p=b,0===(p&6)&&db()}}function wb(a,b){a.finishedWork=null;a.finishedLanes=0;var c=a.timeoutHandle;-1!==c&&(a.timeoutHandle=-1,Nk(c));if(null!==H)for(c=H.return;null!==c;){var d=c;Ve(d);switch(d.tag){case 1:d=d.type.childContextTypes;null!==d&&void 0!==d&&(v(S),v(J));break;case 3:Tb();v(S);v(J);jf();break;case 5:hf(d);break;case 4:Tb();break;case 13:v(F);break; case 19:v(F);break;case 10:cf(d.type._context);break;case 22:case 23:ba=Ga.current,v(Ga)}c=c.return}O=a;H=a=eb(a.current,null);U=ba=b;L=0;Jc=null;Sf=Md=ra=0;ja=Kc=null;if(null!==tb){for(b=0;b<tb.length;b++)if(c=tb[b],d=c.interleaved,null!==d){c.interleaved=null;var e=d.next,f=c.pending;if(null!==f){var g=f.next;f.next=e;d.next=g}c.pending=d}tb=null}return a}function Pi(a,b){do{var c=H;try{af();yd.current=zd;if(Ad){for(var d=C.memoizedState;null!==d;){var e=d.queue;null!==e&&(e.pending=null);d=d.next}Ad= !1}vb=0;N=K=C=null;zc=!1;Ac=0;Uf.current=null;if(null===c||null===c.return){L=1;Jc=b;H=null;break}a:{var f=a,g=c.return,h=c,k=b;b=U;h.flags|=32768;if(null!==k&&"object"===typeof k&&"function"===typeof k.then){var n=k,l=h,p=l.tag;if(0===(l.mode&1)&&(0===p||11===p||15===p)){var r=l.alternate;r?(l.updateQueue=r.updateQueue,l.memoizedState=r.memoizedState,l.lanes=r.lanes):(l.updateQueue=null,l.memoizedState=null)}var v=ji(g);if(null!==v){v.flags&=-257;ki(v,g,h,f,b);v.mode&1&&ii(f,n,b);b=v;k=n;var x=b.updateQueue; if(null===x){var z=new Set;z.add(k);b.updateQueue=z}else x.add(k);break a}else{if(0===(b&1)){ii(f,n,b);Ef();break a}k=Error(m(426))}}else if(D&&h.mode&1){var y=ji(g);if(null!==y){0===(y.flags&65536)&&(y.flags|=256);ki(y,g,h,f,b);Ye(Ub(k,h));break a}}f=k=Ub(k,h);4!==L&&(L=2);null===Kc?Kc=[f]:Kc.push(f);f=g;do{switch(f.tag){case 3:f.flags|=65536;b&=-b;f.lanes|=b;var w=gi(f,k,b);Gh(f,w);break a;case 1:h=k;var A=f.type,t=f.stateNode;if(0===(f.flags&128)&&("function"===typeof A.getDerivedStateFromError|| null!==t&&"function"===typeof t.componentDidCatch&&(null===ib||!ib.has(t)))){f.flags|=65536;b&=-b;f.lanes|=b;var B=hi(f,h,b);Gh(f,B);break a}}f=f.return}while(null!==f)}Qi(c)}catch(ma){b=ma;H===c&&null!==c&&(H=c=c.return);continue}break}while(1)}function Oi(){var a=Od.current;Od.current=zd;return null===a?zd:a}function Ef(){if(0===L||3===L||2===L)L=4;null===O||0===(ra&268435455)&&0===(Md&268435455)||kb(O,U)}function Nd(a,b){var c=p;p|=2;var d=Oi();if(O!==a||U!==b)Ra=null,wb(a,b);do try{Ok();break}catch(e){Pi(a, e)}while(1);af();p=c;Od.current=d;if(null!==H)throw Error(m(261));O=null;U=0;return L}function Ok(){for(;null!==H;)Ri(H)}function Kk(){for(;null!==H&&!Pk();)Ri(H)}function Ri(a){var b=Qk(a.alternate,a,ba);a.memoizedProps=a.pendingProps;null===b?Qi(a):H=b;Uf.current=null}function Qi(a){var b=a;do{var c=b.alternate;a=b.return;if(0===(b.flags&32768)){if(c=xk(c,b,ba),null!==c){H=c;return}}else{c=Bk(c,b);if(null!==c){c.flags&=32767;H=c;return}if(null!==a)a.flags|=32768,a.subtreeFlags=0,a.deletions=null; else{L=6;H=null;return}}b=b.sibling;if(null!==b){H=b;return}H=b=a}while(null!==b);0===L&&(L=5)}function xb(a,b,c){var d=z,e=ca.transition;try{ca.transition=null,z=1,Rk(a,b,c,d)}finally{ca.transition=e,z=d}return null}function Rk(a,b,c,d){do Xb();while(null!==lb);if(0!==(p&6))throw Error(m(327));c=a.finishedWork;var e=a.finishedLanes;if(null===c)return null;a.finishedWork=null;a.finishedLanes=0;if(c===a.current)throw Error(m(177));a.callbackNode=null;a.callbackPriority=0;var f=c.lanes|c.childLanes; uj(a,f);a===O&&(H=O=null,U=0);0===(c.subtreeFlags&2064)&&0===(c.flags&2064)||Pd||(Pd=!0,Mi(ad,function(){Xb();return null}));f=0!==(c.flags&15990);if(0!==(c.subtreeFlags&15990)||f){f=ca.transition;ca.transition=null;var g=z;z=1;var h=p;p|=4;Uf.current=null;Ck(a,c);Fi(c,a);Tj(Kf);Zc=!!Jf;Kf=Jf=null;a.current=c;Hk(c,a,e);Sk();p=h;z=g;ca.transition=f}else a.current=c;Pd&&(Pd=!1,lb=a,Qd=e);f=a.pendingLanes;0===f&&(ib=null);oj(c.stateNode,d);ia(a,P());if(null!==b)for(d=a.onRecoverableError,c=0;c<b.length;c++)e= b[c],d(e.value,{componentStack:e.stack,digest:e.digest});if(Ed)throw Ed=!1,a=xf,xf=null,a;0!==(Qd&1)&&0!==a.tag&&Xb();f=a.pendingLanes;0!==(f&1)?a===Pf?Ic++:(Ic=0,Pf=a):Ic=0;db();return null}function Xb(){if(null!==lb){var a=Eg(Qd),b=ca.transition,c=z;try{ca.transition=null;z=16>a?16:a;if(null===lb)var d=!1;else{a=lb;lb=null;Qd=0;if(0!==(p&6))throw Error(m(331));var e=p;p|=4;for(l=a.current;null!==l;){var f=l,g=f.child;if(0!==(l.flags&16)){var h=f.deletions;if(null!==h){for(var k=0;k<h.length;k++){var n= h[k];for(l=n;null!==l;){var q=l;switch(q.tag){case 0:case 11:case 15:Gc(8,q,f)}var u=q.child;if(null!==u)u.return=q,l=u;else for(;null!==l;){q=l;var r=q.sibling,v=q.return;Ai(q);if(q===n){l=null;break}if(null!==r){r.return=v;l=r;break}l=v}}}var x=f.alternate;if(null!==x){var y=x.child;if(null!==y){x.child=null;do{var C=y.sibling;y.sibling=null;y=C}while(null!==y)}}l=f}}if(0!==(f.subtreeFlags&2064)&&null!==g)g.return=f,l=g;else b:for(;null!==l;){f=l;if(0!==(f.flags&2048))switch(f.tag){case 0:case 11:case 15:Gc(9, f,f.return)}var w=f.sibling;if(null!==w){w.return=f.return;l=w;break b}l=f.return}}var A=a.current;for(l=A;null!==l;){g=l;var t=g.child;if(0!==(g.subtreeFlags&2064)&&null!==t)t.return=g,l=t;else b:for(g=A;null!==l;){h=l;if(0!==(h.flags&2048))try{switch(h.tag){case 0:case 11:case 15:Id(9,h)}}catch(ma){G(h,h.return,ma)}if(h===g){l=null;break b}var B=h.sibling;if(null!==B){B.return=h.return;l=B;break b}l=h.return}}p=e;db();if(Ca&&"function"===typeof Ca.onPostCommitFiberRoot)try{Ca.onPostCommitFiberRoot(Uc, a)}catch(ma){}d=!0}return d}finally{z=c,ca.transition=b}}return!1}function Si(a,b,c){b=Ub(c,b);b=gi(a,b,1);a=fb(a,b,1);b=Z();null!==a&&(ic(a,1,b),ia(a,b))}function G(a,b,c){if(3===a.tag)Si(a,a,c);else for(;null!==b;){if(3===b.tag){Si(b,a,c);break}else if(1===b.tag){var d=b.stateNode;if("function"===typeof b.type.getDerivedStateFromError||"function"===typeof d.componentDidCatch&&(null===ib||!ib.has(d))){a=Ub(c,a);a=hi(b,a,1);b=fb(b,a,1);a=Z();null!==b&&(ic(b,1,a),ia(b,a));break}}b=b.return}}function sk(a, b,c){var d=a.pingCache;null!==d&&d.delete(b);b=Z();a.pingedLanes|=a.suspendedLanes&c;O===a&&(U&c)===c&&(4===L||3===L&&(U&130023424)===U&&500>P()-Of?wb(a,0):Sf|=c);ia(a,b)}function Ti(a,b){0===b&&(0===(a.mode&1)?b=1:(b=Rd,Rd<<=1,0===(Rd&130023424)&&(Rd=4194304)));var c=Z();a=Oa(a,b);null!==a&&(ic(a,b,c),ia(a,c))}function vk(a){var b=a.memoizedState,c=0;null!==b&&(c=b.retryLane);Ti(a,c)}function Gk(a,b){var c=0;switch(a.tag){case 13:var d=a.stateNode;var e=a.memoizedState;null!==e&&(c=e.retryLane); break;case 19:d=a.stateNode;break;default:throw Error(m(314));}null!==d&&d.delete(b);Ti(a,c)}function Mi(a,b){return xh(a,b)}function Tk(a,b,c,d){this.tag=a;this.key=c;this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null;this.index=0;this.ref=null;this.pendingProps=b;this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null;this.mode=d;this.subtreeFlags=this.flags=0;this.deletions=null;this.childLanes=this.lanes=0;this.alternate=null}function yf(a){a= a.prototype;return!(!a||!a.isReactComponent)}function Uk(a){if("function"===typeof a)return yf(a)?1:0;if(void 0!==a&&null!==a){a=a.$$typeof;if(a===ie)return 11;if(a===je)return 14}return 2}function eb(a,b){var c=a.alternate;null===c?(c=pa(a.tag,b,a.key,a.mode),c.elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=b,c.type=a.type,c.flags=0,c.subtreeFlags=0,c.deletions=null);c.flags=a.flags&14680064;c.childLanes=a.childLanes;c.lanes=a.lanes;c.child= a.child;c.memoizedProps=a.memoizedProps;c.memoizedState=a.memoizedState;c.updateQueue=a.updateQueue;b=a.dependencies;c.dependencies=null===b?null:{lanes:b.lanes,firstContext:b.firstContext};c.sibling=a.sibling;c.index=a.index;c.ref=a.ref;return c}function rd(a,b,c,d,e,f){var g=2;d=a;if("function"===typeof a)yf(a)&&(g=1);else if("string"===typeof a)g=5;else a:switch(a){case Bb:return sb(c.children,e,f,b);case fe:g=8;e|=8;break;case ee:return a=pa(12,c,b,e|2),a.elementType=ee,a.lanes=f,a;case ge:return a= pa(13,c,b,e),a.elementType=ge,a.lanes=f,a;case he:return a=pa(19,c,b,e),a.elementType=he,a.lanes=f,a;case Ui:return Gd(c,e,f,b);default:if("object"===typeof a&&null!==a)switch(a.$$typeof){case hg:g=10;break a;case gg:g=9;break a;case ie:g=11;break a;case je:g=14;break a;case Ta:g=16;d=null;break a}throw Error(m(130,null==a?a:typeof a,""));}b=pa(g,c,b,e);b.elementType=a;b.type=d;b.lanes=f;return b}function sb(a,b,c,d){a=pa(7,a,d,b);a.lanes=c;return a}function Gd(a,b,c,d){a=pa(22,a,d,b);a.elementType= Ui;a.lanes=c;a.stateNode={isHidden:!1};return a}function Ze(a,b,c){a=pa(6,a,null,b);a.lanes=c;return a}function $e(a,b,c){b=pa(4,null!==a.children?a.children:[],a.key,b);b.lanes=c;b.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation};return b}function Vk(a,b,c,d,e){this.tag=b;this.containerInfo=a;this.finishedWork=this.pingCache=this.current=this.pendingChildren=null;this.timeoutHandle=-1;this.callbackNode=this.pendingContext=this.context=null;this.callbackPriority= 0;this.eventTimes=we(0);this.expirationTimes=we(-1);this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0;this.entanglements=we(0);this.identifierPrefix=d;this.onRecoverableError=e;this.mutableSourceEagerHydrationData=null}function Vf(a,b,c,d,e,f,g,h,k,l){a=new Vk(a,b,c,h,k);1===b?(b=1,!0===f&&(b|=8)):b=0;f=pa(3,null,null,b);a.current=f;f.stateNode=a;f.memoizedState={element:d,isDehydrated:c,cache:null,transitions:null, pendingSuspenseBoundaries:null};ff(f);return a}function Wk(a,b,c){var d=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:Cb,key:null==d?null:""+d,children:a,containerInfo:b,implementation:c}}function Vi(a){if(!a)return cb;a=a._reactInternals;a:{if(nb(a)!==a||1!==a.tag)throw Error(m(170));var b=a;do{switch(b.tag){case 3:b=b.stateNode.context;break a;case 1:if(ea(b.type)){b=b.stateNode.__reactInternalMemoizedMergedChildContext;break a}}b=b.return}while(null!==b);throw Error(m(171)); }if(1===a.tag){var c=a.type;if(ea(c))return uh(a,c,b)}return b}function Wi(a,b,c,d,e,f,g,h,k,l){a=Vf(c,d,!0,a,e,f,g,h,k);a.context=Vi(null);c=a.current;d=Z();e=hb(c);f=Pa(d,e);f.callback=void 0!==b&&null!==b?b:null;fb(c,f,e);a.current.lanes=e;ic(a,e,d);ia(a,d);return a}function Sd(a,b,c,d){var e=b.current,f=Z(),g=hb(e);c=Vi(c);null===b.context?b.context=c:b.pendingContext=c;b=Pa(f,g);b.payload={element:a};d=void 0===d?null:d;null!==d&&(b.callback=d);a=fb(e,b,g);null!==a&&(xa(a,e,g,f),vd(a,e,g));return g} function Td(a){a=a.current;if(!a.child)return null;switch(a.child.tag){case 5:return a.child.stateNode;default:return a.child.stateNode}}function Xi(a,b){a=a.memoizedState;if(null!==a&&null!==a.dehydrated){var c=a.retryLane;a.retryLane=0!==c&&c<b?c:b}}function Wf(a,b){Xi(a,b);(a=a.alternate)&&Xi(a,b)}function Xk(a){a=Bg(a);return null===a?null:a.stateNode}function Yk(a){return null}function Xf(a){this._internalRoot=a}function Ud(a){this._internalRoot=a}function Yf(a){return!(!a||1!==a.nodeType&&9!== a.nodeType&&11!==a.nodeType)}function Vd(a){return!(!a||1!==a.nodeType&&9!==a.nodeType&&11!==a.nodeType&&(8!==a.nodeType||" react-mount-point-unstable "!==a.nodeValue))}function Yi(){}function Zk(a,b,c,d,e){if(e){if("function"===typeof d){var f=d;d=function(){var a=Td(g);f.call(a)}}var g=Wi(b,d,a,0,null,!1,!1,"",Yi);a._reactRootContainer=g;a[Ja]=g.current;sc(8===a.nodeType?a.parentNode:a);yb();return g}for(;e=a.lastChild;)a.removeChild(e);if("function"===typeof d){var h=d;d=function(){var a=Td(k); h.call(a)}}var k=Vf(a,0,!1,null,null,!1,!1,"",Yi);a._reactRootContainer=k;a[Ja]=k.current;sc(8===a.nodeType?a.parentNode:a);yb(function(){Sd(b,k,c,d)});return k}function Wd(a,b,c,d,e){var f=c._reactRootContainer;if(f){var g=f;if("function"===typeof e){var h=e;e=function(){var a=Td(g);h.call(a)}}Sd(b,g,a,e)}else g=Zk(c,b,a,e,d);return Td(g)}var cg=new Set,$b={},Ia=!("undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement),Zd=Object.prototype.hasOwnProperty, cj=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,eg={},dg={},R={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){R[a]= new Y(a,0,!1,a,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var b=a[0];R[b]=new Y(b,1,!1,a[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(a){R[a]=new Y(a,2,!1,a.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){R[a]=new Y(a,2,!1,a,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a){R[a]= new Y(a,3,!1,a.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(a){R[a]=new Y(a,3,!0,a,null,!1,!1)});["capture","download"].forEach(function(a){R[a]=new Y(a,4,!1,a,null,!1,!1)});["cols","rows","size","span"].forEach(function(a){R[a]=new Y(a,6,!1,a,null,!1,!1)});["rowSpan","start"].forEach(function(a){R[a]=new Y(a,5,!1,a.toLowerCase(),null,!1,!1)});var Zf=/[\-:]([a-z])/g,$f=function(a){return a[1].toUpperCase()};"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(a){var b= a.replace(Zf,$f);R[b]=new Y(b,1,!1,a,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var b=a.replace(Zf,$f);R[b]=new Y(b,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(a){var b=a.replace(Zf,$f);R[b]=new Y(b,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(a){R[a]=new Y(a,1,!1,a.toLowerCase(),null,!1,!1)});R.xlinkHref=new Y("xlinkHref", 1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(a){R[a]=new Y(a,1,!1,a.toLowerCase(),null,!0,!0)});var Sa=zb.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,sd=Symbol.for("react.element"),Cb=Symbol.for("react.portal"),Bb=Symbol.for("react.fragment"),fe=Symbol.for("react.strict_mode"),ee=Symbol.for("react.profiler"),hg=Symbol.for("react.provider"),gg=Symbol.for("react.context"),ie=Symbol.for("react.forward_ref"),ge=Symbol.for("react.suspense"), he=Symbol.for("react.suspense_list"),je=Symbol.for("react.memo"),Ta=Symbol.for("react.lazy");Symbol.for("react.scope");Symbol.for("react.debug_trace_mode");var Ui=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden");Symbol.for("react.cache");Symbol.for("react.tracing_marker");var fg=Symbol.iterator,E=Object.assign,ae,ce=!1,cc=Array.isArray,Xd,yi=function(a){return"undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(b,c,d,e){MSApp.execUnsafeLocalFunction(function(){return a(b, c,d,e)})}:a}(function(a,b){if("http://www.w3.org/2000/svg"!==a.namespaceURI||"innerHTML"in a)a.innerHTML=b;else{Xd=Xd||document.createElement("div");Xd.innerHTML="<svg>"+b.valueOf().toString()+"</svg>";for(b=Xd.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;b.firstChild;)a.appendChild(b.firstChild)}}),Fc=function(a,b){if(b){var c=a.firstChild;if(c&&c===a.lastChild&&3===c.nodeType){c.nodeValue=b;return}}a.textContent=b},dc={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0, borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0, strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},$k=["Webkit","ms","Moz","O"];Object.keys(dc).forEach(function(a){$k.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);dc[b]=dc[a]})});var ij=E({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}),ze=null,se=null,Eb=null,Fb=null,xg=function(a,b){return a(b)},yg=function(){},te=!1,Oe=!1;if(Ia)try{var Lc={};Object.defineProperty(Lc, "passive",{get:function(){Oe=!0}});window.addEventListener("test",Lc,Lc);window.removeEventListener("test",Lc,Lc)}catch(a){Oe=!1}var kj=function(a,b,c,d,e,f,g,h,k){var l=Array.prototype.slice.call(arguments,3);try{b.apply(c,l)}catch(q){this.onError(q)}},gc=!1,Sc=null,Tc=!1,ue=null,lj={onError:function(a){gc=!0;Sc=a}},Ba=zb.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler,Jg=Ba.unstable_scheduleCallback,Kg=Ba.unstable_NormalPriority,xh=Jg,Ki=Ba.unstable_cancelCallback,Pk=Ba.unstable_shouldYield, Sk=Ba.unstable_requestPaint,P=Ba.unstable_now,Dj=Ba.unstable_getCurrentPriorityLevel,De=Ba.unstable_ImmediatePriority,Mg=Ba.unstable_UserBlockingPriority,ad=Kg,Ej=Ba.unstable_LowPriority,Ng=Ba.unstable_IdlePriority,Uc=null,Ca=null,ta=Math.clz32?Math.clz32:pj,qj=Math.log,rj=Math.LN2,Wc=64,Rd=4194304,z=0,Ae=!1,Yc=[],Va=null,Wa=null,Xa=null,jc=new Map,kc=new Map,Ya=[],Bj="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" "), Gb=Sa.ReactCurrentBatchConfig,Zc=!0,$c=null,Za=null,Ee=null,bd=null,Yb={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},He=ka(Yb),Mc=E({},Yb,{view:0,detail:0}),ak=ka(Mc),ag,bg,Nc,Yd=E({},Mc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Fe,button:0,buttons:0,relatedTarget:function(a){return void 0===a.relatedTarget?a.fromElement===a.srcElement?a.toElement:a.fromElement: a.relatedTarget},movementX:function(a){if("movementX"in a)return a.movementX;a!==Nc&&(Nc&&"mousemove"===a.type?(ag=a.screenX-Nc.screenX,bg=a.screenY-Nc.screenY):bg=ag=0,Nc=a);return ag},movementY:function(a){return"movementY"in a?a.movementY:bg}}),ih=ka(Yd),al=E({},Yd,{dataTransfer:0}),Wj=ka(al),bl=E({},Mc,{relatedTarget:0}),Pe=ka(bl),cl=E({},Yb,{animationName:0,elapsedTime:0,pseudoElement:0}),Yj=ka(cl),dl=E({},Yb,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}), ck=ka(dl),el=E({},Yb,{data:0}),qh=ka(el),fk=qh,fl={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},gl={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete", 112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Gj={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"},hl=E({},Mc,{key:function(a){if(a.key){var b=fl[a.key]||a.key;if("Unidentified"!==b)return b}return"keypress"===a.type?(a=cd(a),13===a?"Enter":String.fromCharCode(a)):"keydown"===a.type||"keyup"===a.type?gl[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0, metaKey:0,repeat:0,locale:0,getModifierState:Fe,charCode:function(a){return"keypress"===a.type?cd(a):0},keyCode:function(a){return"keydown"===a.type||"keyup"===a.type?a.keyCode:0},which:function(a){return"keypress"===a.type?cd(a):"keydown"===a.type||"keyup"===a.type?a.keyCode:0}}),Vj=ka(hl),il=E({},Yd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),nh=ka(il),jl=E({},Mc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0, ctrlKey:0,shiftKey:0,getModifierState:Fe}),Xj=ka(jl),kl=E({},Yb,{propertyName:0,elapsedTime:0,pseudoElement:0}),Zj=ka(kl),ll=E({},Yd,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),bk=ka(ll),Hj=[9,13,27,32],Ge=Ia&&"CompositionEvent"in window,Oc=null;Ia&&"documentMode"in document&&(Oc=document.documentMode);var ek=Ia&&"TextEvent"in window&&!Oc,Ug=Ia&&(!Ge||Oc&&8<Oc&&11>=Oc),Tg=String.fromCharCode(32),Sg=!1,Hb=!1,Kj={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0},oc=null,pc=null,ph=!1;Ia&&(ph=Lj("input")&&(!document.documentMode||9<document.documentMode));var ua="function"===typeof Object.is?Object.is:Sj,dk=Ia&&"documentMode"in document&&11>=document.documentMode,Jb=null,Ke=null,rc=null,Je=!1,Kb={animationend:gd("Animation","AnimationEnd"), animationiteration:gd("Animation","AnimationIteration"),animationstart:gd("Animation","AnimationStart"),transitionend:gd("Transition","TransitionEnd")},Le={},eh={};Ia&&(eh=document.createElement("div").style,"AnimationEvent"in window||(delete Kb.animationend.animation,delete Kb.animationiteration.animation,delete Kb.animationstart.animation),"TransitionEvent"in window||delete Kb.transitionend.transition);var jh=hd("animationend"),kh=hd("animationiteration"),lh=hd("animationstart"),mh=hd("transitionend"), fh=new Map,Zi="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" "); (function(){for(var a=0;a<Zi.length;a++){var b=Zi[a],c=b.toLowerCase();b=b[0].toUpperCase()+b.slice(1);$a(c,"on"+b)}$a(jh,"onAnimationEnd");$a(kh,"onAnimationIteration");$a(lh,"onAnimationStart");$a("dblclick","onDoubleClick");$a("focusin","onFocus");$a("focusout","onBlur");$a(mh,"onTransitionEnd")})();Ab("onMouseEnter",["mouseout","mouseover"]);Ab("onMouseLeave",["mouseout","mouseover"]);Ab("onPointerEnter",["pointerout","pointerover"]);Ab("onPointerLeave",["pointerout","pointerover"]);mb("onChange", "change click focusin focusout input keydown keyup selectionchange".split(" "));mb("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));mb("onBeforeInput",["compositionend","keypress","textInput","paste"]);mb("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));mb("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));mb("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" ")); var Ec="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Uj=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ec)),id="_reactListening"+Math.random().toString(36).slice(2),gk=/\r\n?/g,hk=/\u0000|\uFFFD/g,Jf=null,Kf=null,Rf="function"===typeof setTimeout?setTimeout:void 0,Nk="function"===typeof clearTimeout? clearTimeout:void 0,$i="function"===typeof Promise?Promise:void 0,Jk="function"===typeof queueMicrotask?queueMicrotask:"undefined"!==typeof $i?function(a){return $i.resolve(null).then(a).catch(ik)}:Rf,Zb=Math.random().toString(36).slice(2),Da="__reactFiber$"+Zb,uc="__reactProps$"+Zb,Ja="__reactContainer$"+Zb,Me="__reactEvents$"+Zb,Dk="__reactListeners$"+Zb,Ek="__reactHandles$"+Zb,Se=[],Mb=-1,cb={},J=bb(cb),S=bb(!1),pb=cb,La=null,md=!1,Te=!1,Ob=[],Pb=0,od=null,nd=0,na=[],oa=0,rb=null,Ma=1,Na="",la= null,fa=null,D=!1,wa=null,Ik=Sa.ReactCurrentBatchConfig,Vb=Dh(!0),li=Dh(!1),ud=bb(null),td=null,Rb=null,bf=null,tb=null,kk=Oa,gb=!1,wc={},Ea=bb(wc),yc=bb(wc),xc=bb(wc),F=bb(0),kf=[],yd=Sa.ReactCurrentDispatcher,sf=Sa.ReactCurrentBatchConfig,vb=0,C=null,K=null,N=null,Ad=!1,zc=!1,Ac=0,ml=0,zd={readContext:qa,useCallback:V,useContext:V,useEffect:V,useImperativeHandle:V,useInsertionEffect:V,useLayoutEffect:V,useMemo:V,useReducer:V,useRef:V,useState:V,useDebugValue:V,useDeferredValue:V,useTransition:V, useMutableSource:V,useSyncExternalStore:V,useId:V,unstable_isNewReconciler:!1},lk={readContext:qa,useCallback:function(a,b){Fa().memoizedState=[a,void 0===b?null:b];return a},useContext:qa,useEffect:Sh,useImperativeHandle:function(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return Bd(4194308,4,Vh.bind(null,b,a),c)},useLayoutEffect:function(a,b){return Bd(4194308,4,a,b)},useInsertionEffect:function(a,b){return Bd(4,2,a,b)},useMemo:function(a,b){var c=Fa();b=void 0===b?null:b;a=a();c.memoizedState= [a,b];return a},useReducer:function(a,b,c){var d=Fa();b=void 0!==c?c(b):b;d.memoizedState=d.baseState=b;a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:b};d.queue=a;a=a.dispatch=qk.bind(null,C,a);return[d.memoizedState,a]},useRef:function(a){var b=Fa();a={current:a};return b.memoizedState=a},useState:Qh,useDebugValue:rf,useDeferredValue:function(a){return Fa().memoizedState=a},useTransition:function(){var a=Qh(!1),b=a[0];a=pk.bind(null,a[1]);Fa().memoizedState= a;return[b,a]},useMutableSource:function(a,b,c){},useSyncExternalStore:function(a,b,c){var d=C,e=Fa();if(D){if(void 0===c)throw Error(m(407));c=c()}else{c=b();if(null===O)throw Error(m(349));0!==(vb&30)||Nh(d,b,c)}e.memoizedState=c;var f={value:c,getSnapshot:b};e.queue=f;Sh(Lh.bind(null,d,f,a),[a]);d.flags|=2048;Cc(9,Mh.bind(null,d,f,c,b),void 0,null);return c},useId:function(){var a=Fa(),b=O.identifierPrefix;if(D){var c=Na;var d=Ma;c=(d&~(1<<32-ta(d)-1)).toString(32)+c;b=":"+b+"R"+c;c=Ac++;0<c&& (b+="H"+c.toString(32));b+=":"}else c=ml++,b=":"+b+"r"+c.toString(32)+":";return a.memoizedState=b},unstable_isNewReconciler:!1},mk={readContext:qa,useCallback:Xh,useContext:qa,useEffect:qf,useImperativeHandle:Wh,useInsertionEffect:Th,useLayoutEffect:Uh,useMemo:Yh,useReducer:of,useRef:Rh,useState:function(a){return of(Bc)},useDebugValue:rf,useDeferredValue:function(a){var b=sa();return Zh(b,K.memoizedState,a)},useTransition:function(){var a=of(Bc)[0],b=sa().memoizedState;return[a,b]},useMutableSource:Jh, useSyncExternalStore:Kh,useId:$h,unstable_isNewReconciler:!1},nk={readContext:qa,useCallback:Xh,useContext:qa,useEffect:qf,useImperativeHandle:Wh,useInsertionEffect:Th,useLayoutEffect:Uh,useMemo:Yh,useReducer:pf,useRef:Rh,useState:function(a){return pf(Bc)},useDebugValue:rf,useDeferredValue:function(a){var b=sa();return null===K?b.memoizedState=a:Zh(b,K.memoizedState,a)},useTransition:function(){var a=pf(Bc)[0],b=sa().memoizedState;return[a,b]},useMutableSource:Jh,useSyncExternalStore:Kh,useId:$h, unstable_isNewReconciler:!1},Dd={isMounted:function(a){return(a=a._reactInternals)?nb(a)===a:!1},enqueueSetState:function(a,b,c){a=a._reactInternals;var d=Z(),e=hb(a),f=Pa(d,e);f.payload=b;void 0!==c&&null!==c&&(f.callback=c);b=fb(a,f,e);null!==b&&(xa(b,a,e,d),vd(b,a,e))},enqueueReplaceState:function(a,b,c){a=a._reactInternals;var d=Z(),e=hb(a),f=Pa(d,e);f.tag=1;f.payload=b;void 0!==c&&null!==c&&(f.callback=c);b=fb(a,f,e);null!==b&&(xa(b,a,e,d),vd(b,a,e))},enqueueForceUpdate:function(a,b){a=a._reactInternals; var c=Z(),d=hb(a),e=Pa(c,d);e.tag=2;void 0!==b&&null!==b&&(e.callback=b);b=fb(a,e,d);null!==b&&(xa(b,a,d,c),vd(b,a,d))}},rk="function"===typeof WeakMap?WeakMap:Map,tk=Sa.ReactCurrentOwner,ha=!1,Cf={dehydrated:null,treeContext:null,retryLane:0};var zk=function(a,b,c,d){for(c=b.child;null!==c;){if(5===c.tag||6===c.tag)a.appendChild(c.stateNode);else if(4!==c.tag&&null!==c.child){c.child.return=c;c=c.child;continue}if(c===b)break;for(;null===c.sibling;){if(null===c.return||c.return===b)return;c=c.return}c.sibling.return= c.return;c=c.sibling}};var xi=function(a,b){};var yk=function(a,b,c,d,e){var f=a.memoizedProps;if(f!==d){a=b.stateNode;ub(Ea.current);e=null;switch(c){case "input":f=ke(a,f);d=ke(a,d);e=[];break;case "select":f=E({},f,{value:void 0});d=E({},d,{value:void 0});e=[];break;case "textarea":f=ne(a,f);d=ne(a,d);e=[];break;default:"function"!==typeof f.onClick&&"function"===typeof d.onClick&&(a.onclick=kd)}pe(c,d);var g;c=null;for(l in f)if(!d.hasOwnProperty(l)&&f.hasOwnProperty(l)&&null!=f[l])if("style"=== l){var h=f[l];for(g in h)h.hasOwnProperty(g)&&(c||(c={}),c[g]="")}else"dangerouslySetInnerHTML"!==l&&"children"!==l&&"suppressContentEditableWarning"!==l&&"suppressHydrationWarning"!==l&&"autoFocus"!==l&&($b.hasOwnProperty(l)?e||(e=[]):(e=e||[]).push(l,null));for(l in d){var k=d[l];h=null!=f?f[l]:void 0;if(d.hasOwnProperty(l)&&k!==h&&(null!=k||null!=h))if("style"===l)if(h){for(g in h)!h.hasOwnProperty(g)||k&&k.hasOwnProperty(g)||(c||(c={}),c[g]="");for(g in k)k.hasOwnProperty(g)&&h[g]!==k[g]&&(c|| (c={}),c[g]=k[g])}else c||(e||(e=[]),e.push(l,c)),c=k;else"dangerouslySetInnerHTML"===l?(k=k?k.__html:void 0,h=h?h.__html:void 0,null!=k&&h!==k&&(e=e||[]).push(l,k)):"children"===l?"string"!==typeof k&&"number"!==typeof k||(e=e||[]).push(l,""+k):"suppressContentEditableWarning"!==l&&"suppressHydrationWarning"!==l&&($b.hasOwnProperty(l)?(null!=k&&"onScroll"===l&&B("scroll",a),e||h===k||(e=[])):(e=e||[]).push(l,k))}c&&(e=e||[]).push("style",c);var l=e;if(b.updateQueue=l)b.flags|=4}};var Ak=function(a, b,c,d){c!==d&&(b.flags|=4)};var Jd=!1,X=!1,Fk="function"===typeof WeakSet?WeakSet:Set,l=null,zi=!1,T=null,za=!1,Mk=Math.ceil,Od=Sa.ReactCurrentDispatcher,Uf=Sa.ReactCurrentOwner,ca=Sa.ReactCurrentBatchConfig,p=0,O=null,H=null,U=0,ba=0,Ga=bb(0),L=0,Jc=null,ra=0,Md=0,Sf=0,Kc=null,ja=null,Of=0,Hf=Infinity,Ra=null,Ed=!1,xf=null,ib=null,Pd=!1,lb=null,Qd=0,Ic=0,Pf=null,Kd=-1,Ld=0;var Qk=function(a,b,c){if(null!==a)if(a.memoizedProps!==b.pendingProps||S.current)ha=!0;else{if(0===(a.lanes&c)&&0===(b.flags& 128))return ha=!1,wk(a,b,c);ha=0!==(a.flags&131072)?!0:!1}else ha=!1,D&&0!==(b.flags&1048576)&&yh(b,nd,b.index);b.lanes=0;switch(b.tag){case 2:var d=b.type;Fd(a,b);a=b.pendingProps;var e=Nb(b,J.current);Sb(b,c);e=mf(null,b,d,a,e,c);var f=nf();b.flags|=1;"object"===typeof e&&null!==e&&"function"===typeof e.render&&void 0===e.$$typeof?(b.tag=1,b.memoizedState=null,b.updateQueue=null,ea(d)?(f=!0,ld(b)):f=!1,b.memoizedState=null!==e.state&&void 0!==e.state?e.state:null,ff(b),e.updater=Dd,b.stateNode= e,e._reactInternals=b,uf(b,d,a,c),b=Af(null,b,d,!0,f,c)):(b.tag=0,D&&f&&Ue(b),aa(null,b,e,c),b=b.child);return b;case 16:d=b.elementType;a:{Fd(a,b);a=b.pendingProps;e=d._init;d=e(d._payload);b.type=d;e=b.tag=Uk(d);a=ya(d,a);switch(e){case 0:b=zf(null,b,d,a,c);break a;case 1:b=ri(null,b,d,a,c);break a;case 11:b=mi(null,b,d,a,c);break a;case 14:b=ni(null,b,d,ya(d.type,a),c);break a}throw Error(m(306,d,""));}return b;case 0:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:ya(d,e),zf(a,b,d,e,c); case 1:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:ya(d,e),ri(a,b,d,e,c);case 3:a:{si(b);if(null===a)throw Error(m(387));d=b.pendingProps;f=b.memoizedState;e=f.element;Fh(a,b);wd(b,d,null,c);var g=b.memoizedState;d=g.element;if(f.isDehydrated)if(f={element:d,isDehydrated:!1,cache:g.cache,pendingSuspenseBoundaries:g.pendingSuspenseBoundaries,transitions:g.transitions},b.updateQueue.baseState=f,b.memoizedState=f,b.flags&256){e=Ub(Error(m(423)),b);b=ti(a,b,d,c,e);break a}else if(d!==e){e= Ub(Error(m(424)),b);b=ti(a,b,d,c,e);break a}else for(fa=Ka(b.stateNode.containerInfo.firstChild),la=b,D=!0,wa=null,c=li(b,null,d,c),b.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{Qb();if(d===e){b=Qa(a,b,c);break a}aa(a,b,d,c)}b=b.child}return b;case 5:return Ih(b),null===a&&Xe(b),d=b.type,e=b.pendingProps,f=null!==a?a.memoizedProps:null,g=e.children,Qe(d,e)?g=null:null!==f&&Qe(d,f)&&(b.flags|=32),qi(a,b),aa(a,b,g,c),b.child;case 6:return null===a&&Xe(b),null;case 13:return ui(a,b,c);case 4:return gf(b, b.stateNode.containerInfo),d=b.pendingProps,null===a?b.child=Vb(b,null,d,c):aa(a,b,d,c),b.child;case 11:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:ya(d,e),mi(a,b,d,e,c);case 7:return aa(a,b,b.pendingProps,c),b.child;case 8:return aa(a,b,b.pendingProps.children,c),b.child;case 12:return aa(a,b,b.pendingProps.children,c),b.child;case 10:a:{d=b.type._context;e=b.pendingProps;f=b.memoizedProps;g=e.value;y(ud,d._currentValue);d._currentValue=g;if(null!==f)if(ua(f.value,g)){if(f.children=== e.children&&!S.current){b=Qa(a,b,c);break a}}else for(f=b.child,null!==f&&(f.return=b);null!==f;){var h=f.dependencies;if(null!==h){g=f.child;for(var k=h.firstContext;null!==k;){if(k.context===d){if(1===f.tag){k=Pa(-1,c&-c);k.tag=2;var l=f.updateQueue;if(null!==l){l=l.shared;var p=l.pending;null===p?k.next=k:(k.next=p.next,p.next=k);l.pending=k}}f.lanes|=c;k=f.alternate;null!==k&&(k.lanes|=c);df(f.return,c,b);h.lanes|=c;break}k=k.next}}else if(10===f.tag)g=f.type===b.type?null:f.child;else if(18=== f.tag){g=f.return;if(null===g)throw Error(m(341));g.lanes|=c;h=g.alternate;null!==h&&(h.lanes|=c);df(g,c,b);g=f.sibling}else g=f.child;if(null!==g)g.return=f;else for(g=f;null!==g;){if(g===b){g=null;break}f=g.sibling;if(null!==f){f.return=g.return;g=f;break}g=g.return}f=g}aa(a,b,e.children,c);b=b.child}return b;case 9:return e=b.type,d=b.pendingProps.children,Sb(b,c),e=qa(e),d=d(e),b.flags|=1,aa(a,b,d,c),b.child;case 14:return d=b.type,e=ya(d,b.pendingProps),e=ya(d.type,e),ni(a,b,d,e,c);case 15:return oi(a, b,b.type,b.pendingProps,c);case 17:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:ya(d,e),Fd(a,b),b.tag=1,ea(d)?(a=!0,ld(b)):a=!1,Sb(b,c),ei(b,d,e),uf(b,d,e,c),Af(null,b,d,!0,a,c);case 19:return wi(a,b,c);case 22:return pi(a,b,c)}throw Error(m(156,b.tag));};var pa=function(a,b,c,d){return new Tk(a,b,c,d)},aj="function"===typeof reportError?reportError:function(a){console.error(a)};Ud.prototype.render=Xf.prototype.render=function(a){var b=this._internalRoot;if(null===b)throw Error(m(409)); Sd(a,b,null,null)};Ud.prototype.unmount=Xf.prototype.unmount=function(){var a=this._internalRoot;if(null!==a){this._internalRoot=null;var b=a.containerInfo;yb(function(){Sd(null,a,null,null)});b[Ja]=null}};Ud.prototype.unstable_scheduleHydration=function(a){if(a){var b=nl();a={blockedOn:null,target:a,priority:b};for(var c=0;c<Ya.length&&0!==b&&b<Ya[c].priority;c++);Ya.splice(c,0,a);0===c&&Hg(a)}};var Cj=function(a){switch(a.tag){case 3:var b=a.stateNode;if(b.current.memoizedState.isDehydrated){var c= hc(b.pendingLanes);0!==c&&(xe(b,c|1),ia(b,P()),0===(p&6)&&(Hc(),db()))}break;case 13:yb(function(){var b=Oa(a,1);if(null!==b){var c=Z();xa(b,a,1,c)}}),Wf(a,1)}};var Gg=function(a){if(13===a.tag){var b=Oa(a,134217728);if(null!==b){var c=Z();xa(b,a,134217728,c)}Wf(a,134217728)}};var xj=function(a){if(13===a.tag){var b=hb(a),c=Oa(a,b);if(null!==c){var d=Z();xa(c,a,b,d)}Wf(a,b)}};var nl=function(){return z};var wj=function(a,b){var c=z;try{return z=a,b()}finally{z=c}};se=function(a,b,c){switch(b){case "input":le(a, c);b=c.name;if("radio"===c.type&&null!=b){for(c=a;c.parentNode;)c=c.parentNode;c=c.querySelectorAll("input[name="+JSON.stringify(""+b)+'][type="radio"]');for(b=0;b<c.length;b++){var d=c[b];if(d!==a&&d.form===a.form){var e=Rc(d);if(!e)throw Error(m(90));jg(d);le(d,e)}}}break;case "textarea":og(a,c);break;case "select":b=c.value,null!=b&&Db(a,!!c.multiple,b,!1)}};(function(a,b,c){xg=a;yg=c})(Tf,function(a,b,c,d,e){var f=z,g=ca.transition;try{return ca.transition=null,z=1,a(b,c,d,e)}finally{z=f,ca.transition= g,0===p&&Hc()}},yb);var ol={usingClientEntryPoint:!1,Events:[ec,Ib,Rc,ug,vg,Tf]};(function(a){a={bundleType:a.bundleType,version:a.version,rendererPackageName:a.rendererPackageName,rendererConfig:a.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Sa.ReactCurrentDispatcher,findHostInstanceByFiber:Xk, findFiberByHostInstance:a.findFiberByHostInstance||Yk,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1"};if("undefined"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)a=!1;else{var b=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(b.isDisabled||!b.supportsFiber)a=!0;else{try{Uc=b.inject(a),Ca=b}catch(c){}a=b.checkDCE?!0:!1}}return a})({findFiberByHostInstance:ob,bundleType:0,version:"18.3.1-next-f1338f8080-20240426", rendererPackageName:"react-dom"});Q.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ol;Q.createPortal=function(a,b){var c=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!Yf(b))throw Error(m(200));return Wk(a,b,null,c)};Q.createRoot=function(a,b){if(!Yf(a))throw Error(m(299));var c=!1,d="",e=aj;null!==b&&void 0!==b&&(!0===b.unstable_strictMode&&(c=!0),void 0!==b.identifierPrefix&&(d=b.identifierPrefix),void 0!==b.onRecoverableError&&(e=b.onRecoverableError));b=Vf(a,1,!1,null,null, c,!1,d,e);a[Ja]=b.current;sc(8===a.nodeType?a.parentNode:a);return new Xf(b)};Q.findDOMNode=function(a){if(null==a)return null;if(1===a.nodeType)return a;var b=a._reactInternals;if(void 0===b){if("function"===typeof a.render)throw Error(m(188));a=Object.keys(a).join(",");throw Error(m(268,a));}a=Bg(b);a=null===a?null:a.stateNode;return a};Q.flushSync=function(a){return yb(a)};Q.hydrate=function(a,b,c){if(!Vd(b))throw Error(m(200));return Wd(null,a,b,!0,c)};Q.hydrateRoot=function(a,b,c){if(!Yf(a))throw Error(m(405)); var d=null!=c&&c.hydratedSources||null,e=!1,f="",g=aj;null!==c&&void 0!==c&&(!0===c.unstable_strictMode&&(e=!0),void 0!==c.identifierPrefix&&(f=c.identifierPrefix),void 0!==c.onRecoverableError&&(g=c.onRecoverableError));b=Wi(b,null,a,1,null!=c?c:null,e,!1,f,g);a[Ja]=b.current;sc(a);if(d)for(a=0;a<d.length;a++)c=d[a],e=c._getVersion,e=e(c._source),null==b.mutableSourceEagerHydrationData?b.mutableSourceEagerHydrationData=[c,e]:b.mutableSourceEagerHydrationData.push(c,e);return new Ud(b)};Q.render= function(a,b,c){if(!Vd(b))throw Error(m(200));return Wd(null,a,b,!1,c)};Q.unmountComponentAtNode=function(a){if(!Vd(a))throw Error(m(40));return a._reactRootContainer?(yb(function(){Wd(null,null,a,!1,function(){a._reactRootContainer=null;a[Ja]=null})}),!0):!1};Q.unstable_batchedUpdates=Tf;Q.unstable_renderSubtreeIntoContainer=function(a,b,c,d){if(!Vd(c))throw Error(m(200));if(null==a||void 0===a._reactInternals)throw Error(m(38));return Wd(a,b,c,!1,d)};Q.version="18.3.1-next-f1338f8080-20240426"}); })(); vendor/wp-polyfill.min.js 0000644 00000101720 15206720414 0011441 0 ustar 00 /** * core-js 3.39.0 * © 2014-2024 Denis Pushkarev (zloirock.ru) * license: https://github.com/zloirock/core-js/blob/v3.39.0/LICENSE * source: https://github.com/zloirock/core-js */ !function(r){"use strict";var t,e,n;t=[function(r,t,e){e(1),e(53),e(81),e(82),e(93),e(94),e(99),e(100),e(110),e(120),e(122),e(123),e(124),r.exports=e(125)},function(r,t,e){var n=e(2),o=e(4),a=e(48),c=ArrayBuffer.prototype;n&&!("detached"in c)&&o(c,"detached",{configurable:!0,get:function(){return a(this)}})},function(r,t,e){var n=e(3);r.exports=!n((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},function(r,t,e){r.exports=function(r){try{return!!r()}catch(r){return!0}}},function(r,t,e){var n=e(5),o=e(23);r.exports=function(r,t,e){return e.get&&n(e.get,t,{getter:!0}),e.set&&n(e.set,t,{setter:!0}),o.f(r,t,e)}},function(t,e,n){var o=n(6),a=n(3),c=n(8),i=n(9),u=n(2),s=n(13).CONFIGURABLE,f=n(14),p=n(19),l=p.enforce,y=p.get,v=String,h=Object.defineProperty,g=o("".slice),b=o("".replace),m=o([].join),d=u&&!a((function(){return 8!==h((function(){}),"length",{value:8}).length})),w=String(String).split("String"),E=t.exports=function(t,e,n){"Symbol("===g(v(e),0,7)&&(e="["+b(v(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!i(t,"name")||s&&t.name!==e)&&(u?h(t,"name",{value:e,configurable:!0}):t.name=e),d&&n&&i(n,"arity")&&t.length!==n.arity&&h(t,"length",{value:n.arity});try{n&&i(n,"constructor")&&n.constructor?u&&h(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=r)}catch(r){}var o=l(t);return i(o,"source")||(o.source=m(w,"string"==typeof e?e:"")),t};Function.prototype.toString=E((function(){return c(this)&&y(this).source||f(this)}),"toString")},function(r,t,e){var n=e(7),o=Function.prototype,a=o.call,c=n&&o.bind.bind(a,a);r.exports=n?c:function(r){return function(){return a.apply(r,arguments)}}},function(r,t,e){var n=e(3);r.exports=!n((function(){var r=function(){}.bind();return"function"!=typeof r||r.hasOwnProperty("prototype")}))},function(t,e,n){var o="object"==typeof document&&document.all;t.exports=void 0===o&&o!==r?function(r){return"function"==typeof r||r===o}:function(r){return"function"==typeof r}},function(r,t,e){var n=e(6),o=e(10),a=n({}.hasOwnProperty);r.exports=Object.hasOwn||function(r,t){return a(o(r),t)}},function(r,t,e){var n=e(11),o=Object;r.exports=function(r){return o(n(r))}},function(r,t,e){var n=e(12),o=TypeError;r.exports=function(r){if(n(r))throw new o("Can't call method on "+r);return r}},function(t,e,n){t.exports=function(t){return null===t||t===r}},function(r,t,e){var n=e(2),o=e(9),a=Function.prototype,c=n&&Object.getOwnPropertyDescriptor,i=o(a,"name"),u=i&&"something"===function(){}.name,s=i&&(!n||n&&c(a,"name").configurable);r.exports={EXISTS:i,PROPER:u,CONFIGURABLE:s}},function(r,t,e){var n=e(6),o=e(8),a=e(15),c=n(Function.toString);o(a.inspectSource)||(a.inspectSource=function(r){return c(r)}),r.exports=a.inspectSource},function(r,t,e){var n=e(16),o=e(17),a=e(18),c="__core-js_shared__",i=r.exports=o[c]||a(c,{});(i.versions||(i.versions=[])).push({version:"3.39.0",mode:n?"pure":"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.39.0/LICENSE",source:"https://github.com/zloirock/core-js"})},function(r,t,e){r.exports=!1},function(r,t,e){var n=function(r){return r&&r.Math===Math&&r};r.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof global&&global)||n("object"==typeof this&&this)||function(){return this}()||Function("return this")()},function(r,t,e){var n=e(17),o=Object.defineProperty;r.exports=function(r,t){try{o(n,r,{value:t,configurable:!0,writable:!0})}catch(e){n[r]=t}return t}},function(r,t,e){var n,o,a,c=e(20),i=e(17),u=e(21),s=e(22),f=e(9),p=e(15),l=e(46),y=e(47),v="Object already initialized",h=i.TypeError,g=i.WeakMap;if(c||p.state){var b=p.state||(p.state=new g);b.get=b.get,b.has=b.has,b.set=b.set,n=function(r,t){if(b.has(r))throw new h(v);return t.facade=r,b.set(r,t),t},o=function(r){return b.get(r)||{}},a=function(r){return b.has(r)}}else{var m=l("state");y[m]=!0,n=function(r,t){if(f(r,m))throw new h(v);return t.facade=r,s(r,m,t),t},o=function(r){return f(r,m)?r[m]:{}},a=function(r){return f(r,m)}}r.exports={set:n,get:o,has:a,enforce:function(r){return a(r)?o(r):n(r,{})},getterFor:function(r){return function(t){var e;if(!u(t)||(e=o(t)).type!==r)throw new h("Incompatible receiver, "+r+" required");return e}}}},function(r,t,e){var n=e(17),o=e(8),a=n.WeakMap;r.exports=o(a)&&/native code/.test(String(a))},function(r,t,e){var n=e(8);r.exports=function(r){return"object"==typeof r?null!==r:n(r)}},function(r,t,e){var n=e(2),o=e(23),a=e(45);r.exports=n?function(r,t,e){return o.f(r,t,a(1,e))}:function(r,t,e){return r[t]=e,r}},function(r,t,e){var n=e(2),o=e(24),a=e(26),c=e(27),i=e(28),u=TypeError,s=Object.defineProperty,f=Object.getOwnPropertyDescriptor,p="enumerable",l="configurable",y="writable";t.f=n?a?function(r,t,e){if(c(r),t=i(t),c(e),"function"==typeof r&&"prototype"===t&&"value"in e&&y in e&&!e[y]){var n=f(r,t);n&&n[y]&&(r[t]=e.value,e={configurable:l in e?e[l]:n[l],enumerable:p in e?e[p]:n[p],writable:!1})}return s(r,t,e)}:s:function(r,t,e){if(c(r),t=i(t),c(e),o)try{return s(r,t,e)}catch(r){}if("get"in e||"set"in e)throw new u("Accessors not supported");return"value"in e&&(r[t]=e.value),r}},function(r,t,e){var n=e(2),o=e(3),a=e(25);r.exports=!n&&!o((function(){return 7!==Object.defineProperty(a("div"),"a",{get:function(){return 7}}).a}))},function(r,t,e){var n=e(17),o=e(21),a=n.document,c=o(a)&&o(a.createElement);r.exports=function(r){return c?a.createElement(r):{}}},function(r,t,e){var n=e(2),o=e(3);r.exports=n&&o((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},function(r,t,e){var n=e(21),o=String,a=TypeError;r.exports=function(r){if(n(r))return r;throw new a(o(r)+" is not an object")}},function(r,t,e){var n=e(29),o=e(31);r.exports=function(r){var t=n(r,"string");return o(t)?t:t+""}},function(t,e,n){var o=n(30),a=n(21),c=n(31),i=n(38),u=n(41),s=n(42),f=TypeError,p=s("toPrimitive");t.exports=function(t,e){if(!a(t)||c(t))return t;var n,s=i(t,p);if(s){if(e===r&&(e="default"),n=o(s,t,e),!a(n)||c(n))return n;throw new f("Can't convert object to primitive value")}return e===r&&(e="number"),u(t,e)}},function(r,t,e){var n=e(7),o=Function.prototype.call;r.exports=n?o.bind(o):function(){return o.apply(o,arguments)}},function(r,t,e){var n=e(32),o=e(8),a=e(33),c=e(34),i=Object;r.exports=c?function(r){return"symbol"==typeof r}:function(r){var t=n("Symbol");return o(t)&&a(t.prototype,i(r))}},function(t,e,n){var o=n(17),a=n(8);t.exports=function(t,e){return arguments.length<2?(n=o[t],a(n)?n:r):o[t]&&o[t][e];var n}},function(r,t,e){var n=e(6);r.exports=n({}.isPrototypeOf)},function(r,t,e){var n=e(35);r.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},function(r,t,e){var n=e(36),o=e(3),a=e(17).String;r.exports=!!Object.getOwnPropertySymbols&&!o((function(){var r=Symbol("symbol detection");return!a(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},function(r,t,e){var n,o,a=e(17),c=e(37),i=a.process,u=a.Deno,s=i&&i.versions||u&&u.version,f=s&&s.v8;f&&(o=(n=f.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!o&&c&&(!(n=c.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=c.match(/Chrome\/(\d+)/))&&(o=+n[1]),r.exports=o},function(r,t,e){var n=e(17).navigator,o=n&&n.userAgent;r.exports=o?String(o):""},function(t,e,n){var o=n(39),a=n(12);t.exports=function(t,e){var n=t[e];return a(n)?r:o(n)}},function(r,t,e){var n=e(8),o=e(40),a=TypeError;r.exports=function(r){if(n(r))return r;throw new a(o(r)+" is not a function")}},function(r,t,e){var n=String;r.exports=function(r){try{return n(r)}catch(r){return"Object"}}},function(r,t,e){var n=e(30),o=e(8),a=e(21),c=TypeError;r.exports=function(r,t){var e,i;if("string"===t&&o(e=r.toString)&&!a(i=n(e,r)))return i;if(o(e=r.valueOf)&&!a(i=n(e,r)))return i;if("string"!==t&&o(e=r.toString)&&!a(i=n(e,r)))return i;throw new c("Can't convert object to primitive value")}},function(r,t,e){var n=e(17),o=e(43),a=e(9),c=e(44),i=e(35),u=e(34),s=n.Symbol,f=o("wks"),p=u?s.for||s:s&&s.withoutSetter||c;r.exports=function(r){return a(f,r)||(f[r]=i&&a(s,r)?s[r]:p("Symbol."+r)),f[r]}},function(r,t,e){var n=e(15);r.exports=function(r,t){return n[r]||(n[r]=t||{})}},function(t,e,n){var o=n(6),a=0,c=Math.random(),i=o(1..toString);t.exports=function(t){return"Symbol("+(t===r?"":t)+")_"+i(++a+c,36)}},function(r,t,e){r.exports=function(r,t){return{enumerable:!(1&r),configurable:!(2&r),writable:!(4&r),value:t}}},function(r,t,e){var n=e(43),o=e(44),a=n("keys");r.exports=function(r){return a[r]||(a[r]=o(r))}},function(r,t,e){r.exports={}},function(r,t,e){var n=e(17),o=e(49),a=e(51),c=n.ArrayBuffer,i=c&&c.prototype,u=i&&o(i.slice);r.exports=function(r){if(0!==a(r))return!1;if(!u)return!1;try{return u(r,0,0),!1}catch(r){return!0}}},function(r,t,e){var n=e(50),o=e(6);r.exports=function(r){if("Function"===n(r))return o(r)}},function(r,t,e){var n=e(6),o=n({}.toString),a=n("".slice);r.exports=function(r){return a(o(r),8,-1)}},function(r,t,e){var n=e(17),o=e(52),a=e(50),c=n.ArrayBuffer,i=n.TypeError;r.exports=c&&o(c.prototype,"byteLength","get")||function(r){if("ArrayBuffer"!==a(r))throw new i("ArrayBuffer expected");return r.byteLength}},function(r,t,e){var n=e(6),o=e(39);r.exports=function(r,t,e){try{return n(o(Object.getOwnPropertyDescriptor(r,t)[e]))}catch(r){}}},function(t,e,n){var o=n(54),a=n(73);a&&o({target:"ArrayBuffer",proto:!0},{transfer:function(){return a(this,arguments.length?arguments[0]:r,!0)}})},function(t,e,n){var o=n(17),a=n(55).f,c=n(22),i=n(59),u=n(18),s=n(60),f=n(72);t.exports=function(t,e){var n,p,l,y,v,h=t.target,g=t.global,b=t.stat;if(n=g?o:b?o[h]||u(h,{}):o[h]&&o[h].prototype)for(p in e){if(y=e[p],l=t.dontCallGetSet?(v=a(n,p))&&v.value:n[p],!f(g?p:h+(b?".":"#")+p,t.forced)&&l!==r){if(typeof y==typeof l)continue;s(y,l)}(t.sham||l&&l.sham)&&c(y,"sham",!0),i(n,p,y,t)}}},function(r,t,e){var n=e(2),o=e(30),a=e(56),c=e(45),i=e(57),u=e(28),s=e(9),f=e(24),p=Object.getOwnPropertyDescriptor;t.f=n?p:function(r,t){if(r=i(r),t=u(t),f)try{return p(r,t)}catch(r){}if(s(r,t))return c(!o(a.f,r,t),r[t])}},function(r,t,e){var n={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,a=o&&!n.call({1:2},1);t.f=a?function(r){var t=o(this,r);return!!t&&t.enumerable}:n},function(r,t,e){var n=e(58),o=e(11);r.exports=function(r){return n(o(r))}},function(r,t,e){var n=e(6),o=e(3),a=e(50),c=Object,i=n("".split);r.exports=o((function(){return!c("z").propertyIsEnumerable(0)}))?function(r){return"String"===a(r)?i(r,""):c(r)}:c},function(t,e,n){var o=n(8),a=n(23),c=n(5),i=n(18);t.exports=function(t,e,n,u){u||(u={});var s=u.enumerable,f=u.name!==r?u.name:e;if(o(n)&&c(n,f,u),u.global)s?t[e]=n:i(e,n);else{try{u.unsafe?t[e]&&(s=!0):delete t[e]}catch(r){}s?t[e]=n:a.f(t,e,{value:n,enumerable:!1,configurable:!u.nonConfigurable,writable:!u.nonWritable})}return t}},function(r,t,e){var n=e(9),o=e(61),a=e(55),c=e(23);r.exports=function(r,t,e){for(var i=o(t),u=c.f,s=a.f,f=0;f<i.length;f++){var p=i[f];n(r,p)||e&&n(e,p)||u(r,p,s(t,p))}}},function(r,t,e){var n=e(32),o=e(6),a=e(62),c=e(71),i=e(27),u=o([].concat);r.exports=n("Reflect","ownKeys")||function(r){var t=a.f(i(r)),e=c.f;return e?u(t,e(r)):t}},function(r,t,e){var n=e(63),o=e(70).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(r){return n(r,o)}},function(r,t,e){var n=e(6),o=e(9),a=e(57),c=e(64).indexOf,i=e(47),u=n([].push);r.exports=function(r,t){var e,n=a(r),s=0,f=[];for(e in n)!o(i,e)&&o(n,e)&&u(f,e);for(;t.length>s;)o(n,e=t[s++])&&(~c(f,e)||u(f,e));return f}},function(r,t,e){var n=e(57),o=e(65),a=e(68),c=function(r){return function(t,e,c){var i=n(t),u=a(i);if(0===u)return!r&&-1;var s,f=o(c,u);if(r&&e!=e){for(;u>f;)if((s=i[f++])!=s)return!0}else for(;u>f;f++)if((r||f in i)&&i[f]===e)return r||f||0;return!r&&-1}};r.exports={includes:c(!0),indexOf:c(!1)}},function(r,t,e){var n=e(66),o=Math.max,a=Math.min;r.exports=function(r,t){var e=n(r);return e<0?o(e+t,0):a(e,t)}},function(r,t,e){var n=e(67);r.exports=function(r){var t=+r;return t!=t||0===t?0:n(t)}},function(r,t,e){var n=Math.ceil,o=Math.floor;r.exports=Math.trunc||function(r){var t=+r;return(t>0?o:n)(t)}},function(r,t,e){var n=e(69);r.exports=function(r){return n(r.length)}},function(r,t,e){var n=e(66),o=Math.min;r.exports=function(r){var t=n(r);return t>0?o(t,9007199254740991):0}},function(r,t,e){r.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(r,t,e){t.f=Object.getOwnPropertySymbols},function(r,t,e){var n=e(3),o=e(8),a=/#|\.prototype\./,c=function(r,t){var e=u[i(r)];return e===f||e!==s&&(o(t)?n(t):!!t)},i=c.normalize=function(r){return String(r).replace(a,".").toLowerCase()},u=c.data={},s=c.NATIVE="N",f=c.POLYFILL="P";r.exports=c},function(t,e,n){var o=n(17),a=n(6),c=n(52),i=n(74),u=n(75),s=n(51),f=n(76),p=n(80),l=o.structuredClone,y=o.ArrayBuffer,v=o.DataView,h=Math.min,g=y.prototype,b=v.prototype,m=a(g.slice),d=c(g,"resizable","get"),w=c(g,"maxByteLength","get"),E=a(b.getInt8),x=a(b.setInt8);t.exports=(p||f)&&function(t,e,n){var o,a=s(t),c=e===r?a:i(e),g=!d||!d(t);if(u(t),p&&(t=l(t,{transfer:[t]}),a===c&&(n||g)))return t;if(a>=c&&(!n||g))o=m(t,0,c);else{var b=n&&!g&&w?{maxByteLength:w(t)}:r;o=new y(c,b);for(var O=new v(t),R=new v(o),S=h(c,a),A=0;A<S;A++)x(R,A,E(O,A))}return p||f(t),o}},function(t,e,n){var o=n(66),a=n(69),c=RangeError;t.exports=function(t){if(t===r)return 0;var e=o(t),n=a(e);if(e!==n)throw new c("Wrong length or index");return n}},function(r,t,e){var n=e(48),o=TypeError;r.exports=function(r){if(n(r))throw new o("ArrayBuffer is detached");return r}},function(r,t,e){var n,o,a,c,i=e(17),u=e(77),s=e(80),f=i.structuredClone,p=i.ArrayBuffer,l=i.MessageChannel,y=!1;if(s)y=function(r){f(r,{transfer:[r]})};else if(p)try{l||(n=u("worker_threads"))&&(l=n.MessageChannel),l&&(o=new l,a=new p(2),c=function(r){o.port1.postMessage(null,[r])},2===a.byteLength&&(c(a),0===a.byteLength&&(y=c)))}catch(r){}r.exports=y},function(r,t,e){var n=e(17),o=e(78);r.exports=function(r){if(o){try{return n.process.getBuiltinModule(r)}catch(r){}try{return Function('return require("'+r+'")')()}catch(r){}}}},function(r,t,e){var n=e(79);r.exports="NODE"===n},function(r,t,e){var n=e(17),o=e(37),a=e(50),c=function(r){return o.slice(0,r.length)===r};r.exports=c("Bun/")?"BUN":c("Cloudflare-Workers")?"CLOUDFLARE":c("Deno/")?"DENO":c("Node.js/")?"NODE":n.Bun&&"string"==typeof Bun.version?"BUN":n.Deno&&"object"==typeof Deno.version?"DENO":"process"===a(n.process)?"NODE":n.window&&n.document?"BROWSER":"REST"},function(r,t,e){var n=e(17),o=e(3),a=e(36),c=e(79),i=n.structuredClone;r.exports=!!i&&!o((function(){if("DENO"===c&&a>92||"NODE"===c&&a>94||"BROWSER"===c&&a>97)return!1;var r=new ArrayBuffer(8),t=i(r,{transfer:[r]});return 0!==r.byteLength||8!==t.byteLength}))},function(t,e,n){var o=n(54),a=n(73);a&&o({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return a(this,arguments.length?arguments[0]:r,!1)}})},function(r,t,e){var n=e(54),o=e(6),a=e(39),c=e(11),i=e(83),u=e(92),s=e(16),f=e(3),p=u.Map,l=u.has,y=u.get,v=u.set,h=o([].push),g=s||f((function(){return 1!==p.groupBy("ab",(function(r){return r})).get("a").length}));n({target:"Map",stat:!0,forced:s||g},{groupBy:function(r,t){c(r),a(t);var e=new p,n=0;return i(r,(function(r){var o=t(r,n++);l(e,o)?h(y(e,o),r):v(e,o,[r])})),e}})},function(r,t,e){var n=e(84),o=e(30),a=e(27),c=e(40),i=e(85),u=e(68),s=e(33),f=e(87),p=e(88),l=e(91),y=TypeError,v=function(r,t){this.stopped=r,this.result=t},h=v.prototype;r.exports=function(r,t,e){var g,b,m,d,w,E,x,O=e&&e.that,R=!(!e||!e.AS_ENTRIES),S=!(!e||!e.IS_RECORD),A=!(!e||!e.IS_ITERATOR),T=!(!e||!e.INTERRUPTED),D=n(t,O),_=function(r){return g&&l(g,"normal",r),new v(!0,r)},I=function(r){return R?(a(r),T?D(r[0],r[1],_):D(r[0],r[1])):T?D(r,_):D(r)};if(S)g=r.iterator;else if(A)g=r;else{if(!(b=p(r)))throw new y(c(r)+" is not iterable");if(i(b)){for(m=0,d=u(r);d>m;m++)if((w=I(r[m]))&&s(h,w))return w;return new v(!1)}g=f(r,b)}for(E=S?r.next:g.next;!(x=o(E,g)).done;){try{w=I(x.value)}catch(r){l(g,"throw",r)}if("object"==typeof w&&w&&s(h,w))return w}return new v(!1)}},function(t,e,n){var o=n(49),a=n(39),c=n(7),i=o(o.bind);t.exports=function(t,e){return a(t),e===r?t:c?i(t,e):function(){return t.apply(e,arguments)}}},function(t,e,n){var o=n(42),a=n(86),c=o("iterator"),i=Array.prototype;t.exports=function(t){return t!==r&&(a.Array===t||i[c]===t)}},function(r,t,e){r.exports={}},function(r,t,e){var n=e(30),o=e(39),a=e(27),c=e(40),i=e(88),u=TypeError;r.exports=function(r,t){var e=arguments.length<2?i(r):t;if(o(e))return a(n(e,r));throw new u(c(r)+" is not iterable")}},function(r,t,e){var n=e(89),o=e(38),a=e(12),c=e(86),i=e(42)("iterator");r.exports=function(r){if(!a(r))return o(r,i)||o(r,"@@iterator")||c[n(r)]}},function(t,e,n){var o=n(90),a=n(8),c=n(50),i=n(42)("toStringTag"),u=Object,s="Arguments"===c(function(){return arguments}());t.exports=o?c:function(t){var e,n,o;return t===r?"Undefined":null===t?"Null":"string"==typeof(n=function(r,t){try{return r[t]}catch(r){}}(e=u(t),i))?n:s?c(e):"Object"===(o=c(e))&&a(e.callee)?"Arguments":o}},function(r,t,e){var n={};n[e(42)("toStringTag")]="z",r.exports="[object z]"===String(n)},function(r,t,e){var n=e(30),o=e(27),a=e(38);r.exports=function(r,t,e){var c,i;o(r);try{if(!(c=a(r,"return"))){if("throw"===t)throw e;return e}c=n(c,r)}catch(r){i=!0,c=r}if("throw"===t)throw e;if(i)throw c;return o(c),e}},function(r,t,e){var n=e(6),o=Map.prototype;r.exports={Map:Map,set:n(o.set),get:n(o.get),has:n(o.has),remove:n(o.delete),proto:o}},function(r,t,e){var n=e(54),o=e(32),a=e(6),c=e(39),i=e(11),u=e(28),s=e(83),f=e(3),p=Object.groupBy,l=o("Object","create"),y=a([].push);n({target:"Object",stat:!0,forced:!p||f((function(){return 1!==p("ab",(function(r){return r})).a.length}))},{groupBy:function(r,t){i(r),c(t);var e=l(null),n=0;return s(r,(function(r){var o=u(t(r,n++));o in e?y(e[o],r):e[o]=[r]})),e}})},function(t,e,n){var o=n(54),a=n(17),c=n(95),i=n(96),u=n(97),s=n(39),f=n(98),p=a.Promise,l=!1;o({target:"Promise",stat:!0,forced:!p||!p.try||f((function(){p.try((function(r){l=8===r}),8)})).error||!l},{try:function(t){var e=arguments.length>1?i(arguments,1):[],n=u.f(this),o=f((function(){return c(s(t),r,e)}));return(o.error?n.reject:n.resolve)(o.value),n.promise}})},function(r,t,e){var n=e(7),o=Function.prototype,a=o.apply,c=o.call;r.exports="object"==typeof Reflect&&Reflect.apply||(n?c.bind(a):function(){return c.apply(a,arguments)})},function(r,t,e){var n=e(6);r.exports=n([].slice)},function(t,e,n){var o=n(39),a=TypeError,c=function(t){var e,n;this.promise=new t((function(t,o){if(e!==r||n!==r)throw new a("Bad Promise constructor");e=t,n=o})),this.resolve=o(e),this.reject=o(n)};t.exports.f=function(r){return new c(r)}},function(r,t,e){r.exports=function(r){try{return{error:!1,value:r()}}catch(r){return{error:!0,value:r}}}},function(r,t,e){var n=e(54),o=e(97);n({target:"Promise",stat:!0},{withResolvers:function(){var r=o.f(this);return{promise:r.promise,resolve:r.resolve,reject:r.reject}}})},function(t,e,n){var o=n(54),a=n(17),c=n(32),i=n(45),u=n(23).f,s=n(9),f=n(101),p=n(102),l=n(106),y=n(108),v=n(109),h=n(2),g=n(16),b="DOMException",m=c("Error"),d=c(b),w=function(){f(this,E);var t=arguments.length,e=l(t<1?r:arguments[0]),n=l(t<2?r:arguments[1],"Error"),o=new d(e,n),a=new m(e);return a.name=b,u(o,"stack",i(1,v(a.stack,1))),p(o,this,w),o},E=w.prototype=d.prototype,x="stack"in new m(b),O="stack"in new d(1,2),R=d&&h&&Object.getOwnPropertyDescriptor(a,b),S=!(!R||R.writable&&R.configurable),A=x&&!S&&!O;o({global:!0,constructor:!0,forced:g||A},{DOMException:A?w:d});var T=c(b),D=T.prototype;if(D.constructor!==T)for(var _ in g||u(D,"constructor",i(1,T)),y)if(s(y,_)){var I=y[_],j=I.s;s(T,j)||u(T,j,i(6,I.c))}},function(r,t,e){var n=e(33),o=TypeError;r.exports=function(r,t){if(n(t,r))return r;throw new o("Incorrect invocation")}},function(r,t,e){var n=e(8),o=e(21),a=e(103);r.exports=function(r,t,e){var c,i;return a&&n(c=t.constructor)&&c!==e&&o(i=c.prototype)&&i!==e.prototype&&a(r,i),r}},function(t,e,n){var o=n(52),a=n(21),c=n(11),i=n(104);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var r,t=!1,e={};try{(r=o(Object.prototype,"__proto__","set"))(e,[]),t=e instanceof Array}catch(r){}return function(e,n){return c(e),i(n),a(e)?(t?r(e,n):e.__proto__=n,e):e}}():r)},function(r,t,e){var n=e(105),o=String,a=TypeError;r.exports=function(r){if(n(r))return r;throw new a("Can't set "+o(r)+" as a prototype")}},function(r,t,e){var n=e(21);r.exports=function(r){return n(r)||null===r}},function(t,e,n){var o=n(107);t.exports=function(t,e){return t===r?arguments.length<2?"":e:o(t)}},function(r,t,e){var n=e(89),o=String;r.exports=function(r){if("Symbol"===n(r))throw new TypeError("Cannot convert a Symbol value to a string");return o(r)}},function(r,t,e){r.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}},function(r,t,e){var n=e(6),o=Error,a=n("".replace),c=String(new o("zxcasd").stack),i=/\n\s*at [^:]*:[^\n]*/,u=i.test(c);r.exports=function(r,t){if(u&&"string"==typeof r&&!o.prepareStackTrace)for(;t--;)r=a(r,i,"");return r}},function(t,e,n){var o,a=n(16),c=n(54),i=n(17),u=n(32),s=n(6),f=n(3),p=n(44),l=n(8),y=n(111),v=n(12),h=n(21),g=n(31),b=n(83),m=n(27),d=n(89),w=n(9),E=n(112),x=n(22),O=n(68),R=n(113),S=n(114),A=n(92),T=n(116),D=n(117),_=n(76),I=n(119),j=n(80),M=i.Object,k=i.Array,P=i.Date,C=i.Error,L=i.TypeError,B=i.PerformanceMark,N=u("DOMException"),U=A.Map,F=A.has,z=A.get,W=A.set,V=T.Set,H=T.add,G=T.has,Y=u("Object","keys"),Q=s([].push),q=s((!0).valueOf),X=s(1..valueOf),K=s("".valueOf),Z=s(P.prototype.getTime),$=p("structuredClone"),J="DataCloneError",rr="Transferring",tr=function(r){return!f((function(){var t=new i.Set([7]),e=r(t),n=r(M(7));return e===t||!e.has(7)||!h(n)||7!=+n}))&&r},er=function(r,t){return!f((function(){var e=new t,n=r({a:e,b:e});return!(n&&n.a===n.b&&n.a instanceof t&&n.a.stack===e.stack)}))},nr=i.structuredClone,or=a||!er(nr,C)||!er(nr,N)||(o=nr,!!f((function(){var r=o(new i.AggregateError([1],$,{cause:3}));return"AggregateError"!==r.name||1!==r.errors[0]||r.message!==$||3!==r.cause}))),ar=!nr&&tr((function(r){return new B($,{detail:r}).detail})),cr=tr(nr)||ar,ir=function(r){throw new N("Uncloneable type: "+r,J)},ur=function(r,t){throw new N((t||"Cloning")+" of "+r+" cannot be properly polyfilled in this engine",J)},sr=function(r,t){return cr||ur(t),cr(r)},fr=function(t,e,n){if(F(e,t))return z(e,t);var o,a,c,u,s,f;if("SharedArrayBuffer"===(n||d(t)))o=cr?cr(t):t;else{var p=i.DataView;p||l(t.slice)||ur("ArrayBuffer");try{if(l(t.slice)&&!t.resizable)o=t.slice(0);else{a=t.byteLength,c="maxByteLength"in t?{maxByteLength:t.maxByteLength}:r,o=new ArrayBuffer(a,c),u=new p(t),s=new p(o);for(f=0;f<a;f++)s.setUint8(f,u.getUint8(f))}}catch(r){throw new N("ArrayBuffer is detached",J)}}return W(e,t,o),o},pr=function(t,e){if(g(t)&&ir("Symbol"),!h(t))return t;if(e){if(F(e,t))return z(e,t)}else e=new U;var n,o,a,c,s,f,p,y,v=d(t);switch(v){case"Array":a=k(O(t));break;case"Object":a={};break;case"Map":a=new U;break;case"Set":a=new V;break;case"RegExp":a=new RegExp(t.source,S(t));break;case"Error":switch(o=t.name){case"AggregateError":a=new(u(o))([]);break;case"EvalError":case"RangeError":case"ReferenceError":case"SuppressedError":case"SyntaxError":case"TypeError":case"URIError":a=new(u(o));break;case"CompileError":case"LinkError":case"RuntimeError":a=new(u("WebAssembly",o));break;default:a=new C}break;case"DOMException":a=new N(t.message,t.name);break;case"ArrayBuffer":case"SharedArrayBuffer":a=fr(t,e,v);break;case"DataView":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float16Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":f="DataView"===v?t.byteLength:t.length,a=function(r,t,e,n,o){var a=i[t];return h(a)||ur(t),new a(fr(r.buffer,o),e,n)}(t,v,t.byteOffset,f,e);break;case"DOMQuad":try{a=new DOMQuad(pr(t.p1,e),pr(t.p2,e),pr(t.p3,e),pr(t.p4,e))}catch(r){a=sr(t,v)}break;case"File":if(cr)try{a=cr(t),d(a)!==v&&(a=r)}catch(r){}if(!a)try{a=new File([t],t.name,t)}catch(r){}a||ur(v);break;case"FileList":if(c=function(){var r;try{r=new i.DataTransfer}catch(t){try{r=new i.ClipboardEvent("").clipboardData}catch(r){}}return r&&r.items&&r.files?r:null}()){for(s=0,f=O(t);s<f;s++)c.items.add(pr(t[s],e));a=c.files}else a=sr(t,v);break;case"ImageData":try{a=new ImageData(pr(t.data,e),t.width,t.height,{colorSpace:t.colorSpace})}catch(r){a=sr(t,v)}break;default:if(cr)a=cr(t);else switch(v){case"BigInt":a=M(t.valueOf());break;case"Boolean":a=M(q(t));break;case"Number":a=M(X(t));break;case"String":a=M(K(t));break;case"Date":a=new P(Z(t));break;case"Blob":try{a=t.slice(0,t.size,t.type)}catch(r){ur(v)}break;case"DOMPoint":case"DOMPointReadOnly":n=i[v];try{a=n.fromPoint?n.fromPoint(t):new n(t.x,t.y,t.z,t.w)}catch(r){ur(v)}break;case"DOMRect":case"DOMRectReadOnly":n=i[v];try{a=n.fromRect?n.fromRect(t):new n(t.x,t.y,t.width,t.height)}catch(r){ur(v)}break;case"DOMMatrix":case"DOMMatrixReadOnly":n=i[v];try{a=n.fromMatrix?n.fromMatrix(t):new n(t)}catch(r){ur(v)}break;case"AudioData":case"VideoFrame":l(t.clone)||ur(v);try{a=t.clone()}catch(r){ir(v)}break;case"CropTarget":case"CryptoKey":case"FileSystemDirectoryHandle":case"FileSystemFileHandle":case"FileSystemHandle":case"GPUCompilationInfo":case"GPUCompilationMessage":case"ImageBitmap":case"RTCCertificate":case"WebAssembly.Module":ur(v);default:ir(v)}}switch(W(e,t,a),v){case"Array":case"Object":for(p=Y(t),s=0,f=O(p);s<f;s++)y=p[s],E(a,y,pr(t[y],e));break;case"Map":t.forEach((function(r,t){W(a,pr(t,e),pr(r,e))}));break;case"Set":t.forEach((function(r){H(a,pr(r,e))}));break;case"Error":x(a,"message",pr(t.message,e)),w(t,"cause")&&x(a,"cause",pr(t.cause,e)),"AggregateError"===o?a.errors=pr(t.errors,e):"SuppressedError"===o&&(a.error=pr(t.error,e),a.suppressed=pr(t.suppressed,e));case"DOMException":I&&x(a,"stack",pr(t.stack,e))}return a};c({global:!0,enumerable:!0,sham:!j,forced:or},{structuredClone:function(t){var e,n,o=R(arguments.length,1)>1&&!v(arguments[1])?m(arguments[1]):r,a=o?o.transfer:r;a!==r&&(n=function(t,e){if(!h(t))throw new L("Transfer option cannot be converted to a sequence");var n=[];b(t,(function(r){Q(n,m(r))}));for(var o,a,c,u,s,f=0,p=O(n),v=new V;f<p;){if(o=n[f++],"ArrayBuffer"===(a=d(o))?G(v,o):F(e,o))throw new N("Duplicate transferable",J);if("ArrayBuffer"!==a){if(j)u=nr(o,{transfer:[o]});else switch(a){case"ImageBitmap":c=i.OffscreenCanvas,y(c)||ur(a,rr);try{(s=new c(o.width,o.height)).getContext("bitmaprenderer").transferFromImageBitmap(o),u=s.transferToImageBitmap()}catch(r){}break;case"AudioData":case"VideoFrame":l(o.clone)&&l(o.close)||ur(a,rr);try{u=o.clone(),o.close()}catch(r){}break;case"MediaSourceHandle":case"MessagePort":case"MIDIAccess":case"OffscreenCanvas":case"ReadableStream":case"RTCDataChannel":case"TransformStream":case"WebTransportReceiveStream":case"WebTransportSendStream":case"WritableStream":ur(a,rr)}if(u===r)throw new N("This object cannot be transferred: "+a,J);W(e,o,u)}else H(v,o)}return v}(a,e=new U));var c=pr(t,e);return n&&function(r){D(r,(function(r){j?cr(r,{transfer:[r]}):l(r.transfer)?r.transfer():_?_(r):ur("ArrayBuffer",rr)}))}(n),c}})},function(r,t,e){var n=e(6),o=e(3),a=e(8),c=e(89),i=e(32),u=e(14),s=function(){},f=i("Reflect","construct"),p=/^\s*(?:class|function)\b/,l=n(p.exec),y=!p.test(s),v=function(r){if(!a(r))return!1;try{return f(s,[],r),!0}catch(r){return!1}},h=function(r){if(!a(r))return!1;switch(c(r)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return y||!!l(p,u(r))}catch(r){return!0}};h.sham=!0,r.exports=!f||o((function(){var r;return v(v.call)||!v(Object)||!v((function(){r=!0}))||r}))?h:v},function(r,t,e){var n=e(2),o=e(23),a=e(45);r.exports=function(r,t,e){n?o.f(r,t,a(0,e)):r[t]=e}},function(r,t,e){var n=TypeError;r.exports=function(r,t){if(r<t)throw new n("Not enough arguments");return r}},function(t,e,n){var o=n(30),a=n(9),c=n(33),i=n(115),u=RegExp.prototype;t.exports=function(t){var e=t.flags;return e!==r||"flags"in u||a(t,"flags")||!c(u,t)?e:o(i,t)}},function(r,t,e){var n=e(27);r.exports=function(){var r=n(this),t="";return r.hasIndices&&(t+="d"),r.global&&(t+="g"),r.ignoreCase&&(t+="i"),r.multiline&&(t+="m"),r.dotAll&&(t+="s"),r.unicode&&(t+="u"),r.unicodeSets&&(t+="v"),r.sticky&&(t+="y"),t}},function(r,t,e){var n=e(6),o=Set.prototype;r.exports={Set:Set,add:n(o.add),has:n(o.has),remove:n(o.delete),proto:o}},function(r,t,e){var n=e(6),o=e(118),a=e(116),c=a.Set,i=a.proto,u=n(i.forEach),s=n(i.keys),f=s(new c).next;r.exports=function(r,t,e){return e?o({iterator:s(r),next:f},t):u(r,t)}},function(t,e,n){var o=n(30);t.exports=function(t,e,n){for(var a,c,i=n?t:t.iterator,u=t.next;!(a=o(u,i)).done;)if((c=e(a.value))!==r)return c}},function(r,t,e){var n=e(3),o=e(45);r.exports=!n((function(){var r=new Error("a");return!("stack"in r)||(Object.defineProperty(r,"stack",o(1,7)),7!==r.stack)}))},function(t,e,n){var o=n(54),a=n(32),c=n(3),i=n(113),u=n(107),s=n(121),f=a("URL"),p=s&&c((function(){f.canParse()})),l=c((function(){return 1!==f.canParse.length}));o({target:"URL",stat:!0,forced:!p||l},{canParse:function(t){var e=i(arguments.length,1),n=u(t),o=e<2||arguments[1]===r?r:u(arguments[1]);try{return!!new f(n,o)}catch(r){return!1}}})},function(t,e,n){var o=n(3),a=n(42),c=n(2),i=n(16),u=a("iterator");t.exports=!o((function(){var t=new URL("b?a=1&b=2&c=3","https://a"),e=t.searchParams,n=new URLSearchParams("a=1&a=2&b=3"),o="";return t.pathname="c%20d",e.forEach((function(r,t){e.delete("b"),o+=t+r})),n.delete("a",2),n.delete("b",r),i&&(!t.toJSON||!n.has("a",1)||n.has("a",2)||!n.has("a",r)||n.has("b"))||!e.size&&(i||!c)||!e.sort||"https://a/c%20d?a=1&c=3"!==t.href||"3"!==e.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!e[u]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("https://тест").host||"#%D0%B1"!==new URL("https://a#б").hash||"a1c3"!==o||"x"!==new URL("https://x",r).host}))},function(t,e,n){var o=n(54),a=n(32),c=n(113),i=n(107),u=n(121),s=a("URL");o({target:"URL",stat:!0,forced:!u},{parse:function(t){var e=c(arguments.length,1),n=i(t),o=e<2||arguments[1]===r?r:i(arguments[1]);try{return new s(n,o)}catch(r){return null}}})},function(t,e,n){var o=n(59),a=n(6),c=n(107),i=n(113),u=URLSearchParams,s=u.prototype,f=a(s.append),p=a(s.delete),l=a(s.forEach),y=a([].push),v=new u("a=1&a=2&b=3");v.delete("a",1),v.delete("b",r),v+""!="a=2"&&o(s,"delete",(function(t){var e=arguments.length,n=e<2?r:arguments[1];if(e&&n===r)return p(this,t);var o=[];l(this,(function(r,t){y(o,{key:t,value:r})})),i(e,1);for(var a,u=c(t),s=c(n),v=0,h=0,g=!1,b=o.length;v<b;)a=o[v++],g||a.key===u?(g=!0,p(this,a.key)):h++;for(;h<b;)(a=o[h++]).key===u&&a.value===s||f(this,a.key,a.value)}),{enumerable:!0,unsafe:!0})},function(t,e,n){var o=n(59),a=n(6),c=n(107),i=n(113),u=URLSearchParams,s=u.prototype,f=a(s.getAll),p=a(s.has),l=new u("a=1");!l.has("a",2)&&l.has("a",r)||o(s,"has",(function(t){var e=arguments.length,n=e<2?r:arguments[1];if(e&&n===r)return p(this,t);var o=f(this,t);i(e,1);for(var a=c(n),u=0;u<o.length;)if(o[u++]===a)return!0;return!1}),{enumerable:!0,unsafe:!0})},function(r,t,e){var n=e(2),o=e(6),a=e(4),c=URLSearchParams.prototype,i=o(c.forEach);n&&!("size"in c)&&a(c,"size",{get:function(){var r=0;return i(this,(function(){r++})),r},configurable:!0,enumerable:!0})}],e={},(n=function(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}).m=t,n.c=e,n.d=function(r,t,e){n.o(r,t)||Object.defineProperty(r,t,{enumerable:!0,get:e})},n.r=function(r){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},n.t=function(r,t){if(1&t&&(r=n(r)),8&t)return r;if(4&t&&"object"==typeof r&&r&&r.__esModule)return r;var e=Object.create(null);if(n.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:r}),2&t&&"string"!=typeof r)for(var o in r)n.d(e,o,function(t){return r[t]}.bind(null,o));return e},n.n=function(r){var t=r&&r.__esModule?function(){return r.default}:function(){return r};return n.d(t,"a",t),t},n.o=function(r,t){return Object.prototype.hasOwnProperty.call(r,t)},n.p="",n(n.s=0)}(); vendor/wp-polyfill-element-closest.min.js 0000644 00000000654 15206720414 0014546 0 ustar 00 !function(e){var t=e.Element.prototype;"function"!=typeof t.matches&&(t.matches=t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||function(e){for(var t=(this.document||this.ownerDocument).querySelectorAll(e),o=0;t[o]&&t[o]!==this;)++o;return Boolean(t[o])}),"function"!=typeof t.closest&&(t.closest=function(e){for(var t=this;t&&1===t.nodeType;){if(t.matches(e))return t;t=t.parentNode}return null})}(window); vendor/wp-polyfill.js 0000644 00000324200 15206720414 0010657 0 ustar 00 /** * core-js 3.39.0 * © 2014-2024 Denis Pushkarev (zloirock.ru) * license: https://github.com/zloirock/core-js/blob/v3.39.0/LICENSE * source: https://github.com/zloirock/core-js */ !function (undefined) { 'use strict'; /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ var __webpack_require__ = function (moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 0); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(1); __webpack_require__(53); __webpack_require__(81); __webpack_require__(82); __webpack_require__(93); __webpack_require__(94); __webpack_require__(99); __webpack_require__(100); __webpack_require__(110); __webpack_require__(120); __webpack_require__(122); __webpack_require__(123); __webpack_require__(124); module.exports = __webpack_require__(125); /***/ }), /* 1 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var DESCRIPTORS = __webpack_require__(2); var defineBuiltInAccessor = __webpack_require__(4); var isDetached = __webpack_require__(48); var ArrayBufferPrototype = ArrayBuffer.prototype; // `ArrayBuffer.prototype.detached` getter // https://tc39.es/ecma262/#sec-get-arraybuffer.prototype.detached if (DESCRIPTORS && !('detached' in ArrayBufferPrototype)) { defineBuiltInAccessor(ArrayBufferPrototype, 'detached', { configurable: true, get: function detached() { return isDetached(this); } }); } /***/ }), /* 2 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var fails = __webpack_require__(3); // Detect IE8's incomplete defineProperty implementation module.exports = !fails(function () { // eslint-disable-next-line es/no-object-defineproperty -- required for testing return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7; }); /***/ }), /* 3 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function (exec) { try { return !!exec(); } catch (error) { return true; } }; /***/ }), /* 4 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var makeBuiltIn = __webpack_require__(5); var defineProperty = __webpack_require__(23); module.exports = function (target, name, descriptor) { if (descriptor.get) makeBuiltIn(descriptor.get, name, { getter: true }); if (descriptor.set) makeBuiltIn(descriptor.set, name, { setter: true }); return defineProperty.f(target, name, descriptor); }; /***/ }), /* 5 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var uncurryThis = __webpack_require__(6); var fails = __webpack_require__(3); var isCallable = __webpack_require__(8); var hasOwn = __webpack_require__(9); var DESCRIPTORS = __webpack_require__(2); var CONFIGURABLE_FUNCTION_NAME = __webpack_require__(13).CONFIGURABLE; var inspectSource = __webpack_require__(14); var InternalStateModule = __webpack_require__(19); var enforceInternalState = InternalStateModule.enforce; var getInternalState = InternalStateModule.get; var $String = String; // eslint-disable-next-line es/no-object-defineproperty -- safe var defineProperty = Object.defineProperty; var stringSlice = uncurryThis(''.slice); var replace = uncurryThis(''.replace); var join = uncurryThis([].join); var CONFIGURABLE_LENGTH = DESCRIPTORS && !fails(function () { return defineProperty(function () { /* empty */ }, 'length', { value: 8 }).length !== 8; }); var TEMPLATE = String(String).split('String'); var makeBuiltIn = module.exports = function (value, name, options) { if (stringSlice($String(name), 0, 7) === 'Symbol(') { name = '[' + replace($String(name), /^Symbol\(([^)]*)\).*$/, '$1') + ']'; } if (options && options.getter) name = 'get ' + name; if (options && options.setter) name = 'set ' + name; if (!hasOwn(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) { if (DESCRIPTORS) defineProperty(value, 'name', { value: name, configurable: true }); else value.name = name; } if (CONFIGURABLE_LENGTH && options && hasOwn(options, 'arity') && value.length !== options.arity) { defineProperty(value, 'length', { value: options.arity }); } try { if (options && hasOwn(options, 'constructor') && options.constructor) { if (DESCRIPTORS) defineProperty(value, 'prototype', { writable: false }); // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable } else if (value.prototype) value.prototype = undefined; } catch (error) { /* empty */ } var state = enforceInternalState(value); if (!hasOwn(state, 'source')) { state.source = join(TEMPLATE, typeof name == 'string' ? name : ''); } return value; }; // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative // eslint-disable-next-line no-extend-native -- required Function.prototype.toString = makeBuiltIn(function toString() { return isCallable(this) && getInternalState(this).source || inspectSource(this); }, 'toString'); /***/ }), /* 6 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var NATIVE_BIND = __webpack_require__(7); var FunctionPrototype = Function.prototype; var call = FunctionPrototype.call; var uncurryThisWithBind = NATIVE_BIND && FunctionPrototype.bind.bind(call, call); module.exports = NATIVE_BIND ? uncurryThisWithBind : function (fn) { return function () { return call.apply(fn, arguments); }; }; /***/ }), /* 7 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var fails = __webpack_require__(3); module.exports = !fails(function () { // eslint-disable-next-line es/no-function-prototype-bind -- safe var test = (function () { /* empty */ }).bind(); // eslint-disable-next-line no-prototype-builtins -- safe return typeof test != 'function' || test.hasOwnProperty('prototype'); }); /***/ }), /* 8 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot var documentAll = typeof document == 'object' && document.all; // `IsCallable` abstract operation // https://tc39.es/ecma262/#sec-iscallable // eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing module.exports = typeof documentAll == 'undefined' && documentAll !== undefined ? function (argument) { return typeof argument == 'function' || argument === documentAll; } : function (argument) { return typeof argument == 'function'; }; /***/ }), /* 9 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var uncurryThis = __webpack_require__(6); var toObject = __webpack_require__(10); var hasOwnProperty = uncurryThis({}.hasOwnProperty); // `HasOwnProperty` abstract operation // https://tc39.es/ecma262/#sec-hasownproperty // eslint-disable-next-line es/no-object-hasown -- safe module.exports = Object.hasOwn || function hasOwn(it, key) { return hasOwnProperty(toObject(it), key); }; /***/ }), /* 10 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var requireObjectCoercible = __webpack_require__(11); var $Object = Object; // `ToObject` abstract operation // https://tc39.es/ecma262/#sec-toobject module.exports = function (argument) { return $Object(requireObjectCoercible(argument)); }; /***/ }), /* 11 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var isNullOrUndefined = __webpack_require__(12); var $TypeError = TypeError; // `RequireObjectCoercible` abstract operation // https://tc39.es/ecma262/#sec-requireobjectcoercible module.exports = function (it) { if (isNullOrUndefined(it)) throw new $TypeError("Can't call method on " + it); return it; }; /***/ }), /* 12 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // we can't use just `it == null` since of `document.all` special case // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec module.exports = function (it) { return it === null || it === undefined; }; /***/ }), /* 13 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var DESCRIPTORS = __webpack_require__(2); var hasOwn = __webpack_require__(9); var FunctionPrototype = Function.prototype; // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor; var EXISTS = hasOwn(FunctionPrototype, 'name'); // additional protection from minified / mangled / dropped function names var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something'; var CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable)); module.exports = { EXISTS: EXISTS, PROPER: PROPER, CONFIGURABLE: CONFIGURABLE }; /***/ }), /* 14 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var uncurryThis = __webpack_require__(6); var isCallable = __webpack_require__(8); var store = __webpack_require__(15); var functionToString = uncurryThis(Function.toString); // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper if (!isCallable(store.inspectSource)) { store.inspectSource = function (it) { return functionToString(it); }; } module.exports = store.inspectSource; /***/ }), /* 15 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var IS_PURE = __webpack_require__(16); var globalThis = __webpack_require__(17); var defineGlobalProperty = __webpack_require__(18); var SHARED = '__core-js_shared__'; var store = module.exports = globalThis[SHARED] || defineGlobalProperty(SHARED, {}); (store.versions || (store.versions = [])).push({ version: '3.39.0', mode: IS_PURE ? 'pure' : 'global', copyright: '© 2014-2024 Denis Pushkarev (zloirock.ru)', license: 'https://github.com/zloirock/core-js/blob/v3.39.0/LICENSE', source: 'https://github.com/zloirock/core-js' }); /***/ }), /* 16 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = false; /***/ }), /* 17 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var check = function (it) { return it && it.Math === Math && it; }; // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 module.exports = // eslint-disable-next-line es/no-global-this -- safe check(typeof globalThis == 'object' && globalThis) || check(typeof window == 'object' && window) || // eslint-disable-next-line no-restricted-globals -- safe check(typeof self == 'object' && self) || check(typeof global == 'object' && global) || check(typeof this == 'object' && this) || // eslint-disable-next-line no-new-func -- fallback (function () { return this; })() || Function('return this')(); /***/ }), /* 18 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var globalThis = __webpack_require__(17); // eslint-disable-next-line es/no-object-defineproperty -- safe var defineProperty = Object.defineProperty; module.exports = function (key, value) { try { defineProperty(globalThis, key, { value: value, configurable: true, writable: true }); } catch (error) { globalThis[key] = value; } return value; }; /***/ }), /* 19 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var NATIVE_WEAK_MAP = __webpack_require__(20); var globalThis = __webpack_require__(17); var isObject = __webpack_require__(21); var createNonEnumerableProperty = __webpack_require__(22); var hasOwn = __webpack_require__(9); var shared = __webpack_require__(15); var sharedKey = __webpack_require__(46); var hiddenKeys = __webpack_require__(47); var OBJECT_ALREADY_INITIALIZED = 'Object already initialized'; var TypeError = globalThis.TypeError; var WeakMap = globalThis.WeakMap; var set, get, has; var enforce = function (it) { return has(it) ? get(it) : set(it, {}); }; var getterFor = function (TYPE) { return function (it) { var state; if (!isObject(it) || (state = get(it)).type !== TYPE) { throw new TypeError('Incompatible receiver, ' + TYPE + ' required'); } return state; }; }; if (NATIVE_WEAK_MAP || shared.state) { var store = shared.state || (shared.state = new WeakMap()); /* eslint-disable no-self-assign -- prototype methods protection */ store.get = store.get; store.has = store.has; store.set = store.set; /* eslint-enable no-self-assign -- prototype methods protection */ set = function (it, metadata) { if (store.has(it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED); metadata.facade = it; store.set(it, metadata); return metadata; }; get = function (it) { return store.get(it) || {}; }; has = function (it) { return store.has(it); }; } else { var STATE = sharedKey('state'); hiddenKeys[STATE] = true; set = function (it, metadata) { if (hasOwn(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED); metadata.facade = it; createNonEnumerableProperty(it, STATE, metadata); return metadata; }; get = function (it) { return hasOwn(it, STATE) ? it[STATE] : {}; }; has = function (it) { return hasOwn(it, STATE); }; } module.exports = { set: set, get: get, has: has, enforce: enforce, getterFor: getterFor }; /***/ }), /* 20 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var globalThis = __webpack_require__(17); var isCallable = __webpack_require__(8); var WeakMap = globalThis.WeakMap; module.exports = isCallable(WeakMap) && /native code/.test(String(WeakMap)); /***/ }), /* 21 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var isCallable = __webpack_require__(8); module.exports = function (it) { return typeof it == 'object' ? it !== null : isCallable(it); }; /***/ }), /* 22 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var DESCRIPTORS = __webpack_require__(2); var definePropertyModule = __webpack_require__(23); var createPropertyDescriptor = __webpack_require__(45); module.exports = DESCRIPTORS ? function (object, key, value) { return definePropertyModule.f(object, key, createPropertyDescriptor(1, value)); } : function (object, key, value) { object[key] = value; return object; }; /***/ }), /* 23 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var DESCRIPTORS = __webpack_require__(2); var IE8_DOM_DEFINE = __webpack_require__(24); var V8_PROTOTYPE_DEFINE_BUG = __webpack_require__(26); var anObject = __webpack_require__(27); var toPropertyKey = __webpack_require__(28); var $TypeError = TypeError; // eslint-disable-next-line es/no-object-defineproperty -- safe var $defineProperty = Object.defineProperty; // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; var ENUMERABLE = 'enumerable'; var CONFIGURABLE = 'configurable'; var WRITABLE = 'writable'; // `Object.defineProperty` method // https://tc39.es/ecma262/#sec-object.defineproperty exports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) { anObject(O); P = toPropertyKey(P); anObject(Attributes); if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) { var current = $getOwnPropertyDescriptor(O, P); if (current && current[WRITABLE]) { O[P] = Attributes.value; Attributes = { configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE], enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE], writable: false }; } } return $defineProperty(O, P, Attributes); } : $defineProperty : function defineProperty(O, P, Attributes) { anObject(O); P = toPropertyKey(P); anObject(Attributes); if (IE8_DOM_DEFINE) try { return $defineProperty(O, P, Attributes); } catch (error) { /* empty */ } if ('get' in Attributes || 'set' in Attributes) throw new $TypeError('Accessors not supported'); if ('value' in Attributes) O[P] = Attributes.value; return O; }; /***/ }), /* 24 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var DESCRIPTORS = __webpack_require__(2); var fails = __webpack_require__(3); var createElement = __webpack_require__(25); // Thanks to IE8 for its funny defineProperty module.exports = !DESCRIPTORS && !fails(function () { // eslint-disable-next-line es/no-object-defineproperty -- required for testing return Object.defineProperty(createElement('div'), 'a', { get: function () { return 7; } }).a !== 7; }); /***/ }), /* 25 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var globalThis = __webpack_require__(17); var isObject = __webpack_require__(21); var document = globalThis.document; // typeof document.createElement is 'object' in old IE var EXISTS = isObject(document) && isObject(document.createElement); module.exports = function (it) { return EXISTS ? document.createElement(it) : {}; }; /***/ }), /* 26 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var DESCRIPTORS = __webpack_require__(2); var fails = __webpack_require__(3); // V8 ~ Chrome 36- // https://bugs.chromium.org/p/v8/issues/detail?id=3334 module.exports = DESCRIPTORS && fails(function () { // eslint-disable-next-line es/no-object-defineproperty -- required for testing return Object.defineProperty(function () { /* empty */ }, 'prototype', { value: 42, writable: false }).prototype !== 42; }); /***/ }), /* 27 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var isObject = __webpack_require__(21); var $String = String; var $TypeError = TypeError; // `Assert: Type(argument) is Object` module.exports = function (argument) { if (isObject(argument)) return argument; throw new $TypeError($String(argument) + ' is not an object'); }; /***/ }), /* 28 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var toPrimitive = __webpack_require__(29); var isSymbol = __webpack_require__(31); // `ToPropertyKey` abstract operation // https://tc39.es/ecma262/#sec-topropertykey module.exports = function (argument) { var key = toPrimitive(argument, 'string'); return isSymbol(key) ? key : key + ''; }; /***/ }), /* 29 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var call = __webpack_require__(30); var isObject = __webpack_require__(21); var isSymbol = __webpack_require__(31); var getMethod = __webpack_require__(38); var ordinaryToPrimitive = __webpack_require__(41); var wellKnownSymbol = __webpack_require__(42); var $TypeError = TypeError; var TO_PRIMITIVE = wellKnownSymbol('toPrimitive'); // `ToPrimitive` abstract operation // https://tc39.es/ecma262/#sec-toprimitive module.exports = function (input, pref) { if (!isObject(input) || isSymbol(input)) return input; var exoticToPrim = getMethod(input, TO_PRIMITIVE); var result; if (exoticToPrim) { if (pref === undefined) pref = 'default'; result = call(exoticToPrim, input, pref); if (!isObject(result) || isSymbol(result)) return result; throw new $TypeError("Can't convert object to primitive value"); } if (pref === undefined) pref = 'number'; return ordinaryToPrimitive(input, pref); }; /***/ }), /* 30 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var NATIVE_BIND = __webpack_require__(7); var call = Function.prototype.call; module.exports = NATIVE_BIND ? call.bind(call) : function () { return call.apply(call, arguments); }; /***/ }), /* 31 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var getBuiltIn = __webpack_require__(32); var isCallable = __webpack_require__(8); var isPrototypeOf = __webpack_require__(33); var USE_SYMBOL_AS_UID = __webpack_require__(34); var $Object = Object; module.exports = USE_SYMBOL_AS_UID ? function (it) { return typeof it == 'symbol'; } : function (it) { var $Symbol = getBuiltIn('Symbol'); return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it)); }; /***/ }), /* 32 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var globalThis = __webpack_require__(17); var isCallable = __webpack_require__(8); var aFunction = function (argument) { return isCallable(argument) ? argument : undefined; }; module.exports = function (namespace, method) { return arguments.length < 2 ? aFunction(globalThis[namespace]) : globalThis[namespace] && globalThis[namespace][method]; }; /***/ }), /* 33 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var uncurryThis = __webpack_require__(6); module.exports = uncurryThis({}.isPrototypeOf); /***/ }), /* 34 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* eslint-disable es/no-symbol -- required for testing */ var NATIVE_SYMBOL = __webpack_require__(35); module.exports = NATIVE_SYMBOL && !Symbol.sham && typeof Symbol.iterator == 'symbol'; /***/ }), /* 35 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* eslint-disable es/no-symbol -- required for testing */ var V8_VERSION = __webpack_require__(36); var fails = __webpack_require__(3); var globalThis = __webpack_require__(17); var $String = globalThis.String; // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing module.exports = !!Object.getOwnPropertySymbols && !fails(function () { var symbol = Symbol('symbol detection'); // Chrome 38 Symbol has incorrect toString conversion // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances // nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will, // of course, fail. return !$String(symbol) || !(Object(symbol) instanceof Symbol) || // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances !Symbol.sham && V8_VERSION && V8_VERSION < 41; }); /***/ }), /* 36 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var globalThis = __webpack_require__(17); var userAgent = __webpack_require__(37); var process = globalThis.process; var Deno = globalThis.Deno; var versions = process && process.versions || Deno && Deno.version; var v8 = versions && versions.v8; var match, version; if (v8) { match = v8.split('.'); // in old Chrome, versions of V8 isn't V8 = Chrome / 10 // but their correct versions are not interesting for us version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]); } // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0` // so check `userAgent` even if `.v8` exists, but 0 if (!version && userAgent) { match = userAgent.match(/Edge\/(\d+)/); if (!match || match[1] >= 74) { match = userAgent.match(/Chrome\/(\d+)/); if (match) version = +match[1]; } } module.exports = version; /***/ }), /* 37 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var globalThis = __webpack_require__(17); var navigator = globalThis.navigator; var userAgent = navigator && navigator.userAgent; module.exports = userAgent ? String(userAgent) : ''; /***/ }), /* 38 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var aCallable = __webpack_require__(39); var isNullOrUndefined = __webpack_require__(12); // `GetMethod` abstract operation // https://tc39.es/ecma262/#sec-getmethod module.exports = function (V, P) { var func = V[P]; return isNullOrUndefined(func) ? undefined : aCallable(func); }; /***/ }), /* 39 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var isCallable = __webpack_require__(8); var tryToString = __webpack_require__(40); var $TypeError = TypeError; // `Assert: IsCallable(argument) is true` module.exports = function (argument) { if (isCallable(argument)) return argument; throw new $TypeError(tryToString(argument) + ' is not a function'); }; /***/ }), /* 40 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $String = String; module.exports = function (argument) { try { return $String(argument); } catch (error) { return 'Object'; } }; /***/ }), /* 41 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var call = __webpack_require__(30); var isCallable = __webpack_require__(8); var isObject = __webpack_require__(21); var $TypeError = TypeError; // `OrdinaryToPrimitive` abstract operation // https://tc39.es/ecma262/#sec-ordinarytoprimitive module.exports = function (input, pref) { var fn, val; if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val; if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val; if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val; throw new $TypeError("Can't convert object to primitive value"); }; /***/ }), /* 42 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var globalThis = __webpack_require__(17); var shared = __webpack_require__(43); var hasOwn = __webpack_require__(9); var uid = __webpack_require__(44); var NATIVE_SYMBOL = __webpack_require__(35); var USE_SYMBOL_AS_UID = __webpack_require__(34); var Symbol = globalThis.Symbol; var WellKnownSymbolsStore = shared('wks'); var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol['for'] || Symbol : Symbol && Symbol.withoutSetter || uid; module.exports = function (name) { if (!hasOwn(WellKnownSymbolsStore, name)) { WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn(Symbol, name) ? Symbol[name] : createWellKnownSymbol('Symbol.' + name); } return WellKnownSymbolsStore[name]; }; /***/ }), /* 43 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var store = __webpack_require__(15); module.exports = function (key, value) { return store[key] || (store[key] = value || {}); }; /***/ }), /* 44 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var uncurryThis = __webpack_require__(6); var id = 0; var postfix = Math.random(); var toString = uncurryThis(1.0.toString); module.exports = function (key) { return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36); }; /***/ }), /* 45 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function (bitmap, value) { return { enumerable: !(bitmap & 1), configurable: !(bitmap & 2), writable: !(bitmap & 4), value: value }; }; /***/ }), /* 46 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var shared = __webpack_require__(43); var uid = __webpack_require__(44); var keys = shared('keys'); module.exports = function (key) { return keys[key] || (keys[key] = uid(key)); }; /***/ }), /* 47 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = {}; /***/ }), /* 48 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var globalThis = __webpack_require__(17); var uncurryThis = __webpack_require__(49); var arrayBufferByteLength = __webpack_require__(51); var ArrayBuffer = globalThis.ArrayBuffer; var ArrayBufferPrototype = ArrayBuffer && ArrayBuffer.prototype; var slice = ArrayBufferPrototype && uncurryThis(ArrayBufferPrototype.slice); module.exports = function (O) { if (arrayBufferByteLength(O) !== 0) return false; if (!slice) return false; try { slice(O, 0, 0); return false; } catch (error) { return true; } }; /***/ }), /* 49 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var classofRaw = __webpack_require__(50); var uncurryThis = __webpack_require__(6); module.exports = function (fn) { // Nashorn bug: // https://github.com/zloirock/core-js/issues/1128 // https://github.com/zloirock/core-js/issues/1130 if (classofRaw(fn) === 'Function') return uncurryThis(fn); }; /***/ }), /* 50 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var uncurryThis = __webpack_require__(6); var toString = uncurryThis({}.toString); var stringSlice = uncurryThis(''.slice); module.exports = function (it) { return stringSlice(toString(it), 8, -1); }; /***/ }), /* 51 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var globalThis = __webpack_require__(17); var uncurryThisAccessor = __webpack_require__(52); var classof = __webpack_require__(50); var ArrayBuffer = globalThis.ArrayBuffer; var TypeError = globalThis.TypeError; // Includes // - Perform ? RequireInternalSlot(O, [[ArrayBufferData]]). // - If IsSharedArrayBuffer(O) is true, throw a TypeError exception. module.exports = ArrayBuffer && uncurryThisAccessor(ArrayBuffer.prototype, 'byteLength', 'get') || function (O) { if (classof(O) !== 'ArrayBuffer') throw new TypeError('ArrayBuffer expected'); return O.byteLength; }; /***/ }), /* 52 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var uncurryThis = __webpack_require__(6); var aCallable = __webpack_require__(39); module.exports = function (object, key, method) { try { // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe return uncurryThis(aCallable(Object.getOwnPropertyDescriptor(object, key)[method])); } catch (error) { /* empty */ } }; /***/ }), /* 53 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(54); var $transfer = __webpack_require__(73); // `ArrayBuffer.prototype.transfer` method // https://tc39.es/proposal-arraybuffer-transfer/#sec-arraybuffer.prototype.transfer if ($transfer) $({ target: 'ArrayBuffer', proto: true }, { transfer: function transfer() { return $transfer(this, arguments.length ? arguments[0] : undefined, true); } }); /***/ }), /* 54 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var globalThis = __webpack_require__(17); var getOwnPropertyDescriptor = __webpack_require__(55).f; var createNonEnumerableProperty = __webpack_require__(22); var defineBuiltIn = __webpack_require__(59); var defineGlobalProperty = __webpack_require__(18); var copyConstructorProperties = __webpack_require__(60); var isForced = __webpack_require__(72); /* options.target - name of the target object options.global - target is the global object options.stat - export as static methods of target options.proto - export as prototype methods of target options.real - real prototype method for the `pure` version options.forced - export even if the native feature is available options.bind - bind methods to the target, required for the `pure` version options.wrap - wrap constructors to preventing global pollution, required for the `pure` version options.unsafe - use the simple assignment of property instead of delete + defineProperty options.sham - add a flag to not completely full polyfills options.enumerable - export as enumerable property options.dontCallGetSet - prevent calling a getter on target options.name - the .name of the function if it does not match the key */ module.exports = function (options, source) { var TARGET = options.target; var GLOBAL = options.global; var STATIC = options.stat; var FORCED, target, key, targetProperty, sourceProperty, descriptor; if (GLOBAL) { target = globalThis; } else if (STATIC) { target = globalThis[TARGET] || defineGlobalProperty(TARGET, {}); } else { target = globalThis[TARGET] && globalThis[TARGET].prototype; } if (target) for (key in source) { sourceProperty = source[key]; if (options.dontCallGetSet) { descriptor = getOwnPropertyDescriptor(target, key); targetProperty = descriptor && descriptor.value; } else targetProperty = target[key]; FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced); // contained in target if (!FORCED && targetProperty !== undefined) { if (typeof sourceProperty == typeof targetProperty) continue; copyConstructorProperties(sourceProperty, targetProperty); } // add a flag to not completely full polyfills if (options.sham || (targetProperty && targetProperty.sham)) { createNonEnumerableProperty(sourceProperty, 'sham', true); } defineBuiltIn(target, key, sourceProperty, options); } }; /***/ }), /* 55 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var DESCRIPTORS = __webpack_require__(2); var call = __webpack_require__(30); var propertyIsEnumerableModule = __webpack_require__(56); var createPropertyDescriptor = __webpack_require__(45); var toIndexedObject = __webpack_require__(57); var toPropertyKey = __webpack_require__(28); var hasOwn = __webpack_require__(9); var IE8_DOM_DEFINE = __webpack_require__(24); // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; // `Object.getOwnPropertyDescriptor` method // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor exports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) { O = toIndexedObject(O); P = toPropertyKey(P); if (IE8_DOM_DEFINE) try { return $getOwnPropertyDescriptor(O, P); } catch (error) { /* empty */ } if (hasOwn(O, P)) return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]); }; /***/ }), /* 56 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $propertyIsEnumerable = {}.propertyIsEnumerable; // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; // Nashorn ~ JDK8 bug var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1); // `Object.prototype.propertyIsEnumerable` method implementation // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) { var descriptor = getOwnPropertyDescriptor(this, V); return !!descriptor && descriptor.enumerable; } : $propertyIsEnumerable; /***/ }), /* 57 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // toObject with fallback for non-array-like ES3 strings var IndexedObject = __webpack_require__(58); var requireObjectCoercible = __webpack_require__(11); module.exports = function (it) { return IndexedObject(requireObjectCoercible(it)); }; /***/ }), /* 58 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var uncurryThis = __webpack_require__(6); var fails = __webpack_require__(3); var classof = __webpack_require__(50); var $Object = Object; var split = uncurryThis(''.split); // fallback for non-array-like ES3 and non-enumerable old V8 strings module.exports = fails(function () { // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346 // eslint-disable-next-line no-prototype-builtins -- safe return !$Object('z').propertyIsEnumerable(0); }) ? function (it) { return classof(it) === 'String' ? split(it, '') : $Object(it); } : $Object; /***/ }), /* 59 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var isCallable = __webpack_require__(8); var definePropertyModule = __webpack_require__(23); var makeBuiltIn = __webpack_require__(5); var defineGlobalProperty = __webpack_require__(18); module.exports = function (O, key, value, options) { if (!options) options = {}; var simple = options.enumerable; var name = options.name !== undefined ? options.name : key; if (isCallable(value)) makeBuiltIn(value, name, options); if (options.global) { if (simple) O[key] = value; else defineGlobalProperty(key, value); } else { try { if (!options.unsafe) delete O[key]; else if (O[key]) simple = true; } catch (error) { /* empty */ } if (simple) O[key] = value; else definePropertyModule.f(O, key, { value: value, enumerable: false, configurable: !options.nonConfigurable, writable: !options.nonWritable }); } return O; }; /***/ }), /* 60 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var hasOwn = __webpack_require__(9); var ownKeys = __webpack_require__(61); var getOwnPropertyDescriptorModule = __webpack_require__(55); var definePropertyModule = __webpack_require__(23); module.exports = function (target, source, exceptions) { var keys = ownKeys(source); var defineProperty = definePropertyModule.f; var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; for (var i = 0; i < keys.length; i++) { var key = keys[i]; if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) { defineProperty(target, key, getOwnPropertyDescriptor(source, key)); } } }; /***/ }), /* 61 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var getBuiltIn = __webpack_require__(32); var uncurryThis = __webpack_require__(6); var getOwnPropertyNamesModule = __webpack_require__(62); var getOwnPropertySymbolsModule = __webpack_require__(71); var anObject = __webpack_require__(27); var concat = uncurryThis([].concat); // all object keys, includes non-enumerable and symbols module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) { var keys = getOwnPropertyNamesModule.f(anObject(it)); var getOwnPropertySymbols = getOwnPropertySymbolsModule.f; return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys; }; /***/ }), /* 62 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var internalObjectKeys = __webpack_require__(63); var enumBugKeys = __webpack_require__(70); var hiddenKeys = enumBugKeys.concat('length', 'prototype'); // `Object.getOwnPropertyNames` method // https://tc39.es/ecma262/#sec-object.getownpropertynames // eslint-disable-next-line es/no-object-getownpropertynames -- safe exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { return internalObjectKeys(O, hiddenKeys); }; /***/ }), /* 63 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var uncurryThis = __webpack_require__(6); var hasOwn = __webpack_require__(9); var toIndexedObject = __webpack_require__(57); var indexOf = __webpack_require__(64).indexOf; var hiddenKeys = __webpack_require__(47); var push = uncurryThis([].push); module.exports = function (object, names) { var O = toIndexedObject(object); var i = 0; var result = []; var key; for (key in O) !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key); // Don't enum bug & hidden keys while (names.length > i) if (hasOwn(O, key = names[i++])) { ~indexOf(result, key) || push(result, key); } return result; }; /***/ }), /* 64 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var toIndexedObject = __webpack_require__(57); var toAbsoluteIndex = __webpack_require__(65); var lengthOfArrayLike = __webpack_require__(68); // `Array.prototype.{ indexOf, includes }` methods implementation var createMethod = function (IS_INCLUDES) { return function ($this, el, fromIndex) { var O = toIndexedObject($this); var length = lengthOfArrayLike(O); if (length === 0) return !IS_INCLUDES && -1; var index = toAbsoluteIndex(fromIndex, length); var value; // Array#includes uses SameValueZero equality algorithm // eslint-disable-next-line no-self-compare -- NaN check if (IS_INCLUDES && el !== el) while (length > index) { value = O[index++]; // eslint-disable-next-line no-self-compare -- NaN check if (value !== value) return true; // Array#indexOf ignores holes, Array#includes - not } else for (;length > index; index++) { if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0; } return !IS_INCLUDES && -1; }; }; module.exports = { // `Array.prototype.includes` method // https://tc39.es/ecma262/#sec-array.prototype.includes includes: createMethod(true), // `Array.prototype.indexOf` method // https://tc39.es/ecma262/#sec-array.prototype.indexof indexOf: createMethod(false) }; /***/ }), /* 65 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var toIntegerOrInfinity = __webpack_require__(66); var max = Math.max; var min = Math.min; // Helper for a popular repeating case of the spec: // Let integer be ? ToInteger(index). // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length). module.exports = function (index, length) { var integer = toIntegerOrInfinity(index); return integer < 0 ? max(integer + length, 0) : min(integer, length); }; /***/ }), /* 66 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var trunc = __webpack_require__(67); // `ToIntegerOrInfinity` abstract operation // https://tc39.es/ecma262/#sec-tointegerorinfinity module.exports = function (argument) { var number = +argument; // eslint-disable-next-line no-self-compare -- NaN check return number !== number || number === 0 ? 0 : trunc(number); }; /***/ }), /* 67 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var ceil = Math.ceil; var floor = Math.floor; // `Math.trunc` method // https://tc39.es/ecma262/#sec-math.trunc // eslint-disable-next-line es/no-math-trunc -- safe module.exports = Math.trunc || function trunc(x) { var n = +x; return (n > 0 ? floor : ceil)(n); }; /***/ }), /* 68 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var toLength = __webpack_require__(69); // `LengthOfArrayLike` abstract operation // https://tc39.es/ecma262/#sec-lengthofarraylike module.exports = function (obj) { return toLength(obj.length); }; /***/ }), /* 69 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var toIntegerOrInfinity = __webpack_require__(66); var min = Math.min; // `ToLength` abstract operation // https://tc39.es/ecma262/#sec-tolength module.exports = function (argument) { var len = toIntegerOrInfinity(argument); return len > 0 ? min(len, 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991 }; /***/ }), /* 70 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // IE8- don't enum bug keys module.exports = [ 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf' ]; /***/ }), /* 71 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe exports.f = Object.getOwnPropertySymbols; /***/ }), /* 72 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var fails = __webpack_require__(3); var isCallable = __webpack_require__(8); var replacement = /#|\.prototype\./; var isForced = function (feature, detection) { var value = data[normalize(feature)]; return value === POLYFILL ? true : value === NATIVE ? false : isCallable(detection) ? fails(detection) : !!detection; }; var normalize = isForced.normalize = function (string) { return String(string).replace(replacement, '.').toLowerCase(); }; var data = isForced.data = {}; var NATIVE = isForced.NATIVE = 'N'; var POLYFILL = isForced.POLYFILL = 'P'; module.exports = isForced; /***/ }), /* 73 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var globalThis = __webpack_require__(17); var uncurryThis = __webpack_require__(6); var uncurryThisAccessor = __webpack_require__(52); var toIndex = __webpack_require__(74); var notDetached = __webpack_require__(75); var arrayBufferByteLength = __webpack_require__(51); var detachTransferable = __webpack_require__(76); var PROPER_STRUCTURED_CLONE_TRANSFER = __webpack_require__(80); var structuredClone = globalThis.structuredClone; var ArrayBuffer = globalThis.ArrayBuffer; var DataView = globalThis.DataView; var min = Math.min; var ArrayBufferPrototype = ArrayBuffer.prototype; var DataViewPrototype = DataView.prototype; var slice = uncurryThis(ArrayBufferPrototype.slice); var isResizable = uncurryThisAccessor(ArrayBufferPrototype, 'resizable', 'get'); var maxByteLength = uncurryThisAccessor(ArrayBufferPrototype, 'maxByteLength', 'get'); var getInt8 = uncurryThis(DataViewPrototype.getInt8); var setInt8 = uncurryThis(DataViewPrototype.setInt8); module.exports = (PROPER_STRUCTURED_CLONE_TRANSFER || detachTransferable) && function (arrayBuffer, newLength, preserveResizability) { var byteLength = arrayBufferByteLength(arrayBuffer); var newByteLength = newLength === undefined ? byteLength : toIndex(newLength); var fixedLength = !isResizable || !isResizable(arrayBuffer); var newBuffer; notDetached(arrayBuffer); if (PROPER_STRUCTURED_CLONE_TRANSFER) { arrayBuffer = structuredClone(arrayBuffer, { transfer: [arrayBuffer] }); if (byteLength === newByteLength && (preserveResizability || fixedLength)) return arrayBuffer; } if (byteLength >= newByteLength && (!preserveResizability || fixedLength)) { newBuffer = slice(arrayBuffer, 0, newByteLength); } else { var options = preserveResizability && !fixedLength && maxByteLength ? { maxByteLength: maxByteLength(arrayBuffer) } : undefined; newBuffer = new ArrayBuffer(newByteLength, options); var a = new DataView(arrayBuffer); var b = new DataView(newBuffer); var copyLength = min(newByteLength, byteLength); for (var i = 0; i < copyLength; i++) setInt8(b, i, getInt8(a, i)); } if (!PROPER_STRUCTURED_CLONE_TRANSFER) detachTransferable(arrayBuffer); return newBuffer; }; /***/ }), /* 74 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var toIntegerOrInfinity = __webpack_require__(66); var toLength = __webpack_require__(69); var $RangeError = RangeError; // `ToIndex` abstract operation // https://tc39.es/ecma262/#sec-toindex module.exports = function (it) { if (it === undefined) return 0; var number = toIntegerOrInfinity(it); var length = toLength(number); if (number !== length) throw new $RangeError('Wrong length or index'); return length; }; /***/ }), /* 75 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var isDetached = __webpack_require__(48); var $TypeError = TypeError; module.exports = function (it) { if (isDetached(it)) throw new $TypeError('ArrayBuffer is detached'); return it; }; /***/ }), /* 76 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var globalThis = __webpack_require__(17); var getBuiltInNodeModule = __webpack_require__(77); var PROPER_STRUCTURED_CLONE_TRANSFER = __webpack_require__(80); var structuredClone = globalThis.structuredClone; var $ArrayBuffer = globalThis.ArrayBuffer; var $MessageChannel = globalThis.MessageChannel; var detach = false; var WorkerThreads, channel, buffer, $detach; if (PROPER_STRUCTURED_CLONE_TRANSFER) { detach = function (transferable) { structuredClone(transferable, { transfer: [transferable] }); }; } else if ($ArrayBuffer) try { if (!$MessageChannel) { WorkerThreads = getBuiltInNodeModule('worker_threads'); if (WorkerThreads) $MessageChannel = WorkerThreads.MessageChannel; } if ($MessageChannel) { channel = new $MessageChannel(); buffer = new $ArrayBuffer(2); $detach = function (transferable) { channel.port1.postMessage(null, [transferable]); }; if (buffer.byteLength === 2) { $detach(buffer); if (buffer.byteLength === 0) detach = $detach; } } } catch (error) { /* empty */ } module.exports = detach; /***/ }), /* 77 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var globalThis = __webpack_require__(17); var IS_NODE = __webpack_require__(78); module.exports = function (name) { if (IS_NODE) { try { return globalThis.process.getBuiltinModule(name); } catch (error) { /* empty */ } try { // eslint-disable-next-line no-new-func -- safe return Function('return require("' + name + '")')(); } catch (error) { /* empty */ } } }; /***/ }), /* 78 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var ENVIRONMENT = __webpack_require__(79); module.exports = ENVIRONMENT === 'NODE'; /***/ }), /* 79 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* global Bun, Deno -- detection */ var globalThis = __webpack_require__(17); var userAgent = __webpack_require__(37); var classof = __webpack_require__(50); var userAgentStartsWith = function (string) { return userAgent.slice(0, string.length) === string; }; module.exports = (function () { if (userAgentStartsWith('Bun/')) return 'BUN'; if (userAgentStartsWith('Cloudflare-Workers')) return 'CLOUDFLARE'; if (userAgentStartsWith('Deno/')) return 'DENO'; if (userAgentStartsWith('Node.js/')) return 'NODE'; if (globalThis.Bun && typeof Bun.version == 'string') return 'BUN'; if (globalThis.Deno && typeof Deno.version == 'object') return 'DENO'; if (classof(globalThis.process) === 'process') return 'NODE'; if (globalThis.window && globalThis.document) return 'BROWSER'; return 'REST'; })(); /***/ }), /* 80 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var globalThis = __webpack_require__(17); var fails = __webpack_require__(3); var V8 = __webpack_require__(36); var ENVIRONMENT = __webpack_require__(79); var structuredClone = globalThis.structuredClone; module.exports = !!structuredClone && !fails(function () { // prevent V8 ArrayBufferDetaching protector cell invalidation and performance degradation // https://github.com/zloirock/core-js/issues/679 if ((ENVIRONMENT === 'DENO' && V8 > 92) || (ENVIRONMENT === 'NODE' && V8 > 94) || (ENVIRONMENT === 'BROWSER' && V8 > 97)) return false; var buffer = new ArrayBuffer(8); var clone = structuredClone(buffer, { transfer: [buffer] }); return buffer.byteLength !== 0 || clone.byteLength !== 8; }); /***/ }), /* 81 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(54); var $transfer = __webpack_require__(73); // `ArrayBuffer.prototype.transferToFixedLength` method // https://tc39.es/proposal-arraybuffer-transfer/#sec-arraybuffer.prototype.transfertofixedlength if ($transfer) $({ target: 'ArrayBuffer', proto: true }, { transferToFixedLength: function transferToFixedLength() { return $transfer(this, arguments.length ? arguments[0] : undefined, false); } }); /***/ }), /* 82 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(54); var uncurryThis = __webpack_require__(6); var aCallable = __webpack_require__(39); var requireObjectCoercible = __webpack_require__(11); var iterate = __webpack_require__(83); var MapHelpers = __webpack_require__(92); var IS_PURE = __webpack_require__(16); var fails = __webpack_require__(3); var Map = MapHelpers.Map; var has = MapHelpers.has; var get = MapHelpers.get; var set = MapHelpers.set; var push = uncurryThis([].push); var DOES_NOT_WORK_WITH_PRIMITIVES = IS_PURE || fails(function () { return Map.groupBy('ab', function (it) { return it; }).get('a').length !== 1; }); // `Map.groupBy` method // https://tc39.es/ecma262/#sec-map.groupby $({ target: 'Map', stat: true, forced: IS_PURE || DOES_NOT_WORK_WITH_PRIMITIVES }, { groupBy: function groupBy(items, callbackfn) { requireObjectCoercible(items); aCallable(callbackfn); var map = new Map(); var k = 0; iterate(items, function (value) { var key = callbackfn(value, k++); if (!has(map, key)) set(map, key, [value]); else push(get(map, key), value); }); return map; } }); /***/ }), /* 83 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var bind = __webpack_require__(84); var call = __webpack_require__(30); var anObject = __webpack_require__(27); var tryToString = __webpack_require__(40); var isArrayIteratorMethod = __webpack_require__(85); var lengthOfArrayLike = __webpack_require__(68); var isPrototypeOf = __webpack_require__(33); var getIterator = __webpack_require__(87); var getIteratorMethod = __webpack_require__(88); var iteratorClose = __webpack_require__(91); var $TypeError = TypeError; var Result = function (stopped, result) { this.stopped = stopped; this.result = result; }; var ResultPrototype = Result.prototype; module.exports = function (iterable, unboundFunction, options) { var that = options && options.that; var AS_ENTRIES = !!(options && options.AS_ENTRIES); var IS_RECORD = !!(options && options.IS_RECORD); var IS_ITERATOR = !!(options && options.IS_ITERATOR); var INTERRUPTED = !!(options && options.INTERRUPTED); var fn = bind(unboundFunction, that); var iterator, iterFn, index, length, result, next, step; var stop = function (condition) { if (iterator) iteratorClose(iterator, 'normal', condition); return new Result(true, condition); }; var callFn = function (value) { if (AS_ENTRIES) { anObject(value); return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]); } return INTERRUPTED ? fn(value, stop) : fn(value); }; if (IS_RECORD) { iterator = iterable.iterator; } else if (IS_ITERATOR) { iterator = iterable; } else { iterFn = getIteratorMethod(iterable); if (!iterFn) throw new $TypeError(tryToString(iterable) + ' is not iterable'); // optimisation for array iterators if (isArrayIteratorMethod(iterFn)) { for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) { result = callFn(iterable[index]); if (result && isPrototypeOf(ResultPrototype, result)) return result; } return new Result(false); } iterator = getIterator(iterable, iterFn); } next = IS_RECORD ? iterable.next : iterator.next; while (!(step = call(next, iterator)).done) { try { result = callFn(step.value); } catch (error) { iteratorClose(iterator, 'throw', error); } if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result; } return new Result(false); }; /***/ }), /* 84 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var uncurryThis = __webpack_require__(49); var aCallable = __webpack_require__(39); var NATIVE_BIND = __webpack_require__(7); var bind = uncurryThis(uncurryThis.bind); // optional / simple context binding module.exports = function (fn, that) { aCallable(fn); return that === undefined ? fn : NATIVE_BIND ? bind(fn, that) : function (/* ...args */) { return fn.apply(that, arguments); }; }; /***/ }), /* 85 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var wellKnownSymbol = __webpack_require__(42); var Iterators = __webpack_require__(86); var ITERATOR = wellKnownSymbol('iterator'); var ArrayPrototype = Array.prototype; // check on default Array iterator module.exports = function (it) { return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it); }; /***/ }), /* 86 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = {}; /***/ }), /* 87 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var call = __webpack_require__(30); var aCallable = __webpack_require__(39); var anObject = __webpack_require__(27); var tryToString = __webpack_require__(40); var getIteratorMethod = __webpack_require__(88); var $TypeError = TypeError; module.exports = function (argument, usingIterator) { var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator; if (aCallable(iteratorMethod)) return anObject(call(iteratorMethod, argument)); throw new $TypeError(tryToString(argument) + ' is not iterable'); }; /***/ }), /* 88 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var classof = __webpack_require__(89); var getMethod = __webpack_require__(38); var isNullOrUndefined = __webpack_require__(12); var Iterators = __webpack_require__(86); var wellKnownSymbol = __webpack_require__(42); var ITERATOR = wellKnownSymbol('iterator'); module.exports = function (it) { if (!isNullOrUndefined(it)) return getMethod(it, ITERATOR) || getMethod(it, '@@iterator') || Iterators[classof(it)]; }; /***/ }), /* 89 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var TO_STRING_TAG_SUPPORT = __webpack_require__(90); var isCallable = __webpack_require__(8); var classofRaw = __webpack_require__(50); var wellKnownSymbol = __webpack_require__(42); var TO_STRING_TAG = wellKnownSymbol('toStringTag'); var $Object = Object; // ES3 wrong here var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) === 'Arguments'; // fallback for IE11 Script Access Denied error var tryGet = function (it, key) { try { return it[key]; } catch (error) { /* empty */ } }; // getting tag from ES6+ `Object.prototype.toString` module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) { var O, tag, result; return it === undefined ? 'Undefined' : it === null ? 'Null' // @@toStringTag case : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag // builtinTag case : CORRECT_ARGUMENTS ? classofRaw(O) // ES3 arguments fallback : (result = classofRaw(O)) === 'Object' && isCallable(O.callee) ? 'Arguments' : result; }; /***/ }), /* 90 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var wellKnownSymbol = __webpack_require__(42); var TO_STRING_TAG = wellKnownSymbol('toStringTag'); var test = {}; test[TO_STRING_TAG] = 'z'; module.exports = String(test) === '[object z]'; /***/ }), /* 91 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var call = __webpack_require__(30); var anObject = __webpack_require__(27); var getMethod = __webpack_require__(38); module.exports = function (iterator, kind, value) { var innerResult, innerError; anObject(iterator); try { innerResult = getMethod(iterator, 'return'); if (!innerResult) { if (kind === 'throw') throw value; return value; } innerResult = call(innerResult, iterator); } catch (error) { innerError = true; innerResult = error; } if (kind === 'throw') throw value; if (innerError) throw innerResult; anObject(innerResult); return value; }; /***/ }), /* 92 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var uncurryThis = __webpack_require__(6); // eslint-disable-next-line es/no-map -- safe var MapPrototype = Map.prototype; module.exports = { // eslint-disable-next-line es/no-map -- safe Map: Map, set: uncurryThis(MapPrototype.set), get: uncurryThis(MapPrototype.get), has: uncurryThis(MapPrototype.has), remove: uncurryThis(MapPrototype['delete']), proto: MapPrototype }; /***/ }), /* 93 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(54); var getBuiltIn = __webpack_require__(32); var uncurryThis = __webpack_require__(6); var aCallable = __webpack_require__(39); var requireObjectCoercible = __webpack_require__(11); var toPropertyKey = __webpack_require__(28); var iterate = __webpack_require__(83); var fails = __webpack_require__(3); // eslint-disable-next-line es/no-object-groupby -- testing var nativeGroupBy = Object.groupBy; var create = getBuiltIn('Object', 'create'); var push = uncurryThis([].push); var DOES_NOT_WORK_WITH_PRIMITIVES = !nativeGroupBy || fails(function () { return nativeGroupBy('ab', function (it) { return it; }).a.length !== 1; }); // `Object.groupBy` method // https://tc39.es/ecma262/#sec-object.groupby $({ target: 'Object', stat: true, forced: DOES_NOT_WORK_WITH_PRIMITIVES }, { groupBy: function groupBy(items, callbackfn) { requireObjectCoercible(items); aCallable(callbackfn); var obj = create(null); var k = 0; iterate(items, function (value) { var key = toPropertyKey(callbackfn(value, k++)); // in some IE versions, `hasOwnProperty` returns incorrect result on integer keys // but since it's a `null` prototype object, we can safely use `in` if (key in obj) push(obj[key], value); else obj[key] = [value]; }); return obj; } }); /***/ }), /* 94 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(54); var globalThis = __webpack_require__(17); var apply = __webpack_require__(95); var slice = __webpack_require__(96); var newPromiseCapabilityModule = __webpack_require__(97); var aCallable = __webpack_require__(39); var perform = __webpack_require__(98); var Promise = globalThis.Promise; var ACCEPT_ARGUMENTS = false; // Avoiding the use of polyfills of the previous iteration of this proposal // that does not accept arguments of the callback var FORCED = !Promise || !Promise['try'] || perform(function () { Promise['try'](function (argument) { ACCEPT_ARGUMENTS = argument === 8; }, 8); }).error || !ACCEPT_ARGUMENTS; // `Promise.try` method // https://tc39.es/ecma262/#sec-promise.try $({ target: 'Promise', stat: true, forced: FORCED }, { 'try': function (callbackfn /* , ...args */) { var args = arguments.length > 1 ? slice(arguments, 1) : []; var promiseCapability = newPromiseCapabilityModule.f(this); var result = perform(function () { return apply(aCallable(callbackfn), undefined, args); }); (result.error ? promiseCapability.reject : promiseCapability.resolve)(result.value); return promiseCapability.promise; } }); /***/ }), /* 95 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var NATIVE_BIND = __webpack_require__(7); var FunctionPrototype = Function.prototype; var apply = FunctionPrototype.apply; var call = FunctionPrototype.call; // eslint-disable-next-line es/no-reflect -- safe module.exports = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call.bind(apply) : function () { return call.apply(apply, arguments); }); /***/ }), /* 96 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var uncurryThis = __webpack_require__(6); module.exports = uncurryThis([].slice); /***/ }), /* 97 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var aCallable = __webpack_require__(39); var $TypeError = TypeError; var PromiseCapability = function (C) { var resolve, reject; this.promise = new C(function ($$resolve, $$reject) { if (resolve !== undefined || reject !== undefined) throw new $TypeError('Bad Promise constructor'); resolve = $$resolve; reject = $$reject; }); this.resolve = aCallable(resolve); this.reject = aCallable(reject); }; // `NewPromiseCapability` abstract operation // https://tc39.es/ecma262/#sec-newpromisecapability module.exports.f = function (C) { return new PromiseCapability(C); }; /***/ }), /* 98 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function (exec) { try { return { error: false, value: exec() }; } catch (error) { return { error: true, value: error }; } }; /***/ }), /* 99 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(54); var newPromiseCapabilityModule = __webpack_require__(97); // `Promise.withResolvers` method // https://tc39.es/ecma262/#sec-promise.withResolvers $({ target: 'Promise', stat: true }, { withResolvers: function withResolvers() { var promiseCapability = newPromiseCapabilityModule.f(this); return { promise: promiseCapability.promise, resolve: promiseCapability.resolve, reject: promiseCapability.reject }; } }); /***/ }), /* 100 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(54); var globalThis = __webpack_require__(17); var getBuiltIn = __webpack_require__(32); var createPropertyDescriptor = __webpack_require__(45); var defineProperty = __webpack_require__(23).f; var hasOwn = __webpack_require__(9); var anInstance = __webpack_require__(101); var inheritIfRequired = __webpack_require__(102); var normalizeStringArgument = __webpack_require__(106); var DOMExceptionConstants = __webpack_require__(108); var clearErrorStack = __webpack_require__(109); var DESCRIPTORS = __webpack_require__(2); var IS_PURE = __webpack_require__(16); var DOM_EXCEPTION = 'DOMException'; var Error = getBuiltIn('Error'); var NativeDOMException = getBuiltIn(DOM_EXCEPTION); var $DOMException = function DOMException() { anInstance(this, DOMExceptionPrototype); var argumentsLength = arguments.length; var message = normalizeStringArgument(argumentsLength < 1 ? undefined : arguments[0]); var name = normalizeStringArgument(argumentsLength < 2 ? undefined : arguments[1], 'Error'); var that = new NativeDOMException(message, name); var error = new Error(message); error.name = DOM_EXCEPTION; defineProperty(that, 'stack', createPropertyDescriptor(1, clearErrorStack(error.stack, 1))); inheritIfRequired(that, this, $DOMException); return that; }; var DOMExceptionPrototype = $DOMException.prototype = NativeDOMException.prototype; var ERROR_HAS_STACK = 'stack' in new Error(DOM_EXCEPTION); var DOM_EXCEPTION_HAS_STACK = 'stack' in new NativeDOMException(1, 2); // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var descriptor = NativeDOMException && DESCRIPTORS && Object.getOwnPropertyDescriptor(globalThis, DOM_EXCEPTION); // Bun ~ 0.1.1 DOMException have incorrect descriptor and we can't redefine it // https://github.com/Jarred-Sumner/bun/issues/399 var BUGGY_DESCRIPTOR = !!descriptor && !(descriptor.writable && descriptor.configurable); var FORCED_CONSTRUCTOR = ERROR_HAS_STACK && !BUGGY_DESCRIPTOR && !DOM_EXCEPTION_HAS_STACK; // `DOMException` constructor patch for `.stack` where it's required // https://webidl.spec.whatwg.org/#es-DOMException-specialness $({ global: true, constructor: true, forced: IS_PURE || FORCED_CONSTRUCTOR }, { // TODO: fix export logic DOMException: FORCED_CONSTRUCTOR ? $DOMException : NativeDOMException }); var PolyfilledDOMException = getBuiltIn(DOM_EXCEPTION); var PolyfilledDOMExceptionPrototype = PolyfilledDOMException.prototype; if (PolyfilledDOMExceptionPrototype.constructor !== PolyfilledDOMException) { if (!IS_PURE) { defineProperty(PolyfilledDOMExceptionPrototype, 'constructor', createPropertyDescriptor(1, PolyfilledDOMException)); } for (var key in DOMExceptionConstants) if (hasOwn(DOMExceptionConstants, key)) { var constant = DOMExceptionConstants[key]; var constantName = constant.s; if (!hasOwn(PolyfilledDOMException, constantName)) { defineProperty(PolyfilledDOMException, constantName, createPropertyDescriptor(6, constant.c)); } } } /***/ }), /* 101 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var isPrototypeOf = __webpack_require__(33); var $TypeError = TypeError; module.exports = function (it, Prototype) { if (isPrototypeOf(Prototype, it)) return it; throw new $TypeError('Incorrect invocation'); }; /***/ }), /* 102 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var isCallable = __webpack_require__(8); var isObject = __webpack_require__(21); var setPrototypeOf = __webpack_require__(103); // makes subclassing work correct for wrapped built-ins module.exports = function ($this, dummy, Wrapper) { var NewTarget, NewTargetPrototype; if ( // it can work only with native `setPrototypeOf` setPrototypeOf && // we haven't completely correct pre-ES6 way for getting `new.target`, so use this isCallable(NewTarget = dummy.constructor) && NewTarget !== Wrapper && isObject(NewTargetPrototype = NewTarget.prototype) && NewTargetPrototype !== Wrapper.prototype ) setPrototypeOf($this, NewTargetPrototype); return $this; }; /***/ }), /* 103 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* eslint-disable no-proto -- safe */ var uncurryThisAccessor = __webpack_require__(52); var isObject = __webpack_require__(21); var requireObjectCoercible = __webpack_require__(11); var aPossiblePrototype = __webpack_require__(104); // `Object.setPrototypeOf` method // https://tc39.es/ecma262/#sec-object.setprototypeof // Works with __proto__ only. Old v8 can't work with null proto objects. // eslint-disable-next-line es/no-object-setprototypeof -- safe module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () { var CORRECT_SETTER = false; var test = {}; var setter; try { setter = uncurryThisAccessor(Object.prototype, '__proto__', 'set'); setter(test, []); CORRECT_SETTER = test instanceof Array; } catch (error) { /* empty */ } return function setPrototypeOf(O, proto) { requireObjectCoercible(O); aPossiblePrototype(proto); if (!isObject(O)) return O; if (CORRECT_SETTER) setter(O, proto); else O.__proto__ = proto; return O; }; }() : undefined); /***/ }), /* 104 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var isPossiblePrototype = __webpack_require__(105); var $String = String; var $TypeError = TypeError; module.exports = function (argument) { if (isPossiblePrototype(argument)) return argument; throw new $TypeError("Can't set " + $String(argument) + ' as a prototype'); }; /***/ }), /* 105 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var isObject = __webpack_require__(21); module.exports = function (argument) { return isObject(argument) || argument === null; }; /***/ }), /* 106 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var toString = __webpack_require__(107); module.exports = function (argument, $default) { return argument === undefined ? arguments.length < 2 ? '' : $default : toString(argument); }; /***/ }), /* 107 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var classof = __webpack_require__(89); var $String = String; module.exports = function (argument) { if (classof(argument) === 'Symbol') throw new TypeError('Cannot convert a Symbol value to a string'); return $String(argument); }; /***/ }), /* 108 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = { IndexSizeError: { s: 'INDEX_SIZE_ERR', c: 1, m: 1 }, DOMStringSizeError: { s: 'DOMSTRING_SIZE_ERR', c: 2, m: 0 }, HierarchyRequestError: { s: 'HIERARCHY_REQUEST_ERR', c: 3, m: 1 }, WrongDocumentError: { s: 'WRONG_DOCUMENT_ERR', c: 4, m: 1 }, InvalidCharacterError: { s: 'INVALID_CHARACTER_ERR', c: 5, m: 1 }, NoDataAllowedError: { s: 'NO_DATA_ALLOWED_ERR', c: 6, m: 0 }, NoModificationAllowedError: { s: 'NO_MODIFICATION_ALLOWED_ERR', c: 7, m: 1 }, NotFoundError: { s: 'NOT_FOUND_ERR', c: 8, m: 1 }, NotSupportedError: { s: 'NOT_SUPPORTED_ERR', c: 9, m: 1 }, InUseAttributeError: { s: 'INUSE_ATTRIBUTE_ERR', c: 10, m: 1 }, InvalidStateError: { s: 'INVALID_STATE_ERR', c: 11, m: 1 }, SyntaxError: { s: 'SYNTAX_ERR', c: 12, m: 1 }, InvalidModificationError: { s: 'INVALID_MODIFICATION_ERR', c: 13, m: 1 }, NamespaceError: { s: 'NAMESPACE_ERR', c: 14, m: 1 }, InvalidAccessError: { s: 'INVALID_ACCESS_ERR', c: 15, m: 1 }, ValidationError: { s: 'VALIDATION_ERR', c: 16, m: 0 }, TypeMismatchError: { s: 'TYPE_MISMATCH_ERR', c: 17, m: 1 }, SecurityError: { s: 'SECURITY_ERR', c: 18, m: 1 }, NetworkError: { s: 'NETWORK_ERR', c: 19, m: 1 }, AbortError: { s: 'ABORT_ERR', c: 20, m: 1 }, URLMismatchError: { s: 'URL_MISMATCH_ERR', c: 21, m: 1 }, QuotaExceededError: { s: 'QUOTA_EXCEEDED_ERR', c: 22, m: 1 }, TimeoutError: { s: 'TIMEOUT_ERR', c: 23, m: 1 }, InvalidNodeTypeError: { s: 'INVALID_NODE_TYPE_ERR', c: 24, m: 1 }, DataCloneError: { s: 'DATA_CLONE_ERR', c: 25, m: 1 } }; /***/ }), /* 109 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var uncurryThis = __webpack_require__(6); var $Error = Error; var replace = uncurryThis(''.replace); var TEST = (function (arg) { return String(new $Error(arg).stack); })('zxcasd'); // eslint-disable-next-line redos/no-vulnerable, sonarjs/slow-regex -- safe var V8_OR_CHAKRA_STACK_ENTRY = /\n\s*at [^:]*:[^\n]*/; var IS_V8_OR_CHAKRA_STACK = V8_OR_CHAKRA_STACK_ENTRY.test(TEST); module.exports = function (stack, dropEntries) { if (IS_V8_OR_CHAKRA_STACK && typeof stack == 'string' && !$Error.prepareStackTrace) { while (dropEntries--) stack = replace(stack, V8_OR_CHAKRA_STACK_ENTRY, ''); } return stack; }; /***/ }), /* 110 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var IS_PURE = __webpack_require__(16); var $ = __webpack_require__(54); var globalThis = __webpack_require__(17); var getBuiltIn = __webpack_require__(32); var uncurryThis = __webpack_require__(6); var fails = __webpack_require__(3); var uid = __webpack_require__(44); var isCallable = __webpack_require__(8); var isConstructor = __webpack_require__(111); var isNullOrUndefined = __webpack_require__(12); var isObject = __webpack_require__(21); var isSymbol = __webpack_require__(31); var iterate = __webpack_require__(83); var anObject = __webpack_require__(27); var classof = __webpack_require__(89); var hasOwn = __webpack_require__(9); var createProperty = __webpack_require__(112); var createNonEnumerableProperty = __webpack_require__(22); var lengthOfArrayLike = __webpack_require__(68); var validateArgumentsLength = __webpack_require__(113); var getRegExpFlags = __webpack_require__(114); var MapHelpers = __webpack_require__(92); var SetHelpers = __webpack_require__(116); var setIterate = __webpack_require__(117); var detachTransferable = __webpack_require__(76); var ERROR_STACK_INSTALLABLE = __webpack_require__(119); var PROPER_STRUCTURED_CLONE_TRANSFER = __webpack_require__(80); var Object = globalThis.Object; var Array = globalThis.Array; var Date = globalThis.Date; var Error = globalThis.Error; var TypeError = globalThis.TypeError; var PerformanceMark = globalThis.PerformanceMark; var DOMException = getBuiltIn('DOMException'); var Map = MapHelpers.Map; var mapHas = MapHelpers.has; var mapGet = MapHelpers.get; var mapSet = MapHelpers.set; var Set = SetHelpers.Set; var setAdd = SetHelpers.add; var setHas = SetHelpers.has; var objectKeys = getBuiltIn('Object', 'keys'); var push = uncurryThis([].push); var thisBooleanValue = uncurryThis(true.valueOf); var thisNumberValue = uncurryThis(1.0.valueOf); var thisStringValue = uncurryThis(''.valueOf); var thisTimeValue = uncurryThis(Date.prototype.getTime); var PERFORMANCE_MARK = uid('structuredClone'); var DATA_CLONE_ERROR = 'DataCloneError'; var TRANSFERRING = 'Transferring'; var checkBasicSemantic = function (structuredCloneImplementation) { return !fails(function () { var set1 = new globalThis.Set([7]); var set2 = structuredCloneImplementation(set1); var number = structuredCloneImplementation(Object(7)); return set2 === set1 || !set2.has(7) || !isObject(number) || +number !== 7; }) && structuredCloneImplementation; }; var checkErrorsCloning = function (structuredCloneImplementation, $Error) { return !fails(function () { var error = new $Error(); var test = structuredCloneImplementation({ a: error, b: error }); return !(test && test.a === test.b && test.a instanceof $Error && test.a.stack === error.stack); }); }; // https://github.com/whatwg/html/pull/5749 var checkNewErrorsCloningSemantic = function (structuredCloneImplementation) { return !fails(function () { var test = structuredCloneImplementation(new globalThis.AggregateError([1], PERFORMANCE_MARK, { cause: 3 })); return test.name !== 'AggregateError' || test.errors[0] !== 1 || test.message !== PERFORMANCE_MARK || test.cause !== 3; }); }; // FF94+, Safari 15.4+, Chrome 98+, NodeJS 17.0+, Deno 1.13+ // FF<103 and Safari implementations can't clone errors // https://bugzilla.mozilla.org/show_bug.cgi?id=1556604 // FF103 can clone errors, but `.stack` of clone is an empty string // https://bugzilla.mozilla.org/show_bug.cgi?id=1778762 // FF104+ fixed it on usual errors, but not on DOMExceptions // https://bugzilla.mozilla.org/show_bug.cgi?id=1777321 // Chrome <102 returns `null` if cloned object contains multiple references to one error // https://bugs.chromium.org/p/v8/issues/detail?id=12542 // NodeJS implementation can't clone DOMExceptions // https://github.com/nodejs/node/issues/41038 // only FF103+ supports new (html/5749) error cloning semantic var nativeStructuredClone = globalThis.structuredClone; var FORCED_REPLACEMENT = IS_PURE || !checkErrorsCloning(nativeStructuredClone, Error) || !checkErrorsCloning(nativeStructuredClone, DOMException) || !checkNewErrorsCloningSemantic(nativeStructuredClone); // Chrome 82+, Safari 14.1+, Deno 1.11+ // Chrome 78-81 implementation swaps `.name` and `.message` of cloned `DOMException` // Chrome returns `null` if cloned object contains multiple references to one error // Safari 14.1 implementation doesn't clone some `RegExp` flags, so requires a workaround // Safari implementation can't clone errors // Deno 1.2-1.10 implementations too naive // NodeJS 16.0+ does not have `PerformanceMark` constructor // NodeJS <17.2 structured cloning implementation from `performance.mark` is too naive // and can't clone, for example, `RegExp` or some boxed primitives // https://github.com/nodejs/node/issues/40840 // no one of those implementations supports new (html/5749) error cloning semantic var structuredCloneFromMark = !nativeStructuredClone && checkBasicSemantic(function (value) { return new PerformanceMark(PERFORMANCE_MARK, { detail: value }).detail; }); var nativeRestrictedStructuredClone = checkBasicSemantic(nativeStructuredClone) || structuredCloneFromMark; var throwUncloneable = function (type) { throw new DOMException('Uncloneable type: ' + type, DATA_CLONE_ERROR); }; var throwUnpolyfillable = function (type, action) { throw new DOMException((action || 'Cloning') + ' of ' + type + ' cannot be properly polyfilled in this engine', DATA_CLONE_ERROR); }; var tryNativeRestrictedStructuredClone = function (value, type) { if (!nativeRestrictedStructuredClone) throwUnpolyfillable(type); return nativeRestrictedStructuredClone(value); }; var createDataTransfer = function () { var dataTransfer; try { dataTransfer = new globalThis.DataTransfer(); } catch (error) { try { dataTransfer = new globalThis.ClipboardEvent('').clipboardData; } catch (error2) { /* empty */ } } return dataTransfer && dataTransfer.items && dataTransfer.files ? dataTransfer : null; }; var cloneBuffer = function (value, map, $type) { if (mapHas(map, value)) return mapGet(map, value); var type = $type || classof(value); var clone, length, options, source, target, i; if (type === 'SharedArrayBuffer') { if (nativeRestrictedStructuredClone) clone = nativeRestrictedStructuredClone(value); // SharedArrayBuffer should use shared memory, we can't polyfill it, so return the original else clone = value; } else { var DataView = globalThis.DataView; // `ArrayBuffer#slice` is not available in IE10 // `ArrayBuffer#slice` and `DataView` are not available in old FF if (!DataView && !isCallable(value.slice)) throwUnpolyfillable('ArrayBuffer'); // detached buffers throws in `DataView` and `.slice` try { if (isCallable(value.slice) && !value.resizable) { clone = value.slice(0); } else { length = value.byteLength; options = 'maxByteLength' in value ? { maxByteLength: value.maxByteLength } : undefined; // eslint-disable-next-line es/no-resizable-and-growable-arraybuffers -- safe clone = new ArrayBuffer(length, options); source = new DataView(value); target = new DataView(clone); for (i = 0; i < length; i++) { target.setUint8(i, source.getUint8(i)); } } } catch (error) { throw new DOMException('ArrayBuffer is detached', DATA_CLONE_ERROR); } } mapSet(map, value, clone); return clone; }; var cloneView = function (value, type, offset, length, map) { var C = globalThis[type]; // in some old engines like Safari 9, typeof C is 'object' // on Uint8ClampedArray or some other constructors if (!isObject(C)) throwUnpolyfillable(type); return new C(cloneBuffer(value.buffer, map), offset, length); }; var structuredCloneInternal = function (value, map) { if (isSymbol(value)) throwUncloneable('Symbol'); if (!isObject(value)) return value; // effectively preserves circular references if (map) { if (mapHas(map, value)) return mapGet(map, value); } else map = new Map(); var type = classof(value); var C, name, cloned, dataTransfer, i, length, keys, key; switch (type) { case 'Array': cloned = Array(lengthOfArrayLike(value)); break; case 'Object': cloned = {}; break; case 'Map': cloned = new Map(); break; case 'Set': cloned = new Set(); break; case 'RegExp': // in this block because of a Safari 14.1 bug // old FF does not clone regexes passed to the constructor, so get the source and flags directly cloned = new RegExp(value.source, getRegExpFlags(value)); break; case 'Error': name = value.name; switch (name) { case 'AggregateError': cloned = new (getBuiltIn(name))([]); break; case 'EvalError': case 'RangeError': case 'ReferenceError': case 'SuppressedError': case 'SyntaxError': case 'TypeError': case 'URIError': cloned = new (getBuiltIn(name))(); break; case 'CompileError': case 'LinkError': case 'RuntimeError': cloned = new (getBuiltIn('WebAssembly', name))(); break; default: cloned = new Error(); } break; case 'DOMException': cloned = new DOMException(value.message, value.name); break; case 'ArrayBuffer': case 'SharedArrayBuffer': cloned = cloneBuffer(value, map, type); break; case 'DataView': case 'Int8Array': case 'Uint8Array': case 'Uint8ClampedArray': case 'Int16Array': case 'Uint16Array': case 'Int32Array': case 'Uint32Array': case 'Float16Array': case 'Float32Array': case 'Float64Array': case 'BigInt64Array': case 'BigUint64Array': length = type === 'DataView' ? value.byteLength : value.length; cloned = cloneView(value, type, value.byteOffset, length, map); break; case 'DOMQuad': try { cloned = new DOMQuad( structuredCloneInternal(value.p1, map), structuredCloneInternal(value.p2, map), structuredCloneInternal(value.p3, map), structuredCloneInternal(value.p4, map) ); } catch (error) { cloned = tryNativeRestrictedStructuredClone(value, type); } break; case 'File': if (nativeRestrictedStructuredClone) try { cloned = nativeRestrictedStructuredClone(value); // NodeJS 20.0.0 bug, https://github.com/nodejs/node/issues/47612 if (classof(cloned) !== type) cloned = undefined; } catch (error) { /* empty */ } if (!cloned) try { cloned = new File([value], value.name, value); } catch (error) { /* empty */ } if (!cloned) throwUnpolyfillable(type); break; case 'FileList': dataTransfer = createDataTransfer(); if (dataTransfer) { for (i = 0, length = lengthOfArrayLike(value); i < length; i++) { dataTransfer.items.add(structuredCloneInternal(value[i], map)); } cloned = dataTransfer.files; } else cloned = tryNativeRestrictedStructuredClone(value, type); break; case 'ImageData': // Safari 9 ImageData is a constructor, but typeof ImageData is 'object' try { cloned = new ImageData( structuredCloneInternal(value.data, map), value.width, value.height, { colorSpace: value.colorSpace } ); } catch (error) { cloned = tryNativeRestrictedStructuredClone(value, type); } break; default: if (nativeRestrictedStructuredClone) { cloned = nativeRestrictedStructuredClone(value); } else switch (type) { case 'BigInt': // can be a 3rd party polyfill cloned = Object(value.valueOf()); break; case 'Boolean': cloned = Object(thisBooleanValue(value)); break; case 'Number': cloned = Object(thisNumberValue(value)); break; case 'String': cloned = Object(thisStringValue(value)); break; case 'Date': cloned = new Date(thisTimeValue(value)); break; case 'Blob': try { cloned = value.slice(0, value.size, value.type); } catch (error) { throwUnpolyfillable(type); } break; case 'DOMPoint': case 'DOMPointReadOnly': C = globalThis[type]; try { cloned = C.fromPoint ? C.fromPoint(value) : new C(value.x, value.y, value.z, value.w); } catch (error) { throwUnpolyfillable(type); } break; case 'DOMRect': case 'DOMRectReadOnly': C = globalThis[type]; try { cloned = C.fromRect ? C.fromRect(value) : new C(value.x, value.y, value.width, value.height); } catch (error) { throwUnpolyfillable(type); } break; case 'DOMMatrix': case 'DOMMatrixReadOnly': C = globalThis[type]; try { cloned = C.fromMatrix ? C.fromMatrix(value) : new C(value); } catch (error) { throwUnpolyfillable(type); } break; case 'AudioData': case 'VideoFrame': if (!isCallable(value.clone)) throwUnpolyfillable(type); try { cloned = value.clone(); } catch (error) { throwUncloneable(type); } break; case 'CropTarget': case 'CryptoKey': case 'FileSystemDirectoryHandle': case 'FileSystemFileHandle': case 'FileSystemHandle': case 'GPUCompilationInfo': case 'GPUCompilationMessage': case 'ImageBitmap': case 'RTCCertificate': case 'WebAssembly.Module': throwUnpolyfillable(type); // break omitted default: throwUncloneable(type); } } mapSet(map, value, cloned); switch (type) { case 'Array': case 'Object': keys = objectKeys(value); for (i = 0, length = lengthOfArrayLike(keys); i < length; i++) { key = keys[i]; createProperty(cloned, key, structuredCloneInternal(value[key], map)); } break; case 'Map': value.forEach(function (v, k) { mapSet(cloned, structuredCloneInternal(k, map), structuredCloneInternal(v, map)); }); break; case 'Set': value.forEach(function (v) { setAdd(cloned, structuredCloneInternal(v, map)); }); break; case 'Error': createNonEnumerableProperty(cloned, 'message', structuredCloneInternal(value.message, map)); if (hasOwn(value, 'cause')) { createNonEnumerableProperty(cloned, 'cause', structuredCloneInternal(value.cause, map)); } if (name === 'AggregateError') { cloned.errors = structuredCloneInternal(value.errors, map); } else if (name === 'SuppressedError') { cloned.error = structuredCloneInternal(value.error, map); cloned.suppressed = structuredCloneInternal(value.suppressed, map); } // break omitted case 'DOMException': if (ERROR_STACK_INSTALLABLE) { createNonEnumerableProperty(cloned, 'stack', structuredCloneInternal(value.stack, map)); } } return cloned; }; var tryToTransfer = function (rawTransfer, map) { if (!isObject(rawTransfer)) throw new TypeError('Transfer option cannot be converted to a sequence'); var transfer = []; iterate(rawTransfer, function (value) { push(transfer, anObject(value)); }); var i = 0; var length = lengthOfArrayLike(transfer); var buffers = new Set(); var value, type, C, transferred, canvas, context; while (i < length) { value = transfer[i++]; type = classof(value); if (type === 'ArrayBuffer' ? setHas(buffers, value) : mapHas(map, value)) { throw new DOMException('Duplicate transferable', DATA_CLONE_ERROR); } if (type === 'ArrayBuffer') { setAdd(buffers, value); continue; } if (PROPER_STRUCTURED_CLONE_TRANSFER) { transferred = nativeStructuredClone(value, { transfer: [value] }); } else switch (type) { case 'ImageBitmap': C = globalThis.OffscreenCanvas; if (!isConstructor(C)) throwUnpolyfillable(type, TRANSFERRING); try { canvas = new C(value.width, value.height); context = canvas.getContext('bitmaprenderer'); context.transferFromImageBitmap(value); transferred = canvas.transferToImageBitmap(); } catch (error) { /* empty */ } break; case 'AudioData': case 'VideoFrame': if (!isCallable(value.clone) || !isCallable(value.close)) throwUnpolyfillable(type, TRANSFERRING); try { transferred = value.clone(); value.close(); } catch (error) { /* empty */ } break; case 'MediaSourceHandle': case 'MessagePort': case 'MIDIAccess': case 'OffscreenCanvas': case 'ReadableStream': case 'RTCDataChannel': case 'TransformStream': case 'WebTransportReceiveStream': case 'WebTransportSendStream': case 'WritableStream': throwUnpolyfillable(type, TRANSFERRING); } if (transferred === undefined) throw new DOMException('This object cannot be transferred: ' + type, DATA_CLONE_ERROR); mapSet(map, value, transferred); } return buffers; }; var detachBuffers = function (buffers) { setIterate(buffers, function (buffer) { if (PROPER_STRUCTURED_CLONE_TRANSFER) { nativeRestrictedStructuredClone(buffer, { transfer: [buffer] }); } else if (isCallable(buffer.transfer)) { buffer.transfer(); } else if (detachTransferable) { detachTransferable(buffer); } else { throwUnpolyfillable('ArrayBuffer', TRANSFERRING); } }); }; // `structuredClone` method // https://html.spec.whatwg.org/multipage/structured-data.html#dom-structuredclone $({ global: true, enumerable: true, sham: !PROPER_STRUCTURED_CLONE_TRANSFER, forced: FORCED_REPLACEMENT }, { structuredClone: function structuredClone(value /* , { transfer } */) { var options = validateArgumentsLength(arguments.length, 1) > 1 && !isNullOrUndefined(arguments[1]) ? anObject(arguments[1]) : undefined; var transfer = options ? options.transfer : undefined; var map, buffers; if (transfer !== undefined) { map = new Map(); buffers = tryToTransfer(transfer, map); } var clone = structuredCloneInternal(value, map); // since of an issue with cloning views of transferred buffers, we a forced to detach them later // https://github.com/zloirock/core-js/issues/1265 if (buffers) detachBuffers(buffers); return clone; } }); /***/ }), /* 111 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var uncurryThis = __webpack_require__(6); var fails = __webpack_require__(3); var isCallable = __webpack_require__(8); var classof = __webpack_require__(89); var getBuiltIn = __webpack_require__(32); var inspectSource = __webpack_require__(14); var noop = function () { /* empty */ }; var construct = getBuiltIn('Reflect', 'construct'); var constructorRegExp = /^\s*(?:class|function)\b/; var exec = uncurryThis(constructorRegExp.exec); var INCORRECT_TO_STRING = !constructorRegExp.test(noop); var isConstructorModern = function isConstructor(argument) { if (!isCallable(argument)) return false; try { construct(noop, [], argument); return true; } catch (error) { return false; } }; var isConstructorLegacy = function isConstructor(argument) { if (!isCallable(argument)) return false; switch (classof(argument)) { case 'AsyncFunction': case 'GeneratorFunction': case 'AsyncGeneratorFunction': return false; } try { // we can't check .prototype since constructors produced by .bind haven't it // `Function#toString` throws on some built-it function in some legacy engines // (for example, `DOMQuad` and similar in FF41-) return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument)); } catch (error) { return true; } }; isConstructorLegacy.sham = true; // `IsConstructor` abstract operation // https://tc39.es/ecma262/#sec-isconstructor module.exports = !construct || fails(function () { var called; return isConstructorModern(isConstructorModern.call) || !isConstructorModern(Object) || !isConstructorModern(function () { called = true; }) || called; }) ? isConstructorLegacy : isConstructorModern; /***/ }), /* 112 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var DESCRIPTORS = __webpack_require__(2); var definePropertyModule = __webpack_require__(23); var createPropertyDescriptor = __webpack_require__(45); module.exports = function (object, key, value) { if (DESCRIPTORS) definePropertyModule.f(object, key, createPropertyDescriptor(0, value)); else object[key] = value; }; /***/ }), /* 113 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $TypeError = TypeError; module.exports = function (passed, required) { if (passed < required) throw new $TypeError('Not enough arguments'); return passed; }; /***/ }), /* 114 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var call = __webpack_require__(30); var hasOwn = __webpack_require__(9); var isPrototypeOf = __webpack_require__(33); var regExpFlags = __webpack_require__(115); var RegExpPrototype = RegExp.prototype; module.exports = function (R) { var flags = R.flags; return flags === undefined && !('flags' in RegExpPrototype) && !hasOwn(R, 'flags') && isPrototypeOf(RegExpPrototype, R) ? call(regExpFlags, R) : flags; }; /***/ }), /* 115 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var anObject = __webpack_require__(27); // `RegExp.prototype.flags` getter implementation // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags module.exports = function () { var that = anObject(this); var result = ''; if (that.hasIndices) result += 'd'; if (that.global) result += 'g'; if (that.ignoreCase) result += 'i'; if (that.multiline) result += 'm'; if (that.dotAll) result += 's'; if (that.unicode) result += 'u'; if (that.unicodeSets) result += 'v'; if (that.sticky) result += 'y'; return result; }; /***/ }), /* 116 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var uncurryThis = __webpack_require__(6); // eslint-disable-next-line es/no-set -- safe var SetPrototype = Set.prototype; module.exports = { // eslint-disable-next-line es/no-set -- safe Set: Set, add: uncurryThis(SetPrototype.add), has: uncurryThis(SetPrototype.has), remove: uncurryThis(SetPrototype['delete']), proto: SetPrototype }; /***/ }), /* 117 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var uncurryThis = __webpack_require__(6); var iterateSimple = __webpack_require__(118); var SetHelpers = __webpack_require__(116); var Set = SetHelpers.Set; var SetPrototype = SetHelpers.proto; var forEach = uncurryThis(SetPrototype.forEach); var keys = uncurryThis(SetPrototype.keys); var next = keys(new Set()).next; module.exports = function (set, fn, interruptible) { return interruptible ? iterateSimple({ iterator: keys(set), next: next }, fn) : forEach(set, fn); }; /***/ }), /* 118 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var call = __webpack_require__(30); module.exports = function (record, fn, ITERATOR_INSTEAD_OF_RECORD) { var iterator = ITERATOR_INSTEAD_OF_RECORD ? record : record.iterator; var next = record.next; var step, result; while (!(step = call(next, iterator)).done) { result = fn(step.value); if (result !== undefined) return result; } }; /***/ }), /* 119 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var fails = __webpack_require__(3); var createPropertyDescriptor = __webpack_require__(45); module.exports = !fails(function () { var error = new Error('a'); if (!('stack' in error)) return true; // eslint-disable-next-line es/no-object-defineproperty -- safe Object.defineProperty(error, 'stack', createPropertyDescriptor(1, 7)); return error.stack !== 7; }); /***/ }), /* 120 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(54); var getBuiltIn = __webpack_require__(32); var fails = __webpack_require__(3); var validateArgumentsLength = __webpack_require__(113); var toString = __webpack_require__(107); var USE_NATIVE_URL = __webpack_require__(121); var URL = getBuiltIn('URL'); // https://github.com/nodejs/node/issues/47505 // https://github.com/denoland/deno/issues/18893 var THROWS_WITHOUT_ARGUMENTS = USE_NATIVE_URL && fails(function () { URL.canParse(); }); // Bun ~ 1.0.30 bug // https://github.com/oven-sh/bun/issues/9250 var WRONG_ARITY = fails(function () { return URL.canParse.length !== 1; }); // `URL.canParse` method // https://url.spec.whatwg.org/#dom-url-canparse $({ target: 'URL', stat: true, forced: !THROWS_WITHOUT_ARGUMENTS || WRONG_ARITY }, { canParse: function canParse(url) { var length = validateArgumentsLength(arguments.length, 1); var urlString = toString(url); var base = length < 2 || arguments[1] === undefined ? undefined : toString(arguments[1]); try { return !!new URL(urlString, base); } catch (error) { return false; } } }); /***/ }), /* 121 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var fails = __webpack_require__(3); var wellKnownSymbol = __webpack_require__(42); var DESCRIPTORS = __webpack_require__(2); var IS_PURE = __webpack_require__(16); var ITERATOR = wellKnownSymbol('iterator'); module.exports = !fails(function () { // eslint-disable-next-line unicorn/relative-url-style -- required for testing var url = new URL('b?a=1&b=2&c=3', 'https://a'); var params = url.searchParams; var params2 = new URLSearchParams('a=1&a=2&b=3'); var result = ''; url.pathname = 'c%20d'; params.forEach(function (value, key) { params['delete']('b'); result += key + value; }); params2['delete']('a', 2); // `undefined` case is a Chromium 117 bug // https://bugs.chromium.org/p/v8/issues/detail?id=14222 params2['delete']('b', undefined); return (IS_PURE && (!url.toJSON || !params2.has('a', 1) || params2.has('a', 2) || !params2.has('a', undefined) || params2.has('b'))) || (!params.size && (IS_PURE || !DESCRIPTORS)) || !params.sort || url.href !== 'https://a/c%20d?a=1&c=3' || params.get('c') !== '3' || String(new URLSearchParams('?a=1')) !== 'a=1' || !params[ITERATOR] // throws in Edge || new URL('https://a@b').username !== 'a' || new URLSearchParams(new URLSearchParams('a=b')).get('a') !== 'b' // not punycoded in Edge || new URL('https://тест').host !== 'xn--e1aybc' // not escaped in Chrome 62- || new URL('https://a#б').hash !== '#%D0%B1' // fails in Chrome 66- || result !== 'a1c3' // throws in Safari || new URL('https://x', undefined).host !== 'x'; }); /***/ }), /* 122 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(54); var getBuiltIn = __webpack_require__(32); var validateArgumentsLength = __webpack_require__(113); var toString = __webpack_require__(107); var USE_NATIVE_URL = __webpack_require__(121); var URL = getBuiltIn('URL'); // `URL.parse` method // https://url.spec.whatwg.org/#dom-url-canparse $({ target: 'URL', stat: true, forced: !USE_NATIVE_URL }, { parse: function parse(url) { var length = validateArgumentsLength(arguments.length, 1); var urlString = toString(url); var base = length < 2 || arguments[1] === undefined ? undefined : toString(arguments[1]); try { return new URL(urlString, base); } catch (error) { return null; } } }); /***/ }), /* 123 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var defineBuiltIn = __webpack_require__(59); var uncurryThis = __webpack_require__(6); var toString = __webpack_require__(107); var validateArgumentsLength = __webpack_require__(113); var $URLSearchParams = URLSearchParams; var URLSearchParamsPrototype = $URLSearchParams.prototype; var append = uncurryThis(URLSearchParamsPrototype.append); var $delete = uncurryThis(URLSearchParamsPrototype['delete']); var forEach = uncurryThis(URLSearchParamsPrototype.forEach); var push = uncurryThis([].push); var params = new $URLSearchParams('a=1&a=2&b=3'); params['delete']('a', 1); // `undefined` case is a Chromium 117 bug // https://bugs.chromium.org/p/v8/issues/detail?id=14222 params['delete']('b', undefined); if (params + '' !== 'a=2') { defineBuiltIn(URLSearchParamsPrototype, 'delete', function (name /* , value */) { var length = arguments.length; var $value = length < 2 ? undefined : arguments[1]; if (length && $value === undefined) return $delete(this, name); var entries = []; forEach(this, function (v, k) { // also validates `this` push(entries, { key: k, value: v }); }); validateArgumentsLength(length, 1); var key = toString(name); var value = toString($value); var index = 0; var dindex = 0; var found = false; var entriesLength = entries.length; var entry; while (index < entriesLength) { entry = entries[index++]; if (found || entry.key === key) { found = true; $delete(this, entry.key); } else dindex++; } while (dindex < entriesLength) { entry = entries[dindex++]; if (!(entry.key === key && entry.value === value)) append(this, entry.key, entry.value); } }, { enumerable: true, unsafe: true }); } /***/ }), /* 124 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var defineBuiltIn = __webpack_require__(59); var uncurryThis = __webpack_require__(6); var toString = __webpack_require__(107); var validateArgumentsLength = __webpack_require__(113); var $URLSearchParams = URLSearchParams; var URLSearchParamsPrototype = $URLSearchParams.prototype; var getAll = uncurryThis(URLSearchParamsPrototype.getAll); var $has = uncurryThis(URLSearchParamsPrototype.has); var params = new $URLSearchParams('a=1'); // `undefined` case is a Chromium 117 bug // https://bugs.chromium.org/p/v8/issues/detail?id=14222 if (params.has('a', 2) || !params.has('a', undefined)) { defineBuiltIn(URLSearchParamsPrototype, 'has', function has(name /* , value */) { var length = arguments.length; var $value = length < 2 ? undefined : arguments[1]; if (length && $value === undefined) return $has(this, name); var values = getAll(this, name); // also validates `this` validateArgumentsLength(length, 1); var value = toString($value); var index = 0; while (index < values.length) { if (values[index++] === value) return true; } return false; }, { enumerable: true, unsafe: true }); } /***/ }), /* 125 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var DESCRIPTORS = __webpack_require__(2); var uncurryThis = __webpack_require__(6); var defineBuiltInAccessor = __webpack_require__(4); var URLSearchParamsPrototype = URLSearchParams.prototype; var forEach = uncurryThis(URLSearchParamsPrototype.forEach); // `URLSearchParams.prototype.size` getter // https://github.com/whatwg/url/pull/734 if (DESCRIPTORS && !('size' in URLSearchParamsPrototype)) { defineBuiltInAccessor(URLSearchParamsPrototype, 'size', { get: function size() { var count = 0; forEach(this, function () { count++; }); return count; }, configurable: true, enumerable: true }); } /***/ }) /******/ ]); }(); vendor/lodash.min.js 0000644 00000217022 15206720414 0010440 0 ustar 00 /** * @license * Lodash lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE */ ;(function(){function n(n,t,r){switch(r.length){case 0:return n.call(t);case 1:return n.call(t,r[0]);case 2:return n.call(t,r[0],r[1]);case 3:return n.call(t,r[0],r[1],r[2])}return n.apply(t,r)}function t(n,t,r,e){for(var u=-1,i=null==n?0:n.length;++u<i;){var o=n[u];t(e,o,r(o),n)}return e}function r(n,t){for(var r=-1,e=null==n?0:n.length;++r<e&&t(n[r],r,n)!==false;);return n}function e(n,t){for(var r=null==n?0:n.length;r--&&t(n[r],r,n)!==false;);return n}function u(n,t){for(var r=-1,e=null==n?0:n.length;++r<e;)if(!t(n[r],r,n))return false; return true}function i(n,t){for(var r=-1,e=null==n?0:n.length,u=0,i=[];++r<e;){var o=n[r];t(o,r,n)&&(i[u++]=o)}return i}function o(n,t){return!!(null==n?0:n.length)&&y(n,t,0)>-1}function f(n,t,r){for(var e=-1,u=null==n?0:n.length;++e<u;)if(r(t,n[e]))return true;return false}function c(n,t){for(var r=-1,e=null==n?0:n.length,u=Array(e);++r<e;)u[r]=t(n[r],r,n);return u}function a(n,t){for(var r=-1,e=t.length,u=n.length;++r<e;)n[u+r]=t[r];return n}function l(n,t,r,e){var u=-1,i=null==n?0:n.length;for(e&&i&&(r=n[++u]);++u<i;)r=t(r,n[u],u,n); return r}function s(n,t,r,e){var u=null==n?0:n.length;for(e&&u&&(r=n[--u]);u--;)r=t(r,n[u],u,n);return r}function h(n,t){for(var r=-1,e=null==n?0:n.length;++r<e;)if(t(n[r],r,n))return true;return false}function p(n){return n.split("")}function _(n){return n.match(Dt)||[]}function v(n,t,r){var e;return r(n,function(n,r,u){if(t(n,r,u))return e=r,false}),e}function g(n,t,r,e){for(var u=n.length,i=r+(e?1:-1);e?i--:++i<u;)if(t(n[i],i,n))return i;return-1}function y(n,t,r){return t===t?Z(n,t,r):g(n,b,r)}function d(n,t,r,e){ for(var u=r-1,i=n.length;++u<i;)if(e(n[u],t))return u;return-1}function b(n){return n!==n}function w(n,t){var r=null==n?0:n.length;return r?k(n,t)/r:Un}function m(n){return function(t){return null==t?X:t[n]}}function x(n){return function(t){return null==n?X:n[t]}}function j(n,t,r,e,u){return u(n,function(n,u,i){r=e?(e=false,n):t(r,n,u,i)}),r}function A(n,t){var r=n.length;for(n.sort(t);r--;)n[r]=n[r].c;return n}function k(n,t){for(var r,e=-1,u=n.length;++e<u;){var i=t(n[e]);i!==X&&(r=r===X?i:r+i)}return r; }function I(n,t){for(var r=-1,e=Array(n);++r<n;)e[r]=t(r);return e}function O(n,t){return c(t,function(t){return[t,n[t]]})}function R(n){return n?n.slice(0,H(n)+1).replace(Ct,""):n}function z(n){return function(t){return n(t)}}function E(n,t){return c(t,function(t){return n[t]})}function S(n,t){return n.has(t)}function W(n,t){for(var r=-1,e=n.length;++r<e&&y(t,n[r],0)>-1;);return r}function L(n,t){for(var r=n.length;r--&&y(t,n[r],0)>-1;);return r}function C(n,t){for(var r=n.length,e=0;r--;)n[r]===t&&++e; return e}function U(n){return"\\"+Yr[n]}function B(n,t){return null==n?X:n[t]}function T(n){return Pr.test(n)}function $(n){return qr.test(n)}function D(n){for(var t,r=[];!(t=n.next()).done;)r.push(t.value);return r}function M(n){var t=-1,r=Array(n.size);return n.forEach(function(n,e){r[++t]=[e,n]}),r}function F(n,t){return function(r){return n(t(r))}}function N(n,t){for(var r=-1,e=n.length,u=0,i=[];++r<e;){var o=n[r];o!==t&&o!==an||(n[r]=an,i[u++]=r)}return i}function P(n){var t=-1,r=Array(n.size); return n.forEach(function(n){r[++t]=n}),r}function q(n){var t=-1,r=Array(n.size);return n.forEach(function(n){r[++t]=[n,n]}),r}function Z(n,t,r){for(var e=r-1,u=n.length;++e<u;)if(n[e]===t)return e;return-1}function K(n,t,r){for(var e=r+1;e--;)if(n[e]===t)return e;return e}function V(n){return T(n)?J(n):_e(n)}function G(n){return T(n)?Y(n):p(n)}function H(n){for(var t=n.length;t--&&Ut.test(n.charAt(t)););return t}function J(n){for(var t=Fr.lastIndex=0;Fr.test(n);)++t;return t}function Y(n){return n.match(Fr)||[]; }function Q(n){return n.match(Nr)||[]}var X,nn="4.18.1",tn=200,rn="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",en="Expected a function",un="Invalid `variable` option passed into `_.template`",on="Invalid `imports` option passed into `_.template`",fn="__lodash_hash_undefined__",cn=500,an="__lodash_placeholder__",ln=1,sn=2,hn=4,pn=1,_n=2,vn=1,gn=2,yn=4,dn=8,bn=16,wn=32,mn=64,xn=128,jn=256,An=512,kn=30,In="...",On=800,Rn=16,zn=1,En=2,Sn=3,Wn=1/0,Ln=9007199254740991,Cn=1.7976931348623157e308,Un=NaN,Bn=4294967295,Tn=Bn-1,$n=Bn>>>1,Dn=[["ary",xn],["bind",vn],["bindKey",gn],["curry",dn],["curryRight",bn],["flip",An],["partial",wn],["partialRight",mn],["rearg",jn]],Mn="[object Arguments]",Fn="[object Array]",Nn="[object AsyncFunction]",Pn="[object Boolean]",qn="[object Date]",Zn="[object DOMException]",Kn="[object Error]",Vn="[object Function]",Gn="[object GeneratorFunction]",Hn="[object Map]",Jn="[object Number]",Yn="[object Null]",Qn="[object Object]",Xn="[object Promise]",nt="[object Proxy]",tt="[object RegExp]",rt="[object Set]",et="[object String]",ut="[object Symbol]",it="[object Undefined]",ot="[object WeakMap]",ft="[object WeakSet]",ct="[object ArrayBuffer]",at="[object DataView]",lt="[object Float32Array]",st="[object Float64Array]",ht="[object Int8Array]",pt="[object Int16Array]",_t="[object Int32Array]",vt="[object Uint8Array]",gt="[object Uint8ClampedArray]",yt="[object Uint16Array]",dt="[object Uint32Array]",bt=/\b__p\+='';/g,wt=/\b(__p\+=)''\+/g,mt=/(__e\(.*?\)|\b__t\))\+'';/g,xt=/&(?:amp|lt|gt|quot|#39);/g,jt=/[&<>"']/g,At=RegExp(xt.source),kt=RegExp(jt.source),It=/<%-([\s\S]+?)%>/g,Ot=/<%([\s\S]+?)%>/g,Rt=/<%=([\s\S]+?)%>/g,zt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Et=/^\w*$/,St=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Wt=/[\\^$.*+?()[\]{}|]/g,Lt=RegExp(Wt.source),Ct=/^\s+/,Ut=/\s/,Bt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Tt=/\{\n\/\* \[wrapped with (.+)\] \*/,$t=/,? & /,Dt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Mt=/[()=,{}\[\]\/\s]/,Ft=/\\(\\)?/g,Nt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Pt=/\w*$/,qt=/^[-+]0x[0-9a-f]+$/i,Zt=/^0b[01]+$/i,Kt=/^\[object .+?Constructor\]$/,Vt=/^0o[0-7]+$/i,Gt=/^(?:0|[1-9]\d*)$/,Ht=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Jt=/($^)/,Yt=/['\n\r\u2028\u2029\\]/g,Qt="\\ud800-\\udfff",Xt="\\u0300-\\u036f",nr="\\ufe20-\\ufe2f",tr="\\u20d0-\\u20ff",rr=Xt+nr+tr,er="\\u2700-\\u27bf",ur="a-z\\xdf-\\xf6\\xf8-\\xff",ir="\\xac\\xb1\\xd7\\xf7",or="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",fr="\\u2000-\\u206f",cr=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ar="A-Z\\xc0-\\xd6\\xd8-\\xde",lr="\\ufe0e\\ufe0f",sr=ir+or+fr+cr,hr="['\u2019]",pr="["+Qt+"]",_r="["+sr+"]",vr="["+rr+"]",gr="\\d+",yr="["+er+"]",dr="["+ur+"]",br="[^"+Qt+sr+gr+er+ur+ar+"]",wr="\\ud83c[\\udffb-\\udfff]",mr="(?:"+vr+"|"+wr+")",xr="[^"+Qt+"]",jr="(?:\\ud83c[\\udde6-\\uddff]){2}",Ar="[\\ud800-\\udbff][\\udc00-\\udfff]",kr="["+ar+"]",Ir="\\u200d",Or="(?:"+dr+"|"+br+")",Rr="(?:"+kr+"|"+br+")",zr="(?:"+hr+"(?:d|ll|m|re|s|t|ve))?",Er="(?:"+hr+"(?:D|LL|M|RE|S|T|VE))?",Sr=mr+"?",Wr="["+lr+"]?",Lr="(?:"+Ir+"(?:"+[xr,jr,Ar].join("|")+")"+Wr+Sr+")*",Cr="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ur="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Br=Wr+Sr+Lr,Tr="(?:"+[yr,jr,Ar].join("|")+")"+Br,$r="(?:"+[xr+vr+"?",vr,jr,Ar,pr].join("|")+")",Dr=RegExp(hr,"g"),Mr=RegExp(vr,"g"),Fr=RegExp(wr+"(?="+wr+")|"+$r+Br,"g"),Nr=RegExp([kr+"?"+dr+"+"+zr+"(?="+[_r,kr,"$"].join("|")+")",Rr+"+"+Er+"(?="+[_r,kr+Or,"$"].join("|")+")",kr+"?"+Or+"+"+zr,kr+"+"+Er,Ur,Cr,gr,Tr].join("|"),"g"),Pr=RegExp("["+Ir+Qt+rr+lr+"]"),qr=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Zr=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Kr={}; Kr[lt]=Kr[st]=Kr[ht]=Kr[pt]=Kr[_t]=Kr[vt]=Kr[gt]=Kr[yt]=Kr[dt]=true,Kr[Mn]=Kr[Fn]=Kr[ct]=Kr[Pn]=Kr[at]=Kr[qn]=Kr[Kn]=Kr[Vn]=Kr[Hn]=Kr[Jn]=Kr[Qn]=Kr[tt]=Kr[rt]=Kr[et]=Kr[ot]=false;var Vr={};Vr[Mn]=Vr[Fn]=Vr[ct]=Vr[at]=Vr[Pn]=Vr[qn]=Vr[lt]=Vr[st]=Vr[ht]=Vr[pt]=Vr[_t]=Vr[Hn]=Vr[Jn]=Vr[Qn]=Vr[tt]=Vr[rt]=Vr[et]=Vr[ut]=Vr[vt]=Vr[gt]=Vr[yt]=Vr[dt]=true,Vr[Kn]=Vr[Vn]=Vr[ot]=false;var Gr={"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a", "\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae", "\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g", "\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O", "\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w", "\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"},Hr={"&":"&","<":"<",">":">",'"':""","'":"'"},Jr={"&":"&","<":"<",">":">",""":'"',"'":"'"},Yr={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Qr=parseFloat,Xr=parseInt,ne=typeof global=="object"&&global&&global.Object===Object&&global,te=typeof self=="object"&&self&&self.Object===Object&&self,re=ne||te||Function("return this")(),ee=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ue=ee&&typeof module=="object"&&module&&!module.nodeType&&module,ie=ue&&ue.exports===ee,oe=ie&&ne.process,fe=function(){ try{var n=ue&&ue.require&&ue.require("util").types;return n?n:oe&&oe.binding&&oe.binding("util")}catch(n){}}(),ce=fe&&fe.isArrayBuffer,ae=fe&&fe.isDate,le=fe&&fe.isMap,se=fe&&fe.isRegExp,he=fe&&fe.isSet,pe=fe&&fe.isTypedArray,_e=m("length"),ve=x(Gr),ge=x(Hr),ye=x(Jr),de=function p(x){function Z(n){if(cc(n)&&!bh(n)&&!(n instanceof Ut)){if(n instanceof Y)return n;if(bl.call(n,"__wrapped__"))return eo(n)}return new Y(n)}function J(){}function Y(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t, this.__index__=0,this.__values__=X}function Ut(n){this.__wrapped__=n,this.__actions__=[],this.__dir__=1,this.__filtered__=false,this.__iteratees__=[],this.__takeCount__=Bn,this.__views__=[]}function Dt(){var n=new Ut(this.__wrapped__);return n.__actions__=Tu(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=Tu(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=Tu(this.__views__),n}function Qt(){if(this.__filtered__){var n=new Ut(this);n.__dir__=-1, n.__filtered__=true}else n=this.clone(),n.__dir__*=-1;return n}function Xt(){var n=this.__wrapped__.value(),t=this.__dir__,r=bh(n),e=t<0,u=r?n.length:0,i=Ii(0,u,this.__views__),o=i.start,f=i.end,c=f-o,a=e?f:o-1,l=this.__iteratees__,s=l.length,h=0,p=Hl(c,this.__takeCount__);if(!r||!e&&u==c&&p==c)return wu(n,this.__actions__);var _=[];n:for(;c--&&h<p;){a+=t;for(var v=-1,g=n[a];++v<s;){var y=l[v],d=y.iteratee,b=y.type,w=d(g);if(b==En)g=w;else if(!w){if(b==zn)continue n;break n}}_[h++]=g}return _}function nr(n){ var t=-1,r=null==n?0:n.length;for(this.clear();++t<r;){var e=n[t];this.set(e[0],e[1])}}function tr(){this.__data__=is?is(null):{},this.size=0}function rr(n){var t=this.has(n)&&delete this.__data__[n];return this.size-=t?1:0,t}function er(n){var t=this.__data__;if(is){var r=t[n];return r===fn?X:r}return bl.call(t,n)?t[n]:X}function ur(n){var t=this.__data__;return is?t[n]!==X:bl.call(t,n)}function ir(n,t){var r=this.__data__;return this.size+=this.has(n)?0:1,r[n]=is&&t===X?fn:t,this}function or(n){ var t=-1,r=null==n?0:n.length;for(this.clear();++t<r;){var e=n[t];this.set(e[0],e[1])}}function fr(){this.__data__=[],this.size=0}function cr(n){var t=this.__data__,r=Lr(t,n);return!(r<0)&&(r==t.length-1?t.pop():Ll.call(t,r,1),--this.size,true)}function ar(n){var t=this.__data__,r=Lr(t,n);return r<0?X:t[r][1]}function lr(n){return Lr(this.__data__,n)>-1}function sr(n,t){var r=this.__data__,e=Lr(r,n);return e<0?(++this.size,r.push([n,t])):r[e][1]=t,this}function hr(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t<r;){ var e=n[t];this.set(e[0],e[1])}}function pr(){this.size=0,this.__data__={hash:new nr,map:new(ts||or),string:new nr}}function _r(n){var t=xi(this,n).delete(n);return this.size-=t?1:0,t}function vr(n){return xi(this,n).get(n)}function gr(n){return xi(this,n).has(n)}function yr(n,t){var r=xi(this,n),e=r.size;return r.set(n,t),this.size+=r.size==e?0:1,this}function dr(n){var t=-1,r=null==n?0:n.length;for(this.__data__=new hr;++t<r;)this.add(n[t])}function br(n){return this.__data__.set(n,fn),this}function wr(n){ return this.__data__.has(n)}function mr(n){this.size=(this.__data__=new or(n)).size}function xr(){this.__data__=new or,this.size=0}function jr(n){var t=this.__data__,r=t.delete(n);return this.size=t.size,r}function Ar(n){return this.__data__.get(n)}function kr(n){return this.__data__.has(n)}function Ir(n,t){var r=this.__data__;if(r instanceof or){var e=r.__data__;if(!ts||e.length<tn-1)return e.push([n,t]),this.size=++r.size,this;r=this.__data__=new hr(e)}return r.set(n,t),this.size=r.size,this}function Or(n,t){ var r=bh(n),e=!r&&dh(n),u=!r&&!e&&mh(n),i=!r&&!e&&!u&&Ih(n),o=r||e||u||i,f=o?I(n.length,hl):[],c=f.length;for(var a in n)!t&&!bl.call(n,a)||o&&("length"==a||u&&("offset"==a||"parent"==a)||i&&("buffer"==a||"byteLength"==a||"byteOffset"==a)||Ci(a,c))||f.push(a);return f}function Rr(n){var t=n.length;return t?n[tu(0,t-1)]:X}function zr(n,t){return Xi(Tu(n),Fr(t,0,n.length))}function Er(n){return Xi(Tu(n))}function Sr(n,t,r){(r===X||Gf(n[t],r))&&(r!==X||t in n)||Tr(n,t,r)}function Wr(n,t,r){var e=n[t]; bl.call(n,t)&&Gf(e,r)&&(r!==X||t in n)||Tr(n,t,r)}function Lr(n,t){for(var r=n.length;r--;)if(Gf(n[r][0],t))return r;return-1}function Cr(n,t,r,e){return ys(n,function(n,u,i){t(e,n,r(n),i)}),e}function Ur(n,t){return n&&$u(t,Pc(t),n)}function Br(n,t){return n&&$u(t,qc(t),n)}function Tr(n,t,r){"__proto__"==t&&Tl?Tl(n,t,{configurable:true,enumerable:true,value:r,writable:true}):n[t]=r}function $r(n,t){for(var r=-1,e=t.length,u=il(e),i=null==n;++r<e;)u[r]=i?X:Mc(n,t[r]);return u}function Fr(n,t,r){return n===n&&(r!==X&&(n=n<=r?n:r), t!==X&&(n=n>=t?n:t)),n}function Nr(n,t,e,u,i,o){var f,c=t&ln,a=t&sn,l=t&hn;if(e&&(f=i?e(n,u,i,o):e(n)),f!==X)return f;if(!fc(n))return n;var s=bh(n);if(s){if(f=zi(n),!c)return Tu(n,f)}else{var h=zs(n),p=h==Vn||h==Gn;if(mh(n))return Ou(n,c);if(h==Qn||h==Mn||p&&!i){if(f=a||p?{}:Ei(n),!c)return a?Mu(n,Br(f,n)):Du(n,Ur(f,n))}else{if(!Vr[h])return i?n:{};f=Si(n,h,c)}}o||(o=new mr);var _=o.get(n);if(_)return _;o.set(n,f),kh(n)?n.forEach(function(r){f.add(Nr(r,t,e,r,n,o))}):jh(n)&&n.forEach(function(r,u){ f.set(u,Nr(r,t,e,u,n,o))});var v=l?a?di:yi:a?qc:Pc,g=s?X:v(n);return r(g||n,function(r,u){g&&(u=r,r=n[u]),Wr(f,u,Nr(r,t,e,u,n,o))}),f}function Pr(n){var t=Pc(n);return function(r){return qr(r,n,t)}}function qr(n,t,r){var e=r.length;if(null==n)return!e;for(n=ll(n);e--;){var u=r[e],i=t[u],o=n[u];if(o===X&&!(u in n)||!i(o))return false}return true}function Gr(n,t,r){if(typeof n!="function")throw new pl(en);return Ws(function(){n.apply(X,r)},t)}function Hr(n,t,r,e){var u=-1,i=o,a=true,l=n.length,s=[],h=t.length; if(!l)return s;r&&(t=c(t,z(r))),e?(i=f,a=false):t.length>=tn&&(i=S,a=false,t=new dr(t));n:for(;++u<l;){var p=n[u],_=null==r?p:r(p);if(p=e||0!==p?p:0,a&&_===_){for(var v=h;v--;)if(t[v]===_)continue n;s.push(p)}else i(t,_,e)||s.push(p)}return s}function Jr(n,t){var r=true;return ys(n,function(n,e,u){return r=!!t(n,e,u)}),r}function Yr(n,t,r){for(var e=-1,u=n.length;++e<u;){var i=n[e],o=t(i);if(null!=o&&(f===X?o===o&&!bc(o):r(o,f)))var f=o,c=i}return c}function ne(n,t,r,e){var u=n.length;for(r=kc(r),r<0&&(r=-r>u?0:u+r), e=e===X||e>u?u:kc(e),e<0&&(e+=u),e=r>e?0:Ic(e);r<e;)n[r++]=t;return n}function te(n,t){var r=[];return ys(n,function(n,e,u){t(n,e,u)&&r.push(n)}),r}function ee(n,t,r,e,u){var i=-1,o=n.length;for(r||(r=Li),u||(u=[]);++i<o;){var f=n[i];t>0&&r(f)?t>1?ee(f,t-1,r,e,u):a(u,f):e||(u[u.length]=f)}return u}function ue(n,t){return n&&bs(n,t,Pc)}function oe(n,t){return n&&ws(n,t,Pc)}function fe(n,t){return i(t,function(t){return uc(n[t])})}function _e(n,t){t=ku(t,n);for(var r=0,e=t.length;null!=n&&r<e;)n=n[no(t[r++])]; return r&&r==e?n:X}function de(n,t,r){var e=t(n);return bh(n)?e:a(e,r(n))}function we(n){return null==n?n===X?it:Yn:Bl&&Bl in ll(n)?ki(n):Ki(n)}function me(n,t){return n>t}function xe(n,t){return null!=n&&bl.call(n,t)}function je(n,t){return null!=n&&t in ll(n)}function Ae(n,t,r){return n>=Hl(t,r)&&n<Gl(t,r)}function ke(n,t,r){for(var e=r?f:o,u=n[0].length,i=n.length,a=i,l=il(i),s=1/0,h=[];a--;){var p=n[a];a&&t&&(p=c(p,z(t))),s=Hl(p.length,s),l[a]=!r&&(t||u>=120&&p.length>=120)?new dr(a&&p):X}p=n[0]; var _=-1,v=l[0];n:for(;++_<u&&h.length<s;){var g=p[_],y=t?t(g):g;if(g=r||0!==g?g:0,!(v?S(v,y):e(h,y,r))){for(a=i;--a;){var d=l[a];if(!(d?S(d,y):e(n[a],y,r)))continue n}v&&v.push(y),h.push(g)}}return h}function Ie(n,t,r,e){return ue(n,function(n,u,i){t(e,r(n),u,i)}),e}function Oe(t,r,e){r=ku(r,t),t=Gi(t,r);var u=null==t?t:t[no(jo(r))];return null==u?X:n(u,t,e)}function Re(n){return cc(n)&&we(n)==Mn}function ze(n){return cc(n)&&we(n)==ct}function Ee(n){return cc(n)&&we(n)==qn}function Se(n,t,r,e,u){ return n===t||(null==n||null==t||!cc(n)&&!cc(t)?n!==n&&t!==t:We(n,t,r,e,Se,u))}function We(n,t,r,e,u,i){var o=bh(n),f=bh(t),c=o?Fn:zs(n),a=f?Fn:zs(t);c=c==Mn?Qn:c,a=a==Mn?Qn:a;var l=c==Qn,s=a==Qn,h=c==a;if(h&&mh(n)){if(!mh(t))return false;o=true,l=false}if(h&&!l)return i||(i=new mr),o||Ih(n)?pi(n,t,r,e,u,i):_i(n,t,c,r,e,u,i);if(!(r&pn)){var p=l&&bl.call(n,"__wrapped__"),_=s&&bl.call(t,"__wrapped__");if(p||_){var v=p?n.value():n,g=_?t.value():t;return i||(i=new mr),u(v,g,r,e,i)}}return!!h&&(i||(i=new mr),vi(n,t,r,e,u,i)); }function Le(n){return cc(n)&&zs(n)==Hn}function Ce(n,t,r,e){var u=r.length,i=u,o=!e;if(null==n)return!i;for(n=ll(n);u--;){var f=r[u];if(o&&f[2]?f[1]!==n[f[0]]:!(f[0]in n))return false}for(;++u<i;){f=r[u];var c=f[0],a=n[c],l=f[1];if(o&&f[2]){if(a===X&&!(c in n))return false}else{var s=new mr;if(e)var h=e(a,l,c,n,t,s);if(!(h===X?Se(l,a,pn|_n,e,s):h))return false}}return true}function Ue(n){return!(!fc(n)||Di(n))&&(uc(n)?kl:Kt).test(to(n))}function Be(n){return cc(n)&&we(n)==tt}function Te(n){return cc(n)&&zs(n)==rt; }function $e(n){return cc(n)&&oc(n.length)&&!!Kr[we(n)]}function De(n){return typeof n=="function"?n:null==n?La:typeof n=="object"?bh(n)?Ze(n[0],n[1]):qe(n):Fa(n)}function Me(n){if(!Mi(n))return Vl(n);var t=[];for(var r in ll(n))bl.call(n,r)&&"constructor"!=r&&t.push(r);return t}function Fe(n){if(!fc(n))return Zi(n);var t=Mi(n),r=[];for(var e in n)("constructor"!=e||!t&&bl.call(n,e))&&r.push(e);return r}function Ne(n,t){return n<t}function Pe(n,t){var r=-1,e=Hf(n)?il(n.length):[];return ys(n,function(n,u,i){ e[++r]=t(n,u,i)}),e}function qe(n){var t=ji(n);return 1==t.length&&t[0][2]?Ni(t[0][0],t[0][1]):function(r){return r===n||Ce(r,n,t)}}function Ze(n,t){return Bi(n)&&Fi(t)?Ni(no(n),t):function(r){var e=Mc(r,n);return e===X&&e===t?Nc(r,n):Se(t,e,pn|_n)}}function Ke(n,t,r,e,u){n!==t&&bs(t,function(i,o){if(u||(u=new mr),fc(i))Ve(n,t,o,r,Ke,e,u);else{var f=e?e(Ji(n,o),i,o+"",n,t,u):X;f===X&&(f=i),Sr(n,o,f)}},qc)}function Ve(n,t,r,e,u,i,o){var f=Ji(n,r),c=Ji(t,r),a=o.get(c);if(a)return Sr(n,r,a),X;var l=i?i(f,c,r+"",n,t,o):X,s=l===X; if(s){var h=bh(c),p=!h&&mh(c),_=!h&&!p&&Ih(c);l=c,h||p||_?bh(f)?l=f:Jf(f)?l=Tu(f):p?(s=false,l=Ou(c,true)):_?(s=false,l=Wu(c,true)):l=[]:gc(c)||dh(c)?(l=f,dh(f)?l=Rc(f):fc(f)&&!uc(f)||(l=Ei(c))):s=false}s&&(o.set(c,l),u(l,c,e,i,o),o.delete(c)),Sr(n,r,l)}function Ge(n,t){var r=n.length;if(r)return t+=t<0?r:0,Ci(t,r)?n[t]:X}function He(n,t,r){t=t.length?c(t,function(n){return bh(n)?function(t){return _e(t,1===n.length?n[0]:n)}:n}):[La];var e=-1;return t=c(t,z(mi())),A(Pe(n,function(n,r,u){return{a:c(t,function(t){ return t(n)}),b:++e,c:n}}),function(n,t){return Cu(n,t,r)})}function Je(n,t){return Ye(n,t,function(t,r){return Nc(n,r)})}function Ye(n,t,r){for(var e=-1,u=t.length,i={};++e<u;){var o=t[e],f=_e(n,o);r(f,o)&&fu(i,ku(o,n),f)}return i}function Qe(n){return function(t){return _e(t,n)}}function Xe(n,t,r,e){var u=e?d:y,i=-1,o=t.length,f=n;for(n===t&&(t=Tu(t)),r&&(f=c(n,z(r)));++i<o;)for(var a=0,l=t[i],s=r?r(l):l;(a=u(f,s,a,e))>-1;)f!==n&&Ll.call(f,a,1),Ll.call(n,a,1);return n}function nu(n,t){for(var r=n?t.length:0,e=r-1;r--;){ var u=t[r];if(r==e||u!==i){var i=u;Ci(u)?Ll.call(n,u,1):yu(n,u)}}return n}function tu(n,t){return n+Nl(Ql()*(t-n+1))}function ru(n,t,r,e){for(var u=-1,i=Gl(Fl((t-n)/(r||1)),0),o=il(i);i--;)o[e?i:++u]=n,n+=r;return o}function eu(n,t){var r="";if(!n||t<1||t>Ln)return r;do t%2&&(r+=n),t=Nl(t/2),t&&(n+=n);while(t);return r}function uu(n,t){return Ls(Vi(n,t,La),n+"")}function iu(n){return Rr(ra(n))}function ou(n,t){var r=ra(n);return Xi(r,Fr(t,0,r.length))}function fu(n,t,r,e){if(!fc(n))return n;t=ku(t,n); for(var u=-1,i=t.length,o=i-1,f=n;null!=f&&++u<i;){var c=no(t[u]),a=r;if("__proto__"===c||"constructor"===c||"prototype"===c)return n;if(u!=o){var l=f[c];a=e?e(l,c,f):X,a===X&&(a=fc(l)?l:Ci(t[u+1])?[]:{})}Wr(f,c,a),f=f[c]}return n}function cu(n){return Xi(ra(n))}function au(n,t,r){var e=-1,u=n.length;t<0&&(t=-t>u?0:u+t),r=r>u?u:r,r<0&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0;for(var i=il(u);++e<u;)i[e]=n[e+t];return i}function lu(n,t){var r;return ys(n,function(n,e,u){return r=t(n,e,u),!r}),!!r}function su(n,t,r){ var e=0,u=null==n?e:n.length;if(typeof t=="number"&&t===t&&u<=$n){for(;e<u;){var i=e+u>>>1,o=n[i];null!==o&&!bc(o)&&(r?o<=t:o<t)?e=i+1:u=i}return u}return hu(n,t,La,r)}function hu(n,t,r,e){var u=0,i=null==n?0:n.length;if(0===i)return 0;t=r(t);for(var o=t!==t,f=null===t,c=bc(t),a=t===X;u<i;){var l=Nl((u+i)/2),s=r(n[l]),h=s!==X,p=null===s,_=s===s,v=bc(s);if(o)var g=e||_;else g=a?_&&(e||h):f?_&&h&&(e||!p):c?_&&h&&!p&&(e||!v):!p&&!v&&(e?s<=t:s<t);g?u=l+1:i=l}return Hl(i,Tn)}function pu(n,t){for(var r=-1,e=n.length,u=0,i=[];++r<e;){ var o=n[r],f=t?t(o):o;if(!r||!Gf(f,c)){var c=f;i[u++]=0===o?0:o}}return i}function _u(n){return typeof n=="number"?n:bc(n)?Un:+n}function vu(n){if(typeof n=="string")return n;if(bh(n))return c(n,vu)+"";if(bc(n))return vs?vs.call(n):"";var t=n+"";return"0"==t&&1/n==-Wn?"-0":t}function gu(n,t,r){var e=-1,u=o,i=n.length,c=true,a=[],l=a;if(r)c=false,u=f;else if(i>=tn){var s=t?null:ks(n);if(s)return P(s);c=false,u=S,l=new dr}else l=t?[]:a;n:for(;++e<i;){var h=n[e],p=t?t(h):h;if(h=r||0!==h?h:0,c&&p===p){for(var _=l.length;_--;)if(l[_]===p)continue n; t&&l.push(p),a.push(h)}else u(l,p,r)||(l!==a&&l.push(p),a.push(h))}return a}function yu(n,t){t=ku(t,n);var r=-1,e=t.length;if(!e)return true;for(;++r<e;){var u=no(t[r]);if("__proto__"===u&&!bl.call(n,"__proto__"))return false;if(("constructor"===u||"prototype"===u)&&r<e-1)return false}var i=Gi(n,t);return null==i||delete i[no(jo(t))]}function du(n,t,r,e){return fu(n,t,r(_e(n,t)),e)}function bu(n,t,r,e){for(var u=n.length,i=e?u:-1;(e?i--:++i<u)&&t(n[i],i,n););return r?au(n,e?0:i,e?i+1:u):au(n,e?i+1:0,e?u:i)} function wu(n,t){var r=n;return r instanceof Ut&&(r=r.value()),l(t,function(n,t){return t.func.apply(t.thisArg,a([n],t.args))},r)}function mu(n,t,r){var e=n.length;if(e<2)return e?gu(n[0]):[];for(var u=-1,i=il(e);++u<e;)for(var o=n[u],f=-1;++f<e;)f!=u&&(i[u]=Hr(i[u]||o,n[f],t,r));return gu(ee(i,1),t,r)}function xu(n,t,r){for(var e=-1,u=n.length,i=t.length,o={};++e<u;){r(o,n[e],e<i?t[e]:X)}return o}function ju(n){return Jf(n)?n:[]}function Au(n){return typeof n=="function"?n:La}function ku(n,t){return bh(n)?n:Bi(n,t)?[n]:Cs(Ec(n)); }function Iu(n,t,r){var e=n.length;return r=r===X?e:r,!t&&r>=e?n:au(n,t,r)}function Ou(n,t){if(t)return n.slice();var r=n.length,e=zl?zl(r):new n.constructor(r);return n.copy(e),e}function Ru(n){var t=new n.constructor(n.byteLength);return new Rl(t).set(new Rl(n)),t}function zu(n,t){return new n.constructor(t?Ru(n.buffer):n.buffer,n.byteOffset,n.byteLength)}function Eu(n){var t=new n.constructor(n.source,Pt.exec(n));return t.lastIndex=n.lastIndex,t}function Su(n){return _s?ll(_s.call(n)):{}}function Wu(n,t){ return new n.constructor(t?Ru(n.buffer):n.buffer,n.byteOffset,n.length)}function Lu(n,t){if(n!==t){var r=n!==X,e=null===n,u=n===n,i=bc(n),o=t!==X,f=null===t,c=t===t,a=bc(t);if(!f&&!a&&!i&&n>t||i&&o&&c&&!f&&!a||e&&o&&c||!r&&c||!u)return 1;if(!e&&!i&&!a&&n<t||a&&r&&u&&!e&&!i||f&&r&&u||!o&&u||!c)return-1}return 0}function Cu(n,t,r){for(var e=-1,u=n.a,i=t.a,o=u.length,f=r.length;++e<o;){var c=Lu(u[e],i[e]);if(c){if(e>=f)return c;return c*("desc"==r[e]?-1:1)}}return n.b-t.b}function Uu(n,t,r,e){for(var u=-1,i=n.length,o=r.length,f=-1,c=t.length,a=Gl(i-o,0),l=il(c+a),s=!e;++f<c;)l[f]=t[f]; for(;++u<o;)(s||u<i)&&(l[r[u]]=n[u]);for(;a--;)l[f++]=n[u++];return l}function Bu(n,t,r,e){for(var u=-1,i=n.length,o=-1,f=r.length,c=-1,a=t.length,l=Gl(i-f,0),s=il(l+a),h=!e;++u<l;)s[u]=n[u];for(var p=u;++c<a;)s[p+c]=t[c];for(;++o<f;)(h||u<i)&&(s[p+r[o]]=n[u++]);return s}function Tu(n,t){var r=-1,e=n.length;for(t||(t=il(e));++r<e;)t[r]=n[r];return t}function $u(n,t,r,e){var u=!r;r||(r={});for(var i=-1,o=t.length;++i<o;){var f=t[i],c=e?e(r[f],n[f],f,r,n):X;c===X&&(c=n[f]),u?Tr(r,f,c):Wr(r,f,c)}return r; }function Du(n,t){return $u(n,Os(n),t)}function Mu(n,t){return $u(n,Rs(n),t)}function Fu(n,r){return function(e,u){var i=bh(e)?t:Cr,o=r?r():{};return i(e,n,mi(u,2),o)}}function Nu(n){return uu(function(t,r){var e=-1,u=r.length,i=u>1?r[u-1]:X,o=u>2?r[2]:X;for(i=n.length>3&&typeof i=="function"?(u--,i):X,o&&Ui(r[0],r[1],o)&&(i=u<3?X:i,u=1),t=ll(t);++e<u;){var f=r[e];f&&n(t,f,e,i)}return t})}function Pu(n,t){return function(r,e){if(null==r)return r;if(!Hf(r))return n(r,e);for(var u=r.length,i=t?u:-1,o=ll(r);(t?i--:++i<u)&&e(o[i],i,o)!==false;); return r}}function qu(n){return function(t,r,e){for(var u=-1,i=ll(t),o=e(t),f=o.length;f--;){var c=o[n?f:++u];if(r(i[c],c,i)===false)break}return t}}function Zu(n,t,r){function e(){return(this&&this!==re&&this instanceof e?i:n).apply(u?r:this,arguments)}var u=t&vn,i=Gu(n);return e}function Ku(n){return function(t){t=Ec(t);var r=T(t)?G(t):X,e=r?r[0]:t.charAt(0),u=r?Iu(r,1).join(""):t.slice(1);return e[n]()+u}}function Vu(n){return function(t){return l(Ra(ca(t).replace(Dr,"")),n,"")}}function Gu(n){return function(){ var t=arguments;switch(t.length){case 0:return new n;case 1:return new n(t[0]);case 2:return new n(t[0],t[1]);case 3:return new n(t[0],t[1],t[2]);case 4:return new n(t[0],t[1],t[2],t[3]);case 5:return new n(t[0],t[1],t[2],t[3],t[4]);case 6:return new n(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new n(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=gs(n.prototype),e=n.apply(r,t);return fc(e)?e:r}}function Hu(t,r,e){function u(){for(var o=arguments.length,f=il(o),c=o,a=wi(u);c--;)f[c]=arguments[c];var l=o<3&&f[0]!==a&&f[o-1]!==a?[]:N(f,a); return o-=l.length,o<e?oi(t,r,Qu,u.placeholder,X,f,l,X,X,e-o):n(this&&this!==re&&this instanceof u?i:t,this,f)}var i=Gu(t);return u}function Ju(n){return function(t,r,e){var u=ll(t);if(!Hf(t)){var i=mi(r,3);t=Pc(t),r=function(n){return i(u[n],n,u)}}var o=n(t,r,e);return o>-1?u[i?t[o]:o]:X}}function Yu(n){return gi(function(t){var r=t.length,e=r,u=Y.prototype.thru;for(n&&t.reverse();e--;){var i=t[e];if(typeof i!="function")throw new pl(en);if(u&&!o&&"wrapper"==bi(i))var o=new Y([],true)}for(e=o?e:r;++e<r;){ i=t[e];var f=bi(i),c="wrapper"==f?Is(i):X;o=c&&$i(c[0])&&c[1]==(xn|dn|wn|jn)&&!c[4].length&&1==c[9]?o[bi(c[0])].apply(o,c[3]):1==i.length&&$i(i)?o[f]():o.thru(i)}return function(){var n=arguments,e=n[0];if(o&&1==n.length&&bh(e))return o.plant(e).value();for(var u=0,i=r?t[u].apply(this,n):e;++u<r;)i=t[u].call(this,i);return i}})}function Qu(n,t,r,e,u,i,o,f,c,a){function l(){for(var y=arguments.length,d=il(y),b=y;b--;)d[b]=arguments[b];if(_)var w=wi(l),m=C(d,w);if(e&&(d=Uu(d,e,u,_)),i&&(d=Bu(d,i,o,_)), y-=m,_&&y<a){return oi(n,t,Qu,l.placeholder,r,d,N(d,w),f,c,a-y)}var x=h?r:this,j=p?x[n]:n;return y=d.length,f?d=Hi(d,f):v&&y>1&&d.reverse(),s&&c<y&&(d.length=c),this&&this!==re&&this instanceof l&&(j=g||Gu(j)),j.apply(x,d)}var s=t&xn,h=t&vn,p=t&gn,_=t&(dn|bn),v=t&An,g=p?X:Gu(n);return l}function Xu(n,t){return function(r,e){return Ie(r,n,t(e),{})}}function ni(n,t){return function(r,e){var u;if(r===X&&e===X)return t;if(r!==X&&(u=r),e!==X){if(u===X)return e;typeof r=="string"||typeof e=="string"?(r=vu(r), e=vu(e)):(r=_u(r),e=_u(e)),u=n(r,e)}return u}}function ti(t){return gi(function(r){return r=c(r,z(mi())),uu(function(e){var u=this;return t(r,function(t){return n(t,u,e)})})})}function ri(n,t){t=t===X?" ":vu(t);var r=t.length;if(r<2)return r?eu(t,n):t;var e=eu(t,Fl(n/V(t)));return T(t)?Iu(G(e),0,n).join(""):e.slice(0,n)}function ei(t,r,e,u){function i(){for(var r=-1,c=arguments.length,a=-1,l=u.length,s=il(l+c),h=this&&this!==re&&this instanceof i?f:t;++a<l;)s[a]=u[a];for(;c--;)s[a++]=arguments[++r]; return n(h,o?e:this,s)}var o=r&vn,f=Gu(t);return i}function ui(n){return function(t,r,e){return e&&typeof e!="number"&&Ui(t,r,e)&&(r=e=X),t=Ac(t),r===X?(r=t,t=0):r=Ac(r),e=e===X?t<r?1:-1:Ac(e),ru(t,r,e,n)}}function ii(n){return function(t,r){return typeof t=="string"&&typeof r=="string"||(t=Oc(t),r=Oc(r)),n(t,r)}}function oi(n,t,r,e,u,i,o,f,c,a){var l=t&dn,s=l?o:X,h=l?X:o,p=l?i:X,_=l?X:i;t|=l?wn:mn,t&=~(l?mn:wn),t&yn||(t&=~(vn|gn));var v=[n,t,u,p,s,_,h,f,c,a],g=r.apply(X,v);return $i(n)&&Ss(g,v),g.placeholder=e, Yi(g,n,t)}function fi(n){var t=al[n];return function(n,r){if(n=Oc(n),r=null==r?0:Hl(kc(r),292),r&&Zl(n)){var e=(Ec(n)+"e").split("e");return e=(Ec(t(e[0]+"e"+(+e[1]+r)))+"e").split("e"),+(e[0]+"e"+(+e[1]-r))}return t(n)}}function ci(n){return function(t){var r=zs(t);return r==Hn?M(t):r==rt?q(t):O(t,n(t))}}function ai(n,t,r,e,u,i,o,f){var c=t&gn;if(!c&&typeof n!="function")throw new pl(en);var a=e?e.length:0;if(a||(t&=~(wn|mn),e=u=X),o=o===X?o:Gl(kc(o),0),f=f===X?f:kc(f),a-=u?u.length:0,t&mn){var l=e,s=u; e=u=X}var h=c?X:Is(n),p=[n,t,r,e,u,l,s,i,o,f];if(h&&qi(p,h),n=p[0],t=p[1],r=p[2],e=p[3],u=p[4],f=p[9]=p[9]===X?c?0:n.length:Gl(p[9]-a,0),!f&&t&(dn|bn)&&(t&=~(dn|bn)),t&&t!=vn)_=t==dn||t==bn?Hu(n,t,f):t!=wn&&t!=(vn|wn)||u.length?Qu.apply(X,p):ei(n,t,r,e);else var _=Zu(n,t,r);return Yi((h?ms:Ss)(_,p),n,t)}function li(n,t,r,e){return n===X||Gf(n,gl[r])&&!bl.call(e,r)?t:n}function si(n,t,r,e,u,i){return fc(n)&&fc(t)&&(i.set(t,n),Ke(n,t,X,si,i),i.delete(t)),n}function hi(n){return gc(n)?X:n}function pi(n,t,r,e,u,i){ var o=r&pn,f=n.length,c=t.length;if(f!=c&&!(o&&c>f))return false;var a=i.get(n),l=i.get(t);if(a&&l)return a==t&&l==n;var s=-1,p=true,_=r&_n?new dr:X;for(i.set(n,t),i.set(t,n);++s<f;){var v=n[s],g=t[s];if(e)var y=o?e(g,v,s,t,n,i):e(v,g,s,n,t,i);if(y!==X){if(y)continue;p=false;break}if(_){if(!h(t,function(n,t){if(!S(_,t)&&(v===n||u(v,n,r,e,i)))return _.push(t)})){p=false;break}}else if(v!==g&&!u(v,g,r,e,i)){p=false;break}}return i.delete(n),i.delete(t),p}function _i(n,t,r,e,u,i,o){switch(r){case at:if(n.byteLength!=t.byteLength||n.byteOffset!=t.byteOffset)return false; n=n.buffer,t=t.buffer;case ct:return!(n.byteLength!=t.byteLength||!i(new Rl(n),new Rl(t)));case Pn:case qn:case Jn:return Gf(+n,+t);case Kn:return n.name==t.name&&n.message==t.message;case tt:case et:return n==t+"";case Hn:var f=M;case rt:var c=e&pn;if(f||(f=P),n.size!=t.size&&!c)return false;var a=o.get(n);if(a)return a==t;e|=_n,o.set(n,t);var l=pi(f(n),f(t),e,u,i,o);return o.delete(n),l;case ut:if(_s)return _s.call(n)==_s.call(t)}return false}function vi(n,t,r,e,u,i){var o=r&pn,f=yi(n),c=f.length;if(c!=yi(t).length&&!o)return false; for(var a=c;a--;){var l=f[a];if(!(o?l in t:bl.call(t,l)))return false}var s=i.get(n),h=i.get(t);if(s&&h)return s==t&&h==n;var p=true;i.set(n,t),i.set(t,n);for(var _=o;++a<c;){l=f[a];var v=n[l],g=t[l];if(e)var y=o?e(g,v,l,t,n,i):e(v,g,l,n,t,i);if(!(y===X?v===g||u(v,g,r,e,i):y)){p=false;break}_||(_="constructor"==l)}if(p&&!_){var d=n.constructor,b=t.constructor;d!=b&&"constructor"in n&&"constructor"in t&&!(typeof d=="function"&&d instanceof d&&typeof b=="function"&&b instanceof b)&&(p=false)}return i.delete(n), i.delete(t),p}function gi(n){return Ls(Vi(n,X,_o),n+"")}function yi(n){return de(n,Pc,Os)}function di(n){return de(n,qc,Rs)}function bi(n){for(var t=n.name+"",r=fs[t],e=bl.call(fs,t)?r.length:0;e--;){var u=r[e],i=u.func;if(null==i||i==n)return u.name}return t}function wi(n){return(bl.call(Z,"placeholder")?Z:n).placeholder}function mi(){var n=Z.iteratee||Ca;return n=n===Ca?De:n,arguments.length?n(arguments[0],arguments[1]):n}function xi(n,t){var r=n.__data__;return Ti(t)?r[typeof t=="string"?"string":"hash"]:r.map; }function ji(n){for(var t=Pc(n),r=t.length;r--;){var e=t[r],u=n[e];t[r]=[e,u,Fi(u)]}return t}function Ai(n,t){var r=B(n,t);return Ue(r)?r:X}function ki(n){var t=bl.call(n,Bl),r=n[Bl];try{n[Bl]=X;var e=true}catch(n){}var u=xl.call(n);return e&&(t?n[Bl]=r:delete n[Bl]),u}function Ii(n,t,r){for(var e=-1,u=r.length;++e<u;){var i=r[e],o=i.size;switch(i.type){case"drop":n+=o;break;case"dropRight":t-=o;break;case"take":t=Hl(t,n+o);break;case"takeRight":n=Gl(n,t-o)}}return{start:n,end:t}}function Oi(n){var t=n.match(Tt); return t?t[1].split($t):[]}function Ri(n,t,r){t=ku(t,n);for(var e=-1,u=t.length,i=false;++e<u;){var o=no(t[e]);if(!(i=null!=n&&r(n,o)))break;n=n[o]}return i||++e!=u?i:(u=null==n?0:n.length,!!u&&oc(u)&&Ci(o,u)&&(bh(n)||dh(n)))}function zi(n){var t=n.length,r=new n.constructor(t);return t&&"string"==typeof n[0]&&bl.call(n,"index")&&(r.index=n.index,r.input=n.input),r}function Ei(n){return typeof n.constructor!="function"||Mi(n)?{}:gs(El(n))}function Si(n,t,r){var e=n.constructor;switch(t){case ct:return Ru(n); case Pn:case qn:return new e(+n);case at:return zu(n,r);case lt:case st:case ht:case pt:case _t:case vt:case gt:case yt:case dt:return Wu(n,r);case Hn:return new e;case Jn:case et:return new e(n);case tt:return Eu(n);case rt:return new e;case ut:return Su(n)}}function Wi(n,t){var r=t.length;if(!r)return n;var e=r-1;return t[e]=(r>1?"& ":"")+t[e],t=t.join(r>2?", ":" "),n.replace(Bt,"{\n/* [wrapped with "+t+"] */\n")}function Li(n){return bh(n)||dh(n)||!!(Cl&&n&&n[Cl])}function Ci(n,t){var r=typeof n; return t=null==t?Ln:t,!!t&&("number"==r||"symbol"!=r&&Gt.test(n))&&n>-1&&n%1==0&&n<t}function Ui(n,t,r){if(!fc(r))return false;var e=typeof t;return!!("number"==e?Hf(r)&&Ci(t,r.length):"string"==e&&t in r)&&Gf(r[t],n)}function Bi(n,t){if(bh(n))return false;var r=typeof n;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=n&&!bc(n))||(Et.test(n)||!zt.test(n)||null!=t&&n in ll(t))}function Ti(n){var t=typeof n;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==n:null===n}function $i(n){ var t=bi(n),r=Z[t];if(typeof r!="function"||!(t in Ut.prototype))return false;if(n===r)return true;var e=Is(r);return!!e&&n===e[0]}function Di(n){return!!ml&&ml in n}function Mi(n){var t=n&&n.constructor;return n===(typeof t=="function"&&t.prototype||gl)}function Fi(n){return n===n&&!fc(n)}function Ni(n,t){return function(r){return null!=r&&(r[n]===t&&(t!==X||n in ll(r)))}}function Pi(n){var t=Cf(n,function(n){return r.size===cn&&r.clear(),n}),r=t.cache;return t}function qi(n,t){var r=n[1],e=t[1],u=r|e,i=u<(vn|gn|xn),o=e==xn&&r==dn||e==xn&&r==jn&&n[7].length<=t[8]||e==(xn|jn)&&t[7].length<=t[8]&&r==dn; if(!i&&!o)return n;e&vn&&(n[2]=t[2],u|=r&vn?0:yn);var f=t[3];if(f){var c=n[3];n[3]=c?Uu(c,f,t[4]):f,n[4]=c?N(n[3],an):t[4]}return f=t[5],f&&(c=n[5],n[5]=c?Bu(c,f,t[6]):f,n[6]=c?N(n[5],an):t[6]),f=t[7],f&&(n[7]=f),e&xn&&(n[8]=null==n[8]?t[8]:Hl(n[8],t[8])),null==n[9]&&(n[9]=t[9]),n[0]=t[0],n[1]=u,n}function Zi(n){var t=[];if(null!=n)for(var r in ll(n))t.push(r);return t}function Ki(n){return xl.call(n)}function Vi(t,r,e){return r=Gl(r===X?t.length-1:r,0),function(){for(var u=arguments,i=-1,o=Gl(u.length-r,0),f=il(o);++i<o;)f[i]=u[r+i]; i=-1;for(var c=il(r+1);++i<r;)c[i]=u[i];return c[r]=e(f),n(t,this,c)}}function Gi(n,t){return t.length<2?n:_e(n,au(t,0,-1))}function Hi(n,t){for(var r=n.length,e=Hl(t.length,r),u=Tu(n);e--;){var i=t[e];n[e]=Ci(i,r)?u[i]:X}return n}function Ji(n,t){if(("constructor"!==t||"function"!=typeof n[t])&&"__proto__"!=t)return n[t]}function Yi(n,t,r){var e=t+"";return Ls(n,Wi(e,ro(Oi(e),r)))}function Qi(n){var t=0,r=0;return function(){var e=Jl(),u=Rn-(e-r);if(r=e,u>0){if(++t>=On)return arguments[0]}else t=0; return n.apply(X,arguments)}}function Xi(n,t){var r=-1,e=n.length,u=e-1;for(t=t===X?e:t;++r<t;){var i=tu(r,u),o=n[i];n[i]=n[r],n[r]=o}return n.length=t,n}function no(n){if(typeof n=="string"||bc(n))return n;var t=n+"";return"0"==t&&1/n==-Wn?"-0":t}function to(n){if(null!=n){try{return dl.call(n)}catch(n){}try{return n+""}catch(n){}}return""}function ro(n,t){return r(Dn,function(r){var e="_."+r[0];t&r[1]&&!o(n,e)&&n.push(e)}),n.sort()}function eo(n){if(n instanceof Ut)return n.clone();var t=new Y(n.__wrapped__,n.__chain__); return t.__actions__=Tu(n.__actions__),t.__index__=n.__index__,t.__values__=n.__values__,t}function uo(n,t,r){t=(r?Ui(n,t,r):t===X)?1:Gl(kc(t),0);var e=null==n?0:n.length;if(!e||t<1)return[];for(var u=0,i=0,o=il(Fl(e/t));u<e;)o[i++]=au(n,u,u+=t);return o}function io(n){for(var t=-1,r=null==n?0:n.length,e=0,u=[];++t<r;){var i=n[t];i&&(u[e++]=i)}return u}function oo(){var n=arguments.length;if(!n)return[];for(var t=il(n-1),r=arguments[0],e=n;e--;)t[e-1]=arguments[e];return a(bh(r)?Tu(r):[r],ee(t,1)); }function fo(n,t,r){var e=null==n?0:n.length;return e?(t=r||t===X?1:kc(t),au(n,t<0?0:t,e)):[]}function co(n,t,r){var e=null==n?0:n.length;return e?(t=r||t===X?1:kc(t),t=e-t,au(n,0,t<0?0:t)):[]}function ao(n,t){return n&&n.length?bu(n,mi(t,3),true,true):[]}function lo(n,t){return n&&n.length?bu(n,mi(t,3),true):[]}function so(n,t,r,e){var u=null==n?0:n.length;return u?(r&&typeof r!="number"&&Ui(n,t,r)&&(r=0,e=u),ne(n,t,r,e)):[]}function ho(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=null==r?0:kc(r); return u<0&&(u=Gl(e+u,0)),g(n,mi(t,3),u)}function po(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=e-1;return r!==X&&(u=kc(r),u=r<0?Gl(e+u,0):Hl(u,e-1)),g(n,mi(t,3),u,true)}function _o(n){return(null==n?0:n.length)?ee(n,1):[]}function vo(n){return(null==n?0:n.length)?ee(n,Wn):[]}function go(n,t){return(null==n?0:n.length)?(t=t===X?1:kc(t),ee(n,t)):[]}function yo(n){for(var t=-1,r=null==n?0:n.length,e={};++t<r;){var u=n[t];Tr(e,u[0],u[1])}return e}function bo(n){return n&&n.length?n[0]:X}function wo(n,t,r){ var e=null==n?0:n.length;if(!e)return-1;var u=null==r?0:kc(r);return u<0&&(u=Gl(e+u,0)),y(n,t,u)}function mo(n){return(null==n?0:n.length)?au(n,0,-1):[]}function xo(n,t){return null==n?"":Kl.call(n,t)}function jo(n){var t=null==n?0:n.length;return t?n[t-1]:X}function Ao(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=e;return r!==X&&(u=kc(r),u=u<0?Gl(e+u,0):Hl(u,e-1)),t===t?K(n,t,u):g(n,b,u,true)}function ko(n,t){return n&&n.length?Ge(n,kc(t)):X}function Io(n,t){return n&&n.length&&t&&t.length?Xe(n,t):n; }function Oo(n,t,r){return n&&n.length&&t&&t.length?Xe(n,t,mi(r,2)):n}function Ro(n,t,r){return n&&n.length&&t&&t.length?Xe(n,t,X,r):n}function zo(n,t){var r=[];if(!n||!n.length)return r;var e=-1,u=[],i=n.length;for(t=mi(t,3);++e<i;){var o=n[e];t(o,e,n)&&(r.push(o),u.push(e))}return nu(n,u),r}function Eo(n){return null==n?n:Xl.call(n)}function So(n,t,r){var e=null==n?0:n.length;return e?(r&&typeof r!="number"&&Ui(n,t,r)?(t=0,r=e):(t=null==t?0:kc(t),r=r===X?e:kc(r)),au(n,t,r)):[]}function Wo(n,t){ return su(n,t)}function Lo(n,t,r){return hu(n,t,mi(r,2))}function Co(n,t){var r=null==n?0:n.length;if(r){var e=su(n,t);if(e<r&&Gf(n[e],t))return e}return-1}function Uo(n,t){return su(n,t,true)}function Bo(n,t,r){return hu(n,t,mi(r,2),true)}function To(n,t){if(null==n?0:n.length){var r=su(n,t,true)-1;if(Gf(n[r],t))return r}return-1}function $o(n){return n&&n.length?pu(n):[]}function Do(n,t){return n&&n.length?pu(n,mi(t,2)):[]}function Mo(n){var t=null==n?0:n.length;return t?au(n,1,t):[]}function Fo(n,t,r){ return n&&n.length?(t=r||t===X?1:kc(t),au(n,0,t<0?0:t)):[]}function No(n,t,r){var e=null==n?0:n.length;return e?(t=r||t===X?1:kc(t),t=e-t,au(n,t<0?0:t,e)):[]}function Po(n,t){return n&&n.length?bu(n,mi(t,3),false,true):[]}function qo(n,t){return n&&n.length?bu(n,mi(t,3)):[]}function Zo(n){return n&&n.length?gu(n):[]}function Ko(n,t){return n&&n.length?gu(n,mi(t,2)):[]}function Vo(n,t){return t=typeof t=="function"?t:X,n&&n.length?gu(n,X,t):[]}function Go(n){if(!n||!n.length)return[];var t=0;return n=i(n,function(n){ if(Jf(n))return t=Gl(n.length,t),true}),I(t,function(t){return c(n,m(t))})}function Ho(t,r){if(!t||!t.length)return[];var e=Go(t);return null==r?e:c(e,function(t){return n(r,X,t)})}function Jo(n,t){return xu(n||[],t||[],Wr)}function Yo(n,t){return xu(n||[],t||[],fu)}function Qo(n){var t=Z(n);return t.__chain__=true,t}function Xo(n,t){return t(n),n}function nf(n,t){return t(n)}function tf(){return Qo(this)}function rf(){return new Y(this.value(),this.__chain__)}function ef(){this.__values__===X&&(this.__values__=jc(this.value())); var n=this.__index__>=this.__values__.length;return{done:n,value:n?X:this.__values__[this.__index__++]}}function uf(){return this}function of(n){for(var t,r=this;r instanceof J;){var e=eo(r);e.__index__=0,e.__values__=X,t?u.__wrapped__=e:t=e;var u=e;r=r.__wrapped__}return u.__wrapped__=n,t}function ff(){var n=this.__wrapped__;if(n instanceof Ut){var t=n;return this.__actions__.length&&(t=new Ut(this)),t=t.reverse(),t.__actions__.push({func:nf,args:[Eo],thisArg:X}),new Y(t,this.__chain__)}return this.thru(Eo); }function cf(){return wu(this.__wrapped__,this.__actions__)}function af(n,t,r){var e=bh(n)?u:Jr;return r&&Ui(n,t,r)&&(t=X),e(n,mi(t,3))}function lf(n,t){return(bh(n)?i:te)(n,mi(t,3))}function sf(n,t){return ee(yf(n,t),1)}function hf(n,t){return ee(yf(n,t),Wn)}function pf(n,t,r){return r=r===X?1:kc(r),ee(yf(n,t),r)}function _f(n,t){return(bh(n)?r:ys)(n,mi(t,3))}function vf(n,t){return(bh(n)?e:ds)(n,mi(t,3))}function gf(n,t,r,e){n=Hf(n)?n:ra(n),r=r&&!e?kc(r):0;var u=n.length;return r<0&&(r=Gl(u+r,0)), dc(n)?r<=u&&n.indexOf(t,r)>-1:!!u&&y(n,t,r)>-1}function yf(n,t){return(bh(n)?c:Pe)(n,mi(t,3))}function df(n,t,r,e){return null==n?[]:(bh(t)||(t=null==t?[]:[t]),r=e?X:r,bh(r)||(r=null==r?[]:[r]),He(n,t,r))}function bf(n,t,r){var e=bh(n)?l:j,u=arguments.length<3;return e(n,mi(t,4),r,u,ys)}function wf(n,t,r){var e=bh(n)?s:j,u=arguments.length<3;return e(n,mi(t,4),r,u,ds)}function mf(n,t){return(bh(n)?i:te)(n,Uf(mi(t,3)))}function xf(n){return(bh(n)?Rr:iu)(n)}function jf(n,t,r){return t=(r?Ui(n,t,r):t===X)?1:kc(t), (bh(n)?zr:ou)(n,t)}function Af(n){return(bh(n)?Er:cu)(n)}function kf(n){if(null==n)return 0;if(Hf(n))return dc(n)?V(n):n.length;var t=zs(n);return t==Hn||t==rt?n.size:Me(n).length}function If(n,t,r){var e=bh(n)?h:lu;return r&&Ui(n,t,r)&&(t=X),e(n,mi(t,3))}function Of(n,t){if(typeof t!="function")throw new pl(en);return n=kc(n),function(){if(--n<1)return t.apply(this,arguments)}}function Rf(n,t,r){return t=r?X:t,t=n&&null==t?n.length:t,ai(n,xn,X,X,X,X,t)}function zf(n,t){var r;if(typeof t!="function")throw new pl(en); return n=kc(n),function(){return--n>0&&(r=t.apply(this,arguments)),n<=1&&(t=X),r}}function Ef(n,t,r){t=r?X:t;var e=ai(n,dn,X,X,X,X,X,t);return e.placeholder=Ef.placeholder,e}function Sf(n,t,r){t=r?X:t;var e=ai(n,bn,X,X,X,X,X,t);return e.placeholder=Sf.placeholder,e}function Wf(n,t,r){function e(t){var r=h,e=p;return h=p=X,d=t,v=n.apply(e,r)}function u(n){return d=n,g=Ws(f,t),b?e(n):v}function i(n){var r=n-y,e=n-d,u=t-r;return w?Hl(u,_-e):u}function o(n){var r=n-y,e=n-d;return y===X||r>=t||r<0||w&&e>=_; }function f(){var n=fh();return o(n)?c(n):(g=Ws(f,i(n)),X)}function c(n){return g=X,m&&h?e(n):(h=p=X,v)}function a(){g!==X&&As(g),d=0,h=y=p=g=X}function l(){return g===X?v:c(fh())}function s(){var n=fh(),r=o(n);if(h=arguments,p=this,y=n,r){if(g===X)return u(y);if(w)return As(g),g=Ws(f,t),e(y)}return g===X&&(g=Ws(f,t)),v}var h,p,_,v,g,y,d=0,b=false,w=false,m=true;if(typeof n!="function")throw new pl(en);return t=Oc(t)||0,fc(r)&&(b=!!r.leading,w="maxWait"in r,_=w?Gl(Oc(r.maxWait)||0,t):_,m="trailing"in r?!!r.trailing:m), s.cancel=a,s.flush=l,s}function Lf(n){return ai(n,An)}function Cf(n,t){if(typeof n!="function"||null!=t&&typeof t!="function")throw new pl(en);var r=function(){var e=arguments,u=t?t.apply(this,e):e[0],i=r.cache;if(i.has(u))return i.get(u);var o=n.apply(this,e);return r.cache=i.set(u,o)||i,o};return r.cache=new(Cf.Cache||hr),r}function Uf(n){if(typeof n!="function")throw new pl(en);return function(){var t=arguments;switch(t.length){case 0:return!n.call(this);case 1:return!n.call(this,t[0]);case 2: return!n.call(this,t[0],t[1]);case 3:return!n.call(this,t[0],t[1],t[2])}return!n.apply(this,t)}}function Bf(n){return zf(2,n)}function Tf(n,t){if(typeof n!="function")throw new pl(en);return t=t===X?t:kc(t),uu(n,t)}function $f(t,r){if(typeof t!="function")throw new pl(en);return r=null==r?0:Gl(kc(r),0),uu(function(e){var u=e[r],i=Iu(e,0,r);return u&&a(i,u),n(t,this,i)})}function Df(n,t,r){var e=true,u=true;if(typeof n!="function")throw new pl(en);return fc(r)&&(e="leading"in r?!!r.leading:e,u="trailing"in r?!!r.trailing:u), Wf(n,t,{leading:e,maxWait:t,trailing:u})}function Mf(n){return Rf(n,1)}function Ff(n,t){return ph(Au(t),n)}function Nf(){if(!arguments.length)return[];var n=arguments[0];return bh(n)?n:[n]}function Pf(n){return Nr(n,hn)}function qf(n,t){return t=typeof t=="function"?t:X,Nr(n,hn,t)}function Zf(n){return Nr(n,ln|hn)}function Kf(n,t){return t=typeof t=="function"?t:X,Nr(n,ln|hn,t)}function Vf(n,t){return null==t||qr(n,t,Pc(t))}function Gf(n,t){return n===t||n!==n&&t!==t}function Hf(n){return null!=n&&oc(n.length)&&!uc(n); }function Jf(n){return cc(n)&&Hf(n)}function Yf(n){return n===true||n===false||cc(n)&&we(n)==Pn}function Qf(n){return cc(n)&&1===n.nodeType&&!gc(n)}function Xf(n){if(null==n)return true;if(Hf(n)&&(bh(n)||typeof n=="string"||typeof n.splice=="function"||mh(n)||Ih(n)||dh(n)))return!n.length;var t=zs(n);if(t==Hn||t==rt)return!n.size;if(Mi(n))return!Me(n).length;for(var r in n)if(bl.call(n,r))return false;return true}function nc(n,t){return Se(n,t)}function tc(n,t,r){r=typeof r=="function"?r:X;var e=r?r(n,t):X;return e===X?Se(n,t,X,r):!!e; }function rc(n){if(!cc(n))return false;var t=we(n);return t==Kn||t==Zn||typeof n.message=="string"&&typeof n.name=="string"&&!gc(n)}function ec(n){return typeof n=="number"&&Zl(n)}function uc(n){if(!fc(n))return false;var t=we(n);return t==Vn||t==Gn||t==Nn||t==nt}function ic(n){return typeof n=="number"&&n==kc(n)}function oc(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=Ln}function fc(n){var t=typeof n;return null!=n&&("object"==t||"function"==t)}function cc(n){return null!=n&&typeof n=="object"}function ac(n,t){ return n===t||Ce(n,t,ji(t))}function lc(n,t,r){return r=typeof r=="function"?r:X,Ce(n,t,ji(t),r)}function sc(n){return vc(n)&&n!=+n}function hc(n){if(Es(n))throw new fl(rn);return Ue(n)}function pc(n){return null===n}function _c(n){return null==n}function vc(n){return typeof n=="number"||cc(n)&&we(n)==Jn}function gc(n){if(!cc(n)||we(n)!=Qn)return false;var t=El(n);if(null===t)return true;var r=bl.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&dl.call(r)==jl}function yc(n){ return ic(n)&&n>=-Ln&&n<=Ln}function dc(n){return typeof n=="string"||!bh(n)&&cc(n)&&we(n)==et}function bc(n){return typeof n=="symbol"||cc(n)&&we(n)==ut}function wc(n){return n===X}function mc(n){return cc(n)&&zs(n)==ot}function xc(n){return cc(n)&&we(n)==ft}function jc(n){if(!n)return[];if(Hf(n))return dc(n)?G(n):Tu(n);if(Ul&&n[Ul])return D(n[Ul]());var t=zs(n);return(t==Hn?M:t==rt?P:ra)(n)}function Ac(n){if(!n)return 0===n?n:0;if(n=Oc(n),n===Wn||n===-Wn){return(n<0?-1:1)*Cn}return n===n?n:0}function kc(n){ var t=Ac(n),r=t%1;return t===t?r?t-r:t:0}function Ic(n){return n?Fr(kc(n),0,Bn):0}function Oc(n){if(typeof n=="number")return n;if(bc(n))return Un;if(fc(n)){var t=typeof n.valueOf=="function"?n.valueOf():n;n=fc(t)?t+"":t}if(typeof n!="string")return 0===n?n:+n;n=R(n);var r=Zt.test(n);return r||Vt.test(n)?Xr(n.slice(2),r?2:8):qt.test(n)?Un:+n}function Rc(n){return $u(n,qc(n))}function zc(n){return n?Fr(kc(n),-Ln,Ln):0===n?n:0}function Ec(n){return null==n?"":vu(n)}function Sc(n,t){var r=gs(n);return null==t?r:Ur(r,t); }function Wc(n,t){return v(n,mi(t,3),ue)}function Lc(n,t){return v(n,mi(t,3),oe)}function Cc(n,t){return null==n?n:bs(n,mi(t,3),qc)}function Uc(n,t){return null==n?n:ws(n,mi(t,3),qc)}function Bc(n,t){return n&&ue(n,mi(t,3))}function Tc(n,t){return n&&oe(n,mi(t,3))}function $c(n){return null==n?[]:fe(n,Pc(n))}function Dc(n){return null==n?[]:fe(n,qc(n))}function Mc(n,t,r){var e=null==n?X:_e(n,t);return e===X?r:e}function Fc(n,t){return null!=n&&Ri(n,t,xe)}function Nc(n,t){return null!=n&&Ri(n,t,je); }function Pc(n){return Hf(n)?Or(n):Me(n)}function qc(n){return Hf(n)?Or(n,true):Fe(n)}function Zc(n,t){var r={};return t=mi(t,3),ue(n,function(n,e,u){Tr(r,t(n,e,u),n)}),r}function Kc(n,t){var r={};return t=mi(t,3),ue(n,function(n,e,u){Tr(r,e,t(n,e,u))}),r}function Vc(n,t){return Gc(n,Uf(mi(t)))}function Gc(n,t){if(null==n)return{};var r=c(di(n),function(n){return[n]});return t=mi(t),Ye(n,r,function(n,r){return t(n,r[0])})}function Hc(n,t,r){t=ku(t,n);var e=-1,u=t.length;for(u||(u=1,n=X);++e<u;){var i=null==n?X:n[no(t[e])]; i===X&&(e=u,i=r),n=uc(i)?i.call(n):i}return n}function Jc(n,t,r){return null==n?n:fu(n,t,r)}function Yc(n,t,r,e){return e=typeof e=="function"?e:X,null==n?n:fu(n,t,r,e)}function Qc(n,t,e){var u=bh(n),i=u||mh(n)||Ih(n);if(t=mi(t,4),null==e){var o=n&&n.constructor;e=i?u?new o:[]:fc(n)&&uc(o)?gs(El(n)):{}}return(i?r:ue)(n,function(n,r,u){return t(e,n,r,u)}),e}function Xc(n,t){return null==n||yu(n,t)}function na(n,t,r){return null==n?n:du(n,t,Au(r))}function ta(n,t,r,e){return e=typeof e=="function"?e:X, null==n?n:du(n,t,Au(r),e)}function ra(n){return null==n?[]:E(n,Pc(n))}function ea(n){return null==n?[]:E(n,qc(n))}function ua(n,t,r){return r===X&&(r=t,t=X),r!==X&&(r=Oc(r),r=r===r?r:0),t!==X&&(t=Oc(t),t=t===t?t:0),Fr(Oc(n),t,r)}function ia(n,t,r){return t=Ac(t),r===X?(r=t,t=0):r=Ac(r),n=Oc(n),Ae(n,t,r)}function oa(n,t,r){if(r&&typeof r!="boolean"&&Ui(n,t,r)&&(t=r=X),r===X&&(typeof t=="boolean"?(r=t,t=X):typeof n=="boolean"&&(r=n,n=X)),n===X&&t===X?(n=0,t=1):(n=Ac(n),t===X?(t=n,n=0):t=Ac(t)),n>t){ var e=n;n=t,t=e}if(r||n%1||t%1){var u=Ql();return Hl(n+u*(t-n+Qr("1e-"+((u+"").length-1))),t)}return tu(n,t)}function fa(n){return Qh(Ec(n).toLowerCase())}function ca(n){return n=Ec(n),n&&n.replace(Ht,ve).replace(Mr,"")}function aa(n,t,r){n=Ec(n),t=vu(t);var e=n.length;r=r===X?e:Fr(kc(r),0,e);var u=r;return r-=t.length,r>=0&&n.slice(r,u)==t}function la(n){return n=Ec(n),n&&kt.test(n)?n.replace(jt,ge):n}function sa(n){return n=Ec(n),n&&Lt.test(n)?n.replace(Wt,"\\$&"):n}function ha(n,t,r){n=Ec(n),t=kc(t); var e=t?V(n):0;if(!t||e>=t)return n;var u=(t-e)/2;return ri(Nl(u),r)+n+ri(Fl(u),r)}function pa(n,t,r){n=Ec(n),t=kc(t);var e=t?V(n):0;return t&&e<t?n+ri(t-e,r):n}function _a(n,t,r){n=Ec(n),t=kc(t);var e=t?V(n):0;return t&&e<t?ri(t-e,r)+n:n}function va(n,t,r){return r||null==t?t=0:t&&(t=+t),Yl(Ec(n).replace(Ct,""),t||0)}function ga(n,t,r){return t=(r?Ui(n,t,r):t===X)?1:kc(t),eu(Ec(n),t)}function ya(){var n=arguments,t=Ec(n[0]);return n.length<3?t:t.replace(n[1],n[2])}function da(n,t,r){return r&&typeof r!="number"&&Ui(n,t,r)&&(t=r=X), (r=r===X?Bn:r>>>0)?(n=Ec(n),n&&(typeof t=="string"||null!=t&&!Ah(t))&&(t=vu(t),!t&&T(n))?Iu(G(n),0,r):n.split(t,r)):[]}function ba(n,t,r){return n=Ec(n),r=null==r?0:Fr(kc(r),0,n.length),t=vu(t),n.slice(r,r+t.length)==t}function wa(n,t,e){var u=Z.templateSettings;e&&Ui(n,t,e)&&(t=X),n=Ec(n),t=Wh({},t,u,li);var i=Wh({},t.imports,u.imports,li),o=Pc(i),f=E(i,o);r(o,function(n){if(Mt.test(n))throw new fl(on)});var c,a,l=0,s=t.interpolate||Jt,h="__p+='",p=sl((t.escape||Jt).source+"|"+s.source+"|"+(s===Rt?Nt:Jt).source+"|"+(t.evaluate||Jt).source+"|$","g"),_=bl.call(t,"sourceURL")?"//# sourceURL="+(t.sourceURL+"").replace(/\s/g," ")+"\n":""; n.replace(p,function(t,r,e,u,i,o){return e||(e=u),h+=n.slice(l,o).replace(Yt,U),r&&(c=true,h+="'+__e("+r+")+'"),i&&(a=true,h+="';"+i+";\n__p+='"),e&&(h+="'+((__t=("+e+"))==null?'':__t)+'"),l=o+t.length,t}),h+="';";var v=bl.call(t,"variable")&&t.variable;if(v){if(Mt.test(v))throw new fl(un)}else h="with(obj){"+h+"}";h=(a?h.replace(bt,""):h).replace(wt,"$1").replace(mt,"$1;"),h="function("+(v||"obj")+"){"+(v?"":"obj||(obj={});")+"var __t,__p=''"+(c?",__e=_.escape":"")+(a?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+h+"return __p}"; var g=Xh(function(){return cl(o,_+"return "+h).apply(X,f)});if(g.source=h,rc(g))throw g;return g}function ma(n){return Ec(n).toLowerCase()}function xa(n){return Ec(n).toUpperCase()}function ja(n,t,r){if(n=Ec(n),n&&(r||t===X))return R(n);if(!n||!(t=vu(t)))return n;var e=G(n),u=G(t);return Iu(e,W(e,u),L(e,u)+1).join("")}function Aa(n,t,r){if(n=Ec(n),n&&(r||t===X))return n.slice(0,H(n)+1);if(!n||!(t=vu(t)))return n;var e=G(n);return Iu(e,0,L(e,G(t))+1).join("")}function ka(n,t,r){if(n=Ec(n),n&&(r||t===X))return n.replace(Ct,""); if(!n||!(t=vu(t)))return n;var e=G(n);return Iu(e,W(e,G(t))).join("")}function Ia(n,t){var r=kn,e=In;if(fc(t)){var u="separator"in t?t.separator:u;r="length"in t?kc(t.length):r,e="omission"in t?vu(t.omission):e}n=Ec(n);var i=n.length;if(T(n)){var o=G(n);i=o.length}if(r>=i)return n;var f=r-V(e);if(f<1)return e;var c=o?Iu(o,0,f).join(""):n.slice(0,f);if(u===X)return c+e;if(o&&(f+=c.length-f),Ah(u)){if(n.slice(f).search(u)){var a,l=c;for(u.global||(u=sl(u.source,Ec(Pt.exec(u))+"g")),u.lastIndex=0;a=u.exec(l);)var s=a.index; c=c.slice(0,s===X?f:s)}}else if(n.indexOf(vu(u),f)!=f){var h=c.lastIndexOf(u);h>-1&&(c=c.slice(0,h))}return c+e}function Oa(n){return n=Ec(n),n&&At.test(n)?n.replace(xt,ye):n}function Ra(n,t,r){return n=Ec(n),t=r?X:t,t===X?$(n)?Q(n):_(n):n.match(t)||[]}function za(t){var r=null==t?0:t.length,e=mi();return t=r?c(t,function(n){if("function"!=typeof n[1])throw new pl(en);return[e(n[0]),n[1]]}):[],uu(function(e){for(var u=-1;++u<r;){var i=t[u];if(n(i[0],this,e))return n(i[1],this,e)}})}function Ea(n){ return Pr(Nr(n,ln))}function Sa(n){return function(){return n}}function Wa(n,t){return null==n||n!==n?t:n}function La(n){return n}function Ca(n){return De(typeof n=="function"?n:Nr(n,ln))}function Ua(n){return qe(Nr(n,ln))}function Ba(n,t){return Ze(n,Nr(t,ln))}function Ta(n,t,e){var u=Pc(t),i=fe(t,u);null!=e||fc(t)&&(i.length||!u.length)||(e=t,t=n,n=this,i=fe(t,Pc(t)));var o=!(fc(e)&&"chain"in e&&!e.chain),f=uc(n);return r(i,function(r){var e=t[r];n[r]=e,f&&(n.prototype[r]=function(){var t=this.__chain__; if(o||t){var r=n(this.__wrapped__);return(r.__actions__=Tu(this.__actions__)).push({func:e,args:arguments,thisArg:n}),r.__chain__=t,r}return e.apply(n,a([this.value()],arguments))})}),n}function $a(){return re._===this&&(re._=Al),this}function Da(){}function Ma(n){return n=kc(n),uu(function(t){return Ge(t,n)})}function Fa(n){return Bi(n)?m(no(n)):Qe(n)}function Na(n){return function(t){return null==n?X:_e(n,t)}}function Pa(){return[]}function qa(){return false}function Za(){return{}}function Ka(){return""; }function Va(){return true}function Ga(n,t){if(n=kc(n),n<1||n>Ln)return[];var r=Bn,e=Hl(n,Bn);t=mi(t),n-=Bn;for(var u=I(e,t);++r<n;)t(r);return u}function Ha(n){return bh(n)?c(n,no):bc(n)?[n]:Tu(Cs(Ec(n)))}function Ja(n){var t=++wl;return Ec(n)+t}function Ya(n){return n&&n.length?Yr(n,La,me):X}function Qa(n,t){return n&&n.length?Yr(n,mi(t,2),me):X}function Xa(n){return w(n,La)}function nl(n,t){return w(n,mi(t,2))}function tl(n){return n&&n.length?Yr(n,La,Ne):X}function rl(n,t){return n&&n.length?Yr(n,mi(t,2),Ne):X; }function el(n){return n&&n.length?k(n,La):0}function ul(n,t){return n&&n.length?k(n,mi(t,2)):0}x=null==x?re:be.defaults(re.Object(),x,be.pick(re,Zr));var il=x.Array,ol=x.Date,fl=x.Error,cl=x.Function,al=x.Math,ll=x.Object,sl=x.RegExp,hl=x.String,pl=x.TypeError,_l=il.prototype,vl=cl.prototype,gl=ll.prototype,yl=x["__core-js_shared__"],dl=vl.toString,bl=gl.hasOwnProperty,wl=0,ml=function(){var n=/[^.]+$/.exec(yl&&yl.keys&&yl.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}(),xl=gl.toString,jl=dl.call(ll),Al=re._,kl=sl("^"+dl.call(bl).replace(Wt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Il=ie?x.Buffer:X,Ol=x.Symbol,Rl=x.Uint8Array,zl=Il?Il.allocUnsafe:X,El=F(ll.getPrototypeOf,ll),Sl=ll.create,Wl=gl.propertyIsEnumerable,Ll=_l.splice,Cl=Ol?Ol.isConcatSpreadable:X,Ul=Ol?Ol.iterator:X,Bl=Ol?Ol.toStringTag:X,Tl=function(){ try{var n=Ai(ll,"defineProperty");return n({},"",{}),n}catch(n){}}(),$l=x.clearTimeout!==re.clearTimeout&&x.clearTimeout,Dl=ol&&ol.now!==re.Date.now&&ol.now,Ml=x.setTimeout!==re.setTimeout&&x.setTimeout,Fl=al.ceil,Nl=al.floor,Pl=ll.getOwnPropertySymbols,ql=Il?Il.isBuffer:X,Zl=x.isFinite,Kl=_l.join,Vl=F(ll.keys,ll),Gl=al.max,Hl=al.min,Jl=ol.now,Yl=x.parseInt,Ql=al.random,Xl=_l.reverse,ns=Ai(x,"DataView"),ts=Ai(x,"Map"),rs=Ai(x,"Promise"),es=Ai(x,"Set"),us=Ai(x,"WeakMap"),is=Ai(ll,"create"),os=us&&new us,fs={},cs=to(ns),as=to(ts),ls=to(rs),ss=to(es),hs=to(us),ps=Ol?Ol.prototype:X,_s=ps?ps.valueOf:X,vs=ps?ps.toString:X,gs=function(){ function n(){}return function(t){if(!fc(t))return{};if(Sl)return Sl(t);n.prototype=t;var r=new n;return n.prototype=X,r}}();Z.templateSettings={escape:It,evaluate:Ot,interpolate:Rt,variable:"",imports:{_:Z}},Z.prototype=J.prototype,Z.prototype.constructor=Z,Y.prototype=gs(J.prototype),Y.prototype.constructor=Y,Ut.prototype=gs(J.prototype),Ut.prototype.constructor=Ut,nr.prototype.clear=tr,nr.prototype.delete=rr,nr.prototype.get=er,nr.prototype.has=ur,nr.prototype.set=ir,or.prototype.clear=fr,or.prototype.delete=cr, or.prototype.get=ar,or.prototype.has=lr,or.prototype.set=sr,hr.prototype.clear=pr,hr.prototype.delete=_r,hr.prototype.get=vr,hr.prototype.has=gr,hr.prototype.set=yr,dr.prototype.add=dr.prototype.push=br,dr.prototype.has=wr,mr.prototype.clear=xr,mr.prototype.delete=jr,mr.prototype.get=Ar,mr.prototype.has=kr,mr.prototype.set=Ir;var ys=Pu(ue),ds=Pu(oe,true),bs=qu(),ws=qu(true),ms=os?function(n,t){return os.set(n,t),n}:La,xs=Tl?function(n,t){return Tl(n,"toString",{configurable:true,enumerable:false,value:Sa(t), writable:true})}:La,js=uu,As=$l||function(n){return re.clearTimeout(n)},ks=es&&1/P(new es([,-0]))[1]==Wn?function(n){return new es(n)}:Da,Is=os?function(n){return os.get(n)}:Da,Os=Pl?function(n){return null==n?[]:(n=ll(n),i(Pl(n),function(t){return Wl.call(n,t)}))}:Pa,Rs=Pl?function(n){for(var t=[];n;)a(t,Os(n)),n=El(n);return t}:Pa,zs=we;(ns&&zs(new ns(new ArrayBuffer(1)))!=at||ts&&zs(new ts)!=Hn||rs&&zs(rs.resolve())!=Xn||es&&zs(new es)!=rt||us&&zs(new us)!=ot)&&(zs=function(n){var t=we(n),r=t==Qn?n.constructor:X,e=r?to(r):""; if(e)switch(e){case cs:return at;case as:return Hn;case ls:return Xn;case ss:return rt;case hs:return ot}return t});var Es=yl?uc:qa,Ss=Qi(ms),Ws=Ml||function(n,t){return re.setTimeout(n,t)},Ls=Qi(xs),Cs=Pi(function(n){var t=[];return 46===n.charCodeAt(0)&&t.push(""),n.replace(St,function(n,r,e,u){t.push(e?u.replace(Ft,"$1"):r||n)}),t}),Us=uu(function(n,t){return Jf(n)?Hr(n,ee(t,1,Jf,true)):[]}),Bs=uu(function(n,t){var r=jo(t);return Jf(r)&&(r=X),Jf(n)?Hr(n,ee(t,1,Jf,true),mi(r,2)):[]}),Ts=uu(function(n,t){ var r=jo(t);return Jf(r)&&(r=X),Jf(n)?Hr(n,ee(t,1,Jf,true),X,r):[]}),$s=uu(function(n){var t=c(n,ju);return t.length&&t[0]===n[0]?ke(t):[]}),Ds=uu(function(n){var t=jo(n),r=c(n,ju);return t===jo(r)?t=X:r.pop(),r.length&&r[0]===n[0]?ke(r,mi(t,2)):[]}),Ms=uu(function(n){var t=jo(n),r=c(n,ju);return t=typeof t=="function"?t:X,t&&r.pop(),r.length&&r[0]===n[0]?ke(r,X,t):[]}),Fs=uu(Io),Ns=gi(function(n,t){var r=null==n?0:n.length,e=$r(n,t);return nu(n,c(t,function(n){return Ci(n,r)?+n:n}).sort(Lu)),e}),Ps=uu(function(n){ return gu(ee(n,1,Jf,true))}),qs=uu(function(n){var t=jo(n);return Jf(t)&&(t=X),gu(ee(n,1,Jf,true),mi(t,2))}),Zs=uu(function(n){var t=jo(n);return t=typeof t=="function"?t:X,gu(ee(n,1,Jf,true),X,t)}),Ks=uu(function(n,t){return Jf(n)?Hr(n,t):[]}),Vs=uu(function(n){return mu(i(n,Jf))}),Gs=uu(function(n){var t=jo(n);return Jf(t)&&(t=X),mu(i(n,Jf),mi(t,2))}),Hs=uu(function(n){var t=jo(n);return t=typeof t=="function"?t:X,mu(i(n,Jf),X,t)}),Js=uu(Go),Ys=uu(function(n){var t=n.length,r=t>1?n[t-1]:X;return r=typeof r=="function"?(n.pop(), r):X,Ho(n,r)}),Qs=gi(function(n){var t=n.length,r=t?n[0]:0,e=this.__wrapped__,u=function(t){return $r(t,n)};return!(t>1||this.__actions__.length)&&e instanceof Ut&&Ci(r)?(e=e.slice(r,+r+(t?1:0)),e.__actions__.push({func:nf,args:[u],thisArg:X}),new Y(e,this.__chain__).thru(function(n){return t&&!n.length&&n.push(X),n})):this.thru(u)}),Xs=Fu(function(n,t,r){bl.call(n,r)?++n[r]:Tr(n,r,1)}),nh=Ju(ho),th=Ju(po),rh=Fu(function(n,t,r){bl.call(n,r)?n[r].push(t):Tr(n,r,[t])}),eh=uu(function(t,r,e){var u=-1,i=typeof r=="function",o=Hf(t)?il(t.length):[]; return ys(t,function(t){o[++u]=i?n(r,t,e):Oe(t,r,e)}),o}),uh=Fu(function(n,t,r){Tr(n,r,t)}),ih=Fu(function(n,t,r){n[r?0:1].push(t)},function(){return[[],[]]}),oh=uu(function(n,t){if(null==n)return[];var r=t.length;return r>1&&Ui(n,t[0],t[1])?t=[]:r>2&&Ui(t[0],t[1],t[2])&&(t=[t[0]]),He(n,ee(t,1),[])}),fh=Dl||function(){return re.Date.now()},ch=uu(function(n,t,r){var e=vn;if(r.length){var u=N(r,wi(ch));e|=wn}return ai(n,e,t,r,u)}),ah=uu(function(n,t,r){var e=vn|gn;if(r.length){var u=N(r,wi(ah));e|=wn; }return ai(t,e,n,r,u)}),lh=uu(function(n,t){return Gr(n,1,t)}),sh=uu(function(n,t,r){return Gr(n,Oc(t)||0,r)});Cf.Cache=hr;var hh=js(function(t,r){r=1==r.length&&bh(r[0])?c(r[0],z(mi())):c(ee(r,1),z(mi()));var e=r.length;return uu(function(u){for(var i=-1,o=Hl(u.length,e);++i<o;)u[i]=r[i].call(this,u[i]);return n(t,this,u)})}),ph=uu(function(n,t){return ai(n,wn,X,t,N(t,wi(ph)))}),_h=uu(function(n,t){return ai(n,mn,X,t,N(t,wi(_h)))}),vh=gi(function(n,t){return ai(n,jn,X,X,X,t)}),gh=ii(me),yh=ii(function(n,t){ return n>=t}),dh=Re(function(){return arguments}())?Re:function(n){return cc(n)&&bl.call(n,"callee")&&!Wl.call(n,"callee")},bh=il.isArray,wh=ce?z(ce):ze,mh=ql||qa,xh=ae?z(ae):Ee,jh=le?z(le):Le,Ah=se?z(se):Be,kh=he?z(he):Te,Ih=pe?z(pe):$e,Oh=ii(Ne),Rh=ii(function(n,t){return n<=t}),zh=Nu(function(n,t){if(Mi(t)||Hf(t))return $u(t,Pc(t),n),X;for(var r in t)bl.call(t,r)&&Wr(n,r,t[r])}),Eh=Nu(function(n,t){$u(t,qc(t),n)}),Sh=Nu(function(n,t,r,e){$u(t,qc(t),n,e)}),Wh=Nu(function(n,t,r,e){$u(t,Pc(t),n,e); }),Lh=gi($r),Ch=uu(function(n,t){n=ll(n);var r=-1,e=t.length,u=e>2?t[2]:X;for(u&&Ui(t[0],t[1],u)&&(e=1);++r<e;)for(var i=t[r],o=qc(i),f=-1,c=o.length;++f<c;){var a=o[f],l=n[a];(l===X||Gf(l,gl[a])&&!bl.call(n,a))&&(n[a]=i[a])}return n}),Uh=uu(function(t){return t.push(X,si),n(Mh,X,t)}),Bh=Xu(function(n,t,r){null!=t&&typeof t.toString!="function"&&(t=xl.call(t)),n[t]=r},Sa(La)),Th=Xu(function(n,t,r){null!=t&&typeof t.toString!="function"&&(t=xl.call(t)),bl.call(n,t)?n[t].push(r):n[t]=[r]},mi),$h=uu(Oe),Dh=Nu(function(n,t,r){ Ke(n,t,r)}),Mh=Nu(function(n,t,r,e){Ke(n,t,r,e)}),Fh=gi(function(n,t){var r={};if(null==n)return r;var e=false;t=c(t,function(t){return t=ku(t,n),e||(e=t.length>1),t}),$u(n,di(n),r),e&&(r=Nr(r,ln|sn|hn,hi));for(var u=t.length;u--;)yu(r,t[u]);return r}),Nh=gi(function(n,t){return null==n?{}:Je(n,t)}),Ph=ci(Pc),qh=ci(qc),Zh=Vu(function(n,t,r){return t=t.toLowerCase(),n+(r?fa(t):t)}),Kh=Vu(function(n,t,r){return n+(r?"-":"")+t.toLowerCase()}),Vh=Vu(function(n,t,r){return n+(r?" ":"")+t.toLowerCase()}),Gh=Ku("toLowerCase"),Hh=Vu(function(n,t,r){ return n+(r?"_":"")+t.toLowerCase()}),Jh=Vu(function(n,t,r){return n+(r?" ":"")+Qh(t)}),Yh=Vu(function(n,t,r){return n+(r?" ":"")+t.toUpperCase()}),Qh=Ku("toUpperCase"),Xh=uu(function(t,r){try{return n(t,X,r)}catch(n){return rc(n)?n:new fl(n)}}),np=gi(function(n,t){return r(t,function(t){t=no(t),Tr(n,t,ch(n[t],n))}),n}),tp=Yu(),rp=Yu(true),ep=uu(function(n,t){return function(r){return Oe(r,n,t)}}),up=uu(function(n,t){return function(r){return Oe(n,r,t)}}),ip=ti(c),op=ti(u),fp=ti(h),cp=ui(),ap=ui(true),lp=ni(function(n,t){ return n+t},0),sp=fi("ceil"),hp=ni(function(n,t){return n/t},1),pp=fi("floor"),_p=ni(function(n,t){return n*t},1),vp=fi("round"),gp=ni(function(n,t){return n-t},0);return Z.after=Of,Z.ary=Rf,Z.assign=zh,Z.assignIn=Eh,Z.assignInWith=Sh,Z.assignWith=Wh,Z.at=Lh,Z.before=zf,Z.bind=ch,Z.bindAll=np,Z.bindKey=ah,Z.castArray=Nf,Z.chain=Qo,Z.chunk=uo,Z.compact=io,Z.concat=oo,Z.cond=za,Z.conforms=Ea,Z.constant=Sa,Z.countBy=Xs,Z.create=Sc,Z.curry=Ef,Z.curryRight=Sf,Z.debounce=Wf,Z.defaults=Ch,Z.defaultsDeep=Uh, Z.defer=lh,Z.delay=sh,Z.difference=Us,Z.differenceBy=Bs,Z.differenceWith=Ts,Z.drop=fo,Z.dropRight=co,Z.dropRightWhile=ao,Z.dropWhile=lo,Z.fill=so,Z.filter=lf,Z.flatMap=sf,Z.flatMapDeep=hf,Z.flatMapDepth=pf,Z.flatten=_o,Z.flattenDeep=vo,Z.flattenDepth=go,Z.flip=Lf,Z.flow=tp,Z.flowRight=rp,Z.fromPairs=yo,Z.functions=$c,Z.functionsIn=Dc,Z.groupBy=rh,Z.initial=mo,Z.intersection=$s,Z.intersectionBy=Ds,Z.intersectionWith=Ms,Z.invert=Bh,Z.invertBy=Th,Z.invokeMap=eh,Z.iteratee=Ca,Z.keyBy=uh,Z.keys=Pc,Z.keysIn=qc, Z.map=yf,Z.mapKeys=Zc,Z.mapValues=Kc,Z.matches=Ua,Z.matchesProperty=Ba,Z.memoize=Cf,Z.merge=Dh,Z.mergeWith=Mh,Z.method=ep,Z.methodOf=up,Z.mixin=Ta,Z.negate=Uf,Z.nthArg=Ma,Z.omit=Fh,Z.omitBy=Vc,Z.once=Bf,Z.orderBy=df,Z.over=ip,Z.overArgs=hh,Z.overEvery=op,Z.overSome=fp,Z.partial=ph,Z.partialRight=_h,Z.partition=ih,Z.pick=Nh,Z.pickBy=Gc,Z.property=Fa,Z.propertyOf=Na,Z.pull=Fs,Z.pullAll=Io,Z.pullAllBy=Oo,Z.pullAllWith=Ro,Z.pullAt=Ns,Z.range=cp,Z.rangeRight=ap,Z.rearg=vh,Z.reject=mf,Z.remove=zo,Z.rest=Tf, Z.reverse=Eo,Z.sampleSize=jf,Z.set=Jc,Z.setWith=Yc,Z.shuffle=Af,Z.slice=So,Z.sortBy=oh,Z.sortedUniq=$o,Z.sortedUniqBy=Do,Z.split=da,Z.spread=$f,Z.tail=Mo,Z.take=Fo,Z.takeRight=No,Z.takeRightWhile=Po,Z.takeWhile=qo,Z.tap=Xo,Z.throttle=Df,Z.thru=nf,Z.toArray=jc,Z.toPairs=Ph,Z.toPairsIn=qh,Z.toPath=Ha,Z.toPlainObject=Rc,Z.transform=Qc,Z.unary=Mf,Z.union=Ps,Z.unionBy=qs,Z.unionWith=Zs,Z.uniq=Zo,Z.uniqBy=Ko,Z.uniqWith=Vo,Z.unset=Xc,Z.unzip=Go,Z.unzipWith=Ho,Z.update=na,Z.updateWith=ta,Z.values=ra,Z.valuesIn=ea, Z.without=Ks,Z.words=Ra,Z.wrap=Ff,Z.xor=Vs,Z.xorBy=Gs,Z.xorWith=Hs,Z.zip=Js,Z.zipObject=Jo,Z.zipObjectDeep=Yo,Z.zipWith=Ys,Z.entries=Ph,Z.entriesIn=qh,Z.extend=Eh,Z.extendWith=Sh,Ta(Z,Z),Z.add=lp,Z.attempt=Xh,Z.camelCase=Zh,Z.capitalize=fa,Z.ceil=sp,Z.clamp=ua,Z.clone=Pf,Z.cloneDeep=Zf,Z.cloneDeepWith=Kf,Z.cloneWith=qf,Z.conformsTo=Vf,Z.deburr=ca,Z.defaultTo=Wa,Z.divide=hp,Z.endsWith=aa,Z.eq=Gf,Z.escape=la,Z.escapeRegExp=sa,Z.every=af,Z.find=nh,Z.findIndex=ho,Z.findKey=Wc,Z.findLast=th,Z.findLastIndex=po, Z.findLastKey=Lc,Z.floor=pp,Z.forEach=_f,Z.forEachRight=vf,Z.forIn=Cc,Z.forInRight=Uc,Z.forOwn=Bc,Z.forOwnRight=Tc,Z.get=Mc,Z.gt=gh,Z.gte=yh,Z.has=Fc,Z.hasIn=Nc,Z.head=bo,Z.identity=La,Z.includes=gf,Z.indexOf=wo,Z.inRange=ia,Z.invoke=$h,Z.isArguments=dh,Z.isArray=bh,Z.isArrayBuffer=wh,Z.isArrayLike=Hf,Z.isArrayLikeObject=Jf,Z.isBoolean=Yf,Z.isBuffer=mh,Z.isDate=xh,Z.isElement=Qf,Z.isEmpty=Xf,Z.isEqual=nc,Z.isEqualWith=tc,Z.isError=rc,Z.isFinite=ec,Z.isFunction=uc,Z.isInteger=ic,Z.isLength=oc,Z.isMap=jh, Z.isMatch=ac,Z.isMatchWith=lc,Z.isNaN=sc,Z.isNative=hc,Z.isNil=_c,Z.isNull=pc,Z.isNumber=vc,Z.isObject=fc,Z.isObjectLike=cc,Z.isPlainObject=gc,Z.isRegExp=Ah,Z.isSafeInteger=yc,Z.isSet=kh,Z.isString=dc,Z.isSymbol=bc,Z.isTypedArray=Ih,Z.isUndefined=wc,Z.isWeakMap=mc,Z.isWeakSet=xc,Z.join=xo,Z.kebabCase=Kh,Z.last=jo,Z.lastIndexOf=Ao,Z.lowerCase=Vh,Z.lowerFirst=Gh,Z.lt=Oh,Z.lte=Rh,Z.max=Ya,Z.maxBy=Qa,Z.mean=Xa,Z.meanBy=nl,Z.min=tl,Z.minBy=rl,Z.stubArray=Pa,Z.stubFalse=qa,Z.stubObject=Za,Z.stubString=Ka, Z.stubTrue=Va,Z.multiply=_p,Z.nth=ko,Z.noConflict=$a,Z.noop=Da,Z.now=fh,Z.pad=ha,Z.padEnd=pa,Z.padStart=_a,Z.parseInt=va,Z.random=oa,Z.reduce=bf,Z.reduceRight=wf,Z.repeat=ga,Z.replace=ya,Z.result=Hc,Z.round=vp,Z.runInContext=p,Z.sample=xf,Z.size=kf,Z.snakeCase=Hh,Z.some=If,Z.sortedIndex=Wo,Z.sortedIndexBy=Lo,Z.sortedIndexOf=Co,Z.sortedLastIndex=Uo,Z.sortedLastIndexBy=Bo,Z.sortedLastIndexOf=To,Z.startCase=Jh,Z.startsWith=ba,Z.subtract=gp,Z.sum=el,Z.sumBy=ul,Z.template=wa,Z.times=Ga,Z.toFinite=Ac,Z.toInteger=kc, Z.toLength=Ic,Z.toLower=ma,Z.toNumber=Oc,Z.toSafeInteger=zc,Z.toString=Ec,Z.toUpper=xa,Z.trim=ja,Z.trimEnd=Aa,Z.trimStart=ka,Z.truncate=Ia,Z.unescape=Oa,Z.uniqueId=Ja,Z.upperCase=Yh,Z.upperFirst=Qh,Z.each=_f,Z.eachRight=vf,Z.first=bo,Ta(Z,function(){var n={};return ue(Z,function(t,r){bl.call(Z.prototype,r)||(n[r]=t)}),n}(),{chain:false}),Z.VERSION=nn,r(["bind","bindKey","curry","curryRight","partial","partialRight"],function(n){Z[n].placeholder=Z}),r(["drop","take"],function(n,t){Ut.prototype[n]=function(r){ r=r===X?1:Gl(kc(r),0);var e=this.__filtered__&&!t?new Ut(this):this.clone();return e.__filtered__?e.__takeCount__=Hl(r,e.__takeCount__):e.__views__.push({size:Hl(r,Bn),type:n+(e.__dir__<0?"Right":"")}),e},Ut.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()}}),r(["filter","map","takeWhile"],function(n,t){var r=t+1,e=r==zn||r==Sn;Ut.prototype[n]=function(n){var t=this.clone();return t.__iteratees__.push({iteratee:mi(n,3),type:r}),t.__filtered__=t.__filtered__||e,t}}),r(["head","last"],function(n,t){ var r="take"+(t?"Right":"");Ut.prototype[n]=function(){return this[r](1).value()[0]}}),r(["initial","tail"],function(n,t){var r="drop"+(t?"":"Right");Ut.prototype[n]=function(){return this.__filtered__?new Ut(this):this[r](1)}}),Ut.prototype.compact=function(){return this.filter(La)},Ut.prototype.find=function(n){return this.filter(n).head()},Ut.prototype.findLast=function(n){return this.reverse().find(n)},Ut.prototype.invokeMap=uu(function(n,t){return typeof n=="function"?new Ut(this):this.map(function(r){ return Oe(r,n,t)})}),Ut.prototype.reject=function(n){return this.filter(Uf(mi(n)))},Ut.prototype.slice=function(n,t){n=kc(n);var r=this;return r.__filtered__&&(n>0||t<0)?new Ut(r):(n<0?r=r.takeRight(-n):n&&(r=r.drop(n)),t!==X&&(t=kc(t),r=t<0?r.dropRight(-t):r.take(t-n)),r)},Ut.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},Ut.prototype.toArray=function(){return this.take(Bn)},ue(Ut.prototype,function(n,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),e=/^(?:head|last)$/.test(t),u=Z[e?"take"+("last"==t?"Right":""):t],i=e||/^find/.test(t); u&&(Z.prototype[t]=function(){var t=this.__wrapped__,o=e?[1]:arguments,f=t instanceof Ut,c=o[0],l=f||bh(t),s=function(n){var t=u.apply(Z,a([n],o));return e&&h?t[0]:t};l&&r&&typeof c=="function"&&1!=c.length&&(f=l=false);var h=this.__chain__,p=!!this.__actions__.length,_=i&&!h,v=f&&!p;if(!i&&l){t=v?t:new Ut(this);var g=n.apply(t,o);return g.__actions__.push({func:nf,args:[s],thisArg:X}),new Y(g,h)}return _&&v?n.apply(this,o):(g=this.thru(s),_?e?g.value()[0]:g.value():g)})}),r(["pop","push","shift","sort","splice","unshift"],function(n){ var t=_l[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|shift)$/.test(n);Z.prototype[n]=function(){var n=arguments;if(e&&!this.__chain__){var u=this.value();return t.apply(bh(u)?u:[],n)}return this[r](function(r){return t.apply(bh(r)?r:[],n)})}}),ue(Ut.prototype,function(n,t){var r=Z[t];if(r){var e=r.name+"";bl.call(fs,e)||(fs[e]=[]),fs[e].push({name:t,func:r})}}),fs[Qu(X,gn).name]=[{name:"wrapper",func:X}],Ut.prototype.clone=Dt,Ut.prototype.reverse=Qt,Ut.prototype.value=Xt,Z.prototype.at=Qs, Z.prototype.chain=tf,Z.prototype.commit=rf,Z.prototype.next=ef,Z.prototype.plant=of,Z.prototype.reverse=ff,Z.prototype.toJSON=Z.prototype.valueOf=Z.prototype.value=cf,Z.prototype.first=Z.prototype.head,Ul&&(Z.prototype[Ul]=uf),Z},be=de();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(re._=be, define(function(){return be})):ue?((ue.exports=be)._=be,ee._=be):re._=be}).call(this); vendor/react-jsx-runtime.js 0000644 00000115265 15206720414 0011773 0 ustar 00 "use strict"; var ReactJSXRuntime = (() => { var __getOwnPropNames = Object.getOwnPropertyNames; var __commonJS = (cb, mod) => function __require() { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; // react-external:react var require_react = __commonJS({ "react-external:react"(exports, module) { module.exports = globalThis.React; } }); // node_modules/react/cjs/react-jsx-runtime.development.js var require_react_jsx_runtime_development = __commonJS({ "node_modules/react/cjs/react-jsx-runtime.development.js"(exports) { "use strict"; if (true) { (function() { "use strict"; var React = require_react(); var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.element"); var REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal"); var REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment"); var REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode"); var REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler"); var REACT_PROVIDER_TYPE = /* @__PURE__ */ Symbol.for("react.provider"); var REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context"); var REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref"); var REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense"); var REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for("react.suspense_list"); var REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo"); var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy"); var REACT_OFFSCREEN_TYPE = /* @__PURE__ */ Symbol.for("react.offscreen"); var MAYBE_ITERATOR_SYMBOL = Symbol.iterator; var FAUX_ITERATOR_SYMBOL = "@@iterator"; function getIteratorFn(maybeIterable) { if (maybeIterable === null || typeof maybeIterable !== "object") { return null; } var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; if (typeof maybeIterator === "function") { return maybeIterator; } return null; } var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; function error(format) { { { for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { args[_key2 - 1] = arguments[_key2]; } printWarning("error", format, args); } } } function printWarning(level, format, args) { { var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame; var stack = ReactDebugCurrentFrame2.getStackAddendum(); if (stack !== "") { format += "%s"; args = args.concat([stack]); } var argsWithFormat = args.map(function(item) { return String(item); }); argsWithFormat.unshift("Warning: " + format); Function.prototype.apply.call(console[level], console, argsWithFormat); } } var enableScopeAPI = false; var enableCacheElement = false; var enableTransitionTracing = false; var enableLegacyHidden = false; var enableDebugTracing = false; var REACT_MODULE_REFERENCE; { REACT_MODULE_REFERENCE = /* @__PURE__ */ Symbol.for("react.module.reference"); } function isValidElementType(type) { if (typeof type === "string" || typeof type === "function") { return true; } if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) { return true; } if (typeof type === "object" && type !== null) { if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object // types supported by any Flight configuration anywhere since // we don't know which Flight build this will end up being used // with. type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== void 0) { return true; } } return false; } function getWrappedName(outerType, innerType, wrapperName) { var displayName = outerType.displayName; if (displayName) { return displayName; } var functionName = innerType.displayName || innerType.name || ""; return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName; } function getContextName(type) { return type.displayName || "Context"; } function getComponentNameFromType(type) { if (type == null) { return null; } { if (typeof type.tag === "number") { error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."); } } if (typeof type === "function") { return type.displayName || type.name || null; } if (typeof type === "string") { return type; } switch (type) { case REACT_FRAGMENT_TYPE: return "Fragment"; case REACT_PORTAL_TYPE: return "Portal"; case REACT_PROFILER_TYPE: return "Profiler"; case REACT_STRICT_MODE_TYPE: return "StrictMode"; case REACT_SUSPENSE_TYPE: return "Suspense"; case REACT_SUSPENSE_LIST_TYPE: return "SuspenseList"; } if (typeof type === "object") { switch (type.$$typeof) { case REACT_CONTEXT_TYPE: var context = type; return getContextName(context) + ".Consumer"; case REACT_PROVIDER_TYPE: var provider = type; return getContextName(provider._context) + ".Provider"; case REACT_FORWARD_REF_TYPE: return getWrappedName(type, type.render, "ForwardRef"); case REACT_MEMO_TYPE: var outerName = type.displayName || null; if (outerName !== null) { return outerName; } return getComponentNameFromType(type.type) || "Memo"; case REACT_LAZY_TYPE: { var lazyComponent = type; var payload = lazyComponent._payload; var init = lazyComponent._init; try { return getComponentNameFromType(init(payload)); } catch (x) { return null; } } } } return null; } var assign = Object.assign; var disabledDepth = 0; var prevLog; var prevInfo; var prevWarn; var prevError; var prevGroup; var prevGroupCollapsed; var prevGroupEnd; function disabledLog() { } disabledLog.__reactDisabledLog = true; function disableLogs() { { if (disabledDepth === 0) { prevLog = console.log; prevInfo = console.info; prevWarn = console.warn; prevError = console.error; prevGroup = console.group; prevGroupCollapsed = console.groupCollapsed; prevGroupEnd = console.groupEnd; var props = { configurable: true, enumerable: true, value: disabledLog, writable: true }; Object.defineProperties(console, { info: props, log: props, warn: props, error: props, group: props, groupCollapsed: props, groupEnd: props }); } disabledDepth++; } } function reenableLogs() { { disabledDepth--; if (disabledDepth === 0) { var props = { configurable: true, enumerable: true, writable: true }; Object.defineProperties(console, { log: assign({}, props, { value: prevLog }), info: assign({}, props, { value: prevInfo }), warn: assign({}, props, { value: prevWarn }), error: assign({}, props, { value: prevError }), group: assign({}, props, { value: prevGroup }), groupCollapsed: assign({}, props, { value: prevGroupCollapsed }), groupEnd: assign({}, props, { value: prevGroupEnd }) }); } if (disabledDepth < 0) { error("disabledDepth fell below zero. This is a bug in React. Please file an issue."); } } } var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher; var prefix; function describeBuiltInComponentFrame(name, source, ownerFn) { { if (prefix === void 0) { try { throw Error(); } catch (x) { var match = x.stack.trim().match(/\n( *(at )?)/); prefix = match && match[1] || ""; } } return "\n" + prefix + name; } } var reentry = false; var componentFrameCache; { var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map; componentFrameCache = new PossiblyWeakMap(); } function describeNativeComponentFrame(fn, construct) { if (!fn || reentry) { return ""; } { var frame = componentFrameCache.get(fn); if (frame !== void 0) { return frame; } } var control; reentry = true; var previousPrepareStackTrace = Error.prepareStackTrace; Error.prepareStackTrace = void 0; var previousDispatcher; { previousDispatcher = ReactCurrentDispatcher.current; ReactCurrentDispatcher.current = null; disableLogs(); } try { if (construct) { var Fake = function() { throw Error(); }; Object.defineProperty(Fake.prototype, "props", { set: function() { throw Error(); } }); if (typeof Reflect === "object" && Reflect.construct) { try { Reflect.construct(Fake, []); } catch (x) { control = x; } Reflect.construct(fn, [], Fake); } else { try { Fake.call(); } catch (x) { control = x; } fn.call(Fake.prototype); } } else { try { throw Error(); } catch (x) { control = x; } fn(); } } catch (sample) { if (sample && control && typeof sample.stack === "string") { var sampleLines = sample.stack.split("\n"); var controlLines = control.stack.split("\n"); var s = sampleLines.length - 1; var c = controlLines.length - 1; while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) { c--; } for (; s >= 1 && c >= 0; s--, c--) { if (sampleLines[s] !== controlLines[c]) { if (s !== 1 || c !== 1) { do { s--; c--; if (c < 0 || sampleLines[s] !== controlLines[c]) { var _frame = "\n" + sampleLines[s].replace(" at new ", " at "); if (fn.displayName && _frame.includes("<anonymous>")) { _frame = _frame.replace("<anonymous>", fn.displayName); } { if (typeof fn === "function") { componentFrameCache.set(fn, _frame); } } return _frame; } } while (s >= 1 && c >= 0); } break; } } } } finally { reentry = false; { ReactCurrentDispatcher.current = previousDispatcher; reenableLogs(); } Error.prepareStackTrace = previousPrepareStackTrace; } var name = fn ? fn.displayName || fn.name : ""; var syntheticFrame = name ? describeBuiltInComponentFrame(name) : ""; { if (typeof fn === "function") { componentFrameCache.set(fn, syntheticFrame); } } return syntheticFrame; } function describeFunctionComponentFrame(fn, source, ownerFn) { { return describeNativeComponentFrame(fn, false); } } function shouldConstruct(Component) { var prototype = Component.prototype; return !!(prototype && prototype.isReactComponent); } function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) { if (type == null) { return ""; } if (typeof type === "function") { { return describeNativeComponentFrame(type, shouldConstruct(type)); } } if (typeof type === "string") { return describeBuiltInComponentFrame(type); } switch (type) { case REACT_SUSPENSE_TYPE: return describeBuiltInComponentFrame("Suspense"); case REACT_SUSPENSE_LIST_TYPE: return describeBuiltInComponentFrame("SuspenseList"); } if (typeof type === "object") { switch (type.$$typeof) { case REACT_FORWARD_REF_TYPE: return describeFunctionComponentFrame(type.render); case REACT_MEMO_TYPE: return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn); case REACT_LAZY_TYPE: { var lazyComponent = type; var payload = lazyComponent._payload; var init = lazyComponent._init; try { return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn); } catch (x) { } } } } return ""; } var hasOwnProperty = Object.prototype.hasOwnProperty; var loggedTypeFailures = {}; var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; function setCurrentlyValidatingElement(element) { { if (element) { var owner = element._owner; var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null); ReactDebugCurrentFrame.setExtraStackFrame(stack); } else { ReactDebugCurrentFrame.setExtraStackFrame(null); } } } function checkPropTypes(typeSpecs, values, location, componentName, element) { { var has = Function.call.bind(hasOwnProperty); for (var typeSpecName in typeSpecs) { if (has(typeSpecs, typeSpecName)) { var error$1 = void 0; try { if (typeof typeSpecs[typeSpecName] !== "function") { var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."); err.name = "Invariant Violation"; throw err; } error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"); } catch (ex) { error$1 = ex; } if (error$1 && !(error$1 instanceof Error)) { setCurrentlyValidatingElement(element); error("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", componentName || "React class", location, typeSpecName, typeof error$1); setCurrentlyValidatingElement(null); } if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) { loggedTypeFailures[error$1.message] = true; setCurrentlyValidatingElement(element); error("Failed %s type: %s", location, error$1.message); setCurrentlyValidatingElement(null); } } } } } var isArrayImpl = Array.isArray; function isArray(a) { return isArrayImpl(a); } function typeName(value) { { var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag; var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object"; return type; } } function willCoercionThrow(value) { { try { testStringCoercion(value); return false; } catch (e) { return true; } } } function testStringCoercion(value) { return "" + value; } function checkKeyStringCoercion(value) { { if (willCoercionThrow(value)) { error("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value)); return testStringCoercion(value); } } } var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner; var RESERVED_PROPS = { key: true, ref: true, __self: true, __source: true }; var specialPropKeyWarningShown; var specialPropRefWarningShown; var didWarnAboutStringRefs; { didWarnAboutStringRefs = {}; } function hasValidRef(config) { { if (hasOwnProperty.call(config, "ref")) { var getter = Object.getOwnPropertyDescriptor(config, "ref").get; if (getter && getter.isReactWarning) { return false; } } } return config.ref !== void 0; } function hasValidKey(config) { { if (hasOwnProperty.call(config, "key")) { var getter = Object.getOwnPropertyDescriptor(config, "key").get; if (getter && getter.isReactWarning) { return false; } } } return config.key !== void 0; } function warnIfStringRefCannotBeAutoConverted(config, self) { { if (typeof config.ref === "string" && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) { var componentName = getComponentNameFromType(ReactCurrentOwner.current.type); if (!didWarnAboutStringRefs[componentName]) { error('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref); didWarnAboutStringRefs[componentName] = true; } } } } function defineKeyPropWarningGetter(props, displayName) { { var warnAboutAccessingKey = function() { if (!specialPropKeyWarningShown) { specialPropKeyWarningShown = true; error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName); } }; warnAboutAccessingKey.isReactWarning = true; Object.defineProperty(props, "key", { get: warnAboutAccessingKey, configurable: true }); } } function defineRefPropWarningGetter(props, displayName) { { var warnAboutAccessingRef = function() { if (!specialPropRefWarningShown) { specialPropRefWarningShown = true; error("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName); } }; warnAboutAccessingRef.isReactWarning = true; Object.defineProperty(props, "ref", { get: warnAboutAccessingRef, configurable: true }); } } var ReactElement = function(type, key, ref, self, source, owner, props) { var element = { // This tag allows us to uniquely identify this as a React Element $$typeof: REACT_ELEMENT_TYPE, // Built-in properties that belong on the element type, key, ref, props, // Record the component responsible for creating this element. _owner: owner }; { element._store = {}; Object.defineProperty(element._store, "validated", { configurable: false, enumerable: false, writable: true, value: false }); Object.defineProperty(element, "_self", { configurable: false, enumerable: false, writable: false, value: self }); Object.defineProperty(element, "_source", { configurable: false, enumerable: false, writable: false, value: source }); if (Object.freeze) { Object.freeze(element.props); Object.freeze(element); } } return element; }; function jsxDEV(type, config, maybeKey, source, self) { { var propName; var props = {}; var key = null; var ref = null; if (maybeKey !== void 0) { { checkKeyStringCoercion(maybeKey); } key = "" + maybeKey; } if (hasValidKey(config)) { { checkKeyStringCoercion(config.key); } key = "" + config.key; } if (hasValidRef(config)) { ref = config.ref; warnIfStringRefCannotBeAutoConverted(config, self); } for (propName in config) { if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { props[propName] = config[propName]; } } if (type && type.defaultProps) { var defaultProps = type.defaultProps; for (propName in defaultProps) { if (props[propName] === void 0) { props[propName] = defaultProps[propName]; } } } if (key || ref) { var displayName = typeof type === "function" ? type.displayName || type.name || "Unknown" : type; if (key) { defineKeyPropWarningGetter(props, displayName); } if (ref) { defineRefPropWarningGetter(props, displayName); } } return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props); } } var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner; var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame; function setCurrentlyValidatingElement$1(element) { { if (element) { var owner = element._owner; var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null); ReactDebugCurrentFrame$1.setExtraStackFrame(stack); } else { ReactDebugCurrentFrame$1.setExtraStackFrame(null); } } } var propTypesMisspellWarningShown; { propTypesMisspellWarningShown = false; } function isValidElement(object) { { return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; } } function getDeclarationErrorAddendum() { { if (ReactCurrentOwner$1.current) { var name = getComponentNameFromType(ReactCurrentOwner$1.current.type); if (name) { return "\n\nCheck the render method of `" + name + "`."; } } return ""; } } function getSourceInfoErrorAddendum(source) { { if (source !== void 0) { var fileName = source.fileName.replace(/^.*[\\\/]/, ""); var lineNumber = source.lineNumber; return "\n\nCheck your code at " + fileName + ":" + lineNumber + "."; } return ""; } } var ownerHasKeyUseWarning = {}; function getCurrentComponentErrorInfo(parentType) { { var info = getDeclarationErrorAddendum(); if (!info) { var parentName = typeof parentType === "string" ? parentType : parentType.displayName || parentType.name; if (parentName) { info = "\n\nCheck the top-level render call using <" + parentName + ">."; } } return info; } } function validateExplicitKey(element, parentType) { { if (!element._store || element._store.validated || element.key != null) { return; } element._store.validated = true; var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType); if (ownerHasKeyUseWarning[currentComponentErrorInfo]) { return; } ownerHasKeyUseWarning[currentComponentErrorInfo] = true; var childOwner = ""; if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) { childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + "."; } setCurrentlyValidatingElement$1(element); error('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner); setCurrentlyValidatingElement$1(null); } } function validateChildKeys(node, parentType) { { if (typeof node !== "object") { return; } if (isArray(node)) { for (var i = 0; i < node.length; i++) { var child = node[i]; if (isValidElement(child)) { validateExplicitKey(child, parentType); } } } else if (isValidElement(node)) { if (node._store) { node._store.validated = true; } } else if (node) { var iteratorFn = getIteratorFn(node); if (typeof iteratorFn === "function") { if (iteratorFn !== node.entries) { var iterator = iteratorFn.call(node); var step; while (!(step = iterator.next()).done) { if (isValidElement(step.value)) { validateExplicitKey(step.value, parentType); } } } } } } } function validatePropTypes(element) { { var type = element.type; if (type === null || type === void 0 || typeof type === "string") { return; } var propTypes; if (typeof type === "function") { propTypes = type.propTypes; } else if (typeof type === "object" && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here. // Inner props are checked in the reconciler. type.$$typeof === REACT_MEMO_TYPE)) { propTypes = type.propTypes; } else { return; } if (propTypes) { var name = getComponentNameFromType(type); checkPropTypes(propTypes, element.props, "prop", name, element); } else if (type.PropTypes !== void 0 && !propTypesMisspellWarningShown) { propTypesMisspellWarningShown = true; var _name = getComponentNameFromType(type); error("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", _name || "Unknown"); } if (typeof type.getDefaultProps === "function" && !type.getDefaultProps.isReactClassApproved) { error("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead."); } } } function validateFragmentProps(fragment) { { var keys = Object.keys(fragment.props); for (var i = 0; i < keys.length; i++) { var key = keys[i]; if (key !== "children" && key !== "key") { setCurrentlyValidatingElement$1(fragment); error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", key); setCurrentlyValidatingElement$1(null); break; } } if (fragment.ref !== null) { setCurrentlyValidatingElement$1(fragment); error("Invalid attribute `ref` supplied to `React.Fragment`."); setCurrentlyValidatingElement$1(null); } } } var didWarnAboutKeySpread = {}; function jsxWithValidation(type, props, key, isStaticChildren, source, self) { { var validType = isValidElementType(type); if (!validType) { var info = ""; if (type === void 0 || typeof type === "object" && type !== null && Object.keys(type).length === 0) { info += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."; } var sourceInfo = getSourceInfoErrorAddendum(source); if (sourceInfo) { info += sourceInfo; } else { info += getDeclarationErrorAddendum(); } var typeString; if (type === null) { typeString = "null"; } else if (isArray(type)) { typeString = "array"; } else if (type !== void 0 && type.$$typeof === REACT_ELEMENT_TYPE) { typeString = "<" + (getComponentNameFromType(type.type) || "Unknown") + " />"; info = " Did you accidentally export a JSX literal instead of a component?"; } else { typeString = typeof type; } error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", typeString, info); } var element = jsxDEV(type, props, key, source, self); if (element == null) { return element; } if (validType) { var children = props.children; if (children !== void 0) { if (isStaticChildren) { if (isArray(children)) { for (var i = 0; i < children.length; i++) { validateChildKeys(children[i], type); } if (Object.freeze) { Object.freeze(children); } } else { error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."); } } else { validateChildKeys(children, type); } } } { if (hasOwnProperty.call(props, "key")) { var componentName = getComponentNameFromType(type); var keys = Object.keys(props).filter(function(k) { return k !== "key"; }); var beforeExample = keys.length > 0 ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}"; if (!didWarnAboutKeySpread[componentName + beforeExample]) { var afterExample = keys.length > 0 ? "{" + keys.join(": ..., ") + ": ...}" : "{}"; error('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />', beforeExample, componentName, afterExample, componentName); didWarnAboutKeySpread[componentName + beforeExample] = true; } } } if (type === REACT_FRAGMENT_TYPE) { validateFragmentProps(element); } else { validatePropTypes(element); } return element; } } function jsxWithValidationStatic(type, props, key) { { return jsxWithValidation(type, props, key, true); } } function jsxWithValidationDynamic(type, props, key) { { return jsxWithValidation(type, props, key, false); } } var jsx = jsxWithValidationDynamic; var jsxs = jsxWithValidationStatic; exports.Fragment = REACT_FRAGMENT_TYPE; exports.jsx = jsx; exports.jsxs = jsxs; })(); } } }); // node_modules/react/jsx-runtime.js var require_jsx_runtime = __commonJS({ "node_modules/react/jsx-runtime.js"(exports, module) { if (false) { module.exports = null; } else { module.exports = require_react_jsx_runtime_development(); } } }); return require_jsx_runtime(); })(); /*! Bundled license information: react/cjs/react-jsx-runtime.development.js: (** * @license React * react-jsx-runtime.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. *) */ vendor/wp-polyfill-formdata.js 0000644 00000027142 15206720414 0012457 0 ustar 00 /* formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */ /* global FormData self Blob File */ /* eslint-disable no-inner-declarations */ if (typeof Blob !== 'undefined' && (typeof FormData === 'undefined' || !FormData.prototype.keys)) { const global = typeof globalThis === 'object' ? globalThis : typeof window === 'object' ? window : typeof self === 'object' ? self : this // keep a reference to native implementation const _FormData = global.FormData // To be monkey patched const _send = global.XMLHttpRequest && global.XMLHttpRequest.prototype.send const _fetch = global.Request && global.fetch const _sendBeacon = global.navigator && global.navigator.sendBeacon // Might be a worker thread... const _match = global.Element && global.Element.prototype // Unable to patch Request/Response constructor correctly #109 // only way is to use ES6 class extend // https://github.com/babel/babel/issues/1966 const stringTag = global.Symbol && Symbol.toStringTag // Add missing stringTags to blob and files if (stringTag) { if (!Blob.prototype[stringTag]) { Blob.prototype[stringTag] = 'Blob' } if ('File' in global && !File.prototype[stringTag]) { File.prototype[stringTag] = 'File' } } // Fix so you can construct your own File try { new File([], '') // eslint-disable-line } catch (a) { global.File = function File (b, d, c) { const blob = new Blob(b, c || {}) const t = c && void 0 !== c.lastModified ? new Date(c.lastModified) : new Date() Object.defineProperties(blob, { name: { value: d }, lastModified: { value: +t }, toString: { value () { return '[object File]' } } }) if (stringTag) { Object.defineProperty(blob, stringTag, { value: 'File' }) } return blob } } function ensureArgs (args, expected) { if (args.length < expected) { throw new TypeError(`${expected} argument required, but only ${args.length} present.`) } } /** * @param {string} name * @param {string | undefined} filename * @returns {[string, File|string]} */ function normalizeArgs (name, value, filename) { if (value instanceof Blob) { filename = filename !== undefined ? String(filename + '') : typeof value.name === 'string' ? value.name : 'blob' if (value.name !== filename || Object.prototype.toString.call(value) === '[object Blob]') { value = new File([value], filename) } return [String(name), value] } return [String(name), String(value)] } // normalize line feeds for textarea // https://html.spec.whatwg.org/multipage/form-elements.html#textarea-line-break-normalisation-transformation function normalizeLinefeeds (value) { return value.replace(/\r?\n|\r/g, '\r\n') } /** * @template T * @param {ArrayLike<T>} arr * @param {{ (elm: T): void; }} cb */ function each (arr, cb) { for (let i = 0; i < arr.length; i++) { cb(arr[i]) } } const escape = str => str.replace(/\n/g, '%0A').replace(/\r/g, '%0D').replace(/"/g, '%22') /** * @implements {Iterable} */ class FormDataPolyfill { /** * FormData class * * @param {HTMLFormElement=} form */ constructor (form) { /** @type {[string, string|File][]} */ this._data = [] const self = this form && each(form.elements, (/** @type {HTMLInputElement} */ elm) => { if ( !elm.name || elm.disabled || elm.type === 'submit' || elm.type === 'button' || elm.matches('form fieldset[disabled] *') ) return if (elm.type === 'file') { const files = elm.files && elm.files.length ? elm.files : [new File([], '', { type: 'application/octet-stream' })] // #78 each(files, file => { self.append(elm.name, file) }) } else if (elm.type === 'select-multiple' || elm.type === 'select-one') { each(elm.options, opt => { !opt.disabled && opt.selected && self.append(elm.name, opt.value) }) } else if (elm.type === 'checkbox' || elm.type === 'radio') { if (elm.checked) self.append(elm.name, elm.value) } else { const value = elm.type === 'textarea' ? normalizeLinefeeds(elm.value) : elm.value self.append(elm.name, value) } }) } /** * Append a field * * @param {string} name field name * @param {string|Blob|File} value string / blob / file * @param {string=} filename filename to use with blob * @return {undefined} */ append (name, value, filename) { ensureArgs(arguments, 2) this._data.push(normalizeArgs(name, value, filename)) } /** * Delete all fields values given name * * @param {string} name Field name * @return {undefined} */ delete (name) { ensureArgs(arguments, 1) const result = [] name = String(name) each(this._data, entry => { entry[0] !== name && result.push(entry) }) this._data = result } /** * Iterate over all fields as [name, value] * * @return {Iterator} */ * entries () { for (var i = 0; i < this._data.length; i++) { yield this._data[i] } } /** * Iterate over all fields * * @param {Function} callback Executed for each item with parameters (value, name, thisArg) * @param {Object=} thisArg `this` context for callback function */ forEach (callback, thisArg) { ensureArgs(arguments, 1) for (const [name, value] of this) { callback.call(thisArg, value, name, this) } } /** * Return first field value given name * or null if non existent * * @param {string} name Field name * @return {string|File|null} value Fields value */ get (name) { ensureArgs(arguments, 1) const entries = this._data name = String(name) for (let i = 0; i < entries.length; i++) { if (entries[i][0] === name) { return entries[i][1] } } return null } /** * Return all fields values given name * * @param {string} name Fields name * @return {Array} [{String|File}] */ getAll (name) { ensureArgs(arguments, 1) const result = [] name = String(name) each(this._data, data => { data[0] === name && result.push(data[1]) }) return result } /** * Check for field name existence * * @param {string} name Field name * @return {boolean} */ has (name) { ensureArgs(arguments, 1) name = String(name) for (let i = 0; i < this._data.length; i++) { if (this._data[i][0] === name) { return true } } return false } /** * Iterate over all fields name * * @return {Iterator} */ * keys () { for (const [name] of this) { yield name } } /** * Overwrite all values given name * * @param {string} name Filed name * @param {string} value Field value * @param {string=} filename Filename (optional) */ set (name, value, filename) { ensureArgs(arguments, 2) name = String(name) /** @type {[string, string|File][]} */ const result = [] const args = normalizeArgs(name, value, filename) let replace = true // - replace the first occurrence with same name // - discards the remaining with same name // - while keeping the same order items where added each(this._data, data => { data[0] === name ? replace && (replace = !result.push(args)) : result.push(data) }) replace && result.push(args) this._data = result } /** * Iterate over all fields * * @return {Iterator} */ * values () { for (const [, value] of this) { yield value } } /** * Return a native (perhaps degraded) FormData with only a `append` method * Can throw if it's not supported * * @return {FormData} */ ['_asNative'] () { const fd = new _FormData() for (const [name, value] of this) { fd.append(name, value) } return fd } /** * [_blob description] * * @return {Blob} [description] */ ['_blob'] () { const boundary = '----formdata-polyfill-' + Math.random(), chunks = [], p = `--${boundary}\r\nContent-Disposition: form-data; name="` this.forEach((value, name) => typeof value == 'string' ? chunks.push(p + escape(normalizeLinefeeds(name)) + `"\r\n\r\n${normalizeLinefeeds(value)}\r\n`) : chunks.push(p + escape(normalizeLinefeeds(name)) + `"; filename="${escape(value.name)}"\r\nContent-Type: ${value.type||"application/octet-stream"}\r\n\r\n`, value, `\r\n`)) chunks.push(`--${boundary}--`) return new Blob(chunks, { type: "multipart/form-data; boundary=" + boundary }) } /** * The class itself is iterable * alias for formdata.entries() * * @return {Iterator} */ [Symbol.iterator] () { return this.entries() } /** * Create the default string description. * * @return {string} [object FormData] */ toString () { return '[object FormData]' } } if (_match && !_match.matches) { _match.matches = _match.matchesSelector || _match.mozMatchesSelector || _match.msMatchesSelector || _match.oMatchesSelector || _match.webkitMatchesSelector || function (s) { var matches = (this.document || this.ownerDocument).querySelectorAll(s) var i = matches.length while (--i >= 0 && matches.item(i) !== this) {} return i > -1 } } if (stringTag) { /** * Create the default string description. * It is accessed internally by the Object.prototype.toString(). */ FormDataPolyfill.prototype[stringTag] = 'FormData' } // Patch xhr's send method to call _blob transparently if (_send) { const setRequestHeader = global.XMLHttpRequest.prototype.setRequestHeader global.XMLHttpRequest.prototype.setRequestHeader = function (name, value) { setRequestHeader.call(this, name, value) if (name.toLowerCase() === 'content-type') this._hasContentType = true } global.XMLHttpRequest.prototype.send = function (data) { // need to patch send b/c old IE don't send blob's type (#44) if (data instanceof FormDataPolyfill) { const blob = data['_blob']() if (!this._hasContentType) this.setRequestHeader('Content-Type', blob.type) _send.call(this, blob) } else { _send.call(this, data) } } } // Patch fetch's function to call _blob transparently if (_fetch) { global.fetch = function (input, init) { if (init && init.body && init.body instanceof FormDataPolyfill) { init.body = init.body['_blob']() } return _fetch.call(this, input, init) } } // Patch navigator.sendBeacon to use native FormData if (_sendBeacon) { global.navigator.sendBeacon = function (url, data) { if (data instanceof FormDataPolyfill) { data = data['_asNative']() } return _sendBeacon.call(this, url, data) } } global['FormData'] = FormDataPolyfill } vendor/lodash.js 0000644 00002052231 15206720414 0007657 0 ustar 00 /** * @license * Lodash <https://lodash.com/> * Copyright OpenJS Foundation and other contributors <https://openjsf.org/> * Released under MIT license <https://lodash.com/license> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ ;(function() { /** Used as a safe reference for `undefined` in pre-ES5 environments. */ var undefined; /** Used as the semantic version number. */ var VERSION = '4.18.1'; /** Used as the size to enable large array optimizations. */ var LARGE_ARRAY_SIZE = 200; /** Error message constants. */ var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.', FUNC_ERROR_TEXT = 'Expected a function', INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`', INVALID_TEMPL_IMPORTS_ERROR_TEXT = 'Invalid `imports` option passed into `_.template`'; /** Used to stand-in for `undefined` hash values. */ var HASH_UNDEFINED = '__lodash_hash_undefined__'; /** Used as the maximum memoize cache size. */ var MAX_MEMOIZE_SIZE = 500; /** Used as the internal argument placeholder. */ var PLACEHOLDER = '__lodash_placeholder__'; /** Used to compose bitmasks for cloning. */ var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4; /** Used to compose bitmasks for value comparisons. */ var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2; /** Used to compose bitmasks for function metadata. */ var WRAP_BIND_FLAG = 1, WRAP_BIND_KEY_FLAG = 2, WRAP_CURRY_BOUND_FLAG = 4, WRAP_CURRY_FLAG = 8, WRAP_CURRY_RIGHT_FLAG = 16, WRAP_PARTIAL_FLAG = 32, WRAP_PARTIAL_RIGHT_FLAG = 64, WRAP_ARY_FLAG = 128, WRAP_REARG_FLAG = 256, WRAP_FLIP_FLAG = 512; /** Used as default options for `_.truncate`. */ var DEFAULT_TRUNC_LENGTH = 30, DEFAULT_TRUNC_OMISSION = '...'; /** Used to detect hot functions by number of calls within a span of milliseconds. */ var HOT_COUNT = 800, HOT_SPAN = 16; /** Used to indicate the type of lazy iteratees. */ var LAZY_FILTER_FLAG = 1, LAZY_MAP_FLAG = 2, LAZY_WHILE_FLAG = 3; /** Used as references for various `Number` constants. */ var INFINITY = 1 / 0, MAX_SAFE_INTEGER = 9007199254740991, MAX_INTEGER = 1.7976931348623157e+308, NAN = 0 / 0; /** Used as references for the maximum length and index of an array. */ var MAX_ARRAY_LENGTH = 4294967295, MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; /** Used to associate wrap methods with their bit flags. */ var wrapFlags = [ ['ary', WRAP_ARY_FLAG], ['bind', WRAP_BIND_FLAG], ['bindKey', WRAP_BIND_KEY_FLAG], ['curry', WRAP_CURRY_FLAG], ['curryRight', WRAP_CURRY_RIGHT_FLAG], ['flip', WRAP_FLIP_FLAG], ['partial', WRAP_PARTIAL_FLAG], ['partialRight', WRAP_PARTIAL_RIGHT_FLAG], ['rearg', WRAP_REARG_FLAG] ]; /** `Object#toString` result references. */ var argsTag = '[object Arguments]', arrayTag = '[object Array]', asyncTag = '[object AsyncFunction]', boolTag = '[object Boolean]', dateTag = '[object Date]', domExcTag = '[object DOMException]', errorTag = '[object Error]', funcTag = '[object Function]', genTag = '[object GeneratorFunction]', mapTag = '[object Map]', numberTag = '[object Number]', nullTag = '[object Null]', objectTag = '[object Object]', promiseTag = '[object Promise]', proxyTag = '[object Proxy]', regexpTag = '[object RegExp]', setTag = '[object Set]', stringTag = '[object String]', symbolTag = '[object Symbol]', undefinedTag = '[object Undefined]', weakMapTag = '[object WeakMap]', weakSetTag = '[object WeakSet]'; var arrayBufferTag = '[object ArrayBuffer]', dataViewTag = '[object DataView]', float32Tag = '[object Float32Array]', float64Tag = '[object Float64Array]', int8Tag = '[object Int8Array]', int16Tag = '[object Int16Array]', int32Tag = '[object Int32Array]', uint8Tag = '[object Uint8Array]', uint8ClampedTag = '[object Uint8ClampedArray]', uint16Tag = '[object Uint16Array]', uint32Tag = '[object Uint32Array]'; /** Used to match empty string literals in compiled template source. */ var reEmptyStringLeading = /\b__p \+= '';/g, reEmptyStringMiddle = /\b(__p \+=) '' \+/g, reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; /** Used to match HTML entities and HTML characters. */ var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, reUnescapedHtml = /[&<>"']/g, reHasEscapedHtml = RegExp(reEscapedHtml.source), reHasUnescapedHtml = RegExp(reUnescapedHtml.source); /** Used to match template delimiters. */ var reEscape = /<%-([\s\S]+?)%>/g, reEvaluate = /<%([\s\S]+?)%>/g, reInterpolate = /<%=([\s\S]+?)%>/g; /** Used to match property names within property paths. */ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; /** * Used to match `RegExp` * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). */ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reHasRegExpChar = RegExp(reRegExpChar.source); /** Used to match leading whitespace. */ var reTrimStart = /^\s+/; /** Used to match a single whitespace character. */ var reWhitespace = /\s/; /** Used to match wrap detail comments. */ var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, reSplitDetails = /,? & /; /** Used to match words composed of alphanumeric characters. */ var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; /** * Used to validate the `validate` option in `_.template` variable. * * Forbids characters which could potentially change the meaning of the function argument definition: * - "()," (modification of function parameters) * - "=" (default value) * - "[]{}" (destructuring of function parameters) * - "/" (beginning of a comment) * - whitespace */ var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/; /** Used to match backslashes in property paths. */ var reEscapeChar = /\\(\\)?/g; /** * Used to match * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components). */ var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; /** Used to match `RegExp` flags from their coerced string values. */ var reFlags = /\w*$/; /** Used to detect bad signed hexadecimal string values. */ var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; /** Used to detect binary string values. */ var reIsBinary = /^0b[01]+$/i; /** Used to detect host constructors (Safari). */ var reIsHostCtor = /^\[object .+?Constructor\]$/; /** Used to detect octal string values. */ var reIsOctal = /^0o[0-7]+$/i; /** Used to detect unsigned integer values. */ var reIsUint = /^(?:0|[1-9]\d*)$/; /** Used to match Latin Unicode letters (excluding mathematical operators). */ var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; /** Used to ensure capturing order of template delimiters. */ var reNoMatch = /($^)/; /** Used to match unescaped characters in compiled string literals. */ var reUnescapedString = /['\n\r\u2028\u2029\\]/g; /** Used to compose unicode character classes. */ var rsAstralRange = '\\ud800-\\udfff', rsComboMarksRange = '\\u0300-\\u036f', reComboHalfMarksRange = '\\ufe20-\\ufe2f', rsComboSymbolsRange = '\\u20d0-\\u20ff', rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, rsDingbatRange = '\\u2700-\\u27bf', rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf', rsPunctuationRange = '\\u2000-\\u206f', rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000', rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde', rsVarRange = '\\ufe0e\\ufe0f', rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; /** Used to compose unicode capture groups. */ var rsApos = "['\u2019]", rsAstral = '[' + rsAstralRange + ']', rsBreak = '[' + rsBreakRange + ']', rsCombo = '[' + rsComboRange + ']', rsDigits = '\\d+', rsDingbat = '[' + rsDingbatRange + ']', rsLower = '[' + rsLowerRange + ']', rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']', rsFitz = '\\ud83c[\\udffb-\\udfff]', rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', rsNonAstral = '[^' + rsAstralRange + ']', rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', rsUpper = '[' + rsUpperRange + ']', rsZWJ = '\\u200d'; /** Used to compose unicode regexes. */ var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')', rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')', rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?', rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?', reOptMod = rsModifier + '?', rsOptVar = '[' + rsVarRange + ']?', rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])', rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])', rsSeq = rsOptVar + reOptMod + rsOptJoin, rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq, rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; /** Used to match apostrophes. */ var reApos = RegExp(rsApos, 'g'); /** * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). */ var reComboMark = RegExp(rsCombo, 'g'); /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); /** Used to match complex or compound words. */ var reUnicodeWord = RegExp([ rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')', rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower, rsUpper + '+' + rsOptContrUpper, rsOrdUpper, rsOrdLower, rsDigits, rsEmoji ].join('|'), 'g'); /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']'); /** Used to detect strings that need a more robust regexp to match words. */ var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; /** Used to assign default `context` object properties. */ var contextProps = [ 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array', 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object', 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array', 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap', '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout' ]; /** Used to make template sourceURLs easier to identify. */ var templateCounter = -1; /** Used to identify `toStringTag` values of typed arrays. */ var typedArrayTags = {}; typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true; typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; /** Used to identify `toStringTag` values supported by `_.clone`. */ var cloneableTags = {}; cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false; /** Used to map Latin Unicode letters to basic Latin letters. */ var deburredLetters = { // Latin-1 Supplement block. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', '\xc7': 'C', '\xe7': 'c', '\xd0': 'D', '\xf0': 'd', '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', '\xd1': 'N', '\xf1': 'n', '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', '\xc6': 'Ae', '\xe6': 'ae', '\xde': 'Th', '\xfe': 'th', '\xdf': 'ss', // Latin Extended-A block. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A', '\u0101': 'a', '\u0103': 'a', '\u0105': 'a', '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C', '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c', '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd', '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E', '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e', '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G', '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g', '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h', '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I', '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i', '\u0134': 'J', '\u0135': 'j', '\u0136': 'K', '\u0137': 'k', '\u0138': 'k', '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L', '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l', '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N', '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n', '\u014c': 'O', '\u014e': 'O', '\u0150': 'O', '\u014d': 'o', '\u014f': 'o', '\u0151': 'o', '\u0154': 'R', '\u0156': 'R', '\u0158': 'R', '\u0155': 'r', '\u0157': 'r', '\u0159': 'r', '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S', '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's', '\u0162': 'T', '\u0164': 'T', '\u0166': 'T', '\u0163': 't', '\u0165': 't', '\u0167': 't', '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U', '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u', '\u0174': 'W', '\u0175': 'w', '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y', '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z', '\u017a': 'z', '\u017c': 'z', '\u017e': 'z', '\u0132': 'IJ', '\u0133': 'ij', '\u0152': 'Oe', '\u0153': 'oe', '\u0149': "'n", '\u017f': 's' }; /** Used to map characters to HTML entities. */ var htmlEscapes = { '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }; /** Used to map HTML entities to characters. */ var htmlUnescapes = { '&': '&', '<': '<', '>': '>', '"': '"', ''': "'" }; /** Used to escape characters for inclusion in compiled string literals. */ var stringEscapes = { '\\': '\\', "'": "'", '\n': 'n', '\r': 'r', '\u2028': 'u2028', '\u2029': 'u2029' }; /** Built-in method references without a dependency on `root`. */ var freeParseFloat = parseFloat, freeParseInt = parseInt; /** Detect free variable `global` from Node.js. */ var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; /** Detect free variable `self`. */ var freeSelf = typeof self == 'object' && self && self.Object === Object && self; /** Used as a reference to the global object. */ var root = freeGlobal || freeSelf || Function('return this')(); /** Detect free variable `exports`. */ var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; /** Detect free variable `module`. */ var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; /** Detect the popular CommonJS extension `module.exports`. */ var moduleExports = freeModule && freeModule.exports === freeExports; /** Detect free variable `process` from Node.js. */ var freeProcess = moduleExports && freeGlobal.process; /** Used to access faster Node.js helpers. */ var nodeUtil = (function() { try { // Use `util.types` for Node.js 10+. var types = freeModule && freeModule.require && freeModule.require('util').types; if (types) { return types; } // Legacy `process.binding('util')` for Node.js < 10. return freeProcess && freeProcess.binding && freeProcess.binding('util'); } catch (e) {} }()); /* Node.js helper references. */ var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, nodeIsDate = nodeUtil && nodeUtil.isDate, nodeIsMap = nodeUtil && nodeUtil.isMap, nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, nodeIsSet = nodeUtil && nodeUtil.isSet, nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; /*--------------------------------------------------------------------------*/ /** * A faster alternative to `Function#apply`, this function invokes `func` * with the `this` binding of `thisArg` and the arguments of `args`. * * @private * @param {Function} func The function to invoke. * @param {*} thisArg The `this` binding of `func`. * @param {Array} args The arguments to invoke `func` with. * @returns {*} Returns the result of `func`. */ function apply(func, thisArg, args) { switch (args.length) { case 0: return func.call(thisArg); case 1: return func.call(thisArg, args[0]); case 2: return func.call(thisArg, args[0], args[1]); case 3: return func.call(thisArg, args[0], args[1], args[2]); } return func.apply(thisArg, args); } /** * A specialized version of `baseAggregator` for arrays. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} setter The function to set `accumulator` values. * @param {Function} iteratee The iteratee to transform keys. * @param {Object} accumulator The initial aggregated object. * @returns {Function} Returns `accumulator`. */ function arrayAggregator(array, setter, iteratee, accumulator) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { var value = array[index]; setter(accumulator, value, iteratee(value), array); } return accumulator; } /** * A specialized version of `_.forEach` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns `array`. */ function arrayEach(array, iteratee) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (iteratee(array[index], index, array) === false) { break; } } return array; } /** * A specialized version of `_.forEachRight` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns `array`. */ function arrayEachRight(array, iteratee) { var length = array == null ? 0 : array.length; while (length--) { if (iteratee(array[length], length, array) === false) { break; } } return array; } /** * A specialized version of `_.every` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {boolean} Returns `true` if all elements pass the predicate check, * else `false`. */ function arrayEvery(array, predicate) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (!predicate(array[index], index, array)) { return false; } } return true; } /** * A specialized version of `_.filter` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {Array} Returns the new filtered array. */ function arrayFilter(array, predicate) { var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = []; while (++index < length) { var value = array[index]; if (predicate(value, index, array)) { result[resIndex++] = value; } } return result; } /** * A specialized version of `_.includes` for arrays without support for * specifying an index to search from. * * @private * @param {Array} [array] The array to inspect. * @param {*} target The value to search for. * @returns {boolean} Returns `true` if `target` is found, else `false`. */ function arrayIncludes(array, value) { var length = array == null ? 0 : array.length; return !!length && baseIndexOf(array, value, 0) > -1; } /** * This function is like `arrayIncludes` except that it accepts a comparator. * * @private * @param {Array} [array] The array to inspect. * @param {*} target The value to search for. * @param {Function} comparator The comparator invoked per element. * @returns {boolean} Returns `true` if `target` is found, else `false`. */ function arrayIncludesWith(array, value, comparator) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (comparator(value, array[index])) { return true; } } return false; } /** * A specialized version of `_.map` for arrays without support for iteratee * shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the new mapped array. */ function arrayMap(array, iteratee) { var index = -1, length = array == null ? 0 : array.length, result = Array(length); while (++index < length) { result[index] = iteratee(array[index], index, array); } return result; } /** * Appends the elements of `values` to `array`. * * @private * @param {Array} array The array to modify. * @param {Array} values The values to append. * @returns {Array} Returns `array`. */ function arrayPush(array, values) { var index = -1, length = values.length, offset = array.length; while (++index < length) { array[offset + index] = values[index]; } return array; } /** * A specialized version of `_.reduce` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {*} [accumulator] The initial value. * @param {boolean} [initAccum] Specify using the first element of `array` as * the initial value. * @returns {*} Returns the accumulated value. */ function arrayReduce(array, iteratee, accumulator, initAccum) { var index = -1, length = array == null ? 0 : array.length; if (initAccum && length) { accumulator = array[++index]; } while (++index < length) { accumulator = iteratee(accumulator, array[index], index, array); } return accumulator; } /** * A specialized version of `_.reduceRight` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {*} [accumulator] The initial value. * @param {boolean} [initAccum] Specify using the last element of `array` as * the initial value. * @returns {*} Returns the accumulated value. */ function arrayReduceRight(array, iteratee, accumulator, initAccum) { var length = array == null ? 0 : array.length; if (initAccum && length) { accumulator = array[--length]; } while (length--) { accumulator = iteratee(accumulator, array[length], length, array); } return accumulator; } /** * A specialized version of `_.some` for arrays without support for iteratee * shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {boolean} Returns `true` if any element passes the predicate check, * else `false`. */ function arraySome(array, predicate) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (predicate(array[index], index, array)) { return true; } } return false; } /** * Gets the size of an ASCII `string`. * * @private * @param {string} string The string inspect. * @returns {number} Returns the string size. */ var asciiSize = baseProperty('length'); /** * Converts an ASCII `string` to an array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the converted array. */ function asciiToArray(string) { return string.split(''); } /** * Splits an ASCII `string` into an array of its words. * * @private * @param {string} The string to inspect. * @returns {Array} Returns the words of `string`. */ function asciiWords(string) { return string.match(reAsciiWord) || []; } /** * The base implementation of methods like `_.findKey` and `_.findLastKey`, * without support for iteratee shorthands, which iterates over `collection` * using `eachFunc`. * * @private * @param {Array|Object} collection The collection to inspect. * @param {Function} predicate The function invoked per iteration. * @param {Function} eachFunc The function to iterate over `collection`. * @returns {*} Returns the found element or its key, else `undefined`. */ function baseFindKey(collection, predicate, eachFunc) { var result; eachFunc(collection, function(value, key, collection) { if (predicate(value, key, collection)) { result = key; return false; } }); return result; } /** * The base implementation of `_.findIndex` and `_.findLastIndex` without * support for iteratee shorthands. * * @private * @param {Array} array The array to inspect. * @param {Function} predicate The function invoked per iteration. * @param {number} fromIndex The index to search from. * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {number} Returns the index of the matched value, else `-1`. */ function baseFindIndex(array, predicate, fromIndex, fromRight) { var length = array.length, index = fromIndex + (fromRight ? 1 : -1); while ((fromRight ? index-- : ++index < length)) { if (predicate(array[index], index, array)) { return index; } } return -1; } /** * The base implementation of `_.indexOf` without `fromIndex` bounds checks. * * @private * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} fromIndex The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. */ function baseIndexOf(array, value, fromIndex) { return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex); } /** * This function is like `baseIndexOf` except that it accepts a comparator. * * @private * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} fromIndex The index to search from. * @param {Function} comparator The comparator invoked per element. * @returns {number} Returns the index of the matched value, else `-1`. */ function baseIndexOfWith(array, value, fromIndex, comparator) { var index = fromIndex - 1, length = array.length; while (++index < length) { if (comparator(array[index], value)) { return index; } } return -1; } /** * The base implementation of `_.isNaN` without support for number objects. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. */ function baseIsNaN(value) { return value !== value; } /** * The base implementation of `_.mean` and `_.meanBy` without support for * iteratee shorthands. * * @private * @param {Array} array The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {number} Returns the mean. */ function baseMean(array, iteratee) { var length = array == null ? 0 : array.length; return length ? (baseSum(array, iteratee) / length) : NAN; } /** * The base implementation of `_.property` without support for deep paths. * * @private * @param {string} key The key of the property to get. * @returns {Function} Returns the new accessor function. */ function baseProperty(key) { return function(object) { return object == null ? undefined : object[key]; }; } /** * The base implementation of `_.propertyOf` without support for deep paths. * * @private * @param {Object} object The object to query. * @returns {Function} Returns the new accessor function. */ function basePropertyOf(object) { return function(key) { return object == null ? undefined : object[key]; }; } /** * The base implementation of `_.reduce` and `_.reduceRight`, without support * for iteratee shorthands, which iterates over `collection` using `eachFunc`. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {*} accumulator The initial value. * @param {boolean} initAccum Specify using the first or last element of * `collection` as the initial value. * @param {Function} eachFunc The function to iterate over `collection`. * @returns {*} Returns the accumulated value. */ function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { eachFunc(collection, function(value, index, collection) { accumulator = initAccum ? (initAccum = false, value) : iteratee(accumulator, value, index, collection); }); return accumulator; } /** * The base implementation of `_.sortBy` which uses `comparer` to define the * sort order of `array` and replaces criteria objects with their corresponding * values. * * @private * @param {Array} array The array to sort. * @param {Function} comparer The function to define sort order. * @returns {Array} Returns `array`. */ function baseSortBy(array, comparer) { var length = array.length; array.sort(comparer); while (length--) { array[length] = array[length].value; } return array; } /** * The base implementation of `_.sum` and `_.sumBy` without support for * iteratee shorthands. * * @private * @param {Array} array The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {number} Returns the sum. */ function baseSum(array, iteratee) { var result, index = -1, length = array.length; while (++index < length) { var current = iteratee(array[index]); if (current !== undefined) { result = result === undefined ? current : (result + current); } } return result; } /** * The base implementation of `_.times` without support for iteratee shorthands * or max array length checks. * * @private * @param {number} n The number of times to invoke `iteratee`. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the array of results. */ function baseTimes(n, iteratee) { var index = -1, result = Array(n); while (++index < n) { result[index] = iteratee(index); } return result; } /** * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array * of key-value pairs for `object` corresponding to the property names of `props`. * * @private * @param {Object} object The object to query. * @param {Array} props The property names to get values for. * @returns {Object} Returns the key-value pairs. */ function baseToPairs(object, props) { return arrayMap(props, function(key) { return [key, object[key]]; }); } /** * The base implementation of `_.trim`. * * @private * @param {string} string The string to trim. * @returns {string} Returns the trimmed string. */ function baseTrim(string) { return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '') : string; } /** * The base implementation of `_.unary` without support for storing metadata. * * @private * @param {Function} func The function to cap arguments for. * @returns {Function} Returns the new capped function. */ function baseUnary(func) { return function(value) { return func(value); }; } /** * The base implementation of `_.values` and `_.valuesIn` which creates an * array of `object` property values corresponding to the property names * of `props`. * * @private * @param {Object} object The object to query. * @param {Array} props The property names to get values for. * @returns {Object} Returns the array of property values. */ function baseValues(object, props) { return arrayMap(props, function(key) { return object[key]; }); } /** * Checks if a `cache` value for `key` exists. * * @private * @param {Object} cache The cache to query. * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function cacheHas(cache, key) { return cache.has(key); } /** * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol * that is not found in the character symbols. * * @private * @param {Array} strSymbols The string symbols to inspect. * @param {Array} chrSymbols The character symbols to find. * @returns {number} Returns the index of the first unmatched string symbol. */ function charsStartIndex(strSymbols, chrSymbols) { var index = -1, length = strSymbols.length; while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} return index; } /** * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol * that is not found in the character symbols. * * @private * @param {Array} strSymbols The string symbols to inspect. * @param {Array} chrSymbols The character symbols to find. * @returns {number} Returns the index of the last unmatched string symbol. */ function charsEndIndex(strSymbols, chrSymbols) { var index = strSymbols.length; while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} return index; } /** * Gets the number of `placeholder` occurrences in `array`. * * @private * @param {Array} array The array to inspect. * @param {*} placeholder The placeholder to search for. * @returns {number} Returns the placeholder count. */ function countHolders(array, placeholder) { var length = array.length, result = 0; while (length--) { if (array[length] === placeholder) { ++result; } } return result; } /** * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A * letters to basic Latin letters. * * @private * @param {string} letter The matched letter to deburr. * @returns {string} Returns the deburred letter. */ var deburrLetter = basePropertyOf(deburredLetters); /** * Used by `_.escape` to convert characters to HTML entities. * * @private * @param {string} chr The matched character to escape. * @returns {string} Returns the escaped character. */ var escapeHtmlChar = basePropertyOf(htmlEscapes); /** * Used by `_.template` to escape characters for inclusion in compiled string literals. * * @private * @param {string} chr The matched character to escape. * @returns {string} Returns the escaped character. */ function escapeStringChar(chr) { return '\\' + stringEscapes[chr]; } /** * Gets the value at `key` of `object`. * * @private * @param {Object} [object] The object to query. * @param {string} key The key of the property to get. * @returns {*} Returns the property value. */ function getValue(object, key) { return object == null ? undefined : object[key]; } /** * Checks if `string` contains Unicode symbols. * * @private * @param {string} string The string to inspect. * @returns {boolean} Returns `true` if a symbol is found, else `false`. */ function hasUnicode(string) { return reHasUnicode.test(string); } /** * Checks if `string` contains a word composed of Unicode symbols. * * @private * @param {string} string The string to inspect. * @returns {boolean} Returns `true` if a word is found, else `false`. */ function hasUnicodeWord(string) { return reHasUnicodeWord.test(string); } /** * Converts `iterator` to an array. * * @private * @param {Object} iterator The iterator to convert. * @returns {Array} Returns the converted array. */ function iteratorToArray(iterator) { var data, result = []; while (!(data = iterator.next()).done) { result.push(data.value); } return result; } /** * Converts `map` to its key-value pairs. * * @private * @param {Object} map The map to convert. * @returns {Array} Returns the key-value pairs. */ function mapToArray(map) { var index = -1, result = Array(map.size); map.forEach(function(value, key) { result[++index] = [key, value]; }); return result; } /** * Creates a unary function that invokes `func` with its argument transformed. * * @private * @param {Function} func The function to wrap. * @param {Function} transform The argument transform. * @returns {Function} Returns the new function. */ function overArg(func, transform) { return function(arg) { return func(transform(arg)); }; } /** * Replaces all `placeholder` elements in `array` with an internal placeholder * and returns an array of their indexes. * * @private * @param {Array} array The array to modify. * @param {*} placeholder The placeholder to replace. * @returns {Array} Returns the new array of placeholder indexes. */ function replaceHolders(array, placeholder) { var index = -1, length = array.length, resIndex = 0, result = []; while (++index < length) { var value = array[index]; if (value === placeholder || value === PLACEHOLDER) { array[index] = PLACEHOLDER; result[resIndex++] = index; } } return result; } /** * Converts `set` to an array of its values. * * @private * @param {Object} set The set to convert. * @returns {Array} Returns the values. */ function setToArray(set) { var index = -1, result = Array(set.size); set.forEach(function(value) { result[++index] = value; }); return result; } /** * Converts `set` to its value-value pairs. * * @private * @param {Object} set The set to convert. * @returns {Array} Returns the value-value pairs. */ function setToPairs(set) { var index = -1, result = Array(set.size); set.forEach(function(value) { result[++index] = [value, value]; }); return result; } /** * A specialized version of `_.indexOf` which performs strict equality * comparisons of values, i.e. `===`. * * @private * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} fromIndex The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. */ function strictIndexOf(array, value, fromIndex) { var index = fromIndex - 1, length = array.length; while (++index < length) { if (array[index] === value) { return index; } } return -1; } /** * A specialized version of `_.lastIndexOf` which performs strict equality * comparisons of values, i.e. `===`. * * @private * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} fromIndex The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. */ function strictLastIndexOf(array, value, fromIndex) { var index = fromIndex + 1; while (index--) { if (array[index] === value) { return index; } } return index; } /** * Gets the number of symbols in `string`. * * @private * @param {string} string The string to inspect. * @returns {number} Returns the string size. */ function stringSize(string) { return hasUnicode(string) ? unicodeSize(string) : asciiSize(string); } /** * Converts `string` to an array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the converted array. */ function stringToArray(string) { return hasUnicode(string) ? unicodeToArray(string) : asciiToArray(string); } /** * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace * character of `string`. * * @private * @param {string} string The string to inspect. * @returns {number} Returns the index of the last non-whitespace character. */ function trimmedEndIndex(string) { var index = string.length; while (index-- && reWhitespace.test(string.charAt(index))) {} return index; } /** * Used by `_.unescape` to convert HTML entities to characters. * * @private * @param {string} chr The matched character to unescape. * @returns {string} Returns the unescaped character. */ var unescapeHtmlChar = basePropertyOf(htmlUnescapes); /** * Gets the size of a Unicode `string`. * * @private * @param {string} string The string inspect. * @returns {number} Returns the string size. */ function unicodeSize(string) { var result = reUnicode.lastIndex = 0; while (reUnicode.test(string)) { ++result; } return result; } /** * Converts a Unicode `string` to an array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the converted array. */ function unicodeToArray(string) { return string.match(reUnicode) || []; } /** * Splits a Unicode `string` into an array of its words. * * @private * @param {string} The string to inspect. * @returns {Array} Returns the words of `string`. */ function unicodeWords(string) { return string.match(reUnicodeWord) || []; } /*--------------------------------------------------------------------------*/ /** * Create a new pristine `lodash` function using the `context` object. * * @static * @memberOf _ * @since 1.1.0 * @category Util * @param {Object} [context=root] The context object. * @returns {Function} Returns a new `lodash` function. * @example * * _.mixin({ 'foo': _.constant('foo') }); * * var lodash = _.runInContext(); * lodash.mixin({ 'bar': lodash.constant('bar') }); * * _.isFunction(_.foo); * // => true * _.isFunction(_.bar); * // => false * * lodash.isFunction(lodash.foo); * // => false * lodash.isFunction(lodash.bar); * // => true * * // Create a suped-up `defer` in Node.js. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer; */ var runInContext = (function runInContext(context) { context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps)); /** Built-in constructor references. */ var Array = context.Array, Date = context.Date, Error = context.Error, Function = context.Function, Math = context.Math, Object = context.Object, RegExp = context.RegExp, String = context.String, TypeError = context.TypeError; /** Used for built-in method references. */ var arrayProto = Array.prototype, funcProto = Function.prototype, objectProto = Object.prototype; /** Used to detect overreaching core-js shims. */ var coreJsData = context['__core-js_shared__']; /** Used to resolve the decompiled source of functions. */ var funcToString = funcProto.toString; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** Used to generate unique IDs. */ var idCounter = 0; /** Used to detect methods masquerading as native. */ var maskSrcKey = (function() { var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); return uid ? ('Symbol(src)_1.' + uid) : ''; }()); /** * Used to resolve the * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var nativeObjectToString = objectProto.toString; /** Used to infer the `Object` constructor. */ var objectCtorString = funcToString.call(Object); /** Used to restore the original `_` reference in `_.noConflict`. */ var oldDash = root._; /** Used to detect if a method is native. */ var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' ); /** Built-in value references. */ var Buffer = moduleExports ? context.Buffer : undefined, Symbol = context.Symbol, Uint8Array = context.Uint8Array, allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined, getPrototype = overArg(Object.getPrototypeOf, Object), objectCreate = Object.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice, spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined, symIterator = Symbol ? Symbol.iterator : undefined, symToStringTag = Symbol ? Symbol.toStringTag : undefined; var defineProperty = (function() { try { var func = getNative(Object, 'defineProperty'); func({}, '', {}); return func; } catch (e) {} }()); /** Mocked built-ins. */ var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, ctxNow = Date && Date.now !== root.Date.now && Date.now, ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeCeil = Math.ceil, nativeFloor = Math.floor, nativeGetSymbols = Object.getOwnPropertySymbols, nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, nativeIsFinite = context.isFinite, nativeJoin = arrayProto.join, nativeKeys = overArg(Object.keys, Object), nativeMax = Math.max, nativeMin = Math.min, nativeNow = Date.now, nativeParseInt = context.parseInt, nativeRandom = Math.random, nativeReverse = arrayProto.reverse; /* Built-in method references that are verified to be native. */ var DataView = getNative(context, 'DataView'), Map = getNative(context, 'Map'), Promise = getNative(context, 'Promise'), Set = getNative(context, 'Set'), WeakMap = getNative(context, 'WeakMap'), nativeCreate = getNative(Object, 'create'); /** Used to store function metadata. */ var metaMap = WeakMap && new WeakMap; /** Used to lookup unminified function names. */ var realNames = {}; /** Used to detect maps, sets, and weakmaps. */ var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map), promiseCtorString = toSource(Promise), setCtorString = toSource(Set), weakMapCtorString = toSource(WeakMap); /** Used to convert symbols to primitives and strings. */ var symbolProto = Symbol ? Symbol.prototype : undefined, symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, symbolToString = symbolProto ? symbolProto.toString : undefined; /*------------------------------------------------------------------------*/ /** * Creates a `lodash` object which wraps `value` to enable implicit method * chain sequences. Methods that operate on and return arrays, collections, * and functions can be chained together. Methods that retrieve a single value * or may return a primitive value will automatically end the chain sequence * and return the unwrapped value. Otherwise, the value must be unwrapped * with `_#value`. * * Explicit chain sequences, which must be unwrapped with `_#value`, may be * enabled using `_.chain`. * * The execution of chained methods is lazy, that is, it's deferred until * `_#value` is implicitly or explicitly called. * * Lazy evaluation allows several methods to support shortcut fusion. * Shortcut fusion is an optimization to merge iteratee calls; this avoids * the creation of intermediate arrays and can greatly reduce the number of * iteratee executions. Sections of a chain sequence qualify for shortcut * fusion if the section is applied to an array and iteratees accept only * one argument. The heuristic for whether a section qualifies for shortcut * fusion is subject to change. * * Chaining is supported in custom builds as long as the `_#value` method is * directly or indirectly included in the build. * * In addition to lodash methods, wrappers have `Array` and `String` methods. * * The wrapper `Array` methods are: * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` * * The wrapper `String` methods are: * `replace` and `split` * * The wrapper methods that support shortcut fusion are: * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` * * The chainable wrapper methods are: * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, * `zipObject`, `zipObjectDeep`, and `zipWith` * * The wrapper methods that are **not** chainable by default are: * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`, * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`, * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`, * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`, * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`, * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`, * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`, * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`, * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`, * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`, * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, * `upperFirst`, `value`, and `words` * * @name _ * @constructor * @category Seq * @param {*} value The value to wrap in a `lodash` instance. * @returns {Object} Returns the new `lodash` wrapper instance. * @example * * function square(n) { * return n * n; * } * * var wrapped = _([1, 2, 3]); * * // Returns an unwrapped value. * wrapped.reduce(_.add); * // => 6 * * // Returns a wrapped value. * var squares = wrapped.map(square); * * _.isArray(squares); * // => false * * _.isArray(squares.value()); * // => true */ function lodash(value) { if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) { if (value instanceof LodashWrapper) { return value; } if (hasOwnProperty.call(value, '__wrapped__')) { return wrapperClone(value); } } return new LodashWrapper(value); } /** * The base implementation of `_.create` without support for assigning * properties to the created object. * * @private * @param {Object} proto The object to inherit from. * @returns {Object} Returns the new object. */ var baseCreate = (function() { function object() {} return function(proto) { if (!isObject(proto)) { return {}; } if (objectCreate) { return objectCreate(proto); } object.prototype = proto; var result = new object; object.prototype = undefined; return result; }; }()); /** * The function whose prototype chain sequence wrappers inherit from. * * @private */ function baseLodash() { // No operation performed. } /** * The base constructor for creating `lodash` wrapper objects. * * @private * @param {*} value The value to wrap. * @param {boolean} [chainAll] Enable explicit method chain sequences. */ function LodashWrapper(value, chainAll) { this.__wrapped__ = value; this.__actions__ = []; this.__chain__ = !!chainAll; this.__index__ = 0; this.__values__ = undefined; } /** * By default, the template delimiters used by lodash are like those in * embedded Ruby (ERB) as well as ES2015 template strings. Change the * following template settings to use alternative delimiters. * * **Security:** See * [threat model](https://github.com/lodash/lodash/blob/main/threat-model.md) * — `_.template` is insecure and will be removed in v5. * * @static * @memberOf _ * @type {Object} */ lodash.templateSettings = { /** * Used to detect `data` property values to be HTML-escaped. * * @memberOf _.templateSettings * @type {RegExp} */ 'escape': reEscape, /** * Used to detect code to be evaluated. * * @memberOf _.templateSettings * @type {RegExp} */ 'evaluate': reEvaluate, /** * Used to detect `data` property values to inject. * * @memberOf _.templateSettings * @type {RegExp} */ 'interpolate': reInterpolate, /** * Used to reference the data object in the template text. * * @memberOf _.templateSettings * @type {string} */ 'variable': '', /** * Used to import variables into the compiled template. * * @memberOf _.templateSettings * @type {Object} */ 'imports': { /** * A reference to the `lodash` function. * * @memberOf _.templateSettings.imports * @type {Function} */ '_': lodash } }; // Ensure wrappers are instances of `baseLodash`. lodash.prototype = baseLodash.prototype; lodash.prototype.constructor = lodash; LodashWrapper.prototype = baseCreate(baseLodash.prototype); LodashWrapper.prototype.constructor = LodashWrapper; /*------------------------------------------------------------------------*/ /** * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. * * @private * @constructor * @param {*} value The value to wrap. */ function LazyWrapper(value) { this.__wrapped__ = value; this.__actions__ = []; this.__dir__ = 1; this.__filtered__ = false; this.__iteratees__ = []; this.__takeCount__ = MAX_ARRAY_LENGTH; this.__views__ = []; } /** * Creates a clone of the lazy wrapper object. * * @private * @name clone * @memberOf LazyWrapper * @returns {Object} Returns the cloned `LazyWrapper` object. */ function lazyClone() { var result = new LazyWrapper(this.__wrapped__); result.__actions__ = copyArray(this.__actions__); result.__dir__ = this.__dir__; result.__filtered__ = this.__filtered__; result.__iteratees__ = copyArray(this.__iteratees__); result.__takeCount__ = this.__takeCount__; result.__views__ = copyArray(this.__views__); return result; } /** * Reverses the direction of lazy iteration. * * @private * @name reverse * @memberOf LazyWrapper * @returns {Object} Returns the new reversed `LazyWrapper` object. */ function lazyReverse() { if (this.__filtered__) { var result = new LazyWrapper(this); result.__dir__ = -1; result.__filtered__ = true; } else { result = this.clone(); result.__dir__ *= -1; } return result; } /** * Extracts the unwrapped value from its lazy wrapper. * * @private * @name value * @memberOf LazyWrapper * @returns {*} Returns the unwrapped value. */ function lazyValue() { var array = this.__wrapped__.value(), dir = this.__dir__, isArr = isArray(array), isRight = dir < 0, arrLength = isArr ? array.length : 0, view = getView(0, arrLength, this.__views__), start = view.start, end = view.end, length = end - start, index = isRight ? end : (start - 1), iteratees = this.__iteratees__, iterLength = iteratees.length, resIndex = 0, takeCount = nativeMin(length, this.__takeCount__); if (!isArr || (!isRight && arrLength == length && takeCount == length)) { return baseWrapperValue(array, this.__actions__); } var result = []; outer: while (length-- && resIndex < takeCount) { index += dir; var iterIndex = -1, value = array[index]; while (++iterIndex < iterLength) { var data = iteratees[iterIndex], iteratee = data.iteratee, type = data.type, computed = iteratee(value); if (type == LAZY_MAP_FLAG) { value = computed; } else if (!computed) { if (type == LAZY_FILTER_FLAG) { continue outer; } else { break outer; } } } result[resIndex++] = value; } return result; } // Ensure `LazyWrapper` is an instance of `baseLodash`. LazyWrapper.prototype = baseCreate(baseLodash.prototype); LazyWrapper.prototype.constructor = LazyWrapper; /*------------------------------------------------------------------------*/ /** * Creates a hash object. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function Hash(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } /** * Removes all key-value entries from the hash. * * @private * @name clear * @memberOf Hash */ function hashClear() { this.__data__ = nativeCreate ? nativeCreate(null) : {}; this.size = 0; } /** * Removes `key` and its value from the hash. * * @private * @name delete * @memberOf Hash * @param {Object} hash The hash to modify. * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function hashDelete(key) { var result = this.has(key) && delete this.__data__[key]; this.size -= result ? 1 : 0; return result; } /** * Gets the hash value for `key`. * * @private * @name get * @memberOf Hash * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function hashGet(key) { var data = this.__data__; if (nativeCreate) { var result = data[key]; return result === HASH_UNDEFINED ? undefined : result; } return hasOwnProperty.call(data, key) ? data[key] : undefined; } /** * Checks if a hash value for `key` exists. * * @private * @name has * @memberOf Hash * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function hashHas(key) { var data = this.__data__; return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); } /** * Sets the hash `key` to `value`. * * @private * @name set * @memberOf Hash * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the hash instance. */ function hashSet(key, value) { var data = this.__data__; this.size += this.has(key) ? 0 : 1; data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; return this; } // Add methods to `Hash`. Hash.prototype.clear = hashClear; Hash.prototype['delete'] = hashDelete; Hash.prototype.get = hashGet; Hash.prototype.has = hashHas; Hash.prototype.set = hashSet; /*------------------------------------------------------------------------*/ /** * Creates an list cache object. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function ListCache(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } /** * Removes all key-value entries from the list cache. * * @private * @name clear * @memberOf ListCache */ function listCacheClear() { this.__data__ = []; this.size = 0; } /** * Removes `key` and its value from the list cache. * * @private * @name delete * @memberOf ListCache * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function listCacheDelete(key) { var data = this.__data__, index = assocIndexOf(data, key); if (index < 0) { return false; } var lastIndex = data.length - 1; if (index == lastIndex) { data.pop(); } else { splice.call(data, index, 1); } --this.size; return true; } /** * Gets the list cache value for `key`. * * @private * @name get * @memberOf ListCache * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function listCacheGet(key) { var data = this.__data__, index = assocIndexOf(data, key); return index < 0 ? undefined : data[index][1]; } /** * Checks if a list cache value for `key` exists. * * @private * @name has * @memberOf ListCache * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function listCacheHas(key) { return assocIndexOf(this.__data__, key) > -1; } /** * Sets the list cache `key` to `value`. * * @private * @name set * @memberOf ListCache * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the list cache instance. */ function listCacheSet(key, value) { var data = this.__data__, index = assocIndexOf(data, key); if (index < 0) { ++this.size; data.push([key, value]); } else { data[index][1] = value; } return this; } // Add methods to `ListCache`. ListCache.prototype.clear = listCacheClear; ListCache.prototype['delete'] = listCacheDelete; ListCache.prototype.get = listCacheGet; ListCache.prototype.has = listCacheHas; ListCache.prototype.set = listCacheSet; /*------------------------------------------------------------------------*/ /** * Creates a map cache object to store key-value pairs. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function MapCache(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } /** * Removes all key-value entries from the map. * * @private * @name clear * @memberOf MapCache */ function mapCacheClear() { this.size = 0; this.__data__ = { 'hash': new Hash, 'map': new (Map || ListCache), 'string': new Hash }; } /** * Removes `key` and its value from the map. * * @private * @name delete * @memberOf MapCache * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function mapCacheDelete(key) { var result = getMapData(this, key)['delete'](key); this.size -= result ? 1 : 0; return result; } /** * Gets the map value for `key`. * * @private * @name get * @memberOf MapCache * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function mapCacheGet(key) { return getMapData(this, key).get(key); } /** * Checks if a map value for `key` exists. * * @private * @name has * @memberOf MapCache * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function mapCacheHas(key) { return getMapData(this, key).has(key); } /** * Sets the map `key` to `value`. * * @private * @name set * @memberOf MapCache * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the map cache instance. */ function mapCacheSet(key, value) { var data = getMapData(this, key), size = data.size; data.set(key, value); this.size += data.size == size ? 0 : 1; return this; } // Add methods to `MapCache`. MapCache.prototype.clear = mapCacheClear; MapCache.prototype['delete'] = mapCacheDelete; MapCache.prototype.get = mapCacheGet; MapCache.prototype.has = mapCacheHas; MapCache.prototype.set = mapCacheSet; /*------------------------------------------------------------------------*/ /** * * Creates an array cache object to store unique values. * * @private * @constructor * @param {Array} [values] The values to cache. */ function SetCache(values) { var index = -1, length = values == null ? 0 : values.length; this.__data__ = new MapCache; while (++index < length) { this.add(values[index]); } } /** * Adds `value` to the array cache. * * @private * @name add * @memberOf SetCache * @alias push * @param {*} value The value to cache. * @returns {Object} Returns the cache instance. */ function setCacheAdd(value) { this.__data__.set(value, HASH_UNDEFINED); return this; } /** * Checks if `value` is in the array cache. * * @private * @name has * @memberOf SetCache * @param {*} value The value to search for. * @returns {boolean} Returns `true` if `value` is found, else `false`. */ function setCacheHas(value) { return this.__data__.has(value); } // Add methods to `SetCache`. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; SetCache.prototype.has = setCacheHas; /*------------------------------------------------------------------------*/ /** * Creates a stack cache object to store key-value pairs. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function Stack(entries) { var data = this.__data__ = new ListCache(entries); this.size = data.size; } /** * Removes all key-value entries from the stack. * * @private * @name clear * @memberOf Stack */ function stackClear() { this.__data__ = new ListCache; this.size = 0; } /** * Removes `key` and its value from the stack. * * @private * @name delete * @memberOf Stack * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function stackDelete(key) { var data = this.__data__, result = data['delete'](key); this.size = data.size; return result; } /** * Gets the stack value for `key`. * * @private * @name get * @memberOf Stack * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function stackGet(key) { return this.__data__.get(key); } /** * Checks if a stack value for `key` exists. * * @private * @name has * @memberOf Stack * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function stackHas(key) { return this.__data__.has(key); } /** * Sets the stack `key` to `value`. * * @private * @name set * @memberOf Stack * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the stack cache instance. */ function stackSet(key, value) { var data = this.__data__; if (data instanceof ListCache) { var pairs = data.__data__; if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { pairs.push([key, value]); this.size = ++data.size; return this; } data = this.__data__ = new MapCache(pairs); } data.set(key, value); this.size = data.size; return this; } // Add methods to `Stack`. Stack.prototype.clear = stackClear; Stack.prototype['delete'] = stackDelete; Stack.prototype.get = stackGet; Stack.prototype.has = stackHas; Stack.prototype.set = stackSet; /*------------------------------------------------------------------------*/ /** * Creates an array of the enumerable property names of the array-like `value`. * * @private * @param {*} value The value to query. * @param {boolean} inherited Specify returning inherited property names. * @returns {Array} Returns the array of property names. */ function arrayLikeKeys(value, inherited) { var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length; for (var key in value) { if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && ( // Safari 9 has enumerable `arguments.length` in strict mode. key == 'length' || // Node.js 0.10 has enumerable non-index properties on buffers. (isBuff && (key == 'offset' || key == 'parent')) || // PhantomJS 2 has enumerable non-index properties on typed arrays. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || // Skip index properties. isIndex(key, length) ))) { result.push(key); } } return result; } /** * A specialized version of `_.sample` for arrays. * * @private * @param {Array} array The array to sample. * @returns {*} Returns the random element. */ function arraySample(array) { var length = array.length; return length ? array[baseRandom(0, length - 1)] : undefined; } /** * A specialized version of `_.sampleSize` for arrays. * * @private * @param {Array} array The array to sample. * @param {number} n The number of elements to sample. * @returns {Array} Returns the random elements. */ function arraySampleSize(array, n) { return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length)); } /** * A specialized version of `_.shuffle` for arrays. * * @private * @param {Array} array The array to shuffle. * @returns {Array} Returns the new shuffled array. */ function arrayShuffle(array) { return shuffleSelf(copyArray(array)); } /** * This function is like `assignValue` except that it doesn't assign * `undefined` values. * * @private * @param {Object} object The object to modify. * @param {string} key The key of the property to assign. * @param {*} value The value to assign. */ function assignMergeValue(object, key, value) { if ((value !== undefined && !eq(object[key], value)) || (value === undefined && !(key in object))) { baseAssignValue(object, key, value); } } /** * Assigns `value` to `key` of `object` if the existing value is not equivalent * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * * @private * @param {Object} object The object to modify. * @param {string} key The key of the property to assign. * @param {*} value The value to assign. */ function assignValue(object, key, value) { var objValue = object[key]; if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || (value === undefined && !(key in object))) { baseAssignValue(object, key, value); } } /** * Gets the index at which the `key` is found in `array` of key-value pairs. * * @private * @param {Array} array The array to inspect. * @param {*} key The key to search for. * @returns {number} Returns the index of the matched value, else `-1`. */ function assocIndexOf(array, key) { var length = array.length; while (length--) { if (eq(array[length][0], key)) { return length; } } return -1; } /** * Aggregates elements of `collection` on `accumulator` with keys transformed * by `iteratee` and values set by `setter`. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} setter The function to set `accumulator` values. * @param {Function} iteratee The iteratee to transform keys. * @param {Object} accumulator The initial aggregated object. * @returns {Function} Returns `accumulator`. */ function baseAggregator(collection, setter, iteratee, accumulator) { baseEach(collection, function(value, key, collection) { setter(accumulator, value, iteratee(value), collection); }); return accumulator; } /** * The base implementation of `_.assign` without support for multiple sources * or `customizer` functions. * * @private * @param {Object} object The destination object. * @param {Object} source The source object. * @returns {Object} Returns `object`. */ function baseAssign(object, source) { return object && copyObject(source, keys(source), object); } /** * The base implementation of `_.assignIn` without support for multiple sources * or `customizer` functions. * * @private * @param {Object} object The destination object. * @param {Object} source The source object. * @returns {Object} Returns `object`. */ function baseAssignIn(object, source) { return object && copyObject(source, keysIn(source), object); } /** * The base implementation of `assignValue` and `assignMergeValue` without * value checks. * * @private * @param {Object} object The object to modify. * @param {string} key The key of the property to assign. * @param {*} value The value to assign. */ function baseAssignValue(object, key, value) { if (key == '__proto__' && defineProperty) { defineProperty(object, key, { 'configurable': true, 'enumerable': true, 'value': value, 'writable': true }); } else { object[key] = value; } } /** * The base implementation of `_.at` without support for individual paths. * * @private * @param {Object} object The object to iterate over. * @param {string[]} paths The property paths to pick. * @returns {Array} Returns the picked elements. */ function baseAt(object, paths) { var index = -1, length = paths.length, result = Array(length), skip = object == null; while (++index < length) { result[index] = skip ? undefined : get(object, paths[index]); } return result; } /** * The base implementation of `_.clamp` which doesn't coerce arguments. * * @private * @param {number} number The number to clamp. * @param {number} [lower] The lower bound. * @param {number} upper The upper bound. * @returns {number} Returns the clamped number. */ function baseClamp(number, lower, upper) { if (number === number) { if (upper !== undefined) { number = number <= upper ? number : upper; } if (lower !== undefined) { number = number >= lower ? number : lower; } } return number; } /** * The base implementation of `_.clone` and `_.cloneDeep` which tracks * traversed objects. * * @private * @param {*} value The value to clone. * @param {boolean} bitmask The bitmask flags. * 1 - Deep clone * 2 - Flatten inherited properties * 4 - Clone symbols * @param {Function} [customizer] The function to customize cloning. * @param {string} [key] The key of `value`. * @param {Object} [object] The parent object of `value`. * @param {Object} [stack] Tracks traversed objects and their clone counterparts. * @returns {*} Returns the cloned value. */ function baseClone(value, bitmask, customizer, key, object, stack) { var result, isDeep = bitmask & CLONE_DEEP_FLAG, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG; if (customizer) { result = object ? customizer(value, key, object, stack) : customizer(value); } if (result !== undefined) { return result; } if (!isObject(value)) { return value; } var isArr = isArray(value); if (isArr) { result = initCloneArray(value); if (!isDeep) { return copyArray(value, result); } } else { var tag = getTag(value), isFunc = tag == funcTag || tag == genTag; if (isBuffer(value)) { return cloneBuffer(value, isDeep); } if (tag == objectTag || tag == argsTag || (isFunc && !object)) { result = (isFlat || isFunc) ? {} : initCloneObject(value); if (!isDeep) { return isFlat ? copySymbolsIn(value, baseAssignIn(result, value)) : copySymbols(value, baseAssign(result, value)); } } else { if (!cloneableTags[tag]) { return object ? value : {}; } result = initCloneByTag(value, tag, isDeep); } } // Check for circular references and return its corresponding clone. stack || (stack = new Stack); var stacked = stack.get(value); if (stacked) { return stacked; } stack.set(value, result); if (isSet(value)) { value.forEach(function(subValue) { result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); }); } else if (isMap(value)) { value.forEach(function(subValue, key) { result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); }); } var keysFunc = isFull ? (isFlat ? getAllKeysIn : getAllKeys) : (isFlat ? keysIn : keys); var props = isArr ? undefined : keysFunc(value); arrayEach(props || value, function(subValue, key) { if (props) { key = subValue; subValue = value[key]; } // Recursively populate clone (susceptible to call stack limits). assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); }); return result; } /** * The base implementation of `_.conforms` which doesn't clone `source`. * * @private * @param {Object} source The object of property predicates to conform to. * @returns {Function} Returns the new spec function. */ function baseConforms(source) { var props = keys(source); return function(object) { return baseConformsTo(object, source, props); }; } /** * The base implementation of `_.conformsTo` which accepts `props` to check. * * @private * @param {Object} object The object to inspect. * @param {Object} source The object of property predicates to conform to. * @returns {boolean} Returns `true` if `object` conforms, else `false`. */ function baseConformsTo(object, source, props) { var length = props.length; if (object == null) { return !length; } object = Object(object); while (length--) { var key = props[length], predicate = source[key], value = object[key]; if ((value === undefined && !(key in object)) || !predicate(value)) { return false; } } return true; } /** * The base implementation of `_.delay` and `_.defer` which accepts `args` * to provide to `func`. * * @private * @param {Function} func The function to delay. * @param {number} wait The number of milliseconds to delay invocation. * @param {Array} args The arguments to provide to `func`. * @returns {number|Object} Returns the timer id or timeout object. */ function baseDelay(func, wait, args) { if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } return setTimeout(function() { func.apply(undefined, args); }, wait); } /** * The base implementation of methods like `_.difference` without support * for excluding multiple arrays or iteratee shorthands. * * @private * @param {Array} array The array to inspect. * @param {Array} values The values to exclude. * @param {Function} [iteratee] The iteratee invoked per element. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of filtered values. */ function baseDifference(array, values, iteratee, comparator) { var index = -1, includes = arrayIncludes, isCommon = true, length = array.length, result = [], valuesLength = values.length; if (!length) { return result; } if (iteratee) { values = arrayMap(values, baseUnary(iteratee)); } if (comparator) { includes = arrayIncludesWith; isCommon = false; } else if (values.length >= LARGE_ARRAY_SIZE) { includes = cacheHas; isCommon = false; values = new SetCache(values); } outer: while (++index < length) { var value = array[index], computed = iteratee == null ? value : iteratee(value); value = (comparator || value !== 0) ? value : 0; if (isCommon && computed === computed) { var valuesIndex = valuesLength; while (valuesIndex--) { if (values[valuesIndex] === computed) { continue outer; } } result.push(value); } else if (!includes(values, computed, comparator)) { result.push(value); } } return result; } /** * The base implementation of `_.forEach` without support for iteratee shorthands. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array|Object} Returns `collection`. */ var baseEach = createBaseEach(baseForOwn); /** * The base implementation of `_.forEachRight` without support for iteratee shorthands. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array|Object} Returns `collection`. */ var baseEachRight = createBaseEach(baseForOwnRight, true); /** * The base implementation of `_.every` without support for iteratee shorthands. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {boolean} Returns `true` if all elements pass the predicate check, * else `false` */ function baseEvery(collection, predicate) { var result = true; baseEach(collection, function(value, index, collection) { result = !!predicate(value, index, collection); return result; }); return result; } /** * The base implementation of methods like `_.max` and `_.min` which accepts a * `comparator` to determine the extremum value. * * @private * @param {Array} array The array to iterate over. * @param {Function} iteratee The iteratee invoked per iteration. * @param {Function} comparator The comparator used to compare values. * @returns {*} Returns the extremum value. */ function baseExtremum(array, iteratee, comparator) { var index = -1, length = array.length; while (++index < length) { var value = array[index], current = iteratee(value); if (current != null && (computed === undefined ? (current === current && !isSymbol(current)) : comparator(current, computed) )) { var computed = current, result = value; } } return result; } /** * The base implementation of `_.fill` without an iteratee call guard. * * @private * @param {Array} array The array to fill. * @param {*} value The value to fill `array` with. * @param {number} [start=0] The start position. * @param {number} [end=array.length] The end position. * @returns {Array} Returns `array`. */ function baseFill(array, value, start, end) { var length = array.length; start = toInteger(start); if (start < 0) { start = -start > length ? 0 : (length + start); } end = (end === undefined || end > length) ? length : toInteger(end); if (end < 0) { end += length; } end = start > end ? 0 : toLength(end); while (start < end) { array[start++] = value; } return array; } /** * The base implementation of `_.filter` without support for iteratee shorthands. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {Array} Returns the new filtered array. */ function baseFilter(collection, predicate) { var result = []; baseEach(collection, function(value, index, collection) { if (predicate(value, index, collection)) { result.push(value); } }); return result; } /** * The base implementation of `_.flatten` with support for restricting flattening. * * @private * @param {Array} array The array to flatten. * @param {number} depth The maximum recursion depth. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. * @param {Array} [result=[]] The initial result value. * @returns {Array} Returns the new flattened array. */ function baseFlatten(array, depth, predicate, isStrict, result) { var index = -1, length = array.length; predicate || (predicate = isFlattenable); result || (result = []); while (++index < length) { var value = array[index]; if (depth > 0 && predicate(value)) { if (depth > 1) { // Recursively flatten arrays (susceptible to call stack limits). baseFlatten(value, depth - 1, predicate, isStrict, result); } else { arrayPush(result, value); } } else if (!isStrict) { result[result.length] = value; } } return result; } /** * The base implementation of `baseForOwn` which iterates over `object` * properties returned by `keysFunc` and invokes `iteratee` for each property. * Iteratee functions may exit iteration early by explicitly returning `false`. * * @private * @param {Object} object The object to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {Function} keysFunc The function to get the keys of `object`. * @returns {Object} Returns `object`. */ var baseFor = createBaseFor(); /** * This function is like `baseFor` except that it iterates over properties * in the opposite order. * * @private * @param {Object} object The object to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {Function} keysFunc The function to get the keys of `object`. * @returns {Object} Returns `object`. */ var baseForRight = createBaseFor(true); /** * The base implementation of `_.forOwn` without support for iteratee shorthands. * * @private * @param {Object} object The object to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Object} Returns `object`. */ function baseForOwn(object, iteratee) { return object && baseFor(object, iteratee, keys); } /** * The base implementation of `_.forOwnRight` without support for iteratee shorthands. * * @private * @param {Object} object The object to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Object} Returns `object`. */ function baseForOwnRight(object, iteratee) { return object && baseForRight(object, iteratee, keys); } /** * The base implementation of `_.functions` which creates an array of * `object` function property names filtered from `props`. * * @private * @param {Object} object The object to inspect. * @param {Array} props The property names to filter. * @returns {Array} Returns the function names. */ function baseFunctions(object, props) { return arrayFilter(props, function(key) { return isFunction(object[key]); }); } /** * The base implementation of `_.get` without support for default values. * * @private * @param {Object} object The object to query. * @param {Array|string} path The path of the property to get. * @returns {*} Returns the resolved value. */ function baseGet(object, path) { path = castPath(path, object); var index = 0, length = path.length; while (object != null && index < length) { object = object[toKey(path[index++])]; } return (index && index == length) ? object : undefined; } /** * The base implementation of `getAllKeys` and `getAllKeysIn` which uses * `keysFunc` and `symbolsFunc` to get the enumerable property names and * symbols of `object`. * * @private * @param {Object} object The object to query. * @param {Function} keysFunc The function to get the keys of `object`. * @param {Function} symbolsFunc The function to get the symbols of `object`. * @returns {Array} Returns the array of property names and symbols. */ function baseGetAllKeys(object, keysFunc, symbolsFunc) { var result = keysFunc(object); return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); } /** * The base implementation of `getTag` without fallbacks for buggy environments. * * @private * @param {*} value The value to query. * @returns {string} Returns the `toStringTag`. */ function baseGetTag(value) { if (value == null) { return value === undefined ? undefinedTag : nullTag; } return (symToStringTag && symToStringTag in Object(value)) ? getRawTag(value) : objectToString(value); } /** * The base implementation of `_.gt` which doesn't coerce arguments. * * @private * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if `value` is greater than `other`, * else `false`. */ function baseGt(value, other) { return value > other; } /** * The base implementation of `_.has` without support for deep paths. * * @private * @param {Object} [object] The object to query. * @param {Array|string} key The key to check. * @returns {boolean} Returns `true` if `key` exists, else `false`. */ function baseHas(object, key) { return object != null && hasOwnProperty.call(object, key); } /** * The base implementation of `_.hasIn` without support for deep paths. * * @private * @param {Object} [object] The object to query. * @param {Array|string} key The key to check. * @returns {boolean} Returns `true` if `key` exists, else `false`. */ function baseHasIn(object, key) { return object != null && key in Object(object); } /** * The base implementation of `_.inRange` which doesn't coerce arguments. * * @private * @param {number} number The number to check. * @param {number} start The start of the range. * @param {number} end The end of the range. * @returns {boolean} Returns `true` if `number` is in the range, else `false`. */ function baseInRange(number, start, end) { return number >= nativeMin(start, end) && number < nativeMax(start, end); } /** * The base implementation of methods like `_.intersection`, without support * for iteratee shorthands, that accepts an array of arrays to inspect. * * @private * @param {Array} arrays The arrays to inspect. * @param {Function} [iteratee] The iteratee invoked per element. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of shared values. */ function baseIntersection(arrays, iteratee, comparator) { var includes = comparator ? arrayIncludesWith : arrayIncludes, length = arrays[0].length, othLength = arrays.length, othIndex = othLength, caches = Array(othLength), maxLength = Infinity, result = []; while (othIndex--) { var array = arrays[othIndex]; if (othIndex && iteratee) { array = arrayMap(array, baseUnary(iteratee)); } maxLength = nativeMin(array.length, maxLength); caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) ? new SetCache(othIndex && array) : undefined; } array = arrays[0]; var index = -1, seen = caches[0]; outer: while (++index < length && result.length < maxLength) { var value = array[index], computed = iteratee ? iteratee(value) : value; value = (comparator || value !== 0) ? value : 0; if (!(seen ? cacheHas(seen, computed) : includes(result, computed, comparator) )) { othIndex = othLength; while (--othIndex) { var cache = caches[othIndex]; if (!(cache ? cacheHas(cache, computed) : includes(arrays[othIndex], computed, comparator)) ) { continue outer; } } if (seen) { seen.push(computed); } result.push(value); } } return result; } /** * The base implementation of `_.invert` and `_.invertBy` which inverts * `object` with values transformed by `iteratee` and set by `setter`. * * @private * @param {Object} object The object to iterate over. * @param {Function} setter The function to set `accumulator` values. * @param {Function} iteratee The iteratee to transform values. * @param {Object} accumulator The initial inverted object. * @returns {Function} Returns `accumulator`. */ function baseInverter(object, setter, iteratee, accumulator) { baseForOwn(object, function(value, key, object) { setter(accumulator, iteratee(value), key, object); }); return accumulator; } /** * The base implementation of `_.invoke` without support for individual * method arguments. * * @private * @param {Object} object The object to query. * @param {Array|string} path The path of the method to invoke. * @param {Array} args The arguments to invoke the method with. * @returns {*} Returns the result of the invoked method. */ function baseInvoke(object, path, args) { path = castPath(path, object); object = parent(object, path); var func = object == null ? object : object[toKey(last(path))]; return func == null ? undefined : apply(func, object, args); } /** * The base implementation of `_.isArguments`. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an `arguments` object, */ function baseIsArguments(value) { return isObjectLike(value) && baseGetTag(value) == argsTag; } /** * The base implementation of `_.isArrayBuffer` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. */ function baseIsArrayBuffer(value) { return isObjectLike(value) && baseGetTag(value) == arrayBufferTag; } /** * The base implementation of `_.isDate` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a date object, else `false`. */ function baseIsDate(value) { return isObjectLike(value) && baseGetTag(value) == dateTag; } /** * The base implementation of `_.isEqual` which supports partial comparisons * and tracks traversed objects. * * @private * @param {*} value The value to compare. * @param {*} other The other value to compare. * @param {boolean} bitmask The bitmask flags. * 1 - Unordered comparison * 2 - Partial comparison * @param {Function} [customizer] The function to customize comparisons. * @param {Object} [stack] Tracks traversed `value` and `other` objects. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. */ function baseIsEqual(value, other, bitmask, customizer, stack) { if (value === other) { return true; } if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { return value !== value && other !== other; } return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); } /** * A specialized version of `baseIsEqual` for arrays and objects which performs * deep comparisons and tracks traversed objects enabling objects with circular * references to be compared. * * @private * @param {Object} object The object to compare. * @param {Object} other The other object to compare. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. * @param {Function} customizer The function to customize comparisons. * @param {Function} equalFunc The function to determine equivalents of values. * @param {Object} [stack] Tracks traversed `object` and `other` objects. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { var objIsArr = isArray(object), othIsArr = isArray(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other); objTag = objTag == argsTag ? objectTag : objTag; othTag = othTag == argsTag ? objectTag : othTag; var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag; if (isSameTag && isBuffer(object)) { if (!isBuffer(other)) { return false; } objIsArr = true; objIsObj = false; } if (isSameTag && !objIsObj) { stack || (stack = new Stack); return (objIsArr || isTypedArray(object)) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); } if (!(bitmask & COMPARE_PARTIAL_FLAG)) { var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); if (objIsWrapped || othIsWrapped) { var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other; stack || (stack = new Stack); return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); } } if (!isSameTag) { return false; } stack || (stack = new Stack); return equalObjects(object, other, bitmask, customizer, equalFunc, stack); } /** * The base implementation of `_.isMap` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a map, else `false`. */ function baseIsMap(value) { return isObjectLike(value) && getTag(value) == mapTag; } /** * The base implementation of `_.isMatch` without support for iteratee shorthands. * * @private * @param {Object} object The object to inspect. * @param {Object} source The object of property values to match. * @param {Array} matchData The property names, values, and compare flags to match. * @param {Function} [customizer] The function to customize comparisons. * @returns {boolean} Returns `true` if `object` is a match, else `false`. */ function baseIsMatch(object, source, matchData, customizer) { var index = matchData.length, length = index, noCustomizer = !customizer; if (object == null) { return !length; } object = Object(object); while (index--) { var data = matchData[index]; if ((noCustomizer && data[2]) ? data[1] !== object[data[0]] : !(data[0] in object) ) { return false; } } while (++index < length) { data = matchData[index]; var key = data[0], objValue = object[key], srcValue = data[1]; if (noCustomizer && data[2]) { if (objValue === undefined && !(key in object)) { return false; } } else { var stack = new Stack; if (customizer) { var result = customizer(objValue, srcValue, key, object, source, stack); } if (!(result === undefined ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) : result )) { return false; } } } return true; } /** * The base implementation of `_.isNative` without bad shim checks. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a native function, * else `false`. */ function baseIsNative(value) { if (!isObject(value) || isMasked(value)) { return false; } var pattern = isFunction(value) ? reIsNative : reIsHostCtor; return pattern.test(toSource(value)); } /** * The base implementation of `_.isRegExp` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. */ function baseIsRegExp(value) { return isObjectLike(value) && baseGetTag(value) == regexpTag; } /** * The base implementation of `_.isSet` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a set, else `false`. */ function baseIsSet(value) { return isObjectLike(value) && getTag(value) == setTag; } /** * The base implementation of `_.isTypedArray` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. */ function baseIsTypedArray(value) { return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; } /** * The base implementation of `_.iteratee`. * * @private * @param {*} [value=_.identity] The value to convert to an iteratee. * @returns {Function} Returns the iteratee. */ function baseIteratee(value) { // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. if (typeof value == 'function') { return value; } if (value == null) { return identity; } if (typeof value == 'object') { return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value); } return property(value); } /** * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ function baseKeys(object) { if (!isPrototype(object)) { return nativeKeys(object); } var result = []; for (var key in Object(object)) { if (hasOwnProperty.call(object, key) && key != 'constructor') { result.push(key); } } return result; } /** * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ function baseKeysIn(object) { if (!isObject(object)) { return nativeKeysIn(object); } var isProto = isPrototype(object), result = []; for (var key in object) { if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { result.push(key); } } return result; } /** * The base implementation of `_.lt` which doesn't coerce arguments. * * @private * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if `value` is less than `other`, * else `false`. */ function baseLt(value, other) { return value < other; } /** * The base implementation of `_.map` without support for iteratee shorthands. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the new mapped array. */ function baseMap(collection, iteratee) { var index = -1, result = isArrayLike(collection) ? Array(collection.length) : []; baseEach(collection, function(value, key, collection) { result[++index] = iteratee(value, key, collection); }); return result; } /** * The base implementation of `_.matches` which doesn't clone `source`. * * @private * @param {Object} source The object of property values to match. * @returns {Function} Returns the new spec function. */ function baseMatches(source) { var matchData = getMatchData(source); if (matchData.length == 1 && matchData[0][2]) { return matchesStrictComparable(matchData[0][0], matchData[0][1]); } return function(object) { return object === source || baseIsMatch(object, source, matchData); }; } /** * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. * * @private * @param {string} path The path of the property to get. * @param {*} srcValue The value to match. * @returns {Function} Returns the new spec function. */ function baseMatchesProperty(path, srcValue) { if (isKey(path) && isStrictComparable(srcValue)) { return matchesStrictComparable(toKey(path), srcValue); } return function(object) { var objValue = get(object, path); return (objValue === undefined && objValue === srcValue) ? hasIn(object, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); }; } /** * The base implementation of `_.merge` without support for multiple sources. * * @private * @param {Object} object The destination object. * @param {Object} source The source object. * @param {number} srcIndex The index of `source`. * @param {Function} [customizer] The function to customize merged values. * @param {Object} [stack] Tracks traversed source values and their merged * counterparts. */ function baseMerge(object, source, srcIndex, customizer, stack) { if (object === source) { return; } baseFor(source, function(srcValue, key) { stack || (stack = new Stack); if (isObject(srcValue)) { baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); } else { var newValue = customizer ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) : undefined; if (newValue === undefined) { newValue = srcValue; } assignMergeValue(object, key, newValue); } }, keysIn); } /** * A specialized version of `baseMerge` for arrays and objects which performs * deep merges and tracks traversed objects enabling objects with circular * references to be merged. * * @private * @param {Object} object The destination object. * @param {Object} source The source object. * @param {string} key The key of the value to merge. * @param {number} srcIndex The index of `source`. * @param {Function} mergeFunc The function to merge values. * @param {Function} [customizer] The function to customize assigned values. * @param {Object} [stack] Tracks traversed source values and their merged * counterparts. */ function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { var objValue = safeGet(object, key), srcValue = safeGet(source, key), stacked = stack.get(srcValue); if (stacked) { assignMergeValue(object, key, stacked); return; } var newValue = customizer ? customizer(objValue, srcValue, (key + ''), object, source, stack) : undefined; var isCommon = newValue === undefined; if (isCommon) { var isArr = isArray(srcValue), isBuff = !isArr && isBuffer(srcValue), isTyped = !isArr && !isBuff && isTypedArray(srcValue); newValue = srcValue; if (isArr || isBuff || isTyped) { if (isArray(objValue)) { newValue = objValue; } else if (isArrayLikeObject(objValue)) { newValue = copyArray(objValue); } else if (isBuff) { isCommon = false; newValue = cloneBuffer(srcValue, true); } else if (isTyped) { isCommon = false; newValue = cloneTypedArray(srcValue, true); } else { newValue = []; } } else if (isPlainObject(srcValue) || isArguments(srcValue)) { newValue = objValue; if (isArguments(objValue)) { newValue = toPlainObject(objValue); } else if (!isObject(objValue) || isFunction(objValue)) { newValue = initCloneObject(srcValue); } } else { isCommon = false; } } if (isCommon) { // Recursively merge objects and arrays (susceptible to call stack limits). stack.set(srcValue, newValue); mergeFunc(newValue, srcValue, srcIndex, customizer, stack); stack['delete'](srcValue); } assignMergeValue(object, key, newValue); } /** * The base implementation of `_.nth` which doesn't coerce arguments. * * @private * @param {Array} array The array to query. * @param {number} n The index of the element to return. * @returns {*} Returns the nth element of `array`. */ function baseNth(array, n) { var length = array.length; if (!length) { return; } n += n < 0 ? length : 0; return isIndex(n, length) ? array[n] : undefined; } /** * The base implementation of `_.orderBy` without param guards. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. * @param {string[]} orders The sort orders of `iteratees`. * @returns {Array} Returns the new sorted array. */ function baseOrderBy(collection, iteratees, orders) { if (iteratees.length) { iteratees = arrayMap(iteratees, function(iteratee) { if (isArray(iteratee)) { return function(value) { return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee); }; } return iteratee; }); } else { iteratees = [identity]; } var index = -1; iteratees = arrayMap(iteratees, baseUnary(getIteratee())); var result = baseMap(collection, function(value, key, collection) { var criteria = arrayMap(iteratees, function(iteratee) { return iteratee(value); }); return { 'criteria': criteria, 'index': ++index, 'value': value }; }); return baseSortBy(result, function(object, other) { return compareMultiple(object, other, orders); }); } /** * The base implementation of `_.pick` without support for individual * property identifiers. * * @private * @param {Object} object The source object. * @param {string[]} paths The property paths to pick. * @returns {Object} Returns the new object. */ function basePick(object, paths) { return basePickBy(object, paths, function(value, path) { return hasIn(object, path); }); } /** * The base implementation of `_.pickBy` without support for iteratee shorthands. * * @private * @param {Object} object The source object. * @param {string[]} paths The property paths to pick. * @param {Function} predicate The function invoked per property. * @returns {Object} Returns the new object. */ function basePickBy(object, paths, predicate) { var index = -1, length = paths.length, result = {}; while (++index < length) { var path = paths[index], value = baseGet(object, path); if (predicate(value, path)) { baseSet(result, castPath(path, object), value); } } return result; } /** * A specialized version of `baseProperty` which supports deep paths. * * @private * @param {Array|string} path The path of the property to get. * @returns {Function} Returns the new accessor function. */ function basePropertyDeep(path) { return function(object) { return baseGet(object, path); }; } /** * The base implementation of `_.pullAllBy` without support for iteratee * shorthands. * * @private * @param {Array} array The array to modify. * @param {Array} values The values to remove. * @param {Function} [iteratee] The iteratee invoked per element. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns `array`. */ function basePullAll(array, values, iteratee, comparator) { var indexOf = comparator ? baseIndexOfWith : baseIndexOf, index = -1, length = values.length, seen = array; if (array === values) { values = copyArray(values); } if (iteratee) { seen = arrayMap(array, baseUnary(iteratee)); } while (++index < length) { var fromIndex = 0, value = values[index], computed = iteratee ? iteratee(value) : value; while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) { if (seen !== array) { splice.call(seen, fromIndex, 1); } splice.call(array, fromIndex, 1); } } return array; } /** * The base implementation of `_.pullAt` without support for individual * indexes or capturing the removed elements. * * @private * @param {Array} array The array to modify. * @param {number[]} indexes The indexes of elements to remove. * @returns {Array} Returns `array`. */ function basePullAt(array, indexes) { var length = array ? indexes.length : 0, lastIndex = length - 1; while (length--) { var index = indexes[length]; if (length == lastIndex || index !== previous) { var previous = index; if (isIndex(index)) { splice.call(array, index, 1); } else { baseUnset(array, index); } } } return array; } /** * The base implementation of `_.random` without support for returning * floating-point numbers. * * @private * @param {number} lower The lower bound. * @param {number} upper The upper bound. * @returns {number} Returns the random number. */ function baseRandom(lower, upper) { return lower + nativeFloor(nativeRandom() * (upper - lower + 1)); } /** * The base implementation of `_.range` and `_.rangeRight` which doesn't * coerce arguments. * * @private * @param {number} start The start of the range. * @param {number} end The end of the range. * @param {number} step The value to increment or decrement by. * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Array} Returns the range of numbers. */ function baseRange(start, end, step, fromRight) { var index = -1, length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), result = Array(length); while (length--) { result[fromRight ? length : ++index] = start; start += step; } return result; } /** * The base implementation of `_.repeat` which doesn't coerce arguments. * * @private * @param {string} string The string to repeat. * @param {number} n The number of times to repeat the string. * @returns {string} Returns the repeated string. */ function baseRepeat(string, n) { var result = ''; if (!string || n < 1 || n > MAX_SAFE_INTEGER) { return result; } // Leverage the exponentiation by squaring algorithm for a faster repeat. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. do { if (n % 2) { result += string; } n = nativeFloor(n / 2); if (n) { string += string; } } while (n); return result; } /** * The base implementation of `_.rest` which doesn't validate or coerce arguments. * * @private * @param {Function} func The function to apply a rest parameter to. * @param {number} [start=func.length-1] The start position of the rest parameter. * @returns {Function} Returns the new function. */ function baseRest(func, start) { return setToString(overRest(func, start, identity), func + ''); } /** * The base implementation of `_.sample`. * * @private * @param {Array|Object} collection The collection to sample. * @returns {*} Returns the random element. */ function baseSample(collection) { return arraySample(values(collection)); } /** * The base implementation of `_.sampleSize` without param guards. * * @private * @param {Array|Object} collection The collection to sample. * @param {number} n The number of elements to sample. * @returns {Array} Returns the random elements. */ function baseSampleSize(collection, n) { var array = values(collection); return shuffleSelf(array, baseClamp(n, 0, array.length)); } /** * The base implementation of `_.set`. * * @private * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to set. * @param {*} value The value to set. * @param {Function} [customizer] The function to customize path creation. * @returns {Object} Returns `object`. */ function baseSet(object, path, value, customizer) { if (!isObject(object)) { return object; } path = castPath(path, object); var index = -1, length = path.length, lastIndex = length - 1, nested = object; while (nested != null && ++index < length) { var key = toKey(path[index]), newValue = value; if (key === '__proto__' || key === 'constructor' || key === 'prototype') { return object; } if (index != lastIndex) { var objValue = nested[key]; newValue = customizer ? customizer(objValue, key, nested) : undefined; if (newValue === undefined) { newValue = isObject(objValue) ? objValue : (isIndex(path[index + 1]) ? [] : {}); } } assignValue(nested, key, newValue); nested = nested[key]; } return object; } /** * The base implementation of `setData` without support for hot loop shorting. * * @private * @param {Function} func The function to associate metadata with. * @param {*} data The metadata. * @returns {Function} Returns `func`. */ var baseSetData = !metaMap ? identity : function(func, data) { metaMap.set(func, data); return func; }; /** * The base implementation of `setToString` without support for hot loop shorting. * * @private * @param {Function} func The function to modify. * @param {Function} string The `toString` result. * @returns {Function} Returns `func`. */ var baseSetToString = !defineProperty ? identity : function(func, string) { return defineProperty(func, 'toString', { 'configurable': true, 'enumerable': false, 'value': constant(string), 'writable': true }); }; /** * The base implementation of `_.shuffle`. * * @private * @param {Array|Object} collection The collection to shuffle. * @returns {Array} Returns the new shuffled array. */ function baseShuffle(collection) { return shuffleSelf(values(collection)); } /** * The base implementation of `_.slice` without an iteratee call guard. * * @private * @param {Array} array The array to slice. * @param {number} [start=0] The start position. * @param {number} [end=array.length] The end position. * @returns {Array} Returns the slice of `array`. */ function baseSlice(array, start, end) { var index = -1, length = array.length; if (start < 0) { start = -start > length ? 0 : (length + start); } end = end > length ? length : end; if (end < 0) { end += length; } length = start > end ? 0 : ((end - start) >>> 0); start >>>= 0; var result = Array(length); while (++index < length) { result[index] = array[index + start]; } return result; } /** * The base implementation of `_.some` without support for iteratee shorthands. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {boolean} Returns `true` if any element passes the predicate check, * else `false`. */ function baseSome(collection, predicate) { var result; baseEach(collection, function(value, index, collection) { result = predicate(value, index, collection); return !result; }); return !!result; } /** * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which * performs a binary search of `array` to determine the index at which `value` * should be inserted into `array` in order to maintain its sort order. * * @private * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. * @param {boolean} [retHighest] Specify returning the highest qualified index. * @returns {number} Returns the index at which `value` should be inserted * into `array`. */ function baseSortedIndex(array, value, retHighest) { var low = 0, high = array == null ? low : array.length; if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { while (low < high) { var mid = (low + high) >>> 1, computed = array[mid]; if (computed !== null && !isSymbol(computed) && (retHighest ? (computed <= value) : (computed < value))) { low = mid + 1; } else { high = mid; } } return high; } return baseSortedIndexBy(array, value, identity, retHighest); } /** * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy` * which invokes `iteratee` for `value` and each element of `array` to compute * their sort ranking. The iteratee is invoked with one argument; (value). * * @private * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. * @param {Function} iteratee The iteratee invoked per element. * @param {boolean} [retHighest] Specify returning the highest qualified index. * @returns {number} Returns the index at which `value` should be inserted * into `array`. */ function baseSortedIndexBy(array, value, iteratee, retHighest) { var low = 0, high = array == null ? 0 : array.length; if (high === 0) { return 0; } value = iteratee(value); var valIsNaN = value !== value, valIsNull = value === null, valIsSymbol = isSymbol(value), valIsUndefined = value === undefined; while (low < high) { var mid = nativeFloor((low + high) / 2), computed = iteratee(array[mid]), othIsDefined = computed !== undefined, othIsNull = computed === null, othIsReflexive = computed === computed, othIsSymbol = isSymbol(computed); if (valIsNaN) { var setLow = retHighest || othIsReflexive; } else if (valIsUndefined) { setLow = othIsReflexive && (retHighest || othIsDefined); } else if (valIsNull) { setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull); } else if (valIsSymbol) { setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol); } else if (othIsNull || othIsSymbol) { setLow = false; } else { setLow = retHighest ? (computed <= value) : (computed < value); } if (setLow) { low = mid + 1; } else { high = mid; } } return nativeMin(high, MAX_ARRAY_INDEX); } /** * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without * support for iteratee shorthands. * * @private * @param {Array} array The array to inspect. * @param {Function} [iteratee] The iteratee invoked per element. * @returns {Array} Returns the new duplicate free array. */ function baseSortedUniq(array, iteratee) { var index = -1, length = array.length, resIndex = 0, result = []; while (++index < length) { var value = array[index], computed = iteratee ? iteratee(value) : value; if (!index || !eq(computed, seen)) { var seen = computed; result[resIndex++] = value === 0 ? 0 : value; } } return result; } /** * The base implementation of `_.toNumber` which doesn't ensure correct * conversions of binary, hexadecimal, or octal string values. * * @private * @param {*} value The value to process. * @returns {number} Returns the number. */ function baseToNumber(value) { if (typeof value == 'number') { return value; } if (isSymbol(value)) { return NAN; } return +value; } /** * The base implementation of `_.toString` which doesn't convert nullish * values to empty strings. * * @private * @param {*} value The value to process. * @returns {string} Returns the string. */ function baseToString(value) { // Exit early for strings to avoid a performance hit in some environments. if (typeof value == 'string') { return value; } if (isArray(value)) { // Recursively convert values (susceptible to call stack limits). return arrayMap(value, baseToString) + ''; } if (isSymbol(value)) { return symbolToString ? symbolToString.call(value) : ''; } var result = (value + ''); return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; } /** * The base implementation of `_.uniqBy` without support for iteratee shorthands. * * @private * @param {Array} array The array to inspect. * @param {Function} [iteratee] The iteratee invoked per element. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new duplicate free array. */ function baseUniq(array, iteratee, comparator) { var index = -1, includes = arrayIncludes, length = array.length, isCommon = true, result = [], seen = result; if (comparator) { isCommon = false; includes = arrayIncludesWith; } else if (length >= LARGE_ARRAY_SIZE) { var set = iteratee ? null : createSet(array); if (set) { return setToArray(set); } isCommon = false; includes = cacheHas; seen = new SetCache; } else { seen = iteratee ? [] : result; } outer: while (++index < length) { var value = array[index], computed = iteratee ? iteratee(value) : value; value = (comparator || value !== 0) ? value : 0; if (isCommon && computed === computed) { var seenIndex = seen.length; while (seenIndex--) { if (seen[seenIndex] === computed) { continue outer; } } if (iteratee) { seen.push(computed); } result.push(value); } else if (!includes(seen, computed, comparator)) { if (seen !== result) { seen.push(computed); } result.push(value); } } return result; } /** * The base implementation of `_.unset`. * * @private * @param {Object} object The object to modify. * @param {Array|string} path The property path to unset. * @returns {boolean} Returns `true` if the property is deleted, else `false`. */ function baseUnset(object, path) { path = castPath(path, object); // Prevent prototype pollution: // https://github.com/lodash/lodash/security/advisories/GHSA-xxjr-mmjv-4gpg // https://github.com/lodash/lodash/security/advisories/GHSA-f23m-r3pf-42rh var index = -1, length = path.length; if (!length) { return true; } while (++index < length) { var key = toKey(path[index]); // Always block "__proto__" anywhere in the path if it's not expected if (key === '__proto__' && !hasOwnProperty.call(object, '__proto__')) { return false; } // Block constructor/prototype as non-terminal traversal keys to prevent // escaping the object graph into built-in constructors and prototypes. if ((key === 'constructor' || key === 'prototype') && index < length - 1) { return false; } } var obj = parent(object, path); return obj == null || delete obj[toKey(last(path))]; } /** * The base implementation of `_.update`. * * @private * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to update. * @param {Function} updater The function to produce the updated value. * @param {Function} [customizer] The function to customize path creation. * @returns {Object} Returns `object`. */ function baseUpdate(object, path, updater, customizer) { return baseSet(object, path, updater(baseGet(object, path)), customizer); } /** * The base implementation of methods like `_.dropWhile` and `_.takeWhile` * without support for iteratee shorthands. * * @private * @param {Array} array The array to query. * @param {Function} predicate The function invoked per iteration. * @param {boolean} [isDrop] Specify dropping elements instead of taking them. * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Array} Returns the slice of `array`. */ function baseWhile(array, predicate, isDrop, fromRight) { var length = array.length, index = fromRight ? length : -1; while ((fromRight ? index-- : ++index < length) && predicate(array[index], index, array)) {} return isDrop ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index)); } /** * The base implementation of `wrapperValue` which returns the result of * performing a sequence of actions on the unwrapped `value`, where each * successive action is supplied the return value of the previous. * * @private * @param {*} value The unwrapped value. * @param {Array} actions Actions to perform to resolve the unwrapped value. * @returns {*} Returns the resolved value. */ function baseWrapperValue(value, actions) { var result = value; if (result instanceof LazyWrapper) { result = result.value(); } return arrayReduce(actions, function(result, action) { return action.func.apply(action.thisArg, arrayPush([result], action.args)); }, result); } /** * The base implementation of methods like `_.xor`, without support for * iteratee shorthands, that accepts an array of arrays to inspect. * * @private * @param {Array} arrays The arrays to inspect. * @param {Function} [iteratee] The iteratee invoked per element. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of values. */ function baseXor(arrays, iteratee, comparator) { var length = arrays.length; if (length < 2) { return length ? baseUniq(arrays[0]) : []; } var index = -1, result = Array(length); while (++index < length) { var array = arrays[index], othIndex = -1; while (++othIndex < length) { if (othIndex != index) { result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator); } } } return baseUniq(baseFlatten(result, 1), iteratee, comparator); } /** * This base implementation of `_.zipObject` which assigns values using `assignFunc`. * * @private * @param {Array} props The property identifiers. * @param {Array} values The property values. * @param {Function} assignFunc The function to assign values. * @returns {Object} Returns the new object. */ function baseZipObject(props, values, assignFunc) { var index = -1, length = props.length, valsLength = values.length, result = {}; while (++index < length) { var value = index < valsLength ? values[index] : undefined; assignFunc(result, props[index], value); } return result; } /** * Casts `value` to an empty array if it's not an array like object. * * @private * @param {*} value The value to inspect. * @returns {Array|Object} Returns the cast array-like object. */ function castArrayLikeObject(value) { return isArrayLikeObject(value) ? value : []; } /** * Casts `value` to `identity` if it's not a function. * * @private * @param {*} value The value to inspect. * @returns {Function} Returns cast function. */ function castFunction(value) { return typeof value == 'function' ? value : identity; } /** * Casts `value` to a path array if it's not one. * * @private * @param {*} value The value to inspect. * @param {Object} [object] The object to query keys on. * @returns {Array} Returns the cast property path array. */ function castPath(value, object) { if (isArray(value)) { return value; } return isKey(value, object) ? [value] : stringToPath(toString(value)); } /** * A `baseRest` alias which can be replaced with `identity` by module * replacement plugins. * * @private * @type {Function} * @param {Function} func The function to apply a rest parameter to. * @returns {Function} Returns the new function. */ var castRest = baseRest; /** * Casts `array` to a slice if it's needed. * * @private * @param {Array} array The array to inspect. * @param {number} start The start position. * @param {number} [end=array.length] The end position. * @returns {Array} Returns the cast slice. */ function castSlice(array, start, end) { var length = array.length; end = end === undefined ? length : end; return (!start && end >= length) ? array : baseSlice(array, start, end); } /** * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout). * * @private * @param {number|Object} id The timer id or timeout object of the timer to clear. */ var clearTimeout = ctxClearTimeout || function(id) { return root.clearTimeout(id); }; /** * Creates a clone of `buffer`. * * @private * @param {Buffer} buffer The buffer to clone. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Buffer} Returns the cloned buffer. */ function cloneBuffer(buffer, isDeep) { if (isDeep) { return buffer.slice(); } var length = buffer.length, result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); buffer.copy(result); return result; } /** * Creates a clone of `arrayBuffer`. * * @private * @param {ArrayBuffer} arrayBuffer The array buffer to clone. * @returns {ArrayBuffer} Returns the cloned array buffer. */ function cloneArrayBuffer(arrayBuffer) { var result = new arrayBuffer.constructor(arrayBuffer.byteLength); new Uint8Array(result).set(new Uint8Array(arrayBuffer)); return result; } /** * Creates a clone of `dataView`. * * @private * @param {Object} dataView The data view to clone. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Object} Returns the cloned data view. */ function cloneDataView(dataView, isDeep) { var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); } /** * Creates a clone of `regexp`. * * @private * @param {Object} regexp The regexp to clone. * @returns {Object} Returns the cloned regexp. */ function cloneRegExp(regexp) { var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); result.lastIndex = regexp.lastIndex; return result; } /** * Creates a clone of the `symbol` object. * * @private * @param {Object} symbol The symbol object to clone. * @returns {Object} Returns the cloned symbol object. */ function cloneSymbol(symbol) { return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; } /** * Creates a clone of `typedArray`. * * @private * @param {Object} typedArray The typed array to clone. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Object} Returns the cloned typed array. */ function cloneTypedArray(typedArray, isDeep) { var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); } /** * Compares values to sort them in ascending order. * * @private * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {number} Returns the sort order indicator for `value`. */ function compareAscending(value, other) { if (value !== other) { var valIsDefined = value !== undefined, valIsNull = value === null, valIsReflexive = value === value, valIsSymbol = isSymbol(value); var othIsDefined = other !== undefined, othIsNull = other === null, othIsReflexive = other === other, othIsSymbol = isSymbol(other); if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || (valIsNull && othIsDefined && othIsReflexive) || (!valIsDefined && othIsReflexive) || !valIsReflexive) { return 1; } if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || (othIsNull && valIsDefined && valIsReflexive) || (!othIsDefined && valIsReflexive) || !othIsReflexive) { return -1; } } return 0; } /** * Used by `_.orderBy` to compare multiple properties of a value to another * and stable sort them. * * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, * specify an order of "desc" for descending or "asc" for ascending sort order * of corresponding values. * * @private * @param {Object} object The object to compare. * @param {Object} other The other object to compare. * @param {boolean[]|string[]} orders The order to sort by for each property. * @returns {number} Returns the sort order indicator for `object`. */ function compareMultiple(object, other, orders) { var index = -1, objCriteria = object.criteria, othCriteria = other.criteria, length = objCriteria.length, ordersLength = orders.length; while (++index < length) { var result = compareAscending(objCriteria[index], othCriteria[index]); if (result) { if (index >= ordersLength) { return result; } var order = orders[index]; return result * (order == 'desc' ? -1 : 1); } } // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications // that causes it, under certain circumstances, to provide the same value for // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 // for more details. // // This also ensures a stable sort in V8 and other engines. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. return object.index - other.index; } /** * Creates an array that is the composition of partially applied arguments, * placeholders, and provided arguments into a single array of arguments. * * @private * @param {Array} args The provided arguments. * @param {Array} partials The arguments to prepend to those provided. * @param {Array} holders The `partials` placeholder indexes. * @params {boolean} [isCurried] Specify composing for a curried function. * @returns {Array} Returns the new array of composed arguments. */ function composeArgs(args, partials, holders, isCurried) { var argsIndex = -1, argsLength = args.length, holdersLength = holders.length, leftIndex = -1, leftLength = partials.length, rangeLength = nativeMax(argsLength - holdersLength, 0), result = Array(leftLength + rangeLength), isUncurried = !isCurried; while (++leftIndex < leftLength) { result[leftIndex] = partials[leftIndex]; } while (++argsIndex < holdersLength) { if (isUncurried || argsIndex < argsLength) { result[holders[argsIndex]] = args[argsIndex]; } } while (rangeLength--) { result[leftIndex++] = args[argsIndex++]; } return result; } /** * This function is like `composeArgs` except that the arguments composition * is tailored for `_.partialRight`. * * @private * @param {Array} args The provided arguments. * @param {Array} partials The arguments to append to those provided. * @param {Array} holders The `partials` placeholder indexes. * @params {boolean} [isCurried] Specify composing for a curried function. * @returns {Array} Returns the new array of composed arguments. */ function composeArgsRight(args, partials, holders, isCurried) { var argsIndex = -1, argsLength = args.length, holdersIndex = -1, holdersLength = holders.length, rightIndex = -1, rightLength = partials.length, rangeLength = nativeMax(argsLength - holdersLength, 0), result = Array(rangeLength + rightLength), isUncurried = !isCurried; while (++argsIndex < rangeLength) { result[argsIndex] = args[argsIndex]; } var offset = argsIndex; while (++rightIndex < rightLength) { result[offset + rightIndex] = partials[rightIndex]; } while (++holdersIndex < holdersLength) { if (isUncurried || argsIndex < argsLength) { result[offset + holders[holdersIndex]] = args[argsIndex++]; } } return result; } /** * Copies the values of `source` to `array`. * * @private * @param {Array} source The array to copy values from. * @param {Array} [array=[]] The array to copy values to. * @returns {Array} Returns `array`. */ function copyArray(source, array) { var index = -1, length = source.length; array || (array = Array(length)); while (++index < length) { array[index] = source[index]; } return array; } /** * Copies properties of `source` to `object`. * * @private * @param {Object} source The object to copy properties from. * @param {Array} props The property identifiers to copy. * @param {Object} [object={}] The object to copy properties to. * @param {Function} [customizer] The function to customize copied values. * @returns {Object} Returns `object`. */ function copyObject(source, props, object, customizer) { var isNew = !object; object || (object = {}); var index = -1, length = props.length; while (++index < length) { var key = props[index]; var newValue = customizer ? customizer(object[key], source[key], key, object, source) : undefined; if (newValue === undefined) { newValue = source[key]; } if (isNew) { baseAssignValue(object, key, newValue); } else { assignValue(object, key, newValue); } } return object; } /** * Copies own symbols of `source` to `object`. * * @private * @param {Object} source The object to copy symbols from. * @param {Object} [object={}] The object to copy symbols to. * @returns {Object} Returns `object`. */ function copySymbols(source, object) { return copyObject(source, getSymbols(source), object); } /** * Copies own and inherited symbols of `source` to `object`. * * @private * @param {Object} source The object to copy symbols from. * @param {Object} [object={}] The object to copy symbols to. * @returns {Object} Returns `object`. */ function copySymbolsIn(source, object) { return copyObject(source, getSymbolsIn(source), object); } /** * Creates a function like `_.groupBy`. * * @private * @param {Function} setter The function to set accumulator values. * @param {Function} [initializer] The accumulator object initializer. * @returns {Function} Returns the new aggregator function. */ function createAggregator(setter, initializer) { return function(collection, iteratee) { var func = isArray(collection) ? arrayAggregator : baseAggregator, accumulator = initializer ? initializer() : {}; return func(collection, setter, getIteratee(iteratee, 2), accumulator); }; } /** * Creates a function like `_.assign`. * * @private * @param {Function} assigner The function to assign values. * @returns {Function} Returns the new assigner function. */ function createAssigner(assigner) { return baseRest(function(object, sources) { var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : undefined, guard = length > 2 ? sources[2] : undefined; customizer = (assigner.length > 3 && typeof customizer == 'function') ? (length--, customizer) : undefined; if (guard && isIterateeCall(sources[0], sources[1], guard)) { customizer = length < 3 ? undefined : customizer; length = 1; } object = Object(object); while (++index < length) { var source = sources[index]; if (source) { assigner(object, source, index, customizer); } } return object; }); } /** * Creates a `baseEach` or `baseEachRight` function. * * @private * @param {Function} eachFunc The function to iterate over a collection. * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Function} Returns the new base function. */ function createBaseEach(eachFunc, fromRight) { return function(collection, iteratee) { if (collection == null) { return collection; } if (!isArrayLike(collection)) { return eachFunc(collection, iteratee); } var length = collection.length, index = fromRight ? length : -1, iterable = Object(collection); while ((fromRight ? index-- : ++index < length)) { if (iteratee(iterable[index], index, iterable) === false) { break; } } return collection; }; } /** * Creates a base function for methods like `_.forIn` and `_.forOwn`. * * @private * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Function} Returns the new base function. */ function createBaseFor(fromRight) { return function(object, iteratee, keysFunc) { var index = -1, iterable = Object(object), props = keysFunc(object), length = props.length; while (length--) { var key = props[fromRight ? length : ++index]; if (iteratee(iterable[key], key, iterable) === false) { break; } } return object; }; } /** * Creates a function that wraps `func` to invoke it with the optional `this` * binding of `thisArg`. * * @private * @param {Function} func The function to wrap. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {*} [thisArg] The `this` binding of `func`. * @returns {Function} Returns the new wrapped function. */ function createBind(func, bitmask, thisArg) { var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func); function wrapper() { var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; return fn.apply(isBind ? thisArg : this, arguments); } return wrapper; } /** * Creates a function like `_.lowerFirst`. * * @private * @param {string} methodName The name of the `String` case method to use. * @returns {Function} Returns the new case function. */ function createCaseFirst(methodName) { return function(string) { string = toString(string); var strSymbols = hasUnicode(string) ? stringToArray(string) : undefined; var chr = strSymbols ? strSymbols[0] : string.charAt(0); var trailing = strSymbols ? castSlice(strSymbols, 1).join('') : string.slice(1); return chr[methodName]() + trailing; }; } /** * Creates a function like `_.camelCase`. * * @private * @param {Function} callback The function to combine each word. * @returns {Function} Returns the new compounder function. */ function createCompounder(callback) { return function(string) { return arrayReduce(words(deburr(string).replace(reApos, '')), callback, ''); }; } /** * Creates a function that produces an instance of `Ctor` regardless of * whether it was invoked as part of a `new` expression or by `call` or `apply`. * * @private * @param {Function} Ctor The constructor to wrap. * @returns {Function} Returns the new wrapped function. */ function createCtor(Ctor) { return function() { // Use a `switch` statement to work with class constructors. See // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist // for more details. var args = arguments; switch (args.length) { case 0: return new Ctor; case 1: return new Ctor(args[0]); case 2: return new Ctor(args[0], args[1]); case 3: return new Ctor(args[0], args[1], args[2]); case 4: return new Ctor(args[0], args[1], args[2], args[3]); case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); } var thisBinding = baseCreate(Ctor.prototype), result = Ctor.apply(thisBinding, args); // Mimic the constructor's `return` behavior. // See https://es5.github.io/#x13.2.2 for more details. return isObject(result) ? result : thisBinding; }; } /** * Creates a function that wraps `func` to enable currying. * * @private * @param {Function} func The function to wrap. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {number} arity The arity of `func`. * @returns {Function} Returns the new wrapped function. */ function createCurry(func, bitmask, arity) { var Ctor = createCtor(func); function wrapper() { var length = arguments.length, args = Array(length), index = length, placeholder = getHolder(wrapper); while (index--) { args[index] = arguments[index]; } var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder) ? [] : replaceHolders(args, placeholder); length -= holders.length; if (length < arity) { return createRecurry( func, bitmask, createHybrid, wrapper.placeholder, undefined, args, holders, undefined, undefined, arity - length); } var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; return apply(fn, this, args); } return wrapper; } /** * Creates a `_.find` or `_.findLast` function. * * @private * @param {Function} findIndexFunc The function to find the collection index. * @returns {Function} Returns the new find function. */ function createFind(findIndexFunc) { return function(collection, predicate, fromIndex) { var iterable = Object(collection); if (!isArrayLike(collection)) { var iteratee = getIteratee(predicate, 3); collection = keys(collection); predicate = function(key) { return iteratee(iterable[key], key, iterable); }; } var index = findIndexFunc(collection, predicate, fromIndex); return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; }; } /** * Creates a `_.flow` or `_.flowRight` function. * * @private * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Function} Returns the new flow function. */ function createFlow(fromRight) { return flatRest(function(funcs) { var length = funcs.length, index = length, prereq = LodashWrapper.prototype.thru; if (fromRight) { funcs.reverse(); } while (index--) { var func = funcs[index]; if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } if (prereq && !wrapper && getFuncName(func) == 'wrapper') { var wrapper = new LodashWrapper([], true); } } index = wrapper ? index : length; while (++index < length) { func = funcs[index]; var funcName = getFuncName(func), data = funcName == 'wrapper' ? getData(func) : undefined; if (data && isLaziable(data[0]) && data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && !data[4].length && data[9] == 1 ) { wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); } else { wrapper = (func.length == 1 && isLaziable(func)) ? wrapper[funcName]() : wrapper.thru(func); } } return function() { var args = arguments, value = args[0]; if (wrapper && args.length == 1 && isArray(value)) { return wrapper.plant(value).value(); } var index = 0, result = length ? funcs[index].apply(this, args) : value; while (++index < length) { result = funcs[index].call(this, result); } return result; }; }); } /** * Creates a function that wraps `func` to invoke it with optional `this` * binding of `thisArg`, partial application, and currying. * * @private * @param {Function|string} func The function or method name to wrap. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {*} [thisArg] The `this` binding of `func`. * @param {Array} [partials] The arguments to prepend to those provided to * the new function. * @param {Array} [holders] The `partials` placeholder indexes. * @param {Array} [partialsRight] The arguments to append to those provided * to the new function. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. * @param {Array} [argPos] The argument positions of the new function. * @param {number} [ary] The arity cap of `func`. * @param {number} [arity] The arity of `func`. * @returns {Function} Returns the new wrapped function. */ function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { var isAry = bitmask & WRAP_ARY_FLAG, isBind = bitmask & WRAP_BIND_FLAG, isBindKey = bitmask & WRAP_BIND_KEY_FLAG, isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), isFlip = bitmask & WRAP_FLIP_FLAG, Ctor = isBindKey ? undefined : createCtor(func); function wrapper() { var length = arguments.length, args = Array(length), index = length; while (index--) { args[index] = arguments[index]; } if (isCurried) { var placeholder = getHolder(wrapper), holdersCount = countHolders(args, placeholder); } if (partials) { args = composeArgs(args, partials, holders, isCurried); } if (partialsRight) { args = composeArgsRight(args, partialsRight, holdersRight, isCurried); } length -= holdersCount; if (isCurried && length < arity) { var newHolders = replaceHolders(args, placeholder); return createRecurry( func, bitmask, createHybrid, wrapper.placeholder, thisArg, args, newHolders, argPos, ary, arity - length ); } var thisBinding = isBind ? thisArg : this, fn = isBindKey ? thisBinding[func] : func; length = args.length; if (argPos) { args = reorder(args, argPos); } else if (isFlip && length > 1) { args.reverse(); } if (isAry && ary < length) { args.length = ary; } if (this && this !== root && this instanceof wrapper) { fn = Ctor || createCtor(fn); } return fn.apply(thisBinding, args); } return wrapper; } /** * Creates a function like `_.invertBy`. * * @private * @param {Function} setter The function to set accumulator values. * @param {Function} toIteratee The function to resolve iteratees. * @returns {Function} Returns the new inverter function. */ function createInverter(setter, toIteratee) { return function(object, iteratee) { return baseInverter(object, setter, toIteratee(iteratee), {}); }; } /** * Creates a function that performs a mathematical operation on two values. * * @private * @param {Function} operator The function to perform the operation. * @param {number} [defaultValue] The value used for `undefined` arguments. * @returns {Function} Returns the new mathematical operation function. */ function createMathOperation(operator, defaultValue) { return function(value, other) { var result; if (value === undefined && other === undefined) { return defaultValue; } if (value !== undefined) { result = value; } if (other !== undefined) { if (result === undefined) { return other; } if (typeof value == 'string' || typeof other == 'string') { value = baseToString(value); other = baseToString(other); } else { value = baseToNumber(value); other = baseToNumber(other); } result = operator(value, other); } return result; }; } /** * Creates a function like `_.over`. * * @private * @param {Function} arrayFunc The function to iterate over iteratees. * @returns {Function} Returns the new over function. */ function createOver(arrayFunc) { return flatRest(function(iteratees) { iteratees = arrayMap(iteratees, baseUnary(getIteratee())); return baseRest(function(args) { var thisArg = this; return arrayFunc(iteratees, function(iteratee) { return apply(iteratee, thisArg, args); }); }); }); } /** * Creates the padding for `string` based on `length`. The `chars` string * is truncated if the number of characters exceeds `length`. * * @private * @param {number} length The padding length. * @param {string} [chars=' '] The string used as padding. * @returns {string} Returns the padding for `string`. */ function createPadding(length, chars) { chars = chars === undefined ? ' ' : baseToString(chars); var charsLength = chars.length; if (charsLength < 2) { return charsLength ? baseRepeat(chars, length) : chars; } var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); return hasUnicode(chars) ? castSlice(stringToArray(result), 0, length).join('') : result.slice(0, length); } /** * Creates a function that wraps `func` to invoke it with the `this` binding * of `thisArg` and `partials` prepended to the arguments it receives. * * @private * @param {Function} func The function to wrap. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {*} thisArg The `this` binding of `func`. * @param {Array} partials The arguments to prepend to those provided to * the new function. * @returns {Function} Returns the new wrapped function. */ function createPartial(func, bitmask, thisArg, partials) { var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func); function wrapper() { var argsIndex = -1, argsLength = arguments.length, leftIndex = -1, leftLength = partials.length, args = Array(leftLength + argsLength), fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; while (++leftIndex < leftLength) { args[leftIndex] = partials[leftIndex]; } while (argsLength--) { args[leftIndex++] = arguments[++argsIndex]; } return apply(fn, isBind ? thisArg : this, args); } return wrapper; } /** * Creates a `_.range` or `_.rangeRight` function. * * @private * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Function} Returns the new range function. */ function createRange(fromRight) { return function(start, end, step) { if (step && typeof step != 'number' && isIterateeCall(start, end, step)) { end = step = undefined; } // Ensure the sign of `-0` is preserved. start = toFinite(start); if (end === undefined) { end = start; start = 0; } else { end = toFinite(end); } step = step === undefined ? (start < end ? 1 : -1) : toFinite(step); return baseRange(start, end, step, fromRight); }; } /** * Creates a function that performs a relational operation on two values. * * @private * @param {Function} operator The function to perform the operation. * @returns {Function} Returns the new relational operation function. */ function createRelationalOperation(operator) { return function(value, other) { if (!(typeof value == 'string' && typeof other == 'string')) { value = toNumber(value); other = toNumber(other); } return operator(value, other); }; } /** * Creates a function that wraps `func` to continue currying. * * @private * @param {Function} func The function to wrap. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {Function} wrapFunc The function to create the `func` wrapper. * @param {*} placeholder The placeholder value. * @param {*} [thisArg] The `this` binding of `func`. * @param {Array} [partials] The arguments to prepend to those provided to * the new function. * @param {Array} [holders] The `partials` placeholder indexes. * @param {Array} [argPos] The argument positions of the new function. * @param {number} [ary] The arity cap of `func`. * @param {number} [arity] The arity of `func`. * @returns {Function} Returns the new wrapped function. */ function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { var isCurry = bitmask & WRAP_CURRY_FLAG, newHolders = isCurry ? holders : undefined, newHoldersRight = isCurry ? undefined : holders, newPartials = isCurry ? partials : undefined, newPartialsRight = isCurry ? undefined : partials; bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG); bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG); if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) { bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG); } var newData = [ func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, newHoldersRight, argPos, ary, arity ]; var result = wrapFunc.apply(undefined, newData); if (isLaziable(func)) { setData(result, newData); } result.placeholder = placeholder; return setWrapToString(result, func, bitmask); } /** * Creates a function like `_.round`. * * @private * @param {string} methodName The name of the `Math` method to use when rounding. * @returns {Function} Returns the new round function. */ function createRound(methodName) { var func = Math[methodName]; return function(number, precision) { number = toNumber(number); precision = precision == null ? 0 : nativeMin(toInteger(precision), 292); if (precision && nativeIsFinite(number)) { // Shift with exponential notation to avoid floating-point issues. // See [MDN](https://mdn.io/round#Examples) for more details. var pair = (toString(number) + 'e').split('e'), value = func(pair[0] + 'e' + (+pair[1] + precision)); pair = (toString(value) + 'e').split('e'); return +(pair[0] + 'e' + (+pair[1] - precision)); } return func(number); }; } /** * Creates a set object of `values`. * * @private * @param {Array} values The values to add to the set. * @returns {Object} Returns the new set. */ var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { return new Set(values); }; /** * Creates a `_.toPairs` or `_.toPairsIn` function. * * @private * @param {Function} keysFunc The function to get the keys of a given object. * @returns {Function} Returns the new pairs function. */ function createToPairs(keysFunc) { return function(object) { var tag = getTag(object); if (tag == mapTag) { return mapToArray(object); } if (tag == setTag) { return setToPairs(object); } return baseToPairs(object, keysFunc(object)); }; } /** * Creates a function that either curries or invokes `func` with optional * `this` binding and partially applied arguments. * * @private * @param {Function|string} func The function or method name to wrap. * @param {number} bitmask The bitmask flags. * 1 - `_.bind` * 2 - `_.bindKey` * 4 - `_.curry` or `_.curryRight` of a bound function * 8 - `_.curry` * 16 - `_.curryRight` * 32 - `_.partial` * 64 - `_.partialRight` * 128 - `_.rearg` * 256 - `_.ary` * 512 - `_.flip` * @param {*} [thisArg] The `this` binding of `func`. * @param {Array} [partials] The arguments to be partially applied. * @param {Array} [holders] The `partials` placeholder indexes. * @param {Array} [argPos] The argument positions of the new function. * @param {number} [ary] The arity cap of `func`. * @param {number} [arity] The arity of `func`. * @returns {Function} Returns the new wrapped function. */ function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { var isBindKey = bitmask & WRAP_BIND_KEY_FLAG; if (!isBindKey && typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } var length = partials ? partials.length : 0; if (!length) { bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG); partials = holders = undefined; } ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0); arity = arity === undefined ? arity : toInteger(arity); length -= holders ? holders.length : 0; if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) { var partialsRight = partials, holdersRight = holders; partials = holders = undefined; } var data = isBindKey ? undefined : getData(func); var newData = [ func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity ]; if (data) { mergeData(newData, data); } func = newData[0]; bitmask = newData[1]; thisArg = newData[2]; partials = newData[3]; holders = newData[4]; arity = newData[9] = newData[9] === undefined ? (isBindKey ? 0 : func.length) : nativeMax(newData[9] - length, 0); if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) { bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG); } if (!bitmask || bitmask == WRAP_BIND_FLAG) { var result = createBind(func, bitmask, thisArg); } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) { result = createCurry(func, bitmask, arity); } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) { result = createPartial(func, bitmask, thisArg, partials); } else { result = createHybrid.apply(undefined, newData); } var setter = data ? baseSetData : setData; return setWrapToString(setter(result, newData), func, bitmask); } /** * Used by `_.defaults` to customize its `_.assignIn` use to assign properties * of source objects to the destination object for all destination properties * that resolve to `undefined`. * * @private * @param {*} objValue The destination value. * @param {*} srcValue The source value. * @param {string} key The key of the property to assign. * @param {Object} object The parent object of `objValue`. * @returns {*} Returns the value to assign. */ function customDefaultsAssignIn(objValue, srcValue, key, object) { if (objValue === undefined || (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) { return srcValue; } return objValue; } /** * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source * objects into destination objects that are passed thru. * * @private * @param {*} objValue The destination value. * @param {*} srcValue The source value. * @param {string} key The key of the property to merge. * @param {Object} object The parent object of `objValue`. * @param {Object} source The parent object of `srcValue`. * @param {Object} [stack] Tracks traversed source values and their merged * counterparts. * @returns {*} Returns the value to assign. */ function customDefaultsMerge(objValue, srcValue, key, object, source, stack) { if (isObject(objValue) && isObject(srcValue)) { // Recursively merge objects and arrays (susceptible to call stack limits). stack.set(srcValue, objValue); baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack); stack['delete'](srcValue); } return objValue; } /** * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain * objects. * * @private * @param {*} value The value to inspect. * @param {string} key The key of the property to inspect. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`. */ function customOmitClone(value) { return isPlainObject(value) ? undefined : value; } /** * A specialized version of `baseIsEqualDeep` for arrays with support for * partial deep comparisons. * * @private * @param {Array} array The array to compare. * @param {Array} other The other array to compare. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. * @param {Function} customizer The function to customize comparisons. * @param {Function} equalFunc The function to determine equivalents of values. * @param {Object} stack Tracks traversed `array` and `other` objects. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. */ function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array.length, othLength = other.length; if (arrLength != othLength && !(isPartial && othLength > arrLength)) { return false; } // Check that cyclic values are equal. var arrStacked = stack.get(array); var othStacked = stack.get(other); if (arrStacked && othStacked) { return arrStacked == other && othStacked == array; } var index = -1, result = true, seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; stack.set(array, other); stack.set(other, array); // Ignore non-index properties. while (++index < arrLength) { var arrValue = array[index], othValue = other[index]; if (customizer) { var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack); } if (compared !== undefined) { if (compared) { continue; } result = false; break; } // Recursively compare arrays (susceptible to call stack limits). if (seen) { if (!arraySome(other, function(othValue, othIndex) { if (!cacheHas(seen, othIndex) && (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { return seen.push(othIndex); } })) { result = false; break; } } else if (!( arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack) )) { result = false; break; } } stack['delete'](array); stack['delete'](other); return result; } /** * A specialized version of `baseIsEqualDeep` for comparing objects of * the same `toStringTag`. * * **Note:** This function only supports comparing values with tags of * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. * * @private * @param {Object} object The object to compare. * @param {Object} other The other object to compare. * @param {string} tag The `toStringTag` of the objects to compare. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. * @param {Function} customizer The function to customize comparisons. * @param {Function} equalFunc The function to determine equivalents of values. * @param {Object} stack Tracks traversed `object` and `other` objects. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { switch (tag) { case dataViewTag: if ((object.byteLength != other.byteLength) || (object.byteOffset != other.byteOffset)) { return false; } object = object.buffer; other = other.buffer; case arrayBufferTag: if ((object.byteLength != other.byteLength) || !equalFunc(new Uint8Array(object), new Uint8Array(other))) { return false; } return true; case boolTag: case dateTag: case numberTag: // Coerce booleans to `1` or `0` and dates to milliseconds. // Invalid dates are coerced to `NaN`. return eq(+object, +other); case errorTag: return object.name == other.name && object.message == other.message; case regexpTag: case stringTag: // Coerce regexes to strings and treat strings, primitives and objects, // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring // for more details. return object == (other + ''); case mapTag: var convert = mapToArray; case setTag: var isPartial = bitmask & COMPARE_PARTIAL_FLAG; convert || (convert = setToArray); if (object.size != other.size && !isPartial) { return false; } // Assume cyclic values are equal. var stacked = stack.get(object); if (stacked) { return stacked == other; } bitmask |= COMPARE_UNORDERED_FLAG; // Recursively compare objects (susceptible to call stack limits). stack.set(object, other); var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); stack['delete'](object); return result; case symbolTag: if (symbolValueOf) { return symbolValueOf.call(object) == symbolValueOf.call(other); } } return false; } /** * A specialized version of `baseIsEqualDeep` for objects with support for * partial deep comparisons. * * @private * @param {Object} object The object to compare. * @param {Object} other The other object to compare. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. * @param {Function} customizer The function to customize comparisons. * @param {Function} equalFunc The function to determine equivalents of values. * @param {Object} stack Tracks traversed `object` and `other` objects. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length; if (objLength != othLength && !isPartial) { return false; } var index = objLength; while (index--) { var key = objProps[index]; if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { return false; } } // Check that cyclic values are equal. var objStacked = stack.get(object); var othStacked = stack.get(other); if (objStacked && othStacked) { return objStacked == other && othStacked == object; } var result = true; stack.set(object, other); stack.set(other, object); var skipCtor = isPartial; while (++index < objLength) { key = objProps[index]; var objValue = object[key], othValue = other[key]; if (customizer) { var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack); } // Recursively compare objects (susceptible to call stack limits). if (!(compared === undefined ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) : compared )) { result = false; break; } skipCtor || (skipCtor = key == 'constructor'); } if (result && !skipCtor) { var objCtor = object.constructor, othCtor = other.constructor; // Non `Object` object instances with different constructors are not equal. if (objCtor != othCtor && ('constructor' in object && 'constructor' in other) && !(typeof objCtor == 'function' && objCtor instanceof objCtor && typeof othCtor == 'function' && othCtor instanceof othCtor)) { result = false; } } stack['delete'](object); stack['delete'](other); return result; } /** * A specialized version of `baseRest` which flattens the rest array. * * @private * @param {Function} func The function to apply a rest parameter to. * @returns {Function} Returns the new function. */ function flatRest(func) { return setToString(overRest(func, undefined, flatten), func + ''); } /** * Creates an array of own enumerable property names and symbols of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names and symbols. */ function getAllKeys(object) { return baseGetAllKeys(object, keys, getSymbols); } /** * Creates an array of own and inherited enumerable property names and * symbols of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names and symbols. */ function getAllKeysIn(object) { return baseGetAllKeys(object, keysIn, getSymbolsIn); } /** * Gets metadata for `func`. * * @private * @param {Function} func The function to query. * @returns {*} Returns the metadata for `func`. */ var getData = !metaMap ? noop : function(func) { return metaMap.get(func); }; /** * Gets the name of `func`. * * @private * @param {Function} func The function to query. * @returns {string} Returns the function name. */ function getFuncName(func) { var result = (func.name + ''), array = realNames[result], length = hasOwnProperty.call(realNames, result) ? array.length : 0; while (length--) { var data = array[length], otherFunc = data.func; if (otherFunc == null || otherFunc == func) { return data.name; } } return result; } /** * Gets the argument placeholder value for `func`. * * @private * @param {Function} func The function to inspect. * @returns {*} Returns the placeholder value. */ function getHolder(func) { var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func; return object.placeholder; } /** * Gets the appropriate "iteratee" function. If `_.iteratee` is customized, * this function returns the custom method, otherwise it returns `baseIteratee`. * If arguments are provided, the chosen function is invoked with them and * its result is returned. * * @private * @param {*} [value] The value to convert to an iteratee. * @param {number} [arity] The arity of the created iteratee. * @returns {Function} Returns the chosen function or its result. */ function getIteratee() { var result = lodash.iteratee || iteratee; result = result === iteratee ? baseIteratee : result; return arguments.length ? result(arguments[0], arguments[1]) : result; } /** * Gets the data for `map`. * * @private * @param {Object} map The map to query. * @param {string} key The reference key. * @returns {*} Returns the map data. */ function getMapData(map, key) { var data = map.__data__; return isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map; } /** * Gets the property names, values, and compare flags of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the match data of `object`. */ function getMatchData(object) { var result = keys(object), length = result.length; while (length--) { var key = result[length], value = object[key]; result[length] = [key, value, isStrictComparable(value)]; } return result; } /** * Gets the native function at `key` of `object`. * * @private * @param {Object} object The object to query. * @param {string} key The key of the method to get. * @returns {*} Returns the function if it's native, else `undefined`. */ function getNative(object, key) { var value = getValue(object, key); return baseIsNative(value) ? value : undefined; } /** * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. * * @private * @param {*} value The value to query. * @returns {string} Returns the raw `toStringTag`. */ function getRawTag(value) { var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag]; try { value[symToStringTag] = undefined; var unmasked = true; } catch (e) {} var result = nativeObjectToString.call(value); if (unmasked) { if (isOwn) { value[symToStringTag] = tag; } else { delete value[symToStringTag]; } } return result; } /** * Creates an array of the own enumerable symbols of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of symbols. */ var getSymbols = !nativeGetSymbols ? stubArray : function(object) { if (object == null) { return []; } object = Object(object); return arrayFilter(nativeGetSymbols(object), function(symbol) { return propertyIsEnumerable.call(object, symbol); }); }; /** * Creates an array of the own and inherited enumerable symbols of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of symbols. */ var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { var result = []; while (object) { arrayPush(result, getSymbols(object)); object = getPrototype(object); } return result; }; /** * Gets the `toStringTag` of `value`. * * @private * @param {*} value The value to query. * @returns {string} Returns the `toStringTag`. */ var getTag = baseGetTag; // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || (Map && getTag(new Map) != mapTag) || (Promise && getTag(Promise.resolve()) != promiseTag) || (Set && getTag(new Set) != setTag) || (WeakMap && getTag(new WeakMap) != weakMapTag)) { getTag = function(value) { var result = baseGetTag(value), Ctor = result == objectTag ? value.constructor : undefined, ctorString = Ctor ? toSource(Ctor) : ''; if (ctorString) { switch (ctorString) { case dataViewCtorString: return dataViewTag; case mapCtorString: return mapTag; case promiseCtorString: return promiseTag; case setCtorString: return setTag; case weakMapCtorString: return weakMapTag; } } return result; }; } /** * Gets the view, applying any `transforms` to the `start` and `end` positions. * * @private * @param {number} start The start of the view. * @param {number} end The end of the view. * @param {Array} transforms The transformations to apply to the view. * @returns {Object} Returns an object containing the `start` and `end` * positions of the view. */ function getView(start, end, transforms) { var index = -1, length = transforms.length; while (++index < length) { var data = transforms[index], size = data.size; switch (data.type) { case 'drop': start += size; break; case 'dropRight': end -= size; break; case 'take': end = nativeMin(end, start + size); break; case 'takeRight': start = nativeMax(start, end - size); break; } } return { 'start': start, 'end': end }; } /** * Extracts wrapper details from the `source` body comment. * * @private * @param {string} source The source to inspect. * @returns {Array} Returns the wrapper details. */ function getWrapDetails(source) { var match = source.match(reWrapDetails); return match ? match[1].split(reSplitDetails) : []; } /** * Checks if `path` exists on `object`. * * @private * @param {Object} object The object to query. * @param {Array|string} path The path to check. * @param {Function} hasFunc The function to check properties. * @returns {boolean} Returns `true` if `path` exists, else `false`. */ function hasPath(object, path, hasFunc) { path = castPath(path, object); var index = -1, length = path.length, result = false; while (++index < length) { var key = toKey(path[index]); if (!(result = object != null && hasFunc(object, key))) { break; } object = object[key]; } if (result || ++index != length) { return result; } length = object == null ? 0 : object.length; return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object)); } /** * Initializes an array clone. * * @private * @param {Array} array The array to clone. * @returns {Array} Returns the initialized clone. */ function initCloneArray(array) { var length = array.length, result = new array.constructor(length); // Add properties assigned by `RegExp#exec`. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { result.index = array.index; result.input = array.input; } return result; } /** * Initializes an object clone. * * @private * @param {Object} object The object to clone. * @returns {Object} Returns the initialized clone. */ function initCloneObject(object) { return (typeof object.constructor == 'function' && !isPrototype(object)) ? baseCreate(getPrototype(object)) : {}; } /** * Initializes an object clone based on its `toStringTag`. * * **Note:** This function only supports cloning values with tags of * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`. * * @private * @param {Object} object The object to clone. * @param {string} tag The `toStringTag` of the object to clone. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Object} Returns the initialized clone. */ function initCloneByTag(object, tag, isDeep) { var Ctor = object.constructor; switch (tag) { case arrayBufferTag: return cloneArrayBuffer(object); case boolTag: case dateTag: return new Ctor(+object); case dataViewTag: return cloneDataView(object, isDeep); case float32Tag: case float64Tag: case int8Tag: case int16Tag: case int32Tag: case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: return cloneTypedArray(object, isDeep); case mapTag: return new Ctor; case numberTag: case stringTag: return new Ctor(object); case regexpTag: return cloneRegExp(object); case setTag: return new Ctor; case symbolTag: return cloneSymbol(object); } } /** * Inserts wrapper `details` in a comment at the top of the `source` body. * * @private * @param {string} source The source to modify. * @returns {Array} details The details to insert. * @returns {string} Returns the modified source. */ function insertWrapDetails(source, details) { var length = details.length; if (!length) { return source; } var lastIndex = length - 1; details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex]; details = details.join(length > 2 ? ', ' : ' '); return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n'); } /** * Checks if `value` is a flattenable `arguments` object or array. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. */ function isFlattenable(value) { return isArray(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]); } /** * Checks if `value` is a valid array-like index. * * @private * @param {*} value The value to check. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. */ function isIndex(value, length) { var type = typeof value; length = length == null ? MAX_SAFE_INTEGER : length; return !!length && (type == 'number' || (type != 'symbol' && reIsUint.test(value))) && (value > -1 && value % 1 == 0 && value < length); } /** * Checks if the given arguments are from an iteratee call. * * @private * @param {*} value The potential iteratee value argument. * @param {*} index The potential iteratee index or key argument. * @param {*} object The potential iteratee object argument. * @returns {boolean} Returns `true` if the arguments are from an iteratee call, * else `false`. */ function isIterateeCall(value, index, object) { if (!isObject(object)) { return false; } var type = typeof index; if (type == 'number' ? (isArrayLike(object) && isIndex(index, object.length)) : (type == 'string' && index in object) ) { return eq(object[index], value); } return false; } /** * Checks if `value` is a property name and not a property path. * * @private * @param {*} value The value to check. * @param {Object} [object] The object to query keys on. * @returns {boolean} Returns `true` if `value` is a property name, else `false`. */ function isKey(value, object) { if (isArray(value)) { return false; } var type = typeof value; if (type == 'number' || type == 'symbol' || type == 'boolean' || value == null || isSymbol(value)) { return true; } return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || (object != null && value in Object(object)); } /** * Checks if `value` is suitable for use as unique object key. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is suitable, else `false`. */ function isKeyable(value) { var type = typeof value; return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') ? (value !== '__proto__') : (value === null); } /** * Checks if `func` has a lazy counterpart. * * @private * @param {Function} func The function to check. * @returns {boolean} Returns `true` if `func` has a lazy counterpart, * else `false`. */ function isLaziable(func) { var funcName = getFuncName(func), other = lodash[funcName]; if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) { return false; } if (func === other) { return true; } var data = getData(other); return !!data && func === data[0]; } /** * Checks if `func` has its source masked. * * @private * @param {Function} func The function to check. * @returns {boolean} Returns `true` if `func` is masked, else `false`. */ function isMasked(func) { return !!maskSrcKey && (maskSrcKey in func); } /** * Checks if `func` is capable of being masked. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `func` is maskable, else `false`. */ var isMaskable = coreJsData ? isFunction : stubFalse; /** * Checks if `value` is likely a prototype object. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. */ function isPrototype(value) { var Ctor = value && value.constructor, proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; return value === proto; } /** * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` if suitable for strict * equality comparisons, else `false`. */ function isStrictComparable(value) { return value === value && !isObject(value); } /** * A specialized version of `matchesProperty` for source values suitable * for strict equality comparisons, i.e. `===`. * * @private * @param {string} key The key of the property to get. * @param {*} srcValue The value to match. * @returns {Function} Returns the new spec function. */ function matchesStrictComparable(key, srcValue) { return function(object) { if (object == null) { return false; } return object[key] === srcValue && (srcValue !== undefined || (key in Object(object))); }; } /** * A specialized version of `_.memoize` which clears the memoized function's * cache when it exceeds `MAX_MEMOIZE_SIZE`. * * @private * @param {Function} func The function to have its output memoized. * @returns {Function} Returns the new memoized function. */ function memoizeCapped(func) { var result = memoize(func, function(key) { if (cache.size === MAX_MEMOIZE_SIZE) { cache.clear(); } return key; }); var cache = result.cache; return result; } /** * Merges the function metadata of `source` into `data`. * * Merging metadata reduces the number of wrappers used to invoke a function. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` * may be applied regardless of execution order. Methods like `_.ary` and * `_.rearg` modify function arguments, making the order in which they are * executed important, preventing the merging of metadata. However, we make * an exception for a safe combined case where curried functions have `_.ary` * and or `_.rearg` applied. * * @private * @param {Array} data The destination metadata. * @param {Array} source The source metadata. * @returns {Array} Returns `data`. */ function mergeData(data, source) { var bitmask = data[1], srcBitmask = source[1], newBitmask = bitmask | srcBitmask, isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG); var isCombo = ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) || ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) || ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG)); // Exit early if metadata can't be merged. if (!(isCommon || isCombo)) { return data; } // Use source `thisArg` if available. if (srcBitmask & WRAP_BIND_FLAG) { data[2] = source[2]; // Set when currying a bound function. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG; } // Compose partial arguments. var value = source[3]; if (value) { var partials = data[3]; data[3] = partials ? composeArgs(partials, value, source[4]) : value; data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4]; } // Compose partial right arguments. value = source[5]; if (value) { partials = data[5]; data[5] = partials ? composeArgsRight(partials, value, source[6]) : value; data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6]; } // Use source `argPos` if available. value = source[7]; if (value) { data[7] = value; } // Use source `ary` if it's smaller. if (srcBitmask & WRAP_ARY_FLAG) { data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); } // Use source `arity` if one is not provided. if (data[9] == null) { data[9] = source[9]; } // Use source `func` and merge bitmasks. data[0] = source[0]; data[1] = newBitmask; return data; } /** * This function is like * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) * except that it includes inherited enumerable properties. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ function nativeKeysIn(object) { var result = []; if (object != null) { for (var key in Object(object)) { result.push(key); } } return result; } /** * Converts `value` to a string using `Object.prototype.toString`. * * @private * @param {*} value The value to convert. * @returns {string} Returns the converted string. */ function objectToString(value) { return nativeObjectToString.call(value); } /** * A specialized version of `baseRest` which transforms the rest array. * * @private * @param {Function} func The function to apply a rest parameter to. * @param {number} [start=func.length-1] The start position of the rest parameter. * @param {Function} transform The rest array transform. * @returns {Function} Returns the new function. */ function overRest(func, start, transform) { start = nativeMax(start === undefined ? (func.length - 1) : start, 0); return function() { var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array(length); while (++index < length) { array[index] = args[start + index]; } index = -1; var otherArgs = Array(start + 1); while (++index < start) { otherArgs[index] = args[index]; } otherArgs[start] = transform(array); return apply(func, this, otherArgs); }; } /** * Gets the parent value at `path` of `object`. * * @private * @param {Object} object The object to query. * @param {Array} path The path to get the parent value of. * @returns {*} Returns the parent value. */ function parent(object, path) { return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1)); } /** * Reorder `array` according to the specified indexes where the element at * the first index is assigned as the first element, the element at * the second index is assigned as the second element, and so on. * * @private * @param {Array} array The array to reorder. * @param {Array} indexes The arranged array indexes. * @returns {Array} Returns `array`. */ function reorder(array, indexes) { var arrLength = array.length, length = nativeMin(indexes.length, arrLength), oldArray = copyArray(array); while (length--) { var index = indexes[length]; array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; } return array; } /** * Gets the value at `key`, unless `key` is "__proto__" or "constructor". * * @private * @param {Object} object The object to query. * @param {string} key The key of the property to get. * @returns {*} Returns the property value. */ function safeGet(object, key) { if (key === 'constructor' && typeof object[key] === 'function') { return; } if (key == '__proto__') { return; } return object[key]; } /** * Sets metadata for `func`. * * **Note:** If this function becomes hot, i.e. is invoked a lot in a short * period of time, it will trip its breaker and transition to an identity * function to avoid garbage collection pauses in V8. See * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070) * for more details. * * @private * @param {Function} func The function to associate metadata with. * @param {*} data The metadata. * @returns {Function} Returns `func`. */ var setData = shortOut(baseSetData); /** * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout). * * @private * @param {Function} func The function to delay. * @param {number} wait The number of milliseconds to delay invocation. * @returns {number|Object} Returns the timer id or timeout object. */ var setTimeout = ctxSetTimeout || function(func, wait) { return root.setTimeout(func, wait); }; /** * Sets the `toString` method of `func` to return `string`. * * @private * @param {Function} func The function to modify. * @param {Function} string The `toString` result. * @returns {Function} Returns `func`. */ var setToString = shortOut(baseSetToString); /** * Sets the `toString` method of `wrapper` to mimic the source of `reference` * with wrapper details in a comment at the top of the source body. * * @private * @param {Function} wrapper The function to modify. * @param {Function} reference The reference function. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @returns {Function} Returns `wrapper`. */ function setWrapToString(wrapper, reference, bitmask) { var source = (reference + ''); return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))); } /** * Creates a function that'll short out and invoke `identity` instead * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` * milliseconds. * * @private * @param {Function} func The function to restrict. * @returns {Function} Returns the new shortable function. */ function shortOut(func) { var count = 0, lastCalled = 0; return function() { var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled); lastCalled = stamp; if (remaining > 0) { if (++count >= HOT_COUNT) { return arguments[0]; } } else { count = 0; } return func.apply(undefined, arguments); }; } /** * A specialized version of `_.shuffle` which mutates and sets the size of `array`. * * @private * @param {Array} array The array to shuffle. * @param {number} [size=array.length] The size of `array`. * @returns {Array} Returns `array`. */ function shuffleSelf(array, size) { var index = -1, length = array.length, lastIndex = length - 1; size = size === undefined ? length : size; while (++index < size) { var rand = baseRandom(index, lastIndex), value = array[rand]; array[rand] = array[index]; array[index] = value; } array.length = size; return array; } /** * Converts `string` to a property path array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the property path array. */ var stringToPath = memoizeCapped(function(string) { var result = []; if (string.charCodeAt(0) === 46 /* . */) { result.push(''); } string.replace(rePropName, function(match, number, quote, subString) { result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match)); }); return result; }); /** * Converts `value` to a string key if it's not a string or symbol. * * @private * @param {*} value The value to inspect. * @returns {string|symbol} Returns the key. */ function toKey(value) { if (typeof value == 'string' || isSymbol(value)) { return value; } var result = (value + ''); return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; } /** * Converts `func` to its source code. * * @private * @param {Function} func The function to convert. * @returns {string} Returns the source code. */ function toSource(func) { if (func != null) { try { return funcToString.call(func); } catch (e) {} try { return (func + ''); } catch (e) {} } return ''; } /** * Updates wrapper `details` based on `bitmask` flags. * * @private * @returns {Array} details The details to modify. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @returns {Array} Returns `details`. */ function updateWrapDetails(details, bitmask) { arrayEach(wrapFlags, function(pair) { var value = '_.' + pair[0]; if ((bitmask & pair[1]) && !arrayIncludes(details, value)) { details.push(value); } }); return details.sort(); } /** * Creates a clone of `wrapper`. * * @private * @param {Object} wrapper The wrapper to clone. * @returns {Object} Returns the cloned wrapper. */ function wrapperClone(wrapper) { if (wrapper instanceof LazyWrapper) { return wrapper.clone(); } var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); result.__actions__ = copyArray(wrapper.__actions__); result.__index__ = wrapper.__index__; result.__values__ = wrapper.__values__; return result; } /*------------------------------------------------------------------------*/ /** * Creates an array of elements split into groups the length of `size`. * If `array` can't be split evenly, the final chunk will be the remaining * elements. * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to process. * @param {number} [size=1] The length of each chunk * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the new array of chunks. * @example * * _.chunk(['a', 'b', 'c', 'd'], 2); * // => [['a', 'b'], ['c', 'd']] * * _.chunk(['a', 'b', 'c', 'd'], 3); * // => [['a', 'b', 'c'], ['d']] */ function chunk(array, size, guard) { if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) { size = 1; } else { size = nativeMax(toInteger(size), 0); } var length = array == null ? 0 : array.length; if (!length || size < 1) { return []; } var index = 0, resIndex = 0, result = Array(nativeCeil(length / size)); while (index < length) { result[resIndex++] = baseSlice(array, index, (index += size)); } return result; } /** * Creates an array with all falsey values removed. The values `false`, `null`, * `0`, `-0`, `0n`, `""`, `undefined`, and `NaN` are falsy. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to compact. * @returns {Array} Returns the new array of filtered values. * @example * * _.compact([0, 1, false, 2, '', 3]); * // => [1, 2, 3] */ function compact(array) { var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = []; while (++index < length) { var value = array[index]; if (value) { result[resIndex++] = value; } } return result; } /** * Creates a new array concatenating `array` with any additional arrays * and/or values. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to concatenate. * @param {...*} [values] The values to concatenate. * @returns {Array} Returns the new concatenated array. * @example * * var array = [1]; * var other = _.concat(array, 2, [3], [[4]]); * * console.log(other); * // => [1, 2, 3, [4]] * * console.log(array); * // => [1] */ function concat() { var length = arguments.length; if (!length) { return []; } var args = Array(length - 1), array = arguments[0], index = length; while (index--) { args[index - 1] = arguments[index]; } return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)); } /** * Creates an array of `array` values not included in the other given arrays * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. The order and references of result values are * determined by the first array. * * **Note:** Unlike `_.pullAll`, this method returns a new array. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to inspect. * @param {...Array} [values] The values to exclude. * @returns {Array} Returns the new array of filtered values. * @see _.without, _.xor * @example * * _.difference([2, 1], [2, 3]); * // => [1] */ var difference = baseRest(function(array, values) { return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) : []; }); /** * This method is like `_.difference` except that it accepts `iteratee` which * is invoked for each element of `array` and `values` to generate the criterion * by which they're compared. The order and references of result values are * determined by the first array. The iteratee is invoked with one argument: * (value). * * **Note:** Unlike `_.pullAllBy`, this method returns a new array. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {...Array} [values] The values to exclude. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Array} Returns the new array of filtered values. * @example * * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor); * // => [1.2] * * // The `_.property` iteratee shorthand. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); * // => [{ 'x': 2 }] */ var differenceBy = baseRest(function(array, values) { var iteratee = last(values); if (isArrayLikeObject(iteratee)) { iteratee = undefined; } return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)) : []; }); /** * This method is like `_.difference` except that it accepts `comparator` * which is invoked to compare elements of `array` to `values`. The order and * references of result values are determined by the first array. The comparator * is invoked with two arguments: (arrVal, othVal). * * **Note:** Unlike `_.pullAllWith`, this method returns a new array. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {...Array} [values] The values to exclude. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of filtered values. * @example * * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; * * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); * // => [{ 'x': 2, 'y': 1 }] */ var differenceWith = baseRest(function(array, values) { var comparator = last(values); if (isArrayLikeObject(comparator)) { comparator = undefined; } return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator) : []; }); /** * Creates a slice of `array` with `n` elements dropped from the beginning. * * @static * @memberOf _ * @since 0.5.0 * @category Array * @param {Array} array The array to query. * @param {number} [n=1] The number of elements to drop. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the slice of `array`. * @example * * _.drop([1, 2, 3]); * // => [2, 3] * * _.drop([1, 2, 3], 2); * // => [3] * * _.drop([1, 2, 3], 5); * // => [] * * _.drop([1, 2, 3], 0); * // => [1, 2, 3] */ function drop(array, n, guard) { var length = array == null ? 0 : array.length; if (!length) { return []; } n = (guard || n === undefined) ? 1 : toInteger(n); return baseSlice(array, n < 0 ? 0 : n, length); } /** * Creates a slice of `array` with `n` elements dropped from the end. * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to query. * @param {number} [n=1] The number of elements to drop. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the slice of `array`. * @example * * _.dropRight([1, 2, 3]); * // => [1, 2] * * _.dropRight([1, 2, 3], 2); * // => [1] * * _.dropRight([1, 2, 3], 5); * // => [] * * _.dropRight([1, 2, 3], 0); * // => [1, 2, 3] */ function dropRight(array, n, guard) { var length = array == null ? 0 : array.length; if (!length) { return []; } n = (guard || n === undefined) ? 1 : toInteger(n); n = length - n; return baseSlice(array, 0, n < 0 ? 0 : n); } /** * Creates a slice of `array` excluding elements dropped from the end. * Elements are dropped until `predicate` returns falsey. The predicate is * invoked with three arguments: (value, index, array). * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to query. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the slice of `array`. * @example * * var users = [ * { 'user': 'barney', 'active': true }, * { 'user': 'fred', 'active': false }, * { 'user': 'pebbles', 'active': false } * ]; * * _.dropRightWhile(users, function(o) { return !o.active; }); * // => objects for ['barney'] * * // The `_.matches` iteratee shorthand. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false }); * // => objects for ['barney', 'fred'] * * // The `_.matchesProperty` iteratee shorthand. * _.dropRightWhile(users, ['active', false]); * // => objects for ['barney'] * * // The `_.property` iteratee shorthand. * _.dropRightWhile(users, 'active'); * // => objects for ['barney', 'fred', 'pebbles'] */ function dropRightWhile(array, predicate) { return (array && array.length) ? baseWhile(array, getIteratee(predicate, 3), true, true) : []; } /** * Creates a slice of `array` excluding elements dropped from the beginning. * Elements are dropped until `predicate` returns falsey. The predicate is * invoked with three arguments: (value, index, array). * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to query. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the slice of `array`. * @example * * var users = [ * { 'user': 'barney', 'active': false }, * { 'user': 'fred', 'active': false }, * { 'user': 'pebbles', 'active': true } * ]; * * _.dropWhile(users, function(o) { return !o.active; }); * // => objects for ['pebbles'] * * // The `_.matches` iteratee shorthand. * _.dropWhile(users, { 'user': 'barney', 'active': false }); * // => objects for ['fred', 'pebbles'] * * // The `_.matchesProperty` iteratee shorthand. * _.dropWhile(users, ['active', false]); * // => objects for ['pebbles'] * * // The `_.property` iteratee shorthand. * _.dropWhile(users, 'active'); * // => objects for ['barney', 'fred', 'pebbles'] */ function dropWhile(array, predicate) { return (array && array.length) ? baseWhile(array, getIteratee(predicate, 3), true) : []; } /** * Fills elements of `array` with `value` from `start` up to, but not * including, `end`. * * **Note:** This method mutates `array`. * * @static * @memberOf _ * @since 3.2.0 * @category Array * @param {Array} array The array to fill. * @param {*} value The value to fill `array` with. * @param {number} [start=0] The start position. * @param {number} [end=array.length] The end position. * @returns {Array} Returns `array`. * @example * * var array = [1, 2, 3]; * * _.fill(array, 'a'); * console.log(array); * // => ['a', 'a', 'a'] * * _.fill(Array(3), 2); * // => [2, 2, 2] * * _.fill([4, 6, 8, 10], '*', 1, 3); * // => [4, '*', '*', 10] */ function fill(array, value, start, end) { var length = array == null ? 0 : array.length; if (!length) { return []; } if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { start = 0; end = length; } return baseFill(array, value, start, end); } /** * This method is like `_.find` except that it returns the index of the first * element `predicate` returns truthy for instead of the element itself. * * @static * @memberOf _ * @since 1.1.0 * @category Array * @param {Array} array The array to inspect. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @param {number} [fromIndex=0] The index to search from. * @returns {number} Returns the index of the found element, else `-1`. * @example * * var users = [ * { 'user': 'barney', 'active': false }, * { 'user': 'fred', 'active': false }, * { 'user': 'pebbles', 'active': true } * ]; * * _.findIndex(users, function(o) { return o.user == 'barney'; }); * // => 0 * * // The `_.matches` iteratee shorthand. * _.findIndex(users, { 'user': 'fred', 'active': false }); * // => 1 * * // The `_.matchesProperty` iteratee shorthand. * _.findIndex(users, ['active', false]); * // => 0 * * // The `_.property` iteratee shorthand. * _.findIndex(users, 'active'); * // => 2 */ function findIndex(array, predicate, fromIndex) { var length = array == null ? 0 : array.length; if (!length) { return -1; } var index = fromIndex == null ? 0 : toInteger(fromIndex); if (index < 0) { index = nativeMax(length + index, 0); } return baseFindIndex(array, getIteratee(predicate, 3), index); } /** * This method is like `_.findIndex` except that it iterates over elements * of `collection` from right to left. * * @static * @memberOf _ * @since 2.0.0 * @category Array * @param {Array} array The array to inspect. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @param {number} [fromIndex=array.length-1] The index to search from. * @returns {number} Returns the index of the found element, else `-1`. * @example * * var users = [ * { 'user': 'barney', 'active': true }, * { 'user': 'fred', 'active': false }, * { 'user': 'pebbles', 'active': false } * ]; * * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); * // => 2 * * // The `_.matches` iteratee shorthand. * _.findLastIndex(users, { 'user': 'barney', 'active': true }); * // => 0 * * // The `_.matchesProperty` iteratee shorthand. * _.findLastIndex(users, ['active', false]); * // => 2 * * // The `_.property` iteratee shorthand. * _.findLastIndex(users, 'active'); * // => 0 */ function findLastIndex(array, predicate, fromIndex) { var length = array == null ? 0 : array.length; if (!length) { return -1; } var index = length - 1; if (fromIndex !== undefined) { index = toInteger(fromIndex); index = fromIndex < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); } return baseFindIndex(array, getIteratee(predicate, 3), index, true); } /** * Flattens `array` a single level deep. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to flatten. * @returns {Array} Returns the new flattened array. * @example * * _.flatten([1, [2, [3, [4]], 5]]); * // => [1, 2, [3, [4]], 5] */ function flatten(array) { var length = array == null ? 0 : array.length; return length ? baseFlatten(array, 1) : []; } /** * Recursively flattens `array`. * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to flatten. * @returns {Array} Returns the new flattened array. * @example * * _.flattenDeep([1, [2, [3, [4]], 5]]); * // => [1, 2, 3, 4, 5] */ function flattenDeep(array) { var length = array == null ? 0 : array.length; return length ? baseFlatten(array, INFINITY) : []; } /** * Recursively flatten `array` up to `depth` times. * * @static * @memberOf _ * @since 4.4.0 * @category Array * @param {Array} array The array to flatten. * @param {number} [depth=1] The maximum recursion depth. * @returns {Array} Returns the new flattened array. * @example * * var array = [1, [2, [3, [4]], 5]]; * * _.flattenDepth(array, 1); * // => [1, 2, [3, [4]], 5] * * _.flattenDepth(array, 2); * // => [1, 2, 3, [4], 5] */ function flattenDepth(array, depth) { var length = array == null ? 0 : array.length; if (!length) { return []; } depth = depth === undefined ? 1 : toInteger(depth); return baseFlatten(array, depth); } /** * The inverse of `_.toPairs`; this method returns an object composed * from key-value `pairs`. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} pairs The key-value pairs. * @returns {Object} Returns the new object. * @example * * _.fromPairs([['a', 1], ['b', 2]]); * // => { 'a': 1, 'b': 2 } */ function fromPairs(pairs) { var index = -1, length = pairs == null ? 0 : pairs.length, result = {}; while (++index < length) { var pair = pairs[index]; baseAssignValue(result, pair[0], pair[1]); } return result; } /** * Gets the first element of `array`. * * @static * @memberOf _ * @since 0.1.0 * @alias first * @category Array * @param {Array} array The array to query. * @returns {*} Returns the first element of `array`. * @example * * _.head([1, 2, 3]); * // => 1 * * _.head([]); * // => undefined */ function head(array) { return (array && array.length) ? array[0] : undefined; } /** * Gets the index at which the first occurrence of `value` is found in `array` * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. If `fromIndex` is negative, it's used as the * offset from the end of `array`. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} [fromIndex=0] The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. * @example * * _.indexOf([1, 2, 1, 2], 2); * // => 1 * * // Search from the `fromIndex`. * _.indexOf([1, 2, 1, 2], 2, 2); * // => 3 */ function indexOf(array, value, fromIndex) { var length = array == null ? 0 : array.length; if (!length) { return -1; } var index = fromIndex == null ? 0 : toInteger(fromIndex); if (index < 0) { index = nativeMax(length + index, 0); } return baseIndexOf(array, value, index); } /** * Gets all but the last element of `array`. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to query. * @returns {Array} Returns the slice of `array`. * @example * * _.initial([1, 2, 3]); * // => [1, 2] */ function initial(array) { var length = array == null ? 0 : array.length; return length ? baseSlice(array, 0, -1) : []; } /** * Creates an array of unique values that are included in all given arrays * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. The order and references of result values are * determined by the first array. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @returns {Array} Returns the new array of intersecting values. * @example * * _.intersection([2, 1], [2, 3]); * // => [2] */ var intersection = baseRest(function(arrays) { var mapped = arrayMap(arrays, castArrayLikeObject); return (mapped.length && mapped[0] === arrays[0]) ? baseIntersection(mapped) : []; }); /** * This method is like `_.intersection` except that it accepts `iteratee` * which is invoked for each element of each `arrays` to generate the criterion * by which they're compared. The order and references of result values are * determined by the first array. The iteratee is invoked with one argument: * (value). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Array} Returns the new array of intersecting values. * @example * * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor); * // => [2.1] * * // The `_.property` iteratee shorthand. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); * // => [{ 'x': 1 }] */ var intersectionBy = baseRest(function(arrays) { var iteratee = last(arrays), mapped = arrayMap(arrays, castArrayLikeObject); if (iteratee === last(mapped)) { iteratee = undefined; } else { mapped.pop(); } return (mapped.length && mapped[0] === arrays[0]) ? baseIntersection(mapped, getIteratee(iteratee, 2)) : []; }); /** * This method is like `_.intersection` except that it accepts `comparator` * which is invoked to compare elements of `arrays`. The order and references * of result values are determined by the first array. The comparator is * invoked with two arguments: (arrVal, othVal). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of intersecting values. * @example * * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; * * _.intersectionWith(objects, others, _.isEqual); * // => [{ 'x': 1, 'y': 2 }] */ var intersectionWith = baseRest(function(arrays) { var comparator = last(arrays), mapped = arrayMap(arrays, castArrayLikeObject); comparator = typeof comparator == 'function' ? comparator : undefined; if (comparator) { mapped.pop(); } return (mapped.length && mapped[0] === arrays[0]) ? baseIntersection(mapped, undefined, comparator) : []; }); /** * Converts all elements in `array` into a string separated by `separator`. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to convert. * @param {string} [separator=','] The element separator. * @returns {string} Returns the joined string. * @example * * _.join(['a', 'b', 'c'], '~'); * // => 'a~b~c' */ function join(array, separator) { return array == null ? '' : nativeJoin.call(array, separator); } /** * Gets the last element of `array`. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to query. * @returns {*} Returns the last element of `array`. * @example * * _.last([1, 2, 3]); * // => 3 */ function last(array) { var length = array == null ? 0 : array.length; return length ? array[length - 1] : undefined; } /** * This method is like `_.indexOf` except that it iterates over elements of * `array` from right to left. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} [fromIndex=array.length-1] The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. * @example * * _.lastIndexOf([1, 2, 1, 2], 2); * // => 3 * * // Search from the `fromIndex`. * _.lastIndexOf([1, 2, 1, 2], 2, 2); * // => 1 */ function lastIndexOf(array, value, fromIndex) { var length = array == null ? 0 : array.length; if (!length) { return -1; } var index = length; if (fromIndex !== undefined) { index = toInteger(fromIndex); index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); } return value === value ? strictLastIndexOf(array, value, index) : baseFindIndex(array, baseIsNaN, index, true); } /** * Gets the element at index `n` of `array`. If `n` is negative, the nth * element from the end is returned. * * @static * @memberOf _ * @since 4.11.0 * @category Array * @param {Array} array The array to query. * @param {number} [n=0] The index of the element to return. * @returns {*} Returns the nth element of `array`. * @example * * var array = ['a', 'b', 'c', 'd']; * * _.nth(array, 1); * // => 'b' * * _.nth(array, -2); * // => 'c'; */ function nth(array, n) { return (array && array.length) ? baseNth(array, toInteger(n)) : undefined; } /** * Removes all given values from `array` using * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove` * to remove elements from an array by predicate. * * @static * @memberOf _ * @since 2.0.0 * @category Array * @param {Array} array The array to modify. * @param {...*} [values] The values to remove. * @returns {Array} Returns `array`. * @example * * var array = ['a', 'b', 'c', 'a', 'b', 'c']; * * _.pull(array, 'a', 'c'); * console.log(array); * // => ['b', 'b'] */ var pull = baseRest(pullAll); /** * This method is like `_.pull` except that it accepts an array of values to remove. * * **Note:** Unlike `_.difference`, this method mutates `array`. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to modify. * @param {Array} values The values to remove. * @returns {Array} Returns `array`. * @example * * var array = ['a', 'b', 'c', 'a', 'b', 'c']; * * _.pullAll(array, ['a', 'c']); * console.log(array); * // => ['b', 'b'] */ function pullAll(array, values) { return (array && array.length && values && values.length) ? basePullAll(array, values) : array; } /** * This method is like `_.pullAll` except that it accepts `iteratee` which is * invoked for each element of `array` and `values` to generate the criterion * by which they're compared. The iteratee is invoked with one argument: (value). * * **Note:** Unlike `_.differenceBy`, this method mutates `array`. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to modify. * @param {Array} values The values to remove. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Array} Returns `array`. * @example * * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; * * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); * console.log(array); * // => [{ 'x': 2 }] */ function pullAllBy(array, values, iteratee) { return (array && array.length && values && values.length) ? basePullAll(array, values, getIteratee(iteratee, 2)) : array; } /** * This method is like `_.pullAll` except that it accepts `comparator` which * is invoked to compare elements of `array` to `values`. The comparator is * invoked with two arguments: (arrVal, othVal). * * **Note:** Unlike `_.differenceWith`, this method mutates `array`. * * @static * @memberOf _ * @since 4.6.0 * @category Array * @param {Array} array The array to modify. * @param {Array} values The values to remove. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns `array`. * @example * * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; * * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); * console.log(array); * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] */ function pullAllWith(array, values, comparator) { return (array && array.length && values && values.length) ? basePullAll(array, values, undefined, comparator) : array; } /** * Removes elements from `array` corresponding to `indexes` and returns an * array of removed elements. * * **Note:** Unlike `_.at`, this method mutates `array`. * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to modify. * @param {...(number|number[])} [indexes] The indexes of elements to remove. * @returns {Array} Returns the new array of removed elements. * @example * * var array = ['a', 'b', 'c', 'd']; * var pulled = _.pullAt(array, [1, 3]); * * console.log(array); * // => ['a', 'c'] * * console.log(pulled); * // => ['b', 'd'] */ var pullAt = flatRest(function(array, indexes) { var length = array == null ? 0 : array.length, result = baseAt(array, indexes); basePullAt(array, arrayMap(indexes, function(index) { return isIndex(index, length) ? +index : index; }).sort(compareAscending)); return result; }); /** * Removes all elements from `array` that `predicate` returns truthy for * and returns an array of the removed elements. The predicate is invoked * with three arguments: (value, index, array). * * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull` * to pull elements from an array by value. * * @static * @memberOf _ * @since 2.0.0 * @category Array * @param {Array} array The array to modify. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the new array of removed elements. * @example * * var array = [1, 2, 3, 4]; * var evens = _.remove(array, function(n) { * return n % 2 == 0; * }); * * console.log(array); * // => [1, 3] * * console.log(evens); * // => [2, 4] */ function remove(array, predicate) { var result = []; if (!(array && array.length)) { return result; } var index = -1, indexes = [], length = array.length; predicate = getIteratee(predicate, 3); while (++index < length) { var value = array[index]; if (predicate(value, index, array)) { result.push(value); indexes.push(index); } } basePullAt(array, indexes); return result; } /** * Reverses `array` so that the first element becomes the last, the second * element becomes the second to last, and so on. * * **Note:** This method mutates `array` and is based on * [`Array#reverse`](https://mdn.io/Array/reverse). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to modify. * @returns {Array} Returns `array`. * @example * * var array = [1, 2, 3]; * * _.reverse(array); * // => [3, 2, 1] * * console.log(array); * // => [3, 2, 1] */ function reverse(array) { return array == null ? array : nativeReverse.call(array); } /** * Creates a slice of `array` from `start` up to, but not including, `end`. * * **Note:** This method is used instead of * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are * returned. * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to slice. * @param {number} [start=0] The start position. * @param {number} [end=array.length] The end position. * @returns {Array} Returns the slice of `array`. */ function slice(array, start, end) { var length = array == null ? 0 : array.length; if (!length) { return []; } if (end && typeof end != 'number' && isIterateeCall(array, start, end)) { start = 0; end = length; } else { start = start == null ? 0 : toInteger(start); end = end === undefined ? length : toInteger(end); } return baseSlice(array, start, end); } /** * Uses a binary search to determine the lowest index at which `value` * should be inserted into `array` in order to maintain its sort order. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. * @returns {number} Returns the index at which `value` should be inserted * into `array`. * @example * * _.sortedIndex([30, 50], 40); * // => 1 */ function sortedIndex(array, value) { return baseSortedIndex(array, value); } /** * This method is like `_.sortedIndex` except that it accepts `iteratee` * which is invoked for `value` and each element of `array` to compute their * sort ranking. The iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {number} Returns the index at which `value` should be inserted * into `array`. * @example * * var objects = [{ 'x': 4 }, { 'x': 5 }]; * * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); * // => 0 * * // The `_.property` iteratee shorthand. * _.sortedIndexBy(objects, { 'x': 4 }, 'x'); * // => 0 */ function sortedIndexBy(array, value, iteratee) { return baseSortedIndexBy(array, value, getIteratee(iteratee, 2)); } /** * This method is like `_.indexOf` except that it performs a binary * search on a sorted `array`. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @returns {number} Returns the index of the matched value, else `-1`. * @example * * _.sortedIndexOf([4, 5, 5, 5, 6], 5); * // => 1 */ function sortedIndexOf(array, value) { var length = array == null ? 0 : array.length; if (length) { var index = baseSortedIndex(array, value); if (index < length && eq(array[index], value)) { return index; } } return -1; } /** * This method is like `_.sortedIndex` except that it returns the highest * index at which `value` should be inserted into `array` in order to * maintain its sort order. * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. * @returns {number} Returns the index at which `value` should be inserted * into `array`. * @example * * _.sortedLastIndex([4, 5, 5, 5, 6], 5); * // => 4 */ function sortedLastIndex(array, value) { return baseSortedIndex(array, value, true); } /** * This method is like `_.sortedLastIndex` except that it accepts `iteratee` * which is invoked for `value` and each element of `array` to compute their * sort ranking. The iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {number} Returns the index at which `value` should be inserted * into `array`. * @example * * var objects = [{ 'x': 4 }, { 'x': 5 }]; * * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); * // => 1 * * // The `_.property` iteratee shorthand. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x'); * // => 1 */ function sortedLastIndexBy(array, value, iteratee) { return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true); } /** * This method is like `_.lastIndexOf` except that it performs a binary * search on a sorted `array`. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @returns {number} Returns the index of the matched value, else `-1`. * @example * * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5); * // => 3 */ function sortedLastIndexOf(array, value) { var length = array == null ? 0 : array.length; if (length) { var index = baseSortedIndex(array, value, true) - 1; if (eq(array[index], value)) { return index; } } return -1; } /** * This method is like `_.uniq` except that it's designed and optimized * for sorted arrays. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @returns {Array} Returns the new duplicate free array. * @example * * _.sortedUniq([1, 1, 2]); * // => [1, 2] */ function sortedUniq(array) { return (array && array.length) ? baseSortedUniq(array) : []; } /** * This method is like `_.uniqBy` except that it's designed and optimized * for sorted arrays. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {Function} [iteratee] The iteratee invoked per element. * @returns {Array} Returns the new duplicate free array. * @example * * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); * // => [1.1, 2.3] */ function sortedUniqBy(array, iteratee) { return (array && array.length) ? baseSortedUniq(array, getIteratee(iteratee, 2)) : []; } /** * Gets all but the first element of `array`. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to query. * @returns {Array} Returns the slice of `array`. * @example * * _.tail([1, 2, 3]); * // => [2, 3] */ function tail(array) { var length = array == null ? 0 : array.length; return length ? baseSlice(array, 1, length) : []; } /** * Creates a slice of `array` with `n` elements taken from the beginning. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to query. * @param {number} [n=1] The number of elements to take. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the slice of `array`. * @example * * _.take([1, 2, 3]); * // => [1] * * _.take([1, 2, 3], 2); * // => [1, 2] * * _.take([1, 2, 3], 5); * // => [1, 2, 3] * * _.take([1, 2, 3], 0); * // => [] */ function take(array, n, guard) { if (!(array && array.length)) { return []; } n = (guard || n === undefined) ? 1 : toInteger(n); return baseSlice(array, 0, n < 0 ? 0 : n); } /** * Creates a slice of `array` with `n` elements taken from the end. * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to query. * @param {number} [n=1] The number of elements to take. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the slice of `array`. * @example * * _.takeRight([1, 2, 3]); * // => [3] * * _.takeRight([1, 2, 3], 2); * // => [2, 3] * * _.takeRight([1, 2, 3], 5); * // => [1, 2, 3] * * _.takeRight([1, 2, 3], 0); * // => [] */ function takeRight(array, n, guard) { var length = array == null ? 0 : array.length; if (!length) { return []; } n = (guard || n === undefined) ? 1 : toInteger(n); n = length - n; return baseSlice(array, n < 0 ? 0 : n, length); } /** * Creates a slice of `array` with elements taken from the end. Elements are * taken until `predicate` returns falsey. The predicate is invoked with * three arguments: (value, index, array). * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to query. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the slice of `array`. * @example * * var users = [ * { 'user': 'barney', 'active': true }, * { 'user': 'fred', 'active': false }, * { 'user': 'pebbles', 'active': false } * ]; * * _.takeRightWhile(users, function(o) { return !o.active; }); * // => objects for ['fred', 'pebbles'] * * // The `_.matches` iteratee shorthand. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false }); * // => objects for ['pebbles'] * * // The `_.matchesProperty` iteratee shorthand. * _.takeRightWhile(users, ['active', false]); * // => objects for ['fred', 'pebbles'] * * // The `_.property` iteratee shorthand. * _.takeRightWhile(users, 'active'); * // => [] */ function takeRightWhile(array, predicate) { return (array && array.length) ? baseWhile(array, getIteratee(predicate, 3), false, true) : []; } /** * Creates a slice of `array` with elements taken from the beginning. Elements * are taken until `predicate` returns falsey. The predicate is invoked with * three arguments: (value, index, array). * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to query. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the slice of `array`. * @example * * var users = [ * { 'user': 'barney', 'active': false }, * { 'user': 'fred', 'active': false }, * { 'user': 'pebbles', 'active': true } * ]; * * _.takeWhile(users, function(o) { return !o.active; }); * // => objects for ['barney', 'fred'] * * // The `_.matches` iteratee shorthand. * _.takeWhile(users, { 'user': 'barney', 'active': false }); * // => objects for ['barney'] * * // The `_.matchesProperty` iteratee shorthand. * _.takeWhile(users, ['active', false]); * // => objects for ['barney', 'fred'] * * // The `_.property` iteratee shorthand. * _.takeWhile(users, 'active'); * // => [] */ function takeWhile(array, predicate) { return (array && array.length) ? baseWhile(array, getIteratee(predicate, 3)) : []; } /** * Creates an array of unique values, in order, from all given arrays using * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @returns {Array} Returns the new array of combined values. * @example * * _.union([2], [1, 2]); * // => [2, 1] */ var union = baseRest(function(arrays) { return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); }); /** * This method is like `_.union` except that it accepts `iteratee` which is * invoked for each element of each `arrays` to generate the criterion by * which uniqueness is computed. Result values are chosen from the first * array in which the value occurs. The iteratee is invoked with one argument: * (value). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Array} Returns the new array of combined values. * @example * * _.unionBy([2.1], [1.2, 2.3], Math.floor); * // => [2.1, 1.2] * * // The `_.property` iteratee shorthand. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); * // => [{ 'x': 1 }, { 'x': 2 }] */ var unionBy = baseRest(function(arrays) { var iteratee = last(arrays); if (isArrayLikeObject(iteratee)) { iteratee = undefined; } return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)); }); /** * This method is like `_.union` except that it accepts `comparator` which * is invoked to compare elements of `arrays`. Result values are chosen from * the first array in which the value occurs. The comparator is invoked * with two arguments: (arrVal, othVal). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of combined values. * @example * * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; * * _.unionWith(objects, others, _.isEqual); * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] */ var unionWith = baseRest(function(arrays) { var comparator = last(arrays); comparator = typeof comparator == 'function' ? comparator : undefined; return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator); }); /** * Creates a duplicate-free version of an array, using * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons, in which only the first occurrence of each element * is kept. The order of result values is determined by the order they occur * in the array. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to inspect. * @returns {Array} Returns the new duplicate free array. * @example * * _.uniq([2, 1, 2]); * // => [2, 1] */ function uniq(array) { return (array && array.length) ? baseUniq(array) : []; } /** * This method is like `_.uniq` except that it accepts `iteratee` which is * invoked for each element in `array` to generate the criterion by which * uniqueness is computed. The order of result values is determined by the * order they occur in the array. The iteratee is invoked with one argument: * (value). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Array} Returns the new duplicate free array. * @example * * _.uniqBy([2.1, 1.2, 2.3], Math.floor); * // => [2.1, 1.2] * * // The `_.property` iteratee shorthand. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); * // => [{ 'x': 1 }, { 'x': 2 }] */ function uniqBy(array, iteratee) { return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : []; } /** * This method is like `_.uniq` except that it accepts `comparator` which * is invoked to compare elements of `array`. The order of result values is * determined by the order they occur in the array.The comparator is invoked * with two arguments: (arrVal, othVal). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new duplicate free array. * @example * * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; * * _.uniqWith(objects, _.isEqual); * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] */ function uniqWith(array, comparator) { comparator = typeof comparator == 'function' ? comparator : undefined; return (array && array.length) ? baseUniq(array, undefined, comparator) : []; } /** * This method is like `_.zip` except that it accepts an array of grouped * elements and creates an array regrouping the elements to their pre-zip * configuration. * * @static * @memberOf _ * @since 1.2.0 * @category Array * @param {Array} array The array of grouped elements to process. * @returns {Array} Returns the new array of regrouped elements. * @example * * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]); * // => [['a', 1, true], ['b', 2, false]] * * _.unzip(zipped); * // => [['a', 'b'], [1, 2], [true, false]] */ function unzip(array) { if (!(array && array.length)) { return []; } var length = 0; array = arrayFilter(array, function(group) { if (isArrayLikeObject(group)) { length = nativeMax(group.length, length); return true; } }); return baseTimes(length, function(index) { return arrayMap(array, baseProperty(index)); }); } /** * This method is like `_.unzip` except that it accepts `iteratee` to specify * how regrouped values should be combined. The iteratee is invoked with the * elements of each group: (...group). * * @static * @memberOf _ * @since 3.8.0 * @category Array * @param {Array} array The array of grouped elements to process. * @param {Function} [iteratee=_.identity] The function to combine * regrouped values. * @returns {Array} Returns the new array of regrouped elements. * @example * * var zipped = _.zip([1, 2], [10, 20], [100, 200]); * // => [[1, 10, 100], [2, 20, 200]] * * _.unzipWith(zipped, _.add); * // => [3, 30, 300] */ function unzipWith(array, iteratee) { if (!(array && array.length)) { return []; } var result = unzip(array); if (iteratee == null) { return result; } return arrayMap(result, function(group) { return apply(iteratee, undefined, group); }); } /** * Creates an array excluding all given values using * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * * **Note:** Unlike `_.pull`, this method returns a new array. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to inspect. * @param {...*} [values] The values to exclude. * @returns {Array} Returns the new array of filtered values. * @see _.difference, _.xor * @example * * _.without([2, 1, 2, 3], 1, 2); * // => [3] */ var without = baseRest(function(array, values) { return isArrayLikeObject(array) ? baseDifference(array, values) : []; }); /** * Creates an array of unique values that is the * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) * of the given arrays. The order of result values is determined by the order * they occur in the arrays. * * @static * @memberOf _ * @since 2.4.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @returns {Array} Returns the new array of filtered values. * @see _.difference, _.without * @example * * _.xor([2, 1], [2, 3]); * // => [1, 3] */ var xor = baseRest(function(arrays) { return baseXor(arrayFilter(arrays, isArrayLikeObject)); }); /** * This method is like `_.xor` except that it accepts `iteratee` which is * invoked for each element of each `arrays` to generate the criterion by * which by which they're compared. The order of result values is determined * by the order they occur in the arrays. The iteratee is invoked with one * argument: (value). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Array} Returns the new array of filtered values. * @example * * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor); * // => [1.2, 3.4] * * // The `_.property` iteratee shorthand. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); * // => [{ 'x': 2 }] */ var xorBy = baseRest(function(arrays) { var iteratee = last(arrays); if (isArrayLikeObject(iteratee)) { iteratee = undefined; } return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2)); }); /** * This method is like `_.xor` except that it accepts `comparator` which is * invoked to compare elements of `arrays`. The order of result values is * determined by the order they occur in the arrays. The comparator is invoked * with two arguments: (arrVal, othVal). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of filtered values. * @example * * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; * * _.xorWith(objects, others, _.isEqual); * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] */ var xorWith = baseRest(function(arrays) { var comparator = last(arrays); comparator = typeof comparator == 'function' ? comparator : undefined; return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator); }); /** * Creates an array of grouped elements, the first of which contains the * first elements of the given arrays, the second of which contains the * second elements of the given arrays, and so on. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {...Array} [arrays] The arrays to process. * @returns {Array} Returns the new array of grouped elements. * @example * * _.zip(['a', 'b'], [1, 2], [true, false]); * // => [['a', 1, true], ['b', 2, false]] */ var zip = baseRest(unzip); /** * This method is like `_.fromPairs` except that it accepts two arrays, * one of property identifiers and one of corresponding values. * * @static * @memberOf _ * @since 0.4.0 * @category Array * @param {Array} [props=[]] The property identifiers. * @param {Array} [values=[]] The property values. * @returns {Object} Returns the new object. * @example * * _.zipObject(['a', 'b'], [1, 2]); * // => { 'a': 1, 'b': 2 } */ function zipObject(props, values) { return baseZipObject(props || [], values || [], assignValue); } /** * This method is like `_.zipObject` except that it supports property paths. * * @static * @memberOf _ * @since 4.1.0 * @category Array * @param {Array} [props=[]] The property identifiers. * @param {Array} [values=[]] The property values. * @returns {Object} Returns the new object. * @example * * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]); * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } } */ function zipObjectDeep(props, values) { return baseZipObject(props || [], values || [], baseSet); } /** * This method is like `_.zip` except that it accepts `iteratee` to specify * how grouped values should be combined. The iteratee is invoked with the * elements of each group: (...group). * * @static * @memberOf _ * @since 3.8.0 * @category Array * @param {...Array} [arrays] The arrays to process. * @param {Function} [iteratee=_.identity] The function to combine * grouped values. * @returns {Array} Returns the new array of grouped elements. * @example * * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) { * return a + b + c; * }); * // => [111, 222] */ var zipWith = baseRest(function(arrays) { var length = arrays.length, iteratee = length > 1 ? arrays[length - 1] : undefined; iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined; return unzipWith(arrays, iteratee); }); /*------------------------------------------------------------------------*/ /** * Creates a `lodash` wrapper instance that wraps `value` with explicit method * chain sequences enabled. The result of such sequences must be unwrapped * with `_#value`. * * @static * @memberOf _ * @since 1.3.0 * @category Seq * @param {*} value The value to wrap. * @returns {Object} Returns the new `lodash` wrapper instance. * @example * * var users = [ * { 'user': 'barney', 'age': 36 }, * { 'user': 'fred', 'age': 40 }, * { 'user': 'pebbles', 'age': 1 } * ]; * * var youngest = _ * .chain(users) * .sortBy('age') * .map(function(o) { * return o.user + ' is ' + o.age; * }) * .head() * .value(); * // => 'pebbles is 1' */ function chain(value) { var result = lodash(value); result.__chain__ = true; return result; } /** * This method invokes `interceptor` and returns `value`. The interceptor * is invoked with one argument; (value). The purpose of this method is to * "tap into" a method chain sequence in order to modify intermediate results. * * @static * @memberOf _ * @since 0.1.0 * @category Seq * @param {*} value The value to provide to `interceptor`. * @param {Function} interceptor The function to invoke. * @returns {*} Returns `value`. * @example * * _([1, 2, 3]) * .tap(function(array) { * // Mutate input array. * array.pop(); * }) * .reverse() * .value(); * // => [2, 1] */ function tap(value, interceptor) { interceptor(value); return value; } /** * This method is like `_.tap` except that it returns the result of `interceptor`. * The purpose of this method is to "pass thru" values replacing intermediate * results in a method chain sequence. * * @static * @memberOf _ * @since 3.0.0 * @category Seq * @param {*} value The value to provide to `interceptor`. * @param {Function} interceptor The function to invoke. * @returns {*} Returns the result of `interceptor`. * @example * * _(' abc ') * .chain() * .trim() * .thru(function(value) { * return [value]; * }) * .value(); * // => ['abc'] */ function thru(value, interceptor) { return interceptor(value); } /** * This method is the wrapper version of `_.at`. * * @name at * @memberOf _ * @since 1.0.0 * @category Seq * @param {...(string|string[])} [paths] The property paths to pick. * @returns {Object} Returns the new `lodash` wrapper instance. * @example * * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; * * _(object).at(['a[0].b.c', 'a[1]']).value(); * // => [3, 4] */ var wrapperAt = flatRest(function(paths) { var length = paths.length, start = length ? paths[0] : 0, value = this.__wrapped__, interceptor = function(object) { return baseAt(object, paths); }; if (length > 1 || this.__actions__.length || !(value instanceof LazyWrapper) || !isIndex(start)) { return this.thru(interceptor); } value = value.slice(start, +start + (length ? 1 : 0)); value.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined }); return new LodashWrapper(value, this.__chain__).thru(function(array) { if (length && !array.length) { array.push(undefined); } return array; }); }); /** * Creates a `lodash` wrapper instance with explicit method chain sequences enabled. * * @name chain * @memberOf _ * @since 0.1.0 * @category Seq * @returns {Object} Returns the new `lodash` wrapper instance. * @example * * var users = [ * { 'user': 'barney', 'age': 36 }, * { 'user': 'fred', 'age': 40 } * ]; * * // A sequence without explicit chaining. * _(users).head(); * // => { 'user': 'barney', 'age': 36 } * * // A sequence with explicit chaining. * _(users) * .chain() * .head() * .pick('user') * .value(); * // => { 'user': 'barney' } */ function wrapperChain() { return chain(this); } /** * Executes the chain sequence and returns the wrapped result. * * @name commit * @memberOf _ * @since 3.2.0 * @category Seq * @returns {Object} Returns the new `lodash` wrapper instance. * @example * * var array = [1, 2]; * var wrapped = _(array).push(3); * * console.log(array); * // => [1, 2] * * wrapped = wrapped.commit(); * console.log(array); * // => [1, 2, 3] * * wrapped.last(); * // => 3 * * console.log(array); * // => [1, 2, 3] */ function wrapperCommit() { return new LodashWrapper(this.value(), this.__chain__); } /** * Gets the next value on a wrapped object following the * [iterator protocol](https://mdn.io/iteration_protocols#iterator). * * @name next * @memberOf _ * @since 4.0.0 * @category Seq * @returns {Object} Returns the next iterator value. * @example * * var wrapped = _([1, 2]); * * wrapped.next(); * // => { 'done': false, 'value': 1 } * * wrapped.next(); * // => { 'done': false, 'value': 2 } * * wrapped.next(); * // => { 'done': true, 'value': undefined } */ function wrapperNext() { if (this.__values__ === undefined) { this.__values__ = toArray(this.value()); } var done = this.__index__ >= this.__values__.length, value = done ? undefined : this.__values__[this.__index__++]; return { 'done': done, 'value': value }; } /** * Enables the wrapper to be iterable. * * @name Symbol.iterator * @memberOf _ * @since 4.0.0 * @category Seq * @returns {Object} Returns the wrapper object. * @example * * var wrapped = _([1, 2]); * * wrapped[Symbol.iterator]() === wrapped; * // => true * * Array.from(wrapped); * // => [1, 2] */ function wrapperToIterator() { return this; } /** * Creates a clone of the chain sequence planting `value` as the wrapped value. * * @name plant * @memberOf _ * @since 3.2.0 * @category Seq * @param {*} value The value to plant. * @returns {Object} Returns the new `lodash` wrapper instance. * @example * * function square(n) { * return n * n; * } * * var wrapped = _([1, 2]).map(square); * var other = wrapped.plant([3, 4]); * * other.value(); * // => [9, 16] * * wrapped.value(); * // => [1, 4] */ function wrapperPlant(value) { var result, parent = this; while (parent instanceof baseLodash) { var clone = wrapperClone(parent); clone.__index__ = 0; clone.__values__ = undefined; if (result) { previous.__wrapped__ = clone; } else { result = clone; } var previous = clone; parent = parent.__wrapped__; } previous.__wrapped__ = value; return result; } /** * This method is the wrapper version of `_.reverse`. * * **Note:** This method mutates the wrapped array. * * @name reverse * @memberOf _ * @since 0.1.0 * @category Seq * @returns {Object} Returns the new `lodash` wrapper instance. * @example * * var array = [1, 2, 3]; * * _(array).reverse().value() * // => [3, 2, 1] * * console.log(array); * // => [3, 2, 1] */ function wrapperReverse() { var value = this.__wrapped__; if (value instanceof LazyWrapper) { var wrapped = value; if (this.__actions__.length) { wrapped = new LazyWrapper(this); } wrapped = wrapped.reverse(); wrapped.__actions__.push({ 'func': thru, 'args': [reverse], 'thisArg': undefined }); return new LodashWrapper(wrapped, this.__chain__); } return this.thru(reverse); } /** * Executes the chain sequence to resolve the unwrapped value. * * @name value * @memberOf _ * @since 0.1.0 * @alias toJSON, valueOf * @category Seq * @returns {*} Returns the resolved unwrapped value. * @example * * _([1, 2, 3]).value(); * // => [1, 2, 3] */ function wrapperValue() { return baseWrapperValue(this.__wrapped__, this.__actions__); } /*------------------------------------------------------------------------*/ /** * Creates an object composed of keys generated from the results of running * each element of `collection` thru `iteratee`. The corresponding value of * each key is the number of times the key was returned by `iteratee`. The * iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 0.5.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The iteratee to transform keys. * @returns {Object} Returns the composed aggregate object. * @example * * _.countBy([6.1, 4.2, 6.3], Math.floor); * // => { '4': 1, '6': 2 } * * // The `_.property` iteratee shorthand. * _.countBy(['one', 'two', 'three'], 'length'); * // => { '3': 2, '5': 1 } */ var countBy = createAggregator(function(result, value, key) { if (hasOwnProperty.call(result, key)) { ++result[key]; } else { baseAssignValue(result, key, 1); } }); /** * Checks if `predicate` returns truthy for **all** elements of `collection`. * Iteration is stopped once `predicate` returns falsey. The predicate is * invoked with three arguments: (value, index|key, collection). * * **Note:** This method returns `true` for * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of * elements of empty collections. * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {boolean} Returns `true` if all elements pass the predicate check, * else `false`. * @example * * _.every([true, 1, null, 'yes'], Boolean); * // => false * * var users = [ * { 'user': 'barney', 'age': 36, 'active': false }, * { 'user': 'fred', 'age': 40, 'active': false } * ]; * * // The `_.matches` iteratee shorthand. * _.every(users, { 'user': 'barney', 'active': false }); * // => false * * // The `_.matchesProperty` iteratee shorthand. * _.every(users, ['active', false]); * // => true * * // The `_.property` iteratee shorthand. * _.every(users, 'active'); * // => false */ function every(collection, predicate, guard) { var func = isArray(collection) ? arrayEvery : baseEvery; if (guard && isIterateeCall(collection, predicate, guard)) { predicate = undefined; } return func(collection, getIteratee(predicate, 3)); } /** * Iterates over elements of `collection`, returning an array of all elements * `predicate` returns truthy for. The predicate is invoked with three * arguments: (value, index|key, collection). * * **Note:** Unlike `_.remove`, this method returns a new array. * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the new filtered array. * @see _.reject * @example * * var users = [ * { 'user': 'barney', 'age': 36, 'active': true }, * { 'user': 'fred', 'age': 40, 'active': false } * ]; * * _.filter(users, function(o) { return !o.active; }); * // => objects for ['fred'] * * // The `_.matches` iteratee shorthand. * _.filter(users, { 'age': 36, 'active': true }); * // => objects for ['barney'] * * // The `_.matchesProperty` iteratee shorthand. * _.filter(users, ['active', false]); * // => objects for ['fred'] * * // The `_.property` iteratee shorthand. * _.filter(users, 'active'); * // => objects for ['barney'] * * // Combining several predicates using `_.overEvery` or `_.overSome`. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]])); * // => objects for ['fred', 'barney'] */ function filter(collection, predicate) { var func = isArray(collection) ? arrayFilter : baseFilter; return func(collection, getIteratee(predicate, 3)); } /** * Iterates over elements of `collection`, returning the first element * `predicate` returns truthy for. The predicate is invoked with three * arguments: (value, index|key, collection). * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to inspect. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @param {number} [fromIndex=0] The index to search from. * @returns {*} Returns the matched element, else `undefined`. * @example * * var users = [ * { 'user': 'barney', 'age': 36, 'active': true }, * { 'user': 'fred', 'age': 40, 'active': false }, * { 'user': 'pebbles', 'age': 1, 'active': true } * ]; * * _.find(users, function(o) { return o.age < 40; }); * // => object for 'barney' * * // The `_.matches` iteratee shorthand. * _.find(users, { 'age': 1, 'active': true }); * // => object for 'pebbles' * * // The `_.matchesProperty` iteratee shorthand. * _.find(users, ['active', false]); * // => object for 'fred' * * // The `_.property` iteratee shorthand. * _.find(users, 'active'); * // => object for 'barney' */ var find = createFind(findIndex); /** * This method is like `_.find` except that it iterates over elements of * `collection` from right to left. * * @static * @memberOf _ * @since 2.0.0 * @category Collection * @param {Array|Object} collection The collection to inspect. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @param {number} [fromIndex=collection.length-1] The index to search from. * @returns {*} Returns the matched element, else `undefined`. * @example * * _.findLast([1, 2, 3, 4], function(n) { * return n % 2 == 1; * }); * // => 3 */ var findLast = createFind(findLastIndex); /** * Creates a flattened array of values by running each element in `collection` * thru `iteratee` and flattening the mapped results. The iteratee is invoked * with three arguments: (value, index|key, collection). * * @static * @memberOf _ * @since 4.0.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Array} Returns the new flattened array. * @example * * function duplicate(n) { * return [n, n]; * } * * _.flatMap([1, 2], duplicate); * // => [1, 1, 2, 2] */ function flatMap(collection, iteratee) { return baseFlatten(map(collection, iteratee), 1); } /** * This method is like `_.flatMap` except that it recursively flattens the * mapped results. * * @static * @memberOf _ * @since 4.7.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Array} Returns the new flattened array. * @example * * function duplicate(n) { * return [[[n, n]]]; * } * * _.flatMapDeep([1, 2], duplicate); * // => [1, 1, 2, 2] */ function flatMapDeep(collection, iteratee) { return baseFlatten(map(collection, iteratee), INFINITY); } /** * This method is like `_.flatMap` except that it recursively flattens the * mapped results up to `depth` times. * * @static * @memberOf _ * @since 4.7.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @param {number} [depth=1] The maximum recursion depth. * @returns {Array} Returns the new flattened array. * @example * * function duplicate(n) { * return [[[n, n]]]; * } * * _.flatMapDepth([1, 2], duplicate, 2); * // => [[1, 1], [2, 2]] */ function flatMapDepth(collection, iteratee, depth) { depth = depth === undefined ? 1 : toInteger(depth); return baseFlatten(map(collection, iteratee), depth); } /** * Iterates over elements of `collection` and invokes `iteratee` for each element. * The iteratee is invoked with three arguments: (value, index|key, collection). * Iteratee functions may exit iteration early by explicitly returning `false`. * * **Note:** As with other "Collections" methods, objects with a "length" * property are iterated like arrays. To avoid this behavior use `_.forIn` * or `_.forOwn` for object iteration. * * @static * @memberOf _ * @since 0.1.0 * @alias each * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Array|Object} Returns `collection`. * @see _.forEachRight * @example * * _.forEach([1, 2], function(value) { * console.log(value); * }); * // => Logs `1` then `2`. * * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { * console.log(key); * }); * // => Logs 'a' then 'b' (iteration order is not guaranteed). */ function forEach(collection, iteratee) { var func = isArray(collection) ? arrayEach : baseEach; return func(collection, getIteratee(iteratee, 3)); } /** * This method is like `_.forEach` except that it iterates over elements of * `collection` from right to left. * * @static * @memberOf _ * @since 2.0.0 * @alias eachRight * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Array|Object} Returns `collection`. * @see _.forEach * @example * * _.forEachRight([1, 2], function(value) { * console.log(value); * }); * // => Logs `2` then `1`. */ function forEachRight(collection, iteratee) { var func = isArray(collection) ? arrayEachRight : baseEachRight; return func(collection, getIteratee(iteratee, 3)); } /** * Creates an object composed of keys generated from the results of running * each element of `collection` thru `iteratee`. The order of grouped values * is determined by the order they occur in `collection`. The corresponding * value of each key is an array of elements responsible for generating the * key. The iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The iteratee to transform keys. * @returns {Object} Returns the composed aggregate object. * @example * * _.groupBy([6.1, 4.2, 6.3], Math.floor); * // => { '4': [4.2], '6': [6.1, 6.3] } * * // The `_.property` iteratee shorthand. * _.groupBy(['one', 'two', 'three'], 'length'); * // => { '3': ['one', 'two'], '5': ['three'] } */ var groupBy = createAggregator(function(result, value, key) { if (hasOwnProperty.call(result, key)) { result[key].push(value); } else { baseAssignValue(result, key, [value]); } }); /** * Checks if `value` is in `collection`. If `collection` is a string, it's * checked for a substring of `value`, otherwise * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * is used for equality comparisons. If `fromIndex` is negative, it's used as * the offset from the end of `collection`. * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object|string} collection The collection to inspect. * @param {*} value The value to search for. * @param {number} [fromIndex=0] The index to search from. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. * @returns {boolean} Returns `true` if `value` is found, else `false`. * @example * * _.includes([1, 2, 3], 1); * // => true * * _.includes([1, 2, 3], 1, 2); * // => false * * _.includes({ 'a': 1, 'b': 2 }, 1); * // => true * * _.includes('abcd', 'bc'); * // => true */ function includes(collection, value, fromIndex, guard) { collection = isArrayLike(collection) ? collection : values(collection); fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; var length = collection.length; if (fromIndex < 0) { fromIndex = nativeMax(length + fromIndex, 0); } return isString(collection) ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) : (!!length && baseIndexOf(collection, value, fromIndex) > -1); } /** * Invokes the method at `path` of each element in `collection`, returning * an array of the results of each invoked method. Any additional arguments * are provided to each invoked method. If `path` is a function, it's invoked * for, and `this` bound to, each element in `collection`. * * @static * @memberOf _ * @since 4.0.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Array|Function|string} path The path of the method to invoke or * the function invoked per iteration. * @param {...*} [args] The arguments to invoke each method with. * @returns {Array} Returns the array of results. * @example * * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort'); * // => [[1, 5, 7], [1, 2, 3]] * * _.invokeMap([123, 456], String.prototype.split, ''); * // => [['1', '2', '3'], ['4', '5', '6']] */ var invokeMap = baseRest(function(collection, path, args) { var index = -1, isFunc = typeof path == 'function', result = isArrayLike(collection) ? Array(collection.length) : []; baseEach(collection, function(value) { result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args); }); return result; }); /** * Creates an object composed of keys generated from the results of running * each element of `collection` thru `iteratee`. The corresponding value of * each key is the last element responsible for generating the key. The * iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 4.0.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The iteratee to transform keys. * @returns {Object} Returns the composed aggregate object. * @example * * var array = [ * { 'dir': 'left', 'code': 97 }, * { 'dir': 'right', 'code': 100 } * ]; * * _.keyBy(array, function(o) { * return String.fromCharCode(o.code); * }); * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } * * _.keyBy(array, 'dir'); * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } */ var keyBy = createAggregator(function(result, value, key) { baseAssignValue(result, key, value); }); /** * Creates an array of values by running each element in `collection` thru * `iteratee`. The iteratee is invoked with three arguments: * (value, index|key, collection). * * Many lodash methods are guarded to work as iteratees for methods like * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. * * The guarded methods are: * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, * `template`, `trim`, `trimEnd`, `trimStart`, and `words` * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Array} Returns the new mapped array. * @example * * function square(n) { * return n * n; * } * * _.map([4, 8], square); * // => [16, 64] * * _.map({ 'a': 4, 'b': 8 }, square); * // => [16, 64] (iteration order is not guaranteed) * * var users = [ * { 'user': 'barney' }, * { 'user': 'fred' } * ]; * * // The `_.property` iteratee shorthand. * _.map(users, 'user'); * // => ['barney', 'fred'] */ function map(collection, iteratee) { var func = isArray(collection) ? arrayMap : baseMap; return func(collection, getIteratee(iteratee, 3)); } /** * This method is like `_.sortBy` except that it allows specifying the sort * orders of the iteratees to sort by. If `orders` is unspecified, all values * are sorted in ascending order. Otherwise, specify an order of "desc" for * descending or "asc" for ascending sort order of corresponding values. * * @static * @memberOf _ * @since 4.0.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]] * The iteratees to sort by. * @param {string[]} [orders] The sort orders of `iteratees`. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. * @returns {Array} Returns the new sorted array. * @example * * var users = [ * { 'user': 'fred', 'age': 48 }, * { 'user': 'barney', 'age': 34 }, * { 'user': 'fred', 'age': 40 }, * { 'user': 'barney', 'age': 36 } * ]; * * // Sort by `user` in ascending order and by `age` in descending order. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] */ function orderBy(collection, iteratees, orders, guard) { if (collection == null) { return []; } if (!isArray(iteratees)) { iteratees = iteratees == null ? [] : [iteratees]; } orders = guard ? undefined : orders; if (!isArray(orders)) { orders = orders == null ? [] : [orders]; } return baseOrderBy(collection, iteratees, orders); } /** * Creates an array of elements split into two groups, the first of which * contains elements `predicate` returns truthy for, the second of which * contains elements `predicate` returns falsey for. The predicate is * invoked with one argument: (value). * * @static * @memberOf _ * @since 3.0.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the array of grouped elements. * @example * * var users = [ * { 'user': 'barney', 'age': 36, 'active': false }, * { 'user': 'fred', 'age': 40, 'active': true }, * { 'user': 'pebbles', 'age': 1, 'active': false } * ]; * * _.partition(users, function(o) { return o.active; }); * // => objects for [['fred'], ['barney', 'pebbles']] * * // The `_.matches` iteratee shorthand. * _.partition(users, { 'age': 1, 'active': false }); * // => objects for [['pebbles'], ['barney', 'fred']] * * // The `_.matchesProperty` iteratee shorthand. * _.partition(users, ['active', false]); * // => objects for [['barney', 'pebbles'], ['fred']] * * // The `_.property` iteratee shorthand. * _.partition(users, 'active'); * // => objects for [['fred'], ['barney', 'pebbles']] */ var partition = createAggregator(function(result, value, key) { result[key ? 0 : 1].push(value); }, function() { return [[], []]; }); /** * Reduces `collection` to a value which is the accumulated result of running * each element in `collection` thru `iteratee`, where each successive * invocation is supplied the return value of the previous. If `accumulator` * is not given, the first element of `collection` is used as the initial * value. The iteratee is invoked with four arguments: * (accumulator, value, index|key, collection). * * Many lodash methods are guarded to work as iteratees for methods like * `_.reduce`, `_.reduceRight`, and `_.transform`. * * The guarded methods are: * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`, * and `sortBy` * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @param {*} [accumulator] The initial value. * @returns {*} Returns the accumulated value. * @see _.reduceRight * @example * * _.reduce([1, 2], function(sum, n) { * return sum + n; * }, 0); * // => 3 * * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { * (result[value] || (result[value] = [])).push(key); * return result; * }, {}); * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) */ function reduce(collection, iteratee, accumulator) { var func = isArray(collection) ? arrayReduce : baseReduce, initAccum = arguments.length < 3; return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach); } /** * This method is like `_.reduce` except that it iterates over elements of * `collection` from right to left. * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @param {*} [accumulator] The initial value. * @returns {*} Returns the accumulated value. * @see _.reduce * @example * * var array = [[0, 1], [2, 3], [4, 5]]; * * _.reduceRight(array, function(flattened, other) { * return flattened.concat(other); * }, []); * // => [4, 5, 2, 3, 0, 1] */ function reduceRight(collection, iteratee, accumulator) { var func = isArray(collection) ? arrayReduceRight : baseReduce, initAccum = arguments.length < 3; return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight); } /** * The opposite of `_.filter`; this method returns the elements of `collection` * that `predicate` does **not** return truthy for. * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the new filtered array. * @see _.filter * @example * * var users = [ * { 'user': 'barney', 'age': 36, 'active': false }, * { 'user': 'fred', 'age': 40, 'active': true } * ]; * * _.reject(users, function(o) { return !o.active; }); * // => objects for ['fred'] * * // The `_.matches` iteratee shorthand. * _.reject(users, { 'age': 40, 'active': true }); * // => objects for ['barney'] * * // The `_.matchesProperty` iteratee shorthand. * _.reject(users, ['active', false]); * // => objects for ['fred'] * * // The `_.property` iteratee shorthand. * _.reject(users, 'active'); * // => objects for ['barney'] */ function reject(collection, predicate) { var func = isArray(collection) ? arrayFilter : baseFilter; return func(collection, negate(getIteratee(predicate, 3))); } /** * Gets a random element from `collection`. * * @static * @memberOf _ * @since 2.0.0 * @category Collection * @param {Array|Object} collection The collection to sample. * @returns {*} Returns the random element. * @example * * _.sample([1, 2, 3, 4]); * // => 2 */ function sample(collection) { var func = isArray(collection) ? arraySample : baseSample; return func(collection); } /** * Gets `n` random elements at unique keys from `collection` up to the * size of `collection`. * * @static * @memberOf _ * @since 4.0.0 * @category Collection * @param {Array|Object} collection The collection to sample. * @param {number} [n=1] The number of elements to sample. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the random elements. * @example * * _.sampleSize([1, 2, 3], 2); * // => [3, 1] * * _.sampleSize([1, 2, 3], 4); * // => [2, 3, 1] */ function sampleSize(collection, n, guard) { if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) { n = 1; } else { n = toInteger(n); } var func = isArray(collection) ? arraySampleSize : baseSampleSize; return func(collection, n); } /** * Creates an array of shuffled values, using a version of the * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle). * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to shuffle. * @returns {Array} Returns the new shuffled array. * @example * * _.shuffle([1, 2, 3, 4]); * // => [4, 1, 3, 2] */ function shuffle(collection) { var func = isArray(collection) ? arrayShuffle : baseShuffle; return func(collection); } /** * Gets the size of `collection` by returning its length for array-like * values or the number of own enumerable string keyed properties for objects. * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object|string} collection The collection to inspect. * @returns {number} Returns the collection size. * @example * * _.size([1, 2, 3]); * // => 3 * * _.size({ 'a': 1, 'b': 2 }); * // => 2 * * _.size('pebbles'); * // => 7 */ function size(collection) { if (collection == null) { return 0; } if (isArrayLike(collection)) { return isString(collection) ? stringSize(collection) : collection.length; } var tag = getTag(collection); if (tag == mapTag || tag == setTag) { return collection.size; } return baseKeys(collection).length; } /** * Checks if `predicate` returns truthy for **any** element of `collection`. * Iteration is stopped once `predicate` returns truthy. The predicate is * invoked with three arguments: (value, index|key, collection). * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {boolean} Returns `true` if any element passes the predicate check, * else `false`. * @example * * _.some([null, 0, 'yes', false], Boolean); * // => true * * var users = [ * { 'user': 'barney', 'active': true }, * { 'user': 'fred', 'active': false } * ]; * * // The `_.matches` iteratee shorthand. * _.some(users, { 'user': 'barney', 'active': false }); * // => false * * // The `_.matchesProperty` iteratee shorthand. * _.some(users, ['active', false]); * // => true * * // The `_.property` iteratee shorthand. * _.some(users, 'active'); * // => true */ function some(collection, predicate, guard) { var func = isArray(collection) ? arraySome : baseSome; if (guard && isIterateeCall(collection, predicate, guard)) { predicate = undefined; } return func(collection, getIteratee(predicate, 3)); } /** * Creates an array of elements, sorted in ascending order by the results of * running each element in a collection thru each iteratee. This method * performs a stable sort, that is, it preserves the original sort order of * equal elements. The iteratees are invoked with one argument: (value). * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {...(Function|Function[])} [iteratees=[_.identity]] * The iteratees to sort by. * @returns {Array} Returns the new sorted array. * @example * * var users = [ * { 'user': 'fred', 'age': 48 }, * { 'user': 'barney', 'age': 36 }, * { 'user': 'fred', 'age': 30 }, * { 'user': 'barney', 'age': 34 } * ]; * * _.sortBy(users, [function(o) { return o.user; }]); * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]] * * _.sortBy(users, ['user', 'age']); * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]] */ var sortBy = baseRest(function(collection, iteratees) { if (collection == null) { return []; } var length = iteratees.length; if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { iteratees = []; } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { iteratees = [iteratees[0]]; } return baseOrderBy(collection, baseFlatten(iteratees, 1), []); }); /*------------------------------------------------------------------------*/ /** * Gets the timestamp of the number of milliseconds that have elapsed since * the Unix epoch (1 January 1970 00:00:00 UTC). * * @static * @memberOf _ * @since 2.4.0 * @category Date * @returns {number} Returns the timestamp. * @example * * _.defer(function(stamp) { * console.log(_.now() - stamp); * }, _.now()); * // => Logs the number of milliseconds it took for the deferred invocation. */ var now = ctxNow || function() { return root.Date.now(); }; /*------------------------------------------------------------------------*/ /** * The opposite of `_.before`; this method creates a function that invokes * `func` once it's called `n` or more times. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {number} n The number of calls before `func` is invoked. * @param {Function} func The function to restrict. * @returns {Function} Returns the new restricted function. * @example * * var saves = ['profile', 'settings']; * * var done = _.after(saves.length, function() { * console.log('done saving!'); * }); * * _.forEach(saves, function(type) { * asyncSave({ 'type': type, 'complete': done }); * }); * // => Logs 'done saving!' after the two async saves have completed. */ function after(n, func) { if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } n = toInteger(n); return function() { if (--n < 1) { return func.apply(this, arguments); } }; } /** * Creates a function that invokes `func`, with up to `n` arguments, * ignoring any additional arguments. * * @static * @memberOf _ * @since 3.0.0 * @category Function * @param {Function} func The function to cap arguments for. * @param {number} [n=func.length] The arity cap. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Function} Returns the new capped function. * @example * * _.map(['6', '8', '10'], _.ary(parseInt, 1)); * // => [6, 8, 10] */ function ary(func, n, guard) { n = guard ? undefined : n; n = (func && n == null) ? func.length : n; return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n); } /** * Creates a function that invokes `func`, with the `this` binding and arguments * of the created function, while it's called less than `n` times. Subsequent * calls to the created function return the result of the last `func` invocation. * * @static * @memberOf _ * @since 3.0.0 * @category Function * @param {number} n The number of calls at which `func` is no longer invoked. * @param {Function} func The function to restrict. * @returns {Function} Returns the new restricted function. * @example * * jQuery(element).on('click', _.before(5, addContactToList)); * // => Allows adding up to 4 contacts to the list. */ function before(n, func) { var result; if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } n = toInteger(n); return function() { if (--n > 0) { result = func.apply(this, arguments); } if (n <= 1) { func = undefined; } return result; }; } /** * Creates a function that invokes `func` with the `this` binding of `thisArg` * and `partials` prepended to the arguments it receives. * * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, * may be used as a placeholder for partially applied arguments. * * **Note:** Unlike native `Function#bind`, this method doesn't set the "length" * property of bound functions. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to bind. * @param {*} thisArg The `this` binding of `func`. * @param {...*} [partials] The arguments to be partially applied. * @returns {Function} Returns the new bound function. * @example * * function greet(greeting, punctuation) { * return greeting + ' ' + this.user + punctuation; * } * * var object = { 'user': 'fred' }; * * var bound = _.bind(greet, object, 'hi'); * bound('!'); * // => 'hi fred!' * * // Bound with placeholders. * var bound = _.bind(greet, object, _, '!'); * bound('hi'); * // => 'hi fred!' */ var bind = baseRest(function(func, thisArg, partials) { var bitmask = WRAP_BIND_FLAG; if (partials.length) { var holders = replaceHolders(partials, getHolder(bind)); bitmask |= WRAP_PARTIAL_FLAG; } return createWrap(func, bitmask, thisArg, partials, holders); }); /** * Creates a function that invokes the method at `object[key]` with `partials` * prepended to the arguments it receives. * * This method differs from `_.bind` by allowing bound functions to reference * methods that may be redefined or don't yet exist. See * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) * for more details. * * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic * builds, may be used as a placeholder for partially applied arguments. * * @static * @memberOf _ * @since 0.10.0 * @category Function * @param {Object} object The object to invoke the method on. * @param {string} key The key of the method. * @param {...*} [partials] The arguments to be partially applied. * @returns {Function} Returns the new bound function. * @example * * var object = { * 'user': 'fred', * 'greet': function(greeting, punctuation) { * return greeting + ' ' + this.user + punctuation; * } * }; * * var bound = _.bindKey(object, 'greet', 'hi'); * bound('!'); * // => 'hi fred!' * * object.greet = function(greeting, punctuation) { * return greeting + 'ya ' + this.user + punctuation; * }; * * bound('!'); * // => 'hiya fred!' * * // Bound with placeholders. * var bound = _.bindKey(object, 'greet', _, '!'); * bound('hi'); * // => 'hiya fred!' */ var bindKey = baseRest(function(object, key, partials) { var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG; if (partials.length) { var holders = replaceHolders(partials, getHolder(bindKey)); bitmask |= WRAP_PARTIAL_FLAG; } return createWrap(key, bitmask, object, partials, holders); }); /** * Creates a function that accepts arguments of `func` and either invokes * `func` returning its result, if at least `arity` number of arguments have * been provided, or returns a function that accepts the remaining `func` * arguments, and so on. The arity of `func` may be specified if `func.length` * is not sufficient. * * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, * may be used as a placeholder for provided arguments. * * **Note:** This method doesn't set the "length" property of curried functions. * * @static * @memberOf _ * @since 2.0.0 * @category Function * @param {Function} func The function to curry. * @param {number} [arity=func.length] The arity of `func`. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Function} Returns the new curried function. * @example * * var abc = function(a, b, c) { * return [a, b, c]; * }; * * var curried = _.curry(abc); * * curried(1)(2)(3); * // => [1, 2, 3] * * curried(1, 2)(3); * // => [1, 2, 3] * * curried(1, 2, 3); * // => [1, 2, 3] * * // Curried with placeholders. * curried(1)(_, 3)(2); * // => [1, 2, 3] */ function curry(func, arity, guard) { arity = guard ? undefined : arity; var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity); result.placeholder = curry.placeholder; return result; } /** * This method is like `_.curry` except that arguments are applied to `func` * in the manner of `_.partialRight` instead of `_.partial`. * * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic * builds, may be used as a placeholder for provided arguments. * * **Note:** This method doesn't set the "length" property of curried functions. * * @static * @memberOf _ * @since 3.0.0 * @category Function * @param {Function} func The function to curry. * @param {number} [arity=func.length] The arity of `func`. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Function} Returns the new curried function. * @example * * var abc = function(a, b, c) { * return [a, b, c]; * }; * * var curried = _.curryRight(abc); * * curried(3)(2)(1); * // => [1, 2, 3] * * curried(2, 3)(1); * // => [1, 2, 3] * * curried(1, 2, 3); * // => [1, 2, 3] * * // Curried with placeholders. * curried(3)(1, _)(2); * // => [1, 2, 3] */ function curryRight(func, arity, guard) { arity = guard ? undefined : arity; var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity); result.placeholder = curryRight.placeholder; return result; } /** * Creates a debounced function that delays invoking `func` until after `wait` * milliseconds have elapsed since the last time the debounced function was * invoked. The debounced function comes with a `cancel` method to cancel * delayed `func` invocations and a `flush` method to immediately invoke them. * Provide `options` to indicate whether `func` should be invoked on the * leading and/or trailing edge of the `wait` timeout. The `func` is invoked * with the last arguments provided to the debounced function. Subsequent * calls to the debounced function return the result of the last `func` * invocation. * * **Note:** If `leading` and `trailing` options are `true`, `func` is * invoked on the trailing edge of the timeout only if the debounced function * is invoked more than once during the `wait` timeout. * * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred * until to the next tick, similar to `setTimeout` with a timeout of `0`. * * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) * for details over the differences between `_.debounce` and `_.throttle`. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to debounce. * @param {number} [wait=0] The number of milliseconds to delay. * @param {Object} [options={}] The options object. * @param {boolean} [options.leading=false] * Specify invoking on the leading edge of the timeout. * @param {number} [options.maxWait] * The maximum time `func` is allowed to be delayed before it's invoked. * @param {boolean} [options.trailing=true] * Specify invoking on the trailing edge of the timeout. * @returns {Function} Returns the new debounced function. * @example * * // Avoid costly calculations while the window size is in flux. * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); * * // Invoke `sendMail` when clicked, debouncing subsequent calls. * jQuery(element).on('click', _.debounce(sendMail, 300, { * 'leading': true, * 'trailing': false * })); * * // Ensure `batchLog` is invoked once after 1 second of debounced calls. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); * var source = new EventSource('/stream'); * jQuery(source).on('message', debounced); * * // Cancel the trailing debounced invocation. * jQuery(window).on('popstate', debounced.cancel); */ function debounce(func, wait, options) { var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true; if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } wait = toNumber(wait) || 0; if (isObject(options)) { leading = !!options.leading; maxing = 'maxWait' in options; maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; trailing = 'trailing' in options ? !!options.trailing : trailing; } function invokeFunc(time) { var args = lastArgs, thisArg = lastThis; lastArgs = lastThis = undefined; lastInvokeTime = time; result = func.apply(thisArg, args); return result; } function leadingEdge(time) { // Reset any `maxWait` timer. lastInvokeTime = time; // Start the timer for the trailing edge. timerId = setTimeout(timerExpired, wait); // Invoke the leading edge. return leading ? invokeFunc(time) : result; } function remainingWait(time) { var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall; return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting; } function shouldInvoke(time) { var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime; // Either this is the first call, activity has stopped and we're at the // trailing edge, the system time has gone backwards and we're treating // it as the trailing edge, or we've hit the `maxWait` limit. return (lastCallTime === undefined || (timeSinceLastCall >= wait) || (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); } function timerExpired() { var time = now(); if (shouldInvoke(time)) { return trailingEdge(time); } // Restart the timer. timerId = setTimeout(timerExpired, remainingWait(time)); } function trailingEdge(time) { timerId = undefined; // Only invoke if we have `lastArgs` which means `func` has been // debounced at least once. if (trailing && lastArgs) { return invokeFunc(time); } lastArgs = lastThis = undefined; return result; } function cancel() { if (timerId !== undefined) { clearTimeout(timerId); } lastInvokeTime = 0; lastArgs = lastCallTime = lastThis = timerId = undefined; } function flush() { return timerId === undefined ? result : trailingEdge(now()); } function debounced() { var time = now(), isInvoking = shouldInvoke(time); lastArgs = arguments; lastThis = this; lastCallTime = time; if (isInvoking) { if (timerId === undefined) { return leadingEdge(lastCallTime); } if (maxing) { // Handle invocations in a tight loop. clearTimeout(timerId); timerId = setTimeout(timerExpired, wait); return invokeFunc(lastCallTime); } } if (timerId === undefined) { timerId = setTimeout(timerExpired, wait); } return result; } debounced.cancel = cancel; debounced.flush = flush; return debounced; } /** * Defers invoking the `func` until the current call stack has cleared. Any * additional arguments are provided to `func` when it's invoked. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to defer. * @param {...*} [args] The arguments to invoke `func` with. * @returns {number} Returns the timer id. * @example * * _.defer(function(text) { * console.log(text); * }, 'deferred'); * // => Logs 'deferred' after one millisecond. */ var defer = baseRest(function(func, args) { return baseDelay(func, 1, args); }); /** * Invokes `func` after `wait` milliseconds. Any additional arguments are * provided to `func` when it's invoked. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to delay. * @param {number} wait The number of milliseconds to delay invocation. * @param {...*} [args] The arguments to invoke `func` with. * @returns {number} Returns the timer id. * @example * * _.delay(function(text) { * console.log(text); * }, 1000, 'later'); * // => Logs 'later' after one second. */ var delay = baseRest(function(func, wait, args) { return baseDelay(func, toNumber(wait) || 0, args); }); /** * Creates a function that invokes `func` with arguments reversed. * * @static * @memberOf _ * @since 4.0.0 * @category Function * @param {Function} func The function to flip arguments for. * @returns {Function} Returns the new flipped function. * @example * * var flipped = _.flip(function() { * return _.toArray(arguments); * }); * * flipped('a', 'b', 'c', 'd'); * // => ['d', 'c', 'b', 'a'] */ function flip(func) { return createWrap(func, WRAP_FLIP_FLAG); } /** * Creates a function that memoizes the result of `func`. If `resolver` is * provided, it determines the cache key for storing the result based on the * arguments provided to the memoized function. By default, the first argument * provided to the memoized function is used as the map cache key. The `func` * is invoked with the `this` binding of the memoized function. * * **Note:** The cache is exposed as the `cache` property on the memoized * function. Its creation may be customized by replacing the `_.memoize.Cache` * constructor with one whose instances implement the * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) * method interface of `clear`, `delete`, `get`, `has`, and `set`. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to have its output memoized. * @param {Function} [resolver] The function to resolve the cache key. * @returns {Function} Returns the new memoized function. * @example * * var object = { 'a': 1, 'b': 2 }; * var other = { 'c': 3, 'd': 4 }; * * var values = _.memoize(_.values); * values(object); * // => [1, 2] * * values(other); * // => [3, 4] * * object.a = 2; * values(object); * // => [1, 2] * * // Modify the result cache. * values.cache.set(object, ['a', 'b']); * values(object); * // => ['a', 'b'] * * // Replace `_.memoize.Cache`. * _.memoize.Cache = WeakMap; */ function memoize(func, resolver) { if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { throw new TypeError(FUNC_ERROR_TEXT); } var memoized = function() { var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache; if (cache.has(key)) { return cache.get(key); } var result = func.apply(this, args); memoized.cache = cache.set(key, result) || cache; return result; }; memoized.cache = new (memoize.Cache || MapCache); return memoized; } // Expose `MapCache`. memoize.Cache = MapCache; /** * Creates a function that negates the result of the predicate `func`. The * `func` predicate is invoked with the `this` binding and arguments of the * created function. * * @static * @memberOf _ * @since 3.0.0 * @category Function * @param {Function} predicate The predicate to negate. * @returns {Function} Returns the new negated function. * @example * * function isEven(n) { * return n % 2 == 0; * } * * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); * // => [1, 3, 5] */ function negate(predicate) { if (typeof predicate != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } return function() { var args = arguments; switch (args.length) { case 0: return !predicate.call(this); case 1: return !predicate.call(this, args[0]); case 2: return !predicate.call(this, args[0], args[1]); case 3: return !predicate.call(this, args[0], args[1], args[2]); } return !predicate.apply(this, args); }; } /** * Creates a function that is restricted to invoking `func` once. Repeat calls * to the function return the value of the first invocation. The `func` is * invoked with the `this` binding and arguments of the created function. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to restrict. * @returns {Function} Returns the new restricted function. * @example * * var initialize = _.once(createApplication); * initialize(); * initialize(); * // => `createApplication` is invoked once */ function once(func) { return before(2, func); } /** * Creates a function that invokes `func` with its arguments transformed. * * @static * @since 4.0.0 * @memberOf _ * @category Function * @param {Function} func The function to wrap. * @param {...(Function|Function[])} [transforms=[_.identity]] * The argument transforms. * @returns {Function} Returns the new function. * @example * * function doubled(n) { * return n * 2; * } * * function square(n) { * return n * n; * } * * var func = _.overArgs(function(x, y) { * return [x, y]; * }, [square, doubled]); * * func(9, 3); * // => [81, 6] * * func(10, 5); * // => [100, 10] */ var overArgs = castRest(function(func, transforms) { transforms = (transforms.length == 1 && isArray(transforms[0])) ? arrayMap(transforms[0], baseUnary(getIteratee())) : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee())); var funcsLength = transforms.length; return baseRest(function(args) { var index = -1, length = nativeMin(args.length, funcsLength); while (++index < length) { args[index] = transforms[index].call(this, args[index]); } return apply(func, this, args); }); }); /** * Creates a function that invokes `func` with `partials` prepended to the * arguments it receives. This method is like `_.bind` except it does **not** * alter the `this` binding. * * The `_.partial.placeholder` value, which defaults to `_` in monolithic * builds, may be used as a placeholder for partially applied arguments. * * **Note:** This method doesn't set the "length" property of partially * applied functions. * * @static * @memberOf _ * @since 0.2.0 * @category Function * @param {Function} func The function to partially apply arguments to. * @param {...*} [partials] The arguments to be partially applied. * @returns {Function} Returns the new partially applied function. * @example * * function greet(greeting, name) { * return greeting + ' ' + name; * } * * var sayHelloTo = _.partial(greet, 'hello'); * sayHelloTo('fred'); * // => 'hello fred' * * // Partially applied with placeholders. * var greetFred = _.partial(greet, _, 'fred'); * greetFred('hi'); * // => 'hi fred' */ var partial = baseRest(function(func, partials) { var holders = replaceHolders(partials, getHolder(partial)); return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders); }); /** * This method is like `_.partial` except that partially applied arguments * are appended to the arguments it receives. * * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic * builds, may be used as a placeholder for partially applied arguments. * * **Note:** This method doesn't set the "length" property of partially * applied functions. * * @static * @memberOf _ * @since 1.0.0 * @category Function * @param {Function} func The function to partially apply arguments to. * @param {...*} [partials] The arguments to be partially applied. * @returns {Function} Returns the new partially applied function. * @example * * function greet(greeting, name) { * return greeting + ' ' + name; * } * * var greetFred = _.partialRight(greet, 'fred'); * greetFred('hi'); * // => 'hi fred' * * // Partially applied with placeholders. * var sayHelloTo = _.partialRight(greet, 'hello', _); * sayHelloTo('fred'); * // => 'hello fred' */ var partialRight = baseRest(function(func, partials) { var holders = replaceHolders(partials, getHolder(partialRight)); return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders); }); /** * Creates a function that invokes `func` with arguments arranged according * to the specified `indexes` where the argument value at the first index is * provided as the first argument, the argument value at the second index is * provided as the second argument, and so on. * * @static * @memberOf _ * @since 3.0.0 * @category Function * @param {Function} func The function to rearrange arguments for. * @param {...(number|number[])} indexes The arranged argument indexes. * @returns {Function} Returns the new function. * @example * * var rearged = _.rearg(function(a, b, c) { * return [a, b, c]; * }, [2, 0, 1]); * * rearged('b', 'c', 'a') * // => ['a', 'b', 'c'] */ var rearg = flatRest(function(func, indexes) { return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes); }); /** * Creates a function that invokes `func` with the `this` binding of the * created function and arguments from `start` and beyond provided as * an array. * * **Note:** This method is based on the * [rest parameter](https://mdn.io/rest_parameters). * * @static * @memberOf _ * @since 4.0.0 * @category Function * @param {Function} func The function to apply a rest parameter to. * @param {number} [start=func.length-1] The start position of the rest parameter. * @returns {Function} Returns the new function. * @example * * var say = _.rest(function(what, names) { * return what + ' ' + _.initial(names).join(', ') + * (_.size(names) > 1 ? ', & ' : '') + _.last(names); * }); * * say('hello', 'fred', 'barney', 'pebbles'); * // => 'hello fred, barney, & pebbles' */ function rest(func, start) { if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } start = start === undefined ? start : toInteger(start); return baseRest(func, start); } /** * Creates a function that invokes `func` with the `this` binding of the * create function and an array of arguments much like * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply). * * **Note:** This method is based on the * [spread operator](https://mdn.io/spread_operator). * * @static * @memberOf _ * @since 3.2.0 * @category Function * @param {Function} func The function to spread arguments over. * @param {number} [start=0] The start position of the spread. * @returns {Function} Returns the new function. * @example * * var say = _.spread(function(who, what) { * return who + ' says ' + what; * }); * * say(['fred', 'hello']); * // => 'fred says hello' * * var numbers = Promise.all([ * Promise.resolve(40), * Promise.resolve(36) * ]); * * numbers.then(_.spread(function(x, y) { * return x + y; * })); * // => a Promise of 76 */ function spread(func, start) { if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } start = start == null ? 0 : nativeMax(toInteger(start), 0); return baseRest(function(args) { var array = args[start], otherArgs = castSlice(args, 0, start); if (array) { arrayPush(otherArgs, array); } return apply(func, this, otherArgs); }); } /** * Creates a throttled function that only invokes `func` at most once per * every `wait` milliseconds. The throttled function comes with a `cancel` * method to cancel delayed `func` invocations and a `flush` method to * immediately invoke them. Provide `options` to indicate whether `func` * should be invoked on the leading and/or trailing edge of the `wait` * timeout. The `func` is invoked with the last arguments provided to the * throttled function. Subsequent calls to the throttled function return the * result of the last `func` invocation. * * **Note:** If `leading` and `trailing` options are `true`, `func` is * invoked on the trailing edge of the timeout only if the throttled function * is invoked more than once during the `wait` timeout. * * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred * until to the next tick, similar to `setTimeout` with a timeout of `0`. * * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) * for details over the differences between `_.throttle` and `_.debounce`. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to throttle. * @param {number} [wait=0] The number of milliseconds to throttle invocations to. * @param {Object} [options={}] The options object. * @param {boolean} [options.leading=true] * Specify invoking on the leading edge of the timeout. * @param {boolean} [options.trailing=true] * Specify invoking on the trailing edge of the timeout. * @returns {Function} Returns the new throttled function. * @example * * // Avoid excessively updating the position while scrolling. * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); * * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false }); * jQuery(element).on('click', throttled); * * // Cancel the trailing throttled invocation. * jQuery(window).on('popstate', throttled.cancel); */ function throttle(func, wait, options) { var leading = true, trailing = true; if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } if (isObject(options)) { leading = 'leading' in options ? !!options.leading : leading; trailing = 'trailing' in options ? !!options.trailing : trailing; } return debounce(func, wait, { 'leading': leading, 'maxWait': wait, 'trailing': trailing }); } /** * Creates a function that accepts up to one argument, ignoring any * additional arguments. * * @static * @memberOf _ * @since 4.0.0 * @category Function * @param {Function} func The function to cap arguments for. * @returns {Function} Returns the new capped function. * @example * * _.map(['6', '8', '10'], _.unary(parseInt)); * // => [6, 8, 10] */ function unary(func) { return ary(func, 1); } /** * Creates a function that provides `value` to `wrapper` as its first * argument. Any additional arguments provided to the function are appended * to those provided to the `wrapper`. The wrapper is invoked with the `this` * binding of the created function. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {*} value The value to wrap. * @param {Function} [wrapper=identity] The wrapper function. * @returns {Function} Returns the new function. * @example * * var p = _.wrap(_.escape, function(func, text) { * return '<p>' + func(text) + '</p>'; * }); * * p('fred, barney, & pebbles'); * // => '<p>fred, barney, & pebbles</p>' */ function wrap(value, wrapper) { return partial(castFunction(wrapper), value); } /*------------------------------------------------------------------------*/ /** * Casts `value` as an array if it's not one. * * @static * @memberOf _ * @since 4.4.0 * @category Lang * @param {*} value The value to inspect. * @returns {Array} Returns the cast array. * @example * * _.castArray(1); * // => [1] * * _.castArray({ 'a': 1 }); * // => [{ 'a': 1 }] * * _.castArray('abc'); * // => ['abc'] * * _.castArray(null); * // => [null] * * _.castArray(undefined); * // => [undefined] * * _.castArray(); * // => [] * * var array = [1, 2, 3]; * console.log(_.castArray(array) === array); * // => true */ function castArray() { if (!arguments.length) { return []; } var value = arguments[0]; return isArray(value) ? value : [value]; } /** * Creates a shallow clone of `value`. * * **Note:** This method is loosely based on the * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) * and supports cloning arrays, array buffers, booleans, date objects, maps, * numbers, `Object` objects, regexes, sets, strings, symbols, and typed * arrays. The own enumerable properties of `arguments` objects are cloned * as plain objects. An empty object is returned for uncloneable values such * as error objects, functions, DOM nodes, and WeakMaps. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to clone. * @returns {*} Returns the cloned value. * @see _.cloneDeep * @example * * var objects = [{ 'a': 1 }, { 'b': 2 }]; * * var shallow = _.clone(objects); * console.log(shallow[0] === objects[0]); * // => true */ function clone(value) { return baseClone(value, CLONE_SYMBOLS_FLAG); } /** * This method is like `_.clone` except that it accepts `customizer` which * is invoked to produce the cloned value. If `customizer` returns `undefined`, * cloning is handled by the method instead. The `customizer` is invoked with * up to four arguments; (value [, index|key, object, stack]). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to clone. * @param {Function} [customizer] The function to customize cloning. * @returns {*} Returns the cloned value. * @see _.cloneDeepWith * @example * * function customizer(value) { * if (_.isElement(value)) { * return value.cloneNode(false); * } * } * * var el = _.cloneWith(document.body, customizer); * * console.log(el === document.body); * // => false * console.log(el.nodeName); * // => 'BODY' * console.log(el.childNodes.length); * // => 0 */ function cloneWith(value, customizer) { customizer = typeof customizer == 'function' ? customizer : undefined; return baseClone(value, CLONE_SYMBOLS_FLAG, customizer); } /** * This method is like `_.clone` except that it recursively clones `value`. * * @static * @memberOf _ * @since 1.0.0 * @category Lang * @param {*} value The value to recursively clone. * @returns {*} Returns the deep cloned value. * @see _.clone * @example * * var objects = [{ 'a': 1 }, { 'b': 2 }]; * * var deep = _.cloneDeep(objects); * console.log(deep[0] === objects[0]); * // => false */ function cloneDeep(value) { return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); } /** * This method is like `_.cloneWith` except that it recursively clones `value`. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to recursively clone. * @param {Function} [customizer] The function to customize cloning. * @returns {*} Returns the deep cloned value. * @see _.cloneWith * @example * * function customizer(value) { * if (_.isElement(value)) { * return value.cloneNode(true); * } * } * * var el = _.cloneDeepWith(document.body, customizer); * * console.log(el === document.body); * // => false * console.log(el.nodeName); * // => 'BODY' * console.log(el.childNodes.length); * // => 20 */ function cloneDeepWith(value, customizer) { customizer = typeof customizer == 'function' ? customizer : undefined; return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer); } /** * Checks if `object` conforms to `source` by invoking the predicate * properties of `source` with the corresponding property values of `object`. * * **Note:** This method is equivalent to `_.conforms` when `source` is * partially applied. * * @static * @memberOf _ * @since 4.14.0 * @category Lang * @param {Object} object The object to inspect. * @param {Object} source The object of property predicates to conform to. * @returns {boolean} Returns `true` if `object` conforms, else `false`. * @example * * var object = { 'a': 1, 'b': 2 }; * * _.conformsTo(object, { 'b': function(n) { return n > 1; } }); * // => true * * _.conformsTo(object, { 'b': function(n) { return n > 2; } }); * // => false */ function conformsTo(object, source) { return source == null || baseConformsTo(object, source, keys(source)); } /** * Performs a * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * comparison between two values to determine if they are equivalent. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * * var object = { 'a': 1 }; * var other = { 'a': 1 }; * * _.eq(object, object); * // => true * * _.eq(object, other); * // => false * * _.eq('a', 'a'); * // => true * * _.eq('a', Object('a')); * // => false * * _.eq(NaN, NaN); * // => true */ function eq(value, other) { return value === other || (value !== value && other !== other); } /** * Checks if `value` is greater than `other`. * * @static * @memberOf _ * @since 3.9.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if `value` is greater than `other`, * else `false`. * @see _.lt * @example * * _.gt(3, 1); * // => true * * _.gt(3, 3); * // => false * * _.gt(1, 3); * // => false */ var gt = createRelationalOperation(baseGt); /** * Checks if `value` is greater than or equal to `other`. * * @static * @memberOf _ * @since 3.9.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if `value` is greater than or equal to * `other`, else `false`. * @see _.lte * @example * * _.gte(3, 1); * // => true * * _.gte(3, 3); * // => true * * _.gte(1, 3); * // => false */ var gte = createRelationalOperation(function(value, other) { return value >= other; }); /** * Checks if `value` is likely an `arguments` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an `arguments` object, * else `false`. * @example * * _.isArguments(function() { return arguments; }()); * // => true * * _.isArguments([1, 2, 3]); * // => false */ var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee'); }; /** * Checks if `value` is classified as an `Array` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array, else `false`. * @example * * _.isArray([1, 2, 3]); * // => true * * _.isArray(document.body.children); * // => false * * _.isArray('abc'); * // => false * * _.isArray(_.noop); * // => false */ var isArray = Array.isArray; /** * Checks if `value` is classified as an `ArrayBuffer` object. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. * @example * * _.isArrayBuffer(new ArrayBuffer(2)); * // => true * * _.isArrayBuffer(new Array(2)); * // => false */ var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer; /** * Checks if `value` is array-like. A value is considered array-like if it's * not a function and has a `value.length` that's an integer greater than or * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is array-like, else `false`. * @example * * _.isArrayLike([1, 2, 3]); * // => true * * _.isArrayLike(document.body.children); * // => true * * _.isArrayLike('abc'); * // => true * * _.isArrayLike(_.noop); * // => false */ function isArrayLike(value) { return value != null && isLength(value.length) && !isFunction(value); } /** * This method is like `_.isArrayLike` except that it also checks if `value` * is an object. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array-like object, * else `false`. * @example * * _.isArrayLikeObject([1, 2, 3]); * // => true * * _.isArrayLikeObject(document.body.children); * // => true * * _.isArrayLikeObject('abc'); * // => false * * _.isArrayLikeObject(_.noop); * // => false */ function isArrayLikeObject(value) { return isObjectLike(value) && isArrayLike(value); } /** * Checks if `value` is classified as a boolean primitive or object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`. * @example * * _.isBoolean(false); * // => true * * _.isBoolean(null); * // => false */ function isBoolean(value) { return value === true || value === false || (isObjectLike(value) && baseGetTag(value) == boolTag); } /** * Checks if `value` is a buffer. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. * @example * * _.isBuffer(new Buffer(2)); * // => true * * _.isBuffer(new Uint8Array(2)); * // => false */ var isBuffer = nativeIsBuffer || stubFalse; /** * Checks if `value` is classified as a `Date` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a date object, else `false`. * @example * * _.isDate(new Date); * // => true * * _.isDate('Mon April 23 2012'); * // => false */ var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate; /** * Checks if `value` is likely a DOM element. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. * @example * * _.isElement(document.body); * // => true * * _.isElement('<body>'); * // => false */ function isElement(value) { return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value); } /** * Checks if `value` is an empty object, collection, map, or set. * * Objects are considered empty if they have no own enumerable string keyed * properties. * * Array-like values such as `arguments` objects, arrays, buffers, strings, or * jQuery-like collections are considered empty if they have a `length` of `0`. * Similarly, maps and sets are considered empty if they have a `size` of `0`. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is empty, else `false`. * @example * * _.isEmpty(null); * // => true * * _.isEmpty(true); * // => true * * _.isEmpty(1); * // => true * * _.isEmpty([1, 2, 3]); * // => false * * _.isEmpty({ 'a': 1 }); * // => false */ function isEmpty(value) { if (value == null) { return true; } if (isArrayLike(value) && (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || isBuffer(value) || isTypedArray(value) || isArguments(value))) { return !value.length; } var tag = getTag(value); if (tag == mapTag || tag == setTag) { return !value.size; } if (isPrototype(value)) { return !baseKeys(value).length; } for (var key in value) { if (hasOwnProperty.call(value, key)) { return false; } } return true; } /** * Performs a deep comparison between two values to determine if they are * equivalent. * * **Note:** This method supports comparing arrays, array buffers, booleans, * date objects, error objects, maps, numbers, `Object` objects, regexes, * sets, strings, symbols, and typed arrays. `Object` objects are compared * by their own, not inherited, enumerable properties. Functions and DOM * nodes are compared by strict equality, i.e. `===`. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * * var object = { 'a': 1 }; * var other = { 'a': 1 }; * * _.isEqual(object, other); * // => true * * object === other; * // => false */ function isEqual(value, other) { return baseIsEqual(value, other); } /** * This method is like `_.isEqual` except that it accepts `customizer` which * is invoked to compare values. If `customizer` returns `undefined`, comparisons * are handled by the method instead. The `customizer` is invoked with up to * six arguments: (objValue, othValue [, index|key, object, other, stack]). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @param {Function} [customizer] The function to customize comparisons. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * * function isGreeting(value) { * return /^h(?:i|ello)$/.test(value); * } * * function customizer(objValue, othValue) { * if (isGreeting(objValue) && isGreeting(othValue)) { * return true; * } * } * * var array = ['hello', 'goodbye']; * var other = ['hi', 'goodbye']; * * _.isEqualWith(array, other, customizer); * // => true */ function isEqualWith(value, other, customizer) { customizer = typeof customizer == 'function' ? customizer : undefined; var result = customizer ? customizer(value, other) : undefined; return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result; } /** * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, * `SyntaxError`, `TypeError`, or `URIError` object. * * @static * @memberOf _ * @since 3.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an error object, else `false`. * @example * * _.isError(new Error); * // => true * * _.isError(Error); * // => false */ function isError(value) { if (!isObjectLike(value)) { return false; } var tag = baseGetTag(value); return tag == errorTag || tag == domExcTag || (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value)); } /** * Checks if `value` is a finite primitive number. * * **Note:** This method is based on * [`Number.isFinite`](https://mdn.io/Number/isFinite). * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. * @example * * _.isFinite(3); * // => true * * _.isFinite(Number.MIN_VALUE); * // => true * * _.isFinite(Infinity); * // => false * * _.isFinite('3'); * // => false */ function isFinite(value) { return typeof value == 'number' && nativeIsFinite(value); } /** * Checks if `value` is classified as a `Function` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a function, else `false`. * @example * * _.isFunction(_); * // => true * * _.isFunction(/abc/); * // => false */ function isFunction(value) { if (!isObject(value)) { return false; } // The use of `Object#toString` avoids issues with the `typeof` operator // in Safari 9 which returns 'object' for typed arrays and other constructors. var tag = baseGetTag(value); return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; } /** * Checks if `value` is an integer. * * **Note:** This method is based on * [`Number.isInteger`](https://mdn.io/Number/isInteger). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an integer, else `false`. * @example * * _.isInteger(3); * // => true * * _.isInteger(Number.MIN_VALUE); * // => false * * _.isInteger(Infinity); * // => false * * _.isInteger('3'); * // => false */ function isInteger(value) { return typeof value == 'number' && value == toInteger(value); } /** * Checks if `value` is a valid array-like length. * * **Note:** This method is loosely based on * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. * @example * * _.isLength(3); * // => true * * _.isLength(Number.MIN_VALUE); * // => false * * _.isLength(Infinity); * // => false * * _.isLength('3'); * // => false */ function isLength(value) { return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; } /** * Checks if `value` is the * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an object, else `false`. * @example * * _.isObject({}); * // => true * * _.isObject([1, 2, 3]); * // => true * * _.isObject(_.noop); * // => true * * _.isObject(null); * // => false */ function isObject(value) { var type = typeof value; return value != null && (type == 'object' || type == 'function'); } /** * Checks if `value` is object-like. A value is object-like if it's not `null` * and has a `typeof` result of "object". * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is object-like, else `false`. * @example * * _.isObjectLike({}); * // => true * * _.isObjectLike([1, 2, 3]); * // => true * * _.isObjectLike(_.noop); * // => false * * _.isObjectLike(null); * // => false */ function isObjectLike(value) { return value != null && typeof value == 'object'; } /** * Checks if `value` is classified as a `Map` object. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a map, else `false`. * @example * * _.isMap(new Map); * // => true * * _.isMap(new WeakMap); * // => false */ var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; /** * Performs a partial deep comparison between `object` and `source` to * determine if `object` contains equivalent property values. * * **Note:** This method is equivalent to `_.matches` when `source` is * partially applied. * * Partial comparisons will match empty array and empty object `source` * values against any array or object value, respectively. See `_.isEqual` * for a list of supported value comparisons. * * @static * @memberOf _ * @since 3.0.0 * @category Lang * @param {Object} object The object to inspect. * @param {Object} source The object of property values to match. * @returns {boolean} Returns `true` if `object` is a match, else `false`. * @example * * var object = { 'a': 1, 'b': 2 }; * * _.isMatch(object, { 'b': 2 }); * // => true * * _.isMatch(object, { 'b': 1 }); * // => false */ function isMatch(object, source) { return object === source || baseIsMatch(object, source, getMatchData(source)); } /** * This method is like `_.isMatch` except that it accepts `customizer` which * is invoked to compare values. If `customizer` returns `undefined`, comparisons * are handled by the method instead. The `customizer` is invoked with five * arguments: (objValue, srcValue, index|key, object, source). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {Object} object The object to inspect. * @param {Object} source The object of property values to match. * @param {Function} [customizer] The function to customize comparisons. * @returns {boolean} Returns `true` if `object` is a match, else `false`. * @example * * function isGreeting(value) { * return /^h(?:i|ello)$/.test(value); * } * * function customizer(objValue, srcValue) { * if (isGreeting(objValue) && isGreeting(srcValue)) { * return true; * } * } * * var object = { 'greeting': 'hello' }; * var source = { 'greeting': 'hi' }; * * _.isMatchWith(object, source, customizer); * // => true */ function isMatchWith(object, source, customizer) { customizer = typeof customizer == 'function' ? customizer : undefined; return baseIsMatch(object, source, getMatchData(source), customizer); } /** * Checks if `value` is `NaN`. * * **Note:** This method is based on * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for * `undefined` and other non-number values. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. * @example * * _.isNaN(NaN); * // => true * * _.isNaN(new Number(NaN)); * // => true * * isNaN(undefined); * // => true * * _.isNaN(undefined); * // => false */ function isNaN(value) { // An `NaN` primitive is the only value that is not equal to itself. // Perform the `toStringTag` check first to avoid errors with some // ActiveX objects in IE. return isNumber(value) && value != +value; } /** * Checks if `value` is a pristine native function. * * **Note:** This method can't reliably detect native functions in the presence * of the core-js package because core-js circumvents this kind of detection. * Despite multiple requests, the core-js maintainer has made it clear: any * attempt to fix the detection will be obstructed. As a result, we're left * with little choice but to throw an error. Unfortunately, this also affects * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill), * which rely on core-js. * * @static * @memberOf _ * @since 3.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a native function, * else `false`. * @example * * _.isNative(Array.prototype.push); * // => true * * _.isNative(_); * // => false */ function isNative(value) { if (isMaskable(value)) { throw new Error(CORE_ERROR_TEXT); } return baseIsNative(value); } /** * Checks if `value` is `null`. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is `null`, else `false`. * @example * * _.isNull(null); * // => true * * _.isNull(void 0); * // => false */ function isNull(value) { return value === null; } /** * Checks if `value` is `null` or `undefined`. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is nullish, else `false`. * @example * * _.isNil(null); * // => true * * _.isNil(void 0); * // => true * * _.isNil(NaN); * // => false */ function isNil(value) { return value == null; } /** * Checks if `value` is classified as a `Number` primitive or object. * * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are * classified as numbers, use the `_.isFinite` method. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a number, else `false`. * @example * * _.isNumber(3); * // => true * * _.isNumber(Number.MIN_VALUE); * // => true * * _.isNumber(Infinity); * // => true * * _.isNumber('3'); * // => false */ function isNumber(value) { return typeof value == 'number' || (isObjectLike(value) && baseGetTag(value) == numberTag); } /** * Checks if `value` is a plain object, that is, an object created by the * `Object` constructor or one with a `[[Prototype]]` of `null`. * * @static * @memberOf _ * @since 0.8.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. * @example * * function Foo() { * this.a = 1; * } * * _.isPlainObject(new Foo); * // => false * * _.isPlainObject([1, 2, 3]); * // => false * * _.isPlainObject({ 'x': 0, 'y': 0 }); * // => true * * _.isPlainObject(Object.create(null)); * // => true */ function isPlainObject(value) { if (!isObjectLike(value) || baseGetTag(value) != objectTag) { return false; } var proto = getPrototype(value); if (proto === null) { return true; } var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; return typeof Ctor == 'function' && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString; } /** * Checks if `value` is classified as a `RegExp` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. * @example * * _.isRegExp(/abc/); * // => true * * _.isRegExp('/abc/'); * // => false */ var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp; /** * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 * double precision number which isn't the result of a rounded unsafe integer. * * **Note:** This method is based on * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`. * @example * * _.isSafeInteger(3); * // => true * * _.isSafeInteger(Number.MIN_VALUE); * // => false * * _.isSafeInteger(Infinity); * // => false * * _.isSafeInteger('3'); * // => false */ function isSafeInteger(value) { return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER; } /** * Checks if `value` is classified as a `Set` object. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a set, else `false`. * @example * * _.isSet(new Set); * // => true * * _.isSet(new WeakSet); * // => false */ var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; /** * Checks if `value` is classified as a `String` primitive or object. * * @static * @since 0.1.0 * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a string, else `false`. * @example * * _.isString('abc'); * // => true * * _.isString(1); * // => false */ function isString(value) { return typeof value == 'string' || (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); } /** * Checks if `value` is classified as a `Symbol` primitive or object. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. * @example * * _.isSymbol(Symbol.iterator); * // => true * * _.isSymbol('abc'); * // => false */ function isSymbol(value) { return typeof value == 'symbol' || (isObjectLike(value) && baseGetTag(value) == symbolTag); } /** * Checks if `value` is classified as a typed array. * * @static * @memberOf _ * @since 3.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. * @example * * _.isTypedArray(new Uint8Array); * // => true * * _.isTypedArray([]); * // => false */ var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; /** * Checks if `value` is `undefined`. * * @static * @since 0.1.0 * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. * @example * * _.isUndefined(void 0); * // => true * * _.isUndefined(null); * // => false */ function isUndefined(value) { return value === undefined; } /** * Checks if `value` is classified as a `WeakMap` object. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`. * @example * * _.isWeakMap(new WeakMap); * // => true * * _.isWeakMap(new Map); * // => false */ function isWeakMap(value) { return isObjectLike(value) && getTag(value) == weakMapTag; } /** * Checks if `value` is classified as a `WeakSet` object. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`. * @example * * _.isWeakSet(new WeakSet); * // => true * * _.isWeakSet(new Set); * // => false */ function isWeakSet(value) { return isObjectLike(value) && baseGetTag(value) == weakSetTag; } /** * Checks if `value` is less than `other`. * * @static * @memberOf _ * @since 3.9.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if `value` is less than `other`, * else `false`. * @see _.gt * @example * * _.lt(1, 3); * // => true * * _.lt(3, 3); * // => false * * _.lt(3, 1); * // => false */ var lt = createRelationalOperation(baseLt); /** * Checks if `value` is less than or equal to `other`. * * @static * @memberOf _ * @since 3.9.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if `value` is less than or equal to * `other`, else `false`. * @see _.gte * @example * * _.lte(1, 3); * // => true * * _.lte(3, 3); * // => true * * _.lte(3, 1); * // => false */ var lte = createRelationalOperation(function(value, other) { return value <= other; }); /** * Converts `value` to an array. * * @static * @since 0.1.0 * @memberOf _ * @category Lang * @param {*} value The value to convert. * @returns {Array} Returns the converted array. * @example * * _.toArray({ 'a': 1, 'b': 2 }); * // => [1, 2] * * _.toArray('abc'); * // => ['a', 'b', 'c'] * * _.toArray(1); * // => [] * * _.toArray(null); * // => [] */ function toArray(value) { if (!value) { return []; } if (isArrayLike(value)) { return isString(value) ? stringToArray(value) : copyArray(value); } if (symIterator && value[symIterator]) { return iteratorToArray(value[symIterator]()); } var tag = getTag(value), func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values); return func(value); } /** * Converts `value` to a finite number. * * @static * @memberOf _ * @since 4.12.0 * @category Lang * @param {*} value The value to convert. * @returns {number} Returns the converted number. * @example * * _.toFinite(3.2); * // => 3.2 * * _.toFinite(Number.MIN_VALUE); * // => 5e-324 * * _.toFinite(Infinity); * // => 1.7976931348623157e+308 * * _.toFinite('3.2'); * // => 3.2 */ function toFinite(value) { if (!value) { return value === 0 ? value : 0; } value = toNumber(value); if (value === INFINITY || value === -INFINITY) { var sign = (value < 0 ? -1 : 1); return sign * MAX_INTEGER; } return value === value ? value : 0; } /** * Converts `value` to an integer. * * **Note:** This method is loosely based on * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to convert. * @returns {number} Returns the converted integer. * @example * * _.toInteger(3.2); * // => 3 * * _.toInteger(Number.MIN_VALUE); * // => 0 * * _.toInteger(Infinity); * // => 1.7976931348623157e+308 * * _.toInteger('3.2'); * // => 3 */ function toInteger(value) { var result = toFinite(value), remainder = result % 1; return result === result ? (remainder ? result - remainder : result) : 0; } /** * Converts `value` to an integer suitable for use as the length of an * array-like object. * * **Note:** This method is based on * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to convert. * @returns {number} Returns the converted integer. * @example * * _.toLength(3.2); * // => 3 * * _.toLength(Number.MIN_VALUE); * // => 0 * * _.toLength(Infinity); * // => 4294967295 * * _.toLength('3.2'); * // => 3 */ function toLength(value) { return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0; } /** * Converts `value` to a number. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to process. * @returns {number} Returns the number. * @example * * _.toNumber(3.2); * // => 3.2 * * _.toNumber(Number.MIN_VALUE); * // => 5e-324 * * _.toNumber(Infinity); * // => Infinity * * _.toNumber('3.2'); * // => 3.2 */ function toNumber(value) { if (typeof value == 'number') { return value; } if (isSymbol(value)) { return NAN; } if (isObject(value)) { var other = typeof value.valueOf == 'function' ? value.valueOf() : value; value = isObject(other) ? (other + '') : other; } if (typeof value != 'string') { return value === 0 ? value : +value; } value = baseTrim(value); var isBinary = reIsBinary.test(value); return (isBinary || reIsOctal.test(value)) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : (reIsBadHex.test(value) ? NAN : +value); } /** * Converts `value` to a plain object flattening inherited enumerable string * keyed properties of `value` to own properties of the plain object. * * @static * @memberOf _ * @since 3.0.0 * @category Lang * @param {*} value The value to convert. * @returns {Object} Returns the converted plain object. * @example * * function Foo() { * this.b = 2; * } * * Foo.prototype.c = 3; * * _.assign({ 'a': 1 }, new Foo); * // => { 'a': 1, 'b': 2 } * * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); * // => { 'a': 1, 'b': 2, 'c': 3 } */ function toPlainObject(value) { return copyObject(value, keysIn(value)); } /** * Converts `value` to a safe integer. A safe integer can be compared and * represented correctly. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to convert. * @returns {number} Returns the converted integer. * @example * * _.toSafeInteger(3.2); * // => 3 * * _.toSafeInteger(Number.MIN_VALUE); * // => 0 * * _.toSafeInteger(Infinity); * // => 9007199254740991 * * _.toSafeInteger('3.2'); * // => 3 */ function toSafeInteger(value) { return value ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) : (value === 0 ? value : 0); } /** * Converts `value` to a string. An empty string is returned for `null` * and `undefined` values. The sign of `-0` is preserved. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to convert. * @returns {string} Returns the converted string. * @example * * _.toString(null); * // => '' * * _.toString(-0); * // => '-0' * * _.toString([1, 2, 3]); * // => '1,2,3' */ function toString(value) { return value == null ? '' : baseToString(value); } /*------------------------------------------------------------------------*/ /** * Assigns own enumerable string keyed properties of source objects to the * destination object. Source objects are applied from left to right. * Subsequent sources overwrite property assignments of previous sources. * * **Note:** This method mutates `object` and is loosely based on * [`Object.assign`](https://mdn.io/Object/assign). * * @static * @memberOf _ * @since 0.10.0 * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. * @returns {Object} Returns `object`. * @see _.assignIn * @example * * function Foo() { * this.a = 1; * } * * function Bar() { * this.c = 3; * } * * Foo.prototype.b = 2; * Bar.prototype.d = 4; * * _.assign({ 'a': 0 }, new Foo, new Bar); * // => { 'a': 1, 'c': 3 } */ var assign = createAssigner(function(object, source) { if (isPrototype(source) || isArrayLike(source)) { copyObject(source, keys(source), object); return; } for (var key in source) { if (hasOwnProperty.call(source, key)) { assignValue(object, key, source[key]); } } }); /** * This method is like `_.assign` except that it iterates over own and * inherited source properties. * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.0.0 * @alias extend * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. * @returns {Object} Returns `object`. * @see _.assign * @example * * function Foo() { * this.a = 1; * } * * function Bar() { * this.c = 3; * } * * Foo.prototype.b = 2; * Bar.prototype.d = 4; * * _.assignIn({ 'a': 0 }, new Foo, new Bar); * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } */ var assignIn = createAssigner(function(object, source) { copyObject(source, keysIn(source), object); }); /** * This method is like `_.assignIn` except that it accepts `customizer` * which is invoked to produce the assigned values. If `customizer` returns * `undefined`, assignment is handled by the method instead. The `customizer` * is invoked with five arguments: (objValue, srcValue, key, object, source). * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.0.0 * @alias extendWith * @category Object * @param {Object} object The destination object. * @param {...Object} sources The source objects. * @param {Function} [customizer] The function to customize assigned values. * @returns {Object} Returns `object`. * @see _.assignWith * @example * * function customizer(objValue, srcValue) { * return _.isUndefined(objValue) ? srcValue : objValue; * } * * var defaults = _.partialRight(_.assignInWith, customizer); * * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); * // => { 'a': 1, 'b': 2 } */ var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { copyObject(source, keysIn(source), object, customizer); }); /** * This method is like `_.assign` except that it accepts `customizer` * which is invoked to produce the assigned values. If `customizer` returns * `undefined`, assignment is handled by the method instead. The `customizer` * is invoked with five arguments: (objValue, srcValue, key, object, source). * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The destination object. * @param {...Object} sources The source objects. * @param {Function} [customizer] The function to customize assigned values. * @returns {Object} Returns `object`. * @see _.assignInWith * @example * * function customizer(objValue, srcValue) { * return _.isUndefined(objValue) ? srcValue : objValue; * } * * var defaults = _.partialRight(_.assignWith, customizer); * * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); * // => { 'a': 1, 'b': 2 } */ var assignWith = createAssigner(function(object, source, srcIndex, customizer) { copyObject(source, keys(source), object, customizer); }); /** * Creates an array of values corresponding to `paths` of `object`. * * @static * @memberOf _ * @since 1.0.0 * @category Object * @param {Object} object The object to iterate over. * @param {...(string|string[])} [paths] The property paths to pick. * @returns {Array} Returns the picked values. * @example * * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; * * _.at(object, ['a[0].b.c', 'a[1]']); * // => [3, 4] */ var at = flatRest(baseAt); /** * Creates an object that inherits from the `prototype` object. If a * `properties` object is given, its own enumerable string keyed properties * are assigned to the created object. * * @static * @memberOf _ * @since 2.3.0 * @category Object * @param {Object} prototype The object to inherit from. * @param {Object} [properties] The properties to assign to the object. * @returns {Object} Returns the new object. * @example * * function Shape() { * this.x = 0; * this.y = 0; * } * * function Circle() { * Shape.call(this); * } * * Circle.prototype = _.create(Shape.prototype, { * 'constructor': Circle * }); * * var circle = new Circle; * circle instanceof Circle; * // => true * * circle instanceof Shape; * // => true */ function create(prototype, properties) { var result = baseCreate(prototype); return properties == null ? result : baseAssign(result, properties); } /** * Assigns own and inherited enumerable string keyed properties of source * objects to the destination object for all destination properties that * resolve to `undefined`. Source objects are applied from left to right. * Once a property is set, additional values of the same property are ignored. * * **Note:** This method mutates `object`. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. * @returns {Object} Returns `object`. * @see _.defaultsDeep * @example * * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); * // => { 'a': 1, 'b': 2 } */ var defaults = baseRest(function(object, sources) { object = Object(object); var index = -1; var length = sources.length; var guard = length > 2 ? sources[2] : undefined; if (guard && isIterateeCall(sources[0], sources[1], guard)) { length = 1; } while (++index < length) { var source = sources[index]; var props = keysIn(source); var propsIndex = -1; var propsLength = props.length; while (++propsIndex < propsLength) { var key = props[propsIndex]; var value = object[key]; if (value === undefined || (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) { object[key] = source[key]; } } } return object; }); /** * This method is like `_.defaults` except that it recursively assigns * default properties. * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 3.10.0 * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. * @returns {Object} Returns `object`. * @see _.defaults * @example * * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } }); * // => { 'a': { 'b': 2, 'c': 3 } } */ var defaultsDeep = baseRest(function(args) { args.push(undefined, customDefaultsMerge); return apply(mergeWith, undefined, args); }); /** * This method is like `_.find` except that it returns the key of the first * element `predicate` returns truthy for instead of the element itself. * * @static * @memberOf _ * @since 1.1.0 * @category Object * @param {Object} object The object to inspect. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {string|undefined} Returns the key of the matched element, * else `undefined`. * @example * * var users = { * 'barney': { 'age': 36, 'active': true }, * 'fred': { 'age': 40, 'active': false }, * 'pebbles': { 'age': 1, 'active': true } * }; * * _.findKey(users, function(o) { return o.age < 40; }); * // => 'barney' (iteration order is not guaranteed) * * // The `_.matches` iteratee shorthand. * _.findKey(users, { 'age': 1, 'active': true }); * // => 'pebbles' * * // The `_.matchesProperty` iteratee shorthand. * _.findKey(users, ['active', false]); * // => 'fred' * * // The `_.property` iteratee shorthand. * _.findKey(users, 'active'); * // => 'barney' */ function findKey(object, predicate) { return baseFindKey(object, getIteratee(predicate, 3), baseForOwn); } /** * This method is like `_.findKey` except that it iterates over elements of * a collection in the opposite order. * * @static * @memberOf _ * @since 2.0.0 * @category Object * @param {Object} object The object to inspect. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {string|undefined} Returns the key of the matched element, * else `undefined`. * @example * * var users = { * 'barney': { 'age': 36, 'active': true }, * 'fred': { 'age': 40, 'active': false }, * 'pebbles': { 'age': 1, 'active': true } * }; * * _.findLastKey(users, function(o) { return o.age < 40; }); * // => returns 'pebbles' assuming `_.findKey` returns 'barney' * * // The `_.matches` iteratee shorthand. * _.findLastKey(users, { 'age': 36, 'active': true }); * // => 'barney' * * // The `_.matchesProperty` iteratee shorthand. * _.findLastKey(users, ['active', false]); * // => 'fred' * * // The `_.property` iteratee shorthand. * _.findLastKey(users, 'active'); * // => 'pebbles' */ function findLastKey(object, predicate) { return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight); } /** * Iterates over own and inherited enumerable string keyed properties of an * object and invokes `iteratee` for each property. The iteratee is invoked * with three arguments: (value, key, object). Iteratee functions may exit * iteration early by explicitly returning `false`. * * @static * @memberOf _ * @since 0.3.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns `object`. * @see _.forInRight * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.forIn(new Foo, function(value, key) { * console.log(key); * }); * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed). */ function forIn(object, iteratee) { return object == null ? object : baseFor(object, getIteratee(iteratee, 3), keysIn); } /** * This method is like `_.forIn` except that it iterates over properties of * `object` in the opposite order. * * @static * @memberOf _ * @since 2.0.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns `object`. * @see _.forIn * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.forInRight(new Foo, function(value, key) { * console.log(key); * }); * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'. */ function forInRight(object, iteratee) { return object == null ? object : baseForRight(object, getIteratee(iteratee, 3), keysIn); } /** * Iterates over own enumerable string keyed properties of an object and * invokes `iteratee` for each property. The iteratee is invoked with three * arguments: (value, key, object). Iteratee functions may exit iteration * early by explicitly returning `false`. * * @static * @memberOf _ * @since 0.3.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns `object`. * @see _.forOwnRight * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.forOwn(new Foo, function(value, key) { * console.log(key); * }); * // => Logs 'a' then 'b' (iteration order is not guaranteed). */ function forOwn(object, iteratee) { return object && baseForOwn(object, getIteratee(iteratee, 3)); } /** * This method is like `_.forOwn` except that it iterates over properties of * `object` in the opposite order. * * @static * @memberOf _ * @since 2.0.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns `object`. * @see _.forOwn * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.forOwnRight(new Foo, function(value, key) { * console.log(key); * }); * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'. */ function forOwnRight(object, iteratee) { return object && baseForOwnRight(object, getIteratee(iteratee, 3)); } /** * Creates an array of function property names from own enumerable properties * of `object`. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to inspect. * @returns {Array} Returns the function names. * @see _.functionsIn * @example * * function Foo() { * this.a = _.constant('a'); * this.b = _.constant('b'); * } * * Foo.prototype.c = _.constant('c'); * * _.functions(new Foo); * // => ['a', 'b'] */ function functions(object) { return object == null ? [] : baseFunctions(object, keys(object)); } /** * Creates an array of function property names from own and inherited * enumerable properties of `object`. * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The object to inspect. * @returns {Array} Returns the function names. * @see _.functions * @example * * function Foo() { * this.a = _.constant('a'); * this.b = _.constant('b'); * } * * Foo.prototype.c = _.constant('c'); * * _.functionsIn(new Foo); * // => ['a', 'b', 'c'] */ function functionsIn(object) { return object == null ? [] : baseFunctions(object, keysIn(object)); } /** * Gets the value at `path` of `object`. If the resolved value is * `undefined`, the `defaultValue` is returned in its place. * * @static * @memberOf _ * @since 3.7.0 * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path of the property to get. * @param {*} [defaultValue] The value returned for `undefined` resolved values. * @returns {*} Returns the resolved value. * @example * * var object = { 'a': [{ 'b': { 'c': 3 } }] }; * * _.get(object, 'a[0].b.c'); * // => 3 * * _.get(object, ['a', '0', 'b', 'c']); * // => 3 * * _.get(object, 'a.b.c', 'default'); * // => 'default' */ function get(object, path, defaultValue) { var result = object == null ? undefined : baseGet(object, path); return result === undefined ? defaultValue : result; } /** * Checks if `path` is a direct property of `object`. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path to check. * @returns {boolean} Returns `true` if `path` exists, else `false`. * @example * * var object = { 'a': { 'b': 2 } }; * var other = _.create({ 'a': _.create({ 'b': 2 }) }); * * _.has(object, 'a'); * // => true * * _.has(object, 'a.b'); * // => true * * _.has(object, ['a', 'b']); * // => true * * _.has(other, 'a'); * // => false */ function has(object, path) { return object != null && hasPath(object, path, baseHas); } /** * Checks if `path` is a direct or inherited property of `object`. * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path to check. * @returns {boolean} Returns `true` if `path` exists, else `false`. * @example * * var object = _.create({ 'a': _.create({ 'b': 2 }) }); * * _.hasIn(object, 'a'); * // => true * * _.hasIn(object, 'a.b'); * // => true * * _.hasIn(object, ['a', 'b']); * // => true * * _.hasIn(object, 'b'); * // => false */ function hasIn(object, path) { return object != null && hasPath(object, path, baseHasIn); } /** * Creates an object composed of the inverted keys and values of `object`. * If `object` contains duplicate values, subsequent values overwrite * property assignments of previous values. * * @static * @memberOf _ * @since 0.7.0 * @category Object * @param {Object} object The object to invert. * @returns {Object} Returns the new inverted object. * @example * * var object = { 'a': 1, 'b': 2, 'c': 1 }; * * _.invert(object); * // => { '1': 'c', '2': 'b' } */ var invert = createInverter(function(result, value, key) { if (value != null && typeof value.toString != 'function') { value = nativeObjectToString.call(value); } result[value] = key; }, constant(identity)); /** * This method is like `_.invert` except that the inverted object is generated * from the results of running each element of `object` thru `iteratee`. The * corresponding inverted value of each inverted key is an array of keys * responsible for generating the inverted value. The iteratee is invoked * with one argument: (value). * * @static * @memberOf _ * @since 4.1.0 * @category Object * @param {Object} object The object to invert. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Object} Returns the new inverted object. * @example * * var object = { 'a': 1, 'b': 2, 'c': 1 }; * * _.invertBy(object); * // => { '1': ['a', 'c'], '2': ['b'] } * * _.invertBy(object, function(value) { * return 'group' + value; * }); * // => { 'group1': ['a', 'c'], 'group2': ['b'] } */ var invertBy = createInverter(function(result, value, key) { if (value != null && typeof value.toString != 'function') { value = nativeObjectToString.call(value); } if (hasOwnProperty.call(result, value)) { result[value].push(key); } else { result[value] = [key]; } }, getIteratee); /** * Invokes the method at `path` of `object`. * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path of the method to invoke. * @param {...*} [args] The arguments to invoke the method with. * @returns {*} Returns the result of the invoked method. * @example * * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] }; * * _.invoke(object, 'a[0].b.c.slice', 1, 3); * // => [2, 3] */ var invoke = baseRest(baseInvoke); /** * Creates an array of the own enumerable property names of `object`. * * **Note:** Non-object values are coerced to objects. See the * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) * for more details. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.keys(new Foo); * // => ['a', 'b'] (iteration order is not guaranteed) * * _.keys('hi'); * // => ['0', '1'] */ function keys(object) { return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); } /** * Creates an array of the own and inherited enumerable property names of `object`. * * **Note:** Non-object values are coerced to objects. * * @static * @memberOf _ * @since 3.0.0 * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.keysIn(new Foo); * // => ['a', 'b', 'c'] (iteration order is not guaranteed) */ function keysIn(object) { return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); } /** * The opposite of `_.mapValues`; this method creates an object with the * same values as `object` and keys generated by running each own enumerable * string keyed property of `object` thru `iteratee`. The iteratee is invoked * with three arguments: (value, key, object). * * @static * @memberOf _ * @since 3.8.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns the new mapped object. * @see _.mapValues * @example * * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { * return key + value; * }); * // => { 'a1': 1, 'b2': 2 } */ function mapKeys(object, iteratee) { var result = {}; iteratee = getIteratee(iteratee, 3); baseForOwn(object, function(value, key, object) { baseAssignValue(result, iteratee(value, key, object), value); }); return result; } /** * Creates an object with the same keys as `object` and values generated * by running each own enumerable string keyed property of `object` thru * `iteratee`. The iteratee is invoked with three arguments: * (value, key, object). * * @static * @memberOf _ * @since 2.4.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns the new mapped object. * @see _.mapKeys * @example * * var users = { * 'fred': { 'user': 'fred', 'age': 40 }, * 'pebbles': { 'user': 'pebbles', 'age': 1 } * }; * * _.mapValues(users, function(o) { return o.age; }); * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) * * // The `_.property` iteratee shorthand. * _.mapValues(users, 'age'); * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) */ function mapValues(object, iteratee) { var result = {}; iteratee = getIteratee(iteratee, 3); baseForOwn(object, function(value, key, object) { baseAssignValue(result, key, iteratee(value, key, object)); }); return result; } /** * This method is like `_.assign` except that it recursively merges own and * inherited enumerable string keyed properties of source objects into the * destination object. Source properties that resolve to `undefined` are * skipped if a destination value exists. Array and plain object properties * are merged recursively. Other objects and value types are overridden by * assignment. Source objects are applied from left to right. Subsequent * sources overwrite property assignments of previous sources. * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 0.5.0 * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. * @returns {Object} Returns `object`. * @example * * var object = { * 'a': [{ 'b': 2 }, { 'd': 4 }] * }; * * var other = { * 'a': [{ 'c': 3 }, { 'e': 5 }] * }; * * _.merge(object, other); * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } */ var merge = createAssigner(function(object, source, srcIndex) { baseMerge(object, source, srcIndex); }); /** * This method is like `_.merge` except that it accepts `customizer` which * is invoked to produce the merged values of the destination and source * properties. If `customizer` returns `undefined`, merging is handled by the * method instead. The `customizer` is invoked with six arguments: * (objValue, srcValue, key, object, source, stack). * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The destination object. * @param {...Object} sources The source objects. * @param {Function} customizer The function to customize assigned values. * @returns {Object} Returns `object`. * @example * * function customizer(objValue, srcValue) { * if (_.isArray(objValue)) { * return objValue.concat(srcValue); * } * } * * var object = { 'a': [1], 'b': [2] }; * var other = { 'a': [3], 'b': [4] }; * * _.mergeWith(object, other, customizer); * // => { 'a': [1, 3], 'b': [2, 4] } */ var mergeWith = createAssigner(function(object, source, srcIndex, customizer) { baseMerge(object, source, srcIndex, customizer); }); /** * The opposite of `_.pick`; this method creates an object composed of the * own and inherited enumerable property paths of `object` that are not omitted. * * **Note:** This method is considerably slower than `_.pick`. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The source object. * @param {...(string|string[])} [paths] The property paths to omit. * @returns {Object} Returns the new object. * @example * * var object = { 'a': 1, 'b': '2', 'c': 3 }; * * _.omit(object, ['a', 'c']); * // => { 'b': '2' } */ var omit = flatRest(function(object, paths) { var result = {}; if (object == null) { return result; } var isDeep = false; paths = arrayMap(paths, function(path) { path = castPath(path, object); isDeep || (isDeep = path.length > 1); return path; }); copyObject(object, getAllKeysIn(object), result); if (isDeep) { result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone); } var length = paths.length; while (length--) { baseUnset(result, paths[length]); } return result; }); /** * The opposite of `_.pickBy`; this method creates an object composed of * the own and inherited enumerable string keyed properties of `object` that * `predicate` doesn't return truthy for. The predicate is invoked with two * arguments: (value, key). * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The source object. * @param {Function} [predicate=_.identity] The function invoked per property. * @returns {Object} Returns the new object. * @example * * var object = { 'a': 1, 'b': '2', 'c': 3 }; * * _.omitBy(object, _.isNumber); * // => { 'b': '2' } */ function omitBy(object, predicate) { return pickBy(object, negate(getIteratee(predicate))); } /** * Creates an object composed of the picked `object` properties. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The source object. * @param {...(string|string[])} [paths] The property paths to pick. * @returns {Object} Returns the new object. * @example * * var object = { 'a': 1, 'b': '2', 'c': 3 }; * * _.pick(object, ['a', 'c']); * // => { 'a': 1, 'c': 3 } */ var pick = flatRest(function(object, paths) { return object == null ? {} : basePick(object, paths); }); /** * Creates an object composed of the `object` properties `predicate` returns * truthy for. The predicate is invoked with two arguments: (value, key). * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The source object. * @param {Function} [predicate=_.identity] The function invoked per property. * @returns {Object} Returns the new object. * @example * * var object = { 'a': 1, 'b': '2', 'c': 3 }; * * _.pickBy(object, _.isNumber); * // => { 'a': 1, 'c': 3 } */ function pickBy(object, predicate) { if (object == null) { return {}; } var props = arrayMap(getAllKeysIn(object), function(prop) { return [prop]; }); predicate = getIteratee(predicate); return basePickBy(object, props, function(value, path) { return predicate(value, path[0]); }); } /** * This method is like `_.get` except that if the resolved value is a * function it's invoked with the `this` binding of its parent object and * its result is returned. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path of the property to resolve. * @param {*} [defaultValue] The value returned for `undefined` resolved values. * @returns {*} Returns the resolved value. * @example * * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; * * _.result(object, 'a[0].b.c1'); * // => 3 * * _.result(object, 'a[0].b.c2'); * // => 4 * * _.result(object, 'a[0].b.c3', 'default'); * // => 'default' * * _.result(object, 'a[0].b.c3', _.constant('default')); * // => 'default' */ function result(object, path, defaultValue) { path = castPath(path, object); var index = -1, length = path.length; // Ensure the loop is entered when path is empty. if (!length) { length = 1; object = undefined; } while (++index < length) { var value = object == null ? undefined : object[toKey(path[index])]; if (value === undefined) { index = length; value = defaultValue; } object = isFunction(value) ? value.call(object) : value; } return object; } /** * Sets the value at `path` of `object`. If a portion of `path` doesn't exist, * it's created. Arrays are created for missing index properties while objects * are created for all other missing properties. Use `_.setWith` to customize * `path` creation. * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 3.7.0 * @category Object * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to set. * @param {*} value The value to set. * @returns {Object} Returns `object`. * @example * * var object = { 'a': [{ 'b': { 'c': 3 } }] }; * * _.set(object, 'a[0].b.c', 4); * console.log(object.a[0].b.c); * // => 4 * * _.set(object, ['x', '0', 'y', 'z'], 5); * console.log(object.x[0].y.z); * // => 5 */ function set(object, path, value) { return object == null ? object : baseSet(object, path, value); } /** * This method is like `_.set` except that it accepts `customizer` which is * invoked to produce the objects of `path`. If `customizer` returns `undefined` * path creation is handled by the method instead. The `customizer` is invoked * with three arguments: (nsValue, key, nsObject). * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to set. * @param {*} value The value to set. * @param {Function} [customizer] The function to customize assigned values. * @returns {Object} Returns `object`. * @example * * var object = {}; * * _.setWith(object, '[0][1]', 'a', Object); * // => { '0': { '1': 'a' } } */ function setWith(object, path, value, customizer) { customizer = typeof customizer == 'function' ? customizer : undefined; return object == null ? object : baseSet(object, path, value, customizer); } /** * Creates an array of own enumerable string keyed-value pairs for `object` * which can be consumed by `_.fromPairs`. If `object` is a map or set, its * entries are returned. * * @static * @memberOf _ * @since 4.0.0 * @alias entries * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the key-value pairs. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.toPairs(new Foo); * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed) */ var toPairs = createToPairs(keys); /** * Creates an array of own and inherited enumerable string keyed-value pairs * for `object` which can be consumed by `_.fromPairs`. If `object` is a map * or set, its entries are returned. * * @static * @memberOf _ * @since 4.0.0 * @alias entriesIn * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the key-value pairs. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.toPairsIn(new Foo); * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed) */ var toPairsIn = createToPairs(keysIn); /** * An alternative to `_.reduce`; this method transforms `object` to a new * `accumulator` object which is the result of running each of its own * enumerable string keyed properties thru `iteratee`, with each invocation * potentially mutating the `accumulator` object. If `accumulator` is not * provided, a new object with the same `[[Prototype]]` will be used. The * iteratee is invoked with four arguments: (accumulator, value, key, object). * Iteratee functions may exit iteration early by explicitly returning `false`. * * @static * @memberOf _ * @since 1.3.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @param {*} [accumulator] The custom accumulator value. * @returns {*} Returns the accumulated value. * @example * * _.transform([2, 3, 4], function(result, n) { * result.push(n *= n); * return n % 2 == 0; * }, []); * // => [4, 9] * * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { * (result[value] || (result[value] = [])).push(key); * }, {}); * // => { '1': ['a', 'c'], '2': ['b'] } */ function transform(object, iteratee, accumulator) { var isArr = isArray(object), isArrLike = isArr || isBuffer(object) || isTypedArray(object); iteratee = getIteratee(iteratee, 4); if (accumulator == null) { var Ctor = object && object.constructor; if (isArrLike) { accumulator = isArr ? new Ctor : []; } else if (isObject(object)) { accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {}; } else { accumulator = {}; } } (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) { return iteratee(accumulator, value, index, object); }); return accumulator; } /** * Removes the property at `path` of `object`. * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to unset. * @returns {boolean} Returns `true` if the property is deleted, else `false`. * @example * * var object = { 'a': [{ 'b': { 'c': 7 } }] }; * _.unset(object, 'a[0].b.c'); * // => true * * console.log(object); * // => { 'a': [{ 'b': {} }] }; * * _.unset(object, ['a', '0', 'b', 'c']); * // => true * * console.log(object); * // => { 'a': [{ 'b': {} }] }; */ function unset(object, path) { return object == null ? true : baseUnset(object, path); } /** * This method is like `_.set` except that accepts `updater` to produce the * value to set. Use `_.updateWith` to customize `path` creation. The `updater` * is invoked with one argument: (value). * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.6.0 * @category Object * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to set. * @param {Function} updater The function to produce the updated value. * @returns {Object} Returns `object`. * @example * * var object = { 'a': [{ 'b': { 'c': 3 } }] }; * * _.update(object, 'a[0].b.c', function(n) { return n * n; }); * console.log(object.a[0].b.c); * // => 9 * * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; }); * console.log(object.x[0].y.z); * // => 0 */ function update(object, path, updater) { return object == null ? object : baseUpdate(object, path, castFunction(updater)); } /** * This method is like `_.update` except that it accepts `customizer` which is * invoked to produce the objects of `path`. If `customizer` returns `undefined` * path creation is handled by the method instead. The `customizer` is invoked * with three arguments: (nsValue, key, nsObject). * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.6.0 * @category Object * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to set. * @param {Function} updater The function to produce the updated value. * @param {Function} [customizer] The function to customize assigned values. * @returns {Object} Returns `object`. * @example * * var object = {}; * * _.updateWith(object, '[0][1]', _.constant('a'), Object); * // => { '0': { '1': 'a' } } */ function updateWith(object, path, updater, customizer) { customizer = typeof customizer == 'function' ? customizer : undefined; return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer); } /** * Creates an array of the own enumerable string keyed property values of `object`. * * **Note:** Non-object values are coerced to objects. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property values. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.values(new Foo); * // => [1, 2] (iteration order is not guaranteed) * * _.values('hi'); * // => ['h', 'i'] */ function values(object) { return object == null ? [] : baseValues(object, keys(object)); } /** * Creates an array of the own and inherited enumerable string keyed property * values of `object`. * * **Note:** Non-object values are coerced to objects. * * @static * @memberOf _ * @since 3.0.0 * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property values. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.valuesIn(new Foo); * // => [1, 2, 3] (iteration order is not guaranteed) */ function valuesIn(object) { return object == null ? [] : baseValues(object, keysIn(object)); } /*------------------------------------------------------------------------*/ /** * Clamps `number` within the inclusive `lower` and `upper` bounds. * * @static * @memberOf _ * @since 4.0.0 * @category Number * @param {number} number The number to clamp. * @param {number} [lower] The lower bound. * @param {number} upper The upper bound. * @returns {number} Returns the clamped number. * @example * * _.clamp(-10, -5, 5); * // => -5 * * _.clamp(10, -5, 5); * // => 5 */ function clamp(number, lower, upper) { if (upper === undefined) { upper = lower; lower = undefined; } if (upper !== undefined) { upper = toNumber(upper); upper = upper === upper ? upper : 0; } if (lower !== undefined) { lower = toNumber(lower); lower = lower === lower ? lower : 0; } return baseClamp(toNumber(number), lower, upper); } /** * Checks if `n` is between `start` and up to, but not including, `end`. If * `end` is not specified, it's set to `start` with `start` then set to `0`. * If `start` is greater than `end` the params are swapped to support * negative ranges. * * @static * @memberOf _ * @since 3.3.0 * @category Number * @param {number} number The number to check. * @param {number} [start=0] The start of the range. * @param {number} end The end of the range. * @returns {boolean} Returns `true` if `number` is in the range, else `false`. * @see _.range, _.rangeRight * @example * * _.inRange(3, 2, 4); * // => true * * _.inRange(4, 8); * // => true * * _.inRange(4, 2); * // => false * * _.inRange(2, 2); * // => false * * _.inRange(1.2, 2); * // => true * * _.inRange(5.2, 4); * // => false * * _.inRange(-3, -2, -6); * // => true */ function inRange(number, start, end) { start = toFinite(start); if (end === undefined) { end = start; start = 0; } else { end = toFinite(end); } number = toNumber(number); return baseInRange(number, start, end); } /** * Produces a random number between the inclusive `lower` and `upper` bounds. * If only one argument is provided a number between `0` and the given number * is returned. If `floating` is `true`, or either `lower` or `upper` are * floats, a floating-point number is returned instead of an integer. * * **Note:** JavaScript follows the IEEE-754 standard for resolving * floating-point values which can produce unexpected results. * * **Note:** If `lower` is greater than `upper`, the values are swapped. * * @static * @memberOf _ * @since 0.7.0 * @category Number * @param {number} [lower=0] The lower bound. * @param {number} [upper=1] The upper bound. * @param {boolean} [floating] Specify returning a floating-point number. * @returns {number} Returns the random number. * @example * * _.random(0, 5); * // => an integer between 0 and 5 * * // when lower is greater than upper the values are swapped * _.random(5, 0); * // => an integer between 0 and 5 * * _.random(5); * // => also an integer between 0 and 5 * * _.random(-5); * // => an integer between -5 and 0 * * _.random(5, true); * // => a floating-point number between 0 and 5 * * _.random(1.2, 5.2); * // => a floating-point number between 1.2 and 5.2 */ function random(lower, upper, floating) { if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) { upper = floating = undefined; } if (floating === undefined) { if (typeof upper == 'boolean') { floating = upper; upper = undefined; } else if (typeof lower == 'boolean') { floating = lower; lower = undefined; } } if (lower === undefined && upper === undefined) { lower = 0; upper = 1; } else { lower = toFinite(lower); if (upper === undefined) { upper = lower; lower = 0; } else { upper = toFinite(upper); } } if (lower > upper) { var temp = lower; lower = upper; upper = temp; } if (floating || lower % 1 || upper % 1) { var rand = nativeRandom(); return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper); } return baseRandom(lower, upper); } /*------------------------------------------------------------------------*/ /** * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the camel cased string. * @example * * _.camelCase('Foo Bar'); * // => 'fooBar' * * _.camelCase('--foo-bar--'); * // => 'fooBar' * * _.camelCase('__FOO_BAR__'); * // => 'fooBar' */ var camelCase = createCompounder(function(result, word, index) { word = word.toLowerCase(); return result + (index ? capitalize(word) : word); }); /** * Converts the first character of `string` to upper case and the remaining * to lower case. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to capitalize. * @returns {string} Returns the capitalized string. * @example * * _.capitalize('FRED'); * // => 'Fred' */ function capitalize(string) { return upperFirst(toString(string).toLowerCase()); } /** * Deburrs `string` by converting * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A) * letters to basic Latin letters and removing * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to deburr. * @returns {string} Returns the deburred string. * @example * * _.deburr('déjà vu'); * // => 'deja vu' */ function deburr(string) { string = toString(string); return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ''); } /** * Checks if `string` ends with the given target string. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to inspect. * @param {string} [target] The string to search for. * @param {number} [position=string.length] The position to search up to. * @returns {boolean} Returns `true` if `string` ends with `target`, * else `false`. * @example * * _.endsWith('abc', 'c'); * // => true * * _.endsWith('abc', 'b'); * // => false * * _.endsWith('abc', 'b', 2); * // => true */ function endsWith(string, target, position) { string = toString(string); target = baseToString(target); var length = string.length; position = position === undefined ? length : baseClamp(toInteger(position), 0, length); var end = position; position -= target.length; return position >= 0 && string.slice(position, end) == target; } /** * Converts the characters "&", "<", ">", '"', and "'" in `string` to their * corresponding HTML entities. * * **Note:** No other characters are escaped. To escape additional * characters use a third-party library like [_he_](https://mths.be/he). * * Though the ">" character is escaped for symmetry, characters like * ">" and "/" don't need escaping in HTML and have no special meaning * unless they're part of a tag or unquoted attribute value. See * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) * (under "semi-related fun fact") for more details. * * When working with HTML you should always * [quote attribute values](http://wonko.com/post/html-escaping) to reduce * XSS vectors. * * @static * @since 0.1.0 * @memberOf _ * @category String * @param {string} [string=''] The string to escape. * @returns {string} Returns the escaped string. * @example * * _.escape('fred, barney, & pebbles'); * // => 'fred, barney, & pebbles' */ function escape(string) { string = toString(string); return (string && reHasUnescapedHtml.test(string)) ? string.replace(reUnescapedHtml, escapeHtmlChar) : string; } /** * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to escape. * @returns {string} Returns the escaped string. * @example * * _.escapeRegExp('[lodash](https://lodash.com/)'); * // => '\[lodash\]\(https://lodash\.com/\)' */ function escapeRegExp(string) { string = toString(string); return (string && reHasRegExpChar.test(string)) ? string.replace(reRegExpChar, '\\$&') : string; } /** * Converts `string` to * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the kebab cased string. * @example * * _.kebabCase('Foo Bar'); * // => 'foo-bar' * * _.kebabCase('fooBar'); * // => 'foo-bar' * * _.kebabCase('__FOO_BAR__'); * // => 'foo-bar' */ var kebabCase = createCompounder(function(result, word, index) { return result + (index ? '-' : '') + word.toLowerCase(); }); /** * Converts `string`, as space separated words, to lower case. * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the lower cased string. * @example * * _.lowerCase('--Foo-Bar--'); * // => 'foo bar' * * _.lowerCase('fooBar'); * // => 'foo bar' * * _.lowerCase('__FOO_BAR__'); * // => 'foo bar' */ var lowerCase = createCompounder(function(result, word, index) { return result + (index ? ' ' : '') + word.toLowerCase(); }); /** * Converts the first character of `string` to lower case. * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the converted string. * @example * * _.lowerFirst('Fred'); * // => 'fred' * * _.lowerFirst('FRED'); * // => 'fRED' */ var lowerFirst = createCaseFirst('toLowerCase'); /** * Pads `string` on the left and right sides if it's shorter than `length`. * Padding characters are truncated if they can't be evenly divided by `length`. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to pad. * @param {number} [length=0] The padding length. * @param {string} [chars=' '] The string used as padding. * @returns {string} Returns the padded string. * @example * * _.pad('abc', 8); * // => ' abc ' * * _.pad('abc', 8, '_-'); * // => '_-abc_-_' * * _.pad('abc', 3); * // => 'abc' */ function pad(string, length, chars) { string = toString(string); length = toInteger(length); var strLength = length ? stringSize(string) : 0; if (!length || strLength >= length) { return string; } var mid = (length - strLength) / 2; return ( createPadding(nativeFloor(mid), chars) + string + createPadding(nativeCeil(mid), chars) ); } /** * Pads `string` on the right side if it's shorter than `length`. Padding * characters are truncated if they exceed `length`. * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to pad. * @param {number} [length=0] The padding length. * @param {string} [chars=' '] The string used as padding. * @returns {string} Returns the padded string. * @example * * _.padEnd('abc', 6); * // => 'abc ' * * _.padEnd('abc', 6, '_-'); * // => 'abc_-_' * * _.padEnd('abc', 3); * // => 'abc' */ function padEnd(string, length, chars) { string = toString(string); length = toInteger(length); var strLength = length ? stringSize(string) : 0; return (length && strLength < length) ? (string + createPadding(length - strLength, chars)) : string; } /** * Pads `string` on the left side if it's shorter than `length`. Padding * characters are truncated if they exceed `length`. * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to pad. * @param {number} [length=0] The padding length. * @param {string} [chars=' '] The string used as padding. * @returns {string} Returns the padded string. * @example * * _.padStart('abc', 6); * // => ' abc' * * _.padStart('abc', 6, '_-'); * // => '_-_abc' * * _.padStart('abc', 3); * // => 'abc' */ function padStart(string, length, chars) { string = toString(string); length = toInteger(length); var strLength = length ? stringSize(string) : 0; return (length && strLength < length) ? (createPadding(length - strLength, chars) + string) : string; } /** * Converts `string` to an integer of the specified radix. If `radix` is * `undefined` or `0`, a `radix` of `10` is used unless `value` is a * hexadecimal, in which case a `radix` of `16` is used. * * **Note:** This method aligns with the * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`. * * @static * @memberOf _ * @since 1.1.0 * @category String * @param {string} string The string to convert. * @param {number} [radix=10] The radix to interpret `value` by. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {number} Returns the converted integer. * @example * * _.parseInt('08'); * // => 8 * * _.map(['6', '08', '10'], _.parseInt); * // => [6, 8, 10] */ function parseInt(string, radix, guard) { if (guard || radix == null) { radix = 0; } else if (radix) { radix = +radix; } return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0); } /** * Repeats the given string `n` times. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to repeat. * @param {number} [n=1] The number of times to repeat the string. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {string} Returns the repeated string. * @example * * _.repeat('*', 3); * // => '***' * * _.repeat('abc', 2); * // => 'abcabc' * * _.repeat('abc', 0); * // => '' */ function repeat(string, n, guard) { if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) { n = 1; } else { n = toInteger(n); } return baseRepeat(toString(string), n); } /** * Replaces matches for `pattern` in `string` with `replacement`. * * **Note:** This method is based on * [`String#replace`](https://mdn.io/String/replace). * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to modify. * @param {RegExp|string} pattern The pattern to replace. * @param {Function|string} replacement The match replacement. * @returns {string} Returns the modified string. * @example * * _.replace('Hi Fred', 'Fred', 'Barney'); * // => 'Hi Barney' */ function replace() { var args = arguments, string = toString(args[0]); return args.length < 3 ? string : string.replace(args[1], args[2]); } /** * Converts `string` to * [snake case](https://en.wikipedia.org/wiki/Snake_case). * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the snake cased string. * @example * * _.snakeCase('Foo Bar'); * // => 'foo_bar' * * _.snakeCase('fooBar'); * // => 'foo_bar' * * _.snakeCase('--FOO-BAR--'); * // => 'foo_bar' */ var snakeCase = createCompounder(function(result, word, index) { return result + (index ? '_' : '') + word.toLowerCase(); }); /** * Splits `string` by `separator`. * * **Note:** This method is based on * [`String#split`](https://mdn.io/String/split). * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to split. * @param {RegExp|string} separator The separator pattern to split by. * @param {number} [limit] The length to truncate results to. * @returns {Array} Returns the string segments. * @example * * _.split('a-b-c', '-', 2); * // => ['a', 'b'] */ function split(string, separator, limit) { if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) { separator = limit = undefined; } limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0; if (!limit) { return []; } string = toString(string); if (string && ( typeof separator == 'string' || (separator != null && !isRegExp(separator)) )) { separator = baseToString(separator); if (!separator && hasUnicode(string)) { return castSlice(stringToArray(string), 0, limit); } } return string.split(separator, limit); } /** * Converts `string` to * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage). * * @static * @memberOf _ * @since 3.1.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the start cased string. * @example * * _.startCase('--foo-bar--'); * // => 'Foo Bar' * * _.startCase('fooBar'); * // => 'Foo Bar' * * _.startCase('__FOO_BAR__'); * // => 'FOO BAR' */ var startCase = createCompounder(function(result, word, index) { return result + (index ? ' ' : '') + upperFirst(word); }); /** * Checks if `string` starts with the given target string. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to inspect. * @param {string} [target] The string to search for. * @param {number} [position=0] The position to search from. * @returns {boolean} Returns `true` if `string` starts with `target`, * else `false`. * @example * * _.startsWith('abc', 'a'); * // => true * * _.startsWith('abc', 'b'); * // => false * * _.startsWith('abc', 'b', 1); * // => true */ function startsWith(string, target, position) { string = toString(string); position = position == null ? 0 : baseClamp(toInteger(position), 0, string.length); target = baseToString(target); return string.slice(position, position + target.length) == target; } /** * Creates a compiled template function that can interpolate data properties * in "interpolate" delimiters, HTML-escape interpolated data properties in * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data * properties may be accessed as free variables in the template. If a setting * object is given, it takes precedence over `_.templateSettings` values. * * **Security:** `_.template` is insecure and should not be used. It will be * removed in Lodash v5. Avoid untrusted input. See * [threat model](https://github.com/lodash/lodash/blob/main/threat-model.md). * * **Note:** In the development build `_.template` utilizes * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) * for easier debugging. * * For more information on precompiling templates see * [lodash's custom builds documentation](https://lodash.com/custom-builds). * * For more information on Chrome extension sandboxes see * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). * * @static * @since 0.1.0 * @memberOf _ * @category String * @param {string} [string=''] The template string. * @param {Object} [options={}] The options object. * @param {RegExp} [options.escape=_.templateSettings.escape] * The HTML "escape" delimiter. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate] * The "evaluate" delimiter. * @param {Object} [options.imports=_.templateSettings.imports] * An object to import into the template as free variables. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate] * The "interpolate" delimiter. * @param {string} [options.sourceURL='lodash.templateSources[n]'] * The sourceURL of the compiled template. * @param {string} [options.variable='obj'] * The data object variable name. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Function} Returns the compiled template function. * @example * * // Use the "interpolate" delimiter to create a compiled template. * var compiled = _.template('hello <%= user %>!'); * compiled({ 'user': 'fred' }); * // => 'hello fred!' * * // Use the HTML "escape" delimiter to escape data property values. * var compiled = _.template('<b><%- value %></b>'); * compiled({ 'value': '<script>' }); * // => '<b><script></b>' * * // Use the "evaluate" delimiter to execute JavaScript and generate HTML. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>'); * compiled({ 'users': ['fred', 'barney'] }); * // => '<li>fred</li><li>barney</li>' * * // Use the internal `print` function in "evaluate" delimiters. * var compiled = _.template('<% print("hello " + user); %>!'); * compiled({ 'user': 'barney' }); * // => 'hello barney!' * * // Use the ES template literal delimiter as an "interpolate" delimiter. * // Disable support by replacing the "interpolate" delimiter. * var compiled = _.template('hello ${ user }!'); * compiled({ 'user': 'pebbles' }); * // => 'hello pebbles!' * * // Use backslashes to treat delimiters as plain text. * var compiled = _.template('<%= "\\<%- value %\\>" %>'); * compiled({ 'value': 'ignored' }); * // => '<%- value %>' * * // Use the `imports` option to import `jQuery` as `jq`. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>'; * var compiled = _.template(text, { 'imports': { 'jq': jQuery } }); * compiled({ 'users': ['fred', 'barney'] }); * // => '<li>fred</li><li>barney</li>' * * // Use the `sourceURL` option to specify a custom sourceURL for the template. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' }); * compiled(data); * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector. * * // Use the `variable` option to ensure a with-statement isn't used in the compiled template. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' }); * compiled.source; * // => function(data) { * // var __t, __p = ''; * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!'; * // return __p; * // } * * // Use custom template delimiters. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g; * var compiled = _.template('hello {{ user }}!'); * compiled({ 'user': 'mustache' }); * // => 'hello mustache!' * * // Use the `source` property to inline compiled templates for meaningful * // line numbers in error messages and stack traces. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\ * var JST = {\ * "main": ' + _.template(mainText).source + '\ * };\ * '); */ function template(string, options, guard) { // Based on John Resig's `tmpl` implementation // (http://ejohn.org/blog/javascript-micro-templating/) // and Laura Doktorova's doT.js (https://github.com/olado/doT). var settings = lodash.templateSettings; if (guard && isIterateeCall(string, options, guard)) { options = undefined; } string = toString(string); options = assignWith({}, options, settings, customDefaultsAssignIn); var imports = assignWith({}, options.imports, settings.imports, customDefaultsAssignIn), importsKeys = keys(imports), importsValues = baseValues(imports, importsKeys); arrayEach(importsKeys, function(key) { if (reForbiddenIdentifierChars.test(key)) { throw new Error(INVALID_TEMPL_IMPORTS_ERROR_TEXT); } }); var isEscaping, isEvaluating, index = 0, interpolate = options.interpolate || reNoMatch, source = "__p += '"; // Compile the regexp to match each delimiter. var reDelimiters = RegExp( (options.escape || reNoMatch).source + '|' + interpolate.source + '|' + (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' + (options.evaluate || reNoMatch).source + '|$' , 'g'); // Use a sourceURL for easier debugging. // The sourceURL gets injected into the source that's eval-ed, so be careful // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in // and escape the comment, thus injecting code that gets evaled. var sourceURL = '//# sourceURL=' + (hasOwnProperty.call(options, 'sourceURL') ? (options.sourceURL + '').replace(/\s/g, ' ') : ('lodash.templateSources[' + (++templateCounter) + ']') ) + '\n'; string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) { interpolateValue || (interpolateValue = esTemplateValue); // Escape characters that can't be included in string literals. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar); // Replace delimiters with snippets. if (escapeValue) { isEscaping = true; source += "' +\n__e(" + escapeValue + ") +\n'"; } if (evaluateValue) { isEvaluating = true; source += "';\n" + evaluateValue + ";\n__p += '"; } if (interpolateValue) { source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'"; } index = offset + match.length; // The JS engine embedded in Adobe products needs `match` returned in // order to produce the correct `offset` value. return match; }); source += "';\n"; // If `variable` is not specified wrap a with-statement around the generated // code to add the data object to the top of the scope chain. var variable = hasOwnProperty.call(options, 'variable') && options.variable; if (!variable) { source = 'with (obj) {\n' + source + '\n}\n'; } // Throw an error if a forbidden character was found in `variable`, to prevent // potential command injection attacks. else if (reForbiddenIdentifierChars.test(variable)) { throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT); } // Cleanup code by stripping empty strings. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source) .replace(reEmptyStringMiddle, '$1') .replace(reEmptyStringTrailing, '$1;'); // Frame code as the function body. source = 'function(' + (variable || 'obj') + ') {\n' + (variable ? '' : 'obj || (obj = {});\n' ) + "var __t, __p = ''" + (isEscaping ? ', __e = _.escape' : '' ) + (isEvaluating ? ', __j = Array.prototype.join;\n' + "function print() { __p += __j.call(arguments, '') }\n" : ';\n' ) + source + 'return __p\n}'; var result = attempt(function() { return Function(importsKeys, sourceURL + 'return ' + source) .apply(undefined, importsValues); }); // Provide the compiled function's source by its `toString` method or // the `source` property as a convenience for inlining compiled templates. result.source = source; if (isError(result)) { throw result; } return result; } /** * Converts `string`, as a whole, to lower case just like * [String#toLowerCase](https://mdn.io/toLowerCase). * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the lower cased string. * @example * * _.toLower('--Foo-Bar--'); * // => '--foo-bar--' * * _.toLower('fooBar'); * // => 'foobar' * * _.toLower('__FOO_BAR__'); * // => '__foo_bar__' */ function toLower(value) { return toString(value).toLowerCase(); } /** * Converts `string`, as a whole, to upper case just like * [String#toUpperCase](https://mdn.io/toUpperCase). * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the upper cased string. * @example * * _.toUpper('--foo-bar--'); * // => '--FOO-BAR--' * * _.toUpper('fooBar'); * // => 'FOOBAR' * * _.toUpper('__foo_bar__'); * // => '__FOO_BAR__' */ function toUpper(value) { return toString(value).toUpperCase(); } /** * Removes leading and trailing whitespace or specified characters from `string`. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to trim. * @param {string} [chars=whitespace] The characters to trim. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {string} Returns the trimmed string. * @example * * _.trim(' abc '); * // => 'abc' * * _.trim('-_-abc-_-', '_-'); * // => 'abc' * * _.map([' foo ', ' bar '], _.trim); * // => ['foo', 'bar'] */ function trim(string, chars, guard) { string = toString(string); if (string && (guard || chars === undefined)) { return baseTrim(string); } if (!string || !(chars = baseToString(chars))) { return string; } var strSymbols = stringToArray(string), chrSymbols = stringToArray(chars), start = charsStartIndex(strSymbols, chrSymbols), end = charsEndIndex(strSymbols, chrSymbols) + 1; return castSlice(strSymbols, start, end).join(''); } /** * Removes trailing whitespace or specified characters from `string`. * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to trim. * @param {string} [chars=whitespace] The characters to trim. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {string} Returns the trimmed string. * @example * * _.trimEnd(' abc '); * // => ' abc' * * _.trimEnd('-_-abc-_-', '_-'); * // => '-_-abc' */ function trimEnd(string, chars, guard) { string = toString(string); if (string && (guard || chars === undefined)) { return string.slice(0, trimmedEndIndex(string) + 1); } if (!string || !(chars = baseToString(chars))) { return string; } var strSymbols = stringToArray(string), end = charsEndIndex(strSymbols, stringToArray(chars)) + 1; return castSlice(strSymbols, 0, end).join(''); } /** * Removes leading whitespace or specified characters from `string`. * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to trim. * @param {string} [chars=whitespace] The characters to trim. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {string} Returns the trimmed string. * @example * * _.trimStart(' abc '); * // => 'abc ' * * _.trimStart('-_-abc-_-', '_-'); * // => 'abc-_-' */ function trimStart(string, chars, guard) { string = toString(string); if (string && (guard || chars === undefined)) { return string.replace(reTrimStart, ''); } if (!string || !(chars = baseToString(chars))) { return string; } var strSymbols = stringToArray(string), start = charsStartIndex(strSymbols, stringToArray(chars)); return castSlice(strSymbols, start).join(''); } /** * Truncates `string` if it's longer than the given maximum string length. * The last characters of the truncated string are replaced with the omission * string which defaults to "...". * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to truncate. * @param {Object} [options={}] The options object. * @param {number} [options.length=30] The maximum string length. * @param {string} [options.omission='...'] The string to indicate text is omitted. * @param {RegExp|string} [options.separator] The separator pattern to truncate to. * @returns {string} Returns the truncated string. * @example * * _.truncate('hi-diddly-ho there, neighborino'); * // => 'hi-diddly-ho there, neighbo...' * * _.truncate('hi-diddly-ho there, neighborino', { * 'length': 24, * 'separator': ' ' * }); * // => 'hi-diddly-ho there,...' * * _.truncate('hi-diddly-ho there, neighborino', { * 'length': 24, * 'separator': /,? +/ * }); * // => 'hi-diddly-ho there...' * * _.truncate('hi-diddly-ho there, neighborino', { * 'omission': ' [...]' * }); * // => 'hi-diddly-ho there, neig [...]' */ function truncate(string, options) { var length = DEFAULT_TRUNC_LENGTH, omission = DEFAULT_TRUNC_OMISSION; if (isObject(options)) { var separator = 'separator' in options ? options.separator : separator; length = 'length' in options ? toInteger(options.length) : length; omission = 'omission' in options ? baseToString(options.omission) : omission; } string = toString(string); var strLength = string.length; if (hasUnicode(string)) { var strSymbols = stringToArray(string); strLength = strSymbols.length; } if (length >= strLength) { return string; } var end = length - stringSize(omission); if (end < 1) { return omission; } var result = strSymbols ? castSlice(strSymbols, 0, end).join('') : string.slice(0, end); if (separator === undefined) { return result + omission; } if (strSymbols) { end += (result.length - end); } if (isRegExp(separator)) { if (string.slice(end).search(separator)) { var match, substring = result; if (!separator.global) { separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g'); } separator.lastIndex = 0; while ((match = separator.exec(substring))) { var newEnd = match.index; } result = result.slice(0, newEnd === undefined ? end : newEnd); } } else if (string.indexOf(baseToString(separator), end) != end) { var index = result.lastIndexOf(separator); if (index > -1) { result = result.slice(0, index); } } return result + omission; } /** * The inverse of `_.escape`; this method converts the HTML entities * `&`, `<`, `>`, `"`, and `'` in `string` to * their corresponding characters. * * **Note:** No other HTML entities are unescaped. To unescape additional * HTML entities use a third-party library like [_he_](https://mths.be/he). * * @static * @memberOf _ * @since 0.6.0 * @category String * @param {string} [string=''] The string to unescape. * @returns {string} Returns the unescaped string. * @example * * _.unescape('fred, barney, & pebbles'); * // => 'fred, barney, & pebbles' */ function unescape(string) { string = toString(string); return (string && reHasEscapedHtml.test(string)) ? string.replace(reEscapedHtml, unescapeHtmlChar) : string; } /** * Converts `string`, as space separated words, to upper case. * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the upper cased string. * @example * * _.upperCase('--foo-bar'); * // => 'FOO BAR' * * _.upperCase('fooBar'); * // => 'FOO BAR' * * _.upperCase('__foo_bar__'); * // => 'FOO BAR' */ var upperCase = createCompounder(function(result, word, index) { return result + (index ? ' ' : '') + word.toUpperCase(); }); /** * Converts the first character of `string` to upper case. * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the converted string. * @example * * _.upperFirst('fred'); * // => 'Fred' * * _.upperFirst('FRED'); * // => 'FRED' */ var upperFirst = createCaseFirst('toUpperCase'); /** * Splits `string` into an array of its words. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to inspect. * @param {RegExp|string} [pattern] The pattern to match words. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the words of `string`. * @example * * _.words('fred, barney, & pebbles'); * // => ['fred', 'barney', 'pebbles'] * * _.words('fred, barney, & pebbles', /[^, ]+/g); * // => ['fred', 'barney', '&', 'pebbles'] */ function words(string, pattern, guard) { string = toString(string); pattern = guard ? undefined : pattern; if (pattern === undefined) { return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string); } return string.match(pattern) || []; } /*------------------------------------------------------------------------*/ /** * Attempts to invoke `func`, returning either the result or the caught error * object. Any additional arguments are provided to `func` when it's invoked. * * @static * @memberOf _ * @since 3.0.0 * @category Util * @param {Function} func The function to attempt. * @param {...*} [args] The arguments to invoke `func` with. * @returns {*} Returns the `func` result or error object. * @example * * // Avoid throwing errors for invalid selectors. * var elements = _.attempt(function(selector) { * return document.querySelectorAll(selector); * }, '>_>'); * * if (_.isError(elements)) { * elements = []; * } */ var attempt = baseRest(function(func, args) { try { return apply(func, undefined, args); } catch (e) { return isError(e) ? e : new Error(e); } }); /** * Binds methods of an object to the object itself, overwriting the existing * method. * * **Note:** This method doesn't set the "length" property of bound functions. * * @static * @since 0.1.0 * @memberOf _ * @category Util * @param {Object} object The object to bind and assign the bound methods to. * @param {...(string|string[])} methodNames The object method names to bind. * @returns {Object} Returns `object`. * @example * * var view = { * 'label': 'docs', * 'click': function() { * console.log('clicked ' + this.label); * } * }; * * _.bindAll(view, ['click']); * jQuery(element).on('click', view.click); * // => Logs 'clicked docs' when clicked. */ var bindAll = flatRest(function(object, methodNames) { arrayEach(methodNames, function(key) { key = toKey(key); baseAssignValue(object, key, bind(object[key], object)); }); return object; }); /** * Creates a function that iterates over `pairs` and invokes the corresponding * function of the first predicate to return truthy. The predicate-function * pairs are invoked with the `this` binding and arguments of the created * function. * * @static * @memberOf _ * @since 4.0.0 * @category Util * @param {Array} pairs The predicate-function pairs. * @returns {Function} Returns the new composite function. * @example * * var func = _.cond([ * [_.matches({ 'a': 1 }), _.constant('matches A')], * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')], * [_.stubTrue, _.constant('no match')] * ]); * * func({ 'a': 1, 'b': 2 }); * // => 'matches A' * * func({ 'a': 0, 'b': 1 }); * // => 'matches B' * * func({ 'a': '1', 'b': '2' }); * // => 'no match' */ function cond(pairs) { var length = pairs == null ? 0 : pairs.length, toIteratee = getIteratee(); pairs = !length ? [] : arrayMap(pairs, function(pair) { if (typeof pair[1] != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } return [toIteratee(pair[0]), pair[1]]; }); return baseRest(function(args) { var index = -1; while (++index < length) { var pair = pairs[index]; if (apply(pair[0], this, args)) { return apply(pair[1], this, args); } } }); } /** * Creates a function that invokes the predicate properties of `source` with * the corresponding property values of a given object, returning `true` if * all predicates return truthy, else `false`. * * **Note:** The created function is equivalent to `_.conformsTo` with * `source` partially applied. * * @static * @memberOf _ * @since 4.0.0 * @category Util * @param {Object} source The object of property predicates to conform to. * @returns {Function} Returns the new spec function. * @example * * var objects = [ * { 'a': 2, 'b': 1 }, * { 'a': 1, 'b': 2 } * ]; * * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } })); * // => [{ 'a': 1, 'b': 2 }] */ function conforms(source) { return baseConforms(baseClone(source, CLONE_DEEP_FLAG)); } /** * Creates a function that returns `value`. * * @static * @memberOf _ * @since 2.4.0 * @category Util * @param {*} value The value to return from the new function. * @returns {Function} Returns the new constant function. * @example * * var objects = _.times(2, _.constant({ 'a': 1 })); * * console.log(objects); * // => [{ 'a': 1 }, { 'a': 1 }] * * console.log(objects[0] === objects[1]); * // => true */ function constant(value) { return function() { return value; }; } /** * Checks `value` to determine whether a default value should be returned in * its place. The `defaultValue` is returned if `value` is `NaN`, `null`, * or `undefined`. * * @static * @memberOf _ * @since 4.14.0 * @category Util * @param {*} value The value to check. * @param {*} defaultValue The default value. * @returns {*} Returns the resolved value. * @example * * _.defaultTo(1, 10); * // => 1 * * _.defaultTo(undefined, 10); * // => 10 */ function defaultTo(value, defaultValue) { return (value == null || value !== value) ? defaultValue : value; } /** * Creates a function that returns the result of invoking the given functions * with the `this` binding of the created function, where each successive * invocation is supplied the return value of the previous. * * @static * @memberOf _ * @since 3.0.0 * @category Util * @param {...(Function|Function[])} [funcs] The functions to invoke. * @returns {Function} Returns the new composite function. * @see _.flowRight * @example * * function square(n) { * return n * n; * } * * var addSquare = _.flow([_.add, square]); * addSquare(1, 2); * // => 9 */ var flow = createFlow(); /** * This method is like `_.flow` except that it creates a function that * invokes the given functions from right to left. * * @static * @since 3.0.0 * @memberOf _ * @category Util * @param {...(Function|Function[])} [funcs] The functions to invoke. * @returns {Function} Returns the new composite function. * @see _.flow * @example * * function square(n) { * return n * n; * } * * var addSquare = _.flowRight([square, _.add]); * addSquare(1, 2); * // => 9 */ var flowRight = createFlow(true); /** * This method returns the first argument it receives. * * @static * @since 0.1.0 * @memberOf _ * @category Util * @param {*} value Any value. * @returns {*} Returns `value`. * @example * * var object = { 'a': 1 }; * * console.log(_.identity(object) === object); * // => true */ function identity(value) { return value; } /** * Creates a function that invokes `func` with the arguments of the created * function. If `func` is a property name, the created function returns the * property value for a given element. If `func` is an array or object, the * created function returns `true` for elements that contain the equivalent * source properties, otherwise it returns `false`. * * @static * @since 4.0.0 * @memberOf _ * @category Util * @param {*} [func=_.identity] The value to convert to a callback. * @returns {Function} Returns the callback. * @example * * var users = [ * { 'user': 'barney', 'age': 36, 'active': true }, * { 'user': 'fred', 'age': 40, 'active': false } * ]; * * // The `_.matches` iteratee shorthand. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true })); * // => [{ 'user': 'barney', 'age': 36, 'active': true }] * * // The `_.matchesProperty` iteratee shorthand. * _.filter(users, _.iteratee(['user', 'fred'])); * // => [{ 'user': 'fred', 'age': 40 }] * * // The `_.property` iteratee shorthand. * _.map(users, _.iteratee('user')); * // => ['barney', 'fred'] * * // Create custom iteratee shorthands. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) { * return !_.isRegExp(func) ? iteratee(func) : function(string) { * return func.test(string); * }; * }); * * _.filter(['abc', 'def'], /ef/); * // => ['def'] */ function iteratee(func) { return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG)); } /** * Creates a function that performs a partial deep comparison between a given * object and `source`, returning `true` if the given object has equivalent * property values, else `false`. * * **Note:** The created function is equivalent to `_.isMatch` with `source` * partially applied. * * Partial comparisons will match empty array and empty object `source` * values against any array or object value, respectively. See `_.isEqual` * for a list of supported value comparisons. * * **Note:** Multiple values can be checked by combining several matchers * using `_.overSome` * * @static * @memberOf _ * @since 3.0.0 * @category Util * @param {Object} source The object of property values to match. * @returns {Function} Returns the new spec function. * @example * * var objects = [ * { 'a': 1, 'b': 2, 'c': 3 }, * { 'a': 4, 'b': 5, 'c': 6 } * ]; * * _.filter(objects, _.matches({ 'a': 4, 'c': 6 })); * // => [{ 'a': 4, 'b': 5, 'c': 6 }] * * // Checking for several possible values * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })])); * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }] */ function matches(source) { return baseMatches(baseClone(source, CLONE_DEEP_FLAG)); } /** * Creates a function that performs a partial deep comparison between the * value at `path` of a given object to `srcValue`, returning `true` if the * object value is equivalent, else `false`. * * **Note:** Partial comparisons will match empty array and empty object * `srcValue` values against any array or object value, respectively. See * `_.isEqual` for a list of supported value comparisons. * * **Note:** Multiple values can be checked by combining several matchers * using `_.overSome` * * @static * @memberOf _ * @since 3.2.0 * @category Util * @param {Array|string} path The path of the property to get. * @param {*} srcValue The value to match. * @returns {Function} Returns the new spec function. * @example * * var objects = [ * { 'a': 1, 'b': 2, 'c': 3 }, * { 'a': 4, 'b': 5, 'c': 6 } * ]; * * _.find(objects, _.matchesProperty('a', 4)); * // => { 'a': 4, 'b': 5, 'c': 6 } * * // Checking for several possible values * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)])); * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }] */ function matchesProperty(path, srcValue) { return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG)); } /** * Creates a function that invokes the method at `path` of a given object. * Any additional arguments are provided to the invoked method. * * @static * @memberOf _ * @since 3.7.0 * @category Util * @param {Array|string} path The path of the method to invoke. * @param {...*} [args] The arguments to invoke the method with. * @returns {Function} Returns the new invoker function. * @example * * var objects = [ * { 'a': { 'b': _.constant(2) } }, * { 'a': { 'b': _.constant(1) } } * ]; * * _.map(objects, _.method('a.b')); * // => [2, 1] * * _.map(objects, _.method(['a', 'b'])); * // => [2, 1] */ var method = baseRest(function(path, args) { return function(object) { return baseInvoke(object, path, args); }; }); /** * The opposite of `_.method`; this method creates a function that invokes * the method at a given path of `object`. Any additional arguments are * provided to the invoked method. * * @static * @memberOf _ * @since 3.7.0 * @category Util * @param {Object} object The object to query. * @param {...*} [args] The arguments to invoke the method with. * @returns {Function} Returns the new invoker function. * @example * * var array = _.times(3, _.constant), * object = { 'a': array, 'b': array, 'c': array }; * * _.map(['a[2]', 'c[0]'], _.methodOf(object)); * // => [2, 0] * * _.map([['a', '2'], ['c', '0']], _.methodOf(object)); * // => [2, 0] */ var methodOf = baseRest(function(object, args) { return function(path) { return baseInvoke(object, path, args); }; }); /** * Adds all own enumerable string keyed function properties of a source * object to the destination object. If `object` is a function, then methods * are added to its prototype as well. * * **Note:** Use `_.runInContext` to create a pristine `lodash` function to * avoid conflicts caused by modifying the original. * * @static * @since 0.1.0 * @memberOf _ * @category Util * @param {Function|Object} [object=lodash] The destination object. * @param {Object} source The object of functions to add. * @param {Object} [options={}] The options object. * @param {boolean} [options.chain=true] Specify whether mixins are chainable. * @returns {Function|Object} Returns `object`. * @example * * function vowels(string) { * return _.filter(string, function(v) { * return /[aeiou]/i.test(v); * }); * } * * _.mixin({ 'vowels': vowels }); * _.vowels('fred'); * // => ['e'] * * _('fred').vowels().value(); * // => ['e'] * * _.mixin({ 'vowels': vowels }, { 'chain': false }); * _('fred').vowels(); * // => ['e'] */ function mixin(object, source, options) { var props = keys(source), methodNames = baseFunctions(source, props); if (options == null && !(isObject(source) && (methodNames.length || !props.length))) { options = source; source = object; object = this; methodNames = baseFunctions(source, keys(source)); } var chain = !(isObject(options) && 'chain' in options) || !!options.chain, isFunc = isFunction(object); arrayEach(methodNames, function(methodName) { var func = source[methodName]; object[methodName] = func; if (isFunc) { object.prototype[methodName] = function() { var chainAll = this.__chain__; if (chain || chainAll) { var result = object(this.__wrapped__), actions = result.__actions__ = copyArray(this.__actions__); actions.push({ 'func': func, 'args': arguments, 'thisArg': object }); result.__chain__ = chainAll; return result; } return func.apply(object, arrayPush([this.value()], arguments)); }; } }); return object; } /** * Reverts the `_` variable to its previous value and returns a reference to * the `lodash` function. * * @static * @since 0.1.0 * @memberOf _ * @category Util * @returns {Function} Returns the `lodash` function. * @example * * var lodash = _.noConflict(); */ function noConflict() { if (root._ === this) { root._ = oldDash; } return this; } /** * This method returns `undefined`. * * @static * @memberOf _ * @since 2.3.0 * @category Util * @example * * _.times(2, _.noop); * // => [undefined, undefined] */ function noop() { // No operation performed. } /** * Creates a function that gets the argument at index `n`. If `n` is negative, * the nth argument from the end is returned. * * @static * @memberOf _ * @since 4.0.0 * @category Util * @param {number} [n=0] The index of the argument to return. * @returns {Function} Returns the new pass-thru function. * @example * * var func = _.nthArg(1); * func('a', 'b', 'c', 'd'); * // => 'b' * * var func = _.nthArg(-2); * func('a', 'b', 'c', 'd'); * // => 'c' */ function nthArg(n) { n = toInteger(n); return baseRest(function(args) { return baseNth(args, n); }); } /** * Creates a function that invokes `iteratees` with the arguments it receives * and returns their results. * * @static * @memberOf _ * @since 4.0.0 * @category Util * @param {...(Function|Function[])} [iteratees=[_.identity]] * The iteratees to invoke. * @returns {Function} Returns the new function. * @example * * var func = _.over([Math.max, Math.min]); * * func(1, 2, 3, 4); * // => [4, 1] */ var over = createOver(arrayMap); /** * Creates a function that checks if **all** of the `predicates` return * truthy when invoked with the arguments it receives. * * Following shorthands are possible for providing predicates. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them. * * @static * @memberOf _ * @since 4.0.0 * @category Util * @param {...(Function|Function[])} [predicates=[_.identity]] * The predicates to check. * @returns {Function} Returns the new function. * @example * * var func = _.overEvery([Boolean, isFinite]); * * func('1'); * // => true * * func(null); * // => false * * func(NaN); * // => false */ var overEvery = createOver(arrayEvery); /** * Creates a function that checks if **any** of the `predicates` return * truthy when invoked with the arguments it receives. * * Following shorthands are possible for providing predicates. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them. * * @static * @memberOf _ * @since 4.0.0 * @category Util * @param {...(Function|Function[])} [predicates=[_.identity]] * The predicates to check. * @returns {Function} Returns the new function. * @example * * var func = _.overSome([Boolean, isFinite]); * * func('1'); * // => true * * func(null); * // => true * * func(NaN); * // => false * * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }]) * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]]) */ var overSome = createOver(arraySome); /** * Creates a function that returns the value at `path` of a given object. * * @static * @memberOf _ * @since 2.4.0 * @category Util * @param {Array|string} path The path of the property to get. * @returns {Function} Returns the new accessor function. * @example * * var objects = [ * { 'a': { 'b': 2 } }, * { 'a': { 'b': 1 } } * ]; * * _.map(objects, _.property('a.b')); * // => [2, 1] * * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b'); * // => [1, 2] */ function property(path) { return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path); } /** * The opposite of `_.property`; this method creates a function that returns * the value at a given path of `object`. * * @static * @memberOf _ * @since 3.0.0 * @category Util * @param {Object} object The object to query. * @returns {Function} Returns the new accessor function. * @example * * var array = [0, 1, 2], * object = { 'a': array, 'b': array, 'c': array }; * * _.map(['a[2]', 'c[0]'], _.propertyOf(object)); * // => [2, 0] * * _.map([['a', '2'], ['c', '0']], _.propertyOf(object)); * // => [2, 0] */ function propertyOf(object) { return function(path) { return object == null ? undefined : baseGet(object, path); }; } /** * Creates an array of numbers (positive and/or negative) progressing from * `start` up to, but not including, `end`. A step of `-1` is used if a negative * `start` is specified without an `end` or `step`. If `end` is not specified, * it's set to `start` with `start` then set to `0`. * * **Note:** JavaScript follows the IEEE-754 standard for resolving * floating-point values which can produce unexpected results. * * @static * @since 0.1.0 * @memberOf _ * @category Util * @param {number} [start=0] The start of the range. * @param {number} end The end of the range. * @param {number} [step=1] The value to increment or decrement by. * @returns {Array} Returns the range of numbers. * @see _.inRange, _.rangeRight * @example * * _.range(4); * // => [0, 1, 2, 3] * * _.range(-4); * // => [0, -1, -2, -3] * * _.range(1, 5); * // => [1, 2, 3, 4] * * _.range(0, 20, 5); * // => [0, 5, 10, 15] * * _.range(0, -4, -1); * // => [0, -1, -2, -3] * * _.range(1, 4, 0); * // => [1, 1, 1] * * _.range(0); * // => [] */ var range = createRange(); /** * This method is like `_.range` except that it populates values in * descending order. * * @static * @memberOf _ * @since 4.0.0 * @category Util * @param {number} [start=0] The start of the range. * @param {number} end The end of the range. * @param {number} [step=1] The value to increment or decrement by. * @returns {Array} Returns the range of numbers. * @see _.inRange, _.range * @example * * _.rangeRight(4); * // => [3, 2, 1, 0] * * _.rangeRight(-4); * // => [-3, -2, -1, 0] * * _.rangeRight(1, 5); * // => [4, 3, 2, 1] * * _.rangeRight(0, 20, 5); * // => [15, 10, 5, 0] * * _.rangeRight(0, -4, -1); * // => [-3, -2, -1, 0] * * _.rangeRight(1, 4, 0); * // => [1, 1, 1] * * _.rangeRight(0); * // => [] */ var rangeRight = createRange(true); /** * This method returns a new empty array. * * @static * @memberOf _ * @since 4.13.0 * @category Util * @returns {Array} Returns the new empty array. * @example * * var arrays = _.times(2, _.stubArray); * * console.log(arrays); * // => [[], []] * * console.log(arrays[0] === arrays[1]); * // => false */ function stubArray() { return []; } /** * This method returns `false`. * * @static * @memberOf _ * @since 4.13.0 * @category Util * @returns {boolean} Returns `false`. * @example * * _.times(2, _.stubFalse); * // => [false, false] */ function stubFalse() { return false; } /** * This method returns a new empty object. * * @static * @memberOf _ * @since 4.13.0 * @category Util * @returns {Object} Returns the new empty object. * @example * * var objects = _.times(2, _.stubObject); * * console.log(objects); * // => [{}, {}] * * console.log(objects[0] === objects[1]); * // => false */ function stubObject() { return {}; } /** * This method returns an empty string. * * @static * @memberOf _ * @since 4.13.0 * @category Util * @returns {string} Returns the empty string. * @example * * _.times(2, _.stubString); * // => ['', ''] */ function stubString() { return ''; } /** * This method returns `true`. * * @static * @memberOf _ * @since 4.13.0 * @category Util * @returns {boolean} Returns `true`. * @example * * _.times(2, _.stubTrue); * // => [true, true] */ function stubTrue() { return true; } /** * Invokes the iteratee `n` times, returning an array of the results of * each invocation. The iteratee is invoked with one argument; (index). * * @static * @since 0.1.0 * @memberOf _ * @category Util * @param {number} n The number of times to invoke `iteratee`. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Array} Returns the array of results. * @example * * _.times(3, String); * // => ['0', '1', '2'] * * _.times(4, _.constant(0)); * // => [0, 0, 0, 0] */ function times(n, iteratee) { n = toInteger(n); if (n < 1 || n > MAX_SAFE_INTEGER) { return []; } var index = MAX_ARRAY_LENGTH, length = nativeMin(n, MAX_ARRAY_LENGTH); iteratee = getIteratee(iteratee); n -= MAX_ARRAY_LENGTH; var result = baseTimes(length, iteratee); while (++index < n) { iteratee(index); } return result; } /** * Converts `value` to a property path array. * * @static * @memberOf _ * @since 4.0.0 * @category Util * @param {*} value The value to convert. * @returns {Array} Returns the new property path array. * @example * * _.toPath('a.b.c'); * // => ['a', 'b', 'c'] * * _.toPath('a[0].b.c'); * // => ['a', '0', 'b', 'c'] */ function toPath(value) { if (isArray(value)) { return arrayMap(value, toKey); } return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value))); } /** * Generates a unique ID. If `prefix` is given, the ID is appended to it. * * @static * @since 0.1.0 * @memberOf _ * @category Util * @param {string} [prefix=''] The value to prefix the ID with. * @returns {string} Returns the unique ID. * @example * * _.uniqueId('contact_'); * // => 'contact_104' * * _.uniqueId(); * // => '105' */ function uniqueId(prefix) { var id = ++idCounter; return toString(prefix) + id; } /*------------------------------------------------------------------------*/ /** * Adds two numbers. * * @static * @memberOf _ * @since 3.4.0 * @category Math * @param {number} augend The first number in an addition. * @param {number} addend The second number in an addition. * @returns {number} Returns the total. * @example * * _.add(6, 4); * // => 10 */ var add = createMathOperation(function(augend, addend) { return augend + addend; }, 0); /** * Computes `number` rounded up to `precision`. * * @static * @memberOf _ * @since 3.10.0 * @category Math * @param {number} number The number to round up. * @param {number} [precision=0] The precision to round up to. * @returns {number} Returns the rounded up number. * @example * * _.ceil(4.006); * // => 5 * * _.ceil(6.004, 2); * // => 6.01 * * _.ceil(6040, -2); * // => 6100 */ var ceil = createRound('ceil'); /** * Divide two numbers. * * @static * @memberOf _ * @since 4.7.0 * @category Math * @param {number} dividend The first number in a division. * @param {number} divisor The second number in a division. * @returns {number} Returns the quotient. * @example * * _.divide(6, 4); * // => 1.5 */ var divide = createMathOperation(function(dividend, divisor) { return dividend / divisor; }, 1); /** * Computes `number` rounded down to `precision`. * * @static * @memberOf _ * @since 3.10.0 * @category Math * @param {number} number The number to round down. * @param {number} [precision=0] The precision to round down to. * @returns {number} Returns the rounded down number. * @example * * _.floor(4.006); * // => 4 * * _.floor(0.046, 2); * // => 0.04 * * _.floor(4060, -2); * // => 4000 */ var floor = createRound('floor'); /** * Computes the maximum value of `array`. If `array` is empty or falsey, * `undefined` is returned. * * @static * @since 0.1.0 * @memberOf _ * @category Math * @param {Array} array The array to iterate over. * @returns {*} Returns the maximum value. * @example * * _.max([4, 2, 8, 6]); * // => 8 * * _.max([]); * // => undefined */ function max(array) { return (array && array.length) ? baseExtremum(array, identity, baseGt) : undefined; } /** * This method is like `_.max` except that it accepts `iteratee` which is * invoked for each element in `array` to generate the criterion by which * the value is ranked. The iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 4.0.0 * @category Math * @param {Array} array The array to iterate over. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {*} Returns the maximum value. * @example * * var objects = [{ 'n': 1 }, { 'n': 2 }]; * * _.maxBy(objects, function(o) { return o.n; }); * // => { 'n': 2 } * * // The `_.property` iteratee shorthand. * _.maxBy(objects, 'n'); * // => { 'n': 2 } */ function maxBy(array, iteratee) { return (array && array.length) ? baseExtremum(array, getIteratee(iteratee, 2), baseGt) : undefined; } /** * Computes the mean of the values in `array`. * * @static * @memberOf _ * @since 4.0.0 * @category Math * @param {Array} array The array to iterate over. * @returns {number} Returns the mean. * @example * * _.mean([4, 2, 8, 6]); * // => 5 */ function mean(array) { return baseMean(array, identity); } /** * This method is like `_.mean` except that it accepts `iteratee` which is * invoked for each element in `array` to generate the value to be averaged. * The iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 4.7.0 * @category Math * @param {Array} array The array to iterate over. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {number} Returns the mean. * @example * * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }]; * * _.meanBy(objects, function(o) { return o.n; }); * // => 5 * * // The `_.property` iteratee shorthand. * _.meanBy(objects, 'n'); * // => 5 */ function meanBy(array, iteratee) { return baseMean(array, getIteratee(iteratee, 2)); } /** * Computes the minimum value of `array`. If `array` is empty or falsey, * `undefined` is returned. * * @static * @since 0.1.0 * @memberOf _ * @category Math * @param {Array} array The array to iterate over. * @returns {*} Returns the minimum value. * @example * * _.min([4, 2, 8, 6]); * // => 2 * * _.min([]); * // => undefined */ function min(array) { return (array && array.length) ? baseExtremum(array, identity, baseLt) : undefined; } /** * This method is like `_.min` except that it accepts `iteratee` which is * invoked for each element in `array` to generate the criterion by which * the value is ranked. The iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 4.0.0 * @category Math * @param {Array} array The array to iterate over. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {*} Returns the minimum value. * @example * * var objects = [{ 'n': 1 }, { 'n': 2 }]; * * _.minBy(objects, function(o) { return o.n; }); * // => { 'n': 1 } * * // The `_.property` iteratee shorthand. * _.minBy(objects, 'n'); * // => { 'n': 1 } */ function minBy(array, iteratee) { return (array && array.length) ? baseExtremum(array, getIteratee(iteratee, 2), baseLt) : undefined; } /** * Multiply two numbers. * * @static * @memberOf _ * @since 4.7.0 * @category Math * @param {number} multiplier The first number in a multiplication. * @param {number} multiplicand The second number in a multiplication. * @returns {number} Returns the product. * @example * * _.multiply(6, 4); * // => 24 */ var multiply = createMathOperation(function(multiplier, multiplicand) { return multiplier * multiplicand; }, 1); /** * Computes `number` rounded to `precision`. * * @static * @memberOf _ * @since 3.10.0 * @category Math * @param {number} number The number to round. * @param {number} [precision=0] The precision to round to. * @returns {number} Returns the rounded number. * @example * * _.round(4.006); * // => 4 * * _.round(4.006, 2); * // => 4.01 * * _.round(4060, -2); * // => 4100 */ var round = createRound('round'); /** * Subtract two numbers. * * @static * @memberOf _ * @since 4.0.0 * @category Math * @param {number} minuend The first number in a subtraction. * @param {number} subtrahend The second number in a subtraction. * @returns {number} Returns the difference. * @example * * _.subtract(6, 4); * // => 2 */ var subtract = createMathOperation(function(minuend, subtrahend) { return minuend - subtrahend; }, 0); /** * Computes the sum of the values in `array`. * * @static * @memberOf _ * @since 3.4.0 * @category Math * @param {Array} array The array to iterate over. * @returns {number} Returns the sum. * @example * * _.sum([4, 2, 8, 6]); * // => 20 */ function sum(array) { return (array && array.length) ? baseSum(array, identity) : 0; } /** * This method is like `_.sum` except that it accepts `iteratee` which is * invoked for each element in `array` to generate the value to be summed. * The iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 4.0.0 * @category Math * @param {Array} array The array to iterate over. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {number} Returns the sum. * @example * * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }]; * * _.sumBy(objects, function(o) { return o.n; }); * // => 20 * * // The `_.property` iteratee shorthand. * _.sumBy(objects, 'n'); * // => 20 */ function sumBy(array, iteratee) { return (array && array.length) ? baseSum(array, getIteratee(iteratee, 2)) : 0; } /*------------------------------------------------------------------------*/ // Add methods that return wrapped values in chain sequences. lodash.after = after; lodash.ary = ary; lodash.assign = assign; lodash.assignIn = assignIn; lodash.assignInWith = assignInWith; lodash.assignWith = assignWith; lodash.at = at; lodash.before = before; lodash.bind = bind; lodash.bindAll = bindAll; lodash.bindKey = bindKey; lodash.castArray = castArray; lodash.chain = chain; lodash.chunk = chunk; lodash.compact = compact; lodash.concat = concat; lodash.cond = cond; lodash.conforms = conforms; lodash.constant = constant; lodash.countBy = countBy; lodash.create = create; lodash.curry = curry; lodash.curryRight = curryRight; lodash.debounce = debounce; lodash.defaults = defaults; lodash.defaultsDeep = defaultsDeep; lodash.defer = defer; lodash.delay = delay; lodash.difference = difference; lodash.differenceBy = differenceBy; lodash.differenceWith = differenceWith; lodash.drop = drop; lodash.dropRight = dropRight; lodash.dropRightWhile = dropRightWhile; lodash.dropWhile = dropWhile; lodash.fill = fill; lodash.filter = filter; lodash.flatMap = flatMap; lodash.flatMapDeep = flatMapDeep; lodash.flatMapDepth = flatMapDepth; lodash.flatten = flatten; lodash.flattenDeep = flattenDeep; lodash.flattenDepth = flattenDepth; lodash.flip = flip; lodash.flow = flow; lodash.flowRight = flowRight; lodash.fromPairs = fromPairs; lodash.functions = functions; lodash.functionsIn = functionsIn; lodash.groupBy = groupBy; lodash.initial = initial; lodash.intersection = intersection; lodash.intersectionBy = intersectionBy; lodash.intersectionWith = intersectionWith; lodash.invert = invert; lodash.invertBy = invertBy; lodash.invokeMap = invokeMap; lodash.iteratee = iteratee; lodash.keyBy = keyBy; lodash.keys = keys; lodash.keysIn = keysIn; lodash.map = map; lodash.mapKeys = mapKeys; lodash.mapValues = mapValues; lodash.matches = matches; lodash.matchesProperty = matchesProperty; lodash.memoize = memoize; lodash.merge = merge; lodash.mergeWith = mergeWith; lodash.method = method; lodash.methodOf = methodOf; lodash.mixin = mixin; lodash.negate = negate; lodash.nthArg = nthArg; lodash.omit = omit; lodash.omitBy = omitBy; lodash.once = once; lodash.orderBy = orderBy; lodash.over = over; lodash.overArgs = overArgs; lodash.overEvery = overEvery; lodash.overSome = overSome; lodash.partial = partial; lodash.partialRight = partialRight; lodash.partition = partition; lodash.pick = pick; lodash.pickBy = pickBy; lodash.property = property; lodash.propertyOf = propertyOf; lodash.pull = pull; lodash.pullAll = pullAll; lodash.pullAllBy = pullAllBy; lodash.pullAllWith = pullAllWith; lodash.pullAt = pullAt; lodash.range = range; lodash.rangeRight = rangeRight; lodash.rearg = rearg; lodash.reject = reject; lodash.remove = remove; lodash.rest = rest; lodash.reverse = reverse; lodash.sampleSize = sampleSize; lodash.set = set; lodash.setWith = setWith; lodash.shuffle = shuffle; lodash.slice = slice; lodash.sortBy = sortBy; lodash.sortedUniq = sortedUniq; lodash.sortedUniqBy = sortedUniqBy; lodash.split = split; lodash.spread = spread; lodash.tail = tail; lodash.take = take; lodash.takeRight = takeRight; lodash.takeRightWhile = takeRightWhile; lodash.takeWhile = takeWhile; lodash.tap = tap; lodash.throttle = throttle; lodash.thru = thru; lodash.toArray = toArray; lodash.toPairs = toPairs; lodash.toPairsIn = toPairsIn; lodash.toPath = toPath; lodash.toPlainObject = toPlainObject; lodash.transform = transform; lodash.unary = unary; lodash.union = union; lodash.unionBy = unionBy; lodash.unionWith = unionWith; lodash.uniq = uniq; lodash.uniqBy = uniqBy; lodash.uniqWith = uniqWith; lodash.unset = unset; lodash.unzip = unzip; lodash.unzipWith = unzipWith; lodash.update = update; lodash.updateWith = updateWith; lodash.values = values; lodash.valuesIn = valuesIn; lodash.without = without; lodash.words = words; lodash.wrap = wrap; lodash.xor = xor; lodash.xorBy = xorBy; lodash.xorWith = xorWith; lodash.zip = zip; lodash.zipObject = zipObject; lodash.zipObjectDeep = zipObjectDeep; lodash.zipWith = zipWith; // Add aliases. lodash.entries = toPairs; lodash.entriesIn = toPairsIn; lodash.extend = assignIn; lodash.extendWith = assignInWith; // Add methods to `lodash.prototype`. mixin(lodash, lodash); /*------------------------------------------------------------------------*/ // Add methods that return unwrapped values in chain sequences. lodash.add = add; lodash.attempt = attempt; lodash.camelCase = camelCase; lodash.capitalize = capitalize; lodash.ceil = ceil; lodash.clamp = clamp; lodash.clone = clone; lodash.cloneDeep = cloneDeep; lodash.cloneDeepWith = cloneDeepWith; lodash.cloneWith = cloneWith; lodash.conformsTo = conformsTo; lodash.deburr = deburr; lodash.defaultTo = defaultTo; lodash.divide = divide; lodash.endsWith = endsWith; lodash.eq = eq; lodash.escape = escape; lodash.escapeRegExp = escapeRegExp; lodash.every = every; lodash.find = find; lodash.findIndex = findIndex; lodash.findKey = findKey; lodash.findLast = findLast; lodash.findLastIndex = findLastIndex; lodash.findLastKey = findLastKey; lodash.floor = floor; lodash.forEach = forEach; lodash.forEachRight = forEachRight; lodash.forIn = forIn; lodash.forInRight = forInRight; lodash.forOwn = forOwn; lodash.forOwnRight = forOwnRight; lodash.get = get; lodash.gt = gt; lodash.gte = gte; lodash.has = has; lodash.hasIn = hasIn; lodash.head = head; lodash.identity = identity; lodash.includes = includes; lodash.indexOf = indexOf; lodash.inRange = inRange; lodash.invoke = invoke; lodash.isArguments = isArguments; lodash.isArray = isArray; lodash.isArrayBuffer = isArrayBuffer; lodash.isArrayLike = isArrayLike; lodash.isArrayLikeObject = isArrayLikeObject; lodash.isBoolean = isBoolean; lodash.isBuffer = isBuffer; lodash.isDate = isDate; lodash.isElement = isElement; lodash.isEmpty = isEmpty; lodash.isEqual = isEqual; lodash.isEqualWith = isEqualWith; lodash.isError = isError; lodash.isFinite = isFinite; lodash.isFunction = isFunction; lodash.isInteger = isInteger; lodash.isLength = isLength; lodash.isMap = isMap; lodash.isMatch = isMatch; lodash.isMatchWith = isMatchWith; lodash.isNaN = isNaN; lodash.isNative = isNative; lodash.isNil = isNil; lodash.isNull = isNull; lodash.isNumber = isNumber; lodash.isObject = isObject; lodash.isObjectLike = isObjectLike; lodash.isPlainObject = isPlainObject; lodash.isRegExp = isRegExp; lodash.isSafeInteger = isSafeInteger; lodash.isSet = isSet; lodash.isString = isString; lodash.isSymbol = isSymbol; lodash.isTypedArray = isTypedArray; lodash.isUndefined = isUndefined; lodash.isWeakMap = isWeakMap; lodash.isWeakSet = isWeakSet; lodash.join = join; lodash.kebabCase = kebabCase; lodash.last = last; lodash.lastIndexOf = lastIndexOf; lodash.lowerCase = lowerCase; lodash.lowerFirst = lowerFirst; lodash.lt = lt; lodash.lte = lte; lodash.max = max; lodash.maxBy = maxBy; lodash.mean = mean; lodash.meanBy = meanBy; lodash.min = min; lodash.minBy = minBy; lodash.stubArray = stubArray; lodash.stubFalse = stubFalse; lodash.stubObject = stubObject; lodash.stubString = stubString; lodash.stubTrue = stubTrue; lodash.multiply = multiply; lodash.nth = nth; lodash.noConflict = noConflict; lodash.noop = noop; lodash.now = now; lodash.pad = pad; lodash.padEnd = padEnd; lodash.padStart = padStart; lodash.parseInt = parseInt; lodash.random = random; lodash.reduce = reduce; lodash.reduceRight = reduceRight; lodash.repeat = repeat; lodash.replace = replace; lodash.result = result; lodash.round = round; lodash.runInContext = runInContext; lodash.sample = sample; lodash.size = size; lodash.snakeCase = snakeCase; lodash.some = some; lodash.sortedIndex = sortedIndex; lodash.sortedIndexBy = sortedIndexBy; lodash.sortedIndexOf = sortedIndexOf; lodash.sortedLastIndex = sortedLastIndex; lodash.sortedLastIndexBy = sortedLastIndexBy; lodash.sortedLastIndexOf = sortedLastIndexOf; lodash.startCase = startCase; lodash.startsWith = startsWith; lodash.subtract = subtract; lodash.sum = sum; lodash.sumBy = sumBy; lodash.template = template; lodash.times = times; lodash.toFinite = toFinite; lodash.toInteger = toInteger; lodash.toLength = toLength; lodash.toLower = toLower; lodash.toNumber = toNumber; lodash.toSafeInteger = toSafeInteger; lodash.toString = toString; lodash.toUpper = toUpper; lodash.trim = trim; lodash.trimEnd = trimEnd; lodash.trimStart = trimStart; lodash.truncate = truncate; lodash.unescape = unescape; lodash.uniqueId = uniqueId; lodash.upperCase = upperCase; lodash.upperFirst = upperFirst; // Add aliases. lodash.each = forEach; lodash.eachRight = forEachRight; lodash.first = head; mixin(lodash, (function() { var source = {}; baseForOwn(lodash, function(func, methodName) { if (!hasOwnProperty.call(lodash.prototype, methodName)) { source[methodName] = func; } }); return source; }()), { 'chain': false }); /*------------------------------------------------------------------------*/ /** * The semantic version number. * * @static * @memberOf _ * @type {string} */ lodash.VERSION = VERSION; // Assign default placeholders. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) { lodash[methodName].placeholder = lodash; }); // Add `LazyWrapper` methods for `_.drop` and `_.take` variants. arrayEach(['drop', 'take'], function(methodName, index) { LazyWrapper.prototype[methodName] = function(n) { n = n === undefined ? 1 : nativeMax(toInteger(n), 0); var result = (this.__filtered__ && !index) ? new LazyWrapper(this) : this.clone(); if (result.__filtered__) { result.__takeCount__ = nativeMin(n, result.__takeCount__); } else { result.__views__.push({ 'size': nativeMin(n, MAX_ARRAY_LENGTH), 'type': methodName + (result.__dir__ < 0 ? 'Right' : '') }); } return result; }; LazyWrapper.prototype[methodName + 'Right'] = function(n) { return this.reverse()[methodName](n).reverse(); }; }); // Add `LazyWrapper` methods that accept an `iteratee` value. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) { var type = index + 1, isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG; LazyWrapper.prototype[methodName] = function(iteratee) { var result = this.clone(); result.__iteratees__.push({ 'iteratee': getIteratee(iteratee, 3), 'type': type }); result.__filtered__ = result.__filtered__ || isFilter; return result; }; }); // Add `LazyWrapper` methods for `_.head` and `_.last`. arrayEach(['head', 'last'], function(methodName, index) { var takeName = 'take' + (index ? 'Right' : ''); LazyWrapper.prototype[methodName] = function() { return this[takeName](1).value()[0]; }; }); // Add `LazyWrapper` methods for `_.initial` and `_.tail`. arrayEach(['initial', 'tail'], function(methodName, index) { var dropName = 'drop' + (index ? '' : 'Right'); LazyWrapper.prototype[methodName] = function() { return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1); }; }); LazyWrapper.prototype.compact = function() { return this.filter(identity); }; LazyWrapper.prototype.find = function(predicate) { return this.filter(predicate).head(); }; LazyWrapper.prototype.findLast = function(predicate) { return this.reverse().find(predicate); }; LazyWrapper.prototype.invokeMap = baseRest(function(path, args) { if (typeof path == 'function') { return new LazyWrapper(this); } return this.map(function(value) { return baseInvoke(value, path, args); }); }); LazyWrapper.prototype.reject = function(predicate) { return this.filter(negate(getIteratee(predicate))); }; LazyWrapper.prototype.slice = function(start, end) { start = toInteger(start); var result = this; if (result.__filtered__ && (start > 0 || end < 0)) { return new LazyWrapper(result); } if (start < 0) { result = result.takeRight(-start); } else if (start) { result = result.drop(start); } if (end !== undefined) { end = toInteger(end); result = end < 0 ? result.dropRight(-end) : result.take(end - start); } return result; }; LazyWrapper.prototype.takeRightWhile = function(predicate) { return this.reverse().takeWhile(predicate).reverse(); }; LazyWrapper.prototype.toArray = function() { return this.take(MAX_ARRAY_LENGTH); }; // Add `LazyWrapper` methods to `lodash.prototype`. baseForOwn(LazyWrapper.prototype, function(func, methodName) { var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName), isTaker = /^(?:head|last)$/.test(methodName), lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName], retUnwrapped = isTaker || /^find/.test(methodName); if (!lodashFunc) { return; } lodash.prototype[methodName] = function() { var value = this.__wrapped__, args = isTaker ? [1] : arguments, isLazy = value instanceof LazyWrapper, iteratee = args[0], useLazy = isLazy || isArray(value); var interceptor = function(value) { var result = lodashFunc.apply(lodash, arrayPush([value], args)); return (isTaker && chainAll) ? result[0] : result; }; if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) { // Avoid lazy use if the iteratee has a "length" value other than `1`. isLazy = useLazy = false; } var chainAll = this.__chain__, isHybrid = !!this.__actions__.length, isUnwrapped = retUnwrapped && !chainAll, onlyLazy = isLazy && !isHybrid; if (!retUnwrapped && useLazy) { value = onlyLazy ? value : new LazyWrapper(this); var result = func.apply(value, args); result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined }); return new LodashWrapper(result, chainAll); } if (isUnwrapped && onlyLazy) { return func.apply(this, args); } result = this.thru(interceptor); return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result; }; }); // Add `Array` methods to `lodash.prototype`. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) { var func = arrayProto[methodName], chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru', retUnwrapped = /^(?:pop|shift)$/.test(methodName); lodash.prototype[methodName] = function() { var args = arguments; if (retUnwrapped && !this.__chain__) { var value = this.value(); return func.apply(isArray(value) ? value : [], args); } return this[chainName](function(value) { return func.apply(isArray(value) ? value : [], args); }); }; }); // Map minified method names to their real names. baseForOwn(LazyWrapper.prototype, function(func, methodName) { var lodashFunc = lodash[methodName]; if (lodashFunc) { var key = lodashFunc.name + ''; if (!hasOwnProperty.call(realNames, key)) { realNames[key] = []; } realNames[key].push({ 'name': methodName, 'func': lodashFunc }); } }); realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{ 'name': 'wrapper', 'func': undefined }]; // Add methods to `LazyWrapper`. LazyWrapper.prototype.clone = lazyClone; LazyWrapper.prototype.reverse = lazyReverse; LazyWrapper.prototype.value = lazyValue; // Add chain sequence methods to the `lodash` wrapper. lodash.prototype.at = wrapperAt; lodash.prototype.chain = wrapperChain; lodash.prototype.commit = wrapperCommit; lodash.prototype.next = wrapperNext; lodash.prototype.plant = wrapperPlant; lodash.prototype.reverse = wrapperReverse; lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue; // Add lazy aliases. lodash.prototype.first = lodash.prototype.head; if (symIterator) { lodash.prototype[symIterator] = wrapperToIterator; } return lodash; }); /*--------------------------------------------------------------------------*/ // Export lodash. var _ = runInContext(); // Some AMD build optimizers, like r.js, check for condition patterns like: if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) { // Expose Lodash on the global object to prevent errors when Lodash is // loaded by a script tag in the presence of an AMD loader. // See http://requirejs.org/docs/errors.html#mismatch for more details. // Use `_.noConflict` to remove Lodash from the global object. root._ = _; // Define as an anonymous module so, through path mapping, it can be // referenced as the "underscore" module. define(function() { return _; }); } // Check for `exports` after `define` in case a build optimizer adds it. else if (freeModule) { // Export for Node.js. (freeModule.exports = _)._ = _; // Export for CommonJS support. freeExports._ = _; } else { // Export to the global object. root._ = _; } }.call(this)); vendor/wp-polyfill-url.js 0000644 00000327374 15206720414 0011476 0 ustar 00 (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){ module.exports = function (it) { if (typeof it != 'function') { throw TypeError(String(it) + ' is not a function'); } return it; }; },{}],2:[function(require,module,exports){ var isObject = require('../internals/is-object'); module.exports = function (it) { if (!isObject(it) && it !== null) { throw TypeError("Can't set " + String(it) + ' as a prototype'); } return it; }; },{"../internals/is-object":37}],3:[function(require,module,exports){ var wellKnownSymbol = require('../internals/well-known-symbol'); var create = require('../internals/object-create'); var definePropertyModule = require('../internals/object-define-property'); var UNSCOPABLES = wellKnownSymbol('unscopables'); var ArrayPrototype = Array.prototype; // Array.prototype[@@unscopables] // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables if (ArrayPrototype[UNSCOPABLES] == undefined) { definePropertyModule.f(ArrayPrototype, UNSCOPABLES, { configurable: true, value: create(null) }); } // add a key to Array.prototype[@@unscopables] module.exports = function (key) { ArrayPrototype[UNSCOPABLES][key] = true; }; },{"../internals/object-create":45,"../internals/object-define-property":47,"../internals/well-known-symbol":77}],4:[function(require,module,exports){ module.exports = function (it, Constructor, name) { if (!(it instanceof Constructor)) { throw TypeError('Incorrect ' + (name ? name + ' ' : '') + 'invocation'); } return it; }; },{}],5:[function(require,module,exports){ var isObject = require('../internals/is-object'); module.exports = function (it) { if (!isObject(it)) { throw TypeError(String(it) + ' is not an object'); } return it; }; },{"../internals/is-object":37}],6:[function(require,module,exports){ 'use strict'; var bind = require('../internals/function-bind-context'); var toObject = require('../internals/to-object'); var callWithSafeIterationClosing = require('../internals/call-with-safe-iteration-closing'); var isArrayIteratorMethod = require('../internals/is-array-iterator-method'); var toLength = require('../internals/to-length'); var createProperty = require('../internals/create-property'); var getIteratorMethod = require('../internals/get-iterator-method'); // `Array.from` method implementation // https://tc39.github.io/ecma262/#sec-array.from module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) { var O = toObject(arrayLike); var C = typeof this == 'function' ? this : Array; var argumentsLength = arguments.length; var mapfn = argumentsLength > 1 ? arguments[1] : undefined; var mapping = mapfn !== undefined; var iteratorMethod = getIteratorMethod(O); var index = 0; var length, result, step, iterator, next, value; if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined, 2); // if the target is not iterable or it's an array with the default iterator - use a simple case if (iteratorMethod != undefined && !(C == Array && isArrayIteratorMethod(iteratorMethod))) { iterator = iteratorMethod.call(O); next = iterator.next; result = new C(); for (;!(step = next.call(iterator)).done; index++) { value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value; createProperty(result, index, value); } } else { length = toLength(O.length); result = new C(length); for (;length > index; index++) { value = mapping ? mapfn(O[index], index) : O[index]; createProperty(result, index, value); } } result.length = index; return result; }; },{"../internals/call-with-safe-iteration-closing":8,"../internals/create-property":16,"../internals/function-bind-context":23,"../internals/get-iterator-method":25,"../internals/is-array-iterator-method":35,"../internals/to-length":71,"../internals/to-object":72}],7:[function(require,module,exports){ var toIndexedObject = require('../internals/to-indexed-object'); var toLength = require('../internals/to-length'); var toAbsoluteIndex = require('../internals/to-absolute-index'); // `Array.prototype.{ indexOf, includes }` methods implementation var createMethod = function (IS_INCLUDES) { return function ($this, el, fromIndex) { var O = toIndexedObject($this); var length = toLength(O.length); var index = toAbsoluteIndex(fromIndex, length); var value; // Array#includes uses SameValueZero equality algorithm // eslint-disable-next-line no-self-compare if (IS_INCLUDES && el != el) while (length > index) { value = O[index++]; // eslint-disable-next-line no-self-compare if (value != value) return true; // Array#indexOf ignores holes, Array#includes - not } else for (;length > index; index++) { if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0; } return !IS_INCLUDES && -1; }; }; module.exports = { // `Array.prototype.includes` method // https://tc39.github.io/ecma262/#sec-array.prototype.includes includes: createMethod(true), // `Array.prototype.indexOf` method // https://tc39.github.io/ecma262/#sec-array.prototype.indexof indexOf: createMethod(false) }; },{"../internals/to-absolute-index":68,"../internals/to-indexed-object":69,"../internals/to-length":71}],8:[function(require,module,exports){ var anObject = require('../internals/an-object'); // call something on iterator step with safe closing on error module.exports = function (iterator, fn, value, ENTRIES) { try { return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value); // 7.4.6 IteratorClose(iterator, completion) } catch (error) { var returnMethod = iterator['return']; if (returnMethod !== undefined) anObject(returnMethod.call(iterator)); throw error; } }; },{"../internals/an-object":5}],9:[function(require,module,exports){ var toString = {}.toString; module.exports = function (it) { return toString.call(it).slice(8, -1); }; },{}],10:[function(require,module,exports){ var TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support'); var classofRaw = require('../internals/classof-raw'); var wellKnownSymbol = require('../internals/well-known-symbol'); var TO_STRING_TAG = wellKnownSymbol('toStringTag'); // ES3 wrong here var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments'; // fallback for IE11 Script Access Denied error var tryGet = function (it, key) { try { return it[key]; } catch (error) { /* empty */ } }; // getting tag from ES6+ `Object.prototype.toString` module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) { var O, tag, result; return it === undefined ? 'Undefined' : it === null ? 'Null' // @@toStringTag case : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag // builtinTag case : CORRECT_ARGUMENTS ? classofRaw(O) // ES3 arguments fallback : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result; }; },{"../internals/classof-raw":9,"../internals/to-string-tag-support":74,"../internals/well-known-symbol":77}],11:[function(require,module,exports){ var has = require('../internals/has'); var ownKeys = require('../internals/own-keys'); var getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor'); var definePropertyModule = require('../internals/object-define-property'); module.exports = function (target, source) { var keys = ownKeys(source); var defineProperty = definePropertyModule.f; var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; for (var i = 0; i < keys.length; i++) { var key = keys[i]; if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key)); } }; },{"../internals/has":28,"../internals/object-define-property":47,"../internals/object-get-own-property-descriptor":48,"../internals/own-keys":56}],12:[function(require,module,exports){ var fails = require('../internals/fails'); module.exports = !fails(function () { function F() { /* empty */ } F.prototype.constructor = null; return Object.getPrototypeOf(new F()) !== F.prototype; }); },{"../internals/fails":22}],13:[function(require,module,exports){ 'use strict'; var IteratorPrototype = require('../internals/iterators-core').IteratorPrototype; var create = require('../internals/object-create'); var createPropertyDescriptor = require('../internals/create-property-descriptor'); var setToStringTag = require('../internals/set-to-string-tag'); var Iterators = require('../internals/iterators'); var returnThis = function () { return this; }; module.exports = function (IteratorConstructor, NAME, next) { var TO_STRING_TAG = NAME + ' Iterator'; IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(1, next) }); setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true); Iterators[TO_STRING_TAG] = returnThis; return IteratorConstructor; }; },{"../internals/create-property-descriptor":15,"../internals/iterators":40,"../internals/iterators-core":39,"../internals/object-create":45,"../internals/set-to-string-tag":62}],14:[function(require,module,exports){ var DESCRIPTORS = require('../internals/descriptors'); var definePropertyModule = require('../internals/object-define-property'); var createPropertyDescriptor = require('../internals/create-property-descriptor'); module.exports = DESCRIPTORS ? function (object, key, value) { return definePropertyModule.f(object, key, createPropertyDescriptor(1, value)); } : function (object, key, value) { object[key] = value; return object; }; },{"../internals/create-property-descriptor":15,"../internals/descriptors":18,"../internals/object-define-property":47}],15:[function(require,module,exports){ module.exports = function (bitmap, value) { return { enumerable: !(bitmap & 1), configurable: !(bitmap & 2), writable: !(bitmap & 4), value: value }; }; },{}],16:[function(require,module,exports){ 'use strict'; var toPrimitive = require('../internals/to-primitive'); var definePropertyModule = require('../internals/object-define-property'); var createPropertyDescriptor = require('../internals/create-property-descriptor'); module.exports = function (object, key, value) { var propertyKey = toPrimitive(key); if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value)); else object[propertyKey] = value; }; },{"../internals/create-property-descriptor":15,"../internals/object-define-property":47,"../internals/to-primitive":73}],17:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var createIteratorConstructor = require('../internals/create-iterator-constructor'); var getPrototypeOf = require('../internals/object-get-prototype-of'); var setPrototypeOf = require('../internals/object-set-prototype-of'); var setToStringTag = require('../internals/set-to-string-tag'); var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); var redefine = require('../internals/redefine'); var wellKnownSymbol = require('../internals/well-known-symbol'); var IS_PURE = require('../internals/is-pure'); var Iterators = require('../internals/iterators'); var IteratorsCore = require('../internals/iterators-core'); var IteratorPrototype = IteratorsCore.IteratorPrototype; var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS; var ITERATOR = wellKnownSymbol('iterator'); var KEYS = 'keys'; var VALUES = 'values'; var ENTRIES = 'entries'; var returnThis = function () { return this; }; module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) { createIteratorConstructor(IteratorConstructor, NAME, next); var getIterationMethod = function (KIND) { if (KIND === DEFAULT && defaultIterator) return defaultIterator; if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND]; switch (KIND) { case KEYS: return function keys() { return new IteratorConstructor(this, KIND); }; case VALUES: return function values() { return new IteratorConstructor(this, KIND); }; case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); }; } return function () { return new IteratorConstructor(this); }; }; var TO_STRING_TAG = NAME + ' Iterator'; var INCORRECT_VALUES_NAME = false; var IterablePrototype = Iterable.prototype; var nativeIterator = IterablePrototype[ITERATOR] || IterablePrototype['@@iterator'] || DEFAULT && IterablePrototype[DEFAULT]; var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT); var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator; var CurrentIteratorPrototype, methods, KEY; // fix native if (anyNativeIterator) { CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable())); if (IteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) { if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) { if (setPrototypeOf) { setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype); } else if (typeof CurrentIteratorPrototype[ITERATOR] != 'function') { createNonEnumerableProperty(CurrentIteratorPrototype, ITERATOR, returnThis); } } // Set @@toStringTag to native iterators setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true); if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis; } } // fix Array#{values, @@iterator}.name in V8 / FF if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) { INCORRECT_VALUES_NAME = true; defaultIterator = function values() { return nativeIterator.call(this); }; } // define iterator if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) { createNonEnumerableProperty(IterablePrototype, ITERATOR, defaultIterator); } Iterators[NAME] = defaultIterator; // export additional methods if (DEFAULT) { methods = { values: getIterationMethod(VALUES), keys: IS_SET ? defaultIterator : getIterationMethod(KEYS), entries: getIterationMethod(ENTRIES) }; if (FORCED) for (KEY in methods) { if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) { redefine(IterablePrototype, KEY, methods[KEY]); } } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods); } return methods; }; },{"../internals/create-iterator-constructor":13,"../internals/create-non-enumerable-property":14,"../internals/export":21,"../internals/is-pure":38,"../internals/iterators":40,"../internals/iterators-core":39,"../internals/object-get-prototype-of":51,"../internals/object-set-prototype-of":55,"../internals/redefine":59,"../internals/set-to-string-tag":62,"../internals/well-known-symbol":77}],18:[function(require,module,exports){ var fails = require('../internals/fails'); // Thank's IE8 for his funny defineProperty module.exports = !fails(function () { return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7; }); },{"../internals/fails":22}],19:[function(require,module,exports){ var global = require('../internals/global'); var isObject = require('../internals/is-object'); var document = global.document; // typeof document.createElement is 'object' in old IE var EXISTS = isObject(document) && isObject(document.createElement); module.exports = function (it) { return EXISTS ? document.createElement(it) : {}; }; },{"../internals/global":27,"../internals/is-object":37}],20:[function(require,module,exports){ // IE8- don't enum bug keys module.exports = [ 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf' ]; },{}],21:[function(require,module,exports){ var global = require('../internals/global'); var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f; var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); var redefine = require('../internals/redefine'); var setGlobal = require('../internals/set-global'); var copyConstructorProperties = require('../internals/copy-constructor-properties'); var isForced = require('../internals/is-forced'); /* options.target - name of the target object options.global - target is the global object options.stat - export as static methods of target options.proto - export as prototype methods of target options.real - real prototype method for the `pure` version options.forced - export even if the native feature is available options.bind - bind methods to the target, required for the `pure` version options.wrap - wrap constructors to preventing global pollution, required for the `pure` version options.unsafe - use the simple assignment of property instead of delete + defineProperty options.sham - add a flag to not completely full polyfills options.enumerable - export as enumerable property options.noTargetGet - prevent calling a getter on target */ module.exports = function (options, source) { var TARGET = options.target; var GLOBAL = options.global; var STATIC = options.stat; var FORCED, target, key, targetProperty, sourceProperty, descriptor; if (GLOBAL) { target = global; } else if (STATIC) { target = global[TARGET] || setGlobal(TARGET, {}); } else { target = (global[TARGET] || {}).prototype; } if (target) for (key in source) { sourceProperty = source[key]; if (options.noTargetGet) { descriptor = getOwnPropertyDescriptor(target, key); targetProperty = descriptor && descriptor.value; } else targetProperty = target[key]; FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced); // contained in target if (!FORCED && targetProperty !== undefined) { if (typeof sourceProperty === typeof targetProperty) continue; copyConstructorProperties(sourceProperty, targetProperty); } // add a flag to not completely full polyfills if (options.sham || (targetProperty && targetProperty.sham)) { createNonEnumerableProperty(sourceProperty, 'sham', true); } // extend global redefine(target, key, sourceProperty, options); } }; },{"../internals/copy-constructor-properties":11,"../internals/create-non-enumerable-property":14,"../internals/global":27,"../internals/is-forced":36,"../internals/object-get-own-property-descriptor":48,"../internals/redefine":59,"../internals/set-global":61}],22:[function(require,module,exports){ module.exports = function (exec) { try { return !!exec(); } catch (error) { return true; } }; },{}],23:[function(require,module,exports){ var aFunction = require('../internals/a-function'); // optional / simple context binding module.exports = function (fn, that, length) { aFunction(fn); if (that === undefined) return fn; switch (length) { case 0: return function () { return fn.call(that); }; case 1: return function (a) { return fn.call(that, a); }; case 2: return function (a, b) { return fn.call(that, a, b); }; case 3: return function (a, b, c) { return fn.call(that, a, b, c); }; } return function (/* ...args */) { return fn.apply(that, arguments); }; }; },{"../internals/a-function":1}],24:[function(require,module,exports){ var path = require('../internals/path'); var global = require('../internals/global'); var aFunction = function (variable) { return typeof variable == 'function' ? variable : undefined; }; module.exports = function (namespace, method) { return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace]) : path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method]; }; },{"../internals/global":27,"../internals/path":57}],25:[function(require,module,exports){ var classof = require('../internals/classof'); var Iterators = require('../internals/iterators'); var wellKnownSymbol = require('../internals/well-known-symbol'); var ITERATOR = wellKnownSymbol('iterator'); module.exports = function (it) { if (it != undefined) return it[ITERATOR] || it['@@iterator'] || Iterators[classof(it)]; }; },{"../internals/classof":10,"../internals/iterators":40,"../internals/well-known-symbol":77}],26:[function(require,module,exports){ var anObject = require('../internals/an-object'); var getIteratorMethod = require('../internals/get-iterator-method'); module.exports = function (it) { var iteratorMethod = getIteratorMethod(it); if (typeof iteratorMethod != 'function') { throw TypeError(String(it) + ' is not iterable'); } return anObject(iteratorMethod.call(it)); }; },{"../internals/an-object":5,"../internals/get-iterator-method":25}],27:[function(require,module,exports){ (function (global){ var check = function (it) { return it && it.Math == Math && it; }; // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 module.exports = // eslint-disable-next-line no-undef check(typeof globalThis == 'object' && globalThis) || check(typeof window == 'object' && window) || check(typeof self == 'object' && self) || check(typeof global == 'object' && global) || // eslint-disable-next-line no-new-func Function('return this')(); }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{}],28:[function(require,module,exports){ var hasOwnProperty = {}.hasOwnProperty; module.exports = function (it, key) { return hasOwnProperty.call(it, key); }; },{}],29:[function(require,module,exports){ module.exports = {}; },{}],30:[function(require,module,exports){ var getBuiltIn = require('../internals/get-built-in'); module.exports = getBuiltIn('document', 'documentElement'); },{"../internals/get-built-in":24}],31:[function(require,module,exports){ var DESCRIPTORS = require('../internals/descriptors'); var fails = require('../internals/fails'); var createElement = require('../internals/document-create-element'); // Thank's IE8 for his funny defineProperty module.exports = !DESCRIPTORS && !fails(function () { return Object.defineProperty(createElement('div'), 'a', { get: function () { return 7; } }).a != 7; }); },{"../internals/descriptors":18,"../internals/document-create-element":19,"../internals/fails":22}],32:[function(require,module,exports){ var fails = require('../internals/fails'); var classof = require('../internals/classof-raw'); var split = ''.split; // fallback for non-array-like ES3 and non-enumerable old V8 strings module.exports = fails(function () { // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346 // eslint-disable-next-line no-prototype-builtins return !Object('z').propertyIsEnumerable(0); }) ? function (it) { return classof(it) == 'String' ? split.call(it, '') : Object(it); } : Object; },{"../internals/classof-raw":9,"../internals/fails":22}],33:[function(require,module,exports){ var store = require('../internals/shared-store'); var functionToString = Function.toString; // this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper if (typeof store.inspectSource != 'function') { store.inspectSource = function (it) { return functionToString.call(it); }; } module.exports = store.inspectSource; },{"../internals/shared-store":64}],34:[function(require,module,exports){ var NATIVE_WEAK_MAP = require('../internals/native-weak-map'); var global = require('../internals/global'); var isObject = require('../internals/is-object'); var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); var objectHas = require('../internals/has'); var sharedKey = require('../internals/shared-key'); var hiddenKeys = require('../internals/hidden-keys'); var WeakMap = global.WeakMap; var set, get, has; var enforce = function (it) { return has(it) ? get(it) : set(it, {}); }; var getterFor = function (TYPE) { return function (it) { var state; if (!isObject(it) || (state = get(it)).type !== TYPE) { throw TypeError('Incompatible receiver, ' + TYPE + ' required'); } return state; }; }; if (NATIVE_WEAK_MAP) { var store = new WeakMap(); var wmget = store.get; var wmhas = store.has; var wmset = store.set; set = function (it, metadata) { wmset.call(store, it, metadata); return metadata; }; get = function (it) { return wmget.call(store, it) || {}; }; has = function (it) { return wmhas.call(store, it); }; } else { var STATE = sharedKey('state'); hiddenKeys[STATE] = true; set = function (it, metadata) { createNonEnumerableProperty(it, STATE, metadata); return metadata; }; get = function (it) { return objectHas(it, STATE) ? it[STATE] : {}; }; has = function (it) { return objectHas(it, STATE); }; } module.exports = { set: set, get: get, has: has, enforce: enforce, getterFor: getterFor }; },{"../internals/create-non-enumerable-property":14,"../internals/global":27,"../internals/has":28,"../internals/hidden-keys":29,"../internals/is-object":37,"../internals/native-weak-map":43,"../internals/shared-key":63}],35:[function(require,module,exports){ var wellKnownSymbol = require('../internals/well-known-symbol'); var Iterators = require('../internals/iterators'); var ITERATOR = wellKnownSymbol('iterator'); var ArrayPrototype = Array.prototype; // check on default Array iterator module.exports = function (it) { return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it); }; },{"../internals/iterators":40,"../internals/well-known-symbol":77}],36:[function(require,module,exports){ var fails = require('../internals/fails'); var replacement = /#|\.prototype\./; var isForced = function (feature, detection) { var value = data[normalize(feature)]; return value == POLYFILL ? true : value == NATIVE ? false : typeof detection == 'function' ? fails(detection) : !!detection; }; var normalize = isForced.normalize = function (string) { return String(string).replace(replacement, '.').toLowerCase(); }; var data = isForced.data = {}; var NATIVE = isForced.NATIVE = 'N'; var POLYFILL = isForced.POLYFILL = 'P'; module.exports = isForced; },{"../internals/fails":22}],37:[function(require,module,exports){ module.exports = function (it) { return typeof it === 'object' ? it !== null : typeof it === 'function'; }; },{}],38:[function(require,module,exports){ module.exports = false; },{}],39:[function(require,module,exports){ 'use strict'; var getPrototypeOf = require('../internals/object-get-prototype-of'); var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); var has = require('../internals/has'); var wellKnownSymbol = require('../internals/well-known-symbol'); var IS_PURE = require('../internals/is-pure'); var ITERATOR = wellKnownSymbol('iterator'); var BUGGY_SAFARI_ITERATORS = false; var returnThis = function () { return this; }; // `%IteratorPrototype%` object // https://tc39.github.io/ecma262/#sec-%iteratorprototype%-object var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator; if ([].keys) { arrayIterator = [].keys(); // Safari 8 has buggy iterators w/o `next` if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true; else { PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator)); if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype; } } if (IteratorPrototype == undefined) IteratorPrototype = {}; // 25.1.2.1.1 %IteratorPrototype%[@@iterator]() if (!IS_PURE && !has(IteratorPrototype, ITERATOR)) { createNonEnumerableProperty(IteratorPrototype, ITERATOR, returnThis); } module.exports = { IteratorPrototype: IteratorPrototype, BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS }; },{"../internals/create-non-enumerable-property":14,"../internals/has":28,"../internals/is-pure":38,"../internals/object-get-prototype-of":51,"../internals/well-known-symbol":77}],40:[function(require,module,exports){ arguments[4][29][0].apply(exports,arguments) },{"dup":29}],41:[function(require,module,exports){ var fails = require('../internals/fails'); module.exports = !!Object.getOwnPropertySymbols && !fails(function () { // Chrome 38 Symbol has incorrect toString conversion // eslint-disable-next-line no-undef return !String(Symbol()); }); },{"../internals/fails":22}],42:[function(require,module,exports){ var fails = require('../internals/fails'); var wellKnownSymbol = require('../internals/well-known-symbol'); var IS_PURE = require('../internals/is-pure'); var ITERATOR = wellKnownSymbol('iterator'); module.exports = !fails(function () { var url = new URL('b?a=1&b=2&c=3', 'http://a'); var searchParams = url.searchParams; var result = ''; url.pathname = 'c%20d'; searchParams.forEach(function (value, key) { searchParams['delete']('b'); result += key + value; }); return (IS_PURE && !url.toJSON) || !searchParams.sort || url.href !== 'http://a/c%20d?a=1&c=3' || searchParams.get('c') !== '3' || String(new URLSearchParams('?a=1')) !== 'a=1' || !searchParams[ITERATOR] // throws in Edge || new URL('https://a@b').username !== 'a' || new URLSearchParams(new URLSearchParams('a=b')).get('a') !== 'b' // not punycoded in Edge || new URL('http://тест').host !== 'xn--e1aybc' // not escaped in Chrome 62- || new URL('http://a#б').hash !== '#%D0%B1' // fails in Chrome 66- || result !== 'a1c3' // throws in Safari || new URL('http://x', undefined).host !== 'x'; }); },{"../internals/fails":22,"../internals/is-pure":38,"../internals/well-known-symbol":77}],43:[function(require,module,exports){ var global = require('../internals/global'); var inspectSource = require('../internals/inspect-source'); var WeakMap = global.WeakMap; module.exports = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap)); },{"../internals/global":27,"../internals/inspect-source":33}],44:[function(require,module,exports){ 'use strict'; var DESCRIPTORS = require('../internals/descriptors'); var fails = require('../internals/fails'); var objectKeys = require('../internals/object-keys'); var getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols'); var propertyIsEnumerableModule = require('../internals/object-property-is-enumerable'); var toObject = require('../internals/to-object'); var IndexedObject = require('../internals/indexed-object'); var nativeAssign = Object.assign; var defineProperty = Object.defineProperty; // `Object.assign` method // https://tc39.github.io/ecma262/#sec-object.assign module.exports = !nativeAssign || fails(function () { // should have correct order of operations (Edge bug) if (DESCRIPTORS && nativeAssign({ b: 1 }, nativeAssign(defineProperty({}, 'a', { enumerable: true, get: function () { defineProperty(this, 'b', { value: 3, enumerable: false }); } }), { b: 2 })).b !== 1) return true; // should work with symbols and should have deterministic property order (V8 bug) var A = {}; var B = {}; // eslint-disable-next-line no-undef var symbol = Symbol(); var alphabet = 'abcdefghijklmnopqrst'; A[symbol] = 7; alphabet.split('').forEach(function (chr) { B[chr] = chr; }); return nativeAssign({}, A)[symbol] != 7 || objectKeys(nativeAssign({}, B)).join('') != alphabet; }) ? function assign(target, source) { // eslint-disable-line no-unused-vars var T = toObject(target); var argumentsLength = arguments.length; var index = 1; var getOwnPropertySymbols = getOwnPropertySymbolsModule.f; var propertyIsEnumerable = propertyIsEnumerableModule.f; while (argumentsLength > index) { var S = IndexedObject(arguments[index++]); var keys = getOwnPropertySymbols ? objectKeys(S).concat(getOwnPropertySymbols(S)) : objectKeys(S); var length = keys.length; var j = 0; var key; while (length > j) { key = keys[j++]; if (!DESCRIPTORS || propertyIsEnumerable.call(S, key)) T[key] = S[key]; } } return T; } : nativeAssign; },{"../internals/descriptors":18,"../internals/fails":22,"../internals/indexed-object":32,"../internals/object-get-own-property-symbols":50,"../internals/object-keys":53,"../internals/object-property-is-enumerable":54,"../internals/to-object":72}],45:[function(require,module,exports){ var anObject = require('../internals/an-object'); var defineProperties = require('../internals/object-define-properties'); var enumBugKeys = require('../internals/enum-bug-keys'); var hiddenKeys = require('../internals/hidden-keys'); var html = require('../internals/html'); var documentCreateElement = require('../internals/document-create-element'); var sharedKey = require('../internals/shared-key'); var GT = '>'; var LT = '<'; var PROTOTYPE = 'prototype'; var SCRIPT = 'script'; var IE_PROTO = sharedKey('IE_PROTO'); var EmptyConstructor = function () { /* empty */ }; var scriptTag = function (content) { return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT; }; // Create object with fake `null` prototype: use ActiveX Object with cleared prototype var NullProtoObjectViaActiveX = function (activeXDocument) { activeXDocument.write(scriptTag('')); activeXDocument.close(); var temp = activeXDocument.parentWindow.Object; activeXDocument = null; // avoid memory leak return temp; }; // Create object with fake `null` prototype: use iframe Object with cleared prototype var NullProtoObjectViaIFrame = function () { // Thrash, waste and sodomy: IE GC bug var iframe = documentCreateElement('iframe'); var JS = 'java' + SCRIPT + ':'; var iframeDocument; iframe.style.display = 'none'; html.appendChild(iframe); // https://github.com/zloirock/core-js/issues/475 iframe.src = String(JS); iframeDocument = iframe.contentWindow.document; iframeDocument.open(); iframeDocument.write(scriptTag('document.F=Object')); iframeDocument.close(); return iframeDocument.F; }; // Check for document.domain and active x support // No need to use active x approach when document.domain is not set // see https://github.com/es-shims/es5-shim/issues/150 // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346 // avoid IE GC bug var activeXDocument; var NullProtoObject = function () { try { /* global ActiveXObject */ activeXDocument = document.domain && new ActiveXObject('htmlfile'); } catch (error) { /* ignore */ } NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame(); var length = enumBugKeys.length; while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]]; return NullProtoObject(); }; hiddenKeys[IE_PROTO] = true; // `Object.create` method // https://tc39.github.io/ecma262/#sec-object.create module.exports = Object.create || function create(O, Properties) { var result; if (O !== null) { EmptyConstructor[PROTOTYPE] = anObject(O); result = new EmptyConstructor(); EmptyConstructor[PROTOTYPE] = null; // add "__proto__" for Object.getPrototypeOf polyfill result[IE_PROTO] = O; } else result = NullProtoObject(); return Properties === undefined ? result : defineProperties(result, Properties); }; },{"../internals/an-object":5,"../internals/document-create-element":19,"../internals/enum-bug-keys":20,"../internals/hidden-keys":29,"../internals/html":30,"../internals/object-define-properties":46,"../internals/shared-key":63}],46:[function(require,module,exports){ var DESCRIPTORS = require('../internals/descriptors'); var definePropertyModule = require('../internals/object-define-property'); var anObject = require('../internals/an-object'); var objectKeys = require('../internals/object-keys'); // `Object.defineProperties` method // https://tc39.github.io/ecma262/#sec-object.defineproperties module.exports = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) { anObject(O); var keys = objectKeys(Properties); var length = keys.length; var index = 0; var key; while (length > index) definePropertyModule.f(O, key = keys[index++], Properties[key]); return O; }; },{"../internals/an-object":5,"../internals/descriptors":18,"../internals/object-define-property":47,"../internals/object-keys":53}],47:[function(require,module,exports){ var DESCRIPTORS = require('../internals/descriptors'); var IE8_DOM_DEFINE = require('../internals/ie8-dom-define'); var anObject = require('../internals/an-object'); var toPrimitive = require('../internals/to-primitive'); var nativeDefineProperty = Object.defineProperty; // `Object.defineProperty` method // https://tc39.github.io/ecma262/#sec-object.defineproperty exports.f = DESCRIPTORS ? nativeDefineProperty : function defineProperty(O, P, Attributes) { anObject(O); P = toPrimitive(P, true); anObject(Attributes); if (IE8_DOM_DEFINE) try { return nativeDefineProperty(O, P, Attributes); } catch (error) { /* empty */ } if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported'); if ('value' in Attributes) O[P] = Attributes.value; return O; }; },{"../internals/an-object":5,"../internals/descriptors":18,"../internals/ie8-dom-define":31,"../internals/to-primitive":73}],48:[function(require,module,exports){ var DESCRIPTORS = require('../internals/descriptors'); var propertyIsEnumerableModule = require('../internals/object-property-is-enumerable'); var createPropertyDescriptor = require('../internals/create-property-descriptor'); var toIndexedObject = require('../internals/to-indexed-object'); var toPrimitive = require('../internals/to-primitive'); var has = require('../internals/has'); var IE8_DOM_DEFINE = require('../internals/ie8-dom-define'); var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; // `Object.getOwnPropertyDescriptor` method // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor exports.f = DESCRIPTORS ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) { O = toIndexedObject(O); P = toPrimitive(P, true); if (IE8_DOM_DEFINE) try { return nativeGetOwnPropertyDescriptor(O, P); } catch (error) { /* empty */ } if (has(O, P)) return createPropertyDescriptor(!propertyIsEnumerableModule.f.call(O, P), O[P]); }; },{"../internals/create-property-descriptor":15,"../internals/descriptors":18,"../internals/has":28,"../internals/ie8-dom-define":31,"../internals/object-property-is-enumerable":54,"../internals/to-indexed-object":69,"../internals/to-primitive":73}],49:[function(require,module,exports){ var internalObjectKeys = require('../internals/object-keys-internal'); var enumBugKeys = require('../internals/enum-bug-keys'); var hiddenKeys = enumBugKeys.concat('length', 'prototype'); // `Object.getOwnPropertyNames` method // https://tc39.github.io/ecma262/#sec-object.getownpropertynames exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { return internalObjectKeys(O, hiddenKeys); }; },{"../internals/enum-bug-keys":20,"../internals/object-keys-internal":52}],50:[function(require,module,exports){ exports.f = Object.getOwnPropertySymbols; },{}],51:[function(require,module,exports){ var has = require('../internals/has'); var toObject = require('../internals/to-object'); var sharedKey = require('../internals/shared-key'); var CORRECT_PROTOTYPE_GETTER = require('../internals/correct-prototype-getter'); var IE_PROTO = sharedKey('IE_PROTO'); var ObjectPrototype = Object.prototype; // `Object.getPrototypeOf` method // https://tc39.github.io/ecma262/#sec-object.getprototypeof module.exports = CORRECT_PROTOTYPE_GETTER ? Object.getPrototypeOf : function (O) { O = toObject(O); if (has(O, IE_PROTO)) return O[IE_PROTO]; if (typeof O.constructor == 'function' && O instanceof O.constructor) { return O.constructor.prototype; } return O instanceof Object ? ObjectPrototype : null; }; },{"../internals/correct-prototype-getter":12,"../internals/has":28,"../internals/shared-key":63,"../internals/to-object":72}],52:[function(require,module,exports){ var has = require('../internals/has'); var toIndexedObject = require('../internals/to-indexed-object'); var indexOf = require('../internals/array-includes').indexOf; var hiddenKeys = require('../internals/hidden-keys'); module.exports = function (object, names) { var O = toIndexedObject(object); var i = 0; var result = []; var key; for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key); // Don't enum bug & hidden keys while (names.length > i) if (has(O, key = names[i++])) { ~indexOf(result, key) || result.push(key); } return result; }; },{"../internals/array-includes":7,"../internals/has":28,"../internals/hidden-keys":29,"../internals/to-indexed-object":69}],53:[function(require,module,exports){ var internalObjectKeys = require('../internals/object-keys-internal'); var enumBugKeys = require('../internals/enum-bug-keys'); // `Object.keys` method // https://tc39.github.io/ecma262/#sec-object.keys module.exports = Object.keys || function keys(O) { return internalObjectKeys(O, enumBugKeys); }; },{"../internals/enum-bug-keys":20,"../internals/object-keys-internal":52}],54:[function(require,module,exports){ 'use strict'; var nativePropertyIsEnumerable = {}.propertyIsEnumerable; var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; // Nashorn ~ JDK8 bug var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1); // `Object.prototype.propertyIsEnumerable` method implementation // https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) { var descriptor = getOwnPropertyDescriptor(this, V); return !!descriptor && descriptor.enumerable; } : nativePropertyIsEnumerable; },{}],55:[function(require,module,exports){ var anObject = require('../internals/an-object'); var aPossiblePrototype = require('../internals/a-possible-prototype'); // `Object.setPrototypeOf` method // https://tc39.github.io/ecma262/#sec-object.setprototypeof // Works with __proto__ only. Old v8 can't work with null proto objects. /* eslint-disable no-proto */ module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () { var CORRECT_SETTER = false; var test = {}; var setter; try { setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set; setter.call(test, []); CORRECT_SETTER = test instanceof Array; } catch (error) { /* empty */ } return function setPrototypeOf(O, proto) { anObject(O); aPossiblePrototype(proto); if (CORRECT_SETTER) setter.call(O, proto); else O.__proto__ = proto; return O; }; }() : undefined); },{"../internals/a-possible-prototype":2,"../internals/an-object":5}],56:[function(require,module,exports){ var getBuiltIn = require('../internals/get-built-in'); var getOwnPropertyNamesModule = require('../internals/object-get-own-property-names'); var getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols'); var anObject = require('../internals/an-object'); // all object keys, includes non-enumerable and symbols module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) { var keys = getOwnPropertyNamesModule.f(anObject(it)); var getOwnPropertySymbols = getOwnPropertySymbolsModule.f; return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys; }; },{"../internals/an-object":5,"../internals/get-built-in":24,"../internals/object-get-own-property-names":49,"../internals/object-get-own-property-symbols":50}],57:[function(require,module,exports){ var global = require('../internals/global'); module.exports = global; },{"../internals/global":27}],58:[function(require,module,exports){ var redefine = require('../internals/redefine'); module.exports = function (target, src, options) { for (var key in src) redefine(target, key, src[key], options); return target; }; },{"../internals/redefine":59}],59:[function(require,module,exports){ var global = require('../internals/global'); var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); var has = require('../internals/has'); var setGlobal = require('../internals/set-global'); var inspectSource = require('../internals/inspect-source'); var InternalStateModule = require('../internals/internal-state'); var getInternalState = InternalStateModule.get; var enforceInternalState = InternalStateModule.enforce; var TEMPLATE = String(String).split('String'); (module.exports = function (O, key, value, options) { var unsafe = options ? !!options.unsafe : false; var simple = options ? !!options.enumerable : false; var noTargetGet = options ? !!options.noTargetGet : false; if (typeof value == 'function') { if (typeof key == 'string' && !has(value, 'name')) createNonEnumerableProperty(value, 'name', key); enforceInternalState(value).source = TEMPLATE.join(typeof key == 'string' ? key : ''); } if (O === global) { if (simple) O[key] = value; else setGlobal(key, value); return; } else if (!unsafe) { delete O[key]; } else if (!noTargetGet && O[key]) { simple = true; } if (simple) O[key] = value; else createNonEnumerableProperty(O, key, value); // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative })(Function.prototype, 'toString', function toString() { return typeof this == 'function' && getInternalState(this).source || inspectSource(this); }); },{"../internals/create-non-enumerable-property":14,"../internals/global":27,"../internals/has":28,"../internals/inspect-source":33,"../internals/internal-state":34,"../internals/set-global":61}],60:[function(require,module,exports){ // `RequireObjectCoercible` abstract operation // https://tc39.github.io/ecma262/#sec-requireobjectcoercible module.exports = function (it) { if (it == undefined) throw TypeError("Can't call method on " + it); return it; }; },{}],61:[function(require,module,exports){ var global = require('../internals/global'); var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); module.exports = function (key, value) { try { createNonEnumerableProperty(global, key, value); } catch (error) { global[key] = value; } return value; }; },{"../internals/create-non-enumerable-property":14,"../internals/global":27}],62:[function(require,module,exports){ var defineProperty = require('../internals/object-define-property').f; var has = require('../internals/has'); var wellKnownSymbol = require('../internals/well-known-symbol'); var TO_STRING_TAG = wellKnownSymbol('toStringTag'); module.exports = function (it, TAG, STATIC) { if (it && !has(it = STATIC ? it : it.prototype, TO_STRING_TAG)) { defineProperty(it, TO_STRING_TAG, { configurable: true, value: TAG }); } }; },{"../internals/has":28,"../internals/object-define-property":47,"../internals/well-known-symbol":77}],63:[function(require,module,exports){ var shared = require('../internals/shared'); var uid = require('../internals/uid'); var keys = shared('keys'); module.exports = function (key) { return keys[key] || (keys[key] = uid(key)); }; },{"../internals/shared":65,"../internals/uid":75}],64:[function(require,module,exports){ var global = require('../internals/global'); var setGlobal = require('../internals/set-global'); var SHARED = '__core-js_shared__'; var store = global[SHARED] || setGlobal(SHARED, {}); module.exports = store; },{"../internals/global":27,"../internals/set-global":61}],65:[function(require,module,exports){ var IS_PURE = require('../internals/is-pure'); var store = require('../internals/shared-store'); (module.exports = function (key, value) { return store[key] || (store[key] = value !== undefined ? value : {}); })('versions', []).push({ version: '3.6.4', mode: IS_PURE ? 'pure' : 'global', copyright: '© 2020 Denis Pushkarev (zloirock.ru)' }); },{"../internals/is-pure":38,"../internals/shared-store":64}],66:[function(require,module,exports){ var toInteger = require('../internals/to-integer'); var requireObjectCoercible = require('../internals/require-object-coercible'); // `String.prototype.{ codePointAt, at }` methods implementation var createMethod = function (CONVERT_TO_STRING) { return function ($this, pos) { var S = String(requireObjectCoercible($this)); var position = toInteger(pos); var size = S.length; var first, second; if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined; first = S.charCodeAt(position); return first < 0xD800 || first > 0xDBFF || position + 1 === size || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF ? CONVERT_TO_STRING ? S.charAt(position) : first : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000; }; }; module.exports = { // `String.prototype.codePointAt` method // https://tc39.github.io/ecma262/#sec-string.prototype.codepointat codeAt: createMethod(false), // `String.prototype.at` method // https://github.com/mathiasbynens/String.prototype.at charAt: createMethod(true) }; },{"../internals/require-object-coercible":60,"../internals/to-integer":70}],67:[function(require,module,exports){ 'use strict'; // based on https://github.com/bestiejs/punycode.js/blob/master/punycode.js var maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1 var base = 36; var tMin = 1; var tMax = 26; var skew = 38; var damp = 700; var initialBias = 72; var initialN = 128; // 0x80 var delimiter = '-'; // '\x2D' var regexNonASCII = /[^\0-\u007E]/; // non-ASCII chars var regexSeparators = /[.\u3002\uFF0E\uFF61]/g; // RFC 3490 separators var OVERFLOW_ERROR = 'Overflow: input needs wider integers to process'; var baseMinusTMin = base - tMin; var floor = Math.floor; var stringFromCharCode = String.fromCharCode; /** * Creates an array containing the numeric code points of each Unicode * character in the string. While JavaScript uses UCS-2 internally, * this function will convert a pair of surrogate halves (each of which * UCS-2 exposes as separate characters) into a single code point, * matching UTF-16. */ var ucs2decode = function (string) { var output = []; var counter = 0; var length = string.length; while (counter < length) { var value = string.charCodeAt(counter++); if (value >= 0xD800 && value <= 0xDBFF && counter < length) { // It's a high surrogate, and there is a next character. var extra = string.charCodeAt(counter++); if ((extra & 0xFC00) == 0xDC00) { // Low surrogate. output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); } else { // It's an unmatched surrogate; only append this code unit, in case the // next code unit is the high surrogate of a surrogate pair. output.push(value); counter--; } } else { output.push(value); } } return output; }; /** * Converts a digit/integer into a basic code point. */ var digitToBasic = function (digit) { // 0..25 map to ASCII a..z or A..Z // 26..35 map to ASCII 0..9 return digit + 22 + 75 * (digit < 26); }; /** * Bias adaptation function as per section 3.4 of RFC 3492. * https://tools.ietf.org/html/rfc3492#section-3.4 */ var adapt = function (delta, numPoints, firstTime) { var k = 0; delta = firstTime ? floor(delta / damp) : delta >> 1; delta += floor(delta / numPoints); for (; delta > baseMinusTMin * tMax >> 1; k += base) { delta = floor(delta / baseMinusTMin); } return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); }; /** * Converts a string of Unicode symbols (e.g. a domain name label) to a * Punycode string of ASCII-only symbols. */ // eslint-disable-next-line max-statements var encode = function (input) { var output = []; // Convert the input in UCS-2 to an array of Unicode code points. input = ucs2decode(input); // Cache the length. var inputLength = input.length; // Initialize the state. var n = initialN; var delta = 0; var bias = initialBias; var i, currentValue; // Handle the basic code points. for (i = 0; i < input.length; i++) { currentValue = input[i]; if (currentValue < 0x80) { output.push(stringFromCharCode(currentValue)); } } var basicLength = output.length; // number of basic code points. var handledCPCount = basicLength; // number of code points that have been handled; // Finish the basic string with a delimiter unless it's empty. if (basicLength) { output.push(delimiter); } // Main encoding loop: while (handledCPCount < inputLength) { // All non-basic code points < n have been handled already. Find the next larger one: var m = maxInt; for (i = 0; i < input.length; i++) { currentValue = input[i]; if (currentValue >= n && currentValue < m) { m = currentValue; } } // Increase `delta` enough to advance the decoder's <n,i> state to <m,0>, but guard against overflow. var handledCPCountPlusOne = handledCPCount + 1; if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { throw RangeError(OVERFLOW_ERROR); } delta += (m - n) * handledCPCountPlusOne; n = m; for (i = 0; i < input.length; i++) { currentValue = input[i]; if (currentValue < n && ++delta > maxInt) { throw RangeError(OVERFLOW_ERROR); } if (currentValue == n) { // Represent delta as a generalized variable-length integer. var q = delta; for (var k = base; /* no condition */; k += base) { var t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); if (q < t) break; var qMinusT = q - t; var baseMinusT = base - t; output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT))); q = floor(qMinusT / baseMinusT); } output.push(stringFromCharCode(digitToBasic(q))); bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); delta = 0; ++handledCPCount; } } ++delta; ++n; } return output.join(''); }; module.exports = function (input) { var encoded = []; var labels = input.toLowerCase().replace(regexSeparators, '\u002E').split('.'); var i, label; for (i = 0; i < labels.length; i++) { label = labels[i]; encoded.push(regexNonASCII.test(label) ? 'xn--' + encode(label) : label); } return encoded.join('.'); }; },{}],68:[function(require,module,exports){ var toInteger = require('../internals/to-integer'); var max = Math.max; var min = Math.min; // Helper for a popular repeating case of the spec: // Let integer be ? ToInteger(index). // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length). module.exports = function (index, length) { var integer = toInteger(index); return integer < 0 ? max(integer + length, 0) : min(integer, length); }; },{"../internals/to-integer":70}],69:[function(require,module,exports){ // toObject with fallback for non-array-like ES3 strings var IndexedObject = require('../internals/indexed-object'); var requireObjectCoercible = require('../internals/require-object-coercible'); module.exports = function (it) { return IndexedObject(requireObjectCoercible(it)); }; },{"../internals/indexed-object":32,"../internals/require-object-coercible":60}],70:[function(require,module,exports){ var ceil = Math.ceil; var floor = Math.floor; // `ToInteger` abstract operation // https://tc39.github.io/ecma262/#sec-tointeger module.exports = function (argument) { return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument); }; },{}],71:[function(require,module,exports){ var toInteger = require('../internals/to-integer'); var min = Math.min; // `ToLength` abstract operation // https://tc39.github.io/ecma262/#sec-tolength module.exports = function (argument) { return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991 }; },{"../internals/to-integer":70}],72:[function(require,module,exports){ var requireObjectCoercible = require('../internals/require-object-coercible'); // `ToObject` abstract operation // https://tc39.github.io/ecma262/#sec-toobject module.exports = function (argument) { return Object(requireObjectCoercible(argument)); }; },{"../internals/require-object-coercible":60}],73:[function(require,module,exports){ var isObject = require('../internals/is-object'); // `ToPrimitive` abstract operation // https://tc39.github.io/ecma262/#sec-toprimitive // instead of the ES6 spec version, we didn't implement @@toPrimitive case // and the second argument - flag - preferred type is a string module.exports = function (input, PREFERRED_STRING) { if (!isObject(input)) return input; var fn, val; if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val; if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val; if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val; throw TypeError("Can't convert object to primitive value"); }; },{"../internals/is-object":37}],74:[function(require,module,exports){ var wellKnownSymbol = require('../internals/well-known-symbol'); var TO_STRING_TAG = wellKnownSymbol('toStringTag'); var test = {}; test[TO_STRING_TAG] = 'z'; module.exports = String(test) === '[object z]'; },{"../internals/well-known-symbol":77}],75:[function(require,module,exports){ var id = 0; var postfix = Math.random(); module.exports = function (key) { return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36); }; },{}],76:[function(require,module,exports){ var NATIVE_SYMBOL = require('../internals/native-symbol'); module.exports = NATIVE_SYMBOL // eslint-disable-next-line no-undef && !Symbol.sham // eslint-disable-next-line no-undef && typeof Symbol.iterator == 'symbol'; },{"../internals/native-symbol":41}],77:[function(require,module,exports){ var global = require('../internals/global'); var shared = require('../internals/shared'); var has = require('../internals/has'); var uid = require('../internals/uid'); var NATIVE_SYMBOL = require('../internals/native-symbol'); var USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid'); var WellKnownSymbolsStore = shared('wks'); var Symbol = global.Symbol; var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid; module.exports = function (name) { if (!has(WellKnownSymbolsStore, name)) { if (NATIVE_SYMBOL && has(Symbol, name)) WellKnownSymbolsStore[name] = Symbol[name]; else WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name); } return WellKnownSymbolsStore[name]; }; },{"../internals/global":27,"../internals/has":28,"../internals/native-symbol":41,"../internals/shared":65,"../internals/uid":75,"../internals/use-symbol-as-uid":76}],78:[function(require,module,exports){ 'use strict'; var toIndexedObject = require('../internals/to-indexed-object'); var addToUnscopables = require('../internals/add-to-unscopables'); var Iterators = require('../internals/iterators'); var InternalStateModule = require('../internals/internal-state'); var defineIterator = require('../internals/define-iterator'); var ARRAY_ITERATOR = 'Array Iterator'; var setInternalState = InternalStateModule.set; var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR); // `Array.prototype.entries` method // https://tc39.github.io/ecma262/#sec-array.prototype.entries // `Array.prototype.keys` method // https://tc39.github.io/ecma262/#sec-array.prototype.keys // `Array.prototype.values` method // https://tc39.github.io/ecma262/#sec-array.prototype.values // `Array.prototype[@@iterator]` method // https://tc39.github.io/ecma262/#sec-array.prototype-@@iterator // `CreateArrayIterator` internal method // https://tc39.github.io/ecma262/#sec-createarrayiterator module.exports = defineIterator(Array, 'Array', function (iterated, kind) { setInternalState(this, { type: ARRAY_ITERATOR, target: toIndexedObject(iterated), // target index: 0, // next index kind: kind // kind }); // `%ArrayIteratorPrototype%.next` method // https://tc39.github.io/ecma262/#sec-%arrayiteratorprototype%.next }, function () { var state = getInternalState(this); var target = state.target; var kind = state.kind; var index = state.index++; if (!target || index >= target.length) { state.target = undefined; return { value: undefined, done: true }; } if (kind == 'keys') return { value: index, done: false }; if (kind == 'values') return { value: target[index], done: false }; return { value: [index, target[index]], done: false }; }, 'values'); // argumentsList[@@iterator] is %ArrayProto_values% // https://tc39.github.io/ecma262/#sec-createunmappedargumentsobject // https://tc39.github.io/ecma262/#sec-createmappedargumentsobject Iterators.Arguments = Iterators.Array; // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables addToUnscopables('keys'); addToUnscopables('values'); addToUnscopables('entries'); },{"../internals/add-to-unscopables":3,"../internals/define-iterator":17,"../internals/internal-state":34,"../internals/iterators":40,"../internals/to-indexed-object":69}],79:[function(require,module,exports){ 'use strict'; var charAt = require('../internals/string-multibyte').charAt; var InternalStateModule = require('../internals/internal-state'); var defineIterator = require('../internals/define-iterator'); var STRING_ITERATOR = 'String Iterator'; var setInternalState = InternalStateModule.set; var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR); // `String.prototype[@@iterator]` method // https://tc39.github.io/ecma262/#sec-string.prototype-@@iterator defineIterator(String, 'String', function (iterated) { setInternalState(this, { type: STRING_ITERATOR, string: String(iterated), index: 0 }); // `%StringIteratorPrototype%.next` method // https://tc39.github.io/ecma262/#sec-%stringiteratorprototype%.next }, function next() { var state = getInternalState(this); var string = state.string; var index = state.index; var point; if (index >= string.length) return { value: undefined, done: true }; point = charAt(string, index); state.index += point.length; return { value: point, done: false }; }); },{"../internals/define-iterator":17,"../internals/internal-state":34,"../internals/string-multibyte":66}],80:[function(require,module,exports){ 'use strict'; // TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env` require('../modules/es.array.iterator'); var $ = require('../internals/export'); var getBuiltIn = require('../internals/get-built-in'); var USE_NATIVE_URL = require('../internals/native-url'); var redefine = require('../internals/redefine'); var redefineAll = require('../internals/redefine-all'); var setToStringTag = require('../internals/set-to-string-tag'); var createIteratorConstructor = require('../internals/create-iterator-constructor'); var InternalStateModule = require('../internals/internal-state'); var anInstance = require('../internals/an-instance'); var hasOwn = require('../internals/has'); var bind = require('../internals/function-bind-context'); var classof = require('../internals/classof'); var anObject = require('../internals/an-object'); var isObject = require('../internals/is-object'); var create = require('../internals/object-create'); var createPropertyDescriptor = require('../internals/create-property-descriptor'); var getIterator = require('../internals/get-iterator'); var getIteratorMethod = require('../internals/get-iterator-method'); var wellKnownSymbol = require('../internals/well-known-symbol'); var $fetch = getBuiltIn('fetch'); var Headers = getBuiltIn('Headers'); var ITERATOR = wellKnownSymbol('iterator'); var URL_SEARCH_PARAMS = 'URLSearchParams'; var URL_SEARCH_PARAMS_ITERATOR = URL_SEARCH_PARAMS + 'Iterator'; var setInternalState = InternalStateModule.set; var getInternalParamsState = InternalStateModule.getterFor(URL_SEARCH_PARAMS); var getInternalIteratorState = InternalStateModule.getterFor(URL_SEARCH_PARAMS_ITERATOR); var plus = /\+/g; var sequences = Array(4); var percentSequence = function (bytes) { return sequences[bytes - 1] || (sequences[bytes - 1] = RegExp('((?:%[\\da-f]{2}){' + bytes + '})', 'gi')); }; var percentDecode = function (sequence) { try { return decodeURIComponent(sequence); } catch (error) { return sequence; } }; var deserialize = function (it) { var result = it.replace(plus, ' '); var bytes = 4; try { return decodeURIComponent(result); } catch (error) { while (bytes) { result = result.replace(percentSequence(bytes--), percentDecode); } return result; } }; var find = /[!'()~]|%20/g; var replace = { '!': '%21', "'": '%27', '(': '%28', ')': '%29', '~': '%7E', '%20': '+' }; var replacer = function (match) { return replace[match]; }; var serialize = function (it) { return encodeURIComponent(it).replace(find, replacer); }; var parseSearchParams = function (result, query) { if (query) { var attributes = query.split('&'); var index = 0; var attribute, entry; while (index < attributes.length) { attribute = attributes[index++]; if (attribute.length) { entry = attribute.split('='); result.push({ key: deserialize(entry.shift()), value: deserialize(entry.join('=')) }); } } } }; var updateSearchParams = function (query) { this.entries.length = 0; parseSearchParams(this.entries, query); }; var validateArgumentsLength = function (passed, required) { if (passed < required) throw TypeError('Not enough arguments'); }; var URLSearchParamsIterator = createIteratorConstructor(function Iterator(params, kind) { setInternalState(this, { type: URL_SEARCH_PARAMS_ITERATOR, iterator: getIterator(getInternalParamsState(params).entries), kind: kind }); }, 'Iterator', function next() { var state = getInternalIteratorState(this); var kind = state.kind; var step = state.iterator.next(); var entry = step.value; if (!step.done) { step.value = kind === 'keys' ? entry.key : kind === 'values' ? entry.value : [entry.key, entry.value]; } return step; }); // `URLSearchParams` constructor // https://url.spec.whatwg.org/#interface-urlsearchparams var URLSearchParamsConstructor = function URLSearchParams(/* init */) { anInstance(this, URLSearchParamsConstructor, URL_SEARCH_PARAMS); var init = arguments.length > 0 ? arguments[0] : undefined; var that = this; var entries = []; var iteratorMethod, iterator, next, step, entryIterator, entryNext, first, second, key; setInternalState(that, { type: URL_SEARCH_PARAMS, entries: entries, updateURL: function () { /* empty */ }, updateSearchParams: updateSearchParams }); if (init !== undefined) { if (isObject(init)) { iteratorMethod = getIteratorMethod(init); if (typeof iteratorMethod === 'function') { iterator = iteratorMethod.call(init); next = iterator.next; while (!(step = next.call(iterator)).done) { entryIterator = getIterator(anObject(step.value)); entryNext = entryIterator.next; if ( (first = entryNext.call(entryIterator)).done || (second = entryNext.call(entryIterator)).done || !entryNext.call(entryIterator).done ) throw TypeError('Expected sequence with length 2'); entries.push({ key: first.value + '', value: second.value + '' }); } } else for (key in init) if (hasOwn(init, key)) entries.push({ key: key, value: init[key] + '' }); } else { parseSearchParams(entries, typeof init === 'string' ? init.charAt(0) === '?' ? init.slice(1) : init : init + ''); } } }; var URLSearchParamsPrototype = URLSearchParamsConstructor.prototype; redefineAll(URLSearchParamsPrototype, { // `URLSearchParams.prototype.appent` method // https://url.spec.whatwg.org/#dom-urlsearchparams-append append: function append(name, value) { validateArgumentsLength(arguments.length, 2); var state = getInternalParamsState(this); state.entries.push({ key: name + '', value: value + '' }); state.updateURL(); }, // `URLSearchParams.prototype.delete` method // https://url.spec.whatwg.org/#dom-urlsearchparams-delete 'delete': function (name) { validateArgumentsLength(arguments.length, 1); var state = getInternalParamsState(this); var entries = state.entries; var key = name + ''; var index = 0; while (index < entries.length) { if (entries[index].key === key) entries.splice(index, 1); else index++; } state.updateURL(); }, // `URLSearchParams.prototype.get` method // https://url.spec.whatwg.org/#dom-urlsearchparams-get get: function get(name) { validateArgumentsLength(arguments.length, 1); var entries = getInternalParamsState(this).entries; var key = name + ''; var index = 0; for (; index < entries.length; index++) { if (entries[index].key === key) return entries[index].value; } return null; }, // `URLSearchParams.prototype.getAll` method // https://url.spec.whatwg.org/#dom-urlsearchparams-getall getAll: function getAll(name) { validateArgumentsLength(arguments.length, 1); var entries = getInternalParamsState(this).entries; var key = name + ''; var result = []; var index = 0; for (; index < entries.length; index++) { if (entries[index].key === key) result.push(entries[index].value); } return result; }, // `URLSearchParams.prototype.has` method // https://url.spec.whatwg.org/#dom-urlsearchparams-has has: function has(name) { validateArgumentsLength(arguments.length, 1); var entries = getInternalParamsState(this).entries; var key = name + ''; var index = 0; while (index < entries.length) { if (entries[index++].key === key) return true; } return false; }, // `URLSearchParams.prototype.set` method // https://url.spec.whatwg.org/#dom-urlsearchparams-set set: function set(name, value) { validateArgumentsLength(arguments.length, 1); var state = getInternalParamsState(this); var entries = state.entries; var found = false; var key = name + ''; var val = value + ''; var index = 0; var entry; for (; index < entries.length; index++) { entry = entries[index]; if (entry.key === key) { if (found) entries.splice(index--, 1); else { found = true; entry.value = val; } } } if (!found) entries.push({ key: key, value: val }); state.updateURL(); }, // `URLSearchParams.prototype.sort` method // https://url.spec.whatwg.org/#dom-urlsearchparams-sort sort: function sort() { var state = getInternalParamsState(this); var entries = state.entries; // Array#sort is not stable in some engines var slice = entries.slice(); var entry, entriesIndex, sliceIndex; entries.length = 0; for (sliceIndex = 0; sliceIndex < slice.length; sliceIndex++) { entry = slice[sliceIndex]; for (entriesIndex = 0; entriesIndex < sliceIndex; entriesIndex++) { if (entries[entriesIndex].key > entry.key) { entries.splice(entriesIndex, 0, entry); break; } } if (entriesIndex === sliceIndex) entries.push(entry); } state.updateURL(); }, // `URLSearchParams.prototype.forEach` method forEach: function forEach(callback /* , thisArg */) { var entries = getInternalParamsState(this).entries; var boundFunction = bind(callback, arguments.length > 1 ? arguments[1] : undefined, 3); var index = 0; var entry; while (index < entries.length) { entry = entries[index++]; boundFunction(entry.value, entry.key, this); } }, // `URLSearchParams.prototype.keys` method keys: function keys() { return new URLSearchParamsIterator(this, 'keys'); }, // `URLSearchParams.prototype.values` method values: function values() { return new URLSearchParamsIterator(this, 'values'); }, // `URLSearchParams.prototype.entries` method entries: function entries() { return new URLSearchParamsIterator(this, 'entries'); } }, { enumerable: true }); // `URLSearchParams.prototype[@@iterator]` method redefine(URLSearchParamsPrototype, ITERATOR, URLSearchParamsPrototype.entries); // `URLSearchParams.prototype.toString` method // https://url.spec.whatwg.org/#urlsearchparams-stringification-behavior redefine(URLSearchParamsPrototype, 'toString', function toString() { var entries = getInternalParamsState(this).entries; var result = []; var index = 0; var entry; while (index < entries.length) { entry = entries[index++]; result.push(serialize(entry.key) + '=' + serialize(entry.value)); } return result.join('&'); }, { enumerable: true }); setToStringTag(URLSearchParamsConstructor, URL_SEARCH_PARAMS); $({ global: true, forced: !USE_NATIVE_URL }, { URLSearchParams: URLSearchParamsConstructor }); // Wrap `fetch` for correct work with polyfilled `URLSearchParams` // https://github.com/zloirock/core-js/issues/674 if (!USE_NATIVE_URL && typeof $fetch == 'function' && typeof Headers == 'function') { $({ global: true, enumerable: true, forced: true }, { fetch: function fetch(input /* , init */) { var args = [input]; var init, body, headers; if (arguments.length > 1) { init = arguments[1]; if (isObject(init)) { body = init.body; if (classof(body) === URL_SEARCH_PARAMS) { headers = init.headers ? new Headers(init.headers) : new Headers(); if (!headers.has('content-type')) { headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8'); } init = create(init, { body: createPropertyDescriptor(0, String(body)), headers: createPropertyDescriptor(0, headers) }); } } args.push(init); } return $fetch.apply(this, args); } }); } module.exports = { URLSearchParams: URLSearchParamsConstructor, getState: getInternalParamsState }; },{"../internals/an-instance":4,"../internals/an-object":5,"../internals/classof":10,"../internals/create-iterator-constructor":13,"../internals/create-property-descriptor":15,"../internals/export":21,"../internals/function-bind-context":23,"../internals/get-built-in":24,"../internals/get-iterator":26,"../internals/get-iterator-method":25,"../internals/has":28,"../internals/internal-state":34,"../internals/is-object":37,"../internals/native-url":42,"../internals/object-create":45,"../internals/redefine":59,"../internals/redefine-all":58,"../internals/set-to-string-tag":62,"../internals/well-known-symbol":77,"../modules/es.array.iterator":78}],81:[function(require,module,exports){ 'use strict'; // TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env` require('../modules/es.string.iterator'); var $ = require('../internals/export'); var DESCRIPTORS = require('../internals/descriptors'); var USE_NATIVE_URL = require('../internals/native-url'); var global = require('../internals/global'); var defineProperties = require('../internals/object-define-properties'); var redefine = require('../internals/redefine'); var anInstance = require('../internals/an-instance'); var has = require('../internals/has'); var assign = require('../internals/object-assign'); var arrayFrom = require('../internals/array-from'); var codeAt = require('../internals/string-multibyte').codeAt; var toASCII = require('../internals/string-punycode-to-ascii'); var setToStringTag = require('../internals/set-to-string-tag'); var URLSearchParamsModule = require('../modules/web.url-search-params'); var InternalStateModule = require('../internals/internal-state'); var NativeURL = global.URL; var URLSearchParams = URLSearchParamsModule.URLSearchParams; var getInternalSearchParamsState = URLSearchParamsModule.getState; var setInternalState = InternalStateModule.set; var getInternalURLState = InternalStateModule.getterFor('URL'); var floor = Math.floor; var pow = Math.pow; var INVALID_AUTHORITY = 'Invalid authority'; var INVALID_SCHEME = 'Invalid scheme'; var INVALID_HOST = 'Invalid host'; var INVALID_PORT = 'Invalid port'; var ALPHA = /[A-Za-z]/; var ALPHANUMERIC = /[\d+\-.A-Za-z]/; var DIGIT = /\d/; var HEX_START = /^(0x|0X)/; var OCT = /^[0-7]+$/; var DEC = /^\d+$/; var HEX = /^[\dA-Fa-f]+$/; // eslint-disable-next-line no-control-regex var FORBIDDEN_HOST_CODE_POINT = /[\u0000\u0009\u000A\u000D #%/:?@[\\]]/; // eslint-disable-next-line no-control-regex var FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT = /[\u0000\u0009\u000A\u000D #/:?@[\\]]/; // eslint-disable-next-line no-control-regex var LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE = /^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g; // eslint-disable-next-line no-control-regex var TAB_AND_NEW_LINE = /[\u0009\u000A\u000D]/g; var EOF; var parseHost = function (url, input) { var result, codePoints, index; if (input.charAt(0) == '[') { if (input.charAt(input.length - 1) != ']') return INVALID_HOST; result = parseIPv6(input.slice(1, -1)); if (!result) return INVALID_HOST; url.host = result; // opaque host } else if (!isSpecial(url)) { if (FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT.test(input)) return INVALID_HOST; result = ''; codePoints = arrayFrom(input); for (index = 0; index < codePoints.length; index++) { result += percentEncode(codePoints[index], C0ControlPercentEncodeSet); } url.host = result; } else { input = toASCII(input); if (FORBIDDEN_HOST_CODE_POINT.test(input)) return INVALID_HOST; result = parseIPv4(input); if (result === null) return INVALID_HOST; url.host = result; } }; var parseIPv4 = function (input) { var parts = input.split('.'); var partsLength, numbers, index, part, radix, number, ipv4; if (parts.length && parts[parts.length - 1] == '') { parts.pop(); } partsLength = parts.length; if (partsLength > 4) return input; numbers = []; for (index = 0; index < partsLength; index++) { part = parts[index]; if (part == '') return input; radix = 10; if (part.length > 1 && part.charAt(0) == '0') { radix = HEX_START.test(part) ? 16 : 8; part = part.slice(radix == 8 ? 1 : 2); } if (part === '') { number = 0; } else { if (!(radix == 10 ? DEC : radix == 8 ? OCT : HEX).test(part)) return input; number = parseInt(part, radix); } numbers.push(number); } for (index = 0; index < partsLength; index++) { number = numbers[index]; if (index == partsLength - 1) { if (number >= pow(256, 5 - partsLength)) return null; } else if (number > 255) return null; } ipv4 = numbers.pop(); for (index = 0; index < numbers.length; index++) { ipv4 += numbers[index] * pow(256, 3 - index); } return ipv4; }; // eslint-disable-next-line max-statements var parseIPv6 = function (input) { var address = [0, 0, 0, 0, 0, 0, 0, 0]; var pieceIndex = 0; var compress = null; var pointer = 0; var value, length, numbersSeen, ipv4Piece, number, swaps, swap; var char = function () { return input.charAt(pointer); }; if (char() == ':') { if (input.charAt(1) != ':') return; pointer += 2; pieceIndex++; compress = pieceIndex; } while (char()) { if (pieceIndex == 8) return; if (char() == ':') { if (compress !== null) return; pointer++; pieceIndex++; compress = pieceIndex; continue; } value = length = 0; while (length < 4 && HEX.test(char())) { value = value * 16 + parseInt(char(), 16); pointer++; length++; } if (char() == '.') { if (length == 0) return; pointer -= length; if (pieceIndex > 6) return; numbersSeen = 0; while (char()) { ipv4Piece = null; if (numbersSeen > 0) { if (char() == '.' && numbersSeen < 4) pointer++; else return; } if (!DIGIT.test(char())) return; while (DIGIT.test(char())) { number = parseInt(char(), 10); if (ipv4Piece === null) ipv4Piece = number; else if (ipv4Piece == 0) return; else ipv4Piece = ipv4Piece * 10 + number; if (ipv4Piece > 255) return; pointer++; } address[pieceIndex] = address[pieceIndex] * 256 + ipv4Piece; numbersSeen++; if (numbersSeen == 2 || numbersSeen == 4) pieceIndex++; } if (numbersSeen != 4) return; break; } else if (char() == ':') { pointer++; if (!char()) return; } else if (char()) return; address[pieceIndex++] = value; } if (compress !== null) { swaps = pieceIndex - compress; pieceIndex = 7; while (pieceIndex != 0 && swaps > 0) { swap = address[pieceIndex]; address[pieceIndex--] = address[compress + swaps - 1]; address[compress + --swaps] = swap; } } else if (pieceIndex != 8) return; return address; }; var findLongestZeroSequence = function (ipv6) { var maxIndex = null; var maxLength = 1; var currStart = null; var currLength = 0; var index = 0; for (; index < 8; index++) { if (ipv6[index] !== 0) { if (currLength > maxLength) { maxIndex = currStart; maxLength = currLength; } currStart = null; currLength = 0; } else { if (currStart === null) currStart = index; ++currLength; } } if (currLength > maxLength) { maxIndex = currStart; maxLength = currLength; } return maxIndex; }; var serializeHost = function (host) { var result, index, compress, ignore0; // ipv4 if (typeof host == 'number') { result = []; for (index = 0; index < 4; index++) { result.unshift(host % 256); host = floor(host / 256); } return result.join('.'); // ipv6 } else if (typeof host == 'object') { result = ''; compress = findLongestZeroSequence(host); for (index = 0; index < 8; index++) { if (ignore0 && host[index] === 0) continue; if (ignore0) ignore0 = false; if (compress === index) { result += index ? ':' : '::'; ignore0 = true; } else { result += host[index].toString(16); if (index < 7) result += ':'; } } return '[' + result + ']'; } return host; }; var C0ControlPercentEncodeSet = {}; var fragmentPercentEncodeSet = assign({}, C0ControlPercentEncodeSet, { ' ': 1, '"': 1, '<': 1, '>': 1, '`': 1 }); var pathPercentEncodeSet = assign({}, fragmentPercentEncodeSet, { '#': 1, '?': 1, '{': 1, '}': 1 }); var userinfoPercentEncodeSet = assign({}, pathPercentEncodeSet, { '/': 1, ':': 1, ';': 1, '=': 1, '@': 1, '[': 1, '\\': 1, ']': 1, '^': 1, '|': 1 }); var percentEncode = function (char, set) { var code = codeAt(char, 0); return code > 0x20 && code < 0x7F && !has(set, char) ? char : encodeURIComponent(char); }; var specialSchemes = { ftp: 21, file: null, http: 80, https: 443, ws: 80, wss: 443 }; var isSpecial = function (url) { return has(specialSchemes, url.scheme); }; var includesCredentials = function (url) { return url.username != '' || url.password != ''; }; var cannotHaveUsernamePasswordPort = function (url) { return !url.host || url.cannotBeABaseURL || url.scheme == 'file'; }; var isWindowsDriveLetter = function (string, normalized) { var second; return string.length == 2 && ALPHA.test(string.charAt(0)) && ((second = string.charAt(1)) == ':' || (!normalized && second == '|')); }; var startsWithWindowsDriveLetter = function (string) { var third; return string.length > 1 && isWindowsDriveLetter(string.slice(0, 2)) && ( string.length == 2 || ((third = string.charAt(2)) === '/' || third === '\\' || third === '?' || third === '#') ); }; var shortenURLsPath = function (url) { var path = url.path; var pathSize = path.length; if (pathSize && (url.scheme != 'file' || pathSize != 1 || !isWindowsDriveLetter(path[0], true))) { path.pop(); } }; var isSingleDot = function (segment) { return segment === '.' || segment.toLowerCase() === '%2e'; }; var isDoubleDot = function (segment) { segment = segment.toLowerCase(); return segment === '..' || segment === '%2e.' || segment === '.%2e' || segment === '%2e%2e'; }; // States: var SCHEME_START = {}; var SCHEME = {}; var NO_SCHEME = {}; var SPECIAL_RELATIVE_OR_AUTHORITY = {}; var PATH_OR_AUTHORITY = {}; var RELATIVE = {}; var RELATIVE_SLASH = {}; var SPECIAL_AUTHORITY_SLASHES = {}; var SPECIAL_AUTHORITY_IGNORE_SLASHES = {}; var AUTHORITY = {}; var HOST = {}; var HOSTNAME = {}; var PORT = {}; var FILE = {}; var FILE_SLASH = {}; var FILE_HOST = {}; var PATH_START = {}; var PATH = {}; var CANNOT_BE_A_BASE_URL_PATH = {}; var QUERY = {}; var FRAGMENT = {}; // eslint-disable-next-line max-statements var parseURL = function (url, input, stateOverride, base) { var state = stateOverride || SCHEME_START; var pointer = 0; var buffer = ''; var seenAt = false; var seenBracket = false; var seenPasswordToken = false; var codePoints, char, bufferCodePoints, failure; if (!stateOverride) { url.scheme = ''; url.username = ''; url.password = ''; url.host = null; url.port = null; url.path = []; url.query = null; url.fragment = null; url.cannotBeABaseURL = false; input = input.replace(LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE, ''); } input = input.replace(TAB_AND_NEW_LINE, ''); codePoints = arrayFrom(input); while (pointer <= codePoints.length) { char = codePoints[pointer]; switch (state) { case SCHEME_START: if (char && ALPHA.test(char)) { buffer += char.toLowerCase(); state = SCHEME; } else if (!stateOverride) { state = NO_SCHEME; continue; } else return INVALID_SCHEME; break; case SCHEME: if (char && (ALPHANUMERIC.test(char) || char == '+' || char == '-' || char == '.')) { buffer += char.toLowerCase(); } else if (char == ':') { if (stateOverride && ( (isSpecial(url) != has(specialSchemes, buffer)) || (buffer == 'file' && (includesCredentials(url) || url.port !== null)) || (url.scheme == 'file' && !url.host) )) return; url.scheme = buffer; if (stateOverride) { if (isSpecial(url) && specialSchemes[url.scheme] == url.port) url.port = null; return; } buffer = ''; if (url.scheme == 'file') { state = FILE; } else if (isSpecial(url) && base && base.scheme == url.scheme) { state = SPECIAL_RELATIVE_OR_AUTHORITY; } else if (isSpecial(url)) { state = SPECIAL_AUTHORITY_SLASHES; } else if (codePoints[pointer + 1] == '/') { state = PATH_OR_AUTHORITY; pointer++; } else { url.cannotBeABaseURL = true; url.path.push(''); state = CANNOT_BE_A_BASE_URL_PATH; } } else if (!stateOverride) { buffer = ''; state = NO_SCHEME; pointer = 0; continue; } else return INVALID_SCHEME; break; case NO_SCHEME: if (!base || (base.cannotBeABaseURL && char != '#')) return INVALID_SCHEME; if (base.cannotBeABaseURL && char == '#') { url.scheme = base.scheme; url.path = base.path.slice(); url.query = base.query; url.fragment = ''; url.cannotBeABaseURL = true; state = FRAGMENT; break; } state = base.scheme == 'file' ? FILE : RELATIVE; continue; case SPECIAL_RELATIVE_OR_AUTHORITY: if (char == '/' && codePoints[pointer + 1] == '/') { state = SPECIAL_AUTHORITY_IGNORE_SLASHES; pointer++; } else { state = RELATIVE; continue; } break; case PATH_OR_AUTHORITY: if (char == '/') { state = AUTHORITY; break; } else { state = PATH; continue; } case RELATIVE: url.scheme = base.scheme; if (char == EOF) { url.username = base.username; url.password = base.password; url.host = base.host; url.port = base.port; url.path = base.path.slice(); url.query = base.query; } else if (char == '/' || (char == '\\' && isSpecial(url))) { state = RELATIVE_SLASH; } else if (char == '?') { url.username = base.username; url.password = base.password; url.host = base.host; url.port = base.port; url.path = base.path.slice(); url.query = ''; state = QUERY; } else if (char == '#') { url.username = base.username; url.password = base.password; url.host = base.host; url.port = base.port; url.path = base.path.slice(); url.query = base.query; url.fragment = ''; state = FRAGMENT; } else { url.username = base.username; url.password = base.password; url.host = base.host; url.port = base.port; url.path = base.path.slice(); url.path.pop(); state = PATH; continue; } break; case RELATIVE_SLASH: if (isSpecial(url) && (char == '/' || char == '\\')) { state = SPECIAL_AUTHORITY_IGNORE_SLASHES; } else if (char == '/') { state = AUTHORITY; } else { url.username = base.username; url.password = base.password; url.host = base.host; url.port = base.port; state = PATH; continue; } break; case SPECIAL_AUTHORITY_SLASHES: state = SPECIAL_AUTHORITY_IGNORE_SLASHES; if (char != '/' || buffer.charAt(pointer + 1) != '/') continue; pointer++; break; case SPECIAL_AUTHORITY_IGNORE_SLASHES: if (char != '/' && char != '\\') { state = AUTHORITY; continue; } break; case AUTHORITY: if (char == '@') { if (seenAt) buffer = '%40' + buffer; seenAt = true; bufferCodePoints = arrayFrom(buffer); for (var i = 0; i < bufferCodePoints.length; i++) { var codePoint = bufferCodePoints[i]; if (codePoint == ':' && !seenPasswordToken) { seenPasswordToken = true; continue; } var encodedCodePoints = percentEncode(codePoint, userinfoPercentEncodeSet); if (seenPasswordToken) url.password += encodedCodePoints; else url.username += encodedCodePoints; } buffer = ''; } else if ( char == EOF || char == '/' || char == '?' || char == '#' || (char == '\\' && isSpecial(url)) ) { if (seenAt && buffer == '') return INVALID_AUTHORITY; pointer -= arrayFrom(buffer).length + 1; buffer = ''; state = HOST; } else buffer += char; break; case HOST: case HOSTNAME: if (stateOverride && url.scheme == 'file') { state = FILE_HOST; continue; } else if (char == ':' && !seenBracket) { if (buffer == '') return INVALID_HOST; failure = parseHost(url, buffer); if (failure) return failure; buffer = ''; state = PORT; if (stateOverride == HOSTNAME) return; } else if ( char == EOF || char == '/' || char == '?' || char == '#' || (char == '\\' && isSpecial(url)) ) { if (isSpecial(url) && buffer == '') return INVALID_HOST; if (stateOverride && buffer == '' && (includesCredentials(url) || url.port !== null)) return; failure = parseHost(url, buffer); if (failure) return failure; buffer = ''; state = PATH_START; if (stateOverride) return; continue; } else { if (char == '[') seenBracket = true; else if (char == ']') seenBracket = false; buffer += char; } break; case PORT: if (DIGIT.test(char)) { buffer += char; } else if ( char == EOF || char == '/' || char == '?' || char == '#' || (char == '\\' && isSpecial(url)) || stateOverride ) { if (buffer != '') { var port = parseInt(buffer, 10); if (port > 0xFFFF) return INVALID_PORT; url.port = (isSpecial(url) && port === specialSchemes[url.scheme]) ? null : port; buffer = ''; } if (stateOverride) return; state = PATH_START; continue; } else return INVALID_PORT; break; case FILE: url.scheme = 'file'; if (char == '/' || char == '\\') state = FILE_SLASH; else if (base && base.scheme == 'file') { if (char == EOF) { url.host = base.host; url.path = base.path.slice(); url.query = base.query; } else if (char == '?') { url.host = base.host; url.path = base.path.slice(); url.query = ''; state = QUERY; } else if (char == '#') { url.host = base.host; url.path = base.path.slice(); url.query = base.query; url.fragment = ''; state = FRAGMENT; } else { if (!startsWithWindowsDriveLetter(codePoints.slice(pointer).join(''))) { url.host = base.host; url.path = base.path.slice(); shortenURLsPath(url); } state = PATH; continue; } } else { state = PATH; continue; } break; case FILE_SLASH: if (char == '/' || char == '\\') { state = FILE_HOST; break; } if (base && base.scheme == 'file' && !startsWithWindowsDriveLetter(codePoints.slice(pointer).join(''))) { if (isWindowsDriveLetter(base.path[0], true)) url.path.push(base.path[0]); else url.host = base.host; } state = PATH; continue; case FILE_HOST: if (char == EOF || char == '/' || char == '\\' || char == '?' || char == '#') { if (!stateOverride && isWindowsDriveLetter(buffer)) { state = PATH; } else if (buffer == '') { url.host = ''; if (stateOverride) return; state = PATH_START; } else { failure = parseHost(url, buffer); if (failure) return failure; if (url.host == 'localhost') url.host = ''; if (stateOverride) return; buffer = ''; state = PATH_START; } continue; } else buffer += char; break; case PATH_START: if (isSpecial(url)) { state = PATH; if (char != '/' && char != '\\') continue; } else if (!stateOverride && char == '?') { url.query = ''; state = QUERY; } else if (!stateOverride && char == '#') { url.fragment = ''; state = FRAGMENT; } else if (char != EOF) { state = PATH; if (char != '/') continue; } break; case PATH: if ( char == EOF || char == '/' || (char == '\\' && isSpecial(url)) || (!stateOverride && (char == '?' || char == '#')) ) { if (isDoubleDot(buffer)) { shortenURLsPath(url); if (char != '/' && !(char == '\\' && isSpecial(url))) { url.path.push(''); } } else if (isSingleDot(buffer)) { if (char != '/' && !(char == '\\' && isSpecial(url))) { url.path.push(''); } } else { if (url.scheme == 'file' && !url.path.length && isWindowsDriveLetter(buffer)) { if (url.host) url.host = ''; buffer = buffer.charAt(0) + ':'; // normalize windows drive letter } url.path.push(buffer); } buffer = ''; if (url.scheme == 'file' && (char == EOF || char == '?' || char == '#')) { while (url.path.length > 1 && url.path[0] === '') { url.path.shift(); } } if (char == '?') { url.query = ''; state = QUERY; } else if (char == '#') { url.fragment = ''; state = FRAGMENT; } } else { buffer += percentEncode(char, pathPercentEncodeSet); } break; case CANNOT_BE_A_BASE_URL_PATH: if (char == '?') { url.query = ''; state = QUERY; } else if (char == '#') { url.fragment = ''; state = FRAGMENT; } else if (char != EOF) { url.path[0] += percentEncode(char, C0ControlPercentEncodeSet); } break; case QUERY: if (!stateOverride && char == '#') { url.fragment = ''; state = FRAGMENT; } else if (char != EOF) { if (char == "'" && isSpecial(url)) url.query += '%27'; else if (char == '#') url.query += '%23'; else url.query += percentEncode(char, C0ControlPercentEncodeSet); } break; case FRAGMENT: if (char != EOF) url.fragment += percentEncode(char, fragmentPercentEncodeSet); break; } pointer++; } }; // `URL` constructor // https://url.spec.whatwg.org/#url-class var URLConstructor = function URL(url /* , base */) { var that = anInstance(this, URLConstructor, 'URL'); var base = arguments.length > 1 ? arguments[1] : undefined; var urlString = String(url); var state = setInternalState(that, { type: 'URL' }); var baseState, failure; if (base !== undefined) { if (base instanceof URLConstructor) baseState = getInternalURLState(base); else { failure = parseURL(baseState = {}, String(base)); if (failure) throw TypeError(failure); } } failure = parseURL(state, urlString, null, baseState); if (failure) throw TypeError(failure); var searchParams = state.searchParams = new URLSearchParams(); var searchParamsState = getInternalSearchParamsState(searchParams); searchParamsState.updateSearchParams(state.query); searchParamsState.updateURL = function () { state.query = String(searchParams) || null; }; if (!DESCRIPTORS) { that.href = serializeURL.call(that); that.origin = getOrigin.call(that); that.protocol = getProtocol.call(that); that.username = getUsername.call(that); that.password = getPassword.call(that); that.host = getHost.call(that); that.hostname = getHostname.call(that); that.port = getPort.call(that); that.pathname = getPathname.call(that); that.search = getSearch.call(that); that.searchParams = getSearchParams.call(that); that.hash = getHash.call(that); } }; var URLPrototype = URLConstructor.prototype; var serializeURL = function () { var url = getInternalURLState(this); var scheme = url.scheme; var username = url.username; var password = url.password; var host = url.host; var port = url.port; var path = url.path; var query = url.query; var fragment = url.fragment; var output = scheme + ':'; if (host !== null) { output += '//'; if (includesCredentials(url)) { output += username + (password ? ':' + password : '') + '@'; } output += serializeHost(host); if (port !== null) output += ':' + port; } else if (scheme == 'file') output += '//'; output += url.cannotBeABaseURL ? path[0] : path.length ? '/' + path.join('/') : ''; if (query !== null) output += '?' + query; if (fragment !== null) output += '#' + fragment; return output; }; var getOrigin = function () { var url = getInternalURLState(this); var scheme = url.scheme; var port = url.port; if (scheme == 'blob') try { return new URL(scheme.path[0]).origin; } catch (error) { return 'null'; } if (scheme == 'file' || !isSpecial(url)) return 'null'; return scheme + '://' + serializeHost(url.host) + (port !== null ? ':' + port : ''); }; var getProtocol = function () { return getInternalURLState(this).scheme + ':'; }; var getUsername = function () { return getInternalURLState(this).username; }; var getPassword = function () { return getInternalURLState(this).password; }; var getHost = function () { var url = getInternalURLState(this); var host = url.host; var port = url.port; return host === null ? '' : port === null ? serializeHost(host) : serializeHost(host) + ':' + port; }; var getHostname = function () { var host = getInternalURLState(this).host; return host === null ? '' : serializeHost(host); }; var getPort = function () { var port = getInternalURLState(this).port; return port === null ? '' : String(port); }; var getPathname = function () { var url = getInternalURLState(this); var path = url.path; return url.cannotBeABaseURL ? path[0] : path.length ? '/' + path.join('/') : ''; }; var getSearch = function () { var query = getInternalURLState(this).query; return query ? '?' + query : ''; }; var getSearchParams = function () { return getInternalURLState(this).searchParams; }; var getHash = function () { var fragment = getInternalURLState(this).fragment; return fragment ? '#' + fragment : ''; }; var accessorDescriptor = function (getter, setter) { return { get: getter, set: setter, configurable: true, enumerable: true }; }; if (DESCRIPTORS) { defineProperties(URLPrototype, { // `URL.prototype.href` accessors pair // https://url.spec.whatwg.org/#dom-url-href href: accessorDescriptor(serializeURL, function (href) { var url = getInternalURLState(this); var urlString = String(href); var failure = parseURL(url, urlString); if (failure) throw TypeError(failure); getInternalSearchParamsState(url.searchParams).updateSearchParams(url.query); }), // `URL.prototype.origin` getter // https://url.spec.whatwg.org/#dom-url-origin origin: accessorDescriptor(getOrigin), // `URL.prototype.protocol` accessors pair // https://url.spec.whatwg.org/#dom-url-protocol protocol: accessorDescriptor(getProtocol, function (protocol) { var url = getInternalURLState(this); parseURL(url, String(protocol) + ':', SCHEME_START); }), // `URL.prototype.username` accessors pair // https://url.spec.whatwg.org/#dom-url-username username: accessorDescriptor(getUsername, function (username) { var url = getInternalURLState(this); var codePoints = arrayFrom(String(username)); if (cannotHaveUsernamePasswordPort(url)) return; url.username = ''; for (var i = 0; i < codePoints.length; i++) { url.username += percentEncode(codePoints[i], userinfoPercentEncodeSet); } }), // `URL.prototype.password` accessors pair // https://url.spec.whatwg.org/#dom-url-password password: accessorDescriptor(getPassword, function (password) { var url = getInternalURLState(this); var codePoints = arrayFrom(String(password)); if (cannotHaveUsernamePasswordPort(url)) return; url.password = ''; for (var i = 0; i < codePoints.length; i++) { url.password += percentEncode(codePoints[i], userinfoPercentEncodeSet); } }), // `URL.prototype.host` accessors pair // https://url.spec.whatwg.org/#dom-url-host host: accessorDescriptor(getHost, function (host) { var url = getInternalURLState(this); if (url.cannotBeABaseURL) return; parseURL(url, String(host), HOST); }), // `URL.prototype.hostname` accessors pair // https://url.spec.whatwg.org/#dom-url-hostname hostname: accessorDescriptor(getHostname, function (hostname) { var url = getInternalURLState(this); if (url.cannotBeABaseURL) return; parseURL(url, String(hostname), HOSTNAME); }), // `URL.prototype.port` accessors pair // https://url.spec.whatwg.org/#dom-url-port port: accessorDescriptor(getPort, function (port) { var url = getInternalURLState(this); if (cannotHaveUsernamePasswordPort(url)) return; port = String(port); if (port == '') url.port = null; else parseURL(url, port, PORT); }), // `URL.prototype.pathname` accessors pair // https://url.spec.whatwg.org/#dom-url-pathname pathname: accessorDescriptor(getPathname, function (pathname) { var url = getInternalURLState(this); if (url.cannotBeABaseURL) return; url.path = []; parseURL(url, pathname + '', PATH_START); }), // `URL.prototype.search` accessors pair // https://url.spec.whatwg.org/#dom-url-search search: accessorDescriptor(getSearch, function (search) { var url = getInternalURLState(this); search = String(search); if (search == '') { url.query = null; } else { if ('?' == search.charAt(0)) search = search.slice(1); url.query = ''; parseURL(url, search, QUERY); } getInternalSearchParamsState(url.searchParams).updateSearchParams(url.query); }), // `URL.prototype.searchParams` getter // https://url.spec.whatwg.org/#dom-url-searchparams searchParams: accessorDescriptor(getSearchParams), // `URL.prototype.hash` accessors pair // https://url.spec.whatwg.org/#dom-url-hash hash: accessorDescriptor(getHash, function (hash) { var url = getInternalURLState(this); hash = String(hash); if (hash == '') { url.fragment = null; return; } if ('#' == hash.charAt(0)) hash = hash.slice(1); url.fragment = ''; parseURL(url, hash, FRAGMENT); }) }); } // `URL.prototype.toJSON` method // https://url.spec.whatwg.org/#dom-url-tojson redefine(URLPrototype, 'toJSON', function toJSON() { return serializeURL.call(this); }, { enumerable: true }); // `URL.prototype.toString` method // https://url.spec.whatwg.org/#URL-stringification-behavior redefine(URLPrototype, 'toString', function toString() { return serializeURL.call(this); }, { enumerable: true }); if (NativeURL) { var nativeCreateObjectURL = NativeURL.createObjectURL; var nativeRevokeObjectURL = NativeURL.revokeObjectURL; // `URL.createObjectURL` method // https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL // eslint-disable-next-line no-unused-vars if (nativeCreateObjectURL) redefine(URLConstructor, 'createObjectURL', function createObjectURL(blob) { return nativeCreateObjectURL.apply(NativeURL, arguments); }); // `URL.revokeObjectURL` method // https://developer.mozilla.org/en-US/docs/Web/API/URL/revokeObjectURL // eslint-disable-next-line no-unused-vars if (nativeRevokeObjectURL) redefine(URLConstructor, 'revokeObjectURL', function revokeObjectURL(url) { return nativeRevokeObjectURL.apply(NativeURL, arguments); }); } setToStringTag(URLConstructor, 'URL'); $({ global: true, forced: !USE_NATIVE_URL, sham: !DESCRIPTORS }, { URL: URLConstructor }); },{"../internals/an-instance":4,"../internals/array-from":6,"../internals/descriptors":18,"../internals/export":21,"../internals/global":27,"../internals/has":28,"../internals/internal-state":34,"../internals/native-url":42,"../internals/object-assign":44,"../internals/object-define-properties":46,"../internals/redefine":59,"../internals/set-to-string-tag":62,"../internals/string-multibyte":66,"../internals/string-punycode-to-ascii":67,"../modules/es.string.iterator":79,"../modules/web.url-search-params":80}],82:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); // `URL.prototype.toJSON` method // https://url.spec.whatwg.org/#dom-url-tojson $({ target: 'URL', proto: true, enumerable: true }, { toJSON: function toJSON() { return URL.prototype.toString.call(this); } }); },{"../internals/export":21}],83:[function(require,module,exports){ require('../modules/web.url'); require('../modules/web.url.to-json'); require('../modules/web.url-search-params'); var path = require('../internals/path'); module.exports = path.URL; },{"../internals/path":57,"../modules/web.url":81,"../modules/web.url-search-params":80,"../modules/web.url.to-json":82}]},{},[83]); vendor/wp-polyfill-fetch.min.js 0000644 00000023435 15206720414 0012536 0 ustar 00 !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.WHATWGFetch={})}(this,function(h){"use strict";var e,r,u="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||"undefined"!=typeof global&&global||{},o="URLSearchParams"in u,n="Symbol"in u&&"iterator"in Symbol,f="FileReader"in u&&"Blob"in u&&function(){try{return new Blob,!0}catch(t){return!1}}(),s="FormData"in u,d="ArrayBuffer"in u;function c(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(t)||""===t)throw new TypeError('Invalid character in header field name: "'+t+'"');return t.toLowerCase()}function y(t){return t="string"!=typeof t?String(t):t}function t(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return n&&(t[Symbol.iterator]=function(){return t}),t}function l(e){this.map={},e instanceof l?e.forEach(function(t,e){this.append(e,t)},this):Array.isArray(e)?e.forEach(function(t){if(2!=t.length)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+t.length);this.append(t[0],t[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function i(t){if(!t._noBody)return t.bodyUsed?Promise.reject(new TypeError("Already read")):void(t.bodyUsed=!0)}function a(r){return new Promise(function(t,e){r.onload=function(){t(r.result)},r.onerror=function(){e(r.error)}})}function p(t){var e=new FileReader,r=a(e);return e.readAsArrayBuffer(t),r}function b(t){var e;return t.slice?t.slice(0):((e=new Uint8Array(t.byteLength)).set(new Uint8Array(t)),e.buffer)}function m(){return this.bodyUsed=!1,this._initBody=function(t){var e;this.bodyUsed=this.bodyUsed,(this._bodyInit=t)?"string"==typeof t?this._bodyText=t:f&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:s&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:o&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():d&&f&&(e=t)&&DataView.prototype.isPrototypeOf(e)?(this._bodyArrayBuffer=b(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):d&&(ArrayBuffer.prototype.isPrototypeOf(t)||r(t))?this._bodyArrayBuffer=b(t):this._bodyText=t=Object.prototype.toString.call(t):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):o&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},f&&(this.blob=function(){var t=i(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer)return i(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer));if(f)return this.blob().then(p);throw new Error("could not read as ArrayBuffer")},this.text=function(){var t,e,r,o=i(this);if(o)return o;if(this._bodyBlob)return o=this._bodyBlob,t=new FileReader,e=a(t),r=(r=/charset=([A-Za-z0-9_-]+)/.exec(o.type))?r[1]:"utf-8",t.readAsText(o,r),e;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),o=0;o<e.length;o++)r[o]=String.fromCharCode(e[o]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},s&&(this.formData=function(){return this.text().then(A)}),this.json=function(){return this.text().then(JSON.parse)},this}d&&(e=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],r=ArrayBuffer.isView||function(t){return t&&-1<e.indexOf(Object.prototype.toString.call(t))}),l.prototype.append=function(t,e){t=c(t),e=y(e);var r=this.map[t];this.map[t]=r?r+", "+e:e},l.prototype.delete=function(t){delete this.map[c(t)]},l.prototype.get=function(t){return t=c(t),this.has(t)?this.map[t]:null},l.prototype.has=function(t){return this.map.hasOwnProperty(c(t))},l.prototype.set=function(t,e){this.map[c(t)]=y(e)},l.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},l.prototype.keys=function(){var r=[];return this.forEach(function(t,e){r.push(e)}),t(r)},l.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),t(e)},l.prototype.entries=function(){var r=[];return this.forEach(function(t,e){r.push([e,t])}),t(r)},n&&(l.prototype[Symbol.iterator]=l.prototype.entries);var w=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function E(t,e){if(!(this instanceof E))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var r,o=(e=e||{}).body;if(t instanceof E){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new l(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,o||null==t._bodyInit||(o=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new l(e.headers)),this.method=(t=e.method||this.method||"GET",r=t.toUpperCase(),-1<w.indexOf(r)?r:t),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal||function(){if("AbortController"in u)return(new AbortController).signal}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(o),"GET"!==this.method&&"HEAD"!==this.method||"no-store"!==e.cache&&"no-cache"!==e.cache||((r=/([?&])_=[^&]*/).test(this.url)?this.url=this.url.replace(r,"$1_="+(new Date).getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime())}function A(t){var r=new FormData;return t.trim().split("&").forEach(function(t){var e;t&&(e=(t=t.split("=")).shift().replace(/\+/g," "),t=t.join("=").replace(/\+/g," "),r.append(decodeURIComponent(e),decodeURIComponent(t)))}),r}function g(t,e){if(!(this instanceof g))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(e=e||{},this.type="default",this.status=void 0===e.status?200:e.status,this.status<200||599<this.status)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=200<=this.status&&this.status<300,this.statusText=void 0===e.statusText?"":""+e.statusText,this.headers=new l(e.headers),this.url=e.url||"",this._initBody(t)}E.prototype.clone=function(){return new E(this,{body:this._bodyInit})},m.call(E.prototype),m.call(g.prototype),g.prototype.clone=function(){return new g(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new l(this.headers),url:this.url})},g.error=function(){var t=new g(null,{status:200,statusText:""});return t.ok=!1,t.status=0,t.type="error",t};var T=[301,302,303,307,308];g.redirect=function(t,e){if(-1===T.indexOf(e))throw new RangeError("Invalid status code");return new g(null,{status:e,headers:{location:t}})},h.DOMException=u.DOMException;try{new h.DOMException}catch(t){h.DOMException=function(t,e){this.message=t,this.name=e;e=Error(t);this.stack=e.stack},h.DOMException.prototype=Object.create(Error.prototype),h.DOMException.prototype.constructor=h.DOMException}function _(o,a){return new Promise(function(n,t){var s=new E(o,a);if(s.signal&&s.signal.aborted)return t(new h.DOMException("Aborted","AbortError"));var r,i=new XMLHttpRequest;function e(){i.abort()}i.onload=function(){var t,r,e={statusText:i.statusText,headers:(t=i.getAllResponseHeaders()||"",r=new l,t.replace(/\r?\n[\t ]+/g," ").split("\r").map(function(t){return 0===t.indexOf("\n")?t.substr(1,t.length):t}).forEach(function(t){var t=t.split(":"),e=t.shift().trim();if(e){t=t.join(":").trim();try{r.append(e,t)}catch(t){console.warn("Response "+t.message)}}}),r)},o=(0===s.url.indexOf("file://")&&(i.status<200||599<i.status)?e.status=200:e.status=i.status,e.url="responseURL"in i?i.responseURL:e.headers.get("X-Request-URL"),"response"in i?i.response:i.responseText);setTimeout(function(){n(new g(o,e))},0)},i.onerror=function(){setTimeout(function(){t(new TypeError("Network request failed"))},0)},i.ontimeout=function(){setTimeout(function(){t(new TypeError("Network request timed out"))},0)},i.onabort=function(){setTimeout(function(){t(new h.DOMException("Aborted","AbortError"))},0)},i.open(s.method,function(e){try{return""===e&&u.location.href?u.location.href:e}catch(t){return e}}(s.url),!0),"include"===s.credentials?i.withCredentials=!0:"omit"===s.credentials&&(i.withCredentials=!1),"responseType"in i&&(f?i.responseType="blob":d&&(i.responseType="arraybuffer")),a&&"object"==typeof a.headers&&!(a.headers instanceof l||u.Headers&&a.headers instanceof u.Headers)?(r=[],Object.getOwnPropertyNames(a.headers).forEach(function(t){r.push(c(t)),i.setRequestHeader(t,y(a.headers[t]))}),s.headers.forEach(function(t,e){-1===r.indexOf(e)&&i.setRequestHeader(e,t)})):s.headers.forEach(function(t,e){i.setRequestHeader(e,t)}),s.signal&&(s.signal.addEventListener("abort",e),i.onreadystatechange=function(){4===i.readyState&&s.signal.removeEventListener("abort",e)}),i.send(void 0===s._bodyInit?null:s._bodyInit)})}_.polyfill=!0,u.fetch||(u.fetch=_,u.Headers=l,u.Request=E,u.Response=g),h.Headers=l,h.Request=E,h.Response=g,h.fetch=_,Object.defineProperty(h,"__esModule",{value:!0})}); vendor/react-dom.js 0000644 00004075643 15206720414 0010276 0 ustar 00 /** * @license React * react-dom.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) : typeof define === 'function' && define.amd ? define(['exports', 'react'], factory) : (global = global || self, factory(global.ReactDOM = {}, global.React)); }(this, (function (exports, React) { 'use strict'; var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; var suppressWarning = false; function setSuppressWarning(newSuppressWarning) { { suppressWarning = newSuppressWarning; } } // In DEV, calls to console.warn and console.error get replaced // by calls to these methods by a Babel plugin. // // In PROD (or in packages without access to React internals), // they are left as they are instead. function warn(format) { { if (!suppressWarning) { for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } printWarning('warn', format, args); } } } function error(format) { { if (!suppressWarning) { for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { args[_key2 - 1] = arguments[_key2]; } printWarning('error', format, args); } } } function printWarning(level, format, args) { // When changing this logic, you might want to also // update consoleWithStackDev.www.js as well. { var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; var stack = ReactDebugCurrentFrame.getStackAddendum(); if (stack !== '') { format += '%s'; args = args.concat([stack]); } // eslint-disable-next-line react-internal/safe-string-coercion var argsWithFormat = args.map(function (item) { return String(item); }); // Careful: RN currently depends on this prefix argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it // breaks IE9: https://github.com/facebook/react/issues/13610 // eslint-disable-next-line react-internal/no-production-logging Function.prototype.apply.call(console[level], console, argsWithFormat); } } var FunctionComponent = 0; var ClassComponent = 1; var IndeterminateComponent = 2; // Before we know whether it is function or class var HostRoot = 3; // Root of a host tree. Could be nested inside another node. var HostPortal = 4; // A subtree. Could be an entry point to a different renderer. var HostComponent = 5; var HostText = 6; var Fragment = 7; var Mode = 8; var ContextConsumer = 9; var ContextProvider = 10; var ForwardRef = 11; var Profiler = 12; var SuspenseComponent = 13; var MemoComponent = 14; var SimpleMemoComponent = 15; var LazyComponent = 16; var IncompleteClassComponent = 17; var DehydratedFragment = 18; var SuspenseListComponent = 19; var ScopeComponent = 21; var OffscreenComponent = 22; var LegacyHiddenComponent = 23; var CacheComponent = 24; var TracingMarkerComponent = 25; // ----------------------------------------------------------------------------- var enableClientRenderFallbackOnTextMismatch = true; // TODO: Need to review this code one more time before landing // the react-reconciler package. var enableNewReconciler = false; // Support legacy Primer support on internal FB www var enableLazyContextPropagation = false; // FB-only usage. The new API has different semantics. var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber var enableSuspenseAvoidThisFallback = false; // Enables unstable_avoidThisFallback feature in Fizz // React DOM Chopping Block // // Similar to main Chopping Block but only flags related to React DOM. These are // grouped because we will likely batch all of them into a single major release. // ----------------------------------------------------------------------------- // Disable support for comment nodes as React DOM containers. Already disabled // in open source, but www codebase still relies on it. Need to remove. var disableCommentsAsDOMContainers = true; // Disable javascript: URL strings in href for XSS protection. // and client rendering, mostly to allow JSX attributes to apply to the custom // element's object properties instead of only HTML attributes. // https://github.com/facebook/react/issues/11347 var enableCustomElementPropertySupport = false; // Disables children for <textarea> elements var warnAboutStringRefs = true; // ----------------------------------------------------------------------------- // Debugging and DevTools // ----------------------------------------------------------------------------- // Adds user timing marks for e.g. state updates, suspense, and work loop stuff, // for an experimental timeline tool. var enableSchedulingProfiler = true; // Helps identify side effects in render-phase lifecycle hooks and setState var enableProfilerTimer = true; // Record durations for commit and passive effects phases. var enableProfilerCommitHooks = true; // Phase param passed to onRender callback differentiates between an "update" and a "cascading-update". var allNativeEvents = new Set(); /** * Mapping from registration name to event name */ var registrationNameDependencies = {}; /** * Mapping from lowercase registration names to the properly cased version, * used to warn in the case of missing event handlers. Available * only in true. * @type {Object} */ var possibleRegistrationNames = {} ; // Trust the developer to only use possibleRegistrationNames in true function registerTwoPhaseEvent(registrationName, dependencies) { registerDirectEvent(registrationName, dependencies); registerDirectEvent(registrationName + 'Capture', dependencies); } function registerDirectEvent(registrationName, dependencies) { { if (registrationNameDependencies[registrationName]) { error('EventRegistry: More than one plugin attempted to publish the same ' + 'registration name, `%s`.', registrationName); } } registrationNameDependencies[registrationName] = dependencies; { var lowerCasedName = registrationName.toLowerCase(); possibleRegistrationNames[lowerCasedName] = registrationName; if (registrationName === 'onDoubleClick') { possibleRegistrationNames.ondblclick = registrationName; } } for (var i = 0; i < dependencies.length; i++) { allNativeEvents.add(dependencies[i]); } } var canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined'); var hasOwnProperty = Object.prototype.hasOwnProperty; /* * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol * and Temporal.* types. See https://github.com/facebook/react/pull/22064. * * The functions in this module will throw an easier-to-understand, * easier-to-debug exception with a clear errors message message explaining the * problem. (Instead of a confusing exception thrown inside the implementation * of the `value` object). */ // $FlowFixMe only called in DEV, so void return is not possible. function typeName(value) { { // toStringTag is needed for namespaced types like Temporal.Instant var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag; var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object'; return type; } } // $FlowFixMe only called in DEV, so void return is not possible. function willCoercionThrow(value) { { try { testStringCoercion(value); return false; } catch (e) { return true; } } } function testStringCoercion(value) { // If you ended up here by following an exception call stack, here's what's // happened: you supplied an object or symbol value to React (as a prop, key, // DOM attribute, CSS property, string ref, etc.) and when React tried to // coerce it to a string using `'' + value`, an exception was thrown. // // The most common types that will cause this exception are `Symbol` instances // and Temporal objects like `Temporal.Instant`. But any object that has a // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this // exception. (Library authors do this to prevent users from using built-in // numeric operators like `+` or comparison operators like `>=` because custom // methods are needed to perform accurate arithmetic or comparison.) // // To fix the problem, coerce this object or symbol value to a string before // passing it to React. The most reliable way is usually `String(value)`. // // To find which value is throwing, check the browser or debugger console. // Before this exception was thrown, there should be `console.error` output // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the // problem and how that type was used: key, atrribute, input value prop, etc. // In most cases, this console output also shows the component and its // ancestor components where the exception happened. // // eslint-disable-next-line react-internal/safe-string-coercion return '' + value; } function checkAttributeStringCoercion(value, attributeName) { { if (willCoercionThrow(value)) { error('The provided `%s` attribute is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', attributeName, typeName(value)); return testStringCoercion(value); // throw (to help callers find troubleshooting comments) } } } function checkKeyStringCoercion(value) { { if (willCoercionThrow(value)) { error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value)); return testStringCoercion(value); // throw (to help callers find troubleshooting comments) } } } function checkPropStringCoercion(value, propName) { { if (willCoercionThrow(value)) { error('The provided `%s` prop is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', propName, typeName(value)); return testStringCoercion(value); // throw (to help callers find troubleshooting comments) } } } function checkCSSPropertyStringCoercion(value, propName) { { if (willCoercionThrow(value)) { error('The provided `%s` CSS property is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', propName, typeName(value)); return testStringCoercion(value); // throw (to help callers find troubleshooting comments) } } } function checkHtmlStringCoercion(value) { { if (willCoercionThrow(value)) { error('The provided HTML markup uses a value of unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value)); return testStringCoercion(value); // throw (to help callers find troubleshooting comments) } } } function checkFormFieldValueStringCoercion(value) { { if (willCoercionThrow(value)) { error('Form field values (value, checked, defaultValue, or defaultChecked props)' + ' must be strings, not %s.' + ' This value must be coerced to a string before before using it here.', typeName(value)); return testStringCoercion(value); // throw (to help callers find troubleshooting comments) } } } // A reserved attribute. // It is handled by React separately and shouldn't be written to the DOM. var RESERVED = 0; // A simple string attribute. // Attributes that aren't in the filter are presumed to have this type. var STRING = 1; // A string attribute that accepts booleans in React. In HTML, these are called // "enumerated" attributes with "true" and "false" as possible values. // When true, it should be set to a "true" string. // When false, it should be set to a "false" string. var BOOLEANISH_STRING = 2; // A real boolean attribute. // When true, it should be present (set either to an empty string or its name). // When false, it should be omitted. var BOOLEAN = 3; // An attribute that can be used as a flag as well as with a value. // When true, it should be present (set either to an empty string or its name). // When false, it should be omitted. // For any other value, should be present with that value. var OVERLOADED_BOOLEAN = 4; // An attribute that must be numeric or parse as a numeric. // When falsy, it should be removed. var NUMERIC = 5; // An attribute that must be positive numeric or parse as a positive numeric. // When falsy, it should be removed. var POSITIVE_NUMERIC = 6; /* eslint-disable max-len */ var ATTRIBUTE_NAME_START_CHAR = ":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD"; /* eslint-enable max-len */ var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040"; var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$'); var illegalAttributeNameCache = {}; var validatedAttributeNameCache = {}; function isAttributeNameSafe(attributeName) { if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) { return true; } if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) { return false; } if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) { validatedAttributeNameCache[attributeName] = true; return true; } illegalAttributeNameCache[attributeName] = true; { error('Invalid attribute name: `%s`', attributeName); } return false; } function shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) { if (propertyInfo !== null) { return propertyInfo.type === RESERVED; } if (isCustomComponentTag) { return false; } if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) { return true; } return false; } function shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag) { if (propertyInfo !== null && propertyInfo.type === RESERVED) { return false; } switch (typeof value) { case 'function': // $FlowIssue symbol is perfectly valid here case 'symbol': // eslint-disable-line return true; case 'boolean': { if (isCustomComponentTag) { return false; } if (propertyInfo !== null) { return !propertyInfo.acceptsBooleans; } else { var prefix = name.toLowerCase().slice(0, 5); return prefix !== 'data-' && prefix !== 'aria-'; } } default: return false; } } function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) { if (value === null || typeof value === 'undefined') { return true; } if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) { return true; } if (isCustomComponentTag) { return false; } if (propertyInfo !== null) { switch (propertyInfo.type) { case BOOLEAN: return !value; case OVERLOADED_BOOLEAN: return value === false; case NUMERIC: return isNaN(value); case POSITIVE_NUMERIC: return isNaN(value) || value < 1; } } return false; } function getPropertyInfo(name) { return properties.hasOwnProperty(name) ? properties[name] : null; } function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL, removeEmptyString) { this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN; this.attributeName = attributeName; this.attributeNamespace = attributeNamespace; this.mustUseProperty = mustUseProperty; this.propertyName = name; this.type = type; this.sanitizeURL = sanitizeURL; this.removeEmptyString = removeEmptyString; } // When adding attributes to this list, be sure to also add them to // the `possibleStandardNames` module to ensure casing and incorrect // name warnings. var properties = {}; // These props are reserved by React. They shouldn't be written to the DOM. var reservedProps = ['children', 'dangerouslySetInnerHTML', // TODO: This prevents the assignment of defaultValue to regular // elements (not just inputs). Now that ReactDOMInput assigns to the // defaultValue property -- do we need this? 'defaultValue', 'defaultChecked', 'innerHTML', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'style']; reservedProps.forEach(function (name) { properties[name] = new PropertyInfoRecord(name, RESERVED, false, // mustUseProperty name, // attributeName null, // attributeNamespace false, // sanitizeURL false); }); // A few React string attributes have a different name. // This is a mapping from React prop names to the attribute names. [['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor', 'for'], ['httpEquiv', 'http-equiv']].forEach(function (_ref) { var name = _ref[0], attributeName = _ref[1]; properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty attributeName, // attributeName null, // attributeNamespace false, // sanitizeURL false); }); // These are "enumerated" HTML attributes that accept "true" and "false". // In React, we let users pass `true` and `false` even though technically // these aren't boolean attributes (they are coerced to strings). ['contentEditable', 'draggable', 'spellCheck', 'value'].forEach(function (name) { properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty name.toLowerCase(), // attributeName null, // attributeNamespace false, // sanitizeURL false); }); // These are "enumerated" SVG attributes that accept "true" and "false". // In React, we let users pass `true` and `false` even though technically // these aren't boolean attributes (they are coerced to strings). // Since these are SVG attributes, their attribute names are case-sensitive. ['autoReverse', 'externalResourcesRequired', 'focusable', 'preserveAlpha'].forEach(function (name) { properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty name, // attributeName null, // attributeNamespace false, // sanitizeURL false); }); // These are HTML boolean attributes. ['allowFullScreen', 'async', // Note: there is a special case that prevents it from being written to the DOM // on the client side because the browsers are inconsistent. Instead we call focus(). 'autoFocus', 'autoPlay', 'controls', 'default', 'defer', 'disabled', 'disablePictureInPicture', 'disableRemotePlayback', 'formNoValidate', 'hidden', 'loop', 'noModule', 'noValidate', 'open', 'playsInline', 'readOnly', 'required', 'reversed', 'scoped', 'seamless', // Microdata 'itemScope'].forEach(function (name) { properties[name] = new PropertyInfoRecord(name, BOOLEAN, false, // mustUseProperty name.toLowerCase(), // attributeName null, // attributeNamespace false, // sanitizeURL false); }); // These are the few React props that we set as DOM properties // rather than attributes. These are all booleans. ['checked', // Note: `option.selected` is not updated if `select.multiple` is // disabled with `removeAttribute`. We have special logic for handling this. 'multiple', 'muted', 'selected' // NOTE: if you add a camelCased prop to this list, // you'll need to set attributeName to name.toLowerCase() // instead in the assignment below. ].forEach(function (name) { properties[name] = new PropertyInfoRecord(name, BOOLEAN, true, // mustUseProperty name, // attributeName null, // attributeNamespace false, // sanitizeURL false); }); // These are HTML attributes that are "overloaded booleans": they behave like // booleans, but can also accept a string value. ['capture', 'download' // NOTE: if you add a camelCased prop to this list, // you'll need to set attributeName to name.toLowerCase() // instead in the assignment below. ].forEach(function (name) { properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false, // mustUseProperty name, // attributeName null, // attributeNamespace false, // sanitizeURL false); }); // These are HTML attributes that must be positive numbers. ['cols', 'rows', 'size', 'span' // NOTE: if you add a camelCased prop to this list, // you'll need to set attributeName to name.toLowerCase() // instead in the assignment below. ].forEach(function (name) { properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false, // mustUseProperty name, // attributeName null, // attributeNamespace false, // sanitizeURL false); }); // These are HTML attributes that must be numbers. ['rowSpan', 'start'].forEach(function (name) { properties[name] = new PropertyInfoRecord(name, NUMERIC, false, // mustUseProperty name.toLowerCase(), // attributeName null, // attributeNamespace false, // sanitizeURL false); }); var CAMELIZE = /[\-\:]([a-z])/g; var capitalize = function (token) { return token[1].toUpperCase(); }; // This is a list of all SVG attributes that need special casing, namespacing, // or boolean value assignment. Regular attributes that just accept strings // and have the same names are omitted, just like in the HTML attribute filter. // Some of these attributes can be hard to find. This list was created by // scraping the MDN documentation. ['accent-height', 'alignment-baseline', 'arabic-form', 'baseline-shift', 'cap-height', 'clip-path', 'clip-rule', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'dominant-baseline', 'enable-background', 'fill-opacity', 'fill-rule', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-name', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'horiz-adv-x', 'horiz-origin-x', 'image-rendering', 'letter-spacing', 'lighting-color', 'marker-end', 'marker-mid', 'marker-start', 'overline-position', 'overline-thickness', 'paint-order', 'panose-1', 'pointer-events', 'rendering-intent', 'shape-rendering', 'stop-color', 'stop-opacity', 'strikethrough-position', 'strikethrough-thickness', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-decoration', 'text-rendering', 'underline-position', 'underline-thickness', 'unicode-bidi', 'unicode-range', 'units-per-em', 'v-alphabetic', 'v-hanging', 'v-ideographic', 'v-mathematical', 'vector-effect', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'word-spacing', 'writing-mode', 'xmlns:xlink', 'x-height' // NOTE: if you add a camelCased prop to this list, // you'll need to set attributeName to name.toLowerCase() // instead in the assignment below. ].forEach(function (attributeName) { var name = attributeName.replace(CAMELIZE, capitalize); properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty attributeName, null, // attributeNamespace false, // sanitizeURL false); }); // String SVG attributes with the xlink namespace. ['xlink:actuate', 'xlink:arcrole', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type' // NOTE: if you add a camelCased prop to this list, // you'll need to set attributeName to name.toLowerCase() // instead in the assignment below. ].forEach(function (attributeName) { var name = attributeName.replace(CAMELIZE, capitalize); properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty attributeName, 'http://www.w3.org/1999/xlink', false, // sanitizeURL false); }); // String SVG attributes with the xml namespace. ['xml:base', 'xml:lang', 'xml:space' // NOTE: if you add a camelCased prop to this list, // you'll need to set attributeName to name.toLowerCase() // instead in the assignment below. ].forEach(function (attributeName) { var name = attributeName.replace(CAMELIZE, capitalize); properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty attributeName, 'http://www.w3.org/XML/1998/namespace', false, // sanitizeURL false); }); // These attribute exists both in HTML and SVG. // The attribute name is case-sensitive in SVG so we can't just use // the React name like we do for attributes that exist only in HTML. ['tabIndex', 'crossOrigin'].forEach(function (attributeName) { properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty attributeName.toLowerCase(), // attributeName null, // attributeNamespace false, // sanitizeURL false); }); // These attributes accept URLs. These must not allow javascript: URLS. // These will also need to accept Trusted Types object in the future. var xlinkHref = 'xlinkHref'; properties[xlinkHref] = new PropertyInfoRecord('xlinkHref', STRING, false, // mustUseProperty 'xlink:href', 'http://www.w3.org/1999/xlink', true, // sanitizeURL false); ['src', 'href', 'action', 'formAction'].forEach(function (attributeName) { properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty attributeName.toLowerCase(), // attributeName null, // attributeNamespace true, // sanitizeURL true); }); // and any newline or tab are filtered out as if they're not part of the URL. // https://url.spec.whatwg.org/#url-parsing // Tab or newline are defined as \r\n\t: // https://infra.spec.whatwg.org/#ascii-tab-or-newline // A C0 control is a code point in the range \u0000 NULL to \u001F // INFORMATION SEPARATOR ONE, inclusive: // https://infra.spec.whatwg.org/#c0-control-or-space /* eslint-disable max-len */ var isJavaScriptProtocol = /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i; var didWarn = false; function sanitizeURL(url) { { if (!didWarn && isJavaScriptProtocol.test(url)) { didWarn = true; error('A future version of React will block javascript: URLs as a security precaution. ' + 'Use event handlers instead if you can. If you need to generate unsafe HTML try ' + 'using dangerouslySetInnerHTML instead. React was passed %s.', JSON.stringify(url)); } } } /** * Get the value for a property on a node. Only used in DEV for SSR validation. * The "expected" argument is used as a hint of what the expected value is. * Some properties have multiple equivalent values. */ function getValueForProperty(node, name, expected, propertyInfo) { { if (propertyInfo.mustUseProperty) { var propertyName = propertyInfo.propertyName; return node[propertyName]; } else { // This check protects multiple uses of `expected`, which is why the // react-internal/safe-string-coercion rule is disabled in several spots // below. { checkAttributeStringCoercion(expected, name); } if ( propertyInfo.sanitizeURL) { // If we haven't fully disabled javascript: URLs, and if // the hydration is successful of a javascript: URL, we // still want to warn on the client. // eslint-disable-next-line react-internal/safe-string-coercion sanitizeURL('' + expected); } var attributeName = propertyInfo.attributeName; var stringValue = null; if (propertyInfo.type === OVERLOADED_BOOLEAN) { if (node.hasAttribute(attributeName)) { var value = node.getAttribute(attributeName); if (value === '') { return true; } if (shouldRemoveAttribute(name, expected, propertyInfo, false)) { return value; } // eslint-disable-next-line react-internal/safe-string-coercion if (value === '' + expected) { return expected; } return value; } } else if (node.hasAttribute(attributeName)) { if (shouldRemoveAttribute(name, expected, propertyInfo, false)) { // We had an attribute but shouldn't have had one, so read it // for the error message. return node.getAttribute(attributeName); } if (propertyInfo.type === BOOLEAN) { // If this was a boolean, it doesn't matter what the value is // the fact that we have it is the same as the expected. return expected; } // Even if this property uses a namespace we use getAttribute // because we assume its namespaced name is the same as our config. // To use getAttributeNS we need the local name which we don't have // in our config atm. stringValue = node.getAttribute(attributeName); } if (shouldRemoveAttribute(name, expected, propertyInfo, false)) { return stringValue === null ? expected : stringValue; // eslint-disable-next-line react-internal/safe-string-coercion } else if (stringValue === '' + expected) { return expected; } else { return stringValue; } } } } /** * Get the value for a attribute on a node. Only used in DEV for SSR validation. * The third argument is used as a hint of what the expected value is. Some * attributes have multiple equivalent values. */ function getValueForAttribute(node, name, expected, isCustomComponentTag) { { if (!isAttributeNameSafe(name)) { return; } if (!node.hasAttribute(name)) { return expected === undefined ? undefined : null; } var value = node.getAttribute(name); { checkAttributeStringCoercion(expected, name); } if (value === '' + expected) { return expected; } return value; } } /** * Sets the value for a property on a node. * * @param {DOMElement} node * @param {string} name * @param {*} value */ function setValueForProperty(node, name, value, isCustomComponentTag) { var propertyInfo = getPropertyInfo(name); if (shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag)) { return; } if (shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag)) { value = null; } if (isCustomComponentTag || propertyInfo === null) { if (isAttributeNameSafe(name)) { var _attributeName = name; if (value === null) { node.removeAttribute(_attributeName); } else { { checkAttributeStringCoercion(value, name); } node.setAttribute(_attributeName, '' + value); } } return; } var mustUseProperty = propertyInfo.mustUseProperty; if (mustUseProperty) { var propertyName = propertyInfo.propertyName; if (value === null) { var type = propertyInfo.type; node[propertyName] = type === BOOLEAN ? false : ''; } else { // Contrary to `setAttribute`, object properties are properly // `toString`ed by IE8/9. node[propertyName] = value; } return; } // The rest are treated as attributes with special cases. var attributeName = propertyInfo.attributeName, attributeNamespace = propertyInfo.attributeNamespace; if (value === null) { node.removeAttribute(attributeName); } else { var _type = propertyInfo.type; var attributeValue; if (_type === BOOLEAN || _type === OVERLOADED_BOOLEAN && value === true) { // If attribute type is boolean, we know for sure it won't be an execution sink // and we won't require Trusted Type here. attributeValue = ''; } else { // `setAttribute` with objects becomes only `[object]` in IE8/9, // ('' + value) makes it output the correct toString()-value. { { checkAttributeStringCoercion(value, attributeName); } attributeValue = '' + value; } if (propertyInfo.sanitizeURL) { sanitizeURL(attributeValue.toString()); } } if (attributeNamespace) { node.setAttributeNS(attributeNamespace, attributeName, attributeValue); } else { node.setAttribute(attributeName, attributeValue); } } } // ATTENTION // When adding new symbols to this file, // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' // The Symbol used to tag the ReactElement-like types. var REACT_ELEMENT_TYPE = Symbol.for('react.element'); var REACT_PORTAL_TYPE = Symbol.for('react.portal'); var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment'); var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode'); var REACT_PROFILER_TYPE = Symbol.for('react.profiler'); var REACT_PROVIDER_TYPE = Symbol.for('react.provider'); var REACT_CONTEXT_TYPE = Symbol.for('react.context'); var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref'); var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense'); var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list'); var REACT_MEMO_TYPE = Symbol.for('react.memo'); var REACT_LAZY_TYPE = Symbol.for('react.lazy'); var REACT_SCOPE_TYPE = Symbol.for('react.scope'); var REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for('react.debug_trace_mode'); var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen'); var REACT_LEGACY_HIDDEN_TYPE = Symbol.for('react.legacy_hidden'); var REACT_CACHE_TYPE = Symbol.for('react.cache'); var REACT_TRACING_MARKER_TYPE = Symbol.for('react.tracing_marker'); var MAYBE_ITERATOR_SYMBOL = Symbol.iterator; var FAUX_ITERATOR_SYMBOL = '@@iterator'; function getIteratorFn(maybeIterable) { if (maybeIterable === null || typeof maybeIterable !== 'object') { return null; } var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; if (typeof maybeIterator === 'function') { return maybeIterator; } return null; } var assign = Object.assign; // Helpers to patch console.logs to avoid logging during side-effect free // replaying on render function. This currently only patches the object // lazily which won't cover if the log function was extracted eagerly. // We could also eagerly patch the method. var disabledDepth = 0; var prevLog; var prevInfo; var prevWarn; var prevError; var prevGroup; var prevGroupCollapsed; var prevGroupEnd; function disabledLog() {} disabledLog.__reactDisabledLog = true; function disableLogs() { { if (disabledDepth === 0) { /* eslint-disable react-internal/no-production-logging */ prevLog = console.log; prevInfo = console.info; prevWarn = console.warn; prevError = console.error; prevGroup = console.group; prevGroupCollapsed = console.groupCollapsed; prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099 var props = { configurable: true, enumerable: true, value: disabledLog, writable: true }; // $FlowFixMe Flow thinks console is immutable. Object.defineProperties(console, { info: props, log: props, warn: props, error: props, group: props, groupCollapsed: props, groupEnd: props }); /* eslint-enable react-internal/no-production-logging */ } disabledDepth++; } } function reenableLogs() { { disabledDepth--; if (disabledDepth === 0) { /* eslint-disable react-internal/no-production-logging */ var props = { configurable: true, enumerable: true, writable: true }; // $FlowFixMe Flow thinks console is immutable. Object.defineProperties(console, { log: assign({}, props, { value: prevLog }), info: assign({}, props, { value: prevInfo }), warn: assign({}, props, { value: prevWarn }), error: assign({}, props, { value: prevError }), group: assign({}, props, { value: prevGroup }), groupCollapsed: assign({}, props, { value: prevGroupCollapsed }), groupEnd: assign({}, props, { value: prevGroupEnd }) }); /* eslint-enable react-internal/no-production-logging */ } if (disabledDepth < 0) { error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.'); } } } var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher; var prefix; function describeBuiltInComponentFrame(name, source, ownerFn) { { if (prefix === undefined) { // Extract the VM specific prefix used by each line. try { throw Error(); } catch (x) { var match = x.stack.trim().match(/\n( *(at )?)/); prefix = match && match[1] || ''; } } // We use the prefix to ensure our stacks line up with native stack frames. return '\n' + prefix + name; } } var reentry = false; var componentFrameCache; { var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map; componentFrameCache = new PossiblyWeakMap(); } function describeNativeComponentFrame(fn, construct) { // If something asked for a stack inside a fake render, it should get ignored. if ( !fn || reentry) { return ''; } { var frame = componentFrameCache.get(fn); if (frame !== undefined) { return frame; } } var control; reentry = true; var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined. Error.prepareStackTrace = undefined; var previousDispatcher; { previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function // for warnings. ReactCurrentDispatcher.current = null; disableLogs(); } try { // This should throw. if (construct) { // Something should be setting the props in the constructor. var Fake = function () { throw Error(); }; // $FlowFixMe Object.defineProperty(Fake.prototype, 'props', { set: function () { // We use a throwing setter instead of frozen or non-writable props // because that won't throw in a non-strict mode function. throw Error(); } }); if (typeof Reflect === 'object' && Reflect.construct) { // We construct a different control for this case to include any extra // frames added by the construct call. try { Reflect.construct(Fake, []); } catch (x) { control = x; } Reflect.construct(fn, [], Fake); } else { try { Fake.call(); } catch (x) { control = x; } fn.call(Fake.prototype); } } else { try { throw Error(); } catch (x) { control = x; } fn(); } } catch (sample) { // This is inlined manually because closure doesn't do it for us. if (sample && control && typeof sample.stack === 'string') { // This extracts the first frame from the sample that isn't also in the control. // Skipping one frame that we assume is the frame that calls the two. var sampleLines = sample.stack.split('\n'); var controlLines = control.stack.split('\n'); var s = sampleLines.length - 1; var c = controlLines.length - 1; while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) { // We expect at least one stack frame to be shared. // Typically this will be the root most one. However, stack frames may be // cut off due to maximum stack limits. In this case, one maybe cut off // earlier than the other. We assume that the sample is longer or the same // and there for cut off earlier. So we should find the root most frame in // the sample somewhere in the control. c--; } for (; s >= 1 && c >= 0; s--, c--) { // Next we find the first one that isn't the same which should be the // frame that called our sample function and the control. if (sampleLines[s] !== controlLines[c]) { // In V8, the first line is describing the message but other VMs don't. // If we're about to return the first line, and the control is also on the same // line, that's a pretty good indicator that our sample threw at same line as // the control. I.e. before we entered the sample frame. So we ignore this result. // This can happen if you passed a class to function component, or non-function. if (s !== 1 || c !== 1) { do { s--; c--; // We may still have similar intermediate frames from the construct call. // The next one that isn't the same should be our match though. if (c < 0 || sampleLines[s] !== controlLines[c]) { // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier. var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled "<anonymous>" // but we have a user-provided "displayName" // splice it in to make the stack more readable. if (fn.displayName && _frame.includes('<anonymous>')) { _frame = _frame.replace('<anonymous>', fn.displayName); } { if (typeof fn === 'function') { componentFrameCache.set(fn, _frame); } } // Return the line we found. return _frame; } } while (s >= 1 && c >= 0); } break; } } } } finally { reentry = false; { ReactCurrentDispatcher.current = previousDispatcher; reenableLogs(); } Error.prepareStackTrace = previousPrepareStackTrace; } // Fallback to just using the name if we couldn't make it throw. var name = fn ? fn.displayName || fn.name : ''; var syntheticFrame = name ? describeBuiltInComponentFrame(name) : ''; { if (typeof fn === 'function') { componentFrameCache.set(fn, syntheticFrame); } } return syntheticFrame; } function describeClassComponentFrame(ctor, source, ownerFn) { { return describeNativeComponentFrame(ctor, true); } } function describeFunctionComponentFrame(fn, source, ownerFn) { { return describeNativeComponentFrame(fn, false); } } function shouldConstruct(Component) { var prototype = Component.prototype; return !!(prototype && prototype.isReactComponent); } function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) { if (type == null) { return ''; } if (typeof type === 'function') { { return describeNativeComponentFrame(type, shouldConstruct(type)); } } if (typeof type === 'string') { return describeBuiltInComponentFrame(type); } switch (type) { case REACT_SUSPENSE_TYPE: return describeBuiltInComponentFrame('Suspense'); case REACT_SUSPENSE_LIST_TYPE: return describeBuiltInComponentFrame('SuspenseList'); } if (typeof type === 'object') { switch (type.$$typeof) { case REACT_FORWARD_REF_TYPE: return describeFunctionComponentFrame(type.render); case REACT_MEMO_TYPE: // Memo may contain any component type so we recursively resolve it. return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn); case REACT_LAZY_TYPE: { var lazyComponent = type; var payload = lazyComponent._payload; var init = lazyComponent._init; try { // Lazy may contain any component type so we recursively resolve it. return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn); } catch (x) {} } } } return ''; } function describeFiber(fiber) { var owner = fiber._debugOwner ? fiber._debugOwner.type : null ; var source = fiber._debugSource ; switch (fiber.tag) { case HostComponent: return describeBuiltInComponentFrame(fiber.type); case LazyComponent: return describeBuiltInComponentFrame('Lazy'); case SuspenseComponent: return describeBuiltInComponentFrame('Suspense'); case SuspenseListComponent: return describeBuiltInComponentFrame('SuspenseList'); case FunctionComponent: case IndeterminateComponent: case SimpleMemoComponent: return describeFunctionComponentFrame(fiber.type); case ForwardRef: return describeFunctionComponentFrame(fiber.type.render); case ClassComponent: return describeClassComponentFrame(fiber.type); default: return ''; } } function getStackByFiberInDevAndProd(workInProgress) { try { var info = ''; var node = workInProgress; do { info += describeFiber(node); node = node.return; } while (node); return info; } catch (x) { return '\nError generating stack: ' + x.message + '\n' + x.stack; } } function getWrappedName(outerType, innerType, wrapperName) { var displayName = outerType.displayName; if (displayName) { return displayName; } var functionName = innerType.displayName || innerType.name || ''; return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName; } // Keep in sync with react-reconciler/getComponentNameFromFiber function getContextName(type) { return type.displayName || 'Context'; } // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead. function getComponentNameFromType(type) { if (type == null) { // Host root, text node or just invalid type. return null; } { if (typeof type.tag === 'number') { error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.'); } } if (typeof type === 'function') { return type.displayName || type.name || null; } if (typeof type === 'string') { return type; } switch (type) { case REACT_FRAGMENT_TYPE: return 'Fragment'; case REACT_PORTAL_TYPE: return 'Portal'; case REACT_PROFILER_TYPE: return 'Profiler'; case REACT_STRICT_MODE_TYPE: return 'StrictMode'; case REACT_SUSPENSE_TYPE: return 'Suspense'; case REACT_SUSPENSE_LIST_TYPE: return 'SuspenseList'; } if (typeof type === 'object') { switch (type.$$typeof) { case REACT_CONTEXT_TYPE: var context = type; return getContextName(context) + '.Consumer'; case REACT_PROVIDER_TYPE: var provider = type; return getContextName(provider._context) + '.Provider'; case REACT_FORWARD_REF_TYPE: return getWrappedName(type, type.render, 'ForwardRef'); case REACT_MEMO_TYPE: var outerName = type.displayName || null; if (outerName !== null) { return outerName; } return getComponentNameFromType(type.type) || 'Memo'; case REACT_LAZY_TYPE: { var lazyComponent = type; var payload = lazyComponent._payload; var init = lazyComponent._init; try { return getComponentNameFromType(init(payload)); } catch (x) { return null; } } // eslint-disable-next-line no-fallthrough } } return null; } function getWrappedName$1(outerType, innerType, wrapperName) { var functionName = innerType.displayName || innerType.name || ''; return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName); } // Keep in sync with shared/getComponentNameFromType function getContextName$1(type) { return type.displayName || 'Context'; } function getComponentNameFromFiber(fiber) { var tag = fiber.tag, type = fiber.type; switch (tag) { case CacheComponent: return 'Cache'; case ContextConsumer: var context = type; return getContextName$1(context) + '.Consumer'; case ContextProvider: var provider = type; return getContextName$1(provider._context) + '.Provider'; case DehydratedFragment: return 'DehydratedFragment'; case ForwardRef: return getWrappedName$1(type, type.render, 'ForwardRef'); case Fragment: return 'Fragment'; case HostComponent: // Host component type is the display name (e.g. "div", "View") return type; case HostPortal: return 'Portal'; case HostRoot: return 'Root'; case HostText: return 'Text'; case LazyComponent: // Name comes from the type in this case; we don't have a tag. return getComponentNameFromType(type); case Mode: if (type === REACT_STRICT_MODE_TYPE) { // Don't be less specific than shared/getComponentNameFromType return 'StrictMode'; } return 'Mode'; case OffscreenComponent: return 'Offscreen'; case Profiler: return 'Profiler'; case ScopeComponent: return 'Scope'; case SuspenseComponent: return 'Suspense'; case SuspenseListComponent: return 'SuspenseList'; case TracingMarkerComponent: return 'TracingMarker'; // The display name for this tags come from the user-provided type: case ClassComponent: case FunctionComponent: case IncompleteClassComponent: case IndeterminateComponent: case MemoComponent: case SimpleMemoComponent: if (typeof type === 'function') { return type.displayName || type.name || null; } if (typeof type === 'string') { return type; } break; } return null; } var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; var current = null; var isRendering = false; function getCurrentFiberOwnerNameInDevOrNull() { { if (current === null) { return null; } var owner = current._debugOwner; if (owner !== null && typeof owner !== 'undefined') { return getComponentNameFromFiber(owner); } } return null; } function getCurrentFiberStackInDev() { { if (current === null) { return ''; } // Safe because if current fiber exists, we are reconciling, // and it is guaranteed to be the work-in-progress version. return getStackByFiberInDevAndProd(current); } } function resetCurrentFiber() { { ReactDebugCurrentFrame.getCurrentStack = null; current = null; isRendering = false; } } function setCurrentFiber(fiber) { { ReactDebugCurrentFrame.getCurrentStack = fiber === null ? null : getCurrentFiberStackInDev; current = fiber; isRendering = false; } } function getCurrentFiber() { { return current; } } function setIsRendering(rendering) { { isRendering = rendering; } } // Flow does not allow string concatenation of most non-string types. To work // around this limitation, we use an opaque type that can only be obtained by // passing the value through getToStringValue first. function toString(value) { // The coercion safety check is performed in getToStringValue(). // eslint-disable-next-line react-internal/safe-string-coercion return '' + value; } function getToStringValue(value) { switch (typeof value) { case 'boolean': case 'number': case 'string': case 'undefined': return value; case 'object': { checkFormFieldValueStringCoercion(value); } return value; default: // function, symbol are assigned as empty strings return ''; } } var hasReadOnlyValue = { button: true, checkbox: true, image: true, hidden: true, radio: true, reset: true, submit: true }; function checkControlledValueProps(tagName, props) { { if (!(hasReadOnlyValue[props.type] || props.onChange || props.onInput || props.readOnly || props.disabled || props.value == null)) { error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.'); } if (!(props.onChange || props.readOnly || props.disabled || props.checked == null)) { error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.'); } } } function isCheckable(elem) { var type = elem.type; var nodeName = elem.nodeName; return nodeName && nodeName.toLowerCase() === 'input' && (type === 'checkbox' || type === 'radio'); } function getTracker(node) { return node._valueTracker; } function detachTracker(node) { node._valueTracker = null; } function getValueFromNode(node) { var value = ''; if (!node) { return value; } if (isCheckable(node)) { value = node.checked ? 'true' : 'false'; } else { value = node.value; } return value; } function trackValueOnNode(node) { var valueField = isCheckable(node) ? 'checked' : 'value'; var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField); { checkFormFieldValueStringCoercion(node[valueField]); } var currentValue = '' + node[valueField]; // if someone has already defined a value or Safari, then bail // and don't track value will cause over reporting of changes, // but it's better then a hard failure // (needed for certain tests that spyOn input values and Safari) if (node.hasOwnProperty(valueField) || typeof descriptor === 'undefined' || typeof descriptor.get !== 'function' || typeof descriptor.set !== 'function') { return; } var get = descriptor.get, set = descriptor.set; Object.defineProperty(node, valueField, { configurable: true, get: function () { return get.call(this); }, set: function (value) { { checkFormFieldValueStringCoercion(value); } currentValue = '' + value; set.call(this, value); } }); // We could've passed this the first time // but it triggers a bug in IE11 and Edge 14/15. // Calling defineProperty() again should be equivalent. // https://github.com/facebook/react/issues/11768 Object.defineProperty(node, valueField, { enumerable: descriptor.enumerable }); var tracker = { getValue: function () { return currentValue; }, setValue: function (value) { { checkFormFieldValueStringCoercion(value); } currentValue = '' + value; }, stopTracking: function () { detachTracker(node); delete node[valueField]; } }; return tracker; } function track(node) { if (getTracker(node)) { return; } // TODO: Once it's just Fiber we can move this to node._wrapperState node._valueTracker = trackValueOnNode(node); } function updateValueIfChanged(node) { if (!node) { return false; } var tracker = getTracker(node); // if there is no tracker at this point it's unlikely // that trying again will succeed if (!tracker) { return true; } var lastValue = tracker.getValue(); var nextValue = getValueFromNode(node); if (nextValue !== lastValue) { tracker.setValue(nextValue); return true; } return false; } function getActiveElement(doc) { doc = doc || (typeof document !== 'undefined' ? document : undefined); if (typeof doc === 'undefined') { return null; } try { return doc.activeElement || doc.body; } catch (e) { return doc.body; } } var didWarnValueDefaultValue = false; var didWarnCheckedDefaultChecked = false; var didWarnControlledToUncontrolled = false; var didWarnUncontrolledToControlled = false; function isControlled(props) { var usesChecked = props.type === 'checkbox' || props.type === 'radio'; return usesChecked ? props.checked != null : props.value != null; } /** * Implements an <input> host component that allows setting these optional * props: `checked`, `value`, `defaultChecked`, and `defaultValue`. * * If `checked` or `value` are not supplied (or null/undefined), user actions * that affect the checked state or value will trigger updates to the element. * * If they are supplied (and not null/undefined), the rendered element will not * trigger updates to the element. Instead, the props must change in order for * the rendered element to be updated. * * The rendered element will be initialized as unchecked (or `defaultChecked`) * with an empty value (or `defaultValue`). * * See http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html */ function getHostProps(element, props) { var node = element; var checked = props.checked; var hostProps = assign({}, props, { defaultChecked: undefined, defaultValue: undefined, value: undefined, checked: checked != null ? checked : node._wrapperState.initialChecked }); return hostProps; } function initWrapperState(element, props) { { checkControlledValueProps('input', props); if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) { error('%s contains an input of type %s with both checked and defaultChecked props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://reactjs.org/link/controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type); didWarnCheckedDefaultChecked = true; } if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) { error('%s contains an input of type %s with both value and defaultValue props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://reactjs.org/link/controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type); didWarnValueDefaultValue = true; } } var node = element; var defaultValue = props.defaultValue == null ? '' : props.defaultValue; node._wrapperState = { initialChecked: props.checked != null ? props.checked : props.defaultChecked, initialValue: getToStringValue(props.value != null ? props.value : defaultValue), controlled: isControlled(props) }; } function updateChecked(element, props) { var node = element; var checked = props.checked; if (checked != null) { setValueForProperty(node, 'checked', checked, false); } } function updateWrapper(element, props) { var node = element; { var controlled = isControlled(props); if (!node._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) { error('A component is changing an uncontrolled input to be controlled. ' + 'This is likely caused by the value changing from undefined to ' + 'a defined value, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components'); didWarnUncontrolledToControlled = true; } if (node._wrapperState.controlled && !controlled && !didWarnControlledToUncontrolled) { error('A component is changing a controlled input to be uncontrolled. ' + 'This is likely caused by the value changing from a defined to ' + 'undefined, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components'); didWarnControlledToUncontrolled = true; } } updateChecked(element, props); var value = getToStringValue(props.value); var type = props.type; if (value != null) { if (type === 'number') { if (value === 0 && node.value === '' || // We explicitly want to coerce to number here if possible. // eslint-disable-next-line node.value != value) { node.value = toString(value); } } else if (node.value !== toString(value)) { node.value = toString(value); } } else if (type === 'submit' || type === 'reset') { // Submit/reset inputs need the attribute removed completely to avoid // blank-text buttons. node.removeAttribute('value'); return; } { // When syncing the value attribute, the value comes from a cascade of // properties: // 1. The value React property // 2. The defaultValue React property // 3. Otherwise there should be no change if (props.hasOwnProperty('value')) { setDefaultValue(node, props.type, value); } else if (props.hasOwnProperty('defaultValue')) { setDefaultValue(node, props.type, getToStringValue(props.defaultValue)); } } { // When syncing the checked attribute, it only changes when it needs // to be removed, such as transitioning from a checkbox into a text input if (props.checked == null && props.defaultChecked != null) { node.defaultChecked = !!props.defaultChecked; } } } function postMountWrapper(element, props, isHydrating) { var node = element; // Do not assign value if it is already set. This prevents user text input // from being lost during SSR hydration. if (props.hasOwnProperty('value') || props.hasOwnProperty('defaultValue')) { var type = props.type; var isButton = type === 'submit' || type === 'reset'; // Avoid setting value attribute on submit/reset inputs as it overrides the // default value provided by the browser. See: #12872 if (isButton && (props.value === undefined || props.value === null)) { return; } var initialValue = toString(node._wrapperState.initialValue); // Do not assign value if it is already set. This prevents user text input // from being lost during SSR hydration. if (!isHydrating) { { // When syncing the value attribute, the value property should use // the wrapperState._initialValue property. This uses: // // 1. The value React property when present // 2. The defaultValue React property when present // 3. An empty string if (initialValue !== node.value) { node.value = initialValue; } } } { // Otherwise, the value attribute is synchronized to the property, // so we assign defaultValue to the same thing as the value property // assignment step above. node.defaultValue = initialValue; } } // Normally, we'd just do `node.checked = node.checked` upon initial mount, less this bug // this is needed to work around a chrome bug where setting defaultChecked // will sometimes influence the value of checked (even after detachment). // Reference: https://bugs.chromium.org/p/chromium/issues/detail?id=608416 // We need to temporarily unset name to avoid disrupting radio button groups. var name = node.name; if (name !== '') { node.name = ''; } { // When syncing the checked attribute, both the checked property and // attribute are assigned at the same time using defaultChecked. This uses: // // 1. The checked React property when present // 2. The defaultChecked React property when present // 3. Otherwise, false node.defaultChecked = !node.defaultChecked; node.defaultChecked = !!node._wrapperState.initialChecked; } if (name !== '') { node.name = name; } } function restoreControlledState(element, props) { var node = element; updateWrapper(node, props); updateNamedCousins(node, props); } function updateNamedCousins(rootNode, props) { var name = props.name; if (props.type === 'radio' && name != null) { var queryRoot = rootNode; while (queryRoot.parentNode) { queryRoot = queryRoot.parentNode; } // If `rootNode.form` was non-null, then we could try `form.elements`, // but that sometimes behaves strangely in IE8. We could also try using // `form.getElementsByName`, but that will only return direct children // and won't include inputs that use the HTML5 `form=` attribute. Since // the input might not even be in a form. It might not even be in the // document. Let's just use the local `querySelectorAll` to ensure we don't // miss anything. { checkAttributeStringCoercion(name, 'name'); } var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type="radio"]'); for (var i = 0; i < group.length; i++) { var otherNode = group[i]; if (otherNode === rootNode || otherNode.form !== rootNode.form) { continue; } // This will throw if radio buttons rendered by different copies of React // and the same name are rendered into the same form (same as #1939). // That's probably okay; we don't support it just as we don't support // mixing React radio buttons with non-React ones. var otherProps = getFiberCurrentPropsFromNode(otherNode); if (!otherProps) { throw new Error('ReactDOMInput: Mixing React and non-React radio inputs with the ' + 'same `name` is not supported.'); } // We need update the tracked value on the named cousin since the value // was changed but the input saw no event or value set updateValueIfChanged(otherNode); // If this is a controlled radio button group, forcing the input that // was previously checked to update will cause it to be come re-checked // as appropriate. updateWrapper(otherNode, otherProps); } } } // In Chrome, assigning defaultValue to certain input types triggers input validation. // For number inputs, the display value loses trailing decimal points. For email inputs, // Chrome raises "The specified value <x> is not a valid email address". // // Here we check to see if the defaultValue has actually changed, avoiding these problems // when the user is inputting text // // https://github.com/facebook/react/issues/7253 function setDefaultValue(node, type, value) { if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js type !== 'number' || getActiveElement(node.ownerDocument) !== node) { if (value == null) { node.defaultValue = toString(node._wrapperState.initialValue); } else if (node.defaultValue !== toString(value)) { node.defaultValue = toString(value); } } } var didWarnSelectedSetOnOption = false; var didWarnInvalidChild = false; var didWarnInvalidInnerHTML = false; /** * Implements an <option> host component that warns when `selected` is set. */ function validateProps(element, props) { { // If a value is not provided, then the children must be simple. if (props.value == null) { if (typeof props.children === 'object' && props.children !== null) { React.Children.forEach(props.children, function (child) { if (child == null) { return; } if (typeof child === 'string' || typeof child === 'number') { return; } if (!didWarnInvalidChild) { didWarnInvalidChild = true; error('Cannot infer the option value of complex children. ' + 'Pass a `value` prop or use a plain string as children to <option>.'); } }); } else if (props.dangerouslySetInnerHTML != null) { if (!didWarnInvalidInnerHTML) { didWarnInvalidInnerHTML = true; error('Pass a `value` prop if you set dangerouslyInnerHTML so React knows ' + 'which value should be selected.'); } } } // TODO: Remove support for `selected` in <option>. if (props.selected != null && !didWarnSelectedSetOnOption) { error('Use the `defaultValue` or `value` props on <select> instead of ' + 'setting `selected` on <option>.'); didWarnSelectedSetOnOption = true; } } } function postMountWrapper$1(element, props) { // value="" should make a value attribute (#6219) if (props.value != null) { element.setAttribute('value', toString(getToStringValue(props.value))); } } var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare function isArray(a) { return isArrayImpl(a); } var didWarnValueDefaultValue$1; { didWarnValueDefaultValue$1 = false; } function getDeclarationErrorAddendum() { var ownerName = getCurrentFiberOwnerNameInDevOrNull(); if (ownerName) { return '\n\nCheck the render method of `' + ownerName + '`.'; } return ''; } var valuePropNames = ['value', 'defaultValue']; /** * Validation function for `value` and `defaultValue`. */ function checkSelectPropTypes(props) { { checkControlledValueProps('select', props); for (var i = 0; i < valuePropNames.length; i++) { var propName = valuePropNames[i]; if (props[propName] == null) { continue; } var propNameIsArray = isArray(props[propName]); if (props.multiple && !propNameIsArray) { error('The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum()); } else if (!props.multiple && propNameIsArray) { error('The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum()); } } } } function updateOptions(node, multiple, propValue, setDefaultSelected) { var options = node.options; if (multiple) { var selectedValues = propValue; var selectedValue = {}; for (var i = 0; i < selectedValues.length; i++) { // Prefix to avoid chaos with special keys. selectedValue['$' + selectedValues[i]] = true; } for (var _i = 0; _i < options.length; _i++) { var selected = selectedValue.hasOwnProperty('$' + options[_i].value); if (options[_i].selected !== selected) { options[_i].selected = selected; } if (selected && setDefaultSelected) { options[_i].defaultSelected = true; } } } else { // Do not set `select.value` as exact behavior isn't consistent across all // browsers for all cases. var _selectedValue = toString(getToStringValue(propValue)); var defaultSelected = null; for (var _i2 = 0; _i2 < options.length; _i2++) { if (options[_i2].value === _selectedValue) { options[_i2].selected = true; if (setDefaultSelected) { options[_i2].defaultSelected = true; } return; } if (defaultSelected === null && !options[_i2].disabled) { defaultSelected = options[_i2]; } } if (defaultSelected !== null) { defaultSelected.selected = true; } } } /** * Implements a <select> host component that allows optionally setting the * props `value` and `defaultValue`. If `multiple` is false, the prop must be a * stringable. If `multiple` is true, the prop must be an array of stringables. * * If `value` is not supplied (or null/undefined), user actions that change the * selected option will trigger updates to the rendered options. * * If it is supplied (and not null/undefined), the rendered options will not * update in response to user actions. Instead, the `value` prop must change in * order for the rendered options to update. * * If `defaultValue` is provided, any options with the supplied values will be * selected. */ function getHostProps$1(element, props) { return assign({}, props, { value: undefined }); } function initWrapperState$1(element, props) { var node = element; { checkSelectPropTypes(props); } node._wrapperState = { wasMultiple: !!props.multiple }; { if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue$1) { error('Select elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled select ' + 'element and remove one of these props. More info: ' + 'https://reactjs.org/link/controlled-components'); didWarnValueDefaultValue$1 = true; } } } function postMountWrapper$2(element, props) { var node = element; node.multiple = !!props.multiple; var value = props.value; if (value != null) { updateOptions(node, !!props.multiple, value, false); } else if (props.defaultValue != null) { updateOptions(node, !!props.multiple, props.defaultValue, true); } } function postUpdateWrapper(element, props) { var node = element; var wasMultiple = node._wrapperState.wasMultiple; node._wrapperState.wasMultiple = !!props.multiple; var value = props.value; if (value != null) { updateOptions(node, !!props.multiple, value, false); } else if (wasMultiple !== !!props.multiple) { // For simplicity, reapply `defaultValue` if `multiple` is toggled. if (props.defaultValue != null) { updateOptions(node, !!props.multiple, props.defaultValue, true); } else { // Revert the select back to its default unselected state. updateOptions(node, !!props.multiple, props.multiple ? [] : '', false); } } } function restoreControlledState$1(element, props) { var node = element; var value = props.value; if (value != null) { updateOptions(node, !!props.multiple, value, false); } } var didWarnValDefaultVal = false; /** * Implements a <textarea> host component that allows setting `value`, and * `defaultValue`. This differs from the traditional DOM API because value is * usually set as PCDATA children. * * If `value` is not supplied (or null/undefined), user actions that affect the * value will trigger updates to the element. * * If `value` is supplied (and not null/undefined), the rendered element will * not trigger updates to the element. Instead, the `value` prop must change in * order for the rendered element to be updated. * * The rendered element will be initialized with an empty value, the prop * `defaultValue` if specified, or the children content (deprecated). */ function getHostProps$2(element, props) { var node = element; if (props.dangerouslySetInnerHTML != null) { throw new Error('`dangerouslySetInnerHTML` does not make sense on <textarea>.'); } // Always set children to the same thing. In IE9, the selection range will // get reset if `textContent` is mutated. We could add a check in setTextContent // to only set the value if/when the value differs from the node value (which would // completely solve this IE9 bug), but Sebastian+Sophie seemed to like this // solution. The value can be a boolean or object so that's why it's forced // to be a string. var hostProps = assign({}, props, { value: undefined, defaultValue: undefined, children: toString(node._wrapperState.initialValue) }); return hostProps; } function initWrapperState$2(element, props) { var node = element; { checkControlledValueProps('textarea', props); if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValDefaultVal) { error('%s contains a textarea with both value and defaultValue props. ' + 'Textarea elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled textarea ' + 'and remove one of these props. More info: ' + 'https://reactjs.org/link/controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component'); didWarnValDefaultVal = true; } } var initialValue = props.value; // Only bother fetching default value if we're going to use it if (initialValue == null) { var children = props.children, defaultValue = props.defaultValue; if (children != null) { { error('Use the `defaultValue` or `value` props instead of setting ' + 'children on <textarea>.'); } { if (defaultValue != null) { throw new Error('If you supply `defaultValue` on a <textarea>, do not pass children.'); } if (isArray(children)) { if (children.length > 1) { throw new Error('<textarea> can only have at most one child.'); } children = children[0]; } defaultValue = children; } } if (defaultValue == null) { defaultValue = ''; } initialValue = defaultValue; } node._wrapperState = { initialValue: getToStringValue(initialValue) }; } function updateWrapper$1(element, props) { var node = element; var value = getToStringValue(props.value); var defaultValue = getToStringValue(props.defaultValue); if (value != null) { // Cast `value` to a string to ensure the value is set correctly. While // browsers typically do this as necessary, jsdom doesn't. var newValue = toString(value); // To avoid side effects (such as losing text selection), only set value if changed if (newValue !== node.value) { node.value = newValue; } if (props.defaultValue == null && node.defaultValue !== newValue) { node.defaultValue = newValue; } } if (defaultValue != null) { node.defaultValue = toString(defaultValue); } } function postMountWrapper$3(element, props) { var node = element; // This is in postMount because we need access to the DOM node, which is not // available until after the component has mounted. var textContent = node.textContent; // Only set node.value if textContent is equal to the expected // initial value. In IE10/IE11 there is a bug where the placeholder attribute // will populate textContent as well. // https://developer.microsoft.com/microsoft-edge/platform/issues/101525/ if (textContent === node._wrapperState.initialValue) { if (textContent !== '' && textContent !== null) { node.value = textContent; } } } function restoreControlledState$2(element, props) { // DOM component is still mounted; update updateWrapper$1(element, props); } var HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml'; var MATH_NAMESPACE = 'http://www.w3.org/1998/Math/MathML'; var SVG_NAMESPACE = 'http://www.w3.org/2000/svg'; // Assumes there is no parent namespace. function getIntrinsicNamespace(type) { switch (type) { case 'svg': return SVG_NAMESPACE; case 'math': return MATH_NAMESPACE; default: return HTML_NAMESPACE; } } function getChildNamespace(parentNamespace, type) { if (parentNamespace == null || parentNamespace === HTML_NAMESPACE) { // No (or default) parent namespace: potential entry point. return getIntrinsicNamespace(type); } if (parentNamespace === SVG_NAMESPACE && type === 'foreignObject') { // We're leaving SVG. return HTML_NAMESPACE; } // By default, pass namespace below. return parentNamespace; } /* globals MSApp */ /** * Create a function which has 'unsafe' privileges (required by windows8 apps) */ var createMicrosoftUnsafeLocalFunction = function (func) { if (typeof MSApp !== 'undefined' && MSApp.execUnsafeLocalFunction) { return function (arg0, arg1, arg2, arg3) { MSApp.execUnsafeLocalFunction(function () { return func(arg0, arg1, arg2, arg3); }); }; } else { return func; } }; var reusableSVGContainer; /** * Set the innerHTML property of a node * * @param {DOMElement} node * @param {string} html * @internal */ var setInnerHTML = createMicrosoftUnsafeLocalFunction(function (node, html) { if (node.namespaceURI === SVG_NAMESPACE) { if (!('innerHTML' in node)) { // IE does not have innerHTML for SVG nodes, so instead we inject the // new markup in a temp node and then move the child nodes across into // the target node reusableSVGContainer = reusableSVGContainer || document.createElement('div'); reusableSVGContainer.innerHTML = '<svg>' + html.valueOf().toString() + '</svg>'; var svgNode = reusableSVGContainer.firstChild; while (node.firstChild) { node.removeChild(node.firstChild); } while (svgNode.firstChild) { node.appendChild(svgNode.firstChild); } return; } } node.innerHTML = html; }); /** * HTML nodeType values that represent the type of the node */ var ELEMENT_NODE = 1; var TEXT_NODE = 3; var COMMENT_NODE = 8; var DOCUMENT_NODE = 9; var DOCUMENT_FRAGMENT_NODE = 11; /** * Set the textContent property of a node. For text updates, it's faster * to set the `nodeValue` of the Text node directly instead of using * `.textContent` which will remove the existing node and create a new one. * * @param {DOMElement} node * @param {string} text * @internal */ var setTextContent = function (node, text) { if (text) { var firstChild = node.firstChild; if (firstChild && firstChild === node.lastChild && firstChild.nodeType === TEXT_NODE) { firstChild.nodeValue = text; return; } } node.textContent = text; }; // List derived from Gecko source code: // https://github.com/mozilla/gecko-dev/blob/4e638efc71/layout/style/test/property_database.js var shorthandToLonghand = { animation: ['animationDelay', 'animationDirection', 'animationDuration', 'animationFillMode', 'animationIterationCount', 'animationName', 'animationPlayState', 'animationTimingFunction'], background: ['backgroundAttachment', 'backgroundClip', 'backgroundColor', 'backgroundImage', 'backgroundOrigin', 'backgroundPositionX', 'backgroundPositionY', 'backgroundRepeat', 'backgroundSize'], backgroundPosition: ['backgroundPositionX', 'backgroundPositionY'], border: ['borderBottomColor', 'borderBottomStyle', 'borderBottomWidth', 'borderImageOutset', 'borderImageRepeat', 'borderImageSlice', 'borderImageSource', 'borderImageWidth', 'borderLeftColor', 'borderLeftStyle', 'borderLeftWidth', 'borderRightColor', 'borderRightStyle', 'borderRightWidth', 'borderTopColor', 'borderTopStyle', 'borderTopWidth'], borderBlockEnd: ['borderBlockEndColor', 'borderBlockEndStyle', 'borderBlockEndWidth'], borderBlockStart: ['borderBlockStartColor', 'borderBlockStartStyle', 'borderBlockStartWidth'], borderBottom: ['borderBottomColor', 'borderBottomStyle', 'borderBottomWidth'], borderColor: ['borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor'], borderImage: ['borderImageOutset', 'borderImageRepeat', 'borderImageSlice', 'borderImageSource', 'borderImageWidth'], borderInlineEnd: ['borderInlineEndColor', 'borderInlineEndStyle', 'borderInlineEndWidth'], borderInlineStart: ['borderInlineStartColor', 'borderInlineStartStyle', 'borderInlineStartWidth'], borderLeft: ['borderLeftColor', 'borderLeftStyle', 'borderLeftWidth'], borderRadius: ['borderBottomLeftRadius', 'borderBottomRightRadius', 'borderTopLeftRadius', 'borderTopRightRadius'], borderRight: ['borderRightColor', 'borderRightStyle', 'borderRightWidth'], borderStyle: ['borderBottomStyle', 'borderLeftStyle', 'borderRightStyle', 'borderTopStyle'], borderTop: ['borderTopColor', 'borderTopStyle', 'borderTopWidth'], borderWidth: ['borderBottomWidth', 'borderLeftWidth', 'borderRightWidth', 'borderTopWidth'], columnRule: ['columnRuleColor', 'columnRuleStyle', 'columnRuleWidth'], columns: ['columnCount', 'columnWidth'], flex: ['flexBasis', 'flexGrow', 'flexShrink'], flexFlow: ['flexDirection', 'flexWrap'], font: ['fontFamily', 'fontFeatureSettings', 'fontKerning', 'fontLanguageOverride', 'fontSize', 'fontSizeAdjust', 'fontStretch', 'fontStyle', 'fontVariant', 'fontVariantAlternates', 'fontVariantCaps', 'fontVariantEastAsian', 'fontVariantLigatures', 'fontVariantNumeric', 'fontVariantPosition', 'fontWeight', 'lineHeight'], fontVariant: ['fontVariantAlternates', 'fontVariantCaps', 'fontVariantEastAsian', 'fontVariantLigatures', 'fontVariantNumeric', 'fontVariantPosition'], gap: ['columnGap', 'rowGap'], grid: ['gridAutoColumns', 'gridAutoFlow', 'gridAutoRows', 'gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows'], gridArea: ['gridColumnEnd', 'gridColumnStart', 'gridRowEnd', 'gridRowStart'], gridColumn: ['gridColumnEnd', 'gridColumnStart'], gridColumnGap: ['columnGap'], gridGap: ['columnGap', 'rowGap'], gridRow: ['gridRowEnd', 'gridRowStart'], gridRowGap: ['rowGap'], gridTemplate: ['gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows'], listStyle: ['listStyleImage', 'listStylePosition', 'listStyleType'], margin: ['marginBottom', 'marginLeft', 'marginRight', 'marginTop'], marker: ['markerEnd', 'markerMid', 'markerStart'], mask: ['maskClip', 'maskComposite', 'maskImage', 'maskMode', 'maskOrigin', 'maskPositionX', 'maskPositionY', 'maskRepeat', 'maskSize'], maskPosition: ['maskPositionX', 'maskPositionY'], outline: ['outlineColor', 'outlineStyle', 'outlineWidth'], overflow: ['overflowX', 'overflowY'], padding: ['paddingBottom', 'paddingLeft', 'paddingRight', 'paddingTop'], placeContent: ['alignContent', 'justifyContent'], placeItems: ['alignItems', 'justifyItems'], placeSelf: ['alignSelf', 'justifySelf'], textDecoration: ['textDecorationColor', 'textDecorationLine', 'textDecorationStyle'], textEmphasis: ['textEmphasisColor', 'textEmphasisStyle'], transition: ['transitionDelay', 'transitionDuration', 'transitionProperty', 'transitionTimingFunction'], wordWrap: ['overflowWrap'] }; /** * CSS properties which accept numbers but are not in units of "px". */ var isUnitlessNumber = { animationIterationCount: true, aspectRatio: true, borderImageOutset: true, borderImageSlice: true, borderImageWidth: true, boxFlex: true, boxFlexGroup: true, boxOrdinalGroup: true, columnCount: true, columns: true, flex: true, flexGrow: true, flexPositive: true, flexShrink: true, flexNegative: true, flexOrder: true, gridArea: true, gridRow: true, gridRowEnd: true, gridRowSpan: true, gridRowStart: true, gridColumn: true, gridColumnEnd: true, gridColumnSpan: true, gridColumnStart: true, fontWeight: true, lineClamp: true, lineHeight: true, opacity: true, order: true, orphans: true, tabSize: true, widows: true, zIndex: true, zoom: true, // SVG-related properties fillOpacity: true, floodOpacity: true, stopOpacity: true, strokeDasharray: true, strokeDashoffset: true, strokeMiterlimit: true, strokeOpacity: true, strokeWidth: true }; /** * @param {string} prefix vendor-specific prefix, eg: Webkit * @param {string} key style name, eg: transitionDuration * @return {string} style name prefixed with `prefix`, properly camelCased, eg: * WebkitTransitionDuration */ function prefixKey(prefix, key) { return prefix + key.charAt(0).toUpperCase() + key.substring(1); } /** * Support style names that may come passed in prefixed by adding permutations * of vendor prefixes. */ var prefixes = ['Webkit', 'ms', 'Moz', 'O']; // Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an // infinite loop, because it iterates over the newly added props too. Object.keys(isUnitlessNumber).forEach(function (prop) { prefixes.forEach(function (prefix) { isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop]; }); }); /** * Convert a value into the proper css writable value. The style name `name` * should be logical (no hyphens), as specified * in `CSSProperty.isUnitlessNumber`. * * @param {string} name CSS property name such as `topMargin`. * @param {*} value CSS property value such as `10px`. * @return {string} Normalized style value with dimensions applied. */ function dangerousStyleValue(name, value, isCustomProperty) { // Note that we've removed escapeTextForBrowser() calls here since the // whole string will be escaped when the attribute is injected into // the markup. If you provide unsafe user data here they can inject // arbitrary CSS which may be problematic (I couldn't repro this): // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet // http://www.thespanner.co.uk/2007/11/26/ultimate-xss-css-injection/ // This is not an XSS hole but instead a potential CSS injection issue // which has lead to a greater discussion about how we're going to // trust URLs moving forward. See #2115901 var isEmpty = value == null || typeof value === 'boolean' || value === ''; if (isEmpty) { return ''; } if (!isCustomProperty && typeof value === 'number' && value !== 0 && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) { return value + 'px'; // Presumes implicit 'px' suffix for unitless numbers } { checkCSSPropertyStringCoercion(value, name); } return ('' + value).trim(); } var uppercasePattern = /([A-Z])/g; var msPattern = /^ms-/; /** * Hyphenates a camelcased CSS property name, for example: * * > hyphenateStyleName('backgroundColor') * < "background-color" * > hyphenateStyleName('MozTransition') * < "-moz-transition" * > hyphenateStyleName('msTransition') * < "-ms-transition" * * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix * is converted to `-ms-`. */ function hyphenateStyleName(name) { return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-'); } var warnValidStyle = function () {}; { // 'msTransform' is correct, but the other prefixes should be capitalized var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/; var msPattern$1 = /^-ms-/; var hyphenPattern = /-(.)/g; // style values shouldn't contain a semicolon var badStyleValueWithSemicolonPattern = /;\s*$/; var warnedStyleNames = {}; var warnedStyleValues = {}; var warnedForNaNValue = false; var warnedForInfinityValue = false; var camelize = function (string) { return string.replace(hyphenPattern, function (_, character) { return character.toUpperCase(); }); }; var warnHyphenatedStyleName = function (name) { if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) { return; } warnedStyleNames[name] = true; error('Unsupported style property %s. Did you mean %s?', name, // As Andi Smith suggests // (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix // is converted to lowercase `ms`. camelize(name.replace(msPattern$1, 'ms-'))); }; var warnBadVendoredStyleName = function (name) { if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) { return; } warnedStyleNames[name] = true; error('Unsupported vendor-prefixed style property %s. Did you mean %s?', name, name.charAt(0).toUpperCase() + name.slice(1)); }; var warnStyleValueWithSemicolon = function (name, value) { if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) { return; } warnedStyleValues[value] = true; error("Style property values shouldn't contain a semicolon. " + 'Try "%s: %s" instead.', name, value.replace(badStyleValueWithSemicolonPattern, '')); }; var warnStyleValueIsNaN = function (name, value) { if (warnedForNaNValue) { return; } warnedForNaNValue = true; error('`NaN` is an invalid value for the `%s` css style property.', name); }; var warnStyleValueIsInfinity = function (name, value) { if (warnedForInfinityValue) { return; } warnedForInfinityValue = true; error('`Infinity` is an invalid value for the `%s` css style property.', name); }; warnValidStyle = function (name, value) { if (name.indexOf('-') > -1) { warnHyphenatedStyleName(name); } else if (badVendoredStyleNamePattern.test(name)) { warnBadVendoredStyleName(name); } else if (badStyleValueWithSemicolonPattern.test(value)) { warnStyleValueWithSemicolon(name, value); } if (typeof value === 'number') { if (isNaN(value)) { warnStyleValueIsNaN(name, value); } else if (!isFinite(value)) { warnStyleValueIsInfinity(name, value); } } }; } var warnValidStyle$1 = warnValidStyle; /** * Operations for dealing with CSS properties. */ /** * This creates a string that is expected to be equivalent to the style * attribute generated by server-side rendering. It by-passes warnings and * security checks so it's not safe to use this value for anything other than * comparison. It is only used in DEV for SSR validation. */ function createDangerousStringForStyles(styles) { { var serialized = ''; var delimiter = ''; for (var styleName in styles) { if (!styles.hasOwnProperty(styleName)) { continue; } var styleValue = styles[styleName]; if (styleValue != null) { var isCustomProperty = styleName.indexOf('--') === 0; serialized += delimiter + (isCustomProperty ? styleName : hyphenateStyleName(styleName)) + ':'; serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty); delimiter = ';'; } } return serialized || null; } } /** * Sets the value for multiple styles on a node. If a value is specified as * '' (empty string), the corresponding style property will be unset. * * @param {DOMElement} node * @param {object} styles */ function setValueForStyles(node, styles) { var style = node.style; for (var styleName in styles) { if (!styles.hasOwnProperty(styleName)) { continue; } var isCustomProperty = styleName.indexOf('--') === 0; { if (!isCustomProperty) { warnValidStyle$1(styleName, styles[styleName]); } } var styleValue = dangerousStyleValue(styleName, styles[styleName], isCustomProperty); if (styleName === 'float') { styleName = 'cssFloat'; } if (isCustomProperty) { style.setProperty(styleName, styleValue); } else { style[styleName] = styleValue; } } } function isValueEmpty(value) { return value == null || typeof value === 'boolean' || value === ''; } /** * Given {color: 'red', overflow: 'hidden'} returns { * color: 'color', * overflowX: 'overflow', * overflowY: 'overflow', * }. This can be read as "the overflowY property was set by the overflow * shorthand". That is, the values are the property that each was derived from. */ function expandShorthandMap(styles) { var expanded = {}; for (var key in styles) { var longhands = shorthandToLonghand[key] || [key]; for (var i = 0; i < longhands.length; i++) { expanded[longhands[i]] = key; } } return expanded; } /** * When mixing shorthand and longhand property names, we warn during updates if * we expect an incorrect result to occur. In particular, we warn for: * * Updating a shorthand property (longhand gets overwritten): * {font: 'foo', fontVariant: 'bar'} -> {font: 'baz', fontVariant: 'bar'} * becomes .style.font = 'baz' * Removing a shorthand property (longhand gets lost too): * {font: 'foo', fontVariant: 'bar'} -> {fontVariant: 'bar'} * becomes .style.font = '' * Removing a longhand property (should revert to shorthand; doesn't): * {font: 'foo', fontVariant: 'bar'} -> {font: 'foo'} * becomes .style.fontVariant = '' */ function validateShorthandPropertyCollisionInDev(styleUpdates, nextStyles) { { if (!nextStyles) { return; } var expandedUpdates = expandShorthandMap(styleUpdates); var expandedStyles = expandShorthandMap(nextStyles); var warnedAbout = {}; for (var key in expandedUpdates) { var originalKey = expandedUpdates[key]; var correctOriginalKey = expandedStyles[key]; if (correctOriginalKey && originalKey !== correctOriginalKey) { var warningKey = originalKey + ',' + correctOriginalKey; if (warnedAbout[warningKey]) { continue; } warnedAbout[warningKey] = true; error('%s a style property during rerender (%s) when a ' + 'conflicting property is set (%s) can lead to styling bugs. To ' + "avoid this, don't mix shorthand and non-shorthand properties " + 'for the same value; instead, replace the shorthand with ' + 'separate values.', isValueEmpty(styleUpdates[originalKey]) ? 'Removing' : 'Updating', originalKey, correctOriginalKey); } } } } // For HTML, certain tags should omit their close tag. We keep a list for // those special-case tags. var omittedCloseTags = { area: true, base: true, br: true, col: true, embed: true, hr: true, img: true, input: true, keygen: true, link: true, meta: true, param: true, source: true, track: true, wbr: true // NOTE: menuitem's close tag should be omitted, but that causes problems. }; // `omittedCloseTags` except that `menuitem` should still have its closing tag. var voidElementTags = assign({ menuitem: true }, omittedCloseTags); var HTML = '__html'; function assertValidProps(tag, props) { if (!props) { return; } // Note the use of `==` which checks for null or undefined. if (voidElementTags[tag]) { if (props.children != null || props.dangerouslySetInnerHTML != null) { throw new Error(tag + " is a void element tag and must neither have `children` nor " + 'use `dangerouslySetInnerHTML`.'); } } if (props.dangerouslySetInnerHTML != null) { if (props.children != null) { throw new Error('Can only set one of `children` or `props.dangerouslySetInnerHTML`.'); } if (typeof props.dangerouslySetInnerHTML !== 'object' || !(HTML in props.dangerouslySetInnerHTML)) { throw new Error('`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. ' + 'Please visit https://reactjs.org/link/dangerously-set-inner-html ' + 'for more information.'); } } { if (!props.suppressContentEditableWarning && props.contentEditable && props.children != null) { error('A component is `contentEditable` and contains `children` managed by ' + 'React. It is now your responsibility to guarantee that none of ' + 'those nodes are unexpectedly modified or duplicated. This is ' + 'probably not intentional.'); } } if (props.style != null && typeof props.style !== 'object') { throw new Error('The `style` prop expects a mapping from style properties to values, ' + "not a string. For example, style={{marginRight: spacing + 'em'}} when " + 'using JSX.'); } } function isCustomComponent(tagName, props) { if (tagName.indexOf('-') === -1) { return typeof props.is === 'string'; } switch (tagName) { // These are reserved SVG and MathML elements. // We don't mind this list too much because we expect it to never grow. // The alternative is to track the namespace in a few places which is convoluted. // https://w3c.github.io/webcomponents/spec/custom/#custom-elements-core-concepts case 'annotation-xml': case 'color-profile': case 'font-face': case 'font-face-src': case 'font-face-uri': case 'font-face-format': case 'font-face-name': case 'missing-glyph': return false; default: return true; } } // When adding attributes to the HTML or SVG allowed attribute list, be sure to // also add them to this module to ensure casing and incorrect name // warnings. var possibleStandardNames = { // HTML accept: 'accept', acceptcharset: 'acceptCharset', 'accept-charset': 'acceptCharset', accesskey: 'accessKey', action: 'action', allowfullscreen: 'allowFullScreen', alt: 'alt', as: 'as', async: 'async', autocapitalize: 'autoCapitalize', autocomplete: 'autoComplete', autocorrect: 'autoCorrect', autofocus: 'autoFocus', autoplay: 'autoPlay', autosave: 'autoSave', capture: 'capture', cellpadding: 'cellPadding', cellspacing: 'cellSpacing', challenge: 'challenge', charset: 'charSet', checked: 'checked', children: 'children', cite: 'cite', class: 'className', classid: 'classID', classname: 'className', cols: 'cols', colspan: 'colSpan', content: 'content', contenteditable: 'contentEditable', contextmenu: 'contextMenu', controls: 'controls', controlslist: 'controlsList', coords: 'coords', crossorigin: 'crossOrigin', dangerouslysetinnerhtml: 'dangerouslySetInnerHTML', data: 'data', datetime: 'dateTime', default: 'default', defaultchecked: 'defaultChecked', defaultvalue: 'defaultValue', defer: 'defer', dir: 'dir', disabled: 'disabled', disablepictureinpicture: 'disablePictureInPicture', disableremoteplayback: 'disableRemotePlayback', download: 'download', draggable: 'draggable', enctype: 'encType', enterkeyhint: 'enterKeyHint', for: 'htmlFor', form: 'form', formmethod: 'formMethod', formaction: 'formAction', formenctype: 'formEncType', formnovalidate: 'formNoValidate', formtarget: 'formTarget', frameborder: 'frameBorder', headers: 'headers', height: 'height', hidden: 'hidden', high: 'high', href: 'href', hreflang: 'hrefLang', htmlfor: 'htmlFor', httpequiv: 'httpEquiv', 'http-equiv': 'httpEquiv', icon: 'icon', id: 'id', imagesizes: 'imageSizes', imagesrcset: 'imageSrcSet', innerhtml: 'innerHTML', inputmode: 'inputMode', integrity: 'integrity', is: 'is', itemid: 'itemID', itemprop: 'itemProp', itemref: 'itemRef', itemscope: 'itemScope', itemtype: 'itemType', keyparams: 'keyParams', keytype: 'keyType', kind: 'kind', label: 'label', lang: 'lang', list: 'list', loop: 'loop', low: 'low', manifest: 'manifest', marginwidth: 'marginWidth', marginheight: 'marginHeight', max: 'max', maxlength: 'maxLength', media: 'media', mediagroup: 'mediaGroup', method: 'method', min: 'min', minlength: 'minLength', multiple: 'multiple', muted: 'muted', name: 'name', nomodule: 'noModule', nonce: 'nonce', novalidate: 'noValidate', open: 'open', optimum: 'optimum', pattern: 'pattern', placeholder: 'placeholder', playsinline: 'playsInline', poster: 'poster', preload: 'preload', profile: 'profile', radiogroup: 'radioGroup', readonly: 'readOnly', referrerpolicy: 'referrerPolicy', rel: 'rel', required: 'required', reversed: 'reversed', role: 'role', rows: 'rows', rowspan: 'rowSpan', sandbox: 'sandbox', scope: 'scope', scoped: 'scoped', scrolling: 'scrolling', seamless: 'seamless', selected: 'selected', shape: 'shape', size: 'size', sizes: 'sizes', span: 'span', spellcheck: 'spellCheck', src: 'src', srcdoc: 'srcDoc', srclang: 'srcLang', srcset: 'srcSet', start: 'start', step: 'step', style: 'style', summary: 'summary', tabindex: 'tabIndex', target: 'target', title: 'title', type: 'type', usemap: 'useMap', value: 'value', width: 'width', wmode: 'wmode', wrap: 'wrap', // SVG about: 'about', accentheight: 'accentHeight', 'accent-height': 'accentHeight', accumulate: 'accumulate', additive: 'additive', alignmentbaseline: 'alignmentBaseline', 'alignment-baseline': 'alignmentBaseline', allowreorder: 'allowReorder', alphabetic: 'alphabetic', amplitude: 'amplitude', arabicform: 'arabicForm', 'arabic-form': 'arabicForm', ascent: 'ascent', attributename: 'attributeName', attributetype: 'attributeType', autoreverse: 'autoReverse', azimuth: 'azimuth', basefrequency: 'baseFrequency', baselineshift: 'baselineShift', 'baseline-shift': 'baselineShift', baseprofile: 'baseProfile', bbox: 'bbox', begin: 'begin', bias: 'bias', by: 'by', calcmode: 'calcMode', capheight: 'capHeight', 'cap-height': 'capHeight', clip: 'clip', clippath: 'clipPath', 'clip-path': 'clipPath', clippathunits: 'clipPathUnits', cliprule: 'clipRule', 'clip-rule': 'clipRule', color: 'color', colorinterpolation: 'colorInterpolation', 'color-interpolation': 'colorInterpolation', colorinterpolationfilters: 'colorInterpolationFilters', 'color-interpolation-filters': 'colorInterpolationFilters', colorprofile: 'colorProfile', 'color-profile': 'colorProfile', colorrendering: 'colorRendering', 'color-rendering': 'colorRendering', contentscripttype: 'contentScriptType', contentstyletype: 'contentStyleType', cursor: 'cursor', cx: 'cx', cy: 'cy', d: 'd', datatype: 'datatype', decelerate: 'decelerate', descent: 'descent', diffuseconstant: 'diffuseConstant', direction: 'direction', display: 'display', divisor: 'divisor', dominantbaseline: 'dominantBaseline', 'dominant-baseline': 'dominantBaseline', dur: 'dur', dx: 'dx', dy: 'dy', edgemode: 'edgeMode', elevation: 'elevation', enablebackground: 'enableBackground', 'enable-background': 'enableBackground', end: 'end', exponent: 'exponent', externalresourcesrequired: 'externalResourcesRequired', fill: 'fill', fillopacity: 'fillOpacity', 'fill-opacity': 'fillOpacity', fillrule: 'fillRule', 'fill-rule': 'fillRule', filter: 'filter', filterres: 'filterRes', filterunits: 'filterUnits', floodopacity: 'floodOpacity', 'flood-opacity': 'floodOpacity', floodcolor: 'floodColor', 'flood-color': 'floodColor', focusable: 'focusable', fontfamily: 'fontFamily', 'font-family': 'fontFamily', fontsize: 'fontSize', 'font-size': 'fontSize', fontsizeadjust: 'fontSizeAdjust', 'font-size-adjust': 'fontSizeAdjust', fontstretch: 'fontStretch', 'font-stretch': 'fontStretch', fontstyle: 'fontStyle', 'font-style': 'fontStyle', fontvariant: 'fontVariant', 'font-variant': 'fontVariant', fontweight: 'fontWeight', 'font-weight': 'fontWeight', format: 'format', from: 'from', fx: 'fx', fy: 'fy', g1: 'g1', g2: 'g2', glyphname: 'glyphName', 'glyph-name': 'glyphName', glyphorientationhorizontal: 'glyphOrientationHorizontal', 'glyph-orientation-horizontal': 'glyphOrientationHorizontal', glyphorientationvertical: 'glyphOrientationVertical', 'glyph-orientation-vertical': 'glyphOrientationVertical', glyphref: 'glyphRef', gradienttransform: 'gradientTransform', gradientunits: 'gradientUnits', hanging: 'hanging', horizadvx: 'horizAdvX', 'horiz-adv-x': 'horizAdvX', horizoriginx: 'horizOriginX', 'horiz-origin-x': 'horizOriginX', ideographic: 'ideographic', imagerendering: 'imageRendering', 'image-rendering': 'imageRendering', in2: 'in2', in: 'in', inlist: 'inlist', intercept: 'intercept', k1: 'k1', k2: 'k2', k3: 'k3', k4: 'k4', k: 'k', kernelmatrix: 'kernelMatrix', kernelunitlength: 'kernelUnitLength', kerning: 'kerning', keypoints: 'keyPoints', keysplines: 'keySplines', keytimes: 'keyTimes', lengthadjust: 'lengthAdjust', letterspacing: 'letterSpacing', 'letter-spacing': 'letterSpacing', lightingcolor: 'lightingColor', 'lighting-color': 'lightingColor', limitingconeangle: 'limitingConeAngle', local: 'local', markerend: 'markerEnd', 'marker-end': 'markerEnd', markerheight: 'markerHeight', markermid: 'markerMid', 'marker-mid': 'markerMid', markerstart: 'markerStart', 'marker-start': 'markerStart', markerunits: 'markerUnits', markerwidth: 'markerWidth', mask: 'mask', maskcontentunits: 'maskContentUnits', maskunits: 'maskUnits', mathematical: 'mathematical', mode: 'mode', numoctaves: 'numOctaves', offset: 'offset', opacity: 'opacity', operator: 'operator', order: 'order', orient: 'orient', orientation: 'orientation', origin: 'origin', overflow: 'overflow', overlineposition: 'overlinePosition', 'overline-position': 'overlinePosition', overlinethickness: 'overlineThickness', 'overline-thickness': 'overlineThickness', paintorder: 'paintOrder', 'paint-order': 'paintOrder', panose1: 'panose1', 'panose-1': 'panose1', pathlength: 'pathLength', patterncontentunits: 'patternContentUnits', patterntransform: 'patternTransform', patternunits: 'patternUnits', pointerevents: 'pointerEvents', 'pointer-events': 'pointerEvents', points: 'points', pointsatx: 'pointsAtX', pointsaty: 'pointsAtY', pointsatz: 'pointsAtZ', prefix: 'prefix', preservealpha: 'preserveAlpha', preserveaspectratio: 'preserveAspectRatio', primitiveunits: 'primitiveUnits', property: 'property', r: 'r', radius: 'radius', refx: 'refX', refy: 'refY', renderingintent: 'renderingIntent', 'rendering-intent': 'renderingIntent', repeatcount: 'repeatCount', repeatdur: 'repeatDur', requiredextensions: 'requiredExtensions', requiredfeatures: 'requiredFeatures', resource: 'resource', restart: 'restart', result: 'result', results: 'results', rotate: 'rotate', rx: 'rx', ry: 'ry', scale: 'scale', security: 'security', seed: 'seed', shaperendering: 'shapeRendering', 'shape-rendering': 'shapeRendering', slope: 'slope', spacing: 'spacing', specularconstant: 'specularConstant', specularexponent: 'specularExponent', speed: 'speed', spreadmethod: 'spreadMethod', startoffset: 'startOffset', stddeviation: 'stdDeviation', stemh: 'stemh', stemv: 'stemv', stitchtiles: 'stitchTiles', stopcolor: 'stopColor', 'stop-color': 'stopColor', stopopacity: 'stopOpacity', 'stop-opacity': 'stopOpacity', strikethroughposition: 'strikethroughPosition', 'strikethrough-position': 'strikethroughPosition', strikethroughthickness: 'strikethroughThickness', 'strikethrough-thickness': 'strikethroughThickness', string: 'string', stroke: 'stroke', strokedasharray: 'strokeDasharray', 'stroke-dasharray': 'strokeDasharray', strokedashoffset: 'strokeDashoffset', 'stroke-dashoffset': 'strokeDashoffset', strokelinecap: 'strokeLinecap', 'stroke-linecap': 'strokeLinecap', strokelinejoin: 'strokeLinejoin', 'stroke-linejoin': 'strokeLinejoin', strokemiterlimit: 'strokeMiterlimit', 'stroke-miterlimit': 'strokeMiterlimit', strokewidth: 'strokeWidth', 'stroke-width': 'strokeWidth', strokeopacity: 'strokeOpacity', 'stroke-opacity': 'strokeOpacity', suppresscontenteditablewarning: 'suppressContentEditableWarning', suppresshydrationwarning: 'suppressHydrationWarning', surfacescale: 'surfaceScale', systemlanguage: 'systemLanguage', tablevalues: 'tableValues', targetx: 'targetX', targety: 'targetY', textanchor: 'textAnchor', 'text-anchor': 'textAnchor', textdecoration: 'textDecoration', 'text-decoration': 'textDecoration', textlength: 'textLength', textrendering: 'textRendering', 'text-rendering': 'textRendering', to: 'to', transform: 'transform', typeof: 'typeof', u1: 'u1', u2: 'u2', underlineposition: 'underlinePosition', 'underline-position': 'underlinePosition', underlinethickness: 'underlineThickness', 'underline-thickness': 'underlineThickness', unicode: 'unicode', unicodebidi: 'unicodeBidi', 'unicode-bidi': 'unicodeBidi', unicoderange: 'unicodeRange', 'unicode-range': 'unicodeRange', unitsperem: 'unitsPerEm', 'units-per-em': 'unitsPerEm', unselectable: 'unselectable', valphabetic: 'vAlphabetic', 'v-alphabetic': 'vAlphabetic', values: 'values', vectoreffect: 'vectorEffect', 'vector-effect': 'vectorEffect', version: 'version', vertadvy: 'vertAdvY', 'vert-adv-y': 'vertAdvY', vertoriginx: 'vertOriginX', 'vert-origin-x': 'vertOriginX', vertoriginy: 'vertOriginY', 'vert-origin-y': 'vertOriginY', vhanging: 'vHanging', 'v-hanging': 'vHanging', videographic: 'vIdeographic', 'v-ideographic': 'vIdeographic', viewbox: 'viewBox', viewtarget: 'viewTarget', visibility: 'visibility', vmathematical: 'vMathematical', 'v-mathematical': 'vMathematical', vocab: 'vocab', widths: 'widths', wordspacing: 'wordSpacing', 'word-spacing': 'wordSpacing', writingmode: 'writingMode', 'writing-mode': 'writingMode', x1: 'x1', x2: 'x2', x: 'x', xchannelselector: 'xChannelSelector', xheight: 'xHeight', 'x-height': 'xHeight', xlinkactuate: 'xlinkActuate', 'xlink:actuate': 'xlinkActuate', xlinkarcrole: 'xlinkArcrole', 'xlink:arcrole': 'xlinkArcrole', xlinkhref: 'xlinkHref', 'xlink:href': 'xlinkHref', xlinkrole: 'xlinkRole', 'xlink:role': 'xlinkRole', xlinkshow: 'xlinkShow', 'xlink:show': 'xlinkShow', xlinktitle: 'xlinkTitle', 'xlink:title': 'xlinkTitle', xlinktype: 'xlinkType', 'xlink:type': 'xlinkType', xmlbase: 'xmlBase', 'xml:base': 'xmlBase', xmllang: 'xmlLang', 'xml:lang': 'xmlLang', xmlns: 'xmlns', 'xml:space': 'xmlSpace', xmlnsxlink: 'xmlnsXlink', 'xmlns:xlink': 'xmlnsXlink', xmlspace: 'xmlSpace', y1: 'y1', y2: 'y2', y: 'y', ychannelselector: 'yChannelSelector', z: 'z', zoomandpan: 'zoomAndPan' }; var ariaProperties = { 'aria-current': 0, // state 'aria-description': 0, 'aria-details': 0, 'aria-disabled': 0, // state 'aria-hidden': 0, // state 'aria-invalid': 0, // state 'aria-keyshortcuts': 0, 'aria-label': 0, 'aria-roledescription': 0, // Widget Attributes 'aria-autocomplete': 0, 'aria-checked': 0, 'aria-expanded': 0, 'aria-haspopup': 0, 'aria-level': 0, 'aria-modal': 0, 'aria-multiline': 0, 'aria-multiselectable': 0, 'aria-orientation': 0, 'aria-placeholder': 0, 'aria-pressed': 0, 'aria-readonly': 0, 'aria-required': 0, 'aria-selected': 0, 'aria-sort': 0, 'aria-valuemax': 0, 'aria-valuemin': 0, 'aria-valuenow': 0, 'aria-valuetext': 0, // Live Region Attributes 'aria-atomic': 0, 'aria-busy': 0, 'aria-live': 0, 'aria-relevant': 0, // Drag-and-Drop Attributes 'aria-dropeffect': 0, 'aria-grabbed': 0, // Relationship Attributes 'aria-activedescendant': 0, 'aria-colcount': 0, 'aria-colindex': 0, 'aria-colspan': 0, 'aria-controls': 0, 'aria-describedby': 0, 'aria-errormessage': 0, 'aria-flowto': 0, 'aria-labelledby': 0, 'aria-owns': 0, 'aria-posinset': 0, 'aria-rowcount': 0, 'aria-rowindex': 0, 'aria-rowspan': 0, 'aria-setsize': 0 }; var warnedProperties = {}; var rARIA = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$'); var rARIACamel = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$'); function validateProperty(tagName, name) { { if (hasOwnProperty.call(warnedProperties, name) && warnedProperties[name]) { return true; } if (rARIACamel.test(name)) { var ariaName = 'aria-' + name.slice(4).toLowerCase(); var correctName = ariaProperties.hasOwnProperty(ariaName) ? ariaName : null; // If this is an aria-* attribute, but is not listed in the known DOM // DOM properties, then it is an invalid aria-* attribute. if (correctName == null) { error('Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.', name); warnedProperties[name] = true; return true; } // aria-* attributes should be lowercase; suggest the lowercase version. if (name !== correctName) { error('Invalid ARIA attribute `%s`. Did you mean `%s`?', name, correctName); warnedProperties[name] = true; return true; } } if (rARIA.test(name)) { var lowerCasedName = name.toLowerCase(); var standardName = ariaProperties.hasOwnProperty(lowerCasedName) ? lowerCasedName : null; // If this is an aria-* attribute, but is not listed in the known DOM // DOM properties, then it is an invalid aria-* attribute. if (standardName == null) { warnedProperties[name] = true; return false; } // aria-* attributes should be lowercase; suggest the lowercase version. if (name !== standardName) { error('Unknown ARIA attribute `%s`. Did you mean `%s`?', name, standardName); warnedProperties[name] = true; return true; } } } return true; } function warnInvalidARIAProps(type, props) { { var invalidProps = []; for (var key in props) { var isValid = validateProperty(type, key); if (!isValid) { invalidProps.push(key); } } var unknownPropString = invalidProps.map(function (prop) { return '`' + prop + '`'; }).join(', '); if (invalidProps.length === 1) { error('Invalid aria prop %s on <%s> tag. ' + 'For details, see https://reactjs.org/link/invalid-aria-props', unknownPropString, type); } else if (invalidProps.length > 1) { error('Invalid aria props %s on <%s> tag. ' + 'For details, see https://reactjs.org/link/invalid-aria-props', unknownPropString, type); } } } function validateProperties(type, props) { if (isCustomComponent(type, props)) { return; } warnInvalidARIAProps(type, props); } var didWarnValueNull = false; function validateProperties$1(type, props) { { if (type !== 'input' && type !== 'textarea' && type !== 'select') { return; } if (props != null && props.value === null && !didWarnValueNull) { didWarnValueNull = true; if (type === 'select' && props.multiple) { error('`value` prop on `%s` should not be null. ' + 'Consider using an empty array when `multiple` is set to `true` ' + 'to clear the component or `undefined` for uncontrolled components.', type); } else { error('`value` prop on `%s` should not be null. ' + 'Consider using an empty string to clear the component or `undefined` ' + 'for uncontrolled components.', type); } } } } var validateProperty$1 = function () {}; { var warnedProperties$1 = {}; var EVENT_NAME_REGEX = /^on./; var INVALID_EVENT_NAME_REGEX = /^on[^A-Z]/; var rARIA$1 = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$'); var rARIACamel$1 = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$'); validateProperty$1 = function (tagName, name, value, eventRegistry) { if (hasOwnProperty.call(warnedProperties$1, name) && warnedProperties$1[name]) { return true; } var lowerCasedName = name.toLowerCase(); if (lowerCasedName === 'onfocusin' || lowerCasedName === 'onfocusout') { error('React uses onFocus and onBlur instead of onFocusIn and onFocusOut. ' + 'All React events are normalized to bubble, so onFocusIn and onFocusOut ' + 'are not needed/supported by React.'); warnedProperties$1[name] = true; return true; } // We can't rely on the event system being injected on the server. if (eventRegistry != null) { var registrationNameDependencies = eventRegistry.registrationNameDependencies, possibleRegistrationNames = eventRegistry.possibleRegistrationNames; if (registrationNameDependencies.hasOwnProperty(name)) { return true; } var registrationName = possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? possibleRegistrationNames[lowerCasedName] : null; if (registrationName != null) { error('Invalid event handler property `%s`. Did you mean `%s`?', name, registrationName); warnedProperties$1[name] = true; return true; } if (EVENT_NAME_REGEX.test(name)) { error('Unknown event handler property `%s`. It will be ignored.', name); warnedProperties$1[name] = true; return true; } } else if (EVENT_NAME_REGEX.test(name)) { // If no event plugins have been injected, we are in a server environment. // So we can't tell if the event name is correct for sure, but we can filter // out known bad ones like `onclick`. We can't suggest a specific replacement though. if (INVALID_EVENT_NAME_REGEX.test(name)) { error('Invalid event handler property `%s`. ' + 'React events use the camelCase naming convention, for example `onClick`.', name); } warnedProperties$1[name] = true; return true; } // Let the ARIA attribute hook validate ARIA attributes if (rARIA$1.test(name) || rARIACamel$1.test(name)) { return true; } if (lowerCasedName === 'innerhtml') { error('Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.'); warnedProperties$1[name] = true; return true; } if (lowerCasedName === 'aria') { error('The `aria` attribute is reserved for future use in React. ' + 'Pass individual `aria-` attributes instead.'); warnedProperties$1[name] = true; return true; } if (lowerCasedName === 'is' && value !== null && value !== undefined && typeof value !== 'string') { error('Received a `%s` for a string attribute `is`. If this is expected, cast ' + 'the value to a string.', typeof value); warnedProperties$1[name] = true; return true; } if (typeof value === 'number' && isNaN(value)) { error('Received NaN for the `%s` attribute. If this is expected, cast ' + 'the value to a string.', name); warnedProperties$1[name] = true; return true; } var propertyInfo = getPropertyInfo(name); var isReserved = propertyInfo !== null && propertyInfo.type === RESERVED; // Known attributes should match the casing specified in the property config. if (possibleStandardNames.hasOwnProperty(lowerCasedName)) { var standardName = possibleStandardNames[lowerCasedName]; if (standardName !== name) { error('Invalid DOM property `%s`. Did you mean `%s`?', name, standardName); warnedProperties$1[name] = true; return true; } } else if (!isReserved && name !== lowerCasedName) { // Unknown attributes should have lowercase casing since that's how they // will be cased anyway with server rendering. error('React does not recognize the `%s` prop on a DOM element. If you ' + 'intentionally want it to appear in the DOM as a custom ' + 'attribute, spell it as lowercase `%s` instead. ' + 'If you accidentally passed it from a parent component, remove ' + 'it from the DOM element.', name, lowerCasedName); warnedProperties$1[name] = true; return true; } if (typeof value === 'boolean' && shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) { if (value) { error('Received `%s` for a non-boolean attribute `%s`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s="%s" or %s={value.toString()}.', value, name, name, value, name); } else { error('Received `%s` for a non-boolean attribute `%s`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s="%s" or %s={value.toString()}.\n\n' + 'If you used to conditionally omit it with %s={condition && value}, ' + 'pass %s={condition ? value : undefined} instead.', value, name, name, value, name, name, name); } warnedProperties$1[name] = true; return true; } // Now that we've validated casing, do not validate // data types for reserved props if (isReserved) { return true; } // Warn when a known attribute is a bad type if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) { warnedProperties$1[name] = true; return false; } // Warn when passing the strings 'false' or 'true' into a boolean prop if ((value === 'false' || value === 'true') && propertyInfo !== null && propertyInfo.type === BOOLEAN) { error('Received the string `%s` for the boolean attribute `%s`. ' + '%s ' + 'Did you mean %s={%s}?', value, name, value === 'false' ? 'The browser will interpret it as a truthy value.' : 'Although this works, it will not work as expected if you pass the string "false".', name, value); warnedProperties$1[name] = true; return true; } return true; }; } var warnUnknownProperties = function (type, props, eventRegistry) { { var unknownProps = []; for (var key in props) { var isValid = validateProperty$1(type, key, props[key], eventRegistry); if (!isValid) { unknownProps.push(key); } } var unknownPropString = unknownProps.map(function (prop) { return '`' + prop + '`'; }).join(', '); if (unknownProps.length === 1) { error('Invalid value for prop %s on <%s> tag. Either remove it from the element, ' + 'or pass a string or number value to keep it in the DOM. ' + 'For details, see https://reactjs.org/link/attribute-behavior ', unknownPropString, type); } else if (unknownProps.length > 1) { error('Invalid values for props %s on <%s> tag. Either remove them from the element, ' + 'or pass a string or number value to keep them in the DOM. ' + 'For details, see https://reactjs.org/link/attribute-behavior ', unknownPropString, type); } } }; function validateProperties$2(type, props, eventRegistry) { if (isCustomComponent(type, props)) { return; } warnUnknownProperties(type, props, eventRegistry); } var IS_EVENT_HANDLE_NON_MANAGED_NODE = 1; var IS_NON_DELEGATED = 1 << 1; var IS_CAPTURE_PHASE = 1 << 2; // set to LEGACY_FB_SUPPORT. LEGACY_FB_SUPPORT only gets set when // we call willDeferLaterForLegacyFBSupport, thus not bailing out // will result in endless cycles like an infinite loop. // We also don't want to defer during event replaying. var SHOULD_NOT_PROCESS_POLYFILL_EVENT_PLUGINS = IS_EVENT_HANDLE_NON_MANAGED_NODE | IS_NON_DELEGATED | IS_CAPTURE_PHASE; // This exists to avoid circular dependency between ReactDOMEventReplaying // and DOMPluginEventSystem. var currentReplayingEvent = null; function setReplayingEvent(event) { { if (currentReplayingEvent !== null) { error('Expected currently replaying event to be null. This error ' + 'is likely caused by a bug in React. Please file an issue.'); } } currentReplayingEvent = event; } function resetReplayingEvent() { { if (currentReplayingEvent === null) { error('Expected currently replaying event to not be null. This error ' + 'is likely caused by a bug in React. Please file an issue.'); } } currentReplayingEvent = null; } function isReplayingEvent(event) { return event === currentReplayingEvent; } /** * Gets the target node from a native browser event by accounting for * inconsistencies in browser DOM APIs. * * @param {object} nativeEvent Native browser event. * @return {DOMEventTarget} Target node. */ function getEventTarget(nativeEvent) { // Fallback to nativeEvent.srcElement for IE9 // https://github.com/facebook/react/issues/12506 var target = nativeEvent.target || nativeEvent.srcElement || window; // Normalize SVG <use> element events #4963 if (target.correspondingUseElement) { target = target.correspondingUseElement; } // Safari may fire events on text nodes (Node.TEXT_NODE is 3). // @see http://www.quirksmode.org/js/events_properties.html return target.nodeType === TEXT_NODE ? target.parentNode : target; } var restoreImpl = null; var restoreTarget = null; var restoreQueue = null; function restoreStateOfTarget(target) { // We perform this translation at the end of the event loop so that we // always receive the correct fiber here var internalInstance = getInstanceFromNode(target); if (!internalInstance) { // Unmounted return; } if (typeof restoreImpl !== 'function') { throw new Error('setRestoreImplementation() needs to be called to handle a target for controlled ' + 'events. This error is likely caused by a bug in React. Please file an issue.'); } var stateNode = internalInstance.stateNode; // Guard against Fiber being unmounted. if (stateNode) { var _props = getFiberCurrentPropsFromNode(stateNode); restoreImpl(internalInstance.stateNode, internalInstance.type, _props); } } function setRestoreImplementation(impl) { restoreImpl = impl; } function enqueueStateRestore(target) { if (restoreTarget) { if (restoreQueue) { restoreQueue.push(target); } else { restoreQueue = [target]; } } else { restoreTarget = target; } } function needsStateRestore() { return restoreTarget !== null || restoreQueue !== null; } function restoreStateIfNeeded() { if (!restoreTarget) { return; } var target = restoreTarget; var queuedTargets = restoreQueue; restoreTarget = null; restoreQueue = null; restoreStateOfTarget(target); if (queuedTargets) { for (var i = 0; i < queuedTargets.length; i++) { restoreStateOfTarget(queuedTargets[i]); } } } // the renderer. Such as when we're dispatching events or if third party // libraries need to call batchedUpdates. Eventually, this API will go away when // everything is batched by default. We'll then have a similar API to opt-out of // scheduled work and instead do synchronous work. // Defaults var batchedUpdatesImpl = function (fn, bookkeeping) { return fn(bookkeeping); }; var flushSyncImpl = function () {}; var isInsideEventHandler = false; function finishEventHandler() { // Here we wait until all updates have propagated, which is important // when using controlled components within layers: // https://github.com/facebook/react/issues/1698 // Then we restore state of any controlled component. var controlledComponentsHavePendingUpdates = needsStateRestore(); if (controlledComponentsHavePendingUpdates) { // If a controlled event was fired, we may need to restore the state of // the DOM node back to the controlled value. This is necessary when React // bails out of the update without touching the DOM. // TODO: Restore state in the microtask, after the discrete updates flush, // instead of early flushing them here. flushSyncImpl(); restoreStateIfNeeded(); } } function batchedUpdates(fn, a, b) { if (isInsideEventHandler) { // If we are currently inside another batch, we need to wait until it // fully completes before restoring state. return fn(a, b); } isInsideEventHandler = true; try { return batchedUpdatesImpl(fn, a, b); } finally { isInsideEventHandler = false; finishEventHandler(); } } // TODO: Replace with flushSync function setBatchingImplementation(_batchedUpdatesImpl, _discreteUpdatesImpl, _flushSyncImpl) { batchedUpdatesImpl = _batchedUpdatesImpl; flushSyncImpl = _flushSyncImpl; } function isInteractive(tag) { return tag === 'button' || tag === 'input' || tag === 'select' || tag === 'textarea'; } function shouldPreventMouseEvent(name, type, props) { switch (name) { case 'onClick': case 'onClickCapture': case 'onDoubleClick': case 'onDoubleClickCapture': case 'onMouseDown': case 'onMouseDownCapture': case 'onMouseMove': case 'onMouseMoveCapture': case 'onMouseUp': case 'onMouseUpCapture': case 'onMouseEnter': return !!(props.disabled && isInteractive(type)); default: return false; } } /** * @param {object} inst The instance, which is the source of events. * @param {string} registrationName Name of listener (e.g. `onClick`). * @return {?function} The stored callback. */ function getListener(inst, registrationName) { var stateNode = inst.stateNode; if (stateNode === null) { // Work in progress (ex: onload events in incremental mode). return null; } var props = getFiberCurrentPropsFromNode(stateNode); if (props === null) { // Work in progress. return null; } var listener = props[registrationName]; if (shouldPreventMouseEvent(registrationName, inst.type, props)) { return null; } if (listener && typeof listener !== 'function') { throw new Error("Expected `" + registrationName + "` listener to be a function, instead got a value of `" + typeof listener + "` type."); } return listener; } var passiveBrowserEventsSupported = false; // Check if browser support events with passive listeners // https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support if (canUseDOM) { try { var options = {}; // $FlowFixMe: Ignore Flow complaining about needing a value Object.defineProperty(options, 'passive', { get: function () { passiveBrowserEventsSupported = true; } }); window.addEventListener('test', options, options); window.removeEventListener('test', options, options); } catch (e) { passiveBrowserEventsSupported = false; } } function invokeGuardedCallbackProd(name, func, context, a, b, c, d, e, f) { var funcArgs = Array.prototype.slice.call(arguments, 3); try { func.apply(context, funcArgs); } catch (error) { this.onError(error); } } var invokeGuardedCallbackImpl = invokeGuardedCallbackProd; { // In DEV mode, we swap out invokeGuardedCallback for a special version // that plays more nicely with the browser's DevTools. The idea is to preserve // "Pause on exceptions" behavior. Because React wraps all user-provided // functions in invokeGuardedCallback, and the production version of // invokeGuardedCallback uses a try-catch, all user exceptions are treated // like caught exceptions, and the DevTools won't pause unless the developer // takes the extra step of enabling pause on caught exceptions. This is // unintuitive, though, because even though React has caught the error, from // the developer's perspective, the error is uncaught. // // To preserve the expected "Pause on exceptions" behavior, we don't use a // try-catch in DEV. Instead, we synchronously dispatch a fake event to a fake // DOM node, and call the user-provided callback from inside an event handler // for that fake event. If the callback throws, the error is "captured" using // a global event handler. But because the error happens in a different // event loop context, it does not interrupt the normal program flow. // Effectively, this gives us try-catch behavior without actually using // try-catch. Neat! // Check that the browser supports the APIs we need to implement our special // DEV version of invokeGuardedCallback if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') { var fakeNode = document.createElement('react'); invokeGuardedCallbackImpl = function invokeGuardedCallbackDev(name, func, context, a, b, c, d, e, f) { // If document doesn't exist we know for sure we will crash in this method // when we call document.createEvent(). However this can cause confusing // errors: https://github.com/facebook/create-react-app/issues/3482 // So we preemptively throw with a better message instead. if (typeof document === 'undefined' || document === null) { throw new Error('The `document` global was defined when React was initialized, but is not ' + 'defined anymore. This can happen in a test environment if a component ' + 'schedules an update from an asynchronous callback, but the test has already ' + 'finished running. To solve this, you can either unmount the component at ' + 'the end of your test (and ensure that any asynchronous operations get ' + 'canceled in `componentWillUnmount`), or you can change the test itself ' + 'to be asynchronous.'); } var evt = document.createEvent('Event'); var didCall = false; // Keeps track of whether the user-provided callback threw an error. We // set this to true at the beginning, then set it to false right after // calling the function. If the function errors, `didError` will never be // set to false. This strategy works even if the browser is flaky and // fails to call our global error handler, because it doesn't rely on // the error event at all. var didError = true; // Keeps track of the value of window.event so that we can reset it // during the callback to let user code access window.event in the // browsers that support it. var windowEvent = window.event; // Keeps track of the descriptor of window.event to restore it after event // dispatching: https://github.com/facebook/react/issues/13688 var windowEventDescriptor = Object.getOwnPropertyDescriptor(window, 'event'); function restoreAfterDispatch() { // We immediately remove the callback from event listeners so that // nested `invokeGuardedCallback` calls do not clash. Otherwise, a // nested call would trigger the fake event handlers of any call higher // in the stack. fakeNode.removeEventListener(evtType, callCallback, false); // We check for window.hasOwnProperty('event') to prevent the // window.event assignment in both IE <= 10 as they throw an error // "Member not found" in strict mode, and in Firefox which does not // support window.event. if (typeof window.event !== 'undefined' && window.hasOwnProperty('event')) { window.event = windowEvent; } } // Create an event handler for our fake event. We will synchronously // dispatch our fake event using `dispatchEvent`. Inside the handler, we // call the user-provided callback. var funcArgs = Array.prototype.slice.call(arguments, 3); function callCallback() { didCall = true; restoreAfterDispatch(); func.apply(context, funcArgs); didError = false; } // Create a global error event handler. We use this to capture the value // that was thrown. It's possible that this error handler will fire more // than once; for example, if non-React code also calls `dispatchEvent` // and a handler for that event throws. We should be resilient to most of // those cases. Even if our error event handler fires more than once, the // last error event is always used. If the callback actually does error, // we know that the last error event is the correct one, because it's not // possible for anything else to have happened in between our callback // erroring and the code that follows the `dispatchEvent` call below. If // the callback doesn't error, but the error event was fired, we know to // ignore it because `didError` will be false, as described above. var error; // Use this to track whether the error event is ever called. var didSetError = false; var isCrossOriginError = false; function handleWindowError(event) { error = event.error; didSetError = true; if (error === null && event.colno === 0 && event.lineno === 0) { isCrossOriginError = true; } if (event.defaultPrevented) { // Some other error handler has prevented default. // Browsers silence the error report if this happens. // We'll remember this to later decide whether to log it or not. if (error != null && typeof error === 'object') { try { error._suppressLogging = true; } catch (inner) {// Ignore. } } } } // Create a fake event type. var evtType = "react-" + (name ? name : 'invokeguardedcallback'); // Attach our event handlers window.addEventListener('error', handleWindowError); fakeNode.addEventListener(evtType, callCallback, false); // Synchronously dispatch our fake event. If the user-provided function // errors, it will trigger our global error handler. evt.initEvent(evtType, false, false); fakeNode.dispatchEvent(evt); if (windowEventDescriptor) { Object.defineProperty(window, 'event', windowEventDescriptor); } if (didCall && didError) { if (!didSetError) { // The callback errored, but the error event never fired. // eslint-disable-next-line react-internal/prod-error-codes error = new Error('An error was thrown inside one of your components, but React ' + "doesn't know what it was. This is likely due to browser " + 'flakiness. React does its best to preserve the "Pause on ' + 'exceptions" behavior of the DevTools, which requires some ' + "DEV-mode only tricks. It's possible that these don't work in " + 'your browser. Try triggering the error in production mode, ' + 'or switching to a modern browser. If you suspect that this is ' + 'actually an issue with React, please file an issue.'); } else if (isCrossOriginError) { // eslint-disable-next-line react-internal/prod-error-codes error = new Error("A cross-origin error was thrown. React doesn't have access to " + 'the actual error object in development. ' + 'See https://reactjs.org/link/crossorigin-error for more information.'); } this.onError(error); } // Remove our event listeners window.removeEventListener('error', handleWindowError); if (!didCall) { // Something went really wrong, and our event was not dispatched. // https://github.com/facebook/react/issues/16734 // https://github.com/facebook/react/issues/16585 // Fall back to the production implementation. restoreAfterDispatch(); return invokeGuardedCallbackProd.apply(this, arguments); } }; } } var invokeGuardedCallbackImpl$1 = invokeGuardedCallbackImpl; var hasError = false; var caughtError = null; // Used by event system to capture/rethrow the first error. var hasRethrowError = false; var rethrowError = null; var reporter = { onError: function (error) { hasError = true; caughtError = error; } }; /** * Call a function while guarding against errors that happens within it. * Returns an error if it throws, otherwise null. * * In production, this is implemented using a try-catch. The reason we don't * use a try-catch directly is so that we can swap out a different * implementation in DEV mode. * * @param {String} name of the guard to use for logging or debugging * @param {Function} func The function to invoke * @param {*} context The context to use when calling the function * @param {...*} args Arguments for function */ function invokeGuardedCallback(name, func, context, a, b, c, d, e, f) { hasError = false; caughtError = null; invokeGuardedCallbackImpl$1.apply(reporter, arguments); } /** * Same as invokeGuardedCallback, but instead of returning an error, it stores * it in a global so it can be rethrown by `rethrowCaughtError` later. * TODO: See if caughtError and rethrowError can be unified. * * @param {String} name of the guard to use for logging or debugging * @param {Function} func The function to invoke * @param {*} context The context to use when calling the function * @param {...*} args Arguments for function */ function invokeGuardedCallbackAndCatchFirstError(name, func, context, a, b, c, d, e, f) { invokeGuardedCallback.apply(this, arguments); if (hasError) { var error = clearCaughtError(); if (!hasRethrowError) { hasRethrowError = true; rethrowError = error; } } } /** * During execution of guarded functions we will capture the first error which * we will rethrow to be handled by the top level error handler. */ function rethrowCaughtError() { if (hasRethrowError) { var error = rethrowError; hasRethrowError = false; rethrowError = null; throw error; } } function hasCaughtError() { return hasError; } function clearCaughtError() { if (hasError) { var error = caughtError; hasError = false; caughtError = null; return error; } else { throw new Error('clearCaughtError was called but no error was captured. This error ' + 'is likely caused by a bug in React. Please file an issue.'); } } var ReactInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; var _ReactInternals$Sched = ReactInternals.Scheduler, unstable_cancelCallback = _ReactInternals$Sched.unstable_cancelCallback, unstable_now = _ReactInternals$Sched.unstable_now, unstable_scheduleCallback = _ReactInternals$Sched.unstable_scheduleCallback, unstable_shouldYield = _ReactInternals$Sched.unstable_shouldYield, unstable_requestPaint = _ReactInternals$Sched.unstable_requestPaint, unstable_getFirstCallbackNode = _ReactInternals$Sched.unstable_getFirstCallbackNode, unstable_runWithPriority = _ReactInternals$Sched.unstable_runWithPriority, unstable_next = _ReactInternals$Sched.unstable_next, unstable_continueExecution = _ReactInternals$Sched.unstable_continueExecution, unstable_pauseExecution = _ReactInternals$Sched.unstable_pauseExecution, unstable_getCurrentPriorityLevel = _ReactInternals$Sched.unstable_getCurrentPriorityLevel, unstable_ImmediatePriority = _ReactInternals$Sched.unstable_ImmediatePriority, unstable_UserBlockingPriority = _ReactInternals$Sched.unstable_UserBlockingPriority, unstable_NormalPriority = _ReactInternals$Sched.unstable_NormalPriority, unstable_LowPriority = _ReactInternals$Sched.unstable_LowPriority, unstable_IdlePriority = _ReactInternals$Sched.unstable_IdlePriority, unstable_forceFrameRate = _ReactInternals$Sched.unstable_forceFrameRate, unstable_flushAllWithoutAsserting = _ReactInternals$Sched.unstable_flushAllWithoutAsserting, unstable_yieldValue = _ReactInternals$Sched.unstable_yieldValue, unstable_setDisableYieldValue = _ReactInternals$Sched.unstable_setDisableYieldValue; /** * `ReactInstanceMap` maintains a mapping from a public facing stateful * instance (key) and the internal representation (value). This allows public * methods to accept the user facing instance as an argument and map them back * to internal methods. * * Note that this module is currently shared and assumed to be stateless. * If this becomes an actual Map, that will break. */ function get(key) { return key._reactInternals; } function has(key) { return key._reactInternals !== undefined; } function set(key, value) { key._reactInternals = value; } // Don't change these two values. They're used by React Dev Tools. var NoFlags = /* */ 0; var PerformedWork = /* */ 1; // You can change the rest (and add more). var Placement = /* */ 2; var Update = /* */ 4; var ChildDeletion = /* */ 16; var ContentReset = /* */ 32; var Callback = /* */ 64; var DidCapture = /* */ 128; var ForceClientRender = /* */ 256; var Ref = /* */ 512; var Snapshot = /* */ 1024; var Passive = /* */ 2048; var Hydrating = /* */ 4096; var Visibility = /* */ 8192; var StoreConsistency = /* */ 16384; var LifecycleEffectMask = Passive | Update | Callback | Ref | Snapshot | StoreConsistency; // Union of all commit flags (flags with the lifetime of a particular commit) var HostEffectMask = /* */ 32767; // These are not really side effects, but we still reuse this field. var Incomplete = /* */ 32768; var ShouldCapture = /* */ 65536; var ForceUpdateForLegacySuspense = /* */ 131072; var Forked = /* */ 1048576; // Static tags describe aspects of a fiber that are not specific to a render, // e.g. a fiber uses a passive effect (even if there are no updates on this particular render). // This enables us to defer more work in the unmount case, // since we can defer traversing the tree during layout to look for Passive effects, // and instead rely on the static flag as a signal that there may be cleanup work. var RefStatic = /* */ 2097152; var LayoutStatic = /* */ 4194304; var PassiveStatic = /* */ 8388608; // These flags allow us to traverse to fibers that have effects on mount // without traversing the entire tree after every commit for // double invoking var MountLayoutDev = /* */ 16777216; var MountPassiveDev = /* */ 33554432; // Groups of flags that are used in the commit phase to skip over trees that // don't contain effects, by checking subtreeFlags. var BeforeMutationMask = // TODO: Remove Update flag from before mutation phase by re-landing Visibility // flag logic (see #20043) Update | Snapshot | ( 0); var MutationMask = Placement | Update | ChildDeletion | ContentReset | Ref | Hydrating | Visibility; var LayoutMask = Update | Callback | Ref | Visibility; // TODO: Split into PassiveMountMask and PassiveUnmountMask var PassiveMask = Passive | ChildDeletion; // Union of tags that don't get reset on clones. // This allows certain concepts to persist without recalculating them, // e.g. whether a subtree contains passive effects or portals. var StaticMask = LayoutStatic | PassiveStatic | RefStatic; var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner; function getNearestMountedFiber(fiber) { var node = fiber; var nearestMounted = fiber; if (!fiber.alternate) { // If there is no alternate, this might be a new tree that isn't inserted // yet. If it is, then it will have a pending insertion effect on it. var nextNode = node; do { node = nextNode; if ((node.flags & (Placement | Hydrating)) !== NoFlags) { // This is an insertion or in-progress hydration. The nearest possible // mounted fiber is the parent but we need to continue to figure out // if that one is still mounted. nearestMounted = node.return; } nextNode = node.return; } while (nextNode); } else { while (node.return) { node = node.return; } } if (node.tag === HostRoot) { // TODO: Check if this was a nested HostRoot when used with // renderContainerIntoSubtree. return nearestMounted; } // If we didn't hit the root, that means that we're in an disconnected tree // that has been unmounted. return null; } function getSuspenseInstanceFromFiber(fiber) { if (fiber.tag === SuspenseComponent) { var suspenseState = fiber.memoizedState; if (suspenseState === null) { var current = fiber.alternate; if (current !== null) { suspenseState = current.memoizedState; } } if (suspenseState !== null) { return suspenseState.dehydrated; } } return null; } function getContainerFromFiber(fiber) { return fiber.tag === HostRoot ? fiber.stateNode.containerInfo : null; } function isFiberMounted(fiber) { return getNearestMountedFiber(fiber) === fiber; } function isMounted(component) { { var owner = ReactCurrentOwner.current; if (owner !== null && owner.tag === ClassComponent) { var ownerFiber = owner; var instance = ownerFiber.stateNode; if (!instance._warnedAboutRefsInRender) { error('%s is accessing isMounted inside its render() function. ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', getComponentNameFromFiber(ownerFiber) || 'A component'); } instance._warnedAboutRefsInRender = true; } } var fiber = get(component); if (!fiber) { return false; } return getNearestMountedFiber(fiber) === fiber; } function assertIsMounted(fiber) { if (getNearestMountedFiber(fiber) !== fiber) { throw new Error('Unable to find node on an unmounted component.'); } } function findCurrentFiberUsingSlowPath(fiber) { var alternate = fiber.alternate; if (!alternate) { // If there is no alternate, then we only need to check if it is mounted. var nearestMounted = getNearestMountedFiber(fiber); if (nearestMounted === null) { throw new Error('Unable to find node on an unmounted component.'); } if (nearestMounted !== fiber) { return null; } return fiber; } // If we have two possible branches, we'll walk backwards up to the root // to see what path the root points to. On the way we may hit one of the // special cases and we'll deal with them. var a = fiber; var b = alternate; while (true) { var parentA = a.return; if (parentA === null) { // We're at the root. break; } var parentB = parentA.alternate; if (parentB === null) { // There is no alternate. This is an unusual case. Currently, it only // happens when a Suspense component is hidden. An extra fragment fiber // is inserted in between the Suspense fiber and its children. Skip // over this extra fragment fiber and proceed to the next parent. var nextParent = parentA.return; if (nextParent !== null) { a = b = nextParent; continue; } // If there's no parent, we're at the root. break; } // If both copies of the parent fiber point to the same child, we can // assume that the child is current. This happens when we bailout on low // priority: the bailed out fiber's child reuses the current child. if (parentA.child === parentB.child) { var child = parentA.child; while (child) { if (child === a) { // We've determined that A is the current branch. assertIsMounted(parentA); return fiber; } if (child === b) { // We've determined that B is the current branch. assertIsMounted(parentA); return alternate; } child = child.sibling; } // We should never have an alternate for any mounting node. So the only // way this could possibly happen is if this was unmounted, if at all. throw new Error('Unable to find node on an unmounted component.'); } if (a.return !== b.return) { // The return pointer of A and the return pointer of B point to different // fibers. We assume that return pointers never criss-cross, so A must // belong to the child set of A.return, and B must belong to the child // set of B.return. a = parentA; b = parentB; } else { // The return pointers point to the same fiber. We'll have to use the // default, slow path: scan the child sets of each parent alternate to see // which child belongs to which set. // // Search parent A's child set var didFindChild = false; var _child = parentA.child; while (_child) { if (_child === a) { didFindChild = true; a = parentA; b = parentB; break; } if (_child === b) { didFindChild = true; b = parentA; a = parentB; break; } _child = _child.sibling; } if (!didFindChild) { // Search parent B's child set _child = parentB.child; while (_child) { if (_child === a) { didFindChild = true; a = parentB; b = parentA; break; } if (_child === b) { didFindChild = true; b = parentB; a = parentA; break; } _child = _child.sibling; } if (!didFindChild) { throw new Error('Child was not found in either parent set. This indicates a bug ' + 'in React related to the return pointer. Please file an issue.'); } } } if (a.alternate !== b) { throw new Error("Return fibers should always be each others' alternates. " + 'This error is likely caused by a bug in React. Please file an issue.'); } } // If the root is not a host container, we're in a disconnected tree. I.e. // unmounted. if (a.tag !== HostRoot) { throw new Error('Unable to find node on an unmounted component.'); } if (a.stateNode.current === a) { // We've determined that A is the current branch. return fiber; } // Otherwise B has to be current branch. return alternate; } function findCurrentHostFiber(parent) { var currentParent = findCurrentFiberUsingSlowPath(parent); return currentParent !== null ? findCurrentHostFiberImpl(currentParent) : null; } function findCurrentHostFiberImpl(node) { // Next we'll drill down this component to find the first HostComponent/Text. if (node.tag === HostComponent || node.tag === HostText) { return node; } var child = node.child; while (child !== null) { var match = findCurrentHostFiberImpl(child); if (match !== null) { return match; } child = child.sibling; } return null; } function findCurrentHostFiberWithNoPortals(parent) { var currentParent = findCurrentFiberUsingSlowPath(parent); return currentParent !== null ? findCurrentHostFiberWithNoPortalsImpl(currentParent) : null; } function findCurrentHostFiberWithNoPortalsImpl(node) { // Next we'll drill down this component to find the first HostComponent/Text. if (node.tag === HostComponent || node.tag === HostText) { return node; } var child = node.child; while (child !== null) { if (child.tag !== HostPortal) { var match = findCurrentHostFiberWithNoPortalsImpl(child); if (match !== null) { return match; } } child = child.sibling; } return null; } // This module only exists as an ESM wrapper around the external CommonJS var scheduleCallback = unstable_scheduleCallback; var cancelCallback = unstable_cancelCallback; var shouldYield = unstable_shouldYield; var requestPaint = unstable_requestPaint; var now = unstable_now; var getCurrentPriorityLevel = unstable_getCurrentPriorityLevel; var ImmediatePriority = unstable_ImmediatePriority; var UserBlockingPriority = unstable_UserBlockingPriority; var NormalPriority = unstable_NormalPriority; var LowPriority = unstable_LowPriority; var IdlePriority = unstable_IdlePriority; // this doesn't actually exist on the scheduler, but it *does* // on scheduler/unstable_mock, which we'll need for internal testing var unstable_yieldValue$1 = unstable_yieldValue; var unstable_setDisableYieldValue$1 = unstable_setDisableYieldValue; var rendererID = null; var injectedHook = null; var injectedProfilingHooks = null; var hasLoggedError = false; var isDevToolsPresent = typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined'; function injectInternals(internals) { if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') { // No DevTools return false; } var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__; if (hook.isDisabled) { // This isn't a real property on the hook, but it can be set to opt out // of DevTools integration and associated warnings and logs. // https://github.com/facebook/react/issues/3877 return true; } if (!hook.supportsFiber) { { error('The installed version of React DevTools is too old and will not work ' + 'with the current version of React. Please update React DevTools. ' + 'https://reactjs.org/link/react-devtools'); } // DevTools exists, even though it doesn't support Fiber. return true; } try { if (enableSchedulingProfiler) { // Conditionally inject these hooks only if Timeline profiler is supported by this build. // This gives DevTools a way to feature detect that isn't tied to version number // (since profiling and timeline are controlled by different feature flags). internals = assign({}, internals, { getLaneLabelMap: getLaneLabelMap, injectProfilingHooks: injectProfilingHooks }); } rendererID = hook.inject(internals); // We have successfully injected, so now it is safe to set up hooks. injectedHook = hook; } catch (err) { // Catch all errors because it is unsafe to throw during initialization. { error('React instrumentation encountered an error: %s.', err); } } if (hook.checkDCE) { // This is the real DevTools. return true; } else { // This is likely a hook installed by Fast Refresh runtime. return false; } } function onScheduleRoot(root, children) { { if (injectedHook && typeof injectedHook.onScheduleFiberRoot === 'function') { try { injectedHook.onScheduleFiberRoot(rendererID, root, children); } catch (err) { if ( !hasLoggedError) { hasLoggedError = true; error('React instrumentation encountered an error: %s', err); } } } } } function onCommitRoot(root, eventPriority) { if (injectedHook && typeof injectedHook.onCommitFiberRoot === 'function') { try { var didError = (root.current.flags & DidCapture) === DidCapture; if (enableProfilerTimer) { var schedulerPriority; switch (eventPriority) { case DiscreteEventPriority: schedulerPriority = ImmediatePriority; break; case ContinuousEventPriority: schedulerPriority = UserBlockingPriority; break; case DefaultEventPriority: schedulerPriority = NormalPriority; break; case IdleEventPriority: schedulerPriority = IdlePriority; break; default: schedulerPriority = NormalPriority; break; } injectedHook.onCommitFiberRoot(rendererID, root, schedulerPriority, didError); } else { injectedHook.onCommitFiberRoot(rendererID, root, undefined, didError); } } catch (err) { { if (!hasLoggedError) { hasLoggedError = true; error('React instrumentation encountered an error: %s', err); } } } } } function onPostCommitRoot(root) { if (injectedHook && typeof injectedHook.onPostCommitFiberRoot === 'function') { try { injectedHook.onPostCommitFiberRoot(rendererID, root); } catch (err) { { if (!hasLoggedError) { hasLoggedError = true; error('React instrumentation encountered an error: %s', err); } } } } } function onCommitUnmount(fiber) { if (injectedHook && typeof injectedHook.onCommitFiberUnmount === 'function') { try { injectedHook.onCommitFiberUnmount(rendererID, fiber); } catch (err) { { if (!hasLoggedError) { hasLoggedError = true; error('React instrumentation encountered an error: %s', err); } } } } } function setIsStrictModeForDevtools(newIsStrictMode) { { if (typeof unstable_yieldValue$1 === 'function') { // We're in a test because Scheduler.unstable_yieldValue only exists // in SchedulerMock. To reduce the noise in strict mode tests, // suppress warnings and disable scheduler yielding during the double render unstable_setDisableYieldValue$1(newIsStrictMode); setSuppressWarning(newIsStrictMode); } if (injectedHook && typeof injectedHook.setStrictMode === 'function') { try { injectedHook.setStrictMode(rendererID, newIsStrictMode); } catch (err) { { if (!hasLoggedError) { hasLoggedError = true; error('React instrumentation encountered an error: %s', err); } } } } } } // Profiler API hooks function injectProfilingHooks(profilingHooks) { injectedProfilingHooks = profilingHooks; } function getLaneLabelMap() { { var map = new Map(); var lane = 1; for (var index = 0; index < TotalLanes; index++) { var label = getLabelForLane(lane); map.set(lane, label); lane *= 2; } return map; } } function markCommitStarted(lanes) { { if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markCommitStarted === 'function') { injectedProfilingHooks.markCommitStarted(lanes); } } } function markCommitStopped() { { if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markCommitStopped === 'function') { injectedProfilingHooks.markCommitStopped(); } } } function markComponentRenderStarted(fiber) { { if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentRenderStarted === 'function') { injectedProfilingHooks.markComponentRenderStarted(fiber); } } } function markComponentRenderStopped() { { if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentRenderStopped === 'function') { injectedProfilingHooks.markComponentRenderStopped(); } } } function markComponentPassiveEffectMountStarted(fiber) { { if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentPassiveEffectMountStarted === 'function') { injectedProfilingHooks.markComponentPassiveEffectMountStarted(fiber); } } } function markComponentPassiveEffectMountStopped() { { if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentPassiveEffectMountStopped === 'function') { injectedProfilingHooks.markComponentPassiveEffectMountStopped(); } } } function markComponentPassiveEffectUnmountStarted(fiber) { { if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStarted === 'function') { injectedProfilingHooks.markComponentPassiveEffectUnmountStarted(fiber); } } } function markComponentPassiveEffectUnmountStopped() { { if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStopped === 'function') { injectedProfilingHooks.markComponentPassiveEffectUnmountStopped(); } } } function markComponentLayoutEffectMountStarted(fiber) { { if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentLayoutEffectMountStarted === 'function') { injectedProfilingHooks.markComponentLayoutEffectMountStarted(fiber); } } } function markComponentLayoutEffectMountStopped() { { if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentLayoutEffectMountStopped === 'function') { injectedProfilingHooks.markComponentLayoutEffectMountStopped(); } } } function markComponentLayoutEffectUnmountStarted(fiber) { { if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStarted === 'function') { injectedProfilingHooks.markComponentLayoutEffectUnmountStarted(fiber); } } } function markComponentLayoutEffectUnmountStopped() { { if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStopped === 'function') { injectedProfilingHooks.markComponentLayoutEffectUnmountStopped(); } } } function markComponentErrored(fiber, thrownValue, lanes) { { if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentErrored === 'function') { injectedProfilingHooks.markComponentErrored(fiber, thrownValue, lanes); } } } function markComponentSuspended(fiber, wakeable, lanes) { { if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentSuspended === 'function') { injectedProfilingHooks.markComponentSuspended(fiber, wakeable, lanes); } } } function markLayoutEffectsStarted(lanes) { { if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markLayoutEffectsStarted === 'function') { injectedProfilingHooks.markLayoutEffectsStarted(lanes); } } } function markLayoutEffectsStopped() { { if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markLayoutEffectsStopped === 'function') { injectedProfilingHooks.markLayoutEffectsStopped(); } } } function markPassiveEffectsStarted(lanes) { { if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markPassiveEffectsStarted === 'function') { injectedProfilingHooks.markPassiveEffectsStarted(lanes); } } } function markPassiveEffectsStopped() { { if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markPassiveEffectsStopped === 'function') { injectedProfilingHooks.markPassiveEffectsStopped(); } } } function markRenderStarted(lanes) { { if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markRenderStarted === 'function') { injectedProfilingHooks.markRenderStarted(lanes); } } } function markRenderYielded() { { if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markRenderYielded === 'function') { injectedProfilingHooks.markRenderYielded(); } } } function markRenderStopped() { { if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markRenderStopped === 'function') { injectedProfilingHooks.markRenderStopped(); } } } function markRenderScheduled(lane) { { if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markRenderScheduled === 'function') { injectedProfilingHooks.markRenderScheduled(lane); } } } function markForceUpdateScheduled(fiber, lane) { { if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markForceUpdateScheduled === 'function') { injectedProfilingHooks.markForceUpdateScheduled(fiber, lane); } } } function markStateUpdateScheduled(fiber, lane) { { if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markStateUpdateScheduled === 'function') { injectedProfilingHooks.markStateUpdateScheduled(fiber, lane); } } } var NoMode = /* */ 0; // TODO: Remove ConcurrentMode by reading from the root tag instead var ConcurrentMode = /* */ 1; var ProfileMode = /* */ 2; var StrictLegacyMode = /* */ 8; var StrictEffectsMode = /* */ 16; // TODO: This is pretty well supported by browsers. Maybe we can drop it. var clz32 = Math.clz32 ? Math.clz32 : clz32Fallback; // Count leading zeros. // Based on: // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/clz32 var log = Math.log; var LN2 = Math.LN2; function clz32Fallback(x) { var asUint = x >>> 0; if (asUint === 0) { return 32; } return 31 - (log(asUint) / LN2 | 0) | 0; } // If those values are changed that package should be rebuilt and redeployed. var TotalLanes = 31; var NoLanes = /* */ 0; var NoLane = /* */ 0; var SyncLane = /* */ 1; var InputContinuousHydrationLane = /* */ 2; var InputContinuousLane = /* */ 4; var DefaultHydrationLane = /* */ 8; var DefaultLane = /* */ 16; var TransitionHydrationLane = /* */ 32; var TransitionLanes = /* */ 4194240; var TransitionLane1 = /* */ 64; var TransitionLane2 = /* */ 128; var TransitionLane3 = /* */ 256; var TransitionLane4 = /* */ 512; var TransitionLane5 = /* */ 1024; var TransitionLane6 = /* */ 2048; var TransitionLane7 = /* */ 4096; var TransitionLane8 = /* */ 8192; var TransitionLane9 = /* */ 16384; var TransitionLane10 = /* */ 32768; var TransitionLane11 = /* */ 65536; var TransitionLane12 = /* */ 131072; var TransitionLane13 = /* */ 262144; var TransitionLane14 = /* */ 524288; var TransitionLane15 = /* */ 1048576; var TransitionLane16 = /* */ 2097152; var RetryLanes = /* */ 130023424; var RetryLane1 = /* */ 4194304; var RetryLane2 = /* */ 8388608; var RetryLane3 = /* */ 16777216; var RetryLane4 = /* */ 33554432; var RetryLane5 = /* */ 67108864; var SomeRetryLane = RetryLane1; var SelectiveHydrationLane = /* */ 134217728; var NonIdleLanes = /* */ 268435455; var IdleHydrationLane = /* */ 268435456; var IdleLane = /* */ 536870912; var OffscreenLane = /* */ 1073741824; // This function is used for the experimental timeline (react-devtools-timeline) // It should be kept in sync with the Lanes values above. function getLabelForLane(lane) { { if (lane & SyncLane) { return 'Sync'; } if (lane & InputContinuousHydrationLane) { return 'InputContinuousHydration'; } if (lane & InputContinuousLane) { return 'InputContinuous'; } if (lane & DefaultHydrationLane) { return 'DefaultHydration'; } if (lane & DefaultLane) { return 'Default'; } if (lane & TransitionHydrationLane) { return 'TransitionHydration'; } if (lane & TransitionLanes) { return 'Transition'; } if (lane & RetryLanes) { return 'Retry'; } if (lane & SelectiveHydrationLane) { return 'SelectiveHydration'; } if (lane & IdleHydrationLane) { return 'IdleHydration'; } if (lane & IdleLane) { return 'Idle'; } if (lane & OffscreenLane) { return 'Offscreen'; } } } var NoTimestamp = -1; var nextTransitionLane = TransitionLane1; var nextRetryLane = RetryLane1; function getHighestPriorityLanes(lanes) { switch (getHighestPriorityLane(lanes)) { case SyncLane: return SyncLane; case InputContinuousHydrationLane: return InputContinuousHydrationLane; case InputContinuousLane: return InputContinuousLane; case DefaultHydrationLane: return DefaultHydrationLane; case DefaultLane: return DefaultLane; case TransitionHydrationLane: return TransitionHydrationLane; case TransitionLane1: case TransitionLane2: case TransitionLane3: case TransitionLane4: case TransitionLane5: case TransitionLane6: case TransitionLane7: case TransitionLane8: case TransitionLane9: case TransitionLane10: case TransitionLane11: case TransitionLane12: case TransitionLane13: case TransitionLane14: case TransitionLane15: case TransitionLane16: return lanes & TransitionLanes; case RetryLane1: case RetryLane2: case RetryLane3: case RetryLane4: case RetryLane5: return lanes & RetryLanes; case SelectiveHydrationLane: return SelectiveHydrationLane; case IdleHydrationLane: return IdleHydrationLane; case IdleLane: return IdleLane; case OffscreenLane: return OffscreenLane; default: { error('Should have found matching lanes. This is a bug in React.'); } // This shouldn't be reachable, but as a fallback, return the entire bitmask. return lanes; } } function getNextLanes(root, wipLanes) { // Early bailout if there's no pending work left. var pendingLanes = root.pendingLanes; if (pendingLanes === NoLanes) { return NoLanes; } var nextLanes = NoLanes; var suspendedLanes = root.suspendedLanes; var pingedLanes = root.pingedLanes; // Do not work on any idle work until all the non-idle work has finished, // even if the work is suspended. var nonIdlePendingLanes = pendingLanes & NonIdleLanes; if (nonIdlePendingLanes !== NoLanes) { var nonIdleUnblockedLanes = nonIdlePendingLanes & ~suspendedLanes; if (nonIdleUnblockedLanes !== NoLanes) { nextLanes = getHighestPriorityLanes(nonIdleUnblockedLanes); } else { var nonIdlePingedLanes = nonIdlePendingLanes & pingedLanes; if (nonIdlePingedLanes !== NoLanes) { nextLanes = getHighestPriorityLanes(nonIdlePingedLanes); } } } else { // The only remaining work is Idle. var unblockedLanes = pendingLanes & ~suspendedLanes; if (unblockedLanes !== NoLanes) { nextLanes = getHighestPriorityLanes(unblockedLanes); } else { if (pingedLanes !== NoLanes) { nextLanes = getHighestPriorityLanes(pingedLanes); } } } if (nextLanes === NoLanes) { // This should only be reachable if we're suspended // TODO: Consider warning in this path if a fallback timer is not scheduled. return NoLanes; } // If we're already in the middle of a render, switching lanes will interrupt // it and we'll lose our progress. We should only do this if the new lanes are // higher priority. if (wipLanes !== NoLanes && wipLanes !== nextLanes && // If we already suspended with a delay, then interrupting is fine. Don't // bother waiting until the root is complete. (wipLanes & suspendedLanes) === NoLanes) { var nextLane = getHighestPriorityLane(nextLanes); var wipLane = getHighestPriorityLane(wipLanes); if ( // Tests whether the next lane is equal or lower priority than the wip // one. This works because the bits decrease in priority as you go left. nextLane >= wipLane || // Default priority updates should not interrupt transition updates. The // only difference between default updates and transition updates is that // default updates do not support refresh transitions. nextLane === DefaultLane && (wipLane & TransitionLanes) !== NoLanes) { // Keep working on the existing in-progress tree. Do not interrupt. return wipLanes; } } if ((nextLanes & InputContinuousLane) !== NoLanes) { // When updates are sync by default, we entangle continuous priority updates // and default updates, so they render in the same batch. The only reason // they use separate lanes is because continuous updates should interrupt // transitions, but default updates should not. nextLanes |= pendingLanes & DefaultLane; } // Check for entangled lanes and add them to the batch. // // A lane is said to be entangled with another when it's not allowed to render // in a batch that does not also include the other lane. Typically we do this // when multiple updates have the same source, and we only want to respond to // the most recent event from that source. // // Note that we apply entanglements *after* checking for partial work above. // This means that if a lane is entangled during an interleaved event while // it's already rendering, we won't interrupt it. This is intentional, since // entanglement is usually "best effort": we'll try our best to render the // lanes in the same batch, but it's not worth throwing out partially // completed work in order to do it. // TODO: Reconsider this. The counter-argument is that the partial work // represents an intermediate state, which we don't want to show to the user. // And by spending extra time finishing it, we're increasing the amount of // time it takes to show the final state, which is what they are actually // waiting for. // // For those exceptions where entanglement is semantically important, like // useMutableSource, we should ensure that there is no partial work at the // time we apply the entanglement. var entangledLanes = root.entangledLanes; if (entangledLanes !== NoLanes) { var entanglements = root.entanglements; var lanes = nextLanes & entangledLanes; while (lanes > 0) { var index = pickArbitraryLaneIndex(lanes); var lane = 1 << index; nextLanes |= entanglements[index]; lanes &= ~lane; } } return nextLanes; } function getMostRecentEventTime(root, lanes) { var eventTimes = root.eventTimes; var mostRecentEventTime = NoTimestamp; while (lanes > 0) { var index = pickArbitraryLaneIndex(lanes); var lane = 1 << index; var eventTime = eventTimes[index]; if (eventTime > mostRecentEventTime) { mostRecentEventTime = eventTime; } lanes &= ~lane; } return mostRecentEventTime; } function computeExpirationTime(lane, currentTime) { switch (lane) { case SyncLane: case InputContinuousHydrationLane: case InputContinuousLane: // User interactions should expire slightly more quickly. // // NOTE: This is set to the corresponding constant as in Scheduler.js. // When we made it larger, a product metric in www regressed, suggesting // there's a user interaction that's being starved by a series of // synchronous updates. If that theory is correct, the proper solution is // to fix the starvation. However, this scenario supports the idea that // expiration times are an important safeguard when starvation // does happen. return currentTime + 250; case DefaultHydrationLane: case DefaultLane: case TransitionHydrationLane: case TransitionLane1: case TransitionLane2: case TransitionLane3: case TransitionLane4: case TransitionLane5: case TransitionLane6: case TransitionLane7: case TransitionLane8: case TransitionLane9: case TransitionLane10: case TransitionLane11: case TransitionLane12: case TransitionLane13: case TransitionLane14: case TransitionLane15: case TransitionLane16: return currentTime + 5000; case RetryLane1: case RetryLane2: case RetryLane3: case RetryLane4: case RetryLane5: // TODO: Retries should be allowed to expire if they are CPU bound for // too long, but when I made this change it caused a spike in browser // crashes. There must be some other underlying bug; not super urgent but // ideally should figure out why and fix it. Unfortunately we don't have // a repro for the crashes, only detected via production metrics. return NoTimestamp; case SelectiveHydrationLane: case IdleHydrationLane: case IdleLane: case OffscreenLane: // Anything idle priority or lower should never expire. return NoTimestamp; default: { error('Should have found matching lanes. This is a bug in React.'); } return NoTimestamp; } } function markStarvedLanesAsExpired(root, currentTime) { // TODO: This gets called every time we yield. We can optimize by storing // the earliest expiration time on the root. Then use that to quickly bail out // of this function. var pendingLanes = root.pendingLanes; var suspendedLanes = root.suspendedLanes; var pingedLanes = root.pingedLanes; var expirationTimes = root.expirationTimes; // Iterate through the pending lanes and check if we've reached their // expiration time. If so, we'll assume the update is being starved and mark // it as expired to force it to finish. var lanes = pendingLanes; while (lanes > 0) { var index = pickArbitraryLaneIndex(lanes); var lane = 1 << index; var expirationTime = expirationTimes[index]; if (expirationTime === NoTimestamp) { // Found a pending lane with no expiration time. If it's not suspended, or // if it's pinged, assume it's CPU-bound. Compute a new expiration time // using the current time. if ((lane & suspendedLanes) === NoLanes || (lane & pingedLanes) !== NoLanes) { // Assumes timestamps are monotonically increasing. expirationTimes[index] = computeExpirationTime(lane, currentTime); } } else if (expirationTime <= currentTime) { // This lane expired root.expiredLanes |= lane; } lanes &= ~lane; } } // This returns the highest priority pending lanes regardless of whether they // are suspended. function getHighestPriorityPendingLanes(root) { return getHighestPriorityLanes(root.pendingLanes); } function getLanesToRetrySynchronouslyOnError(root) { var everythingButOffscreen = root.pendingLanes & ~OffscreenLane; if (everythingButOffscreen !== NoLanes) { return everythingButOffscreen; } if (everythingButOffscreen & OffscreenLane) { return OffscreenLane; } return NoLanes; } function includesSyncLane(lanes) { return (lanes & SyncLane) !== NoLanes; } function includesNonIdleWork(lanes) { return (lanes & NonIdleLanes) !== NoLanes; } function includesOnlyRetries(lanes) { return (lanes & RetryLanes) === lanes; } function includesOnlyNonUrgentLanes(lanes) { var UrgentLanes = SyncLane | InputContinuousLane | DefaultLane; return (lanes & UrgentLanes) === NoLanes; } function includesOnlyTransitions(lanes) { return (lanes & TransitionLanes) === lanes; } function includesBlockingLane(root, lanes) { var SyncDefaultLanes = InputContinuousHydrationLane | InputContinuousLane | DefaultHydrationLane | DefaultLane; return (lanes & SyncDefaultLanes) !== NoLanes; } function includesExpiredLane(root, lanes) { // This is a separate check from includesBlockingLane because a lane can // expire after a render has already started. return (lanes & root.expiredLanes) !== NoLanes; } function isTransitionLane(lane) { return (lane & TransitionLanes) !== NoLanes; } function claimNextTransitionLane() { // Cycle through the lanes, assigning each new transition to the next lane. // In most cases, this means every transition gets its own lane, until we // run out of lanes and cycle back to the beginning. var lane = nextTransitionLane; nextTransitionLane <<= 1; if ((nextTransitionLane & TransitionLanes) === NoLanes) { nextTransitionLane = TransitionLane1; } return lane; } function claimNextRetryLane() { var lane = nextRetryLane; nextRetryLane <<= 1; if ((nextRetryLane & RetryLanes) === NoLanes) { nextRetryLane = RetryLane1; } return lane; } function getHighestPriorityLane(lanes) { return lanes & -lanes; } function pickArbitraryLane(lanes) { // This wrapper function gets inlined. Only exists so to communicate that it // doesn't matter which bit is selected; you can pick any bit without // affecting the algorithms where its used. Here I'm using // getHighestPriorityLane because it requires the fewest operations. return getHighestPriorityLane(lanes); } function pickArbitraryLaneIndex(lanes) { return 31 - clz32(lanes); } function laneToIndex(lane) { return pickArbitraryLaneIndex(lane); } function includesSomeLane(a, b) { return (a & b) !== NoLanes; } function isSubsetOfLanes(set, subset) { return (set & subset) === subset; } function mergeLanes(a, b) { return a | b; } function removeLanes(set, subset) { return set & ~subset; } function intersectLanes(a, b) { return a & b; } // Seems redundant, but it changes the type from a single lane (used for // updates) to a group of lanes (used for flushing work). function laneToLanes(lane) { return lane; } function higherPriorityLane(a, b) { // This works because the bit ranges decrease in priority as you go left. return a !== NoLane && a < b ? a : b; } function createLaneMap(initial) { // Intentionally pushing one by one. // https://v8.dev/blog/elements-kinds#avoid-creating-holes var laneMap = []; for (var i = 0; i < TotalLanes; i++) { laneMap.push(initial); } return laneMap; } function markRootUpdated(root, updateLane, eventTime) { root.pendingLanes |= updateLane; // If there are any suspended transitions, it's possible this new update // could unblock them. Clear the suspended lanes so that we can try rendering // them again. // // TODO: We really only need to unsuspend only lanes that are in the // `subtreeLanes` of the updated fiber, or the update lanes of the return // path. This would exclude suspended updates in an unrelated sibling tree, // since there's no way for this update to unblock it. // // We don't do this if the incoming update is idle, because we never process // idle updates until after all the regular updates have finished; there's no // way it could unblock a transition. if (updateLane !== IdleLane) { root.suspendedLanes = NoLanes; root.pingedLanes = NoLanes; } var eventTimes = root.eventTimes; var index = laneToIndex(updateLane); // We can always overwrite an existing timestamp because we prefer the most // recent event, and we assume time is monotonically increasing. eventTimes[index] = eventTime; } function markRootSuspended(root, suspendedLanes) { root.suspendedLanes |= suspendedLanes; root.pingedLanes &= ~suspendedLanes; // The suspended lanes are no longer CPU-bound. Clear their expiration times. var expirationTimes = root.expirationTimes; var lanes = suspendedLanes; while (lanes > 0) { var index = pickArbitraryLaneIndex(lanes); var lane = 1 << index; expirationTimes[index] = NoTimestamp; lanes &= ~lane; } } function markRootPinged(root, pingedLanes, eventTime) { root.pingedLanes |= root.suspendedLanes & pingedLanes; } function markRootFinished(root, remainingLanes) { var noLongerPendingLanes = root.pendingLanes & ~remainingLanes; root.pendingLanes = remainingLanes; // Let's try everything again root.suspendedLanes = NoLanes; root.pingedLanes = NoLanes; root.expiredLanes &= remainingLanes; root.mutableReadLanes &= remainingLanes; root.entangledLanes &= remainingLanes; var entanglements = root.entanglements; var eventTimes = root.eventTimes; var expirationTimes = root.expirationTimes; // Clear the lanes that no longer have pending work var lanes = noLongerPendingLanes; while (lanes > 0) { var index = pickArbitraryLaneIndex(lanes); var lane = 1 << index; entanglements[index] = NoLanes; eventTimes[index] = NoTimestamp; expirationTimes[index] = NoTimestamp; lanes &= ~lane; } } function markRootEntangled(root, entangledLanes) { // In addition to entangling each of the given lanes with each other, we also // have to consider _transitive_ entanglements. For each lane that is already // entangled with *any* of the given lanes, that lane is now transitively // entangled with *all* the given lanes. // // Translated: If C is entangled with A, then entangling A with B also // entangles C with B. // // If this is hard to grasp, it might help to intentionally break this // function and look at the tests that fail in ReactTransition-test.js. Try // commenting out one of the conditions below. var rootEntangledLanes = root.entangledLanes |= entangledLanes; var entanglements = root.entanglements; var lanes = rootEntangledLanes; while (lanes) { var index = pickArbitraryLaneIndex(lanes); var lane = 1 << index; if ( // Is this one of the newly entangled lanes? lane & entangledLanes | // Is this lane transitively entangled with the newly entangled lanes? entanglements[index] & entangledLanes) { entanglements[index] |= entangledLanes; } lanes &= ~lane; } } function getBumpedLaneForHydration(root, renderLanes) { var renderLane = getHighestPriorityLane(renderLanes); var lane; switch (renderLane) { case InputContinuousLane: lane = InputContinuousHydrationLane; break; case DefaultLane: lane = DefaultHydrationLane; break; case TransitionLane1: case TransitionLane2: case TransitionLane3: case TransitionLane4: case TransitionLane5: case TransitionLane6: case TransitionLane7: case TransitionLane8: case TransitionLane9: case TransitionLane10: case TransitionLane11: case TransitionLane12: case TransitionLane13: case TransitionLane14: case TransitionLane15: case TransitionLane16: case RetryLane1: case RetryLane2: case RetryLane3: case RetryLane4: case RetryLane5: lane = TransitionHydrationLane; break; case IdleLane: lane = IdleHydrationLane; break; default: // Everything else is already either a hydration lane, or shouldn't // be retried at a hydration lane. lane = NoLane; break; } // Check if the lane we chose is suspended. If so, that indicates that we // already attempted and failed to hydrate at that level. Also check if we're // already rendering that lane, which is rare but could happen. if ((lane & (root.suspendedLanes | renderLanes)) !== NoLane) { // Give up trying to hydrate and fall back to client render. return NoLane; } return lane; } function addFiberToLanesMap(root, fiber, lanes) { if (!isDevToolsPresent) { return; } var pendingUpdatersLaneMap = root.pendingUpdatersLaneMap; while (lanes > 0) { var index = laneToIndex(lanes); var lane = 1 << index; var updaters = pendingUpdatersLaneMap[index]; updaters.add(fiber); lanes &= ~lane; } } function movePendingFibersToMemoized(root, lanes) { if (!isDevToolsPresent) { return; } var pendingUpdatersLaneMap = root.pendingUpdatersLaneMap; var memoizedUpdaters = root.memoizedUpdaters; while (lanes > 0) { var index = laneToIndex(lanes); var lane = 1 << index; var updaters = pendingUpdatersLaneMap[index]; if (updaters.size > 0) { updaters.forEach(function (fiber) { var alternate = fiber.alternate; if (alternate === null || !memoizedUpdaters.has(alternate)) { memoizedUpdaters.add(fiber); } }); updaters.clear(); } lanes &= ~lane; } } function getTransitionsForLanes(root, lanes) { { return null; } } var DiscreteEventPriority = SyncLane; var ContinuousEventPriority = InputContinuousLane; var DefaultEventPriority = DefaultLane; var IdleEventPriority = IdleLane; var currentUpdatePriority = NoLane; function getCurrentUpdatePriority() { return currentUpdatePriority; } function setCurrentUpdatePriority(newPriority) { currentUpdatePriority = newPriority; } function runWithPriority(priority, fn) { var previousPriority = currentUpdatePriority; try { currentUpdatePriority = priority; return fn(); } finally { currentUpdatePriority = previousPriority; } } function higherEventPriority(a, b) { return a !== 0 && a < b ? a : b; } function lowerEventPriority(a, b) { return a === 0 || a > b ? a : b; } function isHigherEventPriority(a, b) { return a !== 0 && a < b; } function lanesToEventPriority(lanes) { var lane = getHighestPriorityLane(lanes); if (!isHigherEventPriority(DiscreteEventPriority, lane)) { return DiscreteEventPriority; } if (!isHigherEventPriority(ContinuousEventPriority, lane)) { return ContinuousEventPriority; } if (includesNonIdleWork(lane)) { return DefaultEventPriority; } return IdleEventPriority; } // This is imported by the event replaying implementation in React DOM. It's // in a separate file to break a circular dependency between the renderer and // the reconciler. function isRootDehydrated(root) { var currentState = root.current.memoizedState; return currentState.isDehydrated; } var _attemptSynchronousHydration; function setAttemptSynchronousHydration(fn) { _attemptSynchronousHydration = fn; } function attemptSynchronousHydration(fiber) { _attemptSynchronousHydration(fiber); } var attemptContinuousHydration; function setAttemptContinuousHydration(fn) { attemptContinuousHydration = fn; } var attemptHydrationAtCurrentPriority; function setAttemptHydrationAtCurrentPriority(fn) { attemptHydrationAtCurrentPriority = fn; } var getCurrentUpdatePriority$1; function setGetCurrentUpdatePriority(fn) { getCurrentUpdatePriority$1 = fn; } var attemptHydrationAtPriority; function setAttemptHydrationAtPriority(fn) { attemptHydrationAtPriority = fn; } // TODO: Upgrade this definition once we're on a newer version of Flow that // has this definition built-in. var hasScheduledReplayAttempt = false; // The queue of discrete events to be replayed. var queuedDiscreteEvents = []; // Indicates if any continuous event targets are non-null for early bailout. // if the last target was dehydrated. var queuedFocus = null; var queuedDrag = null; var queuedMouse = null; // For pointer events there can be one latest event per pointerId. var queuedPointers = new Map(); var queuedPointerCaptures = new Map(); // We could consider replaying selectionchange and touchmoves too. var queuedExplicitHydrationTargets = []; var discreteReplayableEvents = ['mousedown', 'mouseup', 'touchcancel', 'touchend', 'touchstart', 'auxclick', 'dblclick', 'pointercancel', 'pointerdown', 'pointerup', 'dragend', 'dragstart', 'drop', 'compositionend', 'compositionstart', 'keydown', 'keypress', 'keyup', 'input', 'textInput', // Intentionally camelCase 'copy', 'cut', 'paste', 'click', 'change', 'contextmenu', 'reset', 'submit']; function isDiscreteEventThatRequiresHydration(eventType) { return discreteReplayableEvents.indexOf(eventType) > -1; } function createQueuedReplayableEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) { return { blockedOn: blockedOn, domEventName: domEventName, eventSystemFlags: eventSystemFlags, nativeEvent: nativeEvent, targetContainers: [targetContainer] }; } function clearIfContinuousEvent(domEventName, nativeEvent) { switch (domEventName) { case 'focusin': case 'focusout': queuedFocus = null; break; case 'dragenter': case 'dragleave': queuedDrag = null; break; case 'mouseover': case 'mouseout': queuedMouse = null; break; case 'pointerover': case 'pointerout': { var pointerId = nativeEvent.pointerId; queuedPointers.delete(pointerId); break; } case 'gotpointercapture': case 'lostpointercapture': { var _pointerId = nativeEvent.pointerId; queuedPointerCaptures.delete(_pointerId); break; } } } function accumulateOrCreateContinuousQueuedReplayableEvent(existingQueuedEvent, blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) { if (existingQueuedEvent === null || existingQueuedEvent.nativeEvent !== nativeEvent) { var queuedEvent = createQueuedReplayableEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent); if (blockedOn !== null) { var _fiber2 = getInstanceFromNode(blockedOn); if (_fiber2 !== null) { // Attempt to increase the priority of this target. attemptContinuousHydration(_fiber2); } } return queuedEvent; } // If we have already queued this exact event, then it's because // the different event systems have different DOM event listeners. // We can accumulate the flags, and the targetContainers, and // store a single event to be replayed. existingQueuedEvent.eventSystemFlags |= eventSystemFlags; var targetContainers = existingQueuedEvent.targetContainers; if (targetContainer !== null && targetContainers.indexOf(targetContainer) === -1) { targetContainers.push(targetContainer); } return existingQueuedEvent; } function queueIfContinuousEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) { // These set relatedTarget to null because the replayed event will be treated as if we // moved from outside the window (no target) onto the target once it hydrates. // Instead of mutating we could clone the event. switch (domEventName) { case 'focusin': { var focusEvent = nativeEvent; queuedFocus = accumulateOrCreateContinuousQueuedReplayableEvent(queuedFocus, blockedOn, domEventName, eventSystemFlags, targetContainer, focusEvent); return true; } case 'dragenter': { var dragEvent = nativeEvent; queuedDrag = accumulateOrCreateContinuousQueuedReplayableEvent(queuedDrag, blockedOn, domEventName, eventSystemFlags, targetContainer, dragEvent); return true; } case 'mouseover': { var mouseEvent = nativeEvent; queuedMouse = accumulateOrCreateContinuousQueuedReplayableEvent(queuedMouse, blockedOn, domEventName, eventSystemFlags, targetContainer, mouseEvent); return true; } case 'pointerover': { var pointerEvent = nativeEvent; var pointerId = pointerEvent.pointerId; queuedPointers.set(pointerId, accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointers.get(pointerId) || null, blockedOn, domEventName, eventSystemFlags, targetContainer, pointerEvent)); return true; } case 'gotpointercapture': { var _pointerEvent = nativeEvent; var _pointerId2 = _pointerEvent.pointerId; queuedPointerCaptures.set(_pointerId2, accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointerCaptures.get(_pointerId2) || null, blockedOn, domEventName, eventSystemFlags, targetContainer, _pointerEvent)); return true; } } return false; } // Check if this target is unblocked. Returns true if it's unblocked. function attemptExplicitHydrationTarget(queuedTarget) { // TODO: This function shares a lot of logic with findInstanceBlockingEvent. // Try to unify them. It's a bit tricky since it would require two return // values. var targetInst = getClosestInstanceFromNode(queuedTarget.target); if (targetInst !== null) { var nearestMounted = getNearestMountedFiber(targetInst); if (nearestMounted !== null) { var tag = nearestMounted.tag; if (tag === SuspenseComponent) { var instance = getSuspenseInstanceFromFiber(nearestMounted); if (instance !== null) { // We're blocked on hydrating this boundary. // Increase its priority. queuedTarget.blockedOn = instance; attemptHydrationAtPriority(queuedTarget.priority, function () { attemptHydrationAtCurrentPriority(nearestMounted); }); return; } } else if (tag === HostRoot) { var root = nearestMounted.stateNode; if (isRootDehydrated(root)) { queuedTarget.blockedOn = getContainerFromFiber(nearestMounted); // We don't currently have a way to increase the priority of // a root other than sync. return; } } } } queuedTarget.blockedOn = null; } function queueExplicitHydrationTarget(target) { // TODO: This will read the priority if it's dispatched by the React // event system but not native events. Should read window.event.type, like // we do for updates (getCurrentEventPriority). var updatePriority = getCurrentUpdatePriority$1(); var queuedTarget = { blockedOn: null, target: target, priority: updatePriority }; var i = 0; for (; i < queuedExplicitHydrationTargets.length; i++) { // Stop once we hit the first target with lower priority than if (!isHigherEventPriority(updatePriority, queuedExplicitHydrationTargets[i].priority)) { break; } } queuedExplicitHydrationTargets.splice(i, 0, queuedTarget); if (i === 0) { attemptExplicitHydrationTarget(queuedTarget); } } function attemptReplayContinuousQueuedEvent(queuedEvent) { if (queuedEvent.blockedOn !== null) { return false; } var targetContainers = queuedEvent.targetContainers; while (targetContainers.length > 0) { var targetContainer = targetContainers[0]; var nextBlockedOn = findInstanceBlockingEvent(queuedEvent.domEventName, queuedEvent.eventSystemFlags, targetContainer, queuedEvent.nativeEvent); if (nextBlockedOn === null) { { var nativeEvent = queuedEvent.nativeEvent; var nativeEventClone = new nativeEvent.constructor(nativeEvent.type, nativeEvent); setReplayingEvent(nativeEventClone); nativeEvent.target.dispatchEvent(nativeEventClone); resetReplayingEvent(); } } else { // We're still blocked. Try again later. var _fiber3 = getInstanceFromNode(nextBlockedOn); if (_fiber3 !== null) { attemptContinuousHydration(_fiber3); } queuedEvent.blockedOn = nextBlockedOn; return false; } // This target container was successfully dispatched. Try the next. targetContainers.shift(); } return true; } function attemptReplayContinuousQueuedEventInMap(queuedEvent, key, map) { if (attemptReplayContinuousQueuedEvent(queuedEvent)) { map.delete(key); } } function replayUnblockedEvents() { hasScheduledReplayAttempt = false; if (queuedFocus !== null && attemptReplayContinuousQueuedEvent(queuedFocus)) { queuedFocus = null; } if (queuedDrag !== null && attemptReplayContinuousQueuedEvent(queuedDrag)) { queuedDrag = null; } if (queuedMouse !== null && attemptReplayContinuousQueuedEvent(queuedMouse)) { queuedMouse = null; } queuedPointers.forEach(attemptReplayContinuousQueuedEventInMap); queuedPointerCaptures.forEach(attemptReplayContinuousQueuedEventInMap); } function scheduleCallbackIfUnblocked(queuedEvent, unblocked) { if (queuedEvent.blockedOn === unblocked) { queuedEvent.blockedOn = null; if (!hasScheduledReplayAttempt) { hasScheduledReplayAttempt = true; // Schedule a callback to attempt replaying as many events as are // now unblocked. This first might not actually be unblocked yet. // We could check it early to avoid scheduling an unnecessary callback. unstable_scheduleCallback(unstable_NormalPriority, replayUnblockedEvents); } } } function retryIfBlockedOn(unblocked) { // Mark anything that was blocked on this as no longer blocked // and eligible for a replay. if (queuedDiscreteEvents.length > 0) { scheduleCallbackIfUnblocked(queuedDiscreteEvents[0], unblocked); // This is a exponential search for each boundary that commits. I think it's // worth it because we expect very few discrete events to queue up and once // we are actually fully unblocked it will be fast to replay them. for (var i = 1; i < queuedDiscreteEvents.length; i++) { var queuedEvent = queuedDiscreteEvents[i]; if (queuedEvent.blockedOn === unblocked) { queuedEvent.blockedOn = null; } } } if (queuedFocus !== null) { scheduleCallbackIfUnblocked(queuedFocus, unblocked); } if (queuedDrag !== null) { scheduleCallbackIfUnblocked(queuedDrag, unblocked); } if (queuedMouse !== null) { scheduleCallbackIfUnblocked(queuedMouse, unblocked); } var unblock = function (queuedEvent) { return scheduleCallbackIfUnblocked(queuedEvent, unblocked); }; queuedPointers.forEach(unblock); queuedPointerCaptures.forEach(unblock); for (var _i = 0; _i < queuedExplicitHydrationTargets.length; _i++) { var queuedTarget = queuedExplicitHydrationTargets[_i]; if (queuedTarget.blockedOn === unblocked) { queuedTarget.blockedOn = null; } } while (queuedExplicitHydrationTargets.length > 0) { var nextExplicitTarget = queuedExplicitHydrationTargets[0]; if (nextExplicitTarget.blockedOn !== null) { // We're still blocked. break; } else { attemptExplicitHydrationTarget(nextExplicitTarget); if (nextExplicitTarget.blockedOn === null) { // We're unblocked. queuedExplicitHydrationTargets.shift(); } } } } var ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig; // TODO: can we stop exporting these? var _enabled = true; // This is exported in FB builds for use by legacy FB layer infra. // We'd like to remove this but it's not clear if this is safe. function setEnabled(enabled) { _enabled = !!enabled; } function isEnabled() { return _enabled; } function createEventListenerWrapperWithPriority(targetContainer, domEventName, eventSystemFlags) { var eventPriority = getEventPriority(domEventName); var listenerWrapper; switch (eventPriority) { case DiscreteEventPriority: listenerWrapper = dispatchDiscreteEvent; break; case ContinuousEventPriority: listenerWrapper = dispatchContinuousEvent; break; case DefaultEventPriority: default: listenerWrapper = dispatchEvent; break; } return listenerWrapper.bind(null, domEventName, eventSystemFlags, targetContainer); } function dispatchDiscreteEvent(domEventName, eventSystemFlags, container, nativeEvent) { var previousPriority = getCurrentUpdatePriority(); var prevTransition = ReactCurrentBatchConfig.transition; ReactCurrentBatchConfig.transition = null; try { setCurrentUpdatePriority(DiscreteEventPriority); dispatchEvent(domEventName, eventSystemFlags, container, nativeEvent); } finally { setCurrentUpdatePriority(previousPriority); ReactCurrentBatchConfig.transition = prevTransition; } } function dispatchContinuousEvent(domEventName, eventSystemFlags, container, nativeEvent) { var previousPriority = getCurrentUpdatePriority(); var prevTransition = ReactCurrentBatchConfig.transition; ReactCurrentBatchConfig.transition = null; try { setCurrentUpdatePriority(ContinuousEventPriority); dispatchEvent(domEventName, eventSystemFlags, container, nativeEvent); } finally { setCurrentUpdatePriority(previousPriority); ReactCurrentBatchConfig.transition = prevTransition; } } function dispatchEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent) { if (!_enabled) { return; } { dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay(domEventName, eventSystemFlags, targetContainer, nativeEvent); } } function dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay(domEventName, eventSystemFlags, targetContainer, nativeEvent) { var blockedOn = findInstanceBlockingEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent); if (blockedOn === null) { dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, return_targetInst, targetContainer); clearIfContinuousEvent(domEventName, nativeEvent); return; } if (queueIfContinuousEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent)) { nativeEvent.stopPropagation(); return; } // We need to clear only if we didn't queue because // queueing is accumulative. clearIfContinuousEvent(domEventName, nativeEvent); if (eventSystemFlags & IS_CAPTURE_PHASE && isDiscreteEventThatRequiresHydration(domEventName)) { while (blockedOn !== null) { var fiber = getInstanceFromNode(blockedOn); if (fiber !== null) { attemptSynchronousHydration(fiber); } var nextBlockedOn = findInstanceBlockingEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent); if (nextBlockedOn === null) { dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, return_targetInst, targetContainer); } if (nextBlockedOn === blockedOn) { break; } blockedOn = nextBlockedOn; } if (blockedOn !== null) { nativeEvent.stopPropagation(); } return; } // This is not replayable so we'll invoke it but without a target, // in case the event system needs to trace it. dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, null, targetContainer); } var return_targetInst = null; // Returns a SuspenseInstance or Container if it's blocked. // The return_targetInst field above is conceptually part of the return value. function findInstanceBlockingEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent) { // TODO: Warn if _enabled is false. return_targetInst = null; var nativeEventTarget = getEventTarget(nativeEvent); var targetInst = getClosestInstanceFromNode(nativeEventTarget); if (targetInst !== null) { var nearestMounted = getNearestMountedFiber(targetInst); if (nearestMounted === null) { // This tree has been unmounted already. Dispatch without a target. targetInst = null; } else { var tag = nearestMounted.tag; if (tag === SuspenseComponent) { var instance = getSuspenseInstanceFromFiber(nearestMounted); if (instance !== null) { // Queue the event to be replayed later. Abort dispatching since we // don't want this event dispatched twice through the event system. // TODO: If this is the first discrete event in the queue. Schedule an increased // priority for this boundary. return instance; } // This shouldn't happen, something went wrong but to avoid blocking // the whole system, dispatch the event without a target. // TODO: Warn. targetInst = null; } else if (tag === HostRoot) { var root = nearestMounted.stateNode; if (isRootDehydrated(root)) { // If this happens during a replay something went wrong and it might block // the whole system. return getContainerFromFiber(nearestMounted); } targetInst = null; } else if (nearestMounted !== targetInst) { // If we get an event (ex: img onload) before committing that // component's mount, ignore it for now (that is, treat it as if it was an // event on a non-React tree). We might also consider queueing events and // dispatching them after the mount. targetInst = null; } } } return_targetInst = targetInst; // We're not blocked on anything. return null; } function getEventPriority(domEventName) { switch (domEventName) { // Used by SimpleEventPlugin: case 'cancel': case 'click': case 'close': case 'contextmenu': case 'copy': case 'cut': case 'auxclick': case 'dblclick': case 'dragend': case 'dragstart': case 'drop': case 'focusin': case 'focusout': case 'input': case 'invalid': case 'keydown': case 'keypress': case 'keyup': case 'mousedown': case 'mouseup': case 'paste': case 'pause': case 'play': case 'pointercancel': case 'pointerdown': case 'pointerup': case 'ratechange': case 'reset': case 'resize': case 'seeked': case 'submit': case 'touchcancel': case 'touchend': case 'touchstart': case 'volumechange': // Used by polyfills: // eslint-disable-next-line no-fallthrough case 'change': case 'selectionchange': case 'textInput': case 'compositionstart': case 'compositionend': case 'compositionupdate': // Only enableCreateEventHandleAPI: // eslint-disable-next-line no-fallthrough case 'beforeblur': case 'afterblur': // Not used by React but could be by user code: // eslint-disable-next-line no-fallthrough case 'beforeinput': case 'blur': case 'fullscreenchange': case 'focus': case 'hashchange': case 'popstate': case 'select': case 'selectstart': return DiscreteEventPriority; case 'drag': case 'dragenter': case 'dragexit': case 'dragleave': case 'dragover': case 'mousemove': case 'mouseout': case 'mouseover': case 'pointermove': case 'pointerout': case 'pointerover': case 'scroll': case 'toggle': case 'touchmove': case 'wheel': // Not used by React but could be by user code: // eslint-disable-next-line no-fallthrough case 'mouseenter': case 'mouseleave': case 'pointerenter': case 'pointerleave': return ContinuousEventPriority; case 'message': { // We might be in the Scheduler callback. // Eventually this mechanism will be replaced by a check // of the current priority on the native scheduler. var schedulerPriority = getCurrentPriorityLevel(); switch (schedulerPriority) { case ImmediatePriority: return DiscreteEventPriority; case UserBlockingPriority: return ContinuousEventPriority; case NormalPriority: case LowPriority: // TODO: Handle LowSchedulerPriority, somehow. Maybe the same lane as hydration. return DefaultEventPriority; case IdlePriority: return IdleEventPriority; default: return DefaultEventPriority; } } default: return DefaultEventPriority; } } function addEventBubbleListener(target, eventType, listener) { target.addEventListener(eventType, listener, false); return listener; } function addEventCaptureListener(target, eventType, listener) { target.addEventListener(eventType, listener, true); return listener; } function addEventCaptureListenerWithPassiveFlag(target, eventType, listener, passive) { target.addEventListener(eventType, listener, { capture: true, passive: passive }); return listener; } function addEventBubbleListenerWithPassiveFlag(target, eventType, listener, passive) { target.addEventListener(eventType, listener, { passive: passive }); return listener; } /** * These variables store information about text content of a target node, * allowing comparison of content before and after a given event. * * Identify the node where selection currently begins, then observe * both its text content and its current position in the DOM. Since the * browser may natively replace the target node during composition, we can * use its position to find its replacement. * * */ var root = null; var startText = null; var fallbackText = null; function initialize(nativeEventTarget) { root = nativeEventTarget; startText = getText(); return true; } function reset() { root = null; startText = null; fallbackText = null; } function getData() { if (fallbackText) { return fallbackText; } var start; var startValue = startText; var startLength = startValue.length; var end; var endValue = getText(); var endLength = endValue.length; for (start = 0; start < startLength; start++) { if (startValue[start] !== endValue[start]) { break; } } var minEnd = startLength - start; for (end = 1; end <= minEnd; end++) { if (startValue[startLength - end] !== endValue[endLength - end]) { break; } } var sliceTail = end > 1 ? 1 - end : undefined; fallbackText = endValue.slice(start, sliceTail); return fallbackText; } function getText() { if ('value' in root) { return root.value; } return root.textContent; } /** * `charCode` represents the actual "character code" and is safe to use with * `String.fromCharCode`. As such, only keys that correspond to printable * characters produce a valid `charCode`, the only exception to this is Enter. * The Tab-key is considered non-printable and does not have a `charCode`, * presumably because it does not produce a tab-character in browsers. * * @param {object} nativeEvent Native browser event. * @return {number} Normalized `charCode` property. */ function getEventCharCode(nativeEvent) { var charCode; var keyCode = nativeEvent.keyCode; if ('charCode' in nativeEvent) { charCode = nativeEvent.charCode; // FF does not set `charCode` for the Enter-key, check against `keyCode`. if (charCode === 0 && keyCode === 13) { charCode = 13; } } else { // IE8 does not implement `charCode`, but `keyCode` has the correct value. charCode = keyCode; } // IE and Edge (on Windows) and Chrome / Safari (on Windows and Linux) // report Enter as charCode 10 when ctrl is pressed. if (charCode === 10) { charCode = 13; } // Some non-printable keys are reported in `charCode`/`keyCode`, discard them. // Must not discard the (non-)printable Enter-key. if (charCode >= 32 || charCode === 13) { return charCode; } return 0; } function functionThatReturnsTrue() { return true; } function functionThatReturnsFalse() { return false; } // This is intentionally a factory so that we have different returned constructors. // If we had a single constructor, it would be megamorphic and engines would deopt. function createSyntheticEvent(Interface) { /** * Synthetic events are dispatched by event plugins, typically in response to a * top-level event delegation handler. * * These systems should generally use pooling to reduce the frequency of garbage * collection. The system should check `isPersistent` to determine whether the * event should be released into the pool after being dispatched. Users that * need a persisted event should invoke `persist`. * * Synthetic events (and subclasses) implement the DOM Level 3 Events API by * normalizing browser quirks. Subclasses do not necessarily have to implement a * DOM interface; custom application-specific events can also subclass this. */ function SyntheticBaseEvent(reactName, reactEventType, targetInst, nativeEvent, nativeEventTarget) { this._reactName = reactName; this._targetInst = targetInst; this.type = reactEventType; this.nativeEvent = nativeEvent; this.target = nativeEventTarget; this.currentTarget = null; for (var _propName in Interface) { if (!Interface.hasOwnProperty(_propName)) { continue; } var normalize = Interface[_propName]; if (normalize) { this[_propName] = normalize(nativeEvent); } else { this[_propName] = nativeEvent[_propName]; } } var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false; if (defaultPrevented) { this.isDefaultPrevented = functionThatReturnsTrue; } else { this.isDefaultPrevented = functionThatReturnsFalse; } this.isPropagationStopped = functionThatReturnsFalse; return this; } assign(SyntheticBaseEvent.prototype, { preventDefault: function () { this.defaultPrevented = true; var event = this.nativeEvent; if (!event) { return; } if (event.preventDefault) { event.preventDefault(); // $FlowFixMe - flow is not aware of `unknown` in IE } else if (typeof event.returnValue !== 'unknown') { event.returnValue = false; } this.isDefaultPrevented = functionThatReturnsTrue; }, stopPropagation: function () { var event = this.nativeEvent; if (!event) { return; } if (event.stopPropagation) { event.stopPropagation(); // $FlowFixMe - flow is not aware of `unknown` in IE } else if (typeof event.cancelBubble !== 'unknown') { // The ChangeEventPlugin registers a "propertychange" event for // IE. This event does not support bubbling or cancelling, and // any references to cancelBubble throw "Member not found". A // typeof check of "unknown" circumvents this issue (and is also // IE specific). event.cancelBubble = true; } this.isPropagationStopped = functionThatReturnsTrue; }, /** * We release all dispatched `SyntheticEvent`s after each event loop, adding * them back into the pool. This allows a way to hold onto a reference that * won't be added back into the pool. */ persist: function () {// Modern event system doesn't use pooling. }, /** * Checks if this event should be released back into the pool. * * @return {boolean} True if this should not be released, false otherwise. */ isPersistent: functionThatReturnsTrue }); return SyntheticBaseEvent; } /** * @interface Event * @see http://www.w3.org/TR/DOM-Level-3-Events/ */ var EventInterface = { eventPhase: 0, bubbles: 0, cancelable: 0, timeStamp: function (event) { return event.timeStamp || Date.now(); }, defaultPrevented: 0, isTrusted: 0 }; var SyntheticEvent = createSyntheticEvent(EventInterface); var UIEventInterface = assign({}, EventInterface, { view: 0, detail: 0 }); var SyntheticUIEvent = createSyntheticEvent(UIEventInterface); var lastMovementX; var lastMovementY; var lastMouseEvent; function updateMouseMovementPolyfillState(event) { if (event !== lastMouseEvent) { if (lastMouseEvent && event.type === 'mousemove') { lastMovementX = event.screenX - lastMouseEvent.screenX; lastMovementY = event.screenY - lastMouseEvent.screenY; } else { lastMovementX = 0; lastMovementY = 0; } lastMouseEvent = event; } } /** * @interface MouseEvent * @see http://www.w3.org/TR/DOM-Level-3-Events/ */ var MouseEventInterface = assign({}, UIEventInterface, { screenX: 0, screenY: 0, clientX: 0, clientY: 0, pageX: 0, pageY: 0, ctrlKey: 0, shiftKey: 0, altKey: 0, metaKey: 0, getModifierState: getEventModifierState, button: 0, buttons: 0, relatedTarget: function (event) { if (event.relatedTarget === undefined) return event.fromElement === event.srcElement ? event.toElement : event.fromElement; return event.relatedTarget; }, movementX: function (event) { if ('movementX' in event) { return event.movementX; } updateMouseMovementPolyfillState(event); return lastMovementX; }, movementY: function (event) { if ('movementY' in event) { return event.movementY; } // Don't need to call updateMouseMovementPolyfillState() here // because it's guaranteed to have already run when movementX // was copied. return lastMovementY; } }); var SyntheticMouseEvent = createSyntheticEvent(MouseEventInterface); /** * @interface DragEvent * @see http://www.w3.org/TR/DOM-Level-3-Events/ */ var DragEventInterface = assign({}, MouseEventInterface, { dataTransfer: 0 }); var SyntheticDragEvent = createSyntheticEvent(DragEventInterface); /** * @interface FocusEvent * @see http://www.w3.org/TR/DOM-Level-3-Events/ */ var FocusEventInterface = assign({}, UIEventInterface, { relatedTarget: 0 }); var SyntheticFocusEvent = createSyntheticEvent(FocusEventInterface); /** * @interface Event * @see http://www.w3.org/TR/css3-animations/#AnimationEvent-interface * @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent */ var AnimationEventInterface = assign({}, EventInterface, { animationName: 0, elapsedTime: 0, pseudoElement: 0 }); var SyntheticAnimationEvent = createSyntheticEvent(AnimationEventInterface); /** * @interface Event * @see http://www.w3.org/TR/clipboard-apis/ */ var ClipboardEventInterface = assign({}, EventInterface, { clipboardData: function (event) { return 'clipboardData' in event ? event.clipboardData : window.clipboardData; } }); var SyntheticClipboardEvent = createSyntheticEvent(ClipboardEventInterface); /** * @interface Event * @see http://www.w3.org/TR/DOM-Level-3-Events/#events-compositionevents */ var CompositionEventInterface = assign({}, EventInterface, { data: 0 }); var SyntheticCompositionEvent = createSyntheticEvent(CompositionEventInterface); /** * @interface Event * @see http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105 * /#events-inputevents */ // Happens to share the same list for now. var SyntheticInputEvent = SyntheticCompositionEvent; /** * Normalization of deprecated HTML5 `key` values * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names */ var normalizeKey = { Esc: 'Escape', Spacebar: ' ', Left: 'ArrowLeft', Up: 'ArrowUp', Right: 'ArrowRight', Down: 'ArrowDown', Del: 'Delete', Win: 'OS', Menu: 'ContextMenu', Apps: 'ContextMenu', Scroll: 'ScrollLock', MozPrintableKey: 'Unidentified' }; /** * Translation from legacy `keyCode` to HTML5 `key` * Only special keys supported, all others depend on keyboard layout or browser * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names */ var translateToKey = { '8': 'Backspace', '9': 'Tab', '12': 'Clear', '13': 'Enter', '16': 'Shift', '17': 'Control', '18': 'Alt', '19': 'Pause', '20': 'CapsLock', '27': 'Escape', '32': ' ', '33': 'PageUp', '34': 'PageDown', '35': 'End', '36': 'Home', '37': 'ArrowLeft', '38': 'ArrowUp', '39': 'ArrowRight', '40': 'ArrowDown', '45': 'Insert', '46': 'Delete', '112': 'F1', '113': 'F2', '114': 'F3', '115': 'F4', '116': 'F5', '117': 'F6', '118': 'F7', '119': 'F8', '120': 'F9', '121': 'F10', '122': 'F11', '123': 'F12', '144': 'NumLock', '145': 'ScrollLock', '224': 'Meta' }; /** * @param {object} nativeEvent Native browser event. * @return {string} Normalized `key` property. */ function getEventKey(nativeEvent) { if (nativeEvent.key) { // Normalize inconsistent values reported by browsers due to // implementations of a working draft specification. // FireFox implements `key` but returns `MozPrintableKey` for all // printable characters (normalized to `Unidentified`), ignore it. var key = normalizeKey[nativeEvent.key] || nativeEvent.key; if (key !== 'Unidentified') { return key; } } // Browser does not implement `key`, polyfill as much of it as we can. if (nativeEvent.type === 'keypress') { var charCode = getEventCharCode(nativeEvent); // The enter-key is technically both printable and non-printable and can // thus be captured by `keypress`, no other non-printable key should. return charCode === 13 ? 'Enter' : String.fromCharCode(charCode); } if (nativeEvent.type === 'keydown' || nativeEvent.type === 'keyup') { // While user keyboard layout determines the actual meaning of each // `keyCode` value, almost all function keys have a universal value. return translateToKey[nativeEvent.keyCode] || 'Unidentified'; } return ''; } /** * Translation from modifier key to the associated property in the event. * @see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers */ var modifierKeyToProp = { Alt: 'altKey', Control: 'ctrlKey', Meta: 'metaKey', Shift: 'shiftKey' }; // Older browsers (Safari <= 10, iOS Safari <= 10.2) do not support // getModifierState. If getModifierState is not supported, we map it to a set of // modifier keys exposed by the event. In this case, Lock-keys are not supported. function modifierStateGetter(keyArg) { var syntheticEvent = this; var nativeEvent = syntheticEvent.nativeEvent; if (nativeEvent.getModifierState) { return nativeEvent.getModifierState(keyArg); } var keyProp = modifierKeyToProp[keyArg]; return keyProp ? !!nativeEvent[keyProp] : false; } function getEventModifierState(nativeEvent) { return modifierStateGetter; } /** * @interface KeyboardEvent * @see http://www.w3.org/TR/DOM-Level-3-Events/ */ var KeyboardEventInterface = assign({}, UIEventInterface, { key: getEventKey, code: 0, location: 0, ctrlKey: 0, shiftKey: 0, altKey: 0, metaKey: 0, repeat: 0, locale: 0, getModifierState: getEventModifierState, // Legacy Interface charCode: function (event) { // `charCode` is the result of a KeyPress event and represents the value of // the actual printable character. // KeyPress is deprecated, but its replacement is not yet final and not // implemented in any major browser. Only KeyPress has charCode. if (event.type === 'keypress') { return getEventCharCode(event); } return 0; }, keyCode: function (event) { // `keyCode` is the result of a KeyDown/Up event and represents the value of // physical keyboard key. // The actual meaning of the value depends on the users' keyboard layout // which cannot be detected. Assuming that it is a US keyboard layout // provides a surprisingly accurate mapping for US and European users. // Due to this, it is left to the user to implement at this time. if (event.type === 'keydown' || event.type === 'keyup') { return event.keyCode; } return 0; }, which: function (event) { // `which` is an alias for either `keyCode` or `charCode` depending on the // type of the event. if (event.type === 'keypress') { return getEventCharCode(event); } if (event.type === 'keydown' || event.type === 'keyup') { return event.keyCode; } return 0; } }); var SyntheticKeyboardEvent = createSyntheticEvent(KeyboardEventInterface); /** * @interface PointerEvent * @see http://www.w3.org/TR/pointerevents/ */ var PointerEventInterface = assign({}, MouseEventInterface, { pointerId: 0, width: 0, height: 0, pressure: 0, tangentialPressure: 0, tiltX: 0, tiltY: 0, twist: 0, pointerType: 0, isPrimary: 0 }); var SyntheticPointerEvent = createSyntheticEvent(PointerEventInterface); /** * @interface TouchEvent * @see http://www.w3.org/TR/touch-events/ */ var TouchEventInterface = assign({}, UIEventInterface, { touches: 0, targetTouches: 0, changedTouches: 0, altKey: 0, metaKey: 0, ctrlKey: 0, shiftKey: 0, getModifierState: getEventModifierState }); var SyntheticTouchEvent = createSyntheticEvent(TouchEventInterface); /** * @interface Event * @see http://www.w3.org/TR/2009/WD-css3-transitions-20090320/#transition-events- * @see https://developer.mozilla.org/en-US/docs/Web/API/TransitionEvent */ var TransitionEventInterface = assign({}, EventInterface, { propertyName: 0, elapsedTime: 0, pseudoElement: 0 }); var SyntheticTransitionEvent = createSyntheticEvent(TransitionEventInterface); /** * @interface WheelEvent * @see http://www.w3.org/TR/DOM-Level-3-Events/ */ var WheelEventInterface = assign({}, MouseEventInterface, { deltaX: function (event) { return 'deltaX' in event ? event.deltaX : // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive). 'wheelDeltaX' in event ? -event.wheelDeltaX : 0; }, deltaY: function (event) { return 'deltaY' in event ? event.deltaY : // Fallback to `wheelDeltaY` for Webkit and normalize (down is positive). 'wheelDeltaY' in event ? -event.wheelDeltaY : // Fallback to `wheelDelta` for IE<9 and normalize (down is positive). 'wheelDelta' in event ? -event.wheelDelta : 0; }, deltaZ: 0, // Browsers without "deltaMode" is reporting in raw wheel delta where one // notch on the scroll is always +/- 120, roughly equivalent to pixels. // A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or // ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size. deltaMode: 0 }); var SyntheticWheelEvent = createSyntheticEvent(WheelEventInterface); var END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space var START_KEYCODE = 229; var canUseCompositionEvent = canUseDOM && 'CompositionEvent' in window; var documentMode = null; if (canUseDOM && 'documentMode' in document) { documentMode = document.documentMode; } // Webkit offers a very useful `textInput` event that can be used to // directly represent `beforeInput`. The IE `textinput` event is not as // useful, so we don't use it. var canUseTextInputEvent = canUseDOM && 'TextEvent' in window && !documentMode; // In IE9+, we have access to composition events, but the data supplied // by the native compositionend event may be incorrect. Japanese ideographic // spaces, for instance (\u3000) are not recorded correctly. var useFallbackCompositionData = canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11); var SPACEBAR_CODE = 32; var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE); function registerEvents() { registerTwoPhaseEvent('onBeforeInput', ['compositionend', 'keypress', 'textInput', 'paste']); registerTwoPhaseEvent('onCompositionEnd', ['compositionend', 'focusout', 'keydown', 'keypress', 'keyup', 'mousedown']); registerTwoPhaseEvent('onCompositionStart', ['compositionstart', 'focusout', 'keydown', 'keypress', 'keyup', 'mousedown']); registerTwoPhaseEvent('onCompositionUpdate', ['compositionupdate', 'focusout', 'keydown', 'keypress', 'keyup', 'mousedown']); } // Track whether we've ever handled a keypress on the space key. var hasSpaceKeypress = false; /** * Return whether a native keypress event is assumed to be a command. * This is required because Firefox fires `keypress` events for key commands * (cut, copy, select-all, etc.) even though no character is inserted. */ function isKeypressCommand(nativeEvent) { return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) && // ctrlKey && altKey is equivalent to AltGr, and is not a command. !(nativeEvent.ctrlKey && nativeEvent.altKey); } /** * Translate native top level events into event types. */ function getCompositionEventType(domEventName) { switch (domEventName) { case 'compositionstart': return 'onCompositionStart'; case 'compositionend': return 'onCompositionEnd'; case 'compositionupdate': return 'onCompositionUpdate'; } } /** * Does our fallback best-guess model think this event signifies that * composition has begun? */ function isFallbackCompositionStart(domEventName, nativeEvent) { return domEventName === 'keydown' && nativeEvent.keyCode === START_KEYCODE; } /** * Does our fallback mode think that this event is the end of composition? */ function isFallbackCompositionEnd(domEventName, nativeEvent) { switch (domEventName) { case 'keyup': // Command keys insert or clear IME input. return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1; case 'keydown': // Expect IME keyCode on each keydown. If we get any other // code we must have exited earlier. return nativeEvent.keyCode !== START_KEYCODE; case 'keypress': case 'mousedown': case 'focusout': // Events are not possible without cancelling IME. return true; default: return false; } } /** * Google Input Tools provides composition data via a CustomEvent, * with the `data` property populated in the `detail` object. If this * is available on the event object, use it. If not, this is a plain * composition event and we have nothing special to extract. * * @param {object} nativeEvent * @return {?string} */ function getDataFromCustomEvent(nativeEvent) { var detail = nativeEvent.detail; if (typeof detail === 'object' && 'data' in detail) { return detail.data; } return null; } /** * Check if a composition event was triggered by Korean IME. * Our fallback mode does not work well with IE's Korean IME, * so just use native composition events when Korean IME is used. * Although CompositionEvent.locale property is deprecated, * it is available in IE, where our fallback mode is enabled. * * @param {object} nativeEvent * @return {boolean} */ function isUsingKoreanIME(nativeEvent) { return nativeEvent.locale === 'ko'; } // Track the current IME composition status, if any. var isComposing = false; /** * @return {?object} A SyntheticCompositionEvent. */ function extractCompositionEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget) { var eventType; var fallbackData; if (canUseCompositionEvent) { eventType = getCompositionEventType(domEventName); } else if (!isComposing) { if (isFallbackCompositionStart(domEventName, nativeEvent)) { eventType = 'onCompositionStart'; } } else if (isFallbackCompositionEnd(domEventName, nativeEvent)) { eventType = 'onCompositionEnd'; } if (!eventType) { return null; } if (useFallbackCompositionData && !isUsingKoreanIME(nativeEvent)) { // The current composition is stored statically and must not be // overwritten while composition continues. if (!isComposing && eventType === 'onCompositionStart') { isComposing = initialize(nativeEventTarget); } else if (eventType === 'onCompositionEnd') { if (isComposing) { fallbackData = getData(); } } } var listeners = accumulateTwoPhaseListeners(targetInst, eventType); if (listeners.length > 0) { var event = new SyntheticCompositionEvent(eventType, domEventName, null, nativeEvent, nativeEventTarget); dispatchQueue.push({ event: event, listeners: listeners }); if (fallbackData) { // Inject data generated from fallback path into the synthetic event. // This matches the property of native CompositionEventInterface. event.data = fallbackData; } else { var customData = getDataFromCustomEvent(nativeEvent); if (customData !== null) { event.data = customData; } } } } function getNativeBeforeInputChars(domEventName, nativeEvent) { switch (domEventName) { case 'compositionend': return getDataFromCustomEvent(nativeEvent); case 'keypress': /** * If native `textInput` events are available, our goal is to make * use of them. However, there is a special case: the spacebar key. * In Webkit, preventing default on a spacebar `textInput` event * cancels character insertion, but it *also* causes the browser * to fall back to its default spacebar behavior of scrolling the * page. * * Tracking at: * https://code.google.com/p/chromium/issues/detail?id=355103 * * To avoid this issue, use the keypress event as if no `textInput` * event is available. */ var which = nativeEvent.which; if (which !== SPACEBAR_CODE) { return null; } hasSpaceKeypress = true; return SPACEBAR_CHAR; case 'textInput': // Record the characters to be added to the DOM. var chars = nativeEvent.data; // If it's a spacebar character, assume that we have already handled // it at the keypress level and bail immediately. Android Chrome // doesn't give us keycodes, so we need to ignore it. if (chars === SPACEBAR_CHAR && hasSpaceKeypress) { return null; } return chars; default: // For other native event types, do nothing. return null; } } /** * For browsers that do not provide the `textInput` event, extract the * appropriate string to use for SyntheticInputEvent. */ function getFallbackBeforeInputChars(domEventName, nativeEvent) { // If we are currently composing (IME) and using a fallback to do so, // try to extract the composed characters from the fallback object. // If composition event is available, we extract a string only at // compositionevent, otherwise extract it at fallback events. if (isComposing) { if (domEventName === 'compositionend' || !canUseCompositionEvent && isFallbackCompositionEnd(domEventName, nativeEvent)) { var chars = getData(); reset(); isComposing = false; return chars; } return null; } switch (domEventName) { case 'paste': // If a paste event occurs after a keypress, throw out the input // chars. Paste events should not lead to BeforeInput events. return null; case 'keypress': /** * As of v27, Firefox may fire keypress events even when no character * will be inserted. A few possibilities: * * - `which` is `0`. Arrow keys, Esc key, etc. * * - `which` is the pressed key code, but no char is available. * Ex: 'AltGr + d` in Polish. There is no modified character for * this key combination and no character is inserted into the * document, but FF fires the keypress for char code `100` anyway. * No `input` event will occur. * * - `which` is the pressed key code, but a command combination is * being used. Ex: `Cmd+C`. No character is inserted, and no * `input` event will occur. */ if (!isKeypressCommand(nativeEvent)) { // IE fires the `keypress` event when a user types an emoji via // Touch keyboard of Windows. In such a case, the `char` property // holds an emoji character like `\uD83D\uDE0A`. Because its length // is 2, the property `which` does not represent an emoji correctly. // In such a case, we directly return the `char` property instead of // using `which`. if (nativeEvent.char && nativeEvent.char.length > 1) { return nativeEvent.char; } else if (nativeEvent.which) { return String.fromCharCode(nativeEvent.which); } } return null; case 'compositionend': return useFallbackCompositionData && !isUsingKoreanIME(nativeEvent) ? null : nativeEvent.data; default: return null; } } /** * Extract a SyntheticInputEvent for `beforeInput`, based on either native * `textInput` or fallback behavior. * * @return {?object} A SyntheticInputEvent. */ function extractBeforeInputEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget) { var chars; if (canUseTextInputEvent) { chars = getNativeBeforeInputChars(domEventName, nativeEvent); } else { chars = getFallbackBeforeInputChars(domEventName, nativeEvent); } // If no characters are being inserted, no BeforeInput event should // be fired. if (!chars) { return null; } var listeners = accumulateTwoPhaseListeners(targetInst, 'onBeforeInput'); if (listeners.length > 0) { var event = new SyntheticInputEvent('onBeforeInput', 'beforeinput', null, nativeEvent, nativeEventTarget); dispatchQueue.push({ event: event, listeners: listeners }); event.data = chars; } } /** * Create an `onBeforeInput` event to match * http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105/#events-inputevents. * * This event plugin is based on the native `textInput` event * available in Chrome, Safari, Opera, and IE. This event fires after * `onKeyPress` and `onCompositionEnd`, but before `onInput`. * * `beforeInput` is spec'd but not implemented in any browsers, and * the `input` event does not provide any useful information about what has * actually been added, contrary to the spec. Thus, `textInput` is the best * available event to identify the characters that have actually been inserted * into the target node. * * This plugin is also responsible for emitting `composition` events, thus * allowing us to share composition fallback code for both `beforeInput` and * `composition` event types. */ function extractEvents(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) { extractCompositionEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget); extractBeforeInputEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget); } /** * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary */ var supportedInputTypes = { color: true, date: true, datetime: true, 'datetime-local': true, email: true, month: true, number: true, password: true, range: true, search: true, tel: true, text: true, time: true, url: true, week: true }; function isTextInputElement(elem) { var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase(); if (nodeName === 'input') { return !!supportedInputTypes[elem.type]; } if (nodeName === 'textarea') { return true; } return false; } /** * Checks if an event is supported in the current execution environment. * * NOTE: This will not work correctly for non-generic events such as `change`, * `reset`, `load`, `error`, and `select`. * * Borrows from Modernizr. * * @param {string} eventNameSuffix Event name, e.g. "click". * @return {boolean} True if the event is supported. * @internal * @license Modernizr 3.0.0pre (Custom Build) | MIT */ function isEventSupported(eventNameSuffix) { if (!canUseDOM) { return false; } var eventName = 'on' + eventNameSuffix; var isSupported = (eventName in document); if (!isSupported) { var element = document.createElement('div'); element.setAttribute(eventName, 'return;'); isSupported = typeof element[eventName] === 'function'; } return isSupported; } function registerEvents$1() { registerTwoPhaseEvent('onChange', ['change', 'click', 'focusin', 'focusout', 'input', 'keydown', 'keyup', 'selectionchange']); } function createAndAccumulateChangeEvent(dispatchQueue, inst, nativeEvent, target) { // Flag this event loop as needing state restore. enqueueStateRestore(target); var listeners = accumulateTwoPhaseListeners(inst, 'onChange'); if (listeners.length > 0) { var event = new SyntheticEvent('onChange', 'change', null, nativeEvent, target); dispatchQueue.push({ event: event, listeners: listeners }); } } /** * For IE shims */ var activeElement = null; var activeElementInst = null; /** * SECTION: handle `change` event */ function shouldUseChangeEvent(elem) { var nodeName = elem.nodeName && elem.nodeName.toLowerCase(); return nodeName === 'select' || nodeName === 'input' && elem.type === 'file'; } function manualDispatchChangeEvent(nativeEvent) { var dispatchQueue = []; createAndAccumulateChangeEvent(dispatchQueue, activeElementInst, nativeEvent, getEventTarget(nativeEvent)); // If change and propertychange bubbled, we'd just bind to it like all the // other events and have it go through ReactBrowserEventEmitter. Since it // doesn't, we manually listen for the events and so we have to enqueue and // process the abstract event manually. // // Batching is necessary here in order to ensure that all event handlers run // before the next rerender (including event handlers attached to ancestor // elements instead of directly on the input). Without this, controlled // components don't work properly in conjunction with event bubbling because // the component is rerendered and the value reverted before all the event // handlers can run. See https://github.com/facebook/react/issues/708. batchedUpdates(runEventInBatch, dispatchQueue); } function runEventInBatch(dispatchQueue) { processDispatchQueue(dispatchQueue, 0); } function getInstIfValueChanged(targetInst) { var targetNode = getNodeFromInstance(targetInst); if (updateValueIfChanged(targetNode)) { return targetInst; } } function getTargetInstForChangeEvent(domEventName, targetInst) { if (domEventName === 'change') { return targetInst; } } /** * SECTION: handle `input` event */ var isInputEventSupported = false; if (canUseDOM) { // IE9 claims to support the input event but fails to trigger it when // deleting text, so we ignore its input events. isInputEventSupported = isEventSupported('input') && (!document.documentMode || document.documentMode > 9); } /** * (For IE <=9) Starts tracking propertychange events on the passed-in element * and override the value property so that we can distinguish user events from * value changes in JS. */ function startWatchingForValueChange(target, targetInst) { activeElement = target; activeElementInst = targetInst; activeElement.attachEvent('onpropertychange', handlePropertyChange); } /** * (For IE <=9) Removes the event listeners from the currently-tracked element, * if any exists. */ function stopWatchingForValueChange() { if (!activeElement) { return; } activeElement.detachEvent('onpropertychange', handlePropertyChange); activeElement = null; activeElementInst = null; } /** * (For IE <=9) Handles a propertychange event, sending a `change` event if * the value of the active element has changed. */ function handlePropertyChange(nativeEvent) { if (nativeEvent.propertyName !== 'value') { return; } if (getInstIfValueChanged(activeElementInst)) { manualDispatchChangeEvent(nativeEvent); } } function handleEventsForInputEventPolyfill(domEventName, target, targetInst) { if (domEventName === 'focusin') { // In IE9, propertychange fires for most input events but is buggy and // doesn't fire when text is deleted, but conveniently, selectionchange // appears to fire in all of the remaining cases so we catch those and // forward the event if the value has changed // In either case, we don't want to call the event handler if the value // is changed from JS so we redefine a setter for `.value` that updates // our activeElementValue variable, allowing us to ignore those changes // // stopWatching() should be a noop here but we call it just in case we // missed a blur event somehow. stopWatchingForValueChange(); startWatchingForValueChange(target, targetInst); } else if (domEventName === 'focusout') { stopWatchingForValueChange(); } } // For IE8 and IE9. function getTargetInstForInputEventPolyfill(domEventName, targetInst) { if (domEventName === 'selectionchange' || domEventName === 'keyup' || domEventName === 'keydown') { // On the selectionchange event, the target is just document which isn't // helpful for us so just check activeElement instead. // // 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire // propertychange on the first input event after setting `value` from a // script and fires only keydown, keypress, keyup. Catching keyup usually // gets it and catching keydown lets us fire an event for the first // keystroke if user does a key repeat (it'll be a little delayed: right // before the second keystroke). Other input methods (e.g., paste) seem to // fire selectionchange normally. return getInstIfValueChanged(activeElementInst); } } /** * SECTION: handle `click` event */ function shouldUseClickEvent(elem) { // Use the `click` event to detect changes to checkbox and radio inputs. // This approach works across all browsers, whereas `change` does not fire // until `blur` in IE8. var nodeName = elem.nodeName; return nodeName && nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || elem.type === 'radio'); } function getTargetInstForClickEvent(domEventName, targetInst) { if (domEventName === 'click') { return getInstIfValueChanged(targetInst); } } function getTargetInstForInputOrChangeEvent(domEventName, targetInst) { if (domEventName === 'input' || domEventName === 'change') { return getInstIfValueChanged(targetInst); } } function handleControlledInputBlur(node) { var state = node._wrapperState; if (!state || !state.controlled || node.type !== 'number') { return; } { // If controlled, assign the value attribute to the current value on blur setDefaultValue(node, 'number', node.value); } } /** * This plugin creates an `onChange` event that normalizes change events * across form elements. This event fires at a time when it's possible to * change the element's value without seeing a flicker. * * Supported elements are: * - input (see `isTextInputElement`) * - textarea * - select */ function extractEvents$1(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) { var targetNode = targetInst ? getNodeFromInstance(targetInst) : window; var getTargetInstFunc, handleEventFunc; if (shouldUseChangeEvent(targetNode)) { getTargetInstFunc = getTargetInstForChangeEvent; } else if (isTextInputElement(targetNode)) { if (isInputEventSupported) { getTargetInstFunc = getTargetInstForInputOrChangeEvent; } else { getTargetInstFunc = getTargetInstForInputEventPolyfill; handleEventFunc = handleEventsForInputEventPolyfill; } } else if (shouldUseClickEvent(targetNode)) { getTargetInstFunc = getTargetInstForClickEvent; } if (getTargetInstFunc) { var inst = getTargetInstFunc(domEventName, targetInst); if (inst) { createAndAccumulateChangeEvent(dispatchQueue, inst, nativeEvent, nativeEventTarget); return; } } if (handleEventFunc) { handleEventFunc(domEventName, targetNode, targetInst); } // When blurring, set the value attribute for number inputs if (domEventName === 'focusout') { handleControlledInputBlur(targetNode); } } function registerEvents$2() { registerDirectEvent('onMouseEnter', ['mouseout', 'mouseover']); registerDirectEvent('onMouseLeave', ['mouseout', 'mouseover']); registerDirectEvent('onPointerEnter', ['pointerout', 'pointerover']); registerDirectEvent('onPointerLeave', ['pointerout', 'pointerover']); } /** * For almost every interaction we care about, there will be both a top-level * `mouseover` and `mouseout` event that occurs. Only use `mouseout` so that * we do not extract duplicate events. However, moving the mouse into the * browser from outside will not fire a `mouseout` event. In this case, we use * the `mouseover` top-level event. */ function extractEvents$2(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) { var isOverEvent = domEventName === 'mouseover' || domEventName === 'pointerover'; var isOutEvent = domEventName === 'mouseout' || domEventName === 'pointerout'; if (isOverEvent && !isReplayingEvent(nativeEvent)) { // If this is an over event with a target, we might have already dispatched // the event in the out event of the other target. If this is replayed, // then it's because we couldn't dispatch against this target previously // so we have to do it now instead. var related = nativeEvent.relatedTarget || nativeEvent.fromElement; if (related) { // If the related node is managed by React, we can assume that we have // already dispatched the corresponding events during its mouseout. if (getClosestInstanceFromNode(related) || isContainerMarkedAsRoot(related)) { return; } } } if (!isOutEvent && !isOverEvent) { // Must not be a mouse or pointer in or out - ignoring. return; } var win; // TODO: why is this nullable in the types but we read from it? if (nativeEventTarget.window === nativeEventTarget) { // `nativeEventTarget` is probably a window object. win = nativeEventTarget; } else { // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8. var doc = nativeEventTarget.ownerDocument; if (doc) { win = doc.defaultView || doc.parentWindow; } else { win = window; } } var from; var to; if (isOutEvent) { var _related = nativeEvent.relatedTarget || nativeEvent.toElement; from = targetInst; to = _related ? getClosestInstanceFromNode(_related) : null; if (to !== null) { var nearestMounted = getNearestMountedFiber(to); if (to !== nearestMounted || to.tag !== HostComponent && to.tag !== HostText) { to = null; } } } else { // Moving to a node from outside the window. from = null; to = targetInst; } if (from === to) { // Nothing pertains to our managed components. return; } var SyntheticEventCtor = SyntheticMouseEvent; var leaveEventType = 'onMouseLeave'; var enterEventType = 'onMouseEnter'; var eventTypePrefix = 'mouse'; if (domEventName === 'pointerout' || domEventName === 'pointerover') { SyntheticEventCtor = SyntheticPointerEvent; leaveEventType = 'onPointerLeave'; enterEventType = 'onPointerEnter'; eventTypePrefix = 'pointer'; } var fromNode = from == null ? win : getNodeFromInstance(from); var toNode = to == null ? win : getNodeFromInstance(to); var leave = new SyntheticEventCtor(leaveEventType, eventTypePrefix + 'leave', from, nativeEvent, nativeEventTarget); leave.target = fromNode; leave.relatedTarget = toNode; var enter = null; // We should only process this nativeEvent if we are processing // the first ancestor. Next time, we will ignore the event. var nativeTargetInst = getClosestInstanceFromNode(nativeEventTarget); if (nativeTargetInst === targetInst) { var enterEvent = new SyntheticEventCtor(enterEventType, eventTypePrefix + 'enter', to, nativeEvent, nativeEventTarget); enterEvent.target = toNode; enterEvent.relatedTarget = fromNode; enter = enterEvent; } accumulateEnterLeaveTwoPhaseListeners(dispatchQueue, leave, enter, from, to); } /** * inlined Object.is polyfill to avoid requiring consumers ship their own * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is */ function is(x, y) { return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare ; } var objectIs = typeof Object.is === 'function' ? Object.is : is; /** * Performs equality by iterating through keys on an object and returning false * when any key has values which are not strictly equal between the arguments. * Returns true when the values of all keys are strictly equal. */ function shallowEqual(objA, objB) { if (objectIs(objA, objB)) { return true; } if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) { return false; } var keysA = Object.keys(objA); var keysB = Object.keys(objB); if (keysA.length !== keysB.length) { return false; } // Test for A's keys different from B. for (var i = 0; i < keysA.length; i++) { var currentKey = keysA[i]; if (!hasOwnProperty.call(objB, currentKey) || !objectIs(objA[currentKey], objB[currentKey])) { return false; } } return true; } /** * Given any node return the first leaf node without children. * * @param {DOMElement|DOMTextNode} node * @return {DOMElement|DOMTextNode} */ function getLeafNode(node) { while (node && node.firstChild) { node = node.firstChild; } return node; } /** * Get the next sibling within a container. This will walk up the * DOM if a node's siblings have been exhausted. * * @param {DOMElement|DOMTextNode} node * @return {?DOMElement|DOMTextNode} */ function getSiblingNode(node) { while (node) { if (node.nextSibling) { return node.nextSibling; } node = node.parentNode; } } /** * Get object describing the nodes which contain characters at offset. * * @param {DOMElement|DOMTextNode} root * @param {number} offset * @return {?object} */ function getNodeForCharacterOffset(root, offset) { var node = getLeafNode(root); var nodeStart = 0; var nodeEnd = 0; while (node) { if (node.nodeType === TEXT_NODE) { nodeEnd = nodeStart + node.textContent.length; if (nodeStart <= offset && nodeEnd >= offset) { return { node: node, offset: offset - nodeStart }; } nodeStart = nodeEnd; } node = getLeafNode(getSiblingNode(node)); } } /** * @param {DOMElement} outerNode * @return {?object} */ function getOffsets(outerNode) { var ownerDocument = outerNode.ownerDocument; var win = ownerDocument && ownerDocument.defaultView || window; var selection = win.getSelection && win.getSelection(); if (!selection || selection.rangeCount === 0) { return null; } var anchorNode = selection.anchorNode, anchorOffset = selection.anchorOffset, focusNode = selection.focusNode, focusOffset = selection.focusOffset; // In Firefox, anchorNode and focusNode can be "anonymous divs", e.g. the // up/down buttons on an <input type="number">. Anonymous divs do not seem to // expose properties, triggering a "Permission denied error" if any of its // properties are accessed. The only seemingly possible way to avoid erroring // is to access a property that typically works for non-anonymous divs and // catch any error that may otherwise arise. See // https://bugzilla.mozilla.org/show_bug.cgi?id=208427 try { /* eslint-disable no-unused-expressions */ anchorNode.nodeType; focusNode.nodeType; /* eslint-enable no-unused-expressions */ } catch (e) { return null; } return getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset); } /** * Returns {start, end} where `start` is the character/codepoint index of * (anchorNode, anchorOffset) within the textContent of `outerNode`, and * `end` is the index of (focusNode, focusOffset). * * Returns null if you pass in garbage input but we should probably just crash. * * Exported only for testing. */ function getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset) { var length = 0; var start = -1; var end = -1; var indexWithinAnchor = 0; var indexWithinFocus = 0; var node = outerNode; var parentNode = null; outer: while (true) { var next = null; while (true) { if (node === anchorNode && (anchorOffset === 0 || node.nodeType === TEXT_NODE)) { start = length + anchorOffset; } if (node === focusNode && (focusOffset === 0 || node.nodeType === TEXT_NODE)) { end = length + focusOffset; } if (node.nodeType === TEXT_NODE) { length += node.nodeValue.length; } if ((next = node.firstChild) === null) { break; } // Moving from `node` to its first child `next`. parentNode = node; node = next; } while (true) { if (node === outerNode) { // If `outerNode` has children, this is always the second time visiting // it. If it has no children, this is still the first loop, and the only // valid selection is anchorNode and focusNode both equal to this node // and both offsets 0, in which case we will have handled above. break outer; } if (parentNode === anchorNode && ++indexWithinAnchor === anchorOffset) { start = length; } if (parentNode === focusNode && ++indexWithinFocus === focusOffset) { end = length; } if ((next = node.nextSibling) !== null) { break; } node = parentNode; parentNode = node.parentNode; } // Moving from `node` to its next sibling `next`. node = next; } if (start === -1 || end === -1) { // This should never happen. (Would happen if the anchor/focus nodes aren't // actually inside the passed-in node.) return null; } return { start: start, end: end }; } /** * In modern non-IE browsers, we can support both forward and backward * selections. * * Note: IE10+ supports the Selection object, but it does not support * the `extend` method, which means that even in modern IE, it's not possible * to programmatically create a backward selection. Thus, for all IE * versions, we use the old IE API to create our selections. * * @param {DOMElement|DOMTextNode} node * @param {object} offsets */ function setOffsets(node, offsets) { var doc = node.ownerDocument || document; var win = doc && doc.defaultView || window; // Edge fails with "Object expected" in some scenarios. // (For instance: TinyMCE editor used in a list component that supports pasting to add more, // fails when pasting 100+ items) if (!win.getSelection) { return; } var selection = win.getSelection(); var length = node.textContent.length; var start = Math.min(offsets.start, length); var end = offsets.end === undefined ? start : Math.min(offsets.end, length); // IE 11 uses modern selection, but doesn't support the extend method. // Flip backward selections, so we can set with a single range. if (!selection.extend && start > end) { var temp = end; end = start; start = temp; } var startMarker = getNodeForCharacterOffset(node, start); var endMarker = getNodeForCharacterOffset(node, end); if (startMarker && endMarker) { if (selection.rangeCount === 1 && selection.anchorNode === startMarker.node && selection.anchorOffset === startMarker.offset && selection.focusNode === endMarker.node && selection.focusOffset === endMarker.offset) { return; } var range = doc.createRange(); range.setStart(startMarker.node, startMarker.offset); selection.removeAllRanges(); if (start > end) { selection.addRange(range); selection.extend(endMarker.node, endMarker.offset); } else { range.setEnd(endMarker.node, endMarker.offset); selection.addRange(range); } } } function isTextNode(node) { return node && node.nodeType === TEXT_NODE; } function containsNode(outerNode, innerNode) { if (!outerNode || !innerNode) { return false; } else if (outerNode === innerNode) { return true; } else if (isTextNode(outerNode)) { return false; } else if (isTextNode(innerNode)) { return containsNode(outerNode, innerNode.parentNode); } else if ('contains' in outerNode) { return outerNode.contains(innerNode); } else if (outerNode.compareDocumentPosition) { return !!(outerNode.compareDocumentPosition(innerNode) & 16); } else { return false; } } function isInDocument(node) { return node && node.ownerDocument && containsNode(node.ownerDocument.documentElement, node); } function isSameOriginFrame(iframe) { try { // Accessing the contentDocument of a HTMLIframeElement can cause the browser // to throw, e.g. if it has a cross-origin src attribute. // Safari will show an error in the console when the access results in "Blocked a frame with origin". e.g: // iframe.contentDocument.defaultView; // A safety way is to access one of the cross origin properties: Window or Location // Which might result in "SecurityError" DOM Exception and it is compatible to Safari. // https://html.spec.whatwg.org/multipage/browsers.html#integration-with-idl return typeof iframe.contentWindow.location.href === 'string'; } catch (err) { return false; } } function getActiveElementDeep() { var win = window; var element = getActiveElement(); while (element instanceof win.HTMLIFrameElement) { if (isSameOriginFrame(element)) { win = element.contentWindow; } else { return element; } element = getActiveElement(win.document); } return element; } /** * @ReactInputSelection: React input selection module. Based on Selection.js, * but modified to be suitable for react and has a couple of bug fixes (doesn't * assume buttons have range selections allowed). * Input selection module for React. */ /** * @hasSelectionCapabilities: we get the element types that support selection * from https://html.spec.whatwg.org/#do-not-apply, looking at `selectionStart` * and `selectionEnd` rows. */ function hasSelectionCapabilities(elem) { var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase(); return nodeName && (nodeName === 'input' && (elem.type === 'text' || elem.type === 'search' || elem.type === 'tel' || elem.type === 'url' || elem.type === 'password') || nodeName === 'textarea' || elem.contentEditable === 'true'); } function getSelectionInformation() { var focusedElem = getActiveElementDeep(); return { focusedElem: focusedElem, selectionRange: hasSelectionCapabilities(focusedElem) ? getSelection(focusedElem) : null }; } /** * @restoreSelection: If any selection information was potentially lost, * restore it. This is useful when performing operations that could remove dom * nodes and place them back in, resulting in focus being lost. */ function restoreSelection(priorSelectionInformation) { var curFocusedElem = getActiveElementDeep(); var priorFocusedElem = priorSelectionInformation.focusedElem; var priorSelectionRange = priorSelectionInformation.selectionRange; if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) { if (priorSelectionRange !== null && hasSelectionCapabilities(priorFocusedElem)) { setSelection(priorFocusedElem, priorSelectionRange); } // Focusing a node can change the scroll position, which is undesirable var ancestors = []; var ancestor = priorFocusedElem; while (ancestor = ancestor.parentNode) { if (ancestor.nodeType === ELEMENT_NODE) { ancestors.push({ element: ancestor, left: ancestor.scrollLeft, top: ancestor.scrollTop }); } } if (typeof priorFocusedElem.focus === 'function') { priorFocusedElem.focus(); } for (var i = 0; i < ancestors.length; i++) { var info = ancestors[i]; info.element.scrollLeft = info.left; info.element.scrollTop = info.top; } } } /** * @getSelection: Gets the selection bounds of a focused textarea, input or * contentEditable node. * -@input: Look up selection bounds of this input * -@return {start: selectionStart, end: selectionEnd} */ function getSelection(input) { var selection; if ('selectionStart' in input) { // Modern browser with input or textarea. selection = { start: input.selectionStart, end: input.selectionEnd }; } else { // Content editable or old IE textarea. selection = getOffsets(input); } return selection || { start: 0, end: 0 }; } /** * @setSelection: Sets the selection bounds of a textarea or input and focuses * the input. * -@input Set selection bounds of this input or textarea * -@offsets Object of same form that is returned from get* */ function setSelection(input, offsets) { var start = offsets.start; var end = offsets.end; if (end === undefined) { end = start; } if ('selectionStart' in input) { input.selectionStart = start; input.selectionEnd = Math.min(end, input.value.length); } else { setOffsets(input, offsets); } } var skipSelectionChangeEvent = canUseDOM && 'documentMode' in document && document.documentMode <= 11; function registerEvents$3() { registerTwoPhaseEvent('onSelect', ['focusout', 'contextmenu', 'dragend', 'focusin', 'keydown', 'keyup', 'mousedown', 'mouseup', 'selectionchange']); } var activeElement$1 = null; var activeElementInst$1 = null; var lastSelection = null; var mouseDown = false; /** * Get an object which is a unique representation of the current selection. * * The return value will not be consistent across nodes or browsers, but * two identical selections on the same node will return identical objects. */ function getSelection$1(node) { if ('selectionStart' in node && hasSelectionCapabilities(node)) { return { start: node.selectionStart, end: node.selectionEnd }; } else { var win = node.ownerDocument && node.ownerDocument.defaultView || window; var selection = win.getSelection(); return { anchorNode: selection.anchorNode, anchorOffset: selection.anchorOffset, focusNode: selection.focusNode, focusOffset: selection.focusOffset }; } } /** * Get document associated with the event target. */ function getEventTargetDocument(eventTarget) { return eventTarget.window === eventTarget ? eventTarget.document : eventTarget.nodeType === DOCUMENT_NODE ? eventTarget : eventTarget.ownerDocument; } /** * Poll selection to see whether it's changed. * * @param {object} nativeEvent * @param {object} nativeEventTarget * @return {?SyntheticEvent} */ function constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget) { // Ensure we have the right element, and that the user is not dragging a // selection (this matches native `select` event behavior). In HTML5, select // fires only on input and textarea thus if there's no focused element we // won't dispatch. var doc = getEventTargetDocument(nativeEventTarget); if (mouseDown || activeElement$1 == null || activeElement$1 !== getActiveElement(doc)) { return; } // Only fire when selection has actually changed. var currentSelection = getSelection$1(activeElement$1); if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) { lastSelection = currentSelection; var listeners = accumulateTwoPhaseListeners(activeElementInst$1, 'onSelect'); if (listeners.length > 0) { var event = new SyntheticEvent('onSelect', 'select', null, nativeEvent, nativeEventTarget); dispatchQueue.push({ event: event, listeners: listeners }); event.target = activeElement$1; } } } /** * This plugin creates an `onSelect` event that normalizes select events * across form elements. * * Supported elements are: * - input (see `isTextInputElement`) * - textarea * - contentEditable * * This differs from native browser implementations in the following ways: * - Fires on contentEditable fields as well as inputs. * - Fires for collapsed selection. * - Fires after user input. */ function extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) { var targetNode = targetInst ? getNodeFromInstance(targetInst) : window; switch (domEventName) { // Track the input node that has focus. case 'focusin': if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') { activeElement$1 = targetNode; activeElementInst$1 = targetInst; lastSelection = null; } break; case 'focusout': activeElement$1 = null; activeElementInst$1 = null; lastSelection = null; break; // Don't fire the event while the user is dragging. This matches the // semantics of the native select event. case 'mousedown': mouseDown = true; break; case 'contextmenu': case 'mouseup': case 'dragend': mouseDown = false; constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget); break; // Chrome and IE fire non-standard event when selection is changed (and // sometimes when it hasn't). IE's event fires out of order with respect // to key and input events on deletion, so we discard it. // // Firefox doesn't support selectionchange, so check selection status // after each key entry. The selection changes after keydown and before // keyup, but we check on keydown as well in the case of holding down a // key, when multiple keydown events are fired but only one keyup is. // This is also our approach for IE handling, for the reason above. case 'selectionchange': if (skipSelectionChangeEvent) { break; } // falls through case 'keydown': case 'keyup': constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget); } } /** * Generate a mapping of standard vendor prefixes using the defined style property and event name. * * @param {string} styleProp * @param {string} eventName * @returns {object} */ function makePrefixMap(styleProp, eventName) { var prefixes = {}; prefixes[styleProp.toLowerCase()] = eventName.toLowerCase(); prefixes['Webkit' + styleProp] = 'webkit' + eventName; prefixes['Moz' + styleProp] = 'moz' + eventName; return prefixes; } /** * A list of event names to a configurable list of vendor prefixes. */ var vendorPrefixes = { animationend: makePrefixMap('Animation', 'AnimationEnd'), animationiteration: makePrefixMap('Animation', 'AnimationIteration'), animationstart: makePrefixMap('Animation', 'AnimationStart'), transitionend: makePrefixMap('Transition', 'TransitionEnd') }; /** * Event names that have already been detected and prefixed (if applicable). */ var prefixedEventNames = {}; /** * Element to check for prefixes on. */ var style = {}; /** * Bootstrap if a DOM exists. */ if (canUseDOM) { style = document.createElement('div').style; // On some platforms, in particular some releases of Android 4.x, // the un-prefixed "animation" and "transition" properties are defined on the // style object but the events that fire will still be prefixed, so we need // to check if the un-prefixed events are usable, and if not remove them from the map. if (!('AnimationEvent' in window)) { delete vendorPrefixes.animationend.animation; delete vendorPrefixes.animationiteration.animation; delete vendorPrefixes.animationstart.animation; } // Same as above if (!('TransitionEvent' in window)) { delete vendorPrefixes.transitionend.transition; } } /** * Attempts to determine the correct vendor prefixed event name. * * @param {string} eventName * @returns {string} */ function getVendorPrefixedEventName(eventName) { if (prefixedEventNames[eventName]) { return prefixedEventNames[eventName]; } else if (!vendorPrefixes[eventName]) { return eventName; } var prefixMap = vendorPrefixes[eventName]; for (var styleProp in prefixMap) { if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) { return prefixedEventNames[eventName] = prefixMap[styleProp]; } } return eventName; } var ANIMATION_END = getVendorPrefixedEventName('animationend'); var ANIMATION_ITERATION = getVendorPrefixedEventName('animationiteration'); var ANIMATION_START = getVendorPrefixedEventName('animationstart'); var TRANSITION_END = getVendorPrefixedEventName('transitionend'); var topLevelEventsToReactNames = new Map(); // NOTE: Capitalization is important in this list! // // E.g. it needs "pointerDown", not "pointerdown". // This is because we derive both React name ("onPointerDown") // and DOM name ("pointerdown") from the same list. // // Exceptions that don't match this convention are listed separately. // // prettier-ignore var simpleEventPluginEvents = ['abort', 'auxClick', 'cancel', 'canPlay', 'canPlayThrough', 'click', 'close', 'contextMenu', 'copy', 'cut', 'drag', 'dragEnd', 'dragEnter', 'dragExit', 'dragLeave', 'dragOver', 'dragStart', 'drop', 'durationChange', 'emptied', 'encrypted', 'ended', 'error', 'gotPointerCapture', 'input', 'invalid', 'keyDown', 'keyPress', 'keyUp', 'load', 'loadedData', 'loadedMetadata', 'loadStart', 'lostPointerCapture', 'mouseDown', 'mouseMove', 'mouseOut', 'mouseOver', 'mouseUp', 'paste', 'pause', 'play', 'playing', 'pointerCancel', 'pointerDown', 'pointerMove', 'pointerOut', 'pointerOver', 'pointerUp', 'progress', 'rateChange', 'reset', 'resize', 'seeked', 'seeking', 'stalled', 'submit', 'suspend', 'timeUpdate', 'touchCancel', 'touchEnd', 'touchStart', 'volumeChange', 'scroll', 'toggle', 'touchMove', 'waiting', 'wheel']; function registerSimpleEvent(domEventName, reactName) { topLevelEventsToReactNames.set(domEventName, reactName); registerTwoPhaseEvent(reactName, [domEventName]); } function registerSimpleEvents() { for (var i = 0; i < simpleEventPluginEvents.length; i++) { var eventName = simpleEventPluginEvents[i]; var domEventName = eventName.toLowerCase(); var capitalizedEvent = eventName[0].toUpperCase() + eventName.slice(1); registerSimpleEvent(domEventName, 'on' + capitalizedEvent); } // Special cases where event names don't match. registerSimpleEvent(ANIMATION_END, 'onAnimationEnd'); registerSimpleEvent(ANIMATION_ITERATION, 'onAnimationIteration'); registerSimpleEvent(ANIMATION_START, 'onAnimationStart'); registerSimpleEvent('dblclick', 'onDoubleClick'); registerSimpleEvent('focusin', 'onFocus'); registerSimpleEvent('focusout', 'onBlur'); registerSimpleEvent(TRANSITION_END, 'onTransitionEnd'); } function extractEvents$4(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) { var reactName = topLevelEventsToReactNames.get(domEventName); if (reactName === undefined) { return; } var SyntheticEventCtor = SyntheticEvent; var reactEventType = domEventName; switch (domEventName) { case 'keypress': // Firefox creates a keypress event for function keys too. This removes // the unwanted keypress events. Enter is however both printable and // non-printable. One would expect Tab to be as well (but it isn't). if (getEventCharCode(nativeEvent) === 0) { return; } /* falls through */ case 'keydown': case 'keyup': SyntheticEventCtor = SyntheticKeyboardEvent; break; case 'focusin': reactEventType = 'focus'; SyntheticEventCtor = SyntheticFocusEvent; break; case 'focusout': reactEventType = 'blur'; SyntheticEventCtor = SyntheticFocusEvent; break; case 'beforeblur': case 'afterblur': SyntheticEventCtor = SyntheticFocusEvent; break; case 'click': // Firefox creates a click event on right mouse clicks. This removes the // unwanted click events. if (nativeEvent.button === 2) { return; } /* falls through */ case 'auxclick': case 'dblclick': case 'mousedown': case 'mousemove': case 'mouseup': // TODO: Disabled elements should not respond to mouse events /* falls through */ case 'mouseout': case 'mouseover': case 'contextmenu': SyntheticEventCtor = SyntheticMouseEvent; break; case 'drag': case 'dragend': case 'dragenter': case 'dragexit': case 'dragleave': case 'dragover': case 'dragstart': case 'drop': SyntheticEventCtor = SyntheticDragEvent; break; case 'touchcancel': case 'touchend': case 'touchmove': case 'touchstart': SyntheticEventCtor = SyntheticTouchEvent; break; case ANIMATION_END: case ANIMATION_ITERATION: case ANIMATION_START: SyntheticEventCtor = SyntheticAnimationEvent; break; case TRANSITION_END: SyntheticEventCtor = SyntheticTransitionEvent; break; case 'scroll': SyntheticEventCtor = SyntheticUIEvent; break; case 'wheel': SyntheticEventCtor = SyntheticWheelEvent; break; case 'copy': case 'cut': case 'paste': SyntheticEventCtor = SyntheticClipboardEvent; break; case 'gotpointercapture': case 'lostpointercapture': case 'pointercancel': case 'pointerdown': case 'pointermove': case 'pointerout': case 'pointerover': case 'pointerup': SyntheticEventCtor = SyntheticPointerEvent; break; } var inCapturePhase = (eventSystemFlags & IS_CAPTURE_PHASE) !== 0; { // Some events don't bubble in the browser. // In the past, React has always bubbled them, but this can be surprising. // We're going to try aligning closer to the browser behavior by not bubbling // them in React either. We'll start by not bubbling onScroll, and then expand. var accumulateTargetOnly = !inCapturePhase && // TODO: ideally, we'd eventually add all events from // nonDelegatedEvents list in DOMPluginEventSystem. // Then we can remove this special list. // This is a breaking change that can wait until React 18. domEventName === 'scroll'; var _listeners = accumulateSinglePhaseListeners(targetInst, reactName, nativeEvent.type, inCapturePhase, accumulateTargetOnly); if (_listeners.length > 0) { // Intentionally create event lazily. var _event = new SyntheticEventCtor(reactName, reactEventType, null, nativeEvent, nativeEventTarget); dispatchQueue.push({ event: _event, listeners: _listeners }); } } } // TODO: remove top-level side effect. registerSimpleEvents(); registerEvents$2(); registerEvents$1(); registerEvents$3(); registerEvents(); function extractEvents$5(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) { // TODO: we should remove the concept of a "SimpleEventPlugin". // This is the basic functionality of the event system. All // the other plugins are essentially polyfills. So the plugin // should probably be inlined somewhere and have its logic // be core the to event system. This would potentially allow // us to ship builds of React without the polyfilled plugins below. extractEvents$4(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags); var shouldProcessPolyfillPlugins = (eventSystemFlags & SHOULD_NOT_PROCESS_POLYFILL_EVENT_PLUGINS) === 0; // We don't process these events unless we are in the // event's native "bubble" phase, which means that we're // not in the capture phase. That's because we emulate // the capture phase here still. This is a trade-off, // because in an ideal world we would not emulate and use // the phases properly, like we do with the SimpleEvent // plugin. However, the plugins below either expect // emulation (EnterLeave) or use state localized to that // plugin (BeforeInput, Change, Select). The state in // these modules complicates things, as you'll essentially // get the case where the capture phase event might change // state, only for the following bubble event to come in // later and not trigger anything as the state now // invalidates the heuristics of the event plugin. We // could alter all these plugins to work in such ways, but // that might cause other unknown side-effects that we // can't foresee right now. if (shouldProcessPolyfillPlugins) { extractEvents$2(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget); extractEvents$1(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget); extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget); extractEvents(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget); } } // List of events that need to be individually attached to media elements. var mediaEventTypes = ['abort', 'canplay', 'canplaythrough', 'durationchange', 'emptied', 'encrypted', 'ended', 'error', 'loadeddata', 'loadedmetadata', 'loadstart', 'pause', 'play', 'playing', 'progress', 'ratechange', 'resize', 'seeked', 'seeking', 'stalled', 'suspend', 'timeupdate', 'volumechange', 'waiting']; // We should not delegate these events to the container, but rather // set them on the actual target element itself. This is primarily // because these events do not consistently bubble in the DOM. var nonDelegatedEvents = new Set(['cancel', 'close', 'invalid', 'load', 'scroll', 'toggle'].concat(mediaEventTypes)); function executeDispatch(event, listener, currentTarget) { var type = event.type || 'unknown-event'; event.currentTarget = currentTarget; invokeGuardedCallbackAndCatchFirstError(type, listener, undefined, event); event.currentTarget = null; } function processDispatchQueueItemsInOrder(event, dispatchListeners, inCapturePhase) { var previousInstance; if (inCapturePhase) { for (var i = dispatchListeners.length - 1; i >= 0; i--) { var _dispatchListeners$i = dispatchListeners[i], instance = _dispatchListeners$i.instance, currentTarget = _dispatchListeners$i.currentTarget, listener = _dispatchListeners$i.listener; if (instance !== previousInstance && event.isPropagationStopped()) { return; } executeDispatch(event, listener, currentTarget); previousInstance = instance; } } else { for (var _i = 0; _i < dispatchListeners.length; _i++) { var _dispatchListeners$_i = dispatchListeners[_i], _instance = _dispatchListeners$_i.instance, _currentTarget = _dispatchListeners$_i.currentTarget, _listener = _dispatchListeners$_i.listener; if (_instance !== previousInstance && event.isPropagationStopped()) { return; } executeDispatch(event, _listener, _currentTarget); previousInstance = _instance; } } } function processDispatchQueue(dispatchQueue, eventSystemFlags) { var inCapturePhase = (eventSystemFlags & IS_CAPTURE_PHASE) !== 0; for (var i = 0; i < dispatchQueue.length; i++) { var _dispatchQueue$i = dispatchQueue[i], event = _dispatchQueue$i.event, listeners = _dispatchQueue$i.listeners; processDispatchQueueItemsInOrder(event, listeners, inCapturePhase); // event system doesn't use pooling. } // This would be a good time to rethrow if any of the event handlers threw. rethrowCaughtError(); } function dispatchEventsForPlugins(domEventName, eventSystemFlags, nativeEvent, targetInst, targetContainer) { var nativeEventTarget = getEventTarget(nativeEvent); var dispatchQueue = []; extractEvents$5(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags); processDispatchQueue(dispatchQueue, eventSystemFlags); } function listenToNonDelegatedEvent(domEventName, targetElement) { { if (!nonDelegatedEvents.has(domEventName)) { error('Did not expect a listenToNonDelegatedEvent() call for "%s". ' + 'This is a bug in React. Please file an issue.', domEventName); } } var isCapturePhaseListener = false; var listenerSet = getEventListenerSet(targetElement); var listenerSetKey = getListenerSetKey(domEventName, isCapturePhaseListener); if (!listenerSet.has(listenerSetKey)) { addTrappedEventListener(targetElement, domEventName, IS_NON_DELEGATED, isCapturePhaseListener); listenerSet.add(listenerSetKey); } } function listenToNativeEvent(domEventName, isCapturePhaseListener, target) { { if (nonDelegatedEvents.has(domEventName) && !isCapturePhaseListener) { error('Did not expect a listenToNativeEvent() call for "%s" in the bubble phase. ' + 'This is a bug in React. Please file an issue.', domEventName); } } var eventSystemFlags = 0; if (isCapturePhaseListener) { eventSystemFlags |= IS_CAPTURE_PHASE; } addTrappedEventListener(target, domEventName, eventSystemFlags, isCapturePhaseListener); } // This is only used by createEventHandle when the var listeningMarker = '_reactListening' + Math.random().toString(36).slice(2); function listenToAllSupportedEvents(rootContainerElement) { if (!rootContainerElement[listeningMarker]) { rootContainerElement[listeningMarker] = true; allNativeEvents.forEach(function (domEventName) { // We handle selectionchange separately because it // doesn't bubble and needs to be on the document. if (domEventName !== 'selectionchange') { if (!nonDelegatedEvents.has(domEventName)) { listenToNativeEvent(domEventName, false, rootContainerElement); } listenToNativeEvent(domEventName, true, rootContainerElement); } }); var ownerDocument = rootContainerElement.nodeType === DOCUMENT_NODE ? rootContainerElement : rootContainerElement.ownerDocument; if (ownerDocument !== null) { // The selectionchange event also needs deduplication // but it is attached to the document. if (!ownerDocument[listeningMarker]) { ownerDocument[listeningMarker] = true; listenToNativeEvent('selectionchange', false, ownerDocument); } } } } function addTrappedEventListener(targetContainer, domEventName, eventSystemFlags, isCapturePhaseListener, isDeferredListenerForLegacyFBSupport) { var listener = createEventListenerWrapperWithPriority(targetContainer, domEventName, eventSystemFlags); // If passive option is not supported, then the event will be // active and not passive. var isPassiveListener = undefined; if (passiveBrowserEventsSupported) { // Browsers introduced an intervention, making these events // passive by default on document. React doesn't bind them // to document anymore, but changing this now would undo // the performance wins from the change. So we emulate // the existing behavior manually on the roots now. // https://github.com/facebook/react/issues/19651 if (domEventName === 'touchstart' || domEventName === 'touchmove' || domEventName === 'wheel') { isPassiveListener = true; } } targetContainer = targetContainer; var unsubscribeListener; // When legacyFBSupport is enabled, it's for when we if (isCapturePhaseListener) { if (isPassiveListener !== undefined) { unsubscribeListener = addEventCaptureListenerWithPassiveFlag(targetContainer, domEventName, listener, isPassiveListener); } else { unsubscribeListener = addEventCaptureListener(targetContainer, domEventName, listener); } } else { if (isPassiveListener !== undefined) { unsubscribeListener = addEventBubbleListenerWithPassiveFlag(targetContainer, domEventName, listener, isPassiveListener); } else { unsubscribeListener = addEventBubbleListener(targetContainer, domEventName, listener); } } } function isMatchingRootContainer(grandContainer, targetContainer) { return grandContainer === targetContainer || grandContainer.nodeType === COMMENT_NODE && grandContainer.parentNode === targetContainer; } function dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, targetInst, targetContainer) { var ancestorInst = targetInst; if ((eventSystemFlags & IS_EVENT_HANDLE_NON_MANAGED_NODE) === 0 && (eventSystemFlags & IS_NON_DELEGATED) === 0) { var targetContainerNode = targetContainer; // If we are using the legacy FB support flag, we if (targetInst !== null) { // The below logic attempts to work out if we need to change // the target fiber to a different ancestor. We had similar logic // in the legacy event system, except the big difference between // systems is that the modern event system now has an event listener // attached to each React Root and React Portal Root. Together, // the DOM nodes representing these roots are the "rootContainer". // To figure out which ancestor instance we should use, we traverse // up the fiber tree from the target instance and attempt to find // root boundaries that match that of our current "rootContainer". // If we find that "rootContainer", we find the parent fiber // sub-tree for that root and make that our ancestor instance. var node = targetInst; mainLoop: while (true) { if (node === null) { return; } var nodeTag = node.tag; if (nodeTag === HostRoot || nodeTag === HostPortal) { var container = node.stateNode.containerInfo; if (isMatchingRootContainer(container, targetContainerNode)) { break; } if (nodeTag === HostPortal) { // The target is a portal, but it's not the rootContainer we're looking for. // Normally portals handle their own events all the way down to the root. // So we should be able to stop now. However, we don't know if this portal // was part of *our* root. var grandNode = node.return; while (grandNode !== null) { var grandTag = grandNode.tag; if (grandTag === HostRoot || grandTag === HostPortal) { var grandContainer = grandNode.stateNode.containerInfo; if (isMatchingRootContainer(grandContainer, targetContainerNode)) { // This is the rootContainer we're looking for and we found it as // a parent of the Portal. That means we can ignore it because the // Portal will bubble through to us. return; } } grandNode = grandNode.return; } } // Now we need to find it's corresponding host fiber in the other // tree. To do this we can use getClosestInstanceFromNode, but we // need to validate that the fiber is a host instance, otherwise // we need to traverse up through the DOM till we find the correct // node that is from the other tree. while (container !== null) { var parentNode = getClosestInstanceFromNode(container); if (parentNode === null) { return; } var parentTag = parentNode.tag; if (parentTag === HostComponent || parentTag === HostText) { node = ancestorInst = parentNode; continue mainLoop; } container = container.parentNode; } } node = node.return; } } } batchedUpdates(function () { return dispatchEventsForPlugins(domEventName, eventSystemFlags, nativeEvent, ancestorInst); }); } function createDispatchListener(instance, listener, currentTarget) { return { instance: instance, listener: listener, currentTarget: currentTarget }; } function accumulateSinglePhaseListeners(targetFiber, reactName, nativeEventType, inCapturePhase, accumulateTargetOnly, nativeEvent) { var captureName = reactName !== null ? reactName + 'Capture' : null; var reactEventName = inCapturePhase ? captureName : reactName; var listeners = []; var instance = targetFiber; var lastHostComponent = null; // Accumulate all instances and listeners via the target -> root path. while (instance !== null) { var _instance2 = instance, stateNode = _instance2.stateNode, tag = _instance2.tag; // Handle listeners that are on HostComponents (i.e. <div>) if (tag === HostComponent && stateNode !== null) { lastHostComponent = stateNode; // createEventHandle listeners if (reactEventName !== null) { var listener = getListener(instance, reactEventName); if (listener != null) { listeners.push(createDispatchListener(instance, listener, lastHostComponent)); } } } // If we are only accumulating events for the target, then we don't // continue to propagate through the React fiber tree to find other // listeners. if (accumulateTargetOnly) { break; } // If we are processing the onBeforeBlur event, then we need to take instance = instance.return; } return listeners; } // We should only use this function for: // - BeforeInputEventPlugin // - ChangeEventPlugin // - SelectEventPlugin // This is because we only process these plugins // in the bubble phase, so we need to accumulate two // phase event listeners (via emulation). function accumulateTwoPhaseListeners(targetFiber, reactName) { var captureName = reactName + 'Capture'; var listeners = []; var instance = targetFiber; // Accumulate all instances and listeners via the target -> root path. while (instance !== null) { var _instance3 = instance, stateNode = _instance3.stateNode, tag = _instance3.tag; // Handle listeners that are on HostComponents (i.e. <div>) if (tag === HostComponent && stateNode !== null) { var currentTarget = stateNode; var captureListener = getListener(instance, captureName); if (captureListener != null) { listeners.unshift(createDispatchListener(instance, captureListener, currentTarget)); } var bubbleListener = getListener(instance, reactName); if (bubbleListener != null) { listeners.push(createDispatchListener(instance, bubbleListener, currentTarget)); } } instance = instance.return; } return listeners; } function getParent(inst) { if (inst === null) { return null; } do { inst = inst.return; // TODO: If this is a HostRoot we might want to bail out. // That is depending on if we want nested subtrees (layers) to bubble // events to their parent. We could also go through parentNode on the // host node but that wouldn't work for React Native and doesn't let us // do the portal feature. } while (inst && inst.tag !== HostComponent); if (inst) { return inst; } return null; } /** * Return the lowest common ancestor of A and B, or null if they are in * different trees. */ function getLowestCommonAncestor(instA, instB) { var nodeA = instA; var nodeB = instB; var depthA = 0; for (var tempA = nodeA; tempA; tempA = getParent(tempA)) { depthA++; } var depthB = 0; for (var tempB = nodeB; tempB; tempB = getParent(tempB)) { depthB++; } // If A is deeper, crawl up. while (depthA - depthB > 0) { nodeA = getParent(nodeA); depthA--; } // If B is deeper, crawl up. while (depthB - depthA > 0) { nodeB = getParent(nodeB); depthB--; } // Walk in lockstep until we find a match. var depth = depthA; while (depth--) { if (nodeA === nodeB || nodeB !== null && nodeA === nodeB.alternate) { return nodeA; } nodeA = getParent(nodeA); nodeB = getParent(nodeB); } return null; } function accumulateEnterLeaveListenersForEvent(dispatchQueue, event, target, common, inCapturePhase) { var registrationName = event._reactName; var listeners = []; var instance = target; while (instance !== null) { if (instance === common) { break; } var _instance4 = instance, alternate = _instance4.alternate, stateNode = _instance4.stateNode, tag = _instance4.tag; if (alternate !== null && alternate === common) { break; } if (tag === HostComponent && stateNode !== null) { var currentTarget = stateNode; if (inCapturePhase) { var captureListener = getListener(instance, registrationName); if (captureListener != null) { listeners.unshift(createDispatchListener(instance, captureListener, currentTarget)); } } else if (!inCapturePhase) { var bubbleListener = getListener(instance, registrationName); if (bubbleListener != null) { listeners.push(createDispatchListener(instance, bubbleListener, currentTarget)); } } } instance = instance.return; } if (listeners.length !== 0) { dispatchQueue.push({ event: event, listeners: listeners }); } } // We should only use this function for: // - EnterLeaveEventPlugin // This is because we only process this plugin // in the bubble phase, so we need to accumulate two // phase event listeners. function accumulateEnterLeaveTwoPhaseListeners(dispatchQueue, leaveEvent, enterEvent, from, to) { var common = from && to ? getLowestCommonAncestor(from, to) : null; if (from !== null) { accumulateEnterLeaveListenersForEvent(dispatchQueue, leaveEvent, from, common, false); } if (to !== null && enterEvent !== null) { accumulateEnterLeaveListenersForEvent(dispatchQueue, enterEvent, to, common, true); } } function getListenerSetKey(domEventName, capture) { return domEventName + "__" + (capture ? 'capture' : 'bubble'); } var didWarnInvalidHydration = false; var DANGEROUSLY_SET_INNER_HTML = 'dangerouslySetInnerHTML'; var SUPPRESS_CONTENT_EDITABLE_WARNING = 'suppressContentEditableWarning'; var SUPPRESS_HYDRATION_WARNING = 'suppressHydrationWarning'; var AUTOFOCUS = 'autoFocus'; var CHILDREN = 'children'; var STYLE = 'style'; var HTML$1 = '__html'; var warnedUnknownTags; var validatePropertiesInDevelopment; var warnForPropDifference; var warnForExtraAttributes; var warnForInvalidEventListener; var canDiffStyleForHydrationWarning; var normalizeHTML; { warnedUnknownTags = { // There are working polyfills for <dialog>. Let people use it. dialog: true, // Electron ships a custom <webview> tag to display external web content in // an isolated frame and process. // This tag is not present in non Electron environments such as JSDom which // is often used for testing purposes. // @see https://electronjs.org/docs/api/webview-tag webview: true }; validatePropertiesInDevelopment = function (type, props) { validateProperties(type, props); validateProperties$1(type, props); validateProperties$2(type, props, { registrationNameDependencies: registrationNameDependencies, possibleRegistrationNames: possibleRegistrationNames }); }; // IE 11 parses & normalizes the style attribute as opposed to other // browsers. It adds spaces and sorts the properties in some // non-alphabetical order. Handling that would require sorting CSS // properties in the client & server versions or applying // `expectedStyle` to a temporary DOM node to read its `style` attribute // normalized. Since it only affects IE, we're skipping style warnings // in that browser completely in favor of doing all that work. // See https://github.com/facebook/react/issues/11807 canDiffStyleForHydrationWarning = canUseDOM && !document.documentMode; warnForPropDifference = function (propName, serverValue, clientValue) { if (didWarnInvalidHydration) { return; } var normalizedClientValue = normalizeMarkupForTextOrAttribute(clientValue); var normalizedServerValue = normalizeMarkupForTextOrAttribute(serverValue); if (normalizedServerValue === normalizedClientValue) { return; } didWarnInvalidHydration = true; error('Prop `%s` did not match. Server: %s Client: %s', propName, JSON.stringify(normalizedServerValue), JSON.stringify(normalizedClientValue)); }; warnForExtraAttributes = function (attributeNames) { if (didWarnInvalidHydration) { return; } didWarnInvalidHydration = true; var names = []; attributeNames.forEach(function (name) { names.push(name); }); error('Extra attributes from the server: %s', names); }; warnForInvalidEventListener = function (registrationName, listener) { if (listener === false) { error('Expected `%s` listener to be a function, instead got `false`.\n\n' + 'If you used to conditionally omit it with %s={condition && value}, ' + 'pass %s={condition ? value : undefined} instead.', registrationName, registrationName, registrationName); } else { error('Expected `%s` listener to be a function, instead got a value of `%s` type.', registrationName, typeof listener); } }; // Parse the HTML and read it back to normalize the HTML string so that it // can be used for comparison. normalizeHTML = function (parent, html) { // We could have created a separate document here to avoid // re-initializing custom elements if they exist. But this breaks // how <noscript> is being handled. So we use the same document. // See the discussion in https://github.com/facebook/react/pull/11157. var testElement = parent.namespaceURI === HTML_NAMESPACE ? parent.ownerDocument.createElement(parent.tagName) : parent.ownerDocument.createElementNS(parent.namespaceURI, parent.tagName); testElement.innerHTML = html; return testElement.innerHTML; }; } // HTML parsing normalizes CR and CRLF to LF. // It also can turn \u0000 into \uFFFD inside attributes. // https://www.w3.org/TR/html5/single-page.html#preprocessing-the-input-stream // If we have a mismatch, it might be caused by that. // We will still patch up in this case but not fire the warning. var NORMALIZE_NEWLINES_REGEX = /\r\n?/g; var NORMALIZE_NULL_AND_REPLACEMENT_REGEX = /\u0000|\uFFFD/g; function normalizeMarkupForTextOrAttribute(markup) { { checkHtmlStringCoercion(markup); } var markupString = typeof markup === 'string' ? markup : '' + markup; return markupString.replace(NORMALIZE_NEWLINES_REGEX, '\n').replace(NORMALIZE_NULL_AND_REPLACEMENT_REGEX, ''); } function checkForUnmatchedText(serverText, clientText, isConcurrentMode, shouldWarnDev) { var normalizedClientText = normalizeMarkupForTextOrAttribute(clientText); var normalizedServerText = normalizeMarkupForTextOrAttribute(serverText); if (normalizedServerText === normalizedClientText) { return; } if (shouldWarnDev) { { if (!didWarnInvalidHydration) { didWarnInvalidHydration = true; error('Text content did not match. Server: "%s" Client: "%s"', normalizedServerText, normalizedClientText); } } } if (isConcurrentMode && enableClientRenderFallbackOnTextMismatch) { // In concurrent roots, we throw when there's a text mismatch and revert to // client rendering, up to the nearest Suspense boundary. throw new Error('Text content does not match server-rendered HTML.'); } } function getOwnerDocumentFromRootContainer(rootContainerElement) { return rootContainerElement.nodeType === DOCUMENT_NODE ? rootContainerElement : rootContainerElement.ownerDocument; } function noop() {} function trapClickOnNonInteractiveElement(node) { // Mobile Safari does not fire properly bubble click events on // non-interactive elements, which means delegated click listeners do not // fire. The workaround for this bug involves attaching an empty click // listener on the target node. // https://www.quirksmode.org/blog/archives/2010/09/click_event_del.html // Just set it using the onclick property so that we don't have to manage any // bookkeeping for it. Not sure if we need to clear it when the listener is // removed. // TODO: Only do this for the relevant Safaris maybe? node.onclick = noop; } function setInitialDOMProperties(tag, domElement, rootContainerElement, nextProps, isCustomComponentTag) { for (var propKey in nextProps) { if (!nextProps.hasOwnProperty(propKey)) { continue; } var nextProp = nextProps[propKey]; if (propKey === STYLE) { { if (nextProp) { // Freeze the next style object so that we can assume it won't be // mutated. We have already warned for this in the past. Object.freeze(nextProp); } } // Relies on `updateStylesByID` not mutating `styleUpdates`. setValueForStyles(domElement, nextProp); } else if (propKey === DANGEROUSLY_SET_INNER_HTML) { var nextHtml = nextProp ? nextProp[HTML$1] : undefined; if (nextHtml != null) { setInnerHTML(domElement, nextHtml); } } else if (propKey === CHILDREN) { if (typeof nextProp === 'string') { // Avoid setting initial textContent when the text is empty. In IE11 setting // textContent on a <textarea> will cause the placeholder to not // show within the <textarea> until it has been focused and blurred again. // https://github.com/facebook/react/issues/6731#issuecomment-254874553 var canSetTextContent = tag !== 'textarea' || nextProp !== ''; if (canSetTextContent) { setTextContent(domElement, nextProp); } } else if (typeof nextProp === 'number') { setTextContent(domElement, '' + nextProp); } } else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING) ; else if (propKey === AUTOFOCUS) ; else if (registrationNameDependencies.hasOwnProperty(propKey)) { if (nextProp != null) { if ( typeof nextProp !== 'function') { warnForInvalidEventListener(propKey, nextProp); } if (propKey === 'onScroll') { listenToNonDelegatedEvent('scroll', domElement); } } } else if (nextProp != null) { setValueForProperty(domElement, propKey, nextProp, isCustomComponentTag); } } } function updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag) { // TODO: Handle wasCustomComponentTag for (var i = 0; i < updatePayload.length; i += 2) { var propKey = updatePayload[i]; var propValue = updatePayload[i + 1]; if (propKey === STYLE) { setValueForStyles(domElement, propValue); } else if (propKey === DANGEROUSLY_SET_INNER_HTML) { setInnerHTML(domElement, propValue); } else if (propKey === CHILDREN) { setTextContent(domElement, propValue); } else { setValueForProperty(domElement, propKey, propValue, isCustomComponentTag); } } } function createElement(type, props, rootContainerElement, parentNamespace) { var isCustomComponentTag; // We create tags in the namespace of their parent container, except HTML // tags get no namespace. var ownerDocument = getOwnerDocumentFromRootContainer(rootContainerElement); var domElement; var namespaceURI = parentNamespace; if (namespaceURI === HTML_NAMESPACE) { namespaceURI = getIntrinsicNamespace(type); } if (namespaceURI === HTML_NAMESPACE) { { isCustomComponentTag = isCustomComponent(type, props); // Should this check be gated by parent namespace? Not sure we want to // allow <SVG> or <mATH>. if (!isCustomComponentTag && type !== type.toLowerCase()) { error('<%s /> is using incorrect casing. ' + 'Use PascalCase for React components, ' + 'or lowercase for HTML elements.', type); } } if (type === 'script') { // Create the script via .innerHTML so its "parser-inserted" flag is // set to true and it does not execute var div = ownerDocument.createElement('div'); div.innerHTML = '<script><' + '/script>'; // eslint-disable-line // This is guaranteed to yield a script element. var firstChild = div.firstChild; domElement = div.removeChild(firstChild); } else if (typeof props.is === 'string') { // $FlowIssue `createElement` should be updated for Web Components domElement = ownerDocument.createElement(type, { is: props.is }); } else { // Separate else branch instead of using `props.is || undefined` above because of a Firefox bug. // See discussion in https://github.com/facebook/react/pull/6896 // and discussion in https://bugzilla.mozilla.org/show_bug.cgi?id=1276240 domElement = ownerDocument.createElement(type); // Normally attributes are assigned in `setInitialDOMProperties`, however the `multiple` and `size` // attributes on `select`s needs to be added before `option`s are inserted. // This prevents: // - a bug where the `select` does not scroll to the correct option because singular // `select` elements automatically pick the first item #13222 // - a bug where the `select` set the first item as selected despite the `size` attribute #14239 // See https://github.com/facebook/react/issues/13222 // and https://github.com/facebook/react/issues/14239 if (type === 'select') { var node = domElement; if (props.multiple) { node.multiple = true; } else if (props.size) { // Setting a size greater than 1 causes a select to behave like `multiple=true`, where // it is possible that no option is selected. // // This is only necessary when a select in "single selection mode". node.size = props.size; } } } } else { domElement = ownerDocument.createElementNS(namespaceURI, type); } { if (namespaceURI === HTML_NAMESPACE) { if (!isCustomComponentTag && Object.prototype.toString.call(domElement) === '[object HTMLUnknownElement]' && !hasOwnProperty.call(warnedUnknownTags, type)) { warnedUnknownTags[type] = true; error('The tag <%s> is unrecognized in this browser. ' + 'If you meant to render a React component, start its name with ' + 'an uppercase letter.', type); } } } return domElement; } function createTextNode(text, rootContainerElement) { return getOwnerDocumentFromRootContainer(rootContainerElement).createTextNode(text); } function setInitialProperties(domElement, tag, rawProps, rootContainerElement) { var isCustomComponentTag = isCustomComponent(tag, rawProps); { validatePropertiesInDevelopment(tag, rawProps); } // TODO: Make sure that we check isMounted before firing any of these events. var props; switch (tag) { case 'dialog': listenToNonDelegatedEvent('cancel', domElement); listenToNonDelegatedEvent('close', domElement); props = rawProps; break; case 'iframe': case 'object': case 'embed': // We listen to this event in case to ensure emulated bubble // listeners still fire for the load event. listenToNonDelegatedEvent('load', domElement); props = rawProps; break; case 'video': case 'audio': // We listen to these events in case to ensure emulated bubble // listeners still fire for all the media events. for (var i = 0; i < mediaEventTypes.length; i++) { listenToNonDelegatedEvent(mediaEventTypes[i], domElement); } props = rawProps; break; case 'source': // We listen to this event in case to ensure emulated bubble // listeners still fire for the error event. listenToNonDelegatedEvent('error', domElement); props = rawProps; break; case 'img': case 'image': case 'link': // We listen to these events in case to ensure emulated bubble // listeners still fire for error and load events. listenToNonDelegatedEvent('error', domElement); listenToNonDelegatedEvent('load', domElement); props = rawProps; break; case 'details': // We listen to this event in case to ensure emulated bubble // listeners still fire for the toggle event. listenToNonDelegatedEvent('toggle', domElement); props = rawProps; break; case 'input': initWrapperState(domElement, rawProps); props = getHostProps(domElement, rawProps); // We listen to this event in case to ensure emulated bubble // listeners still fire for the invalid event. listenToNonDelegatedEvent('invalid', domElement); break; case 'option': validateProps(domElement, rawProps); props = rawProps; break; case 'select': initWrapperState$1(domElement, rawProps); props = getHostProps$1(domElement, rawProps); // We listen to this event in case to ensure emulated bubble // listeners still fire for the invalid event. listenToNonDelegatedEvent('invalid', domElement); break; case 'textarea': initWrapperState$2(domElement, rawProps); props = getHostProps$2(domElement, rawProps); // We listen to this event in case to ensure emulated bubble // listeners still fire for the invalid event. listenToNonDelegatedEvent('invalid', domElement); break; default: props = rawProps; } assertValidProps(tag, props); setInitialDOMProperties(tag, domElement, rootContainerElement, props, isCustomComponentTag); switch (tag) { case 'input': // TODO: Make sure we check if this is still unmounted or do any clean // up necessary since we never stop tracking anymore. track(domElement); postMountWrapper(domElement, rawProps, false); break; case 'textarea': // TODO: Make sure we check if this is still unmounted or do any clean // up necessary since we never stop tracking anymore. track(domElement); postMountWrapper$3(domElement); break; case 'option': postMountWrapper$1(domElement, rawProps); break; case 'select': postMountWrapper$2(domElement, rawProps); break; default: if (typeof props.onClick === 'function') { // TODO: This cast may not be sound for SVG, MathML or custom elements. trapClickOnNonInteractiveElement(domElement); } break; } } // Calculate the diff between the two objects. function diffProperties(domElement, tag, lastRawProps, nextRawProps, rootContainerElement) { { validatePropertiesInDevelopment(tag, nextRawProps); } var updatePayload = null; var lastProps; var nextProps; switch (tag) { case 'input': lastProps = getHostProps(domElement, lastRawProps); nextProps = getHostProps(domElement, nextRawProps); updatePayload = []; break; case 'select': lastProps = getHostProps$1(domElement, lastRawProps); nextProps = getHostProps$1(domElement, nextRawProps); updatePayload = []; break; case 'textarea': lastProps = getHostProps$2(domElement, lastRawProps); nextProps = getHostProps$2(domElement, nextRawProps); updatePayload = []; break; default: lastProps = lastRawProps; nextProps = nextRawProps; if (typeof lastProps.onClick !== 'function' && typeof nextProps.onClick === 'function') { // TODO: This cast may not be sound for SVG, MathML or custom elements. trapClickOnNonInteractiveElement(domElement); } break; } assertValidProps(tag, nextProps); var propKey; var styleName; var styleUpdates = null; for (propKey in lastProps) { if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty(propKey) || lastProps[propKey] == null) { continue; } if (propKey === STYLE) { var lastStyle = lastProps[propKey]; for (styleName in lastStyle) { if (lastStyle.hasOwnProperty(styleName)) { if (!styleUpdates) { styleUpdates = {}; } styleUpdates[styleName] = ''; } } } else if (propKey === DANGEROUSLY_SET_INNER_HTML || propKey === CHILDREN) ; else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING) ; else if (propKey === AUTOFOCUS) ; else if (registrationNameDependencies.hasOwnProperty(propKey)) { // This is a special case. If any listener updates we need to ensure // that the "current" fiber pointer gets updated so we need a commit // to update this element. if (!updatePayload) { updatePayload = []; } } else { // For all other deleted properties we add it to the queue. We use // the allowed property list in the commit phase instead. (updatePayload = updatePayload || []).push(propKey, null); } } for (propKey in nextProps) { var nextProp = nextProps[propKey]; var lastProp = lastProps != null ? lastProps[propKey] : undefined; if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp || nextProp == null && lastProp == null) { continue; } if (propKey === STYLE) { { if (nextProp) { // Freeze the next style object so that we can assume it won't be // mutated. We have already warned for this in the past. Object.freeze(nextProp); } } if (lastProp) { // Unset styles on `lastProp` but not on `nextProp`. for (styleName in lastProp) { if (lastProp.hasOwnProperty(styleName) && (!nextProp || !nextProp.hasOwnProperty(styleName))) { if (!styleUpdates) { styleUpdates = {}; } styleUpdates[styleName] = ''; } } // Update styles that changed since `lastProp`. for (styleName in nextProp) { if (nextProp.hasOwnProperty(styleName) && lastProp[styleName] !== nextProp[styleName]) { if (!styleUpdates) { styleUpdates = {}; } styleUpdates[styleName] = nextProp[styleName]; } } } else { // Relies on `updateStylesByID` not mutating `styleUpdates`. if (!styleUpdates) { if (!updatePayload) { updatePayload = []; } updatePayload.push(propKey, styleUpdates); } styleUpdates = nextProp; } } else if (propKey === DANGEROUSLY_SET_INNER_HTML) { var nextHtml = nextProp ? nextProp[HTML$1] : undefined; var lastHtml = lastProp ? lastProp[HTML$1] : undefined; if (nextHtml != null) { if (lastHtml !== nextHtml) { (updatePayload = updatePayload || []).push(propKey, nextHtml); } } } else if (propKey === CHILDREN) { if (typeof nextProp === 'string' || typeof nextProp === 'number') { (updatePayload = updatePayload || []).push(propKey, '' + nextProp); } } else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING) ; else if (registrationNameDependencies.hasOwnProperty(propKey)) { if (nextProp != null) { // We eagerly listen to this even though we haven't committed yet. if ( typeof nextProp !== 'function') { warnForInvalidEventListener(propKey, nextProp); } if (propKey === 'onScroll') { listenToNonDelegatedEvent('scroll', domElement); } } if (!updatePayload && lastProp !== nextProp) { // This is a special case. If any listener updates we need to ensure // that the "current" props pointer gets updated so we need a commit // to update this element. updatePayload = []; } } else { // For any other property we always add it to the queue and then we // filter it out using the allowed property list during the commit. (updatePayload = updatePayload || []).push(propKey, nextProp); } } if (styleUpdates) { { validateShorthandPropertyCollisionInDev(styleUpdates, nextProps[STYLE]); } (updatePayload = updatePayload || []).push(STYLE, styleUpdates); } return updatePayload; } // Apply the diff. function updateProperties(domElement, updatePayload, tag, lastRawProps, nextRawProps) { // Update checked *before* name. // In the middle of an update, it is possible to have multiple checked. // When a checked radio tries to change name, browser makes another radio's checked false. if (tag === 'input' && nextRawProps.type === 'radio' && nextRawProps.name != null) { updateChecked(domElement, nextRawProps); } var wasCustomComponentTag = isCustomComponent(tag, lastRawProps); var isCustomComponentTag = isCustomComponent(tag, nextRawProps); // Apply the diff. updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag); // TODO: Ensure that an update gets scheduled if any of the special props // changed. switch (tag) { case 'input': // Update the wrapper around inputs *after* updating props. This has to // happen after `updateDOMProperties`. Otherwise HTML5 input validations // raise warnings and prevent the new value from being assigned. updateWrapper(domElement, nextRawProps); break; case 'textarea': updateWrapper$1(domElement, nextRawProps); break; case 'select': // <select> value update needs to occur after <option> children // reconciliation postUpdateWrapper(domElement, nextRawProps); break; } } function getPossibleStandardName(propName) { { var lowerCasedName = propName.toLowerCase(); if (!possibleStandardNames.hasOwnProperty(lowerCasedName)) { return null; } return possibleStandardNames[lowerCasedName] || null; } } function diffHydratedProperties(domElement, tag, rawProps, parentNamespace, rootContainerElement, isConcurrentMode, shouldWarnDev) { var isCustomComponentTag; var extraAttributeNames; { isCustomComponentTag = isCustomComponent(tag, rawProps); validatePropertiesInDevelopment(tag, rawProps); } // TODO: Make sure that we check isMounted before firing any of these events. switch (tag) { case 'dialog': listenToNonDelegatedEvent('cancel', domElement); listenToNonDelegatedEvent('close', domElement); break; case 'iframe': case 'object': case 'embed': // We listen to this event in case to ensure emulated bubble // listeners still fire for the load event. listenToNonDelegatedEvent('load', domElement); break; case 'video': case 'audio': // We listen to these events in case to ensure emulated bubble // listeners still fire for all the media events. for (var i = 0; i < mediaEventTypes.length; i++) { listenToNonDelegatedEvent(mediaEventTypes[i], domElement); } break; case 'source': // We listen to this event in case to ensure emulated bubble // listeners still fire for the error event. listenToNonDelegatedEvent('error', domElement); break; case 'img': case 'image': case 'link': // We listen to these events in case to ensure emulated bubble // listeners still fire for error and load events. listenToNonDelegatedEvent('error', domElement); listenToNonDelegatedEvent('load', domElement); break; case 'details': // We listen to this event in case to ensure emulated bubble // listeners still fire for the toggle event. listenToNonDelegatedEvent('toggle', domElement); break; case 'input': initWrapperState(domElement, rawProps); // We listen to this event in case to ensure emulated bubble // listeners still fire for the invalid event. listenToNonDelegatedEvent('invalid', domElement); break; case 'option': validateProps(domElement, rawProps); break; case 'select': initWrapperState$1(domElement, rawProps); // We listen to this event in case to ensure emulated bubble // listeners still fire for the invalid event. listenToNonDelegatedEvent('invalid', domElement); break; case 'textarea': initWrapperState$2(domElement, rawProps); // We listen to this event in case to ensure emulated bubble // listeners still fire for the invalid event. listenToNonDelegatedEvent('invalid', domElement); break; } assertValidProps(tag, rawProps); { extraAttributeNames = new Set(); var attributes = domElement.attributes; for (var _i = 0; _i < attributes.length; _i++) { var name = attributes[_i].name.toLowerCase(); switch (name) { // Controlled attributes are not validated // TODO: Only ignore them on controlled tags. case 'value': break; case 'checked': break; case 'selected': break; default: // Intentionally use the original name. // See discussion in https://github.com/facebook/react/pull/10676. extraAttributeNames.add(attributes[_i].name); } } } var updatePayload = null; for (var propKey in rawProps) { if (!rawProps.hasOwnProperty(propKey)) { continue; } var nextProp = rawProps[propKey]; if (propKey === CHILDREN) { // For text content children we compare against textContent. This // might match additional HTML that is hidden when we read it using // textContent. E.g. "foo" will match "f<span>oo</span>" but that still // satisfies our requirement. Our requirement is not to produce perfect // HTML and attributes. Ideally we should preserve structure but it's // ok not to if the visible content is still enough to indicate what // even listeners these nodes might be wired up to. // TODO: Warn if there is more than a single textNode as a child. // TODO: Should we use domElement.firstChild.nodeValue to compare? if (typeof nextProp === 'string') { if (domElement.textContent !== nextProp) { if (rawProps[SUPPRESS_HYDRATION_WARNING] !== true) { checkForUnmatchedText(domElement.textContent, nextProp, isConcurrentMode, shouldWarnDev); } updatePayload = [CHILDREN, nextProp]; } } else if (typeof nextProp === 'number') { if (domElement.textContent !== '' + nextProp) { if (rawProps[SUPPRESS_HYDRATION_WARNING] !== true) { checkForUnmatchedText(domElement.textContent, nextProp, isConcurrentMode, shouldWarnDev); } updatePayload = [CHILDREN, '' + nextProp]; } } } else if (registrationNameDependencies.hasOwnProperty(propKey)) { if (nextProp != null) { if ( typeof nextProp !== 'function') { warnForInvalidEventListener(propKey, nextProp); } if (propKey === 'onScroll') { listenToNonDelegatedEvent('scroll', domElement); } } } else if (shouldWarnDev && true && // Convince Flow we've calculated it (it's DEV-only in this method.) typeof isCustomComponentTag === 'boolean') { // Validate that the properties correspond to their expected values. var serverValue = void 0; var propertyInfo = isCustomComponentTag && enableCustomElementPropertySupport ? null : getPropertyInfo(propKey); if (rawProps[SUPPRESS_HYDRATION_WARNING] === true) ; else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING || // Controlled attributes are not validated // TODO: Only ignore them on controlled tags. propKey === 'value' || propKey === 'checked' || propKey === 'selected') ; else if (propKey === DANGEROUSLY_SET_INNER_HTML) { var serverHTML = domElement.innerHTML; var nextHtml = nextProp ? nextProp[HTML$1] : undefined; if (nextHtml != null) { var expectedHTML = normalizeHTML(domElement, nextHtml); if (expectedHTML !== serverHTML) { warnForPropDifference(propKey, serverHTML, expectedHTML); } } } else if (propKey === STYLE) { // $FlowFixMe - Should be inferred as not undefined. extraAttributeNames.delete(propKey); if (canDiffStyleForHydrationWarning) { var expectedStyle = createDangerousStringForStyles(nextProp); serverValue = domElement.getAttribute('style'); if (expectedStyle !== serverValue) { warnForPropDifference(propKey, serverValue, expectedStyle); } } } else if (isCustomComponentTag && !enableCustomElementPropertySupport) { // $FlowFixMe - Should be inferred as not undefined. extraAttributeNames.delete(propKey.toLowerCase()); serverValue = getValueForAttribute(domElement, propKey, nextProp); if (nextProp !== serverValue) { warnForPropDifference(propKey, serverValue, nextProp); } } else if (!shouldIgnoreAttribute(propKey, propertyInfo, isCustomComponentTag) && !shouldRemoveAttribute(propKey, nextProp, propertyInfo, isCustomComponentTag)) { var isMismatchDueToBadCasing = false; if (propertyInfo !== null) { // $FlowFixMe - Should be inferred as not undefined. extraAttributeNames.delete(propertyInfo.attributeName); serverValue = getValueForProperty(domElement, propKey, nextProp, propertyInfo); } else { var ownNamespace = parentNamespace; if (ownNamespace === HTML_NAMESPACE) { ownNamespace = getIntrinsicNamespace(tag); } if (ownNamespace === HTML_NAMESPACE) { // $FlowFixMe - Should be inferred as not undefined. extraAttributeNames.delete(propKey.toLowerCase()); } else { var standardName = getPossibleStandardName(propKey); if (standardName !== null && standardName !== propKey) { // If an SVG prop is supplied with bad casing, it will // be successfully parsed from HTML, but will produce a mismatch // (and would be incorrectly rendered on the client). // However, we already warn about bad casing elsewhere. // So we'll skip the misleading extra mismatch warning in this case. isMismatchDueToBadCasing = true; // $FlowFixMe - Should be inferred as not undefined. extraAttributeNames.delete(standardName); } // $FlowFixMe - Should be inferred as not undefined. extraAttributeNames.delete(propKey); } serverValue = getValueForAttribute(domElement, propKey, nextProp); } var dontWarnCustomElement = enableCustomElementPropertySupport ; if (!dontWarnCustomElement && nextProp !== serverValue && !isMismatchDueToBadCasing) { warnForPropDifference(propKey, serverValue, nextProp); } } } } { if (shouldWarnDev) { if ( // $FlowFixMe - Should be inferred as not undefined. extraAttributeNames.size > 0 && rawProps[SUPPRESS_HYDRATION_WARNING] !== true) { // $FlowFixMe - Should be inferred as not undefined. warnForExtraAttributes(extraAttributeNames); } } } switch (tag) { case 'input': // TODO: Make sure we check if this is still unmounted or do any clean // up necessary since we never stop tracking anymore. track(domElement); postMountWrapper(domElement, rawProps, true); break; case 'textarea': // TODO: Make sure we check if this is still unmounted or do any clean // up necessary since we never stop tracking anymore. track(domElement); postMountWrapper$3(domElement); break; case 'select': case 'option': // For input and textarea we current always set the value property at // post mount to force it to diverge from attributes. However, for // option and select we don't quite do the same thing and select // is not resilient to the DOM state changing so we don't do that here. // TODO: Consider not doing this for input and textarea. break; default: if (typeof rawProps.onClick === 'function') { // TODO: This cast may not be sound for SVG, MathML or custom elements. trapClickOnNonInteractiveElement(domElement); } break; } return updatePayload; } function diffHydratedText(textNode, text, isConcurrentMode) { var isDifferent = textNode.nodeValue !== text; return isDifferent; } function warnForDeletedHydratableElement(parentNode, child) { { if (didWarnInvalidHydration) { return; } didWarnInvalidHydration = true; error('Did not expect server HTML to contain a <%s> in <%s>.', child.nodeName.toLowerCase(), parentNode.nodeName.toLowerCase()); } } function warnForDeletedHydratableText(parentNode, child) { { if (didWarnInvalidHydration) { return; } didWarnInvalidHydration = true; error('Did not expect server HTML to contain the text node "%s" in <%s>.', child.nodeValue, parentNode.nodeName.toLowerCase()); } } function warnForInsertedHydratedElement(parentNode, tag, props) { { if (didWarnInvalidHydration) { return; } didWarnInvalidHydration = true; error('Expected server HTML to contain a matching <%s> in <%s>.', tag, parentNode.nodeName.toLowerCase()); } } function warnForInsertedHydratedText(parentNode, text) { { if (text === '') { // We expect to insert empty text nodes since they're not represented in // the HTML. // TODO: Remove this special case if we can just avoid inserting empty // text nodes. return; } if (didWarnInvalidHydration) { return; } didWarnInvalidHydration = true; error('Expected server HTML to contain a matching text node for "%s" in <%s>.', text, parentNode.nodeName.toLowerCase()); } } function restoreControlledState$3(domElement, tag, props) { switch (tag) { case 'input': restoreControlledState(domElement, props); return; case 'textarea': restoreControlledState$2(domElement, props); return; case 'select': restoreControlledState$1(domElement, props); return; } } var validateDOMNesting = function () {}; var updatedAncestorInfo = function () {}; { // This validation code was written based on the HTML5 parsing spec: // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope // // Note: this does not catch all invalid nesting, nor does it try to (as it's // not clear what practical benefit doing so provides); instead, we warn only // for cases where the parser will give a parse tree differing from what React // intended. For example, <b><div></div></b> is invalid but we don't warn // because it still parses correctly; we do warn for other cases like nested // <p> tags where the beginning of the second element implicitly closes the // first, causing a confusing mess. // https://html.spec.whatwg.org/multipage/syntax.html#special var specialTags = ['address', 'applet', 'area', 'article', 'aside', 'base', 'basefont', 'bgsound', 'blockquote', 'body', 'br', 'button', 'caption', 'center', 'col', 'colgroup', 'dd', 'details', 'dir', 'div', 'dl', 'dt', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'iframe', 'img', 'input', 'isindex', 'li', 'link', 'listing', 'main', 'marquee', 'menu', 'menuitem', 'meta', 'nav', 'noembed', 'noframes', 'noscript', 'object', 'ol', 'p', 'param', 'plaintext', 'pre', 'script', 'section', 'select', 'source', 'style', 'summary', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'title', 'tr', 'track', 'ul', 'wbr', 'xmp']; // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope var inScopeTags = ['applet', 'caption', 'html', 'table', 'td', 'th', 'marquee', 'object', 'template', // https://html.spec.whatwg.org/multipage/syntax.html#html-integration-point // TODO: Distinguish by namespace here -- for <title>, including it here // errs on the side of fewer warnings 'foreignObject', 'desc', 'title']; // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-button-scope var buttonScopeTags = inScopeTags.concat(['button']); // https://html.spec.whatwg.org/multipage/syntax.html#generate-implied-end-tags var impliedEndTags = ['dd', 'dt', 'li', 'option', 'optgroup', 'p', 'rp', 'rt']; var emptyAncestorInfo = { current: null, formTag: null, aTagInScope: null, buttonTagInScope: null, nobrTagInScope: null, pTagInButtonScope: null, listItemTagAutoclosing: null, dlItemTagAutoclosing: null }; updatedAncestorInfo = function (oldInfo, tag) { var ancestorInfo = assign({}, oldInfo || emptyAncestorInfo); var info = { tag: tag }; if (inScopeTags.indexOf(tag) !== -1) { ancestorInfo.aTagInScope = null; ancestorInfo.buttonTagInScope = null; ancestorInfo.nobrTagInScope = null; } if (buttonScopeTags.indexOf(tag) !== -1) { ancestorInfo.pTagInButtonScope = null; } // See rules for 'li', 'dd', 'dt' start tags in // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody if (specialTags.indexOf(tag) !== -1 && tag !== 'address' && tag !== 'div' && tag !== 'p') { ancestorInfo.listItemTagAutoclosing = null; ancestorInfo.dlItemTagAutoclosing = null; } ancestorInfo.current = info; if (tag === 'form') { ancestorInfo.formTag = info; } if (tag === 'a') { ancestorInfo.aTagInScope = info; } if (tag === 'button') { ancestorInfo.buttonTagInScope = info; } if (tag === 'nobr') { ancestorInfo.nobrTagInScope = info; } if (tag === 'p') { ancestorInfo.pTagInButtonScope = info; } if (tag === 'li') { ancestorInfo.listItemTagAutoclosing = info; } if (tag === 'dd' || tag === 'dt') { ancestorInfo.dlItemTagAutoclosing = info; } return ancestorInfo; }; /** * Returns whether */ var isTagValidWithParent = function (tag, parentTag) { // First, let's check if we're in an unusual parsing mode... switch (parentTag) { // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inselect case 'select': return tag === 'option' || tag === 'optgroup' || tag === '#text'; case 'optgroup': return tag === 'option' || tag === '#text'; // Strictly speaking, seeing an <option> doesn't mean we're in a <select> // but case 'option': return tag === '#text'; // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intd // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incaption // No special behavior since these rules fall back to "in body" mode for // all except special table nodes which cause bad parsing behavior anyway. // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intr case 'tr': return tag === 'th' || tag === 'td' || tag === 'style' || tag === 'script' || tag === 'template'; // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intbody case 'tbody': case 'thead': case 'tfoot': return tag === 'tr' || tag === 'style' || tag === 'script' || tag === 'template'; // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incolgroup case 'colgroup': return tag === 'col' || tag === 'template'; // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intable case 'table': return tag === 'caption' || tag === 'colgroup' || tag === 'tbody' || tag === 'tfoot' || tag === 'thead' || tag === 'style' || tag === 'script' || tag === 'template'; // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inhead case 'head': return tag === 'base' || tag === 'basefont' || tag === 'bgsound' || tag === 'link' || tag === 'meta' || tag === 'title' || tag === 'noscript' || tag === 'noframes' || tag === 'style' || tag === 'script' || tag === 'template'; // https://html.spec.whatwg.org/multipage/semantics.html#the-html-element case 'html': return tag === 'head' || tag === 'body' || tag === 'frameset'; case 'frameset': return tag === 'frame'; case '#document': return tag === 'html'; } // Probably in the "in body" parsing mode, so we outlaw only tag combos // where the parsing rules cause implicit opens or closes to be added. // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody switch (tag) { case 'h1': case 'h2': case 'h3': case 'h4': case 'h5': case 'h6': return parentTag !== 'h1' && parentTag !== 'h2' && parentTag !== 'h3' && parentTag !== 'h4' && parentTag !== 'h5' && parentTag !== 'h6'; case 'rp': case 'rt': return impliedEndTags.indexOf(parentTag) === -1; case 'body': case 'caption': case 'col': case 'colgroup': case 'frameset': case 'frame': case 'head': case 'html': case 'tbody': case 'td': case 'tfoot': case 'th': case 'thead': case 'tr': // These tags are only valid with a few parents that have special child // parsing rules -- if we're down here, then none of those matched and // so we allow it only if we don't know what the parent is, as all other // cases are invalid. return parentTag == null; } return true; }; /** * Returns whether */ var findInvalidAncestorForTag = function (tag, ancestorInfo) { switch (tag) { case 'address': case 'article': case 'aside': case 'blockquote': case 'center': case 'details': case 'dialog': case 'dir': case 'div': case 'dl': case 'fieldset': case 'figcaption': case 'figure': case 'footer': case 'header': case 'hgroup': case 'main': case 'menu': case 'nav': case 'ol': case 'p': case 'section': case 'summary': case 'ul': case 'pre': case 'listing': case 'table': case 'hr': case 'xmp': case 'h1': case 'h2': case 'h3': case 'h4': case 'h5': case 'h6': return ancestorInfo.pTagInButtonScope; case 'form': return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope; case 'li': return ancestorInfo.listItemTagAutoclosing; case 'dd': case 'dt': return ancestorInfo.dlItemTagAutoclosing; case 'button': return ancestorInfo.buttonTagInScope; case 'a': // Spec says something about storing a list of markers, but it sounds // equivalent to this check. return ancestorInfo.aTagInScope; case 'nobr': return ancestorInfo.nobrTagInScope; } return null; }; var didWarn$1 = {}; validateDOMNesting = function (childTag, childText, ancestorInfo) { ancestorInfo = ancestorInfo || emptyAncestorInfo; var parentInfo = ancestorInfo.current; var parentTag = parentInfo && parentInfo.tag; if (childText != null) { if (childTag != null) { error('validateDOMNesting: when childText is passed, childTag should be null'); } childTag = '#text'; } var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo; var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo); var invalidParentOrAncestor = invalidParent || invalidAncestor; if (!invalidParentOrAncestor) { return; } var ancestorTag = invalidParentOrAncestor.tag; var warnKey = !!invalidParent + '|' + childTag + '|' + ancestorTag; if (didWarn$1[warnKey]) { return; } didWarn$1[warnKey] = true; var tagDisplayName = childTag; var whitespaceInfo = ''; if (childTag === '#text') { if (/\S/.test(childText)) { tagDisplayName = 'Text nodes'; } else { tagDisplayName = 'Whitespace text nodes'; whitespaceInfo = " Make sure you don't have any extra whitespace between tags on " + 'each line of your source code.'; } } else { tagDisplayName = '<' + childTag + '>'; } if (invalidParent) { var info = ''; if (ancestorTag === 'table' && childTag === 'tr') { info += ' Add a <tbody>, <thead> or <tfoot> to your code to match the DOM tree generated by ' + 'the browser.'; } error('validateDOMNesting(...): %s cannot appear as a child of <%s>.%s%s', tagDisplayName, ancestorTag, whitespaceInfo, info); } else { error('validateDOMNesting(...): %s cannot appear as a descendant of ' + '<%s>.', tagDisplayName, ancestorTag); } }; } var SUPPRESS_HYDRATION_WARNING$1 = 'suppressHydrationWarning'; var SUSPENSE_START_DATA = '$'; var SUSPENSE_END_DATA = '/$'; var SUSPENSE_PENDING_START_DATA = '$?'; var SUSPENSE_FALLBACK_START_DATA = '$!'; var STYLE$1 = 'style'; var eventsEnabled = null; var selectionInformation = null; function getRootHostContext(rootContainerInstance) { var type; var namespace; var nodeType = rootContainerInstance.nodeType; switch (nodeType) { case DOCUMENT_NODE: case DOCUMENT_FRAGMENT_NODE: { type = nodeType === DOCUMENT_NODE ? '#document' : '#fragment'; var root = rootContainerInstance.documentElement; namespace = root ? root.namespaceURI : getChildNamespace(null, ''); break; } default: { var container = nodeType === COMMENT_NODE ? rootContainerInstance.parentNode : rootContainerInstance; var ownNamespace = container.namespaceURI || null; type = container.tagName; namespace = getChildNamespace(ownNamespace, type); break; } } { var validatedTag = type.toLowerCase(); var ancestorInfo = updatedAncestorInfo(null, validatedTag); return { namespace: namespace, ancestorInfo: ancestorInfo }; } } function getChildHostContext(parentHostContext, type, rootContainerInstance) { { var parentHostContextDev = parentHostContext; var namespace = getChildNamespace(parentHostContextDev.namespace, type); var ancestorInfo = updatedAncestorInfo(parentHostContextDev.ancestorInfo, type); return { namespace: namespace, ancestorInfo: ancestorInfo }; } } function getPublicInstance(instance) { return instance; } function prepareForCommit(containerInfo) { eventsEnabled = isEnabled(); selectionInformation = getSelectionInformation(); var activeInstance = null; setEnabled(false); return activeInstance; } function resetAfterCommit(containerInfo) { restoreSelection(selectionInformation); setEnabled(eventsEnabled); eventsEnabled = null; selectionInformation = null; } function createInstance(type, props, rootContainerInstance, hostContext, internalInstanceHandle) { var parentNamespace; { // TODO: take namespace into account when validating. var hostContextDev = hostContext; validateDOMNesting(type, null, hostContextDev.ancestorInfo); if (typeof props.children === 'string' || typeof props.children === 'number') { var string = '' + props.children; var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type); validateDOMNesting(null, string, ownAncestorInfo); } parentNamespace = hostContextDev.namespace; } var domElement = createElement(type, props, rootContainerInstance, parentNamespace); precacheFiberNode(internalInstanceHandle, domElement); updateFiberProps(domElement, props); return domElement; } function appendInitialChild(parentInstance, child) { parentInstance.appendChild(child); } function finalizeInitialChildren(domElement, type, props, rootContainerInstance, hostContext) { setInitialProperties(domElement, type, props, rootContainerInstance); switch (type) { case 'button': case 'input': case 'select': case 'textarea': return !!props.autoFocus; case 'img': return true; default: return false; } } function prepareUpdate(domElement, type, oldProps, newProps, rootContainerInstance, hostContext) { { var hostContextDev = hostContext; if (typeof newProps.children !== typeof oldProps.children && (typeof newProps.children === 'string' || typeof newProps.children === 'number')) { var string = '' + newProps.children; var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type); validateDOMNesting(null, string, ownAncestorInfo); } } return diffProperties(domElement, type, oldProps, newProps); } function shouldSetTextContent(type, props) { return type === 'textarea' || type === 'noscript' || typeof props.children === 'string' || typeof props.children === 'number' || typeof props.dangerouslySetInnerHTML === 'object' && props.dangerouslySetInnerHTML !== null && props.dangerouslySetInnerHTML.__html != null; } function createTextInstance(text, rootContainerInstance, hostContext, internalInstanceHandle) { { var hostContextDev = hostContext; validateDOMNesting(null, text, hostContextDev.ancestorInfo); } var textNode = createTextNode(text, rootContainerInstance); precacheFiberNode(internalInstanceHandle, textNode); return textNode; } function getCurrentEventPriority() { var currentEvent = window.event; if (currentEvent === undefined) { return DefaultEventPriority; } return getEventPriority(currentEvent.type); } // if a component just imports ReactDOM (e.g. for findDOMNode). // Some environments might not have setTimeout or clearTimeout. var scheduleTimeout = typeof setTimeout === 'function' ? setTimeout : undefined; var cancelTimeout = typeof clearTimeout === 'function' ? clearTimeout : undefined; var noTimeout = -1; var localPromise = typeof Promise === 'function' ? Promise : undefined; // ------------------- var scheduleMicrotask = typeof queueMicrotask === 'function' ? queueMicrotask : typeof localPromise !== 'undefined' ? function (callback) { return localPromise.resolve(null).then(callback).catch(handleErrorInNextTick); } : scheduleTimeout; // TODO: Determine the best fallback here. function handleErrorInNextTick(error) { setTimeout(function () { throw error; }); } // ------------------- function commitMount(domElement, type, newProps, internalInstanceHandle) { // Despite the naming that might imply otherwise, this method only // fires if there is an `Update` effect scheduled during mounting. // This happens if `finalizeInitialChildren` returns `true` (which it // does to implement the `autoFocus` attribute on the client). But // there are also other cases when this might happen (such as patching // up text content during hydration mismatch). So we'll check this again. switch (type) { case 'button': case 'input': case 'select': case 'textarea': if (newProps.autoFocus) { domElement.focus(); } return; case 'img': { if (newProps.src) { domElement.src = newProps.src; } return; } } } function commitUpdate(domElement, updatePayload, type, oldProps, newProps, internalInstanceHandle) { // Apply the diff to the DOM node. updateProperties(domElement, updatePayload, type, oldProps, newProps); // Update the props handle so that we know which props are the ones with // with current event handlers. updateFiberProps(domElement, newProps); } function resetTextContent(domElement) { setTextContent(domElement, ''); } function commitTextUpdate(textInstance, oldText, newText) { textInstance.nodeValue = newText; } function appendChild(parentInstance, child) { parentInstance.appendChild(child); } function appendChildToContainer(container, child) { var parentNode; if (container.nodeType === COMMENT_NODE) { parentNode = container.parentNode; parentNode.insertBefore(child, container); } else { parentNode = container; parentNode.appendChild(child); } // This container might be used for a portal. // If something inside a portal is clicked, that click should bubble // through the React tree. However, on Mobile Safari the click would // never bubble through the *DOM* tree unless an ancestor with onclick // event exists. So we wouldn't see it and dispatch it. // This is why we ensure that non React root containers have inline onclick // defined. // https://github.com/facebook/react/issues/11918 var reactRootContainer = container._reactRootContainer; if ((reactRootContainer === null || reactRootContainer === undefined) && parentNode.onclick === null) { // TODO: This cast may not be sound for SVG, MathML or custom elements. trapClickOnNonInteractiveElement(parentNode); } } function insertBefore(parentInstance, child, beforeChild) { parentInstance.insertBefore(child, beforeChild); } function insertInContainerBefore(container, child, beforeChild) { if (container.nodeType === COMMENT_NODE) { container.parentNode.insertBefore(child, beforeChild); } else { container.insertBefore(child, beforeChild); } } function removeChild(parentInstance, child) { parentInstance.removeChild(child); } function removeChildFromContainer(container, child) { if (container.nodeType === COMMENT_NODE) { container.parentNode.removeChild(child); } else { container.removeChild(child); } } function clearSuspenseBoundary(parentInstance, suspenseInstance) { var node = suspenseInstance; // Delete all nodes within this suspense boundary. // There might be nested nodes so we need to keep track of how // deep we are and only break out when we're back on top. var depth = 0; do { var nextNode = node.nextSibling; parentInstance.removeChild(node); if (nextNode && nextNode.nodeType === COMMENT_NODE) { var data = nextNode.data; if (data === SUSPENSE_END_DATA) { if (depth === 0) { parentInstance.removeChild(nextNode); // Retry if any event replaying was blocked on this. retryIfBlockedOn(suspenseInstance); return; } else { depth--; } } else if (data === SUSPENSE_START_DATA || data === SUSPENSE_PENDING_START_DATA || data === SUSPENSE_FALLBACK_START_DATA) { depth++; } } node = nextNode; } while (node); // TODO: Warn, we didn't find the end comment boundary. // Retry if any event replaying was blocked on this. retryIfBlockedOn(suspenseInstance); } function clearSuspenseBoundaryFromContainer(container, suspenseInstance) { if (container.nodeType === COMMENT_NODE) { clearSuspenseBoundary(container.parentNode, suspenseInstance); } else if (container.nodeType === ELEMENT_NODE) { clearSuspenseBoundary(container, suspenseInstance); } // Retry if any event replaying was blocked on this. retryIfBlockedOn(container); } function hideInstance(instance) { // TODO: Does this work for all element types? What about MathML? Should we // pass host context to this method? instance = instance; var style = instance.style; if (typeof style.setProperty === 'function') { style.setProperty('display', 'none', 'important'); } else { style.display = 'none'; } } function hideTextInstance(textInstance) { textInstance.nodeValue = ''; } function unhideInstance(instance, props) { instance = instance; var styleProp = props[STYLE$1]; var display = styleProp !== undefined && styleProp !== null && styleProp.hasOwnProperty('display') ? styleProp.display : null; instance.style.display = dangerousStyleValue('display', display); } function unhideTextInstance(textInstance, text) { textInstance.nodeValue = text; } function clearContainer(container) { if (container.nodeType === ELEMENT_NODE) { container.textContent = ''; } else if (container.nodeType === DOCUMENT_NODE) { if (container.documentElement) { container.removeChild(container.documentElement); } } } // ------------------- function canHydrateInstance(instance, type, props) { if (instance.nodeType !== ELEMENT_NODE || type.toLowerCase() !== instance.nodeName.toLowerCase()) { return null; } // This has now been refined to an element node. return instance; } function canHydrateTextInstance(instance, text) { if (text === '' || instance.nodeType !== TEXT_NODE) { // Empty strings are not parsed by HTML so there won't be a correct match here. return null; } // This has now been refined to a text node. return instance; } function canHydrateSuspenseInstance(instance) { if (instance.nodeType !== COMMENT_NODE) { // Empty strings are not parsed by HTML so there won't be a correct match here. return null; } // This has now been refined to a suspense node. return instance; } function isSuspenseInstancePending(instance) { return instance.data === SUSPENSE_PENDING_START_DATA; } function isSuspenseInstanceFallback(instance) { return instance.data === SUSPENSE_FALLBACK_START_DATA; } function getSuspenseInstanceFallbackErrorDetails(instance) { var dataset = instance.nextSibling && instance.nextSibling.dataset; var digest, message, stack; if (dataset) { digest = dataset.dgst; { message = dataset.msg; stack = dataset.stck; } } { return { message: message, digest: digest, stack: stack }; } // let value = {message: undefined, hash: undefined}; // const nextSibling = instance.nextSibling; // if (nextSibling) { // const dataset = ((nextSibling: any): HTMLTemplateElement).dataset; // value.message = dataset.msg; // value.hash = dataset.hash; // if (true) { // value.stack = dataset.stack; // } // } // return value; } function registerSuspenseInstanceRetry(instance, callback) { instance._reactRetry = callback; } function getNextHydratable(node) { // Skip non-hydratable nodes. for (; node != null; node = node.nextSibling) { var nodeType = node.nodeType; if (nodeType === ELEMENT_NODE || nodeType === TEXT_NODE) { break; } if (nodeType === COMMENT_NODE) { var nodeData = node.data; if (nodeData === SUSPENSE_START_DATA || nodeData === SUSPENSE_FALLBACK_START_DATA || nodeData === SUSPENSE_PENDING_START_DATA) { break; } if (nodeData === SUSPENSE_END_DATA) { return null; } } } return node; } function getNextHydratableSibling(instance) { return getNextHydratable(instance.nextSibling); } function getFirstHydratableChild(parentInstance) { return getNextHydratable(parentInstance.firstChild); } function getFirstHydratableChildWithinContainer(parentContainer) { return getNextHydratable(parentContainer.firstChild); } function getFirstHydratableChildWithinSuspenseInstance(parentInstance) { return getNextHydratable(parentInstance.nextSibling); } function hydrateInstance(instance, type, props, rootContainerInstance, hostContext, internalInstanceHandle, shouldWarnDev) { precacheFiberNode(internalInstanceHandle, instance); // TODO: Possibly defer this until the commit phase where all the events // get attached. updateFiberProps(instance, props); var parentNamespace; { var hostContextDev = hostContext; parentNamespace = hostContextDev.namespace; } // TODO: Temporary hack to check if we're in a concurrent root. We can delete // when the legacy root API is removed. var isConcurrentMode = (internalInstanceHandle.mode & ConcurrentMode) !== NoMode; return diffHydratedProperties(instance, type, props, parentNamespace, rootContainerInstance, isConcurrentMode, shouldWarnDev); } function hydrateTextInstance(textInstance, text, internalInstanceHandle, shouldWarnDev) { precacheFiberNode(internalInstanceHandle, textInstance); // TODO: Temporary hack to check if we're in a concurrent root. We can delete // when the legacy root API is removed. var isConcurrentMode = (internalInstanceHandle.mode & ConcurrentMode) !== NoMode; return diffHydratedText(textInstance, text); } function hydrateSuspenseInstance(suspenseInstance, internalInstanceHandle) { precacheFiberNode(internalInstanceHandle, suspenseInstance); } function getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance) { var node = suspenseInstance.nextSibling; // Skip past all nodes within this suspense boundary. // There might be nested nodes so we need to keep track of how // deep we are and only break out when we're back on top. var depth = 0; while (node) { if (node.nodeType === COMMENT_NODE) { var data = node.data; if (data === SUSPENSE_END_DATA) { if (depth === 0) { return getNextHydratableSibling(node); } else { depth--; } } else if (data === SUSPENSE_START_DATA || data === SUSPENSE_FALLBACK_START_DATA || data === SUSPENSE_PENDING_START_DATA) { depth++; } } node = node.nextSibling; } // TODO: Warn, we didn't find the end comment boundary. return null; } // Returns the SuspenseInstance if this node is a direct child of a // SuspenseInstance. I.e. if its previous sibling is a Comment with // SUSPENSE_x_START_DATA. Otherwise, null. function getParentSuspenseInstance(targetInstance) { var node = targetInstance.previousSibling; // Skip past all nodes within this suspense boundary. // There might be nested nodes so we need to keep track of how // deep we are and only break out when we're back on top. var depth = 0; while (node) { if (node.nodeType === COMMENT_NODE) { var data = node.data; if (data === SUSPENSE_START_DATA || data === SUSPENSE_FALLBACK_START_DATA || data === SUSPENSE_PENDING_START_DATA) { if (depth === 0) { return node; } else { depth--; } } else if (data === SUSPENSE_END_DATA) { depth++; } } node = node.previousSibling; } return null; } function commitHydratedContainer(container) { // Retry if any event replaying was blocked on this. retryIfBlockedOn(container); } function commitHydratedSuspenseInstance(suspenseInstance) { // Retry if any event replaying was blocked on this. retryIfBlockedOn(suspenseInstance); } function shouldDeleteUnhydratedTailInstances(parentType) { return parentType !== 'head' && parentType !== 'body'; } function didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, text, isConcurrentMode) { var shouldWarnDev = true; checkForUnmatchedText(textInstance.nodeValue, text, isConcurrentMode, shouldWarnDev); } function didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, text, isConcurrentMode) { if (parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) { var shouldWarnDev = true; checkForUnmatchedText(textInstance.nodeValue, text, isConcurrentMode, shouldWarnDev); } } function didNotHydrateInstanceWithinContainer(parentContainer, instance) { { if (instance.nodeType === ELEMENT_NODE) { warnForDeletedHydratableElement(parentContainer, instance); } else if (instance.nodeType === COMMENT_NODE) ; else { warnForDeletedHydratableText(parentContainer, instance); } } } function didNotHydrateInstanceWithinSuspenseInstance(parentInstance, instance) { { // $FlowFixMe: Only Element or Document can be parent nodes. var parentNode = parentInstance.parentNode; if (parentNode !== null) { if (instance.nodeType === ELEMENT_NODE) { warnForDeletedHydratableElement(parentNode, instance); } else if (instance.nodeType === COMMENT_NODE) ; else { warnForDeletedHydratableText(parentNode, instance); } } } } function didNotHydrateInstance(parentType, parentProps, parentInstance, instance, isConcurrentMode) { { if (isConcurrentMode || parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) { if (instance.nodeType === ELEMENT_NODE) { warnForDeletedHydratableElement(parentInstance, instance); } else if (instance.nodeType === COMMENT_NODE) ; else { warnForDeletedHydratableText(parentInstance, instance); } } } } function didNotFindHydratableInstanceWithinContainer(parentContainer, type, props) { { warnForInsertedHydratedElement(parentContainer, type); } } function didNotFindHydratableTextInstanceWithinContainer(parentContainer, text) { { warnForInsertedHydratedText(parentContainer, text); } } function didNotFindHydratableInstanceWithinSuspenseInstance(parentInstance, type, props) { { // $FlowFixMe: Only Element or Document can be parent nodes. var parentNode = parentInstance.parentNode; if (parentNode !== null) warnForInsertedHydratedElement(parentNode, type); } } function didNotFindHydratableTextInstanceWithinSuspenseInstance(parentInstance, text) { { // $FlowFixMe: Only Element or Document can be parent nodes. var parentNode = parentInstance.parentNode; if (parentNode !== null) warnForInsertedHydratedText(parentNode, text); } } function didNotFindHydratableInstance(parentType, parentProps, parentInstance, type, props, isConcurrentMode) { { if (isConcurrentMode || parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) { warnForInsertedHydratedElement(parentInstance, type); } } } function didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, text, isConcurrentMode) { { if (isConcurrentMode || parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) { warnForInsertedHydratedText(parentInstance, text); } } } function errorHydratingContainer(parentContainer) { { // TODO: This gets logged by onRecoverableError, too, so we should be // able to remove it. error('An error occurred during hydration. The server HTML was replaced with client content in <%s>.', parentContainer.nodeName.toLowerCase()); } } function preparePortalMount(portalInstance) { listenToAllSupportedEvents(portalInstance); } var randomKey = Math.random().toString(36).slice(2); var internalInstanceKey = '__reactFiber$' + randomKey; var internalPropsKey = '__reactProps$' + randomKey; var internalContainerInstanceKey = '__reactContainer$' + randomKey; var internalEventHandlersKey = '__reactEvents$' + randomKey; var internalEventHandlerListenersKey = '__reactListeners$' + randomKey; var internalEventHandlesSetKey = '__reactHandles$' + randomKey; function detachDeletedInstance(node) { // TODO: This function is only called on host components. I don't think all of // these fields are relevant. delete node[internalInstanceKey]; delete node[internalPropsKey]; delete node[internalEventHandlersKey]; delete node[internalEventHandlerListenersKey]; delete node[internalEventHandlesSetKey]; } function precacheFiberNode(hostInst, node) { node[internalInstanceKey] = hostInst; } function markContainerAsRoot(hostRoot, node) { node[internalContainerInstanceKey] = hostRoot; } function unmarkContainerAsRoot(node) { node[internalContainerInstanceKey] = null; } function isContainerMarkedAsRoot(node) { return !!node[internalContainerInstanceKey]; } // Given a DOM node, return the closest HostComponent or HostText fiber ancestor. // If the target node is part of a hydrated or not yet rendered subtree, then // this may also return a SuspenseComponent or HostRoot to indicate that. // Conceptually the HostRoot fiber is a child of the Container node. So if you // pass the Container node as the targetNode, you will not actually get the // HostRoot back. To get to the HostRoot, you need to pass a child of it. // The same thing applies to Suspense boundaries. function getClosestInstanceFromNode(targetNode) { var targetInst = targetNode[internalInstanceKey]; if (targetInst) { // Don't return HostRoot or SuspenseComponent here. return targetInst; } // If the direct event target isn't a React owned DOM node, we need to look // to see if one of its parents is a React owned DOM node. var parentNode = targetNode.parentNode; while (parentNode) { // We'll check if this is a container root that could include // React nodes in the future. We need to check this first because // if we're a child of a dehydrated container, we need to first // find that inner container before moving on to finding the parent // instance. Note that we don't check this field on the targetNode // itself because the fibers are conceptually between the container // node and the first child. It isn't surrounding the container node. // If it's not a container, we check if it's an instance. targetInst = parentNode[internalContainerInstanceKey] || parentNode[internalInstanceKey]; if (targetInst) { // Since this wasn't the direct target of the event, we might have // stepped past dehydrated DOM nodes to get here. However they could // also have been non-React nodes. We need to answer which one. // If we the instance doesn't have any children, then there can't be // a nested suspense boundary within it. So we can use this as a fast // bailout. Most of the time, when people add non-React children to // the tree, it is using a ref to a child-less DOM node. // Normally we'd only need to check one of the fibers because if it // has ever gone from having children to deleting them or vice versa // it would have deleted the dehydrated boundary nested inside already. // However, since the HostRoot starts out with an alternate it might // have one on the alternate so we need to check in case this was a // root. var alternate = targetInst.alternate; if (targetInst.child !== null || alternate !== null && alternate.child !== null) { // Next we need to figure out if the node that skipped past is // nested within a dehydrated boundary and if so, which one. var suspenseInstance = getParentSuspenseInstance(targetNode); while (suspenseInstance !== null) { // We found a suspense instance. That means that we haven't // hydrated it yet. Even though we leave the comments in the // DOM after hydrating, and there are boundaries in the DOM // that could already be hydrated, we wouldn't have found them // through this pass since if the target is hydrated it would // have had an internalInstanceKey on it. // Let's get the fiber associated with the SuspenseComponent // as the deepest instance. var targetSuspenseInst = suspenseInstance[internalInstanceKey]; if (targetSuspenseInst) { return targetSuspenseInst; } // If we don't find a Fiber on the comment, it might be because // we haven't gotten to hydrate it yet. There might still be a // parent boundary that hasn't above this one so we need to find // the outer most that is known. suspenseInstance = getParentSuspenseInstance(suspenseInstance); // If we don't find one, then that should mean that the parent // host component also hasn't hydrated yet. We can return it // below since it will bail out on the isMounted check later. } } return targetInst; } targetNode = parentNode; parentNode = targetNode.parentNode; } return null; } /** * Given a DOM node, return the ReactDOMComponent or ReactDOMTextComponent * instance, or null if the node was not rendered by this React. */ function getInstanceFromNode(node) { var inst = node[internalInstanceKey] || node[internalContainerInstanceKey]; if (inst) { if (inst.tag === HostComponent || inst.tag === HostText || inst.tag === SuspenseComponent || inst.tag === HostRoot) { return inst; } else { return null; } } return null; } /** * Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding * DOM node. */ function getNodeFromInstance(inst) { if (inst.tag === HostComponent || inst.tag === HostText) { // In Fiber this, is just the state node right now. We assume it will be // a host component or host text. return inst.stateNode; } // Without this first invariant, passing a non-DOM-component triggers the next // invariant for a missing parent, which is super confusing. throw new Error('getNodeFromInstance: Invalid argument.'); } function getFiberCurrentPropsFromNode(node) { return node[internalPropsKey] || null; } function updateFiberProps(node, props) { node[internalPropsKey] = props; } function getEventListenerSet(node) { var elementListenerSet = node[internalEventHandlersKey]; if (elementListenerSet === undefined) { elementListenerSet = node[internalEventHandlersKey] = new Set(); } return elementListenerSet; } var loggedTypeFailures = {}; var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame; function setCurrentlyValidatingElement(element) { { if (element) { var owner = element._owner; var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null); ReactDebugCurrentFrame$1.setExtraStackFrame(stack); } else { ReactDebugCurrentFrame$1.setExtraStackFrame(null); } } } function checkPropTypes(typeSpecs, values, location, componentName, element) { { // $FlowFixMe This is okay but Flow doesn't know it. var has = Function.call.bind(hasOwnProperty); for (var typeSpecName in typeSpecs) { if (has(typeSpecs, typeSpecName)) { var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to // fail the render phase where it didn't fail before. So we log it. // After these have been cleaned up, we'll let them throw. try { // This is intentionally an invariant that gets caught. It's the same // behavior as without this statement except with a better message. if (typeof typeSpecs[typeSpecName] !== 'function') { // eslint-disable-next-line react-internal/prod-error-codes var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'); err.name = 'Invariant Violation'; throw err; } error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'); } catch (ex) { error$1 = ex; } if (error$1 && !(error$1 instanceof Error)) { setCurrentlyValidatingElement(element); error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1); setCurrentlyValidatingElement(null); } if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) { // Only monitor this failure once because there tends to be a lot of the // same error. loggedTypeFailures[error$1.message] = true; setCurrentlyValidatingElement(element); error('Failed %s type: %s', location, error$1.message); setCurrentlyValidatingElement(null); } } } } } var valueStack = []; var fiberStack; { fiberStack = []; } var index = -1; function createCursor(defaultValue) { return { current: defaultValue }; } function pop(cursor, fiber) { if (index < 0) { { error('Unexpected pop.'); } return; } { if (fiber !== fiberStack[index]) { error('Unexpected Fiber popped.'); } } cursor.current = valueStack[index]; valueStack[index] = null; { fiberStack[index] = null; } index--; } function push(cursor, value, fiber) { index++; valueStack[index] = cursor.current; { fiberStack[index] = fiber; } cursor.current = value; } var warnedAboutMissingGetChildContext; { warnedAboutMissingGetChildContext = {}; } var emptyContextObject = {}; { Object.freeze(emptyContextObject); } // A cursor to the current merged context object on the stack. var contextStackCursor = createCursor(emptyContextObject); // A cursor to a boolean indicating whether the context has changed. var didPerformWorkStackCursor = createCursor(false); // Keep track of the previous context object that was on the stack. // We use this to get access to the parent context after we have already // pushed the next context provider, and now need to merge their contexts. var previousContext = emptyContextObject; function getUnmaskedContext(workInProgress, Component, didPushOwnContextIfProvider) { { if (didPushOwnContextIfProvider && isContextProvider(Component)) { // If the fiber is a context provider itself, when we read its context // we may have already pushed its own child context on the stack. A context // provider should not "see" its own child context. Therefore we read the // previous (parent) context instead for a context provider. return previousContext; } return contextStackCursor.current; } } function cacheContext(workInProgress, unmaskedContext, maskedContext) { { var instance = workInProgress.stateNode; instance.__reactInternalMemoizedUnmaskedChildContext = unmaskedContext; instance.__reactInternalMemoizedMaskedChildContext = maskedContext; } } function getMaskedContext(workInProgress, unmaskedContext) { { var type = workInProgress.type; var contextTypes = type.contextTypes; if (!contextTypes) { return emptyContextObject; } // Avoid recreating masked context unless unmasked context has changed. // Failing to do this will result in unnecessary calls to componentWillReceiveProps. // This may trigger infinite loops if componentWillReceiveProps calls setState. var instance = workInProgress.stateNode; if (instance && instance.__reactInternalMemoizedUnmaskedChildContext === unmaskedContext) { return instance.__reactInternalMemoizedMaskedChildContext; } var context = {}; for (var key in contextTypes) { context[key] = unmaskedContext[key]; } { var name = getComponentNameFromFiber(workInProgress) || 'Unknown'; checkPropTypes(contextTypes, context, 'context', name); } // Cache unmasked context so we can avoid recreating masked context unless necessary. // Context is created before the class component is instantiated so check for instance. if (instance) { cacheContext(workInProgress, unmaskedContext, context); } return context; } } function hasContextChanged() { { return didPerformWorkStackCursor.current; } } function isContextProvider(type) { { var childContextTypes = type.childContextTypes; return childContextTypes !== null && childContextTypes !== undefined; } } function popContext(fiber) { { pop(didPerformWorkStackCursor, fiber); pop(contextStackCursor, fiber); } } function popTopLevelContextObject(fiber) { { pop(didPerformWorkStackCursor, fiber); pop(contextStackCursor, fiber); } } function pushTopLevelContextObject(fiber, context, didChange) { { if (contextStackCursor.current !== emptyContextObject) { throw new Error('Unexpected context found on stack. ' + 'This error is likely caused by a bug in React. Please file an issue.'); } push(contextStackCursor, context, fiber); push(didPerformWorkStackCursor, didChange, fiber); } } function processChildContext(fiber, type, parentContext) { { var instance = fiber.stateNode; var childContextTypes = type.childContextTypes; // TODO (bvaughn) Replace this behavior with an invariant() in the future. // It has only been added in Fiber to match the (unintentional) behavior in Stack. if (typeof instance.getChildContext !== 'function') { { var componentName = getComponentNameFromFiber(fiber) || 'Unknown'; if (!warnedAboutMissingGetChildContext[componentName]) { warnedAboutMissingGetChildContext[componentName] = true; error('%s.childContextTypes is specified but there is no getChildContext() method ' + 'on the instance. You can either define getChildContext() on %s or remove ' + 'childContextTypes from it.', componentName, componentName); } } return parentContext; } var childContext = instance.getChildContext(); for (var contextKey in childContext) { if (!(contextKey in childContextTypes)) { throw new Error((getComponentNameFromFiber(fiber) || 'Unknown') + ".getChildContext(): key \"" + contextKey + "\" is not defined in childContextTypes."); } } { var name = getComponentNameFromFiber(fiber) || 'Unknown'; checkPropTypes(childContextTypes, childContext, 'child context', name); } return assign({}, parentContext, childContext); } } function pushContextProvider(workInProgress) { { var instance = workInProgress.stateNode; // We push the context as early as possible to ensure stack integrity. // If the instance does not exist yet, we will push null at first, // and replace it on the stack later when invalidating the context. var memoizedMergedChildContext = instance && instance.__reactInternalMemoizedMergedChildContext || emptyContextObject; // Remember the parent context so we can merge with it later. // Inherit the parent's did-perform-work value to avoid inadvertently blocking updates. previousContext = contextStackCursor.current; push(contextStackCursor, memoizedMergedChildContext, workInProgress); push(didPerformWorkStackCursor, didPerformWorkStackCursor.current, workInProgress); return true; } } function invalidateContextProvider(workInProgress, type, didChange) { { var instance = workInProgress.stateNode; if (!instance) { throw new Error('Expected to have an instance by this point. ' + 'This error is likely caused by a bug in React. Please file an issue.'); } if (didChange) { // Merge parent and own context. // Skip this if we're not updating due to sCU. // This avoids unnecessarily recomputing memoized values. var mergedContext = processChildContext(workInProgress, type, previousContext); instance.__reactInternalMemoizedMergedChildContext = mergedContext; // Replace the old (or empty) context with the new one. // It is important to unwind the context in the reverse order. pop(didPerformWorkStackCursor, workInProgress); pop(contextStackCursor, workInProgress); // Now push the new context and mark that it has changed. push(contextStackCursor, mergedContext, workInProgress); push(didPerformWorkStackCursor, didChange, workInProgress); } else { pop(didPerformWorkStackCursor, workInProgress); push(didPerformWorkStackCursor, didChange, workInProgress); } } } function findCurrentUnmaskedContext(fiber) { { // Currently this is only used with renderSubtreeIntoContainer; not sure if it // makes sense elsewhere if (!isFiberMounted(fiber) || fiber.tag !== ClassComponent) { throw new Error('Expected subtree parent to be a mounted class component. ' + 'This error is likely caused by a bug in React. Please file an issue.'); } var node = fiber; do { switch (node.tag) { case HostRoot: return node.stateNode.context; case ClassComponent: { var Component = node.type; if (isContextProvider(Component)) { return node.stateNode.__reactInternalMemoizedMergedChildContext; } break; } } node = node.return; } while (node !== null); throw new Error('Found unexpected detached subtree parent. ' + 'This error is likely caused by a bug in React. Please file an issue.'); } } var LegacyRoot = 0; var ConcurrentRoot = 1; var syncQueue = null; var includesLegacySyncCallbacks = false; var isFlushingSyncQueue = false; function scheduleSyncCallback(callback) { // Push this callback into an internal queue. We'll flush these either in // the next tick, or earlier if something calls `flushSyncCallbackQueue`. if (syncQueue === null) { syncQueue = [callback]; } else { // Push onto existing queue. Don't need to schedule a callback because // we already scheduled one when we created the queue. syncQueue.push(callback); } } function scheduleLegacySyncCallback(callback) { includesLegacySyncCallbacks = true; scheduleSyncCallback(callback); } function flushSyncCallbacksOnlyInLegacyMode() { // Only flushes the queue if there's a legacy sync callback scheduled. // TODO: There's only a single type of callback: performSyncOnWorkOnRoot. So // it might make more sense for the queue to be a list of roots instead of a // list of generic callbacks. Then we can have two: one for legacy roots, one // for concurrent roots. And this method would only flush the legacy ones. if (includesLegacySyncCallbacks) { flushSyncCallbacks(); } } function flushSyncCallbacks() { if (!isFlushingSyncQueue && syncQueue !== null) { // Prevent re-entrance. isFlushingSyncQueue = true; var i = 0; var previousUpdatePriority = getCurrentUpdatePriority(); try { var isSync = true; var queue = syncQueue; // TODO: Is this necessary anymore? The only user code that runs in this // queue is in the render or commit phases. setCurrentUpdatePriority(DiscreteEventPriority); for (; i < queue.length; i++) { var callback = queue[i]; do { callback = callback(isSync); } while (callback !== null); } syncQueue = null; includesLegacySyncCallbacks = false; } catch (error) { // If something throws, leave the remaining callbacks on the queue. if (syncQueue !== null) { syncQueue = syncQueue.slice(i + 1); } // Resume flushing in the next tick scheduleCallback(ImmediatePriority, flushSyncCallbacks); throw error; } finally { setCurrentUpdatePriority(previousUpdatePriority); isFlushingSyncQueue = false; } } return null; } // TODO: Use the unified fiber stack module instead of this local one? // Intentionally not using it yet to derisk the initial implementation, because // the way we push/pop these values is a bit unusual. If there's a mistake, I'd // rather the ids be wrong than crash the whole reconciler. var forkStack = []; var forkStackIndex = 0; var treeForkProvider = null; var treeForkCount = 0; var idStack = []; var idStackIndex = 0; var treeContextProvider = null; var treeContextId = 1; var treeContextOverflow = ''; function isForkedChild(workInProgress) { warnIfNotHydrating(); return (workInProgress.flags & Forked) !== NoFlags; } function getForksAtLevel(workInProgress) { warnIfNotHydrating(); return treeForkCount; } function getTreeId() { var overflow = treeContextOverflow; var idWithLeadingBit = treeContextId; var id = idWithLeadingBit & ~getLeadingBit(idWithLeadingBit); return id.toString(32) + overflow; } function pushTreeFork(workInProgress, totalChildren) { // This is called right after we reconcile an array (or iterator) of child // fibers, because that's the only place where we know how many children in // the whole set without doing extra work later, or storing addtional // information on the fiber. // // That's why this function is separate from pushTreeId — it's called during // the render phase of the fork parent, not the child, which is where we push // the other context values. // // In the Fizz implementation this is much simpler because the child is // rendered in the same callstack as the parent. // // It might be better to just add a `forks` field to the Fiber type. It would // make this module simpler. warnIfNotHydrating(); forkStack[forkStackIndex++] = treeForkCount; forkStack[forkStackIndex++] = treeForkProvider; treeForkProvider = workInProgress; treeForkCount = totalChildren; } function pushTreeId(workInProgress, totalChildren, index) { warnIfNotHydrating(); idStack[idStackIndex++] = treeContextId; idStack[idStackIndex++] = treeContextOverflow; idStack[idStackIndex++] = treeContextProvider; treeContextProvider = workInProgress; var baseIdWithLeadingBit = treeContextId; var baseOverflow = treeContextOverflow; // The leftmost 1 marks the end of the sequence, non-inclusive. It's not part // of the id; we use it to account for leading 0s. var baseLength = getBitLength(baseIdWithLeadingBit) - 1; var baseId = baseIdWithLeadingBit & ~(1 << baseLength); var slot = index + 1; var length = getBitLength(totalChildren) + baseLength; // 30 is the max length we can store without overflowing, taking into // consideration the leading 1 we use to mark the end of the sequence. if (length > 30) { // We overflowed the bitwise-safe range. Fall back to slower algorithm. // This branch assumes the length of the base id is greater than 5; it won't // work for smaller ids, because you need 5 bits per character. // // We encode the id in multiple steps: first the base id, then the // remaining digits. // // Each 5 bit sequence corresponds to a single base 32 character. So for // example, if the current id is 23 bits long, we can convert 20 of those // bits into a string of 4 characters, with 3 bits left over. // // First calculate how many bits in the base id represent a complete // sequence of characters. var numberOfOverflowBits = baseLength - baseLength % 5; // Then create a bitmask that selects only those bits. var newOverflowBits = (1 << numberOfOverflowBits) - 1; // Select the bits, and convert them to a base 32 string. var newOverflow = (baseId & newOverflowBits).toString(32); // Now we can remove those bits from the base id. var restOfBaseId = baseId >> numberOfOverflowBits; var restOfBaseLength = baseLength - numberOfOverflowBits; // Finally, encode the rest of the bits using the normal algorithm. Because // we made more room, this time it won't overflow. var restOfLength = getBitLength(totalChildren) + restOfBaseLength; var restOfNewBits = slot << restOfBaseLength; var id = restOfNewBits | restOfBaseId; var overflow = newOverflow + baseOverflow; treeContextId = 1 << restOfLength | id; treeContextOverflow = overflow; } else { // Normal path var newBits = slot << baseLength; var _id = newBits | baseId; var _overflow = baseOverflow; treeContextId = 1 << length | _id; treeContextOverflow = _overflow; } } function pushMaterializedTreeId(workInProgress) { warnIfNotHydrating(); // This component materialized an id. This will affect any ids that appear // in its children. var returnFiber = workInProgress.return; if (returnFiber !== null) { var numberOfForks = 1; var slotIndex = 0; pushTreeFork(workInProgress, numberOfForks); pushTreeId(workInProgress, numberOfForks, slotIndex); } } function getBitLength(number) { return 32 - clz32(number); } function getLeadingBit(id) { return 1 << getBitLength(id) - 1; } function popTreeContext(workInProgress) { // Restore the previous values. // This is a bit more complicated than other context-like modules in Fiber // because the same Fiber may appear on the stack multiple times and for // different reasons. We have to keep popping until the work-in-progress is // no longer at the top of the stack. while (workInProgress === treeForkProvider) { treeForkProvider = forkStack[--forkStackIndex]; forkStack[forkStackIndex] = null; treeForkCount = forkStack[--forkStackIndex]; forkStack[forkStackIndex] = null; } while (workInProgress === treeContextProvider) { treeContextProvider = idStack[--idStackIndex]; idStack[idStackIndex] = null; treeContextOverflow = idStack[--idStackIndex]; idStack[idStackIndex] = null; treeContextId = idStack[--idStackIndex]; idStack[idStackIndex] = null; } } function getSuspendedTreeContext() { warnIfNotHydrating(); if (treeContextProvider !== null) { return { id: treeContextId, overflow: treeContextOverflow }; } else { return null; } } function restoreSuspendedTreeContext(workInProgress, suspendedContext) { warnIfNotHydrating(); idStack[idStackIndex++] = treeContextId; idStack[idStackIndex++] = treeContextOverflow; idStack[idStackIndex++] = treeContextProvider; treeContextId = suspendedContext.id; treeContextOverflow = suspendedContext.overflow; treeContextProvider = workInProgress; } function warnIfNotHydrating() { { if (!getIsHydrating()) { error('Expected to be hydrating. This is a bug in React. Please file ' + 'an issue.'); } } } // This may have been an insertion or a hydration. var hydrationParentFiber = null; var nextHydratableInstance = null; var isHydrating = false; // This flag allows for warning supression when we expect there to be mismatches // due to earlier mismatches or a suspended fiber. var didSuspendOrErrorDEV = false; // Hydration errors that were thrown inside this boundary var hydrationErrors = null; function warnIfHydrating() { { if (isHydrating) { error('We should not be hydrating here. This is a bug in React. Please file a bug.'); } } } function markDidThrowWhileHydratingDEV() { { didSuspendOrErrorDEV = true; } } function didSuspendOrErrorWhileHydratingDEV() { { return didSuspendOrErrorDEV; } } function enterHydrationState(fiber) { var parentInstance = fiber.stateNode.containerInfo; nextHydratableInstance = getFirstHydratableChildWithinContainer(parentInstance); hydrationParentFiber = fiber; isHydrating = true; hydrationErrors = null; didSuspendOrErrorDEV = false; return true; } function reenterHydrationStateFromDehydratedSuspenseInstance(fiber, suspenseInstance, treeContext) { nextHydratableInstance = getFirstHydratableChildWithinSuspenseInstance(suspenseInstance); hydrationParentFiber = fiber; isHydrating = true; hydrationErrors = null; didSuspendOrErrorDEV = false; if (treeContext !== null) { restoreSuspendedTreeContext(fiber, treeContext); } return true; } function warnUnhydratedInstance(returnFiber, instance) { { switch (returnFiber.tag) { case HostRoot: { didNotHydrateInstanceWithinContainer(returnFiber.stateNode.containerInfo, instance); break; } case HostComponent: { var isConcurrentMode = (returnFiber.mode & ConcurrentMode) !== NoMode; didNotHydrateInstance(returnFiber.type, returnFiber.memoizedProps, returnFiber.stateNode, instance, // TODO: Delete this argument when we remove the legacy root API. isConcurrentMode); break; } case SuspenseComponent: { var suspenseState = returnFiber.memoizedState; if (suspenseState.dehydrated !== null) didNotHydrateInstanceWithinSuspenseInstance(suspenseState.dehydrated, instance); break; } } } } function deleteHydratableInstance(returnFiber, instance) { warnUnhydratedInstance(returnFiber, instance); var childToDelete = createFiberFromHostInstanceForDeletion(); childToDelete.stateNode = instance; childToDelete.return = returnFiber; var deletions = returnFiber.deletions; if (deletions === null) { returnFiber.deletions = [childToDelete]; returnFiber.flags |= ChildDeletion; } else { deletions.push(childToDelete); } } function warnNonhydratedInstance(returnFiber, fiber) { { if (didSuspendOrErrorDEV) { // Inside a boundary that already suspended. We're currently rendering the // siblings of a suspended node. The mismatch may be due to the missing // data, so it's probably a false positive. return; } switch (returnFiber.tag) { case HostRoot: { var parentContainer = returnFiber.stateNode.containerInfo; switch (fiber.tag) { case HostComponent: var type = fiber.type; var props = fiber.pendingProps; didNotFindHydratableInstanceWithinContainer(parentContainer, type); break; case HostText: var text = fiber.pendingProps; didNotFindHydratableTextInstanceWithinContainer(parentContainer, text); break; } break; } case HostComponent: { var parentType = returnFiber.type; var parentProps = returnFiber.memoizedProps; var parentInstance = returnFiber.stateNode; switch (fiber.tag) { case HostComponent: { var _type = fiber.type; var _props = fiber.pendingProps; var isConcurrentMode = (returnFiber.mode & ConcurrentMode) !== NoMode; didNotFindHydratableInstance(parentType, parentProps, parentInstance, _type, _props, // TODO: Delete this argument when we remove the legacy root API. isConcurrentMode); break; } case HostText: { var _text = fiber.pendingProps; var _isConcurrentMode = (returnFiber.mode & ConcurrentMode) !== NoMode; didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, _text, // TODO: Delete this argument when we remove the legacy root API. _isConcurrentMode); break; } } break; } case SuspenseComponent: { var suspenseState = returnFiber.memoizedState; var _parentInstance = suspenseState.dehydrated; if (_parentInstance !== null) switch (fiber.tag) { case HostComponent: var _type2 = fiber.type; var _props2 = fiber.pendingProps; didNotFindHydratableInstanceWithinSuspenseInstance(_parentInstance, _type2); break; case HostText: var _text2 = fiber.pendingProps; didNotFindHydratableTextInstanceWithinSuspenseInstance(_parentInstance, _text2); break; } break; } default: return; } } } function insertNonHydratedInstance(returnFiber, fiber) { fiber.flags = fiber.flags & ~Hydrating | Placement; warnNonhydratedInstance(returnFiber, fiber); } function tryHydrate(fiber, nextInstance) { switch (fiber.tag) { case HostComponent: { var type = fiber.type; var props = fiber.pendingProps; var instance = canHydrateInstance(nextInstance, type); if (instance !== null) { fiber.stateNode = instance; hydrationParentFiber = fiber; nextHydratableInstance = getFirstHydratableChild(instance); return true; } return false; } case HostText: { var text = fiber.pendingProps; var textInstance = canHydrateTextInstance(nextInstance, text); if (textInstance !== null) { fiber.stateNode = textInstance; hydrationParentFiber = fiber; // Text Instances don't have children so there's nothing to hydrate. nextHydratableInstance = null; return true; } return false; } case SuspenseComponent: { var suspenseInstance = canHydrateSuspenseInstance(nextInstance); if (suspenseInstance !== null) { var suspenseState = { dehydrated: suspenseInstance, treeContext: getSuspendedTreeContext(), retryLane: OffscreenLane }; fiber.memoizedState = suspenseState; // Store the dehydrated fragment as a child fiber. // This simplifies the code for getHostSibling and deleting nodes, // since it doesn't have to consider all Suspense boundaries and // check if they're dehydrated ones or not. var dehydratedFragment = createFiberFromDehydratedFragment(suspenseInstance); dehydratedFragment.return = fiber; fiber.child = dehydratedFragment; hydrationParentFiber = fiber; // While a Suspense Instance does have children, we won't step into // it during the first pass. Instead, we'll reenter it later. nextHydratableInstance = null; return true; } return false; } default: return false; } } function shouldClientRenderOnMismatch(fiber) { return (fiber.mode & ConcurrentMode) !== NoMode && (fiber.flags & DidCapture) === NoFlags; } function throwOnHydrationMismatch(fiber) { throw new Error('Hydration failed because the initial UI does not match what was ' + 'rendered on the server.'); } function tryToClaimNextHydratableInstance(fiber) { if (!isHydrating) { return; } var nextInstance = nextHydratableInstance; if (!nextInstance) { if (shouldClientRenderOnMismatch(fiber)) { warnNonhydratedInstance(hydrationParentFiber, fiber); throwOnHydrationMismatch(); } // Nothing to hydrate. Make it an insertion. insertNonHydratedInstance(hydrationParentFiber, fiber); isHydrating = false; hydrationParentFiber = fiber; return; } var firstAttemptedInstance = nextInstance; if (!tryHydrate(fiber, nextInstance)) { if (shouldClientRenderOnMismatch(fiber)) { warnNonhydratedInstance(hydrationParentFiber, fiber); throwOnHydrationMismatch(); } // If we can't hydrate this instance let's try the next one. // We use this as a heuristic. It's based on intuition and not data so it // might be flawed or unnecessary. nextInstance = getNextHydratableSibling(firstAttemptedInstance); var prevHydrationParentFiber = hydrationParentFiber; if (!nextInstance || !tryHydrate(fiber, nextInstance)) { // Nothing to hydrate. Make it an insertion. insertNonHydratedInstance(hydrationParentFiber, fiber); isHydrating = false; hydrationParentFiber = fiber; return; } // We matched the next one, we'll now assume that the first one was // superfluous and we'll delete it. Since we can't eagerly delete it // we'll have to schedule a deletion. To do that, this node needs a dummy // fiber associated with it. deleteHydratableInstance(prevHydrationParentFiber, firstAttemptedInstance); } } function prepareToHydrateHostInstance(fiber, rootContainerInstance, hostContext) { var instance = fiber.stateNode; var shouldWarnIfMismatchDev = !didSuspendOrErrorDEV; var updatePayload = hydrateInstance(instance, fiber.type, fiber.memoizedProps, rootContainerInstance, hostContext, fiber, shouldWarnIfMismatchDev); // TODO: Type this specific to this type of component. fiber.updateQueue = updatePayload; // If the update payload indicates that there is a change or if there // is a new ref we mark this as an update. if (updatePayload !== null) { return true; } return false; } function prepareToHydrateHostTextInstance(fiber) { var textInstance = fiber.stateNode; var textContent = fiber.memoizedProps; var shouldUpdate = hydrateTextInstance(textInstance, textContent, fiber); if (shouldUpdate) { // We assume that prepareToHydrateHostTextInstance is called in a context where the // hydration parent is the parent host component of this host text. var returnFiber = hydrationParentFiber; if (returnFiber !== null) { switch (returnFiber.tag) { case HostRoot: { var parentContainer = returnFiber.stateNode.containerInfo; var isConcurrentMode = (returnFiber.mode & ConcurrentMode) !== NoMode; didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, textContent, // TODO: Delete this argument when we remove the legacy root API. isConcurrentMode); break; } case HostComponent: { var parentType = returnFiber.type; var parentProps = returnFiber.memoizedProps; var parentInstance = returnFiber.stateNode; var _isConcurrentMode2 = (returnFiber.mode & ConcurrentMode) !== NoMode; didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, textContent, // TODO: Delete this argument when we remove the legacy root API. _isConcurrentMode2); break; } } } } return shouldUpdate; } function prepareToHydrateHostSuspenseInstance(fiber) { var suspenseState = fiber.memoizedState; var suspenseInstance = suspenseState !== null ? suspenseState.dehydrated : null; if (!suspenseInstance) { throw new Error('Expected to have a hydrated suspense instance. ' + 'This error is likely caused by a bug in React. Please file an issue.'); } hydrateSuspenseInstance(suspenseInstance, fiber); } function skipPastDehydratedSuspenseInstance(fiber) { var suspenseState = fiber.memoizedState; var suspenseInstance = suspenseState !== null ? suspenseState.dehydrated : null; if (!suspenseInstance) { throw new Error('Expected to have a hydrated suspense instance. ' + 'This error is likely caused by a bug in React. Please file an issue.'); } return getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance); } function popToNextHostParent(fiber) { var parent = fiber.return; while (parent !== null && parent.tag !== HostComponent && parent.tag !== HostRoot && parent.tag !== SuspenseComponent) { parent = parent.return; } hydrationParentFiber = parent; } function popHydrationState(fiber) { if (fiber !== hydrationParentFiber) { // We're deeper than the current hydration context, inside an inserted // tree. return false; } if (!isHydrating) { // If we're not currently hydrating but we're in a hydration context, then // we were an insertion and now need to pop up reenter hydration of our // siblings. popToNextHostParent(fiber); isHydrating = true; return false; } // If we have any remaining hydratable nodes, we need to delete them now. // We only do this deeper than head and body since they tend to have random // other nodes in them. We also ignore components with pure text content in // side of them. We also don't delete anything inside the root container. if (fiber.tag !== HostRoot && (fiber.tag !== HostComponent || shouldDeleteUnhydratedTailInstances(fiber.type) && !shouldSetTextContent(fiber.type, fiber.memoizedProps))) { var nextInstance = nextHydratableInstance; if (nextInstance) { if (shouldClientRenderOnMismatch(fiber)) { warnIfUnhydratedTailNodes(fiber); throwOnHydrationMismatch(); } else { while (nextInstance) { deleteHydratableInstance(fiber, nextInstance); nextInstance = getNextHydratableSibling(nextInstance); } } } } popToNextHostParent(fiber); if (fiber.tag === SuspenseComponent) { nextHydratableInstance = skipPastDehydratedSuspenseInstance(fiber); } else { nextHydratableInstance = hydrationParentFiber ? getNextHydratableSibling(fiber.stateNode) : null; } return true; } function hasUnhydratedTailNodes() { return isHydrating && nextHydratableInstance !== null; } function warnIfUnhydratedTailNodes(fiber) { var nextInstance = nextHydratableInstance; while (nextInstance) { warnUnhydratedInstance(fiber, nextInstance); nextInstance = getNextHydratableSibling(nextInstance); } } function resetHydrationState() { hydrationParentFiber = null; nextHydratableInstance = null; isHydrating = false; didSuspendOrErrorDEV = false; } function upgradeHydrationErrorsToRecoverable() { if (hydrationErrors !== null) { // Successfully completed a forced client render. The errors that occurred // during the hydration attempt are now recovered. We will log them in // commit phase, once the entire tree has finished. queueRecoverableErrors(hydrationErrors); hydrationErrors = null; } } function getIsHydrating() { return isHydrating; } function queueHydrationError(error) { if (hydrationErrors === null) { hydrationErrors = [error]; } else { hydrationErrors.push(error); } } var ReactCurrentBatchConfig$1 = ReactSharedInternals.ReactCurrentBatchConfig; var NoTransition = null; function requestCurrentTransition() { return ReactCurrentBatchConfig$1.transition; } var ReactStrictModeWarnings = { recordUnsafeLifecycleWarnings: function (fiber, instance) {}, flushPendingUnsafeLifecycleWarnings: function () {}, recordLegacyContextWarning: function (fiber, instance) {}, flushLegacyContextWarning: function () {}, discardPendingWarnings: function () {} }; { var findStrictRoot = function (fiber) { var maybeStrictRoot = null; var node = fiber; while (node !== null) { if (node.mode & StrictLegacyMode) { maybeStrictRoot = node; } node = node.return; } return maybeStrictRoot; }; var setToSortedString = function (set) { var array = []; set.forEach(function (value) { array.push(value); }); return array.sort().join(', '); }; var pendingComponentWillMountWarnings = []; var pendingUNSAFE_ComponentWillMountWarnings = []; var pendingComponentWillReceivePropsWarnings = []; var pendingUNSAFE_ComponentWillReceivePropsWarnings = []; var pendingComponentWillUpdateWarnings = []; var pendingUNSAFE_ComponentWillUpdateWarnings = []; // Tracks components we have already warned about. var didWarnAboutUnsafeLifecycles = new Set(); ReactStrictModeWarnings.recordUnsafeLifecycleWarnings = function (fiber, instance) { // Dedupe strategy: Warn once per component. if (didWarnAboutUnsafeLifecycles.has(fiber.type)) { return; } if (typeof instance.componentWillMount === 'function' && // Don't warn about react-lifecycles-compat polyfilled components. instance.componentWillMount.__suppressDeprecationWarning !== true) { pendingComponentWillMountWarnings.push(fiber); } if (fiber.mode & StrictLegacyMode && typeof instance.UNSAFE_componentWillMount === 'function') { pendingUNSAFE_ComponentWillMountWarnings.push(fiber); } if (typeof instance.componentWillReceiveProps === 'function' && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) { pendingComponentWillReceivePropsWarnings.push(fiber); } if (fiber.mode & StrictLegacyMode && typeof instance.UNSAFE_componentWillReceiveProps === 'function') { pendingUNSAFE_ComponentWillReceivePropsWarnings.push(fiber); } if (typeof instance.componentWillUpdate === 'function' && instance.componentWillUpdate.__suppressDeprecationWarning !== true) { pendingComponentWillUpdateWarnings.push(fiber); } if (fiber.mode & StrictLegacyMode && typeof instance.UNSAFE_componentWillUpdate === 'function') { pendingUNSAFE_ComponentWillUpdateWarnings.push(fiber); } }; ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings = function () { // We do an initial pass to gather component names var componentWillMountUniqueNames = new Set(); if (pendingComponentWillMountWarnings.length > 0) { pendingComponentWillMountWarnings.forEach(function (fiber) { componentWillMountUniqueNames.add(getComponentNameFromFiber(fiber) || 'Component'); didWarnAboutUnsafeLifecycles.add(fiber.type); }); pendingComponentWillMountWarnings = []; } var UNSAFE_componentWillMountUniqueNames = new Set(); if (pendingUNSAFE_ComponentWillMountWarnings.length > 0) { pendingUNSAFE_ComponentWillMountWarnings.forEach(function (fiber) { UNSAFE_componentWillMountUniqueNames.add(getComponentNameFromFiber(fiber) || 'Component'); didWarnAboutUnsafeLifecycles.add(fiber.type); }); pendingUNSAFE_ComponentWillMountWarnings = []; } var componentWillReceivePropsUniqueNames = new Set(); if (pendingComponentWillReceivePropsWarnings.length > 0) { pendingComponentWillReceivePropsWarnings.forEach(function (fiber) { componentWillReceivePropsUniqueNames.add(getComponentNameFromFiber(fiber) || 'Component'); didWarnAboutUnsafeLifecycles.add(fiber.type); }); pendingComponentWillReceivePropsWarnings = []; } var UNSAFE_componentWillReceivePropsUniqueNames = new Set(); if (pendingUNSAFE_ComponentWillReceivePropsWarnings.length > 0) { pendingUNSAFE_ComponentWillReceivePropsWarnings.forEach(function (fiber) { UNSAFE_componentWillReceivePropsUniqueNames.add(getComponentNameFromFiber(fiber) || 'Component'); didWarnAboutUnsafeLifecycles.add(fiber.type); }); pendingUNSAFE_ComponentWillReceivePropsWarnings = []; } var componentWillUpdateUniqueNames = new Set(); if (pendingComponentWillUpdateWarnings.length > 0) { pendingComponentWillUpdateWarnings.forEach(function (fiber) { componentWillUpdateUniqueNames.add(getComponentNameFromFiber(fiber) || 'Component'); didWarnAboutUnsafeLifecycles.add(fiber.type); }); pendingComponentWillUpdateWarnings = []; } var UNSAFE_componentWillUpdateUniqueNames = new Set(); if (pendingUNSAFE_ComponentWillUpdateWarnings.length > 0) { pendingUNSAFE_ComponentWillUpdateWarnings.forEach(function (fiber) { UNSAFE_componentWillUpdateUniqueNames.add(getComponentNameFromFiber(fiber) || 'Component'); didWarnAboutUnsafeLifecycles.add(fiber.type); }); pendingUNSAFE_ComponentWillUpdateWarnings = []; } // Finally, we flush all the warnings // UNSAFE_ ones before the deprecated ones, since they'll be 'louder' if (UNSAFE_componentWillMountUniqueNames.size > 0) { var sortedNames = setToSortedString(UNSAFE_componentWillMountUniqueNames); error('Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. ' + 'See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n' + '* Move code with side effects to componentDidMount, and set initial state in the constructor.\n' + '\nPlease update the following components: %s', sortedNames); } if (UNSAFE_componentWillReceivePropsUniqueNames.size > 0) { var _sortedNames = setToSortedString(UNSAFE_componentWillReceivePropsUniqueNames); error('Using UNSAFE_componentWillReceiveProps in strict mode is not recommended ' + 'and may indicate bugs in your code. ' + 'See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n' + '* Move data fetching code or side effects to componentDidUpdate.\n' + "* If you're updating state whenever props change, " + 'refactor your code to use memoization techniques or move it to ' + 'static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state\n' + '\nPlease update the following components: %s', _sortedNames); } if (UNSAFE_componentWillUpdateUniqueNames.size > 0) { var _sortedNames2 = setToSortedString(UNSAFE_componentWillUpdateUniqueNames); error('Using UNSAFE_componentWillUpdate in strict mode is not recommended ' + 'and may indicate bugs in your code. ' + 'See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n' + '* Move data fetching code or side effects to componentDidUpdate.\n' + '\nPlease update the following components: %s', _sortedNames2); } if (componentWillMountUniqueNames.size > 0) { var _sortedNames3 = setToSortedString(componentWillMountUniqueNames); warn('componentWillMount has been renamed, and is not recommended for use. ' + 'See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n' + '* Move code with side effects to componentDidMount, and set initial state in the constructor.\n' + '* Rename componentWillMount to UNSAFE_componentWillMount to suppress ' + 'this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. ' + 'To rename all deprecated lifecycles to their new names, you can run ' + '`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n' + '\nPlease update the following components: %s', _sortedNames3); } if (componentWillReceivePropsUniqueNames.size > 0) { var _sortedNames4 = setToSortedString(componentWillReceivePropsUniqueNames); warn('componentWillReceiveProps has been renamed, and is not recommended for use. ' + 'See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n' + '* Move data fetching code or side effects to componentDidUpdate.\n' + "* If you're updating state whenever props change, refactor your " + 'code to use memoization techniques or move it to ' + 'static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state\n' + '* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress ' + 'this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. ' + 'To rename all deprecated lifecycles to their new names, you can run ' + '`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n' + '\nPlease update the following components: %s', _sortedNames4); } if (componentWillUpdateUniqueNames.size > 0) { var _sortedNames5 = setToSortedString(componentWillUpdateUniqueNames); warn('componentWillUpdate has been renamed, and is not recommended for use. ' + 'See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n' + '* Move data fetching code or side effects to componentDidUpdate.\n' + '* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress ' + 'this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. ' + 'To rename all deprecated lifecycles to their new names, you can run ' + '`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n' + '\nPlease update the following components: %s', _sortedNames5); } }; var pendingLegacyContextWarning = new Map(); // Tracks components we have already warned about. var didWarnAboutLegacyContext = new Set(); ReactStrictModeWarnings.recordLegacyContextWarning = function (fiber, instance) { var strictRoot = findStrictRoot(fiber); if (strictRoot === null) { error('Expected to find a StrictMode component in a strict mode tree. ' + 'This error is likely caused by a bug in React. Please file an issue.'); return; } // Dedup strategy: Warn once per component. if (didWarnAboutLegacyContext.has(fiber.type)) { return; } var warningsForRoot = pendingLegacyContextWarning.get(strictRoot); if (fiber.type.contextTypes != null || fiber.type.childContextTypes != null || instance !== null && typeof instance.getChildContext === 'function') { if (warningsForRoot === undefined) { warningsForRoot = []; pendingLegacyContextWarning.set(strictRoot, warningsForRoot); } warningsForRoot.push(fiber); } }; ReactStrictModeWarnings.flushLegacyContextWarning = function () { pendingLegacyContextWarning.forEach(function (fiberArray, strictRoot) { if (fiberArray.length === 0) { return; } var firstFiber = fiberArray[0]; var uniqueNames = new Set(); fiberArray.forEach(function (fiber) { uniqueNames.add(getComponentNameFromFiber(fiber) || 'Component'); didWarnAboutLegacyContext.add(fiber.type); }); var sortedNames = setToSortedString(uniqueNames); try { setCurrentFiber(firstFiber); error('Legacy context API has been detected within a strict-mode tree.' + '\n\nThe old API will be supported in all 16.x releases, but applications ' + 'using it should migrate to the new version.' + '\n\nPlease update the following components: %s' + '\n\nLearn more about this warning here: https://reactjs.org/link/legacy-context', sortedNames); } finally { resetCurrentFiber(); } }); }; ReactStrictModeWarnings.discardPendingWarnings = function () { pendingComponentWillMountWarnings = []; pendingUNSAFE_ComponentWillMountWarnings = []; pendingComponentWillReceivePropsWarnings = []; pendingUNSAFE_ComponentWillReceivePropsWarnings = []; pendingComponentWillUpdateWarnings = []; pendingUNSAFE_ComponentWillUpdateWarnings = []; pendingLegacyContextWarning = new Map(); }; } var didWarnAboutMaps; var didWarnAboutGenerators; var didWarnAboutStringRefs; var ownerHasKeyUseWarning; var ownerHasFunctionTypeWarning; var warnForMissingKey = function (child, returnFiber) {}; { didWarnAboutMaps = false; didWarnAboutGenerators = false; didWarnAboutStringRefs = {}; /** * Warn if there's no key explicitly set on dynamic arrays of children or * object keys are not valid. This allows us to keep track of children between * updates. */ ownerHasKeyUseWarning = {}; ownerHasFunctionTypeWarning = {}; warnForMissingKey = function (child, returnFiber) { if (child === null || typeof child !== 'object') { return; } if (!child._store || child._store.validated || child.key != null) { return; } if (typeof child._store !== 'object') { throw new Error('React Component in warnForMissingKey should have a _store. ' + 'This error is likely caused by a bug in React. Please file an issue.'); } child._store.validated = true; var componentName = getComponentNameFromFiber(returnFiber) || 'Component'; if (ownerHasKeyUseWarning[componentName]) { return; } ownerHasKeyUseWarning[componentName] = true; error('Each child in a list should have a unique ' + '"key" prop. See https://reactjs.org/link/warning-keys for ' + 'more information.'); }; } function isReactClass(type) { return type.prototype && type.prototype.isReactComponent; } function coerceRef(returnFiber, current, element) { var mixedRef = element.ref; if (mixedRef !== null && typeof mixedRef !== 'function' && typeof mixedRef !== 'object') { { // TODO: Clean this up once we turn on the string ref warning for // everyone, because the strict mode case will no longer be relevant if ((returnFiber.mode & StrictLegacyMode || warnAboutStringRefs) && // We warn in ReactElement.js if owner and self are equal for string refs // because these cannot be automatically converted to an arrow function // using a codemod. Therefore, we don't have to warn about string refs again. !(element._owner && element._self && element._owner.stateNode !== element._self) && // Will already throw with "Function components cannot have string refs" !(element._owner && element._owner.tag !== ClassComponent) && // Will already warn with "Function components cannot be given refs" !(typeof element.type === 'function' && !isReactClass(element.type)) && // Will already throw with "Element ref was specified as a string (someStringRef) but no owner was set" element._owner) { var componentName = getComponentNameFromFiber(returnFiber) || 'Component'; if (!didWarnAboutStringRefs[componentName]) { { error('Component "%s" contains the string ref "%s". Support for string refs ' + 'will be removed in a future major release. We recommend using ' + 'useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', componentName, mixedRef); } didWarnAboutStringRefs[componentName] = true; } } } if (element._owner) { var owner = element._owner; var inst; if (owner) { var ownerFiber = owner; if (ownerFiber.tag !== ClassComponent) { throw new Error('Function components cannot have string refs. ' + 'We recommend using useRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref'); } inst = ownerFiber.stateNode; } if (!inst) { throw new Error("Missing owner for string ref " + mixedRef + ". This error is likely caused by a " + 'bug in React. Please file an issue.'); } // Assigning this to a const so Flow knows it won't change in the closure var resolvedInst = inst; { checkPropStringCoercion(mixedRef, 'ref'); } var stringRef = '' + mixedRef; // Check if previous string ref matches new string ref if (current !== null && current.ref !== null && typeof current.ref === 'function' && current.ref._stringRef === stringRef) { return current.ref; } var ref = function (value) { var refs = resolvedInst.refs; if (value === null) { delete refs[stringRef]; } else { refs[stringRef] = value; } }; ref._stringRef = stringRef; return ref; } else { if (typeof mixedRef !== 'string') { throw new Error('Expected ref to be a function, a string, an object returned by React.createRef(), or null.'); } if (!element._owner) { throw new Error("Element ref was specified as a string (" + mixedRef + ") but no owner was set. This could happen for one of" + ' the following reasons:\n' + '1. You may be adding a ref to a function component\n' + "2. You may be adding a ref to a component that was not created inside a component's render method\n" + '3. You have multiple copies of React loaded\n' + 'See https://reactjs.org/link/refs-must-have-owner for more information.'); } } } return mixedRef; } function throwOnInvalidObjectType(returnFiber, newChild) { var childString = Object.prototype.toString.call(newChild); throw new Error("Objects are not valid as a React child (found: " + (childString === '[object Object]' ? 'object with keys {' + Object.keys(newChild).join(', ') + '}' : childString) + "). " + 'If you meant to render a collection of children, use an array ' + 'instead.'); } function warnOnFunctionType(returnFiber) { { var componentName = getComponentNameFromFiber(returnFiber) || 'Component'; if (ownerHasFunctionTypeWarning[componentName]) { return; } ownerHasFunctionTypeWarning[componentName] = true; error('Functions are not valid as a React child. This may happen if ' + 'you return a Component instead of <Component /> from render. ' + 'Or maybe you meant to call this function rather than return it.'); } } function resolveLazy(lazyType) { var payload = lazyType._payload; var init = lazyType._init; return init(payload); } // This wrapper function exists because I expect to clone the code in each path // to be able to optimize each path individually by branching early. This needs // a compiler or we can do it manually. Helpers that don't need this branching // live outside of this function. function ChildReconciler(shouldTrackSideEffects) { function deleteChild(returnFiber, childToDelete) { if (!shouldTrackSideEffects) { // Noop. return; } var deletions = returnFiber.deletions; if (deletions === null) { returnFiber.deletions = [childToDelete]; returnFiber.flags |= ChildDeletion; } else { deletions.push(childToDelete); } } function deleteRemainingChildren(returnFiber, currentFirstChild) { if (!shouldTrackSideEffects) { // Noop. return null; } // TODO: For the shouldClone case, this could be micro-optimized a bit by // assuming that after the first child we've already added everything. var childToDelete = currentFirstChild; while (childToDelete !== null) { deleteChild(returnFiber, childToDelete); childToDelete = childToDelete.sibling; } return null; } function mapRemainingChildren(returnFiber, currentFirstChild) { // Add the remaining children to a temporary map so that we can find them by // keys quickly. Implicit (null) keys get added to this set with their index // instead. var existingChildren = new Map(); var existingChild = currentFirstChild; while (existingChild !== null) { if (existingChild.key !== null) { existingChildren.set(existingChild.key, existingChild); } else { existingChildren.set(existingChild.index, existingChild); } existingChild = existingChild.sibling; } return existingChildren; } function useFiber(fiber, pendingProps) { // We currently set sibling to null and index to 0 here because it is easy // to forget to do before returning it. E.g. for the single child case. var clone = createWorkInProgress(fiber, pendingProps); clone.index = 0; clone.sibling = null; return clone; } function placeChild(newFiber, lastPlacedIndex, newIndex) { newFiber.index = newIndex; if (!shouldTrackSideEffects) { // During hydration, the useId algorithm needs to know which fibers are // part of a list of children (arrays, iterators). newFiber.flags |= Forked; return lastPlacedIndex; } var current = newFiber.alternate; if (current !== null) { var oldIndex = current.index; if (oldIndex < lastPlacedIndex) { // This is a move. newFiber.flags |= Placement; return lastPlacedIndex; } else { // This item can stay in place. return oldIndex; } } else { // This is an insertion. newFiber.flags |= Placement; return lastPlacedIndex; } } function placeSingleChild(newFiber) { // This is simpler for the single child case. We only need to do a // placement for inserting new children. if (shouldTrackSideEffects && newFiber.alternate === null) { newFiber.flags |= Placement; } return newFiber; } function updateTextNode(returnFiber, current, textContent, lanes) { if (current === null || current.tag !== HostText) { // Insert var created = createFiberFromText(textContent, returnFiber.mode, lanes); created.return = returnFiber; return created; } else { // Update var existing = useFiber(current, textContent); existing.return = returnFiber; return existing; } } function updateElement(returnFiber, current, element, lanes) { var elementType = element.type; if (elementType === REACT_FRAGMENT_TYPE) { return updateFragment(returnFiber, current, element.props.children, lanes, element.key); } if (current !== null) { if (current.elementType === elementType || ( // Keep this check inline so it only runs on the false path: isCompatibleFamilyForHotReloading(current, element) ) || // Lazy types should reconcile their resolved type. // We need to do this after the Hot Reloading check above, // because hot reloading has different semantics than prod because // it doesn't resuspend. So we can't let the call below suspend. typeof elementType === 'object' && elementType !== null && elementType.$$typeof === REACT_LAZY_TYPE && resolveLazy(elementType) === current.type) { // Move based on index var existing = useFiber(current, element.props); existing.ref = coerceRef(returnFiber, current, element); existing.return = returnFiber; { existing._debugSource = element._source; existing._debugOwner = element._owner; } return existing; } } // Insert var created = createFiberFromElement(element, returnFiber.mode, lanes); created.ref = coerceRef(returnFiber, current, element); created.return = returnFiber; return created; } function updatePortal(returnFiber, current, portal, lanes) { if (current === null || current.tag !== HostPortal || current.stateNode.containerInfo !== portal.containerInfo || current.stateNode.implementation !== portal.implementation) { // Insert var created = createFiberFromPortal(portal, returnFiber.mode, lanes); created.return = returnFiber; return created; } else { // Update var existing = useFiber(current, portal.children || []); existing.return = returnFiber; return existing; } } function updateFragment(returnFiber, current, fragment, lanes, key) { if (current === null || current.tag !== Fragment) { // Insert var created = createFiberFromFragment(fragment, returnFiber.mode, lanes, key); created.return = returnFiber; return created; } else { // Update var existing = useFiber(current, fragment); existing.return = returnFiber; return existing; } } function createChild(returnFiber, newChild, lanes) { if (typeof newChild === 'string' && newChild !== '' || typeof newChild === 'number') { // Text nodes don't have keys. If the previous node is implicitly keyed // we can continue to replace it without aborting even if it is not a text // node. var created = createFiberFromText('' + newChild, returnFiber.mode, lanes); created.return = returnFiber; return created; } if (typeof newChild === 'object' && newChild !== null) { switch (newChild.$$typeof) { case REACT_ELEMENT_TYPE: { var _created = createFiberFromElement(newChild, returnFiber.mode, lanes); _created.ref = coerceRef(returnFiber, null, newChild); _created.return = returnFiber; return _created; } case REACT_PORTAL_TYPE: { var _created2 = createFiberFromPortal(newChild, returnFiber.mode, lanes); _created2.return = returnFiber; return _created2; } case REACT_LAZY_TYPE: { var payload = newChild._payload; var init = newChild._init; return createChild(returnFiber, init(payload), lanes); } } if (isArray(newChild) || getIteratorFn(newChild)) { var _created3 = createFiberFromFragment(newChild, returnFiber.mode, lanes, null); _created3.return = returnFiber; return _created3; } throwOnInvalidObjectType(returnFiber, newChild); } { if (typeof newChild === 'function') { warnOnFunctionType(returnFiber); } } return null; } function updateSlot(returnFiber, oldFiber, newChild, lanes) { // Update the fiber if the keys match, otherwise return null. var key = oldFiber !== null ? oldFiber.key : null; if (typeof newChild === 'string' && newChild !== '' || typeof newChild === 'number') { // Text nodes don't have keys. If the previous node is implicitly keyed // we can continue to replace it without aborting even if it is not a text // node. if (key !== null) { return null; } return updateTextNode(returnFiber, oldFiber, '' + newChild, lanes); } if (typeof newChild === 'object' && newChild !== null) { switch (newChild.$$typeof) { case REACT_ELEMENT_TYPE: { if (newChild.key === key) { return updateElement(returnFiber, oldFiber, newChild, lanes); } else { return null; } } case REACT_PORTAL_TYPE: { if (newChild.key === key) { return updatePortal(returnFiber, oldFiber, newChild, lanes); } else { return null; } } case REACT_LAZY_TYPE: { var payload = newChild._payload; var init = newChild._init; return updateSlot(returnFiber, oldFiber, init(payload), lanes); } } if (isArray(newChild) || getIteratorFn(newChild)) { if (key !== null) { return null; } return updateFragment(returnFiber, oldFiber, newChild, lanes, null); } throwOnInvalidObjectType(returnFiber, newChild); } { if (typeof newChild === 'function') { warnOnFunctionType(returnFiber); } } return null; } function updateFromMap(existingChildren, returnFiber, newIdx, newChild, lanes) { if (typeof newChild === 'string' && newChild !== '' || typeof newChild === 'number') { // Text nodes don't have keys, so we neither have to check the old nor // new node for the key. If both are text nodes, they match. var matchedFiber = existingChildren.get(newIdx) || null; return updateTextNode(returnFiber, matchedFiber, '' + newChild, lanes); } if (typeof newChild === 'object' && newChild !== null) { switch (newChild.$$typeof) { case REACT_ELEMENT_TYPE: { var _matchedFiber = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null; return updateElement(returnFiber, _matchedFiber, newChild, lanes); } case REACT_PORTAL_TYPE: { var _matchedFiber2 = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null; return updatePortal(returnFiber, _matchedFiber2, newChild, lanes); } case REACT_LAZY_TYPE: var payload = newChild._payload; var init = newChild._init; return updateFromMap(existingChildren, returnFiber, newIdx, init(payload), lanes); } if (isArray(newChild) || getIteratorFn(newChild)) { var _matchedFiber3 = existingChildren.get(newIdx) || null; return updateFragment(returnFiber, _matchedFiber3, newChild, lanes, null); } throwOnInvalidObjectType(returnFiber, newChild); } { if (typeof newChild === 'function') { warnOnFunctionType(returnFiber); } } return null; } /** * Warns if there is a duplicate or missing key */ function warnOnInvalidKey(child, knownKeys, returnFiber) { { if (typeof child !== 'object' || child === null) { return knownKeys; } switch (child.$$typeof) { case REACT_ELEMENT_TYPE: case REACT_PORTAL_TYPE: warnForMissingKey(child, returnFiber); var key = child.key; if (typeof key !== 'string') { break; } if (knownKeys === null) { knownKeys = new Set(); knownKeys.add(key); break; } if (!knownKeys.has(key)) { knownKeys.add(key); break; } error('Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.', key); break; case REACT_LAZY_TYPE: var payload = child._payload; var init = child._init; warnOnInvalidKey(init(payload), knownKeys, returnFiber); break; } } return knownKeys; } function reconcileChildrenArray(returnFiber, currentFirstChild, newChildren, lanes) { // This algorithm can't optimize by searching from both ends since we // don't have backpointers on fibers. I'm trying to see how far we can get // with that model. If it ends up not being worth the tradeoffs, we can // add it later. // Even with a two ended optimization, we'd want to optimize for the case // where there are few changes and brute force the comparison instead of // going for the Map. It'd like to explore hitting that path first in // forward-only mode and only go for the Map once we notice that we need // lots of look ahead. This doesn't handle reversal as well as two ended // search but that's unusual. Besides, for the two ended optimization to // work on Iterables, we'd need to copy the whole set. // In this first iteration, we'll just live with hitting the bad case // (adding everything to a Map) in for every insert/move. // If you change this code, also update reconcileChildrenIterator() which // uses the same algorithm. { // First, validate keys. var knownKeys = null; for (var i = 0; i < newChildren.length; i++) { var child = newChildren[i]; knownKeys = warnOnInvalidKey(child, knownKeys, returnFiber); } } var resultingFirstChild = null; var previousNewFiber = null; var oldFiber = currentFirstChild; var lastPlacedIndex = 0; var newIdx = 0; var nextOldFiber = null; for (; oldFiber !== null && newIdx < newChildren.length; newIdx++) { if (oldFiber.index > newIdx) { nextOldFiber = oldFiber; oldFiber = null; } else { nextOldFiber = oldFiber.sibling; } var newFiber = updateSlot(returnFiber, oldFiber, newChildren[newIdx], lanes); if (newFiber === null) { // TODO: This breaks on empty slots like null children. That's // unfortunate because it triggers the slow path all the time. We need // a better way to communicate whether this was a miss or null, // boolean, undefined, etc. if (oldFiber === null) { oldFiber = nextOldFiber; } break; } if (shouldTrackSideEffects) { if (oldFiber && newFiber.alternate === null) { // We matched the slot, but we didn't reuse the existing fiber, so we // need to delete the existing child. deleteChild(returnFiber, oldFiber); } } lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx); if (previousNewFiber === null) { // TODO: Move out of the loop. This only happens for the first run. resultingFirstChild = newFiber; } else { // TODO: Defer siblings if we're not at the right index for this slot. // I.e. if we had null values before, then we want to defer this // for each null value. However, we also don't want to call updateSlot // with the previous one. previousNewFiber.sibling = newFiber; } previousNewFiber = newFiber; oldFiber = nextOldFiber; } if (newIdx === newChildren.length) { // We've reached the end of the new children. We can delete the rest. deleteRemainingChildren(returnFiber, oldFiber); if (getIsHydrating()) { var numberOfForks = newIdx; pushTreeFork(returnFiber, numberOfForks); } return resultingFirstChild; } if (oldFiber === null) { // If we don't have any more existing children we can choose a fast path // since the rest will all be insertions. for (; newIdx < newChildren.length; newIdx++) { var _newFiber = createChild(returnFiber, newChildren[newIdx], lanes); if (_newFiber === null) { continue; } lastPlacedIndex = placeChild(_newFiber, lastPlacedIndex, newIdx); if (previousNewFiber === null) { // TODO: Move out of the loop. This only happens for the first run. resultingFirstChild = _newFiber; } else { previousNewFiber.sibling = _newFiber; } previousNewFiber = _newFiber; } if (getIsHydrating()) { var _numberOfForks = newIdx; pushTreeFork(returnFiber, _numberOfForks); } return resultingFirstChild; } // Add all children to a key map for quick lookups. var existingChildren = mapRemainingChildren(returnFiber, oldFiber); // Keep scanning and use the map to restore deleted items as moves. for (; newIdx < newChildren.length; newIdx++) { var _newFiber2 = updateFromMap(existingChildren, returnFiber, newIdx, newChildren[newIdx], lanes); if (_newFiber2 !== null) { if (shouldTrackSideEffects) { if (_newFiber2.alternate !== null) { // The new fiber is a work in progress, but if there exists a // current, that means that we reused the fiber. We need to delete // it from the child list so that we don't add it to the deletion // list. existingChildren.delete(_newFiber2.key === null ? newIdx : _newFiber2.key); } } lastPlacedIndex = placeChild(_newFiber2, lastPlacedIndex, newIdx); if (previousNewFiber === null) { resultingFirstChild = _newFiber2; } else { previousNewFiber.sibling = _newFiber2; } previousNewFiber = _newFiber2; } } if (shouldTrackSideEffects) { // Any existing children that weren't consumed above were deleted. We need // to add them to the deletion list. existingChildren.forEach(function (child) { return deleteChild(returnFiber, child); }); } if (getIsHydrating()) { var _numberOfForks2 = newIdx; pushTreeFork(returnFiber, _numberOfForks2); } return resultingFirstChild; } function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildrenIterable, lanes) { // This is the same implementation as reconcileChildrenArray(), // but using the iterator instead. var iteratorFn = getIteratorFn(newChildrenIterable); if (typeof iteratorFn !== 'function') { throw new Error('An object is not an iterable. This error is likely caused by a bug in ' + 'React. Please file an issue.'); } { // We don't support rendering Generators because it's a mutation. // See https://github.com/facebook/react/issues/12995 if (typeof Symbol === 'function' && // $FlowFixMe Flow doesn't know about toStringTag newChildrenIterable[Symbol.toStringTag] === 'Generator') { if (!didWarnAboutGenerators) { error('Using Generators as children is unsupported and will likely yield ' + 'unexpected results because enumerating a generator mutates it. ' + 'You may convert it to an array with `Array.from()` or the ' + '`[...spread]` operator before rendering. Keep in mind ' + 'you might need to polyfill these features for older browsers.'); } didWarnAboutGenerators = true; } // Warn about using Maps as children if (newChildrenIterable.entries === iteratorFn) { if (!didWarnAboutMaps) { error('Using Maps as children is not supported. ' + 'Use an array of keyed ReactElements instead.'); } didWarnAboutMaps = true; } // First, validate keys. // We'll get a different iterator later for the main pass. var _newChildren = iteratorFn.call(newChildrenIterable); if (_newChildren) { var knownKeys = null; var _step = _newChildren.next(); for (; !_step.done; _step = _newChildren.next()) { var child = _step.value; knownKeys = warnOnInvalidKey(child, knownKeys, returnFiber); } } } var newChildren = iteratorFn.call(newChildrenIterable); if (newChildren == null) { throw new Error('An iterable object provided no iterator.'); } var resultingFirstChild = null; var previousNewFiber = null; var oldFiber = currentFirstChild; var lastPlacedIndex = 0; var newIdx = 0; var nextOldFiber = null; var step = newChildren.next(); for (; oldFiber !== null && !step.done; newIdx++, step = newChildren.next()) { if (oldFiber.index > newIdx) { nextOldFiber = oldFiber; oldFiber = null; } else { nextOldFiber = oldFiber.sibling; } var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes); if (newFiber === null) { // TODO: This breaks on empty slots like null children. That's // unfortunate because it triggers the slow path all the time. We need // a better way to communicate whether this was a miss or null, // boolean, undefined, etc. if (oldFiber === null) { oldFiber = nextOldFiber; } break; } if (shouldTrackSideEffects) { if (oldFiber && newFiber.alternate === null) { // We matched the slot, but we didn't reuse the existing fiber, so we // need to delete the existing child. deleteChild(returnFiber, oldFiber); } } lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx); if (previousNewFiber === null) { // TODO: Move out of the loop. This only happens for the first run. resultingFirstChild = newFiber; } else { // TODO: Defer siblings if we're not at the right index for this slot. // I.e. if we had null values before, then we want to defer this // for each null value. However, we also don't want to call updateSlot // with the previous one. previousNewFiber.sibling = newFiber; } previousNewFiber = newFiber; oldFiber = nextOldFiber; } if (step.done) { // We've reached the end of the new children. We can delete the rest. deleteRemainingChildren(returnFiber, oldFiber); if (getIsHydrating()) { var numberOfForks = newIdx; pushTreeFork(returnFiber, numberOfForks); } return resultingFirstChild; } if (oldFiber === null) { // If we don't have any more existing children we can choose a fast path // since the rest will all be insertions. for (; !step.done; newIdx++, step = newChildren.next()) { var _newFiber3 = createChild(returnFiber, step.value, lanes); if (_newFiber3 === null) { continue; } lastPlacedIndex = placeChild(_newFiber3, lastPlacedIndex, newIdx); if (previousNewFiber === null) { // TODO: Move out of the loop. This only happens for the first run. resultingFirstChild = _newFiber3; } else { previousNewFiber.sibling = _newFiber3; } previousNewFiber = _newFiber3; } if (getIsHydrating()) { var _numberOfForks3 = newIdx; pushTreeFork(returnFiber, _numberOfForks3); } return resultingFirstChild; } // Add all children to a key map for quick lookups. var existingChildren = mapRemainingChildren(returnFiber, oldFiber); // Keep scanning and use the map to restore deleted items as moves. for (; !step.done; newIdx++, step = newChildren.next()) { var _newFiber4 = updateFromMap(existingChildren, returnFiber, newIdx, step.value, lanes); if (_newFiber4 !== null) { if (shouldTrackSideEffects) { if (_newFiber4.alternate !== null) { // The new fiber is a work in progress, but if there exists a // current, that means that we reused the fiber. We need to delete // it from the child list so that we don't add it to the deletion // list. existingChildren.delete(_newFiber4.key === null ? newIdx : _newFiber4.key); } } lastPlacedIndex = placeChild(_newFiber4, lastPlacedIndex, newIdx); if (previousNewFiber === null) { resultingFirstChild = _newFiber4; } else { previousNewFiber.sibling = _newFiber4; } previousNewFiber = _newFiber4; } } if (shouldTrackSideEffects) { // Any existing children that weren't consumed above were deleted. We need // to add them to the deletion list. existingChildren.forEach(function (child) { return deleteChild(returnFiber, child); }); } if (getIsHydrating()) { var _numberOfForks4 = newIdx; pushTreeFork(returnFiber, _numberOfForks4); } return resultingFirstChild; } function reconcileSingleTextNode(returnFiber, currentFirstChild, textContent, lanes) { // There's no need to check for keys on text nodes since we don't have a // way to define them. if (currentFirstChild !== null && currentFirstChild.tag === HostText) { // We already have an existing node so let's just update it and delete // the rest. deleteRemainingChildren(returnFiber, currentFirstChild.sibling); var existing = useFiber(currentFirstChild, textContent); existing.return = returnFiber; return existing; } // The existing first child is not a text node so we need to create one // and delete the existing ones. deleteRemainingChildren(returnFiber, currentFirstChild); var created = createFiberFromText(textContent, returnFiber.mode, lanes); created.return = returnFiber; return created; } function reconcileSingleElement(returnFiber, currentFirstChild, element, lanes) { var key = element.key; var child = currentFirstChild; while (child !== null) { // TODO: If key === null and child.key === null, then this only applies to // the first item in the list. if (child.key === key) { var elementType = element.type; if (elementType === REACT_FRAGMENT_TYPE) { if (child.tag === Fragment) { deleteRemainingChildren(returnFiber, child.sibling); var existing = useFiber(child, element.props.children); existing.return = returnFiber; { existing._debugSource = element._source; existing._debugOwner = element._owner; } return existing; } } else { if (child.elementType === elementType || ( // Keep this check inline so it only runs on the false path: isCompatibleFamilyForHotReloading(child, element) ) || // Lazy types should reconcile their resolved type. // We need to do this after the Hot Reloading check above, // because hot reloading has different semantics than prod because // it doesn't resuspend. So we can't let the call below suspend. typeof elementType === 'object' && elementType !== null && elementType.$$typeof === REACT_LAZY_TYPE && resolveLazy(elementType) === child.type) { deleteRemainingChildren(returnFiber, child.sibling); var _existing = useFiber(child, element.props); _existing.ref = coerceRef(returnFiber, child, element); _existing.return = returnFiber; { _existing._debugSource = element._source; _existing._debugOwner = element._owner; } return _existing; } } // Didn't match. deleteRemainingChildren(returnFiber, child); break; } else { deleteChild(returnFiber, child); } child = child.sibling; } if (element.type === REACT_FRAGMENT_TYPE) { var created = createFiberFromFragment(element.props.children, returnFiber.mode, lanes, element.key); created.return = returnFiber; return created; } else { var _created4 = createFiberFromElement(element, returnFiber.mode, lanes); _created4.ref = coerceRef(returnFiber, currentFirstChild, element); _created4.return = returnFiber; return _created4; } } function reconcileSinglePortal(returnFiber, currentFirstChild, portal, lanes) { var key = portal.key; var child = currentFirstChild; while (child !== null) { // TODO: If key === null and child.key === null, then this only applies to // the first item in the list. if (child.key === key) { if (child.tag === HostPortal && child.stateNode.containerInfo === portal.containerInfo && child.stateNode.implementation === portal.implementation) { deleteRemainingChildren(returnFiber, child.sibling); var existing = useFiber(child, portal.children || []); existing.return = returnFiber; return existing; } else { deleteRemainingChildren(returnFiber, child); break; } } else { deleteChild(returnFiber, child); } child = child.sibling; } var created = createFiberFromPortal(portal, returnFiber.mode, lanes); created.return = returnFiber; return created; } // This API will tag the children with the side-effect of the reconciliation // itself. They will be added to the side-effect list as we pass through the // children and the parent. function reconcileChildFibers(returnFiber, currentFirstChild, newChild, lanes) { // This function is not recursive. // If the top level item is an array, we treat it as a set of children, // not as a fragment. Nested arrays on the other hand will be treated as // fragment nodes. Recursion happens at the normal flow. // Handle top level unkeyed fragments as if they were arrays. // This leads to an ambiguity between <>{[...]}</> and <>...</>. // We treat the ambiguous cases above the same. var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null; if (isUnkeyedTopLevelFragment) { newChild = newChild.props.children; } // Handle object types if (typeof newChild === 'object' && newChild !== null) { switch (newChild.$$typeof) { case REACT_ELEMENT_TYPE: return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, lanes)); case REACT_PORTAL_TYPE: return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, lanes)); case REACT_LAZY_TYPE: var payload = newChild._payload; var init = newChild._init; // TODO: This function is supposed to be non-recursive. return reconcileChildFibers(returnFiber, currentFirstChild, init(payload), lanes); } if (isArray(newChild)) { return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, lanes); } if (getIteratorFn(newChild)) { return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, lanes); } throwOnInvalidObjectType(returnFiber, newChild); } if (typeof newChild === 'string' && newChild !== '' || typeof newChild === 'number') { return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, lanes)); } { if (typeof newChild === 'function') { warnOnFunctionType(returnFiber); } } // Remaining cases are all treated as empty. return deleteRemainingChildren(returnFiber, currentFirstChild); } return reconcileChildFibers; } var reconcileChildFibers = ChildReconciler(true); var mountChildFibers = ChildReconciler(false); function cloneChildFibers(current, workInProgress) { if (current !== null && workInProgress.child !== current.child) { throw new Error('Resuming work not yet implemented.'); } if (workInProgress.child === null) { return; } var currentChild = workInProgress.child; var newChild = createWorkInProgress(currentChild, currentChild.pendingProps); workInProgress.child = newChild; newChild.return = workInProgress; while (currentChild.sibling !== null) { currentChild = currentChild.sibling; newChild = newChild.sibling = createWorkInProgress(currentChild, currentChild.pendingProps); newChild.return = workInProgress; } newChild.sibling = null; } // Reset a workInProgress child set to prepare it for a second pass. function resetChildFibers(workInProgress, lanes) { var child = workInProgress.child; while (child !== null) { resetWorkInProgress(child, lanes); child = child.sibling; } } var valueCursor = createCursor(null); var rendererSigil; { // Use this to detect multiple renderers using the same context rendererSigil = {}; } var currentlyRenderingFiber = null; var lastContextDependency = null; var lastFullyObservedContext = null; var isDisallowedContextReadInDEV = false; function resetContextDependencies() { // This is called right before React yields execution, to ensure `readContext` // cannot be called outside the render phase. currentlyRenderingFiber = null; lastContextDependency = null; lastFullyObservedContext = null; { isDisallowedContextReadInDEV = false; } } function enterDisallowedContextReadInDEV() { { isDisallowedContextReadInDEV = true; } } function exitDisallowedContextReadInDEV() { { isDisallowedContextReadInDEV = false; } } function pushProvider(providerFiber, context, nextValue) { { push(valueCursor, context._currentValue, providerFiber); context._currentValue = nextValue; { if (context._currentRenderer !== undefined && context._currentRenderer !== null && context._currentRenderer !== rendererSigil) { error('Detected multiple renderers concurrently rendering the ' + 'same context provider. This is currently unsupported.'); } context._currentRenderer = rendererSigil; } } } function popProvider(context, providerFiber) { var currentValue = valueCursor.current; pop(valueCursor, providerFiber); { { context._currentValue = currentValue; } } } function scheduleContextWorkOnParentPath(parent, renderLanes, propagationRoot) { // Update the child lanes of all the ancestors, including the alternates. var node = parent; while (node !== null) { var alternate = node.alternate; if (!isSubsetOfLanes(node.childLanes, renderLanes)) { node.childLanes = mergeLanes(node.childLanes, renderLanes); if (alternate !== null) { alternate.childLanes = mergeLanes(alternate.childLanes, renderLanes); } } else if (alternate !== null && !isSubsetOfLanes(alternate.childLanes, renderLanes)) { alternate.childLanes = mergeLanes(alternate.childLanes, renderLanes); } if (node === propagationRoot) { break; } node = node.return; } { if (node !== propagationRoot) { error('Expected to find the propagation root when scheduling context work. ' + 'This error is likely caused by a bug in React. Please file an issue.'); } } } function propagateContextChange(workInProgress, context, renderLanes) { { propagateContextChange_eager(workInProgress, context, renderLanes); } } function propagateContextChange_eager(workInProgress, context, renderLanes) { var fiber = workInProgress.child; if (fiber !== null) { // Set the return pointer of the child to the work-in-progress fiber. fiber.return = workInProgress; } while (fiber !== null) { var nextFiber = void 0; // Visit this fiber. var list = fiber.dependencies; if (list !== null) { nextFiber = fiber.child; var dependency = list.firstContext; while (dependency !== null) { // Check if the context matches. if (dependency.context === context) { // Match! Schedule an update on this fiber. if (fiber.tag === ClassComponent) { // Schedule a force update on the work-in-progress. var lane = pickArbitraryLane(renderLanes); var update = createUpdate(NoTimestamp, lane); update.tag = ForceUpdate; // TODO: Because we don't have a work-in-progress, this will add the // update to the current fiber, too, which means it will persist even if // this render is thrown away. Since it's a race condition, not sure it's // worth fixing. // Inlined `enqueueUpdate` to remove interleaved update check var updateQueue = fiber.updateQueue; if (updateQueue === null) ; else { var sharedQueue = updateQueue.shared; var pending = sharedQueue.pending; if (pending === null) { // This is the first update. Create a circular list. update.next = update; } else { update.next = pending.next; pending.next = update; } sharedQueue.pending = update; } } fiber.lanes = mergeLanes(fiber.lanes, renderLanes); var alternate = fiber.alternate; if (alternate !== null) { alternate.lanes = mergeLanes(alternate.lanes, renderLanes); } scheduleContextWorkOnParentPath(fiber.return, renderLanes, workInProgress); // Mark the updated lanes on the list, too. list.lanes = mergeLanes(list.lanes, renderLanes); // Since we already found a match, we can stop traversing the // dependency list. break; } dependency = dependency.next; } } else if (fiber.tag === ContextProvider) { // Don't scan deeper if this is a matching provider nextFiber = fiber.type === workInProgress.type ? null : fiber.child; } else if (fiber.tag === DehydratedFragment) { // If a dehydrated suspense boundary is in this subtree, we don't know // if it will have any context consumers in it. The best we can do is // mark it as having updates. var parentSuspense = fiber.return; if (parentSuspense === null) { throw new Error('We just came from a parent so we must have had a parent. This is a bug in React.'); } parentSuspense.lanes = mergeLanes(parentSuspense.lanes, renderLanes); var _alternate = parentSuspense.alternate; if (_alternate !== null) { _alternate.lanes = mergeLanes(_alternate.lanes, renderLanes); } // This is intentionally passing this fiber as the parent // because we want to schedule this fiber as having work // on its children. We'll use the childLanes on // this fiber to indicate that a context has changed. scheduleContextWorkOnParentPath(parentSuspense, renderLanes, workInProgress); nextFiber = fiber.sibling; } else { // Traverse down. nextFiber = fiber.child; } if (nextFiber !== null) { // Set the return pointer of the child to the work-in-progress fiber. nextFiber.return = fiber; } else { // No child. Traverse to next sibling. nextFiber = fiber; while (nextFiber !== null) { if (nextFiber === workInProgress) { // We're back to the root of this subtree. Exit. nextFiber = null; break; } var sibling = nextFiber.sibling; if (sibling !== null) { // Set the return pointer of the sibling to the work-in-progress fiber. sibling.return = nextFiber.return; nextFiber = sibling; break; } // No more siblings. Traverse up. nextFiber = nextFiber.return; } } fiber = nextFiber; } } function prepareToReadContext(workInProgress, renderLanes) { currentlyRenderingFiber = workInProgress; lastContextDependency = null; lastFullyObservedContext = null; var dependencies = workInProgress.dependencies; if (dependencies !== null) { { var firstContext = dependencies.firstContext; if (firstContext !== null) { if (includesSomeLane(dependencies.lanes, renderLanes)) { // Context list has a pending update. Mark that this fiber performed work. markWorkInProgressReceivedUpdate(); } // Reset the work-in-progress list dependencies.firstContext = null; } } } } function readContext(context) { { // This warning would fire if you read context inside a Hook like useMemo. // Unlike the class check below, it's not enforced in production for perf. if (isDisallowedContextReadInDEV) { error('Context can only be read while React is rendering. ' + 'In classes, you can read it in the render method or getDerivedStateFromProps. ' + 'In function components, you can read it directly in the function body, but not ' + 'inside Hooks like useReducer() or useMemo().'); } } var value = context._currentValue ; if (lastFullyObservedContext === context) ; else { var contextItem = { context: context, memoizedValue: value, next: null }; if (lastContextDependency === null) { if (currentlyRenderingFiber === null) { throw new Error('Context can only be read while React is rendering. ' + 'In classes, you can read it in the render method or getDerivedStateFromProps. ' + 'In function components, you can read it directly in the function body, but not ' + 'inside Hooks like useReducer() or useMemo().'); } // This is the first dependency for this component. Create a new list. lastContextDependency = contextItem; currentlyRenderingFiber.dependencies = { lanes: NoLanes, firstContext: contextItem }; } else { // Append a new context item. lastContextDependency = lastContextDependency.next = contextItem; } } return value; } // render. When this render exits, either because it finishes or because it is // interrupted, the interleaved updates will be transferred onto the main part // of the queue. var concurrentQueues = null; function pushConcurrentUpdateQueue(queue) { if (concurrentQueues === null) { concurrentQueues = [queue]; } else { concurrentQueues.push(queue); } } function finishQueueingConcurrentUpdates() { // Transfer the interleaved updates onto the main queue. Each queue has a // `pending` field and an `interleaved` field. When they are not null, they // point to the last node in a circular linked list. We need to append the // interleaved list to the end of the pending list by joining them into a // single, circular list. if (concurrentQueues !== null) { for (var i = 0; i < concurrentQueues.length; i++) { var queue = concurrentQueues[i]; var lastInterleavedUpdate = queue.interleaved; if (lastInterleavedUpdate !== null) { queue.interleaved = null; var firstInterleavedUpdate = lastInterleavedUpdate.next; var lastPendingUpdate = queue.pending; if (lastPendingUpdate !== null) { var firstPendingUpdate = lastPendingUpdate.next; lastPendingUpdate.next = firstInterleavedUpdate; lastInterleavedUpdate.next = firstPendingUpdate; } queue.pending = lastInterleavedUpdate; } } concurrentQueues = null; } } function enqueueConcurrentHookUpdate(fiber, queue, update, lane) { var interleaved = queue.interleaved; if (interleaved === null) { // This is the first update. Create a circular list. update.next = update; // At the end of the current render, this queue's interleaved updates will // be transferred to the pending queue. pushConcurrentUpdateQueue(queue); } else { update.next = interleaved.next; interleaved.next = update; } queue.interleaved = update; return markUpdateLaneFromFiberToRoot(fiber, lane); } function enqueueConcurrentHookUpdateAndEagerlyBailout(fiber, queue, update, lane) { var interleaved = queue.interleaved; if (interleaved === null) { // This is the first update. Create a circular list. update.next = update; // At the end of the current render, this queue's interleaved updates will // be transferred to the pending queue. pushConcurrentUpdateQueue(queue); } else { update.next = interleaved.next; interleaved.next = update; } queue.interleaved = update; } function enqueueConcurrentClassUpdate(fiber, queue, update, lane) { var interleaved = queue.interleaved; if (interleaved === null) { // This is the first update. Create a circular list. update.next = update; // At the end of the current render, this queue's interleaved updates will // be transferred to the pending queue. pushConcurrentUpdateQueue(queue); } else { update.next = interleaved.next; interleaved.next = update; } queue.interleaved = update; return markUpdateLaneFromFiberToRoot(fiber, lane); } function enqueueConcurrentRenderForLane(fiber, lane) { return markUpdateLaneFromFiberToRoot(fiber, lane); } // Calling this function outside this module should only be done for backwards // compatibility and should always be accompanied by a warning. var unsafe_markUpdateLaneFromFiberToRoot = markUpdateLaneFromFiberToRoot; function markUpdateLaneFromFiberToRoot(sourceFiber, lane) { // Update the source fiber's lanes sourceFiber.lanes = mergeLanes(sourceFiber.lanes, lane); var alternate = sourceFiber.alternate; if (alternate !== null) { alternate.lanes = mergeLanes(alternate.lanes, lane); } { if (alternate === null && (sourceFiber.flags & (Placement | Hydrating)) !== NoFlags) { warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber); } } // Walk the parent path to the root and update the child lanes. var node = sourceFiber; var parent = sourceFiber.return; while (parent !== null) { parent.childLanes = mergeLanes(parent.childLanes, lane); alternate = parent.alternate; if (alternate !== null) { alternate.childLanes = mergeLanes(alternate.childLanes, lane); } else { { if ((parent.flags & (Placement | Hydrating)) !== NoFlags) { warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber); } } } node = parent; parent = parent.return; } if (node.tag === HostRoot) { var root = node.stateNode; return root; } else { return null; } } var UpdateState = 0; var ReplaceState = 1; var ForceUpdate = 2; var CaptureUpdate = 3; // Global state that is reset at the beginning of calling `processUpdateQueue`. // It should only be read right after calling `processUpdateQueue`, via // `checkHasForceUpdateAfterProcessing`. var hasForceUpdate = false; var didWarnUpdateInsideUpdate; var currentlyProcessingQueue; { didWarnUpdateInsideUpdate = false; currentlyProcessingQueue = null; } function initializeUpdateQueue(fiber) { var queue = { baseState: fiber.memoizedState, firstBaseUpdate: null, lastBaseUpdate: null, shared: { pending: null, interleaved: null, lanes: NoLanes }, effects: null }; fiber.updateQueue = queue; } function cloneUpdateQueue(current, workInProgress) { // Clone the update queue from current. Unless it's already a clone. var queue = workInProgress.updateQueue; var currentQueue = current.updateQueue; if (queue === currentQueue) { var clone = { baseState: currentQueue.baseState, firstBaseUpdate: currentQueue.firstBaseUpdate, lastBaseUpdate: currentQueue.lastBaseUpdate, shared: currentQueue.shared, effects: currentQueue.effects }; workInProgress.updateQueue = clone; } } function createUpdate(eventTime, lane) { var update = { eventTime: eventTime, lane: lane, tag: UpdateState, payload: null, callback: null, next: null }; return update; } function enqueueUpdate(fiber, update, lane) { var updateQueue = fiber.updateQueue; if (updateQueue === null) { // Only occurs if the fiber has been unmounted. return null; } var sharedQueue = updateQueue.shared; { if (currentlyProcessingQueue === sharedQueue && !didWarnUpdateInsideUpdate) { error('An update (setState, replaceState, or forceUpdate) was scheduled ' + 'from inside an update function. Update functions should be pure, ' + 'with zero side-effects. Consider using componentDidUpdate or a ' + 'callback.'); didWarnUpdateInsideUpdate = true; } } if (isUnsafeClassRenderPhaseUpdate()) { // This is an unsafe render phase update. Add directly to the update // queue so we can process it immediately during the current render. var pending = sharedQueue.pending; if (pending === null) { // This is the first update. Create a circular list. update.next = update; } else { update.next = pending.next; pending.next = update; } sharedQueue.pending = update; // Update the childLanes even though we're most likely already rendering // this fiber. This is for backwards compatibility in the case where you // update a different component during render phase than the one that is // currently renderings (a pattern that is accompanied by a warning). return unsafe_markUpdateLaneFromFiberToRoot(fiber, lane); } else { return enqueueConcurrentClassUpdate(fiber, sharedQueue, update, lane); } } function entangleTransitions(root, fiber, lane) { var updateQueue = fiber.updateQueue; if (updateQueue === null) { // Only occurs if the fiber has been unmounted. return; } var sharedQueue = updateQueue.shared; if (isTransitionLane(lane)) { var queueLanes = sharedQueue.lanes; // If any entangled lanes are no longer pending on the root, then they must // have finished. We can remove them from the shared queue, which represents // a superset of the actually pending lanes. In some cases we may entangle // more than we need to, but that's OK. In fact it's worse if we *don't* // entangle when we should. queueLanes = intersectLanes(queueLanes, root.pendingLanes); // Entangle the new transition lane with the other transition lanes. var newQueueLanes = mergeLanes(queueLanes, lane); sharedQueue.lanes = newQueueLanes; // Even if queue.lanes already include lane, we don't know for certain if // the lane finished since the last time we entangled it. So we need to // entangle it again, just to be sure. markRootEntangled(root, newQueueLanes); } } function enqueueCapturedUpdate(workInProgress, capturedUpdate) { // Captured updates are updates that are thrown by a child during the render // phase. They should be discarded if the render is aborted. Therefore, // we should only put them on the work-in-progress queue, not the current one. var queue = workInProgress.updateQueue; // Check if the work-in-progress queue is a clone. var current = workInProgress.alternate; if (current !== null) { var currentQueue = current.updateQueue; if (queue === currentQueue) { // The work-in-progress queue is the same as current. This happens when // we bail out on a parent fiber that then captures an error thrown by // a child. Since we want to append the update only to the work-in // -progress queue, we need to clone the updates. We usually clone during // processUpdateQueue, but that didn't happen in this case because we // skipped over the parent when we bailed out. var newFirst = null; var newLast = null; var firstBaseUpdate = queue.firstBaseUpdate; if (firstBaseUpdate !== null) { // Loop through the updates and clone them. var update = firstBaseUpdate; do { var clone = { eventTime: update.eventTime, lane: update.lane, tag: update.tag, payload: update.payload, callback: update.callback, next: null }; if (newLast === null) { newFirst = newLast = clone; } else { newLast.next = clone; newLast = clone; } update = update.next; } while (update !== null); // Append the captured update the end of the cloned list. if (newLast === null) { newFirst = newLast = capturedUpdate; } else { newLast.next = capturedUpdate; newLast = capturedUpdate; } } else { // There are no base updates. newFirst = newLast = capturedUpdate; } queue = { baseState: currentQueue.baseState, firstBaseUpdate: newFirst, lastBaseUpdate: newLast, shared: currentQueue.shared, effects: currentQueue.effects }; workInProgress.updateQueue = queue; return; } } // Append the update to the end of the list. var lastBaseUpdate = queue.lastBaseUpdate; if (lastBaseUpdate === null) { queue.firstBaseUpdate = capturedUpdate; } else { lastBaseUpdate.next = capturedUpdate; } queue.lastBaseUpdate = capturedUpdate; } function getStateFromUpdate(workInProgress, queue, update, prevState, nextProps, instance) { switch (update.tag) { case ReplaceState: { var payload = update.payload; if (typeof payload === 'function') { // Updater function { enterDisallowedContextReadInDEV(); } var nextState = payload.call(instance, prevState, nextProps); { if ( workInProgress.mode & StrictLegacyMode) { setIsStrictModeForDevtools(true); try { payload.call(instance, prevState, nextProps); } finally { setIsStrictModeForDevtools(false); } } exitDisallowedContextReadInDEV(); } return nextState; } // State object return payload; } case CaptureUpdate: { workInProgress.flags = workInProgress.flags & ~ShouldCapture | DidCapture; } // Intentional fallthrough case UpdateState: { var _payload = update.payload; var partialState; if (typeof _payload === 'function') { // Updater function { enterDisallowedContextReadInDEV(); } partialState = _payload.call(instance, prevState, nextProps); { if ( workInProgress.mode & StrictLegacyMode) { setIsStrictModeForDevtools(true); try { _payload.call(instance, prevState, nextProps); } finally { setIsStrictModeForDevtools(false); } } exitDisallowedContextReadInDEV(); } } else { // Partial state object partialState = _payload; } if (partialState === null || partialState === undefined) { // Null and undefined are treated as no-ops. return prevState; } // Merge the partial state and the previous state. return assign({}, prevState, partialState); } case ForceUpdate: { hasForceUpdate = true; return prevState; } } return prevState; } function processUpdateQueue(workInProgress, props, instance, renderLanes) { // This is always non-null on a ClassComponent or HostRoot var queue = workInProgress.updateQueue; hasForceUpdate = false; { currentlyProcessingQueue = queue.shared; } var firstBaseUpdate = queue.firstBaseUpdate; var lastBaseUpdate = queue.lastBaseUpdate; // Check if there are pending updates. If so, transfer them to the base queue. var pendingQueue = queue.shared.pending; if (pendingQueue !== null) { queue.shared.pending = null; // The pending queue is circular. Disconnect the pointer between first // and last so that it's non-circular. var lastPendingUpdate = pendingQueue; var firstPendingUpdate = lastPendingUpdate.next; lastPendingUpdate.next = null; // Append pending updates to base queue if (lastBaseUpdate === null) { firstBaseUpdate = firstPendingUpdate; } else { lastBaseUpdate.next = firstPendingUpdate; } lastBaseUpdate = lastPendingUpdate; // If there's a current queue, and it's different from the base queue, then // we need to transfer the updates to that queue, too. Because the base // queue is a singly-linked list with no cycles, we can append to both // lists and take advantage of structural sharing. // TODO: Pass `current` as argument var current = workInProgress.alternate; if (current !== null) { // This is always non-null on a ClassComponent or HostRoot var currentQueue = current.updateQueue; var currentLastBaseUpdate = currentQueue.lastBaseUpdate; if (currentLastBaseUpdate !== lastBaseUpdate) { if (currentLastBaseUpdate === null) { currentQueue.firstBaseUpdate = firstPendingUpdate; } else { currentLastBaseUpdate.next = firstPendingUpdate; } currentQueue.lastBaseUpdate = lastPendingUpdate; } } } // These values may change as we process the queue. if (firstBaseUpdate !== null) { // Iterate through the list of updates to compute the result. var newState = queue.baseState; // TODO: Don't need to accumulate this. Instead, we can remove renderLanes // from the original lanes. var newLanes = NoLanes; var newBaseState = null; var newFirstBaseUpdate = null; var newLastBaseUpdate = null; var update = firstBaseUpdate; do { var updateLane = update.lane; var updateEventTime = update.eventTime; if (!isSubsetOfLanes(renderLanes, updateLane)) { // Priority is insufficient. Skip this update. If this is the first // skipped update, the previous update/state is the new base // update/state. var clone = { eventTime: updateEventTime, lane: updateLane, tag: update.tag, payload: update.payload, callback: update.callback, next: null }; if (newLastBaseUpdate === null) { newFirstBaseUpdate = newLastBaseUpdate = clone; newBaseState = newState; } else { newLastBaseUpdate = newLastBaseUpdate.next = clone; } // Update the remaining priority in the queue. newLanes = mergeLanes(newLanes, updateLane); } else { // This update does have sufficient priority. if (newLastBaseUpdate !== null) { var _clone = { eventTime: updateEventTime, // This update is going to be committed so we never want uncommit // it. Using NoLane works because 0 is a subset of all bitmasks, so // this will never be skipped by the check above. lane: NoLane, tag: update.tag, payload: update.payload, callback: update.callback, next: null }; newLastBaseUpdate = newLastBaseUpdate.next = _clone; } // Process this update. newState = getStateFromUpdate(workInProgress, queue, update, newState, props, instance); var callback = update.callback; if (callback !== null && // If the update was already committed, we should not queue its // callback again. update.lane !== NoLane) { workInProgress.flags |= Callback; var effects = queue.effects; if (effects === null) { queue.effects = [update]; } else { effects.push(update); } } } update = update.next; if (update === null) { pendingQueue = queue.shared.pending; if (pendingQueue === null) { break; } else { // An update was scheduled from inside a reducer. Add the new // pending updates to the end of the list and keep processing. var _lastPendingUpdate = pendingQueue; // Intentionally unsound. Pending updates form a circular list, but we // unravel them when transferring them to the base queue. var _firstPendingUpdate = _lastPendingUpdate.next; _lastPendingUpdate.next = null; update = _firstPendingUpdate; queue.lastBaseUpdate = _lastPendingUpdate; queue.shared.pending = null; } } } while (true); if (newLastBaseUpdate === null) { newBaseState = newState; } queue.baseState = newBaseState; queue.firstBaseUpdate = newFirstBaseUpdate; queue.lastBaseUpdate = newLastBaseUpdate; // Interleaved updates are stored on a separate queue. We aren't going to // process them during this render, but we do need to track which lanes // are remaining. var lastInterleaved = queue.shared.interleaved; if (lastInterleaved !== null) { var interleaved = lastInterleaved; do { newLanes = mergeLanes(newLanes, interleaved.lane); interleaved = interleaved.next; } while (interleaved !== lastInterleaved); } else if (firstBaseUpdate === null) { // `queue.lanes` is used for entangling transitions. We can set it back to // zero once the queue is empty. queue.shared.lanes = NoLanes; } // Set the remaining expiration time to be whatever is remaining in the queue. // This should be fine because the only two other things that contribute to // expiration time are props and context. We're already in the middle of the // begin phase by the time we start processing the queue, so we've already // dealt with the props. Context in components that specify // shouldComponentUpdate is tricky; but we'll have to account for // that regardless. markSkippedUpdateLanes(newLanes); workInProgress.lanes = newLanes; workInProgress.memoizedState = newState; } { currentlyProcessingQueue = null; } } function callCallback(callback, context) { if (typeof callback !== 'function') { throw new Error('Invalid argument passed as callback. Expected a function. Instead ' + ("received: " + callback)); } callback.call(context); } function resetHasForceUpdateBeforeProcessing() { hasForceUpdate = false; } function checkHasForceUpdateAfterProcessing() { return hasForceUpdate; } function commitUpdateQueue(finishedWork, finishedQueue, instance) { // Commit the effects var effects = finishedQueue.effects; finishedQueue.effects = null; if (effects !== null) { for (var i = 0; i < effects.length; i++) { var effect = effects[i]; var callback = effect.callback; if (callback !== null) { effect.callback = null; callCallback(callback, instance); } } } } var NO_CONTEXT = {}; var contextStackCursor$1 = createCursor(NO_CONTEXT); var contextFiberStackCursor = createCursor(NO_CONTEXT); var rootInstanceStackCursor = createCursor(NO_CONTEXT); function requiredContext(c) { if (c === NO_CONTEXT) { throw new Error('Expected host context to exist. This error is likely caused by a bug ' + 'in React. Please file an issue.'); } return c; } function getRootHostContainer() { var rootInstance = requiredContext(rootInstanceStackCursor.current); return rootInstance; } function pushHostContainer(fiber, nextRootInstance) { // Push current root instance onto the stack; // This allows us to reset root when portals are popped. push(rootInstanceStackCursor, nextRootInstance, fiber); // Track the context and the Fiber that provided it. // This enables us to pop only Fibers that provide unique contexts. push(contextFiberStackCursor, fiber, fiber); // Finally, we need to push the host context to the stack. // However, we can't just call getRootHostContext() and push it because // we'd have a different number of entries on the stack depending on // whether getRootHostContext() throws somewhere in renderer code or not. // So we push an empty value first. This lets us safely unwind on errors. push(contextStackCursor$1, NO_CONTEXT, fiber); var nextRootContext = getRootHostContext(nextRootInstance); // Now that we know this function doesn't throw, replace it. pop(contextStackCursor$1, fiber); push(contextStackCursor$1, nextRootContext, fiber); } function popHostContainer(fiber) { pop(contextStackCursor$1, fiber); pop(contextFiberStackCursor, fiber); pop(rootInstanceStackCursor, fiber); } function getHostContext() { var context = requiredContext(contextStackCursor$1.current); return context; } function pushHostContext(fiber) { var rootInstance = requiredContext(rootInstanceStackCursor.current); var context = requiredContext(contextStackCursor$1.current); var nextContext = getChildHostContext(context, fiber.type); // Don't push this Fiber's context unless it's unique. if (context === nextContext) { return; } // Track the context and the Fiber that provided it. // This enables us to pop only Fibers that provide unique contexts. push(contextFiberStackCursor, fiber, fiber); push(contextStackCursor$1, nextContext, fiber); } function popHostContext(fiber) { // Do not pop unless this Fiber provided the current context. // pushHostContext() only pushes Fibers that provide unique contexts. if (contextFiberStackCursor.current !== fiber) { return; } pop(contextStackCursor$1, fiber); pop(contextFiberStackCursor, fiber); } var DefaultSuspenseContext = 0; // The Suspense Context is split into two parts. The lower bits is // inherited deeply down the subtree. The upper bits only affect // this immediate suspense boundary and gets reset each new // boundary or suspense list. var SubtreeSuspenseContextMask = 1; // Subtree Flags: // InvisibleParentSuspenseContext indicates that one of our parent Suspense // boundaries is not currently showing visible main content. // Either because it is already showing a fallback or is not mounted at all. // We can use this to determine if it is desirable to trigger a fallback at // the parent. If not, then we might need to trigger undesirable boundaries // and/or suspend the commit to avoid hiding the parent content. var InvisibleParentSuspenseContext = 1; // Shallow Flags: // ForceSuspenseFallback can be used by SuspenseList to force newly added // items into their fallback state during one of the render passes. var ForceSuspenseFallback = 2; var suspenseStackCursor = createCursor(DefaultSuspenseContext); function hasSuspenseContext(parentContext, flag) { return (parentContext & flag) !== 0; } function setDefaultShallowSuspenseContext(parentContext) { return parentContext & SubtreeSuspenseContextMask; } function setShallowSuspenseContext(parentContext, shallowContext) { return parentContext & SubtreeSuspenseContextMask | shallowContext; } function addSubtreeSuspenseContext(parentContext, subtreeContext) { return parentContext | subtreeContext; } function pushSuspenseContext(fiber, newContext) { push(suspenseStackCursor, newContext, fiber); } function popSuspenseContext(fiber) { pop(suspenseStackCursor, fiber); } function shouldCaptureSuspense(workInProgress, hasInvisibleParent) { // If it was the primary children that just suspended, capture and render the // fallback. Otherwise, don't capture and bubble to the next boundary. var nextState = workInProgress.memoizedState; if (nextState !== null) { if (nextState.dehydrated !== null) { // A dehydrated boundary always captures. return true; } return false; } var props = workInProgress.memoizedProps; // Regular boundaries always capture. { return true; } // If it's a boundary we should avoid, then we prefer to bubble up to the } function findFirstSuspended(row) { var node = row; while (node !== null) { if (node.tag === SuspenseComponent) { var state = node.memoizedState; if (state !== null) { var dehydrated = state.dehydrated; if (dehydrated === null || isSuspenseInstancePending(dehydrated) || isSuspenseInstanceFallback(dehydrated)) { return node; } } } else if (node.tag === SuspenseListComponent && // revealOrder undefined can't be trusted because it don't // keep track of whether it suspended or not. node.memoizedProps.revealOrder !== undefined) { var didSuspend = (node.flags & DidCapture) !== NoFlags; if (didSuspend) { return node; } } else if (node.child !== null) { node.child.return = node; node = node.child; continue; } if (node === row) { return null; } while (node.sibling === null) { if (node.return === null || node.return === row) { return null; } node = node.return; } node.sibling.return = node.return; node = node.sibling; } return null; } var NoFlags$1 = /* */ 0; // Represents whether effect should fire. var HasEffect = /* */ 1; // Represents the phase in which the effect (not the clean-up) fires. var Insertion = /* */ 2; var Layout = /* */ 4; var Passive$1 = /* */ 8; // and should be reset before starting a new render. // This tracks which mutable sources need to be reset after a render. var workInProgressSources = []; function resetWorkInProgressVersions() { for (var i = 0; i < workInProgressSources.length; i++) { var mutableSource = workInProgressSources[i]; { mutableSource._workInProgressVersionPrimary = null; } } workInProgressSources.length = 0; } // This ensures that the version used for server rendering matches the one // that is eventually read during hydration. // If they don't match there's a potential tear and a full deopt render is required. function registerMutableSourceForHydration(root, mutableSource) { var getVersion = mutableSource._getVersion; var version = getVersion(mutableSource._source); // TODO Clear this data once all pending hydration work is finished. // Retaining it forever may interfere with GC. if (root.mutableSourceEagerHydrationData == null) { root.mutableSourceEagerHydrationData = [mutableSource, version]; } else { root.mutableSourceEagerHydrationData.push(mutableSource, version); } } var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher, ReactCurrentBatchConfig$2 = ReactSharedInternals.ReactCurrentBatchConfig; var didWarnAboutMismatchedHooksForComponent; var didWarnUncachedGetSnapshot; { didWarnAboutMismatchedHooksForComponent = new Set(); } // These are set right before calling the component. var renderLanes = NoLanes; // The work-in-progress fiber. I've named it differently to distinguish it from // the work-in-progress hook. var currentlyRenderingFiber$1 = null; // Hooks are stored as a linked list on the fiber's memoizedState field. The // current hook list is the list that belongs to the current fiber. The // work-in-progress hook list is a new list that will be added to the // work-in-progress fiber. var currentHook = null; var workInProgressHook = null; // Whether an update was scheduled at any point during the render phase. This // does not get reset if we do another render pass; only when we're completely // finished evaluating this component. This is an optimization so we know // whether we need to clear render phase updates after a throw. var didScheduleRenderPhaseUpdate = false; // Where an update was scheduled only during the current render pass. This // gets reset after each attempt. // TODO: Maybe there's some way to consolidate this with // `didScheduleRenderPhaseUpdate`. Or with `numberOfReRenders`. var didScheduleRenderPhaseUpdateDuringThisPass = false; // Counts the number of useId hooks in this component. var localIdCounter = 0; // Used for ids that are generated completely client-side (i.e. not during // hydration). This counter is global, so client ids are not stable across // render attempts. var globalClientIdCounter = 0; var RE_RENDER_LIMIT = 25; // In DEV, this is the name of the currently executing primitive hook var currentHookNameInDev = null; // In DEV, this list ensures that hooks are called in the same order between renders. // The list stores the order of hooks used during the initial render (mount). // Subsequent renders (updates) reference this list. var hookTypesDev = null; var hookTypesUpdateIndexDev = -1; // In DEV, this tracks whether currently rendering component needs to ignore // the dependencies for Hooks that need them (e.g. useEffect or useMemo). // When true, such Hooks will always be "remounted". Only used during hot reload. var ignorePreviousDependencies = false; function mountHookTypesDev() { { var hookName = currentHookNameInDev; if (hookTypesDev === null) { hookTypesDev = [hookName]; } else { hookTypesDev.push(hookName); } } } function updateHookTypesDev() { { var hookName = currentHookNameInDev; if (hookTypesDev !== null) { hookTypesUpdateIndexDev++; if (hookTypesDev[hookTypesUpdateIndexDev] !== hookName) { warnOnHookMismatchInDev(hookName); } } } } function checkDepsAreArrayDev(deps) { { if (deps !== undefined && deps !== null && !isArray(deps)) { // Verify deps, but only on mount to avoid extra checks. // It's unlikely their type would change as usually you define them inline. error('%s received a final argument that is not an array (instead, received `%s`). When ' + 'specified, the final argument must be an array.', currentHookNameInDev, typeof deps); } } } function warnOnHookMismatchInDev(currentHookName) { { var componentName = getComponentNameFromFiber(currentlyRenderingFiber$1); if (!didWarnAboutMismatchedHooksForComponent.has(componentName)) { didWarnAboutMismatchedHooksForComponent.add(componentName); if (hookTypesDev !== null) { var table = ''; var secondColumnStart = 30; for (var i = 0; i <= hookTypesUpdateIndexDev; i++) { var oldHookName = hookTypesDev[i]; var newHookName = i === hookTypesUpdateIndexDev ? currentHookName : oldHookName; var row = i + 1 + ". " + oldHookName; // Extra space so second column lines up // lol @ IE not supporting String#repeat while (row.length < secondColumnStart) { row += ' '; } row += newHookName + '\n'; table += row; } error('React has detected a change in the order of Hooks called by %s. ' + 'This will lead to bugs and errors if not fixed. ' + 'For more information, read the Rules of Hooks: https://reactjs.org/link/rules-of-hooks\n\n' + ' Previous render Next render\n' + ' ------------------------------------------------------\n' + '%s' + ' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n', componentName, table); } } } } function throwInvalidHookError() { throw new Error('Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for' + ' one of the following reasons:\n' + '1. You might have mismatching versions of React and the renderer (such as React DOM)\n' + '2. You might be breaking the Rules of Hooks\n' + '3. You might have more than one copy of React in the same app\n' + 'See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.'); } function areHookInputsEqual(nextDeps, prevDeps) { { if (ignorePreviousDependencies) { // Only true when this component is being hot reloaded. return false; } } if (prevDeps === null) { { error('%s received a final argument during this render, but not during ' + 'the previous render. Even though the final argument is optional, ' + 'its type cannot change between renders.', currentHookNameInDev); } return false; } { // Don't bother comparing lengths in prod because these arrays should be // passed inline. if (nextDeps.length !== prevDeps.length) { error('The final argument passed to %s changed size between renders. The ' + 'order and size of this array must remain constant.\n\n' + 'Previous: %s\n' + 'Incoming: %s', currentHookNameInDev, "[" + prevDeps.join(', ') + "]", "[" + nextDeps.join(', ') + "]"); } } for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) { if (objectIs(nextDeps[i], prevDeps[i])) { continue; } return false; } return true; } function renderWithHooks(current, workInProgress, Component, props, secondArg, nextRenderLanes) { renderLanes = nextRenderLanes; currentlyRenderingFiber$1 = workInProgress; { hookTypesDev = current !== null ? current._debugHookTypes : null; hookTypesUpdateIndexDev = -1; // Used for hot reloading: ignorePreviousDependencies = current !== null && current.type !== workInProgress.type; } workInProgress.memoizedState = null; workInProgress.updateQueue = null; workInProgress.lanes = NoLanes; // The following should have already been reset // currentHook = null; // workInProgressHook = null; // didScheduleRenderPhaseUpdate = false; // localIdCounter = 0; // TODO Warn if no hooks are used at all during mount, then some are used during update. // Currently we will identify the update render as a mount because memoizedState === null. // This is tricky because it's valid for certain types of components (e.g. React.lazy) // Using memoizedState to differentiate between mount/update only works if at least one stateful hook is used. // Non-stateful hooks (e.g. context) don't get added to memoizedState, // so memoizedState would be null during updates and mounts. { if (current !== null && current.memoizedState !== null) { ReactCurrentDispatcher$1.current = HooksDispatcherOnUpdateInDEV; } else if (hookTypesDev !== null) { // This dispatcher handles an edge case where a component is updating, // but no stateful hooks have been used. // We want to match the production code behavior (which will use HooksDispatcherOnMount), // but with the extra DEV validation to ensure hooks ordering hasn't changed. // This dispatcher does that. ReactCurrentDispatcher$1.current = HooksDispatcherOnMountWithHookTypesInDEV; } else { ReactCurrentDispatcher$1.current = HooksDispatcherOnMountInDEV; } } var children = Component(props, secondArg); // Check if there was a render phase update if (didScheduleRenderPhaseUpdateDuringThisPass) { // Keep rendering in a loop for as long as render phase updates continue to // be scheduled. Use a counter to prevent infinite loops. var numberOfReRenders = 0; do { didScheduleRenderPhaseUpdateDuringThisPass = false; localIdCounter = 0; if (numberOfReRenders >= RE_RENDER_LIMIT) { throw new Error('Too many re-renders. React limits the number of renders to prevent ' + 'an infinite loop.'); } numberOfReRenders += 1; { // Even when hot reloading, allow dependencies to stabilize // after first render to prevent infinite render phase updates. ignorePreviousDependencies = false; } // Start over from the beginning of the list currentHook = null; workInProgressHook = null; workInProgress.updateQueue = null; { // Also validate hook order for cascading updates. hookTypesUpdateIndexDev = -1; } ReactCurrentDispatcher$1.current = HooksDispatcherOnRerenderInDEV ; children = Component(props, secondArg); } while (didScheduleRenderPhaseUpdateDuringThisPass); } // We can assume the previous dispatcher is always this one, since we set it // at the beginning of the render phase and there's no re-entrance. ReactCurrentDispatcher$1.current = ContextOnlyDispatcher; { workInProgress._debugHookTypes = hookTypesDev; } // This check uses currentHook so that it works the same in DEV and prod bundles. // hookTypesDev could catch more cases (e.g. context) but only in DEV bundles. var didRenderTooFewHooks = currentHook !== null && currentHook.next !== null; renderLanes = NoLanes; currentlyRenderingFiber$1 = null; currentHook = null; workInProgressHook = null; { currentHookNameInDev = null; hookTypesDev = null; hookTypesUpdateIndexDev = -1; // Confirm that a static flag was not added or removed since the last // render. If this fires, it suggests that we incorrectly reset the static // flags in some other part of the codebase. This has happened before, for // example, in the SuspenseList implementation. if (current !== null && (current.flags & StaticMask) !== (workInProgress.flags & StaticMask) && // Disable this warning in legacy mode, because legacy Suspense is weird // and creates false positives. To make this work in legacy mode, we'd // need to mark fibers that commit in an incomplete state, somehow. For // now I'll disable the warning that most of the bugs that would trigger // it are either exclusive to concurrent mode or exist in both. (current.mode & ConcurrentMode) !== NoMode) { error('Internal React error: Expected static flag was missing. Please ' + 'notify the React team.'); } } didScheduleRenderPhaseUpdate = false; // This is reset by checkDidRenderIdHook // localIdCounter = 0; if (didRenderTooFewHooks) { throw new Error('Rendered fewer hooks than expected. This may be caused by an accidental ' + 'early return statement.'); } return children; } function checkDidRenderIdHook() { // This should be called immediately after every renderWithHooks call. // Conceptually, it's part of the return value of renderWithHooks; it's only a // separate function to avoid using an array tuple. var didRenderIdHook = localIdCounter !== 0; localIdCounter = 0; return didRenderIdHook; } function bailoutHooks(current, workInProgress, lanes) { workInProgress.updateQueue = current.updateQueue; // TODO: Don't need to reset the flags here, because they're reset in the // complete phase (bubbleProperties). if ( (workInProgress.mode & StrictEffectsMode) !== NoMode) { workInProgress.flags &= ~(MountPassiveDev | MountLayoutDev | Passive | Update); } else { workInProgress.flags &= ~(Passive | Update); } current.lanes = removeLanes(current.lanes, lanes); } function resetHooksAfterThrow() { // We can assume the previous dispatcher is always this one, since we set it // at the beginning of the render phase and there's no re-entrance. ReactCurrentDispatcher$1.current = ContextOnlyDispatcher; if (didScheduleRenderPhaseUpdate) { // There were render phase updates. These are only valid for this render // phase, which we are now aborting. Remove the updates from the queues so // they do not persist to the next render. Do not remove updates from hooks // that weren't processed. // // Only reset the updates from the queue if it has a clone. If it does // not have a clone, that means it wasn't processed, and the updates were // scheduled before we entered the render phase. var hook = currentlyRenderingFiber$1.memoizedState; while (hook !== null) { var queue = hook.queue; if (queue !== null) { queue.pending = null; } hook = hook.next; } didScheduleRenderPhaseUpdate = false; } renderLanes = NoLanes; currentlyRenderingFiber$1 = null; currentHook = null; workInProgressHook = null; { hookTypesDev = null; hookTypesUpdateIndexDev = -1; currentHookNameInDev = null; isUpdatingOpaqueValueInRenderPhase = false; } didScheduleRenderPhaseUpdateDuringThisPass = false; localIdCounter = 0; } function mountWorkInProgressHook() { var hook = { memoizedState: null, baseState: null, baseQueue: null, queue: null, next: null }; if (workInProgressHook === null) { // This is the first hook in the list currentlyRenderingFiber$1.memoizedState = workInProgressHook = hook; } else { // Append to the end of the list workInProgressHook = workInProgressHook.next = hook; } return workInProgressHook; } function updateWorkInProgressHook() { // This function is used both for updates and for re-renders triggered by a // render phase update. It assumes there is either a current hook we can // clone, or a work-in-progress hook from a previous render pass that we can // use as a base. When we reach the end of the base list, we must switch to // the dispatcher used for mounts. var nextCurrentHook; if (currentHook === null) { var current = currentlyRenderingFiber$1.alternate; if (current !== null) { nextCurrentHook = current.memoizedState; } else { nextCurrentHook = null; } } else { nextCurrentHook = currentHook.next; } var nextWorkInProgressHook; if (workInProgressHook === null) { nextWorkInProgressHook = currentlyRenderingFiber$1.memoizedState; } else { nextWorkInProgressHook = workInProgressHook.next; } if (nextWorkInProgressHook !== null) { // There's already a work-in-progress. Reuse it. workInProgressHook = nextWorkInProgressHook; nextWorkInProgressHook = workInProgressHook.next; currentHook = nextCurrentHook; } else { // Clone from the current hook. if (nextCurrentHook === null) { throw new Error('Rendered more hooks than during the previous render.'); } currentHook = nextCurrentHook; var newHook = { memoizedState: currentHook.memoizedState, baseState: currentHook.baseState, baseQueue: currentHook.baseQueue, queue: currentHook.queue, next: null }; if (workInProgressHook === null) { // This is the first hook in the list. currentlyRenderingFiber$1.memoizedState = workInProgressHook = newHook; } else { // Append to the end of the list. workInProgressHook = workInProgressHook.next = newHook; } } return workInProgressHook; } function createFunctionComponentUpdateQueue() { return { lastEffect: null, stores: null }; } function basicStateReducer(state, action) { // $FlowFixMe: Flow doesn't like mixed types return typeof action === 'function' ? action(state) : action; } function mountReducer(reducer, initialArg, init) { var hook = mountWorkInProgressHook(); var initialState; if (init !== undefined) { initialState = init(initialArg); } else { initialState = initialArg; } hook.memoizedState = hook.baseState = initialState; var queue = { pending: null, interleaved: null, lanes: NoLanes, dispatch: null, lastRenderedReducer: reducer, lastRenderedState: initialState }; hook.queue = queue; var dispatch = queue.dispatch = dispatchReducerAction.bind(null, currentlyRenderingFiber$1, queue); return [hook.memoizedState, dispatch]; } function updateReducer(reducer, initialArg, init) { var hook = updateWorkInProgressHook(); var queue = hook.queue; if (queue === null) { throw new Error('Should have a queue. This is likely a bug in React. Please file an issue.'); } queue.lastRenderedReducer = reducer; var current = currentHook; // The last rebase update that is NOT part of the base state. var baseQueue = current.baseQueue; // The last pending update that hasn't been processed yet. var pendingQueue = queue.pending; if (pendingQueue !== null) { // We have new updates that haven't been processed yet. // We'll add them to the base queue. if (baseQueue !== null) { // Merge the pending queue and the base queue. var baseFirst = baseQueue.next; var pendingFirst = pendingQueue.next; baseQueue.next = pendingFirst; pendingQueue.next = baseFirst; } { if (current.baseQueue !== baseQueue) { // Internal invariant that should never happen, but feasibly could in // the future if we implement resuming, or some form of that. error('Internal error: Expected work-in-progress queue to be a clone. ' + 'This is a bug in React.'); } } current.baseQueue = baseQueue = pendingQueue; queue.pending = null; } if (baseQueue !== null) { // We have a queue to process. var first = baseQueue.next; var newState = current.baseState; var newBaseState = null; var newBaseQueueFirst = null; var newBaseQueueLast = null; var update = first; do { var updateLane = update.lane; if (!isSubsetOfLanes(renderLanes, updateLane)) { // Priority is insufficient. Skip this update. If this is the first // skipped update, the previous update/state is the new base // update/state. var clone = { lane: updateLane, action: update.action, hasEagerState: update.hasEagerState, eagerState: update.eagerState, next: null }; if (newBaseQueueLast === null) { newBaseQueueFirst = newBaseQueueLast = clone; newBaseState = newState; } else { newBaseQueueLast = newBaseQueueLast.next = clone; } // Update the remaining priority in the queue. // TODO: Don't need to accumulate this. Instead, we can remove // renderLanes from the original lanes. currentlyRenderingFiber$1.lanes = mergeLanes(currentlyRenderingFiber$1.lanes, updateLane); markSkippedUpdateLanes(updateLane); } else { // This update does have sufficient priority. if (newBaseQueueLast !== null) { var _clone = { // This update is going to be committed so we never want uncommit // it. Using NoLane works because 0 is a subset of all bitmasks, so // this will never be skipped by the check above. lane: NoLane, action: update.action, hasEagerState: update.hasEagerState, eagerState: update.eagerState, next: null }; newBaseQueueLast = newBaseQueueLast.next = _clone; } // Process this update. if (update.hasEagerState) { // If this update is a state update (not a reducer) and was processed eagerly, // we can use the eagerly computed state newState = update.eagerState; } else { var action = update.action; newState = reducer(newState, action); } } update = update.next; } while (update !== null && update !== first); if (newBaseQueueLast === null) { newBaseState = newState; } else { newBaseQueueLast.next = newBaseQueueFirst; } // Mark that the fiber performed work, but only if the new state is // different from the current state. if (!objectIs(newState, hook.memoizedState)) { markWorkInProgressReceivedUpdate(); } hook.memoizedState = newState; hook.baseState = newBaseState; hook.baseQueue = newBaseQueueLast; queue.lastRenderedState = newState; } // Interleaved updates are stored on a separate queue. We aren't going to // process them during this render, but we do need to track which lanes // are remaining. var lastInterleaved = queue.interleaved; if (lastInterleaved !== null) { var interleaved = lastInterleaved; do { var interleavedLane = interleaved.lane; currentlyRenderingFiber$1.lanes = mergeLanes(currentlyRenderingFiber$1.lanes, interleavedLane); markSkippedUpdateLanes(interleavedLane); interleaved = interleaved.next; } while (interleaved !== lastInterleaved); } else if (baseQueue === null) { // `queue.lanes` is used for entangling transitions. We can set it back to // zero once the queue is empty. queue.lanes = NoLanes; } var dispatch = queue.dispatch; return [hook.memoizedState, dispatch]; } function rerenderReducer(reducer, initialArg, init) { var hook = updateWorkInProgressHook(); var queue = hook.queue; if (queue === null) { throw new Error('Should have a queue. This is likely a bug in React. Please file an issue.'); } queue.lastRenderedReducer = reducer; // This is a re-render. Apply the new render phase updates to the previous // work-in-progress hook. var dispatch = queue.dispatch; var lastRenderPhaseUpdate = queue.pending; var newState = hook.memoizedState; if (lastRenderPhaseUpdate !== null) { // The queue doesn't persist past this render pass. queue.pending = null; var firstRenderPhaseUpdate = lastRenderPhaseUpdate.next; var update = firstRenderPhaseUpdate; do { // Process this render phase update. We don't have to check the // priority because it will always be the same as the current // render's. var action = update.action; newState = reducer(newState, action); update = update.next; } while (update !== firstRenderPhaseUpdate); // Mark that the fiber performed work, but only if the new state is // different from the current state. if (!objectIs(newState, hook.memoizedState)) { markWorkInProgressReceivedUpdate(); } hook.memoizedState = newState; // Don't persist the state accumulated from the render phase updates to // the base state unless the queue is empty. // TODO: Not sure if this is the desired semantics, but it's what we // do for gDSFP. I can't remember why. if (hook.baseQueue === null) { hook.baseState = newState; } queue.lastRenderedState = newState; } return [newState, dispatch]; } function mountMutableSource(source, getSnapshot, subscribe) { { return undefined; } } function updateMutableSource(source, getSnapshot, subscribe) { { return undefined; } } function mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { var fiber = currentlyRenderingFiber$1; var hook = mountWorkInProgressHook(); var nextSnapshot; var isHydrating = getIsHydrating(); if (isHydrating) { if (getServerSnapshot === undefined) { throw new Error('Missing getServerSnapshot, which is required for ' + 'server-rendered content. Will revert to client rendering.'); } nextSnapshot = getServerSnapshot(); { if (!didWarnUncachedGetSnapshot) { if (nextSnapshot !== getServerSnapshot()) { error('The result of getServerSnapshot should be cached to avoid an infinite loop'); didWarnUncachedGetSnapshot = true; } } } } else { nextSnapshot = getSnapshot(); { if (!didWarnUncachedGetSnapshot) { var cachedSnapshot = getSnapshot(); if (!objectIs(nextSnapshot, cachedSnapshot)) { error('The result of getSnapshot should be cached to avoid an infinite loop'); didWarnUncachedGetSnapshot = true; } } } // Unless we're rendering a blocking lane, schedule a consistency check. // Right before committing, we will walk the tree and check if any of the // stores were mutated. // // We won't do this if we're hydrating server-rendered content, because if // the content is stale, it's already visible anyway. Instead we'll patch // it up in a passive effect. var root = getWorkInProgressRoot(); if (root === null) { throw new Error('Expected a work-in-progress root. This is a bug in React. Please file an issue.'); } if (!includesBlockingLane(root, renderLanes)) { pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); } } // Read the current snapshot from the store on every render. This breaks the // normal rules of React, and only works because store updates are // always synchronous. hook.memoizedState = nextSnapshot; var inst = { value: nextSnapshot, getSnapshot: getSnapshot }; hook.queue = inst; // Schedule an effect to subscribe to the store. mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [subscribe]); // Schedule an effect to update the mutable instance fields. We will update // this whenever subscribe, getSnapshot, or value changes. Because there's no // clean-up function, and we track the deps correctly, we can call pushEffect // directly, without storing any additional state. For the same reason, we // don't need to set a static flag, either. // TODO: We can move this to the passive phase once we add a pre-commit // consistency check. See the next comment. fiber.flags |= Passive; pushEffect(HasEffect | Passive$1, updateStoreInstance.bind(null, fiber, inst, nextSnapshot, getSnapshot), undefined, null); return nextSnapshot; } function updateSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { var fiber = currentlyRenderingFiber$1; var hook = updateWorkInProgressHook(); // Read the current snapshot from the store on every render. This breaks the // normal rules of React, and only works because store updates are // always synchronous. var nextSnapshot = getSnapshot(); { if (!didWarnUncachedGetSnapshot) { var cachedSnapshot = getSnapshot(); if (!objectIs(nextSnapshot, cachedSnapshot)) { error('The result of getSnapshot should be cached to avoid an infinite loop'); didWarnUncachedGetSnapshot = true; } } } var prevSnapshot = hook.memoizedState; var snapshotChanged = !objectIs(prevSnapshot, nextSnapshot); if (snapshotChanged) { hook.memoizedState = nextSnapshot; markWorkInProgressReceivedUpdate(); } var inst = hook.queue; updateEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [subscribe]); // Whenever getSnapshot or subscribe changes, we need to check in the // commit phase if there was an interleaved mutation. In concurrent mode // this can happen all the time, but even in synchronous mode, an earlier // effect may have mutated the store. if (inst.getSnapshot !== getSnapshot || snapshotChanged || // Check if the susbcribe function changed. We can save some memory by // checking whether we scheduled a subscription effect above. workInProgressHook !== null && workInProgressHook.memoizedState.tag & HasEffect) { fiber.flags |= Passive; pushEffect(HasEffect | Passive$1, updateStoreInstance.bind(null, fiber, inst, nextSnapshot, getSnapshot), undefined, null); // Unless we're rendering a blocking lane, schedule a consistency check. // Right before committing, we will walk the tree and check if any of the // stores were mutated. var root = getWorkInProgressRoot(); if (root === null) { throw new Error('Expected a work-in-progress root. This is a bug in React. Please file an issue.'); } if (!includesBlockingLane(root, renderLanes)) { pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); } } return nextSnapshot; } function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) { fiber.flags |= StoreConsistency; var check = { getSnapshot: getSnapshot, value: renderedSnapshot }; var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue; if (componentUpdateQueue === null) { componentUpdateQueue = createFunctionComponentUpdateQueue(); currentlyRenderingFiber$1.updateQueue = componentUpdateQueue; componentUpdateQueue.stores = [check]; } else { var stores = componentUpdateQueue.stores; if (stores === null) { componentUpdateQueue.stores = [check]; } else { stores.push(check); } } } function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) { // These are updated in the passive phase inst.value = nextSnapshot; inst.getSnapshot = getSnapshot; // Something may have been mutated in between render and commit. This could // have been in an event that fired before the passive effects, or it could // have been in a layout effect. In that case, we would have used the old // snapsho and getSnapshot values to bail out. We need to check one more time. if (checkIfSnapshotChanged(inst)) { // Force a re-render. forceStoreRerender(fiber); } } function subscribeToStore(fiber, inst, subscribe) { var handleStoreChange = function () { // The store changed. Check if the snapshot changed since the last time we // read from the store. if (checkIfSnapshotChanged(inst)) { // Force a re-render. forceStoreRerender(fiber); } }; // Subscribe to the store and return a clean-up function. return subscribe(handleStoreChange); } function checkIfSnapshotChanged(inst) { var latestGetSnapshot = inst.getSnapshot; var prevValue = inst.value; try { var nextValue = latestGetSnapshot(); return !objectIs(prevValue, nextValue); } catch (error) { return true; } } function forceStoreRerender(fiber) { var root = enqueueConcurrentRenderForLane(fiber, SyncLane); if (root !== null) { scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp); } } function mountState(initialState) { var hook = mountWorkInProgressHook(); if (typeof initialState === 'function') { // $FlowFixMe: Flow doesn't like mixed types initialState = initialState(); } hook.memoizedState = hook.baseState = initialState; var queue = { pending: null, interleaved: null, lanes: NoLanes, dispatch: null, lastRenderedReducer: basicStateReducer, lastRenderedState: initialState }; hook.queue = queue; var dispatch = queue.dispatch = dispatchSetState.bind(null, currentlyRenderingFiber$1, queue); return [hook.memoizedState, dispatch]; } function updateState(initialState) { return updateReducer(basicStateReducer); } function rerenderState(initialState) { return rerenderReducer(basicStateReducer); } function pushEffect(tag, create, destroy, deps) { var effect = { tag: tag, create: create, destroy: destroy, deps: deps, // Circular next: null }; var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue; if (componentUpdateQueue === null) { componentUpdateQueue = createFunctionComponentUpdateQueue(); currentlyRenderingFiber$1.updateQueue = componentUpdateQueue; componentUpdateQueue.lastEffect = effect.next = effect; } else { var lastEffect = componentUpdateQueue.lastEffect; if (lastEffect === null) { componentUpdateQueue.lastEffect = effect.next = effect; } else { var firstEffect = lastEffect.next; lastEffect.next = effect; effect.next = firstEffect; componentUpdateQueue.lastEffect = effect; } } return effect; } function mountRef(initialValue) { var hook = mountWorkInProgressHook(); { var _ref2 = { current: initialValue }; hook.memoizedState = _ref2; return _ref2; } } function updateRef(initialValue) { var hook = updateWorkInProgressHook(); return hook.memoizedState; } function mountEffectImpl(fiberFlags, hookFlags, create, deps) { var hook = mountWorkInProgressHook(); var nextDeps = deps === undefined ? null : deps; currentlyRenderingFiber$1.flags |= fiberFlags; hook.memoizedState = pushEffect(HasEffect | hookFlags, create, undefined, nextDeps); } function updateEffectImpl(fiberFlags, hookFlags, create, deps) { var hook = updateWorkInProgressHook(); var nextDeps = deps === undefined ? null : deps; var destroy = undefined; if (currentHook !== null) { var prevEffect = currentHook.memoizedState; destroy = prevEffect.destroy; if (nextDeps !== null) { var prevDeps = prevEffect.deps; if (areHookInputsEqual(nextDeps, prevDeps)) { hook.memoizedState = pushEffect(hookFlags, create, destroy, nextDeps); return; } } } currentlyRenderingFiber$1.flags |= fiberFlags; hook.memoizedState = pushEffect(HasEffect | hookFlags, create, destroy, nextDeps); } function mountEffect(create, deps) { if ( (currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode) { return mountEffectImpl(MountPassiveDev | Passive | PassiveStatic, Passive$1, create, deps); } else { return mountEffectImpl(Passive | PassiveStatic, Passive$1, create, deps); } } function updateEffect(create, deps) { return updateEffectImpl(Passive, Passive$1, create, deps); } function mountInsertionEffect(create, deps) { return mountEffectImpl(Update, Insertion, create, deps); } function updateInsertionEffect(create, deps) { return updateEffectImpl(Update, Insertion, create, deps); } function mountLayoutEffect(create, deps) { var fiberFlags = Update; { fiberFlags |= LayoutStatic; } if ( (currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode) { fiberFlags |= MountLayoutDev; } return mountEffectImpl(fiberFlags, Layout, create, deps); } function updateLayoutEffect(create, deps) { return updateEffectImpl(Update, Layout, create, deps); } function imperativeHandleEffect(create, ref) { if (typeof ref === 'function') { var refCallback = ref; var _inst = create(); refCallback(_inst); return function () { refCallback(null); }; } else if (ref !== null && ref !== undefined) { var refObject = ref; { if (!refObject.hasOwnProperty('current')) { error('Expected useImperativeHandle() first argument to either be a ' + 'ref callback or React.createRef() object. Instead received: %s.', 'an object with keys {' + Object.keys(refObject).join(', ') + '}'); } } var _inst2 = create(); refObject.current = _inst2; return function () { refObject.current = null; }; } } function mountImperativeHandle(ref, create, deps) { { if (typeof create !== 'function') { error('Expected useImperativeHandle() second argument to be a function ' + 'that creates a handle. Instead received: %s.', create !== null ? typeof create : 'null'); } } // TODO: If deps are provided, should we skip comparing the ref itself? var effectDeps = deps !== null && deps !== undefined ? deps.concat([ref]) : null; var fiberFlags = Update; { fiberFlags |= LayoutStatic; } if ( (currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode) { fiberFlags |= MountLayoutDev; } return mountEffectImpl(fiberFlags, Layout, imperativeHandleEffect.bind(null, create, ref), effectDeps); } function updateImperativeHandle(ref, create, deps) { { if (typeof create !== 'function') { error('Expected useImperativeHandle() second argument to be a function ' + 'that creates a handle. Instead received: %s.', create !== null ? typeof create : 'null'); } } // TODO: If deps are provided, should we skip comparing the ref itself? var effectDeps = deps !== null && deps !== undefined ? deps.concat([ref]) : null; return updateEffectImpl(Update, Layout, imperativeHandleEffect.bind(null, create, ref), effectDeps); } function mountDebugValue(value, formatterFn) {// This hook is normally a no-op. // The react-debug-hooks package injects its own implementation // so that e.g. DevTools can display custom hook values. } var updateDebugValue = mountDebugValue; function mountCallback(callback, deps) { var hook = mountWorkInProgressHook(); var nextDeps = deps === undefined ? null : deps; hook.memoizedState = [callback, nextDeps]; return callback; } function updateCallback(callback, deps) { var hook = updateWorkInProgressHook(); var nextDeps = deps === undefined ? null : deps; var prevState = hook.memoizedState; if (prevState !== null) { if (nextDeps !== null) { var prevDeps = prevState[1]; if (areHookInputsEqual(nextDeps, prevDeps)) { return prevState[0]; } } } hook.memoizedState = [callback, nextDeps]; return callback; } function mountMemo(nextCreate, deps) { var hook = mountWorkInProgressHook(); var nextDeps = deps === undefined ? null : deps; var nextValue = nextCreate(); hook.memoizedState = [nextValue, nextDeps]; return nextValue; } function updateMemo(nextCreate, deps) { var hook = updateWorkInProgressHook(); var nextDeps = deps === undefined ? null : deps; var prevState = hook.memoizedState; if (prevState !== null) { // Assume these are defined. If they're not, areHookInputsEqual will warn. if (nextDeps !== null) { var prevDeps = prevState[1]; if (areHookInputsEqual(nextDeps, prevDeps)) { return prevState[0]; } } } var nextValue = nextCreate(); hook.memoizedState = [nextValue, nextDeps]; return nextValue; } function mountDeferredValue(value) { var hook = mountWorkInProgressHook(); hook.memoizedState = value; return value; } function updateDeferredValue(value) { var hook = updateWorkInProgressHook(); var resolvedCurrentHook = currentHook; var prevValue = resolvedCurrentHook.memoizedState; return updateDeferredValueImpl(hook, prevValue, value); } function rerenderDeferredValue(value) { var hook = updateWorkInProgressHook(); if (currentHook === null) { // This is a rerender during a mount. hook.memoizedState = value; return value; } else { // This is a rerender during an update. var prevValue = currentHook.memoizedState; return updateDeferredValueImpl(hook, prevValue, value); } } function updateDeferredValueImpl(hook, prevValue, value) { var shouldDeferValue = !includesOnlyNonUrgentLanes(renderLanes); if (shouldDeferValue) { // This is an urgent update. If the value has changed, keep using the // previous value and spawn a deferred render to update it later. if (!objectIs(value, prevValue)) { // Schedule a deferred render var deferredLane = claimNextTransitionLane(); currentlyRenderingFiber$1.lanes = mergeLanes(currentlyRenderingFiber$1.lanes, deferredLane); markSkippedUpdateLanes(deferredLane); // Set this to true to indicate that the rendered value is inconsistent // from the latest value. The name "baseState" doesn't really match how we // use it because we're reusing a state hook field instead of creating a // new one. hook.baseState = true; } // Reuse the previous value return prevValue; } else { // This is not an urgent update, so we can use the latest value regardless // of what it is. No need to defer it. // However, if we're currently inside a spawned render, then we need to mark // this as an update to prevent the fiber from bailing out. // // `baseState` is true when the current value is different from the rendered // value. The name doesn't really match how we use it because we're reusing // a state hook field instead of creating a new one. if (hook.baseState) { // Flip this back to false. hook.baseState = false; markWorkInProgressReceivedUpdate(); } hook.memoizedState = value; return value; } } function startTransition(setPending, callback, options) { var previousPriority = getCurrentUpdatePriority(); setCurrentUpdatePriority(higherEventPriority(previousPriority, ContinuousEventPriority)); setPending(true); var prevTransition = ReactCurrentBatchConfig$2.transition; ReactCurrentBatchConfig$2.transition = {}; var currentTransition = ReactCurrentBatchConfig$2.transition; { ReactCurrentBatchConfig$2.transition._updatedFibers = new Set(); } try { setPending(false); callback(); } finally { setCurrentUpdatePriority(previousPriority); ReactCurrentBatchConfig$2.transition = prevTransition; { if (prevTransition === null && currentTransition._updatedFibers) { var updatedFibersCount = currentTransition._updatedFibers.size; if (updatedFibersCount > 10) { warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.'); } currentTransition._updatedFibers.clear(); } } } } function mountTransition() { var _mountState = mountState(false), isPending = _mountState[0], setPending = _mountState[1]; // The `start` method never changes. var start = startTransition.bind(null, setPending); var hook = mountWorkInProgressHook(); hook.memoizedState = start; return [isPending, start]; } function updateTransition() { var _updateState = updateState(), isPending = _updateState[0]; var hook = updateWorkInProgressHook(); var start = hook.memoizedState; return [isPending, start]; } function rerenderTransition() { var _rerenderState = rerenderState(), isPending = _rerenderState[0]; var hook = updateWorkInProgressHook(); var start = hook.memoizedState; return [isPending, start]; } var isUpdatingOpaqueValueInRenderPhase = false; function getIsUpdatingOpaqueValueInRenderPhaseInDEV() { { return isUpdatingOpaqueValueInRenderPhase; } } function mountId() { var hook = mountWorkInProgressHook(); var root = getWorkInProgressRoot(); // TODO: In Fizz, id generation is specific to each server config. Maybe we // should do this in Fiber, too? Deferring this decision for now because // there's no other place to store the prefix except for an internal field on // the public createRoot object, which the fiber tree does not currently have // a reference to. var identifierPrefix = root.identifierPrefix; var id; if (getIsHydrating()) { var treeId = getTreeId(); // Use a captial R prefix for server-generated ids. id = ':' + identifierPrefix + 'R' + treeId; // Unless this is the first id at this level, append a number at the end // that represents the position of this useId hook among all the useId // hooks for this fiber. var localId = localIdCounter++; if (localId > 0) { id += 'H' + localId.toString(32); } id += ':'; } else { // Use a lowercase r prefix for client-generated ids. var globalClientId = globalClientIdCounter++; id = ':' + identifierPrefix + 'r' + globalClientId.toString(32) + ':'; } hook.memoizedState = id; return id; } function updateId() { var hook = updateWorkInProgressHook(); var id = hook.memoizedState; return id; } function dispatchReducerAction(fiber, queue, action) { { if (typeof arguments[3] === 'function') { error("State updates from the useState() and useReducer() Hooks don't support the " + 'second callback argument. To execute a side effect after ' + 'rendering, declare it in the component body with useEffect().'); } } var lane = requestUpdateLane(fiber); var update = { lane: lane, action: action, hasEagerState: false, eagerState: null, next: null }; if (isRenderPhaseUpdate(fiber)) { enqueueRenderPhaseUpdate(queue, update); } else { var root = enqueueConcurrentHookUpdate(fiber, queue, update, lane); if (root !== null) { var eventTime = requestEventTime(); scheduleUpdateOnFiber(root, fiber, lane, eventTime); entangleTransitionUpdate(root, queue, lane); } } markUpdateInDevTools(fiber, lane); } function dispatchSetState(fiber, queue, action) { { if (typeof arguments[3] === 'function') { error("State updates from the useState() and useReducer() Hooks don't support the " + 'second callback argument. To execute a side effect after ' + 'rendering, declare it in the component body with useEffect().'); } } var lane = requestUpdateLane(fiber); var update = { lane: lane, action: action, hasEagerState: false, eagerState: null, next: null }; if (isRenderPhaseUpdate(fiber)) { enqueueRenderPhaseUpdate(queue, update); } else { var alternate = fiber.alternate; if (fiber.lanes === NoLanes && (alternate === null || alternate.lanes === NoLanes)) { // The queue is currently empty, which means we can eagerly compute the // next state before entering the render phase. If the new state is the // same as the current state, we may be able to bail out entirely. var lastRenderedReducer = queue.lastRenderedReducer; if (lastRenderedReducer !== null) { var prevDispatcher; { prevDispatcher = ReactCurrentDispatcher$1.current; ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; } try { var currentState = queue.lastRenderedState; var eagerState = lastRenderedReducer(currentState, action); // Stash the eagerly computed state, and the reducer used to compute // it, on the update object. If the reducer hasn't changed by the // time we enter the render phase, then the eager state can be used // without calling the reducer again. update.hasEagerState = true; update.eagerState = eagerState; if (objectIs(eagerState, currentState)) { // Fast path. We can bail out without scheduling React to re-render. // It's still possible that we'll need to rebase this update later, // if the component re-renders for a different reason and by that // time the reducer has changed. // TODO: Do we still need to entangle transitions in this case? enqueueConcurrentHookUpdateAndEagerlyBailout(fiber, queue, update, lane); return; } } catch (error) {// Suppress the error. It will throw again in the render phase. } finally { { ReactCurrentDispatcher$1.current = prevDispatcher; } } } } var root = enqueueConcurrentHookUpdate(fiber, queue, update, lane); if (root !== null) { var eventTime = requestEventTime(); scheduleUpdateOnFiber(root, fiber, lane, eventTime); entangleTransitionUpdate(root, queue, lane); } } markUpdateInDevTools(fiber, lane); } function isRenderPhaseUpdate(fiber) { var alternate = fiber.alternate; return fiber === currentlyRenderingFiber$1 || alternate !== null && alternate === currentlyRenderingFiber$1; } function enqueueRenderPhaseUpdate(queue, update) { // This is a render phase update. Stash it in a lazily-created map of // queue -> linked list of updates. After this render pass, we'll restart // and apply the stashed updates on top of the work-in-progress hook. didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate = true; var pending = queue.pending; if (pending === null) { // This is the first update. Create a circular list. update.next = update; } else { update.next = pending.next; pending.next = update; } queue.pending = update; } // TODO: Move to ReactFiberConcurrentUpdates? function entangleTransitionUpdate(root, queue, lane) { if (isTransitionLane(lane)) { var queueLanes = queue.lanes; // If any entangled lanes are no longer pending on the root, then they // must have finished. We can remove them from the shared queue, which // represents a superset of the actually pending lanes. In some cases we // may entangle more than we need to, but that's OK. In fact it's worse if // we *don't* entangle when we should. queueLanes = intersectLanes(queueLanes, root.pendingLanes); // Entangle the new transition lane with the other transition lanes. var newQueueLanes = mergeLanes(queueLanes, lane); queue.lanes = newQueueLanes; // Even if queue.lanes already include lane, we don't know for certain if // the lane finished since the last time we entangled it. So we need to // entangle it again, just to be sure. markRootEntangled(root, newQueueLanes); } } function markUpdateInDevTools(fiber, lane, action) { { markStateUpdateScheduled(fiber, lane); } } var ContextOnlyDispatcher = { readContext: readContext, useCallback: throwInvalidHookError, useContext: throwInvalidHookError, useEffect: throwInvalidHookError, useImperativeHandle: throwInvalidHookError, useInsertionEffect: throwInvalidHookError, useLayoutEffect: throwInvalidHookError, useMemo: throwInvalidHookError, useReducer: throwInvalidHookError, useRef: throwInvalidHookError, useState: throwInvalidHookError, useDebugValue: throwInvalidHookError, useDeferredValue: throwInvalidHookError, useTransition: throwInvalidHookError, useMutableSource: throwInvalidHookError, useSyncExternalStore: throwInvalidHookError, useId: throwInvalidHookError, unstable_isNewReconciler: enableNewReconciler }; var HooksDispatcherOnMountInDEV = null; var HooksDispatcherOnMountWithHookTypesInDEV = null; var HooksDispatcherOnUpdateInDEV = null; var HooksDispatcherOnRerenderInDEV = null; var InvalidNestedHooksDispatcherOnMountInDEV = null; var InvalidNestedHooksDispatcherOnUpdateInDEV = null; var InvalidNestedHooksDispatcherOnRerenderInDEV = null; { var warnInvalidContextAccess = function () { error('Context can only be read while React is rendering. ' + 'In classes, you can read it in the render method or getDerivedStateFromProps. ' + 'In function components, you can read it directly in the function body, but not ' + 'inside Hooks like useReducer() or useMemo().'); }; var warnInvalidHookAccess = function () { error('Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. ' + 'You can only call Hooks at the top level of your React function. ' + 'For more information, see ' + 'https://reactjs.org/link/rules-of-hooks'); }; HooksDispatcherOnMountInDEV = { readContext: function (context) { return readContext(context); }, useCallback: function (callback, deps) { currentHookNameInDev = 'useCallback'; mountHookTypesDev(); checkDepsAreArrayDev(deps); return mountCallback(callback, deps); }, useContext: function (context) { currentHookNameInDev = 'useContext'; mountHookTypesDev(); return readContext(context); }, useEffect: function (create, deps) { currentHookNameInDev = 'useEffect'; mountHookTypesDev(); checkDepsAreArrayDev(deps); return mountEffect(create, deps); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = 'useImperativeHandle'; mountHookTypesDev(); checkDepsAreArrayDev(deps); return mountImperativeHandle(ref, create, deps); }, useInsertionEffect: function (create, deps) { currentHookNameInDev = 'useInsertionEffect'; mountHookTypesDev(); checkDepsAreArrayDev(deps); return mountInsertionEffect(create, deps); }, useLayoutEffect: function (create, deps) { currentHookNameInDev = 'useLayoutEffect'; mountHookTypesDev(); checkDepsAreArrayDev(deps); return mountLayoutEffect(create, deps); }, useMemo: function (create, deps) { currentHookNameInDev = 'useMemo'; mountHookTypesDev(); checkDepsAreArrayDev(deps); var prevDispatcher = ReactCurrentDispatcher$1.current; ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; try { return mountMemo(create, deps); } finally { ReactCurrentDispatcher$1.current = prevDispatcher; } }, useReducer: function (reducer, initialArg, init) { currentHookNameInDev = 'useReducer'; mountHookTypesDev(); var prevDispatcher = ReactCurrentDispatcher$1.current; ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; try { return mountReducer(reducer, initialArg, init); } finally { ReactCurrentDispatcher$1.current = prevDispatcher; } }, useRef: function (initialValue) { currentHookNameInDev = 'useRef'; mountHookTypesDev(); return mountRef(initialValue); }, useState: function (initialState) { currentHookNameInDev = 'useState'; mountHookTypesDev(); var prevDispatcher = ReactCurrentDispatcher$1.current; ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; try { return mountState(initialState); } finally { ReactCurrentDispatcher$1.current = prevDispatcher; } }, useDebugValue: function (value, formatterFn) { currentHookNameInDev = 'useDebugValue'; mountHookTypesDev(); return mountDebugValue(); }, useDeferredValue: function (value) { currentHookNameInDev = 'useDeferredValue'; mountHookTypesDev(); return mountDeferredValue(value); }, useTransition: function () { currentHookNameInDev = 'useTransition'; mountHookTypesDev(); return mountTransition(); }, useMutableSource: function (source, getSnapshot, subscribe) { currentHookNameInDev = 'useMutableSource'; mountHookTypesDev(); return mountMutableSource(); }, useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) { currentHookNameInDev = 'useSyncExternalStore'; mountHookTypesDev(); return mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot); }, useId: function () { currentHookNameInDev = 'useId'; mountHookTypesDev(); return mountId(); }, unstable_isNewReconciler: enableNewReconciler }; HooksDispatcherOnMountWithHookTypesInDEV = { readContext: function (context) { return readContext(context); }, useCallback: function (callback, deps) { currentHookNameInDev = 'useCallback'; updateHookTypesDev(); return mountCallback(callback, deps); }, useContext: function (context) { currentHookNameInDev = 'useContext'; updateHookTypesDev(); return readContext(context); }, useEffect: function (create, deps) { currentHookNameInDev = 'useEffect'; updateHookTypesDev(); return mountEffect(create, deps); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = 'useImperativeHandle'; updateHookTypesDev(); return mountImperativeHandle(ref, create, deps); }, useInsertionEffect: function (create, deps) { currentHookNameInDev = 'useInsertionEffect'; updateHookTypesDev(); return mountInsertionEffect(create, deps); }, useLayoutEffect: function (create, deps) { currentHookNameInDev = 'useLayoutEffect'; updateHookTypesDev(); return mountLayoutEffect(create, deps); }, useMemo: function (create, deps) { currentHookNameInDev = 'useMemo'; updateHookTypesDev(); var prevDispatcher = ReactCurrentDispatcher$1.current; ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; try { return mountMemo(create, deps); } finally { ReactCurrentDispatcher$1.current = prevDispatcher; } }, useReducer: function (reducer, initialArg, init) { currentHookNameInDev = 'useReducer'; updateHookTypesDev(); var prevDispatcher = ReactCurrentDispatcher$1.current; ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; try { return mountReducer(reducer, initialArg, init); } finally { ReactCurrentDispatcher$1.current = prevDispatcher; } }, useRef: function (initialValue) { currentHookNameInDev = 'useRef'; updateHookTypesDev(); return mountRef(initialValue); }, useState: function (initialState) { currentHookNameInDev = 'useState'; updateHookTypesDev(); var prevDispatcher = ReactCurrentDispatcher$1.current; ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; try { return mountState(initialState); } finally { ReactCurrentDispatcher$1.current = prevDispatcher; } }, useDebugValue: function (value, formatterFn) { currentHookNameInDev = 'useDebugValue'; updateHookTypesDev(); return mountDebugValue(); }, useDeferredValue: function (value) { currentHookNameInDev = 'useDeferredValue'; updateHookTypesDev(); return mountDeferredValue(value); }, useTransition: function () { currentHookNameInDev = 'useTransition'; updateHookTypesDev(); return mountTransition(); }, useMutableSource: function (source, getSnapshot, subscribe) { currentHookNameInDev = 'useMutableSource'; updateHookTypesDev(); return mountMutableSource(); }, useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) { currentHookNameInDev = 'useSyncExternalStore'; updateHookTypesDev(); return mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot); }, useId: function () { currentHookNameInDev = 'useId'; updateHookTypesDev(); return mountId(); }, unstable_isNewReconciler: enableNewReconciler }; HooksDispatcherOnUpdateInDEV = { readContext: function (context) { return readContext(context); }, useCallback: function (callback, deps) { currentHookNameInDev = 'useCallback'; updateHookTypesDev(); return updateCallback(callback, deps); }, useContext: function (context) { currentHookNameInDev = 'useContext'; updateHookTypesDev(); return readContext(context); }, useEffect: function (create, deps) { currentHookNameInDev = 'useEffect'; updateHookTypesDev(); return updateEffect(create, deps); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = 'useImperativeHandle'; updateHookTypesDev(); return updateImperativeHandle(ref, create, deps); }, useInsertionEffect: function (create, deps) { currentHookNameInDev = 'useInsertionEffect'; updateHookTypesDev(); return updateInsertionEffect(create, deps); }, useLayoutEffect: function (create, deps) { currentHookNameInDev = 'useLayoutEffect'; updateHookTypesDev(); return updateLayoutEffect(create, deps); }, useMemo: function (create, deps) { currentHookNameInDev = 'useMemo'; updateHookTypesDev(); var prevDispatcher = ReactCurrentDispatcher$1.current; ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; try { return updateMemo(create, deps); } finally { ReactCurrentDispatcher$1.current = prevDispatcher; } }, useReducer: function (reducer, initialArg, init) { currentHookNameInDev = 'useReducer'; updateHookTypesDev(); var prevDispatcher = ReactCurrentDispatcher$1.current; ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; try { return updateReducer(reducer, initialArg, init); } finally { ReactCurrentDispatcher$1.current = prevDispatcher; } }, useRef: function (initialValue) { currentHookNameInDev = 'useRef'; updateHookTypesDev(); return updateRef(); }, useState: function (initialState) { currentHookNameInDev = 'useState'; updateHookTypesDev(); var prevDispatcher = ReactCurrentDispatcher$1.current; ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; try { return updateState(initialState); } finally { ReactCurrentDispatcher$1.current = prevDispatcher; } }, useDebugValue: function (value, formatterFn) { currentHookNameInDev = 'useDebugValue'; updateHookTypesDev(); return updateDebugValue(); }, useDeferredValue: function (value) { currentHookNameInDev = 'useDeferredValue'; updateHookTypesDev(); return updateDeferredValue(value); }, useTransition: function () { currentHookNameInDev = 'useTransition'; updateHookTypesDev(); return updateTransition(); }, useMutableSource: function (source, getSnapshot, subscribe) { currentHookNameInDev = 'useMutableSource'; updateHookTypesDev(); return updateMutableSource(); }, useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) { currentHookNameInDev = 'useSyncExternalStore'; updateHookTypesDev(); return updateSyncExternalStore(subscribe, getSnapshot); }, useId: function () { currentHookNameInDev = 'useId'; updateHookTypesDev(); return updateId(); }, unstable_isNewReconciler: enableNewReconciler }; HooksDispatcherOnRerenderInDEV = { readContext: function (context) { return readContext(context); }, useCallback: function (callback, deps) { currentHookNameInDev = 'useCallback'; updateHookTypesDev(); return updateCallback(callback, deps); }, useContext: function (context) { currentHookNameInDev = 'useContext'; updateHookTypesDev(); return readContext(context); }, useEffect: function (create, deps) { currentHookNameInDev = 'useEffect'; updateHookTypesDev(); return updateEffect(create, deps); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = 'useImperativeHandle'; updateHookTypesDev(); return updateImperativeHandle(ref, create, deps); }, useInsertionEffect: function (create, deps) { currentHookNameInDev = 'useInsertionEffect'; updateHookTypesDev(); return updateInsertionEffect(create, deps); }, useLayoutEffect: function (create, deps) { currentHookNameInDev = 'useLayoutEffect'; updateHookTypesDev(); return updateLayoutEffect(create, deps); }, useMemo: function (create, deps) { currentHookNameInDev = 'useMemo'; updateHookTypesDev(); var prevDispatcher = ReactCurrentDispatcher$1.current; ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV; try { return updateMemo(create, deps); } finally { ReactCurrentDispatcher$1.current = prevDispatcher; } }, useReducer: function (reducer, initialArg, init) { currentHookNameInDev = 'useReducer'; updateHookTypesDev(); var prevDispatcher = ReactCurrentDispatcher$1.current; ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV; try { return rerenderReducer(reducer, initialArg, init); } finally { ReactCurrentDispatcher$1.current = prevDispatcher; } }, useRef: function (initialValue) { currentHookNameInDev = 'useRef'; updateHookTypesDev(); return updateRef(); }, useState: function (initialState) { currentHookNameInDev = 'useState'; updateHookTypesDev(); var prevDispatcher = ReactCurrentDispatcher$1.current; ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV; try { return rerenderState(initialState); } finally { ReactCurrentDispatcher$1.current = prevDispatcher; } }, useDebugValue: function (value, formatterFn) { currentHookNameInDev = 'useDebugValue'; updateHookTypesDev(); return updateDebugValue(); }, useDeferredValue: function (value) { currentHookNameInDev = 'useDeferredValue'; updateHookTypesDev(); return rerenderDeferredValue(value); }, useTransition: function () { currentHookNameInDev = 'useTransition'; updateHookTypesDev(); return rerenderTransition(); }, useMutableSource: function (source, getSnapshot, subscribe) { currentHookNameInDev = 'useMutableSource'; updateHookTypesDev(); return updateMutableSource(); }, useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) { currentHookNameInDev = 'useSyncExternalStore'; updateHookTypesDev(); return updateSyncExternalStore(subscribe, getSnapshot); }, useId: function () { currentHookNameInDev = 'useId'; updateHookTypesDev(); return updateId(); }, unstable_isNewReconciler: enableNewReconciler }; InvalidNestedHooksDispatcherOnMountInDEV = { readContext: function (context) { warnInvalidContextAccess(); return readContext(context); }, useCallback: function (callback, deps) { currentHookNameInDev = 'useCallback'; warnInvalidHookAccess(); mountHookTypesDev(); return mountCallback(callback, deps); }, useContext: function (context) { currentHookNameInDev = 'useContext'; warnInvalidHookAccess(); mountHookTypesDev(); return readContext(context); }, useEffect: function (create, deps) { currentHookNameInDev = 'useEffect'; warnInvalidHookAccess(); mountHookTypesDev(); return mountEffect(create, deps); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = 'useImperativeHandle'; warnInvalidHookAccess(); mountHookTypesDev(); return mountImperativeHandle(ref, create, deps); }, useInsertionEffect: function (create, deps) { currentHookNameInDev = 'useInsertionEffect'; warnInvalidHookAccess(); mountHookTypesDev(); return mountInsertionEffect(create, deps); }, useLayoutEffect: function (create, deps) { currentHookNameInDev = 'useLayoutEffect'; warnInvalidHookAccess(); mountHookTypesDev(); return mountLayoutEffect(create, deps); }, useMemo: function (create, deps) { currentHookNameInDev = 'useMemo'; warnInvalidHookAccess(); mountHookTypesDev(); var prevDispatcher = ReactCurrentDispatcher$1.current; ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; try { return mountMemo(create, deps); } finally { ReactCurrentDispatcher$1.current = prevDispatcher; } }, useReducer: function (reducer, initialArg, init) { currentHookNameInDev = 'useReducer'; warnInvalidHookAccess(); mountHookTypesDev(); var prevDispatcher = ReactCurrentDispatcher$1.current; ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; try { return mountReducer(reducer, initialArg, init); } finally { ReactCurrentDispatcher$1.current = prevDispatcher; } }, useRef: function (initialValue) { currentHookNameInDev = 'useRef'; warnInvalidHookAccess(); mountHookTypesDev(); return mountRef(initialValue); }, useState: function (initialState) { currentHookNameInDev = 'useState'; warnInvalidHookAccess(); mountHookTypesDev(); var prevDispatcher = ReactCurrentDispatcher$1.current; ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; try { return mountState(initialState); } finally { ReactCurrentDispatcher$1.current = prevDispatcher; } }, useDebugValue: function (value, formatterFn) { currentHookNameInDev = 'useDebugValue'; warnInvalidHookAccess(); mountHookTypesDev(); return mountDebugValue(); }, useDeferredValue: function (value) { currentHookNameInDev = 'useDeferredValue'; warnInvalidHookAccess(); mountHookTypesDev(); return mountDeferredValue(value); }, useTransition: function () { currentHookNameInDev = 'useTransition'; warnInvalidHookAccess(); mountHookTypesDev(); return mountTransition(); }, useMutableSource: function (source, getSnapshot, subscribe) { currentHookNameInDev = 'useMutableSource'; warnInvalidHookAccess(); mountHookTypesDev(); return mountMutableSource(); }, useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) { currentHookNameInDev = 'useSyncExternalStore'; warnInvalidHookAccess(); mountHookTypesDev(); return mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot); }, useId: function () { currentHookNameInDev = 'useId'; warnInvalidHookAccess(); mountHookTypesDev(); return mountId(); }, unstable_isNewReconciler: enableNewReconciler }; InvalidNestedHooksDispatcherOnUpdateInDEV = { readContext: function (context) { warnInvalidContextAccess(); return readContext(context); }, useCallback: function (callback, deps) { currentHookNameInDev = 'useCallback'; warnInvalidHookAccess(); updateHookTypesDev(); return updateCallback(callback, deps); }, useContext: function (context) { currentHookNameInDev = 'useContext'; warnInvalidHookAccess(); updateHookTypesDev(); return readContext(context); }, useEffect: function (create, deps) { currentHookNameInDev = 'useEffect'; warnInvalidHookAccess(); updateHookTypesDev(); return updateEffect(create, deps); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = 'useImperativeHandle'; warnInvalidHookAccess(); updateHookTypesDev(); return updateImperativeHandle(ref, create, deps); }, useInsertionEffect: function (create, deps) { currentHookNameInDev = 'useInsertionEffect'; warnInvalidHookAccess(); updateHookTypesDev(); return updateInsertionEffect(create, deps); }, useLayoutEffect: function (create, deps) { currentHookNameInDev = 'useLayoutEffect'; warnInvalidHookAccess(); updateHookTypesDev(); return updateLayoutEffect(create, deps); }, useMemo: function (create, deps) { currentHookNameInDev = 'useMemo'; warnInvalidHookAccess(); updateHookTypesDev(); var prevDispatcher = ReactCurrentDispatcher$1.current; ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; try { return updateMemo(create, deps); } finally { ReactCurrentDispatcher$1.current = prevDispatcher; } }, useReducer: function (reducer, initialArg, init) { currentHookNameInDev = 'useReducer'; warnInvalidHookAccess(); updateHookTypesDev(); var prevDispatcher = ReactCurrentDispatcher$1.current; ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; try { return updateReducer(reducer, initialArg, init); } finally { ReactCurrentDispatcher$1.current = prevDispatcher; } }, useRef: function (initialValue) { currentHookNameInDev = 'useRef'; warnInvalidHookAccess(); updateHookTypesDev(); return updateRef(); }, useState: function (initialState) { currentHookNameInDev = 'useState'; warnInvalidHookAccess(); updateHookTypesDev(); var prevDispatcher = ReactCurrentDispatcher$1.current; ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; try { return updateState(initialState); } finally { ReactCurrentDispatcher$1.current = prevDispatcher; } }, useDebugValue: function (value, formatterFn) { currentHookNameInDev = 'useDebugValue'; warnInvalidHookAccess(); updateHookTypesDev(); return updateDebugValue(); }, useDeferredValue: function (value) { currentHookNameInDev = 'useDeferredValue'; warnInvalidHookAccess(); updateHookTypesDev(); return updateDeferredValue(value); }, useTransition: function () { currentHookNameInDev = 'useTransition'; warnInvalidHookAccess(); updateHookTypesDev(); return updateTransition(); }, useMutableSource: function (source, getSnapshot, subscribe) { currentHookNameInDev = 'useMutableSource'; warnInvalidHookAccess(); updateHookTypesDev(); return updateMutableSource(); }, useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) { currentHookNameInDev = 'useSyncExternalStore'; warnInvalidHookAccess(); updateHookTypesDev(); return updateSyncExternalStore(subscribe, getSnapshot); }, useId: function () { currentHookNameInDev = 'useId'; warnInvalidHookAccess(); updateHookTypesDev(); return updateId(); }, unstable_isNewReconciler: enableNewReconciler }; InvalidNestedHooksDispatcherOnRerenderInDEV = { readContext: function (context) { warnInvalidContextAccess(); return readContext(context); }, useCallback: function (callback, deps) { currentHookNameInDev = 'useCallback'; warnInvalidHookAccess(); updateHookTypesDev(); return updateCallback(callback, deps); }, useContext: function (context) { currentHookNameInDev = 'useContext'; warnInvalidHookAccess(); updateHookTypesDev(); return readContext(context); }, useEffect: function (create, deps) { currentHookNameInDev = 'useEffect'; warnInvalidHookAccess(); updateHookTypesDev(); return updateEffect(create, deps); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = 'useImperativeHandle'; warnInvalidHookAccess(); updateHookTypesDev(); return updateImperativeHandle(ref, create, deps); }, useInsertionEffect: function (create, deps) { currentHookNameInDev = 'useInsertionEffect'; warnInvalidHookAccess(); updateHookTypesDev(); return updateInsertionEffect(create, deps); }, useLayoutEffect: function (create, deps) { currentHookNameInDev = 'useLayoutEffect'; warnInvalidHookAccess(); updateHookTypesDev(); return updateLayoutEffect(create, deps); }, useMemo: function (create, deps) { currentHookNameInDev = 'useMemo'; warnInvalidHookAccess(); updateHookTypesDev(); var prevDispatcher = ReactCurrentDispatcher$1.current; ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; try { return updateMemo(create, deps); } finally { ReactCurrentDispatcher$1.current = prevDispatcher; } }, useReducer: function (reducer, initialArg, init) { currentHookNameInDev = 'useReducer'; warnInvalidHookAccess(); updateHookTypesDev(); var prevDispatcher = ReactCurrentDispatcher$1.current; ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; try { return rerenderReducer(reducer, initialArg, init); } finally { ReactCurrentDispatcher$1.current = prevDispatcher; } }, useRef: function (initialValue) { currentHookNameInDev = 'useRef'; warnInvalidHookAccess(); updateHookTypesDev(); return updateRef(); }, useState: function (initialState) { currentHookNameInDev = 'useState'; warnInvalidHookAccess(); updateHookTypesDev(); var prevDispatcher = ReactCurrentDispatcher$1.current; ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; try { return rerenderState(initialState); } finally { ReactCurrentDispatcher$1.current = prevDispatcher; } }, useDebugValue: function (value, formatterFn) { currentHookNameInDev = 'useDebugValue'; warnInvalidHookAccess(); updateHookTypesDev(); return updateDebugValue(); }, useDeferredValue: function (value) { currentHookNameInDev = 'useDeferredValue'; warnInvalidHookAccess(); updateHookTypesDev(); return rerenderDeferredValue(value); }, useTransition: function () { currentHookNameInDev = 'useTransition'; warnInvalidHookAccess(); updateHookTypesDev(); return rerenderTransition(); }, useMutableSource: function (source, getSnapshot, subscribe) { currentHookNameInDev = 'useMutableSource'; warnInvalidHookAccess(); updateHookTypesDev(); return updateMutableSource(); }, useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) { currentHookNameInDev = 'useSyncExternalStore'; warnInvalidHookAccess(); updateHookTypesDev(); return updateSyncExternalStore(subscribe, getSnapshot); }, useId: function () { currentHookNameInDev = 'useId'; warnInvalidHookAccess(); updateHookTypesDev(); return updateId(); }, unstable_isNewReconciler: enableNewReconciler }; } var now$1 = unstable_now; var commitTime = 0; var layoutEffectStartTime = -1; var profilerStartTime = -1; var passiveEffectStartTime = -1; /** * Tracks whether the current update was a nested/cascading update (scheduled from a layout effect). * * The overall sequence is: * 1. render * 2. commit (and call `onRender`, `onCommit`) * 3. check for nested updates * 4. flush passive effects (and call `onPostCommit`) * * Nested updates are identified in step 3 above, * but step 4 still applies to the work that was just committed. * We use two flags to track nested updates then: * one tracks whether the upcoming update is a nested update, * and the other tracks whether the current update was a nested update. * The first value gets synced to the second at the start of the render phase. */ var currentUpdateIsNested = false; var nestedUpdateScheduled = false; function isCurrentUpdateNested() { return currentUpdateIsNested; } function markNestedUpdateScheduled() { { nestedUpdateScheduled = true; } } function resetNestedUpdateFlag() { { currentUpdateIsNested = false; nestedUpdateScheduled = false; } } function syncNestedUpdateFlag() { { currentUpdateIsNested = nestedUpdateScheduled; nestedUpdateScheduled = false; } } function getCommitTime() { return commitTime; } function recordCommitTime() { commitTime = now$1(); } function startProfilerTimer(fiber) { profilerStartTime = now$1(); if (fiber.actualStartTime < 0) { fiber.actualStartTime = now$1(); } } function stopProfilerTimerIfRunning(fiber) { profilerStartTime = -1; } function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) { if (profilerStartTime >= 0) { var elapsedTime = now$1() - profilerStartTime; fiber.actualDuration += elapsedTime; if (overrideBaseTime) { fiber.selfBaseDuration = elapsedTime; } profilerStartTime = -1; } } function recordLayoutEffectDuration(fiber) { if (layoutEffectStartTime >= 0) { var elapsedTime = now$1() - layoutEffectStartTime; layoutEffectStartTime = -1; // Store duration on the next nearest Profiler ancestor // Or the root (for the DevTools Profiler to read) var parentFiber = fiber.return; while (parentFiber !== null) { switch (parentFiber.tag) { case HostRoot: var root = parentFiber.stateNode; root.effectDuration += elapsedTime; return; case Profiler: var parentStateNode = parentFiber.stateNode; parentStateNode.effectDuration += elapsedTime; return; } parentFiber = parentFiber.return; } } } function recordPassiveEffectDuration(fiber) { if (passiveEffectStartTime >= 0) { var elapsedTime = now$1() - passiveEffectStartTime; passiveEffectStartTime = -1; // Store duration on the next nearest Profiler ancestor // Or the root (for the DevTools Profiler to read) var parentFiber = fiber.return; while (parentFiber !== null) { switch (parentFiber.tag) { case HostRoot: var root = parentFiber.stateNode; if (root !== null) { root.passiveEffectDuration += elapsedTime; } return; case Profiler: var parentStateNode = parentFiber.stateNode; if (parentStateNode !== null) { // Detached fibers have their state node cleared out. // In this case, the return pointer is also cleared out, // so we won't be able to report the time spent in this Profiler's subtree. parentStateNode.passiveEffectDuration += elapsedTime; } return; } parentFiber = parentFiber.return; } } } function startLayoutEffectTimer() { layoutEffectStartTime = now$1(); } function startPassiveEffectTimer() { passiveEffectStartTime = now$1(); } function transferActualDuration(fiber) { // Transfer time spent rendering these children so we don't lose it // after we rerender. This is used as a helper in special cases // where we should count the work of multiple passes. var child = fiber.child; while (child) { fiber.actualDuration += child.actualDuration; child = child.sibling; } } function resolveDefaultProps(Component, baseProps) { if (Component && Component.defaultProps) { // Resolve default props. Taken from ReactElement var props = assign({}, baseProps); var defaultProps = Component.defaultProps; for (var propName in defaultProps) { if (props[propName] === undefined) { props[propName] = defaultProps[propName]; } } return props; } return baseProps; } var fakeInternalInstance = {}; var didWarnAboutStateAssignmentForComponent; var didWarnAboutUninitializedState; var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate; var didWarnAboutLegacyLifecyclesAndDerivedState; var didWarnAboutUndefinedDerivedState; var warnOnUndefinedDerivedState; var warnOnInvalidCallback; var didWarnAboutDirectlyAssigningPropsToState; var didWarnAboutContextTypeAndContextTypes; var didWarnAboutInvalidateContextType; var didWarnAboutLegacyContext$1; { didWarnAboutStateAssignmentForComponent = new Set(); didWarnAboutUninitializedState = new Set(); didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set(); didWarnAboutLegacyLifecyclesAndDerivedState = new Set(); didWarnAboutDirectlyAssigningPropsToState = new Set(); didWarnAboutUndefinedDerivedState = new Set(); didWarnAboutContextTypeAndContextTypes = new Set(); didWarnAboutInvalidateContextType = new Set(); didWarnAboutLegacyContext$1 = new Set(); var didWarnOnInvalidCallback = new Set(); warnOnInvalidCallback = function (callback, callerName) { if (callback === null || typeof callback === 'function') { return; } var key = callerName + '_' + callback; if (!didWarnOnInvalidCallback.has(key)) { didWarnOnInvalidCallback.add(key); error('%s(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callerName, callback); } }; warnOnUndefinedDerivedState = function (type, partialState) { if (partialState === undefined) { var componentName = getComponentNameFromType(type) || 'Component'; if (!didWarnAboutUndefinedDerivedState.has(componentName)) { didWarnAboutUndefinedDerivedState.add(componentName); error('%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. ' + 'You have returned undefined.', componentName); } } }; // This is so gross but it's at least non-critical and can be removed if // it causes problems. This is meant to give a nicer error message for // ReactDOM15.unstable_renderSubtreeIntoContainer(reactDOM16Component, // ...)) which otherwise throws a "_processChildContext is not a function" // exception. Object.defineProperty(fakeInternalInstance, '_processChildContext', { enumerable: false, value: function () { throw new Error('_processChildContext is not available in React 16+. This likely ' + 'means you have multiple copies of React and are attempting to nest ' + 'a React 15 tree inside a React 16 tree using ' + "unstable_renderSubtreeIntoContainer, which isn't supported. Try " + 'to make sure you have only one copy of React (and ideally, switch ' + 'to ReactDOM.createPortal).'); } }); Object.freeze(fakeInternalInstance); } function applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, nextProps) { var prevState = workInProgress.memoizedState; var partialState = getDerivedStateFromProps(nextProps, prevState); { if ( workInProgress.mode & StrictLegacyMode) { setIsStrictModeForDevtools(true); try { // Invoke the function an extra time to help detect side-effects. partialState = getDerivedStateFromProps(nextProps, prevState); } finally { setIsStrictModeForDevtools(false); } } warnOnUndefinedDerivedState(ctor, partialState); } // Merge the partial state and the previous state. var memoizedState = partialState === null || partialState === undefined ? prevState : assign({}, prevState, partialState); workInProgress.memoizedState = memoizedState; // Once the update queue is empty, persist the derived state onto the // base state. if (workInProgress.lanes === NoLanes) { // Queue is always non-null for classes var updateQueue = workInProgress.updateQueue; updateQueue.baseState = memoizedState; } } var classComponentUpdater = { isMounted: isMounted, enqueueSetState: function (inst, payload, callback) { var fiber = get(inst); var eventTime = requestEventTime(); var lane = requestUpdateLane(fiber); var update = createUpdate(eventTime, lane); update.payload = payload; if (callback !== undefined && callback !== null) { { warnOnInvalidCallback(callback, 'setState'); } update.callback = callback; } var root = enqueueUpdate(fiber, update, lane); if (root !== null) { scheduleUpdateOnFiber(root, fiber, lane, eventTime); entangleTransitions(root, fiber, lane); } { markStateUpdateScheduled(fiber, lane); } }, enqueueReplaceState: function (inst, payload, callback) { var fiber = get(inst); var eventTime = requestEventTime(); var lane = requestUpdateLane(fiber); var update = createUpdate(eventTime, lane); update.tag = ReplaceState; update.payload = payload; if (callback !== undefined && callback !== null) { { warnOnInvalidCallback(callback, 'replaceState'); } update.callback = callback; } var root = enqueueUpdate(fiber, update, lane); if (root !== null) { scheduleUpdateOnFiber(root, fiber, lane, eventTime); entangleTransitions(root, fiber, lane); } { markStateUpdateScheduled(fiber, lane); } }, enqueueForceUpdate: function (inst, callback) { var fiber = get(inst); var eventTime = requestEventTime(); var lane = requestUpdateLane(fiber); var update = createUpdate(eventTime, lane); update.tag = ForceUpdate; if (callback !== undefined && callback !== null) { { warnOnInvalidCallback(callback, 'forceUpdate'); } update.callback = callback; } var root = enqueueUpdate(fiber, update, lane); if (root !== null) { scheduleUpdateOnFiber(root, fiber, lane, eventTime); entangleTransitions(root, fiber, lane); } { markForceUpdateScheduled(fiber, lane); } } }; function checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext) { var instance = workInProgress.stateNode; if (typeof instance.shouldComponentUpdate === 'function') { var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, nextContext); { if ( workInProgress.mode & StrictLegacyMode) { setIsStrictModeForDevtools(true); try { // Invoke the function an extra time to help detect side-effects. shouldUpdate = instance.shouldComponentUpdate(newProps, newState, nextContext); } finally { setIsStrictModeForDevtools(false); } } if (shouldUpdate === undefined) { error('%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', getComponentNameFromType(ctor) || 'Component'); } } return shouldUpdate; } if (ctor.prototype && ctor.prototype.isPureReactComponent) { return !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState); } return true; } function checkClassInstance(workInProgress, ctor, newProps) { var instance = workInProgress.stateNode; { var name = getComponentNameFromType(ctor) || 'Component'; var renderPresent = instance.render; if (!renderPresent) { if (ctor.prototype && typeof ctor.prototype.render === 'function') { error('%s(...): No `render` method found on the returned component ' + 'instance: did you accidentally return an object from the constructor?', name); } else { error('%s(...): No `render` method found on the returned component ' + 'instance: you may have forgotten to define `render`.', name); } } if (instance.getInitialState && !instance.getInitialState.isReactClassApproved && !instance.state) { error('getInitialState was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Did you mean to define a state property instead?', name); } if (instance.getDefaultProps && !instance.getDefaultProps.isReactClassApproved) { error('getDefaultProps was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Use a static property to define defaultProps instead.', name); } if (instance.propTypes) { error('propTypes was defined as an instance property on %s. Use a static ' + 'property to define propTypes instead.', name); } if (instance.contextType) { error('contextType was defined as an instance property on %s. Use a static ' + 'property to define contextType instead.', name); } { if (ctor.childContextTypes && !didWarnAboutLegacyContext$1.has(ctor) && // Strict Mode has its own warning for legacy context, so we can skip // this one. (workInProgress.mode & StrictLegacyMode) === NoMode) { didWarnAboutLegacyContext$1.add(ctor); error('%s uses the legacy childContextTypes API which is no longer ' + 'supported and will be removed in the next major release. Use ' + 'React.createContext() instead\n\n.' + 'Learn more about this warning here: https://reactjs.org/link/legacy-context', name); } if (ctor.contextTypes && !didWarnAboutLegacyContext$1.has(ctor) && // Strict Mode has its own warning for legacy context, so we can skip // this one. (workInProgress.mode & StrictLegacyMode) === NoMode) { didWarnAboutLegacyContext$1.add(ctor); error('%s uses the legacy contextTypes API which is no longer supported ' + 'and will be removed in the next major release. Use ' + 'React.createContext() with static contextType instead.\n\n' + 'Learn more about this warning here: https://reactjs.org/link/legacy-context', name); } if (instance.contextTypes) { error('contextTypes was defined as an instance property on %s. Use a static ' + 'property to define contextTypes instead.', name); } if (ctor.contextType && ctor.contextTypes && !didWarnAboutContextTypeAndContextTypes.has(ctor)) { didWarnAboutContextTypeAndContextTypes.add(ctor); error('%s declares both contextTypes and contextType static properties. ' + 'The legacy contextTypes property will be ignored.', name); } } if (typeof instance.componentShouldUpdate === 'function') { error('%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', name); } if (ctor.prototype && ctor.prototype.isPureReactComponent && typeof instance.shouldComponentUpdate !== 'undefined') { error('%s has a method called shouldComponentUpdate(). ' + 'shouldComponentUpdate should not be used when extending React.PureComponent. ' + 'Please extend React.Component if shouldComponentUpdate is used.', getComponentNameFromType(ctor) || 'A pure component'); } if (typeof instance.componentDidUnmount === 'function') { error('%s has a method called ' + 'componentDidUnmount(). But there is no such lifecycle method. ' + 'Did you mean componentWillUnmount()?', name); } if (typeof instance.componentDidReceiveProps === 'function') { error('%s has a method called ' + 'componentDidReceiveProps(). But there is no such lifecycle method. ' + 'If you meant to update the state in response to changing props, ' + 'use componentWillReceiveProps(). If you meant to fetch data or ' + 'run side-effects or mutations after React has updated the UI, use componentDidUpdate().', name); } if (typeof instance.componentWillRecieveProps === 'function') { error('%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', name); } if (typeof instance.UNSAFE_componentWillRecieveProps === 'function') { error('%s has a method called ' + 'UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?', name); } var hasMutatedProps = instance.props !== newProps; if (instance.props !== undefined && hasMutatedProps) { error('%s(...): When calling super() in `%s`, make sure to pass ' + "up the same props that your component's constructor was passed.", name, name); } if (instance.defaultProps) { error('Setting defaultProps as an instance property on %s is not supported and will be ignored.' + ' Instead, define defaultProps as a static property on %s.', name, name); } if (typeof instance.getSnapshotBeforeUpdate === 'function' && typeof instance.componentDidUpdate !== 'function' && !didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(ctor)) { didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(ctor); error('%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). ' + 'This component defines getSnapshotBeforeUpdate() only.', getComponentNameFromType(ctor)); } if (typeof instance.getDerivedStateFromProps === 'function') { error('%s: getDerivedStateFromProps() is defined as an instance method ' + 'and will be ignored. Instead, declare it as a static method.', name); } if (typeof instance.getDerivedStateFromError === 'function') { error('%s: getDerivedStateFromError() is defined as an instance method ' + 'and will be ignored. Instead, declare it as a static method.', name); } if (typeof ctor.getSnapshotBeforeUpdate === 'function') { error('%s: getSnapshotBeforeUpdate() is defined as a static method ' + 'and will be ignored. Instead, declare it as an instance method.', name); } var _state = instance.state; if (_state && (typeof _state !== 'object' || isArray(_state))) { error('%s.state: must be set to an object or null', name); } if (typeof instance.getChildContext === 'function' && typeof ctor.childContextTypes !== 'object') { error('%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', name); } } } function adoptClassInstance(workInProgress, instance) { instance.updater = classComponentUpdater; workInProgress.stateNode = instance; // The instance needs access to the fiber so that it can schedule updates set(instance, workInProgress); { instance._reactInternalInstance = fakeInternalInstance; } } function constructClassInstance(workInProgress, ctor, props) { var isLegacyContextConsumer = false; var unmaskedContext = emptyContextObject; var context = emptyContextObject; var contextType = ctor.contextType; { if ('contextType' in ctor) { var isValid = // Allow null for conditional declaration contextType === null || contextType !== undefined && contextType.$$typeof === REACT_CONTEXT_TYPE && contextType._context === undefined; // Not a <Context.Consumer> if (!isValid && !didWarnAboutInvalidateContextType.has(ctor)) { didWarnAboutInvalidateContextType.add(ctor); var addendum = ''; if (contextType === undefined) { addendum = ' However, it is set to undefined. ' + 'This can be caused by a typo or by mixing up named and default imports. ' + 'This can also happen due to a circular dependency, so ' + 'try moving the createContext() call to a separate file.'; } else if (typeof contextType !== 'object') { addendum = ' However, it is set to a ' + typeof contextType + '.'; } else if (contextType.$$typeof === REACT_PROVIDER_TYPE) { addendum = ' Did you accidentally pass the Context.Provider instead?'; } else if (contextType._context !== undefined) { // <Context.Consumer> addendum = ' Did you accidentally pass the Context.Consumer instead?'; } else { addendum = ' However, it is set to an object with keys {' + Object.keys(contextType).join(', ') + '}.'; } error('%s defines an invalid contextType. ' + 'contextType should point to the Context object returned by React.createContext().%s', getComponentNameFromType(ctor) || 'Component', addendum); } } } if (typeof contextType === 'object' && contextType !== null) { context = readContext(contextType); } else { unmaskedContext = getUnmaskedContext(workInProgress, ctor, true); var contextTypes = ctor.contextTypes; isLegacyContextConsumer = contextTypes !== null && contextTypes !== undefined; context = isLegacyContextConsumer ? getMaskedContext(workInProgress, unmaskedContext) : emptyContextObject; } var instance = new ctor(props, context); // Instantiate twice to help detect side-effects. { if ( workInProgress.mode & StrictLegacyMode) { setIsStrictModeForDevtools(true); try { instance = new ctor(props, context); // eslint-disable-line no-new } finally { setIsStrictModeForDevtools(false); } } } var state = workInProgress.memoizedState = instance.state !== null && instance.state !== undefined ? instance.state : null; adoptClassInstance(workInProgress, instance); { if (typeof ctor.getDerivedStateFromProps === 'function' && state === null) { var componentName = getComponentNameFromType(ctor) || 'Component'; if (!didWarnAboutUninitializedState.has(componentName)) { didWarnAboutUninitializedState.add(componentName); error('`%s` uses `getDerivedStateFromProps` but its initial state is ' + '%s. This is not recommended. Instead, define the initial state by ' + 'assigning an object to `this.state` in the constructor of `%s`. ' + 'This ensures that `getDerivedStateFromProps` arguments have a consistent shape.', componentName, instance.state === null ? 'null' : 'undefined', componentName); } } // If new component APIs are defined, "unsafe" lifecycles won't be called. // Warn about these lifecycles if they are present. // Don't warn about react-lifecycles-compat polyfilled methods though. if (typeof ctor.getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function') { var foundWillMountName = null; var foundWillReceivePropsName = null; var foundWillUpdateName = null; if (typeof instance.componentWillMount === 'function' && instance.componentWillMount.__suppressDeprecationWarning !== true) { foundWillMountName = 'componentWillMount'; } else if (typeof instance.UNSAFE_componentWillMount === 'function') { foundWillMountName = 'UNSAFE_componentWillMount'; } if (typeof instance.componentWillReceiveProps === 'function' && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) { foundWillReceivePropsName = 'componentWillReceiveProps'; } else if (typeof instance.UNSAFE_componentWillReceiveProps === 'function') { foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps'; } if (typeof instance.componentWillUpdate === 'function' && instance.componentWillUpdate.__suppressDeprecationWarning !== true) { foundWillUpdateName = 'componentWillUpdate'; } else if (typeof instance.UNSAFE_componentWillUpdate === 'function') { foundWillUpdateName = 'UNSAFE_componentWillUpdate'; } if (foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null) { var _componentName = getComponentNameFromType(ctor) || 'Component'; var newApiName = typeof ctor.getDerivedStateFromProps === 'function' ? 'getDerivedStateFromProps()' : 'getSnapshotBeforeUpdate()'; if (!didWarnAboutLegacyLifecyclesAndDerivedState.has(_componentName)) { didWarnAboutLegacyLifecyclesAndDerivedState.add(_componentName); error('Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n' + '%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\n' + 'The above lifecycles should be removed. Learn more about this warning here:\n' + 'https://reactjs.org/link/unsafe-component-lifecycles', _componentName, newApiName, foundWillMountName !== null ? "\n " + foundWillMountName : '', foundWillReceivePropsName !== null ? "\n " + foundWillReceivePropsName : '', foundWillUpdateName !== null ? "\n " + foundWillUpdateName : ''); } } } } // Cache unmasked context so we can avoid recreating masked context unless necessary. // ReactFiberContext usually updates this cache but can't for newly-created instances. if (isLegacyContextConsumer) { cacheContext(workInProgress, unmaskedContext, context); } return instance; } function callComponentWillMount(workInProgress, instance) { var oldState = instance.state; if (typeof instance.componentWillMount === 'function') { instance.componentWillMount(); } if (typeof instance.UNSAFE_componentWillMount === 'function') { instance.UNSAFE_componentWillMount(); } if (oldState !== instance.state) { { error('%s.componentWillMount(): Assigning directly to this.state is ' + "deprecated (except inside a component's " + 'constructor). Use setState instead.', getComponentNameFromFiber(workInProgress) || 'Component'); } classComponentUpdater.enqueueReplaceState(instance, instance.state, null); } } function callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext) { var oldState = instance.state; if (typeof instance.componentWillReceiveProps === 'function') { instance.componentWillReceiveProps(newProps, nextContext); } if (typeof instance.UNSAFE_componentWillReceiveProps === 'function') { instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); } if (instance.state !== oldState) { { var componentName = getComponentNameFromFiber(workInProgress) || 'Component'; if (!didWarnAboutStateAssignmentForComponent.has(componentName)) { didWarnAboutStateAssignmentForComponent.add(componentName); error('%s.componentWillReceiveProps(): Assigning directly to ' + "this.state is deprecated (except inside a component's " + 'constructor). Use setState instead.', componentName); } } classComponentUpdater.enqueueReplaceState(instance, instance.state, null); } } // Invokes the mount life-cycles on a previously never rendered instance. function mountClassInstance(workInProgress, ctor, newProps, renderLanes) { { checkClassInstance(workInProgress, ctor, newProps); } var instance = workInProgress.stateNode; instance.props = newProps; instance.state = workInProgress.memoizedState; instance.refs = {}; initializeUpdateQueue(workInProgress); var contextType = ctor.contextType; if (typeof contextType === 'object' && contextType !== null) { instance.context = readContext(contextType); } else { var unmaskedContext = getUnmaskedContext(workInProgress, ctor, true); instance.context = getMaskedContext(workInProgress, unmaskedContext); } { if (instance.state === newProps) { var componentName = getComponentNameFromType(ctor) || 'Component'; if (!didWarnAboutDirectlyAssigningPropsToState.has(componentName)) { didWarnAboutDirectlyAssigningPropsToState.add(componentName); error('%s: It is not recommended to assign props directly to state ' + "because updates to props won't be reflected in state. " + 'In most cases, it is better to use props directly.', componentName); } } if (workInProgress.mode & StrictLegacyMode) { ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress, instance); } { ReactStrictModeWarnings.recordUnsafeLifecycleWarnings(workInProgress, instance); } } instance.state = workInProgress.memoizedState; var getDerivedStateFromProps = ctor.getDerivedStateFromProps; if (typeof getDerivedStateFromProps === 'function') { applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps); instance.state = workInProgress.memoizedState; } // In order to support react-lifecycles-compat polyfilled components, // Unsafe lifecycles should not be invoked for components using the new APIs. if (typeof ctor.getDerivedStateFromProps !== 'function' && typeof instance.getSnapshotBeforeUpdate !== 'function' && (typeof instance.UNSAFE_componentWillMount === 'function' || typeof instance.componentWillMount === 'function')) { callComponentWillMount(workInProgress, instance); // If we had additional state updates during this life-cycle, let's // process them now. processUpdateQueue(workInProgress, newProps, instance, renderLanes); instance.state = workInProgress.memoizedState; } if (typeof instance.componentDidMount === 'function') { var fiberFlags = Update; { fiberFlags |= LayoutStatic; } if ( (workInProgress.mode & StrictEffectsMode) !== NoMode) { fiberFlags |= MountLayoutDev; } workInProgress.flags |= fiberFlags; } } function resumeMountClassInstance(workInProgress, ctor, newProps, renderLanes) { var instance = workInProgress.stateNode; var oldProps = workInProgress.memoizedProps; instance.props = oldProps; var oldContext = instance.context; var contextType = ctor.contextType; var nextContext = emptyContextObject; if (typeof contextType === 'object' && contextType !== null) { nextContext = readContext(contextType); } else { var nextLegacyUnmaskedContext = getUnmaskedContext(workInProgress, ctor, true); nextContext = getMaskedContext(workInProgress, nextLegacyUnmaskedContext); } var getDerivedStateFromProps = ctor.getDerivedStateFromProps; var hasNewLifecycles = typeof getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function'; // Note: During these life-cycles, instance.props/instance.state are what // ever the previously attempted to render - not the "current". However, // during componentDidUpdate we pass the "current" props. // In order to support react-lifecycles-compat polyfilled components, // Unsafe lifecycles should not be invoked for components using the new APIs. if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === 'function' || typeof instance.componentWillReceiveProps === 'function')) { if (oldProps !== newProps || oldContext !== nextContext) { callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext); } } resetHasForceUpdateBeforeProcessing(); var oldState = workInProgress.memoizedState; var newState = instance.state = oldState; processUpdateQueue(workInProgress, newProps, instance, renderLanes); newState = workInProgress.memoizedState; if (oldProps === newProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) { // If an update was already in progress, we should schedule an Update // effect even though we're bailing out, so that cWU/cDU are called. if (typeof instance.componentDidMount === 'function') { var fiberFlags = Update; { fiberFlags |= LayoutStatic; } if ( (workInProgress.mode & StrictEffectsMode) !== NoMode) { fiberFlags |= MountLayoutDev; } workInProgress.flags |= fiberFlags; } return false; } if (typeof getDerivedStateFromProps === 'function') { applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps); newState = workInProgress.memoizedState; } var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext); if (shouldUpdate) { // In order to support react-lifecycles-compat polyfilled components, // Unsafe lifecycles should not be invoked for components using the new APIs. if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillMount === 'function' || typeof instance.componentWillMount === 'function')) { if (typeof instance.componentWillMount === 'function') { instance.componentWillMount(); } if (typeof instance.UNSAFE_componentWillMount === 'function') { instance.UNSAFE_componentWillMount(); } } if (typeof instance.componentDidMount === 'function') { var _fiberFlags = Update; { _fiberFlags |= LayoutStatic; } if ( (workInProgress.mode & StrictEffectsMode) !== NoMode) { _fiberFlags |= MountLayoutDev; } workInProgress.flags |= _fiberFlags; } } else { // If an update was already in progress, we should schedule an Update // effect even though we're bailing out, so that cWU/cDU are called. if (typeof instance.componentDidMount === 'function') { var _fiberFlags2 = Update; { _fiberFlags2 |= LayoutStatic; } if ( (workInProgress.mode & StrictEffectsMode) !== NoMode) { _fiberFlags2 |= MountLayoutDev; } workInProgress.flags |= _fiberFlags2; } // If shouldComponentUpdate returned false, we should still update the // memoized state to indicate that this work can be reused. workInProgress.memoizedProps = newProps; workInProgress.memoizedState = newState; } // Update the existing instance's state, props, and context pointers even // if shouldComponentUpdate returns false. instance.props = newProps; instance.state = newState; instance.context = nextContext; return shouldUpdate; } // Invokes the update life-cycles and returns false if it shouldn't rerender. function updateClassInstance(current, workInProgress, ctor, newProps, renderLanes) { var instance = workInProgress.stateNode; cloneUpdateQueue(current, workInProgress); var unresolvedOldProps = workInProgress.memoizedProps; var oldProps = workInProgress.type === workInProgress.elementType ? unresolvedOldProps : resolveDefaultProps(workInProgress.type, unresolvedOldProps); instance.props = oldProps; var unresolvedNewProps = workInProgress.pendingProps; var oldContext = instance.context; var contextType = ctor.contextType; var nextContext = emptyContextObject; if (typeof contextType === 'object' && contextType !== null) { nextContext = readContext(contextType); } else { var nextUnmaskedContext = getUnmaskedContext(workInProgress, ctor, true); nextContext = getMaskedContext(workInProgress, nextUnmaskedContext); } var getDerivedStateFromProps = ctor.getDerivedStateFromProps; var hasNewLifecycles = typeof getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function'; // Note: During these life-cycles, instance.props/instance.state are what // ever the previously attempted to render - not the "current". However, // during componentDidUpdate we pass the "current" props. // In order to support react-lifecycles-compat polyfilled components, // Unsafe lifecycles should not be invoked for components using the new APIs. if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === 'function' || typeof instance.componentWillReceiveProps === 'function')) { if (unresolvedOldProps !== unresolvedNewProps || oldContext !== nextContext) { callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext); } } resetHasForceUpdateBeforeProcessing(); var oldState = workInProgress.memoizedState; var newState = instance.state = oldState; processUpdateQueue(workInProgress, newProps, instance, renderLanes); newState = workInProgress.memoizedState; if (unresolvedOldProps === unresolvedNewProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing() && !(enableLazyContextPropagation )) { // If an update was already in progress, we should schedule an Update // effect even though we're bailing out, so that cWU/cDU are called. if (typeof instance.componentDidUpdate === 'function') { if (unresolvedOldProps !== current.memoizedProps || oldState !== current.memoizedState) { workInProgress.flags |= Update; } } if (typeof instance.getSnapshotBeforeUpdate === 'function') { if (unresolvedOldProps !== current.memoizedProps || oldState !== current.memoizedState) { workInProgress.flags |= Snapshot; } } return false; } if (typeof getDerivedStateFromProps === 'function') { applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps); newState = workInProgress.memoizedState; } var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext) || // TODO: In some cases, we'll end up checking if context has changed twice, // both before and after `shouldComponentUpdate` has been called. Not ideal, // but I'm loath to refactor this function. This only happens for memoized // components so it's not that common. enableLazyContextPropagation ; if (shouldUpdate) { // In order to support react-lifecycles-compat polyfilled components, // Unsafe lifecycles should not be invoked for components using the new APIs. if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillUpdate === 'function' || typeof instance.componentWillUpdate === 'function')) { if (typeof instance.componentWillUpdate === 'function') { instance.componentWillUpdate(newProps, newState, nextContext); } if (typeof instance.UNSAFE_componentWillUpdate === 'function') { instance.UNSAFE_componentWillUpdate(newProps, newState, nextContext); } } if (typeof instance.componentDidUpdate === 'function') { workInProgress.flags |= Update; } if (typeof instance.getSnapshotBeforeUpdate === 'function') { workInProgress.flags |= Snapshot; } } else { // If an update was already in progress, we should schedule an Update // effect even though we're bailing out, so that cWU/cDU are called. if (typeof instance.componentDidUpdate === 'function') { if (unresolvedOldProps !== current.memoizedProps || oldState !== current.memoizedState) { workInProgress.flags |= Update; } } if (typeof instance.getSnapshotBeforeUpdate === 'function') { if (unresolvedOldProps !== current.memoizedProps || oldState !== current.memoizedState) { workInProgress.flags |= Snapshot; } } // If shouldComponentUpdate returned false, we should still update the // memoized props/state to indicate that this work can be reused. workInProgress.memoizedProps = newProps; workInProgress.memoizedState = newState; } // Update the existing instance's state, props, and context pointers even // if shouldComponentUpdate returns false. instance.props = newProps; instance.state = newState; instance.context = nextContext; return shouldUpdate; } function createCapturedValueAtFiber(value, source) { // If the value is an error, call this function immediately after it is thrown // so the stack is accurate. return { value: value, source: source, stack: getStackByFiberInDevAndProd(source), digest: null }; } function createCapturedValue(value, digest, stack) { return { value: value, source: null, stack: stack != null ? stack : null, digest: digest != null ? digest : null }; } // This module is forked in different environments. // By default, return `true` to log errors to the console. // Forks can return `false` if this isn't desirable. function showErrorDialog(boundary, errorInfo) { return true; } function logCapturedError(boundary, errorInfo) { try { var logError = showErrorDialog(boundary, errorInfo); // Allow injected showErrorDialog() to prevent default console.error logging. // This enables renderers like ReactNative to better manage redbox behavior. if (logError === false) { return; } var error = errorInfo.value; if (true) { var source = errorInfo.source; var stack = errorInfo.stack; var componentStack = stack !== null ? stack : ''; // Browsers support silencing uncaught errors by calling // `preventDefault()` in window `error` handler. // We record this information as an expando on the error. if (error != null && error._suppressLogging) { if (boundary.tag === ClassComponent) { // The error is recoverable and was silenced. // Ignore it and don't print the stack addendum. // This is handy for testing error boundaries without noise. return; } // The error is fatal. Since the silencing might have // been accidental, we'll surface it anyway. // However, the browser would have silenced the original error // so we'll print it first, and then print the stack addendum. console['error'](error); // Don't transform to our wrapper // For a more detailed description of this block, see: // https://github.com/facebook/react/pull/13384 } var componentName = source ? getComponentNameFromFiber(source) : null; var componentNameMessage = componentName ? "The above error occurred in the <" + componentName + "> component:" : 'The above error occurred in one of your React components:'; var errorBoundaryMessage; if (boundary.tag === HostRoot) { errorBoundaryMessage = 'Consider adding an error boundary to your tree to customize error handling behavior.\n' + 'Visit https://reactjs.org/link/error-boundaries to learn more about error boundaries.'; } else { var errorBoundaryName = getComponentNameFromFiber(boundary) || 'Anonymous'; errorBoundaryMessage = "React will try to recreate this component tree from scratch " + ("using the error boundary you provided, " + errorBoundaryName + "."); } var combinedMessage = componentNameMessage + "\n" + componentStack + "\n\n" + ("" + errorBoundaryMessage); // In development, we provide our own message with just the component stack. // We don't include the original error message and JS stack because the browser // has already printed it. Even if the application swallows the error, it is still // displayed by the browser thanks to the DEV-only fake event trick in ReactErrorUtils. console['error'](combinedMessage); // Don't transform to our wrapper } else { // In production, we print the error directly. // This will include the message, the JS stack, and anything the browser wants to show. // We pass the error object instead of custom message so that the browser displays the error natively. console['error'](error); // Don't transform to our wrapper } } catch (e) { // This method must not throw, or React internal state will get messed up. // If console.error is overridden, or logCapturedError() shows a dialog that throws, // we want to report this error outside of the normal stack as a last resort. // https://github.com/facebook/react/issues/13188 setTimeout(function () { throw e; }); } } var PossiblyWeakMap$1 = typeof WeakMap === 'function' ? WeakMap : Map; function createRootErrorUpdate(fiber, errorInfo, lane) { var update = createUpdate(NoTimestamp, lane); // Unmount the root by rendering null. update.tag = CaptureUpdate; // Caution: React DevTools currently depends on this property // being called "element". update.payload = { element: null }; var error = errorInfo.value; update.callback = function () { onUncaughtError(error); logCapturedError(fiber, errorInfo); }; return update; } function createClassErrorUpdate(fiber, errorInfo, lane) { var update = createUpdate(NoTimestamp, lane); update.tag = CaptureUpdate; var getDerivedStateFromError = fiber.type.getDerivedStateFromError; if (typeof getDerivedStateFromError === 'function') { var error$1 = errorInfo.value; update.payload = function () { return getDerivedStateFromError(error$1); }; update.callback = function () { { markFailedErrorBoundaryForHotReloading(fiber); } logCapturedError(fiber, errorInfo); }; } var inst = fiber.stateNode; if (inst !== null && typeof inst.componentDidCatch === 'function') { update.callback = function callback() { { markFailedErrorBoundaryForHotReloading(fiber); } logCapturedError(fiber, errorInfo); if (typeof getDerivedStateFromError !== 'function') { // To preserve the preexisting retry behavior of error boundaries, // we keep track of which ones already failed during this batch. // This gets reset before we yield back to the browser. // TODO: Warn in strict mode if getDerivedStateFromError is // not defined. markLegacyErrorBoundaryAsFailed(this); } var error$1 = errorInfo.value; var stack = errorInfo.stack; this.componentDidCatch(error$1, { componentStack: stack !== null ? stack : '' }); { if (typeof getDerivedStateFromError !== 'function') { // If componentDidCatch is the only error boundary method defined, // then it needs to call setState to recover from errors. // If no state update is scheduled then the boundary will swallow the error. if (!includesSomeLane(fiber.lanes, SyncLane)) { error('%s: Error boundaries should implement getDerivedStateFromError(). ' + 'In that method, return a state update to display an error message or fallback UI.', getComponentNameFromFiber(fiber) || 'Unknown'); } } } }; } return update; } function attachPingListener(root, wakeable, lanes) { // Attach a ping listener // // The data might resolve before we have a chance to commit the fallback. Or, // in the case of a refresh, we'll never commit a fallback. So we need to // attach a listener now. When it resolves ("pings"), we can decide whether to // try rendering the tree again. // // Only attach a listener if one does not already exist for the lanes // we're currently rendering (which acts like a "thread ID" here). // // We only need to do this in concurrent mode. Legacy Suspense always // commits fallbacks synchronously, so there are no pings. var pingCache = root.pingCache; var threadIDs; if (pingCache === null) { pingCache = root.pingCache = new PossiblyWeakMap$1(); threadIDs = new Set(); pingCache.set(wakeable, threadIDs); } else { threadIDs = pingCache.get(wakeable); if (threadIDs === undefined) { threadIDs = new Set(); pingCache.set(wakeable, threadIDs); } } if (!threadIDs.has(lanes)) { // Memoize using the thread ID to prevent redundant listeners. threadIDs.add(lanes); var ping = pingSuspendedRoot.bind(null, root, wakeable, lanes); { if (isDevToolsPresent) { // If we have pending work still, restore the original updaters restorePendingUpdaters(root, lanes); } } wakeable.then(ping, ping); } } function attachRetryListener(suspenseBoundary, root, wakeable, lanes) { // Retry listener // // If the fallback does commit, we need to attach a different type of // listener. This one schedules an update on the Suspense boundary to turn // the fallback state off. // // Stash the wakeable on the boundary fiber so we can access it in the // commit phase. // // When the wakeable resolves, we'll attempt to render the boundary // again ("retry"). var wakeables = suspenseBoundary.updateQueue; if (wakeables === null) { var updateQueue = new Set(); updateQueue.add(wakeable); suspenseBoundary.updateQueue = updateQueue; } else { wakeables.add(wakeable); } } function resetSuspendedComponent(sourceFiber, rootRenderLanes) { // A legacy mode Suspense quirk, only relevant to hook components. var tag = sourceFiber.tag; if ((sourceFiber.mode & ConcurrentMode) === NoMode && (tag === FunctionComponent || tag === ForwardRef || tag === SimpleMemoComponent)) { var currentSource = sourceFiber.alternate; if (currentSource) { sourceFiber.updateQueue = currentSource.updateQueue; sourceFiber.memoizedState = currentSource.memoizedState; sourceFiber.lanes = currentSource.lanes; } else { sourceFiber.updateQueue = null; sourceFiber.memoizedState = null; } } } function getNearestSuspenseBoundaryToCapture(returnFiber) { var node = returnFiber; do { if (node.tag === SuspenseComponent && shouldCaptureSuspense(node)) { return node; } // This boundary already captured during this render. Continue to the next // boundary. node = node.return; } while (node !== null); return null; } function markSuspenseBoundaryShouldCapture(suspenseBoundary, returnFiber, sourceFiber, root, rootRenderLanes) { // This marks a Suspense boundary so that when we're unwinding the stack, // it captures the suspended "exception" and does a second (fallback) pass. if ((suspenseBoundary.mode & ConcurrentMode) === NoMode) { // Legacy Mode Suspense // // If the boundary is in legacy mode, we should *not* // suspend the commit. Pretend as if the suspended component rendered // null and keep rendering. When the Suspense boundary completes, // we'll do a second pass to render the fallback. if (suspenseBoundary === returnFiber) { // Special case where we suspended while reconciling the children of // a Suspense boundary's inner Offscreen wrapper fiber. This happens // when a React.lazy component is a direct child of a // Suspense boundary. // // Suspense boundaries are implemented as multiple fibers, but they // are a single conceptual unit. The legacy mode behavior where we // pretend the suspended fiber committed as `null` won't work, // because in this case the "suspended" fiber is the inner // Offscreen wrapper. // // Because the contents of the boundary haven't started rendering // yet (i.e. nothing in the tree has partially rendered) we can // switch to the regular, concurrent mode behavior: mark the // boundary with ShouldCapture and enter the unwind phase. suspenseBoundary.flags |= ShouldCapture; } else { suspenseBoundary.flags |= DidCapture; sourceFiber.flags |= ForceUpdateForLegacySuspense; // We're going to commit this fiber even though it didn't complete. // But we shouldn't call any lifecycle methods or callbacks. Remove // all lifecycle effect tags. sourceFiber.flags &= ~(LifecycleEffectMask | Incomplete); if (sourceFiber.tag === ClassComponent) { var currentSourceFiber = sourceFiber.alternate; if (currentSourceFiber === null) { // This is a new mount. Change the tag so it's not mistaken for a // completed class component. For example, we should not call // componentWillUnmount if it is deleted. sourceFiber.tag = IncompleteClassComponent; } else { // When we try rendering again, we should not reuse the current fiber, // since it's known to be in an inconsistent state. Use a force update to // prevent a bail out. var update = createUpdate(NoTimestamp, SyncLane); update.tag = ForceUpdate; enqueueUpdate(sourceFiber, update, SyncLane); } } // The source fiber did not complete. Mark it with Sync priority to // indicate that it still has pending work. sourceFiber.lanes = mergeLanes(sourceFiber.lanes, SyncLane); } return suspenseBoundary; } // Confirmed that the boundary is in a concurrent mode tree. Continue // with the normal suspend path. // // After this we'll use a set of heuristics to determine whether this // render pass will run to completion or restart or "suspend" the commit. // The actual logic for this is spread out in different places. // // This first principle is that if we're going to suspend when we complete // a root, then we should also restart if we get an update or ping that // might unsuspend it, and vice versa. The only reason to suspend is // because you think you might want to restart before committing. However, // it doesn't make sense to restart only while in the period we're suspended. // // Restarting too aggressively is also not good because it starves out any // intermediate loading state. So we use heuristics to determine when. // Suspense Heuristics // // If nothing threw a Promise or all the same fallbacks are already showing, // then don't suspend/restart. // // If this is an initial render of a new tree of Suspense boundaries and // those trigger a fallback, then don't suspend/restart. We want to ensure // that we can show the initial loading state as quickly as possible. // // If we hit a "Delayed" case, such as when we'd switch from content back into // a fallback, then we should always suspend/restart. Transitions apply // to this case. If none is defined, JND is used instead. // // If we're already showing a fallback and it gets "retried", allowing us to show // another level, but there's still an inner boundary that would show a fallback, // then we suspend/restart for 500ms since the last time we showed a fallback // anywhere in the tree. This effectively throttles progressive loading into a // consistent train of commits. This also gives us an opportunity to restart to // get to the completed state slightly earlier. // // If there's ambiguity due to batching it's resolved in preference of: // 1) "delayed", 2) "initial render", 3) "retry". // // We want to ensure that a "busy" state doesn't get force committed. We want to // ensure that new initial loading states can commit as soon as possible. suspenseBoundary.flags |= ShouldCapture; // TODO: I think we can remove this, since we now use `DidCapture` in // the begin phase to prevent an early bailout. suspenseBoundary.lanes = rootRenderLanes; return suspenseBoundary; } function throwException(root, returnFiber, sourceFiber, value, rootRenderLanes) { // The source fiber did not complete. sourceFiber.flags |= Incomplete; { if (isDevToolsPresent) { // If we have pending work still, restore the original updaters restorePendingUpdaters(root, rootRenderLanes); } } if (value !== null && typeof value === 'object' && typeof value.then === 'function') { // This is a wakeable. The component suspended. var wakeable = value; resetSuspendedComponent(sourceFiber); { if (getIsHydrating() && sourceFiber.mode & ConcurrentMode) { markDidThrowWhileHydratingDEV(); } } var suspenseBoundary = getNearestSuspenseBoundaryToCapture(returnFiber); if (suspenseBoundary !== null) { suspenseBoundary.flags &= ~ForceClientRender; markSuspenseBoundaryShouldCapture(suspenseBoundary, returnFiber, sourceFiber, root, rootRenderLanes); // We only attach ping listeners in concurrent mode. Legacy Suspense always // commits fallbacks synchronously, so there are no pings. if (suspenseBoundary.mode & ConcurrentMode) { attachPingListener(root, wakeable, rootRenderLanes); } attachRetryListener(suspenseBoundary, root, wakeable); return; } else { // No boundary was found. Unless this is a sync update, this is OK. // We can suspend and wait for more data to arrive. if (!includesSyncLane(rootRenderLanes)) { // This is not a sync update. Suspend. Since we're not activating a // Suspense boundary, this will unwind all the way to the root without // performing a second pass to render a fallback. (This is arguably how // refresh transitions should work, too, since we're not going to commit // the fallbacks anyway.) // // This case also applies to initial hydration. attachPingListener(root, wakeable, rootRenderLanes); renderDidSuspendDelayIfPossible(); return; } // This is a sync/discrete update. We treat this case like an error // because discrete renders are expected to produce a complete tree // synchronously to maintain consistency with external state. var uncaughtSuspenseError = new Error('A component suspended while responding to synchronous input. This ' + 'will cause the UI to be replaced with a loading indicator. To ' + 'fix, updates that suspend should be wrapped ' + 'with startTransition.'); // If we're outside a transition, fall through to the regular error path. // The error will be caught by the nearest suspense boundary. value = uncaughtSuspenseError; } } else { // This is a regular error, not a Suspense wakeable. if (getIsHydrating() && sourceFiber.mode & ConcurrentMode) { markDidThrowWhileHydratingDEV(); var _suspenseBoundary = getNearestSuspenseBoundaryToCapture(returnFiber); // If the error was thrown during hydration, we may be able to recover by // discarding the dehydrated content and switching to a client render. // Instead of surfacing the error, find the nearest Suspense boundary // and render it again without hydration. if (_suspenseBoundary !== null) { if ((_suspenseBoundary.flags & ShouldCapture) === NoFlags) { // Set a flag to indicate that we should try rendering the normal // children again, not the fallback. _suspenseBoundary.flags |= ForceClientRender; } markSuspenseBoundaryShouldCapture(_suspenseBoundary, returnFiber, sourceFiber, root, rootRenderLanes); // Even though the user may not be affected by this error, we should // still log it so it can be fixed. queueHydrationError(createCapturedValueAtFiber(value, sourceFiber)); return; } } } value = createCapturedValueAtFiber(value, sourceFiber); renderDidError(value); // We didn't find a boundary that could handle this type of exception. Start // over and traverse parent path again, this time treating the exception // as an error. var workInProgress = returnFiber; do { switch (workInProgress.tag) { case HostRoot: { var _errorInfo = value; workInProgress.flags |= ShouldCapture; var lane = pickArbitraryLane(rootRenderLanes); workInProgress.lanes = mergeLanes(workInProgress.lanes, lane); var update = createRootErrorUpdate(workInProgress, _errorInfo, lane); enqueueCapturedUpdate(workInProgress, update); return; } case ClassComponent: // Capture and retry var errorInfo = value; var ctor = workInProgress.type; var instance = workInProgress.stateNode; if ((workInProgress.flags & DidCapture) === NoFlags && (typeof ctor.getDerivedStateFromError === 'function' || instance !== null && typeof instance.componentDidCatch === 'function' && !isAlreadyFailedLegacyErrorBoundary(instance))) { workInProgress.flags |= ShouldCapture; var _lane = pickArbitraryLane(rootRenderLanes); workInProgress.lanes = mergeLanes(workInProgress.lanes, _lane); // Schedule the error boundary to re-render using updated state var _update = createClassErrorUpdate(workInProgress, errorInfo, _lane); enqueueCapturedUpdate(workInProgress, _update); return; } break; } workInProgress = workInProgress.return; } while (workInProgress !== null); } function getSuspendedCache() { { return null; } // This function is called when a Suspense boundary suspends. It returns the } var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner; var didReceiveUpdate = false; var didWarnAboutBadClass; var didWarnAboutModulePatternComponent; var didWarnAboutContextTypeOnFunctionComponent; var didWarnAboutGetDerivedStateOnFunctionComponent; var didWarnAboutFunctionRefs; var didWarnAboutReassigningProps; var didWarnAboutRevealOrder; var didWarnAboutTailOptions; var didWarnAboutDefaultPropsOnFunctionComponent; { didWarnAboutBadClass = {}; didWarnAboutModulePatternComponent = {}; didWarnAboutContextTypeOnFunctionComponent = {}; didWarnAboutGetDerivedStateOnFunctionComponent = {}; didWarnAboutFunctionRefs = {}; didWarnAboutReassigningProps = false; didWarnAboutRevealOrder = {}; didWarnAboutTailOptions = {}; didWarnAboutDefaultPropsOnFunctionComponent = {}; } function reconcileChildren(current, workInProgress, nextChildren, renderLanes) { if (current === null) { // If this is a fresh new component that hasn't been rendered yet, we // won't update its child set by applying minimal side-effects. Instead, // we will add them all to the child before it gets rendered. That means // we can optimize this reconciliation pass by not tracking side-effects. workInProgress.child = mountChildFibers(workInProgress, null, nextChildren, renderLanes); } else { // If the current child is the same as the work in progress, it means that // we haven't yet started any work on these children. Therefore, we use // the clone algorithm to create a copy of all the current children. // If we had any progressed work already, that is invalid at this point so // let's throw it out. workInProgress.child = reconcileChildFibers(workInProgress, current.child, nextChildren, renderLanes); } } function forceUnmountCurrentAndReconcile(current, workInProgress, nextChildren, renderLanes) { // This function is fork of reconcileChildren. It's used in cases where we // want to reconcile without matching against the existing set. This has the // effect of all current children being unmounted; even if the type and key // are the same, the old child is unmounted and a new child is created. // // To do this, we're going to go through the reconcile algorithm twice. In // the first pass, we schedule a deletion for all the current children by // passing null. workInProgress.child = reconcileChildFibers(workInProgress, current.child, null, renderLanes); // In the second pass, we mount the new children. The trick here is that we // pass null in place of where we usually pass the current child set. This has // the effect of remounting all children regardless of whether their // identities match. workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderLanes); } function updateForwardRef(current, workInProgress, Component, nextProps, renderLanes) { // TODO: current can be non-null here even if the component // hasn't yet mounted. This happens after the first render suspends. // We'll need to figure out if this is fine or can cause issues. { if (workInProgress.type !== workInProgress.elementType) { // Lazy component props can't be validated in createElement // because they're only guaranteed to be resolved here. var innerPropTypes = Component.propTypes; if (innerPropTypes) { checkPropTypes(innerPropTypes, nextProps, // Resolved props 'prop', getComponentNameFromType(Component)); } } } var render = Component.render; var ref = workInProgress.ref; // The rest is a fork of updateFunctionComponent var nextChildren; var hasId; prepareToReadContext(workInProgress, renderLanes); { markComponentRenderStarted(workInProgress); } { ReactCurrentOwner$1.current = workInProgress; setIsRendering(true); nextChildren = renderWithHooks(current, workInProgress, render, nextProps, ref, renderLanes); hasId = checkDidRenderIdHook(); if ( workInProgress.mode & StrictLegacyMode) { setIsStrictModeForDevtools(true); try { nextChildren = renderWithHooks(current, workInProgress, render, nextProps, ref, renderLanes); hasId = checkDidRenderIdHook(); } finally { setIsStrictModeForDevtools(false); } } setIsRendering(false); } { markComponentRenderStopped(); } if (current !== null && !didReceiveUpdate) { bailoutHooks(current, workInProgress, renderLanes); return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); } if (getIsHydrating() && hasId) { pushMaterializedTreeId(workInProgress); } // React DevTools reads this flag. workInProgress.flags |= PerformedWork; reconcileChildren(current, workInProgress, nextChildren, renderLanes); return workInProgress.child; } function updateMemoComponent(current, workInProgress, Component, nextProps, renderLanes) { if (current === null) { var type = Component.type; if (isSimpleFunctionComponent(type) && Component.compare === null && // SimpleMemoComponent codepath doesn't resolve outer props either. Component.defaultProps === undefined) { var resolvedType = type; { resolvedType = resolveFunctionForHotReloading(type); } // If this is a plain function component without default props, // and with only the default shallow comparison, we upgrade it // to a SimpleMemoComponent to allow fast path updates. workInProgress.tag = SimpleMemoComponent; workInProgress.type = resolvedType; { validateFunctionComponentInDev(workInProgress, type); } return updateSimpleMemoComponent(current, workInProgress, resolvedType, nextProps, renderLanes); } { var innerPropTypes = type.propTypes; if (innerPropTypes) { // Inner memo component props aren't currently validated in createElement. // We could move it there, but we'd still need this for lazy code path. checkPropTypes(innerPropTypes, nextProps, // Resolved props 'prop', getComponentNameFromType(type)); } if ( Component.defaultProps !== undefined) { var componentName = getComponentNameFromType(type) || 'Unknown'; if (!didWarnAboutDefaultPropsOnFunctionComponent[componentName]) { error('%s: Support for defaultProps will be removed from memo components ' + 'in a future major release. Use JavaScript default parameters instead.', componentName); didWarnAboutDefaultPropsOnFunctionComponent[componentName] = true; } } } var child = createFiberFromTypeAndProps(Component.type, null, nextProps, workInProgress, workInProgress.mode, renderLanes); child.ref = workInProgress.ref; child.return = workInProgress; workInProgress.child = child; return child; } { var _type = Component.type; var _innerPropTypes = _type.propTypes; if (_innerPropTypes) { // Inner memo component props aren't currently validated in createElement. // We could move it there, but we'd still need this for lazy code path. checkPropTypes(_innerPropTypes, nextProps, // Resolved props 'prop', getComponentNameFromType(_type)); } } var currentChild = current.child; // This is always exactly one child var hasScheduledUpdateOrContext = checkScheduledUpdateOrContext(current, renderLanes); if (!hasScheduledUpdateOrContext) { // This will be the props with resolved defaultProps, // unlike current.memoizedProps which will be the unresolved ones. var prevProps = currentChild.memoizedProps; // Default to shallow comparison var compare = Component.compare; compare = compare !== null ? compare : shallowEqual; if (compare(prevProps, nextProps) && current.ref === workInProgress.ref) { return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); } } // React DevTools reads this flag. workInProgress.flags |= PerformedWork; var newChild = createWorkInProgress(currentChild, nextProps); newChild.ref = workInProgress.ref; newChild.return = workInProgress; workInProgress.child = newChild; return newChild; } function updateSimpleMemoComponent(current, workInProgress, Component, nextProps, renderLanes) { // TODO: current can be non-null here even if the component // hasn't yet mounted. This happens when the inner render suspends. // We'll need to figure out if this is fine or can cause issues. { if (workInProgress.type !== workInProgress.elementType) { // Lazy component props can't be validated in createElement // because they're only guaranteed to be resolved here. var outerMemoType = workInProgress.elementType; if (outerMemoType.$$typeof === REACT_LAZY_TYPE) { // We warn when you define propTypes on lazy() // so let's just skip over it to find memo() outer wrapper. // Inner props for memo are validated later. var lazyComponent = outerMemoType; var payload = lazyComponent._payload; var init = lazyComponent._init; try { outerMemoType = init(payload); } catch (x) { outerMemoType = null; } // Inner propTypes will be validated in the function component path. var outerPropTypes = outerMemoType && outerMemoType.propTypes; if (outerPropTypes) { checkPropTypes(outerPropTypes, nextProps, // Resolved (SimpleMemoComponent has no defaultProps) 'prop', getComponentNameFromType(outerMemoType)); } } } } if (current !== null) { var prevProps = current.memoizedProps; if (shallowEqual(prevProps, nextProps) && current.ref === workInProgress.ref && ( // Prevent bailout if the implementation changed due to hot reload. workInProgress.type === current.type )) { didReceiveUpdate = false; // The props are shallowly equal. Reuse the previous props object, like we // would during a normal fiber bailout. // // We don't have strong guarantees that the props object is referentially // equal during updates where we can't bail out anyway — like if the props // are shallowly equal, but there's a local state or context update in the // same batch. // // However, as a principle, we should aim to make the behavior consistent // across different ways of memoizing a component. For example, React.memo // has a different internal Fiber layout if you pass a normal function // component (SimpleMemoComponent) versus if you pass a different type // like forwardRef (MemoComponent). But this is an implementation detail. // Wrapping a component in forwardRef (or React.lazy, etc) shouldn't // affect whether the props object is reused during a bailout. workInProgress.pendingProps = nextProps = prevProps; if (!checkScheduledUpdateOrContext(current, renderLanes)) { // The pending lanes were cleared at the beginning of beginWork. We're // about to bail out, but there might be other lanes that weren't // included in the current render. Usually, the priority level of the // remaining updates is accumulated during the evaluation of the // component (i.e. when processing the update queue). But since since // we're bailing out early *without* evaluating the component, we need // to account for it here, too. Reset to the value of the current fiber. // NOTE: This only applies to SimpleMemoComponent, not MemoComponent, // because a MemoComponent fiber does not have hooks or an update queue; // rather, it wraps around an inner component, which may or may not // contains hooks. // TODO: Move the reset at in beginWork out of the common path so that // this is no longer necessary. workInProgress.lanes = current.lanes; return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); } else if ((current.flags & ForceUpdateForLegacySuspense) !== NoFlags) { // This is a special case that only exists for legacy mode. // See https://github.com/facebook/react/pull/19216. didReceiveUpdate = true; } } } return updateFunctionComponent(current, workInProgress, Component, nextProps, renderLanes); } function updateOffscreenComponent(current, workInProgress, renderLanes) { var nextProps = workInProgress.pendingProps; var nextChildren = nextProps.children; var prevState = current !== null ? current.memoizedState : null; if (nextProps.mode === 'hidden' || enableLegacyHidden ) { // Rendering a hidden tree. if ((workInProgress.mode & ConcurrentMode) === NoMode) { // In legacy sync mode, don't defer the subtree. Render it now. // TODO: Consider how Offscreen should work with transitions in the future var nextState = { baseLanes: NoLanes, cachePool: null, transitions: null }; workInProgress.memoizedState = nextState; pushRenderLanes(workInProgress, renderLanes); } else if (!includesSomeLane(renderLanes, OffscreenLane)) { var spawnedCachePool = null; // We're hidden, and we're not rendering at Offscreen. We will bail out // and resume this tree later. var nextBaseLanes; if (prevState !== null) { var prevBaseLanes = prevState.baseLanes; nextBaseLanes = mergeLanes(prevBaseLanes, renderLanes); } else { nextBaseLanes = renderLanes; } // Schedule this fiber to re-render at offscreen priority. Then bailout. workInProgress.lanes = workInProgress.childLanes = laneToLanes(OffscreenLane); var _nextState = { baseLanes: nextBaseLanes, cachePool: spawnedCachePool, transitions: null }; workInProgress.memoizedState = _nextState; workInProgress.updateQueue = null; // to avoid a push/pop misalignment. pushRenderLanes(workInProgress, nextBaseLanes); return null; } else { // This is the second render. The surrounding visible content has already // committed. Now we resume rendering the hidden tree. // Rendering at offscreen, so we can clear the base lanes. var _nextState2 = { baseLanes: NoLanes, cachePool: null, transitions: null }; workInProgress.memoizedState = _nextState2; // Push the lanes that were skipped when we bailed out. var subtreeRenderLanes = prevState !== null ? prevState.baseLanes : renderLanes; pushRenderLanes(workInProgress, subtreeRenderLanes); } } else { // Rendering a visible tree. var _subtreeRenderLanes; if (prevState !== null) { // We're going from hidden -> visible. _subtreeRenderLanes = mergeLanes(prevState.baseLanes, renderLanes); workInProgress.memoizedState = null; } else { // We weren't previously hidden, and we still aren't, so there's nothing // special to do. Need to push to the stack regardless, though, to avoid // a push/pop misalignment. _subtreeRenderLanes = renderLanes; } pushRenderLanes(workInProgress, _subtreeRenderLanes); } reconcileChildren(current, workInProgress, nextChildren, renderLanes); return workInProgress.child; } // Note: These happen to have identical begin phases, for now. We shouldn't hold function updateFragment(current, workInProgress, renderLanes) { var nextChildren = workInProgress.pendingProps; reconcileChildren(current, workInProgress, nextChildren, renderLanes); return workInProgress.child; } function updateMode(current, workInProgress, renderLanes) { var nextChildren = workInProgress.pendingProps.children; reconcileChildren(current, workInProgress, nextChildren, renderLanes); return workInProgress.child; } function updateProfiler(current, workInProgress, renderLanes) { { workInProgress.flags |= Update; { // Reset effect durations for the next eventual effect phase. // These are reset during render to allow the DevTools commit hook a chance to read them, var stateNode = workInProgress.stateNode; stateNode.effectDuration = 0; stateNode.passiveEffectDuration = 0; } } var nextProps = workInProgress.pendingProps; var nextChildren = nextProps.children; reconcileChildren(current, workInProgress, nextChildren, renderLanes); return workInProgress.child; } function markRef(current, workInProgress) { var ref = workInProgress.ref; if (current === null && ref !== null || current !== null && current.ref !== ref) { // Schedule a Ref effect workInProgress.flags |= Ref; { workInProgress.flags |= RefStatic; } } } function updateFunctionComponent(current, workInProgress, Component, nextProps, renderLanes) { { if (workInProgress.type !== workInProgress.elementType) { // Lazy component props can't be validated in createElement // because they're only guaranteed to be resolved here. var innerPropTypes = Component.propTypes; if (innerPropTypes) { checkPropTypes(innerPropTypes, nextProps, // Resolved props 'prop', getComponentNameFromType(Component)); } } } var context; { var unmaskedContext = getUnmaskedContext(workInProgress, Component, true); context = getMaskedContext(workInProgress, unmaskedContext); } var nextChildren; var hasId; prepareToReadContext(workInProgress, renderLanes); { markComponentRenderStarted(workInProgress); } { ReactCurrentOwner$1.current = workInProgress; setIsRendering(true); nextChildren = renderWithHooks(current, workInProgress, Component, nextProps, context, renderLanes); hasId = checkDidRenderIdHook(); if ( workInProgress.mode & StrictLegacyMode) { setIsStrictModeForDevtools(true); try { nextChildren = renderWithHooks(current, workInProgress, Component, nextProps, context, renderLanes); hasId = checkDidRenderIdHook(); } finally { setIsStrictModeForDevtools(false); } } setIsRendering(false); } { markComponentRenderStopped(); } if (current !== null && !didReceiveUpdate) { bailoutHooks(current, workInProgress, renderLanes); return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); } if (getIsHydrating() && hasId) { pushMaterializedTreeId(workInProgress); } // React DevTools reads this flag. workInProgress.flags |= PerformedWork; reconcileChildren(current, workInProgress, nextChildren, renderLanes); return workInProgress.child; } function updateClassComponent(current, workInProgress, Component, nextProps, renderLanes) { { // This is used by DevTools to force a boundary to error. switch (shouldError(workInProgress)) { case false: { var _instance = workInProgress.stateNode; var ctor = workInProgress.type; // TODO This way of resetting the error boundary state is a hack. // Is there a better way to do this? var tempInstance = new ctor(workInProgress.memoizedProps, _instance.context); var state = tempInstance.state; _instance.updater.enqueueSetState(_instance, state, null); break; } case true: { workInProgress.flags |= DidCapture; workInProgress.flags |= ShouldCapture; // eslint-disable-next-line react-internal/prod-error-codes var error$1 = new Error('Simulated error coming from DevTools'); var lane = pickArbitraryLane(renderLanes); workInProgress.lanes = mergeLanes(workInProgress.lanes, lane); // Schedule the error boundary to re-render using updated state var update = createClassErrorUpdate(workInProgress, createCapturedValueAtFiber(error$1, workInProgress), lane); enqueueCapturedUpdate(workInProgress, update); break; } } if (workInProgress.type !== workInProgress.elementType) { // Lazy component props can't be validated in createElement // because they're only guaranteed to be resolved here. var innerPropTypes = Component.propTypes; if (innerPropTypes) { checkPropTypes(innerPropTypes, nextProps, // Resolved props 'prop', getComponentNameFromType(Component)); } } } // Push context providers early to prevent context stack mismatches. // During mounting we don't know the child context yet as the instance doesn't exist. // We will invalidate the child context in finishClassComponent() right after rendering. var hasContext; if (isContextProvider(Component)) { hasContext = true; pushContextProvider(workInProgress); } else { hasContext = false; } prepareToReadContext(workInProgress, renderLanes); var instance = workInProgress.stateNode; var shouldUpdate; if (instance === null) { resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); // In the initial pass we might need to construct the instance. constructClassInstance(workInProgress, Component, nextProps); mountClassInstance(workInProgress, Component, nextProps, renderLanes); shouldUpdate = true; } else if (current === null) { // In a resume, we'll already have an instance we can reuse. shouldUpdate = resumeMountClassInstance(workInProgress, Component, nextProps, renderLanes); } else { shouldUpdate = updateClassInstance(current, workInProgress, Component, nextProps, renderLanes); } var nextUnitOfWork = finishClassComponent(current, workInProgress, Component, shouldUpdate, hasContext, renderLanes); { var inst = workInProgress.stateNode; if (shouldUpdate && inst.props !== nextProps) { if (!didWarnAboutReassigningProps) { error('It looks like %s is reassigning its own `this.props` while rendering. ' + 'This is not supported and can lead to confusing bugs.', getComponentNameFromFiber(workInProgress) || 'a component'); } didWarnAboutReassigningProps = true; } } return nextUnitOfWork; } function finishClassComponent(current, workInProgress, Component, shouldUpdate, hasContext, renderLanes) { // Refs should update even if shouldComponentUpdate returns false markRef(current, workInProgress); var didCaptureError = (workInProgress.flags & DidCapture) !== NoFlags; if (!shouldUpdate && !didCaptureError) { // Context providers should defer to sCU for rendering if (hasContext) { invalidateContextProvider(workInProgress, Component, false); } return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); } var instance = workInProgress.stateNode; // Rerender ReactCurrentOwner$1.current = workInProgress; var nextChildren; if (didCaptureError && typeof Component.getDerivedStateFromError !== 'function') { // If we captured an error, but getDerivedStateFromError is not defined, // unmount all the children. componentDidCatch will schedule an update to // re-render a fallback. This is temporary until we migrate everyone to // the new API. // TODO: Warn in a future release. nextChildren = null; { stopProfilerTimerIfRunning(); } } else { { markComponentRenderStarted(workInProgress); } { setIsRendering(true); nextChildren = instance.render(); if ( workInProgress.mode & StrictLegacyMode) { setIsStrictModeForDevtools(true); try { instance.render(); } finally { setIsStrictModeForDevtools(false); } } setIsRendering(false); } { markComponentRenderStopped(); } } // React DevTools reads this flag. workInProgress.flags |= PerformedWork; if (current !== null && didCaptureError) { // If we're recovering from an error, reconcile without reusing any of // the existing children. Conceptually, the normal children and the children // that are shown on error are two different sets, so we shouldn't reuse // normal children even if their identities match. forceUnmountCurrentAndReconcile(current, workInProgress, nextChildren, renderLanes); } else { reconcileChildren(current, workInProgress, nextChildren, renderLanes); } // Memoize state using the values we just used to render. // TODO: Restructure so we never read values from the instance. workInProgress.memoizedState = instance.state; // The context might have changed so we need to recalculate it. if (hasContext) { invalidateContextProvider(workInProgress, Component, true); } return workInProgress.child; } function pushHostRootContext(workInProgress) { var root = workInProgress.stateNode; if (root.pendingContext) { pushTopLevelContextObject(workInProgress, root.pendingContext, root.pendingContext !== root.context); } else if (root.context) { // Should always be set pushTopLevelContextObject(workInProgress, root.context, false); } pushHostContainer(workInProgress, root.containerInfo); } function updateHostRoot(current, workInProgress, renderLanes) { pushHostRootContext(workInProgress); if (current === null) { throw new Error('Should have a current fiber. This is a bug in React.'); } var nextProps = workInProgress.pendingProps; var prevState = workInProgress.memoizedState; var prevChildren = prevState.element; cloneUpdateQueue(current, workInProgress); processUpdateQueue(workInProgress, nextProps, null, renderLanes); var nextState = workInProgress.memoizedState; var root = workInProgress.stateNode; // being called "element". var nextChildren = nextState.element; if ( prevState.isDehydrated) { // This is a hydration root whose shell has not yet hydrated. We should // attempt to hydrate. // Flip isDehydrated to false to indicate that when this render // finishes, the root will no longer be dehydrated. var overrideState = { element: nextChildren, isDehydrated: false, cache: nextState.cache, pendingSuspenseBoundaries: nextState.pendingSuspenseBoundaries, transitions: nextState.transitions }; var updateQueue = workInProgress.updateQueue; // `baseState` can always be the last state because the root doesn't // have reducer functions so it doesn't need rebasing. updateQueue.baseState = overrideState; workInProgress.memoizedState = overrideState; if (workInProgress.flags & ForceClientRender) { // Something errored during a previous attempt to hydrate the shell, so we // forced a client render. var recoverableError = createCapturedValueAtFiber(new Error('There was an error while hydrating. Because the error happened outside ' + 'of a Suspense boundary, the entire root will switch to ' + 'client rendering.'), workInProgress); return mountHostRootWithoutHydrating(current, workInProgress, nextChildren, renderLanes, recoverableError); } else if (nextChildren !== prevChildren) { var _recoverableError = createCapturedValueAtFiber(new Error('This root received an early update, before anything was able ' + 'hydrate. Switched the entire root to client rendering.'), workInProgress); return mountHostRootWithoutHydrating(current, workInProgress, nextChildren, renderLanes, _recoverableError); } else { // The outermost shell has not hydrated yet. Start hydrating. enterHydrationState(workInProgress); var child = mountChildFibers(workInProgress, null, nextChildren, renderLanes); workInProgress.child = child; var node = child; while (node) { // Mark each child as hydrating. This is a fast path to know whether this // tree is part of a hydrating tree. This is used to determine if a child // node has fully mounted yet, and for scheduling event replaying. // Conceptually this is similar to Placement in that a new subtree is // inserted into the React tree here. It just happens to not need DOM // mutations because it already exists. node.flags = node.flags & ~Placement | Hydrating; node = node.sibling; } } } else { // Root is not dehydrated. Either this is a client-only root, or it // already hydrated. resetHydrationState(); if (nextChildren === prevChildren) { return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); } reconcileChildren(current, workInProgress, nextChildren, renderLanes); } return workInProgress.child; } function mountHostRootWithoutHydrating(current, workInProgress, nextChildren, renderLanes, recoverableError) { // Revert to client rendering. resetHydrationState(); queueHydrationError(recoverableError); workInProgress.flags |= ForceClientRender; reconcileChildren(current, workInProgress, nextChildren, renderLanes); return workInProgress.child; } function updateHostComponent(current, workInProgress, renderLanes) { pushHostContext(workInProgress); if (current === null) { tryToClaimNextHydratableInstance(workInProgress); } var type = workInProgress.type; var nextProps = workInProgress.pendingProps; var prevProps = current !== null ? current.memoizedProps : null; var nextChildren = nextProps.children; var isDirectTextChild = shouldSetTextContent(type, nextProps); if (isDirectTextChild) { // We special case a direct text child of a host node. This is a common // case. We won't handle it as a reified child. We will instead handle // this in the host environment that also has access to this prop. That // avoids allocating another HostText fiber and traversing it. nextChildren = null; } else if (prevProps !== null && shouldSetTextContent(type, prevProps)) { // If we're switching from a direct text child to a normal child, or to // empty, we need to schedule the text content to be reset. workInProgress.flags |= ContentReset; } markRef(current, workInProgress); reconcileChildren(current, workInProgress, nextChildren, renderLanes); return workInProgress.child; } function updateHostText(current, workInProgress) { if (current === null) { tryToClaimNextHydratableInstance(workInProgress); } // Nothing to do here. This is terminal. We'll do the completion step // immediately after. return null; } function mountLazyComponent(_current, workInProgress, elementType, renderLanes) { resetSuspendedCurrentOnMountInLegacyMode(_current, workInProgress); var props = workInProgress.pendingProps; var lazyComponent = elementType; var payload = lazyComponent._payload; var init = lazyComponent._init; var Component = init(payload); // Store the unwrapped component in the type. workInProgress.type = Component; var resolvedTag = workInProgress.tag = resolveLazyComponentTag(Component); var resolvedProps = resolveDefaultProps(Component, props); var child; switch (resolvedTag) { case FunctionComponent: { { validateFunctionComponentInDev(workInProgress, Component); workInProgress.type = Component = resolveFunctionForHotReloading(Component); } child = updateFunctionComponent(null, workInProgress, Component, resolvedProps, renderLanes); return child; } case ClassComponent: { { workInProgress.type = Component = resolveClassForHotReloading(Component); } child = updateClassComponent(null, workInProgress, Component, resolvedProps, renderLanes); return child; } case ForwardRef: { { workInProgress.type = Component = resolveForwardRefForHotReloading(Component); } child = updateForwardRef(null, workInProgress, Component, resolvedProps, renderLanes); return child; } case MemoComponent: { { if (workInProgress.type !== workInProgress.elementType) { var outerPropTypes = Component.propTypes; if (outerPropTypes) { checkPropTypes(outerPropTypes, resolvedProps, // Resolved for outer only 'prop', getComponentNameFromType(Component)); } } } child = updateMemoComponent(null, workInProgress, Component, resolveDefaultProps(Component.type, resolvedProps), // The inner type can have defaults too renderLanes); return child; } } var hint = ''; { if (Component !== null && typeof Component === 'object' && Component.$$typeof === REACT_LAZY_TYPE) { hint = ' Did you wrap a component in React.lazy() more than once?'; } } // This message intentionally doesn't mention ForwardRef or MemoComponent // because the fact that it's a separate type of work is an // implementation detail. throw new Error("Element type is invalid. Received a promise that resolves to: " + Component + ". " + ("Lazy element type must resolve to a class or function." + hint)); } function mountIncompleteClassComponent(_current, workInProgress, Component, nextProps, renderLanes) { resetSuspendedCurrentOnMountInLegacyMode(_current, workInProgress); // Promote the fiber to a class and try rendering again. workInProgress.tag = ClassComponent; // The rest of this function is a fork of `updateClassComponent` // Push context providers early to prevent context stack mismatches. // During mounting we don't know the child context yet as the instance doesn't exist. // We will invalidate the child context in finishClassComponent() right after rendering. var hasContext; if (isContextProvider(Component)) { hasContext = true; pushContextProvider(workInProgress); } else { hasContext = false; } prepareToReadContext(workInProgress, renderLanes); constructClassInstance(workInProgress, Component, nextProps); mountClassInstance(workInProgress, Component, nextProps, renderLanes); return finishClassComponent(null, workInProgress, Component, true, hasContext, renderLanes); } function mountIndeterminateComponent(_current, workInProgress, Component, renderLanes) { resetSuspendedCurrentOnMountInLegacyMode(_current, workInProgress); var props = workInProgress.pendingProps; var context; { var unmaskedContext = getUnmaskedContext(workInProgress, Component, false); context = getMaskedContext(workInProgress, unmaskedContext); } prepareToReadContext(workInProgress, renderLanes); var value; var hasId; { markComponentRenderStarted(workInProgress); } { if (Component.prototype && typeof Component.prototype.render === 'function') { var componentName = getComponentNameFromType(Component) || 'Unknown'; if (!didWarnAboutBadClass[componentName]) { error("The <%s /> component appears to have a render method, but doesn't extend React.Component. " + 'This is likely to cause errors. Change %s to extend React.Component instead.', componentName, componentName); didWarnAboutBadClass[componentName] = true; } } if (workInProgress.mode & StrictLegacyMode) { ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress, null); } setIsRendering(true); ReactCurrentOwner$1.current = workInProgress; value = renderWithHooks(null, workInProgress, Component, props, context, renderLanes); hasId = checkDidRenderIdHook(); setIsRendering(false); } { markComponentRenderStopped(); } // React DevTools reads this flag. workInProgress.flags |= PerformedWork; { // Support for module components is deprecated and is removed behind a flag. // Whether or not it would crash later, we want to show a good message in DEV first. if (typeof value === 'object' && value !== null && typeof value.render === 'function' && value.$$typeof === undefined) { var _componentName = getComponentNameFromType(Component) || 'Unknown'; if (!didWarnAboutModulePatternComponent[_componentName]) { error('The <%s /> component appears to be a function component that returns a class instance. ' + 'Change %s to a class that extends React.Component instead. ' + "If you can't use a class try assigning the prototype on the function as a workaround. " + "`%s.prototype = React.Component.prototype`. Don't use an arrow function since it " + 'cannot be called with `new` by React.', _componentName, _componentName, _componentName); didWarnAboutModulePatternComponent[_componentName] = true; } } } if ( // Run these checks in production only if the flag is off. // Eventually we'll delete this branch altogether. typeof value === 'object' && value !== null && typeof value.render === 'function' && value.$$typeof === undefined) { { var _componentName2 = getComponentNameFromType(Component) || 'Unknown'; if (!didWarnAboutModulePatternComponent[_componentName2]) { error('The <%s /> component appears to be a function component that returns a class instance. ' + 'Change %s to a class that extends React.Component instead. ' + "If you can't use a class try assigning the prototype on the function as a workaround. " + "`%s.prototype = React.Component.prototype`. Don't use an arrow function since it " + 'cannot be called with `new` by React.', _componentName2, _componentName2, _componentName2); didWarnAboutModulePatternComponent[_componentName2] = true; } } // Proceed under the assumption that this is a class instance workInProgress.tag = ClassComponent; // Throw out any hooks that were used. workInProgress.memoizedState = null; workInProgress.updateQueue = null; // Push context providers early to prevent context stack mismatches. // During mounting we don't know the child context yet as the instance doesn't exist. // We will invalidate the child context in finishClassComponent() right after rendering. var hasContext = false; if (isContextProvider(Component)) { hasContext = true; pushContextProvider(workInProgress); } else { hasContext = false; } workInProgress.memoizedState = value.state !== null && value.state !== undefined ? value.state : null; initializeUpdateQueue(workInProgress); adoptClassInstance(workInProgress, value); mountClassInstance(workInProgress, Component, props, renderLanes); return finishClassComponent(null, workInProgress, Component, true, hasContext, renderLanes); } else { // Proceed under the assumption that this is a function component workInProgress.tag = FunctionComponent; { if ( workInProgress.mode & StrictLegacyMode) { setIsStrictModeForDevtools(true); try { value = renderWithHooks(null, workInProgress, Component, props, context, renderLanes); hasId = checkDidRenderIdHook(); } finally { setIsStrictModeForDevtools(false); } } } if (getIsHydrating() && hasId) { pushMaterializedTreeId(workInProgress); } reconcileChildren(null, workInProgress, value, renderLanes); { validateFunctionComponentInDev(workInProgress, Component); } return workInProgress.child; } } function validateFunctionComponentInDev(workInProgress, Component) { { if (Component) { if (Component.childContextTypes) { error('%s(...): childContextTypes cannot be defined on a function component.', Component.displayName || Component.name || 'Component'); } } if (workInProgress.ref !== null) { var info = ''; var ownerName = getCurrentFiberOwnerNameInDevOrNull(); if (ownerName) { info += '\n\nCheck the render method of `' + ownerName + '`.'; } var warningKey = ownerName || ''; var debugSource = workInProgress._debugSource; if (debugSource) { warningKey = debugSource.fileName + ':' + debugSource.lineNumber; } if (!didWarnAboutFunctionRefs[warningKey]) { didWarnAboutFunctionRefs[warningKey] = true; error('Function components cannot be given refs. ' + 'Attempts to access this ref will fail. ' + 'Did you mean to use React.forwardRef()?%s', info); } } if ( Component.defaultProps !== undefined) { var componentName = getComponentNameFromType(Component) || 'Unknown'; if (!didWarnAboutDefaultPropsOnFunctionComponent[componentName]) { error('%s: Support for defaultProps will be removed from function components ' + 'in a future major release. Use JavaScript default parameters instead.', componentName); didWarnAboutDefaultPropsOnFunctionComponent[componentName] = true; } } if (typeof Component.getDerivedStateFromProps === 'function') { var _componentName3 = getComponentNameFromType(Component) || 'Unknown'; if (!didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3]) { error('%s: Function components do not support getDerivedStateFromProps.', _componentName3); didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3] = true; } } if (typeof Component.contextType === 'object' && Component.contextType !== null) { var _componentName4 = getComponentNameFromType(Component) || 'Unknown'; if (!didWarnAboutContextTypeOnFunctionComponent[_componentName4]) { error('%s: Function components do not support contextType.', _componentName4); didWarnAboutContextTypeOnFunctionComponent[_componentName4] = true; } } } } var SUSPENDED_MARKER = { dehydrated: null, treeContext: null, retryLane: NoLane }; function mountSuspenseOffscreenState(renderLanes) { return { baseLanes: renderLanes, cachePool: getSuspendedCache(), transitions: null }; } function updateSuspenseOffscreenState(prevOffscreenState, renderLanes) { var cachePool = null; return { baseLanes: mergeLanes(prevOffscreenState.baseLanes, renderLanes), cachePool: cachePool, transitions: prevOffscreenState.transitions }; } // TODO: Probably should inline this back function shouldRemainOnFallback(suspenseContext, current, workInProgress, renderLanes) { // If we're already showing a fallback, there are cases where we need to // remain on that fallback regardless of whether the content has resolved. // For example, SuspenseList coordinates when nested content appears. if (current !== null) { var suspenseState = current.memoizedState; if (suspenseState === null) { // Currently showing content. Don't hide it, even if ForceSuspenseFallback // is true. More precise name might be "ForceRemainSuspenseFallback". // Note: This is a factoring smell. Can't remain on a fallback if there's // no fallback to remain on. return false; } } // Not currently showing content. Consult the Suspense context. return hasSuspenseContext(suspenseContext, ForceSuspenseFallback); } function getRemainingWorkInPrimaryTree(current, renderLanes) { // TODO: Should not remove render lanes that were pinged during this render return removeLanes(current.childLanes, renderLanes); } function updateSuspenseComponent(current, workInProgress, renderLanes) { var nextProps = workInProgress.pendingProps; // This is used by DevTools to force a boundary to suspend. { if (shouldSuspend(workInProgress)) { workInProgress.flags |= DidCapture; } } var suspenseContext = suspenseStackCursor.current; var showFallback = false; var didSuspend = (workInProgress.flags & DidCapture) !== NoFlags; if (didSuspend || shouldRemainOnFallback(suspenseContext, current)) { // Something in this boundary's subtree already suspended. Switch to // rendering the fallback children. showFallback = true; workInProgress.flags &= ~DidCapture; } else { // Attempting the main content if (current === null || current.memoizedState !== null) { // This is a new mount or this boundary is already showing a fallback state. // Mark this subtree context as having at least one invisible parent that could // handle the fallback state. // Avoided boundaries are not considered since they cannot handle preferred fallback states. { suspenseContext = addSubtreeSuspenseContext(suspenseContext, InvisibleParentSuspenseContext); } } } suspenseContext = setDefaultShallowSuspenseContext(suspenseContext); pushSuspenseContext(workInProgress, suspenseContext); // OK, the next part is confusing. We're about to reconcile the Suspense // boundary's children. This involves some custom reconciliation logic. Two // main reasons this is so complicated. // // First, Legacy Mode has different semantics for backwards compatibility. The // primary tree will commit in an inconsistent state, so when we do the // second pass to render the fallback, we do some exceedingly, uh, clever // hacks to make that not totally break. Like transferring effects and // deletions from hidden tree. In Concurrent Mode, it's much simpler, // because we bailout on the primary tree completely and leave it in its old // state, no effects. Same as what we do for Offscreen (except that // Offscreen doesn't have the first render pass). // // Second is hydration. During hydration, the Suspense fiber has a slightly // different layout, where the child points to a dehydrated fragment, which // contains the DOM rendered by the server. // // Third, even if you set all that aside, Suspense is like error boundaries in // that we first we try to render one tree, and if that fails, we render again // and switch to a different tree. Like a try/catch block. So we have to track // which branch we're currently rendering. Ideally we would model this using // a stack. if (current === null) { // Initial mount // Special path for hydration // If we're currently hydrating, try to hydrate this boundary. tryToClaimNextHydratableInstance(workInProgress); // This could've been a dehydrated suspense component. var suspenseState = workInProgress.memoizedState; if (suspenseState !== null) { var dehydrated = suspenseState.dehydrated; if (dehydrated !== null) { return mountDehydratedSuspenseComponent(workInProgress, dehydrated); } } var nextPrimaryChildren = nextProps.children; var nextFallbackChildren = nextProps.fallback; if (showFallback) { var fallbackFragment = mountSuspenseFallbackChildren(workInProgress, nextPrimaryChildren, nextFallbackChildren, renderLanes); var primaryChildFragment = workInProgress.child; primaryChildFragment.memoizedState = mountSuspenseOffscreenState(renderLanes); workInProgress.memoizedState = SUSPENDED_MARKER; return fallbackFragment; } else { return mountSuspensePrimaryChildren(workInProgress, nextPrimaryChildren); } } else { // This is an update. // Special path for hydration var prevState = current.memoizedState; if (prevState !== null) { var _dehydrated = prevState.dehydrated; if (_dehydrated !== null) { return updateDehydratedSuspenseComponent(current, workInProgress, didSuspend, nextProps, _dehydrated, prevState, renderLanes); } } if (showFallback) { var _nextFallbackChildren = nextProps.fallback; var _nextPrimaryChildren = nextProps.children; var fallbackChildFragment = updateSuspenseFallbackChildren(current, workInProgress, _nextPrimaryChildren, _nextFallbackChildren, renderLanes); var _primaryChildFragment2 = workInProgress.child; var prevOffscreenState = current.child.memoizedState; _primaryChildFragment2.memoizedState = prevOffscreenState === null ? mountSuspenseOffscreenState(renderLanes) : updateSuspenseOffscreenState(prevOffscreenState, renderLanes); _primaryChildFragment2.childLanes = getRemainingWorkInPrimaryTree(current, renderLanes); workInProgress.memoizedState = SUSPENDED_MARKER; return fallbackChildFragment; } else { var _nextPrimaryChildren2 = nextProps.children; var _primaryChildFragment3 = updateSuspensePrimaryChildren(current, workInProgress, _nextPrimaryChildren2, renderLanes); workInProgress.memoizedState = null; return _primaryChildFragment3; } } } function mountSuspensePrimaryChildren(workInProgress, primaryChildren, renderLanes) { var mode = workInProgress.mode; var primaryChildProps = { mode: 'visible', children: primaryChildren }; var primaryChildFragment = mountWorkInProgressOffscreenFiber(primaryChildProps, mode); primaryChildFragment.return = workInProgress; workInProgress.child = primaryChildFragment; return primaryChildFragment; } function mountSuspenseFallbackChildren(workInProgress, primaryChildren, fallbackChildren, renderLanes) { var mode = workInProgress.mode; var progressedPrimaryFragment = workInProgress.child; var primaryChildProps = { mode: 'hidden', children: primaryChildren }; var primaryChildFragment; var fallbackChildFragment; if ((mode & ConcurrentMode) === NoMode && progressedPrimaryFragment !== null) { // In legacy mode, we commit the primary tree as if it successfully // completed, even though it's in an inconsistent state. primaryChildFragment = progressedPrimaryFragment; primaryChildFragment.childLanes = NoLanes; primaryChildFragment.pendingProps = primaryChildProps; if ( workInProgress.mode & ProfileMode) { // Reset the durations from the first pass so they aren't included in the // final amounts. This seems counterintuitive, since we're intentionally // not measuring part of the render phase, but this makes it match what we // do in Concurrent Mode. primaryChildFragment.actualDuration = 0; primaryChildFragment.actualStartTime = -1; primaryChildFragment.selfBaseDuration = 0; primaryChildFragment.treeBaseDuration = 0; } fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes, null); } else { primaryChildFragment = mountWorkInProgressOffscreenFiber(primaryChildProps, mode); fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes, null); } primaryChildFragment.return = workInProgress; fallbackChildFragment.return = workInProgress; primaryChildFragment.sibling = fallbackChildFragment; workInProgress.child = primaryChildFragment; return fallbackChildFragment; } function mountWorkInProgressOffscreenFiber(offscreenProps, mode, renderLanes) { // The props argument to `createFiberFromOffscreen` is `any` typed, so we use // this wrapper function to constrain it. return createFiberFromOffscreen(offscreenProps, mode, NoLanes, null); } function updateWorkInProgressOffscreenFiber(current, offscreenProps) { // The props argument to `createWorkInProgress` is `any` typed, so we use this // wrapper function to constrain it. return createWorkInProgress(current, offscreenProps); } function updateSuspensePrimaryChildren(current, workInProgress, primaryChildren, renderLanes) { var currentPrimaryChildFragment = current.child; var currentFallbackChildFragment = currentPrimaryChildFragment.sibling; var primaryChildFragment = updateWorkInProgressOffscreenFiber(currentPrimaryChildFragment, { mode: 'visible', children: primaryChildren }); if ((workInProgress.mode & ConcurrentMode) === NoMode) { primaryChildFragment.lanes = renderLanes; } primaryChildFragment.return = workInProgress; primaryChildFragment.sibling = null; if (currentFallbackChildFragment !== null) { // Delete the fallback child fragment var deletions = workInProgress.deletions; if (deletions === null) { workInProgress.deletions = [currentFallbackChildFragment]; workInProgress.flags |= ChildDeletion; } else { deletions.push(currentFallbackChildFragment); } } workInProgress.child = primaryChildFragment; return primaryChildFragment; } function updateSuspenseFallbackChildren(current, workInProgress, primaryChildren, fallbackChildren, renderLanes) { var mode = workInProgress.mode; var currentPrimaryChildFragment = current.child; var currentFallbackChildFragment = currentPrimaryChildFragment.sibling; var primaryChildProps = { mode: 'hidden', children: primaryChildren }; var primaryChildFragment; if ( // In legacy mode, we commit the primary tree as if it successfully // completed, even though it's in an inconsistent state. (mode & ConcurrentMode) === NoMode && // Make sure we're on the second pass, i.e. the primary child fragment was // already cloned. In legacy mode, the only case where this isn't true is // when DevTools forces us to display a fallback; we skip the first render // pass entirely and go straight to rendering the fallback. (In Concurrent // Mode, SuspenseList can also trigger this scenario, but this is a legacy- // only codepath.) workInProgress.child !== currentPrimaryChildFragment) { var progressedPrimaryFragment = workInProgress.child; primaryChildFragment = progressedPrimaryFragment; primaryChildFragment.childLanes = NoLanes; primaryChildFragment.pendingProps = primaryChildProps; if ( workInProgress.mode & ProfileMode) { // Reset the durations from the first pass so they aren't included in the // final amounts. This seems counterintuitive, since we're intentionally // not measuring part of the render phase, but this makes it match what we // do in Concurrent Mode. primaryChildFragment.actualDuration = 0; primaryChildFragment.actualStartTime = -1; primaryChildFragment.selfBaseDuration = currentPrimaryChildFragment.selfBaseDuration; primaryChildFragment.treeBaseDuration = currentPrimaryChildFragment.treeBaseDuration; } // The fallback fiber was added as a deletion during the first pass. // However, since we're going to remain on the fallback, we no longer want // to delete it. workInProgress.deletions = null; } else { primaryChildFragment = updateWorkInProgressOffscreenFiber(currentPrimaryChildFragment, primaryChildProps); // Since we're reusing a current tree, we need to reuse the flags, too. // (We don't do this in legacy mode, because in legacy mode we don't re-use // the current tree; see previous branch.) primaryChildFragment.subtreeFlags = currentPrimaryChildFragment.subtreeFlags & StaticMask; } var fallbackChildFragment; if (currentFallbackChildFragment !== null) { fallbackChildFragment = createWorkInProgress(currentFallbackChildFragment, fallbackChildren); } else { fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes, null); // Needs a placement effect because the parent (the Suspense boundary) already // mounted but this is a new fiber. fallbackChildFragment.flags |= Placement; } fallbackChildFragment.return = workInProgress; primaryChildFragment.return = workInProgress; primaryChildFragment.sibling = fallbackChildFragment; workInProgress.child = primaryChildFragment; return fallbackChildFragment; } function retrySuspenseComponentWithoutHydrating(current, workInProgress, renderLanes, recoverableError) { // Falling back to client rendering. Because this has performance // implications, it's considered a recoverable error, even though the user // likely won't observe anything wrong with the UI. // // The error is passed in as an argument to enforce that every caller provide // a custom message, or explicitly opt out (currently the only path that opts // out is legacy mode; every concurrent path provides an error). if (recoverableError !== null) { queueHydrationError(recoverableError); } // This will add the old fiber to the deletion list reconcileChildFibers(workInProgress, current.child, null, renderLanes); // We're now not suspended nor dehydrated. var nextProps = workInProgress.pendingProps; var primaryChildren = nextProps.children; var primaryChildFragment = mountSuspensePrimaryChildren(workInProgress, primaryChildren); // Needs a placement effect because the parent (the Suspense boundary) already // mounted but this is a new fiber. primaryChildFragment.flags |= Placement; workInProgress.memoizedState = null; return primaryChildFragment; } function mountSuspenseFallbackAfterRetryWithoutHydrating(current, workInProgress, primaryChildren, fallbackChildren, renderLanes) { var fiberMode = workInProgress.mode; var primaryChildProps = { mode: 'visible', children: primaryChildren }; var primaryChildFragment = mountWorkInProgressOffscreenFiber(primaryChildProps, fiberMode); var fallbackChildFragment = createFiberFromFragment(fallbackChildren, fiberMode, renderLanes, null); // Needs a placement effect because the parent (the Suspense // boundary) already mounted but this is a new fiber. fallbackChildFragment.flags |= Placement; primaryChildFragment.return = workInProgress; fallbackChildFragment.return = workInProgress; primaryChildFragment.sibling = fallbackChildFragment; workInProgress.child = primaryChildFragment; if ((workInProgress.mode & ConcurrentMode) !== NoMode) { // We will have dropped the effect list which contains the // deletion. We need to reconcile to delete the current child. reconcileChildFibers(workInProgress, current.child, null, renderLanes); } return fallbackChildFragment; } function mountDehydratedSuspenseComponent(workInProgress, suspenseInstance, renderLanes) { // During the first pass, we'll bail out and not drill into the children. // Instead, we'll leave the content in place and try to hydrate it later. if ((workInProgress.mode & ConcurrentMode) === NoMode) { { error('Cannot hydrate Suspense in legacy mode. Switch from ' + 'ReactDOM.hydrate(element, container) to ' + 'ReactDOMClient.hydrateRoot(container, <App />)' + '.render(element) or remove the Suspense components from ' + 'the server rendered components.'); } workInProgress.lanes = laneToLanes(SyncLane); } else if (isSuspenseInstanceFallback(suspenseInstance)) { // This is a client-only boundary. Since we won't get any content from the server // for this, we need to schedule that at a higher priority based on when it would // have timed out. In theory we could render it in this pass but it would have the // wrong priority associated with it and will prevent hydration of parent path. // Instead, we'll leave work left on it to render it in a separate commit. // TODO This time should be the time at which the server rendered response that is // a parent to this boundary was displayed. However, since we currently don't have // a protocol to transfer that time, we'll just estimate it by using the current // time. This will mean that Suspense timeouts are slightly shifted to later than // they should be. // Schedule a normal pri update to render this content. workInProgress.lanes = laneToLanes(DefaultHydrationLane); } else { // We'll continue hydrating the rest at offscreen priority since we'll already // be showing the right content coming from the server, it is no rush. workInProgress.lanes = laneToLanes(OffscreenLane); } return null; } function updateDehydratedSuspenseComponent(current, workInProgress, didSuspend, nextProps, suspenseInstance, suspenseState, renderLanes) { if (!didSuspend) { // This is the first render pass. Attempt to hydrate. // We should never be hydrating at this point because it is the first pass, // but after we've already committed once. warnIfHydrating(); if ((workInProgress.mode & ConcurrentMode) === NoMode) { return retrySuspenseComponentWithoutHydrating(current, workInProgress, renderLanes, // TODO: When we delete legacy mode, we should make this error argument // required — every concurrent mode path that causes hydration to // de-opt to client rendering should have an error message. null); } if (isSuspenseInstanceFallback(suspenseInstance)) { // This boundary is in a permanent fallback state. In this case, we'll never // get an update and we'll never be able to hydrate the final content. Let's just try the // client side render instead. var digest, message, stack; { var _getSuspenseInstanceF = getSuspenseInstanceFallbackErrorDetails(suspenseInstance); digest = _getSuspenseInstanceF.digest; message = _getSuspenseInstanceF.message; stack = _getSuspenseInstanceF.stack; } var error; if (message) { // eslint-disable-next-line react-internal/prod-error-codes error = new Error(message); } else { error = new Error('The server could not finish this Suspense boundary, likely ' + 'due to an error during server rendering. Switched to ' + 'client rendering.'); } var capturedValue = createCapturedValue(error, digest, stack); return retrySuspenseComponentWithoutHydrating(current, workInProgress, renderLanes, capturedValue); } // any context has changed, we need to treat is as if the input might have changed. var hasContextChanged = includesSomeLane(renderLanes, current.childLanes); if (didReceiveUpdate || hasContextChanged) { // This boundary has changed since the first render. This means that we are now unable to // hydrate it. We might still be able to hydrate it using a higher priority lane. var root = getWorkInProgressRoot(); if (root !== null) { var attemptHydrationAtLane = getBumpedLaneForHydration(root, renderLanes); if (attemptHydrationAtLane !== NoLane && attemptHydrationAtLane !== suspenseState.retryLane) { // Intentionally mutating since this render will get interrupted. This // is one of the very rare times where we mutate the current tree // during the render phase. suspenseState.retryLane = attemptHydrationAtLane; // TODO: Ideally this would inherit the event time of the current render var eventTime = NoTimestamp; enqueueConcurrentRenderForLane(current, attemptHydrationAtLane); scheduleUpdateOnFiber(root, current, attemptHydrationAtLane, eventTime); } } // If we have scheduled higher pri work above, this will probably just abort the render // since we now have higher priority work, but in case it doesn't, we need to prepare to // render something, if we time out. Even if that requires us to delete everything and // skip hydration. // Delay having to do this as long as the suspense timeout allows us. renderDidSuspendDelayIfPossible(); var _capturedValue = createCapturedValue(new Error('This Suspense boundary received an update before it finished ' + 'hydrating. This caused the boundary to switch to client rendering. ' + 'The usual way to fix this is to wrap the original update ' + 'in startTransition.')); return retrySuspenseComponentWithoutHydrating(current, workInProgress, renderLanes, _capturedValue); } else if (isSuspenseInstancePending(suspenseInstance)) { // This component is still pending more data from the server, so we can't hydrate its // content. We treat it as if this component suspended itself. It might seem as if // we could just try to render it client-side instead. However, this will perform a // lot of unnecessary work and is unlikely to complete since it often will suspend // on missing data anyway. Additionally, the server might be able to render more // than we can on the client yet. In that case we'd end up with more fallback states // on the client than if we just leave it alone. If the server times out or errors // these should update this boundary to the permanent Fallback state instead. // Mark it as having captured (i.e. suspended). workInProgress.flags |= DidCapture; // Leave the child in place. I.e. the dehydrated fragment. workInProgress.child = current.child; // Register a callback to retry this boundary once the server has sent the result. var retry = retryDehydratedSuspenseBoundary.bind(null, current); registerSuspenseInstanceRetry(suspenseInstance, retry); return null; } else { // This is the first attempt. reenterHydrationStateFromDehydratedSuspenseInstance(workInProgress, suspenseInstance, suspenseState.treeContext); var primaryChildren = nextProps.children; var primaryChildFragment = mountSuspensePrimaryChildren(workInProgress, primaryChildren); // Mark the children as hydrating. This is a fast path to know whether this // tree is part of a hydrating tree. This is used to determine if a child // node has fully mounted yet, and for scheduling event replaying. // Conceptually this is similar to Placement in that a new subtree is // inserted into the React tree here. It just happens to not need DOM // mutations because it already exists. primaryChildFragment.flags |= Hydrating; return primaryChildFragment; } } else { // This is the second render pass. We already attempted to hydrated, but // something either suspended or errored. if (workInProgress.flags & ForceClientRender) { // Something errored during hydration. Try again without hydrating. workInProgress.flags &= ~ForceClientRender; var _capturedValue2 = createCapturedValue(new Error('There was an error while hydrating this Suspense boundary. ' + 'Switched to client rendering.')); return retrySuspenseComponentWithoutHydrating(current, workInProgress, renderLanes, _capturedValue2); } else if (workInProgress.memoizedState !== null) { // Something suspended and we should still be in dehydrated mode. // Leave the existing child in place. workInProgress.child = current.child; // The dehydrated completion pass expects this flag to be there // but the normal suspense pass doesn't. workInProgress.flags |= DidCapture; return null; } else { // Suspended but we should no longer be in dehydrated mode. // Therefore we now have to render the fallback. var nextPrimaryChildren = nextProps.children; var nextFallbackChildren = nextProps.fallback; var fallbackChildFragment = mountSuspenseFallbackAfterRetryWithoutHydrating(current, workInProgress, nextPrimaryChildren, nextFallbackChildren, renderLanes); var _primaryChildFragment4 = workInProgress.child; _primaryChildFragment4.memoizedState = mountSuspenseOffscreenState(renderLanes); workInProgress.memoizedState = SUSPENDED_MARKER; return fallbackChildFragment; } } } function scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) { fiber.lanes = mergeLanes(fiber.lanes, renderLanes); var alternate = fiber.alternate; if (alternate !== null) { alternate.lanes = mergeLanes(alternate.lanes, renderLanes); } scheduleContextWorkOnParentPath(fiber.return, renderLanes, propagationRoot); } function propagateSuspenseContextChange(workInProgress, firstChild, renderLanes) { // Mark any Suspense boundaries with fallbacks as having work to do. // If they were previously forced into fallbacks, they may now be able // to unblock. var node = firstChild; while (node !== null) { if (node.tag === SuspenseComponent) { var state = node.memoizedState; if (state !== null) { scheduleSuspenseWorkOnFiber(node, renderLanes, workInProgress); } } else if (node.tag === SuspenseListComponent) { // If the tail is hidden there might not be an Suspense boundaries // to schedule work on. In this case we have to schedule it on the // list itself. // We don't have to traverse to the children of the list since // the list will propagate the change when it rerenders. scheduleSuspenseWorkOnFiber(node, renderLanes, workInProgress); } else if (node.child !== null) { node.child.return = node; node = node.child; continue; } if (node === workInProgress) { return; } while (node.sibling === null) { if (node.return === null || node.return === workInProgress) { return; } node = node.return; } node.sibling.return = node.return; node = node.sibling; } } function findLastContentRow(firstChild) { // This is going to find the last row among these children that is already // showing content on the screen, as opposed to being in fallback state or // new. If a row has multiple Suspense boundaries, any of them being in the // fallback state, counts as the whole row being in a fallback state. // Note that the "rows" will be workInProgress, but any nested children // will still be current since we haven't rendered them yet. The mounted // order may not be the same as the new order. We use the new order. var row = firstChild; var lastContentRow = null; while (row !== null) { var currentRow = row.alternate; // New rows can't be content rows. if (currentRow !== null && findFirstSuspended(currentRow) === null) { lastContentRow = row; } row = row.sibling; } return lastContentRow; } function validateRevealOrder(revealOrder) { { if (revealOrder !== undefined && revealOrder !== 'forwards' && revealOrder !== 'backwards' && revealOrder !== 'together' && !didWarnAboutRevealOrder[revealOrder]) { didWarnAboutRevealOrder[revealOrder] = true; if (typeof revealOrder === 'string') { switch (revealOrder.toLowerCase()) { case 'together': case 'forwards': case 'backwards': { error('"%s" is not a valid value for revealOrder on <SuspenseList />. ' + 'Use lowercase "%s" instead.', revealOrder, revealOrder.toLowerCase()); break; } case 'forward': case 'backward': { error('"%s" is not a valid value for revealOrder on <SuspenseList />. ' + 'React uses the -s suffix in the spelling. Use "%ss" instead.', revealOrder, revealOrder.toLowerCase()); break; } default: error('"%s" is not a supported revealOrder on <SuspenseList />. ' + 'Did you mean "together", "forwards" or "backwards"?', revealOrder); break; } } else { error('%s is not a supported value for revealOrder on <SuspenseList />. ' + 'Did you mean "together", "forwards" or "backwards"?', revealOrder); } } } } function validateTailOptions(tailMode, revealOrder) { { if (tailMode !== undefined && !didWarnAboutTailOptions[tailMode]) { if (tailMode !== 'collapsed' && tailMode !== 'hidden') { didWarnAboutTailOptions[tailMode] = true; error('"%s" is not a supported value for tail on <SuspenseList />. ' + 'Did you mean "collapsed" or "hidden"?', tailMode); } else if (revealOrder !== 'forwards' && revealOrder !== 'backwards') { didWarnAboutTailOptions[tailMode] = true; error('<SuspenseList tail="%s" /> is only valid if revealOrder is ' + '"forwards" or "backwards". ' + 'Did you mean to specify revealOrder="forwards"?', tailMode); } } } } function validateSuspenseListNestedChild(childSlot, index) { { var isAnArray = isArray(childSlot); var isIterable = !isAnArray && typeof getIteratorFn(childSlot) === 'function'; if (isAnArray || isIterable) { var type = isAnArray ? 'array' : 'iterable'; error('A nested %s was passed to row #%s in <SuspenseList />. Wrap it in ' + 'an additional SuspenseList to configure its revealOrder: ' + '<SuspenseList revealOrder=...> ... ' + '<SuspenseList revealOrder=...>{%s}</SuspenseList> ... ' + '</SuspenseList>', type, index, type); return false; } } return true; } function validateSuspenseListChildren(children, revealOrder) { { if ((revealOrder === 'forwards' || revealOrder === 'backwards') && children !== undefined && children !== null && children !== false) { if (isArray(children)) { for (var i = 0; i < children.length; i++) { if (!validateSuspenseListNestedChild(children[i], i)) { return; } } } else { var iteratorFn = getIteratorFn(children); if (typeof iteratorFn === 'function') { var childrenIterator = iteratorFn.call(children); if (childrenIterator) { var step = childrenIterator.next(); var _i = 0; for (; !step.done; step = childrenIterator.next()) { if (!validateSuspenseListNestedChild(step.value, _i)) { return; } _i++; } } } else { error('A single row was passed to a <SuspenseList revealOrder="%s" />. ' + 'This is not useful since it needs multiple rows. ' + 'Did you mean to pass multiple children or an array?', revealOrder); } } } } } function initSuspenseListRenderState(workInProgress, isBackwards, tail, lastContentRow, tailMode) { var renderState = workInProgress.memoizedState; if (renderState === null) { workInProgress.memoizedState = { isBackwards: isBackwards, rendering: null, renderingStartTime: 0, last: lastContentRow, tail: tail, tailMode: tailMode }; } else { // We can reuse the existing object from previous renders. renderState.isBackwards = isBackwards; renderState.rendering = null; renderState.renderingStartTime = 0; renderState.last = lastContentRow; renderState.tail = tail; renderState.tailMode = tailMode; } } // This can end up rendering this component multiple passes. // The first pass splits the children fibers into two sets. A head and tail. // We first render the head. If anything is in fallback state, we do another // pass through beginWork to rerender all children (including the tail) with // the force suspend context. If the first render didn't have anything in // in fallback state. Then we render each row in the tail one-by-one. // That happens in the completeWork phase without going back to beginWork. function updateSuspenseListComponent(current, workInProgress, renderLanes) { var nextProps = workInProgress.pendingProps; var revealOrder = nextProps.revealOrder; var tailMode = nextProps.tail; var newChildren = nextProps.children; validateRevealOrder(revealOrder); validateTailOptions(tailMode, revealOrder); validateSuspenseListChildren(newChildren, revealOrder); reconcileChildren(current, workInProgress, newChildren, renderLanes); var suspenseContext = suspenseStackCursor.current; var shouldForceFallback = hasSuspenseContext(suspenseContext, ForceSuspenseFallback); if (shouldForceFallback) { suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback); workInProgress.flags |= DidCapture; } else { var didSuspendBefore = current !== null && (current.flags & DidCapture) !== NoFlags; if (didSuspendBefore) { // If we previously forced a fallback, we need to schedule work // on any nested boundaries to let them know to try to render // again. This is the same as context updating. propagateSuspenseContextChange(workInProgress, workInProgress.child, renderLanes); } suspenseContext = setDefaultShallowSuspenseContext(suspenseContext); } pushSuspenseContext(workInProgress, suspenseContext); if ((workInProgress.mode & ConcurrentMode) === NoMode) { // In legacy mode, SuspenseList doesn't work so we just // use make it a noop by treating it as the default revealOrder. workInProgress.memoizedState = null; } else { switch (revealOrder) { case 'forwards': { var lastContentRow = findLastContentRow(workInProgress.child); var tail; if (lastContentRow === null) { // The whole list is part of the tail. // TODO: We could fast path by just rendering the tail now. tail = workInProgress.child; workInProgress.child = null; } else { // Disconnect the tail rows after the content row. // We're going to render them separately later. tail = lastContentRow.sibling; lastContentRow.sibling = null; } initSuspenseListRenderState(workInProgress, false, // isBackwards tail, lastContentRow, tailMode); break; } case 'backwards': { // We're going to find the first row that has existing content. // At the same time we're going to reverse the list of everything // we pass in the meantime. That's going to be our tail in reverse // order. var _tail = null; var row = workInProgress.child; workInProgress.child = null; while (row !== null) { var currentRow = row.alternate; // New rows can't be content rows. if (currentRow !== null && findFirstSuspended(currentRow) === null) { // This is the beginning of the main content. workInProgress.child = row; break; } var nextRow = row.sibling; row.sibling = _tail; _tail = row; row = nextRow; } // TODO: If workInProgress.child is null, we can continue on the tail immediately. initSuspenseListRenderState(workInProgress, true, // isBackwards _tail, null, // last tailMode); break; } case 'together': { initSuspenseListRenderState(workInProgress, false, // isBackwards null, // tail null, // last undefined); break; } default: { // The default reveal order is the same as not having // a boundary. workInProgress.memoizedState = null; } } } return workInProgress.child; } function updatePortalComponent(current, workInProgress, renderLanes) { pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); var nextChildren = workInProgress.pendingProps; if (current === null) { // Portals are special because we don't append the children during mount // but at commit. Therefore we need to track insertions which the normal // flow doesn't do during mount. This doesn't happen at the root because // the root always starts with a "current" with a null child. // TODO: Consider unifying this with how the root works. workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderLanes); } else { reconcileChildren(current, workInProgress, nextChildren, renderLanes); } return workInProgress.child; } var hasWarnedAboutUsingNoValuePropOnContextProvider = false; function updateContextProvider(current, workInProgress, renderLanes) { var providerType = workInProgress.type; var context = providerType._context; var newProps = workInProgress.pendingProps; var oldProps = workInProgress.memoizedProps; var newValue = newProps.value; { if (!('value' in newProps)) { if (!hasWarnedAboutUsingNoValuePropOnContextProvider) { hasWarnedAboutUsingNoValuePropOnContextProvider = true; error('The `value` prop is required for the `<Context.Provider>`. Did you misspell it or forget to pass it?'); } } var providerPropTypes = workInProgress.type.propTypes; if (providerPropTypes) { checkPropTypes(providerPropTypes, newProps, 'prop', 'Context.Provider'); } } pushProvider(workInProgress, context, newValue); { if (oldProps !== null) { var oldValue = oldProps.value; if (objectIs(oldValue, newValue)) { // No change. Bailout early if children are the same. if (oldProps.children === newProps.children && !hasContextChanged()) { return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); } } else { // The context value changed. Search for matching consumers and schedule // them to update. propagateContextChange(workInProgress, context, renderLanes); } } } var newChildren = newProps.children; reconcileChildren(current, workInProgress, newChildren, renderLanes); return workInProgress.child; } var hasWarnedAboutUsingContextAsConsumer = false; function updateContextConsumer(current, workInProgress, renderLanes) { var context = workInProgress.type; // The logic below for Context differs depending on PROD or DEV mode. In // DEV mode, we create a separate object for Context.Consumer that acts // like a proxy to Context. This proxy object adds unnecessary code in PROD // so we use the old behaviour (Context.Consumer references Context) to // reduce size and overhead. The separate object references context via // a property called "_context", which also gives us the ability to check // in DEV mode if this property exists or not and warn if it does not. { if (context._context === undefined) { // This may be because it's a Context (rather than a Consumer). // Or it may be because it's older React where they're the same thing. // We only want to warn if we're sure it's a new React. if (context !== context.Consumer) { if (!hasWarnedAboutUsingContextAsConsumer) { hasWarnedAboutUsingContextAsConsumer = true; error('Rendering <Context> directly is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?'); } } } else { context = context._context; } } var newProps = workInProgress.pendingProps; var render = newProps.children; { if (typeof render !== 'function') { error('A context consumer was rendered with multiple children, or a child ' + "that isn't a function. A context consumer expects a single child " + 'that is a function. If you did pass a function, make sure there ' + 'is no trailing or leading whitespace around it.'); } } prepareToReadContext(workInProgress, renderLanes); var newValue = readContext(context); { markComponentRenderStarted(workInProgress); } var newChildren; { ReactCurrentOwner$1.current = workInProgress; setIsRendering(true); newChildren = render(newValue); setIsRendering(false); } { markComponentRenderStopped(); } // React DevTools reads this flag. workInProgress.flags |= PerformedWork; reconcileChildren(current, workInProgress, newChildren, renderLanes); return workInProgress.child; } function markWorkInProgressReceivedUpdate() { didReceiveUpdate = true; } function resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress) { if ((workInProgress.mode & ConcurrentMode) === NoMode) { if (current !== null) { // A lazy component only mounts if it suspended inside a non- // concurrent tree, in an inconsistent state. We want to treat it like // a new mount, even though an empty version of it already committed. // Disconnect the alternate pointers. current.alternate = null; workInProgress.alternate = null; // Since this is conceptually a new fiber, schedule a Placement effect workInProgress.flags |= Placement; } } } function bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) { if (current !== null) { // Reuse previous dependencies workInProgress.dependencies = current.dependencies; } { // Don't update "base" render times for bailouts. stopProfilerTimerIfRunning(); } markSkippedUpdateLanes(workInProgress.lanes); // Check if the children have any pending work. if (!includesSomeLane(renderLanes, workInProgress.childLanes)) { // The children don't have any work either. We can skip them. // TODO: Once we add back resuming, we should check if the children are // a work-in-progress set. If so, we need to transfer their effects. { return null; } } // This fiber doesn't have work, but its subtree does. Clone the child // fibers and continue. cloneChildFibers(current, workInProgress); return workInProgress.child; } function remountFiber(current, oldWorkInProgress, newWorkInProgress) { { var returnFiber = oldWorkInProgress.return; if (returnFiber === null) { // eslint-disable-next-line react-internal/prod-error-codes throw new Error('Cannot swap the root fiber.'); } // Disconnect from the old current. // It will get deleted. current.alternate = null; oldWorkInProgress.alternate = null; // Connect to the new tree. newWorkInProgress.index = oldWorkInProgress.index; newWorkInProgress.sibling = oldWorkInProgress.sibling; newWorkInProgress.return = oldWorkInProgress.return; newWorkInProgress.ref = oldWorkInProgress.ref; // Replace the child/sibling pointers above it. if (oldWorkInProgress === returnFiber.child) { returnFiber.child = newWorkInProgress; } else { var prevSibling = returnFiber.child; if (prevSibling === null) { // eslint-disable-next-line react-internal/prod-error-codes throw new Error('Expected parent to have a child.'); } while (prevSibling.sibling !== oldWorkInProgress) { prevSibling = prevSibling.sibling; if (prevSibling === null) { // eslint-disable-next-line react-internal/prod-error-codes throw new Error('Expected to find the previous sibling.'); } } prevSibling.sibling = newWorkInProgress; } // Delete the old fiber and place the new one. // Since the old fiber is disconnected, we have to schedule it manually. var deletions = returnFiber.deletions; if (deletions === null) { returnFiber.deletions = [current]; returnFiber.flags |= ChildDeletion; } else { deletions.push(current); } newWorkInProgress.flags |= Placement; // Restart work from the new fiber. return newWorkInProgress; } } function checkScheduledUpdateOrContext(current, renderLanes) { // Before performing an early bailout, we must check if there are pending // updates or context. var updateLanes = current.lanes; if (includesSomeLane(updateLanes, renderLanes)) { return true; } // No pending update, but because context is propagated lazily, we need return false; } function attemptEarlyBailoutIfNoScheduledUpdate(current, workInProgress, renderLanes) { // This fiber does not have any pending work. Bailout without entering // the begin phase. There's still some bookkeeping we that needs to be done // in this optimized path, mostly pushing stuff onto the stack. switch (workInProgress.tag) { case HostRoot: pushHostRootContext(workInProgress); var root = workInProgress.stateNode; resetHydrationState(); break; case HostComponent: pushHostContext(workInProgress); break; case ClassComponent: { var Component = workInProgress.type; if (isContextProvider(Component)) { pushContextProvider(workInProgress); } break; } case HostPortal: pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); break; case ContextProvider: { var newValue = workInProgress.memoizedProps.value; var context = workInProgress.type._context; pushProvider(workInProgress, context, newValue); break; } case Profiler: { // Profiler should only call onRender when one of its descendants actually rendered. var hasChildWork = includesSomeLane(renderLanes, workInProgress.childLanes); if (hasChildWork) { workInProgress.flags |= Update; } { // Reset effect durations for the next eventual effect phase. // These are reset during render to allow the DevTools commit hook a chance to read them, var stateNode = workInProgress.stateNode; stateNode.effectDuration = 0; stateNode.passiveEffectDuration = 0; } } break; case SuspenseComponent: { var state = workInProgress.memoizedState; if (state !== null) { if (state.dehydrated !== null) { pushSuspenseContext(workInProgress, setDefaultShallowSuspenseContext(suspenseStackCursor.current)); // We know that this component will suspend again because if it has // been unsuspended it has committed as a resolved Suspense component. // If it needs to be retried, it should have work scheduled on it. workInProgress.flags |= DidCapture; // We should never render the children of a dehydrated boundary until we // upgrade it. We return null instead of bailoutOnAlreadyFinishedWork. return null; } // If this boundary is currently timed out, we need to decide // whether to retry the primary children, or to skip over it and // go straight to the fallback. Check the priority of the primary // child fragment. var primaryChildFragment = workInProgress.child; var primaryChildLanes = primaryChildFragment.childLanes; if (includesSomeLane(renderLanes, primaryChildLanes)) { // The primary children have pending work. Use the normal path // to attempt to render the primary children again. return updateSuspenseComponent(current, workInProgress, renderLanes); } else { // The primary child fragment does not have pending work marked // on it pushSuspenseContext(workInProgress, setDefaultShallowSuspenseContext(suspenseStackCursor.current)); // The primary children do not have pending work with sufficient // priority. Bailout. var child = bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); if (child !== null) { // The fallback children have pending work. Skip over the // primary children and work on the fallback. return child.sibling; } else { // Note: We can return `null` here because we already checked // whether there were nested context consumers, via the call to // `bailoutOnAlreadyFinishedWork` above. return null; } } } else { pushSuspenseContext(workInProgress, setDefaultShallowSuspenseContext(suspenseStackCursor.current)); } break; } case SuspenseListComponent: { var didSuspendBefore = (current.flags & DidCapture) !== NoFlags; var _hasChildWork = includesSomeLane(renderLanes, workInProgress.childLanes); if (didSuspendBefore) { if (_hasChildWork) { // If something was in fallback state last time, and we have all the // same children then we're still in progressive loading state. // Something might get unblocked by state updates or retries in the // tree which will affect the tail. So we need to use the normal // path to compute the correct tail. return updateSuspenseListComponent(current, workInProgress, renderLanes); } // If none of the children had any work, that means that none of // them got retried so they'll still be blocked in the same way // as before. We can fast bail out. workInProgress.flags |= DidCapture; } // If nothing suspended before and we're rendering the same children, // then the tail doesn't matter. Anything new that suspends will work // in the "together" mode, so we can continue from the state we had. var renderState = workInProgress.memoizedState; if (renderState !== null) { // Reset to the "together" mode in case we've started a different // update in the past but didn't complete it. renderState.rendering = null; renderState.tail = null; renderState.lastEffect = null; } pushSuspenseContext(workInProgress, suspenseStackCursor.current); if (_hasChildWork) { break; } else { // If none of the children had any work, that means that none of // them got retried so they'll still be blocked in the same way // as before. We can fast bail out. return null; } } case OffscreenComponent: case LegacyHiddenComponent: { // Need to check if the tree still needs to be deferred. This is // almost identical to the logic used in the normal update path, // so we'll just enter that. The only difference is we'll bail out // at the next level instead of this one, because the child props // have not changed. Which is fine. // TODO: Probably should refactor `beginWork` to split the bailout // path from the normal path. I'm tempted to do a labeled break here // but I won't :) workInProgress.lanes = NoLanes; return updateOffscreenComponent(current, workInProgress, renderLanes); } } return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); } function beginWork(current, workInProgress, renderLanes) { { if (workInProgress._debugNeedsRemount && current !== null) { // This will restart the begin phase with a new fiber. return remountFiber(current, workInProgress, createFiberFromTypeAndProps(workInProgress.type, workInProgress.key, workInProgress.pendingProps, workInProgress._debugOwner || null, workInProgress.mode, workInProgress.lanes)); } } if (current !== null) { var oldProps = current.memoizedProps; var newProps = workInProgress.pendingProps; if (oldProps !== newProps || hasContextChanged() || ( // Force a re-render if the implementation changed due to hot reload: workInProgress.type !== current.type )) { // If props or context changed, mark the fiber as having performed work. // This may be unset if the props are determined to be equal later (memo). didReceiveUpdate = true; } else { // Neither props nor legacy context changes. Check if there's a pending // update or context change. var hasScheduledUpdateOrContext = checkScheduledUpdateOrContext(current, renderLanes); if (!hasScheduledUpdateOrContext && // If this is the second pass of an error or suspense boundary, there // may not be work scheduled on `current`, so we check for this flag. (workInProgress.flags & DidCapture) === NoFlags) { // No pending updates or context. Bail out now. didReceiveUpdate = false; return attemptEarlyBailoutIfNoScheduledUpdate(current, workInProgress, renderLanes); } if ((current.flags & ForceUpdateForLegacySuspense) !== NoFlags) { // This is a special case that only exists for legacy mode. // See https://github.com/facebook/react/pull/19216. didReceiveUpdate = true; } else { // An update was scheduled on this fiber, but there are no new props // nor legacy context. Set this to false. If an update queue or context // consumer produces a changed value, it will set this to true. Otherwise, // the component will assume the children have not changed and bail out. didReceiveUpdate = false; } } } else { didReceiveUpdate = false; if (getIsHydrating() && isForkedChild(workInProgress)) { // Check if this child belongs to a list of muliple children in // its parent. // // In a true multi-threaded implementation, we would render children on // parallel threads. This would represent the beginning of a new render // thread for this subtree. // // We only use this for id generation during hydration, which is why the // logic is located in this special branch. var slotIndex = workInProgress.index; var numberOfForks = getForksAtLevel(); pushTreeId(workInProgress, numberOfForks, slotIndex); } } // Before entering the begin phase, clear pending update priority. // TODO: This assumes that we're about to evaluate the component and process // the update queue. However, there's an exception: SimpleMemoComponent // sometimes bails out later in the begin phase. This indicates that we should // move this assignment out of the common path and into each branch. workInProgress.lanes = NoLanes; switch (workInProgress.tag) { case IndeterminateComponent: { return mountIndeterminateComponent(current, workInProgress, workInProgress.type, renderLanes); } case LazyComponent: { var elementType = workInProgress.elementType; return mountLazyComponent(current, workInProgress, elementType, renderLanes); } case FunctionComponent: { var Component = workInProgress.type; var unresolvedProps = workInProgress.pendingProps; var resolvedProps = workInProgress.elementType === Component ? unresolvedProps : resolveDefaultProps(Component, unresolvedProps); return updateFunctionComponent(current, workInProgress, Component, resolvedProps, renderLanes); } case ClassComponent: { var _Component = workInProgress.type; var _unresolvedProps = workInProgress.pendingProps; var _resolvedProps = workInProgress.elementType === _Component ? _unresolvedProps : resolveDefaultProps(_Component, _unresolvedProps); return updateClassComponent(current, workInProgress, _Component, _resolvedProps, renderLanes); } case HostRoot: return updateHostRoot(current, workInProgress, renderLanes); case HostComponent: return updateHostComponent(current, workInProgress, renderLanes); case HostText: return updateHostText(current, workInProgress); case SuspenseComponent: return updateSuspenseComponent(current, workInProgress, renderLanes); case HostPortal: return updatePortalComponent(current, workInProgress, renderLanes); case ForwardRef: { var type = workInProgress.type; var _unresolvedProps2 = workInProgress.pendingProps; var _resolvedProps2 = workInProgress.elementType === type ? _unresolvedProps2 : resolveDefaultProps(type, _unresolvedProps2); return updateForwardRef(current, workInProgress, type, _resolvedProps2, renderLanes); } case Fragment: return updateFragment(current, workInProgress, renderLanes); case Mode: return updateMode(current, workInProgress, renderLanes); case Profiler: return updateProfiler(current, workInProgress, renderLanes); case ContextProvider: return updateContextProvider(current, workInProgress, renderLanes); case ContextConsumer: return updateContextConsumer(current, workInProgress, renderLanes); case MemoComponent: { var _type2 = workInProgress.type; var _unresolvedProps3 = workInProgress.pendingProps; // Resolve outer props first, then resolve inner props. var _resolvedProps3 = resolveDefaultProps(_type2, _unresolvedProps3); { if (workInProgress.type !== workInProgress.elementType) { var outerPropTypes = _type2.propTypes; if (outerPropTypes) { checkPropTypes(outerPropTypes, _resolvedProps3, // Resolved for outer only 'prop', getComponentNameFromType(_type2)); } } } _resolvedProps3 = resolveDefaultProps(_type2.type, _resolvedProps3); return updateMemoComponent(current, workInProgress, _type2, _resolvedProps3, renderLanes); } case SimpleMemoComponent: { return updateSimpleMemoComponent(current, workInProgress, workInProgress.type, workInProgress.pendingProps, renderLanes); } case IncompleteClassComponent: { var _Component2 = workInProgress.type; var _unresolvedProps4 = workInProgress.pendingProps; var _resolvedProps4 = workInProgress.elementType === _Component2 ? _unresolvedProps4 : resolveDefaultProps(_Component2, _unresolvedProps4); return mountIncompleteClassComponent(current, workInProgress, _Component2, _resolvedProps4, renderLanes); } case SuspenseListComponent: { return updateSuspenseListComponent(current, workInProgress, renderLanes); } case ScopeComponent: { break; } case OffscreenComponent: { return updateOffscreenComponent(current, workInProgress, renderLanes); } } throw new Error("Unknown unit of work tag (" + workInProgress.tag + "). This error is likely caused by a bug in " + 'React. Please file an issue.'); } function markUpdate(workInProgress) { // Tag the fiber with an update effect. This turns a Placement into // a PlacementAndUpdate. workInProgress.flags |= Update; } function markRef$1(workInProgress) { workInProgress.flags |= Ref; { workInProgress.flags |= RefStatic; } } var appendAllChildren; var updateHostContainer; var updateHostComponent$1; var updateHostText$1; { // Mutation mode appendAllChildren = function (parent, workInProgress, needsVisibilityToggle, isHidden) { // We only have the top Fiber that was created but we need recurse down its // children to find all the terminal nodes. var node = workInProgress.child; while (node !== null) { if (node.tag === HostComponent || node.tag === HostText) { appendInitialChild(parent, node.stateNode); } else if (node.tag === HostPortal) ; else if (node.child !== null) { node.child.return = node; node = node.child; continue; } if (node === workInProgress) { return; } while (node.sibling === null) { if (node.return === null || node.return === workInProgress) { return; } node = node.return; } node.sibling.return = node.return; node = node.sibling; } }; updateHostContainer = function (current, workInProgress) {// Noop }; updateHostComponent$1 = function (current, workInProgress, type, newProps, rootContainerInstance) { // If we have an alternate, that means this is an update and we need to // schedule a side-effect to do the updates. var oldProps = current.memoizedProps; if (oldProps === newProps) { // In mutation mode, this is sufficient for a bailout because // we won't touch this node even if children changed. return; } // If we get updated because one of our children updated, we don't // have newProps so we'll have to reuse them. // TODO: Split the update API as separate for the props vs. children. // Even better would be if children weren't special cased at all tho. var instance = workInProgress.stateNode; var currentHostContext = getHostContext(); // TODO: Experiencing an error where oldProps is null. Suggests a host // component is hitting the resume path. Figure out why. Possibly // related to `hidden`. var updatePayload = prepareUpdate(instance, type, oldProps, newProps, rootContainerInstance, currentHostContext); // TODO: Type this specific to this type of component. workInProgress.updateQueue = updatePayload; // If the update payload indicates that there is a change or if there // is a new ref we mark this as an update. All the work is done in commitWork. if (updatePayload) { markUpdate(workInProgress); } }; updateHostText$1 = function (current, workInProgress, oldText, newText) { // If the text differs, mark it as an update. All the work in done in commitWork. if (oldText !== newText) { markUpdate(workInProgress); } }; } function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { if (getIsHydrating()) { // If we're hydrating, we should consume as many items as we can // so we don't leave any behind. return; } switch (renderState.tailMode) { case 'hidden': { // Any insertions at the end of the tail list after this point // should be invisible. If there are already mounted boundaries // anything before them are not considered for collapsing. // Therefore we need to go through the whole tail to find if // there are any. var tailNode = renderState.tail; var lastTailNode = null; while (tailNode !== null) { if (tailNode.alternate !== null) { lastTailNode = tailNode; } tailNode = tailNode.sibling; } // Next we're simply going to delete all insertions after the // last rendered item. if (lastTailNode === null) { // All remaining items in the tail are insertions. renderState.tail = null; } else { // Detach the insertion after the last node that was already // inserted. lastTailNode.sibling = null; } break; } case 'collapsed': { // Any insertions at the end of the tail list after this point // should be invisible. If there are already mounted boundaries // anything before them are not considered for collapsing. // Therefore we need to go through the whole tail to find if // there are any. var _tailNode = renderState.tail; var _lastTailNode = null; while (_tailNode !== null) { if (_tailNode.alternate !== null) { _lastTailNode = _tailNode; } _tailNode = _tailNode.sibling; } // Next we're simply going to delete all insertions after the // last rendered item. if (_lastTailNode === null) { // All remaining items in the tail are insertions. if (!hasRenderedATailFallback && renderState.tail !== null) { // We suspended during the head. We want to show at least one // row at the tail. So we'll keep on and cut off the rest. renderState.tail.sibling = null; } else { renderState.tail = null; } } else { // Detach the insertion after the last node that was already // inserted. _lastTailNode.sibling = null; } break; } } } function bubbleProperties(completedWork) { var didBailout = completedWork.alternate !== null && completedWork.alternate.child === completedWork.child; var newChildLanes = NoLanes; var subtreeFlags = NoFlags; if (!didBailout) { // Bubble up the earliest expiration time. if ( (completedWork.mode & ProfileMode) !== NoMode) { // In profiling mode, resetChildExpirationTime is also used to reset // profiler durations. var actualDuration = completedWork.actualDuration; var treeBaseDuration = completedWork.selfBaseDuration; var child = completedWork.child; while (child !== null) { newChildLanes = mergeLanes(newChildLanes, mergeLanes(child.lanes, child.childLanes)); subtreeFlags |= child.subtreeFlags; subtreeFlags |= child.flags; // When a fiber is cloned, its actualDuration is reset to 0. This value will // only be updated if work is done on the fiber (i.e. it doesn't bailout). // When work is done, it should bubble to the parent's actualDuration. If // the fiber has not been cloned though, (meaning no work was done), then // this value will reflect the amount of time spent working on a previous // render. In that case it should not bubble. We determine whether it was // cloned by comparing the child pointer. actualDuration += child.actualDuration; treeBaseDuration += child.treeBaseDuration; child = child.sibling; } completedWork.actualDuration = actualDuration; completedWork.treeBaseDuration = treeBaseDuration; } else { var _child = completedWork.child; while (_child !== null) { newChildLanes = mergeLanes(newChildLanes, mergeLanes(_child.lanes, _child.childLanes)); subtreeFlags |= _child.subtreeFlags; subtreeFlags |= _child.flags; // Update the return pointer so the tree is consistent. This is a code // smell because it assumes the commit phase is never concurrent with // the render phase. Will address during refactor to alternate model. _child.return = completedWork; _child = _child.sibling; } } completedWork.subtreeFlags |= subtreeFlags; } else { // Bubble up the earliest expiration time. if ( (completedWork.mode & ProfileMode) !== NoMode) { // In profiling mode, resetChildExpirationTime is also used to reset // profiler durations. var _treeBaseDuration = completedWork.selfBaseDuration; var _child2 = completedWork.child; while (_child2 !== null) { newChildLanes = mergeLanes(newChildLanes, mergeLanes(_child2.lanes, _child2.childLanes)); // "Static" flags share the lifetime of the fiber/hook they belong to, // so we should bubble those up even during a bailout. All the other // flags have a lifetime only of a single render + commit, so we should // ignore them. subtreeFlags |= _child2.subtreeFlags & StaticMask; subtreeFlags |= _child2.flags & StaticMask; _treeBaseDuration += _child2.treeBaseDuration; _child2 = _child2.sibling; } completedWork.treeBaseDuration = _treeBaseDuration; } else { var _child3 = completedWork.child; while (_child3 !== null) { newChildLanes = mergeLanes(newChildLanes, mergeLanes(_child3.lanes, _child3.childLanes)); // "Static" flags share the lifetime of the fiber/hook they belong to, // so we should bubble those up even during a bailout. All the other // flags have a lifetime only of a single render + commit, so we should // ignore them. subtreeFlags |= _child3.subtreeFlags & StaticMask; subtreeFlags |= _child3.flags & StaticMask; // Update the return pointer so the tree is consistent. This is a code // smell because it assumes the commit phase is never concurrent with // the render phase. Will address during refactor to alternate model. _child3.return = completedWork; _child3 = _child3.sibling; } } completedWork.subtreeFlags |= subtreeFlags; } completedWork.childLanes = newChildLanes; return didBailout; } function completeDehydratedSuspenseBoundary(current, workInProgress, nextState) { if (hasUnhydratedTailNodes() && (workInProgress.mode & ConcurrentMode) !== NoMode && (workInProgress.flags & DidCapture) === NoFlags) { warnIfUnhydratedTailNodes(workInProgress); resetHydrationState(); workInProgress.flags |= ForceClientRender | Incomplete | ShouldCapture; return false; } var wasHydrated = popHydrationState(workInProgress); if (nextState !== null && nextState.dehydrated !== null) { // We might be inside a hydration state the first time we're picking up this // Suspense boundary, and also after we've reentered it for further hydration. if (current === null) { if (!wasHydrated) { throw new Error('A dehydrated suspense component was completed without a hydrated node. ' + 'This is probably a bug in React.'); } prepareToHydrateHostSuspenseInstance(workInProgress); bubbleProperties(workInProgress); { if ((workInProgress.mode & ProfileMode) !== NoMode) { var isTimedOutSuspense = nextState !== null; if (isTimedOutSuspense) { // Don't count time spent in a timed out Suspense subtree as part of the base duration. var primaryChildFragment = workInProgress.child; if (primaryChildFragment !== null) { // $FlowFixMe Flow doesn't support type casting in combination with the -= operator workInProgress.treeBaseDuration -= primaryChildFragment.treeBaseDuration; } } } } return false; } else { // We might have reentered this boundary to hydrate it. If so, we need to reset the hydration // state since we're now exiting out of it. popHydrationState doesn't do that for us. resetHydrationState(); if ((workInProgress.flags & DidCapture) === NoFlags) { // This boundary did not suspend so it's now hydrated and unsuspended. workInProgress.memoizedState = null; } // If nothing suspended, we need to schedule an effect to mark this boundary // as having hydrated so events know that they're free to be invoked. // It's also a signal to replay events and the suspense callback. // If something suspended, schedule an effect to attach retry listeners. // So we might as well always mark this. workInProgress.flags |= Update; bubbleProperties(workInProgress); { if ((workInProgress.mode & ProfileMode) !== NoMode) { var _isTimedOutSuspense = nextState !== null; if (_isTimedOutSuspense) { // Don't count time spent in a timed out Suspense subtree as part of the base duration. var _primaryChildFragment = workInProgress.child; if (_primaryChildFragment !== null) { // $FlowFixMe Flow doesn't support type casting in combination with the -= operator workInProgress.treeBaseDuration -= _primaryChildFragment.treeBaseDuration; } } } } return false; } } else { // Successfully completed this tree. If this was a forced client render, // there may have been recoverable errors during first hydration // attempt. If so, add them to a queue so we can log them in the // commit phase. upgradeHydrationErrorsToRecoverable(); // Fall through to normal Suspense path return true; } } function completeWork(current, workInProgress, renderLanes) { var newProps = workInProgress.pendingProps; // Note: This intentionally doesn't check if we're hydrating because comparing // to the current tree provider fiber is just as fast and less error-prone. // Ideally we would have a special version of the work loop only // for hydration. popTreeContext(workInProgress); switch (workInProgress.tag) { case IndeterminateComponent: case LazyComponent: case SimpleMemoComponent: case FunctionComponent: case ForwardRef: case Fragment: case Mode: case Profiler: case ContextConsumer: case MemoComponent: bubbleProperties(workInProgress); return null; case ClassComponent: { var Component = workInProgress.type; if (isContextProvider(Component)) { popContext(workInProgress); } bubbleProperties(workInProgress); return null; } case HostRoot: { var fiberRoot = workInProgress.stateNode; popHostContainer(workInProgress); popTopLevelContextObject(workInProgress); resetWorkInProgressVersions(); if (fiberRoot.pendingContext) { fiberRoot.context = fiberRoot.pendingContext; fiberRoot.pendingContext = null; } if (current === null || current.child === null) { // If we hydrated, pop so that we can delete any remaining children // that weren't hydrated. var wasHydrated = popHydrationState(workInProgress); if (wasHydrated) { // If we hydrated, then we'll need to schedule an update for // the commit side-effects on the root. markUpdate(workInProgress); } else { if (current !== null) { var prevState = current.memoizedState; if ( // Check if this is a client root !prevState.isDehydrated || // Check if we reverted to client rendering (e.g. due to an error) (workInProgress.flags & ForceClientRender) !== NoFlags) { // Schedule an effect to clear this container at the start of the // next commit. This handles the case of React rendering into a // container with previous children. It's also safe to do for // updates too, because current.child would only be null if the // previous render was null (so the container would already // be empty). workInProgress.flags |= Snapshot; // If this was a forced client render, there may have been // recoverable errors during first hydration attempt. If so, add // them to a queue so we can log them in the commit phase. upgradeHydrationErrorsToRecoverable(); } } } } updateHostContainer(current, workInProgress); bubbleProperties(workInProgress); return null; } case HostComponent: { popHostContext(workInProgress); var rootContainerInstance = getRootHostContainer(); var type = workInProgress.type; if (current !== null && workInProgress.stateNode != null) { updateHostComponent$1(current, workInProgress, type, newProps, rootContainerInstance); if (current.ref !== workInProgress.ref) { markRef$1(workInProgress); } } else { if (!newProps) { if (workInProgress.stateNode === null) { throw new Error('We must have new props for new mounts. This error is likely ' + 'caused by a bug in React. Please file an issue.'); } // This can happen when we abort work. bubbleProperties(workInProgress); return null; } var currentHostContext = getHostContext(); // TODO: Move createInstance to beginWork and keep it on a context // "stack" as the parent. Then append children as we go in beginWork // or completeWork depending on whether we want to add them top->down or // bottom->up. Top->down is faster in IE11. var _wasHydrated = popHydrationState(workInProgress); if (_wasHydrated) { // TODO: Move this and createInstance step into the beginPhase // to consolidate. if (prepareToHydrateHostInstance(workInProgress, rootContainerInstance, currentHostContext)) { // If changes to the hydrated node need to be applied at the // commit-phase we mark this as such. markUpdate(workInProgress); } } else { var instance = createInstance(type, newProps, rootContainerInstance, currentHostContext, workInProgress); appendAllChildren(instance, workInProgress, false, false); workInProgress.stateNode = instance; // Certain renderers require commit-time effects for initial mount. // (eg DOM renderer supports auto-focus for certain elements). // Make sure such renderers get scheduled for later work. if (finalizeInitialChildren(instance, type, newProps, rootContainerInstance)) { markUpdate(workInProgress); } } if (workInProgress.ref !== null) { // If there is a ref on a host node we need to schedule a callback markRef$1(workInProgress); } } bubbleProperties(workInProgress); return null; } case HostText: { var newText = newProps; if (current && workInProgress.stateNode != null) { var oldText = current.memoizedProps; // If we have an alternate, that means this is an update and we need // to schedule a side-effect to do the updates. updateHostText$1(current, workInProgress, oldText, newText); } else { if (typeof newText !== 'string') { if (workInProgress.stateNode === null) { throw new Error('We must have new props for new mounts. This error is likely ' + 'caused by a bug in React. Please file an issue.'); } // This can happen when we abort work. } var _rootContainerInstance = getRootHostContainer(); var _currentHostContext = getHostContext(); var _wasHydrated2 = popHydrationState(workInProgress); if (_wasHydrated2) { if (prepareToHydrateHostTextInstance(workInProgress)) { markUpdate(workInProgress); } } else { workInProgress.stateNode = createTextInstance(newText, _rootContainerInstance, _currentHostContext, workInProgress); } } bubbleProperties(workInProgress); return null; } case SuspenseComponent: { popSuspenseContext(workInProgress); var nextState = workInProgress.memoizedState; // Special path for dehydrated boundaries. We may eventually move this // to its own fiber type so that we can add other kinds of hydration // boundaries that aren't associated with a Suspense tree. In anticipation // of such a refactor, all the hydration logic is contained in // this branch. if (current === null || current.memoizedState !== null && current.memoizedState.dehydrated !== null) { var fallthroughToNormalSuspensePath = completeDehydratedSuspenseBoundary(current, workInProgress, nextState); if (!fallthroughToNormalSuspensePath) { if (workInProgress.flags & ShouldCapture) { // Special case. There were remaining unhydrated nodes. We treat // this as a mismatch. Revert to client rendering. return workInProgress; } else { // Did not finish hydrating, either because this is the initial // render or because something suspended. return null; } } // Continue with the normal Suspense path. } if ((workInProgress.flags & DidCapture) !== NoFlags) { // Something suspended. Re-render with the fallback children. workInProgress.lanes = renderLanes; // Do not reset the effect list. if ( (workInProgress.mode & ProfileMode) !== NoMode) { transferActualDuration(workInProgress); } // Don't bubble properties in this case. return workInProgress; } var nextDidTimeout = nextState !== null; var prevDidTimeout = current !== null && current.memoizedState !== null; // a passive effect, which is when we process the transitions if (nextDidTimeout !== prevDidTimeout) { // an effect to toggle the subtree's visibility. When we switch from // fallback -> primary, the inner Offscreen fiber schedules this effect // as part of its normal complete phase. But when we switch from // primary -> fallback, the inner Offscreen fiber does not have a complete // phase. So we need to schedule its effect here. // // We also use this flag to connect/disconnect the effects, but the same // logic applies: when re-connecting, the Offscreen fiber's complete // phase will handle scheduling the effect. It's only when the fallback // is active that we have to do anything special. if (nextDidTimeout) { var _offscreenFiber2 = workInProgress.child; _offscreenFiber2.flags |= Visibility; // TODO: This will still suspend a synchronous tree if anything // in the concurrent tree already suspended during this render. // This is a known bug. if ((workInProgress.mode & ConcurrentMode) !== NoMode) { // TODO: Move this back to throwException because this is too late // if this is a large tree which is common for initial loads. We // don't know if we should restart a render or not until we get // this marker, and this is too late. // If this render already had a ping or lower pri updates, // and this is the first time we know we're going to suspend we // should be able to immediately restart from within throwException. var hasInvisibleChildContext = current === null && (workInProgress.memoizedProps.unstable_avoidThisFallback !== true || !enableSuspenseAvoidThisFallback); if (hasInvisibleChildContext || hasSuspenseContext(suspenseStackCursor.current, InvisibleParentSuspenseContext)) { // If this was in an invisible tree or a new render, then showing // this boundary is ok. renderDidSuspend(); } else { // Otherwise, we're going to have to hide content so we should // suspend for longer if possible. renderDidSuspendDelayIfPossible(); } } } } var wakeables = workInProgress.updateQueue; if (wakeables !== null) { // Schedule an effect to attach a retry listener to the promise. // TODO: Move to passive phase workInProgress.flags |= Update; } bubbleProperties(workInProgress); { if ((workInProgress.mode & ProfileMode) !== NoMode) { if (nextDidTimeout) { // Don't count time spent in a timed out Suspense subtree as part of the base duration. var primaryChildFragment = workInProgress.child; if (primaryChildFragment !== null) { // $FlowFixMe Flow doesn't support type casting in combination with the -= operator workInProgress.treeBaseDuration -= primaryChildFragment.treeBaseDuration; } } } } return null; } case HostPortal: popHostContainer(workInProgress); updateHostContainer(current, workInProgress); if (current === null) { preparePortalMount(workInProgress.stateNode.containerInfo); } bubbleProperties(workInProgress); return null; case ContextProvider: // Pop provider fiber var context = workInProgress.type._context; popProvider(context, workInProgress); bubbleProperties(workInProgress); return null; case IncompleteClassComponent: { // Same as class component case. I put it down here so that the tags are // sequential to ensure this switch is compiled to a jump table. var _Component = workInProgress.type; if (isContextProvider(_Component)) { popContext(workInProgress); } bubbleProperties(workInProgress); return null; } case SuspenseListComponent: { popSuspenseContext(workInProgress); var renderState = workInProgress.memoizedState; if (renderState === null) { // We're running in the default, "independent" mode. // We don't do anything in this mode. bubbleProperties(workInProgress); return null; } var didSuspendAlready = (workInProgress.flags & DidCapture) !== NoFlags; var renderedTail = renderState.rendering; if (renderedTail === null) { // We just rendered the head. if (!didSuspendAlready) { // This is the first pass. We need to figure out if anything is still // suspended in the rendered set. // If new content unsuspended, but there's still some content that // didn't. Then we need to do a second pass that forces everything // to keep showing their fallbacks. // We might be suspended if something in this render pass suspended, or // something in the previous committed pass suspended. Otherwise, // there's no chance so we can skip the expensive call to // findFirstSuspended. var cannotBeSuspended = renderHasNotSuspendedYet() && (current === null || (current.flags & DidCapture) === NoFlags); if (!cannotBeSuspended) { var row = workInProgress.child; while (row !== null) { var suspended = findFirstSuspended(row); if (suspended !== null) { didSuspendAlready = true; workInProgress.flags |= DidCapture; cutOffTailIfNeeded(renderState, false); // If this is a newly suspended tree, it might not get committed as // part of the second pass. In that case nothing will subscribe to // its thenables. Instead, we'll transfer its thenables to the // SuspenseList so that it can retry if they resolve. // There might be multiple of these in the list but since we're // going to wait for all of them anyway, it doesn't really matter // which ones gets to ping. In theory we could get clever and keep // track of how many dependencies remain but it gets tricky because // in the meantime, we can add/remove/change items and dependencies. // We might bail out of the loop before finding any but that // doesn't matter since that means that the other boundaries that // we did find already has their listeners attached. var newThenables = suspended.updateQueue; if (newThenables !== null) { workInProgress.updateQueue = newThenables; workInProgress.flags |= Update; } // Rerender the whole list, but this time, we'll force fallbacks // to stay in place. // Reset the effect flags before doing the second pass since that's now invalid. // Reset the child fibers to their original state. workInProgress.subtreeFlags = NoFlags; resetChildFibers(workInProgress, renderLanes); // Set up the Suspense Context to force suspense and immediately // rerender the children. pushSuspenseContext(workInProgress, setShallowSuspenseContext(suspenseStackCursor.current, ForceSuspenseFallback)); // Don't bubble properties in this case. return workInProgress.child; } row = row.sibling; } } if (renderState.tail !== null && now() > getRenderTargetTime()) { // We have already passed our CPU deadline but we still have rows // left in the tail. We'll just give up further attempts to render // the main content and only render fallbacks. workInProgress.flags |= DidCapture; didSuspendAlready = true; cutOffTailIfNeeded(renderState, false); // Since nothing actually suspended, there will nothing to ping this // to get it started back up to attempt the next item. While in terms // of priority this work has the same priority as this current render, // it's not part of the same transition once the transition has // committed. If it's sync, we still want to yield so that it can be // painted. Conceptually, this is really the same as pinging. // We can use any RetryLane even if it's the one currently rendering // since we're leaving it behind on this node. workInProgress.lanes = SomeRetryLane; } } else { cutOffTailIfNeeded(renderState, false); } // Next we're going to render the tail. } else { // Append the rendered row to the child list. if (!didSuspendAlready) { var _suspended = findFirstSuspended(renderedTail); if (_suspended !== null) { workInProgress.flags |= DidCapture; didSuspendAlready = true; // Ensure we transfer the update queue to the parent so that it doesn't // get lost if this row ends up dropped during a second pass. var _newThenables = _suspended.updateQueue; if (_newThenables !== null) { workInProgress.updateQueue = _newThenables; workInProgress.flags |= Update; } cutOffTailIfNeeded(renderState, true); // This might have been modified. if (renderState.tail === null && renderState.tailMode === 'hidden' && !renderedTail.alternate && !getIsHydrating() // We don't cut it if we're hydrating. ) { // We're done. bubbleProperties(workInProgress); return null; } } else if ( // The time it took to render last row is greater than the remaining // time we have to render. So rendering one more row would likely // exceed it. now() * 2 - renderState.renderingStartTime > getRenderTargetTime() && renderLanes !== OffscreenLane) { // We have now passed our CPU deadline and we'll just give up further // attempts to render the main content and only render fallbacks. // The assumption is that this is usually faster. workInProgress.flags |= DidCapture; didSuspendAlready = true; cutOffTailIfNeeded(renderState, false); // Since nothing actually suspended, there will nothing to ping this // to get it started back up to attempt the next item. While in terms // of priority this work has the same priority as this current render, // it's not part of the same transition once the transition has // committed. If it's sync, we still want to yield so that it can be // painted. Conceptually, this is really the same as pinging. // We can use any RetryLane even if it's the one currently rendering // since we're leaving it behind on this node. workInProgress.lanes = SomeRetryLane; } } if (renderState.isBackwards) { // The effect list of the backwards tail will have been added // to the end. This breaks the guarantee that life-cycles fire in // sibling order but that isn't a strong guarantee promised by React. // Especially since these might also just pop in during future commits. // Append to the beginning of the list. renderedTail.sibling = workInProgress.child; workInProgress.child = renderedTail; } else { var previousSibling = renderState.last; if (previousSibling !== null) { previousSibling.sibling = renderedTail; } else { workInProgress.child = renderedTail; } renderState.last = renderedTail; } } if (renderState.tail !== null) { // We still have tail rows to render. // Pop a row. var next = renderState.tail; renderState.rendering = next; renderState.tail = next.sibling; renderState.renderingStartTime = now(); next.sibling = null; // Restore the context. // TODO: We can probably just avoid popping it instead and only // setting it the first time we go from not suspended to suspended. var suspenseContext = suspenseStackCursor.current; if (didSuspendAlready) { suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback); } else { suspenseContext = setDefaultShallowSuspenseContext(suspenseContext); } pushSuspenseContext(workInProgress, suspenseContext); // Do a pass over the next row. // Don't bubble properties in this case. return next; } bubbleProperties(workInProgress); return null; } case ScopeComponent: { break; } case OffscreenComponent: case LegacyHiddenComponent: { popRenderLanes(workInProgress); var _nextState = workInProgress.memoizedState; var nextIsHidden = _nextState !== null; if (current !== null) { var _prevState = current.memoizedState; var prevIsHidden = _prevState !== null; if (prevIsHidden !== nextIsHidden && ( // LegacyHidden doesn't do any hiding — it only pre-renders. !enableLegacyHidden )) { workInProgress.flags |= Visibility; } } if (!nextIsHidden || (workInProgress.mode & ConcurrentMode) === NoMode) { bubbleProperties(workInProgress); } else { // Don't bubble properties for hidden children unless we're rendering // at offscreen priority. if (includesSomeLane(subtreeRenderLanes, OffscreenLane)) { bubbleProperties(workInProgress); { // Check if there was an insertion or update in the hidden subtree. // If so, we need to hide those nodes in the commit phase, so // schedule a visibility effect. if ( workInProgress.subtreeFlags & (Placement | Update)) { workInProgress.flags |= Visibility; } } } } return null; } case CacheComponent: { return null; } case TracingMarkerComponent: { return null; } } throw new Error("Unknown unit of work tag (" + workInProgress.tag + "). This error is likely caused by a bug in " + 'React. Please file an issue.'); } function unwindWork(current, workInProgress, renderLanes) { // Note: This intentionally doesn't check if we're hydrating because comparing // to the current tree provider fiber is just as fast and less error-prone. // Ideally we would have a special version of the work loop only // for hydration. popTreeContext(workInProgress); switch (workInProgress.tag) { case ClassComponent: { var Component = workInProgress.type; if (isContextProvider(Component)) { popContext(workInProgress); } var flags = workInProgress.flags; if (flags & ShouldCapture) { workInProgress.flags = flags & ~ShouldCapture | DidCapture; if ( (workInProgress.mode & ProfileMode) !== NoMode) { transferActualDuration(workInProgress); } return workInProgress; } return null; } case HostRoot: { var root = workInProgress.stateNode; popHostContainer(workInProgress); popTopLevelContextObject(workInProgress); resetWorkInProgressVersions(); var _flags = workInProgress.flags; if ((_flags & ShouldCapture) !== NoFlags && (_flags & DidCapture) === NoFlags) { // There was an error during render that wasn't captured by a suspense // boundary. Do a second pass on the root to unmount the children. workInProgress.flags = _flags & ~ShouldCapture | DidCapture; return workInProgress; } // We unwound to the root without completing it. Exit. return null; } case HostComponent: { // TODO: popHydrationState popHostContext(workInProgress); return null; } case SuspenseComponent: { popSuspenseContext(workInProgress); var suspenseState = workInProgress.memoizedState; if (suspenseState !== null && suspenseState.dehydrated !== null) { if (workInProgress.alternate === null) { throw new Error('Threw in newly mounted dehydrated component. This is likely a bug in ' + 'React. Please file an issue.'); } resetHydrationState(); } var _flags2 = workInProgress.flags; if (_flags2 & ShouldCapture) { workInProgress.flags = _flags2 & ~ShouldCapture | DidCapture; // Captured a suspense effect. Re-render the boundary. if ( (workInProgress.mode & ProfileMode) !== NoMode) { transferActualDuration(workInProgress); } return workInProgress; } return null; } case SuspenseListComponent: { popSuspenseContext(workInProgress); // SuspenseList doesn't actually catch anything. It should've been // caught by a nested boundary. If not, it should bubble through. return null; } case HostPortal: popHostContainer(workInProgress); return null; case ContextProvider: var context = workInProgress.type._context; popProvider(context, workInProgress); return null; case OffscreenComponent: case LegacyHiddenComponent: popRenderLanes(workInProgress); return null; case CacheComponent: return null; default: return null; } } function unwindInterruptedWork(current, interruptedWork, renderLanes) { // Note: This intentionally doesn't check if we're hydrating because comparing // to the current tree provider fiber is just as fast and less error-prone. // Ideally we would have a special version of the work loop only // for hydration. popTreeContext(interruptedWork); switch (interruptedWork.tag) { case ClassComponent: { var childContextTypes = interruptedWork.type.childContextTypes; if (childContextTypes !== null && childContextTypes !== undefined) { popContext(interruptedWork); } break; } case HostRoot: { var root = interruptedWork.stateNode; popHostContainer(interruptedWork); popTopLevelContextObject(interruptedWork); resetWorkInProgressVersions(); break; } case HostComponent: { popHostContext(interruptedWork); break; } case HostPortal: popHostContainer(interruptedWork); break; case SuspenseComponent: popSuspenseContext(interruptedWork); break; case SuspenseListComponent: popSuspenseContext(interruptedWork); break; case ContextProvider: var context = interruptedWork.type._context; popProvider(context, interruptedWork); break; case OffscreenComponent: case LegacyHiddenComponent: popRenderLanes(interruptedWork); break; } } var didWarnAboutUndefinedSnapshotBeforeUpdate = null; { didWarnAboutUndefinedSnapshotBeforeUpdate = new Set(); } // Used during the commit phase to track the state of the Offscreen component stack. // Allows us to avoid traversing the return path to find the nearest Offscreen ancestor. // Only used when enableSuspenseLayoutEffectSemantics is enabled. var offscreenSubtreeIsHidden = false; var offscreenSubtreeWasHidden = false; var PossiblyWeakSet = typeof WeakSet === 'function' ? WeakSet : Set; var nextEffect = null; // Used for Profiling builds to track updaters. var inProgressLanes = null; var inProgressRoot = null; function reportUncaughtErrorInDEV(error) { // Wrapping each small part of the commit phase into a guarded // callback is a bit too slow (https://github.com/facebook/react/pull/21666). // But we rely on it to surface errors to DEV tools like overlays // (https://github.com/facebook/react/issues/21712). // As a compromise, rethrow only caught errors in a guard. { invokeGuardedCallback(null, function () { throw error; }); clearCaughtError(); } } var callComponentWillUnmountWithTimer = function (current, instance) { instance.props = current.memoizedProps; instance.state = current.memoizedState; if ( current.mode & ProfileMode) { try { startLayoutEffectTimer(); instance.componentWillUnmount(); } finally { recordLayoutEffectDuration(current); } } else { instance.componentWillUnmount(); } }; // Capture errors so they don't interrupt mounting. function safelyCallCommitHookLayoutEffectListMount(current, nearestMountedAncestor) { try { commitHookEffectListMount(Layout, current); } catch (error) { captureCommitPhaseError(current, nearestMountedAncestor, error); } } // Capture errors so they don't interrupt unmounting. function safelyCallComponentWillUnmount(current, nearestMountedAncestor, instance) { try { callComponentWillUnmountWithTimer(current, instance); } catch (error) { captureCommitPhaseError(current, nearestMountedAncestor, error); } } // Capture errors so they don't interrupt mounting. function safelyCallComponentDidMount(current, nearestMountedAncestor, instance) { try { instance.componentDidMount(); } catch (error) { captureCommitPhaseError(current, nearestMountedAncestor, error); } } // Capture errors so they don't interrupt mounting. function safelyAttachRef(current, nearestMountedAncestor) { try { commitAttachRef(current); } catch (error) { captureCommitPhaseError(current, nearestMountedAncestor, error); } } function safelyDetachRef(current, nearestMountedAncestor) { var ref = current.ref; if (ref !== null) { if (typeof ref === 'function') { var retVal; try { if (enableProfilerTimer && enableProfilerCommitHooks && current.mode & ProfileMode) { try { startLayoutEffectTimer(); retVal = ref(null); } finally { recordLayoutEffectDuration(current); } } else { retVal = ref(null); } } catch (error) { captureCommitPhaseError(current, nearestMountedAncestor, error); } { if (typeof retVal === 'function') { error('Unexpected return value from a callback ref in %s. ' + 'A callback ref should not return a function.', getComponentNameFromFiber(current)); } } } else { ref.current = null; } } } function safelyCallDestroy(current, nearestMountedAncestor, destroy) { try { destroy(); } catch (error) { captureCommitPhaseError(current, nearestMountedAncestor, error); } } var focusedInstanceHandle = null; var shouldFireAfterActiveInstanceBlur = false; function commitBeforeMutationEffects(root, firstChild) { focusedInstanceHandle = prepareForCommit(root.containerInfo); nextEffect = firstChild; commitBeforeMutationEffects_begin(); // We no longer need to track the active instance fiber var shouldFire = shouldFireAfterActiveInstanceBlur; shouldFireAfterActiveInstanceBlur = false; focusedInstanceHandle = null; return shouldFire; } function commitBeforeMutationEffects_begin() { while (nextEffect !== null) { var fiber = nextEffect; // This phase is only used for beforeActiveInstanceBlur. var child = fiber.child; if ((fiber.subtreeFlags & BeforeMutationMask) !== NoFlags && child !== null) { child.return = fiber; nextEffect = child; } else { commitBeforeMutationEffects_complete(); } } } function commitBeforeMutationEffects_complete() { while (nextEffect !== null) { var fiber = nextEffect; setCurrentFiber(fiber); try { commitBeforeMutationEffectsOnFiber(fiber); } catch (error) { captureCommitPhaseError(fiber, fiber.return, error); } resetCurrentFiber(); var sibling = fiber.sibling; if (sibling !== null) { sibling.return = fiber.return; nextEffect = sibling; return; } nextEffect = fiber.return; } } function commitBeforeMutationEffectsOnFiber(finishedWork) { var current = finishedWork.alternate; var flags = finishedWork.flags; if ((flags & Snapshot) !== NoFlags) { setCurrentFiber(finishedWork); switch (finishedWork.tag) { case FunctionComponent: case ForwardRef: case SimpleMemoComponent: { break; } case ClassComponent: { if (current !== null) { var prevProps = current.memoizedProps; var prevState = current.memoizedState; var instance = finishedWork.stateNode; // We could update instance props and state here, // but instead we rely on them being set during last render. // TODO: revisit this when we implement resuming. { if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) { if (instance.props !== finishedWork.memoizedProps) { error('Expected %s props to match memoized props before ' + 'getSnapshotBeforeUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentNameFromFiber(finishedWork) || 'instance'); } if (instance.state !== finishedWork.memoizedState) { error('Expected %s state to match memoized state before ' + 'getSnapshotBeforeUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.state`. ' + 'Please file an issue.', getComponentNameFromFiber(finishedWork) || 'instance'); } } } var snapshot = instance.getSnapshotBeforeUpdate(finishedWork.elementType === finishedWork.type ? prevProps : resolveDefaultProps(finishedWork.type, prevProps), prevState); { var didWarnSet = didWarnAboutUndefinedSnapshotBeforeUpdate; if (snapshot === undefined && !didWarnSet.has(finishedWork.type)) { didWarnSet.add(finishedWork.type); error('%s.getSnapshotBeforeUpdate(): A snapshot value (or null) ' + 'must be returned. You have returned undefined.', getComponentNameFromFiber(finishedWork)); } } instance.__reactInternalSnapshotBeforeUpdate = snapshot; } break; } case HostRoot: { { var root = finishedWork.stateNode; clearContainer(root.containerInfo); } break; } case HostComponent: case HostText: case HostPortal: case IncompleteClassComponent: // Nothing to do for these component types break; default: { throw new Error('This unit of work tag should not have side-effects. This error is ' + 'likely caused by a bug in React. Please file an issue.'); } } resetCurrentFiber(); } } function commitHookEffectListUnmount(flags, finishedWork, nearestMountedAncestor) { var updateQueue = finishedWork.updateQueue; var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null; if (lastEffect !== null) { var firstEffect = lastEffect.next; var effect = firstEffect; do { if ((effect.tag & flags) === flags) { // Unmount var destroy = effect.destroy; effect.destroy = undefined; if (destroy !== undefined) { { if ((flags & Passive$1) !== NoFlags$1) { markComponentPassiveEffectUnmountStarted(finishedWork); } else if ((flags & Layout) !== NoFlags$1) { markComponentLayoutEffectUnmountStarted(finishedWork); } } { if ((flags & Insertion) !== NoFlags$1) { setIsRunningInsertionEffect(true); } } safelyCallDestroy(finishedWork, nearestMountedAncestor, destroy); { if ((flags & Insertion) !== NoFlags$1) { setIsRunningInsertionEffect(false); } } { if ((flags & Passive$1) !== NoFlags$1) { markComponentPassiveEffectUnmountStopped(); } else if ((flags & Layout) !== NoFlags$1) { markComponentLayoutEffectUnmountStopped(); } } } } effect = effect.next; } while (effect !== firstEffect); } } function commitHookEffectListMount(flags, finishedWork) { var updateQueue = finishedWork.updateQueue; var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null; if (lastEffect !== null) { var firstEffect = lastEffect.next; var effect = firstEffect; do { if ((effect.tag & flags) === flags) { { if ((flags & Passive$1) !== NoFlags$1) { markComponentPassiveEffectMountStarted(finishedWork); } else if ((flags & Layout) !== NoFlags$1) { markComponentLayoutEffectMountStarted(finishedWork); } } // Mount var create = effect.create; { if ((flags & Insertion) !== NoFlags$1) { setIsRunningInsertionEffect(true); } } effect.destroy = create(); { if ((flags & Insertion) !== NoFlags$1) { setIsRunningInsertionEffect(false); } } { if ((flags & Passive$1) !== NoFlags$1) { markComponentPassiveEffectMountStopped(); } else if ((flags & Layout) !== NoFlags$1) { markComponentLayoutEffectMountStopped(); } } { var destroy = effect.destroy; if (destroy !== undefined && typeof destroy !== 'function') { var hookName = void 0; if ((effect.tag & Layout) !== NoFlags) { hookName = 'useLayoutEffect'; } else if ((effect.tag & Insertion) !== NoFlags) { hookName = 'useInsertionEffect'; } else { hookName = 'useEffect'; } var addendum = void 0; if (destroy === null) { addendum = ' You returned null. If your effect does not require clean ' + 'up, return undefined (or nothing).'; } else if (typeof destroy.then === 'function') { addendum = '\n\nIt looks like you wrote ' + hookName + '(async () => ...) or returned a Promise. ' + 'Instead, write the async function inside your effect ' + 'and call it immediately:\n\n' + hookName + '(() => {\n' + ' async function fetchData() {\n' + ' // You can await here\n' + ' const response = await MyAPI.getData(someId);\n' + ' // ...\n' + ' }\n' + ' fetchData();\n' + "}, [someId]); // Or [] if effect doesn't need props or state\n\n" + 'Learn more about data fetching with Hooks: https://reactjs.org/link/hooks-data-fetching'; } else { addendum = ' You returned: ' + destroy; } error('%s must not return anything besides a function, ' + 'which is used for clean-up.%s', hookName, addendum); } } } effect = effect.next; } while (effect !== firstEffect); } } function commitPassiveEffectDurations(finishedRoot, finishedWork) { { // Only Profilers with work in their subtree will have an Update effect scheduled. if ((finishedWork.flags & Update) !== NoFlags) { switch (finishedWork.tag) { case Profiler: { var passiveEffectDuration = finishedWork.stateNode.passiveEffectDuration; var _finishedWork$memoize = finishedWork.memoizedProps, id = _finishedWork$memoize.id, onPostCommit = _finishedWork$memoize.onPostCommit; // This value will still reflect the previous commit phase. // It does not get reset until the start of the next commit phase. var commitTime = getCommitTime(); var phase = finishedWork.alternate === null ? 'mount' : 'update'; { if (isCurrentUpdateNested()) { phase = 'nested-update'; } } if (typeof onPostCommit === 'function') { onPostCommit(id, phase, passiveEffectDuration, commitTime); } // Bubble times to the next nearest ancestor Profiler. // After we process that Profiler, we'll bubble further up. var parentFiber = finishedWork.return; outer: while (parentFiber !== null) { switch (parentFiber.tag) { case HostRoot: var root = parentFiber.stateNode; root.passiveEffectDuration += passiveEffectDuration; break outer; case Profiler: var parentStateNode = parentFiber.stateNode; parentStateNode.passiveEffectDuration += passiveEffectDuration; break outer; } parentFiber = parentFiber.return; } break; } } } } } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork, committedLanes) { if ((finishedWork.flags & LayoutMask) !== NoFlags) { switch (finishedWork.tag) { case FunctionComponent: case ForwardRef: case SimpleMemoComponent: { if ( !offscreenSubtreeWasHidden) { // At this point layout effects have already been destroyed (during mutation phase). // This is done to prevent sibling component effects from interfering with each other, // e.g. a destroy function in one component should never override a ref set // by a create function in another component during the same commit. if ( finishedWork.mode & ProfileMode) { try { startLayoutEffectTimer(); commitHookEffectListMount(Layout | HasEffect, finishedWork); } finally { recordLayoutEffectDuration(finishedWork); } } else { commitHookEffectListMount(Layout | HasEffect, finishedWork); } } break; } case ClassComponent: { var instance = finishedWork.stateNode; if (finishedWork.flags & Update) { if (!offscreenSubtreeWasHidden) { if (current === null) { // We could update instance props and state here, // but instead we rely on them being set during last render. // TODO: revisit this when we implement resuming. { if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) { if (instance.props !== finishedWork.memoizedProps) { error('Expected %s props to match memoized props before ' + 'componentDidMount. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentNameFromFiber(finishedWork) || 'instance'); } if (instance.state !== finishedWork.memoizedState) { error('Expected %s state to match memoized state before ' + 'componentDidMount. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.state`. ' + 'Please file an issue.', getComponentNameFromFiber(finishedWork) || 'instance'); } } } if ( finishedWork.mode & ProfileMode) { try { startLayoutEffectTimer(); instance.componentDidMount(); } finally { recordLayoutEffectDuration(finishedWork); } } else { instance.componentDidMount(); } } else { var prevProps = finishedWork.elementType === finishedWork.type ? current.memoizedProps : resolveDefaultProps(finishedWork.type, current.memoizedProps); var prevState = current.memoizedState; // We could update instance props and state here, // but instead we rely on them being set during last render. // TODO: revisit this when we implement resuming. { if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) { if (instance.props !== finishedWork.memoizedProps) { error('Expected %s props to match memoized props before ' + 'componentDidUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentNameFromFiber(finishedWork) || 'instance'); } if (instance.state !== finishedWork.memoizedState) { error('Expected %s state to match memoized state before ' + 'componentDidUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.state`. ' + 'Please file an issue.', getComponentNameFromFiber(finishedWork) || 'instance'); } } } if ( finishedWork.mode & ProfileMode) { try { startLayoutEffectTimer(); instance.componentDidUpdate(prevProps, prevState, instance.__reactInternalSnapshotBeforeUpdate); } finally { recordLayoutEffectDuration(finishedWork); } } else { instance.componentDidUpdate(prevProps, prevState, instance.__reactInternalSnapshotBeforeUpdate); } } } } // TODO: I think this is now always non-null by the time it reaches the // commit phase. Consider removing the type check. var updateQueue = finishedWork.updateQueue; if (updateQueue !== null) { { if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) { if (instance.props !== finishedWork.memoizedProps) { error('Expected %s props to match memoized props before ' + 'processing the update queue. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentNameFromFiber(finishedWork) || 'instance'); } if (instance.state !== finishedWork.memoizedState) { error('Expected %s state to match memoized state before ' + 'processing the update queue. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.state`. ' + 'Please file an issue.', getComponentNameFromFiber(finishedWork) || 'instance'); } } } // We could update instance props and state here, // but instead we rely on them being set during last render. // TODO: revisit this when we implement resuming. commitUpdateQueue(finishedWork, updateQueue, instance); } break; } case HostRoot: { // TODO: I think this is now always non-null by the time it reaches the // commit phase. Consider removing the type check. var _updateQueue = finishedWork.updateQueue; if (_updateQueue !== null) { var _instance = null; if (finishedWork.child !== null) { switch (finishedWork.child.tag) { case HostComponent: _instance = getPublicInstance(finishedWork.child.stateNode); break; case ClassComponent: _instance = finishedWork.child.stateNode; break; } } commitUpdateQueue(finishedWork, _updateQueue, _instance); } break; } case HostComponent: { var _instance2 = finishedWork.stateNode; // Renderers may schedule work to be done after host components are mounted // (eg DOM renderer may schedule auto-focus for inputs and form controls). // These effects should only be committed when components are first mounted, // aka when there is no current/alternate. if (current === null && finishedWork.flags & Update) { var type = finishedWork.type; var props = finishedWork.memoizedProps; commitMount(_instance2, type, props); } break; } case HostText: { // We have no life-cycles associated with text. break; } case HostPortal: { // We have no life-cycles associated with portals. break; } case Profiler: { { var _finishedWork$memoize2 = finishedWork.memoizedProps, onCommit = _finishedWork$memoize2.onCommit, onRender = _finishedWork$memoize2.onRender; var effectDuration = finishedWork.stateNode.effectDuration; var commitTime = getCommitTime(); var phase = current === null ? 'mount' : 'update'; { if (isCurrentUpdateNested()) { phase = 'nested-update'; } } if (typeof onRender === 'function') { onRender(finishedWork.memoizedProps.id, phase, finishedWork.actualDuration, finishedWork.treeBaseDuration, finishedWork.actualStartTime, commitTime); } { if (typeof onCommit === 'function') { onCommit(finishedWork.memoizedProps.id, phase, effectDuration, commitTime); } // Schedule a passive effect for this Profiler to call onPostCommit hooks. // This effect should be scheduled even if there is no onPostCommit callback for this Profiler, // because the effect is also where times bubble to parent Profilers. enqueuePendingPassiveProfilerEffect(finishedWork); // Propagate layout effect durations to the next nearest Profiler ancestor. // Do not reset these values until the next render so DevTools has a chance to read them first. var parentFiber = finishedWork.return; outer: while (parentFiber !== null) { switch (parentFiber.tag) { case HostRoot: var root = parentFiber.stateNode; root.effectDuration += effectDuration; break outer; case Profiler: var parentStateNode = parentFiber.stateNode; parentStateNode.effectDuration += effectDuration; break outer; } parentFiber = parentFiber.return; } } } break; } case SuspenseComponent: { commitSuspenseHydrationCallbacks(finishedRoot, finishedWork); break; } case SuspenseListComponent: case IncompleteClassComponent: case ScopeComponent: case OffscreenComponent: case LegacyHiddenComponent: case TracingMarkerComponent: { break; } default: throw new Error('This unit of work tag should not have side-effects. This error is ' + 'likely caused by a bug in React. Please file an issue.'); } } if ( !offscreenSubtreeWasHidden) { { if (finishedWork.flags & Ref) { commitAttachRef(finishedWork); } } } } function reappearLayoutEffectsOnFiber(node) { // Turn on layout effects in a tree that previously disappeared. // TODO (Offscreen) Check: flags & LayoutStatic switch (node.tag) { case FunctionComponent: case ForwardRef: case SimpleMemoComponent: { if ( node.mode & ProfileMode) { try { startLayoutEffectTimer(); safelyCallCommitHookLayoutEffectListMount(node, node.return); } finally { recordLayoutEffectDuration(node); } } else { safelyCallCommitHookLayoutEffectListMount(node, node.return); } break; } case ClassComponent: { var instance = node.stateNode; if (typeof instance.componentDidMount === 'function') { safelyCallComponentDidMount(node, node.return, instance); } safelyAttachRef(node, node.return); break; } case HostComponent: { safelyAttachRef(node, node.return); break; } } } function hideOrUnhideAllChildren(finishedWork, isHidden) { // Only hide or unhide the top-most host nodes. var hostSubtreeRoot = null; { // We only have the top Fiber that was inserted but we need to recurse down its // children to find all the terminal nodes. var node = finishedWork; while (true) { if (node.tag === HostComponent) { if (hostSubtreeRoot === null) { hostSubtreeRoot = node; try { var instance = node.stateNode; if (isHidden) { hideInstance(instance); } else { unhideInstance(node.stateNode, node.memoizedProps); } } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } } } else if (node.tag === HostText) { if (hostSubtreeRoot === null) { try { var _instance3 = node.stateNode; if (isHidden) { hideTextInstance(_instance3); } else { unhideTextInstance(_instance3, node.memoizedProps); } } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } } } else if ((node.tag === OffscreenComponent || node.tag === LegacyHiddenComponent) && node.memoizedState !== null && node !== finishedWork) ; else if (node.child !== null) { node.child.return = node; node = node.child; continue; } if (node === finishedWork) { return; } while (node.sibling === null) { if (node.return === null || node.return === finishedWork) { return; } if (hostSubtreeRoot === node) { hostSubtreeRoot = null; } node = node.return; } if (hostSubtreeRoot === node) { hostSubtreeRoot = null; } node.sibling.return = node.return; node = node.sibling; } } } function commitAttachRef(finishedWork) { var ref = finishedWork.ref; if (ref !== null) { var instance = finishedWork.stateNode; var instanceToUse; switch (finishedWork.tag) { case HostComponent: instanceToUse = getPublicInstance(instance); break; default: instanceToUse = instance; } // Moved outside to ensure DCE works with this flag if (typeof ref === 'function') { var retVal; if ( finishedWork.mode & ProfileMode) { try { startLayoutEffectTimer(); retVal = ref(instanceToUse); } finally { recordLayoutEffectDuration(finishedWork); } } else { retVal = ref(instanceToUse); } { if (typeof retVal === 'function') { error('Unexpected return value from a callback ref in %s. ' + 'A callback ref should not return a function.', getComponentNameFromFiber(finishedWork)); } } } else { { if (!ref.hasOwnProperty('current')) { error('Unexpected ref object provided for %s. ' + 'Use either a ref-setter function or React.createRef().', getComponentNameFromFiber(finishedWork)); } } ref.current = instanceToUse; } } } function detachFiberMutation(fiber) { // Cut off the return pointer to disconnect it from the tree. // This enables us to detect and warn against state updates on an unmounted component. // It also prevents events from bubbling from within disconnected components. // // Ideally, we should also clear the child pointer of the parent alternate to let this // get GC:ed but we don't know which for sure which parent is the current // one so we'll settle for GC:ing the subtree of this child. // This child itself will be GC:ed when the parent updates the next time. // // Note that we can't clear child or sibling pointers yet. // They're needed for passive effects and for findDOMNode. // We defer those fields, and all other cleanup, to the passive phase (see detachFiberAfterEffects). // // Don't reset the alternate yet, either. We need that so we can detach the // alternate's fields in the passive phase. Clearing the return pointer is // sufficient for findDOMNode semantics. var alternate = fiber.alternate; if (alternate !== null) { alternate.return = null; } fiber.return = null; } function detachFiberAfterEffects(fiber) { var alternate = fiber.alternate; if (alternate !== null) { fiber.alternate = null; detachFiberAfterEffects(alternate); } // Note: Defensively using negation instead of < in case // `deletedTreeCleanUpLevel` is undefined. { // Clear cyclical Fiber fields. This level alone is designed to roughly // approximate the planned Fiber refactor. In that world, `setState` will be // bound to a special "instance" object instead of a Fiber. The Instance // object will not have any of these fields. It will only be connected to // the fiber tree via a single link at the root. So if this level alone is // sufficient to fix memory issues, that bodes well for our plans. fiber.child = null; fiber.deletions = null; fiber.sibling = null; // The `stateNode` is cyclical because on host nodes it points to the host // tree, which has its own pointers to children, parents, and siblings. // The other host nodes also point back to fibers, so we should detach that // one, too. if (fiber.tag === HostComponent) { var hostInstance = fiber.stateNode; if (hostInstance !== null) { detachDeletedInstance(hostInstance); } } fiber.stateNode = null; // I'm intentionally not clearing the `return` field in this level. We // already disconnect the `return` pointer at the root of the deleted // subtree (in `detachFiberMutation`). Besides, `return` by itself is not // cyclical — it's only cyclical when combined with `child`, `sibling`, and // `alternate`. But we'll clear it in the next level anyway, just in case. { fiber._debugOwner = null; } { // Theoretically, nothing in here should be necessary, because we already // disconnected the fiber from the tree. So even if something leaks this // particular fiber, it won't leak anything else // // The purpose of this branch is to be super aggressive so we can measure // if there's any difference in memory impact. If there is, that could // indicate a React leak we don't know about. fiber.return = null; fiber.dependencies = null; fiber.memoizedProps = null; fiber.memoizedState = null; fiber.pendingProps = null; fiber.stateNode = null; // TODO: Move to `commitPassiveUnmountInsideDeletedTreeOnFiber` instead. fiber.updateQueue = null; } } } function getHostParentFiber(fiber) { var parent = fiber.return; while (parent !== null) { if (isHostParent(parent)) { return parent; } parent = parent.return; } throw new Error('Expected to find a host parent. This error is likely caused by a bug ' + 'in React. Please file an issue.'); } function isHostParent(fiber) { return fiber.tag === HostComponent || fiber.tag === HostRoot || fiber.tag === HostPortal; } function getHostSibling(fiber) { // We're going to search forward into the tree until we find a sibling host // node. Unfortunately, if multiple insertions are done in a row we have to // search past them. This leads to exponential search for the next sibling. // TODO: Find a more efficient way to do this. var node = fiber; siblings: while (true) { // If we didn't find anything, let's try the next sibling. while (node.sibling === null) { if (node.return === null || isHostParent(node.return)) { // If we pop out of the root or hit the parent the fiber we are the // last sibling. return null; } node = node.return; } node.sibling.return = node.return; node = node.sibling; while (node.tag !== HostComponent && node.tag !== HostText && node.tag !== DehydratedFragment) { // If it is not host node and, we might have a host node inside it. // Try to search down until we find one. if (node.flags & Placement) { // If we don't have a child, try the siblings instead. continue siblings; } // If we don't have a child, try the siblings instead. // We also skip portals because they are not part of this host tree. if (node.child === null || node.tag === HostPortal) { continue siblings; } else { node.child.return = node; node = node.child; } } // Check if this host node is stable or about to be placed. if (!(node.flags & Placement)) { // Found it! return node.stateNode; } } } function commitPlacement(finishedWork) { var parentFiber = getHostParentFiber(finishedWork); // Note: these two variables *must* always be updated together. switch (parentFiber.tag) { case HostComponent: { var parent = parentFiber.stateNode; if (parentFiber.flags & ContentReset) { // Reset the text content of the parent before doing any insertions resetTextContent(parent); // Clear ContentReset from the effect tag parentFiber.flags &= ~ContentReset; } var before = getHostSibling(finishedWork); // We only have the top Fiber that was inserted but we need to recurse down its // children to find all the terminal nodes. insertOrAppendPlacementNode(finishedWork, before, parent); break; } case HostRoot: case HostPortal: { var _parent = parentFiber.stateNode.containerInfo; var _before = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer(finishedWork, _before, _parent); break; } // eslint-disable-next-line-no-fallthrough default: throw new Error('Invalid host parent fiber. This error is likely caused by a bug ' + 'in React. Please file an issue.'); } } function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { var tag = node.tag; var isHost = tag === HostComponent || tag === HostText; if (isHost) { var stateNode = node.stateNode; if (before) { insertInContainerBefore(parent, stateNode, before); } else { appendChildToContainer(parent, stateNode); } } else if (tag === HostPortal) ; else { var child = node.child; if (child !== null) { insertOrAppendPlacementNodeIntoContainer(child, before, parent); var sibling = child.sibling; while (sibling !== null) { insertOrAppendPlacementNodeIntoContainer(sibling, before, parent); sibling = sibling.sibling; } } } } function insertOrAppendPlacementNode(node, before, parent) { var tag = node.tag; var isHost = tag === HostComponent || tag === HostText; if (isHost) { var stateNode = node.stateNode; if (before) { insertBefore(parent, stateNode, before); } else { appendChild(parent, stateNode); } } else if (tag === HostPortal) ; else { var child = node.child; if (child !== null) { insertOrAppendPlacementNode(child, before, parent); var sibling = child.sibling; while (sibling !== null) { insertOrAppendPlacementNode(sibling, before, parent); sibling = sibling.sibling; } } } } // These are tracked on the stack as we recursively traverse a // deleted subtree. // TODO: Update these during the whole mutation phase, not just during // a deletion. var hostParent = null; var hostParentIsContainer = false; function commitDeletionEffects(root, returnFiber, deletedFiber) { { // We only have the top Fiber that was deleted but we need to recurse down its // children to find all the terminal nodes. // Recursively delete all host nodes from the parent, detach refs, clean // up mounted layout effects, and call componentWillUnmount. // We only need to remove the topmost host child in each branch. But then we // still need to keep traversing to unmount effects, refs, and cWU. TODO: We // could split this into two separate traversals functions, where the second // one doesn't include any removeChild logic. This is maybe the same // function as "disappearLayoutEffects" (or whatever that turns into after // the layout phase is refactored to use recursion). // Before starting, find the nearest host parent on the stack so we know // which instance/container to remove the children from. // TODO: Instead of searching up the fiber return path on every deletion, we // can track the nearest host component on the JS stack as we traverse the // tree during the commit phase. This would make insertions faster, too. var parent = returnFiber; findParent: while (parent !== null) { switch (parent.tag) { case HostComponent: { hostParent = parent.stateNode; hostParentIsContainer = false; break findParent; } case HostRoot: { hostParent = parent.stateNode.containerInfo; hostParentIsContainer = true; break findParent; } case HostPortal: { hostParent = parent.stateNode.containerInfo; hostParentIsContainer = true; break findParent; } } parent = parent.return; } if (hostParent === null) { throw new Error('Expected to find a host parent. This error is likely caused by ' + 'a bug in React. Please file an issue.'); } commitDeletionEffectsOnFiber(root, returnFiber, deletedFiber); hostParent = null; hostParentIsContainer = false; } detachFiberMutation(deletedFiber); } function recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, parent) { // TODO: Use a static flag to skip trees that don't have unmount effects var child = parent.child; while (child !== null) { commitDeletionEffectsOnFiber(finishedRoot, nearestMountedAncestor, child); child = child.sibling; } } function commitDeletionEffectsOnFiber(finishedRoot, nearestMountedAncestor, deletedFiber) { onCommitUnmount(deletedFiber); // The cases in this outer switch modify the stack before they traverse // into their subtree. There are simpler cases in the inner switch // that don't modify the stack. switch (deletedFiber.tag) { case HostComponent: { if (!offscreenSubtreeWasHidden) { safelyDetachRef(deletedFiber, nearestMountedAncestor); } // Intentional fallthrough to next branch } // eslint-disable-next-line-no-fallthrough case HostText: { // We only need to remove the nearest host child. Set the host parent // to `null` on the stack to indicate that nested children don't // need to be removed. { var prevHostParent = hostParent; var prevHostParentIsContainer = hostParentIsContainer; hostParent = null; recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber); hostParent = prevHostParent; hostParentIsContainer = prevHostParentIsContainer; if (hostParent !== null) { // Now that all the child effects have unmounted, we can remove the // node from the tree. if (hostParentIsContainer) { removeChildFromContainer(hostParent, deletedFiber.stateNode); } else { removeChild(hostParent, deletedFiber.stateNode); } } } return; } case DehydratedFragment: { // Delete the dehydrated suspense boundary and all of its content. { if (hostParent !== null) { if (hostParentIsContainer) { clearSuspenseBoundaryFromContainer(hostParent, deletedFiber.stateNode); } else { clearSuspenseBoundary(hostParent, deletedFiber.stateNode); } } } return; } case HostPortal: { { // When we go into a portal, it becomes the parent to remove from. var _prevHostParent = hostParent; var _prevHostParentIsContainer = hostParentIsContainer; hostParent = deletedFiber.stateNode.containerInfo; hostParentIsContainer = true; recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber); hostParent = _prevHostParent; hostParentIsContainer = _prevHostParentIsContainer; } return; } case FunctionComponent: case ForwardRef: case MemoComponent: case SimpleMemoComponent: { if (!offscreenSubtreeWasHidden) { var updateQueue = deletedFiber.updateQueue; if (updateQueue !== null) { var lastEffect = updateQueue.lastEffect; if (lastEffect !== null) { var firstEffect = lastEffect.next; var effect = firstEffect; do { var _effect = effect, destroy = _effect.destroy, tag = _effect.tag; if (destroy !== undefined) { if ((tag & Insertion) !== NoFlags$1) { safelyCallDestroy(deletedFiber, nearestMountedAncestor, destroy); } else if ((tag & Layout) !== NoFlags$1) { { markComponentLayoutEffectUnmountStarted(deletedFiber); } if ( deletedFiber.mode & ProfileMode) { startLayoutEffectTimer(); safelyCallDestroy(deletedFiber, nearestMountedAncestor, destroy); recordLayoutEffectDuration(deletedFiber); } else { safelyCallDestroy(deletedFiber, nearestMountedAncestor, destroy); } { markComponentLayoutEffectUnmountStopped(); } } } effect = effect.next; } while (effect !== firstEffect); } } } recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber); return; } case ClassComponent: { if (!offscreenSubtreeWasHidden) { safelyDetachRef(deletedFiber, nearestMountedAncestor); var instance = deletedFiber.stateNode; if (typeof instance.componentWillUnmount === 'function') { safelyCallComponentWillUnmount(deletedFiber, nearestMountedAncestor, instance); } } recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber); return; } case ScopeComponent: { recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber); return; } case OffscreenComponent: { if ( // TODO: Remove this dead flag deletedFiber.mode & ConcurrentMode) { // If this offscreen component is hidden, we already unmounted it. Before // deleting the children, track that it's already unmounted so that we // don't attempt to unmount the effects again. // TODO: If the tree is hidden, in most cases we should be able to skip // over the nested children entirely. An exception is we haven't yet found // the topmost host node to delete, which we already track on the stack. // But the other case is portals, which need to be detached no matter how // deeply they are nested. We should use a subtree flag to track whether a // subtree includes a nested portal. var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || deletedFiber.memoizedState !== null; recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber); offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; } else { recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber); } break; } default: { recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber); return; } } } function commitSuspenseCallback(finishedWork) { // TODO: Move this to passive phase var newState = finishedWork.memoizedState; } function commitSuspenseHydrationCallbacks(finishedRoot, finishedWork) { var newState = finishedWork.memoizedState; if (newState === null) { var current = finishedWork.alternate; if (current !== null) { var prevState = current.memoizedState; if (prevState !== null) { var suspenseInstance = prevState.dehydrated; if (suspenseInstance !== null) { commitHydratedSuspenseInstance(suspenseInstance); } } } } } function attachSuspenseRetryListeners(finishedWork) { // If this boundary just timed out, then it will have a set of wakeables. // For each wakeable, attach a listener so that when it resolves, React // attempts to re-render the boundary in the primary (pre-timeout) state. var wakeables = finishedWork.updateQueue; if (wakeables !== null) { finishedWork.updateQueue = null; var retryCache = finishedWork.stateNode; if (retryCache === null) { retryCache = finishedWork.stateNode = new PossiblyWeakSet(); } wakeables.forEach(function (wakeable) { // Memoize using the boundary fiber to prevent redundant listeners. var retry = resolveRetryWakeable.bind(null, finishedWork, wakeable); if (!retryCache.has(wakeable)) { retryCache.add(wakeable); { if (isDevToolsPresent) { if (inProgressLanes !== null && inProgressRoot !== null) { // If we have pending work still, associate the original updaters with it. restorePendingUpdaters(inProgressRoot, inProgressLanes); } else { throw Error('Expected finished root and lanes to be set. This is a bug in React.'); } } } wakeable.then(retry, retry); } }); } } // This function detects when a Suspense boundary goes from visible to hidden. function commitMutationEffects(root, finishedWork, committedLanes) { inProgressLanes = committedLanes; inProgressRoot = root; setCurrentFiber(finishedWork); commitMutationEffectsOnFiber(finishedWork, root); setCurrentFiber(finishedWork); inProgressLanes = null; inProgressRoot = null; } function recursivelyTraverseMutationEffects(root, parentFiber, lanes) { // Deletions effects can be scheduled on any fiber type. They need to happen // before the children effects hae fired. var deletions = parentFiber.deletions; if (deletions !== null) { for (var i = 0; i < deletions.length; i++) { var childToDelete = deletions[i]; try { commitDeletionEffects(root, parentFiber, childToDelete); } catch (error) { captureCommitPhaseError(childToDelete, parentFiber, error); } } } var prevDebugFiber = getCurrentFiber(); if (parentFiber.subtreeFlags & MutationMask) { var child = parentFiber.child; while (child !== null) { setCurrentFiber(child); commitMutationEffectsOnFiber(child, root); child = child.sibling; } } setCurrentFiber(prevDebugFiber); } function commitMutationEffectsOnFiber(finishedWork, root, lanes) { var current = finishedWork.alternate; var flags = finishedWork.flags; // The effect flag should be checked *after* we refine the type of fiber, // because the fiber tag is more specific. An exception is any flag related // to reconcilation, because those can be set on all fiber types. switch (finishedWork.tag) { case FunctionComponent: case ForwardRef: case MemoComponent: case SimpleMemoComponent: { recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); if (flags & Update) { try { commitHookEffectListUnmount(Insertion | HasEffect, finishedWork, finishedWork.return); commitHookEffectListMount(Insertion | HasEffect, finishedWork); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } // Layout effects are destroyed during the mutation phase so that all // destroy functions for all fibers are called before any create functions. // This prevents sibling component effects from interfering with each other, // e.g. a destroy function in one component should never override a ref set // by a create function in another component during the same commit. if ( finishedWork.mode & ProfileMode) { try { startLayoutEffectTimer(); commitHookEffectListUnmount(Layout | HasEffect, finishedWork, finishedWork.return); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } recordLayoutEffectDuration(finishedWork); } else { try { commitHookEffectListUnmount(Layout | HasEffect, finishedWork, finishedWork.return); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } } } return; } case ClassComponent: { recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); if (flags & Ref) { if (current !== null) { safelyDetachRef(current, current.return); } } return; } case HostComponent: { recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); if (flags & Ref) { if (current !== null) { safelyDetachRef(current, current.return); } } { // TODO: ContentReset gets cleared by the children during the commit // phase. This is a refactor hazard because it means we must read // flags the flags after `commitReconciliationEffects` has already run; // the order matters. We should refactor so that ContentReset does not // rely on mutating the flag during commit. Like by setting a flag // during the render phase instead. if (finishedWork.flags & ContentReset) { var instance = finishedWork.stateNode; try { resetTextContent(instance); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } } if (flags & Update) { var _instance4 = finishedWork.stateNode; if (_instance4 != null) { // Commit the work prepared earlier. var newProps = finishedWork.memoizedProps; // For hydration we reuse the update path but we treat the oldProps // as the newProps. The updatePayload will contain the real change in // this case. var oldProps = current !== null ? current.memoizedProps : newProps; var type = finishedWork.type; // TODO: Type the updateQueue to be specific to host components. var updatePayload = finishedWork.updateQueue; finishedWork.updateQueue = null; if (updatePayload !== null) { try { commitUpdate(_instance4, updatePayload, type, oldProps, newProps, finishedWork); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } } } } } return; } case HostText: { recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); if (flags & Update) { { if (finishedWork.stateNode === null) { throw new Error('This should have a text node initialized. This error is likely ' + 'caused by a bug in React. Please file an issue.'); } var textInstance = finishedWork.stateNode; var newText = finishedWork.memoizedProps; // For hydration we reuse the update path but we treat the oldProps // as the newProps. The updatePayload will contain the real change in // this case. var oldText = current !== null ? current.memoizedProps : newText; try { commitTextUpdate(textInstance, oldText, newText); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } } } return; } case HostRoot: { recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); if (flags & Update) { { if (current !== null) { var prevRootState = current.memoizedState; if (prevRootState.isDehydrated) { try { commitHydratedContainer(root.containerInfo); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } } } } } return; } case HostPortal: { recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); return; } case SuspenseComponent: { recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); var offscreenFiber = finishedWork.child; if (offscreenFiber.flags & Visibility) { var offscreenInstance = offscreenFiber.stateNode; var newState = offscreenFiber.memoizedState; var isHidden = newState !== null; // Track the current state on the Offscreen instance so we can // read it during an event offscreenInstance.isHidden = isHidden; if (isHidden) { var wasHidden = offscreenFiber.alternate !== null && offscreenFiber.alternate.memoizedState !== null; if (!wasHidden) { // TODO: Move to passive phase markCommitTimeOfFallback(); } } } if (flags & Update) { try { commitSuspenseCallback(finishedWork); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } attachSuspenseRetryListeners(finishedWork); } return; } case OffscreenComponent: { var _wasHidden = current !== null && current.memoizedState !== null; if ( // TODO: Remove this dead flag finishedWork.mode & ConcurrentMode) { // Before committing the children, track on the stack whether this // offscreen subtree was already hidden, so that we don't unmount the // effects again. var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || _wasHidden; recursivelyTraverseMutationEffects(root, finishedWork); offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; } else { recursivelyTraverseMutationEffects(root, finishedWork); } commitReconciliationEffects(finishedWork); if (flags & Visibility) { var _offscreenInstance = finishedWork.stateNode; var _newState = finishedWork.memoizedState; var _isHidden = _newState !== null; var offscreenBoundary = finishedWork; // Track the current state on the Offscreen instance so we can // read it during an event _offscreenInstance.isHidden = _isHidden; { if (_isHidden) { if (!_wasHidden) { if ((offscreenBoundary.mode & ConcurrentMode) !== NoMode) { nextEffect = offscreenBoundary; var offscreenChild = offscreenBoundary.child; while (offscreenChild !== null) { nextEffect = offscreenChild; disappearLayoutEffects_begin(offscreenChild); offscreenChild = offscreenChild.sibling; } } } } } { // TODO: This needs to run whenever there's an insertion or update // inside a hidden Offscreen tree. hideOrUnhideAllChildren(offscreenBoundary, _isHidden); } } return; } case SuspenseListComponent: { recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); if (flags & Update) { attachSuspenseRetryListeners(finishedWork); } return; } case ScopeComponent: { return; } default: { recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); return; } } } function commitReconciliationEffects(finishedWork) { // Placement effects (insertions, reorders) can be scheduled on any fiber // type. They needs to happen after the children effects have fired, but // before the effects on this fiber have fired. var flags = finishedWork.flags; if (flags & Placement) { try { commitPlacement(finishedWork); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } // Clear the "placement" from effect tag so that we know that this is // inserted, before any life-cycles like componentDidMount gets called. // TODO: findDOMNode doesn't rely on this any more but isMounted does // and isMounted is deprecated anyway so we should be able to kill this. finishedWork.flags &= ~Placement; } if (flags & Hydrating) { finishedWork.flags &= ~Hydrating; } } function commitLayoutEffects(finishedWork, root, committedLanes) { inProgressLanes = committedLanes; inProgressRoot = root; nextEffect = finishedWork; commitLayoutEffects_begin(finishedWork, root, committedLanes); inProgressLanes = null; inProgressRoot = null; } function commitLayoutEffects_begin(subtreeRoot, root, committedLanes) { // Suspense layout effects semantics don't change for legacy roots. var isModernRoot = (subtreeRoot.mode & ConcurrentMode) !== NoMode; while (nextEffect !== null) { var fiber = nextEffect; var firstChild = fiber.child; if ( fiber.tag === OffscreenComponent && isModernRoot) { // Keep track of the current Offscreen stack's state. var isHidden = fiber.memoizedState !== null; var newOffscreenSubtreeIsHidden = isHidden || offscreenSubtreeIsHidden; if (newOffscreenSubtreeIsHidden) { // The Offscreen tree is hidden. Skip over its layout effects. commitLayoutMountEffects_complete(subtreeRoot, root, committedLanes); continue; } else { // TODO (Offscreen) Also check: subtreeFlags & LayoutMask var current = fiber.alternate; var wasHidden = current !== null && current.memoizedState !== null; var newOffscreenSubtreeWasHidden = wasHidden || offscreenSubtreeWasHidden; var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden; var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; // Traverse the Offscreen subtree with the current Offscreen as the root. offscreenSubtreeIsHidden = newOffscreenSubtreeIsHidden; offscreenSubtreeWasHidden = newOffscreenSubtreeWasHidden; if (offscreenSubtreeWasHidden && !prevOffscreenSubtreeWasHidden) { // This is the root of a reappearing boundary. Turn its layout effects // back on. nextEffect = fiber; reappearLayoutEffects_begin(fiber); } var child = firstChild; while (child !== null) { nextEffect = child; commitLayoutEffects_begin(child, // New root; bubble back up to here and stop. root, committedLanes); child = child.sibling; } // Restore Offscreen state and resume in our-progress traversal. nextEffect = fiber; offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; commitLayoutMountEffects_complete(subtreeRoot, root, committedLanes); continue; } } if ((fiber.subtreeFlags & LayoutMask) !== NoFlags && firstChild !== null) { firstChild.return = fiber; nextEffect = firstChild; } else { commitLayoutMountEffects_complete(subtreeRoot, root, committedLanes); } } } function commitLayoutMountEffects_complete(subtreeRoot, root, committedLanes) { while (nextEffect !== null) { var fiber = nextEffect; if ((fiber.flags & LayoutMask) !== NoFlags) { var current = fiber.alternate; setCurrentFiber(fiber); try { commitLayoutEffectOnFiber(root, current, fiber, committedLanes); } catch (error) { captureCommitPhaseError(fiber, fiber.return, error); } resetCurrentFiber(); } if (fiber === subtreeRoot) { nextEffect = null; return; } var sibling = fiber.sibling; if (sibling !== null) { sibling.return = fiber.return; nextEffect = sibling; return; } nextEffect = fiber.return; } } function disappearLayoutEffects_begin(subtreeRoot) { while (nextEffect !== null) { var fiber = nextEffect; var firstChild = fiber.child; // TODO (Offscreen) Check: flags & (RefStatic | LayoutStatic) switch (fiber.tag) { case FunctionComponent: case ForwardRef: case MemoComponent: case SimpleMemoComponent: { if ( fiber.mode & ProfileMode) { try { startLayoutEffectTimer(); commitHookEffectListUnmount(Layout, fiber, fiber.return); } finally { recordLayoutEffectDuration(fiber); } } else { commitHookEffectListUnmount(Layout, fiber, fiber.return); } break; } case ClassComponent: { // TODO (Offscreen) Check: flags & RefStatic safelyDetachRef(fiber, fiber.return); var instance = fiber.stateNode; if (typeof instance.componentWillUnmount === 'function') { safelyCallComponentWillUnmount(fiber, fiber.return, instance); } break; } case HostComponent: { safelyDetachRef(fiber, fiber.return); break; } case OffscreenComponent: { // Check if this is a var isHidden = fiber.memoizedState !== null; if (isHidden) { // Nested Offscreen tree is already hidden. Don't disappear // its effects. disappearLayoutEffects_complete(subtreeRoot); continue; } break; } } // TODO (Offscreen) Check: subtreeFlags & LayoutStatic if (firstChild !== null) { firstChild.return = fiber; nextEffect = firstChild; } else { disappearLayoutEffects_complete(subtreeRoot); } } } function disappearLayoutEffects_complete(subtreeRoot) { while (nextEffect !== null) { var fiber = nextEffect; if (fiber === subtreeRoot) { nextEffect = null; return; } var sibling = fiber.sibling; if (sibling !== null) { sibling.return = fiber.return; nextEffect = sibling; return; } nextEffect = fiber.return; } } function reappearLayoutEffects_begin(subtreeRoot) { while (nextEffect !== null) { var fiber = nextEffect; var firstChild = fiber.child; if (fiber.tag === OffscreenComponent) { var isHidden = fiber.memoizedState !== null; if (isHidden) { // Nested Offscreen tree is still hidden. Don't re-appear its effects. reappearLayoutEffects_complete(subtreeRoot); continue; } } // TODO (Offscreen) Check: subtreeFlags & LayoutStatic if (firstChild !== null) { // This node may have been reused from a previous render, so we can't // assume its return pointer is correct. firstChild.return = fiber; nextEffect = firstChild; } else { reappearLayoutEffects_complete(subtreeRoot); } } } function reappearLayoutEffects_complete(subtreeRoot) { while (nextEffect !== null) { var fiber = nextEffect; // TODO (Offscreen) Check: flags & LayoutStatic setCurrentFiber(fiber); try { reappearLayoutEffectsOnFiber(fiber); } catch (error) { captureCommitPhaseError(fiber, fiber.return, error); } resetCurrentFiber(); if (fiber === subtreeRoot) { nextEffect = null; return; } var sibling = fiber.sibling; if (sibling !== null) { // This node may have been reused from a previous render, so we can't // assume its return pointer is correct. sibling.return = fiber.return; nextEffect = sibling; return; } nextEffect = fiber.return; } } function commitPassiveMountEffects(root, finishedWork, committedLanes, committedTransitions) { nextEffect = finishedWork; commitPassiveMountEffects_begin(finishedWork, root, committedLanes, committedTransitions); } function commitPassiveMountEffects_begin(subtreeRoot, root, committedLanes, committedTransitions) { while (nextEffect !== null) { var fiber = nextEffect; var firstChild = fiber.child; if ((fiber.subtreeFlags & PassiveMask) !== NoFlags && firstChild !== null) { firstChild.return = fiber; nextEffect = firstChild; } else { commitPassiveMountEffects_complete(subtreeRoot, root, committedLanes, committedTransitions); } } } function commitPassiveMountEffects_complete(subtreeRoot, root, committedLanes, committedTransitions) { while (nextEffect !== null) { var fiber = nextEffect; if ((fiber.flags & Passive) !== NoFlags) { setCurrentFiber(fiber); try { commitPassiveMountOnFiber(root, fiber, committedLanes, committedTransitions); } catch (error) { captureCommitPhaseError(fiber, fiber.return, error); } resetCurrentFiber(); } if (fiber === subtreeRoot) { nextEffect = null; return; } var sibling = fiber.sibling; if (sibling !== null) { sibling.return = fiber.return; nextEffect = sibling; return; } nextEffect = fiber.return; } } function commitPassiveMountOnFiber(finishedRoot, finishedWork, committedLanes, committedTransitions) { switch (finishedWork.tag) { case FunctionComponent: case ForwardRef: case SimpleMemoComponent: { if ( finishedWork.mode & ProfileMode) { startPassiveEffectTimer(); try { commitHookEffectListMount(Passive$1 | HasEffect, finishedWork); } finally { recordPassiveEffectDuration(finishedWork); } } else { commitHookEffectListMount(Passive$1 | HasEffect, finishedWork); } break; } } } function commitPassiveUnmountEffects(firstChild) { nextEffect = firstChild; commitPassiveUnmountEffects_begin(); } function commitPassiveUnmountEffects_begin() { while (nextEffect !== null) { var fiber = nextEffect; var child = fiber.child; if ((nextEffect.flags & ChildDeletion) !== NoFlags) { var deletions = fiber.deletions; if (deletions !== null) { for (var i = 0; i < deletions.length; i++) { var fiberToDelete = deletions[i]; nextEffect = fiberToDelete; commitPassiveUnmountEffectsInsideOfDeletedTree_begin(fiberToDelete, fiber); } { // A fiber was deleted from this parent fiber, but it's still part of // the previous (alternate) parent fiber's list of children. Because // children are a linked list, an earlier sibling that's still alive // will be connected to the deleted fiber via its `alternate`: // // live fiber // --alternate--> previous live fiber // --sibling--> deleted fiber // // We can't disconnect `alternate` on nodes that haven't been deleted // yet, but we can disconnect the `sibling` and `child` pointers. var previousFiber = fiber.alternate; if (previousFiber !== null) { var detachedChild = previousFiber.child; if (detachedChild !== null) { previousFiber.child = null; do { var detachedSibling = detachedChild.sibling; detachedChild.sibling = null; detachedChild = detachedSibling; } while (detachedChild !== null); } } } nextEffect = fiber; } } if ((fiber.subtreeFlags & PassiveMask) !== NoFlags && child !== null) { child.return = fiber; nextEffect = child; } else { commitPassiveUnmountEffects_complete(); } } } function commitPassiveUnmountEffects_complete() { while (nextEffect !== null) { var fiber = nextEffect; if ((fiber.flags & Passive) !== NoFlags) { setCurrentFiber(fiber); commitPassiveUnmountOnFiber(fiber); resetCurrentFiber(); } var sibling = fiber.sibling; if (sibling !== null) { sibling.return = fiber.return; nextEffect = sibling; return; } nextEffect = fiber.return; } } function commitPassiveUnmountOnFiber(finishedWork) { switch (finishedWork.tag) { case FunctionComponent: case ForwardRef: case SimpleMemoComponent: { if ( finishedWork.mode & ProfileMode) { startPassiveEffectTimer(); commitHookEffectListUnmount(Passive$1 | HasEffect, finishedWork, finishedWork.return); recordPassiveEffectDuration(finishedWork); } else { commitHookEffectListUnmount(Passive$1 | HasEffect, finishedWork, finishedWork.return); } break; } } } function commitPassiveUnmountEffectsInsideOfDeletedTree_begin(deletedSubtreeRoot, nearestMountedAncestor) { while (nextEffect !== null) { var fiber = nextEffect; // Deletion effects fire in parent -> child order // TODO: Check if fiber has a PassiveStatic flag setCurrentFiber(fiber); commitPassiveUnmountInsideDeletedTreeOnFiber(fiber, nearestMountedAncestor); resetCurrentFiber(); var child = fiber.child; // TODO: Only traverse subtree if it has a PassiveStatic flag. (But, if we // do this, still need to handle `deletedTreeCleanUpLevel` correctly.) if (child !== null) { child.return = fiber; nextEffect = child; } else { commitPassiveUnmountEffectsInsideOfDeletedTree_complete(deletedSubtreeRoot); } } } function commitPassiveUnmountEffectsInsideOfDeletedTree_complete(deletedSubtreeRoot) { while (nextEffect !== null) { var fiber = nextEffect; var sibling = fiber.sibling; var returnFiber = fiber.return; { // Recursively traverse the entire deleted tree and clean up fiber fields. // This is more aggressive than ideal, and the long term goal is to only // have to detach the deleted tree at the root. detachFiberAfterEffects(fiber); if (fiber === deletedSubtreeRoot) { nextEffect = null; return; } } if (sibling !== null) { sibling.return = returnFiber; nextEffect = sibling; return; } nextEffect = returnFiber; } } function commitPassiveUnmountInsideDeletedTreeOnFiber(current, nearestMountedAncestor) { switch (current.tag) { case FunctionComponent: case ForwardRef: case SimpleMemoComponent: { if ( current.mode & ProfileMode) { startPassiveEffectTimer(); commitHookEffectListUnmount(Passive$1, current, nearestMountedAncestor); recordPassiveEffectDuration(current); } else { commitHookEffectListUnmount(Passive$1, current, nearestMountedAncestor); } break; } } } // TODO: Reuse reappearLayoutEffects traversal here? function invokeLayoutEffectMountInDEV(fiber) { { // We don't need to re-check StrictEffectsMode here. // This function is only called if that check has already passed. switch (fiber.tag) { case FunctionComponent: case ForwardRef: case SimpleMemoComponent: { try { commitHookEffectListMount(Layout | HasEffect, fiber); } catch (error) { captureCommitPhaseError(fiber, fiber.return, error); } break; } case ClassComponent: { var instance = fiber.stateNode; try { instance.componentDidMount(); } catch (error) { captureCommitPhaseError(fiber, fiber.return, error); } break; } } } } function invokePassiveEffectMountInDEV(fiber) { { // We don't need to re-check StrictEffectsMode here. // This function is only called if that check has already passed. switch (fiber.tag) { case FunctionComponent: case ForwardRef: case SimpleMemoComponent: { try { commitHookEffectListMount(Passive$1 | HasEffect, fiber); } catch (error) { captureCommitPhaseError(fiber, fiber.return, error); } break; } } } } function invokeLayoutEffectUnmountInDEV(fiber) { { // We don't need to re-check StrictEffectsMode here. // This function is only called if that check has already passed. switch (fiber.tag) { case FunctionComponent: case ForwardRef: case SimpleMemoComponent: { try { commitHookEffectListUnmount(Layout | HasEffect, fiber, fiber.return); } catch (error) { captureCommitPhaseError(fiber, fiber.return, error); } break; } case ClassComponent: { var instance = fiber.stateNode; if (typeof instance.componentWillUnmount === 'function') { safelyCallComponentWillUnmount(fiber, fiber.return, instance); } break; } } } } function invokePassiveEffectUnmountInDEV(fiber) { { // We don't need to re-check StrictEffectsMode here. // This function is only called if that check has already passed. switch (fiber.tag) { case FunctionComponent: case ForwardRef: case SimpleMemoComponent: { try { commitHookEffectListUnmount(Passive$1 | HasEffect, fiber, fiber.return); } catch (error) { captureCommitPhaseError(fiber, fiber.return, error); } } } } } var COMPONENT_TYPE = 0; var HAS_PSEUDO_CLASS_TYPE = 1; var ROLE_TYPE = 2; var TEST_NAME_TYPE = 3; var TEXT_TYPE = 4; if (typeof Symbol === 'function' && Symbol.for) { var symbolFor = Symbol.for; COMPONENT_TYPE = symbolFor('selector.component'); HAS_PSEUDO_CLASS_TYPE = symbolFor('selector.has_pseudo_class'); ROLE_TYPE = symbolFor('selector.role'); TEST_NAME_TYPE = symbolFor('selector.test_id'); TEXT_TYPE = symbolFor('selector.text'); } var commitHooks = []; function onCommitRoot$1() { { commitHooks.forEach(function (commitHook) { return commitHook(); }); } } var ReactCurrentActQueue = ReactSharedInternals.ReactCurrentActQueue; function isLegacyActEnvironment(fiber) { { // Legacy mode. We preserve the behavior of React 17's act. It assumes an // act environment whenever `jest` is defined, but you can still turn off // spurious warnings by setting IS_REACT_ACT_ENVIRONMENT explicitly // to false. var isReactActEnvironmentGlobal = // $FlowExpectedError – Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global typeof IS_REACT_ACT_ENVIRONMENT !== 'undefined' ? IS_REACT_ACT_ENVIRONMENT : undefined; // $FlowExpectedError - Flow doesn't know about jest var jestIsDefined = typeof jest !== 'undefined'; return jestIsDefined && isReactActEnvironmentGlobal !== false; } } function isConcurrentActEnvironment() { { var isReactActEnvironmentGlobal = // $FlowExpectedError – Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global typeof IS_REACT_ACT_ENVIRONMENT !== 'undefined' ? IS_REACT_ACT_ENVIRONMENT : undefined; if (!isReactActEnvironmentGlobal && ReactCurrentActQueue.current !== null) { // TODO: Include link to relevant documentation page. error('The current testing environment is not configured to support ' + 'act(...)'); } return isReactActEnvironmentGlobal; } } var ceil = Math.ceil; var ReactCurrentDispatcher$2 = ReactSharedInternals.ReactCurrentDispatcher, ReactCurrentOwner$2 = ReactSharedInternals.ReactCurrentOwner, ReactCurrentBatchConfig$3 = ReactSharedInternals.ReactCurrentBatchConfig, ReactCurrentActQueue$1 = ReactSharedInternals.ReactCurrentActQueue; var NoContext = /* */ 0; var BatchedContext = /* */ 1; var RenderContext = /* */ 2; var CommitContext = /* */ 4; var RootInProgress = 0; var RootFatalErrored = 1; var RootErrored = 2; var RootSuspended = 3; var RootSuspendedWithDelay = 4; var RootCompleted = 5; var RootDidNotComplete = 6; // Describes where we are in the React execution stack var executionContext = NoContext; // The root we're working on var workInProgressRoot = null; // The fiber we're working on var workInProgress = null; // The lanes we're rendering var workInProgressRootRenderLanes = NoLanes; // Stack that allows components to change the render lanes for its subtree // This is a superset of the lanes we started working on at the root. The only // case where it's different from `workInProgressRootRenderLanes` is when we // enter a subtree that is hidden and needs to be unhidden: Suspense and // Offscreen component. // // Most things in the work loop should deal with workInProgressRootRenderLanes. // Most things in begin/complete phases should deal with subtreeRenderLanes. var subtreeRenderLanes = NoLanes; var subtreeRenderLanesCursor = createCursor(NoLanes); // Whether to root completed, errored, suspended, etc. var workInProgressRootExitStatus = RootInProgress; // A fatal error, if one is thrown var workInProgressRootFatalError = null; // "Included" lanes refer to lanes that were worked on during this render. It's // slightly different than `renderLanes` because `renderLanes` can change as you // enter and exit an Offscreen tree. This value is the combination of all render // lanes for the entire render phase. var workInProgressRootIncludedLanes = NoLanes; // The work left over by components that were visited during this render. Only // includes unprocessed updates, not work in bailed out children. var workInProgressRootSkippedLanes = NoLanes; // Lanes that were updated (in an interleaved event) during this render. var workInProgressRootInterleavedUpdatedLanes = NoLanes; // Lanes that were updated during the render phase (*not* an interleaved event). var workInProgressRootPingedLanes = NoLanes; // Errors that are thrown during the render phase. var workInProgressRootConcurrentErrors = null; // These are errors that we recovered from without surfacing them to the UI. // We will log them once the tree commits. var workInProgressRootRecoverableErrors = null; // The most recent time we committed a fallback. This lets us ensure a train // model where we don't commit new loading states in too quick succession. var globalMostRecentFallbackTime = 0; var FALLBACK_THROTTLE_MS = 500; // The absolute time for when we should start giving up on rendering // more and prefer CPU suspense heuristics instead. var workInProgressRootRenderTargetTime = Infinity; // How long a render is supposed to take before we start following CPU // suspense heuristics and opt out of rendering more content. var RENDER_TIMEOUT_MS = 500; var workInProgressTransitions = null; function resetRenderTimer() { workInProgressRootRenderTargetTime = now() + RENDER_TIMEOUT_MS; } function getRenderTargetTime() { return workInProgressRootRenderTargetTime; } var hasUncaughtError = false; var firstUncaughtError = null; var legacyErrorBoundariesThatAlreadyFailed = null; // Only used when enableProfilerNestedUpdateScheduledHook is true; var rootDoesHavePassiveEffects = false; var rootWithPendingPassiveEffects = null; var pendingPassiveEffectsLanes = NoLanes; var pendingPassiveProfilerEffects = []; var pendingPassiveTransitions = null; // Use these to prevent an infinite loop of nested updates var NESTED_UPDATE_LIMIT = 50; var nestedUpdateCount = 0; var rootWithNestedUpdates = null; var isFlushingPassiveEffects = false; var didScheduleUpdateDuringPassiveEffects = false; var NESTED_PASSIVE_UPDATE_LIMIT = 50; var nestedPassiveUpdateCount = 0; var rootWithPassiveNestedUpdates = null; // If two updates are scheduled within the same event, we should treat their // event times as simultaneous, even if the actual clock time has advanced // between the first and second call. var currentEventTime = NoTimestamp; var currentEventTransitionLane = NoLanes; var isRunningInsertionEffect = false; function getWorkInProgressRoot() { return workInProgressRoot; } function requestEventTime() { if ((executionContext & (RenderContext | CommitContext)) !== NoContext) { // We're inside React, so it's fine to read the actual time. return now(); } // We're not inside React, so we may be in the middle of a browser event. if (currentEventTime !== NoTimestamp) { // Use the same start time for all updates until we enter React again. return currentEventTime; } // This is the first update since React yielded. Compute a new start time. currentEventTime = now(); return currentEventTime; } function requestUpdateLane(fiber) { // Special cases var mode = fiber.mode; if ((mode & ConcurrentMode) === NoMode) { return SyncLane; } else if ( (executionContext & RenderContext) !== NoContext && workInProgressRootRenderLanes !== NoLanes) { // This is a render phase update. These are not officially supported. The // old behavior is to give this the same "thread" (lanes) as // whatever is currently rendering. So if you call `setState` on a component // that happens later in the same render, it will flush. Ideally, we want to // remove the special case and treat them as if they came from an // interleaved event. Regardless, this pattern is not officially supported. // This behavior is only a fallback. The flag only exists until we can roll // out the setState warning, since existing code might accidentally rely on // the current behavior. return pickArbitraryLane(workInProgressRootRenderLanes); } var isTransition = requestCurrentTransition() !== NoTransition; if (isTransition) { if ( ReactCurrentBatchConfig$3.transition !== null) { var transition = ReactCurrentBatchConfig$3.transition; if (!transition._updatedFibers) { transition._updatedFibers = new Set(); } transition._updatedFibers.add(fiber); } // The algorithm for assigning an update to a lane should be stable for all // updates at the same priority within the same event. To do this, the // inputs to the algorithm must be the same. // // The trick we use is to cache the first of each of these inputs within an // event. Then reset the cached values once we can be sure the event is // over. Our heuristic for that is whenever we enter a concurrent work loop. if (currentEventTransitionLane === NoLane) { // All transitions within the same event are assigned the same lane. currentEventTransitionLane = claimNextTransitionLane(); } return currentEventTransitionLane; } // Updates originating inside certain React methods, like flushSync, have // their priority set by tracking it with a context variable. // // The opaque type returned by the host config is internally a lane, so we can // use that directly. // TODO: Move this type conversion to the event priority module. var updateLane = getCurrentUpdatePriority(); if (updateLane !== NoLane) { return updateLane; } // This update originated outside React. Ask the host environment for an // appropriate priority, based on the type of event. // // The opaque type returned by the host config is internally a lane, so we can // use that directly. // TODO: Move this type conversion to the event priority module. var eventLane = getCurrentEventPriority(); return eventLane; } function requestRetryLane(fiber) { // This is a fork of `requestUpdateLane` designed specifically for Suspense // "retries" — a special update that attempts to flip a Suspense boundary // from its placeholder state to its primary/resolved state. // Special cases var mode = fiber.mode; if ((mode & ConcurrentMode) === NoMode) { return SyncLane; } return claimNextRetryLane(); } function scheduleUpdateOnFiber(root, fiber, lane, eventTime) { checkForNestedUpdates(); { if (isRunningInsertionEffect) { error('useInsertionEffect must not schedule updates.'); } } { if (isFlushingPassiveEffects) { didScheduleUpdateDuringPassiveEffects = true; } } // Mark that the root has a pending update. markRootUpdated(root, lane, eventTime); if ((executionContext & RenderContext) !== NoLanes && root === workInProgressRoot) { // This update was dispatched during the render phase. This is a mistake // if the update originates from user space (with the exception of local // hook updates, which are handled differently and don't reach this // function), but there are some internal React features that use this as // an implementation detail, like selective hydration. warnAboutRenderPhaseUpdatesInDEV(fiber); // Track lanes that were updated during the render phase } else { // This is a normal update, scheduled from outside the render phase. For // example, during an input event. { if (isDevToolsPresent) { addFiberToLanesMap(root, fiber, lane); } } warnIfUpdatesNotWrappedWithActDEV(fiber); if (root === workInProgressRoot) { // Received an update to a tree that's in the middle of rendering. Mark // that there was an interleaved update work on this root. Unless the // `deferRenderPhaseUpdateToNextBatch` flag is off and this is a render // phase update. In that case, we don't treat render phase updates as if // they were interleaved, for backwards compat reasons. if ( (executionContext & RenderContext) === NoContext) { workInProgressRootInterleavedUpdatedLanes = mergeLanes(workInProgressRootInterleavedUpdatedLanes, lane); } if (workInProgressRootExitStatus === RootSuspendedWithDelay) { // The root already suspended with a delay, which means this render // definitely won't finish. Since we have a new update, let's mark it as // suspended now, right before marking the incoming update. This has the // effect of interrupting the current render and switching to the update. // TODO: Make sure this doesn't override pings that happen while we've // already started rendering. markRootSuspended$1(root, workInProgressRootRenderLanes); } } ensureRootIsScheduled(root, eventTime); if (lane === SyncLane && executionContext === NoContext && (fiber.mode & ConcurrentMode) === NoMode && // Treat `act` as if it's inside `batchedUpdates`, even in legacy mode. !( ReactCurrentActQueue$1.isBatchingLegacy)) { // Flush the synchronous work now, unless we're already working or inside // a batch. This is intentionally inside scheduleUpdateOnFiber instead of // scheduleCallbackForFiber to preserve the ability to schedule a callback // without immediately flushing it. We only do this for user-initiated // updates, to preserve historical behavior of legacy mode. resetRenderTimer(); flushSyncCallbacksOnlyInLegacyMode(); } } } function scheduleInitialHydrationOnRoot(root, lane, eventTime) { // This is a special fork of scheduleUpdateOnFiber that is only used to // schedule the initial hydration of a root that has just been created. Most // of the stuff in scheduleUpdateOnFiber can be skipped. // // The main reason for this separate path, though, is to distinguish the // initial children from subsequent updates. In fully client-rendered roots // (createRoot instead of hydrateRoot), all top-level renders are modeled as // updates, but hydration roots are special because the initial render must // match what was rendered on the server. var current = root.current; current.lanes = lane; markRootUpdated(root, lane, eventTime); ensureRootIsScheduled(root, eventTime); } function isUnsafeClassRenderPhaseUpdate(fiber) { // Check if this is a render phase update. Only called by class components, // which special (deprecated) behavior for UNSAFE_componentWillReceive props. return (// TODO: Remove outdated deferRenderPhaseUpdateToNextBatch experiment. We // decided not to enable it. (executionContext & RenderContext) !== NoContext ); } // Use this function to schedule a task for a root. There's only one task per // root; if a task was already scheduled, we'll check to make sure the priority // of the existing task is the same as the priority of the next level that the // root has work on. This function is called on every update, and right before // exiting a task. function ensureRootIsScheduled(root, currentTime) { var existingCallbackNode = root.callbackNode; // Check if any lanes are being starved by other work. If so, mark them as // expired so we know to work on those next. markStarvedLanesAsExpired(root, currentTime); // Determine the next lanes to work on, and their priority. var nextLanes = getNextLanes(root, root === workInProgressRoot ? workInProgressRootRenderLanes : NoLanes); if (nextLanes === NoLanes) { // Special case: There's nothing to work on. if (existingCallbackNode !== null) { cancelCallback$1(existingCallbackNode); } root.callbackNode = null; root.callbackPriority = NoLane; return; } // We use the highest priority lane to represent the priority of the callback. var newCallbackPriority = getHighestPriorityLane(nextLanes); // Check if there's an existing task. We may be able to reuse it. var existingCallbackPriority = root.callbackPriority; if (existingCallbackPriority === newCallbackPriority && // Special case related to `act`. If the currently scheduled task is a // Scheduler task, rather than an `act` task, cancel it and re-scheduled // on the `act` queue. !( ReactCurrentActQueue$1.current !== null && existingCallbackNode !== fakeActCallbackNode)) { { // If we're going to re-use an existing task, it needs to exist. // Assume that discrete update microtasks are non-cancellable and null. // TODO: Temporary until we confirm this warning is not fired. if (existingCallbackNode == null && existingCallbackPriority !== SyncLane) { error('Expected scheduled callback to exist. This error is likely caused by a bug in React. Please file an issue.'); } } // The priority hasn't changed. We can reuse the existing task. Exit. return; } if (existingCallbackNode != null) { // Cancel the existing callback. We'll schedule a new one below. cancelCallback$1(existingCallbackNode); } // Schedule a new callback. var newCallbackNode; if (newCallbackPriority === SyncLane) { // Special case: Sync React callbacks are scheduled on a special // internal queue if (root.tag === LegacyRoot) { if ( ReactCurrentActQueue$1.isBatchingLegacy !== null) { ReactCurrentActQueue$1.didScheduleLegacyUpdate = true; } scheduleLegacySyncCallback(performSyncWorkOnRoot.bind(null, root)); } else { scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root)); } { // Flush the queue in a microtask. if ( ReactCurrentActQueue$1.current !== null) { // Inside `act`, use our internal `act` queue so that these get flushed // at the end of the current scope even when using the sync version // of `act`. ReactCurrentActQueue$1.current.push(flushSyncCallbacks); } else { scheduleMicrotask(function () { // In Safari, appending an iframe forces microtasks to run. // https://github.com/facebook/react/issues/22459 // We don't support running callbacks in the middle of render // or commit so we need to check against that. if ((executionContext & (RenderContext | CommitContext)) === NoContext) { // Note that this would still prematurely flush the callbacks // if this happens outside render or commit phase (e.g. in an event). flushSyncCallbacks(); } }); } } newCallbackNode = null; } else { var schedulerPriorityLevel; switch (lanesToEventPriority(nextLanes)) { case DiscreteEventPriority: schedulerPriorityLevel = ImmediatePriority; break; case ContinuousEventPriority: schedulerPriorityLevel = UserBlockingPriority; break; case DefaultEventPriority: schedulerPriorityLevel = NormalPriority; break; case IdleEventPriority: schedulerPriorityLevel = IdlePriority; break; default: schedulerPriorityLevel = NormalPriority; break; } newCallbackNode = scheduleCallback$1(schedulerPriorityLevel, performConcurrentWorkOnRoot.bind(null, root)); } root.callbackPriority = newCallbackPriority; root.callbackNode = newCallbackNode; } // This is the entry point for every concurrent task, i.e. anything that // goes through Scheduler. function performConcurrentWorkOnRoot(root, didTimeout) { { resetNestedUpdateFlag(); } // Since we know we're in a React event, we can clear the current // event time. The next update will compute a new event time. currentEventTime = NoTimestamp; currentEventTransitionLane = NoLanes; if ((executionContext & (RenderContext | CommitContext)) !== NoContext) { throw new Error('Should not already be working.'); } // Flush any pending passive effects before deciding which lanes to work on, // in case they schedule additional work. var originalCallbackNode = root.callbackNode; var didFlushPassiveEffects = flushPassiveEffects(); if (didFlushPassiveEffects) { // Something in the passive effect phase may have canceled the current task. // Check if the task node for this root was changed. if (root.callbackNode !== originalCallbackNode) { // The current task was canceled. Exit. We don't need to call // `ensureRootIsScheduled` because the check above implies either that // there's a new task, or that there's no remaining work on this root. return null; } } // Determine the next lanes to work on, using the fields stored // on the root. var lanes = getNextLanes(root, root === workInProgressRoot ? workInProgressRootRenderLanes : NoLanes); if (lanes === NoLanes) { // Defensive coding. This is never expected to happen. return null; } // We disable time-slicing in some cases: if the work has been CPU-bound // for too long ("expired" work, to prevent starvation), or we're in // sync-updates-by-default mode. // TODO: We only check `didTimeout` defensively, to account for a Scheduler // bug we're still investigating. Once the bug in Scheduler is fixed, // we can remove this, since we track expiration ourselves. var shouldTimeSlice = !includesBlockingLane(root, lanes) && !includesExpiredLane(root, lanes) && ( !didTimeout); var exitStatus = shouldTimeSlice ? renderRootConcurrent(root, lanes) : renderRootSync(root, lanes); if (exitStatus !== RootInProgress) { if (exitStatus === RootErrored) { // If something threw an error, try rendering one more time. We'll // render synchronously to block concurrent data mutations, and we'll // includes all pending updates are included. If it still fails after // the second attempt, we'll give up and commit the resulting tree. var errorRetryLanes = getLanesToRetrySynchronouslyOnError(root); if (errorRetryLanes !== NoLanes) { lanes = errorRetryLanes; exitStatus = recoverFromConcurrentError(root, errorRetryLanes); } } if (exitStatus === RootFatalErrored) { var fatalError = workInProgressRootFatalError; prepareFreshStack(root, NoLanes); markRootSuspended$1(root, lanes); ensureRootIsScheduled(root, now()); throw fatalError; } if (exitStatus === RootDidNotComplete) { // The render unwound without completing the tree. This happens in special // cases where need to exit the current render without producing a // consistent tree or committing. // // This should only happen during a concurrent render, not a discrete or // synchronous update. We should have already checked for this when we // unwound the stack. markRootSuspended$1(root, lanes); } else { // The render completed. // Check if this render may have yielded to a concurrent event, and if so, // confirm that any newly rendered stores are consistent. // TODO: It's possible that even a concurrent render may never have yielded // to the main thread, if it was fast enough, or if it expired. We could // skip the consistency check in that case, too. var renderWasConcurrent = !includesBlockingLane(root, lanes); var finishedWork = root.current.alternate; if (renderWasConcurrent && !isRenderConsistentWithExternalStores(finishedWork)) { // A store was mutated in an interleaved event. Render again, // synchronously, to block further mutations. exitStatus = renderRootSync(root, lanes); // We need to check again if something threw if (exitStatus === RootErrored) { var _errorRetryLanes = getLanesToRetrySynchronouslyOnError(root); if (_errorRetryLanes !== NoLanes) { lanes = _errorRetryLanes; exitStatus = recoverFromConcurrentError(root, _errorRetryLanes); // We assume the tree is now consistent because we didn't yield to any // concurrent events. } } if (exitStatus === RootFatalErrored) { var _fatalError = workInProgressRootFatalError; prepareFreshStack(root, NoLanes); markRootSuspended$1(root, lanes); ensureRootIsScheduled(root, now()); throw _fatalError; } } // We now have a consistent tree. The next step is either to commit it, // or, if something suspended, wait to commit it after a timeout. root.finishedWork = finishedWork; root.finishedLanes = lanes; finishConcurrentRender(root, exitStatus, lanes); } } ensureRootIsScheduled(root, now()); if (root.callbackNode === originalCallbackNode) { // The task node scheduled for this root is the same one that's // currently executed. Need to return a continuation. return performConcurrentWorkOnRoot.bind(null, root); } return null; } function recoverFromConcurrentError(root, errorRetryLanes) { // If an error occurred during hydration, discard server response and fall // back to client side render. // Before rendering again, save the errors from the previous attempt. var errorsFromFirstAttempt = workInProgressRootConcurrentErrors; if (isRootDehydrated(root)) { // The shell failed to hydrate. Set a flag to force a client rendering // during the next attempt. To do this, we call prepareFreshStack now // to create the root work-in-progress fiber. This is a bit weird in terms // of factoring, because it relies on renderRootSync not calling // prepareFreshStack again in the call below, which happens because the // root and lanes haven't changed. // // TODO: I think what we should do is set ForceClientRender inside // throwException, like we do for nested Suspense boundaries. The reason // it's here instead is so we can switch to the synchronous work loop, too. // Something to consider for a future refactor. var rootWorkInProgress = prepareFreshStack(root, errorRetryLanes); rootWorkInProgress.flags |= ForceClientRender; { errorHydratingContainer(root.containerInfo); } } var exitStatus = renderRootSync(root, errorRetryLanes); if (exitStatus !== RootErrored) { // Successfully finished rendering on retry // The errors from the failed first attempt have been recovered. Add // them to the collection of recoverable errors. We'll log them in the // commit phase. var errorsFromSecondAttempt = workInProgressRootRecoverableErrors; workInProgressRootRecoverableErrors = errorsFromFirstAttempt; // The errors from the second attempt should be queued after the errors // from the first attempt, to preserve the causal sequence. if (errorsFromSecondAttempt !== null) { queueRecoverableErrors(errorsFromSecondAttempt); } } return exitStatus; } function queueRecoverableErrors(errors) { if (workInProgressRootRecoverableErrors === null) { workInProgressRootRecoverableErrors = errors; } else { workInProgressRootRecoverableErrors.push.apply(workInProgressRootRecoverableErrors, errors); } } function finishConcurrentRender(root, exitStatus, lanes) { switch (exitStatus) { case RootInProgress: case RootFatalErrored: { throw new Error('Root did not complete. This is a bug in React.'); } // Flow knows about invariant, so it complains if I add a break // statement, but eslint doesn't know about invariant, so it complains // if I do. eslint-disable-next-line no-fallthrough case RootErrored: { // We should have already attempted to retry this tree. If we reached // this point, it errored again. Commit it. commitRoot(root, workInProgressRootRecoverableErrors, workInProgressTransitions); break; } case RootSuspended: { markRootSuspended$1(root, lanes); // We have an acceptable loading state. We need to figure out if we // should immediately commit it or wait a bit. if (includesOnlyRetries(lanes) && // do not delay if we're inside an act() scope !shouldForceFlushFallbacksInDEV()) { // This render only included retries, no updates. Throttle committing // retries so that we don't show too many loading states too quickly. var msUntilTimeout = globalMostRecentFallbackTime + FALLBACK_THROTTLE_MS - now(); // Don't bother with a very short suspense time. if (msUntilTimeout > 10) { var nextLanes = getNextLanes(root, NoLanes); if (nextLanes !== NoLanes) { // There's additional work on this root. break; } var suspendedLanes = root.suspendedLanes; if (!isSubsetOfLanes(suspendedLanes, lanes)) { // We should prefer to render the fallback of at the last // suspended level. Ping the last suspended level to try // rendering it again. // FIXME: What if the suspended lanes are Idle? Should not restart. var eventTime = requestEventTime(); markRootPinged(root, suspendedLanes); break; } // The render is suspended, it hasn't timed out, and there's no // lower priority work to do. Instead of committing the fallback // immediately, wait for more data to arrive. root.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root, workInProgressRootRecoverableErrors, workInProgressTransitions), msUntilTimeout); break; } } // The work expired. Commit immediately. commitRoot(root, workInProgressRootRecoverableErrors, workInProgressTransitions); break; } case RootSuspendedWithDelay: { markRootSuspended$1(root, lanes); if (includesOnlyTransitions(lanes)) { // This is a transition, so we should exit without committing a // placeholder and without scheduling a timeout. Delay indefinitely // until we receive more data. break; } if (!shouldForceFlushFallbacksInDEV()) { // This is not a transition, but we did trigger an avoided state. // Schedule a placeholder to display after a short delay, using the Just // Noticeable Difference. // TODO: Is the JND optimization worth the added complexity? If this is // the only reason we track the event time, then probably not. // Consider removing. var mostRecentEventTime = getMostRecentEventTime(root, lanes); var eventTimeMs = mostRecentEventTime; var timeElapsedMs = now() - eventTimeMs; var _msUntilTimeout = jnd(timeElapsedMs) - timeElapsedMs; // Don't bother with a very short suspense time. if (_msUntilTimeout > 10) { // Instead of committing the fallback immediately, wait for more data // to arrive. root.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root, workInProgressRootRecoverableErrors, workInProgressTransitions), _msUntilTimeout); break; } } // Commit the placeholder. commitRoot(root, workInProgressRootRecoverableErrors, workInProgressTransitions); break; } case RootCompleted: { // The work completed. Ready to commit. commitRoot(root, workInProgressRootRecoverableErrors, workInProgressTransitions); break; } default: { throw new Error('Unknown root exit status.'); } } } function isRenderConsistentWithExternalStores(finishedWork) { // Search the rendered tree for external store reads, and check whether the // stores were mutated in a concurrent event. Intentionally using an iterative // loop instead of recursion so we can exit early. var node = finishedWork; while (true) { if (node.flags & StoreConsistency) { var updateQueue = node.updateQueue; if (updateQueue !== null) { var checks = updateQueue.stores; if (checks !== null) { for (var i = 0; i < checks.length; i++) { var check = checks[i]; var getSnapshot = check.getSnapshot; var renderedValue = check.value; try { if (!objectIs(getSnapshot(), renderedValue)) { // Found an inconsistent store. return false; } } catch (error) { // If `getSnapshot` throws, return `false`. This will schedule // a re-render, and the error will be rethrown during render. return false; } } } } } var child = node.child; if (node.subtreeFlags & StoreConsistency && child !== null) { child.return = node; node = child; continue; } if (node === finishedWork) { return true; } while (node.sibling === null) { if (node.return === null || node.return === finishedWork) { return true; } node = node.return; } node.sibling.return = node.return; node = node.sibling; } // Flow doesn't know this is unreachable, but eslint does // eslint-disable-next-line no-unreachable return true; } function markRootSuspended$1(root, suspendedLanes) { // When suspending, we should always exclude lanes that were pinged or (more // rarely, since we try to avoid it) updated during the render phase. // TODO: Lol maybe there's a better way to factor this besides this // obnoxiously named function :) suspendedLanes = removeLanes(suspendedLanes, workInProgressRootPingedLanes); suspendedLanes = removeLanes(suspendedLanes, workInProgressRootInterleavedUpdatedLanes); markRootSuspended(root, suspendedLanes); } // This is the entry point for synchronous tasks that don't go // through Scheduler function performSyncWorkOnRoot(root) { { syncNestedUpdateFlag(); } if ((executionContext & (RenderContext | CommitContext)) !== NoContext) { throw new Error('Should not already be working.'); } flushPassiveEffects(); var lanes = getNextLanes(root, NoLanes); if (!includesSomeLane(lanes, SyncLane)) { // There's no remaining sync work left. ensureRootIsScheduled(root, now()); return null; } var exitStatus = renderRootSync(root, lanes); if (root.tag !== LegacyRoot && exitStatus === RootErrored) { // If something threw an error, try rendering one more time. We'll render // synchronously to block concurrent data mutations, and we'll includes // all pending updates are included. If it still fails after the second // attempt, we'll give up and commit the resulting tree. var errorRetryLanes = getLanesToRetrySynchronouslyOnError(root); if (errorRetryLanes !== NoLanes) { lanes = errorRetryLanes; exitStatus = recoverFromConcurrentError(root, errorRetryLanes); } } if (exitStatus === RootFatalErrored) { var fatalError = workInProgressRootFatalError; prepareFreshStack(root, NoLanes); markRootSuspended$1(root, lanes); ensureRootIsScheduled(root, now()); throw fatalError; } if (exitStatus === RootDidNotComplete) { throw new Error('Root did not complete. This is a bug in React.'); } // We now have a consistent tree. Because this is a sync render, we // will commit it even if something suspended. var finishedWork = root.current.alternate; root.finishedWork = finishedWork; root.finishedLanes = lanes; commitRoot(root, workInProgressRootRecoverableErrors, workInProgressTransitions); // Before exiting, make sure there's a callback scheduled for the next // pending level. ensureRootIsScheduled(root, now()); return null; } function flushRoot(root, lanes) { if (lanes !== NoLanes) { markRootEntangled(root, mergeLanes(lanes, SyncLane)); ensureRootIsScheduled(root, now()); if ((executionContext & (RenderContext | CommitContext)) === NoContext) { resetRenderTimer(); flushSyncCallbacks(); } } } function batchedUpdates$1(fn, a) { var prevExecutionContext = executionContext; executionContext |= BatchedContext; try { return fn(a); } finally { executionContext = prevExecutionContext; // If there were legacy sync updates, flush them at the end of the outer // most batchedUpdates-like method. if (executionContext === NoContext && // Treat `act` as if it's inside `batchedUpdates`, even in legacy mode. !( ReactCurrentActQueue$1.isBatchingLegacy)) { resetRenderTimer(); flushSyncCallbacksOnlyInLegacyMode(); } } } function discreteUpdates(fn, a, b, c, d) { var previousPriority = getCurrentUpdatePriority(); var prevTransition = ReactCurrentBatchConfig$3.transition; try { ReactCurrentBatchConfig$3.transition = null; setCurrentUpdatePriority(DiscreteEventPriority); return fn(a, b, c, d); } finally { setCurrentUpdatePriority(previousPriority); ReactCurrentBatchConfig$3.transition = prevTransition; if (executionContext === NoContext) { resetRenderTimer(); } } } // Overload the definition to the two valid signatures. // Warning, this opts-out of checking the function body. // eslint-disable-next-line no-redeclare function flushSync(fn) { // In legacy mode, we flush pending passive effects at the beginning of the // next event, not at the end of the previous one. if (rootWithPendingPassiveEffects !== null && rootWithPendingPassiveEffects.tag === LegacyRoot && (executionContext & (RenderContext | CommitContext)) === NoContext) { flushPassiveEffects(); } var prevExecutionContext = executionContext; executionContext |= BatchedContext; var prevTransition = ReactCurrentBatchConfig$3.transition; var previousPriority = getCurrentUpdatePriority(); try { ReactCurrentBatchConfig$3.transition = null; setCurrentUpdatePriority(DiscreteEventPriority); if (fn) { return fn(); } else { return undefined; } } finally { setCurrentUpdatePriority(previousPriority); ReactCurrentBatchConfig$3.transition = prevTransition; executionContext = prevExecutionContext; // Flush the immediate callbacks that were scheduled during this batch. // Note that this will happen even if batchedUpdates is higher up // the stack. if ((executionContext & (RenderContext | CommitContext)) === NoContext) { flushSyncCallbacks(); } } } function isAlreadyRendering() { // Used by the renderer to print a warning if certain APIs are called from // the wrong context. return (executionContext & (RenderContext | CommitContext)) !== NoContext; } function pushRenderLanes(fiber, lanes) { push(subtreeRenderLanesCursor, subtreeRenderLanes, fiber); subtreeRenderLanes = mergeLanes(subtreeRenderLanes, lanes); workInProgressRootIncludedLanes = mergeLanes(workInProgressRootIncludedLanes, lanes); } function popRenderLanes(fiber) { subtreeRenderLanes = subtreeRenderLanesCursor.current; pop(subtreeRenderLanesCursor, fiber); } function prepareFreshStack(root, lanes) { root.finishedWork = null; root.finishedLanes = NoLanes; var timeoutHandle = root.timeoutHandle; if (timeoutHandle !== noTimeout) { // The root previous suspended and scheduled a timeout to commit a fallback // state. Now that we have additional work, cancel the timeout. root.timeoutHandle = noTimeout; // $FlowFixMe Complains noTimeout is not a TimeoutID, despite the check above cancelTimeout(timeoutHandle); } if (workInProgress !== null) { var interruptedWork = workInProgress.return; while (interruptedWork !== null) { var current = interruptedWork.alternate; unwindInterruptedWork(current, interruptedWork); interruptedWork = interruptedWork.return; } } workInProgressRoot = root; var rootWorkInProgress = createWorkInProgress(root.current, null); workInProgress = rootWorkInProgress; workInProgressRootRenderLanes = subtreeRenderLanes = workInProgressRootIncludedLanes = lanes; workInProgressRootExitStatus = RootInProgress; workInProgressRootFatalError = null; workInProgressRootSkippedLanes = NoLanes; workInProgressRootInterleavedUpdatedLanes = NoLanes; workInProgressRootPingedLanes = NoLanes; workInProgressRootConcurrentErrors = null; workInProgressRootRecoverableErrors = null; finishQueueingConcurrentUpdates(); { ReactStrictModeWarnings.discardPendingWarnings(); } return rootWorkInProgress; } function handleError(root, thrownValue) { do { var erroredWork = workInProgress; try { // Reset module-level state that was set during the render phase. resetContextDependencies(); resetHooksAfterThrow(); resetCurrentFiber(); // TODO: I found and added this missing line while investigating a // separate issue. Write a regression test using string refs. ReactCurrentOwner$2.current = null; if (erroredWork === null || erroredWork.return === null) { // Expected to be working on a non-root fiber. This is a fatal error // because there's no ancestor that can handle it; the root is // supposed to capture all errors that weren't caught by an error // boundary. workInProgressRootExitStatus = RootFatalErrored; workInProgressRootFatalError = thrownValue; // Set `workInProgress` to null. This represents advancing to the next // sibling, or the parent if there are no siblings. But since the root // has no siblings nor a parent, we set it to null. Usually this is // handled by `completeUnitOfWork` or `unwindWork`, but since we're // intentionally not calling those, we need set it here. // TODO: Consider calling `unwindWork` to pop the contexts. workInProgress = null; return; } if (enableProfilerTimer && erroredWork.mode & ProfileMode) { // Record the time spent rendering before an error was thrown. This // avoids inaccurate Profiler durations in the case of a // suspended render. stopProfilerTimerIfRunningAndRecordDelta(erroredWork, true); } if (enableSchedulingProfiler) { markComponentRenderStopped(); if (thrownValue !== null && typeof thrownValue === 'object' && typeof thrownValue.then === 'function') { var wakeable = thrownValue; markComponentSuspended(erroredWork, wakeable, workInProgressRootRenderLanes); } else { markComponentErrored(erroredWork, thrownValue, workInProgressRootRenderLanes); } } throwException(root, erroredWork.return, erroredWork, thrownValue, workInProgressRootRenderLanes); completeUnitOfWork(erroredWork); } catch (yetAnotherThrownValue) { // Something in the return path also threw. thrownValue = yetAnotherThrownValue; if (workInProgress === erroredWork && erroredWork !== null) { // If this boundary has already errored, then we had trouble processing // the error. Bubble it to the next boundary. erroredWork = erroredWork.return; workInProgress = erroredWork; } else { erroredWork = workInProgress; } continue; } // Return to the normal work loop. return; } while (true); } function pushDispatcher() { var prevDispatcher = ReactCurrentDispatcher$2.current; ReactCurrentDispatcher$2.current = ContextOnlyDispatcher; if (prevDispatcher === null) { // The React isomorphic package does not include a default dispatcher. // Instead the first renderer will lazily attach one, in order to give // nicer error messages. return ContextOnlyDispatcher; } else { return prevDispatcher; } } function popDispatcher(prevDispatcher) { ReactCurrentDispatcher$2.current = prevDispatcher; } function markCommitTimeOfFallback() { globalMostRecentFallbackTime = now(); } function markSkippedUpdateLanes(lane) { workInProgressRootSkippedLanes = mergeLanes(lane, workInProgressRootSkippedLanes); } function renderDidSuspend() { if (workInProgressRootExitStatus === RootInProgress) { workInProgressRootExitStatus = RootSuspended; } } function renderDidSuspendDelayIfPossible() { if (workInProgressRootExitStatus === RootInProgress || workInProgressRootExitStatus === RootSuspended || workInProgressRootExitStatus === RootErrored) { workInProgressRootExitStatus = RootSuspendedWithDelay; } // Check if there are updates that we skipped tree that might have unblocked // this render. if (workInProgressRoot !== null && (includesNonIdleWork(workInProgressRootSkippedLanes) || includesNonIdleWork(workInProgressRootInterleavedUpdatedLanes))) { // Mark the current render as suspended so that we switch to working on // the updates that were skipped. Usually we only suspend at the end of // the render phase. // TODO: We should probably always mark the root as suspended immediately // (inside this function), since by suspending at the end of the render // phase introduces a potential mistake where we suspend lanes that were // pinged or updated while we were rendering. markRootSuspended$1(workInProgressRoot, workInProgressRootRenderLanes); } } function renderDidError(error) { if (workInProgressRootExitStatus !== RootSuspendedWithDelay) { workInProgressRootExitStatus = RootErrored; } if (workInProgressRootConcurrentErrors === null) { workInProgressRootConcurrentErrors = [error]; } else { workInProgressRootConcurrentErrors.push(error); } } // Called during render to determine if anything has suspended. // Returns false if we're not sure. function renderHasNotSuspendedYet() { // If something errored or completed, we can't really be sure, // so those are false. return workInProgressRootExitStatus === RootInProgress; } function renderRootSync(root, lanes) { var prevExecutionContext = executionContext; executionContext |= RenderContext; var prevDispatcher = pushDispatcher(); // If the root or lanes have changed, throw out the existing stack // and prepare a fresh one. Otherwise we'll continue where we left off. if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes) { { if (isDevToolsPresent) { var memoizedUpdaters = root.memoizedUpdaters; if (memoizedUpdaters.size > 0) { restorePendingUpdaters(root, workInProgressRootRenderLanes); memoizedUpdaters.clear(); } // At this point, move Fibers that scheduled the upcoming work from the Map to the Set. // If we bailout on this work, we'll move them back (like above). // It's important to move them now in case the work spawns more work at the same priority with different updaters. // That way we can keep the current update and future updates separate. movePendingFibersToMemoized(root, lanes); } } workInProgressTransitions = getTransitionsForLanes(); prepareFreshStack(root, lanes); } { markRenderStarted(lanes); } do { try { workLoopSync(); break; } catch (thrownValue) { handleError(root, thrownValue); } } while (true); resetContextDependencies(); executionContext = prevExecutionContext; popDispatcher(prevDispatcher); if (workInProgress !== null) { // This is a sync render, so we should have finished the whole tree. throw new Error('Cannot commit an incomplete root. This error is likely caused by a ' + 'bug in React. Please file an issue.'); } { markRenderStopped(); } // Set this to null to indicate there's no in-progress render. workInProgressRoot = null; workInProgressRootRenderLanes = NoLanes; return workInProgressRootExitStatus; } // The work loop is an extremely hot path. Tell Closure not to inline it. /** @noinline */ function workLoopSync() { // Already timed out, so perform work without checking if we need to yield. while (workInProgress !== null) { performUnitOfWork(workInProgress); } } function renderRootConcurrent(root, lanes) { var prevExecutionContext = executionContext; executionContext |= RenderContext; var prevDispatcher = pushDispatcher(); // If the root or lanes have changed, throw out the existing stack // and prepare a fresh one. Otherwise we'll continue where we left off. if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes) { { if (isDevToolsPresent) { var memoizedUpdaters = root.memoizedUpdaters; if (memoizedUpdaters.size > 0) { restorePendingUpdaters(root, workInProgressRootRenderLanes); memoizedUpdaters.clear(); } // At this point, move Fibers that scheduled the upcoming work from the Map to the Set. // If we bailout on this work, we'll move them back (like above). // It's important to move them now in case the work spawns more work at the same priority with different updaters. // That way we can keep the current update and future updates separate. movePendingFibersToMemoized(root, lanes); } } workInProgressTransitions = getTransitionsForLanes(); resetRenderTimer(); prepareFreshStack(root, lanes); } { markRenderStarted(lanes); } do { try { workLoopConcurrent(); break; } catch (thrownValue) { handleError(root, thrownValue); } } while (true); resetContextDependencies(); popDispatcher(prevDispatcher); executionContext = prevExecutionContext; if (workInProgress !== null) { // Still work remaining. { markRenderYielded(); } return RootInProgress; } else { // Completed the tree. { markRenderStopped(); } // Set this to null to indicate there's no in-progress render. workInProgressRoot = null; workInProgressRootRenderLanes = NoLanes; // Return the final exit status. return workInProgressRootExitStatus; } } /** @noinline */ function workLoopConcurrent() { // Perform work until Scheduler asks us to yield while (workInProgress !== null && !shouldYield()) { performUnitOfWork(workInProgress); } } function performUnitOfWork(unitOfWork) { // The current, flushed, state of this fiber is the alternate. Ideally // nothing should rely on this, but relying on it here means that we don't // need an additional field on the work in progress. var current = unitOfWork.alternate; setCurrentFiber(unitOfWork); var next; if ( (unitOfWork.mode & ProfileMode) !== NoMode) { startProfilerTimer(unitOfWork); next = beginWork$1(current, unitOfWork, subtreeRenderLanes); stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, true); } else { next = beginWork$1(current, unitOfWork, subtreeRenderLanes); } resetCurrentFiber(); unitOfWork.memoizedProps = unitOfWork.pendingProps; if (next === null) { // If this doesn't spawn new work, complete the current work. completeUnitOfWork(unitOfWork); } else { workInProgress = next; } ReactCurrentOwner$2.current = null; } function completeUnitOfWork(unitOfWork) { // Attempt to complete the current unit of work, then move to the next // sibling. If there are no more siblings, return to the parent fiber. var completedWork = unitOfWork; do { // The current, flushed, state of this fiber is the alternate. Ideally // nothing should rely on this, but relying on it here means that we don't // need an additional field on the work in progress. var current = completedWork.alternate; var returnFiber = completedWork.return; // Check if the work completed or if something threw. if ((completedWork.flags & Incomplete) === NoFlags) { setCurrentFiber(completedWork); var next = void 0; if ( (completedWork.mode & ProfileMode) === NoMode) { next = completeWork(current, completedWork, subtreeRenderLanes); } else { startProfilerTimer(completedWork); next = completeWork(current, completedWork, subtreeRenderLanes); // Update render duration assuming we didn't error. stopProfilerTimerIfRunningAndRecordDelta(completedWork, false); } resetCurrentFiber(); if (next !== null) { // Completing this fiber spawned new work. Work on that next. workInProgress = next; return; } } else { // This fiber did not complete because something threw. Pop values off // the stack without entering the complete phase. If this is a boundary, // capture values if possible. var _next = unwindWork(current, completedWork); // Because this fiber did not complete, don't reset its lanes. if (_next !== null) { // If completing this work spawned new work, do that next. We'll come // back here again. // Since we're restarting, remove anything that is not a host effect // from the effect tag. _next.flags &= HostEffectMask; workInProgress = _next; return; } if ( (completedWork.mode & ProfileMode) !== NoMode) { // Record the render duration for the fiber that errored. stopProfilerTimerIfRunningAndRecordDelta(completedWork, false); // Include the time spent working on failed children before continuing. var actualDuration = completedWork.actualDuration; var child = completedWork.child; while (child !== null) { actualDuration += child.actualDuration; child = child.sibling; } completedWork.actualDuration = actualDuration; } if (returnFiber !== null) { // Mark the parent fiber as incomplete and clear its subtree flags. returnFiber.flags |= Incomplete; returnFiber.subtreeFlags = NoFlags; returnFiber.deletions = null; } else { // We've unwound all the way to the root. workInProgressRootExitStatus = RootDidNotComplete; workInProgress = null; return; } } var siblingFiber = completedWork.sibling; if (siblingFiber !== null) { // If there is more work to do in this returnFiber, do that next. workInProgress = siblingFiber; return; } // Otherwise, return to the parent completedWork = returnFiber; // Update the next thing we're working on in case something throws. workInProgress = completedWork; } while (completedWork !== null); // We've reached the root. if (workInProgressRootExitStatus === RootInProgress) { workInProgressRootExitStatus = RootCompleted; } } function commitRoot(root, recoverableErrors, transitions) { // TODO: This no longer makes any sense. We already wrap the mutation and // layout phases. Should be able to remove. var previousUpdateLanePriority = getCurrentUpdatePriority(); var prevTransition = ReactCurrentBatchConfig$3.transition; try { ReactCurrentBatchConfig$3.transition = null; setCurrentUpdatePriority(DiscreteEventPriority); commitRootImpl(root, recoverableErrors, transitions, previousUpdateLanePriority); } finally { ReactCurrentBatchConfig$3.transition = prevTransition; setCurrentUpdatePriority(previousUpdateLanePriority); } return null; } function commitRootImpl(root, recoverableErrors, transitions, renderPriorityLevel) { do { // `flushPassiveEffects` will call `flushSyncUpdateQueue` at the end, which // means `flushPassiveEffects` will sometimes result in additional // passive effects. So we need to keep flushing in a loop until there are // no more pending effects. // TODO: Might be better if `flushPassiveEffects` did not automatically // flush synchronous work at the end, to avoid factoring hazards like this. flushPassiveEffects(); } while (rootWithPendingPassiveEffects !== null); flushRenderPhaseStrictModeWarningsInDEV(); if ((executionContext & (RenderContext | CommitContext)) !== NoContext) { throw new Error('Should not already be working.'); } var finishedWork = root.finishedWork; var lanes = root.finishedLanes; { markCommitStarted(lanes); } if (finishedWork === null) { { markCommitStopped(); } return null; } else { { if (lanes === NoLanes) { error('root.finishedLanes should not be empty during a commit. This is a ' + 'bug in React.'); } } } root.finishedWork = null; root.finishedLanes = NoLanes; if (finishedWork === root.current) { throw new Error('Cannot commit the same tree as before. This error is likely caused by ' + 'a bug in React. Please file an issue.'); } // commitRoot never returns a continuation; it always finishes synchronously. // So we can clear these now to allow a new callback to be scheduled. root.callbackNode = null; root.callbackPriority = NoLane; // Update the first and last pending times on this root. The new first // pending time is whatever is left on the root fiber. var remainingLanes = mergeLanes(finishedWork.lanes, finishedWork.childLanes); markRootFinished(root, remainingLanes); if (root === workInProgressRoot) { // We can reset these now that they are finished. workInProgressRoot = null; workInProgress = null; workInProgressRootRenderLanes = NoLanes; } // If there are pending passive effects, schedule a callback to process them. // Do this as early as possible, so it is queued before anything else that // might get scheduled in the commit phase. (See #16714.) // TODO: Delete all other places that schedule the passive effect callback // They're redundant. if ((finishedWork.subtreeFlags & PassiveMask) !== NoFlags || (finishedWork.flags & PassiveMask) !== NoFlags) { if (!rootDoesHavePassiveEffects) { rootDoesHavePassiveEffects = true; // to store it in pendingPassiveTransitions until they get processed // We need to pass this through as an argument to commitRoot // because workInProgressTransitions might have changed between // the previous render and commit if we throttle the commit // with setTimeout pendingPassiveTransitions = transitions; scheduleCallback$1(NormalPriority, function () { flushPassiveEffects(); // This render triggered passive effects: release the root cache pool // *after* passive effects fire to avoid freeing a cache pool that may // be referenced by a node in the tree (HostRoot, Cache boundary etc) return null; }); } } // Check if there are any effects in the whole tree. // TODO: This is left over from the effect list implementation, where we had // to check for the existence of `firstEffect` to satisfy Flow. I think the // only other reason this optimization exists is because it affects profiling. // Reconsider whether this is necessary. var subtreeHasEffects = (finishedWork.subtreeFlags & (BeforeMutationMask | MutationMask | LayoutMask | PassiveMask)) !== NoFlags; var rootHasEffect = (finishedWork.flags & (BeforeMutationMask | MutationMask | LayoutMask | PassiveMask)) !== NoFlags; if (subtreeHasEffects || rootHasEffect) { var prevTransition = ReactCurrentBatchConfig$3.transition; ReactCurrentBatchConfig$3.transition = null; var previousPriority = getCurrentUpdatePriority(); setCurrentUpdatePriority(DiscreteEventPriority); var prevExecutionContext = executionContext; executionContext |= CommitContext; // Reset this to null before calling lifecycles ReactCurrentOwner$2.current = null; // The commit phase is broken into several sub-phases. We do a separate pass // of the effect list for each phase: all mutation effects come before all // layout effects, and so on. // The first phase a "before mutation" phase. We use this phase to read the // state of the host tree right before we mutate it. This is where // getSnapshotBeforeUpdate is called. var shouldFireAfterActiveInstanceBlur = commitBeforeMutationEffects(root, finishedWork); { // Mark the current commit time to be shared by all Profilers in this // batch. This enables them to be grouped later. recordCommitTime(); } commitMutationEffects(root, finishedWork, lanes); resetAfterCommit(root.containerInfo); // The work-in-progress tree is now the current tree. This must come after // the mutation phase, so that the previous tree is still current during // componentWillUnmount, but before the layout phase, so that the finished // work is current during componentDidMount/Update. root.current = finishedWork; // The next phase is the layout phase, where we call effects that read { markLayoutEffectsStarted(lanes); } commitLayoutEffects(finishedWork, root, lanes); { markLayoutEffectsStopped(); } // opportunity to paint. requestPaint(); executionContext = prevExecutionContext; // Reset the priority to the previous non-sync value. setCurrentUpdatePriority(previousPriority); ReactCurrentBatchConfig$3.transition = prevTransition; } else { // No effects. root.current = finishedWork; // Measure these anyway so the flamegraph explicitly shows that there were // no effects. // TODO: Maybe there's a better way to report this. { recordCommitTime(); } } var rootDidHavePassiveEffects = rootDoesHavePassiveEffects; if (rootDoesHavePassiveEffects) { // This commit has passive effects. Stash a reference to them. But don't // schedule a callback until after flushing layout work. rootDoesHavePassiveEffects = false; rootWithPendingPassiveEffects = root; pendingPassiveEffectsLanes = lanes; } else { { nestedPassiveUpdateCount = 0; rootWithPassiveNestedUpdates = null; } } // Read this again, since an effect might have updated it remainingLanes = root.pendingLanes; // Check if there's remaining work on this root // TODO: This is part of the `componentDidCatch` implementation. Its purpose // is to detect whether something might have called setState inside // `componentDidCatch`. The mechanism is known to be flawed because `setState` // inside `componentDidCatch` is itself flawed — that's why we recommend // `getDerivedStateFromError` instead. However, it could be improved by // checking if remainingLanes includes Sync work, instead of whether there's // any work remaining at all (which would also include stuff like Suspense // retries or transitions). It's been like this for a while, though, so fixing // it probably isn't that urgent. if (remainingLanes === NoLanes) { // If there's no remaining work, we can clear the set of already failed // error boundaries. legacyErrorBoundariesThatAlreadyFailed = null; } { if (!rootDidHavePassiveEffects) { commitDoubleInvokeEffectsInDEV(root.current, false); } } onCommitRoot(finishedWork.stateNode, renderPriorityLevel); { if (isDevToolsPresent) { root.memoizedUpdaters.clear(); } } { onCommitRoot$1(); } // Always call this before exiting `commitRoot`, to ensure that any // additional work on this root is scheduled. ensureRootIsScheduled(root, now()); if (recoverableErrors !== null) { // There were errors during this render, but recovered from them without // needing to surface it to the UI. We log them here. var onRecoverableError = root.onRecoverableError; for (var i = 0; i < recoverableErrors.length; i++) { var recoverableError = recoverableErrors[i]; var componentStack = recoverableError.stack; var digest = recoverableError.digest; onRecoverableError(recoverableError.value, { componentStack: componentStack, digest: digest }); } } if (hasUncaughtError) { hasUncaughtError = false; var error$1 = firstUncaughtError; firstUncaughtError = null; throw error$1; } // If the passive effects are the result of a discrete render, flush them // synchronously at the end of the current task so that the result is // immediately observable. Otherwise, we assume that they are not // order-dependent and do not need to be observed by external systems, so we // can wait until after paint. // TODO: We can optimize this by not scheduling the callback earlier. Since we // currently schedule the callback in multiple places, will wait until those // are consolidated. if (includesSomeLane(pendingPassiveEffectsLanes, SyncLane) && root.tag !== LegacyRoot) { flushPassiveEffects(); } // Read this again, since a passive effect might have updated it remainingLanes = root.pendingLanes; if (includesSomeLane(remainingLanes, SyncLane)) { { markNestedUpdateScheduled(); } // Count the number of times the root synchronously re-renders without // finishing. If there are too many, it indicates an infinite update loop. if (root === rootWithNestedUpdates) { nestedUpdateCount++; } else { nestedUpdateCount = 0; rootWithNestedUpdates = root; } } else { nestedUpdateCount = 0; } // If layout work was scheduled, flush it now. flushSyncCallbacks(); { markCommitStopped(); } return null; } function flushPassiveEffects() { // Returns whether passive effects were flushed. // TODO: Combine this check with the one in flushPassiveEFfectsImpl. We should // probably just combine the two functions. I believe they were only separate // in the first place because we used to wrap it with // `Scheduler.runWithPriority`, which accepts a function. But now we track the // priority within React itself, so we can mutate the variable directly. if (rootWithPendingPassiveEffects !== null) { var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes); var priority = lowerEventPriority(DefaultEventPriority, renderPriority); var prevTransition = ReactCurrentBatchConfig$3.transition; var previousPriority = getCurrentUpdatePriority(); try { ReactCurrentBatchConfig$3.transition = null; setCurrentUpdatePriority(priority); return flushPassiveEffectsImpl(); } finally { setCurrentUpdatePriority(previousPriority); ReactCurrentBatchConfig$3.transition = prevTransition; // Once passive effects have run for the tree - giving components a } } return false; } function enqueuePendingPassiveProfilerEffect(fiber) { { pendingPassiveProfilerEffects.push(fiber); if (!rootDoesHavePassiveEffects) { rootDoesHavePassiveEffects = true; scheduleCallback$1(NormalPriority, function () { flushPassiveEffects(); return null; }); } } } function flushPassiveEffectsImpl() { if (rootWithPendingPassiveEffects === null) { return false; } // Cache and clear the transitions flag var transitions = pendingPassiveTransitions; pendingPassiveTransitions = null; var root = rootWithPendingPassiveEffects; var lanes = pendingPassiveEffectsLanes; rootWithPendingPassiveEffects = null; // TODO: This is sometimes out of sync with rootWithPendingPassiveEffects. // Figure out why and fix it. It's not causing any known issues (probably // because it's only used for profiling), but it's a refactor hazard. pendingPassiveEffectsLanes = NoLanes; if ((executionContext & (RenderContext | CommitContext)) !== NoContext) { throw new Error('Cannot flush passive effects while already rendering.'); } { isFlushingPassiveEffects = true; didScheduleUpdateDuringPassiveEffects = false; } { markPassiveEffectsStarted(lanes); } var prevExecutionContext = executionContext; executionContext |= CommitContext; commitPassiveUnmountEffects(root.current); commitPassiveMountEffects(root, root.current, lanes, transitions); // TODO: Move to commitPassiveMountEffects { var profilerEffects = pendingPassiveProfilerEffects; pendingPassiveProfilerEffects = []; for (var i = 0; i < profilerEffects.length; i++) { var _fiber = profilerEffects[i]; commitPassiveEffectDurations(root, _fiber); } } { markPassiveEffectsStopped(); } { commitDoubleInvokeEffectsInDEV(root.current, true); } executionContext = prevExecutionContext; flushSyncCallbacks(); { // If additional passive effects were scheduled, increment a counter. If this // exceeds the limit, we'll fire a warning. if (didScheduleUpdateDuringPassiveEffects) { if (root === rootWithPassiveNestedUpdates) { nestedPassiveUpdateCount++; } else { nestedPassiveUpdateCount = 0; rootWithPassiveNestedUpdates = root; } } else { nestedPassiveUpdateCount = 0; } isFlushingPassiveEffects = false; didScheduleUpdateDuringPassiveEffects = false; } // TODO: Move to commitPassiveMountEffects onPostCommitRoot(root); { var stateNode = root.current.stateNode; stateNode.effectDuration = 0; stateNode.passiveEffectDuration = 0; } return true; } function isAlreadyFailedLegacyErrorBoundary(instance) { return legacyErrorBoundariesThatAlreadyFailed !== null && legacyErrorBoundariesThatAlreadyFailed.has(instance); } function markLegacyErrorBoundaryAsFailed(instance) { if (legacyErrorBoundariesThatAlreadyFailed === null) { legacyErrorBoundariesThatAlreadyFailed = new Set([instance]); } else { legacyErrorBoundariesThatAlreadyFailed.add(instance); } } function prepareToThrowUncaughtError(error) { if (!hasUncaughtError) { hasUncaughtError = true; firstUncaughtError = error; } } var onUncaughtError = prepareToThrowUncaughtError; function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) { var errorInfo = createCapturedValueAtFiber(error, sourceFiber); var update = createRootErrorUpdate(rootFiber, errorInfo, SyncLane); var root = enqueueUpdate(rootFiber, update, SyncLane); var eventTime = requestEventTime(); if (root !== null) { markRootUpdated(root, SyncLane, eventTime); ensureRootIsScheduled(root, eventTime); } } function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error$1) { { reportUncaughtErrorInDEV(error$1); setIsRunningInsertionEffect(false); } if (sourceFiber.tag === HostRoot) { // Error was thrown at the root. There is no parent, so the root // itself should capture it. captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error$1); return; } var fiber = null; { fiber = nearestMountedAncestor; } while (fiber !== null) { if (fiber.tag === HostRoot) { captureCommitPhaseErrorOnRoot(fiber, sourceFiber, error$1); return; } else if (fiber.tag === ClassComponent) { var ctor = fiber.type; var instance = fiber.stateNode; if (typeof ctor.getDerivedStateFromError === 'function' || typeof instance.componentDidCatch === 'function' && !isAlreadyFailedLegacyErrorBoundary(instance)) { var errorInfo = createCapturedValueAtFiber(error$1, sourceFiber); var update = createClassErrorUpdate(fiber, errorInfo, SyncLane); var root = enqueueUpdate(fiber, update, SyncLane); var eventTime = requestEventTime(); if (root !== null) { markRootUpdated(root, SyncLane, eventTime); ensureRootIsScheduled(root, eventTime); } return; } } fiber = fiber.return; } { // TODO: Until we re-land skipUnmountedBoundaries (see #20147), this warning // will fire for errors that are thrown by destroy functions inside deleted // trees. What it should instead do is propagate the error to the parent of // the deleted tree. In the meantime, do not add this warning to the // allowlist; this is only for our internal use. error('Internal React error: Attempted to capture a commit phase error ' + 'inside a detached tree. This indicates a bug in React. Likely ' + 'causes include deleting the same fiber more than once, committing an ' + 'already-finished tree, or an inconsistent return pointer.\n\n' + 'Error message:\n\n%s', error$1); } } function pingSuspendedRoot(root, wakeable, pingedLanes) { var pingCache = root.pingCache; if (pingCache !== null) { // The wakeable resolved, so we no longer need to memoize, because it will // never be thrown again. pingCache.delete(wakeable); } var eventTime = requestEventTime(); markRootPinged(root, pingedLanes); warnIfSuspenseResolutionNotWrappedWithActDEV(root); if (workInProgressRoot === root && isSubsetOfLanes(workInProgressRootRenderLanes, pingedLanes)) { // Received a ping at the same priority level at which we're currently // rendering. We might want to restart this render. This should mirror // the logic of whether or not a root suspends once it completes. // TODO: If we're rendering sync either due to Sync, Batched or expired, // we should probably never restart. // If we're suspended with delay, or if it's a retry, we'll always suspend // so we can always restart. if (workInProgressRootExitStatus === RootSuspendedWithDelay || workInProgressRootExitStatus === RootSuspended && includesOnlyRetries(workInProgressRootRenderLanes) && now() - globalMostRecentFallbackTime < FALLBACK_THROTTLE_MS) { // Restart from the root. prepareFreshStack(root, NoLanes); } else { // Even though we can't restart right now, we might get an // opportunity later. So we mark this render as having a ping. workInProgressRootPingedLanes = mergeLanes(workInProgressRootPingedLanes, pingedLanes); } } ensureRootIsScheduled(root, eventTime); } function retryTimedOutBoundary(boundaryFiber, retryLane) { // The boundary fiber (a Suspense component or SuspenseList component) // previously was rendered in its fallback state. One of the promises that // suspended it has resolved, which means at least part of the tree was // likely unblocked. Try rendering again, at a new lanes. if (retryLane === NoLane) { // TODO: Assign this to `suspenseState.retryLane`? to avoid // unnecessary entanglement? retryLane = requestRetryLane(boundaryFiber); } // TODO: Special case idle priority? var eventTime = requestEventTime(); var root = enqueueConcurrentRenderForLane(boundaryFiber, retryLane); if (root !== null) { markRootUpdated(root, retryLane, eventTime); ensureRootIsScheduled(root, eventTime); } } function retryDehydratedSuspenseBoundary(boundaryFiber) { var suspenseState = boundaryFiber.memoizedState; var retryLane = NoLane; if (suspenseState !== null) { retryLane = suspenseState.retryLane; } retryTimedOutBoundary(boundaryFiber, retryLane); } function resolveRetryWakeable(boundaryFiber, wakeable) { var retryLane = NoLane; // Default var retryCache; switch (boundaryFiber.tag) { case SuspenseComponent: retryCache = boundaryFiber.stateNode; var suspenseState = boundaryFiber.memoizedState; if (suspenseState !== null) { retryLane = suspenseState.retryLane; } break; case SuspenseListComponent: retryCache = boundaryFiber.stateNode; break; default: throw new Error('Pinged unknown suspense boundary type. ' + 'This is probably a bug in React.'); } if (retryCache !== null) { // The wakeable resolved, so we no longer need to memoize, because it will // never be thrown again. retryCache.delete(wakeable); } retryTimedOutBoundary(boundaryFiber, retryLane); } // Computes the next Just Noticeable Difference (JND) boundary. // The theory is that a person can't tell the difference between small differences in time. // Therefore, if we wait a bit longer than necessary that won't translate to a noticeable // difference in the experience. However, waiting for longer might mean that we can avoid // showing an intermediate loading state. The longer we have already waited, the harder it // is to tell small differences in time. Therefore, the longer we've already waited, // the longer we can wait additionally. At some point we have to give up though. // We pick a train model where the next boundary commits at a consistent schedule. // These particular numbers are vague estimates. We expect to adjust them based on research. function jnd(timeElapsed) { return timeElapsed < 120 ? 120 : timeElapsed < 480 ? 480 : timeElapsed < 1080 ? 1080 : timeElapsed < 1920 ? 1920 : timeElapsed < 3000 ? 3000 : timeElapsed < 4320 ? 4320 : ceil(timeElapsed / 1960) * 1960; } function checkForNestedUpdates() { if (nestedUpdateCount > NESTED_UPDATE_LIMIT) { nestedUpdateCount = 0; rootWithNestedUpdates = null; throw new Error('Maximum update depth exceeded. This can happen when a component ' + 'repeatedly calls setState inside componentWillUpdate or ' + 'componentDidUpdate. React limits the number of nested updates to ' + 'prevent infinite loops.'); } { if (nestedPassiveUpdateCount > NESTED_PASSIVE_UPDATE_LIMIT) { nestedPassiveUpdateCount = 0; rootWithPassiveNestedUpdates = null; error('Maximum update depth exceeded. This can happen when a component ' + "calls setState inside useEffect, but useEffect either doesn't " + 'have a dependency array, or one of the dependencies changes on ' + 'every render.'); } } } function flushRenderPhaseStrictModeWarningsInDEV() { { ReactStrictModeWarnings.flushLegacyContextWarning(); { ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings(); } } } function commitDoubleInvokeEffectsInDEV(fiber, hasPassiveEffects) { { // TODO (StrictEffects) Should we set a marker on the root if it contains strict effects // so we don't traverse unnecessarily? similar to subtreeFlags but just at the root level. // Maybe not a big deal since this is DEV only behavior. setCurrentFiber(fiber); invokeEffectsInDev(fiber, MountLayoutDev, invokeLayoutEffectUnmountInDEV); if (hasPassiveEffects) { invokeEffectsInDev(fiber, MountPassiveDev, invokePassiveEffectUnmountInDEV); } invokeEffectsInDev(fiber, MountLayoutDev, invokeLayoutEffectMountInDEV); if (hasPassiveEffects) { invokeEffectsInDev(fiber, MountPassiveDev, invokePassiveEffectMountInDEV); } resetCurrentFiber(); } } function invokeEffectsInDev(firstChild, fiberFlags, invokeEffectFn) { { // We don't need to re-check StrictEffectsMode here. // This function is only called if that check has already passed. var current = firstChild; var subtreeRoot = null; while (current !== null) { var primarySubtreeFlag = current.subtreeFlags & fiberFlags; if (current !== subtreeRoot && current.child !== null && primarySubtreeFlag !== NoFlags) { current = current.child; } else { if ((current.flags & fiberFlags) !== NoFlags) { invokeEffectFn(current); } if (current.sibling !== null) { current = current.sibling; } else { current = subtreeRoot = current.return; } } } } } var didWarnStateUpdateForNotYetMountedComponent = null; function warnAboutUpdateOnNotYetMountedFiberInDEV(fiber) { { if ((executionContext & RenderContext) !== NoContext) { // We let the other warning about render phase updates deal with this one. return; } if (!(fiber.mode & ConcurrentMode)) { return; } var tag = fiber.tag; if (tag !== IndeterminateComponent && tag !== HostRoot && tag !== ClassComponent && tag !== FunctionComponent && tag !== ForwardRef && tag !== MemoComponent && tag !== SimpleMemoComponent) { // Only warn for user-defined components, not internal ones like Suspense. return; } // We show the whole stack but dedupe on the top component's name because // the problematic code almost always lies inside that component. var componentName = getComponentNameFromFiber(fiber) || 'ReactComponent'; if (didWarnStateUpdateForNotYetMountedComponent !== null) { if (didWarnStateUpdateForNotYetMountedComponent.has(componentName)) { return; } didWarnStateUpdateForNotYetMountedComponent.add(componentName); } else { didWarnStateUpdateForNotYetMountedComponent = new Set([componentName]); } var previousFiber = current; try { setCurrentFiber(fiber); error("Can't perform a React state update on a component that hasn't mounted yet. " + 'This indicates that you have a side-effect in your render function that ' + 'asynchronously later calls tries to update the component. Move this work to ' + 'useEffect instead.'); } finally { if (previousFiber) { setCurrentFiber(fiber); } else { resetCurrentFiber(); } } } } var beginWork$1; { var dummyFiber = null; beginWork$1 = function (current, unitOfWork, lanes) { // If a component throws an error, we replay it again in a synchronously // dispatched event, so that the debugger will treat it as an uncaught // error See ReactErrorUtils for more information. // Before entering the begin phase, copy the work-in-progress onto a dummy // fiber. If beginWork throws, we'll use this to reset the state. var originalWorkInProgressCopy = assignFiberPropertiesInDEV(dummyFiber, unitOfWork); try { return beginWork(current, unitOfWork, lanes); } catch (originalError) { if (didSuspendOrErrorWhileHydratingDEV() || originalError !== null && typeof originalError === 'object' && typeof originalError.then === 'function') { // Don't replay promises. // Don't replay errors if we are hydrating and have already suspended or handled an error throw originalError; } // Keep this code in sync with handleError; any changes here must have // corresponding changes there. resetContextDependencies(); resetHooksAfterThrow(); // Don't reset current debug fiber, since we're about to work on the // same fiber again. // Unwind the failed stack frame unwindInterruptedWork(current, unitOfWork); // Restore the original properties of the fiber. assignFiberPropertiesInDEV(unitOfWork, originalWorkInProgressCopy); if ( unitOfWork.mode & ProfileMode) { // Reset the profiler timer. startProfilerTimer(unitOfWork); } // Run beginWork again. invokeGuardedCallback(null, beginWork, null, current, unitOfWork, lanes); if (hasCaughtError()) { var replayError = clearCaughtError(); if (typeof replayError === 'object' && replayError !== null && replayError._suppressLogging && typeof originalError === 'object' && originalError !== null && !originalError._suppressLogging) { // If suppressed, let the flag carry over to the original error which is the one we'll rethrow. originalError._suppressLogging = true; } } // We always throw the original error in case the second render pass is not idempotent. // This can happen if a memoized function or CommonJS module doesn't throw after first invocation. throw originalError; } }; } var didWarnAboutUpdateInRender = false; var didWarnAboutUpdateInRenderForAnotherComponent; { didWarnAboutUpdateInRenderForAnotherComponent = new Set(); } function warnAboutRenderPhaseUpdatesInDEV(fiber) { { if (isRendering && !getIsUpdatingOpaqueValueInRenderPhaseInDEV()) { switch (fiber.tag) { case FunctionComponent: case ForwardRef: case SimpleMemoComponent: { var renderingComponentName = workInProgress && getComponentNameFromFiber(workInProgress) || 'Unknown'; // Dedupe by the rendering component because it's the one that needs to be fixed. var dedupeKey = renderingComponentName; if (!didWarnAboutUpdateInRenderForAnotherComponent.has(dedupeKey)) { didWarnAboutUpdateInRenderForAnotherComponent.add(dedupeKey); var setStateComponentName = getComponentNameFromFiber(fiber) || 'Unknown'; error('Cannot update a component (`%s`) while rendering a ' + 'different component (`%s`). To locate the bad setState() call inside `%s`, ' + 'follow the stack trace as described in https://reactjs.org/link/setstate-in-render', setStateComponentName, renderingComponentName, renderingComponentName); } break; } case ClassComponent: { if (!didWarnAboutUpdateInRender) { error('Cannot update during an existing state transition (such as ' + 'within `render`). Render methods should be a pure ' + 'function of props and state.'); didWarnAboutUpdateInRender = true; } break; } } } } } function restorePendingUpdaters(root, lanes) { { if (isDevToolsPresent) { var memoizedUpdaters = root.memoizedUpdaters; memoizedUpdaters.forEach(function (schedulingFiber) { addFiberToLanesMap(root, schedulingFiber, lanes); }); // This function intentionally does not clear memoized updaters. // Those may still be relevant to the current commit // and a future one (e.g. Suspense). } } } var fakeActCallbackNode = {}; function scheduleCallback$1(priorityLevel, callback) { { // If we're currently inside an `act` scope, bypass Scheduler and push to // the `act` queue instead. var actQueue = ReactCurrentActQueue$1.current; if (actQueue !== null) { actQueue.push(callback); return fakeActCallbackNode; } else { return scheduleCallback(priorityLevel, callback); } } } function cancelCallback$1(callbackNode) { if ( callbackNode === fakeActCallbackNode) { return; } // In production, always call Scheduler. This function will be stripped out. return cancelCallback(callbackNode); } function shouldForceFlushFallbacksInDEV() { // Never force flush in production. This function should get stripped out. return ReactCurrentActQueue$1.current !== null; } function warnIfUpdatesNotWrappedWithActDEV(fiber) { { if (fiber.mode & ConcurrentMode) { if (!isConcurrentActEnvironment()) { // Not in an act environment. No need to warn. return; } } else { // Legacy mode has additional cases where we suppress a warning. if (!isLegacyActEnvironment()) { // Not in an act environment. No need to warn. return; } if (executionContext !== NoContext) { // Legacy mode doesn't warn if the update is batched, i.e. // batchedUpdates or flushSync. return; } if (fiber.tag !== FunctionComponent && fiber.tag !== ForwardRef && fiber.tag !== SimpleMemoComponent) { // For backwards compatibility with pre-hooks code, legacy mode only // warns for updates that originate from a hook. return; } } if (ReactCurrentActQueue$1.current === null) { var previousFiber = current; try { setCurrentFiber(fiber); error('An update to %s inside a test was not wrapped in act(...).\n\n' + 'When testing, code that causes React state updates should be ' + 'wrapped into act(...):\n\n' + 'act(() => {\n' + ' /* fire events that update state */\n' + '});\n' + '/* assert on the output */\n\n' + "This ensures that you're testing the behavior the user would see " + 'in the browser.' + ' Learn more at https://reactjs.org/link/wrap-tests-with-act', getComponentNameFromFiber(fiber)); } finally { if (previousFiber) { setCurrentFiber(fiber); } else { resetCurrentFiber(); } } } } } function warnIfSuspenseResolutionNotWrappedWithActDEV(root) { { if (root.tag !== LegacyRoot && isConcurrentActEnvironment() && ReactCurrentActQueue$1.current === null) { error('A suspended resource finished loading inside a test, but the event ' + 'was not wrapped in act(...).\n\n' + 'When testing, code that resolves suspended data should be wrapped ' + 'into act(...):\n\n' + 'act(() => {\n' + ' /* finish loading suspended data */\n' + '});\n' + '/* assert on the output */\n\n' + "This ensures that you're testing the behavior the user would see " + 'in the browser.' + ' Learn more at https://reactjs.org/link/wrap-tests-with-act'); } } } function setIsRunningInsertionEffect(isRunning) { { isRunningInsertionEffect = isRunning; } } /* eslint-disable react-internal/prod-error-codes */ var resolveFamily = null; // $FlowFixMe Flow gets confused by a WeakSet feature check below. var failedBoundaries = null; var setRefreshHandler = function (handler) { { resolveFamily = handler; } }; function resolveFunctionForHotReloading(type) { { if (resolveFamily === null) { // Hot reloading is disabled. return type; } var family = resolveFamily(type); if (family === undefined) { return type; } // Use the latest known implementation. return family.current; } } function resolveClassForHotReloading(type) { // No implementation differences. return resolveFunctionForHotReloading(type); } function resolveForwardRefForHotReloading(type) { { if (resolveFamily === null) { // Hot reloading is disabled. return type; } var family = resolveFamily(type); if (family === undefined) { // Check if we're dealing with a real forwardRef. Don't want to crash early. if (type !== null && type !== undefined && typeof type.render === 'function') { // ForwardRef is special because its resolved .type is an object, // but it's possible that we only have its inner render function in the map. // If that inner render function is different, we'll build a new forwardRef type. var currentRender = resolveFunctionForHotReloading(type.render); if (type.render !== currentRender) { var syntheticType = { $$typeof: REACT_FORWARD_REF_TYPE, render: currentRender }; if (type.displayName !== undefined) { syntheticType.displayName = type.displayName; } return syntheticType; } } return type; } // Use the latest known implementation. return family.current; } } function isCompatibleFamilyForHotReloading(fiber, element) { { if (resolveFamily === null) { // Hot reloading is disabled. return false; } var prevType = fiber.elementType; var nextType = element.type; // If we got here, we know types aren't === equal. var needsCompareFamilies = false; var $$typeofNextType = typeof nextType === 'object' && nextType !== null ? nextType.$$typeof : null; switch (fiber.tag) { case ClassComponent: { if (typeof nextType === 'function') { needsCompareFamilies = true; } break; } case FunctionComponent: { if (typeof nextType === 'function') { needsCompareFamilies = true; } else if ($$typeofNextType === REACT_LAZY_TYPE) { // We don't know the inner type yet. // We're going to assume that the lazy inner type is stable, // and so it is sufficient to avoid reconciling it away. // We're not going to unwrap or actually use the new lazy type. needsCompareFamilies = true; } break; } case ForwardRef: { if ($$typeofNextType === REACT_FORWARD_REF_TYPE) { needsCompareFamilies = true; } else if ($$typeofNextType === REACT_LAZY_TYPE) { needsCompareFamilies = true; } break; } case MemoComponent: case SimpleMemoComponent: { if ($$typeofNextType === REACT_MEMO_TYPE) { // TODO: if it was but can no longer be simple, // we shouldn't set this. needsCompareFamilies = true; } else if ($$typeofNextType === REACT_LAZY_TYPE) { needsCompareFamilies = true; } break; } default: return false; } // Check if both types have a family and it's the same one. if (needsCompareFamilies) { // Note: memo() and forwardRef() we'll compare outer rather than inner type. // This means both of them need to be registered to preserve state. // If we unwrapped and compared the inner types for wrappers instead, // then we would risk falsely saying two separate memo(Foo) // calls are equivalent because they wrap the same Foo function. var prevFamily = resolveFamily(prevType); if (prevFamily !== undefined && prevFamily === resolveFamily(nextType)) { return true; } } return false; } } function markFailedErrorBoundaryForHotReloading(fiber) { { if (resolveFamily === null) { // Hot reloading is disabled. return; } if (typeof WeakSet !== 'function') { return; } if (failedBoundaries === null) { failedBoundaries = new WeakSet(); } failedBoundaries.add(fiber); } } var scheduleRefresh = function (root, update) { { if (resolveFamily === null) { // Hot reloading is disabled. return; } var staleFamilies = update.staleFamilies, updatedFamilies = update.updatedFamilies; flushPassiveEffects(); flushSync(function () { scheduleFibersWithFamiliesRecursively(root.current, updatedFamilies, staleFamilies); }); } }; var scheduleRoot = function (root, element) { { if (root.context !== emptyContextObject) { // Super edge case: root has a legacy _renderSubtree context // but we don't know the parentComponent so we can't pass it. // Just ignore. We'll delete this with _renderSubtree code path later. return; } flushPassiveEffects(); flushSync(function () { updateContainer(element, root, null, null); }); } }; function scheduleFibersWithFamiliesRecursively(fiber, updatedFamilies, staleFamilies) { { var alternate = fiber.alternate, child = fiber.child, sibling = fiber.sibling, tag = fiber.tag, type = fiber.type; var candidateType = null; switch (tag) { case FunctionComponent: case SimpleMemoComponent: case ClassComponent: candidateType = type; break; case ForwardRef: candidateType = type.render; break; } if (resolveFamily === null) { throw new Error('Expected resolveFamily to be set during hot reload.'); } var needsRender = false; var needsRemount = false; if (candidateType !== null) { var family = resolveFamily(candidateType); if (family !== undefined) { if (staleFamilies.has(family)) { needsRemount = true; } else if (updatedFamilies.has(family)) { if (tag === ClassComponent) { needsRemount = true; } else { needsRender = true; } } } } if (failedBoundaries !== null) { if (failedBoundaries.has(fiber) || alternate !== null && failedBoundaries.has(alternate)) { needsRemount = true; } } if (needsRemount) { fiber._debugNeedsRemount = true; } if (needsRemount || needsRender) { var _root = enqueueConcurrentRenderForLane(fiber, SyncLane); if (_root !== null) { scheduleUpdateOnFiber(_root, fiber, SyncLane, NoTimestamp); } } if (child !== null && !needsRemount) { scheduleFibersWithFamiliesRecursively(child, updatedFamilies, staleFamilies); } if (sibling !== null) { scheduleFibersWithFamiliesRecursively(sibling, updatedFamilies, staleFamilies); } } } var findHostInstancesForRefresh = function (root, families) { { var hostInstances = new Set(); var types = new Set(families.map(function (family) { return family.current; })); findHostInstancesForMatchingFibersRecursively(root.current, types, hostInstances); return hostInstances; } }; function findHostInstancesForMatchingFibersRecursively(fiber, types, hostInstances) { { var child = fiber.child, sibling = fiber.sibling, tag = fiber.tag, type = fiber.type; var candidateType = null; switch (tag) { case FunctionComponent: case SimpleMemoComponent: case ClassComponent: candidateType = type; break; case ForwardRef: candidateType = type.render; break; } var didMatch = false; if (candidateType !== null) { if (types.has(candidateType)) { didMatch = true; } } if (didMatch) { // We have a match. This only drills down to the closest host components. // There's no need to search deeper because for the purpose of giving // visual feedback, "flashing" outermost parent rectangles is sufficient. findHostInstancesForFiberShallowly(fiber, hostInstances); } else { // If there's no match, maybe there will be one further down in the child tree. if (child !== null) { findHostInstancesForMatchingFibersRecursively(child, types, hostInstances); } } if (sibling !== null) { findHostInstancesForMatchingFibersRecursively(sibling, types, hostInstances); } } } function findHostInstancesForFiberShallowly(fiber, hostInstances) { { var foundHostInstances = findChildHostInstancesForFiberShallowly(fiber, hostInstances); if (foundHostInstances) { return; } // If we didn't find any host children, fallback to closest host parent. var node = fiber; while (true) { switch (node.tag) { case HostComponent: hostInstances.add(node.stateNode); return; case HostPortal: hostInstances.add(node.stateNode.containerInfo); return; case HostRoot: hostInstances.add(node.stateNode.containerInfo); return; } if (node.return === null) { throw new Error('Expected to reach root first.'); } node = node.return; } } } function findChildHostInstancesForFiberShallowly(fiber, hostInstances) { { var node = fiber; var foundHostInstances = false; while (true) { if (node.tag === HostComponent) { // We got a match. foundHostInstances = true; hostInstances.add(node.stateNode); // There may still be more, so keep searching. } else if (node.child !== null) { node.child.return = node; node = node.child; continue; } if (node === fiber) { return foundHostInstances; } while (node.sibling === null) { if (node.return === null || node.return === fiber) { return foundHostInstances; } node = node.return; } node.sibling.return = node.return; node = node.sibling; } } return false; } var hasBadMapPolyfill; { hasBadMapPolyfill = false; try { var nonExtensibleObject = Object.preventExtensions({}); /* eslint-disable no-new */ new Map([[nonExtensibleObject, null]]); new Set([nonExtensibleObject]); /* eslint-enable no-new */ } catch (e) { // TODO: Consider warning about bad polyfills hasBadMapPolyfill = true; } } function FiberNode(tag, pendingProps, key, mode) { // Instance this.tag = tag; this.key = key; this.elementType = null; this.type = null; this.stateNode = null; // Fiber this.return = null; this.child = null; this.sibling = null; this.index = 0; this.ref = null; this.pendingProps = pendingProps; this.memoizedProps = null; this.updateQueue = null; this.memoizedState = null; this.dependencies = null; this.mode = mode; // Effects this.flags = NoFlags; this.subtreeFlags = NoFlags; this.deletions = null; this.lanes = NoLanes; this.childLanes = NoLanes; this.alternate = null; { // Note: The following is done to avoid a v8 performance cliff. // // Initializing the fields below to smis and later updating them with // double values will cause Fibers to end up having separate shapes. // This behavior/bug has something to do with Object.preventExtension(). // Fortunately this only impacts DEV builds. // Unfortunately it makes React unusably slow for some applications. // To work around this, initialize the fields below with doubles. // // Learn more about this here: // https://github.com/facebook/react/issues/14365 // https://bugs.chromium.org/p/v8/issues/detail?id=8538 this.actualDuration = Number.NaN; this.actualStartTime = Number.NaN; this.selfBaseDuration = Number.NaN; this.treeBaseDuration = Number.NaN; // It's okay to replace the initial doubles with smis after initialization. // This won't trigger the performance cliff mentioned above, // and it simplifies other profiler code (including DevTools). this.actualDuration = 0; this.actualStartTime = -1; this.selfBaseDuration = 0; this.treeBaseDuration = 0; } { // This isn't directly used but is handy for debugging internals: this._debugSource = null; this._debugOwner = null; this._debugNeedsRemount = false; this._debugHookTypes = null; if (!hasBadMapPolyfill && typeof Object.preventExtensions === 'function') { Object.preventExtensions(this); } } } // This is a constructor function, rather than a POJO constructor, still // please ensure we do the following: // 1) Nobody should add any instance methods on this. Instance methods can be // more difficult to predict when they get optimized and they are almost // never inlined properly in static compilers. // 2) Nobody should rely on `instanceof Fiber` for type testing. We should // always know when it is a fiber. // 3) We might want to experiment with using numeric keys since they are easier // to optimize in a non-JIT environment. // 4) We can easily go from a constructor to a createFiber object literal if that // is faster. // 5) It should be easy to port this to a C struct and keep a C implementation // compatible. var createFiber = function (tag, pendingProps, key, mode) { // $FlowFixMe: the shapes are exact here but Flow doesn't like constructors return new FiberNode(tag, pendingProps, key, mode); }; function shouldConstruct$1(Component) { var prototype = Component.prototype; return !!(prototype && prototype.isReactComponent); } function isSimpleFunctionComponent(type) { return typeof type === 'function' && !shouldConstruct$1(type) && type.defaultProps === undefined; } function resolveLazyComponentTag(Component) { if (typeof Component === 'function') { return shouldConstruct$1(Component) ? ClassComponent : FunctionComponent; } else if (Component !== undefined && Component !== null) { var $$typeof = Component.$$typeof; if ($$typeof === REACT_FORWARD_REF_TYPE) { return ForwardRef; } if ($$typeof === REACT_MEMO_TYPE) { return MemoComponent; } } return IndeterminateComponent; } // This is used to create an alternate fiber to do work on. function createWorkInProgress(current, pendingProps) { var workInProgress = current.alternate; if (workInProgress === null) { // We use a double buffering pooling technique because we know that we'll // only ever need at most two versions of a tree. We pool the "other" unused // node that we're free to reuse. This is lazily created to avoid allocating // extra objects for things that are never updated. It also allow us to // reclaim the extra memory if needed. workInProgress = createFiber(current.tag, pendingProps, current.key, current.mode); workInProgress.elementType = current.elementType; workInProgress.type = current.type; workInProgress.stateNode = current.stateNode; { // DEV-only fields workInProgress._debugSource = current._debugSource; workInProgress._debugOwner = current._debugOwner; workInProgress._debugHookTypes = current._debugHookTypes; } workInProgress.alternate = current; current.alternate = workInProgress; } else { workInProgress.pendingProps = pendingProps; // Needed because Blocks store data on type. workInProgress.type = current.type; // We already have an alternate. // Reset the effect tag. workInProgress.flags = NoFlags; // The effects are no longer valid. workInProgress.subtreeFlags = NoFlags; workInProgress.deletions = null; { // We intentionally reset, rather than copy, actualDuration & actualStartTime. // This prevents time from endlessly accumulating in new commits. // This has the downside of resetting values for different priority renders, // But works for yielding (the common case) and should support resuming. workInProgress.actualDuration = 0; workInProgress.actualStartTime = -1; } } // Reset all effects except static ones. // Static effects are not specific to a render. workInProgress.flags = current.flags & StaticMask; workInProgress.childLanes = current.childLanes; workInProgress.lanes = current.lanes; workInProgress.child = current.child; workInProgress.memoizedProps = current.memoizedProps; workInProgress.memoizedState = current.memoizedState; workInProgress.updateQueue = current.updateQueue; // Clone the dependencies object. This is mutated during the render phase, so // it cannot be shared with the current fiber. var currentDependencies = current.dependencies; workInProgress.dependencies = currentDependencies === null ? null : { lanes: currentDependencies.lanes, firstContext: currentDependencies.firstContext }; // These will be overridden during the parent's reconciliation workInProgress.sibling = current.sibling; workInProgress.index = current.index; workInProgress.ref = current.ref; { workInProgress.selfBaseDuration = current.selfBaseDuration; workInProgress.treeBaseDuration = current.treeBaseDuration; } { workInProgress._debugNeedsRemount = current._debugNeedsRemount; switch (workInProgress.tag) { case IndeterminateComponent: case FunctionComponent: case SimpleMemoComponent: workInProgress.type = resolveFunctionForHotReloading(current.type); break; case ClassComponent: workInProgress.type = resolveClassForHotReloading(current.type); break; case ForwardRef: workInProgress.type = resolveForwardRefForHotReloading(current.type); break; } } return workInProgress; } // Used to reuse a Fiber for a second pass. function resetWorkInProgress(workInProgress, renderLanes) { // This resets the Fiber to what createFiber or createWorkInProgress would // have set the values to before during the first pass. Ideally this wouldn't // be necessary but unfortunately many code paths reads from the workInProgress // when they should be reading from current and writing to workInProgress. // We assume pendingProps, index, key, ref, return are still untouched to // avoid doing another reconciliation. // Reset the effect flags but keep any Placement tags, since that's something // that child fiber is setting, not the reconciliation. workInProgress.flags &= StaticMask | Placement; // The effects are no longer valid. var current = workInProgress.alternate; if (current === null) { // Reset to createFiber's initial values. workInProgress.childLanes = NoLanes; workInProgress.lanes = renderLanes; workInProgress.child = null; workInProgress.subtreeFlags = NoFlags; workInProgress.memoizedProps = null; workInProgress.memoizedState = null; workInProgress.updateQueue = null; workInProgress.dependencies = null; workInProgress.stateNode = null; { // Note: We don't reset the actualTime counts. It's useful to accumulate // actual time across multiple render passes. workInProgress.selfBaseDuration = 0; workInProgress.treeBaseDuration = 0; } } else { // Reset to the cloned values that createWorkInProgress would've. workInProgress.childLanes = current.childLanes; workInProgress.lanes = current.lanes; workInProgress.child = current.child; workInProgress.subtreeFlags = NoFlags; workInProgress.deletions = null; workInProgress.memoizedProps = current.memoizedProps; workInProgress.memoizedState = current.memoizedState; workInProgress.updateQueue = current.updateQueue; // Needed because Blocks store data on type. workInProgress.type = current.type; // Clone the dependencies object. This is mutated during the render phase, so // it cannot be shared with the current fiber. var currentDependencies = current.dependencies; workInProgress.dependencies = currentDependencies === null ? null : { lanes: currentDependencies.lanes, firstContext: currentDependencies.firstContext }; { // Note: We don't reset the actualTime counts. It's useful to accumulate // actual time across multiple render passes. workInProgress.selfBaseDuration = current.selfBaseDuration; workInProgress.treeBaseDuration = current.treeBaseDuration; } } return workInProgress; } function createHostRootFiber(tag, isStrictMode, concurrentUpdatesByDefaultOverride) { var mode; if (tag === ConcurrentRoot) { mode = ConcurrentMode; if (isStrictMode === true) { mode |= StrictLegacyMode; { mode |= StrictEffectsMode; } } } else { mode = NoMode; } if ( isDevToolsPresent) { // Always collect profile timings when DevTools are present. // This enables DevTools to start capturing timing at any point– // Without some nodes in the tree having empty base times. mode |= ProfileMode; } return createFiber(HostRoot, null, null, mode); } function createFiberFromTypeAndProps(type, // React$ElementType key, pendingProps, owner, mode, lanes) { var fiberTag = IndeterminateComponent; // The resolved type is set if we know what the final type will be. I.e. it's not lazy. var resolvedType = type; if (typeof type === 'function') { if (shouldConstruct$1(type)) { fiberTag = ClassComponent; { resolvedType = resolveClassForHotReloading(resolvedType); } } else { { resolvedType = resolveFunctionForHotReloading(resolvedType); } } } else if (typeof type === 'string') { fiberTag = HostComponent; } else { getTag: switch (type) { case REACT_FRAGMENT_TYPE: return createFiberFromFragment(pendingProps.children, mode, lanes, key); case REACT_STRICT_MODE_TYPE: fiberTag = Mode; mode |= StrictLegacyMode; if ( (mode & ConcurrentMode) !== NoMode) { // Strict effects should never run on legacy roots mode |= StrictEffectsMode; } break; case REACT_PROFILER_TYPE: return createFiberFromProfiler(pendingProps, mode, lanes, key); case REACT_SUSPENSE_TYPE: return createFiberFromSuspense(pendingProps, mode, lanes, key); case REACT_SUSPENSE_LIST_TYPE: return createFiberFromSuspenseList(pendingProps, mode, lanes, key); case REACT_OFFSCREEN_TYPE: return createFiberFromOffscreen(pendingProps, mode, lanes, key); case REACT_LEGACY_HIDDEN_TYPE: // eslint-disable-next-line no-fallthrough case REACT_SCOPE_TYPE: // eslint-disable-next-line no-fallthrough case REACT_CACHE_TYPE: // eslint-disable-next-line no-fallthrough case REACT_TRACING_MARKER_TYPE: // eslint-disable-next-line no-fallthrough case REACT_DEBUG_TRACING_MODE_TYPE: // eslint-disable-next-line no-fallthrough default: { if (typeof type === 'object' && type !== null) { switch (type.$$typeof) { case REACT_PROVIDER_TYPE: fiberTag = ContextProvider; break getTag; case REACT_CONTEXT_TYPE: // This is a consumer fiberTag = ContextConsumer; break getTag; case REACT_FORWARD_REF_TYPE: fiberTag = ForwardRef; { resolvedType = resolveForwardRefForHotReloading(resolvedType); } break getTag; case REACT_MEMO_TYPE: fiberTag = MemoComponent; break getTag; case REACT_LAZY_TYPE: fiberTag = LazyComponent; resolvedType = null; break getTag; } } var info = ''; { if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) { info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and " + 'named imports.'; } var ownerName = owner ? getComponentNameFromFiber(owner) : null; if (ownerName) { info += '\n\nCheck the render method of `' + ownerName + '`.'; } } throw new Error('Element type is invalid: expected a string (for built-in ' + 'components) or a class/function (for composite components) ' + ("but got: " + (type == null ? type : typeof type) + "." + info)); } } } var fiber = createFiber(fiberTag, pendingProps, key, mode); fiber.elementType = type; fiber.type = resolvedType; fiber.lanes = lanes; { fiber._debugOwner = owner; } return fiber; } function createFiberFromElement(element, mode, lanes) { var owner = null; { owner = element._owner; } var type = element.type; var key = element.key; var pendingProps = element.props; var fiber = createFiberFromTypeAndProps(type, key, pendingProps, owner, mode, lanes); { fiber._debugSource = element._source; fiber._debugOwner = element._owner; } return fiber; } function createFiberFromFragment(elements, mode, lanes, key) { var fiber = createFiber(Fragment, elements, key, mode); fiber.lanes = lanes; return fiber; } function createFiberFromProfiler(pendingProps, mode, lanes, key) { { if (typeof pendingProps.id !== 'string') { error('Profiler must specify an "id" of type `string` as a prop. Received the type `%s` instead.', typeof pendingProps.id); } } var fiber = createFiber(Profiler, pendingProps, key, mode | ProfileMode); fiber.elementType = REACT_PROFILER_TYPE; fiber.lanes = lanes; { fiber.stateNode = { effectDuration: 0, passiveEffectDuration: 0 }; } return fiber; } function createFiberFromSuspense(pendingProps, mode, lanes, key) { var fiber = createFiber(SuspenseComponent, pendingProps, key, mode); fiber.elementType = REACT_SUSPENSE_TYPE; fiber.lanes = lanes; return fiber; } function createFiberFromSuspenseList(pendingProps, mode, lanes, key) { var fiber = createFiber(SuspenseListComponent, pendingProps, key, mode); fiber.elementType = REACT_SUSPENSE_LIST_TYPE; fiber.lanes = lanes; return fiber; } function createFiberFromOffscreen(pendingProps, mode, lanes, key) { var fiber = createFiber(OffscreenComponent, pendingProps, key, mode); fiber.elementType = REACT_OFFSCREEN_TYPE; fiber.lanes = lanes; var primaryChildInstance = { isHidden: false }; fiber.stateNode = primaryChildInstance; return fiber; } function createFiberFromText(content, mode, lanes) { var fiber = createFiber(HostText, content, null, mode); fiber.lanes = lanes; return fiber; } function createFiberFromHostInstanceForDeletion() { var fiber = createFiber(HostComponent, null, null, NoMode); fiber.elementType = 'DELETED'; return fiber; } function createFiberFromDehydratedFragment(dehydratedNode) { var fiber = createFiber(DehydratedFragment, null, null, NoMode); fiber.stateNode = dehydratedNode; return fiber; } function createFiberFromPortal(portal, mode, lanes) { var pendingProps = portal.children !== null ? portal.children : []; var fiber = createFiber(HostPortal, pendingProps, portal.key, mode); fiber.lanes = lanes; fiber.stateNode = { containerInfo: portal.containerInfo, pendingChildren: null, // Used by persistent updates implementation: portal.implementation }; return fiber; } // Used for stashing WIP properties to replay failed work in DEV. function assignFiberPropertiesInDEV(target, source) { if (target === null) { // This Fiber's initial properties will always be overwritten. // We only use a Fiber to ensure the same hidden class so DEV isn't slow. target = createFiber(IndeterminateComponent, null, null, NoMode); } // This is intentionally written as a list of all properties. // We tried to use Object.assign() instead but this is called in // the hottest path, and Object.assign() was too slow: // https://github.com/facebook/react/issues/12502 // This code is DEV-only so size is not a concern. target.tag = source.tag; target.key = source.key; target.elementType = source.elementType; target.type = source.type; target.stateNode = source.stateNode; target.return = source.return; target.child = source.child; target.sibling = source.sibling; target.index = source.index; target.ref = source.ref; target.pendingProps = source.pendingProps; target.memoizedProps = source.memoizedProps; target.updateQueue = source.updateQueue; target.memoizedState = source.memoizedState; target.dependencies = source.dependencies; target.mode = source.mode; target.flags = source.flags; target.subtreeFlags = source.subtreeFlags; target.deletions = source.deletions; target.lanes = source.lanes; target.childLanes = source.childLanes; target.alternate = source.alternate; { target.actualDuration = source.actualDuration; target.actualStartTime = source.actualStartTime; target.selfBaseDuration = source.selfBaseDuration; target.treeBaseDuration = source.treeBaseDuration; } target._debugSource = source._debugSource; target._debugOwner = source._debugOwner; target._debugNeedsRemount = source._debugNeedsRemount; target._debugHookTypes = source._debugHookTypes; return target; } function FiberRootNode(containerInfo, tag, hydrate, identifierPrefix, onRecoverableError) { this.tag = tag; this.containerInfo = containerInfo; this.pendingChildren = null; this.current = null; this.pingCache = null; this.finishedWork = null; this.timeoutHandle = noTimeout; this.context = null; this.pendingContext = null; this.callbackNode = null; this.callbackPriority = NoLane; this.eventTimes = createLaneMap(NoLanes); this.expirationTimes = createLaneMap(NoTimestamp); this.pendingLanes = NoLanes; this.suspendedLanes = NoLanes; this.pingedLanes = NoLanes; this.expiredLanes = NoLanes; this.mutableReadLanes = NoLanes; this.finishedLanes = NoLanes; this.entangledLanes = NoLanes; this.entanglements = createLaneMap(NoLanes); this.identifierPrefix = identifierPrefix; this.onRecoverableError = onRecoverableError; { this.mutableSourceEagerHydrationData = null; } { this.effectDuration = 0; this.passiveEffectDuration = 0; } { this.memoizedUpdaters = new Set(); var pendingUpdatersLaneMap = this.pendingUpdatersLaneMap = []; for (var _i = 0; _i < TotalLanes; _i++) { pendingUpdatersLaneMap.push(new Set()); } } { switch (tag) { case ConcurrentRoot: this._debugRootType = hydrate ? 'hydrateRoot()' : 'createRoot()'; break; case LegacyRoot: this._debugRootType = hydrate ? 'hydrate()' : 'render()'; break; } } } function createFiberRoot(containerInfo, tag, hydrate, initialChildren, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, // TODO: We have several of these arguments that are conceptually part of the // host config, but because they are passed in at runtime, we have to thread // them through the root constructor. Perhaps we should put them all into a // single type, like a DynamicHostConfig that is defined by the renderer. identifierPrefix, onRecoverableError, transitionCallbacks) { var root = new FiberRootNode(containerInfo, tag, hydrate, identifierPrefix, onRecoverableError); // stateNode is any. var uninitializedFiber = createHostRootFiber(tag, isStrictMode); root.current = uninitializedFiber; uninitializedFiber.stateNode = root; { var _initialState = { element: initialChildren, isDehydrated: hydrate, cache: null, // not enabled yet transitions: null, pendingSuspenseBoundaries: null }; uninitializedFiber.memoizedState = _initialState; } initializeUpdateQueue(uninitializedFiber); return root; } var ReactVersion = '18.3.1'; function createPortal(children, containerInfo, // TODO: figure out the API for cross-renderer implementation. implementation) { var key = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; { checkKeyStringCoercion(key); } return { // This tag allow us to uniquely identify this as a React Portal $$typeof: REACT_PORTAL_TYPE, key: key == null ? null : '' + key, children: children, containerInfo: containerInfo, implementation: implementation }; } var didWarnAboutNestedUpdates; var didWarnAboutFindNodeInStrictMode; { didWarnAboutNestedUpdates = false; didWarnAboutFindNodeInStrictMode = {}; } function getContextForSubtree(parentComponent) { if (!parentComponent) { return emptyContextObject; } var fiber = get(parentComponent); var parentContext = findCurrentUnmaskedContext(fiber); if (fiber.tag === ClassComponent) { var Component = fiber.type; if (isContextProvider(Component)) { return processChildContext(fiber, Component, parentContext); } } return parentContext; } function findHostInstanceWithWarning(component, methodName) { { var fiber = get(component); if (fiber === undefined) { if (typeof component.render === 'function') { throw new Error('Unable to find node on an unmounted component.'); } else { var keys = Object.keys(component).join(','); throw new Error("Argument appears to not be a ReactComponent. Keys: " + keys); } } var hostFiber = findCurrentHostFiber(fiber); if (hostFiber === null) { return null; } if (hostFiber.mode & StrictLegacyMode) { var componentName = getComponentNameFromFiber(fiber) || 'Component'; if (!didWarnAboutFindNodeInStrictMode[componentName]) { didWarnAboutFindNodeInStrictMode[componentName] = true; var previousFiber = current; try { setCurrentFiber(hostFiber); if (fiber.mode & StrictLegacyMode) { error('%s is deprecated in StrictMode. ' + '%s was passed an instance of %s which is inside StrictMode. ' + 'Instead, add a ref directly to the element you want to reference. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-find-node', methodName, methodName, componentName); } else { error('%s is deprecated in StrictMode. ' + '%s was passed an instance of %s which renders StrictMode children. ' + 'Instead, add a ref directly to the element you want to reference. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-find-node', methodName, methodName, componentName); } } finally { // Ideally this should reset to previous but this shouldn't be called in // render and there's another warning for that anyway. if (previousFiber) { setCurrentFiber(previousFiber); } else { resetCurrentFiber(); } } } } return hostFiber.stateNode; } } function createContainer(containerInfo, tag, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError, transitionCallbacks) { var hydrate = false; var initialChildren = null; return createFiberRoot(containerInfo, tag, hydrate, initialChildren, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError); } function createHydrationContainer(initialChildren, // TODO: Remove `callback` when we delete legacy mode. callback, containerInfo, tag, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError, transitionCallbacks) { var hydrate = true; var root = createFiberRoot(containerInfo, tag, hydrate, initialChildren, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError); // TODO: Move this to FiberRoot constructor root.context = getContextForSubtree(null); // Schedule the initial render. In a hydration root, this is different from // a regular update because the initial render must match was was rendered // on the server. // NOTE: This update intentionally doesn't have a payload. We're only using // the update to schedule work on the root fiber (and, for legacy roots, to // enqueue the callback if one is provided). var current = root.current; var eventTime = requestEventTime(); var lane = requestUpdateLane(current); var update = createUpdate(eventTime, lane); update.callback = callback !== undefined && callback !== null ? callback : null; enqueueUpdate(current, update, lane); scheduleInitialHydrationOnRoot(root, lane, eventTime); return root; } function updateContainer(element, container, parentComponent, callback) { { onScheduleRoot(container, element); } var current$1 = container.current; var eventTime = requestEventTime(); var lane = requestUpdateLane(current$1); { markRenderScheduled(lane); } var context = getContextForSubtree(parentComponent); if (container.context === null) { container.context = context; } else { container.pendingContext = context; } { if (isRendering && current !== null && !didWarnAboutNestedUpdates) { didWarnAboutNestedUpdates = true; error('Render methods should be a pure function of props and state; ' + 'triggering nested component updates from render is not allowed. ' + 'If necessary, trigger nested updates in componentDidUpdate.\n\n' + 'Check the render method of %s.', getComponentNameFromFiber(current) || 'Unknown'); } } var update = createUpdate(eventTime, lane); // Caution: React DevTools currently depends on this property // being called "element". update.payload = { element: element }; callback = callback === undefined ? null : callback; if (callback !== null) { { if (typeof callback !== 'function') { error('render(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callback); } } update.callback = callback; } var root = enqueueUpdate(current$1, update, lane); if (root !== null) { scheduleUpdateOnFiber(root, current$1, lane, eventTime); entangleTransitions(root, current$1, lane); } return lane; } function getPublicRootInstance(container) { var containerFiber = container.current; if (!containerFiber.child) { return null; } switch (containerFiber.child.tag) { case HostComponent: return getPublicInstance(containerFiber.child.stateNode); default: return containerFiber.child.stateNode; } } function attemptSynchronousHydration$1(fiber) { switch (fiber.tag) { case HostRoot: { var root = fiber.stateNode; if (isRootDehydrated(root)) { // Flush the first scheduled "update". var lanes = getHighestPriorityPendingLanes(root); flushRoot(root, lanes); } break; } case SuspenseComponent: { flushSync(function () { var root = enqueueConcurrentRenderForLane(fiber, SyncLane); if (root !== null) { var eventTime = requestEventTime(); scheduleUpdateOnFiber(root, fiber, SyncLane, eventTime); } }); // If we're still blocked after this, we need to increase // the priority of any promises resolving within this // boundary so that they next attempt also has higher pri. var retryLane = SyncLane; markRetryLaneIfNotHydrated(fiber, retryLane); break; } } } function markRetryLaneImpl(fiber, retryLane) { var suspenseState = fiber.memoizedState; if (suspenseState !== null && suspenseState.dehydrated !== null) { suspenseState.retryLane = higherPriorityLane(suspenseState.retryLane, retryLane); } } // Increases the priority of thenables when they resolve within this boundary. function markRetryLaneIfNotHydrated(fiber, retryLane) { markRetryLaneImpl(fiber, retryLane); var alternate = fiber.alternate; if (alternate) { markRetryLaneImpl(alternate, retryLane); } } function attemptContinuousHydration$1(fiber) { if (fiber.tag !== SuspenseComponent) { // We ignore HostRoots here because we can't increase // their priority and they should not suspend on I/O, // since you have to wrap anything that might suspend in // Suspense. return; } var lane = SelectiveHydrationLane; var root = enqueueConcurrentRenderForLane(fiber, lane); if (root !== null) { var eventTime = requestEventTime(); scheduleUpdateOnFiber(root, fiber, lane, eventTime); } markRetryLaneIfNotHydrated(fiber, lane); } function attemptHydrationAtCurrentPriority$1(fiber) { if (fiber.tag !== SuspenseComponent) { // We ignore HostRoots here because we can't increase // their priority other than synchronously flush it. return; } var lane = requestUpdateLane(fiber); var root = enqueueConcurrentRenderForLane(fiber, lane); if (root !== null) { var eventTime = requestEventTime(); scheduleUpdateOnFiber(root, fiber, lane, eventTime); } markRetryLaneIfNotHydrated(fiber, lane); } function findHostInstanceWithNoPortals(fiber) { var hostFiber = findCurrentHostFiberWithNoPortals(fiber); if (hostFiber === null) { return null; } return hostFiber.stateNode; } var shouldErrorImpl = function (fiber) { return null; }; function shouldError(fiber) { return shouldErrorImpl(fiber); } var shouldSuspendImpl = function (fiber) { return false; }; function shouldSuspend(fiber) { return shouldSuspendImpl(fiber); } var overrideHookState = null; var overrideHookStateDeletePath = null; var overrideHookStateRenamePath = null; var overrideProps = null; var overridePropsDeletePath = null; var overridePropsRenamePath = null; var scheduleUpdate = null; var setErrorHandler = null; var setSuspenseHandler = null; { var copyWithDeleteImpl = function (obj, path, index) { var key = path[index]; var updated = isArray(obj) ? obj.slice() : assign({}, obj); if (index + 1 === path.length) { if (isArray(updated)) { updated.splice(key, 1); } else { delete updated[key]; } return updated; } // $FlowFixMe number or string is fine here updated[key] = copyWithDeleteImpl(obj[key], path, index + 1); return updated; }; var copyWithDelete = function (obj, path) { return copyWithDeleteImpl(obj, path, 0); }; var copyWithRenameImpl = function (obj, oldPath, newPath, index) { var oldKey = oldPath[index]; var updated = isArray(obj) ? obj.slice() : assign({}, obj); if (index + 1 === oldPath.length) { var newKey = newPath[index]; // $FlowFixMe number or string is fine here updated[newKey] = updated[oldKey]; if (isArray(updated)) { updated.splice(oldKey, 1); } else { delete updated[oldKey]; } } else { // $FlowFixMe number or string is fine here updated[oldKey] = copyWithRenameImpl( // $FlowFixMe number or string is fine here obj[oldKey], oldPath, newPath, index + 1); } return updated; }; var copyWithRename = function (obj, oldPath, newPath) { if (oldPath.length !== newPath.length) { warn('copyWithRename() expects paths of the same length'); return; } else { for (var i = 0; i < newPath.length - 1; i++) { if (oldPath[i] !== newPath[i]) { warn('copyWithRename() expects paths to be the same except for the deepest key'); return; } } } return copyWithRenameImpl(obj, oldPath, newPath, 0); }; var copyWithSetImpl = function (obj, path, index, value) { if (index >= path.length) { return value; } var key = path[index]; var updated = isArray(obj) ? obj.slice() : assign({}, obj); // $FlowFixMe number or string is fine here updated[key] = copyWithSetImpl(obj[key], path, index + 1, value); return updated; }; var copyWithSet = function (obj, path, value) { return copyWithSetImpl(obj, path, 0, value); }; var findHook = function (fiber, id) { // For now, the "id" of stateful hooks is just the stateful hook index. // This may change in the future with e.g. nested hooks. var currentHook = fiber.memoizedState; while (currentHook !== null && id > 0) { currentHook = currentHook.next; id--; } return currentHook; }; // Support DevTools editable values for useState and useReducer. overrideHookState = function (fiber, id, path, value) { var hook = findHook(fiber, id); if (hook !== null) { var newState = copyWithSet(hook.memoizedState, path, value); hook.memoizedState = newState; hook.baseState = newState; // We aren't actually adding an update to the queue, // because there is no update we can add for useReducer hooks that won't trigger an error. // (There's no appropriate action type for DevTools overrides.) // As a result though, React will see the scheduled update as a noop and bailout. // Shallow cloning props works as a workaround for now to bypass the bailout check. fiber.memoizedProps = assign({}, fiber.memoizedProps); var root = enqueueConcurrentRenderForLane(fiber, SyncLane); if (root !== null) { scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp); } } }; overrideHookStateDeletePath = function (fiber, id, path) { var hook = findHook(fiber, id); if (hook !== null) { var newState = copyWithDelete(hook.memoizedState, path); hook.memoizedState = newState; hook.baseState = newState; // We aren't actually adding an update to the queue, // because there is no update we can add for useReducer hooks that won't trigger an error. // (There's no appropriate action type for DevTools overrides.) // As a result though, React will see the scheduled update as a noop and bailout. // Shallow cloning props works as a workaround for now to bypass the bailout check. fiber.memoizedProps = assign({}, fiber.memoizedProps); var root = enqueueConcurrentRenderForLane(fiber, SyncLane); if (root !== null) { scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp); } } }; overrideHookStateRenamePath = function (fiber, id, oldPath, newPath) { var hook = findHook(fiber, id); if (hook !== null) { var newState = copyWithRename(hook.memoizedState, oldPath, newPath); hook.memoizedState = newState; hook.baseState = newState; // We aren't actually adding an update to the queue, // because there is no update we can add for useReducer hooks that won't trigger an error. // (There's no appropriate action type for DevTools overrides.) // As a result though, React will see the scheduled update as a noop and bailout. // Shallow cloning props works as a workaround for now to bypass the bailout check. fiber.memoizedProps = assign({}, fiber.memoizedProps); var root = enqueueConcurrentRenderForLane(fiber, SyncLane); if (root !== null) { scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp); } } }; // Support DevTools props for function components, forwardRef, memo, host components, etc. overrideProps = function (fiber, path, value) { fiber.pendingProps = copyWithSet(fiber.memoizedProps, path, value); if (fiber.alternate) { fiber.alternate.pendingProps = fiber.pendingProps; } var root = enqueueConcurrentRenderForLane(fiber, SyncLane); if (root !== null) { scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp); } }; overridePropsDeletePath = function (fiber, path) { fiber.pendingProps = copyWithDelete(fiber.memoizedProps, path); if (fiber.alternate) { fiber.alternate.pendingProps = fiber.pendingProps; } var root = enqueueConcurrentRenderForLane(fiber, SyncLane); if (root !== null) { scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp); } }; overridePropsRenamePath = function (fiber, oldPath, newPath) { fiber.pendingProps = copyWithRename(fiber.memoizedProps, oldPath, newPath); if (fiber.alternate) { fiber.alternate.pendingProps = fiber.pendingProps; } var root = enqueueConcurrentRenderForLane(fiber, SyncLane); if (root !== null) { scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp); } }; scheduleUpdate = function (fiber) { var root = enqueueConcurrentRenderForLane(fiber, SyncLane); if (root !== null) { scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp); } }; setErrorHandler = function (newShouldErrorImpl) { shouldErrorImpl = newShouldErrorImpl; }; setSuspenseHandler = function (newShouldSuspendImpl) { shouldSuspendImpl = newShouldSuspendImpl; }; } function findHostInstanceByFiber(fiber) { var hostFiber = findCurrentHostFiber(fiber); if (hostFiber === null) { return null; } return hostFiber.stateNode; } function emptyFindFiberByHostInstance(instance) { return null; } function getCurrentFiberForDevTools() { return current; } function injectIntoDevTools(devToolsConfig) { var findFiberByHostInstance = devToolsConfig.findFiberByHostInstance; var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher; return injectInternals({ bundleType: devToolsConfig.bundleType, version: devToolsConfig.version, rendererPackageName: devToolsConfig.rendererPackageName, rendererConfig: devToolsConfig.rendererConfig, overrideHookState: overrideHookState, overrideHookStateDeletePath: overrideHookStateDeletePath, overrideHookStateRenamePath: overrideHookStateRenamePath, overrideProps: overrideProps, overridePropsDeletePath: overridePropsDeletePath, overridePropsRenamePath: overridePropsRenamePath, setErrorHandler: setErrorHandler, setSuspenseHandler: setSuspenseHandler, scheduleUpdate: scheduleUpdate, currentDispatcherRef: ReactCurrentDispatcher, findHostInstanceByFiber: findHostInstanceByFiber, findFiberByHostInstance: findFiberByHostInstance || emptyFindFiberByHostInstance, // React Refresh findHostInstancesForRefresh: findHostInstancesForRefresh , scheduleRefresh: scheduleRefresh , scheduleRoot: scheduleRoot , setRefreshHandler: setRefreshHandler , // Enables DevTools to append owner stacks to error messages in DEV mode. getCurrentFiber: getCurrentFiberForDevTools , // Enables DevTools to detect reconciler version rather than renderer version // which may not match for third party renderers. reconcilerVersion: ReactVersion }); } /* global reportError */ var defaultOnRecoverableError = typeof reportError === 'function' ? // In modern browsers, reportError will dispatch an error event, // emulating an uncaught JavaScript error. reportError : function (error) { // In older browsers and test environments, fallback to console.error. // eslint-disable-next-line react-internal/no-production-logging console['error'](error); }; function ReactDOMRoot(internalRoot) { this._internalRoot = internalRoot; } ReactDOMHydrationRoot.prototype.render = ReactDOMRoot.prototype.render = function (children) { var root = this._internalRoot; if (root === null) { throw new Error('Cannot update an unmounted root.'); } { if (typeof arguments[1] === 'function') { error('render(...): does not support the second callback argument. ' + 'To execute a side effect after rendering, declare it in a component body with useEffect().'); } else if (isValidContainer(arguments[1])) { error('You passed a container to the second argument of root.render(...). ' + "You don't need to pass it again since you already passed it to create the root."); } else if (typeof arguments[1] !== 'undefined') { error('You passed a second argument to root.render(...) but it only accepts ' + 'one argument.'); } var container = root.containerInfo; if (container.nodeType !== COMMENT_NODE) { var hostInstance = findHostInstanceWithNoPortals(root.current); if (hostInstance) { if (hostInstance.parentNode !== container) { error('render(...): It looks like the React-rendered content of the ' + 'root container was removed without using React. This is not ' + 'supported and will cause errors. Instead, call ' + "root.unmount() to empty a root's container."); } } } } updateContainer(children, root, null, null); }; ReactDOMHydrationRoot.prototype.unmount = ReactDOMRoot.prototype.unmount = function () { { if (typeof arguments[0] === 'function') { error('unmount(...): does not support a callback argument. ' + 'To execute a side effect after rendering, declare it in a component body with useEffect().'); } } var root = this._internalRoot; if (root !== null) { this._internalRoot = null; var container = root.containerInfo; { if (isAlreadyRendering()) { error('Attempted to synchronously unmount a root while React was already ' + 'rendering. React cannot finish unmounting the root until the ' + 'current render has completed, which may lead to a race condition.'); } } flushSync(function () { updateContainer(null, root, null, null); }); unmarkContainerAsRoot(container); } }; function createRoot(container, options) { if (!isValidContainer(container)) { throw new Error('createRoot(...): Target container is not a DOM element.'); } warnIfReactDOMContainerInDEV(container); var isStrictMode = false; var concurrentUpdatesByDefaultOverride = false; var identifierPrefix = ''; var onRecoverableError = defaultOnRecoverableError; var transitionCallbacks = null; if (options !== null && options !== undefined) { { if (options.hydrate) { warn('hydrate through createRoot is deprecated. Use ReactDOMClient.hydrateRoot(container, <App />) instead.'); } else { if (typeof options === 'object' && options !== null && options.$$typeof === REACT_ELEMENT_TYPE) { error('You passed a JSX element to createRoot. You probably meant to ' + 'call root.render instead. ' + 'Example usage:\n\n' + ' let root = createRoot(domContainer);\n' + ' root.render(<App />);'); } } } if (options.unstable_strictMode === true) { isStrictMode = true; } if (options.identifierPrefix !== undefined) { identifierPrefix = options.identifierPrefix; } if (options.onRecoverableError !== undefined) { onRecoverableError = options.onRecoverableError; } if (options.transitionCallbacks !== undefined) { transitionCallbacks = options.transitionCallbacks; } } var root = createContainer(container, ConcurrentRoot, null, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError); markContainerAsRoot(root.current, container); var rootContainerElement = container.nodeType === COMMENT_NODE ? container.parentNode : container; listenToAllSupportedEvents(rootContainerElement); return new ReactDOMRoot(root); } function ReactDOMHydrationRoot(internalRoot) { this._internalRoot = internalRoot; } function scheduleHydration(target) { if (target) { queueExplicitHydrationTarget(target); } } ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = scheduleHydration; function hydrateRoot(container, initialChildren, options) { if (!isValidContainer(container)) { throw new Error('hydrateRoot(...): Target container is not a DOM element.'); } warnIfReactDOMContainerInDEV(container); { if (initialChildren === undefined) { error('Must provide initial children as second argument to hydrateRoot. ' + 'Example usage: hydrateRoot(domContainer, <App />)'); } } // For now we reuse the whole bag of options since they contain // the hydration callbacks. var hydrationCallbacks = options != null ? options : null; // TODO: Delete this option var mutableSources = options != null && options.hydratedSources || null; var isStrictMode = false; var concurrentUpdatesByDefaultOverride = false; var identifierPrefix = ''; var onRecoverableError = defaultOnRecoverableError; if (options !== null && options !== undefined) { if (options.unstable_strictMode === true) { isStrictMode = true; } if (options.identifierPrefix !== undefined) { identifierPrefix = options.identifierPrefix; } if (options.onRecoverableError !== undefined) { onRecoverableError = options.onRecoverableError; } } var root = createHydrationContainer(initialChildren, null, container, ConcurrentRoot, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError); markContainerAsRoot(root.current, container); // This can't be a comment node since hydration doesn't work on comment nodes anyway. listenToAllSupportedEvents(container); if (mutableSources) { for (var i = 0; i < mutableSources.length; i++) { var mutableSource = mutableSources[i]; registerMutableSourceForHydration(root, mutableSource); } } return new ReactDOMHydrationRoot(root); } function isValidContainer(node) { return !!(node && (node.nodeType === ELEMENT_NODE || node.nodeType === DOCUMENT_NODE || node.nodeType === DOCUMENT_FRAGMENT_NODE || !disableCommentsAsDOMContainers )); } // TODO: Remove this function which also includes comment nodes. // We only use it in places that are currently more relaxed. function isValidContainerLegacy(node) { return !!(node && (node.nodeType === ELEMENT_NODE || node.nodeType === DOCUMENT_NODE || node.nodeType === DOCUMENT_FRAGMENT_NODE || node.nodeType === COMMENT_NODE && node.nodeValue === ' react-mount-point-unstable ')); } function warnIfReactDOMContainerInDEV(container) { { if (container.nodeType === ELEMENT_NODE && container.tagName && container.tagName.toUpperCase() === 'BODY') { error('createRoot(): Creating roots directly with document.body is ' + 'discouraged, since its children are often manipulated by third-party ' + 'scripts and browser extensions. This may lead to subtle ' + 'reconciliation issues. Try using a container element created ' + 'for your app.'); } if (isContainerMarkedAsRoot(container)) { if (container._reactRootContainer) { error('You are calling ReactDOMClient.createRoot() on a container that was previously ' + 'passed to ReactDOM.render(). This is not supported.'); } else { error('You are calling ReactDOMClient.createRoot() on a container that ' + 'has already been passed to createRoot() before. Instead, call ' + 'root.render() on the existing root instead if you want to update it.'); } } } } var ReactCurrentOwner$3 = ReactSharedInternals.ReactCurrentOwner; var topLevelUpdateWarnings; { topLevelUpdateWarnings = function (container) { if (container._reactRootContainer && container.nodeType !== COMMENT_NODE) { var hostInstance = findHostInstanceWithNoPortals(container._reactRootContainer.current); if (hostInstance) { if (hostInstance.parentNode !== container) { error('render(...): It looks like the React-rendered content of this ' + 'container was removed without using React. This is not ' + 'supported and will cause errors. Instead, call ' + 'ReactDOM.unmountComponentAtNode to empty a container.'); } } } var isRootRenderedBySomeReact = !!container._reactRootContainer; var rootEl = getReactRootElementInContainer(container); var hasNonRootReactChild = !!(rootEl && getInstanceFromNode(rootEl)); if (hasNonRootReactChild && !isRootRenderedBySomeReact) { error('render(...): Replacing React-rendered children with a new root ' + 'component. If you intended to update the children of this node, ' + 'you should instead have the existing children update their state ' + 'and render the new components instead of calling ReactDOM.render.'); } if (container.nodeType === ELEMENT_NODE && container.tagName && container.tagName.toUpperCase() === 'BODY') { error('render(): Rendering components directly into document.body is ' + 'discouraged, since its children are often manipulated by third-party ' + 'scripts and browser extensions. This may lead to subtle ' + 'reconciliation issues. Try rendering into a container element created ' + 'for your app.'); } }; } function getReactRootElementInContainer(container) { if (!container) { return null; } if (container.nodeType === DOCUMENT_NODE) { return container.documentElement; } else { return container.firstChild; } } function noopOnRecoverableError() {// This isn't reachable because onRecoverableError isn't called in the // legacy API. } function legacyCreateRootFromDOMContainer(container, initialChildren, parentComponent, callback, isHydrationContainer) { if (isHydrationContainer) { if (typeof callback === 'function') { var originalCallback = callback; callback = function () { var instance = getPublicRootInstance(root); originalCallback.call(instance); }; } var root = createHydrationContainer(initialChildren, callback, container, LegacyRoot, null, // hydrationCallbacks false, // isStrictMode false, // concurrentUpdatesByDefaultOverride, '', // identifierPrefix noopOnRecoverableError); container._reactRootContainer = root; markContainerAsRoot(root.current, container); var rootContainerElement = container.nodeType === COMMENT_NODE ? container.parentNode : container; listenToAllSupportedEvents(rootContainerElement); flushSync(); return root; } else { // First clear any existing content. var rootSibling; while (rootSibling = container.lastChild) { container.removeChild(rootSibling); } if (typeof callback === 'function') { var _originalCallback = callback; callback = function () { var instance = getPublicRootInstance(_root); _originalCallback.call(instance); }; } var _root = createContainer(container, LegacyRoot, null, // hydrationCallbacks false, // isStrictMode false, // concurrentUpdatesByDefaultOverride, '', // identifierPrefix noopOnRecoverableError); container._reactRootContainer = _root; markContainerAsRoot(_root.current, container); var _rootContainerElement = container.nodeType === COMMENT_NODE ? container.parentNode : container; listenToAllSupportedEvents(_rootContainerElement); // Initial mount should not be batched. flushSync(function () { updateContainer(initialChildren, _root, parentComponent, callback); }); return _root; } } function warnOnInvalidCallback$1(callback, callerName) { { if (callback !== null && typeof callback !== 'function') { error('%s(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callerName, callback); } } } function legacyRenderSubtreeIntoContainer(parentComponent, children, container, forceHydrate, callback) { { topLevelUpdateWarnings(container); warnOnInvalidCallback$1(callback === undefined ? null : callback, 'render'); } var maybeRoot = container._reactRootContainer; var root; if (!maybeRoot) { // Initial mount root = legacyCreateRootFromDOMContainer(container, children, parentComponent, callback, forceHydrate); } else { root = maybeRoot; if (typeof callback === 'function') { var originalCallback = callback; callback = function () { var instance = getPublicRootInstance(root); originalCallback.call(instance); }; } // Update updateContainer(children, root, parentComponent, callback); } return getPublicRootInstance(root); } var didWarnAboutFindDOMNode = false; function findDOMNode(componentOrElement) { { if (!didWarnAboutFindDOMNode) { didWarnAboutFindDOMNode = true; error('findDOMNode is deprecated and will be removed in the next major ' + 'release. Instead, add a ref directly to the element you want ' + 'to reference. Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-find-node'); } var owner = ReactCurrentOwner$3.current; if (owner !== null && owner.stateNode !== null) { var warnedAboutRefsInRender = owner.stateNode._warnedAboutRefsInRender; if (!warnedAboutRefsInRender) { error('%s is accessing findDOMNode inside its render(). ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', getComponentNameFromType(owner.type) || 'A component'); } owner.stateNode._warnedAboutRefsInRender = true; } } if (componentOrElement == null) { return null; } if (componentOrElement.nodeType === ELEMENT_NODE) { return componentOrElement; } { return findHostInstanceWithWarning(componentOrElement, 'findDOMNode'); } } function hydrate(element, container, callback) { { error('ReactDOM.hydrate is no longer supported in React 18. Use hydrateRoot ' + 'instead. Until you switch to the new API, your app will behave as ' + "if it's running React 17. Learn " + 'more: https://reactjs.org/link/switch-to-createroot'); } if (!isValidContainerLegacy(container)) { throw new Error('Target container is not a DOM element.'); } { var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === undefined; if (isModernRoot) { error('You are calling ReactDOM.hydrate() on a container that was previously ' + 'passed to ReactDOMClient.createRoot(). This is not supported. ' + 'Did you mean to call hydrateRoot(container, element)?'); } } // TODO: throw or warn if we couldn't hydrate? return legacyRenderSubtreeIntoContainer(null, element, container, true, callback); } function render(element, container, callback) { { error('ReactDOM.render is no longer supported in React 18. Use createRoot ' + 'instead. Until you switch to the new API, your app will behave as ' + "if it's running React 17. Learn " + 'more: https://reactjs.org/link/switch-to-createroot'); } if (!isValidContainerLegacy(container)) { throw new Error('Target container is not a DOM element.'); } { var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === undefined; if (isModernRoot) { error('You are calling ReactDOM.render() on a container that was previously ' + 'passed to ReactDOMClient.createRoot(). This is not supported. ' + 'Did you mean to call root.render(element)?'); } } return legacyRenderSubtreeIntoContainer(null, element, container, false, callback); } function unstable_renderSubtreeIntoContainer(parentComponent, element, containerNode, callback) { { error('ReactDOM.unstable_renderSubtreeIntoContainer() is no longer supported ' + 'in React 18. Consider using a portal instead. Until you switch to ' + "the createRoot API, your app will behave as if it's running React " + '17. Learn more: https://reactjs.org/link/switch-to-createroot'); } if (!isValidContainerLegacy(containerNode)) { throw new Error('Target container is not a DOM element.'); } if (parentComponent == null || !has(parentComponent)) { throw new Error('parentComponent must be a valid React Component'); } return legacyRenderSubtreeIntoContainer(parentComponent, element, containerNode, false, callback); } var didWarnAboutUnmountComponentAtNode = false; function unmountComponentAtNode(container) { { if (!didWarnAboutUnmountComponentAtNode) { didWarnAboutUnmountComponentAtNode = true; error('unmountComponentAtNode is deprecated and will be removed in the ' + 'next major release. Switch to the createRoot API. Learn ' + 'more: https://reactjs.org/link/switch-to-createroot'); } } if (!isValidContainerLegacy(container)) { throw new Error('unmountComponentAtNode(...): Target container is not a DOM element.'); } { var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === undefined; if (isModernRoot) { error('You are calling ReactDOM.unmountComponentAtNode() on a container that was previously ' + 'passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call root.unmount()?'); } } if (container._reactRootContainer) { { var rootEl = getReactRootElementInContainer(container); var renderedByDifferentReact = rootEl && !getInstanceFromNode(rootEl); if (renderedByDifferentReact) { error("unmountComponentAtNode(): The node you're attempting to unmount " + 'was rendered by another copy of React.'); } } // Unmount should not be batched. flushSync(function () { legacyRenderSubtreeIntoContainer(null, null, container, false, function () { // $FlowFixMe This should probably use `delete container._reactRootContainer` container._reactRootContainer = null; unmarkContainerAsRoot(container); }); }); // If you call unmountComponentAtNode twice in quick succession, you'll // get `true` twice. That's probably fine? return true; } else { { var _rootEl = getReactRootElementInContainer(container); var hasNonRootReactChild = !!(_rootEl && getInstanceFromNode(_rootEl)); // Check if the container itself is a React root node. var isContainerReactRoot = container.nodeType === ELEMENT_NODE && isValidContainerLegacy(container.parentNode) && !!container.parentNode._reactRootContainer; if (hasNonRootReactChild) { error("unmountComponentAtNode(): The node you're attempting to unmount " + 'was rendered by React and is not a top-level container. %s', isContainerReactRoot ? 'You may have accidentally passed in a React root node instead ' + 'of its container.' : 'Instead, have the parent component update its state and ' + 'rerender in order to remove this component.'); } } return false; } } setAttemptSynchronousHydration(attemptSynchronousHydration$1); setAttemptContinuousHydration(attemptContinuousHydration$1); setAttemptHydrationAtCurrentPriority(attemptHydrationAtCurrentPriority$1); setGetCurrentUpdatePriority(getCurrentUpdatePriority); setAttemptHydrationAtPriority(runWithPriority); { if (typeof Map !== 'function' || // $FlowIssue Flow incorrectly thinks Map has no prototype Map.prototype == null || typeof Map.prototype.forEach !== 'function' || typeof Set !== 'function' || // $FlowIssue Flow incorrectly thinks Set has no prototype Set.prototype == null || typeof Set.prototype.clear !== 'function' || typeof Set.prototype.forEach !== 'function') { error('React depends on Map and Set built-in types. Make sure that you load a ' + 'polyfill in older browsers. https://reactjs.org/link/react-polyfills'); } } setRestoreImplementation(restoreControlledState$3); setBatchingImplementation(batchedUpdates$1, discreteUpdates, flushSync); function createPortal$1(children, container) { var key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; if (!isValidContainer(container)) { throw new Error('Target container is not a DOM element.'); } // TODO: pass ReactDOM portal implementation as third argument // $FlowFixMe The Flow type is opaque but there's no way to actually create it. return createPortal(children, container, null, key); } function renderSubtreeIntoContainer(parentComponent, element, containerNode, callback) { return unstable_renderSubtreeIntoContainer(parentComponent, element, containerNode, callback); } var Internals = { usingClientEntryPoint: false, // Keep in sync with ReactTestUtils.js. // This is an array for better minification. Events: [getInstanceFromNode, getNodeFromInstance, getFiberCurrentPropsFromNode, enqueueStateRestore, restoreStateIfNeeded, batchedUpdates$1] }; function createRoot$1(container, options) { { if (!Internals.usingClientEntryPoint && !true) { error('You are importing createRoot from "react-dom" which is not supported. ' + 'You should instead import it from "react-dom/client".'); } } return createRoot(container, options); } function hydrateRoot$1(container, initialChildren, options) { { if (!Internals.usingClientEntryPoint && !true) { error('You are importing hydrateRoot from "react-dom" which is not supported. ' + 'You should instead import it from "react-dom/client".'); } } return hydrateRoot(container, initialChildren, options); } // Overload the definition to the two valid signatures. // Warning, this opts-out of checking the function body. // eslint-disable-next-line no-redeclare function flushSync$1(fn) { { if (isAlreadyRendering()) { error('flushSync was called from inside a lifecycle method. React cannot ' + 'flush when React is already rendering. Consider moving this call to ' + 'a scheduler task or micro task.'); } } return flushSync(fn); } var foundDevTools = injectIntoDevTools({ findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 1 , version: ReactVersion, rendererPackageName: 'react-dom' }); { if (!foundDevTools && canUseDOM && window.top === window.self) { // If we're in Chrome or Firefox, provide a download link if not installed. if (navigator.userAgent.indexOf('Chrome') > -1 && navigator.userAgent.indexOf('Edge') === -1 || navigator.userAgent.indexOf('Firefox') > -1) { var protocol = window.location.protocol; // Don't warn in exotic cases like chrome-extension://. if (/^(https?|file):$/.test(protocol)) { // eslint-disable-next-line react-internal/no-production-logging console.info('%cDownload the React DevTools ' + 'for a better development experience: ' + 'https://reactjs.org/link/react-devtools' + (protocol === 'file:' ? '\nYou might need to use a local HTTP server (instead of file://): ' + 'https://reactjs.org/link/react-devtools-faq' : ''), 'font-weight:bold'); } } } } exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals; exports.createPortal = createPortal$1; exports.createRoot = createRoot$1; exports.findDOMNode = findDOMNode; exports.flushSync = flushSync$1; exports.hydrate = hydrate; exports.hydrateRoot = hydrateRoot$1; exports.render = render; exports.unmountComponentAtNode = unmountComponentAtNode; exports.unstable_batchedUpdates = batchedUpdates$1; exports.unstable_renderSubtreeIntoContainer = renderSubtreeIntoContainer; exports.version = ReactVersion; }))); vendor/wp-polyfill-object-fit.min.js 0000644 00000005645 15206720414 0013476 0 ustar 00 !function(){"use strict";if("undefined"!=typeof window){var t=window.navigator.userAgent.match(/Edge\/(\d{2})\./),e=t?parseInt(t[1],10):null,n=!!e&&(16<=e&&e<=18);if(!("objectFit"in document.documentElement.style!=!1)||n){var o=function(t,e,i){var n,o,l,a,d;if((i=i.split(" ")).length<2&&(i[1]=i[0]),"x"===t)n=i[0],o=i[1],l="left",a="right",d=e.clientWidth;else{if("y"!==t)return;n=i[1],o=i[0],l="top",a="bottom",d=e.clientHeight}if(n!==l&&o!==l){if(n!==a&&o!==a)return"center"===n||"50%"===n?(e.style[l]="50%",void(e.style["margin-"+l]=d/-2+"px")):void(0<=n.indexOf("%")?(n=parseInt(n,10))<50?(e.style[l]=n+"%",e.style["margin-"+l]=d*(n/-100)+"px"):(n=100-n,e.style[a]=n+"%",e.style["margin-"+a]=d*(n/-100)+"px"):e.style[l]=n);e.style[a]="0"}else e.style[l]="0"},l=function(t){var e=t.dataset?t.dataset.objectFit:t.getAttribute("data-object-fit"),i=t.dataset?t.dataset.objectPosition:t.getAttribute("data-object-position");e=e||"cover",i=i||"50% 50%";var n=t.parentNode;return function(t){var e=window.getComputedStyle(t,null),i=e.getPropertyValue("position"),n=e.getPropertyValue("overflow"),o=e.getPropertyValue("display");i&&"static"!==i||(t.style.position="relative"),"hidden"!==n&&(t.style.overflow="hidden"),o&&"inline"!==o||(t.style.display="block"),0===t.clientHeight&&(t.style.height="100%"),-1===t.className.indexOf("object-fit-polyfill")&&(t.className=t.className+" object-fit-polyfill")}(n),function(t){var e=window.getComputedStyle(t,null),i={"max-width":"none","max-height":"none","min-width":"0px","min-height":"0px",top:"auto",right:"auto",bottom:"auto",left:"auto","margin-top":"0px","margin-right":"0px","margin-bottom":"0px","margin-left":"0px"};for(var n in i)e.getPropertyValue(n)!==i[n]&&(t.style[n]=i[n])}(t),t.style.position="absolute",t.style.width="auto",t.style.height="auto","scale-down"===e&&(e=t.clientWidth<n.clientWidth&&t.clientHeight<n.clientHeight?"none":"contain"),"none"===e?(o("x",t,i),void o("y",t,i)):"fill"===e?(t.style.width="100%",t.style.height="100%",o("x",t,i),void o("y",t,i)):(t.style.height="100%",void("cover"===e&&t.clientWidth>n.clientWidth||"contain"===e&&t.clientWidth<n.clientWidth?(t.style.top="0",t.style.marginTop="0",o("x",t,i)):(t.style.width="100%",t.style.height="auto",t.style.left="0",t.style.marginLeft="0",o("y",t,i))))},i=function(t){if(void 0===t||t instanceof Event)t=document.querySelectorAll("[data-object-fit]");else if(t&&t.nodeName)t=[t];else{if("object"!=typeof t||!t.length||!t[0].nodeName)return!1;t=t}for(var e=0;e<t.length;e++)if(t[e].nodeName){var i=t[e].nodeName.toLowerCase();if("img"===i){if(n)continue;t[e].complete?l(t[e]):t[e].addEventListener("load",function(){l(this)})}else"video"===i?0<t[e].readyState?l(t[e]):t[e].addEventListener("loadedmetadata",function(){l(this)}):l(t[e])}return!0};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",i):i(),window.addEventListener("resize",i),window.objectFitPolyfill=i}else window.objectFitPolyfill=function(){return!1}}}(); vendor/react.min.js 0000644 00000024777 15206720414 0010301 0 ustar 00 /** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ (function(){'use strict';(function(c,x){"object"===typeof exports&&"undefined"!==typeof module?x(exports):"function"===typeof define&&define.amd?define(["exports"],x):(c=c||self,x(c.React={}))})(this,function(c){function x(a){if(null===a||"object"!==typeof a)return null;a=V&&a[V]||a["@@iterator"];return"function"===typeof a?a:null}function w(a,b,e){this.props=a;this.context=b;this.refs=W;this.updater=e||X}function Y(){}function K(a,b,e){this.props=a;this.context=b;this.refs=W;this.updater=e||X}function Z(a,b, e){var m,d={},c=null,h=null;if(null!=b)for(m in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(c=""+b.key),b)aa.call(b,m)&&!ba.hasOwnProperty(m)&&(d[m]=b[m]);var l=arguments.length-2;if(1===l)d.children=e;else if(1<l){for(var f=Array(l),k=0;k<l;k++)f[k]=arguments[k+2];d.children=f}if(a&&a.defaultProps)for(m in l=a.defaultProps,l)void 0===d[m]&&(d[m]=l[m]);return{$$typeof:y,type:a,key:c,ref:h,props:d,_owner:L.current}}function oa(a,b){return{$$typeof:y,type:a.type,key:b,ref:a.ref,props:a.props,_owner:a._owner}} function M(a){return"object"===typeof a&&null!==a&&a.$$typeof===y}function pa(a){var b={"=":"=0",":":"=2"};return"$"+a.replace(/[=:]/g,function(a){return b[a]})}function N(a,b){return"object"===typeof a&&null!==a&&null!=a.key?pa(""+a.key):b.toString(36)}function B(a,b,e,m,d){var c=typeof a;if("undefined"===c||"boolean"===c)a=null;var h=!1;if(null===a)h=!0;else switch(c){case "string":case "number":h=!0;break;case "object":switch(a.$$typeof){case y:case qa:h=!0}}if(h)return h=a,d=d(h),a=""===m?"."+ N(h,0):m,ca(d)?(e="",null!=a&&(e=a.replace(da,"$&/")+"/"),B(d,b,e,"",function(a){return a})):null!=d&&(M(d)&&(d=oa(d,e+(!d.key||h&&h.key===d.key?"":(""+d.key).replace(da,"$&/")+"/")+a)),b.push(d)),1;h=0;m=""===m?".":m+":";if(ca(a))for(var l=0;l<a.length;l++){c=a[l];var f=m+N(c,l);h+=B(c,b,e,f,d)}else if(f=x(a),"function"===typeof f)for(a=f.call(a),l=0;!(c=a.next()).done;)c=c.value,f=m+N(c,l++),h+=B(c,b,e,f,d);else if("object"===c)throw b=String(a),Error("Objects are not valid as a React child (found: "+ ("[object Object]"===b?"object with keys {"+Object.keys(a).join(", ")+"}":b)+"). If you meant to render a collection of children, use an array instead.");return h}function C(a,b,e){if(null==a)return a;var c=[],d=0;B(a,c,"","",function(a){return b.call(e,a,d++)});return c}function ra(a){if(-1===a._status){var b=a._result;b=b();b.then(function(b){if(0===a._status||-1===a._status)a._status=1,a._result=b},function(b){if(0===a._status||-1===a._status)a._status=2,a._result=b});-1===a._status&&(a._status= 0,a._result=b)}if(1===a._status)return a._result.default;throw a._result;}function O(a,b){var e=a.length;a.push(b);a:for(;0<e;){var c=e-1>>>1,d=a[c];if(0<D(d,b))a[c]=b,a[e]=d,e=c;else break a}}function p(a){return 0===a.length?null:a[0]}function E(a){if(0===a.length)return null;var b=a[0],e=a.pop();if(e!==b){a[0]=e;a:for(var c=0,d=a.length,k=d>>>1;c<k;){var h=2*(c+1)-1,l=a[h],f=h+1,g=a[f];if(0>D(l,e))f<d&&0>D(g,l)?(a[c]=g,a[f]=e,c=f):(a[c]=l,a[h]=e,c=h);else if(f<d&&0>D(g,e))a[c]=g,a[f]=e,c=f;else break a}}return b} function D(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}function P(a){for(var b=p(r);null!==b;){if(null===b.callback)E(r);else if(b.startTime<=a)E(r),b.sortIndex=b.expirationTime,O(q,b);else break;b=p(r)}}function Q(a){z=!1;P(a);if(!u)if(null!==p(q))u=!0,R(S);else{var b=p(r);null!==b&&T(Q,b.startTime-a)}}function S(a,b){u=!1;z&&(z=!1,ea(A),A=-1);F=!0;var c=k;try{P(b);for(n=p(q);null!==n&&(!(n.expirationTime>b)||a&&!fa());){var m=n.callback;if("function"===typeof m){n.callback=null; k=n.priorityLevel;var d=m(n.expirationTime<=b);b=v();"function"===typeof d?n.callback=d:n===p(q)&&E(q);P(b)}else E(q);n=p(q)}if(null!==n)var g=!0;else{var h=p(r);null!==h&&T(Q,h.startTime-b);g=!1}return g}finally{n=null,k=c,F=!1}}function fa(){return v()-ha<ia?!1:!0}function R(a){G=a;H||(H=!0,I())}function T(a,b){A=ja(function(){a(v())},b)}function ka(a){throw Error("act(...) is not supported in production builds of React.");}var y=Symbol.for("react.element"),qa=Symbol.for("react.portal"),sa=Symbol.for("react.fragment"), ta=Symbol.for("react.strict_mode"),ua=Symbol.for("react.profiler"),va=Symbol.for("react.provider"),wa=Symbol.for("react.context"),xa=Symbol.for("react.forward_ref"),ya=Symbol.for("react.suspense"),za=Symbol.for("react.memo"),Aa=Symbol.for("react.lazy"),V=Symbol.iterator,X={isMounted:function(a){return!1},enqueueForceUpdate:function(a,b,c){},enqueueReplaceState:function(a,b,c,m){},enqueueSetState:function(a,b,c,m){}},la=Object.assign,W={};w.prototype.isReactComponent={};w.prototype.setState=function(a, b){if("object"!==typeof a&&"function"!==typeof a&&null!=a)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,a,b,"setState")};w.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,"forceUpdate")};Y.prototype=w.prototype;var t=K.prototype=new Y;t.constructor=K;la(t,w.prototype);t.isPureReactComponent=!0;var ca=Array.isArray,aa=Object.prototype.hasOwnProperty,L={current:null}, ba={key:!0,ref:!0,__self:!0,__source:!0},da=/\/+/g,g={current:null},J={transition:null};if("object"===typeof performance&&"function"===typeof performance.now){var Ba=performance;var v=function(){return Ba.now()}}else{var ma=Date,Ca=ma.now();v=function(){return ma.now()-Ca}}var q=[],r=[],Da=1,n=null,k=3,F=!1,u=!1,z=!1,ja="function"===typeof setTimeout?setTimeout:null,ea="function"===typeof clearTimeout?clearTimeout:null,na="undefined"!==typeof setImmediate?setImmediate:null;"undefined"!==typeof navigator&& void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var H=!1,G=null,A=-1,ia=5,ha=-1,U=function(){if(null!==G){var a=v();ha=a;var b=!0;try{b=G(!0,a)}finally{b?I():(H=!1,G=null)}}else H=!1};if("function"===typeof na)var I=function(){na(U)};else if("undefined"!==typeof MessageChannel){t=new MessageChannel;var Ea=t.port2;t.port1.onmessage=U;I=function(){Ea.postMessage(null)}}else I=function(){ja(U,0)};t={ReactCurrentDispatcher:g, ReactCurrentOwner:L,ReactCurrentBatchConfig:J,Scheduler:{__proto__:null,unstable_ImmediatePriority:1,unstable_UserBlockingPriority:2,unstable_NormalPriority:3,unstable_IdlePriority:5,unstable_LowPriority:4,unstable_runWithPriority:function(a,b){switch(a){case 1:case 2:case 3:case 4:case 5:break;default:a=3}var c=k;k=a;try{return b()}finally{k=c}},unstable_next:function(a){switch(k){case 1:case 2:case 3:var b=3;break;default:b=k}var c=k;k=b;try{return a()}finally{k=c}},unstable_scheduleCallback:function(a, b,c){var e=v();"object"===typeof c&&null!==c?(c=c.delay,c="number"===typeof c&&0<c?e+c:e):c=e;switch(a){case 1:var d=-1;break;case 2:d=250;break;case 5:d=1073741823;break;case 4:d=1E4;break;default:d=5E3}d=c+d;a={id:Da++,callback:b,priorityLevel:a,startTime:c,expirationTime:d,sortIndex:-1};c>e?(a.sortIndex=c,O(r,a),null===p(q)&&a===p(r)&&(z?(ea(A),A=-1):z=!0,T(Q,c-e))):(a.sortIndex=d,O(q,a),u||F||(u=!0,R(S)));return a},unstable_cancelCallback:function(a){a.callback=null},unstable_wrapCallback:function(a){var b= k;return function(){var c=k;k=b;try{return a.apply(this,arguments)}finally{k=c}}},unstable_getCurrentPriorityLevel:function(){return k},unstable_shouldYield:fa,unstable_requestPaint:function(){},unstable_continueExecution:function(){u||F||(u=!0,R(S))},unstable_pauseExecution:function(){},unstable_getFirstCallbackNode:function(){return p(q)},get unstable_now(){return v},unstable_forceFrameRate:function(a){0>a||125<a?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"): ia=0<a?Math.floor(1E3/a):5},unstable_Profiling:null}};c.Children={map:C,forEach:function(a,b,c){C(a,function(){b.apply(this,arguments)},c)},count:function(a){var b=0;C(a,function(){b++});return b},toArray:function(a){return C(a,function(a){return a})||[]},only:function(a){if(!M(a))throw Error("React.Children.only expected to receive a single React element child.");return a}};c.Component=w;c.Fragment=sa;c.Profiler=ua;c.PureComponent=K;c.StrictMode=ta;c.Suspense=ya;c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED= t;c.act=ka;c.cloneElement=function(a,b,c){if(null===a||void 0===a)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+a+".");var e=la({},a.props),d=a.key,k=a.ref,h=a._owner;if(null!=b){void 0!==b.ref&&(k=b.ref,h=L.current);void 0!==b.key&&(d=""+b.key);if(a.type&&a.type.defaultProps)var l=a.type.defaultProps;for(f in b)aa.call(b,f)&&!ba.hasOwnProperty(f)&&(e[f]=void 0===b[f]&&void 0!==l?l[f]:b[f])}var f=arguments.length-2;if(1===f)e.children=c;else if(1<f){l= Array(f);for(var g=0;g<f;g++)l[g]=arguments[g+2];e.children=l}return{$$typeof:y,type:a.type,key:d,ref:k,props:e,_owner:h}};c.createContext=function(a){a={$$typeof:wa,_currentValue:a,_currentValue2:a,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};a.Provider={$$typeof:va,_context:a};return a.Consumer=a};c.createElement=Z;c.createFactory=function(a){var b=Z.bind(null,a);b.type=a;return b};c.createRef=function(){return{current:null}};c.forwardRef=function(a){return{$$typeof:xa, render:a}};c.isValidElement=M;c.lazy=function(a){return{$$typeof:Aa,_payload:{_status:-1,_result:a},_init:ra}};c.memo=function(a,b){return{$$typeof:za,type:a,compare:void 0===b?null:b}};c.startTransition=function(a,b){b=J.transition;J.transition={};try{a()}finally{J.transition=b}};c.unstable_act=ka;c.useCallback=function(a,b){return g.current.useCallback(a,b)};c.useContext=function(a){return g.current.useContext(a)};c.useDebugValue=function(a,b){};c.useDeferredValue=function(a){return g.current.useDeferredValue(a)}; c.useEffect=function(a,b){return g.current.useEffect(a,b)};c.useId=function(){return g.current.useId()};c.useImperativeHandle=function(a,b,c){return g.current.useImperativeHandle(a,b,c)};c.useInsertionEffect=function(a,b){return g.current.useInsertionEffect(a,b)};c.useLayoutEffect=function(a,b){return g.current.useLayoutEffect(a,b)};c.useMemo=function(a,b){return g.current.useMemo(a,b)};c.useReducer=function(a,b,c){return g.current.useReducer(a,b,c)};c.useRef=function(a){return g.current.useRef(a)}; c.useState=function(a){return g.current.useState(a)};c.useSyncExternalStore=function(a,b,c){return g.current.useSyncExternalStore(a,b,c)};c.useTransition=function(){return g.current.useTransition()};c.version="18.3.1"}); })(); vendor/wp-polyfill-dom-rect.js 0000644 00000003607 15206720414 0012374 0 ustar 00 // DOMRect (function (global) { function number(v) { return v === undefined ? 0 : Number(v); } function different(u, v) { return u !== v && !(isNaN(u) && isNaN(v)); } function DOMRect(xArg, yArg, wArg, hArg) { var x, y, width, height, left, right, top, bottom; x = number(xArg); y = number(yArg); width = number(wArg); height = number(hArg); Object.defineProperties(this, { x: { get: function () { return x; }, set: function (newX) { if (different(x, newX)) { x = newX; left = right = undefined; } }, enumerable: true }, y: { get: function () { return y; }, set: function (newY) { if (different(y, newY)) { y = newY; top = bottom = undefined; } }, enumerable: true }, width: { get: function () { return width; }, set: function (newWidth) { if (different(width, newWidth)) { width = newWidth; left = right = undefined; } }, enumerable: true }, height: { get: function () { return height; }, set: function (newHeight) { if (different(height, newHeight)) { height = newHeight; top = bottom = undefined; } }, enumerable: true }, left: { get: function () { if (left === undefined) { left = x + Math.min(0, width); } return left; }, enumerable: true }, right: { get: function () { if (right === undefined) { right = x + Math.max(0, width); } return right; }, enumerable: true }, top: { get: function () { if (top === undefined) { top = y + Math.min(0, height); } return top; }, enumerable: true }, bottom: { get: function () { if (bottom === undefined) { bottom = y + Math.max(0, height); } return bottom; }, enumerable: true } }); } global.DOMRect = DOMRect; }(self)); server-side-render.min.js 0000644 00000007640 15206720414 0011401 0 ustar 00 var wp;(wp||={}).serverSideRender=(()=>{var V=Object.create;var g=Object.defineProperty;var Z=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var re=Object.getPrototypeOf,te=Object.prototype.hasOwnProperty;var d=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),oe=(e,r)=>{for(var t in r)g(e,t,{get:r[t],enumerable:!0})},k=(e,r,t,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of ee(r))!te.call(e,n)&&n!==t&&g(e,n,{get:()=>r[n],enumerable:!(s=Z(r,n))||s.enumerable});return e};var c=(e,r,t)=>(t=e!=null?V(re(e)):{},k(r||!e||!e.__esModule?g(t,"default",{value:e,enumerable:!0}):t,e)),ne=e=>k(g({},"__esModule",{value:!0}),e);var A=d((Se,C)=>{C.exports=window.wp.element});var L=d((we,_)=>{_.exports=window.wp.i18n});var I=d((he,B)=>{B.exports=window.wp.components});var D=d((Re,M)=>{M.exports=window.wp.data});var O=d((be,F)=>{F.exports=window.wp.compose});var z=d((ve,j)=>{j.exports=window.wp.apiFetch});var N=d((ge,J)=>{J.exports=window.wp.url});var Q=d((xe,G)=>{G.exports=window.wp.blocks});var Y=d((Pe,X)=>{X.exports=window.ReactJSXRuntime});var fe={};oe(fe,{ServerSideRender:()=>x,default:()=>pe,useServerSideRender:()=>w});var i=c(A(),1),h=c(L(),1),R=c(I(),1),$=c(D(),1);var W=c(O(),1),m=c(A(),1),q=c(z(),1),H=c(N(),1),U=c(Q(),1);function se(e,r=null,t={}){return(0,H.addQueryArgs)(`/wp/v2/block-renderer/${e}`,{context:"edit",...r!==null?{attributes:r}:{},...t})}function ie(e){let{backgroundColor:r,borderColor:t,fontFamily:s,fontSize:n,gradient:u,textColor:b,className:l,...a}=e,{border:p,color:f,elements:K,shadow:y,spacing:P,typography:E,...v}=e?.style||{};return{...a,style:v}}function w(e){let[r,t]=(0,m.useState)({status:"idle"}),s=(0,m.useRef)(!1),{attributes:n,block:u,skipBlockSupportAttributes:b=!1,httpMethod:l="GET",urlQueryArgs:a}=e,p=n&&(0,U.__experimentalSanitizeBlockAttributes)(u,n);b&&(p=ie(p));let f=l==="POST",y=se(u,f?null:p,a),P=f?JSON.stringify({attributes:p??null}):void 0;return(0,m.useEffect)(()=>{let E=new AbortController,v=(0,W.debounce)(function(){t({status:"loading"}),(0,q.default)({path:y,method:f?"POST":"GET",body:P,headers:f?{"Content-Type":"application/json"}:{},signal:E.signal}).then(S=>{t({status:"success",content:S?S.rendered:""})}).catch(S=>{S.name!=="AbortError"&&t({status:"error",error:S.message})}).finally(()=>{s.current=!0})},s.current?500:0);return v(),()=>{E.abort(),v.cancel()}},[y,f,P]),r}var o=c(Y(),1),ce={};function ue({className:e}){return(0,o.jsx)(R.Placeholder,{className:e,children:(0,h.__)("Block rendered as empty.")})}function de({message:e,className:r}){let t=(0,h.sprintf)((0,h.__)("Error loading block: %s"),e);return(0,o.jsx)(R.Placeholder,{className:r,children:t})}function le({children:e}){let[r,t]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{let s=setTimeout(()=>{t(!0)},1e3);return()=>clearTimeout(s)},[]),(0,o.jsxs)("div",{style:{position:"relative"},children:[r&&(0,o.jsx)("div",{style:{position:"absolute",top:"50%",left:"50%",marginTop:"-9px",marginLeft:"-9px"},children:(0,o.jsx)(R.Spinner,{})}),(0,o.jsx)("div",{style:{opacity:r?"0.3":1},children:e})]})}function ae(e){let r=(0,i.useRef)(""),{className:t,EmptyResponsePlaceholder:s=ue,ErrorResponsePlaceholder:n=de,LoadingResponsePlaceholder:u=le,...b}=e,{content:l,status:a,error:p}=w(b);return(0,i.useEffect)(()=>{l&&(r.current=l)},[l]),a==="loading"?(0,o.jsx)(u,{...e,children:!!r.current&&(0,o.jsx)(i.RawHTML,{className:t,children:r.current})}):a==="success"&&!l?(0,o.jsx)(s,{...e}):a==="error"?(0,o.jsx)(n,{message:p,...e}):(0,o.jsx)(i.RawHTML,{className:t,children:l})}function x({urlQueryArgs:e=ce,...r}){let t=(0,$.useSelect)(n=>{let u=n("core/editor")?.getCurrentPostId();return u&&typeof u=="number"?u:null},[]),s=(0,i.useMemo)(()=>t?{post_id:t,...e}:e,[t,e]);return(0,o.jsx)(ae,{urlQueryArgs:s,...r})}var T=x;T.ServerSideRender=x;T.useServerSideRender=w;var pe=T;return ne(fe);})(); if (typeof wp.serverSideRender === 'object' && wp.serverSideRender.default) { wp.serverSideRender = wp.serverSideRender.default; } edit-site.js 0000644 00006574040 15206720414 0007012 0 ustar 00 "use strict"; var wp; (wp ||= {}).editSite = (() => { 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 __require = /* @__PURE__ */ ((x2) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x2, { get: (a2, b2) => (typeof require !== "undefined" ? require : a2)[b2] }) : x2)(function(x2) { if (typeof require !== "undefined") return require.apply(this, arguments); throw Error('Dynamic require of "' + x2 + '" is not supported'); }); var __commonJS = (cb, mod) => function __require4() { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; var __export = (target, all) => { for (var name2 in all) __defProp(target, name2, { get: all[name2], enumerable: true }); }; var __copyProps = (to2, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to2, key) && key !== except) __defProp(to2, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to2; }; 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 )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // package-external:@wordpress/blocks var require_blocks = __commonJS({ "package-external:@wordpress/blocks"(exports, module) { module.exports = window.wp.blocks; } }); // package-external:@wordpress/block-library var require_block_library = __commonJS({ "package-external:@wordpress/block-library"(exports, module) { module.exports = window.wp.blockLibrary; } }); // package-external:@wordpress/data var require_data = __commonJS({ "package-external:@wordpress/data"(exports, module) { module.exports = window.wp.data; } }); // package-external:@wordpress/deprecated var require_deprecated = __commonJS({ "package-external:@wordpress/deprecated"(exports, module) { module.exports = window.wp.deprecated; } }); // package-external:@wordpress/element var require_element = __commonJS({ "package-external:@wordpress/element"(exports, module) { module.exports = window.wp.element; } }); // package-external:@wordpress/editor var require_editor = __commonJS({ "package-external:@wordpress/editor"(exports, module) { module.exports = window.wp.editor; } }); // package-external:@wordpress/preferences var require_preferences = __commonJS({ "package-external:@wordpress/preferences"(exports, module) { module.exports = window.wp.preferences; } }); // package-external:@wordpress/widgets var require_widgets = __commonJS({ "package-external:@wordpress/widgets"(exports, module) { module.exports = window.wp.widgets; } }); // package-external:@wordpress/core-data var require_core_data = __commonJS({ "package-external:@wordpress/core-data"(exports, module) { module.exports = window.wp.coreData; } }); // package-external:@wordpress/block-editor var require_block_editor = __commonJS({ "package-external:@wordpress/block-editor"(exports, module) { module.exports = window.wp.blockEditor; } }); // package-external:@wordpress/i18n var require_i18n = __commonJS({ "package-external:@wordpress/i18n"(exports, module) { module.exports = window.wp.i18n; } }); // package-external:@wordpress/patterns var require_patterns = __commonJS({ "package-external:@wordpress/patterns"(exports, module) { module.exports = window.wp.patterns; } }); // 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/router var require_router = __commonJS({ "package-external:@wordpress/router"(exports, module) { module.exports = window.wp.router; } }); // package-external:@wordpress/components var require_components = __commonJS({ "package-external:@wordpress/components"(exports, module) { module.exports = window.wp.components; } }); // vendor-external:react/jsx-runtime var require_jsx_runtime = __commonJS({ "vendor-external:react/jsx-runtime"(exports, module) { module.exports = window.ReactJSXRuntime; } }); // vendor-external:react var require_react = __commonJS({ "vendor-external:react"(exports, module) { module.exports = window.React; } }); // vendor-external:react-dom var require_react_dom = __commonJS({ "vendor-external:react-dom"(exports, module) { module.exports = window.ReactDOM; } }); // node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js var require_use_sync_external_store_shim_development = __commonJS({ "node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js"(exports) { "use strict"; (function() { function is2(x2, y2) { return x2 === y2 && (0 !== x2 || 1 / x2 === 1 / y2) || x2 !== x2 && y2 !== y2; } function useSyncExternalStore$2(subscribe2, getSnapshot) { didWarnOld18Alpha || void 0 === React10.startTransition || (didWarnOld18Alpha = true, console.error( "You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release." )); var value = getSnapshot(); if (!didWarnUncachedGetSnapshot) { var cachedValue = getSnapshot(); objectIs(value, cachedValue) || (console.error( "The result of getSnapshot should be cached to avoid an infinite loop" ), didWarnUncachedGetSnapshot = true); } cachedValue = useState71({ inst: { value, getSnapshot } }); var inst = cachedValue[0].inst, forceUpdate = cachedValue[1]; useLayoutEffect7( function() { inst.value = value; inst.getSnapshot = getSnapshot; checkIfSnapshotChanged(inst) && forceUpdate({ inst }); }, [subscribe2, value, getSnapshot] ); useEffect51( function() { checkIfSnapshotChanged(inst) && forceUpdate({ inst }); return subscribe2(function() { checkIfSnapshotChanged(inst) && forceUpdate({ inst }); }); }, [subscribe2] ); useDebugValue(value); return value; } function checkIfSnapshotChanged(inst) { var latestGetSnapshot = inst.getSnapshot; inst = inst.value; try { var nextValue = latestGetSnapshot(); return !objectIs(inst, nextValue); } catch (error) { return true; } } function useSyncExternalStore$1(subscribe2, getSnapshot) { return getSnapshot(); } "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()); var React10 = require_react(), objectIs = "function" === typeof Object.is ? Object.is : is2, useState71 = React10.useState, useEffect51 = React10.useEffect, useLayoutEffect7 = React10.useLayoutEffect, useDebugValue = React10.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2; exports.useSyncExternalStore = void 0 !== React10.useSyncExternalStore ? React10.useSyncExternalStore : shim; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error()); })(); } }); // node_modules/use-sync-external-store/shim/index.js var require_shim = __commonJS({ "node_modules/use-sync-external-store/shim/index.js"(exports, module) { "use strict"; if (false) { module.exports = null; } else { module.exports = require_use_sync_external_store_shim_development(); } } }); // package-external:@wordpress/a11y var require_a11y = __commonJS({ "package-external:@wordpress/a11y"(exports, module) { module.exports = window.wp.a11y; } }); // package-external:@wordpress/primitives var require_primitives = __commonJS({ "package-external:@wordpress/primitives"(exports, module) { module.exports = window.wp.primitives; } }); // package-external:@wordpress/compose var require_compose = __commonJS({ "package-external:@wordpress/compose"(exports, module) { module.exports = window.wp.compose; } }); // package-external:@wordpress/plugins var require_plugins = __commonJS({ "package-external:@wordpress/plugins"(exports, module) { module.exports = window.wp.plugins; } }); // package-external:@wordpress/notices var require_notices = __commonJS({ "package-external:@wordpress/notices"(exports, module) { module.exports = window.wp.notices; } }); // package-external:@wordpress/html-entities var require_html_entities = __commonJS({ "package-external:@wordpress/html-entities"(exports, module) { module.exports = window.wp.htmlEntities; } }); // package-external:@wordpress/commands var require_commands = __commonJS({ "package-external:@wordpress/commands"(exports, module) { module.exports = window.wp.commands; } }); // package-external:@wordpress/keycodes var require_keycodes = __commonJS({ "package-external:@wordpress/keycodes"(exports, module) { module.exports = window.wp.keycodes; } }); // package-external:@wordpress/url var require_url = __commonJS({ "package-external:@wordpress/url"(exports, module) { module.exports = window.wp.url; } }); // package-external:@wordpress/dom var require_dom = __commonJS({ "package-external:@wordpress/dom"(exports, module) { module.exports = window.wp.dom; } }); // package-external:@wordpress/keyboard-shortcuts var require_keyboard_shortcuts = __commonJS({ "package-external:@wordpress/keyboard-shortcuts"(exports, module) { module.exports = window.wp.keyboardShortcuts; } }); // 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/style-engine var require_style_engine = __commonJS({ "package-external:@wordpress/style-engine"(exports, module) { module.exports = window.wp.styleEngine; } }); // node_modules/fast-deep-equal/es6/index.js var require_es6 = __commonJS({ "node_modules/fast-deep-equal/es6/index.js"(exports, module) { "use strict"; module.exports = function equal(a2, b2) { if (a2 === b2) return true; if (a2 && b2 && typeof a2 == "object" && typeof b2 == "object") { if (a2.constructor !== b2.constructor) return false; var length, i2, keys; if (Array.isArray(a2)) { length = a2.length; if (length != b2.length) return false; for (i2 = length; i2-- !== 0; ) if (!equal(a2[i2], b2[i2])) return false; return true; } if (a2 instanceof Map && b2 instanceof Map) { if (a2.size !== b2.size) return false; for (i2 of a2.entries()) if (!b2.has(i2[0])) return false; for (i2 of a2.entries()) if (!equal(i2[1], b2.get(i2[0]))) return false; return true; } if (a2 instanceof Set && b2 instanceof Set) { if (a2.size !== b2.size) return false; for (i2 of a2.entries()) if (!b2.has(i2[0])) return false; return true; } if (ArrayBuffer.isView(a2) && ArrayBuffer.isView(b2)) { length = a2.length; if (length != b2.length) return false; for (i2 = length; i2-- !== 0; ) if (a2[i2] !== b2[i2]) return false; return true; } if (a2.constructor === RegExp) return a2.source === b2.source && a2.flags === b2.flags; if (a2.valueOf !== Object.prototype.valueOf) return a2.valueOf() === b2.valueOf(); if (a2.toString !== Object.prototype.toString) return a2.toString() === b2.toString(); keys = Object.keys(a2); length = keys.length; if (length !== Object.keys(b2).length) return false; for (i2 = length; i2-- !== 0; ) if (!Object.prototype.hasOwnProperty.call(b2, keys[i2])) return false; for (i2 = length; i2-- !== 0; ) { var key = keys[i2]; if (!equal(a2[key], b2[key])) return false; } return true; } return a2 !== a2 && b2 !== b2; }; } }); // node_modules/deepmerge/dist/cjs.js var require_cjs = __commonJS({ "node_modules/deepmerge/dist/cjs.js"(exports, module) { "use strict"; var isMergeableObject = function isMergeableObject2(value) { return isNonNullObject(value) && !isSpecial(value); }; function isNonNullObject(value) { return !!value && typeof value === "object"; } function isSpecial(value) { var stringValue = Object.prototype.toString.call(value); return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value); } var canUseSymbol = typeof Symbol === "function" && Symbol.for; var REACT_ELEMENT_TYPE = canUseSymbol ? /* @__PURE__ */ Symbol.for("react.element") : 60103; function isReactElement(value) { return value.$$typeof === REACT_ELEMENT_TYPE; } function emptyTarget(val) { return Array.isArray(val) ? [] : {}; } function cloneUnlessOtherwiseSpecified(value, options) { return options.clone !== false && options.isMergeableObject(value) ? deepmerge2(emptyTarget(value), value, options) : value; } function defaultArrayMerge(target, source, options) { return target.concat(source).map(function(element) { return cloneUnlessOtherwiseSpecified(element, options); }); } function getMergeFunction(key, options) { if (!options.customMerge) { return deepmerge2; } var customMerge = options.customMerge(key); return typeof customMerge === "function" ? customMerge : deepmerge2; } function getEnumerableOwnPropertySymbols(target) { return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol3) { return Object.propertyIsEnumerable.call(target, symbol3); }) : []; } function getKeys2(target) { return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target)); } function propertyIsOnObject(object, property) { try { return property in object; } catch (_) { return false; } } function propertyIsUnsafe(target, key) { return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key)); } function mergeObject(target, source, options) { var destination = {}; if (options.isMergeableObject(target)) { getKeys2(target).forEach(function(key) { destination[key] = cloneUnlessOtherwiseSpecified(target[key], options); }); } getKeys2(source).forEach(function(key) { if (propertyIsUnsafe(target, key)) { return; } if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) { destination[key] = getMergeFunction(key, options)(target[key], source[key], options); } else { destination[key] = cloneUnlessOtherwiseSpecified(source[key], options); } }); return destination; } function deepmerge2(target, source, options) { options = options || {}; options.arrayMerge = options.arrayMerge || defaultArrayMerge; options.isMergeableObject = options.isMergeableObject || isMergeableObject; options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified; var sourceIsArray = Array.isArray(source); var targetIsArray = Array.isArray(target); var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray; if (!sourceAndTargetTypesMatch) { return cloneUnlessOtherwiseSpecified(source, options); } else if (sourceIsArray) { return options.arrayMerge(target, source, options); } else { return mergeObject(target, source, options); } } deepmerge2.all = function deepmergeAll(array, options) { if (!Array.isArray(array)) { throw new Error("first argument should be an array"); } return array.reduce(function(prev, next) { return deepmerge2(prev, next, options); }, {}); }; var deepmerge_1 = deepmerge2; module.exports = deepmerge_1; } }); // package-external:@wordpress/date var require_date = __commonJS({ "package-external:@wordpress/date"(exports, module) { module.exports = window.wp.date; } }); // package-external:@wordpress/blob var require_blob = __commonJS({ "package-external:@wordpress/blob"(exports, module) { module.exports = window.wp.blob; } }); // node_modules/remove-accents/index.js var require_remove_accents = __commonJS({ "node_modules/remove-accents/index.js"(exports, module) { var characterMap = { "\xC0": "A", "\xC1": "A", "\xC2": "A", "\xC3": "A", "\xC4": "A", "\xC5": "A", "\u1EA4": "A", "\u1EAE": "A", "\u1EB2": "A", "\u1EB4": "A", "\u1EB6": "A", "\xC6": "AE", "\u1EA6": "A", "\u1EB0": "A", "\u0202": "A", "\u1EA2": "A", "\u1EA0": "A", "\u1EA8": "A", "\u1EAA": "A", "\u1EAC": "A", "\xC7": "C", "\u1E08": "C", "\xC8": "E", "\xC9": "E", "\xCA": "E", "\xCB": "E", "\u1EBE": "E", "\u1E16": "E", "\u1EC0": "E", "\u1E14": "E", "\u1E1C": "E", "\u0206": "E", "\u1EBA": "E", "\u1EBC": "E", "\u1EB8": "E", "\u1EC2": "E", "\u1EC4": "E", "\u1EC6": "E", "\xCC": "I", "\xCD": "I", "\xCE": "I", "\xCF": "I", "\u1E2E": "I", "\u020A": "I", "\u1EC8": "I", "\u1ECA": "I", "\xD0": "D", "\xD1": "N", "\xD2": "O", "\xD3": "O", "\xD4": "O", "\xD5": "O", "\xD6": "O", "\xD8": "O", "\u1ED0": "O", "\u1E4C": "O", "\u1E52": "O", "\u020E": "O", "\u1ECE": "O", "\u1ECC": "O", "\u1ED4": "O", "\u1ED6": "O", "\u1ED8": "O", "\u1EDC": "O", "\u1EDE": "O", "\u1EE0": "O", "\u1EDA": "O", "\u1EE2": "O", "\xD9": "U", "\xDA": "U", "\xDB": "U", "\xDC": "U", "\u1EE6": "U", "\u1EE4": "U", "\u1EEC": "U", "\u1EEE": "U", "\u1EF0": "U", "\xDD": "Y", "\xE0": "a", "\xE1": "a", "\xE2": "a", "\xE3": "a", "\xE4": "a", "\xE5": "a", "\u1EA5": "a", "\u1EAF": "a", "\u1EB3": "a", "\u1EB5": "a", "\u1EB7": "a", "\xE6": "ae", "\u1EA7": "a", "\u1EB1": "a", "\u0203": "a", "\u1EA3": "a", "\u1EA1": "a", "\u1EA9": "a", "\u1EAB": "a", "\u1EAD": "a", "\xE7": "c", "\u1E09": "c", "\xE8": "e", "\xE9": "e", "\xEA": "e", "\xEB": "e", "\u1EBF": "e", "\u1E17": "e", "\u1EC1": "e", "\u1E15": "e", "\u1E1D": "e", "\u0207": "e", "\u1EBB": "e", "\u1EBD": "e", "\u1EB9": "e", "\u1EC3": "e", "\u1EC5": "e", "\u1EC7": "e", "\xEC": "i", "\xED": "i", "\xEE": "i", "\xEF": "i", "\u1E2F": "i", "\u020B": "i", "\u1EC9": "i", "\u1ECB": "i", "\xF0": "d", "\xF1": "n", "\xF2": "o", "\xF3": "o", "\xF4": "o", "\xF5": "o", "\xF6": "o", "\xF8": "o", "\u1ED1": "o", "\u1E4D": "o", "\u1E53": "o", "\u020F": "o", "\u1ECF": "o", "\u1ECD": "o", "\u1ED5": "o", "\u1ED7": "o", "\u1ED9": "o", "\u1EDD": "o", "\u1EDF": "o", "\u1EE1": "o", "\u1EDB": "o", "\u1EE3": "o", "\xF9": "u", "\xFA": "u", "\xFB": "u", "\xFC": "u", "\u1EE7": "u", "\u1EE5": "u", "\u1EED": "u", "\u1EEF": "u", "\u1EF1": "u", "\xFD": "y", "\xFF": "y", "\u0100": "A", "\u0101": "a", "\u0102": "A", "\u0103": "a", "\u0104": "A", "\u0105": "a", "\u0106": "C", "\u0107": "c", "\u0108": "C", "\u0109": "c", "\u010A": "C", "\u010B": "c", "\u010C": "C", "\u010D": "c", "C\u0306": "C", "c\u0306": "c", "\u010E": "D", "\u010F": "d", "\u0110": "D", "\u0111": "d", "\u0112": "E", "\u0113": "e", "\u0114": "E", "\u0115": "e", "\u0116": "E", "\u0117": "e", "\u0118": "E", "\u0119": "e", "\u011A": "E", "\u011B": "e", "\u011C": "G", "\u01F4": "G", "\u011D": "g", "\u01F5": "g", "\u011E": "G", "\u011F": "g", "\u0120": "G", "\u0121": "g", "\u0122": "G", "\u0123": "g", "\u0124": "H", "\u0125": "h", "\u0126": "H", "\u0127": "h", "\u1E2A": "H", "\u1E2B": "h", "\u0128": "I", "\u0129": "i", "\u012A": "I", "\u012B": "i", "\u012C": "I", "\u012D": "i", "\u012E": "I", "\u012F": "i", "\u0130": "I", "\u0131": "i", "\u0132": "IJ", "\u0133": "ij", "\u0134": "J", "\u0135": "j", "\u0136": "K", "\u0137": "k", "\u1E30": "K", "\u1E31": "k", "K\u0306": "K", "k\u0306": "k", "\u0139": "L", "\u013A": "l", "\u013B": "L", "\u013C": "l", "\u013D": "L", "\u013E": "l", "\u013F": "L", "\u0140": "l", "\u0141": "l", "\u0142": "l", "\u1E3E": "M", "\u1E3F": "m", "M\u0306": "M", "m\u0306": "m", "\u0143": "N", "\u0144": "n", "\u0145": "N", "\u0146": "n", "\u0147": "N", "\u0148": "n", "\u0149": "n", "N\u0306": "N", "n\u0306": "n", "\u014C": "O", "\u014D": "o", "\u014E": "O", "\u014F": "o", "\u0150": "O", "\u0151": "o", "\u0152": "OE", "\u0153": "oe", "P\u0306": "P", "p\u0306": "p", "\u0154": "R", "\u0155": "r", "\u0156": "R", "\u0157": "r", "\u0158": "R", "\u0159": "r", "R\u0306": "R", "r\u0306": "r", "\u0212": "R", "\u0213": "r", "\u015A": "S", "\u015B": "s", "\u015C": "S", "\u015D": "s", "\u015E": "S", "\u0218": "S", "\u0219": "s", "\u015F": "s", "\u0160": "S", "\u0161": "s", "\u0162": "T", "\u0163": "t", "\u021B": "t", "\u021A": "T", "\u0164": "T", "\u0165": "t", "\u0166": "T", "\u0167": "t", "T\u0306": "T", "t\u0306": "t", "\u0168": "U", "\u0169": "u", "\u016A": "U", "\u016B": "u", "\u016C": "U", "\u016D": "u", "\u016E": "U", "\u016F": "u", "\u0170": "U", "\u0171": "u", "\u0172": "U", "\u0173": "u", "\u0216": "U", "\u0217": "u", "V\u0306": "V", "v\u0306": "v", "\u0174": "W", "\u0175": "w", "\u1E82": "W", "\u1E83": "w", "X\u0306": "X", "x\u0306": "x", "\u0176": "Y", "\u0177": "y", "\u0178": "Y", "Y\u0306": "Y", "y\u0306": "y", "\u0179": "Z", "\u017A": "z", "\u017B": "Z", "\u017C": "z", "\u017D": "Z", "\u017E": "z", "\u017F": "s", "\u0192": "f", "\u01A0": "O", "\u01A1": "o", "\u01AF": "U", "\u01B0": "u", "\u01CD": "A", "\u01CE": "a", "\u01CF": "I", "\u01D0": "i", "\u01D1": "O", "\u01D2": "o", "\u01D3": "U", "\u01D4": "u", "\u01D5": "U", "\u01D6": "u", "\u01D7": "U", "\u01D8": "u", "\u01D9": "U", "\u01DA": "u", "\u01DB": "U", "\u01DC": "u", "\u1EE8": "U", "\u1EE9": "u", "\u1E78": "U", "\u1E79": "u", "\u01FA": "A", "\u01FB": "a", "\u01FC": "AE", "\u01FD": "ae", "\u01FE": "O", "\u01FF": "o", "\xDE": "TH", "\xFE": "th", "\u1E54": "P", "\u1E55": "p", "\u1E64": "S", "\u1E65": "s", "X\u0301": "X", "x\u0301": "x", "\u0403": "\u0413", "\u0453": "\u0433", "\u040C": "\u041A", "\u045C": "\u043A", "A\u030B": "A", "a\u030B": "a", "E\u030B": "E", "e\u030B": "e", "I\u030B": "I", "i\u030B": "i", "\u01F8": "N", "\u01F9": "n", "\u1ED2": "O", "\u1ED3": "o", "\u1E50": "O", "\u1E51": "o", "\u1EEA": "U", "\u1EEB": "u", "\u1E80": "W", "\u1E81": "w", "\u1EF2": "Y", "\u1EF3": "y", "\u0200": "A", "\u0201": "a", "\u0204": "E", "\u0205": "e", "\u0208": "I", "\u0209": "i", "\u020C": "O", "\u020D": "o", "\u0210": "R", "\u0211": "r", "\u0214": "U", "\u0215": "u", "B\u030C": "B", "b\u030C": "b", "\u010C\u0323": "C", "\u010D\u0323": "c", "\xCA\u030C": "E", "\xEA\u030C": "e", "F\u030C": "F", "f\u030C": "f", "\u01E6": "G", "\u01E7": "g", "\u021E": "H", "\u021F": "h", "J\u030C": "J", "\u01F0": "j", "\u01E8": "K", "\u01E9": "k", "M\u030C": "M", "m\u030C": "m", "P\u030C": "P", "p\u030C": "p", "Q\u030C": "Q", "q\u030C": "q", "\u0158\u0329": "R", "\u0159\u0329": "r", "\u1E66": "S", "\u1E67": "s", "V\u030C": "V", "v\u030C": "v", "W\u030C": "W", "w\u030C": "w", "X\u030C": "X", "x\u030C": "x", "Y\u030C": "Y", "y\u030C": "y", "A\u0327": "A", "a\u0327": "a", "B\u0327": "B", "b\u0327": "b", "\u1E10": "D", "\u1E11": "d", "\u0228": "E", "\u0229": "e", "\u0190\u0327": "E", "\u025B\u0327": "e", "\u1E28": "H", "\u1E29": "h", "I\u0327": "I", "i\u0327": "i", "\u0197\u0327": "I", "\u0268\u0327": "i", "M\u0327": "M", "m\u0327": "m", "O\u0327": "O", "o\u0327": "o", "Q\u0327": "Q", "q\u0327": "q", "U\u0327": "U", "u\u0327": "u", "X\u0327": "X", "x\u0327": "x", "Z\u0327": "Z", "z\u0327": "z", "\u0439": "\u0438", "\u0419": "\u0418", "\u0451": "\u0435", "\u0401": "\u0415" }; var chars = Object.keys(characterMap).join("|"); var allAccents = new RegExp(chars, "g"); var firstAccent = new RegExp(chars, ""); function matcher(match3) { return characterMap[match3]; } var removeAccents3 = function(string) { return string.replace(allAccents, matcher); }; var hasAccents = function(string) { return !!string.match(firstAccent); }; module.exports = removeAccents3; module.exports.has = hasAccents; module.exports.remove = removeAccents3; } }); // package-external:@wordpress/warning var require_warning = __commonJS({ "package-external:@wordpress/warning"(exports, module) { module.exports = window.wp.warning; } }); // packages/edit-site/build-module/index.mjs var index_exports = {}; __export(index_exports, { PluginMoreMenuItem: () => PluginMoreMenuItem, PluginSidebar: () => PluginSidebar, PluginSidebarMoreMenuItem: () => PluginSidebarMoreMenuItem, PluginTemplateSettingPanel: () => plugin_template_setting_panel_default, initializeEditor: () => initializeEditor, reinitializeEditor: () => reinitializeEditor, store: () => store }); var import_blocks15 = __toESM(require_blocks(), 1); var import_block_library3 = __toESM(require_block_library(), 1); var import_data84 = __toESM(require_data(), 1); var import_deprecated6 = __toESM(require_deprecated(), 1); var import_element162 = __toESM(require_element(), 1); var import_editor46 = __toESM(require_editor(), 1); var import_preferences13 = __toESM(require_preferences(), 1); var import_widgets = __toESM(require_widgets(), 1); // packages/edit-site/build-module/store/index.mjs var import_data3 = __toESM(require_data(), 1); // packages/edit-site/build-module/store/reducer.mjs var import_data = __toESM(require_data(), 1); function settings(state = {}, action) { switch (action.type) { case "UPDATE_SETTINGS": return { ...state, ...action.settings }; } return state; } function editedPost(state = {}, action) { switch (action.type) { case "SET_EDITED_POST": return { postType: action.postType, id: action.id, context: action.context }; case "SET_EDITED_POST_CONTEXT": return { ...state, context: action.context }; } return state; } function saveViewPanel(state = false, action) { switch (action.type) { case "SET_IS_SAVE_VIEW_OPENED": return action.isOpen; } return state; } function routes(state = [], action) { switch (action.type) { case "REGISTER_ROUTE": return [...state, action.route]; case "UNREGISTER_ROUTE": return state.filter((route) => route.name !== action.name); } return state; } var reducer_default = (0, import_data.combineReducers)({ settings, editedPost, saveViewPanel, routes }); // packages/edit-site/build-module/store/actions.mjs var actions_exports = {}; __export(actions_exports, { __experimentalSetPreviewDeviceType: () => __experimentalSetPreviewDeviceType, addTemplate: () => addTemplate, closeGeneralSidebar: () => closeGeneralSidebar, openGeneralSidebar: () => openGeneralSidebar, openNavigationPanelToMenu: () => openNavigationPanelToMenu, removeTemplate: () => removeTemplate, revertTemplate: () => revertTemplate, setEditedEntity: () => setEditedEntity, setEditedPostContext: () => setEditedPostContext, setHasPageContentFocus: () => setHasPageContentFocus, setHomeTemplateId: () => setHomeTemplateId, setIsInserterOpened: () => setIsInserterOpened, setIsListViewOpened: () => setIsListViewOpened, setIsNavigationPanelOpened: () => setIsNavigationPanelOpened, setIsSaveViewOpened: () => setIsSaveViewOpened, setNavigationMenu: () => setNavigationMenu, setNavigationPanelActiveMenu: () => setNavigationPanelActiveMenu, setPage: () => setPage, setTemplate: () => setTemplate, setTemplatePart: () => setTemplatePart, switchEditorMode: () => switchEditorMode, toggleDistractionFree: () => toggleDistractionFree, toggleFeature: () => toggleFeature, updateSettings: () => updateSettings }); var import_blocks = __toESM(require_blocks(), 1); var import_deprecated = __toESM(require_deprecated(), 1); var import_core_data = __toESM(require_core_data(), 1); var import_block_editor = __toESM(require_block_editor(), 1); var import_editor = __toESM(require_editor(), 1); var import_preferences = __toESM(require_preferences(), 1); // packages/edit-site/build-module/utils/constants.mjs var import_i18n = __toESM(require_i18n(), 1); var import_patterns = __toESM(require_patterns(), 1); // packages/edit-site/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/edit-site" ); // packages/edit-site/build-module/utils/constants.mjs var ATTACHMENT_POST_TYPE = "attachment"; var NAVIGATION_POST_TYPE = "wp_navigation"; var TEMPLATE_POST_TYPE = "wp_template"; var TEMPLATE_PART_POST_TYPE = "wp_template_part"; var TEMPLATE_ORIGINS = { custom: "custom", theme: "theme", plugin: "plugin" }; var TEMPLATE_PART_AREA_DEFAULT_CATEGORY = "uncategorized"; var TEMPLATE_PART_ALL_AREAS_CATEGORY = "all-parts"; var { PATTERN_TYPES, PATTERN_DEFAULT_CATEGORY, PATTERN_USER_CATEGORY, EXCLUDED_PATTERN_SOURCES, PATTERN_SYNC_TYPES } = unlock(import_patterns.privateApis); var FOCUSABLE_ENTITIES = [ TEMPLATE_PART_POST_TYPE, NAVIGATION_POST_TYPE, PATTERN_TYPES.user ]; var POST_TYPE_LABELS = { [TEMPLATE_POST_TYPE]: (0, import_i18n.__)("Template"), [TEMPLATE_PART_POST_TYPE]: (0, import_i18n.__)("Template part"), [PATTERN_TYPES.user]: (0, import_i18n.__)("Pattern"), [NAVIGATION_POST_TYPE]: (0, import_i18n.__)("Navigation") }; var LAYOUT_GRID = "grid"; var LAYOUT_TABLE = "table"; var LAYOUT_LIST = "list"; var OPERATOR_IS = "is"; var OPERATOR_IS_ANY = "isAny"; var OPERATOR_IS_NONE = "isNone"; var OPERATOR_BEFORE = "before"; var OPERATOR_AFTER = "after"; // packages/edit-site/build-module/store/actions.mjs var { interfaceStore } = unlock(import_editor.privateApis); function toggleFeature(featureName) { return function({ registry }) { (0, import_deprecated.default)( "dispatch( 'core/edit-site' ).toggleFeature( featureName )", { since: "6.0", alternative: "dispatch( 'core/preferences').toggle( 'core/edit-site', featureName )" } ); registry.dispatch(import_preferences.store).toggle("core/edit-site", featureName); }; } var __experimentalSetPreviewDeviceType = (deviceType) => ({ registry }) => { (0, import_deprecated.default)( "dispatch( 'core/edit-site' ).__experimentalSetPreviewDeviceType", { since: "6.5", version: "6.7", hint: "registry.dispatch( editorStore ).setDeviceType" } ); registry.dispatch(import_editor.store).setDeviceType(deviceType); }; function setTemplate() { (0, import_deprecated.default)("dispatch( 'core/edit-site' ).setTemplate", { since: "6.5", version: "6.8", hint: "The setTemplate is not needed anymore, the correct entity is resolved from the URL automatically." }); return { type: "NOTHING" }; } var addTemplate = (template) => async ({ dispatch: dispatch2, registry }) => { (0, import_deprecated.default)("dispatch( 'core/edit-site' ).addTemplate", { since: "6.5", version: "6.8", hint: "use saveEntityRecord directly" }); const newTemplate = await registry.dispatch(import_core_data.store).saveEntityRecord("postType", TEMPLATE_POST_TYPE, template); if (template.content) { registry.dispatch(import_core_data.store).editEntityRecord( "postType", TEMPLATE_POST_TYPE, newTemplate.id, { blocks: (0, import_blocks.parse)(template.content) }, { undoIgnore: true } ); } dispatch2({ type: "SET_EDITED_POST", postType: TEMPLATE_POST_TYPE, id: newTemplate.id }); }; var removeTemplate = (template) => ({ registry }) => { return unlock(registry.dispatch(import_editor.store)).removeTemplates([ template ]); }; function setTemplatePart(templatePartId) { (0, import_deprecated.default)("dispatch( 'core/edit-site' ).setTemplatePart", { since: "6.8" }); return { type: "SET_EDITED_POST", postType: TEMPLATE_PART_POST_TYPE, id: templatePartId }; } function setNavigationMenu(navigationMenuId) { (0, import_deprecated.default)("dispatch( 'core/edit-site' ).setNavigationMenu", { since: "6.8" }); return { type: "SET_EDITED_POST", postType: NAVIGATION_POST_TYPE, id: navigationMenuId }; } function setEditedEntity(postType2, postId, context) { return { type: "SET_EDITED_POST", postType: postType2, id: postId, context }; } function setHomeTemplateId() { (0, import_deprecated.default)("dispatch( 'core/edit-site' ).setHomeTemplateId", { since: "6.2", version: "6.4" }); return { type: "NOTHING" }; } function setEditedPostContext(context) { (0, import_deprecated.default)("dispatch( 'core/edit-site' ).setEditedPostContext", { since: "6.8" }); return { type: "SET_EDITED_POST_CONTEXT", context }; } function setPage() { (0, import_deprecated.default)("dispatch( 'core/edit-site' ).setPage", { since: "6.5", version: "6.8", hint: "The setPage is not needed anymore, the correct entity is resolved from the URL automatically." }); return { type: "NOTHING" }; } function setNavigationPanelActiveMenu() { (0, import_deprecated.default)("dispatch( 'core/edit-site' ).setNavigationPanelActiveMenu", { since: "6.2", version: "6.4" }); return { type: "NOTHING" }; } function openNavigationPanelToMenu() { (0, import_deprecated.default)("dispatch( 'core/edit-site' ).openNavigationPanelToMenu", { since: "6.2", version: "6.4" }); return { type: "NOTHING" }; } function setIsNavigationPanelOpened() { (0, import_deprecated.default)("dispatch( 'core/edit-site' ).setIsNavigationPanelOpened", { since: "6.2", version: "6.4" }); return { type: "NOTHING" }; } var setIsInserterOpened = (value) => ({ registry }) => { (0, import_deprecated.default)("dispatch( 'core/edit-site' ).setIsInserterOpened", { since: "6.5", alternative: "dispatch( 'core/editor').setIsInserterOpened" }); registry.dispatch(import_editor.store).setIsInserterOpened(value); }; var setIsListViewOpened = (isOpen) => ({ registry }) => { (0, import_deprecated.default)("dispatch( 'core/edit-site' ).setIsListViewOpened", { since: "6.5", alternative: "dispatch( 'core/editor').setIsListViewOpened" }); registry.dispatch(import_editor.store).setIsListViewOpened(isOpen); }; function updateSettings(settings2) { return { type: "UPDATE_SETTINGS", settings: settings2 }; } function setIsSaveViewOpened(isOpen) { return { type: "SET_IS_SAVE_VIEW_OPENED", isOpen }; } var revertTemplate = (template, options) => ({ registry }) => { return unlock(registry.dispatch(import_editor.store)).revertTemplate( template, options ); }; var openGeneralSidebar = (name2) => ({ registry }) => { registry.dispatch(interfaceStore).enableComplementaryArea("core", name2); }; var closeGeneralSidebar = () => ({ registry }) => { registry.dispatch(interfaceStore).disableComplementaryArea("core"); }; var switchEditorMode = (mode) => ({ registry }) => { (0, import_deprecated.default)("dispatch( 'core/edit-site' ).switchEditorMode", { since: "6.6", alternative: "dispatch( 'core/editor').switchEditorMode" }); registry.dispatch(import_editor.store).switchEditorMode(mode); }; var setHasPageContentFocus = (hasPageContentFocus2) => ({ dispatch: dispatch2, registry }) => { (0, import_deprecated.default)(`dispatch( 'core/edit-site' ).setHasPageContentFocus`, { since: "6.5" }); if (hasPageContentFocus2) { registry.dispatch(import_block_editor.store).clearSelectedBlock(); } dispatch2({ type: "SET_HAS_PAGE_CONTENT_FOCUS", hasPageContentFocus: hasPageContentFocus2 }); }; var toggleDistractionFree = () => ({ registry }) => { (0, import_deprecated.default)("dispatch( 'core/edit-site' ).toggleDistractionFree", { since: "6.6", alternative: "dispatch( 'core/editor').toggleDistractionFree" }); registry.dispatch(import_editor.store).toggleDistractionFree(); }; // packages/edit-site/build-module/store/private-actions.mjs var private_actions_exports = {}; __export(private_actions_exports, { registerRoute: () => registerRoute, unregisterRoute: () => unregisterRoute }); function registerRoute(route) { return { type: "REGISTER_ROUTE", route }; } function unregisterRoute(name2) { return { type: "UNREGISTER_ROUTE", name: name2 }; } // packages/edit-site/build-module/store/selectors.mjs var selectors_exports = {}; __export(selectors_exports, { __experimentalGetInsertionPoint: () => __experimentalGetInsertionPoint, __experimentalGetPreviewDeviceType: () => __experimentalGetPreviewDeviceType, getCanUserCreateMedia: () => getCanUserCreateMedia, getCurrentTemplateNavigationPanelSubMenu: () => getCurrentTemplateNavigationPanelSubMenu, getCurrentTemplateTemplateParts: () => getCurrentTemplateTemplateParts, getEditedPostContext: () => getEditedPostContext, getEditedPostId: () => getEditedPostId, getEditedPostType: () => getEditedPostType, getEditorMode: () => getEditorMode, getHomeTemplateId: () => getHomeTemplateId, getNavigationPanelActiveMenu: () => getNavigationPanelActiveMenu, getPage: () => getPage, getReusableBlocks: () => getReusableBlocks, getSettings: () => getSettings, hasPageContentFocus: () => hasPageContentFocus, isFeatureActive: () => isFeatureActive, isInserterOpened: () => isInserterOpened, isListViewOpened: () => isListViewOpened, isNavigationOpened: () => isNavigationOpened, isPage: () => isPage, isSaveViewOpened: () => isSaveViewOpened }); var import_core_data2 = __toESM(require_core_data(), 1); var import_data2 = __toESM(require_data(), 1); var import_deprecated2 = __toESM(require_deprecated(), 1); var import_element = __toESM(require_element(), 1); var import_preferences2 = __toESM(require_preferences(), 1); var import_editor2 = __toESM(require_editor(), 1); var import_block_editor2 = __toESM(require_block_editor(), 1); // packages/edit-site/build-module/utils/get-filtered-template-parts.mjs var import_blocks2 = __toESM(require_blocks(), 1); var EMPTY_ARRAY = []; function getFilteredTemplatePartBlocks(blocks = EMPTY_ARRAY, templateParts) { const templatePartsById = templateParts ? ( // Key template parts by their ID. templateParts.reduce( (newTemplateParts, part) => ({ ...newTemplateParts, [part.id]: part }), {} ) ) : {}; const result = []; const stack = [...blocks]; while (stack.length) { const { innerBlocks, ...block } = stack.shift(); stack.unshift(...innerBlocks); if ((0, import_blocks2.isTemplatePart)(block)) { const { attributes: { theme, slug } } = block; const templatePartId = `${theme}//${slug}`; const templatePart = templatePartsById[templatePartId]; if (templatePart) { result.push({ templatePart, block }); } } } return result; } // packages/edit-site/build-module/store/selectors.mjs var isFeatureActive = (0, import_data2.createRegistrySelector)( (select3) => (_, featureName) => { (0, import_deprecated2.default)(`select( 'core/edit-site' ).isFeatureActive`, { since: "6.0", alternative: `select( 'core/preferences' ).get` }); return !!select3(import_preferences2.store).get( "core/edit-site", featureName ); } ); var __experimentalGetPreviewDeviceType = (0, import_data2.createRegistrySelector)( (select3) => () => { (0, import_deprecated2.default)( `select( 'core/edit-site' ).__experimentalGetPreviewDeviceType`, { since: "6.5", version: "6.7", alternative: `select( 'core/editor' ).getDeviceType` } ); return select3(import_editor2.store).getDeviceType(); } ); var getCanUserCreateMedia = (0, import_data2.createRegistrySelector)( (select3) => () => { (0, import_deprecated2.default)( `wp.data.select( 'core/edit-site' ).getCanUserCreateMedia()`, { since: "6.7", alternative: `wp.data.select( 'core' ).canUser( 'create', { kind: 'postType', type: 'attachment' } )` } ); return select3(import_core_data2.store).canUser("create", "media"); } ); var getReusableBlocks = (0, import_data2.createRegistrySelector)((select3) => () => { (0, import_deprecated2.default)(`select( 'core/edit-site' ).getReusableBlocks()`, { since: "6.5", version: "6.8", alternative: `select( 'core/core' ).getEntityRecords( 'postType', 'wp_block' )` }); const isWeb = import_element.Platform.OS === "web"; return isWeb ? select3(import_core_data2.store).getEntityRecords("postType", "wp_block", { per_page: -1 }) : []; }); function getSettings(state) { return state.settings; } function getHomeTemplateId() { (0, import_deprecated2.default)("select( 'core/edit-site' ).getHomeTemplateId", { since: "6.2", version: "6.4" }); } function getEditedPostType(state) { (0, import_deprecated2.default)("select( 'core/edit-site' ).getEditedPostType", { since: "6.8", alternative: "select( 'core/editor' ).getCurrentPostType" }); return state.editedPost.postType; } function getEditedPostId(state) { (0, import_deprecated2.default)("select( 'core/edit-site' ).getEditedPostId", { since: "6.8", alternative: "select( 'core/editor' ).getCurrentPostId" }); return state.editedPost.id; } function getEditedPostContext(state) { (0, import_deprecated2.default)("select( 'core/edit-site' ).getEditedPostContext", { since: "6.8" }); return state.editedPost.context; } function getPage(state) { (0, import_deprecated2.default)("select( 'core/edit-site' ).getPage", { since: "6.8" }); return { context: state.editedPost.context }; } var isInserterOpened = (0, import_data2.createRegistrySelector)((select3) => () => { (0, import_deprecated2.default)(`select( 'core/edit-site' ).isInserterOpened`, { since: "6.5", alternative: `select( 'core/editor' ).isInserterOpened` }); return select3(import_editor2.store).isInserterOpened(); }); var __experimentalGetInsertionPoint = (0, import_data2.createRegistrySelector)( (select3) => () => { (0, import_deprecated2.default)( `select( 'core/edit-site' ).__experimentalGetInsertionPoint`, { since: "6.5", version: "6.7" } ); return unlock(select3(import_editor2.store)).getInserter(); } ); var isListViewOpened = (0, import_data2.createRegistrySelector)((select3) => () => { (0, import_deprecated2.default)(`select( 'core/edit-site' ).isListViewOpened`, { since: "6.5", alternative: `select( 'core/editor' ).isListViewOpened` }); return select3(import_editor2.store).isListViewOpened(); }); function isSaveViewOpened(state) { return state.saveViewPanel; } function getBlocksAndTemplateParts(select3) { const templateParts = select3(import_core_data2.store).getEntityRecords( "postType", TEMPLATE_PART_POST_TYPE, { per_page: -1 } ); const { getBlocksByName, getBlocksByClientId } = select3(import_block_editor2.store); const clientIds = getBlocksByName("core/template-part"); const blocks = getBlocksByClientId(clientIds); return [blocks, templateParts]; } var getCurrentTemplateTemplateParts = (0, import_data2.createRegistrySelector)( (select3) => (0, import_data2.createSelector)( () => { (0, import_deprecated2.default)( `select( 'core/edit-site' ).getCurrentTemplateTemplateParts()`, { since: "6.7", version: "6.9", alternative: `select( 'core/block-editor' ).getBlocksByName( 'core/template-part' )` } ); return getFilteredTemplatePartBlocks( ...getBlocksAndTemplateParts(select3) ); }, () => getBlocksAndTemplateParts(select3) ) ); var getEditorMode = (0, import_data2.createRegistrySelector)((select3) => () => { return select3(import_preferences2.store).get("core", "editorMode"); }); function getCurrentTemplateNavigationPanelSubMenu() { (0, import_deprecated2.default)( "dispatch( 'core/edit-site' ).getCurrentTemplateNavigationPanelSubMenu", { since: "6.2", version: "6.4" } ); } function getNavigationPanelActiveMenu() { (0, import_deprecated2.default)("dispatch( 'core/edit-site' ).getNavigationPanelActiveMenu", { since: "6.2", version: "6.4" }); } function isNavigationOpened() { (0, import_deprecated2.default)("dispatch( 'core/edit-site' ).isNavigationOpened", { since: "6.2", version: "6.4" }); } function isPage(state) { (0, import_deprecated2.default)("select( 'core/edit-site' ).isPage", { since: "6.8", alternative: "select( 'core/editor' ).getCurrentPostType" }); return !!state.editedPost.context?.postId; } function hasPageContentFocus() { (0, import_deprecated2.default)(`select( 'core/edit-site' ).hasPageContentFocus`, { since: "6.5" }); return false; } // packages/edit-site/build-module/store/private-selectors.mjs var private_selectors_exports = {}; __export(private_selectors_exports, { getRoutes: () => getRoutes }); function getRoutes(state) { return state.routes; } // packages/edit-site/build-module/store/constants.mjs var STORE_NAME = "core/edit-site"; // packages/edit-site/build-module/store/index.mjs var storeConfig = { reducer: reducer_default, actions: actions_exports, selectors: selectors_exports }; var store = (0, import_data3.createReduxStore)(STORE_NAME, storeConfig); (0, import_data3.register)(store); unlock(store).registerPrivateSelectors(private_selectors_exports); unlock(store).registerPrivateActions(private_actions_exports); // packages/edit-site/build-module/components/app/index.mjs var import_data83 = __toESM(require_data(), 1); var import_router42 = __toESM(require_router(), 1); var import_element161 = __toESM(require_element(), 1); var import_core_data65 = __toESM(require_core_data(), 1); // node_modules/clsx/dist/clsx.mjs function r(e2) { var t3, f2, n2 = ""; if ("string" == typeof e2 || "number" == typeof e2) n2 += e2; else if ("object" == typeof e2) if (Array.isArray(e2)) { var o3 = e2.length; for (t3 = 0; t3 < o3; t3++) e2[t3] && (f2 = r(e2[t3])) && (n2 && (n2 += " "), n2 += f2); } else for (f2 in e2) e2[f2] && (n2 && (n2 += " "), n2 += f2); return n2; } function clsx() { for (var e2, t3, f2 = 0, n2 = "", o3 = arguments.length; f2 < o3; f2++) (e2 = arguments[f2]) && (t3 = r(e2)) && (n2 && (n2 += " "), n2 += t3); return n2; } var clsx_default = clsx; // packages/admin-ui/build-module/navigable-region/index.mjs var import_element2 = __toESM(require_element(), 1); var import_jsx_runtime = __toESM(require_jsx_runtime(), 1); var NavigableRegion = (0, import_element2.forwardRef)( ({ children, className, ariaLabel, as: Tag = "div", ...props }, ref) => { return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( Tag, { ref, className: clsx_default("admin-ui-navigable-region", className), "aria-label": ariaLabel, role: "region", tabIndex: "-1", ...props, children } ); } ); NavigableRegion.displayName = "NavigableRegion"; var navigable_region_default = NavigableRegion; // node_modules/@base-ui/utils/esm/useRefWithInit.js var React = __toESM(require_react(), 1); var UNINITIALIZED = {}; function useRefWithInit(init2, initArg) { const ref = React.useRef(UNINITIALIZED); if (ref.current === UNINITIALIZED) { ref.current = init2(initArg); } return ref; } // node_modules/@base-ui/react/esm/utils/useRenderElement.js var React4 = __toESM(require_react(), 1); // node_modules/@base-ui/utils/esm/useMergedRefs.js function useMergedRefs(a2, b2, c6, d2) { const forkRef = useRefWithInit(createForkRef).current; if (didChange(forkRef, a2, b2, c6, d2)) { update(forkRef, [a2, b2, c6, d2]); } return forkRef.callback; } function useMergedRefsN(refs) { const forkRef = useRefWithInit(createForkRef).current; if (didChangeN(forkRef, refs)) { update(forkRef, refs); } return forkRef.callback; } function createForkRef() { return { callback: null, cleanup: null, refs: [] }; } function didChange(forkRef, a2, b2, c6, d2) { return forkRef.refs[0] !== a2 || forkRef.refs[1] !== b2 || forkRef.refs[2] !== c6 || forkRef.refs[3] !== d2; } function didChangeN(forkRef, newRefs) { return forkRef.refs.length !== newRefs.length || forkRef.refs.some((ref, index) => ref !== newRefs[index]); } function update(forkRef, refs) { forkRef.refs = refs; if (refs.every((ref) => ref == null)) { forkRef.callback = null; return; } forkRef.callback = (instance) => { if (forkRef.cleanup) { forkRef.cleanup(); forkRef.cleanup = null; } if (instance != null) { const cleanupCallbacks = Array(refs.length).fill(null); for (let i2 = 0; i2 < refs.length; i2 += 1) { const ref = refs[i2]; if (ref == null) { continue; } switch (typeof ref) { case "function": { const refCleanup = ref(instance); if (typeof refCleanup === "function") { cleanupCallbacks[i2] = refCleanup; } break; } case "object": { ref.current = instance; break; } default: } } forkRef.cleanup = () => { for (let i2 = 0; i2 < refs.length; i2 += 1) { const ref = refs[i2]; if (ref == null) { continue; } switch (typeof ref) { case "function": { const cleanupCallback = cleanupCallbacks[i2]; if (typeof cleanupCallback === "function") { cleanupCallback(); } else { ref(null); } break; } case "object": { ref.current = null; break; } default: } } }; } }; } // node_modules/@base-ui/utils/esm/getReactElementRef.js var React3 = __toESM(require_react(), 1); // node_modules/@base-ui/utils/esm/reactVersion.js var React2 = __toESM(require_react(), 1); var majorVersion = parseInt(React2.version, 10); function isReactVersionAtLeast(reactVersionToCheck) { return majorVersion >= reactVersionToCheck; } // node_modules/@base-ui/utils/esm/getReactElementRef.js function getReactElementRef(element) { if (!/* @__PURE__ */ React3.isValidElement(element)) { return null; } const reactElement = element; const propsWithRef = reactElement.props; return (isReactVersionAtLeast(19) ? propsWithRef?.ref : reactElement.ref) ?? null; } // node_modules/@base-ui/utils/esm/mergeObjects.js function mergeObjects(a2, b2) { if (a2 && !b2) { return a2; } if (!a2 && b2) { return b2; } if (a2 || b2) { return { ...a2, ...b2 }; } return void 0; } // node_modules/@base-ui/react/esm/utils/getStateAttributesProps.js function getStateAttributesProps(state, customMapping) { const props = {}; for (const key in state) { const value = state[key]; if (customMapping?.hasOwnProperty(key)) { const customProps = customMapping[key](value); if (customProps != null) { Object.assign(props, customProps); } continue; } if (value === true) { props[`data-${key.toLowerCase()}`] = ""; } else if (value) { props[`data-${key.toLowerCase()}`] = value.toString(); } } return props; } // node_modules/@base-ui/react/esm/utils/resolveClassName.js function resolveClassName(className, state) { return typeof className === "function" ? className(state) : className; } // node_modules/@base-ui/react/esm/utils/resolveStyle.js function resolveStyle(style, state) { return typeof style === "function" ? style(state) : style; } // node_modules/@base-ui/react/esm/merge-props/mergeProps.js var EMPTY_PROPS = {}; function mergeProps(a2, b2, c6, d2, e2) { let merged = { ...resolvePropsGetter(a2, EMPTY_PROPS) }; if (b2) { merged = mergeOne(merged, b2); } if (c6) { merged = mergeOne(merged, c6); } if (d2) { merged = mergeOne(merged, d2); } if (e2) { merged = mergeOne(merged, e2); } return merged; } function mergePropsN(props) { if (props.length === 0) { return EMPTY_PROPS; } if (props.length === 1) { return resolvePropsGetter(props[0], EMPTY_PROPS); } let merged = { ...resolvePropsGetter(props[0], EMPTY_PROPS) }; for (let i2 = 1; i2 < props.length; i2 += 1) { merged = mergeOne(merged, props[i2]); } return merged; } function mergeOne(merged, inputProps) { if (isPropsGetter(inputProps)) { return inputProps(merged); } return mutablyMergeInto(merged, inputProps); } function mutablyMergeInto(mergedProps, externalProps) { if (!externalProps) { return mergedProps; } for (const propName in externalProps) { const externalPropValue = externalProps[propName]; switch (propName) { case "style": { mergedProps[propName] = mergeObjects(mergedProps.style, externalPropValue); break; } case "className": { mergedProps[propName] = mergeClassNames(mergedProps.className, externalPropValue); break; } default: { if (isEventHandler(propName, externalPropValue)) { mergedProps[propName] = mergeEventHandlers(mergedProps[propName], externalPropValue); } else { mergedProps[propName] = externalPropValue; } } } } return mergedProps; } function isEventHandler(key, value) { const code0 = key.charCodeAt(0); const code1 = key.charCodeAt(1); const code2 = key.charCodeAt(2); return code0 === 111 && code1 === 110 && code2 >= 65 && code2 <= 90 && (typeof value === "function" || typeof value === "undefined"); } function isPropsGetter(inputProps) { return typeof inputProps === "function"; } function resolvePropsGetter(inputProps, previousProps) { if (isPropsGetter(inputProps)) { return inputProps(previousProps); } return inputProps ?? EMPTY_PROPS; } function mergeEventHandlers(ourHandler, theirHandler) { if (!theirHandler) { return ourHandler; } if (!ourHandler) { return theirHandler; } return (event) => { if (isSyntheticEvent(event)) { const baseUIEvent = event; makeEventPreventable(baseUIEvent); const result2 = theirHandler(baseUIEvent); if (!baseUIEvent.baseUIHandlerPrevented) { ourHandler?.(baseUIEvent); } return result2; } const result = theirHandler(event); ourHandler?.(event); return result; }; } function makeEventPreventable(event) { event.preventBaseUIHandler = () => { event.baseUIHandlerPrevented = true; }; return event; } function mergeClassNames(ourClassName, theirClassName) { if (theirClassName) { if (ourClassName) { return theirClassName + " " + ourClassName; } return theirClassName; } return ourClassName; } function isSyntheticEvent(event) { return event != null && typeof event === "object" && "nativeEvent" in event; } // node_modules/@base-ui/utils/esm/empty.js var EMPTY_ARRAY2 = Object.freeze([]); var EMPTY_OBJECT = Object.freeze({}); // node_modules/@base-ui/react/esm/utils/useRenderElement.js var import_react = __toESM(require_react(), 1); function useRenderElement(element, componentProps, params = {}) { const renderProp = componentProps.render; const outProps = useRenderElementProps(componentProps, params); if (params.enabled === false) { return null; } const state = params.state ?? EMPTY_OBJECT; return evaluateRenderProp(element, renderProp, outProps, state); } function useRenderElementProps(componentProps, params = {}) { const { className: classNameProp, style: styleProp, render: renderProp } = componentProps; const { state = EMPTY_OBJECT, ref, props, stateAttributesMapping, enabled = true } = params; const className = enabled ? resolveClassName(classNameProp, state) : void 0; const style = enabled ? resolveStyle(styleProp, state) : void 0; const stateProps = enabled ? getStateAttributesProps(state, stateAttributesMapping) : EMPTY_OBJECT; const outProps = enabled ? mergeObjects(stateProps, Array.isArray(props) ? mergePropsN(props) : props) ?? EMPTY_OBJECT : EMPTY_OBJECT; if (typeof document !== "undefined") { if (!enabled) { useMergedRefs(null, null); } else if (Array.isArray(ref)) { outProps.ref = useMergedRefsN([outProps.ref, getReactElementRef(renderProp), ...ref]); } else { outProps.ref = useMergedRefs(outProps.ref, getReactElementRef(renderProp), ref); } } if (!enabled) { return EMPTY_OBJECT; } if (className !== void 0) { outProps.className = mergeClassNames(outProps.className, className); } if (style !== void 0) { outProps.style = mergeObjects(outProps.style, style); } return outProps; } function evaluateRenderProp(element, render4, props, state) { if (render4) { if (typeof render4 === "function") { return render4(props, state); } const mergedProps = mergeProps(props, render4.props); mergedProps.ref = props.ref; return /* @__PURE__ */ React4.cloneElement(render4, mergedProps); } if (element) { if (typeof element === "string") { return renderTag(element, props); } } throw new Error(true ? "Base UI: Render element or function are not defined." : formatErrorMessage(8)); } function renderTag(Tag, props) { if (Tag === "button") { return /* @__PURE__ */ (0, import_react.createElement)("button", { type: "button", ...props, key: props.key }); } if (Tag === "img") { return /* @__PURE__ */ (0, import_react.createElement)("img", { alt: "", ...props, key: props.key }); } return /* @__PURE__ */ React4.createElement(Tag, props); } // node_modules/@base-ui/react/esm/use-render/useRender.js function useRender(params) { return useRenderElement(params.defaultTagName ?? "div", params, params); } // packages/ui/build-module/badge/badge.mjs var import_element3 = __toESM(require_element(), 1); if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='244b5c59c0']")) { const style = document.createElement("style"); style.setAttribute("data-wp-hash", "244b5c59c0"); style.appendChild(document.createTextNode('@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._96e6251aad1a6136__badge{border-radius:var(--wpds-border-radius-lg,8px);font-family:var(--wpds-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-font-size-sm,12px);font-weight:var(--wpds-font-weight-regular,400);line-height:var(--wpds-font-line-height-xs,16px);padding-block:var(--wpds-dimension-padding-xs,4px);padding-inline:var(--wpds-dimension-padding-sm,8px)}._99f7158cb520f750__is-high-intent{background-color:var(--wpds-color-bg-surface-error,#f6e6e3);color:var(--wpds-color-fg-content-error,#470000)}.c20ebef2365bc8b7__is-medium-intent{background-color:var(--wpds-color-bg-surface-warning,#fde6bd);color:var(--wpds-color-fg-content-warning,#2e1900)}._365e1626c6202e52__is-low-intent{background-color:var(--wpds-color-bg-surface-caution,#fee994);color:var(--wpds-color-fg-content-caution,#281d00)}._33f8198127ddf4ef__is-stable-intent{background-color:var(--wpds-color-bg-surface-success,#c5f7cc);color:var(--wpds-color-fg-content-success,#002900)}._04c1aca8fc449412__is-informational-intent{background-color:var(--wpds-color-bg-surface-info,#deebfa);color:var(--wpds-color-fg-content-info,#001b4f)}._90726e69d495ec19__is-draft-intent{background-color:var(--wpds-color-bg-surface-neutral-weak,#f0f0f0);color:var(--wpds-color-fg-content-neutral,#1e1e1e)}._898f4a544993bd39__is-none-intent{background-color:var(--wpds-color-bg-surface-neutral,#f8f8f8);color:var(--wpds-color-fg-content-neutral-weak,#6d6d6d)}}')); document.head.appendChild(style); } var style_default = { "badge": "_96e6251aad1a6136__badge", "is-high-intent": "_99f7158cb520f750__is-high-intent", "is-medium-intent": "c20ebef2365bc8b7__is-medium-intent", "is-low-intent": "_365e1626c6202e52__is-low-intent", "is-stable-intent": "_33f8198127ddf4ef__is-stable-intent", "is-informational-intent": "_04c1aca8fc449412__is-informational-intent", "is-draft-intent": "_90726e69d495ec19__is-draft-intent", "is-none-intent": "_898f4a544993bd39__is-none-intent" }; var Badge = (0, import_element3.forwardRef)(function Badge2({ children, intent = "none", render: render4, className, ...props }, ref) { const element = useRender({ render: render4, defaultTagName: "span", ref, props: mergeProps(props, { className: clsx_default( style_default.badge, style_default[`is-${intent}-intent`], className ), children }) }); return element; }); // packages/icons/build-module/icon/index.mjs var import_element4 = __toESM(require_element(), 1); var icon_default = (0, import_element4.forwardRef)( ({ icon, size = 24, ...props }, ref) => { return (0, import_element4.cloneElement)(icon, { width: size, height: size, ...props, ref }); } ); // packages/icons/build-module/library/archive.mjs var import_primitives = __toESM(require_primitives(), 1); var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1); var archive_default = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M11.934 7.406a1 1 0 0 0 .914.594H19a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5h5.764a.5.5 0 0 1 .447.276l.723 1.63Zm1.064-1.216a.5.5 0 0 0 .462.31H19a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h5.764a2 2 0 0 1 1.789 1.106l.445 1.084ZM8.5 10.5h7V12h-7v-1.5Zm7 3.5h-7v1.5h7V14Z" }) }); // packages/icons/build-module/library/arrow-down.mjs var import_primitives2 = __toESM(require_primitives(), 1); var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1); var arrow_down_default = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives2.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives2.Path, { d: "m16.5 13.5-3.7 3.7V4h-1.5v13.2l-3.8-3.7-1 1 5.5 5.6 5.5-5.6z" }) }); // packages/icons/build-module/library/arrow-left.mjs var import_primitives3 = __toESM(require_primitives(), 1); var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1); var arrow_left_default = /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives3.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives3.Path, { d: "M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z" }) }); // packages/icons/build-module/library/arrow-right.mjs var import_primitives4 = __toESM(require_primitives(), 1); var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1); var arrow_right_default = /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives4.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives4.Path, { d: "m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z" }) }); // packages/icons/build-module/library/arrow-up-left.mjs var import_primitives5 = __toESM(require_primitives(), 1); var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1); var arrow_up_left_default = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives5.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives5.Path, { d: "M14 6H6v8h1.5V8.5L17 18l1-1-9.5-9.5H14V6Z" }) }); // packages/icons/build-module/library/arrow-up.mjs var import_primitives6 = __toESM(require_primitives(), 1); var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1); var arrow_up_default = /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_primitives6.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_primitives6.Path, { d: "M12 3.9 6.5 9.5l1 1 3.8-3.7V20h1.5V6.8l3.7 3.7 1-1z" }) }); // packages/icons/build-module/library/backup.mjs var import_primitives7 = __toESM(require_primitives(), 1); var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1); var backup_default = /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_primitives7.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_primitives7.Path, { d: "M5.5 12h1.75l-2.5 3-2.5-3H4a8 8 0 113.134 6.35l.907-1.194A6.5 6.5 0 105.5 12zm9.53 1.97l-2.28-2.28V8.5a.75.75 0 00-1.5 0V12a.747.747 0 00.218.529l1.282-.84-1.28.842 2.5 2.5a.75.75 0 101.06-1.061z" }) }); // packages/icons/build-module/library/block-meta.mjs var import_primitives8 = __toESM(require_primitives(), 1); var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1); var block_meta_default = /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_primitives8.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_primitives8.Path, { fillRule: "evenodd", d: "M8.95 11.25H4v1.5h4.95v4.5H13V18c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2v-3c0-1.1-.9-2-2-2h-3c-1.1 0-2 .9-2 2v.75h-2.55v-7.5H13V9c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3c-1.1 0-2 .9-2 2v.75H8.95v4.5ZM14.5 15v3c0 .3.2.5.5.5h3c.3 0 .5-.2.5-.5v-3c0-.3-.2-.5-.5-.5h-3c-.3 0-.5.2-.5.5Zm0-6V6c0-.3.2-.5.5-.5h3c.3 0 .5.2.5.5v3c0 .3-.2.5-.5.5h-3c-.3 0-.5-.2-.5-.5Z", clipRule: "evenodd" }) }); // packages/icons/build-module/library/block-table.mjs var import_primitives9 = __toESM(require_primitives(), 1); var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1); var block_table_default = /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_primitives9.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_primitives9.Path, { d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v3.5h-15V5c0-.3.2-.5.5-.5zm8 5.5h6.5v3.5H13V10zm-1.5 3.5h-7V10h7v3.5zm-7 5.5v-4h7v4.5H5c-.3 0-.5-.2-.5-.5zm14.5.5h-6V15h6.5v4c0 .3-.2.5-.5.5z" }) }); // packages/icons/build-module/library/calendar.mjs var import_primitives10 = __toESM(require_primitives(), 1); var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1); var calendar_default = /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_primitives10.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_primitives10.Path, { d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V7h15v12zM9 10H7v2h2v-2zm0 4H7v2h2v-2zm4-4h-2v2h2v-2zm4 0h-2v2h2v-2zm-4 4h-2v2h2v-2zm4 0h-2v2h2v-2z" }) }); // packages/icons/build-module/library/category.mjs var import_primitives11 = __toESM(require_primitives(), 1); var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1); var category_default = /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_primitives11.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_primitives11.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M6 5.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM4 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2V6zm11-.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5h-3a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM13 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2h-3a2 2 0 01-2-2V6zm5 8.5h-3a.5.5 0 00-.5.5v3a.5.5 0 00.5.5h3a.5.5 0 00.5-.5v-3a.5.5 0 00-.5-.5zM15 13a2 2 0 00-2 2v3a2 2 0 002 2h3a2 2 0 002-2v-3a2 2 0 00-2-2h-3zm-9 1.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5v-3a.5.5 0 01.5-.5zM4 15a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2v-3z" }) }); // packages/icons/build-module/library/check.mjs var import_primitives12 = __toESM(require_primitives(), 1); var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1); var check_default = /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_primitives12.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_primitives12.Path, { d: "M16.5 7.5 10 13.9l-2.5-2.4-1 1 3.5 3.6 7.5-7.6z" }) }); // packages/icons/build-module/library/chevron-down.mjs var import_primitives13 = __toESM(require_primitives(), 1); var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1); var chevron_down_default = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_primitives13.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_primitives13.Path, { d: "M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z" }) }); // packages/icons/build-module/library/chevron-left-small.mjs var import_primitives14 = __toESM(require_primitives(), 1); var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1); var chevron_left_small_default = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_primitives14.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_primitives14.Path, { d: "m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z" }) }); // packages/icons/build-module/library/chevron-left.mjs var import_primitives15 = __toESM(require_primitives(), 1); var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1); var chevron_left_default = /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_primitives15.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_primitives15.Path, { d: "M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z" }) }); // packages/icons/build-module/library/chevron-right-small.mjs var import_primitives16 = __toESM(require_primitives(), 1); var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1); var chevron_right_small_default = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_primitives16.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_primitives16.Path, { d: "M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z" }) }); // packages/icons/build-module/library/chevron-right.mjs var import_primitives17 = __toESM(require_primitives(), 1); var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1); var chevron_right_default = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_primitives17.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_primitives17.Path, { d: "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z" }) }); // packages/icons/build-module/library/chevron-up.mjs var import_primitives18 = __toESM(require_primitives(), 1); var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1); var chevron_up_default = /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_primitives18.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_primitives18.Path, { d: "M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z" }) }); // packages/icons/build-module/library/close-small.mjs var import_primitives19 = __toESM(require_primitives(), 1); var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1); var close_small_default = /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_primitives19.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_primitives19.Path, { d: "M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z" }) }); // packages/icons/build-module/library/cog.mjs var import_primitives20 = __toESM(require_primitives(), 1); var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1); var cog_default = /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_primitives20.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_primitives20.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M10.289 4.836A1 1 0 0111.275 4h1.306a1 1 0 01.987.836l.244 1.466c.787.26 1.503.679 2.108 1.218l1.393-.522a1 1 0 011.216.437l.653 1.13a1 1 0 01-.23 1.273l-1.148.944a6.025 6.025 0 010 2.435l1.149.946a1 1 0 01.23 1.272l-.653 1.13a1 1 0 01-1.216.437l-1.394-.522c-.605.54-1.32.958-2.108 1.218l-.244 1.466a1 1 0 01-.987.836h-1.306a1 1 0 01-.986-.836l-.244-1.466a5.995 5.995 0 01-2.108-1.218l-1.394.522a1 1 0 01-1.217-.436l-.653-1.131a1 1 0 01.23-1.272l1.149-.946a6.026 6.026 0 010-2.435l-1.148-.944a1 1 0 01-.23-1.272l.653-1.131a1 1 0 011.217-.437l1.393.522a5.994 5.994 0 012.108-1.218l.244-1.466zM14.929 12a3 3 0 11-6 0 3 3 0 016 0z" }) }); // packages/icons/build-module/library/comment-author-avatar.mjs var import_primitives21 = __toESM(require_primitives(), 1); var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1); var comment_author_avatar_default = /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_primitives21.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_primitives21.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M7.25 16.437a6.5 6.5 0 1 1 9.5 0V16A2.75 2.75 0 0 0 14 13.25h-4A2.75 2.75 0 0 0 7.25 16v.437Zm1.5 1.193a6.47 6.47 0 0 0 3.25.87 6.47 6.47 0 0 0 3.25-.87V16c0-.69-.56-1.25-1.25-1.25h-4c-.69 0-1.25.56-1.25 1.25v1.63ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm10-2a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" }) }); // packages/icons/build-module/library/download.mjs var import_primitives22 = __toESM(require_primitives(), 1); var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1); var download_default = /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_primitives22.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_primitives22.Path, { d: "M18 11.3l-1-1.1-4 4V3h-1.5v11.3L7 10.2l-1 1.1 6.2 5.8 5.8-5.8zm.5 3.7v3.5h-13V15H4v5h16v-5h-1.5z" }) }); // packages/icons/build-module/library/drafts.mjs var import_primitives23 = __toESM(require_primitives(), 1); var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1); var drafts_default = /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_primitives23.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_primitives23.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm8 4a4 4 0 0 0 4-4H8a4 4 0 0 0 4 4Z" }) }); // packages/icons/build-module/library/drawer-right.mjs var import_primitives24 = __toESM(require_primitives(), 1); var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1); var drawer_right_default = /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_primitives24.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_primitives24.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4 14.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h8v13zm4.5-.5c0 .3-.2.5-.5.5h-2.5v-13H18c.3 0 .5.2.5.5v12z" }) }); // packages/icons/build-module/library/envelope.mjs var import_primitives25 = __toESM(require_primitives(), 1); var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1); var envelope_default = /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_primitives25.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_primitives25.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M3 7c0-1.1.9-2 2-2h14a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7Zm2-.5h14c.3 0 .5.2.5.5v1L12 13.5 4.5 7.9V7c0-.3.2-.5.5-.5Zm-.5 3.3V17c0 .3.2.5.5.5h14c.3 0 .5-.2.5-.5V9.8L12 15.4 4.5 9.8Z" }) }); // packages/icons/build-module/library/error.mjs var import_primitives26 = __toESM(require_primitives(), 1); var import_jsx_runtime27 = __toESM(require_jsx_runtime(), 1); var error_default = /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_primitives26.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_primitives26.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M12.218 5.377a.25.25 0 0 0-.436 0l-7.29 12.96a.25.25 0 0 0 .218.373h14.58a.25.25 0 0 0 .218-.372l-7.29-12.96Zm-1.743-.735c.669-1.19 2.381-1.19 3.05 0l7.29 12.96a1.75 1.75 0 0 1-1.525 2.608H4.71a1.75 1.75 0 0 1-1.525-2.608l7.29-12.96ZM12.75 17.46h-1.5v-1.5h1.5v1.5Zm-1.5-3h1.5v-5h-1.5v5Z" }) }); // packages/icons/build-module/library/file.mjs var import_primitives27 = __toESM(require_primitives(), 1); var import_jsx_runtime28 = __toESM(require_jsx_runtime(), 1); var file_default = /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_primitives27.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_primitives27.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M12.848 8a1 1 0 0 1-.914-.594l-.723-1.63a.5.5 0 0 0-.447-.276H5a.5.5 0 0 0-.5.5v11.5a.5.5 0 0 0 .5.5h14a.5.5 0 0 0 .5-.5v-9A.5.5 0 0 0 19 8h-6.152Zm.612-1.5a.5.5 0 0 1-.462-.31l-.445-1.084A2 2 0 0 0 10.763 4H5a2 2 0 0 0-2 2v11.5a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-9a2 2 0 0 0-2-2h-5.54Z" }) }); // packages/icons/build-module/library/format-list-bullets-rtl.mjs var import_primitives28 = __toESM(require_primitives(), 1); var import_jsx_runtime29 = __toESM(require_jsx_runtime(), 1); var format_list_bullets_rtl_default = /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_primitives28.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_primitives28.Path, { d: "M4 8.8h8.9V7.2H4v1.6zm0 7h8.9v-1.5H4v1.5zM18 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z" }) }); // packages/icons/build-module/library/format-list-bullets.mjs var import_primitives29 = __toESM(require_primitives(), 1); var import_jsx_runtime30 = __toESM(require_jsx_runtime(), 1); var format_list_bullets_default = /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_primitives29.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_primitives29.Path, { d: "M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM6 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-7c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z" }) }); // packages/icons/build-module/library/funnel.mjs var import_primitives30 = __toESM(require_primitives(), 1); var import_jsx_runtime31 = __toESM(require_jsx_runtime(), 1); var funnel_default = /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_primitives30.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_primitives30.Path, { d: "M10 17.5H14V16H10V17.5ZM6 6V7.5H18V6H6ZM8 12.5H16V11H8V12.5Z" }) }); // packages/icons/build-module/library/globe.mjs var import_primitives31 = __toESM(require_primitives(), 1); var import_jsx_runtime32 = __toESM(require_jsx_runtime(), 1); var globe_default = /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_primitives31.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_primitives31.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-8Zm6.5 8c0 .6 0 1.2-.2 1.8h-2.7c0-.6.2-1.1.2-1.8s0-1.2-.2-1.8h2.7c.2.6.2 1.1.2 1.8Zm-.9-3.2h-2.4c-.3-.9-.7-1.8-1.1-2.4-.1-.2-.2-.4-.3-.5 1.6.5 3 1.6 3.8 3ZM12.8 17c-.3.5-.6 1-.8 1.3-.2-.3-.5-.8-.8-1.3-.3-.5-.6-1.1-.8-1.7h3.3c-.2.6-.5 1.2-.8 1.7Zm-2.9-3.2c-.1-.6-.2-1.1-.2-1.8s0-1.2.2-1.8H14c.1.6.2 1.1.2 1.8s0 1.2-.2 1.8H9.9ZM11.2 7c.3-.5.6-1 .8-1.3.2.3.5.8.8 1.3.3.5.6 1.1.8 1.7h-3.3c.2-.6.5-1.2.8-1.7Zm-1-1.2c-.1.2-.2.3-.3.5-.4.7-.8 1.5-1.1 2.4H6.4c.8-1.4 2.2-2.5 3.8-3Zm-1.8 8H5.7c-.2-.6-.2-1.1-.2-1.8s0-1.2.2-1.8h2.7c0 .6-.2 1.1-.2 1.8s0 1.2.2 1.8Zm-2 1.4h2.4c.3.9.7 1.8 1.1 2.4.1.2.2.4.3.5-1.6-.5-3-1.6-3.8-3Zm7.4 3c.1-.2.2-.3.3-.5.4-.7.8-1.5 1.1-2.4h2.4c-.8 1.4-2.2 2.5-3.8 3Z" }) }); // packages/icons/build-module/library/help.mjs var import_primitives32 = __toESM(require_primitives(), 1); var import_jsx_runtime33 = __toESM(require_jsx_runtime(), 1); var help_default = /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_primitives32.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_primitives32.Path, { d: "M12 4a8 8 0 1 1 .001 16.001A8 8 0 0 1 12 4Zm0 1.5a6.5 6.5 0 1 0-.001 13.001A6.5 6.5 0 0 0 12 5.5Zm.75 11h-1.5V15h1.5v1.5Zm-.445-9.234a3 3 0 0 1 .445 5.89V14h-1.5v-1.25c0-.57.452-.958.917-1.01A1.5 1.5 0 0 0 12 8.75a1.5 1.5 0 0 0-1.5 1.5H9a3 3 0 0 1 3.305-2.984Z" }) }); // packages/icons/build-module/library/home.mjs var import_primitives33 = __toESM(require_primitives(), 1); var import_jsx_runtime34 = __toESM(require_jsx_runtime(), 1); var home_default = /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_primitives33.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_primitives33.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_primitives34 = __toESM(require_primitives(), 1); var import_jsx_runtime35 = __toESM(require_jsx_runtime(), 1); var layout_default = /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_primitives34.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_primitives34.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/link.mjs var import_primitives35 = __toESM(require_primitives(), 1); var import_jsx_runtime36 = __toESM(require_jsx_runtime(), 1); var link_default = /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_primitives35.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_primitives35.Path, { d: "M10 17.389H8.444A5.194 5.194 0 1 1 8.444 7H10v1.5H8.444a3.694 3.694 0 0 0 0 7.389H10v1.5ZM14 7h1.556a5.194 5.194 0 0 1 0 10.39H14v-1.5h1.556a3.694 3.694 0 0 0 0-7.39H14V7Zm-4.5 6h5v-1.5h-5V13Z" }) }); // packages/icons/build-module/library/list.mjs var import_primitives36 = __toESM(require_primitives(), 1); var import_jsx_runtime37 = __toESM(require_jsx_runtime(), 1); var list_default = /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_primitives36.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_primitives36.Path, { d: "M4 4v1.5h16V4H4zm8 8.5h8V11h-8v1.5zM4 20h16v-1.5H4V20zm4-8c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2z" }) }); // packages/icons/build-module/library/media.mjs var import_primitives37 = __toESM(require_primitives(), 1); var import_jsx_runtime38 = __toESM(require_jsx_runtime(), 1); var media_default = /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_primitives37.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_primitives37.Path, { d: "m7 6.5 4 2.5-4 2.5z" }), /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_primitives37.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "m5 3c-1.10457 0-2 .89543-2 2v14c0 1.1046.89543 2 2 2h14c1.1046 0 2-.8954 2-2v-14c0-1.10457-.8954-2-2-2zm14 1.5h-14c-.27614 0-.5.22386-.5.5v10.7072l3.62953-2.6465c.25108-.1831.58905-.1924.84981-.0234l2.92666 1.8969 3.5712-3.4719c.2911-.2831.7545-.2831 1.0456 0l2.9772 2.8945v-9.3568c0-.27614-.2239-.5-.5-.5zm-14.5 14.5v-1.4364l4.09643-2.987 2.99567 1.9417c.2936.1903.6798.1523.9307-.0917l3.4772-3.3806 3.4772 3.3806.0228-.0234v2.5968c0 .2761-.2239.5-.5.5h-14c-.27614 0-.5-.2239-.5-.5z" }) ] }); // packages/icons/build-module/library/mobile.mjs var import_primitives38 = __toESM(require_primitives(), 1); var import_jsx_runtime39 = __toESM(require_jsx_runtime(), 1); var mobile_default = /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_primitives38.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_primitives38.Path, { d: "M15 4H9c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h6c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H9c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h6c.3 0 .5.2.5.5v12zm-4.5-.5h2V16h-2v1.5z" }) }); // packages/icons/build-module/library/more-vertical.mjs var import_primitives39 = __toESM(require_primitives(), 1); var import_jsx_runtime40 = __toESM(require_jsx_runtime(), 1); var more_vertical_default = /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_primitives39.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_primitives39.Path, { d: "M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z" }) }); // packages/icons/build-module/library/navigation.mjs var import_primitives40 = __toESM(require_primitives(), 1); var import_jsx_runtime41 = __toESM(require_jsx_runtime(), 1); var navigation_default = /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_primitives40.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_primitives40.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/next.mjs var import_primitives41 = __toESM(require_primitives(), 1); var import_jsx_runtime42 = __toESM(require_jsx_runtime(), 1); var next_default = /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_primitives41.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_primitives41.Path, { d: "M6.6 6L5.4 7l4.5 5-4.5 5 1.1 1 5.5-6-5.4-6zm6 0l-1.1 1 4.5 5-4.5 5 1.1 1 5.5-6-5.5-6z" }) }); // packages/icons/build-module/library/not-allowed.mjs var import_primitives42 = __toESM(require_primitives(), 1); var import_jsx_runtime43 = __toESM(require_jsx_runtime(), 1); var not_allowed_default = /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_primitives42.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_primitives42.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M12 18.5A6.5 6.5 0 0 1 6.93 7.931l9.139 9.138A6.473 6.473 0 0 1 12 18.5Zm5.123-2.498a6.5 6.5 0 0 0-9.124-9.124l9.124 9.124ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Z" }) }); // packages/icons/build-module/library/not-found.mjs var import_primitives43 = __toESM(require_primitives(), 1); var import_jsx_runtime44 = __toESM(require_jsx_runtime(), 1); var not_found_default = /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_primitives43.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_primitives43.Path, { d: "M19 5c1.1 0 2 .9 2 2v10c0 1.1-.9 2-2 2H5c-1.1 0-2-.9-2-2V7c0-1.1.9-2 2-2zM5 6.5c-.3 0-.5.2-.5.5v10c0 .3.2.5.5.5h14c.3 0 .5-.2.5-.5V7c0-.3-.2-.5-.5-.5zm7.01 2.75q.711 0 1.24.364.533.364.824 1.012.296.645.296 1.488 0 .887-.296 1.556-.292.664-.824 1.036-.528.368-1.24.368-.708 0-1.24-.368-.527-.372-.824-1.036-.296-.668-.296-1.556 0-.848.296-1.492.296-.648.824-1.008a2.14 2.14 0 0 1 1.24-.364m-3.484 3.6h.72v.832h-.72v1.28h-.984v-1.28H4.75l3.08-4.32h.696zm9.522 0h.72v.832h-.72v1.28h-.983v-1.28h-2.793l3.08-4.32h.696zm-6.038-2.696q-.568 0-.952.48-.384.475-.384 1.48 0 .716.176 1.168.176.45.476.66.304.212.684.212t.68-.208q.304-.207.48-.656.176-.451.176-1.176 0-.996-.384-1.476-.38-.484-.952-.484M6.33 12.85h1.212v-1.722zm9.523 0h1.211v-1.722z" }) }); // packages/icons/build-module/library/page.mjs var import_primitives44 = __toESM(require_primitives(), 1); var import_jsx_runtime45 = __toESM(require_jsx_runtime(), 1); var page_default = /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_primitives44.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_primitives44.Path, { d: "M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z" }), /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_primitives44.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/pages.mjs var import_primitives45 = __toESM(require_primitives(), 1); var import_jsx_runtime46 = __toESM(require_jsx_runtime(), 1); var pages_default = /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_primitives45.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_primitives45.Path, { d: "M14.5 5.5h-7V7h7V5.5ZM7.5 9h7v1.5h-7V9Zm7 3.5h-7V14h7v-1.5Z" }), /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_primitives45.Path, { d: "M16 2H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2ZM6 3.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H6a.5.5 0 0 1-.5-.5V4a.5.5 0 0 1 .5-.5Z" }), /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_primitives45.Path, { d: "M20 8v11c0 .69-.31 1-.999 1H6v1.5h13.001c1.52 0 2.499-.982 2.499-2.5V8H20Z" }) ] }); // packages/icons/build-module/library/pencil.mjs var import_primitives46 = __toESM(require_primitives(), 1); var import_jsx_runtime47 = __toESM(require_jsx_runtime(), 1); var pencil_default = /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_primitives46.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_primitives46.Path, { d: "m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z" }) }); // packages/icons/build-module/library/pending.mjs var import_primitives47 = __toESM(require_primitives(), 1); var import_jsx_runtime48 = __toESM(require_jsx_runtime(), 1); var pending_default = /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_primitives47.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_primitives47.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm8 4a4 4 0 0 1-4-4h4V8a4 4 0 0 1 0 8Z" }) }); // packages/icons/build-module/library/pin.mjs var import_primitives48 = __toESM(require_primitives(), 1); var import_jsx_runtime49 = __toESM(require_jsx_runtime(), 1); var pin_default = /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_primitives48.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_primitives48.Path, { d: "m21.5 9.1-6.6-6.6-4.2 5.6c-1.2-.1-2.4.1-3.6.7-.1 0-.1.1-.2.1-.5.3-.9.6-1.2.9l3.7 3.7-5.7 5.7v1.1h1.1l5.7-5.7 3.7 3.7c.4-.4.7-.8.9-1.2.1-.1.1-.2.2-.3.6-1.1.8-2.4.6-3.6l5.6-4.1zm-7.3 3.5.1.9c.1.9 0 1.8-.4 2.6l-6-6c.8-.4 1.7-.5 2.6-.4l.9.1L15 4.9 19.1 9l-4.9 3.6z" }) }); // packages/icons/build-module/library/plugins.mjs var import_primitives49 = __toESM(require_primitives(), 1); var import_jsx_runtime50 = __toESM(require_jsx_runtime(), 1); var plugins_default = /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_primitives49.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_primitives49.Path, { d: "M10.5 4v4h3V4H15v4h1.5a1 1 0 011 1v4l-3 4v2a1 1 0 01-1 1h-3a1 1 0 01-1-1v-2l-3-4V9a1 1 0 011-1H9V4h1.5zm.5 12.5v2h2v-2l3-4v-3H8v3l3 4z" }) }); // packages/icons/build-module/library/post.mjs var import_primitives50 = __toESM(require_primitives(), 1); var import_jsx_runtime51 = __toESM(require_jsx_runtime(), 1); var post_default = /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_primitives50.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_primitives50.Path, { d: "m7.3 9.7 1.4 1.4c.2-.2.3-.3.4-.5 0 0 0-.1.1-.1.3-.5.4-1.1.3-1.6L12 7 9 4 7.2 6.5c-.6-.1-1.1 0-1.6.3 0 0-.1 0-.1.1-.3.1-.4.2-.6.4l1.4 1.4L4 11v1h1l2.3-2.3zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z" }) }); // packages/icons/build-module/library/previous.mjs var import_primitives51 = __toESM(require_primitives(), 1); var import_jsx_runtime52 = __toESM(require_jsx_runtime(), 1); var previous_default = /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_primitives51.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_primitives51.Path, { d: "M11.6 7l-1.1-1L5 12l5.5 6 1.1-1L7 12l4.6-5zm6 0l-1.1-1-5.5 6 5.5 6 1.1-1-4.6-5 4.6-5z" }) }); // packages/icons/build-module/library/published.mjs var import_primitives52 = __toESM(require_primitives(), 1); var import_jsx_runtime53 = __toESM(require_jsx_runtime(), 1); var published_default = /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_primitives52.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_primitives52.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm11.53-1.47-1.06-1.06L11 12.94l-1.47-1.47-1.06 1.06L11 15.06l4.53-4.53Z" }) }); // packages/icons/build-module/library/rotate-left.mjs var import_primitives53 = __toESM(require_primitives(), 1); var import_jsx_runtime54 = __toESM(require_jsx_runtime(), 1); var rotate_left_default = /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_primitives53.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_primitives53.Path, { d: "M12 4V2.2L9 4.8l3 2.5V5.5c3.6 0 6.5 2.9 6.5 6.5 0 2.9-1.9 5.3-4.5 6.2v.2l-.1-.2c-.4.1-.7.2-1.1.2l.2 1.5c.3 0 .6-.1 1-.2 3.5-.9 6-4 6-7.7 0-4.4-3.6-8-8-8zm-7.9 7l1.5.2c.1-1.2.5-2.3 1.2-3.2l-1.1-.9C4.8 8.2 4.3 9.6 4.1 11zm1.5 1.8l-1.5.2c.1.7.3 1.4.5 2 .3.7.6 1.3 1 1.8l1.2-.8c-.3-.5-.6-1-.8-1.5s-.4-1.1-.4-1.7zm1.5 5.5c1.1.9 2.4 1.4 3.8 1.6l.2-1.5c-1.1-.1-2.2-.5-3.1-1.2l-.9 1.1z" }) }); // packages/icons/build-module/library/rotate-right.mjs var import_primitives54 = __toESM(require_primitives(), 1); var import_jsx_runtime55 = __toESM(require_jsx_runtime(), 1); var rotate_right_default = /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_primitives54.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_primitives54.Path, { d: "M15.1 4.8l-3-2.5V4c-4.4 0-8 3.6-8 8 0 3.7 2.5 6.9 6 7.7.3.1.6.1 1 .2l.2-1.5c-.4 0-.7-.1-1.1-.2l-.1.2v-.2c-2.6-.8-4.5-3.3-4.5-6.2 0-3.6 2.9-6.5 6.5-6.5v1.8l3-2.5zM20 11c-.2-1.4-.7-2.7-1.6-3.8l-1.2.8c.7.9 1.1 2 1.3 3.1L20 11zm-1.5 1.8c-.1.5-.2 1.1-.4 1.6s-.5 1-.8 1.5l1.2.9c.4-.5.8-1.1 1-1.8s.5-1.3.5-2l-1.5-.2zm-5.6 5.6l.2 1.5c1.4-.2 2.7-.7 3.8-1.6l-.9-1.1c-.9.7-2 1.1-3.1 1.2z" }) }); // packages/icons/build-module/library/scheduled.mjs var import_primitives55 = __toESM(require_primitives(), 1); var import_jsx_runtime56 = __toESM(require_jsx_runtime(), 1); var scheduled_default = /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_primitives55.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_primitives55.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm9 1V8h-1.5v3.5h-2V13H13Z" }) }); // packages/icons/build-module/library/search.mjs var import_primitives56 = __toESM(require_primitives(), 1); var import_jsx_runtime57 = __toESM(require_jsx_runtime(), 1); var search_default = /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_primitives56.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_primitives56.Path, { d: "M13 5c-3.3 0-6 2.7-6 6 0 1.4.5 2.7 1.3 3.7l-3.8 3.8 1.1 1.1 3.8-3.8c1 .8 2.3 1.3 3.7 1.3 3.3 0 6-2.7 6-6S16.3 5 13 5zm0 10.5c-2.5 0-4.5-2-4.5-4.5s2-4.5 4.5-4.5 4.5 2 4.5 4.5-2 4.5-4.5 4.5z" }) }); // packages/icons/build-module/library/seen.mjs var import_primitives57 = __toESM(require_primitives(), 1); var import_jsx_runtime58 = __toESM(require_jsx_runtime(), 1); var seen_default = /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_primitives57.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_primitives57.Path, { d: "M3.99961 13C4.67043 13.3354 4.6703 13.3357 4.67017 13.3359L4.67298 13.3305C4.67621 13.3242 4.68184 13.3135 4.68988 13.2985C4.70595 13.2686 4.7316 13.2218 4.76695 13.1608C4.8377 13.0385 4.94692 12.8592 5.09541 12.6419C5.39312 12.2062 5.84436 11.624 6.45435 11.0431C7.67308 9.88241 9.49719 8.75 11.9996 8.75C14.502 8.75 16.3261 9.88241 17.5449 11.0431C18.1549 11.624 18.6061 12.2062 18.9038 12.6419C19.0523 12.8592 19.1615 13.0385 19.2323 13.1608C19.2676 13.2218 19.2933 13.2686 19.3093 13.2985C19.3174 13.3135 19.323 13.3242 19.3262 13.3305L19.3291 13.3359C19.3289 13.3357 19.3288 13.3354 19.9996 13C20.6704 12.6646 20.6703 12.6643 20.6701 12.664L20.6697 12.6632L20.6688 12.6614L20.6662 12.6563L20.6583 12.6408C20.6517 12.6282 20.6427 12.6108 20.631 12.5892C20.6078 12.5459 20.5744 12.4852 20.5306 12.4096C20.4432 12.2584 20.3141 12.0471 20.1423 11.7956C19.7994 11.2938 19.2819 10.626 18.5794 9.9569C17.1731 8.61759 14.9972 7.25 11.9996 7.25C9.00203 7.25 6.82614 8.61759 5.41987 9.9569C4.71736 10.626 4.19984 11.2938 3.85694 11.7956C3.68511 12.0471 3.55605 12.2584 3.4686 12.4096C3.42484 12.4852 3.39142 12.5459 3.36818 12.5892C3.35656 12.6108 3.34748 12.6282 3.34092 12.6408L3.33297 12.6563L3.33041 12.6614L3.32948 12.6632L3.32911 12.664C3.32894 12.6643 3.32879 12.6646 3.99961 13ZM11.9996 16C13.9326 16 15.4996 14.433 15.4996 12.5C15.4996 10.567 13.9326 9 11.9996 9C10.0666 9 8.49961 10.567 8.49961 12.5C8.49961 14.433 10.0666 16 11.9996 16Z" }) }); // packages/icons/build-module/library/styles.mjs var import_primitives58 = __toESM(require_primitives(), 1); var import_jsx_runtime59 = __toESM(require_jsx_runtime(), 1); var styles_default = /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_primitives58.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_primitives58.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_primitives59 = __toESM(require_primitives(), 1); var import_jsx_runtime60 = __toESM(require_jsx_runtime(), 1); var symbol_filled_default = /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_primitives59.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_primitives59.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_primitives60 = __toESM(require_primitives(), 1); var import_jsx_runtime61 = __toESM(require_jsx_runtime(), 1); var symbol_default = /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_primitives60.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_primitives60.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/tag.mjs var import_primitives61 = __toESM(require_primitives(), 1); var import_jsx_runtime62 = __toESM(require_jsx_runtime(), 1); var tag_default = /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_primitives61.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_primitives61.Path, { d: "M4.75 4a.75.75 0 0 0-.75.75v7.826c0 .2.08.39.22.53l6.72 6.716a2.313 2.313 0 0 0 3.276-.001l5.61-5.611-.531-.53.532.528a2.315 2.315 0 0 0 0-3.264L13.104 4.22a.75.75 0 0 0-.53-.22H4.75ZM19 12.576a.815.815 0 0 1-.236.574l-5.61 5.611a.814.814 0 0 1-1.153 0L5.5 12.264V5.5h6.763l6.5 6.502a.816.816 0 0 1 .237.574ZM8.75 9.75a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z" }) }); // packages/icons/build-module/library/trash.mjs var import_primitives62 = __toESM(require_primitives(), 1); var import_jsx_runtime63 = __toESM(require_jsx_runtime(), 1); var trash_default = /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_primitives62.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_primitives62.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z" }) }); // packages/icons/build-module/library/unseen.mjs var import_primitives63 = __toESM(require_primitives(), 1); var import_jsx_runtime64 = __toESM(require_jsx_runtime(), 1); var unseen_default = /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_primitives63.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_primitives63.Path, { d: "M20.7 12.7s0-.1-.1-.2c0-.2-.2-.4-.4-.6-.3-.5-.9-1.2-1.6-1.8-.7-.6-1.5-1.3-2.6-1.8l-.6 1.4c.9.4 1.6 1 2.1 1.5.6.6 1.1 1.2 1.4 1.6.1.2.3.4.3.5v.1l.7-.3.7-.3Zm-5.2-9.3-1.8 4c-.5-.1-1.1-.2-1.7-.2-3 0-5.2 1.4-6.6 2.7-.7.7-1.2 1.3-1.6 1.8-.2.3-.3.5-.4.6 0 0 0 .1-.1.2s0 0 .7.3l.7.3V13c0-.1.2-.3.3-.5.3-.4.7-1 1.4-1.6 1.2-1.2 3-2.3 5.5-2.3H13v.3c-.4 0-.8-.1-1.1-.1-1.9 0-3.5 1.6-3.5 3.5s.6 2.3 1.6 2.9l-2 4.4.9.4 7.6-16.2-.9-.4Zm-3 12.6c1.7-.2 3-1.7 3-3.5s-.2-1.4-.6-1.9L12.4 16Z" }) }); // packages/icons/build-module/library/upload.mjs var import_primitives64 = __toESM(require_primitives(), 1); var import_jsx_runtime65 = __toESM(require_jsx_runtime(), 1); var upload_default = /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_primitives64.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_primitives64.Path, { d: "M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z" }) }); // packages/icons/build-module/library/verse.mjs var import_primitives65 = __toESM(require_primitives(), 1); var import_jsx_runtime66 = __toESM(require_jsx_runtime(), 1); var verse_default = /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_primitives65.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_primitives65.Path, { d: "M17.8 2l-.9.3c-.1 0-3.6 1-5.2 2.1C10 5.5 9.3 6.5 8.9 7.1c-.6.9-1.7 4.7-1.7 6.3l-.9 2.3c-.2.4 0 .8.4 1 .1 0 .2.1.3.1.3 0 .6-.2.7-.5l.6-1.5c.3 0 .7-.1 1.2-.2.7-.1 1.4-.3 2.2-.5.8-.2 1.6-.5 2.4-.8.7-.3 1.4-.7 1.9-1.2s.8-1.2 1-1.9c.2-.7.3-1.6.4-2.4.1-.8.1-1.7.2-2.5 0-.8.1-1.5.2-2.1V2zm-1.9 5.6c-.1.8-.2 1.5-.3 2.1-.2.6-.4 1-.6 1.3-.3.3-.8.6-1.4.9-.7.3-1.4.5-2.2.8-.6.2-1.3.3-1.8.4L15 7.5c.3-.3.6-.7 1-1.1 0 .4 0 .8-.1 1.2zM6 20h8v-1.5H6V20z" }) }); // packages/icons/build-module/library/wordpress.mjs var import_primitives66 = __toESM(require_primitives(), 1); var import_jsx_runtime67 = __toESM(require_jsx_runtime(), 1); var wordpress_default = /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_primitives66.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "-2 -2 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_primitives66.Path, { d: "M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z" }) }); // packages/ui/build-module/stack/stack.mjs var import_element5 = __toESM(require_element(), 1); if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='71d20935c2']")) { const style = document.createElement("style"); style.setAttribute("data-wp-hash", "71d20935c2"); style.appendChild(document.createTextNode("@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._19ce0419607e1896__stack{display:flex}}")); document.head.appendChild(style); } var style_default2 = { "stack": "_19ce0419607e1896__stack" }; var gapTokens = { xs: "var(--wpds-dimension-gap-xs, 4px)", sm: "var(--wpds-dimension-gap-sm, 8px)", md: "var(--wpds-dimension-gap-md, 12px)", lg: "var(--wpds-dimension-gap-lg, 16px)", xl: "var(--wpds-dimension-gap-xl, 24px)", "2xl": "var(--wpds-dimension-gap-2xl, 32px)", "3xl": "var(--wpds-dimension-gap-3xl, 40px)" }; var Stack = (0, import_element5.forwardRef)(function Stack2({ direction, gap, align, justify, wrap, render: render4, ...props }, ref) { const style = { gap: gap && gapTokens[gap], alignItems: align, justifyContent: justify, flexDirection: direction, flexWrap: wrap }; const element = useRender({ render: render4, ref, props: mergeProps(props, { style, className: style_default2.stack }) }); return element; }); // packages/admin-ui/build-module/page/sidebar-toggle-slot.mjs var import_components = __toESM(require_components(), 1); var { Fill: SidebarToggleFill, Slot: SidebarToggleSlot } = (0, import_components.createSlotFill)("SidebarToggle"); // packages/admin-ui/build-module/page/header.mjs var import_jsx_runtime68 = __toESM(require_jsx_runtime(), 1); function Header({ headingLevel = 1, breadcrumbs, badges, title, subTitle, actions, showSidebarToggle = true }) { const HeadingTag = `h${headingLevel}`; return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(Stack, { direction: "column", className: "admin-ui-page__header", children: [ /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(Stack, { direction: "row", justify: "space-between", gap: "sm", children: [ /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(Stack, { direction: "row", gap: "sm", align: "center", justify: "start", children: [ showSidebarToggle && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)( SidebarToggleSlot, { bubblesVirtually: true, className: "admin-ui-page__sidebar-toggle-slot" } ), title && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(HeadingTag, { className: "admin-ui-page__header-title", children: title }), breadcrumbs, badges ] }), /* @__PURE__ */ (0, import_jsx_runtime68.jsx)( Stack, { direction: "row", gap: "sm", style: { width: "auto", flexShrink: 0 }, className: "admin-ui-page__header-actions", align: "center", children: actions } ) ] }), subTitle && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("p", { className: "admin-ui-page__header-subtitle", children: subTitle }) ] }); } // packages/admin-ui/build-module/page/index.mjs var import_jsx_runtime69 = __toESM(require_jsx_runtime(), 1); function Page({ headingLevel, breadcrumbs, badges, title, subTitle, children, className, actions, hasPadding = false, showSidebarToggle = true }) { const classes = clsx_default("admin-ui-page", className); return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(navigable_region_default, { className: classes, ariaLabel: title, children: [ (title || breadcrumbs || badges) && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)( Header, { headingLevel, breadcrumbs, badges, title, subTitle, actions, showSidebarToggle } ), hasPadding ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "admin-ui-page__content has-padding", children }) : children ] }); } Page.SidebarToggleFill = SidebarToggleFill; var page_default2 = Page; // packages/edit-site/build-module/components/layout/index.mjs var import_components8 = __toESM(require_components(), 1); var import_compose2 = __toESM(require_compose(), 1); var import_i18n8 = __toESM(require_i18n(), 1); var import_element14 = __toESM(require_element(), 1); var import_editor6 = __toESM(require_editor(), 1); var import_router6 = __toESM(require_router(), 1); var import_plugins2 = __toESM(require_plugins(), 1); var import_notices = __toESM(require_notices(), 1); var import_data13 = __toESM(require_data(), 1); var import_preferences3 = __toESM(require_preferences(), 1); // packages/edit-site/build-module/components/site-hub/index.mjs var import_data5 = __toESM(require_data(), 1); var import_components3 = __toESM(require_components(), 1); var import_i18n3 = __toESM(require_i18n(), 1); var import_core_data4 = __toESM(require_core_data(), 1); var import_html_entities = __toESM(require_html_entities(), 1); var import_element7 = __toESM(require_element(), 1); var import_commands = __toESM(require_commands(), 1); var import_keycodes = __toESM(require_keycodes(), 1); var import_url = __toESM(require_url(), 1); var import_router = __toESM(require_router(), 1); // packages/edit-site/build-module/components/site-icon/index.mjs var import_data4 = __toESM(require_data(), 1); var import_components2 = __toESM(require_components(), 1); var import_i18n2 = __toESM(require_i18n(), 1); var import_core_data3 = __toESM(require_core_data(), 1); var import_jsx_runtime70 = __toESM(require_jsx_runtime(), 1); function SiteIcon({ className }) { const { isRequestingSite, siteIconUrl } = (0, import_data4.useSelect)((select3) => { const { getEntityRecord } = select3(import_core_data3.store); const siteData = getEntityRecord("root", "__unstableBase", void 0); return { isRequestingSite: !siteData, siteIconUrl: siteData?.site_icon_url }; }, []); if (isRequestingSite && !siteIconUrl) { return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { className: "edit-site-site-icon__image" }); } const icon = siteIconUrl ? /* @__PURE__ */ (0, import_jsx_runtime70.jsx)( "img", { className: "edit-site-site-icon__image", alt: (0, import_i18n2.__)("Site Icon"), src: siteIconUrl } ) : /* @__PURE__ */ (0, import_jsx_runtime70.jsx)( import_components2.Icon, { className: "edit-site-site-icon__icon", icon: wordpress_default, size: 48 } ); return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { className: clsx_default(className, "edit-site-site-icon"), children: icon }); } var site_icon_default = SiteIcon; // packages/edit-site/build-module/components/sidebar/index.mjs var import_element6 = __toESM(require_element(), 1); var import_dom = __toESM(require_dom(), 1); var import_jsx_runtime71 = __toESM(require_jsx_runtime(), 1); var SidebarNavigationContext = (0, import_element6.createContext)(() => { }); SidebarNavigationContext.displayName = "SidebarNavigationContext"; function focusSidebarElement(el, direction, focusSelector) { let elementToFocus; if (direction === "back" && focusSelector) { elementToFocus = el.querySelector(focusSelector); } if (direction !== null && !elementToFocus) { const [firstTabbable] = import_dom.focus.tabbable.find(el); elementToFocus = firstTabbable ?? el; } elementToFocus?.focus(); } function createNavState() { let state = { direction: null, focusSelector: null }; return { get() { return state; }, navigate(direction, focusSelector = null) { state = { direction, focusSelector: direction === "forward" && focusSelector ? focusSelector : state.focusSelector }; } }; } function SidebarContentWrapper({ children, shouldAnimate }) { const navState = (0, import_element6.useContext)(SidebarNavigationContext); const wrapperRef = (0, import_element6.useRef)(); const [navAnimation, setNavAnimation] = (0, import_element6.useState)(null); (0, import_element6.useLayoutEffect)(() => { const { direction, focusSelector } = navState.get(); focusSidebarElement(wrapperRef.current, direction, focusSelector); setNavAnimation(direction); }, [navState]); const wrapperCls = clsx_default( "edit-site-sidebar__screen-wrapper", /* * Some panes do not have sub-panes and therefore * should not animate when clicked on. */ shouldAnimate ? { "slide-from-left": navAnimation === "back", "slide-from-right": navAnimation === "forward" } : {} ); return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("div", { ref: wrapperRef, className: wrapperCls, children }); } function SidebarNavigationProvider({ children }) { const [navState] = (0, import_element6.useState)(createNavState); return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(SidebarNavigationContext.Provider, { value: navState, children }); } function SidebarContent({ routeKey, shouldAnimate, children }) { return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("div", { className: "edit-site-sidebar__content", children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)( SidebarContentWrapper, { shouldAnimate, children }, routeKey ) }); } // packages/edit-site/build-module/components/site-hub/index.mjs var import_jsx_runtime72 = __toESM(require_jsx_runtime(), 1); var { useLocation, useHistory } = unlock(import_router.privateApis); var SiteHub = (0, import_element7.memo)( (0, import_element7.forwardRef)(({ isTransparent }, ref) => { const { dashboardLink, homeUrl, siteTitle } = (0, import_data5.useSelect)((select3) => { const { getSettings: getSettings7 } = unlock(select3(store)); const { getEntityRecord } = select3(import_core_data4.store); const _site = getEntityRecord("root", "site"); return { dashboardLink: getSettings7().__experimentalDashboardLink, homeUrl: getEntityRecord("root", "__unstableBase")?.home, siteTitle: !_site?.title && !!_site?.url ? (0, import_url.filterURLForDisplay)(_site?.url) : _site?.title }; }, []); const { open: openCommandCenter } = (0, import_data5.useDispatch)(import_commands.store); return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("div", { className: "edit-site-site-hub", children: /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(import_components3.__experimentalHStack, { justify: "flex-start", spacing: "0", children: [ /* @__PURE__ */ (0, import_jsx_runtime72.jsx)( "div", { className: clsx_default( "edit-site-site-hub__view-mode-toggle-container", { "has-transparent-background": isTransparent } ), children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)( import_components3.Button, { __next40pxDefaultSize: true, ref, href: dashboardLink, label: (0, import_i18n3.__)("Go to the Dashboard"), className: "edit-site-layout__view-mode-toggle", style: { transform: "scale(0.5333) translateX(-4px)", // Offset to position the icon 12px from viewport edge borderRadius: 4 }, children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(site_icon_default, { className: "edit-site-layout__view-mode-toggle-icon" }) } ) } ), /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(import_components3.__experimentalHStack, { children: [ /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("div", { className: "edit-site-site-hub__title", children: /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)( import_components3.Button, { __next40pxDefaultSize: true, variant: "link", href: homeUrl, target: "_blank", children: [ (0, import_html_entities.decodeEntities)(siteTitle), /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_components3.VisuallyHidden, { as: "span", /* translators: accessibility text */ children: (0, import_i18n3.__)("(opens in a new tab)") }) ] } ) }), /* @__PURE__ */ (0, import_jsx_runtime72.jsx)( import_components3.__experimentalHStack, { spacing: 0, expanded: false, className: "edit-site-site-hub__actions", children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)( import_components3.Button, { size: "compact", className: "edit-site-site-hub_toggle-command-center", icon: search_default, onClick: () => openCommandCenter(), label: (0, import_i18n3.__)("Open command palette"), shortcut: import_keycodes.displayShortcut.primary("k") } ) } ) ] }) ] }) }); }) ); var site_hub_default = SiteHub; var SiteHubMobile = (0, import_element7.memo)( (0, import_element7.forwardRef)(({ isTransparent }, ref) => { const { path } = useLocation(); const history = useHistory(); const { navigate } = (0, import_element7.useContext)(SidebarNavigationContext); const { dashboardLink, homeUrl, siteTitle, isBlockTheme, isClassicThemeWithStyleBookSupport: isClassicThemeWithStyleBookSupport2 } = (0, import_data5.useSelect)((select3) => { const { getSettings: getSettings7 } = unlock(select3(store)); const { getEntityRecord, getCurrentTheme } = select3(import_core_data4.store); const _site = getEntityRecord("root", "site"); const currentTheme = getCurrentTheme(); const settings2 = getSettings7(); const supportsEditorStyles = currentTheme?.theme_supports["editor-styles"]; const hasThemeJson = settings2.supportsLayout; return { dashboardLink: settings2.__experimentalDashboardLink, homeUrl: getEntityRecord("root", "__unstableBase")?.home, siteTitle: !_site?.title && !!_site?.url ? (0, import_url.filterURLForDisplay)(_site?.url) : _site?.title, isBlockTheme: currentTheme?.is_block_theme, isClassicThemeWithStyleBookSupport: !currentTheme?.is_block_theme && (supportsEditorStyles || hasThemeJson) }; }, []); const { open: openCommandCenter } = (0, import_data5.useDispatch)(import_commands.store); let backPath; if (path !== "/") { if (isBlockTheme || isClassicThemeWithStyleBookSupport2) { backPath = "/"; } else if (path !== "/pattern") { backPath = "/pattern"; } } const backButtonProps = { href: !!backPath ? void 0 : dashboardLink, label: !!backPath ? (0, import_i18n3.__)("Go to Site Editor") : (0, import_i18n3.__)("Go to the Dashboard"), onClick: !!backPath ? () => { history.navigate(backPath); navigate("back"); } : void 0 }; return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("div", { className: "edit-site-site-hub", children: /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(import_components3.__experimentalHStack, { justify: "flex-start", spacing: "0", children: [ /* @__PURE__ */ (0, import_jsx_runtime72.jsx)( "div", { className: clsx_default( "edit-site-site-hub__view-mode-toggle-container", { "has-transparent-background": isTransparent } ), children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)( import_components3.Button, { __next40pxDefaultSize: true, ref, className: "edit-site-layout__view-mode-toggle", style: { transform: "scale(0.5)", borderRadius: 4 }, ...backButtonProps, children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(site_icon_default, { className: "edit-site-layout__view-mode-toggle-icon" }) } ) } ), /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(import_components3.__experimentalHStack, { children: [ /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("div", { className: "edit-site-site-hub__title", children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)( import_components3.Button, { __next40pxDefaultSize: true, variant: "link", href: homeUrl, target: "_blank", label: (0, import_i18n3.__)("View site (opens in a new tab)"), children: (0, import_html_entities.decodeEntities)(siteTitle) } ) }), /* @__PURE__ */ (0, import_jsx_runtime72.jsx)( import_components3.__experimentalHStack, { spacing: 0, expanded: false, className: "edit-site-site-hub__actions", children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)( import_components3.Button, { __next40pxDefaultSize: true, className: "edit-site-site-hub_toggle-command-center", icon: search_default, onClick: () => openCommandCenter(), label: (0, import_i18n3.__)("Open command palette"), shortcut: import_keycodes.displayShortcut.primary("k") } ) } ) ] }) ] }) }); }) ); // packages/edit-site/build-module/components/resizable-frame/index.mjs var import_element8 = __toESM(require_element(), 1); var import_components4 = __toESM(require_components(), 1); var import_compose = __toESM(require_compose(), 1); var import_i18n4 = __toESM(require_i18n(), 1); var import_router2 = __toESM(require_router(), 1); var import_data6 = __toESM(require_data(), 1); var import_core_data5 = __toESM(require_core_data(), 1); var import_url2 = __toESM(require_url(), 1); var import_jsx_runtime73 = __toESM(require_jsx_runtime(), 1); var { useLocation: useLocation2, useHistory: useHistory2 } = unlock(import_router2.privateApis); var HANDLE_STYLES_OVERRIDE = { position: void 0, userSelect: void 0, cursor: void 0, width: void 0, height: void 0, top: void 0, right: void 0, bottom: void 0, left: void 0 }; var FRAME_MIN_WIDTH = 320; var FRAME_REFERENCE_WIDTH = 1300; var FRAME_TARGET_ASPECT_RATIO = 9 / 19.5; var SNAP_TO_EDIT_CANVAS_MODE_THRESHOLD = 200; var INITIAL_FRAME_SIZE = { width: "100%", height: "100%" }; function calculateNewHeight(width, initialAspectRatio) { const lerp = (a2, b2, amount) => { return a2 + (b2 - a2) * amount; }; const lerpFactor = 1 - Math.max( 0, Math.min( 1, (width - FRAME_MIN_WIDTH) / (FRAME_REFERENCE_WIDTH - FRAME_MIN_WIDTH) ) ); const intermediateAspectRatio = lerp( initialAspectRatio, FRAME_TARGET_ASPECT_RATIO, lerpFactor ); return width / intermediateAspectRatio; } function ResizableFrame({ isFullWidth, isOversized, setIsOversized, isReady, children, /** The default (unresized) width/height of the frame, based on the space available in the viewport. */ defaultSize, innerContentStyle }) { const history = useHistory2(); const { path, query } = useLocation2(); const { canvas = "view" } = query; const disableMotion = (0, import_compose.useReducedMotion)(); const [frameSize, setFrameSize] = (0, import_element8.useState)(INITIAL_FRAME_SIZE); const [startingWidth, setStartingWidth] = (0, import_element8.useState)(); const [isResizing, setIsResizing] = (0, import_element8.useState)(false); const [shouldShowHandle, setShouldShowHandle] = (0, import_element8.useState)(false); const [resizeRatio, setResizeRatio] = (0, import_element8.useState)(1); const FRAME_TRANSITION = { type: "tween", duration: isResizing ? 0 : 0.5 }; const frameRef = (0, import_element8.useRef)(null); const resizableHandleHelpId = (0, import_compose.useInstanceId)( ResizableFrame, "edit-site-resizable-frame-handle-help" ); const defaultAspectRatio = defaultSize.width / defaultSize.height; const isBlockTheme = (0, import_data6.useSelect)((select3) => { const { getCurrentTheme } = select3(import_core_data5.store); return getCurrentTheme()?.is_block_theme; }, []); const handleResizeStart = (_event, _direction, ref) => { setStartingWidth(ref.offsetWidth); setIsResizing(true); }; const handleResize = (_event, _direction, _ref, delta) => { const normalizedDelta = delta.width / resizeRatio; const deltaAbs = Math.abs(normalizedDelta); const maxDoubledDelta = delta.width < 0 ? deltaAbs : (defaultSize.width - startingWidth) / 2; const deltaToDouble = Math.min(deltaAbs, maxDoubledDelta); const doubleSegment = deltaAbs === 0 ? 0 : deltaToDouble / deltaAbs; const singleSegment = 1 - doubleSegment; setResizeRatio(singleSegment + doubleSegment * 2); const updatedWidth = startingWidth + delta.width; setIsOversized(updatedWidth > defaultSize.width); setFrameSize({ height: isOversized ? "100%" : calculateNewHeight(updatedWidth, defaultAspectRatio) }); }; const handleResizeStop = (_event, _direction, ref) => { setIsResizing(false); if (!isOversized) { return; } setIsOversized(false); const remainingWidth = ref.ownerDocument.documentElement.offsetWidth - ref.offsetWidth; if (remainingWidth > SNAP_TO_EDIT_CANVAS_MODE_THRESHOLD || !isBlockTheme) { setFrameSize(INITIAL_FRAME_SIZE); } else { history.navigate( (0, import_url2.addQueryArgs)(path, { canvas: "edit" }), { transition: "canvas-mode-edit-transition" } ); } }; const handleResizableHandleKeyDown = (event) => { if (!["ArrowLeft", "ArrowRight"].includes(event.key)) { return; } event.preventDefault(); const step = 20 * (event.shiftKey ? 5 : 1); const delta = step * (event.key === "ArrowLeft" ? 1 : -1) * ((0, import_i18n4.isRTL)() ? -1 : 1); const newWidth = Math.min( Math.max( FRAME_MIN_WIDTH, frameRef.current.resizable.offsetWidth + delta ), defaultSize.width ); setFrameSize({ width: newWidth, height: calculateNewHeight(newWidth, defaultAspectRatio) }); }; const frameAnimationVariants = { default: { flexGrow: 0, height: frameSize.height }, fullWidth: { flexGrow: 1, height: frameSize.height } }; const resizeHandleVariants = { hidden: { opacity: 0, ...(0, import_i18n4.isRTL)() ? { right: 0 } : { left: 0 } }, visible: { opacity: 1, // Account for the handle's width. ...(0, import_i18n4.isRTL)() ? { right: -14 } : { left: -14 } }, active: { opacity: 1, // Account for the handle's width. ...(0, import_i18n4.isRTL)() ? { right: -14 } : { left: -14 }, scaleY: 1.3 } }; const currentResizeHandleVariant = (() => { if (isResizing) { return "active"; } return shouldShowHandle ? "visible" : "hidden"; })(); return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)( import_components4.ResizableBox, { as: import_components4.__unstableMotion.div, ref: frameRef, initial: false, variants: frameAnimationVariants, animate: isFullWidth ? "fullWidth" : "default", onAnimationComplete: (definition) => { if (definition === "fullWidth") { setFrameSize({ width: "100%", height: "100%" }); } }, whileHover: canvas === "view" && isBlockTheme ? { scale: 1.005, transition: { duration: disableMotion ? 0 : 0.5, ease: "easeOut" } } : {}, transition: FRAME_TRANSITION, size: frameSize, enable: { top: false, bottom: false, // Resizing will be disabled until the editor content is loaded. ...(0, import_i18n4.isRTL)() ? { right: isReady, left: false } : { left: isReady, right: false }, topRight: false, bottomRight: false, bottomLeft: false, topLeft: false }, resizeRatio, handleClasses: void 0, handleStyles: { left: HANDLE_STYLES_OVERRIDE, right: HANDLE_STYLES_OVERRIDE }, minWidth: FRAME_MIN_WIDTH, maxWidth: isFullWidth ? "100%" : "150%", maxHeight: "100%", onFocus: () => setShouldShowHandle(true), onBlur: () => setShouldShowHandle(false), onMouseOver: () => setShouldShowHandle(true), onMouseOut: () => setShouldShowHandle(false), handleComponent: { [(0, import_i18n4.isRTL)() ? "right" : "left"]: canvas === "view" && /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(import_jsx_runtime73.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_components4.Tooltip, { text: (0, import_i18n4.__)("Drag to resize"), children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)( import_components4.__unstableMotion.button, { role: "separator", "aria-orientation": "vertical", className: clsx_default( "edit-site-resizable-frame__handle", { "is-resizing": isResizing } ), variants: resizeHandleVariants, animate: currentResizeHandleVariant, "aria-label": (0, import_i18n4.__)("Drag to resize"), "aria-describedby": resizableHandleHelpId, "aria-valuenow": frameRef.current?.resizable?.offsetWidth || void 0, "aria-valuemin": FRAME_MIN_WIDTH, "aria-valuemax": defaultSize.width, onKeyDown: handleResizableHandleKeyDown, initial: "hidden", exit: "hidden", whileFocus: "active", whileHover: "active" }, "handle" ) }), /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { hidden: true, id: resizableHandleHelpId, children: (0, import_i18n4.__)( "Use left and right arrow keys to resize the canvas. Hold shift to resize in larger increments." ) }) ] }) }, onResizeStart: handleResizeStart, onResize: handleResize, onResizeStop: handleResizeStop, className: clsx_default("edit-site-resizable-frame__inner", { "is-resizing": isResizing }), showHandle: false, children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)( "div", { className: "edit-site-resizable-frame__inner-content", style: innerContentStyle, children } ) } ); } var resizable_frame_default = ResizableFrame; // packages/edit-site/build-module/components/save-keyboard-shortcut/index.mjs var import_element9 = __toESM(require_element(), 1); var import_keyboard_shortcuts = __toESM(require_keyboard_shortcuts(), 1); var import_i18n5 = __toESM(require_i18n(), 1); var import_data7 = __toESM(require_data(), 1); var import_core_data6 = __toESM(require_core_data(), 1); var import_editor3 = __toESM(require_editor(), 1); var shortcutName = "core/edit-site/save"; function SaveKeyboardShortcut() { const { __experimentalGetDirtyEntityRecords, isSavingEntityRecord } = (0, import_data7.useSelect)(import_core_data6.store); const { hasNonPostEntityChanges, isPostSavingLocked } = (0, import_data7.useSelect)(import_editor3.store); const { savePost } = (0, import_data7.useDispatch)(import_editor3.store); const { setIsSaveViewOpened: setIsSaveViewOpened2 } = (0, import_data7.useDispatch)(store); const { registerShortcut, unregisterShortcut } = (0, import_data7.useDispatch)( import_keyboard_shortcuts.store ); (0, import_element9.useEffect)(() => { registerShortcut({ name: shortcutName, category: "global", description: (0, import_i18n5.__)("Save your changes."), keyCombination: { modifier: "primary", character: "s" } }); return () => { unregisterShortcut(shortcutName); }; }, [registerShortcut, unregisterShortcut]); (0, import_keyboard_shortcuts.useShortcut)("core/edit-site/save", (event) => { event.preventDefault(); const dirtyEntityRecords = __experimentalGetDirtyEntityRecords(); const hasDirtyEntities = !!dirtyEntityRecords.length; const isSaving = dirtyEntityRecords.some( (record) => isSavingEntityRecord(record.kind, record.name, record.key) ); if (!hasDirtyEntities || isSaving) { return; } if (hasNonPostEntityChanges()) { setIsSaveViewOpened2(true); } else if (!isPostSavingLocked()) { savePost(); } }); return null; } // packages/edit-site/build-module/components/layout/hooks.mjs var import_element10 = __toESM(require_element(), 1); var import_data8 = __toESM(require_data(), 1); var import_core_data7 = __toESM(require_core_data(), 1); var MAX_LOADING_TIME = 1e4; function useIsSiteEditorLoading() { const [loaded, setLoaded] = (0, import_element10.useState)(false); const inLoadingPause = (0, import_data8.useSelect)( (select3) => { const hasResolvingSelectors = select3(import_core_data7.store).hasResolvingSelectors(); return !loaded && !hasResolvingSelectors; }, [loaded] ); (0, import_element10.useEffect)(() => { let timeout; if (!loaded) { timeout = setTimeout(() => { setLoaded(true); }, MAX_LOADING_TIME); } return () => { clearTimeout(timeout); }; }, [loaded]); (0, import_element10.useEffect)(() => { if (inLoadingPause) { const ARTIFICIAL_DELAY = 100; const timeout = setTimeout(() => { setLoaded(true); }, ARTIFICIAL_DELAY); return () => { clearTimeout(timeout); }; } }, [inLoadingPause]); return !loaded; } // node_modules/@react-spring/rafz/dist/react-spring-rafz.esm.js var updateQueue = makeQueue(); var raf = (fn) => schedule(fn, updateQueue); var writeQueue = makeQueue(); raf.write = (fn) => schedule(fn, writeQueue); var onStartQueue = makeQueue(); raf.onStart = (fn) => schedule(fn, onStartQueue); var onFrameQueue = makeQueue(); raf.onFrame = (fn) => schedule(fn, onFrameQueue); var onFinishQueue = makeQueue(); raf.onFinish = (fn) => schedule(fn, onFinishQueue); var timeouts = []; raf.setTimeout = (handler, ms) => { let time = raf.now() + ms; let cancel = () => { let i2 = timeouts.findIndex((t3) => t3.cancel == cancel); if (~i2) timeouts.splice(i2, 1); pendingCount -= ~i2 ? 1 : 0; }; let timeout = { time, handler, cancel }; timeouts.splice(findTimeout(time), 0, timeout); pendingCount += 1; start(); return timeout; }; var findTimeout = (time) => ~(~timeouts.findIndex((t3) => t3.time > time) || ~timeouts.length); raf.cancel = (fn) => { onStartQueue.delete(fn); onFrameQueue.delete(fn); onFinishQueue.delete(fn); updateQueue.delete(fn); writeQueue.delete(fn); }; raf.sync = (fn) => { sync = true; raf.batchedUpdates(fn); sync = false; }; raf.throttle = (fn) => { let lastArgs; function queuedFn() { try { fn(...lastArgs); } finally { lastArgs = null; } } function throttled(...args) { lastArgs = args; raf.onStart(queuedFn); } throttled.handler = fn; throttled.cancel = () => { onStartQueue.delete(queuedFn); lastArgs = null; }; return throttled; }; var nativeRaf = typeof window != "undefined" ? window.requestAnimationFrame : () => { }; raf.use = (impl) => nativeRaf = impl; raf.now = typeof performance != "undefined" ? () => performance.now() : Date.now; raf.batchedUpdates = (fn) => fn(); raf.catch = console.error; raf.frameLoop = "always"; raf.advance = () => { if (raf.frameLoop !== "demand") { console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"); } else { update2(); } }; var ts = -1; var pendingCount = 0; var sync = false; function schedule(fn, queue) { if (sync) { queue.delete(fn); fn(0); } else { queue.add(fn); start(); } } function start() { if (ts < 0) { ts = 0; if (raf.frameLoop !== "demand") { nativeRaf(loop); } } } function stop() { ts = -1; } function loop() { if (~ts) { nativeRaf(loop); raf.batchedUpdates(update2); } } function update2() { let prevTs = ts; ts = raf.now(); let count = findTimeout(ts); if (count) { eachSafely(timeouts.splice(0, count), (t3) => t3.handler()); pendingCount -= count; } if (!pendingCount) { stop(); return; } onStartQueue.flush(); updateQueue.flush(prevTs ? Math.min(64, ts - prevTs) : 16.667); onFrameQueue.flush(); writeQueue.flush(); onFinishQueue.flush(); } function makeQueue() { let next = /* @__PURE__ */ new Set(); let current = next; return { add(fn) { pendingCount += current == next && !next.has(fn) ? 1 : 0; next.add(fn); }, delete(fn) { pendingCount -= current == next && next.has(fn) ? 1 : 0; return next.delete(fn); }, flush(arg) { if (current.size) { next = /* @__PURE__ */ new Set(); pendingCount -= current.size; eachSafely(current, (fn) => fn(arg) && next.add(fn)); pendingCount += next.size; current = next; } } }; } function eachSafely(values, each2) { values.forEach((value) => { try { each2(value); } catch (e2) { raf.catch(e2); } }); } // node_modules/@react-spring/shared/dist/react-spring-shared.esm.js var import_react4 = __toESM(require_react()); function noop() { } var defineHidden = (obj, key, value) => Object.defineProperty(obj, key, { value, writable: true, configurable: true }); var is = { arr: Array.isArray, obj: (a2) => !!a2 && a2.constructor.name === "Object", fun: (a2) => typeof a2 === "function", str: (a2) => typeof a2 === "string", num: (a2) => typeof a2 === "number", und: (a2) => a2 === void 0 }; function isEqual(a2, b2) { if (is.arr(a2)) { if (!is.arr(b2) || a2.length !== b2.length) return false; for (let i2 = 0; i2 < a2.length; i2++) { if (a2[i2] !== b2[i2]) return false; } return true; } return a2 === b2; } var each = (obj, fn) => obj.forEach(fn); function eachProp(obj, fn, ctx9) { if (is.arr(obj)) { for (let i2 = 0; i2 < obj.length; i2++) { fn.call(ctx9, obj[i2], `${i2}`); } return; } for (const key in obj) { if (obj.hasOwnProperty(key)) { fn.call(ctx9, obj[key], key); } } } var toArray = (a2) => is.und(a2) ? [] : is.arr(a2) ? a2 : [a2]; function flush(queue, iterator) { if (queue.size) { const items = Array.from(queue); queue.clear(); each(items, iterator); } } var flushCalls = (queue, ...args) => flush(queue, (fn) => fn(...args)); var isSSR = () => typeof window === "undefined" || !window.navigator || /ServerSideRendering|^Deno\//.test(window.navigator.userAgent); var createStringInterpolator$1; var to; var colors$1 = null; var skipAnimation = false; var willAdvance = noop; var assign = (globals2) => { if (globals2.to) to = globals2.to; if (globals2.now) raf.now = globals2.now; if (globals2.colors !== void 0) colors$1 = globals2.colors; if (globals2.skipAnimation != null) skipAnimation = globals2.skipAnimation; if (globals2.createStringInterpolator) createStringInterpolator$1 = globals2.createStringInterpolator; if (globals2.requestAnimationFrame) raf.use(globals2.requestAnimationFrame); if (globals2.batchedUpdates) raf.batchedUpdates = globals2.batchedUpdates; if (globals2.willAdvance) willAdvance = globals2.willAdvance; if (globals2.frameLoop) raf.frameLoop = globals2.frameLoop; }; var globals = /* @__PURE__ */ Object.freeze({ __proto__: null, get createStringInterpolator() { return createStringInterpolator$1; }, get to() { return to; }, get colors() { return colors$1; }, get skipAnimation() { return skipAnimation; }, get willAdvance() { return willAdvance; }, assign }); var startQueue = /* @__PURE__ */ new Set(); var currentFrame = []; var prevFrame = []; var priority = 0; var frameLoop = { get idle() { return !startQueue.size && !currentFrame.length; }, start(animation) { if (priority > animation.priority) { startQueue.add(animation); raf.onStart(flushStartQueue); } else { startSafely(animation); raf(advance); } }, advance, sort(animation) { if (priority) { raf.onFrame(() => frameLoop.sort(animation)); } else { const prevIndex = currentFrame.indexOf(animation); if (~prevIndex) { currentFrame.splice(prevIndex, 1); startUnsafely(animation); } } }, clear() { currentFrame = []; startQueue.clear(); } }; function flushStartQueue() { startQueue.forEach(startSafely); startQueue.clear(); raf(advance); } function startSafely(animation) { if (!currentFrame.includes(animation)) startUnsafely(animation); } function startUnsafely(animation) { currentFrame.splice(findIndex(currentFrame, (other) => other.priority > animation.priority), 0, animation); } function advance(dt) { const nextFrame = prevFrame; for (let i2 = 0; i2 < currentFrame.length; i2++) { const animation = currentFrame[i2]; priority = animation.priority; if (!animation.idle) { willAdvance(animation); animation.advance(dt); if (!animation.idle) { nextFrame.push(animation); } } } priority = 0; prevFrame = currentFrame; prevFrame.length = 0; currentFrame = nextFrame; return currentFrame.length > 0; } function findIndex(arr, test) { const index = arr.findIndex(test); return index < 0 ? arr.length : index; } var colors = { transparent: 0, aliceblue: 4042850303, antiquewhite: 4209760255, aqua: 16777215, aquamarine: 2147472639, azure: 4043309055, beige: 4126530815, bisque: 4293182719, black: 255, blanchedalmond: 4293643775, blue: 65535, blueviolet: 2318131967, brown: 2771004159, burlywood: 3736635391, burntsienna: 3934150143, cadetblue: 1604231423, chartreuse: 2147418367, chocolate: 3530104575, coral: 4286533887, cornflowerblue: 1687547391, cornsilk: 4294499583, crimson: 3692313855, cyan: 16777215, darkblue: 35839, darkcyan: 9145343, darkgoldenrod: 3095792639, darkgray: 2846468607, darkgreen: 6553855, darkgrey: 2846468607, darkkhaki: 3182914559, darkmagenta: 2332068863, darkolivegreen: 1433087999, darkorange: 4287365375, darkorchid: 2570243327, darkred: 2332033279, darksalmon: 3918953215, darkseagreen: 2411499519, darkslateblue: 1211993087, darkslategray: 793726975, darkslategrey: 793726975, darkturquoise: 13554175, darkviolet: 2483082239, deeppink: 4279538687, deepskyblue: 12582911, dimgray: 1768516095, dimgrey: 1768516095, dodgerblue: 512819199, firebrick: 2988581631, floralwhite: 4294635775, forestgreen: 579543807, fuchsia: 4278255615, gainsboro: 3705462015, ghostwhite: 4177068031, gold: 4292280575, goldenrod: 3668254975, gray: 2155905279, green: 8388863, greenyellow: 2919182335, grey: 2155905279, honeydew: 4043305215, hotpink: 4285117695, indianred: 3445382399, indigo: 1258324735, ivory: 4294963455, khaki: 4041641215, lavender: 3873897215, lavenderblush: 4293981695, lawngreen: 2096890111, lemonchiffon: 4294626815, lightblue: 2916673279, lightcoral: 4034953471, lightcyan: 3774873599, lightgoldenrodyellow: 4210742015, lightgray: 3553874943, lightgreen: 2431553791, lightgrey: 3553874943, lightpink: 4290167295, lightsalmon: 4288707327, lightseagreen: 548580095, lightskyblue: 2278488831, lightslategray: 2005441023, lightslategrey: 2005441023, lightsteelblue: 2965692159, lightyellow: 4294959359, lime: 16711935, limegreen: 852308735, linen: 4210091775, magenta: 4278255615, maroon: 2147483903, mediumaquamarine: 1724754687, mediumblue: 52735, mediumorchid: 3126187007, mediumpurple: 2473647103, mediumseagreen: 1018393087, mediumslateblue: 2070474495, mediumspringgreen: 16423679, mediumturquoise: 1221709055, mediumvioletred: 3340076543, midnightblue: 421097727, mintcream: 4127193855, mistyrose: 4293190143, moccasin: 4293178879, navajowhite: 4292783615, navy: 33023, oldlace: 4260751103, olive: 2155872511, olivedrab: 1804477439, orange: 4289003775, orangered: 4282712319, orchid: 3664828159, palegoldenrod: 4008225535, palegreen: 2566625535, paleturquoise: 2951671551, palevioletred: 3681588223, papayawhip: 4293907967, peachpuff: 4292524543, peru: 3448061951, pink: 4290825215, plum: 3718307327, powderblue: 2967529215, purple: 2147516671, rebeccapurple: 1714657791, red: 4278190335, rosybrown: 3163525119, royalblue: 1097458175, saddlebrown: 2336560127, salmon: 4202722047, sandybrown: 4104413439, seagreen: 780883967, seashell: 4294307583, sienna: 2689740287, silver: 3233857791, skyblue: 2278484991, slateblue: 1784335871, slategray: 1887473919, slategrey: 1887473919, snow: 4294638335, springgreen: 16744447, steelblue: 1182971135, tan: 3535047935, teal: 8421631, thistle: 3636451583, tomato: 4284696575, turquoise: 1088475391, violet: 4001558271, wheat: 4125012991, white: 4294967295, whitesmoke: 4126537215, yellow: 4294902015, yellowgreen: 2597139199 }; var NUMBER = "[-+]?\\d*\\.?\\d+"; var PERCENTAGE = NUMBER + "%"; function call(...parts) { return "\\(\\s*(" + parts.join(")\\s*,\\s*(") + ")\\s*\\)"; } var rgb = new RegExp("rgb" + call(NUMBER, NUMBER, NUMBER)); var rgba = new RegExp("rgba" + call(NUMBER, NUMBER, NUMBER, NUMBER)); var hsl = new RegExp("hsl" + call(NUMBER, PERCENTAGE, PERCENTAGE)); var hsla = new RegExp("hsla" + call(NUMBER, PERCENTAGE, PERCENTAGE, NUMBER)); var hex3 = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/; var hex4 = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/; var hex6 = /^#([0-9a-fA-F]{6})$/; var hex8 = /^#([0-9a-fA-F]{8})$/; function normalizeColor(color) { let match3; if (typeof color === "number") { return color >>> 0 === color && color >= 0 && color <= 4294967295 ? color : null; } if (match3 = hex6.exec(color)) return parseInt(match3[1] + "ff", 16) >>> 0; if (colors$1 && colors$1[color] !== void 0) { return colors$1[color]; } if (match3 = rgb.exec(color)) { return (parse255(match3[1]) << 24 | parse255(match3[2]) << 16 | parse255(match3[3]) << 8 | 255) >>> 0; } if (match3 = rgba.exec(color)) { return (parse255(match3[1]) << 24 | parse255(match3[2]) << 16 | parse255(match3[3]) << 8 | parse1(match3[4])) >>> 0; } if (match3 = hex3.exec(color)) { return parseInt(match3[1] + match3[1] + match3[2] + match3[2] + match3[3] + match3[3] + "ff", 16) >>> 0; } if (match3 = hex8.exec(color)) return parseInt(match3[1], 16) >>> 0; if (match3 = hex4.exec(color)) { return parseInt(match3[1] + match3[1] + match3[2] + match3[2] + match3[3] + match3[3] + match3[4] + match3[4], 16) >>> 0; } if (match3 = hsl.exec(color)) { return (hslToRgb(parse360(match3[1]), parsePercentage(match3[2]), parsePercentage(match3[3])) | 255) >>> 0; } if (match3 = hsla.exec(color)) { return (hslToRgb(parse360(match3[1]), parsePercentage(match3[2]), parsePercentage(match3[3])) | parse1(match3[4])) >>> 0; } return null; } function hue2rgb(p3, q, t3) { if (t3 < 0) t3 += 1; if (t3 > 1) t3 -= 1; if (t3 < 1 / 6) return p3 + (q - p3) * 6 * t3; if (t3 < 1 / 2) return q; if (t3 < 2 / 3) return p3 + (q - p3) * (2 / 3 - t3) * 6; return p3; } function hslToRgb(h2, s2, l2) { const q = l2 < 0.5 ? l2 * (1 + s2) : l2 + s2 - l2 * s2; const p3 = 2 * l2 - q; const r3 = hue2rgb(p3, q, h2 + 1 / 3); const g2 = hue2rgb(p3, q, h2); const b2 = hue2rgb(p3, q, h2 - 1 / 3); return Math.round(r3 * 255) << 24 | Math.round(g2 * 255) << 16 | Math.round(b2 * 255) << 8; } function parse255(str) { const int = parseInt(str, 10); if (int < 0) return 0; if (int > 255) return 255; return int; } function parse360(str) { const int = parseFloat(str); return (int % 360 + 360) % 360 / 360; } function parse1(str) { const num = parseFloat(str); if (num < 0) return 0; if (num > 1) return 255; return Math.round(num * 255); } function parsePercentage(str) { const int = parseFloat(str); if (int < 0) return 0; if (int > 100) return 1; return int / 100; } function colorToRgba(input) { let int32Color = normalizeColor(input); if (int32Color === null) return input; int32Color = int32Color || 0; let r3 = (int32Color & 4278190080) >>> 24; let g2 = (int32Color & 16711680) >>> 16; let b2 = (int32Color & 65280) >>> 8; let a2 = (int32Color & 255) / 255; return `rgba(${r3}, ${g2}, ${b2}, ${a2})`; } var createInterpolator = (range, output, extrapolate) => { if (is.fun(range)) { return range; } if (is.arr(range)) { return createInterpolator({ range, output, extrapolate }); } if (is.str(range.output[0])) { return createStringInterpolator$1(range); } const config2 = range; const outputRange = config2.output; const inputRange = config2.range || [0, 1]; const extrapolateLeft = config2.extrapolateLeft || config2.extrapolate || "extend"; const extrapolateRight = config2.extrapolateRight || config2.extrapolate || "extend"; const easing = config2.easing || ((t3) => t3); return (input) => { const range2 = findRange(input, inputRange); return interpolate(input, inputRange[range2], inputRange[range2 + 1], outputRange[range2], outputRange[range2 + 1], easing, extrapolateLeft, extrapolateRight, config2.map); }; }; function interpolate(input, inputMin, inputMax, outputMin, outputMax, easing, extrapolateLeft, extrapolateRight, map) { let result = map ? map(input) : input; if (result < inputMin) { if (extrapolateLeft === "identity") return result; else if (extrapolateLeft === "clamp") result = inputMin; } if (result > inputMax) { if (extrapolateRight === "identity") return result; else if (extrapolateRight === "clamp") result = inputMax; } if (outputMin === outputMax) return outputMin; if (inputMin === inputMax) return input <= inputMin ? outputMin : outputMax; if (inputMin === -Infinity) result = -result; else if (inputMax === Infinity) result = result - inputMin; else result = (result - inputMin) / (inputMax - inputMin); result = easing(result); if (outputMin === -Infinity) result = -result; else if (outputMax === Infinity) result = result + outputMin; else result = result * (outputMax - outputMin) + outputMin; return result; } function findRange(input, inputRange) { for (var i2 = 1; i2 < inputRange.length - 1; ++i2) if (inputRange[i2] >= input) break; return i2 - 1; } function _extends() { _extends = Object.assign ? Object.assign.bind() : function(target) { for (var i2 = 1; i2 < arguments.length; i2++) { var source = arguments[i2]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } var $get = /* @__PURE__ */ Symbol.for("FluidValue.get"); var $observers = /* @__PURE__ */ Symbol.for("FluidValue.observers"); var hasFluidValue = (arg) => Boolean(arg && arg[$get]); var getFluidValue = (arg) => arg && arg[$get] ? arg[$get]() : arg; var getFluidObservers = (target) => target[$observers] || null; function callFluidObserver(observer, event) { if (observer.eventObserved) { observer.eventObserved(event); } else { observer(event); } } function callFluidObservers(target, event) { let observers = target[$observers]; if (observers) { observers.forEach((observer) => { callFluidObserver(observer, event); }); } } var FluidValue = class { constructor(get) { this[$get] = void 0; this[$observers] = void 0; if (!get && !(get = this.get)) { throw Error("Unknown getter"); } setFluidGetter(this, get); } }; var setFluidGetter = (target, get) => setHidden(target, $get, get); function addFluidObserver(target, observer) { if (target[$get]) { let observers = target[$observers]; if (!observers) { setHidden(target, $observers, observers = /* @__PURE__ */ new Set()); } if (!observers.has(observer)) { observers.add(observer); if (target.observerAdded) { target.observerAdded(observers.size, observer); } } } return observer; } function removeFluidObserver(target, observer) { let observers = target[$observers]; if (observers && observers.has(observer)) { const count = observers.size - 1; if (count) { observers.delete(observer); } else { target[$observers] = null; } if (target.observerRemoved) { target.observerRemoved(count, observer); } } } var setHidden = (target, key, value) => Object.defineProperty(target, key, { value, writable: true, configurable: true }); var numberRegex = /[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g; var colorRegex = /(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi; var unitRegex = new RegExp(`(${numberRegex.source})(%|[a-z]+)`, "i"); var rgbaRegex = /rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi; var cssVariableRegex = /var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/; var variableToRgba = (input) => { const [token, fallback] = parseCSSVariable(input); if (!token || isSSR()) { return input; } const value = window.getComputedStyle(document.documentElement).getPropertyValue(token); if (value) { return value.trim(); } else if (fallback && fallback.startsWith("--")) { const _value = window.getComputedStyle(document.documentElement).getPropertyValue(fallback); if (_value) { return _value; } else { return input; } } else if (fallback && cssVariableRegex.test(fallback)) { return variableToRgba(fallback); } else if (fallback) { return fallback; } return input; }; var parseCSSVariable = (current) => { const match3 = cssVariableRegex.exec(current); if (!match3) return [,]; const [, token, fallback] = match3; return [token, fallback]; }; var namedColorRegex; var rgbaRound = (_, p1, p22, p3, p4) => `rgba(${Math.round(p1)}, ${Math.round(p22)}, ${Math.round(p3)}, ${p4})`; var createStringInterpolator = (config2) => { if (!namedColorRegex) namedColorRegex = colors$1 ? new RegExp(`(${Object.keys(colors$1).join("|")})(?!\\w)`, "g") : /^\b$/; const output = config2.output.map((value) => { return getFluidValue(value).replace(cssVariableRegex, variableToRgba).replace(colorRegex, colorToRgba).replace(namedColorRegex, colorToRgba); }); const keyframes = output.map((value) => value.match(numberRegex).map(Number)); const outputRanges = keyframes[0].map((_, i2) => keyframes.map((values) => { if (!(i2 in values)) { throw Error('The arity of each "output" value must be equal'); } return values[i2]; })); const interpolators = outputRanges.map((output2) => createInterpolator(_extends({}, config2, { output: output2 }))); return (input) => { var _output$find; const missingUnit = !unitRegex.test(output[0]) && ((_output$find = output.find((value) => unitRegex.test(value))) == null ? void 0 : _output$find.replace(numberRegex, "")); let i2 = 0; return output[0].replace(numberRegex, () => `${interpolators[i2++](input)}${missingUnit || ""}`).replace(rgbaRegex, rgbaRound); }; }; var prefix = "react-spring: "; var once = (fn) => { const func = fn; let called = false; if (typeof func != "function") { throw new TypeError(`${prefix}once requires a function parameter`); } return (...args) => { if (!called) { func(...args); called = true; } }; }; var warnInterpolate = once(console.warn); function deprecateInterpolate() { warnInterpolate(`${prefix}The "interpolate" function is deprecated in v9 (use "to" instead)`); } var warnDirectCall = once(console.warn); function isAnimatedString(value) { return is.str(value) && (value[0] == "#" || /\d/.test(value) || !isSSR() && cssVariableRegex.test(value) || value in (colors$1 || {})); } var useIsomorphicLayoutEffect = isSSR() ? import_react4.useEffect : import_react4.useLayoutEffect; var useIsMounted = () => { const isMounted = (0, import_react4.useRef)(false); useIsomorphicLayoutEffect(() => { isMounted.current = true; return () => { isMounted.current = false; }; }, []); return isMounted; }; function useForceUpdate() { const update4 = (0, import_react4.useState)()[1]; const isMounted = useIsMounted(); return () => { if (isMounted.current) { update4(Math.random()); } }; } function useMemoOne(getResult, inputs) { const [initial] = (0, import_react4.useState)(() => ({ inputs, result: getResult() })); const committed = (0, import_react4.useRef)(); const prevCache = committed.current; let cache = prevCache; if (cache) { const useCache = Boolean(inputs && cache.inputs && areInputsEqual(inputs, cache.inputs)); if (!useCache) { cache = { inputs, result: getResult() }; } } else { cache = initial; } (0, import_react4.useEffect)(() => { committed.current = cache; if (prevCache == initial) { initial.inputs = initial.result = void 0; } }, [cache]); return cache.result; } function areInputsEqual(next, prev) { if (next.length !== prev.length) { return false; } for (let i2 = 0; i2 < next.length; i2++) { if (next[i2] !== prev[i2]) { return false; } } return true; } var useOnce = (effect) => (0, import_react4.useEffect)(effect, emptyDeps); var emptyDeps = []; // node_modules/@react-spring/core/dist/react-spring-core.esm.js var React6 = __toESM(require_react()); var import_react6 = __toESM(require_react()); // node_modules/@react-spring/animated/dist/react-spring-animated.esm.js var React5 = __toESM(require_react()); var import_react5 = __toESM(require_react()); var $node = /* @__PURE__ */ Symbol.for("Animated:node"); var isAnimated = (value) => !!value && value[$node] === value; var getAnimated = (owner) => owner && owner[$node]; var setAnimated = (owner, node) => defineHidden(owner, $node, node); var getPayload = (owner) => owner && owner[$node] && owner[$node].getPayload(); var Animated = class { constructor() { this.payload = void 0; setAnimated(this, this); } getPayload() { return this.payload || []; } }; var AnimatedValue = class _AnimatedValue extends Animated { constructor(_value) { super(); this.done = true; this.elapsedTime = void 0; this.lastPosition = void 0; this.lastVelocity = void 0; this.v0 = void 0; this.durationProgress = 0; this._value = _value; if (is.num(this._value)) { this.lastPosition = this._value; } } static create(value) { return new _AnimatedValue(value); } getPayload() { return [this]; } getValue() { return this._value; } setValue(value, step) { if (is.num(value)) { this.lastPosition = value; if (step) { value = Math.round(value / step) * step; if (this.done) { this.lastPosition = value; } } } if (this._value === value) { return false; } this._value = value; return true; } reset() { const { done } = this; this.done = false; if (is.num(this._value)) { this.elapsedTime = 0; this.durationProgress = 0; this.lastPosition = this._value; if (done) this.lastVelocity = null; this.v0 = null; } } }; var AnimatedString = class _AnimatedString extends AnimatedValue { constructor(value) { super(0); this._string = null; this._toString = void 0; this._toString = createInterpolator({ output: [value, value] }); } static create(value) { return new _AnimatedString(value); } getValue() { let value = this._string; return value == null ? this._string = this._toString(this._value) : value; } setValue(value) { if (is.str(value)) { if (value == this._string) { return false; } this._string = value; this._value = 1; } else if (super.setValue(value)) { this._string = null; } else { return false; } return true; } reset(goal) { if (goal) { this._toString = createInterpolator({ output: [this.getValue(), goal] }); } this._value = 0; super.reset(); } }; var TreeContext = { dependencies: null }; var AnimatedObject = class extends Animated { constructor(source) { super(); this.source = source; this.setValue(source); } getValue(animated2) { const values = {}; eachProp(this.source, (source, key) => { if (isAnimated(source)) { values[key] = source.getValue(animated2); } else if (hasFluidValue(source)) { values[key] = getFluidValue(source); } else if (!animated2) { values[key] = source; } }); return values; } setValue(source) { this.source = source; this.payload = this._makePayload(source); } reset() { if (this.payload) { each(this.payload, (node) => node.reset()); } } _makePayload(source) { if (source) { const payload = /* @__PURE__ */ new Set(); eachProp(source, this._addToPayload, payload); return Array.from(payload); } } _addToPayload(source) { if (TreeContext.dependencies && hasFluidValue(source)) { TreeContext.dependencies.add(source); } const payload = getPayload(source); if (payload) { each(payload, (node) => this.add(node)); } } }; var AnimatedArray = class _AnimatedArray extends AnimatedObject { constructor(source) { super(source); } static create(source) { return new _AnimatedArray(source); } getValue() { return this.source.map((node) => node.getValue()); } setValue(source) { const payload = this.getPayload(); if (source.length == payload.length) { return payload.map((node, i2) => node.setValue(source[i2])).some(Boolean); } super.setValue(source.map(makeAnimated)); return true; } }; function makeAnimated(value) { const nodeType = isAnimatedString(value) ? AnimatedString : AnimatedValue; return nodeType.create(value); } function getAnimatedType(value) { const parentNode = getAnimated(value); return parentNode ? parentNode.constructor : is.arr(value) ? AnimatedArray : isAnimatedString(value) ? AnimatedString : AnimatedValue; } function _extends2() { _extends2 = Object.assign ? Object.assign.bind() : function(target) { for (var i2 = 1; i2 < arguments.length; i2++) { var source = arguments[i2]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends2.apply(this, arguments); } var withAnimated = (Component, host2) => { const hasInstance = !is.fun(Component) || Component.prototype && Component.prototype.isReactComponent; return (0, import_react5.forwardRef)((givenProps, givenRef) => { const instanceRef = (0, import_react5.useRef)(null); const ref = hasInstance && (0, import_react5.useCallback)((value) => { instanceRef.current = updateRef(givenRef, value); }, [givenRef]); const [props, deps] = getAnimatedState(givenProps, host2); const forceUpdate = useForceUpdate(); const callback = () => { const instance = instanceRef.current; if (hasInstance && !instance) { return; } const didUpdate = instance ? host2.applyAnimatedValues(instance, props.getValue(true)) : false; if (didUpdate === false) { forceUpdate(); } }; const observer = new PropsObserver(callback, deps); const observerRef = (0, import_react5.useRef)(); useIsomorphicLayoutEffect(() => { observerRef.current = observer; each(deps, (dep) => addFluidObserver(dep, observer)); return () => { if (observerRef.current) { each(observerRef.current.deps, (dep) => removeFluidObserver(dep, observerRef.current)); raf.cancel(observerRef.current.update); } }; }); (0, import_react5.useEffect)(callback, []); useOnce(() => () => { const observer2 = observerRef.current; each(observer2.deps, (dep) => removeFluidObserver(dep, observer2)); }); const usedProps = host2.getComponentProps(props.getValue()); return React5.createElement(Component, _extends2({}, usedProps, { ref })); }); }; var PropsObserver = class { constructor(update4, deps) { this.update = update4; this.deps = deps; } eventObserved(event) { if (event.type == "change") { raf.write(this.update); } } }; function getAnimatedState(props, host2) { const dependencies = /* @__PURE__ */ new Set(); TreeContext.dependencies = dependencies; if (props.style) props = _extends2({}, props, { style: host2.createAnimatedStyle(props.style) }); props = new AnimatedObject(props); TreeContext.dependencies = null; return [props, dependencies]; } function updateRef(ref, value) { if (ref) { if (is.fun(ref)) ref(value); else ref.current = value; } return value; } var cacheKey = /* @__PURE__ */ Symbol.for("AnimatedComponent"); var createHost = (components, { applyAnimatedValues: _applyAnimatedValues = () => false, createAnimatedStyle: _createAnimatedStyle = (style) => new AnimatedObject(style), getComponentProps: _getComponentProps = (props) => props } = {}) => { const hostConfig = { applyAnimatedValues: _applyAnimatedValues, createAnimatedStyle: _createAnimatedStyle, getComponentProps: _getComponentProps }; const animated2 = (Component) => { const displayName = getDisplayName(Component) || "Anonymous"; if (is.str(Component)) { Component = animated2[Component] || (animated2[Component] = withAnimated(Component, hostConfig)); } else { Component = Component[cacheKey] || (Component[cacheKey] = withAnimated(Component, hostConfig)); } Component.displayName = `Animated(${displayName})`; return Component; }; eachProp(components, (Component, key) => { if (is.arr(components)) { key = getDisplayName(Component); } animated2[key] = animated2(Component); }); return { animated: animated2 }; }; var getDisplayName = (arg) => is.str(arg) ? arg : arg && is.str(arg.displayName) ? arg.displayName : is.fun(arg) && arg.name || null; // node_modules/@react-spring/core/dist/react-spring-core.esm.js function _extends3() { _extends3 = Object.assign ? Object.assign.bind() : function(target) { for (var i2 = 1; i2 < arguments.length; i2++) { var source = arguments[i2]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends3.apply(this, arguments); } function callProp(value, ...args) { return is.fun(value) ? value(...args) : value; } var matchProp = (value, key) => value === true || !!(key && value && (is.fun(value) ? value(key) : toArray(value).includes(key))); var resolveProp = (prop, key) => is.obj(prop) ? key && prop[key] : prop; var getDefaultProp = (props, key) => props.default === true ? props[key] : props.default ? props.default[key] : void 0; var noopTransform = (value) => value; var getDefaultProps = (props, transform = noopTransform) => { let keys = DEFAULT_PROPS; if (props.default && props.default !== true) { props = props.default; keys = Object.keys(props); } const defaults2 = {}; for (const key of keys) { const value = transform(props[key], key); if (!is.und(value)) { defaults2[key] = value; } } return defaults2; }; var DEFAULT_PROPS = ["config", "onProps", "onStart", "onChange", "onPause", "onResume", "onRest"]; var RESERVED_PROPS = { config: 1, from: 1, to: 1, ref: 1, loop: 1, reset: 1, pause: 1, cancel: 1, reverse: 1, immediate: 1, default: 1, delay: 1, onProps: 1, onStart: 1, onChange: 1, onPause: 1, onResume: 1, onRest: 1, onResolve: 1, items: 1, trail: 1, sort: 1, expires: 1, initial: 1, enter: 1, update: 1, leave: 1, children: 1, onDestroyed: 1, keys: 1, callId: 1, parentId: 1 }; function getForwardProps(props) { const forward = {}; let count = 0; eachProp(props, (value, prop) => { if (!RESERVED_PROPS[prop]) { forward[prop] = value; count++; } }); if (count) { return forward; } } function inferTo(props) { const to2 = getForwardProps(props); if (to2) { const out = { to: to2 }; eachProp(props, (val, key) => key in to2 || (out[key] = val)); return out; } return _extends3({}, props); } function computeGoal(value) { value = getFluidValue(value); return is.arr(value) ? value.map(computeGoal) : isAnimatedString(value) ? globals.createStringInterpolator({ range: [0, 1], output: [value, value] })(1) : value; } function isAsyncTo(to2) { return is.fun(to2) || is.arr(to2) && is.obj(to2[0]); } var config = { default: { tension: 170, friction: 26 }, gentle: { tension: 120, friction: 14 }, wobbly: { tension: 180, friction: 12 }, stiff: { tension: 210, friction: 20 }, slow: { tension: 280, friction: 60 }, molasses: { tension: 280, friction: 120 } }; var c1 = 1.70158; var c2 = c1 * 1.525; var c3 = c1 + 1; var c4 = 2 * Math.PI / 3; var c5 = 2 * Math.PI / 4.5; var bounceOut = (x2) => { const n1 = 7.5625; const d1 = 2.75; if (x2 < 1 / d1) { return n1 * x2 * x2; } else if (x2 < 2 / d1) { return n1 * (x2 -= 1.5 / d1) * x2 + 0.75; } else if (x2 < 2.5 / d1) { return n1 * (x2 -= 2.25 / d1) * x2 + 0.9375; } else { return n1 * (x2 -= 2.625 / d1) * x2 + 0.984375; } }; var easings = { linear: (x2) => x2, easeInQuad: (x2) => x2 * x2, easeOutQuad: (x2) => 1 - (1 - x2) * (1 - x2), easeInOutQuad: (x2) => x2 < 0.5 ? 2 * x2 * x2 : 1 - Math.pow(-2 * x2 + 2, 2) / 2, easeInCubic: (x2) => x2 * x2 * x2, easeOutCubic: (x2) => 1 - Math.pow(1 - x2, 3), easeInOutCubic: (x2) => x2 < 0.5 ? 4 * x2 * x2 * x2 : 1 - Math.pow(-2 * x2 + 2, 3) / 2, easeInQuart: (x2) => x2 * x2 * x2 * x2, easeOutQuart: (x2) => 1 - Math.pow(1 - x2, 4), easeInOutQuart: (x2) => x2 < 0.5 ? 8 * x2 * x2 * x2 * x2 : 1 - Math.pow(-2 * x2 + 2, 4) / 2, easeInQuint: (x2) => x2 * x2 * x2 * x2 * x2, easeOutQuint: (x2) => 1 - Math.pow(1 - x2, 5), easeInOutQuint: (x2) => x2 < 0.5 ? 16 * x2 * x2 * x2 * x2 * x2 : 1 - Math.pow(-2 * x2 + 2, 5) / 2, easeInSine: (x2) => 1 - Math.cos(x2 * Math.PI / 2), easeOutSine: (x2) => Math.sin(x2 * Math.PI / 2), easeInOutSine: (x2) => -(Math.cos(Math.PI * x2) - 1) / 2, easeInExpo: (x2) => x2 === 0 ? 0 : Math.pow(2, 10 * x2 - 10), easeOutExpo: (x2) => x2 === 1 ? 1 : 1 - Math.pow(2, -10 * x2), easeInOutExpo: (x2) => x2 === 0 ? 0 : x2 === 1 ? 1 : x2 < 0.5 ? Math.pow(2, 20 * x2 - 10) / 2 : (2 - Math.pow(2, -20 * x2 + 10)) / 2, easeInCirc: (x2) => 1 - Math.sqrt(1 - Math.pow(x2, 2)), easeOutCirc: (x2) => Math.sqrt(1 - Math.pow(x2 - 1, 2)), easeInOutCirc: (x2) => x2 < 0.5 ? (1 - Math.sqrt(1 - Math.pow(2 * x2, 2))) / 2 : (Math.sqrt(1 - Math.pow(-2 * x2 + 2, 2)) + 1) / 2, easeInBack: (x2) => c3 * x2 * x2 * x2 - c1 * x2 * x2, easeOutBack: (x2) => 1 + c3 * Math.pow(x2 - 1, 3) + c1 * Math.pow(x2 - 1, 2), easeInOutBack: (x2) => x2 < 0.5 ? Math.pow(2 * x2, 2) * ((c2 + 1) * 2 * x2 - c2) / 2 : (Math.pow(2 * x2 - 2, 2) * ((c2 + 1) * (x2 * 2 - 2) + c2) + 2) / 2, easeInElastic: (x2) => x2 === 0 ? 0 : x2 === 1 ? 1 : -Math.pow(2, 10 * x2 - 10) * Math.sin((x2 * 10 - 10.75) * c4), easeOutElastic: (x2) => x2 === 0 ? 0 : x2 === 1 ? 1 : Math.pow(2, -10 * x2) * Math.sin((x2 * 10 - 0.75) * c4) + 1, easeInOutElastic: (x2) => x2 === 0 ? 0 : x2 === 1 ? 1 : x2 < 0.5 ? -(Math.pow(2, 20 * x2 - 10) * Math.sin((20 * x2 - 11.125) * c5)) / 2 : Math.pow(2, -20 * x2 + 10) * Math.sin((20 * x2 - 11.125) * c5) / 2 + 1, easeInBounce: (x2) => 1 - bounceOut(1 - x2), easeOutBounce: bounceOut, easeInOutBounce: (x2) => x2 < 0.5 ? (1 - bounceOut(1 - 2 * x2)) / 2 : (1 + bounceOut(2 * x2 - 1)) / 2 }; var defaults = _extends3({}, config.default, { mass: 1, damping: 1, easing: easings.linear, clamp: false }); var AnimationConfig = class { constructor() { this.tension = void 0; this.friction = void 0; this.frequency = void 0; this.damping = void 0; this.mass = void 0; this.velocity = 0; this.restVelocity = void 0; this.precision = void 0; this.progress = void 0; this.duration = void 0; this.easing = void 0; this.clamp = void 0; this.bounce = void 0; this.decay = void 0; this.round = void 0; Object.assign(this, defaults); } }; function mergeConfig(config2, newConfig, defaultConfig) { if (defaultConfig) { defaultConfig = _extends3({}, defaultConfig); sanitizeConfig(defaultConfig, newConfig); newConfig = _extends3({}, defaultConfig, newConfig); } sanitizeConfig(config2, newConfig); Object.assign(config2, newConfig); for (const key in defaults) { if (config2[key] == null) { config2[key] = defaults[key]; } } let { mass, frequency, damping } = config2; if (!is.und(frequency)) { if (frequency < 0.01) frequency = 0.01; if (damping < 0) damping = 0; config2.tension = Math.pow(2 * Math.PI / frequency, 2) * mass; config2.friction = 4 * Math.PI * damping * mass / frequency; } return config2; } function sanitizeConfig(config2, props) { if (!is.und(props.decay)) { config2.duration = void 0; } else { const isTensionConfig = !is.und(props.tension) || !is.und(props.friction); if (isTensionConfig || !is.und(props.frequency) || !is.und(props.damping) || !is.und(props.mass)) { config2.duration = void 0; config2.decay = void 0; } if (isTensionConfig) { config2.frequency = void 0; } } } var emptyArray = []; var Animation = class { constructor() { this.changed = false; this.values = emptyArray; this.toValues = null; this.fromValues = emptyArray; this.to = void 0; this.from = void 0; this.config = new AnimationConfig(); this.immediate = false; } }; function scheduleProps(callId, { key, props, defaultProps, state, actions }) { return new Promise((resolve, reject) => { var _props$cancel; let delay; let timeout; let cancel = matchProp((_props$cancel = props.cancel) != null ? _props$cancel : defaultProps == null ? void 0 : defaultProps.cancel, key); if (cancel) { onStart(); } else { if (!is.und(props.pause)) { state.paused = matchProp(props.pause, key); } let pause = defaultProps == null ? void 0 : defaultProps.pause; if (pause !== true) { pause = state.paused || matchProp(pause, key); } delay = callProp(props.delay || 0, key); if (pause) { state.resumeQueue.add(onResume); actions.pause(); } else { actions.resume(); onResume(); } } function onPause() { state.resumeQueue.add(onResume); state.timeouts.delete(timeout); timeout.cancel(); delay = timeout.time - raf.now(); } function onResume() { if (delay > 0 && !globals.skipAnimation) { state.delayed = true; timeout = raf.setTimeout(onStart, delay); state.pauseQueue.add(onPause); state.timeouts.add(timeout); } else { onStart(); } } function onStart() { if (state.delayed) { state.delayed = false; } state.pauseQueue.delete(onPause); state.timeouts.delete(timeout); if (callId <= (state.cancelId || 0)) { cancel = true; } try { actions.start(_extends3({}, props, { callId, cancel }), resolve); } catch (err) { reject(err); } } }); } var getCombinedResult = (target, results) => results.length == 1 ? results[0] : results.some((result) => result.cancelled) ? getCancelledResult(target.get()) : results.every((result) => result.noop) ? getNoopResult(target.get()) : getFinishedResult(target.get(), results.every((result) => result.finished)); var getNoopResult = (value) => ({ value, noop: true, finished: true, cancelled: false }); var getFinishedResult = (value, finished, cancelled = false) => ({ value, finished, cancelled }); var getCancelledResult = (value) => ({ value, cancelled: true, finished: false }); function runAsync(to2, props, state, target) { const { callId, parentId, onRest } = props; const { asyncTo: prevTo, promise: prevPromise } = state; if (!parentId && to2 === prevTo && !props.reset) { return prevPromise; } return state.promise = (async () => { state.asyncId = callId; state.asyncTo = to2; const defaultProps = getDefaultProps(props, (value, key) => key === "onRest" ? void 0 : value); let preventBail; let bail; const bailPromise = new Promise((resolve, reject) => (preventBail = resolve, bail = reject)); const bailIfEnded = (bailSignal) => { const bailResult = callId <= (state.cancelId || 0) && getCancelledResult(target) || callId !== state.asyncId && getFinishedResult(target, false); if (bailResult) { bailSignal.result = bailResult; bail(bailSignal); throw bailSignal; } }; const animate = (arg1, arg2) => { const bailSignal = new BailSignal(); const skipAnimationSignal = new SkipAniamtionSignal(); return (async () => { if (globals.skipAnimation) { stopAsync(state); skipAnimationSignal.result = getFinishedResult(target, false); bail(skipAnimationSignal); throw skipAnimationSignal; } bailIfEnded(bailSignal); const props2 = is.obj(arg1) ? _extends3({}, arg1) : _extends3({}, arg2, { to: arg1 }); props2.parentId = callId; eachProp(defaultProps, (value, key) => { if (is.und(props2[key])) { props2[key] = value; } }); const result2 = await target.start(props2); bailIfEnded(bailSignal); if (state.paused) { await new Promise((resume) => { state.resumeQueue.add(resume); }); } return result2; })(); }; let result; if (globals.skipAnimation) { stopAsync(state); return getFinishedResult(target, false); } try { let animating; if (is.arr(to2)) { animating = (async (queue) => { for (const props2 of queue) { await animate(props2); } })(to2); } else { animating = Promise.resolve(to2(animate, target.stop.bind(target))); } await Promise.all([animating.then(preventBail), bailPromise]); result = getFinishedResult(target.get(), true, false); } catch (err) { if (err instanceof BailSignal) { result = err.result; } else if (err instanceof SkipAniamtionSignal) { result = err.result; } else { throw err; } } finally { if (callId == state.asyncId) { state.asyncId = parentId; state.asyncTo = parentId ? prevTo : void 0; state.promise = parentId ? prevPromise : void 0; } } if (is.fun(onRest)) { raf.batchedUpdates(() => { onRest(result, target, target.item); }); } return result; })(); } function stopAsync(state, cancelId) { flush(state.timeouts, (t3) => t3.cancel()); state.pauseQueue.clear(); state.resumeQueue.clear(); state.asyncId = state.asyncTo = state.promise = void 0; if (cancelId) state.cancelId = cancelId; } var BailSignal = class extends Error { constructor() { super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise."); this.result = void 0; } }; var SkipAniamtionSignal = class extends Error { constructor() { super("SkipAnimationSignal"); this.result = void 0; } }; var isFrameValue = (value) => value instanceof FrameValue; var nextId$1 = 1; var FrameValue = class extends FluidValue { constructor(...args) { super(...args); this.id = nextId$1++; this.key = void 0; this._priority = 0; } get priority() { return this._priority; } set priority(priority2) { if (this._priority != priority2) { this._priority = priority2; this._onPriorityChange(priority2); } } get() { const node = getAnimated(this); return node && node.getValue(); } to(...args) { return globals.to(this, args); } interpolate(...args) { deprecateInterpolate(); return globals.to(this, args); } toJSON() { return this.get(); } observerAdded(count) { if (count == 1) this._attach(); } observerRemoved(count) { if (count == 0) this._detach(); } _attach() { } _detach() { } _onChange(value, idle = false) { callFluidObservers(this, { type: "change", parent: this, value, idle }); } _onPriorityChange(priority2) { if (!this.idle) { frameLoop.sort(this); } callFluidObservers(this, { type: "priority", parent: this, priority: priority2 }); } }; var $P = /* @__PURE__ */ Symbol.for("SpringPhase"); var HAS_ANIMATED = 1; var IS_ANIMATING = 2; var IS_PAUSED = 4; var hasAnimated = (target) => (target[$P] & HAS_ANIMATED) > 0; var isAnimating = (target) => (target[$P] & IS_ANIMATING) > 0; var isPaused = (target) => (target[$P] & IS_PAUSED) > 0; var setActiveBit = (target, active) => active ? target[$P] |= IS_ANIMATING | HAS_ANIMATED : target[$P] &= ~IS_ANIMATING; var setPausedBit = (target, paused) => paused ? target[$P] |= IS_PAUSED : target[$P] &= ~IS_PAUSED; var SpringValue = class extends FrameValue { constructor(arg1, arg2) { super(); this.key = void 0; this.animation = new Animation(); this.queue = void 0; this.defaultProps = {}; this._state = { paused: false, delayed: false, pauseQueue: /* @__PURE__ */ new Set(), resumeQueue: /* @__PURE__ */ new Set(), timeouts: /* @__PURE__ */ new Set() }; this._pendingCalls = /* @__PURE__ */ new Set(); this._lastCallId = 0; this._lastToId = 0; this._memoizedDuration = 0; if (!is.und(arg1) || !is.und(arg2)) { const props = is.obj(arg1) ? _extends3({}, arg1) : _extends3({}, arg2, { from: arg1 }); if (is.und(props.default)) { props.default = true; } this.start(props); } } get idle() { return !(isAnimating(this) || this._state.asyncTo) || isPaused(this); } get goal() { return getFluidValue(this.animation.to); } get velocity() { const node = getAnimated(this); return node instanceof AnimatedValue ? node.lastVelocity || 0 : node.getPayload().map((node2) => node2.lastVelocity || 0); } get hasAnimated() { return hasAnimated(this); } get isAnimating() { return isAnimating(this); } get isPaused() { return isPaused(this); } get isDelayed() { return this._state.delayed; } advance(dt) { let idle = true; let changed = false; const anim = this.animation; let { config: config2, toValues } = anim; const payload = getPayload(anim.to); if (!payload && hasFluidValue(anim.to)) { toValues = toArray(getFluidValue(anim.to)); } anim.values.forEach((node2, i2) => { if (node2.done) return; const to2 = node2.constructor == AnimatedString ? 1 : payload ? payload[i2].lastPosition : toValues[i2]; let finished = anim.immediate; let position = to2; if (!finished) { position = node2.lastPosition; if (config2.tension <= 0) { node2.done = true; return; } let elapsed = node2.elapsedTime += dt; const from = anim.fromValues[i2]; const v0 = node2.v0 != null ? node2.v0 : node2.v0 = is.arr(config2.velocity) ? config2.velocity[i2] : config2.velocity; let velocity; const precision = config2.precision || (from == to2 ? 5e-3 : Math.min(1, Math.abs(to2 - from) * 1e-3)); if (!is.und(config2.duration)) { let p3 = 1; if (config2.duration > 0) { if (this._memoizedDuration !== config2.duration) { this._memoizedDuration = config2.duration; if (node2.durationProgress > 0) { node2.elapsedTime = config2.duration * node2.durationProgress; elapsed = node2.elapsedTime += dt; } } p3 = (config2.progress || 0) + elapsed / this._memoizedDuration; p3 = p3 > 1 ? 1 : p3 < 0 ? 0 : p3; node2.durationProgress = p3; } position = from + config2.easing(p3) * (to2 - from); velocity = (position - node2.lastPosition) / dt; finished = p3 == 1; } else if (config2.decay) { const decay = config2.decay === true ? 0.998 : config2.decay; const e2 = Math.exp(-(1 - decay) * elapsed); position = from + v0 / (1 - decay) * (1 - e2); finished = Math.abs(node2.lastPosition - position) <= precision; velocity = v0 * e2; } else { velocity = node2.lastVelocity == null ? v0 : node2.lastVelocity; const restVelocity = config2.restVelocity || precision / 10; const bounceFactor = config2.clamp ? 0 : config2.bounce; const canBounce = !is.und(bounceFactor); const isGrowing = from == to2 ? node2.v0 > 0 : from < to2; let isMoving; let isBouncing = false; const step = 1; const numSteps = Math.ceil(dt / step); for (let n2 = 0; n2 < numSteps; ++n2) { isMoving = Math.abs(velocity) > restVelocity; if (!isMoving) { finished = Math.abs(to2 - position) <= precision; if (finished) { break; } } if (canBounce) { isBouncing = position == to2 || position > to2 == isGrowing; if (isBouncing) { velocity = -velocity * bounceFactor; position = to2; } } const springForce = -config2.tension * 1e-6 * (position - to2); const dampingForce = -config2.friction * 1e-3 * velocity; const acceleration = (springForce + dampingForce) / config2.mass; velocity = velocity + acceleration * step; position = position + velocity * step; } } node2.lastVelocity = velocity; if (Number.isNaN(position)) { console.warn(`Got NaN while animating:`, this); finished = true; } } if (payload && !payload[i2].done) { finished = false; } if (finished) { node2.done = true; } else { idle = false; } if (node2.setValue(position, config2.round)) { changed = true; } }); const node = getAnimated(this); const currVal = node.getValue(); if (idle) { const finalVal = getFluidValue(anim.to); if ((currVal !== finalVal || changed) && !config2.decay) { node.setValue(finalVal); this._onChange(finalVal); } else if (changed && config2.decay) { this._onChange(currVal); } this._stop(); } else if (changed) { this._onChange(currVal); } } set(value) { raf.batchedUpdates(() => { this._stop(); this._focus(value); this._set(value); }); return this; } pause() { this._update({ pause: true }); } resume() { this._update({ pause: false }); } finish() { if (isAnimating(this)) { const { to: to2, config: config2 } = this.animation; raf.batchedUpdates(() => { this._onStart(); if (!config2.decay) { this._set(to2, false); } this._stop(); }); } return this; } update(props) { const queue = this.queue || (this.queue = []); queue.push(props); return this; } start(to2, arg2) { let queue; if (!is.und(to2)) { queue = [is.obj(to2) ? to2 : _extends3({}, arg2, { to: to2 })]; } else { queue = this.queue || []; this.queue = []; } return Promise.all(queue.map((props) => { const up = this._update(props); return up; })).then((results) => getCombinedResult(this, results)); } stop(cancel) { const { to: to2 } = this.animation; this._focus(this.get()); stopAsync(this._state, cancel && this._lastCallId); raf.batchedUpdates(() => this._stop(to2, cancel)); return this; } reset() { this._update({ reset: true }); } eventObserved(event) { if (event.type == "change") { this._start(); } else if (event.type == "priority") { this.priority = event.priority + 1; } } _prepareNode(props) { const key = this.key || ""; let { to: to2, from } = props; to2 = is.obj(to2) ? to2[key] : to2; if (to2 == null || isAsyncTo(to2)) { to2 = void 0; } from = is.obj(from) ? from[key] : from; if (from == null) { from = void 0; } const range = { to: to2, from }; if (!hasAnimated(this)) { if (props.reverse) [to2, from] = [from, to2]; from = getFluidValue(from); if (!is.und(from)) { this._set(from); } else if (!getAnimated(this)) { this._set(to2); } } return range; } _update(_ref, isLoop) { let props = _extends3({}, _ref); const { key, defaultProps } = this; if (props.default) Object.assign(defaultProps, getDefaultProps(props, (value, prop) => /^on/.test(prop) ? resolveProp(value, key) : value)); mergeActiveFn(this, props, "onProps"); sendEvent(this, "onProps", props, this); const range = this._prepareNode(props); if (Object.isFrozen(this)) { throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?"); } const state = this._state; return scheduleProps(++this._lastCallId, { key, props, defaultProps, state, actions: { pause: () => { if (!isPaused(this)) { setPausedBit(this, true); flushCalls(state.pauseQueue); sendEvent(this, "onPause", getFinishedResult(this, checkFinished(this, this.animation.to)), this); } }, resume: () => { if (isPaused(this)) { setPausedBit(this, false); if (isAnimating(this)) { this._resume(); } flushCalls(state.resumeQueue); sendEvent(this, "onResume", getFinishedResult(this, checkFinished(this, this.animation.to)), this); } }, start: this._merge.bind(this, range) } }).then((result) => { if (props.loop && result.finished && !(isLoop && result.noop)) { const nextProps = createLoopUpdate(props); if (nextProps) { return this._update(nextProps, true); } } return result; }); } _merge(range, props, resolve) { if (props.cancel) { this.stop(true); return resolve(getCancelledResult(this)); } const hasToProp = !is.und(range.to); const hasFromProp = !is.und(range.from); if (hasToProp || hasFromProp) { if (props.callId > this._lastToId) { this._lastToId = props.callId; } else { return resolve(getCancelledResult(this)); } } const { key, defaultProps, animation: anim } = this; const { to: prevTo, from: prevFrom } = anim; let { to: to2 = prevTo, from = prevFrom } = range; if (hasFromProp && !hasToProp && (!props.default || is.und(to2))) { to2 = from; } if (props.reverse) [to2, from] = [from, to2]; const hasFromChanged = !isEqual(from, prevFrom); if (hasFromChanged) { anim.from = from; } from = getFluidValue(from); const hasToChanged = !isEqual(to2, prevTo); if (hasToChanged) { this._focus(to2); } const hasAsyncTo = isAsyncTo(props.to); const { config: config2 } = anim; const { decay, velocity } = config2; if (hasToProp || hasFromProp) { config2.velocity = 0; } if (props.config && !hasAsyncTo) { mergeConfig(config2, callProp(props.config, key), props.config !== defaultProps.config ? callProp(defaultProps.config, key) : void 0); } let node = getAnimated(this); if (!node || is.und(to2)) { return resolve(getFinishedResult(this, true)); } const reset = is.und(props.reset) ? hasFromProp && !props.default : !is.und(from) && matchProp(props.reset, key); const value = reset ? from : this.get(); const goal = computeGoal(to2); const isAnimatable = is.num(goal) || is.arr(goal) || isAnimatedString(goal); const immediate = !hasAsyncTo && (!isAnimatable || matchProp(defaultProps.immediate || props.immediate, key)); if (hasToChanged) { const nodeType = getAnimatedType(to2); if (nodeType !== node.constructor) { if (immediate) { node = this._set(goal); } else throw Error(`Cannot animate between ${node.constructor.name} and ${nodeType.name}, as the "to" prop suggests`); } } const goalType = node.constructor; let started = hasFluidValue(to2); let finished = false; if (!started) { const hasValueChanged = reset || !hasAnimated(this) && hasFromChanged; if (hasToChanged || hasValueChanged) { finished = isEqual(computeGoal(value), goal); started = !finished; } if (!isEqual(anim.immediate, immediate) && !immediate || !isEqual(config2.decay, decay) || !isEqual(config2.velocity, velocity)) { started = true; } } if (finished && isAnimating(this)) { if (anim.changed && !reset) { started = true; } else if (!started) { this._stop(prevTo); } } if (!hasAsyncTo) { if (started || hasFluidValue(prevTo)) { anim.values = node.getPayload(); anim.toValues = hasFluidValue(to2) ? null : goalType == AnimatedString ? [1] : toArray(goal); } if (anim.immediate != immediate) { anim.immediate = immediate; if (!immediate && !reset) { this._set(prevTo); } } if (started) { const { onRest } = anim; each(ACTIVE_EVENTS, (type) => mergeActiveFn(this, props, type)); const result = getFinishedResult(this, checkFinished(this, prevTo)); flushCalls(this._pendingCalls, result); this._pendingCalls.add(resolve); if (anim.changed) raf.batchedUpdates(() => { anim.changed = !reset; onRest == null ? void 0 : onRest(result, this); if (reset) { callProp(defaultProps.onRest, result); } else { anim.onStart == null ? void 0 : anim.onStart(result, this); } }); } } if (reset) { this._set(value); } if (hasAsyncTo) { resolve(runAsync(props.to, props, this._state, this)); } else if (started) { this._start(); } else if (isAnimating(this) && !hasToChanged) { this._pendingCalls.add(resolve); } else { resolve(getNoopResult(value)); } } _focus(value) { const anim = this.animation; if (value !== anim.to) { if (getFluidObservers(this)) { this._detach(); } anim.to = value; if (getFluidObservers(this)) { this._attach(); } } } _attach() { let priority2 = 0; const { to: to2 } = this.animation; if (hasFluidValue(to2)) { addFluidObserver(to2, this); if (isFrameValue(to2)) { priority2 = to2.priority + 1; } } this.priority = priority2; } _detach() { const { to: to2 } = this.animation; if (hasFluidValue(to2)) { removeFluidObserver(to2, this); } } _set(arg, idle = true) { const value = getFluidValue(arg); if (!is.und(value)) { const oldNode = getAnimated(this); if (!oldNode || !isEqual(value, oldNode.getValue())) { const nodeType = getAnimatedType(value); if (!oldNode || oldNode.constructor != nodeType) { setAnimated(this, nodeType.create(value)); } else { oldNode.setValue(value); } if (oldNode) { raf.batchedUpdates(() => { this._onChange(value, idle); }); } } } return getAnimated(this); } _onStart() { const anim = this.animation; if (!anim.changed) { anim.changed = true; sendEvent(this, "onStart", getFinishedResult(this, checkFinished(this, anim.to)), this); } } _onChange(value, idle) { if (!idle) { this._onStart(); callProp(this.animation.onChange, value, this); } callProp(this.defaultProps.onChange, value, this); super._onChange(value, idle); } _start() { const anim = this.animation; getAnimated(this).reset(getFluidValue(anim.to)); if (!anim.immediate) { anim.fromValues = anim.values.map((node) => node.lastPosition); } if (!isAnimating(this)) { setActiveBit(this, true); if (!isPaused(this)) { this._resume(); } } } _resume() { if (globals.skipAnimation) { this.finish(); } else { frameLoop.start(this); } } _stop(goal, cancel) { if (isAnimating(this)) { setActiveBit(this, false); const anim = this.animation; each(anim.values, (node) => { node.done = true; }); if (anim.toValues) { anim.onChange = anim.onPause = anim.onResume = void 0; } callFluidObservers(this, { type: "idle", parent: this }); const result = cancel ? getCancelledResult(this.get()) : getFinishedResult(this.get(), checkFinished(this, goal != null ? goal : anim.to)); flushCalls(this._pendingCalls, result); if (anim.changed) { anim.changed = false; sendEvent(this, "onRest", result, this); } } } }; function checkFinished(target, to2) { const goal = computeGoal(to2); const value = computeGoal(target.get()); return isEqual(value, goal); } function createLoopUpdate(props, loop2 = props.loop, to2 = props.to) { let loopRet = callProp(loop2); if (loopRet) { const overrides = loopRet !== true && inferTo(loopRet); const reverse = (overrides || props).reverse; const reset = !overrides || overrides.reset; return createUpdate(_extends3({}, props, { loop: loop2, default: false, pause: void 0, to: !reverse || isAsyncTo(to2) ? to2 : void 0, from: reset ? props.from : void 0, reset }, overrides)); } } function createUpdate(props) { const { to: to2, from } = props = inferTo(props); const keys = /* @__PURE__ */ new Set(); if (is.obj(to2)) findDefined(to2, keys); if (is.obj(from)) findDefined(from, keys); props.keys = keys.size ? Array.from(keys) : null; return props; } function findDefined(values, keys) { eachProp(values, (value, key) => value != null && keys.add(key)); } var ACTIVE_EVENTS = ["onStart", "onRest", "onChange", "onPause", "onResume"]; function mergeActiveFn(target, props, type) { target.animation[type] = props[type] !== getDefaultProp(props, type) ? resolveProp(props[type], target.key) : void 0; } function sendEvent(target, type, ...args) { var _target$animation$typ, _target$animation, _target$defaultProps$, _target$defaultProps; (_target$animation$typ = (_target$animation = target.animation)[type]) == null ? void 0 : _target$animation$typ.call(_target$animation, ...args); (_target$defaultProps$ = (_target$defaultProps = target.defaultProps)[type]) == null ? void 0 : _target$defaultProps$.call(_target$defaultProps, ...args); } var BATCHED_EVENTS = ["onStart", "onChange", "onRest"]; var nextId = 1; var Controller = class { constructor(props, flush2) { this.id = nextId++; this.springs = {}; this.queue = []; this.ref = void 0; this._flush = void 0; this._initialProps = void 0; this._lastAsyncId = 0; this._active = /* @__PURE__ */ new Set(); this._changed = /* @__PURE__ */ new Set(); this._started = false; this._item = void 0; this._state = { paused: false, pauseQueue: /* @__PURE__ */ new Set(), resumeQueue: /* @__PURE__ */ new Set(), timeouts: /* @__PURE__ */ new Set() }; this._events = { onStart: /* @__PURE__ */ new Map(), onChange: /* @__PURE__ */ new Map(), onRest: /* @__PURE__ */ new Map() }; this._onFrame = this._onFrame.bind(this); if (flush2) { this._flush = flush2; } if (props) { this.start(_extends3({ default: true }, props)); } } get idle() { return !this._state.asyncTo && Object.values(this.springs).every((spring) => { return spring.idle && !spring.isDelayed && !spring.isPaused; }); } get item() { return this._item; } set item(item) { this._item = item; } get() { const values = {}; this.each((spring, key) => values[key] = spring.get()); return values; } set(values) { for (const key in values) { const value = values[key]; if (!is.und(value)) { this.springs[key].set(value); } } } update(props) { if (props) { this.queue.push(createUpdate(props)); } return this; } start(props) { let { queue } = this; if (props) { queue = toArray(props).map(createUpdate); } else { this.queue = []; } if (this._flush) { return this._flush(this, queue); } prepareKeys(this, queue); return flushUpdateQueue(this, queue); } stop(arg, keys) { if (arg !== !!arg) { keys = arg; } if (keys) { const springs = this.springs; each(toArray(keys), (key) => springs[key].stop(!!arg)); } else { stopAsync(this._state, this._lastAsyncId); this.each((spring) => spring.stop(!!arg)); } return this; } pause(keys) { if (is.und(keys)) { this.start({ pause: true }); } else { const springs = this.springs; each(toArray(keys), (key) => springs[key].pause()); } return this; } resume(keys) { if (is.und(keys)) { this.start({ pause: false }); } else { const springs = this.springs; each(toArray(keys), (key) => springs[key].resume()); } return this; } each(iterator) { eachProp(this.springs, iterator); } _onFrame() { const { onStart, onChange, onRest } = this._events; const active = this._active.size > 0; const changed = this._changed.size > 0; if (active && !this._started || changed && !this._started) { this._started = true; flush(onStart, ([onStart2, result]) => { result.value = this.get(); onStart2(result, this, this._item); }); } const idle = !active && this._started; const values = changed || idle && onRest.size ? this.get() : null; if (changed && onChange.size) { flush(onChange, ([onChange2, result]) => { result.value = values; onChange2(result, this, this._item); }); } if (idle) { this._started = false; flush(onRest, ([onRest2, result]) => { result.value = values; onRest2(result, this, this._item); }); } } eventObserved(event) { if (event.type == "change") { this._changed.add(event.parent); if (!event.idle) { this._active.add(event.parent); } } else if (event.type == "idle") { this._active.delete(event.parent); } else return; raf.onFrame(this._onFrame); } }; function flushUpdateQueue(ctrl, queue) { return Promise.all(queue.map((props) => flushUpdate(ctrl, props))).then((results) => getCombinedResult(ctrl, results)); } async function flushUpdate(ctrl, props, isLoop) { const { keys, to: to2, from, loop: loop2, onRest, onResolve } = props; const defaults2 = is.obj(props.default) && props.default; if (loop2) { props.loop = false; } if (to2 === false) props.to = null; if (from === false) props.from = null; const asyncTo = is.arr(to2) || is.fun(to2) ? to2 : void 0; if (asyncTo) { props.to = void 0; props.onRest = void 0; if (defaults2) { defaults2.onRest = void 0; } } else { each(BATCHED_EVENTS, (key) => { const handler = props[key]; if (is.fun(handler)) { const queue = ctrl["_events"][key]; props[key] = ({ finished, cancelled }) => { const result2 = queue.get(handler); if (result2) { if (!finished) result2.finished = false; if (cancelled) result2.cancelled = true; } else { queue.set(handler, { value: null, finished: finished || false, cancelled: cancelled || false }); } }; if (defaults2) { defaults2[key] = props[key]; } } }); } const state = ctrl["_state"]; if (props.pause === !state.paused) { state.paused = props.pause; flushCalls(props.pause ? state.pauseQueue : state.resumeQueue); } else if (state.paused) { props.pause = true; } const promises = (keys || Object.keys(ctrl.springs)).map((key) => ctrl.springs[key].start(props)); const cancel = props.cancel === true || getDefaultProp(props, "cancel") === true; if (asyncTo || cancel && state.asyncId) { promises.push(scheduleProps(++ctrl["_lastAsyncId"], { props, state, actions: { pause: noop, resume: noop, start(props2, resolve) { if (cancel) { stopAsync(state, ctrl["_lastAsyncId"]); resolve(getCancelledResult(ctrl)); } else { props2.onRest = onRest; resolve(runAsync(asyncTo, props2, state, ctrl)); } } } })); } if (state.paused) { await new Promise((resume) => { state.resumeQueue.add(resume); }); } const result = getCombinedResult(ctrl, await Promise.all(promises)); if (loop2 && result.finished && !(isLoop && result.noop)) { const nextProps = createLoopUpdate(props, loop2, to2); if (nextProps) { prepareKeys(ctrl, [nextProps]); return flushUpdate(ctrl, nextProps, true); } } if (onResolve) { raf.batchedUpdates(() => onResolve(result, ctrl, ctrl.item)); } return result; } function createSpring(key, observer) { const spring = new SpringValue(); spring.key = key; if (observer) { addFluidObserver(spring, observer); } return spring; } function prepareSprings(springs, props, create) { if (props.keys) { each(props.keys, (key) => { const spring = springs[key] || (springs[key] = create(key)); spring["_prepareNode"](props); }); } } function prepareKeys(ctrl, queue) { each(queue, (props) => { prepareSprings(ctrl.springs, props, (key) => { return createSpring(key, ctrl); }); }); } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i2; for (i2 = 0; i2 < sourceKeys.length; i2++) { key = sourceKeys[i2]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } var _excluded$3 = ["children"]; var SpringContext = (_ref) => { let { children } = _ref, props = _objectWithoutPropertiesLoose(_ref, _excluded$3); const inherited = (0, import_react6.useContext)(ctx); const pause = props.pause || !!inherited.pause, immediate = props.immediate || !!inherited.immediate; props = useMemoOne(() => ({ pause, immediate }), [pause, immediate]); const { Provider } = ctx; return React6.createElement(Provider, { value: props }, children); }; var ctx = makeContext(SpringContext, {}); SpringContext.Provider = ctx.Provider; SpringContext.Consumer = ctx.Consumer; function makeContext(target, init2) { Object.assign(target, React6.createContext(init2)); target.Provider._context = target; target.Consumer._context = target; return target; } var TransitionPhase; (function(TransitionPhase2) { TransitionPhase2["MOUNT"] = "mount"; TransitionPhase2["ENTER"] = "enter"; TransitionPhase2["UPDATE"] = "update"; TransitionPhase2["LEAVE"] = "leave"; })(TransitionPhase || (TransitionPhase = {})); var Interpolation = class extends FrameValue { constructor(source, args) { super(); this.key = void 0; this.idle = true; this.calc = void 0; this._active = /* @__PURE__ */ new Set(); this.source = source; this.calc = createInterpolator(...args); const value = this._get(); const nodeType = getAnimatedType(value); setAnimated(this, nodeType.create(value)); } advance(_dt) { const value = this._get(); const oldValue = this.get(); if (!isEqual(value, oldValue)) { getAnimated(this).setValue(value); this._onChange(value, this.idle); } if (!this.idle && checkIdle(this._active)) { becomeIdle(this); } } _get() { const inputs = is.arr(this.source) ? this.source.map(getFluidValue) : toArray(getFluidValue(this.source)); return this.calc(...inputs); } _start() { if (this.idle && !checkIdle(this._active)) { this.idle = false; each(getPayload(this), (node) => { node.done = false; }); if (globals.skipAnimation) { raf.batchedUpdates(() => this.advance()); becomeIdle(this); } else { frameLoop.start(this); } } } _attach() { let priority2 = 1; each(toArray(this.source), (source) => { if (hasFluidValue(source)) { addFluidObserver(source, this); } if (isFrameValue(source)) { if (!source.idle) { this._active.add(source); } priority2 = Math.max(priority2, source.priority + 1); } }); this.priority = priority2; this._start(); } _detach() { each(toArray(this.source), (source) => { if (hasFluidValue(source)) { removeFluidObserver(source, this); } }); this._active.clear(); becomeIdle(this); } eventObserved(event) { if (event.type == "change") { if (event.idle) { this.advance(); } else { this._active.add(event.parent); this._start(); } } else if (event.type == "idle") { this._active.delete(event.parent); } else if (event.type == "priority") { this.priority = toArray(this.source).reduce((highest, parent) => Math.max(highest, (isFrameValue(parent) ? parent.priority : 0) + 1), 0); } } }; function isIdle(source) { return source.idle !== false; } function checkIdle(active) { return !active.size || Array.from(active).every(isIdle); } function becomeIdle(self2) { if (!self2.idle) { self2.idle = true; each(getPayload(self2), (node) => { node.done = true; }); callFluidObservers(self2, { type: "idle", parent: self2 }); } } globals.assign({ createStringInterpolator, to: (source, args) => new Interpolation(source, args) }); var update3 = frameLoop.advance; // node_modules/@react-spring/web/dist/react-spring-web.esm.js var import_react_dom = __toESM(require_react_dom()); function _objectWithoutPropertiesLoose2(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i2; for (i2 = 0; i2 < sourceKeys.length; i2++) { key = sourceKeys[i2]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } var _excluded$2 = ["style", "children", "scrollTop", "scrollLeft"]; var isCustomPropRE = /^--/; function dangerousStyleValue(name2, value) { if (value == null || typeof value === "boolean" || value === "") return ""; if (typeof value === "number" && value !== 0 && !isCustomPropRE.test(name2) && !(isUnitlessNumber.hasOwnProperty(name2) && isUnitlessNumber[name2])) return value + "px"; return ("" + value).trim(); } var attributeCache = {}; function applyAnimatedValues(instance, props) { if (!instance.nodeType || !instance.setAttribute) { return false; } const isFilterElement = instance.nodeName === "filter" || instance.parentNode && instance.parentNode.nodeName === "filter"; const _ref = props, { style, children, scrollTop, scrollLeft } = _ref, attributes = _objectWithoutPropertiesLoose2(_ref, _excluded$2); const values = Object.values(attributes); const names = Object.keys(attributes).map((name2) => isFilterElement || instance.hasAttribute(name2) ? name2 : attributeCache[name2] || (attributeCache[name2] = name2.replace(/([A-Z])/g, (n2) => "-" + n2.toLowerCase()))); if (children !== void 0) { instance.textContent = children; } for (let name2 in style) { if (style.hasOwnProperty(name2)) { const value = dangerousStyleValue(name2, style[name2]); if (isCustomPropRE.test(name2)) { instance.style.setProperty(name2, value); } else { instance.style[name2] = value; } } } names.forEach((name2, i2) => { instance.setAttribute(name2, values[i2]); }); if (scrollTop !== void 0) { instance.scrollTop = scrollTop; } if (scrollLeft !== void 0) { instance.scrollLeft = scrollLeft; } } var isUnitlessNumber = { animationIterationCount: true, borderImageOutset: true, borderImageSlice: true, borderImageWidth: true, boxFlex: true, boxFlexGroup: true, boxOrdinalGroup: true, columnCount: true, columns: true, flex: true, flexGrow: true, flexPositive: true, flexShrink: true, flexNegative: true, flexOrder: true, gridRow: true, gridRowEnd: true, gridRowSpan: true, gridRowStart: true, gridColumn: true, gridColumnEnd: true, gridColumnSpan: true, gridColumnStart: true, fontWeight: true, lineClamp: true, lineHeight: true, opacity: true, order: true, orphans: true, tabSize: true, widows: true, zIndex: true, zoom: true, fillOpacity: true, floodOpacity: true, stopOpacity: true, strokeDasharray: true, strokeDashoffset: true, strokeMiterlimit: true, strokeOpacity: true, strokeWidth: true }; var prefixKey = (prefix2, key) => prefix2 + key.charAt(0).toUpperCase() + key.substring(1); var prefixes = ["Webkit", "Ms", "Moz", "O"]; isUnitlessNumber = Object.keys(isUnitlessNumber).reduce((acc, prop) => { prefixes.forEach((prefix2) => acc[prefixKey(prefix2, prop)] = acc[prop]); return acc; }, isUnitlessNumber); var _excluded$1 = ["x", "y", "z"]; var domTransforms = /^(matrix|translate|scale|rotate|skew)/; var pxTransforms = /^(translate)/; var degTransforms = /^(rotate|skew)/; var addUnit = (value, unit) => is.num(value) && value !== 0 ? value + unit : value; var isValueIdentity = (value, id) => is.arr(value) ? value.every((v2) => isValueIdentity(v2, id)) : is.num(value) ? value === id : parseFloat(value) === id; var AnimatedStyle = class extends AnimatedObject { constructor(_ref) { let { x: x2, y: y2, z } = _ref, style = _objectWithoutPropertiesLoose2(_ref, _excluded$1); const inputs = []; const transforms = []; if (x2 || y2 || z) { inputs.push([x2 || 0, y2 || 0, z || 0]); transforms.push((xyz) => [`translate3d(${xyz.map((v2) => addUnit(v2, "px")).join(",")})`, isValueIdentity(xyz, 0)]); } eachProp(style, (value, key) => { if (key === "transform") { inputs.push([value || ""]); transforms.push((transform) => [transform, transform === ""]); } else if (domTransforms.test(key)) { delete style[key]; if (is.und(value)) return; const unit = pxTransforms.test(key) ? "px" : degTransforms.test(key) ? "deg" : ""; inputs.push(toArray(value)); transforms.push(key === "rotate3d" ? ([x3, y3, z2, deg]) => [`rotate3d(${x3},${y3},${z2},${addUnit(deg, unit)})`, isValueIdentity(deg, 0)] : (input) => [`${key}(${input.map((v2) => addUnit(v2, unit)).join(",")})`, isValueIdentity(input, key.startsWith("scale") ? 1 : 0)]); } }); if (inputs.length) { style.transform = new FluidTransform(inputs, transforms); } super(style); } }; var FluidTransform = class extends FluidValue { constructor(inputs, transforms) { super(); this._value = null; this.inputs = inputs; this.transforms = transforms; } get() { return this._value || (this._value = this._get()); } _get() { let transform = ""; let identity2 = true; each(this.inputs, (input, i2) => { const arg1 = getFluidValue(input[0]); const [t3, id] = this.transforms[i2](is.arr(arg1) ? arg1 : input.map(getFluidValue)); transform += " " + t3; identity2 = identity2 && id; }); return identity2 ? "none" : transform; } observerAdded(count) { if (count == 1) each(this.inputs, (input) => each(input, (value) => hasFluidValue(value) && addFluidObserver(value, this))); } observerRemoved(count) { if (count == 0) each(this.inputs, (input) => each(input, (value) => hasFluidValue(value) && removeFluidObserver(value, this))); } eventObserved(event) { if (event.type == "change") { this._value = null; } callFluidObservers(this, event); } }; var primitives = ["a", "abbr", "address", "area", "article", "aside", "audio", "b", "base", "bdi", "bdo", "big", "blockquote", "body", "br", "button", "canvas", "caption", "cite", "code", "col", "colgroup", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "iframe", "img", "input", "ins", "kbd", "keygen", "label", "legend", "li", "link", "main", "map", "mark", "menu", "menuitem", "meta", "meter", "nav", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "script", "section", "select", "small", "source", "span", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "track", "u", "ul", "var", "video", "wbr", "circle", "clipPath", "defs", "ellipse", "foreignObject", "g", "image", "line", "linearGradient", "mask", "path", "pattern", "polygon", "polyline", "radialGradient", "rect", "stop", "svg", "text", "tspan"]; var _excluded = ["scrollTop", "scrollLeft"]; globals.assign({ batchedUpdates: import_react_dom.unstable_batchedUpdates, createStringInterpolator, colors }); var host = createHost(primitives, { applyAnimatedValues, createAnimatedStyle: (style) => new AnimatedStyle(style), getComponentProps: (_ref) => { let props = _objectWithoutPropertiesLoose2(_ref, _excluded); return props; } }); var animated = host.animated; // packages/edit-site/build-module/components/layout/animation.mjs var import_element11 = __toESM(require_element(), 1); function getAbsolutePosition(element) { return { top: element.offsetTop, left: element.offsetLeft }; } var ANIMATION_DURATION = 400; function useMovingAnimation({ triggerAnimationOnChange }) { const ref = (0, import_element11.useRef)(); const { previous, prevRect } = (0, import_element11.useMemo)( () => ({ previous: ref.current && getAbsolutePosition(ref.current), prevRect: ref.current && ref.current.getBoundingClientRect() }), [triggerAnimationOnChange] ); (0, import_element11.useLayoutEffect)(() => { if (!previous || !ref.current) { return; } const disableAnimation = window.matchMedia( "(prefers-reduced-motion: reduce)" ).matches; if (disableAnimation) { return; } const controller = new Controller({ x: 0, y: 0, width: prevRect.width, height: prevRect.height, config: { duration: ANIMATION_DURATION, easing: easings.easeInOutQuint }, onChange({ value }) { if (!ref.current) { return; } let { x: x22, y: y22, width: width2, height: height2 } = value; x22 = Math.round(x22); y22 = Math.round(y22); width2 = Math.round(width2); height2 = Math.round(height2); const finishedMoving = x22 === 0 && y22 === 0; ref.current.style.transformOrigin = "center center"; ref.current.style.transform = finishedMoving ? null : `translate3d(${x22}px,${y22}px,0)`; ref.current.style.width = finishedMoving ? null : `${width2}px`; ref.current.style.height = finishedMoving ? null : `${height2}px`; } }); ref.current.style.transform = void 0; const destination = ref.current.getBoundingClientRect(); const x2 = Math.round(prevRect.left - destination.left); const y2 = Math.round(prevRect.top - destination.top); const width = destination.width; const height = destination.height; controller.start({ x: 0, y: 0, width, height, from: { x: x2, y: y2, width: prevRect.width, height: prevRect.height } }); return () => { controller.stop(); controller.set({ x: 0, y: 0, width: prevRect.width, height: prevRect.height }); }; }, [previous, prevRect]); return ref; } var animation_default = useMovingAnimation; // packages/edit-site/build-module/components/save-hub/index.mjs var import_data10 = __toESM(require_data(), 1); var import_components6 = __toESM(require_components(), 1); var import_core_data9 = __toESM(require_core_data(), 1); // packages/edit-site/build-module/components/save-button/index.mjs var import_data9 = __toESM(require_data(), 1); var import_components5 = __toESM(require_components(), 1); var import_i18n6 = __toESM(require_i18n(), 1); var import_core_data8 = __toESM(require_core_data(), 1); var import_keycodes2 = __toESM(require_keycodes(), 1); var import_router3 = __toESM(require_router(), 1); var import_editor4 = __toESM(require_editor(), 1); // packages/edit-site/build-module/utils/is-previewing-theme.mjs var import_url3 = __toESM(require_url(), 1); function isPreviewingTheme() { return !!(0, import_url3.getQueryArg)(window.location.href, "wp_theme_preview"); } function currentlyPreviewingTheme() { if (isPreviewingTheme()) { return (0, import_url3.getQueryArg)(window.location.href, "wp_theme_preview"); } return null; } // packages/edit-site/build-module/components/save-button/index.mjs var import_jsx_runtime74 = __toESM(require_jsx_runtime(), 1); var { useLocation: useLocation3 } = unlock(import_router3.privateApis); function SaveButton({ className = "edit-site-save-button__button", variant = "primary", showTooltip = true, showReviewMessage, icon, size, __next40pxDefaultSize = false }) { const { params } = useLocation3(); const { setIsSaveViewOpened: setIsSaveViewOpened2 } = (0, import_data9.useDispatch)(store); const { saveDirtyEntities } = unlock((0, import_data9.useDispatch)(import_editor4.store)); const { dirtyEntityRecords } = (0, import_editor4.useEntitiesSavedStatesIsDirty)(); const { isSaving, isSaveViewOpen, previewingThemeName } = (0, import_data9.useSelect)( (select3) => { const { isSavingEntityRecord, isResolving } = select3(import_core_data8.store); const { isSaveViewOpened: isSaveViewOpened2 } = select3(store); const isActivatingTheme = isResolving("activateTheme"); const currentlyPreviewingThemeId = currentlyPreviewingTheme(); return { isSaving: dirtyEntityRecords.some( (record) => isSavingEntityRecord( record.kind, record.name, record.key ) ) || isActivatingTheme, isSaveViewOpen: isSaveViewOpened2(), // Do not call `getTheme` with null, it will cause a request to // the server. previewingThemeName: currentlyPreviewingThemeId ? select3(import_core_data8.store).getTheme(currentlyPreviewingThemeId)?.name?.rendered : void 0 }; }, [dirtyEntityRecords] ); const hasDirtyEntities = !!dirtyEntityRecords.length; let isOnlyCurrentEntityDirty; if (dirtyEntityRecords.length === 1) { if (params.postId) { isOnlyCurrentEntityDirty = `${dirtyEntityRecords[0].key}` === params.postId && dirtyEntityRecords[0].name === params.postType; } else if (params.path?.includes("wp_global_styles")) { isOnlyCurrentEntityDirty = dirtyEntityRecords[0].name === "globalStyles"; } } const disabled = isSaving || !hasDirtyEntities && !isPreviewingTheme(); const getLabel = () => { if (isPreviewingTheme()) { if (isSaving) { return (0, import_i18n6.sprintf)( /* translators: %s: The name of theme to be activated. */ (0, import_i18n6.__)("Activating %s"), previewingThemeName ); } else if (disabled) { return (0, import_i18n6.__)("Saved"); } else if (hasDirtyEntities) { return (0, import_i18n6.sprintf)( /* translators: %s: The name of theme to be activated. */ (0, import_i18n6.__)("Activate %s & Save"), previewingThemeName ); } return (0, import_i18n6.sprintf)( /* translators: %s: The name of theme to be activated. */ (0, import_i18n6.__)("Activate %s"), previewingThemeName ); } if (isSaving) { return (0, import_i18n6.__)("Saving"); } if (disabled) { return (0, import_i18n6.__)("Saved"); } if (!isOnlyCurrentEntityDirty && showReviewMessage) { return (0, import_i18n6.sprintf)( // translators: %d: number of unsaved changes (number). (0, import_i18n6._n)( "Review %d change\u2026", "Review %d changes\u2026", dirtyEntityRecords.length ), dirtyEntityRecords.length ); } return (0, import_i18n6.__)("Save"); }; const label = getLabel(); const onClick = isOnlyCurrentEntityDirty ? () => saveDirtyEntities({ dirtyEntityRecords }) : () => setIsSaveViewOpened2(true); return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)( import_components5.Button, { variant, className, "aria-disabled": disabled, "aria-expanded": isSaveViewOpen, isBusy: isSaving, onClick: disabled ? void 0 : onClick, label, shortcut: disabled ? void 0 : import_keycodes2.displayShortcut.primary("s"), showTooltip, icon, __next40pxDefaultSize, size, children: label } ); } // packages/edit-site/build-module/components/save-hub/index.mjs var import_jsx_runtime75 = __toESM(require_jsx_runtime(), 1); function SaveHub() { const { isDisabled, isSaving } = (0, import_data10.useSelect)((select3) => { const { __experimentalGetDirtyEntityRecords, isSavingEntityRecord } = select3(import_core_data9.store); const dirtyEntityRecords = __experimentalGetDirtyEntityRecords(); const _isSaving = dirtyEntityRecords.some( (record) => isSavingEntityRecord(record.kind, record.name, record.key) ); return { isSaving: _isSaving, isDisabled: _isSaving || !dirtyEntityRecords.length && !isPreviewingTheme() }; }, []); return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_components6.__experimentalHStack, { className: "edit-site-save-hub", alignment: "right", spacing: 4, children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)( SaveButton, { className: "edit-site-save-hub__button", variant: isDisabled ? null : "primary", showTooltip: false, icon: isDisabled && !isSaving ? check_default : null, showReviewMessage: true, __next40pxDefaultSize: true } ) }); } // packages/edit-site/build-module/components/save-panel/index.mjs var import_components7 = __toESM(require_components(), 1); var import_editor5 = __toESM(require_editor(), 1); var import_data12 = __toESM(require_data(), 1); var import_i18n7 = __toESM(require_i18n(), 1); var import_core_data11 = __toESM(require_core_data(), 1); var import_router5 = __toESM(require_router(), 1); var import_element13 = __toESM(require_element(), 1); // packages/edit-site/build-module/utils/use-activate-theme.mjs var import_core_data10 = __toESM(require_core_data(), 1); var import_data11 = __toESM(require_data(), 1); var import_router4 = __toESM(require_router(), 1); var import_url4 = __toESM(require_url(), 1); var { useHistory: useHistory3, useLocation: useLocation4 } = unlock(import_router4.privateApis); function useActivateTheme() { const history = useHistory3(); const { path } = useLocation4(); const { startResolution, finishResolution } = (0, import_data11.useDispatch)(import_core_data10.store); return async () => { if (isPreviewingTheme()) { const activationURL = "themes.php?action=activate&stylesheet=" + currentlyPreviewingTheme() + "&_wpnonce=" + window.WP_BLOCK_THEME_ACTIVATE_NONCE; startResolution("activateTheme"); await window.fetch(activationURL); finishResolution("activateTheme"); history.navigate((0, import_url4.addQueryArgs)(path, { wp_theme_preview: "" })); } }; } // packages/edit-site/build-module/utils/use-actual-current-theme.mjs var import_api_fetch = __toESM(require_api_fetch(), 1); var import_element12 = __toESM(require_element(), 1); var import_url5 = __toESM(require_url(), 1); var ACTIVE_THEMES_URL = "/wp/v2/themes?status=active"; function useActualCurrentTheme() { const [currentTheme, setCurrentTheme] = (0, import_element12.useState)(); (0, import_element12.useEffect)(() => { const path = (0, import_url5.addQueryArgs)(ACTIVE_THEMES_URL, { context: "edit", wp_theme_preview: "" }); (0, import_api_fetch.default)({ path }).then((activeThemes) => setCurrentTheme(activeThemes[0])).catch(() => { }); }, []); return currentTheme; } // packages/edit-site/build-module/components/save-panel/index.mjs var import_jsx_runtime76 = __toESM(require_jsx_runtime(), 1); var { EntitiesSavedStatesExtensible } = unlock(import_editor5.privateApis); var { useLocation: useLocation5 } = unlock(import_router5.privateApis); var EntitiesSavedStatesForPreview = ({ onClose, renderDialog, variant }) => { const isDirtyProps = (0, import_editor5.useEntitiesSavedStatesIsDirty)(); let activateSaveLabel, successNoticeContent; if (isDirtyProps.isDirty) { activateSaveLabel = (0, import_i18n7.__)("Activate & Save"); successNoticeContent = (0, import_i18n7.__)("Theme activated and site updated."); } else { activateSaveLabel = (0, import_i18n7.__)("Activate"); successNoticeContent = (0, import_i18n7.__)("Theme activated."); } const currentTheme = useActualCurrentTheme(); const previewingTheme = (0, import_data12.useSelect)( (select3) => select3(import_core_data11.store).getCurrentTheme(), [] ); const additionalPrompt = /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("p", { children: (0, import_i18n7.sprintf)( /* translators: 1: The name of active theme, 2: The name of theme to be activated. */ (0, import_i18n7.__)( "Saving your changes will change your active theme from %1$s to %2$s." ), currentTheme?.name?.rendered ?? "...", previewingTheme?.name?.rendered ?? "..." ) }); const activateTheme = useActivateTheme(); const onSave = async (values) => { await activateTheme(); return values; }; return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)( EntitiesSavedStatesExtensible, { ...{ ...isDirtyProps, additionalPrompt, close: onClose, onSave, saveEnabled: true, saveLabel: activateSaveLabel, renderDialog, variant, successNoticeContent } } ); }; var _EntitiesSavedStates = ({ onClose, renderDialog, variant }) => { if (isPreviewingTheme()) { return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)( EntitiesSavedStatesForPreview, { onClose, renderDialog, variant } ); } return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)( import_editor5.EntitiesSavedStates, { close: onClose, renderDialog, variant } ); }; function SavePanel() { const { query } = useLocation5(); const { canvas = "view" } = query; const { isSaveViewOpen, isDirty, isSaving } = (0, import_data12.useSelect)((select3) => { const { __experimentalGetDirtyEntityRecords, isSavingEntityRecord, isResolving } = select3(import_core_data11.store); const dirtyEntityRecords = __experimentalGetDirtyEntityRecords(); const isActivatingTheme = isResolving("activateTheme"); const { isSaveViewOpened: isSaveViewOpened2 } = unlock(select3(store)); return { isSaveViewOpen: isSaveViewOpened2(), isDirty: dirtyEntityRecords.length > 0, isSaving: dirtyEntityRecords.some( (record) => isSavingEntityRecord(record.kind, record.name, record.key) ) || isActivatingTheme }; }, []); const { setIsSaveViewOpened: setIsSaveViewOpened2 } = (0, import_data12.useDispatch)(store); const onClose = () => setIsSaveViewOpened2(false); (0, import_element13.useEffect)(() => { setIsSaveViewOpened2(false); }, [canvas, setIsSaveViewOpened2]); if (canvas === "view") { return isSaveViewOpen ? /* @__PURE__ */ (0, import_jsx_runtime76.jsx)( import_components7.Modal, { className: "edit-site-save-panel__modal", onRequestClose: onClose, title: (0, import_i18n7.__)("Review changes"), size: "small", children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(_EntitiesSavedStates, { onClose, variant: "inline" }) } ) : null; } const activateSaveEnabled = isPreviewingTheme() || isDirty; const disabled = isSaving || !activateSaveEnabled; return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)( navigable_region_default, { className: clsx_default("edit-site-layout__actions", { "is-entity-save-view-open": isSaveViewOpen }), ariaLabel: (0, import_i18n7.__)("Save panel"), children: [ /* @__PURE__ */ (0, import_jsx_runtime76.jsx)( "div", { className: clsx_default("edit-site-editor__toggle-save-panel", { "screen-reader-text": isSaveViewOpen }), children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)( import_components7.Button, { __next40pxDefaultSize: true, variant: "secondary", className: "edit-site-editor__toggle-save-panel-button", onClick: () => setIsSaveViewOpened2(true), "aria-haspopup": "dialog", disabled, accessibleWhenDisabled: true, children: (0, import_i18n7.__)("Open save panel") } ) } ), isSaveViewOpen && /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(_EntitiesSavedStates, { onClose, renderDialog: true }) ] } ); } // packages/edit-site/build-module/components/layout/index.mjs var import_jsx_runtime77 = __toESM(require_jsx_runtime(), 1); var { useLocation: useLocation6 } = unlock(import_router6.privateApis); var { useStyle } = unlock(import_editor6.privateApis); var ANIMATION_DURATION2 = 0.3; function Layout() { const { query, name: routeKey, areas: areas2, widths } = useLocation6(); const canvas = routeKey === "notfound" ? "view" : query?.canvas ?? "view"; const isMobileViewport = (0, import_compose2.useViewportMatch)("medium", "<"); const toggleRef = (0, import_element14.useRef)(); const navigateRegionsProps = (0, import_components8.__unstableUseNavigateRegions)(); const disableMotion = (0, import_compose2.useReducedMotion)(); const [canvasResizer, canvasSize] = (0, import_compose2.useResizeObserver)(); const isEditorLoading = useIsSiteEditorLoading(); const [isResizableFrameOversized, setIsResizableFrameOversized] = (0, import_element14.useState)(false); const animationRef = animation_default({ triggerAnimationOnChange: routeKey + "-" + canvas }); const { showIconLabels } = (0, import_data13.useSelect)((select3) => { return { showIconLabels: select3(import_preferences3.store).get( "core", "showIconLabels" ) }; }); const backgroundColor = useStyle("color.background"); const gradientValue = useStyle("color.gradient"); const previousCanvaMode = (0, import_compose2.usePrevious)(canvas); (0, import_element14.useEffect)(() => { if (previousCanvaMode === "edit") { toggleRef.current?.focus(); } }, [canvas]); return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(import_jsx_runtime77.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_editor6.UnsavedChangesWarning, {}), canvas === "view" && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(SaveKeyboardShortcut, {}), /* @__PURE__ */ (0, import_jsx_runtime77.jsx)( "div", { ...navigateRegionsProps, ref: navigateRegionsProps.ref, className: clsx_default( "edit-site-layout", navigateRegionsProps.className, { "is-full-canvas": canvas === "edit", "show-icon-labels": showIconLabels } ), children: /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "edit-site-layout__content", children: [ (!isMobileViewport || !areas2.mobile) && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)( navigable_region_default, { ariaLabel: (0, import_i18n8.__)("Navigation"), className: "edit-site-layout__sidebar-region", children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_components8.__unstableAnimatePresence, { children: canvas === "view" && /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)( import_components8.__unstableMotion.div, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, transition: { type: "tween", duration: ( // Disable transition in mobile to emulate a full page transition. disableMotion || isMobileViewport ? 0 : ANIMATION_DURATION2 ), ease: "easeOut" }, className: "edit-site-layout__sidebar", children: [ /* @__PURE__ */ (0, import_jsx_runtime77.jsx)( site_hub_default, { ref: toggleRef, isTransparent: isResizableFrameOversized } ), /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(SidebarNavigationProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)( SidebarContent, { shouldAnimate: routeKey !== "styles", routeKey, children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_editor6.ErrorBoundary, { children: areas2.sidebar }) } ) }), /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(SaveHub, {}), /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(SavePanel, {}) ] } ) }) } ), /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_notices.SnackbarNotices, { className: "edit-site-layout__snackbar" }), isMobileViewport && areas2.mobile && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "edit-site-layout__mobile", children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(SidebarNavigationProvider, { children: canvas !== "edit" ? /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(import_jsx_runtime77.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime77.jsx)( SiteHubMobile, { ref: toggleRef, isTransparent: isResizableFrameOversized } ), /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(SidebarContent, { routeKey, children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_editor6.ErrorBoundary, { children: areas2.mobile }) }), /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(SaveHub, {}), /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(SavePanel, {}) ] }) : /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_editor6.ErrorBoundary, { children: areas2.mobile }) }) }), !isMobileViewport && areas2.content && canvas !== "edit" && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)( "div", { className: "edit-site-layout__area", style: { maxWidth: widths?.content }, children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_editor6.ErrorBoundary, { children: areas2.content }) } ), !isMobileViewport && areas2.edit && canvas !== "edit" && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)( "div", { className: "edit-site-layout__area", style: { maxWidth: widths?.edit }, children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_editor6.ErrorBoundary, { children: areas2.edit }) } ), !isMobileViewport && areas2.preview && /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "edit-site-layout__canvas-container", children: [ canvasResizer, !!canvasSize.width && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)( "div", { className: clsx_default( "edit-site-layout__canvas", { "is-right-aligned": isResizableFrameOversized } ), ref: animationRef, children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_editor6.ErrorBoundary, { children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)( resizable_frame_default, { isReady: !isEditorLoading, isFullWidth: canvas === "edit", defaultSize: { width: canvasSize.width - 24, height: canvasSize.height }, isOversized: isResizableFrameOversized, setIsOversized: setIsResizableFrameOversized, innerContentStyle: { background: gradientValue ?? backgroundColor }, children: areas2.preview } ) }) } ) ] }) ] }) } ) ] }); } function LayoutWithGlobalStylesProvider(props) { const { createErrorNotice } = (0, import_data13.useDispatch)(import_notices.store); function onPluginAreaError(name2) { createErrorNotice( (0, import_i18n8.sprintf)( /* translators: %s: plugin name */ (0, import_i18n8.__)( 'The "%s" plugin has encountered an error and cannot be rendered.' ), name2 ) ); } return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(import_components8.SlotFillProvider, { children: [ /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_plugins2.PluginArea, { onError: onPluginAreaError }), /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(Layout, { ...props }) ] }); } // packages/edit-site/build-module/hooks/commands/use-common-commands.mjs var import_element15 = __toESM(require_element(), 1); var import_data14 = __toESM(require_data(), 1); var import_i18n9 = __toESM(require_i18n(), 1); var import_commands2 = __toESM(require_commands(), 1); var import_router7 = __toESM(require_router(), 1); var import_preferences4 = __toESM(require_preferences(), 1); var import_core_data12 = __toESM(require_core_data(), 1); var import_editor7 = __toESM(require_editor(), 1); var { useHistory: useHistory4, useLocation: useLocation7 } = unlock(import_router7.privateApis); var { useGlobalStyles } = unlock(import_editor7.privateApis); var getGlobalStylesToggleWelcomeGuideCommands = () => function useGlobalStylesToggleWelcomeGuideCommands() { const { openGeneralSidebar: openGeneralSidebar2 } = unlock((0, import_data14.useDispatch)(store)); const { params } = useLocation7(); const { canvas = "view" } = params; const { set } = (0, import_data14.useDispatch)(import_preferences4.store); const history = useHistory4(); const isBlockBasedTheme = (0, import_data14.useSelect)((select3) => { return select3(import_core_data12.store).getCurrentTheme().is_block_theme; }, []); const commands = (0, import_element15.useMemo)(() => { if (!isBlockBasedTheme) { return []; } return [ { name: "core/edit-site/toggle-styles-welcome-guide", label: (0, import_i18n9.__)("Learn about styles"), callback: ({ close }) => { close(); if (canvas !== "edit") { history.navigate("/styles?canvas=edit", { transition: "canvas-mode-edit-transition" }); } openGeneralSidebar2("edit-site/global-styles"); set("core/edit-site", "welcomeGuideStyles", true); setTimeout(() => { set("core/edit-site", "welcomeGuideStyles", true); }, 500); }, icon: help_default } ]; }, [history, openGeneralSidebar2, canvas, isBlockBasedTheme, set]); return { isLoading: false, commands }; }; var getGlobalStylesResetCommands = () => function useGlobalStylesResetCommands() { const { user, setUser } = useGlobalStyles(); const canReset = !!user && (Object.keys(user?.styles ?? {}).length > 0 || Object.keys(user?.settings ?? {}).length > 0); const commands = (0, import_element15.useMemo)(() => { if (!canReset) { return []; } return [ { name: "core/edit-site/reset-global-styles", label: (0, import_i18n9.__)("Reset styles"), icon: (0, import_i18n9.isRTL)() ? rotate_right_default : rotate_left_default, callback: ({ close }) => { close(); setUser({ styles: {}, settings: {} }); } } ]; }, [canReset, setUser]); return { isLoading: false, commands }; }; var getGlobalStylesOpenRevisionsCommands = () => function useGlobalStylesOpenRevisionsCommands() { const { openGeneralSidebar: openGeneralSidebar2 } = unlock((0, import_data14.useDispatch)(store)); const { setStylesPath } = unlock((0, import_data14.useDispatch)(import_editor7.store)); const { params } = useLocation7(); const { canvas = "view" } = params; const history = useHistory4(); const hasRevisions = (0, import_data14.useSelect)((select3) => { const { getEntityRecord, __experimentalGetCurrentGlobalStylesId } = select3(import_core_data12.store); const globalStylesId = __experimentalGetCurrentGlobalStylesId(); const globalStyles = globalStylesId ? getEntityRecord("root", "globalStyles", globalStylesId) : void 0; return !!globalStyles?._links?.["version-history"]?.[0]?.count; }, []); const commands = (0, import_element15.useMemo)(() => { if (!hasRevisions) { return []; } return [ { name: "core/edit-site/open-styles-revisions", label: (0, import_i18n9.__)("Open style revisions"), icon: backup_default, callback: ({ close }) => { close(); if (canvas !== "edit") { history.navigate("/styles?canvas=edit", { transition: "canvas-mode-edit-transition" }); } openGeneralSidebar2("edit-site/global-styles"); setStylesPath("/revisions"); } } ]; }, [ history, openGeneralSidebar2, setStylesPath, hasRevisions, canvas ]); return { isLoading: false, commands }; }; function useCommonCommands() { (0, import_commands2.useCommandLoader)({ name: "core/edit-site/toggle-styles-welcome-guide", hook: getGlobalStylesToggleWelcomeGuideCommands() }); (0, import_commands2.useCommandLoader)({ name: "core/edit-site/reset-global-styles", hook: getGlobalStylesResetCommands() }); (0, import_commands2.useCommandLoader)({ name: "core/edit-site/open-styles-revisions", hook: getGlobalStylesOpenRevisionsCommands() }); } // packages/edit-site/build-module/hooks/commands/use-set-command-context.mjs var import_data15 = __toESM(require_data(), 1); var import_commands3 = __toESM(require_commands(), 1); var import_block_editor3 = __toESM(require_block_editor(), 1); var import_router8 = __toESM(require_router(), 1); var { useCommandContext } = unlock(import_commands3.privateApis); var { useLocation: useLocation8 } = unlock(import_router8.privateApis); function useSetCommandContext() { const { query = {} } = useLocation8(); const { canvas = "view" } = query; const hasBlockSelected = (0, import_data15.useSelect)((select3) => { return select3(import_block_editor3.store).getBlockSelectionStart(); }, []); let commandContext = "site-editor"; if (canvas === "edit") { commandContext = "entity-edit"; } if (hasBlockSelected) { commandContext = "block-selection-edit"; } useCommandContext(commandContext); } // packages/edit-site/build-module/components/site-editor-routes/index.mjs var import_data82 = __toESM(require_data(), 1); var import_element160 = __toESM(require_element(), 1); // packages/edit-site/build-module/components/sidebar-navigation-screen-main/index.mjs var import_components73 = __toESM(require_components(), 1); var import_i18n59 = __toESM(require_i18n(), 1); var import_data31 = __toESM(require_data(), 1); var import_core_data25 = __toESM(require_core_data(), 1); // packages/edit-site/build-module/components/sidebar-navigation-screen/index.mjs var import_components10 = __toESM(require_components(), 1); var import_i18n10 = __toESM(require_i18n(), 1); var import_core_data13 = __toESM(require_core_data(), 1); var import_data16 = __toESM(require_data(), 1); var import_router9 = __toESM(require_router(), 1); var import_element16 = __toESM(require_element(), 1); // packages/edit-site/build-module/components/sidebar-button/index.mjs var import_components9 = __toESM(require_components(), 1); var import_jsx_runtime78 = __toESM(require_jsx_runtime(), 1); function SidebarButton(props) { return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)( import_components9.Button, { size: "compact", ...props, className: clsx_default("edit-site-sidebar-button", props.className) } ); } // packages/edit-site/build-module/components/sidebar-navigation-screen/index.mjs var import_jsx_runtime79 = __toESM(require_jsx_runtime(), 1); var { useHistory: useHistory5, useLocation: useLocation9 } = unlock(import_router9.privateApis); function SidebarNavigationScreen({ isRoot, title, actions, content, footer, description, backPath: backPathProp }) { const { dashboardLink, dashboardLinkText, previewingThemeName } = (0, import_data16.useSelect)( (select3) => { const { getSettings: getSettings7 } = unlock(select3(store)); const currentlyPreviewingThemeId = currentlyPreviewingTheme(); return { dashboardLink: getSettings7().__experimentalDashboardLink, dashboardLinkText: getSettings7().__experimentalDashboardLinkText, // Do not call `getTheme` with null, it will cause a request to // the server. previewingThemeName: currentlyPreviewingThemeId ? select3(import_core_data13.store).getTheme(currentlyPreviewingThemeId)?.name?.rendered : void 0 }; }, [] ); const location = useLocation9(); const history = useHistory5(); const { navigate } = (0, import_element16.useContext)(SidebarNavigationContext); const backPath = backPathProp ?? location.state?.backPath; const icon = (0, import_i18n10.isRTL)() ? chevron_right_default : chevron_left_default; return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(import_jsx_runtime79.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)( import_components10.__experimentalVStack, { className: clsx_default("edit-site-sidebar-navigation-screen__main", { "has-footer": !!footer }), spacing: 0, justify: "flex-start", children: [ /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)( import_components10.__experimentalHStack, { spacing: 3, alignment: "flex-start", className: "edit-site-sidebar-navigation-screen__title-icon", children: [ !isRoot && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)( SidebarButton, { onClick: () => { history.navigate(backPath); navigate("back"); }, icon, label: (0, import_i18n10.__)("Back"), showTooltip: false } ), isRoot && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)( SidebarButton, { icon, label: dashboardLinkText || (0, import_i18n10.__)("Go to the Dashboard"), href: dashboardLink } ), /* @__PURE__ */ (0, import_jsx_runtime79.jsx)( import_components10.__experimentalHeading, { className: "edit-site-sidebar-navigation-screen__title", color: "#e0e0e0", level: 1, size: 20, children: !isPreviewingTheme() ? title : (0, import_i18n10.sprintf)( /* translators: 1: theme name. 2: title */ (0, import_i18n10.__)("Previewing %1$s: %2$s"), previewingThemeName, title ) } ), actions && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: "edit-site-sidebar-navigation-screen__actions", children: actions }) ] } ), /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: "edit-site-sidebar-navigation-screen__content", children: [ description && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: "edit-site-sidebar-navigation-screen__description", children: description }), content ] }) ] } ), footer && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("footer", { className: "edit-site-sidebar-navigation-screen__footer", children: footer }) ] }); } // packages/edit-site/build-module/components/sidebar-navigation-item/index.mjs var import_components11 = __toESM(require_components(), 1); var import_i18n11 = __toESM(require_i18n(), 1); var import_router10 = __toESM(require_router(), 1); var import_element17 = __toESM(require_element(), 1); var import_jsx_runtime80 = __toESM(require_jsx_runtime(), 1); var { useHistory: useHistory6, useLink } = unlock(import_router10.privateApis); function SidebarNavigationItem({ className, icon, withChevron = false, suffix, uid, to: to2, onClick, children, ...props }) { const history = useHistory6(); const { navigate } = (0, import_element17.useContext)(SidebarNavigationContext); function handleClick(e2) { if (onClick) { onClick(e2); navigate("forward"); } else if (to2) { e2.preventDefault(); history.navigate(to2); navigate("forward", `[id="${uid}"]`); } } const linkProps = useLink(to2); return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)( import_components11.__experimentalItem, { className: clsx_default( "edit-site-sidebar-navigation-item", { "with-suffix": !withChevron && suffix }, className ), id: uid, onClick: handleClick, href: to2 ? linkProps.href : void 0, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(import_components11.__experimentalHStack, { justify: "flex-start", children: [ icon && /* @__PURE__ */ (0, import_jsx_runtime80.jsx)( icon_default, { style: { fill: "currentcolor" }, icon, size: 24 } ), /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_components11.FlexBlock, { children }), withChevron && /* @__PURE__ */ (0, import_jsx_runtime80.jsx)( icon_default, { icon: (0, import_i18n11.isRTL)() ? chevron_left_small_default : chevron_right_small_default, className: "edit-site-sidebar-navigation-item__drilldown-indicator", size: 24 } ), !withChevron && suffix ] }) } ); } // packages/edit-site/build-module/components/sidebar-navigation-screen-global-styles/index.mjs var import_i18n58 = __toESM(require_i18n(), 1); var import_data30 = __toESM(require_data(), 1); var import_element49 = __toESM(require_element(), 1); var import_preferences5 = __toESM(require_preferences(), 1); var import_editor8 = __toESM(require_editor(), 1); var import_router11 = __toESM(require_router(), 1); var import_url7 = __toESM(require_url(), 1); // packages/global-styles-ui/build-module/global-styles-ui.mjs var import_components71 = __toESM(require_components(), 1); var import_blocks8 = __toESM(require_blocks(), 1); var import_data29 = __toESM(require_data(), 1); var import_block_editor16 = __toESM(require_block_editor(), 1); var import_element48 = __toESM(require_element(), 1); var import_compose8 = __toESM(require_compose(), 1); // packages/global-styles-engine/build-module/utils/object.mjs function setImmutably(object, path, value) { path = Array.isArray(path) ? [...path] : [path]; object = Array.isArray(object) ? [...object] : { ...object }; const leaf = path.pop(); let prev = object; for (const key of path) { const lvl = prev[key]; prev = prev[key] = Array.isArray(lvl) ? [...lvl] : { ...lvl }; } prev[leaf] = value; return object; } var getValueFromObjectPath = (object, path, defaultValue2) => { const arrayPath = Array.isArray(path) ? path : path.split("."); let value = object; arrayPath.forEach((fieldName) => { value = value?.[fieldName]; }); return value ?? defaultValue2; }; // packages/global-styles-engine/build-module/settings/get-setting.mjs var VALID_SETTINGS = [ "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 getSetting(globalStyles, path, blockName) { const appendedBlockPath = blockName ? ".blocks." + blockName : ""; const appendedPropertyPath = path ? "." + path : ""; const contextualPath = `settings${appendedBlockPath}${appendedPropertyPath}`; const globalPath = `settings${appendedPropertyPath}`; if (path) { return getValueFromObjectPath(globalStyles, contextualPath) ?? getValueFromObjectPath(globalStyles, globalPath); } let result = {}; VALID_SETTINGS.forEach((setting) => { const value = getValueFromObjectPath( globalStyles, `settings${appendedBlockPath}.${setting}` ) ?? getValueFromObjectPath(globalStyles, `settings.${setting}`); if (value !== void 0) { result = setImmutably(result, setting.split("."), value); } }); return result; } // packages/global-styles-engine/build-module/settings/set-setting.mjs function setSetting(globalStyles, path, newValue, blockName) { const appendedBlockPath = blockName ? ".blocks." + blockName : ""; const appendedPropertyPath = path ? "." + path : ""; const finalPath = `settings${appendedBlockPath}${appendedPropertyPath}`; return setImmutably( globalStyles, finalPath.split("."), newValue ); } // packages/global-styles-engine/build-module/utils/common.mjs var import_style_engine = __toESM(require_style_engine(), 1); // packages/global-styles-engine/build-module/utils/fluid.mjs var DEFAULT_MAXIMUM_VIEWPORT_WIDTH = "1600px"; var DEFAULT_MINIMUM_VIEWPORT_WIDTH = "320px"; var DEFAULT_SCALE_FACTOR = 1; var DEFAULT_MINIMUM_FONT_SIZE_FACTOR_MIN = 0.25; var DEFAULT_MINIMUM_FONT_SIZE_FACTOR_MAX = 0.75; var DEFAULT_MINIMUM_FONT_SIZE_LIMIT = "14px"; function getComputedFluidTypographyValue({ minimumFontSize, maximumFontSize, fontSize, minimumViewportWidth = DEFAULT_MINIMUM_VIEWPORT_WIDTH, maximumViewportWidth = DEFAULT_MAXIMUM_VIEWPORT_WIDTH, scaleFactor = DEFAULT_SCALE_FACTOR, minimumFontSizeLimit }) { minimumFontSizeLimit = !!getTypographyValueAndUnit(minimumFontSizeLimit) ? minimumFontSizeLimit : DEFAULT_MINIMUM_FONT_SIZE_LIMIT; if (fontSize) { const fontSizeParsed = getTypographyValueAndUnit(fontSize); if (!fontSizeParsed?.unit || !fontSizeParsed?.value) { return null; } const minimumFontSizeLimitParsed = getTypographyValueAndUnit( minimumFontSizeLimit, { coerceTo: fontSizeParsed.unit } ); if (!!minimumFontSizeLimitParsed?.value && !minimumFontSize && !maximumFontSize) { if (fontSizeParsed?.value <= minimumFontSizeLimitParsed?.value) { return null; } } if (!maximumFontSize) { maximumFontSize = `${fontSizeParsed.value}${fontSizeParsed.unit}`; } if (!minimumFontSize) { const fontSizeValueInPx = fontSizeParsed.unit === "px" ? fontSizeParsed.value : fontSizeParsed.value * 16; const minimumFontSizeFactor = Math.min( Math.max( 1 - 0.075 * Math.log2(fontSizeValueInPx), DEFAULT_MINIMUM_FONT_SIZE_FACTOR_MIN ), DEFAULT_MINIMUM_FONT_SIZE_FACTOR_MAX ); const calculatedMinimumFontSize = roundToPrecision( fontSizeParsed.value * minimumFontSizeFactor, 3 ); if (!!minimumFontSizeLimitParsed?.value && calculatedMinimumFontSize < minimumFontSizeLimitParsed?.value) { minimumFontSize = `${minimumFontSizeLimitParsed.value}${minimumFontSizeLimitParsed.unit}`; } else { minimumFontSize = `${calculatedMinimumFontSize}${fontSizeParsed.unit}`; } } } const minimumFontSizeParsed = getTypographyValueAndUnit(minimumFontSize); const fontSizeUnit = minimumFontSizeParsed?.unit || "rem"; const maximumFontSizeParsed = getTypographyValueAndUnit(maximumFontSize, { coerceTo: fontSizeUnit }); if (!minimumFontSizeParsed || !maximumFontSizeParsed) { return null; } const minimumFontSizeRem = getTypographyValueAndUnit(minimumFontSize, { coerceTo: "rem" }); const maximumViewportWidthParsed = getTypographyValueAndUnit( maximumViewportWidth, { coerceTo: fontSizeUnit } ); const minimumViewportWidthParsed = getTypographyValueAndUnit( minimumViewportWidth, { coerceTo: fontSizeUnit } ); if (!maximumViewportWidthParsed || !minimumViewportWidthParsed || !minimumFontSizeRem) { return null; } const linearDenominator = maximumViewportWidthParsed.value - minimumViewportWidthParsed.value; if (!linearDenominator) { return null; } const minViewportWidthOffsetValue = roundToPrecision( minimumViewportWidthParsed.value / 100, 3 ); const viewportWidthOffset = roundToPrecision(minViewportWidthOffsetValue, 3) + fontSizeUnit; const linearFactor = 100 * ((maximumFontSizeParsed.value - minimumFontSizeParsed.value) / linearDenominator); const linearFactorScaled = roundToPrecision( (linearFactor || 1) * scaleFactor, 3 ); const fluidTargetFontSize = `${minimumFontSizeRem.value}${minimumFontSizeRem.unit} + ((1vw - ${viewportWidthOffset}) * ${linearFactorScaled})`; return `clamp(${minimumFontSize}, ${fluidTargetFontSize}, ${maximumFontSize})`; } function getTypographyValueAndUnit(rawValue, options = {}) { if (typeof rawValue !== "string" && typeof rawValue !== "number") { return null; } if (isFinite(rawValue)) { rawValue = `${rawValue}px`; } const { coerceTo, rootSizeValue, acceptableUnits } = { coerceTo: "", // Default browser font size. Later we could inject some JS to compute this `getComputedStyle( document.querySelector( "html" ) ).fontSize`. rootSizeValue: 16, acceptableUnits: ["rem", "px", "em"], ...options }; const acceptableUnitsGroup = acceptableUnits?.join("|"); const regexUnits = new RegExp( `^(\\d*\\.?\\d+)(${acceptableUnitsGroup}){1,1}$` ); const matches = rawValue.toString().match(regexUnits); if (!matches || matches.length < 3) { return null; } let [, value, unit] = matches; let returnValue = parseFloat(value); if ("px" === coerceTo && ("em" === unit || "rem" === unit)) { returnValue = returnValue * rootSizeValue; unit = coerceTo; } if ("px" === unit && ("em" === coerceTo || "rem" === coerceTo)) { returnValue = returnValue / rootSizeValue; unit = coerceTo; } if (("em" === coerceTo || "rem" === coerceTo) && ("em" === unit || "rem" === unit)) { unit = coerceTo; } if (!unit) { return null; } return { value: roundToPrecision(returnValue, 3), unit }; } function roundToPrecision(value, digits = 3) { const base = Math.pow(10, digits); return Math.round(value * base) / base; } // packages/global-styles-engine/build-module/utils/typography.mjs function isFluidTypographyEnabled(typographySettings) { const fluidSettings = typographySettings?.fluid; return true === fluidSettings || fluidSettings && typeof fluidSettings === "object" && Object.keys(fluidSettings).length > 0; } function getFluidTypographyOptionsFromSettings(settings2) { const typographySettings = settings2?.typography ?? {}; const layoutSettings = settings2?.layout; const defaultMaxViewportWidth = getTypographyValueAndUnit( layoutSettings?.wideSize ) ? layoutSettings?.wideSize : null; return isFluidTypographyEnabled(typographySettings) && defaultMaxViewportWidth ? { fluid: { maxViewportWidth: defaultMaxViewportWidth, ...typeof typographySettings.fluid === "object" ? typographySettings.fluid : {} } } : { fluid: typographySettings?.fluid }; } function getTypographyFontSizeValue(preset, settings2) { const { size: defaultSize } = preset; if (!defaultSize || "0" === defaultSize || false === preset?.fluid) { return defaultSize; } if (!isFluidTypographyEnabled(settings2?.typography) && !isFluidTypographyEnabled(preset)) { return defaultSize; } const fluidTypographySettings = getFluidTypographyOptionsFromSettings(settings2)?.fluid ?? {}; const fluidFontSizeValue = getComputedFluidTypographyValue({ minimumFontSize: typeof preset?.fluid === "boolean" ? void 0 : preset?.fluid?.min, maximumFontSize: typeof preset?.fluid === "boolean" ? void 0 : preset?.fluid?.max, fontSize: defaultSize, minimumFontSizeLimit: typeof fluidTypographySettings === "object" ? fluidTypographySettings?.minFontSize : void 0, maximumViewportWidth: typeof fluidTypographySettings === "object" ? fluidTypographySettings?.maxViewportWidth : void 0, minimumViewportWidth: typeof fluidTypographySettings === "object" ? fluidTypographySettings?.minViewportWidth : void 0 }); if (!!fluidFontSizeValue) { return fluidFontSizeValue; } return defaultSize; } // packages/global-styles-engine/build-module/utils/common.mjs var ROOT_BLOCK_SELECTOR = "body"; var ROOT_CSS_PROPERTIES_SELECTOR = ":root"; var PRESET_METADATA = [ { path: ["color", "palette"], valueKey: "color", cssVarInfix: "color", classes: [ { classSuffix: "color", propertyName: "color" }, { classSuffix: "background-color", propertyName: "background-color" }, { classSuffix: "border-color", propertyName: "border-color" } ] }, { path: ["color", "gradients"], valueKey: "gradient", cssVarInfix: "gradient", classes: [ { classSuffix: "gradient-background", propertyName: "background" } ] }, { path: ["color", "duotone"], valueKey: "colors", cssVarInfix: "duotone", valueFunc: ({ slug }) => `url( '#wp-duotone-${slug}' )`, classes: [] }, { path: ["shadow", "presets"], valueKey: "shadow", cssVarInfix: "shadow", classes: [] }, { path: ["typography", "fontSizes"], valueFunc: (preset, settings2) => getTypographyFontSizeValue(preset, settings2), valueKey: "size", cssVarInfix: "font-size", classes: [{ classSuffix: "font-size", propertyName: "font-size" }] }, { path: ["typography", "fontFamilies"], valueKey: "fontFamily", cssVarInfix: "font-family", classes: [ { classSuffix: "font-family", propertyName: "font-family" } ] }, { path: ["spacing", "spacingSizes"], valueKey: "size", cssVarInfix: "spacing", valueFunc: ({ size }) => size, classes: [] }, { path: ["border", "radiusSizes"], valueKey: "size", cssVarInfix: "border-radius", classes: [] }, { path: ["dimensions", "dimensionSizes"], valueKey: "size", cssVarInfix: "dimension", classes: [] } ]; function scopeSelector(scope, selector2) { if (!scope || !selector2) { return selector2; } const scopes = scope.split(","); const selectors = selector2.split(","); const selectorsScoped = []; scopes.forEach((outer) => { selectors.forEach((inner) => { selectorsScoped.push(`${outer.trim()} ${inner.trim()}`); }); }); return selectorsScoped.join(", "); } function scopeFeatureSelectors(scope, selectors) { if (!scope || !selectors) { return; } const featureSelectors = {}; Object.entries(selectors).forEach(([feature, selector2]) => { if (typeof selector2 === "string") { featureSelectors[feature] = scopeSelector(scope, selector2); } if (typeof selector2 === "object") { featureSelectors[feature] = {}; Object.entries(selector2).forEach( ([subfeature, subfeatureSelector]) => { featureSelectors[feature][subfeature] = scopeSelector( scope, subfeatureSelector ); } ); } }); return featureSelectors; } function appendToSelector(selector2, toAppend) { if (!selector2.includes(",")) { return selector2 + toAppend; } const selectors = selector2.split(","); const newSelectors = selectors.map((sel) => sel + toAppend); return newSelectors.join(","); } function getBlockStyleVariationSelector(variation, blockSelector) { const variationClass = `.is-style-${variation}`; if (!blockSelector) { return variationClass; } const ancestorRegex = /((?::\([^)]+\))?\s*)([^\s:]+)/; const addVariationClass = (_match, group1, group2) => { return group1 + group2 + variationClass; }; const result = blockSelector.split(",").map((part) => part.replace(ancestorRegex, addVariationClass)); return result.join(","); } function getResolvedRefValue(ruleValue, tree) { if (!ruleValue || !tree) { return ruleValue; } if (typeof ruleValue === "object" && "ref" in ruleValue && ruleValue?.ref) { const resolvedRuleValue = (0, import_style_engine.getCSSValueFromRawStyle)( getValueFromObjectPath(tree, ruleValue.ref) ); if (typeof resolvedRuleValue === "object" && resolvedRuleValue !== null && "ref" in resolvedRuleValue && resolvedRuleValue?.ref) { return void 0; } if (resolvedRuleValue === void 0) { return ruleValue; } return resolvedRuleValue; } return ruleValue; } function getResolvedThemeFilePath(file, themeFileURIs) { if (!file || !themeFileURIs || !Array.isArray(themeFileURIs)) { return file; } const uri = themeFileURIs.find( (themeFileUri) => themeFileUri?.name === file ); if (!uri?.href) { return file; } return uri?.href; } function getResolvedValue(ruleValue, tree) { if (!ruleValue || !tree) { return ruleValue; } const resolvedValue = getResolvedRefValue(ruleValue, tree); if (typeof resolvedValue === "object" && resolvedValue !== null && "url" in resolvedValue && resolvedValue?.url) { resolvedValue.url = getResolvedThemeFilePath( resolvedValue.url, tree?._links?.["wp:theme-file"] ); } return resolvedValue; } function findInPresetsBy(settings2, blockName, presetPath = [], presetProperty = "slug", presetValueValue) { const orderedPresetsByOrigin = [ blockName ? getValueFromObjectPath(settings2, [ "blocks", blockName, ...presetPath ]) : void 0, getValueFromObjectPath(settings2, presetPath) ].filter(Boolean); for (const presetByOrigin of orderedPresetsByOrigin) { if (presetByOrigin) { const origins = ["custom", "theme", "default"]; for (const origin of origins) { const presets = presetByOrigin[origin]; if (presets) { const presetObject = presets.find( (preset) => preset[presetProperty] === presetValueValue ); if (presetObject) { if (presetProperty === "slug") { return presetObject; } const highestPresetObjectWithSameSlug = findInPresetsBy( settings2, blockName, presetPath, "slug", presetObject.slug ); if (highestPresetObjectWithSameSlug[presetProperty] === presetObject[presetProperty]) { return presetObject; } return void 0; } } } } } } function getValueFromPresetVariable(features, blockName, variable, [presetType, slug] = []) { const metadata = PRESET_METADATA.find( (data) => data.cssVarInfix === presetType ); if (!metadata || !features.settings) { return variable; } const presetObject = findInPresetsBy( features.settings, blockName, metadata.path, "slug", slug ); if (presetObject) { const { valueKey } = metadata; const result = presetObject[valueKey]; return getValueFromVariable(features, blockName, result); } return variable; } function getValueFromCustomVariable(features, blockName, variable, path = []) { const result = (blockName ? getValueFromObjectPath(features?.settings ?? {}, [ "blocks", blockName, "custom", ...path ]) : void 0) ?? getValueFromObjectPath(features?.settings ?? {}, [ "custom", ...path ]); if (!result) { return variable; } return getValueFromVariable(features, blockName, result); } function getValueFromVariable(features, blockName, variable) { if (!variable || typeof variable !== "string") { if (typeof variable === "object" && variable !== null && "ref" in variable && typeof variable.ref === "string") { const resolvedVariable = getValueFromObjectPath( features, variable.ref ); if (!resolvedVariable || typeof resolvedVariable === "object" && "ref" in resolvedVariable) { return resolvedVariable; } variable = resolvedVariable; } else { return variable; } } const USER_VALUE_PREFIX = "var:"; const THEME_VALUE_PREFIX = "var(--wp--"; const THEME_VALUE_SUFFIX = ")"; let parsedVar; if (variable.startsWith(USER_VALUE_PREFIX)) { parsedVar = variable.slice(USER_VALUE_PREFIX.length).split("|"); } else if (variable.startsWith(THEME_VALUE_PREFIX) && variable.endsWith(THEME_VALUE_SUFFIX)) { parsedVar = variable.slice(THEME_VALUE_PREFIX.length, -THEME_VALUE_SUFFIX.length).split("--"); } else { return variable; } const [type, ...path] = parsedVar; if (type === "preset") { return getValueFromPresetVariable( features, blockName, variable, path ); } if (type === "custom") { return getValueFromCustomVariable( features, blockName, variable, path ); } return variable; } // packages/global-styles-engine/build-module/settings/get-style.mjs function getStyle(globalStyles, path, blockName, shouldDecodeEncode = true) { const appendedPath = path ? "." + path : ""; const finalPath = !blockName ? `styles${appendedPath}` : `styles.blocks.${blockName}${appendedPath}`; if (!globalStyles) { return void 0; } const rawResult = getValueFromObjectPath(globalStyles, finalPath); const result = shouldDecodeEncode ? getValueFromVariable(globalStyles, blockName, rawResult) : rawResult; return result; } // packages/global-styles-engine/build-module/settings/set-style.mjs function setStyle(globalStyles, path, newValue, blockName) { const appendedPath = path ? "." + path : ""; const finalPath = !blockName ? `styles${appendedPath}` : `styles.blocks.${blockName}${appendedPath}`; return setImmutably( globalStyles, finalPath.split("."), newValue ); } // packages/global-styles-engine/build-module/core/equal.mjs var import_es6 = __toESM(require_es6(), 1); function areGlobalStylesEqual(original, variation) { if (typeof original !== "object" || typeof variation !== "object") { return original === variation; } return (0, import_es6.default)(original?.styles, variation?.styles) && (0, import_es6.default)(original?.settings, variation?.settings); } // packages/global-styles-engine/build-module/core/merge.mjs var import_deepmerge = __toESM(require_cjs(), 1); // node_modules/is-plain-object/dist/is-plain-object.mjs function isObject(o3) { return Object.prototype.toString.call(o3) === "[object Object]"; } function isPlainObject(o3) { var ctor, prot; if (isObject(o3) === false) return false; ctor = o3.constructor; if (ctor === void 0) return true; prot = ctor.prototype; if (isObject(prot) === false) return false; if (prot.hasOwnProperty("isPrototypeOf") === false) { return false; } return true; } // packages/global-styles-engine/build-module/core/merge.mjs function mergeGlobalStyles(base, user) { return (0, import_deepmerge.default)(base, user, { /* * We only pass as arrays the presets, * in which case we want the new array of values * to override the old array (no merging). */ isMergeableObject: isPlainObject, /* * Exceptions to the above rule. * Background images should be replaced, not merged, * as they themselves are specific object definitions for the style. */ customMerge: (key) => { if (key === "backgroundImage") { return (baseConfig, userConfig) => userConfig ?? baseConfig; } return void 0; } }); } // packages/global-styles-engine/build-module/core/render.mjs var import_blocks3 = __toESM(require_blocks(), 1); var import_style_engine2 = __toESM(require_style_engine(), 1); var import_data17 = __toESM(require_data(), 1); // packages/global-styles-engine/build-module/core/selectors.mjs function getBlockSelector(blockType, target = "root", options = {}) { if (!target) { return null; } const { fallback = false } = options; const { name: name2, selectors, supports } = blockType; const hasSelectors = selectors && Object.keys(selectors).length > 0; const path = Array.isArray(target) ? target.join(".") : target; let rootSelector = null; if (hasSelectors && selectors.root) { rootSelector = selectors?.root; } else if (supports?.__experimentalSelector) { rootSelector = supports.__experimentalSelector; } else { rootSelector = ".wp-block-" + name2.replace("core/", "").replace("/", "-"); } if (path === "root") { return rootSelector; } const pathArray = Array.isArray(target) ? target : target.split("."); if (pathArray.length === 1) { const fallbackSelector = fallback ? rootSelector : null; if (hasSelectors) { const featureSelector2 = getValueFromObjectPath( selectors, `${path}.root`, null ) || getValueFromObjectPath(selectors, path, null); return featureSelector2 || fallbackSelector; } const featureSelector = supports ? getValueFromObjectPath( supports, `${path}.__experimentalSelector`, null ) : void 0; if (!featureSelector) { return fallbackSelector; } return scopeSelector(rootSelector, featureSelector); } let subfeatureSelector; if (hasSelectors) { subfeatureSelector = getValueFromObjectPath(selectors, path, null); } if (subfeatureSelector) { return subfeatureSelector; } if (fallback) { return getBlockSelector(blockType, pathArray[0], options); } return null; } // node_modules/colord/index.mjs var r2 = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }; var t = function(r3) { return "string" == typeof r3 ? r3.length > 0 : "number" == typeof r3; }; var n = function(r3, t3, n2) { return void 0 === t3 && (t3 = 0), void 0 === n2 && (n2 = Math.pow(10, t3)), Math.round(n2 * r3) / n2 + 0; }; var e = function(r3, t3, n2) { return void 0 === t3 && (t3 = 0), void 0 === n2 && (n2 = 1), r3 > n2 ? n2 : r3 > t3 ? r3 : t3; }; var u = function(r3) { return (r3 = isFinite(r3) ? r3 % 360 : 0) > 0 ? r3 : r3 + 360; }; var a = function(r3) { return { r: e(r3.r, 0, 255), g: e(r3.g, 0, 255), b: e(r3.b, 0, 255), a: e(r3.a) }; }; var o = function(r3) { return { r: n(r3.r), g: n(r3.g), b: n(r3.b), a: n(r3.a, 3) }; }; var i = /^#([0-9a-f]{3,8})$/i; var s = function(r3) { var t3 = r3.toString(16); return t3.length < 2 ? "0" + t3 : t3; }; var h = function(r3) { var t3 = r3.r, n2 = r3.g, e2 = r3.b, u2 = r3.a, a2 = Math.max(t3, n2, e2), o3 = a2 - Math.min(t3, n2, e2), i2 = o3 ? a2 === t3 ? (n2 - e2) / o3 : a2 === n2 ? 2 + (e2 - t3) / o3 : 4 + (t3 - n2) / o3 : 0; return { h: 60 * (i2 < 0 ? i2 + 6 : i2), s: a2 ? o3 / a2 * 100 : 0, v: a2 / 255 * 100, a: u2 }; }; var b = function(r3) { var t3 = r3.h, n2 = r3.s, e2 = r3.v, u2 = r3.a; t3 = t3 / 360 * 6, n2 /= 100, e2 /= 100; var a2 = Math.floor(t3), o3 = e2 * (1 - n2), i2 = e2 * (1 - (t3 - a2) * n2), s2 = e2 * (1 - (1 - t3 + a2) * n2), h2 = a2 % 6; return { r: 255 * [e2, i2, o3, o3, s2, e2][h2], g: 255 * [s2, e2, e2, i2, o3, o3][h2], b: 255 * [o3, o3, s2, e2, e2, i2][h2], a: u2 }; }; var g = function(r3) { return { h: u(r3.h), s: e(r3.s, 0, 100), l: e(r3.l, 0, 100), a: e(r3.a) }; }; var d = function(r3) { return { h: n(r3.h), s: n(r3.s), l: n(r3.l), a: n(r3.a, 3) }; }; var f = function(r3) { return b((n2 = (t3 = r3).s, { h: t3.h, s: (n2 *= ((e2 = t3.l) < 50 ? e2 : 100 - e2) / 100) > 0 ? 2 * n2 / (e2 + n2) * 100 : 0, v: e2 + n2, a: t3.a })); var t3, n2, e2; }; var c = function(r3) { return { h: (t3 = h(r3)).h, s: (u2 = (200 - (n2 = t3.s)) * (e2 = t3.v) / 100) > 0 && u2 < 200 ? n2 * e2 / 100 / (u2 <= 100 ? u2 : 200 - u2) * 100 : 0, l: u2 / 2, a: t3.a }; var t3, n2, e2, u2; }; var l = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i; var p2 = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i; var v = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i; var m = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i; var y = { string: [[function(r3) { var t3 = i.exec(r3); return t3 ? (r3 = t3[1]).length <= 4 ? { r: parseInt(r3[0] + r3[0], 16), g: parseInt(r3[1] + r3[1], 16), b: parseInt(r3[2] + r3[2], 16), a: 4 === r3.length ? n(parseInt(r3[3] + r3[3], 16) / 255, 2) : 1 } : 6 === r3.length || 8 === r3.length ? { r: parseInt(r3.substr(0, 2), 16), g: parseInt(r3.substr(2, 2), 16), b: parseInt(r3.substr(4, 2), 16), a: 8 === r3.length ? n(parseInt(r3.substr(6, 2), 16) / 255, 2) : 1 } : null : null; }, "hex"], [function(r3) { var t3 = v.exec(r3) || m.exec(r3); return t3 ? t3[2] !== t3[4] || t3[4] !== t3[6] ? null : a({ r: Number(t3[1]) / (t3[2] ? 100 / 255 : 1), g: Number(t3[3]) / (t3[4] ? 100 / 255 : 1), b: Number(t3[5]) / (t3[6] ? 100 / 255 : 1), a: void 0 === t3[7] ? 1 : Number(t3[7]) / (t3[8] ? 100 : 1) }) : null; }, "rgb"], [function(t3) { var n2 = l.exec(t3) || p2.exec(t3); if (!n2) return null; var e2, u2, a2 = g({ h: (e2 = n2[1], u2 = n2[2], void 0 === u2 && (u2 = "deg"), Number(e2) * (r2[u2] || 1)), s: Number(n2[3]), l: Number(n2[4]), a: void 0 === n2[5] ? 1 : Number(n2[5]) / (n2[6] ? 100 : 1) }); return f(a2); }, "hsl"]], object: [[function(r3) { var n2 = r3.r, e2 = r3.g, u2 = r3.b, o3 = r3.a, i2 = void 0 === o3 ? 1 : o3; return t(n2) && t(e2) && t(u2) ? a({ r: Number(n2), g: Number(e2), b: Number(u2), a: Number(i2) }) : null; }, "rgb"], [function(r3) { var n2 = r3.h, e2 = r3.s, u2 = r3.l, a2 = r3.a, o3 = void 0 === a2 ? 1 : a2; if (!t(n2) || !t(e2) || !t(u2)) return null; var i2 = g({ h: Number(n2), s: Number(e2), l: Number(u2), a: Number(o3) }); return f(i2); }, "hsl"], [function(r3) { var n2 = r3.h, a2 = r3.s, o3 = r3.v, i2 = r3.a, s2 = void 0 === i2 ? 1 : i2; if (!t(n2) || !t(a2) || !t(o3)) return null; var h2 = (function(r4) { return { h: u(r4.h), s: e(r4.s, 0, 100), v: e(r4.v, 0, 100), a: e(r4.a) }; })({ h: Number(n2), s: Number(a2), v: Number(o3), a: Number(s2) }); return b(h2); }, "hsv"]] }; var N = function(r3, t3) { for (var n2 = 0; n2 < t3.length; n2++) { var e2 = t3[n2][0](r3); if (e2) return [e2, t3[n2][1]]; } return [null, void 0]; }; var x = function(r3) { return "string" == typeof r3 ? N(r3.trim(), y.string) : "object" == typeof r3 && null !== r3 ? N(r3, y.object) : [null, void 0]; }; var M = function(r3, t3) { var n2 = c(r3); return { h: n2.h, s: e(n2.s + 100 * t3, 0, 100), l: n2.l, a: n2.a }; }; var H = function(r3) { return (299 * r3.r + 587 * r3.g + 114 * r3.b) / 1e3 / 255; }; var $ = function(r3, t3) { var n2 = c(r3); return { h: n2.h, s: n2.s, l: e(n2.l + 100 * t3, 0, 100), a: n2.a }; }; var j = (function() { function r3(r4) { this.parsed = x(r4)[0], this.rgba = this.parsed || { r: 0, g: 0, b: 0, a: 1 }; } return r3.prototype.isValid = function() { return null !== this.parsed; }, r3.prototype.brightness = function() { return n(H(this.rgba), 2); }, r3.prototype.isDark = function() { return H(this.rgba) < 0.5; }, r3.prototype.isLight = function() { return H(this.rgba) >= 0.5; }, r3.prototype.toHex = function() { return r4 = o(this.rgba), t3 = r4.r, e2 = r4.g, u2 = r4.b, i2 = (a2 = r4.a) < 1 ? s(n(255 * a2)) : "", "#" + s(t3) + s(e2) + s(u2) + i2; var r4, t3, e2, u2, a2, i2; }, r3.prototype.toRgb = function() { return o(this.rgba); }, r3.prototype.toRgbString = function() { return r4 = o(this.rgba), t3 = r4.r, n2 = r4.g, e2 = r4.b, (u2 = r4.a) < 1 ? "rgba(" + t3 + ", " + n2 + ", " + e2 + ", " + u2 + ")" : "rgb(" + t3 + ", " + n2 + ", " + e2 + ")"; var r4, t3, n2, e2, u2; }, r3.prototype.toHsl = function() { return d(c(this.rgba)); }, r3.prototype.toHslString = function() { return r4 = d(c(this.rgba)), t3 = r4.h, n2 = r4.s, e2 = r4.l, (u2 = r4.a) < 1 ? "hsla(" + t3 + ", " + n2 + "%, " + e2 + "%, " + u2 + ")" : "hsl(" + t3 + ", " + n2 + "%, " + e2 + "%)"; var r4, t3, n2, e2, u2; }, r3.prototype.toHsv = function() { return r4 = h(this.rgba), { h: n(r4.h), s: n(r4.s), v: n(r4.v), a: n(r4.a, 3) }; var r4; }, r3.prototype.invert = function() { return w({ r: 255 - (r4 = this.rgba).r, g: 255 - r4.g, b: 255 - r4.b, a: r4.a }); var r4; }, r3.prototype.saturate = function(r4) { return void 0 === r4 && (r4 = 0.1), w(M(this.rgba, r4)); }, r3.prototype.desaturate = function(r4) { return void 0 === r4 && (r4 = 0.1), w(M(this.rgba, -r4)); }, r3.prototype.grayscale = function() { return w(M(this.rgba, -1)); }, r3.prototype.lighten = function(r4) { return void 0 === r4 && (r4 = 0.1), w($(this.rgba, r4)); }, r3.prototype.darken = function(r4) { return void 0 === r4 && (r4 = 0.1), w($(this.rgba, -r4)); }, r3.prototype.rotate = function(r4) { return void 0 === r4 && (r4 = 15), this.hue(this.hue() + r4); }, r3.prototype.alpha = function(r4) { return "number" == typeof r4 ? w({ r: (t3 = this.rgba).r, g: t3.g, b: t3.b, a: r4 }) : n(this.rgba.a, 3); var t3; }, r3.prototype.hue = function(r4) { var t3 = c(this.rgba); return "number" == typeof r4 ? w({ h: r4, s: t3.s, l: t3.l, a: t3.a }) : n(t3.h); }, r3.prototype.isEqual = function(r4) { return this.toHex() === w(r4).toHex(); }, r3; })(); var w = function(r3) { return r3 instanceof j ? r3 : new j(r3); }; var S = []; var k = function(r3) { r3.forEach(function(r4) { S.indexOf(r4) < 0 && (r4(j, y), S.push(r4)); }); }; // packages/global-styles-engine/build-module/utils/duotone.mjs function getValuesFromColors(colors2 = []) { const values = { r: [], g: [], b: [], a: [] }; colors2.forEach((color) => { const rgbColor = w(color).toRgb(); values.r.push(rgbColor.r / 255); values.g.push(rgbColor.g / 255); values.b.push(rgbColor.b / 255); values.a.push(rgbColor.a); }); return values; } function getDuotoneFilter(id, colors2) { const values = getValuesFromColors(colors2); return ` <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="${id}"> <!-- 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="${values.r.join(" ")}"></feFuncR> <feFuncG type="table" tableValues="${values.g.join(" ")}"></feFuncG> <feFuncB type="table" tableValues="${values.b.join(" ")}"></feFuncB> <feFuncA type="table" tableValues="${values.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>`; } // packages/global-styles-engine/build-module/utils/string.mjs function kebabCase(str) { return str.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(); } // packages/global-styles-engine/build-module/utils/spacing.mjs function getSpacingPresetCssVar(value) { if (!value) { return; } const slug = value.match(/var:preset\|spacing\|(.+)/); if (!slug) { return value; } return `var(--wp--preset--spacing--${slug[1]})`; } // packages/global-styles-engine/build-module/utils/gap.mjs function getGapBoxControlValueFromStyle(blockGapValue) { if (!blockGapValue) { return null; } const isValueString = typeof blockGapValue === "string"; return { top: isValueString ? blockGapValue : blockGapValue?.top, left: isValueString ? blockGapValue : blockGapValue?.left }; } function getGapCSSValue(blockGapValue, defaultValue2 = "0") { const blockGapBoxControlValue = getGapBoxControlValueFromStyle(blockGapValue); if (!blockGapBoxControlValue) { return null; } const row = getSpacingPresetCssVar(blockGapBoxControlValue?.top) || defaultValue2; const column = getSpacingPresetCssVar(blockGapBoxControlValue?.left) || defaultValue2; return row === column ? row : `${row} ${column}`; } // packages/global-styles-engine/build-module/utils/background.mjs var BACKGROUND_BLOCK_DEFAULT_VALUES = { backgroundSize: "cover", backgroundPosition: "50% 50%" // used only when backgroundSize is 'contain'. }; function setBackgroundStyleDefaults(backgroundStyle) { if (!backgroundStyle || // @ts-expect-error !backgroundStyle?.backgroundImage?.url) { return; } let backgroundStylesWithDefaults; if (!backgroundStyle?.backgroundSize) { backgroundStylesWithDefaults = { backgroundSize: BACKGROUND_BLOCK_DEFAULT_VALUES.backgroundSize }; } if ("contain" === backgroundStyle?.backgroundSize && !backgroundStyle?.backgroundPosition) { backgroundStylesWithDefaults = { backgroundPosition: BACKGROUND_BLOCK_DEFAULT_VALUES.backgroundPosition }; } return backgroundStylesWithDefaults; } // packages/global-styles-engine/build-module/utils/layout.mjs var LAYOUT_DEFINITIONS = { 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)", // :is(*, div) instead of just * increases the specificity by 001. rules: { margin: "0" } } ], spacingStyles: [ { selector: "", rules: { gap: null } } ] }, grid: { name: "grid", slug: "grid", className: "is-layout-grid", displayMode: "grid", baseStyles: [ { selector: " > :is(*, div)", // :is(*, div) instead of just * increases the specificity by 001. rules: { margin: "0" } } ], spacingStyles: [ { selector: "", rules: { gap: null } } ] } }; // packages/global-styles-engine/build-module/core/render.mjs var ELEMENT_CLASS_NAMES = { button: "wp-element-button", caption: "wp-element-caption" }; var BLOCK_SUPPORT_FEATURE_LEVEL_SELECTORS = { __experimentalBorder: "border", color: "color", dimensions: "dimensions", spacing: "spacing", typography: "typography" }; function getPresetsDeclarations(blockPresets = {}, mergedSettings) { return PRESET_METADATA.reduce( (declarations, { path, valueKey, valueFunc, cssVarInfix }) => { const presetByOrigin = getValueFromObjectPath( blockPresets, path, [] ); ["default", "theme", "custom"].forEach((origin) => { if (presetByOrigin[origin]) { presetByOrigin[origin].forEach((value) => { if (valueKey && !valueFunc) { declarations.push( `--wp--preset--${cssVarInfix}--${kebabCase( value.slug )}: ${value[valueKey]}` ); } else if (valueFunc && typeof valueFunc === "function") { declarations.push( `--wp--preset--${cssVarInfix}--${kebabCase( value.slug )}: ${valueFunc(value, mergedSettings)}` ); } }); } }); return declarations; }, [] ); } function getPresetsClasses(blockSelector = "*", blockPresets = {}) { return PRESET_METADATA.reduce( (declarations, { path, cssVarInfix, classes }) => { if (!classes) { return declarations; } const presetByOrigin = getValueFromObjectPath( blockPresets, path, [] ); ["default", "theme", "custom"].forEach((origin) => { if (presetByOrigin[origin]) { presetByOrigin[origin].forEach( ({ slug }) => { classes.forEach( ({ classSuffix, propertyName }) => { const classSelectorToUse = `.has-${kebabCase( slug )}-${classSuffix}`; const selectorToUse = blockSelector.split(",").map( (selector2) => `${selector2}${classSelectorToUse}` ).join(","); const value = `var(--wp--preset--${cssVarInfix}--${kebabCase( slug )})`; declarations += `${selectorToUse}{${propertyName}: ${value} !important;}`; } ); } ); } }); return declarations; }, "" ); } function getPresetsSvgFilters(blockPresets = {}) { return PRESET_METADATA.filter( // Duotone are the only type of filters for now. (metadata) => metadata.path.at(-1) === "duotone" ).flatMap((metadata) => { const presetByOrigin = getValueFromObjectPath( blockPresets, metadata.path, {} ); return ["default", "theme"].filter((origin) => presetByOrigin[origin]).flatMap( (origin) => presetByOrigin[origin].map( (preset) => getDuotoneFilter( `wp-duotone-${preset.slug}`, preset.colors ) ) ).join(""); }); } function flattenTree(input = {}, prefix2, token) { let result = []; Object.keys(input).forEach((key) => { const newKey = prefix2 + kebabCase(key.replace("/", "-")); const newLeaf = input[key]; if (newLeaf instanceof Object) { const newPrefix = newKey + token; result = [...result, ...flattenTree(newLeaf, newPrefix, token)]; } else { result.push(`${newKey}: ${newLeaf}`); } }); return result; } function concatFeatureVariationSelectorString(featureSelector, styleVariationSelector) { const featureSelectors = featureSelector.split(","); const combinedSelectors = []; featureSelectors.forEach((selector2) => { combinedSelectors.push( `${styleVariationSelector.trim()}${selector2.trim()}` ); }); return combinedSelectors.join(", "); } var updateParagraphTextIndentSelector = (featureDeclarations, settings2, blockName) => { if (blockName !== "core/paragraph") { return featureDeclarations; } const blockSettings = settings2?.blocks?.["core/paragraph"]; const textIndentSetting = blockSettings?.typography?.textIndent ?? settings2?.typography?.textIndent ?? "subsequent"; if (textIndentSetting !== "all") { return featureDeclarations; } const oldSelector = ".wp-block-paragraph + .wp-block-paragraph"; const newSelector = ".wp-block-paragraph"; if (oldSelector in featureDeclarations) { const declarations = featureDeclarations[oldSelector]; const updated = { ...featureDeclarations }; delete updated[oldSelector]; updated[newSelector] = declarations; return updated; } return featureDeclarations; }; var getFeatureDeclarations = (selectors, styles) => { const declarations = {}; Object.entries(selectors).forEach(([feature, selector2]) => { if (feature === "root" || !styles?.[feature]) { return; } const isShorthand = typeof selector2 === "string"; if (!isShorthand && typeof selector2 === "object" && selector2 !== null) { Object.entries(selector2).forEach( ([subfeature, subfeatureSelector]) => { if (subfeature === "root" || !styles?.[feature][subfeature]) { return; } const subfeatureStyles = { [feature]: { [subfeature]: styles[feature][subfeature] } }; const newDeclarations = getStylesDeclarations(subfeatureStyles); declarations[subfeatureSelector] = [ ...declarations[subfeatureSelector] || [], ...newDeclarations ]; delete styles[feature][subfeature]; } ); } if (isShorthand || typeof selector2 === "object" && selector2 !== null && "root" in selector2) { const featureSelector = isShorthand ? selector2 : selector2.root; const featureStyles = { [feature]: styles[feature] }; const newDeclarations = getStylesDeclarations(featureStyles); declarations[featureSelector] = [ ...declarations[featureSelector] || [], ...newDeclarations ]; delete styles[feature]; } }); return declarations; }; function getStylesDeclarations(blockStyles = {}, selector2 = "", useRootPaddingAlign, tree = {}, disableRootPadding = false) { const isRoot = ROOT_BLOCK_SELECTOR === selector2; const output = Object.entries( import_blocks3.__EXPERIMENTAL_STYLE_PROPERTY ).reduce( (declarations, [key, { value, properties, useEngine, rootOnly }]) => { if (rootOnly && !isRoot) { return declarations; } const pathToValue = value; if (pathToValue[0] === "elements" || useEngine) { return declarations; } const styleValue = getValueFromObjectPath( blockStyles, pathToValue ); if (key === "--wp--style--root--padding" && (typeof styleValue === "string" || !useRootPaddingAlign)) { return declarations; } if (properties && typeof styleValue !== "string") { Object.entries(properties).forEach((entry) => { const [name2, prop] = entry; if (!getValueFromObjectPath(styleValue, [prop], false)) { return; } const cssProperty = name2.startsWith("--") ? name2 : kebabCase(name2); declarations.push( `${cssProperty}: ${(0, import_style_engine2.getCSSValueFromRawStyle)( getValueFromObjectPath(styleValue, [prop]) )}` ); }); } else if (getValueFromObjectPath(blockStyles, pathToValue, false)) { const cssProperty = key.startsWith("--") ? key : kebabCase(key); declarations.push( `${cssProperty}: ${(0, import_style_engine2.getCSSValueFromRawStyle)( getValueFromObjectPath(blockStyles, pathToValue) )}` ); } return declarations; }, [] ); if (!!blockStyles.background) { if (blockStyles.background?.backgroundImage) { blockStyles.background.backgroundImage = getResolvedValue( blockStyles.background.backgroundImage, tree ); } if (!isRoot && !!blockStyles.background?.backgroundImage?.id) { blockStyles = { ...blockStyles, background: { ...blockStyles.background, ...setBackgroundStyleDefaults(blockStyles.background) } }; } } const extraRules = (0, import_style_engine2.getCSSRules)(blockStyles); extraRules.forEach((rule) => { if (isRoot && (useRootPaddingAlign || disableRootPadding) && rule.key.startsWith("padding")) { return; } const cssProperty = rule.key.startsWith("--") ? rule.key : kebabCase(rule.key); let ruleValue = getResolvedValue(rule.value, tree); if (cssProperty === "font-size") { ruleValue = getTypographyFontSizeValue( { name: "", slug: "", size: ruleValue }, tree?.settings ); } if (cssProperty === "aspect-ratio") { output.push("min-height: unset"); } output.push(`${cssProperty}: ${ruleValue}`); }); return output; } function getLayoutStyles({ layoutDefinitions = LAYOUT_DEFINITIONS, style, selector: selector2, hasBlockGapSupport, hasFallbackGapSupport, fallbackGapValue }) { let ruleset = ""; let gapValue = hasBlockGapSupport ? getGapCSSValue(style?.spacing?.blockGap) : ""; if (hasFallbackGapSupport) { if (selector2 === ROOT_BLOCK_SELECTOR) { gapValue = !gapValue ? "0.5em" : gapValue; } else if (!hasBlockGapSupport && fallbackGapValue) { gapValue = fallbackGapValue; } } if (gapValue && layoutDefinitions) { Object.values(layoutDefinitions).forEach( ({ className, name: name2, spacingStyles }) => { if (!hasBlockGapSupport && "flex" !== name2 && "grid" !== name2) { return; } if (spacingStyles?.length) { spacingStyles.forEach((spacingStyle) => { const declarations = []; if (spacingStyle.rules) { Object.entries(spacingStyle.rules).forEach( ([cssProperty, cssValue]) => { declarations.push( `${cssProperty}: ${cssValue ? cssValue : gapValue}` ); } ); } if (declarations.length) { let combinedSelector = ""; if (!hasBlockGapSupport) { combinedSelector = selector2 === ROOT_BLOCK_SELECTOR ? `:where(.${className}${spacingStyle?.selector || ""})` : `:where(${selector2}.${className}${spacingStyle?.selector || ""})`; } else { combinedSelector = selector2 === ROOT_BLOCK_SELECTOR ? `:root :where(.${className})${spacingStyle?.selector || ""}` : `:root :where(${selector2}-${className})${spacingStyle?.selector || ""}`; } ruleset += `${combinedSelector} { ${declarations.join( "; " )}; }`; } }); } } ); if (selector2 === ROOT_BLOCK_SELECTOR && hasBlockGapSupport) { ruleset += `${ROOT_CSS_PROPERTIES_SELECTOR} { --wp--style--block-gap: ${gapValue}; }`; } } if (selector2 === ROOT_BLOCK_SELECTOR && layoutDefinitions) { const validDisplayModes = ["block", "flex", "grid"]; Object.values(layoutDefinitions).forEach( ({ className, displayMode, baseStyles }) => { if (displayMode && validDisplayModes.includes(displayMode)) { ruleset += `${selector2} .${className} { display:${displayMode}; }`; } if (baseStyles?.length) { baseStyles.forEach((baseStyle) => { const declarations = []; if (baseStyle.rules) { Object.entries(baseStyle.rules).forEach( ([cssProperty, cssValue]) => { declarations.push( `${cssProperty}: ${cssValue}` ); } ); } if (declarations.length) { const combinedSelector = `.${className}${baseStyle?.selector || ""}`; ruleset += `${combinedSelector} { ${declarations.join( "; " )}; }`; } }); } } ); } return ruleset; } var STYLE_KEYS = [ "border", "color", "dimensions", "spacing", "typography", "filter", "outline", "shadow", "background" ]; function pickStyleKeys(treeToPickFrom) { if (!treeToPickFrom) { return {}; } const entries = Object.entries(treeToPickFrom); const pickedEntries = entries.filter( ([key]) => STYLE_KEYS.includes(key) ); const clonedEntries = pickedEntries.map(([key, style]) => [ key, JSON.parse(JSON.stringify(style)) ]); return Object.fromEntries(clonedEntries); } var getNodesWithStyles = (tree, blockSelectors) => { const nodes = []; if (!tree?.styles) { return nodes; } const styles = pickStyleKeys(tree.styles); if (styles) { nodes.push({ styles, selector: ROOT_BLOCK_SELECTOR, // Root selector (body) styles should not be wrapped in `:root where()` to keep // specificity at (0,0,1) and maintain backwards compatibility. skipSelectorWrapper: true }); } Object.entries(import_blocks3.__EXPERIMENTAL_ELEMENTS).forEach(([name2, selector2]) => { if (tree.styles?.elements?.[name2]) { nodes.push({ styles: tree.styles?.elements?.[name2] ?? {}, selector: selector2, // Top level elements that don't use a class name should not receive the // `:root :where()` wrapper to maintain backwards compatibility. skipSelectorWrapper: !ELEMENT_CLASS_NAMES[name2] }); } }); Object.entries(tree.styles?.blocks ?? {}).forEach( ([blockName, node]) => { const blockStyles = pickStyleKeys(node); const typedNode = node; const variationNodesToAdd = []; if (typedNode?.variations) { const variations = {}; Object.entries(typedNode.variations).forEach( ([variationName, variation]) => { const typedVariation = variation; variations[variationName] = pickStyleKeys(typedVariation); if (typedVariation?.css) { variations[variationName].css = typedVariation.css; } const variationSelector = typeof blockSelectors !== "string" ? blockSelectors[blockName]?.styleVariationSelectors?.[variationName] : void 0; Object.entries( typedVariation?.elements ?? {} ).forEach(([element, elementStyles]) => { if (elementStyles && import_blocks3.__EXPERIMENTAL_ELEMENTS[element]) { variationNodesToAdd.push({ styles: elementStyles, selector: scopeSelector( variationSelector, import_blocks3.__EXPERIMENTAL_ELEMENTS[element] ) }); } }); Object.entries(typedVariation?.blocks ?? {}).forEach( ([ variationBlockName, variationBlockStyles ]) => { const variationBlockSelector = typeof blockSelectors !== "string" ? scopeSelector( variationSelector, blockSelectors[variationBlockName]?.selector ) : void 0; const variationDuotoneSelector = typeof blockSelectors !== "string" ? scopeSelector( variationSelector, blockSelectors[variationBlockName]?.duotoneSelector ) : void 0; const variationFeatureSelectors = typeof blockSelectors !== "string" ? scopeFeatureSelectors( variationSelector, blockSelectors[variationBlockName]?.featureSelectors ?? {} ) : void 0; const variationBlockStyleNodes = pickStyleKeys(variationBlockStyles); if (variationBlockStyles?.css) { variationBlockStyleNodes.css = variationBlockStyles.css; } if (!variationBlockSelector || typeof blockSelectors === "string") { return; } variationNodesToAdd.push({ selector: variationBlockSelector, duotoneSelector: variationDuotoneSelector, featureSelectors: variationFeatureSelectors, fallbackGapValue: blockSelectors[variationBlockName]?.fallbackGapValue, hasLayoutSupport: blockSelectors[variationBlockName]?.hasLayoutSupport, styles: variationBlockStyleNodes }); Object.entries( variationBlockStyles.elements ?? {} ).forEach( ([ variationBlockElement, variationBlockElementStyles ]) => { if (variationBlockElementStyles && import_blocks3.__EXPERIMENTAL_ELEMENTS[variationBlockElement]) { variationNodesToAdd.push({ styles: variationBlockElementStyles, selector: scopeSelector( variationBlockSelector, import_blocks3.__EXPERIMENTAL_ELEMENTS[variationBlockElement] ) }); } } ); } ); } ); blockStyles.variations = variations; } if (typeof blockSelectors !== "string" && blockSelectors?.[blockName]?.selector) { nodes.push({ duotoneSelector: blockSelectors[blockName].duotoneSelector, fallbackGapValue: blockSelectors[blockName].fallbackGapValue, hasLayoutSupport: blockSelectors[blockName].hasLayoutSupport, selector: blockSelectors[blockName].selector, styles: blockStyles, featureSelectors: blockSelectors[blockName].featureSelectors, styleVariationSelectors: blockSelectors[blockName].styleVariationSelectors, name: blockName }); } Object.entries(typedNode?.elements ?? {}).forEach( ([elementName, value]) => { if (typeof blockSelectors !== "string" && value && blockSelectors?.[blockName] && import_blocks3.__EXPERIMENTAL_ELEMENTS[elementName]) { nodes.push({ styles: value, selector: blockSelectors[blockName]?.selector.split(",").map((sel) => { const elementSelectors = import_blocks3.__EXPERIMENTAL_ELEMENTS[elementName].split(","); return elementSelectors.map( (elementSelector) => sel + " " + elementSelector ); }).join(",") }); } } ); nodes.push(...variationNodesToAdd); } ); return nodes; }; var getNodesWithSettings = (tree, blockSelectors) => { const nodes = []; if (!tree?.settings) { return nodes; } const pickPresets = (treeToPickFrom) => { let presets2 = {}; PRESET_METADATA.forEach(({ path }) => { const value = getValueFromObjectPath(treeToPickFrom, path, false); if (value !== false) { presets2 = setImmutably(presets2, path, value); } }); return presets2; }; const presets = pickPresets(tree.settings); const custom = tree.settings?.custom; if (Object.keys(presets).length > 0 || custom) { nodes.push({ presets, custom, selector: ROOT_CSS_PROPERTIES_SELECTOR }); } Object.entries(tree.settings?.blocks ?? {}).forEach( ([blockName, node]) => { const blockCustom = node.custom; if (typeof blockSelectors === "string" || !blockSelectors[blockName]) { return; } const blockPresets = pickPresets(node); if (Object.keys(blockPresets).length > 0 || blockCustom) { nodes.push({ presets: blockPresets, custom: blockCustom, selector: blockSelectors[blockName]?.selector }); } } ); return nodes; }; var generateCustomProperties = (tree, blockSelectors) => { const settings2 = getNodesWithSettings(tree, blockSelectors); let ruleset = ""; settings2.forEach(({ presets, custom, selector: selector2 }) => { const declarations = tree?.settings ? getPresetsDeclarations(presets, tree?.settings) : []; const customProps = flattenTree(custom, "--wp--custom--", "--"); if (customProps.length > 0) { declarations.push(...customProps); } if (declarations.length > 0) { ruleset += `${selector2}{${declarations.join(";")};}`; } }); return ruleset; }; var transformToStyles = (tree, blockSelectors, hasBlockGapSupport, hasFallbackGapSupport, disableLayoutStyles = false, disableRootPadding = false, styleOptions = {}) => { const options = { blockGap: true, blockStyles: true, layoutStyles: true, marginReset: true, presets: true, rootPadding: true, variationStyles: false, ...styleOptions }; const nodesWithStyles = getNodesWithStyles(tree, blockSelectors); const nodesWithSettings = getNodesWithSettings(tree, blockSelectors); const useRootPaddingAlign = tree?.settings?.useRootPaddingAwareAlignments; const { contentSize, wideSize } = tree?.settings?.layout || {}; const hasBodyStyles = options.marginReset || options.rootPadding || options.layoutStyles; let ruleset = ""; if (options.presets && (contentSize || wideSize)) { ruleset += `${ROOT_CSS_PROPERTIES_SELECTOR} {`; ruleset = contentSize ? ruleset + ` --wp--style--global--content-size: ${contentSize};` : ruleset; ruleset = wideSize ? ruleset + ` --wp--style--global--wide-size: ${wideSize};` : ruleset; ruleset += "}"; } if (hasBodyStyles) { ruleset += ":where(body) {margin: 0;"; if (options.rootPadding && useRootPaddingAlign) { ruleset += `padding-right: 0; padding-left: 0; padding-top: var(--wp--style--root--padding-top); padding-bottom: var(--wp--style--root--padding-bottom) } .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; `; } ruleset += "}"; } if (options.blockStyles) { nodesWithStyles.forEach( ({ selector: selector2, duotoneSelector, styles, fallbackGapValue, hasLayoutSupport, featureSelectors, styleVariationSelectors, skipSelectorWrapper, name: name2 }) => { if (featureSelectors) { let featureDeclarations = getFeatureDeclarations( featureSelectors, styles ); featureDeclarations = updateParagraphTextIndentSelector( featureDeclarations, tree.settings, name2 ); Object.entries(featureDeclarations).forEach( ([cssSelector, declarations]) => { if (declarations.length) { const rules = declarations.join(";"); ruleset += `:root :where(${cssSelector}){${rules};}`; } } ); } if (duotoneSelector) { const duotoneStyles = {}; if (styles?.filter) { duotoneStyles.filter = styles.filter; delete styles.filter; } const duotoneDeclarations = getStylesDeclarations(duotoneStyles); if (duotoneDeclarations.length) { ruleset += `${duotoneSelector}{${duotoneDeclarations.join( ";" )};}`; } } if (!disableLayoutStyles && (ROOT_BLOCK_SELECTOR === selector2 || hasLayoutSupport)) { ruleset += getLayoutStyles({ style: styles, selector: selector2, hasBlockGapSupport, hasFallbackGapSupport, fallbackGapValue }); } const styleDeclarations = getStylesDeclarations( styles, selector2, useRootPaddingAlign, tree, disableRootPadding ); if (styleDeclarations?.length) { const generalSelector = skipSelectorWrapper ? selector2 : `:root :where(${selector2})`; ruleset += `${generalSelector}{${styleDeclarations.join( ";" )};}`; } if (styles?.css) { ruleset += processCSSNesting( styles.css, `:root :where(${selector2})` ); } if (options.variationStyles && styleVariationSelectors) { Object.entries(styleVariationSelectors).forEach( ([styleVariationName, styleVariationSelector]) => { const styleVariations = styles?.variations?.[styleVariationName]; if (styleVariations) { if (featureSelectors) { let featureDeclarations = getFeatureDeclarations( featureSelectors, styleVariations ); featureDeclarations = updateParagraphTextIndentSelector( featureDeclarations, tree.settings, name2 ); Object.entries( featureDeclarations ).forEach( ([baseSelector, declarations]) => { if (declarations.length) { const cssSelector = concatFeatureVariationSelectorString( baseSelector, styleVariationSelector ); const rules = declarations.join(";"); ruleset += `:root :where(${cssSelector}){${rules};}`; } } ); } const styleVariationDeclarations = getStylesDeclarations( styleVariations, styleVariationSelector, useRootPaddingAlign, tree ); if (styleVariationDeclarations.length) { ruleset += `:root :where(${styleVariationSelector}){${styleVariationDeclarations.join( ";" )};}`; } if (styleVariations?.css) { ruleset += processCSSNesting( styleVariations.css, `:root :where(${styleVariationSelector})` ); } if (hasLayoutSupport && styleVariations?.spacing?.blockGap) { const variationSelectorWithBlock = styleVariationSelector + selector2; ruleset += getLayoutStyles({ style: styleVariations, selector: variationSelectorWithBlock, hasBlockGapSupport: true, hasFallbackGapSupport, fallbackGapValue }); } } } ); } const pseudoSelectorStyles = Object.entries(styles).filter( ([key]) => key.startsWith(":") ); if (pseudoSelectorStyles?.length) { pseudoSelectorStyles.forEach( ([pseudoKey, pseudoStyle]) => { const pseudoDeclarations = getStylesDeclarations(pseudoStyle); if (!pseudoDeclarations?.length) { return; } const _selector = selector2.split(",").map((sel) => sel + pseudoKey).join(","); const pseudoRule = `:root :where(${_selector}){${pseudoDeclarations.join( ";" )};}`; ruleset += pseudoRule; } ); } } ); } if (options.layoutStyles) { ruleset = ruleset + ".wp-site-blocks > .alignleft { float: left; margin-right: 2em; }"; ruleset = ruleset + ".wp-site-blocks > .alignright { float: right; margin-left: 2em; }"; ruleset = ruleset + ".wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }"; } if (options.blockGap && hasBlockGapSupport) { const gapValue = getGapCSSValue(tree?.styles?.spacing?.blockGap) || "0.5em"; ruleset = ruleset + `:root :where(.wp-site-blocks) > * { margin-block-start: ${gapValue}; margin-block-end: 0; }`; ruleset = ruleset + ":root :where(.wp-site-blocks) > :first-child { margin-block-start: 0; }"; ruleset = ruleset + ":root :where(.wp-site-blocks) > :last-child { margin-block-end: 0; }"; } if (options.presets) { nodesWithSettings.forEach(({ selector: selector2, presets }) => { if (ROOT_BLOCK_SELECTOR === selector2 || ROOT_CSS_PROPERTIES_SELECTOR === selector2) { selector2 = ""; } const classes = getPresetsClasses(selector2, presets); if (classes.length > 0) { ruleset += classes; } }); } return ruleset; }; function generateSvgFilters(tree, blockSelectors) { const nodesWithSettings = getNodesWithSettings(tree, blockSelectors); return nodesWithSettings.flatMap(({ presets }) => { return getPresetsSvgFilters(presets); }); } var getSelectorsConfig = (blockType, rootSelector) => { if (blockType?.selectors && Object.keys(blockType.selectors).length > 0) { return blockType.selectors; } const config2 = { root: rootSelector }; Object.entries(BLOCK_SUPPORT_FEATURE_LEVEL_SELECTORS).forEach( ([featureKey, featureName]) => { const featureSelector = getBlockSelector(blockType, featureKey); if (featureSelector) { config2[featureName] = featureSelector; } } ); return config2; }; var getBlockSelectors = (blockTypes, variationInstanceId) => { const { getBlockStyles } = (0, import_data17.select)(import_blocks3.store); const result = {}; blockTypes.forEach((blockType) => { const name2 = blockType.name; const selector2 = getBlockSelector(blockType); if (!selector2) { return; } let duotoneSelector = getBlockSelector(blockType, "filter.duotone"); if (!duotoneSelector) { const rootSelector = getBlockSelector(blockType); const duotoneSupport = (0, import_blocks3.getBlockSupport)( blockType, "color.__experimentalDuotone", false ); duotoneSelector = duotoneSupport && rootSelector && scopeSelector(rootSelector, duotoneSupport); } const hasLayoutSupport = !!blockType?.supports?.layout || !!blockType?.supports?.__experimentalLayout; const fallbackGapValue = ( // @ts-expect-error blockType?.supports?.spacing?.blockGap?.__experimentalDefault ); const blockStyleVariations = getBlockStyles(name2); const styleVariationSelectors = {}; blockStyleVariations?.forEach((variation) => { const variationSuffix = variationInstanceId ? `-${variationInstanceId}` : ""; const variationName = `${variation.name}${variationSuffix}`; const styleVariationSelector = getBlockStyleVariationSelector( variationName, selector2 ); styleVariationSelectors[variationName] = styleVariationSelector; }); const featureSelectors = getSelectorsConfig(blockType, selector2); result[name2] = { duotoneSelector: duotoneSelector ?? void 0, fallbackGapValue, featureSelectors: Object.keys(featureSelectors).length ? featureSelectors : void 0, hasLayoutSupport, name: name2, selector: selector2, styleVariationSelectors: blockStyleVariations?.length ? styleVariationSelectors : void 0 }; }); return result; }; function updateConfigWithSeparator(config2) { const blocks = config2.styles?.blocks; const separatorBlock = blocks?.["core/separator"]; const needsSeparatorStyleUpdate = separatorBlock && separatorBlock.color?.background && !separatorBlock.color?.text && !separatorBlock.border?.color; if (needsSeparatorStyleUpdate) { return { ...config2, styles: { ...config2.styles, blocks: { ...blocks, "core/separator": { ...separatorBlock, color: { ...separatorBlock.color, text: separatorBlock.color?.background } } } } }; } return config2; } function processCSSNesting(css, blockSelector) { let processedCSS = ""; if (!css || css.trim() === "") { return processedCSS; } const parts = css.split("&"); parts.forEach((part) => { if (!part || part.trim() === "") { return; } const isRootCss = !part.includes("{"); if (isRootCss) { processedCSS += `:root :where(${blockSelector}){${part.trim()}}`; } else { const splitPart = part.replace("}", "").split("{"); if (splitPart.length !== 2) { return; } const [nestedSelector, cssValue] = splitPart; const matches = nestedSelector.match(/([>+~\s]*::[a-zA-Z-]+)/); const pseudoPart = matches ? matches[1] : ""; const withoutPseudoElement = matches ? nestedSelector.replace(pseudoPart, "").trim() : nestedSelector.trim(); let combinedSelector; if (withoutPseudoElement === "") { combinedSelector = blockSelector; } else { combinedSelector = nestedSelector.startsWith(" ") ? scopeSelector(blockSelector, withoutPseudoElement) : appendToSelector(blockSelector, withoutPseudoElement); } processedCSS += `:root :where(${combinedSelector})${pseudoPart}{${cssValue.trim()}}`; } }); return processedCSS; } function generateGlobalStyles(config2 = {}, blockTypes = [], options = {}) { const { hasBlockGapSupport: hasBlockGapSupportOption, hasFallbackGapSupport: hasFallbackGapSupportOption, disableLayoutStyles = false, disableRootPadding = false, styleOptions = {} } = options; const blocks = blockTypes.length > 0 ? blockTypes : (0, import_blocks3.getBlockTypes)(); const blockGap = getSetting(config2, "spacing.blockGap"); const hasBlockGapSupport = hasBlockGapSupportOption ?? blockGap !== null; const hasFallbackGapSupport = hasFallbackGapSupportOption ?? !hasBlockGapSupport; if (!config2?.styles || !config2?.settings) { return [[], {}]; } const updatedConfig = updateConfigWithSeparator(config2); const blockSelectors = getBlockSelectors(blocks); const customProperties = generateCustomProperties( updatedConfig, blockSelectors ); const globalStyles = transformToStyles( updatedConfig, blockSelectors, hasBlockGapSupport, hasFallbackGapSupport, disableLayoutStyles, disableRootPadding, styleOptions ); const svgs = generateSvgFilters(updatedConfig, blockSelectors); const styles = [ { css: customProperties, isGlobalStyles: true }, { css: globalStyles, isGlobalStyles: true }, // Load custom CSS in own stylesheet so that any invalid CSS entered in the input won't break all the global styles in the editor. { css: updatedConfig?.styles?.css ?? "", isGlobalStyles: true }, { assets: svgs, __unstableType: "svg", isGlobalStyles: true } ]; blocks.forEach((blockType) => { const blockStyles = updatedConfig?.styles?.blocks?.[blockType.name]; if (blockStyles?.css) { const selector2 = blockSelectors[blockType.name].selector; styles.push({ css: processCSSNesting(blockStyles.css, selector2), isGlobalStyles: true }); } }); return [styles, updatedConfig.settings]; } // packages/global-styles-ui/build-module/provider.mjs var import_element19 = __toESM(require_element(), 1); // packages/global-styles-ui/build-module/context.mjs var import_element18 = __toESM(require_element(), 1); var GlobalStylesContext = (0, import_element18.createContext)({ user: { styles: {}, settings: {} }, base: { styles: {}, settings: {} }, merged: { styles: {}, settings: {} }, onChange: () => { }, fontLibraryEnabled: false }); // packages/global-styles-ui/build-module/provider.mjs var import_jsx_runtime81 = __toESM(require_jsx_runtime(), 1); function GlobalStylesProvider({ children, value, baseValue, onChange, fontLibraryEnabled }) { const merged = (0, import_element19.useMemo)(() => { return mergeGlobalStyles(baseValue, value); }, [baseValue, value]); const contextValue = (0, import_element19.useMemo)( () => ({ user: value, base: baseValue, merged, onChange, fontLibraryEnabled }), [value, baseValue, merged, onChange, fontLibraryEnabled] ); return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(GlobalStylesContext.Provider, { value: contextValue, children }); } // packages/global-styles-ui/build-module/screen-root.mjs var import_components18 = __toESM(require_components(), 1); var import_i18n15 = __toESM(require_i18n(), 1); var import_data19 = __toESM(require_data(), 1); var import_core_data15 = __toESM(require_core_data(), 1); // packages/global-styles-ui/build-module/icon-with-current-color.mjs var import_jsx_runtime82 = __toESM(require_jsx_runtime(), 1); function IconWithCurrentColor({ className, ...props }) { return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)( icon_default, { className: clsx_default( className, "global-styles-ui-icon-with-current-color" ), ...props } ); } // packages/global-styles-ui/build-module/navigation-button.mjs var import_components12 = __toESM(require_components(), 1); var import_jsx_runtime83 = __toESM(require_jsx_runtime(), 1); function GenericNavigationButton({ icon, children, ...props }) { return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(import_components12.__experimentalItem, { ...props, children: [ icon && /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(import_components12.__experimentalHStack, { justify: "flex-start", children: [ /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(IconWithCurrentColor, { icon, size: 24 }), /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_components12.FlexItem, { children }) ] }), !icon && children ] }); } function NavigationButtonAsItem(props) { return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_components12.Navigator.Button, { as: GenericNavigationButton, ...props }); } // packages/global-styles-ui/build-module/root-menu.mjs var import_components13 = __toESM(require_components(), 1); var import_i18n13 = __toESM(require_i18n(), 1); var import_block_editor4 = __toESM(require_block_editor(), 1); // node_modules/colord/plugins/a11y.mjs var o2 = function(o3) { var t3 = o3 / 255; return t3 < 0.04045 ? t3 / 12.92 : Math.pow((t3 + 0.055) / 1.055, 2.4); }; var t2 = function(t3) { return 0.2126 * o2(t3.r) + 0.7152 * o2(t3.g) + 0.0722 * o2(t3.b); }; function a11y_default(o3) { o3.prototype.luminance = function() { return o4 = t2(this.rgba), void 0 === (r3 = 2) && (r3 = 0), void 0 === n2 && (n2 = Math.pow(10, r3)), Math.round(n2 * o4) / n2 + 0; var o4, r3, n2; }, o3.prototype.contrast = function(r3) { void 0 === r3 && (r3 = "#FFF"); var n2, a2, i2, e2, v2, u2, d2, c6 = r3 instanceof o3 ? r3 : new o3(r3); return e2 = this.rgba, v2 = c6.toRgb(), u2 = t2(e2), d2 = t2(v2), n2 = u2 > d2 ? (u2 + 0.05) / (d2 + 0.05) : (d2 + 0.05) / (u2 + 0.05), void 0 === (a2 = 2) && (a2 = 0), void 0 === i2 && (i2 = Math.pow(10, a2)), Math.floor(i2 * n2) / i2 + 0; }, o3.prototype.isReadable = function(o4, t3) { return void 0 === o4 && (o4 = "#FFF"), void 0 === t3 && (t3 = {}), this.contrast(o4) >= (e2 = void 0 === (i2 = (r3 = t3).size) ? "normal" : i2, "AAA" === (a2 = void 0 === (n2 = r3.level) ? "AA" : n2) && "normal" === e2 ? 7 : "AA" === a2 && "large" === e2 ? 3 : 4.5); var r3, n2, a2, i2, e2; }; } // packages/global-styles-ui/build-module/hooks.mjs var import_element20 = __toESM(require_element(), 1); var import_data18 = __toESM(require_data(), 1); var import_core_data14 = __toESM(require_core_data(), 1); var import_i18n12 = __toESM(require_i18n(), 1); // packages/global-styles-ui/build-module/utils.mjs function removePropertiesFromObject(object, properties) { if (!properties?.length) { return object; } if (typeof object !== "object" || !object || !Object.keys(object).length) { return object; } for (const key in object) { if (properties.includes(key)) { delete object[key]; } else if (typeof object[key] === "object") { removePropertiesFromObject(object[key], properties); } } return object; } var filterObjectByProperties = (object, properties) => { if (!object || !properties?.length) { return {}; } const newObject = {}; Object.keys(object).forEach((key) => { if (properties.includes(key)) { newObject[key] = object[key]; } else if (typeof object[key] === "object") { const newFilter = filterObjectByProperties( object[key], properties ); if (Object.keys(newFilter).length) { newObject[key] = newFilter; } } }); return newObject; }; function isVariationWithProperties(variation, properties) { const variationWithProperties = filterObjectByProperties( structuredClone(variation), properties ); return areGlobalStylesEqual(variationWithProperties, variation); } function getFontFamilyFromSetting(fontFamilies, setting) { if (!Array.isArray(fontFamilies) || !setting) { return null; } const fontFamilyVariable = setting.replace("var(", "").replace(")", ""); const fontFamilySlug = fontFamilyVariable?.split("--").slice(-1)[0]; return fontFamilies.find( (fontFamily) => fontFamily.slug === fontFamilySlug ); } function getFontFamilies(themeJson) { const themeFontFamilies = themeJson?.settings?.typography?.fontFamilies?.theme; const customFontFamilies = themeJson?.settings?.typography?.fontFamilies?.custom; let fontFamilies = []; if (themeFontFamilies && customFontFamilies) { fontFamilies = [...themeFontFamilies, ...customFontFamilies]; } else if (themeFontFamilies) { fontFamilies = themeFontFamilies; } else if (customFontFamilies) { fontFamilies = customFontFamilies; } const bodyFontFamilySetting = themeJson?.styles?.typography?.fontFamily; const bodyFontFamily = getFontFamilyFromSetting( fontFamilies, bodyFontFamilySetting ); const headingFontFamilySetting = themeJson?.styles?.elements?.heading?.typography?.fontFamily; let headingFontFamily; if (!headingFontFamilySetting) { headingFontFamily = bodyFontFamily; } else { headingFontFamily = getFontFamilyFromSetting( fontFamilies, themeJson?.styles?.elements?.heading?.typography?.fontFamily ); } return [bodyFontFamily, headingFontFamily]; } // packages/global-styles-ui/build-module/hooks.mjs k([a11y_default]); function useStyle2(path, blockName, readFrom = "merged", shouldDecodeEncode = true) { const { user, base, merged, onChange } = (0, import_element20.useContext)(GlobalStylesContext); let sourceValue = merged; if (readFrom === "base") { sourceValue = base; } else if (readFrom === "user") { sourceValue = user; } const styleValue = (0, import_element20.useMemo)( () => getStyle(sourceValue, path, blockName, shouldDecodeEncode), [sourceValue, path, blockName, shouldDecodeEncode] ); const setStyleValue = (0, import_element20.useCallback)( (newValue) => { const newGlobalStyles = setStyle( user, path, newValue, blockName ); onChange(newGlobalStyles); }, [user, onChange, path, blockName] ); return [styleValue, setStyleValue]; } function useSetting(path, blockName, readFrom = "merged") { const { user, base, merged, onChange } = (0, import_element20.useContext)(GlobalStylesContext); let sourceValue = merged; if (readFrom === "base") { sourceValue = base; } else if (readFrom === "user") { sourceValue = user; } const settingValue = (0, import_element20.useMemo)( () => getSetting(sourceValue, path, blockName), [sourceValue, path, blockName] ); const setSettingValue = (0, import_element20.useCallback)( (newValue) => { const newGlobalStyles = setSetting( user, path, newValue, blockName ); onChange(newGlobalStyles); }, [user, onChange, path, blockName] ); return [settingValue, setSettingValue]; } var EMPTY_ARRAY3 = []; function hasThemeVariation({ title, settings: settings2, styles }) { return title === (0, import_i18n12.__)("Default") || Object.keys(settings2 || {}).length > 0 || Object.keys(styles || {}).length > 0; } function useCurrentMergeThemeStyleVariationsWithUserConfig(properties = []) { const { variationsFromTheme } = (0, import_data18.useSelect)((select3) => { const _variationsFromTheme = select3( import_core_data14.store ).__experimentalGetCurrentThemeGlobalStylesVariations?.(); return { variationsFromTheme: _variationsFromTheme || EMPTY_ARRAY3 }; }, []); const { user: userVariation } = (0, import_element20.useContext)(GlobalStylesContext); return (0, import_element20.useMemo)(() => { const clonedUserVariation = structuredClone(userVariation); const userVariationWithoutProperties = removePropertiesFromObject( clonedUserVariation, properties ); userVariationWithoutProperties.title = (0, import_i18n12.__)("Default"); const variationsWithPropertiesAndBase = variationsFromTheme.filter((variation) => { return isVariationWithProperties(variation, properties); }).map((variation) => { return mergeGlobalStyles( userVariationWithoutProperties, variation ); }); const variationsByProperties = [ userVariationWithoutProperties, ...variationsWithPropertiesAndBase ]; return variationsByProperties?.length ? variationsByProperties.filter(hasThemeVariation) : []; }, [properties, userVariation, variationsFromTheme]); } // packages/global-styles-ui/build-module/lock-unlock.mjs var import_private_apis2 = __toESM(require_private_apis(), 1); var { lock: lock2, unlock: unlock2 } = (0, import_private_apis2.__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/global-styles-ui" ); // packages/global-styles-ui/build-module/root-menu.mjs var import_jsx_runtime84 = __toESM(require_jsx_runtime(), 1); var { useHasDimensionsPanel, useHasTypographyPanel, useHasColorPanel, useSettingsForBlockElement, useHasBackgroundPanel } = unlock2(import_block_editor4.privateApis); // packages/global-styles-ui/build-module/preview-styles.mjs var import_components17 = __toESM(require_components(), 1); // packages/global-styles-ui/build-module/preview-hooks.mjs function useStylesPreviewColors() { const [textColor = "black"] = useStyle2("color.text"); const [backgroundColor = "white"] = useStyle2("color.background"); const [headingColor = textColor] = useStyle2( "elements.h1.color.text" ); const [linkColor = headingColor] = useStyle2( "elements.link.color.text" ); const [buttonBackgroundColor = linkColor] = useStyle2( "elements.button.color.background" ); const [coreColors] = useSetting("color.palette.core") || []; const [themeColors] = useSetting("color.palette.theme") || []; const [customColors] = useSetting("color.palette.custom") || []; const paletteColors = (themeColors ?? []).concat(customColors ?? []).concat(coreColors ?? []); const textColorObject = paletteColors.filter( ({ color }) => color === textColor ); const buttonBackgroundColorObject = paletteColors.filter( ({ color }) => color === buttonBackgroundColor ); const highlightedColors = textColorObject.concat(buttonBackgroundColorObject).concat(paletteColors).filter( // we exclude these background color because it is already visible in the preview. ({ color }) => color !== backgroundColor ).slice(0, 2); return { paletteColors, highlightedColors }; } // packages/global-styles-ui/build-module/typography-example.mjs var import_element21 = __toESM(require_element(), 1); var import_components14 = __toESM(require_components(), 1); var import_i18n14 = __toESM(require_i18n(), 1); // packages/global-styles-ui/build-module/font-library/utils/preview-styles.mjs function findNearest(input, numbers) { if (numbers.length === 0) { return null; } numbers.sort((a2, b2) => Math.abs(input - a2) - Math.abs(input - b2)); return numbers[0]; } function extractFontWeights(fontFaces) { const result = []; fontFaces.forEach((face) => { const weights = String(face.fontWeight).split(" "); if (weights.length === 2) { const start2 = parseInt(weights[0]); const end = parseInt(weights[1]); for (let i2 = start2; i2 <= end; i2 += 100) { result.push(i2); } } else if (weights.length === 1) { result.push(parseInt(weights[0])); } }); return result; } function formatFontFamily(input) { const regex = /^(?!generic\([ a-zA-Z\-]+\)$)(?!^[a-zA-Z\-]+$).+/; const output = input.trim(); const formatItem = (item) => { item = item.trim(); if (item.match(regex)) { item = item.replace(/^["']|["']$/g, ""); return `"${item}"`; } return item; }; if (output.includes(",")) { return output.split(",").map(formatItem).filter((item) => item !== "").join(", "); } return formatItem(output); } function getFamilyPreviewStyle(family) { const style = { fontFamily: formatFontFamily(family.fontFamily) }; if (!("fontFace" in family) || !Array.isArray(family.fontFace)) { style.fontWeight = "400"; style.fontStyle = "normal"; return style; } if (family.fontFace) { const normalFaces = family.fontFace.filter( (face) => face?.fontStyle && face.fontStyle.toLowerCase() === "normal" ); if (normalFaces.length > 0) { style.fontStyle = "normal"; const normalWeights = extractFontWeights(normalFaces); const nearestWeight = findNearest(400, normalWeights); style.fontWeight = String(nearestWeight) || "400"; } else { style.fontStyle = family.fontFace.length && family.fontFace[0].fontStyle || "normal"; style.fontWeight = family.fontFace.length && String(family.fontFace[0].fontWeight) || "400"; } } return style; } // packages/global-styles-ui/build-module/typography-example.mjs var import_jsx_runtime85 = __toESM(require_jsx_runtime(), 1); function PreviewTypography({ fontSize, variation }) { const { base } = (0, import_element21.useContext)(GlobalStylesContext); let config2 = base; if (variation) { config2 = { ...base, ...variation }; } const [textColor] = useStyle2("color.text"); const [bodyFontFamilies, headingFontFamilies] = getFontFamilies(config2); const bodyPreviewStyle = bodyFontFamilies ? getFamilyPreviewStyle(bodyFontFamilies) : {}; const headingPreviewStyle = headingFontFamilies ? getFamilyPreviewStyle(headingFontFamilies) : {}; if (textColor) { bodyPreviewStyle.color = textColor; headingPreviewStyle.color = textColor; } if (fontSize) { bodyPreviewStyle.fontSize = fontSize; headingPreviewStyle.fontSize = fontSize; } return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)( import_components14.__unstableMotion.div, { animate: { scale: 1, opacity: 1 }, initial: { scale: 0.1, opacity: 0 }, transition: { delay: 0.3, type: "tween" }, style: { textAlign: "center", lineHeight: 1 }, children: [ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { style: headingPreviewStyle, children: (0, import_i18n14._x)("A", "Uppercase letter A") }), /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { style: bodyPreviewStyle, children: (0, import_i18n14._x)("a", "Lowercase letter A") }) ] } ); } // packages/global-styles-ui/build-module/highlighted-colors.mjs var import_components15 = __toESM(require_components(), 1); var import_jsx_runtime86 = __toESM(require_jsx_runtime(), 1); function HighlightedColors({ normalizedColorSwatchSize, ratio }) { const { highlightedColors } = useStylesPreviewColors(); const scaledSwatchSize = normalizedColorSwatchSize * ratio; return highlightedColors.map(({ slug, color }, index) => /* @__PURE__ */ (0, import_jsx_runtime86.jsx)( import_components15.__unstableMotion.div, { style: { height: scaledSwatchSize, width: scaledSwatchSize, background: color, borderRadius: scaledSwatchSize / 2 }, animate: { scale: 1, opacity: 1 }, initial: { scale: 0.1, opacity: 0 }, transition: { delay: index === 1 ? 0.2 : 0.1 } }, `${slug}-${index}` )); } // packages/global-styles-ui/build-module/preview-wrapper.mjs var import_components16 = __toESM(require_components(), 1); var import_compose3 = __toESM(require_compose(), 1); var import_element22 = __toESM(require_element(), 1); var import_jsx_runtime87 = __toESM(require_jsx_runtime(), 1); var normalizedWidth = 248; var normalizedHeight = 152; var THROTTLE_OPTIONS = { leading: true, trailing: true }; function PreviewWrapper({ children, label, isFocused, withHoverView }) { const [backgroundColor = "white"] = useStyle2("color.background"); const [gradientValue] = useStyle2("color.gradient"); const disableMotion = (0, import_compose3.useReducedMotion)(); const [isHovered, setIsHovered] = (0, import_element22.useState)(false); const [containerResizeListener, { width }] = (0, import_compose3.useResizeObserver)(); const [throttledWidth, setThrottledWidthState] = (0, import_element22.useState)(width); const [ratioState, setRatioState] = (0, import_element22.useState)(); const setThrottledWidth = (0, import_compose3.useThrottle)( setThrottledWidthState, 250, THROTTLE_OPTIONS ); (0, import_element22.useLayoutEffect)(() => { if (width) { setThrottledWidth(width); } }, [width, setThrottledWidth]); (0, import_element22.useLayoutEffect)(() => { const newRatio = throttledWidth ? throttledWidth / normalizedWidth : 1; const ratioDiff = newRatio - (ratioState || 0); const isRatioDiffBigEnough = Math.abs(ratioDiff) > 0.1; if (isRatioDiffBigEnough || !ratioState) { setRatioState(newRatio); } }, [throttledWidth, ratioState]); const fallbackRatio = width ? width / normalizedWidth : 1; const ratio = ratioState ? ratioState : fallbackRatio; const isReady = !!width; return /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(import_jsx_runtime87.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { style: { position: "relative" }, children: containerResizeListener }), isReady && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)( "div", { className: "global-styles-ui-preview__wrapper", style: { height: normalizedHeight * ratio }, onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), tabIndex: -1, children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)( import_components16.__unstableMotion.div, { style: { height: normalizedHeight * ratio, width: "100%", background: gradientValue ?? backgroundColor, cursor: withHoverView ? "pointer" : void 0 }, initial: "start", animate: (isHovered || isFocused) && !disableMotion && label ? "hover" : "start", children: [].concat(children).map( (child, key) => child({ ratio, key }) ) } ) } ) ] }); } var preview_wrapper_default = PreviewWrapper; // packages/global-styles-ui/build-module/preview-styles.mjs var import_jsx_runtime88 = __toESM(require_jsx_runtime(), 1); var firstFrameVariants = { start: { scale: 1, opacity: 1 }, hover: { scale: 0, opacity: 0 } }; var midFrameVariants = { hover: { opacity: 1 }, start: { opacity: 0.5 } }; var secondFrameVariants = { hover: { scale: 1, opacity: 1 }, start: { scale: 0, opacity: 0 } }; function PreviewStyles({ label, isFocused, withHoverView, variation }) { const [fontWeight] = useStyle2("typography.fontWeight"); const [fontFamily = "serif"] = useStyle2( "typography.fontFamily" ); const [headingFontFamily = fontFamily] = useStyle2( "elements.h1.typography.fontFamily" ); const [headingFontWeight = fontWeight] = useStyle2( "elements.h1.typography.fontWeight" ); const [textColor = "black"] = useStyle2("color.text"); const [headingColor = textColor] = useStyle2( "elements.h1.color.text" ); const { paletteColors } = useStylesPreviewColors(); return /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)( preview_wrapper_default, { label, isFocused, withHoverView, children: [ ({ ratio, key }) => /* @__PURE__ */ (0, import_jsx_runtime88.jsx)( import_components17.__unstableMotion.div, { variants: firstFrameVariants, style: { height: "100%", overflow: "hidden" }, children: /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)( import_components17.__experimentalHStack, { spacing: 10 * ratio, justify: "center", style: { height: "100%", overflow: "hidden" }, children: [ /* @__PURE__ */ (0, import_jsx_runtime88.jsx)( PreviewTypography, { fontSize: 65 * ratio, variation } ), /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_components17.__experimentalVStack, { spacing: 4 * ratio, children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)( HighlightedColors, { normalizedColorSwatchSize: 32, ratio } ) }) ] } ) }, key ), ({ key }) => /* @__PURE__ */ (0, import_jsx_runtime88.jsx)( import_components17.__unstableMotion.div, { variants: withHoverView ? midFrameVariants : void 0, style: { height: "100%", width: "100%", position: "absolute", top: 0, overflow: "hidden", filter: "blur(60px)", opacity: 0.1 }, children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)( import_components17.__experimentalHStack, { spacing: 0, justify: "flex-start", style: { height: "100%", overflow: "hidden" }, children: paletteColors.slice(0, 4).map(({ color }, index) => /* @__PURE__ */ (0, import_jsx_runtime88.jsx)( "div", { style: { height: "100%", background: color, flexGrow: 1 } }, index )) } ) }, key ), ({ ratio, key }) => /* @__PURE__ */ (0, import_jsx_runtime88.jsx)( import_components17.__unstableMotion.div, { variants: secondFrameVariants, style: { height: "100%", width: "100%", overflow: "hidden", position: "absolute", top: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)( import_components17.__experimentalVStack, { spacing: 3 * ratio, justify: "center", style: { height: "100%", overflow: "hidden", padding: 10 * ratio, boxSizing: "border-box" }, children: label && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)( "div", { style: { fontSize: 40 * ratio, fontFamily: headingFontFamily, color: headingColor, fontWeight: headingFontWeight, lineHeight: "1em", textAlign: "center" }, children: label } ) } ) }, key ) ] } ); } var preview_styles_default = PreviewStyles; // packages/global-styles-ui/build-module/screen-root.mjs var import_jsx_runtime89 = __toESM(require_jsx_runtime(), 1); // packages/global-styles-ui/build-module/screen-block-list.mjs var import_blocks5 = __toESM(require_blocks(), 1); var import_i18n17 = __toESM(require_i18n(), 1); var import_components21 = __toESM(require_components(), 1); var import_data21 = __toESM(require_data(), 1); var import_element23 = __toESM(require_element(), 1); var import_block_editor5 = __toESM(require_block_editor(), 1); var import_compose4 = __toESM(require_compose(), 1); var import_a11y2 = __toESM(require_a11y(), 1); // packages/global-styles-ui/build-module/variations/variations-panel.mjs var import_blocks4 = __toESM(require_blocks(), 1); var import_data20 = __toESM(require_data(), 1); var import_components19 = __toESM(require_components(), 1); var import_jsx_runtime90 = __toESM(require_jsx_runtime(), 1); function getFilteredBlockStyles(blockStyles, variations) { return blockStyles?.filter( (style) => style.source === "block" || variations.includes(style.name) ) || []; } function useBlockVariations(name2) { const blockStyles = (0, import_data20.useSelect)( (select3) => { const { getBlockStyles } = select3(import_blocks4.store); return getBlockStyles(name2); }, [name2] ); const [variations] = useStyle2("variations", name2); const variationNames = Object.keys(variations ?? {}); return getFilteredBlockStyles(blockStyles, variationNames); } // packages/global-styles-ui/build-module/screen-header.mjs var import_components20 = __toESM(require_components(), 1); var import_i18n16 = __toESM(require_i18n(), 1); var import_jsx_runtime91 = __toESM(require_jsx_runtime(), 1); // packages/global-styles-ui/build-module/screen-block-list.mjs var import_jsx_runtime92 = __toESM(require_jsx_runtime(), 1); var { useHasDimensionsPanel: useHasDimensionsPanel2, useHasTypographyPanel: useHasTypographyPanel2, useHasBorderPanel, useSettingsForBlockElement: useSettingsForBlockElement2, useHasColorPanel: useHasColorPanel2 } = unlock2(import_block_editor5.privateApis); function useSortedBlockTypes() { const blockItems = (0, import_data21.useSelect)( (select3) => select3(import_blocks5.store).getBlockTypes(), [] ); const groupByType = (blocks, block) => { const { core, noncore } = blocks; const type = block.name.startsWith("core/") ? core : noncore; type.push(block); return blocks; }; const { core: coreItems, noncore: nonCoreItems } = blockItems.reduce( groupByType, { core: [], noncore: [] } ); return [...coreItems, ...nonCoreItems]; } function useBlockHasGlobalStyles(blockName) { const [rawSettings] = useSetting("", blockName); const settings2 = useSettingsForBlockElement2(rawSettings, blockName); const hasTypographyPanel = useHasTypographyPanel2(settings2); const hasColorPanel = useHasColorPanel2(settings2); const hasBorderPanel = useHasBorderPanel(settings2); const hasDimensionsPanel = useHasDimensionsPanel2(settings2); const hasLayoutPanel = hasBorderPanel || hasDimensionsPanel; const hasVariationsPanel = !!useBlockVariations(blockName)?.length; const hasGlobalStyles = hasTypographyPanel || hasColorPanel || hasLayoutPanel || hasVariationsPanel; return hasGlobalStyles; } function BlockMenuItem({ block }) { const hasBlockMenuItem = useBlockHasGlobalStyles(block.name); if (!hasBlockMenuItem) { return null; } return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)( NavigationButtonAsItem, { path: "/blocks/" + encodeURIComponent(block.name), children: /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(import_components21.__experimentalHStack, { justify: "flex-start", children: [ /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(import_block_editor5.BlockIcon, { icon: block.icon }), /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(import_components21.FlexItem, { children: block.title }) ] }) } ); } function BlockList({ filterValue }) { const sortedBlockTypes = useSortedBlockTypes(); const debouncedSpeak = (0, import_compose4.useDebounce)(import_a11y2.speak, 500); const { isMatchingSearchTerm } = (0, import_data21.useSelect)(import_blocks5.store); const filteredBlockTypes = !filterValue ? sortedBlockTypes : sortedBlockTypes.filter( (blockType) => isMatchingSearchTerm(blockType, filterValue) ); const blockTypesListRef = (0, import_element23.useRef)(null); (0, import_element23.useEffect)(() => { if (!filterValue) { return; } const count = blockTypesListRef.current?.childElementCount || 0; const resultsFoundMessage = (0, import_i18n17.sprintf)( /* translators: %d: number of results. */ (0, import_i18n17._n)("%d result found.", "%d results found.", count), count ); debouncedSpeak(resultsFoundMessage, "polite"); }, [filterValue, debouncedSpeak]); return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)( "div", { ref: blockTypesListRef, className: "global-styles-ui-block-types-item-list", role: "list", children: filteredBlockTypes.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(import_components21.__experimentalText, { align: "center", as: "p", children: (0, import_i18n17.__)("No blocks found.") }) : filteredBlockTypes.map((block) => /* @__PURE__ */ (0, import_jsx_runtime92.jsx)( BlockMenuItem, { block }, "menu-itemblock-" + block.name )) } ); } var MemoizedBlockList = (0, import_element23.memo)(BlockList); // packages/global-styles-ui/build-module/screen-block.mjs var import_blocks7 = __toESM(require_blocks(), 1); var import_block_editor7 = __toESM(require_block_editor(), 1); var import_element25 = __toESM(require_element(), 1); var import_data22 = __toESM(require_data(), 1); var import_core_data16 = __toESM(require_core_data(), 1); var import_components24 = __toESM(require_components(), 1); var import_i18n18 = __toESM(require_i18n(), 1); // packages/global-styles-ui/build-module/block-preview-panel.mjs var import_block_editor6 = __toESM(require_block_editor(), 1); var import_blocks6 = __toESM(require_blocks(), 1); var import_components22 = __toESM(require_components(), 1); var import_element24 = __toESM(require_element(), 1); var import_jsx_runtime93 = __toESM(require_jsx_runtime(), 1); // packages/global-styles-ui/build-module/subtitle.mjs var import_components23 = __toESM(require_components(), 1); var import_jsx_runtime94 = __toESM(require_jsx_runtime(), 1); function Subtitle({ children, level = 2 }) { return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_components23.__experimentalHeading, { className: "global-styles-ui-subtitle", level, children }); } // packages/global-styles-ui/build-module/screen-block.mjs var import_jsx_runtime95 = __toESM(require_jsx_runtime(), 1); var { useHasDimensionsPanel: useHasDimensionsPanel3, useHasTypographyPanel: useHasTypographyPanel3, useHasBorderPanel: useHasBorderPanel2, useSettingsForBlockElement: useSettingsForBlockElement3, useHasColorPanel: useHasColorPanel3, useHasFiltersPanel, useHasImageSettingsPanel, useHasBackgroundPanel: useHasBackgroundPanel2, BackgroundPanel: StylesBackgroundPanel, BorderPanel: StylesBorderPanel, ColorPanel: StylesColorPanel, TypographyPanel: StylesTypographyPanel, DimensionsPanel: StylesDimensionsPanel, FiltersPanel: StylesFiltersPanel, ImageSettingsPanel, AdvancedPanel: StylesAdvancedPanel } = unlock2(import_block_editor7.privateApis); // packages/global-styles-ui/build-module/screen-typography.mjs var import_i18n32 = __toESM(require_i18n(), 1); var import_components44 = __toESM(require_components(), 1); var import_element36 = __toESM(require_element(), 1); // packages/global-styles-ui/build-module/screen-body.mjs var import_components25 = __toESM(require_components(), 1); var import_jsx_runtime96 = __toESM(require_jsx_runtime(), 1); // packages/global-styles-ui/build-module/typography-elements.mjs var import_i18n19 = __toESM(require_i18n(), 1); var import_components26 = __toESM(require_components(), 1); var import_jsx_runtime97 = __toESM(require_jsx_runtime(), 1); // packages/global-styles-ui/build-module/variations/variations-typography.mjs var import_components29 = __toESM(require_components(), 1); // packages/global-styles-ui/build-module/preview-typography.mjs var import_components27 = __toESM(require_components(), 1); var import_jsx_runtime98 = __toESM(require_jsx_runtime(), 1); var StylesPreviewTypography = ({ variation, isFocused, withHoverView }) => { return /* @__PURE__ */ (0, import_jsx_runtime98.jsx)( preview_wrapper_default, { label: variation.title, isFocused, withHoverView, children: ({ ratio, key }) => /* @__PURE__ */ (0, import_jsx_runtime98.jsx)( import_components27.__experimentalHStack, { spacing: 10 * ratio, justify: "center", style: { height: "100%", overflow: "hidden" }, children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)( PreviewTypography, { variation, fontSize: 85 * ratio } ) }, key ) } ); }; var preview_typography_default = StylesPreviewTypography; // packages/global-styles-ui/build-module/variations/variation.mjs var import_components28 = __toESM(require_components(), 1); var import_element26 = __toESM(require_element(), 1); var import_keycodes3 = __toESM(require_keycodes(), 1); var import_i18n20 = __toESM(require_i18n(), 1); var import_jsx_runtime99 = __toESM(require_jsx_runtime(), 1); function Variation({ variation, children, isPill = false, properties, showTooltip = false }) { const [isFocused, setIsFocused] = (0, import_element26.useState)(false); const { base, user, onChange: setUserConfig } = (0, import_element26.useContext)(GlobalStylesContext); const context = (0, import_element26.useMemo)(() => { let merged = mergeGlobalStyles(base, variation); if (properties) { merged = filterObjectByProperties(merged, properties); } return { user: variation, base, merged, onChange: () => { } }; }, [variation, base, properties]); const selectVariation = () => setUserConfig(variation); const selectOnEnter = (event) => { if (event.keyCode === import_keycodes3.ENTER) { event.preventDefault(); selectVariation(); } }; const isActive = (0, import_element26.useMemo)( () => areGlobalStylesEqual(user, variation), [user, variation] ); let label = variation?.title; if (variation?.description) { label = (0, import_i18n20.sprintf)( /* translators: 1: variation title. 2: variation description. */ (0, import_i18n20._x)("%1$s (%2$s)", "variation label"), variation?.title, variation?.description ); } const content = /* @__PURE__ */ (0, import_jsx_runtime99.jsx)( "div", { className: clsx_default("global-styles-ui-variations_item", { "is-active": isActive }), role: "button", onClick: selectVariation, onKeyDown: selectOnEnter, tabIndex: 0, "aria-label": label, "aria-current": isActive, onFocus: () => setIsFocused(true), onBlur: () => setIsFocused(false), children: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)( "div", { className: clsx_default("global-styles-ui-variations_item-preview", { "is-pill": isPill }), children: children(isFocused) } ) } ); return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(GlobalStylesContext.Provider, { value: context, children: showTooltip ? /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(import_components28.Tooltip, { text: variation?.title, children: content }) : content }); } // packages/global-styles-ui/build-module/variations/variations-typography.mjs var import_jsx_runtime100 = __toESM(require_jsx_runtime(), 1); var propertiesToFilter = ["typography"]; function TypographyVariations({ title, gap = 2 }) { const typographyVariations = useCurrentMergeThemeStyleVariationsWithUserConfig(propertiesToFilter); if (typographyVariations?.length <= 1) { return null; } return /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(import_components29.__experimentalVStack, { spacing: 3, children: [ title && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(Subtitle, { level: 3, children: title }), /* @__PURE__ */ (0, import_jsx_runtime100.jsx)( import_components29.__experimentalGrid, { columns: 3, gap, className: "global-styles-ui-style-variations-container", children: typographyVariations.map( (variation, index) => { return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)( Variation, { variation, properties: propertiesToFilter, showTooltip: true, children: () => /* @__PURE__ */ (0, import_jsx_runtime100.jsx)( preview_typography_default, { variation } ) }, index ); } ) } ) ] }); } // packages/global-styles-ui/build-module/font-families.mjs var import_i18n30 = __toESM(require_i18n(), 1); var import_components42 = __toESM(require_components(), 1); var import_element35 = __toESM(require_element(), 1); // packages/global-styles-ui/build-module/font-library/context.mjs var import_element27 = __toESM(require_element(), 1); var import_data23 = __toESM(require_data(), 1); var import_core_data18 = __toESM(require_core_data(), 1); var import_i18n22 = __toESM(require_i18n(), 1); // packages/global-styles-ui/build-module/font-library/api.mjs var import_api_fetch2 = __toESM(require_api_fetch(), 1); var import_core_data17 = __toESM(require_core_data(), 1); // packages/global-styles-ui/build-module/font-library/utils/index.mjs var import_components30 = __toESM(require_components(), 1); // packages/global-styles-ui/build-module/font-library/utils/constants.mjs var import_i18n21 = __toESM(require_i18n(), 1); var FONT_WEIGHTS = { 100: (0, import_i18n21._x)("Thin", "font weight"), 200: (0, import_i18n21._x)("Extra-light", "font weight"), 300: (0, import_i18n21._x)("Light", "font weight"), 400: (0, import_i18n21._x)("Normal", "font weight"), 500: (0, import_i18n21._x)("Medium", "font weight"), 600: (0, import_i18n21._x)("Semi-bold", "font weight"), 700: (0, import_i18n21._x)("Bold", "font weight"), 800: (0, import_i18n21._x)("Extra-bold", "font weight"), 900: (0, import_i18n21._x)("Black", "font weight") }; var FONT_STYLES = { normal: (0, import_i18n21._x)("Normal", "font style"), italic: (0, import_i18n21._x)("Italic", "font style") }; // packages/global-styles-ui/build-module/font-library/utils/index.mjs var { File } = window; var { kebabCase: kebabCase2 } = unlock2(import_components30.privateApis); // packages/global-styles-ui/build-module/font-library/context.mjs var import_jsx_runtime101 = __toESM(require_jsx_runtime(), 1); var FontLibraryContext = (0, import_element27.createContext)( {} ); FontLibraryContext.displayName = "FontLibraryContext"; // packages/global-styles-ui/build-module/font-library/modal.mjs var import_i18n28 = __toESM(require_i18n(), 1); var import_components40 = __toESM(require_components(), 1); var import_core_data21 = __toESM(require_core_data(), 1); var import_data25 = __toESM(require_data(), 1); // packages/global-styles-ui/build-module/font-library/installed-fonts.mjs var import_components34 = __toESM(require_components(), 1); var import_core_data19 = __toESM(require_core_data(), 1); var import_data24 = __toESM(require_data(), 1); var import_element30 = __toESM(require_element(), 1); var import_i18n24 = __toESM(require_i18n(), 1); // packages/global-styles-ui/build-module/font-library/font-card.mjs var import_i18n23 = __toESM(require_i18n(), 1); var import_components32 = __toESM(require_components(), 1); // packages/global-styles-ui/build-module/font-library/font-demo.mjs var import_components31 = __toESM(require_components(), 1); var import_element28 = __toESM(require_element(), 1); var import_jsx_runtime102 = __toESM(require_jsx_runtime(), 1); // packages/global-styles-ui/build-module/font-library/font-card.mjs var import_jsx_runtime103 = __toESM(require_jsx_runtime(), 1); // packages/global-styles-ui/build-module/font-library/library-font-variant.mjs var import_element29 = __toESM(require_element(), 1); var import_components33 = __toESM(require_components(), 1); var import_jsx_runtime104 = __toESM(require_jsx_runtime(), 1); // packages/global-styles-ui/build-module/font-library/installed-fonts.mjs var import_jsx_runtime105 = __toESM(require_jsx_runtime(), 1); // packages/global-styles-ui/build-module/font-library/font-collection.mjs var import_element32 = __toESM(require_element(), 1); var import_components37 = __toESM(require_components(), 1); var import_compose5 = __toESM(require_compose(), 1); var import_i18n26 = __toESM(require_i18n(), 1); var import_core_data20 = __toESM(require_core_data(), 1); // packages/global-styles-ui/build-module/font-library/google-fonts-confirm-dialog.mjs var import_i18n25 = __toESM(require_i18n(), 1); var import_components35 = __toESM(require_components(), 1); var import_jsx_runtime106 = __toESM(require_jsx_runtime(), 1); // packages/global-styles-ui/build-module/font-library/collection-font-variant.mjs var import_element31 = __toESM(require_element(), 1); var import_components36 = __toESM(require_components(), 1); var import_jsx_runtime107 = __toESM(require_jsx_runtime(), 1); // packages/global-styles-ui/build-module/font-library/font-collection.mjs var import_jsx_runtime108 = __toESM(require_jsx_runtime(), 1); var DEFAULT_CATEGORY = { slug: "all", name: (0, import_i18n26._x)("All", "font categories") }; // packages/global-styles-ui/build-module/font-library/upload-fonts.mjs var import_i18n27 = __toESM(require_i18n(), 1); var import_components39 = __toESM(require_components(), 1); var import_element33 = __toESM(require_element(), 1); // packages/global-styles-ui/build-module/font-library/lib/unbrotli.mjs var __require2 = /* @__PURE__ */ ((x2) => typeof __require !== "undefined" ? __require : typeof Proxy !== "undefined" ? new Proxy(x2, { get: (a2, b2) => (typeof __require !== "undefined" ? __require : a2)[b2] }) : x2)(function(x2) { if (typeof __require !== "undefined") return __require.apply(this, arguments); throw Error('Dynamic require of "' + x2 + '" is not supported'); }); var unbrotli_default = (function() { var define, module, exports; return (/* @__PURE__ */ (function() { function r3(e2, n2, t3) { function o3(i22, f2) { if (!n2[i22]) { if (!e2[i22]) { var c6 = "function" == typeof __require2 && __require2; if (!f2 && c6) return c6(i22, true); if (u2) return u2(i22, true); var a2 = new Error("Cannot find module '" + i22 + "'"); throw a2.code = "MODULE_NOT_FOUND", a2; } var p3 = n2[i22] = { exports: {} }; e2[i22][0].call( p3.exports, function(r22) { var n22 = e2[i22][1][r22]; return o3(n22 || r22); }, p3, p3.exports, r3, e2, n2, t3 ); } return n2[i22].exports; } for (var u2 = "function" == typeof __require2 && __require2, i2 = 0; i2 < t3.length; i2++) o3(t3[i2]); return o3; } return r3; })())( { 1: [ function(require2, module2, exports2) { var BROTLI_READ_SIZE = 4096; var BROTLI_IBUF_SIZE = 2 * BROTLI_READ_SIZE + 32; var BROTLI_IBUF_MASK = 2 * BROTLI_READ_SIZE - 1; var kBitMask = new Uint32Array([ 0, 1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 4095, 8191, 16383, 32767, 65535, 131071, 262143, 524287, 1048575, 2097151, 4194303, 8388607, 16777215 ]); function BrotliBitReader(input) { this.buf_ = new Uint8Array(BROTLI_IBUF_SIZE); this.input_ = input; this.reset(); } BrotliBitReader.READ_SIZE = BROTLI_READ_SIZE; BrotliBitReader.IBUF_MASK = BROTLI_IBUF_MASK; BrotliBitReader.prototype.reset = function() { this.buf_ptr_ = 0; this.val_ = 0; this.pos_ = 0; this.bit_pos_ = 0; this.bit_end_pos_ = 0; this.eos_ = 0; this.readMoreInput(); for (var i2 = 0; i2 < 4; i2++) { this.val_ |= this.buf_[this.pos_] << 8 * i2; ++this.pos_; } return this.bit_end_pos_ > 0; }; BrotliBitReader.prototype.readMoreInput = function() { if (this.bit_end_pos_ > 256) { return; } else if (this.eos_) { if (this.bit_pos_ > this.bit_end_pos_) throw new Error( "Unexpected end of input " + this.bit_pos_ + " " + this.bit_end_pos_ ); } else { var dst = this.buf_ptr_; var bytes_read = this.input_.read( this.buf_, dst, BROTLI_READ_SIZE ); if (bytes_read < 0) { throw new Error("Unexpected end of input"); } if (bytes_read < BROTLI_READ_SIZE) { this.eos_ = 1; for (var p3 = 0; p3 < 32; p3++) this.buf_[dst + bytes_read + p3] = 0; } if (dst === 0) { for (var p3 = 0; p3 < 32; p3++) this.buf_[(BROTLI_READ_SIZE << 1) + p3] = this.buf_[p3]; this.buf_ptr_ = BROTLI_READ_SIZE; } else { this.buf_ptr_ = 0; } this.bit_end_pos_ += bytes_read << 3; } }; BrotliBitReader.prototype.fillBitWindow = function() { while (this.bit_pos_ >= 8) { this.val_ >>>= 8; this.val_ |= this.buf_[this.pos_ & BROTLI_IBUF_MASK] << 24; ++this.pos_; this.bit_pos_ = this.bit_pos_ - 8 >>> 0; this.bit_end_pos_ = this.bit_end_pos_ - 8 >>> 0; } }; BrotliBitReader.prototype.readBits = function(n_bits) { if (32 - this.bit_pos_ < n_bits) { this.fillBitWindow(); } var val = this.val_ >>> this.bit_pos_ & kBitMask[n_bits]; this.bit_pos_ += n_bits; return val; }; module2.exports = BrotliBitReader; }, {} ], 2: [ function(require2, module2, exports2) { var CONTEXT_LSB6 = 0; var CONTEXT_MSB6 = 1; var CONTEXT_UTF8 = 2; var CONTEXT_SIGNED = 3; exports2.lookup = new Uint8Array([ /* CONTEXT_UTF8, last byte. */ /* ASCII range. */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 12, 16, 12, 12, 20, 12, 16, 24, 28, 12, 12, 32, 12, 36, 12, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 32, 32, 24, 40, 28, 12, 12, 48, 52, 52, 52, 48, 52, 52, 52, 48, 52, 52, 52, 52, 52, 48, 52, 52, 52, 52, 52, 48, 52, 52, 52, 52, 52, 24, 12, 28, 12, 12, 12, 56, 60, 60, 60, 56, 60, 60, 60, 56, 60, 60, 60, 60, 60, 56, 60, 60, 60, 60, 60, 56, 60, 60, 60, 60, 60, 24, 12, 28, 12, 0, /* UTF8 continuation byte range. */ 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, /* ASCII range. */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 0, /* UTF8 continuation byte range. */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, /* CONTEXT_SIGNED, last byte, same as the above values shifted by 3 bits. */ 0, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 56, /* CONTEXT_LSB6, last byte. */ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, /* CONTEXT_MSB6, last byte. */ 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 23, 23, 23, 23, 24, 24, 24, 24, 25, 25, 25, 25, 26, 26, 26, 26, 27, 27, 27, 27, 28, 28, 28, 28, 29, 29, 29, 29, 30, 30, 30, 30, 31, 31, 31, 31, 32, 32, 32, 32, 33, 33, 33, 33, 34, 34, 34, 34, 35, 35, 35, 35, 36, 36, 36, 36, 37, 37, 37, 37, 38, 38, 38, 38, 39, 39, 39, 39, 40, 40, 40, 40, 41, 41, 41, 41, 42, 42, 42, 42, 43, 43, 43, 43, 44, 44, 44, 44, 45, 45, 45, 45, 46, 46, 46, 46, 47, 47, 47, 47, 48, 48, 48, 48, 49, 49, 49, 49, 50, 50, 50, 50, 51, 51, 51, 51, 52, 52, 52, 52, 53, 53, 53, 53, 54, 54, 54, 54, 55, 55, 55, 55, 56, 56, 56, 56, 57, 57, 57, 57, 58, 58, 58, 58, 59, 59, 59, 59, 60, 60, 60, 60, 61, 61, 61, 61, 62, 62, 62, 62, 63, 63, 63, 63, /* CONTEXT_{M,L}SB6, second last byte, */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]); exports2.lookupOffsets = new Uint16Array([ /* CONTEXT_LSB6 */ 1024, 1536, 1280, 1536, 0, 256, 768, 512 ]); }, {} ], 3: [ function(require2, module2, exports2) { var BrotliInput = require2("./streams").BrotliInput; var BrotliOutput = require2("./streams").BrotliOutput; var BrotliBitReader = require2("./bit_reader"); var BrotliDictionary = require2("./dictionary"); var HuffmanCode = require2("./huffman").HuffmanCode; var BrotliBuildHuffmanTable = require2("./huffman").BrotliBuildHuffmanTable; var Context = require2("./context"); var Prefix = require2("./prefix"); var Transform = require2("./transform"); var kDefaultCodeLength = 8; var kCodeLengthRepeatCode = 16; var kNumLiteralCodes = 256; var kNumInsertAndCopyCodes = 704; var kNumBlockLengthCodes = 26; var kLiteralContextBits = 6; var kDistanceContextBits = 2; var HUFFMAN_TABLE_BITS = 8; var HUFFMAN_TABLE_MASK = 255; var HUFFMAN_MAX_TABLE_SIZE = 1080; var CODE_LENGTH_CODES = 18; var kCodeLengthCodeOrder = new Uint8Array([ 1, 2, 3, 4, 0, 5, 17, 6, 16, 7, 8, 9, 10, 11, 12, 13, 14, 15 ]); var NUM_DISTANCE_SHORT_CODES = 16; var kDistanceShortCodeIndexOffset = new Uint8Array([ 3, 2, 1, 0, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2 ]); var kDistanceShortCodeValueOffset = new Int8Array([ 0, 0, 0, 0, -1, 1, -2, 2, -3, 3, -1, 1, -2, 2, -3, 3 ]); var kMaxHuffmanTableSize = new Uint16Array([ 256, 402, 436, 468, 500, 534, 566, 598, 630, 662, 694, 726, 758, 790, 822, 854, 886, 920, 952, 984, 1016, 1048, 1080 ]); function DecodeWindowBits(br) { var n2; if (br.readBits(1) === 0) { return 16; } n2 = br.readBits(3); if (n2 > 0) { return 17 + n2; } n2 = br.readBits(3); if (n2 > 0) { return 8 + n2; } return 17; } function DecodeVarLenUint8(br) { if (br.readBits(1)) { var nbits = br.readBits(3); if (nbits === 0) { return 1; } else { return br.readBits(nbits) + (1 << nbits); } } return 0; } function MetaBlockLength() { this.meta_block_length = 0; this.input_end = 0; this.is_uncompressed = 0; this.is_metadata = false; } function DecodeMetaBlockLength(br) { var out = new MetaBlockLength(); var size_nibbles; var size_bytes; var i2; out.input_end = br.readBits(1); if (out.input_end && br.readBits(1)) { return out; } size_nibbles = br.readBits(2) + 4; if (size_nibbles === 7) { out.is_metadata = true; if (br.readBits(1) !== 0) throw new Error("Invalid reserved bit"); size_bytes = br.readBits(2); if (size_bytes === 0) return out; for (i2 = 0; i2 < size_bytes; i2++) { var next_byte = br.readBits(8); if (i2 + 1 === size_bytes && size_bytes > 1 && next_byte === 0) throw new Error("Invalid size byte"); out.meta_block_length |= next_byte << i2 * 8; } } else { for (i2 = 0; i2 < size_nibbles; ++i2) { var next_nibble = br.readBits(4); if (i2 + 1 === size_nibbles && size_nibbles > 4 && next_nibble === 0) throw new Error("Invalid size nibble"); out.meta_block_length |= next_nibble << i2 * 4; } } ++out.meta_block_length; if (!out.input_end && !out.is_metadata) { out.is_uncompressed = br.readBits(1); } return out; } function ReadSymbol(table, index, br) { var start_index = index; var nbits; br.fillBitWindow(); index += br.val_ >>> br.bit_pos_ & HUFFMAN_TABLE_MASK; nbits = table[index].bits - HUFFMAN_TABLE_BITS; if (nbits > 0) { br.bit_pos_ += HUFFMAN_TABLE_BITS; index += table[index].value; index += br.val_ >>> br.bit_pos_ & (1 << nbits) - 1; } br.bit_pos_ += table[index].bits; return table[index].value; } function ReadHuffmanCodeLengths(code_length_code_lengths, num_symbols, code_lengths, br) { var symbol3 = 0; var prev_code_len = kDefaultCodeLength; var repeat = 0; var repeat_code_len = 0; var space = 32768; var table = []; for (var i2 = 0; i2 < 32; i2++) table.push(new HuffmanCode(0, 0)); BrotliBuildHuffmanTable( table, 0, 5, code_length_code_lengths, CODE_LENGTH_CODES ); while (symbol3 < num_symbols && space > 0) { var p3 = 0; var code_len; br.readMoreInput(); br.fillBitWindow(); p3 += br.val_ >>> br.bit_pos_ & 31; br.bit_pos_ += table[p3].bits; code_len = table[p3].value & 255; if (code_len < kCodeLengthRepeatCode) { repeat = 0; code_lengths[symbol3++] = code_len; if (code_len !== 0) { prev_code_len = code_len; space -= 32768 >> code_len; } } else { var extra_bits = code_len - 14; var old_repeat; var repeat_delta; var new_len = 0; if (code_len === kCodeLengthRepeatCode) { new_len = prev_code_len; } if (repeat_code_len !== new_len) { repeat = 0; repeat_code_len = new_len; } old_repeat = repeat; if (repeat > 0) { repeat -= 2; repeat <<= extra_bits; } repeat += br.readBits(extra_bits) + 3; repeat_delta = repeat - old_repeat; if (symbol3 + repeat_delta > num_symbols) { throw new Error( "[ReadHuffmanCodeLengths] symbol + repeat_delta > num_symbols" ); } for (var x2 = 0; x2 < repeat_delta; x2++) code_lengths[symbol3 + x2] = repeat_code_len; symbol3 += repeat_delta; if (repeat_code_len !== 0) { space -= repeat_delta << 15 - repeat_code_len; } } } if (space !== 0) { throw new Error( "[ReadHuffmanCodeLengths] space = " + space ); } for (; symbol3 < num_symbols; symbol3++) code_lengths[symbol3] = 0; } function ReadHuffmanCode(alphabet_size, tables, table, br) { var table_size = 0; var simple_code_or_skip; var code_lengths = new Uint8Array(alphabet_size); br.readMoreInput(); simple_code_or_skip = br.readBits(2); if (simple_code_or_skip === 1) { var i2; var max_bits_counter = alphabet_size - 1; var max_bits = 0; var symbols = new Int32Array(4); var num_symbols = br.readBits(2) + 1; while (max_bits_counter) { max_bits_counter >>= 1; ++max_bits; } for (i2 = 0; i2 < num_symbols; ++i2) { symbols[i2] = br.readBits(max_bits) % alphabet_size; code_lengths[symbols[i2]] = 2; } code_lengths[symbols[0]] = 1; switch (num_symbols) { case 1: break; case 3: if (symbols[0] === symbols[1] || symbols[0] === symbols[2] || symbols[1] === symbols[2]) { throw new Error( "[ReadHuffmanCode] invalid symbols" ); } break; case 2: if (symbols[0] === symbols[1]) { throw new Error( "[ReadHuffmanCode] invalid symbols" ); } code_lengths[symbols[1]] = 1; break; case 4: if (symbols[0] === symbols[1] || symbols[0] === symbols[2] || symbols[0] === symbols[3] || symbols[1] === symbols[2] || symbols[1] === symbols[3] || symbols[2] === symbols[3]) { throw new Error( "[ReadHuffmanCode] invalid symbols" ); } if (br.readBits(1)) { code_lengths[symbols[2]] = 3; code_lengths[symbols[3]] = 3; } else { code_lengths[symbols[0]] = 2; } break; } } else { var i2; var code_length_code_lengths = new Uint8Array( CODE_LENGTH_CODES ); var space = 32; var num_codes = 0; var huff = [ new HuffmanCode(2, 0), new HuffmanCode(2, 4), new HuffmanCode(2, 3), new HuffmanCode(3, 2), new HuffmanCode(2, 0), new HuffmanCode(2, 4), new HuffmanCode(2, 3), new HuffmanCode(4, 1), new HuffmanCode(2, 0), new HuffmanCode(2, 4), new HuffmanCode(2, 3), new HuffmanCode(3, 2), new HuffmanCode(2, 0), new HuffmanCode(2, 4), new HuffmanCode(2, 3), new HuffmanCode(4, 5) ]; for (i2 = simple_code_or_skip; i2 < CODE_LENGTH_CODES && space > 0; ++i2) { var code_len_idx = kCodeLengthCodeOrder[i2]; var p3 = 0; var v2; br.fillBitWindow(); p3 += br.val_ >>> br.bit_pos_ & 15; br.bit_pos_ += huff[p3].bits; v2 = huff[p3].value; code_length_code_lengths[code_len_idx] = v2; if (v2 !== 0) { space -= 32 >> v2; ++num_codes; } } if (!(num_codes === 1 || space === 0)) throw new Error( "[ReadHuffmanCode] invalid num_codes or space" ); ReadHuffmanCodeLengths( code_length_code_lengths, alphabet_size, code_lengths, br ); } table_size = BrotliBuildHuffmanTable( tables, table, HUFFMAN_TABLE_BITS, code_lengths, alphabet_size ); if (table_size === 0) { throw new Error( "[ReadHuffmanCode] BuildHuffmanTable failed: " ); } return table_size; } function ReadBlockLength(table, index, br) { var code; var nbits; code = ReadSymbol(table, index, br); nbits = Prefix.kBlockLengthPrefixCode[code].nbits; return Prefix.kBlockLengthPrefixCode[code].offset + br.readBits(nbits); } function TranslateShortCodes(code, ringbuffer, index) { var val; if (code < NUM_DISTANCE_SHORT_CODES) { index += kDistanceShortCodeIndexOffset[code]; index &= 3; val = ringbuffer[index] + kDistanceShortCodeValueOffset[code]; } else { val = code - NUM_DISTANCE_SHORT_CODES + 1; } return val; } function MoveToFront(v2, index) { var value = v2[index]; var i2 = index; for (; i2; --i2) v2[i2] = v2[i2 - 1]; v2[0] = value; } function InverseMoveToFrontTransform(v2, v_len) { var mtf = new Uint8Array(256); var i2; for (i2 = 0; i2 < 256; ++i2) { mtf[i2] = i2; } for (i2 = 0; i2 < v_len; ++i2) { var index = v2[i2]; v2[i2] = mtf[index]; if (index) MoveToFront(mtf, index); } } function HuffmanTreeGroup(alphabet_size, num_htrees) { this.alphabet_size = alphabet_size; this.num_htrees = num_htrees; this.codes = new Array( num_htrees + num_htrees * kMaxHuffmanTableSize[alphabet_size + 31 >>> 5] ); this.htrees = new Uint32Array(num_htrees); } HuffmanTreeGroup.prototype.decode = function(br) { var i2; var table_size; var next = 0; for (i2 = 0; i2 < this.num_htrees; ++i2) { this.htrees[i2] = next; table_size = ReadHuffmanCode( this.alphabet_size, this.codes, next, br ); next += table_size; } }; function DecodeContextMap(context_map_size, br) { var out = { num_htrees: null, context_map: null }; var use_rle_for_zeros; var max_run_length_prefix = 0; var table; var i2; br.readMoreInput(); var num_htrees = out.num_htrees = DecodeVarLenUint8(br) + 1; var context_map = out.context_map = new Uint8Array( context_map_size ); if (num_htrees <= 1) { return out; } use_rle_for_zeros = br.readBits(1); if (use_rle_for_zeros) { max_run_length_prefix = br.readBits(4) + 1; } table = []; for (i2 = 0; i2 < HUFFMAN_MAX_TABLE_SIZE; i2++) { table[i2] = new HuffmanCode(0, 0); } ReadHuffmanCode( num_htrees + max_run_length_prefix, table, 0, br ); for (i2 = 0; i2 < context_map_size; ) { var code; br.readMoreInput(); code = ReadSymbol(table, 0, br); if (code === 0) { context_map[i2] = 0; ++i2; } else if (code <= max_run_length_prefix) { var reps = 1 + (1 << code) + br.readBits(code); while (--reps) { if (i2 >= context_map_size) { throw new Error( "[DecodeContextMap] i >= context_map_size" ); } context_map[i2] = 0; ++i2; } } else { context_map[i2] = code - max_run_length_prefix; ++i2; } } if (br.readBits(1)) { InverseMoveToFrontTransform( context_map, context_map_size ); } return out; } function DecodeBlockType(max_block_type, trees, tree_type, block_types, ringbuffers, indexes, br) { var ringbuffer = tree_type * 2; var index = tree_type; var type_code = ReadSymbol( trees, tree_type * HUFFMAN_MAX_TABLE_SIZE, br ); var block_type; if (type_code === 0) { block_type = ringbuffers[ringbuffer + (indexes[index] & 1)]; } else if (type_code === 1) { block_type = ringbuffers[ringbuffer + (indexes[index] - 1 & 1)] + 1; } else { block_type = type_code - 2; } if (block_type >= max_block_type) { block_type -= max_block_type; } block_types[tree_type] = block_type; ringbuffers[ringbuffer + (indexes[index] & 1)] = block_type; ++indexes[index]; } function CopyUncompressedBlockToOutput(output, len, pos, ringbuffer, ringbuffer_mask, br) { var rb_size = ringbuffer_mask + 1; var rb_pos = pos & ringbuffer_mask; var br_pos = br.pos_ & BrotliBitReader.IBUF_MASK; var nbytes; if (len < 8 || br.bit_pos_ + (len << 3) < br.bit_end_pos_) { while (len-- > 0) { br.readMoreInput(); ringbuffer[rb_pos++] = br.readBits(8); if (rb_pos === rb_size) { output.write(ringbuffer, rb_size); rb_pos = 0; } } return; } if (br.bit_end_pos_ < 32) { throw new Error( "[CopyUncompressedBlockToOutput] br.bit_end_pos_ < 32" ); } while (br.bit_pos_ < 32) { ringbuffer[rb_pos] = br.val_ >>> br.bit_pos_; br.bit_pos_ += 8; ++rb_pos; --len; } nbytes = br.bit_end_pos_ - br.bit_pos_ >> 3; if (br_pos + nbytes > BrotliBitReader.IBUF_MASK) { var tail = BrotliBitReader.IBUF_MASK + 1 - br_pos; for (var x2 = 0; x2 < tail; x2++) ringbuffer[rb_pos + x2] = br.buf_[br_pos + x2]; nbytes -= tail; rb_pos += tail; len -= tail; br_pos = 0; } for (var x2 = 0; x2 < nbytes; x2++) ringbuffer[rb_pos + x2] = br.buf_[br_pos + x2]; rb_pos += nbytes; len -= nbytes; if (rb_pos >= rb_size) { output.write(ringbuffer, rb_size); rb_pos -= rb_size; for (var x2 = 0; x2 < rb_pos; x2++) ringbuffer[x2] = ringbuffer[rb_size + x2]; } while (rb_pos + len >= rb_size) { nbytes = rb_size - rb_pos; if (br.input_.read(ringbuffer, rb_pos, nbytes) < nbytes) { throw new Error( "[CopyUncompressedBlockToOutput] not enough bytes" ); } output.write(ringbuffer, rb_size); len -= nbytes; rb_pos = 0; } if (br.input_.read(ringbuffer, rb_pos, len) < len) { throw new Error( "[CopyUncompressedBlockToOutput] not enough bytes" ); } br.reset(); } function JumpToByteBoundary(br) { var new_bit_pos = br.bit_pos_ + 7 & ~7; var pad_bits = br.readBits(new_bit_pos - br.bit_pos_); return pad_bits == 0; } function BrotliDecompressedSize(buffer) { var input = new BrotliInput(buffer); var br = new BrotliBitReader(input); DecodeWindowBits(br); var out = DecodeMetaBlockLength(br); return out.meta_block_length; } exports2.BrotliDecompressedSize = BrotliDecompressedSize; function BrotliDecompressBuffer(buffer, output_size) { var input = new BrotliInput(buffer); if (output_size == null) { output_size = BrotliDecompressedSize(buffer); } var output_buffer = new Uint8Array(output_size); var output = new BrotliOutput(output_buffer); BrotliDecompress(input, output); if (output.pos < output.buffer.length) { output.buffer = output.buffer.subarray( 0, output.pos ); } return output.buffer; } exports2.BrotliDecompressBuffer = BrotliDecompressBuffer; function BrotliDecompress(input, output) { var i2; var pos = 0; var input_end = 0; var window_bits = 0; var max_backward_distance; var max_distance = 0; var ringbuffer_size; var ringbuffer_mask; var ringbuffer; var ringbuffer_end; var dist_rb = [16, 15, 11, 4]; var dist_rb_idx = 0; var prev_byte1 = 0; var prev_byte2 = 0; var hgroup = [ new HuffmanTreeGroup(0, 0), new HuffmanTreeGroup(0, 0), new HuffmanTreeGroup(0, 0) ]; var block_type_trees; var block_len_trees; var br; var kRingBufferWriteAheadSlack = 128 + BrotliBitReader.READ_SIZE; br = new BrotliBitReader(input); window_bits = DecodeWindowBits(br); max_backward_distance = (1 << window_bits) - 16; ringbuffer_size = 1 << window_bits; ringbuffer_mask = ringbuffer_size - 1; ringbuffer = new Uint8Array( ringbuffer_size + kRingBufferWriteAheadSlack + BrotliDictionary.maxDictionaryWordLength ); ringbuffer_end = ringbuffer_size; block_type_trees = []; block_len_trees = []; for (var x2 = 0; x2 < 3 * HUFFMAN_MAX_TABLE_SIZE; x2++) { block_type_trees[x2] = new HuffmanCode(0, 0); block_len_trees[x2] = new HuffmanCode(0, 0); } while (!input_end) { var meta_block_remaining_len = 0; var is_uncompressed; var block_length = [1 << 28, 1 << 28, 1 << 28]; var block_type = [0]; var num_block_types = [1, 1, 1]; var block_type_rb = [0, 1, 0, 1, 0, 1]; var block_type_rb_index = [0]; var distance_postfix_bits; var num_direct_distance_codes; var distance_postfix_mask; var num_distance_codes; var context_map = null; var context_modes = null; var num_literal_htrees; var dist_context_map = null; var num_dist_htrees; var context_offset = 0; var context_map_slice = null; var literal_htree_index = 0; var dist_context_offset = 0; var dist_context_map_slice = null; var dist_htree_index = 0; var context_lookup_offset1 = 0; var context_lookup_offset2 = 0; var context_mode; var htree_command; for (i2 = 0; i2 < 3; ++i2) { hgroup[i2].codes = null; hgroup[i2].htrees = null; } br.readMoreInput(); var _out = DecodeMetaBlockLength(br); meta_block_remaining_len = _out.meta_block_length; if (pos + meta_block_remaining_len > output.buffer.length) { var tmp = new Uint8Array( pos + meta_block_remaining_len ); tmp.set(output.buffer); output.buffer = tmp; } input_end = _out.input_end; is_uncompressed = _out.is_uncompressed; if (_out.is_metadata) { JumpToByteBoundary(br); for (; meta_block_remaining_len > 0; --meta_block_remaining_len) { br.readMoreInput(); br.readBits(8); } continue; } if (meta_block_remaining_len === 0) { continue; } if (is_uncompressed) { br.bit_pos_ = br.bit_pos_ + 7 & ~7; CopyUncompressedBlockToOutput( output, meta_block_remaining_len, pos, ringbuffer, ringbuffer_mask, br ); pos += meta_block_remaining_len; continue; } for (i2 = 0; i2 < 3; ++i2) { num_block_types[i2] = DecodeVarLenUint8(br) + 1; if (num_block_types[i2] >= 2) { ReadHuffmanCode( num_block_types[i2] + 2, block_type_trees, i2 * HUFFMAN_MAX_TABLE_SIZE, br ); ReadHuffmanCode( kNumBlockLengthCodes, block_len_trees, i2 * HUFFMAN_MAX_TABLE_SIZE, br ); block_length[i2] = ReadBlockLength( block_len_trees, i2 * HUFFMAN_MAX_TABLE_SIZE, br ); block_type_rb_index[i2] = 1; } } br.readMoreInput(); distance_postfix_bits = br.readBits(2); num_direct_distance_codes = NUM_DISTANCE_SHORT_CODES + (br.readBits(4) << distance_postfix_bits); distance_postfix_mask = (1 << distance_postfix_bits) - 1; num_distance_codes = num_direct_distance_codes + (48 << distance_postfix_bits); context_modes = new Uint8Array( num_block_types[0] ); for (i2 = 0; i2 < num_block_types[0]; ++i2) { br.readMoreInput(); context_modes[i2] = br.readBits(2) << 1; } var _o1 = DecodeContextMap( num_block_types[0] << kLiteralContextBits, br ); num_literal_htrees = _o1.num_htrees; context_map = _o1.context_map; var _o2 = DecodeContextMap( num_block_types[2] << kDistanceContextBits, br ); num_dist_htrees = _o2.num_htrees; dist_context_map = _o2.context_map; hgroup[0] = new HuffmanTreeGroup( kNumLiteralCodes, num_literal_htrees ); hgroup[1] = new HuffmanTreeGroup( kNumInsertAndCopyCodes, num_block_types[1] ); hgroup[2] = new HuffmanTreeGroup( num_distance_codes, num_dist_htrees ); for (i2 = 0; i2 < 3; ++i2) { hgroup[i2].decode(br); } context_map_slice = 0; dist_context_map_slice = 0; context_mode = context_modes[block_type[0]]; context_lookup_offset1 = Context.lookupOffsets[context_mode]; context_lookup_offset2 = Context.lookupOffsets[context_mode + 1]; htree_command = hgroup[1].htrees[0]; while (meta_block_remaining_len > 0) { var cmd_code; var range_idx; var insert_code; var copy_code; var insert_length; var copy_length; var distance_code; var distance; var context; var j2; var copy_dst; br.readMoreInput(); if (block_length[1] === 0) { DecodeBlockType( num_block_types[1], block_type_trees, 1, block_type, block_type_rb, block_type_rb_index, br ); block_length[1] = ReadBlockLength( block_len_trees, HUFFMAN_MAX_TABLE_SIZE, br ); htree_command = hgroup[1].htrees[block_type[1]]; } --block_length[1]; cmd_code = ReadSymbol( hgroup[1].codes, htree_command, br ); range_idx = cmd_code >> 6; if (range_idx >= 2) { range_idx -= 2; distance_code = -1; } else { distance_code = 0; } insert_code = Prefix.kInsertRangeLut[range_idx] + (cmd_code >> 3 & 7); copy_code = Prefix.kCopyRangeLut[range_idx] + (cmd_code & 7); insert_length = Prefix.kInsertLengthPrefixCode[insert_code].offset + br.readBits( Prefix.kInsertLengthPrefixCode[insert_code].nbits ); copy_length = Prefix.kCopyLengthPrefixCode[copy_code].offset + br.readBits( Prefix.kCopyLengthPrefixCode[copy_code].nbits ); prev_byte1 = ringbuffer[pos - 1 & ringbuffer_mask]; prev_byte2 = ringbuffer[pos - 2 & ringbuffer_mask]; for (j2 = 0; j2 < insert_length; ++j2) { br.readMoreInput(); if (block_length[0] === 0) { DecodeBlockType( num_block_types[0], block_type_trees, 0, block_type, block_type_rb, block_type_rb_index, br ); block_length[0] = ReadBlockLength( block_len_trees, 0, br ); context_offset = block_type[0] << kLiteralContextBits; context_map_slice = context_offset; context_mode = context_modes[block_type[0]]; context_lookup_offset1 = Context.lookupOffsets[context_mode]; context_lookup_offset2 = Context.lookupOffsets[context_mode + 1]; } context = Context.lookup[context_lookup_offset1 + prev_byte1] | Context.lookup[context_lookup_offset2 + prev_byte2]; literal_htree_index = context_map[context_map_slice + context]; --block_length[0]; prev_byte2 = prev_byte1; prev_byte1 = ReadSymbol( hgroup[0].codes, hgroup[0].htrees[literal_htree_index], br ); ringbuffer[pos & ringbuffer_mask] = prev_byte1; if ((pos & ringbuffer_mask) === ringbuffer_mask) { output.write( ringbuffer, ringbuffer_size ); } ++pos; } meta_block_remaining_len -= insert_length; if (meta_block_remaining_len <= 0) break; if (distance_code < 0) { var context; br.readMoreInput(); if (block_length[2] === 0) { DecodeBlockType( num_block_types[2], block_type_trees, 2, block_type, block_type_rb, block_type_rb_index, br ); block_length[2] = ReadBlockLength( block_len_trees, 2 * HUFFMAN_MAX_TABLE_SIZE, br ); dist_context_offset = block_type[2] << kDistanceContextBits; dist_context_map_slice = dist_context_offset; } --block_length[2]; context = (copy_length > 4 ? 3 : copy_length - 2) & 255; dist_htree_index = dist_context_map[dist_context_map_slice + context]; distance_code = ReadSymbol( hgroup[2].codes, hgroup[2].htrees[dist_htree_index], br ); if (distance_code >= num_direct_distance_codes) { var nbits; var postfix; var offset; distance_code -= num_direct_distance_codes; postfix = distance_code & distance_postfix_mask; distance_code >>= distance_postfix_bits; nbits = (distance_code >> 1) + 1; offset = (2 + (distance_code & 1) << nbits) - 4; distance_code = num_direct_distance_codes + (offset + br.readBits(nbits) << distance_postfix_bits) + postfix; } } distance = TranslateShortCodes( distance_code, dist_rb, dist_rb_idx ); if (distance < 0) { throw new Error( "[BrotliDecompress] invalid distance" ); } if (pos < max_backward_distance && max_distance !== max_backward_distance) { max_distance = pos; } else { max_distance = max_backward_distance; } copy_dst = pos & ringbuffer_mask; if (distance > max_distance) { if (copy_length >= BrotliDictionary.minDictionaryWordLength && copy_length <= BrotliDictionary.maxDictionaryWordLength) { var offset = BrotliDictionary.offsetsByLength[copy_length]; var word_id = distance - max_distance - 1; var shift = BrotliDictionary.sizeBitsByLength[copy_length]; var mask = (1 << shift) - 1; var word_idx = word_id & mask; var transform_idx = word_id >> shift; offset += word_idx * copy_length; if (transform_idx < Transform.kNumTransforms) { var len = Transform.transformDictionaryWord( ringbuffer, copy_dst, offset, copy_length, transform_idx ); copy_dst += len; pos += len; meta_block_remaining_len -= len; if (copy_dst >= ringbuffer_end) { output.write( ringbuffer, ringbuffer_size ); for (var _x24 = 0; _x24 < copy_dst - ringbuffer_end; _x24++) ringbuffer[_x24] = ringbuffer[ringbuffer_end + _x24]; } } else { throw new Error( "Invalid backward reference. pos: " + pos + " distance: " + distance + " len: " + copy_length + " bytes left: " + meta_block_remaining_len ); } } else { throw new Error( "Invalid backward reference. pos: " + pos + " distance: " + distance + " len: " + copy_length + " bytes left: " + meta_block_remaining_len ); } } else { if (distance_code > 0) { dist_rb[dist_rb_idx & 3] = distance; ++dist_rb_idx; } if (copy_length > meta_block_remaining_len) { throw new Error( "Invalid backward reference. pos: " + pos + " distance: " + distance + " len: " + copy_length + " bytes left: " + meta_block_remaining_len ); } for (j2 = 0; j2 < copy_length; ++j2) { ringbuffer[pos & ringbuffer_mask] = ringbuffer[pos - distance & ringbuffer_mask]; if ((pos & ringbuffer_mask) === ringbuffer_mask) { output.write( ringbuffer, ringbuffer_size ); } ++pos; --meta_block_remaining_len; } } prev_byte1 = ringbuffer[pos - 1 & ringbuffer_mask]; prev_byte2 = ringbuffer[pos - 2 & ringbuffer_mask]; } pos &= 1073741823; } output.write(ringbuffer, pos & ringbuffer_mask); } exports2.BrotliDecompress = BrotliDecompress; BrotliDictionary.init(); }, { "./bit_reader": 1, "./context": 2, "./dictionary": 6, "./huffman": 7, "./prefix": 9, "./streams": 10, "./transform": 11 } ], 4: [ function(require2, module2, exports2) { var base64 = require2("base64-js"); exports2.init = function() { var BrotliDecompressBuffer = require2("./decode").BrotliDecompressBuffer; var compressed = base64.toByteArray( require2("./dictionary.bin.js") ); return BrotliDecompressBuffer(compressed); }; }, { "./decode": 3, "./dictionary.bin.js": 5, "base64-js": 8 } ], 5: [ function(require2, module2, exports2) { module2.exports = "W5/fcQLn5gKf2XUbAiQ1XULX+TZz6ADToDsgqk6qVfeC0e4m6OO2wcQ1J76ZBVRV1fRkEsdu//62zQsFEZWSTCnMhcsQKlS2qOhuVYYMGCkV0fXWEoMFbESXrKEZ9wdUEsyw9g4bJlEt1Y6oVMxMRTEVbCIwZzJzboK5j8m4YH02qgXYhv1V+PM435sLVxyHJihaJREEhZGqL03txGFQLm76caGO/ovxKvzCby/3vMTtX/459f0igi7WutnKiMQ6wODSoRh/8Lx1V3Q99MvKtwB6bHdERYRY0hStJoMjNeTsNX7bn+Y7e4EQ3bf8xBc7L0BsyfFPK43dGSXpL6clYC/I328h54/VYrQ5i0648FgbGtl837svJ35L3Mot/+nPlNpWgKx1gGXQYqX6n+bbZ7wuyCHKcUok12Xjqub7NXZGzqBx0SD+uziNf87t7ve42jxSKQoW3nyxVrWIGlFShhCKxjpZZ5MeGna0+lBkk+kaN8F9qFBAFgEogyMBdcX/T1W/WnMOi/7ycWUQloEBKGeC48MkiwqJkJO+12eQiOFHMmck6q/IjWW3RZlany23TBm+cNr/84/oi5GGmGBZWrZ6j+zykVozz5fT/QH/Da6WTbZYYPynVNO7kxzuNN2kxKKWche5WveitPKAecB8YcAHz/+zXLjcLzkdDSktNIDwZE9J9X+tto43oJy65wApM3mDzYtCwX9lM+N5VR3kXYo0Z3t0TtXfgBFg7gU8oN0Dgl7fZlUbhNll+0uuohRVKjrEd8egrSndy5/Tgd2gqjA4CAVuC7ESUmL3DZoGnfhQV8uwnpi8EGvAVVsowNRxPudck7+oqAUDkwZopWqFnW1riss0t1z6iCISVKreYGNvQcXv+1L9+jbP8cd/dPUiqBso2q+7ZyFBvENCkkVr44iyPbtOoOoCecWsiuqMSML5lv+vN5MzUr+Dnh73G7Q1YnRYJVYXHRJaNAOByiaK6CusgFdBPE40r0rvqXV7tksKO2DrHYXBTv8P5ysqxEx8VDXUDDqkPH6NNOV/a2WH8zlkXRELSa8P+heNyJBBP7PgsG1EtWtNef6/i+lcayzQwQCsduidpbKfhWUDgAEmyhGu/zVTacI6RS0zTABrOYueemnVa19u9fT23N/Ta6RvTpof5DWygqreCqrDAgM4LID1+1T/taU6yTFVLqXOv+/MuQOFnaF8vLMKD7tKWDoBdALgxF33zQccCcdHx8fKIVdW69O7qHtXpeGr9jbbpFA+qRMWr5hp0s67FPc7HAiLV0g0/peZlW7hJPYEhZyhpSwahnf93/tZgfqZWXFdmdXBzqxGHLrQKxoAY6fRoBhgCRPmmGueYZ5JexTVDKUIXzkG/fqp/0U3hAgQdJ9zumutK6nqWbaqvm1pgu03IYR+G+8s0jDBBz8cApZFSBeuWasyqo2OMDKAZCozS+GWSvL/HsE9rHxooe17U3s/lTE+VZAk4j3dp6uIGaC0JMiqR5CUsabPyM0dOYDR7Ea7ip4USZlya38YfPtvrX/tBlhHilj55nZ1nfN24AOAi9BVtz/Mbn8AEDJCqJgsVUa6nQnSxv2Fs7l/NlCzpfYEjmPrNyib/+t0ei2eEMjvNhLkHCZlci4WhBe7ePZTmzYqlY9+1pxtS4GB+5lM1BHT9tS270EWUDYFq1I0yY/fNiAk4bk9yBgmef/f2k6AlYQZHsNFnW8wBQxCd68iWv7/35bXfz3JZmfGligWAKRjIs3IpzxQ27vAglHSiOzCYzJ9L9A1CdiyFvyR66ucA4jKifu5ehwER26yV7HjKqn5Mfozo7Coxxt8LWWPT47BeMxX8p0Pjb7hZn+6bw7z3Lw+7653j5sI8CLu5kThpMlj1m4c2ch3jGcP1FsT13vuK3qjecKTZk2kHcOZY40UX+qdaxstZqsqQqgXz+QGF99ZJLqr3VYu4aecl1Ab5GmqS8k/GV5b95zxQ5d4EfXUJ6kTS/CXF/aiqKDOT1T7Jz5z0PwDUcwr9clLN1OJGCiKfqvah+h3XzrBOiLOW8wvn8gW6qE8vPxi+Efv+UH55T7PQFVMh6cZ1pZQlzJpKZ7P7uWvwPGJ6DTlR6wbyj3Iv2HyefnRo/dv7dNx+qaa0N38iBsR++Uil7Wd4afwDNsrzDAK4fXZwvEY/jdKuIKXlfrQd2C39dW7ntnRbIp9OtGy9pPBn/V2ASoi/2UJZfS+xuGLH8bnLuPlzdTNS6zdyk8Dt/h6sfOW5myxh1f+zf3zZ3MX/mO9cQPp5pOx967ZA6/pqHvclNfnUFF+rq+Vd7alKr6KWPcIDhpn6v2K6NlUu6LrKo8b/pYpU/Gazfvtwhn7tEOUuXht5rUJdSf6sLjYf0VTYDgwJ81yaqKTUYej/tbHckSRb/HZicwGJqh1mAHB/IuNs9dc9yuvF3D5Xocm3elWFdq5oEy70dYFit79yaLiNjPj5UUcVmZUVhQEhW5V2Z6Cm4HVH/R8qlamRYwBileuh07CbEce3TXa2JmXWBf+ozt319psboobeZhVnwhMZzOeQJzhpTDbP71Tv8HuZxxUI/+ma3XW6DFDDs4+qmpERwHGBd2edxwUKlODRdUWZ/g0GOezrbzOZauFMai4QU6GVHV6aPNBiBndHSsV4IzpvUiiYyg6OyyrL4Dj5q/Lw3N5kAwftEVl9rNd7Jk5PDij2hTH6wIXnsyXkKePxbmHYgC8A6an5Fob/KH5GtC0l4eFso+VpxedtJHdHpNm+Bvy4C79yVOkrZsLrQ3OHCeB0Ra+kBIRldUGlDCEmq2RwXnfyh6Dz+alk6eftI2n6sastRrGwbwszBeDRS/Fa/KwRJkCzTsLr/JCs5hOPE/MPLYdZ1F1fv7D+VmysX6NpOC8aU9F4Qs6HvDyUy9PvFGDKZ/P5101TYHFl8pjj6wm/qyS75etZhhfg0UEL4OYmHk6m6dO192AzoIyPSV9QedDA4Ml23rRbqxMPMxf7FJnDc5FTElVS/PyqgePzmwVZ26NWhRDQ+oaT7ly7ell4s3DypS1s0g+tOr7XHrrkZj9+x/mJBttrLx98lFIaRZzHz4aC7r52/JQ4VjHahY2/YVXZn/QC2ztQb/sY3uRlyc5vQS8nLPGT/n27495i8HPA152z7Fh5aFpyn1GPJKHuPL8Iw94DuW3KjkURAWZXn4EQy89xiKEHN1mk/tkM4gYDBxwNoYvRfE6LFqsxWJtPrDGbsnLMap3Ka3MUoytW0cvieozOmdERmhcqzG+3HmZv2yZeiIeQTKGdRT4HHNxekm1tY+/n06rGmFleqLscSERzctTKM6G9P0Pc1RmVvrascIxaO1CQCiYPE15bD7c3xSeW7gXxYjgxcrUlcbIvO0r+Yplhx0kTt3qafDOmFyMjgGxXu73rddMHpV1wMubyAGcf/v5dLr5P72Ta9lBF+fzMJrMycwv+9vnU3ANIl1cH9tfW7af8u0/HG0vV47jNFXzFTtaha1xvze/s8KMtCYucXc1nzfd/MQydUXn/b72RBt5wO/3jRcMH9BdhC/yctKBIveRYPrNpDWqBsO8VMmP+WvRaOcA4zRMR1PvSoO92rS7pYEv+fZfEfTMzEdM+6X5tLlyxExhqLRkms5EuLovLfx66de5fL2/yX02H52FPVwahrPqmN/E0oVXnsCKhbi/yRxX83nRbUKWhzYceXOntfuXn51NszJ6MO73pQf5Pl4in3ec4JU8hF7ppV34+mm9r1LY0ee/i1O1wpd8+zfLztE0cqBxggiBi5Bu95v9l3r9r/U5hweLn+TbfxowrWDqdJauKd8+q/dH8sbPkc9ttuyO94f7/XK/nHX46MPFLEb5qQlNPvhJ50/59t9ft3LXu7uVaWaO2bDrDCnRSzZyWvFKxO1+vT8MwwunR3bX0CkfPjqb4K9O19tn5X50PvmYpEwHtiW9WtzuV/s76B1zvLLNkViNd8ySxIl/3orfqP90TyTGaf7/rx8jQzeHJXdmh/N6YDvbvmTBwCdxfEQ1NcL6wNMdSIXNq7b1EUzRy1/Axsyk5p22GMG1b+GxFgbHErZh92wuvco0AuOLXct9hvw2nw/LqIcDRRmJmmZzcgUa7JpM/WV/S9IUfbF56TL2orzqwebdRD8nIYNJ41D/hz37Fo11p2Y21wzPcn713qVGhqtevStYfGH4n69OEJtPvbbLYWvscDqc3Hgnu166+tAyLnxrX0Y5zoYjV++1sI7t5kMr02KT/+uwtkc+rZLOf/qn/s3nYCf13Dg8/sB2diJgjGqjQ+TLhxbzyue2Ob7X6/9lUwW7a+lbznHzOYy8LKW1C/uRPbQY3KW/0gO9LXunHLvPL97afba9bFtc9hmz7GAttjVYlCvQAiOwAk/gC5+hkLEs6tr3AZKxLJtOEwk2dLxTYWsIB/j/ToWtIWzo906FrSG8iaqqqqqqiIiIiAgzMzMzNz+AyK+01/zi8n8S+Y1MjoRaQ80WU/G8MBlO+53VPXANrWm4wzGUVZUjjBJZVdhpcfkjsmcWaO+UEldXi1e+zq+HOsCpknYshuh8pOLISJun7TN0EIGW2xTnlOImeecnoGW4raxe2G1T3HEvfYUYMhG+gAFOAwh5nK8mZhwJMmN7r224QVsNFvZ87Z0qatvknklyPDK3Hy45PgVKXji52Wen4d4PlFVVYGnNap+fSpFbK90rYnhUc6n91Q3AY9E0tJOFrcfZtm/491XbcG/jsViUPPX76qmeuiz+qY1Hk7/1VPM405zWVuoheLUimpWYdVzCmUdKHebMdzgrYrb8mL2eeLSnRWHdonfZa8RsOU9F37w+591l5FLYHiOqWeHtE/lWrBHcRKp3uhtr8yXm8LU/5ms+NM6ZKsqu90cFZ4o58+k4rdrtB97NADFbwmEG7lXqvirhOTOqU14xuUF2myIjURcPHrPOQ4lmM3PeMg7bUuk0nnZi67bXsU6H8lhqIo8TaOrEafCO1ARK9PjC0QOoq2BxmMdgYB9G/lIb9++fqNJ2s7BHGFyBNmZAR8J3KCo012ikaSP8BCrf6VI0X5xdnbhHIO+B5rbOyB54zXkzfObyJ4ecwxfqBJMLFc7m59rNcw7hoHnFZ0b00zee+gTqvjm61Pb4xn0kcDX4jvHM0rBXZypG3DCKnD/Waa/ZtHmtFPgO5eETx+k7RrVg3aSwm2YoNXnCs3XPQDhNn+Fia6IlOOuIG6VJH7TP6ava26ehKHQa2T4N0tcZ9dPCGo3ZdnNltsHQbeYt5vPnJezV/cAeNypdml1vCHI8M81nSRP5Qi2+mI8v/sxiZru9187nRtp3f/42NemcONa+4eVC3PCZzc88aZh851CqSsshe70uPxeN/dmYwlwb3trwMrN1Gq8jbnApcVDx/yDPeYs5/7r62tsQ6lLg+DiFXTEhzR9dHqv0iT4tgj825W+H3XiRUNUZT2kR9Ri0+lp+UM3iQtS8uOE23Ly4KYtvqH13jghUntJRAewuzNLDXp8RxdcaA3cMY6TO2IeSFRXezeWIjCqyhsUdMYuCgYTZSKpBype1zRfq8FshvfBPc6BAQWl7/QxIDp3VGo1J3vn42OEs3qznws+YLRXbymyB19a9XBx6n/owcyxlEYyFWCi+kG9F+EyD/4yn80+agaZ9P7ay2Dny99aK2o91FkfEOY8hBwyfi5uwx2y5SaHmG+oq/zl1FX/8irOf8Y3vAcX/6uLP6A6nvMO24edSGPjQc827Rw2atX+z2bKq0CmW9mOtYnr5/AfDa1ZfPaXnKtlWborup7QYx+Or2uWb+N3N//2+yDcXMqIJdf55xl7/vsj4WoPPlxLxtVrkJ4w/tTe3mLdATOOYwxcq52w5Wxz5MbPdVs5O8/lhfE7dPj0bIiPQ3QV0iqm4m3YX8hRfc6jQ3fWepevMqUDJd86Z4vwM40CWHnn+WphsGHfieF02D3tmZvpWD+kBpNCFcLnZhcmmrhpGzzbdA+sQ1ar18OJD87IOKOFoRNznaHPNHUfUNhvY1iU+uhvEvpKHaUn3qK3exVVyX4joipp3um7FmYJWmA+WbIDshRpbVRx5/nqstCgy87FGbfVB8yDGCqS+2qCsnRwnSAN6zgzxfdB2nBT/vZ4/6uxb6oH8b4VBRxiIB93wLa47hG3w2SL/2Z27yOXJFwZpSJaBYyvajA7vRRYNKqljXKpt/CFD/tSMr18DKKbwB0xggBePatl1nki0yvqW5zchlyZmJ0OTxJ3D+fsYJs/mxYN5+Le5oagtcl+YsVvy8kSjI2YGvGjvmpkRS9W2dtXqWnVuxUhURm1lKtou/hdEq19VBp9OjGvHEQSmrpuf2R24mXGheil8KeiANY8fW1VERUfBImb64j12caBZmRViZHbeVMjCrPDg9A90IXrtnsYCuZtRQ0PyrKDjBNOsPfKsg1pA02gHlVr0OXiFhtp6nJqXVzcbfM0KnzC3ggOENPE9VBdmHKN6LYaijb4wXxJn5A0FSDF5j+h1ooZx885Jt3ZKzO5n7Z5WfNEOtyyPqQEnn7WLv5Fis3PdgMshjF1FRydbNyeBbyKI1oN1TRVrVK7kgsb/zjX4NDPIRMctVeaxVB38Vh1x5KbeJbU138AM5KzmZu3uny0ErygxiJF7GVXUrPzFxrlx1uFdAaZFDN9cvIb74qD9tzBMo7L7WIEYK+sla1DVMHpF0F7b3+Y6S+zjvLeDMCpapmJo1weBWuxKF3rOocih1gun4BoJh1kWnV/Jmiq6uOhK3VfKxEHEkafjLgK3oujaPzY6SXg8phhL4TNR1xvJd1Wa0aYFfPUMLrNBDCh4AuGRTbtKMc6Z1Udj8evY/ZpCuMAUefdo69DZUngoqE1P9A3PJfOf7WixCEj+Y6t7fYeHbbxUAoFV3M89cCKfma3fc1+jKRe7MFWEbQqEfyzO2x/wrO2VYH7iYdQ9BkPyI8/3kXBpLaCpU7eC0Yv/am/tEDu7HZpqg0EvHo0nf/R/gRzUWy33/HXMJQeu1GylKmOkXzlCfGFruAcPPhaGqZOtu19zsJ1SO2Jz4Ztth5cBX6mRQwWmDwryG9FUMlZzNckMdK+IoMJv1rOWnBamS2w2KHiaPMPLC15hCZm4KTpoZyj4E2TqC/P6r7/EhnDMhKicZZ1ZwxuC7DPzDGs53q8gXaI9kFTK+2LTq7bhwsTbrMV8Rsfua5lMS0FwbTitUVnVa1yTb5IX51mmYnUcP9wPr8Ji1tiYJeJV9GZTrQhF7vvdU2OTU42ogJ9FDwhmycI2LIg++03C6scYhUyUuMV5tkw6kGUoL+mjNC38+wMdWNljn6tGPpRES7veqrSn5TRuv+dh6JVL/iDHU1db4c9WK3++OrH3PqziF916UMUKn8G67nN60GfWiHrXYhUG3yVWmyYak59NHj8t1smG4UDiWz2rPHNrKnN4Zo1LBbr2/eF9YZ0n0blx2nG4X+EKFxvS3W28JESD+FWk61VCD3z/URGHiJl++7TdBwkCj6tGOH3qDb0QqcOF9Kzpj0HUb/KyFW3Yhj2VMKJqGZleFBH7vqvf7WqLC3XMuHV8q8a4sTFuxUtkD/6JIBvKaVjv96ndgruKZ1k/BHzqf2K9fLk7HGXANyLDd1vxkK/i055pnzl+zw6zLnwXlVYVtfmacJgEpRP1hbGgrYPVN6v2lG+idQNGmwcKXu/8xEj/P6qe/sB2WmwNp6pp8jaISMkwdleFXYK55NHWLTTbutSUqjBfDGWo/Yg918qQ+8BRZSAHZbfuNZz2O0sov1Ue4CWlVg3rFhM3Kljj9ksGd/NUhk4nH+a5UN2+1i8+NM3vRNp7uQ6sqexSCukEVlVZriHNqFi5rLm9TMWa4qm3idJqppQACol2l4VSuvWLfta4JcXy3bROPNbXOgdOhG47LC0CwW/dMlSx4Jf17aEU3yA1x9p+Yc0jupXgcMuYNku64iYOkGToVDuJvlbEKlJqsmiHbvNrIVZEH+yFdF8DbleZ6iNiWwMqvtMp/mSpwx5KxRrT9p3MAPTHGtMbfvdFhyj9vhaKcn3At8Lc16Ai+vBcSp1ztXi7rCJZx/ql7TXcclq6Q76UeKWDy9boS0WHIjUuWhPG8LBmW5y2rhuTpM5vsLt+HOLh1Yf0DqXa9tsfC+kaKt2htA0ai/L2i7RKoNjEwztkmRU0GfgW1TxUvPFhg0V7DdfWJk5gfrccpYv+MA9M0dkGTLECeYwUixRzjRFdmjG7zdZIl3XKB9YliNKI31lfa7i2JG5C8Ss+rHe0D7Z696/V3DEAOWHnQ9yNahMUl5kENWS6pHKKp2D1BaSrrHdE1w2qNxIztpXgUIrF0bm15YML4b6V1k+GpNysTahKMVrrS85lTVo9OGJ96I47eAy5rYWpRf/mIzeoYU1DKaQCTUVwrhHeyNoDqHel+lLxr9WKzhSYw7vrR6+V5q0pfi2k3L1zqkubY6rrd9ZLvSuWNf0uqnkY+FpTvFzSW9Fp0b9l8JA7THV9eCi/PY/SCZIUYx3BU2alj7Cm3VV6eYpios4b6WuNOJdYXUK3zTqj5CVG2FqYM4Z7CuIU0qO05XR0d71FHM0YhZmJmTRfLlXEumN82BGtzdX0S19t1e+bUieK8zRmqpa4Qc5TSjifmaQsY2ETLjhI36gMR1+7qpjdXXHiceUekfBaucHShAOiFXmv3sNmGQyU5iVgnoocuonQXEPTFwslHtS8R+A47StI9wj0iSrtbi5rMysczFiImsQ+bdFClnFjjpXXwMy6O7qfjOr8Fb0a7ODItisjnn3EQO16+ypd1cwyaAW5Yzxz5QknfMO7643fXW/I9y3U2xH27Oapqr56Z/tEzglj6IbT6HEHjopiXqeRbe5mQQvxtcbDOVverN0ZgMdzqRYRjaXtMRd56Q4cZSmdPvZJdSrhJ1D9zNXPqAEqPIavPdfubt5oke2kmv0dztIszSv2VYuoyf1UuopbsYb+uX9h6WpwjpgtZ6fNNawNJ4q8O3CFoSbioAaOSZMx2GYaPYB+rEb6qjQiNRFQ76TvwNFVKD+BhH9VhcKGsXzmMI7BptU/CNWolM7YzROvpFAntsiWJp6eR2d3GarcYShVYSUqhmYOWj5E96NK2WvmYNTeY7Zs4RUEdv9h9QT4EseKt6LzLrqEOs3hxAY1MaNWpSa6zZx8F3YOVeCYMS88W+CYHDuWe4yoc6YK+djDuEOrBR5lvh0r+Q9uM88lrjx9x9AtgpQVNE8r+3O6Gvw59D+kBF/UMXyhliYUtPjmvXGY6Dk3x+kEOW+GtdMVC4EZTqoS/jmR0P0LS75DOc/w2vnri97M4SdbZ8qeU7gg8DVbERkU5geaMQO3mYrSYyAngeUQqrN0C0/vsFmcgWNXNeidsTAj7/4MncJR0caaBUpbLK1yBCBNRjEv6KvuVSdpPnEMJdsRRtqJ+U8tN1gXA4ePHc6ZT0eviI73UOJF0fEZ8YaneAQqQdGphNvwM4nIqPnXxV0xA0fnCT+oAhJuyw/q8jO0y8CjSteZExwBpIN6SvNp6A5G/abi6egeND/1GTguhuNjaUbbnSbGd4L8937Ezm34Eyi6n1maeOBxh3PI0jzJDf5mh/BsLD7F2GOKvlA/5gtvxI3/eV4sLfKW5Wy+oio+es/u6T8UU+nsofy57Icb/JlZHPFtCgd/x+bwt3ZT+xXTtTtTrGAb4QehC6X9G+8YT+ozcLxDsdCjsuOqwPFnrdLYaFc92Ui0m4fr39lYmlCaqTit7G6O/3kWDkgtXjNH4BiEm/+jegQnihOtfffn33WxsFjhfMd48HT+f6o6X65j7XR8WLSHMFkxbvOYsrRsF1bowDuSQ18Mkxk4qz2zoGPL5fu9h2Hqmt1asl3Q3Yu3szOc+spiCmX4AETBM3pLoTYSp3sVxahyhL8eC4mPN9k2x3o0xkiixIzM3CZFzf5oR4mecQ5+ax2wCah3/crmnHoqR0+KMaOPxRif1oEFRFOO/kTPPmtww+NfMXxEK6gn6iU32U6fFruIz8Q4WgljtnaCVTBgWx7diUdshC9ZEa5yKpRBBeW12r/iNc/+EgNqmhswNB8SBoihHXeDF7rrWDLcmt3V8GYYN7pXRy4DZjj4DJuUBL5iC3DQAaoo4vkftqVTYRGLS3mHZ7gdmdTTqbgNN/PTdTCOTgXolc88MhXAEUMdX0iy1JMuk5wLsgeu0QUYlz2S4skTWwJz6pOm/8ihrmgGfFgri+ZWUK2gAPHgbWa8jaocdSuM4FJYoKicYX/ZSENkg9Q1ZzJfwScfVnR2DegOGwCvmogaWJCLQepv9WNlU6QgsmOwICquU28Mlk3d9W5E81lU/5Ez0LcX6lwKMWDNluNKfBDUy/phJgBcMnfkh9iRxrdOzgs08JdPB85Lwo+GUSb4t3nC+0byqMZtO2fQJ4U2zGIr49t/28qmmGv2RanDD7a3FEcdtutkW8twwwlUSpb8QalodddbBfNHKDQ828BdE7OBgFdiKYohLawFYqpybQoxATZrheLhdI7+0Zlu9Q1myRcd15r9UIm8K2LGJxqTegntqNVMKnf1a8zQiyUR1rxoqjiFxeHxqFcYUTHfDu7rhbWng6qOxOsI+5A1p9mRyEPdVkTlE24vY54W7bWc6jMgZvNXdfC9/9q7408KDsbdL7Utz7QFSDetz2picArzrdpL8OaCHC9V26RroemtDZ5yNM/KGkWMyTmfnInEvwtSD23UcFcjhaE3VKzkoaEMKGBft4XbIO6forTY1lmGQwVmKicBCiArDzE+1oIxE08fWeviIOD5TznqH+OoHadvoOP20drMPe5Irg3XBQziW2XDuHYzjqQQ4wySssjXUs5H+t3FWYMHppUnBHMx/nYIT5d7OmjDbgD9F6na3m4l7KdkeSO3kTEPXafiWinogag7b52taiZhL1TSvBFmEZafFq2H8khQaZXuitCewT5FBgVtPK0j4xUHPfUz3Q28eac1Z139DAP23dgki94EC8vbDPTQC97HPPSWjUNG5tWKMsaxAEMKC0665Xvo1Ntd07wCLNf8Q56mrEPVpCxlIMVlQlWRxM3oAfpgIc+8KC3rEXUog5g06vt7zgXY8grH7hhwVSaeuvC06YYRAwpbyk/Unzj9hLEZNs2oxPQB9yc+GnL6zTgq7rI++KDJwX2SP8Sd6YzTuw5lV/kU6eQxRD12omfQAW6caTR4LikYkBB1CMOrvgRr/VY75+NSB40Cni6bADAtaK+vyxVWpf9NeKJxN2KYQ8Q2xPB3K1s7fuhvWbr2XpgW044VD6DRs0qXoqKf1NFsaGvKJc47leUV3pppP/5VTKFhaGuol4Esfjf5zyCyUHmHthChcYh4hYLQF+AFWsuq4t0wJyWgdwQVOZiV0efRHPoK5+E1vjz9wTJmVkITC9oEstAsyZSgE/dbicwKr89YUxKZI+owD205Tm5lnnmDRuP/JnzxX3gMtlrcX0UesZdxyQqYQuEW4R51vmQ5xOZteUd8SJruMlTUzhtVw/Nq7eUBcqN2/HVotgfngif60yKEtoUx3WYOZlVJuJOh8u59fzSDPFYtQgqDUAGyGhQOAvKroXMcOYY0qjnStJR/G3aP+Jt1sLVlGV8POwr/6OGsqetnyF3TmTqZjENfnXh51oxe9qVUw2M78EzAJ+IM8lZ1MBPQ9ZWSVc4J3mWSrLKrMHReA5qdGoz0ODRsaA+vwxXA2cAM4qlfzBJA6581m4hzxItQw5dxrrBL3Y6kCbUcFxo1S8jyV44q//+7ASNNudZ6xeaNOSIUffqMn4A9lIjFctYn2gpEPAb3f7p3iIBN8H14FUGQ9ct2hPsL+cEsTgUrR47uJVN4n4wt/wgfwwHuOnLd4yobkofy8JvxSQTA7rMpDIc608SlZFJfZYcmbT0tAHpPE8MrtQ42siTUNWxqvWZOmvu9f0JPoQmg+6l7sZWwyfi6PXkxJnwBraUG0MYG4zYHQz3igy/XsFkx5tNQxw43qvI9dU3f0DdhOUlHKjmi1VAr2Kiy0HZwD8VeEbhh0OiDdMYspolQsYdSwjCcjeowIXNZVUPmL2wwIkYhmXKhGozdCJ4lRKbsf4NBh/XnQoS92NJEWOVOFs2YhN8c5QZFeK0pRdAG40hqvLbmoSA8xQmzOOEc7wLcme9JOsjPCEgpCwUs9E2DohMHRhUeyGIN6TFvrbny8nDuilsDpzrH5mS76APoIEJmItS67sQJ+nfwddzmjPxcBEBBCw0kWDwd0EZCkNeOD7NNQhtBm7KHL9mRxj6U1yWU2puzlIDtpYxdH4ZPeXBJkTGAJfUr/oTCz/iypY6uXaR2V1doPxJYlrw2ghH0D5gbrhFcIxzYwi4a/4hqVdf2DdxBp6vGYDjavxMAAoy+1+3aiO6S3W/QAKNVXagDtvsNtx7Ks+HKgo6U21B+QSZgIogV5Bt+BnXisdVfy9VyXV+2P5fMuvdpAjM1o/K9Z+XnE4EOCrue+kcdYHqAQ0/Y/OmNlQ6OI33jH/uD1RalPaHpJAm2av0/xtpqdXVKNDrc9F2izo23Wu7firgbURFDNX9eGGeYBhiypyXZft2j3hTvzE6PMWKsod//rEILDkzBXfi7xh0eFkfb3/1zzPK/PI5Nk3FbZyTl4mq5BfBoVoqiPHO4Q4QKZAlrQ3MdNfi3oxIjvsM3kAFv3fdufurqYR3PSwX/mpGy/GFI/B2MNPiNdOppWVbs/gjF3YH+QA9jMhlAbhvasAHstB0IJew09iAkmXHl1/TEj+jvHOpOGrPRQXbPADM+Ig2/OEcUcpgPTItMtW4DdqgfYVI/+4hAFWYjUGpOP/UwNuB7+BbKOcALbjobdgzeBQfjgNSp2GOpxzGLj70Vvq5cw2AoYENwKLUtJUX8sGRox4dVa/TN4xKwaKcl9XawQR/uNus700Hf17pyNnezrUgaY9e4MADhEDBpsJT6y1gDJs1q6wlwGhuUzGR7C8kgpjPyHWwsvrf3yn1zJEIRa5eSxoLAZOCR9xbuztxFRJW9ZmMYfCFJ0evm9F2fVnuje92Rc4Pl6A8bluN8MZyyJGZ0+sNSb//DvAFxC2BqlEsFwccWeAl6CyBcQV1bx4mQMBP1Jxqk1EUADNLeieS2dUFbQ/c/kvwItbZ7tx0st16viqd53WsRmPTKv2AD8CUnhtPWg5aUegNpsYgasaw2+EVooeNKmrW3MFtj76bYHJm5K9gpAXZXsE5U8DM8XmVOSJ1F1WnLy6nQup+jx52bAb+rCq6y9WXl2B2oZDhfDkW7H3oYfT/4xx5VncBuxMXP2lNfhUVQjSSzSRbuZFE4vFawlzveXxaYKVs8LpvAb8IRYF3ZHiRnm0ADeNPWocwxSzNseG7NrSEVZoHdKWqaGEBz1N8Pt7kFbqh3LYmAbm9i1IChIpLpM5AS6mr6OAPHMwwznVy61YpBYX8xZDN/a+lt7n+x5j4bNOVteZ8lj3hpAHSx1VR8vZHec4AHO9XFCdjZ9eRkSV65ljMmZVzaej2qFn/qt1lvWzNZEfHxK3qOJrHL6crr0CRzMox5f2e8ALBB4UGFZKA3tN6F6IXd32GTJXGQ7DTi9j/dNcLF9jCbDcWGKxoKTYblIwbLDReL00LRcDPMcQuXLMh5YzgtfjkFK1DP1iDzzYYVZz5M/kWYRlRpig1htVRjVCknm+h1M5LiEDXOyHREhvzCGpFZjHS0RsK27o2avgdilrJkalWqPW3D9gmwV37HKmfM3F8YZj2ar+vHFvf3B8CRoH4kDHIK9mrAg+owiEwNjjd9V+FsQKYR8czJrUkf7Qoi2YaW6EVDZp5zYlqiYtuXOTHk4fAcZ7qBbdLDiJq0WNV1l2+Hntk1mMWvxrYmc8kIx8G3rW36J6Ra4lLrTOCgiOihmow+YnzUT19jbV2B3RWqSHyxkhmgsBqMYWvOcUom1jDQ436+fcbu3xf2bbeqU/ca+C4DOKE+e3qvmeMqW3AxejfzBRFVcwVYPq4L0APSWWoJu+5UYX4qg5U6YTioqQGPG9XrnuZ/BkxuYpe6Li87+18EskyQW/uA+uk2rpHpr6hut2TlVbKgWkFpx+AZffweiw2+VittkEyf/ifinS/0ItRL2Jq3tQOcxPaWO2xrG68GdFoUpZgFXaP2wYVtRc6xYCfI1CaBqyWpg4bx8OHBQwsV4XWMibZZ0LYjWEy2IxQ1mZrf1/UNbYCJplWu3nZ4WpodIGVA05d+RWSS+ET9tH3RfGGmNI1cIY7evZZq7o+a0bjjygpmR3mVfalkT/SZGT27Q8QGalwGlDOS9VHCyFAIL0a1Q7JiW3saz9gqY8lqKynFrPCzxkU4SIfLc9VfCI5edgRhDXs0edO992nhTKHriREP1NJC6SROMgQ0xO5kNNZOhMOIT99AUElbxqeZF8A3xrfDJsWtDnUenAHdYWSwAbYjFqQZ+D5gi3hNK8CSxU9i6f6ClL9IGlj1OPMQAsr84YG6ijsJpCaGWj75c3yOZKBB9mNpQNPUKkK0D6wgLH8MGoyRxTX6Y05Q4AnYNXMZwXM4eij/9WpsM/9CoRnFQXGR6MEaY+FXvXEO3RO0JaStk6OXuHVATHJE+1W+TU3bSZ2ksMtqjO0zfSJCdBv7y2d8DMx6TfVme3q0ZpTKMMu4YL/t7ciTNtdDkwPogh3Cnjx7qk08SHwf+dksZ7M2vCOlfsF0hQ6J4ehPCaHTNrM/zBSOqD83dBEBCW/F/LEmeh0nOHd7oVl3/Qo/9GUDkkbj7yz+9cvvu+dDAtx8NzCDTP4iKdZvk9MWiizvtILLepysflSvTLFBZ37RLwiriqyRxYv/zrgFd/9XVHh/OmzBvDX4mitMR/lUavs2Vx6cR94lzAkplm3IRNy4TFfu47tuYs9EQPIPVta4P64tV+sZ7n3ued3cgEx2YK+QL5+xms6osk8qQbTyuKVGdaX9FQqk6qfDnT5ykxk0VK7KZ62b6DNDUfQlqGHxSMKv1P0XN5BqMeKG1P4Wp5QfZDUCEldppoX0U6ss2jIko2XpURKCIhfaOqLPfShdtS37ZrT+jFRSH2xYVV1rmT/MBtRQhxiO4MQ3iAGlaZi+9PWBEIXOVnu9jN1f921lWLZky9bqbM3J2MAAI9jmuAx3gyoEUa6P2ivs0EeNv/OR+AX6q5SW6l5HaoFuS6jr6yg9limu+P0KYKzfMXWcQSfTXzpOzKEKpwI3YGXZpSSy2LTlMgfmFA3CF6R5c9xWEtRuCg2ZPUQ2Nb6dRFTNd4TfGHrnEWSKHPuRyiJSDAZ+KX0VxmSHjGPbQTLVpqixia2uyhQ394gBMt7C3ZAmxn/DJS+l1fBsAo2Eir/C0jG9csd4+/tp12pPc/BVJGaK9mfvr7M/CeztrmCO5qY06Edi4xAGtiEhnWAbzLy2VEyazE1J5nPmgU4RpW4Sa0TnOT6w5lgt3/tMpROigHHmexBGAMY0mdcDbDxWIz41NgdD6oxgHsJRgr5RnT6wZAkTOcStU4NMOQNemSO7gxGahdEsC+NRVGxMUhQmmM0llWRbbmFGHzEqLM4Iw0H7577Kyo+Zf+2cUFIOw93gEY171vQaM0HLwpjpdRR6Jz7V0ckE7XzYJ0TmY9znLdzkva0vNrAGGT5SUZ5uaHDkcGvI0ySpwkasEgZPMseYcu85w8HPdSNi+4T6A83iAwDbxgeFcB1ZM2iGXzFcEOUlYVrEckaOyodfvaYSQ7GuB4ISE0nYJc15X/1ciDTPbPCgYJK55VkEor4LvzL9S2WDy4xj+6FOqVyTAC2ZNowheeeSI5hA/02l8UYkv4nk9iaVn+kCVEUstgk5Hyq+gJm6R9vG3rhuM904he/hFmNQaUIATB1y3vw+OmxP4X5Yi6A5I5jJufHCjF9+AGNwnEllZjUco6XhsO5T5+R3yxz5yLVOnAn0zuS+6zdj0nTJbEZCbXJdtpfYZfCeCOqJHoE2vPPFS6eRLjIJlG69X93nfR0mxSFXzp1Zc0lt/VafDaImhUMtbnqWVb9M4nGNQLN68BHP7AR8Il9dkcxzmBv8PCZlw9guY0lurbBsmNYlwJZsA/B15/HfkbjbwPddaVecls/elmDHNW2r4crAx43feNkfRwsaNq/yyJ0d/p5hZ6AZajz7DBfUok0ZU62gCzz7x8eVfJTKA8IWn45vINLSM1q+HF9CV9qF3zP6Ml21kPPL3CXzkuYUlnSqT+Ij4tI/od5KwIs+tDajDs64owN7tOAd6eucGz+KfO26iNcBFpbWA5732bBNWO4kHNpr9D955L61bvHCF/mwSrz6eQaDjfDEANqGMkFc+NGxpKZzCD2sj/JrHd+zlPQ8Iz7Q+2JVIiVCuCKoK/hlAEHzvk/Piq3mRL1rT/fEh9hoT5GJmeYswg1otiKydizJ/fS2SeKHVu6Z3JEHjiW8NaTQgP5xdBli8nC57XiN9hrquBu99hn9zqwo92+PM2JXtpeVZS0PdqR5mDyDreMMtEws+CpwaRyyzoYtfcvt9PJIW0fJVNNi/FFyRsea7peLvJrL+5b4GOXJ8tAr+ATk9f8KmiIsRhqRy0vFzwRV3Z5dZ3QqIU8JQ/uQpkJbjMUMFj2F9sCFeaBjI4+fL/oN3+LQgjI4zuAfQ+3IPIPFQBccf0clJpsfpnBxD84atwtupkGqKvrH7cGNl/QcWcSi6wcVDML6ljOgYbo+2BOAWNNjlUBPiyitUAwbnhFvLbnqw42kR3Yp2kv2dMeDdcGOX5kT4S6M44KHEB/SpCfl7xgsUvs+JNY9G3O2X/6FEt9FyAn57lrbiu+tl83sCymSvq9eZbe9mchL7MTf/Ta78e80zSf0hYY5eUU7+ff14jv7Xy8qjzfzzzvaJnrIdvFb5BLWKcWGy5/w7+vV2cvIfwHqdTB+RuJK5oj9mbt0Hy94AmjMjjwYNZlNS6uiyxNnwNyt3gdreLb64p/3+08nXkb92LTkkRgFOwk1oGEVllcOj5lv1hfAZywDows0944U8vUFw+A/nuVq/UCygsrmWIBnHyU01d0XJPwriEOvx/ISK6Pk4y2w0gmojZs7lU8TtakBAdne4v/aNxmMpK4VcGMp7si0yqsiolXRuOi1Z1P7SqD3Zmp0CWcyK4Ubmp2SXiXuI5nGLCieFHKHNRIlcY3Pys2dwMTYCaqlyWSITwr2oGXvyU3h1Pf8eQ3w1bnD7ilocVjYDkcXR3Oo1BXgMLTUjNw2xMVwjtp99NhSVc5aIWrDQT5DHPKtCtheBP4zHcw4dz2eRdTMamhlHhtfgqJJHI7NGDUw1XL8vsSeSHyKqDtqoAmrQqsYwvwi7HW3ojWyhIa5oz5xJTaq14NAzFLjVLR12rRNUQ6xohDnrWFb5bG9yf8aCD8d5phoackcNJp+Dw3Due3RM+5Rid7EuIgsnwgpX0rUWh/nqPtByMhMZZ69NpgvRTKZ62ViZ+Q7Dp5r4K0d7EfJuiy06KuIYauRh5Ecrhdt2QpTS1k1AscEHvapNbU3HL1F2TFyR33Wxb5MvH5iZsrn3SDcsxlnnshO8PLwmdGN+paWnQuORtZGX37uhFT64SeuPsx8UOokY6ON85WdQ1dki5zErsJGazcBOddWJEKqNPiJpsMD1GrVLrVY+AOdPWQneTyyP1hRX/lMM4ZogGGOhYuAdr7F/DOiAoc++cn5vlf0zkMUJ40Z1rlgv9BelPqVOpxKeOpzKdF8maK+1Vv23MO9k/8+qpLoxrIGH2EDQlnGmH8CD31G8QqlyQIcpmR5bwmSVw9/Ns6IHgulCRehvZ/+VrM60Cu/r3AontFfrljew74skYe2uyn7JKQtFQBQRJ9ryGic/zQOsbS4scUBctA8cPToQ3x6ZBQu6DPu5m1bnCtP8TllLYA0UTQNVqza5nfew3Mopy1GPUwG5jsl0OVXniPmAcmLqO5HG8Hv3nSLecE9oOjPDXcsTxoCBxYyzBdj4wmnyEV4kvFDunipS8SSkvdaMnTBN9brHUR8xdmmEAp/Pdqk9uextp1t+JrtXwpN/MG2w/qhRMpSNxQ1uhg/kKO30eQ/FyHUDkWHT8V6gGRU4DhDMxZu7xXij9Ui6jlpWmQCqJg3FkOTq3WKneCRYZxBXMNAVLQgHXSCGSqNdjebY94oyIpVjMYehAiFx/tqzBXFHZaL5PeeD74rW5OysFoUXY8sebUZleFTUa/+zBKVTFDopTReXNuZq47QjkWnxjirCommO4L/GrFtVV21EpMyw8wyThL5Y59d88xtlx1g1ttSICDwnof6lt/6zliPzgVUL8jWBjC0o2D6Kg+jNuThkAlaDJsq/AG2aKA//A76avw2KNqtv223P+Wq3StRDDNKFFgtsFukYt1GFDWooFVXitaNhb3RCyJi4cMeNjROiPEDb4k+G3+hD8tsg+5hhmSc/8t2JTSwYoCzAI75doq8QTHe+E/Tw0RQSUDlU+6uBeNN3h6jJGX/mH8oj0i3caCNsjvTnoh73BtyZpsflHLq6AfwJNCDX4S98h4+pCOhGKDhV3rtkKHMa3EG4J9y8zFWI4UsfNzC/Rl5midNn7gwoN9j23HGCQQ+OAZpTTPMdiVow740gIyuEtd0qVxMyNXhHcnuXRKdw5wDUSL358ktjMXmAkvIB73BLa1vfF9BAUZInPYJiwxqFWQQBVk7gQH4ojfUQ/KEjn+A/WR6EEe4CtbpoLe1mzHkajgTIoE0SLDHVauKhrq12zrAXBGbPPWKCt4DGedq3JyGRbmPFW32bE7T20+73BatV/qQhhBWfWBFHfhYWXjALts38FemnoT+9bn1jDBMcUMmYgSc0e7GQjv2MUBwLU8ionCpgV+Qrhg7iUIfUY6JFxR0Y+ZTCPM+rVuq0GNLyJXX6nrUTt8HzFBRY1E/FIm2EeVA9NcXrj7S6YYIChVQCWr/m2fYUjC4j0XLkzZ8GCSLfmkW3PB/xq+nlXsKVBOj7vTvqKCOMq7Ztqr3cQ+N8gBnPaAps+oGwWOkbuxnRYj/x/WjiDclVrs22xMK4qArE1Ztk1456kiJriw6abkNeRHogaPRBgbgF9Z8i/tbzWELN4CvbqtrqV9TtGSnmPS2F9kqOIBaazHYaJ9bi3AoDBvlZasMluxt0BDXfhp02Jn411aVt6S4TUB8ZgFDkI6TP6gwPY85w+oUQSsjIeXVminrwIdK2ZAawb8Se6XOJbOaliQxHSrnAeONDLuCnFejIbp4YDtBcQCwMsYiRZfHefuEJqJcwKTTJ8sx5hjHmJI1sPFHOr6W9AhZ2NAod38mnLQk1gOz2LCAohoQbgMbUK9RMEA3LkiF7Sr9tLZp6lkciIGhE2V546w3Mam53VtVkGbB9w0Yk2XiRnCmbpxmHr2k4eSC0RuNbjNsUfDIfc8DZvRvgUDe1IlKdZTzcT4ZGEb53dp8VtsoZlyXzLHOdAbsp1LPTVaHvLA0GYDFMbAW/WUBfUAdHwqLFAV+3uHvYWrCfhUOR2i89qvCBoOb48usAGdcF2M4aKn79k/43WzBZ+xR1L0uZfia70XP9soQReeuhZiUnXFDG1T8/OXNmssTSnYO+3kVLAgeiY719uDwL9FQycgLPessNihMZbAKG7qwPZyG11G1+ZA3jAX2yddpYfmaKBlmfcK/V0mwIRUDC0nJSOPUl2KB8h13F4dlVZiRhdGY5farwN+f9hEb1cRi41ZcGDn6Xe9MMSTOY81ULJyXIHSWFIQHstVYLiJEiUjktlHiGjntN5/btB8Fu+vp28zl2fZXN+dJDyN6EXhS+0yzqpl/LSJNEUVxmu7BsNdjAY0jVsAhkNuuY0E1G48ej25mSt+00yPbQ4SRCVkIwb6ISvYtmJRPz9Zt5dk76blf+lJwAPH5KDF+vHAmACLoCdG2Adii6dOHnNJnTmZtoOGO8Q1jy1veMw6gbLFToQmfJa7nT7Al89mRbRkZZQxJTKgK5Kc9INzmTJFp0tpAPzNmyL/F08bX3nhCumM/cR/2RPn9emZ3VljokttZD1zVWXlUIqEU7SLk5I0lFRU0AcENXBYazNaVzsVHA/sD3o9hm42wbHIRb/BBQTKzAi8s3+bMtpOOZgLdQzCYPfX3UUxKd1WYVkGH7lh/RBBgMZZwXzU9+GYxdBqlGs0LP+DZ5g2BWNh6FAcR944B+K/JTWI3t9YyVyRhlP4CCoUk/mmF7+r2pilVBjxXBHFaBfBtr9hbVn2zDuI0kEOG3kBx8CGdPOjX1ph1POOZJUO1JEGG0jzUy2tK4X0CgVNYhmkqqQysRNtKuPdCJqK3WW57kaV17vXgiyPrl4KEEWgiGF1euI4QkSFHFf0TDroQiLNKJiLbdhH0YBhriRNCHPxSqJmNNoketaioohqMglh6wLtEGWSM1EZbQg72h0UJAIPVFCAJOThpQGGdKfFovcwEeiBuZHN2Ob4uVM7+gwZLz1D9E7ta4RmMZ24OBBAg7Eh6dLXGofZ4U2TFOCQMKjwhVckjrydRS+YaqCw1kYt6UexuzbNEDyYLTZnrY1PzsHZJT4U+awO2xlqTSYu6n/U29O2wPXgGOEKDMSq+zTUtyc8+6iLp0ivav4FKx+xxVy4FxhIF/pucVDqpsVe2jFOfdZhTzLz2QjtzvsTCvDPU7bzDH2eXVKUV9TZ+qFtaSSxnYgYdXKwVreIgvWhT9eGDB2OvnWyPLfIIIfNnfIxU8nW7MbcH05nhlsYtaW9EZRsxWcKdEqInq1DiZPKCz7iGmAU9/ccnnQud2pNgIGFYOTAWjhIrd63aPDgfj8/sdlD4l+UTlcxTI9jbaMqqN0gQxSHs60IAcW3cH4p3V1aSciTKB29L1tz2eUQhRiTgTvmqc+sGtBNh4ky0mQJGsdycBREP+fAaSs1EREDVo5gvgi5+aCN7NECw30owbCc1mSpjiahyNVwJd1jiGgzSwfTpzf2c5XJvG/g1n0fH88KHNnf+u7ZiRMlXueSIsloJBUtW9ezvsx9grfsX/FNxnbxU1Lvg0hLxixypHKGFAaPu0xCD8oDTeFSyfRT6s8109GMUZL8m2xXp8X2dpPCWWdX84iga4BrTlOfqox4shqEgh/Ht4qRst52cA1xOIUuOxgfUivp6v5f8IVyaryEdpVk72ERAwdT4aoY1usBgmP+0m06Q216H/nubtNYxHaOIYjcach3A8Ez/zc0KcShhel0HCYjFsA0FjYqyJ5ZUH1aZw3+zWC0hLpM6GDfcAdn9fq2orPmZbW6XXrf+Krc9RtvII5jeD3dFoT1KwZJwxfUMvc5KLfn8rROW23Jw89sJ2a5dpB3qWDUBWF2iX8OCuKprHosJ2mflBR+Wqs86VvgI/XMnsqb97+VlKdPVysczPj8Jhzf+WCvGBHijAqYlavbF60soMWlHbvKT+ScvhprgeTln51xX0sF+Eadc/l2s2a5BgkVbHYyz0E85p0LstqH+gEGiR84nBRRFIn8hLSZrGwqjZ3E29cuGi+5Z5bp7EM8MWFa9ssS/vy4VrDfECSv7DSU84DaP0sXI3Ap4lWznQ65nQoTKRWU30gd7Nn8ZowUvGIx4aqyXGwmA/PB4qN8msJUODezUHEl0VP9uo+cZ8vPFodSIB4C7lQYjEFj8yu49C2KIV3qxMFYTevG8KqAr0TPlkbzHHnTpDpvpzziAiNFh8xiT7C/TiyH0EguUw4vxAgpnE27WIypV+uFN2zW7xniF/n75trs9IJ5amB1zXXZ1LFkJ6GbS/dFokzl4cc2mamVwhL4XU0Av5gDWAl+aEWhAP7t2VIwU+EpvfOPDcLASX7H7lZpXA2XQfbSlD4qU18NffNPoAKMNSccBfO9YVVgmlW4RydBqfHAV7+hrZ84WJGho6bNT0YMhxxLdOx/dwGj0oyak9aAkNJ8lRJzUuA8sR+fPyiyTgUHio5+Pp+YaKlHrhR41jY5NESPS3x+zTMe0S2HnLOKCOQPpdxKyviBvdHrCDRqO+l96HhhNBLXWv4yEMuEUYo8kXnYJM8oIgVM4XJ+xXOev4YbWeqsvgq0lmw4/PiYr9sYLt+W5EAuYSFnJEan8CwJwbtASBfLBBpJZiRPor/aCJBZsM+MhvS7ZepyHvU8m5WSmaZnxuLts8ojl6KkS8oSAHkq5GWlCB/NgJ5W3rO2Cj1MK7ahxsCrbTT3a0V/QQH+sErxV4XUWDHx0kkFy25bPmBMBQ6BU3HoHhhYcJB9JhP6NXUWKxnE0raXHB6U9KHpWdQCQI72qevp5fMzcm+AvC85rsynVQhruDA9fp9COe7N56cg1UKGSas89vrN+WlGLYTwi5W+0xYdKEGtGCeNJwXKDU0XqU5uQYnWsMwTENLGtbQMvoGjIFIEMzCRal4rnBAg7D/CSn8MsCvS+FDJJAzoiioJEhZJgAp9n2+1Yznr7H+6eT4YkJ9Mpj60ImcW4i4iHDLn9RydB8dx3QYm3rsX6n4VRrZDsYK6DCGwkwd5n3/INFEpk16fYpP6JtMQpqEMzcOfQGAHXBTEGzuLJ03GYQL9bmV2/7ExDlRf+Uvf1sM2frRtCWmal12pMgtonvSCtR4n1CLUZRdTHDHP1Otwqd+rcdlavnKjUB/OYXQHUJzpNyFoKpQK+2OgrEKpGyIgIBgn2y9QHnTJihZOpEvOKIoHAMGAXHmj21Lym39Mbiow4IF+77xNuewziNVBxr6KD5e+9HzZSBIlUa/AmsDFJFXeyrQakR3FwowTGcADJHcEfhGkXYNGSYo4dh4bxwLM+28xjiqkdn0/3R4UEkvcBrBfn/SzBc1XhKM2VPlJgKSorjDac96V2UnQYXl1/yZPT4DVelgO+soMjexXwYO58VLl5xInQUZI8jc3H2CPnCNb9X05nOxIy4MlecasTqGK6s2az4RjpF2cQP2G28R+7wDPsZDZC/kWtjdoHC7SpdPmqQrUAhMwKVuxCmYTiD9q/O7GHtZvPSN0CAUQN/rymXZNniYLlJDE70bsk6Xxsh4kDOdxe7A2wo7P9F5YvqqRDI6brf79yPCSp4I0jVoO4YnLYtX5nzspR5WB4AKOYtR1ujXbOQpPyYDvfRE3FN5zw0i7reehdi7yV0YDRKRllGCGRk5Yz+Uv1fYl2ZwrnGsqsjgAVo0xEUba8ohjaNMJNwTwZA/wBDWFSCpg1eUH8MYL2zdioxRTqgGQrDZxQyNzyBJPXZF0+oxITJAbj7oNC5JwgDMUJaM5GqlGCWc//KCIrI+aclEe4IA0uzv7cuj6GCdaJONpi13O544vbtIHBF+A+JeDFUQNy61Gki3rtyQ4aUywn6ru314/dkGiP8Iwjo0J/2Txs49ZkwEl4mx+iYUUO55I6pJzU4P+7RRs+DXZkyKUYZqVWrPF4I94m4Wx1tXeE74o9GuX977yvJ/jkdak8+AmoHVjI15V+WwBdARFV2IPirJgVMdsg1Pez2VNHqa7EHWdTkl3XTcyjG9BiueWFvQfXI8aWSkuuRmqi/HUuzqyvLJfNfs0txMqldYYflWB1BS31WkuPJGGwXUCpjiQSktkuBMWwHjSkQxeehqw1Kgz0Trzm7QbtgxiEPDVmWCNCAeCfROTphd1ZNOhzLy6XfJyG6Xgd5MCAZw4xie0Sj5AnY1/akDgNS9YFl3Y06vd6FAsg2gVQJtzG7LVq1OH2frbXNHWH/NY89NNZ4QUSJqL2yEcGADbT38X0bGdukqYlSoliKOcsSTuqhcaemUeYLLoI8+MZor2RxXTRThF1LrHfqf/5LcLAjdl4EERgUysYS2geE+yFdasU91UgUDsc2cSQ1ZoT9+uLOwdgAmifwQqF028INc2IQEDfTmUw3eZxvz7Ud1z3xc1PQfeCvfKsB9jOhRj7rFyb9XcDWLcYj0bByosychMezMLVkFiYcdBBQtvI6K0KRuOZQH2kBsYHJaXTkup8F0eIhO1/GcIwWKpr2mouB7g5TUDJNvORXPXa/mU8bh27TAZYBe2sKx4NSv5OjnHIWD2RuysCzBlUfeNXhDd2jxnHoUlheJ3jBApzURy0fwm2FwwsSU0caQGl0Kv8hopRQE211NnvtLRsmCNrhhpEDoNiZEzD2QdJWKbRRWnaFedXHAELSN0t0bfsCsMf0ktfBoXBoNA+nZN9+pSlmuzspFevmsqqcMllzzvkyXrzoA+Ryo1ePXpdGOoJvhyru+EBRsmOp7MXZ0vNUMUqHLUoKglg1p73sWeZmPc+KAw0pE2zIsFFE5H4192KwDvDxdxEYoDBDNZjbg2bmADTeUKK57IPD4fTYF4c6EnXx/teYMORBDtIhPJneiZny7Nv/zG+YmekIKCoxr6kauE2bZtBLufetNG0BtBY7f+/ImUypMBvdWu/Q7vTMRzw5aQGZWuc1V0HEsItFYMIBnoKGZ0xcarba/TYZq50kCaflFysYjA4EDKHqGdpYWdKYmm+a7TADmW35yfnOYpZYrkpVEtiqF0EujI00aeplNs2k+qyFZNeE3CDPL9P6b4PQ/kataHkVpLSEVGK7EX6rAa7IVNrvZtFvOA6okKvBgMtFDAGZOx88MeBcJ8AR3AgUUeIznAN6tjCUipGDZONm1FjWJp4A3QIzSaIOmZ7DvF/ysYYbM/fFDOV0jntAjRdapxJxL0eThpEhKOjCDDq2ks+3GrwxqIFKLe1WdOzII8XIOPGnwy6LKXVfpSDOTEfaRsGujhpS4hBIsMOqHbl16PJxc4EkaVu9wpEYlF/84NSv5Zum4drMfp9yXbzzAOJqqS4YkI4cBrFrC7bMPiCfgI3nNZAqkk3QOZqR+yyqx+nDQKBBBZ7QKrfGMCL+XpqFaBJU0wpkBdAhbR4hJsmT5aynlvkouoxm/NjD5oe6BzVIO9uktM+/5dEC5P7vZvarmuO/lKXz4sBabVPIATuKTrwbJP8XUkdM6uEctHKXICUJGjaZIWRbZp8czquQYfY6ynBUCfIU+gG6wqSIBmYIm9pZpXdaL121V7q0VjDjmQnXvMe7ysoEZnZL15B0SpxS1jjd83uNIOKZwu5MPzg2NhOx3xMOPYwEn2CUzbSrwAs5OAtrz3GAaUkJOU74XwjaYUmGJdZBS1NJVkGYrToINLKDjxcuIlyfVsKQSG/G4DyiO2SlQvJ0d0Ot1uOG5IFSAkq+PRVMgVMDvOIJMdqjeCFKUGRWBW9wigYvcbU7CQL/7meF2KZAaWl+4y9uhowAX7elogAvItAAxo2+SFxGRsHGEW9BnhlTuWigYxRcnVUBRQHV41LV+Fr5CJYV7sHfeywswx4XMtUx6EkBhR+q8AXXUA8uPJ73Pb49i9KG9fOljvXeyFj9ixgbo6CcbAJ7WHWqKHy/h+YjBwp6VcN7M89FGzQ04qbrQtgrOFybg3gQRTYG5xn73ArkfQWjCJROwy3J38Dx/D7jOa6BBNsitEw1wGq780EEioOeD+ZGp2J66ADiVGMayiHYucMk8nTK2zzT9CnEraAk95kQjy4k0GRElLL5YAKLQErJ5rp1eay9O4Fb6yJGm9U4FaMwPGxtKD6odIIHKoWnhKo1U8KIpFC+MVn59ZXmc7ZTBZfsg6FQ8W10YfTr4u0nYrpHZbZ1jXiLmooF0cOm0+mPnJBXQtepc7n0BqOipNCqI6yyloTeRShNKH04FIo0gcMk0H/xThyN4pPAWjDDkEp3lNNPRNVfpMI44CWRlRgViP64eK0JSRp0WUvCWYumlW/c58Vcz/yMwVcW5oYb9+26TEhwvbxiNg48hl1VI1UXTU//Eta+BMKnGUivctfL5wINDD0giQL1ipt6U7C9cd4+lgqY2lMUZ02Uv6Prs+ZEZer7ZfWBXVghlfOOrClwsoOFKzWEfz6RZu1eCs+K8fLvkts5+BX0gyrFYve0C3qHrn5U/Oh6D/CihmWIrY7HUZRhJaxde+tldu6adYJ+LeXupQw0XExC36RETdNFxcq9glMu4cNQSX9cqR/GQYp+IxUkIcNGWVU7ZtGa6P3XAyodRt0XeS3Tp01AnCh0ZbUh4VrSZeV9RWfSoWyxnY3hzcZ30G/InDq4wxRrEejreBxnhIQbkxenxkaxl+k7eLUQkUR6vKJ2iDFNGX3WmVA1yaOH+mvhBd+sE6vacQzFobwY5BqEAFmejwW5ne7HtVNolOUgJc8CsUxmc/LBi8N5mu9VsIA5HyErnS6zeCz7VLI9+n/hbT6hTokMXTVyXJRKSG2hd2labXTbtmK4fNH3IZBPreSA4FMeVouVN3zG5x9CiGpLw/3pceo4qGqp+rVp+z+7yQ98oEf+nyH4F3+J9IheDBa94Wi63zJbLBCIZm7P0asHGpIJt3PzE3m0S4YIWyXBCVXGikj8MudDPB/6Nm2v4IxJ5gU0ii0guy5SUHqGUYzTP0jIJU5E82RHUXtX4lDdrihBLdP1YaG1AGUC12rQKuIaGvCpMjZC9bWSCYnjDlvpWbkdXMTNeBHLKiuoozMGIvkczmP0aRJSJ8PYnLCVNhKHXBNckH79e8Z8Kc2wUej4sQZoH8qDRGkg86maW/ZQWGNnLcXmq3FlXM6ssR/3P6E/bHMvm6HLrv1yRixit25JsH3/IOr2UV4BWJhxXW5BJ6Xdr07n9kF3ZNAk6/Xpc5MSFmYJ2R7bdL8Kk7q1OU9Elg/tCxJ8giT27wSTySF0GOxg4PbYJdi/Nyia9Nn89CGDulfJemm1aiEr/eleGSN+5MRrVJ4K6lgyTTIW3i9cQ0dAi6FHt0YMbH3wDSAtGLSAccezzxHitt1QdhW36CQgPcA8vIIBh3/JNjf/Obmc2yzpk8edSlS4lVdwgW5vzbYEyFoF4GCBBby1keVNueHAH+evi+H7oOVfS3XuPQSNTXOONAbzJeSb5stwdQHl1ZjrGoE49I8+A9j3t+ahhQj74FCSWpZrj7wRSFJJnnwi1T9HL5qrCFW/JZq6P62XkMWTb+u4lGpKfmmwiJWx178GOG7KbrZGqyWwmuyKWPkNswkZ1q8uptUlviIi+AXh2bOOTOLsrtNkfqbQJeh24reebkINLkjut5r4d9GR/r8CBa9SU0UQhsnZp5cP+RqWCixRm7i4YRFbtZ4EAkhtNa6jHb6gPYQv7MKqkPLRmX3dFsK8XsRLVZ6IEVrCbmNDc8o5mqsogjAQfoC9Bc7R6gfw03m+lQpv6kTfhxscDIX6s0w+fBxtkhjXAXr10UouWCx3C/p/FYwJRS/AXRKkjOb5CLmK4XRe0+xeDDwVkJPZau52bzLEDHCqV0f44pPgKOkYKgTZJ33fmk3Tu8SdxJ02SHM8Fem5SMsWqRyi2F1ynfRJszcFKykdWlNqgDA/L9lKYBmc7Zu/q9ii1FPF47VJkqhirUob53zoiJtVVRVwMR34gV9iqcBaHbRu9kkvqk3yMpfRFG49pKKjIiq7h/VpRwPGTHoY4cg05X5028iHsLvUW/uz+kjPyIEhhcKUwCkJAwbR9pIEGOn8z6svAO8i89sJ3dL5qDWFYbS+HGPRMxYwJItFQN86YESeJQhn2urGiLRffQeLptDl8dAgb+Tp47UQPxWOw17OeChLN1WnzlkPL1T5O+O3Menpn4C3IY5LEepHpnPeZHbvuWfeVtPlkH4LZjPbBrkJT3NoRJzBt86CO0Xq59oQ+8dsm0ymRcmQyn8w71mhmcuEI5byuF+C88VPYly2sEzjlzAQ3vdn/1+Hzguw6qFNNbqenhZGbdiG6RwZaTG7jTA2X9RdXjDN9yj1uQpyO4Lx8KRAcZcbZMafp4wPOd5MdXoFY52V1A8M9hi3sso93+uprE0qYNMjkE22CvK4HuUxqN7oIz5pWuETq1lQAjqlSlqdD2Rnr/ggp/TVkQYjn9lMfYelk2sH5HPdopYo7MHwlV1or9Bxf+QCyLzm92vzG2wjiIjC/ZHEJzeroJl6bdFPTpZho5MV2U86fLQqxNlGIMqCGy+9WYhJ8ob1r0+Whxde9L2PdysETv97O+xVw+VNN1TZSQN5I6l9m5Ip6pLIqLm4a1B1ffH6gHyqT9p82NOjntRWGIofO3bJz5GhkvSWbsXueTAMaJDou99kGLqDlhwBZNEQ4mKPuDvVwSK4WmLluHyhA97pZiVe8g+JxmnJF8IkV/tCs4Jq/HgOoAEGR9tCDsDbDmi3OviUQpG5D8XmKcSAUaFLRXb2lmJTNYdhtYyfjBYZQmN5qT5CNuaD3BVnlkCk7bsMW3AtXkNMMTuW4HjUERSJnVQ0vsBGa1wo3Qh7115XGeTF3NTz8w0440AgU7c3bSXO/KMINaIWXd0oLpoq/0/QJxCQSJ9XnYy1W7TYLBJpHsVWD1ahsA7FjNvRd6mxCiHsm8g6Z0pnzqIpF1dHUtP2ITU5Z1hZHbu+L3BEEStBbL9XYvGfEakv1bmf+bOZGnoiuHEdlBnaChxYKNzB23b8sw8YyT7Ajxfk49eJIAvdbVkdFCe2J0gMefhQ0bIZxhx3fzMIysQNiN8PgOUKxOMur10LduigREDRMZyP4oGWrP1GFY4t6groASsZ421os48wAdnrbovNhLt7ScNULkwZ5AIZJTrbaKYTLjA1oJ3sIuN/aYocm/9uoQHEIlacF1s/TM1fLcPTL38O9fOsjMEIwoPKfvt7opuI9G2Hf/PR4aCLDQ7wNmIdEuXJ/QNL72k5q4NejAldPfe3UVVqzkys8YZ/jYOGOp6c+YzRCrCuq0M11y7TiN6qk7YXRMn/gukxrEimbMQjr3jwRM6dKVZ4RUfWQr8noPXLJq6yh5R3EH1IVOHESst/LItbG2D2vRsZRkAObzvQAAD3mb3/G4NzopI0FAiHfbpq0X72adg6SRj+8OHMShtFxxLZlf/nLgRLbClwl5WmaYSs+yEjkq48tY7Z2bE0N91mJwt+ua0NlRJIDh0HikF4UvSVorFj2YVu9YeS5tfvlVjPSoNu/Zu6dEUfBOT555hahBdN3Sa5Xuj2Rvau1lQNIaC944y0RWj9UiNDskAK1WoL+EfXcC6IbBXFRyVfX/WKXxPAwUyIAGW8ggZ08hcijKTt1YKnUO6QPvcrmDVAb0FCLIXn5id4fD/Jx4tw/gbXs7WF9b2RgXtPhLBG9vF5FEkdHAKrQHZAJC/HWvk7nvzzDzIXZlfFTJoC3JpGgLPBY7SQTjGlUvG577yNutZ1hTfs9/1nkSXK9zzKLRZ3VODeKUovJe0WCq1zVMYxCJMenmNzPIU2S8TA4E7wWmbNkxq9rI2dd6v0VpcAPVMxnDsvWTWFayyqvKZO7Z08a62i/oH2/jxf8rpmfO64in3FLiL1GX8IGtVE9M23yGsIqJbxDTy+LtaMWDaPqkymb5VrQdzOvqldeU0SUi6IirG8UZ3jcpRbwHa1C0Dww9G/SFX3gPvTJQE+kyz+g1BeMILKKO+olcHzctOWgzxYHnOD7dpCRtuZEXACjgqesZMasoPgnuDC4nUviAAxDc5pngjoAITIkvhKwg5d608pdrZcA+qn5TMT6Uo/QzBaOxBCLTJX3Mgk85rMfsnWx86oLxf7p2PX5ONqieTa/qM3tPw4ZXvlAp83NSD8F7+ZgctK1TpoYwtiU2h02HCGioH5tkVCqNVTMH5p00sRy2JU1qyDBP2CII/Dg4WDsIl+zgeX7589srx6YORRQMBfKbodbB743Tl4WLKOEnwWUVBsm94SOlCracU72MSyj068wdpYjyz1FwC2bjQnxnB6Mp/pZ+yyZXtguEaYB+kqhjQ6UUmwSFazOb+rhYjLaoiM+aN9/8KKn0zaCTFpN9eKwWy7/u4EHzO46TdFSNjMfn2iPSJwDPCFHc0I1+vjdAZw5ZjqR/uzi9Zn20oAa5JnLEk/EA3VRWE7J/XrupfFJPtCUuqHPpnlL7ISJtRpSVcB8qsZCm2QEkWoROtCKKxUh3yEcMbWYJwk6DlEBG0bZP6eg06FL3v6RPb7odGuwm7FN8fG4woqtB8e7M5klPpo97GoObNwt+ludTAmxyC5hmcFx+dIvEZKI6igFKHqLH01iY1o7903VzG9QGetyVx5RNmBYUU+zIuSva/yIcECUi4pRmE3VkF2avqulQEUY4yZ/wmNboBzPmAPey3+dSYtBZUjeWWT0pPwCz4Vozxp9xeClIU60qvEFMQCaPvPaA70WlOP9f/ey39macvpGCVa+zfa8gO44wbxpJUlC8GN/pRMTQtzY8Z8/hiNrU+Zq64ZfFGIkdj7m7abcK1EBtws1X4J/hnqvasPvvDSDYWN+QcQVGMqXalkDtTad5rYY0TIR1Eqox3czwPMjKPvF5sFv17Thujr1IZ1Ytl4VX1J0vjXKmLY4lmXipRAro0qVGEcXxEVMMEl54jQMd4J7RjgomU0j1ptjyxY+cLiSyXPfiEcIS2lWDK3ISAy6UZ3Hb5vnPncA94411jcy75ay6B6DSTzK6UTCZR9uDANtPBrvIDgjsfarMiwoax2OlLxaSoYn4iRgkpEGqEkwox5tyI8aKkLlfZ12lO11TxsqRMY89j5JaO55XfPJPDL1LGSnC88Re9Ai+Nu5bZjtwRrvFITUFHPR4ZmxGslQMecgbZO7nHk32qHxYkdvWpup07ojcMCaVrpFAyFZJJbNvBpZfdf39Hdo2kPtT7v0/f8R/B5Nz4f1t9/3zNM/7n6SUHfcWk5dfQFJvcJMgPolGCpOFb/WC0FGWU2asuQyT+rm88ZKZ78Cei/CAh939CH0JYbpZIPtxc2ufXqjS3pHH9lnWK4iJ7OjR/EESpCo2R3MYKyE7rHfhTvWho4cL1QdN4jFTyR6syMwFm124TVDDRXMNveI1Dp/ntwdz8k8kxw7iFSx6+Yx6O+1LzMVrN0BBzziZi9kneZSzgollBnVwBh6oSOPHXrglrOj+QmR/AESrhDpKrWT+8/AiMDxS/5wwRNuGQPLlJ9ovomhJWn8sMLVItQ8N/7IXvtD8kdOoHaw+vBSbFImQsv/OCAIui99E+YSIOMlMvBXkAt+NAZK8wB9Jf8CPtB+TOUOR+z71d/AFXpPBT6+A5FLjxMjLIEoJzrQfquvxEIi+WoUzGR1IzQFNvbYOnxb2PyQ0kGdyXKzW2axQL8lNAXPk6NEjqrRD1oZtKLlFoofrXw0dCNWASHzy+7PSzOUJ3XtaPZsxLDjr+o41fKuKWNmjiZtfkOzItvlV2MDGSheGF0ma04qE3TUEfqJMrXFm7DpK+27DSvCUVf7rbNoljPhha5W7KBqVq0ShUSTbRmuqPtQreVWH4JET5yMhuqMoSd4r/N8sDmeQiQQvi1tcZv7Moc7dT5X5AtCD6kNEGZOzVcNYlpX4AbTsLgSYYliiPyVoniuYYySxsBy5cgb3pD+EK0Gpb0wJg031dPgaL8JZt6sIvzNPEHfVPOjXmaXj4bd4voXzpZ5GApMhILgMbCEWZ2zwgdeQgjNHLbPIt+KqxRwWPLTN6HwZ0Ouijj4UF+Sg0Au8XuIKW0WxlexdrFrDcZJ8Shauat3X0XmHygqgL1nAu2hrJFb4wZXkcS+i36KMyU1yFvYv23bQUJi/3yQpqr/naUOoiEWOxckyq/gq43dFou1DVDaYMZK9tho7+IXXokBCs5GRfOcBK7g3A+jXQ39K4YA8PBRW4m5+yR0ZAxWJncjRVbITvIAPHYRt1EJ3YLiUbqIvoKHtzHKtUy1ddRUQ0AUO41vonZDUOW+mrszw+SW/6Q/IUgNpcXFjkM7F4CSSQ2ExZg85otsMs7kqsQD4OxYeBNDcSpifjMoLb7GEbGWTwasVObmB/bfPcUlq0wYhXCYEDWRW02TP5bBrYsKTGWjnWDDJ1F7zWai0zW/2XsCuvBQjPFcTYaQX3tSXRSm8hsAoDdjArK/OFp6vcWYOE7lizP0Yc+8p16i7/NiXIiiQTp7c7Xus925VEtlKAjUdFhyaiLT7VxDagprMFwix4wZ05u0qj7cDWFd0W9OYHIu3JbJKMXRJ1aYNovugg+QqRN7fNHSi26VSgBpn+JfMuPo3aeqPWik/wI5Rz3BWarPQX4i5+dM0npwVOsX+KsOhC7vDg+OJsz4Q5zlnIeflUWL6QYMbf9WDfLmosLF4Qev3mJiOuHjoor/dMeBpA9iKDkMjYBNbRo414HCxjsHrB4EXNbHzNMDHCLuNBG6Sf+J4MZ/ElVsDSLxjIiGsTPhw8BPjxbfQtskj+dyNMKOOcUYIRBEIqbazz3lmjlRQhplxq673VklMMY6597vu+d89ec/zq7Mi4gQvh87ehYbpOuZEXj5g/Q7S7BFDAAB9DzG35SC853xtWVcnZQoH54jeOqYLR9NDuwxsVthTV7V99n/B7HSbAytbEyVTz/5NhJ8gGIjG0E5j3griULUd5Rg7tQR+90hJgNQKQH2btbSfPcaTOfIexc1db1BxUOhM1vWCpLaYuKr3FdNTt/T3PWCpEUWDKEtzYrjpzlL/wri3MITKsFvtF8QVV/NhVo97aKIBgdliNc10dWdXVDpVtsNn+2UIolrgqdWA4EY8so0YvB4a+aLzMXiMAuOHQrXY0tr+CL10JbvZzgjJJuB1cRkdT7DUqTvnswVUp5kkUSFVtIIFYK05+tQxT6992HHNWVhWxUsD1PkceIrlXuUVRogwmfdhyrf6zzaL8+c0L7GXMZOteAhAVQVwdJh+7nrX7x4LaIIfz2F2v7Dg/uDfz2Fa+4gFm2zHAor8UqimJG3VTJtZEoFXhnDYXvxMJFc6ku2bhbCxzij2z5UNuK0jmp1mnvkVNUfR+SEmj1Lr94Lym75PO7Fs0MIr3GdsWXRXSfgLTVY0FLqba97u1In8NAcY7IC6TjWLigwKEIm43NxTdaVTv9mcKkzuzBkKd8x/xt1p/9BbP7Wyb4bpo1K1gnOpbLvKz58pWl3B55RJ/Z5mRDLPtNQg14jdOEs9+h/V5UVpwrAI8kGbX8KPVPDIMfIqKDjJD9UyDOPhjZ3vFAyecwyq4akUE9mDOtJEK1hpDyi6Ae87sWAClXGTiwPwN7PXWwjxaR79ArHRIPeYKTunVW24sPr/3HPz2IwH8oKH4OlWEmt4BLM6W5g4kMcYbLwj2usodD1088stZA7VOsUSpEVl4w7NMb1EUHMRxAxLF0CIV+0L3iZb+ekB1vSDSFjAZ3hfLJf7gFaXrOKn+mhR+rWw/eTXIcAgl4HvFuBg1LOmOAwJH3eoVEjjwheKA4icbrQCmvAtpQ0mXG0agYp5mj4Rb6mdQ+RV4QBPbxMqh9C7o8nP0Wko2ocnCHeRGhN1XVyT2b9ACsL+6ylUy+yC3QEnaKRIJK91YtaoSrcWZMMwxuM0E9J68Z+YyjA0g8p1PfHAAIROy6Sa04VXOuT6A351FOWhKfTGsFJ3RTJGWYPoLk5FVK4OaYR9hkJvezwF9vQN1126r6isMGXWTqFW+3HL3I/jurlIdDWIVvYY+s6yq7lrFSPAGRdnU7PVwY/SvWbZGpXzy3BQ2LmAJlrONUsZs4oGkly0V267xbD5KMY8woNNsmWG1VVgLCra8aQBBcI4DP2BlNwxhiCtHlaz6OWFoCW0vMR3ErrG7JyMjTSCnvRcsEHgmPnwA6iNpJ2DrFb4gLlhKJyZGaWkA97H6FFdwEcLT6DRQQL++fOkVC4cYGW1TG/3iK5dShRSuiBulmihqgjR45Vi03o2RbQbP3sxt90VxQ6vzdlGfkXmmKmjOi080JSHkLntjvsBJnv7gKscOaTOkEaRQqAnCA4HWtB4XnMtOhpRmH2FH8tTXrIjAGNWEmudQLCkcVlGTQ965Kh0H6ixXbgImQP6b42B49sO5C8pc7iRlgyvSYvcnH9FgQ3azLbQG2cUW96SDojTQStxkOJyOuDGTHAnnWkz29aEwN9FT8EJ4yhXOg+jLTrCPKeEoJ9a7lDXOjEr8AgX4BmnMQ668oW0zYPyQiVMPxKRHtpfnEEyaKhdzNVThlxxDQNdrHeZiUFb6NoY2KwvSb7BnRcpJy+/g/zAYx3fYSN5QEaVD2Y1VsNWxB0BSO12MRsRY8JLfAezRMz5lURuLUnG1ToKk6Q30FughqWN6gBNcFxP/nY/iv+iaUQOa+2Nuym46wtI/DvSfzSp1jEi4SdYBE7YhTiVV5cX9gwboVDMVgZp5YBQlHOQvaDNfcCoCJuYhf5kz5kwiIKPjzgpcRJHPbOhJajeoeRL53cuMahhV8Z7IRr6M4hW0JzT7mzaMUzQpm866zwM7Cs07fJYXuWvjAMkbe5O6V4bu71sOG6JQ4oL8zIeXHheFVavzxmlIyBkgc9IZlEDplMPr8xlcyss4pVUdwK1e7CK2kTsSdq7g5SHRAl3pYUB9Ko4fsh4qleOyJv1z3KFSTSvwEcRO/Ew8ozEDYZSqpfoVW9uhJfYrNAXR0Z3VmeoAD+rVWtwP/13sE/3ICX3HhDG3CMc476dEEC0K3umSAD4j+ZQLVdFOsWL2C1TH5+4KiSWH+lMibo+B55hR3Gq40G1n25sGcN0mEcoU2wN9FCVyQLBhYOu9aHVLWjEKx2JIUZi5ySoHUAI9b8hGzaLMxCZDMLhv8MkcpTqEwz9KFDpCpqQhVmsGQN8m24wyB82FAKNmjgfKRsXRmsSESovAwXjBIoMKSG51p6Um8b3i7GISs7kjTq/PZoioCfJzfKdJTN0Q45kQEQuh9H88M3yEs3DbtRTKALraM0YC8laiMiOOe6ADmTcCiREeAWZelBaEXRaSuj2lx0xHaRYqF65O0Lo5OCFU18A8cMDE4MLYm9w2QSr9NgQAIcRxZsNpA7UJR0e71JL+VU+ISWFk5I97lra8uGg7GlQYhGd4Gc6rxsLFRiIeGO4abP4S4ekQ1fiqDCy87GZHd52fn5aaDGuvOmIofrzpVwMvtbreZ/855OaXTRcNiNE0wzGZSxbjg26v8ko8L537v/XCCWP2MFaArJpvnkep0pA+O86MWjRAZPQRfznZiSIaTppy6m3p6HrNSsY7fDtz7Cl4V/DJAjQDoyiL2uwf1UHVd2AIrzBUSlJaTj4k6NL97a/GqhWKU9RUmjnYKpm2r+JYUcrkCuZKvcYvrg8pDoUKQywY9GDWg03DUFSirlUXBS5SWn/KAntnf0IdHGL/7mwXqDG+LZYjbEdQmqUqq4y54TNmWUP7IgcAw5816YBzwiNIJiE9M4lPCzeI/FGBeYy3p6IAmH4AjXXmvQ4Iy0Y82NTobcAggT2Cdqz6Mx4TdGoq9fn2etrWKUNFyatAHydQTVUQ2S5OWVUlugcNvoUrlA8cJJz9MqOa/W3iVno4zDHfE7zhoY5f5lRTVZDhrQbR8LS4eRLz8iPMyBL6o4PiLlp89FjdokQLaSBmKHUwWp0na5fE3v9zny2YcDXG/jfI9sctulHRbdkI5a4GOPJx4oAJQzVZ/yYAado8KNZUdEFs9ZPiBsausotXMNebEgr0dyopuqfScFJ3ODNPHgclACPdccwv0YJGQdsN2lhoV4HVGBxcEUeUX/alr4nqpcc1CCR3vR7g40zteQg/JvWmFlUE4mAiTpHlYGrB7w+U2KdSwQz2QJKBe/5eiixWipmfP15AFWrK8Sh1GBBYLgzki1wTMhGQmagXqJ2+FuqJ8f0XzXCVJFHQdMAw8xco11HhM347alrAu+wmX3pDFABOvkC+WPX0Uhg1Z5MVHKNROxaR84YV3s12UcM+70cJ460SzEaKLyh472vOMD3XnaK7zxZcXlWqenEvcjmgGNR2OKbI1s8U+iwiW+HotHalp3e1MGDy6BMVIvajnAzkFHbeVsgjmJUkrP9OAwnEHYXVBqYx3q7LvXjoVR0mY8h+ZaOnh053pdsGkmbqhyryN01eVHySr+CkDYkSMeZ1xjPNVM+gVLTDKu2VGsMUJqWO4TwPDP0VOg2/8ITbAUaMGb4LjL7L+Pi11lEVMXTYIlAZ/QHmTENjyx3kDkBdfcvvQt6tKk6jYFM4EG5UXDTaF5+1ZjRz6W7MdJPC+wTkbDUim4p5QQH3b9kGk2Bkilyeur8Bc20wm5uJSBO95GfYDI1EZipoRaH7uVveneqz43tlTZGRQ4a7CNmMHgXyOQQOL6WQkgMUTQDT8vh21aSdz7ERiZT1jK9F+v6wgFvuEmGngSvIUR2CJkc5tx1QygfZnAruONobB1idCLB1FCfO7N1ZdRocT8/Wye+EnDiO9pzqIpnLDl4bkaRKW+ekBVwHn46Shw1X0tclt/0ROijuUB4kIInrVJU4buWf4YITJtjOJ6iKdr1u+flgQeFH70GxKjhdgt/MrwfB4K/sXczQ+9zYcrD4dhY6qZhZ010rrxggWA8JaZyg2pYij8ieYEg1aZJkZK9O1Re7sB0iouf60rK0Gd+AYlp7soqCBCDGwfKeUQhCBn0E0o0GS6PdmjLi0TtCYZeqazqwN+yNINIA8Lk3iPDnWUiIPLGNcHmZDxfeK0iAdxm/T7LnN+gemRL61hHIc0NCAZaiYJR+OHnLWSe8sLrK905B5eEJHNlWq4RmEXIaFTmo49f8w61+NwfEUyuJAwVqZCLFcyHBKAcIVj3sNzfEOXzVKIndxHw+AR93owhbCxUZf6Gs8cz6/1VdrFEPrv330+9s6BtMVPJ3zl/Uf9rUi0Z/opexfdL3ykF76e999GPfVv8fJv/Y/+/5hEMon1tqNFyVRevV9y9/uIvsG3dbB8GRRrgaEXfhx+2xeOFt+cEn3RZanNxdEe2+B6MHpNbrRE53PlDifPvFcp4kO78ILR0T4xyW/WGPyBsqGdoA7zJJCu1TKbGfhnqgnRbxbB2B3UZoeQ2bz2sTVnUwokTcTU21RxN1PYPS3Sar7T0eRIsyCNowr9amwoMU/od9s2APtiKNL6ENOlyKADstAEWKA+sdKDhrJ6BOhRJmZ+QJbAaZ3/5Fq0/lumCgEzGEbu3yi0Y4I4EgVAjqxh4HbuQn0GrRhOWyAfsglQJAVL1y/6yezS2k8RE2MstJLh92NOB3GCYgFXznF4d25qiP4ZCyI4RYGesut6FXK6GwPpKK8WHEkhYui0AyEmr5Ml3uBFtPFdnioI8RiCooa7Z1G1WuyIi3nSNglutc+xY8BkeW3JJXPK6jd2VIMpaSxpVtFq+R+ySK9J6WG5Qvt+C+QH1hyYUOVK7857nFmyDBYgZ/o+AnibzNVqyYCJQvyDXDTK+iXdkA71bY7TL3bvuLxLBQ8kbTvTEY9aqkQ3+MiLWbEgjLzOH+lXgco1ERgzd80rDCymlpaRQbOYnKG/ODoFl46lzT0cjM5FYVvv0qLUbD5lyJtMUaC1pFlTkNONx6lliaX9o0i/1vws5bNKn5OuENQEKmLlcP4o2ZmJjD4zzd3Fk32uQ4uRWkPSUqb4LBe3EXHdORNB2BWsws5daRnMfNVX7isPSb1hMQdAJi1/qmDMfRUlCU74pmnzjbXfL8PVG8NsW6IQM2Ne23iCPIpryJjYbVnm5hCvKpMa7HLViNiNc+xTfDIaKm3jctViD8A1M9YPJNk003VVr4Zo2MuGW8vil8SLaGpPXqG7I4DLdtl8a4Rbx1Lt4w5Huqaa1XzZBtj208EJVGcmKYEuaeN27zT9EE6a09JerXdEbpaNgNqYJdhP1NdqiPKsbDRUi86XvvNC7rME5mrSQtrzAZVndtSjCMqd8BmaeGR4l4YFULGRBeXIV9Y4yxLFdyoUNpiy2IhePSWzBofYPP0eIa2q5JP4j9G8at/AqoSsLAUuRXtvgsqX/zYwsE+of6oSDbUOo4RMJw+DOUTJq+hnqwKim9Yy/napyZNTc2rCq6V9jHtJbxGPDwlzWj/Sk3zF/BHOlT/fSjSq7FqlPI1q6J+ru8Aku008SFINXZfOfnZNOvGPMtEmn2gLPt+H4QLA+/SYe4j398auzhKIp2Pok3mPC5q1IN1HgR+mnEfc4NeeHYwd2/kpszR3cBn7ni9NbIqhtSWFW8xbUJuUPVOeeXu3j0IGZmFNiwaNZ6rH4/zQ2ODz6tFxRLsUYZu1bfd1uIvfQDt4YD/efKYv8VF8bHGDgK22w2Wqwpi43vNCOXFJZCGMqWiPbL8mil6tsmOTXAWCyMCw73e2rADZj2IK6rqksM3EXF2cbLb4vjB14wa/yXK5vwU+05MzERJ5nXsXsW21o7M+gO0js2OyKciP5uF2iXyb2DiptwQeHeqygkrNsqVCSlldxBMpwHi1vfc8RKpP/4L3Lmpq6DZcvhDDfxTCE3splacTcOtXdK2g303dIWBVe2wD/Gvja1cClFQ67gw0t1ZUttsUgQ1Veky8oOpS6ksYEc4bqseCbZy766SvL3FodmnahlWJRgVCNjPxhL/fk2wyvlKhITH/VQCipOI0dNcRa5B1M5HmOBjTLeZQJy237e2mobwmDyJNHePhdDmiknvLKaDbShL+Is1XTCJuLQd2wmdJL7+mKvs294whXQD+vtd88KKk0DXP8B1Xu9J+xo69VOuFgexgTrcvI6SyltuLix9OPuE6/iRJYoBMEXxU4shQMf4Fjqwf1PtnJ/wWSZd29rhZjRmTGgiGTAUQqRz+nCdjeMfYhsBD5Lv60KILWEvNEHfmsDs2L0A252351eUoYxAysVaCJVLdH9QFWAmqJDCODUcdoo12+gd6bW2boY0pBVHWL6LQDK5bYWh1V8vFvi0cRpfwv7cJiMX3AZNJuTddHehTIdU0YQ/sQ1dLoF2xQPcCuHKiuCWOY30DHe1OwcClLAhqAKyqlnIbH/8u9ScJpcS4kgp6HKDUdiOgRaRGSiUCRBjzI5gSksMZKqy7Sd51aeg0tgJ+x0TH9YH2Mgsap9N7ENZdEB0bey2DMTrBA1hn56SErNHf3tKtqyL9b6yXEP97/rc+jgD2N1LNUH6RM9AzP3kSipr06RkKOolR7HO768jjWiH1X92jA7dkg7gcNcjqsZCgfqWw0tPXdLg20cF6vnQypg7gLtkazrHAodyYfENPQZsdfnjMZiNu4nJO97D1/sQE+3vNFzrSDOKw+keLECYf7RJwVHeP/j79833oZ0egonYB2FlFE5qj02B/LVOMJQlsB8uNg3Leg4qtZwntsOSNidR0abbZmAK4sCzvt8Yiuz2yrNCJoH5O8XvX/vLeR/BBYTWj0sOPYM/jyxRd5+/JziKAABaPcw/34UA3aj/gLZxZgRCWN6m4m3demanNgsx0P237/Q+Ew5VYnJPkyCY0cIVHoFn2Ay/e7U4P19APbPFXEHX94N6KhEMPG7iwB3+I+O1jd5n6VSgHegxgaSawO6iQCYFgDsPSMsNOcUj4q3sF6KzGaH/0u5PQoAj/8zq6Uc9MoNrGqhYeb2jQo0WlGlXjxtanZLS24/OIN5Gx/2g684BPDQpwlqnkFcxpmP/osnOXrFuu4PqifouQH0eF5qCkvITQbJw/Zvy5mAHWC9oU+cTiYhJmSfKsCyt1cGVxisKu+NymEQIAyaCgud/V09qT3nk/9s/SWsYtha7yNpzBIMM40rCSGaJ9u6lEkl00vXBiEt7p9P5IBCiavynEOv7FgLqPdeqxRiCwuFVMolSIUBcoyfUC2e2FJSAUgYdVGFf0b0Kn2EZlK97yyxrT2MVgvtRikfdaAW8RwEEfN+B7/eK8bBdp7URpbqn1xcrC6d2UjdsKbzCjBFqkKkoZt7Mrhg6YagE7spkqj0jOrWM+UGQ0MUlG2evP1uE1p2xSv4dMK0dna6ENcNUF+xkaJ7B764NdxLCpuvhblltVRAf7vK5qPttJ/9RYFUUSGcLdibnz6mf7WkPO3MkUUhR2mAOuGv8IWw5XG1ZvoVMnjSAZe6T7WYA99GENxoHkMiKxHlCuK5Gd0INrISImHQrQmv6F4mqU/TTQ8nHMDzCRivKySQ8dqkpQgnUMnwIkaAuc6/FGq1hw3b2Sba398BhUwUZSAIO8XZvnuLdY2n6hOXws+gq9BHUKcKFA6kz6FDnpxLPICa3qGhnc97bo1FT/XJk48LrkHJ2CAtBv0RtN97N21plfpXHvZ8gMJb7Zc4cfI6MbPwsW7AilCSXMFIEUEmir8XLEklA0ztYbGpTTGqttp5hpFTTIqUyaAIqvMT9A/x+Ji5ejA4Bhxb/cl1pUdOD6epd3yilIdO6j297xInoiBPuEDW2/UfslDyhGkQs7Wy253bVnlT+SWg89zYIK/9KXFl5fe+jow2rd5FXv8zDPrmfMXiUPt9QBO/iK4QGbX5j/7Rx1c1vzsY8ONbP3lVIaPrhL4+1QrECTN3nyKavGG0gBBtHvTKhGoBHgMXHStFowN+HKrPriYu+OZ05Frn8okQrPaaxoKP1ULCS/cmKFN3gcH7HQlVjraCeQmtjg1pSQxeuqXiSKgLpxc/1OiZsU4+n4lz4hpahGyWBURLi4642n1gn9qz9bIsaCeEPJ0uJmenMWp2tJmIwLQ6VSgDYErOeBCfSj9P4G/vI7oIF+l/n5fp956QgxGvur77ynawAu3G9MdFbJbu49NZnWnnFcQHjxRuhUYvg1U/e84N4JTecciDAKb/KYIFXzloyuE1eYXf54MmhjTq7B/yBToDzzpx3tJCTo3HCmVPYfmtBRe3mPYEE/6RlTIxbf4fSOcaKFGk4gbaUWe44hVk9SZzhW80yfW5QWBHxmtUzvMhfVQli4gZTktIOZd9mjJ5hsbmzttaHQB29Am3dZkmx3g/qvYocyhZ2PXAWsNQiIaf+Q8W/MWPIK7/TjvCx5q2XRp4lVWydMc2wIQkhadDB0xsnw/kSEyGjLKjI4coVIwtubTF3E7MJ6LS6UOsJKj82XVAVPJJcepfewbzE91ivXZvOvYfsmMevwtPpfMzGmC7WJlyW2j0jh7AF1JLmwEJSKYwIvu6DHc3YnyLH9ZdIBnQ+nOVDRiP+REpqv++typYHIvoJyICGA40d8bR7HR2k7do6UQTHF4oriYeIQbxKe4Th6+/l1BjUtS9hqORh3MbgvYrStXTfSwaBOmAVQZzpYNqsAmQyjY56MUqty3c/xH6GuhNvNaG9vGbG6cPtBM8UA3e8r51D0AR9kozKuGGSMgLz3nAHxDNnc7GTwpLj7/6HeWp1iksDeTjwCLpxejuMtpMnGJgsiku1sOACwQ9ukzESiDRN77YNESxR5LphOlcASXA5uIts1LnBIcn1J7BLWs49DMALSnuz95gdOrTZr0u1SeYHinno/pE58xYoXbVO/S+FEMMs5qyWkMnp8Q3ClyTlZP52Y9nq7b8fITPuVXUk9ohG5EFHw4gAEcjFxfKb3xuAsEjx2z1wxNbSZMcgS9GKyW3R6KwJONgtA64LTyxWm8Bvudp0M1FdJPEGopM4Fvg7G/hsptkhCfHFegv4ENwxPeXmYhxwZy7js+BeM27t9ODBMynVCLJ7RWcBMteZJtvjOYHb5lOnCLYWNEMKC59BA7covu1cANa2PXL05iGdufOzkgFqqHBOrgQVUmLEc+Mkz4Rq8O6WkNr7atNkH4M8d+SD1t/tSzt3oFql+neVs+AwEI5JaBJaxARtY2Z4mKoUqxds4UpZ0sv3zIbNoo0J4fihldQTX3XNcuNcZmcrB5LTWMdzeRuAtBk3cZHYQF6gTi3PNuDJ0nmR+4LPLoHvxQIxRgJ9iNNXqf2SYJhcvCtJiVWo85TsyFOuq7EyBPJrAdhEgE0cTq16FQXhYPJFqSfiVn0IQnPOy0LbU4BeG94QjdYNB0CiQ3QaxQqD2ebSMiNjaVaw8WaM4Z5WnzcVDsr4eGweSLa2DE3BWViaxhZFIcSTjgxNCAfelg+hznVOYoe5VqTYs1g7WtfTm3e4/WduC6p+qqAM8H4ZyrJCGpewThTDPe6H7CzX/zQ8Tm+r65HeZn+MsmxUciEWPlAVaK/VBaQBWfoG/aRL/jSZIQfep/89GjasWmbaWzeEZ2R1FOjvyJT37O9B8046SRSKVEnXWlBqbkb5XCS3qFeuE9xb9+frEknxWB5h1D/hruz2iVDEAS7+qkEz5Ot5agHJc7WCdY94Ws61sURcX5nG8UELGBAHZ3i+3VulAyT0nKNNz4K2LBHBWJcTBX1wzf+//u/j/9+//v87+9/l9Lbh/L/uyNYiTsWV2LwsjaA6MxTuzFMqmxW8Jw/+IppdX8t/Clgi1rI1SN0UC/r6tX/4lUc2VV1OQReSeCsjUpKZchw4XUcjHfw6ryCV3R8s6VXm67vp4n+lcPV9gJwmbKQEsmrJi9c2vkwrm8HFbVYNTaRGq8D91t9n5+U+aD/hNtN3HjC/nC/vUoGFSCkXP+NlRcmLUqLbiUBl4LYf1U/CCvwtd3ryCH8gUmGITAxiH1O5rnGTz7y1LuFjmnFGQ1UWuM7HwfXtWl2fPFKklYwNUpF2IL/TmaRETjQiM5SJacI+3Gv5MBU8lP5Io6gWkawpyzNEVGqOdx4YlO1dCvjbWFZWbCmeiFKPSlMKtKcMFLs/KQxtgAHi7NZNCQ32bBAW2mbHflVZ8wXKi1JKVHkW20bnYnl3dKWJeWJOiX3oKPBD6Zbi0ZvSIuWktUHB8qDR8DMMh1ZfkBL9FS9x5r0hBGLJ8pUCJv3NYH+Ae8p40mZWd5m5fhobFjQeQvqTT4VKWIYfRL0tfaXKiVl75hHReuTJEcqVlug+eOIIc4bdIydtn2K0iNZPsYWQvQio2qbO3OqAlPHDDOB7DfjGEfVF51FqqNacd6QmgFKJpMfLp5DHTv4wXlONKVXF9zTJpDV4m1sYZqJPhotcsliZM8yksKkCkzpiXt+EcRQvSQqmBS9WdWkxMTJXPSw94jqI3varCjQxTazjlMH8jTS8ilaW8014/vwA/LNa+YiFoyyx3s/KswP3O8QW1jtq45yTM/DX9a8M4voTVaO2ebvw1EooDw/yg6Y1faY+WwrdVs5Yt0hQ5EwRfYXSFxray1YvSM+kYmlpLG2/9mm1MfmbKHXr44Ih8nVKb1M537ZANUkCtdsPZ80JVKVKabVHCadaLXg+IV8i5GSwpZti0h6diTaKs9sdpUKEpd7jDUpYmHtiX33SKiO3tuydkaxA7pEc9XIQEOfWJlszj5YpL5bKeQyT7aZSBOamvSHl8xsWvgo26IP/bqk+0EJUz+gkkcvlUlyPp2kdKFtt7y5aCdks9ZJJcFp5ZWeaWKgtnXMN3ORwGLBE0PtkEIek5FY2aVssUZHtsWIvnljMVJtuVIjpZup/5VL1yPOHWWHkOMc6YySWMckczD5jUj2mlLVquFaMU8leGVaqeXis+aRRL8zm4WuBk6cyWfGMxgtr8useQEx7k/PvRoZyd9nde1GUCV84gMX8Ogu/BWezYPSR27llzQnA97oo0pYyxobYUJfsj+ysTm9zJ+S4pk0TGo9VTG0KjqYhTmALfoDZVKla2b5yhv241PxFaLJs3i05K0AAIdcGxCJZmT3ZdT7CliR7q+kur7WdQjygYtOWRL9B8E4s4LI8KpAj7bE0dg7DLOaX+MGeAi0hMMSSWZEz+RudXbZCsGYS0QqiXjH9XQbd8sCB+nIVTq7/T/FDS+zWY9q7Z2fdq1tdLb6v3hKKVDAw5gjj6o9r1wHFROdHc18MJp4SJ2Ucvu+iQ9EgkekW8VCM+psM6y+/2SBy8tNN4a3L1MzP+OLsyvESo5gS7IQOnIqMmviJBVc6zbVG1n8eXiA3j46kmvvtJlewwNDrxk4SbJOtP/TV/lIVK9ueShNbbMHfwnLTLLhbZuO79ec5XvfgRwLFK+w1r5ZWW15rVFZrE+wKqNRv5KqsLNfpGgnoUU6Y71NxEmN7MyqwqAQqoIULOw/LbuUB2+uE75gJt+kq1qY4LoxV+qR/zalupea3D5+WMeaRIn0sAI6DDWDh158fqUb4YhAxhREbUN0qyyJYkBU4V2KARXDT65gW3gRsiv7xSPYEKLwzgriWcWgPr0sbZnv7m1XHNFW6xPdGNZUdxFiUYlmXNjDVWuu7LCkX/nVkrXaJhiYktBISC2xgBXQnNEP+cptWl1eG62a7CPXrnrkTQ5BQASbEqUZWMDiZUisKyHDeLFOaJILUo5f6iDt4ZO8MlqaKLto0AmTHVVbkGuyPa1R/ywZsWRoRDoRdNMMHwYTsklMVnlAd2S0282bgMI8fiJpDh69OSL6K3qbo20KfpNMurnYGQSr/stFqZ7hYsxKlLnKAKhsmB8AIpEQ4bd/NrTLTXefsE6ChRmKWjXKVgpGoPs8GAicgKVw4K0qgDgy1A6hFq1WRat3fHF+FkU+b6H4NWpOU3KXTxrIb2qSHAb+qhm8hiSROi/9ofapjxhyKxxntPpge6KL5Z4+WBMYkAcE6+0Hd3Yh2zBsK2MV3iW0Y6cvOCroXlRb2MMJtdWx+3dkFzGh2Pe3DZ9QpSqpaR/rE1ImOrHqYYyccpiLC22amJIjRWVAherTfpQLmo6/K2pna85GrDuQPlH1Tsar8isAJbXLafSwOof4gg9RkAGm/oYpBQQiPUoyDk2BCQ1k+KILq48ErFo4WSRhHLq/y7mgw3+L85PpP6xWr6cgp9sOjYjKagOrxF148uhuaWtjet953fh1IQiEzgC+d2IgBCcUZqgTAICm2bR8oCjDLBsmg+ThyhfD+zBalsKBY1Ce54Y/t9cwfbLu9SFwEgphfopNA3yNxgyDafUM3mYTovZNgPGdd4ZFFOj1vtfFW3u7N+iHEN1HkeesDMXKPyoCDCGVMo4GCCD6PBhQ3dRZIHy0Y/3MaE5zU9mTCrwwnZojtE+qNpMSkJSpmGe0EzLyFelMJqhfFQ7a50uXxZ8pCc2wxtAKWgHoeamR2O7R+bq7IbPYItO0esdRgoTaY38hZLJ5y02oIVwoPokGIzxAMDuanQ1vn2WDQ00Rh6o5QOaCRu99fwDbQcN0XAuqkFpxT/cfz3slGRVokrNU0iqiMAJFEbKScZdmSkTUznC0U+MfwFOGdLgsewRyPKwBZYSmy6U325iUhBQNxbAC3FLKDV9VSOuQpOOukJ/GAmu/tyEbX9DgEp6dv1zoU0IqzpG6gssSjIYRVPGgU1QAQYRgIT8gEV0EXr1sqeh2I6rXjtmoCYyEDCe/PkFEi/Q48FuT29p557iN+LCwk5CK/CZ2WdAdfQZh2Z9QGrzPLSNRj5igUWzl9Vi0rCqH8G1Kp4QMLkuwMCAypdviDXyOIk0AHTM8HBYKh3b0/F+DxoNj4ZdoZfCpQVdnZarqoMaHWnMLNVcyevytGsrXQEoIbubqWYNo7NRHzdc0zvT21fWVirj7g36iy6pxogfvgHp1xH1Turbz8QyyHnXeBJicpYUctbzApwzZ1HT+FPEXMAgUZetgeGMwt4G+DHiDT2Lu+PT21fjJCAfV16a/Wu1PqOkUHSTKYhWW6PhhHUlNtWzFnA7MbY+r64vkwdpfNB2JfWgWXAvkzd42K4lN9x7Wrg4kIKgXCb4mcW595MCPJ/cTfPAMQMFWwnqwde4w8HZYJFpQwcSMhjVz4B8p6ncSCN1X4klxoIH4BN2J6taBMj6lHkAOs8JJAmXq5xsQtrPIPIIp/HG6i21xMGcFgqDXSRF0xQg14d2uy6HgKE13LSvQe52oShF5Jx1R6avyL4thhXQZHfC94oZzuPUBKFYf1VvDaxIrtV6dNGSx7DO0i1p6CzBkuAmEqyWceQY7F9+U0ObYDzoa1iKao/cOD/v6Q9gHrrr1uCeOk8fST9MG23Ul0KmM3r+Wn6Hi6WAcL7gEeaykicvgjzkjSwFsAXIR81Zx4QJ6oosVyJkCcT+4xAldCcihqvTf94HHUPXYp3REIaR4dhpQF6+FK1H0i9i7Pvh8owu3lO4PT1iuqu+DkL2Bj9+kdfGAg2TXw03iNHyobxofLE2ibjsYDPgeEQlRMR7afXbSGQcnPjI2D+sdtmuQ771dbASUsDndU7t58jrrNGRzISvwioAlHs5FA+cBE5Ccznkd8NMV6BR6ksnKLPZnMUawRDU1MZ/ib3xCdkTblHKu4blNiylH5n213yM0zubEie0o4JhzcfAy3H5qh2l17uLooBNLaO+gzonTH2uF8PQu9EyH+pjGsACTMy4cHzsPdymUSXYJOMP3yTkXqvO/lpvt0cX5ekDEu9PUfBeZODkFuAjXCaGdi6ew4qxJ8PmFfwmPpkgQjQlWqomFY6UkjmcnAtJG75EVR+NpzGpP1Ef5qUUbfowrC3zcSLX3BxgWEgEx/v9cP8H8u1Mvt9/rMDYf6sjwU1xSOPBgzFEeJLMRVFtKo5QHsUYT8ZRLCah27599EuqoC9PYjYO6aoAMHB8X1OHwEAYouHfHB3nyb2B+SnZxM/vw/bCtORjLMSy5aZoEpvgdGvlJfNPFUu/p7Z4VVK1hiI0/UTuB3ZPq4ohEbm7Mntgc1evEtknaosgZSwnDC2BdMmibpeg48X8Ixl+/8+xXdbshQXUPPvx8jT3fkELivHSmqbhblfNFShWAyQnJ3WBU6SMYSIpTDmHjdLVAdlADdz9gCplZw6mTiHqDwIsxbm9ErGusiVpg2w8Q3khKV/R9Oj8PFeF43hmW/nSd99nZzhyjCX3QOZkkB6BsH4H866WGyv9E0hVAzPYah2tkRfQZMmP2rinfOeQalge0ovhduBjJs9a1GBwReerceify49ctOh5/65ATYuMsAkVltmvTLBk4oHpdl6i+p8DoNj4Fb2vhdFYer2JSEilEwPd5n5zNoGBXEjreg/wh2NFnNRaIUHSOXa4eJRwygZoX6vnWnqVdCRT1ARxeFrNBJ+tsdooMwqnYhE7zIxnD8pZH+P0Nu1wWxCPTADfNWmqx626IBJJq6NeapcGeOmbtXvl0TeWG0Y7OGGV4+EHTtNBIT5Wd0Bujl7inXgZgfXTM5efD3qDTJ54O9v3Bkv+tdIRlq1kXcVD0BEMirmFxglNPt5pedb1AnxuCYMChUykwsTIWqT23XDpvTiKEru1cTcEMeniB+HQDehxPXNmkotFdwUPnilB/u4Nx5Xc6l8J9jH1EgKZUUt8t8cyoZleDBEt8oibDmJRAoMKJ5Oe9CSWS5ZMEJvacsGVdXDWjp/Ype5x0p9PXB2PAwt2LRD3d+ftNgpuyvxlP8pB84oB1i73vAVpwyrmXW72hfW6Dzn9Jkj4++0VQ4d0KSx1AsDA4OtXXDo63/w+GD+zC7w5SJaxsmnlYRQ4dgdjA7tTl2KNLnpJ+mvkoDxtt1a4oPaX3EVqj96o9sRKBQqU7ZOiupeAIyLMD+Y3YwHx30XWHB5CQiw7q3mj1EDlP2eBsZbz79ayUMbyHQ7s8gu4Lgip1LiGJj7NQj905/+rgUYKAA5qdrlHKIknWmqfuR+PB8RdBkDg/NgnlT89G72h2NvySnj7UyBwD+mi/IWs1xWbxuVwUIVXun5cMqBtFbrccI+DILjsVQg6eeq0itiRfedn89CvyFtpkxaauEvSANuZmB1p8FGPbU94J9medwsZ9HkUYjmI7OH5HuxendLbxTaYrPuIfE2ffXFKhoNBUp33HsFAXmCV/Vxpq5AYgFoRr5Ay93ZLRlgaIPjhZjXZZChT+aE5iWAXMX0oSFQEtwjiuhQQItTQX5IYrKfKB+queTNplR1Hoflo5/I6aPPmACwQCE2jTOYo5Dz1cs7Sod0KTG/3kEDGk3kUaUCON19xSJCab3kNpWZhSWkO8l+SpW70Wn3g0ciOIJO5JXma6dbos6jyisuxXwUUhj2+1uGhcvuliKtWwsUTw4gi1c/diEEpZHoKoxTBeMDmhPhKTx7TXWRakV8imJR355DcIHkR9IREHxohP4TbyR5LtFU24umRPRmEYHbpe1LghyxPx7YgUHjNbbQFRQhh4KeU1EabXx8FS3JAxp2rwRDoeWkJgWRUSKw6gGP5U2PuO9V4ZuiKXGGzFQuRuf+tkSSsbBtRJKhCi3ENuLlXhPbjTKD4djXVnfXFds6Zb+1XiUrRfyayGxJq1+SYBEfbKlgjiSmk0orgTqzSS+DZ5rTqsJbttiNtp+KMqGE2AHGFw6jQqM5vD6vMptmXV9OAjq49Uf/Lx9Opam+Hn5O9p8qoBBAQixzQZ4eNVkO9sPzJAMyR1y4/RCQQ1s0pV5KAU5sKLw3tkcFbI/JqrjCsK4Mw+W8aod4lioYuawUiCyVWBE/qPaFi5bnkgpfu/ae47174rI1fqQoTbW0HrU6FAejq7ByM0V4zkZTg02/YJK2N7hUQRCeZ4BIgSEqgD8XsjzG6LIsSbuHoIdz/LhFzbNn1clci1NHWJ0/6/O8HJMdIpEZbqi1RrrFfoo/rI/7ufm2MPG5lUI0IYJ4MAiHRTSOFJ2oTverFHYXThkYFIoyFx6rMYFgaOKM4xNWdlOnIcKb/suptptgTOTdVIf4YgdaAjJnIAm4qNNHNQqqAzvi53GkyRCEoseUBrHohZsjUbkR8gfKtc/+Oa72lwxJ8Mq6HDfDATbfbJhzeIuFQJSiw1uZprHlzUf90WgqG76zO0eCB1WdPv1IT6sNxxh91GEL2YpgC97ikFHyoaH92ndwduqZ6IYjkg20DX33MWdoZk7QkcKUCgisIYslOaaLyvIIqRKWQj16jE1DlQWJJaPopWTJjXfixEjRJJo8g4++wuQjbq+WVYjsqCuNIQW3YjnxKe2M5ZKEqq+cX7ZVgnkbsU3RWIyXA1rxv4kGersYJjD//auldXGmcEbcfTeF16Y1708FB1HIfmWv6dSFi6oD4E+RIjCsEZ+kY7dKnwReJJw3xCjKvi3kGN42rvyhUlIz0Bp+fNSV5xwFiuBzG296e5s/oHoFtUyUplmPulIPl+e1CQIQVtjlzLzzzbV+D/OVQtYzo5ixtMi5BmHuG4N/uKfJk5UIREp7+12oZlKtPBomXSzAY0KgtbPzzZoHQxujnREUgBU+O/jKKhgxVhRPtbqyHiUaRwRpHv7pgRPyUrnE7fYkVblGmfTY28tFCvlILC04Tz3ivkNWVazA+OsYrxvRM/hiNn8Fc4bQBeUZABGx5S/xFf9Lbbmk298X7iFg2yeimvsQqqJ+hYbt6uq+Zf9jC+Jcwiccd61NKQtFvGWrgJiHB5lwi6fR8KzYS7EaEHf/ka9EC7H8D+WEa3TEACHBkNSj/cXxFeq4RllC+fUFm2xtstYLL2nos1DfzsC9vqDDdRVcPA3Ho95aEQHvExVThXPqym65llkKlfRXbPTRiDepdylHjmV9YTWAEjlD9DdQnCem7Aj/ml58On366392214B5zrmQz/9ySG2mFqEwjq5sFl5tYJPw5hNz8lyZPUTsr5E0F2C9VMPnZckWP7+mbwp/BiN7f4kf7vtGnZF2JGvjK/sDX1RtcFY5oPQnE4lIAYV49U3C9SP0LCY/9i/WIFK9ORjzM9kG/KGrAuwFmgdEpdLaiqQNpCTGZVuAO65afkY1h33hrqyLjZy92JK3/twdj9pafFcwfXONmPQWldPlMe7jlP24Js0v9m8bIJ9TgS2IuRvE9ZVRaCwSJYOtAfL5H/YS4FfzKWKbek+GFulheyKtDNlBtrdmr+KU+ibHTdalzFUmMfxw3f36x+3cQbJLItSilW9cuvZEMjKw987jykZRlsH/UI+HlKfo2tLwemBEeBFtmxF2xmItA/dAIfQ+rXnm88dqvXa+GapOYVt/2waFimXFx3TC2MUiOi5/Ml+3rj/YU6Ihx2hXgiDXFsUeQkRAD6wF3SCPi2flk7XwKAA4zboqynuELD312EJ88lmDEVOMa1W/K/a8tGylZRMrMoILyoMQzzbDJHNZrhH77L9qSC42HVmKiZ5S0016UTp83gOhCwz9XItK9fgXfK3F5d7nZCBUekoLxrutQaPHa16Rjsa0gTrzyjqTnmcIcrxg6X6dkKiucudc0DD5W4pJPf0vuDW8r5/uw24YfMuxFRpD2ovT2mFX79xH6Jf+MVdv2TYqR6/955QgVPe3JCD/WjAYcLA9tpXgFiEjge2J5ljeI/iUzg91KQuHkII4mmHZxC3XQORLAC6G7uFn5LOmlnXkjFdoO976moNTxElS8HdxWoPAkjjocDR136m2l+f5t6xaaNgdodOvTu0rievnhNAB79WNrVs6EsPgkgfahF9gSFzzAd+rJSraw5Mllit7vUP5YxA843lUpu6/5jAR0RvH4rRXkSg3nE+O5GFyfe+L0s5r3k05FyghSFnKo4TTgs07qj4nTLqOYj6qaW9knJTDkF5OFMYbmCP+8H16Ty482OjvERV6OFyw043L9w3hoJi408sR+SGo1WviXUu8d7qS+ehKjpKwxeCthsm2LBFSFeetx0x4AaKPxtp3CxdWqCsLrB1s/j5TAhc1jNZsXWl6tjo/WDoewxzg8T8NnhZ1niUwL/nhfygLanCnRwaFGDyLw+sfZhyZ1UtYTp8TYB6dE7R3VsKKH95CUxJ8u8N+9u2/9HUNKHW3x3w5GQrfOPafk2w5qZq8MaHT0ebeY3wIsp3rN9lrpIsW9c1ws3VNV+JwNz0Lo9+V7zZr6GD56We6gWVIvtmam5GPPkVAbr74r6SwhuL+TRXtW/0pgyX16VNl4/EAD50TnUPuwrW6OcUO2VlWXS0inq872kk7GUlW6o/ozFKq+Sip6LcTtSDfDrPTcCHhx75H8BeRon+KG2wRwzfDgWhALmiWOMO6h3pm1UCZEPEjScyk7tdLx6WrdA2N1QTPENvNnhCQjW6kl057/qv7IwRryHrZBCwVSbLLnFRiHdTwk8mlYixFt1slEcPD7FVht13HyqVeyD55HOXrh2ElAxJyinGeoFzwKA91zfrdLvDxJSjzmImfvTisreI25EDcVfGsmxLVbfU8PGe/7NmWWKjXcdTJ11jAlVIY/Bv/mcxg/Q10vCHwKG1GW/XbJq5nxDhyLqiorn7Wd7VEVL8UgVzpHMjQ+Z8DUgSukiVwWAKkeTlVVeZ7t1DGnCgJVIdBPZAEK5f8CDyDNo7tK4/5DBjdD5MPV86TaEhGsLVFPQSI68KlBYy84FievdU9gWh6XZrugvtCZmi9vfd6db6V7FmoEcRHnG36VZH8N4aZaldq9zZawt1uBFgxYYx+Gs/qW1jwANeFy+LCoymyM6zgG7j8bGzUyLhvrbJkTYAEdICEb4kMKusKT9V3eIwMLsjdUdgijMc+7iKrr+TxrVWG0U+W95SGrxnxGrE4eaJFfgvAjUM4SAy8UaRwE9j6ZQH5qYAWGtXByvDiLSDfOD0yFA3UCMKSyQ30fyy1mIRg4ZcgZHLNHWl+c9SeijOvbOJxoQy7lTN2r3Y8p6ovxvUY74aOYbuVezryqXA6U+fcp6wSV9X5/OZKP18tB56Ua0gMyxJI7XyNT7IrqN8GsB9rL/kP5KMrjXxgqKLDa+V5OCH6a5hmOWemMUsea9vQl9t5Oce76PrTyTv50ExOqngE3PHPfSL//AItPdB7kGnyTRhVUUFNdJJ2z7RtktZwgmQzhBG/G7QsjZmJfCE7k75EmdIKH7xlnmDrNM/XbTT6FzldcH/rcRGxlPrv4qDScqE7JSmQABJWqRT/TUcJSwoQM+1jvDigvrjjH8oeK2in1S+/yO1j8xAws/T5u0VnIvAPqaE1atNuN0cuRliLcH2j0nTL4JpcR7w9Qya0JoaHgsOiALLCCzRkl1UUESz+ze/gIXHGtDwgYrK6pCFKJ1webSDog4zTlPkgXZqxlQDiYMjhDpwTtBW2WxthWbov9dt2X9XFLFmcF+eEc1UaQ74gqZiZsdj63pH1qcv3Vy8JYciogIVKsJ8Yy3J9w/GhjWVSQAmrS0BPOWK+RKV+0lWqXgYMnIFwpcZVD7zPSp547i9HlflB8gVnSTGmmq1ClO081OW/UH11pEQMfkEdDFzjLC1Cdo/BdL3s7cXb8J++Hzz1rhOUVZFIPehRiZ8VYu6+7Er7j5PSZu9g/GBdmNzJmyCD9wiswj9BZw+T3iBrg81re36ihMLjoVLoWc+62a1U/7qVX5CpvTVF7rocSAKwv4cBVqZm7lLDS/qoXs4fMs/VQi6BtVbNA3uSzKpQfjH1o3x4LrvkOn40zhm6hjduDglzJUwA0POabgdXIndp9fzhOo23Pe+Rk9GSLX0d71Poqry8NQDTzNlsa+JTNG9+UrEf+ngxCjGEsDCc0bz+udVRyHQI1jmEO3S+IOQycEq7XwB6z3wfMfa73m8PVRp+iOgtZfeSBl01xn03vMaQJkyj7vnhGCklsCWVRUl4y+5oNUzQ63B2dbjDF3vikd/3RUMifPYnX5Glfuk2FsV/7RqjI9yKTbE8wJY+74p7qXO8+dIYgjtLD/N8TJtRh04N9tXJA4H59IkMmLElgvr0Q5OCeVfdAt+5hkh4pQgfRMHpL74XatLQpPiOyHRs/OdmHtBf8nOZcxVKzdGclIN16lE7kJ+pVMjspOI+5+TqLRO6m0ZpNXJoZRv9MPDRcAfJUtNZHyig/s2wwReakFgPPJwCQmu1I30/tcBbji+Na53i1W1N+BqoY7Zxo+U/M9XyJ4Ok2SSkBtoOrwuhAY3a03Eu6l8wFdIG1cN+e8hopTkiKF093KuH/BcB39rMiGDLn6XVhGKEaaT/vqb/lufuAdpGExevF1+J9itkFhCfymWr9vGb3BTK4j598zRH7+e+MU9maruZqb0pkGxRDRE1CD4Z8LV4vhgPidk5w2Bq816g3nHw1//j3JStz7NR9HIWELO8TMn3QrP/zZp//+Dv9p429/ogv+GATR+n/UdF+ns9xNkXZQJXY4t9jMkJNUFygAtzndXwjss+yWH9HAnLQQfhAskdZS2l01HLWv7L7us5uTH409pqitvfSOQg/c+Zt7k879P3K9+WV68n7+3cZfuRd/dDPP/03rn+d+/nBvWfgDlt8+LzjqJ/vx3CnNOwiXhho778C96iD+1TBvRZYeP+EH81LE0vVwOOrmCLB3iKzI1x+vJEsrPH4uF0UB4TJ4X3uDfOCo3PYpYe0MF4bouh0DQ/l43fxUF7Y+dpWuvTSffB0yO2UQUETI/LwCZE3BvnevJ7c9zUlY3H58xzke6DNFDQG8n0WtDN4LAYN4nogKav1ezOfK/z+t6tsCTp+dhx4ymjWuCJk1dEUifDP+HyS4iP/Vg9B2jTo9L4NbiBuDS4nuuHW6H+JDQn2JtqRKGkEQPEYE7uzazXIkcxIAqUq1esasZBETlEZY7y7Jo+RoV/IsjY9eIMkUvr42Hc0xqtsavZvhz1OLwSxMOTuqzlhb0WbdOwBH9EYiyBjatz40bUxTHbiWxqJ0uma19qhPruvcWJlbiSSH48OLDDpaHPszvyct41ZfTu10+vjox6kOqK6v0K/gEPphEvMl/vwSv+A4Hhm36JSP9IXTyCZDm4kKsqD5ay8b1Sad/vaiyO5N/sDfEV6Z4q95E+yfjxpqBoBETW2C7xl4pIO2bDODDFurUPwE7EWC2Uplq+AHmBHvir2PSgkR12/Ry65O0aZtQPeXi9mTlF/Wj5GQ+vFkYyhXsLTjrBSP9hwk4GPqDP5rBn5/l8b0mLRAvRSzXHc293bs3s8EsdE3m2exxidWVB4joHR+S+dz5/W+v00K3TqN14CDBth8eWcsTbiwXPsygHdGid0PEdy6HHm2v/IUuV5RVapYmzGsX90mpnIdNGcOOq64Dbc5GUbYpD9M7S+6cLY//QmjxFLP5cuTFRm3vA5rkFZroFnO3bjHF35uU3s8mvL7Tp9nyTc4mymTJ5sLIp7umSnGkO23faehtz3mmTS7fbVx5rP7x3HXIjRNeq/A3xCs9JNB08c9S9BF2O3bOur0ItslFxXgRPdaapBIi4dRpKGxVz7ir69t/bc9qTxjvtOyGOfiLGDhR4fYywHv1WdOplxIV87TpLBy3Wc0QP0P9s4G7FBNOdITS/tep3o3h1TEa5XDDii7fWtqRzUEReP2fbxz7bHWWJdbIOxOUJZtItNZpTFRfj6vm9sYjRxQVO+WTdiOhdPeTJ+8YirPvoeL88l5iLYOHd3b/Imkq+1ZN1El3UikhftuteEYxf1Wujof8Pr4ICTu5ezZyZ4tHQMxlzUHLYO2VMOoNMGL/20S5i2o2obfk+8qqdR7xzbRDbgU0lnuIgz4LelQ5XS7xbLuSQtNS95v3ZUOdaUx/Qd8qxCt6xf2E62yb/HukLO6RyorV8KgYl5YNc75y+KvefrxY+lc/64y9kvWP0a0bDz/rojq+RWjO06WeruWqNFU7r3HPIcLWRql8ICZsz2Ls/qOm/CLn6++X+Qf7mGspYCrZod/lpl6Rw4xN/yuq8gqV4B6aHk1hVE1SfILxWu5gvXqbfARYQpspcxKp1F/c8XOPzkZvmoSw+vEqBLdrq1fr3wAPv5NnM9i8F+jdAuxkP5Z71c6uhK3enlnGymr7UsWZKC12qgUiG8XXGQ9mxnqz4GSIlybF9eXmbqj2sHX+a1jf0gRoONHRdRSrIq03Ty89eQ1GbV/Bk+du4+V15zls+vvERvZ4E7ZbnxWTVjDjb4o/k8jlw44pTIrUGxxuJvBeO+heuhOjpFsO6lVJ/aXnJDa/bM0Ql1cLbXE/Pbv3EZ3vj3iVrB5irjupZTzlnv677NrI9UNYNqbPgp/HZXS+lJmk87wec+7YOxTDo2aw2l3NfDr34VNlvqWJBknuK7oSlZ6/T10zuOoPZOeoIk81N+sL843WJ2Q4Z0fZ3scsqC/JV2fuhWi1jGURSKZV637lf53Xnnx16/vKEXY89aVJ0fv91jGdfG+G4+sniwHes4hS+udOr4RfhFhG/F5gUG35QaU+McuLmclb5ZWmR+sG5V6nf+PxYzlrnFGxpZaK8eqqVo0NfmAWoGfXDiT/FnUbWvzGDOTr8aktOZWg4BYvz5YH12ZbfCcGtNk+dDAZNGWvHov+PIOnY9Prjg8h/wLRrT69suaMVZ5bNuK00lSVpnqSX1NON/81FoP92rYndionwgOiA8WMf4vc8l15KqEEG4yAm2+WAN5Brfu1sq9suWYqgoajgOYt/JCk1gC8wPkK+XKCtRX6TAtgvrnuBgNRmn6I8lVDipOVB9kX6Oxkp4ZKyd1M6Gj8/v2U7k+YQBL95Kb9PQENucJb0JlW3b5tObN7m/Z1j1ev388d7o15zgXsI9CikAGAViR6lkJv7nb4Ak40M2G8TJ447kN+pvfHiOFjSUSP6PM+QfbAywKJCBaxSVxpizHseZUyUBhq59vFwrkyGoRiHbo0apweEZeSLuNiQ+HAekOnarFg00dZNXaPeoHPTRR0FmEyqYExOVaaaO8c0uFUh7U4e/UxdBmthlBDgg257Q33j1hA7HTxSeTTSuVnPZbgW1nodwmG16aKBDKxEetv7D9OjO0JhrbJTnoe+kcGoDJazFSO8/fUN9Jy/g4XK5PUkw2dgPDGpJqBfhe7GA+cjzfE/EGsMM+FV9nj9IAhrSfT/J3QE5TEIYyk5UjsI6ZZcCPr6A8FZUF4g9nnpVmjX90MLSQysIPD0nFzqwCcSJmIb5mYv2Cmk+C1MDFkZQyCBq4c/Yai9LJ6xYkGS/x2s5/frIW2vmG2Wrv0APpCdgCA9snFvfpe8uc0OwdRs4G9973PGEBnQB5qKrCQ6m6X/H7NInZ7y/1674/ZXOVp7OeuCRk8JFS516VHrnH1HkIUIlTIljjHaQtEtkJtosYul77cVwjk3gW1Ajaa6zWeyHGLlpk3VHE2VFzT2yI/EvlGUSz2H9zYE1s4nsKMtMqNyKNtL/59CpFJki5Fou6VXGm8vWATEPwrUVOLvoA8jLuwOzVBCgHB2Cr5V6OwEWtJEKokJkfc87h+sNHTvMb0KVTp5284QTPupoWvQVUwUeogZR3kBMESYo0mfukewRVPKh5+rzLQb7HKjFFIgWhj1w3yN/qCNoPI8XFiUgBNT1hCHBsAz8L7Oyt8wQWUFj92ONn/APyJFg8hzueqoJdNj57ROrFbffuS/XxrSXLTRgj5uxZjpgQYceeMc2wJrahReSKpm3QjHfqExTLAB2ipVumE8pqcZv8LYXQiPHHsgb5BMW8zM5pvQit+mQx8XGaVDcfVbLyMTlY8xcfmm/RSAT/H09UQol5gIz7rESDmnrQ4bURIB4iRXMDQwxgex1GgtDxKp2HayIkR+E/aDmCttNm2C6lytWdfOVzD6X2SpDWjQDlMRvAp1symWv4my1bPCD+E1EmGnMGWhNwmycJnDV2WrQNxO45ukEb08AAffizYKVULp15I4vbNK5DzWwCSUADfmKhfGSUqii1L2UsE8rB7mLuHuUJZOx4+WiizHBJ/hwboaBzhpNOVvgFTf5cJsHef7L1HCI9dOUUbb+YxUJWn6dYOLz+THi91kzY5dtO5c+grX7v0jEbsuoOGnoIreDIg/sFMyG+TyCLIcAWd1IZ1UNFxE8Uie13ucm40U2fcxC0u3WLvLOxwu+F7MWUsHsdtFQZ7W+nlfCASiAKyh8rnP3EyDByvtJb6Kax6/HkLzT9SyEyTMVM1zPtM0MJY14DmsWh4MgD15Ea9Hd00AdkTZ0EiG5NAGuIBzQJJ0JR0na+OB7lQA6UKxMfihIQ7GCCnVz694QvykWXTxpS2soDu+smru1UdIxSvAszBFD1c8c6ZOobA8bJiJIvuycgIXBQIXWwhyTgZDQxJTRXgEwRNAawGSXO0a1DKjdihLVNp/taE/xYhsgwe+VpKEEB4LlraQyE84gEihxCnbfoyOuJIEXy2FIYw+JjRusybKlU2g/vhTSGTydvCvXhYBdtAXtS2v7LkHtmXh/8fly1do8FI/D0f8UbzVb5h+KRhMGSAmR2mhi0YG/uj7wgxcfzCrMvdjitUIpXDX8ae2JcF/36qUWIMwN6JsjaRGNj+jEteGDcFyTUb8X/NHSucKMJp7pduxtD6KuxVlyxxwaeiC1FbGBESO84lbyrAugYxdl+2N8/6AgWpo/IeoAOcsG35IA/b3AuSyoa55L7llBLlaWlEWvuCFd8f8NfcTUgzJv6CbB+6ohWwodlk9nGWFpBAOaz5uEW5xBvmjnHFeDsb0mXwayj3mdYq5gxxNf3H3/tnCgHwjSrpSgVxLmiTtuszdRUFIsn6LiMPjL808vL1uQhDbM7aA43mISXReqjSskynIRcHCJ9qeFopJfx9tqyUoGbSwJex/0aDE3plBPGtNBYgWbdLom3+Q/bjdizR2/AS/c/dH/d3G7pyl1qDXgtOFtEqidwLqxPYtrNEveasWq3vPUUtqTeu8gpov4bdOQRI2kneFvRNMrShyVeEupK1PoLDPMSfWMIJcs267mGB8X9CehQCF0gIyhpP10mbyM7lwW1e6TGvHBV1sg/UyTghHPGRqMyaebC6pbB1WKNCQtlai1GGvmq9zUKaUzLaXsXEBYtHxmFbEZ2kJhR164LhWW2Tlp1dhsGE7ZgIWRBOx3Zcu2DxgH+G83WTPceKG0TgQKKiiNNOlWgvqNEbnrk6fVD+AqRam2OguZb0YWSTX88N+i/ELSxbaUUpPx4vJUzYg/WonSeA8xUK6u7DPHgpqWpEe6D4cXg5uK9FIYVba47V/nb+wyOtk+zG8RrS4EA0ouwa04iByRLSvoJA2FzaobbZtXnq8GdbfqEp5I2dpfpj59TCVif6+E75p665faiX8gS213RqBxTZqfHP46nF6NSenOneuT+vgbLUbdTH2/t0REFXZJOEB6DHvx6N6g9956CYrY/AYcm9gELJXYkrSi+0F0geKDZgOCIYkLU/+GOW5aGj8mvLFgtFH5+XC8hvAE3CvHRfl4ofM/Qwk4x2A+R+nyc9gNu/9Tem7XW4XRnyRymf52z09cTOdr+PG6+P/Vb4QiXlwauc5WB1z3o+IJjlbxI8MyWtSzT+k4sKVbhF3xa+vDts3NxXa87iiu+xRH9cAprnOL2h6vV54iQRXuOAj1s8nLFK8gZ70ThIQcWdF19/2xaJmT0efrkNDkWbpAQPdo92Z8+Hn/aLjbOzB9AI/k12fPs9HhUNDJ1u6ax2VxD3R6PywN7BrLJ26z6s3QoMp76qzzwetrDABKSGkfW5PwS1GvYNUbK6uRqxfyVGNyFB0E+OugMM8kKwmJmupuRWO8XkXXXQECyRVw9UyIrtCtcc4oNqXqr7AURBmKn6Khz3eBN96LwIJrAGP9mr/59uTOSx631suyT+QujDd4beUFpZ0kJEEnjlP+X/Kr2kCKhnENTg4BsMTOmMqlj2WMFLRUlVG0fzdCBgUta9odrJfpVdFomTi6ak0tFjXTcdqqvWBAzjY6hVrH9sbt3Z9gn+AVDpTcQImefbB4edirjzrsNievve4ZT4EUZWV3TxEsIW+9MT/RJoKfZZYSRGfC1CwPG/9rdMOM8qR/LUYvw5f/emUSoD7YSFuOoqchdUg2UePd1eCtFSKgxLSZ764oy4lvRCIH6bowPxZWwxNFctksLeil47pfevcBipkkBIc4ngZG+kxGZ71a72KQ7VaZ6MZOZkQJZXM6kb/Ac0/XkJx8dvyfJcWbI3zONEaEPIW8GbkYjsZcwy+eMoKrYjDmvEEixHzkCSCRPRzhOfJZuLdcbx19EL23MA8rnjTZZ787FGMnkqnpuzB5/90w1gtUSRaWcb0eta8198VEeZMUSfIhyuc4/nywFQ9uqn7jdqXh+5wwv+RK9XouNPbYdoEelNGo34KyySwigsrfCe0v/PlWPvQvQg8R0KgHO18mTVThhQrlbEQ0Kp/JxPdjHyR7E1QPw/ut0r+HDDG7BwZFm9IqEUZRpv2WpzlMkOemeLcAt5CsrzskLGaVOAxyySzZV/D2EY7ydNZMf8e8VhHcKGHAWNszf1EOq8fNstijMY4JXyATwTdncFFqcNDfDo+mWFvxJJpc4sEZtjXyBdoFcxbUmniCoKq5jydUHNjYJxMqN1KzYV62MugcELVhS3Bnd+TLLOh7dws/zSXWzxEb4Nj4aFun5x4kDWLK5TUF/yCXB/cZYvI9kPgVsG2jShtXkxfgT+xzjJofXqPEnIXIQ1lnIdmVzBOM90EXvJUW6a0nZ/7XjJGl8ToO3H/fdxnxmTNKBZxnkpXLVgLXCZywGT3YyS75w/PAH5I/jMuRspej8xZObU9kREbRA+kqjmKRFaKGWAmFQspC+QLbKPf0RaK3OXvBSWqo46p70ws/eZpu6jCtZUgQy6r4tHMPUdAgWGGUYNbuv/1a6K+MVFsd3T183+T8capSo6m0+Sh57fEeG/95dykGJBQMj09DSW2bY0mUonDy9a8trLnnL5B5LW3Nl8rJZNysO8Zb+80zXxqUGFpud3Qzwb7bf+8mq6x0TAnJU9pDQR9YQmZhlna2xuxJt0aCO/f1SU8gblOrbIyMsxTlVUW69VJPzYU2HlRXcqE2lLLxnObZuz2tT9CivfTAUYfmzJlt/lOPgsR6VN64/xQd4Jlk/RV7UKVv2Gx/AWsmTAuCWKhdwC+4HmKEKYZh2Xis4KsUR1BeObs1c13wqFRnocdmuheaTV30gvVXZcouzHKK5zwrN52jXJEuX6dGx3BCpV/++4f3hyaW/cQJLFKqasjsMuO3B3WlMq2gyYfdK1e7L2pO/tRye2mwzwZPfdUMrl5wdLqdd2Kv/wVtnpyWYhd49L6rsOV+8HXPrWH2Kup89l2tz6bf80iYSd+V4LROSOHeamvexR524q4r43rTmtFzQvArpvWfLYFZrbFspBsXNUqqenjxNNsFXatZvlIhk7teUPfK+YL32F8McTnjv0BZNppb+vshoCrtLXjIWq3EJXpVXIlG6ZNL0dh6qEm2WMwDjD3LfOfkGh1/czYc/0qhiD2ozNnH4882MVVt3JbVFkbwowNCO3KL5IoYW5wlVeGCViOuv1svZx7FbzxKzA4zGqBlRRaRWCobXaVq4yYCWbZf8eiJwt3OY+MFiSJengcFP2t0JMfzOiJ7cECvpx7neg1Rc5x+7myPJOXt2FohVRyXtD+/rDoTOyGYInJelZMjolecVHUhUNqvdZWg2J2t0jPmiLFeRD/8fOT4o+NGILb+TufCo9ceBBm3JLVn+MO2675n7qiEX/6W+188cYg3Zn5NSTjgOKfWFSAANa6raCxSoVU851oJLY11WIoYK0du0ec5E4tCnAPoKh71riTsjVIp3gKvBbEYQiNYrmH22oLQWA2AdwMnID6PX9b58dR2QKo4qag1D1Z+L/FwEKTR7osOZPWECPJIHQqPUsM5i/CH5YupVPfFA5pHUBcsesh8eO5YhyWnaVRPZn/BmdXVumZWPxMP5e28zm2uqHgFoT9CymHYNNrzrrjlXZM06HnzDxYNlI5b/QosxLmmrqDFqmogQdqk0WLkUceoAvQxHgkIyvWU69BPFr24VB6+lx75Rna6dGtrmOxDnvBojvi1/4dHjVeg8owofPe1cOnxU1ioh016s/Vudv9mhV9f35At+Sh28h1bpp8xhr09+vf47Elx3Ms6hyp6QvB3t0vnLbOhwo660cp7K0vvepabK7YJfxEWWfrC2YzJfYOjygPwfwd/1amTqa0hZ5ueebhWYVMubRTwIjj+0Oq0ohU3zfRfuL8gt59XsHdwKtxTQQ4Y2qz6gisxnm2UdlmpEkgOsZz7iEk6QOt8BuPwr+NR01LTqXmJo1C76o1N274twJvl+I069TiLpenK/miRxhyY8jvYV6W1WuSwhH9q7kuwnJMtm7IWcqs7HsnyHSqWXLSpYtZGaR1V3t0gauninFPZGtWskF65rtti48UV9uV9KM8kfDYs0pgB00S+TlzTXV6P8mxq15b9En8sz3jWSszcifZa/NuufPNnNTb031pptt0+sRSH/7UG8pzbsgtt3OG3ut7B9JzDMt2mTZuyRNIV8D54TuTrpNcHtgmMlYJeiY9XS83NYJicjRjtJSf9BZLsQv629QdDsKQhTK5CnXhpk7vMNkHzPhm0ExW/VCGApHfPyBagtZQTQmPHx7g5IXXsrQDPzIVhv2LB6Ih138iSDww1JNHrDvzUxvp73MsQBVhW8EbrReaVUcLB1R3PUXyaYG4HpJUcLVxMgDxcPkVRQpL7VTAGabDzbKcvg12t5P8TSGQkrj/gOrpnbiDHwluA73xbXts/L7u468cRWSWRtgTwlQnA47EKg0OiZDgFxAKQQUcsbGomITgeXUAAyKe03eA7Mp4gnyKQmm0LXJtEk6ddksMJCuxDmmHzmVhO+XaN2A54MIh3niw5CF7PwiXFZrnA8wOdeHLvvhdoqIDG9PDI7UnWWHq526T8y6ixJPhkuVKZnoUruOpUgOOp3iIKBjk+yi1vHo5cItHXb1PIKzGaZlRS0g5d3MV2pD8FQdGYLZ73aae/eEIUePMc4NFz8pIUfLCrrF4jVWH5gQneN3S8vANBmUXrEcKGn6hIUN95y1vpsvLwbGpzV9L0ZKTan6TDXM05236uLJcIEMKVAxKNT0K8WljuwNny3BNQRfzovA85beI9zr1AGNYnYCVkR1aGngWURUrgqR+gRrQhxW81l3CHevjvGEPzPMTxdsIfB9dfGRbZU0cg/1mcubtECX4tvaedmNAvTxCJtc2QaoUalGfENCGK7IS/O8CRpdOVca8EWCRwv2sSWE8CJPW5PCugjCXPd3h6U60cPD+bdhtXZuYB6stcoveE7Sm5MM2yvfUHXFSW7KzLmi7/EeEWL0wqcOH9MOSKjhCHHmw+JGLcYE/7SBZQCRggox0ZZTAxrlzNNXYXL5fNIjkdT4YMqVUz6p8YDt049v4OXGdg3qTrtLBUXOZf7ahPlZAY/O+7Sp0bvGSHdyQ8B1LOsplqMb9Se8VAE7gIdSZvxbRSrfl+Lk5Qaqi5QJceqjitdErcHXg/3MryljPSIAMaaloFm1cVwBJ8DNmkDqoGROSHFetrgjQ5CahuKkdH5pRPigMrgTtlFI8ufJPJSUlGgTjbBSvpRc0zypiUn6U5KZqcRoyrtzhmJ7/caeZkmVRwJQeLOG8LY6vP5ChpKhc8Js0El+n6FXqbx9ItdtLtYP92kKfaTLtCi8StLZdENJa9Ex1nOoz1kQ7qxoiZFKRyLf4O4CHRT0T/0W9F8epNKVoeyxUXhy3sQMMsJjQJEyMOjmOhMFgOmmlscV4eFi1CldU92yjwleirEKPW3bPAuEhRZV7JsKV3Lr5cETAiFuX5Nw5UlF7d2HZ96Bh0sgFIL5KGaKSoVYVlvdKpZJVP5+NZ7xDEkQhmDgsDKciazJCXJ6ZN2B3FY2f6VZyGl/t4aunGIAk/BHaS+i+SpdRfnB/OktOvyjinWNfM9Ksr6WwtCa1hCmeRI6icpFM4o8quCLsikU0tMoZI/9EqXRMpKGaWzofl4nQuVQm17d5fU5qXCQeCDqVaL9XJ9qJ08n3G3EFZS28SHEb3cdRBdtO0YcTzil3QknNKEe/smQ1fTb0XbpyNB5xAeuIlf+5KWlEY0DqJbsnzJlQxJPOVyHiKMx5Xu9FcEv1Fbg6Fhm4t+Jyy5JC1W3YO8dYLsO0PXPbxodBgttTbH3rt9Cp1lJIk2r3O1Zqu94eRbnIz2f50lWolYzuKsj4PMok4abHLO8NAC884hiXx5Fy5pWKO0bWL7uEGXaJCtznhP67SlQ4xjWIfgq6EpZ28QMtuZK7JC0RGbl9nA4XtFLug/NLMoH1pGt9IonAJqcEDLyH6TDROcbsmGPaGIxMo41IUAnQVPMPGByp4mOmh9ZQMkBAcksUK55LsZj7E5z5XuZoyWCKu6nHmDq22xI/9Z8YdxJy4kWpD16jLVrpwGLWfyOD0Wd+cBzFBxVaGv7S5k9qwh/5t/LQEXsRqI3Q9Rm3QIoaZW9GlsDaKOUyykyWuhNOprSEi0s1G4rgoiX1V743EELti+pJu5og6X0g6oTynUqlhH9k6ezyRi05NGZHz0nvp3HOJr7ebrAUFrDjbkFBObEvdQWkkUbL0pEvMU46X58vF9j9F3j6kpyetNUBItrEubW9ZvMPM4qNqLlsSBJqOH3XbNwv/cXDXNxN8iFLzUhteisYY+RlHYOuP29/Cb+L+xv+35Rv7xudnZ6ohK4cMPfCG8KI7dNmjNk/H4e84pOxn/sZHK9psfvj8ncA8qJz7O8xqbxESDivGJOZzF7o5PJLQ7g34qAWoyuA+x3btU98LT6ZyGyceIXjrqob2CAVql4VOTQPUQYvHV/g4zAuCZGvYQBtf0wmd5lilrvuEn1BXLny01B4h4SMDlYsnNpm9d7m9h578ufpef9Z4WplqWQvqo52fyUA7J24eZD5av6SyGIV9kpmHNqyvdfzcpEMw97BvknV2fq+MFHun9BT3Lsf8pbzvisWiIQvYkng+8Vxk1V+dli1u56kY50LRjaPdotvT5BwqtwyF+emo/z9J3yVUVGfKrxQtJMOAQWoQii/4dp9wgybSa5mkucmRLtEQZ/pz0tL/NVcgWAd95nEQ3Tg6tNbuyn3Iepz65L3huMUUBntllWuu4DbtOFSMSbpILV4fy6wlM0SOvi6CpLh81c1LreIvKd61uEWBcDw1lUBUW1I0Z+m/PaRlX+PQ/oxg0Ye6KUiIiTF4ADNk59Ydpt5/rkxmq9tV5Kcp/eQLUVVmBzQNVuytQCP6Ezd0G8eLxWyHpmZWJ3bAzkWTtg4lZlw42SQezEmiUPaJUuR/qklVA/87S4ArFCpALdY3QRdUw3G3XbWUp6aq9z0zUizcPa7351p9JXOZyfdZBFnqt90VzQndXB/mwf8LC9STj5kenVpNuqOQQP3mIRJj7eV21FxG8VAxKrEn3c+XfmZ800EPb9/5lIlijscUbB6da0RQaMook0zug1G0tKi/JBC4rw7/D3m4ARzAkzMcVrDcT2SyFtUdWAsFlsPDFqV3N+EjyXaoEePwroaZCiLqEzb8MW+PNE9TmTC01EzWli51PzZvUqkmyuROU+V6ik+Le/9qT6nwzUzf9tP68tYei0YaDGx6kAd7jn1cKqOCuYbiELH9zYqcc4MnRJjkeGiqaGwLImhyeKs+xKJMBlOJ05ow9gGCKZ1VpnMKoSCTbMS+X+23y042zOb5MtcY/6oBeAo1Vy89OTyhpavFP78jXCcFH0t7Gx24hMEOm2gsEfGabVpQgvFqbQKMsknFRRmuPHcZu0Su/WMFphZvB2r/EGbG72rpGGho3h+Msz0uGzJ7hNK2uqQiE1qmn0zgacKYYZBCqsxV+sjbpoVdSilW/b94n2xNb648VmNIoizqEWhBnsen+d0kbCPmRItfWqSBeOd9Wne3c6bcd6uvXOJ6WdiSsuXq0ndhqrQ4QoWUjCjYtZ0EAhnSOP1m44xkf0O7jXghrzSJWxP4a/t72jU29Vu2rvu4n7HfHkkmQOMGSS+NPeLGO5I73mC2B7+lMiBQQZRM9/9liLIfowupUFAbPBbR+lxDM6M8Ptgh1paJq5Rvs7yEuLQv/7d1oU2woFSb3FMPWQOKMuCuJ7pDDjpIclus5TeEoMBy2YdVB4fxmesaCeMNsEgTHKS5WDSGyNUOoEpcC2OFWtIRf0w27ck34/DjxRTVIcc9+kqZE6iMSiVDsiKdP/Xz5XfEhm/sBhO50p1rvJDlkyyxuJ9SPgs7YeUJBjXdeAkE+P9OQJm6SZnn1svcduI78dYmbkE2mtziPrcjVisXG78spLvbZaSFx/Rks9zP4LKn0Cdz/3JsetkT06A8f/yCgMO6Mb1Hme0JJ7b2wZz1qleqTuKBGokhPVUZ0dVu+tnQYNEY1fmkZSz6+EGZ5EzL7657mreZGR3jUfaEk458PDniBzsSmBKhDRzfXameryJv9/D5m6HIqZ0R+ouCE54Dzp4IJuuD1e4Dc5i+PpSORJfG23uVgqixAMDvchMR0nZdH5brclYwRoJRWv/rlxGRI5ffD5NPGmIDt7vDE1434pYdVZIFh89Bs94HGGJbTwrN8T6lh1HZFTOB4lWzWj6EVqxSMvC0/ljWBQ3F2kc/mO2b6tWonT2JEqEwFts8rz2h+oWNds9ceR2cb7zZvJTDppHaEhK5avWqsseWa2Dt5BBhabdWSktS80oMQrL4TvAM9b5HMmyDnO+OkkbMXfUJG7eXqTIG6lqSOEbqVR+qYdP7uWb57WEJqzyh411GAVsDinPs7KvUeXItlcMdOUWzXBH6zscymV1LLVCtc8IePojzXHF9m5b5zGwBRdzcyUJkiu938ApmAayRdJrX1PmVguWUvt2ThQ62czItTyWJMW2An/hdDfMK7SiFQlGIdAbltHz3ycoh7j9V7GxNWBpbtcSdqm4XxRwTawc3cbZ+xfSv9qQfEkDKfZTwCkqWGI/ur250ItXlMlh6vUNWEYIg9A3GzbgmbqvTN8js2YMo87CU5y6nZ4dbJLDQJj9fc7yM7tZzJDZFtqOcU8+mZjYlq4VmifI23iHb1ZoT9E+kT2dolnP1AfiOkt7PQCSykBiXy5mv637IegWSKj9IKrYZf4Lu9+I7ub+mkRdlvYzehh/jaJ9n7HUH5b2IbgeNdkY7wx1yVzxS7pbvky6+nmVUtRllEFfweUQ0/nG017WoUYSxs+j2B4FV/F62EtHlMWZXYrjGHpthnNb1x66LKZ0Qe92INWHdfR/vqp02wMS8r1G4dJqHok8KmQ7947G13a4YXbsGgHcBvRuVu1eAi4/A5+ZixmdSXM73LupB/LH7O9yxLTVXJTyBbI1S49TIROrfVCOb/czZ9pM4JsZx8kUz8dQGv7gUWKxXvTH7QM/3J2OuXXgciUhqY+cgtaOliQQVOYthBLV3xpESZT3rmfEYNZxmpBbb24CRao86prn+i9TNOh8VxRJGXJfXHATJHs1T5txgc/opYrY8XjlGQQbRcoxIBcnVsMjmU1ymmIUL4dviJXndMAJ0Yet+c7O52/p98ytlmAsGBaTAmMhimAnvp1TWNGM9BpuitGj+t810CU2UhorrjPKGtThVC8WaXw04WFnT5fTjqmPyrQ0tN3CkLsctVy2xr0ZWgiWVZ1OrlFjjxJYsOiZv2cAoOvE+7sY0I/TwWcZqMoyIKNOftwP7w++Rfg67ljfovKYa50if3fzE/8aPYVey/Nq35+nH2sLPh/fP5TsylSKGOZ4k69d2PnH43+kq++sRXHQqGArWdwhx+hpwQC6JgT2uxehYU4Zbw7oNb6/HLikPyJROGK2ouyr+vzseESp9G50T4AyFrSqOQ0rroCYP4sMDFBrHn342EyZTMlSyk47rHSq89Y9/nI3zG5lX16Z5lxphguLOcZUndL8wNcrkyjH82jqg8Bo8OYkynrxZvbFno5lUS3OPr8Ko3mX9NoRPdYOKKjD07bvgFgpZ/RF+YzkWvJ/Hs/tUbfeGzGWLxNAjfDzHHMVSDwB5SabQLsIZHiBp43FjGkaienYoDd18hu2BGwOK7U3o70K/WY/kuuKdmdrykIBUdG2mvE91L1JtTbh20mOLbk1vCAamu7utlXeGU2ooVikbU/actcgmsC1FKk2qmj3GWeIWbj4tGIxE7BLcBWUvvcnd/lYxsMV4F917fWeFB/XbINN3qGvIyTpCalz1lVewdIGqeAS/gB8Mi+sA+BqDiX3VGD2eUunTRbSY+AuDy4E3Qx3hAhwnSXX+B0zuj3eQ1miS8Vux2z/l6/BkWtjKGU72aJkOCWhGcSf3+kFkkB15vGOsQrSdFr6qTj0gBYiOlnBO41170gOWHSUoBVRU2JjwppYdhIFDfu7tIRHccSNM5KZOFDPz0TGMAjzzEpeLwTWp+kn201kU6NjbiMQJx83+LX1e1tZ10kuChJZ/XBUQ1dwaBHjTDJDqOympEk8X2M3VtVw21JksChA8w1tTefO3RJ1FMbqZ01bHHkudDB/OhLfe7P5GOHaI28ZXKTMuqo0hLWQ4HabBsGG7NbP1RiXtETz074er6w/OerJWEqjmkq2y51q1BVI+JUudnVa3ogBpzdhFE7fC7kybrAt2Z6RqDjATAUEYeYK45WMupBKQRtQlU+uNsjnzj6ZmGrezA+ASrWxQ6LMkHRXqXwNq7ftv28dUx/ZSJciDXP2SWJsWaN0FjPX9Yko6LobZ7aYW/IdUktI9apTLyHS8DyWPyuoZyxN1TK/vtfxk3HwWh6JczZC8Ftn0bIJay2g+n5wd7lm9rEsKO+svqVmi+c1j88hSCxbzrg4+HEP0Nt1/B6YW1XVm09T1CpAKjc9n18hjqsaFGdfyva1ZG0Xu3ip6N6JGpyTSqY5h4BOlpLPaOnyw45PdXTN+DtAKg7DLrLFTnWusoSBHk3s0d7YouJHq85/R09Tfc37ENXZF48eAYLnq9GLioNcwDZrC6FW6godB8JnqYUPvn0pWLfQz0lM0Yy8Mybgn84Ds3Q9bDP10bLyOV+qzxa4Rd9Dhu7cju8mMaONXK3UqmBQ9qIg7etIwEqM/kECk/Dzja4Bs1xR+Q/tCbc8IKrSGsTdJJ0vge7IG20W687uVmK6icWQ6cD3lwFzgNMGtFvO5qyJeKflGLAAcQZOrkxVwy3cWvqlGpvjmf9Qe6Ap20MPbV92DPV0OhFM4kz8Yr0ffC2zLWSQ1kqY6QdQrttR3kh1YLtQd1kCEv5hVoPIRWl5ERcUTttBIrWp6Xs5Ehh5OUUwI5aEBvuiDmUoENmnVw1FohCrbRp1A1E+XSlWVOTi7ADW+5Ohb9z1vK4qx5R5lPdGCPBJZ00mC+Ssp8VUbgpGAvXWMuWQQRbCqI6Rr2jtxZxtfP7W/8onz+yz0Gs76LaT5HX9ecyiZCB/ZR/gFtMxPsDwohoeCRtiuLxE1GM1vUEUgBv86+eehL58/P56QFGQ/MqOe/vC76L63jzmeax4exd/OKTUvkXg+fOJUHych9xt/9goJMrapSgvXrj8+8vk/N80f22Sewj6cyGqt1B6mztoeklVHHraouhvHJaG/OuBz6DHKMpFmQULU1bRWlyYE0RPXYYkUycIemN7TLtgNCJX6BqdyxDKkegO7nJK5xQ7OVYDZTMf9bVHidtk6DQX9Et+V9M7esgbsYBdEeUpsB0Xvw2kd9+rI7V+m47u+O/tq7mw7262HU1WlS9uFzsV6JxIHNmUCy0QS9e077JGRFbG65z3/dOKB/Zk+yDdKpUmdXjn/aS3N5nv4fK7bMHHmPlHd4E2+iTbV5rpzScRnxk6KARuDTJ8Q1LpK2mP8gj1EbuJ9RIyY+EWK4hCiIDBAS1Tm2IEXAFfgKPgdL9O6mAa06wjCcUAL6EsxPQWO9VNegBPm/0GgkZbDxCynxujX/92vmGcjZRMAY45puak2sFLCLSwXpEsyy5fnF0jGJBhm+fNSHKKUUfy+276A7/feLOFxxUuHRNJI2Osenxyvf8DAGObT60pfTTlhEg9u/KKkhJqm5U1/+BEcSkpFDA5XeCqxwXmPac1jcuZ3JWQ+p0NdWzb/5v1ZvF8GtMTFFEdQjpLO0bwPb0BHNWnip3liDXI2fXf05jjvfJ0NpjLCUgfTh9CMFYVFKEd4Z/OG/2C+N435mnK+9t1gvCiVcaaH7rK4+PjCvpVNiz+t2QyqH1O8x3JKZVl6Q+Lp/XK8wMjVMslOq9FdSw5FtUs/CptXH9PW+wbWHgrV17R5jTVOtGtKFu3nb80T+E0tv9QkzW3J2dbaw/8ddAKZ0pxIaEqLjlPrji3VgJ3GvdFvlqD8075woxh4fVt0JZE0KVFsAvqhe0dqN9b35jtSpnYMXkU+vZq+IAHad3IHc2s/LYrnD1anfG46IFiMIr9oNbZDWvwthqYNqOigaKd/XlLU4XHfk/PXIjPsLy/9/kAtQ+/wKH+hI/IROWj5FPvTZAT9f7j4ZXQyG4M0TujMAFXYkKvEHv1xhySekgXGGqNxWeWKlf8dDAlLuB1cb/qOD+rk7cmwt+1yKpk9cudqBanTi6zTbXRtV8qylNtjyOVKy1HTz0GW9rjt6sSjAZcT5R+KdtyYb0zyqG9pSLuCw5WBwAn7fjBjKLLoxLXMI+52L9cLwIR2B6OllJZLHJ8vDxmWdtF+QJnmt1rsHPIWY20lftk8fYePkAIg6Hgn532QoIpegMxiWgAOfe5/U44APR8Ac0NeZrVh3gEhs12W+tVSiWiUQekf/YBECUy5fdYbA08dd7VzPAP9aiVcIB9k6tY7WdJ1wNV+bHeydNtmC6G5ICtFC1ZwmJU/j8hf0I8TRVKSiz5oYIa93EpUI78X8GYIAZabx47/n8LDAAJ0nNtP1rpROprqKMBRecShca6qXuTSI3jZBLOB3Vp381B5rCGhjSvh/NSVkYp2qIdP/Bg="; }, {} ], 6: [ function(require2, module2, exports2) { var data = require2("./dictionary-browser"); exports2.init = function() { exports2.dictionary = data.init(); }; exports2.offsetsByLength = new Uint32Array([ 0, 0, 0, 0, 0, 4096, 9216, 21504, 35840, 44032, 53248, 63488, 74752, 87040, 93696, 100864, 104704, 106752, 108928, 113536, 115968, 118528, 119872, 121280, 122016 ]); exports2.sizeBitsByLength = new Uint8Array([ 0, 0, 0, 0, 10, 10, 11, 11, 10, 10, 10, 10, 10, 9, 9, 8, 7, 7, 8, 7, 7, 6, 6, 5, 5 ]); exports2.minDictionaryWordLength = 4; exports2.maxDictionaryWordLength = 24; }, { "./dictionary-browser": 4 } ], 7: [ function(require2, module2, exports2) { function HuffmanCode(bits, value) { this.bits = bits; this.value = value; } exports2.HuffmanCode = HuffmanCode; var MAX_LENGTH = 15; function GetNextKey(key, len) { var step = 1 << len - 1; while (key & step) { step >>= 1; } return (key & step - 1) + step; } function ReplicateValue(table, i2, step, end, code) { do { end -= step; table[i2 + end] = new HuffmanCode( code.bits, code.value ); } while (end > 0); } function NextTableBitSize(count, len, root_bits) { var left = 1 << len - root_bits; while (len < MAX_LENGTH) { left -= count[len]; if (left <= 0) break; ++len; left <<= 1; } return len - root_bits; } exports2.BrotliBuildHuffmanTable = function(root_table, table, root_bits, code_lengths, code_lengths_size) { var start_table = table; var code; var len; var symbol3; var key; var step; var low; var mask; var table_bits; var table_size; var total_size; var sorted; var count = new Int32Array( MAX_LENGTH + 1 ); var offset = new Int32Array( MAX_LENGTH + 1 ); sorted = new Int32Array(code_lengths_size); for (symbol3 = 0; symbol3 < code_lengths_size; symbol3++) { count[code_lengths[symbol3]]++; } offset[1] = 0; for (len = 1; len < MAX_LENGTH; len++) { offset[len + 1] = offset[len] + count[len]; } for (symbol3 = 0; symbol3 < code_lengths_size; symbol3++) { if (code_lengths[symbol3] !== 0) { sorted[offset[code_lengths[symbol3]]++] = symbol3; } } table_bits = root_bits; table_size = 1 << table_bits; total_size = table_size; if (offset[MAX_LENGTH] === 1) { for (key = 0; key < total_size; ++key) { root_table[table + key] = new HuffmanCode( 0, sorted[0] & 65535 ); } return total_size; } key = 0; symbol3 = 0; for (len = 1, step = 2; len <= root_bits; ++len, step <<= 1) { for (; count[len] > 0; --count[len]) { code = new HuffmanCode( len & 255, sorted[symbol3++] & 65535 ); ReplicateValue( root_table, table + key, step, table_size, code ); key = GetNextKey(key, len); } } mask = total_size - 1; low = -1; for (len = root_bits + 1, step = 2; len <= MAX_LENGTH; ++len, step <<= 1) { for (; count[len] > 0; --count[len]) { if ((key & mask) !== low) { table += table_size; table_bits = NextTableBitSize( count, len, root_bits ); table_size = 1 << table_bits; total_size += table_size; low = key & mask; root_table[start_table + low] = new HuffmanCode( table_bits + root_bits & 255, table - start_table - low & 65535 ); } code = new HuffmanCode( len - root_bits & 255, sorted[symbol3++] & 65535 ); ReplicateValue( root_table, table + (key >> root_bits), step, table_size, code ); key = GetNextKey(key, len); } } return total_size; }; }, {} ], 8: [ function(require2, module2, exports2) { "use strict"; exports2.byteLength = byteLength; exports2.toByteArray = toByteArray; exports2.fromByteArray = fromByteArray; var lookup = []; var revLookup = []; var Arr = typeof Uint8Array !== "undefined" ? Uint8Array : Array; var code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; for (var i2 = 0, len = code.length; i2 < len; ++i2) { lookup[i2] = code[i2]; revLookup[code.charCodeAt(i2)] = i2; } revLookup["-".charCodeAt(0)] = 62; revLookup["_".charCodeAt(0)] = 63; function getLens(b64) { var len2 = b64.length; if (len2 % 4 > 0) { throw new Error( "Invalid string. Length must be a multiple of 4" ); } var validLen = b64.indexOf("="); if (validLen === -1) validLen = len2; var placeHoldersLen = validLen === len2 ? 0 : 4 - validLen % 4; return [validLen, placeHoldersLen]; } function byteLength(b64) { var lens = getLens(b64); var validLen = lens[0]; var placeHoldersLen = lens[1]; return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; } function _byteLength(b64, validLen, placeHoldersLen) { return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; } function toByteArray(b64) { var tmp; var lens = getLens(b64); var validLen = lens[0]; var placeHoldersLen = lens[1]; var arr = new Arr( _byteLength(b64, validLen, placeHoldersLen) ); var curByte = 0; var len2 = placeHoldersLen > 0 ? validLen - 4 : validLen; for (var i22 = 0; i22 < len2; i22 += 4) { tmp = revLookup[b64.charCodeAt(i22)] << 18 | revLookup[b64.charCodeAt(i22 + 1)] << 12 | revLookup[b64.charCodeAt(i22 + 2)] << 6 | revLookup[b64.charCodeAt(i22 + 3)]; arr[curByte++] = tmp >> 16 & 255; arr[curByte++] = tmp >> 8 & 255; arr[curByte++] = tmp & 255; } if (placeHoldersLen === 2) { tmp = revLookup[b64.charCodeAt(i22)] << 2 | revLookup[b64.charCodeAt(i22 + 1)] >> 4; arr[curByte++] = tmp & 255; } if (placeHoldersLen === 1) { tmp = revLookup[b64.charCodeAt(i22)] << 10 | revLookup[b64.charCodeAt(i22 + 1)] << 4 | revLookup[b64.charCodeAt(i22 + 2)] >> 2; arr[curByte++] = tmp >> 8 & 255; arr[curByte++] = tmp & 255; } return arr; } function tripletToBase64(num) { return lookup[num >> 18 & 63] + lookup[num >> 12 & 63] + lookup[num >> 6 & 63] + lookup[num & 63]; } function encodeChunk(uint8, start2, end) { var tmp; var output = []; for (var i22 = start2; i22 < end; i22 += 3) { tmp = (uint8[i22] << 16 & 16711680) + (uint8[i22 + 1] << 8 & 65280) + (uint8[i22 + 2] & 255); output.push(tripletToBase64(tmp)); } return output.join(""); } function fromByteArray(uint8) { var tmp; var len2 = uint8.length; var extraBytes = len2 % 3; var parts = []; var maxChunkLength = 16383; for (var i22 = 0, len22 = len2 - extraBytes; i22 < len22; i22 += maxChunkLength) { parts.push( encodeChunk( uint8, i22, i22 + maxChunkLength > len22 ? len22 : i22 + maxChunkLength ) ); } if (extraBytes === 1) { tmp = uint8[len2 - 1]; parts.push( lookup[tmp >> 2] + lookup[tmp << 4 & 63] + "==" ); } else if (extraBytes === 2) { tmp = (uint8[len2 - 2] << 8) + uint8[len2 - 1]; parts.push( lookup[tmp >> 10] + lookup[tmp >> 4 & 63] + lookup[tmp << 2 & 63] + "=" ); } return parts.join(""); } }, {} ], 9: [ function(require2, module2, exports2) { function PrefixCodeRange(offset, nbits) { this.offset = offset; this.nbits = nbits; } exports2.kBlockLengthPrefixCode = [ new PrefixCodeRange(1, 2), new PrefixCodeRange(5, 2), new PrefixCodeRange(9, 2), new PrefixCodeRange(13, 2), new PrefixCodeRange(17, 3), new PrefixCodeRange(25, 3), new PrefixCodeRange(33, 3), new PrefixCodeRange(41, 3), new PrefixCodeRange(49, 4), new PrefixCodeRange(65, 4), new PrefixCodeRange(81, 4), new PrefixCodeRange(97, 4), new PrefixCodeRange(113, 5), new PrefixCodeRange(145, 5), new PrefixCodeRange(177, 5), new PrefixCodeRange(209, 5), new PrefixCodeRange(241, 6), new PrefixCodeRange(305, 6), new PrefixCodeRange(369, 7), new PrefixCodeRange(497, 8), new PrefixCodeRange(753, 9), new PrefixCodeRange(1265, 10), new PrefixCodeRange(2289, 11), new PrefixCodeRange(4337, 12), new PrefixCodeRange(8433, 13), new PrefixCodeRange(16625, 24) ]; exports2.kInsertLengthPrefixCode = [ new PrefixCodeRange(0, 0), new PrefixCodeRange(1, 0), new PrefixCodeRange(2, 0), new PrefixCodeRange(3, 0), new PrefixCodeRange(4, 0), new PrefixCodeRange(5, 0), new PrefixCodeRange(6, 1), new PrefixCodeRange(8, 1), new PrefixCodeRange(10, 2), new PrefixCodeRange(14, 2), new PrefixCodeRange(18, 3), new PrefixCodeRange(26, 3), new PrefixCodeRange(34, 4), new PrefixCodeRange(50, 4), new PrefixCodeRange(66, 5), new PrefixCodeRange(98, 5), new PrefixCodeRange(130, 6), new PrefixCodeRange(194, 7), new PrefixCodeRange(322, 8), new PrefixCodeRange(578, 9), new PrefixCodeRange(1090, 10), new PrefixCodeRange(2114, 12), new PrefixCodeRange(6210, 14), new PrefixCodeRange(22594, 24) ]; exports2.kCopyLengthPrefixCode = [ new PrefixCodeRange(2, 0), new PrefixCodeRange(3, 0), new PrefixCodeRange(4, 0), new PrefixCodeRange(5, 0), new PrefixCodeRange(6, 0), new PrefixCodeRange(7, 0), new PrefixCodeRange(8, 0), new PrefixCodeRange(9, 0), new PrefixCodeRange(10, 1), new PrefixCodeRange(12, 1), new PrefixCodeRange(14, 2), new PrefixCodeRange(18, 2), new PrefixCodeRange(22, 3), new PrefixCodeRange(30, 3), new PrefixCodeRange(38, 4), new PrefixCodeRange(54, 4), new PrefixCodeRange(70, 5), new PrefixCodeRange(102, 5), new PrefixCodeRange(134, 6), new PrefixCodeRange(198, 7), new PrefixCodeRange(326, 8), new PrefixCodeRange(582, 9), new PrefixCodeRange(1094, 10), new PrefixCodeRange(2118, 24) ]; exports2.kInsertRangeLut = [0, 0, 8, 8, 0, 16, 8, 16, 16]; exports2.kCopyRangeLut = [0, 8, 0, 8, 16, 0, 16, 8, 16]; }, {} ], 10: [ function(require2, module2, exports2) { function BrotliInput(buffer) { this.buffer = buffer; this.pos = 0; } BrotliInput.prototype.read = function(buf, i2, count) { if (this.pos + count > this.buffer.length) { count = this.buffer.length - this.pos; } for (var p3 = 0; p3 < count; p3++) buf[i2 + p3] = this.buffer[this.pos + p3]; this.pos += count; return count; }; exports2.BrotliInput = BrotliInput; function BrotliOutput(buf) { this.buffer = buf; this.pos = 0; } BrotliOutput.prototype.write = function(buf, count) { if (this.pos + count > this.buffer.length) throw new Error( "Output buffer is not large enough" ); this.buffer.set(buf.subarray(0, count), this.pos); this.pos += count; return count; }; exports2.BrotliOutput = BrotliOutput; }, {} ], 11: [ function(require2, module2, exports2) { var BrotliDictionary = require2("./dictionary"); var kIdentity = 0; var kOmitLast1 = 1; var kOmitLast2 = 2; var kOmitLast3 = 3; var kOmitLast4 = 4; var kOmitLast5 = 5; var kOmitLast6 = 6; var kOmitLast7 = 7; var kOmitLast8 = 8; var kOmitLast9 = 9; var kUppercaseFirst = 10; var kUppercaseAll = 11; var kOmitFirst1 = 12; var kOmitFirst2 = 13; var kOmitFirst3 = 14; var kOmitFirst4 = 15; var kOmitFirst5 = 16; var kOmitFirst6 = 17; var kOmitFirst7 = 18; var kOmitFirst8 = 19; var kOmitFirst9 = 20; function Transform(prefix2, transform, suffix) { this.prefix = new Uint8Array(prefix2.length); this.transform = transform; this.suffix = new Uint8Array(suffix.length); for (var i2 = 0; i2 < prefix2.length; i2++) this.prefix[i2] = prefix2.charCodeAt(i2); for (var i2 = 0; i2 < suffix.length; i2++) this.suffix[i2] = suffix.charCodeAt(i2); } var kTransforms = [ new Transform("", kIdentity, ""), new Transform("", kIdentity, " "), new Transform(" ", kIdentity, " "), new Transform("", kOmitFirst1, ""), new Transform("", kUppercaseFirst, " "), new Transform("", kIdentity, " the "), new Transform(" ", kIdentity, ""), new Transform("s ", kIdentity, " "), new Transform("", kIdentity, " of "), new Transform("", kUppercaseFirst, ""), new Transform("", kIdentity, " and "), new Transform("", kOmitFirst2, ""), new Transform("", kOmitLast1, ""), new Transform(", ", kIdentity, " "), new Transform("", kIdentity, ", "), new Transform(" ", kUppercaseFirst, " "), new Transform("", kIdentity, " in "), new Transform("", kIdentity, " to "), new Transform("e ", kIdentity, " "), new Transform("", kIdentity, '"'), new Transform("", kIdentity, "."), new Transform("", kIdentity, '">'), new Transform("", kIdentity, "\n"), new Transform("", kOmitLast3, ""), new Transform("", kIdentity, "]"), new Transform("", kIdentity, " for "), new Transform("", kOmitFirst3, ""), new Transform("", kOmitLast2, ""), new Transform("", kIdentity, " a "), new Transform("", kIdentity, " that "), new Transform(" ", kUppercaseFirst, ""), new Transform("", kIdentity, ". "), new Transform(".", kIdentity, ""), new Transform(" ", kIdentity, ", "), new Transform("", kOmitFirst4, ""), new Transform("", kIdentity, " with "), new Transform("", kIdentity, "'"), new Transform("", kIdentity, " from "), new Transform("", kIdentity, " by "), new Transform("", kOmitFirst5, ""), new Transform("", kOmitFirst6, ""), new Transform(" the ", kIdentity, ""), new Transform("", kOmitLast4, ""), new Transform("", kIdentity, ". The "), new Transform("", kUppercaseAll, ""), new Transform("", kIdentity, " on "), new Transform("", kIdentity, " as "), new Transform("", kIdentity, " is "), new Transform("", kOmitLast7, ""), new Transform("", kOmitLast1, "ing "), new Transform("", kIdentity, "\n "), new Transform("", kIdentity, ":"), new Transform(" ", kIdentity, ". "), new Transform("", kIdentity, "ed "), new Transform("", kOmitFirst9, ""), new Transform("", kOmitFirst7, ""), new Transform("", kOmitLast6, ""), new Transform("", kIdentity, "("), new Transform("", kUppercaseFirst, ", "), new Transform("", kOmitLast8, ""), new Transform("", kIdentity, " at "), new Transform("", kIdentity, "ly "), new Transform(" the ", kIdentity, " of "), new Transform("", kOmitLast5, ""), new Transform("", kOmitLast9, ""), new Transform(" ", kUppercaseFirst, ", "), new Transform("", kUppercaseFirst, '"'), new Transform(".", kIdentity, "("), new Transform("", kUppercaseAll, " "), new Transform("", kUppercaseFirst, '">'), new Transform("", kIdentity, '="'), new Transform(" ", kIdentity, "."), new Transform(".com/", kIdentity, ""), new Transform(" the ", kIdentity, " of the "), new Transform("", kUppercaseFirst, "'"), new Transform("", kIdentity, ". This "), new Transform("", kIdentity, ","), new Transform(".", kIdentity, " "), new Transform("", kUppercaseFirst, "("), new Transform("", kUppercaseFirst, "."), new Transform("", kIdentity, " not "), new Transform(" ", kIdentity, '="'), new Transform("", kIdentity, "er "), new Transform(" ", kUppercaseAll, " "), new Transform("", kIdentity, "al "), new Transform(" ", kUppercaseAll, ""), new Transform("", kIdentity, "='"), new Transform("", kUppercaseAll, '"'), new Transform("", kUppercaseFirst, ". "), new Transform(" ", kIdentity, "("), new Transform("", kIdentity, "ful "), new Transform(" ", kUppercaseFirst, ". "), new Transform("", kIdentity, "ive "), new Transform("", kIdentity, "less "), new Transform("", kUppercaseAll, "'"), new Transform("", kIdentity, "est "), new Transform(" ", kUppercaseFirst, "."), new Transform("", kUppercaseAll, '">'), new Transform(" ", kIdentity, "='"), new Transform("", kUppercaseFirst, ","), new Transform("", kIdentity, "ize "), new Transform("", kUppercaseAll, "."), new Transform("\xC2\xA0", kIdentity, ""), new Transform(" ", kIdentity, ","), new Transform("", kUppercaseFirst, '="'), new Transform("", kUppercaseAll, '="'), new Transform("", kIdentity, "ous "), new Transform("", kUppercaseAll, ", "), new Transform("", kUppercaseFirst, "='"), new Transform(" ", kUppercaseFirst, ","), new Transform(" ", kUppercaseAll, '="'), new Transform(" ", kUppercaseAll, ", "), new Transform("", kUppercaseAll, ","), new Transform("", kUppercaseAll, "("), new Transform("", kUppercaseAll, ". "), new Transform(" ", kUppercaseAll, "."), new Transform("", kUppercaseAll, "='"), new Transform(" ", kUppercaseAll, ". "), new Transform(" ", kUppercaseFirst, '="'), new Transform(" ", kUppercaseAll, "='"), new Transform(" ", kUppercaseFirst, "='") ]; exports2.kTransforms = kTransforms; exports2.kNumTransforms = kTransforms.length; function ToUpperCase(p3, i2) { if (p3[i2] < 192) { if (p3[i2] >= 97 && p3[i2] <= 122) { p3[i2] ^= 32; } return 1; } if (p3[i2] < 224) { p3[i2 + 1] ^= 32; return 2; } p3[i2 + 2] ^= 5; return 3; } exports2.transformDictionaryWord = function(dst, idx, word, len, transform) { var prefix2 = kTransforms[transform].prefix; var suffix = kTransforms[transform].suffix; var t3 = kTransforms[transform].transform; var skip = t3 < kOmitFirst1 ? 0 : t3 - (kOmitFirst1 - 1); var i2 = 0; var start_idx = idx; var uppercase; if (skip > len) { skip = len; } var prefix_pos = 0; while (prefix_pos < prefix2.length) { dst[idx++] = prefix2[prefix_pos++]; } word += skip; len -= skip; if (t3 <= kOmitLast9) { len -= t3; } for (i2 = 0; i2 < len; i2++) { dst[idx++] = BrotliDictionary.dictionary[word + i2]; } uppercase = idx - len; if (t3 === kUppercaseFirst) { ToUpperCase(dst, uppercase); } else if (t3 === kUppercaseAll) { while (len > 0) { var step = ToUpperCase(dst, uppercase); uppercase += step; len -= step; } } var suffix_pos = 0; while (suffix_pos < suffix.length) { dst[idx++] = suffix[suffix_pos++]; } return idx - start_idx; }; }, { "./dictionary": 6 } ], 12: [ function(require2, module2, exports2) { module2.exports = require2("./dec/decode").BrotliDecompressBuffer; }, { "./dec/decode": 3 } ] }, {}, [12] )(12); })(); // packages/global-styles-ui/build-module/font-library/lib/inflate.mjs var __require3 = /* @__PURE__ */ ((x2) => typeof __require !== "undefined" ? __require : typeof Proxy !== "undefined" ? new Proxy(x2, { get: (a2, b2) => (typeof __require !== "undefined" ? __require : a2)[b2] }) : x2)(function(x2) { if (typeof __require !== "undefined") return __require.apply(this, arguments); throw Error('Dynamic require of "' + x2 + '" is not supported'); }); var inflate_default = (function() { var define, module, exports; return (/* @__PURE__ */ (function() { function r3(e2, n2, t3) { function o3(i22, f2) { if (!n2[i22]) { if (!e2[i22]) { var c6 = "function" == typeof __require3 && __require3; if (!f2 && c6) return c6(i22, true); if (u2) return u2(i22, true); var a2 = new Error("Cannot find module '" + i22 + "'"); throw a2.code = "MODULE_NOT_FOUND", a2; } var p3 = n2[i22] = { exports: {} }; e2[i22][0].call( p3.exports, function(r22) { var n22 = e2[i22][1][r22]; return o3(n22 || r22); }, p3, p3.exports, r3, e2, n2, t3 ); } return n2[i22].exports; } for (var u2 = "function" == typeof __require3 && __require3, i2 = 0; i2 < t3.length; i2++) o3(t3[i2]); return o3; } return r3; })())( { 1: [ function(require2, module2, exports2) { "use strict"; var TYPED_OK = typeof Uint8Array !== "undefined" && typeof Uint16Array !== "undefined" && typeof Int32Array !== "undefined"; function _has(obj, key) { return Object.prototype.hasOwnProperty.call(obj, key); } exports2.assign = function(obj) { var sources = Array.prototype.slice.call( arguments, 1 ); while (sources.length) { var source = sources.shift(); if (!source) { continue; } if (typeof source !== "object") { throw new TypeError( source + "must be non-object" ); } for (var p3 in source) { if (_has(source, p3)) { obj[p3] = source[p3]; } } } return obj; }; exports2.shrinkBuf = function(buf, size) { if (buf.length === size) { return buf; } if (buf.subarray) { return buf.subarray(0, size); } buf.length = size; return buf; }; var fnTyped = { arraySet: function(dest, src, src_offs, len, dest_offs) { if (src.subarray && dest.subarray) { dest.set( src.subarray(src_offs, src_offs + len), dest_offs ); return; } for (var i2 = 0; i2 < len; i2++) { dest[dest_offs + i2] = src[src_offs + i2]; } }, // Join array of chunks to single array. flattenChunks: function(chunks) { var i2, l2, len, pos, chunk2, result; len = 0; for (i2 = 0, l2 = chunks.length; i2 < l2; i2++) { len += chunks[i2].length; } result = new Uint8Array(len); pos = 0; for (i2 = 0, l2 = chunks.length; i2 < l2; i2++) { chunk2 = chunks[i2]; result.set(chunk2, pos); pos += chunk2.length; } return result; } }; var fnUntyped = { arraySet: function(dest, src, src_offs, len, dest_offs) { for (var i2 = 0; i2 < len; i2++) { dest[dest_offs + i2] = src[src_offs + i2]; } }, // Join array of chunks to single array. flattenChunks: function(chunks) { return [].concat.apply([], chunks); } }; exports2.setTyped = function(on) { if (on) { exports2.Buf8 = Uint8Array; exports2.Buf16 = Uint16Array; exports2.Buf32 = Int32Array; exports2.assign(exports2, fnTyped); } else { exports2.Buf8 = Array; exports2.Buf16 = Array; exports2.Buf32 = Array; exports2.assign(exports2, fnUntyped); } }; exports2.setTyped(TYPED_OK); }, {} ], 2: [ function(require2, module2, exports2) { "use strict"; var utils = require2("./common"); var STR_APPLY_OK = true; var STR_APPLY_UIA_OK = true; try { String.fromCharCode.apply(null, [0]); } catch (__150) { STR_APPLY_OK = false; } try { String.fromCharCode.apply(null, new Uint8Array(1)); } catch (__150) { STR_APPLY_UIA_OK = false; } var _utf8len = new utils.Buf8(256); for (var q = 0; q < 256; q++) { _utf8len[q] = q >= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1; } _utf8len[254] = _utf8len[254] = 1; exports2.string2buf = function(str) { var buf, c6, c22, m_pos, i2, str_len = str.length, buf_len = 0; for (m_pos = 0; m_pos < str_len; m_pos++) { c6 = str.charCodeAt(m_pos); if ((c6 & 64512) === 55296 && m_pos + 1 < str_len) { c22 = str.charCodeAt(m_pos + 1); if ((c22 & 64512) === 56320) { c6 = 65536 + (c6 - 55296 << 10) + (c22 - 56320); m_pos++; } } buf_len += c6 < 128 ? 1 : c6 < 2048 ? 2 : c6 < 65536 ? 3 : 4; } buf = new utils.Buf8(buf_len); for (i2 = 0, m_pos = 0; i2 < buf_len; m_pos++) { c6 = str.charCodeAt(m_pos); if ((c6 & 64512) === 55296 && m_pos + 1 < str_len) { c22 = str.charCodeAt(m_pos + 1); if ((c22 & 64512) === 56320) { c6 = 65536 + (c6 - 55296 << 10) + (c22 - 56320); m_pos++; } } if (c6 < 128) { buf[i2++] = c6; } else if (c6 < 2048) { buf[i2++] = 192 | c6 >>> 6; buf[i2++] = 128 | c6 & 63; } else if (c6 < 65536) { buf[i2++] = 224 | c6 >>> 12; buf[i2++] = 128 | c6 >>> 6 & 63; buf[i2++] = 128 | c6 & 63; } else { buf[i2++] = 240 | c6 >>> 18; buf[i2++] = 128 | c6 >>> 12 & 63; buf[i2++] = 128 | c6 >>> 6 & 63; buf[i2++] = 128 | c6 & 63; } } return buf; }; function buf2binstring(buf, len) { if (len < 65534) { if (buf.subarray && STR_APPLY_UIA_OK || !buf.subarray && STR_APPLY_OK) { return String.fromCharCode.apply( null, utils.shrinkBuf(buf, len) ); } } var result = ""; for (var i2 = 0; i2 < len; i2++) { result += String.fromCharCode(buf[i2]); } return result; } exports2.buf2binstring = function(buf) { return buf2binstring(buf, buf.length); }; exports2.binstring2buf = function(str) { var buf = new utils.Buf8(str.length); for (var i2 = 0, len = buf.length; i2 < len; i2++) { buf[i2] = str.charCodeAt(i2); } return buf; }; exports2.buf2string = function(buf, max) { var i2, out, c6, c_len; var len = max || buf.length; var utf16buf = new Array(len * 2); for (out = 0, i2 = 0; i2 < len; ) { c6 = buf[i2++]; if (c6 < 128) { utf16buf[out++] = c6; continue; } c_len = _utf8len[c6]; if (c_len > 4) { utf16buf[out++] = 65533; i2 += c_len - 1; continue; } c6 &= c_len === 2 ? 31 : c_len === 3 ? 15 : 7; while (c_len > 1 && i2 < len) { c6 = c6 << 6 | buf[i2++] & 63; c_len--; } if (c_len > 1) { utf16buf[out++] = 65533; continue; } if (c6 < 65536) { utf16buf[out++] = c6; } else { c6 -= 65536; utf16buf[out++] = 55296 | c6 >> 10 & 1023; utf16buf[out++] = 56320 | c6 & 1023; } } return buf2binstring(utf16buf, out); }; exports2.utf8border = function(buf, max) { var pos; max = max || buf.length; if (max > buf.length) { max = buf.length; } pos = max - 1; while (pos >= 0 && (buf[pos] & 192) === 128) { pos--; } if (pos < 0) { return max; } if (pos === 0) { return max; } return pos + _utf8len[buf[pos]] > max ? pos : max; }; }, { "./common": 1 } ], 3: [ function(require2, module2, exports2) { "use strict"; function adler32(adler, buf, len, pos) { var s1 = adler & 65535 | 0, s2 = adler >>> 16 & 65535 | 0, n2 = 0; while (len !== 0) { n2 = len > 2e3 ? 2e3 : len; len -= n2; do { s1 = s1 + buf[pos++] | 0; s2 = s2 + s1 | 0; } while (--n2); s1 %= 65521; s2 %= 65521; } return s1 | s2 << 16 | 0; } module2.exports = adler32; }, {} ], 4: [ function(require2, module2, exports2) { "use strict"; module2.exports = { /* Allowed flush values; see deflate() and inflate() below for details */ Z_NO_FLUSH: 0, Z_PARTIAL_FLUSH: 1, Z_SYNC_FLUSH: 2, Z_FULL_FLUSH: 3, Z_FINISH: 4, Z_BLOCK: 5, Z_TREES: 6, /* Return codes for the compression/decompression functions. Negative values * are errors, positive values are used for special but normal events. */ Z_OK: 0, Z_STREAM_END: 1, Z_NEED_DICT: 2, Z_ERRNO: -1, Z_STREAM_ERROR: -2, Z_DATA_ERROR: -3, //Z_MEM_ERROR: -4, Z_BUF_ERROR: -5, //Z_VERSION_ERROR: -6, /* compression levels */ Z_NO_COMPRESSION: 0, Z_BEST_SPEED: 1, Z_BEST_COMPRESSION: 9, Z_DEFAULT_COMPRESSION: -1, Z_FILTERED: 1, Z_HUFFMAN_ONLY: 2, Z_RLE: 3, Z_FIXED: 4, Z_DEFAULT_STRATEGY: 0, /* Possible values of the data_type field (though see inflate()) */ Z_BINARY: 0, Z_TEXT: 1, //Z_ASCII: 1, // = Z_TEXT (deprecated) Z_UNKNOWN: 2, /* The deflate compression method */ Z_DEFLATED: 8 //Z_NULL: null // Use -1 or null inline, depending on var type }; }, {} ], 5: [ function(require2, module2, exports2) { "use strict"; function makeTable() { var c6, table = []; for (var n2 = 0; n2 < 256; n2++) { c6 = n2; for (var k2 = 0; k2 < 8; k2++) { c6 = c6 & 1 ? 3988292384 ^ c6 >>> 1 : c6 >>> 1; } table[n2] = c6; } return table; } var crcTable = makeTable(); function crc32(crc, buf, len, pos) { var t3 = crcTable, end = pos + len; crc ^= -1; for (var i2 = pos; i2 < end; i2++) { crc = crc >>> 8 ^ t3[(crc ^ buf[i2]) & 255]; } return crc ^ -1; } module2.exports = crc32; }, {} ], 6: [ function(require2, module2, exports2) { "use strict"; function GZheader() { this.text = 0; this.time = 0; this.xflags = 0; this.os = 0; this.extra = null; this.extra_len = 0; this.name = ""; this.comment = ""; this.hcrc = 0; this.done = false; } module2.exports = GZheader; }, {} ], 7: [ function(require2, module2, exports2) { "use strict"; var BAD = 30; var TYPE = 12; module2.exports = function inflate_fast(strm, start2) { var state; var _in; var last; var _out; var beg; var end; var dmax; var wsize; var whave; var wnext; var s_window; var hold; var bits; var lcode; var dcode; var lmask; var dmask; var here; var op; var len; var dist; var from; var from_source; var input, output; state = strm.state; _in = strm.next_in; input = strm.input; last = _in + (strm.avail_in - 5); _out = strm.next_out; output = strm.output; beg = _out - (start2 - strm.avail_out); end = _out + (strm.avail_out - 257); dmax = state.dmax; wsize = state.wsize; whave = state.whave; wnext = state.wnext; s_window = state.window; hold = state.hold; bits = state.bits; lcode = state.lencode; dcode = state.distcode; lmask = (1 << state.lenbits) - 1; dmask = (1 << state.distbits) - 1; top: do { if (bits < 15) { hold += input[_in++] << bits; bits += 8; hold += input[_in++] << bits; bits += 8; } here = lcode[hold & lmask]; dolen: for (; ; ) { op = here >>> 24; hold >>>= op; bits -= op; op = here >>> 16 & 255; if (op === 0) { output[_out++] = here & 65535; } else if (op & 16) { len = here & 65535; op &= 15; if (op) { if (bits < op) { hold += input[_in++] << bits; bits += 8; } len += hold & (1 << op) - 1; hold >>>= op; bits -= op; } if (bits < 15) { hold += input[_in++] << bits; bits += 8; hold += input[_in++] << bits; bits += 8; } here = dcode[hold & dmask]; dodist: for (; ; ) { op = here >>> 24; hold >>>= op; bits -= op; op = here >>> 16 & 255; if (op & 16) { dist = here & 65535; op &= 15; if (bits < op) { hold += input[_in++] << bits; bits += 8; if (bits < op) { hold += input[_in++] << bits; bits += 8; } } dist += hold & (1 << op) - 1; if (dist > dmax) { strm.msg = "invalid distance too far back"; state.mode = BAD; break top; } hold >>>= op; bits -= op; op = _out - beg; if (dist > op) { op = dist - op; if (op > whave) { if (state.sane) { strm.msg = "invalid distance too far back"; state.mode = BAD; break top; } } from = 0; from_source = s_window; if (wnext === 0) { from += wsize - op; if (op < len) { len -= op; do { output[_out++] = s_window[from++]; } while (--op); from = _out - dist; from_source = output; } } else if (wnext < op) { from += wsize + wnext - op; op -= wnext; if (op < len) { len -= op; do { output[_out++] = s_window[from++]; } while (--op); from = 0; if (wnext < len) { op = wnext; len -= op; do { output[_out++] = s_window[from++]; } while (--op); from = _out - dist; from_source = output; } } } else { from += wnext - op; if (op < len) { len -= op; do { output[_out++] = s_window[from++]; } while (--op); from = _out - dist; from_source = output; } } while (len > 2) { output[_out++] = from_source[from++]; output[_out++] = from_source[from++]; output[_out++] = from_source[from++]; len -= 3; } if (len) { output[_out++] = from_source[from++]; if (len > 1) { output[_out++] = from_source[from++]; } } } else { from = _out - dist; do { output[_out++] = output[from++]; output[_out++] = output[from++]; output[_out++] = output[from++]; len -= 3; } while (len > 2); if (len) { output[_out++] = output[from++]; if (len > 1) { output[_out++] = output[from++]; } } } } else if ((op & 64) === 0) { here = dcode[(here & 65535) + (hold & (1 << op) - 1)]; continue dodist; } else { strm.msg = "invalid distance code"; state.mode = BAD; break top; } break; } } else if ((op & 64) === 0) { here = lcode[(here & 65535) + (hold & (1 << op) - 1)]; continue dolen; } else if (op & 32) { state.mode = TYPE; break top; } else { strm.msg = "invalid literal/length code"; state.mode = BAD; break top; } break; } } while (_in < last && _out < end); len = bits >> 3; _in -= len; bits -= len << 3; hold &= (1 << bits) - 1; strm.next_in = _in; strm.next_out = _out; strm.avail_in = _in < last ? 5 + (last - _in) : 5 - (_in - last); strm.avail_out = _out < end ? 257 + (end - _out) : 257 - (_out - end); state.hold = hold; state.bits = bits; return; }; }, {} ], 8: [ function(require2, module2, exports2) { "use strict"; var utils = require2("../utils/common"); var adler32 = require2("./adler32"); var crc32 = require2("./crc32"); var inflate_fast = require2("./inffast"); var inflate_table = require2("./inftrees"); var CODES = 0; var LENS = 1; var DISTS = 2; var Z_FINISH = 4; var Z_BLOCK = 5; var Z_TREES = 6; var Z_OK = 0; var Z_STREAM_END = 1; var Z_NEED_DICT = 2; var Z_STREAM_ERROR = -2; var Z_DATA_ERROR = -3; var Z_MEM_ERROR = -4; var Z_BUF_ERROR = -5; var Z_DEFLATED = 8; var HEAD = 1; var FLAGS = 2; var TIME = 3; var OS = 4; var EXLEN = 5; var EXTRA = 6; var NAME = 7; var COMMENT = 8; var HCRC = 9; var DICTID = 10; var DICT = 11; var TYPE = 12; var TYPEDO = 13; var STORED = 14; var COPY_ = 15; var COPY = 16; var TABLE = 17; var LENLENS = 18; var CODELENS = 19; var LEN_ = 20; var LEN = 21; var LENEXT = 22; var DIST = 23; var DISTEXT = 24; var MATCH = 25; var LIT = 26; var CHECK = 27; var LENGTH = 28; var DONE = 29; var BAD = 30; var MEM = 31; var SYNC = 32; var ENOUGH_LENS = 852; var ENOUGH_DISTS = 592; var MAX_WBITS = 15; var DEF_WBITS = MAX_WBITS; function zswap32(q) { return (q >>> 24 & 255) + (q >>> 8 & 65280) + ((q & 65280) << 8) + ((q & 255) << 24); } function InflateState() { this.mode = 0; this.last = false; this.wrap = 0; this.havedict = false; this.flags = 0; this.dmax = 0; this.check = 0; this.total = 0; this.head = null; this.wbits = 0; this.wsize = 0; this.whave = 0; this.wnext = 0; this.window = null; this.hold = 0; this.bits = 0; this.length = 0; this.offset = 0; this.extra = 0; this.lencode = null; this.distcode = null; this.lenbits = 0; this.distbits = 0; this.ncode = 0; this.nlen = 0; this.ndist = 0; this.have = 0; this.next = null; this.lens = new utils.Buf16( 320 ); this.work = new utils.Buf16( 288 ); this.lendyn = null; this.distdyn = null; this.sane = 0; this.back = 0; this.was = 0; } function inflateResetKeep(strm) { var state; if (!strm || !strm.state) { return Z_STREAM_ERROR; } state = strm.state; strm.total_in = strm.total_out = state.total = 0; strm.msg = ""; if (state.wrap) { strm.adler = state.wrap & 1; } state.mode = HEAD; state.last = 0; state.havedict = 0; state.dmax = 32768; state.head = null; state.hold = 0; state.bits = 0; state.lencode = state.lendyn = new utils.Buf32( ENOUGH_LENS ); state.distcode = state.distdyn = new utils.Buf32( ENOUGH_DISTS ); state.sane = 1; state.back = -1; return Z_OK; } function inflateReset(strm) { var state; if (!strm || !strm.state) { return Z_STREAM_ERROR; } state = strm.state; state.wsize = 0; state.whave = 0; state.wnext = 0; return inflateResetKeep(strm); } function inflateReset2(strm, windowBits) { var wrap; var state; if (!strm || !strm.state) { return Z_STREAM_ERROR; } state = strm.state; if (windowBits < 0) { wrap = 0; windowBits = -windowBits; } else { wrap = (windowBits >> 4) + 1; if (windowBits < 48) { windowBits &= 15; } } if (windowBits && (windowBits < 8 || windowBits > 15)) { return Z_STREAM_ERROR; } if (state.window !== null && state.wbits !== windowBits) { state.window = null; } state.wrap = wrap; state.wbits = windowBits; return inflateReset(strm); } function inflateInit2(strm, windowBits) { var ret; var state; if (!strm) { return Z_STREAM_ERROR; } state = new InflateState(); strm.state = state; state.window = null; ret = inflateReset2(strm, windowBits); if (ret !== Z_OK) { strm.state = null; } return ret; } function inflateInit(strm) { return inflateInit2(strm, DEF_WBITS); } var virgin = true; var lenfix, distfix; function fixedtables(state) { if (virgin) { var sym; lenfix = new utils.Buf32(512); distfix = new utils.Buf32(32); sym = 0; while (sym < 144) { state.lens[sym++] = 8; } while (sym < 256) { state.lens[sym++] = 9; } while (sym < 280) { state.lens[sym++] = 7; } while (sym < 288) { state.lens[sym++] = 8; } inflate_table( LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 } ); sym = 0; while (sym < 32) { state.lens[sym++] = 5; } inflate_table( DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 } ); virgin = false; } state.lencode = lenfix; state.lenbits = 9; state.distcode = distfix; state.distbits = 5; } function updatewindow(strm, src, end, copy) { var dist; var state = strm.state; if (state.window === null) { state.wsize = 1 << state.wbits; state.wnext = 0; state.whave = 0; state.window = new utils.Buf8(state.wsize); } if (copy >= state.wsize) { utils.arraySet( state.window, src, end - state.wsize, state.wsize, 0 ); state.wnext = 0; state.whave = state.wsize; } else { dist = state.wsize - state.wnext; if (dist > copy) { dist = copy; } utils.arraySet( state.window, src, end - copy, dist, state.wnext ); copy -= dist; if (copy) { utils.arraySet( state.window, src, end - copy, copy, 0 ); state.wnext = copy; state.whave = state.wsize; } else { state.wnext += dist; if (state.wnext === state.wsize) { state.wnext = 0; } if (state.whave < state.wsize) { state.whave += dist; } } } return 0; } function inflate(strm, flush2) { var state; var input, output; var next; var put; var have, left; var hold; var bits; var _in, _out; var copy; var from; var from_source; var here = 0; var here_bits, here_op, here_val; var last_bits, last_op, last_val; var len; var ret; var hbuf = new utils.Buf8( 4 ); var opts; var n2; var order = ( /* permutation of code lengths */ [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ] ); if (!strm || !strm.state || !strm.output || !strm.input && strm.avail_in !== 0) { return Z_STREAM_ERROR; } state = strm.state; if (state.mode === TYPE) { state.mode = TYPEDO; } put = strm.next_out; output = strm.output; left = strm.avail_out; next = strm.next_in; input = strm.input; have = strm.avail_in; hold = state.hold; bits = state.bits; _in = have; _out = left; ret = Z_OK; inf_leave: for (; ; ) { switch (state.mode) { case HEAD: if (state.wrap === 0) { state.mode = TYPEDO; break; } while (bits < 16) { if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } if (state.wrap & 2 && hold === 35615) { state.check = 0; hbuf[0] = hold & 255; hbuf[1] = hold >>> 8 & 255; state.check = crc32( state.check, hbuf, 2, 0 ); hold = 0; bits = 0; state.mode = FLAGS; break; } state.flags = 0; if (state.head) { state.head.done = false; } if (!(state.wrap & 1) || (((hold & 255) << 8) + (hold >> 8)) % 31) { strm.msg = "incorrect header check"; state.mode = BAD; break; } if ((hold & 15) !== Z_DEFLATED) { strm.msg = "unknown compression method"; state.mode = BAD; break; } hold >>>= 4; bits -= 4; len = (hold & 15) + 8; if (state.wbits === 0) { state.wbits = len; } else if (len > state.wbits) { strm.msg = "invalid window size"; state.mode = BAD; break; } state.dmax = 1 << len; strm.adler = state.check = 1; state.mode = hold & 512 ? DICTID : TYPE; hold = 0; bits = 0; break; case FLAGS: while (bits < 16) { if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } state.flags = hold; if ((state.flags & 255) !== Z_DEFLATED) { strm.msg = "unknown compression method"; state.mode = BAD; break; } if (state.flags & 57344) { strm.msg = "unknown header flags set"; state.mode = BAD; break; } if (state.head) { state.head.text = hold >> 8 & 1; } if (state.flags & 512) { hbuf[0] = hold & 255; hbuf[1] = hold >>> 8 & 255; state.check = crc32( state.check, hbuf, 2, 0 ); } hold = 0; bits = 0; state.mode = TIME; /* falls through */ case TIME: while (bits < 32) { if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } if (state.head) { state.head.time = hold; } if (state.flags & 512) { hbuf[0] = hold & 255; hbuf[1] = hold >>> 8 & 255; hbuf[2] = hold >>> 16 & 255; hbuf[3] = hold >>> 24 & 255; state.check = crc32( state.check, hbuf, 4, 0 ); } hold = 0; bits = 0; state.mode = OS; /* falls through */ case OS: while (bits < 16) { if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } if (state.head) { state.head.xflags = hold & 255; state.head.os = hold >> 8; } if (state.flags & 512) { hbuf[0] = hold & 255; hbuf[1] = hold >>> 8 & 255; state.check = crc32( state.check, hbuf, 2, 0 ); } hold = 0; bits = 0; state.mode = EXLEN; /* falls through */ case EXLEN: if (state.flags & 1024) { while (bits < 16) { if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } state.length = hold; if (state.head) { state.head.extra_len = hold; } if (state.flags & 512) { hbuf[0] = hold & 255; hbuf[1] = hold >>> 8 & 255; state.check = crc32( state.check, hbuf, 2, 0 ); } hold = 0; bits = 0; } else if (state.head) { state.head.extra = null; } state.mode = EXTRA; /* falls through */ case EXTRA: if (state.flags & 1024) { copy = state.length; if (copy > have) { copy = have; } if (copy) { if (state.head) { len = state.head.extra_len - state.length; if (!state.head.extra) { state.head.extra = new Array( state.head.extra_len ); } utils.arraySet( state.head.extra, input, next, // extra field is limited to 65536 bytes // - no need for additional size check copy, /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/ len ); } if (state.flags & 512) { state.check = crc32( state.check, input, copy, next ); } have -= copy; next += copy; state.length -= copy; } if (state.length) { break inf_leave; } } state.length = 0; state.mode = NAME; /* falls through */ case NAME: if (state.flags & 2048) { if (have === 0) { break inf_leave; } copy = 0; do { len = input[next + copy++]; if (state.head && len && state.length < 65536) { state.head.name += String.fromCharCode(len); } } while (len && copy < have); if (state.flags & 512) { state.check = crc32( state.check, input, copy, next ); } have -= copy; next += copy; if (len) { break inf_leave; } } else if (state.head) { state.head.name = null; } state.length = 0; state.mode = COMMENT; /* falls through */ case COMMENT: if (state.flags & 4096) { if (have === 0) { break inf_leave; } copy = 0; do { len = input[next + copy++]; if (state.head && len && state.length < 65536) { state.head.comment += String.fromCharCode(len); } } while (len && copy < have); if (state.flags & 512) { state.check = crc32( state.check, input, copy, next ); } have -= copy; next += copy; if (len) { break inf_leave; } } else if (state.head) { state.head.comment = null; } state.mode = HCRC; /* falls through */ case HCRC: if (state.flags & 512) { while (bits < 16) { if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } if (hold !== (state.check & 65535)) { strm.msg = "header crc mismatch"; state.mode = BAD; break; } hold = 0; bits = 0; } if (state.head) { state.head.hcrc = state.flags >> 9 & 1; state.head.done = true; } strm.adler = state.check = 0; state.mode = TYPE; break; case DICTID: while (bits < 32) { if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } strm.adler = state.check = zswap32(hold); hold = 0; bits = 0; state.mode = DICT; /* falls through */ case DICT: if (state.havedict === 0) { strm.next_out = put; strm.avail_out = left; strm.next_in = next; strm.avail_in = have; state.hold = hold; state.bits = bits; return Z_NEED_DICT; } strm.adler = state.check = 1; state.mode = TYPE; /* falls through */ case TYPE: if (flush2 === Z_BLOCK || flush2 === Z_TREES) { break inf_leave; } /* falls through */ case TYPEDO: if (state.last) { hold >>>= bits & 7; bits -= bits & 7; state.mode = CHECK; break; } while (bits < 3) { if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } state.last = hold & 1; hold >>>= 1; bits -= 1; switch (hold & 3) { case 0: state.mode = STORED; break; case 1: fixedtables(state); state.mode = LEN_; if (flush2 === Z_TREES) { hold >>>= 2; bits -= 2; break inf_leave; } break; case 2: state.mode = TABLE; break; case 3: strm.msg = "invalid block type"; state.mode = BAD; } hold >>>= 2; bits -= 2; break; case STORED: hold >>>= bits & 7; bits -= bits & 7; while (bits < 32) { if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } if ((hold & 65535) !== (hold >>> 16 ^ 65535)) { strm.msg = "invalid stored block lengths"; state.mode = BAD; break; } state.length = hold & 65535; hold = 0; bits = 0; state.mode = COPY_; if (flush2 === Z_TREES) { break inf_leave; } /* falls through */ case COPY_: state.mode = COPY; /* falls through */ case COPY: copy = state.length; if (copy) { if (copy > have) { copy = have; } if (copy > left) { copy = left; } if (copy === 0) { break inf_leave; } utils.arraySet( output, input, next, copy, put ); have -= copy; next += copy; left -= copy; put += copy; state.length -= copy; break; } state.mode = TYPE; break; case TABLE: while (bits < 14) { if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } state.nlen = (hold & 31) + 257; hold >>>= 5; bits -= 5; state.ndist = (hold & 31) + 1; hold >>>= 5; bits -= 5; state.ncode = (hold & 15) + 4; hold >>>= 4; bits -= 4; if (state.nlen > 286 || state.ndist > 30) { strm.msg = "too many length or distance symbols"; state.mode = BAD; break; } state.have = 0; state.mode = LENLENS; /* falls through */ case LENLENS: while (state.have < state.ncode) { while (bits < 3) { if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } state.lens[order[state.have++]] = hold & 7; hold >>>= 3; bits -= 3; } while (state.have < 19) { state.lens[order[state.have++]] = 0; } state.lencode = state.lendyn; state.lenbits = 7; opts = { bits: state.lenbits }; ret = inflate_table( CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts ); state.lenbits = opts.bits; if (ret) { strm.msg = "invalid code lengths set"; state.mode = BAD; break; } state.have = 0; state.mode = CODELENS; /* falls through */ case CODELENS: while (state.have < state.nlen + state.ndist) { for (; ; ) { here = state.lencode[hold & (1 << state.lenbits) - 1]; here_bits = here >>> 24; here_op = here >>> 16 & 255; here_val = here & 65535; if (here_bits <= bits) { break; } if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } if (here_val < 16) { hold >>>= here_bits; bits -= here_bits; state.lens[state.have++] = here_val; } else { if (here_val === 16) { n2 = here_bits + 2; while (bits < n2) { if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } hold >>>= here_bits; bits -= here_bits; if (state.have === 0) { strm.msg = "invalid bit length repeat"; state.mode = BAD; break; } len = state.lens[state.have - 1]; copy = 3 + (hold & 3); hold >>>= 2; bits -= 2; } else if (here_val === 17) { n2 = here_bits + 3; while (bits < n2) { if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } hold >>>= here_bits; bits -= here_bits; len = 0; copy = 3 + (hold & 7); hold >>>= 3; bits -= 3; } else { n2 = here_bits + 7; while (bits < n2) { if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } hold >>>= here_bits; bits -= here_bits; len = 0; copy = 11 + (hold & 127); hold >>>= 7; bits -= 7; } if (state.have + copy > state.nlen + state.ndist) { strm.msg = "invalid bit length repeat"; state.mode = BAD; break; } while (copy--) { state.lens[state.have++] = len; } } } if (state.mode === BAD) { break; } if (state.lens[256] === 0) { strm.msg = "invalid code -- missing end-of-block"; state.mode = BAD; break; } state.lenbits = 9; opts = { bits: state.lenbits }; ret = inflate_table( LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts ); state.lenbits = opts.bits; if (ret) { strm.msg = "invalid literal/lengths set"; state.mode = BAD; break; } state.distbits = 6; state.distcode = state.distdyn; opts = { bits: state.distbits }; ret = inflate_table( DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts ); state.distbits = opts.bits; if (ret) { strm.msg = "invalid distances set"; state.mode = BAD; break; } state.mode = LEN_; if (flush2 === Z_TREES) { break inf_leave; } /* falls through */ case LEN_: state.mode = LEN; /* falls through */ case LEN: if (have >= 6 && left >= 258) { strm.next_out = put; strm.avail_out = left; strm.next_in = next; strm.avail_in = have; state.hold = hold; state.bits = bits; inflate_fast(strm, _out); put = strm.next_out; output = strm.output; left = strm.avail_out; next = strm.next_in; input = strm.input; have = strm.avail_in; hold = state.hold; bits = state.bits; if (state.mode === TYPE) { state.back = -1; } break; } state.back = 0; for (; ; ) { here = state.lencode[hold & (1 << state.lenbits) - 1]; here_bits = here >>> 24; here_op = here >>> 16 & 255; here_val = here & 65535; if (here_bits <= bits) { break; } if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } if (here_op && (here_op & 240) === 0) { last_bits = here_bits; last_op = here_op; last_val = here_val; for (; ; ) { here = state.lencode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)]; here_bits = here >>> 24; here_op = here >>> 16 & 255; here_val = here & 65535; if (last_bits + here_bits <= bits) { break; } if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } hold >>>= last_bits; bits -= last_bits; state.back += last_bits; } hold >>>= here_bits; bits -= here_bits; state.back += here_bits; state.length = here_val; if (here_op === 0) { state.mode = LIT; break; } if (here_op & 32) { state.back = -1; state.mode = TYPE; break; } if (here_op & 64) { strm.msg = "invalid literal/length code"; state.mode = BAD; break; } state.extra = here_op & 15; state.mode = LENEXT; /* falls through */ case LENEXT: if (state.extra) { n2 = state.extra; while (bits < n2) { if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } state.length += hold & (1 << state.extra) - 1; hold >>>= state.extra; bits -= state.extra; state.back += state.extra; } state.was = state.length; state.mode = DIST; /* falls through */ case DIST: for (; ; ) { here = state.distcode[hold & (1 << state.distbits) - 1]; here_bits = here >>> 24; here_op = here >>> 16 & 255; here_val = here & 65535; if (here_bits <= bits) { break; } if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } if ((here_op & 240) === 0) { last_bits = here_bits; last_op = here_op; last_val = here_val; for (; ; ) { here = state.distcode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)]; here_bits = here >>> 24; here_op = here >>> 16 & 255; here_val = here & 65535; if (last_bits + here_bits <= bits) { break; } if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } hold >>>= last_bits; bits -= last_bits; state.back += last_bits; } hold >>>= here_bits; bits -= here_bits; state.back += here_bits; if (here_op & 64) { strm.msg = "invalid distance code"; state.mode = BAD; break; } state.offset = here_val; state.extra = here_op & 15; state.mode = DISTEXT; /* falls through */ case DISTEXT: if (state.extra) { n2 = state.extra; while (bits < n2) { if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } state.offset += hold & (1 << state.extra) - 1; hold >>>= state.extra; bits -= state.extra; state.back += state.extra; } if (state.offset > state.dmax) { strm.msg = "invalid distance too far back"; state.mode = BAD; break; } state.mode = MATCH; /* falls through */ case MATCH: if (left === 0) { break inf_leave; } copy = _out - left; if (state.offset > copy) { copy = state.offset - copy; if (copy > state.whave) { if (state.sane) { strm.msg = "invalid distance too far back"; state.mode = BAD; break; } } if (copy > state.wnext) { copy -= state.wnext; from = state.wsize - copy; } else { from = state.wnext - copy; } if (copy > state.length) { copy = state.length; } from_source = state.window; } else { from_source = output; from = put - state.offset; copy = state.length; } if (copy > left) { copy = left; } left -= copy; state.length -= copy; do { output[put++] = from_source[from++]; } while (--copy); if (state.length === 0) { state.mode = LEN; } break; case LIT: if (left === 0) { break inf_leave; } output[put++] = state.length; left--; state.mode = LEN; break; case CHECK: if (state.wrap) { while (bits < 32) { if (have === 0) { break inf_leave; } have--; hold |= input[next++] << bits; bits += 8; } _out -= left; strm.total_out += _out; state.total += _out; if (_out) { strm.adler = state.check = /*UPDATE(state.check, put - _out, _out);*/ state.flags ? crc32( state.check, output, _out, put - _out ) : adler32( state.check, output, _out, put - _out ); } _out = left; if ((state.flags ? hold : zswap32(hold)) !== state.check) { strm.msg = "incorrect data check"; state.mode = BAD; break; } hold = 0; bits = 0; } state.mode = LENGTH; /* falls through */ case LENGTH: if (state.wrap && state.flags) { while (bits < 32) { if (have === 0) { break inf_leave; } have--; hold += input[next++] << bits; bits += 8; } if (hold !== (state.total & 4294967295)) { strm.msg = "incorrect length check"; state.mode = BAD; break; } hold = 0; bits = 0; } state.mode = DONE; /* falls through */ case DONE: ret = Z_STREAM_END; break inf_leave; case BAD: ret = Z_DATA_ERROR; break inf_leave; case MEM: return Z_MEM_ERROR; case SYNC: /* falls through */ default: return Z_STREAM_ERROR; } } strm.next_out = put; strm.avail_out = left; strm.next_in = next; strm.avail_in = have; state.hold = hold; state.bits = bits; if (state.wsize || _out !== strm.avail_out && state.mode < BAD && (state.mode < CHECK || flush2 !== Z_FINISH)) { if (updatewindow( strm, strm.output, strm.next_out, _out - strm.avail_out )) { state.mode = MEM; return Z_MEM_ERROR; } } _in -= strm.avail_in; _out -= strm.avail_out; strm.total_in += _in; strm.total_out += _out; state.total += _out; if (state.wrap && _out) { strm.adler = state.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/ state.flags ? crc32( state.check, output, _out, strm.next_out - _out ) : adler32( state.check, output, _out, strm.next_out - _out ); } strm.data_type = state.bits + (state.last ? 64 : 0) + (state.mode === TYPE ? 128 : 0) + (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0); if ((_in === 0 && _out === 0 || flush2 === Z_FINISH) && ret === Z_OK) { ret = Z_BUF_ERROR; } return ret; } function inflateEnd(strm) { if (!strm || !strm.state) { return Z_STREAM_ERROR; } var state = strm.state; if (state.window) { state.window = null; } strm.state = null; return Z_OK; } function inflateGetHeader(strm, head2) { var state; if (!strm || !strm.state) { return Z_STREAM_ERROR; } state = strm.state; if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR; } state.head = head2; head2.done = false; return Z_OK; } function inflateSetDictionary(strm, dictionary) { var dictLength = dictionary.length; var state; var dictid; var ret; if (!strm || !strm.state) { return Z_STREAM_ERROR; } state = strm.state; if (state.wrap !== 0 && state.mode !== DICT) { return Z_STREAM_ERROR; } if (state.mode === DICT) { dictid = 1; dictid = adler32( dictid, dictionary, dictLength, 0 ); if (dictid !== state.check) { return Z_DATA_ERROR; } } ret = updatewindow( strm, dictionary, dictLength, dictLength ); if (ret) { state.mode = MEM; return Z_MEM_ERROR; } state.havedict = 1; return Z_OK; } exports2.inflateReset = inflateReset; exports2.inflateReset2 = inflateReset2; exports2.inflateResetKeep = inflateResetKeep; exports2.inflateInit = inflateInit; exports2.inflateInit2 = inflateInit2; exports2.inflate = inflate; exports2.inflateEnd = inflateEnd; exports2.inflateGetHeader = inflateGetHeader; exports2.inflateSetDictionary = inflateSetDictionary; exports2.inflateInfo = "pako inflate (from Nodeca project)"; }, { "../utils/common": 1, "./adler32": 3, "./crc32": 5, "./inffast": 7, "./inftrees": 9 } ], 9: [ function(require2, module2, exports2) { "use strict"; var utils = require2("../utils/common"); var MAXBITS = 15; var ENOUGH_LENS = 852; var ENOUGH_DISTS = 592; var CODES = 0; var LENS = 1; var DISTS = 2; var lbase = [ /* Length codes 257..285 base */ 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0 ]; var lext = [ /* Length codes 257..285 extra */ 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78 ]; var dbase = [ /* Distance codes 0..29 base */ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577, 0, 0 ]; var dext = [ /* Distance codes 0..29 extra */ 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 64, 64 ]; module2.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts) { var bits = opts.bits; var len = 0; var sym = 0; var min = 0, max = 0; var root = 0; var curr = 0; var drop = 0; var left = 0; var used = 0; var huff = 0; var incr; var fill; var low; var mask; var next; var base = null; var base_index = 0; var end; var count = new utils.Buf16(MAXBITS + 1); var offs = new utils.Buf16(MAXBITS + 1); var extra = null; var extra_index = 0; var here_bits, here_op, here_val; for (len = 0; len <= MAXBITS; len++) { count[len] = 0; } for (sym = 0; sym < codes; sym++) { count[lens[lens_index + sym]]++; } root = bits; for (max = MAXBITS; max >= 1; max--) { if (count[max] !== 0) { break; } } if (root > max) { root = max; } if (max === 0) { table[table_index++] = 1 << 24 | 64 << 16 | 0; table[table_index++] = 1 << 24 | 64 << 16 | 0; opts.bits = 1; return 0; } for (min = 1; min < max; min++) { if (count[min] !== 0) { break; } } if (root < min) { root = min; } left = 1; for (len = 1; len <= MAXBITS; len++) { left <<= 1; left -= count[len]; if (left < 0) { return -1; } } if (left > 0 && (type === CODES || max !== 1)) { return -1; } offs[1] = 0; for (len = 1; len < MAXBITS; len++) { offs[len + 1] = offs[len] + count[len]; } for (sym = 0; sym < codes; sym++) { if (lens[lens_index + sym] !== 0) { work[offs[lens[lens_index + sym]]++] = sym; } } if (type === CODES) { base = extra = work; end = 19; } else if (type === LENS) { base = lbase; base_index -= 257; extra = lext; extra_index -= 257; end = 256; } else { base = dbase; extra = dext; end = -1; } huff = 0; sym = 0; len = min; next = table_index; curr = root; drop = 0; low = -1; used = 1 << root; mask = used - 1; if (type === LENS && used > ENOUGH_LENS || type === DISTS && used > ENOUGH_DISTS) { return 1; } for (; ; ) { here_bits = len - drop; if (work[sym] < end) { here_op = 0; here_val = work[sym]; } else if (work[sym] > end) { here_op = extra[extra_index + work[sym]]; here_val = base[base_index + work[sym]]; } else { here_op = 32 + 64; here_val = 0; } incr = 1 << len - drop; fill = 1 << curr; min = fill; do { fill -= incr; table[next + (huff >> drop) + fill] = here_bits << 24 | here_op << 16 | here_val | 0; } while (fill !== 0); incr = 1 << len - 1; while (huff & incr) { incr >>= 1; } if (incr !== 0) { huff &= incr - 1; huff += incr; } else { huff = 0; } sym++; if (--count[len] === 0) { if (len === max) { break; } len = lens[lens_index + work[sym]]; } if (len > root && (huff & mask) !== low) { if (drop === 0) { drop = root; } next += min; curr = len - drop; left = 1 << curr; while (curr + drop < max) { left -= count[curr + drop]; if (left <= 0) { break; } curr++; left <<= 1; } used += 1 << curr; if (type === LENS && used > ENOUGH_LENS || type === DISTS && used > ENOUGH_DISTS) { return 1; } low = huff & mask; table[low] = root << 24 | curr << 16 | next - table_index | 0; } } if (huff !== 0) { table[next + huff] = len - drop << 24 | 64 << 16 | 0; } opts.bits = root; return 0; }; }, { "../utils/common": 1 } ], 10: [ function(require2, module2, exports2) { "use strict"; module2.exports = { 2: "need dictionary", 1: "stream end", 0: "", "-1": "file error", "-2": "stream error", "-3": "data error", "-4": "insufficient memory", "-5": "buffer error", "-6": "incompatible version" }; }, {} ], 11: [ function(require2, module2, exports2) { "use strict"; function ZStream() { this.input = null; this.next_in = 0; this.avail_in = 0; this.total_in = 0; this.output = null; this.next_out = 0; this.avail_out = 0; this.total_out = 0; this.msg = ""; this.state = null; this.data_type = 2; this.adler = 0; } module2.exports = ZStream; }, {} ], "/lib/inflate.js": [ function(require2, module2, exports2) { "use strict"; var zlib_inflate = require2("./zlib/inflate"); var utils = require2("./utils/common"); var strings = require2("./utils/strings"); var c6 = require2("./zlib/constants"); var msg = require2("./zlib/messages"); var ZStream = require2("./zlib/zstream"); var GZheader = require2("./zlib/gzheader"); var toString = Object.prototype.toString; function Inflate(options) { if (!(this instanceof Inflate)) return new Inflate(options); this.options = utils.assign( { chunkSize: 16384, windowBits: 0, to: "" }, options || {} ); var opt = this.options; if (opt.raw && opt.windowBits >= 0 && opt.windowBits < 16) { opt.windowBits = -opt.windowBits; if (opt.windowBits === 0) { opt.windowBits = -15; } } if (opt.windowBits >= 0 && opt.windowBits < 16 && !(options && options.windowBits)) { opt.windowBits += 32; } if (opt.windowBits > 15 && opt.windowBits < 48) { if ((opt.windowBits & 15) === 0) { opt.windowBits |= 15; } } this.err = 0; this.msg = ""; this.ended = false; this.chunks = []; this.strm = new ZStream(); this.strm.avail_out = 0; var status = zlib_inflate.inflateInit2( this.strm, opt.windowBits ); if (status !== c6.Z_OK) { throw new Error(msg[status]); } this.header = new GZheader(); zlib_inflate.inflateGetHeader(this.strm, this.header); if (opt.dictionary) { if (typeof opt.dictionary === "string") { opt.dictionary = strings.string2buf( opt.dictionary ); } else if (toString.call(opt.dictionary) === "[object ArrayBuffer]") { opt.dictionary = new Uint8Array( opt.dictionary ); } if (opt.raw) { status = zlib_inflate.inflateSetDictionary( this.strm, opt.dictionary ); if (status !== c6.Z_OK) { throw new Error(msg[status]); } } } } Inflate.prototype.push = function(data, mode) { var strm = this.strm; var chunkSize = this.options.chunkSize; var dictionary = this.options.dictionary; var status, _mode; var next_out_utf8, tail, utf8str; var allowBufError = false; if (this.ended) { return false; } _mode = mode === ~~mode ? mode : mode === true ? c6.Z_FINISH : c6.Z_NO_FLUSH; if (typeof data === "string") { strm.input = strings.binstring2buf(data); } else if (toString.call(data) === "[object ArrayBuffer]") { strm.input = new Uint8Array(data); } else { strm.input = data; } strm.next_in = 0; strm.avail_in = strm.input.length; do { if (strm.avail_out === 0) { strm.output = new utils.Buf8(chunkSize); strm.next_out = 0; strm.avail_out = chunkSize; } status = zlib_inflate.inflate( strm, c6.Z_NO_FLUSH ); if (status === c6.Z_NEED_DICT && dictionary) { status = zlib_inflate.inflateSetDictionary( this.strm, dictionary ); } if (status === c6.Z_BUF_ERROR && allowBufError === true) { status = c6.Z_OK; allowBufError = false; } if (status !== c6.Z_STREAM_END && status !== c6.Z_OK) { this.onEnd(status); this.ended = true; return false; } if (strm.next_out) { if (strm.avail_out === 0 || status === c6.Z_STREAM_END || strm.avail_in === 0 && (_mode === c6.Z_FINISH || _mode === c6.Z_SYNC_FLUSH)) { if (this.options.to === "string") { next_out_utf8 = strings.utf8border( strm.output, strm.next_out ); tail = strm.next_out - next_out_utf8; utf8str = strings.buf2string( strm.output, next_out_utf8 ); strm.next_out = tail; strm.avail_out = chunkSize - tail; if (tail) { utils.arraySet( strm.output, strm.output, next_out_utf8, tail, 0 ); } this.onData(utf8str); } else { this.onData( utils.shrinkBuf( strm.output, strm.next_out ) ); } } } if (strm.avail_in === 0 && strm.avail_out === 0) { allowBufError = true; } } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== c6.Z_STREAM_END); if (status === c6.Z_STREAM_END) { _mode = c6.Z_FINISH; } if (_mode === c6.Z_FINISH) { status = zlib_inflate.inflateEnd(this.strm); this.onEnd(status); this.ended = true; return status === c6.Z_OK; } if (_mode === c6.Z_SYNC_FLUSH) { this.onEnd(c6.Z_OK); strm.avail_out = 0; return true; } return true; }; Inflate.prototype.onData = function(chunk2) { this.chunks.push(chunk2); }; Inflate.prototype.onEnd = function(status) { if (status === c6.Z_OK) { if (this.options.to === "string") { this.result = this.chunks.join(""); } else { this.result = utils.flattenChunks( this.chunks ); } } this.chunks = []; this.err = status; this.msg = this.strm.msg; }; function inflate(input, options) { var inflator = new Inflate(options); inflator.push(input, true); if (inflator.err) { throw inflator.msg || msg[inflator.err]; } return inflator.result; } function inflateRaw(input, options) { options = options || {}; options.raw = true; return inflate(input, options); } exports2.Inflate = Inflate; exports2.inflate = inflate; exports2.inflateRaw = inflateRaw; exports2.ungzip = inflate; }, { "./utils/common": 1, "./utils/strings": 2, "./zlib/constants": 4, "./zlib/gzheader": 6, "./zlib/inflate": 8, "./zlib/messages": 10, "./zlib/zstream": 11 } ] }, {}, [] )("/lib/inflate.js"); })(); // packages/global-styles-ui/build-module/font-library/lib/lib-font.browser.mjs var fetchFunction = globalThis.fetch; var Event2 = class { constructor(type, detail = {}, msg) { this.type = type; this.detail = detail; this.msg = msg; Object.defineProperty(this, `__mayPropagate`, { enumerable: false, writable: true }); this.__mayPropagate = true; } preventDefault() { } stopPropagation() { this.__mayPropagate = false; } valueOf() { return this; } toString() { return this.msg ? `[${this.type} event]: ${this.msg}` : `[${this.type} event]`; } }; var EventManager = class { constructor() { this.listeners = {}; } addEventListener(type, listener, useCapture) { let bin = this.listeners[type] || []; if (useCapture) bin.unshift(listener); else bin.push(listener); this.listeners[type] = bin; } removeEventListener(type, listener) { let bin = this.listeners[type] || []; let pos = bin.findIndex((e2) => e2 === listener); if (pos > -1) { bin.splice(pos, 1); this.listeners[type] = bin; } } dispatch(event) { let bin = this.listeners[event.type]; if (bin) { for (let l2 = 0, e2 = bin.length; l2 < e2; l2++) { if (!event.__mayPropagate) break; bin[l2](event); } } } }; var startDate = (/* @__PURE__ */ new Date(`1904-01-01T00:00:00+0000`)).getTime(); function asText(data) { return Array.from(data).map((v2) => String.fromCharCode(v2)).join(``); } var Parser = class { constructor(dict, dataview, name2) { this.name = (name2 || dict.tag || ``).trim(); this.length = dict.length; this.start = dict.offset; this.offset = 0; this.data = dataview; [ `getInt8`, `getUint8`, `getInt16`, `getUint16`, `getInt32`, `getUint32`, `getBigInt64`, `getBigUint64` ].forEach((name3) => { let fn = name3.replace(/get(Big)?/, "").toLowerCase(); let increment = parseInt(name3.replace(/[^\d]/g, "")) / 8; Object.defineProperty(this, fn, { get: () => this.getValue(name3, increment) }); }); } get currentPosition() { return this.start + this.offset; } set currentPosition(position) { this.start = position; this.offset = 0; } skip(n2 = 0, bits = 8) { this.offset += n2 * bits / 8; } getValue(type, increment) { let pos = this.start + this.offset; this.offset += increment; try { return this.data[type](pos); } catch (e2) { console.error(`parser`, type, increment, this); console.error(`parser`, this.start, this.offset); throw e2; } } flags(n2) { if (n2 === 8 || n2 === 16 || n2 === 32 || n2 === 64) { return this[`uint${n2}`].toString(2).padStart(n2, 0).split(``).map((v2) => v2 === "1"); } console.error( `Error parsing flags: flag types can only be 1, 2, 4, or 8 bytes long` ); console.trace(); } get tag() { const t3 = this.uint32; return asText([ t3 >> 24 & 255, t3 >> 16 & 255, t3 >> 8 & 255, t3 & 255 ]); } get fixed() { let major = this.int16; let minor = Math.round(1e3 * this.uint16 / 65356); return major + minor / 1e3; } get legacyFixed() { let major = this.uint16; let minor = this.uint16.toString(16).padStart(4, 0); return parseFloat(`${major}.${minor}`); } get uint24() { return (this.uint8 << 16) + (this.uint8 << 8) + this.uint8; } get uint128() { let value = 0; for (let i2 = 0; i2 < 5; i2++) { let byte = this.uint8; value = value * 128 + (byte & 127); if (byte < 128) break; } return value; } get longdatetime() { return new Date(startDate + 1e3 * parseInt(this.int64.toString())); } get fword() { return this.int16; } get ufword() { return this.uint16; } get Offset16() { return this.uint16; } get Offset32() { return this.uint32; } get F2DOT14() { const bits = p.uint16; const integer = [0, 1, -2, -1][bits >> 14]; const fraction = bits & 16383; return integer + fraction / 16384; } verifyLength() { if (this.offset != this.length) { console.error( `unexpected parsed table size (${this.offset}) for "${this.name}" (expected ${this.length})` ); } } readBytes(n2 = 0, position = 0, bits = 8, signed = false) { n2 = n2 || this.length; if (n2 === 0) return []; if (position) this.currentPosition = position; const fn = `${signed ? `` : `u`}int${bits}`, slice = []; while (n2--) slice.push(this[fn]); return slice; } }; var ParsedData = class { constructor(parser) { const pGetter = { enumerable: false, get: () => parser }; Object.defineProperty(this, `parser`, pGetter); const start2 = parser.currentPosition; const startGetter = { enumerable: false, get: () => start2 }; Object.defineProperty(this, `start`, startGetter); } load(struct) { Object.keys(struct).forEach((p22) => { let props = Object.getOwnPropertyDescriptor(struct, p22); if (props.get) { this[p22] = props.get.bind(this); } else if (props.value !== void 0) { this[p22] = props.value; } }); if (this.parser.length) { this.parser.verifyLength(); } } }; var SimpleTable = class extends ParsedData { constructor(dict, dataview, name2) { const { parser, start: start2 } = super( new Parser(dict, dataview, name2) ); const pGetter = { enumerable: false, get: () => parser }; Object.defineProperty(this, `p`, pGetter); const startGetter = { enumerable: false, get: () => start2 }; Object.defineProperty(this, `tableStart`, startGetter); } }; function lazy$1(object, property, getter) { let val; Object.defineProperty(object, property, { get: () => { if (val) return val; val = getter(); return val; }, enumerable: true }); } var SFNT = class extends SimpleTable { constructor(font2, dataview, createTable2) { const { p: p22 } = super({ offset: 0, length: 12 }, dataview, `sfnt`); this.version = p22.uint32; this.numTables = p22.uint16; this.searchRange = p22.uint16; this.entrySelector = p22.uint16; this.rangeShift = p22.uint16; p22.verifyLength(); this.directory = [...new Array(this.numTables)].map( (_) => new TableRecord(p22) ); this.tables = {}; this.directory.forEach((entry) => { const getter = () => createTable2( this.tables, { tag: entry.tag, offset: entry.offset, length: entry.length }, dataview ); lazy$1(this.tables, entry.tag.trim(), getter); }); } }; var TableRecord = class { constructor(p22) { this.tag = p22.tag; this.checksum = p22.uint32; this.offset = p22.uint32; this.length = p22.uint32; } }; var gzipDecode = inflate_default.inflate || void 0; var nativeGzipDecode = void 0; var WOFF$1 = class extends SimpleTable { constructor(font2, dataview, createTable2) { const { p: p22 } = super({ offset: 0, length: 44 }, dataview, `woff`); this.signature = p22.tag; this.flavor = p22.uint32; this.length = p22.uint32; this.numTables = p22.uint16; p22.uint16; this.totalSfntSize = p22.uint32; this.majorVersion = p22.uint16; this.minorVersion = p22.uint16; this.metaOffset = p22.uint32; this.metaLength = p22.uint32; this.metaOrigLength = p22.uint32; this.privOffset = p22.uint32; this.privLength = p22.uint32; p22.verifyLength(); this.directory = [...new Array(this.numTables)].map( (_) => new WoffTableDirectoryEntry(p22) ); buildWoffLazyLookups(this, dataview, createTable2); } }; var WoffTableDirectoryEntry = class { constructor(p22) { this.tag = p22.tag; this.offset = p22.uint32; this.compLength = p22.uint32; this.origLength = p22.uint32; this.origChecksum = p22.uint32; } }; function buildWoffLazyLookups(woff, dataview, createTable2) { woff.tables = {}; woff.directory.forEach((entry) => { lazy$1(woff.tables, entry.tag.trim(), () => { let offset = 0; let view = dataview; if (entry.compLength !== entry.origLength) { const data = dataview.buffer.slice( entry.offset, entry.offset + entry.compLength ); let unpacked; if (gzipDecode) { unpacked = gzipDecode(new Uint8Array(data)); } else if (nativeGzipDecode) { unpacked = nativeGzipDecode(new Uint8Array(data)); } else { const msg = `no brotli decoder available to decode WOFF2 font`; if (font.onerror) font.onerror(msg); throw new Error(msg); } view = new DataView(unpacked.buffer); } else { offset = entry.offset; } return createTable2( woff.tables, { tag: entry.tag, offset, length: entry.origLength }, view ); }); }); } var brotliDecode = unbrotli_default; var nativeBrotliDecode = void 0; var WOFF2$1 = class extends SimpleTable { constructor(font2, dataview, createTable2) { const { p: p22 } = super({ offset: 0, length: 48 }, dataview, `woff2`); this.signature = p22.tag; this.flavor = p22.uint32; this.length = p22.uint32; this.numTables = p22.uint16; p22.uint16; this.totalSfntSize = p22.uint32; this.totalCompressedSize = p22.uint32; this.majorVersion = p22.uint16; this.minorVersion = p22.uint16; this.metaOffset = p22.uint32; this.metaLength = p22.uint32; this.metaOrigLength = p22.uint32; this.privOffset = p22.uint32; this.privLength = p22.uint32; p22.verifyLength(); this.directory = [...new Array(this.numTables)].map( (_) => new Woff2TableDirectoryEntry(p22) ); let dictOffset = p22.currentPosition; this.directory[0].offset = 0; this.directory.forEach((e2, i2) => { let next = this.directory[i2 + 1]; if (next) { next.offset = e2.offset + (e2.transformLength !== void 0 ? e2.transformLength : e2.origLength); } }); let decoded; let buffer = dataview.buffer.slice(dictOffset); if (brotliDecode) { decoded = brotliDecode(new Uint8Array(buffer)); } else if (nativeBrotliDecode) { decoded = new Uint8Array(nativeBrotliDecode(buffer)); } else { const msg = `no brotli decoder available to decode WOFF2 font`; if (font2.onerror) font2.onerror(msg); throw new Error(msg); } buildWoff2LazyLookups(this, decoded, createTable2); } }; var Woff2TableDirectoryEntry = class { constructor(p22) { this.flags = p22.uint8; const tagNumber = this.tagNumber = this.flags & 63; if (tagNumber === 63) { this.tag = p22.tag; } else { this.tag = getWOFF2Tag(tagNumber); } const transformVersion = this.transformVersion = (this.flags & 192) >> 6; let hasTransforms = transformVersion !== 0; if (this.tag === `glyf` || this.tag === `loca`) { hasTransforms = this.transformVersion !== 3; } this.origLength = p22.uint128; if (hasTransforms) { this.transformLength = p22.uint128; } } }; function buildWoff2LazyLookups(woff2, decoded, createTable2) { woff2.tables = {}; woff2.directory.forEach((entry) => { lazy$1(woff2.tables, entry.tag.trim(), () => { const start2 = entry.offset; const end = start2 + (entry.transformLength ? entry.transformLength : entry.origLength); const data = new DataView(decoded.slice(start2, end).buffer); try { return createTable2( woff2.tables, { tag: entry.tag, offset: 0, length: entry.origLength }, data ); } catch (e2) { console.error(e2); } }); }); } function getWOFF2Tag(flag) { return [ `cmap`, `head`, `hhea`, `hmtx`, `maxp`, `name`, `OS/2`, `post`, `cvt `, `fpgm`, `glyf`, `loca`, `prep`, `CFF `, `VORG`, `EBDT`, `EBLC`, `gasp`, `hdmx`, `kern`, `LTSH`, `PCLT`, `VDMX`, `vhea`, `vmtx`, `BASE`, `GDEF`, `GPOS`, `GSUB`, `EBSC`, `JSTF`, `MATH`, `CBDT`, `CBLC`, `COLR`, `CPAL`, `SVG `, `sbix`, `acnt`, `avar`, `bdat`, `bloc`, `bsln`, `cvar`, `fdsc`, `feat`, `fmtx`, `fvar`, `gvar`, `hsty`, `just`, `lcar`, `mort`, `morx`, `opbd`, `prop`, `trak`, `Zapf`, `Silf`, `Glat`, `Gloc`, `Feat`, `Sill` ][flag & 63]; } var tableClasses = {}; var tableClassesLoaded = false; Promise.all([ Promise.resolve().then(function() { return cmap$1; }), Promise.resolve().then(function() { return head$1; }), Promise.resolve().then(function() { return hhea$1; }), Promise.resolve().then(function() { return hmtx$1; }), Promise.resolve().then(function() { return maxp$1; }), Promise.resolve().then(function() { return name$1; }), Promise.resolve().then(function() { return OS2$1; }), Promise.resolve().then(function() { return post$1; }), Promise.resolve().then(function() { return BASE$1; }), Promise.resolve().then(function() { return GDEF$1; }), Promise.resolve().then(function() { return GSUB$1; }), Promise.resolve().then(function() { return GPOS$1; }), Promise.resolve().then(function() { return SVG$1; }), Promise.resolve().then(function() { return fvar$1; }), Promise.resolve().then(function() { return cvt$1; }), Promise.resolve().then(function() { return fpgm$1; }), Promise.resolve().then(function() { return gasp$1; }), Promise.resolve().then(function() { return glyf$1; }), Promise.resolve().then(function() { return loca$1; }), Promise.resolve().then(function() { return prep$1; }), Promise.resolve().then(function() { return CFF$1; }), Promise.resolve().then(function() { return CFF2$1; }), Promise.resolve().then(function() { return VORG$1; }), Promise.resolve().then(function() { return EBLC$1; }), Promise.resolve().then(function() { return EBDT$1; }), Promise.resolve().then(function() { return EBSC$1; }), Promise.resolve().then(function() { return CBLC$1; }), Promise.resolve().then(function() { return CBDT$1; }), Promise.resolve().then(function() { return sbix$1; }), Promise.resolve().then(function() { return COLR$1; }), Promise.resolve().then(function() { return CPAL$1; }), Promise.resolve().then(function() { return DSIG$1; }), Promise.resolve().then(function() { return hdmx$1; }), Promise.resolve().then(function() { return kern$1; }), Promise.resolve().then(function() { return LTSH$1; }), Promise.resolve().then(function() { return MERG$1; }), Promise.resolve().then(function() { return meta$1; }), Promise.resolve().then(function() { return PCLT$1; }), Promise.resolve().then(function() { return VDMX$1; }), Promise.resolve().then(function() { return vhea$1; }), Promise.resolve().then(function() { return vmtx$1; }) ]).then((data) => { data.forEach((e2) => { let name2 = Object.keys(e2)[0]; tableClasses[name2] = e2[name2]; }); tableClassesLoaded = true; }); function createTable(tables, dict, dataview) { let name2 = dict.tag.replace(/[^\w\d]/g, ``); let Type = tableClasses[name2]; if (Type) return new Type(dict, dataview, tables); console.warn( `lib-font has no definition for ${name2}. The table was skipped.` ); return {}; } function loadTableClasses() { let count = 0; function checkLoaded(resolve, reject) { if (!tableClassesLoaded) { if (count > 10) { return reject(new Error(`loading took too long`)); } count++; return setTimeout(() => checkLoaded(resolve), 250); } resolve(createTable); } return new Promise((resolve, reject) => checkLoaded(resolve)); } function getFontCSSFormat(path, errorOnStyle) { let pos = path.lastIndexOf(`.`); let ext = (path.substring(pos + 1) || ``).toLowerCase(); let format6 = { ttf: `truetype`, otf: `opentype`, woff: `woff`, woff2: `woff2` }[ext]; if (format6) return format6; let msg = { eot: `The .eot format is not supported: it died in January 12, 2016, when Microsoft retired all versions of IE that didn't already support WOFF.`, svg: `The .svg format is not supported: SVG fonts (not to be confused with OpenType with embedded SVG) were so bad we took the entire fonts chapter out of the SVG specification again.`, fon: `The .fon format is not supported: this is an ancient Windows bitmap font format.`, ttc: `Based on the current CSS specification, font collections are not (yet?) supported.` }[ext]; if (!msg) msg = `${path} is not a known webfont format.`; if (errorOnStyle) { throw new Error(msg); } else { console.warn(`Could not load font: ${msg}`); } } async function setupFontFace(name2, url, options = {}) { if (!globalThis.document) return; let format6 = getFontCSSFormat(url, options.errorOnStyle); if (!format6) return; let style = document.createElement(`style`); style.className = `injected-by-Font-js`; let rules = []; if (options.styleRules) { rules = Object.entries(options.styleRules).map( ([key, value]) => `${key}: ${value};` ); } style.textContent = ` @font-face { font-family: "${name2}"; ${rules.join( ` ` )} src: url("${url}") format("${format6}"); }`; globalThis.document.head.appendChild(style); return style; } var TTF = [0, 1, 0, 0]; var OTF = [79, 84, 84, 79]; var WOFF = [119, 79, 70, 70]; var WOFF2 = [119, 79, 70, 50]; function match(ar1, ar2) { if (ar1.length !== ar2.length) return; for (let i2 = 0; i2 < ar1.length; i2++) { if (ar1[i2] !== ar2[i2]) return; } return true; } function validFontFormat(dataview) { const LEAD_BYTES = [ dataview.getUint8(0), dataview.getUint8(1), dataview.getUint8(2), dataview.getUint8(3) ]; if (match(LEAD_BYTES, TTF) || match(LEAD_BYTES, OTF)) return `SFNT`; if (match(LEAD_BYTES, WOFF)) return `WOFF`; if (match(LEAD_BYTES, WOFF2)) return `WOFF2`; } function checkFetchResponseStatus(response) { if (!response.ok) { throw new Error( `HTTP ${response.status} - ${response.statusText}` ); } return response; } var Font = class extends EventManager { constructor(name2, options = {}) { super(); this.name = name2; this.options = options; this.metrics = false; } get src() { return this.__src; } set src(src) { this.__src = src; (async () => { if (globalThis.document && !this.options.skipStyleSheet) { await setupFontFace(this.name, src, this.options); } this.loadFont(src); })(); } async loadFont(url, filename) { fetch(url).then( (response) => checkFetchResponseStatus(response) && response.arrayBuffer() ).then( (buffer) => this.fromDataBuffer(buffer, filename || url) ).catch((err) => { const evt = new Event2( `error`, err, `Failed to load font at ${filename || url}` ); this.dispatch(evt); if (this.onerror) this.onerror(evt); }); } async fromDataBuffer(buffer, filenameOrUrL) { this.fontData = new DataView(buffer); let type = validFontFormat(this.fontData); if (!type) { throw new Error( `${filenameOrUrL} is either an unsupported font format, or not a font at all.` ); } await this.parseBasicData(type); const evt = new Event2("load", { font: this }); this.dispatch(evt); if (this.onload) this.onload(evt); } async parseBasicData(type) { return loadTableClasses().then((createTable2) => { if (type === `SFNT`) { this.opentype = new SFNT(this, this.fontData, createTable2); } if (type === `WOFF`) { this.opentype = new WOFF$1(this, this.fontData, createTable2); } if (type === `WOFF2`) { this.opentype = new WOFF2$1(this, this.fontData, createTable2); } return this.opentype; }); } getGlyphId(char) { return this.opentype.tables.cmap.getGlyphId(char); } reverse(glyphid) { return this.opentype.tables.cmap.reverse(glyphid); } supports(char) { return this.getGlyphId(char) !== 0; } supportsVariation(variation) { return this.opentype.tables.cmap.supportsVariation(variation) !== false; } measureText(text, size = 16) { if (this.__unloaded) throw new Error( "Cannot measure text: font was unloaded. Please reload before calling measureText()" ); let d2 = document.createElement("div"); d2.textContent = text; d2.style.fontFamily = this.name; d2.style.fontSize = `${size}px`; d2.style.color = `transparent`; d2.style.background = `transparent`; d2.style.top = `0`; d2.style.left = `0`; d2.style.position = `absolute`; document.body.appendChild(d2); let bbox = d2.getBoundingClientRect(); document.body.removeChild(d2); const OS22 = this.opentype.tables["OS/2"]; bbox.fontSize = size; bbox.ascender = OS22.sTypoAscender; bbox.descender = OS22.sTypoDescender; return bbox; } unload() { if (this.styleElement.parentNode) { this.styleElement.parentNode.removeElement(this.styleElement); const evt = new Event2("unload", { font: this }); this.dispatch(evt); if (this.onunload) this.onunload(evt); } this._unloaded = true; } load() { if (this.__unloaded) { delete this.__unloaded; document.head.appendChild(this.styleElement); const evt = new Event2("load", { font: this }); this.dispatch(evt); if (this.onload) this.onload(evt); } } }; globalThis.Font = Font; var Subtable = class extends ParsedData { constructor(p22, plaformID, encodingID) { super(p22); this.plaformID = plaformID; this.encodingID = encodingID; } }; var Format0 = class extends Subtable { constructor(p22, platformID, encodingID) { super(p22, platformID, encodingID); this.format = 0; this.length = p22.uint16; this.language = p22.uint16; this.glyphIdArray = [...new Array(256)].map((_) => p22.uint8); } supports(charCode) { if (charCode.charCodeAt) { charCode = -1; console.warn( `supports(character) not implemented for cmap subtable format 0. only supports(id) is implemented.` ); } return 0 <= charCode && charCode <= 255; } reverse(glyphID) { console.warn(`reverse not implemented for cmap subtable format 0`); return {}; } getSupportedCharCodes() { return [{ start: 1, end: 256 }]; } }; var Format2 = class extends Subtable { constructor(p22, platformID, encodingID) { super(p22, platformID, encodingID); this.format = 2; this.length = p22.uint16; this.language = p22.uint16; this.subHeaderKeys = [...new Array(256)].map((_) => p22.uint16); const subHeaderCount = Math.max(...this.subHeaderKeys); const subHeaderOffset = p22.currentPosition; lazy$1(this, `subHeaders`, () => { p22.currentPosition = subHeaderOffset; return [...new Array(subHeaderCount)].map( (_) => new SubHeader(p22) ); }); const glyphIndexOffset = subHeaderOffset + subHeaderCount * 8; lazy$1(this, `glyphIndexArray`, () => { p22.currentPosition = glyphIndexOffset; return [...new Array(subHeaderCount)].map((_) => p22.uint16); }); } supports(charCode) { if (charCode.charCodeAt) { charCode = -1; console.warn( `supports(character) not implemented for cmap subtable format 2. only supports(id) is implemented.` ); } const low = charCode && 255; const high = charCode && 65280; const subHeaderKey = this.subHeaders[high]; const subheader = this.subHeaders[subHeaderKey]; const first = subheader.firstCode; const last = first + subheader.entryCount; return first <= low && low <= last; } reverse(glyphID) { console.warn(`reverse not implemented for cmap subtable format 2`); return {}; } getSupportedCharCodes(preservePropNames = false) { if (preservePropNames) { return this.subHeaders.map((h2) => ({ firstCode: h2.firstCode, lastCode: h2.lastCode })); } return this.subHeaders.map((h2) => ({ start: h2.firstCode, end: h2.lastCode })); } }; var SubHeader = class { constructor(p22) { this.firstCode = p22.uint16; this.entryCount = p22.uint16; this.lastCode = this.first + this.entryCount; this.idDelta = p22.int16; this.idRangeOffset = p22.uint16; } }; var Format4 = class extends Subtable { constructor(p22, platformID, encodingID) { super(p22, platformID, encodingID); this.format = 4; this.length = p22.uint16; this.language = p22.uint16; this.segCountX2 = p22.uint16; this.segCount = this.segCountX2 / 2; this.searchRange = p22.uint16; this.entrySelector = p22.uint16; this.rangeShift = p22.uint16; const endCodePosition = p22.currentPosition; lazy$1( this, `endCode`, () => p22.readBytes(this.segCount, endCodePosition, 16) ); const startCodePosition = endCodePosition + 2 + this.segCountX2; lazy$1( this, `startCode`, () => p22.readBytes(this.segCount, startCodePosition, 16) ); const idDeltaPosition = startCodePosition + this.segCountX2; lazy$1( this, `idDelta`, () => p22.readBytes(this.segCount, idDeltaPosition, 16, true) ); const idRangePosition = idDeltaPosition + this.segCountX2; lazy$1( this, `idRangeOffset`, () => p22.readBytes(this.segCount, idRangePosition, 16) ); const glyphIdArrayPosition = idRangePosition + this.segCountX2; const glyphIdArrayLength = this.length - (glyphIdArrayPosition - this.tableStart); lazy$1( this, `glyphIdArray`, () => p22.readBytes(glyphIdArrayLength, glyphIdArrayPosition, 16) ); lazy$1( this, `segments`, () => this.buildSegments(idRangePosition, glyphIdArrayPosition, p22) ); } buildSegments(idRangePosition, glyphIdArrayPosition, p22) { const build = (_, i2) => { let startCode = this.startCode[i2], endCode = this.endCode[i2], idDelta = this.idDelta[i2], idRangeOffset = this.idRangeOffset[i2], idRangeOffsetPointer = idRangePosition + 2 * i2, glyphIDs = []; if (idRangeOffset === 0) { for (let i22 = startCode + idDelta, e2 = endCode + idDelta; i22 <= e2; i22++) { glyphIDs.push(i22); } } else { for (let i22 = 0, e2 = endCode - startCode; i22 <= e2; i22++) { p22.currentPosition = idRangeOffsetPointer + idRangeOffset + i22 * 2; glyphIDs.push(p22.uint16); } } return { startCode, endCode, idDelta, idRangeOffset, glyphIDs }; }; return [...new Array(this.segCount)].map(build); } reverse(glyphID) { let s2 = this.segments.find((v2) => v2.glyphIDs.includes(glyphID)); if (!s2) return {}; const code = s2.startCode + s2.glyphIDs.indexOf(glyphID); return { code, unicode: String.fromCodePoint(code) }; } getGlyphId(charCode) { if (charCode.charCodeAt) charCode = charCode.charCodeAt(0); if (55296 <= charCode && charCode <= 57343) return 0; if ((charCode & 65534) === 65534 || (charCode & 65535) === 65535) return 0; let segment = this.segments.find( (s2) => s2.startCode <= charCode && charCode <= s2.endCode ); if (!segment) return 0; return segment.glyphIDs[charCode - segment.startCode]; } supports(charCode) { return this.getGlyphId(charCode) !== 0; } getSupportedCharCodes(preservePropNames = false) { if (preservePropNames) return this.segments; return this.segments.map((v2) => ({ start: v2.startCode, end: v2.endCode })); } }; var Format6 = class extends Subtable { constructor(p22, platformID, encodingID) { super(p22, platformID, encodingID); this.format = 6; this.length = p22.uint16; this.language = p22.uint16; this.firstCode = p22.uint16; this.entryCount = p22.uint16; this.lastCode = this.firstCode + this.entryCount - 1; const getter = () => [...new Array(this.entryCount)].map((_) => p22.uint16); lazy$1(this, `glyphIdArray`, getter); } supports(charCode) { if (charCode.charCodeAt) { charCode = -1; console.warn( `supports(character) not implemented for cmap subtable format 6. only supports(id) is implemented.` ); } if (charCode < this.firstCode) return {}; if (charCode > this.firstCode + this.entryCount) return {}; const code = charCode - this.firstCode; return { code, unicode: String.fromCodePoint(code) }; } reverse(glyphID) { let pos = this.glyphIdArray.indexOf(glyphID); if (pos > -1) return this.firstCode + pos; } getSupportedCharCodes(preservePropNames = false) { if (preservePropNames) { return [{ firstCode: this.firstCode, lastCode: this.lastCode }]; } return [{ start: this.firstCode, end: this.lastCode }]; } }; var Format8 = class extends Subtable { constructor(p22, platformID, encodingID) { super(p22, platformID, encodingID); this.format = 8; p22.uint16; this.length = p22.uint32; this.language = p22.uint32; this.is32 = [...new Array(8192)].map((_) => p22.uint8); this.numGroups = p22.uint32; const getter = () => [...new Array(this.numGroups)].map( (_) => new SequentialMapGroup$1(p22) ); lazy$1(this, `groups`, getter); } supports(charCode) { if (charCode.charCodeAt) { charCode = -1; console.warn( `supports(character) not implemented for cmap subtable format 8. only supports(id) is implemented.` ); } return this.groups.findIndex( (s2) => s2.startcharCode <= charCode && charCode <= s2.endcharCode ) !== -1; } reverse(glyphID) { console.warn(`reverse not implemented for cmap subtable format 8`); return {}; } getSupportedCharCodes(preservePropNames = false) { if (preservePropNames) return this.groups; return this.groups.map((v2) => ({ start: v2.startcharCode, end: v2.endcharCode })); } }; var SequentialMapGroup$1 = class { constructor(p22) { this.startcharCode = p22.uint32; this.endcharCode = p22.uint32; this.startGlyphID = p22.uint32; } }; var Format10 = class extends Subtable { constructor(p22, platformID, encodingID) { super(p22, platformID, encodingID); this.format = 10; p22.uint16; this.length = p22.uint32; this.language = p22.uint32; this.startCharCode = p22.uint32; this.numChars = p22.uint32; this.endCharCode = this.startCharCode + this.numChars; const getter = () => [...new Array(this.numChars)].map((_) => p22.uint16); lazy$1(this, `glyphs`, getter); } supports(charCode) { if (charCode.charCodeAt) { charCode = -1; console.warn( `supports(character) not implemented for cmap subtable format 10. only supports(id) is implemented.` ); } if (charCode < this.startCharCode) return false; if (charCode > this.startCharCode + this.numChars) return false; return charCode - this.startCharCode; } reverse(glyphID) { console.warn(`reverse not implemented for cmap subtable format 10`); return {}; } getSupportedCharCodes(preservePropNames = false) { if (preservePropNames) { return [ { startCharCode: this.startCharCode, endCharCode: this.endCharCode } ]; } return [{ start: this.startCharCode, end: this.endCharCode }]; } }; var Format12 = class extends Subtable { constructor(p22, platformID, encodingID) { super(p22, platformID, encodingID); this.format = 12; p22.uint16; this.length = p22.uint32; this.language = p22.uint32; this.numGroups = p22.uint32; const getter = () => [...new Array(this.numGroups)].map( (_) => new SequentialMapGroup(p22) ); lazy$1(this, `groups`, getter); } supports(charCode) { if (charCode.charCodeAt) charCode = charCode.charCodeAt(0); if (55296 <= charCode && charCode <= 57343) return 0; if ((charCode & 65534) === 65534 || (charCode & 65535) === 65535) return 0; return this.groups.findIndex( (s2) => s2.startCharCode <= charCode && charCode <= s2.endCharCode ) !== -1; } reverse(glyphID) { for (let group of this.groups) { let start2 = group.startGlyphID; if (start2 > glyphID) continue; if (start2 === glyphID) return group.startCharCode; let end = start2 + (group.endCharCode - group.startCharCode); if (end < glyphID) continue; const code = group.startCharCode + (glyphID - start2); return { code, unicode: String.fromCodePoint(code) }; } return {}; } getSupportedCharCodes(preservePropNames = false) { if (preservePropNames) return this.groups; return this.groups.map((v2) => ({ start: v2.startCharCode, end: v2.endCharCode })); } }; var SequentialMapGroup = class { constructor(p22) { this.startCharCode = p22.uint32; this.endCharCode = p22.uint32; this.startGlyphID = p22.uint32; } }; var Format13 = class extends Subtable { constructor(p22, platformID, encodingID) { super(p22, platformID, encodingID); this.format = 13; p22.uint16; this.length = p22.uint32; this.language = p22.uint32; this.numGroups = p22.uint32; const getter = [...new Array(this.numGroups)].map( (_) => new ConstantMapGroup(p22) ); lazy$1(this, `groups`, getter); } supports(charCode) { if (charCode.charCodeAt) charCode = charCode.charCodeAt(0); return this.groups.findIndex( (s2) => s2.startCharCode <= charCode && charCode <= s2.endCharCode ) !== -1; } reverse(glyphID) { console.warn(`reverse not implemented for cmap subtable format 13`); return {}; } getSupportedCharCodes(preservePropNames = false) { if (preservePropNames) return this.groups; return this.groups.map((v2) => ({ start: v2.startCharCode, end: v2.endCharCode })); } }; var ConstantMapGroup = class { constructor(p22) { this.startCharCode = p22.uint32; this.endCharCode = p22.uint32; this.glyphID = p22.uint32; } }; var Format14 = class extends Subtable { constructor(p22, platformID, encodingID) { super(p22, platformID, encodingID); this.subTableStart = p22.currentPosition; this.format = 14; this.length = p22.uint32; this.numVarSelectorRecords = p22.uint32; lazy$1( this, `varSelectors`, () => [...new Array(this.numVarSelectorRecords)].map( (_) => new VariationSelector(p22) ) ); } supports() { console.warn(`supports not implemented for cmap subtable format 14`); return 0; } getSupportedCharCodes() { console.warn( `getSupportedCharCodes not implemented for cmap subtable format 14` ); return []; } reverse(glyphID) { console.warn(`reverse not implemented for cmap subtable format 14`); return {}; } supportsVariation(variation) { let v2 = this.varSelector.find( (uvs) => uvs.varSelector === variation ); return v2 ? v2 : false; } getSupportedVariations() { return this.varSelectors.map((v2) => v2.varSelector); } }; var VariationSelector = class { constructor(p22) { this.varSelector = p22.uint24; this.defaultUVSOffset = p22.Offset32; this.nonDefaultUVSOffset = p22.Offset32; } }; function createSubTable(parser, platformID, encodingID) { const format6 = parser.uint16; if (format6 === 0) return new Format0(parser, platformID, encodingID); if (format6 === 2) return new Format2(parser, platformID, encodingID); if (format6 === 4) return new Format4(parser, platformID, encodingID); if (format6 === 6) return new Format6(parser, platformID, encodingID); if (format6 === 8) return new Format8(parser, platformID, encodingID); if (format6 === 10) return new Format10(parser, platformID, encodingID); if (format6 === 12) return new Format12(parser, platformID, encodingID); if (format6 === 13) return new Format13(parser, platformID, encodingID); if (format6 === 14) return new Format14(parser, platformID, encodingID); return {}; } var cmap = class extends SimpleTable { constructor(dict, dataview) { const { p: p22 } = super(dict, dataview); this.version = p22.uint16; this.numTables = p22.uint16; this.encodingRecords = [...new Array(this.numTables)].map( (_) => new EncodingRecord(p22, this.tableStart) ); } getSubTable(tableID) { return this.encodingRecords[tableID].table; } getSupportedEncodings() { return this.encodingRecords.map((r3) => ({ platformID: r3.platformID, encodingId: r3.encodingID })); } getSupportedCharCodes(platformID, encodingID) { const recordID = this.encodingRecords.findIndex( (r3) => r3.platformID === platformID && r3.encodingID === encodingID ); if (recordID === -1) return false; const subtable = this.getSubTable(recordID); return subtable.getSupportedCharCodes(); } reverse(glyphid) { for (let i2 = 0; i2 < this.numTables; i2++) { let code = this.getSubTable(i2).reverse(glyphid); if (code) return code; } } getGlyphId(char) { let last = 0; this.encodingRecords.some((_, tableID) => { let t3 = this.getSubTable(tableID); if (!t3.getGlyphId) return false; last = t3.getGlyphId(char); return last !== 0; }); return last; } supports(char) { return this.encodingRecords.some((_, tableID) => { const t3 = this.getSubTable(tableID); return t3.supports && t3.supports(char) !== false; }); } supportsVariation(variation) { return this.encodingRecords.some((_, tableID) => { const t3 = this.getSubTable(tableID); return t3.supportsVariation && t3.supportsVariation(variation) !== false; }); } }; var EncodingRecord = class { constructor(p22, tableStart) { const platformID = this.platformID = p22.uint16; const encodingID = this.encodingID = p22.uint16; const offset = this.offset = p22.Offset32; lazy$1(this, `table`, () => { p22.currentPosition = tableStart + offset; return createSubTable(p22, platformID, encodingID); }); } }; var cmap$1 = Object.freeze({ __proto__: null, cmap }); var head = class extends SimpleTable { constructor(dict, dataview) { const { p: p22 } = super(dict, dataview); this.load({ majorVersion: p22.uint16, minorVersion: p22.uint16, fontRevision: p22.fixed, checkSumAdjustment: p22.uint32, magicNumber: p22.uint32, flags: p22.flags(16), unitsPerEm: p22.uint16, created: p22.longdatetime, modified: p22.longdatetime, xMin: p22.int16, yMin: p22.int16, xMax: p22.int16, yMax: p22.int16, macStyle: p22.flags(16), lowestRecPPEM: p22.uint16, fontDirectionHint: p22.uint16, indexToLocFormat: p22.uint16, glyphDataFormat: p22.uint16 }); } }; var head$1 = Object.freeze({ __proto__: null, head }); var hhea = class extends SimpleTable { constructor(dict, dataview) { const { p: p22 } = super(dict, dataview); this.majorVersion = p22.uint16; this.minorVersion = p22.uint16; this.ascender = p22.fword; this.descender = p22.fword; this.lineGap = p22.fword; this.advanceWidthMax = p22.ufword; this.minLeftSideBearing = p22.fword; this.minRightSideBearing = p22.fword; this.xMaxExtent = p22.fword; this.caretSlopeRise = p22.int16; this.caretSlopeRun = p22.int16; this.caretOffset = p22.int16; p22.int16; p22.int16; p22.int16; p22.int16; this.metricDataFormat = p22.int16; this.numberOfHMetrics = p22.uint16; p22.verifyLength(); } }; var hhea$1 = Object.freeze({ __proto__: null, hhea }); var hmtx = class extends SimpleTable { constructor(dict, dataview, tables) { const { p: p22 } = super(dict, dataview); const numberOfHMetrics = tables.hhea.numberOfHMetrics; const numGlyphs = tables.maxp.numGlyphs; const metricsStart = p22.currentPosition; lazy$1(this, `hMetrics`, () => { p22.currentPosition = metricsStart; return [...new Array(numberOfHMetrics)].map( (_) => new LongHorMetric(p22.uint16, p22.int16) ); }); if (numberOfHMetrics < numGlyphs) { const lsbStart = metricsStart + numberOfHMetrics * 4; lazy$1(this, `leftSideBearings`, () => { p22.currentPosition = lsbStart; return [...new Array(numGlyphs - numberOfHMetrics)].map( (_) => p22.int16 ); }); } } }; var LongHorMetric = class { constructor(w2, b2) { this.advanceWidth = w2; this.lsb = b2; } }; var hmtx$1 = Object.freeze({ __proto__: null, hmtx }); var maxp = class extends SimpleTable { constructor(dict, dataview) { const { p: p22 } = super(dict, dataview); this.version = p22.legacyFixed; this.numGlyphs = p22.uint16; if (this.version === 1) { this.maxPoints = p22.uint16; this.maxContours = p22.uint16; this.maxCompositePoints = p22.uint16; this.maxCompositeContours = p22.uint16; this.maxZones = p22.uint16; this.maxTwilightPoints = p22.uint16; this.maxStorage = p22.uint16; this.maxFunctionDefs = p22.uint16; this.maxInstructionDefs = p22.uint16; this.maxStackElements = p22.uint16; this.maxSizeOfInstructions = p22.uint16; this.maxComponentElements = p22.uint16; this.maxComponentDepth = p22.uint16; } p22.verifyLength(); } }; var maxp$1 = Object.freeze({ __proto__: null, maxp }); var name = class extends SimpleTable { constructor(dict, dataview) { const { p: p22 } = super(dict, dataview); this.format = p22.uint16; this.count = p22.uint16; this.stringOffset = p22.Offset16; this.nameRecords = [...new Array(this.count)].map( (_) => new NameRecord(p22, this) ); if (this.format === 1) { this.langTagCount = p22.uint16; this.langTagRecords = [...new Array(this.langTagCount)].map( (_) => new LangTagRecord(p22.uint16, p22.Offset16) ); } this.stringStart = this.tableStart + this.stringOffset; } get(nameID) { let record = this.nameRecords.find( (record2) => record2.nameID === nameID ); if (record) return record.string; } }; var LangTagRecord = class { constructor(length, offset) { this.length = length; this.offset = offset; } }; var NameRecord = class { constructor(p22, nameTable) { this.platformID = p22.uint16; this.encodingID = p22.uint16; this.languageID = p22.uint16; this.nameID = p22.uint16; this.length = p22.uint16; this.offset = p22.Offset16; lazy$1(this, `string`, () => { p22.currentPosition = nameTable.stringStart + this.offset; return decodeString(p22, this); }); } }; function decodeString(p22, record) { const { platformID, length } = record; if (length === 0) return ``; if (platformID === 0 || platformID === 3) { const str2 = []; for (let i2 = 0, e2 = length / 2; i2 < e2; i2++) str2[i2] = String.fromCharCode(p22.uint16); return str2.join(``); } const bytes = p22.readBytes(length); const str = []; bytes.forEach(function(b2, i2) { str[i2] = String.fromCharCode(b2); }); return str.join(``); } var name$1 = Object.freeze({ __proto__: null, name }); var OS2 = class extends SimpleTable { constructor(dict, dataview) { const { p: p22 } = super(dict, dataview); this.version = p22.uint16; this.xAvgCharWidth = p22.int16; this.usWeightClass = p22.uint16; this.usWidthClass = p22.uint16; this.fsType = p22.uint16; this.ySubscriptXSize = p22.int16; this.ySubscriptYSize = p22.int16; this.ySubscriptXOffset = p22.int16; this.ySubscriptYOffset = p22.int16; this.ySuperscriptXSize = p22.int16; this.ySuperscriptYSize = p22.int16; this.ySuperscriptXOffset = p22.int16; this.ySuperscriptYOffset = p22.int16; this.yStrikeoutSize = p22.int16; this.yStrikeoutPosition = p22.int16; this.sFamilyClass = p22.int16; this.panose = [...new Array(10)].map((_) => p22.uint8); this.ulUnicodeRange1 = p22.flags(32); this.ulUnicodeRange2 = p22.flags(32); this.ulUnicodeRange3 = p22.flags(32); this.ulUnicodeRange4 = p22.flags(32); this.achVendID = p22.tag; this.fsSelection = p22.uint16; this.usFirstCharIndex = p22.uint16; this.usLastCharIndex = p22.uint16; this.sTypoAscender = p22.int16; this.sTypoDescender = p22.int16; this.sTypoLineGap = p22.int16; this.usWinAscent = p22.uint16; this.usWinDescent = p22.uint16; if (this.version === 0) return p22.verifyLength(); this.ulCodePageRange1 = p22.flags(32); this.ulCodePageRange2 = p22.flags(32); if (this.version === 1) return p22.verifyLength(); this.sxHeight = p22.int16; this.sCapHeight = p22.int16; this.usDefaultChar = p22.uint16; this.usBreakChar = p22.uint16; this.usMaxContext = p22.uint16; if (this.version <= 4) return p22.verifyLength(); this.usLowerOpticalPointSize = p22.uint16; this.usUpperOpticalPointSize = p22.uint16; if (this.version === 5) return p22.verifyLength(); } }; var OS2$1 = Object.freeze({ __proto__: null, OS2 }); var post = class extends SimpleTable { constructor(dict, dataview) { const { p: p22 } = super(dict, dataview); this.version = p22.legacyFixed; this.italicAngle = p22.fixed; this.underlinePosition = p22.fword; this.underlineThickness = p22.fword; this.isFixedPitch = p22.uint32; this.minMemType42 = p22.uint32; this.maxMemType42 = p22.uint32; this.minMemType1 = p22.uint32; this.maxMemType1 = p22.uint32; if (this.version === 1 || this.version === 3) return p22.verifyLength(); this.numGlyphs = p22.uint16; if (this.version === 2) { this.glyphNameIndex = [...new Array(this.numGlyphs)].map( (_) => p22.uint16 ); this.namesOffset = p22.currentPosition; this.glyphNameOffsets = [1]; for (let i2 = 0; i2 < this.numGlyphs; i2++) { let index = this.glyphNameIndex[i2]; if (index < macStrings.length) { this.glyphNameOffsets.push(this.glyphNameOffsets[i2]); continue; } let bytelength = p22.int8; p22.skip(bytelength); this.glyphNameOffsets.push( this.glyphNameOffsets[i2] + bytelength + 1 ); } } if (this.version === 2.5) { this.offset = [...new Array(this.numGlyphs)].map( (_) => p22.int8 ); } } getGlyphName(glyphid) { if (this.version !== 2) { console.warn( `post table version ${this.version} does not support glyph name lookups` ); return ``; } let index = this.glyphNameIndex[glyphid]; if (index < 258) return macStrings[index]; let offset = this.glyphNameOffsets[glyphid]; let next = this.glyphNameOffsets[glyphid + 1]; let len = next - offset - 1; if (len === 0) return `.notdef.`; this.parser.currentPosition = this.namesOffset + offset; const data = this.parser.readBytes( len, this.namesOffset + offset, 8, true ); return data.map((b2) => String.fromCharCode(b2)).join(``); } }; var macStrings = [ `.notdef`, `.null`, `nonmarkingreturn`, `space`, `exclam`, `quotedbl`, `numbersign`, `dollar`, `percent`, `ampersand`, `quotesingle`, `parenleft`, `parenright`, `asterisk`, `plus`, `comma`, `hyphen`, `period`, `slash`, `zero`, `one`, `two`, `three`, `four`, `five`, `six`, `seven`, `eight`, `nine`, `colon`, `semicolon`, `less`, `equal`, `greater`, `question`, `at`, `A`, `B`, `C`, `D`, `E`, `F`, `G`, `H`, `I`, `J`, `K`, `L`, `M`, `N`, `O`, `P`, `Q`, `R`, `S`, `T`, `U`, `V`, `W`, `X`, `Y`, `Z`, `bracketleft`, `backslash`, `bracketright`, `asciicircum`, `underscore`, `grave`, `a`, `b`, `c`, `d`, `e`, `f`, `g`, `h`, `i`, `j`, `k`, `l`, `m`, `n`, `o`, `p`, `q`, `r`, `s`, `t`, `u`, `v`, `w`, `x`, `y`, `z`, `braceleft`, `bar`, `braceright`, `asciitilde`, `Adieresis`, `Aring`, `Ccedilla`, `Eacute`, `Ntilde`, `Odieresis`, `Udieresis`, `aacute`, `agrave`, `acircumflex`, `adieresis`, `atilde`, `aring`, `ccedilla`, `eacute`, `egrave`, `ecircumflex`, `edieresis`, `iacute`, `igrave`, `icircumflex`, `idieresis`, `ntilde`, `oacute`, `ograve`, `ocircumflex`, `odieresis`, `otilde`, `uacute`, `ugrave`, `ucircumflex`, `udieresis`, `dagger`, `degree`, `cent`, `sterling`, `section`, `bullet`, `paragraph`, `germandbls`, `registered`, `copyright`, `trademark`, `acute`, `dieresis`, `notequal`, `AE`, `Oslash`, `infinity`, `plusminus`, `lessequal`, `greaterequal`, `yen`, `mu`, `partialdiff`, `summation`, `product`, `pi`, `integral`, `ordfeminine`, `ordmasculine`, `Omega`, `ae`, `oslash`, `questiondown`, `exclamdown`, `logicalnot`, `radical`, `florin`, `approxequal`, `Delta`, `guillemotleft`, `guillemotright`, `ellipsis`, `nonbreakingspace`, `Agrave`, `Atilde`, `Otilde`, `OE`, `oe`, `endash`, `emdash`, `quotedblleft`, `quotedblright`, `quoteleft`, `quoteright`, `divide`, `lozenge`, `ydieresis`, `Ydieresis`, `fraction`, `currency`, `guilsinglleft`, `guilsinglright`, `fi`, `fl`, `daggerdbl`, `periodcentered`, `quotesinglbase`, `quotedblbase`, `perthousand`, `Acircumflex`, `Ecircumflex`, `Aacute`, `Edieresis`, `Egrave`, `Iacute`, `Icircumflex`, `Idieresis`, `Igrave`, `Oacute`, `Ocircumflex`, `apple`, `Ograve`, `Uacute`, `Ucircumflex`, `Ugrave`, `dotlessi`, `circumflex`, `tilde`, `macron`, `breve`, `dotaccent`, `ring`, `cedilla`, `hungarumlaut`, `ogonek`, `caron`, `Lslash`, `lslash`, `Scaron`, `scaron`, `Zcaron`, `zcaron`, `brokenbar`, `Eth`, `eth`, `Yacute`, `yacute`, `Thorn`, `thorn`, `minus`, `multiply`, `onesuperior`, `twosuperior`, `threesuperior`, `onehalf`, `onequarter`, `threequarters`, `franc`, `Gbreve`, `gbreve`, `Idotaccent`, `Scedilla`, `scedilla`, `Cacute`, `cacute`, `Ccaron`, `ccaron`, `dcroat` ]; var post$1 = Object.freeze({ __proto__: null, post }); var BASE = class extends SimpleTable { constructor(dict, dataview) { const { p: p22 } = super(dict, dataview); this.majorVersion = p22.uint16; this.minorVersion = p22.uint16; this.horizAxisOffset = p22.Offset16; this.vertAxisOffset = p22.Offset16; lazy$1( this, `horizAxis`, () => new AxisTable( { offset: dict.offset + this.horizAxisOffset }, dataview ) ); lazy$1( this, `vertAxis`, () => new AxisTable( { offset: dict.offset + this.vertAxisOffset }, dataview ) ); if (this.majorVersion === 1 && this.minorVersion === 1) { this.itemVarStoreOffset = p22.Offset32; lazy$1( this, `itemVarStore`, () => new AxisTable( { offset: dict.offset + this.itemVarStoreOffset }, dataview ) ); } } }; var AxisTable = class extends SimpleTable { constructor(dict, dataview) { const { p: p22 } = super(dict, dataview, `AxisTable`); this.baseTagListOffset = p22.Offset16; this.baseScriptListOffset = p22.Offset16; lazy$1( this, `baseTagList`, () => new BaseTagListTable( { offset: dict.offset + this.baseTagListOffset }, dataview ) ); lazy$1( this, `baseScriptList`, () => new BaseScriptListTable( { offset: dict.offset + this.baseScriptListOffset }, dataview ) ); } }; var BaseTagListTable = class extends SimpleTable { constructor(dict, dataview) { const { p: p22 } = super(dict, dataview, `BaseTagListTable`); this.baseTagCount = p22.uint16; this.baselineTags = [...new Array(this.baseTagCount)].map( (_) => p22.tag ); } }; var BaseScriptListTable = class extends SimpleTable { constructor(dict, dataview) { const { p: p22 } = super(dict, dataview, `BaseScriptListTable`); this.baseScriptCount = p22.uint16; const recordStart = p22.currentPosition; lazy$1(this, `baseScriptRecords`, () => { p22.currentPosition = recordStart; return [...new Array(this.baseScriptCount)].map( (_) => new BaseScriptRecord(this.start, p22) ); }); } }; var BaseScriptRecord = class { constructor(baseScriptListTableStart, p22) { this.baseScriptTag = p22.tag; this.baseScriptOffset = p22.Offset16; lazy$1(this, `baseScriptTable`, () => { p22.currentPosition = baseScriptListTableStart + this.baseScriptOffset; return new BaseScriptTable(p22); }); } }; var BaseScriptTable = class { constructor(p22) { this.start = p22.currentPosition; this.baseValuesOffset = p22.Offset16; this.defaultMinMaxOffset = p22.Offset16; this.baseLangSysCount = p22.uint16; this.baseLangSysRecords = [...new Array(this.baseLangSysCount)].map( (_) => new BaseLangSysRecord(this.start, p22) ); lazy$1(this, `baseValues`, () => { p22.currentPosition = this.start + this.baseValuesOffset; return new BaseValuesTable(p22); }); lazy$1(this, `defaultMinMax`, () => { p22.currentPosition = this.start + this.defaultMinMaxOffset; return new MinMaxTable(p22); }); } }; var BaseLangSysRecord = class { constructor(baseScriptTableStart, p22) { this.baseLangSysTag = p22.tag; this.minMaxOffset = p22.Offset16; lazy$1(this, `minMax`, () => { p22.currentPosition = baseScriptTableStart + this.minMaxOffset; return new MinMaxTable(p22); }); } }; var BaseValuesTable = class { constructor(p22) { this.parser = p22; this.start = p22.currentPosition; this.defaultBaselineIndex = p22.uint16; this.baseCoordCount = p22.uint16; this.baseCoords = [...new Array(this.baseCoordCount)].map( (_) => p22.Offset16 ); } getTable(id) { this.parser.currentPosition = this.start + this.baseCoords[id]; return new BaseCoordTable(this.parser); } }; var MinMaxTable = class { constructor(p22) { this.minCoord = p22.Offset16; this.maxCoord = p22.Offset16; this.featMinMaxCount = p22.uint16; const recordStart = p22.currentPosition; lazy$1(this, `featMinMaxRecords`, () => { p22.currentPosition = recordStart; return [...new Array(this.featMinMaxCount)].map( (_) => new FeatMinMaxRecord(p22) ); }); } }; var FeatMinMaxRecord = class { constructor(p22) { this.featureTableTag = p22.tag; this.minCoord = p22.Offset16; this.maxCoord = p22.Offset16; } }; var BaseCoordTable = class { constructor(p22) { this.baseCoordFormat = p22.uint16; this.coordinate = p22.int16; if (this.baseCoordFormat === 2) { this.referenceGlyph = p22.uint16; this.baseCoordPoint = p22.uint16; } if (this.baseCoordFormat === 3) { this.deviceTable = p22.Offset16; } } }; var BASE$1 = Object.freeze({ __proto__: null, BASE }); var ClassDefinition = class { constructor(p22) { this.classFormat = p22.uint16; if (this.classFormat === 1) { this.startGlyphID = p22.uint16; this.glyphCount = p22.uint16; this.classValueArray = [...new Array(this.glyphCount)].map( (_) => p22.uint16 ); } if (this.classFormat === 2) { this.classRangeCount = p22.uint16; this.classRangeRecords = [ ...new Array(this.classRangeCount) ].map((_) => new ClassRangeRecord(p22)); } } }; var ClassRangeRecord = class { constructor(p22) { this.startGlyphID = p22.uint16; this.endGlyphID = p22.uint16; this.class = p22.uint16; } }; var CoverageTable = class extends ParsedData { constructor(p22) { super(p22); this.coverageFormat = p22.uint16; if (this.coverageFormat === 1) { this.glyphCount = p22.uint16; this.glyphArray = [...new Array(this.glyphCount)].map( (_) => p22.uint16 ); } if (this.coverageFormat === 2) { this.rangeCount = p22.uint16; this.rangeRecords = [...new Array(this.rangeCount)].map( (_) => new CoverageRangeRecord(p22) ); } } }; var CoverageRangeRecord = class { constructor(p22) { this.startGlyphID = p22.uint16; this.endGlyphID = p22.uint16; this.startCoverageIndex = p22.uint16; } }; var ItemVariationStoreTable = class { constructor(table, p22) { this.table = table; this.parser = p22; this.start = p22.currentPosition; this.format = p22.uint16; this.variationRegionListOffset = p22.Offset32; this.itemVariationDataCount = p22.uint16; this.itemVariationDataOffsets = [ ...new Array(this.itemVariationDataCount) ].map((_) => p22.Offset32); } }; var GDEF = class extends SimpleTable { constructor(dict, dataview) { const { p: p22 } = super(dict, dataview); this.majorVersion = p22.uint16; this.minorVersion = p22.uint16; this.glyphClassDefOffset = p22.Offset16; lazy$1(this, `glyphClassDefs`, () => { if (this.glyphClassDefOffset === 0) return void 0; p22.currentPosition = this.tableStart + this.glyphClassDefOffset; return new ClassDefinition(p22); }); this.attachListOffset = p22.Offset16; lazy$1(this, `attachList`, () => { if (this.attachListOffset === 0) return void 0; p22.currentPosition = this.tableStart + this.attachListOffset; return new AttachList(p22); }); this.ligCaretListOffset = p22.Offset16; lazy$1(this, `ligCaretList`, () => { if (this.ligCaretListOffset === 0) return void 0; p22.currentPosition = this.tableStart + this.ligCaretListOffset; return new LigCaretList(p22); }); this.markAttachClassDefOffset = p22.Offset16; lazy$1(this, `markAttachClassDef`, () => { if (this.markAttachClassDefOffset === 0) return void 0; p22.currentPosition = this.tableStart + this.markAttachClassDefOffset; return new ClassDefinition(p22); }); if (this.minorVersion >= 2) { this.markGlyphSetsDefOffset = p22.Offset16; lazy$1(this, `markGlyphSetsDef`, () => { if (this.markGlyphSetsDefOffset === 0) return void 0; p22.currentPosition = this.tableStart + this.markGlyphSetsDefOffset; return new MarkGlyphSetsTable(p22); }); } if (this.minorVersion === 3) { this.itemVarStoreOffset = p22.Offset32; lazy$1(this, `itemVarStore`, () => { if (this.itemVarStoreOffset === 0) return void 0; p22.currentPosition = this.tableStart + this.itemVarStoreOffset; return new ItemVariationStoreTable(p22); }); } } }; var AttachList = class extends ParsedData { constructor(p22) { super(p22); this.coverageOffset = p22.Offset16; this.glyphCount = p22.uint16; this.attachPointOffsets = [...new Array(this.glyphCount)].map( (_) => p22.Offset16 ); } getPoint(pointID) { this.parser.currentPosition = this.start + this.attachPointOffsets[pointID]; return new AttachPoint(this.parser); } }; var AttachPoint = class { constructor(p22) { this.pointCount = p22.uint16; this.pointIndices = [...new Array(this.pointCount)].map( (_) => p22.uint16 ); } }; var LigCaretList = class extends ParsedData { constructor(p22) { super(p22); this.coverageOffset = p22.Offset16; lazy$1(this, `coverage`, () => { p22.currentPosition = this.start + this.coverageOffset; return new CoverageTable(p22); }); this.ligGlyphCount = p22.uint16; this.ligGlyphOffsets = [...new Array(this.ligGlyphCount)].map( (_) => p22.Offset16 ); } getLigGlyph(ligGlyphID) { this.parser.currentPosition = this.start + this.ligGlyphOffsets[ligGlyphID]; return new LigGlyph(this.parser); } }; var LigGlyph = class extends ParsedData { constructor(p22) { super(p22); this.caretCount = p22.uint16; this.caretValueOffsets = [...new Array(this.caretCount)].map( (_) => p22.Offset16 ); } getCaretValue(caretID) { this.parser.currentPosition = this.start + this.caretValueOffsets[caretID]; return new CaretValue(this.parser); } }; var CaretValue = class { constructor(p22) { this.caretValueFormat = p22.uint16; if (this.caretValueFormat === 1) { this.coordinate = p22.int16; } if (this.caretValueFormat === 2) { this.caretValuePointIndex = p22.uint16; } if (this.caretValueFormat === 3) { this.coordinate = p22.int16; this.deviceOffset = p22.Offset16; } } }; var MarkGlyphSetsTable = class extends ParsedData { constructor(p22) { super(p22); this.markGlyphSetTableFormat = p22.uint16; this.markGlyphSetCount = p22.uint16; this.coverageOffsets = [...new Array(this.markGlyphSetCount)].map( (_) => p22.Offset32 ); } getMarkGlyphSet(markGlyphSetID) { this.parser.currentPosition = this.start + this.coverageOffsets[markGlyphSetID]; return new CoverageTable(this.parser); } }; var GDEF$1 = Object.freeze({ __proto__: null, GDEF }); var ScriptList = class extends ParsedData { static EMPTY = { scriptCount: 0, scriptRecords: [] }; constructor(p22) { super(p22); this.scriptCount = p22.uint16; this.scriptRecords = [...new Array(this.scriptCount)].map( (_) => new ScriptRecord(p22) ); } }; var ScriptRecord = class { constructor(p22) { this.scriptTag = p22.tag; this.scriptOffset = p22.Offset16; } }; var ScriptTable = class extends ParsedData { constructor(p22) { super(p22); this.defaultLangSys = p22.Offset16; this.langSysCount = p22.uint16; this.langSysRecords = [...new Array(this.langSysCount)].map( (_) => new LangSysRecord(p22) ); } }; var LangSysRecord = class { constructor(p22) { this.langSysTag = p22.tag; this.langSysOffset = p22.Offset16; } }; var LangSysTable = class { constructor(p22) { this.lookupOrder = p22.Offset16; this.requiredFeatureIndex = p22.uint16; this.featureIndexCount = p22.uint16; this.featureIndices = [...new Array(this.featureIndexCount)].map( (_) => p22.uint16 ); } }; var FeatureList = class extends ParsedData { static EMPTY = { featureCount: 0, featureRecords: [] }; constructor(p22) { super(p22); this.featureCount = p22.uint16; this.featureRecords = [...new Array(this.featureCount)].map( (_) => new FeatureRecord(p22) ); } }; var FeatureRecord = class { constructor(p22) { this.featureTag = p22.tag; this.featureOffset = p22.Offset16; } }; var FeatureTable = class extends ParsedData { constructor(p22) { super(p22); this.featureParams = p22.Offset16; this.lookupIndexCount = p22.uint16; this.lookupListIndices = [...new Array(this.lookupIndexCount)].map( (_) => p22.uint16 ); } getFeatureParams() { if (this.featureParams > 0) { const p22 = this.parser; p22.currentPosition = this.start + this.featureParams; const tag = this.featureTag; if (tag === `size`) return new Size(p22); if (tag.startsWith(`cc`)) return new CharacterVariant(p22); if (tag.startsWith(`ss`)) return new StylisticSet(p22); } } }; var CharacterVariant = class { constructor(p22) { this.format = p22.uint16; this.featUiLabelNameId = p22.uint16; this.featUiTooltipTextNameId = p22.uint16; this.sampleTextNameId = p22.uint16; this.numNamedParameters = p22.uint16; this.firstParamUiLabelNameId = p22.uint16; this.charCount = p22.uint16; this.character = [...new Array(this.charCount)].map( (_) => p22.uint24 ); } }; var Size = class { constructor(p22) { this.designSize = p22.uint16; this.subfamilyIdentifier = p22.uint16; this.subfamilyNameID = p22.uint16; this.smallEnd = p22.uint16; this.largeEnd = p22.uint16; } }; var StylisticSet = class { constructor(p22) { this.version = p22.uint16; this.UINameID = p22.uint16; } }; function undoCoverageOffsetParsing(instance) { instance.parser.currentPosition -= 2; delete instance.coverageOffset; delete instance.getCoverageTable; } var LookupType$1 = class extends ParsedData { constructor(p22) { super(p22); this.substFormat = p22.uint16; this.coverageOffset = p22.Offset16; } getCoverageTable() { let p22 = this.parser; p22.currentPosition = this.start + this.coverageOffset; return new CoverageTable(p22); } }; var SubstLookupRecord = class { constructor(p22) { this.glyphSequenceIndex = p22.uint16; this.lookupListIndex = p22.uint16; } }; var LookupType1$1 = class extends LookupType$1 { constructor(p22) { super(p22); this.deltaGlyphID = p22.int16; } }; var LookupType2$1 = class extends LookupType$1 { constructor(p22) { super(p22); this.sequenceCount = p22.uint16; this.sequenceOffsets = [...new Array(this.sequenceCount)].map( (_) => p22.Offset16 ); } getSequence(index) { let p22 = this.parser; p22.currentPosition = this.start + this.sequenceOffsets[index]; return new SequenceTable(p22); } }; var SequenceTable = class { constructor(p22) { this.glyphCount = p22.uint16; this.substituteGlyphIDs = [...new Array(this.glyphCount)].map( (_) => p22.uint16 ); } }; var LookupType3$1 = class extends LookupType$1 { constructor(p22) { super(p22); this.alternateSetCount = p22.uint16; this.alternateSetOffsets = [ ...new Array(this.alternateSetCount) ].map((_) => p22.Offset16); } getAlternateSet(index) { let p22 = this.parser; p22.currentPosition = this.start + this.alternateSetOffsets[index]; return new AlternateSetTable(p22); } }; var AlternateSetTable = class { constructor(p22) { this.glyphCount = p22.uint16; this.alternateGlyphIDs = [...new Array(this.glyphCount)].map( (_) => p22.uint16 ); } }; var LookupType4$1 = class extends LookupType$1 { constructor(p22) { super(p22); this.ligatureSetCount = p22.uint16; this.ligatureSetOffsets = [...new Array(this.ligatureSetCount)].map( (_) => p22.Offset16 ); } getLigatureSet(index) { let p22 = this.parser; p22.currentPosition = this.start + this.ligatureSetOffsets[index]; return new LigatureSetTable(p22); } }; var LigatureSetTable = class extends ParsedData { constructor(p22) { super(p22); this.ligatureCount = p22.uint16; this.ligatureOffsets = [...new Array(this.ligatureCount)].map( (_) => p22.Offset16 ); } getLigature(index) { let p22 = this.parser; p22.currentPosition = this.start + this.ligatureOffsets[index]; return new LigatureTable(p22); } }; var LigatureTable = class { constructor(p22) { this.ligatureGlyph = p22.uint16; this.componentCount = p22.uint16; this.componentGlyphIDs = [ ...new Array(this.componentCount - 1) ].map((_) => p22.uint16); } }; var LookupType5$1 = class extends LookupType$1 { constructor(p22) { super(p22); if (this.substFormat === 1) { this.subRuleSetCount = p22.uint16; this.subRuleSetOffsets = [ ...new Array(this.subRuleSetCount) ].map((_) => p22.Offset16); } if (this.substFormat === 2) { this.classDefOffset = p22.Offset16; this.subClassSetCount = p22.uint16; this.subClassSetOffsets = [ ...new Array(this.subClassSetCount) ].map((_) => p22.Offset16); } if (this.substFormat === 3) { undoCoverageOffsetParsing(this); this.glyphCount = p22.uint16; this.substitutionCount = p22.uint16; this.coverageOffsets = [...new Array(this.glyphCount)].map( (_) => p22.Offset16 ); this.substLookupRecords = [ ...new Array(this.substitutionCount) ].map((_) => new SubstLookupRecord(p22)); } } getSubRuleSet(index) { if (this.substFormat !== 1) throw new Error( `lookup type 5.${this.substFormat} has no subrule sets.` ); let p22 = this.parser; p22.currentPosition = this.start + this.subRuleSetOffsets[index]; return new SubRuleSetTable(p22); } getSubClassSet(index) { if (this.substFormat !== 2) throw new Error( `lookup type 5.${this.substFormat} has no subclass sets.` ); let p22 = this.parser; p22.currentPosition = this.start + this.subClassSetOffsets[index]; return new SubClassSetTable(p22); } getCoverageTable(index) { if (this.substFormat !== 3 && !index) return super.getCoverageTable(); if (!index) throw new Error( `lookup type 5.${this.substFormat} requires an coverage table index.` ); let p22 = this.parser; p22.currentPosition = this.start + this.coverageOffsets[index]; return new CoverageTable(p22); } }; var SubRuleSetTable = class extends ParsedData { constructor(p22) { super(p22); this.subRuleCount = p22.uint16; this.subRuleOffsets = [...new Array(this.subRuleCount)].map( (_) => p22.Offset16 ); } getSubRule(index) { let p22 = this.parser; p22.currentPosition = this.start + this.subRuleOffsets[index]; return new SubRuleTable(p22); } }; var SubRuleTable = class { constructor(p22) { this.glyphCount = p22.uint16; this.substitutionCount = p22.uint16; this.inputSequence = [...new Array(this.glyphCount - 1)].map( (_) => p22.uint16 ); this.substLookupRecords = [ ...new Array(this.substitutionCount) ].map((_) => new SubstLookupRecord(p22)); } }; var SubClassSetTable = class extends ParsedData { constructor(p22) { super(p22); this.subClassRuleCount = p22.uint16; this.subClassRuleOffsets = [ ...new Array(this.subClassRuleCount) ].map((_) => p22.Offset16); } getSubClass(index) { let p22 = this.parser; p22.currentPosition = this.start + this.subClassRuleOffsets[index]; return new SubClassRuleTable(p22); } }; var SubClassRuleTable = class extends SubRuleTable { constructor(p22) { super(p22); } }; var LookupType6$1 = class extends LookupType$1 { constructor(p22) { super(p22); if (this.substFormat === 1) { this.chainSubRuleSetCount = p22.uint16; this.chainSubRuleSetOffsets = [ ...new Array(this.chainSubRuleSetCount) ].map((_) => p22.Offset16); } if (this.substFormat === 2) { this.backtrackClassDefOffset = p22.Offset16; this.inputClassDefOffset = p22.Offset16; this.lookaheadClassDefOffset = p22.Offset16; this.chainSubClassSetCount = p22.uint16; this.chainSubClassSetOffsets = [ ...new Array(this.chainSubClassSetCount) ].map((_) => p22.Offset16); } if (this.substFormat === 3) { undoCoverageOffsetParsing(this); this.backtrackGlyphCount = p22.uint16; this.backtrackCoverageOffsets = [ ...new Array(this.backtrackGlyphCount) ].map((_) => p22.Offset16); this.inputGlyphCount = p22.uint16; this.inputCoverageOffsets = [ ...new Array(this.inputGlyphCount) ].map((_) => p22.Offset16); this.lookaheadGlyphCount = p22.uint16; this.lookaheadCoverageOffsets = [ ...new Array(this.lookaheadGlyphCount) ].map((_) => p22.Offset16); this.seqLookupCount = p22.uint16; this.seqLookupRecords = [ ...new Array(this.substitutionCount) ].map((_) => new SequenceLookupRecord(p22)); } } getChainSubRuleSet(index) { if (this.substFormat !== 1) throw new Error( `lookup type 6.${this.substFormat} has no chainsubrule sets.` ); let p22 = this.parser; p22.currentPosition = this.start + this.chainSubRuleSetOffsets[index]; return new ChainSubRuleSetTable(p22); } getChainSubClassSet(index) { if (this.substFormat !== 2) throw new Error( `lookup type 6.${this.substFormat} has no chainsubclass sets.` ); let p22 = this.parser; p22.currentPosition = this.start + this.chainSubClassSetOffsets[index]; return new ChainSubClassSetTable(p22); } getCoverageFromOffset(offset) { if (this.substFormat !== 3) throw new Error( `lookup type 6.${this.substFormat} does not use contextual coverage offsets.` ); let p22 = this.parser; p22.currentPosition = this.start + offset; return new CoverageTable(p22); } }; var ChainSubRuleSetTable = class extends ParsedData { constructor(p22) { super(p22); this.chainSubRuleCount = p22.uint16; this.chainSubRuleOffsets = [ ...new Array(this.chainSubRuleCount) ].map((_) => p22.Offset16); } getSubRule(index) { let p22 = this.parser; p22.currentPosition = this.start + this.chainSubRuleOffsets[index]; return new ChainSubRuleTable(p22); } }; var ChainSubRuleTable = class { constructor(p22) { this.backtrackGlyphCount = p22.uint16; this.backtrackSequence = [ ...new Array(this.backtrackGlyphCount) ].map((_) => p22.uint16); this.inputGlyphCount = p22.uint16; this.inputSequence = [...new Array(this.inputGlyphCount - 1)].map( (_) => p22.uint16 ); this.lookaheadGlyphCount = p22.uint16; this.lookAheadSequence = [ ...new Array(this.lookAheadGlyphCount) ].map((_) => p22.uint16); this.substitutionCount = p22.uint16; this.substLookupRecords = [...new Array(this.SubstCount)].map( (_) => new SubstLookupRecord(p22) ); } }; var ChainSubClassSetTable = class extends ParsedData { constructor(p22) { super(p22); this.chainSubClassRuleCount = p22.uint16; this.chainSubClassRuleOffsets = [ ...new Array(this.chainSubClassRuleCount) ].map((_) => p22.Offset16); } getSubClass(index) { let p22 = this.parser; p22.currentPosition = this.start + this.chainSubRuleOffsets[index]; return new ChainSubClassRuleTable(p22); } }; var ChainSubClassRuleTable = class { constructor(p22) { this.backtrackGlyphCount = p22.uint16; this.backtrackSequence = [ ...new Array(this.backtrackGlyphCount) ].map((_) => p22.uint16); this.inputGlyphCount = p22.uint16; this.inputSequence = [...new Array(this.inputGlyphCount - 1)].map( (_) => p22.uint16 ); this.lookaheadGlyphCount = p22.uint16; this.lookAheadSequence = [ ...new Array(this.lookAheadGlyphCount) ].map((_) => p22.uint16); this.substitutionCount = p22.uint16; this.substLookupRecords = [ ...new Array(this.substitutionCount) ].map((_) => new SequenceLookupRecord(p22)); } }; var SequenceLookupRecord = class extends ParsedData { constructor(p22) { super(p22); this.sequenceIndex = p22.uint16; this.lookupListIndex = p22.uint16; } }; var LookupType7$1 = class extends ParsedData { constructor(p22) { super(p22); this.substFormat = p22.uint16; this.extensionLookupType = p22.uint16; this.extensionOffset = p22.Offset32; } }; var LookupType8$1 = class extends LookupType$1 { constructor(p22) { super(p22); this.backtrackGlyphCount = p22.uint16; this.backtrackCoverageOffsets = [ ...new Array(this.backtrackGlyphCount) ].map((_) => p22.Offset16); this.lookaheadGlyphCount = p22.uint16; this.lookaheadCoverageOffsets = [ new Array(this.lookaheadGlyphCount) ].map((_) => p22.Offset16); this.glyphCount = p22.uint16; this.substituteGlyphIDs = [...new Array(this.glyphCount)].map( (_) => p22.uint16 ); } }; var GSUBtables = { buildSubtable: function(type, p22) { const subtable = new [ void 0, LookupType1$1, LookupType2$1, LookupType3$1, LookupType4$1, LookupType5$1, LookupType6$1, LookupType7$1, LookupType8$1 ][type](p22); subtable.type = type; return subtable; } }; var LookupType = class extends ParsedData { constructor(p22) { super(p22); } }; var LookupType1 = class extends LookupType { constructor(p22) { super(p22); console.log(`lookup type 1`); } }; var LookupType2 = class extends LookupType { constructor(p22) { super(p22); console.log(`lookup type 2`); } }; var LookupType3 = class extends LookupType { constructor(p22) { super(p22); console.log(`lookup type 3`); } }; var LookupType4 = class extends LookupType { constructor(p22) { super(p22); console.log(`lookup type 4`); } }; var LookupType5 = class extends LookupType { constructor(p22) { super(p22); console.log(`lookup type 5`); } }; var LookupType6 = class extends LookupType { constructor(p22) { super(p22); console.log(`lookup type 6`); } }; var LookupType7 = class extends LookupType { constructor(p22) { super(p22); console.log(`lookup type 7`); } }; var LookupType8 = class extends LookupType { constructor(p22) { super(p22); console.log(`lookup type 8`); } }; var LookupType9 = class extends LookupType { constructor(p22) { super(p22); console.log(`lookup type 9`); } }; var GPOStables = { buildSubtable: function(type, p22) { const subtable = new [ void 0, LookupType1, LookupType2, LookupType3, LookupType4, LookupType5, LookupType6, LookupType7, LookupType8, LookupType9 ][type](p22); subtable.type = type; return subtable; } }; var LookupList = class extends ParsedData { static EMPTY = { lookupCount: 0, lookups: [] }; constructor(p22) { super(p22); this.lookupCount = p22.uint16; this.lookups = [...new Array(this.lookupCount)].map( (_) => p22.Offset16 ); } }; var LookupTable = class extends ParsedData { constructor(p22, type) { super(p22); this.ctType = type; this.lookupType = p22.uint16; this.lookupFlag = p22.uint16; this.subTableCount = p22.uint16; this.subtableOffsets = [...new Array(this.subTableCount)].map( (_) => p22.Offset16 ); this.markFilteringSet = p22.uint16; } get rightToLeft() { return this.lookupFlag & true; } get ignoreBaseGlyphs() { return this.lookupFlag & true; } get ignoreLigatures() { return this.lookupFlag & true; } get ignoreMarks() { return this.lookupFlag & true; } get useMarkFilteringSet() { return this.lookupFlag & true; } get markAttachmentType() { return this.lookupFlag & true; } getSubTable(index) { const builder = this.ctType === `GSUB` ? GSUBtables : GPOStables; this.parser.currentPosition = this.start + this.subtableOffsets[index]; return builder.buildSubtable(this.lookupType, this.parser); } }; var CommonLayoutTable = class extends SimpleTable { constructor(dict, dataview, name2) { const { p: p22, tableStart } = super(dict, dataview, name2); this.majorVersion = p22.uint16; this.minorVersion = p22.uint16; this.scriptListOffset = p22.Offset16; this.featureListOffset = p22.Offset16; this.lookupListOffset = p22.Offset16; if (this.majorVersion === 1 && this.minorVersion === 1) { this.featureVariationsOffset = p22.Offset32; } const no_content = !(this.scriptListOffset || this.featureListOffset || this.lookupListOffset); lazy$1(this, `scriptList`, () => { if (no_content) return ScriptList.EMPTY; p22.currentPosition = tableStart + this.scriptListOffset; return new ScriptList(p22); }); lazy$1(this, `featureList`, () => { if (no_content) return FeatureList.EMPTY; p22.currentPosition = tableStart + this.featureListOffset; return new FeatureList(p22); }); lazy$1(this, `lookupList`, () => { if (no_content) return LookupList.EMPTY; p22.currentPosition = tableStart + this.lookupListOffset; return new LookupList(p22); }); if (this.featureVariationsOffset) { lazy$1(this, `featureVariations`, () => { if (no_content) return FeatureVariations.EMPTY; p22.currentPosition = tableStart + this.featureVariationsOffset; return new FeatureVariations(p22); }); } } getSupportedScripts() { return this.scriptList.scriptRecords.map((r3) => r3.scriptTag); } getScriptTable(scriptTag) { let record = this.scriptList.scriptRecords.find( (r3) => r3.scriptTag === scriptTag ); this.parser.currentPosition = this.scriptList.start + record.scriptOffset; let table = new ScriptTable(this.parser); table.scriptTag = scriptTag; return table; } ensureScriptTable(arg) { if (typeof arg === "string") { return this.getScriptTable(arg); } return arg; } getSupportedLangSys(scriptTable) { scriptTable = this.ensureScriptTable(scriptTable); const hasDefault = scriptTable.defaultLangSys !== 0; const supported = scriptTable.langSysRecords.map( (l2) => l2.langSysTag ); if (hasDefault) supported.unshift(`dflt`); return supported; } getDefaultLangSysTable(scriptTable) { scriptTable = this.ensureScriptTable(scriptTable); let offset = scriptTable.defaultLangSys; if (offset !== 0) { this.parser.currentPosition = scriptTable.start + offset; let table = new LangSysTable(this.parser); table.langSysTag = ``; table.defaultForScript = scriptTable.scriptTag; return table; } } getLangSysTable(scriptTable, langSysTag = `dflt`) { if (langSysTag === `dflt`) return this.getDefaultLangSysTable(scriptTable); scriptTable = this.ensureScriptTable(scriptTable); let record = scriptTable.langSysRecords.find( (l2) => l2.langSysTag === langSysTag ); this.parser.currentPosition = scriptTable.start + record.langSysOffset; let table = new LangSysTable(this.parser); table.langSysTag = langSysTag; return table; } getFeatures(langSysTable) { return langSysTable.featureIndices.map( (index) => this.getFeature(index) ); } getFeature(indexOrTag) { let record; if (parseInt(indexOrTag) == indexOrTag) { record = this.featureList.featureRecords[indexOrTag]; } else { record = this.featureList.featureRecords.find( (f2) => f2.featureTag === indexOrTag ); } if (!record) return; this.parser.currentPosition = this.featureList.start + record.featureOffset; let table = new FeatureTable(this.parser); table.featureTag = record.featureTag; return table; } getLookups(featureTable) { return featureTable.lookupListIndices.map( (index) => this.getLookup(index) ); } getLookup(lookupIndex, type) { let lookupOffset = this.lookupList.lookups[lookupIndex]; this.parser.currentPosition = this.lookupList.start + lookupOffset; return new LookupTable(this.parser, type); } }; var GSUB = class extends CommonLayoutTable { constructor(dict, dataview) { super(dict, dataview, `GSUB`); } getLookup(lookupIndex) { return super.getLookup(lookupIndex, `GSUB`); } }; var GSUB$1 = Object.freeze({ __proto__: null, GSUB }); var GPOS = class extends CommonLayoutTable { constructor(dict, dataview) { super(dict, dataview, `GPOS`); } getLookup(lookupIndex) { return super.getLookup(lookupIndex, `GPOS`); } }; var GPOS$1 = Object.freeze({ __proto__: null, GPOS }); var SVG67 = class extends SimpleTable { constructor(dict, dataview) { const { p: p22 } = super(dict, dataview); this.version = p22.uint16; this.offsetToSVGDocumentList = p22.Offset32; p22.currentPosition = this.tableStart + this.offsetToSVGDocumentList; this.documentList = new SVGDocumentList(p22); } }; var SVGDocumentList = class extends ParsedData { constructor(p22) { super(p22); this.numEntries = p22.uint16; this.documentRecords = [...new Array(this.numEntries)].map( (_) => new SVGDocumentRecord(p22) ); } getDocument(documentID) { let record = this.documentRecords[documentID]; if (!record) return ""; let offset = this.start + record.svgDocOffset; this.parser.currentPosition = offset; return this.parser.readBytes(record.svgDocLength); } getDocumentForGlyph(glyphID) { let id = this.documentRecords.findIndex( (d2) => d2.startGlyphID <= glyphID && glyphID <= d2.endGlyphID ); if (id === -1) return ""; return this.getDocument(id); } }; var SVGDocumentRecord = class { constructor(p22) { this.startGlyphID = p22.uint16; this.endGlyphID = p22.uint16; this.svgDocOffset = p22.Offset32; this.svgDocLength = p22.uint32; } }; var SVG$1 = Object.freeze({ __proto__: null, SVG: SVG67 }); var fvar = class extends SimpleTable { constructor(dict, dataview) { const { p: p22 } = super(dict, dataview); this.majorVersion = p22.uint16; this.minorVersion = p22.uint16; this.axesArrayOffset = p22.Offset16; p22.uint16; this.axisCount = p22.uint16; this.axisSize = p22.uint16; this.instanceCount = p22.uint16; this.instanceSize = p22.uint16; const axisStart = this.tableStart + this.axesArrayOffset; lazy$1(this, `axes`, () => { p22.currentPosition = axisStart; return [...new Array(this.axisCount)].map( (_) => new VariationAxisRecord(p22) ); }); const instanceStart = axisStart + this.axisCount * this.axisSize; lazy$1(this, `instances`, () => { let instances = []; for (let i2 = 0; i2 < this.instanceCount; i2++) { p22.currentPosition = instanceStart + i2 * this.instanceSize; instances.push( new InstanceRecord(p22, this.axisCount, this.instanceSize) ); } return instances; }); } getSupportedAxes() { return this.axes.map((a2) => a2.tag); } getAxis(name2) { return this.axes.find((a2) => a2.tag === name2); } }; var VariationAxisRecord = class { constructor(p22) { this.tag = p22.tag; this.minValue = p22.fixed; this.defaultValue = p22.fixed; this.maxValue = p22.fixed; this.flags = p22.flags(16); this.axisNameID = p22.uint16; } }; var InstanceRecord = class { constructor(p22, axisCount, size) { let start2 = p22.currentPosition; this.subfamilyNameID = p22.uint16; p22.uint16; this.coordinates = [...new Array(axisCount)].map( (_) => p22.fixed ); if (p22.currentPosition - start2 < size) { this.postScriptNameID = p22.uint16; } } }; var fvar$1 = Object.freeze({ __proto__: null, fvar }); var cvt = class extends SimpleTable { constructor(dict, dataview) { const { p: p22 } = super(dict, dataview); const n2 = dict.length / 2; lazy$1( this, `items`, () => [...new Array(n2)].map((_) => p22.fword) ); } }; var cvt$1 = Object.freeze({ __proto__: null, cvt }); var fpgm = class extends SimpleTable { constructor(dict, dataview) { const { p: p22 } = super(dict, dataview); lazy$1( this, `instructions`, () => [...new Array(dict.length)].map((_) => p22.uint8) ); } }; var fpgm$1 = Object.freeze({ __proto__: null, fpgm }); var gasp = class extends SimpleTable { constructor(dict, dataview) { const { p: p22 } = super(dict, dataview); this.version = p22.uint16; this.numRanges = p22.uint16; const getter = () => [...new Array(this.numRanges)].map( (_) => new GASPRange(p22) ); lazy$1(this, `gaspRanges`, getter); } }; var GASPRange = class { constructor(p22) { this.rangeMaxPPEM = p22.uint16; this.rangeGaspBehavior = p22.uint16; } }; var gasp$1 = Object.freeze({ __proto__: null, gasp }); var glyf = class extends SimpleTable { constructor(dict, dataview) { super(dict, dataview); } getGlyphData(offset, length) { this.parser.currentPosition = this.tableStart + offset; return this.parser.readBytes(length); } }; var glyf$1 = Object.freeze({ __proto__: null, glyf }); var loca = class extends SimpleTable { constructor(dict, dataview, tables) { const { p: p22 } = super(dict, dataview); const n2 = tables.maxp.numGlyphs + 1; if (tables.head.indexToLocFormat === 0) { this.x2 = true; lazy$1( this, `offsets`, () => [...new Array(n2)].map((_) => p22.Offset16) ); } else { lazy$1( this, `offsets`, () => [...new Array(n2)].map((_) => p22.Offset32) ); } } getGlyphDataOffsetAndLength(glyphID) { let offset = this.offsets[glyphID] * this.x2 ? 2 : 1; let nextOffset = this.offsets[glyphID + 1] * this.x2 ? 2 : 1; return { offset, length: nextOffset - offset }; } }; var loca$1 = Object.freeze({ __proto__: null, loca }); var prep = class extends SimpleTable { constructor(dict, dataview) { const { p: p22 } = super(dict, dataview); lazy$1( this, `instructions`, () => [...new Array(dict.length)].map((_) => p22.uint8) ); } }; var prep$1 = Object.freeze({ __proto__: null, prep }); var CFF = class extends SimpleTable { constructor(dict, dataview) { const { p: p22 } = super(dict, dataview); lazy$1(this, `data`, () => p22.readBytes()); } }; var CFF$1 = Object.freeze({ __proto__: null, CFF }); var CFF2 = class extends SimpleTable { constructor(dict, dataview) { const { p: p22 } = super(dict, dataview); lazy$1(this, `data`, () => p22.readBytes()); } }; var CFF2$1 = Object.freeze({ __proto__: null, CFF2 }); var VORG = class extends SimpleTable { constructor(dict, dataview) { const { p: p22 } = super(dict, dataview); this.majorVersion = p22.uint16; this.minorVersion = p22.uint16; this.defaultVertOriginY = p22.int16; this.numVertOriginYMetrics = p22.uint16; lazy$1( this, `vertORiginYMetrics`, () => [...new Array(this.numVertOriginYMetrics)].map( (_) => new VertOriginYMetric(p22) ) ); } }; var VertOriginYMetric = class { constructor(p22) { this.glyphIndex = p22.uint16; this.vertOriginY = p22.int16; } }; var VORG$1 = Object.freeze({ __proto__: null, VORG }); var BitmapSize = class { constructor(p22) { this.indexSubTableArrayOffset = p22.Offset32; this.indexTablesSize = p22.uint32; this.numberofIndexSubTables = p22.uint32; this.colorRef = p22.uint32; this.hori = new SbitLineMetrics(p22); this.vert = new SbitLineMetrics(p22); this.startGlyphIndex = p22.uint16; this.endGlyphIndex = p22.uint16; this.ppemX = p22.uint8; this.ppemY = p22.uint8; this.bitDepth = p22.uint8; this.flags = p22.int8; } }; var BitmapScale = class { constructor(p22) { this.hori = new SbitLineMetrics(p22); this.vert = new SbitLineMetrics(p22); this.ppemX = p22.uint8; this.ppemY = p22.uint8; this.substitutePpemX = p22.uint8; this.substitutePpemY = p22.uint8; } }; var SbitLineMetrics = class { constructor(p22) { this.ascender = p22.int8; this.descender = p22.int8; this.widthMax = p22.uint8; this.caretSlopeNumerator = p22.int8; this.caretSlopeDenominator = p22.int8; this.caretOffset = p22.int8; this.minOriginSB = p22.int8; this.minAdvanceSB = p22.int8; this.maxBeforeBL = p22.int8; this.minAfterBL = p22.int8; this.pad1 = p22.int8; this.pad2 = p22.int8; } }; var EBLC = class extends SimpleTable { constructor(dict, dataview, name2) { const { p: p22 } = super(dict, dataview, name2); this.majorVersion = p22.uint16; this.minorVersion = p22.uint16; this.numSizes = p22.uint32; lazy$1( this, `bitMapSizes`, () => [...new Array(this.numSizes)].map( (_) => new BitmapSize(p22) ) ); } }; var EBLC$1 = Object.freeze({ __proto__: null, EBLC }); var EBDT = class extends SimpleTable { constructor(dict, dataview, name2) { const { p: p22 } = super(dict, dataview, name2); this.majorVersion = p22.uint16; this.minorVersion = p22.uint16; } }; var EBDT$1 = Object.freeze({ __proto__: null, EBDT }); var EBSC = class extends SimpleTable { constructor(dict, dataview) { const { p: p22 } = super(dict, dataview); this.majorVersion = p22.uint16; this.minorVersion = p22.uint16; this.numSizes = p22.uint32; lazy$1( this, `bitmapScales`, () => [...new Array(this.numSizes)].map( (_) => new BitmapScale(p22) ) ); } }; var EBSC$1 = Object.freeze({ __proto__: null, EBSC }); var CBLC = class extends EBLC { constructor(dict, dataview) { super(dict, dataview, `CBLC`); } }; var CBLC$1 = Object.freeze({ __proto__: null, CBLC }); var CBDT = class extends EBDT { constructor(dict, dataview) { super(dict, dataview, `CBDT`); } }; var CBDT$1 = Object.freeze({ __proto__: null, CBDT }); var sbix = class extends SimpleTable { constructor(dict, dataview) { const { p: p22 } = super(dict, dataview); this.version = p22.uint16; this.flags = p22.flags(16); this.numStrikes = p22.uint32; lazy$1( this, `strikeOffsets`, () => [...new Array(this.numStrikes)].map((_) => p22.Offset32) ); } }; var sbix$1 = Object.freeze({ __proto__: null, sbix }); var COLR = class extends SimpleTable { constructor(dict, dataview) { const { p: p22 } = super(dict, dataview); this.version = p22.uint16; this.numBaseGlyphRecords = p22.uint16; this.baseGlyphRecordsOffset = p22.Offset32; this.layerRecordsOffset = p22.Offset32; this.numLayerRecords = p22.uint16; } getBaseGlyphRecord(glyphID) { let start2 = this.tableStart + this.baseGlyphRecordsOffset; this.parser.currentPosition = start2; let first = new BaseGlyphRecord(this.parser); let firstID = first.gID; let end = this.tableStart + this.layerRecordsOffset - 6; this.parser.currentPosition = end; let last = new BaseGlyphRecord(this.parser); let lastID = last.gID; if (firstID === glyphID) return first; if (lastID === glyphID) return last; while (true) { if (start2 === end) break; let mid = start2 + (end - start2) / 12; this.parser.currentPosition = mid; let middle = new BaseGlyphRecord(this.parser); let midID = middle.gID; if (midID === glyphID) return middle; else if (midID > glyphID) { end = mid; } else if (midID < glyphID) { start2 = mid; } } return false; } getLayers(glyphID) { let record = this.getBaseGlyphRecord(glyphID); this.parser.currentPosition = this.tableStart + this.layerRecordsOffset + 4 * record.firstLayerIndex; return [...new Array(record.numLayers)].map( (_) => new LayerRecord(p) ); } }; var BaseGlyphRecord = class { constructor(p22) { this.gID = p22.uint16; this.firstLayerIndex = p22.uint16; this.numLayers = p22.uint16; } }; var LayerRecord = class { constructor(p22) { this.gID = p22.uint16; this.paletteIndex = p22.uint16; } }; var COLR$1 = Object.freeze({ __proto__: null, COLR }); var CPAL = class extends SimpleTable { constructor(dict, dataview) { const { p: p22 } = super(dict, dataview); this.version = p22.uint16; this.numPaletteEntries = p22.uint16; const numPalettes = this.numPalettes = p22.uint16; this.numColorRecords = p22.uint16; this.offsetFirstColorRecord = p22.Offset32; this.colorRecordIndices = [...new Array(this.numPalettes)].map( (_) => p22.uint16 ); lazy$1(this, `colorRecords`, () => { p22.currentPosition = this.tableStart + this.offsetFirstColorRecord; return [...new Array(this.numColorRecords)].map( (_) => new ColorRecord(p22) ); }); if (this.version === 1) { this.offsetPaletteTypeArray = p22.Offset32; this.offsetPaletteLabelArray = p22.Offset32; this.offsetPaletteEntryLabelArray = p22.Offset32; lazy$1(this, `paletteTypeArray`, () => { p22.currentPosition = this.tableStart + this.offsetPaletteTypeArray; return new PaletteTypeArray(p22, numPalettes); }); lazy$1(this, `paletteLabelArray`, () => { p22.currentPosition = this.tableStart + this.offsetPaletteLabelArray; return new PaletteLabelsArray(p22, numPalettes); }); lazy$1(this, `paletteEntryLabelArray`, () => { p22.currentPosition = this.tableStart + this.offsetPaletteEntryLabelArray; return new PaletteEntryLabelArray(p22, numPalettes); }); } } }; var ColorRecord = class { constructor(p22) { this.blue = p22.uint8; this.green = p22.uint8; this.red = p22.uint8; this.alpha = p22.uint8; } }; var PaletteTypeArray = class { constructor(p22, numPalettes) { this.paletteTypes = [...new Array(numPalettes)].map( (_) => p22.uint32 ); } }; var PaletteLabelsArray = class { constructor(p22, numPalettes) { this.paletteLabels = [...new Array(numPalettes)].map( (_) => p22.uint16 ); } }; var PaletteEntryLabelArray = class { constructor(p22, numPalettes) { this.paletteEntryLabels = [...new Array(numPalettes)].map( (_) => p22.uint16 ); } }; var CPAL$1 = Object.freeze({ __proto__: null, CPAL }); var DSIG = class extends SimpleTable { constructor(dict, dataview) { const { p: p22 } = super(dict, dataview); this.version = p22.uint32; this.numSignatures = p22.uint16; this.flags = p22.uint16; this.signatureRecords = [...new Array(this.numSignatures)].map( (_) => new SignatureRecord(p22) ); } getData(signatureID) { const record = this.signatureRecords[signatureID]; this.parser.currentPosition = this.tableStart + record.offset; return new SignatureBlockFormat1(this.parser); } }; var SignatureRecord = class { constructor(p22) { this.format = p22.uint32; this.length = p22.uint32; this.offset = p22.Offset32; } }; var SignatureBlockFormat1 = class { constructor(p22) { p22.uint16; p22.uint16; this.signatureLength = p22.uint32; this.signature = p22.readBytes(this.signatureLength); } }; var DSIG$1 = Object.freeze({ __proto__: null, DSIG }); var hdmx = class extends SimpleTable { constructor(dict, dataview, tables) { const { p: p22 } = super(dict, dataview); const numGlyphs = tables.hmtx.numGlyphs; this.version = p22.uint16; this.numRecords = p22.int16; this.sizeDeviceRecord = p22.int32; this.records = [...new Array(numRecords)].map( (_) => new DeviceRecord(p22, numGlyphs) ); } }; var DeviceRecord = class { constructor(p22, numGlyphs) { this.pixelSize = p22.uint8; this.maxWidth = p22.uint8; this.widths = p22.readBytes(numGlyphs); } }; var hdmx$1 = Object.freeze({ __proto__: null, hdmx }); var kern = class extends SimpleTable { constructor(dict, dataview) { const { p: p22 } = super(dict, dataview); this.version = p22.uint16; this.nTables = p22.uint16; lazy$1(this, `tables`, () => { let offset = this.tableStart + 4; const tables = []; for (let i2 = 0; i2 < this.nTables; i2++) { p22.currentPosition = offset; let subtable = new KernSubTable(p22); tables.push(subtable); offset += subtable; } return tables; }); } }; var KernSubTable = class { constructor(p22) { this.version = p22.uint16; this.length = p22.uint16; this.coverage = p22.flags(8); this.format = p22.uint8; if (this.format === 0) { this.nPairs = p22.uint16; this.searchRange = p22.uint16; this.entrySelector = p22.uint16; this.rangeShift = p22.uint16; lazy$1( this, `pairs`, () => [...new Array(this.nPairs)].map((_) => new Pair(p22)) ); } if (this.format === 2) { console.warn( `Kern subtable format 2 is not supported: this parser currently only parses universal table data.` ); } } get horizontal() { return this.coverage[0]; } get minimum() { return this.coverage[1]; } get crossstream() { return this.coverage[2]; } get override() { return this.coverage[3]; } }; var Pair = class { constructor(p22) { this.left = p22.uint16; this.right = p22.uint16; this.value = p22.fword; } }; var kern$1 = Object.freeze({ __proto__: null, kern }); var LTSH = class extends SimpleTable { constructor(dict, dataview) { const { p: p22 } = super(dict, dataview); this.version = p22.uint16; this.numGlyphs = p22.uint16; this.yPels = p22.readBytes(this.numGlyphs); } }; var LTSH$1 = Object.freeze({ __proto__: null, LTSH }); var MERG = class extends SimpleTable { constructor(dict, dataview) { const { p: p22 } = super(dict, dataview); this.version = p22.uint16; this.mergeClassCount = p22.uint16; this.mergeDataOffset = p22.Offset16; this.classDefCount = p22.uint16; this.offsetToClassDefOffsets = p22.Offset16; lazy$1( this, `mergeEntryMatrix`, () => [...new Array(this.mergeClassCount)].map( (_) => p22.readBytes(this.mergeClassCount) ) ); console.warn(`Full MERG parsing is currently not supported.`); console.warn( `If you need this table parsed, please file an issue, or better yet, a PR.` ); } }; var MERG$1 = Object.freeze({ __proto__: null, MERG }); var meta = class extends SimpleTable { constructor(dict, dataview) { const { p: p22 } = super(dict, dataview); this.version = p22.uint32; this.flags = p22.uint32; p22.uint32; this.dataMapsCount = p22.uint32; this.dataMaps = [...new Array(this.dataMapsCount)].map( (_) => new DataMap(this.tableStart, p22) ); } }; var DataMap = class { constructor(tableStart, p22) { this.tableStart = tableStart; this.parser = p22; this.tag = p22.tag; this.dataOffset = p22.Offset32; this.dataLength = p22.uint32; } getData() { this.parser.currentField = this.tableStart + this.dataOffset; return this.parser.readBytes(this.dataLength); } }; var meta$1 = Object.freeze({ __proto__: null, meta }); var PCLT = class extends SimpleTable { constructor(dict, dataview) { super(dict, dataview); console.warn( `This font uses a PCLT table, which is currently not supported by this parser.` ); console.warn( `If you need this table parsed, please file an issue, or better yet, a PR.` ); } }; var PCLT$1 = Object.freeze({ __proto__: null, PCLT }); var VDMX = class extends SimpleTable { constructor(dict, dataview) { const { p: p22 } = super(dict, dataview); this.version = p22.uint16; this.numRecs = p22.uint16; this.numRatios = p22.uint16; this.ratRanges = [...new Array(this.numRatios)].map( (_) => new RatioRange(p22) ); this.offsets = [...new Array(this.numRatios)].map( (_) => p22.Offset16 ); this.VDMXGroups = [...new Array(this.numRecs)].map( (_) => new VDMXGroup(p22) ); } }; var RatioRange = class { constructor(p22) { this.bCharSet = p22.uint8; this.xRatio = p22.uint8; this.yStartRatio = p22.uint8; this.yEndRatio = p22.uint8; } }; var VDMXGroup = class { constructor(p22) { this.recs = p22.uint16; this.startsz = p22.uint8; this.endsz = p22.uint8; this.records = [...new Array(this.recs)].map( (_) => new vTable(p22) ); } }; var vTable = class { constructor(p22) { this.yPelHeight = p22.uint16; this.yMax = p22.int16; this.yMin = p22.int16; } }; var VDMX$1 = Object.freeze({ __proto__: null, VDMX }); var vhea = class extends SimpleTable { constructor(dict, dataview) { const { p: p22 } = super(dict, dataview); this.version = p22.fixed; this.ascent = this.vertTypoAscender = p22.int16; this.descent = this.vertTypoDescender = p22.int16; this.lineGap = this.vertTypoLineGap = p22.int16; this.advanceHeightMax = p22.int16; this.minTopSideBearing = p22.int16; this.minBottomSideBearing = p22.int16; this.yMaxExtent = p22.int16; this.caretSlopeRise = p22.int16; this.caretSlopeRun = p22.int16; this.caretOffset = p22.int16; this.reserved = p22.int16; this.reserved = p22.int16; this.reserved = p22.int16; this.reserved = p22.int16; this.metricDataFormat = p22.int16; this.numOfLongVerMetrics = p22.uint16; p22.verifyLength(); } }; var vhea$1 = Object.freeze({ __proto__: null, vhea }); var vmtx = class extends SimpleTable { constructor(dict, dataview, tables) { super(dict, dataview); const numOfLongVerMetrics = tables.vhea.numOfLongVerMetrics; const numGlyphs = tables.maxp.numGlyphs; const metricsStart = p.currentPosition; lazy(this, `vMetrics`, () => { p.currentPosition = metricsStart; return [...new Array(numOfLongVerMetrics)].map( (_) => new LongVertMetric(p.uint16, p.int16) ); }); if (numOfLongVerMetrics < numGlyphs) { const tsbStart = metricsStart + numOfLongVerMetrics * 4; lazy(this, `topSideBearings`, () => { p.currentPosition = tsbStart; return [...new Array(numGlyphs - numOfLongVerMetrics)].map( (_) => p.int16 ); }); } } }; var LongVertMetric = class { constructor(h2, b2) { this.advanceHeight = h2; this.topSideBearing = b2; } }; var vmtx$1 = Object.freeze({ __proto__: null, vmtx }); // packages/global-styles-ui/build-module/font-library/utils/make-families-from-faces.mjs var import_components38 = __toESM(require_components(), 1); var { kebabCase: kebabCase3 } = unlock2(import_components38.privateApis); // packages/global-styles-ui/build-module/font-library/upload-fonts.mjs var import_jsx_runtime109 = __toESM(require_jsx_runtime(), 1); // packages/global-styles-ui/build-module/font-library/modal.mjs var import_jsx_runtime110 = __toESM(require_jsx_runtime(), 1); var { Tabs } = unlock2(import_components40.privateApis); var DEFAULT_TAB = { id: "installed-fonts", title: (0, import_i18n28._x)("Library", "Font library") }; var UPLOAD_TAB = { id: "upload-fonts", title: (0, import_i18n28._x)("Upload", "noun") }; // packages/global-styles-ui/build-module/font-family-item.mjs var import_i18n29 = __toESM(require_i18n(), 1); var import_components41 = __toESM(require_components(), 1); var import_element34 = __toESM(require_element(), 1); var import_jsx_runtime111 = __toESM(require_jsx_runtime(), 1); // packages/global-styles-ui/build-module/font-families.mjs var import_jsx_runtime112 = __toESM(require_jsx_runtime(), 1); // packages/global-styles-ui/build-module/font-sizes/font-sizes-count.mjs var import_i18n31 = __toESM(require_i18n(), 1); var import_components43 = __toESM(require_components(), 1); var import_jsx_runtime113 = __toESM(require_jsx_runtime(), 1); // packages/global-styles-ui/build-module/screen-typography.mjs var import_jsx_runtime114 = __toESM(require_jsx_runtime(), 1); // packages/global-styles-ui/build-module/screen-typography-element.mjs var import_i18n33 = __toESM(require_i18n(), 1); var import_components45 = __toESM(require_components(), 1); var import_element37 = __toESM(require_element(), 1); // packages/global-styles-ui/build-module/typography-panel.mjs var import_block_editor8 = __toESM(require_block_editor(), 1); var import_jsx_runtime115 = __toESM(require_jsx_runtime(), 1); var { useSettingsForBlockElement: useSettingsForBlockElement4, TypographyPanel: StylesTypographyPanel2 } = unlock2(import_block_editor8.privateApis); // packages/global-styles-ui/build-module/typography-preview.mjs var import_jsx_runtime116 = __toESM(require_jsx_runtime(), 1); // packages/global-styles-ui/build-module/screen-typography-element.mjs var import_jsx_runtime117 = __toESM(require_jsx_runtime(), 1); var elements = { text: { description: (0, import_i18n33.__)("Manage the fonts used on the site."), title: (0, import_i18n33.__)("Text") }, link: { description: (0, import_i18n33.__)("Manage the fonts and typography used on the links."), title: (0, import_i18n33.__)("Links") }, heading: { description: (0, import_i18n33.__)("Manage the fonts and typography used on headings."), title: (0, import_i18n33.__)("Headings") }, caption: { description: (0, import_i18n33.__)("Manage the fonts and typography used on captions."), title: (0, import_i18n33.__)("Captions") }, button: { description: (0, import_i18n33.__)("Manage the fonts and typography used on buttons."), title: (0, import_i18n33.__)("Buttons") } }; // packages/global-styles-ui/build-module/screen-colors.mjs var import_i18n35 = __toESM(require_i18n(), 1); var import_components48 = __toESM(require_components(), 1); var import_block_editor9 = __toESM(require_block_editor(), 1); // packages/global-styles-ui/build-module/palette.mjs var import_components47 = __toESM(require_components(), 1); var import_i18n34 = __toESM(require_i18n(), 1); var import_element38 = __toESM(require_element(), 1); // packages/global-styles-ui/build-module/color-indicator-wrapper.mjs var import_components46 = __toESM(require_components(), 1); var import_jsx_runtime118 = __toESM(require_jsx_runtime(), 1); // packages/global-styles-ui/build-module/palette.mjs var import_jsx_runtime119 = __toESM(require_jsx_runtime(), 1); // packages/global-styles-ui/build-module/screen-colors.mjs var import_jsx_runtime120 = __toESM(require_jsx_runtime(), 1); var { useSettingsForBlockElement: useSettingsForBlockElement5, ColorPanel: StylesColorPanel2 } = unlock2( import_block_editor9.privateApis ); // packages/global-styles-ui/build-module/screen-color-palette.mjs var import_i18n38 = __toESM(require_i18n(), 1); var import_components53 = __toESM(require_components(), 1); // packages/global-styles-ui/build-module/color-palette-panel.mjs var import_compose6 = __toESM(require_compose(), 1); var import_components51 = __toESM(require_components(), 1); var import_i18n36 = __toESM(require_i18n(), 1); // packages/global-styles-ui/build-module/variations/variations-color.mjs var import_components50 = __toESM(require_components(), 1); // packages/global-styles-ui/build-module/preview-colors.mjs var import_components49 = __toESM(require_components(), 1); // packages/global-styles-ui/build-module/preset-colors.mjs var import_jsx_runtime121 = __toESM(require_jsx_runtime(), 1); function PresetColors() { const { paletteColors } = useStylesPreviewColors(); return paletteColors.slice(0, 4).map(({ slug, color }, index) => /* @__PURE__ */ (0, import_jsx_runtime121.jsx)( "div", { style: { flexGrow: 1, height: "100%", background: color } }, `${slug}-${index}` )); } // packages/global-styles-ui/build-module/preview-colors.mjs var import_jsx_runtime122 = __toESM(require_jsx_runtime(), 1); var firstFrameVariants2 = { start: { scale: 1, opacity: 1 }, hover: { scale: 0, opacity: 0 } }; var StylesPreviewColors = ({ label, isFocused, withHoverView }) => { return /* @__PURE__ */ (0, import_jsx_runtime122.jsx)( preview_wrapper_default, { label, isFocused, withHoverView, children: ({ key }) => /* @__PURE__ */ (0, import_jsx_runtime122.jsx)( import_components49.__unstableMotion.div, { variants: firstFrameVariants2, style: { height: "100%", overflow: "hidden" }, children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)( import_components49.__experimentalHStack, { spacing: 0, justify: "center", style: { height: "100%", overflow: "hidden" }, children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(PresetColors, {}) } ) }, key ) } ); }; var preview_colors_default = StylesPreviewColors; // packages/global-styles-ui/build-module/variations/variations-color.mjs var import_jsx_runtime123 = __toESM(require_jsx_runtime(), 1); var propertiesToFilter2 = ["color"]; function ColorVariations({ title, gap = 2 }) { const colorVariations = useCurrentMergeThemeStyleVariationsWithUserConfig(propertiesToFilter2); if (colorVariations?.length <= 1) { return null; } return /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(import_components50.__experimentalVStack, { spacing: 3, children: [ title && /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(Subtitle, { level: 3, children: title }), /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(import_components50.__experimentalGrid, { gap, children: colorVariations.map((variation, index) => /* @__PURE__ */ (0, import_jsx_runtime123.jsx)( Variation, { variation, isPill: true, properties: propertiesToFilter2, showTooltip: true, children: () => /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(preview_colors_default, {}) }, index )) }) ] }); } // packages/global-styles-ui/build-module/color-palette-panel.mjs var import_jsx_runtime124 = __toESM(require_jsx_runtime(), 1); // packages/global-styles-ui/build-module/gradients-palette-panel.mjs var import_compose7 = __toESM(require_compose(), 1); var import_components52 = __toESM(require_components(), 1); var import_i18n37 = __toESM(require_i18n(), 1); var import_jsx_runtime125 = __toESM(require_jsx_runtime(), 1); // packages/global-styles-ui/build-module/screen-color-palette.mjs var import_jsx_runtime126 = __toESM(require_jsx_runtime(), 1); var { Tabs: Tabs2 } = unlock2(import_components53.privateApis); // packages/global-styles-ui/build-module/screen-background.mjs var import_i18n39 = __toESM(require_i18n(), 1); var import_block_editor11 = __toESM(require_block_editor(), 1); var import_components54 = __toESM(require_components(), 1); // packages/global-styles-ui/build-module/background-panel.mjs var import_block_editor10 = __toESM(require_block_editor(), 1); var import_jsx_runtime127 = __toESM(require_jsx_runtime(), 1); var { BackgroundPanel: StylesBackgroundPanel2 } = unlock2( import_block_editor10.privateApis ); // packages/global-styles-ui/build-module/screen-background.mjs var import_jsx_runtime128 = __toESM(require_jsx_runtime(), 1); var { useHasBackgroundPanel: useHasBackgroundPanel3 } = unlock2(import_block_editor11.privateApis); // packages/global-styles-ui/build-module/shadows-panel.mjs var import_components56 = __toESM(require_components(), 1); var import_i18n41 = __toESM(require_i18n(), 1); var import_element39 = __toESM(require_element(), 1); // packages/global-styles-ui/build-module/confirm-reset-shadow-dialog.mjs var import_components55 = __toESM(require_components(), 1); var import_i18n40 = __toESM(require_i18n(), 1); var import_jsx_runtime129 = __toESM(require_jsx_runtime(), 1); // packages/global-styles-ui/build-module/shadows-panel.mjs var import_jsx_runtime130 = __toESM(require_jsx_runtime(), 1); var { Menu } = unlock2(import_components56.privateApis); // packages/global-styles-ui/build-module/shadows-edit-panel.mjs var import_components57 = __toESM(require_components(), 1); var import_i18n42 = __toESM(require_i18n(), 1); var import_element40 = __toESM(require_element(), 1); var import_jsx_runtime131 = __toESM(require_jsx_runtime(), 1); var { Menu: Menu2 } = unlock2(import_components57.privateApis); var customShadowMenuItems = [ { label: (0, import_i18n42.__)("Rename"), action: "rename" }, { label: (0, import_i18n42.__)("Delete"), action: "delete" } ]; var presetShadowMenuItems = [ { label: (0, import_i18n42.__)("Reset"), action: "reset" } ]; // packages/global-styles-ui/build-module/screen-shadows.mjs var import_jsx_runtime132 = __toESM(require_jsx_runtime(), 1); // packages/global-styles-ui/build-module/screen-layout.mjs var import_i18n43 = __toESM(require_i18n(), 1); var import_block_editor13 = __toESM(require_block_editor(), 1); // packages/global-styles-ui/build-module/dimensions-panel.mjs var import_block_editor12 = __toESM(require_block_editor(), 1); var import_element41 = __toESM(require_element(), 1); var import_jsx_runtime133 = __toESM(require_jsx_runtime(), 1); var { useSettingsForBlockElement: useSettingsForBlockElement6, DimensionsPanel: StylesDimensionsPanel2 } = unlock2(import_block_editor12.privateApis); // packages/global-styles-ui/build-module/screen-layout.mjs var import_jsx_runtime134 = __toESM(require_jsx_runtime(), 1); var { useHasDimensionsPanel: useHasDimensionsPanel4, useSettingsForBlockElement: useSettingsForBlockElement7 } = unlock2( import_block_editor13.privateApis ); // packages/global-styles-ui/build-module/screen-style-variations.mjs var import_components60 = __toESM(require_components(), 1); var import_i18n46 = __toESM(require_i18n(), 1); // packages/global-styles-ui/build-module/style-variations-content.mjs var import_i18n45 = __toESM(require_i18n(), 1); var import_components59 = __toESM(require_components(), 1); // packages/global-styles-ui/build-module/style-variations-container.mjs var import_core_data22 = __toESM(require_core_data(), 1); var import_data26 = __toESM(require_data(), 1); var import_element42 = __toESM(require_element(), 1); var import_components58 = __toESM(require_components(), 1); var import_i18n44 = __toESM(require_i18n(), 1); var import_jsx_runtime135 = __toESM(require_jsx_runtime(), 1); function StyleVariationsContainer({ gap = 2 }) { const { user } = (0, import_element42.useContext)(GlobalStylesContext); const userStyles = user?.styles; const variations = (0, import_data26.useSelect)((select3) => { const result = select3( import_core_data22.store ).__experimentalGetCurrentThemeGlobalStylesVariations(); return Array.isArray(result) ? result : void 0; }, []); const fullStyleVariations = variations?.filter( (variation) => { return !isVariationWithProperties(variation, ["color"]) && !isVariationWithProperties(variation, [ "typography", "spacing" ]); } ); const themeVariations = (0, import_element42.useMemo)(() => { const withEmptyVariation = [ { title: (0, import_i18n44.__)("Default"), settings: {}, styles: {} }, ...fullStyleVariations ?? [] ]; return [ ...withEmptyVariation.map((variation) => { const blockStyles = variation?.styles?.blocks ? { ...variation.styles.blocks } : {}; if (userStyles?.blocks) { Object.keys(userStyles.blocks).forEach((blockName) => { if (userStyles.blocks?.[blockName]?.css) { const variationBlockStyles = blockStyles[blockName] || {}; const customCSS = { css: `${blockStyles[blockName]?.css || ""} ${userStyles.blocks?.[blockName]?.css?.trim() || ""}` }; blockStyles[blockName] = { ...variationBlockStyles, ...customCSS }; } }); } const css = userStyles?.css || variation.styles?.css ? { css: `${variation.styles?.css || ""} ${userStyles?.css || ""}` } : {}; const blocks = Object.keys(blockStyles).length > 0 ? { blocks: blockStyles } : {}; const styles = { ...variation.styles, ...css, ...blocks }; return { ...variation, settings: variation.settings ?? {}, styles }; }) ]; }, [fullStyleVariations, userStyles?.blocks, userStyles?.css]); if (!fullStyleVariations || fullStyleVariations.length < 1) { return null; } return /* @__PURE__ */ (0, import_jsx_runtime135.jsx)( import_components58.__experimentalGrid, { columns: 2, className: "global-styles-ui-style-variations-container", gap, children: themeVariations.map( (variation, index) => /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(Variation, { variation, children: (isFocused) => /* @__PURE__ */ (0, import_jsx_runtime135.jsx)( preview_styles_default, { label: variation?.title, withHoverView: true, isFocused, variation } ) }, index) ) } ); } var style_variations_container_default = StyleVariationsContainer; // packages/global-styles-ui/build-module/style-variations-content.mjs var import_jsx_runtime136 = __toESM(require_jsx_runtime(), 1); // packages/global-styles-ui/build-module/screen-style-variations.mjs var import_jsx_runtime137 = __toESM(require_jsx_runtime(), 1); // packages/global-styles-ui/build-module/screen-css.mjs var import_i18n47 = __toESM(require_i18n(), 1); var import_components61 = __toESM(require_components(), 1); var import_block_editor14 = __toESM(require_block_editor(), 1); var import_jsx_runtime138 = __toESM(require_jsx_runtime(), 1); var { AdvancedPanel: StylesAdvancedPanel2 } = unlock2(import_block_editor14.privateApis); // packages/global-styles-ui/build-module/screen-revisions/index.mjs var import_i18n50 = __toESM(require_i18n(), 1); var import_components64 = __toESM(require_components(), 1); var import_element44 = __toESM(require_element(), 1); // packages/global-styles-ui/build-module/screen-revisions/use-global-styles-revisions.mjs var import_data27 = __toESM(require_data(), 1); var import_core_data23 = __toESM(require_core_data(), 1); var import_element43 = __toESM(require_element(), 1); var SITE_EDITOR_AUTHORS_QUERY = { per_page: -1, _fields: "id,name,avatar_urls", context: "view", capabilities: ["edit_theme_options"] }; var DEFAULT_QUERY = { per_page: 100, page: 1 }; var EMPTY_ARRAY4 = []; function useGlobalStylesRevisions({ query } = {}) { const { user: userConfig } = (0, import_element43.useContext)(GlobalStylesContext); const _query = (0, import_element43.useMemo)( () => ({ ...DEFAULT_QUERY, ...query }), [query] ); const { authors, currentUser, isDirty, revisions, isLoadingGlobalStylesRevisions, revisionsCount } = (0, import_data27.useSelect)( (select3) => { const { __experimentalGetDirtyEntityRecords, getCurrentUser, getUsers, getRevisions, __experimentalGetCurrentGlobalStylesId, getEntityRecord, // @ts-expect-error isResolving } = select3(import_core_data23.store); const dirtyEntityRecords = __experimentalGetDirtyEntityRecords() || []; const _currentUser = getCurrentUser(); const _isDirty = dirtyEntityRecords.length > 0; const globalStylesId = __experimentalGetCurrentGlobalStylesId(); const globalStyles = globalStylesId ? getEntityRecord( "root", "globalStyles", globalStylesId ) : void 0; const _revisionsCount = ( // @ts-expect-error - _links is not typed in GlobalStylesRevision globalStyles?._links?.["version-history"]?.[0]?.count ?? 0 ); const globalStylesRevisions = globalStylesId ? getRevisions( "root", "globalStyles", globalStylesId, _query ) || EMPTY_ARRAY4 : EMPTY_ARRAY4; const _authors = getUsers(SITE_EDITOR_AUTHORS_QUERY) || EMPTY_ARRAY4; const _isResolving = globalStylesId ? isResolving("getRevisions", [ "root", "globalStyles", globalStylesId, _query ]) : false; return { authors: _authors, currentUser: _currentUser, isDirty: _isDirty, revisions: globalStylesRevisions, isLoadingGlobalStylesRevisions: _isResolving, revisionsCount: _revisionsCount }; }, [_query] ); return (0, import_element43.useMemo)(() => { if (!authors.length || isLoadingGlobalStylesRevisions) { return { revisions: EMPTY_ARRAY4, hasUnsavedChanges: isDirty, isLoading: true, revisionsCount }; } const _modifiedRevisions = revisions.map((revision) => { return { ...revision, author: authors.find( (author) => author.id === revision.author ) }; }); const fetchedRevisionsCount = revisions.length; if (fetchedRevisionsCount) { if (_modifiedRevisions[0].id !== "unsaved" && _query.page === 1) { _modifiedRevisions[0].isLatest = true; } if (isDirty && userConfig && Object.keys(userConfig).length > 0 && currentUser && _query.page === 1) { const unsavedRevision = { id: "unsaved", styles: userConfig?.styles, settings: userConfig?.settings, _links: userConfig?._links, author: { name: currentUser?.name || "", // @ts-expect-error - avatar_urls is not typed in User avatar_urls: currentUser?.avatar_urls || {} }, modified: /* @__PURE__ */ new Date() }; _modifiedRevisions.unshift(unsavedRevision); } if (_query.per_page && _query.page === Math.ceil(revisionsCount / _query.per_page)) { _modifiedRevisions.push({ id: "parent", styles: {}, settings: {} }); } } return { revisions: _modifiedRevisions, hasUnsavedChanges: isDirty, isLoading: false, revisionsCount }; }, [ isDirty, revisions, currentUser, authors, userConfig, isLoadingGlobalStylesRevisions, revisionsCount, _query.page, _query.per_page ]); } // packages/global-styles-ui/build-module/screen-revisions/revisions-buttons.mjs var import_i18n48 = __toESM(require_i18n(), 1); var import_components62 = __toESM(require_components(), 1); var import_date = __toESM(require_date(), 1); var import_core_data24 = __toESM(require_core_data(), 1); var import_data28 = __toESM(require_data(), 1); var import_keycodes4 = __toESM(require_keycodes(), 1); var import_jsx_runtime139 = __toESM(require_jsx_runtime(), 1); var DAY_IN_MILLISECONDS = 60 * 60 * 1e3 * 24; // packages/global-styles-ui/build-module/pagination/index.mjs var import_components63 = __toESM(require_components(), 1); var import_i18n49 = __toESM(require_i18n(), 1); var import_jsx_runtime140 = __toESM(require_jsx_runtime(), 1); // packages/global-styles-ui/build-module/screen-revisions/index.mjs var import_jsx_runtime141 = __toESM(require_jsx_runtime(), 1); // packages/global-styles-ui/build-module/font-sizes/font-sizes.mjs var import_i18n52 = __toESM(require_i18n(), 1); var import_components66 = __toESM(require_components(), 1); var import_element45 = __toESM(require_element(), 1); // packages/global-styles-ui/build-module/font-sizes/confirm-reset-font-sizes-dialog.mjs var import_components65 = __toESM(require_components(), 1); var import_i18n51 = __toESM(require_i18n(), 1); var import_jsx_runtime142 = __toESM(require_jsx_runtime(), 1); // packages/global-styles-ui/build-module/font-sizes/font-sizes.mjs var import_jsx_runtime143 = __toESM(require_jsx_runtime(), 1); var { Menu: Menu3 } = unlock2(import_components66.privateApis); // packages/global-styles-ui/build-module/font-sizes/font-size.mjs var import_i18n56 = __toESM(require_i18n(), 1); var import_components70 = __toESM(require_components(), 1); var import_element47 = __toESM(require_element(), 1); // packages/global-styles-ui/build-module/font-sizes/font-size-preview.mjs var import_block_editor15 = __toESM(require_block_editor(), 1); var import_i18n53 = __toESM(require_i18n(), 1); var import_jsx_runtime144 = __toESM(require_jsx_runtime(), 1); // packages/global-styles-ui/build-module/font-sizes/confirm-delete-font-size-dialog.mjs var import_components67 = __toESM(require_components(), 1); var import_i18n54 = __toESM(require_i18n(), 1); var import_jsx_runtime145 = __toESM(require_jsx_runtime(), 1); // packages/global-styles-ui/build-module/font-sizes/rename-font-size-dialog.mjs var import_components68 = __toESM(require_components(), 1); var import_i18n55 = __toESM(require_i18n(), 1); var import_element46 = __toESM(require_element(), 1); var import_jsx_runtime146 = __toESM(require_jsx_runtime(), 1); // packages/global-styles-ui/build-module/size-control/index.mjs var import_components69 = __toESM(require_components(), 1); var import_jsx_runtime147 = __toESM(require_jsx_runtime(), 1); // packages/global-styles-ui/build-module/font-sizes/font-size.mjs var import_jsx_runtime148 = __toESM(require_jsx_runtime(), 1); var { Menu: Menu4 } = unlock2(import_components70.privateApis); // packages/global-styles-ui/build-module/global-styles-ui.mjs var import_jsx_runtime149 = __toESM(require_jsx_runtime(), 1); // packages/global-styles-ui/build-module/with-global-styles-provider.mjs var import_jsx_runtime150 = __toESM(require_jsx_runtime(), 1); function withGlobalStylesProvider(Component) { return function WrappedComponent({ value, baseValue, onChange, ...props }) { return /* @__PURE__ */ (0, import_jsx_runtime150.jsx)( GlobalStylesProvider, { value, baseValue, onChange, children: /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(Component, { ...props }) } ); }; } // packages/global-styles-ui/build-module/style-variations.mjs var StyleVariations = withGlobalStylesProvider(style_variations_container_default); // packages/global-styles-ui/build-module/color-variations.mjs var ColorVariations2 = withGlobalStylesProvider(ColorVariations); // packages/global-styles-ui/build-module/typography-variations.mjs var TypographyVariations2 = withGlobalStylesProvider(TypographyVariations); // packages/global-styles-ui/build-module/font-library/font-library.mjs var import_jsx_runtime151 = __toESM(require_jsx_runtime(), 1); // packages/edit-site/build-module/components/sidebar-navigation-screen-details-footer/index.mjs var import_i18n57 = __toESM(require_i18n(), 1); var import_url6 = __toESM(require_url(), 1); var import_components72 = __toESM(require_components(), 1); var import_jsx_runtime152 = __toESM(require_jsx_runtime(), 1); function SidebarNavigationScreenDetailsFooter({ record, revisionsCount, ...otherProps }) { const hrefProps = {}; const lastRevisionId = record?._links?.["predecessor-version"]?.[0]?.id ?? null; revisionsCount = revisionsCount || record?._links?.["version-history"]?.[0]?.count || 0; if (lastRevisionId && revisionsCount > 1) { hrefProps.href = (0, import_url6.addQueryArgs)("revision.php", { revision: record?._links["predecessor-version"][0].id }); hrefProps.as = "a"; } return /* @__PURE__ */ (0, import_jsx_runtime152.jsx)( import_components72.__experimentalItemGroup, { size: "large", className: "edit-site-sidebar-navigation-screen-details-footer", children: /* @__PURE__ */ (0, import_jsx_runtime152.jsx)( SidebarNavigationItem, { icon: backup_default, ...hrefProps, ...otherProps, children: (0, import_i18n57.sprintf)( /* translators: %d: Number of Styles revisions. */ (0, import_i18n57._n)("%d Revision", "%d Revisions", revisionsCount), revisionsCount ) } ) } ); } // packages/edit-site/build-module/components/sidebar-navigation-screen-global-styles/index.mjs var import_jsx_runtime153 = __toESM(require_jsx_runtime(), 1); var { useLocation: useLocation10, useHistory: useHistory7 } = unlock(import_router11.privateApis); function SidebarNavigationItemGlobalStyles(props) { const { name: name2 } = useLocation10(); return /* @__PURE__ */ (0, import_jsx_runtime153.jsx)( SidebarNavigationItem, { ...props, "aria-current": name2 === "styles" } ); } function SidebarNavigationScreenGlobalStyles() { const history = useHistory7(); const { path } = useLocation10(); const { revisions, isLoading: isLoadingRevisions, revisionsCount } = useGlobalStylesRevisions(); const { openGeneralSidebar: openGeneralSidebar2 } = (0, import_data30.useDispatch)(store); const { setStylesPath } = unlock((0, import_data30.useDispatch)(import_editor8.store)); const { set: setPreference } = (0, import_data30.useDispatch)(import_preferences5.store); const openGlobalStyles = (0, import_element49.useCallback)(async () => { history.navigate((0, import_url7.addQueryArgs)(path, { canvas: "edit" }), { transition: "canvas-mode-edit-transition" }); return Promise.all([ setPreference("core", "distractionFree", false), openGeneralSidebar2("edit-site/global-styles") ]); }, [path, history, openGeneralSidebar2, setPreference]); const openRevisions = (0, import_element49.useCallback)(async () => { await openGlobalStyles(); setStylesPath("/revisions"); }, [openGlobalStyles, setStylesPath]); const shouldShowGlobalStylesFooter = !!revisionsCount && !isLoadingRevisions; return /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(import_jsx_runtime153.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)( SidebarNavigationScreen, { title: (0, import_i18n58.__)("Design"), isRoot: true, description: (0, import_i18n58.__)( "Customize the appearance of your website using the block editor." ), content: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(MainSidebarNavigationContent, { activeItem: "styles-navigation-item" }), footer: shouldShowGlobalStylesFooter && /* @__PURE__ */ (0, import_jsx_runtime153.jsx)( SidebarNavigationScreenDetailsFooter, { record: revisions?.[0], revisionsCount, onClick: openRevisions } ) } ) }); } // packages/edit-site/build-module/components/sidebar-navigation-screen-main/index.mjs var import_jsx_runtime154 = __toESM(require_jsx_runtime(), 1); function MainSidebarNavigationContent({ isBlockBasedTheme = true }) { return /* @__PURE__ */ (0, import_jsx_runtime154.jsxs)(import_components73.__experimentalItemGroup, { className: "edit-site-sidebar-navigation-screen-main", children: [ isBlockBasedTheme && /* @__PURE__ */ (0, import_jsx_runtime154.jsxs)(import_jsx_runtime154.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime154.jsx)( SidebarNavigationItemGlobalStyles, { to: "/styles", uid: "global-styles-navigation-item", icon: styles_default, children: (0, import_i18n59.__)("Styles") } ), /* @__PURE__ */ (0, import_jsx_runtime154.jsx)( SidebarNavigationItem, { uid: "navigation-navigation-item", to: "/navigation", withChevron: true, icon: navigation_default, children: (0, import_i18n59.__)("Navigation") } ), /* @__PURE__ */ (0, import_jsx_runtime154.jsx)( SidebarNavigationItem, { uid: "page-navigation-item", to: "/page", withChevron: true, icon: page_default, children: (0, import_i18n59.__)("Pages") } ), /* @__PURE__ */ (0, import_jsx_runtime154.jsx)( SidebarNavigationItem, { uid: "template-navigation-item", to: "/template", withChevron: true, icon: layout_default, children: (0, import_i18n59.__)("Templates") } ) ] }), !isBlockBasedTheme && /* @__PURE__ */ (0, import_jsx_runtime154.jsx)( SidebarNavigationItem, { uid: "stylebook-navigation-item", to: "/stylebook", withChevron: true, icon: styles_default, children: (0, import_i18n59.__)("Styles") } ), /* @__PURE__ */ (0, import_jsx_runtime154.jsx)( SidebarNavigationItem, { uid: "patterns-navigation-item", to: "/pattern", withChevron: true, icon: symbol_default, children: (0, import_i18n59.__)("Patterns") } ) ] }); } function SidebarNavigationScreenMain({ customDescription }) { const isBlockBasedTheme = (0, import_data31.useSelect)( (select3) => select3(import_core_data25.store).getCurrentTheme()?.is_block_theme, [] ); let description; if (customDescription) { description = customDescription; } else if (isBlockBasedTheme) { description = (0, import_i18n59.__)( "Customize the appearance of your website using the block editor." ); } else { description = (0, import_i18n59.__)( "Explore block styles and patterns to refine your site." ); } return /* @__PURE__ */ (0, import_jsx_runtime154.jsx)( SidebarNavigationScreen, { isRoot: true, title: (0, import_i18n59.__)("Design"), description, content: /* @__PURE__ */ (0, import_jsx_runtime154.jsx)( MainSidebarNavigationContent, { isBlockBasedTheme } ) } ); } // packages/edit-site/build-module/components/sidebar-navigation-screen-unsupported/index.mjs var import_i18n60 = __toESM(require_i18n(), 1); var import_components74 = __toESM(require_components(), 1); var import_jsx_runtime155 = __toESM(require_jsx_runtime(), 1); function SidebarNavigationScreenUnsupported() { return /* @__PURE__ */ (0, import_jsx_runtime155.jsx)(import_components74.__experimentalSpacer, { padding: 3, children: /* @__PURE__ */ (0, import_jsx_runtime155.jsx)(import_components74.Notice, { status: "warning", isDismissible: false, children: (0, import_i18n60.__)( "The theme you are currently using does not support this screen." ) }) }); } // packages/edit-site/build-module/components/editor/index.mjs var import_data48 = __toESM(require_data(), 1); var import_components82 = __toESM(require_components(), 1); var import_compose10 = __toESM(require_compose(), 1); var import_editor20 = __toESM(require_editor(), 1); var import_i18n70 = __toESM(require_i18n(), 1); var import_core_data34 = __toESM(require_core_data(), 1); var import_block_library = __toESM(require_block_library(), 1); var import_element58 = __toESM(require_element(), 1); var import_notices3 = __toESM(require_notices(), 1); var import_router18 = __toESM(require_router(), 1); var import_html_entities4 = __toESM(require_html_entities(), 1); var import_block_editor18 = __toESM(require_block_editor(), 1); var import_url11 = __toESM(require_url(), 1); // packages/edit-site/build-module/components/welcome-guide/editor.mjs var import_data32 = __toESM(require_data(), 1); var import_components75 = __toESM(require_components(), 1); var import_i18n61 = __toESM(require_i18n(), 1); var import_element50 = __toESM(require_element(), 1); var import_preferences6 = __toESM(require_preferences(), 1); var import_core_data26 = __toESM(require_core_data(), 1); // packages/edit-site/build-module/components/welcome-guide/image.mjs var import_jsx_runtime156 = __toESM(require_jsx_runtime(), 1); function WelcomeGuideImage({ nonAnimatedSrc, animatedSrc }) { return /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("picture", { className: "edit-site-welcome-guide__image", children: [ /* @__PURE__ */ (0, import_jsx_runtime156.jsx)( "source", { srcSet: nonAnimatedSrc, media: "(prefers-reduced-motion: reduce)" } ), /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("img", { src: animatedSrc, width: "312", height: "240", alt: "" }) ] }); } // packages/edit-site/build-module/components/welcome-guide/editor.mjs var import_jsx_runtime157 = __toESM(require_jsx_runtime(), 1); function WelcomeGuideEditor() { const { toggle } = (0, import_data32.useDispatch)(import_preferences6.store); const { isActive, isBlockBasedTheme } = (0, import_data32.useSelect)((select3) => { return { isActive: !!select3(import_preferences6.store).get( "core/edit-site", "welcomeGuide" ), isBlockBasedTheme: select3(import_core_data26.store).getCurrentTheme()?.is_block_theme }; }, []); if (!isActive || !isBlockBasedTheme) { return null; } return /* @__PURE__ */ (0, import_jsx_runtime157.jsx)( import_components75.Guide, { className: "edit-site-welcome-guide guide-editor", contentLabel: (0, import_i18n61.__)("Welcome to the site editor"), finishButtonText: (0, import_i18n61.__)("Get started"), onFinish: () => toggle("core/edit-site", "welcomeGuide"), pages: [ { image: /* @__PURE__ */ (0, import_jsx_runtime157.jsx)( WelcomeGuideImage, { nonAnimatedSrc: "https://s.w.org/images/block-editor/edit-your-site.svg?1", animatedSrc: "https://s.w.org/images/block-editor/edit-your-site.gif?1" } ), content: /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)(import_jsx_runtime157.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime157.jsx)("h1", { className: "edit-site-welcome-guide__heading", children: (0, import_i18n61.__)("Edit your site") }), /* @__PURE__ */ (0, import_jsx_runtime157.jsx)("p", { className: "edit-site-welcome-guide__text", children: (0, import_i18n61.__)( "Design everything on your site \u2014 from the header right down to the footer \u2014 using blocks." ) }), /* @__PURE__ */ (0, import_jsx_runtime157.jsx)("p", { className: "edit-site-welcome-guide__text", children: (0, import_element50.createInterpolateElement)( (0, import_i18n61.__)( "Click <StylesIconImage /> to start designing your blocks, and choose your typography, layout, and colors." ), { StylesIconImage: /* @__PURE__ */ (0, import_jsx_runtime157.jsx)( "img", { alt: (0, import_i18n61.__)("styles"), src: "data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 4c-4.4 0-8 3.6-8 8v.1c0 4.1 3.2 7.5 7.2 7.9h.8c4.4 0 8-3.6 8-8s-3.6-8-8-8zm0 15V5c3.9 0 7 3.1 7 7s-3.1 7-7 7z' fill='%231E1E1E'/%3E%3C/svg%3E%0A" } ) } ) }) ] }) } ] } ); } // packages/edit-site/build-module/components/welcome-guide/page.mjs var import_data33 = __toESM(require_data(), 1); var import_components76 = __toESM(require_components(), 1); var import_i18n62 = __toESM(require_i18n(), 1); var import_preferences7 = __toESM(require_preferences(), 1); var import_jsx_runtime158 = __toESM(require_jsx_runtime(), 1); function WelcomeGuidePage() { const { toggle } = (0, import_data33.useDispatch)(import_preferences7.store); const isVisible2 = (0, import_data33.useSelect)((select3) => { const isPageActive = !!select3(import_preferences7.store).get( "core/edit-site", "welcomeGuidePage" ); const isEditorActive = !!select3(import_preferences7.store).get( "core/edit-site", "welcomeGuide" ); return isPageActive && !isEditorActive; }, []); if (!isVisible2) { return null; } const heading = (0, import_i18n62.__)("Editing a page"); return /* @__PURE__ */ (0, import_jsx_runtime158.jsx)( import_components76.Guide, { className: "edit-site-welcome-guide guide-page", contentLabel: heading, finishButtonText: (0, import_i18n62.__)("Continue"), onFinish: () => toggle("core/edit-site", "welcomeGuidePage"), pages: [ { image: /* @__PURE__ */ (0, import_jsx_runtime158.jsx)( "video", { className: "edit-site-welcome-guide__video", autoPlay: true, loop: true, muted: true, width: "312", height: "240", children: /* @__PURE__ */ (0, import_jsx_runtime158.jsx)( "source", { src: "https://s.w.org/images/block-editor/editing-your-page.mp4", type: "video/mp4" } ) } ), content: /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)(import_jsx_runtime158.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("h1", { className: "edit-site-welcome-guide__heading", children: heading }), /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("p", { className: "edit-site-welcome-guide__text", children: (0, import_i18n62.__)( // eslint-disable-next-line no-restricted-syntax -- 'sidebar' is a common web design term for layouts "It\u2019s now possible to edit page content in the site editor. To customise other parts of the page like the header and footer switch to editing the template using the settings sidebar." ) }) ] }) } ] } ); } // packages/edit-site/build-module/components/welcome-guide/template.mjs var import_data34 = __toESM(require_data(), 1); var import_components77 = __toESM(require_components(), 1); var import_i18n63 = __toESM(require_i18n(), 1); var import_preferences8 = __toESM(require_preferences(), 1); var import_editor9 = __toESM(require_editor(), 1); var import_jsx_runtime159 = __toESM(require_jsx_runtime(), 1); function WelcomeGuideTemplate() { const { toggle } = (0, import_data34.useDispatch)(import_preferences8.store); const { isActive, hasPreviousEntity } = (0, import_data34.useSelect)((select3) => { const { getEditorSettings } = select3(import_editor9.store); const { get } = select3(import_preferences8.store); return { isActive: get("core/edit-site", "welcomeGuideTemplate"), hasPreviousEntity: !!getEditorSettings().onNavigateToPreviousEntityRecord }; }, []); const isVisible2 = isActive && hasPreviousEntity; if (!isVisible2) { return null; } const heading = (0, import_i18n63.__)("Editing a template"); return /* @__PURE__ */ (0, import_jsx_runtime159.jsx)( import_components77.Guide, { className: "edit-site-welcome-guide guide-template", contentLabel: heading, finishButtonText: (0, import_i18n63.__)("Continue"), onFinish: () => toggle("core/edit-site", "welcomeGuideTemplate"), pages: [ { image: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)( "video", { className: "edit-site-welcome-guide__video", autoPlay: true, loop: true, muted: true, width: "312", height: "240", children: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)( "source", { src: "https://s.w.org/images/block-editor/editing-your-template.mp4", type: "video/mp4" } ) } ), content: /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(import_jsx_runtime159.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("h1", { className: "edit-site-welcome-guide__heading", children: heading }), /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("p", { className: "edit-site-welcome-guide__text", children: (0, import_i18n63.__)( "Note that the same template can be used by multiple pages, so any changes made here may affect other pages on the site. To switch back to editing the page content click the \u2018Back\u2019 button in the toolbar." ) }) ] }) } ] } ); } // packages/edit-site/build-module/components/welcome-guide/index.mjs var import_jsx_runtime160 = __toESM(require_jsx_runtime(), 1); function WelcomeGuide({ postType: postType2 }) { return /* @__PURE__ */ (0, import_jsx_runtime160.jsxs)(import_jsx_runtime160.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(WelcomeGuideEditor, {}), postType2 === "page" && /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(WelcomeGuidePage, {}), postType2 === "wp_template" && /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(WelcomeGuideTemplate, {}) ] }); } // packages/edit-site/build-module/components/canvas-loader/index.mjs var import_components78 = __toESM(require_components(), 1); var import_core_data27 = __toESM(require_core_data(), 1); var import_data35 = __toESM(require_data(), 1); var import_editor11 = __toESM(require_editor(), 1); var import_jsx_runtime161 = __toESM(require_jsx_runtime(), 1); var { Theme } = unlock(import_components78.privateApis); var { useStyle: useStyle3 } = unlock(import_editor11.privateApis); function CanvasLoader({ id }) { const textColor = useStyle3("color.text"); const backgroundColor = useStyle3("color.background"); const { elapsed, total } = (0, import_data35.useSelect)((select3) => { const selectorsByStatus = select3(import_core_data27.store).countSelectorsByStatus(); const resolving = selectorsByStatus.resolving ?? 0; const finished = selectorsByStatus.finished ?? 0; return { elapsed: finished, total: finished + resolving }; }, []); return /* @__PURE__ */ (0, import_jsx_runtime161.jsx)("div", { className: "edit-site-canvas-loader", children: /* @__PURE__ */ (0, import_jsx_runtime161.jsx)(Theme, { accent: textColor, background: backgroundColor, children: /* @__PURE__ */ (0, import_jsx_runtime161.jsx)(import_components78.ProgressBar, { id, max: total, value: elapsed }) }) }); } // packages/edit-site/build-module/components/block-editor/use-site-editor-settings.mjs var import_data38 = __toESM(require_data(), 1); var import_element53 = __toESM(require_element(), 1); var import_router14 = __toESM(require_router(), 1); var import_compose9 = __toESM(require_compose(), 1); var import_editor14 = __toESM(require_editor(), 1); // packages/edit-site/build-module/components/block-editor/use-navigate-to-entity-record.mjs var import_data37 = __toESM(require_data(), 1); var import_router13 = __toESM(require_router(), 1); var import_element52 = __toESM(require_element(), 1); var import_url8 = __toESM(require_url(), 1); var import_core_data28 = __toESM(require_core_data(), 1); var import_editor13 = __toESM(require_editor(), 1); // packages/edit-site/build-module/components/block-editor/use-viewport-sync.mjs var import_element51 = __toESM(require_element(), 1); var import_data36 = __toESM(require_data(), 1); var import_router12 = __toESM(require_router(), 1); var import_editor12 = __toESM(require_editor(), 1); var { useLocation: useLocation11 } = unlock(import_router12.privateApis); var DEFAULT_DEVICE_TYPE = "Desktop"; var VALID_DEVICE_TYPES = ["desktop", "tablet", "mobile"]; var capitalize = (str) => str.charAt(0).toUpperCase() + str.slice(1); function useViewportSync() { const { query } = useLocation11(); const { setDeviceType } = (0, import_data36.useDispatch)(import_editor12.store); (0, import_element51.useEffect)(() => { const viewport = query?.viewport?.toLowerCase(); const isValid2 = VALID_DEVICE_TYPES.includes(viewport); setDeviceType(isValid2 ? capitalize(viewport) : DEFAULT_DEVICE_TYPE); }, [query?.viewport, setDeviceType]); } function ViewportSync() { useViewportSync(); return null; } // packages/edit-site/build-module/components/block-editor/use-navigate-to-entity-record.mjs var { useHistory: useHistory8, useLocation: useLocation12 } = unlock(import_router13.privateApis); var VALID_VIEWPORTS = ["desktop", "tablet", "mobile"]; function useNavigateToEntityRecord() { const history = useHistory8(); const location = useLocation12(); const { query, path } = location; const registry = (0, import_data37.useRegistry)(); const currentDeviceType = (0, import_data37.useSelect)( (select3) => select3(import_editor13.store).getDeviceType(), [] ); const onNavigateToEntityRecord = (0, import_element52.useCallback)( (params) => { const currentPostType = registry.select(import_editor13.store).getCurrentPostType(); const currentPostId = registry.select(import_editor13.store).getCurrentPostId(); const entityEdits = registry.select(import_core_data28.store).getEntityRecordEdits( "postType", currentPostType, currentPostId ); const externalClientId = entityEdits?.selection?.selectionStart?.clientId; const urlUpdates = { ...query }; if (externalClientId) { urlUpdates.selectedBlock = externalClientId; } const requestedViewport = typeof params.viewport === "string" ? params.viewport.toLowerCase() : void 0; const isValidRequestedViewport = VALID_VIEWPORTS.includes(requestedViewport); if (isValidRequestedViewport) { const currentViewportLower = (currentDeviceType || DEFAULT_DEVICE_TYPE).toLowerCase(); if (currentViewportLower === DEFAULT_DEVICE_TYPE.toLowerCase()) { delete urlUpdates.viewport; } else { urlUpdates.viewport = currentViewportLower; } } const hasUpdatesToSave = externalClientId || isValidRequestedViewport; if (hasUpdatesToSave) { history.navigate((0, import_url8.addQueryArgs)(path, urlUpdates), { replace: true }); } const queryArgs = { canvas: "edit", focusMode: true }; if (isValidRequestedViewport) { queryArgs.viewport = requestedViewport; } const url = (0, import_url8.addQueryArgs)( `/${params.postType}/${params.postId}`, queryArgs ); history.navigate(url); }, [history, path, query, registry, currentDeviceType] ); return onNavigateToEntityRecord; } // packages/edit-site/build-module/components/block-editor/use-site-editor-settings.mjs var { useLocation: useLocation13, useHistory: useHistory9 } = unlock(import_router14.privateApis); var { useGlobalStyles: useGlobalStyles2 } = unlock(import_editor14.privateApis); function useNavigateToPreviousEntityRecord() { const location = useLocation13(); const previousCanvas = (0, import_compose9.usePrevious)(location.query.canvas); const history = useHistory9(); const goBack = (0, import_element53.useMemo)(() => { const isFocusMode = location.query.focusMode || location?.params?.postId && FOCUSABLE_ENTITIES.includes(location?.params?.postType); const didComeFromEditorCanvas = previousCanvas === "edit"; const showBackButton = isFocusMode && didComeFromEditorCanvas; return showBackButton ? () => history.back() : void 0; }, [location, history, previousCanvas]); return goBack; } function useSpecificEditorSettings() { const { query } = useLocation13(); const { canvas = "view" } = query; const onNavigateToEntityRecord = useNavigateToEntityRecord(); const { merged: mergedConfig } = useGlobalStyles2(); const { settings: settings2, currentPostIsTrashed } = (0, import_data38.useSelect)((select3) => { const { getSettings: getSettings7 } = select3(store); const { getCurrentPostAttribute } = select3(import_editor14.store); return { settings: getSettings7(), currentPostIsTrashed: getCurrentPostAttribute("status") === "trash" }; }, []); const onNavigateToPreviousEntityRecord = useNavigateToPreviousEntityRecord(); const [globalStyles, globalSettings] = (0, import_element53.useMemo)(() => { return generateGlobalStyles(mergedConfig, [], { disableRootPadding: false }); }, [mergedConfig]); const defaultEditorSettings = (0, import_element53.useMemo)(() => { const nonGlobalStyles = (settings2?.styles ?? []).filter( (style) => !style.isGlobalStyles ); return { ...settings2, styles: [ ...nonGlobalStyles, ...globalStyles, { // Forming a "block formatting context" to prevent margin collapsing. // @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context css: canvas === "view" ? `body{min-height: 100vh; ${currentPostIsTrashed ? "" : "cursor: pointer;"}}` : void 0 } ], __experimentalFeatures: globalSettings, richEditingEnabled: true, supportsTemplateMode: true, focusMode: canvas !== "view", onNavigateToEntityRecord, onNavigateToPreviousEntityRecord, isPreviewMode: canvas === "view" }; }, [ settings2, globalStyles, globalSettings, canvas, currentPostIsTrashed, onNavigateToEntityRecord, onNavigateToPreviousEntityRecord ]); return defaultEditorSettings; } // packages/edit-site/build-module/components/plugin-template-setting-panel/index.mjs var import_editor15 = __toESM(require_editor(), 1); var import_data39 = __toESM(require_data(), 1); var import_components79 = __toESM(require_components(), 1); var import_deprecated3 = __toESM(require_deprecated(), 1); var import_jsx_runtime162 = __toESM(require_jsx_runtime(), 1); var { Fill, Slot } = (0, import_components79.createSlotFill)("PluginTemplateSettingPanel"); var PluginTemplateSettingPanel = ({ children }) => { (0, import_deprecated3.default)("wp.editSite.PluginTemplateSettingPanel", { since: "6.6", version: "6.8", alternative: "wp.editor.PluginDocumentSettingPanel" }); const isCurrentEntityTemplate = (0, import_data39.useSelect)( (select3) => select3(import_editor15.store).getCurrentPostType() === "wp_template", [] ); if (!isCurrentEntityTemplate) { return null; } return /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(Fill, { children }); }; PluginTemplateSettingPanel.Slot = Slot; var plugin_template_setting_panel_default = PluginTemplateSettingPanel; // packages/edit-site/build-module/components/more-menu/index.mjs var import_editor16 = __toESM(require_editor(), 1); // packages/edit-site/build-module/components/more-menu/site-export.mjs var import_i18n64 = __toESM(require_i18n(), 1); var import_components80 = __toESM(require_components(), 1); var import_api_fetch3 = __toESM(require_api_fetch(), 1); var import_data40 = __toESM(require_data(), 1); var import_blob = __toESM(require_blob(), 1); var import_core_data29 = __toESM(require_core_data(), 1); var import_notices2 = __toESM(require_notices(), 1); var import_jsx_runtime163 = __toESM(require_jsx_runtime(), 1); function SiteExport() { const canExport = (0, import_data40.useSelect)((select3) => { const targetHints = select3(import_core_data29.store).getCurrentTheme()?._links?.["wp:export-theme"]?.[0]?.targetHints ?? {}; return !!targetHints.allow?.includes("GET"); }, []); const { createErrorNotice } = (0, import_data40.useDispatch)(import_notices2.store); if (!canExport) { return null; } async function handleExport() { try { const response = await (0, import_api_fetch3.default)({ path: "/wp-block-editor/v1/export", parse: false, headers: { Accept: "application/zip" } }); const blob = await response.blob(); const contentDisposition = response.headers.get( "content-disposition" ); const contentDispositionMatches = contentDisposition.match(/=(.+)\.zip/); const fileName = contentDispositionMatches[1] ? contentDispositionMatches[1] : "edit-site-export"; (0, import_blob.downloadBlob)(fileName + ".zip", blob, "application/zip"); } catch (errorResponse) { let error = {}; try { error = await errorResponse.json(); } catch (e2) { } const errorMessage = error.message && error.code !== "unknown_error" ? error.message : (0, import_i18n64.__)("An error occurred while creating the site export."); createErrorNotice(errorMessage, { type: "snackbar" }); } } return /* @__PURE__ */ (0, import_jsx_runtime163.jsx)( import_components80.MenuItem, { role: "menuitem", icon: download_default, onClick: handleExport, info: (0, import_i18n64.__)( "Download your theme with updated templates and styles." ), children: (0, import_i18n64._x)("Export", "site exporter menu item") } ); } // packages/edit-site/build-module/components/more-menu/welcome-guide-menu-item.mjs var import_i18n65 = __toESM(require_i18n(), 1); var import_data41 = __toESM(require_data(), 1); var import_components81 = __toESM(require_components(), 1); var import_preferences9 = __toESM(require_preferences(), 1); var import_jsx_runtime164 = __toESM(require_jsx_runtime(), 1); function WelcomeGuideMenuItem() { const { toggle } = (0, import_data41.useDispatch)(import_preferences9.store); return /* @__PURE__ */ (0, import_jsx_runtime164.jsx)(import_components81.MenuItem, { onClick: () => toggle("core/edit-site", "welcomeGuide"), children: (0, import_i18n65.__)("Welcome Guide") }); } // packages/edit-site/build-module/components/more-menu/index.mjs var import_jsx_runtime165 = __toESM(require_jsx_runtime(), 1); var { ToolsMoreMenuGroup, PreferencesModal } = unlock(import_editor16.privateApis); function MoreMenu() { return /* @__PURE__ */ (0, import_jsx_runtime165.jsxs)(import_jsx_runtime165.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime165.jsxs)(ToolsMoreMenuGroup, { children: [ /* @__PURE__ */ (0, import_jsx_runtime165.jsx)(SiteExport, {}), /* @__PURE__ */ (0, import_jsx_runtime165.jsx)(WelcomeGuideMenuItem, {}) ] }), /* @__PURE__ */ (0, import_jsx_runtime165.jsx)(PreferencesModal, {}) ] }); } // packages/edit-site/build-module/components/block-editor/use-editor-iframe-props.mjs var import_data42 = __toESM(require_data(), 1); var import_keycodes5 = __toESM(require_keycodes(), 1); var import_element54 = __toESM(require_element(), 1); var import_i18n66 = __toESM(require_i18n(), 1); var import_editor17 = __toESM(require_editor(), 1); var import_router15 = __toESM(require_router(), 1); var import_url9 = __toESM(require_url(), 1); var { useLocation: useLocation14, useHistory: useHistory10 } = unlock(import_router15.privateApis); function useEditorIframeProps() { const { query, path } = useLocation14(); const history = useHistory10(); const { canvas = "view" } = query; const currentPostIsTrashed = (0, import_data42.useSelect)((select3) => { return select3(import_editor17.store).getCurrentPostAttribute("status") === "trash"; }, []); const [isFocused, setIsFocused] = (0, import_element54.useState)(false); (0, import_element54.useEffect)(() => { if (canvas === "edit") { setIsFocused(false); } }, [canvas]); const viewModeIframeProps = { "aria-label": (0, import_i18n66.__)("Edit"), "aria-disabled": currentPostIsTrashed, title: null, role: "button", tabIndex: 0, onFocus: () => setIsFocused(true), onBlur: () => setIsFocused(false), onKeyDown: (event) => { const { keyCode } = event; if ((keyCode === import_keycodes5.ENTER || keyCode === import_keycodes5.SPACE) && !currentPostIsTrashed) { event.preventDefault(); history.navigate((0, import_url9.addQueryArgs)(path, { canvas: "edit" }), { transition: "canvas-mode-edit-transition" }); } }, onClick: () => history.navigate((0, import_url9.addQueryArgs)(path, { canvas: "edit" }), { transition: "canvas-mode-edit-transition" }), onClickCapture: (event) => { if (currentPostIsTrashed) { event.preventDefault(); event.stopPropagation(); } }, readonly: true }; return { className: clsx_default("edit-site-visual-editor__editor-canvas", { "is-focused": isFocused && canvas === "view" }), ...canvas === "view" ? viewModeIframeProps : {} }; } // packages/edit-site/build-module/components/editor/use-editor-title.mjs var import_i18n68 = __toESM(require_i18n(), 1); var import_data44 = __toESM(require_data(), 1); var import_core_data31 = __toESM(require_core_data(), 1); var import_html_entities3 = __toESM(require_html_entities(), 1); var import_editor18 = __toESM(require_editor(), 1); // packages/edit-site/build-module/components/routes/use-title.mjs var import_element55 = __toESM(require_element(), 1); var import_data43 = __toESM(require_data(), 1); var import_core_data30 = __toESM(require_core_data(), 1); var import_i18n67 = __toESM(require_i18n(), 1); var import_a11y3 = __toESM(require_a11y(), 1); var import_html_entities2 = __toESM(require_html_entities(), 1); var import_router16 = __toESM(require_router(), 1); var { useLocation: useLocation15 } = unlock(import_router16.privateApis); function useTitle(title) { const location = useLocation15(); const siteTitle = (0, import_data43.useSelect)( (select3) => select3(import_core_data30.store).getEntityRecord("root", "site")?.title, [] ); const isInitialLocationRef = (0, import_element55.useRef)(true); (0, import_element55.useEffect)(() => { isInitialLocationRef.current = false; }, [location]); (0, import_element55.useEffect)(() => { if (isInitialLocationRef.current) { return; } if (title && siteTitle) { const formattedTitle = (0, import_i18n67.sprintf)( /* translators: Admin document title. 1: Admin screen name, 2: Network or site name. */ (0, import_i18n67.__)("%1$s \u2039 %2$s \u2039 Editor \u2014 WordPress"), (0, import_html_entities2.decodeEntities)(title), (0, import_html_entities2.decodeEntities)(siteTitle) ); document.title = formattedTitle; (0, import_a11y3.speak)(title, "assertive"); } }, [title, siteTitle, location]); } // packages/edit-site/build-module/components/editor/use-editor-title.mjs var { getTemplateInfo } = unlock(import_editor18.privateApis); function useEditorTitle(postType2, postId) { const { title, isLoaded } = (0, import_data44.useSelect)( (select3) => { const { getEditedEntityRecord, getCurrentTheme, hasFinishedResolution } = select3(import_core_data31.store); if (!postId) { return { isLoaded: false }; } const _record = getEditedEntityRecord( "postType", postType2, postId ); const { default_template_types: templateTypes = [] } = getCurrentTheme() ?? {}; const templateInfo = getTemplateInfo({ template: _record, templateTypes }); const _isLoaded = hasFinishedResolution("getEditedEntityRecord", [ "postType", postType2, postId ]); return { title: templateInfo.title, isLoaded: _isLoaded }; }, [postType2, postId] ); let editorTitle; if (isLoaded) { editorTitle = (0, import_i18n68.sprintf)( // translators: A breadcrumb trail for the Admin document title. 1: title of template being edited, 2: type of template (Template or Template Part). (0, import_i18n68._x)("%1$s \u2039 %2$s", "breadcrumb trail"), (0, import_html_entities3.decodeEntities)(title), POST_TYPE_LABELS[postType2] ?? POST_TYPE_LABELS[TEMPLATE_POST_TYPE] ); } useTitle(isLoaded && editorTitle); } var use_editor_title_default = useEditorTitle; // packages/edit-site/build-module/components/editor/use-adapt-editor-to-canvas.mjs var import_data45 = __toESM(require_data(), 1); var import_block_editor17 = __toESM(require_block_editor(), 1); var import_editor19 = __toESM(require_editor(), 1); var import_element56 = __toESM(require_element(), 1); var import_preferences10 = __toESM(require_preferences(), 1); function useAdaptEditorToCanvas(canvas) { const { clearSelectedBlock } = (0, import_data45.useDispatch)(import_block_editor17.store); const { editPost, setDeviceType, closePublishSidebar, setIsListViewOpened: setIsListViewOpened2, setIsInserterOpened: setIsInserterOpened2 } = (0, import_data45.useDispatch)(import_editor19.store); const { get: getPreference } = (0, import_data45.useSelect)(import_preferences10.store); const { getCurrentPost } = (0, import_data45.useSelect)(import_editor19.store); const registry = (0, import_data45.useRegistry)(); (0, import_element56.useLayoutEffect)(() => { const isMediumOrBigger = window.matchMedia("(min-width: 782px)").matches; registry.batch(() => { clearSelectedBlock(); if (getCurrentPost()?.type) { editPost({ selection: void 0 }, { undoIgnore: true }); } setDeviceType(DEFAULT_DEVICE_TYPE); closePublishSidebar(); setIsInserterOpened2(false); if (isMediumOrBigger && canvas === "edit" && getPreference("core", "showListViewByDefault") && !getPreference("core", "distractionFree")) { setIsListViewOpened2(true); } else { setIsListViewOpened2(false); } }); }, [ canvas, registry, clearSelectedBlock, editPost, setDeviceType, closePublishSidebar, setIsInserterOpened2, setIsListViewOpened2, getPreference, getCurrentPost ]); } // packages/edit-site/build-module/components/editor/use-resolve-edited-entity.mjs var import_element57 = __toESM(require_element(), 1); var import_data46 = __toESM(require_data(), 1); var import_core_data32 = __toESM(require_core_data(), 1); var import_router17 = __toESM(require_router(), 1); var { useLocation: useLocation16 } = unlock(import_router17.privateApis); var postTypesWithoutParentTemplate = [ ATTACHMENT_POST_TYPE, TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE, NAVIGATION_POST_TYPE, PATTERN_TYPES.user ]; var authorizedPostTypes = ["page", "post"]; function getPostType(name2) { let postType2; if (name2 === "navigation-item") { postType2 = NAVIGATION_POST_TYPE; } else if (name2 === "pattern-item") { postType2 = PATTERN_TYPES.user; } else if (name2 === "template-part-item") { postType2 = TEMPLATE_PART_POST_TYPE; } else if (name2 === "templates") { postType2 = TEMPLATE_POST_TYPE; } else if (name2 === "template-item") { postType2 = TEMPLATE_POST_TYPE; } else if (name2 === "page-item" || name2 === "pages") { postType2 = "page"; } else if (name2 === "post-item" || name2 === "posts") { postType2 = "post"; } else if (name2 === "attachment-item") { postType2 = ATTACHMENT_POST_TYPE; } return postType2; } function useResolveEditedEntity() { const { editEntityRecord } = (0, import_data46.useDispatch)(import_core_data32.store); const { hasEntityRecord } = (0, import_data46.useSelect)(import_core_data32.store); const { name: name2, params = {}, query } = useLocation16(); const { postId = query?.postId } = params; const postType2 = getPostType(name2, postId) ?? query?.postType; const { selectedBlock } = query; const appliedSelectionRef = (0, import_element57.useRef)(null); const homePage = (0, import_data46.useSelect)((select3) => { const { getHomePage } = unlock(select3(import_core_data32.store)); return getHomePage(); }, []); const resolvedTemplateId = (0, import_data46.useSelect)( (select3) => { if (postTypesWithoutParentTemplate.includes(postType2) && postId) { return; } if (postId && postId.includes(",")) { return; } const { getTemplateId } = unlock(select3(import_core_data32.store)); if (postType2 && postId && authorizedPostTypes.includes(postType2)) { return getTemplateId(postType2, postId); } if (homePage?.postType === "page") { return getTemplateId("page", homePage?.postId); } if (homePage?.postType === "wp_template") { return homePage?.postId; } }, [homePage, postId, postType2] ); const context = (0, import_element57.useMemo)(() => { if (postTypesWithoutParentTemplate.includes(postType2) && postId) { return {}; } if (postType2 && postId && authorizedPostTypes.includes(postType2)) { return { postType: postType2, postId }; } if (homePage?.postType === "page") { return { postType: "page", postId: homePage?.postId }; } return {}; }, [homePage, postType2, postId]); let entity; if (postTypesWithoutParentTemplate.includes(postType2) && postId) { entity = { isReady: true, postType: postType2, postId, context }; } else if (!!homePage) { entity = { isReady: resolvedTemplateId !== void 0, postType: TEMPLATE_POST_TYPE, postId: resolvedTemplateId, context }; } else { entity = { isReady: false }; } if (selectedBlock && entity.isReady && appliedSelectionRef.current !== selectedBlock) { const selectionPostType = entity.context?.postId ? entity.context.postType : entity.postType; const selectionPostId = entity.context?.postId ? entity.context.postId : entity.postId; if (hasEntityRecord("postType", selectionPostType, selectionPostId)) { editEntityRecord( "postType", selectionPostType, selectionPostId, { selection: { selectionStart: { clientId: selectedBlock }, selectionEnd: { clientId: selectedBlock } } }, { undoIgnore: true } ); appliedSelectionRef.current = selectedBlock; } } return entity; } function useSyncDeprecatedEntityIntoState({ postType: postType2, postId, context, isReady }) { const { setEditedEntity: setEditedEntity2 } = (0, import_data46.useDispatch)(store); (0, import_element57.useEffect)(() => { if (isReady) { setEditedEntity2(postType2, String(postId), context); } }, [isReady, postType2, postId, context, setEditedEntity2]); } // packages/edit-site/build-module/components/editor/site-preview.mjs var import_i18n69 = __toESM(require_i18n(), 1); var import_data47 = __toESM(require_data(), 1); var import_core_data33 = __toESM(require_core_data(), 1); var import_dom2 = __toESM(require_dom(), 1); var import_url10 = __toESM(require_url(), 1); var import_jsx_runtime166 = __toESM(require_jsx_runtime(), 1); function SitePreview() { const siteUrl = (0, import_data47.useSelect)((select3) => { const { getEntityRecord } = select3(import_core_data33.store); const siteData = getEntityRecord("root", "__unstableBase"); return siteData?.home; }, []); return /* @__PURE__ */ (0, import_jsx_runtime166.jsx)( "iframe", { src: (0, import_url10.addQueryArgs)(siteUrl, { // Parameter for hiding the admin bar. wp_site_preview: 1 }), title: (0, import_i18n69.__)("Site Preview"), style: { display: "block", width: "100%", height: "100%", backgroundColor: "#fff" }, onLoad: (event) => { const document2 = event.target.contentDocument; const focusableElements = import_dom2.focus.focusable.find(document2); focusableElements.forEach((element) => { element.style.pointerEvents = "none"; element.tabIndex = -1; element.setAttribute("aria-hidden", "true"); }); } } ); } // packages/edit-site/build-module/components/editor/index.mjs var import_jsx_runtime167 = __toESM(require_jsx_runtime(), 1); var { Editor, BackButton } = unlock(import_editor20.privateApis); var { useHistory: useHistory11, useLocation: useLocation17 } = unlock(import_router18.privateApis); var { BlockKeyboardShortcuts } = unlock(import_block_library.privateApis); var toggleHomeIconVariants = { edit: { opacity: 0, scale: 0.2 }, hover: { opacity: 1, scale: 1, clipPath: "inset( 22% round 2px )" } }; var siteIconVariants = { edit: { clipPath: "inset(0% round 0px)" }, hover: { clipPath: "inset( 22% round 2px )" }, tap: { clipPath: "inset(0% round 0px)" } }; function getListPathForPostType(postType2) { switch (postType2) { case "navigation": return "/navigation"; case "wp_block": return "/pattern?postType=wp_block"; case "wp_template_part": return "/pattern?postType=wp_template_part"; case "wp_template": return "/template"; case "page": return "/page"; case "post": return "/"; } throw "Unknown post type"; } function getNavigationPath(location, postType2) { const { path, name: name2 } = location; if ([ "pattern-item", "template-part-item", "page-item", "template-item", "static-template-item", "post-item" ].includes(name2)) { return getListPathForPostType(postType2); } return (0, import_url11.addQueryArgs)(path, { canvas: void 0 }); } function EditSiteEditor({ isHomeRoute = false }) { const disableMotion = (0, import_compose10.useReducedMotion)(); const location = useLocation17(); const history = useHistory11(); const { canvas = "view" } = location.query; const isLoading = useIsSiteEditorLoading(); useAdaptEditorToCanvas(canvas); const entity = useResolveEditedEntity(); useSyncDeprecatedEntityIntoState(entity); const { postType: postType2, postId, context } = entity; const { isBlockBasedTheme, hasSiteIcon } = (0, import_data48.useSelect)((select3) => { const { getCurrentTheme, getEntityRecord } = select3(import_core_data34.store); const siteData = getEntityRecord("root", "__unstableBase", void 0); return { isBlockBasedTheme: getCurrentTheme()?.is_block_theme, hasSiteIcon: !!siteData?.site_icon_url }; }, []); const postWithTemplate = !!context?.postId; use_editor_title_default( postWithTemplate ? context.postType : postType2, postWithTemplate ? context.postId : postId ); const _isPreviewingTheme = isPreviewingTheme(); const iframeProps = useEditorIframeProps(); const isEditMode = canvas === "edit"; const loadingProgressId = (0, import_compose10.useInstanceId)( CanvasLoader, "edit-site-editor__loading-progress" ); const editorSettings = useSpecificEditorSettings(); const { resetZoomLevel } = unlock((0, import_data48.useDispatch)(import_block_editor18.store)); const { setCurrentRevisionId } = unlock((0, import_data48.useDispatch)(import_editor20.store)); const { createSuccessNotice } = (0, import_data48.useDispatch)(import_notices3.store); const onActionPerformed = (0, import_element58.useCallback)( (actionId, items) => { switch (actionId) { case "move-to-trash": case "delete-post": { history.navigate( getListPathForPostType( postWithTemplate ? context.postType : postType2 ) ); } break; case "duplicate-post": { const newItem = items[0]; const _title = typeof newItem.title === "string" ? newItem.title : newItem.title?.rendered; createSuccessNotice( (0, import_i18n70.sprintf)( // translators: %s: Title of the created post or template, e.g: "Hello world". (0, import_i18n70.__)('"%s" successfully created.'), (0, import_html_entities4.decodeEntities)(_title) || (0, import_i18n70.__)("(no title)") ), { type: "snackbar", id: "duplicate-post-action", actions: [ { label: (0, import_i18n70.__)("Edit"), onClick: () => { history.navigate( `/${newItem.type}/${newItem.id}?canvas=edit` ); } } ] } ); } break; } }, [ postType2, context?.postType, postWithTemplate, history, createSuccessNotice ] ); const isReady = !isLoading; const transition = { duration: disableMotion ? 0 : 0.2 }; return !isBlockBasedTheme && isHomeRoute ? /* @__PURE__ */ (0, import_jsx_runtime167.jsx)(SitePreview, {}) : /* @__PURE__ */ (0, import_jsx_runtime167.jsxs)(import_jsx_runtime167.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime167.jsx)(import_editor20.EditorKeyboardShortcutsRegister, {}), isEditMode && /* @__PURE__ */ (0, import_jsx_runtime167.jsx)(BlockKeyboardShortcuts, {}), !isReady ? /* @__PURE__ */ (0, import_jsx_runtime167.jsx)(CanvasLoader, { id: loadingProgressId }) : null, isEditMode && isReady && /* @__PURE__ */ (0, import_jsx_runtime167.jsx)( WelcomeGuide, { postType: postWithTemplate ? context.postType : postType2 } ), isReady && /* @__PURE__ */ (0, import_jsx_runtime167.jsxs)( Editor, { postType: postWithTemplate ? context.postType : postType2, postId: postWithTemplate ? context.postId : postId, templateId: postWithTemplate ? postId : void 0, settings: editorSettings, className: "edit-site-editor__editor-interface", customSaveButton: _isPreviewingTheme && /* @__PURE__ */ (0, import_jsx_runtime167.jsx)(SaveButton, { size: "compact" }), customSavePanel: _isPreviewingTheme && /* @__PURE__ */ (0, import_jsx_runtime167.jsx)(SavePanel, {}), iframeProps, onActionPerformed, extraSidebarPanels: !postWithTemplate && /* @__PURE__ */ (0, import_jsx_runtime167.jsx)(plugin_template_setting_panel_default.Slot, {}), children: [ isEditMode && /* @__PURE__ */ (0, import_jsx_runtime167.jsx)(ViewportSync, {}), isEditMode && /* @__PURE__ */ (0, import_jsx_runtime167.jsx)(BackButton, { children: ({ length }) => length <= 1 && /* @__PURE__ */ (0, import_jsx_runtime167.jsxs)( import_components82.__unstableMotion.div, { className: "edit-site-editor__view-mode-toggle", transition, animate: "edit", initial: "edit", whileHover: "hover", whileTap: "tap", children: [ /* @__PURE__ */ (0, import_jsx_runtime167.jsx)( import_components82.Button, { __next40pxDefaultSize: true, label: (0, import_i18n70.__)("Open Navigation"), showTooltip: true, tooltipPosition: "middle right", onClick: () => { resetZoomLevel(); setCurrentRevisionId(null); history.navigate( getNavigationPath( location, postWithTemplate ? context.postType : postType2 ), { transition: "canvas-mode-view-transition" } ); }, children: /* @__PURE__ */ (0, import_jsx_runtime167.jsx)( import_components82.__unstableMotion.div, { variants: siteIconVariants, children: /* @__PURE__ */ (0, import_jsx_runtime167.jsx)(site_icon_default, { className: "edit-site-editor__view-mode-toggle-icon" }) } ) } ), /* @__PURE__ */ (0, import_jsx_runtime167.jsx)( import_components82.__unstableMotion.div, { className: clsx_default( "edit-site-editor__back-icon", { "has-site-icon": hasSiteIcon } ), variants: toggleHomeIconVariants, children: /* @__PURE__ */ (0, import_jsx_runtime167.jsx)(icon_default, { icon: arrow_up_left_default }) } ) ] } ) }), /* @__PURE__ */ (0, import_jsx_runtime167.jsx)(MoreMenu, {}) ] } ) ] }); } // packages/edit-site/build-module/components/site-editor-routes/utils.mjs function isClassicThemeWithStyleBookSupport(siteData) { const isBlockTheme = siteData.currentTheme?.is_block_theme; const supportsEditorStyles = siteData.currentTheme?.theme_supports["editor-styles"]; const hasThemeJson = siteData.editorSettings?.supportsLayout; return !isBlockTheme && (supportsEditorStyles || hasThemeJson); } // packages/edit-site/build-module/components/site-editor-routes/home.mjs var import_jsx_runtime168 = __toESM(require_jsx_runtime(), 1); var homeRoute = { name: "home", path: "/", areas: { sidebar({ siteData }) { const isBlockTheme = siteData.currentTheme?.is_block_theme; return isBlockTheme || isClassicThemeWithStyleBookSupport(siteData) ? /* @__PURE__ */ (0, import_jsx_runtime168.jsx)(SidebarNavigationScreenMain, {}) : /* @__PURE__ */ (0, import_jsx_runtime168.jsx)(SidebarNavigationScreenUnsupported, {}); }, preview({ siteData }) { const isBlockTheme = siteData.currentTheme?.is_block_theme; return isBlockTheme || isClassicThemeWithStyleBookSupport(siteData) ? /* @__PURE__ */ (0, import_jsx_runtime168.jsx)(EditSiteEditor, { isHomeRoute: true }) : void 0; }, mobile({ siteData }) { const isBlockTheme = siteData.currentTheme?.is_block_theme; return isBlockTheme || isClassicThemeWithStyleBookSupport(siteData) ? /* @__PURE__ */ (0, import_jsx_runtime168.jsx)(SidebarNavigationScreenMain, {}) : /* @__PURE__ */ (0, import_jsx_runtime168.jsx)(SidebarNavigationScreenUnsupported, {}); } } }; // packages/edit-site/build-module/components/site-editor-routes/styles.mjs var import_router20 = __toESM(require_router(), 1); var import_editor23 = __toESM(require_editor(), 1); var import_url13 = __toESM(require_url(), 1); // packages/edit-site/build-module/components/sidebar-global-styles/index.mjs var import_i18n71 = __toESM(require_i18n(), 1); var import_element59 = __toESM(require_element(), 1); var import_router19 = __toESM(require_router(), 1); var import_editor22 = __toESM(require_editor(), 1); var import_compose11 = __toESM(require_compose(), 1); var import_components83 = __toESM(require_components(), 1); var import_url12 = __toESM(require_url(), 1); var import_jsx_runtime169 = __toESM(require_jsx_runtime(), 1); var { GlobalStylesUIWrapper, GlobalStylesActionMenu } = unlock(import_editor22.privateApis); var { useLocation: useLocation18, useHistory: useHistory12 } = unlock(import_router19.privateApis); var GlobalStylesPageActions = ({ isStyleBookOpened, setIsStyleBookOpened, path, onChangeSection }) => { const history = useHistory12(); return /* @__PURE__ */ (0, import_jsx_runtime169.jsxs)(import_components83.__experimentalHStack, { children: [ /* @__PURE__ */ (0, import_jsx_runtime169.jsx)( import_components83.Button, { isPressed: isStyleBookOpened, icon: seen_default, label: (0, import_i18n71.__)("Style Book"), onClick: () => { setIsStyleBookOpened(!isStyleBookOpened); const updatedPath = !isStyleBookOpened ? (0, import_url12.addQueryArgs)(path, { preview: "stylebook" }) : (0, import_url12.removeQueryArgs)(path, "preview"); history.navigate(updatedPath); }, size: "compact" } ), /* @__PURE__ */ (0, import_jsx_runtime169.jsx)( GlobalStylesActionMenu, { hideWelcomeGuide: true, onChangePath: onChangeSection } ) ] }); }; var useSection = () => { const { path, query } = useLocation18(); const history = useHistory12(); return (0, import_element59.useMemo)(() => { return [ query.section ?? "/", (updatedSection) => { history.navigate( (0, import_url12.addQueryArgs)(path, { section: updatedSection }) ); } ]; }, [path, query.section, history]); }; function SidebarGlobalStyles() { const { path } = useLocation18(); const [isStyleBookOpened, setIsStyleBookOpened] = (0, import_element59.useState)( path.includes("preview=stylebook") ); const isMobileViewport = (0, import_compose11.useViewportMatch)("medium", "<"); const [section, onChangeSection] = useSection(); return /* @__PURE__ */ (0, import_jsx_runtime169.jsx)( page_default2, { actions: !isMobileViewport ? /* @__PURE__ */ (0, import_jsx_runtime169.jsx)( GlobalStylesPageActions, { isStyleBookOpened, setIsStyleBookOpened, path, onChangeSection } ) : null, className: "edit-site-styles", title: (0, import_i18n71.__)("Styles"), headingLevel: 2, children: /* @__PURE__ */ (0, import_jsx_runtime169.jsx)( GlobalStylesUIWrapper, { path: section, onPathChange: onChangeSection } ) } ); } // packages/edit-site/build-module/components/site-editor-routes/styles.mjs var import_jsx_runtime170 = __toESM(require_jsx_runtime(), 1); var { useLocation: useLocation19, useHistory: useHistory13 } = unlock(import_router20.privateApis); var { StyleBookPreview } = unlock(import_editor23.privateApis); function MobileGlobalStylesUI() { const { query = {} } = useLocation19(); const { canvas } = query; if (canvas === "edit") { return /* @__PURE__ */ (0, import_jsx_runtime170.jsx)(EditSiteEditor, {}); } return /* @__PURE__ */ (0, import_jsx_runtime170.jsx)(SidebarGlobalStyles, {}); } function StylesPreviewArea() { const { path, query } = useLocation19(); const history = useHistory13(); const isStylebook = query.preview === "stylebook"; const section = query.section ?? "/"; const onChangeSection = (updatedSection) => { history.navigate( (0, import_url13.addQueryArgs)(path, { section: updatedSection }) ); }; if (isStylebook) { return /* @__PURE__ */ (0, import_jsx_runtime170.jsx)( StyleBookPreview, { path: section, onPathChange: onChangeSection } ); } return /* @__PURE__ */ (0, import_jsx_runtime170.jsx)(EditSiteEditor, {}); } var stylesRoute = { name: "styles", path: "/styles", areas: { content: /* @__PURE__ */ (0, import_jsx_runtime170.jsx)(SidebarGlobalStyles, {}), sidebar: /* @__PURE__ */ (0, import_jsx_runtime170.jsx)(SidebarNavigationScreenGlobalStyles, { backPath: "/" }), preview: /* @__PURE__ */ (0, import_jsx_runtime170.jsx)(StylesPreviewArea, {}), mobile: /* @__PURE__ */ (0, import_jsx_runtime170.jsx)(MobileGlobalStylesUI, {}) }, widths: { content: 380 } }; // packages/edit-site/build-module/components/site-editor-routes/navigation.mjs var import_router25 = __toESM(require_router(), 1); // packages/edit-site/build-module/components/sidebar-navigation-screen-navigation-menus/index.mjs var import_i18n80 = __toESM(require_i18n(), 1); var import_core_data38 = __toESM(require_core_data(), 1); var import_data54 = __toESM(require_data(), 1); var import_html_entities8 = __toESM(require_html_entities(), 1); var import_components89 = __toESM(require_components(), 1); // packages/edit-site/build-module/components/sidebar-navigation-screen-navigation-menus/constants.mjs var PRELOADED_NAVIGATION_MENUS_QUERY = { per_page: 100, status: ["publish", "draft"], order: "desc", orderby: "date" }; // packages/edit-site/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.mjs var import_i18n77 = __toESM(require_i18n(), 1); var import_html_entities6 = __toESM(require_html_entities(), 1); // packages/edit-site/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.mjs var import_components86 = __toESM(require_components(), 1); var import_i18n74 = __toESM(require_i18n(), 1); var import_element61 = __toESM(require_element(), 1); var import_router21 = __toESM(require_router(), 1); // packages/edit-site/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.mjs var import_components84 = __toESM(require_components(), 1); var import_i18n72 = __toESM(require_i18n(), 1); var import_element60 = __toESM(require_element(), 1); var import_jsx_runtime171 = __toESM(require_jsx_runtime(), 1); var notEmptyString = (testString) => testString?.trim()?.length > 0; function RenameModal({ menuTitle, onClose, onSave }) { const [editedMenuTitle, setEditedMenuTitle] = (0, import_element60.useState)(menuTitle); const titleHasChanged = editedMenuTitle !== menuTitle; const isEditedMenuTitleValid = titleHasChanged && notEmptyString(editedMenuTitle); return /* @__PURE__ */ (0, import_jsx_runtime171.jsx)( import_components84.Modal, { title: (0, import_i18n72.__)("Rename"), onRequestClose: onClose, focusOnMount: "firstContentElement", size: "small", children: /* @__PURE__ */ (0, import_jsx_runtime171.jsx)("form", { className: "sidebar-navigation__rename-modal-form", children: /* @__PURE__ */ (0, import_jsx_runtime171.jsxs)(import_components84.__experimentalVStack, { spacing: "3", children: [ /* @__PURE__ */ (0, import_jsx_runtime171.jsx)( import_components84.TextControl, { __next40pxDefaultSize: true, value: editedMenuTitle, placeholder: (0, import_i18n72.__)("Navigation title"), onChange: setEditedMenuTitle, label: (0, import_i18n72.__)("Name") } ), /* @__PURE__ */ (0, import_jsx_runtime171.jsxs)(import_components84.__experimentalHStack, { justify: "right", children: [ /* @__PURE__ */ (0, import_jsx_runtime171.jsx)( import_components84.Button, { __next40pxDefaultSize: true, variant: "tertiary", onClick: onClose, children: (0, import_i18n72.__)("Cancel") } ), /* @__PURE__ */ (0, import_jsx_runtime171.jsx)( import_components84.Button, { __next40pxDefaultSize: true, accessibleWhenDisabled: true, disabled: !isEditedMenuTitleValid, variant: "primary", type: "submit", onClick: (e2) => { e2.preventDefault(); if (!isEditedMenuTitleValid) { return; } onSave({ title: editedMenuTitle }); onClose(); }, children: (0, import_i18n72.__)("Save") } ) ] }) ] }) }) } ); } // packages/edit-site/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.mjs var import_components85 = __toESM(require_components(), 1); var import_i18n73 = __toESM(require_i18n(), 1); var import_jsx_runtime172 = __toESM(require_jsx_runtime(), 1); function DeleteConfirmDialog({ onClose, onConfirm }) { return /* @__PURE__ */ (0, import_jsx_runtime172.jsx)( import_components85.__experimentalConfirmDialog, { isOpen: true, onConfirm: () => { onConfirm(); onClose(); }, onCancel: onClose, confirmButtonText: (0, import_i18n73.__)("Delete"), size: "medium", children: (0, import_i18n73.__)("Are you sure you want to delete this Navigation Menu?") } ); } // packages/edit-site/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.mjs var import_jsx_runtime173 = __toESM(require_jsx_runtime(), 1); var { useHistory: useHistory14 } = unlock(import_router21.privateApis); var POPOVER_PROPS = { position: "bottom right" }; function ScreenNavigationMoreMenu(props) { const { onDelete, onSave, onDuplicate, menuTitle, menuId } = props; const [renameModalOpen, setRenameModalOpen] = (0, import_element61.useState)(false); const [deleteConfirmDialogOpen, setDeleteConfirmDialogOpen] = (0, import_element61.useState)(false); const history = useHistory14(); const closeModals = () => { setRenameModalOpen(false); setDeleteConfirmDialogOpen(false); }; const openRenameModal = () => setRenameModalOpen(true); const openDeleteConfirmDialog = () => setDeleteConfirmDialogOpen(true); return /* @__PURE__ */ (0, import_jsx_runtime173.jsxs)(import_jsx_runtime173.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime173.jsx)( import_components86.DropdownMenu, { className: "sidebar-navigation__more-menu", label: (0, import_i18n74.__)("Actions"), icon: more_vertical_default, popoverProps: POPOVER_PROPS, children: ({ onClose }) => /* @__PURE__ */ (0, import_jsx_runtime173.jsxs)(import_components86.MenuGroup, { children: [ /* @__PURE__ */ (0, import_jsx_runtime173.jsx)( import_components86.MenuItem, { onClick: () => { openRenameModal(); onClose(); }, children: (0, import_i18n74.__)("Rename") } ), /* @__PURE__ */ (0, import_jsx_runtime173.jsx)( import_components86.MenuItem, { onClick: () => { history.navigate( `/wp_navigation/${menuId}?canvas=edit` ); }, children: (0, import_i18n74.__)("Edit") } ), /* @__PURE__ */ (0, import_jsx_runtime173.jsx)( import_components86.MenuItem, { onClick: () => { onDuplicate(); onClose(); }, children: (0, import_i18n74.__)("Duplicate") } ), /* @__PURE__ */ (0, import_jsx_runtime173.jsx)( import_components86.MenuItem, { isDestructive: true, onClick: () => { openDeleteConfirmDialog(); onClose(); }, children: (0, import_i18n74.__)("Delete") } ) ] }) } ), deleteConfirmDialogOpen && /* @__PURE__ */ (0, import_jsx_runtime173.jsx)( DeleteConfirmDialog, { onClose: closeModals, onConfirm: onDelete } ), renameModalOpen && /* @__PURE__ */ (0, import_jsx_runtime173.jsx)( RenameModal, { onClose: closeModals, menuTitle, onSave } ) ] }); } // packages/edit-site/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.mjs var import_element64 = __toESM(require_element(), 1); var import_data51 = __toESM(require_data(), 1); var import_block_editor21 = __toESM(require_block_editor(), 1); var import_blocks10 = __toESM(require_blocks(), 1); // packages/edit-site/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.mjs var import_block_editor20 = __toESM(require_block_editor(), 1); var import_data50 = __toESM(require_data(), 1); var import_blocks9 = __toESM(require_blocks(), 1); var import_element63 = __toESM(require_element(), 1); var import_core_data35 = __toESM(require_core_data(), 1); // packages/edit-site/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.mjs var import_components87 = __toESM(require_components(), 1); var import_data49 = __toESM(require_data(), 1); var import_element62 = __toESM(require_element(), 1); var import_i18n75 = __toESM(require_i18n(), 1); var import_block_editor19 = __toESM(require_block_editor(), 1); var import_router22 = __toESM(require_router(), 1); var import_jsx_runtime174 = __toESM(require_jsx_runtime(), 1); var POPOVER_PROPS2 = { className: "block-editor-block-settings-menu__popover", placement: "bottom-start" }; var { useHistory: useHistory15, useLocation: useLocation20 } = unlock(import_router22.privateApis); function LeafMoreMenu(props) { const history = useHistory15(); const { path } = useLocation20(); const { block } = props; const { clientId } = block; const { moveBlocksDown, moveBlocksUp, removeBlocks } = (0, import_data49.useDispatch)(import_block_editor19.store); const removeLabel = (0, import_i18n75.sprintf)( /* translators: %s: block name */ (0, import_i18n75.__)("Remove %s"), (0, import_block_editor19.BlockTitle)({ clientId, maximumLength: 25 }) ); const goToLabel = (0, import_i18n75.sprintf)( /* translators: %s: block name */ (0, import_i18n75.__)("Go to %s"), (0, import_block_editor19.BlockTitle)({ clientId, maximumLength: 25 }) ); const rootClientId = (0, import_data49.useSelect)( (select3) => { const { getBlockRootClientId } = select3(import_block_editor19.store); return getBlockRootClientId(clientId); }, [clientId] ); const onGoToPage = (0, import_element62.useCallback)( (selectedBlock) => { const { attributes, name: name2 } = selectedBlock; if (attributes.kind === "post-type" && attributes.id && attributes.type && history) { history.navigate( `/${attributes.type}/${attributes.id}?canvas=edit`, { state: { backPath: path } } ); } if (name2 === "core/page-list-item" && attributes.id && history) { history.navigate(`/page/${attributes.id}?canvas=edit`, { state: { backPath: path } }); } }, [path, history] ); return /* @__PURE__ */ (0, import_jsx_runtime174.jsx)( import_components87.DropdownMenu, { icon: more_vertical_default, label: (0, import_i18n75.__)("Options"), className: "block-editor-block-settings-menu", popoverProps: POPOVER_PROPS2, noIcons: true, ...props, children: ({ onClose }) => /* @__PURE__ */ (0, import_jsx_runtime174.jsxs)(import_jsx_runtime174.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime174.jsxs)(import_components87.MenuGroup, { children: [ /* @__PURE__ */ (0, import_jsx_runtime174.jsx)( import_components87.MenuItem, { icon: chevron_up_default, onClick: () => { moveBlocksUp([clientId], rootClientId); onClose(); }, children: (0, import_i18n75.__)("Move up") } ), /* @__PURE__ */ (0, import_jsx_runtime174.jsx)( import_components87.MenuItem, { icon: chevron_down_default, onClick: () => { moveBlocksDown([clientId], rootClientId); onClose(); }, children: (0, import_i18n75.__)("Move down") } ), block.attributes?.type === "page" && block.attributes?.id && /* @__PURE__ */ (0, import_jsx_runtime174.jsx)( import_components87.MenuItem, { onClick: () => { onGoToPage(block); onClose(); }, children: goToLabel } ) ] }), /* @__PURE__ */ (0, import_jsx_runtime174.jsx)(import_components87.MenuGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime174.jsx)( import_components87.MenuItem, { onClick: () => { removeBlocks([clientId], false); onClose(); }, children: removeLabel } ) }) ] }) } ); } // packages/edit-site/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.mjs var import_jsx_runtime175 = __toESM(require_jsx_runtime(), 1); var { PrivateListView } = unlock(import_block_editor20.privateApis); var MAX_PAGE_COUNT = 100; var PAGES_QUERY = [ "postType", "page", { per_page: MAX_PAGE_COUNT, _fields: ["id", "link", "menu_order", "parent", "title", "type"], // TODO: When https://core.trac.wordpress.org/ticket/39037 REST API support for multiple orderby // values is resolved, update 'orderby' to [ 'menu_order', 'post_title' ] to provide a consistent // sort. orderby: "menu_order", order: "asc" } ]; function NavigationMenuContent({ rootClientId }) { const { listViewRootClientId, isLoading } = (0, import_data50.useSelect)( (select3) => { const { areInnerBlocksControlled, getBlockName, getBlockCount, getBlockOrder } = select3(import_block_editor20.store); const { isResolving } = select3(import_core_data35.store); const blockClientIds = getBlockOrder(rootClientId); const hasOnlyPageListBlock = blockClientIds.length === 1 && getBlockName(blockClientIds[0]) === "core/page-list"; const pageListHasBlocks = hasOnlyPageListBlock && getBlockCount(blockClientIds[0]) > 0; const isLoadingPages = isResolving( "getEntityRecords", PAGES_QUERY ); return { listViewRootClientId: pageListHasBlocks ? blockClientIds[0] : rootClientId, // This is a small hack to wait for the navigation block // to actually load its inner blocks. isLoading: !areInnerBlocksControlled(rootClientId) || isLoadingPages }; }, [rootClientId] ); const { replaceBlock, __unstableMarkNextChangeAsNotPersistent } = (0, import_data50.useDispatch)(import_block_editor20.store); const offCanvasOnselect = (0, import_element63.useCallback)( (block) => { if (block.name === "core/navigation-link" && !block.attributes.url) { __unstableMarkNextChangeAsNotPersistent(); replaceBlock( block.clientId, (0, import_blocks9.createBlock)("core/navigation-link", block.attributes) ); } }, [__unstableMarkNextChangeAsNotPersistent, replaceBlock] ); return /* @__PURE__ */ (0, import_jsx_runtime175.jsxs)(import_jsx_runtime175.Fragment, { children: [ !isLoading && /* @__PURE__ */ (0, import_jsx_runtime175.jsx)( PrivateListView, { rootClientId: listViewRootClientId, onSelect: offCanvasOnselect, blockSettingsMenu: LeafMoreMenu, showAppender: false, isExpanded: true } ), /* @__PURE__ */ (0, import_jsx_runtime175.jsx)("div", { className: "edit-site-sidebar-navigation-screen-navigation-menus__helper-block-editor", children: /* @__PURE__ */ (0, import_jsx_runtime175.jsx)(import_block_editor20.BlockList, {}) }) ] }); } // packages/edit-site/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.mjs var import_jsx_runtime176 = __toESM(require_jsx_runtime(), 1); var noop2 = () => { }; function NavigationMenuEditor({ navigationMenuId }) { const { storedSettings } = (0, import_data51.useSelect)((select3) => { const { getSettings: getSettings7 } = unlock(select3(store)); return { storedSettings: getSettings7() }; }, []); const blocks = (0, import_element64.useMemo)(() => { if (!navigationMenuId) { return []; } return [(0, import_blocks10.createBlock)("core/navigation", { ref: navigationMenuId })]; }, [navigationMenuId]); if (!navigationMenuId || !blocks?.length) { return null; } return /* @__PURE__ */ (0, import_jsx_runtime176.jsx)( import_block_editor21.BlockEditorProvider, { settings: storedSettings, value: blocks, onChange: noop2, onInput: noop2, children: /* @__PURE__ */ (0, import_jsx_runtime176.jsx)("div", { className: "edit-site-sidebar-navigation-screen-navigation-menus__content", children: /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(NavigationMenuContent, { rootClientId: blocks[0].clientId }) }) } ); } // packages/edit-site/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.mjs var import_i18n76 = __toESM(require_i18n(), 1); var import_html_entities5 = __toESM(require_html_entities(), 1); function buildNavigationLabel(title, id, status) { if (!title?.rendered) { return (0, import_i18n76.sprintf)((0, import_i18n76.__)("(no title %s)"), id); } if (status === "publish") { return (0, import_html_entities5.decodeEntities)(title?.rendered); } return (0, import_i18n76.sprintf)( // translators: 1: title of the menu. 2: status of the menu (draft, pending, etc.). (0, import_i18n76._x)("%1$s (%2$s)", "menu label"), (0, import_html_entities5.decodeEntities)(title?.rendered), status ); } // packages/edit-site/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.mjs var import_jsx_runtime177 = __toESM(require_jsx_runtime(), 1); function SingleNavigationMenu({ navigationMenu, backPath, handleDelete, handleDuplicate, handleSave }) { const menuTitle = navigationMenu?.title?.rendered; return /* @__PURE__ */ (0, import_jsx_runtime177.jsx)( SidebarNavigationScreenWrapper, { actions: /* @__PURE__ */ (0, import_jsx_runtime177.jsx)(import_jsx_runtime177.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime177.jsx)( ScreenNavigationMoreMenu, { menuId: navigationMenu?.id, menuTitle: (0, import_html_entities6.decodeEntities)(menuTitle), onDelete: handleDelete, onSave: handleSave, onDuplicate: handleDuplicate } ) }), backPath, title: buildNavigationLabel( navigationMenu?.title, navigationMenu?.id, navigationMenu?.status ), description: (0, import_i18n77.__)( "Navigation Menus are a curated collection of blocks that allow visitors to get around your site." ), children: /* @__PURE__ */ (0, import_jsx_runtime177.jsx)(NavigationMenuEditor, { navigationMenuId: navigationMenu?.id }) } ); } // packages/edit-site/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.mjs var import_core_data37 = __toESM(require_core_data(), 1); var import_i18n79 = __toESM(require_i18n(), 1); var import_data53 = __toESM(require_data(), 1); var import_notices4 = __toESM(require_notices(), 1); var import_router24 = __toESM(require_router(), 1); // packages/edit-site/build-module/components/sidebar-navigation-screen-navigation-menu/index.mjs var import_core_data36 = __toESM(require_core_data(), 1); var import_components88 = __toESM(require_components(), 1); var import_i18n78 = __toESM(require_i18n(), 1); var import_data52 = __toESM(require_data(), 1); var import_html_entities7 = __toESM(require_html_entities(), 1); var import_router23 = __toESM(require_router(), 1); var import_jsx_runtime178 = __toESM(require_jsx_runtime(), 1); var { useLocation: useLocation21 } = unlock(import_router23.privateApis); var postType = `wp_navigation`; function SidebarNavigationScreenNavigationMenu({ backPath }) { const { params: { postId } } = useLocation21(); const { record: navigationMenu, isResolving } = (0, import_core_data36.useEntityRecord)( "postType", postType, postId ); const { isSaving, isDeleting } = (0, import_data52.useSelect)( (select3) => { const { isSavingEntityRecord, isDeletingEntityRecord } = select3(import_core_data36.store); return { isSaving: isSavingEntityRecord("postType", postType, postId), isDeleting: isDeletingEntityRecord( "postType", postType, postId ) }; }, [postId] ); const isLoading = isResolving || isSaving || isDeleting; const menuTitle = navigationMenu?.title?.rendered || navigationMenu?.slug; const { handleSave, handleDelete, handleDuplicate } = useNavigationMenuHandlers(); const _handleDelete = () => handleDelete(navigationMenu); const _handleSave = (edits) => handleSave(navigationMenu, edits); const _handleDuplicate = () => handleDuplicate(navigationMenu); if (isLoading) { return /* @__PURE__ */ (0, import_jsx_runtime178.jsx)( SidebarNavigationScreenWrapper, { description: (0, import_i18n78.__)( "Navigation Menus are a curated collection of blocks that allow visitors to get around your site." ), backPath, children: /* @__PURE__ */ (0, import_jsx_runtime178.jsx)(import_components88.Spinner, { className: "edit-site-sidebar-navigation-screen-navigation-menus__loading" }) } ); } if (!isLoading && !navigationMenu) { return /* @__PURE__ */ (0, import_jsx_runtime178.jsx)( SidebarNavigationScreenWrapper, { description: (0, import_i18n78.__)("Navigation Menu missing."), backPath } ); } if (!navigationMenu?.content?.raw) { return /* @__PURE__ */ (0, import_jsx_runtime178.jsx)( SidebarNavigationScreenWrapper, { actions: /* @__PURE__ */ (0, import_jsx_runtime178.jsx)( ScreenNavigationMoreMenu, { menuId: navigationMenu?.id, menuTitle: (0, import_html_entities7.decodeEntities)(menuTitle), onDelete: _handleDelete, onSave: _handleSave, onDuplicate: _handleDuplicate } ), backPath, title: buildNavigationLabel( navigationMenu?.title, navigationMenu?.id, navigationMenu?.status ), description: (0, import_i18n78.__)("This Navigation Menu is empty.") } ); } return /* @__PURE__ */ (0, import_jsx_runtime178.jsx)( SingleNavigationMenu, { navigationMenu, backPath, handleDelete: _handleDelete, handleSave: _handleSave, handleDuplicate: _handleDuplicate } ); } // packages/edit-site/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.mjs var { useHistory: useHistory16 } = unlock(import_router24.privateApis); function useDeleteNavigationMenu() { const { deleteEntityRecord } = (0, import_data53.useDispatch)(import_core_data37.store); const { createSuccessNotice, createErrorNotice } = (0, import_data53.useDispatch)(import_notices4.store); const history = useHistory16(); const handleDelete = async (navigationMenu) => { const postId = navigationMenu?.id; try { await deleteEntityRecord( "postType", postType, postId, { force: true }, { throwOnError: true } ); createSuccessNotice( (0, import_i18n79.__)("Navigation Menu successfully deleted."), { type: "snackbar" } ); history.navigate("/navigation"); } catch (error) { createErrorNotice( (0, import_i18n79.sprintf)( /* translators: %s: error message describing why the navigation menu could not be deleted. */ (0, import_i18n79.__)(`Unable to delete Navigation Menu (%s).`), error?.message ), { type: "snackbar" } ); } }; return handleDelete; } function useSaveNavigationMenu() { const { getEditedEntityRecord } = (0, import_data53.useSelect)((select3) => { const { getEditedEntityRecord: getEditedEntityRecordSelector } = select3(import_core_data37.store); return { getEditedEntityRecord: getEditedEntityRecordSelector }; }, []); const { editEntityRecord, __experimentalSaveSpecifiedEntityEdits: saveSpecifiedEntityEdits } = (0, import_data53.useDispatch)(import_core_data37.store); const { createSuccessNotice, createErrorNotice } = (0, import_data53.useDispatch)(import_notices4.store); const handleSave = async (navigationMenu, edits) => { if (!edits) { return; } const postId = navigationMenu?.id; const originalRecord = getEditedEntityRecord( "postType", NAVIGATION_POST_TYPE, postId ); editEntityRecord("postType", postType, postId, edits); const recordPropertiesToSave = Object.keys(edits); try { await saveSpecifiedEntityEdits( "postType", postType, postId, recordPropertiesToSave, { throwOnError: true } ); createSuccessNotice((0, import_i18n79.__)("Renamed Navigation Menu"), { type: "snackbar" }); } catch (error) { editEntityRecord("postType", postType, postId, originalRecord); createErrorNotice( (0, import_i18n79.sprintf)( /* translators: %s: error message describing why the navigation menu could not be renamed. */ (0, import_i18n79.__)(`Unable to rename Navigation Menu (%s).`), error?.message ), { type: "snackbar" } ); } }; return handleSave; } function useDuplicateNavigationMenu() { const history = useHistory16(); const { saveEntityRecord } = (0, import_data53.useDispatch)(import_core_data37.store); const { createSuccessNotice, createErrorNotice } = (0, import_data53.useDispatch)(import_notices4.store); const handleDuplicate = async (navigationMenu) => { const menuTitle = navigationMenu?.title?.rendered || navigationMenu?.slug; try { const savedRecord = await saveEntityRecord( "postType", postType, { title: (0, import_i18n79.sprintf)( /* translators: %s: Navigation menu title */ (0, import_i18n79._x)("%s (Copy)", "navigation menu"), menuTitle ), content: navigationMenu?.content?.raw, status: "publish" }, { throwOnError: true } ); if (savedRecord) { createSuccessNotice((0, import_i18n79.__)("Duplicated Navigation Menu"), { type: "snackbar" }); history.navigate(`/wp_navigation/${savedRecord.id}`); } } catch (error) { createErrorNotice( (0, import_i18n79.sprintf)( /* translators: %s: error message describing why the navigation menu could not be deleted. */ (0, import_i18n79.__)(`Unable to duplicate Navigation Menu (%s).`), error?.message ), { type: "snackbar" } ); } }; return handleDuplicate; } function useNavigationMenuHandlers() { return { handleDelete: useDeleteNavigationMenu(), handleSave: useSaveNavigationMenu(), handleDuplicate: useDuplicateNavigationMenu() }; } // packages/edit-site/build-module/components/sidebar-navigation-screen-navigation-menus/index.mjs var import_jsx_runtime179 = __toESM(require_jsx_runtime(), 1); function buildMenuLabel(title, id, status) { if (!title) { return (0, import_i18n80.sprintf)((0, import_i18n80.__)("(no title %s)"), id); } if (status === "publish") { return (0, import_html_entities8.decodeEntities)(title); } return (0, import_i18n80.sprintf)( // translators: 1: title of the menu. 2: status of the menu (draft, pending, etc.). (0, import_i18n80._x)("%1$s (%2$s)", "menu label"), (0, import_html_entities8.decodeEntities)(title), status ); } function SidebarNavigationScreenNavigationMenus({ backPath }) { const { records: navigationMenus, isResolving: isResolvingNavigationMenus, hasResolved: hasResolvedNavigationMenus } = (0, import_core_data38.useEntityRecords)( "postType", NAVIGATION_POST_TYPE, PRELOADED_NAVIGATION_MENUS_QUERY ); const isLoading = isResolvingNavigationMenus && !hasResolvedNavigationMenus; const { getNavigationFallbackId } = unlock((0, import_data54.useSelect)(import_core_data38.store)); const isCreatingNavigationFallback = (0, import_data54.useSelect)( (select3) => select3(import_core_data38.store).isResolving("getNavigationFallbackId"), [] ); const firstNavigationMenu = navigationMenus?.[0]; if (!firstNavigationMenu && !isResolvingNavigationMenus && hasResolvedNavigationMenus && // Ensure a fallback navigation is created only once !isCreatingNavigationFallback) { getNavigationFallbackId(); } const { handleSave, handleDelete, handleDuplicate } = useNavigationMenuHandlers(); const hasNavigationMenus = !!navigationMenus?.length; if (isLoading) { return /* @__PURE__ */ (0, import_jsx_runtime179.jsx)(SidebarNavigationScreenWrapper, { backPath, children: /* @__PURE__ */ (0, import_jsx_runtime179.jsx)(import_components89.Spinner, { className: "edit-site-sidebar-navigation-screen-navigation-menus__loading" }) }); } if (!isLoading && !hasNavigationMenus) { return /* @__PURE__ */ (0, import_jsx_runtime179.jsx)( SidebarNavigationScreenWrapper, { description: (0, import_i18n80.__)("No Navigation Menus found."), backPath } ); } if (navigationMenus?.length === 1) { return /* @__PURE__ */ (0, import_jsx_runtime179.jsx)( SingleNavigationMenu, { navigationMenu: firstNavigationMenu, backPath, handleDelete: () => handleDelete(firstNavigationMenu), handleDuplicate: () => handleDuplicate(firstNavigationMenu), handleSave: (edits) => handleSave(firstNavigationMenu, edits) } ); } return /* @__PURE__ */ (0, import_jsx_runtime179.jsx)(SidebarNavigationScreenWrapper, { backPath, children: /* @__PURE__ */ (0, import_jsx_runtime179.jsx)(import_components89.__experimentalItemGroup, { className: "edit-site-sidebar-navigation-screen-navigation-menus", children: navigationMenus?.map(({ id, title, status }, index) => /* @__PURE__ */ (0, import_jsx_runtime179.jsx)( NavMenuItem, { postId: id, withChevron: true, icon: navigation_default, children: buildMenuLabel(title?.rendered, index + 1, status) }, id )) }) }); } function SidebarNavigationScreenWrapper({ children, actions, title, description, backPath }) { return /* @__PURE__ */ (0, import_jsx_runtime179.jsx)( SidebarNavigationScreen, { title: title || (0, import_i18n80.__)("Navigation"), actions, description: description || (0, import_i18n80.__)("Manage your Navigation Menus."), backPath, content: children } ); } var NavMenuItem = ({ postId, ...props }) => { return /* @__PURE__ */ (0, import_jsx_runtime179.jsx)( SidebarNavigationItem, { to: `/wp_navigation/${postId}`, ...props } ); }; // packages/edit-site/build-module/components/site-editor-routes/navigation.mjs var import_jsx_runtime180 = __toESM(require_jsx_runtime(), 1); var { useLocation: useLocation22 } = unlock(import_router25.privateApis); function MobileNavigationView() { const { query = {} } = useLocation22(); const { canvas = "view" } = query; return canvas === "edit" ? /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(EditSiteEditor, {}) : /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(SidebarNavigationScreenNavigationMenus, { backPath: "/" }); } var navigationRoute = { name: "navigation", path: "/navigation", areas: { sidebar({ siteData }) { const isBlockTheme = siteData.currentTheme?.is_block_theme; return isBlockTheme ? /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(SidebarNavigationScreenNavigationMenus, { backPath: "/" }) : /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(SidebarNavigationScreenUnsupported, {}); }, preview({ siteData }) { const isBlockTheme = siteData.currentTheme?.is_block_theme; return isBlockTheme ? /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(EditSiteEditor, {}) : void 0; }, mobile({ siteData }) { const isBlockTheme = siteData.currentTheme?.is_block_theme; return isBlockTheme ? /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(MobileNavigationView, {}) : /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(SidebarNavigationScreenUnsupported, {}); } } }; // packages/edit-site/build-module/components/site-editor-routes/navigation-item.mjs var import_router26 = __toESM(require_router(), 1); var import_jsx_runtime181 = __toESM(require_jsx_runtime(), 1); var { useLocation: useLocation23 } = unlock(import_router26.privateApis); function MobileNavigationItemView() { const { query = {} } = useLocation23(); const { canvas = "view" } = query; return canvas === "edit" ? /* @__PURE__ */ (0, import_jsx_runtime181.jsx)(EditSiteEditor, {}) : /* @__PURE__ */ (0, import_jsx_runtime181.jsx)(SidebarNavigationScreenNavigationMenu, { backPath: "/navigation" }); } var navigationItemRoute = { name: "navigation-item", path: "/wp_navigation/:postId", areas: { sidebar({ siteData }) { const isBlockTheme = siteData.currentTheme?.is_block_theme; return isBlockTheme ? /* @__PURE__ */ (0, import_jsx_runtime181.jsx)(SidebarNavigationScreenNavigationMenu, { backPath: "/navigation" }) : /* @__PURE__ */ (0, import_jsx_runtime181.jsx)(SidebarNavigationScreenUnsupported, {}); }, preview({ siteData }) { const isBlockTheme = siteData.currentTheme?.is_block_theme; return isBlockTheme ? /* @__PURE__ */ (0, import_jsx_runtime181.jsx)(EditSiteEditor, {}) : /* @__PURE__ */ (0, import_jsx_runtime181.jsx)(SidebarNavigationScreenUnsupported, {}); }, mobile({ siteData }) { const isBlockTheme = siteData.currentTheme?.is_block_theme; return isBlockTheme ? /* @__PURE__ */ (0, import_jsx_runtime181.jsx)(MobileNavigationItemView, {}) : /* @__PURE__ */ (0, import_jsx_runtime181.jsx)(SidebarNavigationScreenUnsupported, {}); } } }; // packages/edit-site/build-module/components/sidebar-navigation-screen-patterns/index.mjs var import_components90 = __toESM(require_components(), 1); var import_editor27 = __toESM(require_editor(), 1); var import_i18n82 = __toESM(require_i18n(), 1); var import_router27 = __toESM(require_router(), 1); // packages/edit-site/build-module/components/sidebar-navigation-screen-patterns/category-item.mjs var import_jsx_runtime182 = __toESM(require_jsx_runtime(), 1); function CategoryItem({ count, icon, id, isActive, label, type }) { if (!count) { return; } const queryArgs = [`postType=${type}`]; if (id) { queryArgs.push(`categoryId=${id}`); } return /* @__PURE__ */ (0, import_jsx_runtime182.jsx)( SidebarNavigationItem, { icon, suffix: /* @__PURE__ */ (0, import_jsx_runtime182.jsx)("span", { children: count }), "aria-current": isActive ? "true" : void 0, to: `/pattern?${queryArgs.join("&")}`, children: label } ); } // packages/edit-site/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.mjs var import_element67 = __toESM(require_element(), 1); var import_i18n81 = __toESM(require_i18n(), 1); // packages/edit-site/build-module/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.mjs var import_core_data39 = __toESM(require_core_data(), 1); var import_data55 = __toESM(require_data(), 1); function useDefaultPatternCategories() { const blockPatternCategories = (0, import_data55.useSelect)((select3) => { const { getSettings: getSettings7 } = unlock(select3(store)); const settings2 = getSettings7(); return settings2.__experimentalAdditionalBlockPatternCategories ?? settings2.__experimentalBlockPatternCategories; }); const restBlockPatternCategories = (0, import_data55.useSelect)( (select3) => select3(import_core_data39.store).getBlockPatternCategories() ); return [ ...blockPatternCategories || [], ...restBlockPatternCategories || [] ]; } // packages/edit-site/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.mjs var import_core_data40 = __toESM(require_core_data(), 1); var import_data56 = __toESM(require_data(), 1); var import_element65 = __toESM(require_element(), 1); // packages/edit-site/build-module/components/page-patterns/utils.mjs var filterOutDuplicatesByName = (currentItem, index, items) => index === items.findIndex((item) => currentItem.name === item.name); // packages/edit-site/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.mjs function useThemePatterns() { const blockPatterns = (0, import_data56.useSelect)((select3) => { const { getSettings: getSettings7 } = unlock(select3(store)); return getSettings7().__experimentalAdditionalBlockPatterns ?? getSettings7().__experimentalBlockPatterns; }); const restBlockPatterns = (0, import_data56.useSelect)( (select3) => select3(import_core_data40.store).getBlockPatterns() ); const patterns = (0, import_element65.useMemo)( () => [...blockPatterns || [], ...restBlockPatterns || []].filter( (pattern) => !EXCLUDED_PATTERN_SOURCES.includes(pattern.source) ).filter(filterOutDuplicatesByName).filter((pattern) => pattern.inserter !== false), [blockPatterns, restBlockPatterns] ); return patterns; } // packages/edit-site/build-module/components/page-patterns/use-patterns.mjs var import_blocks11 = __toESM(require_blocks(), 1); var import_data57 = __toESM(require_data(), 1); var import_core_data41 = __toESM(require_core_data(), 1); var import_element66 = __toESM(require_element(), 1); // packages/edit-site/build-module/components/page-patterns/search-items.mjs var import_block_editor22 = __toESM(require_block_editor(), 1); var { extractWords, getNormalizedSearchTerms, normalizeString } = unlock( import_block_editor22.privateApis ); var defaultGetName = (item) => { if (item.type === PATTERN_TYPES.user) { return item.slug; } if (item.type === TEMPLATE_PART_POST_TYPE) { return ""; } return item.name || ""; }; var defaultGetTitle = (item) => { if (typeof item.title === "string") { return item.title; } if (item.title && item.title.rendered) { return item.title.rendered; } if (item.title && item.title.raw) { return item.title.raw; } return ""; }; var defaultGetDescription = (item) => { if (item.type === PATTERN_TYPES.user) { return item.excerpt.raw; } return item.description || ""; }; var defaultGetKeywords = (item) => item.keywords || []; var defaultHasCategory = () => false; var removeMatchingTerms = (unmatchedTerms, unprocessedTerms) => { return unmatchedTerms.filter( (term) => !getNormalizedSearchTerms(unprocessedTerms).some( (unprocessedTerm) => unprocessedTerm.includes(term) ) ); }; var searchItems = (items = [], searchInput = "", config2 = {}) => { const normalizedSearchTerms = getNormalizedSearchTerms(searchInput); const onlyFilterByCategory = config2.categoryId !== PATTERN_DEFAULT_CATEGORY && !normalizedSearchTerms.length; const searchRankConfig = { ...config2, onlyFilterByCategory }; const threshold = onlyFilterByCategory ? 0 : 1; const rankedItems = items.map((item) => { return [ item, getItemSearchRank(item, searchInput, searchRankConfig) ]; }).filter(([, rank]) => rank > threshold); if (normalizedSearchTerms.length === 0) { return rankedItems.map(([item]) => item); } rankedItems.sort(([, rank1], [, rank2]) => rank2 - rank1); return rankedItems.map(([item]) => item); }; function getItemSearchRank(item, searchTerm, config2) { const { categoryId, getName = defaultGetName, getTitle = defaultGetTitle, getDescription = defaultGetDescription, getKeywords = defaultGetKeywords, hasCategory = defaultHasCategory, onlyFilterByCategory } = config2; let rank = categoryId === PATTERN_DEFAULT_CATEGORY || categoryId === TEMPLATE_PART_ALL_AREAS_CATEGORY || categoryId === PATTERN_USER_CATEGORY && item.type === PATTERN_TYPES.user || hasCategory(item, categoryId) ? 1 : 0; if (!rank || onlyFilterByCategory) { return rank; } const name2 = getName(item); const title = getTitle(item); const description = getDescription(item); const keywords = getKeywords(item); const normalizedSearchInput = normalizeString(searchTerm); const normalizedTitle = normalizeString(title); if (normalizedSearchInput === normalizedTitle) { rank += 30; } else if (normalizedTitle.startsWith(normalizedSearchInput)) { rank += 20; } else { const terms = [name2, title, description, ...keywords].join(" "); const normalizedSearchTerms = extractWords(normalizedSearchInput); const unmatchedTerms = removeMatchingTerms( normalizedSearchTerms, terms ); if (unmatchedTerms.length === 0) { rank += 10; } } return rank; } // packages/edit-site/build-module/components/page-patterns/use-patterns.mjs var EMPTY_PATTERN_LIST = []; var selectTemplateParts = (0, import_data57.createSelector)( (select3, categoryId, search = "") => { const { getEntityRecords, getCurrentTheme, isResolving: isResolvingSelector } = select3(import_core_data41.store); const query = { per_page: -1 }; const templateParts = getEntityRecords("postType", TEMPLATE_PART_POST_TYPE, query) ?? EMPTY_PATTERN_LIST; const knownAreas = getCurrentTheme()?.default_template_part_areas || []; const templatePartAreas = knownAreas.map((area) => area.area); const templatePartHasCategory = (item, category) => { if (category !== TEMPLATE_PART_AREA_DEFAULT_CATEGORY) { return item.area === category; } return item.area === category || !templatePartAreas.includes(item.area); }; const isResolving = isResolvingSelector("getEntityRecords", [ "postType", TEMPLATE_PART_POST_TYPE, query ]); const patterns = searchItems(templateParts, search, { categoryId, hasCategory: templatePartHasCategory }); return { patterns, isResolving }; }, (select3) => [ select3(import_core_data41.store).getEntityRecords( "postType", TEMPLATE_PART_POST_TYPE, { per_page: -1 } ), select3(import_core_data41.store).isResolving("getEntityRecords", [ "postType", TEMPLATE_PART_POST_TYPE, { per_page: -1 } ]), select3(import_core_data41.store).getCurrentTheme()?.default_template_part_areas ] ); var selectThemePatterns = (0, import_data57.createSelector)( (select3) => { const { getSettings: getSettings7 } = unlock(select3(store)); const { isResolving: isResolvingSelector } = select3(import_core_data41.store); const settings2 = getSettings7(); const blockPatterns = settings2.__experimentalAdditionalBlockPatterns ?? settings2.__experimentalBlockPatterns; const restBlockPatterns = select3(import_core_data41.store).getBlockPatterns(); const patterns = [ ...blockPatterns || [], ...restBlockPatterns || [] ].filter( (pattern) => !EXCLUDED_PATTERN_SOURCES.includes(pattern.source) ).filter(filterOutDuplicatesByName).filter((pattern) => pattern.inserter !== false).map((pattern) => ({ ...pattern, keywords: pattern.keywords || [], type: PATTERN_TYPES.theme, blocks: (0, import_blocks11.parse)(pattern.content, { __unstableSkipMigrationLogs: true }) })); return { patterns, isResolving: isResolvingSelector("getBlockPatterns") }; }, (select3) => [ select3(import_core_data41.store).getBlockPatterns(), select3(import_core_data41.store).isResolving("getBlockPatterns"), unlock(select3(store)).getSettings() ] ); var selectPatterns = (0, import_data57.createSelector)( (select3, categoryId, syncStatus, search = "") => { const { patterns: themePatterns, isResolving: isResolvingThemePatterns } = selectThemePatterns(select3); const { patterns: userPatterns, isResolving: isResolvingUserPatterns, categories: userPatternCategories } = selectUserPatterns(select3); let patterns = [ ...themePatterns || [], ...userPatterns || [] ]; if (syncStatus) { patterns = patterns.filter((pattern) => { return pattern.type === PATTERN_TYPES.user ? (pattern.wp_pattern_sync_status || PATTERN_SYNC_TYPES.full) === syncStatus : syncStatus === PATTERN_SYNC_TYPES.unsynced; }); } if (categoryId) { patterns = searchItems(patterns, search, { categoryId, hasCategory: (item, currentCategory) => { if (item.type === PATTERN_TYPES.user) { return item.wp_pattern_category?.some( (catId) => userPatternCategories.find( (cat) => cat.id === catId )?.slug === currentCategory ); } return item.categories?.includes(currentCategory); } }); } else { patterns = searchItems(patterns, search, { hasCategory: (item) => { if (item.type === PATTERN_TYPES.user) { return userPatternCategories?.length && (!item.wp_pattern_category?.length || !item.wp_pattern_category?.some( (catId) => userPatternCategories.find( (cat) => cat.id === catId ) )); } return !item.hasOwnProperty("categories"); } }); } return { patterns, isResolving: isResolvingThemePatterns || isResolvingUserPatterns }; }, (select3) => [ selectThemePatterns(select3), selectUserPatterns(select3) ] ); var selectUserPatterns = (0, import_data57.createSelector)( (select3, syncStatus, search = "") => { const { getEntityRecords, isResolving: isResolvingSelector, getUserPatternCategories } = select3(import_core_data41.store); const query = { per_page: -1 }; const patternPosts = getEntityRecords( "postType", PATTERN_TYPES.user, query ); const userPatternCategories = getUserPatternCategories(); const categories = /* @__PURE__ */ new Map(); userPatternCategories.forEach( (userCategory) => categories.set(userCategory.id, userCategory) ); let patterns = patternPosts ?? EMPTY_PATTERN_LIST; const isResolving = isResolvingSelector("getEntityRecords", [ "postType", PATTERN_TYPES.user, query ]); if (syncStatus) { patterns = patterns.filter( (pattern) => pattern.wp_pattern_sync_status || PATTERN_SYNC_TYPES.full === syncStatus ); } patterns = searchItems(patterns, search, { // We exit user pattern retrieval early if we aren't in the // catch-all category for user created patterns, so it has // to be in the category. hasCategory: () => true }); return { patterns, isResolving, categories: userPatternCategories }; }, (select3) => [ select3(import_core_data41.store).getEntityRecords("postType", PATTERN_TYPES.user, { per_page: -1 }), select3(import_core_data41.store).isResolving("getEntityRecords", [ "postType", PATTERN_TYPES.user, { per_page: -1 } ]), select3(import_core_data41.store).getUserPatternCategories() ] ); function useAugmentPatternsWithPermissions(patterns) { const idsAndTypes = (0, import_element66.useMemo)( () => patterns?.filter((record) => record.type !== PATTERN_TYPES.theme).map((record) => [record.type, record.id]) ?? [], [patterns] ); const permissions = (0, import_data57.useSelect)( (select3) => { const { getEntityRecordPermissions } = unlock( select3(import_core_data41.store) ); return idsAndTypes.reduce((acc, [type, id]) => { acc[id] = getEntityRecordPermissions("postType", type, id); return acc; }, {}); }, [idsAndTypes] ); return (0, import_element66.useMemo)( () => patterns?.map((record) => ({ ...record, permissions: permissions?.[record.id] ?? {} })) ?? [], [patterns, permissions] ); } var usePatterns = (postType2, categoryId, { search = "", syncStatus } = {}) => { return (0, import_data57.useSelect)( (select3) => { if (postType2 === TEMPLATE_PART_POST_TYPE) { return selectTemplateParts(select3, categoryId, search); } else if (postType2 === PATTERN_TYPES.user && !!categoryId) { const appliedCategory = categoryId === "uncategorized" ? "" : categoryId; return selectPatterns( select3, appliedCategory, syncStatus, search ); } else if (postType2 === PATTERN_TYPES.user) { return selectUserPatterns(select3, syncStatus, search); } return { patterns: EMPTY_PATTERN_LIST, isResolving: false }; }, [categoryId, postType2, search, syncStatus] ); }; var use_patterns_default = usePatterns; // packages/edit-site/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.mjs function usePatternCategories() { const defaultCategories = useDefaultPatternCategories(); defaultCategories.push({ name: TEMPLATE_PART_AREA_DEFAULT_CATEGORY, label: (0, import_i18n81.__)("Uncategorized") }); const themePatterns = useThemePatterns(); const { patterns: userPatterns, categories: userPatternCategories } = use_patterns_default(PATTERN_TYPES.user); const patternCategories = (0, import_element67.useMemo)(() => { const categoryMap = {}; const categoriesWithCounts = []; defaultCategories.forEach((category) => { if (!categoryMap[category.name]) { categoryMap[category.name] = { ...category, count: 0 }; } }); userPatternCategories.forEach((category) => { if (!categoryMap[category.name]) { categoryMap[category.name] = { ...category, count: 0 }; } }); themePatterns.forEach((pattern) => { pattern.categories?.forEach((category) => { if (categoryMap[category]) { categoryMap[category].count += 1; } }); if (!pattern.categories?.length) { categoryMap.uncategorized.count += 1; } }); userPatterns.forEach((pattern) => { pattern.wp_pattern_category?.forEach((catId) => { const category = userPatternCategories.find( (cat) => cat.id === catId )?.name; if (categoryMap[category]) { categoryMap[category].count += 1; } }); if (!pattern.wp_pattern_category?.length || !pattern.wp_pattern_category?.some( (catId) => userPatternCategories.find((cat) => cat.id === catId) )) { categoryMap.uncategorized.count += 1; } }); [...defaultCategories, ...userPatternCategories].forEach( (category) => { if (categoryMap[category.name].count && !categoriesWithCounts.find( (cat) => cat.name === category.name )) { categoriesWithCounts.push(categoryMap[category.name]); } } ); const sortedCategories = categoriesWithCounts.sort( (a2, b2) => a2.label.localeCompare(b2.label) ); sortedCategories.unshift({ name: PATTERN_USER_CATEGORY, label: (0, import_i18n81.__)("My patterns"), count: userPatterns.length }); sortedCategories.unshift({ name: PATTERN_DEFAULT_CATEGORY, label: (0, import_i18n81.__)("All patterns"), description: (0, import_i18n81.__)("A list of all patterns from all sources."), count: themePatterns.length + userPatterns.length }); return sortedCategories; }, [ defaultCategories, themePatterns, userPatternCategories, userPatterns ]); return { patternCategories, hasPatterns: !!patternCategories.length }; } // packages/edit-site/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.mjs var import_core_data42 = __toESM(require_core_data(), 1); var import_data58 = __toESM(require_data(), 1); var import_block_library2 = __toESM(require_block_library(), 1); var { NAVIGATION_OVERLAY_TEMPLATE_PART_AREA } = unlock( import_block_library2.privateApis ); var useTemplatePartsGroupedByArea = (items) => { const allItems = items || []; const templatePartAreas = (0, import_data58.useSelect)( (select3) => select3(import_core_data42.store).getCurrentTheme()?.default_template_part_areas || [], [] ); const knownAreas = { header: {}, footer: {}, sidebar: {}, uncategorized: {}, [NAVIGATION_OVERLAY_TEMPLATE_PART_AREA]: {} }; templatePartAreas.forEach( (templatePartArea) => knownAreas[templatePartArea.area] = { ...templatePartArea, templateParts: [] } ); const groupedByArea = allItems.reduce((accumulator, item) => { const key = accumulator[item.area] ? item.area : TEMPLATE_PART_AREA_DEFAULT_CATEGORY; accumulator[key]?.templateParts?.push(item); return accumulator; }, knownAreas); return groupedByArea; }; function useTemplatePartAreas() { const { records: templateParts, isResolving: isLoading } = (0, import_core_data42.useEntityRecords)( "postType", TEMPLATE_PART_POST_TYPE, { per_page: -1 } ); return { hasTemplateParts: templateParts ? !!templateParts.length : false, isLoading, templatePartAreas: useTemplatePartsGroupedByArea(templateParts) }; } // packages/edit-site/build-module/components/sidebar-navigation-screen-patterns/index.mjs var import_jsx_runtime183 = __toESM(require_jsx_runtime(), 1); var { useLocation: useLocation24 } = unlock(import_router27.privateApis); function CategoriesGroup({ templatePartAreas, patternCategories, currentCategory, currentType }) { const [allPatterns, ...otherPatterns] = patternCategories; return /* @__PURE__ */ (0, import_jsx_runtime183.jsxs)(import_components90.__experimentalItemGroup, { className: "edit-site-sidebar-navigation-screen-patterns__group", children: [ /* @__PURE__ */ (0, import_jsx_runtime183.jsx)( CategoryItem, { count: Object.values(templatePartAreas).map(({ templateParts }) => templateParts?.length || 0).reduce((acc, val) => acc + val, 0), icon: (0, import_editor27.getTemplatePartIcon)(), label: (0, import_i18n82.__)("All template parts"), id: TEMPLATE_PART_ALL_AREAS_CATEGORY, type: TEMPLATE_PART_POST_TYPE, isActive: currentCategory === TEMPLATE_PART_ALL_AREAS_CATEGORY && currentType === TEMPLATE_PART_POST_TYPE }, "all" ), Object.entries(templatePartAreas).map( ([area, { label, templateParts, icon }]) => /* @__PURE__ */ (0, import_jsx_runtime183.jsx)( CategoryItem, { count: templateParts?.length, icon: (0, import_editor27.getTemplatePartIcon)(icon), label, id: area, type: TEMPLATE_PART_POST_TYPE, isActive: currentCategory === area && currentType === TEMPLATE_PART_POST_TYPE }, area ) ), /* @__PURE__ */ (0, import_jsx_runtime183.jsx)("div", { className: "edit-site-sidebar-navigation-screen-patterns__divider" }), allPatterns && /* @__PURE__ */ (0, import_jsx_runtime183.jsx)( CategoryItem, { count: allPatterns.count, label: allPatterns.label, icon: file_default, id: allPatterns.name, type: PATTERN_TYPES.user, isActive: currentCategory === `${allPatterns.name}` && currentType === PATTERN_TYPES.user }, allPatterns.name ), otherPatterns.map((category) => /* @__PURE__ */ (0, import_jsx_runtime183.jsx)( CategoryItem, { count: category.count, label: category.label, icon: file_default, id: category.name, type: PATTERN_TYPES.user, isActive: currentCategory === `${category.name}` && currentType === PATTERN_TYPES.user }, category.name )) ] }); } function SidebarNavigationScreenPatterns({ backPath }) { const { query: { postType: postType2 = "wp_block", categoryId } } = useLocation24(); const currentCategory = categoryId || (postType2 === PATTERN_TYPES.user ? PATTERN_DEFAULT_CATEGORY : TEMPLATE_PART_ALL_AREAS_CATEGORY); const { templatePartAreas, hasTemplateParts, isLoading } = useTemplatePartAreas(); const { patternCategories, hasPatterns } = usePatternCategories(); return /* @__PURE__ */ (0, import_jsx_runtime183.jsx)( SidebarNavigationScreen, { title: (0, import_i18n82.__)("Patterns"), description: (0, import_i18n82.__)( "Manage what patterns are available when editing the site." ), isRoot: !backPath, backPath, content: /* @__PURE__ */ (0, import_jsx_runtime183.jsxs)(import_jsx_runtime183.Fragment, { children: [ isLoading && (0, import_i18n82.__)("Loading items\u2026"), !isLoading && /* @__PURE__ */ (0, import_jsx_runtime183.jsxs)(import_jsx_runtime183.Fragment, { children: [ !hasTemplateParts && !hasPatterns && /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(import_components90.__experimentalItemGroup, { className: "edit-site-sidebar-navigation-screen-patterns__group", children: /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(import_components90.__experimentalItem, { children: (0, import_i18n82.__)("No items found") }) }), /* @__PURE__ */ (0, import_jsx_runtime183.jsx)( CategoriesGroup, { templatePartAreas, patternCategories, currentCategory, currentType: postType2 } ) ] }) ] }) } ); } // packages/edit-site/build-module/components/page-patterns/index.mjs var import_i18n139 = __toESM(require_i18n(), 1); var import_element141 = __toESM(require_element(), 1); var import_block_editor25 = __toESM(require_block_editor(), 1); // packages/dataviews/build-module/dataviews/index.mjs var import_element121 = __toESM(require_element(), 1); var import_compose23 = __toESM(require_compose(), 1); // packages/dataviews/build-module/components/dataviews-context/index.mjs var import_element68 = __toESM(require_element(), 1); // packages/dataviews/build-module/constants.mjs var import_i18n83 = __toESM(require_i18n(), 1); var OPERATOR_IS_ANY2 = "isAny"; var OPERATOR_IS_NONE2 = "isNone"; var OPERATOR_IS_ALL = "isAll"; var OPERATOR_IS_NOT_ALL = "isNotAll"; var OPERATOR_BETWEEN = "between"; var OPERATOR_IN_THE_PAST = "inThePast"; var OPERATOR_OVER = "over"; var OPERATOR_IS2 = "is"; var OPERATOR_IS_NOT = "isNot"; var OPERATOR_LESS_THAN = "lessThan"; var OPERATOR_GREATER_THAN = "greaterThan"; var OPERATOR_LESS_THAN_OR_EQUAL = "lessThanOrEqual"; var OPERATOR_GREATER_THAN_OR_EQUAL = "greaterThanOrEqual"; var OPERATOR_BEFORE2 = "before"; var OPERATOR_AFTER2 = "after"; var OPERATOR_BEFORE_INC = "beforeInc"; var OPERATOR_AFTER_INC = "afterInc"; var OPERATOR_CONTAINS = "contains"; var OPERATOR_NOT_CONTAINS = "notContains"; var OPERATOR_STARTS_WITH = "startsWith"; var OPERATOR_ON = "on"; var OPERATOR_NOT_ON = "notOn"; var SORTING_DIRECTIONS = ["asc", "desc"]; var sortArrows = { asc: "\u2191", desc: "\u2193" }; var sortValues = { asc: "ascending", desc: "descending" }; var sortLabels = { asc: (0, import_i18n83.__)("Sort ascending"), desc: (0, import_i18n83.__)("Sort descending") }; var sortIcons = { asc: arrow_up_default, desc: arrow_down_default }; var LAYOUT_TABLE2 = "table"; var LAYOUT_GRID2 = "grid"; var LAYOUT_LIST2 = "list"; var LAYOUT_ACTIVITY = "activity"; var LAYOUT_PICKER_GRID = "pickerGrid"; var LAYOUT_PICKER_TABLE = "pickerTable"; // packages/dataviews/build-module/components/dataviews-context/index.mjs var DataViewsContext = (0, import_element68.createContext)({ view: { type: LAYOUT_TABLE2 }, onChangeView: () => { }, fields: [], data: [], paginationInfo: { totalItems: 0, totalPages: 0 }, selection: [], onChangeSelection: () => { }, setOpenedFilter: () => { }, openedFilter: null, getItemId: (item) => item.id, isItemClickable: () => true, renderItemLink: void 0, containerWidth: 0, containerRef: (0, import_element68.createRef)(), resizeObserverRef: () => { }, defaultLayouts: { list: {}, grid: {}, table: {} }, filters: [], isShowingFilter: false, setIsShowingFilter: () => { }, hasInitiallyLoaded: false, hasInfiniteScrollHandler: false, config: { perPageSizes: [] } }); DataViewsContext.displayName = "DataViewsContext"; var dataviews_context_default = DataViewsContext; // packages/dataviews/build-module/components/dataviews-layouts/index.mjs var import_i18n103 = __toESM(require_i18n(), 1); // packages/dataviews/build-module/components/dataviews-layouts/table/index.mjs var import_i18n91 = __toESM(require_i18n(), 1); var import_components96 = __toESM(require_components(), 1); var import_element76 = __toESM(require_element(), 1); var import_keycodes6 = __toESM(require_keycodes(), 1); // packages/dataviews/build-module/components/dataviews-selection-checkbox/index.mjs var import_components91 = __toESM(require_components(), 1); var import_i18n84 = __toESM(require_i18n(), 1); var import_jsx_runtime184 = __toESM(require_jsx_runtime(), 1); function DataViewsSelectionCheckbox({ selection, onChangeSelection, item, getItemId: getItemId2, titleField, disabled, ...extraProps }) { const id = getItemId2(item); const checked = !disabled && selection.includes(id); const selectionLabel = titleField?.getValue?.({ item }) || (0, import_i18n84.__)("(no title)"); return /* @__PURE__ */ (0, import_jsx_runtime184.jsx)( import_components91.CheckboxControl, { className: "dataviews-selection-checkbox", "aria-label": selectionLabel, "aria-disabled": disabled, checked, onChange: () => { if (disabled) { return; } onChangeSelection( selection.includes(id) ? selection.filter((itemId) => id !== itemId) : [...selection, id] ); }, ...extraProps } ); } // packages/dataviews/build-module/components/dataviews-item-actions/index.mjs var import_components92 = __toESM(require_components(), 1); var import_i18n85 = __toESM(require_i18n(), 1); var import_element69 = __toESM(require_element(), 1); var import_data59 = __toESM(require_data(), 1); var import_compose12 = __toESM(require_compose(), 1); // packages/dataviews/build-module/lock-unlock.mjs var import_private_apis3 = __toESM(require_private_apis(), 1); var { lock: lock3, unlock: unlock3 } = (0, import_private_apis3.__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/dataviews" ); // packages/dataviews/build-module/components/dataviews-item-actions/index.mjs var import_jsx_runtime185 = __toESM(require_jsx_runtime(), 1); var { Menu: Menu5, kebabCase: kebabCase4 } = unlock3(import_components92.privateApis); function ButtonTrigger({ action, onClick, items, variant }) { const label = typeof action.label === "string" ? action.label : action.label(items); return /* @__PURE__ */ (0, import_jsx_runtime185.jsx)( import_components92.Button, { disabled: !!action.disabled, accessibleWhenDisabled: true, size: "compact", variant, onClick, children: label } ); } function MenuItemTrigger({ action, onClick, items }) { const label = typeof action.label === "string" ? action.label : action.label(items); return /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(Menu5.Item, { disabled: action.disabled, onClick, children: /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(Menu5.ItemLabel, { children: label }) }); } function ActionModal({ action, items, closeModal }) { const label = typeof action.label === "string" ? action.label : action.label(items); const modalHeader = typeof action.modalHeader === "function" ? action.modalHeader(items) : action.modalHeader; return /* @__PURE__ */ (0, import_jsx_runtime185.jsx)( import_components92.Modal, { title: modalHeader || label, __experimentalHideHeader: !!action.hideModalHeader, onRequestClose: closeModal, focusOnMount: action.modalFocusOnMount ?? true, size: action.modalSize || "medium", overlayClassName: `dataviews-action-modal dataviews-action-modal__${kebabCase4( action.id )}`, children: /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(action.RenderModal, { items, closeModal }) } ); } function ActionsMenuGroup({ actions, item, registry, setActiveModalAction }) { const { primaryActions, regularActions } = (0, import_element69.useMemo)(() => { return actions.reduce( (acc, action) => { (action.isPrimary ? acc.primaryActions : acc.regularActions).push(action); return acc; }, { primaryActions: [], regularActions: [] } ); }, [actions]); const renderActionGroup = (actionList) => actionList.map((action) => /* @__PURE__ */ (0, import_jsx_runtime185.jsx)( MenuItemTrigger, { action, onClick: () => { if ("RenderModal" in action) { setActiveModalAction(action); return; } action.callback([item], { registry }); }, items: [item] }, action.id )); return /* @__PURE__ */ (0, import_jsx_runtime185.jsxs)(Menu5.Group, { children: [ renderActionGroup(primaryActions), renderActionGroup(regularActions) ] }); } function ItemActions({ item, actions, isCompact }) { const registry = (0, import_data59.useRegistry)(); const { primaryActions, eligibleActions } = (0, import_element69.useMemo)(() => { const _eligibleActions = actions.filter( (action) => !action.isEligible || action.isEligible(item) ); const _primaryActions = _eligibleActions.filter( (action) => action.isPrimary ); return { primaryActions: _primaryActions, eligibleActions: _eligibleActions }; }, [actions, item]); const isMobileViewport = (0, import_compose12.useViewportMatch)("medium", "<"); if (isCompact) { return /* @__PURE__ */ (0, import_jsx_runtime185.jsx)( CompactItemActions, { item, actions: eligibleActions, isSmall: true, registry } ); } return /* @__PURE__ */ (0, import_jsx_runtime185.jsxs)( Stack, { direction: "row", justify: "flex-end", className: "dataviews-item-actions", style: { flexShrink: 0, width: "auto" }, children: [ /* @__PURE__ */ (0, import_jsx_runtime185.jsx)( PrimaryActions, { item, actions: primaryActions, registry } ), (primaryActions.length < eligibleActions.length || // Since we hide primary actions on mobile, we need to show the menu // there if there are any actions at all. isMobileViewport) && /* @__PURE__ */ (0, import_jsx_runtime185.jsx)( CompactItemActions, { item, actions: eligibleActions, registry } ) ] } ); } function CompactItemActions({ item, actions, isSmall, registry }) { const [activeModalAction, setActiveModalAction] = (0, import_element69.useState)( null ); return /* @__PURE__ */ (0, import_jsx_runtime185.jsxs)(import_jsx_runtime185.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime185.jsxs)(Menu5, { placement: "bottom-end", children: [ /* @__PURE__ */ (0, import_jsx_runtime185.jsx)( Menu5.TriggerButton, { render: /* @__PURE__ */ (0, import_jsx_runtime185.jsx)( import_components92.Button, { size: isSmall ? "small" : "compact", icon: more_vertical_default, label: (0, import_i18n85.__)("Actions"), accessibleWhenDisabled: true, disabled: !actions.length, className: "dataviews-all-actions-button" } ) } ), /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(Menu5.Popover, { children: /* @__PURE__ */ (0, import_jsx_runtime185.jsx)( ActionsMenuGroup, { actions, item, registry, setActiveModalAction } ) }) ] }), !!activeModalAction && /* @__PURE__ */ (0, import_jsx_runtime185.jsx)( ActionModal, { action: activeModalAction, items: [item], closeModal: () => setActiveModalAction(null) } ) ] }); } function PrimaryActions({ item, actions, registry, buttonVariant }) { const [activeModalAction, setActiveModalAction] = (0, import_element69.useState)(null); const isMobileViewport = (0, import_compose12.useViewportMatch)("medium", "<"); if (isMobileViewport) { return null; } if (!Array.isArray(actions) || actions.length === 0) { return null; } return /* @__PURE__ */ (0, import_jsx_runtime185.jsxs)(import_jsx_runtime185.Fragment, { children: [ actions.map((action) => /* @__PURE__ */ (0, import_jsx_runtime185.jsx)( ButtonTrigger, { action, onClick: () => { if ("RenderModal" in action) { setActiveModalAction(action); return; } action.callback([item], { registry }); }, items: [item], variant: buttonVariant }, action.id )), !!activeModalAction && /* @__PURE__ */ (0, import_jsx_runtime185.jsx)( ActionModal, { action: activeModalAction, items: [item], closeModal: () => setActiveModalAction(null) } ) ] }); } // packages/dataviews/build-module/components/dataviews-bulk-actions/index.mjs var import_components93 = __toESM(require_components(), 1); var import_i18n87 = __toESM(require_i18n(), 1); var import_element70 = __toESM(require_element(), 1); var import_data60 = __toESM(require_data(), 1); var import_compose13 = __toESM(require_compose(), 1); // packages/dataviews/build-module/utils/get-footer-message.mjs var import_i18n86 = __toESM(require_i18n(), 1); function getFooterMessage(selectionCount, itemsCount, totalItems) { if (selectionCount > 0) { return (0, import_i18n86.sprintf)( /* translators: %d: number of items. */ (0, import_i18n86._n)("%d Item selected", "%d Items selected", selectionCount), selectionCount ); } if (totalItems > itemsCount) { return (0, import_i18n86.sprintf)( /* translators: %1$d: number of items. %2$d: total number of items. */ (0, import_i18n86._n)("%1$d of %2$d Item", "%1$d of %2$d Items", totalItems), itemsCount, totalItems ); } return (0, import_i18n86.sprintf)( /* translators: %d: number of items. */ (0, import_i18n86._n)("%d Item", "%d Items", itemsCount), itemsCount ); } // packages/dataviews/build-module/components/dataviews-bulk-actions/index.mjs var import_jsx_runtime186 = __toESM(require_jsx_runtime(), 1); function ActionWithModal({ action, items, ActionTriggerComponent }) { const [isModalOpen, setIsModalOpen] = (0, import_element70.useState)(false); const actionTriggerProps = { action, onClick: () => { setIsModalOpen(true); }, items }; return /* @__PURE__ */ (0, import_jsx_runtime186.jsxs)(import_jsx_runtime186.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(ActionTriggerComponent, { ...actionTriggerProps }), isModalOpen && /* @__PURE__ */ (0, import_jsx_runtime186.jsx)( ActionModal, { action, items, closeModal: () => setIsModalOpen(false) } ) ] }); } function useHasAPossibleBulkAction(actions, item) { return (0, import_element70.useMemo)(() => { return actions.some((action) => { return action.supportsBulk && (!action.isEligible || action.isEligible(item)); }); }, [actions, item]); } function useSomeItemHasAPossibleBulkAction(actions, data) { return (0, import_element70.useMemo)(() => { return data.some((item) => { return actions.some((action) => { return action.supportsBulk && (!action.isEligible || action.isEligible(item)); }); }); }, [actions, data]); } function BulkSelectionCheckbox({ selection, onChangeSelection, data, actions, getItemId: getItemId2 }) { const selectableItems = (0, import_element70.useMemo)(() => { return data.filter((item) => { return actions.some( (action) => action.supportsBulk && (!action.isEligible || action.isEligible(item)) ); }); }, [data, actions]); const selectedItems = data.filter( (item) => selection.includes(getItemId2(item)) && selectableItems.includes(item) ); const areAllSelected = selectedItems.length === selectableItems.length; return /* @__PURE__ */ (0, import_jsx_runtime186.jsx)( import_components93.CheckboxControl, { className: "dataviews-view-table-selection-checkbox", checked: areAllSelected, indeterminate: !areAllSelected && !!selectedItems.length, onChange: () => { if (areAllSelected) { onChangeSelection([]); } else { onChangeSelection( selectableItems.map((item) => getItemId2(item)) ); } }, "aria-label": areAllSelected ? (0, import_i18n87.__)("Deselect all") : (0, import_i18n87.__)("Select all") } ); } function ActionTrigger({ action, onClick, isBusy, items }) { const label = typeof action.label === "string" ? action.label : action.label(items); const isMobile = (0, import_compose13.useViewportMatch)("medium", "<"); if (isMobile) { return /* @__PURE__ */ (0, import_jsx_runtime186.jsx)( import_components93.Button, { disabled: isBusy, accessibleWhenDisabled: true, label, icon: action.icon, size: "compact", onClick, isBusy } ); } return /* @__PURE__ */ (0, import_jsx_runtime186.jsx)( import_components93.Button, { disabled: isBusy, accessibleWhenDisabled: true, size: "compact", onClick, isBusy, children: label } ); } var EMPTY_ARRAY5 = []; function ActionButton({ action, selectedItems, actionInProgress, setActionInProgress }) { const registry = (0, import_data60.useRegistry)(); const selectedEligibleItems = (0, import_element70.useMemo)(() => { return selectedItems.filter((item) => { return !action.isEligible || action.isEligible(item); }); }, [action, selectedItems]); if ("RenderModal" in action) { return /* @__PURE__ */ (0, import_jsx_runtime186.jsx)( ActionWithModal, { action, items: selectedEligibleItems, ActionTriggerComponent: ActionTrigger }, action.id ); } return /* @__PURE__ */ (0, import_jsx_runtime186.jsx)( ActionTrigger, { action, onClick: async () => { setActionInProgress(action.id); await action.callback(selectedItems, { registry }); setActionInProgress(null); }, items: selectedEligibleItems, isBusy: actionInProgress === action.id }, action.id ); } function renderFooterContent(data, actions, getItemId2, selection, actionsToShow, selectedItems, actionInProgress, setActionInProgress, onChangeSelection, paginationInfo) { const message2 = getFooterMessage( selection.length, data.length, paginationInfo.totalItems ); return /* @__PURE__ */ (0, import_jsx_runtime186.jsxs)( Stack, { direction: "row", className: "dataviews-bulk-actions-footer__container", gap: "md", align: "center", children: [ /* @__PURE__ */ (0, import_jsx_runtime186.jsx)( BulkSelectionCheckbox, { selection, onChangeSelection, data, actions, getItemId: getItemId2 } ), /* @__PURE__ */ (0, import_jsx_runtime186.jsx)("span", { className: "dataviews-bulk-actions-footer__item-count", children: message2 }), /* @__PURE__ */ (0, import_jsx_runtime186.jsxs)( Stack, { direction: "row", className: "dataviews-bulk-actions-footer__action-buttons", gap: "xs", children: [ actionsToShow.map((action) => { return /* @__PURE__ */ (0, import_jsx_runtime186.jsx)( ActionButton, { action, selectedItems, actionInProgress, setActionInProgress }, action.id ); }), selectedItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime186.jsx)( import_components93.Button, { icon: close_small_default, showTooltip: true, tooltipPosition: "top", size: "compact", label: (0, import_i18n87.__)("Cancel"), disabled: !!actionInProgress, accessibleWhenDisabled: false, onClick: () => { onChangeSelection(EMPTY_ARRAY5); } } ) ] } ) ] } ); } function FooterContent({ selection, actions, onChangeSelection, data, getItemId: getItemId2, paginationInfo }) { const [actionInProgress, setActionInProgress] = (0, import_element70.useState)( null ); const footerContentRef = (0, import_element70.useRef)(void 0); const isMobile = (0, import_compose13.useViewportMatch)("medium", "<"); const bulkActions = (0, import_element70.useMemo)( () => actions.filter((action) => action.supportsBulk), [actions] ); const selectableItems = (0, import_element70.useMemo)(() => { return data.filter((item) => { return bulkActions.some( (action) => !action.isEligible || action.isEligible(item) ); }); }, [data, bulkActions]); const selectedItems = (0, import_element70.useMemo)(() => { return data.filter( (item) => selection.includes(getItemId2(item)) && selectableItems.includes(item) ); }, [selection, data, getItemId2, selectableItems]); const actionsToShow = (0, import_element70.useMemo)( () => actions.filter((action) => { return action.supportsBulk && (!isMobile || action.icon) && selectedItems.some( (item) => !action.isEligible || action.isEligible(item) ); }), [actions, selectedItems, isMobile] ); if (!actionInProgress) { if (footerContentRef.current) { footerContentRef.current = void 0; } return renderFooterContent( data, actions, getItemId2, selection, actionsToShow, selectedItems, actionInProgress, setActionInProgress, onChangeSelection, paginationInfo ); } else if (!footerContentRef.current) { footerContentRef.current = renderFooterContent( data, actions, getItemId2, selection, actionsToShow, selectedItems, actionInProgress, setActionInProgress, onChangeSelection, paginationInfo ); } return footerContentRef.current; } function BulkActionsFooter() { const { data, selection, actions = EMPTY_ARRAY5, onChangeSelection, getItemId: getItemId2, paginationInfo } = (0, import_element70.useContext)(dataviews_context_default); return /* @__PURE__ */ (0, import_jsx_runtime186.jsx)( FooterContent, { selection, onChangeSelection, data, actions, getItemId: getItemId2, paginationInfo } ); } // packages/dataviews/build-module/components/dataviews-layouts/table/column-header-menu.mjs var import_i18n88 = __toESM(require_i18n(), 1); var import_components94 = __toESM(require_components(), 1); var import_element71 = __toESM(require_element(), 1); // packages/dataviews/build-module/utils/get-hideable-fields.mjs function getHideableFields(view, fields) { const togglableFields = [ view?.titleField, view?.mediaField, view?.descriptionField ].filter(Boolean); return fields.filter( (f2) => !togglableFields.includes(f2.id) && f2.type !== "media" && f2.enableHiding !== false ); } // packages/dataviews/build-module/components/dataviews-layouts/table/column-header-menu.mjs var import_jsx_runtime187 = __toESM(require_jsx_runtime(), 1); var { Menu: Menu6 } = unlock3(import_components94.privateApis); function WithMenuSeparators({ children }) { return import_element71.Children.toArray(children).filter(Boolean).map((child, i2) => /* @__PURE__ */ (0, import_jsx_runtime187.jsxs)(import_element71.Fragment, { children: [ i2 > 0 && /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(Menu6.Separator, {}), child ] }, i2)); } var _HeaderMenu = (0, import_element71.forwardRef)(function HeaderMenu({ fieldId, view, fields, onChangeView, onHide, setOpenedFilter, canMove = true, canInsertLeft = true, canInsertRight = true }, ref) { const visibleFieldIds = view.fields ?? []; const index = visibleFieldIds?.indexOf(fieldId); const isSorted = view.sort?.field === fieldId; let isHidable = false; let isSortable = false; let canAddFilter = false; let operators = []; const field = fields.find((f2) => f2.id === fieldId); const { setIsShowingFilter } = (0, import_element71.useContext)(dataviews_context_default); if (!field) { return null; } isHidable = field.enableHiding !== false; isSortable = field.enableSorting !== false; const header = field.header; operators = !!field.filterBy && field.filterBy?.operators || []; canAddFilter = !view.filters?.some((_filter) => fieldId === _filter.field) && !!(field.hasElements || field.Edit) && field.filterBy !== false && !field.filterBy?.isPrimary; if (!isSortable && !canMove && !isHidable && !canAddFilter) { return header; } const hiddenFields = getHideableFields(view, fields).filter( (f2) => !visibleFieldIds.includes(f2.id) ); const canInsert = (canInsertLeft || canInsertRight) && !!hiddenFields.length; const isRtl = (0, import_i18n88.isRTL)(); return /* @__PURE__ */ (0, import_jsx_runtime187.jsxs)(Menu6, { children: [ /* @__PURE__ */ (0, import_jsx_runtime187.jsxs)( Menu6.TriggerButton, { render: /* @__PURE__ */ (0, import_jsx_runtime187.jsx)( import_components94.Button, { size: "compact", className: "dataviews-view-table-header-button", ref, variant: "tertiary" } ), children: [ header, view.sort && isSorted && /* @__PURE__ */ (0, import_jsx_runtime187.jsx)("span", { "aria-hidden": "true", children: sortArrows[view.sort.direction] }) ] } ), /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(Menu6.Popover, { style: { minWidth: "240px" }, children: /* @__PURE__ */ (0, import_jsx_runtime187.jsxs)(WithMenuSeparators, { children: [ isSortable && /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(Menu6.Group, { children: SORTING_DIRECTIONS.map( (direction) => { const isChecked = view.sort && isSorted && view.sort.direction === direction; const value = `${fieldId}-${direction}`; return /* @__PURE__ */ (0, import_jsx_runtime187.jsx)( Menu6.RadioItem, { name: "view-table-sorting", value, checked: isChecked, onChange: () => { onChangeView({ ...view, sort: { field: fieldId, direction }, showLevels: false }); }, children: /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(Menu6.ItemLabel, { children: sortLabels[direction] }) }, value ); } ) }), canAddFilter && /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(Menu6.Group, { children: /* @__PURE__ */ (0, import_jsx_runtime187.jsx)( Menu6.Item, { prefix: /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(import_components94.Icon, { icon: funnel_default }), onClick: () => { setOpenedFilter(fieldId); setIsShowingFilter(true); onChangeView({ ...view, page: 1, filters: [ ...view.filters || [], { field: fieldId, value: void 0, operator: operators[0] } ] }); }, children: /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(Menu6.ItemLabel, { children: (0, import_i18n88.__)("Add filter") }) } ) }), (canMove || isHidable || canInsert) && field && /* @__PURE__ */ (0, import_jsx_runtime187.jsxs)(Menu6.Group, { children: [ canMove && /* @__PURE__ */ (0, import_jsx_runtime187.jsx)( Menu6.Item, { prefix: /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(import_components94.Icon, { icon: arrow_left_default }), disabled: isRtl ? index >= visibleFieldIds.length - 1 : index < 1, onClick: () => { const targetIndex = isRtl ? index + 1 : index - 1; const newFields = [ ...visibleFieldIds ]; newFields.splice(index, 1); newFields.splice( targetIndex, 0, fieldId ); onChangeView({ ...view, fields: newFields }); }, children: /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(Menu6.ItemLabel, { children: (0, import_i18n88.__)("Move left") }) } ), canMove && /* @__PURE__ */ (0, import_jsx_runtime187.jsx)( Menu6.Item, { prefix: /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(import_components94.Icon, { icon: arrow_right_default }), disabled: isRtl ? index < 1 : index >= visibleFieldIds.length - 1, onClick: () => { const targetIndex = isRtl ? index - 1 : index + 1; const newFields = [ ...visibleFieldIds ]; newFields.splice(index, 1); newFields.splice( targetIndex, 0, fieldId ); onChangeView({ ...view, fields: newFields }); }, children: /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(Menu6.ItemLabel, { children: (0, import_i18n88.__)("Move right") }) } ), canInsertLeft && !!hiddenFields.length && /* @__PURE__ */ (0, import_jsx_runtime187.jsxs)(Menu6, { children: [ /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(Menu6.SubmenuTriggerItem, { children: /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(Menu6.ItemLabel, { children: (0, import_i18n88.__)("Insert left") }) }), /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(Menu6.Popover, { children: hiddenFields.map((hiddenField) => { const insertIndex = isRtl ? index + 1 : index; return /* @__PURE__ */ (0, import_jsx_runtime187.jsx)( Menu6.Item, { onClick: () => { onChangeView({ ...view, fields: [ ...visibleFieldIds.slice( 0, insertIndex ), hiddenField.id, ...visibleFieldIds.slice( insertIndex ) ] }); }, children: /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(Menu6.ItemLabel, { children: hiddenField.label }) }, hiddenField.id ); }) }) ] }), canInsertRight && !!hiddenFields.length && /* @__PURE__ */ (0, import_jsx_runtime187.jsxs)(Menu6, { children: [ /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(Menu6.SubmenuTriggerItem, { children: /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(Menu6.ItemLabel, { children: (0, import_i18n88.__)("Insert right") }) }), /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(Menu6.Popover, { children: hiddenFields.map((hiddenField) => { const insertIndex = isRtl ? index : index + 1; return /* @__PURE__ */ (0, import_jsx_runtime187.jsx)( Menu6.Item, { onClick: () => { onChangeView({ ...view, fields: [ ...visibleFieldIds.slice( 0, insertIndex ), hiddenField.id, ...visibleFieldIds.slice( insertIndex ) ] }); }, children: /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(Menu6.ItemLabel, { children: hiddenField.label }) }, hiddenField.id ); }) }) ] }), isHidable && field && /* @__PURE__ */ (0, import_jsx_runtime187.jsx)( Menu6.Item, { prefix: /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(import_components94.Icon, { icon: unseen_default }), onClick: () => { onHide(field); onChangeView({ ...view, fields: visibleFieldIds.filter( (id) => id !== fieldId ) }); }, children: /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(Menu6.ItemLabel, { children: (0, import_i18n88.__)("Hide column") }) } ) ] }) ] }) }) ] }); }); var ColumnHeaderMenu = _HeaderMenu; var column_header_menu_default = ColumnHeaderMenu; // packages/dataviews/build-module/components/dataviews-layouts/utils/item-click-wrapper.mjs var import_element72 = __toESM(require_element(), 1); var import_jsx_runtime188 = __toESM(require_jsx_runtime(), 1); function getClickableItemProps({ item, isItemClickable, onClickItem, className }) { if (!isItemClickable(item) || !onClickItem) { return { className }; } return { className: className ? `${className} ${className}--clickable` : void 0, role: "button", tabIndex: 0, onClick: (event) => { event.stopPropagation(); onClickItem(item); }, onKeyDown: (event) => { if (event.key === "Enter" || event.key === "" || event.key === " ") { event.stopPropagation(); onClickItem(item); } } }; } function ItemClickWrapper({ item, isItemClickable, onClickItem, renderItemLink, className, children, ...extraProps }) { if (!isItemClickable(item)) { return /* @__PURE__ */ (0, import_jsx_runtime188.jsx)("div", { className, ...extraProps, children }); } if (renderItemLink) { const renderedElement = renderItemLink({ item, className: `${className} ${className}--clickable`, ...extraProps, children }); return (0, import_element72.cloneElement)(renderedElement, { onClick: (event) => { event.stopPropagation(); if (renderedElement.props.onClick) { renderedElement.props.onClick(event); } }, onKeyDown: (event) => { if (event.key === "Enter" || event.key === "" || event.key === " ") { event.stopPropagation(); if (renderedElement.props.onKeyDown) { renderedElement.props.onKeyDown(event); } } } }); } const clickProps = getClickableItemProps({ item, isItemClickable, onClickItem, className }); return /* @__PURE__ */ (0, import_jsx_runtime188.jsx)("div", { ...clickProps, ...extraProps, children }); } // packages/dataviews/build-module/components/dataviews-layouts/table/column-primary.mjs var import_jsx_runtime189 = __toESM(require_jsx_runtime(), 1); function ColumnPrimary({ item, level, titleField, mediaField, descriptionField: descriptionField2, onClickItem, renderItemLink, isItemClickable }) { return /* @__PURE__ */ (0, import_jsx_runtime189.jsxs)(Stack, { direction: "row", gap: "md", align: "flex-start", justify: "flex-start", children: [ mediaField && /* @__PURE__ */ (0, import_jsx_runtime189.jsx)( ItemClickWrapper, { item, isItemClickable, onClickItem, renderItemLink, className: "dataviews-view-table__cell-content-wrapper dataviews-column-primary__media", "aria-label": isItemClickable(item) && (!!onClickItem || !!renderItemLink) && !!titleField ? titleField.getValue?.({ item }) : void 0, children: /* @__PURE__ */ (0, import_jsx_runtime189.jsx)( mediaField.render, { item, field: mediaField, config: { sizes: "32px" } } ) } ), /* @__PURE__ */ (0, import_jsx_runtime189.jsxs)( Stack, { direction: "column", align: "flex-start", className: "dataviews-view-table__primary-column-content", children: [ titleField && /* @__PURE__ */ (0, import_jsx_runtime189.jsxs)( ItemClickWrapper, { item, isItemClickable, onClickItem, renderItemLink, className: "dataviews-view-table__cell-content-wrapper dataviews-title-field", children: [ level !== void 0 && level > 0 && /* @__PURE__ */ (0, import_jsx_runtime189.jsxs)("span", { className: "dataviews-view-table__level", children: [ Array(level).fill("\u2014").join(" "), "\xA0" ] }), /* @__PURE__ */ (0, import_jsx_runtime189.jsx)(titleField.render, { item, field: titleField }) ] } ), descriptionField2 && /* @__PURE__ */ (0, import_jsx_runtime189.jsx)( descriptionField2.render, { item, field: descriptionField2 } ) ] } ) ] }); } var column_primary_default = ColumnPrimary; // packages/dataviews/build-module/components/dataviews-layouts/table/use-is-horizontal-scroll-end.mjs var import_compose14 = __toESM(require_compose(), 1); var import_element73 = __toESM(require_element(), 1); var import_i18n89 = __toESM(require_i18n(), 1); var isScrolledToEnd = (element) => { if ((0, import_i18n89.isRTL)()) { const scrollLeft = Math.abs(element.scrollLeft); return scrollLeft <= 1; } return element.scrollLeft + element.clientWidth >= element.scrollWidth - 1; }; function useIsHorizontalScrollEnd({ scrollContainerRef, enabled = false }) { const [isHorizontalScrollEnd, setIsHorizontalScrollEnd] = (0, import_element73.useState)(false); const handleIsHorizontalScrollEnd = (0, import_compose14.useDebounce)( (0, import_element73.useCallback)(() => { const scrollContainer = scrollContainerRef.current; if (scrollContainer) { setIsHorizontalScrollEnd(isScrolledToEnd(scrollContainer)); } }, [scrollContainerRef, setIsHorizontalScrollEnd]), 200 ); (0, import_element73.useEffect)(() => { if (typeof window === "undefined" || !enabled || !scrollContainerRef.current) { return () => { }; } handleIsHorizontalScrollEnd(); scrollContainerRef.current.addEventListener( "scroll", handleIsHorizontalScrollEnd ); window.addEventListener("resize", handleIsHorizontalScrollEnd); return () => { scrollContainerRef.current?.removeEventListener( "scroll", handleIsHorizontalScrollEnd ); window.removeEventListener("resize", handleIsHorizontalScrollEnd); }; }, [scrollContainerRef, enabled]); return isHorizontalScrollEnd; } // packages/dataviews/build-module/components/dataviews-layouts/utils/get-data-by-group.mjs function getDataByGroup(data, groupByField) { return data.reduce((groups, item) => { const groupName = groupByField.getValue({ item }); if (!groups.has(groupName)) { groups.set(groupName, []); } groups.get(groupName)?.push(item); return groups; }, /* @__PURE__ */ new Map()); } // packages/dataviews/build-module/components/dataviews-view-config/properties-section.mjs var import_components95 = __toESM(require_components(), 1); var import_i18n90 = __toESM(require_i18n(), 1); var import_element74 = __toESM(require_element(), 1); var import_jsx_runtime190 = __toESM(require_jsx_runtime(), 1); function FieldItem({ field, isVisible: isVisible2, onToggleVisibility }) { return /* @__PURE__ */ (0, import_jsx_runtime190.jsx)(import_components95.__experimentalItem, { onClick: field.enableHiding ? onToggleVisibility : void 0, children: /* @__PURE__ */ (0, import_jsx_runtime190.jsxs)(Stack, { direction: "row", gap: "sm", justify: "flex-start", align: "center", children: [ /* @__PURE__ */ (0, import_jsx_runtime190.jsx)("div", { style: { height: 24, width: 24 }, children: isVisible2 && /* @__PURE__ */ (0, import_jsx_runtime190.jsx)(import_components95.Icon, { icon: check_default }) }), /* @__PURE__ */ (0, import_jsx_runtime190.jsx)("span", { className: "dataviews-view-config__label", children: field.label }) ] }) }); } function isDefined(item) { return !!item; } function PropertiesSection({ showLabel = true }) { const { view, fields, onChangeView } = (0, import_element74.useContext)(dataviews_context_default); const regularFields = getHideableFields(view, fields); if (!regularFields?.length) { return null; } const titleField = fields.find((f2) => f2.id === view.titleField); const previewField3 = fields.find((f2) => f2.id === view.mediaField); const descriptionField2 = fields.find( (f2) => f2.id === view.descriptionField ); const lockedFields = [ { field: titleField, isVisibleFlag: "showTitle" }, { field: previewField3, isVisibleFlag: "showMedia" }, { field: descriptionField2, isVisibleFlag: "showDescription" } ].filter(({ field }) => isDefined(field)); const visibleFieldIds = view.fields ?? []; const visibleRegularFieldsCount = regularFields.filter( (f2) => visibleFieldIds.includes(f2.id) ).length; const visibleLockedFields = lockedFields.filter( ({ isVisibleFlag }) => ( // @ts-expect-error view[isVisibleFlag] ?? true ) ); const totalVisibleFields = visibleLockedFields.length + visibleRegularFieldsCount; const isSingleVisibleLockedField = totalVisibleFields === 1 && visibleLockedFields.length === 1; return /* @__PURE__ */ (0, import_jsx_runtime190.jsxs)(Stack, { direction: "column", className: "dataviews-field-control", children: [ showLabel && /* @__PURE__ */ (0, import_jsx_runtime190.jsx)(import_components95.BaseControl.VisualLabel, { children: (0, import_i18n90.__)("Properties") }), /* @__PURE__ */ (0, import_jsx_runtime190.jsx)( Stack, { direction: "column", className: "dataviews-view-config__properties", children: /* @__PURE__ */ (0, import_jsx_runtime190.jsxs)(import_components95.__experimentalItemGroup, { isBordered: true, isSeparated: true, size: "medium", children: [ lockedFields.map(({ field, isVisibleFlag }) => { const isVisible2 = view[isVisibleFlag] ?? true; const fieldToRender = isSingleVisibleLockedField && isVisible2 ? { ...field, enableHiding: false } : field; return /* @__PURE__ */ (0, import_jsx_runtime190.jsx)( FieldItem, { field: fieldToRender, isVisible: isVisible2, onToggleVisibility: () => { onChangeView({ ...view, [isVisibleFlag]: !isVisible2 }); } }, field.id ); }), regularFields.map((field) => { const isVisible2 = visibleFieldIds.includes(field.id); const fieldToRender = totalVisibleFields === 1 && isVisible2 ? { ...field, enableHiding: false } : field; return /* @__PURE__ */ (0, import_jsx_runtime190.jsx)( FieldItem, { field: fieldToRender, isVisible: isVisible2, onToggleVisibility: () => { onChangeView({ ...view, fields: isVisible2 ? visibleFieldIds.filter( (fieldId) => fieldId !== field.id ) : [...visibleFieldIds, field.id] }); } }, field.id ); }) ] }) } ) ] }); } // packages/dataviews/build-module/hooks/use-delayed-loading.mjs var import_element75 = __toESM(require_element(), 1); function useDelayedLoading(isLoading, options = { delay: 400 }) { const [showLoader, setShowLoader] = (0, import_element75.useState)(false); (0, import_element75.useEffect)(() => { if (!isLoading) { return; } const timeout = setTimeout(() => { setShowLoader(true); }, options.delay); return () => { clearTimeout(timeout); setShowLoader(false); }; }, [isLoading, options.delay]); return showLoader; } // packages/dataviews/build-module/components/dataviews-layouts/table/index.mjs var import_jsx_runtime191 = __toESM(require_jsx_runtime(), 1); function getEffectiveAlign(explicitAlign, fieldType) { if (explicitAlign) { return explicitAlign; } if (fieldType === "integer" || fieldType === "number") { return "end"; } return void 0; } function TableColumnField({ item, fields, column, align }) { const field = fields.find((f2) => f2.id === column); if (!field) { return null; } const className = clsx_default("dataviews-view-table__cell-content-wrapper", { "dataviews-view-table__cell-align-end": align === "end", "dataviews-view-table__cell-align-center": align === "center" }); return /* @__PURE__ */ (0, import_jsx_runtime191.jsx)("div", { className, children: /* @__PURE__ */ (0, import_jsx_runtime191.jsx)(field.render, { item, field }) }); } function TableRow({ hasBulkActions, item, level, actions, fields, id, view, titleField, mediaField, descriptionField: descriptionField2, selection, getItemId: getItemId2, isItemClickable, onClickItem, renderItemLink, onChangeSelection, isActionsColumnSticky, posinset }) { const { paginationInfo } = (0, import_element76.useContext)(dataviews_context_default); const hasPossibleBulkAction = useHasAPossibleBulkAction(actions, item); const isSelected2 = hasPossibleBulkAction && selection.includes(id); const { showTitle = true, showMedia = true, showDescription = true, infiniteScrollEnabled } = view; const isTouchDeviceRef = (0, import_element76.useRef)(false); const columns = view.fields ?? []; const hasPrimaryColumn = titleField && showTitle || mediaField && showMedia || descriptionField2 && showDescription; return /* @__PURE__ */ (0, import_jsx_runtime191.jsxs)( "tr", { className: clsx_default("dataviews-view-table__row", { "is-selected": hasPossibleBulkAction && isSelected2, "has-bulk-actions": hasPossibleBulkAction }), onTouchStart: () => { isTouchDeviceRef.current = true; }, "aria-setsize": infiniteScrollEnabled ? paginationInfo.totalItems : void 0, "aria-posinset": posinset, role: infiniteScrollEnabled ? "article" : void 0, onMouseDown: (event) => { const isMetaClick = (0, import_keycodes6.isAppleOS)() ? event.metaKey : event.ctrlKey; if (event.button === 0 && isMetaClick && window.navigator.userAgent.toLowerCase().includes("firefox")) { event?.preventDefault(); } }, onClick: (event) => { if (!hasPossibleBulkAction) { return; } const isModifierKeyPressed = (0, import_keycodes6.isAppleOS)() ? event.metaKey : event.ctrlKey; if (isModifierKeyPressed && !isTouchDeviceRef.current && document.getSelection()?.type !== "Range") { onChangeSelection( selection.includes(id) ? selection.filter((itemId) => id !== itemId) : [...selection, id] ); } }, children: [ hasBulkActions && /* @__PURE__ */ (0, import_jsx_runtime191.jsx)("td", { className: "dataviews-view-table__checkbox-column", children: /* @__PURE__ */ (0, import_jsx_runtime191.jsx)("div", { className: "dataviews-view-table__cell-content-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime191.jsx)( DataViewsSelectionCheckbox, { item, selection, onChangeSelection, getItemId: getItemId2, titleField, disabled: !hasPossibleBulkAction } ) }) }), hasPrimaryColumn && /* @__PURE__ */ (0, import_jsx_runtime191.jsx)("td", { children: /* @__PURE__ */ (0, import_jsx_runtime191.jsx)( column_primary_default, { item, level, titleField: showTitle ? titleField : void 0, mediaField: showMedia ? mediaField : void 0, descriptionField: showDescription ? descriptionField2 : void 0, isItemClickable, onClickItem, renderItemLink } ) }), columns.map((column) => { const { width, maxWidth, minWidth, align } = view.layout?.styles?.[column] ?? {}; const field = fields.find((f2) => f2.id === column); const effectiveAlign = getEffectiveAlign(align, field?.type); return /* @__PURE__ */ (0, import_jsx_runtime191.jsx)( "td", { style: { width, maxWidth, minWidth }, children: /* @__PURE__ */ (0, import_jsx_runtime191.jsx)( TableColumnField, { fields, item, column, align: effectiveAlign } ) }, column ); }), !!actions?.length && // Disable reason: we are not making the element interactive, // but preventing any click events from bubbling up to the // table row. This allows us to add a click handler to the row // itself (to toggle row selection) without erroneously // intercepting click events from ItemActions. /* eslint-disable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */ /* @__PURE__ */ (0, import_jsx_runtime191.jsx)( "td", { className: clsx_default("dataviews-view-table__actions-column", { "dataviews-view-table__actions-column--sticky": true, "dataviews-view-table__actions-column--stuck": isActionsColumnSticky }), onClick: (e2) => e2.stopPropagation(), children: /* @__PURE__ */ (0, import_jsx_runtime191.jsx)(ItemActions, { item, actions }) } ) ] } ); } function ViewTable({ actions, data, fields, getItemId: getItemId2, getItemLevel: getItemLevel2, isLoading = false, onChangeView, onChangeSelection, selection, setOpenedFilter, onClickItem, isItemClickable, renderItemLink, view, className, empty }) { const { containerRef } = (0, import_element76.useContext)(dataviews_context_default); const isDelayedLoading = useDelayedLoading(isLoading); const headerMenuRefs = (0, import_element76.useRef)(/* @__PURE__ */ new Map()); const headerMenuToFocusRef = (0, import_element76.useRef)(void 0); const [nextHeaderMenuToFocus, setNextHeaderMenuToFocus] = (0, import_element76.useState)(); const [contextMenuAnchor, setContextMenuAnchor] = (0, import_element76.useState)(null); (0, import_element76.useEffect)(() => { if (headerMenuToFocusRef.current) { headerMenuToFocusRef.current.focus(); headerMenuToFocusRef.current = void 0; } }); const tableNoticeId = (0, import_element76.useId)(); const isHorizontalScrollEnd = useIsHorizontalScrollEnd({ scrollContainerRef: containerRef, enabled: !!actions?.length }); const hasBulkActions = useSomeItemHasAPossibleBulkAction(actions, data); if (nextHeaderMenuToFocus) { headerMenuToFocusRef.current = nextHeaderMenuToFocus; setNextHeaderMenuToFocus(void 0); return; } const onHide = (field) => { const hidden = headerMenuRefs.current.get(field.id); const fallback = hidden ? headerMenuRefs.current.get(hidden.fallback) : void 0; setNextHeaderMenuToFocus(fallback?.node); }; const handleHeaderContextMenu = (event) => { event.preventDefault(); event.stopPropagation(); const virtualAnchor = { getBoundingClientRect: () => ({ x: event.clientX, y: event.clientY, top: event.clientY, left: event.clientX, right: event.clientX, bottom: event.clientY, width: 0, height: 0, toJSON: () => ({}) }) }; window.requestAnimationFrame(() => { setContextMenuAnchor(virtualAnchor); }); }; const hasData = !!data?.length; const titleField = fields.find((field) => field.id === view.titleField); const mediaField = fields.find((field) => field.id === view.mediaField); const descriptionField2 = fields.find( (field) => field.id === view.descriptionField ); const groupField = view.groupBy?.field ? fields.find((f2) => f2.id === view.groupBy?.field) : null; const dataByGroup = groupField ? getDataByGroup(data, groupField) : null; const { showTitle = true, showMedia = true, showDescription = true } = view; const hasPrimaryColumn = titleField && showTitle || mediaField && showMedia || descriptionField2 && showDescription; const columns = view.fields ?? []; const headerMenuRef = (column, index) => (node) => { if (node) { headerMenuRefs.current.set(column, { node, fallback: columns[index > 0 ? index - 1 : 1] }); } else { headerMenuRefs.current.delete(column); } }; const isInfiniteScroll = view.infiniteScrollEnabled && !dataByGroup; const isRtl = (0, import_i18n91.isRTL)(); if (!hasData) { return /* @__PURE__ */ (0, import_jsx_runtime191.jsx)( "div", { className: clsx_default("dataviews-no-results", { "is-refreshing": isDelayedLoading }), id: tableNoticeId, children: empty } ); } return /* @__PURE__ */ (0, import_jsx_runtime191.jsxs)(import_jsx_runtime191.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime191.jsxs)( "table", { className: clsx_default("dataviews-view-table", className, { [`has-${view.layout?.density}-density`]: view.layout?.density && ["compact", "comfortable"].includes( view.layout.density ), "has-bulk-actions": hasBulkActions, "is-refreshing": !isInfiniteScroll && isDelayedLoading }), "aria-busy": isLoading, "aria-describedby": tableNoticeId, role: isInfiniteScroll ? "feed" : void 0, inert: !isInfiniteScroll && isLoading ? "true" : void 0, children: [ /* @__PURE__ */ (0, import_jsx_runtime191.jsxs)("colgroup", { children: [ hasBulkActions && /* @__PURE__ */ (0, import_jsx_runtime191.jsx)("col", { className: "dataviews-view-table__col-checkbox" }), hasPrimaryColumn && /* @__PURE__ */ (0, import_jsx_runtime191.jsx)("col", { className: "dataviews-view-table__col-first-data" }), columns.map((column, index) => /* @__PURE__ */ (0, import_jsx_runtime191.jsx)( "col", { className: clsx_default( `dataviews-view-table__col-${column}`, { "dataviews-view-table__col-first-data": !hasPrimaryColumn && index === 0 } ) }, `col-${column}` )), !!actions?.length && /* @__PURE__ */ (0, import_jsx_runtime191.jsx)("col", { className: "dataviews-view-table__col-actions" }) ] }), contextMenuAnchor && /* @__PURE__ */ (0, import_jsx_runtime191.jsx)( import_components96.Popover, { anchor: contextMenuAnchor, onClose: () => setContextMenuAnchor(null), placement: "bottom-start", children: /* @__PURE__ */ (0, import_jsx_runtime191.jsx)(PropertiesSection, { showLabel: false }) } ), /* @__PURE__ */ (0, import_jsx_runtime191.jsx)("thead", { onContextMenu: handleHeaderContextMenu, children: /* @__PURE__ */ (0, import_jsx_runtime191.jsxs)("tr", { className: "dataviews-view-table__row", children: [ hasBulkActions && /* @__PURE__ */ (0, import_jsx_runtime191.jsx)( "th", { className: "dataviews-view-table__checkbox-column", scope: "col", onContextMenu: handleHeaderContextMenu, children: /* @__PURE__ */ (0, import_jsx_runtime191.jsx)( BulkSelectionCheckbox, { selection, onChangeSelection, data, actions, getItemId: getItemId2 } ) } ), hasPrimaryColumn && /* @__PURE__ */ (0, import_jsx_runtime191.jsx)("th", { scope: "col", children: titleField && /* @__PURE__ */ (0, import_jsx_runtime191.jsx)( column_header_menu_default, { ref: headerMenuRef( titleField.id, 0 ), fieldId: titleField.id, view, fields, onChangeView, onHide, setOpenedFilter, canMove: false, canInsertLeft: isRtl ? view.layout?.enableMoving ?? true : false, canInsertRight: isRtl ? false : view.layout?.enableMoving ?? true } ) }), columns.map((column, index) => { const { width, maxWidth, minWidth, align } = view.layout?.styles?.[column] ?? {}; const field = fields.find( (f2) => f2.id === column ); const effectiveAlign = getEffectiveAlign( align, field?.type ); const canInsertOrMove = view.layout?.enableMoving ?? true; return /* @__PURE__ */ (0, import_jsx_runtime191.jsx)( "th", { style: { width, maxWidth, minWidth, textAlign: effectiveAlign }, "aria-sort": view.sort?.direction && view.sort?.field === column ? sortValues[view.sort.direction] : void 0, scope: "col", children: /* @__PURE__ */ (0, import_jsx_runtime191.jsx)( column_header_menu_default, { ref: headerMenuRef(column, index), fieldId: column, view, fields, onChangeView, onHide, setOpenedFilter, canMove: canInsertOrMove, canInsertLeft: canInsertOrMove, canInsertRight: canInsertOrMove } ) }, column ); }), !!actions?.length && /* @__PURE__ */ (0, import_jsx_runtime191.jsx)( "th", { className: clsx_default( "dataviews-view-table__actions-column", { "dataviews-view-table__actions-column--sticky": true, "dataviews-view-table__actions-column--stuck": !isHorizontalScrollEnd } ), children: /* @__PURE__ */ (0, import_jsx_runtime191.jsx)("span", { className: "dataviews-view-table-header", children: (0, import_i18n91.__)("Actions") }) } ) ] }) }), hasData && groupField && dataByGroup ? Array.from(dataByGroup.entries()).map( ([groupName, groupItems]) => /* @__PURE__ */ (0, import_jsx_runtime191.jsxs)("tbody", { children: [ /* @__PURE__ */ (0, import_jsx_runtime191.jsx)("tr", { className: "dataviews-view-table__group-header-row", children: /* @__PURE__ */ (0, import_jsx_runtime191.jsx)( "td", { colSpan: columns.length + (hasPrimaryColumn ? 1 : 0) + (hasBulkActions ? 1 : 0) + (actions?.length ? 1 : 0), className: "dataviews-view-table__group-header-cell", children: view.groupBy?.showLabel === false ? groupName : (0, import_i18n91.sprintf)( // translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022". (0, import_i18n91.__)("%1$s: %2$s"), groupField.label, groupName ) } ) }), groupItems.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime191.jsx)( TableRow, { item, level: view.showLevels && typeof getItemLevel2 === "function" ? getItemLevel2(item) : void 0, hasBulkActions, actions, fields, id: getItemId2(item) || index.toString(), view, titleField, mediaField, descriptionField: descriptionField2, selection, getItemId: getItemId2, onChangeSelection, onClickItem, renderItemLink, isItemClickable, isActionsColumnSticky: !isHorizontalScrollEnd }, getItemId2(item) )) ] }, `group-${groupName}`) ) : /* @__PURE__ */ (0, import_jsx_runtime191.jsx)("tbody", { children: hasData && data.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime191.jsx)( TableRow, { item, level: view.showLevels && typeof getItemLevel2 === "function" ? getItemLevel2(item) : void 0, hasBulkActions, actions, fields, id: getItemId2(item) || index.toString(), view, titleField, mediaField, descriptionField: descriptionField2, selection, getItemId: getItemId2, onChangeSelection, onClickItem, renderItemLink, isItemClickable, isActionsColumnSticky: !isHorizontalScrollEnd, posinset: isInfiniteScroll ? index + 1 : void 0 }, getItemId2(item) )) }) ] } ), isInfiniteScroll && isLoading && /* @__PURE__ */ (0, import_jsx_runtime191.jsx)("div", { className: "dataviews-loading", id: tableNoticeId, children: /* @__PURE__ */ (0, import_jsx_runtime191.jsx)("p", { className: "dataviews-loading-more", children: /* @__PURE__ */ (0, import_jsx_runtime191.jsx)(import_components96.Spinner, {}) }) }) ] }); } var table_default = ViewTable; // packages/dataviews/build-module/components/dataviews-layouts/grid/index.mjs var import_components99 = __toESM(require_components(), 1); var import_i18n94 = __toESM(require_i18n(), 1); // packages/dataviews/build-module/components/dataviews-layouts/grid/composite-grid.mjs var import_components98 = __toESM(require_components(), 1); var import_i18n93 = __toESM(require_i18n(), 1); var import_compose15 = __toESM(require_compose(), 1); var import_keycodes7 = __toESM(require_keycodes(), 1); var import_element78 = __toESM(require_element(), 1); // packages/dataviews/build-module/components/dataviews-layouts/grid/preview-size-picker.mjs var import_components97 = __toESM(require_components(), 1); var import_i18n92 = __toESM(require_i18n(), 1); var import_element77 = __toESM(require_element(), 1); var import_jsx_runtime192 = __toESM(require_jsx_runtime(), 1); var imageSizes = [ { value: 120, breakpoint: 1 }, { value: 170, breakpoint: 1 }, { value: 230, breakpoint: 1 }, { value: 290, breakpoint: 1112 // at minimum image width, 4 images display at this container size }, { value: 350, breakpoint: 1636 // at minimum image width, 6 images display at this container size }, { value: 430, breakpoint: 588 // at minimum image width, 2 images display at this container size } ]; var DEFAULT_PREVIEW_SIZE = imageSizes[2].value; function useGridColumns() { const context = (0, import_element77.useContext)(dataviews_context_default); const view = context.view; return (0, import_element77.useMemo)(() => { const containerWidth = context.containerWidth; const gap = 32; const previewSize = view.layout?.previewSize ?? DEFAULT_PREVIEW_SIZE; const columns = Math.floor( (containerWidth + gap) / (previewSize + gap) ); return Math.max(1, columns); }, [context.containerWidth, view.layout?.previewSize]); } // packages/dataviews/build-module/components/dataviews-layouts/grid/composite-grid.mjs var import_jsx_runtime193 = __toESM(require_jsx_runtime(), 1); var { Badge: Badge3 } = unlock3(import_components98.privateApis); function chunk(array, size) { const chunks = []; for (let i2 = 0, j2 = array.length; i2 < j2; i2 += size) { chunks.push(array.slice(i2, i2 + size)); } return chunks; } var GridItem = (0, import_element78.forwardRef)(function GridItem2({ view, selection, onChangeSelection, onClickItem, isItemClickable, renderItemLink, getItemId: getItemId2, item, actions, mediaField, titleField, descriptionField: descriptionField2, regularFields, badgeFields, hasBulkActions, config: config2, ...props }, ref) { const { showTitle = true, showMedia = true, showDescription = true } = view; const hasBulkAction = useHasAPossibleBulkAction(actions, item); const id = getItemId2(item); const instanceId = (0, import_compose15.useInstanceId)(GridItem2); const isSelected2 = selection.includes(id); const mediaPlaceholder = /* @__PURE__ */ (0, import_jsx_runtime193.jsx)("span", { className: "dataviews-view-grid__media-placeholder" }); const rendersMediaField = showMedia && mediaField?.render; const renderedMediaField = rendersMediaField ? /* @__PURE__ */ (0, import_jsx_runtime193.jsx)( mediaField.render, { item, field: mediaField, config: config2 } ) : mediaPlaceholder; const renderedTitleField = showTitle && titleField?.render ? /* @__PURE__ */ (0, import_jsx_runtime193.jsx)(titleField.render, { item, field: titleField }) : null; let mediaA11yProps; let titleA11yProps; if (isItemClickable(item) && onClickItem) { if (renderedTitleField) { mediaA11yProps = { "aria-labelledby": `dataviews-view-grid__title-field-${instanceId}` }; titleA11yProps = { id: `dataviews-view-grid__title-field-${instanceId}` }; } else { mediaA11yProps = { "aria-label": (0, import_i18n93.__)("Navigate to item") }; } } return /* @__PURE__ */ (0, import_jsx_runtime193.jsxs)( Stack, { direction: "column", ...props, ref, className: clsx_default( props.className, "dataviews-view-grid__row__gridcell", "dataviews-view-grid__card", { "is-selected": hasBulkAction && isSelected2 } ), onClickCapture: (event) => { props.onClickCapture?.(event); if ((0, import_keycodes7.isAppleOS)() ? event.metaKey : event.ctrlKey) { event.stopPropagation(); event.preventDefault(); if (!hasBulkAction) { return; } onChangeSelection( selection.includes(id) ? selection.filter((itemId) => id !== itemId) : [...selection, id] ); } }, children: [ /* @__PURE__ */ (0, import_jsx_runtime193.jsx)( ItemClickWrapper, { item, isItemClickable, onClickItem, renderItemLink, className: clsx_default("dataviews-view-grid__media", { "dataviews-view-grid__media--placeholder": !rendersMediaField }), ...mediaA11yProps, children: renderedMediaField } ), hasBulkActions && /* @__PURE__ */ (0, import_jsx_runtime193.jsx)( DataViewsSelectionCheckbox, { item, selection, onChangeSelection, getItemId: getItemId2, titleField, disabled: !hasBulkAction } ), !!actions?.length && /* @__PURE__ */ (0, import_jsx_runtime193.jsx)("div", { className: "dataviews-view-grid__media-actions", children: /* @__PURE__ */ (0, import_jsx_runtime193.jsx)(ItemActions, { item, actions, isCompact: true }) }), showTitle && /* @__PURE__ */ (0, import_jsx_runtime193.jsx)("div", { className: "dataviews-view-grid__title", children: /* @__PURE__ */ (0, import_jsx_runtime193.jsx)( ItemClickWrapper, { item, isItemClickable, onClickItem, renderItemLink, className: "dataviews-view-grid__title-field dataviews-title-field", ...titleA11yProps, title: titleField?.getValueFormatted({ item, field: titleField }) || void 0, children: renderedTitleField } ) }), /* @__PURE__ */ (0, import_jsx_runtime193.jsxs)(Stack, { direction: "column", gap: "xs", children: [ showDescription && descriptionField2?.render && /* @__PURE__ */ (0, import_jsx_runtime193.jsx)( descriptionField2.render, { item, field: descriptionField2 } ), !!badgeFields?.length && /* @__PURE__ */ (0, import_jsx_runtime193.jsx)( Stack, { direction: "row", className: "dataviews-view-grid__badge-fields", gap: "sm", wrap: "wrap", align: "top", justify: "flex-start", children: badgeFields.map((field) => { return /* @__PURE__ */ (0, import_jsx_runtime193.jsx)( Badge3, { className: "dataviews-view-grid__field-value", children: /* @__PURE__ */ (0, import_jsx_runtime193.jsx)( field.render, { item, field } ) }, field.id ); }) } ), !!regularFields?.length && /* @__PURE__ */ (0, import_jsx_runtime193.jsx)( Stack, { direction: "column", className: "dataviews-view-grid__fields", gap: "xs", children: regularFields.map((field) => { return /* @__PURE__ */ (0, import_jsx_runtime193.jsx)( import_components98.Flex, { className: "dataviews-view-grid__field", gap: 1, justify: "flex-start", expanded: true, style: { height: "auto" }, direction: "row", children: /* @__PURE__ */ (0, import_jsx_runtime193.jsxs)(import_jsx_runtime193.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime193.jsx)(import_components98.Tooltip, { text: field.label, children: /* @__PURE__ */ (0, import_jsx_runtime193.jsx)(import_components98.FlexItem, { className: "dataviews-view-grid__field-name", children: field.header }) }), /* @__PURE__ */ (0, import_jsx_runtime193.jsx)( import_components98.FlexItem, { className: "dataviews-view-grid__field-value", style: { maxHeight: "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime193.jsx)( field.render, { item, field } ) } ) ] }) }, field.id ); }) } ) ] }) ] } ); }); function CompositeGrid({ data, isInfiniteScroll, className, inert, isLoading, view, fields, selection, onChangeSelection, onClickItem, isItemClickable, renderItemLink, getItemId: getItemId2, actions }) { const { paginationInfo, resizeObserverRef } = (0, import_element78.useContext)(dataviews_context_default); const gridColumns = useGridColumns(); const hasBulkActions = useSomeItemHasAPossibleBulkAction(actions, data); const titleField = fields.find( (field) => field.id === view?.titleField ); const mediaField = fields.find( (field) => field.id === view?.mediaField ); const descriptionField2 = fields.find( (field) => field.id === view?.descriptionField ); const otherFields = view.fields ?? []; const { regularFields, badgeFields } = otherFields.reduce( (accumulator, fieldId) => { const field = fields.find((f2) => f2.id === fieldId); if (!field) { return accumulator; } const key = view.layout?.badgeFields?.includes(fieldId) ? "badgeFields" : "regularFields"; accumulator[key].push(field); return accumulator; }, { regularFields: [], badgeFields: [] } ); const size = "900px"; const totalRows = Math.ceil(data.length / gridColumns); return /* @__PURE__ */ (0, import_jsx_runtime193.jsx)( import_components98.Composite, { role: isInfiniteScroll ? "feed" : "grid", className: clsx_default("dataviews-view-grid", className), focusWrap: true, "aria-busy": isLoading, "aria-rowcount": isInfiniteScroll ? void 0 : totalRows, ref: resizeObserverRef, inert, children: chunk(data, gridColumns).map((row, i2) => /* @__PURE__ */ (0, import_jsx_runtime193.jsx)( import_components98.Composite.Row, { render: /* @__PURE__ */ (0, import_jsx_runtime193.jsx)( "div", { role: "row", "aria-rowindex": i2 + 1, "aria-label": (0, import_i18n93.sprintf)( /* translators: %d: The row number in the grid */ (0, import_i18n93.__)("Row %d"), i2 + 1 ), className: "dataviews-view-grid__row", style: { gridTemplateColumns: `repeat( ${gridColumns}, minmax(0, 1fr) )` } } ), children: row.map((item, indexInRow) => { const index = i2 * gridColumns + indexInRow; return /* @__PURE__ */ (0, import_jsx_runtime193.jsx)( import_components98.Composite.Item, { render: (props) => /* @__PURE__ */ (0, import_jsx_runtime193.jsx)( GridItem, { ...props, role: isInfiniteScroll ? "article" : "gridcell", "aria-setsize": isInfiniteScroll ? paginationInfo.totalItems : void 0, "aria-posinset": isInfiniteScroll ? index + 1 : void 0, view, selection, onChangeSelection, onClickItem, isItemClickable, renderItemLink, getItemId: getItemId2, item, actions, mediaField, titleField, descriptionField: descriptionField2, regularFields, badgeFields, hasBulkActions, config: { sizes: size } } ) }, getItemId2(item) ); }) }, i2 )) } ); } // packages/dataviews/build-module/components/dataviews-layouts/grid/index.mjs var import_jsx_runtime194 = __toESM(require_jsx_runtime(), 1); function ViewGrid({ actions, data, fields, getItemId: getItemId2, isLoading, onChangeSelection, onClickItem, isItemClickable, renderItemLink, selection, view, className, empty }) { const isDelayedLoading = useDelayedLoading(!!isLoading); const hasData = !!data?.length; const groupField = view.groupBy?.field ? fields.find((f2) => f2.id === view.groupBy?.field) : null; const dataByGroup = groupField ? getDataByGroup(data, groupField) : null; const isInfiniteScroll = view.infiniteScrollEnabled && !dataByGroup; if (!hasData) { return /* @__PURE__ */ (0, import_jsx_runtime194.jsx)( "div", { className: clsx_default("dataviews-no-results", { "is-refreshing": isDelayedLoading }), children: empty } ); } const gridProps = { className: clsx_default(className, { "is-refreshing": !isInfiniteScroll && isDelayedLoading }), inert: !isInfiniteScroll && !!isLoading ? "true" : void 0, isLoading, view, fields, selection, onChangeSelection, onClickItem, isItemClickable, renderItemLink, getItemId: getItemId2, actions }; return /* @__PURE__ */ (0, import_jsx_runtime194.jsxs)(import_jsx_runtime194.Fragment, { // Render multiple groups. children: [ hasData && groupField && dataByGroup && /* @__PURE__ */ (0, import_jsx_runtime194.jsx)(Stack, { direction: "column", gap: "lg", children: Array.from(dataByGroup.entries()).map( ([groupName, groupItems]) => /* @__PURE__ */ (0, import_jsx_runtime194.jsxs)( Stack, { direction: "column", gap: "sm", children: [ /* @__PURE__ */ (0, import_jsx_runtime194.jsx)("h3", { className: "dataviews-view-grid__group-header", children: view.groupBy?.showLabel === false ? groupName : (0, import_i18n94.sprintf)( // translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022". (0, import_i18n94.__)("%1$s: %2$s"), groupField.label, groupName ) }), /* @__PURE__ */ (0, import_jsx_runtime194.jsx)( CompositeGrid, { ...gridProps, data: groupItems, isInfiniteScroll: false } ) ] }, groupName ) ) }), // Render a single grid with all data. !dataByGroup && /* @__PURE__ */ (0, import_jsx_runtime194.jsx)( CompositeGrid, { ...gridProps, data, isInfiniteScroll: !!isInfiniteScroll } ), isInfiniteScroll && isLoading && /* @__PURE__ */ (0, import_jsx_runtime194.jsx)("p", { className: "dataviews-loading-more", children: /* @__PURE__ */ (0, import_jsx_runtime194.jsx)(import_components99.Spinner, {}) }) ] }); } var grid_default = ViewGrid; // packages/dataviews/build-module/components/dataviews-layouts/list/index.mjs var import_compose16 = __toESM(require_compose(), 1); var import_components100 = __toESM(require_components(), 1); var import_element79 = __toESM(require_element(), 1); var import_i18n95 = __toESM(require_i18n(), 1); var import_data61 = __toESM(require_data(), 1); var import_jsx_runtime195 = __toESM(require_jsx_runtime(), 1); var { Menu: Menu7 } = unlock3(import_components100.privateApis); function generateItemWrapperCompositeId(idPrefix) { return `${idPrefix}-item-wrapper`; } function generatePrimaryActionCompositeId(idPrefix, primaryActionId) { return `${idPrefix}-primary-action-${primaryActionId}`; } function generateDropdownTriggerCompositeId(idPrefix) { return `${idPrefix}-dropdown`; } function PrimaryActionGridCell({ idPrefix, primaryAction, item }) { const registry = (0, import_data61.useRegistry)(); const [isModalOpen, setIsModalOpen] = (0, import_element79.useState)(false); const compositeItemId = generatePrimaryActionCompositeId( idPrefix, primaryAction.id ); const label = typeof primaryAction.label === "string" ? primaryAction.label : primaryAction.label([item]); return "RenderModal" in primaryAction ? /* @__PURE__ */ (0, import_jsx_runtime195.jsx)("div", { role: "gridcell", children: /* @__PURE__ */ (0, import_jsx_runtime195.jsx)( import_components100.Composite.Item, { id: compositeItemId, render: /* @__PURE__ */ (0, import_jsx_runtime195.jsx)( import_components100.Button, { disabled: !!primaryAction.disabled, accessibleWhenDisabled: true, text: label, size: "small", onClick: () => setIsModalOpen(true) } ), children: isModalOpen && /* @__PURE__ */ (0, import_jsx_runtime195.jsx)( ActionModal, { action: primaryAction, items: [item], closeModal: () => setIsModalOpen(false) } ) } ) }, primaryAction.id) : /* @__PURE__ */ (0, import_jsx_runtime195.jsx)("div", { role: "gridcell", children: /* @__PURE__ */ (0, import_jsx_runtime195.jsx)( import_components100.Composite.Item, { id: compositeItemId, render: /* @__PURE__ */ (0, import_jsx_runtime195.jsx)( import_components100.Button, { disabled: !!primaryAction.disabled, accessibleWhenDisabled: true, size: "small", onClick: () => { primaryAction.callback([item], { registry }); }, children: label } ) } ) }, primaryAction.id); } function ListItem({ view, actions, idPrefix, isSelected: isSelected2, item, titleField, mediaField, descriptionField: descriptionField2, onSelect, otherFields, onDropdownTriggerKeyDown, posinset }) { const { showTitle = true, showMedia = true, showDescription = true, infiniteScrollEnabled } = view; const itemRef = (0, import_element79.useRef)(null); const labelId = `${idPrefix}-label`; const descriptionId = `${idPrefix}-description`; const registry = (0, import_data61.useRegistry)(); const [isHovered, setIsHovered] = (0, import_element79.useState)(false); const [activeModalAction, setActiveModalAction] = (0, import_element79.useState)( null ); const handleHover = ({ type }) => { const isHover = type === "mouseenter"; setIsHovered(isHover); }; const { paginationInfo } = (0, import_element79.useContext)(dataviews_context_default); (0, import_element79.useEffect)(() => { if (isSelected2) { itemRef.current?.scrollIntoView({ behavior: "auto", block: "nearest", inline: "nearest" }); } }, [isSelected2]); const { primaryAction, eligibleActions } = (0, import_element79.useMemo)(() => { const _eligibleActions = actions.filter( (action) => !action.isEligible || action.isEligible(item) ); const _primaryActions = _eligibleActions.filter( (action) => action.isPrimary ); return { primaryAction: _primaryActions[0], eligibleActions: _eligibleActions }; }, [actions, item]); const hasOnlyOnePrimaryAction = primaryAction && actions.length === 1; const renderedMediaField = showMedia && mediaField?.render ? /* @__PURE__ */ (0, import_jsx_runtime195.jsx)("div", { className: "dataviews-view-list__media-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime195.jsx)( mediaField.render, { item, field: mediaField, config: { sizes: "52px" } } ) }) : null; const renderedTitleField = showTitle && titleField?.render ? /* @__PURE__ */ (0, import_jsx_runtime195.jsx)(titleField.render, { item, field: titleField }) : null; const usedActions = eligibleActions?.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime195.jsxs)( Stack, { direction: "row", gap: "md", className: "dataviews-view-list__item-actions", children: [ primaryAction && /* @__PURE__ */ (0, import_jsx_runtime195.jsx)( PrimaryActionGridCell, { idPrefix, primaryAction, item } ), !hasOnlyOnePrimaryAction && /* @__PURE__ */ (0, import_jsx_runtime195.jsxs)("div", { role: "gridcell", children: [ /* @__PURE__ */ (0, import_jsx_runtime195.jsxs)(Menu7, { placement: "bottom-end", children: [ /* @__PURE__ */ (0, import_jsx_runtime195.jsx)( Menu7.TriggerButton, { render: /* @__PURE__ */ (0, import_jsx_runtime195.jsx)( import_components100.Composite.Item, { id: generateDropdownTriggerCompositeId( idPrefix ), render: /* @__PURE__ */ (0, import_jsx_runtime195.jsx)( import_components100.Button, { size: "small", icon: more_vertical_default, label: (0, import_i18n95.__)("Actions"), accessibleWhenDisabled: true, disabled: !actions.length, onKeyDown: onDropdownTriggerKeyDown } ) } ) } ), /* @__PURE__ */ (0, import_jsx_runtime195.jsx)(Menu7.Popover, { children: /* @__PURE__ */ (0, import_jsx_runtime195.jsx)( ActionsMenuGroup, { actions: eligibleActions, item, registry, setActiveModalAction } ) }) ] }), !!activeModalAction && /* @__PURE__ */ (0, import_jsx_runtime195.jsx)( ActionModal, { action: activeModalAction, items: [item], closeModal: () => setActiveModalAction(null) } ) ] }) ] } ); return /* @__PURE__ */ (0, import_jsx_runtime195.jsx)( import_components100.Composite.Row, { ref: itemRef, render: ( /* aria-posinset breaks Composite.Row if passed to it directly. */ /* @__PURE__ */ (0, import_jsx_runtime195.jsx)( "div", { "aria-posinset": posinset, "aria-setsize": infiniteScrollEnabled ? paginationInfo.totalItems : void 0 } ) ), role: infiniteScrollEnabled ? "article" : "row", className: clsx_default({ "is-selected": isSelected2, "is-hovered": isHovered }), onMouseEnter: handleHover, onMouseLeave: handleHover, children: /* @__PURE__ */ (0, import_jsx_runtime195.jsxs)( Stack, { direction: "row", className: "dataviews-view-list__item-wrapper", children: [ /* @__PURE__ */ (0, import_jsx_runtime195.jsx)("div", { role: "gridcell", children: /* @__PURE__ */ (0, import_jsx_runtime195.jsx)( import_components100.Composite.Item, { id: generateItemWrapperCompositeId(idPrefix), "aria-pressed": isSelected2, "aria-labelledby": labelId, "aria-describedby": descriptionId, className: "dataviews-view-list__item", onClick: () => onSelect(item) } ) }), /* @__PURE__ */ (0, import_jsx_runtime195.jsxs)( Stack, { direction: "row", gap: "md", justify: "start", align: "flex-start", style: { flex: 1, minWidth: 0 }, children: [ renderedMediaField, /* @__PURE__ */ (0, import_jsx_runtime195.jsxs)( Stack, { direction: "column", gap: "xs", className: "dataviews-view-list__field-wrapper", children: [ /* @__PURE__ */ (0, import_jsx_runtime195.jsxs)(Stack, { direction: "row", align: "center", children: [ /* @__PURE__ */ (0, import_jsx_runtime195.jsx)( "div", { className: "dataviews-title-field dataviews-view-list__title-field", id: labelId, children: renderedTitleField } ), usedActions ] }), showDescription && descriptionField2?.render && /* @__PURE__ */ (0, import_jsx_runtime195.jsx)("div", { className: "dataviews-view-list__field", children: /* @__PURE__ */ (0, import_jsx_runtime195.jsx)( descriptionField2.render, { item, field: descriptionField2 } ) }), /* @__PURE__ */ (0, import_jsx_runtime195.jsx)( "div", { className: "dataviews-view-list__fields", id: descriptionId, children: otherFields.map((field) => /* @__PURE__ */ (0, import_jsx_runtime195.jsxs)( "div", { className: "dataviews-view-list__field", children: [ /* @__PURE__ */ (0, import_jsx_runtime195.jsx)( import_components100.VisuallyHidden, { as: "span", className: "dataviews-view-list__field-label", children: field.label } ), /* @__PURE__ */ (0, import_jsx_runtime195.jsx)("span", { className: "dataviews-view-list__field-value", children: /* @__PURE__ */ (0, import_jsx_runtime195.jsx)( field.render, { item, field } ) }) ] }, field.id )) } ) ] } ) ] } ) ] } ) } ); } function isDefined2(item) { return !!item; } function ViewList(props) { const { actions, data, fields, getItemId: getItemId2, isLoading, onChangeSelection, selection, view, className, empty } = props; const baseId = (0, import_compose16.useInstanceId)(ViewList, "view-list"); const isDelayedLoading = useDelayedLoading(!!isLoading); const selectedItem = data?.findLast( (item) => selection.includes(getItemId2(item)) ); const titleField = fields.find((field) => field.id === view.titleField); const mediaField = fields.find((field) => field.id === view.mediaField); const descriptionField2 = fields.find( (field) => field.id === view.descriptionField ); const otherFields = (view?.fields ?? []).map((fieldId) => fields.find((f2) => fieldId === f2.id)).filter(isDefined2); const onSelect = (item) => onChangeSelection([getItemId2(item)]); const generateCompositeItemIdPrefix = (0, import_element79.useCallback)( (item) => `${baseId}-${getItemId2(item)}`, [baseId, getItemId2] ); const isActiveCompositeItem = (0, import_element79.useCallback)( (item, idToCheck) => { return idToCheck.startsWith( generateCompositeItemIdPrefix(item) ); }, [generateCompositeItemIdPrefix] ); const [activeCompositeId, setActiveCompositeId] = (0, import_element79.useState)(void 0); (0, import_element79.useEffect)(() => { if (selectedItem) { setActiveCompositeId( generateItemWrapperCompositeId( generateCompositeItemIdPrefix(selectedItem) ) ); } }, [selectedItem, generateCompositeItemIdPrefix]); const activeItemIndex = data.findIndex( (item) => isActiveCompositeItem(item, activeCompositeId ?? "") ); const previousActiveItemIndex = (0, import_compose16.usePrevious)(activeItemIndex); const isActiveIdInList = activeItemIndex !== -1; const selectCompositeItem = (0, import_element79.useCallback)( (targetIndex, generateCompositeId) => { const clampedIndex = Math.min( data.length - 1, Math.max(0, targetIndex) ); if (!data[clampedIndex]) { return; } const itemIdPrefix = generateCompositeItemIdPrefix( data[clampedIndex] ); const targetCompositeItemId = generateCompositeId(itemIdPrefix); setActiveCompositeId(targetCompositeItemId); document.getElementById(targetCompositeItemId)?.focus(); }, [data, generateCompositeItemIdPrefix] ); (0, import_element79.useEffect)(() => { const wasActiveIdInList = previousActiveItemIndex !== void 0 && previousActiveItemIndex !== -1; if (!isActiveIdInList && wasActiveIdInList) { selectCompositeItem( previousActiveItemIndex, generateItemWrapperCompositeId ); } }, [isActiveIdInList, selectCompositeItem, previousActiveItemIndex]); const onDropdownTriggerKeyDown = (0, import_element79.useCallback)( (event) => { if (event.key === "ArrowDown") { event.preventDefault(); selectCompositeItem( activeItemIndex + 1, generateDropdownTriggerCompositeId ); } if (event.key === "ArrowUp") { event.preventDefault(); selectCompositeItem( activeItemIndex - 1, generateDropdownTriggerCompositeId ); } }, [selectCompositeItem, activeItemIndex] ); const hasData = !!data?.length; const groupField = view.groupBy?.field ? fields.find((field) => field.id === view.groupBy?.field) : null; const dataByGroup = hasData && groupField ? getDataByGroup(data, groupField) : null; const isInfiniteScroll = view.infiniteScrollEnabled && !dataByGroup; if (!hasData) { return /* @__PURE__ */ (0, import_jsx_runtime195.jsx)( "div", { className: clsx_default("dataviews-no-results", { "is-refreshing": isDelayedLoading }), children: empty } ); } if (hasData && groupField && dataByGroup) { return /* @__PURE__ */ (0, import_jsx_runtime195.jsx)( import_components100.Composite, { id: `${baseId}`, render: /* @__PURE__ */ (0, import_jsx_runtime195.jsx)("div", {}), className: "dataviews-view-list__group", role: "grid", activeId: activeCompositeId, setActiveId: setActiveCompositeId, children: /* @__PURE__ */ (0, import_jsx_runtime195.jsx)( Stack, { direction: "column", gap: "lg", className: clsx_default("dataviews-view-list", className), children: Array.from(dataByGroup.entries()).map( ([groupName, groupItems]) => /* @__PURE__ */ (0, import_jsx_runtime195.jsxs)( Stack, { direction: "column", gap: "sm", children: [ /* @__PURE__ */ (0, import_jsx_runtime195.jsx)("h3", { className: "dataviews-view-list__group-header", children: view.groupBy?.showLabel === false ? groupName : (0, import_i18n95.sprintf)( // translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022". (0, import_i18n95.__)("%1$s: %2$s"), groupField.label, groupName ) }), groupItems.map((item) => { const id = generateCompositeItemIdPrefix(item); return /* @__PURE__ */ (0, import_jsx_runtime195.jsx)( ListItem, { view, idPrefix: id, actions, item, isSelected: item === selectedItem, onSelect, mediaField, titleField, descriptionField: descriptionField2, otherFields, onDropdownTriggerKeyDown }, id ); }) ] }, groupName ) ) } ) } ); } return /* @__PURE__ */ (0, import_jsx_runtime195.jsxs)(import_jsx_runtime195.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime195.jsx)( import_components100.Composite, { id: baseId, render: /* @__PURE__ */ (0, import_jsx_runtime195.jsx)("div", {}), className: clsx_default("dataviews-view-list", className, { [`has-${view.layout?.density}-density`]: view.layout?.density && ["compact", "comfortable"].includes( view.layout.density ), "is-refreshing": !isInfiniteScroll && isDelayedLoading }), role: view.infiniteScrollEnabled ? "feed" : "grid", activeId: activeCompositeId, setActiveId: setActiveCompositeId, inert: !isInfiniteScroll && !!isLoading ? "true" : void 0, children: data.map((item, index) => { const id = generateCompositeItemIdPrefix(item); return /* @__PURE__ */ (0, import_jsx_runtime195.jsx)( ListItem, { view, idPrefix: id, actions, item, isSelected: item === selectedItem, onSelect, mediaField, titleField, descriptionField: descriptionField2, otherFields, onDropdownTriggerKeyDown, posinset: view.infiniteScrollEnabled ? index + 1 : void 0 }, id ); }) } ), isInfiniteScroll && isLoading && /* @__PURE__ */ (0, import_jsx_runtime195.jsx)("p", { className: "dataviews-loading-more", children: /* @__PURE__ */ (0, import_jsx_runtime195.jsx)(import_components100.Spinner, {}) }) ] }); } // packages/dataviews/build-module/components/dataviews-layouts/activity/index.mjs var import_components102 = __toESM(require_components(), 1); // packages/dataviews/build-module/components/dataviews-layouts/activity/activity-group.mjs var import_i18n96 = __toESM(require_i18n(), 1); var import_element80 = __toESM(require_element(), 1); var import_jsx_runtime196 = __toESM(require_jsx_runtime(), 1); function ActivityGroup({ groupName, groupData, groupField, showLabel = true, children }) { const groupHeader = showLabel ? (0, import_element80.createInterpolateElement)( // translators: %s: The label of the field e.g. "Status". (0, import_i18n96.sprintf)((0, import_i18n96.__)("%s: <groupName />"), groupField.label).trim(), { groupName: /* @__PURE__ */ (0, import_jsx_runtime196.jsx)( groupField.render, { item: groupData[0], field: groupField } ) } ) : /* @__PURE__ */ (0, import_jsx_runtime196.jsx)(groupField.render, { item: groupData[0], field: groupField }); return /* @__PURE__ */ (0, import_jsx_runtime196.jsxs)( Stack, { direction: "column", className: "dataviews-view-activity__group", children: [ /* @__PURE__ */ (0, import_jsx_runtime196.jsx)("h3", { className: "dataviews-view-activity__group-header", children: groupHeader }), children ] }, groupName ); } // packages/dataviews/build-module/components/dataviews-layouts/activity/activity-item.mjs var import_components101 = __toESM(require_components(), 1); var import_element81 = __toESM(require_element(), 1); var import_data62 = __toESM(require_data(), 1); var import_compose17 = __toESM(require_compose(), 1); var import_jsx_runtime197 = __toESM(require_jsx_runtime(), 1); function ActivityItem(props) { const { view, actions, item, titleField, mediaField, descriptionField: descriptionField2, otherFields, posinset, onClickItem, renderItemLink, isItemClickable } = props; const { showTitle = true, showMedia = true, showDescription = true, infiniteScrollEnabled } = view; const itemRef = (0, import_element81.useRef)(null); const registry = (0, import_data62.useRegistry)(); const { paginationInfo } = (0, import_element81.useContext)(dataviews_context_default); const { primaryActions, eligibleActions } = (0, import_element81.useMemo)(() => { const _eligibleActions = actions.filter( (action) => !action.isEligible || action.isEligible(item) ); const _primaryActions = _eligibleActions.filter( (action) => action.isPrimary ); return { primaryActions: _primaryActions, eligibleActions: _eligibleActions }; }, [actions, item]); const isMobileViewport = (0, import_compose17.useViewportMatch)("medium", "<"); const density = view.layout?.density ?? "balanced"; const mediaContent = showMedia && density !== "compact" && mediaField?.render ? /* @__PURE__ */ (0, import_jsx_runtime197.jsx)( mediaField.render, { item, field: mediaField, config: { sizes: density === "comfortable" ? "32px" : "24px" } } ) : null; const renderedMediaField = /* @__PURE__ */ (0, import_jsx_runtime197.jsx)("div", { className: "dataviews-view-activity__item-type-icon", children: mediaContent || /* @__PURE__ */ (0, import_jsx_runtime197.jsx)( "span", { className: "dataviews-view-activity__item-bullet", "aria-hidden": "true" } ) }); const renderedTitleField = showTitle && titleField?.render ? /* @__PURE__ */ (0, import_jsx_runtime197.jsx)(titleField.render, { item, field: titleField }) : null; const verticalGap = (0, import_element81.useMemo)(() => { switch (density) { case "comfortable": return "md"; default: return "sm"; } }, [density]); return /* @__PURE__ */ (0, import_jsx_runtime197.jsx)( "div", { ref: itemRef, role: infiniteScrollEnabled ? "article" : void 0, "aria-posinset": posinset, "aria-setsize": infiniteScrollEnabled ? paginationInfo.totalItems : void 0, className: clsx_default( "dataviews-view-activity__item", density === "compact" && "is-compact", density === "balanced" && "is-balanced", density === "comfortable" && "is-comfortable" ), children: /* @__PURE__ */ (0, import_jsx_runtime197.jsxs)(Stack, { direction: "row", gap: "lg", justify: "start", align: "flex-start", children: [ /* @__PURE__ */ (0, import_jsx_runtime197.jsx)( Stack, { direction: "column", gap: "xs", align: "center", className: "dataviews-view-activity__item-type", children: renderedMediaField } ), /* @__PURE__ */ (0, import_jsx_runtime197.jsxs)( Stack, { direction: "column", gap: verticalGap, align: "flex-start", className: "dataviews-view-activity__item-content", children: [ renderedTitleField && /* @__PURE__ */ (0, import_jsx_runtime197.jsx)( ItemClickWrapper, { item, isItemClickable, onClickItem, renderItemLink, className: "dataviews-view-activity__item-title", children: renderedTitleField } ), showDescription && descriptionField2 && /* @__PURE__ */ (0, import_jsx_runtime197.jsx)("div", { className: "dataviews-view-activity__item-description", children: /* @__PURE__ */ (0, import_jsx_runtime197.jsx)( descriptionField2.render, { item, field: descriptionField2 } ) }), /* @__PURE__ */ (0, import_jsx_runtime197.jsx)("div", { className: "dataviews-view-activity__item-fields", children: otherFields.map((field) => /* @__PURE__ */ (0, import_jsx_runtime197.jsxs)( "div", { className: "dataviews-view-activity__item-field", children: [ /* @__PURE__ */ (0, import_jsx_runtime197.jsx)( import_components101.VisuallyHidden, { as: "span", className: "dataviews-view-activity__item-field-label", children: field.label } ), /* @__PURE__ */ (0, import_jsx_runtime197.jsx)("span", { className: "dataviews-view-activity__item-field-value", children: /* @__PURE__ */ (0, import_jsx_runtime197.jsx)( field.render, { item, field } ) }) ] }, field.id )) }), !!primaryActions?.length && /* @__PURE__ */ (0, import_jsx_runtime197.jsx)( PrimaryActions, { item, actions: primaryActions, registry, buttonVariant: "secondary" } ) ] } ), (primaryActions.length < eligibleActions.length || // Since we hide primary actions on mobile, we need to show the menu // there if there are any actions at all. isMobileViewport && // At the same time, only show the menu if there are actions to show. eligibleActions.length > 0) && /* @__PURE__ */ (0, import_jsx_runtime197.jsx)("div", { className: "dataviews-view-activity__item-actions", children: /* @__PURE__ */ (0, import_jsx_runtime197.jsx)( ItemActions, { item, actions: eligibleActions, isCompact: true } ) }) ] }) } ); } var activity_item_default = ActivityItem; // packages/dataviews/build-module/components/dataviews-layouts/activity/activity-items.mjs var import_react7 = __toESM(require_react(), 1); function isDefined3(item) { return !!item; } function ActivityItems(props) { const { data, fields, getItemId: getItemId2, view } = props; const titleField = fields.find((field) => field.id === view.titleField); const mediaField = fields.find((field) => field.id === view.mediaField); const descriptionField2 = fields.find( (field) => field.id === view.descriptionField ); const otherFields = (view?.fields ?? []).map((fieldId) => fields.find((f2) => fieldId === f2.id)).filter(isDefined3); return data.map((item, index) => { return /* @__PURE__ */ (0, import_react7.createElement)( activity_item_default, { ...props, key: getItemId2(item), item, mediaField, titleField, descriptionField: descriptionField2, otherFields, posinset: view.infiniteScrollEnabled ? index + 1 : void 0 } ); }); } // packages/dataviews/build-module/components/dataviews-layouts/activity/index.mjs var import_jsx_runtime198 = __toESM(require_jsx_runtime(), 1); function ViewActivity(props) { const { empty, data, fields, isLoading, view, className } = props; const isDelayedLoading = useDelayedLoading(!!isLoading); const hasData = !!data?.length; const groupField = view.groupBy?.field ? fields.find((field) => field.id === view.groupBy?.field) : null; const dataByGroup = hasData && groupField ? getDataByGroup(data, groupField) : null; const isInfiniteScroll = view.infiniteScrollEnabled && !dataByGroup; if (!hasData) { return /* @__PURE__ */ (0, import_jsx_runtime198.jsx)( "div", { className: clsx_default("dataviews-no-results", { "is-refreshing": isDelayedLoading }), children: empty } ); } const isInert = !isInfiniteScroll && !!isLoading; const wrapperClassName = clsx_default("dataviews-view-activity", className, { "is-refreshing": !isInfiniteScroll && isDelayedLoading }); const groupedEntries = dataByGroup ? Array.from(dataByGroup.entries()) : []; if (hasData && groupField && dataByGroup) { return /* @__PURE__ */ (0, import_jsx_runtime198.jsx)( Stack, { direction: "column", gap: "sm", className: wrapperClassName, inert: isInert ? "true" : void 0, children: groupedEntries.map( ([groupName, groupData]) => /* @__PURE__ */ (0, import_jsx_runtime198.jsx)( ActivityGroup, { groupName, groupData, groupField, showLabel: view.groupBy?.showLabel !== false, children: /* @__PURE__ */ (0, import_jsx_runtime198.jsx)( ActivityItems, { ...props, data: groupData } ) }, groupName ) ) } ); } return /* @__PURE__ */ (0, import_jsx_runtime198.jsxs)(import_jsx_runtime198.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime198.jsx)( "div", { className: wrapperClassName, role: view.infiniteScrollEnabled ? "feed" : void 0, inert: isInert ? "true" : void 0, children: /* @__PURE__ */ (0, import_jsx_runtime198.jsx)(ActivityItems, { ...props }) } ), isInfiniteScroll && isLoading && /* @__PURE__ */ (0, import_jsx_runtime198.jsx)("p", { className: "dataviews-loading-more", children: /* @__PURE__ */ (0, import_jsx_runtime198.jsx)(import_components102.Spinner, {}) }) ] }); } // packages/dataviews/build-module/components/dataviews-layouts/picker-grid/index.mjs var import_components105 = __toESM(require_components(), 1); var import_i18n99 = __toESM(require_i18n(), 1); var import_compose18 = __toESM(require_compose(), 1); var import_element85 = __toESM(require_element(), 1); // packages/dataviews/build-module/components/dataviews-picker-footer/index.mjs var import_components104 = __toESM(require_components(), 1); var import_data63 = __toESM(require_data(), 1); var import_element83 = __toESM(require_element(), 1); var import_i18n98 = __toESM(require_i18n(), 1); // packages/dataviews/build-module/components/dataviews-pagination/index.mjs var import_components103 = __toESM(require_components(), 1); var import_element82 = __toESM(require_element(), 1); var import_i18n97 = __toESM(require_i18n(), 1); var import_jsx_runtime199 = __toESM(require_jsx_runtime(), 1); function DataViewsPagination() { const { view, onChangeView, paginationInfo: { totalItems = 0, totalPages } } = (0, import_element82.useContext)(dataviews_context_default); if (!totalItems || !totalPages || view.infiniteScrollEnabled) { return null; } const currentPage = view.page ?? 1; const pageSelectOptions = Array.from(Array(totalPages)).map( (_, i2) => { const page = i2 + 1; return { value: page.toString(), label: page.toString(), "aria-label": currentPage === page ? (0, import_i18n97.sprintf)( // translators: 1: current page number. 2: total number of pages. (0, import_i18n97.__)("Page %1$d of %2$d"), currentPage, totalPages ) : page.toString() }; } ); return !!totalItems && totalPages !== 1 && /* @__PURE__ */ (0, import_jsx_runtime199.jsxs)( Stack, { direction: "row", className: "dataviews-pagination", justify: "end", align: "center", gap: "xl", children: [ /* @__PURE__ */ (0, import_jsx_runtime199.jsx)( Stack, { direction: "row", justify: "flex-start", align: "center", gap: "xs", className: "dataviews-pagination__page-select", children: (0, import_element82.createInterpolateElement)( (0, import_i18n97.sprintf)( // translators: 1: Current page number, 2: Total number of pages. (0, import_i18n97._x)( "<div>Page</div>%1$s<div>of %2$d</div>", "paging" ), "<CurrentPage />", totalPages ), { div: /* @__PURE__ */ (0, import_jsx_runtime199.jsx)("div", { "aria-hidden": true }), CurrentPage: /* @__PURE__ */ (0, import_jsx_runtime199.jsx)( import_components103.SelectControl, { "aria-label": (0, import_i18n97.__)("Current page"), value: currentPage.toString(), options: pageSelectOptions, onChange: (newValue) => { onChangeView({ ...view, page: +newValue }); }, size: "small", variant: "minimal" } ) } ) } ), /* @__PURE__ */ (0, import_jsx_runtime199.jsxs)(Stack, { direction: "row", gap: "xs", align: "center", children: [ /* @__PURE__ */ (0, import_jsx_runtime199.jsx)( import_components103.Button, { onClick: () => onChangeView({ ...view, page: currentPage - 1 }), disabled: currentPage === 1, accessibleWhenDisabled: true, label: (0, import_i18n97.__)("Previous page"), icon: (0, import_i18n97.isRTL)() ? next_default : previous_default, showTooltip: true, size: "compact", tooltipPosition: "top" } ), /* @__PURE__ */ (0, import_jsx_runtime199.jsx)( import_components103.Button, { onClick: () => onChangeView({ ...view, page: currentPage + 1 }), disabled: currentPage >= totalPages, accessibleWhenDisabled: true, label: (0, import_i18n97.__)("Next page"), icon: (0, import_i18n97.isRTL)() ? previous_default : next_default, showTooltip: true, size: "compact", tooltipPosition: "top" } ) ] }) ] } ); } var dataviews_pagination_default = (0, import_element82.memo)(DataViewsPagination); // packages/dataviews/build-module/components/dataviews-picker-footer/index.mjs var import_jsx_runtime200 = __toESM(require_jsx_runtime(), 1); function useIsMultiselectPicker(actions) { return (0, import_element83.useMemo)(() => { return actions?.every((action) => action.supportsBulk); }, [actions]); } // packages/dataviews/build-module/components/dataviews-layouts/utils/grid-items.mjs var import_element84 = __toESM(require_element(), 1); var import_jsx_runtime201 = __toESM(require_jsx_runtime(), 1); var GridItems = (0, import_element84.forwardRef)(({ className, previewSize, ...props }, ref) => { return /* @__PURE__ */ (0, import_jsx_runtime201.jsx)( "div", { ref, className: clsx_default("dataviews-view-grid-items", className), style: { gridTemplateColumns: previewSize && `repeat(auto-fill, minmax(${previewSize}px, 1fr))` }, ...props } ); }); // packages/dataviews/build-module/components/dataviews-layouts/picker-grid/index.mjs var import_jsx_runtime202 = __toESM(require_jsx_runtime(), 1); var { Badge: Badge4 } = unlock3(import_components105.privateApis); function GridItem3({ view, multiselect, selection, onChangeSelection, getItemId: getItemId2, item, mediaField, titleField, descriptionField: descriptionField2, regularFields, badgeFields, config: config2, posinset, setsize }) { const { showTitle = true, showMedia = true, showDescription = true } = view; const id = getItemId2(item); const isSelected2 = selection.includes(id); const renderedMediaField = mediaField?.render ? /* @__PURE__ */ (0, import_jsx_runtime202.jsx)( mediaField.render, { item, field: mediaField, config: config2 } ) : null; const renderedTitleField = showTitle && titleField?.render ? /* @__PURE__ */ (0, import_jsx_runtime202.jsx)(titleField.render, { item, field: titleField }) : null; return /* @__PURE__ */ (0, import_jsx_runtime202.jsxs)( import_components105.Composite.Item, { "aria-label": titleField ? titleField.getValue({ item }) || (0, import_i18n99.__)("(no title)") : void 0, render: ({ children, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime202.jsx)(Stack, { direction: "column", children, ...props }), role: "option", "aria-posinset": posinset, "aria-setsize": setsize, className: clsx_default("dataviews-view-picker-grid__card", { "is-selected": isSelected2 }), "aria-selected": isSelected2, onClick: () => { if (isSelected2) { onChangeSelection( selection.filter((itemId) => id !== itemId) ); } else { const newSelection = multiselect ? [...selection, id] : [id]; onChangeSelection(newSelection); } }, children: [ showMedia && renderedMediaField && /* @__PURE__ */ (0, import_jsx_runtime202.jsx)("div", { className: "dataviews-view-picker-grid__media", children: renderedMediaField }), showMedia && renderedMediaField && /* @__PURE__ */ (0, import_jsx_runtime202.jsx)( DataViewsSelectionCheckbox, { item, selection, onChangeSelection, getItemId: getItemId2, titleField, disabled: false, "aria-hidden": true, tabIndex: -1 } ), showTitle && /* @__PURE__ */ (0, import_jsx_runtime202.jsx)( Stack, { direction: "row", justify: "space-between", className: "dataviews-view-picker-grid__title-actions", children: /* @__PURE__ */ (0, import_jsx_runtime202.jsx)("div", { className: "dataviews-view-picker-grid__title-field dataviews-title-field", children: renderedTitleField }) } ), /* @__PURE__ */ (0, import_jsx_runtime202.jsxs)(Stack, { direction: "column", gap: "xs", children: [ showDescription && descriptionField2?.render && /* @__PURE__ */ (0, import_jsx_runtime202.jsx)( descriptionField2.render, { item, field: descriptionField2 } ), !!badgeFields?.length && /* @__PURE__ */ (0, import_jsx_runtime202.jsx)( Stack, { direction: "row", className: "dataviews-view-picker-grid__badge-fields", gap: "sm", wrap: "wrap", align: "top", justify: "flex-start", children: badgeFields.map((field) => { return /* @__PURE__ */ (0, import_jsx_runtime202.jsx)( Badge4, { className: "dataviews-view-picker-grid__field-value", children: /* @__PURE__ */ (0, import_jsx_runtime202.jsx)( field.render, { item, field } ) }, field.id ); }) } ), !!regularFields?.length && /* @__PURE__ */ (0, import_jsx_runtime202.jsx)( Stack, { direction: "column", className: "dataviews-view-picker-grid__fields", gap: "xs", children: regularFields.map((field) => { return /* @__PURE__ */ (0, import_jsx_runtime202.jsx)( import_components105.Flex, { className: "dataviews-view-picker-grid__field", gap: 1, justify: "flex-start", expanded: true, style: { height: "auto" }, direction: "row", children: /* @__PURE__ */ (0, import_jsx_runtime202.jsxs)(import_jsx_runtime202.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime202.jsx)(import_components105.FlexItem, { className: "dataviews-view-picker-grid__field-name", children: field.header }), /* @__PURE__ */ (0, import_jsx_runtime202.jsx)( import_components105.FlexItem, { className: "dataviews-view-picker-grid__field-value", style: { maxHeight: "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime202.jsx)( field.render, { item, field } ) } ) ] }) }, field.id ); }) } ) ] }) ] }, id ); } function GridGroup({ groupName, groupField, showLabel = true, children }) { const headerId = (0, import_compose18.useInstanceId)( GridGroup, "dataviews-view-picker-grid-group__header" ); return /* @__PURE__ */ (0, import_jsx_runtime202.jsxs)( Stack, { direction: "column", gap: "sm", role: "group", "aria-labelledby": headerId, children: [ /* @__PURE__ */ (0, import_jsx_runtime202.jsx)( "h3", { className: "dataviews-view-picker-grid-group__header", id: headerId, children: showLabel ? (0, import_i18n99.sprintf)( // translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022". (0, import_i18n99.__)("%1$s: %2$s"), groupField.label, groupName ) : groupName } ), children ] }, groupName ); } function ViewPickerGrid({ actions, data, fields, getItemId: getItemId2, isLoading, onChangeSelection, selection, view, className, empty }) { const { resizeObserverRef, paginationInfo, itemListLabel } = (0, import_element85.useContext)(dataviews_context_default); const titleField = fields.find( (field) => field.id === view?.titleField ); const mediaField = fields.find( (field) => field.id === view?.mediaField ); const descriptionField2 = fields.find( (field) => field.id === view?.descriptionField ); const otherFields = view.fields ?? []; const { regularFields, badgeFields } = otherFields.reduce( (accumulator, fieldId) => { const field = fields.find((f2) => f2.id === fieldId); if (!field) { return accumulator; } const key = view.layout?.badgeFields?.includes(fieldId) ? "badgeFields" : "regularFields"; accumulator[key].push(field); return accumulator; }, { regularFields: [], badgeFields: [] } ); const hasData = !!data?.length; const usedPreviewSize = view.layout?.previewSize; const isMultiselect = useIsMultiselectPicker(actions); const size = "900px"; const groupField = view.groupBy?.field ? fields.find((f2) => f2.id === view.groupBy?.field) : null; const dataByGroup = groupField ? getDataByGroup(data, groupField) : null; const isInfiniteScroll = view.infiniteScrollEnabled && !dataByGroup; const currentPage = view?.page ?? 1; const perPage = view?.perPage ?? 0; const setSize = isInfiniteScroll ? paginationInfo?.totalItems : void 0; return /* @__PURE__ */ (0, import_jsx_runtime202.jsxs)(import_jsx_runtime202.Fragment, { // Render multiple groups. children: [ hasData && groupField && dataByGroup && /* @__PURE__ */ (0, import_jsx_runtime202.jsx)( import_components105.Composite, { virtualFocus: true, orientation: "horizontal", role: "listbox", "aria-multiselectable": isMultiselect, className: clsx_default( "dataviews-view-picker-grid", className ), "aria-label": itemListLabel, render: ({ children, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime202.jsx)( Stack, { direction: "column", gap: "lg", children, ...props } ), children: Array.from(dataByGroup.entries()).map( ([groupName, groupItems]) => /* @__PURE__ */ (0, import_jsx_runtime202.jsx)( GridGroup, { groupName, groupField, showLabel: view.groupBy?.showLabel !== false, children: /* @__PURE__ */ (0, import_jsx_runtime202.jsx)( GridItems, { previewSize: usedPreviewSize, style: { gridTemplateColumns: usedPreviewSize && `repeat(auto-fill, minmax(${usedPreviewSize}px, 1fr))` }, "aria-busy": isLoading, ref: resizeObserverRef, children: groupItems.map((item) => { const posInSet = (currentPage - 1) * perPage + data.indexOf(item) + 1; return /* @__PURE__ */ (0, import_jsx_runtime202.jsx)( GridItem3, { view, multiselect: isMultiselect, selection, onChangeSelection, getItemId: getItemId2, item, mediaField, titleField, descriptionField: descriptionField2, regularFields, badgeFields, config: { sizes: size }, posinset: posInSet, setsize: setSize }, getItemId2(item) ); }) } ) }, groupName ) ) } ), // Render a single grid with all data. hasData && !dataByGroup && /* @__PURE__ */ (0, import_jsx_runtime202.jsx)( import_components105.Composite, { render: /* @__PURE__ */ (0, import_jsx_runtime202.jsx)( GridItems, { className: clsx_default( "dataviews-view-picker-grid", className ), previewSize: usedPreviewSize, "aria-busy": isLoading, ref: resizeObserverRef } ), virtualFocus: true, orientation: "horizontal", role: "listbox", "aria-multiselectable": isMultiselect, "aria-label": itemListLabel, children: data.map((item, index) => { let posinset = isInfiniteScroll ? index + 1 : void 0; if (!isInfiniteScroll) { posinset = (currentPage - 1) * perPage + index + 1; } return /* @__PURE__ */ (0, import_jsx_runtime202.jsx)( GridItem3, { view, multiselect: isMultiselect, selection, onChangeSelection, getItemId: getItemId2, item, mediaField, titleField, descriptionField: descriptionField2, regularFields, badgeFields, config: { sizes: size }, posinset, setsize: setSize }, getItemId2(item) ); }) } ), // Render empty state. !hasData && /* @__PURE__ */ (0, import_jsx_runtime202.jsx)( "div", { className: clsx_default({ "dataviews-loading": isLoading, "dataviews-no-results": !isLoading }), children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime202.jsx)("p", { children: /* @__PURE__ */ (0, import_jsx_runtime202.jsx)(import_components105.Spinner, {}) }) : empty } ), hasData && isLoading && /* @__PURE__ */ (0, import_jsx_runtime202.jsx)("p", { className: "dataviews-loading-more", children: /* @__PURE__ */ (0, import_jsx_runtime202.jsx)(import_components105.Spinner, {}) }) ] }); } var picker_grid_default = ViewPickerGrid; // packages/dataviews/build-module/components/dataviews-layouts/picker-table/index.mjs var import_i18n100 = __toESM(require_i18n(), 1); var import_components106 = __toESM(require_components(), 1); var import_element86 = __toESM(require_element(), 1); var import_jsx_runtime203 = __toESM(require_jsx_runtime(), 1); function TableColumnField2({ item, fields, column, align }) { const field = fields.find((f2) => f2.id === column); if (!field) { return null; } const className = clsx_default("dataviews-view-table__cell-content-wrapper", { "dataviews-view-table__cell-align-end": align === "end", "dataviews-view-table__cell-align-center": align === "center" }); return /* @__PURE__ */ (0, import_jsx_runtime203.jsx)("div", { className, children: /* @__PURE__ */ (0, import_jsx_runtime203.jsx)(field.render, { item, field }) }); } function TableRow2({ item, fields, id, view, titleField, mediaField, descriptionField: descriptionField2, selection, getItemId: getItemId2, onChangeSelection, multiselect, posinset }) { const { paginationInfo } = (0, import_element86.useContext)(dataviews_context_default); const isSelected2 = selection.includes(id); const [isHovered, setIsHovered] = (0, import_element86.useState)(false); const { showTitle = true, showMedia = true, showDescription = true, infiniteScrollEnabled } = view; const handleMouseEnter = () => { setIsHovered(true); }; const handleMouseLeave = () => { setIsHovered(false); }; const columns = view.fields ?? []; const hasPrimaryColumn = titleField && showTitle || mediaField && showMedia || descriptionField2 && showDescription; return /* @__PURE__ */ (0, import_jsx_runtime203.jsxs)( import_components106.Composite.Item, { render: ({ children, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime203.jsx)( "tr", { className: clsx_default("dataviews-view-table__row", { "is-selected": isSelected2, "is-hovered": isHovered }), onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, children, ...props } ), "aria-selected": isSelected2, "aria-setsize": paginationInfo.totalItems || void 0, "aria-posinset": posinset, role: infiniteScrollEnabled ? "article" : "option", onClick: () => { if (isSelected2) { onChangeSelection( selection.filter((itemId) => id !== itemId) ); } else { const newSelection = multiselect ? [...selection, id] : [id]; onChangeSelection(newSelection); } }, children: [ /* @__PURE__ */ (0, import_jsx_runtime203.jsx)( "td", { className: "dataviews-view-table__checkbox-column", role: "presentation", children: /* @__PURE__ */ (0, import_jsx_runtime203.jsx)("div", { className: "dataviews-view-table__cell-content-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime203.jsx)( DataViewsSelectionCheckbox, { item, selection, onChangeSelection, getItemId: getItemId2, titleField, disabled: false, "aria-hidden": true, tabIndex: -1 } ) }) } ), hasPrimaryColumn && /* @__PURE__ */ (0, import_jsx_runtime203.jsx)("td", { role: "presentation", children: /* @__PURE__ */ (0, import_jsx_runtime203.jsx)( column_primary_default, { item, titleField: showTitle ? titleField : void 0, mediaField: showMedia ? mediaField : void 0, descriptionField: showDescription ? descriptionField2 : void 0, isItemClickable: () => false } ) }), columns.map((column) => { const { width, maxWidth, minWidth, align } = view.layout?.styles?.[column] ?? {}; return /* @__PURE__ */ (0, import_jsx_runtime203.jsx)( "td", { style: { width, maxWidth, minWidth }, role: "presentation", children: /* @__PURE__ */ (0, import_jsx_runtime203.jsx)( TableColumnField2, { fields, item, column, align } ) }, column ); }) ] }, id ); } function ViewPickerTable({ actions, data, fields, getItemId: getItemId2, isLoading = false, onChangeView, onChangeSelection, selection, setOpenedFilter, view, className, empty }) { const headerMenuRefs = (0, import_element86.useRef)(/* @__PURE__ */ new Map()); const headerMenuToFocusRef = (0, import_element86.useRef)(void 0); const [nextHeaderMenuToFocus, setNextHeaderMenuToFocus] = (0, import_element86.useState)(); const isMultiselect = useIsMultiselectPicker(actions) ?? false; (0, import_element86.useEffect)(() => { if (headerMenuToFocusRef.current) { headerMenuToFocusRef.current.focus(); headerMenuToFocusRef.current = void 0; } }); const tableNoticeId = (0, import_element86.useId)(); if (nextHeaderMenuToFocus) { headerMenuToFocusRef.current = nextHeaderMenuToFocus; setNextHeaderMenuToFocus(void 0); return; } const onHide = (field) => { const hidden = headerMenuRefs.current.get(field.id); const fallback = hidden ? headerMenuRefs.current.get(hidden.fallback) : void 0; setNextHeaderMenuToFocus(fallback?.node); }; const hasData = !!data?.length; const titleField = fields.find((field) => field.id === view.titleField); const mediaField = fields.find((field) => field.id === view.mediaField); const descriptionField2 = fields.find( (field) => field.id === view.descriptionField ); const groupField = view.groupBy?.field ? fields.find((f2) => f2.id === view.groupBy?.field) : null; const dataByGroup = groupField ? getDataByGroup(data, groupField) : null; const { showTitle = true, showMedia = true, showDescription = true } = view; const hasPrimaryColumn = titleField && showTitle || mediaField && showMedia || descriptionField2 && showDescription; const columns = view.fields ?? []; const headerMenuRef = (column, index) => (node) => { if (node) { headerMenuRefs.current.set(column, { node, fallback: columns[index > 0 ? index - 1 : 1] }); } else { headerMenuRefs.current.delete(column); } }; const isInfiniteScroll = view.infiniteScrollEnabled && !dataByGroup; return /* @__PURE__ */ (0, import_jsx_runtime203.jsxs)(import_jsx_runtime203.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime203.jsxs)( "table", { className: clsx_default( "dataviews-view-table", "dataviews-view-picker-table", className, { [`has-${view.layout?.density}-density`]: view.layout?.density && ["compact", "comfortable"].includes( view.layout.density ) } ), "aria-busy": isLoading, "aria-describedby": tableNoticeId, role: isInfiniteScroll ? "feed" : "listbox", children: [ /* @__PURE__ */ (0, import_jsx_runtime203.jsx)("thead", { role: "presentation", children: /* @__PURE__ */ (0, import_jsx_runtime203.jsxs)( "tr", { className: "dataviews-view-table__row", role: "presentation", children: [ /* @__PURE__ */ (0, import_jsx_runtime203.jsx)("th", { className: "dataviews-view-table__checkbox-column", children: isMultiselect && /* @__PURE__ */ (0, import_jsx_runtime203.jsx)( BulkSelectionCheckbox, { selection, onChangeSelection, data, actions, getItemId: getItemId2 } ) }), hasPrimaryColumn && /* @__PURE__ */ (0, import_jsx_runtime203.jsx)("th", { children: titleField && /* @__PURE__ */ (0, import_jsx_runtime203.jsx)( column_header_menu_default, { ref: headerMenuRef( titleField.id, 0 ), fieldId: titleField.id, view, fields, onChangeView, onHide, setOpenedFilter, canMove: false } ) }), columns.map((column, index) => { const { width, maxWidth, minWidth, align } = view.layout?.styles?.[column] ?? {}; return /* @__PURE__ */ (0, import_jsx_runtime203.jsx)( "th", { style: { width, maxWidth, minWidth, textAlign: align }, "aria-sort": view.sort?.direction && view.sort?.field === column ? sortValues[view.sort.direction] : void 0, scope: "col", children: /* @__PURE__ */ (0, import_jsx_runtime203.jsx)( column_header_menu_default, { ref: headerMenuRef(column, index), fieldId: column, view, fields, onChangeView, onHide, setOpenedFilter, canMove: view.layout?.enableMoving ?? true } ) }, column ); }) ] } ) }), hasData && groupField && dataByGroup ? Array.from(dataByGroup.entries()).map( ([groupName, groupItems]) => /* @__PURE__ */ (0, import_jsx_runtime203.jsxs)( import_components106.Composite, { virtualFocus: true, orientation: "vertical", render: /* @__PURE__ */ (0, import_jsx_runtime203.jsx)("tbody", { role: "group" }), children: [ /* @__PURE__ */ (0, import_jsx_runtime203.jsx)( "tr", { className: "dataviews-view-table__group-header-row", role: "presentation", children: /* @__PURE__ */ (0, import_jsx_runtime203.jsx)( "td", { colSpan: columns.length + (hasPrimaryColumn ? 1 : 0) + 1, className: "dataviews-view-table__group-header-cell", role: "presentation", children: view.groupBy?.showLabel === false ? groupName : (0, import_i18n100.sprintf)( // translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022". (0, import_i18n100.__)("%1$s: %2$s"), groupField.label, groupName ) } ) } ), groupItems.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime203.jsx)( TableRow2, { item, fields, id: getItemId2(item) || index.toString(), view, titleField, mediaField, descriptionField: descriptionField2, selection, getItemId: getItemId2, onChangeSelection, multiselect: isMultiselect }, getItemId2(item) )) ] }, `group-${groupName}` ) ) : /* @__PURE__ */ (0, import_jsx_runtime203.jsx)( import_components106.Composite, { render: /* @__PURE__ */ (0, import_jsx_runtime203.jsx)("tbody", { role: "presentation" }), virtualFocus: true, orientation: "vertical", children: hasData && data.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime203.jsx)( TableRow2, { item, fields, id: getItemId2(item) || index.toString(), view, titleField, mediaField, descriptionField: descriptionField2, selection, getItemId: getItemId2, onChangeSelection, multiselect: isMultiselect, posinset: index + 1 }, getItemId2(item) )) } ) ] } ), /* @__PURE__ */ (0, import_jsx_runtime203.jsxs)( "div", { className: clsx_default({ "dataviews-loading": isLoading, "dataviews-no-results": !hasData && !isLoading }), id: tableNoticeId, children: [ !hasData && (isLoading ? /* @__PURE__ */ (0, import_jsx_runtime203.jsx)("p", { children: /* @__PURE__ */ (0, import_jsx_runtime203.jsx)(import_components106.Spinner, {}) }) : empty), hasData && isLoading && /* @__PURE__ */ (0, import_jsx_runtime203.jsx)("p", { className: "dataviews-loading-more", children: /* @__PURE__ */ (0, import_jsx_runtime203.jsx)(import_components106.Spinner, {}) }) ] } ) ] }); } var picker_table_default = ViewPickerTable; // packages/dataviews/build-module/components/dataviews-layouts/utils/preview-size-picker.mjs var import_components107 = __toESM(require_components(), 1); var import_i18n101 = __toESM(require_i18n(), 1); var import_element87 = __toESM(require_element(), 1); var import_jsx_runtime204 = __toESM(require_jsx_runtime(), 1); var imageSizes2 = [ { value: 120, breakpoint: 1 }, { value: 170, breakpoint: 1 }, { value: 230, breakpoint: 1 }, { value: 290, breakpoint: 1112 // at minimum image width, 4 images display at this container size }, { value: 350, breakpoint: 1636 // at minimum image width, 6 images display at this container size }, { value: 430, breakpoint: 588 // at minimum image width, 2 images display at this container size } ]; function PreviewSizePicker() { const context = (0, import_element87.useContext)(dataviews_context_default); const view = context.view; const breakValues = imageSizes2.filter((size) => { return context.containerWidth >= size.breakpoint; }); const layoutPreviewSize = view.layout?.previewSize ?? 230; const previewSizeToUse = breakValues.map((size, index) => ({ ...size, index })).filter((size) => size.value <= layoutPreviewSize).sort((a2, b2) => b2.value - a2.value)[0]?.index ?? 0; const marks = breakValues.map((size, index) => { return { value: index }; }); return /* @__PURE__ */ (0, import_jsx_runtime204.jsx)( import_components107.RangeControl, { __next40pxDefaultSize: true, showTooltip: false, label: (0, import_i18n101.__)("Preview size"), value: previewSizeToUse, min: 0, max: breakValues.length - 1, withInputField: false, onChange: (value = 0) => { context.onChangeView({ ...view, layout: { ...view.layout, previewSize: breakValues[value].value } }); }, step: 1, marks } ); } // packages/dataviews/build-module/components/dataviews-layouts/utils/density-picker.mjs var import_components108 = __toESM(require_components(), 1); var import_i18n102 = __toESM(require_i18n(), 1); var import_element88 = __toESM(require_element(), 1); var import_jsx_runtime205 = __toESM(require_jsx_runtime(), 1); function DensityPicker() { const context = (0, import_element88.useContext)(dataviews_context_default); const view = context.view; return /* @__PURE__ */ (0, import_jsx_runtime205.jsxs)( import_components108.__experimentalToggleGroupControl, { size: "__unstable-large", label: (0, import_i18n102.__)("Density"), value: view.layout?.density || "balanced", onChange: (value) => { context.onChangeView({ ...view, layout: { ...view.layout, density: value } }); }, isBlock: true, children: [ /* @__PURE__ */ (0, import_jsx_runtime205.jsx)( import_components108.__experimentalToggleGroupControlOption, { value: "comfortable", label: (0, import_i18n102._x)( "Comfortable", "Density option for DataView layout" ) }, "comfortable" ), /* @__PURE__ */ (0, import_jsx_runtime205.jsx)( import_components108.__experimentalToggleGroupControlOption, { value: "balanced", label: (0, import_i18n102._x)("Balanced", "Density option for DataView layout") }, "balanced" ), /* @__PURE__ */ (0, import_jsx_runtime205.jsx)( import_components108.__experimentalToggleGroupControlOption, { value: "compact", label: (0, import_i18n102._x)("Compact", "Density option for DataView layout") }, "compact" ) ] } ); } // packages/dataviews/build-module/components/dataviews-layouts/index.mjs var VIEW_LAYOUTS = [ { type: LAYOUT_TABLE2, label: (0, import_i18n103.__)("Table"), component: table_default, icon: block_table_default, viewConfigOptions: DensityPicker }, { type: LAYOUT_GRID2, label: (0, import_i18n103.__)("Grid"), component: grid_default, icon: category_default, viewConfigOptions: PreviewSizePicker }, { type: LAYOUT_LIST2, label: (0, import_i18n103.__)("List"), component: ViewList, icon: (0, import_i18n103.isRTL)() ? format_list_bullets_rtl_default : format_list_bullets_default, viewConfigOptions: DensityPicker }, { type: LAYOUT_ACTIVITY, label: (0, import_i18n103.__)("Activity"), component: ViewActivity, icon: scheduled_default, viewConfigOptions: DensityPicker }, { type: LAYOUT_PICKER_GRID, label: (0, import_i18n103.__)("Grid"), component: picker_grid_default, icon: category_default, viewConfigOptions: PreviewSizePicker, isPicker: true }, { type: LAYOUT_PICKER_TABLE, label: (0, import_i18n103.__)("Table"), component: picker_table_default, icon: block_table_default, viewConfigOptions: DensityPicker, isPicker: true } ]; // packages/dataviews/build-module/components/dataviews-filters/filters.mjs var import_element96 = __toESM(require_element(), 1); // packages/dataviews/build-module/components/dataviews-filters/filter.mjs var import_components111 = __toESM(require_components(), 1); var import_i18n106 = __toESM(require_i18n(), 1); var import_element93 = __toESM(require_element(), 1); // node_modules/@ariakit/core/esm/__chunks/XMCVU3LR.js function noop3(..._) { } function applyState(argument, currentValue) { if (isUpdater(argument)) { const value = isLazyValue(currentValue) ? currentValue() : currentValue; return argument(value); } return argument; } function isUpdater(argument) { return typeof argument === "function"; } function isLazyValue(value) { return typeof value === "function"; } function hasOwnProperty(object, prop) { if (typeof Object.hasOwn === "function") { return Object.hasOwn(object, prop); } return Object.prototype.hasOwnProperty.call(object, prop); } function chain(...fns) { return (...args) => { for (const fn of fns) { if (typeof fn === "function") { fn(...args); } } }; } function normalizeString2(str) { return str.normalize("NFD").replace(/[\u0300-\u036f]/g, ""); } function omit(object, keys) { const result = { ...object }; for (const key of keys) { if (hasOwnProperty(result, key)) { delete result[key]; } } return result; } function pick(object, paths) { const result = {}; for (const key of paths) { if (hasOwnProperty(object, key)) { result[key] = object[key]; } } return result; } function identity(value) { return value; } function invariant(condition, message2) { if (condition) return; if (typeof message2 !== "string") throw new Error("Invariant failed"); throw new Error(message2); } function getKeys(obj) { return Object.keys(obj); } function isFalsyBooleanCallback(booleanOrCallback, ...args) { const result = typeof booleanOrCallback === "function" ? booleanOrCallback(...args) : booleanOrCallback; if (result == null) return false; return !result; } function disabledFromProps(props) { return props.disabled || props["aria-disabled"] === true || props["aria-disabled"] === "true"; } function removeUndefinedValues(obj) { const result = {}; for (const key in obj) { if (obj[key] !== void 0) { result[key] = obj[key]; } } return result; } function defaultValue(...values) { for (const value of values) { if (value !== void 0) return value; } return void 0; } // node_modules/@ariakit/react-core/esm/__chunks/YXGXYGQX.js var import_react8 = __toESM(require_react(), 1); function setRef(ref, value) { if (typeof ref === "function") { ref(value); } else if (ref) { ref.current = value; } } function isValidElementWithRef(element) { if (!element) return false; if (!(0, import_react8.isValidElement)(element)) return false; if ("ref" in element.props) return true; if ("ref" in element) return true; return false; } function getRefProperty(element) { if (!isValidElementWithRef(element)) return null; const props = { ...element.props }; return props.ref || element.ref; } function mergeProps2(base, overrides) { const props = { ...base }; for (const key in overrides) { if (!hasOwnProperty(overrides, key)) continue; if (key === "className") { const prop = "className"; props[prop] = base[prop] ? `${base[prop]} ${overrides[prop]}` : overrides[prop]; continue; } if (key === "style") { const prop = "style"; props[prop] = base[prop] ? { ...base[prop], ...overrides[prop] } : overrides[prop]; continue; } const overrideValue = overrides[key]; if (typeof overrideValue === "function" && key.startsWith("on")) { const baseValue = base[key]; if (typeof baseValue === "function") { props[key] = (...args) => { overrideValue(...args); baseValue(...args); }; continue; } } props[key] = overrideValue; } return props; } // node_modules/@ariakit/core/esm/__chunks/3DNM6L6E.js var canUseDOM = checkIsBrowser(); function checkIsBrowser() { var _a; return typeof window !== "undefined" && !!((_a = window.document) == null ? void 0 : _a.createElement); } function getDocument(node) { if (!node) return document; if ("self" in node) return node.document; return node.ownerDocument || document; } function getActiveElement(node, activeDescendant = false) { var _a; const { activeElement } = getDocument(node); if (!(activeElement == null ? void 0 : activeElement.nodeName)) { return null; } if (isFrame(activeElement) && ((_a = activeElement.contentDocument) == null ? void 0 : _a.body)) { return getActiveElement( activeElement.contentDocument.body, activeDescendant ); } if (activeDescendant) { const id = activeElement.getAttribute("aria-activedescendant"); if (id) { const element = getDocument(activeElement).getElementById(id); if (element) { return element; } } } return activeElement; } function contains(parent, child) { return parent === child || parent.contains(child); } function isFrame(element) { return element.tagName === "IFRAME"; } function isButton(element) { const tagName = element.tagName.toLowerCase(); if (tagName === "button") return true; if (tagName === "input" && element.type) { return buttonInputTypes.indexOf(element.type) !== -1; } return false; } var buttonInputTypes = [ "button", "color", "file", "image", "reset", "submit" ]; function isVisible(element) { if (typeof element.checkVisibility === "function") { return element.checkVisibility(); } const htmlElement = element; return htmlElement.offsetWidth > 0 || htmlElement.offsetHeight > 0 || element.getClientRects().length > 0; } function isTextField(element) { try { const isTextInput = element instanceof HTMLInputElement && element.selectionStart !== null; const isTextArea = element.tagName === "TEXTAREA"; return isTextInput || isTextArea || false; } catch (_error) { return false; } } function isTextbox(element) { return element.isContentEditable || isTextField(element); } function getTextboxValue(element) { if (isTextField(element)) { return element.value; } if (element.isContentEditable) { const range = getDocument(element).createRange(); range.selectNodeContents(element); return range.toString(); } return ""; } function getTextboxSelection(element) { let start2 = 0; let end = 0; if (isTextField(element)) { start2 = element.selectionStart || 0; end = element.selectionEnd || 0; } else if (element.isContentEditable) { const selection = getDocument(element).getSelection(); if ((selection == null ? void 0 : selection.rangeCount) && selection.anchorNode && contains(element, selection.anchorNode) && selection.focusNode && contains(element, selection.focusNode)) { const range = selection.getRangeAt(0); const nextRange = range.cloneRange(); nextRange.selectNodeContents(element); nextRange.setEnd(range.startContainer, range.startOffset); start2 = nextRange.toString().length; nextRange.setEnd(range.endContainer, range.endOffset); end = nextRange.toString().length; } } return { start: start2, end }; } function getPopupRole(element, fallback) { const allowedPopupRoles = ["dialog", "menu", "listbox", "tree", "grid"]; const role = element == null ? void 0 : element.getAttribute("role"); if (role && allowedPopupRoles.indexOf(role) !== -1) { return role; } return fallback; } function getScrollingElement(element) { if (!element) return null; const isScrollableOverflow = (overflow) => { if (overflow === "auto") return true; if (overflow === "scroll") return true; return false; }; if (element.clientHeight && element.scrollHeight > element.clientHeight) { const { overflowY } = getComputedStyle(element); if (isScrollableOverflow(overflowY)) return element; } else if (element.clientWidth && element.scrollWidth > element.clientWidth) { const { overflowX } = getComputedStyle(element); if (isScrollableOverflow(overflowX)) return element; } return getScrollingElement(element.parentElement) || document.scrollingElement || document.body; } function setSelectionRange(element, ...args) { if (/text|search|password|tel|url/i.test(element.type)) { element.setSelectionRange(...args); } } function sortBasedOnDOMPosition(items, getElement) { const pairs = items.map((item, index) => [index, item]); let isOrderDifferent = false; pairs.sort(([indexA, a2], [indexB, b2]) => { const elementA = getElement(a2); const elementB = getElement(b2); if (elementA === elementB) return 0; if (!elementA || !elementB) return 0; if (isElementPreceding(elementA, elementB)) { if (indexA > indexB) { isOrderDifferent = true; } return -1; } if (indexA < indexB) { isOrderDifferent = true; } return 1; }); if (isOrderDifferent) { return pairs.map(([_, item]) => item); } return items; } function isElementPreceding(a2, b2) { return Boolean( b2.compareDocumentPosition(a2) & Node.DOCUMENT_POSITION_PRECEDING ); } // node_modules/@ariakit/core/esm/__chunks/SNHYQNEZ.js function isTouchDevice() { return canUseDOM && !!navigator.maxTouchPoints; } function isApple() { if (!canUseDOM) return false; return /mac|iphone|ipad|ipod/i.test(navigator.platform); } function isSafari() { return canUseDOM && isApple() && /apple/i.test(navigator.vendor); } function isFirefox() { return canUseDOM && /firefox\//i.test(navigator.userAgent); } // node_modules/@ariakit/core/esm/utils/events.js function isPortalEvent(event) { return Boolean( event.currentTarget && !contains(event.currentTarget, event.target) ); } function isSelfTarget(event) { return event.target === event.currentTarget; } function isOpeningInNewTab(event) { const element = event.currentTarget; if (!element) return false; const isAppleDevice = isApple(); if (isAppleDevice && !event.metaKey) return false; if (!isAppleDevice && !event.ctrlKey) return false; const tagName = element.tagName.toLowerCase(); if (tagName === "a") return true; if (tagName === "button" && element.type === "submit") return true; if (tagName === "input" && element.type === "submit") return true; return false; } function isDownloading(event) { const element = event.currentTarget; if (!element) return false; const tagName = element.tagName.toLowerCase(); if (!event.altKey) return false; if (tagName === "a") return true; if (tagName === "button" && element.type === "submit") return true; if (tagName === "input" && element.type === "submit") return true; return false; } function fireBlurEvent(element, eventInit) { const event = new FocusEvent("blur", eventInit); const defaultAllowed = element.dispatchEvent(event); const bubbleInit = { ...eventInit, bubbles: true }; element.dispatchEvent(new FocusEvent("focusout", bubbleInit)); return defaultAllowed; } function fireKeyboardEvent(element, type, eventInit) { const event = new KeyboardEvent(type, eventInit); return element.dispatchEvent(event); } function fireClickEvent(element, eventInit) { const event = new MouseEvent("click", eventInit); return element.dispatchEvent(event); } function isFocusEventOutside(event, container) { const containerElement = container || event.currentTarget; const relatedTarget = event.relatedTarget; return !relatedTarget || !contains(containerElement, relatedTarget); } function queueBeforeEvent(element, type, callback, timeout) { const createTimer = (callback2) => { if (timeout) { const timerId2 = setTimeout(callback2, timeout); return () => clearTimeout(timerId2); } const timerId = requestAnimationFrame(callback2); return () => cancelAnimationFrame(timerId); }; const cancelTimer = createTimer(() => { element.removeEventListener(type, callSync, true); callback(); }); const callSync = () => { cancelTimer(); callback(); }; element.addEventListener(type, callSync, { once: true, capture: true }); return cancelTimer; } function addGlobalEventListener(type, listener, options, scope = window) { const children = []; try { scope.document.addEventListener(type, listener, options); for (const frame of Array.from(scope.frames)) { children.push(addGlobalEventListener(type, listener, options, frame)); } } catch (e2) { } const removeEventListener = () => { try { scope.document.removeEventListener(type, listener, options); } catch (e2) { } for (const remove of children) { remove(); } }; return removeEventListener; } // node_modules/@ariakit/react-core/esm/__chunks/KPHZR4MB.js var React7 = __toESM(require_react(), 1); var import_react9 = __toESM(require_react(), 1); var _React = { ...React7 }; var useReactId = _React.useId; var useReactDeferredValue = _React.useDeferredValue; var useReactInsertionEffect = _React.useInsertionEffect; var useSafeLayoutEffect = canUseDOM ? import_react9.useLayoutEffect : import_react9.useEffect; function useInitialValue(value) { const [initialValue] = (0, import_react9.useState)(value); return initialValue; } function useLiveRef(value) { const ref = (0, import_react9.useRef)(value); useSafeLayoutEffect(() => { ref.current = value; }); return ref; } function useEvent(callback) { const ref = (0, import_react9.useRef)(() => { throw new Error("Cannot call an event handler while rendering."); }); if (useReactInsertionEffect) { useReactInsertionEffect(() => { ref.current = callback; }); } else { ref.current = callback; } return (0, import_react9.useCallback)((...args) => { var _a; return (_a = ref.current) == null ? void 0 : _a.call(ref, ...args); }, []); } function useTransactionState(callback) { const [state, setState] = (0, import_react9.useState)(null); useSafeLayoutEffect(() => { if (state == null) return; if (!callback) return; let prevState = null; callback((prev) => { prevState = prev; return state; }); return () => { callback(prevState); }; }, [state, callback]); return [state, setState]; } function useMergeRefs(...refs) { return (0, import_react9.useMemo)(() => { if (!refs.some(Boolean)) return; return (value) => { for (const ref of refs) { setRef(ref, value); } }; }, refs); } function useId5(defaultId) { if (useReactId) { const reactId = useReactId(); if (defaultId) return defaultId; return reactId; } const [id, setId] = (0, import_react9.useState)(defaultId); useSafeLayoutEffect(() => { if (defaultId || id) return; const random = Math.random().toString(36).slice(2, 8); setId(`id-${random}`); }, [defaultId, id]); return defaultId || id; } function useTagName(refOrElement, type) { const stringOrUndefined = (type2) => { if (typeof type2 !== "string") return; return type2; }; const [tagName, setTagName] = (0, import_react9.useState)(() => stringOrUndefined(type)); useSafeLayoutEffect(() => { const element = refOrElement && "current" in refOrElement ? refOrElement.current : refOrElement; setTagName((element == null ? void 0 : element.tagName.toLowerCase()) || stringOrUndefined(type)); }, [refOrElement, type]); return tagName; } function useAttribute(refOrElement, attributeName, defaultValue2) { const initialValue = useInitialValue(defaultValue2); const [attribute, setAttribute] = (0, import_react9.useState)(initialValue); (0, import_react9.useEffect)(() => { const element = refOrElement && "current" in refOrElement ? refOrElement.current : refOrElement; if (!element) return; const callback = () => { const value = element.getAttribute(attributeName); setAttribute(value == null ? initialValue : value); }; const observer = new MutationObserver(callback); observer.observe(element, { attributeFilter: [attributeName] }); callback(); return () => observer.disconnect(); }, [refOrElement, attributeName, initialValue]); return attribute; } function useUpdateEffect(effect, deps) { const mounted = (0, import_react9.useRef)(false); (0, import_react9.useEffect)(() => { if (mounted.current) { return effect(); } mounted.current = true; }, deps); (0, import_react9.useEffect)( () => () => { mounted.current = false; }, [] ); } function useUpdateLayoutEffect(effect, deps) { const mounted = (0, import_react9.useRef)(false); useSafeLayoutEffect(() => { if (mounted.current) { return effect(); } mounted.current = true; }, deps); useSafeLayoutEffect( () => () => { mounted.current = false; }, [] ); } function useForceUpdate2() { return (0, import_react9.useReducer)(() => [], []); } function useBooleanEvent(booleanOrCallback) { return useEvent( typeof booleanOrCallback === "function" ? booleanOrCallback : () => booleanOrCallback ); } function useWrapElement(props, callback, deps = []) { const wrapElement = (0, import_react9.useCallback)( (element) => { if (props.wrapElement) { element = props.wrapElement(element); } return callback(element); }, [...deps, props.wrapElement] ); return { ...props, wrapElement }; } function useMetadataProps(props, key, value) { const parent = props.onLoadedMetadataCapture; const onLoadedMetadataCapture = (0, import_react9.useMemo)(() => { return Object.assign(() => { }, { ...parent, [key]: value }); }, [parent, key, value]); return [parent == null ? void 0 : parent[key], { onLoadedMetadataCapture }]; } var hasInstalledGlobalEventListeners = false; function useIsMouseMoving() { (0, import_react9.useEffect)(() => { if (hasInstalledGlobalEventListeners) return; addGlobalEventListener("mousemove", setMouseMoving, true); addGlobalEventListener("mousedown", resetMouseMoving, true); addGlobalEventListener("mouseup", resetMouseMoving, true); addGlobalEventListener("keydown", resetMouseMoving, true); addGlobalEventListener("scroll", resetMouseMoving, true); hasInstalledGlobalEventListeners = true; }, []); const isMouseMoving = useEvent(() => mouseMoving); return isMouseMoving; } var mouseMoving = false; var previousScreenX = 0; var previousScreenY = 0; function hasMouseMovement(event) { const movementX = event.movementX || event.screenX - previousScreenX; const movementY = event.movementY || event.screenY - previousScreenY; previousScreenX = event.screenX; previousScreenY = event.screenY; return movementX || movementY || false; } function setMouseMoving(event) { if (!hasMouseMovement(event)) return; mouseMoving = true; } function resetMouseMoving() { mouseMoving = false; } // node_modules/@ariakit/react-core/esm/__chunks/GWSL6KNJ.js var React8 = __toESM(require_react(), 1); var import_jsx_runtime206 = __toESM(require_jsx_runtime(), 1); function forwardRef22(render4) { const Role = React8.forwardRef( // @ts-ignore Incompatible with React 19 types. Ignore for now. (props, ref) => render4({ ...props, ref }) ); Role.displayName = render4.displayName || render4.name; return Role; } function memo22(Component, propsAreEqual) { return React8.memo(Component, propsAreEqual); } function createElement5(Type, props) { const { wrapElement, render: render4, ...rest } = props; const mergedRef = useMergeRefs(props.ref, getRefProperty(render4)); let element; if (React8.isValidElement(render4)) { const renderProps = { // @ts-ignore Incompatible with React 19 types. Ignore for now. ...render4.props, ref: mergedRef }; element = React8.cloneElement(render4, mergeProps2(rest, renderProps)); } else if (render4) { element = render4(rest); } else { element = /* @__PURE__ */ (0, import_jsx_runtime206.jsx)(Type, { ...rest }); } if (wrapElement) { return wrapElement(element); } return element; } function createHook(useProps) { const useRole = (props = {}) => { return useProps(props); }; useRole.displayName = useProps.name; return useRole; } function createStoreContext(providers = [], scopedProviders = []) { const context = React8.createContext(void 0); const scopedContext = React8.createContext(void 0); const useContext210 = () => React8.useContext(context); const useScopedContext = (onlyScoped = false) => { const scoped = React8.useContext(scopedContext); const store2 = useContext210(); if (onlyScoped) return scoped; return scoped || store2; }; const useProviderContext = () => { const scoped = React8.useContext(scopedContext); const store2 = useContext210(); if (scoped && scoped === store2) return; return store2; }; const ContextProvider = (props) => { return providers.reduceRight( (children, Provider) => /* @__PURE__ */ (0, import_jsx_runtime206.jsx)(Provider, { ...props, children }), /* @__PURE__ */ (0, import_jsx_runtime206.jsx)(context.Provider, { ...props }) ); }; const ScopedContextProvider = (props) => { return /* @__PURE__ */ (0, import_jsx_runtime206.jsx)(ContextProvider, { ...props, children: scopedProviders.reduceRight( (children, Provider) => /* @__PURE__ */ (0, import_jsx_runtime206.jsx)(Provider, { ...props, children }), /* @__PURE__ */ (0, import_jsx_runtime206.jsx)(scopedContext.Provider, { ...props }) ) }); }; return { context, scopedContext, useContext: useContext210, useScopedContext, useProviderContext, ContextProvider, ScopedContextProvider }; } // node_modules/@ariakit/react-core/esm/__chunks/SMPCIMZM.js var ctx2 = createStoreContext(); var useCollectionContext = ctx2.useContext; var useCollectionScopedContext = ctx2.useScopedContext; var useCollectionProviderContext = ctx2.useProviderContext; var CollectionContextProvider = ctx2.ContextProvider; var CollectionScopedContextProvider = ctx2.ScopedContextProvider; // node_modules/@ariakit/react-core/esm/__chunks/AVVXDJMZ.js var import_react10 = __toESM(require_react(), 1); var ctx3 = createStoreContext( [CollectionContextProvider], [CollectionScopedContextProvider] ); var useCompositeContext = ctx3.useContext; var useCompositeScopedContext = ctx3.useScopedContext; var useCompositeProviderContext = ctx3.useProviderContext; var CompositeContextProvider = ctx3.ContextProvider; var CompositeScopedContextProvider = ctx3.ScopedContextProvider; var CompositeItemContext = (0, import_react10.createContext)( void 0 ); var CompositeRowContext = (0, import_react10.createContext)( void 0 ); // node_modules/@ariakit/react-core/esm/__chunks/5VQZOHHZ.js function findFirstEnabledItem(items, excludeId) { return items.find((item) => { if (excludeId) { return !item.disabled && item.id !== excludeId; } return !item.disabled; }); } function getEnabledItem(store2, id) { if (!id) return null; return store2.item(id) || null; } function groupItemsByRows(items) { const rows = []; for (const item of items) { const row = rows.find((currentRow) => { var _a; return ((_a = currentRow[0]) == null ? void 0 : _a.rowId) === item.rowId; }); if (row) { row.push(item); } else { rows.push([item]); } } return rows; } function selectTextField(element, collapseToEnd = false) { if (isTextField(element)) { element.setSelectionRange( collapseToEnd ? element.value.length : 0, element.value.length ); } else if (element.isContentEditable) { const selection = getDocument(element).getSelection(); selection == null ? void 0 : selection.selectAllChildren(element); if (collapseToEnd) { selection == null ? void 0 : selection.collapseToEnd(); } } } var FOCUS_SILENTLY = /* @__PURE__ */ Symbol("FOCUS_SILENTLY"); function focusSilently(element) { element[FOCUS_SILENTLY] = true; element.focus({ preventScroll: true }); } function silentlyFocused(element) { const isSilentlyFocused = element[FOCUS_SILENTLY]; delete element[FOCUS_SILENTLY]; return isSilentlyFocused; } function isItem(store2, element, exclude) { if (!element) return false; if (element === exclude) return false; const item = store2.item(element.id); if (!item) return false; if (exclude && item.element === exclude) return false; return true; } // node_modules/@ariakit/react-core/esm/__chunks/Z2O3VLAQ.js var import_react11 = __toESM(require_react(), 1); var TagName = "div"; var useCollectionItem = createHook( function useCollectionItem2({ store: store2, shouldRegisterItem = true, getItem = identity, // @ts-expect-error This prop may come from a collection renderer. element, ...props }) { const context = useCollectionContext(); store2 = store2 || context; const id = useId5(props.id); const ref = (0, import_react11.useRef)(element); (0, import_react11.useEffect)(() => { const element2 = ref.current; if (!id) return; if (!element2) return; if (!shouldRegisterItem) return; const item = getItem({ id, element: element2 }); return store2 == null ? void 0 : store2.renderItem(item); }, [id, shouldRegisterItem, getItem, store2]); props = { ...props, ref: useMergeRefs(ref, props.ref) }; return removeUndefinedValues(props); } ); var CollectionItem = forwardRef22(function CollectionItem2(props) { const htmlProps = useCollectionItem(props); return createElement5(TagName, htmlProps); }); // node_modules/@ariakit/react-core/esm/__chunks/SWN3JYXT.js var import_react12 = __toESM(require_react(), 1); var FocusableContext = (0, import_react12.createContext)(true); // node_modules/@ariakit/core/esm/utils/focus.js var selector = "input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], summary, iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])"; function isFocusable(element) { if (!element.matches(selector)) return false; if (!isVisible(element)) return false; if (element.closest("[inert]")) return false; return true; } function getClosestFocusable(element) { while (element && !isFocusable(element)) { element = element.closest(selector); } return element || null; } function hasFocus(element) { const activeElement = getActiveElement(element); if (!activeElement) return false; if (activeElement === element) return true; const activeDescendant = activeElement.getAttribute("aria-activedescendant"); if (!activeDescendant) return false; return activeDescendant === element.id; } function hasFocusWithin(element) { const activeElement = getActiveElement(element); if (!activeElement) return false; if (contains(element, activeElement)) return true; const activeDescendant = activeElement.getAttribute("aria-activedescendant"); if (!activeDescendant) return false; if (!("id" in element)) return false; if (activeDescendant === element.id) return true; return !!element.querySelector(`#${CSS.escape(activeDescendant)}`); } function focusIfNeeded(element) { if (!hasFocusWithin(element) && isFocusable(element)) { element.focus(); } } function focusIntoView(element, options) { if (!("scrollIntoView" in element)) { element.focus(); } else { element.focus({ preventScroll: true }); element.scrollIntoView({ block: "nearest", inline: "nearest", ...options }); } } // node_modules/@ariakit/react-core/esm/__chunks/U6HHPQDW.js var import_react13 = __toESM(require_react(), 1); var TagName2 = "div"; var isSafariBrowser = isSafari(); var alwaysFocusVisibleInputTypes = [ "text", "search", "url", "tel", "email", "password", "number", "date", "month", "week", "time", "datetime", "datetime-local" ]; var safariFocusAncestorSymbol = /* @__PURE__ */ Symbol("safariFocusAncestor"); function markSafariFocusAncestor(element, value) { if (!element) return; element[safariFocusAncestorSymbol] = value; } function isAlwaysFocusVisible(element) { const { tagName, readOnly, type } = element; if (tagName === "TEXTAREA" && !readOnly) return true; if (tagName === "SELECT" && !readOnly) return true; if (tagName === "INPUT" && !readOnly) { return alwaysFocusVisibleInputTypes.includes(type); } if (element.isContentEditable) return true; const role = element.getAttribute("role"); if (role === "combobox" && element.dataset.name) { return true; } return false; } function getLabels(element) { if ("labels" in element) { return element.labels; } return null; } function isNativeCheckboxOrRadio(element) { const tagName = element.tagName.toLowerCase(); if (tagName === "input" && element.type) { return element.type === "radio" || element.type === "checkbox"; } return false; } function isNativeTabbable(tagName) { if (!tagName) return true; return tagName === "button" || tagName === "summary" || tagName === "input" || tagName === "select" || tagName === "textarea" || tagName === "a"; } function supportsDisabledAttribute(tagName) { if (!tagName) return true; return tagName === "button" || tagName === "input" || tagName === "select" || tagName === "textarea"; } function getTabIndex(focusable, trulyDisabled, nativeTabbable, supportsDisabled, tabIndexProp) { if (!focusable) { return tabIndexProp; } if (trulyDisabled) { if (nativeTabbable && !supportsDisabled) { return -1; } return; } if (nativeTabbable) { return tabIndexProp; } return tabIndexProp || 0; } function useDisableEvent(onEvent, disabled) { return useEvent((event) => { onEvent == null ? void 0 : onEvent(event); if (event.defaultPrevented) return; if (disabled) { event.stopPropagation(); event.preventDefault(); } }); } var hasInstalledGlobalEventListeners2 = false; var isKeyboardModality = true; function onGlobalMouseDown(event) { const target = event.target; if (target && "hasAttribute" in target) { if (!target.hasAttribute("data-focus-visible")) { isKeyboardModality = false; } } } function onGlobalKeyDown(event) { if (event.metaKey) return; if (event.ctrlKey) return; if (event.altKey) return; isKeyboardModality = true; } var useFocusable = createHook( function useFocusable2({ focusable = true, accessibleWhenDisabled, autoFocus, onFocusVisible, ...props }) { const ref = (0, import_react13.useRef)(null); (0, import_react13.useEffect)(() => { if (!focusable) return; if (hasInstalledGlobalEventListeners2) return; addGlobalEventListener("mousedown", onGlobalMouseDown, true); addGlobalEventListener("keydown", onGlobalKeyDown, true); hasInstalledGlobalEventListeners2 = true; }, [focusable]); if (isSafariBrowser) { (0, import_react13.useEffect)(() => { if (!focusable) return; const element = ref.current; if (!element) return; if (!isNativeCheckboxOrRadio(element)) return; const labels = getLabels(element); if (!labels) return; const onMouseUp = () => queueMicrotask(() => element.focus()); for (const label of labels) { label.addEventListener("mouseup", onMouseUp); } return () => { for (const label of labels) { label.removeEventListener("mouseup", onMouseUp); } }; }, [focusable]); } const disabled = focusable && disabledFromProps(props); const trulyDisabled = !!disabled && !accessibleWhenDisabled; const [focusVisible, setFocusVisible] = (0, import_react13.useState)(false); (0, import_react13.useEffect)(() => { if (!focusable) return; if (trulyDisabled && focusVisible) { setFocusVisible(false); } }, [focusable, trulyDisabled, focusVisible]); (0, import_react13.useEffect)(() => { if (!focusable) return; if (!focusVisible) return; const element = ref.current; if (!element) return; if (typeof IntersectionObserver === "undefined") return; const observer = new IntersectionObserver(() => { if (!isFocusable(element)) { setFocusVisible(false); } }); observer.observe(element); return () => observer.disconnect(); }, [focusable, focusVisible]); const onKeyPressCapture = useDisableEvent( props.onKeyPressCapture, disabled ); const onMouseDownCapture = useDisableEvent( props.onMouseDownCapture, disabled ); const onClickCapture = useDisableEvent(props.onClickCapture, disabled); const onMouseDownProp = props.onMouseDown; const onMouseDown = useEvent((event) => { onMouseDownProp == null ? void 0 : onMouseDownProp(event); if (event.defaultPrevented) return; if (!focusable) return; const element = event.currentTarget; if (!isSafariBrowser) return; if (isPortalEvent(event)) return; if (!isButton(element) && !isNativeCheckboxOrRadio(element)) return; let receivedFocus = false; const onFocus = () => { receivedFocus = true; }; const options = { capture: true, once: true }; element.addEventListener("focusin", onFocus, options); const focusableContainer = getClosestFocusable(element.parentElement); markSafariFocusAncestor(focusableContainer, true); queueBeforeEvent(element, "mouseup", () => { element.removeEventListener("focusin", onFocus, true); markSafariFocusAncestor(focusableContainer, false); if (receivedFocus) return; focusIfNeeded(element); }); }); const handleFocusVisible = (event, currentTarget) => { if (currentTarget) { event.currentTarget = currentTarget; } if (!focusable) return; const element = event.currentTarget; if (!element) return; if (!hasFocus(element)) return; onFocusVisible == null ? void 0 : onFocusVisible(event); if (event.defaultPrevented) return; element.dataset.focusVisible = "true"; setFocusVisible(true); }; const onKeyDownCaptureProp = props.onKeyDownCapture; const onKeyDownCapture = useEvent((event) => { onKeyDownCaptureProp == null ? void 0 : onKeyDownCaptureProp(event); if (event.defaultPrevented) return; if (!focusable) return; if (focusVisible) return; if (event.metaKey) return; if (event.altKey) return; if (event.ctrlKey) return; if (!isSelfTarget(event)) return; const element = event.currentTarget; const applyFocusVisible = () => handleFocusVisible(event, element); queueBeforeEvent(element, "focusout", applyFocusVisible); }); const onFocusCaptureProp = props.onFocusCapture; const onFocusCapture = useEvent((event) => { onFocusCaptureProp == null ? void 0 : onFocusCaptureProp(event); if (event.defaultPrevented) return; if (!focusable) return; if (!isSelfTarget(event)) { setFocusVisible(false); return; } const element = event.currentTarget; const applyFocusVisible = () => handleFocusVisible(event, element); if (isKeyboardModality || isAlwaysFocusVisible(event.target)) { queueBeforeEvent(event.target, "focusout", applyFocusVisible); } else { setFocusVisible(false); } }); const onBlurProp = props.onBlur; const onBlur = useEvent((event) => { onBlurProp == null ? void 0 : onBlurProp(event); if (!focusable) return; if (!isFocusEventOutside(event)) return; event.currentTarget.removeAttribute("data-focus-visible"); setFocusVisible(false); }); const autoFocusOnShow = (0, import_react13.useContext)(FocusableContext); const autoFocusRef = useEvent((element) => { if (!focusable) return; if (!autoFocus) return; if (!element) return; if (!autoFocusOnShow) return; queueMicrotask(() => { if (hasFocus(element)) return; if (!isFocusable(element)) return; element.focus(); }); }); const tagName = useTagName(ref); const nativeTabbable = focusable && isNativeTabbable(tagName); const supportsDisabled = focusable && supportsDisabledAttribute(tagName); const styleProp = props.style; const style = (0, import_react13.useMemo)(() => { if (trulyDisabled) { return { pointerEvents: "none", ...styleProp }; } return styleProp; }, [trulyDisabled, styleProp]); props = { "data-focus-visible": focusable && focusVisible || void 0, "data-autofocus": autoFocus || void 0, "aria-disabled": disabled || void 0, ...props, ref: useMergeRefs(ref, autoFocusRef, props.ref), style, tabIndex: getTabIndex( focusable, trulyDisabled, nativeTabbable, supportsDisabled, props.tabIndex ), disabled: supportsDisabled && trulyDisabled ? true : void 0, // TODO: Test Focusable contentEditable. contentEditable: disabled ? void 0 : props.contentEditable, onKeyPressCapture, onClickCapture, onMouseDownCapture, onMouseDown, onKeyDownCapture, onFocusCapture, onBlur }; return removeUndefinedValues(props); } ); var Focusable = forwardRef22(function Focusable2(props) { const htmlProps = useFocusable(props); return createElement5(TagName2, htmlProps); }); // node_modules/@ariakit/react-core/esm/__chunks/PZ3OL7I2.js var import_react14 = __toESM(require_react(), 1); var TagName3 = "button"; function isNativeClick(event) { if (!event.isTrusted) return false; const element = event.currentTarget; if (event.key === "Enter") { return isButton(element) || element.tagName === "SUMMARY" || element.tagName === "A"; } if (event.key === " ") { return isButton(element) || element.tagName === "SUMMARY" || element.tagName === "INPUT" || element.tagName === "SELECT"; } return false; } var symbol = /* @__PURE__ */ Symbol("command"); var useCommand = createHook( function useCommand2({ clickOnEnter = true, clickOnSpace = true, ...props }) { const ref = (0, import_react14.useRef)(null); const [isNativeButton, setIsNativeButton] = (0, import_react14.useState)(false); (0, import_react14.useEffect)(() => { if (!ref.current) return; setIsNativeButton(isButton(ref.current)); }, []); const [active, setActive] = (0, import_react14.useState)(false); const activeRef = (0, import_react14.useRef)(false); const disabled = disabledFromProps(props); const [isDuplicate, metadataProps] = useMetadataProps(props, symbol, true); const onKeyDownProp = props.onKeyDown; const onKeyDown = useEvent((event) => { onKeyDownProp == null ? void 0 : onKeyDownProp(event); const element = event.currentTarget; if (event.defaultPrevented) return; if (isDuplicate) return; if (disabled) return; if (!isSelfTarget(event)) return; if (isTextField(element)) return; if (element.isContentEditable) return; const isEnter = clickOnEnter && event.key === "Enter"; const isSpace = clickOnSpace && event.key === " "; const shouldPreventEnter = event.key === "Enter" && !clickOnEnter; const shouldPreventSpace = event.key === " " && !clickOnSpace; if (shouldPreventEnter || shouldPreventSpace) { event.preventDefault(); return; } if (isEnter || isSpace) { const nativeClick = isNativeClick(event); if (isEnter) { if (!nativeClick) { event.preventDefault(); const { view, ...eventInit } = event; const click = () => fireClickEvent(element, eventInit); if (isFirefox()) { queueBeforeEvent(element, "keyup", click); } else { queueMicrotask(click); } } } else if (isSpace) { activeRef.current = true; if (!nativeClick) { event.preventDefault(); setActive(true); } } } }); const onKeyUpProp = props.onKeyUp; const onKeyUp = useEvent((event) => { onKeyUpProp == null ? void 0 : onKeyUpProp(event); if (event.defaultPrevented) return; if (isDuplicate) return; if (disabled) return; if (event.metaKey) return; const isSpace = clickOnSpace && event.key === " "; if (activeRef.current && isSpace) { activeRef.current = false; if (!isNativeClick(event)) { event.preventDefault(); setActive(false); const element = event.currentTarget; const { view, ...eventInit } = event; queueMicrotask(() => fireClickEvent(element, eventInit)); } } }); props = { "data-active": active || void 0, type: isNativeButton ? "button" : void 0, ...metadataProps, ...props, ref: useMergeRefs(ref, props.ref), onKeyDown, onKeyUp }; props = useFocusable(props); return props; } ); var Command = forwardRef22(function Command2(props) { const htmlProps = useCommand(props); return createElement5(TagName3, htmlProps); }); // node_modules/@ariakit/core/esm/__chunks/SXKM4CGU.js function getInternal(store2, key) { const internals = store2.__unstableInternals; invariant(internals, "Invalid store"); return internals[key]; } function createStore(initialState, ...stores) { let state = initialState; let prevStateBatch = state; let lastUpdate = /* @__PURE__ */ Symbol(); let destroy = noop3; const instances = /* @__PURE__ */ new Set(); const updatedKeys = /* @__PURE__ */ new Set(); const setups = /* @__PURE__ */ new Set(); const listeners = /* @__PURE__ */ new Set(); const batchListeners = /* @__PURE__ */ new Set(); const disposables = /* @__PURE__ */ new WeakMap(); const listenerKeys = /* @__PURE__ */ new WeakMap(); const storeSetup = (callback) => { setups.add(callback); return () => setups.delete(callback); }; const storeInit = () => { const initialized = instances.size; const instance = /* @__PURE__ */ Symbol(); instances.add(instance); const maybeDestroy = () => { instances.delete(instance); if (instances.size) return; destroy(); }; if (initialized) return maybeDestroy; const desyncs = getKeys(state).map( (key) => chain( ...stores.map((store2) => { var _a; const storeState = (_a = store2 == null ? void 0 : store2.getState) == null ? void 0 : _a.call(store2); if (!storeState) return; if (!hasOwnProperty(storeState, key)) return; return sync2(store2, [key], (state2) => { setState( key, state2[key], // @ts-expect-error - Not public API. This is just to prevent // infinite loops. true ); }); }) ) ); const teardowns = []; for (const setup2 of setups) { teardowns.push(setup2()); } const cleanups = stores.map(init); destroy = chain(...desyncs, ...teardowns, ...cleanups); return maybeDestroy; }; const sub = (keys, listener, set = listeners) => { set.add(listener); listenerKeys.set(listener, keys); return () => { var _a; (_a = disposables.get(listener)) == null ? void 0 : _a(); disposables.delete(listener); listenerKeys.delete(listener); set.delete(listener); }; }; const storeSubscribe = (keys, listener) => sub(keys, listener); const storeSync = (keys, listener) => { disposables.set(listener, listener(state, state)); return sub(keys, listener); }; const storeBatch = (keys, listener) => { disposables.set(listener, listener(state, prevStateBatch)); return sub(keys, listener, batchListeners); }; const storePick = (keys) => createStore(pick(state, keys), finalStore); const storeOmit = (keys) => createStore(omit(state, keys), finalStore); const getState = () => state; const setState = (key, value, fromStores = false) => { var _a; if (!hasOwnProperty(state, key)) return; const nextValue = applyState(value, state[key]); if (nextValue === state[key]) return; if (!fromStores) { for (const store2 of stores) { (_a = store2 == null ? void 0 : store2.setState) == null ? void 0 : _a.call(store2, key, nextValue); } } const prevState = state; state = { ...state, [key]: nextValue }; const thisUpdate = /* @__PURE__ */ Symbol(); lastUpdate = thisUpdate; updatedKeys.add(key); const run = (listener, prev, uKeys) => { var _a2; const keys = listenerKeys.get(listener); const updated = (k2) => uKeys ? uKeys.has(k2) : k2 === key; if (!keys || keys.some(updated)) { (_a2 = disposables.get(listener)) == null ? void 0 : _a2(); disposables.set(listener, listener(state, prev)); } }; for (const listener of listeners) { run(listener, prevState); } queueMicrotask(() => { if (lastUpdate !== thisUpdate) return; const snapshot = state; for (const listener of batchListeners) { run(listener, prevStateBatch, updatedKeys); } prevStateBatch = snapshot; updatedKeys.clear(); }); }; const finalStore = { getState, setState, __unstableInternals: { setup: storeSetup, init: storeInit, subscribe: storeSubscribe, sync: storeSync, batch: storeBatch, pick: storePick, omit: storeOmit } }; return finalStore; } function setup(store2, ...args) { if (!store2) return; return getInternal(store2, "setup")(...args); } function init(store2, ...args) { if (!store2) return; return getInternal(store2, "init")(...args); } function subscribe(store2, ...args) { if (!store2) return; return getInternal(store2, "subscribe")(...args); } function sync2(store2, ...args) { if (!store2) return; return getInternal(store2, "sync")(...args); } function batch(store2, ...args) { if (!store2) return; return getInternal(store2, "batch")(...args); } function omit2(store2, ...args) { if (!store2) return; return getInternal(store2, "omit")(...args); } function pick2(store2, ...args) { if (!store2) return; return getInternal(store2, "pick")(...args); } function mergeStore(...stores) { var _a; const initialState = {}; for (const store22 of stores) { const nextState = (_a = store22 == null ? void 0 : store22.getState) == null ? void 0 : _a.call(store22); if (nextState) { Object.assign(initialState, nextState); } } const store2 = createStore(initialState, ...stores); return Object.assign({}, ...stores, store2); } function throwOnConflictingProps(props, store2) { if (false) return; if (!store2) return; const defaultKeys = Object.entries(props).filter(([key, value]) => key.startsWith("default") && value !== void 0).map(([key]) => { var _a; const stateKey = key.replace("default", ""); return `${((_a = stateKey[0]) == null ? void 0 : _a.toLowerCase()) || ""}${stateKey.slice(1)}`; }); if (!defaultKeys.length) return; const storeState = store2.getState(); const conflictingProps = defaultKeys.filter( (key) => hasOwnProperty(storeState, key) ); if (!conflictingProps.length) return; throw new Error( `Passing a store prop in conjunction with a default state is not supported. const store = useSelectStore(); <SelectProvider store={store} defaultValue="Apple" /> ^ ^ Instead, pass the default state to the topmost store: const store = useSelectStore({ defaultValue: "Apple" }); <SelectProvider store={store} /> See https://github.com/ariakit/ariakit/pull/2745 for more details. If there's a particular need for this, please submit a feature request at https://github.com/ariakit/ariakit ` ); } // node_modules/@ariakit/react-core/esm/__chunks/Q5W46E73.js var React9 = __toESM(require_react(), 1); var import_shim = __toESM(require_shim(), 1); var { useSyncExternalStore } = import_shim.default; var noopSubscribe = () => () => { }; function useStoreState(store2, keyOrSelector = identity) { const storeSubscribe = React9.useCallback( (callback) => { if (!store2) return noopSubscribe(); return subscribe(store2, null, callback); }, [store2] ); const getSnapshot = () => { const key = typeof keyOrSelector === "string" ? keyOrSelector : null; const selector2 = typeof keyOrSelector === "function" ? keyOrSelector : null; const state = store2 == null ? void 0 : store2.getState(); if (selector2) return selector2(state); if (!state) return; if (!key) return; if (!hasOwnProperty(state, key)) return; return state[key]; }; return useSyncExternalStore(storeSubscribe, getSnapshot, getSnapshot); } function useStoreStateObject(store2, object) { const objRef = React9.useRef( {} ); const storeSubscribe = React9.useCallback( (callback) => { if (!store2) return noopSubscribe(); return subscribe(store2, null, callback); }, [store2] ); const getSnapshot = () => { const state = store2 == null ? void 0 : store2.getState(); let updated = false; const obj = objRef.current; for (const prop in object) { const keyOrSelector = object[prop]; if (typeof keyOrSelector === "function") { const value = keyOrSelector(state); if (value !== obj[prop]) { obj[prop] = value; updated = true; } } if (typeof keyOrSelector === "string") { if (!state) continue; if (!hasOwnProperty(state, keyOrSelector)) continue; const value = state[keyOrSelector]; if (value !== obj[prop]) { obj[prop] = value; updated = true; } } } if (updated) { objRef.current = { ...obj }; } return objRef.current; }; return useSyncExternalStore(storeSubscribe, getSnapshot, getSnapshot); } function useStoreProps(store2, props, key, setKey) { const value = hasOwnProperty(props, key) ? props[key] : void 0; const setValue = setKey ? props[setKey] : void 0; const propsRef = useLiveRef({ value, setValue }); useSafeLayoutEffect(() => { return sync2(store2, [key], (state, prev) => { const { value: value2, setValue: setValue2 } = propsRef.current; if (!setValue2) return; if (state[key] === prev[key]) return; if (state[key] === value2) return; setValue2(state[key]); }); }, [store2, key]); useSafeLayoutEffect(() => { if (value === void 0) return; store2.setState(key, value); return batch(store2, [key], () => { if (value === void 0) return; store2.setState(key, value); }); }); } function useStore(createStore2, props) { const [store2, setStore] = React9.useState(() => createStore2(props)); useSafeLayoutEffect(() => init(store2), [store2]); const useState210 = React9.useCallback( (keyOrSelector) => useStoreState(store2, keyOrSelector), [store2] ); const memoizedStore = React9.useMemo( () => ({ ...store2, useState: useState210 }), [store2, useState210] ); const updateStore = useEvent(() => { setStore((store22) => createStore2({ ...props, ...store22.getState() })); }); return [memoizedStore, updateStore]; } // node_modules/@ariakit/react-core/esm/__chunks/WZWDIE3S.js var import_react15 = __toESM(require_react(), 1); var import_jsx_runtime207 = __toESM(require_jsx_runtime(), 1); var TagName4 = "button"; function isEditableElement(element) { if (isTextbox(element)) return true; return element.tagName === "INPUT" && !isButton(element); } function getNextPageOffset(scrollingElement, pageUp = false) { const height = scrollingElement.clientHeight; const { top } = scrollingElement.getBoundingClientRect(); const pageSize = Math.max(height * 0.875, height - 40) * 1.5; const pageOffset = pageUp ? height - pageSize + top : pageSize + top; if (scrollingElement.tagName === "HTML") { return pageOffset + scrollingElement.scrollTop; } return pageOffset; } function getItemOffset(itemElement, pageUp = false) { const { top } = itemElement.getBoundingClientRect(); if (pageUp) { return top + itemElement.clientHeight; } return top; } function findNextPageItemId(element, store2, next, pageUp = false) { var _a; if (!store2) return; if (!next) return; const { renderedItems } = store2.getState(); const scrollingElement = getScrollingElement(element); if (!scrollingElement) return; const nextPageOffset = getNextPageOffset(scrollingElement, pageUp); let id; let prevDifference; for (let i2 = 0; i2 < renderedItems.length; i2 += 1) { const previousId = id; id = next(i2); if (!id) break; if (id === previousId) continue; const itemElement = (_a = getEnabledItem(store2, id)) == null ? void 0 : _a.element; if (!itemElement) continue; const itemOffset = getItemOffset(itemElement, pageUp); const difference = itemOffset - nextPageOffset; const absDifference = Math.abs(difference); if (pageUp && difference <= 0 || !pageUp && difference >= 0) { if (prevDifference !== void 0 && prevDifference < absDifference) { id = previousId; } break; } prevDifference = absDifference; } return id; } function targetIsAnotherItem(event, store2) { if (isSelfTarget(event)) return false; return isItem(store2, event.target); } var useCompositeItem = createHook( function useCompositeItem2({ store: store2, rowId: rowIdProp, preventScrollOnKeyDown = false, moveOnKeyPress = true, tabbable = false, getItem: getItemProp, "aria-setsize": ariaSetSizeProp, "aria-posinset": ariaPosInSetProp, ...props }) { const context = useCompositeContext(); store2 = store2 || context; const id = useId5(props.id); const ref = (0, import_react15.useRef)(null); const row = (0, import_react15.useContext)(CompositeRowContext); const disabled = disabledFromProps(props); const trulyDisabled = disabled && !props.accessibleWhenDisabled; const { rowId, baseElement, isActiveItem, ariaSetSize, ariaPosInSet, isTabbable } = useStoreStateObject(store2, { rowId(state) { if (rowIdProp) return rowIdProp; if (!state) return; if (!(row == null ? void 0 : row.baseElement)) return; if (row.baseElement !== state.baseElement) return; return row.id; }, baseElement(state) { return (state == null ? void 0 : state.baseElement) || void 0; }, isActiveItem(state) { return !!state && state.activeId === id; }, ariaSetSize(state) { if (ariaSetSizeProp != null) return ariaSetSizeProp; if (!state) return; if (!(row == null ? void 0 : row.ariaSetSize)) return; if (row.baseElement !== state.baseElement) return; return row.ariaSetSize; }, ariaPosInSet(state) { if (ariaPosInSetProp != null) return ariaPosInSetProp; if (!state) return; if (!(row == null ? void 0 : row.ariaPosInSet)) return; if (row.baseElement !== state.baseElement) return; const itemsInRow = state.renderedItems.filter( (item) => item.rowId === rowId ); return row.ariaPosInSet + itemsInRow.findIndex((item) => item.id === id); }, isTabbable(state) { if (!(state == null ? void 0 : state.renderedItems.length)) return true; if (state.virtualFocus) return false; if (tabbable) return true; if (state.activeId === null) return false; const item = store2 == null ? void 0 : store2.item(state.activeId); if (item == null ? void 0 : item.disabled) return true; if (!(item == null ? void 0 : item.element)) return true; return state.activeId === id; } }); const getItem = (0, import_react15.useCallback)( (item) => { var _a; const nextItem = { ...item, id: id || item.id, rowId, disabled: !!trulyDisabled, children: (_a = item.element) == null ? void 0 : _a.textContent }; if (getItemProp) { return getItemProp(nextItem); } return nextItem; }, [id, rowId, trulyDisabled, getItemProp] ); const onFocusProp = props.onFocus; const hasFocusedComposite = (0, import_react15.useRef)(false); const onFocus = useEvent((event) => { onFocusProp == null ? void 0 : onFocusProp(event); if (event.defaultPrevented) return; if (isPortalEvent(event)) return; if (!id) return; if (!store2) return; if (targetIsAnotherItem(event, store2)) return; const { virtualFocus, baseElement: baseElement2 } = store2.getState(); store2.setActiveId(id); if (isTextbox(event.currentTarget)) { selectTextField(event.currentTarget); } if (!virtualFocus) return; if (!isSelfTarget(event)) return; if (isEditableElement(event.currentTarget)) return; if (!(baseElement2 == null ? void 0 : baseElement2.isConnected)) return; if (isSafari() && event.currentTarget.hasAttribute("data-autofocus")) { event.currentTarget.scrollIntoView({ block: "nearest", inline: "nearest" }); } hasFocusedComposite.current = true; const fromComposite = event.relatedTarget === baseElement2 || isItem(store2, event.relatedTarget); if (fromComposite) { focusSilently(baseElement2); } else { baseElement2.focus(); } }); const onBlurCaptureProp = props.onBlurCapture; const onBlurCapture = useEvent((event) => { onBlurCaptureProp == null ? void 0 : onBlurCaptureProp(event); if (event.defaultPrevented) return; const state = store2 == null ? void 0 : store2.getState(); if ((state == null ? void 0 : state.virtualFocus) && hasFocusedComposite.current) { hasFocusedComposite.current = false; event.preventDefault(); event.stopPropagation(); } }); const onKeyDownProp = props.onKeyDown; const preventScrollOnKeyDownProp = useBooleanEvent(preventScrollOnKeyDown); const moveOnKeyPressProp = useBooleanEvent(moveOnKeyPress); const onKeyDown = useEvent((event) => { onKeyDownProp == null ? void 0 : onKeyDownProp(event); if (event.defaultPrevented) return; if (!isSelfTarget(event)) return; if (!store2) return; const { currentTarget } = event; const state = store2.getState(); const item = store2.item(id); const isGrid2 = !!(item == null ? void 0 : item.rowId); const isVertical = state.orientation !== "horizontal"; const isHorizontal = state.orientation !== "vertical"; const canHomeEnd = () => { if (isGrid2) return true; if (isHorizontal) return true; if (!state.baseElement) return true; if (!isTextField(state.baseElement)) return true; return false; }; const keyMap = { ArrowUp: (isGrid2 || isVertical) && store2.up, ArrowRight: (isGrid2 || isHorizontal) && store2.next, ArrowDown: (isGrid2 || isVertical) && store2.down, ArrowLeft: (isGrid2 || isHorizontal) && store2.previous, Home: () => { if (!canHomeEnd()) return; if (!isGrid2 || event.ctrlKey) { return store2 == null ? void 0 : store2.first(); } return store2 == null ? void 0 : store2.previous(-1); }, End: () => { if (!canHomeEnd()) return; if (!isGrid2 || event.ctrlKey) { return store2 == null ? void 0 : store2.last(); } return store2 == null ? void 0 : store2.next(-1); }, PageUp: () => { return findNextPageItemId(currentTarget, store2, store2 == null ? void 0 : store2.up, true); }, PageDown: () => { return findNextPageItemId(currentTarget, store2, store2 == null ? void 0 : store2.down); } }; const action = keyMap[event.key]; if (action) { if (isTextbox(currentTarget)) { const selection = getTextboxSelection(currentTarget); const isLeft = isHorizontal && event.key === "ArrowLeft"; const isRight = isHorizontal && event.key === "ArrowRight"; const isUp = isVertical && event.key === "ArrowUp"; const isDown = isVertical && event.key === "ArrowDown"; if (isRight || isDown) { const { length: valueLength } = getTextboxValue(currentTarget); if (selection.end !== valueLength) return; } else if ((isLeft || isUp) && selection.start !== 0) return; } const nextId2 = action(); if (preventScrollOnKeyDownProp(event) || nextId2 !== void 0) { if (!moveOnKeyPressProp(event)) return; event.preventDefault(); store2.move(nextId2); } } }); const providerValue = (0, import_react15.useMemo)( () => ({ id, baseElement }), [id, baseElement] ); props = useWrapElement( props, (element) => /* @__PURE__ */ (0, import_jsx_runtime207.jsx)(CompositeItemContext.Provider, { value: providerValue, children: element }), [providerValue] ); props = { id, "data-active-item": isActiveItem || void 0, ...props, ref: useMergeRefs(ref, props.ref), tabIndex: isTabbable ? props.tabIndex : -1, onFocus, onBlurCapture, onKeyDown }; props = useCommand(props); props = useCollectionItem({ store: store2, ...props, getItem, shouldRegisterItem: id ? props.shouldRegisterItem : false }); return removeUndefinedValues({ ...props, "aria-setsize": ariaSetSize, "aria-posinset": ariaPosInSet }); } ); var CompositeItem = memo22( forwardRef22(function CompositeItem2(props) { const htmlProps = useCompositeItem(props); return createElement5(TagName4, htmlProps); }) ); // node_modules/@ariakit/core/esm/__chunks/7PRQYBBV.js function toArray2(arg) { if (Array.isArray(arg)) { return arg; } return typeof arg !== "undefined" ? [arg] : []; } function flatten2DArray(array) { const flattened = []; for (const row of array) { flattened.push(...row); } return flattened; } function reverseArray(array) { return array.slice().reverse(); } // node_modules/@ariakit/react-core/esm/__chunks/ZMWF7ASR.js var import_react16 = __toESM(require_react(), 1); var import_jsx_runtime208 = __toESM(require_jsx_runtime(), 1); var TagName5 = "div"; function isGrid(items) { return items.some((item) => !!item.rowId); } function isPrintableKey(event) { const target = event.target; if (target && !isTextField(target)) return false; return event.key.length === 1 && !event.ctrlKey && !event.metaKey; } function isModifierKey(event) { return event.key === "Shift" || event.key === "Control" || event.key === "Alt" || event.key === "Meta"; } function useKeyboardEventProxy(store2, onKeyboardEvent, previousElementRef) { return useEvent((event) => { var _a; onKeyboardEvent == null ? void 0 : onKeyboardEvent(event); if (event.defaultPrevented) return; if (event.isPropagationStopped()) return; if (!isSelfTarget(event)) return; if (isModifierKey(event)) return; if (isPrintableKey(event)) return; const state = store2.getState(); const activeElement = (_a = getEnabledItem(store2, state.activeId)) == null ? void 0 : _a.element; if (!activeElement) return; const { view, ...eventInit } = event; const previousElement = previousElementRef == null ? void 0 : previousElementRef.current; if (activeElement !== previousElement) { activeElement.focus(); } if (!fireKeyboardEvent(activeElement, event.type, eventInit)) { event.preventDefault(); } if (event.currentTarget.contains(activeElement)) { event.stopPropagation(); } }); } function findFirstEnabledItemInTheLastRow(items) { return findFirstEnabledItem( flatten2DArray(reverseArray(groupItemsByRows(items))) ); } function useScheduleFocus(store2) { const [scheduled, setScheduled] = (0, import_react16.useState)(false); const schedule2 = (0, import_react16.useCallback)(() => setScheduled(true), []); const activeItem = store2.useState( (state) => getEnabledItem(store2, state.activeId) ); (0, import_react16.useEffect)(() => { const activeElement = activeItem == null ? void 0 : activeItem.element; if (!scheduled) return; if (!activeElement) return; setScheduled(false); activeElement.focus({ preventScroll: true }); }, [activeItem, scheduled]); return schedule2; } var useComposite = createHook( function useComposite2({ store: store2, composite = true, focusOnMove = composite, moveOnKeyPress = true, ...props }) { const context = useCompositeProviderContext(); store2 = store2 || context; invariant( store2, "Composite must receive a `store` prop or be wrapped in a CompositeProvider component." ); const ref = (0, import_react16.useRef)(null); const previousElementRef = (0, import_react16.useRef)(null); const scheduleFocus = useScheduleFocus(store2); const moves = store2.useState("moves"); const [, setBaseElement] = useTransactionState( composite ? store2.setBaseElement : null ); (0, import_react16.useEffect)(() => { var _a; if (!store2) return; if (!moves) return; if (!composite) return; if (!focusOnMove) return; const { activeId: activeId2 } = store2.getState(); const itemElement = (_a = getEnabledItem(store2, activeId2)) == null ? void 0 : _a.element; if (!itemElement) return; focusIntoView(itemElement); }, [store2, moves, composite, focusOnMove]); useSafeLayoutEffect(() => { if (!store2) return; if (!moves) return; if (!composite) return; const { baseElement, activeId: activeId2 } = store2.getState(); const isSelfAcive = activeId2 === null; if (!isSelfAcive) return; if (!baseElement) return; const previousElement = previousElementRef.current; previousElementRef.current = null; if (previousElement) { fireBlurEvent(previousElement, { relatedTarget: baseElement }); } if (!hasFocus(baseElement)) { baseElement.focus(); } }, [store2, moves, composite]); const activeId = store2.useState("activeId"); const virtualFocus = store2.useState("virtualFocus"); useSafeLayoutEffect(() => { var _a; if (!store2) return; if (!composite) return; if (!virtualFocus) return; const previousElement = previousElementRef.current; previousElementRef.current = null; if (!previousElement) return; const activeElement = (_a = getEnabledItem(store2, activeId)) == null ? void 0 : _a.element; const relatedTarget = activeElement || getActiveElement(previousElement); if (relatedTarget === previousElement) return; fireBlurEvent(previousElement, { relatedTarget }); }, [store2, activeId, virtualFocus, composite]); const onKeyDownCapture = useKeyboardEventProxy( store2, props.onKeyDownCapture, previousElementRef ); const onKeyUpCapture = useKeyboardEventProxy( store2, props.onKeyUpCapture, previousElementRef ); const onFocusCaptureProp = props.onFocusCapture; const onFocusCapture = useEvent((event) => { onFocusCaptureProp == null ? void 0 : onFocusCaptureProp(event); if (event.defaultPrevented) return; if (!store2) return; const { virtualFocus: virtualFocus2 } = store2.getState(); if (!virtualFocus2) return; const previousActiveElement = event.relatedTarget; const isSilentlyFocused = silentlyFocused(event.currentTarget); if (isSelfTarget(event) && isSilentlyFocused) { event.stopPropagation(); previousElementRef.current = previousActiveElement; } }); const onFocusProp = props.onFocus; const onFocus = useEvent((event) => { onFocusProp == null ? void 0 : onFocusProp(event); if (event.defaultPrevented) return; if (!composite) return; if (!store2) return; const { relatedTarget } = event; const { virtualFocus: virtualFocus2 } = store2.getState(); if (virtualFocus2) { if (isSelfTarget(event) && !isItem(store2, relatedTarget)) { queueMicrotask(scheduleFocus); } } else if (isSelfTarget(event)) { store2.setActiveId(null); } }); const onBlurCaptureProp = props.onBlurCapture; const onBlurCapture = useEvent((event) => { var _a; onBlurCaptureProp == null ? void 0 : onBlurCaptureProp(event); if (event.defaultPrevented) return; if (!store2) return; const { virtualFocus: virtualFocus2, activeId: activeId2 } = store2.getState(); if (!virtualFocus2) return; const activeElement = (_a = getEnabledItem(store2, activeId2)) == null ? void 0 : _a.element; const nextActiveElement = event.relatedTarget; const nextActiveElementIsItem = isItem(store2, nextActiveElement); const previousElement = previousElementRef.current; previousElementRef.current = null; if (isSelfTarget(event) && nextActiveElementIsItem) { if (nextActiveElement === activeElement) { if (previousElement && previousElement !== nextActiveElement) { fireBlurEvent(previousElement, event); } } else if (activeElement) { fireBlurEvent(activeElement, event); } else if (previousElement) { fireBlurEvent(previousElement, event); } event.stopPropagation(); } else { const targetIsItem = isItem(store2, event.target); if (!targetIsItem && activeElement) { fireBlurEvent(activeElement, event); } } }); const onKeyDownProp = props.onKeyDown; const moveOnKeyPressProp = useBooleanEvent(moveOnKeyPress); const onKeyDown = useEvent((event) => { var _a; onKeyDownProp == null ? void 0 : onKeyDownProp(event); if (event.nativeEvent.isComposing) return; if (event.defaultPrevented) return; if (!store2) return; if (!isSelfTarget(event)) return; const { orientation, renderedItems, activeId: activeId2 } = store2.getState(); const activeItem = getEnabledItem(store2, activeId2); if ((_a = activeItem == null ? void 0 : activeItem.element) == null ? void 0 : _a.isConnected) return; const isVertical = orientation !== "horizontal"; const isHorizontal = orientation !== "vertical"; const grid = isGrid(renderedItems); const isHorizontalKey = event.key === "ArrowLeft" || event.key === "ArrowRight" || event.key === "Home" || event.key === "End"; if (isHorizontalKey && isTextField(event.currentTarget)) return; const up = () => { if (grid) { const item = findFirstEnabledItemInTheLastRow(renderedItems); return item == null ? void 0 : item.id; } return store2 == null ? void 0 : store2.last(); }; const keyMap = { ArrowUp: (grid || isVertical) && up, ArrowRight: (grid || isHorizontal) && store2.first, ArrowDown: (grid || isVertical) && store2.first, ArrowLeft: (grid || isHorizontal) && store2.last, Home: store2.first, End: store2.last, PageUp: store2.first, PageDown: store2.last }; const action = keyMap[event.key]; if (action) { const id = action(); if (id !== void 0) { if (!moveOnKeyPressProp(event)) return; event.preventDefault(); store2.move(id); } } }); props = useWrapElement( props, (element) => /* @__PURE__ */ (0, import_jsx_runtime208.jsx)(CompositeContextProvider, { value: store2, children: element }), [store2] ); const activeDescendant = store2.useState((state) => { var _a; if (!store2) return; if (!composite) return; if (!state.virtualFocus) return; return (_a = getEnabledItem(store2, state.activeId)) == null ? void 0 : _a.id; }); props = { "aria-activedescendant": activeDescendant, ...props, ref: useMergeRefs(ref, setBaseElement, props.ref), onKeyDownCapture, onKeyUpCapture, onFocusCapture, onFocus, onBlurCapture, onKeyDown }; const focusable = store2.useState( (state) => composite && (state.virtualFocus || state.activeId === null) ); props = useFocusable({ focusable, ...props }); return props; } ); var Composite6 = forwardRef22(function Composite22(props) { const htmlProps = useComposite(props); return createElement5(TagName5, htmlProps); }); // node_modules/@ariakit/react-core/esm/__chunks/LVDQFHCH.js var ctx4 = createStoreContext(); var useDisclosureContext = ctx4.useContext; var useDisclosureScopedContext = ctx4.useScopedContext; var useDisclosureProviderContext = ctx4.useProviderContext; var DisclosureContextProvider = ctx4.ContextProvider; var DisclosureScopedContextProvider = ctx4.ScopedContextProvider; // node_modules/@ariakit/react-core/esm/__chunks/A62MDFCW.js var import_react17 = __toESM(require_react(), 1); var ctx5 = createStoreContext( [DisclosureContextProvider], [DisclosureScopedContextProvider] ); var useDialogContext = ctx5.useContext; var useDialogScopedContext = ctx5.useScopedContext; var useDialogProviderContext = ctx5.useProviderContext; var DialogContextProvider = ctx5.ContextProvider; var DialogScopedContextProvider = ctx5.ScopedContextProvider; var DialogHeadingContext = (0, import_react17.createContext)(void 0); var DialogDescriptionContext = (0, import_react17.createContext)(void 0); // node_modules/@ariakit/react-core/esm/__chunks/6B3RXHKP.js var import_react18 = __toESM(require_react(), 1); var import_react_dom2 = __toESM(require_react_dom(), 1); var import_jsx_runtime209 = __toESM(require_jsx_runtime(), 1); var TagName6 = "div"; function afterTimeout(timeoutMs, cb) { const timeoutId = setTimeout(cb, timeoutMs); return () => clearTimeout(timeoutId); } function afterPaint2(cb) { let raf2 = requestAnimationFrame(() => { raf2 = requestAnimationFrame(cb); }); return () => cancelAnimationFrame(raf2); } function parseCSSTime(...times) { return times.join(", ").split(", ").reduce((longestTime, currentTimeString) => { const multiplier = currentTimeString.endsWith("ms") ? 1 : 1e3; const currentTime = Number.parseFloat(currentTimeString || "0s") * multiplier; if (currentTime > longestTime) return currentTime; return longestTime; }, 0); } function isHidden(mounted, hidden, alwaysVisible) { return !alwaysVisible && hidden !== false && (!mounted || !!hidden); } var useDisclosureContent = createHook(function useDisclosureContent2({ store: store2, alwaysVisible, ...props }) { const context = useDisclosureProviderContext(); store2 = store2 || context; invariant( store2, "DisclosureContent must receive a `store` prop or be wrapped in a DisclosureProvider component." ); const ref = (0, import_react18.useRef)(null); const id = useId5(props.id); const [transition, setTransition] = (0, import_react18.useState)(null); const open = store2.useState("open"); const mounted = store2.useState("mounted"); const animated2 = store2.useState("animated"); const contentElement = store2.useState("contentElement"); const otherElement = useStoreState(store2.disclosure, "contentElement"); useSafeLayoutEffect(() => { if (!ref.current) return; store2 == null ? void 0 : store2.setContentElement(ref.current); }, [store2]); useSafeLayoutEffect(() => { let previousAnimated; store2 == null ? void 0 : store2.setState("animated", (animated22) => { previousAnimated = animated22; return true; }); return () => { if (previousAnimated === void 0) return; store2 == null ? void 0 : store2.setState("animated", previousAnimated); }; }, [store2]); useSafeLayoutEffect(() => { if (!animated2) return; if (!(contentElement == null ? void 0 : contentElement.isConnected)) { setTransition(null); return; } return afterPaint2(() => { setTransition(open ? "enter" : mounted ? "leave" : null); }); }, [animated2, contentElement, open, mounted]); useSafeLayoutEffect(() => { if (!store2) return; if (!animated2) return; if (!transition) return; if (!contentElement) return; const stopAnimation = () => store2 == null ? void 0 : store2.setState("animating", false); const stopAnimationSync = () => (0, import_react_dom2.flushSync)(stopAnimation); if (transition === "leave" && open) return; if (transition === "enter" && !open) return; if (typeof animated2 === "number") { const timeout2 = animated2; return afterTimeout(timeout2, stopAnimationSync); } const { transitionDuration, animationDuration, transitionDelay, animationDelay } = getComputedStyle(contentElement); const { transitionDuration: transitionDuration2 = "0", animationDuration: animationDuration2 = "0", transitionDelay: transitionDelay2 = "0", animationDelay: animationDelay2 = "0" } = otherElement ? getComputedStyle(otherElement) : {}; const delay = parseCSSTime( transitionDelay, animationDelay, transitionDelay2, animationDelay2 ); const duration = parseCSSTime( transitionDuration, animationDuration, transitionDuration2, animationDuration2 ); const timeout = delay + duration; if (!timeout) { if (transition === "enter") { store2.setState("animated", false); } stopAnimation(); return; } const frameRate = 1e3 / 60; const maxTimeout = Math.max(timeout - frameRate, 0); return afterTimeout(maxTimeout, stopAnimationSync); }, [store2, animated2, contentElement, otherElement, open, transition]); props = useWrapElement( props, (element) => /* @__PURE__ */ (0, import_jsx_runtime209.jsx)(DialogScopedContextProvider, { value: store2, children: element }), [store2] ); const hidden = isHidden(mounted, props.hidden, alwaysVisible); const styleProp = props.style; const style = (0, import_react18.useMemo)(() => { if (hidden) { return { ...styleProp, display: "none" }; } return styleProp; }, [hidden, styleProp]); props = { id, "data-open": open || void 0, "data-enter": transition === "enter" || void 0, "data-leave": transition === "leave" || void 0, hidden, ...props, ref: useMergeRefs(id ? store2.setContentElement : null, ref, props.ref), style }; return removeUndefinedValues(props); }); var DisclosureContentImpl = forwardRef22(function DisclosureContentImpl2(props) { const htmlProps = useDisclosureContent(props); return createElement5(TagName6, htmlProps); }); var DisclosureContent = forwardRef22(function DisclosureContent2({ unmountOnHide, ...props }) { const context = useDisclosureProviderContext(); const store2 = props.store || context; const mounted = useStoreState( store2, (state) => !unmountOnHide || (state == null ? void 0 : state.mounted) ); if (mounted === false) return null; return /* @__PURE__ */ (0, import_jsx_runtime209.jsx)(DisclosureContentImpl, { ...props }); }); // node_modules/@ariakit/core/esm/__chunks/75BJEVSH.js function createDisclosureStore(props = {}) { const store2 = mergeStore( props.store, omit2(props.disclosure, ["contentElement", "disclosureElement"]) ); throwOnConflictingProps(props, store2); const syncState = store2 == null ? void 0 : store2.getState(); const open = defaultValue( props.open, syncState == null ? void 0 : syncState.open, props.defaultOpen, false ); const animated2 = defaultValue(props.animated, syncState == null ? void 0 : syncState.animated, false); const initialState = { open, animated: animated2, animating: !!animated2 && open, mounted: open, contentElement: defaultValue(syncState == null ? void 0 : syncState.contentElement, null), disclosureElement: defaultValue(syncState == null ? void 0 : syncState.disclosureElement, null) }; const disclosure = createStore(initialState, store2); setup( disclosure, () => sync2(disclosure, ["animated", "animating"], (state) => { if (state.animated) return; disclosure.setState("animating", false); }) ); setup( disclosure, () => subscribe(disclosure, ["open"], () => { if (!disclosure.getState().animated) return; disclosure.setState("animating", true); }) ); setup( disclosure, () => sync2(disclosure, ["open", "animating"], (state) => { disclosure.setState("mounted", state.open || state.animating); }) ); return { ...disclosure, disclosure: props.disclosure, setOpen: (value) => disclosure.setState("open", value), show: () => disclosure.setState("open", true), hide: () => disclosure.setState("open", false), toggle: () => disclosure.setState("open", (open2) => !open2), stopAnimation: () => disclosure.setState("animating", false), setContentElement: (value) => disclosure.setState("contentElement", value), setDisclosureElement: (value) => disclosure.setState("disclosureElement", value) }; } // node_modules/@ariakit/react-core/esm/__chunks/WLZ6H5FH.js function useDisclosureStoreProps(store2, update4, props) { useUpdateEffect(update4, [props.store, props.disclosure]); useStoreProps(store2, props, "open", "setOpen"); useStoreProps(store2, props, "mounted", "setMounted"); useStoreProps(store2, props, "animated"); return Object.assign(store2, { disclosure: props.disclosure }); } // node_modules/@ariakit/react-core/esm/__chunks/JMU4N4M5.js var ctx6 = createStoreContext( [DialogContextProvider], [DialogScopedContextProvider] ); var usePopoverContext = ctx6.useContext; var usePopoverScopedContext = ctx6.useScopedContext; var usePopoverProviderContext = ctx6.useProviderContext; var PopoverContextProvider = ctx6.ContextProvider; var PopoverScopedContextProvider = ctx6.ScopedContextProvider; // node_modules/@ariakit/core/esm/__chunks/N5XGANPW.js function getCommonParent(items) { var _a; const firstItem = items.find((item) => !!item.element); const lastItem = [...items].reverse().find((item) => !!item.element); let parentElement = (_a = firstItem == null ? void 0 : firstItem.element) == null ? void 0 : _a.parentElement; while (parentElement && (lastItem == null ? void 0 : lastItem.element)) { const parent = parentElement; if (lastItem && parent.contains(lastItem.element)) { return parentElement; } parentElement = parentElement.parentElement; } return getDocument(parentElement).body; } function getPrivateStore(store2) { return store2 == null ? void 0 : store2.__unstablePrivateStore; } function createCollectionStore(props = {}) { var _a; throwOnConflictingProps(props, props.store); const syncState = (_a = props.store) == null ? void 0 : _a.getState(); const items = defaultValue( props.items, syncState == null ? void 0 : syncState.items, props.defaultItems, [] ); const itemsMap = new Map(items.map((item) => [item.id, item])); const initialState = { items, renderedItems: defaultValue(syncState == null ? void 0 : syncState.renderedItems, []) }; const syncPrivateStore = getPrivateStore(props.store); const privateStore = createStore( { items, renderedItems: initialState.renderedItems }, syncPrivateStore ); const collection = createStore(initialState, props.store); const sortItems = (renderedItems) => { const sortedItems = sortBasedOnDOMPosition(renderedItems, (i2) => i2.element); privateStore.setState("renderedItems", sortedItems); collection.setState("renderedItems", sortedItems); }; setup(collection, () => init(privateStore)); setup(privateStore, () => { return batch(privateStore, ["items"], (state) => { collection.setState("items", state.items); }); }); setup(privateStore, () => { return batch(privateStore, ["renderedItems"], (state) => { let firstRun = true; let raf2 = requestAnimationFrame(() => { const { renderedItems } = collection.getState(); if (state.renderedItems === renderedItems) return; sortItems(state.renderedItems); }); if (typeof IntersectionObserver !== "function") { return () => cancelAnimationFrame(raf2); } const ioCallback = () => { if (firstRun) { firstRun = false; return; } cancelAnimationFrame(raf2); raf2 = requestAnimationFrame(() => sortItems(state.renderedItems)); }; const root = getCommonParent(state.renderedItems); const observer = new IntersectionObserver(ioCallback, { root }); for (const item of state.renderedItems) { if (!item.element) continue; observer.observe(item.element); } return () => { cancelAnimationFrame(raf2); observer.disconnect(); }; }); }); const mergeItem = (item, setItems, canDeleteFromMap = false) => { let prevItem; setItems((items2) => { const index = items2.findIndex(({ id }) => id === item.id); const nextItems = items2.slice(); if (index !== -1) { prevItem = items2[index]; const nextItem = { ...prevItem, ...item }; nextItems[index] = nextItem; itemsMap.set(item.id, nextItem); } else { nextItems.push(item); itemsMap.set(item.id, item); } return nextItems; }); const unmergeItem = () => { setItems((items2) => { if (!prevItem) { if (canDeleteFromMap) { itemsMap.delete(item.id); } return items2.filter(({ id }) => id !== item.id); } const index = items2.findIndex(({ id }) => id === item.id); if (index === -1) return items2; const nextItems = items2.slice(); nextItems[index] = prevItem; itemsMap.set(item.id, prevItem); return nextItems; }); }; return unmergeItem; }; const registerItem = (item) => mergeItem( item, (getItems) => privateStore.setState("items", getItems), true ); return { ...collection, registerItem, renderItem: (item) => chain( registerItem(item), mergeItem( item, (getItems) => privateStore.setState("renderedItems", getItems) ) ), item: (id) => { if (!id) return null; let item = itemsMap.get(id); if (!item) { const { items: items2 } = privateStore.getState(); item = items2.find((item2) => item2.id === id); if (item) { itemsMap.set(id, item); } } return item || null; }, // @ts-expect-error Internal __unstablePrivateStore: privateStore }; } // node_modules/@ariakit/react-core/esm/__chunks/GVAFFF2B.js function useCollectionStoreProps(store2, update4, props) { useUpdateEffect(update4, [props.store]); useStoreProps(store2, props, "items", "setItems"); return store2; } // node_modules/@ariakit/core/esm/__chunks/RVTIKFRL.js var NULL_ITEM = { id: null }; function findFirstEnabledItem2(items, excludeId) { return items.find((item) => { if (excludeId) { return !item.disabled && item.id !== excludeId; } return !item.disabled; }); } function getEnabledItems(items, excludeId) { return items.filter((item) => { if (excludeId) { return !item.disabled && item.id !== excludeId; } return !item.disabled; }); } function getItemsInRow(items, rowId) { return items.filter((item) => item.rowId === rowId); } function flipItems(items, activeId, shouldInsertNullItem = false) { const index = items.findIndex((item) => item.id === activeId); return [ ...items.slice(index + 1), ...shouldInsertNullItem ? [NULL_ITEM] : [], ...items.slice(0, index) ]; } function groupItemsByRows2(items) { const rows = []; for (const item of items) { const row = rows.find((currentRow) => { var _a; return ((_a = currentRow[0]) == null ? void 0 : _a.rowId) === item.rowId; }); if (row) { row.push(item); } else { rows.push([item]); } } return rows; } function getMaxRowLength(array) { let maxLength = 0; for (const { length } of array) { if (length > maxLength) { maxLength = length; } } return maxLength; } function createEmptyItem(rowId) { return { id: "__EMPTY_ITEM__", disabled: true, rowId }; } function normalizeRows(rows, activeId, focusShift) { const maxLength = getMaxRowLength(rows); for (const row of rows) { for (let i2 = 0; i2 < maxLength; i2 += 1) { const item = row[i2]; if (!item || focusShift && item.disabled) { const isFirst = i2 === 0; const previousItem = isFirst && focusShift ? findFirstEnabledItem2(row) : row[i2 - 1]; row[i2] = previousItem && activeId !== previousItem.id && focusShift ? previousItem : createEmptyItem(previousItem == null ? void 0 : previousItem.rowId); } } } return rows; } function verticalizeItems(items) { const rows = groupItemsByRows2(items); const maxLength = getMaxRowLength(rows); const verticalized = []; for (let i2 = 0; i2 < maxLength; i2 += 1) { for (const row of rows) { const item = row[i2]; if (item) { verticalized.push({ ...item, // If there's no rowId, it means that it's not a grid composite, but // a single row instead. So, instead of verticalizing it, that is, // assigning a different rowId based on the column index, we keep it // undefined so they will be part of the same row. This is useful // when using up/down on one-dimensional composites. rowId: item.rowId ? `${i2}` : void 0 }); } } } return verticalized; } function createCompositeStore(props = {}) { var _a; const syncState = (_a = props.store) == null ? void 0 : _a.getState(); const collection = createCollectionStore(props); const activeId = defaultValue( props.activeId, syncState == null ? void 0 : syncState.activeId, props.defaultActiveId ); const initialState = { ...collection.getState(), id: defaultValue( props.id, syncState == null ? void 0 : syncState.id, `id-${Math.random().toString(36).slice(2, 8)}` ), activeId, baseElement: defaultValue(syncState == null ? void 0 : syncState.baseElement, null), includesBaseElement: defaultValue( props.includesBaseElement, syncState == null ? void 0 : syncState.includesBaseElement, activeId === null ), moves: defaultValue(syncState == null ? void 0 : syncState.moves, 0), orientation: defaultValue( props.orientation, syncState == null ? void 0 : syncState.orientation, "both" ), rtl: defaultValue(props.rtl, syncState == null ? void 0 : syncState.rtl, false), virtualFocus: defaultValue( props.virtualFocus, syncState == null ? void 0 : syncState.virtualFocus, false ), focusLoop: defaultValue(props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, false), focusWrap: defaultValue(props.focusWrap, syncState == null ? void 0 : syncState.focusWrap, false), focusShift: defaultValue(props.focusShift, syncState == null ? void 0 : syncState.focusShift, false) }; const composite = createStore(initialState, collection, props.store); setup( composite, () => sync2(composite, ["renderedItems", "activeId"], (state) => { composite.setState("activeId", (activeId2) => { var _a2; if (activeId2 !== void 0) return activeId2; return (_a2 = findFirstEnabledItem2(state.renderedItems)) == null ? void 0 : _a2.id; }); }) ); const getNextId = (direction = "next", options = {}) => { var _a2, _b; const defaultState = composite.getState(); const { skip = 0, activeId: activeId2 = defaultState.activeId, focusShift = defaultState.focusShift, focusLoop = defaultState.focusLoop, focusWrap = defaultState.focusWrap, includesBaseElement = defaultState.includesBaseElement, renderedItems = defaultState.renderedItems, rtl = defaultState.rtl } = options; const isVerticalDirection = direction === "up" || direction === "down"; const isNextDirection = direction === "next" || direction === "down"; const canReverse = isNextDirection ? rtl && !isVerticalDirection : !rtl || isVerticalDirection; const canShift = focusShift && !skip; let items = !isVerticalDirection ? renderedItems : flatten2DArray( normalizeRows(groupItemsByRows2(renderedItems), activeId2, canShift) ); items = canReverse ? reverseArray(items) : items; items = isVerticalDirection ? verticalizeItems(items) : items; if (activeId2 == null) { return (_a2 = findFirstEnabledItem2(items)) == null ? void 0 : _a2.id; } const activeItem = items.find((item) => item.id === activeId2); if (!activeItem) { return (_b = findFirstEnabledItem2(items)) == null ? void 0 : _b.id; } const isGrid2 = items.some((item) => item.rowId); const activeIndex = items.indexOf(activeItem); const nextItems = items.slice(activeIndex + 1); const nextItemsInRow = getItemsInRow(nextItems, activeItem.rowId); if (skip) { const nextEnabledItemsInRow = getEnabledItems(nextItemsInRow, activeId2); const nextItem2 = nextEnabledItemsInRow.slice(skip)[0] || // If we can't find an item, just return the last one. nextEnabledItemsInRow[nextEnabledItemsInRow.length - 1]; return nextItem2 == null ? void 0 : nextItem2.id; } const canLoop = focusLoop && (isVerticalDirection ? focusLoop !== "horizontal" : focusLoop !== "vertical"); const canWrap = isGrid2 && focusWrap && (isVerticalDirection ? focusWrap !== "horizontal" : focusWrap !== "vertical"); const hasNullItem = isNextDirection ? (!isGrid2 || isVerticalDirection) && canLoop && includesBaseElement : isVerticalDirection ? includesBaseElement : false; if (canLoop) { const loopItems = canWrap && !hasNullItem ? items : getItemsInRow(items, activeItem.rowId); const sortedItems = flipItems(loopItems, activeId2, hasNullItem); const nextItem2 = findFirstEnabledItem2(sortedItems, activeId2); return nextItem2 == null ? void 0 : nextItem2.id; } if (canWrap) { const nextItem2 = findFirstEnabledItem2( // We can use nextItems, which contains all the next items, including // items from other rows, to wrap between rows. However, if there is a // null item (the composite container), we'll only use the next items in // the row. So moving next from the last item will focus on the // composite container. On grid composites, horizontal navigation never // focuses on the composite container, only vertical. hasNullItem ? nextItemsInRow : nextItems, activeId2 ); const nextId2 = hasNullItem ? (nextItem2 == null ? void 0 : nextItem2.id) || null : nextItem2 == null ? void 0 : nextItem2.id; return nextId2; } const nextItem = findFirstEnabledItem2(nextItemsInRow, activeId2); if (!nextItem && hasNullItem) { return null; } return nextItem == null ? void 0 : nextItem.id; }; return { ...collection, ...composite, setBaseElement: (element) => composite.setState("baseElement", element), setActiveId: (id) => composite.setState("activeId", id), move: (id) => { if (id === void 0) return; composite.setState("activeId", id); composite.setState("moves", (moves) => moves + 1); }, first: () => { var _a2; return (_a2 = findFirstEnabledItem2(composite.getState().renderedItems)) == null ? void 0 : _a2.id; }, last: () => { var _a2; return (_a2 = findFirstEnabledItem2(reverseArray(composite.getState().renderedItems))) == null ? void 0 : _a2.id; }, next: (options) => { if (options !== void 0 && typeof options === "number") { options = { skip: options }; } return getNextId("next", options); }, previous: (options) => { if (options !== void 0 && typeof options === "number") { options = { skip: options }; } return getNextId("previous", options); }, down: (options) => { if (options !== void 0 && typeof options === "number") { options = { skip: options }; } return getNextId("down", options); }, up: (options) => { if (options !== void 0 && typeof options === "number") { options = { skip: options }; } return getNextId("up", options); } }; } // node_modules/@ariakit/react-core/esm/__chunks/IQYAUKXT.js function useCompositeStoreOptions(props) { const id = useId5(props.id); return { id, ...props }; } function useCompositeStoreProps(store2, update4, props) { store2 = useCollectionStoreProps(store2, update4, props); useStoreProps(store2, props, "activeId", "setActiveId"); useStoreProps(store2, props, "includesBaseElement"); useStoreProps(store2, props, "virtualFocus"); useStoreProps(store2, props, "orientation"); useStoreProps(store2, props, "rtl"); useStoreProps(store2, props, "focusLoop"); useStoreProps(store2, props, "focusWrap"); useStoreProps(store2, props, "focusShift"); return store2; } // node_modules/@ariakit/react-core/esm/__chunks/CVCFNOHX.js var import_react19 = __toESM(require_react(), 1); var ComboboxListRoleContext = (0, import_react19.createContext)( void 0 ); var ctx7 = createStoreContext( [PopoverContextProvider, CompositeContextProvider], [PopoverScopedContextProvider, CompositeScopedContextProvider] ); var useComboboxContext = ctx7.useContext; var useComboboxScopedContext = ctx7.useScopedContext; var useComboboxProviderContext = ctx7.useProviderContext; var ComboboxContextProvider = ctx7.ContextProvider; var ComboboxScopedContextProvider = ctx7.ScopedContextProvider; var ComboboxItemValueContext = (0, import_react19.createContext)( void 0 ); var ComboboxItemCheckedContext = (0, import_react19.createContext)(false); // node_modules/@ariakit/core/esm/__chunks/KMAUV3TY.js function createDialogStore(props = {}) { return createDisclosureStore(props); } // node_modules/@ariakit/react-core/esm/__chunks/4NYSH4UO.js function useDialogStoreProps(store2, update4, props) { return useDisclosureStoreProps(store2, update4, props); } // node_modules/@ariakit/core/esm/__chunks/BFGNM53A.js function createPopoverStore({ popover: otherPopover, ...props } = {}) { const store2 = mergeStore( props.store, omit2(otherPopover, [ "arrowElement", "anchorElement", "contentElement", "popoverElement", "disclosureElement" ]) ); throwOnConflictingProps(props, store2); const syncState = store2 == null ? void 0 : store2.getState(); const dialog = createDialogStore({ ...props, store: store2 }); const placement = defaultValue( props.placement, syncState == null ? void 0 : syncState.placement, "bottom" ); const initialState = { ...dialog.getState(), placement, currentPlacement: placement, anchorElement: defaultValue(syncState == null ? void 0 : syncState.anchorElement, null), popoverElement: defaultValue(syncState == null ? void 0 : syncState.popoverElement, null), arrowElement: defaultValue(syncState == null ? void 0 : syncState.arrowElement, null), rendered: /* @__PURE__ */ Symbol("rendered") }; const popover = createStore(initialState, dialog, store2); return { ...dialog, ...popover, setAnchorElement: (element) => popover.setState("anchorElement", element), setPopoverElement: (element) => popover.setState("popoverElement", element), setArrowElement: (element) => popover.setState("arrowElement", element), render: () => popover.setState("rendered", /* @__PURE__ */ Symbol("rendered")) }; } // node_modules/@ariakit/react-core/esm/__chunks/B6FLPFJM.js function usePopoverStoreProps(store2, update4, props) { useUpdateEffect(update4, [props.popover]); useStoreProps(store2, props, "placement"); return useDialogStoreProps(store2, update4, props); } // node_modules/@ariakit/react-core/esm/__chunks/4POTBZ2J.js var TagName7 = "div"; var usePopoverAnchor = createHook( function usePopoverAnchor2({ store: store2, ...props }) { const context = usePopoverProviderContext(); store2 = store2 || context; props = { ...props, ref: useMergeRefs(store2 == null ? void 0 : store2.setAnchorElement, props.ref) }; return props; } ); var PopoverAnchor = forwardRef22(function PopoverAnchor2(props) { const htmlProps = usePopoverAnchor(props); return createElement5(TagName7, htmlProps); }); // node_modules/@ariakit/react-core/esm/__chunks/X6LNAU2F.js var import_react20 = __toESM(require_react(), 1); var TagName8 = "div"; function getMouseDestination(event) { const relatedTarget = event.relatedTarget; if ((relatedTarget == null ? void 0 : relatedTarget.nodeType) === Node.ELEMENT_NODE) { return relatedTarget; } return null; } function hoveringInside(event) { const nextElement = getMouseDestination(event); if (!nextElement) return false; return contains(event.currentTarget, nextElement); } var symbol2 = /* @__PURE__ */ Symbol("composite-hover"); function movingToAnotherItem(event) { let dest = getMouseDestination(event); if (!dest) return false; do { if (hasOwnProperty(dest, symbol2) && dest[symbol2]) return true; dest = dest.parentElement; } while (dest); return false; } var useCompositeHover = createHook( function useCompositeHover2({ store: store2, focusOnHover = true, blurOnHoverEnd = !!focusOnHover, ...props }) { const context = useCompositeContext(); store2 = store2 || context; invariant( store2, "CompositeHover must be wrapped in a Composite component." ); const isMouseMoving = useIsMouseMoving(); const onMouseMoveProp = props.onMouseMove; const focusOnHoverProp = useBooleanEvent(focusOnHover); const onMouseMove = useEvent((event) => { onMouseMoveProp == null ? void 0 : onMouseMoveProp(event); if (event.defaultPrevented) return; if (!isMouseMoving()) return; if (!focusOnHoverProp(event)) return; if (!hasFocusWithin(event.currentTarget)) { const baseElement = store2 == null ? void 0 : store2.getState().baseElement; if (baseElement && !hasFocus(baseElement)) { baseElement.focus(); } } store2 == null ? void 0 : store2.setActiveId(event.currentTarget.id); }); const onMouseLeaveProp = props.onMouseLeave; const blurOnHoverEndProp = useBooleanEvent(blurOnHoverEnd); const onMouseLeave = useEvent((event) => { var _a; onMouseLeaveProp == null ? void 0 : onMouseLeaveProp(event); if (event.defaultPrevented) return; if (!isMouseMoving()) return; if (hoveringInside(event)) return; if (movingToAnotherItem(event)) return; if (!focusOnHoverProp(event)) return; if (!blurOnHoverEndProp(event)) return; store2 == null ? void 0 : store2.setActiveId(null); (_a = store2 == null ? void 0 : store2.getState().baseElement) == null ? void 0 : _a.focus(); }); const ref = (0, import_react20.useCallback)((element) => { if (!element) return; element[symbol2] = true; }, []); props = { ...props, ref: useMergeRefs(ref, props.ref), onMouseMove, onMouseLeave }; return removeUndefinedValues(props); } ); var CompositeHover = memo22( forwardRef22(function CompositeHover2(props) { const htmlProps = useCompositeHover(props); return createElement5(TagName8, htmlProps); }) ); // node_modules/@ariakit/react-core/esm/combobox/combobox.js var import_react21 = __toESM(require_react(), 1); var TagName9 = "input"; function isFirstItemAutoSelected(items, activeValue, autoSelect) { if (!autoSelect) return false; const firstItem = items.find((item) => !item.disabled && item.value); return (firstItem == null ? void 0 : firstItem.value) === activeValue; } function hasCompletionString(value, activeValue) { if (!activeValue) return false; if (value == null) return false; value = normalizeString2(value); return activeValue.length > value.length && activeValue.toLowerCase().indexOf(value.toLowerCase()) === 0; } function isInputEvent(event) { return event.type === "input"; } function isAriaAutoCompleteValue(value) { return value === "inline" || value === "list" || value === "both" || value === "none"; } function getDefaultAutoSelectId(items) { const item = items.find((item2) => { var _a; if (item2.disabled) return false; return ((_a = item2.element) == null ? void 0 : _a.getAttribute("role")) !== "tab"; }); return item == null ? void 0 : item.id; } var useCombobox = createHook( function useCombobox2({ store: store2, focusable = true, autoSelect: autoSelectProp = false, getAutoSelectId, setValueOnChange, showMinLength = 0, showOnChange, showOnMouseDown, showOnClick = showOnMouseDown, showOnKeyDown, showOnKeyPress = showOnKeyDown, blurActiveItemOnClick, setValueOnClick = true, moveOnKeyPress = true, autoComplete = "list", ...props }) { const context = useComboboxProviderContext(); store2 = store2 || context; invariant( store2, "Combobox must receive a `store` prop or be wrapped in a ComboboxProvider component." ); const ref = (0, import_react21.useRef)(null); const [valueUpdated, forceValueUpdate] = useForceUpdate2(); const canAutoSelectRef = (0, import_react21.useRef)(false); const composingRef = (0, import_react21.useRef)(false); const autoSelect = store2.useState( (state) => state.virtualFocus && autoSelectProp ); const inline = autoComplete === "inline" || autoComplete === "both"; const [canInline, setCanInline] = (0, import_react21.useState)(inline); useUpdateLayoutEffect(() => { if (!inline) return; setCanInline(true); }, [inline]); const storeValue = store2.useState("value"); const prevSelectedValueRef = (0, import_react21.useRef)(void 0); (0, import_react21.useEffect)(() => { return sync2(store2, ["selectedValue", "activeId"], (_, prev) => { prevSelectedValueRef.current = prev.selectedValue; }); }, []); const inlineActiveValue = store2.useState((state) => { var _a; if (!inline) return; if (!canInline) return; if (state.activeValue && Array.isArray(state.selectedValue)) { if (state.selectedValue.includes(state.activeValue)) return; if ((_a = prevSelectedValueRef.current) == null ? void 0 : _a.includes(state.activeValue)) return; } return state.activeValue; }); const items = store2.useState("renderedItems"); const open = store2.useState("open"); const contentElement = store2.useState("contentElement"); const value = (0, import_react21.useMemo)(() => { if (!inline) return storeValue; if (!canInline) return storeValue; const firstItemAutoSelected = isFirstItemAutoSelected( items, inlineActiveValue, autoSelect ); if (firstItemAutoSelected) { if (hasCompletionString(storeValue, inlineActiveValue)) { const slice = (inlineActiveValue == null ? void 0 : inlineActiveValue.slice(storeValue.length)) || ""; return storeValue + slice; } return storeValue; } return inlineActiveValue || storeValue; }, [inline, canInline, items, inlineActiveValue, autoSelect, storeValue]); (0, import_react21.useEffect)(() => { const element = ref.current; if (!element) return; const onCompositeItemMove = () => setCanInline(true); element.addEventListener("combobox-item-move", onCompositeItemMove); return () => { element.removeEventListener("combobox-item-move", onCompositeItemMove); }; }, []); (0, import_react21.useEffect)(() => { if (!inline) return; if (!canInline) return; if (!inlineActiveValue) return; const firstItemAutoSelected = isFirstItemAutoSelected( items, inlineActiveValue, autoSelect ); if (!firstItemAutoSelected) return; if (!hasCompletionString(storeValue, inlineActiveValue)) return; let cleanup = noop3; queueMicrotask(() => { const element = ref.current; if (!element) return; const { start: prevStart, end: prevEnd } = getTextboxSelection(element); const nextStart = storeValue.length; const nextEnd = inlineActiveValue.length; setSelectionRange(element, nextStart, nextEnd); cleanup = () => { if (!hasFocus(element)) return; const { start: start2, end } = getTextboxSelection(element); if (start2 !== nextStart) return; if (end !== nextEnd) return; setSelectionRange(element, prevStart, prevEnd); }; }); return () => cleanup(); }, [ valueUpdated, inline, canInline, inlineActiveValue, items, autoSelect, storeValue ]); const scrollingElementRef = (0, import_react21.useRef)(null); const getAutoSelectIdProp = useEvent(getAutoSelectId); const autoSelectIdRef = (0, import_react21.useRef)(null); (0, import_react21.useEffect)(() => { if (!open) return; if (!contentElement) return; const scrollingElement = getScrollingElement(contentElement); if (!scrollingElement) return; scrollingElementRef.current = scrollingElement; const onUserScroll = () => { canAutoSelectRef.current = false; }; const onScroll = () => { if (!store2) return; if (!canAutoSelectRef.current) return; const { activeId } = store2.getState(); if (activeId === null) return; if (activeId === autoSelectIdRef.current) return; canAutoSelectRef.current = false; }; const options = { passive: true, capture: true }; scrollingElement.addEventListener("wheel", onUserScroll, options); scrollingElement.addEventListener("touchmove", onUserScroll, options); scrollingElement.addEventListener("scroll", onScroll, options); return () => { scrollingElement.removeEventListener("wheel", onUserScroll, true); scrollingElement.removeEventListener("touchmove", onUserScroll, true); scrollingElement.removeEventListener("scroll", onScroll, true); }; }, [open, contentElement, store2]); useSafeLayoutEffect(() => { if (!storeValue) return; if (composingRef.current) return; canAutoSelectRef.current = true; }, [storeValue]); useSafeLayoutEffect(() => { if (autoSelect !== "always" && open) return; canAutoSelectRef.current = open; }, [autoSelect, open]); const resetValueOnSelect = store2.useState("resetValueOnSelect"); useUpdateEffect(() => { var _a, _b; const canAutoSelect = canAutoSelectRef.current; if (!store2) return; if (!open) return; if (!canAutoSelect && !resetValueOnSelect) return; const { baseElement, contentElement: contentElement2, activeId } = store2.getState(); if (baseElement && !hasFocus(baseElement)) return; if (contentElement2 == null ? void 0 : contentElement2.hasAttribute("data-placing")) { const observer = new MutationObserver(forceValueUpdate); observer.observe(contentElement2, { attributeFilter: ["data-placing"] }); return () => observer.disconnect(); } if (autoSelect && canAutoSelect) { const userAutoSelectId = getAutoSelectIdProp(items); const autoSelectId = userAutoSelectId !== void 0 ? userAutoSelectId : (_a = getDefaultAutoSelectId(items)) != null ? _a : store2.first(); autoSelectIdRef.current = autoSelectId; store2.move(autoSelectId != null ? autoSelectId : null); } else { const element = (_b = store2.item(activeId || store2.first())) == null ? void 0 : _b.element; if (element && "scrollIntoView" in element) { element.scrollIntoView({ block: "nearest", inline: "nearest" }); } } return; }, [ store2, open, valueUpdated, storeValue, autoSelect, resetValueOnSelect, getAutoSelectIdProp, items ]); (0, import_react21.useEffect)(() => { if (!inline) return; const combobox = ref.current; if (!combobox) return; const elements2 = [combobox, contentElement].filter( (value2) => !!value2 ); const onBlur2 = (event) => { if (elements2.every((el) => isFocusEventOutside(event, el))) { store2 == null ? void 0 : store2.setValue(value); } }; for (const element of elements2) { element.addEventListener("focusout", onBlur2); } return () => { for (const element of elements2) { element.removeEventListener("focusout", onBlur2); } }; }, [inline, contentElement, store2, value]); const canShow = (event) => { const currentTarget = event.currentTarget; return currentTarget.value.length >= showMinLength; }; const onChangeProp = props.onChange; const showOnChangeProp = useBooleanEvent(showOnChange != null ? showOnChange : canShow); const setValueOnChangeProp = useBooleanEvent( // If the combobox is combined with tags, the value will be set by the tag // input component. setValueOnChange != null ? setValueOnChange : !store2.tag ); const onChange = useEvent((event) => { onChangeProp == null ? void 0 : onChangeProp(event); if (event.defaultPrevented) return; if (!store2) return; const currentTarget = event.currentTarget; const { value: value2, selectionStart, selectionEnd } = currentTarget; const nativeEvent = event.nativeEvent; canAutoSelectRef.current = true; if (isInputEvent(nativeEvent)) { if (nativeEvent.isComposing) { canAutoSelectRef.current = false; composingRef.current = true; } if (inline) { const textInserted = nativeEvent.inputType === "insertText" || nativeEvent.inputType === "insertCompositionText"; const caretAtEnd = selectionStart === value2.length; setCanInline(textInserted && caretAtEnd); } } if (setValueOnChangeProp(event)) { const isSameValue = value2 === store2.getState().value; store2.setValue(value2); queueMicrotask(() => { setSelectionRange(currentTarget, selectionStart, selectionEnd); }); if (inline && autoSelect && isSameValue) { forceValueUpdate(); } } if (showOnChangeProp(event)) { store2.show(); } if (!autoSelect || !canAutoSelectRef.current) { store2.setActiveId(null); } }); const onCompositionEndProp = props.onCompositionEnd; const onCompositionEnd = useEvent((event) => { canAutoSelectRef.current = true; composingRef.current = false; onCompositionEndProp == null ? void 0 : onCompositionEndProp(event); if (event.defaultPrevented) return; if (!autoSelect) return; forceValueUpdate(); }); const onMouseDownProp = props.onMouseDown; const blurActiveItemOnClickProp = useBooleanEvent( blurActiveItemOnClick != null ? blurActiveItemOnClick : (() => !!(store2 == null ? void 0 : store2.getState().includesBaseElement)) ); const setValueOnClickProp = useBooleanEvent(setValueOnClick); const showOnClickProp = useBooleanEvent(showOnClick != null ? showOnClick : canShow); const onMouseDown = useEvent((event) => { onMouseDownProp == null ? void 0 : onMouseDownProp(event); if (event.defaultPrevented) return; if (event.button) return; if (event.ctrlKey) return; if (!store2) return; if (blurActiveItemOnClickProp(event)) { store2.setActiveId(null); } if (setValueOnClickProp(event)) { store2.setValue(value); } if (showOnClickProp(event)) { queueBeforeEvent(event.currentTarget, "mouseup", store2.show); } }); const onKeyDownProp = props.onKeyDown; const showOnKeyPressProp = useBooleanEvent(showOnKeyPress != null ? showOnKeyPress : canShow); const onKeyDown = useEvent((event) => { onKeyDownProp == null ? void 0 : onKeyDownProp(event); if (!event.repeat) { canAutoSelectRef.current = false; } if (event.defaultPrevented) return; if (event.ctrlKey) return; if (event.altKey) return; if (event.shiftKey) return; if (event.metaKey) return; if (!store2) return; const { open: open2 } = store2.getState(); if (open2) return; if (event.key === "ArrowUp" || event.key === "ArrowDown") { if (showOnKeyPressProp(event)) { event.preventDefault(); store2.show(); } } }); const onBlurProp = props.onBlur; const onBlur = useEvent((event) => { canAutoSelectRef.current = false; onBlurProp == null ? void 0 : onBlurProp(event); if (event.defaultPrevented) return; }); const id = useId5(props.id); const ariaAutoComplete = isAriaAutoCompleteValue(autoComplete) ? autoComplete : void 0; const isActiveItem = store2.useState((state) => state.activeId === null); props = { id, role: "combobox", "aria-autocomplete": ariaAutoComplete, "aria-haspopup": getPopupRole(contentElement, "listbox"), "aria-expanded": open, "aria-controls": contentElement == null ? void 0 : contentElement.id, "data-active-item": isActiveItem || void 0, value, ...props, ref: useMergeRefs(ref, props.ref), onChange, onCompositionEnd, onMouseDown, onKeyDown, onBlur }; props = useComposite({ store: store2, focusable, ...props, // Enable inline autocomplete when the user moves from the combobox input // to an item. moveOnKeyPress: (event) => { if (isFalsyBooleanCallback(moveOnKeyPress, event)) return false; if (inline) setCanInline(true); return true; } }); props = usePopoverAnchor({ store: store2, ...props }); return { autoComplete: "off", ...props }; } ); var Combobox = forwardRef22(function Combobox2(props) { const htmlProps = useCombobox(props); return createElement5(TagName9, htmlProps); }); // node_modules/@ariakit/react-core/esm/__chunks/IBXZ2LQC.js var import_react22 = __toESM(require_react(), 1); var import_jsx_runtime210 = __toESM(require_jsx_runtime(), 1); var TagName10 = "div"; function isSelected(storeValue, itemValue) { if (itemValue == null) return; if (storeValue == null) return false; if (Array.isArray(storeValue)) { return storeValue.includes(itemValue); } return storeValue === itemValue; } function getItemRole(popupRole) { var _a; const itemRoleByPopupRole = { menu: "menuitem", listbox: "option", tree: "treeitem" }; const key = popupRole; return (_a = itemRoleByPopupRole[key]) != null ? _a : "option"; } var useComboboxItem = createHook( function useComboboxItem2({ store: store2, value, hideOnClick, setValueOnClick, selectValueOnClick = true, resetValueOnSelect, focusOnHover = false, moveOnKeyPress = true, getItem: getItemProp, ...props }) { var _a; const context = useComboboxScopedContext(); store2 = store2 || context; invariant( store2, "ComboboxItem must be wrapped in a ComboboxList or ComboboxPopover component." ); const { resetValueOnSelectState, multiSelectable, selected } = useStoreStateObject(store2, { resetValueOnSelectState: "resetValueOnSelect", multiSelectable(state) { return Array.isArray(state.selectedValue); }, selected(state) { return isSelected(state.selectedValue, value); } }); const getItem = (0, import_react22.useCallback)( (item) => { const nextItem = { ...item, value }; if (getItemProp) { return getItemProp(nextItem); } return nextItem; }, [value, getItemProp] ); setValueOnClick = setValueOnClick != null ? setValueOnClick : !multiSelectable; hideOnClick = hideOnClick != null ? hideOnClick : value != null && !multiSelectable; const onClickProp = props.onClick; const setValueOnClickProp = useBooleanEvent(setValueOnClick); const selectValueOnClickProp = useBooleanEvent(selectValueOnClick); const resetValueOnSelectProp = useBooleanEvent( (_a = resetValueOnSelect != null ? resetValueOnSelect : resetValueOnSelectState) != null ? _a : multiSelectable ); const hideOnClickProp = useBooleanEvent(hideOnClick); const onClick = useEvent((event) => { onClickProp == null ? void 0 : onClickProp(event); if (event.defaultPrevented) return; if (isDownloading(event)) return; if (isOpeningInNewTab(event)) return; if (value != null) { if (selectValueOnClickProp(event)) { if (resetValueOnSelectProp(event)) { store2 == null ? void 0 : store2.resetValue(); } store2 == null ? void 0 : store2.setSelectedValue((prevValue) => { if (!Array.isArray(prevValue)) return value; if (prevValue.includes(value)) { return prevValue.filter((v2) => v2 !== value); } return [...prevValue, value]; }); } if (setValueOnClickProp(event)) { store2 == null ? void 0 : store2.setValue(value); } } if (hideOnClickProp(event)) { store2 == null ? void 0 : store2.hide(); } }); const onKeyDownProp = props.onKeyDown; const onKeyDown = useEvent((event) => { onKeyDownProp == null ? void 0 : onKeyDownProp(event); if (event.defaultPrevented) return; const baseElement = store2 == null ? void 0 : store2.getState().baseElement; if (!baseElement) return; if (hasFocus(baseElement)) return; const printable = event.key.length === 1; if (printable || event.key === "Backspace" || event.key === "Delete") { queueMicrotask(() => baseElement.focus()); if (isTextField(baseElement)) { store2 == null ? void 0 : store2.setValue(baseElement.value); } } }); if (multiSelectable && selected != null) { props = { "aria-selected": selected, ...props }; } props = useWrapElement( props, (element) => /* @__PURE__ */ (0, import_jsx_runtime210.jsx)(ComboboxItemValueContext.Provider, { value, children: /* @__PURE__ */ (0, import_jsx_runtime210.jsx)(ComboboxItemCheckedContext.Provider, { value: selected != null ? selected : false, children: element }) }), [value, selected] ); const popupRole = (0, import_react22.useContext)(ComboboxListRoleContext); props = { role: getItemRole(popupRole), children: value, ...props, onClick, onKeyDown }; const moveOnKeyPressProp = useBooleanEvent(moveOnKeyPress); props = useCompositeItem({ store: store2, ...props, getItem, // Dispatch a custom event on the combobox input when moving to an item // with the keyboard so the Combobox component can enable inline // autocompletion. moveOnKeyPress: (event) => { if (!moveOnKeyPressProp(event)) return false; const moveEvent = new Event("combobox-item-move"); const baseElement = store2 == null ? void 0 : store2.getState().baseElement; baseElement == null ? void 0 : baseElement.dispatchEvent(moveEvent); return true; } }); props = useCompositeHover({ store: store2, focusOnHover, ...props }); return props; } ); var ComboboxItem = memo22( forwardRef22(function ComboboxItem2(props) { const htmlProps = useComboboxItem(props); return createElement5(TagName10, htmlProps); }) ); // node_modules/@ariakit/react-core/esm/combobox/combobox-item-value.js var import_react23 = __toESM(require_react(), 1); var import_jsx_runtime211 = __toESM(require_jsx_runtime(), 1); var TagName11 = "span"; function normalizeValue(value) { return normalizeString2(value).toLowerCase(); } function getOffsets(string, values) { const offsets = []; for (const value of values) { let pos = 0; const length = value.length; while (string.indexOf(value, pos) !== -1) { const index = string.indexOf(value, pos); if (index !== -1) { offsets.push([index, length]); } pos = index + 1; } } return offsets; } function filterOverlappingOffsets(offsets) { return offsets.filter(([offset, length], i2, arr) => { return !arr.some( ([o3, l2], j2) => j2 !== i2 && o3 <= offset && o3 + l2 >= offset + length ); }); } function sortOffsets(offsets) { return offsets.sort(([a2], [b2]) => a2 - b2); } function splitValue(itemValue, userValue) { if (!itemValue) return itemValue; if (!userValue) return itemValue; const userValues = toArray2(userValue).filter(Boolean).map(normalizeValue); const parts = []; const span = (value, autocomplete = false) => /* @__PURE__ */ (0, import_jsx_runtime211.jsx)( "span", { "data-autocomplete-value": autocomplete ? "" : void 0, "data-user-value": autocomplete ? void 0 : "", children: value }, parts.length ); const offsets = sortOffsets( filterOverlappingOffsets( // Convert userValues into a set to avoid duplicates getOffsets(normalizeValue(itemValue), new Set(userValues)) ) ); if (!offsets.length) { parts.push(span(itemValue, true)); return parts; } const [firstOffset] = offsets[0]; const values = [ itemValue.slice(0, firstOffset), ...offsets.flatMap(([offset, length], i2) => { var _a; const value = itemValue.slice(offset, offset + length); const nextOffset = (_a = offsets[i2 + 1]) == null ? void 0 : _a[0]; const nextValue = itemValue.slice(offset + length, nextOffset); return [value, nextValue]; }) ]; values.forEach((value, i2) => { if (!value) return; parts.push(span(value, i2 % 2 === 0)); }); return parts; } var useComboboxItemValue = createHook(function useComboboxItemValue2({ store: store2, value, userValue, ...props }) { const context = useComboboxScopedContext(); store2 = store2 || context; const itemContext = (0, import_react23.useContext)(ComboboxItemValueContext); const itemValue = value != null ? value : itemContext; const inputValue = useStoreState(store2, (state) => userValue != null ? userValue : state == null ? void 0 : state.value); const children = (0, import_react23.useMemo)(() => { if (!itemValue) return; if (!inputValue) return itemValue; return splitValue(itemValue, inputValue); }, [itemValue, inputValue]); props = { children, ...props }; return removeUndefinedValues(props); }); var ComboboxItemValue = forwardRef22(function ComboboxItemValue2(props) { const htmlProps = useComboboxItemValue(props); return createElement5(TagName11, htmlProps); }); // node_modules/@ariakit/react-core/esm/combobox/combobox-label.js var TagName12 = "label"; var useComboboxLabel = createHook( function useComboboxLabel2({ store: store2, ...props }) { const context = useComboboxProviderContext(); store2 = store2 || context; invariant( store2, "ComboboxLabel must receive a `store` prop or be wrapped in a ComboboxProvider component." ); const comboboxId = store2.useState((state) => { var _a; return (_a = state.baseElement) == null ? void 0 : _a.id; }); props = { htmlFor: comboboxId, ...props }; return removeUndefinedValues(props); } ); var ComboboxLabel = memo22( forwardRef22(function ComboboxLabel2(props) { const htmlProps = useComboboxLabel(props); return createElement5(TagName12, htmlProps); }) ); // node_modules/@ariakit/react-core/esm/__chunks/2G6YEJT4.js var import_react24 = __toESM(require_react(), 1); var import_jsx_runtime212 = __toESM(require_jsx_runtime(), 1); var TagName13 = "div"; var useComboboxList = createHook( function useComboboxList2({ store: store2, alwaysVisible, ...props }) { const scopedContext = useComboboxScopedContext(true); const context = useComboboxContext(); store2 = store2 || context; const scopedContextSameStore = !!store2 && store2 === scopedContext; invariant( store2, "ComboboxList must receive a `store` prop or be wrapped in a ComboboxProvider component." ); const ref = (0, import_react24.useRef)(null); const id = useId5(props.id); const mounted = store2.useState("mounted"); const hidden = isHidden(mounted, props.hidden, alwaysVisible); const style = hidden ? { ...props.style, display: "none" } : props.style; const multiSelectable = store2.useState( (state) => Array.isArray(state.selectedValue) ); const role = useAttribute(ref, "role", props.role); const isCompositeRole = role === "listbox" || role === "tree" || role === "grid"; const ariaMultiSelectable = isCompositeRole ? multiSelectable || void 0 : void 0; const [hasListboxInside, setHasListboxInside] = (0, import_react24.useState)(false); const contentElement = store2.useState("contentElement"); useSafeLayoutEffect(() => { if (!mounted) return; const element = ref.current; if (!element) return; if (contentElement !== element) return; const callback = () => { setHasListboxInside(!!element.querySelector("[role='listbox']")); }; const observer = new MutationObserver(callback); observer.observe(element, { subtree: true, childList: true, attributeFilter: ["role"] }); callback(); return () => observer.disconnect(); }, [mounted, contentElement]); if (!hasListboxInside) { props = { role: "listbox", "aria-multiselectable": ariaMultiSelectable, ...props }; } props = useWrapElement( props, (element) => /* @__PURE__ */ (0, import_jsx_runtime212.jsx)(ComboboxScopedContextProvider, { value: store2, children: /* @__PURE__ */ (0, import_jsx_runtime212.jsx)(ComboboxListRoleContext.Provider, { value: role, children: element }) }), [store2, role] ); const setContentElement = id && (!scopedContext || !scopedContextSameStore) ? store2.setContentElement : null; props = { id, hidden, ...props, ref: useMergeRefs(setContentElement, ref, props.ref), style }; return removeUndefinedValues(props); } ); var ComboboxList = forwardRef22(function ComboboxList2(props) { const htmlProps = useComboboxList(props); return createElement5(TagName13, htmlProps); }); // node_modules/@ariakit/react-core/esm/__chunks/XSIEPKGA.js var import_react25 = __toESM(require_react(), 1); var TagValueContext = (0, import_react25.createContext)(null); var TagRemoveIdContext = (0, import_react25.createContext)( null ); var ctx8 = createStoreContext( [CompositeContextProvider], [CompositeScopedContextProvider] ); var useTagContext = ctx8.useContext; var useTagScopedContext = ctx8.useScopedContext; var useTagProviderContext = ctx8.useProviderContext; var TagContextProvider = ctx8.ContextProvider; var TagScopedContextProvider = ctx8.ScopedContextProvider; // node_modules/@ariakit/core/esm/combobox/combobox-store.js var isTouchSafari = isSafari() && isTouchDevice(); function createComboboxStore({ tag, ...props } = {}) { const store2 = mergeStore(props.store, pick2(tag, ["value", "rtl"])); throwOnConflictingProps(props, store2); const tagState = tag == null ? void 0 : tag.getState(); const syncState = store2 == null ? void 0 : store2.getState(); const activeId = defaultValue( props.activeId, syncState == null ? void 0 : syncState.activeId, props.defaultActiveId, null ); const composite = createCompositeStore({ ...props, activeId, includesBaseElement: defaultValue( props.includesBaseElement, syncState == null ? void 0 : syncState.includesBaseElement, true ), orientation: defaultValue( props.orientation, syncState == null ? void 0 : syncState.orientation, "vertical" ), focusLoop: defaultValue(props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true), focusWrap: defaultValue(props.focusWrap, syncState == null ? void 0 : syncState.focusWrap, true), virtualFocus: defaultValue( props.virtualFocus, syncState == null ? void 0 : syncState.virtualFocus, true ) }); const popover = createPopoverStore({ ...props, placement: defaultValue( props.placement, syncState == null ? void 0 : syncState.placement, "bottom-start" ) }); const value = defaultValue( props.value, syncState == null ? void 0 : syncState.value, props.defaultValue, "" ); const selectedValue = defaultValue( props.selectedValue, syncState == null ? void 0 : syncState.selectedValue, tagState == null ? void 0 : tagState.values, props.defaultSelectedValue, "" ); const multiSelectable = Array.isArray(selectedValue); const initialState = { ...composite.getState(), ...popover.getState(), value, selectedValue, resetValueOnSelect: defaultValue( props.resetValueOnSelect, syncState == null ? void 0 : syncState.resetValueOnSelect, multiSelectable ), resetValueOnHide: defaultValue( props.resetValueOnHide, syncState == null ? void 0 : syncState.resetValueOnHide, multiSelectable && !tag ), activeValue: syncState == null ? void 0 : syncState.activeValue }; const combobox = createStore(initialState, composite, popover, store2); if (isTouchSafari) { setup( combobox, () => sync2(combobox, ["virtualFocus"], () => { combobox.setState("virtualFocus", false); }) ); } setup(combobox, () => { if (!tag) return; return chain( sync2(combobox, ["selectedValue"], (state) => { if (!Array.isArray(state.selectedValue)) return; tag.setValues(state.selectedValue); }), sync2(tag, ["values"], (state) => { combobox.setState("selectedValue", state.values); }) ); }); setup( combobox, () => sync2(combobox, ["resetValueOnHide", "mounted"], (state) => { if (!state.resetValueOnHide) return; if (state.mounted) return; combobox.setState("value", value); }) ); setup( combobox, () => sync2(combobox, ["open"], (state) => { if (state.open) return; combobox.setState("activeId", activeId); combobox.setState("moves", 0); }) ); setup( combobox, () => sync2(combobox, ["moves", "activeId"], (state, prevState) => { if (state.moves === prevState.moves) { combobox.setState("activeValue", void 0); } }) ); setup( combobox, () => batch(combobox, ["moves", "renderedItems"], (state, prev) => { if (state.moves === prev.moves) return; const { activeId: activeId2 } = combobox.getState(); const activeItem = composite.item(activeId2); combobox.setState("activeValue", activeItem == null ? void 0 : activeItem.value); }) ); return { ...popover, ...composite, ...combobox, tag, setValue: (value2) => combobox.setState("value", value2), resetValue: () => combobox.setState("value", initialState.value), setSelectedValue: (selectedValue2) => combobox.setState("selectedValue", selectedValue2) }; } // node_modules/@ariakit/react-core/esm/__chunks/SVN33SY6.js function useComboboxStoreOptions(props) { const tag = useTagContext(); props = { ...props, tag: props.tag !== void 0 ? props.tag : tag }; return useCompositeStoreOptions(props); } function useComboboxStoreProps(store2, update4, props) { useUpdateEffect(update4, [props.tag]); useStoreProps(store2, props, "value", "setValue"); useStoreProps(store2, props, "selectedValue", "setSelectedValue"); useStoreProps(store2, props, "resetValueOnHide"); useStoreProps(store2, props, "resetValueOnSelect"); return Object.assign( useCompositeStoreProps( usePopoverStoreProps(store2, update4, props), update4, props ), { tag: props.tag } ); } function useComboboxStore(props = {}) { props = useComboboxStoreOptions(props); const [store2, update4] = useStore(createComboboxStore, props); return useComboboxStoreProps(store2, update4, props); } // node_modules/@ariakit/react-core/esm/combobox/combobox-provider.js var import_jsx_runtime213 = __toESM(require_jsx_runtime(), 1); function ComboboxProvider(props = {}) { const store2 = useComboboxStore(props); return /* @__PURE__ */ (0, import_jsx_runtime213.jsx)(ComboboxContextProvider, { value: store2, children: props.children }); } // packages/dataviews/build-module/components/dataviews-filters/search-widget.mjs var import_remove_accents = __toESM(require_remove_accents(), 1); var import_compose19 = __toESM(require_compose(), 1); var import_i18n104 = __toESM(require_i18n(), 1); var import_element90 = __toESM(require_element(), 1); var import_components109 = __toESM(require_components(), 1); // packages/dataviews/build-module/components/dataviews-filters/utils.mjs var EMPTY_ARRAY6 = []; var getCurrentValue = (filterDefinition, currentFilter) => { if (filterDefinition.singleSelection) { return currentFilter?.value; } if (Array.isArray(currentFilter?.value)) { return currentFilter.value; } if (!Array.isArray(currentFilter?.value) && !!currentFilter?.value) { return [currentFilter.value]; } return EMPTY_ARRAY6; }; // packages/dataviews/build-module/hooks/use-elements.mjs var import_element89 = __toESM(require_element(), 1); var EMPTY_ARRAY7 = []; function useElements({ elements: elements2, getElements }) { const staticElements = Array.isArray(elements2) && elements2.length > 0 ? elements2 : EMPTY_ARRAY7; const [records, setRecords] = (0, import_element89.useState)(staticElements); const [isLoading, setIsLoading] = (0, import_element89.useState)(false); (0, import_element89.useEffect)(() => { if (!getElements) { setRecords(staticElements); return; } let cancelled = false; setIsLoading(true); getElements().then((fetchedElements) => { if (!cancelled) { const dynamicElements = Array.isArray(fetchedElements) && fetchedElements.length > 0 ? fetchedElements : staticElements; setRecords(dynamicElements); } }).catch(() => { if (!cancelled) { setRecords(staticElements); } }).finally(() => { if (!cancelled) { setIsLoading(false); } }); return () => { cancelled = true; }; }, [getElements, staticElements]); return { elements: records, isLoading }; } // packages/dataviews/build-module/components/dataviews-filters/search-widget.mjs var import_jsx_runtime214 = __toESM(require_jsx_runtime(), 1); function normalizeSearchInput(input = "") { return (0, import_remove_accents.default)(input.trim().toLowerCase()); } var getNewValue = (filterDefinition, currentFilter, value) => { if (filterDefinition.singleSelection) { return value; } if (Array.isArray(currentFilter?.value)) { return currentFilter.value.includes(value) ? currentFilter.value.filter((v2) => v2 !== value) : [...currentFilter.value, value]; } return [value]; }; function generateFilterElementCompositeItemId(prefix2, filterElementValue) { return `${prefix2}-${filterElementValue}`; } var MultiSelectionOption = ({ selected }) => { return /* @__PURE__ */ (0, import_jsx_runtime214.jsx)( "span", { className: clsx_default( "dataviews-filters__search-widget-listitem-multi-selection", { "is-selected": selected } ), children: selected && /* @__PURE__ */ (0, import_jsx_runtime214.jsx)(import_components109.Icon, { icon: check_default }) } ); }; var SingleSelectionOption = ({ selected }) => { return /* @__PURE__ */ (0, import_jsx_runtime214.jsx)( "span", { className: clsx_default( "dataviews-filters__search-widget-listitem-single-selection", { "is-selected": selected } ) } ); }; function ListBox({ view, filter, onChangeView }) { const baseId = (0, import_compose19.useInstanceId)(ListBox, "dataviews-filter-list-box"); const [activeCompositeId, setActiveCompositeId] = (0, import_element90.useState)( // When there are one or less operators, the first item is set as active // (by setting the initial `activeId` to `undefined`). // With 2 or more operators, the focus is moved on the operators control // (by setting the initial `activeId` to `null`), meaning that there won't // be an active item initially. Focus is then managed via the // `onFocusVisible` callback. filter.operators?.length === 1 ? void 0 : null ); const currentFilter = view.filters?.find( (f2) => f2.field === filter.field ); const currentValue = getCurrentValue(filter, currentFilter); return /* @__PURE__ */ (0, import_jsx_runtime214.jsx)( import_components109.Composite, { virtualFocus: true, focusLoop: true, activeId: activeCompositeId, setActiveId: setActiveCompositeId, role: "listbox", className: "dataviews-filters__search-widget-listbox", "aria-label": (0, import_i18n104.sprintf)( /* translators: List of items for a filter. 1: Filter name. e.g.: "List of: Author". */ (0, import_i18n104.__)("List of: %1$s"), filter.name ), onFocusVisible: () => { if (!activeCompositeId && filter.elements.length) { setActiveCompositeId( generateFilterElementCompositeItemId( baseId, filter.elements[0].value ) ); } }, render: /* @__PURE__ */ (0, import_jsx_runtime214.jsx)(import_components109.Composite.Typeahead, {}), children: filter.elements.map((element) => /* @__PURE__ */ (0, import_jsx_runtime214.jsxs)( import_components109.Composite.Hover, { render: /* @__PURE__ */ (0, import_jsx_runtime214.jsx)( import_components109.Composite.Item, { id: generateFilterElementCompositeItemId( baseId, element.value ), render: /* @__PURE__ */ (0, import_jsx_runtime214.jsx)( "div", { "aria-label": element.label, role: "option", className: "dataviews-filters__search-widget-listitem" } ), onClick: () => { const newFilters = currentFilter ? [ ...(view.filters ?? []).map( (_filter) => { if (_filter.field === filter.field) { return { ..._filter, operator: currentFilter.operator || filter.operators[0], value: getNewValue( filter, currentFilter, element.value ) }; } return _filter; } ) ] : [ ...view.filters ?? [], { field: filter.field, operator: filter.operators[0], value: getNewValue( filter, currentFilter, element.value ) } ]; onChangeView({ ...view, page: 1, filters: newFilters }); } } ), children: [ filter.singleSelection && /* @__PURE__ */ (0, import_jsx_runtime214.jsx)( SingleSelectionOption, { selected: currentValue === element.value } ), !filter.singleSelection && /* @__PURE__ */ (0, import_jsx_runtime214.jsx)( MultiSelectionOption, { selected: currentValue.includes(element.value) } ), /* @__PURE__ */ (0, import_jsx_runtime214.jsx)( "span", { className: "dataviews-filters__search-widget-listitem-value", title: element.label, children: element.label } ) ] }, element.value )) } ); } function ComboboxList22({ view, filter, onChangeView }) { const [searchValue, setSearchValue] = (0, import_element90.useState)(""); const deferredSearchValue = (0, import_element90.useDeferredValue)(searchValue); const currentFilter = view.filters?.find( (_filter) => _filter.field === filter.field ); const currentValue = getCurrentValue(filter, currentFilter); const matches = (0, import_element90.useMemo)(() => { const normalizedSearch = normalizeSearchInput(deferredSearchValue); return filter.elements.filter( (item) => normalizeSearchInput(item.label).includes(normalizedSearch) ); }, [filter.elements, deferredSearchValue]); return /* @__PURE__ */ (0, import_jsx_runtime214.jsxs)( ComboboxProvider, { selectedValue: currentValue, setSelectedValue: (value) => { const newFilters = currentFilter ? [ ...(view.filters ?? []).map((_filter) => { if (_filter.field === filter.field) { return { ..._filter, operator: currentFilter.operator || filter.operators[0], value }; } return _filter; }) ] : [ ...view.filters ?? [], { field: filter.field, operator: filter.operators[0], value } ]; onChangeView({ ...view, page: 1, filters: newFilters }); }, setValue: setSearchValue, children: [ /* @__PURE__ */ (0, import_jsx_runtime214.jsxs)("div", { className: "dataviews-filters__search-widget-filter-combobox__wrapper", children: [ /* @__PURE__ */ (0, import_jsx_runtime214.jsx)( ComboboxLabel, { render: /* @__PURE__ */ (0, import_jsx_runtime214.jsx)(import_components109.VisuallyHidden, { children: (0, import_i18n104.__)("Search items") }), children: (0, import_i18n104.__)("Search items") } ), /* @__PURE__ */ (0, import_jsx_runtime214.jsx)( Combobox, { autoSelect: "always", placeholder: (0, import_i18n104.__)("Search"), className: "dataviews-filters__search-widget-filter-combobox__input" } ), /* @__PURE__ */ (0, import_jsx_runtime214.jsx)("div", { className: "dataviews-filters__search-widget-filter-combobox__icon", children: /* @__PURE__ */ (0, import_jsx_runtime214.jsx)(import_components109.Icon, { icon: search_default }) }) ] }), /* @__PURE__ */ (0, import_jsx_runtime214.jsxs)( ComboboxList, { className: "dataviews-filters__search-widget-filter-combobox-list", alwaysVisible: true, children: [ matches.map((element) => { return /* @__PURE__ */ (0, import_jsx_runtime214.jsxs)( ComboboxItem, { resetValueOnSelect: false, value: element.value, className: "dataviews-filters__search-widget-listitem", hideOnClick: false, setValueOnClick: false, focusOnHover: true, children: [ filter.singleSelection && /* @__PURE__ */ (0, import_jsx_runtime214.jsx)( SingleSelectionOption, { selected: currentValue === element.value } ), !filter.singleSelection && /* @__PURE__ */ (0, import_jsx_runtime214.jsx)( MultiSelectionOption, { selected: currentValue.includes( element.value ) } ), /* @__PURE__ */ (0, import_jsx_runtime214.jsxs)( "span", { className: "dataviews-filters__search-widget-listitem-value", title: element.label, children: [ /* @__PURE__ */ (0, import_jsx_runtime214.jsx)( ComboboxItemValue, { className: "dataviews-filters__search-widget-filter-combobox-item-value", value: element.label } ), !!element.description && /* @__PURE__ */ (0, import_jsx_runtime214.jsx)("span", { className: "dataviews-filters__search-widget-listitem-description", children: element.description }) ] } ) ] }, element.value ); }), !matches.length && /* @__PURE__ */ (0, import_jsx_runtime214.jsx)("p", { children: (0, import_i18n104.__)("No results found") }) ] } ) ] } ); } function SearchWidget(props) { const { elements: elements2, isLoading } = useElements({ elements: props.filter.elements, getElements: props.filter.getElements }); if (isLoading) { return /* @__PURE__ */ (0, import_jsx_runtime214.jsx)("div", { className: "dataviews-filters__search-widget-no-elements", children: /* @__PURE__ */ (0, import_jsx_runtime214.jsx)(import_components109.Spinner, {}) }); } if (elements2.length === 0) { return /* @__PURE__ */ (0, import_jsx_runtime214.jsx)("div", { className: "dataviews-filters__search-widget-no-elements", children: (0, import_i18n104.__)("No elements found") }); } const Widget = elements2.length > 10 ? ComboboxList22 : ListBox; return /* @__PURE__ */ (0, import_jsx_runtime214.jsx)(Widget, { ...props, filter: { ...props.filter, elements: elements2 } }); } // packages/dataviews/build-module/components/dataviews-filters/input-widget.mjs var import_es62 = __toESM(require_es6(), 1); var import_compose20 = __toESM(require_compose(), 1); var import_element91 = __toESM(require_element(), 1); var import_components110 = __toESM(require_components(), 1); var import_jsx_runtime215 = __toESM(require_jsx_runtime(), 1); function InputWidget({ filter, view, onChangeView, fields }) { const currentFilter = view.filters?.find( (f2) => f2.field === filter.field ); const currentValue = getCurrentValue(filter, currentFilter); const field = (0, import_element91.useMemo)(() => { const currentField = fields.find((f2) => f2.id === filter.field); if (currentField) { return { ...currentField, // Deactivate validation for filters. isValid: {}, // Configure getValue/setValue as if Item was a plain object. getValue: ({ item }) => item[currentField.id], setValue: ({ value }) => ({ [currentField.id]: value }) }; } return currentField; }, [fields, filter.field]); const data = (0, import_element91.useMemo)(() => { return (view.filters ?? []).reduce( (acc, activeFilter) => { acc[activeFilter.field] = activeFilter.value; return acc; }, {} ); }, [view.filters]); const handleChange = (0, import_compose20.useEvent)((updatedData) => { if (!field || !currentFilter) { return; } const nextValue = field.getValue({ item: updatedData }); if ((0, import_es62.default)(nextValue, currentValue)) { return; } onChangeView({ ...view, filters: (view.filters ?? []).map( (_filter) => _filter.field === filter.field ? { ..._filter, operator: currentFilter.operator || filter.operators[0], // Consider empty strings as undefined: // // - undefined as value means the filter is unset: the filter widget displays no value and the search returns all records // - empty string as value means "search empty string": returns only the records that have an empty string as value // // In practice, this means the filter will not be able to find an empty string as the value. value: nextValue === "" ? void 0 : nextValue } : _filter ) }); }); if (!field || !field.Edit || !currentFilter) { return null; } return /* @__PURE__ */ (0, import_jsx_runtime215.jsx)( import_components110.Flex, { className: "dataviews-filters__user-input-widget", gap: 2.5, direction: "column", children: /* @__PURE__ */ (0, import_jsx_runtime215.jsx)( field.Edit, { hideLabelFromVision: true, data, field, operator: currentFilter.operator, onChange: handleChange } ) } ); } // packages/dataviews/node_modules/date-fns/constants.js var daysInYear = 365.2425; var maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1e3; var minTime = -maxTime; var millisecondsInWeek = 6048e5; var millisecondsInDay = 864e5; var secondsInHour = 3600; var secondsInDay = secondsInHour * 24; var secondsInWeek = secondsInDay * 7; var secondsInYear = secondsInDay * daysInYear; var secondsInMonth = secondsInYear / 12; var secondsInQuarter = secondsInMonth * 3; var constructFromSymbol = /* @__PURE__ */ Symbol.for("constructDateFrom"); // packages/dataviews/node_modules/date-fns/constructFrom.js function constructFrom(date, value) { if (typeof date === "function") return date(value); if (date && typeof date === "object" && constructFromSymbol in date) return date[constructFromSymbol](value); if (date instanceof Date) return new date.constructor(value); return new Date(value); } // packages/dataviews/node_modules/date-fns/toDate.js function toDate(argument, context) { return constructFrom(context || argument, argument); } // packages/dataviews/node_modules/date-fns/addDays.js function addDays(date, amount, options) { const _date = toDate(date, options?.in); if (isNaN(amount)) return constructFrom(options?.in || date, NaN); if (!amount) return _date; _date.setDate(_date.getDate() + amount); return _date; } // packages/dataviews/node_modules/date-fns/addMonths.js function addMonths(date, amount, options) { const _date = toDate(date, options?.in); if (isNaN(amount)) return constructFrom(options?.in || date, NaN); if (!amount) { return _date; } const dayOfMonth = _date.getDate(); const endOfDesiredMonth = constructFrom(options?.in || date, _date.getTime()); endOfDesiredMonth.setMonth(_date.getMonth() + amount + 1, 0); const daysInMonth = endOfDesiredMonth.getDate(); if (dayOfMonth >= daysInMonth) { return endOfDesiredMonth; } else { _date.setFullYear( endOfDesiredMonth.getFullYear(), endOfDesiredMonth.getMonth(), dayOfMonth ); return _date; } } // packages/dataviews/node_modules/date-fns/_lib/defaultOptions.js var defaultOptions = {}; function getDefaultOptions() { return defaultOptions; } // packages/dataviews/node_modules/date-fns/startOfWeek.js function startOfWeek(date, options) { const defaultOptions2 = getDefaultOptions(); const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions2.weekStartsOn ?? defaultOptions2.locale?.options?.weekStartsOn ?? 0; const _date = toDate(date, options?.in); const day = _date.getDay(); const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn; _date.setDate(_date.getDate() - diff); _date.setHours(0, 0, 0, 0); return _date; } // packages/dataviews/node_modules/date-fns/startOfISOWeek.js function startOfISOWeek(date, options) { return startOfWeek(date, { ...options, weekStartsOn: 1 }); } // packages/dataviews/node_modules/date-fns/getISOWeekYear.js function getISOWeekYear(date, options) { const _date = toDate(date, options?.in); const year = _date.getFullYear(); const fourthOfJanuaryOfNextYear = constructFrom(_date, 0); fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4); fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0); const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear); const fourthOfJanuaryOfThisYear = constructFrom(_date, 0); fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4); fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0); const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear); if (_date.getTime() >= startOfNextYear.getTime()) { return year + 1; } else if (_date.getTime() >= startOfThisYear.getTime()) { return year; } else { return year - 1; } } // packages/dataviews/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js function getTimezoneOffsetInMilliseconds(date) { const _date = toDate(date); const utcDate = new Date( Date.UTC( _date.getFullYear(), _date.getMonth(), _date.getDate(), _date.getHours(), _date.getMinutes(), _date.getSeconds(), _date.getMilliseconds() ) ); utcDate.setUTCFullYear(_date.getFullYear()); return +date - +utcDate; } // packages/dataviews/node_modules/date-fns/_lib/normalizeDates.js function normalizeDates(context, ...dates) { const normalize = constructFrom.bind( null, context || dates.find((date) => typeof date === "object") ); return dates.map(normalize); } // packages/dataviews/node_modules/date-fns/startOfDay.js function startOfDay(date, options) { const _date = toDate(date, options?.in); _date.setHours(0, 0, 0, 0); return _date; } // packages/dataviews/node_modules/date-fns/differenceInCalendarDays.js function differenceInCalendarDays(laterDate, earlierDate, options) { const [laterDate_, earlierDate_] = normalizeDates( options?.in, laterDate, earlierDate ); const laterStartOfDay = startOfDay(laterDate_); const earlierStartOfDay = startOfDay(earlierDate_); const laterTimestamp = +laterStartOfDay - getTimezoneOffsetInMilliseconds(laterStartOfDay); const earlierTimestamp = +earlierStartOfDay - getTimezoneOffsetInMilliseconds(earlierStartOfDay); return Math.round((laterTimestamp - earlierTimestamp) / millisecondsInDay); } // packages/dataviews/node_modules/date-fns/startOfISOWeekYear.js function startOfISOWeekYear(date, options) { const year = getISOWeekYear(date, options); const fourthOfJanuary = constructFrom(options?.in || date, 0); fourthOfJanuary.setFullYear(year, 0, 4); fourthOfJanuary.setHours(0, 0, 0, 0); return startOfISOWeek(fourthOfJanuary); } // packages/dataviews/node_modules/date-fns/addWeeks.js function addWeeks(date, amount, options) { return addDays(date, amount * 7, options); } // packages/dataviews/node_modules/date-fns/addYears.js function addYears(date, amount, options) { return addMonths(date, amount * 12, options); } // packages/dataviews/node_modules/date-fns/isDate.js function isDate(value) { return value instanceof Date || typeof value === "object" && Object.prototype.toString.call(value) === "[object Date]"; } // packages/dataviews/node_modules/date-fns/isValid.js function isValid(date) { return !(!isDate(date) && typeof date !== "number" || isNaN(+toDate(date))); } // packages/dataviews/node_modules/date-fns/startOfMonth.js function startOfMonth(date, options) { const _date = toDate(date, options?.in); _date.setDate(1); _date.setHours(0, 0, 0, 0); return _date; } // packages/dataviews/node_modules/date-fns/startOfYear.js function startOfYear(date, options) { const date_ = toDate(date, options?.in); date_.setFullYear(date_.getFullYear(), 0, 1); date_.setHours(0, 0, 0, 0); return date_; } // packages/dataviews/node_modules/date-fns/locale/en-US/_lib/formatDistance.js var formatDistanceLocale = { lessThanXSeconds: { one: "less than a second", other: "less than {{count}} seconds" }, xSeconds: { one: "1 second", other: "{{count}} seconds" }, halfAMinute: "half a minute", lessThanXMinutes: { one: "less than a minute", other: "less than {{count}} minutes" }, xMinutes: { one: "1 minute", other: "{{count}} minutes" }, aboutXHours: { one: "about 1 hour", other: "about {{count}} hours" }, xHours: { one: "1 hour", other: "{{count}} hours" }, xDays: { one: "1 day", other: "{{count}} days" }, aboutXWeeks: { one: "about 1 week", other: "about {{count}} weeks" }, xWeeks: { one: "1 week", other: "{{count}} weeks" }, aboutXMonths: { one: "about 1 month", other: "about {{count}} months" }, xMonths: { one: "1 month", other: "{{count}} months" }, aboutXYears: { one: "about 1 year", other: "about {{count}} years" }, xYears: { one: "1 year", other: "{{count}} years" }, overXYears: { one: "over 1 year", other: "over {{count}} years" }, almostXYears: { one: "almost 1 year", other: "almost {{count}} years" } }; var formatDistance = (token, count, options) => { let result; const tokenValue = formatDistanceLocale[token]; if (typeof tokenValue === "string") { result = tokenValue; } else if (count === 1) { result = tokenValue.one; } else { result = tokenValue.other.replace("{{count}}", count.toString()); } if (options?.addSuffix) { if (options.comparison && options.comparison > 0) { return "in " + result; } else { return result + " ago"; } } return result; }; // packages/dataviews/node_modules/date-fns/locale/_lib/buildFormatLongFn.js function buildFormatLongFn(args) { return (options = {}) => { const width = options.width ? String(options.width) : args.defaultWidth; const format6 = args.formats[width] || args.formats[args.defaultWidth]; return format6; }; } // packages/dataviews/node_modules/date-fns/locale/en-US/_lib/formatLong.js var dateFormats = { full: "EEEE, MMMM do, y", long: "MMMM do, y", medium: "MMM d, y", short: "MM/dd/yyyy" }; var timeFormats = { full: "h:mm:ss a zzzz", long: "h:mm:ss a z", medium: "h:mm:ss a", short: "h:mm a" }; var dateTimeFormats = { full: "{{date}} 'at' {{time}}", long: "{{date}} 'at' {{time}}", medium: "{{date}}, {{time}}", short: "{{date}}, {{time}}" }; var formatLong = { date: buildFormatLongFn({ formats: dateFormats, defaultWidth: "full" }), time: buildFormatLongFn({ formats: timeFormats, defaultWidth: "full" }), dateTime: buildFormatLongFn({ formats: dateTimeFormats, defaultWidth: "full" }) }; // packages/dataviews/node_modules/date-fns/locale/en-US/_lib/formatRelative.js var formatRelativeLocale = { lastWeek: "'last' eeee 'at' p", yesterday: "'yesterday at' p", today: "'today at' p", tomorrow: "'tomorrow at' p", nextWeek: "eeee 'at' p", other: "P" }; var formatRelative = (token, _date, _baseDate, _options) => formatRelativeLocale[token]; // packages/dataviews/node_modules/date-fns/locale/_lib/buildLocalizeFn.js function buildLocalizeFn(args) { return (value, options) => { const context = options?.context ? String(options.context) : "standalone"; let valuesArray; if (context === "formatting" && args.formattingValues) { const defaultWidth = args.defaultFormattingWidth || args.defaultWidth; const width = options?.width ? String(options.width) : defaultWidth; valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth]; } else { const defaultWidth = args.defaultWidth; const width = options?.width ? String(options.width) : args.defaultWidth; valuesArray = args.values[width] || args.values[defaultWidth]; } const index = args.argumentCallback ? args.argumentCallback(value) : value; return valuesArray[index]; }; } // packages/dataviews/node_modules/date-fns/locale/en-US/_lib/localize.js var eraValues = { narrow: ["B", "A"], abbreviated: ["BC", "AD"], wide: ["Before Christ", "Anno Domini"] }; var quarterValues = { narrow: ["1", "2", "3", "4"], abbreviated: ["Q1", "Q2", "Q3", "Q4"], wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"] }; var monthValues = { narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"], abbreviated: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ], wide: [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ] }; var dayValues = { narrow: ["S", "M", "T", "W", "T", "F", "S"], short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], wide: [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ] }; var dayPeriodValues = { narrow: { am: "a", pm: "p", midnight: "mi", noon: "n", morning: "morning", afternoon: "afternoon", evening: "evening", night: "night" }, abbreviated: { am: "AM", pm: "PM", midnight: "midnight", noon: "noon", morning: "morning", afternoon: "afternoon", evening: "evening", night: "night" }, wide: { am: "a.m.", pm: "p.m.", midnight: "midnight", noon: "noon", morning: "morning", afternoon: "afternoon", evening: "evening", night: "night" } }; var formattingDayPeriodValues = { narrow: { am: "a", pm: "p", midnight: "mi", noon: "n", morning: "in the morning", afternoon: "in the afternoon", evening: "in the evening", night: "at night" }, abbreviated: { am: "AM", pm: "PM", midnight: "midnight", noon: "noon", morning: "in the morning", afternoon: "in the afternoon", evening: "in the evening", night: "at night" }, wide: { am: "a.m.", pm: "p.m.", midnight: "midnight", noon: "noon", morning: "in the morning", afternoon: "in the afternoon", evening: "in the evening", night: "at night" } }; var ordinalNumber = (dirtyNumber, _options) => { const number = Number(dirtyNumber); const rem100 = number % 100; if (rem100 > 20 || rem100 < 10) { switch (rem100 % 10) { case 1: return number + "st"; case 2: return number + "nd"; case 3: return number + "rd"; } } return number + "th"; }; var localize = { ordinalNumber, era: buildLocalizeFn({ values: eraValues, defaultWidth: "wide" }), quarter: buildLocalizeFn({ values: quarterValues, defaultWidth: "wide", argumentCallback: (quarter) => quarter - 1 }), month: buildLocalizeFn({ values: monthValues, defaultWidth: "wide" }), day: buildLocalizeFn({ values: dayValues, defaultWidth: "wide" }), dayPeriod: buildLocalizeFn({ values: dayPeriodValues, defaultWidth: "wide", formattingValues: formattingDayPeriodValues, defaultFormattingWidth: "wide" }) }; // packages/dataviews/node_modules/date-fns/locale/_lib/buildMatchFn.js function buildMatchFn(args) { return (string, options = {}) => { const width = options.width; const matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth]; const matchResult = string.match(matchPattern); if (!matchResult) { return null; } const matchedString = matchResult[0]; const parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth]; const key = Array.isArray(parsePatterns) ? findIndex2(parsePatterns, (pattern) => pattern.test(matchedString)) : ( // [TODO] -- I challenge you to fix the type findKey(parsePatterns, (pattern) => pattern.test(matchedString)) ); let value; value = args.valueCallback ? args.valueCallback(key) : key; value = options.valueCallback ? ( // [TODO] -- I challenge you to fix the type options.valueCallback(value) ) : value; const rest = string.slice(matchedString.length); return { value, rest }; }; } function findKey(object, predicate) { for (const key in object) { if (Object.prototype.hasOwnProperty.call(object, key) && predicate(object[key])) { return key; } } return void 0; } function findIndex2(array, predicate) { for (let key = 0; key < array.length; key++) { if (predicate(array[key])) { return key; } } return void 0; } // packages/dataviews/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js function buildMatchPatternFn(args) { return (string, options = {}) => { const matchResult = string.match(args.matchPattern); if (!matchResult) return null; const matchedString = matchResult[0]; const parseResult = string.match(args.parsePattern); if (!parseResult) return null; let value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0]; value = options.valueCallback ? options.valueCallback(value) : value; const rest = string.slice(matchedString.length); return { value, rest }; }; } // packages/dataviews/node_modules/date-fns/locale/en-US/_lib/match.js var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i; var parseOrdinalNumberPattern = /\d+/i; var matchEraPatterns = { narrow: /^(b|a)/i, abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i, wide: /^(before christ|before common era|anno domini|common era)/i }; var parseEraPatterns = { any: [/^b/i, /^(a|c)/i] }; var matchQuarterPatterns = { narrow: /^[1234]/i, abbreviated: /^q[1234]/i, wide: /^[1234](th|st|nd|rd)? quarter/i }; var parseQuarterPatterns = { any: [/1/i, /2/i, /3/i, /4/i] }; var matchMonthPatterns = { narrow: /^[jfmasond]/i, abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i, wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i }; var parseMonthPatterns = { narrow: [ /^j/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i ], any: [ /^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i ] }; var matchDayPatterns = { narrow: /^[smtwf]/i, short: /^(su|mo|tu|we|th|fr|sa)/i, abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i, wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i }; var parseDayPatterns = { narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i], any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i] }; var matchDayPeriodPatterns = { narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i, any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i }; var parseDayPeriodPatterns = { any: { am: /^a/i, pm: /^p/i, midnight: /^mi/i, noon: /^no/i, morning: /morning/i, afternoon: /afternoon/i, evening: /evening/i, night: /night/i } }; var match2 = { ordinalNumber: buildMatchPatternFn({ matchPattern: matchOrdinalNumberPattern, parsePattern: parseOrdinalNumberPattern, valueCallback: (value) => parseInt(value, 10) }), era: buildMatchFn({ matchPatterns: matchEraPatterns, defaultMatchWidth: "wide", parsePatterns: parseEraPatterns, defaultParseWidth: "any" }), quarter: buildMatchFn({ matchPatterns: matchQuarterPatterns, defaultMatchWidth: "wide", parsePatterns: parseQuarterPatterns, defaultParseWidth: "any", valueCallback: (index) => index + 1 }), month: buildMatchFn({ matchPatterns: matchMonthPatterns, defaultMatchWidth: "wide", parsePatterns: parseMonthPatterns, defaultParseWidth: "any" }), day: buildMatchFn({ matchPatterns: matchDayPatterns, defaultMatchWidth: "wide", parsePatterns: parseDayPatterns, defaultParseWidth: "any" }), dayPeriod: buildMatchFn({ matchPatterns: matchDayPeriodPatterns, defaultMatchWidth: "any", parsePatterns: parseDayPeriodPatterns, defaultParseWidth: "any" }) }; // packages/dataviews/node_modules/date-fns/locale/en-US.js var enUS = { code: "en-US", formatDistance, formatLong, formatRelative, localize, match: match2, options: { weekStartsOn: 0, firstWeekContainsDate: 1 } }; // packages/dataviews/node_modules/date-fns/getDayOfYear.js function getDayOfYear(date, options) { const _date = toDate(date, options?.in); const diff = differenceInCalendarDays(_date, startOfYear(_date)); const dayOfYear = diff + 1; return dayOfYear; } // packages/dataviews/node_modules/date-fns/getISOWeek.js function getISOWeek(date, options) { const _date = toDate(date, options?.in); const diff = +startOfISOWeek(_date) - +startOfISOWeekYear(_date); return Math.round(diff / millisecondsInWeek) + 1; } // packages/dataviews/node_modules/date-fns/getWeekYear.js function getWeekYear(date, options) { const _date = toDate(date, options?.in); const year = _date.getFullYear(); const defaultOptions2 = getDefaultOptions(); const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions2.firstWeekContainsDate ?? defaultOptions2.locale?.options?.firstWeekContainsDate ?? 1; const firstWeekOfNextYear = constructFrom(options?.in || date, 0); firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate); firstWeekOfNextYear.setHours(0, 0, 0, 0); const startOfNextYear = startOfWeek(firstWeekOfNextYear, options); const firstWeekOfThisYear = constructFrom(options?.in || date, 0); firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate); firstWeekOfThisYear.setHours(0, 0, 0, 0); const startOfThisYear = startOfWeek(firstWeekOfThisYear, options); if (+_date >= +startOfNextYear) { return year + 1; } else if (+_date >= +startOfThisYear) { return year; } else { return year - 1; } } // packages/dataviews/node_modules/date-fns/startOfWeekYear.js function startOfWeekYear(date, options) { const defaultOptions2 = getDefaultOptions(); const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions2.firstWeekContainsDate ?? defaultOptions2.locale?.options?.firstWeekContainsDate ?? 1; const year = getWeekYear(date, options); const firstWeek = constructFrom(options?.in || date, 0); firstWeek.setFullYear(year, 0, firstWeekContainsDate); firstWeek.setHours(0, 0, 0, 0); const _date = startOfWeek(firstWeek, options); return _date; } // packages/dataviews/node_modules/date-fns/getWeek.js function getWeek(date, options) { const _date = toDate(date, options?.in); const diff = +startOfWeek(_date, options) - +startOfWeekYear(_date, options); return Math.round(diff / millisecondsInWeek) + 1; } // packages/dataviews/node_modules/date-fns/_lib/addLeadingZeros.js function addLeadingZeros(number, targetLength) { const sign = number < 0 ? "-" : ""; const output = Math.abs(number).toString().padStart(targetLength, "0"); return sign + output; } // packages/dataviews/node_modules/date-fns/_lib/format/lightFormatters.js var lightFormatters = { // Year y(date, token) { const signedYear = date.getFullYear(); const year = signedYear > 0 ? signedYear : 1 - signedYear; return addLeadingZeros(token === "yy" ? year % 100 : year, token.length); }, // Month M(date, token) { const month = date.getMonth(); return token === "M" ? String(month + 1) : addLeadingZeros(month + 1, 2); }, // Day of the month d(date, token) { return addLeadingZeros(date.getDate(), token.length); }, // AM or PM a(date, token) { const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? "pm" : "am"; switch (token) { case "a": case "aa": return dayPeriodEnumValue.toUpperCase(); case "aaa": return dayPeriodEnumValue; case "aaaaa": return dayPeriodEnumValue[0]; case "aaaa": default: return dayPeriodEnumValue === "am" ? "a.m." : "p.m."; } }, // Hour [1-12] h(date, token) { return addLeadingZeros(date.getHours() % 12 || 12, token.length); }, // Hour [0-23] H(date, token) { return addLeadingZeros(date.getHours(), token.length); }, // Minute m(date, token) { return addLeadingZeros(date.getMinutes(), token.length); }, // Second s(date, token) { return addLeadingZeros(date.getSeconds(), token.length); }, // Fraction of second S(date, token) { const numberOfDigits = token.length; const milliseconds = date.getMilliseconds(); const fractionalSeconds = Math.trunc( milliseconds * Math.pow(10, numberOfDigits - 3) ); return addLeadingZeros(fractionalSeconds, token.length); } }; // packages/dataviews/node_modules/date-fns/_lib/format/formatters.js var dayPeriodEnum = { am: "am", pm: "pm", midnight: "midnight", noon: "noon", morning: "morning", afternoon: "afternoon", evening: "evening", night: "night" }; var formatters = { // Era G: function(date, token, localize2) { const era = date.getFullYear() > 0 ? 1 : 0; switch (token) { // AD, BC case "G": case "GG": case "GGG": return localize2.era(era, { width: "abbreviated" }); // A, B case "GGGGG": return localize2.era(era, { width: "narrow" }); // Anno Domini, Before Christ case "GGGG": default: return localize2.era(era, { width: "wide" }); } }, // Year y: function(date, token, localize2) { if (token === "yo") { const signedYear = date.getFullYear(); const year = signedYear > 0 ? signedYear : 1 - signedYear; return localize2.ordinalNumber(year, { unit: "year" }); } return lightFormatters.y(date, token); }, // Local week-numbering year Y: function(date, token, localize2, options) { const signedWeekYear = getWeekYear(date, options); const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear; if (token === "YY") { const twoDigitYear = weekYear % 100; return addLeadingZeros(twoDigitYear, 2); } if (token === "Yo") { return localize2.ordinalNumber(weekYear, { unit: "year" }); } return addLeadingZeros(weekYear, token.length); }, // ISO week-numbering year R: function(date, token) { const isoWeekYear = getISOWeekYear(date); return addLeadingZeros(isoWeekYear, token.length); }, // Extended year. This is a single number designating the year of this calendar system. // The main difference between `y` and `u` localizers are B.C. years: // | Year | `y` | `u` | // |------|-----|-----| // | AC 1 | 1 | 1 | // | BC 1 | 1 | 0 | // | BC 2 | 2 | -1 | // Also `yy` always returns the last two digits of a year, // while `uu` pads single digit years to 2 characters and returns other years unchanged. u: function(date, token) { const year = date.getFullYear(); return addLeadingZeros(year, token.length); }, // Quarter Q: function(date, token, localize2) { const quarter = Math.ceil((date.getMonth() + 1) / 3); switch (token) { // 1, 2, 3, 4 case "Q": return String(quarter); // 01, 02, 03, 04 case "QQ": return addLeadingZeros(quarter, 2); // 1st, 2nd, 3rd, 4th case "Qo": return localize2.ordinalNumber(quarter, { unit: "quarter" }); // Q1, Q2, Q3, Q4 case "QQQ": return localize2.quarter(quarter, { width: "abbreviated", context: "formatting" }); // 1, 2, 3, 4 (narrow quarter; could be not numerical) case "QQQQQ": return localize2.quarter(quarter, { width: "narrow", context: "formatting" }); // 1st quarter, 2nd quarter, ... case "QQQQ": default: return localize2.quarter(quarter, { width: "wide", context: "formatting" }); } }, // Stand-alone quarter q: function(date, token, localize2) { const quarter = Math.ceil((date.getMonth() + 1) / 3); switch (token) { // 1, 2, 3, 4 case "q": return String(quarter); // 01, 02, 03, 04 case "qq": return addLeadingZeros(quarter, 2); // 1st, 2nd, 3rd, 4th case "qo": return localize2.ordinalNumber(quarter, { unit: "quarter" }); // Q1, Q2, Q3, Q4 case "qqq": return localize2.quarter(quarter, { width: "abbreviated", context: "standalone" }); // 1, 2, 3, 4 (narrow quarter; could be not numerical) case "qqqqq": return localize2.quarter(quarter, { width: "narrow", context: "standalone" }); // 1st quarter, 2nd quarter, ... case "qqqq": default: return localize2.quarter(quarter, { width: "wide", context: "standalone" }); } }, // Month M: function(date, token, localize2) { const month = date.getMonth(); switch (token) { case "M": case "MM": return lightFormatters.M(date, token); // 1st, 2nd, ..., 12th case "Mo": return localize2.ordinalNumber(month + 1, { unit: "month" }); // Jan, Feb, ..., Dec case "MMM": return localize2.month(month, { width: "abbreviated", context: "formatting" }); // J, F, ..., D case "MMMMM": return localize2.month(month, { width: "narrow", context: "formatting" }); // January, February, ..., December case "MMMM": default: return localize2.month(month, { width: "wide", context: "formatting" }); } }, // Stand-alone month L: function(date, token, localize2) { const month = date.getMonth(); switch (token) { // 1, 2, ..., 12 case "L": return String(month + 1); // 01, 02, ..., 12 case "LL": return addLeadingZeros(month + 1, 2); // 1st, 2nd, ..., 12th case "Lo": return localize2.ordinalNumber(month + 1, { unit: "month" }); // Jan, Feb, ..., Dec case "LLL": return localize2.month(month, { width: "abbreviated", context: "standalone" }); // J, F, ..., D case "LLLLL": return localize2.month(month, { width: "narrow", context: "standalone" }); // January, February, ..., December case "LLLL": default: return localize2.month(month, { width: "wide", context: "standalone" }); } }, // Local week of year w: function(date, token, localize2, options) { const week = getWeek(date, options); if (token === "wo") { return localize2.ordinalNumber(week, { unit: "week" }); } return addLeadingZeros(week, token.length); }, // ISO week of year I: function(date, token, localize2) { const isoWeek = getISOWeek(date); if (token === "Io") { return localize2.ordinalNumber(isoWeek, { unit: "week" }); } return addLeadingZeros(isoWeek, token.length); }, // Day of the month d: function(date, token, localize2) { if (token === "do") { return localize2.ordinalNumber(date.getDate(), { unit: "date" }); } return lightFormatters.d(date, token); }, // Day of year D: function(date, token, localize2) { const dayOfYear = getDayOfYear(date); if (token === "Do") { return localize2.ordinalNumber(dayOfYear, { unit: "dayOfYear" }); } return addLeadingZeros(dayOfYear, token.length); }, // Day of week E: function(date, token, localize2) { const dayOfWeek = date.getDay(); switch (token) { // Tue case "E": case "EE": case "EEE": return localize2.day(dayOfWeek, { width: "abbreviated", context: "formatting" }); // T case "EEEEE": return localize2.day(dayOfWeek, { width: "narrow", context: "formatting" }); // Tu case "EEEEEE": return localize2.day(dayOfWeek, { width: "short", context: "formatting" }); // Tuesday case "EEEE": default: return localize2.day(dayOfWeek, { width: "wide", context: "formatting" }); } }, // Local day of week e: function(date, token, localize2, options) { const dayOfWeek = date.getDay(); const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7; switch (token) { // Numerical value (Nth day of week with current locale or weekStartsOn) case "e": return String(localDayOfWeek); // Padded numerical value case "ee": return addLeadingZeros(localDayOfWeek, 2); // 1st, 2nd, ..., 7th case "eo": return localize2.ordinalNumber(localDayOfWeek, { unit: "day" }); case "eee": return localize2.day(dayOfWeek, { width: "abbreviated", context: "formatting" }); // T case "eeeee": return localize2.day(dayOfWeek, { width: "narrow", context: "formatting" }); // Tu case "eeeeee": return localize2.day(dayOfWeek, { width: "short", context: "formatting" }); // Tuesday case "eeee": default: return localize2.day(dayOfWeek, { width: "wide", context: "formatting" }); } }, // Stand-alone local day of week c: function(date, token, localize2, options) { const dayOfWeek = date.getDay(); const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7; switch (token) { // Numerical value (same as in `e`) case "c": return String(localDayOfWeek); // Padded numerical value case "cc": return addLeadingZeros(localDayOfWeek, token.length); // 1st, 2nd, ..., 7th case "co": return localize2.ordinalNumber(localDayOfWeek, { unit: "day" }); case "ccc": return localize2.day(dayOfWeek, { width: "abbreviated", context: "standalone" }); // T case "ccccc": return localize2.day(dayOfWeek, { width: "narrow", context: "standalone" }); // Tu case "cccccc": return localize2.day(dayOfWeek, { width: "short", context: "standalone" }); // Tuesday case "cccc": default: return localize2.day(dayOfWeek, { width: "wide", context: "standalone" }); } }, // ISO day of week i: function(date, token, localize2) { const dayOfWeek = date.getDay(); const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek; switch (token) { // 2 case "i": return String(isoDayOfWeek); // 02 case "ii": return addLeadingZeros(isoDayOfWeek, token.length); // 2nd case "io": return localize2.ordinalNumber(isoDayOfWeek, { unit: "day" }); // Tue case "iii": return localize2.day(dayOfWeek, { width: "abbreviated", context: "formatting" }); // T case "iiiii": return localize2.day(dayOfWeek, { width: "narrow", context: "formatting" }); // Tu case "iiiiii": return localize2.day(dayOfWeek, { width: "short", context: "formatting" }); // Tuesday case "iiii": default: return localize2.day(dayOfWeek, { width: "wide", context: "formatting" }); } }, // AM or PM a: function(date, token, localize2) { const hours = date.getHours(); const dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am"; switch (token) { case "a": case "aa": return localize2.dayPeriod(dayPeriodEnumValue, { width: "abbreviated", context: "formatting" }); case "aaa": return localize2.dayPeriod(dayPeriodEnumValue, { width: "abbreviated", context: "formatting" }).toLowerCase(); case "aaaaa": return localize2.dayPeriod(dayPeriodEnumValue, { width: "narrow", context: "formatting" }); case "aaaa": default: return localize2.dayPeriod(dayPeriodEnumValue, { width: "wide", context: "formatting" }); } }, // AM, PM, midnight, noon b: function(date, token, localize2) { const hours = date.getHours(); let dayPeriodEnumValue; if (hours === 12) { dayPeriodEnumValue = dayPeriodEnum.noon; } else if (hours === 0) { dayPeriodEnumValue = dayPeriodEnum.midnight; } else { dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am"; } switch (token) { case "b": case "bb": return localize2.dayPeriod(dayPeriodEnumValue, { width: "abbreviated", context: "formatting" }); case "bbb": return localize2.dayPeriod(dayPeriodEnumValue, { width: "abbreviated", context: "formatting" }).toLowerCase(); case "bbbbb": return localize2.dayPeriod(dayPeriodEnumValue, { width: "narrow", context: "formatting" }); case "bbbb": default: return localize2.dayPeriod(dayPeriodEnumValue, { width: "wide", context: "formatting" }); } }, // in the morning, in the afternoon, in the evening, at night B: function(date, token, localize2) { const hours = date.getHours(); let dayPeriodEnumValue; if (hours >= 17) { dayPeriodEnumValue = dayPeriodEnum.evening; } else if (hours >= 12) { dayPeriodEnumValue = dayPeriodEnum.afternoon; } else if (hours >= 4) { dayPeriodEnumValue = dayPeriodEnum.morning; } else { dayPeriodEnumValue = dayPeriodEnum.night; } switch (token) { case "B": case "BB": case "BBB": return localize2.dayPeriod(dayPeriodEnumValue, { width: "abbreviated", context: "formatting" }); case "BBBBB": return localize2.dayPeriod(dayPeriodEnumValue, { width: "narrow", context: "formatting" }); case "BBBB": default: return localize2.dayPeriod(dayPeriodEnumValue, { width: "wide", context: "formatting" }); } }, // Hour [1-12] h: function(date, token, localize2) { if (token === "ho") { let hours = date.getHours() % 12; if (hours === 0) hours = 12; return localize2.ordinalNumber(hours, { unit: "hour" }); } return lightFormatters.h(date, token); }, // Hour [0-23] H: function(date, token, localize2) { if (token === "Ho") { return localize2.ordinalNumber(date.getHours(), { unit: "hour" }); } return lightFormatters.H(date, token); }, // Hour [0-11] K: function(date, token, localize2) { const hours = date.getHours() % 12; if (token === "Ko") { return localize2.ordinalNumber(hours, { unit: "hour" }); } return addLeadingZeros(hours, token.length); }, // Hour [1-24] k: function(date, token, localize2) { let hours = date.getHours(); if (hours === 0) hours = 24; if (token === "ko") { return localize2.ordinalNumber(hours, { unit: "hour" }); } return addLeadingZeros(hours, token.length); }, // Minute m: function(date, token, localize2) { if (token === "mo") { return localize2.ordinalNumber(date.getMinutes(), { unit: "minute" }); } return lightFormatters.m(date, token); }, // Second s: function(date, token, localize2) { if (token === "so") { return localize2.ordinalNumber(date.getSeconds(), { unit: "second" }); } return lightFormatters.s(date, token); }, // Fraction of second S: function(date, token) { return lightFormatters.S(date, token); }, // Timezone (ISO-8601. If offset is 0, output is always `'Z'`) X: function(date, token, _localize) { const timezoneOffset = date.getTimezoneOffset(); if (timezoneOffset === 0) { return "Z"; } switch (token) { // Hours and optional minutes case "X": return formatTimezoneWithOptionalMinutes(timezoneOffset); // Hours, minutes and optional seconds without `:` delimiter // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets // so this token always has the same output as `XX` case "XXXX": case "XX": return formatTimezone(timezoneOffset); // Hours, minutes and optional seconds with `:` delimiter // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets // so this token always has the same output as `XXX` case "XXXXX": case "XXX": // Hours and minutes with `:` delimiter default: return formatTimezone(timezoneOffset, ":"); } }, // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent) x: function(date, token, _localize) { const timezoneOffset = date.getTimezoneOffset(); switch (token) { // Hours and optional minutes case "x": return formatTimezoneWithOptionalMinutes(timezoneOffset); // Hours, minutes and optional seconds without `:` delimiter // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets // so this token always has the same output as `xx` case "xxxx": case "xx": return formatTimezone(timezoneOffset); // Hours, minutes and optional seconds with `:` delimiter // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets // so this token always has the same output as `xxx` case "xxxxx": case "xxx": // Hours and minutes with `:` delimiter default: return formatTimezone(timezoneOffset, ":"); } }, // Timezone (GMT) O: function(date, token, _localize) { const timezoneOffset = date.getTimezoneOffset(); switch (token) { // Short case "O": case "OO": case "OOO": return "GMT" + formatTimezoneShort(timezoneOffset, ":"); // Long case "OOOO": default: return "GMT" + formatTimezone(timezoneOffset, ":"); } }, // Timezone (specific non-location) z: function(date, token, _localize) { const timezoneOffset = date.getTimezoneOffset(); switch (token) { // Short case "z": case "zz": case "zzz": return "GMT" + formatTimezoneShort(timezoneOffset, ":"); // Long case "zzzz": default: return "GMT" + formatTimezone(timezoneOffset, ":"); } }, // Seconds timestamp t: function(date, token, _localize) { const timestamp = Math.trunc(+date / 1e3); return addLeadingZeros(timestamp, token.length); }, // Milliseconds timestamp T: function(date, token, _localize) { return addLeadingZeros(+date, token.length); } }; function formatTimezoneShort(offset, delimiter = "") { const sign = offset > 0 ? "-" : "+"; const absOffset = Math.abs(offset); const hours = Math.trunc(absOffset / 60); const minutes = absOffset % 60; if (minutes === 0) { return sign + String(hours); } return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2); } function formatTimezoneWithOptionalMinutes(offset, delimiter) { if (offset % 60 === 0) { const sign = offset > 0 ? "-" : "+"; return sign + addLeadingZeros(Math.abs(offset) / 60, 2); } return formatTimezone(offset, delimiter); } function formatTimezone(offset, delimiter = "") { const sign = offset > 0 ? "-" : "+"; const absOffset = Math.abs(offset); const hours = addLeadingZeros(Math.trunc(absOffset / 60), 2); const minutes = addLeadingZeros(absOffset % 60, 2); return sign + hours + delimiter + minutes; } // packages/dataviews/node_modules/date-fns/_lib/format/longFormatters.js var dateLongFormatter = (pattern, formatLong2) => { switch (pattern) { case "P": return formatLong2.date({ width: "short" }); case "PP": return formatLong2.date({ width: "medium" }); case "PPP": return formatLong2.date({ width: "long" }); case "PPPP": default: return formatLong2.date({ width: "full" }); } }; var timeLongFormatter = (pattern, formatLong2) => { switch (pattern) { case "p": return formatLong2.time({ width: "short" }); case "pp": return formatLong2.time({ width: "medium" }); case "ppp": return formatLong2.time({ width: "long" }); case "pppp": default: return formatLong2.time({ width: "full" }); } }; var dateTimeLongFormatter = (pattern, formatLong2) => { const matchResult = pattern.match(/(P+)(p+)?/) || []; const datePattern = matchResult[1]; const timePattern = matchResult[2]; if (!timePattern) { return dateLongFormatter(pattern, formatLong2); } let dateTimeFormat; switch (datePattern) { case "P": dateTimeFormat = formatLong2.dateTime({ width: "short" }); break; case "PP": dateTimeFormat = formatLong2.dateTime({ width: "medium" }); break; case "PPP": dateTimeFormat = formatLong2.dateTime({ width: "long" }); break; case "PPPP": default: dateTimeFormat = formatLong2.dateTime({ width: "full" }); break; } return dateTimeFormat.replace("{{date}}", dateLongFormatter(datePattern, formatLong2)).replace("{{time}}", timeLongFormatter(timePattern, formatLong2)); }; var longFormatters = { p: timeLongFormatter, P: dateTimeLongFormatter }; // packages/dataviews/node_modules/date-fns/_lib/protectedTokens.js var dayOfYearTokenRE = /^D+$/; var weekYearTokenRE = /^Y+$/; var throwTokens = ["D", "DD", "YY", "YYYY"]; function isProtectedDayOfYearToken(token) { return dayOfYearTokenRE.test(token); } function isProtectedWeekYearToken(token) { return weekYearTokenRE.test(token); } function warnOrThrowProtectedError(token, format6, input) { const _message = message(token, format6, input); console.warn(_message); if (throwTokens.includes(token)) throw new RangeError(_message); } function message(token, format6, input) { const subject = token[0] === "Y" ? "years" : "days of the month"; return `Use \`${token.toLowerCase()}\` instead of \`${token}\` (in \`${format6}\`) for formatting ${subject} to the input \`${input}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`; } // packages/dataviews/node_modules/date-fns/format.js var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g; var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g; var escapedStringRegExp = /^'([^]*?)'?$/; var doubleQuoteRegExp = /''/g; var unescapedLatinCharacterRegExp = /[a-zA-Z]/; function format(date, formatStr, options) { const defaultOptions2 = getDefaultOptions(); const locale = options?.locale ?? defaultOptions2.locale ?? enUS; const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions2.firstWeekContainsDate ?? defaultOptions2.locale?.options?.firstWeekContainsDate ?? 1; const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions2.weekStartsOn ?? defaultOptions2.locale?.options?.weekStartsOn ?? 0; const originalDate = toDate(date, options?.in); if (!isValid(originalDate)) { throw new RangeError("Invalid time value"); } let parts = formatStr.match(longFormattingTokensRegExp).map((substring) => { const firstCharacter = substring[0]; if (firstCharacter === "p" || firstCharacter === "P") { const longFormatter = longFormatters[firstCharacter]; return longFormatter(substring, locale.formatLong); } return substring; }).join("").match(formattingTokensRegExp).map((substring) => { if (substring === "''") { return { isToken: false, value: "'" }; } const firstCharacter = substring[0]; if (firstCharacter === "'") { return { isToken: false, value: cleanEscapedString(substring) }; } if (formatters[firstCharacter]) { return { isToken: true, value: substring }; } if (firstCharacter.match(unescapedLatinCharacterRegExp)) { throw new RangeError( "Format string contains an unescaped latin alphabet character `" + firstCharacter + "`" ); } return { isToken: false, value: substring }; }); if (locale.localize.preprocessor) { parts = locale.localize.preprocessor(originalDate, parts); } const formatterOptions = { firstWeekContainsDate, weekStartsOn, locale }; return parts.map((part) => { if (!part.isToken) return part.value; const token = part.value; if (!options?.useAdditionalWeekYearTokens && isProtectedWeekYearToken(token) || !options?.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(token)) { warnOrThrowProtectedError(token, formatStr, String(date)); } const formatter = formatters[token[0]]; return formatter(originalDate, token, locale.localize, formatterOptions); }).join(""); } function cleanEscapedString(input) { const matched = input.match(escapedStringRegExp); if (!matched) { return input; } return matched[1].replace(doubleQuoteRegExp, "'"); } // packages/dataviews/node_modules/date-fns/subDays.js function subDays(date, amount, options) { return addDays(date, -amount, options); } // packages/dataviews/node_modules/date-fns/subMonths.js function subMonths(date, amount, options) { return addMonths(date, -amount, options); } // packages/dataviews/node_modules/date-fns/subWeeks.js function subWeeks(date, amount, options) { return addWeeks(date, -amount, options); } // packages/dataviews/node_modules/date-fns/subYears.js function subYears(date, amount, options) { return addYears(date, -amount, options); } // packages/dataviews/build-module/utils/operators.mjs var import_i18n105 = __toESM(require_i18n(), 1); var import_element92 = __toESM(require_element(), 1); var import_date2 = __toESM(require_date(), 1); var import_jsx_runtime216 = __toESM(require_jsx_runtime(), 1); var filterTextWrappers = { Name: /* @__PURE__ */ (0, import_jsx_runtime216.jsx)("span", { className: "dataviews-filters__summary-filter-text-name" }), Value: /* @__PURE__ */ (0, import_jsx_runtime216.jsx)("span", { className: "dataviews-filters__summary-filter-text-value" }) }; function getRelativeDate(value, unit) { switch (unit) { case "days": return subDays(/* @__PURE__ */ new Date(), value); case "weeks": return subWeeks(/* @__PURE__ */ new Date(), value); case "months": return subMonths(/* @__PURE__ */ new Date(), value); case "years": return subYears(/* @__PURE__ */ new Date(), value); default: return /* @__PURE__ */ new Date(); } } var isNoneOperatorDefinition = { /* translators: DataViews operator name */ label: (0, import_i18n105.__)("Is none of"), filterText: (filter, activeElements) => (0, import_element92.createInterpolateElement)( (0, import_i18n105.sprintf)( /* translators: 1: Filter name (e.g. "Author"). 2: Filter value (e.g. "Admin"): "Author is none of: Admin, Editor". */ (0, import_i18n105.__)("<Name>%1$s is none of: </Name><Value>%2$s</Value>"), filter.name, activeElements.map((element) => element.label).join(", ") ), filterTextWrappers ), filter: ((item, field, filterValue) => { if (!filterValue?.length) { return true; } const fieldValue = field.getValue({ item }); if (Array.isArray(fieldValue)) { return !filterValue.some( (fv) => fieldValue.includes(fv) ); } else if (typeof fieldValue === "string") { return !filterValue.includes(fieldValue); } return false; }), selection: "multi" }; var OPERATORS = [ { name: OPERATOR_IS_ANY2, /* translators: DataViews operator name */ label: (0, import_i18n105.__)("Includes"), filterText: (filter, activeElements) => (0, import_element92.createInterpolateElement)( (0, import_i18n105.sprintf)( /* translators: 1: Filter name (e.g. "Author"). 2: Filter value (e.g. "Admin"): "Author is any: Admin, Editor". */ (0, import_i18n105.__)("<Name>%1$s includes: </Name><Value>%2$s</Value>"), filter.name, activeElements.map((element) => element.label).join(", ") ), filterTextWrappers ), filter(item, field, filterValue) { if (!filterValue?.length) { return true; } const fieldValue = field.getValue({ item }); if (Array.isArray(fieldValue)) { return filterValue.some( (fv) => fieldValue.includes(fv) ); } else if (typeof fieldValue === "string") { return filterValue.includes(fieldValue); } return false; }, selection: "multi" }, { name: OPERATOR_IS_NONE2, ...isNoneOperatorDefinition }, { name: OPERATOR_IS_ALL, /* translators: DataViews operator name */ label: (0, import_i18n105.__)("Includes all"), filterText: (filter, activeElements) => (0, import_element92.createInterpolateElement)( (0, import_i18n105.sprintf)( /* translators: 1: Filter name (e.g. "Author"). 2: Filter value (e.g. "Admin"): "Author includes all: Admin, Editor". */ (0, import_i18n105.__)("<Name>%1$s includes all: </Name><Value>%2$s</Value>"), filter.name, activeElements.map((element) => element.label).join(", ") ), filterTextWrappers ), filter(item, field, filterValue) { if (!filterValue?.length) { return true; } return filterValue.every((value) => { return field.getValue({ item })?.includes(value); }); }, selection: "multi" }, { name: OPERATOR_IS_NOT_ALL, ...isNoneOperatorDefinition }, { name: OPERATOR_BETWEEN, /* translators: DataViews operator name */ label: (0, import_i18n105.__)("Between (inc)"), filterText: (filter, activeElements) => (0, import_element92.createInterpolateElement)( (0, import_i18n105.sprintf)( /* translators: 1: Filter name (e.g. "Item count"). 2: Filter value min. 3: Filter value max. e.g.: "Item count between (inc): 10 and 180". */ (0, import_i18n105.__)( "<Name>%1$s between (inc): </Name><Value>%2$s and %3$s</Value>" ), filter.name, activeElements[0].label[0], activeElements[0].label[1] ), filterTextWrappers ), filter(item, field, filterValue) { if (!Array.isArray(filterValue) || filterValue.length !== 2 || filterValue[0] === void 0 || filterValue[1] === void 0) { return true; } const fieldValue = field.getValue({ item }); if (typeof fieldValue === "number" || fieldValue instanceof Date || typeof fieldValue === "string") { return fieldValue >= filterValue[0] && fieldValue <= filterValue[1]; } return false; }, selection: "custom" }, { name: OPERATOR_IN_THE_PAST, /* translators: DataViews operator name */ label: (0, import_i18n105.__)("In the past"), filterText: (filter, activeElements) => (0, import_element92.createInterpolateElement)( (0, import_i18n105.sprintf)( /* translators: 1: Filter name (e.g. "Date"). 2: Filter value (e.g. "7 days"): "Date is in the past: 7 days". */ (0, import_i18n105.__)( "<Name>%1$s is in the past: </Name><Value>%2$s</Value>" ), filter.name, `${activeElements[0].value.value} ${activeElements[0].value.unit}` ), filterTextWrappers ), filter(item, field, filterValue) { if (filterValue?.value === void 0 || filterValue?.unit === void 0) { return true; } const targetDate = getRelativeDate( filterValue.value, filterValue.unit ); const fieldValue = (0, import_date2.getDate)(field.getValue({ item })); return fieldValue >= targetDate && fieldValue <= /* @__PURE__ */ new Date(); }, selection: "custom" }, { name: OPERATOR_OVER, /* translators: DataViews operator name */ label: (0, import_i18n105.__)("Over"), filterText: (filter, activeElements) => (0, import_element92.createInterpolateElement)( (0, import_i18n105.sprintf)( /* translators: 1: Filter name (e.g. "Date"). 2: Filter value (e.g. "7 days"): "Date is over: 7 days". */ (0, import_i18n105.__)("<Name>%1$s is over: </Name><Value>%2$s</Value>"), filter.name, `${activeElements[0].value.value} ${activeElements[0].value.unit}` ), filterTextWrappers ), filter(item, field, filterValue) { if (filterValue?.value === void 0 || filterValue?.unit === void 0) { return true; } const targetDate = getRelativeDate( filterValue.value, filterValue.unit ); const fieldValue = (0, import_date2.getDate)(field.getValue({ item })); return fieldValue < targetDate; }, selection: "custom" }, { name: OPERATOR_IS2, /* translators: DataViews operator name */ label: (0, import_i18n105.__)("Is"), filterText: (filter, activeElements) => (0, import_element92.createInterpolateElement)( (0, import_i18n105.sprintf)( /* translators: 1: Filter name (e.g. "Author"). 2: Filter value (e.g. "Admin"): "Author is: Admin". */ (0, import_i18n105.__)("<Name>%1$s is: </Name><Value>%2$s</Value>"), filter.name, activeElements[0].label ), filterTextWrappers ), filter(item, field, filterValue) { return filterValue === field.getValue({ item }) || filterValue === void 0; }, selection: "single" }, { name: OPERATOR_IS_NOT, /* translators: DataViews operator name */ label: (0, import_i18n105.__)("Is not"), filterText: (filter, activeElements) => (0, import_element92.createInterpolateElement)( (0, import_i18n105.sprintf)( /* translators: 1: Filter name (e.g. "Author"). 2: Filter value (e.g. "Admin"): "Author is not: Admin". */ (0, import_i18n105.__)("<Name>%1$s is not: </Name><Value>%2$s</Value>"), filter.name, activeElements[0].label ), filterTextWrappers ), filter(item, field, filterValue) { return filterValue !== field.getValue({ item }); }, selection: "single" }, { name: OPERATOR_LESS_THAN, /* translators: DataViews operator name */ label: (0, import_i18n105.__)("Less than"), filterText: (filter, activeElements) => (0, import_element92.createInterpolateElement)( (0, import_i18n105.sprintf)( /* translators: 1: Filter name (e.g. "Count"). 2: Filter value (e.g. "10"): "Count is less than: 10". */ (0, import_i18n105.__)("<Name>%1$s is less than: </Name><Value>%2$s</Value>"), filter.name, activeElements[0].label ), filterTextWrappers ), filter(item, field, filterValue) { if (filterValue === void 0) { return true; } const fieldValue = field.getValue({ item }); return fieldValue < filterValue; }, selection: "single" }, { name: OPERATOR_GREATER_THAN, /* translators: DataViews operator name */ label: (0, import_i18n105.__)("Greater than"), filterText: (filter, activeElements) => (0, import_element92.createInterpolateElement)( (0, import_i18n105.sprintf)( /* translators: 1: Filter name (e.g. "Count"). 2: Filter value (e.g. "10"): "Count is greater than: 10". */ (0, import_i18n105.__)( "<Name>%1$s is greater than: </Name><Value>%2$s</Value>" ), filter.name, activeElements[0].label ), filterTextWrappers ), filter(item, field, filterValue) { if (filterValue === void 0) { return true; } const fieldValue = field.getValue({ item }); return fieldValue > filterValue; }, selection: "single" }, { name: OPERATOR_LESS_THAN_OR_EQUAL, /* translators: DataViews operator name */ label: (0, import_i18n105.__)("Less than or equal"), filterText: (filter, activeElements) => (0, import_element92.createInterpolateElement)( (0, import_i18n105.sprintf)( /* translators: 1: Filter name (e.g. "Count"). 2: Filter value (e.g. "10"): "Count is less than or equal to: 10". */ (0, import_i18n105.__)( "<Name>%1$s is less than or equal to: </Name><Value>%2$s</Value>" ), filter.name, activeElements[0].label ), filterTextWrappers ), filter(item, field, filterValue) { if (filterValue === void 0) { return true; } const fieldValue = field.getValue({ item }); return fieldValue <= filterValue; }, selection: "single" }, { name: OPERATOR_GREATER_THAN_OR_EQUAL, /* translators: DataViews operator name */ label: (0, import_i18n105.__)("Greater than or equal"), filterText: (filter, activeElements) => (0, import_element92.createInterpolateElement)( (0, import_i18n105.sprintf)( /* translators: 1: Filter name (e.g. "Count"). 2: Filter value (e.g. "10"): "Count is greater than or equal to: 10". */ (0, import_i18n105.__)( "<Name>%1$s is greater than or equal to: </Name><Value>%2$s</Value>" ), filter.name, activeElements[0].label ), filterTextWrappers ), filter(item, field, filterValue) { if (filterValue === void 0) { return true; } const fieldValue = field.getValue({ item }); return fieldValue >= filterValue; }, selection: "single" }, { name: OPERATOR_BEFORE2, /* translators: DataViews operator name */ label: (0, import_i18n105.__)("Before"), filterText: (filter, activeElements) => (0, import_element92.createInterpolateElement)( (0, import_i18n105.sprintf)( /* translators: 1: Filter name (e.g. "Date"). 2: Filter value (e.g. "2024-01-01"): "Date is before: 2024-01-01". */ (0, import_i18n105.__)("<Name>%1$s is before: </Name><Value>%2$s</Value>"), filter.name, activeElements[0].label ), filterTextWrappers ), filter(item, field, filterValue) { if (filterValue === void 0) { return true; } const filterDate = (0, import_date2.getDate)(filterValue); const fieldDate = (0, import_date2.getDate)(field.getValue({ item })); return fieldDate < filterDate; }, selection: "single" }, { name: OPERATOR_AFTER2, /* translators: DataViews operator name */ label: (0, import_i18n105.__)("After"), filterText: (filter, activeElements) => (0, import_element92.createInterpolateElement)( (0, import_i18n105.sprintf)( /* translators: 1: Filter name (e.g. "Date"). 2: Filter value (e.g. "2024-01-01"): "Date is after: 2024-01-01". */ (0, import_i18n105.__)("<Name>%1$s is after: </Name><Value>%2$s</Value>"), filter.name, activeElements[0].label ), filterTextWrappers ), filter(item, field, filterValue) { if (filterValue === void 0) { return true; } const filterDate = (0, import_date2.getDate)(filterValue); const fieldDate = (0, import_date2.getDate)(field.getValue({ item })); return fieldDate > filterDate; }, selection: "single" }, { name: OPERATOR_BEFORE_INC, /* translators: DataViews operator name */ label: (0, import_i18n105.__)("Before (inc)"), filterText: (filter, activeElements) => (0, import_element92.createInterpolateElement)( (0, import_i18n105.sprintf)( /* translators: 1: Filter name (e.g. "Date"). 2: Filter value (e.g. "2024-01-01"): "Date is on or before: 2024-01-01". */ (0, import_i18n105.__)( "<Name>%1$s is on or before: </Name><Value>%2$s</Value>" ), filter.name, activeElements[0].label ), filterTextWrappers ), filter(item, field, filterValue) { if (filterValue === void 0) { return true; } const filterDate = (0, import_date2.getDate)(filterValue); const fieldDate = (0, import_date2.getDate)(field.getValue({ item })); return fieldDate <= filterDate; }, selection: "single" }, { name: OPERATOR_AFTER_INC, /* translators: DataViews operator name */ label: (0, import_i18n105.__)("After (inc)"), filterText: (filter, activeElements) => (0, import_element92.createInterpolateElement)( (0, import_i18n105.sprintf)( /* translators: 1: Filter name (e.g. "Date"). 2: Filter value (e.g. "2024-01-01"): "Date is on or after: 2024-01-01". */ (0, import_i18n105.__)( "<Name>%1$s is on or after: </Name><Value>%2$s</Value>" ), filter.name, activeElements[0].label ), filterTextWrappers ), filter(item, field, filterValue) { if (filterValue === void 0) { return true; } const filterDate = (0, import_date2.getDate)(filterValue); const fieldDate = (0, import_date2.getDate)(field.getValue({ item })); return fieldDate >= filterDate; }, selection: "single" }, { name: OPERATOR_CONTAINS, /* translators: DataViews operator name */ label: (0, import_i18n105.__)("Contains"), filterText: (filter, activeElements) => (0, import_element92.createInterpolateElement)( (0, import_i18n105.sprintf)( /* translators: 1: Filter name (e.g. "Title"). 2: Filter value (e.g. "Hello"): "Title contains: Hello". */ (0, import_i18n105.__)("<Name>%1$s contains: </Name><Value>%2$s</Value>"), filter.name, activeElements[0].label ), filterTextWrappers ), filter(item, field, filterValue) { if (filterValue === void 0) { return true; } const fieldValue = field.getValue({ item }); return typeof fieldValue === "string" && filterValue && fieldValue.toLowerCase().includes(String(filterValue).toLowerCase()); }, selection: "single" }, { name: OPERATOR_NOT_CONTAINS, /* translators: DataViews operator name */ label: (0, import_i18n105.__)("Doesn't contain"), filterText: (filter, activeElements) => (0, import_element92.createInterpolateElement)( (0, import_i18n105.sprintf)( /* translators: 1: Filter name (e.g. "Title"). 2: Filter value (e.g. "Hello"): "Title doesn't contain: Hello". */ (0, import_i18n105.__)( "<Name>%1$s doesn't contain: </Name><Value>%2$s</Value>" ), filter.name, activeElements[0].label ), filterTextWrappers ), filter(item, field, filterValue) { if (filterValue === void 0) { return true; } const fieldValue = field.getValue({ item }); return typeof fieldValue === "string" && filterValue && !fieldValue.toLowerCase().includes(String(filterValue).toLowerCase()); }, selection: "single" }, { name: OPERATOR_STARTS_WITH, /* translators: DataViews operator name */ label: (0, import_i18n105.__)("Starts with"), filterText: (filter, activeElements) => (0, import_element92.createInterpolateElement)( (0, import_i18n105.sprintf)( /* translators: 1: Filter name (e.g. "Title"). 2: Filter value (e.g. "Hello"): "Title starts with: Hello". */ (0, import_i18n105.__)("<Name>%1$s starts with: </Name><Value>%2$s</Value>"), filter.name, activeElements[0].label ), filterTextWrappers ), filter(item, field, filterValue) { if (filterValue === void 0) { return true; } const fieldValue = field.getValue({ item }); return typeof fieldValue === "string" && filterValue && fieldValue.toLowerCase().startsWith(String(filterValue).toLowerCase()); }, selection: "single" }, { name: OPERATOR_ON, /* translators: DataViews operator name */ label: (0, import_i18n105.__)("On"), filterText: (filter, activeElements) => (0, import_element92.createInterpolateElement)( (0, import_i18n105.sprintf)( /* translators: 1: Filter name (e.g. "Date"). 2: Filter value (e.g. "2024-01-01"): "Date is: 2024-01-01". */ (0, import_i18n105.__)("<Name>%1$s is: </Name><Value>%2$s</Value>"), filter.name, activeElements[0].label ), filterTextWrappers ), filter(item, field, filterValue) { if (filterValue === void 0) { return true; } const filterDate = (0, import_date2.getDate)(filterValue); const fieldDate = (0, import_date2.getDate)(field.getValue({ item })); return filterDate.getTime() === fieldDate.getTime(); }, selection: "single" }, { name: OPERATOR_NOT_ON, /* translators: DataViews operator name */ label: (0, import_i18n105.__)("Not on"), filterText: (filter, activeElements) => (0, import_element92.createInterpolateElement)( (0, import_i18n105.sprintf)( /* translators: 1: Filter name (e.g. "Date"). 2: Filter value (e.g. "2024-01-01"): "Date is not: 2024-01-01". */ (0, import_i18n105.__)("<Name>%1$s is not: </Name><Value>%2$s</Value>"), filter.name, activeElements[0].label ), filterTextWrappers ), filter(item, field, filterValue) { if (filterValue === void 0) { return true; } const filterDate = (0, import_date2.getDate)(filterValue); const fieldDate = (0, import_date2.getDate)(field.getValue({ item })); return filterDate.getTime() !== fieldDate.getTime(); }, selection: "single" } ]; var getOperatorByName = (name2) => OPERATORS.find((op) => op.name === name2); var getAllOperatorNames = () => OPERATORS.map((op) => op.name); var isSingleSelectionOperator = (name2) => OPERATORS.filter((op) => op.selection === "single").some( (op) => op.name === name2 ); var isRegisteredOperator = (name2) => OPERATORS.some((op) => op.name === name2); // packages/dataviews/build-module/components/dataviews-filters/filter.mjs var import_jsx_runtime217 = __toESM(require_jsx_runtime(), 1); var ENTER4 = "Enter"; var SPACE3 = " "; var FilterText = ({ activeElements, filterInView, filter }) => { if (activeElements === void 0 || activeElements.length === 0) { return filter.name; } const operator = getOperatorByName(filterInView?.operator); if (operator !== void 0) { return operator.filterText(filter, activeElements); } return (0, import_i18n106.sprintf)( /* translators: 1: Filter name e.g.: "Unknown status for Author". */ (0, import_i18n106.__)("Unknown status for %1$s"), filter.name ); }; function OperatorSelector({ filter, view, onChangeView }) { const operatorOptions = filter.operators?.map((operator) => ({ value: operator, label: getOperatorByName(operator)?.label || operator })); const currentFilter = view.filters?.find( (_filter) => _filter.field === filter.field ); const value = currentFilter?.operator || filter.operators[0]; return operatorOptions.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime217.jsxs)( Stack, { direction: "row", gap: "sm", justify: "flex-start", className: "dataviews-filters__summary-operators-container", align: "center", children: [ /* @__PURE__ */ (0, import_jsx_runtime217.jsx)(import_components111.FlexItem, { className: "dataviews-filters__summary-operators-filter-name", children: filter.name }), /* @__PURE__ */ (0, import_jsx_runtime217.jsx)( import_components111.SelectControl, { className: "dataviews-filters__summary-operators-filter-select", label: (0, import_i18n106.__)("Conditions"), value, options: operatorOptions, onChange: (newValue) => { const newOperator = newValue; const currentOperator = currentFilter?.operator; const newFilters = currentFilter ? [ ...(view.filters ?? []).map( (_filter) => { if (_filter.field === filter.field) { const currentOpSelectionModel = getOperatorByName( currentOperator )?.selection; const newOpSelectionModel = getOperatorByName( newOperator )?.selection; const shouldResetValue = currentOpSelectionModel !== newOpSelectionModel || [ currentOpSelectionModel, newOpSelectionModel ].includes("custom"); return { ..._filter, value: shouldResetValue ? void 0 : _filter.value, operator: newOperator }; } return _filter; } ) ] : [ ...view.filters ?? [], { field: filter.field, operator: newOperator, value: void 0 } ]; onChangeView({ ...view, page: 1, filters: newFilters }); }, size: "small", variant: "minimal", hideLabelFromVision: true } ) ] } ); } function Filter({ addFilterRef, openedFilter, fields, ...commonProps }) { const toggleRef = (0, import_element93.useRef)(null); const { filter, view, onChangeView } = commonProps; const filterInView = view.filters?.find( (f2) => f2.field === filter.field ); let activeElements = []; const field = (0, import_element93.useMemo)(() => { const currentField = fields.find((f2) => f2.id === filter.field); if (currentField) { return { ...currentField, // Configure getValue as if Item was a plain object. // See related input-widget.tsx getValue: ({ item }) => item[currentField.id] }; } return currentField; }, [fields, filter.field]); const { elements: elements2 } = useElements({ elements: filter.elements, getElements: filter.getElements }); if (elements2.length > 0) { activeElements = elements2.filter((element) => { if (filter.singleSelection) { return element.value === filterInView?.value; } return filterInView?.value?.includes(element.value); }); } else if (Array.isArray(filterInView?.value)) { const label = filterInView.value.map((v2) => { const formattedValue = field?.getValueFormatted({ item: { [field.id]: v2 }, field }); return formattedValue || String(v2); }); activeElements = [ { value: filterInView.value, // @ts-ignore label } ]; } else if (typeof filterInView?.value === "object") { activeElements = [ { value: filterInView.value, label: filterInView.value } ]; } else if (filterInView?.value !== void 0) { const label = field !== void 0 ? field.getValueFormatted({ item: { [field.id]: filterInView.value }, field }) : String(filterInView.value); activeElements = [ { value: filterInView.value, label } ]; } const isPrimary = filter.isPrimary; const isLocked = filterInView?.isLocked; const hasValues = !isLocked && filterInView?.value !== void 0; const canResetOrRemove = !isLocked && (!isPrimary || hasValues); return /* @__PURE__ */ (0, import_jsx_runtime217.jsx)( import_components111.Dropdown, { defaultOpen: openedFilter === filter.field, contentClassName: "dataviews-filters__summary-popover", popoverProps: { placement: "bottom-start", role: "dialog" }, onClose: () => { toggleRef.current?.focus(); }, renderToggle: ({ isOpen, onToggle }) => /* @__PURE__ */ (0, import_jsx_runtime217.jsxs)("div", { className: "dataviews-filters__summary-chip-container", children: [ /* @__PURE__ */ (0, import_jsx_runtime217.jsx)( import_components111.Tooltip, { text: (0, import_i18n106.sprintf)( /* translators: 1: Filter name. */ (0, import_i18n106.__)("Filter by: %1$s"), filter.name.toLowerCase() ), placement: "top", children: /* @__PURE__ */ (0, import_jsx_runtime217.jsx)( "div", { className: clsx_default( "dataviews-filters__summary-chip", { "has-reset": canResetOrRemove, "has-values": hasValues, "is-not-clickable": isLocked } ), role: "button", tabIndex: isLocked ? -1 : 0, onClick: () => { if (!isLocked) { onToggle(); } }, onKeyDown: (event) => { if (!isLocked && [ENTER4, SPACE3].includes(event.key)) { onToggle(); event.preventDefault(); } }, "aria-disabled": isLocked, "aria-pressed": isOpen, "aria-expanded": isOpen, ref: toggleRef, children: /* @__PURE__ */ (0, import_jsx_runtime217.jsx)( FilterText, { activeElements, filterInView, filter } ) } ) } ), canResetOrRemove && /* @__PURE__ */ (0, import_jsx_runtime217.jsx)( import_components111.Tooltip, { text: isPrimary ? (0, import_i18n106.__)("Reset") : (0, import_i18n106.__)("Remove"), placement: "top", children: /* @__PURE__ */ (0, import_jsx_runtime217.jsx)( "button", { className: clsx_default( "dataviews-filters__summary-chip-remove", { "has-values": hasValues } ), onClick: () => { onChangeView({ ...view, page: 1, filters: view.filters?.filter( (_filter) => _filter.field !== filter.field ) }); if (!isPrimary) { addFilterRef.current?.focus(); } else { toggleRef.current?.focus(); } }, children: /* @__PURE__ */ (0, import_jsx_runtime217.jsx)(import_components111.Icon, { icon: close_small_default }) } ) } ) ] }), renderContent: () => { return /* @__PURE__ */ (0, import_jsx_runtime217.jsxs)(Stack, { direction: "column", justify: "flex-start", children: [ /* @__PURE__ */ (0, import_jsx_runtime217.jsx)(OperatorSelector, { ...commonProps }), commonProps.filter.hasElements ? /* @__PURE__ */ (0, import_jsx_runtime217.jsx)( SearchWidget, { ...commonProps, filter: { ...commonProps.filter, elements: elements2 } } ) : /* @__PURE__ */ (0, import_jsx_runtime217.jsx)(InputWidget, { ...commonProps, fields }) ] }); } } ); } // packages/dataviews/build-module/components/dataviews-filters/add-filter.mjs var import_components112 = __toESM(require_components(), 1); var import_i18n107 = __toESM(require_i18n(), 1); var import_element94 = __toESM(require_element(), 1); var import_jsx_runtime218 = __toESM(require_jsx_runtime(), 1); var { Menu: Menu8 } = unlock3(import_components112.privateApis); function AddFilterMenu({ filters, view, onChangeView, setOpenedFilter, triggerProps }) { const inactiveFilters = filters.filter((filter) => !filter.isVisible); return /* @__PURE__ */ (0, import_jsx_runtime218.jsxs)(Menu8, { children: [ /* @__PURE__ */ (0, import_jsx_runtime218.jsx)(Menu8.TriggerButton, { ...triggerProps }), /* @__PURE__ */ (0, import_jsx_runtime218.jsx)(Menu8.Popover, { children: inactiveFilters.map((filter) => { return /* @__PURE__ */ (0, import_jsx_runtime218.jsx)( Menu8.Item, { onClick: () => { setOpenedFilter(filter.field); onChangeView({ ...view, page: 1, filters: [ ...view.filters || [], { field: filter.field, value: void 0, operator: filter.operators[0] } ] }); }, children: /* @__PURE__ */ (0, import_jsx_runtime218.jsx)(Menu8.ItemLabel, { children: filter.name }) }, filter.field ); }) }) ] }); } function AddFilter({ filters, view, onChangeView, setOpenedFilter }, ref) { if (!filters.length || filters.every(({ isPrimary }) => isPrimary)) { return null; } const inactiveFilters = filters.filter((filter) => !filter.isVisible); return /* @__PURE__ */ (0, import_jsx_runtime218.jsx)( AddFilterMenu, { triggerProps: { render: /* @__PURE__ */ (0, import_jsx_runtime218.jsx)( import_components112.Button, { accessibleWhenDisabled: true, size: "compact", className: "dataviews-filters-button", variant: "tertiary", disabled: !inactiveFilters.length, ref } ), children: (0, import_i18n107.__)("Add filter") }, ...{ filters, view, onChangeView, setOpenedFilter } } ); } var add_filter_default = (0, import_element94.forwardRef)(AddFilter); // packages/dataviews/build-module/components/dataviews-filters/reset-filters.mjs var import_components113 = __toESM(require_components(), 1); var import_i18n108 = __toESM(require_i18n(), 1); var import_jsx_runtime219 = __toESM(require_jsx_runtime(), 1); function ResetFilter({ filters, view, onChangeView }) { const isPrimary = (field) => filters.some( (_filter) => _filter.field === field && _filter.isPrimary ); const isDisabled = !view.search && !view.filters?.some( (_filter) => !_filter.isLocked && (_filter.value !== void 0 || !isPrimary(_filter.field)) ); return /* @__PURE__ */ (0, import_jsx_runtime219.jsx)( import_components113.Button, { disabled: isDisabled, accessibleWhenDisabled: true, size: "compact", variant: "tertiary", className: "dataviews-filters__reset-button", onClick: () => { onChangeView({ ...view, page: 1, search: "", filters: view.filters?.filter((f2) => !!f2.isLocked) || [] }); }, children: (0, import_i18n108.__)("Reset") } ); } // packages/dataviews/build-module/components/dataviews-filters/use-filters.mjs var import_element95 = __toESM(require_element(), 1); function useFilters(fields, view) { return (0, import_element95.useMemo)(() => { const filters = []; fields.forEach((field) => { if (field.filterBy === false || !field.hasElements && !field.Edit) { return; } const operators = field.filterBy.operators; const isPrimary = !!field.filterBy?.isPrimary; const isLocked = view.filters?.some( (f2) => f2.field === field.id && !!f2.isLocked ) ?? false; filters.push({ field: field.id, name: field.label, elements: field.elements, getElements: field.getElements, hasElements: field.hasElements, singleSelection: operators.some( (op) => isSingleSelectionOperator(op) ), operators, isVisible: isLocked || isPrimary || !!view.filters?.some( (f2) => f2.field === field.id && isRegisteredOperator(f2.operator) ), isPrimary, isLocked }); }); filters.sort((a2, b2) => { if (a2.isLocked && !b2.isLocked) { return -1; } if (!a2.isLocked && b2.isLocked) { return 1; } if (a2.isPrimary && !b2.isPrimary) { return -1; } if (!a2.isPrimary && b2.isPrimary) { return 1; } return a2.name.localeCompare(b2.name); }); return filters; }, [fields, view]); } var use_filters_default = useFilters; // packages/dataviews/build-module/components/dataviews-filters/filters.mjs var import_jsx_runtime220 = __toESM(require_jsx_runtime(), 1); function Filters({ className }) { const { fields, view, onChangeView, openedFilter, setOpenedFilter } = (0, import_element96.useContext)(dataviews_context_default); const addFilterRef = (0, import_element96.useRef)(null); const filters = use_filters_default(fields, view); const addFilter = /* @__PURE__ */ (0, import_jsx_runtime220.jsx)( add_filter_default, { filters, view, onChangeView, ref: addFilterRef, setOpenedFilter }, "add-filter" ); const visibleFilters = filters.filter((filter) => filter.isVisible); if (visibleFilters.length === 0) { return null; } const filterComponents = [ ...visibleFilters.map((filter) => { return /* @__PURE__ */ (0, import_jsx_runtime220.jsx)( Filter, { filter, view, fields, onChangeView, addFilterRef, openedFilter }, filter.field ); }), addFilter ]; filterComponents.push( /* @__PURE__ */ (0, import_jsx_runtime220.jsx)( ResetFilter, { filters, view, onChangeView }, "reset-filters" ) ); return /* @__PURE__ */ (0, import_jsx_runtime220.jsx)( Stack, { direction: "row", justify: "flex-start", gap: "sm", style: { width: "fit-content" }, wrap: "wrap", className, children: filterComponents } ); } var filters_default = (0, import_element96.memo)(Filters); // packages/dataviews/build-module/components/dataviews-filters/toggle.mjs var import_element97 = __toESM(require_element(), 1); var import_components114 = __toESM(require_components(), 1); var import_i18n109 = __toESM(require_i18n(), 1); var import_jsx_runtime221 = __toESM(require_jsx_runtime(), 1); function FiltersToggle() { const { filters, view, onChangeView, setOpenedFilter, isShowingFilter, setIsShowingFilter } = (0, import_element97.useContext)(dataviews_context_default); const buttonRef = (0, import_element97.useRef)(null); const onChangeViewWithFilterVisibility = (0, import_element97.useCallback)( (_view) => { onChangeView(_view); setIsShowingFilter(true); }, [onChangeView, setIsShowingFilter] ); if (filters.length === 0) { return null; } const hasVisibleFilters = filters.some((filter) => filter.isVisible); const addFilterButtonProps = { label: (0, import_i18n109.__)("Add filter"), "aria-expanded": false, isPressed: false }; const toggleFiltersButtonProps = { label: (0, import_i18n109._x)("Filter", "verb"), "aria-expanded": isShowingFilter, isPressed: isShowingFilter, onClick: () => { if (!isShowingFilter) { setOpenedFilter(null); } setIsShowingFilter(!isShowingFilter); } }; const hasPrimaryOrLockedFilters = filters.some( (filter) => filter.isPrimary || filter.isLocked ); const buttonComponent = /* @__PURE__ */ (0, import_jsx_runtime221.jsx)( import_components114.Button, { ref: buttonRef, className: "dataviews-filters__visibility-toggle", size: "compact", icon: funnel_default, disabled: hasPrimaryOrLockedFilters, accessibleWhenDisabled: true, ...hasVisibleFilters ? toggleFiltersButtonProps : addFilterButtonProps } ); return /* @__PURE__ */ (0, import_jsx_runtime221.jsx)("div", { className: "dataviews-filters__container-visibility-toggle", children: !hasVisibleFilters ? /* @__PURE__ */ (0, import_jsx_runtime221.jsx)( AddFilterMenu, { filters, view, onChangeView: onChangeViewWithFilterVisibility, setOpenedFilter, triggerProps: { render: buttonComponent } } ) : /* @__PURE__ */ (0, import_jsx_runtime221.jsx)( FilterVisibilityToggle, { buttonRef, filtersCount: view.filters?.length, children: buttonComponent } ) }); } function FilterVisibilityToggle({ buttonRef, filtersCount, children }) { (0, import_element97.useEffect)( () => () => { buttonRef.current?.focus(); }, [buttonRef] ); return /* @__PURE__ */ (0, import_jsx_runtime221.jsxs)(import_jsx_runtime221.Fragment, { children: [ children, !!filtersCount && /* @__PURE__ */ (0, import_jsx_runtime221.jsx)("span", { className: "dataviews-filters-toggle__count", children: filtersCount }) ] }); } var toggle_default = FiltersToggle; // packages/dataviews/build-module/components/dataviews-filters/filters-toggled.mjs var import_element98 = __toESM(require_element(), 1); var import_jsx_runtime222 = __toESM(require_jsx_runtime(), 1); function FiltersToggled(props) { const { isShowingFilter } = (0, import_element98.useContext)(dataviews_context_default); if (!isShowingFilter) { return null; } return /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(filters_default, { ...props }); } var filters_toggled_default = FiltersToggled; // packages/dataviews/build-module/components/dataviews-layout/index.mjs var import_element99 = __toESM(require_element(), 1); var import_components115 = __toESM(require_components(), 1); var import_i18n110 = __toESM(require_i18n(), 1); var import_jsx_runtime223 = __toESM(require_jsx_runtime(), 1); function DataViewsLayout({ className }) { const { actions = [], data, fields, getItemId: getItemId2, getItemLevel: getItemLevel2, hasInitiallyLoaded, isLoading, view, onChangeView, selection, onChangeSelection, setOpenedFilter, onClickItem, isItemClickable, renderItemLink, defaultLayouts: defaultLayouts4, empty = /* @__PURE__ */ (0, import_jsx_runtime223.jsx)("p", { children: (0, import_i18n110.__)("No results") }) } = (0, import_element99.useContext)(dataviews_context_default); const isDelayedInitialLoading = useDelayedLoading(!hasInitiallyLoaded, { delay: 200 }); if (!hasInitiallyLoaded) { if (!isDelayedInitialLoading) { return null; } return /* @__PURE__ */ (0, import_jsx_runtime223.jsx)("div", { className: "dataviews-loading", children: /* @__PURE__ */ (0, import_jsx_runtime223.jsx)("p", { children: /* @__PURE__ */ (0, import_jsx_runtime223.jsx)(import_components115.Spinner, {}) }) }); } const ViewComponent = VIEW_LAYOUTS.find( (v2) => v2.type === view.type && defaultLayouts4[v2.type] )?.component; return /* @__PURE__ */ (0, import_jsx_runtime223.jsx)( ViewComponent, { className, actions, data, fields, getItemId: getItemId2, getItemLevel: getItemLevel2, isLoading, onChangeView, onChangeSelection, selection, setOpenedFilter, onClickItem, renderItemLink, isItemClickable, view, empty } ); } // packages/dataviews/build-module/components/dataviews-footer/index.mjs var import_element100 = __toESM(require_element(), 1); var import_jsx_runtime224 = __toESM(require_jsx_runtime(), 1); var EMPTY_ARRAY8 = []; function DataViewsFooter() { const { view, paginationInfo: { totalItems = 0, totalPages }, data, actions = EMPTY_ARRAY8, isLoading, hasInitiallyLoaded, hasInfiniteScrollHandler } = (0, import_element100.useContext)(dataviews_context_default); const isRefreshing = !!isLoading && hasInitiallyLoaded && !hasInfiniteScrollHandler && !!data?.length; const isDelayedRefreshing = useDelayedLoading(!!isRefreshing); const hasBulkActions = useSomeItemHasAPossibleBulkAction(actions, data) && [LAYOUT_TABLE2, LAYOUT_GRID2].includes(view.type); if (!isRefreshing && (!totalItems || !totalPages || totalPages <= 1 && !hasBulkActions)) { return null; } return (!!totalItems || isRefreshing) && /* @__PURE__ */ (0, import_jsx_runtime224.jsx)( "div", { className: "dataviews-footer", inert: isRefreshing ? "true" : void 0, children: /* @__PURE__ */ (0, import_jsx_runtime224.jsxs)( Stack, { direction: "row", justify: "end", align: "center", className: clsx_default("dataviews-footer__content", { "is-refreshing": isDelayedRefreshing }), gap: "sm", children: [ hasBulkActions && /* @__PURE__ */ (0, import_jsx_runtime224.jsx)(BulkActionsFooter, {}), /* @__PURE__ */ (0, import_jsx_runtime224.jsx)(dataviews_pagination_default, {}) ] } ) } ); } // packages/dataviews/build-module/components/dataviews-search/index.mjs var import_i18n111 = __toESM(require_i18n(), 1); var import_element101 = __toESM(require_element(), 1); var import_components116 = __toESM(require_components(), 1); var import_compose21 = __toESM(require_compose(), 1); var import_jsx_runtime225 = __toESM(require_jsx_runtime(), 1); var DataViewsSearch = (0, import_element101.memo)(function Search({ label }) { const { view, onChangeView } = (0, import_element101.useContext)(dataviews_context_default); const [search, setSearch, debouncedSearch] = (0, import_compose21.useDebouncedInput)( view.search ); (0, import_element101.useEffect)(() => { setSearch(view.search ?? ""); }, [view.search, setSearch]); const onChangeViewRef = (0, import_element101.useRef)(onChangeView); const viewRef = (0, import_element101.useRef)(view); (0, import_element101.useEffect)(() => { onChangeViewRef.current = onChangeView; viewRef.current = view; }, [onChangeView, view]); (0, import_element101.useEffect)(() => { if (debouncedSearch !== viewRef.current?.search) { onChangeViewRef.current({ ...viewRef.current, page: 1, search: debouncedSearch }); } }, [debouncedSearch]); const searchLabel = label || (0, import_i18n111.__)("Search"); return /* @__PURE__ */ (0, import_jsx_runtime225.jsx)( import_components116.SearchControl, { className: "dataviews-search", onChange: setSearch, value: search, label: searchLabel, placeholder: searchLabel, size: "compact" } ); }); var dataviews_search_default = DataViewsSearch; // packages/dataviews/build-module/components/dataviews-view-config/index.mjs var import_components118 = __toESM(require_components(), 1); var import_i18n113 = __toESM(require_i18n(), 1); var import_element103 = __toESM(require_element(), 1); var import_warning = __toESM(require_warning(), 1); var import_compose22 = __toESM(require_compose(), 1); // packages/dataviews/build-module/components/dataviews-view-config/infinite-scroll-toggle.mjs var import_components117 = __toESM(require_components(), 1); var import_i18n112 = __toESM(require_i18n(), 1); var import_element102 = __toESM(require_element(), 1); var import_jsx_runtime226 = __toESM(require_jsx_runtime(), 1); function InfiniteScrollToggle() { const context = (0, import_element102.useContext)(dataviews_context_default); const { view, onChangeView } = context; const infiniteScrollEnabled = view.infiniteScrollEnabled ?? false; if (!context.hasInfiniteScrollHandler) { return null; } return /* @__PURE__ */ (0, import_jsx_runtime226.jsx)( import_components117.ToggleControl, { label: (0, import_i18n112.__)("Enable infinite scroll"), help: (0, import_i18n112.__)( "Automatically load more content as you scroll, instead of showing pagination links." ), checked: infiniteScrollEnabled, onChange: (newValue) => { onChangeView({ ...view, infiniteScrollEnabled: newValue }); } } ); } // packages/dataviews/build-module/components/dataviews-view-config/index.mjs var import_jsx_runtime227 = __toESM(require_jsx_runtime(), 1); var { Menu: Menu9 } = unlock3(import_components118.privateApis); var DATAVIEWS_CONFIG_POPOVER_PROPS = { className: "dataviews-config__popover", placement: "bottom-end", offset: 9 }; function ViewTypeMenu() { const { view, onChangeView, defaultLayouts: defaultLayouts4 } = (0, import_element103.useContext)(dataviews_context_default); const availableLayouts = Object.keys(defaultLayouts4); if (availableLayouts.length <= 1) { return null; } const activeView = VIEW_LAYOUTS.find((v2) => view.type === v2.type); return /* @__PURE__ */ (0, import_jsx_runtime227.jsxs)(Menu9, { children: [ /* @__PURE__ */ (0, import_jsx_runtime227.jsx)( Menu9.TriggerButton, { render: /* @__PURE__ */ (0, import_jsx_runtime227.jsx)( import_components118.Button, { size: "compact", icon: activeView?.icon, label: (0, import_i18n113.__)("Layout") } ) } ), /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(Menu9.Popover, { children: availableLayouts.map((layout) => { const config2 = VIEW_LAYOUTS.find( (v2) => v2.type === layout ); if (!config2) { return null; } return /* @__PURE__ */ (0, import_jsx_runtime227.jsx)( Menu9.RadioItem, { value: layout, name: "view-actions-available-view", checked: layout === view.type, hideOnClick: true, onChange: (e2) => { switch (e2.target.value) { case "list": case "grid": case "table": case "pickerGrid": case "pickerTable": case "activity": const viewWithoutLayout = { ...view }; if ("layout" in viewWithoutLayout) { delete viewWithoutLayout.layout; } return onChangeView({ ...viewWithoutLayout, type: e2.target.value, ...defaultLayouts4[e2.target.value] }); } (0, import_warning.default)("Invalid dataview"); }, children: /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(Menu9.ItemLabel, { children: config2.label }) }, layout ); }) }) ] }); } function SortFieldControl() { const { view, fields, onChangeView } = (0, import_element103.useContext)(dataviews_context_default); const orderOptions = (0, import_element103.useMemo)(() => { const sortableFields = fields.filter( (field) => field.enableSorting !== false ); return sortableFields.map((field) => { return { label: field.label, value: field.id }; }); }, [fields]); return /* @__PURE__ */ (0, import_jsx_runtime227.jsx)( import_components118.SelectControl, { __next40pxDefaultSize: true, label: (0, import_i18n113.__)("Sort by"), value: view.sort?.field, options: orderOptions, onChange: (value) => { onChangeView({ ...view, sort: { direction: view?.sort?.direction || "desc", field: value }, showLevels: false }); } } ); } function SortDirectionControl() { const { view, fields, onChangeView } = (0, import_element103.useContext)(dataviews_context_default); const sortableFields = fields.filter( (field) => field.enableSorting !== false ); if (sortableFields.length === 0) { return null; } let value = view.sort?.direction; if (!value && view.sort?.field) { value = "desc"; } return /* @__PURE__ */ (0, import_jsx_runtime227.jsx)( import_components118.__experimentalToggleGroupControl, { className: "dataviews-view-config__sort-direction", __next40pxDefaultSize: true, isBlock: true, label: (0, import_i18n113.__)("Order"), value, onChange: (newDirection) => { if (newDirection === "asc" || newDirection === "desc") { onChangeView({ ...view, sort: { direction: newDirection, field: view.sort?.field || // If there is no field assigned as the sorting field assign the first sortable field. fields.find( (field) => field.enableSorting !== false )?.id || "" }, showLevels: false }); return; } (0, import_warning.default)("Invalid direction"); }, children: SORTING_DIRECTIONS.map((direction) => { return /* @__PURE__ */ (0, import_jsx_runtime227.jsx)( import_components118.__experimentalToggleGroupControlOptionIcon, { value: direction, icon: sortIcons[direction], label: sortLabels[direction] }, direction ); }) } ); } function ItemsPerPageControl() { const { view, config: config2, onChangeView } = (0, import_element103.useContext)(dataviews_context_default); const { infiniteScrollEnabled } = view; if (!config2 || !config2.perPageSizes || config2.perPageSizes.length < 2 || config2.perPageSizes.length > 6 || infiniteScrollEnabled) { return null; } return /* @__PURE__ */ (0, import_jsx_runtime227.jsx)( import_components118.__experimentalToggleGroupControl, { __next40pxDefaultSize: true, isBlock: true, label: (0, import_i18n113.__)("Items per page"), value: view.perPage || 10, disabled: !view?.sort?.field, onChange: (newItemsPerPage) => { const newItemsPerPageNumber = typeof newItemsPerPage === "number" || newItemsPerPage === void 0 ? newItemsPerPage : parseInt(newItemsPerPage, 10); onChangeView({ ...view, perPage: newItemsPerPageNumber, page: 1 }); }, children: config2.perPageSizes.map((value) => { return /* @__PURE__ */ (0, import_jsx_runtime227.jsx)( import_components118.__experimentalToggleGroupControlOption, { value, label: value.toString() }, value ); }) } ); } function ResetViewButton() { const { onReset } = (0, import_element103.useContext)(dataviews_context_default); if (onReset === void 0) { return null; } const isDisabled = onReset === false; return /* @__PURE__ */ (0, import_jsx_runtime227.jsx)( import_components118.Button, { variant: "tertiary", size: "compact", disabled: isDisabled, accessibleWhenDisabled: true, className: "dataviews-view-config__reset-button", onClick: () => { if (typeof onReset === "function") { onReset(); } }, children: (0, import_i18n113.__)("Reset view") } ); } function DataviewsViewConfigDropdown() { const { view, onReset } = (0, import_element103.useContext)(dataviews_context_default); const popoverId = (0, import_compose22.useInstanceId)( _DataViewsViewConfig, "dataviews-view-config-dropdown" ); const activeLayout = VIEW_LAYOUTS.find( (layout) => layout.type === view.type ); const isModified = typeof onReset === "function"; return /* @__PURE__ */ (0, import_jsx_runtime227.jsx)( import_components118.Dropdown, { expandOnMobile: true, popoverProps: { ...DATAVIEWS_CONFIG_POPOVER_PROPS, id: popoverId }, renderToggle: ({ onToggle, isOpen }) => { return /* @__PURE__ */ (0, import_jsx_runtime227.jsxs)("div", { className: "dataviews-view-config__toggle-wrapper", children: [ /* @__PURE__ */ (0, import_jsx_runtime227.jsx)( import_components118.Button, { size: "compact", icon: cog_default, label: (0, import_i18n113._x)( "View options", "View is used as a noun" ), onClick: onToggle, "aria-expanded": isOpen ? "true" : "false", "aria-controls": popoverId } ), isModified && /* @__PURE__ */ (0, import_jsx_runtime227.jsx)("span", { className: "dataviews-view-config__modified-indicator" }) ] }); }, renderContent: () => /* @__PURE__ */ (0, import_jsx_runtime227.jsx)( import_components118.__experimentalDropdownContentWrapper, { paddingSize: "medium", className: "dataviews-config__popover-content-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime227.jsxs)( Stack, { direction: "column", className: "dataviews-view-config", gap: "xl", children: [ /* @__PURE__ */ (0, import_jsx_runtime227.jsxs)( Stack, { direction: "row", justify: "space-between", align: "center", className: "dataviews-view-config__header", children: [ /* @__PURE__ */ (0, import_jsx_runtime227.jsx)( import_components118.__experimentalHeading, { level: 2, className: "dataviews-settings-section__title", children: (0, import_i18n113.__)("Appearance") } ), /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(ResetViewButton, {}) ] } ), /* @__PURE__ */ (0, import_jsx_runtime227.jsxs)(Stack, { direction: "column", gap: "lg", children: [ /* @__PURE__ */ (0, import_jsx_runtime227.jsxs)( Stack, { direction: "row", gap: "sm", className: "dataviews-view-config__sort-controls", children: [ /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(SortFieldControl, {}), /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(SortDirectionControl, {}) ] } ), !!activeLayout?.viewConfigOptions && /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(activeLayout.viewConfigOptions, {}), /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(InfiniteScrollToggle, {}), /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(ItemsPerPageControl, {}), /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(PropertiesSection, {}) ] }) ] } ) } ) } ); } function _DataViewsViewConfig() { return /* @__PURE__ */ (0, import_jsx_runtime227.jsxs)(import_jsx_runtime227.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(ViewTypeMenu, {}), /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(DataviewsViewConfigDropdown, {}) ] }); } var DataViewsViewConfig = (0, import_element103.memo)(_DataViewsViewConfig); var dataviews_view_config_default = DataViewsViewConfig; // packages/dataviews/build-module/components/dataform-controls/checkbox.mjs var import_components119 = __toESM(require_components(), 1); var import_element104 = __toESM(require_element(), 1); // packages/dataviews/build-module/components/dataform-controls/utils/get-custom-validity.mjs function getCustomValidity(isValid2, validity) { let customValidity; if (isValid2?.required && validity?.required) { customValidity = validity?.required?.message ? validity.required : void 0; } else if (isValid2?.pattern && validity?.pattern) { customValidity = validity.pattern; } else if (isValid2?.min && validity?.min) { customValidity = validity.min; } else if (isValid2?.max && validity?.max) { customValidity = validity.max; } else if (isValid2?.minLength && validity?.minLength) { customValidity = validity.minLength; } else if (isValid2?.maxLength && validity?.maxLength) { customValidity = validity.maxLength; } else if (isValid2?.elements && validity?.elements) { customValidity = validity.elements; } else if (validity?.custom) { customValidity = validity.custom; } return customValidity; } // packages/dataviews/build-module/components/dataform-controls/checkbox.mjs var import_jsx_runtime228 = __toESM(require_jsx_runtime(), 1); var { ValidatedCheckboxControl } = unlock3(import_components119.privateApis); function Checkbox({ field, onChange, data, hideLabelFromVision, markWhenOptional, validity }) { const { getValue, setValue, label, description, isValid: isValid2 } = field; const onChangeControl = (0, import_element104.useCallback)(() => { onChange( setValue({ item: data, value: !getValue({ item: data }) }) ); }, [data, getValue, onChange, setValue]); return /* @__PURE__ */ (0, import_jsx_runtime228.jsx)( ValidatedCheckboxControl, { required: !!field.isValid?.required, markWhenOptional, customValidity: getCustomValidity(isValid2, validity), hidden: hideLabelFromVision, label, help: description, checked: getValue({ item: data }), onChange: onChangeControl } ); } // packages/dataviews/build-module/components/dataform-controls/combobox.mjs var import_components120 = __toESM(require_components(), 1); var import_element105 = __toESM(require_element(), 1); var import_jsx_runtime229 = __toESM(require_jsx_runtime(), 1); var { ValidatedComboboxControl } = unlock3(import_components120.privateApis); function Combobox3({ data, field, onChange, hideLabelFromVision, validity }) { const { label, description, placeholder, getValue, setValue, isValid: isValid2 } = field; const value = getValue({ item: data }) ?? ""; const onChangeControl = (0, import_element105.useCallback)( (newValue) => onChange(setValue({ item: data, value: newValue ?? "" })), [data, onChange, setValue] ); const { elements: elements2, isLoading } = useElements({ elements: field.elements, getElements: field.getElements }); if (isLoading) { return /* @__PURE__ */ (0, import_jsx_runtime229.jsx)(import_components120.Spinner, {}); } return /* @__PURE__ */ (0, import_jsx_runtime229.jsx)( ValidatedComboboxControl, { required: !!field.isValid?.required, customValidity: getCustomValidity(isValid2, validity), label, value, help: description, placeholder, options: elements2, onChange: onChangeControl, hideLabelFromVision, allowReset: true, expandOnFocus: true } ); } // packages/dataviews/build-module/components/dataform-controls/datetime.mjs var import_components122 = __toESM(require_components(), 1); var import_element107 = __toESM(require_element(), 1); var import_i18n115 = __toESM(require_i18n(), 1); var import_date4 = __toESM(require_date(), 1); // packages/dataviews/build-module/components/dataform-controls/utils/relative-date-control.mjs var import_components121 = __toESM(require_components(), 1); var import_element106 = __toESM(require_element(), 1); var import_i18n114 = __toESM(require_i18n(), 1); var import_jsx_runtime230 = __toESM(require_jsx_runtime(), 1); var TIME_UNITS_OPTIONS = { [OPERATOR_IN_THE_PAST]: [ { value: "days", label: (0, import_i18n114.__)("Days") }, { value: "weeks", label: (0, import_i18n114.__)("Weeks") }, { value: "months", label: (0, import_i18n114.__)("Months") }, { value: "years", label: (0, import_i18n114.__)("Years") } ], [OPERATOR_OVER]: [ { value: "days", label: (0, import_i18n114.__)("Days ago") }, { value: "weeks", label: (0, import_i18n114.__)("Weeks ago") }, { value: "months", label: (0, import_i18n114.__)("Months ago") }, { value: "years", label: (0, import_i18n114.__)("Years ago") } ] }; function RelativeDateControl({ className, data, field, onChange, hideLabelFromVision, operator }) { const options = TIME_UNITS_OPTIONS[operator === OPERATOR_IN_THE_PAST ? "inThePast" : "over"]; const { id, label, getValue, setValue } = field; const fieldValue = getValue({ item: data }); const { value: relValue = "", unit = options[0].value } = fieldValue && typeof fieldValue === "object" ? fieldValue : {}; const onChangeValue = (0, import_element106.useCallback)( (newValue) => onChange( setValue({ item: data, value: { value: Number(newValue), unit } }) ), [onChange, setValue, data, unit] ); const onChangeUnit = (0, import_element106.useCallback)( (newUnit) => onChange( setValue({ item: data, value: { value: relValue, unit: newUnit } }) ), [onChange, setValue, data, relValue] ); return /* @__PURE__ */ (0, import_jsx_runtime230.jsx)( import_components121.BaseControl, { id, className: clsx_default(className, "dataviews-controls__relative-date"), label, hideLabelFromVision, children: /* @__PURE__ */ (0, import_jsx_runtime230.jsxs)(Stack, { direction: "row", gap: "sm", children: [ /* @__PURE__ */ (0, import_jsx_runtime230.jsx)( import_components121.__experimentalNumberControl, { __next40pxDefaultSize: true, className: "dataviews-controls__relative-date-number", spinControls: "none", min: 1, step: 1, value: relValue, onChange: onChangeValue } ), /* @__PURE__ */ (0, import_jsx_runtime230.jsx)( import_components121.SelectControl, { className: "dataviews-controls__relative-date-unit", __next40pxDefaultSize: true, label: (0, import_i18n114.__)("Unit"), value: unit, options, onChange: onChangeUnit, hideLabelFromVision: true } ) ] }) } ); } // packages/dataviews/build-module/field-types/utils/parse-date-time.mjs var import_date3 = __toESM(require_date(), 1); function parseDateTime(dateTimeString) { if (!dateTimeString) { return null; } const parsed = (0, import_date3.getDate)(dateTimeString); return parsed && isValid(parsed) ? parsed : null; } // packages/dataviews/build-module/components/dataform-controls/datetime.mjs var import_jsx_runtime231 = __toESM(require_jsx_runtime(), 1); var { DateCalendar, ValidatedInputControl } = unlock3(import_components122.privateApis); var formatDateTime = (value) => { if (!value) { return ""; } return (0, import_date4.dateI18n)("Y-m-d\\TH:i", (0, import_date4.getDate)(value)); }; function CalendarDateTimeControl({ data, field, onChange, hideLabelFromVision, markWhenOptional, validity }) { const { id, label, description, setValue, getValue, isValid: isValid2 } = field; const fieldValue = getValue({ item: data }); const value = typeof fieldValue === "string" ? fieldValue : void 0; const [calendarMonth, setCalendarMonth] = (0, import_element107.useState)(() => { const parsedDate = parseDateTime(value); return parsedDate || /* @__PURE__ */ new Date(); }); const inputControlRef = (0, import_element107.useRef)(null); const validationTimeoutRef = (0, import_element107.useRef)(void 0); const previousFocusRef = (0, import_element107.useRef)(null); const onChangeCallback = (0, import_element107.useCallback)( (newValue) => onChange(setValue({ item: data, value: newValue })), [data, onChange, setValue] ); (0, import_element107.useEffect)(() => { return () => { if (validationTimeoutRef.current) { clearTimeout(validationTimeoutRef.current); } }; }, []); const onSelectDate = (0, import_element107.useCallback)( (newDate) => { let dateTimeValue; if (newDate) { const wpDate = (0, import_date4.dateI18n)("Y-m-d", newDate); let wpTime; if (value) { wpTime = (0, import_date4.dateI18n)("H:i", (0, import_date4.getDate)(value)); } else { wpTime = (0, import_date4.dateI18n)("H:i", newDate); } const finalDateTime = (0, import_date4.getDate)(`${wpDate}T${wpTime}`); dateTimeValue = finalDateTime.toISOString(); onChangeCallback(dateTimeValue); if (validationTimeoutRef.current) { clearTimeout(validationTimeoutRef.current); } } else { onChangeCallback(void 0); } previousFocusRef.current = inputControlRef.current && inputControlRef.current.ownerDocument.activeElement; validationTimeoutRef.current = setTimeout(() => { if (inputControlRef.current) { inputControlRef.current.focus(); inputControlRef.current.blur(); onChangeCallback(dateTimeValue); if (previousFocusRef.current && previousFocusRef.current instanceof HTMLElement) { previousFocusRef.current.focus(); } } }, 0); }, [onChangeCallback, value] ); const handleManualDateTimeChange = (0, import_element107.useCallback)( (newValue) => { if (newValue) { const dateTime = (0, import_date4.getDate)(newValue); onChangeCallback(dateTime.toISOString()); const parsedDate = parseDateTime(dateTime.toISOString()); if (parsedDate) { setCalendarMonth(parsedDate); } } else { onChangeCallback(void 0); } }, [onChangeCallback] ); const { format: fieldFormat } = field; const weekStartsOn = fieldFormat.weekStartsOn ?? (0, import_date4.getSettings)().l10n.startOfWeek; const { timezone: { string: timezoneString } } = (0, import_date4.getSettings)(); let displayLabel = label; if (isValid2?.required && !markWhenOptional && !hideLabelFromVision) { displayLabel = `${label} (${(0, import_i18n115.__)("Required")})`; } else if (!isValid2?.required && markWhenOptional && !hideLabelFromVision) { displayLabel = `${label} (${(0, import_i18n115.__)("Optional")})`; } return /* @__PURE__ */ (0, import_jsx_runtime231.jsx)( import_components122.BaseControl, { id, label: displayLabel, help: description, hideLabelFromVision, children: /* @__PURE__ */ (0, import_jsx_runtime231.jsxs)(Stack, { direction: "column", gap: "lg", children: [ /* @__PURE__ */ (0, import_jsx_runtime231.jsx)( DateCalendar, { style: { width: "100%" }, selected: value ? parseDateTime(value) || void 0 : void 0, onSelect: onSelectDate, month: calendarMonth, onMonthChange: setCalendarMonth, timeZone: timezoneString || void 0, weekStartsOn } ), /* @__PURE__ */ (0, import_jsx_runtime231.jsx)( ValidatedInputControl, { ref: inputControlRef, __next40pxDefaultSize: true, required: !!isValid2?.required, customValidity: getCustomValidity(isValid2, validity), type: "datetime-local", label: (0, import_i18n115.__)("Date time"), hideLabelFromVision: true, value: formatDateTime(value), onChange: handleManualDateTimeChange } ) ] }) } ); } function DateTime({ data, field, onChange, hideLabelFromVision, markWhenOptional, operator, validity }) { if (operator === OPERATOR_IN_THE_PAST || operator === OPERATOR_OVER) { return /* @__PURE__ */ (0, import_jsx_runtime231.jsx)( RelativeDateControl, { className: "dataviews-controls__datetime", data, field, onChange, hideLabelFromVision, operator } ); } return /* @__PURE__ */ (0, import_jsx_runtime231.jsx)( CalendarDateTimeControl, { data, field, onChange, hideLabelFromVision, markWhenOptional, validity } ); } // packages/dataviews/build-module/components/dataform-controls/date.mjs var import_components123 = __toESM(require_components(), 1); var import_element108 = __toESM(require_element(), 1); var import_i18n116 = __toESM(require_i18n(), 1); var import_date5 = __toESM(require_date(), 1); var import_jsx_runtime232 = __toESM(require_jsx_runtime(), 1); var { DateCalendar: DateCalendar2, DateRangeCalendar } = unlock3(import_components123.privateApis); var DATE_PRESETS = [ { id: "today", label: (0, import_i18n116.__)("Today"), getValue: () => (0, import_date5.getDate)(null) }, { id: "yesterday", label: (0, import_i18n116.__)("Yesterday"), getValue: () => { const today = (0, import_date5.getDate)(null); return subDays(today, 1); } }, { id: "past-week", label: (0, import_i18n116.__)("Past week"), getValue: () => { const today = (0, import_date5.getDate)(null); return subDays(today, 7); } }, { id: "past-month", label: (0, import_i18n116.__)("Past month"), getValue: () => { const today = (0, import_date5.getDate)(null); return subMonths(today, 1); } } ]; var DATE_RANGE_PRESETS = [ { id: "last-7-days", label: (0, import_i18n116.__)("Last 7 days"), getValue: () => { const today = (0, import_date5.getDate)(null); return [subDays(today, 7), today]; } }, { id: "last-30-days", label: (0, import_i18n116.__)("Last 30 days"), getValue: () => { const today = (0, import_date5.getDate)(null); return [subDays(today, 30), today]; } }, { id: "month-to-date", label: (0, import_i18n116.__)("Month to date"), getValue: () => { const today = (0, import_date5.getDate)(null); return [startOfMonth(today), today]; } }, { id: "last-year", label: (0, import_i18n116.__)("Last year"), getValue: () => { const today = (0, import_date5.getDate)(null); return [subYears(today, 1), today]; } }, { id: "year-to-date", label: (0, import_i18n116.__)("Year to date"), getValue: () => { const today = (0, import_date5.getDate)(null); return [startOfYear(today), today]; } } ]; var parseDate = (dateString) => { if (!dateString) { return null; } const parsed = (0, import_date5.getDate)(dateString); return parsed && isValid(parsed) ? parsed : null; }; var formatDate = (date) => { if (!date) { return ""; } return typeof date === "string" ? date : format(date, "yyyy-MM-dd"); }; function ValidatedDateControl({ field, validity, inputRefs, isTouched, setIsTouched, children }) { const { isValid: isValid2 } = field; const [customValidity, setCustomValidity] = (0, import_element108.useState)(void 0); const validateRefs = (0, import_element108.useCallback)(() => { const refs = Array.isArray(inputRefs) ? inputRefs : [inputRefs]; for (const ref of refs) { const input = ref.current; if (input && !input.validity.valid) { setCustomValidity({ type: "invalid", message: input.validationMessage }); return; } } setCustomValidity(void 0); }, [inputRefs]); (0, import_element108.useEffect)(() => { const refs = Array.isArray(inputRefs) ? inputRefs : [inputRefs]; const result = validity ? getCustomValidity(isValid2, validity) : void 0; for (const ref of refs) { const input = ref.current; if (input) { input.setCustomValidity( result?.type === "invalid" && result.message ? result.message : "" ); } } }, [inputRefs, isValid2, validity]); (0, import_element108.useEffect)(() => { const refs = Array.isArray(inputRefs) ? inputRefs : [inputRefs]; const handleInvalid = (event) => { event.preventDefault(); setIsTouched(true); }; for (const ref of refs) { ref.current?.addEventListener("invalid", handleInvalid); } return () => { for (const ref of refs) { ref.current?.removeEventListener("invalid", handleInvalid); } }; }, [inputRefs, setIsTouched]); (0, import_element108.useEffect)(() => { if (!isTouched) { return; } const result = validity ? getCustomValidity(isValid2, validity) : void 0; if (result) { setCustomValidity(result); } else { validateRefs(); } }, [isTouched, isValid2, validity, validateRefs]); const onBlur = (event) => { if (isTouched) { return; } if (!event.relatedTarget || !event.currentTarget.contains(event.relatedTarget)) { setIsTouched(true); } }; return /* @__PURE__ */ (0, import_jsx_runtime232.jsxs)("div", { onBlur, children: [ children, /* @__PURE__ */ (0, import_jsx_runtime232.jsx)("div", { "aria-live": "polite", children: customValidity && /* @__PURE__ */ (0, import_jsx_runtime232.jsxs)( "p", { className: clsx_default( "components-validated-control__indicator", customValidity.type === "invalid" ? "is-invalid" : void 0 ), children: [ /* @__PURE__ */ (0, import_jsx_runtime232.jsx)( import_components123.Icon, { className: "components-validated-control__indicator-icon", icon: error_default, size: 16, fill: "currentColor" } ), customValidity.message ] } ) }) ] }); } function CalendarDateControl({ data, field, onChange, hideLabelFromVision, markWhenOptional, validity }) { const { id, label, setValue, getValue, isValid: isValid2, format: fieldFormat } = field; const [selectedPresetId, setSelectedPresetId] = (0, import_element108.useState)( null ); const weekStartsOn = fieldFormat.weekStartsOn ?? (0, import_date5.getSettings)().l10n.startOfWeek; const fieldValue = getValue({ item: data }); const value = typeof fieldValue === "string" ? fieldValue : void 0; const [calendarMonth, setCalendarMonth] = (0, import_element108.useState)(() => { const parsedDate = parseDate(value); return parsedDate || /* @__PURE__ */ new Date(); }); const [isTouched, setIsTouched] = (0, import_element108.useState)(false); const validityTargetRef = (0, import_element108.useRef)(null); const onChangeCallback = (0, import_element108.useCallback)( (newValue) => onChange(setValue({ item: data, value: newValue })), [data, onChange, setValue] ); const onSelectDate = (0, import_element108.useCallback)( (newDate) => { const dateValue = newDate ? format(newDate, "yyyy-MM-dd") : void 0; onChangeCallback(dateValue); setSelectedPresetId(null); setIsTouched(true); }, [onChangeCallback] ); const handlePresetClick = (0, import_element108.useCallback)( (preset) => { const presetDate = preset.getValue(); const dateValue = formatDate(presetDate); setCalendarMonth(presetDate); onChangeCallback(dateValue); setSelectedPresetId(preset.id); setIsTouched(true); }, [onChangeCallback] ); const handleManualDateChange = (0, import_element108.useCallback)( (newValue) => { onChangeCallback(newValue); if (newValue) { const parsedDate = parseDate(newValue); if (parsedDate) { setCalendarMonth(parsedDate); } } setSelectedPresetId(null); setIsTouched(true); }, [onChangeCallback] ); const { timezone: { string: timezoneString } } = (0, import_date5.getSettings)(); let displayLabel = label; if (isValid2?.required && !markWhenOptional) { displayLabel = `${label} (${(0, import_i18n116.__)("Required")})`; } else if (!isValid2?.required && markWhenOptional) { displayLabel = `${label} (${(0, import_i18n116.__)("Optional")})`; } return /* @__PURE__ */ (0, import_jsx_runtime232.jsx)( ValidatedDateControl, { field, validity, inputRefs: validityTargetRef, isTouched, setIsTouched, children: /* @__PURE__ */ (0, import_jsx_runtime232.jsx)( import_components123.BaseControl, { id, className: "dataviews-controls__date", label: displayLabel, hideLabelFromVision, children: /* @__PURE__ */ (0, import_jsx_runtime232.jsxs)(Stack, { direction: "column", gap: "lg", children: [ /* @__PURE__ */ (0, import_jsx_runtime232.jsxs)( Stack, { direction: "row", gap: "sm", wrap: "wrap", justify: "flex-start", children: [ DATE_PRESETS.map((preset) => { const isSelected2 = selectedPresetId === preset.id; return /* @__PURE__ */ (0, import_jsx_runtime232.jsx)( import_components123.Button, { className: "dataviews-controls__date-preset", variant: "tertiary", isPressed: isSelected2, size: "small", onClick: () => handlePresetClick(preset), children: preset.label }, preset.id ); }), /* @__PURE__ */ (0, import_jsx_runtime232.jsx)( import_components123.Button, { className: "dataviews-controls__date-preset", variant: "tertiary", isPressed: !selectedPresetId, size: "small", disabled: !!selectedPresetId, accessibleWhenDisabled: false, children: (0, import_i18n116.__)("Custom") } ) ] } ), /* @__PURE__ */ (0, import_jsx_runtime232.jsx)( import_components123.__experimentalInputControl, { __next40pxDefaultSize: true, ref: validityTargetRef, type: "date", label: (0, import_i18n116.__)("Date"), hideLabelFromVision: true, value, onChange: handleManualDateChange, required: !!field.isValid?.required } ), /* @__PURE__ */ (0, import_jsx_runtime232.jsx)( DateCalendar2, { style: { width: "100%" }, selected: value ? parseDate(value) || void 0 : void 0, onSelect: onSelectDate, month: calendarMonth, onMonthChange: setCalendarMonth, timeZone: timezoneString || void 0, weekStartsOn } ) ] }) } ) } ); } function CalendarDateRangeControl({ data, field, onChange, hideLabelFromVision, markWhenOptional, validity }) { const { id, label, getValue, setValue, format: fieldFormat } = field; let value; const fieldValue = getValue({ item: data }); if (Array.isArray(fieldValue) && fieldValue.length === 2 && fieldValue.every((date) => typeof date === "string")) { value = fieldValue; } const weekStartsOn = fieldFormat.weekStartsOn ?? (0, import_date5.getSettings)().l10n.startOfWeek; const onChangeCallback = (0, import_element108.useCallback)( (newValue) => { onChange( setValue({ item: data, value: newValue }) ); }, [data, onChange, setValue] ); const [selectedPresetId, setSelectedPresetId] = (0, import_element108.useState)( null ); const selectedRange = (0, import_element108.useMemo)(() => { if (!value) { return { from: void 0, to: void 0 }; } const [from, to2] = value; return { from: parseDate(from) || void 0, to: parseDate(to2) || void 0 }; }, [value]); const [calendarMonth, setCalendarMonth] = (0, import_element108.useState)(() => { return selectedRange.from || /* @__PURE__ */ new Date(); }); const [isTouched, setIsTouched] = (0, import_element108.useState)(false); const fromInputRef = (0, import_element108.useRef)(null); const toInputRef = (0, import_element108.useRef)(null); const updateDateRange = (0, import_element108.useCallback)( (fromDate, toDate2) => { if (fromDate && toDate2) { onChangeCallback([ formatDate(fromDate), formatDate(toDate2) ]); } else if (!fromDate && !toDate2) { onChangeCallback(void 0); } }, [onChangeCallback] ); const onSelectCalendarRange = (0, import_element108.useCallback)( (newRange) => { updateDateRange(newRange?.from, newRange?.to); setSelectedPresetId(null); setIsTouched(true); }, [updateDateRange] ); const handlePresetClick = (0, import_element108.useCallback)( (preset) => { const [startDate2, endDate] = preset.getValue(); setCalendarMonth(startDate2); updateDateRange(startDate2, endDate); setSelectedPresetId(preset.id); setIsTouched(true); }, [updateDateRange] ); const handleManualDateChange = (0, import_element108.useCallback)( (fromOrTo, newValue) => { const [currentFrom, currentTo] = value || [ void 0, void 0 ]; const updatedFrom = fromOrTo === "from" ? newValue : currentFrom; const updatedTo = fromOrTo === "to" ? newValue : currentTo; updateDateRange(updatedFrom, updatedTo); if (newValue) { const parsedDate = parseDate(newValue); if (parsedDate) { setCalendarMonth(parsedDate); } } setSelectedPresetId(null); setIsTouched(true); }, [value, updateDateRange] ); const { timezone } = (0, import_date5.getSettings)(); let displayLabel = label; if (field.isValid?.required && !markWhenOptional) { displayLabel = `${label} (${(0, import_i18n116.__)("Required")})`; } else if (!field.isValid?.required && markWhenOptional) { displayLabel = `${label} (${(0, import_i18n116.__)("Optional")})`; } return /* @__PURE__ */ (0, import_jsx_runtime232.jsx)( ValidatedDateControl, { field, validity, inputRefs: [fromInputRef, toInputRef], isTouched, setIsTouched, children: /* @__PURE__ */ (0, import_jsx_runtime232.jsx)( import_components123.BaseControl, { id, className: "dataviews-controls__date", label: displayLabel, hideLabelFromVision, children: /* @__PURE__ */ (0, import_jsx_runtime232.jsxs)(Stack, { direction: "column", gap: "lg", children: [ /* @__PURE__ */ (0, import_jsx_runtime232.jsxs)( Stack, { direction: "row", gap: "sm", wrap: "wrap", justify: "flex-start", children: [ DATE_RANGE_PRESETS.map((preset) => { const isSelected2 = selectedPresetId === preset.id; return /* @__PURE__ */ (0, import_jsx_runtime232.jsx)( import_components123.Button, { className: "dataviews-controls__date-preset", variant: "tertiary", isPressed: isSelected2, size: "small", onClick: () => handlePresetClick(preset), children: preset.label }, preset.id ); }), /* @__PURE__ */ (0, import_jsx_runtime232.jsx)( import_components123.Button, { className: "dataviews-controls__date-preset", variant: "tertiary", isPressed: !selectedPresetId, size: "small", accessibleWhenDisabled: false, disabled: !!selectedPresetId, children: (0, import_i18n116.__)("Custom") } ) ] } ), /* @__PURE__ */ (0, import_jsx_runtime232.jsxs)( Stack, { direction: "row", gap: "sm", justify: "space-between", className: "dataviews-controls__date-range-inputs", children: [ /* @__PURE__ */ (0, import_jsx_runtime232.jsx)( import_components123.__experimentalInputControl, { __next40pxDefaultSize: true, ref: fromInputRef, type: "date", label: (0, import_i18n116.__)("From"), hideLabelFromVision: true, value: value?.[0], onChange: (newValue) => handleManualDateChange("from", newValue), required: !!field.isValid?.required } ), /* @__PURE__ */ (0, import_jsx_runtime232.jsx)( import_components123.__experimentalInputControl, { __next40pxDefaultSize: true, ref: toInputRef, type: "date", label: (0, import_i18n116.__)("To"), hideLabelFromVision: true, value: value?.[1], onChange: (newValue) => handleManualDateChange("to", newValue), required: !!field.isValid?.required } ) ] } ), /* @__PURE__ */ (0, import_jsx_runtime232.jsx)( DateRangeCalendar, { style: { width: "100%" }, selected: selectedRange, onSelect: onSelectCalendarRange, month: calendarMonth, onMonthChange: setCalendarMonth, timeZone: timezone.string || void 0, weekStartsOn } ) ] }) } ) } ); } function DateControl({ data, field, onChange, hideLabelFromVision, markWhenOptional, operator, validity }) { if (operator === OPERATOR_IN_THE_PAST || operator === OPERATOR_OVER) { return /* @__PURE__ */ (0, import_jsx_runtime232.jsx)( RelativeDateControl, { className: "dataviews-controls__date", data, field, onChange, hideLabelFromVision, operator } ); } if (operator === OPERATOR_BETWEEN) { return /* @__PURE__ */ (0, import_jsx_runtime232.jsx)( CalendarDateRangeControl, { data, field, onChange, hideLabelFromVision, markWhenOptional, validity } ); } return /* @__PURE__ */ (0, import_jsx_runtime232.jsx)( CalendarDateControl, { data, field, onChange, hideLabelFromVision, markWhenOptional, validity } ); } // packages/dataviews/build-module/components/dataform-controls/select.mjs var import_components124 = __toESM(require_components(), 1); var import_element109 = __toESM(require_element(), 1); var import_jsx_runtime233 = __toESM(require_jsx_runtime(), 1); var { ValidatedSelectControl } = unlock3(import_components124.privateApis); function Select({ data, field, onChange, hideLabelFromVision, markWhenOptional, validity }) { const { type, label, description, getValue, setValue, isValid: isValid2 } = field; const isMultiple = type === "array"; const value = getValue({ item: data }) ?? (isMultiple ? [] : ""); const onChangeControl = (0, import_element109.useCallback)( (newValue) => onChange(setValue({ item: data, value: newValue })), [data, onChange, setValue] ); const { elements: elements2, isLoading } = useElements({ elements: field.elements, getElements: field.getElements }); if (isLoading) { return /* @__PURE__ */ (0, import_jsx_runtime233.jsx)(import_components124.Spinner, {}); } return /* @__PURE__ */ (0, import_jsx_runtime233.jsx)( ValidatedSelectControl, { required: !!field.isValid?.required, markWhenOptional, customValidity: getCustomValidity(isValid2, validity), label, value, help: description, options: elements2, onChange: onChangeControl, __next40pxDefaultSize: true, hideLabelFromVision, multiple: isMultiple } ); } // packages/dataviews/build-module/components/dataform-controls/adaptive-select.mjs var import_jsx_runtime234 = __toESM(require_jsx_runtime(), 1); var ELEMENTS_THRESHOLD = 10; function AdaptiveSelect(props) { const { field } = props; const { elements: elements2 } = useElements({ elements: field.elements, getElements: field.getElements }); if (elements2.length >= ELEMENTS_THRESHOLD) { return /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(Combobox3, { ...props }); } return /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(Select, { ...props }); } // packages/dataviews/build-module/components/dataform-controls/email.mjs var import_components126 = __toESM(require_components(), 1); // packages/dataviews/build-module/components/dataform-controls/utils/validated-input.mjs var import_components125 = __toESM(require_components(), 1); var import_element110 = __toESM(require_element(), 1); var import_jsx_runtime235 = __toESM(require_jsx_runtime(), 1); var { ValidatedInputControl: ValidatedInputControl2 } = unlock3(import_components125.privateApis); function ValidatedText({ data, field, onChange, hideLabelFromVision, markWhenOptional, type, prefix: prefix2, suffix, validity }) { const { label, placeholder, description, getValue, setValue, isValid: isValid2 } = field; const value = getValue({ item: data }); const onChangeControl = (0, import_element110.useCallback)( (newValue) => onChange( setValue({ item: data, value: newValue }) ), [data, setValue, onChange] ); return /* @__PURE__ */ (0, import_jsx_runtime235.jsx)( ValidatedInputControl2, { required: !!isValid2.required, markWhenOptional, customValidity: getCustomValidity(isValid2, validity), label, placeholder, value: value ?? "", help: description, onChange: onChangeControl, hideLabelFromVision, type, prefix: prefix2, suffix, pattern: isValid2.pattern ? isValid2.pattern.constraint : void 0, minLength: isValid2.minLength ? isValid2.minLength.constraint : void 0, maxLength: isValid2.maxLength ? isValid2.maxLength.constraint : void 0, __next40pxDefaultSize: true } ); } // packages/dataviews/build-module/components/dataform-controls/email.mjs var import_jsx_runtime236 = __toESM(require_jsx_runtime(), 1); function Email({ data, field, onChange, hideLabelFromVision, markWhenOptional, validity }) { return /* @__PURE__ */ (0, import_jsx_runtime236.jsx)( ValidatedText, { ...{ data, field, onChange, hideLabelFromVision, markWhenOptional, validity, type: "email", prefix: /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(import_components126.__experimentalInputControlPrefixWrapper, { variant: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(import_components126.Icon, { icon: envelope_default }) }) } } ); } // packages/dataviews/build-module/components/dataform-controls/telephone.mjs var import_components127 = __toESM(require_components(), 1); var import_jsx_runtime237 = __toESM(require_jsx_runtime(), 1); function Telephone({ data, field, onChange, hideLabelFromVision, markWhenOptional, validity }) { return /* @__PURE__ */ (0, import_jsx_runtime237.jsx)( ValidatedText, { ...{ data, field, onChange, hideLabelFromVision, markWhenOptional, validity, type: "tel", prefix: /* @__PURE__ */ (0, import_jsx_runtime237.jsx)(import_components127.__experimentalInputControlPrefixWrapper, { variant: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime237.jsx)(import_components127.Icon, { icon: mobile_default }) }) } } ); } // packages/dataviews/build-module/components/dataform-controls/url.mjs var import_components128 = __toESM(require_components(), 1); var import_jsx_runtime238 = __toESM(require_jsx_runtime(), 1); function Url({ data, field, onChange, hideLabelFromVision, markWhenOptional, validity }) { return /* @__PURE__ */ (0, import_jsx_runtime238.jsx)( ValidatedText, { ...{ data, field, onChange, hideLabelFromVision, markWhenOptional, validity, type: "url", prefix: /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(import_components128.__experimentalInputControlPrefixWrapper, { variant: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(import_components128.Icon, { icon: link_default }) }) } } ); } // packages/dataviews/build-module/components/dataform-controls/utils/validated-number.mjs var import_components129 = __toESM(require_components(), 1); var import_element111 = __toESM(require_element(), 1); var import_i18n117 = __toESM(require_i18n(), 1); var import_jsx_runtime239 = __toESM(require_jsx_runtime(), 1); var { ValidatedNumberControl } = unlock3(import_components129.privateApis); function toNumberOrEmpty(value) { if (value === "" || value === void 0) { return ""; } const number = Number(value); return Number.isFinite(number) ? number : ""; } function BetweenControls({ value, onChange, hideLabelFromVision, step }) { const [min = "", max = ""] = value; const onChangeMin = (0, import_element111.useCallback)( (newValue) => onChange([toNumberOrEmpty(newValue), max]), [onChange, max] ); const onChangeMax = (0, import_element111.useCallback)( (newValue) => onChange([min, toNumberOrEmpty(newValue)]), [onChange, min] ); return /* @__PURE__ */ (0, import_jsx_runtime239.jsx)( import_components129.BaseControl, { help: (0, import_i18n117.__)("The max. value must be greater than the min. value."), children: /* @__PURE__ */ (0, import_jsx_runtime239.jsxs)(import_components129.Flex, { direction: "row", gap: 4, children: [ /* @__PURE__ */ (0, import_jsx_runtime239.jsx)( import_components129.__experimentalNumberControl, { label: (0, import_i18n117.__)("Min."), value: min, max: max ? Number(max) - step : void 0, onChange: onChangeMin, __next40pxDefaultSize: true, hideLabelFromVision, step } ), /* @__PURE__ */ (0, import_jsx_runtime239.jsx)( import_components129.__experimentalNumberControl, { label: (0, import_i18n117.__)("Max."), value: max, min: min ? Number(min) + step : void 0, onChange: onChangeMax, __next40pxDefaultSize: true, hideLabelFromVision, step } ) ] }) } ); } function ValidatedNumber({ data, field, onChange, hideLabelFromVision, markWhenOptional, operator, validity }) { const decimals = field.format?.decimals ?? 0; const step = Math.pow(10, Math.abs(decimals) * -1); const { label, description, getValue, setValue, isValid: isValid2 } = field; const value = getValue({ item: data }) ?? ""; const onChangeControl = (0, import_element111.useCallback)( (newValue) => { onChange( setValue({ item: data, // Do not convert an empty string or undefined to a number, // otherwise there's a mismatch between the UI control (empty) // and the data relied by onChange (0). value: ["", void 0].includes(newValue) ? void 0 : Number(newValue) }) ); }, [data, onChange, setValue] ); const onChangeBetweenControls = (0, import_element111.useCallback)( (newValue) => { onChange( setValue({ item: data, value: newValue }) ); }, [data, onChange, setValue] ); if (operator === OPERATOR_BETWEEN) { let valueBetween = ["", ""]; if (Array.isArray(value) && value.length === 2 && value.every( (element) => typeof element === "number" || element === "" )) { valueBetween = value; } return /* @__PURE__ */ (0, import_jsx_runtime239.jsx)( BetweenControls, { value: valueBetween, onChange: onChangeBetweenControls, hideLabelFromVision, step } ); } return /* @__PURE__ */ (0, import_jsx_runtime239.jsx)( ValidatedNumberControl, { required: !!isValid2.required, markWhenOptional, customValidity: getCustomValidity(isValid2, validity), label, help: description, value, onChange: onChangeControl, __next40pxDefaultSize: true, hideLabelFromVision, step, min: isValid2.min ? isValid2.min.constraint : void 0, max: isValid2.max ? isValid2.max.constraint : void 0 } ); } // packages/dataviews/build-module/components/dataform-controls/integer.mjs var import_jsx_runtime240 = __toESM(require_jsx_runtime(), 1); function Integer(props) { return /* @__PURE__ */ (0, import_jsx_runtime240.jsx)(ValidatedNumber, { ...props }); } // packages/dataviews/build-module/components/dataform-controls/number.mjs var import_jsx_runtime241 = __toESM(require_jsx_runtime(), 1); function Number2(props) { return /* @__PURE__ */ (0, import_jsx_runtime241.jsx)(ValidatedNumber, { ...props }); } // packages/dataviews/build-module/components/dataform-controls/radio.mjs var import_components130 = __toESM(require_components(), 1); var import_element112 = __toESM(require_element(), 1); var import_jsx_runtime242 = __toESM(require_jsx_runtime(), 1); var { ValidatedRadioControl } = unlock3(import_components130.privateApis); function Radio({ data, field, onChange, hideLabelFromVision, markWhenOptional, validity }) { const { label, description, getValue, setValue, isValid: isValid2 } = field; const { elements: elements2, isLoading } = useElements({ elements: field.elements, getElements: field.getElements }); const value = getValue({ item: data }); const onChangeControl = (0, import_element112.useCallback)( (newValue) => onChange(setValue({ item: data, value: newValue })), [data, onChange, setValue] ); if (isLoading) { return /* @__PURE__ */ (0, import_jsx_runtime242.jsx)(import_components130.Spinner, {}); } return /* @__PURE__ */ (0, import_jsx_runtime242.jsx)( ValidatedRadioControl, { required: !!field.isValid?.required, markWhenOptional, customValidity: getCustomValidity(isValid2, validity), label, help: description, onChange: onChangeControl, options: elements2, selected: value, hideLabelFromVision } ); } // packages/dataviews/build-module/components/dataform-controls/text.mjs var import_element113 = __toESM(require_element(), 1); var import_jsx_runtime243 = __toESM(require_jsx_runtime(), 1); function Text12({ data, field, onChange, hideLabelFromVision, markWhenOptional, config: config2, validity }) { const { prefix: prefix2, suffix } = config2 || {}; return /* @__PURE__ */ (0, import_jsx_runtime243.jsx)( ValidatedText, { ...{ data, field, onChange, hideLabelFromVision, markWhenOptional, validity, prefix: prefix2 ? (0, import_element113.createElement)(prefix2) : void 0, suffix: suffix ? (0, import_element113.createElement)(suffix) : void 0 } } ); } // packages/dataviews/build-module/components/dataform-controls/toggle.mjs var import_components131 = __toESM(require_components(), 1); var import_element114 = __toESM(require_element(), 1); var import_jsx_runtime244 = __toESM(require_jsx_runtime(), 1); var { ValidatedToggleControl } = unlock3(import_components131.privateApis); function Toggle({ field, onChange, data, hideLabelFromVision, markWhenOptional, validity }) { const { label, description, getValue, setValue, isValid: isValid2 } = field; const onChangeControl = (0, import_element114.useCallback)(() => { onChange( setValue({ item: data, value: !getValue({ item: data }) }) ); }, [onChange, setValue, data, getValue]); return /* @__PURE__ */ (0, import_jsx_runtime244.jsx)( ValidatedToggleControl, { required: !!isValid2.required, markWhenOptional, customValidity: getCustomValidity(isValid2, validity), hidden: hideLabelFromVision, label, help: description, checked: getValue({ item: data }), onChange: onChangeControl } ); } // packages/dataviews/build-module/components/dataform-controls/textarea.mjs var import_components132 = __toESM(require_components(), 1); var import_element115 = __toESM(require_element(), 1); var import_jsx_runtime245 = __toESM(require_jsx_runtime(), 1); var { ValidatedTextareaControl } = unlock3(import_components132.privateApis); function Textarea({ data, field, onChange, hideLabelFromVision, markWhenOptional, config: config2, validity }) { const { rows = 4 } = config2 || {}; const { label, placeholder, description, setValue, isValid: isValid2 } = field; const value = field.getValue({ item: data }); const onChangeControl = (0, import_element115.useCallback)( (newValue) => onChange(setValue({ item: data, value: newValue })), [data, onChange, setValue] ); return /* @__PURE__ */ (0, import_jsx_runtime245.jsx)( ValidatedTextareaControl, { required: !!isValid2.required, markWhenOptional, customValidity: getCustomValidity(isValid2, validity), label, placeholder, value: value ?? "", help: description, onChange: onChangeControl, rows, minLength: isValid2.minLength ? isValid2.minLength.constraint : void 0, maxLength: isValid2.maxLength ? isValid2.maxLength.constraint : void 0, __next40pxDefaultSize: true, hideLabelFromVision } ); } // packages/dataviews/build-module/components/dataform-controls/toggle-group.mjs var import_components133 = __toESM(require_components(), 1); var import_element116 = __toESM(require_element(), 1); var import_jsx_runtime246 = __toESM(require_jsx_runtime(), 1); var { ValidatedToggleGroupControl } = unlock3(import_components133.privateApis); function ToggleGroup({ data, field, onChange, hideLabelFromVision, markWhenOptional, validity }) { const { getValue, setValue, isValid: isValid2 } = field; const value = getValue({ item: data }); const onChangeControl = (0, import_element116.useCallback)( (newValue) => onChange(setValue({ item: data, value: newValue })), [data, onChange, setValue] ); const { elements: elements2, isLoading } = useElements({ elements: field.elements, getElements: field.getElements }); if (isLoading) { return /* @__PURE__ */ (0, import_jsx_runtime246.jsx)(import_components133.Spinner, {}); } if (elements2.length === 0) { return null; } const selectedOption = elements2.find((el) => el.value === value); return /* @__PURE__ */ (0, import_jsx_runtime246.jsx)( ValidatedToggleGroupControl, { required: !!field.isValid?.required, markWhenOptional, customValidity: getCustomValidity(isValid2, validity), __next40pxDefaultSize: true, isBlock: true, label: field.label, help: selectedOption?.description || field.description, onChange: onChangeControl, value, hideLabelFromVision, children: elements2.map((el) => /* @__PURE__ */ (0, import_jsx_runtime246.jsx)( import_components133.__experimentalToggleGroupControlOption, { label: el.label, value: el.value }, el.value )) } ); } // packages/dataviews/build-module/components/dataform-controls/array.mjs var import_components134 = __toESM(require_components(), 1); var import_element117 = __toESM(require_element(), 1); var import_jsx_runtime247 = __toESM(require_jsx_runtime(), 1); var { ValidatedFormTokenField } = unlock3(import_components134.privateApis); function ArrayControl({ data, field, onChange, hideLabelFromVision, markWhenOptional, validity }) { const { label, placeholder, getValue, setValue, isValid: isValid2 } = field; const value = getValue({ item: data }); const { elements: elements2, isLoading } = useElements({ elements: field.elements, getElements: field.getElements }); const arrayValueAsElements = (0, import_element117.useMemo)( () => Array.isArray(value) ? value.map((token) => { const element = elements2?.find( (suggestion) => suggestion.value === token ); return element || { value: token, label: token }; }) : [], [value, elements2] ); const onChangeControl = (0, import_element117.useCallback)( (tokens) => { const valueTokens = tokens.map((token) => { if (typeof token === "object" && "value" in token) { return token.value; } return token; }); onChange(setValue({ item: data, value: valueTokens })); }, [onChange, setValue, data] ); if (isLoading) { return /* @__PURE__ */ (0, import_jsx_runtime247.jsx)(import_components134.Spinner, {}); } return /* @__PURE__ */ (0, import_jsx_runtime247.jsx)( ValidatedFormTokenField, { required: !!isValid2?.required, markWhenOptional, customValidity: getCustomValidity(isValid2, validity), label: hideLabelFromVision ? void 0 : label, value: arrayValueAsElements, onChange: onChangeControl, placeholder, suggestions: elements2?.map((element) => element.value), __experimentalValidateInput: (token) => { if (field.isValid?.elements && elements2) { return elements2.some( (element) => element.value === token || element.label === token ); } return true; }, __experimentalExpandOnFocus: elements2 && elements2.length > 0, __experimentalShowHowTo: !field.isValid?.elements, displayTransform: (token) => { if (typeof token === "object" && "label" in token) { return token.label; } if (typeof token === "string" && elements2) { const element = elements2.find( (el) => el.value === token ); return element?.label || token; } return token; }, __experimentalRenderItem: ({ item }) => { if (typeof item === "string" && elements2) { const element = elements2.find( (el) => el.value === item ); return /* @__PURE__ */ (0, import_jsx_runtime247.jsx)("span", { children: element?.label || item }); } return /* @__PURE__ */ (0, import_jsx_runtime247.jsx)("span", { children: item }); } } ); } // packages/dataviews/build-module/components/dataform-controls/color.mjs var import_components135 = __toESM(require_components(), 1); var import_element118 = __toESM(require_element(), 1); var import_i18n118 = __toESM(require_i18n(), 1); var import_jsx_runtime248 = __toESM(require_jsx_runtime(), 1); var { ValidatedInputControl: ValidatedInputControl3 } = unlock3(import_components135.privateApis); var ColorPickerDropdown = ({ color, onColorChange }) => { const validColor = color && w(color).isValid() ? color : "#ffffff"; return /* @__PURE__ */ (0, import_jsx_runtime248.jsx)( import_components135.Dropdown, { className: "dataviews-controls__color-picker-dropdown", popoverProps: { resize: false }, renderToggle: ({ onToggle }) => /* @__PURE__ */ (0, import_jsx_runtime248.jsx)( import_components135.Button, { onClick: onToggle, "aria-label": (0, import_i18n118.__)("Open color picker"), size: "small", icon: () => /* @__PURE__ */ (0, import_jsx_runtime248.jsx)(import_components135.ColorIndicator, { colorValue: validColor }) } ), renderContent: () => /* @__PURE__ */ (0, import_jsx_runtime248.jsx)(import_components135.__experimentalDropdownContentWrapper, { paddingSize: "none", children: /* @__PURE__ */ (0, import_jsx_runtime248.jsx)( import_components135.ColorPicker, { color: validColor, onChange: onColorChange, enableAlpha: true } ) }) } ); }; function Color({ data, field, onChange, hideLabelFromVision, markWhenOptional, validity }) { const { label, placeholder, description, setValue, isValid: isValid2 } = field; const value = field.getValue({ item: data }) || ""; const handleColorChange = (0, import_element118.useCallback)( (newColor) => { onChange(setValue({ item: data, value: newColor })); }, [data, onChange, setValue] ); const handleInputChange = (0, import_element118.useCallback)( (newValue) => { onChange(setValue({ item: data, value: newValue || "" })); }, [data, onChange, setValue] ); return /* @__PURE__ */ (0, import_jsx_runtime248.jsx)( ValidatedInputControl3, { required: !!field.isValid?.required, markWhenOptional, customValidity: getCustomValidity(isValid2, validity), label, placeholder, value, help: description, onChange: handleInputChange, hideLabelFromVision, type: "text", prefix: /* @__PURE__ */ (0, import_jsx_runtime248.jsx)(import_components135.__experimentalInputControlPrefixWrapper, { variant: "control", children: /* @__PURE__ */ (0, import_jsx_runtime248.jsx)( ColorPickerDropdown, { color: value, onColorChange: handleColorChange } ) }) } ); } // packages/dataviews/build-module/components/dataform-controls/password.mjs var import_components136 = __toESM(require_components(), 1); var import_element119 = __toESM(require_element(), 1); var import_i18n119 = __toESM(require_i18n(), 1); var import_jsx_runtime249 = __toESM(require_jsx_runtime(), 1); function Password({ data, field, onChange, hideLabelFromVision, markWhenOptional, validity }) { const [isVisible2, setIsVisible] = (0, import_element119.useState)(false); const toggleVisibility = (0, import_element119.useCallback)(() => { setIsVisible((prev) => !prev); }, []); return /* @__PURE__ */ (0, import_jsx_runtime249.jsx)( ValidatedText, { ...{ data, field, onChange, hideLabelFromVision, markWhenOptional, validity, type: isVisible2 ? "text" : "password", suffix: /* @__PURE__ */ (0, import_jsx_runtime249.jsx)(import_components136.__experimentalInputControlSuffixWrapper, { variant: "control", children: /* @__PURE__ */ (0, import_jsx_runtime249.jsx)( import_components136.Button, { icon: isVisible2 ? unseen_default : seen_default, onClick: toggleVisibility, size: "small", label: isVisible2 ? (0, import_i18n119.__)("Hide password") : (0, import_i18n119.__)("Show password") } ) }) } } ); } // packages/dataviews/build-module/field-types/utils/has-elements.mjs function hasElements(field) { return Array.isArray(field.elements) && field.elements.length > 0 || typeof field.getElements === "function"; } // packages/dataviews/build-module/components/dataform-controls/index.mjs var import_jsx_runtime250 = __toESM(require_jsx_runtime(), 1); var FORM_CONTROLS = { adaptiveSelect: AdaptiveSelect, array: ArrayControl, checkbox: Checkbox, color: Color, combobox: Combobox3, datetime: DateTime, date: DateControl, email: Email, telephone: Telephone, url: Url, integer: Integer, number: Number2, password: Password, radio: Radio, select: Select, text: Text12, toggle: Toggle, textarea: Textarea, toggleGroup: ToggleGroup }; function isEditConfig(value) { return value && typeof value === "object" && typeof value.control === "string"; } function createConfiguredControl(config2) { const { control, ...controlConfig } = config2; const BaseControlType = getControlByType(control); if (BaseControlType === null) { return null; } return function ConfiguredControl(props) { return /* @__PURE__ */ (0, import_jsx_runtime250.jsx)(BaseControlType, { ...props, config: controlConfig }); }; } function getControl(field, fallback) { if (typeof field.Edit === "function") { return field.Edit; } if (typeof field.Edit === "string") { return getControlByType(field.Edit); } if (isEditConfig(field.Edit)) { return createConfiguredControl(field.Edit); } if (hasElements(field) && field.type !== "array") { return getControlByType("adaptiveSelect"); } if (fallback === null) { return null; } return getControlByType(fallback); } function getControlByType(type) { if (Object.keys(FORM_CONTROLS).includes(type)) { return FORM_CONTROLS[type]; } return null; } // packages/dataviews/build-module/field-types/utils/get-filter-by.mjs function getFilterBy(field, defaultOperators, validOperators) { if (field.filterBy === false) { return false; } const operators = field.filterBy?.operators?.filter( (op) => validOperators.includes(op) ) ?? defaultOperators; if (operators.length === 0) { return false; } return { isPrimary: !!field.filterBy?.isPrimary, operators }; } var get_filter_by_default = getFilterBy; // packages/dataviews/build-module/field-types/utils/get-value-from-id.mjs var getValueFromId = (id) => ({ item }) => { const path = id.split("."); let value = item; for (const segment of path) { if (value.hasOwnProperty(segment)) { value = value[segment]; } else { value = void 0; } } return value; }; var get_value_from_id_default = getValueFromId; // packages/dataviews/build-module/field-types/utils/set-value-from-id.mjs var setValueFromId = (id) => ({ value }) => { const path = id.split("."); const result = {}; let current = result; for (const segment of path.slice(0, -1)) { current[segment] = {}; current = current[segment]; } current[path.at(-1)] = value; return result; }; var set_value_from_id_default = setValueFromId; // packages/dataviews/build-module/field-types/email.mjs var import_i18n120 = __toESM(require_i18n(), 1); // packages/dataviews/build-module/field-types/utils/render-from-elements.mjs function RenderFromElements({ item, field }) { const { elements: elements2, isLoading } = useElements({ elements: field.elements, getElements: field.getElements }); const value = field.getValue({ item }); if (isLoading) { return value; } if (elements2.length === 0) { return value; } return elements2?.find((element) => element.value === value)?.label || field.getValue({ item }); } // packages/dataviews/build-module/field-types/utils/render-default.mjs var import_jsx_runtime251 = __toESM(require_jsx_runtime(), 1); function render({ item, field }) { if (field.hasElements) { return /* @__PURE__ */ (0, import_jsx_runtime251.jsx)(RenderFromElements, { item, field }); } return field.getValueFormatted({ item, field }); } // packages/dataviews/build-module/field-types/utils/sort-text.mjs var sort_text_default = (a2, b2, direction) => { return direction === "asc" ? a2.localeCompare(b2) : b2.localeCompare(a2); }; // packages/dataviews/build-module/field-types/utils/is-valid-required.mjs function isValidRequired(item, field) { const value = field.getValue({ item }); return ![void 0, "", null].includes(value); } // packages/dataviews/build-module/field-types/utils/is-valid-min-length.mjs function isValidMinLength(item, field) { if (typeof field.isValid.minLength?.constraint !== "number") { return false; } const value = field.getValue({ item }); if ([void 0, "", null].includes(value)) { return true; } return String(value).length >= field.isValid.minLength.constraint; } // packages/dataviews/build-module/field-types/utils/is-valid-max-length.mjs function isValidMaxLength(item, field) { if (typeof field.isValid.maxLength?.constraint !== "number") { return false; } const value = field.getValue({ item }); if ([void 0, "", null].includes(value)) { return true; } return String(value).length <= field.isValid.maxLength.constraint; } // packages/dataviews/build-module/field-types/utils/is-valid-pattern.mjs function isValidPattern(item, field) { if (field.isValid.pattern?.constraint === void 0) { return true; } try { const regexp = new RegExp(field.isValid.pattern.constraint); const value = field.getValue({ item }); if ([void 0, "", null].includes(value)) { return true; } return regexp.test(String(value)); } catch { return false; } } // packages/dataviews/build-module/field-types/utils/is-valid-elements.mjs function isValidElements(item, field) { const elements2 = field.elements ?? []; const validValues = elements2.map((el) => el.value); if (validValues.length === 0) { return true; } const value = field.getValue({ item }); return [].concat(value).every((v2) => validValues.includes(v2)); } // packages/dataviews/build-module/field-types/utils/get-value-formatted-default.mjs function getValueFormatted({ item, field }) { return field.getValue({ item }); } var get_value_formatted_default_default = getValueFormatted; // packages/dataviews/build-module/field-types/email.mjs var emailRegex = /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/; function isValidCustom(item, field) { const value = field.getValue({ item }); if (![void 0, "", null].includes(value) && !emailRegex.test(value)) { return (0, import_i18n120.__)("Value must be a valid email address."); } return null; } var email_default = { type: "email", render, Edit: "email", sort: sort_text_default, enableSorting: true, enableGlobalSearch: false, defaultOperators: [OPERATOR_IS_ANY2, OPERATOR_IS_NONE2], validOperators: [ OPERATOR_IS2, OPERATOR_IS_NOT, OPERATOR_CONTAINS, OPERATOR_NOT_CONTAINS, OPERATOR_STARTS_WITH, // Multiple selection OPERATOR_IS_ANY2, OPERATOR_IS_NONE2, OPERATOR_IS_ALL, OPERATOR_IS_NOT_ALL ], format: {}, getValueFormatted: get_value_formatted_default_default, validate: { required: isValidRequired, pattern: isValidPattern, minLength: isValidMinLength, maxLength: isValidMaxLength, elements: isValidElements, custom: isValidCustom } }; // packages/dataviews/build-module/field-types/integer.mjs var import_i18n121 = __toESM(require_i18n(), 1); // packages/dataviews/build-module/field-types/utils/sort-number.mjs var sort_number_default = (a2, b2, direction) => { return direction === "asc" ? a2 - b2 : b2 - a2; }; // packages/dataviews/build-module/field-types/utils/is-valid-min.mjs function isValidMin(item, field) { if (typeof field.isValid.min?.constraint !== "number") { return false; } const value = field.getValue({ item }); if ([void 0, "", null].includes(value)) { return true; } return Number(value) >= field.isValid.min.constraint; } // packages/dataviews/build-module/field-types/utils/is-valid-max.mjs function isValidMax(item, field) { if (typeof field.isValid.max?.constraint !== "number") { return false; } const value = field.getValue({ item }); if ([void 0, "", null].includes(value)) { return true; } return Number(value) <= field.isValid.max.constraint; } // packages/dataviews/build-module/field-types/integer.mjs var format2 = { separatorThousand: "," }; function getValueFormatted2({ item, field }) { let value = field.getValue({ item }); if (value === null || value === void 0) { return ""; } value = Number(value); if (!Number.isFinite(value)) { return String(value); } let formatInteger; if (field.type !== "integer") { formatInteger = format2; } else { formatInteger = field.format; } const { separatorThousand } = formatInteger; const integerValue = Math.trunc(value); if (!separatorThousand) { return String(integerValue); } return String(integerValue).replace( /\B(?=(\d{3})+(?!\d))/g, separatorThousand ); } function isValidCustom2(item, field) { const value = field.getValue({ item }); if (![void 0, "", null].includes(value) && !Number.isInteger(value)) { return (0, import_i18n121.__)("Value must be an integer."); } return null; } var integer_default = { type: "integer", render, Edit: "integer", sort: sort_number_default, enableSorting: true, enableGlobalSearch: false, defaultOperators: [ OPERATOR_IS2, OPERATOR_IS_NOT, OPERATOR_LESS_THAN, OPERATOR_GREATER_THAN, OPERATOR_LESS_THAN_OR_EQUAL, OPERATOR_GREATER_THAN_OR_EQUAL, OPERATOR_BETWEEN ], validOperators: [ // Single-selection OPERATOR_IS2, OPERATOR_IS_NOT, OPERATOR_LESS_THAN, OPERATOR_GREATER_THAN, OPERATOR_LESS_THAN_OR_EQUAL, OPERATOR_GREATER_THAN_OR_EQUAL, OPERATOR_BETWEEN, // Multiple-selection OPERATOR_IS_ANY2, OPERATOR_IS_NONE2, OPERATOR_IS_ALL, OPERATOR_IS_NOT_ALL ], format: format2, getValueFormatted: getValueFormatted2, validate: { required: isValidRequired, min: isValidMin, max: isValidMax, elements: isValidElements, custom: isValidCustom2 } }; // packages/dataviews/build-module/field-types/number.mjs var import_i18n122 = __toESM(require_i18n(), 1); var format3 = { separatorThousand: ",", separatorDecimal: ".", decimals: 2 }; function getValueFormatted3({ item, field }) { let value = field.getValue({ item }); if (value === null || value === void 0) { return ""; } value = Number(value); if (!Number.isFinite(value)) { return String(value); } let formatNumber; if (field.type !== "number") { formatNumber = format3; } else { formatNumber = field.format; } const { separatorThousand, separatorDecimal, decimals } = formatNumber; const fixedValue = value.toFixed(decimals); const [integerPart, decimalPart] = fixedValue.split("."); const formattedInteger = separatorThousand ? integerPart.replace(/\B(?=(\d{3})+(?!\d))/g, separatorThousand) : integerPart; return decimals === 0 ? formattedInteger : formattedInteger + separatorDecimal + decimalPart; } function isEmpty2(value) { return value === "" || value === void 0 || value === null; } function isValidCustom3(item, field) { const value = field.getValue({ item }); if (!isEmpty2(value) && !Number.isFinite(value)) { return (0, import_i18n122.__)("Value must be a number."); } return null; } var number_default = { type: "number", render, Edit: "number", sort: sort_number_default, enableSorting: true, enableGlobalSearch: false, defaultOperators: [ OPERATOR_IS2, OPERATOR_IS_NOT, OPERATOR_LESS_THAN, OPERATOR_GREATER_THAN, OPERATOR_LESS_THAN_OR_EQUAL, OPERATOR_GREATER_THAN_OR_EQUAL, OPERATOR_BETWEEN ], validOperators: [ // Single-selection OPERATOR_IS2, OPERATOR_IS_NOT, OPERATOR_LESS_THAN, OPERATOR_GREATER_THAN, OPERATOR_LESS_THAN_OR_EQUAL, OPERATOR_GREATER_THAN_OR_EQUAL, OPERATOR_BETWEEN, // Multiple-selection OPERATOR_IS_ANY2, OPERATOR_IS_NONE2, OPERATOR_IS_ALL, OPERATOR_IS_NOT_ALL ], format: format3, getValueFormatted: getValueFormatted3, validate: { required: isValidRequired, min: isValidMin, max: isValidMax, elements: isValidElements, custom: isValidCustom3 } }; // packages/dataviews/build-module/field-types/text.mjs var text_default = { type: "text", render, Edit: "text", sort: sort_text_default, enableSorting: true, enableGlobalSearch: false, defaultOperators: [OPERATOR_IS_ANY2, OPERATOR_IS_NONE2], validOperators: [ // Single selection OPERATOR_IS2, OPERATOR_IS_NOT, OPERATOR_CONTAINS, OPERATOR_NOT_CONTAINS, OPERATOR_STARTS_WITH, // Multiple selection OPERATOR_IS_ANY2, OPERATOR_IS_NONE2, OPERATOR_IS_ALL, OPERATOR_IS_NOT_ALL ], format: {}, getValueFormatted: get_value_formatted_default_default, validate: { required: isValidRequired, pattern: isValidPattern, minLength: isValidMinLength, maxLength: isValidMaxLength, elements: isValidElements } }; // packages/dataviews/build-module/field-types/datetime.mjs var import_date7 = __toESM(require_date(), 1); var format4 = { datetime: (0, import_date7.getSettings)().formats.datetime, weekStartsOn: (0, import_date7.getSettings)().l10n.startOfWeek }; function getValueFormatted4({ item, field }) { const value = field.getValue({ item }); if (["", void 0, null].includes(value)) { return ""; } let formatDatetime; if (field.type !== "datetime") { formatDatetime = format4; } else { formatDatetime = field.format; } return (0, import_date7.dateI18n)(formatDatetime.datetime, (0, import_date7.getDate)(value)); } var sort = (a2, b2, direction) => { const timeA = new Date(a2).getTime(); const timeB = new Date(b2).getTime(); return direction === "asc" ? timeA - timeB : timeB - timeA; }; var datetime_default = { type: "datetime", render, Edit: "datetime", sort, enableSorting: true, enableGlobalSearch: false, defaultOperators: [ OPERATOR_ON, OPERATOR_NOT_ON, OPERATOR_BEFORE2, OPERATOR_AFTER2, OPERATOR_BEFORE_INC, OPERATOR_AFTER_INC, OPERATOR_IN_THE_PAST, OPERATOR_OVER ], validOperators: [ OPERATOR_ON, OPERATOR_NOT_ON, OPERATOR_BEFORE2, OPERATOR_AFTER2, OPERATOR_BEFORE_INC, OPERATOR_AFTER_INC, OPERATOR_IN_THE_PAST, OPERATOR_OVER ], format: format4, getValueFormatted: getValueFormatted4, validate: { required: isValidRequired, elements: isValidElements } }; // packages/dataviews/build-module/field-types/date.mjs var import_date8 = __toESM(require_date(), 1); var format5 = { date: (0, import_date8.getSettings)().formats.date, weekStartsOn: (0, import_date8.getSettings)().l10n.startOfWeek }; function getValueFormatted5({ item, field }) { const value = field.getValue({ item }); if (["", void 0, null].includes(value)) { return ""; } let formatDate2; if (field.type !== "date") { formatDate2 = format5; } else { formatDate2 = field.format; } return (0, import_date8.dateI18n)(formatDate2.date, (0, import_date8.getDate)(value)); } var sort2 = (a2, b2, direction) => { const timeA = new Date(a2).getTime(); const timeB = new Date(b2).getTime(); return direction === "asc" ? timeA - timeB : timeB - timeA; }; var date_default = { type: "date", render, Edit: "date", sort: sort2, enableSorting: true, enableGlobalSearch: false, defaultOperators: [ OPERATOR_ON, OPERATOR_NOT_ON, OPERATOR_BEFORE2, OPERATOR_AFTER2, OPERATOR_BEFORE_INC, OPERATOR_AFTER_INC, OPERATOR_IN_THE_PAST, OPERATOR_OVER, OPERATOR_BETWEEN ], validOperators: [ OPERATOR_ON, OPERATOR_NOT_ON, OPERATOR_BEFORE2, OPERATOR_AFTER2, OPERATOR_BEFORE_INC, OPERATOR_AFTER_INC, OPERATOR_IN_THE_PAST, OPERATOR_OVER, OPERATOR_BETWEEN ], format: format5, getValueFormatted: getValueFormatted5, validate: { required: isValidRequired, elements: isValidElements } }; // packages/dataviews/build-module/field-types/boolean.mjs var import_i18n123 = __toESM(require_i18n(), 1); // packages/dataviews/build-module/field-types/utils/is-valid-required-for-bool.mjs function isValidRequiredForBool(item, field) { const value = field.getValue({ item }); return value === true; } // packages/dataviews/build-module/field-types/boolean.mjs function getValueFormatted6({ item, field }) { const value = field.getValue({ item }); if (value === true) { return (0, import_i18n123.__)("True"); } if (value === false) { return (0, import_i18n123.__)("False"); } return ""; } function isValidCustom4(item, field) { const value = field.getValue({ item }); if (![void 0, "", null].includes(value) && ![true, false].includes(value)) { return (0, import_i18n123.__)("Value must be true, false, or undefined"); } return null; } var sort3 = (a2, b2, direction) => { const boolA = Boolean(a2); const boolB = Boolean(b2); if (boolA === boolB) { return 0; } if (direction === "asc") { return boolA ? 1 : -1; } return boolA ? -1 : 1; }; var boolean_default = { type: "boolean", render, Edit: "checkbox", sort: sort3, validate: { required: isValidRequiredForBool, elements: isValidElements, custom: isValidCustom4 }, enableSorting: true, enableGlobalSearch: false, defaultOperators: [OPERATOR_IS2, OPERATOR_IS_NOT], validOperators: [OPERATOR_IS2, OPERATOR_IS_NOT], format: {}, getValueFormatted: getValueFormatted6 }; // packages/dataviews/build-module/field-types/media.mjs var media_default2 = { type: "media", render: () => null, Edit: null, sort: () => 0, enableSorting: false, enableGlobalSearch: false, defaultOperators: [], validOperators: [], format: {}, getValueFormatted: get_value_formatted_default_default, // cannot validate any constraint, so // the only available validation for the field author // would be providing a custom validator. validate: {} }; // packages/dataviews/build-module/field-types/array.mjs var import_i18n124 = __toESM(require_i18n(), 1); // packages/dataviews/build-module/field-types/utils/is-valid-required-for-array.mjs function isValidRequiredForArray(item, field) { const value = field.getValue({ item }); return Array.isArray(value) && value.length > 0 && value.every( (element) => ![void 0, "", null].includes(element) ); } // packages/dataviews/build-module/field-types/array.mjs function getValueFormatted7({ item, field }) { const value = field.getValue({ item }); const arr = Array.isArray(value) ? value : []; return arr.join(", "); } function render2({ item, field }) { return getValueFormatted7({ item, field }); } function isValidCustom5(item, field) { const value = field.getValue({ item }); if (![void 0, "", null].includes(value) && !Array.isArray(value)) { return (0, import_i18n124.__)("Value must be an array."); } if (!value.every((v2) => typeof v2 === "string")) { return (0, import_i18n124.__)("Every value must be a string."); } return null; } var sort4 = (a2, b2, direction) => { const arrA = Array.isArray(a2) ? a2 : []; const arrB = Array.isArray(b2) ? b2 : []; if (arrA.length !== arrB.length) { return direction === "asc" ? arrA.length - arrB.length : arrB.length - arrA.length; } const joinedA = arrA.join(","); const joinedB = arrB.join(","); return direction === "asc" ? joinedA.localeCompare(joinedB) : joinedB.localeCompare(joinedA); }; var array_default = { type: "array", render: render2, Edit: "array", sort: sort4, enableSorting: true, enableGlobalSearch: false, defaultOperators: [OPERATOR_IS_ANY2, OPERATOR_IS_NONE2], validOperators: [ OPERATOR_IS_ANY2, OPERATOR_IS_NONE2, OPERATOR_IS_ALL, OPERATOR_IS_NOT_ALL ], format: {}, getValueFormatted: getValueFormatted7, validate: { required: isValidRequiredForArray, elements: isValidElements, custom: isValidCustom5 } }; // packages/dataviews/build-module/field-types/password.mjs function getValueFormatted8({ item, field }) { return field.getValue({ item }) ? "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022" : ""; } var password_default = { type: "password", render, Edit: "password", sort: () => 0, // Passwords should not be sortable for security reasons enableSorting: false, enableGlobalSearch: false, defaultOperators: [], validOperators: [], format: {}, getValueFormatted: getValueFormatted8, validate: { required: isValidRequired, pattern: isValidPattern, minLength: isValidMinLength, maxLength: isValidMaxLength, elements: isValidElements } }; // packages/dataviews/build-module/field-types/telephone.mjs var telephone_default = { type: "telephone", render, Edit: "telephone", sort: sort_text_default, enableSorting: true, enableGlobalSearch: false, defaultOperators: [OPERATOR_IS_ANY2, OPERATOR_IS_NONE2], validOperators: [ OPERATOR_IS2, OPERATOR_IS_NOT, OPERATOR_CONTAINS, OPERATOR_NOT_CONTAINS, OPERATOR_STARTS_WITH, // Multiple selection OPERATOR_IS_ANY2, OPERATOR_IS_NONE2, OPERATOR_IS_ALL, OPERATOR_IS_NOT_ALL ], format: {}, getValueFormatted: get_value_formatted_default_default, validate: { required: isValidRequired, pattern: isValidPattern, minLength: isValidMinLength, maxLength: isValidMaxLength, elements: isValidElements } }; // packages/dataviews/build-module/field-types/color.mjs var import_i18n125 = __toESM(require_i18n(), 1); var import_jsx_runtime252 = __toESM(require_jsx_runtime(), 1); function render3({ item, field }) { if (field.hasElements) { return /* @__PURE__ */ (0, import_jsx_runtime252.jsx)(RenderFromElements, { item, field }); } const value = get_value_formatted_default_default({ item, field }); if (!value || !w(value).isValid()) { return value; } return /* @__PURE__ */ (0, import_jsx_runtime252.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [ /* @__PURE__ */ (0, import_jsx_runtime252.jsx)( "div", { style: { width: "16px", height: "16px", borderRadius: "50%", backgroundColor: value, border: "1px solid #ddd", flexShrink: 0 } } ), /* @__PURE__ */ (0, import_jsx_runtime252.jsx)("span", { children: value }) ] }); } function isValidCustom6(item, field) { const value = field.getValue({ item }); if (![void 0, "", null].includes(value) && !w(value).isValid()) { return (0, import_i18n125.__)("Value must be a valid color."); } return null; } var sort5 = (a2, b2, direction) => { const colorA = w(a2); const colorB = w(b2); if (!colorA.isValid() && !colorB.isValid()) { return 0; } if (!colorA.isValid()) { return direction === "asc" ? 1 : -1; } if (!colorB.isValid()) { return direction === "asc" ? -1 : 1; } const hslA = colorA.toHsl(); const hslB = colorB.toHsl(); if (hslA.h !== hslB.h) { return direction === "asc" ? hslA.h - hslB.h : hslB.h - hslA.h; } if (hslA.s !== hslB.s) { return direction === "asc" ? hslA.s - hslB.s : hslB.s - hslA.s; } return direction === "asc" ? hslA.l - hslB.l : hslB.l - hslA.l; }; var color_default = { type: "color", render: render3, Edit: "color", sort: sort5, enableSorting: true, enableGlobalSearch: false, defaultOperators: [OPERATOR_IS_ANY2, OPERATOR_IS_NONE2], validOperators: [ OPERATOR_IS2, OPERATOR_IS_NOT, OPERATOR_IS_ANY2, OPERATOR_IS_NONE2 ], format: {}, getValueFormatted: get_value_formatted_default_default, validate: { required: isValidRequired, elements: isValidElements, custom: isValidCustom6 } }; // packages/dataviews/build-module/field-types/url.mjs var url_default = { type: "url", render, Edit: "url", sort: sort_text_default, enableSorting: true, enableGlobalSearch: false, defaultOperators: [OPERATOR_IS_ANY2, OPERATOR_IS_NONE2], validOperators: [ OPERATOR_IS2, OPERATOR_IS_NOT, OPERATOR_CONTAINS, OPERATOR_NOT_CONTAINS, OPERATOR_STARTS_WITH, // Multiple selection OPERATOR_IS_ANY2, OPERATOR_IS_NONE2, OPERATOR_IS_ALL, OPERATOR_IS_NOT_ALL ], format: {}, getValueFormatted: get_value_formatted_default_default, validate: { required: isValidRequired, pattern: isValidPattern, minLength: isValidMinLength, maxLength: isValidMaxLength, elements: isValidElements } }; // packages/dataviews/build-module/field-types/no-type.mjs var sort6 = (a2, b2, direction) => { if (typeof a2 === "number" && typeof b2 === "number") { return sort_number_default(a2, b2, direction); } return sort_text_default(a2, b2, direction); }; var no_type_default = { // type: no type for this one render, Edit: null, sort: sort6, enableSorting: true, enableGlobalSearch: false, defaultOperators: [OPERATOR_IS2, OPERATOR_IS_NOT], validOperators: getAllOperatorNames(), format: {}, getValueFormatted: get_value_formatted_default_default, validate: { required: isValidRequired, elements: isValidElements } }; // packages/dataviews/build-module/field-types/utils/get-is-valid.mjs function getIsValid(field, fieldType) { let required; if (field.isValid?.required === true && fieldType.validate.required !== void 0) { required = { constraint: true, validate: fieldType.validate.required }; } let elements2; if ((field.isValid?.elements === true || // elements is enabled unless the field opts-out field.isValid?.elements === void 0 && (!!field.elements || !!field.getElements)) && fieldType.validate.elements !== void 0) { elements2 = { constraint: true, validate: fieldType.validate.elements }; } let min; if (typeof field.isValid?.min === "number" && fieldType.validate.min !== void 0) { min = { constraint: field.isValid.min, validate: fieldType.validate.min }; } let max; if (typeof field.isValid?.max === "number" && fieldType.validate.max !== void 0) { max = { constraint: field.isValid.max, validate: fieldType.validate.max }; } let minLength; if (typeof field.isValid?.minLength === "number" && fieldType.validate.minLength !== void 0) { minLength = { constraint: field.isValid.minLength, validate: fieldType.validate.minLength }; } let maxLength; if (typeof field.isValid?.maxLength === "number" && fieldType.validate.maxLength !== void 0) { maxLength = { constraint: field.isValid.maxLength, validate: fieldType.validate.maxLength }; } let pattern; if (field.isValid?.pattern !== void 0 && fieldType.validate.pattern !== void 0) { pattern = { constraint: field.isValid?.pattern, validate: fieldType.validate.pattern }; } const custom = field.isValid?.custom ?? fieldType.validate.custom; return { required, elements: elements2, min, max, minLength, maxLength, pattern, custom }; } // packages/dataviews/build-module/field-types/utils/get-filter.mjs function getFilter(fieldType) { return fieldType.validOperators.reduce((accumulator, operator) => { const operatorObj = getOperatorByName(operator); if (operatorObj?.filter) { accumulator[operator] = operatorObj.filter; } return accumulator; }, {}); } // packages/dataviews/build-module/field-types/utils/get-format.mjs function getFormat(field, fieldType) { return { ...fieldType.format, ...field.format }; } var get_format_default = getFormat; // packages/dataviews/build-module/field-types/index.mjs function getFieldTypeByName(type) { const found = [ email_default, integer_default, number_default, text_default, datetime_default, date_default, boolean_default, media_default2, array_default, password_default, telephone_default, color_default, url_default ].find((fieldType) => fieldType?.type === type); if (!!found) { return found; } return no_type_default; } function normalizeFields(fields) { return fields.map((field) => { const fieldType = getFieldTypeByName(field.type); const getValue = field.getValue || get_value_from_id_default(field.id); const sort7 = function(a2, b2, direction) { const aValue = getValue({ item: a2 }); const bValue = getValue({ item: b2 }); return field.sort ? field.sort(aValue, bValue, direction) : fieldType.sort(aValue, bValue, direction); }; return { id: field.id, label: field.label || field.id, header: field.header || field.label || field.id, description: field.description, placeholder: field.placeholder, getValue, setValue: field.setValue || set_value_from_id_default(field.id), elements: field.elements, getElements: field.getElements, hasElements: hasElements(field), isVisible: field.isVisible, enableHiding: field.enableHiding ?? true, readOnly: field.readOnly ?? false, // The type provides defaults for the following props type: fieldType.type, render: field.render ?? fieldType.render, Edit: getControl(field, fieldType.Edit), sort: sort7, enableSorting: field.enableSorting ?? fieldType.enableSorting, enableGlobalSearch: field.enableGlobalSearch ?? fieldType.enableGlobalSearch, isValid: getIsValid(field, fieldType), filterBy: get_filter_by_default( field, fieldType.defaultOperators, fieldType.validOperators ), filter: getFilter(fieldType), format: get_format_default(field, fieldType), getValueFormatted: field.getValueFormatted ?? fieldType.getValueFormatted }; }); } // packages/dataviews/build-module/hooks/use-data.mjs var import_element120 = __toESM(require_element(), 1); function useData(data, isLoading, paginationInfo) { const previousDataRef = (0, import_element120.useRef)(data); const previousPaginationInfoRef = (0, import_element120.useRef)(paginationInfo); const [hasInitiallyLoaded, setHasInitiallyLoaded] = (0, import_element120.useState)( !isLoading ); (0, import_element120.useEffect)(() => { if (!isLoading) { previousDataRef.current = data; previousPaginationInfoRef.current = paginationInfo; setHasInitiallyLoaded(true); } }, [data, isLoading, paginationInfo]); return { data: isLoading && previousDataRef.current?.length ? previousDataRef.current : data, paginationInfo: isLoading && previousDataRef.current?.length ? previousPaginationInfoRef.current : paginationInfo, hasInitiallyLoaded }; } // packages/dataviews/build-module/dataviews/index.mjs var import_jsx_runtime253 = __toESM(require_jsx_runtime(), 1); var defaultGetItemId = (item) => item.id; var defaultIsItemClickable = () => true; var EMPTY_ARRAY9 = []; var dataViewsLayouts = VIEW_LAYOUTS.filter( (viewLayout) => !viewLayout.isPicker ); function DefaultUI({ header, search = true, searchLabel = void 0 }) { return /* @__PURE__ */ (0, import_jsx_runtime253.jsxs)(import_jsx_runtime253.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime253.jsxs)( Stack, { direction: "row", align: "top", justify: "space-between", className: "dataviews__view-actions", gap: "xs", children: [ /* @__PURE__ */ (0, import_jsx_runtime253.jsxs)( Stack, { direction: "row", justify: "start", gap: "sm", className: "dataviews__search", children: [ search && /* @__PURE__ */ (0, import_jsx_runtime253.jsx)(dataviews_search_default, { label: searchLabel }), /* @__PURE__ */ (0, import_jsx_runtime253.jsx)(toggle_default, {}) ] } ), /* @__PURE__ */ (0, import_jsx_runtime253.jsxs)(Stack, { direction: "row", gap: "xs", style: { flexShrink: 0 }, children: [ /* @__PURE__ */ (0, import_jsx_runtime253.jsx)(dataviews_view_config_default, {}), header ] }) ] } ), /* @__PURE__ */ (0, import_jsx_runtime253.jsx)(filters_toggled_default, { className: "dataviews-filters__container" }), /* @__PURE__ */ (0, import_jsx_runtime253.jsx)(DataViewsLayout, {}), /* @__PURE__ */ (0, import_jsx_runtime253.jsx)(DataViewsFooter, {}) ] }); } function DataViews({ view, onChangeView, fields, search = true, searchLabel = void 0, actions = EMPTY_ARRAY9, data, getItemId: getItemId2 = defaultGetItemId, getItemLevel: getItemLevel2, isLoading = false, paginationInfo, defaultLayouts: defaultLayoutsProperty, selection: selectionProperty, onChangeSelection, onClickItem, renderItemLink, isItemClickable = defaultIsItemClickable, header, children, config: config2 = { perPageSizes: [10, 20, 50, 100] }, empty, onReset }) { const { infiniteScrollHandler } = paginationInfo; const containerRef = (0, import_element121.useRef)(null); const [containerWidth, setContainerWidth] = (0, import_element121.useState)(0); const resizeObserverRef = (0, import_compose23.useResizeObserver)( (resizeObserverEntries) => { setContainerWidth( resizeObserverEntries[0].borderBoxSize[0].inlineSize ); }, { box: "border-box" } ); const [selectionState, setSelectionState] = (0, import_element121.useState)([]); const isUncontrolled = selectionProperty === void 0 || onChangeSelection === void 0; const selection = isUncontrolled ? selectionState : selectionProperty; const [openedFilter, setOpenedFilter] = (0, import_element121.useState)(null); function setSelectionWithChange(value) { const newValue = typeof value === "function" ? value(selection) : value; if (isUncontrolled) { setSelectionState(newValue); } if (onChangeSelection) { onChangeSelection(newValue); } } const _fields = (0, import_element121.useMemo)(() => normalizeFields(fields), [fields]); const _selection = (0, import_element121.useMemo)(() => { return selection.filter( (id) => data.some((item) => getItemId2(item) === id) ); }, [selection, data, getItemId2]); const filters = use_filters_default(_fields, view); const hasPrimaryOrLockedFilters = (0, import_element121.useMemo)( () => (filters || []).some( (filter) => filter.isPrimary || filter.isLocked ), [filters] ); const [isShowingFilter, setIsShowingFilter] = (0, import_element121.useState)( hasPrimaryOrLockedFilters ); (0, import_element121.useEffect)(() => { if (hasPrimaryOrLockedFilters && !isShowingFilter) { setIsShowingFilter(true); } }, [hasPrimaryOrLockedFilters, isShowingFilter]); (0, import_element121.useEffect)(() => { if (!view.infiniteScrollEnabled || !containerRef.current) { return; } const handleScroll = (0, import_compose23.throttle)((event) => { const target = event.target; const scrollTop = target.scrollTop; const scrollHeight = target.scrollHeight; const clientHeight = target.clientHeight; if (scrollTop + clientHeight >= scrollHeight - 100) { infiniteScrollHandler?.(); } }, 100); const container = containerRef.current; container.addEventListener("scroll", handleScroll); return () => { container.removeEventListener("scroll", handleScroll); handleScroll.cancel(); }; }, [infiniteScrollHandler, view.infiniteScrollEnabled]); const defaultLayouts4 = (0, import_element121.useMemo)( () => Object.fromEntries( Object.entries(defaultLayoutsProperty).filter( ([layoutType]) => { return dataViewsLayouts.some( (viewLayout) => viewLayout.type === layoutType ); } ) ), [defaultLayoutsProperty] ); const { data: displayData, paginationInfo: displayPaginationInfo, hasInitiallyLoaded } = useData(data, isLoading, paginationInfo); if (!defaultLayouts4[view.type]) { return null; } return /* @__PURE__ */ (0, import_jsx_runtime253.jsx)( dataviews_context_default.Provider, { value: { view, onChangeView, fields: _fields, actions, data: displayData, isLoading, paginationInfo: displayPaginationInfo, selection: _selection, onChangeSelection: setSelectionWithChange, openedFilter, setOpenedFilter, getItemId: getItemId2, getItemLevel: getItemLevel2, isItemClickable, onClickItem, renderItemLink, containerWidth, containerRef, resizeObserverRef, defaultLayouts: defaultLayouts4, filters, isShowingFilter, setIsShowingFilter, config: config2, empty, hasInitiallyLoaded, hasInfiniteScrollHandler: !!infiniteScrollHandler, onReset }, children: /* @__PURE__ */ (0, import_jsx_runtime253.jsx)("div", { className: "dataviews-wrapper", ref: containerRef, children: children ?? /* @__PURE__ */ (0, import_jsx_runtime253.jsx)( DefaultUI, { header, search, searchLabel } ) }) } ); } var DataViewsSubComponents = DataViews; DataViewsSubComponents.BulkActionToolbar = BulkActionsFooter; DataViewsSubComponents.Filters = filters_default; DataViewsSubComponents.FiltersToggled = filters_toggled_default; DataViewsSubComponents.FiltersToggle = toggle_default; DataViewsSubComponents.Layout = DataViewsLayout; DataViewsSubComponents.LayoutSwitcher = ViewTypeMenu; DataViewsSubComponents.Pagination = DataViewsPagination; DataViewsSubComponents.Search = dataviews_search_default; DataViewsSubComponents.ViewConfig = DataviewsViewConfigDropdown; DataViewsSubComponents.Footer = DataViewsFooter; var dataviews_default = DataViewsSubComponents; // packages/dataviews/build-module/dataform/index.mjs var import_element133 = __toESM(require_element(), 1); // packages/dataviews/build-module/components/dataform-context/index.mjs var import_element122 = __toESM(require_element(), 1); var import_jsx_runtime254 = __toESM(require_jsx_runtime(), 1); var DataFormContext = (0, import_element122.createContext)({ fields: [] }); DataFormContext.displayName = "DataFormContext"; function DataFormProvider({ fields, children }) { return /* @__PURE__ */ (0, import_jsx_runtime254.jsx)(DataFormContext.Provider, { value: { fields }, children }); } var dataform_context_default = DataFormContext; // packages/dataviews/build-module/components/dataform-layouts/data-form-layout.mjs var import_element132 = __toESM(require_element(), 1); // packages/dataviews/build-module/components/dataform-layouts/regular/index.mjs var import_element123 = __toESM(require_element(), 1); var import_components137 = __toESM(require_components(), 1); // packages/dataviews/build-module/components/dataform-layouts/normalize-form.mjs var DEFAULT_LAYOUT = { type: "regular", labelPosition: "top" }; var normalizeCardSummaryField = (sum) => { if (typeof sum === "string") { return [{ id: sum, visibility: "when-collapsed" }]; } return sum.map((item) => { if (typeof item === "string") { return { id: item, visibility: "when-collapsed" }; } return { id: item.id, visibility: item.visibility }; }); }; function normalizeLayout(layout) { let normalizedLayout = DEFAULT_LAYOUT; if (layout?.type === "regular") { normalizedLayout = { type: "regular", labelPosition: layout?.labelPosition ?? "top" }; } else if (layout?.type === "panel") { const summary = layout.summary ?? []; const normalizedSummary = Array.isArray(summary) ? summary : [summary]; normalizedLayout = { type: "panel", labelPosition: layout?.labelPosition ?? "side", openAs: layout?.openAs ?? "dropdown", summary: normalizedSummary, editVisibility: layout?.editVisibility ?? "on-hover" }; } else if (layout?.type === "card") { if (layout.withHeader === false) { normalizedLayout = { type: "card", withHeader: false, isOpened: true, summary: [], isCollapsible: false }; } else { const summary = layout.summary ?? []; normalizedLayout = { type: "card", withHeader: true, isOpened: typeof layout.isOpened === "boolean" ? layout.isOpened : true, summary: normalizeCardSummaryField(summary), isCollapsible: layout.isCollapsible === void 0 ? true : layout.isCollapsible }; } } else if (layout?.type === "row") { normalizedLayout = { type: "row", alignment: layout?.alignment ?? "center", styles: layout?.styles ?? {} }; } else if (layout?.type === "details") { normalizedLayout = { type: "details", summary: layout?.summary ?? "" }; } return normalizedLayout; } function normalizeForm(form) { const normalizedFormLayout = normalizeLayout(form?.layout); const normalizedFields = (form.fields ?? []).map( (field) => { if (typeof field === "string") { return { id: field, layout: normalizedFormLayout }; } const fieldLayout = field.layout ? normalizeLayout(field.layout) : normalizedFormLayout; return { id: field.id, layout: fieldLayout, ...!!field.label && { label: field.label }, ...!!field.description && { description: field.description }, ..."children" in field && Array.isArray(field.children) && { children: normalizeForm({ fields: field.children, layout: DEFAULT_LAYOUT }).fields } }; } ); return { layout: normalizedFormLayout, fields: normalizedFields }; } var normalize_form_default = normalizeForm; // packages/dataviews/build-module/components/dataform-layouts/regular/index.mjs var import_jsx_runtime255 = __toESM(require_jsx_runtime(), 1); function Header2({ title }) { return /* @__PURE__ */ (0, import_jsx_runtime255.jsx)( Stack, { direction: "column", className: "dataforms-layouts-regular__header", gap: "lg", children: /* @__PURE__ */ (0, import_jsx_runtime255.jsx)(Stack, { direction: "row", align: "center", children: /* @__PURE__ */ (0, import_jsx_runtime255.jsx)(import_components137.__experimentalHeading, { level: 2, size: 13, children: title }) }) } ); } function FormRegularField({ data, field, onChange, hideLabelFromVision, markWhenOptional, validity }) { const { fields } = (0, import_element123.useContext)(dataform_context_default); const layout = field.layout; const form = (0, import_element123.useMemo)( () => ({ layout: DEFAULT_LAYOUT, fields: !!field.children ? field.children : [] }), [field] ); if (!!field.children) { return /* @__PURE__ */ (0, import_jsx_runtime255.jsxs)(import_jsx_runtime255.Fragment, { children: [ !hideLabelFromVision && field.label && /* @__PURE__ */ (0, import_jsx_runtime255.jsx)(Header2, { title: field.label }), /* @__PURE__ */ (0, import_jsx_runtime255.jsx)( DataFormLayout, { data, form, onChange, validity: validity?.children } ) ] }); } const labelPosition = layout.labelPosition; const fieldDefinition = fields.find( (fieldDef) => fieldDef.id === field.id ); if (!fieldDefinition || !fieldDefinition.Edit) { return null; } if (labelPosition === "side") { return /* @__PURE__ */ (0, import_jsx_runtime255.jsxs)( Stack, { direction: "row", className: "dataforms-layouts-regular__field", gap: "sm", children: [ /* @__PURE__ */ (0, import_jsx_runtime255.jsx)( "div", { className: clsx_default( "dataforms-layouts-regular__field-label", `dataforms-layouts-regular__field-label--label-position-${labelPosition}` ), children: /* @__PURE__ */ (0, import_jsx_runtime255.jsx)(import_components137.BaseControl.VisualLabel, { children: fieldDefinition.label }) } ), /* @__PURE__ */ (0, import_jsx_runtime255.jsx)("div", { className: "dataforms-layouts-regular__field-control", children: fieldDefinition.readOnly === true ? /* @__PURE__ */ (0, import_jsx_runtime255.jsx)( fieldDefinition.render, { item: data, field: fieldDefinition } ) : /* @__PURE__ */ (0, import_jsx_runtime255.jsx)( fieldDefinition.Edit, { data, field: fieldDefinition, onChange, hideLabelFromVision: true, markWhenOptional, validity }, fieldDefinition.id ) }) ] } ); } return /* @__PURE__ */ (0, import_jsx_runtime255.jsx)("div", { className: "dataforms-layouts-regular__field", children: fieldDefinition.readOnly === true ? /* @__PURE__ */ (0, import_jsx_runtime255.jsx)(import_jsx_runtime255.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime255.jsxs)(import_jsx_runtime255.Fragment, { children: [ !hideLabelFromVision && labelPosition !== "none" && /* @__PURE__ */ (0, import_jsx_runtime255.jsx)(import_components137.BaseControl.VisualLabel, { children: fieldDefinition.label }), /* @__PURE__ */ (0, import_jsx_runtime255.jsx)( fieldDefinition.render, { item: data, field: fieldDefinition } ) ] }) }) : /* @__PURE__ */ (0, import_jsx_runtime255.jsx)( fieldDefinition.Edit, { data, field: fieldDefinition, onChange, hideLabelFromVision: labelPosition === "none" ? true : hideLabelFromVision, markWhenOptional, validity } ) }); } // packages/dataviews/build-module/components/dataform-layouts/panel/modal.mjs var import_deepmerge3 = __toESM(require_cjs(), 1); var import_components140 = __toESM(require_components(), 1); var import_i18n128 = __toESM(require_i18n(), 1); var import_element128 = __toESM(require_element(), 1); var import_compose25 = __toESM(require_compose(), 1); // packages/dataviews/build-module/components/dataform-layouts/panel/summary-button.mjs var import_components139 = __toESM(require_components(), 1); var import_i18n126 = __toESM(require_i18n(), 1); var import_compose24 = __toESM(require_compose(), 1); var import_element124 = __toESM(require_element(), 1); // packages/dataviews/build-module/components/dataform-layouts/panel/utils/get-label-classname.mjs function getLabelClassName(labelPosition, showError) { return clsx_default( "dataforms-layouts-panel__field-label", `dataforms-layouts-panel__field-label--label-position-${labelPosition}`, { "has-error": showError } ); } var get_label_classname_default = getLabelClassName; // packages/dataviews/build-module/components/dataform-layouts/panel/utils/get-label-content.mjs var import_components138 = __toESM(require_components(), 1); var import_jsx_runtime256 = __toESM(require_jsx_runtime(), 1); function getLabelContent(showError, errorMessage, fieldLabel) { return showError ? /* @__PURE__ */ (0, import_jsx_runtime256.jsx)(import_components138.Tooltip, { text: errorMessage, placement: "top", children: /* @__PURE__ */ (0, import_jsx_runtime256.jsxs)("span", { className: "dataforms-layouts-panel__field-label-error-content", children: [ /* @__PURE__ */ (0, import_jsx_runtime256.jsx)(import_components138.Icon, { icon: error_default, size: 16 }), fieldLabel ] }) }) : fieldLabel; } var get_label_content_default = getLabelContent; // packages/dataviews/build-module/components/dataform-layouts/panel/utils/get-first-validation-error.mjs function getFirstValidationError(validity) { if (!validity) { return void 0; } const validityRules = Object.keys(validity).filter( (key) => key !== "children" ); for (const key of validityRules) { const rule = validity[key]; if (rule === void 0) { continue; } if (rule.type === "invalid") { if (rule.message) { return rule.message; } if (key === "required") { return "A required field is empty"; } return "Unidentified validation error"; } } if (validity.children) { for (const childValidity of Object.values(validity.children)) { const childError = getFirstValidationError(childValidity); if (childError) { return childError; } } } return void 0; } var get_first_validation_error_default = getFirstValidationError; // packages/dataviews/build-module/components/dataform-layouts/panel/summary-button.mjs var import_jsx_runtime257 = __toESM(require_jsx_runtime(), 1); function SummaryButton({ data, field, fieldLabel, summaryFields, validity, touched, disabled, onClick, "aria-expanded": ariaExpanded }) { const { labelPosition, editVisibility } = field.layout; const errorMessage = get_first_validation_error_default(validity); const showError = touched && !!errorMessage; const labelClassName = get_label_classname_default(labelPosition, showError); const labelContent = get_label_content_default(showError, errorMessage, fieldLabel); const className = clsx_default( "dataforms-layouts-panel__field-trigger", `dataforms-layouts-panel__field-trigger--label-${labelPosition}`, { "is-disabled": disabled, "dataforms-layouts-panel__field-trigger--edit-always": editVisibility === "always" } ); const controlId = (0, import_compose24.useInstanceId)( SummaryButton, "dataforms-layouts-panel__field-control" ); const ariaLabel = showError ? (0, import_i18n126.sprintf)( // translators: %s: Field name. (0, import_i18n126._x)("Edit %s (has errors)", "field"), fieldLabel || "" ) : (0, import_i18n126.sprintf)( // translators: %s: Field name. (0, import_i18n126._x)("Edit %s", "field"), fieldLabel || "" ); const rowRef = (0, import_element124.useRef)(null); const handleRowClick = () => { const selection = rowRef.current?.ownerDocument.defaultView?.getSelection(); if (selection && selection.toString().length > 0) { return; } onClick(); }; const handleKeyDown = (event) => { if (event.target === event.currentTarget && (event.key === "Enter" || event.key === " ")) { event.preventDefault(); onClick(); } }; return /* @__PURE__ */ (0, import_jsx_runtime257.jsxs)( "div", { ref: rowRef, className, onClick: !disabled ? handleRowClick : void 0, onKeyDown: !disabled ? handleKeyDown : void 0, children: [ labelPosition !== "none" && /* @__PURE__ */ (0, import_jsx_runtime257.jsx)("span", { className: labelClassName, children: labelContent }), labelPosition === "none" && showError && /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(import_components139.Tooltip, { text: errorMessage, placement: "top", children: /* @__PURE__ */ (0, import_jsx_runtime257.jsx)("span", { className: "dataforms-layouts-panel__field-label-error-content", children: /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(import_components139.Icon, { icon: error_default, size: 16 }) }) }), /* @__PURE__ */ (0, import_jsx_runtime257.jsx)( "span", { id: `${controlId}`, className: "dataforms-layouts-panel__field-control", children: summaryFields.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime257.jsx)( "span", { style: { display: "flex", flexDirection: "column", alignItems: "flex-start", width: "100%", gap: "2px" }, children: summaryFields.map((summaryField) => /* @__PURE__ */ (0, import_jsx_runtime257.jsx)( "span", { style: { width: "100%" }, children: /* @__PURE__ */ (0, import_jsx_runtime257.jsx)( summaryField.render, { item: data, field: summaryField } ) }, summaryField.id )) } ) : summaryFields.map((summaryField) => /* @__PURE__ */ (0, import_jsx_runtime257.jsx)( summaryField.render, { item: data, field: summaryField }, summaryField.id )) } ), !disabled && /* @__PURE__ */ (0, import_jsx_runtime257.jsx)( import_components139.Button, { className: "dataforms-layouts-panel__field-trigger-icon", label: ariaLabel, showTooltip: false, icon: pencil_default, size: "small", "aria-expanded": ariaExpanded, "aria-haspopup": "dialog", "aria-describedby": `${controlId}` } ) ] } ); } // packages/dataviews/build-module/hooks/use-form-validity.mjs var import_deepmerge2 = __toESM(require_cjs(), 1); var import_es63 = __toESM(require_es6(), 1); var import_element125 = __toESM(require_element(), 1); var import_i18n127 = __toESM(require_i18n(), 1); function isFormValid(formValidity) { if (!formValidity) { return true; } return Object.values(formValidity).every((fieldValidation) => { return Object.entries(fieldValidation).every( ([key, validation]) => { if (key === "children" && validation && typeof validation === "object") { return isFormValid(validation); } return validation.type !== "invalid" && validation.type !== "validating"; } ); }); } function getFormFieldsToValidate(form, fields) { const normalizedForm = normalize_form_default(form); if (normalizedForm.fields.length === 0) { return []; } const fieldsMap = /* @__PURE__ */ new Map(); fields.forEach((field) => { fieldsMap.set(field.id, field); }); function processFormField(formField) { if ("children" in formField && Array.isArray(formField.children)) { const processedChildren = formField.children.map(processFormField).filter((child) => child !== null); if (processedChildren.length === 0) { return null; } const fieldDef2 = fieldsMap.get(formField.id); if (fieldDef2) { const [normalizedField2] = normalizeFields([ fieldDef2 ]); return { id: formField.id, children: processedChildren, field: normalizedField2 }; } return { id: formField.id, children: processedChildren }; } const fieldDef = fieldsMap.get(formField.id); if (!fieldDef) { return null; } const [normalizedField] = normalizeFields([fieldDef]); return { id: formField.id, children: [], field: normalizedField }; } const toValidate = normalizedForm.fields.map(processFormField).filter((field) => field !== null); return toValidate; } function setValidityAtPath(formValidity, fieldValidity, path) { if (!formValidity) { formValidity = {}; } if (path.length === 0) { return formValidity; } const result = { ...formValidity }; let current = result; for (let i2 = 0; i2 < path.length - 1; i2++) { const segment = path[i2]; if (!current[segment]) { current[segment] = {}; } current[segment] = { ...current[segment] }; current = current[segment]; } const finalKey = path[path.length - 1]; current[finalKey] = { ...current[finalKey] || {}, ...fieldValidity }; return result; } function removeValidationProperty(formValidity, path, property) { if (!formValidity || path.length === 0) { return formValidity; } const result = { ...formValidity }; let current = result; for (let i2 = 0; i2 < path.length - 1; i2++) { const segment = path[i2]; if (!current[segment]) { return formValidity; } current[segment] = { ...current[segment] }; current = current[segment]; } const finalKey = path[path.length - 1]; if (!current[finalKey]) { return formValidity; } const fieldValidity = { ...current[finalKey] }; delete fieldValidity[property]; if (Object.keys(fieldValidity).length === 0) { delete current[finalKey]; } else { current[finalKey] = fieldValidity; } if (Object.keys(result).length === 0) { return void 0; } return result; } function handleElementsValidationAsync(promise, formField, promiseHandler) { const { elementsCounterRef, setFormValidity, path, item } = promiseHandler; const currentToken = (elementsCounterRef.current[formField.id] || 0) + 1; elementsCounterRef.current[formField.id] = currentToken; promise.then((result) => { if (currentToken !== elementsCounterRef.current[formField.id]) { return; } if (!Array.isArray(result)) { setFormValidity((prev) => { const newFormValidity = setValidityAtPath( prev, { elements: { type: "invalid", message: (0, import_i18n127.__)("Could not validate elements.") } }, [...path, formField.id] ); return newFormValidity; }); return; } if (formField.field?.isValid.elements && !formField.field.isValid.elements.validate(item, { ...formField.field, elements: result })) { setFormValidity((prev) => { const newFormValidity = setValidityAtPath( prev, { elements: { type: "invalid", message: (0, import_i18n127.__)( "Value must be one of the elements." ) } }, [...path, formField.id] ); return newFormValidity; }); } else { setFormValidity((prev) => { return removeValidationProperty( prev, [...path, formField.id], "elements" ); }); } }).catch((error) => { if (currentToken !== elementsCounterRef.current[formField.id]) { return; } let errorMessage; if (error instanceof Error) { errorMessage = error.message; } else { errorMessage = String(error) || (0, import_i18n127.__)( "Unknown error when running elements validation asynchronously." ); } setFormValidity((prev) => { const newFormValidity = setValidityAtPath( prev, { elements: { type: "invalid", message: errorMessage } }, [...path, formField.id] ); return newFormValidity; }); }); } function handleCustomValidationAsync(promise, formField, promiseHandler) { const { customCounterRef, setFormValidity, path } = promiseHandler; const currentToken = (customCounterRef.current[formField.id] || 0) + 1; customCounterRef.current[formField.id] = currentToken; promise.then((result) => { if (currentToken !== customCounterRef.current[formField.id]) { return; } if (result === null) { setFormValidity((prev) => { return removeValidationProperty( prev, [...path, formField.id], "custom" ); }); return; } if (typeof result === "string") { setFormValidity((prev) => { const newFormValidity = setValidityAtPath( prev, { custom: { type: "invalid", message: result } }, [...path, formField.id] ); return newFormValidity; }); return; } setFormValidity((prev) => { const newFormValidity = setValidityAtPath( prev, { custom: { type: "invalid", message: (0, import_i18n127.__)("Validation could not be processed.") } }, [...path, formField.id] ); return newFormValidity; }); }).catch((error) => { if (currentToken !== customCounterRef.current[formField.id]) { return; } let errorMessage; if (error instanceof Error) { errorMessage = error.message; } else { errorMessage = String(error) || (0, import_i18n127.__)( "Unknown error when running custom validation asynchronously." ); } setFormValidity((prev) => { const newFormValidity = setValidityAtPath( prev, { custom: { type: "invalid", message: errorMessage } }, [...path, formField.id] ); return newFormValidity; }); }); } function validateFormField(item, formField, promiseHandler) { if (formField.field?.isValid.required && !formField.field.isValid.required.validate(item, formField.field)) { return { required: { type: "invalid" } }; } if (formField.field?.isValid.pattern && !formField.field.isValid.pattern.validate(item, formField.field)) { return { pattern: { type: "invalid", message: (0, import_i18n127.__)("Value does not match the required pattern.") } }; } if (formField.field?.isValid.min && !formField.field.isValid.min.validate(item, formField.field)) { return { min: { type: "invalid", message: (0, import_i18n127.__)("Value is below the minimum.") } }; } if (formField.field?.isValid.max && !formField.field.isValid.max.validate(item, formField.field)) { return { max: { type: "invalid", message: (0, import_i18n127.__)("Value is above the maximum.") } }; } if (formField.field?.isValid.minLength && !formField.field.isValid.minLength.validate(item, formField.field)) { return { minLength: { type: "invalid", message: (0, import_i18n127.__)("Value is too short.") } }; } if (formField.field?.isValid.maxLength && !formField.field.isValid.maxLength.validate(item, formField.field)) { return { maxLength: { type: "invalid", message: (0, import_i18n127.__)("Value is too long.") } }; } if (formField.field?.isValid.elements && formField.field.hasElements && !formField.field.getElements && Array.isArray(formField.field.elements) && !formField.field.isValid.elements.validate(item, formField.field)) { return { elements: { type: "invalid", message: (0, import_i18n127.__)("Value must be one of the elements.") } }; } let customError; if (!!formField.field && formField.field.isValid.custom) { try { const value = formField.field.getValue({ item }); customError = formField.field.isValid.custom( (0, import_deepmerge2.default)( item, formField.field.setValue({ item, value }) ), formField.field ); } catch (error) { let errorMessage; if (error instanceof Error) { errorMessage = error.message; } else { errorMessage = String(error) || (0, import_i18n127.__)("Unknown error when running custom validation."); } return { custom: { type: "invalid", message: errorMessage } }; } } if (typeof customError === "string") { return { custom: { type: "invalid", message: customError } }; } const fieldValidity = {}; if (!!formField.field && formField.field.isValid.elements && formField.field.hasElements && typeof formField.field.getElements === "function") { handleElementsValidationAsync( formField.field.getElements(), formField, promiseHandler ); fieldValidity.elements = { type: "validating", message: (0, import_i18n127.__)("Validating\u2026") }; } if (customError instanceof Promise) { handleCustomValidationAsync(customError, formField, promiseHandler); fieldValidity.custom = { type: "validating", message: (0, import_i18n127.__)("Validating\u2026") }; } if (Object.keys(fieldValidity).length > 0) { return fieldValidity; } if (formField.children.length > 0) { const result = {}; formField.children.forEach((child) => { result[child.id] = validateFormField(item, child, { ...promiseHandler, path: [...promiseHandler.path, formField.id, "children"] }); }); const filteredResult = {}; Object.entries(result).forEach(([key, value]) => { if (value !== void 0) { filteredResult[key] = value; } }); if (Object.keys(filteredResult).length === 0) { return void 0; } return { children: filteredResult }; } return void 0; } function getFormFieldValue(formField, item) { const fieldValue = formField?.field?.getValue({ item }); if (formField.children.length === 0) { return fieldValue; } const childrenValues = formField.children.map( (child) => getFormFieldValue(child, item) ); if (!childrenValues) { return fieldValue; } return { value: fieldValue, children: childrenValues }; } function useFormValidity(item, fields, form) { const [formValidity, setFormValidity] = (0, import_element125.useState)(); const customCounterRef = (0, import_element125.useRef)({}); const elementsCounterRef = (0, import_element125.useRef)({}); const previousValuesRef = (0, import_element125.useRef)({}); const validate = (0, import_element125.useCallback)(() => { const promiseHandler = { customCounterRef, elementsCounterRef, setFormValidity, path: [], item }; const formFieldsToValidate = getFormFieldsToValidate(form, fields); if (formFieldsToValidate.length === 0) { setFormValidity(void 0); return; } const newFormValidity = {}; const untouchedFields = []; formFieldsToValidate.forEach((formField) => { const value = getFormFieldValue(formField, item); if (previousValuesRef.current.hasOwnProperty(formField.id) && (0, import_es63.default)( previousValuesRef.current[formField.id], value )) { untouchedFields.push(formField.id); return; } previousValuesRef.current[formField.id] = value; const fieldValidity = validateFormField( item, formField, promiseHandler ); if (fieldValidity !== void 0) { newFormValidity[formField.id] = fieldValidity; } }); setFormValidity((existingFormValidity) => { let validity = { ...existingFormValidity, ...newFormValidity }; const fieldsToKeep = [ ...untouchedFields, ...Object.keys(newFormValidity) ]; Object.keys(validity).forEach((key) => { if (validity && !fieldsToKeep.includes(key)) { delete validity[key]; } }); if (Object.keys(validity).length === 0) { validity = void 0; } const areEqual = (0, import_es63.default)(existingFormValidity, validity); if (areEqual) { return existingFormValidity; } return validity; }); }, [item, fields, form]); (0, import_element125.useEffect)(() => { validate(); }, [validate]); return { validity: formValidity, isValid: isFormValid(formValidity) }; } var use_form_validity_default = useFormValidity; // packages/dataviews/build-module/hooks/use-report-validity.mjs var import_element126 = __toESM(require_element(), 1); function useReportValidity(ref, shouldReport) { (0, import_element126.useEffect)(() => { if (shouldReport && ref.current) { const inputs = ref.current.querySelectorAll( "input, textarea, select" ); inputs.forEach((input) => { input.reportValidity(); }); } }, [shouldReport, ref]); } // packages/dataviews/build-module/components/dataform-layouts/panel/utils/use-field-from-form-field.mjs var import_element127 = __toESM(require_element(), 1); // packages/dataviews/build-module/components/dataform-layouts/get-summary-fields.mjs function extractSummaryIds(summary) { if (Array.isArray(summary)) { return summary.map( (item) => typeof item === "string" ? item : item.id ); } return []; } var getSummaryFields = (summaryField, fields) => { if (Array.isArray(summaryField) && summaryField.length > 0) { const summaryIds = extractSummaryIds(summaryField); return summaryIds.map( (summaryId) => fields.find((_field) => _field.id === summaryId) ).filter((_field) => _field !== void 0); } return []; }; // packages/dataviews/build-module/components/dataform-layouts/panel/utils/use-field-from-form-field.mjs var getFieldDefinition = (field, fields) => { const fieldDefinition = fields.find((_field) => _field.id === field.id); if (!fieldDefinition) { return fields.find((_field) => { if (!!field.children) { const simpleChildren = field.children.filter( (child) => !child.children ); if (simpleChildren.length === 0) { return false; } return _field.id === simpleChildren[0].id; } return _field.id === field.id; }); } return fieldDefinition; }; function useFieldFromFormField(field) { const { fields } = (0, import_element127.useContext)(dataform_context_default); const layout = field.layout; const summaryFields = getSummaryFields(layout.summary, fields); const fieldDefinition = getFieldDefinition(field, fields); const fieldLabel = !!field.children ? field.label : fieldDefinition?.label; if (summaryFields.length === 0) { return { summaryFields: fieldDefinition ? [fieldDefinition] : [], fieldDefinition, fieldLabel }; } return { summaryFields, fieldDefinition, fieldLabel }; } var use_field_from_form_field_default = useFieldFromFormField; // packages/dataviews/build-module/components/dataform-layouts/panel/modal.mjs var import_jsx_runtime258 = __toESM(require_jsx_runtime(), 1); function ModalContent({ data, field, onChange, fieldLabel, onClose, touched }) { const { fields } = (0, import_element128.useContext)(dataform_context_default); const [changes, setChanges] = (0, import_element128.useState)({}); const modalData = (0, import_element128.useMemo)(() => { return (0, import_deepmerge3.default)(data, changes, { arrayMerge: (target, source) => source }); }, [data, changes]); const form = (0, import_element128.useMemo)( () => ({ layout: DEFAULT_LAYOUT, fields: !!field.children ? field.children : ( // If not explicit children return the field id itself. [{ id: field.id, layout: DEFAULT_LAYOUT }] ) }), [field] ); const fieldsAsFieldType = fields.map((f2) => ({ ...f2, Edit: f2.Edit === null ? void 0 : f2.Edit, isValid: { required: f2.isValid.required?.constraint, elements: f2.isValid.elements?.constraint, min: f2.isValid.min?.constraint, max: f2.isValid.max?.constraint, pattern: f2.isValid.pattern?.constraint, minLength: f2.isValid.minLength?.constraint, maxLength: f2.isValid.maxLength?.constraint } })); const { validity } = use_form_validity_default(modalData, fieldsAsFieldType, form); const onApply = () => { onChange(changes); onClose(); }; const handleOnChange = (newValue) => { setChanges( (prev) => (0, import_deepmerge3.default)(prev, newValue, { arrayMerge: (target, source) => source }) ); }; const focusOnMountRef = (0, import_compose25.useFocusOnMount)("firstInputElement"); const contentRef = (0, import_element128.useRef)(null); const mergedRef = (0, import_compose25.useMergeRefs)([focusOnMountRef, contentRef]); useReportValidity(contentRef, touched); return /* @__PURE__ */ (0, import_jsx_runtime258.jsxs)( import_components140.Modal, { className: "dataforms-layouts-panel__modal", onRequestClose: onClose, isFullScreen: false, title: fieldLabel, size: "medium", children: [ /* @__PURE__ */ (0, import_jsx_runtime258.jsx)("div", { ref: mergedRef, children: /* @__PURE__ */ (0, import_jsx_runtime258.jsx)( DataFormLayout, { data: modalData, form, onChange: handleOnChange, validity, children: (FieldLayout, childField, childFieldValidity, markWhenOptional) => /* @__PURE__ */ (0, import_jsx_runtime258.jsx)( FieldLayout, { data: modalData, field: childField, onChange: handleOnChange, hideLabelFromVision: form.fields.length < 2, markWhenOptional, validity: childFieldValidity }, childField.id ) } ) }), /* @__PURE__ */ (0, import_jsx_runtime258.jsxs)( Stack, { direction: "row", className: "dataforms-layouts-panel__modal-footer", gap: "md", children: [ /* @__PURE__ */ (0, import_jsx_runtime258.jsx)(import_components140.__experimentalSpacer, { style: { flex: 1 } }), /* @__PURE__ */ (0, import_jsx_runtime258.jsx)( import_components140.Button, { variant: "tertiary", onClick: onClose, __next40pxDefaultSize: true, children: (0, import_i18n128.__)("Cancel") } ), /* @__PURE__ */ (0, import_jsx_runtime258.jsx)( import_components140.Button, { variant: "primary", onClick: onApply, __next40pxDefaultSize: true, children: (0, import_i18n128.__)("Apply") } ) ] } ) ] } ); } function PanelModal({ data, field, onChange, validity }) { const [touched, setTouched] = (0, import_element128.useState)(false); const [isOpen, setIsOpen] = (0, import_element128.useState)(false); const { fieldDefinition, fieldLabel, summaryFields } = use_field_from_form_field_default(field); if (!fieldDefinition) { return null; } const handleClose = () => { setIsOpen(false); setTouched(true); }; return /* @__PURE__ */ (0, import_jsx_runtime258.jsxs)(import_jsx_runtime258.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime258.jsx)( SummaryButton, { data, field, fieldLabel, summaryFields, validity, touched, disabled: fieldDefinition.readOnly === true, onClick: () => setIsOpen(true), "aria-expanded": isOpen } ), isOpen && /* @__PURE__ */ (0, import_jsx_runtime258.jsx)( ModalContent, { data, field, onChange, fieldLabel: fieldLabel ?? "", onClose: handleClose, touched } ) ] }); } var modal_default2 = PanelModal; // packages/dataviews/build-module/components/dataform-layouts/panel/dropdown.mjs var import_components141 = __toESM(require_components(), 1); var import_i18n129 = __toESM(require_i18n(), 1); var import_element129 = __toESM(require_element(), 1); var import_compose26 = __toESM(require_compose(), 1); var import_jsx_runtime259 = __toESM(require_jsx_runtime(), 1); function DropdownHeader({ title, onClose }) { return /* @__PURE__ */ (0, import_jsx_runtime259.jsx)( Stack, { direction: "column", className: "dataforms-layouts-panel__dropdown-header", gap: "lg", children: /* @__PURE__ */ (0, import_jsx_runtime259.jsxs)(Stack, { direction: "row", gap: "sm", align: "center", children: [ title && /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(import_components141.__experimentalHeading, { level: 2, size: 13, children: title }), /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(import_components141.__experimentalSpacer, { style: { flex: 1 } }), onClose && /* @__PURE__ */ (0, import_jsx_runtime259.jsx)( import_components141.Button, { label: (0, import_i18n129.__)("Close"), icon: close_small_default, onClick: onClose, size: "small" } ) ] }) } ); } function DropdownContentWithValidation({ touched, children }) { const ref = (0, import_element129.useRef)(null); useReportValidity(ref, touched); return /* @__PURE__ */ (0, import_jsx_runtime259.jsx)("div", { ref, children }); } function PanelDropdown({ data, field, onChange, validity }) { const [touched, setTouched] = (0, import_element129.useState)(false); const [popoverAnchor, setPopoverAnchor] = (0, import_element129.useState)( null ); const popoverProps = (0, import_element129.useMemo)( () => ({ // Anchor the popover to the middle of the entire row so that it doesn't // move around when the label changes. anchor: popoverAnchor, placement: "left-start", offset: 36, shift: true }), [popoverAnchor] ); const [dialogRef, dialogProps] = (0, import_compose26.__experimentalUseDialog)({ focusOnMount: "firstInputElement" }); const form = (0, import_element129.useMemo)( () => ({ layout: DEFAULT_LAYOUT, fields: !!field.children ? field.children : ( // If not explicit children return the field id itself. [{ id: field.id, layout: DEFAULT_LAYOUT }] ) }), [field] ); const formValidity = (0, import_element129.useMemo)(() => { if (validity === void 0) { return void 0; } if (!!field.children) { return validity?.children; } return { [field.id]: validity }; }, [validity, field]); const { fieldDefinition, fieldLabel, summaryFields } = use_field_from_form_field_default(field); if (!fieldDefinition) { return null; } return /* @__PURE__ */ (0, import_jsx_runtime259.jsx)( "div", { ref: setPopoverAnchor, className: "dataforms-layouts-panel__field-dropdown-anchor", children: /* @__PURE__ */ (0, import_jsx_runtime259.jsx)( import_components141.Dropdown, { contentClassName: "dataforms-layouts-panel__field-dropdown", popoverProps, focusOnMount: false, onToggle: (willOpen) => { if (!willOpen) { setTouched(true); } }, renderToggle: ({ isOpen, onToggle }) => /* @__PURE__ */ (0, import_jsx_runtime259.jsx)( SummaryButton, { data, field, fieldLabel, summaryFields, validity, touched, disabled: fieldDefinition.readOnly === true, onClick: onToggle, "aria-expanded": isOpen } ), renderContent: ({ onClose }) => /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(DropdownContentWithValidation, { touched, children: /* @__PURE__ */ (0, import_jsx_runtime259.jsxs)("div", { ref: dialogRef, ...dialogProps, children: [ /* @__PURE__ */ (0, import_jsx_runtime259.jsx)( DropdownHeader, { title: fieldLabel, onClose } ), /* @__PURE__ */ (0, import_jsx_runtime259.jsx)( DataFormLayout, { data, form, onChange, validity: formValidity, children: (FieldLayout, childField, childFieldValidity, markWhenOptional) => /* @__PURE__ */ (0, import_jsx_runtime259.jsx)( FieldLayout, { data, field: childField, onChange, hideLabelFromVision: (form?.fields ?? []).length < 2, markWhenOptional, validity: childFieldValidity }, childField.id ) } ) ] }) }) } ) } ); } var dropdown_default = PanelDropdown; // packages/dataviews/build-module/components/dataform-layouts/panel/index.mjs var import_jsx_runtime260 = __toESM(require_jsx_runtime(), 1); function FormPanelField({ data, field, onChange, validity }) { const layout = field.layout; if (layout.openAs === "modal") { return /* @__PURE__ */ (0, import_jsx_runtime260.jsx)( modal_default2, { data, field, onChange, validity } ); } return /* @__PURE__ */ (0, import_jsx_runtime260.jsx)( dropdown_default, { data, field, onChange, validity } ); } // packages/dataviews/build-module/components/dataform-layouts/card/index.mjs var import_components142 = __toESM(require_components(), 1); var import_compose27 = __toESM(require_compose(), 1); var import_element130 = __toESM(require_element(), 1); var import_i18n131 = __toESM(require_i18n(), 1); // packages/dataviews/build-module/components/dataform-layouts/validation-badge.mjs var import_i18n130 = __toESM(require_i18n(), 1); var import_jsx_runtime261 = __toESM(require_jsx_runtime(), 1); function countInvalidFields(validity) { if (!validity) { return 0; } let count = 0; const validityRules = Object.keys(validity).filter( (key) => key !== "children" ); for (const key of validityRules) { const rule = validity[key]; if (rule?.type === "invalid") { count++; } } if (validity.children) { for (const childValidity of Object.values(validity.children)) { count += countInvalidFields(childValidity); } } return count; } function ValidationBadge({ validity }) { const invalidCount = countInvalidFields(validity); if (invalidCount === 0) { return null; } return /* @__PURE__ */ (0, import_jsx_runtime261.jsx)(Badge, { intent: "high", children: (0, import_i18n130.sprintf)( /* translators: %d: Number of fields that need attention */ (0, import_i18n130._n)( "%d field needs attention", "%d fields need attention", invalidCount ), invalidCount ) }); } // packages/dataviews/build-module/components/dataform-layouts/card/index.mjs var import_jsx_runtime262 = __toESM(require_jsx_runtime(), 1); function isSummaryFieldVisible(summaryField, summaryConfig, isOpen) { if (!summaryConfig || Array.isArray(summaryConfig) && summaryConfig.length === 0) { return false; } const summaryConfigArray = Array.isArray(summaryConfig) ? summaryConfig : [summaryConfig]; const fieldConfig = summaryConfigArray.find((config2) => { if (typeof config2 === "string") { return config2 === summaryField.id; } if (typeof config2 === "object" && "id" in config2) { return config2.id === summaryField.id; } return false; }); if (!fieldConfig) { return false; } if (typeof fieldConfig === "string") { return true; } if (typeof fieldConfig === "object" && "visibility" in fieldConfig) { return fieldConfig.visibility === "always" || fieldConfig.visibility === "when-collapsed" && !isOpen; } return true; } function FormCardField({ data, field, onChange, hideLabelFromVision, markWhenOptional, validity }) { const { fields } = (0, import_element130.useContext)(dataform_context_default); const layout = field.layout; const cardBodyRef = (0, import_element130.useRef)(null); const bodyId = (0, import_compose27.useInstanceId)( FormCardField, "dataforms-layouts-card-card-body" ); const form = (0, import_element130.useMemo)( () => ({ layout: DEFAULT_LAYOUT, fields: field.children ?? [] }), [field] ); const { isOpened, isCollapsible } = layout; const [internalIsOpen, setIsOpen] = (0, import_element130.useState)(isOpened); const [touched, setTouched] = (0, import_element130.useState)(false); (0, import_element130.useEffect)(() => { setIsOpen(isOpened); }, [isOpened]); const toggle = (0, import_element130.useCallback)(() => { setIsOpen((prev) => { if (prev) { setTouched(true); } return !prev; }); }, []); const isOpen = isCollapsible ? internalIsOpen : true; const handleBlur = (0, import_element130.useCallback)(() => { setTouched(true); }, [setTouched]); useReportValidity(cardBodyRef, isOpen && touched); const summaryFields = getSummaryFields(layout.summary, fields); const visibleSummaryFields = summaryFields.filter( (summaryField) => isSummaryFieldVisible(summaryField, layout.summary, isOpen) ); const validationBadge = touched && layout.isCollapsible ? /* @__PURE__ */ (0, import_jsx_runtime262.jsx)(ValidationBadge, { validity }) : null; const sizeCard = { blockStart: "medium", blockEnd: "medium", inlineStart: "medium", inlineEnd: "medium" }; let label = field.label; let withHeader; let bodyContent; if (field.children) { withHeader = !!label && layout.withHeader; bodyContent = /* @__PURE__ */ (0, import_jsx_runtime262.jsxs)(import_jsx_runtime262.Fragment, { children: [ field.description && /* @__PURE__ */ (0, import_jsx_runtime262.jsx)("div", { className: "dataforms-layouts-card__field-description", children: field.description }), /* @__PURE__ */ (0, import_jsx_runtime262.jsx)( DataFormLayout, { data, form, onChange, validity: validity?.children } ) ] }); } else { const fieldDefinition = fields.find( (fieldDef) => fieldDef.id === field.id ); if (!fieldDefinition || !fieldDefinition.Edit) { return null; } const SingleFieldLayout = getFormFieldLayout("regular")?.component; if (!SingleFieldLayout) { return null; } label = fieldDefinition.label; withHeader = !!label && layout.withHeader; bodyContent = /* @__PURE__ */ (0, import_jsx_runtime262.jsx)( SingleFieldLayout, { data, field, onChange, hideLabelFromVision: hideLabelFromVision || withHeader, markWhenOptional, validity } ); } const sizeCardBody = { blockStart: withHeader ? "none" : "medium", blockEnd: "medium", inlineStart: "medium", inlineEnd: "medium" }; return /* @__PURE__ */ (0, import_jsx_runtime262.jsxs)(import_components142.Card, { className: "dataforms-layouts-card__field", size: sizeCard, children: [ withHeader && /* @__PURE__ */ (0, import_jsx_runtime262.jsxs)( import_components142.CardHeader, { className: "dataforms-layouts-card__field-header", onClick: isCollapsible ? toggle : void 0, style: { cursor: isCollapsible ? "pointer" : void 0 }, isBorderless: true, children: [ /* @__PURE__ */ (0, import_jsx_runtime262.jsxs)( "div", { style: { // Match the expand/collapse button's height to avoid layout // differences when that button is not displayed. height: isCollapsible ? void 0 : "40px", width: "100%", display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [ /* @__PURE__ */ (0, import_jsx_runtime262.jsx)("span", { className: "dataforms-layouts-card__field-header-label", children: label }), validationBadge, visibleSummaryFields.length > 0 && layout.withHeader && /* @__PURE__ */ (0, import_jsx_runtime262.jsx)("div", { className: "dataforms-layouts-card__field-summary", children: visibleSummaryFields.map( (summaryField) => /* @__PURE__ */ (0, import_jsx_runtime262.jsx)( summaryField.render, { item: data, field: summaryField }, summaryField.id ) ) }) ] } ), isCollapsible && /* @__PURE__ */ (0, import_jsx_runtime262.jsx)( import_components142.Button, { __next40pxDefaultSize: true, variant: "tertiary", icon: isOpen ? chevron_up_default : chevron_down_default, "aria-expanded": isOpen, "aria-controls": bodyId, "aria-label": isOpen ? (0, import_i18n131.__)("Collapse") : (0, import_i18n131.__)("Expand") } ) ] } ), (isOpen || !withHeader) && // If it doesn't have a header, keep it open. // Otherwise, the card will not be visible. /* @__PURE__ */ (0, import_jsx_runtime262.jsx)( import_components142.CardBody, { id: bodyId, size: sizeCardBody, className: "dataforms-layouts-card__field-control", ref: cardBodyRef, onBlur: handleBlur, children: bodyContent } ) ] }); } // packages/dataviews/build-module/components/dataform-layouts/row/index.mjs var import_components143 = __toESM(require_components(), 1); var import_jsx_runtime263 = __toESM(require_jsx_runtime(), 1); function Header3({ title }) { return /* @__PURE__ */ (0, import_jsx_runtime263.jsx)( Stack, { direction: "column", className: "dataforms-layouts-row__header", gap: "lg", children: /* @__PURE__ */ (0, import_jsx_runtime263.jsx)(Stack, { direction: "row", align: "center", children: /* @__PURE__ */ (0, import_jsx_runtime263.jsx)(import_components143.__experimentalHeading, { level: 2, size: 13, children: title }) }) } ); } var EMPTY_WRAPPER = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime263.jsx)(import_jsx_runtime263.Fragment, { children }); function FormRowField({ data, field, onChange, hideLabelFromVision, markWhenOptional, validity }) { const layout = field.layout; if (!!field.children) { const form = { layout: DEFAULT_LAYOUT, fields: field.children }; return /* @__PURE__ */ (0, import_jsx_runtime263.jsxs)("div", { className: "dataforms-layouts-row__field", children: [ !hideLabelFromVision && field.label && /* @__PURE__ */ (0, import_jsx_runtime263.jsx)(Header3, { title: field.label }), /* @__PURE__ */ (0, import_jsx_runtime263.jsx)(Stack, { direction: "row", align: layout.alignment, gap: "lg", children: /* @__PURE__ */ (0, import_jsx_runtime263.jsx)( DataFormLayout, { data, form, onChange, validity: validity?.children, as: EMPTY_WRAPPER, children: (FieldLayout, childField, childFieldValidity) => /* @__PURE__ */ (0, import_jsx_runtime263.jsx)( "div", { className: "dataforms-layouts-row__field-control", style: layout.styles[childField.id], children: /* @__PURE__ */ (0, import_jsx_runtime263.jsx)( FieldLayout, { data, field: childField, onChange, hideLabelFromVision, markWhenOptional, validity: childFieldValidity } ) }, childField.id ) } ) }) ] }); } const RegularLayout = getFormFieldLayout("regular")?.component; if (!RegularLayout) { return null; } return /* @__PURE__ */ (0, import_jsx_runtime263.jsx)(import_jsx_runtime263.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime263.jsx)("div", { className: "dataforms-layouts-row__field-control", children: /* @__PURE__ */ (0, import_jsx_runtime263.jsx)( RegularLayout, { data, field, onChange, markWhenOptional, validity } ) }) }); } // packages/dataviews/build-module/components/dataform-layouts/details/index.mjs var import_element131 = __toESM(require_element(), 1); var import_i18n132 = __toESM(require_i18n(), 1); var import_jsx_runtime264 = __toESM(require_jsx_runtime(), 1); function FormDetailsField({ data, field, onChange, validity }) { const { fields } = (0, import_element131.useContext)(dataform_context_default); const detailsRef = (0, import_element131.useRef)(null); const contentRef = (0, import_element131.useRef)(null); const [touched, setTouched] = (0, import_element131.useState)(false); const [isOpen, setIsOpen] = (0, import_element131.useState)(false); const form = (0, import_element131.useMemo)( () => ({ layout: DEFAULT_LAYOUT, fields: field.children ?? [] }), [field] ); (0, import_element131.useEffect)(() => { const details = detailsRef.current; if (!details) { return; } const handleToggle = () => { const nowOpen = details.open; if (!nowOpen) { setTouched(true); } setIsOpen(nowOpen); }; details.addEventListener("toggle", handleToggle); return () => { details.removeEventListener("toggle", handleToggle); }; }, []); useReportValidity(contentRef, isOpen && touched); const handleBlur = (0, import_element131.useCallback)(() => { setTouched(true); }, []); if (!field.children) { return null; } const summaryFieldId = field.layout.summary ?? ""; const summaryField = summaryFieldId ? fields.find((fieldDef) => fieldDef.id === summaryFieldId) : void 0; let summaryContent; if (summaryField && summaryField.render) { summaryContent = /* @__PURE__ */ (0, import_jsx_runtime264.jsx)(summaryField.render, { item: data, field: summaryField }); } else { summaryContent = field.label || (0, import_i18n132.__)("More details"); } return /* @__PURE__ */ (0, import_jsx_runtime264.jsxs)( "details", { ref: detailsRef, className: "dataforms-layouts-details__details", children: [ /* @__PURE__ */ (0, import_jsx_runtime264.jsx)("summary", { className: "dataforms-layouts-details__summary", children: /* @__PURE__ */ (0, import_jsx_runtime264.jsxs)( Stack, { direction: "row", align: "center", gap: "md", className: "dataforms-layouts-details__summary-content", children: [ summaryContent, touched && /* @__PURE__ */ (0, import_jsx_runtime264.jsx)(ValidationBadge, { validity }) ] } ) }), /* @__PURE__ */ (0, import_jsx_runtime264.jsx)( "div", { ref: contentRef, className: "dataforms-layouts-details__content", onBlur: handleBlur, children: /* @__PURE__ */ (0, import_jsx_runtime264.jsx)( DataFormLayout, { data, form, onChange, validity: validity?.children } ) } ) ] } ); } // packages/dataviews/build-module/components/dataform-layouts/index.mjs var import_jsx_runtime265 = __toESM(require_jsx_runtime(), 1); var FORM_FIELD_LAYOUTS = [ { type: "regular", component: FormRegularField, wrapper: ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime265.jsx)( Stack, { direction: "column", className: "dataforms-layouts__wrapper", gap: "lg", children } ) }, { type: "panel", component: FormPanelField, wrapper: ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime265.jsx)( Stack, { direction: "column", className: "dataforms-layouts__wrapper", gap: "md", children } ) }, { type: "card", component: FormCardField, wrapper: ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime265.jsx)( Stack, { direction: "column", className: "dataforms-layouts__wrapper", gap: "xl", children } ) }, { type: "row", component: FormRowField, wrapper: ({ children, layout }) => /* @__PURE__ */ (0, import_jsx_runtime265.jsx)( Stack, { direction: "column", className: "dataforms-layouts__wrapper", gap: "lg", children: /* @__PURE__ */ (0, import_jsx_runtime265.jsx)("div", { className: "dataforms-layouts-row__field", children: /* @__PURE__ */ (0, import_jsx_runtime265.jsx)( Stack, { direction: "row", gap: "lg", align: layout.alignment, children } ) }) } ) }, { type: "details", component: FormDetailsField } ]; function getFormFieldLayout(type) { return FORM_FIELD_LAYOUTS.find((layout) => layout.type === type); } // packages/dataviews/build-module/components/dataform-layouts/data-form-layout.mjs var import_jsx_runtime266 = __toESM(require_jsx_runtime(), 1); var DEFAULT_WRAPPER = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime266.jsx)(Stack, { direction: "column", className: "dataforms-layouts__wrapper", gap: "lg", children }); function DataFormLayout({ data, form, onChange, validity, children, as }) { const { fields: fieldDefinitions } = (0, import_element132.useContext)(dataform_context_default); const markWhenOptional = (0, import_element132.useMemo)(() => { const requiredCount = fieldDefinitions.filter( (f2) => !!f2.isValid?.required ).length; const optionalCount = fieldDefinitions.length - requiredCount; return requiredCount > optionalCount; }, [fieldDefinitions]); function getFieldDefinition2(field) { return fieldDefinitions.find( (fieldDefinition) => fieldDefinition.id === field.id ); } const Wrapper = as ?? getFormFieldLayout(form.layout.type)?.wrapper ?? DEFAULT_WRAPPER; return /* @__PURE__ */ (0, import_jsx_runtime266.jsx)(Wrapper, { layout: form.layout, children: form.fields.map((formField) => { const FieldLayout = getFormFieldLayout(formField.layout.type)?.component; if (!FieldLayout) { return null; } const fieldDefinition = !formField.children ? getFieldDefinition2(formField) : void 0; if (fieldDefinition && fieldDefinition.isVisible && !fieldDefinition.isVisible(data)) { return null; } if (children) { return children( FieldLayout, formField, validity?.[formField.id], markWhenOptional ); } return /* @__PURE__ */ (0, import_jsx_runtime266.jsx)( FieldLayout, { data, field: formField, onChange, markWhenOptional, validity: validity?.[formField.id] }, formField.id ); }) }); } // packages/dataviews/build-module/dataform/index.mjs var import_jsx_runtime267 = __toESM(require_jsx_runtime(), 1); function DataForm({ data, form, fields, onChange, validity }) { const normalizedForm = (0, import_element133.useMemo)(() => normalize_form_default(form), [form]); const normalizedFields = (0, import_element133.useMemo)( () => normalizeFields(fields), [fields] ); if (!form.fields) { return null; } return /* @__PURE__ */ (0, import_jsx_runtime267.jsx)(DataFormProvider, { fields: normalizedFields, children: /* @__PURE__ */ (0, import_jsx_runtime267.jsx)( DataFormLayout, { data, form: normalizedForm, onChange, validity } ) }); } // packages/dataviews/build-module/utils/filter-sort-and-paginate.mjs var import_remove_accents2 = __toESM(require_remove_accents(), 1); var import_deprecated4 = __toESM(require_deprecated(), 1); function normalizeSearchInput2(input = "") { return (0, import_remove_accents2.default)(input.trim().toLowerCase()); } var EMPTY_ARRAY10 = []; function filterSortAndPaginate(data, view, fields) { if (!data) { return { data: EMPTY_ARRAY10, paginationInfo: { totalItems: 0, totalPages: 0 } }; } const _fields = normalizeFields(fields); let filteredData = [...data]; if (view.search) { const normalizedSearch = normalizeSearchInput2(view.search); filteredData = filteredData.filter((item) => { return _fields.filter((field) => field.enableGlobalSearch).some((field) => { const fieldValue = field.getValue({ item }); const values = Array.isArray(fieldValue) ? fieldValue : [fieldValue]; return values.some( (value) => normalizeSearchInput2(String(value)).includes( normalizedSearch ) ); }); }); } if (view.filters && view.filters?.length > 0) { view.filters.forEach((filter) => { const field = _fields.find( (_field) => _field.id === filter.field ); if (field) { if (filter.operator === OPERATOR_IS_NOT_ALL) { (0, import_deprecated4.default)("The 'isNotAll' filter operator", { since: "7.0", alternative: "'isNone'" }); } const handler = field.filter[filter.operator]; if (handler) { filteredData = filteredData.filter( (item) => handler(item, field, filter.value) ); } } }); } const sortByField = view.sort?.field ? _fields.find((field) => { return field.enableSorting !== false && field.id === view.sort?.field; }) : null; const groupByField = view.groupBy?.field ? _fields.find((field) => { return field.enableSorting !== false && field.id === view.groupBy?.field; }) : null; if (sortByField || groupByField) { filteredData.sort((a2, b2) => { if (groupByField) { const groupCompare = groupByField.sort( a2, b2, view.groupBy?.direction ?? "asc" ); if (groupCompare !== 0) { return groupCompare; } } if (sortByField) { return sortByField.sort(a2, b2, view.sort?.direction ?? "desc"); } return 0; }); } let totalItems = filteredData.length; let totalPages = 1; if (view.page !== void 0 && view.perPage !== void 0) { const start2 = (view.page - 1) * view.perPage; totalItems = filteredData?.length || 0; totalPages = Math.ceil(totalItems / view.perPage); filteredData = filteredData?.slice(start2, start2 + view.perPage); } return { data: filteredData, paginationInfo: { totalItems, totalPages } }; } // packages/edit-site/build-module/components/page-patterns/index.mjs var import_core_data48 = __toESM(require_core_data(), 1); var import_editor31 = __toESM(require_editor(), 1); var import_router31 = __toESM(require_router(), 1); // node_modules/dequal/dist/index.mjs var has = Object.prototype.hasOwnProperty; function find(iter, tar, key) { for (key of iter.keys()) { if (dequal(key, tar)) return key; } } function dequal(foo, bar) { var ctor, len, tmp; if (foo === bar) return true; if (foo && bar && (ctor = foo.constructor) === bar.constructor) { if (ctor === Date) return foo.getTime() === bar.getTime(); if (ctor === RegExp) return foo.toString() === bar.toString(); if (ctor === Array) { if ((len = foo.length) === bar.length) { while (len-- && dequal(foo[len], bar[len])) ; } return len === -1; } if (ctor === Set) { if (foo.size !== bar.size) { return false; } for (len of foo) { tmp = len; if (tmp && typeof tmp === "object") { tmp = find(bar, tmp); if (!tmp) return false; } if (!bar.has(tmp)) return false; } return true; } if (ctor === Map) { if (foo.size !== bar.size) { return false; } for (len of foo) { tmp = len[0]; if (tmp && typeof tmp === "object") { tmp = find(bar, tmp); if (!tmp) return false; } if (!dequal(len[1], bar.get(tmp))) { return false; } } return true; } if (ctor === ArrayBuffer) { foo = new Uint8Array(foo); bar = new Uint8Array(bar); } else if (ctor === DataView) { if ((len = foo.byteLength) === bar.byteLength) { while (len-- && foo.getInt8(len) === bar.getInt8(len)) ; } return len === -1; } if (ArrayBuffer.isView(foo)) { if ((len = foo.byteLength) === bar.byteLength) { while (len-- && foo[len] === bar[len]) ; } return len === -1; } if (!ctor || typeof foo === "object") { len = 0; for (ctor in foo) { if (has.call(foo, ctor) && ++len && !has.call(bar, ctor)) return false; if (!(ctor in bar) || !dequal(foo[ctor], bar[ctor])) return false; } return Object.keys(bar).length === len; } } return foo !== foo && bar !== bar; } // packages/views/build-module/use-view.mjs var import_element134 = __toESM(require_element(), 1); var import_data64 = __toESM(require_data(), 1); var import_preferences11 = __toESM(require_preferences(), 1); // packages/views/build-module/preference-keys.mjs function generatePreferenceKey(kind, name2, slug) { return `dataviews-${kind}-${name2}-${slug}`; } // packages/views/build-module/filter-utils.mjs var SCALAR_VALUES = [ "titleField", "mediaField", "descriptionField", "showTitle", "showMedia", "showDescription", "showLevels", "infiniteScrollEnabled" ]; function mergeActiveViewOverrides(view, activeViewOverrides, defaultView) { if (!activeViewOverrides) { return view; } let result = view; for (const key of SCALAR_VALUES) { if (key in activeViewOverrides) { result = { ...result, [key]: activeViewOverrides[key] }; } } if (activeViewOverrides.filters && activeViewOverrides.filters.length > 0) { const activeFields = new Set( activeViewOverrides.filters.map((f2) => f2.field) ); const preserved = (view.filters ?? []).filter( (f2) => !activeFields.has(f2.field) ); result = { ...result, filters: [...preserved, ...activeViewOverrides.filters] }; } if (activeViewOverrides.sort) { const isDefaultSort = defaultView && view.sort?.field === defaultView.sort?.field && view.sort?.direction === defaultView.sort?.direction; if (isDefaultSort) { result = { ...result, sort: activeViewOverrides.sort }; } } if (activeViewOverrides.layout) { result = { ...result, layout: { ...result.layout, ...activeViewOverrides.layout } }; } if (activeViewOverrides.groupBy) { result = { ...result, groupBy: activeViewOverrides.groupBy }; } return result; } function stripActiveViewOverrides(view, activeViewOverrides, defaultView) { if (!activeViewOverrides) { return view; } let result = view; for (const key of SCALAR_VALUES) { if (key in activeViewOverrides) { const { [key]: _, ...rest } = result; result = rest; } } if (activeViewOverrides.filters && activeViewOverrides.filters.length > 0) { const activeFields = new Set( activeViewOverrides.filters.map((f2) => f2.field) ); result = { ...result, filters: (view.filters ?? []).filter( (f2) => !activeFields.has(f2.field) ) }; } if (activeViewOverrides.sort && view.sort?.field === activeViewOverrides.sort.field && view.sort?.direction === activeViewOverrides.sort.direction) { result = { ...result, sort: defaultView?.sort }; } if (activeViewOverrides.layout && "layout" in result && result.layout) { const layout = { ...result.layout }; for (const key of Object.keys(activeViewOverrides.layout)) { delete layout[key]; } result = { ...result, layout: Object.keys(layout).length > 0 ? layout : void 0 }; } if (activeViewOverrides.groupBy && "groupBy" in result) { const { groupBy: _, ...rest } = result; result = rest; } return result; } // packages/views/build-module/use-view.mjs function omit3(obj, keys) { const result = { ...obj }; for (const key of keys) { delete result[key]; } return result; } function useView(config2) { const { kind, name: name2, slug, defaultView, activeViewOverrides, queryParams, onChangeQueryParams } = config2; const preferenceKey = generatePreferenceKey(kind, name2, slug); const persistedView = (0, import_data64.useSelect)( (select3) => { return select3(import_preferences11.store).get( "core/views", preferenceKey ); }, [preferenceKey] ); const { set } = (0, import_data64.useDispatch)(import_preferences11.store); const baseView = persistedView ?? defaultView; const page = Number(queryParams?.page ?? baseView.page ?? 1); const search = queryParams?.search ?? baseView.search ?? ""; const view = (0, import_element134.useMemo)(() => { return mergeActiveViewOverrides( { ...baseView, page, search }, activeViewOverrides, defaultView ); }, [baseView, page, search, activeViewOverrides, defaultView]); const isModified = !!persistedView; const updateView = (0, import_element134.useCallback)( (newView) => { const urlParams = { page: newView?.page, search: newView?.search }; const preferenceView = stripActiveViewOverrides( omit3(newView, ["page", "search"]), activeViewOverrides, defaultView ); if (onChangeQueryParams && !dequal(urlParams, { page, search })) { onChangeQueryParams(urlParams); } const comparableBaseView = stripActiveViewOverrides( baseView, activeViewOverrides, defaultView ); const comparableDefaultView = stripActiveViewOverrides( defaultView, activeViewOverrides, defaultView ); if (!dequal(comparableBaseView, preferenceView)) { if (dequal(preferenceView, comparableDefaultView)) { set("core/views", preferenceKey, void 0); } else { set("core/views", preferenceKey, preferenceView); } } }, [ onChangeQueryParams, page, search, baseView, defaultView, activeViewOverrides, set, preferenceKey ] ); const resetToDefault = (0, import_element134.useCallback)(() => { set("core/views", preferenceKey, void 0); }, [preferenceKey, set]); return { view, isModified, updateView, resetToDefault }; } // packages/views/build-module/load-view.mjs var import_data65 = __toESM(require_data(), 1); var import_preferences12 = __toESM(require_preferences(), 1); async function loadView(config2) { const { kind, name: name2, slug, defaultView, activeViewOverrides, queryParams } = config2; const preferenceKey = generatePreferenceKey(kind, name2, slug); const persistedView = (0, import_data65.select)(import_preferences12.store).get( "core/views", preferenceKey ); const baseView = persistedView ?? defaultView; const page = queryParams?.page ?? 1; const search = queryParams?.search ?? ""; return mergeActiveViewOverrides( { ...baseView, page, search }, activeViewOverrides, defaultView ); } // packages/edit-site/build-module/components/page-patterns/index.mjs var import_data71 = __toESM(require_data(), 1); var import_url17 = __toESM(require_url(), 1); // packages/edit-site/build-module/components/page-patterns/use-pattern-settings.mjs var import_core_data43 = __toESM(require_core_data(), 1); var import_data66 = __toESM(require_data(), 1); var import_element135 = __toESM(require_element(), 1); var import_block_editor23 = __toESM(require_block_editor(), 1); var import_editor28 = __toESM(require_editor(), 1); var { useGlobalStyles: useGlobalStyles3 } = unlock(import_editor28.privateApis); var { globalStylesDataKey } = unlock(import_block_editor23.privateApis); function usePatternSettings() { const { merged: mergedConfig } = useGlobalStyles3(); const storedSettings = (0, import_data66.useSelect)((select3) => { const { getSettings: getSettings7 } = unlock(select3(store)); return getSettings7(); }, []); const settingsBlockPatterns = storedSettings.__experimentalAdditionalBlockPatterns ?? // WP 6.0 storedSettings.__experimentalBlockPatterns; const restBlockPatterns = (0, import_data66.useSelect)( (select3) => select3(import_core_data43.store).getBlockPatterns(), [] ); const blockPatterns = (0, import_element135.useMemo)( () => [ ...settingsBlockPatterns || [], ...restBlockPatterns || [] ].filter(filterOutDuplicatesByName), [settingsBlockPatterns, restBlockPatterns] ); const [globalStyles, globalSettings] = (0, import_element135.useMemo)(() => { return generateGlobalStyles(mergedConfig, [], { disableRootPadding: false }); }, [mergedConfig]); const settings2 = (0, import_element135.useMemo)(() => { const { __experimentalAdditionalBlockPatterns, styles, __experimentalFeatures, ...restStoredSettings } = storedSettings; const nonGlobalStyles = (styles ?? []).filter( (style) => !style.isGlobalStyles ); return { ...restStoredSettings, styles: [...nonGlobalStyles, ...globalStyles], __experimentalFeatures: globalSettings, [globalStylesDataKey]: mergedConfig.styles ?? {}, __experimentalBlockPatterns: blockPatterns, isPreviewMode: true }; }, [ storedSettings, blockPatterns, globalStyles, globalSettings, mergedConfig ]); return settings2; } // packages/edit-site/build-module/components/page-patterns/actions.mjs var import_components147 = __toESM(require_components(), 1); var import_i18n136 = __toESM(require_i18n(), 1); // packages/edit-site/build-module/components/add-new-pattern/index.mjs var import_components144 = __toESM(require_components(), 1); var import_element136 = __toESM(require_element(), 1); var import_i18n133 = __toESM(require_i18n(), 1); var import_data67 = __toESM(require_data(), 1); var import_router28 = __toESM(require_router(), 1); var import_patterns2 = __toESM(require_patterns(), 1); var import_notices5 = __toESM(require_notices(), 1); var import_core_data44 = __toESM(require_core_data(), 1); var import_editor29 = __toESM(require_editor(), 1); var import_jsx_runtime268 = __toESM(require_jsx_runtime(), 1); var { useHistory: useHistory17, useLocation: useLocation25 } = unlock(import_router28.privateApis); var { CreatePatternModal, useAddPatternCategory } = unlock( import_patterns2.privateApis ); var { CreateTemplatePartModal } = unlock(import_editor29.privateApis); function AddNewPattern() { const history = useHistory17(); const location = useLocation25(); const [showPatternModal, setShowPatternModal] = (0, import_element136.useState)(false); const [showTemplatePartModal, setShowTemplatePartModal] = (0, import_element136.useState)(false); const { createPatternFromFile } = unlock((0, import_data67.useDispatch)(import_patterns2.store)); const { createSuccessNotice, createErrorNotice } = (0, import_data67.useDispatch)(import_notices5.store); const patternUploadInputRef = (0, import_element136.useRef)(); const { isBlockBasedTheme, addNewPatternLabel, addNewTemplatePartLabel, canCreatePattern, canCreateTemplatePart } = (0, import_data67.useSelect)((select3) => { const { getCurrentTheme, getPostType: getPostType2, canUser } = select3(import_core_data44.store); return { isBlockBasedTheme: getCurrentTheme()?.is_block_theme, addNewPatternLabel: getPostType2(PATTERN_TYPES.user)?.labels?.add_new_item, addNewTemplatePartLabel: getPostType2(TEMPLATE_PART_POST_TYPE)?.labels?.add_new_item, // Blocks refers to the wp_block post type, this checks the ability to create a post of that type. canCreatePattern: canUser("create", { kind: "postType", name: PATTERN_TYPES.user }), canCreateTemplatePart: canUser("create", { kind: "postType", name: TEMPLATE_PART_POST_TYPE }) }; }, []); function handleCreatePattern({ pattern }) { setShowPatternModal(false); history.navigate( `/${PATTERN_TYPES.user}/${pattern.id}?canvas=edit` ); } function handleCreateTemplatePart(templatePart) { setShowTemplatePartModal(false); history.navigate( `/${TEMPLATE_PART_POST_TYPE}/${templatePart.id}?canvas=edit` ); } function handleError() { setShowPatternModal(false); setShowTemplatePartModal(false); } const controls = []; if (canCreatePattern) { controls.push({ icon: symbol_default, onClick: () => setShowPatternModal(true), title: addNewPatternLabel }); } if (isBlockBasedTheme && canCreateTemplatePart) { controls.push({ icon: symbol_filled_default, onClick: () => setShowTemplatePartModal(true), title: addNewTemplatePartLabel }); } if (canCreatePattern) { controls.push({ icon: upload_default, onClick: () => { patternUploadInputRef.current.click(); }, title: (0, import_i18n133.__)("Import pattern from JSON") }); } const { categoryMap, findOrCreateTerm } = useAddPatternCategory(); if (controls.length === 0) { return null; } return /* @__PURE__ */ (0, import_jsx_runtime268.jsxs)(import_jsx_runtime268.Fragment, { children: [ addNewPatternLabel && /* @__PURE__ */ (0, import_jsx_runtime268.jsx)( import_components144.DropdownMenu, { controls, icon: null, toggleProps: { variant: "primary", showTooltip: false, __next40pxDefaultSize: true }, text: addNewPatternLabel, label: addNewPatternLabel } ), showPatternModal && /* @__PURE__ */ (0, import_jsx_runtime268.jsx)( CreatePatternModal, { onClose: () => setShowPatternModal(false), onSuccess: handleCreatePattern, onError: handleError } ), showTemplatePartModal && /* @__PURE__ */ (0, import_jsx_runtime268.jsx)( CreateTemplatePartModal, { closeModal: () => setShowTemplatePartModal(false), blocks: [], onCreate: handleCreateTemplatePart, onError: handleError } ), /* @__PURE__ */ (0, import_jsx_runtime268.jsx)( "input", { type: "file", accept: ".json", hidden: true, ref: patternUploadInputRef, onChange: async (event) => { const file = event.target.files?.[0]; if (!file) { return; } try { let currentCategoryId; if (location.query.postType !== TEMPLATE_PART_POST_TYPE) { const currentCategory = Array.from( categoryMap.values() ).find( (term) => term.name === location.query.categoryId ); if (currentCategory) { currentCategoryId = currentCategory.id || await findOrCreateTerm( currentCategory.label ); } } const pattern = await createPatternFromFile( file, currentCategoryId ? [currentCategoryId] : void 0 ); if (!currentCategoryId && location.query.categoryId !== "my-patterns") { history.navigate( `/pattern?categoryId=${PATTERN_DEFAULT_CATEGORY}` ); } createSuccessNotice( (0, import_i18n133.sprintf)( // translators: %s: The imported pattern's title. (0, import_i18n133.__)('Imported "%s" from JSON.'), pattern.title.raw ), { type: "snackbar", id: "import-pattern-success" } ); } catch (err) { createErrorNotice(err.message, { type: "snackbar", id: "import-pattern-error" }); } finally { event.target.value = ""; } } } ) ] }); } // packages/edit-site/build-module/components/page-patterns/rename-category-menu-item.mjs var import_components145 = __toESM(require_components(), 1); var import_element137 = __toESM(require_element(), 1); var import_i18n134 = __toESM(require_i18n(), 1); var import_patterns3 = __toESM(require_patterns(), 1); var import_jsx_runtime269 = __toESM(require_jsx_runtime(), 1); var { RenamePatternCategoryModal } = unlock(import_patterns3.privateApis); function RenameCategoryMenuItem({ category, onClose }) { const [isModalOpen, setIsModalOpen] = (0, import_element137.useState)(false); return /* @__PURE__ */ (0, import_jsx_runtime269.jsxs)(import_jsx_runtime269.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime269.jsx)(import_components145.MenuItem, { onClick: () => setIsModalOpen(true), children: (0, import_i18n134.__)("Rename") }), isModalOpen && /* @__PURE__ */ (0, import_jsx_runtime269.jsx)( RenameModal2, { category, onClose: () => { setIsModalOpen(false); onClose(); } } ) ] }); } function RenameModal2({ category, onClose }) { const normalizedCategory = { id: category.id, slug: category.slug, name: category.label }; const existingCategories = usePatternCategories(); return /* @__PURE__ */ (0, import_jsx_runtime269.jsx)( RenamePatternCategoryModal, { category: normalizedCategory, existingCategories, onClose, overlayClassName: "edit-site-list__rename-modal", focusOnMount: "firstContentElement", size: "small" } ); } // packages/edit-site/build-module/components/page-patterns/delete-category-menu-item.mjs var import_components146 = __toESM(require_components(), 1); var import_core_data45 = __toESM(require_core_data(), 1); var import_data68 = __toESM(require_data(), 1); var import_element138 = __toESM(require_element(), 1); var import_html_entities9 = __toESM(require_html_entities(), 1); var import_i18n135 = __toESM(require_i18n(), 1); var import_notices6 = __toESM(require_notices(), 1); var import_router29 = __toESM(require_router(), 1); var import_jsx_runtime270 = __toESM(require_jsx_runtime(), 1); var { useHistory: useHistory18 } = unlock(import_router29.privateApis); function DeleteCategoryMenuItem({ category, onClose }) { const [isModalOpen, setIsModalOpen] = (0, import_element138.useState)(false); const history = useHistory18(); const { createSuccessNotice, createErrorNotice } = (0, import_data68.useDispatch)(import_notices6.store); const { deleteEntityRecord, invalidateResolution } = (0, import_data68.useDispatch)(import_core_data45.store); const onDelete = async () => { try { await deleteEntityRecord( "taxonomy", "wp_pattern_category", category.id, { force: true }, { throwOnError: true } ); invalidateResolution("getUserPatternCategories"); invalidateResolution("getEntityRecords", [ "postType", PATTERN_TYPES.user, { per_page: -1 } ]); createSuccessNotice( (0, import_i18n135.sprintf)( /* translators: %s: The pattern category's name */ (0, import_i18n135._x)('"%s" deleted.', "pattern category"), category.label ), { type: "snackbar", id: "pattern-category-delete" } ); onClose?.(); history.navigate( `/pattern?categoryId=${PATTERN_DEFAULT_CATEGORY}` ); } catch (error) { const errorMessage = error.message && error.code !== "unknown_error" ? error.message : (0, import_i18n135.__)( "An error occurred while deleting the pattern category." ); createErrorNotice(errorMessage, { type: "snackbar", id: "pattern-category-delete" }); } }; return /* @__PURE__ */ (0, import_jsx_runtime270.jsxs)(import_jsx_runtime270.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime270.jsx)(import_components146.MenuItem, { isDestructive: true, onClick: () => setIsModalOpen(true), children: (0, import_i18n135.__)("Delete") }), /* @__PURE__ */ (0, import_jsx_runtime270.jsx)( import_components146.__experimentalConfirmDialog, { isOpen: isModalOpen, onConfirm: onDelete, onCancel: () => setIsModalOpen(false), confirmButtonText: (0, import_i18n135.__)("Delete"), className: "edit-site-patterns__delete-modal", title: (0, import_i18n135.sprintf)( // translators: %s: The pattern category's name. (0, import_i18n135._x)('Delete "%s"?', "pattern category"), (0, import_html_entities9.decodeEntities)(category.label) ), size: "medium", __experimentalHideHeader: false, children: (0, import_i18n135.sprintf)( // translators: %s: The pattern category's name. (0, import_i18n135.__)( 'Are you sure you want to delete the category "%s"? The patterns will not be deleted.' ), (0, import_html_entities9.decodeEntities)(category.label) ) } ) ] }); } // packages/edit-site/build-module/components/page-patterns/actions.mjs var import_jsx_runtime271 = __toESM(require_jsx_runtime(), 1); function PatternsActions({ categoryId, type }) { const { patternCategories } = usePatternCategories(); let patternCategory; if (type === PATTERN_TYPES.user && !!categoryId) { patternCategory = patternCategories.find( (category) => category.name === categoryId ); } return /* @__PURE__ */ (0, import_jsx_runtime271.jsxs)(import_jsx_runtime271.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime271.jsx)(AddNewPattern, {}), !!patternCategory?.id && /* @__PURE__ */ (0, import_jsx_runtime271.jsx)( import_components147.DropdownMenu, { icon: more_vertical_default, label: (0, import_i18n136.__)("Actions"), toggleProps: { className: "edit-site-patterns__button", size: "compact" }, children: ({ onClose }) => /* @__PURE__ */ (0, import_jsx_runtime271.jsxs)(import_components147.MenuGroup, { children: [ /* @__PURE__ */ (0, import_jsx_runtime271.jsx)( RenameCategoryMenuItem, { category: patternCategory, onClose } ), /* @__PURE__ */ (0, import_jsx_runtime271.jsx)( DeleteCategoryMenuItem, { category: patternCategory, onClose } ) ] }) } ) ] }); } // packages/edit-site/build-module/components/dataviews-actions/index.mjs var import_i18n137 = __toESM(require_i18n(), 1); var import_element139 = __toESM(require_element(), 1); var import_router30 = __toESM(require_router(), 1); var import_data69 = __toESM(require_data(), 1); var import_core_data46 = __toESM(require_core_data(), 1); var import_url16 = __toESM(require_url(), 1); var { useLocation: useLocation26, useHistory: useHistory19 } = unlock(import_router30.privateApis); var useSetActiveTemplateAction = () => { const activeTheme = (0, import_data69.useSelect)( (select3) => select3(import_core_data46.store).getCurrentTheme() ); const { getEntityRecord } = (0, import_data69.useSelect)(import_core_data46.store); const { editEntityRecord, saveEditedEntityRecord } = (0, import_data69.useDispatch)(import_core_data46.store); return (0, import_element139.useMemo)( () => ({ id: "set-active-template", label(items) { return items.some((item) => item._isActive) ? (0, import_i18n137.__)("Deactivate") : (0, import_i18n137.__)("Activate"); }, isPrimary: true, icon: pencil_default, isEligible(item) { if (item.theme !== activeTheme.stylesheet) { return false; } if (typeof item.id !== "number") { return item._isActive === false; } return true; }, async callback(items) { const deactivate = items.some((item) => item._isActive); const activeTemplates = { ...await getEntityRecord("root", "site").active_templates ?? {} }; for (const item of items) { if (deactivate) { delete activeTemplates[item.slug]; } else { activeTemplates[item.slug] = item.id; } } await editEntityRecord("root", "site", void 0, { active_templates: activeTemplates }); await saveEditedEntityRecord("root", "site"); } }), [ editEntityRecord, saveEditedEntityRecord, getEntityRecord, activeTheme ] ); }; var useEditPostAction = () => { const history = useHistory19(); return (0, import_element139.useMemo)( () => ({ id: "edit-post", label: (0, import_i18n137.__)("Edit"), icon: pencil_default, isEligible(post2) { if (post2.status === "trash") { return false; } return post2.type !== PATTERN_TYPES.theme; }, callback(items) { const post2 = items[0]; history.navigate(`/${post2.type}/${post2.id}?canvas=edit`); } }), [history] ); }; var useQuickEditPostAction = () => { const history = useHistory19(); const { path, query } = useLocation26(); return (0, import_element139.useMemo)( () => ({ id: "quick-edit", label: (0, import_i18n137.__)("Quick Edit"), icon: drawer_right_default, isPrimary: true, supportsBulk: true, isEligible(post2) { if (post2.status === "trash") { return false; } return post2.type === "page"; }, callback(items) { history.navigate( (0, import_url16.addQueryArgs)(path, { ...query, quickEdit: true, postId: items.map((item) => item.id).join(",") }) ); } }), [history, path, query] ); }; // packages/edit-site/build-module/components/page-patterns/fields.mjs var import_components148 = __toESM(require_components(), 1); var import_i18n138 = __toESM(require_i18n(), 1); var import_element140 = __toESM(require_element(), 1); var import_block_editor24 = __toESM(require_block_editor(), 1); var import_blocks12 = __toESM(require_blocks(), 1); var import_editor30 = __toESM(require_editor(), 1); // packages/edit-site/build-module/components/page-templates/hooks.mjs var import_core_data47 = __toESM(require_core_data(), 1); var import_data70 = __toESM(require_data(), 1); function useAddedBy(postType2, postId) { return (0, import_data70.useSelect)( (select3) => { const { getEntityRecord, getUser, getEditedEntityRecord } = select3(import_core_data47.store); const template = getEditedEntityRecord( "postType", postType2, postId ); const originalSource = template?.original_source; const authorText = template?.author_text; switch (originalSource) { case "theme": { return { type: originalSource, icon: layout_default, text: authorText, isCustomized: template.source === TEMPLATE_ORIGINS.custom }; } case "plugin": { return { type: originalSource, icon: plugins_default, text: authorText, isCustomized: template.source === TEMPLATE_ORIGINS.custom }; } case "site": { const siteData = getEntityRecord( "root", "__unstableBase" ); return { type: originalSource, icon: globe_default, imageUrl: siteData?.site_logo ? getEntityRecord( "postType", "attachment", siteData.site_logo )?.source_url : void 0, text: authorText, isCustomized: false }; } default: { const user = getUser(template.author); return { type: "user", icon: comment_author_avatar_default, imageUrl: user?.avatar_urls?.[48], text: authorText ?? user?.name, isCustomized: false }; } } }, [postType2, postId] ); } // packages/edit-site/build-module/components/page-patterns/fields.mjs var import_jsx_runtime272 = __toESM(require_jsx_runtime(), 1); var { useStyle: useStyle4 } = unlock(import_editor30.privateApis); function PreviewField({ item }) { const descriptionId = (0, import_element140.useId)(); const description = item.description || item?.excerpt?.raw; const isTemplatePart2 = item.type === TEMPLATE_PART_POST_TYPE; const backgroundColor = useStyle4("color.background"); const blocks = (0, import_element140.useMemo)(() => { return item.blocks ?? (0, import_blocks12.parse)(item.content.raw, { __unstableSkipMigrationLogs: true }); }, [item?.content?.raw, item.blocks]); const isEmpty3 = !blocks?.length; return /* @__PURE__ */ (0, import_jsx_runtime272.jsxs)( "div", { className: "page-patterns-preview-field", style: { backgroundColor }, "aria-describedby": !!description ? descriptionId : void 0, children: [ isEmpty3 && isTemplatePart2 && (0, import_i18n138.__)("Empty template part"), isEmpty3 && !isTemplatePart2 && (0, import_i18n138.__)("Empty pattern"), !isEmpty3 && /* @__PURE__ */ (0, import_jsx_runtime272.jsx)(import_block_editor24.BlockPreview.Async, { children: /* @__PURE__ */ (0, import_jsx_runtime272.jsx)( import_block_editor24.BlockPreview, { blocks, viewportWidth: item.viewportWidth } ) }), !!description && /* @__PURE__ */ (0, import_jsx_runtime272.jsx)("div", { hidden: true, id: descriptionId, children: description }) ] } ); } var previewField = { label: (0, import_i18n138.__)("Preview"), id: "preview", render: PreviewField, enableSorting: false }; var SYNC_FILTERS = [ { value: PATTERN_SYNC_TYPES.full, label: (0, import_i18n138._x)("Synced", "pattern (singular)"), description: (0, import_i18n138.__)("Patterns that are kept in sync across the site.") }, { value: PATTERN_SYNC_TYPES.unsynced, label: (0, import_i18n138._x)("Not synced", "pattern (singular)"), description: (0, import_i18n138.__)( "Patterns that can be changed freely without affecting the site." ) } ]; var patternStatusField = { label: (0, import_i18n138.__)("Sync status"), id: "sync-status", render: ({ item }) => { const syncStatus = "wp_pattern_sync_status" in item ? item.wp_pattern_sync_status || PATTERN_SYNC_TYPES.full : PATTERN_SYNC_TYPES.unsynced; return /* @__PURE__ */ (0, import_jsx_runtime272.jsx)( "span", { className: `edit-site-patterns__field-sync-status-${syncStatus}`, children: SYNC_FILTERS.find(({ value }) => value === syncStatus).label } ); }, elements: SYNC_FILTERS, filterBy: { operators: [OPERATOR_IS], isPrimary: true }, enableSorting: false }; function AuthorField({ item }) { const [isImageLoaded, setIsImageLoaded] = (0, import_element140.useState)(false); const { text, icon, imageUrl } = useAddedBy(item.type, item.id); return /* @__PURE__ */ (0, import_jsx_runtime272.jsxs)(import_components148.__experimentalHStack, { alignment: "left", spacing: 0, children: [ imageUrl && /* @__PURE__ */ (0, import_jsx_runtime272.jsx)( "div", { className: clsx_default("page-templates-author-field__avatar", { "is-loaded": isImageLoaded }), children: /* @__PURE__ */ (0, import_jsx_runtime272.jsx)( "img", { onLoad: () => setIsImageLoaded(true), alt: "", src: imageUrl } ) } ), !imageUrl && /* @__PURE__ */ (0, import_jsx_runtime272.jsx)("div", { className: "page-templates-author-field__icon", children: /* @__PURE__ */ (0, import_jsx_runtime272.jsx)(icon_default, { icon }) }), /* @__PURE__ */ (0, import_jsx_runtime272.jsx)("span", { className: "page-templates-author-field__name", children: text }) ] }); } var templatePartAuthorField = { label: (0, import_i18n138.__)("Author"), id: "author", getValue: ({ item }) => item.author_text, render: AuthorField, filterBy: { isPrimary: true } }; // packages/edit-site/build-module/components/page-patterns/index.mjs var import_jsx_runtime273 = __toESM(require_jsx_runtime(), 1); var { ExperimentalBlockEditorProvider } = unlock(import_block_editor25.privateApis); var { usePostActions, patternTitleField } = unlock(import_editor31.privateApis); var { useLocation: useLocation27, useHistory: useHistory20 } = unlock(import_router31.privateApis); var EMPTY_ARRAY11 = []; var defaultLayouts = { [LAYOUT_TABLE]: { layout: { styles: { author: { width: "1%" } } } }, [LAYOUT_GRID]: { layout: { badgeFields: ["sync-status"] } } }; var DEFAULT_VIEW = { type: LAYOUT_GRID, perPage: 20, titleField: "title", mediaField: "preview", fields: ["sync-status"], filters: [], ...defaultLayouts[LAYOUT_GRID] }; function usePagePatternsHeader(type, categoryId) { const { patternCategories } = usePatternCategories(); const templatePartAreas = (0, import_data71.useSelect)( (select3) => select3(import_core_data48.store).getCurrentTheme()?.default_template_part_areas || [], [] ); let title, description, patternCategory; if (type === TEMPLATE_PART_POST_TYPE) { const templatePartArea = templatePartAreas.find( (area) => area.area === categoryId ); title = templatePartArea?.label || (0, import_i18n139.__)("All Template Parts"); description = templatePartArea?.description || (0, import_i18n139.__)("Includes every template part defined for any area."); } else if (type === PATTERN_TYPES.user && !!categoryId) { patternCategory = patternCategories.find( (category) => category.name === categoryId ); title = patternCategory?.label; description = patternCategory?.description; } return { title, description }; } function DataviewsPatterns() { const { path, query } = useLocation27(); const { postType: postType2 = "wp_block", categoryId: categoryIdFromURL } = query; const history = useHistory20(); const categoryId = categoryIdFromURL || PATTERN_DEFAULT_CATEGORY; const { view, updateView, isModified, resetToDefault } = useView({ kind: "postType", name: postType2, slug: "default", defaultView: DEFAULT_VIEW, queryParams: { page: query.pageNumber, search: query.search }, onChangeQueryParams: (params) => { history.navigate( (0, import_url17.addQueryArgs)(path, { ...query, pageNumber: params.page, search: params.search }) ); } }); const viewSyncStatus = view.filters?.find( ({ field }) => field === "sync-status" )?.value; const { patterns, isResolving } = use_patterns_default(postType2, categoryId, { search: view.search, syncStatus: viewSyncStatus }); const { records } = (0, import_core_data48.useEntityRecords)("postType", TEMPLATE_PART_POST_TYPE, { per_page: -1 }); const authors = (0, import_element141.useMemo)(() => { if (!records) { return EMPTY_ARRAY11; } const authorsSet = /* @__PURE__ */ new Set(); records.forEach((template) => { authorsSet.add(template.author_text); }); return Array.from(authorsSet).map((author) => ({ value: author, label: author })); }, [records]); const fields = (0, import_element141.useMemo)(() => { const _fields = [previewField, patternTitleField]; if (postType2 === PATTERN_TYPES.user) { _fields.push(patternStatusField); } else if (postType2 === TEMPLATE_PART_POST_TYPE) { _fields.push({ ...templatePartAuthorField, elements: authors }); } return _fields; }, [postType2, authors]); const { data, paginationInfo } = (0, import_element141.useMemo)(() => { const viewWithoutFilters = { ...view }; delete viewWithoutFilters.search; if (postType2 !== TEMPLATE_PART_POST_TYPE) { viewWithoutFilters.filters = []; } return filterSortAndPaginate(patterns, viewWithoutFilters, fields); }, [patterns, view, fields, postType2]); const dataWithPermissions = useAugmentPatternsWithPermissions(data); const templatePartActions = usePostActions({ postType: TEMPLATE_PART_POST_TYPE, context: "list" }); const patternActions = usePostActions({ postType: PATTERN_TYPES.user, context: "list" }); const editAction = useEditPostAction(); const actions = (0, import_element141.useMemo)(() => { if (postType2 === TEMPLATE_PART_POST_TYPE) { return [editAction, ...templatePartActions].filter(Boolean); } return [editAction, ...patternActions].filter(Boolean); }, [editAction, postType2, templatePartActions, patternActions]); const settings2 = usePatternSettings(); const { title, description } = usePagePatternsHeader( postType2, categoryId ); return /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(ExperimentalBlockEditorProvider, { settings: settings2, children: /* @__PURE__ */ (0, import_jsx_runtime273.jsx)( page_default2, { className: "edit-site-page-patterns-dataviews", title, headingLevel: 2, subTitle: description, actions: /* @__PURE__ */ (0, import_jsx_runtime273.jsx)( PatternsActions, { categoryId, type: postType2 } ), children: /* @__PURE__ */ (0, import_jsx_runtime273.jsx)( dataviews_default, { paginationInfo, fields, actions, data: dataWithPermissions || EMPTY_ARRAY11, getItemId: (item) => item.name ?? item.id, isLoading: isResolving, isItemClickable: (item) => item.type !== PATTERN_TYPES.theme, onClickItem: (item) => { history.navigate( `/${item.type}/${[ PATTERN_TYPES.user, TEMPLATE_PART_POST_TYPE ].includes(item.type) ? item.id : item.name}?canvas=edit` ); }, view, onChangeView: updateView, defaultLayouts, onReset: isModified ? resetToDefault : false }, categoryId + postType2 ) } ) }); } // packages/edit-site/build-module/components/site-editor-routes/patterns.mjs var import_jsx_runtime274 = __toESM(require_jsx_runtime(), 1); var patternsRoute = { name: "patterns", path: "/pattern", areas: { sidebar({ siteData }) { const isBlockTheme = siteData.currentTheme?.is_block_theme; const backPath = isBlockTheme || isClassicThemeWithStyleBookSupport(siteData) ? "/" : void 0; return /* @__PURE__ */ (0, import_jsx_runtime274.jsx)(SidebarNavigationScreenPatterns, { backPath }); }, content: /* @__PURE__ */ (0, import_jsx_runtime274.jsx)(DataviewsPatterns, {}), mobile({ siteData, query }) { const { categoryId } = query; const isBlockTheme = siteData.currentTheme?.is_block_theme; const backPath = isBlockTheme || isClassicThemeWithStyleBookSupport(siteData) ? "/" : void 0; return !!categoryId ? /* @__PURE__ */ (0, import_jsx_runtime274.jsx)(DataviewsPatterns, {}) : /* @__PURE__ */ (0, import_jsx_runtime274.jsx)(SidebarNavigationScreenPatterns, { backPath }); } } }; // packages/edit-site/build-module/components/site-editor-routes/pattern-item.mjs var import_jsx_runtime275 = __toESM(require_jsx_runtime(), 1); var patternItemRoute = { name: "pattern-item", path: "/wp_block/:postId", areas: { sidebar({ siteData }) { const isBlockTheme = siteData.currentTheme?.is_block_theme; const backPath = isBlockTheme || isClassicThemeWithStyleBookSupport(siteData) ? "/" : void 0; return /* @__PURE__ */ (0, import_jsx_runtime275.jsx)(SidebarNavigationScreenPatterns, { backPath }); }, mobile: /* @__PURE__ */ (0, import_jsx_runtime275.jsx)(EditSiteEditor, {}), preview: /* @__PURE__ */ (0, import_jsx_runtime275.jsx)(EditSiteEditor, {}) } }; // packages/edit-site/build-module/components/site-editor-routes/template-part-item.mjs var import_jsx_runtime276 = __toESM(require_jsx_runtime(), 1); var templatePartItemRoute = { name: "template-part-item", path: "/wp_template_part/*postId", areas: { sidebar: /* @__PURE__ */ (0, import_jsx_runtime276.jsx)(SidebarNavigationScreenPatterns, { backPath: "/" }), mobile: /* @__PURE__ */ (0, import_jsx_runtime276.jsx)(EditSiteEditor, {}), preview: /* @__PURE__ */ (0, import_jsx_runtime276.jsx)(EditSiteEditor, {}) } }; // packages/edit-site/build-module/components/sidebar-navigation-screen-templates-browse/index.mjs var import_i18n142 = __toESM(require_i18n(), 1); // packages/edit-site/build-module/components/sidebar-navigation-screen-templates-browse/content.mjs var import_core_data49 = __toESM(require_core_data(), 1); var import_element142 = __toESM(require_element(), 1); var import_components149 = __toESM(require_components(), 1); var import_i18n140 = __toESM(require_i18n(), 1); var import_router32 = __toESM(require_router(), 1); var import_url18 = __toESM(require_url(), 1); var import_jsx_runtime277 = __toESM(require_jsx_runtime(), 1); var { useLocation: useLocation28 } = unlock(import_router32.privateApis); var EMPTY_ARRAY12 = []; function TemplateDataviewItem({ template, isActive }) { const { text, icon } = useAddedBy(template.type, template.id); return /* @__PURE__ */ (0, import_jsx_runtime277.jsx)( SidebarNavigationItem, { to: (0, import_url18.addQueryArgs)("/template", { activeView: text }), icon, "aria-current": isActive, children: text } ); } function DataviewsTemplatesSidebarContent() { const { query: { activeView = "active" } } = useLocation28(); const { records } = (0, import_core_data49.useEntityRecords)("root", "registeredTemplate", { // This should not be needed, the endpoint returns all registered // templates, but it's not possible right now to turn off pagination for // entity configs. per_page: -1 }); const firstItemPerAuthorText = (0, import_element142.useMemo)(() => { const firstItemPerAuthor = records?.reduce((acc, template) => { const author = template.author_text; if (author && !acc[author]) { acc[author] = template; } return acc; }, {}); return (firstItemPerAuthor && Object.values(firstItemPerAuthor)) ?? EMPTY_ARRAY12; }, [records]); return /* @__PURE__ */ (0, import_jsx_runtime277.jsxs)(import_components149.__experimentalItemGroup, { className: "edit-site-sidebar-navigation-screen-templates-browse", children: [ /* @__PURE__ */ (0, import_jsx_runtime277.jsx)( SidebarNavigationItem, { to: "/template", icon: published_default, "aria-current": activeView === "active", children: (0, import_i18n140.__)("Active templates") } ), /* @__PURE__ */ (0, import_jsx_runtime277.jsx)( SidebarNavigationItem, { to: (0, import_url18.addQueryArgs)("/template", { activeView: "user" }), icon: comment_author_avatar_default, "aria-current": activeView === "user", // Let's avoid calling them "custom templates" to avoid // confusion. "Created" is closest to meaning database // templates, created by users. // https://developer.wordpress.org/themes/classic-themes/templates/page-template-files/#creating-custom-page-templates-for-global-use children: (0, import_i18n140.__)("Created templates") } ), firstItemPerAuthorText.map((template) => { return /* @__PURE__ */ (0, import_jsx_runtime277.jsx)( TemplateDataviewItem, { template, isActive: activeView === template.author_text }, template.author_text ); }) ] }); } // packages/edit-site/build-module/components/sidebar-navigation-screen-templates-browse/content-legacy.mjs var import_core_data50 = __toESM(require_core_data(), 1); var import_element143 = __toESM(require_element(), 1); var import_components150 = __toESM(require_components(), 1); var import_i18n141 = __toESM(require_i18n(), 1); var import_router33 = __toESM(require_router(), 1); var import_url19 = __toESM(require_url(), 1); var import_jsx_runtime278 = __toESM(require_jsx_runtime(), 1); var { useLocation: useLocation29 } = unlock(import_router33.privateApis); var EMPTY_ARRAY13 = []; function TemplateDataviewItem2({ template, isActive }) { const { text, icon } = useAddedBy(template.type, template.id); return /* @__PURE__ */ (0, import_jsx_runtime278.jsx)( SidebarNavigationItem, { to: (0, import_url19.addQueryArgs)("/template", { activeView: text }), icon, "aria-current": isActive, children: text } ); } function DataviewsTemplatesSidebarContent2() { const { query: { activeView = "all" } } = useLocation29(); const { records } = (0, import_core_data50.useEntityRecords)("postType", TEMPLATE_POST_TYPE, { per_page: -1 }); const firstItemPerAuthorText = (0, import_element143.useMemo)(() => { const firstItemPerAuthor = records?.reduce((acc, template) => { const author = template.author_text; if (author && !acc[author]) { acc[author] = template; } return acc; }, {}); return (firstItemPerAuthor && Object.values(firstItemPerAuthor)) ?? EMPTY_ARRAY13; }, [records]); return /* @__PURE__ */ (0, import_jsx_runtime278.jsxs)(import_components150.__experimentalItemGroup, { className: "edit-site-sidebar-navigation-screen-templates-browse", children: [ /* @__PURE__ */ (0, import_jsx_runtime278.jsx)( SidebarNavigationItem, { to: "/template", icon: layout_default, "aria-current": activeView === "all", children: (0, import_i18n141.__)("All templates") } ), firstItemPerAuthorText.map((template) => { return /* @__PURE__ */ (0, import_jsx_runtime278.jsx)( TemplateDataviewItem2, { template, isActive: activeView === template.author_text }, template.author_text ); }) ] }); } // packages/edit-site/build-module/components/sidebar-navigation-screen-templates-browse/index.mjs var import_jsx_runtime279 = __toESM(require_jsx_runtime(), 1); function SidebarNavigationScreenTemplatesBrowse({ backPath }) { return /* @__PURE__ */ (0, import_jsx_runtime279.jsx)( SidebarNavigationScreen, { title: (0, import_i18n142.__)("Templates"), description: (0, import_i18n142.__)( "Create new templates, or reset any customizations made to the templates supplied by your theme." ), backPath, content: window?.__experimentalTemplateActivate ? /* @__PURE__ */ (0, import_jsx_runtime279.jsx)(DataviewsTemplatesSidebarContent, {}) : /* @__PURE__ */ (0, import_jsx_runtime279.jsx)(DataviewsTemplatesSidebarContent2, {}) } ); } // packages/edit-site/build-module/components/page-templates/index.mjs var import_i18n148 = __toESM(require_i18n(), 1); var import_html_entities14 = __toESM(require_html_entities(), 1); var import_element149 = __toESM(require_element(), 1); var import_core_data55 = __toESM(require_core_data(), 1); var import_router35 = __toESM(require_router(), 1); var import_editor35 = __toESM(require_editor(), 1); var import_url22 = __toESM(require_url(), 1); var import_data75 = __toESM(require_data(), 1); var import_compose30 = __toESM(require_compose(), 1); var import_components155 = __toESM(require_components(), 1); var import_notices8 = __toESM(require_notices(), 1); // packages/edit-site/build-module/components/add-new-template/index.mjs var import_components153 = __toESM(require_components(), 1); var import_html_entities12 = __toESM(require_html_entities(), 1); var import_element147 = __toESM(require_element(), 1); var import_data73 = __toESM(require_data(), 1); var import_core_data53 = __toESM(require_core_data(), 1); var import_compose29 = __toESM(require_compose(), 1); var import_i18n146 = __toESM(require_i18n(), 1); var import_notices7 = __toESM(require_notices(), 1); var import_router34 = __toESM(require_router(), 1); var import_dom13 = __toESM(require_dom(), 1); // packages/edit-site/build-module/components/add-new-template/add-custom-template-modal-content.mjs var import_element145 = __toESM(require_element(), 1); var import_i18n144 = __toESM(require_i18n(), 1); var import_components151 = __toESM(require_components(), 1); var import_core_data52 = __toESM(require_core_data(), 1); var import_html_entities11 = __toESM(require_html_entities(), 1); var import_compose28 = __toESM(require_compose(), 1); var import_dom12 = __toESM(require_dom(), 1); var import_url21 = __toESM(require_url(), 1); // packages/edit-site/build-module/components/add-new-template/utils.mjs var import_data72 = __toESM(require_data(), 1); var import_core_data51 = __toESM(require_core_data(), 1); var import_html_entities10 = __toESM(require_html_entities(), 1); var import_element144 = __toESM(require_element(), 1); var import_i18n143 = __toESM(require_i18n(), 1); var import_url20 = __toESM(require_url(), 1); var EMPTY_OBJECT2 = {}; var getValueFromObjectPath2 = (object, path) => { let value = object; path.split(".").forEach((fieldName) => { value = value?.[fieldName]; }); return value; }; function prefixSlug(prefix2, slug) { return `${prefix2}-${(0, import_url20.safeDecodeURI)(slug)}`; } var mapToIHasNameAndId = (entities, path) => { return (entities || []).map((entity) => ({ ...entity, name: (0, import_html_entities10.decodeEntities)(getValueFromObjectPath2(entity, path)) })); }; var useExistingTemplates = () => { return (0, import_data72.useSelect)( (select3) => select3(import_core_data51.store).getEntityRecords( "postType", TEMPLATE_POST_TYPE, { per_page: -1 } ), [] ); }; var useDefaultTemplateTypes = () => { return (0, import_data72.useSelect)( (select3) => select3(import_core_data51.store).getCurrentTheme()?.default_template_types || [], [] ); }; var usePublicPostTypes = () => { const postTypes = (0, import_data72.useSelect)( (select3) => select3(import_core_data51.store).getPostTypes({ per_page: -1 }), [] ); return (0, import_element144.useMemo)(() => { const excludedPostTypes = ["attachment"]; return postTypes?.filter( ({ viewable, slug }) => viewable && !excludedPostTypes.includes(slug) ).sort((a2, b2) => { if (a2.slug === "post" || b2.slug === "post") { return 0; } return a2.name.localeCompare(b2.name); }); }, [postTypes]); }; var usePublicTaxonomies = () => { const taxonomies = (0, import_data72.useSelect)( (select3) => select3(import_core_data51.store).getTaxonomies({ per_page: -1 }), [] ); return (0, import_element144.useMemo)(() => { return taxonomies?.filter( ({ visibility }) => visibility?.publicly_queryable ); }, [taxonomies]); }; function usePostTypeArchiveMenuItems() { const publicPostTypes = usePublicPostTypes(); const postTypesWithArchives = (0, import_element144.useMemo)( () => publicPostTypes?.filter((postType2) => postType2.has_archive), [publicPostTypes] ); const existingTemplates = useExistingTemplates(); const postTypeLabels = (0, import_element144.useMemo)( () => publicPostTypes?.reduce((accumulator, { labels }) => { const singularName = labels.singular_name.toLowerCase(); accumulator[singularName] = (accumulator[singularName] || 0) + 1; return accumulator; }, {}), [publicPostTypes] ); const needsUniqueIdentifier = (0, import_element144.useCallback)( ({ labels, slug }) => { const singularName = labels.singular_name.toLowerCase(); return postTypeLabels[singularName] > 1 && singularName !== slug; }, [postTypeLabels] ); return (0, import_element144.useMemo)( () => postTypesWithArchives?.filter( (postType2) => !(existingTemplates || []).some( (existingTemplate) => existingTemplate.slug === "archive-" + postType2.slug ) ).map((postType2) => { let title; if (needsUniqueIdentifier(postType2)) { title = (0, import_i18n143.sprintf)( // translators: %1s: Name of the post type e.g: "Post"; %2s: Slug of the post type e.g: "book". (0, import_i18n143.__)("Archive: %1$s (%2$s)"), postType2.labels.singular_name, postType2.slug ); } else { title = (0, import_i18n143.sprintf)( // translators: %s: Name of the post type e.g: "Post". (0, import_i18n143.__)("Archive: %s"), postType2.labels.singular_name ); } return { slug: "archive-" + postType2.slug, description: (0, import_i18n143.sprintf)( // translators: %s: Name of the post type e.g: "Post". (0, import_i18n143.__)( "Displays an archive with the latest posts of type: %s." ), postType2.labels.singular_name ), title, // `icon` is the `menu_icon` property of a post type. We // only handle `dashicons` for now, even if the `menu_icon` // also supports urls and svg as values. icon: typeof postType2.icon === "string" && postType2.icon.startsWith("dashicons-") ? postType2.icon.slice(10) : archive_default, templatePrefix: "archive" }; }) || [], [postTypesWithArchives, existingTemplates, needsUniqueIdentifier] ); } var usePostTypeMenuItems = (onClickMenuItem) => { const publicPostTypes = usePublicPostTypes(); const defaultTemplateTypes = useDefaultTemplateTypes(); const templateLabels = (0, import_element144.useMemo)( () => publicPostTypes?.reduce((accumulator, { labels }) => { const templateName = (labels.template_name || labels.singular_name).toLowerCase(); accumulator[templateName] = (accumulator[templateName] || 0) + 1; return accumulator; }, {}), [publicPostTypes] ); const needsUniqueIdentifier = (0, import_element144.useCallback)( ({ labels, slug }) => { const templateName = (labels.template_name || labels.singular_name).toLowerCase(); return templateLabels[templateName] > 1 && templateName !== slug; }, [templateLabels] ); const templatePrefixes = (0, import_element144.useMemo)( () => publicPostTypes?.reduce((accumulator, { slug }) => { let suffix = slug; if (slug !== "page") { suffix = `single-${suffix}`; } accumulator[slug] = suffix; return accumulator; }, {}), [publicPostTypes] ); const postTypesInfo = useEntitiesInfo("postType", templatePrefixes); const menuItems = (publicPostTypes || []).reduce( (accumulator, postType2) => { const { slug, labels, icon } = postType2; const generalTemplateSlug = templatePrefixes[slug]; const defaultTemplateType = defaultTemplateTypes?.find( ({ slug: _slug }) => _slug === generalTemplateSlug ); const _needsUniqueIdentifier = needsUniqueIdentifier(postType2); let menuItemTitle = labels.template_name || (0, import_i18n143.sprintf)( // translators: %s: Name of the post type e.g: "Post". (0, import_i18n143.__)("Single item: %s"), labels.singular_name ); if (_needsUniqueIdentifier) { menuItemTitle = labels.template_name ? (0, import_i18n143.sprintf)( // translators: 1: Name of the template e.g: "Single Item: Post". 2: Slug of the post type e.g: "book". (0, import_i18n143._x)("%1$s (%2$s)", "post type menu label"), labels.template_name, slug ) : (0, import_i18n143.sprintf)( // translators: 1: Name of the post type e.g: "Post". 2: Slug of the post type e.g: "book". (0, import_i18n143._x)( "Single item: %1$s (%2$s)", "post type menu label" ), labels.singular_name, slug ); } const menuItem = defaultTemplateType ? { ...defaultTemplateType, templatePrefix: templatePrefixes[slug] } : { slug: generalTemplateSlug, title: menuItemTitle, description: (0, import_i18n143.sprintf)( // translators: %s: Name of the post type e.g: "Post". (0, import_i18n143.__)("Displays a single item: %s."), labels.singular_name ), // `icon` is the `menu_icon` property of a post type. We // only handle `dashicons` for now, even if the `menu_icon` // also supports urls and svg as values. icon: typeof icon === "string" && icon.startsWith("dashicons-") ? icon.slice(10) : post_default, templatePrefix: templatePrefixes[slug] }; const hasEntities = postTypesInfo?.[slug]?.hasEntities; if (hasEntities) { menuItem.onClick = (template) => { onClickMenuItem({ type: "postType", slug, config: { recordNamePath: "title.rendered", queryArgs: ({ search }) => { return { _fields: "id,title,slug,link", orderBy: search ? "relevance" : "modified", exclude: postTypesInfo[slug].existingEntitiesIds }; }, getSpecificTemplate: (suggestion) => { const templateSlug = prefixSlug( templatePrefixes[slug], suggestion.slug ); return { title: templateSlug, slug: templateSlug, templatePrefix: templatePrefixes[slug] }; } }, labels, template }); }; } if (hasEntities) { accumulator.push(menuItem); } return accumulator; }, [] ); const postTypesMenuItems = (0, import_element144.useMemo)( () => menuItems.reduce( (accumulator, postType2) => { const { slug } = postType2; let key = "postTypesMenuItems"; if (slug === "page") { key = "defaultPostTypesMenuItems"; } accumulator[key].push(postType2); return accumulator; }, { defaultPostTypesMenuItems: [], postTypesMenuItems: [] } ), [menuItems] ); return postTypesMenuItems; }; var useTaxonomiesMenuItems = (onClickMenuItem) => { const publicTaxonomies = usePublicTaxonomies(); const existingTemplates = useExistingTemplates(); const defaultTemplateTypes = useDefaultTemplateTypes(); const templatePrefixes = (0, import_element144.useMemo)( () => publicTaxonomies?.reduce((accumulator, { slug }) => { let suffix = slug; if (!["category", "post_tag"].includes(slug)) { suffix = `taxonomy-${suffix}`; } if (slug === "post_tag") { suffix = `tag`; } accumulator[slug] = suffix; return accumulator; }, {}), [publicTaxonomies] ); const taxonomyLabels = publicTaxonomies?.reduce( (accumulator, { labels }) => { const templateName = (labels.template_name || labels.singular_name).toLowerCase(); accumulator[templateName] = (accumulator[templateName] || 0) + 1; return accumulator; }, {} ); const needsUniqueIdentifier = (labels, slug) => { if (["category", "post_tag"].includes(slug)) { return false; } const templateName = (labels.template_name || labels.singular_name).toLowerCase(); return taxonomyLabels[templateName] > 1 && templateName !== slug; }; const taxonomiesInfo = useEntitiesInfo("taxonomy", templatePrefixes); const existingTemplateSlugs = (existingTemplates || []).map( ({ slug }) => slug ); const menuItems = (publicTaxonomies || []).reduce( (accumulator, taxonomy) => { const { slug, labels } = taxonomy; const generalTemplateSlug = templatePrefixes[slug]; const defaultTemplateType = defaultTemplateTypes?.find( ({ slug: _slug }) => _slug === generalTemplateSlug ); const hasGeneralTemplate = existingTemplateSlugs?.includes(generalTemplateSlug); const _needsUniqueIdentifier = needsUniqueIdentifier( labels, slug ); let menuItemTitle = labels.template_name || labels.singular_name; if (_needsUniqueIdentifier) { menuItemTitle = labels.template_name ? (0, import_i18n143.sprintf)( // translators: 1: Name of the template e.g: "Products by Category". 2: Slug of the taxonomy e.g: "product_cat". (0, import_i18n143._x)("%1$s (%2$s)", "taxonomy template menu label"), labels.template_name, slug ) : (0, import_i18n143.sprintf)( // translators: 1: Name of the taxonomy e.g: "Category". 2: Slug of the taxonomy e.g: "product_cat". (0, import_i18n143._x)("%1$s (%2$s)", "taxonomy menu label"), labels.singular_name, slug ); } const menuItem = defaultTemplateType ? { ...defaultTemplateType, templatePrefix: templatePrefixes[slug] } : { slug: generalTemplateSlug, title: menuItemTitle, description: (0, import_i18n143.sprintf)( // translators: %s: Name of the taxonomy e.g: "Product Categories". (0, import_i18n143.__)("Displays taxonomy: %s."), labels.singular_name ), icon: block_meta_default, templatePrefix: templatePrefixes[slug] }; const hasEntities = taxonomiesInfo?.[slug]?.hasEntities; if (hasEntities) { menuItem.onClick = (template) => { onClickMenuItem({ type: "taxonomy", slug, config: { queryArgs: ({ search }) => { return { _fields: "id,name,slug,link", orderBy: search ? "name" : "count", exclude: taxonomiesInfo[slug].existingEntitiesIds }; }, getSpecificTemplate: (suggestion) => { const templateSlug = prefixSlug( templatePrefixes[slug], suggestion.slug ); return { title: templateSlug, slug: templateSlug, templatePrefix: templatePrefixes[slug] }; } }, labels, hasGeneralTemplate, template }); }; } if (!hasGeneralTemplate || hasEntities) { accumulator.push(menuItem); } return accumulator; }, [] ); const taxonomiesMenuItems = (0, import_element144.useMemo)( () => menuItems.reduce( (accumulator, taxonomy) => { const { slug } = taxonomy; let key = "taxonomiesMenuItems"; if (["category", "tag"].includes(slug)) { key = "defaultTaxonomiesMenuItems"; } accumulator[key].push(taxonomy); return accumulator; }, { defaultTaxonomiesMenuItems: [], taxonomiesMenuItems: [] } ), [menuItems] ); return taxonomiesMenuItems; }; var USE_AUTHOR_MENU_ITEM_TEMPLATE_PREFIX = { user: "author" }; var USE_AUTHOR_MENU_ITEM_QUERY_PARAMETERS = { user: { who: "authors" } }; function useAuthorMenuItem(onClickMenuItem) { const existingTemplates = useExistingTemplates(); const defaultTemplateTypes = useDefaultTemplateTypes(); const authorInfo = useEntitiesInfo( "root", USE_AUTHOR_MENU_ITEM_TEMPLATE_PREFIX, USE_AUTHOR_MENU_ITEM_QUERY_PARAMETERS ); let authorMenuItem = defaultTemplateTypes?.find( ({ slug }) => slug === "author" ); if (!authorMenuItem) { authorMenuItem = { description: (0, import_i18n143.__)( "Displays latest posts written by a single author." ), slug: "author", title: "Author" }; } const hasGeneralTemplate = !!existingTemplates?.find( ({ slug }) => slug === "author" ); if (authorInfo.user?.hasEntities) { authorMenuItem = { ...authorMenuItem, templatePrefix: "author" }; authorMenuItem.onClick = (template) => { onClickMenuItem({ type: "root", slug: "user", config: { queryArgs: ({ search }) => { return { _fields: "id,name,slug,link", orderBy: search ? "name" : "registered_date", exclude: authorInfo.user.existingEntitiesIds, who: "authors" }; }, getSpecificTemplate: (suggestion) => { const templateSlug = prefixSlug( "author", suggestion.slug ); return { title: (0, import_i18n143.sprintf)( // translators: %s: Name of the author e.g: "Admin". (0, import_i18n143.__)("Author: %s"), suggestion.name ), slug: templateSlug, templatePrefix: "author" }; } }, labels: { singular_name: (0, import_i18n143.__)("Author"), search_items: (0, import_i18n143.__)("Search Authors"), not_found: (0, import_i18n143.__)("No authors found."), all_items: (0, import_i18n143.__)("All Authors") }, hasGeneralTemplate, template }); }; } if (!hasGeneralTemplate || authorInfo.user?.hasEntities) { return authorMenuItem; } } var useEntitiesInfo = (entityName, templatePrefixes, additionalQueryParameters = EMPTY_OBJECT2) => { const entitiesHasRecords = (0, import_data72.useSelect)( (select3) => { return Object.keys(templatePrefixes || {}).reduce( (accumulator, slug) => { accumulator[slug] = !!select3( import_core_data51.store ).getEntityRecords(entityName, slug, { per_page: 1, _fields: "id", context: "view", ...additionalQueryParameters[slug] })?.length; return accumulator; }, {} ); }, [templatePrefixes, entityName, additionalQueryParameters] ); const entitiesInfo = (0, import_element144.useMemo)(() => { return Object.keys(templatePrefixes || {}).reduce( (accumulator, slug) => { accumulator[slug] = { hasEntities: entitiesHasRecords[slug] }; return accumulator; }, {} ); }, [templatePrefixes, entitiesHasRecords]); return entitiesInfo; }; // packages/edit-site/build-module/components/add-new-template/add-custom-template-modal-content.mjs var import_jsx_runtime280 = __toESM(require_jsx_runtime(), 1); var EMPTY_ARRAY14 = []; function SuggestionListItem({ suggestion, search, onSelect, entityForSuggestions }) { const baseCssClass = "edit-site-custom-template-modal__suggestions_list__list-item"; return /* @__PURE__ */ (0, import_jsx_runtime280.jsxs)( import_components151.Composite.Item, { render: /* @__PURE__ */ (0, import_jsx_runtime280.jsx)( import_components151.Button, { __next40pxDefaultSize: true, role: "option", className: baseCssClass, onClick: () => onSelect( entityForSuggestions.config.getSpecificTemplate( suggestion ) ) } ), children: [ /* @__PURE__ */ (0, import_jsx_runtime280.jsx)( import_components151.__experimentalText, { size: "body", lineHeight: 1.53846153846, weight: 500, className: `${baseCssClass}__title`, children: /* @__PURE__ */ (0, import_jsx_runtime280.jsx)( import_components151.TextHighlight, { text: (0, import_html_entities11.decodeEntities)(suggestion.name), highlight: search } ) } ), suggestion.link && /* @__PURE__ */ (0, import_jsx_runtime280.jsx)( import_components151.__experimentalText, { size: "body", lineHeight: 1.53846153846, className: `${baseCssClass}__info`, children: (0, import_url21.safeDecodeURI)(suggestion.link) } ) ] } ); } function useSearchSuggestions(entityForSuggestions, search) { const { config: config2 } = entityForSuggestions; const query = (0, import_element145.useMemo)( () => ({ order: "asc", context: "view", search, per_page: search ? 20 : 10, ...config2.queryArgs(search) }), [search, config2] ); const { records: searchResults, hasResolved: searchHasResolved } = (0, import_core_data52.useEntityRecords)( entityForSuggestions.type, entityForSuggestions.slug, query ); const [suggestions, setSuggestions] = (0, import_element145.useState)(EMPTY_ARRAY14); (0, import_element145.useEffect)(() => { if (!searchHasResolved) { return; } let newSuggestions = EMPTY_ARRAY14; if (searchResults?.length) { newSuggestions = searchResults; if (config2.recordNamePath) { newSuggestions = mapToIHasNameAndId( newSuggestions, config2.recordNamePath ); } } setSuggestions(newSuggestions); }, [searchResults, searchHasResolved]); return suggestions; } function SuggestionList({ entityForSuggestions, onSelect }) { const [search, setSearch, debouncedSearch] = (0, import_compose28.useDebouncedInput)(); const suggestions = useSearchSuggestions( entityForSuggestions, debouncedSearch ); const { labels } = entityForSuggestions; const [showSearchControl, setShowSearchControl] = (0, import_element145.useState)(false); if (!showSearchControl && suggestions?.length > 9) { setShowSearchControl(true); } return /* @__PURE__ */ (0, import_jsx_runtime280.jsxs)(import_jsx_runtime280.Fragment, { children: [ showSearchControl && /* @__PURE__ */ (0, import_jsx_runtime280.jsx)( import_components151.SearchControl, { onChange: setSearch, value: search, label: labels.search_items, placeholder: labels.search_items } ), !!suggestions?.length && /* @__PURE__ */ (0, import_jsx_runtime280.jsx)( import_components151.Composite, { orientation: "vertical", role: "listbox", className: "edit-site-custom-template-modal__suggestions_list", "aria-label": (0, import_i18n144.__)("Suggestions list"), children: suggestions.map((suggestion) => /* @__PURE__ */ (0, import_jsx_runtime280.jsx)( SuggestionListItem, { suggestion, search: debouncedSearch, onSelect, entityForSuggestions }, suggestion.slug )) } ), debouncedSearch && !suggestions?.length && /* @__PURE__ */ (0, import_jsx_runtime280.jsx)( import_components151.__experimentalText, { as: "p", className: "edit-site-custom-template-modal__no-results", children: labels.not_found } ) ] }); } function AddCustomTemplateModalContent({ onSelect, entityForSuggestions, onBack, containerRef }) { const [showSearchEntities, setShowSearchEntities] = (0, import_element145.useState)(); (0, import_element145.useEffect)(() => { if (containerRef.current) { const [firstFocusable] = import_dom12.focus.focusable.find( containerRef.current ); firstFocusable?.focus(); } }, [showSearchEntities]); return /* @__PURE__ */ (0, import_jsx_runtime280.jsxs)( import_components151.__experimentalVStack, { spacing: 4, className: "edit-site-custom-template-modal__contents-wrapper", alignment: "left", children: [ !showSearchEntities && /* @__PURE__ */ (0, import_jsx_runtime280.jsxs)(import_jsx_runtime280.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime280.jsx)(import_components151.__experimentalText, { as: "p", children: (0, import_i18n144.__)( "Select whether to create a single template for all items or a specific one." ) }), /* @__PURE__ */ (0, import_jsx_runtime280.jsxs)( import_components151.Flex, { className: "edit-site-custom-template-modal__contents", gap: "4", align: "initial", children: [ /* @__PURE__ */ (0, import_jsx_runtime280.jsxs)( import_components151.FlexItem, { isBlock: true, as: import_components151.Button, onClick: () => { const { slug, title, description, templatePrefix } = entityForSuggestions.template; onSelect({ slug, title, description, templatePrefix }); }, children: [ /* @__PURE__ */ (0, import_jsx_runtime280.jsx)( import_components151.__experimentalText, { as: "span", weight: 500, lineHeight: 1.53846153846, children: entityForSuggestions.labels.all_items } ), /* @__PURE__ */ (0, import_jsx_runtime280.jsx)( import_components151.__experimentalText, { as: "span", lineHeight: 1.53846153846, // translators: The user is given the choice to set up a template for all items of a post type or taxonomy, or just a specific one. children: (0, import_i18n144.__)("For all items") } ) ] } ), /* @__PURE__ */ (0, import_jsx_runtime280.jsxs)( import_components151.FlexItem, { isBlock: true, as: import_components151.Button, onClick: () => { setShowSearchEntities(true); }, children: [ /* @__PURE__ */ (0, import_jsx_runtime280.jsx)( import_components151.__experimentalText, { as: "span", weight: 500, lineHeight: 1.53846153846, children: entityForSuggestions.labels.singular_name } ), /* @__PURE__ */ (0, import_jsx_runtime280.jsx)( import_components151.__experimentalText, { as: "span", lineHeight: 1.53846153846, // translators: The user is given the choice to set up a template for all items of a post type or taxonomy, or just a specific one. children: (0, import_i18n144.__)("For a specific item") } ) ] } ) ] } ), /* @__PURE__ */ (0, import_jsx_runtime280.jsx)(import_components151.Flex, { justify: "right", children: /* @__PURE__ */ (0, import_jsx_runtime280.jsx)( import_components151.Button, { __next40pxDefaultSize: true, variant: "tertiary", onClick: onBack, children: (0, import_i18n144.__)("Back") } ) }) ] }), showSearchEntities && /* @__PURE__ */ (0, import_jsx_runtime280.jsxs)(import_jsx_runtime280.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime280.jsx)(import_components151.__experimentalText, { as: "p", children: (0, import_i18n144.__)( "This template will be used only for the specific item chosen." ) }), /* @__PURE__ */ (0, import_jsx_runtime280.jsx)( SuggestionList, { entityForSuggestions, onSelect } ), /* @__PURE__ */ (0, import_jsx_runtime280.jsx)(import_components151.Flex, { justify: "right", children: /* @__PURE__ */ (0, import_jsx_runtime280.jsx)( import_components151.Button, { __next40pxDefaultSize: true, variant: "tertiary", onClick: () => { if (entityForSuggestions.hasGeneralTemplate) { onBack(); } else { setShowSearchEntities(false); } }, children: (0, import_i18n144.__)("Back") } ) }) ] }) ] } ); } var add_custom_template_modal_content_default = AddCustomTemplateModalContent; // node_modules/tslib/tslib.es6.mjs var __assign = function() { __assign = Object.assign || function __assign2(t3) { for (var s2, i2 = 1, n2 = arguments.length; i2 < n2; i2++) { s2 = arguments[i2]; for (var p3 in s2) if (Object.prototype.hasOwnProperty.call(s2, p3)) t3[p3] = s2[p3]; } return t3; }; return __assign.apply(this, arguments); }; // node_modules/lower-case/dist.es2015/index.js function lowerCase(str) { return str.toLowerCase(); } // node_modules/no-case/dist.es2015/index.js var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g]; var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi; function noCase(input, options) { if (options === void 0) { options = {}; } var _a = options.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options.transform, transform = _c === void 0 ? lowerCase : _c, _d = options.delimiter, delimiter = _d === void 0 ? " " : _d; var result = replace(replace(input, splitRegexp, "$1\0$2"), stripRegexp, "\0"); var start2 = 0; var end = result.length; while (result.charAt(start2) === "\0") start2++; while (result.charAt(end - 1) === "\0") end--; return result.slice(start2, end).split("\0").map(transform).join(delimiter); } function replace(input, re, value) { if (re instanceof RegExp) return input.replace(re, value); return re.reduce(function(input2, re2) { return input2.replace(re2, value); }, input); } // node_modules/dot-case/dist.es2015/index.js function dotCase(input, options) { if (options === void 0) { options = {}; } return noCase(input, __assign({ delimiter: "." }, options)); } // node_modules/param-case/dist.es2015/index.js function paramCase(input, options) { if (options === void 0) { options = {}; } return dotCase(input, __assign({ delimiter: "-" }, options)); } // packages/edit-site/build-module/components/add-new-template/add-custom-generic-template-modal-content.mjs var import_element146 = __toESM(require_element(), 1); var import_i18n145 = __toESM(require_i18n(), 1); var import_components152 = __toESM(require_components(), 1); var import_jsx_runtime281 = __toESM(require_jsx_runtime(), 1); function AddCustomGenericTemplateModalContent({ createTemplate, onBack }) { const [title, setTitle] = (0, import_element146.useState)(""); const defaultTitle = (0, import_i18n145.__)("Custom Template"); const [isBusy, setIsBusy] = (0, import_element146.useState)(false); const inputRef = (0, import_element146.useRef)(); (0, import_element146.useEffect)(() => { if (inputRef.current) { inputRef.current.focus(); } }, []); async function onCreateTemplate(event) { event.preventDefault(); if (isBusy) { return; } setIsBusy(true); try { await createTemplate( { slug: paramCase(title || defaultTitle) || "wp-custom-template", title: title || defaultTitle }, false ); } finally { setIsBusy(false); } } return /* @__PURE__ */ (0, import_jsx_runtime281.jsx)("form", { onSubmit: onCreateTemplate, children: /* @__PURE__ */ (0, import_jsx_runtime281.jsxs)(import_components152.__experimentalVStack, { spacing: 6, children: [ /* @__PURE__ */ (0, import_jsx_runtime281.jsx)( import_components152.TextControl, { __next40pxDefaultSize: true, label: (0, import_i18n145.__)("Name"), value: title, onChange: setTitle, placeholder: defaultTitle, disabled: isBusy, ref: inputRef, help: (0, import_i18n145.__)( // eslint-disable-next-line no-restricted-syntax -- 'sidebar' is a common web design term for layouts 'Describe the template, e.g. "Post with sidebar". A custom template can be manually applied to any post or page.' ) } ), /* @__PURE__ */ (0, import_jsx_runtime281.jsxs)( import_components152.__experimentalHStack, { className: "edit-site-custom-generic-template__modal-actions", justify: "right", children: [ /* @__PURE__ */ (0, import_jsx_runtime281.jsx)( import_components152.Button, { __next40pxDefaultSize: true, variant: "tertiary", onClick: onBack, children: (0, import_i18n145.__)("Back") } ), /* @__PURE__ */ (0, import_jsx_runtime281.jsx)( import_components152.Button, { __next40pxDefaultSize: true, variant: "primary", type: "submit", isBusy, "aria-disabled": isBusy, children: (0, import_i18n145.__)("Create") } ) ] } ) ] }) }); } var add_custom_generic_template_modal_content_default = AddCustomGenericTemplateModalContent; // packages/edit-site/build-module/components/add-new-template/index.mjs var import_jsx_runtime282 = __toESM(require_jsx_runtime(), 1); var { useHistory: useHistory21 } = unlock(import_router34.privateApis); var DEFAULT_TEMPLATE_SLUGS = [ "front-page", "home", "single", "page", "index", "archive", "author", "category", "date", "tag", "search", "404" ]; var TEMPLATE_ICONS = { "front-page": home_default, home: verse_default, single: pin_default, page: page_default, archive: archive_default, search: search_default, 404: not_found_default, index: list_default, category: category_default, author: comment_author_avatar_default, taxonomy: block_meta_default, date: calendar_default, tag: tag_default, attachment: media_default }; function TemplateListItem({ title, direction, className, description, icon, onClick, children }) { return /* @__PURE__ */ (0, import_jsx_runtime282.jsx)( import_components153.Button, { __next40pxDefaultSize: true, className, onClick, label: description, showTooltip: !!description, children: /* @__PURE__ */ (0, import_jsx_runtime282.jsxs)( import_components153.Flex, { as: "span", spacing: 2, align: "center", justify: "center", style: { width: "100%" }, direction, children: [ /* @__PURE__ */ (0, import_jsx_runtime282.jsx)("div", { className: "edit-site-add-new-template__template-icon", children: /* @__PURE__ */ (0, import_jsx_runtime282.jsx)(import_components153.Icon, { icon }) }), /* @__PURE__ */ (0, import_jsx_runtime282.jsxs)( import_components153.__experimentalVStack, { className: "edit-site-add-new-template__template-name", alignment: "center", spacing: 0, children: [ /* @__PURE__ */ (0, import_jsx_runtime282.jsx)( import_components153.__experimentalText, { align: "center", weight: 500, lineHeight: 1.53846153846, children: title } ), children ] } ) ] } ) } ); } var modalContentMap = { templatesList: 1, customTemplate: 2, customGenericTemplate: 3 }; function NewTemplateModal({ onClose }) { const [modalContent, setModalContent] = (0, import_element147.useState)( modalContentMap.templatesList ); const [entityForSuggestions, setEntityForSuggestions] = (0, import_element147.useState)({}); const [isSubmitting, setIsSubmitting] = (0, import_element147.useState)(false); const missingTemplates = useMissingTemplates( setEntityForSuggestions, () => setModalContent(modalContentMap.customTemplate) ); const history = useHistory21(); const { saveEntityRecord } = (0, import_data73.useDispatch)(import_core_data53.store); const { createErrorNotice, createSuccessNotice } = (0, import_data73.useDispatch)(import_notices7.store); const containerRef = (0, import_element147.useRef)(null); const isMobile = (0, import_compose29.useViewportMatch)("medium", "<"); const homeUrl = (0, import_data73.useSelect)((select3) => { return select3(import_core_data53.store).getEntityRecord("root", "__unstableBase")?.home; }, []); const TEMPLATE_SHORT_DESCRIPTIONS = { "front-page": homeUrl, date: (0, import_i18n146.sprintf)( // translators: %s: The homepage url. (0, import_i18n146.__)("E.g. %s"), homeUrl + "/" + (/* @__PURE__ */ new Date()).getFullYear() ) }; (0, import_element147.useEffect)(() => { if (containerRef.current && modalContent === modalContentMap.templatesList) { const [firstFocusable] = import_dom13.focus.focusable.find( containerRef.current ); firstFocusable?.focus(); } }, [modalContent]); async function createTemplate(template, isWPSuggestion = true) { if (isSubmitting) { return; } setIsSubmitting(true); try { const { title, description, slug } = template; const newTemplate = await saveEntityRecord( "postType", TEMPLATE_POST_TYPE, { description, // Slugs need to be strings, so this is for template `404` slug: slug.toString(), status: "publish", title, // This adds a post meta field in template that is part of `is_custom` value calculation. meta: { is_wp_suggestion: isWPSuggestion } }, { throwOnError: true } ); history.navigate( `/${TEMPLATE_POST_TYPE}/${newTemplate.id}?canvas=edit` ); createSuccessNotice( (0, import_i18n146.sprintf)( // translators: %s: Title of the created post or template, e.g: "Hello world". (0, import_i18n146.__)('"%s" successfully created.'), (0, import_html_entities12.decodeEntities)(newTemplate.title?.rendered || title) || (0, import_i18n146.__)("(no title)") ), { type: "snackbar" } ); } catch (error) { const errorMessage = error.message && error.code !== "unknown_error" ? error.message : (0, import_i18n146.__)("An error occurred while creating the template."); createErrorNotice(errorMessage, { type: "snackbar" }); } finally { setIsSubmitting(false); } } const onModalClose = () => { onClose(); setModalContent(modalContentMap.templatesList); }; let modalTitle = (0, import_i18n146.__)("Add template"); if (modalContent === modalContentMap.customTemplate) { modalTitle = (0, import_i18n146.sprintf)( // translators: %s: Name of the post type e.g: "Post". (0, import_i18n146.__)("Add template: %s"), entityForSuggestions.labels.singular_name ); } else if (modalContent === modalContentMap.customGenericTemplate) { modalTitle = (0, import_i18n146.__)("Create custom template"); } return /* @__PURE__ */ (0, import_jsx_runtime282.jsxs)( import_components153.Modal, { title: modalTitle, className: clsx_default("edit-site-add-new-template__modal", { "edit-site-add-new-template__modal_template_list": modalContent === modalContentMap.templatesList, "edit-site-custom-template-modal": modalContent === modalContentMap.customTemplate }), onRequestClose: onModalClose, overlayClassName: modalContent === modalContentMap.customGenericTemplate ? "edit-site-custom-generic-template__modal" : void 0, ref: containerRef, children: [ modalContent === modalContentMap.templatesList && /* @__PURE__ */ (0, import_jsx_runtime282.jsxs)( import_components153.__experimentalGrid, { columns: isMobile ? 2 : 3, gap: 4, align: "flex-start", justify: "center", className: "edit-site-add-new-template__template-list__contents", children: [ /* @__PURE__ */ (0, import_jsx_runtime282.jsx)(import_components153.Flex, { className: "edit-site-add-new-template__template-list__prompt", children: (0, import_i18n146.__)( "Select what the new template should apply to:" ) }), missingTemplates.map((template) => { const { title, slug, onClick } = template; return /* @__PURE__ */ (0, import_jsx_runtime282.jsx)( TemplateListItem, { title, direction: "column", className: "edit-site-add-new-template__template-button", description: TEMPLATE_SHORT_DESCRIPTIONS[slug], icon: TEMPLATE_ICONS[slug] || layout_default, onClick: () => onClick ? onClick(template) : createTemplate(template) }, slug ); }), /* @__PURE__ */ (0, import_jsx_runtime282.jsx)( TemplateListItem, { title: (0, import_i18n146.__)("Custom template"), direction: "row", className: "edit-site-add-new-template__custom-template-button", icon: pencil_default, onClick: () => setModalContent( modalContentMap.customGenericTemplate ), children: /* @__PURE__ */ (0, import_jsx_runtime282.jsx)( import_components153.__experimentalText, { lineHeight: 1.53846153846, children: (0, import_i18n146.__)( "A custom template can be manually applied to any post or page." ) } ) } ) ] } ), modalContent === modalContentMap.customTemplate && /* @__PURE__ */ (0, import_jsx_runtime282.jsx)( add_custom_template_modal_content_default, { onSelect: createTemplate, entityForSuggestions, onBack: () => setModalContent(modalContentMap.templatesList), containerRef } ), modalContent === modalContentMap.customGenericTemplate && /* @__PURE__ */ (0, import_jsx_runtime282.jsx)( add_custom_generic_template_modal_content_default, { createTemplate, onBack: () => setModalContent(modalContentMap.templatesList) } ) ] } ); } function NewTemplate() { const [showModal, setShowModal] = (0, import_element147.useState)(false); const { postType: postType2 } = (0, import_data73.useSelect)((select3) => { const { getPostType: getPostType2 } = select3(import_core_data53.store); return { postType: getPostType2(TEMPLATE_POST_TYPE) }; }, []); if (!postType2) { return null; } return /* @__PURE__ */ (0, import_jsx_runtime282.jsxs)(import_jsx_runtime282.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime282.jsx)( import_components153.Button, { variant: "primary", onClick: () => setShowModal(true), label: postType2.labels.add_new_item, __next40pxDefaultSize: true, children: postType2.labels.add_new_item } ), showModal && /* @__PURE__ */ (0, import_jsx_runtime282.jsx)(NewTemplateModal, { onClose: () => setShowModal(false) }) ] }); } function useMissingTemplates(setEntityForSuggestions, onClick) { const defaultTemplateTypes = useDefaultTemplateTypes(); const missingDefaultTemplates = (defaultTemplateTypes || []).filter( (template) => DEFAULT_TEMPLATE_SLUGS.includes(template.slug) ); const onClickMenuItem = (_entityForSuggestions) => { onClick?.(); setEntityForSuggestions(_entityForSuggestions); }; const enhancedMissingDefaultTemplateTypes = [...missingDefaultTemplates]; const { defaultTaxonomiesMenuItems, taxonomiesMenuItems } = useTaxonomiesMenuItems(onClickMenuItem); const { defaultPostTypesMenuItems, postTypesMenuItems } = usePostTypeMenuItems(onClickMenuItem); const authorMenuItem = useAuthorMenuItem(onClickMenuItem); [ ...defaultTaxonomiesMenuItems, ...defaultPostTypesMenuItems, authorMenuItem ].forEach((menuItem) => { if (!menuItem) { return; } const matchIndex = enhancedMissingDefaultTemplateTypes.findIndex( (template) => template.slug === menuItem.slug ); if (matchIndex > -1) { enhancedMissingDefaultTemplateTypes[matchIndex] = menuItem; } else { enhancedMissingDefaultTemplateTypes.push(menuItem); } }); enhancedMissingDefaultTemplateTypes?.sort((template1, template2) => { return DEFAULT_TEMPLATE_SLUGS.indexOf(template1.slug) - DEFAULT_TEMPLATE_SLUGS.indexOf(template2.slug); }); const missingTemplates = [ ...enhancedMissingDefaultTemplateTypes, ...usePostTypeArchiveMenuItems(), ...postTypesMenuItems, ...taxonomiesMenuItems ]; return missingTemplates; } var add_new_template_default = (0, import_element147.memo)(NewTemplate); // packages/edit-site/build-module/components/page-templates/fields.mjs var import_components154 = __toESM(require_components(), 1); var import_i18n147 = __toESM(require_i18n(), 1); var import_element148 = __toESM(require_element(), 1); var import_html_entities13 = __toESM(require_html_entities(), 1); var import_blocks13 = __toESM(require_blocks(), 1); var import_block_editor26 = __toESM(require_block_editor(), 1); var import_editor34 = __toESM(require_editor(), 1); var import_core_data54 = __toESM(require_core_data(), 1); var import_data74 = __toESM(require_data(), 1); var import_jsx_runtime283 = __toESM(require_jsx_runtime(), 1); var { Badge: Badge5 } = unlock(import_components154.privateApis); var { useEntityRecordsWithPermissions } = unlock(import_core_data54.privateApis); var { useStyle: useStyle5 } = unlock(import_editor34.privateApis); function useAllDefaultTemplateTypes() { const defaultTemplateTypes = useDefaultTemplateTypes(); const { records: staticRecords } = useEntityRecordsWithPermissions( "root", "registeredTemplate" ); return [ ...defaultTemplateTypes, ...staticRecords?.filter((record) => !record.is_custom).map((record) => { return { slug: record.slug, title: record.title.rendered, description: record.description }; }) ]; } function PreviewField2({ item }) { const settings2 = usePatternSettings(); const backgroundColor = useStyle5("color.background") ?? "white"; const blocks = (0, import_element148.useMemo)(() => { return (0, import_blocks13.parse)(item.content.raw); }, [item.content.raw]); const isEmpty3 = !blocks?.length; return /* @__PURE__ */ (0, import_jsx_runtime283.jsx)(import_editor34.EditorProvider, { post: item, settings: settings2, children: /* @__PURE__ */ (0, import_jsx_runtime283.jsxs)( "div", { className: "page-templates-preview-field", style: { backgroundColor }, children: [ isEmpty3 && (0, import_i18n147.__)("Empty template"), !isEmpty3 && /* @__PURE__ */ (0, import_jsx_runtime283.jsx)(import_block_editor26.BlockPreview.Async, { children: /* @__PURE__ */ (0, import_jsx_runtime283.jsx)(import_block_editor26.BlockPreview, { blocks }) }) ] } ) }); } var previewField2 = { label: (0, import_i18n147.__)("Preview"), id: "preview", render: PreviewField2, enableSorting: false }; var descriptionField = { label: (0, import_i18n147.__)("Description"), id: "description", render: window?.__experimentalTemplateActivate ? function RenderDescription({ item }) { const defaultTemplateTypes = useAllDefaultTemplateTypes(); const defaultTemplateType = defaultTemplateTypes.find( (type) => type.slug === item.slug ); return item.description ? (0, import_html_entities13.decodeEntities)(item.description) : defaultTemplateType?.description; } : ({ item }) => { return item.description && (0, import_html_entities13.decodeEntities)(item.description); }, enableSorting: false, enableGlobalSearch: true }; function AuthorField2({ item }) { const [isImageLoaded, setIsImageLoaded] = (0, import_element148.useState)(false); const { text, icon, imageUrl } = useAddedBy(item.type, item.id); return /* @__PURE__ */ (0, import_jsx_runtime283.jsxs)(import_components154.__experimentalHStack, { alignment: "left", spacing: 0, children: [ imageUrl && /* @__PURE__ */ (0, import_jsx_runtime283.jsx)( "div", { className: clsx_default("page-templates-author-field__avatar", { "is-loaded": isImageLoaded }), children: /* @__PURE__ */ (0, import_jsx_runtime283.jsx)( "img", { onLoad: () => setIsImageLoaded(true), alt: "", src: imageUrl } ) } ), !imageUrl && /* @__PURE__ */ (0, import_jsx_runtime283.jsx)("div", { className: "page-templates-author-field__icon", children: /* @__PURE__ */ (0, import_jsx_runtime283.jsx)(import_components154.Icon, { icon }) }), /* @__PURE__ */ (0, import_jsx_runtime283.jsx)("span", { className: "page-templates-author-field__name", children: text }) ] }); } var authorField = { label: (0, import_i18n147.__)("Author"), id: "author", getValue: ({ item }) => item.author_text ?? item.author, render: AuthorField2 }; var activeField = { label: (0, import_i18n147.__)("Status"), id: "active", type: "boolean", getValue: ({ item }) => item._isActive, render: function Render({ item }) { const activeLabel = item._isCustom ? (0, import_i18n147._x)("Active when used", "template") : (0, import_i18n147._x)("Active", "template"); const activeIntent = item._isCustom ? "info" : "success"; const isActive = item._isActive; return /* @__PURE__ */ (0, import_jsx_runtime283.jsx)(Badge5, { intent: isActive ? activeIntent : "default", children: isActive ? activeLabel : (0, import_i18n147._x)("Inactive", "template") }); } }; var useThemeField = () => { const activeTheme = (0, import_data74.useSelect)( (select3) => select3(import_core_data54.store).getCurrentTheme() ); return (0, import_element148.useMemo)( () => ({ label: (0, import_i18n147.__)("Compatible Theme"), id: "theme", getValue: ({ item }) => item.theme, render: function Render3({ item }) { if (item.theme === activeTheme.stylesheet) { return /* @__PURE__ */ (0, import_jsx_runtime283.jsx)(Badge5, { intent: "success", children: item.theme }); } return /* @__PURE__ */ (0, import_jsx_runtime283.jsx)(Badge5, { intent: "error", children: item.theme }); } }), [activeTheme] ); }; var slugField = { label: (0, import_i18n147.__)("Template Type"), id: "slug", getValue: ({ item }) => item.slug, render: function Render2({ item }) { const defaultTemplateTypes = useAllDefaultTemplateTypes(); const defaultTemplateType = defaultTemplateTypes.find( (type) => type.slug === item.slug ); return defaultTemplateType?.title || (0, import_i18n147._x)("Custom", "template type"); } }; // packages/edit-site/build-module/components/page-templates/view-utils.mjs var defaultLayouts2 = { table: { showMedia: false }, grid: { showMedia: true }, list: { showMedia: false } }; var DEFAULT_VIEW2 = { type: "grid", perPage: 20, sort: { field: "title", direction: "asc" }, titleField: "title", descriptionField: "description", mediaField: "preview", fields: ["author", "active", "slug", "theme"], filters: [], ...defaultLayouts2.grid }; function getActiveViewOverridesForTab(activeView) { if (activeView === "user") { return { sort: { field: "date", direction: "desc" } }; } if (activeView === "active") { return {}; } return { filters: [ { field: "author", operator: "is", value: activeView, isLocked: true } ] }; } // packages/edit-site/build-module/components/page-templates/index.mjs var import_jsx_runtime284 = __toESM(require_jsx_runtime(), 1); var { usePostActions: usePostActions2, usePostFields, templateTitleField } = unlock(import_editor35.privateApis); var { useHistory: useHistory22, useLocation: useLocation30 } = unlock(import_router35.privateApis); var { useEntityRecordsWithPermissions: useEntityRecordsWithPermissions2 } = unlock(import_core_data55.privateApis); function PageTemplates() { const { path, query } = useLocation30(); const { activeView = "active", postId } = query; const [selection, setSelection] = (0, import_element149.useState)([postId]); const [selectedRegisteredTemplate, setSelectedRegisteredTemplate] = (0, import_element149.useState)(false); const defaultView = DEFAULT_VIEW2; const activeViewOverrides = (0, import_element149.useMemo)( () => getActiveViewOverridesForTab(activeView), [activeView] ); const { view, updateView, isModified, resetToDefault } = useView({ kind: "postType", name: TEMPLATE_POST_TYPE, slug: "default", defaultView, activeViewOverrides, queryParams: { page: query.pageNumber, search: query.search }, onChangeQueryParams: (newQueryParams) => { history.navigate( (0, import_url22.addQueryArgs)(path, { ...query, pageNumber: newQueryParams.page, search: newQueryParams.search || void 0 }) ); } }); const { activeTemplatesOption, activeTheme, defaultTemplateTypes } = (0, import_data75.useSelect)((select3) => { const { getEntityRecord, getCurrentTheme } = select3(import_core_data55.store); return { activeTemplatesOption: getEntityRecord("root", "site")?.active_templates, activeTheme: getCurrentTheme(), defaultTemplateTypes: select3(import_core_data55.store).getCurrentTheme()?.default_template_types }; }); const { records: userRecords, isResolving: isLoadingUserRecords } = useEntityRecordsWithPermissions2("postType", TEMPLATE_POST_TYPE, { per_page: -1, combinedTemplates: false }); const { records: staticRecords, isResolving: isLoadingStaticData } = useEntityRecordsWithPermissions2("root", "registeredTemplate", { // This should not be needed, the endpoint returns all registered // templates, but it's not possible right now to turn off pagination // for entity configs. per_page: -1 }); const activeTemplates = (0, import_element149.useMemo)(() => { const _active = [...staticRecords]; if (activeTemplatesOption) { for (const activeSlug in activeTemplatesOption) { const activeId = activeTemplatesOption[activeSlug]; const template = userRecords.find( (userRecord) => userRecord.id === activeId && userRecord.theme === activeTheme.stylesheet ); if (template) { const index = _active.findIndex( ({ slug }) => slug === template.slug ); if (index !== -1) { _active[index] = template; } else { _active.push(template); } } } } return _active; }, [userRecords, staticRecords, activeTemplatesOption, activeTheme]); let isLoadingData; if (activeView === "active") { isLoadingData = isLoadingUserRecords || isLoadingStaticData; } else if (activeView === "user") { isLoadingData = isLoadingUserRecords; } else { isLoadingData = isLoadingStaticData; } const records = (0, import_element149.useMemo)(() => { function isCustom(record) { return record.is_custom ?? // For user templates it's custom if the is_wp_suggestion meta // field is not set and the slug is not found in the default // template types. (!record.meta?.is_wp_suggestion && !defaultTemplateTypes.some( (type) => type.slug === record.slug )); } let _records; if (activeView === "active") { _records = activeTemplates.filter( (record) => !isCustom(record) ); } else if (activeView === "user") { _records = userRecords; } else { _records = staticRecords; } return _records.map((record) => ({ ...record, _isActive: activeTemplates.some( (template) => template.id === record.id ), _isCustom: isCustom(record) })); }, [ activeTemplates, defaultTemplateTypes, userRecords, staticRecords, activeView ]); const users = (0, import_data75.useSelect)( (select3) => { const { getUser } = select3(import_core_data55.store); return records.reduce((acc, record) => { if (record.author_text) { if (!acc[record.author_text]) { acc[record.author_text] = record.author_text; } } else if (record.author) { if (!acc[record.author]) { acc[record.author] = getUser(record.author); } } return acc; }, {}); }, [records] ); const history = useHistory22(); const onChangeSelection = (0, import_element149.useCallback)( (items) => { setSelection(items); if (view?.type === "list") { history.navigate( (0, import_url22.addQueryArgs)(path, { postId: items.length === 1 ? items[0] : void 0 }) ); } }, [history, path, view?.type] ); const postTypeFields = usePostFields({ postType: TEMPLATE_POST_TYPE }); const dateField = postTypeFields.find((field) => field.id === "date"); const themeField = useThemeField(); const fields = (0, import_element149.useMemo)(() => { const _fields = [ previewField2, templateTitleField, descriptionField, activeField, slugField ]; if (activeView === "user") { _fields.push(themeField); if (dateField) { _fields.push(dateField); } } const elements2 = []; for (const author in users) { elements2.push({ value: users[author]?.id ?? author, label: users[author]?.name ?? author }); } _fields.push({ ...authorField, elements: elements2 }); return _fields; }, [users, activeView, themeField, dateField]); const { data, paginationInfo } = (0, import_element149.useMemo)(() => { return filterSortAndPaginate(records, view, fields); }, [records, view, fields]); const { createSuccessNotice } = (0, import_data75.useDispatch)(import_notices8.store); const onActionPerformed = (0, import_element149.useCallback)( (actionId, items) => { switch (actionId) { case "duplicate-post": { const newItem = items[0]; const _title = typeof newItem.title === "string" ? newItem.title : newItem.title?.rendered; history.navigate(`/template?activeView=user`); createSuccessNotice( (0, import_i18n148.sprintf)( // translators: %s: Title of the created post or template, e.g: "Hello world". (0, import_i18n148.__)('"%s" successfully created.'), (0, import_html_entities14.decodeEntities)(_title) || (0, import_i18n148.__)("(no title)") ), { type: "snackbar", id: "duplicate-post-action", actions: [ { label: (0, import_i18n148.__)("Edit"), onClick: () => { history.navigate( `/${newItem.type}/${newItem.id}?canvas=edit` ); } } ] } ); } break; } }, [history, createSuccessNotice] ); const postTypeActions = usePostActions2({ postType: TEMPLATE_POST_TYPE, context: "list", onActionPerformed }); const editAction = useEditPostAction(); const setActiveTemplateAction = useSetActiveTemplateAction(); const actions = (0, import_element149.useMemo)( () => activeView === "user" ? [setActiveTemplateAction, editAction, ...postTypeActions] : [setActiveTemplateAction, ...postTypeActions], [postTypeActions, setActiveTemplateAction, editAction, activeView] ); const onChangeView = (0, import_compose30.useEvent)((newView) => { updateView(newView); if (newView.type !== view.type) { history.invalidate(); } }); const duplicateAction = actions.find( (action) => action.id === "duplicate-post" ); return /* @__PURE__ */ (0, import_jsx_runtime284.jsxs)( page_default2, { className: "edit-site-page-templates", title: (0, import_i18n148.__)("Templates"), headingLevel: 2, actions: /* @__PURE__ */ (0, import_jsx_runtime284.jsx)(add_new_template_default, {}), children: [ /* @__PURE__ */ (0, import_jsx_runtime284.jsx)( dataviews_default, { paginationInfo, fields, actions, data, isLoading: isLoadingData, view, onChangeView, onChangeSelection, isItemClickable: () => true, onClickItem: (item) => { if (typeof item.id === "string") { setSelectedRegisteredTemplate(item); } else { history.navigate( `/${item.type}/${item.id}?canvas=edit` ); } }, selection, defaultLayouts: defaultLayouts2, onReset: isModified ? () => { resetToDefault(); history.invalidate(); } : false }, activeView ), selectedRegisteredTemplate && duplicateAction && /* @__PURE__ */ (0, import_jsx_runtime284.jsx)( import_components155.Modal, { title: (0, import_i18n148.__)("Duplicate"), onRequestClose: () => setSelectedRegisteredTemplate(), size: "small", children: /* @__PURE__ */ (0, import_jsx_runtime284.jsx)( duplicateAction.RenderModal, { items: [selectedRegisteredTemplate], closeModal: () => setSelectedRegisteredTemplate() } ) } ) ] } ); } // packages/edit-site/build-module/components/page-templates/index-legacy.mjs var import_i18n153 = __toESM(require_i18n(), 1); var import_element154 = __toESM(require_element(), 1); var import_core_data59 = __toESM(require_core_data(), 1); var import_router37 = __toESM(require_router(), 1); var import_editor36 = __toESM(require_editor(), 1); var import_url25 = __toESM(require_url(), 1); var import_compose33 = __toESM(require_compose(), 1); // packages/edit-site/build-module/components/add-new-template-legacy/index.mjs var import_components158 = __toESM(require_components(), 1); var import_html_entities17 = __toESM(require_html_entities(), 1); var import_element153 = __toESM(require_element(), 1); var import_data77 = __toESM(require_data(), 1); var import_core_data58 = __toESM(require_core_data(), 1); var import_compose32 = __toESM(require_compose(), 1); var import_i18n152 = __toESM(require_i18n(), 1); var import_notices9 = __toESM(require_notices(), 1); var import_router36 = __toESM(require_router(), 1); var import_dom15 = __toESM(require_dom(), 1); // packages/edit-site/build-module/components/add-new-template-legacy/add-custom-template-modal-content.mjs var import_element151 = __toESM(require_element(), 1); var import_i18n150 = __toESM(require_i18n(), 1); var import_components156 = __toESM(require_components(), 1); var import_core_data57 = __toESM(require_core_data(), 1); var import_html_entities16 = __toESM(require_html_entities(), 1); var import_compose31 = __toESM(require_compose(), 1); var import_dom14 = __toESM(require_dom(), 1); var import_url24 = __toESM(require_url(), 1); // packages/edit-site/build-module/components/add-new-template-legacy/utils.mjs var import_data76 = __toESM(require_data(), 1); var import_core_data56 = __toESM(require_core_data(), 1); var import_html_entities15 = __toESM(require_html_entities(), 1); var import_element150 = __toESM(require_element(), 1); var import_i18n149 = __toESM(require_i18n(), 1); var import_url23 = __toESM(require_url(), 1); var EMPTY_OBJECT3 = {}; var getValueFromObjectPath3 = (object, path) => { let value = object; path.split(".").forEach((fieldName) => { value = value?.[fieldName]; }); return value; }; function prefixSlug2(prefix2, slug) { return `${prefix2}-${(0, import_url23.safeDecodeURI)(slug)}`; } var mapToIHasNameAndId2 = (entities, path) => { return (entities || []).map((entity) => ({ ...entity, name: (0, import_html_entities15.decodeEntities)(getValueFromObjectPath3(entity, path)) })); }; var useExistingTemplates2 = () => { return (0, import_data76.useSelect)( (select3) => select3(import_core_data56.store).getEntityRecords( "postType", TEMPLATE_POST_TYPE, { per_page: -1 } ), [] ); }; var useDefaultTemplateTypes2 = () => { return (0, import_data76.useSelect)( (select3) => select3(import_core_data56.store).getCurrentTheme()?.default_template_types || [], [] ); }; var usePublicPostTypes2 = () => { const postTypes = (0, import_data76.useSelect)( (select3) => select3(import_core_data56.store).getPostTypes({ per_page: -1 }), [] ); return (0, import_element150.useMemo)(() => { const excludedPostTypes = ["attachment"]; return postTypes?.filter( ({ viewable, slug }) => viewable && !excludedPostTypes.includes(slug) ).sort((a2, b2) => { if (a2.slug === "post" || b2.slug === "post") { return 0; } return a2.name.localeCompare(b2.name); }); }, [postTypes]); }; var usePublicTaxonomies2 = () => { const taxonomies = (0, import_data76.useSelect)( (select3) => select3(import_core_data56.store).getTaxonomies({ per_page: -1 }), [] ); return (0, import_element150.useMemo)(() => { return taxonomies?.filter( ({ visibility }) => visibility?.publicly_queryable ); }, [taxonomies]); }; function usePostTypeArchiveMenuItems2() { const publicPostTypes = usePublicPostTypes2(); const postTypesWithArchives = (0, import_element150.useMemo)( () => publicPostTypes?.filter((postType2) => postType2.has_archive), [publicPostTypes] ); const existingTemplates = useExistingTemplates2(); const postTypeLabels = (0, import_element150.useMemo)( () => publicPostTypes?.reduce((accumulator, { labels }) => { const singularName = labels.singular_name.toLowerCase(); accumulator[singularName] = (accumulator[singularName] || 0) + 1; return accumulator; }, {}), [publicPostTypes] ); const needsUniqueIdentifier = (0, import_element150.useCallback)( ({ labels, slug }) => { const singularName = labels.singular_name.toLowerCase(); return postTypeLabels[singularName] > 1 && singularName !== slug; }, [postTypeLabels] ); return (0, import_element150.useMemo)( () => postTypesWithArchives?.filter( (postType2) => !(existingTemplates || []).some( (existingTemplate) => existingTemplate.slug === "archive-" + postType2.slug ) ).map((postType2) => { let title; if (needsUniqueIdentifier(postType2)) { title = (0, import_i18n149.sprintf)( // translators: %1s: Name of the post type e.g: "Post"; %2s: Slug of the post type e.g: "book". (0, import_i18n149.__)("Archive: %1$s (%2$s)"), postType2.labels.singular_name, postType2.slug ); } else { title = (0, import_i18n149.sprintf)( // translators: %s: Name of the post type e.g: "Post". (0, import_i18n149.__)("Archive: %s"), postType2.labels.singular_name ); } return { slug: "archive-" + postType2.slug, description: (0, import_i18n149.sprintf)( // translators: %s: Name of the post type e.g: "Post". (0, import_i18n149.__)( "Displays an archive with the latest posts of type: %s." ), postType2.labels.singular_name ), title, // `icon` is the `menu_icon` property of a post type. We // only handle `dashicons` for now, even if the `menu_icon` // also supports urls and svg as values. icon: typeof postType2.icon === "string" && postType2.icon.startsWith("dashicons-") ? postType2.icon.slice(10) : archive_default, templatePrefix: "archive" }; }) || [], [postTypesWithArchives, existingTemplates, needsUniqueIdentifier] ); } var usePostTypeMenuItems2 = (onClickMenuItem) => { const publicPostTypes = usePublicPostTypes2(); const existingTemplates = useExistingTemplates2(); const defaultTemplateTypes = useDefaultTemplateTypes2(); const templateLabels = (0, import_element150.useMemo)( () => publicPostTypes?.reduce((accumulator, { labels }) => { const templateName = (labels.template_name || labels.singular_name).toLowerCase(); accumulator[templateName] = (accumulator[templateName] || 0) + 1; return accumulator; }, {}), [publicPostTypes] ); const needsUniqueIdentifier = (0, import_element150.useCallback)( ({ labels, slug }) => { const templateName = (labels.template_name || labels.singular_name).toLowerCase(); return templateLabels[templateName] > 1 && templateName !== slug; }, [templateLabels] ); const templatePrefixes = (0, import_element150.useMemo)( () => publicPostTypes?.reduce((accumulator, { slug }) => { let suffix = slug; if (slug !== "page") { suffix = `single-${suffix}`; } accumulator[slug] = suffix; return accumulator; }, {}), [publicPostTypes] ); const postTypesInfo = useEntitiesInfo2("postType", templatePrefixes); const existingTemplateSlugs = (existingTemplates || []).map( ({ slug }) => slug ); const menuItems = (publicPostTypes || []).reduce( (accumulator, postType2) => { const { slug, labels, icon } = postType2; const generalTemplateSlug = templatePrefixes[slug]; const defaultTemplateType = defaultTemplateTypes?.find( ({ slug: _slug }) => _slug === generalTemplateSlug ); const hasGeneralTemplate = existingTemplateSlugs?.includes(generalTemplateSlug); const _needsUniqueIdentifier = needsUniqueIdentifier(postType2); let menuItemTitle = labels.template_name || (0, import_i18n149.sprintf)( // translators: %s: Name of the post type e.g: "Post". (0, import_i18n149.__)("Single item: %s"), labels.singular_name ); if (_needsUniqueIdentifier) { menuItemTitle = labels.template_name ? (0, import_i18n149.sprintf)( // translators: 1: Name of the template e.g: "Single Item: Post". 2: Slug of the post type e.g: "book". (0, import_i18n149._x)("%1$s (%2$s)", "post type menu label"), labels.template_name, slug ) : (0, import_i18n149.sprintf)( // translators: 1: Name of the post type e.g: "Post". 2: Slug of the post type e.g: "book". (0, import_i18n149._x)( "Single item: %1$s (%2$s)", "post type menu label" ), labels.singular_name, slug ); } const menuItem = defaultTemplateType ? { ...defaultTemplateType, templatePrefix: templatePrefixes[slug] } : { slug: generalTemplateSlug, title: menuItemTitle, description: (0, import_i18n149.sprintf)( // translators: %s: Name of the post type e.g: "Post". (0, import_i18n149.__)("Displays a single item: %s."), labels.singular_name ), // `icon` is the `menu_icon` property of a post type. We // only handle `dashicons` for now, even if the `menu_icon` // also supports urls and svg as values. icon: typeof icon === "string" && icon.startsWith("dashicons-") ? icon.slice(10) : post_default, templatePrefix: templatePrefixes[slug] }; const hasEntities = postTypesInfo?.[slug]?.hasEntities; if (hasEntities) { menuItem.onClick = (template) => { onClickMenuItem({ type: "postType", slug, config: { recordNamePath: "title.rendered", queryArgs: ({ search }) => { return { _fields: "id,title,slug,link", orderBy: search ? "relevance" : "modified", exclude: postTypesInfo[slug].existingEntitiesIds }; }, getSpecificTemplate: (suggestion) => { const templateSlug = prefixSlug2( templatePrefixes[slug], suggestion.slug ); return { title: templateSlug, slug: templateSlug, templatePrefix: templatePrefixes[slug] }; } }, labels, hasGeneralTemplate, template }); }; } if (!hasGeneralTemplate || hasEntities) { accumulator.push(menuItem); } return accumulator; }, [] ); const postTypesMenuItems = (0, import_element150.useMemo)( () => menuItems.reduce( (accumulator, postType2) => { const { slug } = postType2; let key = "postTypesMenuItems"; if (slug === "page") { key = "defaultPostTypesMenuItems"; } accumulator[key].push(postType2); return accumulator; }, { defaultPostTypesMenuItems: [], postTypesMenuItems: [] } ), [menuItems] ); return postTypesMenuItems; }; var useTaxonomiesMenuItems2 = (onClickMenuItem) => { const publicTaxonomies = usePublicTaxonomies2(); const existingTemplates = useExistingTemplates2(); const defaultTemplateTypes = useDefaultTemplateTypes2(); const templatePrefixes = (0, import_element150.useMemo)( () => publicTaxonomies?.reduce((accumulator, { slug }) => { let suffix = slug; if (!["category", "post_tag"].includes(slug)) { suffix = `taxonomy-${suffix}`; } if (slug === "post_tag") { suffix = `tag`; } accumulator[slug] = suffix; return accumulator; }, {}), [publicTaxonomies] ); const taxonomyLabels = publicTaxonomies?.reduce( (accumulator, { labels }) => { const templateName = (labels.template_name || labels.singular_name).toLowerCase(); accumulator[templateName] = (accumulator[templateName] || 0) + 1; return accumulator; }, {} ); const needsUniqueIdentifier = (labels, slug) => { if (["category", "post_tag"].includes(slug)) { return false; } const templateName = (labels.template_name || labels.singular_name).toLowerCase(); return taxonomyLabels[templateName] > 1 && templateName !== slug; }; const taxonomiesInfo = useEntitiesInfo2("taxonomy", templatePrefixes); const existingTemplateSlugs = (existingTemplates || []).map( ({ slug }) => slug ); const menuItems = (publicTaxonomies || []).reduce( (accumulator, taxonomy) => { const { slug, labels } = taxonomy; const generalTemplateSlug = templatePrefixes[slug]; const defaultTemplateType = defaultTemplateTypes?.find( ({ slug: _slug }) => _slug === generalTemplateSlug ); const hasGeneralTemplate = existingTemplateSlugs?.includes(generalTemplateSlug); const _needsUniqueIdentifier = needsUniqueIdentifier( labels, slug ); let menuItemTitle = labels.template_name || labels.singular_name; if (_needsUniqueIdentifier) { menuItemTitle = labels.template_name ? (0, import_i18n149.sprintf)( // translators: 1: Name of the template e.g: "Products by Category". 2: Slug of the taxonomy e.g: "product_cat". (0, import_i18n149._x)("%1$s (%2$s)", "taxonomy template menu label"), labels.template_name, slug ) : (0, import_i18n149.sprintf)( // translators: 1: Name of the taxonomy e.g: "Category". 2: Slug of the taxonomy e.g: "product_cat". (0, import_i18n149._x)("%1$s (%2$s)", "taxonomy menu label"), labels.singular_name, slug ); } const menuItem = defaultTemplateType ? { ...defaultTemplateType, templatePrefix: templatePrefixes[slug] } : { slug: generalTemplateSlug, title: menuItemTitle, description: (0, import_i18n149.sprintf)( // translators: %s: Name of the taxonomy e.g: "Product Categories". (0, import_i18n149.__)("Displays taxonomy: %s."), labels.singular_name ), icon: block_meta_default, templatePrefix: templatePrefixes[slug] }; const hasEntities = taxonomiesInfo?.[slug]?.hasEntities; if (hasEntities) { menuItem.onClick = (template) => { onClickMenuItem({ type: "taxonomy", slug, config: { queryArgs: ({ search }) => { return { _fields: "id,name,slug,link", orderBy: search ? "name" : "count", exclude: taxonomiesInfo[slug].existingEntitiesIds }; }, getSpecificTemplate: (suggestion) => { const templateSlug = prefixSlug2( templatePrefixes[slug], suggestion.slug ); return { title: templateSlug, slug: templateSlug, templatePrefix: templatePrefixes[slug] }; } }, labels, hasGeneralTemplate, template }); }; } if (!hasGeneralTemplate || hasEntities) { accumulator.push(menuItem); } return accumulator; }, [] ); const taxonomiesMenuItems = (0, import_element150.useMemo)( () => menuItems.reduce( (accumulator, taxonomy) => { const { slug } = taxonomy; let key = "taxonomiesMenuItems"; if (["category", "tag"].includes(slug)) { key = "defaultTaxonomiesMenuItems"; } accumulator[key].push(taxonomy); return accumulator; }, { defaultTaxonomiesMenuItems: [], taxonomiesMenuItems: [] } ), [menuItems] ); return taxonomiesMenuItems; }; var USE_AUTHOR_MENU_ITEM_TEMPLATE_PREFIX2 = { user: "author" }; var USE_AUTHOR_MENU_ITEM_QUERY_PARAMETERS2 = { user: { who: "authors" } }; function useAuthorMenuItem2(onClickMenuItem) { const existingTemplates = useExistingTemplates2(); const defaultTemplateTypes = useDefaultTemplateTypes2(); const authorInfo = useEntitiesInfo2( "root", USE_AUTHOR_MENU_ITEM_TEMPLATE_PREFIX2, USE_AUTHOR_MENU_ITEM_QUERY_PARAMETERS2 ); let authorMenuItem = defaultTemplateTypes?.find( ({ slug }) => slug === "author" ); if (!authorMenuItem) { authorMenuItem = { description: (0, import_i18n149.__)( "Displays latest posts written by a single author." ), slug: "author", title: "Author" }; } const hasGeneralTemplate = !!existingTemplates?.find( ({ slug }) => slug === "author" ); if (authorInfo.user?.hasEntities) { authorMenuItem = { ...authorMenuItem, templatePrefix: "author" }; authorMenuItem.onClick = (template) => { onClickMenuItem({ type: "root", slug: "user", config: { queryArgs: ({ search }) => { return { _fields: "id,name,slug,link", orderBy: search ? "name" : "registered_date", exclude: authorInfo.user.existingEntitiesIds, who: "authors" }; }, getSpecificTemplate: (suggestion) => { const templateSlug = prefixSlug2( "author", suggestion.slug ); return { title: templateSlug, slug: templateSlug, templatePrefix: "author" }; } }, labels: { singular_name: (0, import_i18n149.__)("Author"), search_items: (0, import_i18n149.__)("Search Authors"), not_found: (0, import_i18n149.__)("No authors found."), all_items: (0, import_i18n149.__)("All Authors") }, hasGeneralTemplate, template }); }; } if (!hasGeneralTemplate || authorInfo.user?.hasEntities) { return authorMenuItem; } } var useExistingTemplateSlugs = (templatePrefixes) => { const existingTemplates = useExistingTemplates2(); const existingSlugs = (0, import_element150.useMemo)(() => { return Object.entries(templatePrefixes || {}).reduce( (accumulator, [slug, prefix2]) => { const slugsWithTemplates = (existingTemplates || []).reduce( (_accumulator, existingTemplate) => { const _prefix = `${prefix2}-`; if (existingTemplate.slug.startsWith(_prefix)) { _accumulator.push( existingTemplate.slug.substring( _prefix.length ) ); } return _accumulator; }, [] ); if (slugsWithTemplates.length) { accumulator[slug] = slugsWithTemplates; } return accumulator; }, {} ); }, [templatePrefixes, existingTemplates]); return existingSlugs; }; var useTemplatesToExclude = (entityName, templatePrefixes, additionalQueryParameters = {}) => { const slugsToExcludePerEntity = useExistingTemplateSlugs(templatePrefixes); const recordsToExcludePerEntity = (0, import_data76.useSelect)( (select3) => { return Object.entries(slugsToExcludePerEntity || {}).reduce( (accumulator, [slug, slugsWithTemplates]) => { const entitiesWithTemplates = select3( import_core_data56.store ).getEntityRecords(entityName, slug, { _fields: "id", context: "view", slug: slugsWithTemplates, ...additionalQueryParameters[slug] }); if (entitiesWithTemplates?.length) { accumulator[slug] = entitiesWithTemplates; } return accumulator; }, {} ); }, [slugsToExcludePerEntity] ); return recordsToExcludePerEntity; }; var useEntitiesInfo2 = (entityName, templatePrefixes, additionalQueryParameters = EMPTY_OBJECT3) => { const recordsToExcludePerEntity = useTemplatesToExclude( entityName, templatePrefixes, additionalQueryParameters ); const entitiesHasRecords = (0, import_data76.useSelect)( (select3) => { return Object.keys(templatePrefixes || {}).reduce( (accumulator, slug) => { const existingEntitiesIds = recordsToExcludePerEntity?.[slug]?.map( ({ id }) => id ) || []; accumulator[slug] = !!select3( import_core_data56.store ).getEntityRecords(entityName, slug, { per_page: 1, _fields: "id", context: "view", exclude: existingEntitiesIds, ...additionalQueryParameters[slug] })?.length; return accumulator; }, {} ); }, [ templatePrefixes, recordsToExcludePerEntity, entityName, additionalQueryParameters ] ); const entitiesInfo = (0, import_element150.useMemo)(() => { return Object.keys(templatePrefixes || {}).reduce( (accumulator, slug) => { const existingEntitiesIds = recordsToExcludePerEntity?.[slug]?.map( ({ id }) => id ) || []; accumulator[slug] = { hasEntities: entitiesHasRecords[slug], existingEntitiesIds }; return accumulator; }, {} ); }, [templatePrefixes, recordsToExcludePerEntity, entitiesHasRecords]); return entitiesInfo; }; // packages/edit-site/build-module/components/add-new-template-legacy/add-custom-template-modal-content.mjs var import_jsx_runtime285 = __toESM(require_jsx_runtime(), 1); var EMPTY_ARRAY15 = []; function SuggestionListItem2({ suggestion, search, onSelect, entityForSuggestions }) { const baseCssClass = "edit-site-custom-template-modal__suggestions_list__list-item"; return /* @__PURE__ */ (0, import_jsx_runtime285.jsxs)( import_components156.Composite.Item, { render: /* @__PURE__ */ (0, import_jsx_runtime285.jsx)( import_components156.Button, { __next40pxDefaultSize: true, role: "option", className: baseCssClass, onClick: () => onSelect( entityForSuggestions.config.getSpecificTemplate( suggestion ) ) } ), children: [ /* @__PURE__ */ (0, import_jsx_runtime285.jsx)( import_components156.__experimentalText, { size: "body", lineHeight: 1.53846153846, weight: 500, className: `${baseCssClass}__title`, children: /* @__PURE__ */ (0, import_jsx_runtime285.jsx)( import_components156.TextHighlight, { text: (0, import_html_entities16.decodeEntities)(suggestion.name), highlight: search } ) } ), suggestion.link && /* @__PURE__ */ (0, import_jsx_runtime285.jsx)( import_components156.__experimentalText, { size: "body", lineHeight: 1.53846153846, className: `${baseCssClass}__info`, children: (0, import_url24.safeDecodeURI)(suggestion.link) } ) ] } ); } function useSearchSuggestions2(entityForSuggestions, search) { const { config: config2 } = entityForSuggestions; const query = (0, import_element151.useMemo)( () => ({ order: "asc", context: "view", search, per_page: search ? 20 : 10, ...config2.queryArgs(search) }), [search, config2] ); const { records: searchResults, hasResolved: searchHasResolved } = (0, import_core_data57.useEntityRecords)( entityForSuggestions.type, entityForSuggestions.slug, query ); const [suggestions, setSuggestions] = (0, import_element151.useState)(EMPTY_ARRAY15); (0, import_element151.useEffect)(() => { if (!searchHasResolved) { return; } let newSuggestions = EMPTY_ARRAY15; if (searchResults?.length) { newSuggestions = searchResults; if (config2.recordNamePath) { newSuggestions = mapToIHasNameAndId2( newSuggestions, config2.recordNamePath ); } } setSuggestions(newSuggestions); }, [searchResults, searchHasResolved]); return suggestions; } function SuggestionList2({ entityForSuggestions, onSelect }) { const [search, setSearch, debouncedSearch] = (0, import_compose31.useDebouncedInput)(); const suggestions = useSearchSuggestions2( entityForSuggestions, debouncedSearch ); const { labels } = entityForSuggestions; const [showSearchControl, setShowSearchControl] = (0, import_element151.useState)(false); if (!showSearchControl && suggestions?.length > 9) { setShowSearchControl(true); } return /* @__PURE__ */ (0, import_jsx_runtime285.jsxs)(import_jsx_runtime285.Fragment, { children: [ showSearchControl && /* @__PURE__ */ (0, import_jsx_runtime285.jsx)( import_components156.SearchControl, { onChange: setSearch, value: search, label: labels.search_items, placeholder: labels.search_items } ), !!suggestions?.length && /* @__PURE__ */ (0, import_jsx_runtime285.jsx)( import_components156.Composite, { orientation: "vertical", role: "listbox", className: "edit-site-custom-template-modal__suggestions_list", "aria-label": (0, import_i18n150.__)("Suggestions list"), children: suggestions.map((suggestion) => /* @__PURE__ */ (0, import_jsx_runtime285.jsx)( SuggestionListItem2, { suggestion, search: debouncedSearch, onSelect, entityForSuggestions }, suggestion.slug )) } ), debouncedSearch && !suggestions?.length && /* @__PURE__ */ (0, import_jsx_runtime285.jsx)( import_components156.__experimentalText, { as: "p", className: "edit-site-custom-template-modal__no-results", children: labels.not_found } ) ] }); } function AddCustomTemplateModalContent2({ onSelect, entityForSuggestions, onBack, containerRef }) { const [showSearchEntities, setShowSearchEntities] = (0, import_element151.useState)( entityForSuggestions.hasGeneralTemplate ); (0, import_element151.useEffect)(() => { if (containerRef.current) { const [firstFocusable] = import_dom14.focus.focusable.find( containerRef.current ); firstFocusable?.focus(); } }, [showSearchEntities]); return /* @__PURE__ */ (0, import_jsx_runtime285.jsxs)( import_components156.__experimentalVStack, { spacing: 4, className: "edit-site-custom-template-modal__contents-wrapper", alignment: "left", children: [ !showSearchEntities && /* @__PURE__ */ (0, import_jsx_runtime285.jsxs)(import_jsx_runtime285.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime285.jsx)(import_components156.__experimentalText, { as: "p", children: (0, import_i18n150.__)( "Select whether to create a single template for all items or a specific one." ) }), /* @__PURE__ */ (0, import_jsx_runtime285.jsxs)( import_components156.Flex, { className: "edit-site-custom-template-modal__contents", gap: "4", align: "initial", children: [ /* @__PURE__ */ (0, import_jsx_runtime285.jsxs)( import_components156.FlexItem, { isBlock: true, as: import_components156.Button, onClick: () => { const { slug, title, description, templatePrefix } = entityForSuggestions.template; onSelect({ slug, title, description, templatePrefix }); }, children: [ /* @__PURE__ */ (0, import_jsx_runtime285.jsx)( import_components156.__experimentalText, { as: "span", weight: 500, lineHeight: 1.53846153846, children: entityForSuggestions.labels.all_items } ), /* @__PURE__ */ (0, import_jsx_runtime285.jsx)( import_components156.__experimentalText, { as: "span", lineHeight: 1.53846153846, // translators: The user is given the choice to set up a template for all items of a post type or taxonomy, or just a specific one. children: (0, import_i18n150.__)("For all items") } ) ] } ), /* @__PURE__ */ (0, import_jsx_runtime285.jsxs)( import_components156.FlexItem, { isBlock: true, as: import_components156.Button, onClick: () => { setShowSearchEntities(true); }, children: [ /* @__PURE__ */ (0, import_jsx_runtime285.jsx)( import_components156.__experimentalText, { as: "span", weight: 500, lineHeight: 1.53846153846, children: entityForSuggestions.labels.singular_name } ), /* @__PURE__ */ (0, import_jsx_runtime285.jsx)( import_components156.__experimentalText, { as: "span", lineHeight: 1.53846153846, // translators: The user is given the choice to set up a template for all items of a post type or taxonomy, or just a specific one. children: (0, import_i18n150.__)("For a specific item") } ) ] } ) ] } ), /* @__PURE__ */ (0, import_jsx_runtime285.jsx)(import_components156.Flex, { justify: "right", children: /* @__PURE__ */ (0, import_jsx_runtime285.jsx)( import_components156.Button, { __next40pxDefaultSize: true, variant: "tertiary", onClick: onBack, children: (0, import_i18n150.__)("Back") } ) }) ] }), showSearchEntities && /* @__PURE__ */ (0, import_jsx_runtime285.jsxs)(import_jsx_runtime285.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime285.jsx)(import_components156.__experimentalText, { as: "p", children: (0, import_i18n150.__)( "This template will be used only for the specific item chosen." ) }), /* @__PURE__ */ (0, import_jsx_runtime285.jsx)( SuggestionList2, { entityForSuggestions, onSelect } ), /* @__PURE__ */ (0, import_jsx_runtime285.jsx)(import_components156.Flex, { justify: "right", children: /* @__PURE__ */ (0, import_jsx_runtime285.jsx)( import_components156.Button, { __next40pxDefaultSize: true, variant: "tertiary", onClick: () => { if (entityForSuggestions.hasGeneralTemplate) { onBack(); } else { setShowSearchEntities(false); } }, children: (0, import_i18n150.__)("Back") } ) }) ] }) ] } ); } var add_custom_template_modal_content_default2 = AddCustomTemplateModalContent2; // packages/edit-site/build-module/components/add-new-template-legacy/add-custom-generic-template-modal-content.mjs var import_element152 = __toESM(require_element(), 1); var import_i18n151 = __toESM(require_i18n(), 1); var import_components157 = __toESM(require_components(), 1); var import_jsx_runtime286 = __toESM(require_jsx_runtime(), 1); function AddCustomGenericTemplateModalContent2({ createTemplate, onBack }) { const [title, setTitle] = (0, import_element152.useState)(""); const defaultTitle = (0, import_i18n151.__)("Custom Template"); const [isBusy, setIsBusy] = (0, import_element152.useState)(false); const inputRef = (0, import_element152.useRef)(); (0, import_element152.useEffect)(() => { if (inputRef.current) { inputRef.current.focus(); } }, []); async function onCreateTemplate(event) { event.preventDefault(); if (isBusy) { return; } setIsBusy(true); try { await createTemplate( { slug: paramCase(title || defaultTitle) || "wp-custom-template", title: title || defaultTitle }, false ); } finally { setIsBusy(false); } } return /* @__PURE__ */ (0, import_jsx_runtime286.jsx)("form", { onSubmit: onCreateTemplate, children: /* @__PURE__ */ (0, import_jsx_runtime286.jsxs)(import_components157.__experimentalVStack, { spacing: 6, children: [ /* @__PURE__ */ (0, import_jsx_runtime286.jsx)( import_components157.TextControl, { __next40pxDefaultSize: true, label: (0, import_i18n151.__)("Name"), value: title, onChange: setTitle, placeholder: defaultTitle, disabled: isBusy, ref: inputRef, help: (0, import_i18n151.__)( // eslint-disable-next-line no-restricted-syntax -- 'sidebar' is a common web design term for layouts 'Describe the template, e.g. "Post with sidebar". A custom template can be manually applied to any post or page.' ) } ), /* @__PURE__ */ (0, import_jsx_runtime286.jsxs)( import_components157.__experimentalHStack, { className: "edit-site-custom-generic-template__modal-actions", justify: "right", children: [ /* @__PURE__ */ (0, import_jsx_runtime286.jsx)( import_components157.Button, { __next40pxDefaultSize: true, variant: "tertiary", onClick: onBack, children: (0, import_i18n151.__)("Back") } ), /* @__PURE__ */ (0, import_jsx_runtime286.jsx)( import_components157.Button, { __next40pxDefaultSize: true, variant: "primary", type: "submit", isBusy, "aria-disabled": isBusy, children: (0, import_i18n151.__)("Create") } ) ] } ) ] }) }); } var add_custom_generic_template_modal_content_default2 = AddCustomGenericTemplateModalContent2; // packages/edit-site/build-module/components/add-new-template-legacy/index.mjs var import_jsx_runtime287 = __toESM(require_jsx_runtime(), 1); var { useHistory: useHistory23 } = unlock(import_router36.privateApis); var DEFAULT_TEMPLATE_SLUGS2 = [ "front-page", "home", "single", "page", "index", "archive", "author", "category", "date", "tag", "search", "404" ]; var TEMPLATE_ICONS2 = { "front-page": home_default, home: verse_default, single: pin_default, page: page_default, archive: archive_default, search: search_default, 404: not_found_default, index: list_default, category: category_default, author: comment_author_avatar_default, taxonomy: block_meta_default, date: calendar_default, tag: tag_default, attachment: media_default }; function TemplateListItem2({ title, direction, className, description, icon, onClick, children }) { return /* @__PURE__ */ (0, import_jsx_runtime287.jsx)( import_components158.Button, { __next40pxDefaultSize: true, className, onClick, label: description, showTooltip: !!description, children: /* @__PURE__ */ (0, import_jsx_runtime287.jsxs)( import_components158.Flex, { as: "span", spacing: 2, align: "center", justify: "center", style: { width: "100%" }, direction, children: [ /* @__PURE__ */ (0, import_jsx_runtime287.jsx)("div", { className: "edit-site-add-new-template__template-icon", children: /* @__PURE__ */ (0, import_jsx_runtime287.jsx)(import_components158.Icon, { icon }) }), /* @__PURE__ */ (0, import_jsx_runtime287.jsxs)( import_components158.__experimentalVStack, { className: "edit-site-add-new-template__template-name", alignment: "center", spacing: 0, children: [ /* @__PURE__ */ (0, import_jsx_runtime287.jsx)( import_components158.__experimentalText, { align: "center", weight: 500, lineHeight: 1.53846153846, children: title } ), children ] } ) ] } ) } ); } var modalContentMap2 = { templatesList: 1, customTemplate: 2, customGenericTemplate: 3 }; function NewTemplateModal2({ onClose }) { const [modalContent, setModalContent] = (0, import_element153.useState)( modalContentMap2.templatesList ); const [entityForSuggestions, setEntityForSuggestions] = (0, import_element153.useState)({}); const [isSubmitting, setIsSubmitting] = (0, import_element153.useState)(false); const missingTemplates = useMissingTemplates2( setEntityForSuggestions, () => setModalContent(modalContentMap2.customTemplate) ); const history = useHistory23(); const { saveEntityRecord } = (0, import_data77.useDispatch)(import_core_data58.store); const { createErrorNotice, createSuccessNotice } = (0, import_data77.useDispatch)(import_notices9.store); const containerRef = (0, import_element153.useRef)(null); const isMobile = (0, import_compose32.useViewportMatch)("medium", "<"); const homeUrl = (0, import_data77.useSelect)((select3) => { return select3(import_core_data58.store).getEntityRecord("root", "__unstableBase")?.home; }, []); const TEMPLATE_SHORT_DESCRIPTIONS = { "front-page": homeUrl, date: (0, import_i18n152.sprintf)( // translators: %s: The homepage url. (0, import_i18n152.__)("E.g. %s"), homeUrl + "/" + (/* @__PURE__ */ new Date()).getFullYear() ) }; (0, import_element153.useEffect)(() => { if (containerRef.current && modalContent === modalContentMap2.templatesList) { const [firstFocusable] = import_dom15.focus.focusable.find( containerRef.current ); firstFocusable?.focus(); } }, [modalContent]); async function createTemplate(template, isWPSuggestion = true) { if (isSubmitting) { return; } setIsSubmitting(true); try { const { title, description, slug } = template; const newTemplate = await saveEntityRecord( "postType", TEMPLATE_POST_TYPE, { description, // Slugs need to be strings, so this is for template `404` slug: slug.toString(), status: "publish", title, // This adds a post meta field in template that is part of `is_custom` value calculation. is_wp_suggestion: isWPSuggestion }, { throwOnError: true } ); history.navigate( `/${TEMPLATE_POST_TYPE}/${newTemplate.id}?canvas=edit` ); createSuccessNotice( (0, import_i18n152.sprintf)( // translators: %s: Title of the created post or template, e.g: "Hello world". (0, import_i18n152.__)('"%s" successfully created.'), (0, import_html_entities17.decodeEntities)(newTemplate.title?.rendered || title) || (0, import_i18n152.__)("(no title)") ), { type: "snackbar" } ); } catch (error) { const errorMessage = error.message && error.code !== "unknown_error" ? error.message : (0, import_i18n152.__)("An error occurred while creating the template."); createErrorNotice(errorMessage, { type: "snackbar" }); } finally { setIsSubmitting(false); } } const onModalClose = () => { onClose(); setModalContent(modalContentMap2.templatesList); }; let modalTitle = (0, import_i18n152.__)("Add template"); if (modalContent === modalContentMap2.customTemplate) { modalTitle = (0, import_i18n152.sprintf)( // translators: %s: Name of the post type e.g: "Post". (0, import_i18n152.__)("Add template: %s"), entityForSuggestions.labels.singular_name ); } else if (modalContent === modalContentMap2.customGenericTemplate) { modalTitle = (0, import_i18n152.__)("Create custom template"); } return /* @__PURE__ */ (0, import_jsx_runtime287.jsxs)( import_components158.Modal, { title: modalTitle, className: clsx_default("edit-site-add-new-template__modal", { "edit-site-add-new-template__modal_template_list": modalContent === modalContentMap2.templatesList, "edit-site-custom-template-modal": modalContent === modalContentMap2.customTemplate }), onRequestClose: onModalClose, overlayClassName: modalContent === modalContentMap2.customGenericTemplate ? "edit-site-custom-generic-template__modal" : void 0, ref: containerRef, children: [ modalContent === modalContentMap2.templatesList && /* @__PURE__ */ (0, import_jsx_runtime287.jsxs)( import_components158.__experimentalGrid, { columns: isMobile ? 2 : 3, gap: 4, align: "flex-start", justify: "center", className: "edit-site-add-new-template__template-list__contents", children: [ /* @__PURE__ */ (0, import_jsx_runtime287.jsx)(import_components158.Flex, { className: "edit-site-add-new-template__template-list__prompt", children: (0, import_i18n152.__)( "Select what the new template should apply to:" ) }), missingTemplates.map((template) => { const { title, slug, onClick } = template; return /* @__PURE__ */ (0, import_jsx_runtime287.jsx)( TemplateListItem2, { title, direction: "column", className: "edit-site-add-new-template__template-button", description: TEMPLATE_SHORT_DESCRIPTIONS[slug], icon: TEMPLATE_ICONS2[slug] || layout_default, onClick: () => onClick ? onClick(template) : createTemplate(template) }, slug ); }), /* @__PURE__ */ (0, import_jsx_runtime287.jsx)( TemplateListItem2, { title: (0, import_i18n152.__)("Custom template"), direction: "row", className: "edit-site-add-new-template__custom-template-button", icon: pencil_default, onClick: () => setModalContent( modalContentMap2.customGenericTemplate ), children: /* @__PURE__ */ (0, import_jsx_runtime287.jsx)( import_components158.__experimentalText, { lineHeight: 1.53846153846, children: (0, import_i18n152.__)( "A custom template can be manually applied to any post or page." ) } ) } ) ] } ), modalContent === modalContentMap2.customTemplate && /* @__PURE__ */ (0, import_jsx_runtime287.jsx)( add_custom_template_modal_content_default2, { onSelect: createTemplate, entityForSuggestions, onBack: () => setModalContent(modalContentMap2.templatesList), containerRef } ), modalContent === modalContentMap2.customGenericTemplate && /* @__PURE__ */ (0, import_jsx_runtime287.jsx)( add_custom_generic_template_modal_content_default2, { createTemplate, onBack: () => setModalContent(modalContentMap2.templatesList) } ) ] } ); } function NewTemplate2() { const [showModal, setShowModal] = (0, import_element153.useState)(false); const { postType: postType2 } = (0, import_data77.useSelect)((select3) => { const { getPostType: getPostType2 } = select3(import_core_data58.store); return { postType: getPostType2(TEMPLATE_POST_TYPE) }; }, []); if (!postType2) { return null; } return /* @__PURE__ */ (0, import_jsx_runtime287.jsxs)(import_jsx_runtime287.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime287.jsx)( import_components158.Button, { variant: "primary", onClick: () => setShowModal(true), label: postType2.labels.add_new_item, __next40pxDefaultSize: true, children: postType2.labels.add_new_item } ), showModal && /* @__PURE__ */ (0, import_jsx_runtime287.jsx)(NewTemplateModal2, { onClose: () => setShowModal(false) }) ] }); } function useMissingTemplates2(setEntityForSuggestions, onClick) { const existingTemplates = useExistingTemplates2(); const defaultTemplateTypes = useDefaultTemplateTypes2(); const existingTemplateSlugs = (existingTemplates || []).map( ({ slug }) => slug ); const missingDefaultTemplates = (defaultTemplateTypes || []).filter( (template) => DEFAULT_TEMPLATE_SLUGS2.includes(template.slug) && !existingTemplateSlugs.includes(template.slug) ); const onClickMenuItem = (_entityForSuggestions) => { onClick?.(); setEntityForSuggestions(_entityForSuggestions); }; const enhancedMissingDefaultTemplateTypes = [...missingDefaultTemplates]; const { defaultTaxonomiesMenuItems, taxonomiesMenuItems } = useTaxonomiesMenuItems2(onClickMenuItem); const { defaultPostTypesMenuItems, postTypesMenuItems } = usePostTypeMenuItems2(onClickMenuItem); const authorMenuItem = useAuthorMenuItem2(onClickMenuItem); [ ...defaultTaxonomiesMenuItems, ...defaultPostTypesMenuItems, authorMenuItem ].forEach((menuItem) => { if (!menuItem) { return; } const matchIndex = enhancedMissingDefaultTemplateTypes.findIndex( (template) => template.slug === menuItem.slug ); if (matchIndex > -1) { enhancedMissingDefaultTemplateTypes[matchIndex] = menuItem; } else { enhancedMissingDefaultTemplateTypes.push(menuItem); } }); enhancedMissingDefaultTemplateTypes?.sort((template1, template2) => { return DEFAULT_TEMPLATE_SLUGS2.indexOf(template1.slug) - DEFAULT_TEMPLATE_SLUGS2.indexOf(template2.slug); }); const missingTemplates = [ ...enhancedMissingDefaultTemplateTypes, ...usePostTypeArchiveMenuItems2(), ...postTypesMenuItems, ...taxonomiesMenuItems ]; return missingTemplates; } var add_new_template_legacy_default = (0, import_element153.memo)(NewTemplate2); // packages/edit-site/build-module/components/page-templates/index-legacy.mjs var import_jsx_runtime288 = __toESM(require_jsx_runtime(), 1); var { usePostActions: usePostActions3, templateTitleField: templateTitleField2 } = unlock(import_editor36.privateApis); var { useHistory: useHistory24, useLocation: useLocation31 } = unlock(import_router37.privateApis); var { useEntityRecordsWithPermissions: useEntityRecordsWithPermissions3 } = unlock(import_core_data59.privateApis); function PageTemplates2() { const { path, query } = useLocation31(); const { activeView = "active", postId } = query; const [selection, setSelection] = (0, import_element154.useState)([postId]); const defaultView = DEFAULT_VIEW2; const activeViewOverrides = (0, import_element154.useMemo)( () => getActiveViewOverridesForTab(activeView), [activeView] ); const { view, updateView, isModified, resetToDefault } = useView({ kind: "postType", name: TEMPLATE_POST_TYPE, slug: "default", defaultView, activeViewOverrides, queryParams: { page: query.pageNumber, search: query.search }, onChangeQueryParams: (newQueryParams) => { history.navigate( (0, import_url25.addQueryArgs)(path, { ...query, pageNumber: newQueryParams.page, search: newQueryParams.search || void 0 }) ); } }); const { records, isResolving: isLoadingData } = useEntityRecordsWithPermissions3("postType", TEMPLATE_POST_TYPE, { per_page: -1 }); const history = useHistory24(); const onChangeSelection = (0, import_element154.useCallback)( (items) => { setSelection(items); if (view?.type === "list") { history.navigate( (0, import_url25.addQueryArgs)(path, { postId: items.length === 1 ? items[0] : void 0 }) ); } }, [history, path, view?.type] ); const authors = (0, import_element154.useMemo)(() => { if (!records) { return []; } const authorsSet = /* @__PURE__ */ new Set(); records.forEach((template) => { authorsSet.add(template.author_text); }); return Array.from(authorsSet).map((author) => ({ value: author, label: author })); }, [records]); const fields = (0, import_element154.useMemo)( () => [ previewField2, templateTitleField2, descriptionField, { ...authorField, elements: authors } ], [authors] ); const { data, paginationInfo } = (0, import_element154.useMemo)(() => { return filterSortAndPaginate(records, view, fields); }, [records, view, fields]); const postTypeActions = usePostActions3({ postType: TEMPLATE_POST_TYPE, context: "list" }); const editAction = useEditPostAction(); const actions = (0, import_element154.useMemo)( () => [editAction, ...postTypeActions], [postTypeActions, editAction] ); const onChangeView = (0, import_compose33.useEvent)((newView) => { updateView(newView); if (newView.type !== view.type) { history.invalidate(); } }); return /* @__PURE__ */ (0, import_jsx_runtime288.jsx)( page_default2, { className: "edit-site-page-templates", title: (0, import_i18n153.__)("Templates"), headingLevel: 2, actions: /* @__PURE__ */ (0, import_jsx_runtime288.jsx)(add_new_template_legacy_default, {}), children: /* @__PURE__ */ (0, import_jsx_runtime288.jsx)( dataviews_default, { paginationInfo, fields, actions, data, isLoading: isLoadingData, view, onChangeView, onChangeSelection, isItemClickable: () => true, onClickItem: ({ id }) => { history.navigate(`/wp_template/${id}?canvas=edit`); }, selection, defaultLayouts: defaultLayouts2, onReset: isModified ? () => { resetToDefault(); history.invalidate(); } : false }, activeView ) } ); } // packages/edit-site/build-module/components/site-editor-routes/templates.mjs var import_jsx_runtime289 = __toESM(require_jsx_runtime(), 1); async function isTemplateListView(query) { const { activeView = "active" } = query; const view = await loadView({ kind: "postType", name: "wp_template", slug: "default", defaultView: DEFAULT_VIEW2, activeViewOverrides: getActiveViewOverridesForTab(activeView) }); return view.type === "list"; } var templatesRoute = { name: "templates", path: "/template", areas: { sidebar({ siteData }) { const isBlockTheme = siteData.currentTheme?.is_block_theme; return isBlockTheme ? /* @__PURE__ */ (0, import_jsx_runtime289.jsx)(SidebarNavigationScreenTemplatesBrowse, { backPath: "/" }) : /* @__PURE__ */ (0, import_jsx_runtime289.jsx)(SidebarNavigationScreenUnsupported, {}); }, content({ siteData }) { const isBlockTheme = siteData.currentTheme?.is_block_theme; if (!isBlockTheme) { return void 0; } return window?.__experimentalTemplateActivate ? /* @__PURE__ */ (0, import_jsx_runtime289.jsx)(PageTemplates, {}) : /* @__PURE__ */ (0, import_jsx_runtime289.jsx)(PageTemplates2, {}); }, async preview({ query, siteData }) { const isBlockTheme = siteData.currentTheme?.is_block_theme; if (!isBlockTheme) { return void 0; } const isListView2 = await isTemplateListView(query); return isListView2 ? /* @__PURE__ */ (0, import_jsx_runtime289.jsx)(EditSiteEditor, {}) : void 0; }, mobile({ siteData }) { const isBlockTheme = siteData.currentTheme?.is_block_theme; if (!isBlockTheme) { return /* @__PURE__ */ (0, import_jsx_runtime289.jsx)(SidebarNavigationScreenUnsupported, {}); } const isTemplateActivateEnabled = typeof window !== "undefined" && window.__experimentalTemplateActivate; return isTemplateActivateEnabled ? /* @__PURE__ */ (0, import_jsx_runtime289.jsx)(PageTemplates, {}) : /* @__PURE__ */ (0, import_jsx_runtime289.jsx)(PageTemplates2, {}); } }, widths: { async content({ query }) { const isListView2 = await isTemplateListView(query); return isListView2 ? 380 : void 0; } } }; // packages/edit-site/build-module/components/site-editor-routes/template-item.mjs var import_jsx_runtime290 = __toESM(require_jsx_runtime(), 1); var areas = { sidebar({ siteData }) { const isBlockTheme = siteData.currentTheme?.is_block_theme; return isBlockTheme ? /* @__PURE__ */ (0, import_jsx_runtime290.jsx)(SidebarNavigationScreenTemplatesBrowse, { backPath: "/" }) : /* @__PURE__ */ (0, import_jsx_runtime290.jsx)(SidebarNavigationScreenUnsupported, {}); }, mobile({ siteData }) { const isBlockTheme = siteData.currentTheme?.is_block_theme; return isBlockTheme ? /* @__PURE__ */ (0, import_jsx_runtime290.jsx)(EditSiteEditor, {}) : /* @__PURE__ */ (0, import_jsx_runtime290.jsx)(SidebarNavigationScreenUnsupported, {}); }, preview({ siteData }) { const isBlockTheme = siteData.currentTheme?.is_block_theme; return isBlockTheme ? /* @__PURE__ */ (0, import_jsx_runtime290.jsx)(EditSiteEditor, {}) : /* @__PURE__ */ (0, import_jsx_runtime290.jsx)(SidebarNavigationScreenUnsupported, {}); } }; var templateItemRoute = { name: "template-item", path: "/wp_template/*postId", areas }; // packages/edit-site/build-module/components/site-editor-routes/pages.mjs var import_router41 = __toESM(require_router(), 1); var import_i18n157 = __toESM(require_i18n(), 1); // packages/edit-site/build-module/components/sidebar-dataviews/index.mjs var import_components160 = __toESM(require_components(), 1); var import_router39 = __toESM(require_router(), 1); var import_data78 = __toESM(require_data(), 1); var import_core_data60 = __toESM(require_core_data(), 1); var import_element155 = __toESM(require_element(), 1); // packages/edit-site/build-module/components/sidebar-dataviews/dataview-item.mjs var import_router38 = __toESM(require_router(), 1); var import_components159 = __toESM(require_components(), 1); var import_url26 = __toESM(require_url(), 1); var import_jsx_runtime291 = __toESM(require_jsx_runtime(), 1); var { useLocation: useLocation32 } = unlock(import_router38.privateApis); function DataViewItem({ title, slug, type, icon, isActive, suffix }) { const { path } = useLocation32(); const iconToUse = icon || VIEW_LAYOUTS.find((v2) => v2.type === type).icon; if (slug === "all") { slug = void 0; } return /* @__PURE__ */ (0, import_jsx_runtime291.jsxs)( import_components159.__experimentalHStack, { justify: "flex-start", className: clsx_default("edit-site-sidebar-dataviews-dataview-item", { "is-selected": isActive }), children: [ /* @__PURE__ */ (0, import_jsx_runtime291.jsx)( SidebarNavigationItem, { icon: iconToUse, to: (0, import_url26.addQueryArgs)(path, { activeView: slug }), "aria-current": isActive ? "true" : void 0, children: title } ), suffix ] } ); } // packages/edit-site/build-module/components/post-list/view-utils.mjs var import_i18n154 = __toESM(require_i18n(), 1); var defaultLayouts3 = { table: { layout: { styles: { author: { align: "start" } } } }, grid: {}, list: {} }; var DEFAULT_VIEW3 = { type: "list", filters: [], perPage: 20, sort: { field: "title", direction: "asc" }, showLevels: true, titleField: "title", mediaField: "featured_media", fields: ["author", "status"], ...defaultLayouts3.list }; function getDefaultViews(postType2) { return [ { title: postType2?.labels?.all_items || (0, import_i18n154.__)("All items"), slug: "all", icon: pages_default, view: DEFAULT_VIEW3 }, { title: (0, import_i18n154.__)("Published"), slug: "published", icon: published_default, view: { ...DEFAULT_VIEW3, filters: [ { field: "status", operator: OPERATOR_IS_ANY, value: "publish", isLocked: true } ] } }, { title: (0, import_i18n154.__)("Scheduled"), slug: "future", icon: scheduled_default, view: { ...DEFAULT_VIEW3, filters: [ { field: "status", operator: OPERATOR_IS_ANY, value: "future", isLocked: true } ] } }, { title: (0, import_i18n154.__)("Drafts"), slug: "drafts", icon: drafts_default, view: { ...DEFAULT_VIEW3, filters: [ { field: "status", operator: OPERATOR_IS_ANY, value: "draft", isLocked: true } ] } }, { title: (0, import_i18n154.__)("Pending"), slug: "pending", icon: pending_default, view: { ...DEFAULT_VIEW3, filters: [ { field: "status", operator: OPERATOR_IS_ANY, value: "pending", isLocked: true } ] } }, { title: (0, import_i18n154.__)("Private"), slug: "private", icon: not_allowed_default, view: { ...DEFAULT_VIEW3, filters: [ { field: "status", operator: OPERATOR_IS_ANY, value: "private", isLocked: true } ] } }, { title: (0, import_i18n154.__)("Trash"), slug: "trash", icon: trash_default, view: { ...DEFAULT_VIEW3, type: "table", layout: defaultLayouts3.table.layout, filters: [ { field: "status", operator: OPERATOR_IS_ANY, value: "trash", isLocked: true } ] } } ]; } var SLUG_TO_STATUS = { published: "publish", future: "future", drafts: "draft", pending: "pending", private: "private", trash: "trash" }; function getActiveViewOverridesForTab2(activeView) { const base = { ...defaultLayouts3.table }; const status = SLUG_TO_STATUS[activeView]; if (!status) { return base; } return { ...base, filters: [ { field: "status", operator: OPERATOR_IS_ANY, value: status, isLocked: true } ] }; } // packages/edit-site/build-module/components/sidebar-dataviews/index.mjs var import_jsx_runtime292 = __toESM(require_jsx_runtime(), 1); var { useLocation: useLocation33 } = unlock(import_router39.privateApis); function DataViewsSidebarContent({ postType: postType2 }) { const { query: { activeView = "all" } } = useLocation33(); const postTypeObject = (0, import_data78.useSelect)( (select3) => { const { getPostType: getPostType2 } = select3(import_core_data60.store); return getPostType2(postType2); }, [postType2] ); const defaultViews = (0, import_element155.useMemo)( () => getDefaultViews(postTypeObject), [postTypeObject] ); if (!postType2) { return null; } return /* @__PURE__ */ (0, import_jsx_runtime292.jsx)(import_jsx_runtime292.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime292.jsx)(import_components160.__experimentalItemGroup, { className: "edit-site-sidebar-dataviews", children: defaultViews.map((dataview) => { return /* @__PURE__ */ (0, import_jsx_runtime292.jsx)( DataViewItem, { slug: dataview.slug, title: dataview.title, icon: dataview.icon, type: dataview.view.type, isActive: dataview.slug === activeView }, dataview.slug ); }) }) }); } // packages/edit-site/build-module/components/post-list/index.mjs var import_components163 = __toESM(require_components(), 1); var import_core_data64 = __toESM(require_core_data(), 1); var import_element159 = __toESM(require_element(), 1); var import_router40 = __toESM(require_router(), 1); var import_data81 = __toESM(require_data(), 1); var import_editor40 = __toESM(require_editor(), 1); var import_compose34 = __toESM(require_compose(), 1); var import_url27 = __toESM(require_url(), 1); // packages/edit-site/build-module/components/add-new-post/index.mjs var import_components161 = __toESM(require_components(), 1); var import_i18n155 = __toESM(require_i18n(), 1); var import_data79 = __toESM(require_data(), 1); var import_element156 = __toESM(require_element(), 1); var import_core_data61 = __toESM(require_core_data(), 1); var import_notices10 = __toESM(require_notices(), 1); var import_html_entities18 = __toESM(require_html_entities(), 1); var import_blocks14 = __toESM(require_blocks(), 1); var import_jsx_runtime293 = __toESM(require_jsx_runtime(), 1); function AddNewPostModal({ postType: postType2, onSave, onClose }) { const labels = (0, import_data79.useSelect)( (select3) => select3(import_core_data61.store).getPostType(postType2)?.labels, [postType2] ); const [isCreatingPost, setIsCreatingPost] = (0, import_element156.useState)(false); const [title, setTitle] = (0, import_element156.useState)(""); const { saveEntityRecord } = (0, import_data79.useDispatch)(import_core_data61.store); const { createErrorNotice, createSuccessNotice } = (0, import_data79.useDispatch)(import_notices10.store); const { resolveSelect: resolveSelect2 } = (0, import_data79.useRegistry)(); async function createPost(event) { event.preventDefault(); if (isCreatingPost) { return; } setIsCreatingPost(true); try { const postTypeObject = await resolveSelect2(import_core_data61.store).getPostType(postType2); const newPage = await saveEntityRecord( "postType", postType2, { status: "draft", title, slug: title ?? void 0, content: !!postTypeObject.template && postTypeObject.template.length ? (0, import_blocks14.serialize)( (0, import_blocks14.synchronizeBlocksWithTemplate)( [], postTypeObject.template ) ) : void 0 }, { throwOnError: true } ); onSave(newPage); createSuccessNotice( (0, import_i18n155.sprintf)( // translators: %s: Title of the created post or template, e.g: "Hello world". (0, import_i18n155.__)('"%s" successfully created.'), (0, import_html_entities18.decodeEntities)(newPage.title?.rendered || title) || (0, import_i18n155.__)("(no title)") ), { type: "snackbar" } ); } catch (error) { const errorMessage = error.message && error.code !== "unknown_error" ? error.message : (0, import_i18n155.__)("An error occurred while creating the item."); createErrorNotice(errorMessage, { type: "snackbar" }); } finally { setIsCreatingPost(false); } } return /* @__PURE__ */ (0, import_jsx_runtime293.jsx)( import_components161.Modal, { title: ( // translators: %s: post type singular_name label e.g: "Page". (0, import_i18n155.sprintf)((0, import_i18n155.__)("Draft new: %s"), labels?.singular_name) ), onRequestClose: onClose, focusOnMount: "firstContentElement", size: "small", children: /* @__PURE__ */ (0, import_jsx_runtime293.jsx)("form", { onSubmit: createPost, children: /* @__PURE__ */ (0, import_jsx_runtime293.jsxs)(import_components161.__experimentalVStack, { spacing: 4, children: [ /* @__PURE__ */ (0, import_jsx_runtime293.jsx)( import_components161.TextControl, { __next40pxDefaultSize: true, label: (0, import_i18n155.__)("Title"), onChange: setTitle, placeholder: (0, import_i18n155.__)("No title"), value: title } ), /* @__PURE__ */ (0, import_jsx_runtime293.jsxs)(import_components161.__experimentalHStack, { spacing: 2, justify: "end", children: [ /* @__PURE__ */ (0, import_jsx_runtime293.jsx)( import_components161.Button, { __next40pxDefaultSize: true, variant: "tertiary", onClick: onClose, children: (0, import_i18n155.__)("Cancel") } ), /* @__PURE__ */ (0, import_jsx_runtime293.jsx)( import_components161.Button, { __next40pxDefaultSize: true, variant: "primary", type: "submit", isBusy: isCreatingPost, "aria-disabled": isCreatingPost, children: (0, import_i18n155.__)("Create draft") } ) ] }) ] }) }) } ); } // packages/edit-site/build-module/components/post-list/use-notes-count.mjs var import_element157 = __toESM(require_element(), 1); var import_core_data62 = __toESM(require_core_data(), 1); function useNotesCount(postIds) { const { records: notes, isResolving } = (0, import_core_data62.useEntityRecords)( "root", "comment", { post: postIds, type: "note", status: "all", per_page: -1, _fields: "id,post" }, { enabled: postIds?.length > 0 } ); const notesCount = (0, import_element157.useMemo)(() => { if (!notes || notes.length === 0) { return {}; } const counts = {}; notes.forEach((note) => { const postId = note.post; counts[postId] = (counts[postId] || 0) + 1; }); return counts; }, [notes]); return { notesCount, isResolving }; } // packages/edit-site/build-module/components/post-list/quick-edit-modal.mjs var import_i18n156 = __toESM(require_i18n(), 1); var import_data80 = __toESM(require_data(), 1); var import_core_data63 = __toESM(require_core_data(), 1); var import_components162 = __toESM(require_components(), 1); var import_element158 = __toESM(require_element(), 1); var import_editor39 = __toESM(require_editor(), 1); var import_jsx_runtime294 = __toESM(require_jsx_runtime(), 1); var { usePostFields: usePostFields2, PostCardPanel } = unlock(import_editor39.privateApis); var fieldsWithBulkEditSupport = ["status", "date", "author", "discussion"]; function QuickEditModal({ postType: postType2, postId, closeModal }) { const isBulk = postId.length > 1; const [localEdits, setLocalEdits] = (0, import_element158.useState)({}); const { record, hasFinishedResolution, canSwitchTemplate } = (0, import_data80.useSelect)( (select3) => { const { getEditedEntityRecord, hasFinishedResolution: hasFinished } = select3(import_core_data63.store); if (isBulk) { return { record: null, hasFinishedResolution: true }; } const args = ["postType", postType2, postId[0]]; const { getHomePage, getPostsPageId } = unlock( select3(import_core_data63.store) ); const singlePostId = String(postId[0]); const isPostsPage = singlePostId !== void 0 && getPostsPageId() === singlePostId; const isFrontPage = singlePostId !== void 0 && postType2 === "page" && getHomePage()?.postId === singlePostId; return { record: getEditedEntityRecord(...args), hasFinishedResolution: hasFinished( "getEditedEntityRecord", args ), canSwitchTemplate: !isPostsPage && !isFrontPage }; }, [postType2, postId, isBulk] ); const { editEntityRecord, saveEditedEntityRecord } = (0, import_data80.useDispatch)(import_core_data63.store); const _fields = usePostFields2({ postType: postType2 }); const fields = (0, import_element158.useMemo)( () => _fields?.map((field) => { if (field.id === "status") { return { ...field, elements: field.elements.filter( (element) => element.value !== "trash" ) }; } if (field.id === "template") { return { ...field, readOnly: !canSwitchTemplate }; } return field; }), [_fields, canSwitchTemplate] ); const form = (0, import_element158.useMemo)(() => { const allFields = [ { id: "featured_media", layout: { type: "regular", labelPosition: "none" } }, { id: "status", label: (0, import_i18n156.__)("Status"), children: [ { id: "status", layout: { type: "regular", labelPosition: "none" } }, "password" ] }, "author", "date", "slug", "parent", { id: "discussion", label: (0, import_i18n156.__)("Discussion"), children: [ { id: "comment_status", layout: { type: "regular", labelPosition: "none" } }, "ping_status" ] }, "template" ]; return { layout: { type: "panel" }, fields: isBulk ? allFields.filter( (field) => fieldsWithBulkEditSupport.includes( typeof field === "string" ? field : field.id ) ) : allFields }; }, [isBulk]); const onChange = (edits) => { const currentData = { ...record, ...localEdits }; if (edits.status && edits.status !== "future" && currentData?.status === "future" && new Date(currentData.date) > /* @__PURE__ */ new Date()) { edits.date = null; } if (edits.status && edits.status === "private" && currentData?.password) { edits.password = ""; } setLocalEdits((prev) => ({ ...prev, ...edits })); }; (0, import_element158.useEffect)(() => { setLocalEdits({}); }, [postId]); const onSave = async () => { for (const id of postId) { editEntityRecord("postType", postType2, id, localEdits); } if (isBulk) { await Promise.allSettled( postId.map( (id) => saveEditedEntityRecord("postType", postType2, id) ) ); } else { await saveEditedEntityRecord("postType", postType2, postId[0]); } closeModal?.(); }; return /* @__PURE__ */ (0, import_jsx_runtime294.jsxs)( import_components162.Modal, { overlayClassName: "dataviews-action-modal__quick-edit", __experimentalHideHeader: true, onRequestClose: closeModal, focusOnMount: "firstElement", children: [ /* @__PURE__ */ (0, import_jsx_runtime294.jsx)("div", { className: "dataviews-action-modal__quick-edit-header", children: /* @__PURE__ */ (0, import_jsx_runtime294.jsx)( PostCardPanel, { postType: postType2, postId, onClose: closeModal, hideActions: true } ) }), /* @__PURE__ */ (0, import_jsx_runtime294.jsx)("div", { className: "dataviews-action-modal__quick-edit-content", children: hasFinishedResolution && /* @__PURE__ */ (0, import_jsx_runtime294.jsx)( DataForm, { data: { ...record, ...localEdits }, fields, form, onChange } ) }), /* @__PURE__ */ (0, import_jsx_runtime294.jsxs)(import_components162.__experimentalHStack, { className: "dataviews-action-modal__quick-edit-footer", children: [ /* @__PURE__ */ (0, import_jsx_runtime294.jsx)( import_components162.Button, { __next40pxDefaultSize: true, variant: "secondary", onClick: closeModal, children: (0, import_i18n156.__)("Cancel") } ), /* @__PURE__ */ (0, import_jsx_runtime294.jsx)( import_components162.Button, { __next40pxDefaultSize: true, variant: "primary", onClick: onSave, children: (0, import_i18n156.__)("Done") } ) ] }) ] } ); } // packages/edit-site/build-module/components/post-list/index.mjs var import_jsx_runtime295 = __toESM(require_jsx_runtime(), 1); var { usePostActions: usePostActions4, usePostFields: usePostFields3 } = unlock(import_editor40.privateApis); var { useLocation: useLocation34, useHistory: useHistory25 } = unlock(import_router40.privateApis); var { useEntityRecordsWithPermissions: useEntityRecordsWithPermissions4 } = unlock(import_core_data64.privateApis); var EMPTY_ARRAY16 = []; var DEFAULT_STATUSES = "draft,future,pending,private,publish"; function getItemId(item) { return item.id.toString(); } function getItemLevel(item) { return item.level; } function PostList({ postType: postType2 }) { const { path, query } = useLocation34(); const { activeView = "all", postId, quickEdit = false } = query; const history = useHistory25(); const defaultView = DEFAULT_VIEW3; const activeViewOverrides = (0, import_element159.useMemo)( () => getActiveViewOverridesForTab2(activeView), [activeView] ); const { view, updateView, isModified, resetToDefault } = useView({ kind: "postType", name: postType2, slug: "default", defaultView, activeViewOverrides, queryParams: { page: query.pageNumber, search: query.search }, onChangeQueryParams: (newQueryParams) => { history.navigate( (0, import_url27.addQueryArgs)(path, { ...query, pageNumber: newQueryParams.page, search: newQueryParams.search || void 0 }) ); } }); const onChangeView = (0, import_compose34.useEvent)((newView) => { updateView(newView); if (newView.type !== view.type) { history.invalidate(); } }); const [selection, setSelection] = (0, import_element159.useState)(postId?.split(",") ?? []); const onChangeSelection = (0, import_element159.useCallback)( (items) => { setSelection(items); history.navigate( (0, import_url27.addQueryArgs)(path, { postId: items.join(",") }) ); }, [path, history] ); (0, import_element159.useEffect)(() => { const newSelection = postId?.split(",") ?? []; setSelection(newSelection); }, [postId]); const fields = usePostFields3({ postType: postType2 }); const queryArgs = (0, import_element159.useMemo)(() => { const filters = {}; view.filters?.forEach((filter) => { if (filter.field === "status" && filter.operator === OPERATOR_IS_ANY) { filters.status = filter.value; } if (filter.field === "author" && filter.operator === OPERATOR_IS_ANY) { filters.author = filter.value; } else if (filter.field === "author" && filter.operator === OPERATOR_IS_NONE) { filters.author_exclude = filter.value; } if (filter.field === "date") { if (!filter.value) { return; } if (filter.operator === OPERATOR_BEFORE) { filters.before = filter.value; } else if (filter.operator === OPERATOR_AFTER) { filters.after = filter.value; } } }); if (!filters.status || filters.status === "") { filters.status = DEFAULT_STATUSES; } return { per_page: view.perPage, page: view.page, _embed: "author,wp:featuredmedia", order: view.sort?.direction, orderby: view.sort?.field, orderby_hierarchy: !!view.showLevels, search: view.search, ...filters }; }, [view]); const { records, isResolving: isLoadingData, totalItems, totalPages, hasResolved } = useEntityRecordsWithPermissions4("postType", postType2, queryArgs); const postIds = (0, import_element159.useMemo)( () => records?.map((record) => record.id) ?? [], [records] ); const { notesCount, isLoading: isLoadingNotesCount } = useNotesCount(postIds); const data = (0, import_element159.useMemo)(() => { let processedRecords = records; if (view?.sort?.field === "author") { processedRecords = filterSortAndPaginate( records, { sort: { ...view.sort } }, fields ).data; } if (processedRecords) { return processedRecords.map((record) => ({ ...record, notesCount: notesCount[record.id] ?? 0 })); } return processedRecords; }, [records, fields, view?.sort, notesCount]); const ids = data?.map((record) => getItemId(record)) ?? []; const prevIds = (0, import_compose34.usePrevious)(ids) ?? []; const deletedIds = prevIds.filter((id) => !ids.includes(id)); const postIdWasDeleted = deletedIds.includes(postId); (0, import_element159.useEffect)(() => { if (postIdWasDeleted) { history.navigate( (0, import_url27.addQueryArgs)(path, { postId: void 0 }) ); } }, [history, postIdWasDeleted, path]); const paginationInfo = (0, import_element159.useMemo)( () => ({ totalItems, totalPages }), [totalItems, totalPages] ); const { labels, canCreateRecord } = (0, import_data81.useSelect)( (select3) => { const { getPostType: getPostType2, canUser } = select3(import_core_data64.store); return { labels: getPostType2(postType2)?.labels, canCreateRecord: canUser("create", { kind: "postType", name: postType2 }) }; }, [postType2] ); const postTypeActions = usePostActions4({ postType: postType2, context: "list" }); const editAction = useEditPostAction(); const quickEditAction = useQuickEditPostAction(); const actions = (0, import_element159.useMemo)(() => { if (view.type === LAYOUT_LIST) { const editActionPrimary = { ...editAction, isPrimary: true }; return [editActionPrimary, ...postTypeActions]; } return [editAction, quickEditAction, ...postTypeActions]; }, [view.type, editAction, quickEditAction, postTypeActions]); const [showAddPostModal, setShowAddPostModal] = (0, import_element159.useState)(false); const openModal = () => setShowAddPostModal(true); const closeModal = () => setShowAddPostModal(false); const handleNewPage = ({ type, id }) => { history.navigate(`/${type}/${id}?canvas=edit`); closeModal(); }; const closeQuickEditModal = () => { history.navigate( (0, import_url27.addQueryArgs)(path, { ...query, quickEdit: void 0 }) ); }; return /* @__PURE__ */ (0, import_jsx_runtime295.jsxs)( page_default2, { title: labels?.name, headingLevel: 2, actions: /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(import_jsx_runtime295.Fragment, { children: labels?.add_new_item && canCreateRecord && /* @__PURE__ */ (0, import_jsx_runtime295.jsxs)(import_jsx_runtime295.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime295.jsx)( import_components163.Button, { variant: "primary", onClick: openModal, __next40pxDefaultSize: true, children: labels.add_new_item } ), showAddPostModal && /* @__PURE__ */ (0, import_jsx_runtime295.jsx)( AddNewPostModal, { postType: postType2, onSave: handleNewPage, onClose: closeModal } ) ] }) }), children: [ /* @__PURE__ */ (0, import_jsx_runtime295.jsx)( dataviews_default, { paginationInfo, fields, actions, data: data || EMPTY_ARRAY16, isLoading: isLoadingData || isLoadingNotesCount || !hasResolved, view, onChangeView, selection, onChangeSelection, isItemClickable: (item) => item.status !== "trash", onClickItem: ({ id }) => { history.navigate(`/${postType2}/${id}?canvas=edit`); }, getItemId, getItemLevel, defaultLayouts: defaultLayouts3, onReset: isModified ? () => { resetToDefault(); history.invalidate(); } : false }, activeView ), quickEdit && !isLoadingData && selection.length > 0 && view.type !== LAYOUT_LIST && /* @__PURE__ */ (0, import_jsx_runtime295.jsx)( QuickEditModal, { postType: postType2, postId: selection, closeModal: closeQuickEditModal } ) ] } ); } // packages/edit-site/build-module/components/site-editor-routes/pages.mjs var import_jsx_runtime296 = __toESM(require_jsx_runtime(), 1); var { useLocation: useLocation35 } = unlock(import_router41.privateApis); async function isListView(query) { const { activeView = "all" } = query; const view = await loadView({ kind: "postType", name: "page", slug: "default", defaultView: DEFAULT_VIEW3, activeViewOverrides: getActiveViewOverridesForTab2(activeView) }); return view.type === "list"; } function MobilePagesView() { const { query = {} } = useLocation35(); const { canvas = "view" } = query; return canvas === "edit" ? /* @__PURE__ */ (0, import_jsx_runtime296.jsx)(EditSiteEditor, {}) : /* @__PURE__ */ (0, import_jsx_runtime296.jsx)(PostList, { postType: "page" }); } var pagesRoute = { name: "pages", path: "/page", areas: { sidebar({ siteData }) { const isBlockTheme = siteData.currentTheme?.is_block_theme; return isBlockTheme ? /* @__PURE__ */ (0, import_jsx_runtime296.jsx)( SidebarNavigationScreen, { title: (0, import_i18n157.__)("Pages"), backPath: "/", content: /* @__PURE__ */ (0, import_jsx_runtime296.jsx)(DataViewsSidebarContent, { postType: "page" }) } ) : /* @__PURE__ */ (0, import_jsx_runtime296.jsx)(SidebarNavigationScreenUnsupported, {}); }, content({ siteData }) { const isBlockTheme = siteData.currentTheme?.is_block_theme; return isBlockTheme ? /* @__PURE__ */ (0, import_jsx_runtime296.jsx)(PostList, { postType: "page" }) : void 0; }, async preview({ query, siteData }) { const isBlockTheme = siteData.currentTheme?.is_block_theme; if (!isBlockTheme) { return void 0; } const isList = await isListView(query); return isList ? /* @__PURE__ */ (0, import_jsx_runtime296.jsx)(EditSiteEditor, {}) : void 0; }, mobile({ siteData }) { const isBlockTheme = siteData.currentTheme?.is_block_theme; return isBlockTheme ? /* @__PURE__ */ (0, import_jsx_runtime296.jsx)(MobilePagesView, {}) : /* @__PURE__ */ (0, import_jsx_runtime296.jsx)(SidebarNavigationScreenUnsupported, {}); } }, widths: { async content({ query }) { const isList = await isListView(query); return isList ? 380 : void 0; } } }; // packages/edit-site/build-module/components/site-editor-routes/page-item.mjs var import_i18n158 = __toESM(require_i18n(), 1); var import_jsx_runtime297 = __toESM(require_jsx_runtime(), 1); var pageItemRoute = { name: "page-item", path: "/page/:postId", areas: { sidebar({ siteData }) { const isBlockTheme = siteData.currentTheme?.is_block_theme; return isBlockTheme ? /* @__PURE__ */ (0, import_jsx_runtime297.jsx)( SidebarNavigationScreen, { title: (0, import_i18n158.__)("Pages"), backPath: "/", content: /* @__PURE__ */ (0, import_jsx_runtime297.jsx)(DataViewsSidebarContent, { postType: "page" }) } ) : /* @__PURE__ */ (0, import_jsx_runtime297.jsx)(SidebarNavigationScreenUnsupported, {}); }, mobile({ siteData }) { const isBlockTheme = siteData.currentTheme?.is_block_theme; return isBlockTheme ? /* @__PURE__ */ (0, import_jsx_runtime297.jsx)(EditSiteEditor, {}) : /* @__PURE__ */ (0, import_jsx_runtime297.jsx)(SidebarNavigationScreenUnsupported, {}); }, preview({ siteData }) { const isBlockTheme = siteData.currentTheme?.is_block_theme; return isBlockTheme ? /* @__PURE__ */ (0, import_jsx_runtime297.jsx)(EditSiteEditor, {}) : /* @__PURE__ */ (0, import_jsx_runtime297.jsx)(SidebarNavigationScreenUnsupported, {}); } } }; // packages/edit-site/build-module/components/site-editor-routes/attachment-item.mjs var import_i18n159 = __toESM(require_i18n(), 1); var import_jsx_runtime298 = __toESM(require_jsx_runtime(), 1); var attachmentItemRoute = { name: "attachment-item", path: "/attachment/:postId", areas: { sidebar: /* @__PURE__ */ (0, import_jsx_runtime298.jsx)( SidebarNavigationScreen, { title: (0, import_i18n159.__)("Media"), backPath: "/", content: null } ), mobile: /* @__PURE__ */ (0, import_jsx_runtime298.jsx)(EditSiteEditor, {}), preview: /* @__PURE__ */ (0, import_jsx_runtime298.jsx)(EditSiteEditor, {}) } }; // packages/edit-site/build-module/components/site-editor-routes/stylebook.mjs var import_i18n160 = __toESM(require_i18n(), 1); var import_editor44 = __toESM(require_editor(), 1); var import_jsx_runtime299 = __toESM(require_jsx_runtime(), 1); var { StyleBookPreview: StyleBookPreview2 } = unlock(import_editor44.privateApis); var stylebookRoute = { name: "stylebook", path: "/stylebook", areas: { sidebar({ siteData }) { return isClassicThemeWithStyleBookSupport(siteData) ? /* @__PURE__ */ (0, import_jsx_runtime299.jsx)( SidebarNavigationScreen, { title: (0, import_i18n160.__)("Styles"), backPath: "/", description: (0, import_i18n160.__)( `Preview your website's visual identity: colors, typography, and blocks.` ) } ) : /* @__PURE__ */ (0, import_jsx_runtime299.jsx)(SidebarNavigationScreenUnsupported, {}); }, preview({ siteData }) { return isClassicThemeWithStyleBookSupport(siteData) ? /* @__PURE__ */ (0, import_jsx_runtime299.jsx)( StyleBookPreview2, { isStatic: true, settings: siteData.editorSettings } ) : void 0; }, mobile({ siteData }) { return isClassicThemeWithStyleBookSupport(siteData) ? /* @__PURE__ */ (0, import_jsx_runtime299.jsx)( StyleBookPreview2, { isStatic: true, settings: siteData.editorSettings } ) : void 0; } } }; // packages/edit-site/build-module/components/site-editor-routes/notfound.mjs var import_i18n161 = __toESM(require_i18n(), 1); var import_components164 = __toESM(require_components(), 1); var import_jsx_runtime300 = __toESM(require_jsx_runtime(), 1); function NotFoundError() { return /* @__PURE__ */ (0, import_jsx_runtime300.jsx)(import_components164.Notice, { status: "error", isDismissible: false, children: (0, import_i18n161.__)( "The requested page could not be found. Please check the URL." ) }); } var notFoundRoute = { name: "notfound", path: "*", areas: { sidebar: /* @__PURE__ */ (0, import_jsx_runtime300.jsx)(SidebarNavigationScreenMain, {}), mobile: /* @__PURE__ */ (0, import_jsx_runtime300.jsx)( SidebarNavigationScreenMain, { customDescription: /* @__PURE__ */ (0, import_jsx_runtime300.jsx)(NotFoundError, {}) } ), content: /* @__PURE__ */ (0, import_jsx_runtime300.jsx)(import_components164.__experimentalSpacer, { padding: 2, children: /* @__PURE__ */ (0, import_jsx_runtime300.jsx)(NotFoundError, {}) }) } }; // packages/edit-site/build-module/components/site-editor-routes/index.mjs var routes2 = [ ...window?.__experimentalMediaEditor ? [attachmentItemRoute] : [], pageItemRoute, pagesRoute, templateItemRoute, templatesRoute, templatePartItemRoute, patternItemRoute, patternsRoute, navigationItemRoute, navigationRoute, stylesRoute, homeRoute, stylebookRoute, notFoundRoute ]; function useRegisterSiteEditorRoutes() { const registry = (0, import_data82.useRegistry)(); const { registerRoute: registerRoute2 } = unlock((0, import_data82.useDispatch)(store)); (0, import_element160.useEffect)(() => { registry.batch(() => { routes2.forEach(registerRoute2); }); }, [registry, registerRoute2]); } // packages/edit-site/build-module/components/app/index.mjs var import_jsx_runtime301 = __toESM(require_jsx_runtime(), 1); var { RouterProvider } = unlock(import_router42.privateApis); function AppLayout() { useCommonCommands(); useSetCommandContext(); return /* @__PURE__ */ (0, import_jsx_runtime301.jsx)(LayoutWithGlobalStylesProvider, {}); } function App() { useRegisterSiteEditorRoutes(); const { routes: routes3, currentTheme, editorSettings } = (0, import_data83.useSelect)((select3) => { return { routes: unlock(select3(store)).getRoutes(), currentTheme: select3(import_core_data65.store).getCurrentTheme(), // This is a temp solution until the has_theme_json value is available for the current theme. editorSettings: select3(store).getSettings() }; }, []); const beforeNavigate = (0, import_element161.useCallback)(({ path, query }) => { if (!isPreviewingTheme()) { return { path, query }; } return { path, query: { ...query, wp_theme_preview: "wp_theme_preview" in query ? query.wp_theme_preview : currentlyPreviewingTheme() } }; }, []); const matchResolverArgsValue = (0, import_element161.useMemo)( () => ({ siteData: { currentTheme, editorSettings } }), [currentTheme, editorSettings] ); return /* @__PURE__ */ (0, import_jsx_runtime301.jsx)( RouterProvider, { routes: routes3, pathArg: "p", beforeNavigate, matchResolverArgs: matchResolverArgsValue, children: /* @__PURE__ */ (0, import_jsx_runtime301.jsx)(AppLayout, {}) } ); } // packages/edit-site/build-module/deprecated.mjs var import_editor45 = __toESM(require_editor(), 1); var import_url28 = __toESM(require_url(), 1); var import_deprecated5 = __toESM(require_deprecated(), 1); var import_jsx_runtime302 = __toESM(require_jsx_runtime(), 1); var isSiteEditor = (0, import_url28.getPath)(window.location.href)?.includes( "site-editor.php" ); var deprecateSlot = (name2) => { (0, import_deprecated5.default)(`wp.editPost.${name2}`, { since: "6.6", alternative: `wp.editor.${name2}` }); }; function PluginMoreMenuItem(props) { if (!isSiteEditor) { return null; } deprecateSlot("PluginMoreMenuItem"); return /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(import_editor45.PluginMoreMenuItem, { ...props }); } function PluginSidebar(props) { if (!isSiteEditor) { return null; } deprecateSlot("PluginSidebar"); return /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(import_editor45.PluginSidebar, { ...props }); } function PluginSidebarMoreMenuItem(props) { if (!isSiteEditor) { return null; } deprecateSlot("PluginSidebarMoreMenuItem"); return /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(import_editor45.PluginSidebarMoreMenuItem, { ...props }); } // packages/edit-site/build-module/index.mjs var import_jsx_runtime303 = __toESM(require_jsx_runtime(), 1); var { registerCoreBlockBindingsSources } = unlock(import_editor46.privateApis); function initializeEditor(id, settings2) { const target = document.getElementById(id); const root = (0, import_element162.createRoot)(target); (0, import_data84.dispatch)(import_blocks15.store).reapplyBlockTypeFilters(); const coreBlocks = (0, import_block_library3.__experimentalGetCoreBlocks)().filter( ({ name: name2 }) => name2 !== "core/freeform" ); (0, import_block_library3.registerCoreBlocks)(coreBlocks); registerCoreBlockBindingsSources(); (0, import_data84.dispatch)(import_blocks15.store).setFreeformFallbackBlockName("core/html"); (0, import_widgets.registerLegacyWidgetBlock)({ inserter: false }); (0, import_widgets.registerWidgetGroupBlock)({ inserter: false }); if (false) { (0, import_block_library3.__experimentalRegisterExperimentalCoreBlocks)({ enableFSEBlocks: true }); } (0, import_data84.dispatch)(import_preferences13.store).setDefaults("core/edit-site", { welcomeGuide: true, welcomeGuideStyles: true, welcomeGuidePage: true, welcomeGuideTemplate: true }); (0, import_data84.dispatch)(import_preferences13.store).setDefaults("core", { allowRightClickOverrides: true, distractionFree: false, editorMode: "visual", editorTool: "edit", fixedToolbar: false, focusMode: false, inactivePanels: [], keepCaretInsideBlock: false, openPanels: ["post-status"], showBlockBreadcrumbs: true, showListViewByDefault: false, enableChoosePatternModal: true, showCollaborationCursor: false, showCollaborationNotifications: true }); if (window.__clientSideMediaProcessing) { (0, import_data84.dispatch)(import_preferences13.store).setDefaults("core/media", { requireApproval: true, optimizeOnUpload: true }); } (0, import_data84.dispatch)(store).updateSettings(settings2); window.addEventListener("dragover", (e2) => e2.preventDefault(), false); window.addEventListener("drop", (e2) => e2.preventDefault(), false); root.render( /* @__PURE__ */ (0, import_jsx_runtime303.jsx)(import_element162.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime303.jsx)(App, {}) }) ); return root; } function reinitializeEditor() { (0, import_deprecated6.default)("wp.editSite.reinitializeEditor", { since: "6.2", version: "6.3" }); } return __toCommonJS(index_exports); })(); /*! Bundled license information: use-sync-external-store/cjs/use-sync-external-store-shim.development.js: (** * @license React * use-sync-external-store-shim.development.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. *) is-plain-object/dist/is-plain-object.mjs: (*! * is-plain-object <https://github.com/jonschlinkert/is-plain-object> * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. *) */ blob.min.js 0000644 00000002201 15206720414 0006576 0 ustar 00 "use strict";var wp;(wp||={}).blob=(()=>{var i=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var w=Object.prototype.hasOwnProperty;var L=(e,n)=>{for(var t in n)i(e,t,{get:n[t],enumerable:!0})},R=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of u(n))!w.call(e,o)&&o!==t&&i(e,o,{get:()=>n[o],enumerable:!(r=b(n,o))||r.enumerable});return e};var U=e=>R(i({},"__esModule",{value:!0}),e);var p={};L(p,{createBlobURL:()=>a,downloadBlob:()=>B,getBlobByURL:()=>l,getBlobTypeByURL:()=>f,isBlobURL:()=>y,revokeBlobURL:()=>s});var d={};function a(e){let n=window.URL.createObjectURL(e);return d[n]=e,n}function l(e){return d[e]}function f(e){return l(e)?.type.split("/")[0]}function s(e){d[e]&&window.URL.revokeObjectURL(e),delete d[e]}function y(e){return!e||!e.indexOf?!1:e.indexOf("blob:")===0}function B(e,n,t=""){if(!e||!n)return;let r=new window.Blob([n],{type:t}),o=window.URL.createObjectURL(r),c=document.createElement("a");c.href=o,c.download=e,c.style.display="none",document.body.appendChild(c),c.click(),document.body.removeChild(c),window.URL.revokeObjectURL(o)}return U(p);})(); dom-ready.min.js 0000644 00000001417 15206720414 0007551 0 ustar 00 "use strict";var wp;(wp||={}).domReady=(()=>{var o=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var i=Object.prototype.hasOwnProperty;var f=(e,t)=>{for(var n in t)o(e,n,{get:t[n],enumerable:!0})},m=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let d of a(t))!i.call(e,d)&&d!==n&&o(e,d,{get:()=>t[d],enumerable:!(r=u(t,d))||r.enumerable});return e};var c=e=>m(o({},"__esModule",{value:!0}),e);var p={};f(p,{default:()=>y});function y(e){if(!(typeof document>"u")){if(document.readyState==="complete"||document.readyState==="interactive")return void e();document.addEventListener("DOMContentLoaded",e)}}return c(p);})(); if (typeof wp.domReady === 'object' && wp.domReady.default) { wp.domReady = wp.domReady.default; } commands.js 0000644 00000457322 15206720414 0006721 0 ustar 00 var wp; (wp ||= {}).commands = (() => { 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 __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; 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 )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // vendor-external:react var require_react = __commonJS({ "vendor-external:react"(exports, module) { module.exports = window.React; } }); // vendor-external:react/jsx-runtime var require_jsx_runtime = __commonJS({ "vendor-external:react/jsx-runtime"(exports, module) { module.exports = window.ReactJSXRuntime; } }); // vendor-external:react-dom var require_react_dom = __commonJS({ "vendor-external:react-dom"(exports, module) { module.exports = window.ReactDOM; } }); // package-external:@wordpress/data var require_data = __commonJS({ "package-external:@wordpress/data"(exports, module) { module.exports = window.wp.data; } }); // 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; } }); // package-external:@wordpress/components var require_components = __commonJS({ "package-external:@wordpress/components"(exports, module) { module.exports = window.wp.components; } }); // package-external:@wordpress/keyboard-shortcuts var require_keyboard_shortcuts = __commonJS({ "package-external:@wordpress/keyboard-shortcuts"(exports, module) { module.exports = window.wp.keyboardShortcuts; } }); // package-external:@wordpress/primitives var require_primitives = __commonJS({ "package-external:@wordpress/primitives"(exports, module) { module.exports = window.wp.primitives; } }); // package-external:@wordpress/private-apis var require_private_apis = __commonJS({ "package-external:@wordpress/private-apis"(exports, module) { module.exports = window.wp.privateApis; } }); // packages/commands/build-module/index.mjs var index_exports = {}; __export(index_exports, { CommandMenu: () => CommandMenu, privateApis: () => privateApis, store: () => store, useCommand: () => useCommand, useCommandLoader: () => useCommandLoader, useCommands: () => useCommands }); // node_modules/cmdk/dist/chunk-NZJY6EH4.mjs var U = 1; var Y = 0.9; var H = 0.8; var J = 0.17; var p = 0.1; var u = 0.999; var $ = 0.9999; var k = 0.99; var m = /[\\\/_+.#"@\[\(\{&]/; var B = /[\\\/_+.#"@\[\(\{&]/g; var K = /[\s-]/; var X = /[\s-]/g; function G(_, C, h, P2, A, f, O) { if (f === C.length) return A === _.length ? U : k; var T2 = `${A},${f}`; if (O[T2] !== void 0) return O[T2]; for (var L2 = P2.charAt(f), c = h.indexOf(L2, A), S = 0, E, N2, R, M; c >= 0; ) E = G(_, C, h, P2, c + 1, f + 1, O), E > S && (c === A ? E *= U : m.test(_.charAt(c - 1)) ? (E *= H, R = _.slice(A, c - 1).match(B), R && A > 0 && (E *= Math.pow(u, R.length))) : K.test(_.charAt(c - 1)) ? (E *= Y, M = _.slice(A, c - 1).match(X), M && A > 0 && (E *= Math.pow(u, M.length))) : (E *= J, A > 0 && (E *= Math.pow(u, c - A))), _.charAt(c) !== C.charAt(f) && (E *= $)), (E < p && h.charAt(c - 1) === P2.charAt(f + 1) || P2.charAt(f + 1) === P2.charAt(f) && h.charAt(c - 1) !== P2.charAt(f)) && (N2 = G(_, C, h, P2, c + 1, f + 2, O), N2 * p > E && (E = N2 * p)), E > S && (S = E), c = h.indexOf(L2, c + 1); return O[T2] = S, S; } function D(_) { return _.toLowerCase().replace(X, " "); } function W(_, C, h) { return _ = h && h.length > 0 ? `${_ + " " + h.join(" ")}` : _, G(_, C, D(_), D(C), 0, 0, {}); } // node_modules/@radix-ui/react-dialog/dist/index.mjs var React37 = __toESM(require_react(), 1); // node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/primitive/dist/index.mjs var canUseDOM = !!(typeof window !== "undefined" && window.document && window.document.createElement); function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) { return function handleEvent(event) { originalEventHandler?.(event); if (checkForDefaultPrevented === false || !event.defaultPrevented) { return ourEventHandler?.(event); } }; } // node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-compose-refs/dist/index.mjs var React = __toESM(require_react(), 1); function setRef(ref, value) { if (typeof ref === "function") { return ref(value); } else if (ref !== null && ref !== void 0) { ref.current = value; } } function composeRefs(...refs) { return (node) => { let hasCleanup = false; const cleanups = refs.map((ref) => { const cleanup = setRef(ref, node); if (!hasCleanup && typeof cleanup == "function") { hasCleanup = true; } return cleanup; }); if (hasCleanup) { return () => { for (let i = 0; i < cleanups.length; i++) { const cleanup = cleanups[i]; if (typeof cleanup == "function") { cleanup(); } else { setRef(refs[i], null); } } }; } }; } function useComposedRefs(...refs) { return React.useCallback(composeRefs(...refs), refs); } // node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-context/dist/index.mjs var React2 = __toESM(require_react(), 1); var import_jsx_runtime = __toESM(require_jsx_runtime(), 1); function createContext2(rootComponentName, defaultContext) { const Context = React2.createContext(defaultContext); const Provider = (props) => { const { children, ...context2 } = props; const value = React2.useMemo(() => context2, Object.values(context2)); return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Context.Provider, { value, children }); }; Provider.displayName = rootComponentName + "Provider"; function useContext22(consumerName) { const context2 = React2.useContext(Context); if (context2) return context2; if (defaultContext !== void 0) return defaultContext; throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``); } return [Provider, useContext22]; } function createContextScope(scopeName, createContextScopeDeps = []) { let defaultContexts = []; function createContext32(rootComponentName, defaultContext) { const BaseContext = React2.createContext(defaultContext); const index = defaultContexts.length; defaultContexts = [...defaultContexts, defaultContext]; const Provider = (props) => { const { scope, children, ...context2 } = props; const Context = scope?.[scopeName]?.[index] || BaseContext; const value = React2.useMemo(() => context2, Object.values(context2)); return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Context.Provider, { value, children }); }; Provider.displayName = rootComponentName + "Provider"; function useContext22(consumerName, scope) { const Context = scope?.[scopeName]?.[index] || BaseContext; const context2 = React2.useContext(Context); if (context2) return context2; if (defaultContext !== void 0) return defaultContext; throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``); } return [Provider, useContext22]; } const createScope = () => { const scopeContexts = defaultContexts.map((defaultContext) => { return React2.createContext(defaultContext); }); return function useScope(scope) { const contexts = scope?.[scopeName] || scopeContexts; return React2.useMemo( () => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }), [scope, contexts] ); }; }; createScope.scopeName = scopeName; return [createContext32, composeContextScopes(createScope, ...createContextScopeDeps)]; } function composeContextScopes(...scopes) { const baseScope = scopes[0]; if (scopes.length === 1) return baseScope; const createScope = () => { const scopeHooks = scopes.map((createScope2) => ({ useScope: createScope2(), scopeName: createScope2.scopeName })); return function useComposedScopes(overrideScopes) { const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => { const scopeProps = useScope(overrideScopes); const currentScope = scopeProps[`__scope${scopeName}`]; return { ...nextScopes2, ...currentScope }; }, {}); return React2.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]); }; }; createScope.scopeName = baseScope.scopeName; return createScope; } // node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-id/dist/index.mjs var React4 = __toESM(require_react(), 1); // node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs var React3 = __toESM(require_react(), 1); var useLayoutEffect2 = globalThis?.document ? React3.useLayoutEffect : () => { }; // node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-id/dist/index.mjs var useReactId = React4[" useId ".trim().toString()] || (() => void 0); var count = 0; function useId(deterministicId) { const [id, setId] = React4.useState(useReactId()); useLayoutEffect2(() => { if (!deterministicId) setId((reactId) => reactId ?? String(count++)); }, [deterministicId]); return deterministicId || (id ? `radix-${id}` : ""); } // node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs var React5 = __toESM(require_react(), 1); var React22 = __toESM(require_react(), 1); var useInsertionEffect = React5[" useInsertionEffect ".trim().toString()] || useLayoutEffect2; function useControllableState({ prop, defaultProp, onChange = () => { }, caller }) { const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({ defaultProp, onChange }); const isControlled = prop !== void 0; const value = isControlled ? prop : uncontrolledProp; if (true) { const isControlledRef = React5.useRef(prop !== void 0); React5.useEffect(() => { const wasControlled = isControlledRef.current; if (wasControlled !== isControlled) { const from = wasControlled ? "controlled" : "uncontrolled"; const to = isControlled ? "controlled" : "uncontrolled"; console.warn( `${caller} is changing from ${from} to ${to}. 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.` ); } isControlledRef.current = isControlled; }, [isControlled, caller]); } const setValue = React5.useCallback( (nextValue) => { if (isControlled) { const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue; if (value2 !== prop) { onChangeRef.current?.(value2); } } else { setUncontrolledProp(nextValue); } }, [isControlled, prop, setUncontrolledProp, onChangeRef] ); return [value, setValue]; } function useUncontrolledState({ defaultProp, onChange }) { const [value, setValue] = React5.useState(defaultProp); const prevValueRef = React5.useRef(value); const onChangeRef = React5.useRef(onChange); useInsertionEffect(() => { onChangeRef.current = onChange; }, [onChange]); React5.useEffect(() => { if (prevValueRef.current !== value) { onChangeRef.current?.(value); prevValueRef.current = value; } }, [value, prevValueRef]); return [value, setValue, onChangeRef]; } function isFunction(value) { return typeof value === "function"; } // node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs var React11 = __toESM(require_react(), 1); // node_modules/@radix-ui/react-dismissable-layer/node_modules/@radix-ui/primitive/dist/index.mjs var canUseDOM2 = !!(typeof window !== "undefined" && window.document && window.document.createElement); function composeEventHandlers2(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) { return function handleEvent(event) { originalEventHandler?.(event); if (checkForDefaultPrevented === false || !event.defaultPrevented) { return ourEventHandler?.(event); } }; } // node_modules/@radix-ui/react-dismissable-layer/node_modules/@radix-ui/react-primitive/dist/index.mjs var React8 = __toESM(require_react(), 1); var ReactDOM = __toESM(require_react_dom(), 1); // node_modules/@radix-ui/react-dismissable-layer/node_modules/@radix-ui/react-slot/dist/index.mjs var React7 = __toESM(require_react(), 1); // node_modules/@radix-ui/react-dismissable-layer/node_modules/@radix-ui/react-compose-refs/dist/index.mjs var React6 = __toESM(require_react(), 1); function setRef2(ref, value) { if (typeof ref === "function") { return ref(value); } else if (ref !== null && ref !== void 0) { ref.current = value; } } function composeRefs2(...refs) { return (node) => { let hasCleanup = false; const cleanups = refs.map((ref) => { const cleanup = setRef2(ref, node); if (!hasCleanup && typeof cleanup == "function") { hasCleanup = true; } return cleanup; }); if (hasCleanup) { return () => { for (let i = 0; i < cleanups.length; i++) { const cleanup = cleanups[i]; if (typeof cleanup == "function") { cleanup(); } else { setRef2(refs[i], null); } } }; } }; } function useComposedRefs2(...refs) { return React6.useCallback(composeRefs2(...refs), refs); } // node_modules/@radix-ui/react-dismissable-layer/node_modules/@radix-ui/react-slot/dist/index.mjs var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1); // @__NO_SIDE_EFFECTS__ function createSlot(ownerName) { const SlotClone = /* @__PURE__ */ createSlotClone(ownerName); const Slot2 = React7.forwardRef((props, forwardedRef) => { const { children, ...slotProps } = props; const childrenArray = React7.Children.toArray(children); const slottable = childrenArray.find(isSlottable); if (slottable) { const newElement = slottable.props.children; const newChildren = childrenArray.map((child) => { if (child === slottable) { if (React7.Children.count(newElement) > 1) return React7.Children.only(null); return React7.isValidElement(newElement) ? newElement.props.children : null; } else { return child; } }); return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children: React7.isValidElement(newElement) ? React7.cloneElement(newElement, void 0, newChildren) : null }); } return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children }); }); Slot2.displayName = `${ownerName}.Slot`; return Slot2; } // @__NO_SIDE_EFFECTS__ function createSlotClone(ownerName) { const SlotClone = React7.forwardRef((props, forwardedRef) => { const { children, ...slotProps } = props; if (React7.isValidElement(children)) { const childrenRef = getElementRef(children); const props2 = mergeProps(slotProps, children.props); if (children.type !== React7.Fragment) { props2.ref = forwardedRef ? composeRefs2(forwardedRef, childrenRef) : childrenRef; } return React7.cloneElement(children, props2); } return React7.Children.count(children) > 1 ? React7.Children.only(null) : null; }); SlotClone.displayName = `${ownerName}.SlotClone`; return SlotClone; } var SLOTTABLE_IDENTIFIER = /* @__PURE__ */ Symbol("radix.slottable"); function isSlottable(child) { return React7.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER; } function mergeProps(slotProps, childProps) { const overrideProps = { ...childProps }; for (const propName in childProps) { const slotPropValue = slotProps[propName]; const childPropValue = childProps[propName]; const isHandler = /^on[A-Z]/.test(propName); if (isHandler) { if (slotPropValue && childPropValue) { overrideProps[propName] = (...args) => { const result = childPropValue(...args); slotPropValue(...args); return result; }; } else if (slotPropValue) { overrideProps[propName] = slotPropValue; } } else if (propName === "style") { overrideProps[propName] = { ...slotPropValue, ...childPropValue }; } else if (propName === "className") { overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" "); } } return { ...slotProps, ...overrideProps }; } function getElementRef(element) { let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get; let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning; if (mayWarn) { return element.ref; } getter = Object.getOwnPropertyDescriptor(element, "ref")?.get; mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning; if (mayWarn) { return element.props.ref; } return element.props.ref || element.ref; } // node_modules/@radix-ui/react-dismissable-layer/node_modules/@radix-ui/react-primitive/dist/index.mjs var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1); var NODES = [ "a", "button", "div", "form", "h2", "h3", "img", "input", "label", "li", "nav", "ol", "p", "select", "span", "svg", "ul" ]; var Primitive = NODES.reduce((primitive, node) => { const Slot2 = createSlot(`Primitive.${node}`); const Node2 = React8.forwardRef((props, forwardedRef) => { const { asChild, ...primitiveProps } = props; const Comp = asChild ? Slot2 : node; if (typeof window !== "undefined") { window[/* @__PURE__ */ Symbol.for("radix-ui")] = true; } return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Comp, { ...primitiveProps, ref: forwardedRef }); }); Node2.displayName = `Primitive.${node}`; return { ...primitive, [node]: Node2 }; }, {}); function dispatchDiscreteCustomEvent(target, event) { if (target) ReactDOM.flushSync(() => target.dispatchEvent(event)); } // node_modules/@radix-ui/react-dismissable-layer/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs var React9 = __toESM(require_react(), 1); function useCallbackRef(callback) { const callbackRef = React9.useRef(callback); React9.useEffect(() => { callbackRef.current = callback; }); return React9.useMemo(() => (...args) => callbackRef.current?.(...args), []); } // node_modules/@radix-ui/react-dismissable-layer/node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs var React10 = __toESM(require_react(), 1); function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.document) { const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp); React10.useEffect(() => { const handleKeyDown = (event) => { if (event.key === "Escape") { onEscapeKeyDown(event); } }; ownerDocument.addEventListener("keydown", handleKeyDown, { capture: true }); return () => ownerDocument.removeEventListener("keydown", handleKeyDown, { capture: true }); }, [onEscapeKeyDown, ownerDocument]); } // node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1); var DISMISSABLE_LAYER_NAME = "DismissableLayer"; var CONTEXT_UPDATE = "dismissableLayer.update"; var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside"; var FOCUS_OUTSIDE = "dismissableLayer.focusOutside"; var originalBodyPointerEvents; var DismissableLayerContext = React11.createContext({ layers: /* @__PURE__ */ new Set(), layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(), branches: /* @__PURE__ */ new Set() }); var DismissableLayer = React11.forwardRef( (props, forwardedRef) => { const { disableOutsidePointerEvents = false, onEscapeKeyDown, onPointerDownOutside, onFocusOutside, onInteractOutside, onDismiss, ...layerProps } = props; const context2 = React11.useContext(DismissableLayerContext); const [node, setNode] = React11.useState(null); const ownerDocument = node?.ownerDocument ?? globalThis?.document; const [, force] = React11.useState({}); const composedRefs = useComposedRefs2(forwardedRef, (node2) => setNode(node2)); const layers = Array.from(context2.layers); const [highestLayerWithOutsidePointerEventsDisabled] = [...context2.layersWithOutsidePointerEventsDisabled].slice(-1); const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled); const index = node ? layers.indexOf(node) : -1; const isBodyPointerEventsDisabled = context2.layersWithOutsidePointerEventsDisabled.size > 0; const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex; const pointerDownOutside = usePointerDownOutside((event) => { const target = event.target; const isPointerDownOnBranch = [...context2.branches].some((branch) => branch.contains(target)); if (!isPointerEventsEnabled || isPointerDownOnBranch) return; onPointerDownOutside?.(event); onInteractOutside?.(event); if (!event.defaultPrevented) onDismiss?.(); }, ownerDocument); const focusOutside = useFocusOutside((event) => { const target = event.target; const isFocusInBranch = [...context2.branches].some((branch) => branch.contains(target)); if (isFocusInBranch) return; onFocusOutside?.(event); onInteractOutside?.(event); if (!event.defaultPrevented) onDismiss?.(); }, ownerDocument); useEscapeKeydown((event) => { const isHighestLayer = index === context2.layers.size - 1; if (!isHighestLayer) return; onEscapeKeyDown?.(event); if (!event.defaultPrevented && onDismiss) { event.preventDefault(); onDismiss(); } }, ownerDocument); React11.useEffect(() => { if (!node) return; if (disableOutsidePointerEvents) { if (context2.layersWithOutsidePointerEventsDisabled.size === 0) { originalBodyPointerEvents = ownerDocument.body.style.pointerEvents; ownerDocument.body.style.pointerEvents = "none"; } context2.layersWithOutsidePointerEventsDisabled.add(node); } context2.layers.add(node); dispatchUpdate(); return () => { if (disableOutsidePointerEvents && context2.layersWithOutsidePointerEventsDisabled.size === 1) { ownerDocument.body.style.pointerEvents = originalBodyPointerEvents; } }; }, [node, ownerDocument, disableOutsidePointerEvents, context2]); React11.useEffect(() => { return () => { if (!node) return; context2.layers.delete(node); context2.layersWithOutsidePointerEventsDisabled.delete(node); dispatchUpdate(); }; }, [node, context2]); React11.useEffect(() => { const handleUpdate = () => force({}); document.addEventListener(CONTEXT_UPDATE, handleUpdate); return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate); }, []); return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)( Primitive.div, { ...layerProps, ref: composedRefs, style: { pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? "auto" : "none" : void 0, ...props.style }, onFocusCapture: composeEventHandlers2(props.onFocusCapture, focusOutside.onFocusCapture), onBlurCapture: composeEventHandlers2(props.onBlurCapture, focusOutside.onBlurCapture), onPointerDownCapture: composeEventHandlers2( props.onPointerDownCapture, pointerDownOutside.onPointerDownCapture ) } ); } ); DismissableLayer.displayName = DISMISSABLE_LAYER_NAME; var BRANCH_NAME = "DismissableLayerBranch"; var DismissableLayerBranch = React11.forwardRef((props, forwardedRef) => { const context2 = React11.useContext(DismissableLayerContext); const ref = React11.useRef(null); const composedRefs = useComposedRefs2(forwardedRef, ref); React11.useEffect(() => { const node = ref.current; if (node) { context2.branches.add(node); return () => { context2.branches.delete(node); }; } }, [context2.branches]); return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Primitive.div, { ...props, ref: composedRefs }); }); DismissableLayerBranch.displayName = BRANCH_NAME; function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) { const handlePointerDownOutside = useCallbackRef(onPointerDownOutside); const isPointerInsideReactTreeRef = React11.useRef(false); const handleClickRef = React11.useRef(() => { }); React11.useEffect(() => { const handlePointerDown = (event) => { if (event.target && !isPointerInsideReactTreeRef.current) { let handleAndDispatchPointerDownOutsideEvent2 = function() { handleAndDispatchCustomEvent( POINTER_DOWN_OUTSIDE, handlePointerDownOutside, eventDetail, { discrete: true } ); }; var handleAndDispatchPointerDownOutsideEvent = handleAndDispatchPointerDownOutsideEvent2; const eventDetail = { originalEvent: event }; if (event.pointerType === "touch") { ownerDocument.removeEventListener("click", handleClickRef.current); handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2; ownerDocument.addEventListener("click", handleClickRef.current, { once: true }); } else { handleAndDispatchPointerDownOutsideEvent2(); } } else { ownerDocument.removeEventListener("click", handleClickRef.current); } isPointerInsideReactTreeRef.current = false; }; const timerId = window.setTimeout(() => { ownerDocument.addEventListener("pointerdown", handlePointerDown); }, 0); return () => { window.clearTimeout(timerId); ownerDocument.removeEventListener("pointerdown", handlePointerDown); ownerDocument.removeEventListener("click", handleClickRef.current); }; }, [ownerDocument, handlePointerDownOutside]); return { // ensures we check React component tree (not just DOM tree) onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true }; } function useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) { const handleFocusOutside = useCallbackRef(onFocusOutside); const isFocusInsideReactTreeRef = React11.useRef(false); React11.useEffect(() => { const handleFocus = (event) => { if (event.target && !isFocusInsideReactTreeRef.current) { const eventDetail = { originalEvent: event }; handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, { discrete: false }); } }; ownerDocument.addEventListener("focusin", handleFocus); return () => ownerDocument.removeEventListener("focusin", handleFocus); }, [ownerDocument, handleFocusOutside]); return { onFocusCapture: () => isFocusInsideReactTreeRef.current = true, onBlurCapture: () => isFocusInsideReactTreeRef.current = false }; } function dispatchUpdate() { const event = new CustomEvent(CONTEXT_UPDATE); document.dispatchEvent(event); } function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) { const target = detail.originalEvent.target; const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail }); if (handler) target.addEventListener(name, handler, { once: true }); if (discrete) { dispatchDiscreteCustomEvent(target, event); } else { target.dispatchEvent(event); } } // node_modules/@radix-ui/react-focus-scope/dist/index.mjs var React16 = __toESM(require_react(), 1); // node_modules/@radix-ui/react-focus-scope/node_modules/@radix-ui/react-compose-refs/dist/index.mjs var React12 = __toESM(require_react(), 1); function setRef3(ref, value) { if (typeof ref === "function") { return ref(value); } else if (ref !== null && ref !== void 0) { ref.current = value; } } function composeRefs3(...refs) { return (node) => { let hasCleanup = false; const cleanups = refs.map((ref) => { const cleanup = setRef3(ref, node); if (!hasCleanup && typeof cleanup == "function") { hasCleanup = true; } return cleanup; }); if (hasCleanup) { return () => { for (let i = 0; i < cleanups.length; i++) { const cleanup = cleanups[i]; if (typeof cleanup == "function") { cleanup(); } else { setRef3(refs[i], null); } } }; } }; } function useComposedRefs3(...refs) { return React12.useCallback(composeRefs3(...refs), refs); } // node_modules/@radix-ui/react-focus-scope/node_modules/@radix-ui/react-primitive/dist/index.mjs var React14 = __toESM(require_react(), 1); var ReactDOM2 = __toESM(require_react_dom(), 1); // node_modules/@radix-ui/react-focus-scope/node_modules/@radix-ui/react-slot/dist/index.mjs var React13 = __toESM(require_react(), 1); var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1); // @__NO_SIDE_EFFECTS__ function createSlot2(ownerName) { const SlotClone = /* @__PURE__ */ createSlotClone2(ownerName); const Slot2 = React13.forwardRef((props, forwardedRef) => { const { children, ...slotProps } = props; const childrenArray = React13.Children.toArray(children); const slottable = childrenArray.find(isSlottable2); if (slottable) { const newElement = slottable.props.children; const newChildren = childrenArray.map((child) => { if (child === slottable) { if (React13.Children.count(newElement) > 1) return React13.Children.only(null); return React13.isValidElement(newElement) ? newElement.props.children : null; } else { return child; } }); return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children: React13.isValidElement(newElement) ? React13.cloneElement(newElement, void 0, newChildren) : null }); } return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children }); }); Slot2.displayName = `${ownerName}.Slot`; return Slot2; } // @__NO_SIDE_EFFECTS__ function createSlotClone2(ownerName) { const SlotClone = React13.forwardRef((props, forwardedRef) => { const { children, ...slotProps } = props; if (React13.isValidElement(children)) { const childrenRef = getElementRef2(children); const props2 = mergeProps2(slotProps, children.props); if (children.type !== React13.Fragment) { props2.ref = forwardedRef ? composeRefs3(forwardedRef, childrenRef) : childrenRef; } return React13.cloneElement(children, props2); } return React13.Children.count(children) > 1 ? React13.Children.only(null) : null; }); SlotClone.displayName = `${ownerName}.SlotClone`; return SlotClone; } var SLOTTABLE_IDENTIFIER2 = /* @__PURE__ */ Symbol("radix.slottable"); function isSlottable2(child) { return React13.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER2; } function mergeProps2(slotProps, childProps) { const overrideProps = { ...childProps }; for (const propName in childProps) { const slotPropValue = slotProps[propName]; const childPropValue = childProps[propName]; const isHandler = /^on[A-Z]/.test(propName); if (isHandler) { if (slotPropValue && childPropValue) { overrideProps[propName] = (...args) => { const result = childPropValue(...args); slotPropValue(...args); return result; }; } else if (slotPropValue) { overrideProps[propName] = slotPropValue; } } else if (propName === "style") { overrideProps[propName] = { ...slotPropValue, ...childPropValue }; } else if (propName === "className") { overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" "); } } return { ...slotProps, ...overrideProps }; } function getElementRef2(element) { let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get; let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning; if (mayWarn) { return element.ref; } getter = Object.getOwnPropertyDescriptor(element, "ref")?.get; mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning; if (mayWarn) { return element.props.ref; } return element.props.ref || element.ref; } // node_modules/@radix-ui/react-focus-scope/node_modules/@radix-ui/react-primitive/dist/index.mjs var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1); var NODES2 = [ "a", "button", "div", "form", "h2", "h3", "img", "input", "label", "li", "nav", "ol", "p", "select", "span", "svg", "ul" ]; var Primitive2 = NODES2.reduce((primitive, node) => { const Slot2 = createSlot2(`Primitive.${node}`); const Node2 = React14.forwardRef((props, forwardedRef) => { const { asChild, ...primitiveProps } = props; const Comp = asChild ? Slot2 : node; if (typeof window !== "undefined") { window[/* @__PURE__ */ Symbol.for("radix-ui")] = true; } return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Comp, { ...primitiveProps, ref: forwardedRef }); }); Node2.displayName = `Primitive.${node}`; return { ...primitive, [node]: Node2 }; }, {}); // node_modules/@radix-ui/react-focus-scope/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs var React15 = __toESM(require_react(), 1); function useCallbackRef2(callback) { const callbackRef = React15.useRef(callback); React15.useEffect(() => { callbackRef.current = callback; }); return React15.useMemo(() => (...args) => callbackRef.current?.(...args), []); } // node_modules/@radix-ui/react-focus-scope/dist/index.mjs var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1); var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount"; var AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount"; var EVENT_OPTIONS = { bubbles: false, cancelable: true }; var FOCUS_SCOPE_NAME = "FocusScope"; var FocusScope = React16.forwardRef((props, forwardedRef) => { const { loop = false, trapped = false, onMountAutoFocus: onMountAutoFocusProp, onUnmountAutoFocus: onUnmountAutoFocusProp, ...scopeProps } = props; const [container, setContainer] = React16.useState(null); const onMountAutoFocus = useCallbackRef2(onMountAutoFocusProp); const onUnmountAutoFocus = useCallbackRef2(onUnmountAutoFocusProp); const lastFocusedElementRef = React16.useRef(null); const composedRefs = useComposedRefs3(forwardedRef, (node) => setContainer(node)); const focusScope = React16.useRef({ paused: false, pause() { this.paused = true; }, resume() { this.paused = false; } }).current; React16.useEffect(() => { if (trapped) { let handleFocusIn2 = function(event) { if (focusScope.paused || !container) return; const target = event.target; if (container.contains(target)) { lastFocusedElementRef.current = target; } else { focus(lastFocusedElementRef.current, { select: true }); } }, handleFocusOut2 = function(event) { if (focusScope.paused || !container) return; const relatedTarget = event.relatedTarget; if (relatedTarget === null) return; if (!container.contains(relatedTarget)) { focus(lastFocusedElementRef.current, { select: true }); } }, handleMutations2 = function(mutations) { const focusedElement = document.activeElement; if (focusedElement !== document.body) return; for (const mutation of mutations) { if (mutation.removedNodes.length > 0) focus(container); } }; var handleFocusIn = handleFocusIn2, handleFocusOut = handleFocusOut2, handleMutations = handleMutations2; document.addEventListener("focusin", handleFocusIn2); document.addEventListener("focusout", handleFocusOut2); const mutationObserver = new MutationObserver(handleMutations2); if (container) mutationObserver.observe(container, { childList: true, subtree: true }); return () => { document.removeEventListener("focusin", handleFocusIn2); document.removeEventListener("focusout", handleFocusOut2); mutationObserver.disconnect(); }; } }, [trapped, container, focusScope.paused]); React16.useEffect(() => { if (container) { focusScopesStack.add(focusScope); const previouslyFocusedElement = document.activeElement; const hasFocusedCandidate = container.contains(previouslyFocusedElement); if (!hasFocusedCandidate) { const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS); container.addEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus); container.dispatchEvent(mountEvent); if (!mountEvent.defaultPrevented) { focusFirst(removeLinks(getTabbableCandidates(container)), { select: true }); if (document.activeElement === previouslyFocusedElement) { focus(container); } } } return () => { container.removeEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus); setTimeout(() => { const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS); container.addEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus); container.dispatchEvent(unmountEvent); if (!unmountEvent.defaultPrevented) { focus(previouslyFocusedElement ?? document.body, { select: true }); } container.removeEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus); focusScopesStack.remove(focusScope); }, 0); }; } }, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]); const handleKeyDown = React16.useCallback( (event) => { if (!loop && !trapped) return; if (focusScope.paused) return; const isTabKey = event.key === "Tab" && !event.altKey && !event.ctrlKey && !event.metaKey; const focusedElement = document.activeElement; if (isTabKey && focusedElement) { const container2 = event.currentTarget; const [first, last] = getTabbableEdges(container2); const hasTabbableElementsInside = first && last; if (!hasTabbableElementsInside) { if (focusedElement === container2) event.preventDefault(); } else { if (!event.shiftKey && focusedElement === last) { event.preventDefault(); if (loop) focus(first, { select: true }); } else if (event.shiftKey && focusedElement === first) { event.preventDefault(); if (loop) focus(last, { select: true }); } } } }, [loop, trapped, focusScope.paused] ); return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Primitive2.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown }); }); FocusScope.displayName = FOCUS_SCOPE_NAME; function focusFirst(candidates, { select = false } = {}) { const previouslyFocusedElement = document.activeElement; for (const candidate of candidates) { focus(candidate, { select }); if (document.activeElement !== previouslyFocusedElement) return; } } function getTabbableEdges(container) { const candidates = getTabbableCandidates(container); const first = findVisible(candidates, container); const last = findVisible(candidates.reverse(), container); return [first, last]; } function getTabbableCandidates(container) { const nodes = []; const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, { acceptNode: (node) => { const isHiddenInput = node.tagName === "INPUT" && node.type === "hidden"; if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP; return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP; } }); while (walker.nextNode()) nodes.push(walker.currentNode); return nodes; } function findVisible(elements, container) { for (const element of elements) { if (!isHidden(element, { upTo: container })) return element; } } function isHidden(node, { upTo }) { if (getComputedStyle(node).visibility === "hidden") return true; while (node) { if (upTo !== void 0 && node === upTo) return false; if (getComputedStyle(node).display === "none") return true; node = node.parentElement; } return false; } function isSelectableInput(element) { return element instanceof HTMLInputElement && "select" in element; } function focus(element, { select = false } = {}) { if (element && element.focus) { const previouslyFocusedElement = document.activeElement; element.focus({ preventScroll: true }); if (element !== previouslyFocusedElement && isSelectableInput(element) && select) element.select(); } } var focusScopesStack = createFocusScopesStack(); function createFocusScopesStack() { let stack = []; return { add(focusScope) { const activeFocusScope = stack[0]; if (focusScope !== activeFocusScope) { activeFocusScope?.pause(); } stack = arrayRemove(stack, focusScope); stack.unshift(focusScope); }, remove(focusScope) { stack = arrayRemove(stack, focusScope); stack[0]?.resume(); } }; } function arrayRemove(array, item) { const updatedArray = [...array]; const index = updatedArray.indexOf(item); if (index !== -1) { updatedArray.splice(index, 1); } return updatedArray; } function removeLinks(items) { return items.filter((item) => item.tagName !== "A"); } // node_modules/@radix-ui/react-portal/dist/index.mjs var React21 = __toESM(require_react(), 1); var import_react_dom = __toESM(require_react_dom(), 1); // node_modules/@radix-ui/react-portal/node_modules/@radix-ui/react-primitive/dist/index.mjs var React19 = __toESM(require_react(), 1); var ReactDOM3 = __toESM(require_react_dom(), 1); // node_modules/@radix-ui/react-portal/node_modules/@radix-ui/react-slot/dist/index.mjs var React18 = __toESM(require_react(), 1); // node_modules/@radix-ui/react-portal/node_modules/@radix-ui/react-compose-refs/dist/index.mjs var React17 = __toESM(require_react(), 1); function setRef4(ref, value) { if (typeof ref === "function") { return ref(value); } else if (ref !== null && ref !== void 0) { ref.current = value; } } function composeRefs4(...refs) { return (node) => { let hasCleanup = false; const cleanups = refs.map((ref) => { const cleanup = setRef4(ref, node); if (!hasCleanup && typeof cleanup == "function") { hasCleanup = true; } return cleanup; }); if (hasCleanup) { return () => { for (let i = 0; i < cleanups.length; i++) { const cleanup = cleanups[i]; if (typeof cleanup == "function") { cleanup(); } else { setRef4(refs[i], null); } } }; } }; } // node_modules/@radix-ui/react-portal/node_modules/@radix-ui/react-slot/dist/index.mjs var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1); // @__NO_SIDE_EFFECTS__ function createSlot3(ownerName) { const SlotClone = /* @__PURE__ */ createSlotClone3(ownerName); const Slot2 = React18.forwardRef((props, forwardedRef) => { const { children, ...slotProps } = props; const childrenArray = React18.Children.toArray(children); const slottable = childrenArray.find(isSlottable3); if (slottable) { const newElement = slottable.props.children; const newChildren = childrenArray.map((child) => { if (child === slottable) { if (React18.Children.count(newElement) > 1) return React18.Children.only(null); return React18.isValidElement(newElement) ? newElement.props.children : null; } else { return child; } }); return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children: React18.isValidElement(newElement) ? React18.cloneElement(newElement, void 0, newChildren) : null }); } return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children }); }); Slot2.displayName = `${ownerName}.Slot`; return Slot2; } // @__NO_SIDE_EFFECTS__ function createSlotClone3(ownerName) { const SlotClone = React18.forwardRef((props, forwardedRef) => { const { children, ...slotProps } = props; if (React18.isValidElement(children)) { const childrenRef = getElementRef3(children); const props2 = mergeProps3(slotProps, children.props); if (children.type !== React18.Fragment) { props2.ref = forwardedRef ? composeRefs4(forwardedRef, childrenRef) : childrenRef; } return React18.cloneElement(children, props2); } return React18.Children.count(children) > 1 ? React18.Children.only(null) : null; }); SlotClone.displayName = `${ownerName}.SlotClone`; return SlotClone; } var SLOTTABLE_IDENTIFIER3 = /* @__PURE__ */ Symbol("radix.slottable"); function isSlottable3(child) { return React18.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER3; } function mergeProps3(slotProps, childProps) { const overrideProps = { ...childProps }; for (const propName in childProps) { const slotPropValue = slotProps[propName]; const childPropValue = childProps[propName]; const isHandler = /^on[A-Z]/.test(propName); if (isHandler) { if (slotPropValue && childPropValue) { overrideProps[propName] = (...args) => { const result = childPropValue(...args); slotPropValue(...args); return result; }; } else if (slotPropValue) { overrideProps[propName] = slotPropValue; } } else if (propName === "style") { overrideProps[propName] = { ...slotPropValue, ...childPropValue }; } else if (propName === "className") { overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" "); } } return { ...slotProps, ...overrideProps }; } function getElementRef3(element) { let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get; let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning; if (mayWarn) { return element.ref; } getter = Object.getOwnPropertyDescriptor(element, "ref")?.get; mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning; if (mayWarn) { return element.props.ref; } return element.props.ref || element.ref; } // node_modules/@radix-ui/react-portal/node_modules/@radix-ui/react-primitive/dist/index.mjs var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1); var NODES3 = [ "a", "button", "div", "form", "h2", "h3", "img", "input", "label", "li", "nav", "ol", "p", "select", "span", "svg", "ul" ]; var Primitive3 = NODES3.reduce((primitive, node) => { const Slot2 = createSlot3(`Primitive.${node}`); const Node2 = React19.forwardRef((props, forwardedRef) => { const { asChild, ...primitiveProps } = props; const Comp = asChild ? Slot2 : node; if (typeof window !== "undefined") { window[/* @__PURE__ */ Symbol.for("radix-ui")] = true; } return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Comp, { ...primitiveProps, ref: forwardedRef }); }); Node2.displayName = `Primitive.${node}`; return { ...primitive, [node]: Node2 }; }, {}); // node_modules/@radix-ui/react-portal/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs var React20 = __toESM(require_react(), 1); var useLayoutEffect22 = globalThis?.document ? React20.useLayoutEffect : () => { }; // node_modules/@radix-ui/react-portal/dist/index.mjs var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1); var PORTAL_NAME = "Portal"; var Portal = React21.forwardRef((props, forwardedRef) => { const { container: containerProp, ...portalProps } = props; const [mounted, setMounted] = React21.useState(false); useLayoutEffect22(() => setMounted(true), []); const container = containerProp || mounted && globalThis?.document?.body; return container ? import_react_dom.default.createPortal(/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Primitive3.div, { ...portalProps, ref: forwardedRef }), container) : null; }); Portal.displayName = PORTAL_NAME; // node_modules/@radix-ui/react-presence/dist/index.mjs var React25 = __toESM(require_react(), 1); // node_modules/@radix-ui/react-presence/node_modules/@radix-ui/react-compose-refs/dist/index.mjs var React23 = __toESM(require_react(), 1); function setRef5(ref, value) { if (typeof ref === "function") { return ref(value); } else if (ref !== null && ref !== void 0) { ref.current = value; } } function composeRefs5(...refs) { return (node) => { let hasCleanup = false; const cleanups = refs.map((ref) => { const cleanup = setRef5(ref, node); if (!hasCleanup && typeof cleanup == "function") { hasCleanup = true; } return cleanup; }); if (hasCleanup) { return () => { for (let i = 0; i < cleanups.length; i++) { const cleanup = cleanups[i]; if (typeof cleanup == "function") { cleanup(); } else { setRef5(refs[i], null); } } }; } }; } function useComposedRefs4(...refs) { return React23.useCallback(composeRefs5(...refs), refs); } // node_modules/@radix-ui/react-presence/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs var React24 = __toESM(require_react(), 1); var useLayoutEffect23 = globalThis?.document ? React24.useLayoutEffect : () => { }; // node_modules/@radix-ui/react-presence/dist/index.mjs var React26 = __toESM(require_react(), 1); function useStateMachine(initialState, machine) { return React26.useReducer((state, event) => { const nextState = machine[state][event]; return nextState ?? state; }, initialState); } var Presence = (props) => { const { present, children } = props; const presence = usePresence(present); const child = typeof children === "function" ? children({ present: presence.isPresent }) : React25.Children.only(children); const ref = useComposedRefs4(presence.ref, getElementRef4(child)); const forceMount = typeof children === "function"; return forceMount || presence.isPresent ? React25.cloneElement(child, { ref }) : null; }; Presence.displayName = "Presence"; function usePresence(present) { const [node, setNode] = React25.useState(); const stylesRef = React25.useRef(null); const prevPresentRef = React25.useRef(present); const prevAnimationNameRef = React25.useRef("none"); const initialState = present ? "mounted" : "unmounted"; const [state, send] = useStateMachine(initialState, { mounted: { UNMOUNT: "unmounted", ANIMATION_OUT: "unmountSuspended" }, unmountSuspended: { MOUNT: "mounted", ANIMATION_END: "unmounted" }, unmounted: { MOUNT: "mounted" } }); React25.useEffect(() => { const currentAnimationName = getAnimationName(stylesRef.current); prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none"; }, [state]); useLayoutEffect23(() => { const styles = stylesRef.current; const wasPresent = prevPresentRef.current; const hasPresentChanged = wasPresent !== present; if (hasPresentChanged) { const prevAnimationName = prevAnimationNameRef.current; const currentAnimationName = getAnimationName(styles); if (present) { send("MOUNT"); } else if (currentAnimationName === "none" || styles?.display === "none") { send("UNMOUNT"); } else { const isAnimating = prevAnimationName !== currentAnimationName; if (wasPresent && isAnimating) { send("ANIMATION_OUT"); } else { send("UNMOUNT"); } } prevPresentRef.current = present; } }, [present, send]); useLayoutEffect23(() => { if (node) { let timeoutId; const ownerWindow = node.ownerDocument.defaultView ?? window; const handleAnimationEnd = (event) => { const currentAnimationName = getAnimationName(stylesRef.current); const isCurrentAnimation = currentAnimationName.includes(CSS.escape(event.animationName)); if (event.target === node && isCurrentAnimation) { send("ANIMATION_END"); if (!prevPresentRef.current) { const currentFillMode = node.style.animationFillMode; node.style.animationFillMode = "forwards"; timeoutId = ownerWindow.setTimeout(() => { if (node.style.animationFillMode === "forwards") { node.style.animationFillMode = currentFillMode; } }); } } }; const handleAnimationStart = (event) => { if (event.target === node) { prevAnimationNameRef.current = getAnimationName(stylesRef.current); } }; node.addEventListener("animationstart", handleAnimationStart); node.addEventListener("animationcancel", handleAnimationEnd); node.addEventListener("animationend", handleAnimationEnd); return () => { ownerWindow.clearTimeout(timeoutId); node.removeEventListener("animationstart", handleAnimationStart); node.removeEventListener("animationcancel", handleAnimationEnd); node.removeEventListener("animationend", handleAnimationEnd); }; } else { send("ANIMATION_END"); } }, [node, send]); return { isPresent: ["mounted", "unmountSuspended"].includes(state), ref: React25.useCallback((node2) => { stylesRef.current = node2 ? getComputedStyle(node2) : null; setNode(node2); }, []) }; } function getAnimationName(styles) { return styles?.animationName || "none"; } function getElementRef4(element) { let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get; let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning; if (mayWarn) { return element.ref; } getter = Object.getOwnPropertyDescriptor(element, "ref")?.get; mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning; if (mayWarn) { return element.props.ref; } return element.props.ref || element.ref; } // node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-primitive/dist/index.mjs var React28 = __toESM(require_react(), 1); var ReactDOM5 = __toESM(require_react_dom(), 1); // node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-slot/dist/index.mjs var React27 = __toESM(require_react(), 1); var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1); // @__NO_SIDE_EFFECTS__ function createSlot4(ownerName) { const SlotClone = /* @__PURE__ */ createSlotClone4(ownerName); const Slot2 = React27.forwardRef((props, forwardedRef) => { const { children, ...slotProps } = props; const childrenArray = React27.Children.toArray(children); const slottable = childrenArray.find(isSlottable4); if (slottable) { const newElement = slottable.props.children; const newChildren = childrenArray.map((child) => { if (child === slottable) { if (React27.Children.count(newElement) > 1) return React27.Children.only(null); return React27.isValidElement(newElement) ? newElement.props.children : null; } else { return child; } }); return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children: React27.isValidElement(newElement) ? React27.cloneElement(newElement, void 0, newChildren) : null }); } return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children }); }); Slot2.displayName = `${ownerName}.Slot`; return Slot2; } // @__NO_SIDE_EFFECTS__ function createSlotClone4(ownerName) { const SlotClone = React27.forwardRef((props, forwardedRef) => { const { children, ...slotProps } = props; if (React27.isValidElement(children)) { const childrenRef = getElementRef5(children); const props2 = mergeProps4(slotProps, children.props); if (children.type !== React27.Fragment) { props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef; } return React27.cloneElement(children, props2); } return React27.Children.count(children) > 1 ? React27.Children.only(null) : null; }); SlotClone.displayName = `${ownerName}.SlotClone`; return SlotClone; } var SLOTTABLE_IDENTIFIER4 = /* @__PURE__ */ Symbol("radix.slottable"); function isSlottable4(child) { return React27.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER4; } function mergeProps4(slotProps, childProps) { const overrideProps = { ...childProps }; for (const propName in childProps) { const slotPropValue = slotProps[propName]; const childPropValue = childProps[propName]; const isHandler = /^on[A-Z]/.test(propName); if (isHandler) { if (slotPropValue && childPropValue) { overrideProps[propName] = (...args) => { const result = childPropValue(...args); slotPropValue(...args); return result; }; } else if (slotPropValue) { overrideProps[propName] = slotPropValue; } } else if (propName === "style") { overrideProps[propName] = { ...slotPropValue, ...childPropValue }; } else if (propName === "className") { overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" "); } } return { ...slotProps, ...overrideProps }; } function getElementRef5(element) { let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get; let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning; if (mayWarn) { return element.ref; } getter = Object.getOwnPropertyDescriptor(element, "ref")?.get; mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning; if (mayWarn) { return element.props.ref; } return element.props.ref || element.ref; } // node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-primitive/dist/index.mjs var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1); var NODES4 = [ "a", "button", "div", "form", "h2", "h3", "img", "input", "label", "li", "nav", "ol", "p", "select", "span", "svg", "ul" ]; var Primitive4 = NODES4.reduce((primitive, node) => { const Slot2 = createSlot4(`Primitive.${node}`); const Node2 = React28.forwardRef((props, forwardedRef) => { const { asChild, ...primitiveProps } = props; const Comp = asChild ? Slot2 : node; if (typeof window !== "undefined") { window[/* @__PURE__ */ Symbol.for("radix-ui")] = true; } return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Comp, { ...primitiveProps, ref: forwardedRef }); }); Node2.displayName = `Primitive.${node}`; return { ...primitive, [node]: Node2 }; }, {}); // node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-focus-guards/dist/index.mjs var React29 = __toESM(require_react(), 1); var count2 = 0; function useFocusGuards() { React29.useEffect(() => { const edgeGuards = document.querySelectorAll("[data-radix-focus-guard]"); document.body.insertAdjacentElement("afterbegin", edgeGuards[0] ?? createFocusGuard()); document.body.insertAdjacentElement("beforeend", edgeGuards[1] ?? createFocusGuard()); count2++; return () => { if (count2 === 1) { document.querySelectorAll("[data-radix-focus-guard]").forEach((node) => node.remove()); } count2--; }; }, []); } function createFocusGuard() { const element = document.createElement("span"); element.setAttribute("data-radix-focus-guard", ""); element.tabIndex = 0; element.style.outline = "none"; element.style.opacity = "0"; element.style.position = "fixed"; element.style.pointerEvents = "none"; return element; } // node_modules/tslib/tslib.es6.mjs var __assign = function() { __assign = Object.assign || function __assign2(t2) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p2 in s) if (Object.prototype.hasOwnProperty.call(s, p2)) t2[p2] = s[p2]; } return t2; }; return __assign.apply(this, arguments); }; function __rest(s, e) { var t2 = {}; for (var p2 in s) if (Object.prototype.hasOwnProperty.call(s, p2) && e.indexOf(p2) < 0) t2[p2] = s[p2]; if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p2 = Object.getOwnPropertySymbols(s); i < p2.length; i++) { if (e.indexOf(p2[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p2[i])) t2[p2[i]] = s[p2[i]]; } return t2; } function __spreadArray(to, from, pack) { if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { if (ar || !(i in from)) { if (!ar) ar = Array.prototype.slice.call(from, 0, i); ar[i] = from[i]; } } return to.concat(ar || Array.prototype.slice.call(from)); } // node_modules/@radix-ui/react-dialog/node_modules/react-remove-scroll/dist/es2015/Combination.js var React36 = __toESM(require_react()); // node_modules/@radix-ui/react-dialog/node_modules/react-remove-scroll/dist/es2015/UI.js var React32 = __toESM(require_react()); // node_modules/react-remove-scroll-bar/dist/es2015/constants.js var zeroRightClassName = "right-scroll-bar-position"; var fullWidthClassName = "width-before-scroll-bar"; var noScrollbarsClassName = "with-scroll-bars-hidden"; var removedBarSizeVariable = "--removed-body-scroll-bar-size"; // node_modules/use-callback-ref/dist/es2015/assignRef.js function assignRef(ref, value) { if (typeof ref === "function") { ref(value); } else if (ref) { ref.current = value; } return ref; } // node_modules/use-callback-ref/dist/es2015/useRef.js var import_react = __toESM(require_react()); function useCallbackRef3(initialValue, callback) { var ref = (0, import_react.useState)(function() { return { // value value: initialValue, // last callback callback, // "memoized" public interface facade: { get current() { return ref.value; }, set current(value) { var last = ref.value; if (last !== value) { ref.value = value; ref.callback(value, last); } } } }; })[0]; ref.callback = callback; return ref.facade; } // node_modules/use-callback-ref/dist/es2015/useMergeRef.js var React30 = __toESM(require_react()); var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React30.useLayoutEffect : React30.useEffect; var currentValues = /* @__PURE__ */ new WeakMap(); function useMergeRefs(refs, defaultValue) { var callbackRef = useCallbackRef3(defaultValue || null, function(newValue) { return refs.forEach(function(ref) { return assignRef(ref, newValue); }); }); useIsomorphicLayoutEffect(function() { var oldValue = currentValues.get(callbackRef); if (oldValue) { var prevRefs_1 = new Set(oldValue); var nextRefs_1 = new Set(refs); var current_1 = callbackRef.current; prevRefs_1.forEach(function(ref) { if (!nextRefs_1.has(ref)) { assignRef(ref, null); } }); nextRefs_1.forEach(function(ref) { if (!prevRefs_1.has(ref)) { assignRef(ref, current_1); } }); } currentValues.set(callbackRef, refs); }, [refs]); return callbackRef; } // node_modules/use-sidecar/dist/es2015/medium.js function ItoI(a) { return a; } function innerCreateMedium(defaults, middleware) { if (middleware === void 0) { middleware = ItoI; } var buffer = []; var assigned = false; var medium = { read: function() { if (assigned) { throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`."); } if (buffer.length) { return buffer[buffer.length - 1]; } return defaults; }, useMedium: function(data) { var item = middleware(data, assigned); buffer.push(item); return function() { buffer = buffer.filter(function(x) { return x !== item; }); }; }, assignSyncMedium: function(cb) { assigned = true; while (buffer.length) { var cbs = buffer; buffer = []; cbs.forEach(cb); } buffer = { push: function(x) { return cb(x); }, filter: function() { return buffer; } }; }, assignMedium: function(cb) { assigned = true; var pendingQueue = []; if (buffer.length) { var cbs = buffer; buffer = []; cbs.forEach(cb); pendingQueue = buffer; } var executeQueue = function() { var cbs2 = pendingQueue; pendingQueue = []; cbs2.forEach(cb); }; var cycle = function() { return Promise.resolve().then(executeQueue); }; cycle(); buffer = { push: function(x) { pendingQueue.push(x); cycle(); }, filter: function(filter) { pendingQueue = pendingQueue.filter(filter); return buffer; } }; } }; return medium; } function createSidecarMedium(options) { if (options === void 0) { options = {}; } var medium = innerCreateMedium(null); medium.options = __assign({ async: true, ssr: false }, options); return medium; } // node_modules/use-sidecar/dist/es2015/exports.js var React31 = __toESM(require_react()); var SideCar = function(_a) { var sideCar = _a.sideCar, rest = __rest(_a, ["sideCar"]); if (!sideCar) { throw new Error("Sidecar: please provide `sideCar` property to import the right car"); } var Target = sideCar.read(); if (!Target) { throw new Error("Sidecar medium not found"); } return React31.createElement(Target, __assign({}, rest)); }; SideCar.isSideCarExport = true; function exportSidecar(medium, exported) { medium.useMedium(exported); return SideCar; } // node_modules/@radix-ui/react-dialog/node_modules/react-remove-scroll/dist/es2015/medium.js var effectCar = createSidecarMedium(); // node_modules/@radix-ui/react-dialog/node_modules/react-remove-scroll/dist/es2015/UI.js var nothing = function() { return; }; var RemoveScroll = React32.forwardRef(function(props, parentRef) { var ref = React32.useRef(null); var _a = React32.useState({ onScrollCapture: nothing, onWheelCapture: nothing, onTouchMoveCapture: nothing }), callbacks = _a[0], setCallbacks = _a[1]; var forwardProps = props.forwardProps, children = props.children, className = props.className, removeScrollBar = props.removeScrollBar, enabled = props.enabled, shards = props.shards, sideCar = props.sideCar, noRelative = props.noRelative, noIsolation = props.noIsolation, inert = props.inert, allowPinchZoom = props.allowPinchZoom, _b = props.as, Container = _b === void 0 ? "div" : _b, gapMode = props.gapMode, rest = __rest(props, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]); var SideCar2 = sideCar; var containerRef = useMergeRefs([ref, parentRef]); var containerProps = __assign(__assign({}, rest), callbacks); return React32.createElement( React32.Fragment, null, enabled && React32.createElement(SideCar2, { sideCar: effectCar, removeScrollBar, shards, noRelative, noIsolation, inert, setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref, gapMode }), forwardProps ? React32.cloneElement(React32.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef })) : React32.createElement(Container, __assign({}, containerProps, { className, ref: containerRef }), children) ); }); RemoveScroll.defaultProps = { enabled: true, removeScrollBar: true, inert: false }; RemoveScroll.classNames = { fullWidth: fullWidthClassName, zeroRight: zeroRightClassName }; // node_modules/@radix-ui/react-dialog/node_modules/react-remove-scroll/dist/es2015/SideEffect.js var React35 = __toESM(require_react()); // node_modules/react-remove-scroll-bar/dist/es2015/component.js var React34 = __toESM(require_react()); // node_modules/react-style-singleton/dist/es2015/hook.js var React33 = __toESM(require_react()); // node_modules/get-nonce/dist/es2015/index.js var currentNonce; var getNonce = function() { if (currentNonce) { return currentNonce; } if (typeof __webpack_nonce__ !== "undefined") { return __webpack_nonce__; } return void 0; }; // node_modules/react-style-singleton/dist/es2015/singleton.js function makeStyleTag() { if (!document) return null; var tag = document.createElement("style"); tag.type = "text/css"; var nonce = getNonce(); if (nonce) { tag.setAttribute("nonce", nonce); } return tag; } function injectStyles(tag, css) { if (tag.styleSheet) { tag.styleSheet.cssText = css; } else { tag.appendChild(document.createTextNode(css)); } } function insertStyleTag(tag) { var head = document.head || document.getElementsByTagName("head")[0]; head.appendChild(tag); } var stylesheetSingleton = function() { var counter = 0; var stylesheet = null; return { add: function(style) { if (counter == 0) { if (stylesheet = makeStyleTag()) { injectStyles(stylesheet, style); insertStyleTag(stylesheet); } } counter++; }, remove: function() { counter--; if (!counter && stylesheet) { stylesheet.parentNode && stylesheet.parentNode.removeChild(stylesheet); stylesheet = null; } } }; }; // node_modules/react-style-singleton/dist/es2015/hook.js var styleHookSingleton = function() { var sheet = stylesheetSingleton(); return function(styles, isDynamic) { React33.useEffect(function() { sheet.add(styles); return function() { sheet.remove(); }; }, [styles && isDynamic]); }; }; // node_modules/react-style-singleton/dist/es2015/component.js var styleSingleton = function() { var useStyle = styleHookSingleton(); var Sheet = function(_a) { var styles = _a.styles, dynamic = _a.dynamic; useStyle(styles, dynamic); return null; }; return Sheet; }; // node_modules/react-remove-scroll-bar/dist/es2015/utils.js var zeroGap = { left: 0, top: 0, right: 0, gap: 0 }; var parse = function(x) { return parseInt(x || "", 10) || 0; }; var getOffset = function(gapMode) { var cs = window.getComputedStyle(document.body); var left = cs[gapMode === "padding" ? "paddingLeft" : "marginLeft"]; var top = cs[gapMode === "padding" ? "paddingTop" : "marginTop"]; var right = cs[gapMode === "padding" ? "paddingRight" : "marginRight"]; return [parse(left), parse(top), parse(right)]; }; var getGapWidth = function(gapMode) { if (gapMode === void 0) { gapMode = "margin"; } if (typeof window === "undefined") { return zeroGap; } var offsets = getOffset(gapMode); var documentWidth = document.documentElement.clientWidth; var windowWidth = window.innerWidth; return { left: offsets[0], top: offsets[1], right: offsets[2], gap: Math.max(0, windowWidth - documentWidth + offsets[2] - offsets[0]) }; }; // node_modules/react-remove-scroll-bar/dist/es2015/component.js var Style = styleSingleton(); var lockAttribute = "data-scroll-locked"; var getStyles = function(_a, allowRelative, gapMode, important) { var left = _a.left, top = _a.top, right = _a.right, gap = _a.gap; if (gapMode === void 0) { gapMode = "margin"; } return "\n .".concat(noScrollbarsClassName, " {\n overflow: hidden ").concat(important, ";\n padding-right: ").concat(gap, "px ").concat(important, ";\n }\n body[").concat(lockAttribute, "] {\n overflow: hidden ").concat(important, ";\n overscroll-behavior: contain;\n ").concat([ allowRelative && "position: relative ".concat(important, ";"), gapMode === "margin" && "\n padding-left: ".concat(left, "px;\n padding-top: ").concat(top, "px;\n padding-right: ").concat(right, "px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(gap, "px ").concat(important, ";\n "), gapMode === "padding" && "padding-right: ".concat(gap, "px ").concat(important, ";") ].filter(Boolean).join(""), "\n }\n \n .").concat(zeroRightClassName, " {\n right: ").concat(gap, "px ").concat(important, ";\n }\n \n .").concat(fullWidthClassName, " {\n margin-right: ").concat(gap, "px ").concat(important, ";\n }\n \n .").concat(zeroRightClassName, " .").concat(zeroRightClassName, " {\n right: 0 ").concat(important, ";\n }\n \n .").concat(fullWidthClassName, " .").concat(fullWidthClassName, " {\n margin-right: 0 ").concat(important, ";\n }\n \n body[").concat(lockAttribute, "] {\n ").concat(removedBarSizeVariable, ": ").concat(gap, "px;\n }\n"); }; var getCurrentUseCounter = function() { var counter = parseInt(document.body.getAttribute(lockAttribute) || "0", 10); return isFinite(counter) ? counter : 0; }; var useLockAttribute = function() { React34.useEffect(function() { document.body.setAttribute(lockAttribute, (getCurrentUseCounter() + 1).toString()); return function() { var newCounter = getCurrentUseCounter() - 1; if (newCounter <= 0) { document.body.removeAttribute(lockAttribute); } else { document.body.setAttribute(lockAttribute, newCounter.toString()); } }; }, []); }; var RemoveScrollBar = function(_a) { var noRelative = _a.noRelative, noImportant = _a.noImportant, _b = _a.gapMode, gapMode = _b === void 0 ? "margin" : _b; useLockAttribute(); var gap = React34.useMemo(function() { return getGapWidth(gapMode); }, [gapMode]); return React34.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? "!important" : "") }); }; // node_modules/@radix-ui/react-dialog/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js var passiveSupported = false; if (typeof window !== "undefined") { try { options = Object.defineProperty({}, "passive", { get: function() { passiveSupported = true; return true; } }); window.addEventListener("test", options, options); window.removeEventListener("test", options, options); } catch (err) { passiveSupported = false; } } var options; var nonPassive = passiveSupported ? { passive: false } : false; // node_modules/@radix-ui/react-dialog/node_modules/react-remove-scroll/dist/es2015/handleScroll.js var alwaysContainsScroll = function(node) { return node.tagName === "TEXTAREA"; }; var elementCanBeScrolled = function(node, overflow) { if (!(node instanceof Element)) { return false; } var styles = window.getComputedStyle(node); return ( // not-not-scrollable styles[overflow] !== "hidden" && // contains scroll inside self !(styles.overflowY === styles.overflowX && !alwaysContainsScroll(node) && styles[overflow] === "visible") ); }; var elementCouldBeVScrolled = function(node) { return elementCanBeScrolled(node, "overflowY"); }; var elementCouldBeHScrolled = function(node) { return elementCanBeScrolled(node, "overflowX"); }; var locationCouldBeScrolled = function(axis, node) { var ownerDocument = node.ownerDocument; var current = node; do { if (typeof ShadowRoot !== "undefined" && current instanceof ShadowRoot) { current = current.host; } var isScrollable = elementCouldBeScrolled(axis, current); if (isScrollable) { var _a = getScrollVariables(axis, current), scrollHeight = _a[1], clientHeight = _a[2]; if (scrollHeight > clientHeight) { return true; } } current = current.parentNode; } while (current && current !== ownerDocument.body); return false; }; var getVScrollVariables = function(_a) { var scrollTop = _a.scrollTop, scrollHeight = _a.scrollHeight, clientHeight = _a.clientHeight; return [ scrollTop, scrollHeight, clientHeight ]; }; var getHScrollVariables = function(_a) { var scrollLeft = _a.scrollLeft, scrollWidth = _a.scrollWidth, clientWidth = _a.clientWidth; return [ scrollLeft, scrollWidth, clientWidth ]; }; var elementCouldBeScrolled = function(axis, node) { return axis === "v" ? elementCouldBeVScrolled(node) : elementCouldBeHScrolled(node); }; var getScrollVariables = function(axis, node) { return axis === "v" ? getVScrollVariables(node) : getHScrollVariables(node); }; var getDirectionFactor = function(axis, direction) { return axis === "h" && direction === "rtl" ? -1 : 1; }; var handleScroll = function(axis, endTarget, event, sourceDelta, noOverscroll) { var directionFactor = getDirectionFactor(axis, window.getComputedStyle(endTarget).direction); var delta = directionFactor * sourceDelta; var target = event.target; var targetInLock = endTarget.contains(target); var shouldCancelScroll = false; var isDeltaPositive = delta > 0; var availableScroll = 0; var availableScrollTop = 0; do { if (!target) { break; } var _a = getScrollVariables(axis, target), position = _a[0], scroll_1 = _a[1], capacity = _a[2]; var elementScroll = scroll_1 - capacity - directionFactor * position; if (position || elementScroll) { if (elementCouldBeScrolled(axis, target)) { availableScroll += elementScroll; availableScrollTop += position; } } var parent_1 = target.parentNode; target = parent_1 && parent_1.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? parent_1.host : parent_1; } while ( // portaled content !targetInLock && target !== document.body || // self content targetInLock && (endTarget.contains(target) || endTarget === target) ); if (isDeltaPositive && (noOverscroll && Math.abs(availableScroll) < 1 || !noOverscroll && delta > availableScroll)) { shouldCancelScroll = true; } else if (!isDeltaPositive && (noOverscroll && Math.abs(availableScrollTop) < 1 || !noOverscroll && -delta > availableScrollTop)) { shouldCancelScroll = true; } return shouldCancelScroll; }; // node_modules/@radix-ui/react-dialog/node_modules/react-remove-scroll/dist/es2015/SideEffect.js var getTouchXY = function(event) { return "changedTouches" in event ? [event.changedTouches[0].clientX, event.changedTouches[0].clientY] : [0, 0]; }; var getDeltaXY = function(event) { return [event.deltaX, event.deltaY]; }; var extractRef = function(ref) { return ref && "current" in ref ? ref.current : ref; }; var deltaCompare = function(x, y) { return x[0] === y[0] && x[1] === y[1]; }; var generateStyle = function(id) { return "\n .block-interactivity-".concat(id, " {pointer-events: none;}\n .allow-interactivity-").concat(id, " {pointer-events: all;}\n"); }; var idCounter = 0; var lockStack = []; function RemoveScrollSideCar(props) { var shouldPreventQueue = React35.useRef([]); var touchStartRef = React35.useRef([0, 0]); var activeAxis = React35.useRef(); var id = React35.useState(idCounter++)[0]; var Style2 = React35.useState(styleSingleton)[0]; var lastProps = React35.useRef(props); React35.useEffect(function() { lastProps.current = props; }, [props]); React35.useEffect(function() { if (props.inert) { document.body.classList.add("block-interactivity-".concat(id)); var allow_1 = __spreadArray([props.lockRef.current], (props.shards || []).map(extractRef), true).filter(Boolean); allow_1.forEach(function(el) { return el.classList.add("allow-interactivity-".concat(id)); }); return function() { document.body.classList.remove("block-interactivity-".concat(id)); allow_1.forEach(function(el) { return el.classList.remove("allow-interactivity-".concat(id)); }); }; } return; }, [props.inert, props.lockRef.current, props.shards]); var shouldCancelEvent = React35.useCallback(function(event, parent) { if ("touches" in event && event.touches.length === 2 || event.type === "wheel" && event.ctrlKey) { return !lastProps.current.allowPinchZoom; } var touch = getTouchXY(event); var touchStart = touchStartRef.current; var deltaX = "deltaX" in event ? event.deltaX : touchStart[0] - touch[0]; var deltaY = "deltaY" in event ? event.deltaY : touchStart[1] - touch[1]; var currentAxis; var target = event.target; var moveDirection = Math.abs(deltaX) > Math.abs(deltaY) ? "h" : "v"; if ("touches" in event && moveDirection === "h" && target.type === "range") { return false; } var canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target); if (!canBeScrolledInMainDirection) { return true; } if (canBeScrolledInMainDirection) { currentAxis = moveDirection; } else { currentAxis = moveDirection === "v" ? "h" : "v"; canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target); } if (!canBeScrolledInMainDirection) { return false; } if (!activeAxis.current && "changedTouches" in event && (deltaX || deltaY)) { activeAxis.current = currentAxis; } if (!currentAxis) { return true; } var cancelingAxis = activeAxis.current || currentAxis; return handleScroll(cancelingAxis, parent, event, cancelingAxis === "h" ? deltaX : deltaY, true); }, []); var shouldPrevent = React35.useCallback(function(_event) { var event = _event; if (!lockStack.length || lockStack[lockStack.length - 1] !== Style2) { return; } var delta = "deltaY" in event ? getDeltaXY(event) : getTouchXY(event); var sourceEvent = shouldPreventQueue.current.filter(function(e) { return e.name === event.type && (e.target === event.target || event.target === e.shadowParent) && deltaCompare(e.delta, delta); })[0]; if (sourceEvent && sourceEvent.should) { if (event.cancelable) { event.preventDefault(); } return; } if (!sourceEvent) { var shardNodes = (lastProps.current.shards || []).map(extractRef).filter(Boolean).filter(function(node) { return node.contains(event.target); }); var shouldStop = shardNodes.length > 0 ? shouldCancelEvent(event, shardNodes[0]) : !lastProps.current.noIsolation; if (shouldStop) { if (event.cancelable) { event.preventDefault(); } } } }, []); var shouldCancel = React35.useCallback(function(name, delta, target, should) { var event = { name, delta, target, should, shadowParent: getOutermostShadowParent(target) }; shouldPreventQueue.current.push(event); setTimeout(function() { shouldPreventQueue.current = shouldPreventQueue.current.filter(function(e) { return e !== event; }); }, 1); }, []); var scrollTouchStart = React35.useCallback(function(event) { touchStartRef.current = getTouchXY(event); activeAxis.current = void 0; }, []); var scrollWheel = React35.useCallback(function(event) { shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current)); }, []); var scrollTouchMove = React35.useCallback(function(event) { shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current)); }, []); React35.useEffect(function() { lockStack.push(Style2); props.setCallbacks({ onScrollCapture: scrollWheel, onWheelCapture: scrollWheel, onTouchMoveCapture: scrollTouchMove }); document.addEventListener("wheel", shouldPrevent, nonPassive); document.addEventListener("touchmove", shouldPrevent, nonPassive); document.addEventListener("touchstart", scrollTouchStart, nonPassive); return function() { lockStack = lockStack.filter(function(inst) { return inst !== Style2; }); document.removeEventListener("wheel", shouldPrevent, nonPassive); document.removeEventListener("touchmove", shouldPrevent, nonPassive); document.removeEventListener("touchstart", scrollTouchStart, nonPassive); }; }, []); var removeScrollBar = props.removeScrollBar, inert = props.inert; return React35.createElement( React35.Fragment, null, inert ? React35.createElement(Style2, { styles: generateStyle(id) }) : null, removeScrollBar ? React35.createElement(RemoveScrollBar, { noRelative: props.noRelative, gapMode: props.gapMode }) : null ); } function getOutermostShadowParent(node) { var shadowParent = null; while (node !== null) { if (node instanceof ShadowRoot) { shadowParent = node.host; node = node.host; } node = node.parentNode; } return shadowParent; } // node_modules/@radix-ui/react-dialog/node_modules/react-remove-scroll/dist/es2015/sidecar.js var sidecar_default = exportSidecar(effectCar, RemoveScrollSideCar); // node_modules/@radix-ui/react-dialog/node_modules/react-remove-scroll/dist/es2015/Combination.js var ReactRemoveScroll = React36.forwardRef(function(props, ref) { return React36.createElement(RemoveScroll, __assign({}, props, { ref, sideCar: sidecar_default })); }); ReactRemoveScroll.classNames = RemoveScroll.classNames; var Combination_default = ReactRemoveScroll; // node_modules/aria-hidden/dist/es2015/index.js var getDefaultParent = function(originalTarget) { if (typeof document === "undefined") { return null; } var sampleTarget = Array.isArray(originalTarget) ? originalTarget[0] : originalTarget; return sampleTarget.ownerDocument.body; }; var counterMap = /* @__PURE__ */ new WeakMap(); var uncontrolledNodes = /* @__PURE__ */ new WeakMap(); var markerMap = {}; var lockCount = 0; var unwrapHost = function(node) { return node && (node.host || unwrapHost(node.parentNode)); }; var correctTargets = function(parent, targets) { return targets.map(function(target) { if (parent.contains(target)) { return target; } var correctedTarget = unwrapHost(target); if (correctedTarget && parent.contains(correctedTarget)) { return correctedTarget; } console.error("aria-hidden", target, "in not contained inside", parent, ". Doing nothing"); return null; }).filter(function(x) { return Boolean(x); }); }; var applyAttributeToOthers = function(originalTarget, parentNode, markerName, controlAttribute) { var targets = correctTargets(parentNode, Array.isArray(originalTarget) ? originalTarget : [originalTarget]); if (!markerMap[markerName]) { markerMap[markerName] = /* @__PURE__ */ new WeakMap(); } var markerCounter = markerMap[markerName]; var hiddenNodes = []; var elementsToKeep = /* @__PURE__ */ new Set(); var elementsToStop = new Set(targets); var keep = function(el) { if (!el || elementsToKeep.has(el)) { return; } elementsToKeep.add(el); keep(el.parentNode); }; targets.forEach(keep); var deep = function(parent) { if (!parent || elementsToStop.has(parent)) { return; } Array.prototype.forEach.call(parent.children, function(node) { if (elementsToKeep.has(node)) { deep(node); } else { try { var attr = node.getAttribute(controlAttribute); var alreadyHidden = attr !== null && attr !== "false"; var counterValue = (counterMap.get(node) || 0) + 1; var markerValue = (markerCounter.get(node) || 0) + 1; counterMap.set(node, counterValue); markerCounter.set(node, markerValue); hiddenNodes.push(node); if (counterValue === 1 && alreadyHidden) { uncontrolledNodes.set(node, true); } if (markerValue === 1) { node.setAttribute(markerName, "true"); } if (!alreadyHidden) { node.setAttribute(controlAttribute, "true"); } } catch (e) { console.error("aria-hidden: cannot operate on ", node, e); } } }); }; deep(parentNode); elementsToKeep.clear(); lockCount++; return function() { hiddenNodes.forEach(function(node) { var counterValue = counterMap.get(node) - 1; var markerValue = markerCounter.get(node) - 1; counterMap.set(node, counterValue); markerCounter.set(node, markerValue); if (!counterValue) { if (!uncontrolledNodes.has(node)) { node.removeAttribute(controlAttribute); } uncontrolledNodes.delete(node); } if (!markerValue) { node.removeAttribute(markerName); } }); lockCount--; if (!lockCount) { counterMap = /* @__PURE__ */ new WeakMap(); counterMap = /* @__PURE__ */ new WeakMap(); uncontrolledNodes = /* @__PURE__ */ new WeakMap(); markerMap = {}; } }; }; var hideOthers = function(originalTarget, parentNode, markerName) { if (markerName === void 0) { markerName = "data-aria-hidden"; } var targets = Array.from(Array.isArray(originalTarget) ? originalTarget : [originalTarget]); var activeParentNode = parentNode || getDefaultParent(originalTarget); if (!activeParentNode) { return function() { return null; }; } targets.push.apply(targets, Array.from(activeParentNode.querySelectorAll("[aria-live], script"))); return applyAttributeToOthers(targets, activeParentNode, markerName, "aria-hidden"); }; // node_modules/@radix-ui/react-dialog/dist/index.mjs var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1); var DIALOG_NAME = "Dialog"; var [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME); var [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME); var Dialog = (props) => { const { __scopeDialog, children, open: openProp, defaultOpen, onOpenChange, modal = true } = props; const triggerRef = React37.useRef(null); const contentRef = React37.useRef(null); const [open2, setOpen] = useControllableState({ prop: openProp, defaultProp: defaultOpen ?? false, onChange: onOpenChange, caller: DIALOG_NAME }); return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)( DialogProvider, { scope: __scopeDialog, triggerRef, contentRef, contentId: useId(), titleId: useId(), descriptionId: useId(), open: open2, onOpenChange: setOpen, onOpenToggle: React37.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]), modal, children } ); }; Dialog.displayName = DIALOG_NAME; var TRIGGER_NAME = "DialogTrigger"; var DialogTrigger = React37.forwardRef( (props, forwardedRef) => { const { __scopeDialog, ...triggerProps } = props; const context2 = useDialogContext(TRIGGER_NAME, __scopeDialog); const composedTriggerRef = useComposedRefs(forwardedRef, context2.triggerRef); return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)( Primitive4.button, { type: "button", "aria-haspopup": "dialog", "aria-expanded": context2.open, "aria-controls": context2.contentId, "data-state": getState(context2.open), ...triggerProps, ref: composedTriggerRef, onClick: composeEventHandlers(props.onClick, context2.onOpenToggle) } ); } ); DialogTrigger.displayName = TRIGGER_NAME; var PORTAL_NAME2 = "DialogPortal"; var [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME2, { forceMount: void 0 }); var DialogPortal = (props) => { const { __scopeDialog, forceMount, children, container } = props; const context2 = useDialogContext(PORTAL_NAME2, __scopeDialog); return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(PortalProvider, { scope: __scopeDialog, forceMount, children: React37.Children.map(children, (child) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Presence, { present: forceMount || context2.open, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Portal, { asChild: true, container, children: child }) })) }); }; DialogPortal.displayName = PORTAL_NAME2; var OVERLAY_NAME = "DialogOverlay"; var DialogOverlay = React37.forwardRef( (props, forwardedRef) => { const portalContext = usePortalContext(OVERLAY_NAME, props.__scopeDialog); const { forceMount = portalContext.forceMount, ...overlayProps } = props; const context2 = useDialogContext(OVERLAY_NAME, props.__scopeDialog); return context2.modal ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Presence, { present: forceMount || context2.open, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DialogOverlayImpl, { ...overlayProps, ref: forwardedRef }) }) : null; } ); DialogOverlay.displayName = OVERLAY_NAME; var Slot = createSlot4("DialogOverlay.RemoveScroll"); var DialogOverlayImpl = React37.forwardRef( (props, forwardedRef) => { const { __scopeDialog, ...overlayProps } = props; const context2 = useDialogContext(OVERLAY_NAME, __scopeDialog); return ( // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll` // ie. when `Overlay` and `Content` are siblings /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Combination_default, { as: Slot, allowPinchZoom: true, shards: [context2.contentRef], children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)( Primitive4.div, { "data-state": getState(context2.open), ...overlayProps, ref: forwardedRef, style: { pointerEvents: "auto", ...overlayProps.style } } ) }) ); } ); var CONTENT_NAME = "DialogContent"; var DialogContent = React37.forwardRef( (props, forwardedRef) => { const portalContext = usePortalContext(CONTENT_NAME, props.__scopeDialog); const { forceMount = portalContext.forceMount, ...contentProps } = props; const context2 = useDialogContext(CONTENT_NAME, props.__scopeDialog); return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Presence, { present: forceMount || context2.open, children: context2.modal ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DialogContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DialogContentNonModal, { ...contentProps, ref: forwardedRef }) }); } ); DialogContent.displayName = CONTENT_NAME; var DialogContentModal = React37.forwardRef( (props, forwardedRef) => { const context2 = useDialogContext(CONTENT_NAME, props.__scopeDialog); const contentRef = React37.useRef(null); const composedRefs = useComposedRefs(forwardedRef, context2.contentRef, contentRef); React37.useEffect(() => { const content = contentRef.current; if (content) return hideOthers(content); }, []); return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)( DialogContentImpl, { ...props, ref: composedRefs, trapFocus: context2.open, disableOutsidePointerEvents: true, onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => { event.preventDefault(); context2.triggerRef.current?.focus(); }), onPointerDownOutside: composeEventHandlers(props.onPointerDownOutside, (event) => { const originalEvent = event.detail.originalEvent; const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true; const isRightClick = originalEvent.button === 2 || ctrlLeftClick; if (isRightClick) event.preventDefault(); }), onFocusOutside: composeEventHandlers( props.onFocusOutside, (event) => event.preventDefault() ) } ); } ); var DialogContentNonModal = React37.forwardRef( (props, forwardedRef) => { const context2 = useDialogContext(CONTENT_NAME, props.__scopeDialog); const hasInteractedOutsideRef = React37.useRef(false); const hasPointerDownOutsideRef = React37.useRef(false); return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)( DialogContentImpl, { ...props, ref: forwardedRef, trapFocus: false, disableOutsidePointerEvents: false, onCloseAutoFocus: (event) => { props.onCloseAutoFocus?.(event); if (!event.defaultPrevented) { if (!hasInteractedOutsideRef.current) context2.triggerRef.current?.focus(); event.preventDefault(); } hasInteractedOutsideRef.current = false; hasPointerDownOutsideRef.current = false; }, onInteractOutside: (event) => { props.onInteractOutside?.(event); if (!event.defaultPrevented) { hasInteractedOutsideRef.current = true; if (event.detail.originalEvent.type === "pointerdown") { hasPointerDownOutsideRef.current = true; } } const target = event.target; const targetIsTrigger = context2.triggerRef.current?.contains(target); if (targetIsTrigger) event.preventDefault(); if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) { event.preventDefault(); } } } ); } ); var DialogContentImpl = React37.forwardRef( (props, forwardedRef) => { const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props; const context2 = useDialogContext(CONTENT_NAME, __scopeDialog); const contentRef = React37.useRef(null); const composedRefs = useComposedRefs(forwardedRef, contentRef); useFocusGuards(); return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)( FocusScope, { asChild: true, loop: true, trapped: trapFocus, onMountAutoFocus: onOpenAutoFocus, onUnmountAutoFocus: onCloseAutoFocus, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)( DismissableLayer, { role: "dialog", id: context2.contentId, "aria-describedby": context2.descriptionId, "aria-labelledby": context2.titleId, "data-state": getState(context2.open), ...contentProps, ref: composedRefs, onDismiss: () => context2.onOpenChange(false) } ) } ), /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(TitleWarning, { titleId: context2.titleId }), /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DescriptionWarning, { contentRef, descriptionId: context2.descriptionId }) ] }) ] }); } ); var TITLE_NAME = "DialogTitle"; var DialogTitle = React37.forwardRef( (props, forwardedRef) => { const { __scopeDialog, ...titleProps } = props; const context2 = useDialogContext(TITLE_NAME, __scopeDialog); return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Primitive4.h2, { id: context2.titleId, ...titleProps, ref: forwardedRef }); } ); DialogTitle.displayName = TITLE_NAME; var DESCRIPTION_NAME = "DialogDescription"; var DialogDescription = React37.forwardRef( (props, forwardedRef) => { const { __scopeDialog, ...descriptionProps } = props; const context2 = useDialogContext(DESCRIPTION_NAME, __scopeDialog); return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Primitive4.p, { id: context2.descriptionId, ...descriptionProps, ref: forwardedRef }); } ); DialogDescription.displayName = DESCRIPTION_NAME; var CLOSE_NAME = "DialogClose"; var DialogClose = React37.forwardRef( (props, forwardedRef) => { const { __scopeDialog, ...closeProps } = props; const context2 = useDialogContext(CLOSE_NAME, __scopeDialog); return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)( Primitive4.button, { type: "button", ...closeProps, ref: forwardedRef, onClick: composeEventHandlers(props.onClick, () => context2.onOpenChange(false)) } ); } ); DialogClose.displayName = CLOSE_NAME; function getState(open2) { return open2 ? "open" : "closed"; } var TITLE_WARNING_NAME = "DialogTitleWarning"; var [WarningProvider, useWarningContext] = createContext2(TITLE_WARNING_NAME, { contentName: CONTENT_NAME, titleName: TITLE_NAME, docsSlug: "dialog" }); var TitleWarning = ({ titleId }) => { const titleWarningContext = useWarningContext(TITLE_WARNING_NAME); const MESSAGE = `\`${titleWarningContext.contentName}\` requires a \`${titleWarningContext.titleName}\` for the component to be accessible for screen reader users. If you want to hide the \`${titleWarningContext.titleName}\`, you can wrap it with our VisuallyHidden component. For more information, see https://radix-ui.com/primitives/docs/components/${titleWarningContext.docsSlug}`; React37.useEffect(() => { if (titleId) { const hasTitle = document.getElementById(titleId); if (!hasTitle) console.error(MESSAGE); } }, [MESSAGE, titleId]); return null; }; var DESCRIPTION_WARNING_NAME = "DialogDescriptionWarning"; var DescriptionWarning = ({ contentRef, descriptionId }) => { const descriptionWarningContext = useWarningContext(DESCRIPTION_WARNING_NAME); const MESSAGE = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${descriptionWarningContext.contentName}}.`; React37.useEffect(() => { const describedById = contentRef.current?.getAttribute("aria-describedby"); if (descriptionId && describedById) { const hasDescription = document.getElementById(descriptionId); if (!hasDescription) console.warn(MESSAGE); } }, [MESSAGE, contentRef, descriptionId]); return null; }; var Root = Dialog; var Portal2 = DialogPortal; var Overlay = DialogOverlay; var Content = DialogContent; // node_modules/cmdk/dist/index.mjs var t = __toESM(require_react(), 1); // node_modules/cmdk/node_modules/@radix-ui/react-primitive/dist/index.mjs var React40 = __toESM(require_react(), 1); var ReactDOM6 = __toESM(require_react_dom(), 1); // node_modules/cmdk/node_modules/@radix-ui/react-slot/dist/index.mjs var React39 = __toESM(require_react(), 1); // node_modules/cmdk/node_modules/@radix-ui/react-compose-refs/dist/index.mjs var React38 = __toESM(require_react(), 1); function setRef6(ref, value) { if (typeof ref === "function") { return ref(value); } else if (ref !== null && ref !== void 0) { ref.current = value; } } function composeRefs6(...refs) { return (node) => { let hasCleanup = false; const cleanups = refs.map((ref) => { const cleanup = setRef6(ref, node); if (!hasCleanup && typeof cleanup == "function") { hasCleanup = true; } return cleanup; }); if (hasCleanup) { return () => { for (let i = 0; i < cleanups.length; i++) { const cleanup = cleanups[i]; if (typeof cleanup == "function") { cleanup(); } else { setRef6(refs[i], null); } } }; } }; } // node_modules/cmdk/node_modules/@radix-ui/react-slot/dist/index.mjs var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1); var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy"); var use = React39[" use ".trim().toString()]; function isPromiseLike(value) { return typeof value === "object" && value !== null && "then" in value; } function isLazyComponent(element) { return element != null && typeof element === "object" && "$$typeof" in element && element.$$typeof === REACT_LAZY_TYPE && "_payload" in element && isPromiseLike(element._payload); } // @__NO_SIDE_EFFECTS__ function createSlot5(ownerName) { const SlotClone = /* @__PURE__ */ createSlotClone5(ownerName); const Slot2 = React39.forwardRef((props, forwardedRef) => { let { children, ...slotProps } = props; if (isLazyComponent(children) && typeof use === "function") { children = use(children._payload); } const childrenArray = React39.Children.toArray(children); const slottable = childrenArray.find(isSlottable5); if (slottable) { const newElement = slottable.props.children; const newChildren = childrenArray.map((child) => { if (child === slottable) { if (React39.Children.count(newElement) > 1) return React39.Children.only(null); return React39.isValidElement(newElement) ? newElement.props.children : null; } else { return child; } }); return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children: React39.isValidElement(newElement) ? React39.cloneElement(newElement, void 0, newChildren) : null }); } return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children }); }); Slot2.displayName = `${ownerName}.Slot`; return Slot2; } // @__NO_SIDE_EFFECTS__ function createSlotClone5(ownerName) { const SlotClone = React39.forwardRef((props, forwardedRef) => { let { children, ...slotProps } = props; if (isLazyComponent(children) && typeof use === "function") { children = use(children._payload); } if (React39.isValidElement(children)) { const childrenRef = getElementRef6(children); const props2 = mergeProps5(slotProps, children.props); if (children.type !== React39.Fragment) { props2.ref = forwardedRef ? composeRefs6(forwardedRef, childrenRef) : childrenRef; } return React39.cloneElement(children, props2); } return React39.Children.count(children) > 1 ? React39.Children.only(null) : null; }); SlotClone.displayName = `${ownerName}.SlotClone`; return SlotClone; } var SLOTTABLE_IDENTIFIER5 = /* @__PURE__ */ Symbol("radix.slottable"); function isSlottable5(child) { return React39.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER5; } function mergeProps5(slotProps, childProps) { const overrideProps = { ...childProps }; for (const propName in childProps) { const slotPropValue = slotProps[propName]; const childPropValue = childProps[propName]; const isHandler = /^on[A-Z]/.test(propName); if (isHandler) { if (slotPropValue && childPropValue) { overrideProps[propName] = (...args) => { const result = childPropValue(...args); slotPropValue(...args); return result; }; } else if (slotPropValue) { overrideProps[propName] = slotPropValue; } } else if (propName === "style") { overrideProps[propName] = { ...slotPropValue, ...childPropValue }; } else if (propName === "className") { overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" "); } } return { ...slotProps, ...overrideProps }; } function getElementRef6(element) { let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get; let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning; if (mayWarn) { return element.ref; } getter = Object.getOwnPropertyDescriptor(element, "ref")?.get; mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning; if (mayWarn) { return element.props.ref; } return element.props.ref || element.ref; } // node_modules/cmdk/node_modules/@radix-ui/react-primitive/dist/index.mjs var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1); var NODES5 = [ "a", "button", "div", "form", "h2", "h3", "img", "input", "label", "li", "nav", "ol", "p", "select", "span", "svg", "ul" ]; var Primitive5 = NODES5.reduce((primitive, node) => { const Slot2 = createSlot5(`Primitive.${node}`); const Node2 = React40.forwardRef((props, forwardedRef) => { const { asChild, ...primitiveProps } = props; const Comp = asChild ? Slot2 : node; if (typeof window !== "undefined") { window[/* @__PURE__ */ Symbol.for("radix-ui")] = true; } return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Comp, { ...primitiveProps, ref: forwardedRef }); }); Node2.displayName = `Primitive.${node}`; return { ...primitive, [node]: Node2 }; }, {}); // node_modules/cmdk/node_modules/@radix-ui/react-id/dist/index.mjs var React42 = __toESM(require_react(), 1); // node_modules/cmdk/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs var React41 = __toESM(require_react(), 1); var useLayoutEffect24 = globalThis?.document ? React41.useLayoutEffect : () => { }; // node_modules/cmdk/node_modules/@radix-ui/react-id/dist/index.mjs var useReactId2 = React42[" useId ".trim().toString()] || (() => void 0); var count3 = 0; function useId2(deterministicId) { const [id, setId] = React42.useState(useReactId2()); useLayoutEffect24(() => { if (!deterministicId) setId((reactId) => reactId ?? String(count3++)); }, [deterministicId]); return deterministicId || (id ? `radix-${id}` : ""); } // node_modules/cmdk/dist/index.mjs var N = '[cmdk-group=""]'; var Y2 = '[cmdk-group-items=""]'; var be = '[cmdk-group-heading=""]'; var le = '[cmdk-item=""]'; var ce = `${le}:not([aria-disabled="true"])`; var Z = "cmdk-item-select"; var T = "data-value"; var Re = (r2, o, n) => W(r2, o, n); var ue = t.createContext(void 0); var K2 = () => t.useContext(ue); var de = t.createContext(void 0); var ee = () => t.useContext(de); var fe = t.createContext(void 0); var me = t.forwardRef((r2, o) => { let n = L(() => { var e, a; return { search: "", value: (a = (e = r2.value) != null ? e : r2.defaultValue) != null ? a : "", selectedItemId: void 0, filtered: { count: 0, items: /* @__PURE__ */ new Map(), groups: /* @__PURE__ */ new Set() } }; }), u2 = L(() => /* @__PURE__ */ new Set()), c = L(() => /* @__PURE__ */ new Map()), d = L(() => /* @__PURE__ */ new Map()), f = L(() => /* @__PURE__ */ new Set()), p2 = pe(r2), { label: b, children: m2, value: R, onValueChange: x, filter: C, shouldFilter: S, loop: A, disablePointerSelection: ge = false, vimBindings: j = true, ...O } = r2, $2 = useId2(), q = useId2(), _ = useId2(), I = t.useRef(null), v = ke(); k2(() => { if (R !== void 0) { let e = R.trim(); n.current.value = e, E.emit(); } }, [R]), k2(() => { v(6, ne); }, []); let E = t.useMemo(() => ({ subscribe: (e) => (f.current.add(e), () => f.current.delete(e)), snapshot: () => n.current, setState: (e, a, s) => { var i, l, g, y; if (!Object.is(n.current[e], a)) { if (n.current[e] = a, e === "search") J2(), z(), v(1, W2); else if (e === "value") { if (document.activeElement.hasAttribute("cmdk-input") || document.activeElement.hasAttribute("cmdk-root")) { let h = document.getElementById(_); h ? h.focus() : (i = document.getElementById($2)) == null || i.focus(); } if (v(7, () => { var h; n.current.selectedItemId = (h = M()) == null ? void 0 : h.id, E.emit(); }), s || v(5, ne), ((l = p2.current) == null ? void 0 : l.value) !== void 0) { let h = a != null ? a : ""; (y = (g = p2.current).onValueChange) == null || y.call(g, h); return; } } E.emit(); } }, emit: () => { f.current.forEach((e) => e()); } }), []), U2 = t.useMemo(() => ({ value: (e, a, s) => { var i; a !== ((i = d.current.get(e)) == null ? void 0 : i.value) && (d.current.set(e, { value: a, keywords: s }), n.current.filtered.items.set(e, te(a, s)), v(2, () => { z(), E.emit(); })); }, item: (e, a) => (u2.current.add(e), a && (c.current.has(a) ? c.current.get(a).add(e) : c.current.set(a, /* @__PURE__ */ new Set([e]))), v(3, () => { J2(), z(), n.current.value || W2(), E.emit(); }), () => { d.current.delete(e), u2.current.delete(e), n.current.filtered.items.delete(e); let s = M(); v(4, () => { J2(), (s == null ? void 0 : s.getAttribute("id")) === e && W2(), E.emit(); }); }), group: (e) => (c.current.has(e) || c.current.set(e, /* @__PURE__ */ new Set()), () => { d.current.delete(e), c.current.delete(e); }), filter: () => p2.current.shouldFilter, label: b || r2["aria-label"], getDisablePointerSelection: () => p2.current.disablePointerSelection, listId: $2, inputId: _, labelId: q, listInnerRef: I }), []); function te(e, a) { var i, l; let s = (l = (i = p2.current) == null ? void 0 : i.filter) != null ? l : Re; return e ? s(e, n.current.search, a) : 0; } function z() { if (!n.current.search || p2.current.shouldFilter === false) return; let e = n.current.filtered.items, a = []; n.current.filtered.groups.forEach((i) => { let l = c.current.get(i), g = 0; l.forEach((y) => { let h = e.get(y); g = Math.max(h, g); }), a.push([i, g]); }); let s = I.current; V().sort((i, l) => { var h, F; let g = i.getAttribute("id"), y = l.getAttribute("id"); return ((h = e.get(y)) != null ? h : 0) - ((F = e.get(g)) != null ? F : 0); }).forEach((i) => { let l = i.closest(Y2); l ? l.appendChild(i.parentElement === l ? i : i.closest(`${Y2} > *`)) : s.appendChild(i.parentElement === s ? i : i.closest(`${Y2} > *`)); }), a.sort((i, l) => l[1] - i[1]).forEach((i) => { var g; let l = (g = I.current) == null ? void 0 : g.querySelector(`${N}[${T}="${encodeURIComponent(i[0])}"]`); l == null || l.parentElement.appendChild(l); }); } function W2() { let e = V().find((s) => s.getAttribute("aria-disabled") !== "true"), a = e == null ? void 0 : e.getAttribute(T); E.setState("value", a || void 0); } function J2() { var a, s, i, l; if (!n.current.search || p2.current.shouldFilter === false) { n.current.filtered.count = u2.current.size; return; } n.current.filtered.groups = /* @__PURE__ */ new Set(); let e = 0; for (let g of u2.current) { let y = (s = (a = d.current.get(g)) == null ? void 0 : a.value) != null ? s : "", h = (l = (i = d.current.get(g)) == null ? void 0 : i.keywords) != null ? l : [], F = te(y, h); n.current.filtered.items.set(g, F), F > 0 && e++; } for (let [g, y] of c.current) for (let h of y) if (n.current.filtered.items.get(h) > 0) { n.current.filtered.groups.add(g); break; } n.current.filtered.count = e; } function ne() { var a, s, i; let e = M(); e && (((a = e.parentElement) == null ? void 0 : a.firstChild) === e && ((i = (s = e.closest(N)) == null ? void 0 : s.querySelector(be)) == null || i.scrollIntoView({ block: "nearest" })), e.scrollIntoView({ block: "nearest" })); } function M() { var e; return (e = I.current) == null ? void 0 : e.querySelector(`${le}[aria-selected="true"]`); } function V() { var e; return Array.from(((e = I.current) == null ? void 0 : e.querySelectorAll(ce)) || []); } function X2(e) { let s = V()[e]; s && E.setState("value", s.getAttribute(T)); } function Q(e) { var g; let a = M(), s = V(), i = s.findIndex((y) => y === a), l = s[i + e]; (g = p2.current) != null && g.loop && (l = i + e < 0 ? s[s.length - 1] : i + e === s.length ? s[0] : s[i + e]), l && E.setState("value", l.getAttribute(T)); } function re(e) { let a = M(), s = a == null ? void 0 : a.closest(N), i; for (; s && !i; ) s = e > 0 ? we(s, N) : De(s, N), i = s == null ? void 0 : s.querySelector(ce); i ? E.setState("value", i.getAttribute(T)) : Q(e); } let oe = () => X2(V().length - 1), ie = (e) => { e.preventDefault(), e.metaKey ? oe() : e.altKey ? re(1) : Q(1); }, se = (e) => { e.preventDefault(), e.metaKey ? X2(0) : e.altKey ? re(-1) : Q(-1); }; return t.createElement(Primitive5.div, { ref: o, tabIndex: -1, ...O, "cmdk-root": "", onKeyDown: (e) => { var s; (s = O.onKeyDown) == null || s.call(O, e); let a = e.nativeEvent.isComposing || e.keyCode === 229; if (!(e.defaultPrevented || a)) switch (e.key) { case "n": case "j": { j && e.ctrlKey && ie(e); break; } case "ArrowDown": { ie(e); break; } case "p": case "k": { j && e.ctrlKey && se(e); break; } case "ArrowUp": { se(e); break; } case "Home": { e.preventDefault(), X2(0); break; } case "End": { e.preventDefault(), oe(); break; } case "Enter": { e.preventDefault(); let i = M(); if (i) { let l = new Event(Z); i.dispatchEvent(l); } } } } }, t.createElement("label", { "cmdk-label": "", htmlFor: U2.inputId, id: U2.labelId, style: Te }, b), B2(r2, (e) => t.createElement(de.Provider, { value: E }, t.createElement(ue.Provider, { value: U2 }, e)))); }); var he = t.forwardRef((r2, o) => { var _, I; let n = useId2(), u2 = t.useRef(null), c = t.useContext(fe), d = K2(), f = pe(r2), p2 = (I = (_ = f.current) == null ? void 0 : _.forceMount) != null ? I : c == null ? void 0 : c.forceMount; k2(() => { if (!p2) return d.item(n, c == null ? void 0 : c.id); }, [p2]); let b = ve(n, u2, [r2.value, r2.children, u2], r2.keywords), m2 = ee(), R = P((v) => v.value && v.value === b.current), x = P((v) => p2 || d.filter() === false ? true : v.search ? v.filtered.items.get(n) > 0 : true); t.useEffect(() => { let v = u2.current; if (!(!v || r2.disabled)) return v.addEventListener(Z, C), () => v.removeEventListener(Z, C); }, [x, r2.onSelect, r2.disabled]); function C() { var v, E; S(), (E = (v = f.current).onSelect) == null || E.call(v, b.current); } function S() { m2.setState("value", b.current, true); } if (!x) return null; let { disabled: A, value: ge, onSelect: j, forceMount: O, keywords: $2, ...q } = r2; return t.createElement(Primitive5.div, { ref: composeRefs6(u2, o), ...q, id: n, "cmdk-item": "", role: "option", "aria-disabled": !!A, "aria-selected": !!R, "data-disabled": !!A, "data-selected": !!R, onPointerMove: A || d.getDisablePointerSelection() ? void 0 : S, onClick: A ? void 0 : C }, r2.children); }); var Ee = t.forwardRef((r2, o) => { let { heading: n, children: u2, forceMount: c, ...d } = r2, f = useId2(), p2 = t.useRef(null), b = t.useRef(null), m2 = useId2(), R = K2(), x = P((S) => c || R.filter() === false ? true : S.search ? S.filtered.groups.has(f) : true); k2(() => R.group(f), []), ve(f, p2, [r2.value, r2.heading, b]); let C = t.useMemo(() => ({ id: f, forceMount: c }), [c]); return t.createElement(Primitive5.div, { ref: composeRefs6(p2, o), ...d, "cmdk-group": "", role: "presentation", hidden: x ? void 0 : true }, n && t.createElement("div", { ref: b, "cmdk-group-heading": "", "aria-hidden": true, id: m2 }, n), B2(r2, (S) => t.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": n ? m2 : void 0 }, t.createElement(fe.Provider, { value: C }, S)))); }); var ye = t.forwardRef((r2, o) => { let { alwaysRender: n, ...u2 } = r2, c = t.useRef(null), d = P((f) => !f.search); return !n && !d ? null : t.createElement(Primitive5.div, { ref: composeRefs6(c, o), ...u2, "cmdk-separator": "", role: "separator" }); }); var Se = t.forwardRef((r2, o) => { let { onValueChange: n, ...u2 } = r2, c = r2.value != null, d = ee(), f = P((m2) => m2.search), p2 = P((m2) => m2.selectedItemId), b = K2(); return t.useEffect(() => { r2.value != null && d.setState("search", r2.value); }, [r2.value]), t.createElement(Primitive5.input, { ref: o, ...u2, "cmdk-input": "", autoComplete: "off", autoCorrect: "off", spellCheck: false, "aria-autocomplete": "list", role: "combobox", "aria-expanded": true, "aria-controls": b.listId, "aria-labelledby": b.labelId, "aria-activedescendant": p2, id: b.inputId, type: "text", value: c ? r2.value : f, onChange: (m2) => { c || d.setState("search", m2.target.value), n == null || n(m2.target.value); } }); }); var Ce = t.forwardRef((r2, o) => { let { children: n, label: u2 = "Suggestions", ...c } = r2, d = t.useRef(null), f = t.useRef(null), p2 = P((m2) => m2.selectedItemId), b = K2(); return t.useEffect(() => { if (f.current && d.current) { let m2 = f.current, R = d.current, x, C = new ResizeObserver(() => { x = requestAnimationFrame(() => { let S = m2.offsetHeight; R.style.setProperty("--cmdk-list-height", S.toFixed(1) + "px"); }); }); return C.observe(m2), () => { cancelAnimationFrame(x), C.unobserve(m2); }; } }, []), t.createElement(Primitive5.div, { ref: composeRefs6(d, o), ...c, "cmdk-list": "", role: "listbox", tabIndex: -1, "aria-activedescendant": p2, "aria-label": u2, id: b.listId }, B2(r2, (m2) => t.createElement("div", { ref: composeRefs6(f, b.listInnerRef), "cmdk-list-sizer": "" }, m2))); }); var xe = t.forwardRef((r2, o) => { let { open: n, onOpenChange: u2, overlayClassName: c, contentClassName: d, container: f, ...p2 } = r2; return t.createElement(Root, { open: n, onOpenChange: u2 }, t.createElement(Portal2, { container: f }, t.createElement(Overlay, { "cmdk-overlay": "", className: c }), t.createElement(Content, { "aria-label": r2.label, "cmdk-dialog": "", className: d }, t.createElement(me, { ref: o, ...p2 })))); }); var Ie = t.forwardRef((r2, o) => P((u2) => u2.filtered.count === 0) ? t.createElement(Primitive5.div, { ref: o, ...r2, "cmdk-empty": "", role: "presentation" }) : null); var Pe = t.forwardRef((r2, o) => { let { progress: n, children: u2, label: c = "Loading...", ...d } = r2; return t.createElement(Primitive5.div, { ref: o, ...d, "cmdk-loading": "", role: "progressbar", "aria-valuenow": n, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": c }, B2(r2, (f) => t.createElement("div", { "aria-hidden": true }, f))); }); var _e = Object.assign(me, { List: Ce, Item: he, Input: Se, Group: Ee, Separator: ye, Dialog: xe, Empty: Ie, Loading: Pe }); function we(r2, o) { let n = r2.nextElementSibling; for (; n; ) { if (n.matches(o)) return n; n = n.nextElementSibling; } } function De(r2, o) { let n = r2.previousElementSibling; for (; n; ) { if (n.matches(o)) return n; n = n.previousElementSibling; } } function pe(r2) { let o = t.useRef(r2); return k2(() => { o.current = r2; }), o; } var k2 = typeof window == "undefined" ? t.useEffect : t.useLayoutEffect; function L(r2) { let o = t.useRef(); return o.current === void 0 && (o.current = r2()), o; } function P(r2) { let o = ee(), n = () => r2(o.snapshot()); return t.useSyncExternalStore(o.subscribe, n, n); } function ve(r2, o, n, u2 = []) { let c = t.useRef(), d = K2(); return k2(() => { var b; let f = (() => { var m2; for (let R of n) { if (typeof R == "string") return R.trim(); if (typeof R == "object" && "current" in R) return R.current ? (m2 = R.current.textContent) == null ? void 0 : m2.trim() : c.current; } })(), p2 = u2.map((m2) => m2.trim()); d.value(r2, f, p2), (b = o.current) == null || b.setAttribute(T, f), c.current = f; }), c; } var ke = () => { let [r2, o] = t.useState(), n = L(() => /* @__PURE__ */ new Map()); return k2(() => { n.current.forEach((u2) => u2()), n.current = /* @__PURE__ */ new Map(); }, [r2]), (u2, c) => { n.current.set(u2, c), o({}); }; }; function Me(r2) { let o = r2.type; return typeof o == "function" ? o(r2.props) : "render" in o ? o.render(r2.props) : r2; } function B2({ asChild: r2, children: o }, n) { return r2 && t.isValidElement(o) ? t.cloneElement(Me(o), { ref: o.ref }, n(o.props.children)) : n(o); } var Te = { position: "absolute", width: "1px", height: "1px", padding: "0", margin: "-1px", overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0" }; // node_modules/clsx/dist/clsx.mjs function r(e) { var t2, f, n = ""; if ("string" == typeof e || "number" == typeof e) n += e; else if ("object" == typeof e) if (Array.isArray(e)) { var o = e.length; for (t2 = 0; t2 < o; t2++) e[t2] && (f = r(e[t2])) && (n && (n += " "), n += f); } else for (f in e) e[f] && (n && (n += " "), n += f); return n; } function clsx() { for (var e, t2, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t2 = r(e)) && (n && (n += " "), n += t2); return n; } var clsx_default = clsx; // packages/commands/build-module/components/command-menu.mjs var import_data4 = __toESM(require_data(), 1); var import_element2 = __toESM(require_element(), 1); var import_i18n = __toESM(require_i18n(), 1); var import_components = __toESM(require_components(), 1); var import_keyboard_shortcuts = __toESM(require_keyboard_shortcuts(), 1); // packages/icons/build-module/icon/index.mjs var import_element = __toESM(require_element(), 1); var icon_default = (0, import_element.forwardRef)( ({ icon, size = 24, ...props }, ref) => { return (0, import_element.cloneElement)(icon, { width: size, height: size, ...props, ref }); } ); // packages/icons/build-module/library/arrow-right.mjs var import_primitives = __toESM(require_primitives(), 1); var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1); var arrow_right_default = /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_primitives.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_primitives.Path, { d: "m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z" }) }); // packages/icons/build-module/library/search.mjs var import_primitives2 = __toESM(require_primitives(), 1); var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1); var search_default = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_primitives2.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_primitives2.Path, { d: "M13 5c-3.3 0-6 2.7-6 6 0 1.4.5 2.7 1.3 3.7l-3.8 3.8 1.1 1.1 3.8-3.8c1 .8 2.3 1.3 3.7 1.3 3.3 0 6-2.7 6-6S16.3 5 13 5zm0 10.5c-2.5 0-4.5-2-4.5-4.5s2-4.5 4.5-4.5 4.5 2 4.5 4.5-2 4.5-4.5 4.5z" }) }); // packages/commands/build-module/store/index.mjs var import_data3 = __toESM(require_data(), 1); // packages/commands/build-module/store/reducer.mjs var import_data = __toESM(require_data(), 1); function commands(state = {}, action) { switch (action.type) { case "REGISTER_COMMAND": return { ...state, [action.name]: { name: action.name, label: action.label, searchLabel: action.searchLabel, context: action.context, category: action.category, callback: action.callback, icon: action.icon, keywords: action.keywords } }; case "UNREGISTER_COMMAND": { const { [action.name]: _, ...remainingState } = state; return remainingState; } } return state; } function commandLoaders(state = {}, action) { switch (action.type) { case "REGISTER_COMMAND_LOADER": return { ...state, [action.name]: { name: action.name, context: action.context, category: action.category, hook: action.hook } }; case "UNREGISTER_COMMAND_LOADER": { const { [action.name]: _, ...remainingState } = state; return remainingState; } } return state; } function isOpen(state = false, action) { switch (action.type) { case "OPEN": return true; case "CLOSE": return false; } return state; } function context(state = "root", action) { switch (action.type) { case "SET_CONTEXT": return action.context; } return state; } var reducer = (0, import_data.combineReducers)({ commands, commandLoaders, isOpen, context }); var reducer_default = reducer; // packages/commands/build-module/store/actions.mjs var actions_exports = {}; __export(actions_exports, { close: () => close, open: () => open, registerCommand: () => registerCommand, registerCommandLoader: () => registerCommandLoader, unregisterCommand: () => unregisterCommand, unregisterCommandLoader: () => unregisterCommandLoader }); var REGISTERABLE_CATEGORIES = /* @__PURE__ */ new Set([ "command", "view", "edit", "action" ]); function registerCommand(config) { let { category } = config; if (!category || !REGISTERABLE_CATEGORIES.has(category)) { category = "action"; } return { type: "REGISTER_COMMAND", ...config, category }; } function unregisterCommand(name) { return { type: "UNREGISTER_COMMAND", name }; } function registerCommandLoader(config) { let { category } = config; if (!category || !REGISTERABLE_CATEGORIES.has(category)) { category = "action"; } return { type: "REGISTER_COMMAND_LOADER", ...config, category }; } function unregisterCommandLoader(name) { return { type: "UNREGISTER_COMMAND_LOADER", name }; } function open() { return { type: "OPEN" }; } function close() { return { type: "CLOSE" }; } // packages/commands/build-module/store/selectors.mjs var selectors_exports = {}; __export(selectors_exports, { getCommandLoaders: () => getCommandLoaders, getCommands: () => getCommands, getContext: () => getContext, isOpen: () => isOpen2 }); var import_data2 = __toESM(require_data(), 1); var getCommands = (0, import_data2.createSelector)( (state, contextual = false) => Object.values(state.commands).filter((command) => { const isContextual = command.context && command.context === state.context; return contextual ? isContextual : !isContextual; }), (state) => [state.commands, state.context] ); var getCommandLoaders = (0, import_data2.createSelector)( (state, contextual = false) => Object.values(state.commandLoaders).filter((loader) => { const isContextual = loader.context && loader.context === state.context; return contextual ? isContextual : !isContextual; }), (state) => [state.commandLoaders, state.context] ); function isOpen2(state) { return state.isOpen; } function getContext(state) { return state.context; } // packages/commands/build-module/store/private-actions.mjs var private_actions_exports = {}; __export(private_actions_exports, { setContext: () => setContext }); function setContext(context2) { return { type: "SET_CONTEXT", context: context2 }; } // packages/commands/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/commands" ); // packages/commands/build-module/store/index.mjs var STORE_NAME = "core/commands"; var store = (0, import_data3.createReduxStore)(STORE_NAME, { reducer: reducer_default, actions: actions_exports, selectors: selectors_exports }); (0, import_data3.register)(store); unlock(store).registerPrivateActions(private_actions_exports); // packages/commands/build-module/components/command-menu.mjs var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1); var { withIgnoreIMEEvents } = unlock(import_components.privateApis); var inputLabel = (0, import_i18n.__)("Search commands and settings"); var CATEGORY_ICONS = { view: arrow_right_default }; var CATEGORY_LABELS = { command: (0, import_i18n.__)("Command"), view: (0, import_i18n.__)("View"), edit: (0, import_i18n.__)("Edit"), action: (0, import_i18n.__)("Action"), workflow: (0, import_i18n.__)("Workflow") }; function isValidIcon(icon) { return !!icon && (typeof icon === "string" || (0, import_element2.isValidElement)(icon) || typeof icon === "function" || icon instanceof import_element2.Component); } function CommandMenuLoader({ name, search, hook, setLoader, close: close2, category }) { const { isLoading, commands: commands2 = [] } = hook({ search }) ?? {}; (0, import_element2.useEffect)(() => { setLoader(name, isLoading); }, [setLoader, name, isLoading]); if (!commands2.length) { return null; } return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_jsx_runtime18.Fragment, { children: commands2.map((command) => { const commandCategory = command.category ?? category; return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)( _e.Item, { value: command.searchLabel ?? command.label, keywords: command.keywords, onSelect: () => command.callback({ close: close2 }), id: command.name, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)( import_components.__experimentalHStack, { alignment: "left", className: clsx_default("commands-command-menu__item", { "has-icon": CATEGORY_ICONS[commandCategory] || command.icon }), children: [ CATEGORY_ICONS[commandCategory] && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)( icon_default, { icon: CATEGORY_ICONS[commandCategory] } ), !CATEGORY_ICONS[commandCategory] && isValidIcon(command.icon) && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(icon_default, { icon: command.icon }), /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "commands-command-menu__item-label", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)( import_components.TextHighlight, { text: command.label, highlight: search } ) }), CATEGORY_LABELS[commandCategory] && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "commands-command-menu__item-category", children: CATEGORY_LABELS[commandCategory] }) ] } ) }, command.name ); }) }); } function CommandMenuLoaderWrapper({ hook, search, setLoader, close: close2, category }) { const currentLoaderRef = (0, import_element2.useRef)(hook); const [key, setKey] = (0, import_element2.useState)(0); (0, import_element2.useEffect)(() => { if (currentLoaderRef.current !== hook) { currentLoaderRef.current = hook; setKey((prevKey) => prevKey + 1); } }, [hook]); return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)( CommandMenuLoader, { hook: currentLoaderRef.current, search, setLoader, close: close2, category }, key ); } function CommandMenuGroup({ isContextual, search, setLoader, close: close2 }) { const { commands: commands2, loaders } = (0, import_data4.useSelect)( (select) => { const { getCommands: getCommands2, getCommandLoaders: getCommandLoaders2 } = select(store); return { commands: getCommands2(isContextual), loaders: getCommandLoaders2(isContextual) }; }, [isContextual] ); if (!commands2.length && !loaders.length) { return null; } return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(_e.Group, { children: [ commands2.map((command) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)( _e.Item, { value: command.searchLabel ?? command.label, keywords: command.keywords, onSelect: () => command.callback({ close: close2 }), id: command.name, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)( import_components.__experimentalHStack, { alignment: "left", className: clsx_default("commands-command-menu__item", { "has-icon": CATEGORY_ICONS[command.category] || command.icon }), children: [ CATEGORY_ICONS[command.category] ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(icon_default, { icon: CATEGORY_ICONS[command.category] }) : command.icon && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(icon_default, { icon: command.icon }), /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)( import_components.TextHighlight, { text: command.label, highlight: search } ) }), CATEGORY_LABELS[command.category] && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "commands-command-menu__item-category", children: CATEGORY_LABELS[command.category] }) ] } ) }, command.name )), loaders.map((loader) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)( CommandMenuLoaderWrapper, { hook: loader.hook, search, setLoader, close: close2, category: loader.category }, loader.name )) ] }); } function CommandInput({ isOpen: isOpen3, search, setSearch }) { const commandMenuInput = (0, import_element2.useRef)(); const _value = P((state) => state.value); const selectedItemId = (0, import_element2.useMemo)(() => { const item = document.querySelector( `[cmdk-item=""][data-value="${_value}"]` ); return item?.getAttribute("id"); }, [_value]); (0, import_element2.useEffect)(() => { if (isOpen3) { commandMenuInput.current.focus(); } }, [isOpen3]); return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)( _e.Input, { ref: commandMenuInput, value: search, onValueChange: setSearch, placeholder: inputLabel, "aria-activedescendant": selectedItemId } ); } function CommandMenu() { const { registerShortcut } = (0, import_data4.useDispatch)(import_keyboard_shortcuts.store); const [search, setSearch] = (0, import_element2.useState)(""); const isOpen3 = (0, import_data4.useSelect)( (select) => select(store).isOpen(), [] ); const { open: open2, close: close2 } = (0, import_data4.useDispatch)(store); const [loaders, setLoaders] = (0, import_element2.useState)({}); (0, import_element2.useEffect)(() => { registerShortcut({ name: "core/commands", category: "global", description: (0, import_i18n.__)("Open the command palette."), keyCombination: { modifier: "primary", character: "k" } }); }, [registerShortcut]); (0, import_keyboard_shortcuts.useShortcut)( "core/commands", /** @type {React.KeyboardEventHandler} */ withIgnoreIMEEvents((event) => { if (event.defaultPrevented) { return; } event.preventDefault(); if (isOpen3) { close2(); } else { open2(); } }), { bindGlobal: true } ); const setLoader = (0, import_element2.useCallback)( (name, value) => setLoaders((current) => ({ ...current, [name]: value })), [] ); const closeAndReset = () => { setSearch(""); close2(); }; if (!isOpen3) { return false; } const isLoading = Object.values(loaders).some(Boolean); return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)( import_components.Modal, { className: "commands-command-menu", overlayClassName: "commands-command-menu__overlay", onRequestClose: closeAndReset, __experimentalHideHeader: true, contentLabel: (0, import_i18n.__)("Command palette"), children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "commands-command-menu__container", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(_e, { label: inputLabel, children: [ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "commands-command-menu__header", children: [ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)( icon_default, { className: "commands-command-menu__header-search-icon", icon: search_default } ), /* @__PURE__ */ (0, import_jsx_runtime18.jsx)( CommandInput, { search, setSearch, isOpen: isOpen3 } ) ] }), /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(_e.List, { label: (0, import_i18n.__)("Command suggestions"), children: [ search && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(_e.Empty, { children: (0, import_i18n.__)("No results found.") }), /* @__PURE__ */ (0, import_jsx_runtime18.jsx)( CommandMenuGroup, { search, setLoader, close: closeAndReset, isContextual: true } ), search && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)( CommandMenuGroup, { search, setLoader, close: closeAndReset } ) ] }) ] }) }) } ); } // packages/commands/build-module/hooks/use-command-context.mjs var import_element3 = __toESM(require_element(), 1); var import_data5 = __toESM(require_data(), 1); function useCommandContext(context2) { const { getContext: getContext2 } = (0, import_data5.useSelect)(store); const initialContext = (0, import_element3.useRef)(getContext2()); const { setContext: setContext2 } = unlock((0, import_data5.useDispatch)(store)); (0, import_element3.useEffect)(() => { setContext2(context2); }, [context2, setContext2]); (0, import_element3.useEffect)(() => { const initialContextRef = initialContext.current; return () => setContext2(initialContextRef); }, [setContext2]); } // packages/commands/build-module/private-apis.mjs var privateApis = {}; lock(privateApis, { useCommandContext }); // packages/commands/build-module/hooks/use-command.mjs var import_element4 = __toESM(require_element(), 1); var import_data6 = __toESM(require_data(), 1); function useCommand(command) { const { registerCommand: registerCommand2, unregisterCommand: unregisterCommand2 } = (0, import_data6.useDispatch)(store); const currentCallbackRef = (0, import_element4.useRef)(command.callback); (0, import_element4.useEffect)(() => { currentCallbackRef.current = command.callback; }, [command.callback]); (0, import_element4.useEffect)(() => { if (command.disabled) { return; } registerCommand2({ name: command.name, context: command.context, category: command.category, label: command.label, searchLabel: command.searchLabel, icon: command.icon, keywords: command.keywords, callback: (...args) => currentCallbackRef.current(...args) }); return () => { unregisterCommand2(command.name); }; }, [ command.name, command.label, command.searchLabel, command.icon, command.context, command.category, command.keywords, command.disabled, registerCommand2, unregisterCommand2 ]); } function useCommands(commands2) { const { registerCommand: registerCommand2, unregisterCommand: unregisterCommand2 } = (0, import_data6.useDispatch)(store); const currentCallbacksRef = (0, import_element4.useRef)({}); (0, import_element4.useEffect)(() => { if (!commands2) { return; } commands2.forEach((command) => { if (command.callback) { currentCallbacksRef.current[command.name] = command.callback; } }); }, [commands2]); (0, import_element4.useEffect)(() => { if (!commands2) { return; } commands2.forEach((command) => { if (command.disabled) { return; } registerCommand2({ name: command.name, context: command.context, category: command.category, label: command.label, searchLabel: command.searchLabel, icon: command.icon, keywords: command.keywords, callback: (...args) => { const callback = currentCallbacksRef.current[command.name]; if (callback) { callback(...args); } } }); }); return () => { commands2.forEach((command) => { unregisterCommand2(command.name); }); }; }, [commands2, registerCommand2, unregisterCommand2]); } // packages/commands/build-module/hooks/use-command-loader.mjs var import_element5 = __toESM(require_element(), 1); var import_data7 = __toESM(require_data(), 1); function useCommandLoader(loader) { const { registerCommandLoader: registerCommandLoader2, unregisterCommandLoader: unregisterCommandLoader2 } = (0, import_data7.useDispatch)(store); (0, import_element5.useEffect)(() => { if (loader.disabled) { return; } registerCommandLoader2({ name: loader.name, hook: loader.hook, context: loader.context, category: loader.category }); return () => { unregisterCommandLoader2(loader.name); }; }, [ loader.name, loader.hook, loader.context, loader.category, loader.disabled, registerCommandLoader2, unregisterCommandLoader2 ]); } return __toCommonJS(index_exports); })(); block-serialization-spec-parser.js 0000644 00000144755 15206720414 0013312 0 ustar 00 "use strict"; var wp; (wp ||= {}).blockSerializationSpecParser = (() => { var __getOwnPropNames = Object.getOwnPropertyNames; var __commonJS = (cb, mod) => function __require() { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; // packages/block-serialization-spec-parser/parser.js var require_parser = __commonJS({ "packages/block-serialization-spec-parser/parser.js"(exports, module) { function peg$subclass(child, parent) { function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); } function peg$SyntaxError(message, expected, found, location) { this.message = message; this.expected = expected; this.found = found; this.location = location; this.name = "SyntaxError"; if (typeof Error.captureStackTrace === "function") { Error.captureStackTrace(this, peg$SyntaxError); } } peg$subclass(peg$SyntaxError, Error); peg$SyntaxError.buildMessage = function(expected, found) { var DESCRIBE_EXPECTATION_FNS = { literal: function(expectation) { return '"' + literalEscape(expectation.text) + '"'; }, "class": function(expectation) { var escapedParts = "", i; for (i = 0; i < expectation.parts.length; i++) { escapedParts += expectation.parts[i] instanceof Array ? classEscape(expectation.parts[i][0]) + "-" + classEscape(expectation.parts[i][1]) : classEscape(expectation.parts[i]); } return "[" + (expectation.inverted ? "^" : "") + escapedParts + "]"; }, any: function(expectation) { return "any character"; }, end: function(expectation) { return "end of input"; }, other: function(expectation) { return expectation.description; } }; function hex(ch) { return ch.charCodeAt(0).toString(16).toUpperCase(); } function literalEscape(s) { return s.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, function(ch) { return "\\x0" + hex(ch); }).replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return "\\x" + hex(ch); }); } function classEscape(s) { return s.replace(/\\/g, "\\\\").replace(/\]/g, "\\]").replace(/\^/g, "\\^").replace(/-/g, "\\-").replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, function(ch) { return "\\x0" + hex(ch); }).replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return "\\x" + hex(ch); }); } function describeExpectation(expectation) { return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation); } function describeExpected(expected2) { var descriptions = new Array(expected2.length), i, j; for (i = 0; i < expected2.length; i++) { descriptions[i] = describeExpectation(expected2[i]); } descriptions.sort(); if (descriptions.length > 0) { for (i = 1, j = 1; i < descriptions.length; i++) { if (descriptions[i - 1] !== descriptions[i]) { descriptions[j] = descriptions[i]; j++; } } descriptions.length = j; } switch (descriptions.length) { case 1: return descriptions[0]; case 2: return descriptions[0] + " or " + descriptions[1]; default: return descriptions.slice(0, -1).join(", ") + ", or " + descriptions[descriptions.length - 1]; } } function describeFound(found2) { return found2 ? '"' + literalEscape(found2) + '"' : "end of input"; } return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found."; }; function peg$parse(input, options) { options = options !== void 0 ? options : {}; var peg$FAILED = {}, peg$startRuleFunctions = { Block_List: peg$parseBlock_List }, peg$startRuleFunction = peg$parseBlock_List, peg$c0 = peg$anyExpectation(), peg$c1 = function(pre, b, html) { return [b, html]; }, peg$c2 = function(pre, bs, post) { return joinBlocks(pre, bs, post); }, peg$c3 = "<!--", peg$c4 = peg$literalExpectation("<!--", false), peg$c5 = "wp:", peg$c6 = peg$literalExpectation("wp:", false), peg$c7 = function(blockName, a) { return a; }, peg$c8 = "/-->", peg$c9 = peg$literalExpectation("/-->", false), peg$c10 = function(blockName, attrs) { return { blockName, attrs: attrs || {}, innerBlocks: [], innerHTML: "", innerContent: [] }; }, peg$c11 = function(s, children, e) { var innerParts = processInnerContent(children); var innerHTML = innerParts[0]; var innerBlocks = innerParts[1]; var innerContent = innerParts[2]; return { blockName: s.blockName, attrs: s.attrs, innerBlocks, innerHTML, innerContent }; }, peg$c12 = "-->", peg$c13 = peg$literalExpectation("-->", false), peg$c14 = function(blockName, attrs) { return { blockName, attrs: attrs || {} }; }, peg$c15 = "/wp:", peg$c16 = peg$literalExpectation("/wp:", false), peg$c17 = function(blockName) { return { blockName }; }, peg$c18 = "/", peg$c19 = peg$literalExpectation("/", false), peg$c20 = function(type) { return "core/" + type; }, peg$c21 = /^[a-z]/, peg$c22 = peg$classExpectation([["a", "z"]], false, false), peg$c23 = /^[a-z0-9_\-]/, peg$c24 = peg$classExpectation([["a", "z"], ["0", "9"], "_", "-"], false, false), peg$c25 = peg$otherExpectation("JSON-encoded attributes embedded in a block's opening comment"), peg$c26 = "{", peg$c27 = peg$literalExpectation("{", false), peg$c28 = "}", peg$c29 = peg$literalExpectation("}", false), peg$c30 = "", peg$c31 = function(attrs) { return maybeJSON(attrs); }, peg$c32 = /^[ \t\r\n]/, peg$c33 = peg$classExpectation([" ", " ", "\r", "\n"], false, false), peg$currPos = 0, peg$savedPos = 0, peg$posDetailsCache = [{ line: 1, column: 1 }], peg$maxFailPos = 0, peg$maxFailExpected = [], peg$silentFails = 0, peg$result; if ("startRule" in options) { if (!(options.startRule in peg$startRuleFunctions)) { throw new Error(`Can't start parsing from rule "` + options.startRule + '".'); } peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; } function text() { return input.substring(peg$savedPos, peg$currPos); } function location() { return peg$computeLocation(peg$savedPos, peg$currPos); } function expected(description, location2) { location2 = location2 !== void 0 ? location2 : peg$computeLocation(peg$savedPos, peg$currPos); throw peg$buildStructuredError( [peg$otherExpectation(description)], input.substring(peg$savedPos, peg$currPos), location2 ); } function error(message, location2) { location2 = location2 !== void 0 ? location2 : peg$computeLocation(peg$savedPos, peg$currPos); throw peg$buildSimpleError(message, location2); } function peg$literalExpectation(text2, ignoreCase) { return { type: "literal", text: text2, ignoreCase }; } function peg$classExpectation(parts, inverted, ignoreCase) { return { type: "class", parts, inverted, ignoreCase }; } function peg$anyExpectation() { return { type: "any" }; } function peg$endExpectation() { return { type: "end" }; } function peg$otherExpectation(description) { return { type: "other", description }; } function peg$computePosDetails(pos) { var details = peg$posDetailsCache[pos], p; if (details) { return details; } else { p = pos - 1; while (!peg$posDetailsCache[p]) { p--; } details = peg$posDetailsCache[p]; details = { line: details.line, column: details.column }; while (p < pos) { if (input.charCodeAt(p) === 10) { details.line++; details.column = 1; } else { details.column++; } p++; } peg$posDetailsCache[pos] = details; return details; } } function peg$computeLocation(startPos, endPos) { var startPosDetails = peg$computePosDetails(startPos), endPosDetails = peg$computePosDetails(endPos); return { start: { offset: startPos, line: startPosDetails.line, column: startPosDetails.column }, end: { offset: endPos, line: endPosDetails.line, column: endPosDetails.column } }; } function peg$fail(expected2) { if (peg$currPos < peg$maxFailPos) { return; } if (peg$currPos > peg$maxFailPos) { peg$maxFailPos = peg$currPos; peg$maxFailExpected = []; } peg$maxFailExpected.push(expected2); } function peg$buildSimpleError(message, location2) { return new peg$SyntaxError(message, null, null, location2); } function peg$buildStructuredError(expected2, found, location2) { return new peg$SyntaxError( peg$SyntaxError.buildMessage(expected2, found), expected2, found, location2 ); } function peg$parseBlock_List() { var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; s0 = peg$currPos; s1 = peg$currPos; s2 = []; s3 = peg$currPos; s4 = peg$currPos; peg$silentFails++; s5 = peg$parseBlock(); peg$silentFails--; if (s5 === peg$FAILED) { s4 = void 0; } else { peg$currPos = s4; s4 = peg$FAILED; } if (s4 !== peg$FAILED) { if (input.length > peg$currPos) { s5 = input.charAt(peg$currPos); peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c0); } } if (s5 !== peg$FAILED) { s4 = [s4, s5]; s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$currPos; s4 = peg$currPos; peg$silentFails++; s5 = peg$parseBlock(); peg$silentFails--; if (s5 === peg$FAILED) { s4 = void 0; } else { peg$currPos = s4; s4 = peg$FAILED; } if (s4 !== peg$FAILED) { if (input.length > peg$currPos) { s5 = input.charAt(peg$currPos); peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c0); } } if (s5 !== peg$FAILED) { s4 = [s4, s5]; s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } if (s2 !== peg$FAILED) { s1 = input.substring(s1, peg$currPos); } else { s1 = s2; } if (s1 !== peg$FAILED) { s2 = []; s3 = peg$currPos; s4 = peg$parseBlock(); if (s4 !== peg$FAILED) { s5 = peg$currPos; s6 = []; s7 = peg$currPos; s8 = peg$currPos; peg$silentFails++; s9 = peg$parseBlock(); peg$silentFails--; if (s9 === peg$FAILED) { s8 = void 0; } else { peg$currPos = s8; s8 = peg$FAILED; } if (s8 !== peg$FAILED) { if (input.length > peg$currPos) { s9 = input.charAt(peg$currPos); peg$currPos++; } else { s9 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c0); } } if (s9 !== peg$FAILED) { s8 = [s8, s9]; s7 = s8; } else { peg$currPos = s7; s7 = peg$FAILED; } } else { peg$currPos = s7; s7 = peg$FAILED; } while (s7 !== peg$FAILED) { s6.push(s7); s7 = peg$currPos; s8 = peg$currPos; peg$silentFails++; s9 = peg$parseBlock(); peg$silentFails--; if (s9 === peg$FAILED) { s8 = void 0; } else { peg$currPos = s8; s8 = peg$FAILED; } if (s8 !== peg$FAILED) { if (input.length > peg$currPos) { s9 = input.charAt(peg$currPos); peg$currPos++; } else { s9 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c0); } } if (s9 !== peg$FAILED) { s8 = [s8, s9]; s7 = s8; } else { peg$currPos = s7; s7 = peg$FAILED; } } else { peg$currPos = s7; s7 = peg$FAILED; } } if (s6 !== peg$FAILED) { s5 = input.substring(s5, peg$currPos); } else { s5 = s6; } if (s5 !== peg$FAILED) { peg$savedPos = s3; s4 = peg$c1(s1, s4, s5); s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$currPos; s4 = peg$parseBlock(); if (s4 !== peg$FAILED) { s5 = peg$currPos; s6 = []; s7 = peg$currPos; s8 = peg$currPos; peg$silentFails++; s9 = peg$parseBlock(); peg$silentFails--; if (s9 === peg$FAILED) { s8 = void 0; } else { peg$currPos = s8; s8 = peg$FAILED; } if (s8 !== peg$FAILED) { if (input.length > peg$currPos) { s9 = input.charAt(peg$currPos); peg$currPos++; } else { s9 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c0); } } if (s9 !== peg$FAILED) { s8 = [s8, s9]; s7 = s8; } else { peg$currPos = s7; s7 = peg$FAILED; } } else { peg$currPos = s7; s7 = peg$FAILED; } while (s7 !== peg$FAILED) { s6.push(s7); s7 = peg$currPos; s8 = peg$currPos; peg$silentFails++; s9 = peg$parseBlock(); peg$silentFails--; if (s9 === peg$FAILED) { s8 = void 0; } else { peg$currPos = s8; s8 = peg$FAILED; } if (s8 !== peg$FAILED) { if (input.length > peg$currPos) { s9 = input.charAt(peg$currPos); peg$currPos++; } else { s9 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c0); } } if (s9 !== peg$FAILED) { s8 = [s8, s9]; s7 = s8; } else { peg$currPos = s7; s7 = peg$FAILED; } } else { peg$currPos = s7; s7 = peg$FAILED; } } if (s6 !== peg$FAILED) { s5 = input.substring(s5, peg$currPos); } else { s5 = s6; } if (s5 !== peg$FAILED) { peg$savedPos = s3; s4 = peg$c1(s1, s4, s5); s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } if (s2 !== peg$FAILED) { s3 = peg$currPos; s4 = []; if (input.length > peg$currPos) { s5 = input.charAt(peg$currPos); peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c0); } } while (s5 !== peg$FAILED) { s4.push(s5); if (input.length > peg$currPos) { s5 = input.charAt(peg$currPos); peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c0); } } } if (s4 !== peg$FAILED) { s3 = input.substring(s3, peg$currPos); } else { s3 = s4; } if (s3 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c2(s1, s2, s3); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parseBlock() { var s0; s0 = peg$parseBlock_Void(); if (s0 === peg$FAILED) { s0 = peg$parseBlock_Balanced(); } return s0; } function peg$parseBlock_Void() { var s0, s1, s2, s3, s4, s5, s6, s7, s8; s0 = peg$currPos; if (input.substr(peg$currPos, 4) === peg$c3) { s1 = peg$c3; peg$currPos += 4; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c4); } } if (s1 !== peg$FAILED) { s2 = peg$parse__(); if (s2 !== peg$FAILED) { if (input.substr(peg$currPos, 3) === peg$c5) { s3 = peg$c5; peg$currPos += 3; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c6); } } if (s3 !== peg$FAILED) { s4 = peg$parseBlock_Name(); if (s4 !== peg$FAILED) { s5 = peg$parse__(); if (s5 !== peg$FAILED) { s6 = peg$currPos; s7 = peg$parseBlock_Attributes(); if (s7 !== peg$FAILED) { s8 = peg$parse__(); if (s8 !== peg$FAILED) { peg$savedPos = s6; s7 = peg$c7(s4, s7); s6 = s7; } else { peg$currPos = s6; s6 = peg$FAILED; } } else { peg$currPos = s6; s6 = peg$FAILED; } if (s6 === peg$FAILED) { s6 = null; } if (s6 !== peg$FAILED) { if (input.substr(peg$currPos, 4) === peg$c8) { s7 = peg$c8; peg$currPos += 4; } else { s7 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c9); } } if (s7 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c10(s4, s6); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parseBlock_Balanced() { var s0, s1, s2, s3, s4, s5, s6, s7, s8; s0 = peg$currPos; s1 = peg$parseBlock_Start(); if (s1 !== peg$FAILED) { s2 = []; s3 = peg$parseBlock(); if (s3 === peg$FAILED) { s3 = peg$currPos; s4 = []; s5 = peg$currPos; s6 = peg$currPos; peg$silentFails++; s7 = peg$parseBlock(); peg$silentFails--; if (s7 === peg$FAILED) { s6 = void 0; } else { peg$currPos = s6; s6 = peg$FAILED; } if (s6 !== peg$FAILED) { s7 = peg$currPos; peg$silentFails++; s8 = peg$parseBlock_End(); peg$silentFails--; if (s8 === peg$FAILED) { s7 = void 0; } else { peg$currPos = s7; s7 = peg$FAILED; } if (s7 !== peg$FAILED) { if (input.length > peg$currPos) { s8 = input.charAt(peg$currPos); peg$currPos++; } else { s8 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c0); } } if (s8 !== peg$FAILED) { s6 = [s6, s7, s8]; s5 = s6; } else { peg$currPos = s5; s5 = peg$FAILED; } } else { peg$currPos = s5; s5 = peg$FAILED; } } else { peg$currPos = s5; s5 = peg$FAILED; } if (s5 !== peg$FAILED) { while (s5 !== peg$FAILED) { s4.push(s5); s5 = peg$currPos; s6 = peg$currPos; peg$silentFails++; s7 = peg$parseBlock(); peg$silentFails--; if (s7 === peg$FAILED) { s6 = void 0; } else { peg$currPos = s6; s6 = peg$FAILED; } if (s6 !== peg$FAILED) { s7 = peg$currPos; peg$silentFails++; s8 = peg$parseBlock_End(); peg$silentFails--; if (s8 === peg$FAILED) { s7 = void 0; } else { peg$currPos = s7; s7 = peg$FAILED; } if (s7 !== peg$FAILED) { if (input.length > peg$currPos) { s8 = input.charAt(peg$currPos); peg$currPos++; } else { s8 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c0); } } if (s8 !== peg$FAILED) { s6 = [s6, s7, s8]; s5 = s6; } else { peg$currPos = s5; s5 = peg$FAILED; } } else { peg$currPos = s5; s5 = peg$FAILED; } } else { peg$currPos = s5; s5 = peg$FAILED; } } } else { s4 = peg$FAILED; } if (s4 !== peg$FAILED) { s3 = input.substring(s3, peg$currPos); } else { s3 = s4; } } while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$parseBlock(); if (s3 === peg$FAILED) { s3 = peg$currPos; s4 = []; s5 = peg$currPos; s6 = peg$currPos; peg$silentFails++; s7 = peg$parseBlock(); peg$silentFails--; if (s7 === peg$FAILED) { s6 = void 0; } else { peg$currPos = s6; s6 = peg$FAILED; } if (s6 !== peg$FAILED) { s7 = peg$currPos; peg$silentFails++; s8 = peg$parseBlock_End(); peg$silentFails--; if (s8 === peg$FAILED) { s7 = void 0; } else { peg$currPos = s7; s7 = peg$FAILED; } if (s7 !== peg$FAILED) { if (input.length > peg$currPos) { s8 = input.charAt(peg$currPos); peg$currPos++; } else { s8 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c0); } } if (s8 !== peg$FAILED) { s6 = [s6, s7, s8]; s5 = s6; } else { peg$currPos = s5; s5 = peg$FAILED; } } else { peg$currPos = s5; s5 = peg$FAILED; } } else { peg$currPos = s5; s5 = peg$FAILED; } if (s5 !== peg$FAILED) { while (s5 !== peg$FAILED) { s4.push(s5); s5 = peg$currPos; s6 = peg$currPos; peg$silentFails++; s7 = peg$parseBlock(); peg$silentFails--; if (s7 === peg$FAILED) { s6 = void 0; } else { peg$currPos = s6; s6 = peg$FAILED; } if (s6 !== peg$FAILED) { s7 = peg$currPos; peg$silentFails++; s8 = peg$parseBlock_End(); peg$silentFails--; if (s8 === peg$FAILED) { s7 = void 0; } else { peg$currPos = s7; s7 = peg$FAILED; } if (s7 !== peg$FAILED) { if (input.length > peg$currPos) { s8 = input.charAt(peg$currPos); peg$currPos++; } else { s8 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c0); } } if (s8 !== peg$FAILED) { s6 = [s6, s7, s8]; s5 = s6; } else { peg$currPos = s5; s5 = peg$FAILED; } } else { peg$currPos = s5; s5 = peg$FAILED; } } else { peg$currPos = s5; s5 = peg$FAILED; } } } else { s4 = peg$FAILED; } if (s4 !== peg$FAILED) { s3 = input.substring(s3, peg$currPos); } else { s3 = s4; } } } if (s2 !== peg$FAILED) { s3 = peg$parseBlock_End(); if (s3 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c11(s1, s2, s3); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parseBlock_Start() { var s0, s1, s2, s3, s4, s5, s6, s7, s8; s0 = peg$currPos; if (input.substr(peg$currPos, 4) === peg$c3) { s1 = peg$c3; peg$currPos += 4; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c4); } } if (s1 !== peg$FAILED) { s2 = peg$parse__(); if (s2 !== peg$FAILED) { if (input.substr(peg$currPos, 3) === peg$c5) { s3 = peg$c5; peg$currPos += 3; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c6); } } if (s3 !== peg$FAILED) { s4 = peg$parseBlock_Name(); if (s4 !== peg$FAILED) { s5 = peg$parse__(); if (s5 !== peg$FAILED) { s6 = peg$currPos; s7 = peg$parseBlock_Attributes(); if (s7 !== peg$FAILED) { s8 = peg$parse__(); if (s8 !== peg$FAILED) { peg$savedPos = s6; s7 = peg$c7(s4, s7); s6 = s7; } else { peg$currPos = s6; s6 = peg$FAILED; } } else { peg$currPos = s6; s6 = peg$FAILED; } if (s6 === peg$FAILED) { s6 = null; } if (s6 !== peg$FAILED) { if (input.substr(peg$currPos, 3) === peg$c12) { s7 = peg$c12; peg$currPos += 3; } else { s7 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c13); } } if (s7 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c14(s4, s6); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parseBlock_End() { var s0, s1, s2, s3, s4, s5, s6; s0 = peg$currPos; if (input.substr(peg$currPos, 4) === peg$c3) { s1 = peg$c3; peg$currPos += 4; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c4); } } if (s1 !== peg$FAILED) { s2 = peg$parse__(); if (s2 !== peg$FAILED) { if (input.substr(peg$currPos, 4) === peg$c15) { s3 = peg$c15; peg$currPos += 4; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c16); } } if (s3 !== peg$FAILED) { s4 = peg$parseBlock_Name(); if (s4 !== peg$FAILED) { s5 = peg$parse__(); if (s5 !== peg$FAILED) { if (input.substr(peg$currPos, 3) === peg$c12) { s6 = peg$c12; peg$currPos += 3; } else { s6 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c13); } } if (s6 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c17(s4); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parseBlock_Name() { var s0; s0 = peg$parseNamespaced_Block_Name(); if (s0 === peg$FAILED) { s0 = peg$parseCore_Block_Name(); } return s0; } function peg$parseNamespaced_Block_Name() { var s0, s1, s2, s3, s4; s0 = peg$currPos; s1 = peg$currPos; s2 = peg$parseBlock_Name_Part(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 47) { s3 = peg$c18; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c19); } } if (s3 !== peg$FAILED) { s4 = peg$parseBlock_Name_Part(); if (s4 !== peg$FAILED) { s2 = [s2, s3, s4]; s1 = s2; } else { peg$currPos = s1; s1 = peg$FAILED; } } else { peg$currPos = s1; s1 = peg$FAILED; } } else { peg$currPos = s1; s1 = peg$FAILED; } if (s1 !== peg$FAILED) { s0 = input.substring(s0, peg$currPos); } else { s0 = s1; } return s0; } function peg$parseCore_Block_Name() { var s0, s1, s2; s0 = peg$currPos; s1 = peg$currPos; s2 = peg$parseBlock_Name_Part(); if (s2 !== peg$FAILED) { s1 = input.substring(s1, peg$currPos); } else { s1 = s2; } if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c20(s1); } s0 = s1; return s0; } function peg$parseBlock_Name_Part() { var s0, s1, s2, s3, s4; s0 = peg$currPos; s1 = peg$currPos; if (peg$c21.test(input.charAt(peg$currPos))) { s2 = input.charAt(peg$currPos); peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c22); } } if (s2 !== peg$FAILED) { s3 = []; if (peg$c23.test(input.charAt(peg$currPos))) { s4 = input.charAt(peg$currPos); peg$currPos++; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c24); } } while (s4 !== peg$FAILED) { s3.push(s4); if (peg$c23.test(input.charAt(peg$currPos))) { s4 = input.charAt(peg$currPos); peg$currPos++; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c24); } } } if (s3 !== peg$FAILED) { s2 = [s2, s3]; s1 = s2; } else { peg$currPos = s1; s1 = peg$FAILED; } } else { peg$currPos = s1; s1 = peg$FAILED; } if (s1 !== peg$FAILED) { s0 = input.substring(s0, peg$currPos); } else { s0 = s1; } return s0; } function peg$parseBlock_Attributes() { var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12; peg$silentFails++; s0 = peg$currPos; s1 = peg$currPos; s2 = peg$currPos; if (input.charCodeAt(peg$currPos) === 123) { s3 = peg$c26; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c27); } } if (s3 !== peg$FAILED) { s4 = []; s5 = peg$currPos; s6 = peg$currPos; peg$silentFails++; s7 = peg$currPos; if (input.charCodeAt(peg$currPos) === 125) { s8 = peg$c28; peg$currPos++; } else { s8 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c29); } } if (s8 !== peg$FAILED) { s9 = peg$parse__(); if (s9 !== peg$FAILED) { s10 = peg$c30; if (s10 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 47) { s11 = peg$c18; peg$currPos++; } else { s11 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c19); } } if (s11 === peg$FAILED) { s11 = null; } if (s11 !== peg$FAILED) { if (input.substr(peg$currPos, 3) === peg$c12) { s12 = peg$c12; peg$currPos += 3; } else { s12 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c13); } } if (s12 !== peg$FAILED) { s8 = [s8, s9, s10, s11, s12]; s7 = s8; } else { peg$currPos = s7; s7 = peg$FAILED; } } else { peg$currPos = s7; s7 = peg$FAILED; } } else { peg$currPos = s7; s7 = peg$FAILED; } } else { peg$currPos = s7; s7 = peg$FAILED; } } else { peg$currPos = s7; s7 = peg$FAILED; } peg$silentFails--; if (s7 === peg$FAILED) { s6 = void 0; } else { peg$currPos = s6; s6 = peg$FAILED; } if (s6 !== peg$FAILED) { if (input.length > peg$currPos) { s7 = input.charAt(peg$currPos); peg$currPos++; } else { s7 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c0); } } if (s7 !== peg$FAILED) { s6 = [s6, s7]; s5 = s6; } else { peg$currPos = s5; s5 = peg$FAILED; } } else { peg$currPos = s5; s5 = peg$FAILED; } while (s5 !== peg$FAILED) { s4.push(s5); s5 = peg$currPos; s6 = peg$currPos; peg$silentFails++; s7 = peg$currPos; if (input.charCodeAt(peg$currPos) === 125) { s8 = peg$c28; peg$currPos++; } else { s8 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c29); } } if (s8 !== peg$FAILED) { s9 = peg$parse__(); if (s9 !== peg$FAILED) { s10 = peg$c30; if (s10 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 47) { s11 = peg$c18; peg$currPos++; } else { s11 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c19); } } if (s11 === peg$FAILED) { s11 = null; } if (s11 !== peg$FAILED) { if (input.substr(peg$currPos, 3) === peg$c12) { s12 = peg$c12; peg$currPos += 3; } else { s12 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c13); } } if (s12 !== peg$FAILED) { s8 = [s8, s9, s10, s11, s12]; s7 = s8; } else { peg$currPos = s7; s7 = peg$FAILED; } } else { peg$currPos = s7; s7 = peg$FAILED; } } else { peg$currPos = s7; s7 = peg$FAILED; } } else { peg$currPos = s7; s7 = peg$FAILED; } } else { peg$currPos = s7; s7 = peg$FAILED; } peg$silentFails--; if (s7 === peg$FAILED) { s6 = void 0; } else { peg$currPos = s6; s6 = peg$FAILED; } if (s6 !== peg$FAILED) { if (input.length > peg$currPos) { s7 = input.charAt(peg$currPos); peg$currPos++; } else { s7 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c0); } } if (s7 !== peg$FAILED) { s6 = [s6, s7]; s5 = s6; } else { peg$currPos = s5; s5 = peg$FAILED; } } else { peg$currPos = s5; s5 = peg$FAILED; } } if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 125) { s5 = peg$c28; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c29); } } if (s5 !== peg$FAILED) { s3 = [s3, s4, s5]; s2 = s3; } else { peg$currPos = s2; s2 = peg$FAILED; } } else { peg$currPos = s2; s2 = peg$FAILED; } } else { peg$currPos = s2; s2 = peg$FAILED; } if (s2 !== peg$FAILED) { s1 = input.substring(s1, peg$currPos); } else { s1 = s2; } if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c31(s1); } s0 = s1; peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c25); } } return s0; } function peg$parse__() { var s0, s1; s0 = []; if (peg$c32.test(input.charAt(peg$currPos))) { s1 = input.charAt(peg$currPos); peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c33); } } if (s1 !== peg$FAILED) { while (s1 !== peg$FAILED) { s0.push(s1); if (peg$c32.test(input.charAt(peg$currPos))) { s1 = input.charAt(peg$currPos); peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c33); } } } } else { s0 = peg$FAILED; } return s0; } function freeform(s) { return s.length && { blockName: null, attrs: {}, innerBlocks: [], innerHTML: s, innerContent: [s] }; } function joinBlocks(pre, tokens, post) { var blocks = [], i, l, html, item, token; if (pre.length) { blocks.push(freeform(pre)); } for (i = 0, l = tokens.length; i < l; i++) { item = tokens[i]; token = item[0]; html = item[1]; blocks.push(token); if (html.length) { blocks.push(freeform(html)); } } if (post.length) { blocks.push(freeform(post)); } return blocks; } function maybeJSON(s) { try { return JSON.parse(s); } catch (e) { return null; } } function processInnerContent(list) { var i, l, item; var html = ""; var blocks = []; var content = []; for (i = 0, l = list.length; i < l; i++) { item = list[i]; if ("string" === typeof item) { html += item; content.push(item); } else { blocks.push(item); content.push(null); } } ; return [html, blocks, content]; } peg$result = peg$startRuleFunction(); if (peg$result !== peg$FAILED && peg$currPos === input.length) { return peg$result; } else { if (peg$result !== peg$FAILED && peg$currPos < input.length) { peg$fail(peg$endExpectation()); } throw peg$buildStructuredError( peg$maxFailExpected, peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null, peg$maxFailPos < input.length ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1) : peg$computeLocation(peg$maxFailPos, peg$maxFailPos) ); } } module.exports = { SyntaxError: peg$SyntaxError, parse: peg$parse }; } }); return require_parser(); })(); viewport.min.js 0000644 00000004326 15206720414 0007551 0 ustar 00 var wp;(wp||={}).viewport=(()=>{var H=Object.create;var d=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var $=Object.getOwnPropertyNames;var P=Object.getPrototypeOf,D=Object.prototype.hasOwnProperty;var l=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),v=(e,t)=>{for(var r in t)d(e,r,{get:t[r],enumerable:!0})},O=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of $(t))!D.call(e,o)&&o!==r&&d(e,o,{get:()=>t[o],enumerable:!(a=L(t,o))||a.enumerable});return e};var n=(e,t,r)=>(r=e!=null?H(P(e)):{},O(t||!e||!e.__esModule?d(r,"default",{value:e,enumerable:!0}):r,e)),G=e=>O(d({},"__esModule",{value:!0}),e);var u=l((W,V)=>{V.exports=window.wp.compose});var M=l((Y,g)=>{g.exports=window.wp.data});var j=l((it,T)=>{T.exports=window.ReactJSXRuntime});var F={};v(F,{ifViewportMatches:()=>C,store:()=>c,withViewportMatch:()=>w});var S=n(u(),1),b=n(M(),1);var f=n(M(),1);function k(e={},t){return t.type==="SET_IS_MATCHING"?t.values:e}var R=k;var x={};v(x,{setIsMatching:()=>B});function B(e){return{type:"SET_IS_MATCHING",values:e}}var E={};v(E,{isViewportMatch:()=>J});function J(e,t){return t.indexOf(" ")===-1&&(t=">= "+t),!!e[t]}var K="core/viewport",c=(0,f.createReduxStore)(K,{reducer:R,actions:x,selectors:E});(0,f.register)(c);var Q=(e,t)=>{let r=(0,S.debounce)(()=>{let i=Object.fromEntries(o.map(([s,h])=>[s,h.matches]));(0,b.dispatch)(c).setIsMatching(i)},0,{leading:!0}),a=Object.entries(t),o=Object.entries(e).flatMap(([i,s])=>a.map(([h,N])=>{let _=window.matchMedia(`(${N}: ${s}px)`);return _.addEventListener("change",r),[`${h} ${i}`,_]}));window.addEventListener("orientationchange",r),r(),r.flush()},I=Q;var m=n(u(),1);var p=n(u(),1),A=n(j(),1),X=e=>{let t=Object.entries(e),r=()=>Object.fromEntries(t.map(([a,o])=>{let[i,s]=o.split(" ");return s===void 0&&(s=i,i=">="),[a,(0,p.useViewportMatch)(s,i)]}));return(0,p.createHigherOrderComponent)(a=>(0,p.pure)(o=>{let i=r();return(0,A.jsx)(a,{...o,...i})}),"withViewportMatch")},w=X;var q=e=>(0,m.createHigherOrderComponent)((0,m.compose)([w({isViewportMatch:e}),(0,m.ifCondition)(t=>t.isViewportMatch)]),"ifViewportMatches"),C=q;var y={huge:1440,wide:1280,large:960,medium:782,small:600,mobile:480},z={"<":"max-width",">=":"min-width"};I(y,z);return G(F);})(); commands.min.js 0000644 00000176152 15206720414 0007502 0 ustar 00 var wp;(wp||={}).commands=(()=>{var pn=Object.create;var ze=Object.defineProperty;var vn=Object.getOwnPropertyDescriptor;var hn=Object.getOwnPropertyNames;var gn=Object.getPrototypeOf,yn=Object.prototype.hasOwnProperty;var oe=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),qe=(e,t)=>{for(var r in t)ze(e,r,{get:t[r],enumerable:!0})},Mr=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of hn(t))!yn.call(e,a)&&a!==r&&ze(e,a,{get:()=>t[a],enumerable:!(o=vn(t,a))||o.enumerable});return e};var m=(e,t,r)=>(r=e!=null?pn(gn(e)):{},Mr(t||!e||!e.__esModule?ze(r,"default",{value:e,enumerable:!0}):r,e)),Rn=e=>Mr(ze({},"__esModule",{value:!0}),e);var w=oe((fl,Vr)=>{Vr.exports=window.React});var B=oe((pl,Hr)=>{Hr.exports=window.ReactJSXRuntime});var pe=oe((Cl,Yr)=>{Yr.exports=window.ReactDOM});var ce=oe((Qf,$a)=>{$a.exports=window.wp.data});var Te=oe((ec,Ua)=>{Ua.exports=window.wp.element});var Ga=oe((tc,Ha)=>{Ha.exports=window.wp.i18n});var za=oe((rc,Ka)=>{Ka.exports=window.wp.components});var Ya=oe((oc,qa)=>{qa.exports=window.wp.keyboardShortcuts});var br=oe((nc,Xa)=>{Xa.exports=window.wp.primitives});var tn=oe((vc,en)=>{en.exports=window.wp.privateApis});var sl={};qe(sl,{CommandMenu:()=>sn,privateApis:()=>Dr,store:()=>K,useCommand:()=>un,useCommandLoader:()=>mn,useCommands:()=>fn});var Fr=1,bn=.9,wn=.8,En=.17,At=.1,It=.999,Cn=.9999,Sn=.99,xn=/[\\\/_+.#"@\[\(\{&]/,On=/[\\\/_+.#"@\[\(\{&]/g,_n=/[\s-]/,Wr=/[\s-]/g;function Lt(e,t,r,o,a,n,s){if(n===t.length)return a===e.length?Fr:Sn;var i=`${a},${n}`;if(s[i]!==void 0)return s[i];for(var u=o.charAt(n),l=r.indexOf(u,a),c=0,f,h,g,_;l>=0;)f=Lt(e,t,r,o,l+1,n+1,s),f>c&&(l===a?f*=Fr:xn.test(e.charAt(l-1))?(f*=wn,g=e.slice(a,l-1).match(On),g&&a>0&&(f*=Math.pow(It,g.length))):_n.test(e.charAt(l-1))?(f*=bn,_=e.slice(a,l-1).match(Wr),_&&a>0&&(f*=Math.pow(It,_.length))):(f*=En,a>0&&(f*=Math.pow(It,l-a))),e.charAt(l)!==t.charAt(n)&&(f*=Cn)),(f<At&&r.charAt(l-1)===o.charAt(n+1)||o.charAt(n+1)===o.charAt(n)&&r.charAt(l-1)!==o.charAt(n))&&(h=Lt(e,t,r,o,l+1,n+2,s),h*At>f&&(f=h*At)),f>c&&(c=f),l=r.indexOf(u,l+1);return s[i]=c,c}function jr(e){return e.toLowerCase().replace(Wr," ")}function Br(e,t,r){return e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,Lt(e,t,jr(e),jr(t),0,0,{})}var I=m(w(),1);var cl=!!(typeof window<"u"&&window.document&&window.document.createElement);function Se(e,t,{checkForDefaultPrevented:r=!0}={}){return function(a){if(e?.(a),r===!1||!a.defaultPrevented)return t?.(a)}}var Ur=m(w(),1);function $r(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Tt(...e){return t=>{let r=!1,o=e.map(a=>{let n=$r(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():$r(e[a],null)}}}}function Ye(...e){return Ur.useCallback(Tt(...e),e)}var J=m(w(),1),kt=m(B(),1);function Gr(e,t){let r=J.createContext(t),o=n=>{let{children:s,...i}=n,u=J.useMemo(()=>i,Object.values(i));return(0,kt.jsx)(r.Provider,{value:u,children:s})};o.displayName=e+"Provider";function a(n){let s=J.useContext(r);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${n}\` must be used within \`${e}\``)}return[o,a]}function Kr(e,t=[]){let r=[];function o(n,s){let i=J.createContext(s),u=r.length;r=[...r,s];let l=f=>{let{scope:h,children:g,..._}=f,p=h?.[e]?.[u]||i,b=J.useMemo(()=>_,Object.values(_));return(0,kt.jsx)(p.Provider,{value:b,children:g})};l.displayName=n+"Provider";function c(f,h){let g=h?.[e]?.[u]||i,_=J.useContext(g);if(_)return _;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${n}\``)}return[l,c]}let a=()=>{let n=r.map(s=>J.createContext(s));return function(i){let u=i?.[e]||n;return J.useMemo(()=>({[`__scope${e}`]:{...i,[e]:u}}),[i,u])}};return a.scopeName=e,[o,Pn(a,...t)]}function Pn(...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 s=o.reduce((i,{useScope:u,scopeName:l})=>{let f=u(n)[`__scope${l}`];return{...i,...f}},{});return J.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}var Mt=m(w(),1);var zr=m(w(),1),Xe=globalThis?.document?zr.useLayoutEffect:()=>{};var Dn=Mt[" useId ".trim().toString()]||(()=>{}),Nn=0;function Ze(e){let[t,r]=Mt.useState(Dn());return Xe(()=>{e||r(o=>o??String(Nn++))},[e]),e||(t?`radix-${t}`:"")}var Q=m(w(),1);var Je=m(w(),1);var An=Q[" useInsertionEffect ".trim().toString()]||Xe;function qr({prop:e,defaultProp:t,onChange:r=()=>{},caller:o}){let[a,n,s]=In({defaultProp:t,onChange:r}),i=e!==void 0,u=i?e:a;{let c=Q.useRef(e!==void 0);Q.useEffect(()=>{let f=c.current;f!==i&&console.warn(`${o} is changing from ${f?"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.`),c.current=i},[i,o])}let l=Q.useCallback(c=>{if(i){let f=Ln(c)?c(e):c;f!==e&&s.current?.(f)}else n(c)},[i,e,n,s]);return[u,l]}function In({defaultProp:e,onChange:t}){let[r,o]=Q.useState(e),a=Q.useRef(r),n=Q.useRef(t);return An(()=>{n.current=t},[t]),Q.useEffect(()=>{a.current!==r&&(n.current?.(r),a.current=r)},[r,a]),[r,o,n]}function Ln(e){return typeof e=="function"}var F=m(w(),1);var wl=!!(typeof window<"u"&&window.document&&window.document.createElement);function Qe(e,t,{checkForDefaultPrevented:r=!0}={}){return function(a){if(e?.(a),r===!1||!a.defaultPrevented)return t?.(a)}}var Qr=m(w(),1),eo=m(pe(),1);var V=m(w(),1);var Zr=m(w(),1);function Xr(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ft(...e){return t=>{let r=!1,o=e.map(a=>{let n=Xr(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():Xr(e[a],null)}}}}function jt(...e){return Zr.useCallback(Ft(...e),e)}var et=m(B(),1);function Jr(e){let t=Tn(e),r=V.forwardRef((o,a)=>{let{children:n,...s}=o,i=V.Children.toArray(n),u=i.find(Mn);if(u){let l=u.props.children,c=i.map(f=>f===u?V.Children.count(l)>1?V.Children.only(null):V.isValidElement(l)?l.props.children:null:f);return(0,et.jsx)(t,{...s,ref:a,children:V.isValidElement(l)?V.cloneElement(l,void 0,c):null})}return(0,et.jsx)(t,{...s,ref:a,children:n})});return r.displayName=`${e}.Slot`,r}function Tn(e){let t=V.forwardRef((r,o)=>{let{children:a,...n}=r;if(V.isValidElement(a)){let s=jn(a),i=Fn(n,a.props);return a.type!==V.Fragment&&(i.ref=o?Ft(o,s):s),V.cloneElement(a,i)}return V.Children.count(a)>1?V.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var kn=Symbol("radix.slottable");function Mn(e){return V.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===kn}function Fn(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 jn(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 to=m(B(),1),Wn=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Wt=Wn.reduce((e,t)=>{let r=Jr(`Primitive.${t}`),o=Qr.forwardRef((a,n)=>{let{asChild:s,...i}=a,u=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),(0,to.jsx)(u,{...i,ref:n})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function ro(e,t){e&&eo.flushSync(()=>e.dispatchEvent(t))}var xe=m(w(),1);function je(e){let t=xe.useRef(e);return xe.useEffect(()=>{t.current=e}),xe.useMemo(()=>(...r)=>t.current?.(...r),[])}var oo=m(w(),1);function ao(e,t=globalThis?.document){let r=je(e);oo.useEffect(()=>{let o=a=>{a.key==="Escape"&&r(a)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[r,t])}var Vt=m(B(),1),Bn="DismissableLayer",Bt="dismissableLayer.update",Vn="dismissableLayer.pointerDownOutside",$n="dismissableLayer.focusOutside",no,so=F.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),$t=F.forwardRef((e,t)=>{let{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:n,onInteractOutside:s,onDismiss:i,...u}=e,l=F.useContext(so),[c,f]=F.useState(null),h=c?.ownerDocument??globalThis?.document,[,g]=F.useState({}),_=jt(t,R=>f(R)),p=Array.from(l.layers),[b]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),S=p.indexOf(b),P=c?p.indexOf(c):-1,T=l.layersWithOutsidePointerEventsDisabled.size>0,k=P>=S,D=Gn(R=>{let z=R.target,se=[...l.branches].some(me=>me.contains(z));!k||se||(a?.(R),s?.(R),R.defaultPrevented||i?.())},h),C=Kn(R=>{let z=R.target;[...l.branches].some(me=>me.contains(z))||(n?.(R),s?.(R),R.defaultPrevented||i?.())},h);return ao(R=>{P===l.layers.size-1&&(o?.(R),!R.defaultPrevented&&i&&(R.preventDefault(),i()))},h),F.useEffect(()=>{if(c)return r&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(no=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(c)),l.layers.add(c),io(),()=>{r&&l.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=no)}},[c,h,r,l]),F.useEffect(()=>()=>{c&&(l.layers.delete(c),l.layersWithOutsidePointerEventsDisabled.delete(c),io())},[c,l]),F.useEffect(()=>{let R=()=>g({});return document.addEventListener(Bt,R),()=>document.removeEventListener(Bt,R)},[]),(0,Vt.jsx)(Wt.div,{...u,ref:_,style:{pointerEvents:T?k?"auto":"none":void 0,...e.style},onFocusCapture:Qe(e.onFocusCapture,C.onFocusCapture),onBlurCapture:Qe(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:Qe(e.onPointerDownCapture,D.onPointerDownCapture)})});$t.displayName=Bn;var Un="DismissableLayerBranch",Hn=F.forwardRef((e,t)=>{let r=F.useContext(so),o=F.useRef(null),a=jt(t,o);return F.useEffect(()=>{let n=o.current;if(n)return r.branches.add(n),()=>{r.branches.delete(n)}},[r.branches]),(0,Vt.jsx)(Wt.div,{...e,ref:a})});Hn.displayName=Un;function Gn(e,t=globalThis?.document){let r=je(e),o=F.useRef(!1),a=F.useRef(()=>{});return F.useEffect(()=>{let n=i=>{if(i.target&&!o.current){let l=function(){lo(Vn,r,c,{discrete:!0})};var u=l;let c={originalEvent:i};i.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=l,t.addEventListener("click",a.current,{once:!0})):l()}else t.removeEventListener("click",a.current);o.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",n)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",n),t.removeEventListener("click",a.current)}},[t,r]),{onPointerDownCapture:()=>o.current=!0}}function Kn(e,t=globalThis?.document){let r=je(e),o=F.useRef(!1);return F.useEffect(()=>{let a=n=>{n.target&&!o.current&&lo($n,r,{originalEvent:n},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,r]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function io(){let e=new CustomEvent(Bt);document.dispatchEvent(e)}function lo(e,t,r,{discrete:o}){let a=r.originalEvent.target,n=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),o?ro(a,n):a.dispatchEvent(n)}var ee=m(w(),1);var fo=m(w(),1);function uo(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ut(...e){return t=>{let r=!1,o=e.map(a=>{let n=uo(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():uo(e[a],null)}}}}function co(...e){return fo.useCallback(Ut(...e),e)}var po=m(w(),1),Jn=m(pe(),1);var $=m(w(),1);var tt=m(B(),1);function mo(e){let t=zn(e),r=$.forwardRef((o,a)=>{let{children:n,...s}=o,i=$.Children.toArray(n),u=i.find(Yn);if(u){let l=u.props.children,c=i.map(f=>f===u?$.Children.count(l)>1?$.Children.only(null):$.isValidElement(l)?l.props.children:null:f);return(0,tt.jsx)(t,{...s,ref:a,children:$.isValidElement(l)?$.cloneElement(l,void 0,c):null})}return(0,tt.jsx)(t,{...s,ref:a,children:n})});return r.displayName=`${e}.Slot`,r}function zn(e){let t=$.forwardRef((r,o)=>{let{children:a,...n}=r;if($.isValidElement(a)){let s=Zn(a),i=Xn(n,a.props);return a.type!==$.Fragment&&(i.ref=o?Ut(o,s):s),$.cloneElement(a,i)}return $.Children.count(a)>1?$.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var qn=Symbol("radix.slottable");function Yn(e){return $.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===qn}function Xn(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 Zn(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 vo=m(B(),1),Qn=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ho=Qn.reduce((e,t)=>{let r=mo(`Primitive.${t}`),o=po.forwardRef((a,n)=>{let{asChild:s,...i}=a,u=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),(0,vo.jsx)(u,{...i,ref:n})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});var Oe=m(w(),1);function Ht(e){let t=Oe.useRef(e);return Oe.useEffect(()=>{t.current=e}),Oe.useMemo(()=>(...r)=>t.current?.(...r),[])}var wo=m(B(),1),Gt="focusScope.autoFocusOnMount",Kt="focusScope.autoFocusOnUnmount",go={bubbles:!1,cancelable:!0},ei="FocusScope",zt=ee.forwardRef((e,t)=>{let{loop:r=!1,trapped:o=!1,onMountAutoFocus:a,onUnmountAutoFocus:n,...s}=e,[i,u]=ee.useState(null),l=Ht(a),c=Ht(n),f=ee.useRef(null),h=co(t,p=>u(p)),g=ee.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;ee.useEffect(()=>{if(o){let P=function(C){if(g.paused||!i)return;let R=C.target;i.contains(R)?f.current=R:le(f.current,{select:!0})},T=function(C){if(g.paused||!i)return;let R=C.relatedTarget;R!==null&&(i.contains(R)||le(f.current,{select:!0}))},k=function(C){if(document.activeElement===document.body)for(let z of C)z.removedNodes.length>0&&le(i)};var p=P,b=T,S=k;document.addEventListener("focusin",P),document.addEventListener("focusout",T);let D=new MutationObserver(k);return i&&D.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",P),document.removeEventListener("focusout",T),D.disconnect()}}},[o,i,g.paused]),ee.useEffect(()=>{if(i){Ro.add(g);let p=document.activeElement;if(!i.contains(p)){let S=new CustomEvent(Gt,go);i.addEventListener(Gt,l),i.dispatchEvent(S),S.defaultPrevented||(ti(ii(Eo(i)),{select:!0}),document.activeElement===p&&le(i))}return()=>{i.removeEventListener(Gt,l),setTimeout(()=>{let S=new CustomEvent(Kt,go);i.addEventListener(Kt,c),i.dispatchEvent(S),S.defaultPrevented||le(p??document.body,{select:!0}),i.removeEventListener(Kt,c),Ro.remove(g)},0)}}},[i,l,c,g]);let _=ee.useCallback(p=>{if(!r&&!o||g.paused)return;let b=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,S=document.activeElement;if(b&&S){let P=p.currentTarget,[T,k]=ri(P);T&&k?!p.shiftKey&&S===k?(p.preventDefault(),r&&le(T,{select:!0})):p.shiftKey&&S===T&&(p.preventDefault(),r&&le(k,{select:!0})):S===P&&p.preventDefault()}},[r,o,g.paused]);return(0,wo.jsx)(ho.div,{tabIndex:-1,...s,ref:h,onKeyDown:_})});zt.displayName=ei;function ti(e,{select:t=!1}={}){let r=document.activeElement;for(let o of e)if(le(o,{select:t}),document.activeElement!==r)return}function ri(e){let t=Eo(e),r=yo(t,e),o=yo(t.reverse(),e);return[r,o]}function Eo(e){let t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{let a=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||a?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function yo(e,t){for(let r of e)if(!oi(r,{upTo:t}))return r}function oi(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function ai(e){return e instanceof HTMLInputElement&&"select"in e}function le(e,{select:t=!1}={}){if(e&&e.focus){let r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&ai(e)&&t&&e.select()}}var Ro=ni();function ni(){let e=[];return{add(t){let r=e[0];t!==r&&r?.pause(),e=bo(e,t),e.unshift(t)},remove(t){e=bo(e,t),e[0]?.resume()}}}function bo(e,t){let r=[...e],o=r.indexOf(t);return o!==-1&&r.splice(o,1),r}function ii(e){return e.filter(t=>t.tagName!=="A")}var ot=m(w(),1),Ao=m(pe(),1);var Oo=m(w(),1),mi=m(pe(),1);var U=m(w(),1);var si=m(w(),1);function Co(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function So(...e){return t=>{let r=!1,o=e.map(a=>{let n=Co(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():Co(e[a],null)}}}}var rt=m(B(),1);function xo(e){let t=li(e),r=U.forwardRef((o,a)=>{let{children:n,...s}=o,i=U.Children.toArray(n),u=i.find(fi);if(u){let l=u.props.children,c=i.map(f=>f===u?U.Children.count(l)>1?U.Children.only(null):U.isValidElement(l)?l.props.children:null:f);return(0,rt.jsx)(t,{...s,ref:a,children:U.isValidElement(l)?U.cloneElement(l,void 0,c):null})}return(0,rt.jsx)(t,{...s,ref:a,children:n})});return r.displayName=`${e}.Slot`,r}function li(e){let t=U.forwardRef((r,o)=>{let{children:a,...n}=r;if(U.isValidElement(a)){let s=di(a),i=ci(n,a.props);return a.type!==U.Fragment&&(i.ref=o?So(o,s):s),U.cloneElement(a,i)}return U.Children.count(a)>1?U.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ui=Symbol("radix.slottable");function fi(e){return U.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ui}function ci(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 di(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 _o=m(B(),1),pi=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Po=pi.reduce((e,t)=>{let r=xo(`Primitive.${t}`),o=Oo.forwardRef((a,n)=>{let{asChild:s,...i}=a,u=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),(0,_o.jsx)(u,{...i,ref:n})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});var Do=m(w(),1),No=globalThis?.document?Do.useLayoutEffect:()=>{};var Io=m(B(),1),vi="Portal",qt=ot.forwardRef((e,t)=>{let{container:r,...o}=e,[a,n]=ot.useState(!1);No(()=>n(!0),[]);let s=r||a&&globalThis?.document?.body;return s?Ao.default.createPortal((0,Io.jsx)(Po.div,{...o,ref:t}),s):null});qt.displayName=vi;var Y=m(w(),1);var To=m(w(),1);function Lo(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function hi(...e){return t=>{let r=!1,o=e.map(a=>{let n=Lo(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():Lo(e[a],null)}}}}function ko(...e){return To.useCallback(hi(...e),e)}var Mo=m(w(),1),Yt=globalThis?.document?Mo.useLayoutEffect:()=>{};var Fo=m(w(),1);function gi(e,t){return Fo.useReducer((r,o)=>t[r][o]??r,e)}var We=e=>{let{present:t,children:r}=e,o=yi(t),a=typeof r=="function"?r({present:o.isPresent}):Y.Children.only(r),n=ko(o.ref,Ri(a));return typeof r=="function"||o.isPresent?Y.cloneElement(a,{ref:n}):null};We.displayName="Presence";function yi(e){let[t,r]=Y.useState(),o=Y.useRef(null),a=Y.useRef(e),n=Y.useRef("none"),s=e?"mounted":"unmounted",[i,u]=gi(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return Y.useEffect(()=>{let l=at(o.current);n.current=i==="mounted"?l:"none"},[i]),Yt(()=>{let l=o.current,c=a.current;if(c!==e){let h=n.current,g=at(l);e?u("MOUNT"):g==="none"||l?.display==="none"?u("UNMOUNT"):u(c&&h!==g?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,u]),Yt(()=>{if(t){let l,c=t.ownerDocument.defaultView??window,f=g=>{let p=at(o.current).includes(CSS.escape(g.animationName));if(g.target===t&&p&&(u("ANIMATION_END"),!a.current)){let b=t.style.animationFillMode;t.style.animationFillMode="forwards",l=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},h=g=>{g.target===t&&(n.current=at(o.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{c.clearTimeout(l),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:Y.useCallback(l=>{o.current=l?getComputedStyle(l):null,r(l)},[])}}function at(e){return e?.animationName||"none"}function Ri(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 jo=m(w(),1),xi=m(pe(),1);var H=m(w(),1);var nt=m(B(),1);function it(e){let t=bi(e),r=H.forwardRef((o,a)=>{let{children:n,...s}=o,i=H.Children.toArray(n),u=i.find(Ei);if(u){let l=u.props.children,c=i.map(f=>f===u?H.Children.count(l)>1?H.Children.only(null):H.isValidElement(l)?l.props.children:null:f);return(0,nt.jsx)(t,{...s,ref:a,children:H.isValidElement(l)?H.cloneElement(l,void 0,c):null})}return(0,nt.jsx)(t,{...s,ref:a,children:n})});return r.displayName=`${e}.Slot`,r}function bi(e){let t=H.forwardRef((r,o)=>{let{children:a,...n}=r;if(H.isValidElement(a)){let s=Si(a),i=Ci(n,a.props);return a.type!==H.Fragment&&(i.ref=o?Tt(o,s):s),H.cloneElement(a,i)}return H.Children.count(a)>1?H.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var wi=Symbol("radix.slottable");function Ei(e){return H.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===wi}function Ci(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 Si(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 Wo=m(B(),1),Oi=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],_e=Oi.reduce((e,t)=>{let r=it(`Primitive.${t}`),o=jo.forwardRef((a,n)=>{let{asChild:s,...i}=a,u=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),(0,Wo.jsx)(u,{...i,ref:n})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});var Vo=m(w(),1),Xt=0;function $o(){Vo.useEffect(()=>{let e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Bo()),document.body.insertAdjacentElement("beforeend",e[1]??Bo()),Xt++,()=>{Xt===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Xt--}},[])}function Bo(){let e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var X=function(){return X=Object.assign||function(t){for(var r,o=1,a=arguments.length;o<a;o++){r=arguments[o];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},X.apply(this,arguments)};function st(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,o=Object.getOwnPropertySymbols(e);a<o.length;a++)t.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(r[o[a]]=e[o[a]]);return r}function Uo(e,t,r){if(r||arguments.length===2)for(var o=0,a=t.length,n;o<a;o++)(n||!(o in t))&&(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}var dt=m(w());var G=m(w());var ve="right-scroll-bar-position",he="width-before-scroll-bar",Zt="with-scroll-bars-hidden",Jt="--removed-body-scroll-bar-size";function lt(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}var Ho=m(w());function Go(e,t){var r=(0,Ho.useState)(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(o){var a=r.value;a!==o&&(r.value=o,r.callback(o,a))}}}})[0];return r.callback=t,r.facade}var ut=m(w());var _i=typeof window<"u"?ut.useLayoutEffect:ut.useEffect,Ko=new WeakMap;function Qt(e,t){var r=Go(t||null,function(o){return e.forEach(function(a){return lt(a,o)})});return _i(function(){var o=Ko.get(r);if(o){var a=new Set(o),n=new Set(e),s=r.current;a.forEach(function(i){n.has(i)||lt(i,null)}),n.forEach(function(i){a.has(i)||lt(i,s)})}Ko.set(r,e)},[e]),r}function Pi(e){return e}function Di(e,t){t===void 0&&(t=Pi);var r=[],o=!1,a={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(n){var s=t(n,o);return r.push(s),function(){r=r.filter(function(i){return i!==s})}},assignSyncMedium:function(n){for(o=!0;r.length;){var s=r;r=[],s.forEach(n)}r={push:function(i){return n(i)},filter:function(){return r}}},assignMedium:function(n){o=!0;var s=[];if(r.length){var i=r;r=[],i.forEach(n),s=r}var u=function(){var c=s;s=[],c.forEach(n)},l=function(){return Promise.resolve().then(u)};l(),r={push:function(c){s.push(c),l()},filter:function(c){return s=s.filter(c),r}}}};return a}function er(e){e===void 0&&(e={});var t=Di(null);return t.options=X({async:!0,ssr:!1},e),t}var zo=m(w()),qo=function(e){var t=e.sideCar,r=st(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=t.read();if(!o)throw new Error("Sidecar medium not found");return zo.createElement(o,X({},r))};qo.isSideCarExport=!0;function tr(e,t){return e.useMedium(t),qo}var ft=er();var rr=function(){},Be=G.forwardRef(function(e,t){var r=G.useRef(null),o=G.useState({onScrollCapture:rr,onWheelCapture:rr,onTouchMoveCapture:rr}),a=o[0],n=o[1],s=e.forwardProps,i=e.children,u=e.className,l=e.removeScrollBar,c=e.enabled,f=e.shards,h=e.sideCar,g=e.noRelative,_=e.noIsolation,p=e.inert,b=e.allowPinchZoom,S=e.as,P=S===void 0?"div":S,T=e.gapMode,k=st(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),D=h,C=Qt([r,t]),R=X(X({},k),a);return G.createElement(G.Fragment,null,c&&G.createElement(D,{sideCar:ft,removeScrollBar:l,shards:f,noRelative:g,noIsolation:_,inert:p,setCallbacks:n,allowPinchZoom:!!b,lockRef:r,gapMode:T}),s?G.cloneElement(G.Children.only(i),X(X({},R),{ref:C})):G.createElement(P,X({},R,{className:u,ref:C}),i))});Be.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Be.classNames={fullWidth:he,zeroRight:ve};var L=m(w());var De=m(w());var Zo=m(w());var Yo;var Xo=function(){if(Yo)return Yo;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Ni(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Xo();return t&&e.setAttribute("nonce",t),e}function Ai(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Ii(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var or=function(){var e=0,t=null;return{add:function(r){e==0&&(t=Ni())&&(Ai(t,r),Ii(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}};var ar=function(){var e=or();return function(t,r){Zo.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}};var Ve=function(){var e=ar(),t=function(r){var o=r.styles,a=r.dynamic;return e(o,a),null};return t};var Li={left:0,top:0,right:0,gap:0},nr=function(e){return parseInt(e||"",10)||0},Ti=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],o=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[nr(r),nr(o),nr(a)]},ir=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Li;var t=Ti(e),r=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-r+t[2]-t[0])}};var ki=Ve(),Pe="data-scroll-locked",Mi=function(e,t,r,o){var a=e.left,n=e.top,s=e.right,i=e.gap;return r===void 0&&(r="margin"),` .`.concat(Zt,` { overflow: hidden `).concat(o,`; padding-right: `).concat(i,"px ").concat(o,`; } body[`).concat(Pe,`] { 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(s,`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(ve,` { right: `).concat(i,"px ").concat(o,`; } .`).concat(he,` { margin-right: `).concat(i,"px ").concat(o,`; } .`).concat(ve," .").concat(ve,` { right: 0 `).concat(o,`; } .`).concat(he," .").concat(he,` { margin-right: 0 `).concat(o,`; } body[`).concat(Pe,`] { `).concat(Jt,": ").concat(i,`px; } `)},Jo=function(){var e=parseInt(document.body.getAttribute(Pe)||"0",10);return isFinite(e)?e:0},Fi=function(){De.useEffect(function(){return document.body.setAttribute(Pe,(Jo()+1).toString()),function(){var e=Jo()-1;e<=0?document.body.removeAttribute(Pe):document.body.setAttribute(Pe,e.toString())}},[])},sr=function(e){var t=e.noRelative,r=e.noImportant,o=e.gapMode,a=o===void 0?"margin":o;Fi();var n=De.useMemo(function(){return ir(a)},[a]);return De.createElement(ki,{styles:Mi(n,!t,a,r?"":"!important")})};var lr=!1;if(typeof window<"u")try{$e=Object.defineProperty({},"passive",{get:function(){return lr=!0,!0}}),window.addEventListener("test",$e,$e),window.removeEventListener("test",$e,$e)}catch{lr=!1}var $e,ge=lr?{passive:!1}:!1;var ji=function(e){return e.tagName==="TEXTAREA"},Qo=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!ji(e)&&r[t]==="visible")},Wi=function(e){return Qo(e,"overflowY")},Bi=function(e){return Qo(e,"overflowX")},ur=function(e,t){var r=t.ownerDocument,o=t;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var a=ea(e,o);if(a){var n=ta(e,o),s=n[1],i=n[2];if(s>i)return!0}o=o.parentNode}while(o&&o!==r.body);return!1},Vi=function(e){var t=e.scrollTop,r=e.scrollHeight,o=e.clientHeight;return[t,r,o]},$i=function(e){var t=e.scrollLeft,r=e.scrollWidth,o=e.clientWidth;return[t,r,o]},ea=function(e,t){return e==="v"?Wi(t):Bi(t)},ta=function(e,t){return e==="v"?Vi(t):$i(t)},Ui=function(e,t){return e==="h"&&t==="rtl"?-1:1},ra=function(e,t,r,o,a){var n=Ui(e,window.getComputedStyle(t).direction),s=n*o,i=r.target,u=t.contains(i),l=!1,c=s>0,f=0,h=0;do{if(!i)break;var g=ta(e,i),_=g[0],p=g[1],b=g[2],S=p-b-n*_;(_||S)&&ea(e,i)&&(f+=S,h+=_);var P=i.parentNode;i=P&&P.nodeType===Node.DOCUMENT_FRAGMENT_NODE?P.host:P}while(!u&&i!==document.body||u&&(t.contains(i)||t===i));return(c&&(a&&Math.abs(f)<1||!a&&s>f)||!c&&(a&&Math.abs(h)<1||!a&&-s>h))&&(l=!0),l};var ct=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},oa=function(e){return[e.deltaX,e.deltaY]},aa=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;} `)},Ki=0,Ne=[];function na(e){var t=L.useRef([]),r=L.useRef([0,0]),o=L.useRef(),a=L.useState(Ki++)[0],n=L.useState(Ve)[0],s=L.useRef(e);L.useEffect(function(){s.current=e},[e]),L.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var p=Uo([e.lockRef.current],(e.shards||[]).map(aa),!0).filter(Boolean);return p.forEach(function(b){return b.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),p.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var i=L.useCallback(function(p,b){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!s.current.allowPinchZoom;var S=ct(p),P=r.current,T="deltaX"in p?p.deltaX:P[0]-S[0],k="deltaY"in p?p.deltaY:P[1]-S[1],D,C=p.target,R=Math.abs(T)>Math.abs(k)?"h":"v";if("touches"in p&&R==="h"&&C.type==="range")return!1;var z=ur(R,C);if(!z)return!0;if(z?D=R:(D=R==="v"?"h":"v",z=ur(R,C)),!z)return!1;if(!o.current&&"changedTouches"in p&&(T||k)&&(o.current=D),!D)return!0;var se=o.current||D;return ra(se,b,p,se==="h"?T:k,!0)},[]),u=L.useCallback(function(p){var b=p;if(!(!Ne.length||Ne[Ne.length-1]!==n)){var S="deltaY"in b?oa(b):ct(b),P=t.current.filter(function(D){return D.name===b.type&&(D.target===b.target||b.target===D.shadowParent)&&Hi(D.delta,S)})[0];if(P&&P.should){b.cancelable&&b.preventDefault();return}if(!P){var T=(s.current.shards||[]).map(aa).filter(Boolean).filter(function(D){return D.contains(b.target)}),k=T.length>0?i(b,T[0]):!s.current.noIsolation;k&&b.cancelable&&b.preventDefault()}}},[]),l=L.useCallback(function(p,b,S,P){var T={name:p,delta:b,target:S,should:P,shadowParent:zi(S)};t.current.push(T),setTimeout(function(){t.current=t.current.filter(function(k){return k!==T})},1)},[]),c=L.useCallback(function(p){r.current=ct(p),o.current=void 0},[]),f=L.useCallback(function(p){l(p.type,oa(p),p.target,i(p,e.lockRef.current))},[]),h=L.useCallback(function(p){l(p.type,ct(p),p.target,i(p,e.lockRef.current))},[]);L.useEffect(function(){return Ne.push(n),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",u,ge),document.addEventListener("touchmove",u,ge),document.addEventListener("touchstart",c,ge),function(){Ne=Ne.filter(function(p){return p!==n}),document.removeEventListener("wheel",u,ge),document.removeEventListener("touchmove",u,ge),document.removeEventListener("touchstart",c,ge)}},[]);var g=e.removeScrollBar,_=e.inert;return L.createElement(L.Fragment,null,_?L.createElement(n,{styles:Gi(a)}):null,g?L.createElement(sr,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function zi(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var ia=tr(ft,na);var sa=dt.forwardRef(function(e,t){return dt.createElement(Be,X({},e,{ref:t,sideCar:ia}))});sa.classNames=Be.classNames;var fr=sa;var qi=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ae=new WeakMap,mt=new WeakMap,pt={},cr=0,la=function(e){return e&&(e.host||la(e.parentNode))},Yi=function(e,t){return t.map(function(r){if(e.contains(r))return r;var o=la(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})},Xi=function(e,t,r,o){var a=Yi(t,Array.isArray(e)?e:[e]);pt[r]||(pt[r]=new WeakMap);var n=pt[r],s=[],i=new Set,u=new Set(a),l=function(f){!f||i.has(f)||(i.add(f),l(f.parentNode))};a.forEach(l);var c=function(f){!f||u.has(f)||Array.prototype.forEach.call(f.children,function(h){if(i.has(h))c(h);else try{var g=h.getAttribute(o),_=g!==null&&g!=="false",p=(Ae.get(h)||0)+1,b=(n.get(h)||0)+1;Ae.set(h,p),n.set(h,b),s.push(h),p===1&&_&&mt.set(h,!0),b===1&&h.setAttribute(r,"true"),_||h.setAttribute(o,"true")}catch(S){console.error("aria-hidden: cannot operate on ",h,S)}})};return c(t),i.clear(),cr++,function(){s.forEach(function(f){var h=Ae.get(f)-1,g=n.get(f)-1;Ae.set(f,h),n.set(f,g),h||(mt.has(f)||f.removeAttribute(o),mt.delete(f)),g||f.removeAttribute(r)}),cr--,cr||(Ae=new WeakMap,Ae=new WeakMap,mt=new WeakMap,pt={})}},ua=function(e,t,r){r===void 0&&(r="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),a=t||qi(e);return a?(o.push.apply(o,Array.from(a.querySelectorAll("[aria-live], script"))),Xi(o,a,r,"aria-hidden")):function(){return null}};var N=m(B(),1),ht="Dialog",[fa,Ff]=Kr(ht),[Zi,te]=fa(ht),ca=e=>{let{__scopeDialog:t,children:r,open:o,defaultOpen:a,onOpenChange:n,modal:s=!0}=e,i=I.useRef(null),u=I.useRef(null),[l,c]=qr({prop:o,defaultProp:a??!1,onChange:n,caller:ht});return(0,N.jsx)(Zi,{scope:t,triggerRef:i,contentRef:u,contentId:Ze(),titleId:Ze(),descriptionId:Ze(),open:l,onOpenChange:c,onOpenToggle:I.useCallback(()=>c(f=>!f),[c]),modal:s,children:r})};ca.displayName=ht;var da="DialogTrigger",Ji=I.forwardRef((e,t)=>{let{__scopeDialog:r,...o}=e,a=te(da,r),n=Ye(t,a.triggerRef);return(0,N.jsx)(_e.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":pr(a.open),...o,ref:n,onClick:Se(e.onClick,a.onOpenToggle)})});Ji.displayName=da;var dr="DialogPortal",[Qi,ma]=fa(dr,{forceMount:void 0}),pa=e=>{let{__scopeDialog:t,forceMount:r,children:o,container:a}=e,n=te(dr,t);return(0,N.jsx)(Qi,{scope:t,forceMount:r,children:I.Children.map(o,s=>(0,N.jsx)(We,{present:r||n.open,children:(0,N.jsx)(qt,{asChild:!0,container:a,children:s})}))})};pa.displayName=dr;var vt="DialogOverlay",va=I.forwardRef((e,t)=>{let r=ma(vt,e.__scopeDialog),{forceMount:o=r.forceMount,...a}=e,n=te(vt,e.__scopeDialog);return n.modal?(0,N.jsx)(We,{present:o||n.open,children:(0,N.jsx)(ts,{...a,ref:t})}):null});va.displayName=vt;var es=it("DialogOverlay.RemoveScroll"),ts=I.forwardRef((e,t)=>{let{__scopeDialog:r,...o}=e,a=te(vt,r);return(0,N.jsx)(fr,{as:es,allowPinchZoom:!0,shards:[a.contentRef],children:(0,N.jsx)(_e.div,{"data-state":pr(a.open),...o,ref:t,style:{pointerEvents:"auto",...o.style}})})}),ye="DialogContent",ha=I.forwardRef((e,t)=>{let r=ma(ye,e.__scopeDialog),{forceMount:o=r.forceMount,...a}=e,n=te(ye,e.__scopeDialog);return(0,N.jsx)(We,{present:o||n.open,children:n.modal?(0,N.jsx)(rs,{...a,ref:t}):(0,N.jsx)(os,{...a,ref:t})})});ha.displayName=ye;var rs=I.forwardRef((e,t)=>{let r=te(ye,e.__scopeDialog),o=I.useRef(null),a=Ye(t,r.contentRef,o);return I.useEffect(()=>{let n=o.current;if(n)return ua(n)},[]),(0,N.jsx)(ga,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Se(e.onCloseAutoFocus,n=>{n.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:Se(e.onPointerDownOutside,n=>{let s=n.detail.originalEvent,i=s.button===0&&s.ctrlKey===!0;(s.button===2||i)&&n.preventDefault()}),onFocusOutside:Se(e.onFocusOutside,n=>n.preventDefault())})}),os=I.forwardRef((e,t)=>{let r=te(ye,e.__scopeDialog),o=I.useRef(!1),a=I.useRef(!1);return(0,N.jsx)(ga,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:n=>{e.onCloseAutoFocus?.(n),n.defaultPrevented||(o.current||r.triggerRef.current?.focus(),n.preventDefault()),o.current=!1,a.current=!1},onInteractOutside:n=>{e.onInteractOutside?.(n),n.defaultPrevented||(o.current=!0,n.detail.originalEvent.type==="pointerdown"&&(a.current=!0));let s=n.target;r.triggerRef.current?.contains(s)&&n.preventDefault(),n.detail.originalEvent.type==="focusin"&&a.current&&n.preventDefault()}})}),ga=I.forwardRef((e,t)=>{let{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:n,...s}=e,i=te(ye,r),u=I.useRef(null),l=Ye(t,u);return $o(),(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(zt,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:a,onUnmountAutoFocus:n,children:(0,N.jsx)($t,{role:"dialog",id:i.contentId,"aria-describedby":i.descriptionId,"aria-labelledby":i.titleId,"data-state":pr(i.open),...s,ref:l,onDismiss:()=>i.onOpenChange(!1)})}),(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ss,{titleId:i.titleId}),(0,N.jsx)(us,{contentRef:u,descriptionId:i.descriptionId})]})]})}),mr="DialogTitle",as=I.forwardRef((e,t)=>{let{__scopeDialog:r,...o}=e,a=te(mr,r);return(0,N.jsx)(_e.h2,{id:a.titleId,...o,ref:t})});as.displayName=mr;var ya="DialogDescription",ns=I.forwardRef((e,t)=>{let{__scopeDialog:r,...o}=e,a=te(ya,r);return(0,N.jsx)(_e.p,{id:a.descriptionId,...o,ref:t})});ns.displayName=ya;var Ra="DialogClose",is=I.forwardRef((e,t)=>{let{__scopeDialog:r,...o}=e,a=te(Ra,r);return(0,N.jsx)(_e.button,{type:"button",...o,ref:t,onClick:Se(e.onClick,()=>a.onOpenChange(!1))})});is.displayName=Ra;function pr(e){return e?"open":"closed"}var ba="DialogTitleWarning",[jf,wa]=Gr(ba,{contentName:ye,titleName:mr,docsSlug:"dialog"}),ss=({titleId:e})=>{let t=wa(ba),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. 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 I.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},ls="DialogDescriptionWarning",us=({contentRef:e,descriptionId:t})=>{let o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${wa(ls).contentName}}.`;return I.useEffect(()=>{let a=e.current?.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(o))},[o,e,t]),null},Ea=ca;var Ca=pa,Sa=va,xa=ha;var v=m(w(),1);var Da=m(w(),1),Rs=m(pe(),1);var j=m(w(),1);var cs=m(w(),1);function Oa(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ue(...e){return t=>{let r=!1,o=e.map(a=>{let n=Oa(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():Oa(e[a],null)}}}}var gt=m(B(),1),ds=Symbol.for("react.lazy"),yt=j[" use ".trim().toString()];function ms(e){return typeof e=="object"&&e!==null&&"then"in e}function _a(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===ds&&"_payload"in e&&ms(e._payload)}function Pa(e){let t=ps(e),r=j.forwardRef((o,a)=>{let{children:n,...s}=o;_a(n)&&typeof yt=="function"&&(n=yt(n._payload));let i=j.Children.toArray(n),u=i.find(hs);if(u){let l=u.props.children,c=i.map(f=>f===u?j.Children.count(l)>1?j.Children.only(null):j.isValidElement(l)?l.props.children:null:f);return(0,gt.jsx)(t,{...s,ref:a,children:j.isValidElement(l)?j.cloneElement(l,void 0,c):null})}return(0,gt.jsx)(t,{...s,ref:a,children:n})});return r.displayName=`${e}.Slot`,r}function ps(e){let t=j.forwardRef((r,o)=>{let{children:a,...n}=r;if(_a(a)&&typeof yt=="function"&&(a=yt(a._payload)),j.isValidElement(a)){let s=ys(a),i=gs(n,a.props);return a.type!==j.Fragment&&(i.ref=o?ue(o,s):s),j.cloneElement(a,i)}return j.Children.count(a)>1?j.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var vs=Symbol("radix.slottable");function hs(e){return j.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===vs}function gs(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 ys(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 Na=m(B(),1),bs=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ie=bs.reduce((e,t)=>{let r=Pa(`Primitive.${t}`),o=Da.forwardRef((a,n)=>{let{asChild:s,...i}=a,u=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),(0,Na.jsx)(u,{...i,ref:n})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});var vr=m(w(),1);var Aa=m(w(),1),Ia=globalThis?.document?Aa.useLayoutEffect:()=>{};var ws=vr[" useId ".trim().toString()]||(()=>{}),Es=0;function Re(e){let[t,r]=vr.useState(ws());return Ia(()=>{e||r(o=>o??String(Es++))},[e]),e||(t?`radix-${t}`:"")}var Ue='[cmdk-group=""]',hr='[cmdk-group-items=""]',Cs='[cmdk-group-heading=""]',Ta='[cmdk-item=""]',La=`${Ta}:not([aria-disabled="true"])`,gr="cmdk-item-select",Ie="data-value",Ss=(e,t,r)=>Br(e,t,r),ka=v.createContext(void 0),He=()=>v.useContext(ka),Ma=v.createContext(void 0),yr=()=>v.useContext(Ma),Fa=v.createContext(void 0),ja=v.forwardRef((e,t)=>{let r=Le(()=>{var d,E;return{search:"",value:(E=(d=e.value)!=null?d:e.defaultValue)!=null?E:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),o=Le(()=>new Set),a=Le(()=>new Map),n=Le(()=>new Map),s=Le(()=>new Set),i=Wa(e),{label:u,children:l,value:c,onValueChange:f,filter:h,shouldFilter:g,loop:_,disablePointerSelection:p=!1,vimBindings:b=!0,...S}=e,P=Re(),T=Re(),k=Re(),D=v.useRef(null),C=ks();be(()=>{if(c!==void 0){let d=c.trim();r.current.value=d,R.emit()}},[c]),be(()=>{C(6,Ar)},[]);let R=v.useMemo(()=>({subscribe:d=>(s.current.add(d),()=>s.current.delete(d)),snapshot:()=>r.current,setState:(d,E,O)=>{var y,A,M,Z;if(!Object.is(r.current[d],E)){if(r.current[d]=E,d==="search")Pt(),me(),C(1,_t);else if(d==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let q=document.getElementById(k);q?q.focus():(y=document.getElementById(P))==null||y.focus()}if(C(7,()=>{var q;r.current.selectedItemId=(q=Ce())==null?void 0:q.id,R.emit()}),O||C(5,Ar),((A=i.current)==null?void 0:A.value)!==void 0){let q=E??"";(Z=(M=i.current).onValueChange)==null||Z.call(M,q);return}}R.emit()}},emit:()=>{s.current.forEach(d=>d())}}),[]),z=v.useMemo(()=>({value:(d,E,O)=>{var y;E!==((y=n.current.get(d))==null?void 0:y.value)&&(n.current.set(d,{value:E,keywords:O}),r.current.filtered.items.set(d,se(E,O)),C(2,()=>{me(),R.emit()}))},item:(d,E)=>(o.current.add(d),E&&(a.current.has(E)?a.current.get(E).add(d):a.current.set(E,new Set([d]))),C(3,()=>{Pt(),me(),r.current.value||_t(),R.emit()}),()=>{n.current.delete(d),o.current.delete(d),r.current.filtered.items.delete(d);let O=Ce();C(4,()=>{Pt(),O?.getAttribute("id")===d&&_t(),R.emit()})}),group:d=>(a.current.has(d)||a.current.set(d,new Set),()=>{n.current.delete(d),a.current.delete(d)}),filter:()=>i.current.shouldFilter,label:u||e["aria-label"],getDisablePointerSelection:()=>i.current.disablePointerSelection,listId:P,inputId:k,labelId:T,listInnerRef:D}),[]);function se(d,E){var O,y;let A=(y=(O=i.current)==null?void 0:O.filter)!=null?y:Ss;return d?A(d,r.current.search,E):0}function me(){if(!r.current.search||i.current.shouldFilter===!1)return;let d=r.current.filtered.items,E=[];r.current.filtered.groups.forEach(y=>{let A=a.current.get(y),M=0;A.forEach(Z=>{let q=d.get(Z);M=Math.max(q,M)}),E.push([y,M])});let O=D.current;Fe().sort((y,A)=>{var M,Z;let q=y.getAttribute("id"),Ke=A.getAttribute("id");return((M=d.get(Ke))!=null?M:0)-((Z=d.get(q))!=null?Z:0)}).forEach(y=>{let A=y.closest(hr);A?A.appendChild(y.parentElement===A?y:y.closest(`${hr} > *`)):O.appendChild(y.parentElement===O?y:y.closest(`${hr} > *`))}),E.sort((y,A)=>A[1]-y[1]).forEach(y=>{var A;let M=(A=D.current)==null?void 0:A.querySelector(`${Ue}[${Ie}="${encodeURIComponent(y[0])}"]`);M?.parentElement.appendChild(M)})}function _t(){let d=Fe().find(O=>O.getAttribute("aria-disabled")!=="true"),E=d?.getAttribute(Ie);R.setState("value",E||void 0)}function Pt(){var d,E,O,y;if(!r.current.search||i.current.shouldFilter===!1){r.current.filtered.count=o.current.size;return}r.current.filtered.groups=new Set;let A=0;for(let M of o.current){let Z=(E=(d=n.current.get(M))==null?void 0:d.value)!=null?E:"",q=(y=(O=n.current.get(M))==null?void 0:O.keywords)!=null?y:[],Ke=se(Z,q);r.current.filtered.items.set(M,Ke),Ke>0&&A++}for(let[M,Z]of a.current)for(let q of Z)if(r.current.filtered.items.get(q)>0){r.current.filtered.groups.add(M);break}r.current.filtered.count=A}function Ar(){var d,E,O;let y=Ce();y&&(((d=y.parentElement)==null?void 0:d.firstChild)===y&&((O=(E=y.closest(Ue))==null?void 0:E.querySelector(Cs))==null||O.scrollIntoView({block:"nearest"})),y.scrollIntoView({block:"nearest"}))}function Ce(){var d;return(d=D.current)==null?void 0:d.querySelector(`${Ta}[aria-selected="true"]`)}function Fe(){var d;return Array.from(((d=D.current)==null?void 0:d.querySelectorAll(La))||[])}function Dt(d){let E=Fe()[d];E&&R.setState("value",E.getAttribute(Ie))}function Nt(d){var E;let O=Ce(),y=Fe(),A=y.findIndex(Z=>Z===O),M=y[A+d];(E=i.current)!=null&&E.loop&&(M=A+d<0?y[y.length-1]:A+d===y.length?y[0]:y[A+d]),M&&R.setState("value",M.getAttribute(Ie))}function Ir(d){let E=Ce(),O=E?.closest(Ue),y;for(;O&&!y;)O=d>0?Ls(O,Ue):Ts(O,Ue),y=O?.querySelector(La);y?R.setState("value",y.getAttribute(Ie)):Nt(d)}let Lr=()=>Dt(Fe().length-1),Tr=d=>{d.preventDefault(),d.metaKey?Lr():d.altKey?Ir(1):Nt(1)},kr=d=>{d.preventDefault(),d.metaKey?Dt(0):d.altKey?Ir(-1):Nt(-1)};return v.createElement(ie.div,{ref:t,tabIndex:-1,...S,"cmdk-root":"",onKeyDown:d=>{var E;(E=S.onKeyDown)==null||E.call(S,d);let O=d.nativeEvent.isComposing||d.keyCode===229;if(!(d.defaultPrevented||O))switch(d.key){case"n":case"j":{b&&d.ctrlKey&&Tr(d);break}case"ArrowDown":{Tr(d);break}case"p":case"k":{b&&d.ctrlKey&&kr(d);break}case"ArrowUp":{kr(d);break}case"Home":{d.preventDefault(),Dt(0);break}case"End":{d.preventDefault(),Lr();break}case"Enter":{d.preventDefault();let y=Ce();if(y){let A=new Event(gr);y.dispatchEvent(A)}}}}},v.createElement("label",{"cmdk-label":"",htmlFor:z.inputId,id:z.labelId,style:Fs},u),Rt(e,d=>v.createElement(Ma.Provider,{value:R},v.createElement(ka.Provider,{value:z},d))))}),xs=v.forwardRef((e,t)=>{var r,o;let a=Re(),n=v.useRef(null),s=v.useContext(Fa),i=He(),u=Wa(e),l=(o=(r=u.current)==null?void 0:r.forceMount)!=null?o:s?.forceMount;be(()=>{if(!l)return i.item(a,s?.id)},[l]);let c=Ba(a,n,[e.value,e.children,n],e.keywords),f=yr(),h=ae(C=>C.value&&C.value===c.current),g=ae(C=>l||i.filter()===!1?!0:C.search?C.filtered.items.get(a)>0:!0);v.useEffect(()=>{let C=n.current;if(!(!C||e.disabled))return C.addEventListener(gr,_),()=>C.removeEventListener(gr,_)},[g,e.onSelect,e.disabled]);function _(){var C,R;p(),(R=(C=u.current).onSelect)==null||R.call(C,c.current)}function p(){f.setState("value",c.current,!0)}if(!g)return null;let{disabled:b,value:S,onSelect:P,forceMount:T,keywords:k,...D}=e;return v.createElement(ie.div,{ref:ue(n,t),...D,id:a,"cmdk-item":"",role:"option","aria-disabled":!!b,"aria-selected":!!h,"data-disabled":!!b,"data-selected":!!h,onPointerMove:b||i.getDisablePointerSelection()?void 0:p,onClick:b?void 0:_},e.children)}),Os=v.forwardRef((e,t)=>{let{heading:r,children:o,forceMount:a,...n}=e,s=Re(),i=v.useRef(null),u=v.useRef(null),l=Re(),c=He(),f=ae(g=>a||c.filter()===!1?!0:g.search?g.filtered.groups.has(s):!0);be(()=>c.group(s),[]),Ba(s,i,[e.value,e.heading,u]);let h=v.useMemo(()=>({id:s,forceMount:a}),[a]);return v.createElement(ie.div,{ref:ue(i,t),...n,"cmdk-group":"",role:"presentation",hidden:f?void 0:!0},r&&v.createElement("div",{ref:u,"cmdk-group-heading":"","aria-hidden":!0,id:l},r),Rt(e,g=>v.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?l:void 0},v.createElement(Fa.Provider,{value:h},g))))}),_s=v.forwardRef((e,t)=>{let{alwaysRender:r,...o}=e,a=v.useRef(null),n=ae(s=>!s.search);return!r&&!n?null:v.createElement(ie.div,{ref:ue(a,t),...o,"cmdk-separator":"",role:"separator"})}),Ps=v.forwardRef((e,t)=>{let{onValueChange:r,...o}=e,a=e.value!=null,n=yr(),s=ae(l=>l.search),i=ae(l=>l.selectedItemId),u=He();return v.useEffect(()=>{e.value!=null&&n.setState("search",e.value)},[e.value]),v.createElement(ie.input,{ref:t,...o,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":u.listId,"aria-labelledby":u.labelId,"aria-activedescendant":i,id:u.inputId,type:"text",value:a?e.value:s,onChange:l=>{a||n.setState("search",l.target.value),r?.(l.target.value)}})}),Ds=v.forwardRef((e,t)=>{let{children:r,label:o="Suggestions",...a}=e,n=v.useRef(null),s=v.useRef(null),i=ae(l=>l.selectedItemId),u=He();return v.useEffect(()=>{if(s.current&&n.current){let l=s.current,c=n.current,f,h=new ResizeObserver(()=>{f=requestAnimationFrame(()=>{let g=l.offsetHeight;c.style.setProperty("--cmdk-list-height",g.toFixed(1)+"px")})});return h.observe(l),()=>{cancelAnimationFrame(f),h.unobserve(l)}}},[]),v.createElement(ie.div,{ref:ue(n,t),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":i,"aria-label":o,id:u.listId},Rt(e,l=>v.createElement("div",{ref:ue(s,u.listInnerRef),"cmdk-list-sizer":""},l)))}),Ns=v.forwardRef((e,t)=>{let{open:r,onOpenChange:o,overlayClassName:a,contentClassName:n,container:s,...i}=e;return v.createElement(Ea,{open:r,onOpenChange:o},v.createElement(Ca,{container:s},v.createElement(Sa,{"cmdk-overlay":"",className:a}),v.createElement(xa,{"aria-label":e.label,"cmdk-dialog":"",className:n},v.createElement(ja,{ref:t,...i}))))}),As=v.forwardRef((e,t)=>ae(r=>r.filtered.count===0)?v.createElement(ie.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Is=v.forwardRef((e,t)=>{let{progress:r,children:o,label:a="Loading...",...n}=e;return v.createElement(ie.div,{ref:t,...n,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},Rt(e,s=>v.createElement("div",{"aria-hidden":!0},s)))}),fe=Object.assign(ja,{List:Ds,Item:xs,Input:Ps,Group:Os,Separator:_s,Dialog:Ns,Empty:As,Loading:Is});function Ls(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function Ts(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function Wa(e){let t=v.useRef(e);return be(()=>{t.current=e}),t}var be=typeof window>"u"?v.useEffect:v.useLayoutEffect;function Le(e){let t=v.useRef();return t.current===void 0&&(t.current=e()),t}function ae(e){let t=yr(),r=()=>e(t.snapshot());return v.useSyncExternalStore(t.subscribe,r,r)}function Ba(e,t,r,o=[]){let a=v.useRef(),n=He();return be(()=>{var s;let i=(()=>{var l;for(let c of r){if(typeof c=="string")return c.trim();if(typeof c=="object"&&"current"in c)return c.current?(l=c.current.textContent)==null?void 0:l.trim():a.current}})(),u=o.map(l=>l.trim());n.value(e,i,u),(s=t.current)==null||s.setAttribute(Ie,i),a.current=i}),a}var ks=()=>{let[e,t]=v.useState(),r=Le(()=>new Map);return be(()=>{r.current.forEach(o=>o()),r.current=new Map},[e]),(o,a)=>{r.current.set(o,a),t({})}};function Ms(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Rt({asChild:e,children:t},r){return e&&v.isValidElement(t)?v.cloneElement(Ms(t),{ref:t.ref},r(t.props.children)):r(t)}var Fs={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function Va(e){var t,r,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=Va(e[t]))&&(o&&(o+=" "),o+=r)}else for(r in e)e[r]&&(o&&(o+=" "),o+=r);return o}function js(){for(var e,t,r=0,o="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=Va(e))&&(o&&(o+=" "),o+=t);return o}var Rr=js;var Me=m(ce(),1),W=m(Te(),1),re=m(Ga(),1),ne=m(za(),1),xt=m(Ya(),1);var bt=m(Te(),1),we=(0,bt.forwardRef)(({icon:e,size:t=24,...r},o)=>(0,bt.cloneElement)(e,{width:t,height:t,...r,ref:o}));var wt=m(br(),1),wr=m(B(),1),Er=(0,wr.jsx)(wt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,wr.jsx)(wt.Path,{d:"m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z"})});var Et=m(br(),1),Cr=m(B(),1),Sr=(0,Cr.jsx)(Et.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Cr.jsx)(Et.Path,{d:"M13 5c-3.3 0-6 2.7-6 6 0 1.4.5 2.7 1.3 3.7l-3.8 3.8 1.1 1.1 3.8-3.8c1 .8 2.3 1.3 3.7 1.3 3.3 0 6-2.7 6-6S16.3 5 13 5zm0 10.5c-2.5 0-4.5-2-4.5-4.5s2-4.5 4.5-4.5 4.5 2 4.5 4.5-2 4.5-4.5 4.5z"})});var Ct=m(ce(),1);var Za=m(ce(),1);function Ws(e={},t){switch(t.type){case"REGISTER_COMMAND":return{...e,[t.name]:{name:t.name,label:t.label,searchLabel:t.searchLabel,context:t.context,category:t.category,callback:t.callback,icon:t.icon,keywords:t.keywords}};case"UNREGISTER_COMMAND":{let{[t.name]:r,...o}=e;return o}}return e}function Bs(e={},t){switch(t.type){case"REGISTER_COMMAND_LOADER":return{...e,[t.name]:{name:t.name,context:t.context,category:t.category,hook:t.hook}};case"UNREGISTER_COMMAND_LOADER":{let{[t.name]:r,...o}=e;return o}}return e}function Vs(e=!1,t){switch(t.type){case"OPEN":return!0;case"CLOSE":return!1}return e}function $s(e="root",t){return t.type==="SET_CONTEXT"?t.context:e}var Us=(0,Za.combineReducers)({commands:Ws,commandLoaders:Bs,isOpen:Vs,context:$s}),Ja=Us;var xr={};qe(xr,{close:()=>Ys,open:()=>qs,registerCommand:()=>Hs,registerCommandLoader:()=>Ks,unregisterCommand:()=>Gs,unregisterCommandLoader:()=>zs});var Qa=new Set(["command","view","edit","action"]);function Hs(e){let{category:t}=e;return(!t||!Qa.has(t))&&(t="action"),{type:"REGISTER_COMMAND",...e,category:t}}function Gs(e){return{type:"UNREGISTER_COMMAND",name:e}}function Ks(e){let{category:t}=e;return(!t||!Qa.has(t))&&(t="action"),{type:"REGISTER_COMMAND_LOADER",...e,category:t}}function zs(e){return{type:"UNREGISTER_COMMAND_LOADER",name:e}}function qs(){return{type:"OPEN"}}function Ys(){return{type:"CLOSE"}}var _r={};qe(_r,{getCommandLoaders:()=>Zs,getCommands:()=>Xs,getContext:()=>Qs,isOpen:()=>Js});var Or=m(ce(),1),Xs=(0,Or.createSelector)((e,t=!1)=>Object.values(e.commands).filter(r=>{let o=r.context&&r.context===e.context;return t?o:!o}),e=>[e.commands,e.context]),Zs=(0,Or.createSelector)((e,t=!1)=>Object.values(e.commandLoaders).filter(r=>{let o=r.context&&r.context===e.context;return t?o:!o}),e=>[e.commandLoaders,e.context]);function Js(e){return e.isOpen}function Qs(e){return e.context}var Pr={};qe(Pr,{setContext:()=>el});function el(e){return{type:"SET_CONTEXT",context:e}}var rn=m(tn(),1),{lock:on,unlock:ke}=(0,rn.__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/commands");var tl="core/commands",K=(0,Ct.createReduxStore)(tl,{reducer:Ja,actions:xr,selectors:_r});(0,Ct.register)(K);ke(K).registerPrivateActions(Pr);var x=m(B(),1),{withIgnoreIMEEvents:rl}=ke(ne.privateApis),nn=(0,re.__)("Search commands and settings"),Ee={view:Er},St={command:(0,re.__)("Command"),view:(0,re.__)("View"),edit:(0,re.__)("Edit"),action:(0,re.__)("Action"),workflow:(0,re.__)("Workflow")};function ol(e){return!!e&&(typeof e=="string"||(0,W.isValidElement)(e)||typeof e=="function"||e instanceof W.Component)}function al({name:e,search:t,hook:r,setLoader:o,close:a,category:n}){let{isLoading:s,commands:i=[]}=r({search:t})??{};return(0,W.useEffect)(()=>{o(e,s)},[o,e,s]),i.length?(0,x.jsx)(x.Fragment,{children:i.map(u=>{let l=u.category??n;return(0,x.jsx)(fe.Item,{value:u.searchLabel??u.label,keywords:u.keywords,onSelect:()=>u.callback({close:a}),id:u.name,children:(0,x.jsxs)(ne.__experimentalHStack,{alignment:"left",className:Rr("commands-command-menu__item",{"has-icon":Ee[l]||u.icon}),children:[Ee[l]&&(0,x.jsx)(we,{icon:Ee[l]}),!Ee[l]&&ol(u.icon)&&(0,x.jsx)(we,{icon:u.icon}),(0,x.jsx)("span",{className:"commands-command-menu__item-label",children:(0,x.jsx)(ne.TextHighlight,{text:u.label,highlight:t})}),St[l]&&(0,x.jsx)("span",{className:"commands-command-menu__item-category",children:St[l]})]})},u.name)})}):null}function nl({hook:e,search:t,setLoader:r,close:o,category:a}){let n=(0,W.useRef)(e),[s,i]=(0,W.useState)(0);return(0,W.useEffect)(()=>{n.current!==e&&(n.current=e,i(u=>u+1))},[e]),(0,x.jsx)(al,{hook:n.current,search:t,setLoader:r,close:o,category:a},s)}function an({isContextual:e,search:t,setLoader:r,close:o}){let{commands:a,loaders:n}=(0,Me.useSelect)(s=>{let{getCommands:i,getCommandLoaders:u}=s(K);return{commands:i(e),loaders:u(e)}},[e]);return!a.length&&!n.length?null:(0,x.jsxs)(fe.Group,{children:[a.map(s=>(0,x.jsx)(fe.Item,{value:s.searchLabel??s.label,keywords:s.keywords,onSelect:()=>s.callback({close:o}),id:s.name,children:(0,x.jsxs)(ne.__experimentalHStack,{alignment:"left",className:Rr("commands-command-menu__item",{"has-icon":Ee[s.category]||s.icon}),children:[Ee[s.category]?(0,x.jsx)(we,{icon:Ee[s.category]}):s.icon&&(0,x.jsx)(we,{icon:s.icon}),(0,x.jsx)("span",{children:(0,x.jsx)(ne.TextHighlight,{text:s.label,highlight:t})}),St[s.category]&&(0,x.jsx)("span",{className:"commands-command-menu__item-category",children:St[s.category]})]})},s.name)),n.map(s=>(0,x.jsx)(nl,{hook:s.hook,search:t,setLoader:r,close:o,category:s.category},s.name))]})}function il({isOpen:e,search:t,setSearch:r}){let o=(0,W.useRef)(),a=ae(s=>s.value),n=(0,W.useMemo)(()=>document.querySelector(`[cmdk-item=""][data-value="${a}"]`)?.getAttribute("id"),[a]);return(0,W.useEffect)(()=>{e&&o.current.focus()},[e]),(0,x.jsx)(fe.Input,{ref:o,value:t,onValueChange:r,placeholder:nn,"aria-activedescendant":n})}function sn(){let{registerShortcut:e}=(0,Me.useDispatch)(xt.store),[t,r]=(0,W.useState)(""),o=(0,Me.useSelect)(f=>f(K).isOpen(),[]),{open:a,close:n}=(0,Me.useDispatch)(K),[s,i]=(0,W.useState)({});(0,W.useEffect)(()=>{e({name:"core/commands",category:"global",description:(0,re.__)("Open the command palette."),keyCombination:{modifier:"primary",character:"k"}})},[e]),(0,xt.useShortcut)("core/commands",rl(f=>{f.defaultPrevented||(f.preventDefault(),o?n():a())}),{bindGlobal:!0});let u=(0,W.useCallback)((f,h)=>i(g=>({...g,[f]:h})),[]),l=()=>{r(""),n()};if(!o)return!1;let c=Object.values(s).some(Boolean);return(0,x.jsx)(ne.Modal,{className:"commands-command-menu",overlayClassName:"commands-command-menu__overlay",onRequestClose:l,__experimentalHideHeader:!0,contentLabel:(0,re.__)("Command palette"),children:(0,x.jsx)("div",{className:"commands-command-menu__container",children:(0,x.jsxs)(fe,{label:nn,children:[(0,x.jsxs)("div",{className:"commands-command-menu__header",children:[(0,x.jsx)(we,{className:"commands-command-menu__header-search-icon",icon:Sr}),(0,x.jsx)(il,{search:t,setSearch:r,isOpen:o})]}),(0,x.jsxs)(fe.List,{label:(0,re.__)("Command suggestions"),children:[t&&!c&&(0,x.jsx)(fe.Empty,{children:(0,re.__)("No results found.")}),(0,x.jsx)(an,{search:t,setLoader:u,close:l,isContextual:!0}),t&&(0,x.jsx)(an,{search:t,setLoader:u,close:l})]})]})})})}var Ge=m(Te(),1),Ot=m(ce(),1);function ln(e){let{getContext:t}=(0,Ot.useSelect)(K),r=(0,Ge.useRef)(t()),{setContext:o}=ke((0,Ot.useDispatch)(K));(0,Ge.useEffect)(()=>{o(e)},[e,o]),(0,Ge.useEffect)(()=>{let a=r.current;return()=>o(a)},[o])}var Dr={};on(Dr,{useCommandContext:ln});var de=m(Te(),1),Nr=m(ce(),1);function un(e){let{registerCommand:t,unregisterCommand:r}=(0,Nr.useDispatch)(K),o=(0,de.useRef)(e.callback);(0,de.useEffect)(()=>{o.current=e.callback},[e.callback]),(0,de.useEffect)(()=>{if(!e.disabled)return t({name:e.name,context:e.context,category:e.category,label:e.label,searchLabel:e.searchLabel,icon:e.icon,keywords:e.keywords,callback:(...a)=>o.current(...a)}),()=>{r(e.name)}},[e.name,e.label,e.searchLabel,e.icon,e.context,e.category,e.keywords,e.disabled,t,r])}function fn(e){let{registerCommand:t,unregisterCommand:r}=(0,Nr.useDispatch)(K),o=(0,de.useRef)({});(0,de.useEffect)(()=>{e&&e.forEach(a=>{a.callback&&(o.current[a.name]=a.callback)})},[e]),(0,de.useEffect)(()=>{if(e)return e.forEach(a=>{a.disabled||t({name:a.name,context:a.context,category:a.category,label:a.label,searchLabel:a.searchLabel,icon:a.icon,keywords:a.keywords,callback:(...n)=>{let s=o.current[a.name];s&&s(...n)}})}),()=>{e.forEach(a=>{r(a.name)})}},[e,t,r])}var cn=m(Te(),1),dn=m(ce(),1);function mn(e){let{registerCommandLoader:t,unregisterCommandLoader:r}=(0,dn.useDispatch)(K);(0,cn.useEffect)(()=>{if(!e.disabled)return t({name:e.name,hook:e.hook,context:e.context,category:e.category}),()=>{r(e.name)}},[e.name,e.hook,e.context,e.category,e.disabled,t,r])}return Rn(sl);})(); list-reusable-blocks.js 0000644 00000032076 15206720414 0011141 0 ustar 00 var wp; (wp ||= {}).listReusableBlocks = (() => { 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/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; } }); // 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/blob var require_blob = __commonJS({ "package-external:@wordpress/blob"(exports, module) { module.exports = window.wp.blob; } }); // package-external:@wordpress/compose var require_compose = __commonJS({ "package-external:@wordpress/compose"(exports, module) { module.exports = window.wp.compose; } }); // package-external:@wordpress/components var require_components = __commonJS({ "package-external:@wordpress/components"(exports, module) { module.exports = window.wp.components; } }); // vendor-external:react/jsx-runtime var require_jsx_runtime = __commonJS({ "vendor-external:react/jsx-runtime"(exports, module) { module.exports = window.ReactJSXRuntime; } }); // packages/list-reusable-blocks/build-module/index.mjs var import_element2 = __toESM(require_element(), 1); var import_i18n3 = __toESM(require_i18n(), 1); // node_modules/tslib/tslib.es6.mjs var __assign = function() { __assign = Object.assign || function __assign2(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; // node_modules/lower-case/dist.es2015/index.js function lowerCase(str) { return str.toLowerCase(); } // node_modules/no-case/dist.es2015/index.js var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g]; var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi; function noCase(input, options) { if (options === void 0) { options = {}; } var _a = options.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options.transform, transform = _c === void 0 ? lowerCase : _c, _d = options.delimiter, delimiter = _d === void 0 ? " " : _d; var result = replace(replace(input, splitRegexp, "$1\0$2"), stripRegexp, "\0"); var start = 0; var end = result.length; while (result.charAt(start) === "\0") start++; while (result.charAt(end - 1) === "\0") end--; return result.slice(start, end).split("\0").map(transform).join(delimiter); } function replace(input, re, value) { if (re instanceof RegExp) return input.replace(re, value); return re.reduce(function(input2, re2) { return input2.replace(re2, value); }, input); } // node_modules/dot-case/dist.es2015/index.js function dotCase(input, options) { if (options === void 0) { options = {}; } return noCase(input, __assign({ delimiter: "." }, options)); } // node_modules/param-case/dist.es2015/index.js function paramCase(input, options) { if (options === void 0) { options = {}; } return dotCase(input, __assign({ delimiter: "-" }, options)); } // packages/list-reusable-blocks/build-module/utils/export.mjs var import_api_fetch = __toESM(require_api_fetch(), 1); var import_blob = __toESM(require_blob(), 1); async function exportReusableBlock(id) { const postType = await (0, import_api_fetch.default)({ path: `/wp/v2/types/wp_block` }); const post = await (0, import_api_fetch.default)({ path: `/wp/v2/${postType.rest_base}/${id}?context=edit` }); const title = post.title.raw; const content = post.content.raw; const syncStatus = post.wp_pattern_sync_status; const fileContent = JSON.stringify( { __file: "wp_block", title, content, syncStatus }, null, 2 ); const fileName = paramCase(title) + ".json"; (0, import_blob.downloadBlob)(fileName, fileContent, "application/json"); } var export_default = exportReusableBlock; // packages/list-reusable-blocks/build-module/components/import-dropdown/index.mjs var import_compose2 = __toESM(require_compose(), 1); var import_i18n2 = __toESM(require_i18n(), 1); var import_components2 = __toESM(require_components(), 1); // packages/list-reusable-blocks/build-module/components/import-form/index.mjs var import_element = __toESM(require_element(), 1); var import_compose = __toESM(require_compose(), 1); var import_i18n = __toESM(require_i18n(), 1); var import_components = __toESM(require_components(), 1); // packages/list-reusable-blocks/build-module/utils/import.mjs var import_api_fetch2 = __toESM(require_api_fetch(), 1); // packages/list-reusable-blocks/build-module/utils/file.mjs function readTextFile(file) { const reader = new window.FileReader(); return new Promise((resolve) => { reader.onload = () => { resolve(reader.result); }; reader.readAsText(file); }); } // packages/list-reusable-blocks/build-module/utils/import.mjs async function importReusableBlock(file) { const fileContent = await readTextFile(file); let parsedContent; try { parsedContent = JSON.parse(fileContent); } catch (e) { throw new Error("Invalid JSON file"); } if (parsedContent.__file !== "wp_block" || !parsedContent.title || !parsedContent.content || typeof parsedContent.title !== "string" || typeof parsedContent.content !== "string" || parsedContent.syncStatus && typeof parsedContent.syncStatus !== "string") { throw new Error("Invalid pattern JSON file"); } const postType = await (0, import_api_fetch2.default)({ path: `/wp/v2/types/wp_block` }); const reusableBlock = await (0, import_api_fetch2.default)({ path: `/wp/v2/${postType.rest_base}`, data: { title: parsedContent.title, content: parsedContent.content, status: "publish", meta: parsedContent.syncStatus === "unsynced" ? { wp_pattern_sync_status: parsedContent.syncStatus } : void 0 }, method: "POST" }); return reusableBlock; } var import_default = importReusableBlock; // packages/list-reusable-blocks/build-module/components/import-form/index.mjs var import_jsx_runtime = __toESM(require_jsx_runtime(), 1); function ImportForm({ instanceId, onUpload }) { const inputId = "list-reusable-blocks-import-form-" + instanceId; const formRef = (0, import_element.useRef)(); const [isLoading, setIsLoading] = (0, import_element.useState)(false); const [error, setError] = (0, import_element.useState)(null); const [file, setFile] = (0, import_element.useState)(null); const onChangeFile = (event) => { setFile(event.target.files[0]); setError(null); }; const onSubmit = (event) => { event.preventDefault(); if (!file) { return; } setIsLoading({ isLoading: true }); import_default(file).then((reusableBlock) => { if (!formRef) { return; } setIsLoading(false); onUpload(reusableBlock); }).catch((errors) => { if (!formRef) { return; } let uiMessage; switch (errors.message) { case "Invalid JSON file": uiMessage = (0, import_i18n.__)("Invalid JSON file"); break; case "Invalid pattern JSON file": uiMessage = (0, import_i18n.__)("Invalid pattern JSON file"); break; default: uiMessage = (0, import_i18n.__)("Unknown error"); } setIsLoading(false); setError(uiMessage); }); }; const onDismissError = () => { setError(null); }; return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)( "form", { className: "list-reusable-blocks-import-form", onSubmit, ref: formRef, children: [ error && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Notice, { status: "error", onRemove: () => onDismissError(), children: error }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)( "label", { htmlFor: inputId, className: "list-reusable-blocks-import-form__label", children: (0, import_i18n.__)("File") } ), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { id: inputId, type: "file", onChange: onChangeFile }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)( import_components.Button, { __next40pxDefaultSize: true, type: "submit", isBusy: isLoading, accessibleWhenDisabled: true, disabled: !file || isLoading, variant: "secondary", className: "list-reusable-blocks-import-form__button", children: (0, import_i18n._x)("Import", "button label") } ) ] } ); } var import_form_default = (0, import_compose.withInstanceId)(ImportForm); // packages/list-reusable-blocks/build-module/components/import-dropdown/index.mjs var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1); function ImportDropdown({ onUpload }) { return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)( import_components2.Dropdown, { popoverProps: { placement: "bottom-start" }, contentClassName: "list-reusable-blocks-import-dropdown__content", renderToggle: ({ isOpen, onToggle }) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)( import_components2.Button, { size: "compact", className: "list-reusable-blocks-import-dropdown__button", "aria-expanded": isOpen, onClick: onToggle, variant: "primary", children: (0, import_i18n2.__)("Import from JSON") } ), renderContent: ({ onClose }) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_form_default, { onUpload: (0, import_compose2.pipe)(onClose, onUpload) }) } ); } var import_dropdown_default = ImportDropdown; // packages/list-reusable-blocks/build-module/index.mjs var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1); document.body.addEventListener("click", (event) => { if (!event.target.classList.contains("wp-list-reusable-blocks__export")) { return; } event.preventDefault(); export_default(event.target.dataset.id); }); document.addEventListener("DOMContentLoaded", () => { const button = document.querySelector(".page-title-action"); if (!button) { return; } const showNotice = () => { const notice = document.createElement("div"); notice.className = "notice notice-success is-dismissible"; notice.innerHTML = `<p>${(0, import_i18n3.__)("Pattern imported successfully!")}</p>`; const headerEnd = document.querySelector(".wp-header-end"); if (!headerEnd) { return; } headerEnd.parentNode.insertBefore(notice, headerEnd); }; const container = document.createElement("div"); container.className = "list-reusable-blocks__container"; button.parentNode.insertBefore(container, button); (0, import_element2.createRoot)(container).render( /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_element2.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_dropdown_default, { onUpload: showNotice }) }) ); }); })(); format-library.min.js 0000644 00000071544 15206720414 0010632 0 ustar 00 var wp;(wp||={}).formatLibrary=(()=>{var Ur=Object.create;var ra=Object.defineProperty;var zr=Object.getOwnPropertyDescriptor;var Dr=Object.getOwnPropertyNames;var Or=Object.getPrototypeOf,Wr=Object.prototype.hasOwnProperty;var Gr=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,a)=>(typeof require<"u"?require:e)[a]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var I=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Zr=(t,e,a,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Dr(e))!Wr.call(t,s)&&s!==a&&ra(t,s,{get:()=>e[s],enumerable:!(o=zr(e,s))||o.enumerable});return t};var r=(t,e,a)=>(a=t!=null?Ur(Or(t)):{},Zr(e||!t||!t.__esModule?ra(a,"default",{value:t,enumerable:!0}):a,t));var x=I((yo,oa)=>{oa.exports=window.wp.richText});var b=I((ko,sa)=>{sa.exports=window.wp.i18n});var y=I((vo,la)=>{la.exports=window.wp.blockEditor});var F=I((Co,fa)=>{fa.exports=window.wp.element});var L=I((So,ia)=>{ia.exports=window.wp.primitives});var n=I((To,ma)=>{ma.exports=window.ReactJSXRuntime});var J=I((fs,ca)=>{ca.exports=window.wp.components});var Ft=I((ns,ba)=>{ba.exports=window.wp.url});var ya=I((ds,wa)=>{wa.exports=window.wp.htmlEntities});var Et=I((ps,ka)=>{ka.exports=window.wp.a11y});var We=I((cs,va)=>{va.exports=window.wp.data});var La=I((gs,Ta)=>{Ta.exports=window.wp.compose});var qa=I((Bs,Ka)=>{Ka.exports=window.wp.privateApis});var Pr=r(x(),1);var ua=r(b(),1),Ee=r(x(),1),lt=r(y(),1);var bt=r(F(),1),le=(0,bt.forwardRef)(({icon:t,size:e=24,...a},o)=>(0,bt.cloneElement)(t,{width:e,height:e,...a,ref:o}));var wt=r(L(),1),fe=r(n(),1),ie=(0,fe.jsx)(wt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,fe.jsx)(wt.Path,{d:"M8 12.5h8V11H8v1.5Z M19 6.5H5a2 2 0 0 0-2 2V15a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8.5a2 2 0 0 0-2-2ZM5 8h14a.5.5 0 0 1 .5.5V15a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V8.5A.5.5 0 0 1 5 8Z"})});var yt=r(L(),1),me=r(n(),1),ue=(0,me.jsx)(yt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,me.jsx)(yt.Path,{d:"M20.8 10.7l-4.3-4.3-1.1 1.1 4.3 4.3c.1.1.1.3 0 .4l-4.3 4.3 1.1 1.1 4.3-4.3c.7-.8.7-1.9 0-2.6zM4.2 11.8l4.3-4.3-1-1-4.3 4.3c-.7.7-.7 1.8 0 2.5l4.3 4.3 1.1-1.1-4.3-4.3c-.2-.1-.2-.3-.1-.4z"})});var kt=r(L(),1),ne=r(n(),1),de=(0,ne.jsx)(kt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,ne.jsx)(kt.Path,{d:"M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3zm-5.1 7.6c-2.5 0-4.6-2.1-4.6-4.6 0-.3.1-1 .8-2.3.5-.9 1.1-1.9 2-3.1.7-.9 1.3-1.7 1.8-2.3.7.8 1.3 1.6 1.8 2.3.8 1.1 1.5 2.2 2 3.1.7 1.3.8 2 .8 2.3 0 2.5-2.1 4.6-4.6 4.6z"})});var vt=r(L(),1),pe=r(n(),1),ce=(0,pe.jsx)(vt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,pe.jsx)(vt.Path,{d:"M14.7 11.3c1-.6 1.5-1.6 1.5-3 0-2.3-1.3-3.4-4-3.4H7v14h5.8c1.4 0 2.5-.3 3.3-1 .8-.7 1.2-1.7 1.2-2.9.1-1.9-.8-3.1-2.6-3.7zm-5.1-4h2.3c.6 0 1.1.1 1.4.4.3.3.5.7.5 1.2s-.2 1-.5 1.2c-.3.3-.8.4-1.4.4H9.6V7.3zm4.6 9c-.4.3-1 .4-1.7.4H9.6v-3.9h2.9c.7 0 1.3.2 1.7.5.4.3.6.8.6 1.5s-.2 1.2-.6 1.5z"})});var Ct=r(L(),1),he=r(n(),1),ge=(0,he.jsx)(Ct.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,he.jsx)(Ct.Path,{d:"M12.5 5L10 19h1.9l2.5-14z"})});var _t=r(L(),1),xe=r(n(),1),be=(0,xe.jsx)(_t.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,xe.jsx)(_t.Path,{d:"M9.1 9v-.5c0-.6.2-1.1.7-1.4.5-.3 1.2-.5 2-.5.7 0 1.4.1 2.1.3.7.2 1.4.5 2.1.9l.2-1.9c-.6-.3-1.2-.5-1.9-.7-.8-.1-1.6-.2-2.4-.2-1.5 0-2.7.3-3.6 1-.8.7-1.2 1.5-1.2 2.6V9h2zM20 12H4v1h8.3c.3.1.6.2.8.3.5.2.9.5 1.1.8.3.3.4.7.4 1.2 0 .7-.2 1.1-.8 1.5-.5.3-1.2.5-2.1.5-.8 0-1.6-.1-2.4-.3-.8-.2-1.5-.5-2.2-.8L7 18.1c.5.2 1.2.4 2 .6.8.2 1.6.3 2.4.3 1.7 0 3-.3 3.9-1 .9-.7 1.3-1.6 1.3-2.8 0-.9-.2-1.7-.7-2.2H20v-1z"})});var St=r(L(),1),we=r(n(),1),ye=(0,we.jsx)(St.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,we.jsx)(St.Path,{d:"M12 4a8 8 0 1 1 .001 16.001A8 8 0 0 1 12 4Zm0 1.5a6.5 6.5 0 1 0-.001 13.001A6.5 6.5 0 0 0 12 5.5Zm.75 11h-1.5V15h1.5v1.5Zm-.445-9.234a3 3 0 0 1 .445 5.89V14h-1.5v-1.25c0-.57.452-.958.917-1.01A1.5 1.5 0 0 0 12 8.75a1.5 1.5 0 0 0-1.5 1.5H9a3 3 0 0 1 3.305-2.984Z"})});var Tt=r(L(),1),ke=r(n(),1),ve=(0,ke.jsx)(Tt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,ke.jsx)(Tt.Path,{d:"M17.5 10h-1.7l-3.7 10.5h1.7l.9-2.6h3.9l.9 2.6h1.7L17.5 10zm-2.2 6.3 1.4-4 1.4 4h-2.8zm-4.8-3.8c1.6-1.8 2.9-3.6 3.7-5.7H16V5.2h-5.8V3H8.8v2.2H3v1.5h9.6c-.7 1.6-1.8 3.1-3.1 4.6C8.6 10.2 7.8 9 7.2 8H5.6c.6 1.4 1.7 2.9 2.9 4.4l-2.4 2.4c-.3.4-.7.8-1.1 1.2l1 1 1.2-1.2c.8-.8 1.6-1.5 2.3-2.3.8.9 1.7 1.7 2.5 2.5l.6-1.5c-.7-.6-1.4-1.3-2.1-2z"})});var Lt=r(L(),1),Ce=r(n(),1),_e=(0,Ce.jsx)(Lt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Ce.jsx)(Lt.Path,{d:"M10 17.389H8.444A5.194 5.194 0 1 1 8.444 7H10v1.5H8.444a3.694 3.694 0 0 0 0 7.389H10v1.5ZM14 7h1.556a5.194 5.194 0 0 1 0 10.39H14v-1.5h1.556a3.694 3.694 0 0 0 0-7.39H14V7Zm-4.5 6h5v-1.5h-5V13Z"})});var It=r(L(),1),Se=r(n(),1),Te=(0,Se.jsx)(It.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Se.jsx)(It.Path,{d:"M11.2 6.8c-.7 0-1.4.5-1.6 1.1l-2.8 7.5-1.2-1.8c-.1-.2-.4-.3-.6-.3H3v1.5h1.6l1.2 1.8c.6.9 1.9.7 2.2-.3l2.9-7.9s.1-.2.2-.2h7.8V6.7h-7.8Zm5.3 3.4-1.9 1.9-1.9-1.9-1.1 1.1 1.9 1.9-1.9 1.9 1.1 1.1 1.9-1.9 1.9 1.9 1.1-1.1-1.9-1.9 1.9-1.9-1.1-1.1Z"})});var Bt=r(L(),1),Le=r(n(),1),Ie=(0,Le.jsx)(Bt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Le.jsx)(Bt.Path,{d:"M16.9 18.3l.8-1.2c.4-.6.7-1.2.9-1.6.2-.4.3-.8.3-1.2 0-.3-.1-.7-.2-1-.1-.3-.4-.5-.6-.7-.3-.2-.6-.3-1-.3s-.8.1-1.1.2c-.3.1-.7.3-1 .6l.2 1.3c.3-.3.5-.5.8-.6s.6-.2.9-.2c.3 0 .5.1.7.2.2.2.2.4.2.7 0 .3-.1.5-.2.8-.1.3-.4.7-.8 1.3L15 19.4h4.3v-1.2h-2.4zM14.1 7.2h-2L9.5 11 6.9 7.2h-2l3.6 5.3L4.7 18h2l2.7-4 2.7 4h2l-3.8-5.5 3.8-5.3z"})});var Nt=r(L(),1),Be=r(n(),1),Ne=(0,Be.jsx)(Nt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Be.jsx)(Nt.Path,{d:"M16.9 10.3l.8-1.3c.4-.6.7-1.2.9-1.6.2-.4.3-.8.3-1.2 0-.3-.1-.7-.2-1-.2-.2-.4-.4-.7-.6-.3-.2-.6-.3-1-.3s-.8.1-1.1.2c-.3.1-.7.3-1 .6l.1 1.3c.3-.3.5-.5.8-.6s.6-.2.9-.2c.3 0 .5.1.7.2.2.2.2.4.2.7 0 .3-.1.5-.2.8-.1.3-.4.7-.8 1.3l-1.8 2.8h4.3v-1.2h-2.2zm-2.8-3.1h-2L9.5 11 6.9 7.2h-2l3.6 5.3L4.7 18h2l2.7-4 2.7 4h2l-3.8-5.5 3.8-5.3z"})});var Vt=r(L(),1),Ve=r(n(),1),Re=(0,Ve.jsx)(Vt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Ve.jsx)(Vt.Path,{d:"M12.9 6h-2l-4 11h1.9l1.1-3h4.2l1.1 3h1.9L12.9 6zm-2.5 6.5l1.5-4.9 1.7 4.9h-3.2z"})});var z=r(n(),1),je="core/bold",Fe=(0,ua.__)("Bold"),na={name:je,title:Fe,tagName:"strong",className:null,edit({isActive:t,value:e,onChange:a,onFocus:o,isVisible:s=!0}){function l(){a((0,Ee.toggleFormat)(e,{type:je,title:Fe}))}function f(){a((0,Ee.toggleFormat)(e,{type:je})),o()}return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(lt.RichTextShortcut,{type:"primary",character:"b",onUse:l}),s&&(0,z.jsx)(lt.RichTextToolbarButton,{name:"bold",icon:ce,title:Fe,onClick:f,isActive:t,shortcutType:"primary",shortcutCharacter:"b"}),(0,z.jsx)(lt.__unstableRichTextInputEvent,{inputType:"formatBold",onInput:l})]})}};var da=r(b(),1),Y=r(x(),1),Rt=r(y(),1);var Q=r(n(),1),Pe="core/code",Me=(0,da.__)("Inline code"),pa={name:Pe,title:Me,tagName:"code",className:null,__unstableInputRule(t){let{start:a,text:o}=t;if(o[a-1]!=="`"||a-2<0)return t;let l=o.lastIndexOf("`",a-2);if(l===-1)return t;let f=l,i=a-2;return f===i||(t=(0,Y.remove)(t,f,f+1),t=(0,Y.remove)(t,i,i+1),t=(0,Y.applyFormat)(t,{type:Pe},f,i)),t},edit({value:t,onChange:e,onFocus:a,isActive:o}){function s(){e((0,Y.toggleFormat)(t,{type:Pe,title:Me})),a()}return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Rt.RichTextShortcut,{type:"access",character:"x",onUse:s}),(0,Q.jsx)(Rt.RichTextToolbarButton,{icon:ue,title:Me,onClick:s,isActive:o,role:"menuitemcheckbox"})]})}};var k=r(J(),1),V=r(b(),1),He=r(F(),1),jt=r(x(),1),ft=r(y(),1),g=r(n(),1),Kr=["image"],Ae="core/image",ha=(0,V.__)("Inline image");function qr(t){if(!t?.className)return;let[,e]=t.className.match(/wp-image-(\d+)/)??[];return e?parseInt(e,10):void 0}var Ue={name:Ae,title:ha,keywords:[(0,V.__)("photo"),(0,V.__)("media")],object:!0,tagName:"img",className:null,attributes:{className:"class",style:"style",url:"src",alt:"alt"},edit:Yr};function $r({value:t,onChange:e,activeObjectAttributes:a,contentRef:o}){let{style:s,alt:l}=a,f=s?.replace(/\D/g,""),[i,m]=(0,He.useState)(f),[u,h]=(0,He.useState)(l),v=i!==f||u!==l,R=(0,jt.useAnchor)({editableContentElement:o.current,settings:Ue});return(0,g.jsx)(k.Popover,{focusOnMount:!1,anchor:R,className:"block-editor-format-toolbar__image-popover",children:(0,g.jsx)("form",{className:"block-editor-format-toolbar__image-container-content",onSubmit:_=>{let C=t.replacements.slice();C[t.start]={type:Ae,attributes:{...a,style:i?`width: ${i}px;`:"",alt:u}},e({...t,replacements:C}),_.preventDefault()},children:(0,g.jsxs)(k.__experimentalVStack,{spacing:4,children:[(0,g.jsx)(k.__experimentalNumberControl,{__next40pxDefaultSize:!0,label:(0,V.__)("Width"),value:i,min:1,onChange:_=>{m(_)}}),(0,g.jsx)(k.TextareaControl,{label:(0,V.__)("Alternative text"),value:u,onChange:_=>{h(_)},help:(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(k.ExternalLink,{href:(0,V.__)("https://www.w3.org/WAI/tutorials/images/decision-tree/"),children:(0,V.__)("Describe the purpose of the image.")}),(0,g.jsx)("br",{}),(0,V.__)("Leave empty if decorative.")]})}),(0,g.jsx)(k.__experimentalHStack,{justify:"right",children:(0,g.jsx)(k.Button,{disabled:!v,accessibleWhenDisabled:!0,variant:"primary",type:"submit",size:"compact",children:(0,V.__)("Apply")})})]})})})}function Yr({value:t,onChange:e,onFocus:a,isObjectActive:o,activeObjectAttributes:s,contentRef:l}){return(0,g.jsxs)(ft.MediaUploadCheck,{children:[(0,g.jsx)(ft.MediaUpload,{allowedTypes:Kr,value:qr(s),onSelect:({id:f,url:i,alt:m,width:u})=>{e((0,jt.insertObject)(t,{type:Ae,attributes:{className:`wp-image-${f}`,style:`width: ${Math.min(u,150)}px;`,url:i,alt:m}})),a()},render:({open:f})=>(0,g.jsx)(ft.RichTextToolbarButton,{icon:(0,g.jsx)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,g.jsx)(k.Path,{d:"M4 18.5h16V17H4v1.5zM16 13v1.5h4V13h-4zM5.1 15h7.8c.6 0 1.1-.5 1.1-1.1V6.1c0-.6-.5-1.1-1.1-1.1H5.1C4.5 5 4 5.5 4 6.1v7.8c0 .6.5 1.1 1.1 1.1zm.4-8.5h7V10l-1-1c-.3-.3-.8-.3-1 0l-1.6 1.5-1.2-.7c-.3-.2-.6-.2-.9 0l-1.3 1V6.5zm0 6.1l1.8-1.3 1.3.8c.3.2.7.2.9-.1l1.5-1.4 1.5 1.4v1.5h-7v-.9z"})}),title:o?(0,V.__)("Replace image"):ha,onClick:f,isActive:o})}),o&&(0,g.jsx)($r,{value:t,onChange:e,activeObjectAttributes:s,contentRef:l})]})}var ga=r(b(),1),Oe=r(x(),1),it=r(y(),1);var D=r(n(),1),ze="core/italic",De=(0,ga.__)("Italic"),xa={name:ze,title:De,tagName:"em",className:null,edit({isActive:t,value:e,onChange:a,onFocus:o,isVisible:s=!0}){function l(){a((0,Oe.toggleFormat)(e,{type:ze,title:De}))}function f(){a((0,Oe.toggleFormat)(e,{type:ze})),o()}return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(it.RichTextShortcut,{type:"primary",character:"i",onUse:l}),s&&(0,D.jsx)(it.RichTextToolbarButton,{name:"italic",icon:ge,title:De,onClick:f,isActive:t,shortcutType:"primary",shortcutCharacter:"i"}),(0,D.jsx)(it.__unstableRichTextInputEvent,{inputType:"formatItalic",onInput:l})]})}};var zt=r(b(),1),X=r(F(),1),w=r(x(),1),tt=r(Ft(),1),gt=r(y(),1),Ea=r(ya(),1);var Pa=r(Et(),1);var Ht=r(F(),1),E=r(b(),1),ct=r(Et(),1),Ra=r(J(),1),ja=r(Ft(),1),p=r(x(),1),mt=r(y(),1),At=r(We(),1);var c=r(Ft(),1);function Pt(t){if(!t)return!1;let e=t.trim();if(!e)return!1;if(/^\S+:/.test(e)){let a=(0,c.getProtocol)(e);if(!(0,c.isValidProtocol)(a)||a.startsWith("http")&&!/^https?:\/\/[^\/\s]/i.test(e))return!1;let o=(0,c.getAuthority)(e);if(!(0,c.isValidAuthority)(o))return!1;let s=(0,c.getPath)(e);if(s&&!(0,c.isValidPath)(s))return!1;let l=(0,c.getQueryString)(e);if(l&&!(0,c.isValidQueryString)(l))return!1;let f=(0,c.getFragment)(e);if(f&&!(0,c.isValidFragment)(f))return!1}return!(e.startsWith("#")&&!(0,c.isValidFragment)(e))}function Ca({url:t,type:e,id:a,opensInNewWindow:o,nofollow:s,cssClasses:l}){let f={type:"core/link",attributes:{url:t}};e&&(f.attributes.type=e),a&&(f.attributes.id=a),o&&(f.attributes.target="_blank",f.attributes.rel=f.attributes.rel?f.attributes.rel+" noreferrer noopener":"noreferrer noopener"),s&&(f.attributes.rel=f.attributes.rel?f.attributes.rel+" nofollow":"nofollow");let i=l?.trim();return i?.length&&(f.attributes.class=i),f}function Mt(t,e,a=t.start,o=t.end){let s={start:void 0,end:void 0},{formats:l}=t,f,i;if(!l?.length)return s;let m=l.slice(),u=m[a]?.find(({type:C})=>C===e.type),h=m[o]?.find(({type:C})=>C===e.type),v=m[o-1]?.find(({type:C})=>C===e.type);if(u)f=u,i=a;else if(h)f=h,i=o;else if(v)f=v,i=o-1;else return s;let R=m[i].indexOf(f),_=[m,i,f,R];return a=Qr(..._),o=Jr(..._),a=a<0?0:a,{start:a,end:o+1}}function _a(t,e,a,o,s){let l=e,i={forwards:1,backwards:-1}[s]||1,m=i*-1;for(;t[l]&&t[l][o]===a;)l=l+i;return l=l+m,l}var Sa=(t,...e)=>(...a)=>t(...a,...e),Qr=Sa(_a,"backwards"),Jr=Sa(_a,"forwards");var Ia=r(F(),1),Ba=r(La(),1),Ge=r(b(),1),W=r(J(),1),O=r(n(),1),Na=({setting:t,value:e,onChange:a})=>{let o=e?e?.cssClasses?.length>0:!1,[s,l]=(0,Ia.useState)(o),i=`css-classes-setting-${(0,Ba.useInstanceId)(Na)}`,m=h=>{let v=typeof h=="string"?h.replace(/,/g," ").replace(/\s+/g," ").trim():h;a({...e,[t.id]:v})},u=()=>{s?(o&&m(""),l(!1)):l(!0)};return(0,O.jsxs)("fieldset",{children:[(0,O.jsx)(W.VisuallyHidden,{as:"legend",children:t.title}),(0,O.jsxs)(W.__experimentalVStack,{spacing:3,children:[(0,O.jsx)(W.CheckboxControl,{label:t.title,onChange:u,checked:s||o,"aria-expanded":s,"aria-controls":s?i:void 0}),s&&(0,O.jsx)("div",{id:i,children:(0,O.jsx)(W.__experimentalInputControl,{label:(0,Ge.__)("CSS classes"),value:e?.cssClasses,onChange:m,help:(0,Ge.__)("Separate multiple classes with spaces."),__unstableInputWidth:"100%",__next40pxDefaultSize:!0})})]})]})},Va=Na;var ht=r(n(),1),Xr=[...mt.LinkControl.DEFAULT_LINK_SETTINGS,{id:"nofollow",title:(0,E.__)("Mark as nofollow")},{id:"cssClasses",title:(0,E.__)("Additional CSS class(es)"),render:(t,e,a)=>(0,ht.jsx)(Va,{setting:t,value:e,onChange:a})}];function to({isActive:t,activeAttributes:e,value:a,onChange:o,onFocusOutside:s,stopAddingLink:l,contentRef:f,focusOnMount:i}){let u=eo(a,t).text,{selectionChange:h}=(0,At.useDispatch)(mt.store),{createPageEntity:v,userCanCreatePages:R,selectionStart:_}=(0,At.useSelect)(d=>{let{getSettings:q,getSelectionStart:oe}=d(mt.store),ot=q();return{createPageEntity:ot.__experimentalCreatePageEntity,userCanCreatePages:ot.__experimentalUserCanCreatePages,selectionStart:oe()}},[]),C=(0,Ht.useMemo)(()=>({url:e.url,type:e.type,id:e.id,opensInNewTab:e.target==="_blank",nofollow:e.rel?.includes("nofollow"),title:u,cssClasses:e.class}),[e.class,e.id,e.rel,e.target,e.type,e.url,u]);function ee(){let d=(0,p.removeFormat)(a,"core/link");o(d),l(),(0,ct.speak)((0,E.__)("Link removed."),"assertive")}function ae(d){let oe=!C?.url;d={...C,...d};let ot=(0,ja.prependHTTPS)(d.url),se=Ca({url:ot,type:d.type,id:d.id!==void 0&&d.id!==null?String(d.id):void 0,opensInNewWindow:d.opensInNewTab,nofollow:d.nofollow,cssClasses:d.cssClasses}),st=d.title||ot,M;if((0,p.isCollapsed)(a)&&!t){let $=(0,p.insert)(a,st);M=(0,p.applyFormat)($,se,a.start,a.start+st.length),o(M),l(),h({clientId:_.clientId,identifier:_.attributeKey,start:a.start+st.length+1});return}else if(st===u){let $=Mt(a,{type:"core/link"});M=(0,p.applyFormat)(a,se,$.start,$.end)}else{M=(0,p.create)({text:st}),M=(0,p.applyFormat)(M,se,0,st.length);let $=Mt(a,{type:"core/link"}),[Mr,Hr]=(0,p.split)(a,$.start,$.start),Ar=(0,p.replace)(Hr,u,M);M=(0,p.concat)(Mr,Ar)}o(M),oe||l(),Pt(ot)?t?(0,ct.speak)((0,E.__)("Link edited."),"assertive"):(0,ct.speak)((0,E.__)("Link inserted."),"assertive"):(0,ct.speak)((0,E.__)("Warning: the link has been inserted but may have errors. Please test it."),"assertive")}let j=(0,p.useAnchor)({editableContentElement:f.current,settings:{...Ut,isActive:t}});async function S(d){let q=await v({title:d,status:"draft"});return{id:q.id,type:q.type,title:q.title.rendered,url:q.link,kind:"post-type"}}function re(d){return(0,Ht.createInterpolateElement)((0,E.sprintf)((0,E.__)("Create page: <mark>%s</mark>"),d),{mark:(0,ht.jsx)("mark",{})})}return(0,ht.jsx)(Ra.Popover,{anchor:j,animate:!1,onClose:l,onFocusOutside:s,placement:"bottom",offset:8,shift:!0,focusOnMount:i,constrainTabbing:!0,children:(0,ht.jsx)(mt.LinkControl,{value:C,onChange:ae,onRemove:ee,hasRichPreviews:!0,createSuggestion:v&&S,withCreateSuggestion:R,createSuggestionButtonText:re,hasTextControl:!0,settings:Xr,showInitialSuggestions:!0,suggestionsQuery:{initialSuggestionsSearchOptions:{type:"post",subtype:"page",perPage:20}}})})}function eo(t,e){let a=t.start,o=t.end;if(e){let s=Mt(t,{type:"core/link"});a=s.start,o=s.end}return(0,p.slice)(t,a,o)}var Fa=to;var H=r(n(),1),ut="core/link",Ma=(0,zt.__)("Link");function ao({isActive:t,activeAttributes:e,value:a,onChange:o,onFocus:s,contentRef:l,isVisible:f=!0}){let[i,m]=(0,X.useState)(!1),[u,h]=(0,X.useState)(null);(0,X.useEffect)(()=>{t||m(!1)},[t]),(0,X.useLayoutEffect)(()=>{let j=l.current;if(!j)return;function S(re){let d=re.target.closest("[contenteditable] a");!d||!t||(m(!0),h({el:d,action:"click"}))}return j.addEventListener("click",S),()=>{j.removeEventListener("click",S)}},[l,t]);function v(j){let S=(0,w.getTextContent)((0,w.slice)(a));!t&&S&&(0,tt.isURL)(S)&&Pt(S)?o((0,w.applyFormat)(a,{type:ut,attributes:{url:S}})):!t&&S&&(0,tt.isEmail)(S)?o((0,w.applyFormat)(a,{type:ut,attributes:{url:`mailto:${S}`}})):!t&&S&&(0,tt.isPhoneNumber)(S)?o((0,w.applyFormat)(a,{type:ut,attributes:{url:`tel:${S.replace(/\D/g,"")}`}})):(j&&h({el:j,action:null}),m(!0))}function R(){m(!1),u?.el?.tagName==="BUTTON"?u.el.focus():s(),h(null)}function _(){m(!1),h(null)}function C(){o((0,w.removeFormat)(a,ut)),(0,Pa.speak)((0,zt.__)("Link removed."),"assertive")}let ee=!(u?.el?.tagName==="A"&&u?.action==="click"),ae=!(0,w.isCollapsed)(a);return(0,H.jsxs)(H.Fragment,{children:[ae&&(0,H.jsx)(gt.RichTextShortcut,{type:"primary",character:"k",onUse:v}),(0,H.jsx)(gt.RichTextShortcut,{type:"primaryShift",character:"k",onUse:C}),f&&(0,H.jsx)(gt.RichTextToolbarButton,{name:"link",icon:_e,title:t?(0,zt.__)("Link"):Ma,onClick:j=>{v(j.currentTarget)},isActive:t||i,shortcutType:"primary",shortcutCharacter:"k","aria-haspopup":"true","aria-expanded":i}),f&&i&&(0,H.jsx)(Fa,{stopAddingLink:R,onFocusOutside:_,isActive:t,activeAttributes:e,value:a,onChange:o,contentRef:l,focusOnMount:ee?"firstElement":!1})]})}var Ut={name:ut,title:Ma,tagName:"a",className:null,attributes:{url:"href",type:"data-type",id:"data-id",_id:"id",target:"target",rel:"rel",class:"class"},__unstablePasteRule(t,{html:e,plainText:a}){let o=(e||a).replace(/<[^>]+>/g,"").trim();if(!(0,tt.isURL)(o)||!/^https?:/.test(o))return t;window.console.log(`Created link: `,o);let s={type:ut,attributes:{url:(0,Ea.decodeEntities)(o)}};return(0,w.isCollapsed)(t)?(0,w.insert)(t,(0,w.applyFormat)((0,w.create)({text:a}),s,0,a.length)):(0,w.applyFormat)(t,s)},edit:ao};var Aa=r(b(),1),Ua=r(x(),1),Dt=r(y(),1);var et=r(n(),1),Ha="core/strikethrough",Ze=(0,Aa.__)("Strikethrough"),za={name:Ha,title:Ze,tagName:"s",className:null,edit({isActive:t,value:e,onChange:a,onFocus:o}){function s(){a((0,Ua.toggleFormat)(e,{type:Ha,title:Ze})),o()}return(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(Dt.RichTextShortcut,{type:"access",character:"d",onUse:s}),(0,et.jsx)(Dt.RichTextToolbarButton,{icon:be,title:Ze,onClick:s,isActive:t,role:"menuitemcheckbox"})]})}};var Wa=r(b(),1),Ga=r(x(),1),Ot=r(y(),1),at=r(n(),1),Da="core/underline",Oa=(0,Wa.__)("Underline"),Za={name:Da,title:Oa,tagName:"span",className:null,attributes:{style:"style"},edit({value:t,onChange:e}){let a=()=>{e((0,Ga.toggleFormat)(t,{type:Da,attributes:{style:"text-decoration: underline;"},title:Oa}))};return(0,at.jsxs)(at.Fragment,{children:[(0,at.jsx)(Ot.RichTextShortcut,{type:"primary",character:"u",onUse:a}),(0,at.jsx)(Ot.__unstableRichTextInputEvent,{inputType:"formatUnderline",onInput:a})]})}};var tr=r(b(),1),Yt=r(F(),1),Qt=r(y(),1);var er=r(x(),1);var Qa=r(F(),1),Ja=r(We(),1),G=r(x(),1),P=r(y(),1),Zt=r(J(),1),Ke=r(b(),1);var $a=r(qa(),1),{lock:Ns,unlock:Wt}=(0,$a.__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/format-library");var A=r(n(),1),{Tabs:Gt}=Wt(Zt.privateApis),Ya=[{name:"color",title:(0,Ke.__)("Text")},{name:"backgroundColor",title:(0,Ke.__)("Background")}];function ro(t=""){return t.split(";").reduce((e,a)=>{if(a){let[o,s]=a.split(":");o==="color"&&(e.color=s),o==="background-color"&&s!==xt&&(e.backgroundColor=s)}return e},{})}function oo(t="",e){return t.split(" ").reduce((a,o)=>{if(o.startsWith("has-")&&o.endsWith("-color")){let s=o.replace(/^has-/,"").replace(/-color$/,""),l=(0,P.getColorObjectByAttributeValues)(e,s);a.color=l.color}return a},{})}function Kt(t,e,a){let o=(0,G.getActiveFormat)(t,e);return o?{...ro(o.attributes.style),...oo(o.attributes.class,a)}:{}}function so(t,e,a,o){let{color:s,backgroundColor:l}={...Kt(t,e,a),...o};if(!s&&!l)return(0,G.removeFormat)(t,e);let f=[],i=[],m={};if(l?f.push(["background-color",l].join(":")):f.push(["background-color",xt].join(":")),s){let u=(0,P.getColorObjectByColorValue)(a,s);u?i.push((0,P.getColorClassName)("color",u.slug)):f.push(["color",s].join(":"))}return f.length&&(m.style=f.join(";")),i.length&&(m.class=i.join(" ")),(0,G.applyFormat)(t,{type:e,attributes:m})}function lo({name:t,property:e,value:a,onChange:o}){let s=(0,Ja.useSelect)(f=>{let{getSettings:i}=f(P.store);return i().colors??[]},[]),l=(0,Qa.useMemo)(()=>Kt(a,t,s),[t,a,s]);return(0,A.jsx)(P.ColorPalette,{value:l[e],onChange:f=>{o(so(a,t,s,{[e]:f}))},enableAlpha:!0,__experimentalIsRenderedInSidebar:!0})}function Xa({name:t,value:e,onChange:a,onClose:o,contentRef:s,isActive:l}){let f=(0,G.useAnchor)({editableContentElement:s.current,settings:{...qt,isActive:l}});return(0,A.jsx)(Zt.Popover,{onClose:o,className:"format-library__inline-color-popover",anchor:f,children:(0,A.jsxs)(Gt,{children:[(0,A.jsx)(Gt.TabList,{children:Ya.map(i=>(0,A.jsx)(Gt.Tab,{tabId:i.name,children:i.title},i.name))}),Ya.map(i=>(0,A.jsx)(Gt.TabPanel,{tabId:i.name,focusable:!1,children:(0,A.jsx)(lo,{name:t,property:i.name,value:e,onChange:a})},i.name))]})})}var Z=r(n(),1),xt="rgba(0, 0, 0, 0)",$t="core/text-color",ar=(0,tr.__)("Highlight"),fo=[];function qe(t,e){let{ownerDocument:a}=t,{defaultView:o}=a,l=o.getComputedStyle(t).getPropertyValue(e);return e==="background-color"&&l===xt&&t.parentElement?qe(t.parentElement,e):l}function io(t,{color:e,backgroundColor:a}){if(!(!e&&!a))return{color:e||qe(t,"color"),backgroundColor:a===xt?qe(t,"background-color"):a}}function mo({value:t,onChange:e,isActive:a,activeAttributes:o,contentRef:s}){let[l,f=fo]=(0,Qt.useSettings)("color.custom","color.palette"),[i,m]=(0,Yt.useState)(!1),u=(0,Yt.useMemo)(()=>io(s.current,Kt(t,$t,f)),[s,t,f]),h=!!f.length||l;return!h&&!a?null:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Qt.RichTextToolbarButton,{className:"format-library-text-color-button",isActive:a,icon:(0,Z.jsx)(le,{icon:Object.keys(o).length?Re:de,style:u}),title:ar,onClick:h?()=>m(!0):()=>e((0,er.removeFormat)(t,$t)),role:"menuitemcheckbox"}),i&&(0,Z.jsx)(Xa,{name:$t,onClose:()=>m(!1),activeAttributes:o,value:t,onChange:e,contentRef:s,isActive:a})]})}var qt={name:$t,title:ar,tagName:"mark",className:"has-inline-color",attributes:{style:"style",class:"class"},edit:mo};var or=r(b(),1),sr=r(x(),1),lr=r(y(),1);var fr=r(n(),1),rr="core/subscript",$e=(0,or.__)("Subscript"),ir={name:rr,title:$e,tagName:"sub",className:null,edit({isActive:t,value:e,onChange:a,onFocus:o}){function s(){a((0,sr.toggleFormat)(e,{type:rr,title:$e}))}function l(){s(),o()}return(0,fr.jsx)(lr.RichTextToolbarButton,{icon:Ie,title:$e,onClick:l,isActive:t,role:"menuitemcheckbox"})}};var ur=r(b(),1),nr=r(x(),1),dr=r(y(),1);var pr=r(n(),1),mr="core/superscript",Ye=(0,ur.__)("Superscript"),cr={name:mr,title:Ye,tagName:"sup",className:null,edit({isActive:t,value:e,onChange:a,onFocus:o}){function s(){a((0,nr.toggleFormat)(e,{type:mr,title:Ye}))}function l(){s(),o()}return(0,pr.jsx)(dr.RichTextToolbarButton,{icon:Ne,title:Ye,onClick:l,isActive:t,role:"menuitemcheckbox"})}};var gr=r(b(),1),xr=r(x(),1),br=r(y(),1);var wr=r(n(),1),hr="core/keyboard",Qe=(0,gr.__)("Keyboard input"),yr={name:hr,title:Qe,tagName:"kbd",className:null,edit({isActive:t,value:e,onChange:a,onFocus:o}){function s(){a((0,xr.toggleFormat)(e,{type:hr,title:Qe}))}function l(){s(),o()}return(0,wr.jsx)(br.RichTextToolbarButton,{icon:ie,title:Qe,onClick:l,isActive:t,role:"menuitemcheckbox"})}};var vr=r(b(),1),nt=r(x(),1),Cr=r(y(),1);var _r=r(n(),1),Je="core/unknown",kr=(0,vr.__)("Clear Unknown Formatting");function uo(t){return(0,nt.isCollapsed)(t)?!1:(0,nt.slice)(t).formats.some(a=>a.some(o=>o.type===Je))}var Sr={name:Je,title:kr,tagName:"*",className:null,edit({isActive:t,value:e,onChange:a,onFocus:o}){if(!t&&!uo(e))return null;function s(){a((0,nt.removeFormat)(e,Je)),o()}return(0,_r.jsx)(Cr.RichTextToolbarButton,{name:"unknown",icon:ye,title:kr,onClick:s,isActive:!0})}};var rt=r(b(),1),Tr=r(y(),1),N=r(J(),1),Jt=r(F(),1),dt=r(x(),1);var B=r(n(),1),Xe="core/language",Xt=(0,rt.__)("Language"),ta={name:Xe,title:Xt,tagName:"bdo",className:null,attributes:{lang:"lang",dir:"dir"},edit:no};function no({isActive:t,value:e,onChange:a,contentRef:o}){let[s,l]=(0,Jt.useState)(!1),f=()=>{l(i=>!i)};return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Tr.RichTextToolbarButton,{icon:ve,label:Xt,title:Xt,onClick:()=>{t?a((0,dt.removeFormat)(e,Xe)):f()},isActive:t,role:"menuitemcheckbox"}),s&&(0,B.jsx)(po,{value:e,onChange:a,onClose:f,contentRef:o})]})}function po({value:t,contentRef:e,onChange:a,onClose:o}){let s=(0,dt.useAnchor)({editableContentElement:e.current,settings:ta}),[l,f]=(0,Jt.useState)(""),[i,m]=(0,Jt.useState)("ltr");return(0,B.jsx)(N.Popover,{className:"block-editor-format-toolbar__language-popover",anchor:s,onClose:o,children:(0,B.jsxs)(N.__experimentalVStack,{as:"form",spacing:4,className:"block-editor-format-toolbar__language-container-content",onSubmit:u=>{u.preventDefault(),a((0,dt.applyFormat)(t,{type:Xe,attributes:{lang:l,dir:i}})),o()},children:[(0,B.jsx)(N.TextControl,{__next40pxDefaultSize:!0,label:Xt,value:l,onChange:u=>f(u),help:(0,rt.__)('A valid language attribute, like "en" or "fr".')}),(0,B.jsx)(N.SelectControl,{__next40pxDefaultSize:!0,label:(0,rt.__)("Text direction"),value:i,options:[{label:(0,rt.__)("Left to right"),value:"ltr"},{label:(0,rt.__)("Right to left"),value:"rtl"}],onChange:u=>m(u)}),(0,B.jsx)(N.__experimentalHStack,{alignment:"right",children:(0,B.jsx)(N.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",text:(0,rt.__)("Apply")})})]})})}var U=r(b(),1),pt=r(F(),1),te=r(x(),1),Lr=r(y(),1),K=r(J(),1);var Ir=r(Et(),1);var T=r(n(),1),{Badge:co}=Wt(K.privateApis),ea="core/math",Br=(0,U.__)("Math");function ho({value:t,onChange:e,activeAttributes:a,contentRef:o,latexToMathML:s}){let[l,f]=(0,pt.useState)(a?.["data-latex"]||""),[i,m]=(0,pt.useState)(null),u=(0,te.useAnchor)({editableContentElement:o.current,settings:aa}),h=v=>{let R="";if(f(v),v)try{R=s(v,{displayMode:!1}),m(null)}catch(C){m(C.message),(0,Ir.speak)((0,U.sprintf)((0,U.__)("Error parsing mathematical expression: %s"),C.message));return}let _=t.replacements.slice();_[t.start]={type:ea,attributes:{"data-latex":v},innerHTML:R},e({...t,replacements:_})};return(0,T.jsx)(K.Popover,{placement:"bottom-start",offset:8,focusOnMount:!1,anchor:u,className:"block-editor-format-toolbar__math-popover",children:(0,T.jsx)("div",{style:{minWidth:"300px",padding:"4px"},children:(0,T.jsxs)(K.__experimentalVStack,{spacing:1,children:[(0,T.jsx)(K.TextControl,{__next40pxDefaultSize:!0,hideLabelFromVision:!0,label:(0,U.__)("LaTeX math syntax"),value:l,onChange:h,placeholder:(0,U.__)("e.g., x^2, \\frac{a}{b}"),autoComplete:"off",className:"block-editor-format-toolbar__math-input"}),i&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(co,{intent:"error",className:"wp-block-math__error",children:(0,U.sprintf)((0,U.__)("Error: %s"),i)}),(0,T.jsx)("style",{children:".wp-block-math__error .components-badge__content{white-space:normal}"})]})]})})})}function go({value:t,onChange:e,onFocus:a,isObjectActive:o,activeObjectAttributes:s,contentRef:l}){let[f,i]=(0,pt.useState)();return(0,pt.useEffect)(()=>{import("@wordpress/latex-to-mathml").then(m=>{i(()=>m.default)})},[]),(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(Lr.RichTextToolbarButton,{icon:Te,title:Br,onClick:()=>{let m=(0,te.insertObject)(t,{type:ea,attributes:{"data-latex":""},innerHTML:""});m.start=m.end-1,e(m),a()},isActive:o}),o&&(0,T.jsx)(ho,{value:t,onChange:e,activeAttributes:s,contentRef:l,latexToMathML:f})]})}var aa={name:ea,title:Br,tagName:"math",className:null,attributes:{"data-latex":"data-latex"},contentEditable:!1,edit:go};var Nr=r(b(),1),Vr=r(x(),1),Rr=r(y(),1),jr=r(n(),1),xo="core/non-breaking-space",bo=(0,Nr.__)("Non breaking space"),Fr={name:xo,title:bo,tagName:"nbsp",className:null,edit({value:t,onChange:e}){function a(){e((0,Vr.insert)(t,"\xA0"))}return(0,jr.jsx)(Rr.RichTextShortcut,{type:"primaryShift",character:" ",onUse:a})}};var Er=[na,pa,Ue,xa,Ut,za,Za,qt,ir,cr,yr,Sr,ta,aa,Fr];Er.forEach(({name:t,...e})=>(0,Pr.registerFormatType)(t,e));})(); blocks.min.js 0000644 00000551125 15206720414 0007153 0 ustar 00 var wp;(wp||={}).blocks=(()=>{var zu=Object.create;var ir=Object.defineProperty;var qu=Object.getOwnPropertyDescriptor;var Iu=Object.getOwnPropertyNames;var Vu=Object.getPrototypeOf,xu=Object.prototype.hasOwnProperty;var z=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ie=(e,t)=>{for(var r in t)ir(e,r,{get:t[r],enumerable:!0})},hn=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Iu(t))!xu.call(e,o)&&o!==r&&ir(e,o,{get:()=>t[o],enumerable:!(a=qu(t,o))||a.enumerable});return e};var B=(e,t,r)=>(r=e!=null?zu(Vu(e)):{},hn(t||!e||!e.__esModule?ir(r,"default",{value:e,enumerable:!0}):r,e)),Hu=e=>hn(ir({},"__esModule",{value:!0}),e);var Be=z((Dd,gn)=>{gn.exports=window.wp.data});var sr=z((Gd,vn)=>{vn.exports=window.wp.i18n});var De=z((Xd,jn)=>{jn.exports=window.wp.element});var Z=z((Zd,zn)=>{zn.exports=window.wp.dom});var xe=z((Qd,qn)=>{qn.exports=window.wp.richText});var J=z((Jd,In)=>{In.exports=window.wp.deprecated});var pt=z((rc,Hn)=>{Hn.exports=window.wp.warning});var Fn=z((nc,Un)=>{Un.exports=window.wp.privateApis});var Ba=z((_c,yr)=>{var Ea={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u1EA4:"A",\u1EAE:"A",\u1EB2:"A",\u1EB4:"A",\u1EB6:"A",\u00C6:"AE",\u1EA6:"A",\u1EB0:"A",\u0202:"A",\u1EA2:"A",\u1EA0:"A",\u1EA8:"A",\u1EAA:"A",\u1EAC:"A",\u00C7:"C",\u1E08:"C",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u1EBE:"E",\u1E16:"E",\u1EC0:"E",\u1E14:"E",\u1E1C:"E",\u0206:"E",\u1EBA:"E",\u1EBC:"E",\u1EB8:"E",\u1EC2:"E",\u1EC4:"E",\u1EC6:"E",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u1E2E:"I",\u020A:"I",\u1EC8:"I",\u1ECA:"I",\u00D0:"D",\u00D1:"N",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u1ED0:"O",\u1E4C:"O",\u1E52:"O",\u020E:"O",\u1ECE:"O",\u1ECC:"O",\u1ED4:"O",\u1ED6:"O",\u1ED8:"O",\u1EDC:"O",\u1EDE:"O",\u1EE0:"O",\u1EDA:"O",\u1EE2:"O",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u1EE6:"U",\u1EE4:"U",\u1EEC:"U",\u1EEE:"U",\u1EF0:"U",\u00DD:"Y",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u1EA5:"a",\u1EAF:"a",\u1EB3:"a",\u1EB5:"a",\u1EB7:"a",\u00E6:"ae",\u1EA7:"a",\u1EB1:"a",\u0203:"a",\u1EA3:"a",\u1EA1:"a",\u1EA9:"a",\u1EAB:"a",\u1EAD:"a",\u00E7:"c",\u1E09:"c",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u1EBF:"e",\u1E17:"e",\u1EC1:"e",\u1E15:"e",\u1E1D:"e",\u0207:"e",\u1EBB:"e",\u1EBD:"e",\u1EB9:"e",\u1EC3:"e",\u1EC5:"e",\u1EC7:"e",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u1E2F:"i",\u020B:"i",\u1EC9:"i",\u1ECB:"i",\u00F0:"d",\u00F1:"n",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u1ED1:"o",\u1E4D:"o",\u1E53:"o",\u020F:"o",\u1ECF:"o",\u1ECD:"o",\u1ED5:"o",\u1ED7:"o",\u1ED9:"o",\u1EDD:"o",\u1EDF:"o",\u1EE1:"o",\u1EDB:"o",\u1EE3:"o",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u1EE7:"u",\u1EE5:"u",\u1EED:"u",\u1EEF:"u",\u1EF1:"u",\u00FD:"y",\u00FF:"y",\u0100:"A",\u0101:"a",\u0102:"A",\u0103:"a",\u0104:"A",\u0105:"a",\u0106:"C",\u0107:"c",\u0108:"C",\u0109:"c",\u010A:"C",\u010B:"c",\u010C:"C",\u010D:"c",C\u0306:"C",c\u0306:"c",\u010E:"D",\u010F:"d",\u0110:"D",\u0111:"d",\u0112:"E",\u0113:"e",\u0114:"E",\u0115:"e",\u0116:"E",\u0117:"e",\u0118:"E",\u0119:"e",\u011A:"E",\u011B:"e",\u011C:"G",\u01F4:"G",\u011D:"g",\u01F5:"g",\u011E:"G",\u011F:"g",\u0120:"G",\u0121:"g",\u0122:"G",\u0123:"g",\u0124:"H",\u0125:"h",\u0126:"H",\u0127:"h",\u1E2A:"H",\u1E2B:"h",\u0128:"I",\u0129:"i",\u012A:"I",\u012B:"i",\u012C:"I",\u012D:"i",\u012E:"I",\u012F:"i",\u0130:"I",\u0131:"i",\u0132:"IJ",\u0133:"ij",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u1E30:"K",\u1E31:"k",K\u0306:"K",k\u0306:"k",\u0139:"L",\u013A:"l",\u013B:"L",\u013C:"l",\u013D:"L",\u013E:"l",\u013F:"L",\u0140:"l",\u0141:"l",\u0142:"l",\u1E3E:"M",\u1E3F:"m",M\u0306:"M",m\u0306:"m",\u0143:"N",\u0144:"n",\u0145:"N",\u0146:"n",\u0147:"N",\u0148:"n",\u0149:"n",N\u0306:"N",n\u0306:"n",\u014C:"O",\u014D:"o",\u014E:"O",\u014F:"o",\u0150:"O",\u0151:"o",\u0152:"OE",\u0153:"oe",P\u0306:"P",p\u0306:"p",\u0154:"R",\u0155:"r",\u0156:"R",\u0157:"r",\u0158:"R",\u0159:"r",R\u0306:"R",r\u0306:"r",\u0212:"R",\u0213:"r",\u015A:"S",\u015B:"s",\u015C:"S",\u015D:"s",\u015E:"S",\u0218:"S",\u0219:"s",\u015F:"s",\u0160:"S",\u0161:"s",\u0162:"T",\u0163:"t",\u021B:"t",\u021A:"T",\u0164:"T",\u0165:"t",\u0166:"T",\u0167:"t",T\u0306:"T",t\u0306:"t",\u0168:"U",\u0169:"u",\u016A:"U",\u016B:"u",\u016C:"U",\u016D:"u",\u016E:"U",\u016F:"u",\u0170:"U",\u0171:"u",\u0172:"U",\u0173:"u",\u0216:"U",\u0217:"u",V\u0306:"V",v\u0306:"v",\u0174:"W",\u0175:"w",\u1E82:"W",\u1E83:"w",X\u0306:"X",x\u0306:"x",\u0176:"Y",\u0177:"y",\u0178:"Y",Y\u0306:"Y",y\u0306:"y",\u0179:"Z",\u017A:"z",\u017B:"Z",\u017C:"z",\u017D:"Z",\u017E:"z",\u017F:"s",\u0192:"f",\u01A0:"O",\u01A1:"o",\u01AF:"U",\u01B0:"u",\u01CD:"A",\u01CE:"a",\u01CF:"I",\u01D0:"i",\u01D1:"O",\u01D2:"o",\u01D3:"U",\u01D4:"u",\u01D5:"U",\u01D6:"u",\u01D7:"U",\u01D8:"u",\u01D9:"U",\u01DA:"u",\u01DB:"U",\u01DC:"u",\u1EE8:"U",\u1EE9:"u",\u1E78:"U",\u1E79:"u",\u01FA:"A",\u01FB:"a",\u01FC:"AE",\u01FD:"ae",\u01FE:"O",\u01FF:"o",\u00DE:"TH",\u00FE:"th",\u1E54:"P",\u1E55:"p",\u1E64:"S",\u1E65:"s",X\u0301:"X",x\u0301:"x",\u0403:"\u0413",\u0453:"\u0433",\u040C:"\u041A",\u045C:"\u043A",A\u030B:"A",a\u030B:"a",E\u030B:"E",e\u030B:"e",I\u030B:"I",i\u030B:"i",\u01F8:"N",\u01F9:"n",\u1ED2:"O",\u1ED3:"o",\u1E50:"O",\u1E51:"o",\u1EEA:"U",\u1EEB:"u",\u1E80:"W",\u1E81:"w",\u1EF2:"Y",\u1EF3:"y",\u0200:"A",\u0201:"a",\u0204:"E",\u0205:"e",\u0208:"I",\u0209:"i",\u020C:"O",\u020D:"o",\u0210:"R",\u0211:"r",\u0214:"U",\u0215:"u",B\u030C:"B",b\u030C:"b",\u010C\u0323:"C",\u010D\u0323:"c",\u00CA\u030C:"E",\u00EA\u030C:"e",F\u030C:"F",f\u030C:"f",\u01E6:"G",\u01E7:"g",\u021E:"H",\u021F:"h",J\u030C:"J",\u01F0:"j",\u01E8:"K",\u01E9:"k",M\u030C:"M",m\u030C:"m",P\u030C:"P",p\u030C:"p",Q\u030C:"Q",q\u030C:"q",\u0158\u0329:"R",\u0159\u0329:"r",\u1E66:"S",\u1E67:"s",V\u030C:"V",v\u030C:"v",W\u030C:"W",w\u030C:"w",X\u030C:"X",x\u030C:"x",Y\u030C:"Y",y\u030C:"y",A\u0327:"A",a\u0327:"a",B\u0327:"B",b\u0327:"b",\u1E10:"D",\u1E11:"d",\u0228:"E",\u0229:"e",\u0190\u0327:"E",\u025B\u0327:"e",\u1E28:"H",\u1E29:"h",I\u0327:"I",i\u0327:"i",\u0197\u0327:"I",\u0268\u0327:"i",M\u0327:"M",m\u0327:"m",O\u0327:"O",o\u0327:"o",Q\u0327:"Q",q\u0327:"q",U\u0327:"U",u\u0327:"u",X\u0327:"X",x\u0327:"x",Z\u0327:"Z",z\u0327:"z",\u0439:"\u0438",\u0419:"\u0418",\u0451:"\u0435",\u0401:"\u0415"},Ta=Object.keys(Ea).join("|"),hi=new RegExp(Ta,"g"),gi=new RegExp(Ta,"");function bi(e){return Ea[e]}var Ca=function(e){return e.replace(hi,bi)},_i=function(e){return!!e.match(gi)};yr.exports=Ca;yr.exports.has=_i;yr.exports.remove=Ca});var xa=z(D=>{"use strict";var Lt=Symbol.for("react.element"),Pt=Symbol.for("react.portal"),kr=Symbol.for("react.fragment"),vr=Symbol.for("react.strict_mode"),Er=Symbol.for("react.profiler"),Tr=Symbol.for("react.provider"),Cr=Symbol.for("react.context"),Ii=Symbol.for("react.server_context"),Br=Symbol.for("react.forward_ref"),Ar=Symbol.for("react.suspense"),Sr=Symbol.for("react.suspense_list"),Nr=Symbol.for("react.memo"),Lr=Symbol.for("react.lazy"),Vi=Symbol.for("react.offscreen"),Va;Va=Symbol.for("react.module.reference");function re(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Lt:switch(e=e.type,e){case kr:case Er:case vr:case Ar:case Sr:return e;default:switch(e=e&&e.$$typeof,e){case Ii:case Cr:case Br:case Lr:case Nr:case Tr:return e;default:return t}}case Pt:return t}}}D.ContextConsumer=Cr;D.ContextProvider=Tr;D.Element=Lt;D.ForwardRef=Br;D.Fragment=kr;D.Lazy=Lr;D.Memo=Nr;D.Portal=Pt;D.Profiler=Er;D.StrictMode=vr;D.Suspense=Ar;D.SuspenseList=Sr;D.isAsyncMode=function(){return!1};D.isConcurrentMode=function(){return!1};D.isContextConsumer=function(e){return re(e)===Cr};D.isContextProvider=function(e){return re(e)===Tr};D.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Lt};D.isForwardRef=function(e){return re(e)===Br};D.isFragment=function(e){return re(e)===kr};D.isLazy=function(e){return re(e)===Lr};D.isMemo=function(e){return re(e)===Nr};D.isPortal=function(e){return re(e)===Pt};D.isProfiler=function(e){return re(e)===Er};D.isStrictMode=function(e){return re(e)===vr};D.isSuspense=function(e){return re(e)===Ar};D.isSuspenseList=function(e){return re(e)===Sr};D.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===kr||e===Er||e===vr||e===Ar||e===Sr||e===Vi||typeof e=="object"&&e!==null&&(e.$$typeof===Lr||e.$$typeof===Nr||e.$$typeof===Tr||e.$$typeof===Cr||e.$$typeof===Br||e.$$typeof===Va||e.getModuleId!==void 0)};D.typeOf=re});var Ua=z((Ac,Ha)=>{"use strict";Ha.exports=xa()});var We=z((Sc,Fa)=>{Fa.exports=window.wp.hooks});var to=z((Jc,ro)=>{ro.exports=window.wp.blockSerializationDefaultParser});var Ut=z((el,no)=>{no.exports=window.wp.autop});var oo=z((rl,ao)=>{ao.exports=window.wp.isShallowEqual});var io=z((al,uo)=>{uo.exports=window.ReactJSXRuntime});var ko=z((ll,wo)=>{"use strict";wo.exports=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var a,o,s;if(Array.isArray(t)){if(a=t.length,a!=r.length)return!1;for(o=a;o--!==0;)if(!e(t[o],r[o]))return!1;return!0}if(t instanceof Map&&r instanceof Map){if(t.size!==r.size)return!1;for(o of t.entries())if(!r.has(o[0]))return!1;for(o of t.entries())if(!e(o[1],r.get(o[0])))return!1;return!0}if(t instanceof Set&&r instanceof Set){if(t.size!==r.size)return!1;for(o of t.entries())if(!r.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(r)){if(a=t.length,a!=r.length)return!1;for(o=a;o--!==0;)if(t[o]!==r[o])return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(s=Object.keys(t),a=s.length,a!==Object.keys(r).length)return!1;for(o=a;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[o]))return!1;for(o=a;o--!==0;){var c=s[o];if(!e(t[c],r[c]))return!1}return!0}return t!==t&&r!==r}});var Eo=z((fl,vo)=>{vo.exports=window.wp.htmlEntities});var Jo=z((kf,Qo)=>{Qo.exports=window.wp.shortcode});var lu=z((qf,cu)=>{cu.exports=window.wp.blob});var gu=z((hu,Qr)=>{(function(){function e(n){"use strict";var i={omitExtraWLInCodeBlocks:{defaultValue:!1,describe:"Omit the default extra whiteline added to code blocks",type:"boolean"},noHeaderId:{defaultValue:!1,describe:"Turn on/off generated header id",type:"boolean"},prefixHeaderId:{defaultValue:!1,describe:"Add a prefix to the generated header ids. Passing a string will prefix that string to the header id. Setting to true will add a generic 'section-' prefix",type:"string"},rawPrefixHeaderId:{defaultValue:!1,describe:'Setting this option to true will prevent showdown from modifying the prefix. This might result in malformed IDs (if, for instance, the " char is used in the prefix)',type:"boolean"},ghCompatibleHeaderId:{defaultValue:!1,describe:"Generate header ids compatible with github style (spaces are replaced with dashes, a bunch of non alphanumeric chars are removed)",type:"boolean"},rawHeaderId:{defaultValue:!1,describe:`Remove only spaces, ' and " from generated header ids (including prefixes), replacing them with dashes (-). WARNING: This might result in malformed ids`,type:"boolean"},headerLevelStart:{defaultValue:!1,describe:"The header blocks level start",type:"integer"},parseImgDimensions:{defaultValue:!1,describe:"Turn on/off image dimension parsing",type:"boolean"},simplifiedAutoLink:{defaultValue:!1,describe:"Turn on/off GFM autolink style",type:"boolean"},excludeTrailingPunctuationFromURLs:{defaultValue:!1,describe:"Excludes trailing punctuation from links generated with autoLinking",type:"boolean"},literalMidWordUnderscores:{defaultValue:!1,describe:"Parse midword underscores as literal underscores",type:"boolean"},literalMidWordAsterisks:{defaultValue:!1,describe:"Parse midword asterisks as literal asterisks",type:"boolean"},strikethrough:{defaultValue:!1,describe:"Turn on/off strikethrough support",type:"boolean"},tables:{defaultValue:!1,describe:"Turn on/off tables support",type:"boolean"},tablesHeaderId:{defaultValue:!1,describe:"Add an id to table headers",type:"boolean"},ghCodeBlocks:{defaultValue:!0,describe:"Turn on/off GFM fenced code blocks support",type:"boolean"},tasklists:{defaultValue:!1,describe:"Turn on/off GFM tasklist support",type:"boolean"},smoothLivePreview:{defaultValue:!1,describe:"Prevents weird effects in live previews due to incomplete input",type:"boolean"},smartIndentationFix:{defaultValue:!1,description:"Tries to smartly fix indentation in es6 strings",type:"boolean"},disableForced4SpacesIndentedSublists:{defaultValue:!1,description:"Disables the requirement of indenting nested sublists by 4 spaces",type:"boolean"},simpleLineBreaks:{defaultValue:!1,description:"Parses simple line breaks as <br> (GFM Style)",type:"boolean"},requireSpaceBeforeHeadingText:{defaultValue:!1,description:"Makes adding a space between `#` and the header text mandatory (GFM Style)",type:"boolean"},ghMentions:{defaultValue:!1,description:"Enables github @mentions",type:"boolean"},ghMentionsLink:{defaultValue:"https://github.com/{u}",description:"Changes the link generated by @mentions. Only applies if ghMentions option is enabled.",type:"string"},encodeEmails:{defaultValue:!0,description:"Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities",type:"boolean"},openLinksInNewWindow:{defaultValue:!1,description:"Open all links in new windows",type:"boolean"},backslashEscapesHTMLTags:{defaultValue:!1,description:"Support for HTML Tag escaping. ex: <div>foo</div>",type:"boolean"},emoji:{defaultValue:!1,description:"Enable emoji support. Ex: `this is a :smile: emoji`",type:"boolean"},underline:{defaultValue:!1,description:"Enable support for underline. Syntax is double or triple underscores: `__underline word__`. With this option enabled, underscores no longer parses into `<em>` and `<strong>`",type:"boolean"},completeHTMLDocument:{defaultValue:!1,description:"Outputs a complete html document, including `<html>`, `<head>` and `<body>` tags",type:"boolean"},metadata:{defaultValue:!1,description:"Enable support for document metadata (defined at the top of the document between `\xAB\xAB\xAB` and `\xBB\xBB\xBB` or between `---` and `---`).",type:"boolean"},splitAdjacentBlockquotes:{defaultValue:!1,description:"Split adjacent blockquote blocks",type:"boolean"}};if(n===!1)return JSON.parse(JSON.stringify(i));var u={};for(var d in i)i.hasOwnProperty(d)&&(u[d]=i[d].defaultValue);return u}function t(){"use strict";var n=e(!0),i={};for(var u in n)n.hasOwnProperty(u)&&(i[u]=!0);return i}var r={},a={},o={},s=e(!0),c="vanilla",h={github:{omitExtraWLInCodeBlocks:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,disableForced4SpacesIndentedSublists:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghCompatibleHeaderId:!0,ghMentions:!0,backslashEscapesHTMLTags:!0,emoji:!0,splitAdjacentBlockquotes:!0},original:{noHeaderId:!0,ghCodeBlocks:!1},ghost:{omitExtraWLInCodeBlocks:!0,parseImgDimensions:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,smoothLivePreview:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghMentions:!1,encodeEmails:!0},vanilla:e(!0),allOn:t()};r.helper={},r.extensions={},r.setOption=function(n,i){"use strict";return s[n]=i,this},r.getOption=function(n){"use strict";return s[n]},r.getOptions=function(){"use strict";return s},r.resetOptions=function(){"use strict";s=e(!0)},r.setFlavor=function(n){"use strict";if(!h.hasOwnProperty(n))throw Error(n+" flavor was not found");r.resetOptions();var i=h[n];c=n;for(var u in i)i.hasOwnProperty(u)&&(s[u]=i[u])},r.getFlavor=function(){"use strict";return c},r.getFlavorOptions=function(n){"use strict";if(h.hasOwnProperty(n))return h[n]},r.getDefaultOptions=function(n){"use strict";return e(n)},r.subParser=function(n,i){"use strict";if(r.helper.isString(n))if(typeof i<"u")a[n]=i;else{if(a.hasOwnProperty(n))return a[n];throw Error("SubParser named "+n+" not registered!")}},r.extension=function(n,i){"use strict";if(!r.helper.isString(n))throw Error("Extension 'name' must be a string");if(n=r.helper.stdExtName(n),r.helper.isUndefined(i)){if(!o.hasOwnProperty(n))throw Error("Extension named "+n+" is not registered!");return o[n]}else{typeof i=="function"&&(i=i()),r.helper.isArray(i)||(i=[i]);var u=_(i,n);if(u.valid)o[n]=i;else throw Error(u.error)}},r.getAllExtensions=function(){"use strict";return o},r.removeExtension=function(n){"use strict";delete o[n]},r.resetExtensions=function(){"use strict";o={}};function _(n,i){"use strict";var u=i?"Error in "+i+" extension->":"Error in unnamed extension",d={valid:!0,error:""};r.helper.isArray(n)||(n=[n]);for(var p=0;p<n.length;++p){var m=u+" sub-extension "+p+": ",f=n[p];if(typeof f!="object")return d.valid=!1,d.error=m+"must be an object, but "+typeof f+" given",d;if(!r.helper.isString(f.type))return d.valid=!1,d.error=m+'property "type" must be a string, but '+typeof f.type+" given",d;var g=f.type=f.type.toLowerCase();if(g==="language"&&(g=f.type="lang"),g==="html"&&(g=f.type="output"),g!=="lang"&&g!=="output"&&g!=="listener")return d.valid=!1,d.error=m+"type "+g+' is not recognized. Valid values: "lang/language", "output/html" or "listener"',d;if(g==="listener"){if(r.helper.isUndefined(f.listeners))return d.valid=!1,d.error=m+'. Extensions of type "listener" must have a property called "listeners"',d}else if(r.helper.isUndefined(f.filter)&&r.helper.isUndefined(f.regex))return d.valid=!1,d.error=m+g+' extensions must define either a "regex" property or a "filter" method',d;if(f.listeners){if(typeof f.listeners!="object")return d.valid=!1,d.error=m+'"listeners" property must be an object but '+typeof f.listeners+" given",d;for(var T in f.listeners)if(f.listeners.hasOwnProperty(T)&&typeof f.listeners[T]!="function")return d.valid=!1,d.error=m+'"listeners" property must be an hash of [event name]: [callback]. listeners.'+T+" must be a function but "+typeof f.listeners[T]+" given",d}if(f.filter){if(typeof f.filter!="function")return d.valid=!1,d.error=m+'"filter" must be a function, but '+typeof f.filter+" given",d}else if(f.regex){if(r.helper.isString(f.regex)&&(f.regex=new RegExp(f.regex,"g")),!(f.regex instanceof RegExp))return d.valid=!1,d.error=m+'"regex" property must either be a string or a RegExp object, but '+typeof f.regex+" given",d;if(r.helper.isUndefined(f.replace))return d.valid=!1,d.error=m+'"regex" extensions must implement a replace string or function',d}}return d}r.validateExtension=function(n){"use strict";var i=_(n,null);return i.valid?!0:(console.warn(i.error),!1)},r.hasOwnProperty("helper")||(r.helper={}),r.helper.isString=function(n){"use strict";return typeof n=="string"||n instanceof String},r.helper.isFunction=function(n){"use strict";var i={};return n&&i.toString.call(n)==="[object Function]"},r.helper.isArray=function(n){"use strict";return Array.isArray(n)},r.helper.isUndefined=function(n){"use strict";return typeof n>"u"},r.helper.forEach=function(n,i){"use strict";if(r.helper.isUndefined(n))throw new Error("obj param is required");if(r.helper.isUndefined(i))throw new Error("callback param is required");if(!r.helper.isFunction(i))throw new Error("callback param must be a function/closure");if(typeof n.forEach=="function")n.forEach(i);else if(r.helper.isArray(n))for(var u=0;u<n.length;u++)i(n[u],u,n);else if(typeof n=="object")for(var d in n)n.hasOwnProperty(d)&&i(n[d],d,n);else throw new Error("obj does not seem to be an array or an iterable object")},r.helper.stdExtName=function(n){"use strict";return n.replace(/[_?*+\/\\.^-]/g,"").replace(/\s/g,"").toLowerCase()};function b(n,i){"use strict";var u=i.charCodeAt(0);return"\xA8E"+u+"E"}r.helper.escapeCharactersCallback=b,r.helper.escapeCharacters=function(n,i,u){"use strict";var d="(["+i.replace(/([\[\]\\])/g,"\\$1")+"])";u&&(d="\\\\"+d);var p=new RegExp(d,"g");return n=n.replace(p,b),n},r.helper.unescapeHTMLEntities=function(n){"use strict";return n.replace(/"/g,'"').replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")};var E=function(n,i,u,d){"use strict";var p=d||"",m=p.indexOf("g")>-1,f=new RegExp(i+"|"+u,"g"+p.replace(/g/g,"")),g=new RegExp(i,p.replace(/g/g,"")),T=[],k,w,v,l,y;do for(k=0;v=f.exec(n);)if(g.test(v[0]))k++||(w=f.lastIndex,l=w-v[0].length);else if(k&&!--k){y=v.index+v[0].length;var C={left:{start:l,end:w},match:{start:w,end:v.index},right:{start:v.index,end:y},wholeMatch:{start:l,end:y}};if(T.push(C),!m)return T}while(k&&(f.lastIndex=w));return T};r.helper.matchRecursiveRegExp=function(n,i,u,d){"use strict";for(var p=E(n,i,u,d),m=[],f=0;f<p.length;++f)m.push([n.slice(p[f].wholeMatch.start,p[f].wholeMatch.end),n.slice(p[f].match.start,p[f].match.end),n.slice(p[f].left.start,p[f].left.end),n.slice(p[f].right.start,p[f].right.end)]);return m},r.helper.replaceRecursiveRegExp=function(n,i,u,d,p){"use strict";if(!r.helper.isFunction(i)){var m=i;i=function(){return m}}var f=E(n,u,d,p),g=n,T=f.length;if(T>0){var k=[];f[0].wholeMatch.start!==0&&k.push(n.slice(0,f[0].wholeMatch.start));for(var w=0;w<T;++w)k.push(i(n.slice(f[w].wholeMatch.start,f[w].wholeMatch.end),n.slice(f[w].match.start,f[w].match.end),n.slice(f[w].left.start,f[w].left.end),n.slice(f[w].right.start,f[w].right.end))),w<T-1&&k.push(n.slice(f[w].wholeMatch.end,f[w+1].wholeMatch.start));f[T-1].wholeMatch.end<n.length&&k.push(n.slice(f[T-1].wholeMatch.end)),g=k.join("")}return g},r.helper.regexIndexOf=function(n,i,u){"use strict";if(!r.helper.isString(n))throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";if(!(i instanceof RegExp))throw"InvalidArgumentError: second parameter of showdown.helper.regexIndexOf function must be an instance of RegExp";var d=n.substring(u||0).search(i);return d>=0?d+(u||0):d},r.helper.splitAtIndex=function(n,i){"use strict";if(!r.helper.isString(n))throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";return[n.substring(0,i),n.substring(i)]},r.helper.encodeEmailAddress=function(n){"use strict";var i=[function(u){return"&#"+u.charCodeAt(0)+";"},function(u){return"&#x"+u.charCodeAt(0).toString(16)+";"},function(u){return u}];return n=n.replace(/./g,function(u){if(u==="@")u=i[Math.floor(Math.random()*2)](u);else{var d=Math.random();u=d>.9?i[2](u):d>.45?i[1](u):i[0](u)}return u}),n},r.helper.padEnd=function(i,u,d){"use strict";return u=u>>0,d=String(d||" "),i.length>u?String(i):(u=u-i.length,u>d.length&&(d+=d.repeat(u/d.length)),String(i)+d.slice(0,u))},typeof console>"u"&&(console={warn:function(n){"use strict";alert(n)},log:function(n){"use strict";alert(n)},error:function(n){"use strict";throw n}}),r.helper.regexes={asteriskDashAndColon:/([*_:~])/g},r.helper.emojis={"+1":"\u{1F44D}","-1":"\u{1F44E}",100:"\u{1F4AF}",1234:"\u{1F522}","1st_place_medal":"\u{1F947}","2nd_place_medal":"\u{1F948}","3rd_place_medal":"\u{1F949}","8ball":"\u{1F3B1}",a:"\u{1F170}\uFE0F",ab:"\u{1F18E}",abc:"\u{1F524}",abcd:"\u{1F521}",accept:"\u{1F251}",aerial_tramway:"\u{1F6A1}",airplane:"\u2708\uFE0F",alarm_clock:"\u23F0",alembic:"\u2697\uFE0F",alien:"\u{1F47D}",ambulance:"\u{1F691}",amphora:"\u{1F3FA}",anchor:"\u2693\uFE0F",angel:"\u{1F47C}",anger:"\u{1F4A2}",angry:"\u{1F620}",anguished:"\u{1F627}",ant:"\u{1F41C}",apple:"\u{1F34E}",aquarius:"\u2652\uFE0F",aries:"\u2648\uFE0F",arrow_backward:"\u25C0\uFE0F",arrow_double_down:"\u23EC",arrow_double_up:"\u23EB",arrow_down:"\u2B07\uFE0F",arrow_down_small:"\u{1F53D}",arrow_forward:"\u25B6\uFE0F",arrow_heading_down:"\u2935\uFE0F",arrow_heading_up:"\u2934\uFE0F",arrow_left:"\u2B05\uFE0F",arrow_lower_left:"\u2199\uFE0F",arrow_lower_right:"\u2198\uFE0F",arrow_right:"\u27A1\uFE0F",arrow_right_hook:"\u21AA\uFE0F",arrow_up:"\u2B06\uFE0F",arrow_up_down:"\u2195\uFE0F",arrow_up_small:"\u{1F53C}",arrow_upper_left:"\u2196\uFE0F",arrow_upper_right:"\u2197\uFE0F",arrows_clockwise:"\u{1F503}",arrows_counterclockwise:"\u{1F504}",art:"\u{1F3A8}",articulated_lorry:"\u{1F69B}",artificial_satellite:"\u{1F6F0}",astonished:"\u{1F632}",athletic_shoe:"\u{1F45F}",atm:"\u{1F3E7}",atom_symbol:"\u269B\uFE0F",avocado:"\u{1F951}",b:"\u{1F171}\uFE0F",baby:"\u{1F476}",baby_bottle:"\u{1F37C}",baby_chick:"\u{1F424}",baby_symbol:"\u{1F6BC}",back:"\u{1F519}",bacon:"\u{1F953}",badminton:"\u{1F3F8}",baggage_claim:"\u{1F6C4}",baguette_bread:"\u{1F956}",balance_scale:"\u2696\uFE0F",balloon:"\u{1F388}",ballot_box:"\u{1F5F3}",ballot_box_with_check:"\u2611\uFE0F",bamboo:"\u{1F38D}",banana:"\u{1F34C}",bangbang:"\u203C\uFE0F",bank:"\u{1F3E6}",bar_chart:"\u{1F4CA}",barber:"\u{1F488}",baseball:"\u26BE\uFE0F",basketball:"\u{1F3C0}",basketball_man:"\u26F9\uFE0F",basketball_woman:"\u26F9\uFE0F‍\u2640\uFE0F",bat:"\u{1F987}",bath:"\u{1F6C0}",bathtub:"\u{1F6C1}",battery:"\u{1F50B}",beach_umbrella:"\u{1F3D6}",bear:"\u{1F43B}",bed:"\u{1F6CF}",bee:"\u{1F41D}",beer:"\u{1F37A}",beers:"\u{1F37B}",beetle:"\u{1F41E}",beginner:"\u{1F530}",bell:"\u{1F514}",bellhop_bell:"\u{1F6CE}",bento:"\u{1F371}",biking_man:"\u{1F6B4}",bike:"\u{1F6B2}",biking_woman:"\u{1F6B4}‍\u2640\uFE0F",bikini:"\u{1F459}",biohazard:"\u2623\uFE0F",bird:"\u{1F426}",birthday:"\u{1F382}",black_circle:"\u26AB\uFE0F",black_flag:"\u{1F3F4}",black_heart:"\u{1F5A4}",black_joker:"\u{1F0CF}",black_large_square:"\u2B1B\uFE0F",black_medium_small_square:"\u25FE\uFE0F",black_medium_square:"\u25FC\uFE0F",black_nib:"\u2712\uFE0F",black_small_square:"\u25AA\uFE0F",black_square_button:"\u{1F532}",blonde_man:"\u{1F471}",blonde_woman:"\u{1F471}‍\u2640\uFE0F",blossom:"\u{1F33C}",blowfish:"\u{1F421}",blue_book:"\u{1F4D8}",blue_car:"\u{1F699}",blue_heart:"\u{1F499}",blush:"\u{1F60A}",boar:"\u{1F417}",boat:"\u26F5\uFE0F",bomb:"\u{1F4A3}",book:"\u{1F4D6}",bookmark:"\u{1F516}",bookmark_tabs:"\u{1F4D1}",books:"\u{1F4DA}",boom:"\u{1F4A5}",boot:"\u{1F462}",bouquet:"\u{1F490}",bowing_man:"\u{1F647}",bow_and_arrow:"\u{1F3F9}",bowing_woman:"\u{1F647}‍\u2640\uFE0F",bowling:"\u{1F3B3}",boxing_glove:"\u{1F94A}",boy:"\u{1F466}",bread:"\u{1F35E}",bride_with_veil:"\u{1F470}",bridge_at_night:"\u{1F309}",briefcase:"\u{1F4BC}",broken_heart:"\u{1F494}",bug:"\u{1F41B}",building_construction:"\u{1F3D7}",bulb:"\u{1F4A1}",bullettrain_front:"\u{1F685}",bullettrain_side:"\u{1F684}",burrito:"\u{1F32F}",bus:"\u{1F68C}",business_suit_levitating:"\u{1F574}",busstop:"\u{1F68F}",bust_in_silhouette:"\u{1F464}",busts_in_silhouette:"\u{1F465}",butterfly:"\u{1F98B}",cactus:"\u{1F335}",cake:"\u{1F370}",calendar:"\u{1F4C6}",call_me_hand:"\u{1F919}",calling:"\u{1F4F2}",camel:"\u{1F42B}",camera:"\u{1F4F7}",camera_flash:"\u{1F4F8}",camping:"\u{1F3D5}",cancer:"\u264B\uFE0F",candle:"\u{1F56F}",candy:"\u{1F36C}",canoe:"\u{1F6F6}",capital_abcd:"\u{1F520}",capricorn:"\u2651\uFE0F",car:"\u{1F697}",card_file_box:"\u{1F5C3}",card_index:"\u{1F4C7}",card_index_dividers:"\u{1F5C2}",carousel_horse:"\u{1F3A0}",carrot:"\u{1F955}",cat:"\u{1F431}",cat2:"\u{1F408}",cd:"\u{1F4BF}",chains:"\u26D3",champagne:"\u{1F37E}",chart:"\u{1F4B9}",chart_with_downwards_trend:"\u{1F4C9}",chart_with_upwards_trend:"\u{1F4C8}",checkered_flag:"\u{1F3C1}",cheese:"\u{1F9C0}",cherries:"\u{1F352}",cherry_blossom:"\u{1F338}",chestnut:"\u{1F330}",chicken:"\u{1F414}",children_crossing:"\u{1F6B8}",chipmunk:"\u{1F43F}",chocolate_bar:"\u{1F36B}",christmas_tree:"\u{1F384}",church:"\u26EA\uFE0F",cinema:"\u{1F3A6}",circus_tent:"\u{1F3AA}",city_sunrise:"\u{1F307}",city_sunset:"\u{1F306}",cityscape:"\u{1F3D9}",cl:"\u{1F191}",clamp:"\u{1F5DC}",clap:"\u{1F44F}",clapper:"\u{1F3AC}",classical_building:"\u{1F3DB}",clinking_glasses:"\u{1F942}",clipboard:"\u{1F4CB}",clock1:"\u{1F550}",clock10:"\u{1F559}",clock1030:"\u{1F565}",clock11:"\u{1F55A}",clock1130:"\u{1F566}",clock12:"\u{1F55B}",clock1230:"\u{1F567}",clock130:"\u{1F55C}",clock2:"\u{1F551}",clock230:"\u{1F55D}",clock3:"\u{1F552}",clock330:"\u{1F55E}",clock4:"\u{1F553}",clock430:"\u{1F55F}",clock5:"\u{1F554}",clock530:"\u{1F560}",clock6:"\u{1F555}",clock630:"\u{1F561}",clock7:"\u{1F556}",clock730:"\u{1F562}",clock8:"\u{1F557}",clock830:"\u{1F563}",clock9:"\u{1F558}",clock930:"\u{1F564}",closed_book:"\u{1F4D5}",closed_lock_with_key:"\u{1F510}",closed_umbrella:"\u{1F302}",cloud:"\u2601\uFE0F",cloud_with_lightning:"\u{1F329}",cloud_with_lightning_and_rain:"\u26C8",cloud_with_rain:"\u{1F327}",cloud_with_snow:"\u{1F328}",clown_face:"\u{1F921}",clubs:"\u2663\uFE0F",cocktail:"\u{1F378}",coffee:"\u2615\uFE0F",coffin:"\u26B0\uFE0F",cold_sweat:"\u{1F630}",comet:"\u2604\uFE0F",computer:"\u{1F4BB}",computer_mouse:"\u{1F5B1}",confetti_ball:"\u{1F38A}",confounded:"\u{1F616}",confused:"\u{1F615}",congratulations:"\u3297\uFE0F",construction:"\u{1F6A7}",construction_worker_man:"\u{1F477}",construction_worker_woman:"\u{1F477}‍\u2640\uFE0F",control_knobs:"\u{1F39B}",convenience_store:"\u{1F3EA}",cookie:"\u{1F36A}",cool:"\u{1F192}",policeman:"\u{1F46E}",copyright:"\xA9\uFE0F",corn:"\u{1F33D}",couch_and_lamp:"\u{1F6CB}",couple:"\u{1F46B}",couple_with_heart_woman_man:"\u{1F491}",couple_with_heart_man_man:"\u{1F468}‍\u2764\uFE0F‍\u{1F468}",couple_with_heart_woman_woman:"\u{1F469}‍\u2764\uFE0F‍\u{1F469}",couplekiss_man_man:"\u{1F468}‍\u2764\uFE0F‍\u{1F48B}‍\u{1F468}",couplekiss_man_woman:"\u{1F48F}",couplekiss_woman_woman:"\u{1F469}‍\u2764\uFE0F‍\u{1F48B}‍\u{1F469}",cow:"\u{1F42E}",cow2:"\u{1F404}",cowboy_hat_face:"\u{1F920}",crab:"\u{1F980}",crayon:"\u{1F58D}",credit_card:"\u{1F4B3}",crescent_moon:"\u{1F319}",cricket:"\u{1F3CF}",crocodile:"\u{1F40A}",croissant:"\u{1F950}",crossed_fingers:"\u{1F91E}",crossed_flags:"\u{1F38C}",crossed_swords:"\u2694\uFE0F",crown:"\u{1F451}",cry:"\u{1F622}",crying_cat_face:"\u{1F63F}",crystal_ball:"\u{1F52E}",cucumber:"\u{1F952}",cupid:"\u{1F498}",curly_loop:"\u27B0",currency_exchange:"\u{1F4B1}",curry:"\u{1F35B}",custard:"\u{1F36E}",customs:"\u{1F6C3}",cyclone:"\u{1F300}",dagger:"\u{1F5E1}",dancer:"\u{1F483}",dancing_women:"\u{1F46F}",dancing_men:"\u{1F46F}‍\u2642\uFE0F",dango:"\u{1F361}",dark_sunglasses:"\u{1F576}",dart:"\u{1F3AF}",dash:"\u{1F4A8}",date:"\u{1F4C5}",deciduous_tree:"\u{1F333}",deer:"\u{1F98C}",department_store:"\u{1F3EC}",derelict_house:"\u{1F3DA}",desert:"\u{1F3DC}",desert_island:"\u{1F3DD}",desktop_computer:"\u{1F5A5}",male_detective:"\u{1F575}\uFE0F",diamond_shape_with_a_dot_inside:"\u{1F4A0}",diamonds:"\u2666\uFE0F",disappointed:"\u{1F61E}",disappointed_relieved:"\u{1F625}",dizzy:"\u{1F4AB}",dizzy_face:"\u{1F635}",do_not_litter:"\u{1F6AF}",dog:"\u{1F436}",dog2:"\u{1F415}",dollar:"\u{1F4B5}",dolls:"\u{1F38E}",dolphin:"\u{1F42C}",door:"\u{1F6AA}",doughnut:"\u{1F369}",dove:"\u{1F54A}",dragon:"\u{1F409}",dragon_face:"\u{1F432}",dress:"\u{1F457}",dromedary_camel:"\u{1F42A}",drooling_face:"\u{1F924}",droplet:"\u{1F4A7}",drum:"\u{1F941}",duck:"\u{1F986}",dvd:"\u{1F4C0}","e-mail":"\u{1F4E7}",eagle:"\u{1F985}",ear:"\u{1F442}",ear_of_rice:"\u{1F33E}",earth_africa:"\u{1F30D}",earth_americas:"\u{1F30E}",earth_asia:"\u{1F30F}",egg:"\u{1F95A}",eggplant:"\u{1F346}",eight_pointed_black_star:"\u2734\uFE0F",eight_spoked_asterisk:"\u2733\uFE0F",electric_plug:"\u{1F50C}",elephant:"\u{1F418}",email:"\u2709\uFE0F",end:"\u{1F51A}",envelope_with_arrow:"\u{1F4E9}",euro:"\u{1F4B6}",european_castle:"\u{1F3F0}",european_post_office:"\u{1F3E4}",evergreen_tree:"\u{1F332}",exclamation:"\u2757\uFE0F",expressionless:"\u{1F611}",eye:"\u{1F441}",eye_speech_bubble:"\u{1F441}‍\u{1F5E8}",eyeglasses:"\u{1F453}",eyes:"\u{1F440}",face_with_head_bandage:"\u{1F915}",face_with_thermometer:"\u{1F912}",fist_oncoming:"\u{1F44A}",factory:"\u{1F3ED}",fallen_leaf:"\u{1F342}",family_man_woman_boy:"\u{1F46A}",family_man_boy:"\u{1F468}‍\u{1F466}",family_man_boy_boy:"\u{1F468}‍\u{1F466}‍\u{1F466}",family_man_girl:"\u{1F468}‍\u{1F467}",family_man_girl_boy:"\u{1F468}‍\u{1F467}‍\u{1F466}",family_man_girl_girl:"\u{1F468}‍\u{1F467}‍\u{1F467}",family_man_man_boy:"\u{1F468}‍\u{1F468}‍\u{1F466}",family_man_man_boy_boy:"\u{1F468}‍\u{1F468}‍\u{1F466}‍\u{1F466}",family_man_man_girl:"\u{1F468}‍\u{1F468}‍\u{1F467}",family_man_man_girl_boy:"\u{1F468}‍\u{1F468}‍\u{1F467}‍\u{1F466}",family_man_man_girl_girl:"\u{1F468}‍\u{1F468}‍\u{1F467}‍\u{1F467}",family_man_woman_boy_boy:"\u{1F468}‍\u{1F469}‍\u{1F466}‍\u{1F466}",family_man_woman_girl:"\u{1F468}‍\u{1F469}‍\u{1F467}",family_man_woman_girl_boy:"\u{1F468}‍\u{1F469}‍\u{1F467}‍\u{1F466}",family_man_woman_girl_girl:"\u{1F468}‍\u{1F469}‍\u{1F467}‍\u{1F467}",family_woman_boy:"\u{1F469}‍\u{1F466}",family_woman_boy_boy:"\u{1F469}‍\u{1F466}‍\u{1F466}",family_woman_girl:"\u{1F469}‍\u{1F467}",family_woman_girl_boy:"\u{1F469}‍\u{1F467}‍\u{1F466}",family_woman_girl_girl:"\u{1F469}‍\u{1F467}‍\u{1F467}",family_woman_woman_boy:"\u{1F469}‍\u{1F469}‍\u{1F466}",family_woman_woman_boy_boy:"\u{1F469}‍\u{1F469}‍\u{1F466}‍\u{1F466}",family_woman_woman_girl:"\u{1F469}‍\u{1F469}‍\u{1F467}",family_woman_woman_girl_boy:"\u{1F469}‍\u{1F469}‍\u{1F467}‍\u{1F466}",family_woman_woman_girl_girl:"\u{1F469}‍\u{1F469}‍\u{1F467}‍\u{1F467}",fast_forward:"\u23E9",fax:"\u{1F4E0}",fearful:"\u{1F628}",feet:"\u{1F43E}",female_detective:"\u{1F575}\uFE0F‍\u2640\uFE0F",ferris_wheel:"\u{1F3A1}",ferry:"\u26F4",field_hockey:"\u{1F3D1}",file_cabinet:"\u{1F5C4}",file_folder:"\u{1F4C1}",film_projector:"\u{1F4FD}",film_strip:"\u{1F39E}",fire:"\u{1F525}",fire_engine:"\u{1F692}",fireworks:"\u{1F386}",first_quarter_moon:"\u{1F313}",first_quarter_moon_with_face:"\u{1F31B}",fish:"\u{1F41F}",fish_cake:"\u{1F365}",fishing_pole_and_fish:"\u{1F3A3}",fist_raised:"\u270A",fist_left:"\u{1F91B}",fist_right:"\u{1F91C}",flags:"\u{1F38F}",flashlight:"\u{1F526}",fleur_de_lis:"\u269C\uFE0F",flight_arrival:"\u{1F6EC}",flight_departure:"\u{1F6EB}",floppy_disk:"\u{1F4BE}",flower_playing_cards:"\u{1F3B4}",flushed:"\u{1F633}",fog:"\u{1F32B}",foggy:"\u{1F301}",football:"\u{1F3C8}",footprints:"\u{1F463}",fork_and_knife:"\u{1F374}",fountain:"\u26F2\uFE0F",fountain_pen:"\u{1F58B}",four_leaf_clover:"\u{1F340}",fox_face:"\u{1F98A}",framed_picture:"\u{1F5BC}",free:"\u{1F193}",fried_egg:"\u{1F373}",fried_shrimp:"\u{1F364}",fries:"\u{1F35F}",frog:"\u{1F438}",frowning:"\u{1F626}",frowning_face:"\u2639\uFE0F",frowning_man:"\u{1F64D}‍\u2642\uFE0F",frowning_woman:"\u{1F64D}",middle_finger:"\u{1F595}",fuelpump:"\u26FD\uFE0F",full_moon:"\u{1F315}",full_moon_with_face:"\u{1F31D}",funeral_urn:"\u26B1\uFE0F",game_die:"\u{1F3B2}",gear:"\u2699\uFE0F",gem:"\u{1F48E}",gemini:"\u264A\uFE0F",ghost:"\u{1F47B}",gift:"\u{1F381}",gift_heart:"\u{1F49D}",girl:"\u{1F467}",globe_with_meridians:"\u{1F310}",goal_net:"\u{1F945}",goat:"\u{1F410}",golf:"\u26F3\uFE0F",golfing_man:"\u{1F3CC}\uFE0F",golfing_woman:"\u{1F3CC}\uFE0F‍\u2640\uFE0F",gorilla:"\u{1F98D}",grapes:"\u{1F347}",green_apple:"\u{1F34F}",green_book:"\u{1F4D7}",green_heart:"\u{1F49A}",green_salad:"\u{1F957}",grey_exclamation:"\u2755",grey_question:"\u2754",grimacing:"\u{1F62C}",grin:"\u{1F601}",grinning:"\u{1F600}",guardsman:"\u{1F482}",guardswoman:"\u{1F482}‍\u2640\uFE0F",guitar:"\u{1F3B8}",gun:"\u{1F52B}",haircut_woman:"\u{1F487}",haircut_man:"\u{1F487}‍\u2642\uFE0F",hamburger:"\u{1F354}",hammer:"\u{1F528}",hammer_and_pick:"\u2692",hammer_and_wrench:"\u{1F6E0}",hamster:"\u{1F439}",hand:"\u270B",handbag:"\u{1F45C}",handshake:"\u{1F91D}",hankey:"\u{1F4A9}",hatched_chick:"\u{1F425}",hatching_chick:"\u{1F423}",headphones:"\u{1F3A7}",hear_no_evil:"\u{1F649}",heart:"\u2764\uFE0F",heart_decoration:"\u{1F49F}",heart_eyes:"\u{1F60D}",heart_eyes_cat:"\u{1F63B}",heartbeat:"\u{1F493}",heartpulse:"\u{1F497}",hearts:"\u2665\uFE0F",heavy_check_mark:"\u2714\uFE0F",heavy_division_sign:"\u2797",heavy_dollar_sign:"\u{1F4B2}",heavy_heart_exclamation:"\u2763\uFE0F",heavy_minus_sign:"\u2796",heavy_multiplication_x:"\u2716\uFE0F",heavy_plus_sign:"\u2795",helicopter:"\u{1F681}",herb:"\u{1F33F}",hibiscus:"\u{1F33A}",high_brightness:"\u{1F506}",high_heel:"\u{1F460}",hocho:"\u{1F52A}",hole:"\u{1F573}",honey_pot:"\u{1F36F}",horse:"\u{1F434}",horse_racing:"\u{1F3C7}",hospital:"\u{1F3E5}",hot_pepper:"\u{1F336}",hotdog:"\u{1F32D}",hotel:"\u{1F3E8}",hotsprings:"\u2668\uFE0F",hourglass:"\u231B\uFE0F",hourglass_flowing_sand:"\u23F3",house:"\u{1F3E0}",house_with_garden:"\u{1F3E1}",houses:"\u{1F3D8}",hugs:"\u{1F917}",hushed:"\u{1F62F}",ice_cream:"\u{1F368}",ice_hockey:"\u{1F3D2}",ice_skate:"\u26F8",icecream:"\u{1F366}",id:"\u{1F194}",ideograph_advantage:"\u{1F250}",imp:"\u{1F47F}",inbox_tray:"\u{1F4E5}",incoming_envelope:"\u{1F4E8}",tipping_hand_woman:"\u{1F481}",information_source:"\u2139\uFE0F",innocent:"\u{1F607}",interrobang:"\u2049\uFE0F",iphone:"\u{1F4F1}",izakaya_lantern:"\u{1F3EE}",jack_o_lantern:"\u{1F383}",japan:"\u{1F5FE}",japanese_castle:"\u{1F3EF}",japanese_goblin:"\u{1F47A}",japanese_ogre:"\u{1F479}",jeans:"\u{1F456}",joy:"\u{1F602}",joy_cat:"\u{1F639}",joystick:"\u{1F579}",kaaba:"\u{1F54B}",key:"\u{1F511}",keyboard:"\u2328\uFE0F",keycap_ten:"\u{1F51F}",kick_scooter:"\u{1F6F4}",kimono:"\u{1F458}",kiss:"\u{1F48B}",kissing:"\u{1F617}",kissing_cat:"\u{1F63D}",kissing_closed_eyes:"\u{1F61A}",kissing_heart:"\u{1F618}",kissing_smiling_eyes:"\u{1F619}",kiwi_fruit:"\u{1F95D}",koala:"\u{1F428}",koko:"\u{1F201}",label:"\u{1F3F7}",large_blue_circle:"\u{1F535}",large_blue_diamond:"\u{1F537}",large_orange_diamond:"\u{1F536}",last_quarter_moon:"\u{1F317}",last_quarter_moon_with_face:"\u{1F31C}",latin_cross:"\u271D\uFE0F",laughing:"\u{1F606}",leaves:"\u{1F343}",ledger:"\u{1F4D2}",left_luggage:"\u{1F6C5}",left_right_arrow:"\u2194\uFE0F",leftwards_arrow_with_hook:"\u21A9\uFE0F",lemon:"\u{1F34B}",leo:"\u264C\uFE0F",leopard:"\u{1F406}",level_slider:"\u{1F39A}",libra:"\u264E\uFE0F",light_rail:"\u{1F688}",link:"\u{1F517}",lion:"\u{1F981}",lips:"\u{1F444}",lipstick:"\u{1F484}",lizard:"\u{1F98E}",lock:"\u{1F512}",lock_with_ink_pen:"\u{1F50F}",lollipop:"\u{1F36D}",loop:"\u27BF",loud_sound:"\u{1F50A}",loudspeaker:"\u{1F4E2}",love_hotel:"\u{1F3E9}",love_letter:"\u{1F48C}",low_brightness:"\u{1F505}",lying_face:"\u{1F925}",m:"\u24C2\uFE0F",mag:"\u{1F50D}",mag_right:"\u{1F50E}",mahjong:"\u{1F004}\uFE0F",mailbox:"\u{1F4EB}",mailbox_closed:"\u{1F4EA}",mailbox_with_mail:"\u{1F4EC}",mailbox_with_no_mail:"\u{1F4ED}",man:"\u{1F468}",man_artist:"\u{1F468}‍\u{1F3A8}",man_astronaut:"\u{1F468}‍\u{1F680}",man_cartwheeling:"\u{1F938}‍\u2642\uFE0F",man_cook:"\u{1F468}‍\u{1F373}",man_dancing:"\u{1F57A}",man_facepalming:"\u{1F926}‍\u2642\uFE0F",man_factory_worker:"\u{1F468}‍\u{1F3ED}",man_farmer:"\u{1F468}‍\u{1F33E}",man_firefighter:"\u{1F468}‍\u{1F692}",man_health_worker:"\u{1F468}‍\u2695\uFE0F",man_in_tuxedo:"\u{1F935}",man_judge:"\u{1F468}‍\u2696\uFE0F",man_juggling:"\u{1F939}‍\u2642\uFE0F",man_mechanic:"\u{1F468}‍\u{1F527}",man_office_worker:"\u{1F468}‍\u{1F4BC}",man_pilot:"\u{1F468}‍\u2708\uFE0F",man_playing_handball:"\u{1F93E}‍\u2642\uFE0F",man_playing_water_polo:"\u{1F93D}‍\u2642\uFE0F",man_scientist:"\u{1F468}‍\u{1F52C}",man_shrugging:"\u{1F937}‍\u2642\uFE0F",man_singer:"\u{1F468}‍\u{1F3A4}",man_student:"\u{1F468}‍\u{1F393}",man_teacher:"\u{1F468}‍\u{1F3EB}",man_technologist:"\u{1F468}‍\u{1F4BB}",man_with_gua_pi_mao:"\u{1F472}",man_with_turban:"\u{1F473}",tangerine:"\u{1F34A}",mans_shoe:"\u{1F45E}",mantelpiece_clock:"\u{1F570}",maple_leaf:"\u{1F341}",martial_arts_uniform:"\u{1F94B}",mask:"\u{1F637}",massage_woman:"\u{1F486}",massage_man:"\u{1F486}‍\u2642\uFE0F",meat_on_bone:"\u{1F356}",medal_military:"\u{1F396}",medal_sports:"\u{1F3C5}",mega:"\u{1F4E3}",melon:"\u{1F348}",memo:"\u{1F4DD}",men_wrestling:"\u{1F93C}‍\u2642\uFE0F",menorah:"\u{1F54E}",mens:"\u{1F6B9}",metal:"\u{1F918}",metro:"\u{1F687}",microphone:"\u{1F3A4}",microscope:"\u{1F52C}",milk_glass:"\u{1F95B}",milky_way:"\u{1F30C}",minibus:"\u{1F690}",minidisc:"\u{1F4BD}",mobile_phone_off:"\u{1F4F4}",money_mouth_face:"\u{1F911}",money_with_wings:"\u{1F4B8}",moneybag:"\u{1F4B0}",monkey:"\u{1F412}",monkey_face:"\u{1F435}",monorail:"\u{1F69D}",moon:"\u{1F314}",mortar_board:"\u{1F393}",mosque:"\u{1F54C}",motor_boat:"\u{1F6E5}",motor_scooter:"\u{1F6F5}",motorcycle:"\u{1F3CD}",motorway:"\u{1F6E3}",mount_fuji:"\u{1F5FB}",mountain:"\u26F0",mountain_biking_man:"\u{1F6B5}",mountain_biking_woman:"\u{1F6B5}‍\u2640\uFE0F",mountain_cableway:"\u{1F6A0}",mountain_railway:"\u{1F69E}",mountain_snow:"\u{1F3D4}",mouse:"\u{1F42D}",mouse2:"\u{1F401}",movie_camera:"\u{1F3A5}",moyai:"\u{1F5FF}",mrs_claus:"\u{1F936}",muscle:"\u{1F4AA}",mushroom:"\u{1F344}",musical_keyboard:"\u{1F3B9}",musical_note:"\u{1F3B5}",musical_score:"\u{1F3BC}",mute:"\u{1F507}",nail_care:"\u{1F485}",name_badge:"\u{1F4DB}",national_park:"\u{1F3DE}",nauseated_face:"\u{1F922}",necktie:"\u{1F454}",negative_squared_cross_mark:"\u274E",nerd_face:"\u{1F913}",neutral_face:"\u{1F610}",new:"\u{1F195}",new_moon:"\u{1F311}",new_moon_with_face:"\u{1F31A}",newspaper:"\u{1F4F0}",newspaper_roll:"\u{1F5DE}",next_track_button:"\u23ED",ng:"\u{1F196}",no_good_man:"\u{1F645}‍\u2642\uFE0F",no_good_woman:"\u{1F645}",night_with_stars:"\u{1F303}",no_bell:"\u{1F515}",no_bicycles:"\u{1F6B3}",no_entry:"\u26D4\uFE0F",no_entry_sign:"\u{1F6AB}",no_mobile_phones:"\u{1F4F5}",no_mouth:"\u{1F636}",no_pedestrians:"\u{1F6B7}",no_smoking:"\u{1F6AD}","non-potable_water":"\u{1F6B1}",nose:"\u{1F443}",notebook:"\u{1F4D3}",notebook_with_decorative_cover:"\u{1F4D4}",notes:"\u{1F3B6}",nut_and_bolt:"\u{1F529}",o:"\u2B55\uFE0F",o2:"\u{1F17E}\uFE0F",ocean:"\u{1F30A}",octopus:"\u{1F419}",oden:"\u{1F362}",office:"\u{1F3E2}",oil_drum:"\u{1F6E2}",ok:"\u{1F197}",ok_hand:"\u{1F44C}",ok_man:"\u{1F646}‍\u2642\uFE0F",ok_woman:"\u{1F646}",old_key:"\u{1F5DD}",older_man:"\u{1F474}",older_woman:"\u{1F475}",om:"\u{1F549}",on:"\u{1F51B}",oncoming_automobile:"\u{1F698}",oncoming_bus:"\u{1F68D}",oncoming_police_car:"\u{1F694}",oncoming_taxi:"\u{1F696}",open_file_folder:"\u{1F4C2}",open_hands:"\u{1F450}",open_mouth:"\u{1F62E}",open_umbrella:"\u2602\uFE0F",ophiuchus:"\u26CE",orange_book:"\u{1F4D9}",orthodox_cross:"\u2626\uFE0F",outbox_tray:"\u{1F4E4}",owl:"\u{1F989}",ox:"\u{1F402}",package:"\u{1F4E6}",page_facing_up:"\u{1F4C4}",page_with_curl:"\u{1F4C3}",pager:"\u{1F4DF}",paintbrush:"\u{1F58C}",palm_tree:"\u{1F334}",pancakes:"\u{1F95E}",panda_face:"\u{1F43C}",paperclip:"\u{1F4CE}",paperclips:"\u{1F587}",parasol_on_ground:"\u26F1",parking:"\u{1F17F}\uFE0F",part_alternation_mark:"\u303D\uFE0F",partly_sunny:"\u26C5\uFE0F",passenger_ship:"\u{1F6F3}",passport_control:"\u{1F6C2}",pause_button:"\u23F8",peace_symbol:"\u262E\uFE0F",peach:"\u{1F351}",peanuts:"\u{1F95C}",pear:"\u{1F350}",pen:"\u{1F58A}",pencil2:"\u270F\uFE0F",penguin:"\u{1F427}",pensive:"\u{1F614}",performing_arts:"\u{1F3AD}",persevere:"\u{1F623}",person_fencing:"\u{1F93A}",pouting_woman:"\u{1F64E}",phone:"\u260E\uFE0F",pick:"\u26CF",pig:"\u{1F437}",pig2:"\u{1F416}",pig_nose:"\u{1F43D}",pill:"\u{1F48A}",pineapple:"\u{1F34D}",ping_pong:"\u{1F3D3}",pisces:"\u2653\uFE0F",pizza:"\u{1F355}",place_of_worship:"\u{1F6D0}",plate_with_cutlery:"\u{1F37D}",play_or_pause_button:"\u23EF",point_down:"\u{1F447}",point_left:"\u{1F448}",point_right:"\u{1F449}",point_up:"\u261D\uFE0F",point_up_2:"\u{1F446}",police_car:"\u{1F693}",policewoman:"\u{1F46E}‍\u2640\uFE0F",poodle:"\u{1F429}",popcorn:"\u{1F37F}",post_office:"\u{1F3E3}",postal_horn:"\u{1F4EF}",postbox:"\u{1F4EE}",potable_water:"\u{1F6B0}",potato:"\u{1F954}",pouch:"\u{1F45D}",poultry_leg:"\u{1F357}",pound:"\u{1F4B7}",rage:"\u{1F621}",pouting_cat:"\u{1F63E}",pouting_man:"\u{1F64E}‍\u2642\uFE0F",pray:"\u{1F64F}",prayer_beads:"\u{1F4FF}",pregnant_woman:"\u{1F930}",previous_track_button:"\u23EE",prince:"\u{1F934}",princess:"\u{1F478}",printer:"\u{1F5A8}",purple_heart:"\u{1F49C}",purse:"\u{1F45B}",pushpin:"\u{1F4CC}",put_litter_in_its_place:"\u{1F6AE}",question:"\u2753",rabbit:"\u{1F430}",rabbit2:"\u{1F407}",racehorse:"\u{1F40E}",racing_car:"\u{1F3CE}",radio:"\u{1F4FB}",radio_button:"\u{1F518}",radioactive:"\u2622\uFE0F",railway_car:"\u{1F683}",railway_track:"\u{1F6E4}",rainbow:"\u{1F308}",rainbow_flag:"\u{1F3F3}\uFE0F‍\u{1F308}",raised_back_of_hand:"\u{1F91A}",raised_hand_with_fingers_splayed:"\u{1F590}",raised_hands:"\u{1F64C}",raising_hand_woman:"\u{1F64B}",raising_hand_man:"\u{1F64B}‍\u2642\uFE0F",ram:"\u{1F40F}",ramen:"\u{1F35C}",rat:"\u{1F400}",record_button:"\u23FA",recycle:"\u267B\uFE0F",red_circle:"\u{1F534}",registered:"\xAE\uFE0F",relaxed:"\u263A\uFE0F",relieved:"\u{1F60C}",reminder_ribbon:"\u{1F397}",repeat:"\u{1F501}",repeat_one:"\u{1F502}",rescue_worker_helmet:"\u26D1",restroom:"\u{1F6BB}",revolving_hearts:"\u{1F49E}",rewind:"\u23EA",rhinoceros:"\u{1F98F}",ribbon:"\u{1F380}",rice:"\u{1F35A}",rice_ball:"\u{1F359}",rice_cracker:"\u{1F358}",rice_scene:"\u{1F391}",right_anger_bubble:"\u{1F5EF}",ring:"\u{1F48D}",robot:"\u{1F916}",rocket:"\u{1F680}",rofl:"\u{1F923}",roll_eyes:"\u{1F644}",roller_coaster:"\u{1F3A2}",rooster:"\u{1F413}",rose:"\u{1F339}",rosette:"\u{1F3F5}",rotating_light:"\u{1F6A8}",round_pushpin:"\u{1F4CD}",rowing_man:"\u{1F6A3}",rowing_woman:"\u{1F6A3}‍\u2640\uFE0F",rugby_football:"\u{1F3C9}",running_man:"\u{1F3C3}",running_shirt_with_sash:"\u{1F3BD}",running_woman:"\u{1F3C3}‍\u2640\uFE0F",sa:"\u{1F202}\uFE0F",sagittarius:"\u2650\uFE0F",sake:"\u{1F376}",sandal:"\u{1F461}",santa:"\u{1F385}",satellite:"\u{1F4E1}",saxophone:"\u{1F3B7}",school:"\u{1F3EB}",school_satchel:"\u{1F392}",scissors:"\u2702\uFE0F",scorpion:"\u{1F982}",scorpius:"\u264F\uFE0F",scream:"\u{1F631}",scream_cat:"\u{1F640}",scroll:"\u{1F4DC}",seat:"\u{1F4BA}",secret:"\u3299\uFE0F",see_no_evil:"\u{1F648}",seedling:"\u{1F331}",selfie:"\u{1F933}",shallow_pan_of_food:"\u{1F958}",shamrock:"\u2618\uFE0F",shark:"\u{1F988}",shaved_ice:"\u{1F367}",sheep:"\u{1F411}",shell:"\u{1F41A}",shield:"\u{1F6E1}",shinto_shrine:"\u26E9",ship:"\u{1F6A2}",shirt:"\u{1F455}",shopping:"\u{1F6CD}",shopping_cart:"\u{1F6D2}",shower:"\u{1F6BF}",shrimp:"\u{1F990}",signal_strength:"\u{1F4F6}",six_pointed_star:"\u{1F52F}",ski:"\u{1F3BF}",skier:"\u26F7",skull:"\u{1F480}",skull_and_crossbones:"\u2620\uFE0F",sleeping:"\u{1F634}",sleeping_bed:"\u{1F6CC}",sleepy:"\u{1F62A}",slightly_frowning_face:"\u{1F641}",slightly_smiling_face:"\u{1F642}",slot_machine:"\u{1F3B0}",small_airplane:"\u{1F6E9}",small_blue_diamond:"\u{1F539}",small_orange_diamond:"\u{1F538}",small_red_triangle:"\u{1F53A}",small_red_triangle_down:"\u{1F53B}",smile:"\u{1F604}",smile_cat:"\u{1F638}",smiley:"\u{1F603}",smiley_cat:"\u{1F63A}",smiling_imp:"\u{1F608}",smirk:"\u{1F60F}",smirk_cat:"\u{1F63C}",smoking:"\u{1F6AC}",snail:"\u{1F40C}",snake:"\u{1F40D}",sneezing_face:"\u{1F927}",snowboarder:"\u{1F3C2}",snowflake:"\u2744\uFE0F",snowman:"\u26C4\uFE0F",snowman_with_snow:"\u2603\uFE0F",sob:"\u{1F62D}",soccer:"\u26BD\uFE0F",soon:"\u{1F51C}",sos:"\u{1F198}",sound:"\u{1F509}",space_invader:"\u{1F47E}",spades:"\u2660\uFE0F",spaghetti:"\u{1F35D}",sparkle:"\u2747\uFE0F",sparkler:"\u{1F387}",sparkles:"\u2728",sparkling_heart:"\u{1F496}",speak_no_evil:"\u{1F64A}",speaker:"\u{1F508}",speaking_head:"\u{1F5E3}",speech_balloon:"\u{1F4AC}",speedboat:"\u{1F6A4}",spider:"\u{1F577}",spider_web:"\u{1F578}",spiral_calendar:"\u{1F5D3}",spiral_notepad:"\u{1F5D2}",spoon:"\u{1F944}",squid:"\u{1F991}",stadium:"\u{1F3DF}",star:"\u2B50\uFE0F",star2:"\u{1F31F}",star_and_crescent:"\u262A\uFE0F",star_of_david:"\u2721\uFE0F",stars:"\u{1F320}",station:"\u{1F689}",statue_of_liberty:"\u{1F5FD}",steam_locomotive:"\u{1F682}",stew:"\u{1F372}",stop_button:"\u23F9",stop_sign:"\u{1F6D1}",stopwatch:"\u23F1",straight_ruler:"\u{1F4CF}",strawberry:"\u{1F353}",stuck_out_tongue:"\u{1F61B}",stuck_out_tongue_closed_eyes:"\u{1F61D}",stuck_out_tongue_winking_eye:"\u{1F61C}",studio_microphone:"\u{1F399}",stuffed_flatbread:"\u{1F959}",sun_behind_large_cloud:"\u{1F325}",sun_behind_rain_cloud:"\u{1F326}",sun_behind_small_cloud:"\u{1F324}",sun_with_face:"\u{1F31E}",sunflower:"\u{1F33B}",sunglasses:"\u{1F60E}",sunny:"\u2600\uFE0F",sunrise:"\u{1F305}",sunrise_over_mountains:"\u{1F304}",surfing_man:"\u{1F3C4}",surfing_woman:"\u{1F3C4}‍\u2640\uFE0F",sushi:"\u{1F363}",suspension_railway:"\u{1F69F}",sweat:"\u{1F613}",sweat_drops:"\u{1F4A6}",sweat_smile:"\u{1F605}",sweet_potato:"\u{1F360}",swimming_man:"\u{1F3CA}",swimming_woman:"\u{1F3CA}‍\u2640\uFE0F",symbols:"\u{1F523}",synagogue:"\u{1F54D}",syringe:"\u{1F489}",taco:"\u{1F32E}",tada:"\u{1F389}",tanabata_tree:"\u{1F38B}",taurus:"\u2649\uFE0F",taxi:"\u{1F695}",tea:"\u{1F375}",telephone_receiver:"\u{1F4DE}",telescope:"\u{1F52D}",tennis:"\u{1F3BE}",tent:"\u26FA\uFE0F",thermometer:"\u{1F321}",thinking:"\u{1F914}",thought_balloon:"\u{1F4AD}",ticket:"\u{1F3AB}",tickets:"\u{1F39F}",tiger:"\u{1F42F}",tiger2:"\u{1F405}",timer_clock:"\u23F2",tipping_hand_man:"\u{1F481}‍\u2642\uFE0F",tired_face:"\u{1F62B}",tm:"\u2122\uFE0F",toilet:"\u{1F6BD}",tokyo_tower:"\u{1F5FC}",tomato:"\u{1F345}",tongue:"\u{1F445}",top:"\u{1F51D}",tophat:"\u{1F3A9}",tornado:"\u{1F32A}",trackball:"\u{1F5B2}",tractor:"\u{1F69C}",traffic_light:"\u{1F6A5}",train:"\u{1F68B}",train2:"\u{1F686}",tram:"\u{1F68A}",triangular_flag_on_post:"\u{1F6A9}",triangular_ruler:"\u{1F4D0}",trident:"\u{1F531}",triumph:"\u{1F624}",trolleybus:"\u{1F68E}",trophy:"\u{1F3C6}",tropical_drink:"\u{1F379}",tropical_fish:"\u{1F420}",truck:"\u{1F69A}",trumpet:"\u{1F3BA}",tulip:"\u{1F337}",tumbler_glass:"\u{1F943}",turkey:"\u{1F983}",turtle:"\u{1F422}",tv:"\u{1F4FA}",twisted_rightwards_arrows:"\u{1F500}",two_hearts:"\u{1F495}",two_men_holding_hands:"\u{1F46C}",two_women_holding_hands:"\u{1F46D}",u5272:"\u{1F239}",u5408:"\u{1F234}",u55b6:"\u{1F23A}",u6307:"\u{1F22F}\uFE0F",u6708:"\u{1F237}\uFE0F",u6709:"\u{1F236}",u6e80:"\u{1F235}",u7121:"\u{1F21A}\uFE0F",u7533:"\u{1F238}",u7981:"\u{1F232}",u7a7a:"\u{1F233}",umbrella:"\u2614\uFE0F",unamused:"\u{1F612}",underage:"\u{1F51E}",unicorn:"\u{1F984}",unlock:"\u{1F513}",up:"\u{1F199}",upside_down_face:"\u{1F643}",v:"\u270C\uFE0F",vertical_traffic_light:"\u{1F6A6}",vhs:"\u{1F4FC}",vibration_mode:"\u{1F4F3}",video_camera:"\u{1F4F9}",video_game:"\u{1F3AE}",violin:"\u{1F3BB}",virgo:"\u264D\uFE0F",volcano:"\u{1F30B}",volleyball:"\u{1F3D0}",vs:"\u{1F19A}",vulcan_salute:"\u{1F596}",walking_man:"\u{1F6B6}",walking_woman:"\u{1F6B6}‍\u2640\uFE0F",waning_crescent_moon:"\u{1F318}",waning_gibbous_moon:"\u{1F316}",warning:"\u26A0\uFE0F",wastebasket:"\u{1F5D1}",watch:"\u231A\uFE0F",water_buffalo:"\u{1F403}",watermelon:"\u{1F349}",wave:"\u{1F44B}",wavy_dash:"\u3030\uFE0F",waxing_crescent_moon:"\u{1F312}",wc:"\u{1F6BE}",weary:"\u{1F629}",wedding:"\u{1F492}",weight_lifting_man:"\u{1F3CB}\uFE0F",weight_lifting_woman:"\u{1F3CB}\uFE0F‍\u2640\uFE0F",whale:"\u{1F433}",whale2:"\u{1F40B}",wheel_of_dharma:"\u2638\uFE0F",wheelchair:"\u267F\uFE0F",white_check_mark:"\u2705",white_circle:"\u26AA\uFE0F",white_flag:"\u{1F3F3}\uFE0F",white_flower:"\u{1F4AE}",white_large_square:"\u2B1C\uFE0F",white_medium_small_square:"\u25FD\uFE0F",white_medium_square:"\u25FB\uFE0F",white_small_square:"\u25AB\uFE0F",white_square_button:"\u{1F533}",wilted_flower:"\u{1F940}",wind_chime:"\u{1F390}",wind_face:"\u{1F32C}",wine_glass:"\u{1F377}",wink:"\u{1F609}",wolf:"\u{1F43A}",woman:"\u{1F469}",woman_artist:"\u{1F469}‍\u{1F3A8}",woman_astronaut:"\u{1F469}‍\u{1F680}",woman_cartwheeling:"\u{1F938}‍\u2640\uFE0F",woman_cook:"\u{1F469}‍\u{1F373}",woman_facepalming:"\u{1F926}‍\u2640\uFE0F",woman_factory_worker:"\u{1F469}‍\u{1F3ED}",woman_farmer:"\u{1F469}‍\u{1F33E}",woman_firefighter:"\u{1F469}‍\u{1F692}",woman_health_worker:"\u{1F469}‍\u2695\uFE0F",woman_judge:"\u{1F469}‍\u2696\uFE0F",woman_juggling:"\u{1F939}‍\u2640\uFE0F",woman_mechanic:"\u{1F469}‍\u{1F527}",woman_office_worker:"\u{1F469}‍\u{1F4BC}",woman_pilot:"\u{1F469}‍\u2708\uFE0F",woman_playing_handball:"\u{1F93E}‍\u2640\uFE0F",woman_playing_water_polo:"\u{1F93D}‍\u2640\uFE0F",woman_scientist:"\u{1F469}‍\u{1F52C}",woman_shrugging:"\u{1F937}‍\u2640\uFE0F",woman_singer:"\u{1F469}‍\u{1F3A4}",woman_student:"\u{1F469}‍\u{1F393}",woman_teacher:"\u{1F469}‍\u{1F3EB}",woman_technologist:"\u{1F469}‍\u{1F4BB}",woman_with_turban:"\u{1F473}‍\u2640\uFE0F",womans_clothes:"\u{1F45A}",womans_hat:"\u{1F452}",women_wrestling:"\u{1F93C}‍\u2640\uFE0F",womens:"\u{1F6BA}",world_map:"\u{1F5FA}",worried:"\u{1F61F}",wrench:"\u{1F527}",writing_hand:"\u270D\uFE0F",x:"\u274C",yellow_heart:"\u{1F49B}",yen:"\u{1F4B4}",yin_yang:"\u262F\uFE0F",yum:"\u{1F60B}",zap:"\u26A1\uFE0F",zipper_mouth_face:"\u{1F910}",zzz:"\u{1F4A4}",octocat:'<img alt=":octocat:" height="20" width="20" align="absmiddle" src="https://assets-cdn.github.com/images/icons/emoji/octocat.png">',showdown:`<span style="font-family: 'Anonymous Pro', monospace; text-decoration: underline; text-decoration-style: dashed; text-decoration-color: #3e8b8a;text-underline-position: under;">S</span>`},r.Converter=function(n){"use strict";var i={},u=[],d=[],p={},m=c,f={parsed:{},raw:"",format:""};g();function g(){n=n||{};for(var l in s)s.hasOwnProperty(l)&&(i[l]=s[l]);if(typeof n=="object")for(var y in n)n.hasOwnProperty(y)&&(i[y]=n[y]);else throw Error("Converter expects the passed parameter to be an object, but "+typeof n+" was passed instead.");i.extensions&&r.helper.forEach(i.extensions,T)}function T(l,y){if(y=y||null,r.helper.isString(l))if(l=r.helper.stdExtName(l),y=l,r.extensions[l]){console.warn("DEPRECATION WARNING: "+l+" is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!"),k(r.extensions[l],l);return}else if(!r.helper.isUndefined(o[l]))l=o[l];else throw Error('Extension "'+l+'" could not be loaded. It was either not found or is not a valid extension.');typeof l=="function"&&(l=l()),r.helper.isArray(l)||(l=[l]);var C=_(l,y);if(!C.valid)throw Error(C.error);for(var A=0;A<l.length;++A){switch(l[A].type){case"lang":u.push(l[A]);break;case"output":d.push(l[A]);break}if(l[A].hasOwnProperty("listeners"))for(var O in l[A].listeners)l[A].listeners.hasOwnProperty(O)&&w(O,l[A].listeners[O])}}function k(l,y){typeof l=="function"&&(l=l(new r.Converter)),r.helper.isArray(l)||(l=[l]);var C=_(l,y);if(!C.valid)throw Error(C.error);for(var A=0;A<l.length;++A)switch(l[A].type){case"lang":u.push(l[A]);break;case"output":d.push(l[A]);break;default:throw Error("Extension loader error: Type unrecognized!!!")}}function w(l,y){if(!r.helper.isString(l))throw Error("Invalid argument in converter.listen() method: name must be a string, but "+typeof l+" given");if(typeof y!="function")throw Error("Invalid argument in converter.listen() method: callback must be a function, but "+typeof y+" given");p.hasOwnProperty(l)||(p[l]=[]),p[l].push(y)}function v(l){var y=l.match(/^\s*/)[0].length,C=new RegExp("^\\s{0,"+y+"}","gm");return l.replace(C,"")}this._dispatch=function(y,C,A,O){if(p.hasOwnProperty(y))for(var S=0;S<p[y].length;++S){var F=p[y][S](y,C,this,A,O);F&&typeof F<"u"&&(C=F)}return C},this.listen=function(l,y){return w(l,y),this},this.makeHtml=function(l){if(!l)return l;var y={gHtmlBlocks:[],gHtmlMdBlocks:[],gHtmlSpans:[],gUrls:{},gTitles:{},gDimensions:{},gListLevel:0,hashLinkCounts:{},langExtensions:u,outputModifiers:d,converter:this,ghCodeBlocks:[],metadata:{parsed:{},raw:"",format:""}};return l=l.replace(/¨/g,"\xA8T"),l=l.replace(/\$/g,"\xA8D"),l=l.replace(/\r\n/g,` `),l=l.replace(/\r/g,` `),l=l.replace(/\u00A0/g," "),i.smartIndentationFix&&(l=v(l)),l=` `+l+` `,l=r.subParser("detab")(l,i,y),l=l.replace(/^[ \t]+$/mg,""),r.helper.forEach(u,function(C){l=r.subParser("runExtension")(C,l,i,y)}),l=r.subParser("metadata")(l,i,y),l=r.subParser("hashPreCodeTags")(l,i,y),l=r.subParser("githubCodeBlocks")(l,i,y),l=r.subParser("hashHTMLBlocks")(l,i,y),l=r.subParser("hashCodeTags")(l,i,y),l=r.subParser("stripLinkDefinitions")(l,i,y),l=r.subParser("blockGamut")(l,i,y),l=r.subParser("unhashHTMLSpans")(l,i,y),l=r.subParser("unescapeSpecialChars")(l,i,y),l=l.replace(/¨D/g,"$$"),l=l.replace(/¨T/g,"\xA8"),l=r.subParser("completeHTMLDocument")(l,i,y),r.helper.forEach(d,function(C){l=r.subParser("runExtension")(C,l,i,y)}),f=y.metadata,l},this.makeMarkdown=this.makeMd=function(l,y){if(l=l.replace(/\r\n/g,` `),l=l.replace(/\r/g,` `),l=l.replace(/>[ \t]+</,">\xA8NBSP;<"),!y)if(window&&window.document)y=window.document;else throw new Error("HTMLParser is undefined. If in a webworker or nodejs environment, you need to provide a WHATWG DOM and HTML such as JSDOM");var C=y.createElement("div");C.innerHTML=l;var A={preList:ne(C)};K(C);for(var O=C.childNodes,S="",F=0;F<O.length;F++)S+=r.subParser("makeMarkdown.node")(O[F],A);function K(x){for(var $=0;$<x.childNodes.length;++$){var Y=x.childNodes[$];Y.nodeType===3?/\S/.test(Y.nodeValue)?(Y.nodeValue=Y.nodeValue.split(` `).join(" "),Y.nodeValue=Y.nodeValue.replace(/(\s)+/g,"$1")):(x.removeChild(Y),--$):Y.nodeType===1&&K(Y)}}function ne(x){for(var $=x.querySelectorAll("pre"),Y=[],X=0;X<$.length;++X)if($[X].childElementCount===1&&$[X].firstChild.tagName.toLowerCase()==="code"){var tt=$[X].firstChild.innerHTML.trim(),nt=$[X].firstChild.getAttribute("data-language")||"";if(nt==="")for(var pn=$[X].firstChild.className.split(" "),at=0;at<pn.length;++at){var mn=pn[at].match(/^language-(.+)$/);if(mn!==null){nt=mn[1];break}}tt=r.helper.unescapeHTMLEntities(tt),Y.push(tt),$[X].outerHTML='<precode language="'+nt+'" precodenum="'+X.toString()+'"></precode>'}else Y.push($[X].innerHTML),$[X].innerHTML="",$[X].setAttribute("prenum",X.toString());return Y}return S},this.setOption=function(l,y){i[l]=y},this.getOption=function(l){return i[l]},this.getOptions=function(){return i},this.addExtension=function(l,y){y=y||null,T(l,y)},this.useExtension=function(l){T(l)},this.setFlavor=function(l){if(!h.hasOwnProperty(l))throw Error(l+" flavor was not found");var y=h[l];m=l;for(var C in y)y.hasOwnProperty(C)&&(i[C]=y[C])},this.getFlavor=function(){return m},this.removeExtension=function(l){r.helper.isArray(l)||(l=[l]);for(var y=0;y<l.length;++y){for(var C=l[y],A=0;A<u.length;++A)u[A]===C&&u[A].splice(A,1);for(var O=0;O<d.length;++A)d[O]===C&&d[O].splice(A,1)}},this.getAllExtensions=function(){return{language:u,output:d}},this.getMetadata=function(l){return l?f.raw:f.parsed},this.getMetadataFormat=function(){return f.format},this._setMetadataPair=function(l,y){f.parsed[l]=y},this._setMetadataFormat=function(l){f.format=l},this._setMetadataRaw=function(l){f.raw=l}},r.subParser("anchors",function(n,i,u){"use strict";n=u.converter._dispatch("anchors.before",n,i,u);var d=function(p,m,f,g,T,k,w){if(r.helper.isUndefined(w)&&(w=""),f=f.toLowerCase(),p.search(/\(<?\s*>? ?(['"].*['"])?\)$/m)>-1)g="";else if(!g)if(f||(f=m.toLowerCase().replace(/ ?\n/g," ")),g="#"+f,!r.helper.isUndefined(u.gUrls[f]))g=u.gUrls[f],r.helper.isUndefined(u.gTitles[f])||(w=u.gTitles[f]);else return p;g=g.replace(r.helper.regexes.asteriskDashAndColon,r.helper.escapeCharactersCallback);var v='<a href="'+g+'"';return w!==""&&w!==null&&(w=w.replace(/"/g,"""),w=w.replace(r.helper.regexes.asteriskDashAndColon,r.helper.escapeCharactersCallback),v+=' title="'+w+'"'),i.openLinksInNewWindow&&!/^#/.test(g)&&(v+=' rel="noopener noreferrer" target="\xA8E95Eblank"'),v+=">"+m+"</a>",v};return n=n.replace(/\[((?:\[[^\]]*]|[^\[\]])*)] ?(?:\n *)?\[(.*?)]()()()()/g,d),n=n.replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<([^>]*)>(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,d),n=n.replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,d),n=n.replace(/\[([^\[\]]+)]()()()()()/g,d),i.ghMentions&&(n=n.replace(/(^|\s)(\\)?(@([a-z\d]+(?:[a-z\d.-]+?[a-z\d]+)*))/gmi,function(p,m,f,g,T){if(f==="\\")return m+g;if(!r.helper.isString(i.ghMentionsLink))throw new Error("ghMentionsLink option must be a string");var k=i.ghMentionsLink.replace(/\{u}/g,T),w="";return i.openLinksInNewWindow&&(w=' rel="noopener noreferrer" target="\xA8E95Eblank"'),m+'<a href="'+k+'"'+w+">"+g+"</a>"})),n=u.converter._dispatch("anchors.after",n,i,u),n});var L=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+?\.[^'">\s]+?)()(\1)?(?=\s|$)(?!["<>])/gi,N=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+?)([.!?,()\[\]])?(\1)?(?=\s|$)(?!["<>])/gi,j=/()<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)()>()/gi,I=/(^|\s)(?:mailto:)?([A-Za-z0-9!#$%&'*+-/=?^_`{|}~.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?=$|\s)/gmi,G=/<()(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,Ce=function(n){"use strict";return function(i,u,d,p,m,f,g){d=d.replace(r.helper.regexes.asteriskDashAndColon,r.helper.escapeCharactersCallback);var T=d,k="",w="",v=u||"",l=g||"";return/^www\./i.test(d)&&(d=d.replace(/^www\./i,"http://www.")),n.excludeTrailingPunctuationFromURLs&&f&&(k=f),n.openLinksInNewWindow&&(w=' rel="noopener noreferrer" target="\xA8E95Eblank"'),v+'<a href="'+d+'"'+w+">"+T+"</a>"+k+l}},ur=function(n,i){"use strict";return function(u,d,p){var m="mailto:";return d=d||"",p=r.subParser("unescapeSpecialChars")(p,n,i),n.encodeEmails?(m=r.helper.encodeEmailAddress(m+p),p=r.helper.encodeEmailAddress(p)):m=m+p,d+'<a href="'+m+'">'+p+"</a>"}};r.subParser("autoLinks",function(n,i,u){"use strict";return n=u.converter._dispatch("autoLinks.before",n,i,u),n=n.replace(j,Ce(i)),n=n.replace(G,ur(i,u)),n=u.converter._dispatch("autoLinks.after",n,i,u),n}),r.subParser("simplifiedAutoLinks",function(n,i,u){"use strict";return i.simplifiedAutoLink&&(n=u.converter._dispatch("simplifiedAutoLinks.before",n,i,u),i.excludeTrailingPunctuationFromURLs?n=n.replace(N,Ce(i)):n=n.replace(L,Ce(i)),n=n.replace(I,ur(i,u)),n=u.converter._dispatch("simplifiedAutoLinks.after",n,i,u)),n}),r.subParser("blockGamut",function(n,i,u){"use strict";return n=u.converter._dispatch("blockGamut.before",n,i,u),n=r.subParser("blockQuotes")(n,i,u),n=r.subParser("headers")(n,i,u),n=r.subParser("horizontalRule")(n,i,u),n=r.subParser("lists")(n,i,u),n=r.subParser("codeBlocks")(n,i,u),n=r.subParser("tables")(n,i,u),n=r.subParser("hashHTMLBlocks")(n,i,u),n=r.subParser("paragraphs")(n,i,u),n=u.converter._dispatch("blockGamut.after",n,i,u),n}),r.subParser("blockQuotes",function(n,i,u){"use strict";n=u.converter._dispatch("blockQuotes.before",n,i,u),n=n+` `;var d=/(^ {0,3}>[ \t]?.+\n(.+\n)*\n*)+/gm;return i.splitAdjacentBlockquotes&&(d=/^ {0,3}>[\s\S]*?(?:\n\n)/gm),n=n.replace(d,function(p){return p=p.replace(/^[ \t]*>[ \t]?/gm,""),p=p.replace(/¨0/g,""),p=p.replace(/^[ \t]+$/gm,""),p=r.subParser("githubCodeBlocks")(p,i,u),p=r.subParser("blockGamut")(p,i,u),p=p.replace(/(^|\n)/g,"$1 "),p=p.replace(/(\s*<pre>[^\r]+?<\/pre>)/gm,function(m,f){var g=f;return g=g.replace(/^ /mg,"\xA80"),g=g.replace(/¨0/g,""),g}),r.subParser("hashBlock")(`<blockquote> `+p+` </blockquote>`,i,u)}),n=u.converter._dispatch("blockQuotes.after",n,i,u),n}),r.subParser("codeBlocks",function(n,i,u){"use strict";n=u.converter._dispatch("codeBlocks.before",n,i,u),n+="\xA80";var d=/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=¨0))/g;return n=n.replace(d,function(p,m,f){var g=m,T=f,k=` `;return g=r.subParser("outdent")(g,i,u),g=r.subParser("encodeCode")(g,i,u),g=r.subParser("detab")(g,i,u),g=g.replace(/^\n+/g,""),g=g.replace(/\n+$/g,""),i.omitExtraWLInCodeBlocks&&(k=""),g="<pre><code>"+g+k+"</code></pre>",r.subParser("hashBlock")(g,i,u)+T}),n=n.replace(/¨0/,""),n=u.converter._dispatch("codeBlocks.after",n,i,u),n}),r.subParser("codeSpans",function(n,i,u){"use strict";return n=u.converter._dispatch("codeSpans.before",n,i,u),typeof n>"u"&&(n=""),n=n.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,function(d,p,m,f){var g=f;return g=g.replace(/^([ \t]*)/g,""),g=g.replace(/[ \t]*$/g,""),g=r.subParser("encodeCode")(g,i,u),g=p+"<code>"+g+"</code>",g=r.subParser("hashHTMLSpans")(g,i,u),g}),n=u.converter._dispatch("codeSpans.after",n,i,u),n}),r.subParser("completeHTMLDocument",function(n,i,u){"use strict";if(!i.completeHTMLDocument)return n;n=u.converter._dispatch("completeHTMLDocument.before",n,i,u);var d="html",p=`<!DOCTYPE HTML> `,m="",f=`<meta charset="utf-8"> `,g="",T="";typeof u.metadata.parsed.doctype<"u"&&(p="<!DOCTYPE "+u.metadata.parsed.doctype+`> `,d=u.metadata.parsed.doctype.toString().toLowerCase(),(d==="html"||d==="html5")&&(f='<meta charset="utf-8">'));for(var k in u.metadata.parsed)if(u.metadata.parsed.hasOwnProperty(k))switch(k.toLowerCase()){case"doctype":break;case"title":m="<title>"+u.metadata.parsed.title+`</title> `;break;case"charset":d==="html"||d==="html5"?f='<meta charset="'+u.metadata.parsed.charset+`"> `:f='<meta name="charset" content="'+u.metadata.parsed.charset+`"> `;break;case"language":case"lang":g=' lang="'+u.metadata.parsed[k]+'"',T+='<meta name="'+k+'" content="'+u.metadata.parsed[k]+`"> `;break;default:T+='<meta name="'+k+'" content="'+u.metadata.parsed[k]+`"> `}return n=p+"<html"+g+`> <head> `+m+f+T+`</head> <body> `+n.trim()+` </body> </html>`,n=u.converter._dispatch("completeHTMLDocument.after",n,i,u),n}),r.subParser("detab",function(n,i,u){"use strict";return n=u.converter._dispatch("detab.before",n,i,u),n=n.replace(/\t(?=\t)/g," "),n=n.replace(/\t/g,"\xA8A\xA8B"),n=n.replace(/¨B(.+?)¨A/g,function(d,p){for(var m=p,f=4-m.length%4,g=0;g<f;g++)m+=" ";return m}),n=n.replace(/¨A/g," "),n=n.replace(/¨B/g,""),n=u.converter._dispatch("detab.after",n,i,u),n}),r.subParser("ellipsis",function(n,i,u){"use strict";return n=u.converter._dispatch("ellipsis.before",n,i,u),n=n.replace(/\.\.\./g,"\u2026"),n=u.converter._dispatch("ellipsis.after",n,i,u),n}),r.subParser("emoji",function(n,i,u){"use strict";if(!i.emoji)return n;n=u.converter._dispatch("emoji.before",n,i,u);var d=/:([\S]+?):/g;return n=n.replace(d,function(p,m){return r.helper.emojis.hasOwnProperty(m)?r.helper.emojis[m]:p}),n=u.converter._dispatch("emoji.after",n,i,u),n}),r.subParser("encodeAmpsAndAngles",function(n,i,u){"use strict";return n=u.converter._dispatch("encodeAmpsAndAngles.before",n,i,u),n=n.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g,"&"),n=n.replace(/<(?![a-z\/?$!])/gi,"<"),n=n.replace(/</g,"<"),n=n.replace(/>/g,">"),n=u.converter._dispatch("encodeAmpsAndAngles.after",n,i,u),n}),r.subParser("encodeBackslashEscapes",function(n,i,u){"use strict";return n=u.converter._dispatch("encodeBackslashEscapes.before",n,i,u),n=n.replace(/\\(\\)/g,r.helper.escapeCharactersCallback),n=n.replace(/\\([`*_{}\[\]()>#+.!~=|-])/g,r.helper.escapeCharactersCallback),n=u.converter._dispatch("encodeBackslashEscapes.after",n,i,u),n}),r.subParser("encodeCode",function(n,i,u){"use strict";return n=u.converter._dispatch("encodeCode.before",n,i,u),n=n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/([*_{}\[\]\\=~-])/g,r.helper.escapeCharactersCallback),n=u.converter._dispatch("encodeCode.after",n,i,u),n}),r.subParser("escapeSpecialCharsWithinTagAttributes",function(n,i,u){"use strict";n=u.converter._dispatch("escapeSpecialCharsWithinTagAttributes.before",n,i,u);var d=/<\/?[a-z\d_:-]+(?:[\s]+[\s\S]+?)?>/gi,p=/<!(--(?:(?:[^>-]|-[^>])(?:[^-]|-[^-])*)--)>/gi;return n=n.replace(d,function(m){return m.replace(/(.)<\/?code>(?=.)/g,"$1`").replace(/([\\`*_~=|])/g,r.helper.escapeCharactersCallback)}),n=n.replace(p,function(m){return m.replace(/([\\`*_~=|])/g,r.helper.escapeCharactersCallback)}),n=u.converter._dispatch("escapeSpecialCharsWithinTagAttributes.after",n,i,u),n}),r.subParser("githubCodeBlocks",function(n,i,u){"use strict";return i.ghCodeBlocks?(n=u.converter._dispatch("githubCodeBlocks.before",n,i,u),n+="\xA80",n=n.replace(/(?:^|\n)(?: {0,3})(```+|~~~+)(?: *)([^\s`~]*)\n([\s\S]*?)\n(?: {0,3})\1/g,function(d,p,m,f){var g=i.omitExtraWLInCodeBlocks?"":` `;return f=r.subParser("encodeCode")(f,i,u),f=r.subParser("detab")(f,i,u),f=f.replace(/^\n+/g,""),f=f.replace(/\n+$/g,""),f="<pre><code"+(m?' class="'+m+" language-"+m+'"':"")+">"+f+g+"</code></pre>",f=r.subParser("hashBlock")(f,i,u),` \xA8G`+(u.ghCodeBlocks.push({text:d,codeblock:f})-1)+`G `}),n=n.replace(/¨0/,""),u.converter._dispatch("githubCodeBlocks.after",n,i,u)):n}),r.subParser("hashBlock",function(n,i,u){"use strict";return n=u.converter._dispatch("hashBlock.before",n,i,u),n=n.replace(/(^\n+|\n+$)/g,""),n=` \xA8K`+(u.gHtmlBlocks.push(n)-1)+`K `,n=u.converter._dispatch("hashBlock.after",n,i,u),n}),r.subParser("hashCodeTags",function(n,i,u){"use strict";n=u.converter._dispatch("hashCodeTags.before",n,i,u);var d=function(p,m,f,g){var T=f+r.subParser("encodeCode")(m,i,u)+g;return"\xA8C"+(u.gHtmlSpans.push(T)-1)+"C"};return n=r.helper.replaceRecursiveRegExp(n,d,"<code\\b[^>]*>","</code>","gim"),n=u.converter._dispatch("hashCodeTags.after",n,i,u),n}),r.subParser("hashElement",function(n,i,u){"use strict";return function(d,p){var m=p;return m=m.replace(/\n\n/g,` `),m=m.replace(/^\n/,""),m=m.replace(/\n+$/g,""),m=` \xA8K`+(u.gHtmlBlocks.push(m)-1)+`K `,m}}),r.subParser("hashHTMLBlocks",function(n,i,u){"use strict";n=u.converter._dispatch("hashHTMLBlocks.before",n,i,u);var d=["pre","div","h1","h2","h3","h4","h5","h6","blockquote","table","dl","ol","ul","script","noscript","form","fieldset","iframe","math","style","section","header","footer","nav","article","aside","address","audio","canvas","figure","hgroup","output","video","p"],p=function(l,y,C,A){var O=l;return C.search(/\bmarkdown\b/)!==-1&&(O=C+u.converter.makeHtml(y)+A),` \xA8K`+(u.gHtmlBlocks.push(O)-1)+`K `};i.backslashEscapesHTMLTags&&(n=n.replace(/\\<(\/?[^>]+?)>/g,function(l,y){return"<"+y+">"}));for(var m=0;m<d.length;++m)for(var f,g=new RegExp("^ {0,3}(<"+d[m]+"\\b[^>]*>)","im"),T="<"+d[m]+"\\b[^>]*>",k="</"+d[m]+">";(f=r.helper.regexIndexOf(n,g))!==-1;){var w=r.helper.splitAtIndex(n,f),v=r.helper.replaceRecursiveRegExp(w[1],p,T,k,"im");if(v===w[1])break;n=w[0].concat(v)}return n=n.replace(/(\n {0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,r.subParser("hashElement")(n,i,u)),n=r.helper.replaceRecursiveRegExp(n,function(l){return` \xA8K`+(u.gHtmlBlocks.push(l)-1)+`K `},"^ {0,3}<!--","-->","gm"),n=n.replace(/(?:\n\n)( {0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,r.subParser("hashElement")(n,i,u)),n=u.converter._dispatch("hashHTMLBlocks.after",n,i,u),n}),r.subParser("hashHTMLSpans",function(n,i,u){"use strict";n=u.converter._dispatch("hashHTMLSpans.before",n,i,u);function d(p){return"\xA8C"+(u.gHtmlSpans.push(p)-1)+"C"}return n=n.replace(/<[^>]+?\/>/gi,function(p){return d(p)}),n=n.replace(/<([^>]+?)>[\s\S]*?<\/\1>/g,function(p){return d(p)}),n=n.replace(/<([^>]+?)\s[^>]+?>[\s\S]*?<\/\1>/g,function(p){return d(p)}),n=n.replace(/<[^>]+?>/gi,function(p){return d(p)}),n=u.converter._dispatch("hashHTMLSpans.after",n,i,u),n}),r.subParser("unhashHTMLSpans",function(n,i,u){"use strict";n=u.converter._dispatch("unhashHTMLSpans.before",n,i,u);for(var d=0;d<u.gHtmlSpans.length;++d){for(var p=u.gHtmlSpans[d],m=0;/¨C(\d+)C/.test(p);){var f=RegExp.$1;if(p=p.replace("\xA8C"+f+"C",u.gHtmlSpans[f]),m===10){console.error("maximum nesting of 10 spans reached!!!");break}++m}n=n.replace("\xA8C"+d+"C",p)}return n=u.converter._dispatch("unhashHTMLSpans.after",n,i,u),n}),r.subParser("hashPreCodeTags",function(n,i,u){"use strict";n=u.converter._dispatch("hashPreCodeTags.before",n,i,u);var d=function(p,m,f,g){var T=f+r.subParser("encodeCode")(m,i,u)+g;return` \xA8G`+(u.ghCodeBlocks.push({text:p,codeblock:T})-1)+`G `};return n=r.helper.replaceRecursiveRegExp(n,d,"^ {0,3}<pre\\b[^>]*>\\s*<code\\b[^>]*>","^ {0,3}</code>\\s*</pre>","gim"),n=u.converter._dispatch("hashPreCodeTags.after",n,i,u),n}),r.subParser("headers",function(n,i,u){"use strict";n=u.converter._dispatch("headers.before",n,i,u);var d=isNaN(parseInt(i.headerLevelStart))?1:parseInt(i.headerLevelStart),p=i.smoothLivePreview?/^(.+)[ \t]*\n={2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n=+[ \t]*\n+/gm,m=i.smoothLivePreview?/^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n-+[ \t]*\n+/gm;n=n.replace(p,function(T,k){var w=r.subParser("spanGamut")(k,i,u),v=i.noHeaderId?"":' id="'+g(k)+'"',l=d,y="<h"+l+v+">"+w+"</h"+l+">";return r.subParser("hashBlock")(y,i,u)}),n=n.replace(m,function(T,k){var w=r.subParser("spanGamut")(k,i,u),v=i.noHeaderId?"":' id="'+g(k)+'"',l=d+1,y="<h"+l+v+">"+w+"</h"+l+">";return r.subParser("hashBlock")(y,i,u)});var f=i.requireSpaceBeforeHeadingText?/^(#{1,6})[ \t]+(.+?)[ \t]*#*\n+/gm:/^(#{1,6})[ \t]*(.+?)[ \t]*#*\n+/gm;n=n.replace(f,function(T,k,w){var v=w;i.customizedHeaderId&&(v=w.replace(/\s?\{([^{]+?)}\s*$/,""));var l=r.subParser("spanGamut")(v,i,u),y=i.noHeaderId?"":' id="'+g(w)+'"',C=d-1+k.length,A="<h"+C+y+">"+l+"</h"+C+">";return r.subParser("hashBlock")(A,i,u)});function g(T){var k,w;if(i.customizedHeaderId){var v=T.match(/\{([^{]+?)}\s*$/);v&&v[1]&&(T=v[1])}return k=T,r.helper.isString(i.prefixHeaderId)?w=i.prefixHeaderId:i.prefixHeaderId===!0?w="section-":w="",i.rawPrefixHeaderId||(k=w+k),i.ghCompatibleHeaderId?k=k.replace(/ /g,"-").replace(/&/g,"").replace(/¨T/g,"").replace(/¨D/g,"").replace(/[&+$,\/:;=?@"#{}|^¨~\[\]`\\*)(%.!'<>]/g,"").toLowerCase():i.rawHeaderId?k=k.replace(/ /g,"-").replace(/&/g,"&").replace(/¨T/g,"\xA8").replace(/¨D/g,"$").replace(/["']/g,"-").toLowerCase():k=k.replace(/[^\w]/g,"").toLowerCase(),i.rawPrefixHeaderId&&(k=w+k),u.hashLinkCounts[k]?k=k+"-"+u.hashLinkCounts[k]++:u.hashLinkCounts[k]=1,k}return n=u.converter._dispatch("headers.after",n,i,u),n}),r.subParser("horizontalRule",function(n,i,u){"use strict";n=u.converter._dispatch("horizontalRule.before",n,i,u);var d=r.subParser("hashBlock")("<hr />",i,u);return n=n.replace(/^ {0,2}( ?-){3,}[ \t]*$/gm,d),n=n.replace(/^ {0,2}( ?\*){3,}[ \t]*$/gm,d),n=n.replace(/^ {0,2}( ?_){3,}[ \t]*$/gm,d),n=u.converter._dispatch("horizontalRule.after",n,i,u),n}),r.subParser("images",function(n,i,u){"use strict";n=u.converter._dispatch("images.before",n,i,u);var d=/!\[([^\]]*?)][ \t]*()\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,p=/!\[([^\]]*?)][ \t]*()\([ \t]?<([^>]*)>(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(?:(["'])([^"]*?)\6))?[ \t]?\)/g,m=/!\[([^\]]*?)][ \t]*()\([ \t]?<?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,f=/!\[([^\]]*?)] ?(?:\n *)?\[([\s\S]*?)]()()()()()/g,g=/!\[([^\[\]]+)]()()()()()/g;function T(w,v,l,y,C,A,O,S){return y=y.replace(/\s/g,""),k(w,v,l,y,C,A,O,S)}function k(w,v,l,y,C,A,O,S){var F=u.gUrls,K=u.gTitles,ne=u.gDimensions;if(l=l.toLowerCase(),S||(S=""),w.search(/\(<?\s*>? ?(['"].*['"])?\)$/m)>-1)y="";else if(y===""||y===null)if((l===""||l===null)&&(l=v.toLowerCase().replace(/ ?\n/g," ")),y="#"+l,!r.helper.isUndefined(F[l]))y=F[l],r.helper.isUndefined(K[l])||(S=K[l]),r.helper.isUndefined(ne[l])||(C=ne[l].width,A=ne[l].height);else return w;v=v.replace(/"/g,""").replace(r.helper.regexes.asteriskDashAndColon,r.helper.escapeCharactersCallback),y=y.replace(r.helper.regexes.asteriskDashAndColon,r.helper.escapeCharactersCallback);var x='<img src="'+y+'" alt="'+v+'"';return S&&r.helper.isString(S)&&(S=S.replace(/"/g,""").replace(r.helper.regexes.asteriskDashAndColon,r.helper.escapeCharactersCallback),x+=' title="'+S+'"'),C&&A&&(C=C==="*"?"auto":C,A=A==="*"?"auto":A,x+=' width="'+C+'"',x+=' height="'+A+'"'),x+=" />",x}return n=n.replace(f,k),n=n.replace(m,T),n=n.replace(p,k),n=n.replace(d,k),n=n.replace(g,k),n=u.converter._dispatch("images.after",n,i,u),n}),r.subParser("italicsAndBold",function(n,i,u){"use strict";n=u.converter._dispatch("italicsAndBold.before",n,i,u);function d(p,m,f){return m+p+f}return i.literalMidWordUnderscores?(n=n.replace(/\b___(\S[\s\S]*?)___\b/g,function(p,m){return d(m,"<strong><em>","</em></strong>")}),n=n.replace(/\b__(\S[\s\S]*?)__\b/g,function(p,m){return d(m,"<strong>","</strong>")}),n=n.replace(/\b_(\S[\s\S]*?)_\b/g,function(p,m){return d(m,"<em>","</em>")})):(n=n.replace(/___(\S[\s\S]*?)___/g,function(p,m){return/\S$/.test(m)?d(m,"<strong><em>","</em></strong>"):p}),n=n.replace(/__(\S[\s\S]*?)__/g,function(p,m){return/\S$/.test(m)?d(m,"<strong>","</strong>"):p}),n=n.replace(/_([^\s_][\s\S]*?)_/g,function(p,m){return/\S$/.test(m)?d(m,"<em>","</em>"):p})),i.literalMidWordAsterisks?(n=n.replace(/([^*]|^)\B\*\*\*(\S[\s\S]*?)\*\*\*\B(?!\*)/g,function(p,m,f){return d(f,m+"<strong><em>","</em></strong>")}),n=n.replace(/([^*]|^)\B\*\*(\S[\s\S]*?)\*\*\B(?!\*)/g,function(p,m,f){return d(f,m+"<strong>","</strong>")}),n=n.replace(/([^*]|^)\B\*(\S[\s\S]*?)\*\B(?!\*)/g,function(p,m,f){return d(f,m+"<em>","</em>")})):(n=n.replace(/\*\*\*(\S[\s\S]*?)\*\*\*/g,function(p,m){return/\S$/.test(m)?d(m,"<strong><em>","</em></strong>"):p}),n=n.replace(/\*\*(\S[\s\S]*?)\*\*/g,function(p,m){return/\S$/.test(m)?d(m,"<strong>","</strong>"):p}),n=n.replace(/\*([^\s*][\s\S]*?)\*/g,function(p,m){return/\S$/.test(m)?d(m,"<em>","</em>"):p})),n=u.converter._dispatch("italicsAndBold.after",n,i,u),n}),r.subParser("lists",function(n,i,u){"use strict";function d(f,g){u.gListLevel++,f=f.replace(/\n{2,}$/,` `),f+="\xA80";var T=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0| {0,3}([*+-]|\d+[.])[ \t]+))/gm,k=/\n[ \t]*\n(?!¨0)/.test(f);return i.disableForced4SpacesIndentedSublists&&(T=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0|\2([*+-]|\d+[.])[ \t]+))/gm),f=f.replace(T,function(w,v,l,y,C,A,O){O=O&&O.trim()!=="";var S=r.subParser("outdent")(C,i,u),F="";return A&&i.tasklists&&(F=' class="task-list-item" style="list-style-type: none;"',S=S.replace(/^[ \t]*\[(x|X| )?]/m,function(){var K='<input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;"';return O&&(K+=" checked"),K+=">",K})),S=S.replace(/^([-*+]|\d\.)[ \t]+[\S\n ]*/g,function(K){return"\xA8A"+K}),v||S.search(/\n{2,}/)>-1?(S=r.subParser("githubCodeBlocks")(S,i,u),S=r.subParser("blockGamut")(S,i,u)):(S=r.subParser("lists")(S,i,u),S=S.replace(/\n$/,""),S=r.subParser("hashHTMLBlocks")(S,i,u),S=S.replace(/\n\n+/g,` `),k?S=r.subParser("paragraphs")(S,i,u):S=r.subParser("spanGamut")(S,i,u)),S=S.replace("\xA8A",""),S="<li"+F+">"+S+`</li> `,S}),f=f.replace(/¨0/g,""),u.gListLevel--,g&&(f=f.replace(/\s+$/,"")),f}function p(f,g){if(g==="ol"){var T=f.match(/^ *(\d+)\./);if(T&&T[1]!=="1")return' start="'+T[1]+'"'}return""}function m(f,g,T){var k=i.disableForced4SpacesIndentedSublists?/^ ?\d+\.[ \t]/gm:/^ {0,3}\d+\.[ \t]/gm,w=i.disableForced4SpacesIndentedSublists?/^ ?[*+-][ \t]/gm:/^ {0,3}[*+-][ \t]/gm,v=g==="ul"?k:w,l="";if(f.search(v)!==-1)(function C(A){var O=A.search(v),S=p(f,g);O!==-1?(l+=` <`+g+S+`> `+d(A.slice(0,O),!!T)+"</"+g+`> `,g=g==="ul"?"ol":"ul",v=g==="ul"?k:w,C(A.slice(O))):l+=` <`+g+S+`> `+d(A,!!T)+"</"+g+`> `})(f);else{var y=p(f,g);l=` <`+g+y+`> `+d(f,!!T)+"</"+g+`> `}return l}return n=u.converter._dispatch("lists.before",n,i,u),n+="\xA80",u.gListLevel?n=n.replace(/^(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,function(f,g,T){var k=T.search(/[*+-]/g)>-1?"ul":"ol";return m(g,k,!0)}):n=n.replace(/(\n\n|^\n?)(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,function(f,g,T,k){var w=k.search(/[*+-]/g)>-1?"ul":"ol";return m(T,w,!1)}),n=n.replace(/¨0/,""),n=u.converter._dispatch("lists.after",n,i,u),n}),r.subParser("metadata",function(n,i,u){"use strict";if(!i.metadata)return n;n=u.converter._dispatch("metadata.before",n,i,u);function d(p){u.metadata.raw=p,p=p.replace(/&/g,"&").replace(/"/g,"""),p=p.replace(/\n {4}/g," "),p.replace(/^([\S ]+): +([\s\S]+?)$/gm,function(m,f,g){return u.metadata.parsed[f]=g,""})}return n=n.replace(/^\s*«««+(\S*?)\n([\s\S]+?)\n»»»+\n/,function(p,m,f){return d(f),"\xA8M"}),n=n.replace(/^\s*---+(\S*?)\n([\s\S]+?)\n---+\n/,function(p,m,f){return m&&(u.metadata.format=m),d(f),"\xA8M"}),n=n.replace(/¨M/g,""),n=u.converter._dispatch("metadata.after",n,i,u),n}),r.subParser("outdent",function(n,i,u){"use strict";return n=u.converter._dispatch("outdent.before",n,i,u),n=n.replace(/^(\t|[ ]{1,4})/gm,"\xA80"),n=n.replace(/¨0/g,""),n=u.converter._dispatch("outdent.after",n,i,u),n}),r.subParser("paragraphs",function(n,i,u){"use strict";n=u.converter._dispatch("paragraphs.before",n,i,u),n=n.replace(/^\n+/g,""),n=n.replace(/\n+$/g,"");for(var d=n.split(/\n{2,}/g),p=[],m=d.length,f=0;f<m;f++){var g=d[f];g.search(/¨(K|G)(\d+)\1/g)>=0?p.push(g):g.search(/\S/)>=0&&(g=r.subParser("spanGamut")(g,i,u),g=g.replace(/^([ \t]*)/g,"<p>"),g+="</p>",p.push(g))}for(m=p.length,f=0;f<m;f++){for(var T="",k=p[f],w=!1;/¨(K|G)(\d+)\1/.test(k);){var v=RegExp.$1,l=RegExp.$2;v==="K"?T=u.gHtmlBlocks[l]:w?T=r.subParser("encodeCode")(u.ghCodeBlocks[l].text,i,u):T=u.ghCodeBlocks[l].codeblock,T=T.replace(/\$/g,"$$$$"),k=k.replace(/(\n\n)?¨(K|G)\d+\2(\n\n)?/,T),/^<pre\b[^>]*>\s*<code\b[^>]*>/.test(k)&&(w=!0)}p[f]=k}return n=p.join(` `),n=n.replace(/^\n+/g,""),n=n.replace(/\n+$/g,""),u.converter._dispatch("paragraphs.after",n,i,u)}),r.subParser("runExtension",function(n,i,u,d){"use strict";if(n.filter)i=n.filter(i,d.converter,u);else if(n.regex){var p=n.regex;p instanceof RegExp||(p=new RegExp(p,"g")),i=i.replace(p,n.replace)}return i}),r.subParser("spanGamut",function(n,i,u){"use strict";return n=u.converter._dispatch("spanGamut.before",n,i,u),n=r.subParser("codeSpans")(n,i,u),n=r.subParser("escapeSpecialCharsWithinTagAttributes")(n,i,u),n=r.subParser("encodeBackslashEscapes")(n,i,u),n=r.subParser("images")(n,i,u),n=r.subParser("anchors")(n,i,u),n=r.subParser("autoLinks")(n,i,u),n=r.subParser("simplifiedAutoLinks")(n,i,u),n=r.subParser("emoji")(n,i,u),n=r.subParser("underline")(n,i,u),n=r.subParser("italicsAndBold")(n,i,u),n=r.subParser("strikethrough")(n,i,u),n=r.subParser("ellipsis")(n,i,u),n=r.subParser("hashHTMLSpans")(n,i,u),n=r.subParser("encodeAmpsAndAngles")(n,i,u),i.simpleLineBreaks?/\n\n¨K/.test(n)||(n=n.replace(/\n+/g,`<br /> `)):n=n.replace(/ +\n/g,`<br /> `),n=u.converter._dispatch("spanGamut.after",n,i,u),n}),r.subParser("strikethrough",function(n,i,u){"use strict";function d(p){return i.simplifiedAutoLink&&(p=r.subParser("simplifiedAutoLinks")(p,i,u)),"<del>"+p+"</del>"}return i.strikethrough&&(n=u.converter._dispatch("strikethrough.before",n,i,u),n=n.replace(/(?:~){2}([\s\S]+?)(?:~){2}/g,function(p,m){return d(m)}),n=u.converter._dispatch("strikethrough.after",n,i,u)),n}),r.subParser("stripLinkDefinitions",function(n,i,u){"use strict";var d=/^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*<?([^>\s]+)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=¨0))/gm,p=/^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*<?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n\n|(?=¨0)|(?=\n\[))/gm;n+="\xA80";var m=function(f,g,T,k,w,v,l){return g=g.toLowerCase(),T.match(/^data:.+?\/.+?;base64,/)?u.gUrls[g]=T.replace(/\s/g,""):u.gUrls[g]=r.subParser("encodeAmpsAndAngles")(T,i,u),v?v+l:(l&&(u.gTitles[g]=l.replace(/"|'/g,""")),i.parseImgDimensions&&k&&w&&(u.gDimensions[g]={width:k,height:w}),"")};return n=n.replace(p,m),n=n.replace(d,m),n=n.replace(/¨0/,""),n}),r.subParser("tables",function(n,i,u){"use strict";if(!i.tables)return n;var d=/^ {0,3}\|?.+\|.+\n {0,3}\|?[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:[-=]){2,}[\s\S]+?(?:\n\n|¨0)/gm,p=/^ {0,3}\|.+\|[ \t]*\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n( {0,3}\|.+\|[ \t]*\n)*(?:\n|¨0)/gm;function m(w){return/^:[ \t]*--*$/.test(w)?' style="text-align:left;"':/^--*[ \t]*:[ \t]*$/.test(w)?' style="text-align:right;"':/^:[ \t]*--*[ \t]*:$/.test(w)?' style="text-align:center;"':""}function f(w,v){var l="";return w=w.trim(),(i.tablesHeaderId||i.tableHeaderId)&&(l=' id="'+w.replace(/ /g,"_").toLowerCase()+'"'),w=r.subParser("spanGamut")(w,i,u),"<th"+l+v+">"+w+`</th> `}function g(w,v){var l=r.subParser("spanGamut")(w,i,u);return"<td"+v+">"+l+`</td> `}function T(w,v){for(var l=`<table> <thead> <tr> `,y=w.length,C=0;C<y;++C)l+=w[C];for(l+=`</tr> </thead> <tbody> `,C=0;C<v.length;++C){l+=`<tr> `;for(var A=0;A<y;++A)l+=v[C][A];l+=`</tr> `}return l+=`</tbody> </table> `,l}function k(w){var v,l=w.split(` `);for(v=0;v<l.length;++v)/^ {0,3}\|/.test(l[v])&&(l[v]=l[v].replace(/^ {0,3}\|/,"")),/\|[ \t]*$/.test(l[v])&&(l[v]=l[v].replace(/\|[ \t]*$/,"")),l[v]=r.subParser("codeSpans")(l[v],i,u);var y=l[0].split("|").map(function(x){return x.trim()}),C=l[1].split("|").map(function(x){return x.trim()}),A=[],O=[],S=[],F=[];for(l.shift(),l.shift(),v=0;v<l.length;++v)l[v].trim()!==""&&A.push(l[v].split("|").map(function(x){return x.trim()}));if(y.length<C.length)return w;for(v=0;v<C.length;++v)S.push(m(C[v]));for(v=0;v<y.length;++v)r.helper.isUndefined(S[v])&&(S[v]=""),O.push(f(y[v],S[v]));for(v=0;v<A.length;++v){for(var K=[],ne=0;ne<O.length;++ne)r.helper.isUndefined(A[v][ne]),K.push(g(A[v][ne],S[ne]));F.push(K)}return T(O,F)}return n=u.converter._dispatch("tables.before",n,i,u),n=n.replace(/\\(\|)/g,r.helper.escapeCharactersCallback),n=n.replace(d,k),n=n.replace(p,k),n=u.converter._dispatch("tables.after",n,i,u),n}),r.subParser("underline",function(n,i,u){"use strict";return i.underline&&(n=u.converter._dispatch("underline.before",n,i,u),i.literalMidWordUnderscores?(n=n.replace(/\b___(\S[\s\S]*?)___\b/g,function(d,p){return"<u>"+p+"</u>"}),n=n.replace(/\b__(\S[\s\S]*?)__\b/g,function(d,p){return"<u>"+p+"</u>"})):(n=n.replace(/___(\S[\s\S]*?)___/g,function(d,p){return/\S$/.test(p)?"<u>"+p+"</u>":d}),n=n.replace(/__(\S[\s\S]*?)__/g,function(d,p){return/\S$/.test(p)?"<u>"+p+"</u>":d})),n=n.replace(/(_)/g,r.helper.escapeCharactersCallback),n=u.converter._dispatch("underline.after",n,i,u)),n}),r.subParser("unescapeSpecialChars",function(n,i,u){"use strict";return n=u.converter._dispatch("unescapeSpecialChars.before",n,i,u),n=n.replace(/¨E(\d+)E/g,function(d,p){var m=parseInt(p);return String.fromCharCode(m)}),n=u.converter._dispatch("unescapeSpecialChars.after",n,i,u),n}),r.subParser("makeMarkdown.blockquote",function(n,i){"use strict";var u="";if(n.hasChildNodes())for(var d=n.childNodes,p=d.length,m=0;m<p;++m){var f=r.subParser("makeMarkdown.node")(d[m],i);f!==""&&(u+=f)}return u=u.trim(),u="> "+u.split(` `).join(` > `),u}),r.subParser("makeMarkdown.codeBlock",function(n,i){"use strict";var u=n.getAttribute("language"),d=n.getAttribute("precodenum");return"```"+u+` `+i.preList[d]+"\n```"}),r.subParser("makeMarkdown.codeSpan",function(n){"use strict";return"`"+n.innerHTML+"`"}),r.subParser("makeMarkdown.emphasis",function(n,i){"use strict";var u="";if(n.hasChildNodes()){u+="*";for(var d=n.childNodes,p=d.length,m=0;m<p;++m)u+=r.subParser("makeMarkdown.node")(d[m],i);u+="*"}return u}),r.subParser("makeMarkdown.header",function(n,i,u){"use strict";var d=new Array(u+1).join("#"),p="";if(n.hasChildNodes()){p=d+" ";for(var m=n.childNodes,f=m.length,g=0;g<f;++g)p+=r.subParser("makeMarkdown.node")(m[g],i)}return p}),r.subParser("makeMarkdown.hr",function(){"use strict";return"---"}),r.subParser("makeMarkdown.image",function(n){"use strict";var i="";return n.hasAttribute("src")&&(i+="+">",n.hasAttribute("width")&&n.hasAttribute("height")&&(i+=" ="+n.getAttribute("width")+"x"+n.getAttribute("height")),n.hasAttribute("title")&&(i+=' "'+n.getAttribute("title")+'"'),i+=")"),i}),r.subParser("makeMarkdown.links",function(n,i){"use strict";var u="";if(n.hasChildNodes()&&n.hasAttribute("href")){var d=n.childNodes,p=d.length;u="[";for(var m=0;m<p;++m)u+=r.subParser("makeMarkdown.node")(d[m],i);u+="](",u+="<"+n.getAttribute("href")+">",n.hasAttribute("title")&&(u+=' "'+n.getAttribute("title")+'"'),u+=")"}return u}),r.subParser("makeMarkdown.list",function(n,i,u){"use strict";var d="";if(!n.hasChildNodes())return"";for(var p=n.childNodes,m=p.length,f=n.getAttribute("start")||1,g=0;g<m;++g)if(!(typeof p[g].tagName>"u"||p[g].tagName.toLowerCase()!=="li")){var T="";u==="ol"?T=f.toString()+". ":T="- ",d+=T+r.subParser("makeMarkdown.listItem")(p[g],i),++f}return d+=` <!-- --> `,d.trim()}),r.subParser("makeMarkdown.listItem",function(n,i){"use strict";for(var u="",d=n.childNodes,p=d.length,m=0;m<p;++m)u+=r.subParser("makeMarkdown.node")(d[m],i);return/\n$/.test(u)?u=u.split(` `).join(` `).replace(/^ {4}$/gm,"").replace(/\n\n+/g,` `):u+=` `,u}),r.subParser("makeMarkdown.node",function(n,i,u){"use strict";u=u||!1;var d="";if(n.nodeType===3)return r.subParser("makeMarkdown.txt")(n,i);if(n.nodeType===8)return"<!--"+n.data+`--> `;if(n.nodeType!==1)return"";var p=n.tagName.toLowerCase();switch(p){case"h1":u||(d=r.subParser("makeMarkdown.header")(n,i,1)+` `);break;case"h2":u||(d=r.subParser("makeMarkdown.header")(n,i,2)+` `);break;case"h3":u||(d=r.subParser("makeMarkdown.header")(n,i,3)+` `);break;case"h4":u||(d=r.subParser("makeMarkdown.header")(n,i,4)+` `);break;case"h5":u||(d=r.subParser("makeMarkdown.header")(n,i,5)+` `);break;case"h6":u||(d=r.subParser("makeMarkdown.header")(n,i,6)+` `);break;case"p":u||(d=r.subParser("makeMarkdown.paragraph")(n,i)+` `);break;case"blockquote":u||(d=r.subParser("makeMarkdown.blockquote")(n,i)+` `);break;case"hr":u||(d=r.subParser("makeMarkdown.hr")(n,i)+` `);break;case"ol":u||(d=r.subParser("makeMarkdown.list")(n,i,"ol")+` `);break;case"ul":u||(d=r.subParser("makeMarkdown.list")(n,i,"ul")+` `);break;case"precode":u||(d=r.subParser("makeMarkdown.codeBlock")(n,i)+` `);break;case"pre":u||(d=r.subParser("makeMarkdown.pre")(n,i)+` `);break;case"table":u||(d=r.subParser("makeMarkdown.table")(n,i)+` `);break;case"code":d=r.subParser("makeMarkdown.codeSpan")(n,i);break;case"em":case"i":d=r.subParser("makeMarkdown.emphasis")(n,i);break;case"strong":case"b":d=r.subParser("makeMarkdown.strong")(n,i);break;case"del":d=r.subParser("makeMarkdown.strikethrough")(n,i);break;case"a":d=r.subParser("makeMarkdown.links")(n,i);break;case"img":d=r.subParser("makeMarkdown.image")(n,i);break;default:d=n.outerHTML+` `}return d}),r.subParser("makeMarkdown.paragraph",function(n,i){"use strict";var u="";if(n.hasChildNodes())for(var d=n.childNodes,p=d.length,m=0;m<p;++m)u+=r.subParser("makeMarkdown.node")(d[m],i);return u=u.trim(),u}),r.subParser("makeMarkdown.pre",function(n,i){"use strict";var u=n.getAttribute("prenum");return"<pre>"+i.preList[u]+"</pre>"}),r.subParser("makeMarkdown.strikethrough",function(n,i){"use strict";var u="";if(n.hasChildNodes()){u+="~~";for(var d=n.childNodes,p=d.length,m=0;m<p;++m)u+=r.subParser("makeMarkdown.node")(d[m],i);u+="~~"}return u}),r.subParser("makeMarkdown.strong",function(n,i){"use strict";var u="";if(n.hasChildNodes()){u+="**";for(var d=n.childNodes,p=d.length,m=0;m<p;++m)u+=r.subParser("makeMarkdown.node")(d[m],i);u+="**"}return u}),r.subParser("makeMarkdown.table",function(n,i){"use strict";var u="",d=[[],[]],p=n.querySelectorAll("thead>tr>th"),m=n.querySelectorAll("tbody>tr"),f,g;for(f=0;f<p.length;++f){var T=r.subParser("makeMarkdown.tableCell")(p[f],i),k="---";if(p[f].hasAttribute("style")){var w=p[f].getAttribute("style").toLowerCase().replace(/\s/g,"");switch(w){case"text-align:left;":k=":---";break;case"text-align:right;":k="---:";break;case"text-align:center;":k=":---:";break}}d[0][f]=T.trim(),d[1][f]=k}for(f=0;f<m.length;++f){var v=d.push([])-1,l=m[f].getElementsByTagName("td");for(g=0;g<p.length;++g){var y=" ";typeof l[g]<"u"&&(y=r.subParser("makeMarkdown.tableCell")(l[g],i)),d[v].push(y)}}var C=3;for(f=0;f<d.length;++f)for(g=0;g<d[f].length;++g){var A=d[f][g].length;A>C&&(C=A)}for(f=0;f<d.length;++f){for(g=0;g<d[f].length;++g)f===1?d[f][g].slice(-1)===":"?d[f][g]=r.helper.padEnd(d[f][g].slice(-1),C-1,"-")+":":d[f][g]=r.helper.padEnd(d[f][g],C,"-"):d[f][g]=r.helper.padEnd(d[f][g],C);u+="| "+d[f].join(" | ")+` | `}return u.trim()}),r.subParser("makeMarkdown.tableCell",function(n,i){"use strict";var u="";if(!n.hasChildNodes())return"";for(var d=n.childNodes,p=d.length,m=0;m<p;++m)u+=r.subParser("makeMarkdown.node")(d[m],i,!0);return u.trim()}),r.subParser("makeMarkdown.txt",function(n){"use strict";var i=n.nodeValue;return i=i.replace(/ +/g," "),i=i.replace(/¨NBSP;/g," "),i=r.helper.unescapeHTMLEntities(i),i=i.replace(/([*_~|`])/g,"\\$1"),i=i.replace(/^(\s*)>/g,"\\$1>"),i=i.replace(/^#/gm,"\\#"),i=i.replace(/^(\s*)([-=]{3,})(\s*)$/,"$1\\$2$3"),i=i.replace(/^( {0,3}\d+)\./gm,"$1\\."),i=i.replace(/^( {0,3})([+-])/gm,"$1\\$2"),i=i.replace(/]([\s]*)\(/g,"\\]$1\\("),i=i.replace(/^ {0,3}\[([\S \t]*?)]:/gm,"\\[$1]:"),i});var ju=this;typeof define=="function"&&define.amd?define(function(){"use strict";return r}):typeof Qr<"u"&&Qr.exports?Qr.exports=r:ju.showdown=r}).call(hu)});var Rd={};Ie(Rd,{__EXPERIMENTAL_ELEMENTS:()=>Vn,__EXPERIMENTAL_PATHS_WITH_OVERRIDE:()=>xn,__EXPERIMENTAL_STYLE_PROPERTY:()=>pe,__experimentalCloneSanitizedBlock:()=>Vt,__experimentalGetAccessibleBlockLabel:()=>_a,__experimentalGetBlockAttributesNamesByRole:()=>ya,__experimentalGetBlockLabel:()=>yt,__experimentalSanitizeBlockAttributes:()=>Ge,__unstableGetBlockProps:()=>Gt,__unstableGetInnerBlocksProps:()=>go,__unstableSerializeAndClean:()=>bo,children:()=>Mo,cloneBlock:()=>xt,createBlock:()=>U,createBlocksFromInnerBlocksTemplate:()=>It,doBlocksMatchTemplate:()=>fn,findTransform:()=>he,getBlockAttributes:()=>ie,getBlockAttributesNamesByRole:()=>vt,getBlockBindingsSource:()=>gt,getBlockBindingsSources:()=>ha,getBlockContent:()=>Xe,getBlockDefaultClassName:()=>po,getBlockFromExample:()=>Ht,getBlockMenuDefaultClassName:()=>mo,getBlockSupport:()=>ta,getBlockTransforms:()=>ue,getBlockType:()=>M,getBlockTypes:()=>Ue,getBlockVariations:()=>ca,getCategories:()=>Nu,getChildBlockNames:()=>oa,getDefaultBlockName:()=>pr,getFreeformContentHandlerName:()=>ee,getGroupingBlockName:()=>fr,getPhrasingContentSchema:()=>Su,getPossibleBlockTransformations:()=>Ja,getSaveContent:()=>ge,getSaveElement:()=>Kt,getUnregisteredTypeHandlerName:()=>me,hasBlockSupport:()=>se,hasChildBlocks:()=>ua,hasChildBlocksWithInserterSupport:()=>ia,isReusableBlock:()=>na,isTemplatePart:()=>aa,isUnmodifiedBlock:()=>_t,isUnmodifiedDefaultBlock:()=>hr,isValidBlockContent:()=>Ro,isValidIcon:()=>$e,node:()=>jo,normalizeIconObject:()=>gr,parse:()=>Ee,parseWithAttributeSchema:()=>Le,pasteHandler:()=>et,privateApis:()=>Du,rawHandler:()=>ln,registerBlockBindingsSource:()=>pa,registerBlockCollection:()=>Xn,registerBlockStyle:()=>sa,registerBlockType:()=>Yn,registerBlockVariation:()=>la,serialize:()=>Mr,serializeRawBlock:()=>we,setCategories:()=>Lu,setDefaultBlockName:()=>ea,setFreeformContentHandlerName:()=>Qn,setGroupingBlockName:()=>ra,setUnregisteredTypeHandlerName:()=>Jn,store:()=>P,switchToBlockType:()=>eo,synchronizeBlocksWithTemplate:()=>rt,unregisterBlockBindingsSource:()=>ma,unregisterBlockStyle:()=>da,unregisterBlockType:()=>Zn,unregisterBlockVariation:()=>fa,unstable__bootstrapServerSideBlockDefinitions:()=>Wn,updateCategory:()=>Pu,validateBlock:()=>be,withBlockContentContext:()=>Pd});var Rr=B(Be(),1);var Oe=function(){return Oe=Object.assign||function(t){for(var r,a=1,o=arguments.length;a<o;a++){r=arguments[a];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},Oe.apply(this,arguments)};function bn(e){return e.toLowerCase()}var Uu=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],Fu=/[^A-Z0-9]+/gi;function yn(e,t){t===void 0&&(t={});for(var r=t.splitRegexp,a=r===void 0?Uu:r,o=t.stripRegexp,s=o===void 0?Fu:o,c=t.transform,h=c===void 0?bn:c,_=t.delimiter,b=_===void 0?" ":_,E=_n(_n(e,a,"$1\0$2"),s,"\0"),L=0,N=E.length;E.charAt(L)==="\0";)L++;for(;E.charAt(N-1)==="\0";)N--;return E.slice(L,N).split("\0").map(h).join(b)}function _n(e,t,r){return t instanceof RegExp?e.replace(t,r):t.reduce(function(a,o){return a.replace(o,r)},e)}function ot(e,t){var r=e.charAt(0),a=e.substr(1).toLowerCase();return t>0&&r>="0"&&r<="9"?"_"+r+a:""+r.toUpperCase()+a}function wn(e,t){return t===void 0&&(t={}),yn(e,Oe({delimiter:"",transform:ot},t))}function $u(e,t){return t===0?e.toLowerCase():ot(e,t)}function kn(e,t){return t===void 0&&(t={}),wn(e,Oe({transform:$u},t))}var ka=B(Be(),1),ye=B(sr(),1);var Gu={grad:.9,turn:360,rad:360/(2*Math.PI)},fe=function(e){return typeof e=="string"?e.length>0:typeof e=="number"},V=function(e,t,r){return t===void 0&&(t=0),r===void 0&&(r=Math.pow(10,t)),Math.round(r*e)/r+0},Q=function(e,t,r){return t===void 0&&(t=0),r===void 0&&(r=1),e>r?r:e>t?e:t},Ln=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},En=function(e){return{r:Q(e.r,0,255),g:Q(e.g,0,255),b:Q(e.b,0,255),a:Q(e.a)}},ut=function(e){return{r:V(e.r),g:V(e.g),b:V(e.b),a:V(e.a,3)}},Ku=/^#([0-9a-f]{3,8})$/i,dr=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Pn=function(e){var t=e.r,r=e.g,a=e.b,o=e.a,s=Math.max(t,r,a),c=s-Math.min(t,r,a),h=c?s===t?(r-a)/c:s===r?2+(a-t)/c:4+(t-r)/c:0;return{h:60*(h<0?h+6:h),s:s?c/s*100:0,v:s/255*100,a:o}},Rn=function(e){var t=e.h,r=e.s,a=e.v,o=e.a;t=t/360*6,r/=100,a/=100;var s=Math.floor(t),c=a*(1-r),h=a*(1-(t-s)*r),_=a*(1-(1-t+s)*r),b=s%6;return{r:255*[a,h,c,c,_,a][b],g:255*[_,a,a,h,c,c][b],b:255*[c,c,_,a,a,h][b],a:o}},Tn=function(e){return{h:Ln(e.h),s:Q(e.s,0,100),l:Q(e.l,0,100),a:Q(e.a)}},Cn=function(e){return{h:V(e.h),s:V(e.s),l:V(e.l),a:V(e.a,3)}},Bn=function(e){return Rn((r=(t=e).s,{h:t.h,s:(r*=((a=t.l)<50?a:100-a)/100)>0?2*r/(a+r)*100:0,v:a+r,a:t.a}));var t,r,a},Ve=function(e){return{h:(t=Pn(e)).h,s:(o=(200-(r=t.s))*(a=t.v)/100)>0&&o<200?r*a/100/(o<=100?o:200-o)*100:0,l:o/2,a:t.a};var t,r,a,o},Wu=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Yu=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Xu=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Zu=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,dt={string:[[function(e){var t=Ku.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?V(parseInt(e[3]+e[3],16)/255,2):1}:e.length===6||e.length===8?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:e.length===8?V(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=Xu.exec(e)||Zu.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:En({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=Wu.exec(e)||Yu.exec(e);if(!t)return null;var r,a,o=Tn({h:(r=t[1],a=t[2],a===void 0&&(a="deg"),Number(r)*(Gu[a]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return Bn(o)},"hsl"]],object:[[function(e){var t=e.r,r=e.g,a=e.b,o=e.a,s=o===void 0?1:o;return fe(t)&&fe(r)&&fe(a)?En({r:Number(t),g:Number(r),b:Number(a),a:Number(s)}):null},"rgb"],[function(e){var t=e.h,r=e.s,a=e.l,o=e.a,s=o===void 0?1:o;if(!fe(t)||!fe(r)||!fe(a))return null;var c=Tn({h:Number(t),s:Number(r),l:Number(a),a:Number(s)});return Bn(c)},"hsl"],[function(e){var t=e.h,r=e.s,a=e.v,o=e.a,s=o===void 0?1:o;if(!fe(t)||!fe(r)||!fe(a))return null;var c=(function(h){return{h:Ln(h.h),s:Q(h.s,0,100),v:Q(h.v,0,100),a:Q(h.a)}})({h:Number(t),s:Number(r),v:Number(a),a:Number(s)});return Rn(c)},"hsv"]]},An=function(e,t){for(var r=0;r<t.length;r++){var a=t[r][0](e);if(a)return[a,t[r][1]]}return[null,void 0]},Qu=function(e){return typeof e=="string"?An(e.trim(),dt.string):typeof e=="object"&&e!==null?An(e,dt.object):[null,void 0]};var it=function(e,t){var r=Ve(e);return{h:r.h,s:Q(r.s+100*t,0,100),l:r.l,a:r.a}},st=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},Sn=function(e,t){var r=Ve(e);return{h:r.h,s:r.s,l:Q(r.l+100*t,0,100),a:r.a}},ct=(function(){function e(t){this.parsed=Qu(t)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return this.parsed!==null},e.prototype.brightness=function(){return V(st(this.rgba),2)},e.prototype.isDark=function(){return st(this.rgba)<.5},e.prototype.isLight=function(){return st(this.rgba)>=.5},e.prototype.toHex=function(){return t=ut(this.rgba),r=t.r,a=t.g,o=t.b,c=(s=t.a)<1?dr(V(255*s)):"","#"+dr(r)+dr(a)+dr(o)+c;var t,r,a,o,s,c},e.prototype.toRgb=function(){return ut(this.rgba)},e.prototype.toRgbString=function(){return t=ut(this.rgba),r=t.r,a=t.g,o=t.b,(s=t.a)<1?"rgba("+r+", "+a+", "+o+", "+s+")":"rgb("+r+", "+a+", "+o+")";var t,r,a,o,s},e.prototype.toHsl=function(){return Cn(Ve(this.rgba))},e.prototype.toHslString=function(){return t=Cn(Ve(this.rgba)),r=t.h,a=t.s,o=t.l,(s=t.a)<1?"hsla("+r+", "+a+"%, "+o+"%, "+s+")":"hsl("+r+", "+a+"%, "+o+"%)";var t,r,a,o,s},e.prototype.toHsv=function(){return t=Pn(this.rgba),{h:V(t.h),s:V(t.s),v:V(t.v),a:V(t.a,3)};var t},e.prototype.invert=function(){return ae({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},e.prototype.saturate=function(t){return t===void 0&&(t=.1),ae(it(this.rgba,t))},e.prototype.desaturate=function(t){return t===void 0&&(t=.1),ae(it(this.rgba,-t))},e.prototype.grayscale=function(){return ae(it(this.rgba,-1))},e.prototype.lighten=function(t){return t===void 0&&(t=.1),ae(Sn(this.rgba,t))},e.prototype.darken=function(t){return t===void 0&&(t=.1),ae(Sn(this.rgba,-t))},e.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},e.prototype.alpha=function(t){return typeof t=="number"?ae({r:(r=this.rgba).r,g:r.g,b:r.b,a:t}):V(this.rgba.a,3);var r},e.prototype.hue=function(t){var r=Ve(this.rgba);return typeof t=="number"?ae({h:t,s:r.s,l:r.l,a:r.a}):V(r.h)},e.prototype.isEqual=function(t){return this.toHex()===ae(t).toHex()},e})(),ae=function(e){return e instanceof ct?e:new ct(e)},Nn=[],On=function(e){e.forEach(function(t){Nn.indexOf(t)<0&&(t(ct,dt),Nn.push(t))})};function Dn(e,t){var r={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},a={};for(var o in r)a[r[o]]=o;var s={};e.prototype.toName=function(c){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var h,_,b=a[this.toHex()];if(b)return b;if(c?.closest){var E=this.toRgb(),L=1/0,N="black";if(!s.length)for(var j in r)s[j]=new e(r[j]).toRgb();for(var I in r){var G=(h=E,_=s[I],Math.pow(h.r-_.r,2)+Math.pow(h.g-_.g,2)+Math.pow(h.b-_.b,2));G<L&&(L=G,N=I)}return N}},t.string.push([function(c){var h=c.toLowerCase(),_=h==="transparent"?"#0000":r[h];return _?new e(_).toRgb():null},"name"])}var lt=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},ft=function(e){return .2126*lt(e.r)+.7152*lt(e.g)+.0722*lt(e.b)};function Mn(e){e.prototype.luminance=function(){return t=ft(this.rgba),(r=2)===void 0&&(r=0),a===void 0&&(a=Math.pow(10,r)),Math.round(a*t)/a+0;var t,r,a},e.prototype.contrast=function(t){t===void 0&&(t="#FFF");var r,a,o,s,c,h,_,b=t instanceof e?t:new e(t);return s=this.rgba,c=b.toRgb(),h=ft(s),_=ft(c),r=h>_?(h+.05)/(_+.05):(_+.05)/(h+.05),(a=2)===void 0&&(a=0),o===void 0&&(o=Math.pow(10,a)),Math.floor(o*r)/o+0},e.prototype.isReadable=function(t,r){return t===void 0&&(t="#FFF"),r===void 0&&(r={}),this.contrast(t)>=(h=(c=(a=r).size)===void 0?"normal":c,(s=(o=a.level)===void 0?"AA":o)==="AAA"&&h==="normal"?7:s==="AA"&&h==="large"?3:4.5);var a,o,s,c,h}}var mr=B(De(),1),W=B(sr(),1),ba=B(Z(),1),Fe=B(xe(),1),bt=B(J(),1);var cr="block-default",He=["attributes","supports","save","migrate","isEligible","apiVersion"],pe={"--wp--style--color--link":{value:["color","link"],support:["color","link"]},aspectRatio:{value:["dimensions","aspectRatio"],support:["dimensions","aspectRatio"],useEngine:!0},background:{value:["color","gradient"],support:["color","gradients"],useEngine:!0},backgroundColor:{value:["color","background"],support:["color","background"],requiresOptOut:!0,useEngine:!0},backgroundImage:{value:["background","backgroundImage"],support:["background","backgroundImage"],useEngine:!0},backgroundRepeat:{value:["background","backgroundRepeat"],support:["background","backgroundRepeat"],useEngine:!0},backgroundSize:{value:["background","backgroundSize"],support:["background","backgroundSize"],useEngine:!0},backgroundPosition:{value:["background","backgroundPosition"],support:["background","backgroundPosition"],useEngine:!0},borderColor:{value:["border","color"],support:["__experimentalBorder","color"],useEngine:!0},borderRadius:{value:["border","radius"],support:["__experimentalBorder","radius"],properties:{borderTopLeftRadius:"topLeft",borderTopRightRadius:"topRight",borderBottomLeftRadius:"bottomLeft",borderBottomRightRadius:"bottomRight"},useEngine:!0},borderStyle:{value:["border","style"],support:["__experimentalBorder","style"],useEngine:!0},borderWidth:{value:["border","width"],support:["__experimentalBorder","width"],useEngine:!0},borderTopColor:{value:["border","top","color"],support:["__experimentalBorder","color"],useEngine:!0},borderTopStyle:{value:["border","top","style"],support:["__experimentalBorder","style"],useEngine:!0},borderTopWidth:{value:["border","top","width"],support:["__experimentalBorder","width"],useEngine:!0},borderRightColor:{value:["border","right","color"],support:["__experimentalBorder","color"],useEngine:!0},borderRightStyle:{value:["border","right","style"],support:["__experimentalBorder","style"],useEngine:!0},borderRightWidth:{value:["border","right","width"],support:["__experimentalBorder","width"],useEngine:!0},borderBottomColor:{value:["border","bottom","color"],support:["__experimentalBorder","color"],useEngine:!0},borderBottomStyle:{value:["border","bottom","style"],support:["__experimentalBorder","style"],useEngine:!0},borderBottomWidth:{value:["border","bottom","width"],support:["__experimentalBorder","width"],useEngine:!0},borderLeftColor:{value:["border","left","color"],support:["__experimentalBorder","color"],useEngine:!0},borderLeftStyle:{value:["border","left","style"],support:["__experimentalBorder","style"],useEngine:!0},borderLeftWidth:{value:["border","left","width"],support:["__experimentalBorder","width"],useEngine:!0},color:{value:["color","text"],support:["color","text"],requiresOptOut:!0,useEngine:!0},columnCount:{value:["typography","textColumns"],support:["typography","textColumns"],useEngine:!0},filter:{value:["filter","duotone"],support:["filter","duotone"]},linkColor:{value:["elements","link","color","text"],support:["color","link"]},captionColor:{value:["elements","caption","color","text"],support:["color","caption"]},buttonColor:{value:["elements","button","color","text"],support:["color","button"]},buttonBackgroundColor:{value:["elements","button","color","background"],support:["color","button"]},headingColor:{value:["elements","heading","color","text"],support:["color","heading"]},headingBackgroundColor:{value:["elements","heading","color","background"],support:["color","heading"]},fontFamily:{value:["typography","fontFamily"],support:["typography","__experimentalFontFamily"],useEngine:!0},fontSize:{value:["typography","fontSize"],support:["typography","fontSize"],useEngine:!0},fontStyle:{value:["typography","fontStyle"],support:["typography","__experimentalFontStyle"],useEngine:!0},fontWeight:{value:["typography","fontWeight"],support:["typography","__experimentalFontWeight"],useEngine:!0},lineHeight:{value:["typography","lineHeight"],support:["typography","lineHeight"],useEngine:!0},margin:{value:["spacing","margin"],support:["spacing","margin"],properties:{marginTop:"top",marginRight:"right",marginBottom:"bottom",marginLeft:"left"},useEngine:!0},minHeight:{value:["dimensions","minHeight"],support:["dimensions","minHeight"],useEngine:!0},height:{value:["dimensions","height"],support:["dimensions","height"],useEngine:!0},width:{value:["dimensions","width"],support:["dimensions","width"],useEngine:!0},padding:{value:["spacing","padding"],support:["spacing","padding"],properties:{paddingTop:"top",paddingRight:"right",paddingBottom:"bottom",paddingLeft:"left"},useEngine:!0},textAlign:{value:["typography","textAlign"],support:["typography","textAlign"],useEngine:!1},textDecoration:{value:["typography","textDecoration"],support:["typography","__experimentalTextDecoration"],useEngine:!0},textTransform:{value:["typography","textTransform"],support:["typography","__experimentalTextTransform"],useEngine:!0},letterSpacing:{value:["typography","letterSpacing"],support:["typography","__experimentalLetterSpacing"],useEngine:!0},textIndent:{value:["typography","textIndent"],support:["typography","textIndent"],useEngine:!0},writingMode:{value:["typography","writingMode"],support:["typography","__experimentalWritingMode"],useEngine:!0},"--wp--style--root--padding":{value:["spacing","padding"],support:["spacing","padding"],properties:{"--wp--style--root--padding-top":"top","--wp--style--root--padding-right":"right","--wp--style--root--padding-bottom":"bottom","--wp--style--root--padding-left":"left"},rootOnly:!0}},Vn={link:"a:where(:not(.wp-element-button))",heading:"h1, h2, h3, h4, h5, h6",h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",button:".wp-element-button, .wp-block-button__link",caption:".wp-element-caption, .wp-block-audio figcaption, .wp-block-embed figcaption, .wp-block-gallery figcaption, .wp-block-image figcaption, .wp-block-table figcaption, .wp-block-video figcaption",cite:"cite",select:"select",textInput:"textarea, input:where([type=email],[type=number],[type=password],[type=search],[type=tel],[type=text],[type=url])"},xn={"color.duotone":!0,"color.gradients":!0,"color.palette":!0,"dimensions.aspectRatios":!0,"typography.fontSizes":!0,"spacing.spacingSizes":!0};var R=B(Be(),1),Kn=B(sr(),1),q=B(pt(),1);var mt={title:"block title",description:"block description",keywords:["block keyword"],styles:[{label:"block style label"}],variations:[{title:"block variation title",description:"block variation description",keywords:["block variation keyword"]}]};var $n=B(Fn(),1),{lock:Gn,unlock:oe}=(0,$n.__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/blocks");function lr(e){return e!==null&&typeof e=="object"}function Wn(e){let{addBootstrappedBlockType:t}=oe((0,R.dispatch)(P));for(let[r,a]of Object.entries(e))t(r,a)}function ei({textdomain:e,...t}){let r=["apiVersion","title","category","parent","ancestor","icon","description","keywords","attributes","providesContext","usesContext","selectors","supports","styles","example","variations","blockHooks","allowedBlocks"],a=Object.fromEntries(Object.entries(t).filter(([o])=>r.includes(o)));return e&&Object.keys(mt).forEach(o=>{a[o]&&(a[o]=ht(mt[o],a[o],e))}),a}function Yn(e,t){let r=lr(e)?e.name:e;if(typeof r!="string"){(0,q.default)("Block names must be strings.");return}if(!/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(r)){(0,q.default)("Block names must contain a namespace prefix, include only lowercase alphanumeric characters or dashes, and start with a letter. Example: my-plugin/my-custom-block");return}if((0,R.select)(P).getBlockType(r)){(0,q.default)('Block "'+r+'" is already registered.');return}let{addBootstrappedBlockType:a,addUnprocessedBlockType:o}=oe((0,R.dispatch)(P));if(lr(e)){let s=ei(e);a(r,s)}return o(r,t),(0,R.select)(P).getBlockType(r)}function ht(e,t,r){return typeof e=="string"&&typeof t=="string"?(0,Kn._x)(t,e,r):Array.isArray(e)&&e.length&&Array.isArray(t)?t.map(a=>ht(e[0],a,r)):lr(e)&&Object.entries(e).length&&lr(t)?Object.keys(t).reduce((a,o)=>e[o]?(a[o]=ht(e[o],t[o],r),a):(a[o]=t[o],a),{}):t}function Xn(e,{title:t,icon:r}){(0,R.dispatch)(P).addBlockCollection(e,t,r)}function Zn(e){let t=(0,R.select)(P).getBlockType(e);if(!t){(0,q.default)('Block "'+e+'" is not registered.');return}return(0,R.dispatch)(P).removeBlockTypes(e),t}function Qn(e){(0,R.dispatch)(P).setFreeformFallbackBlockName(e)}function ee(){return(0,R.select)(P).getFreeformFallbackBlockName()}function fr(){return(0,R.select)(P).getGroupingBlockName()}function Jn(e){(0,R.dispatch)(P).setUnregisteredFallbackBlockName(e)}function me(){return(0,R.select)(P).getUnregisteredFallbackBlockName()}function ea(e){(0,R.dispatch)(P).setDefaultBlockName(e)}function ra(e){(0,R.dispatch)(P).setGroupingBlockName(e)}function pr(){return(0,R.select)(P).getDefaultBlockName()}function M(e){return(0,R.select)(P)?.getBlockType(e)}function Ue(){return(0,R.select)(P).getBlockTypes()}function ta(e,t,r){return(0,R.select)(P).getBlockSupport(e,t,r)}function se(e,t,r){return(0,R.select)(P).hasBlockSupport(e,t,r)}function na(e){return e?.name==="core/block"}function aa(e){return e?.name==="core/template-part"}var oa=e=>(0,R.select)(P).getChildBlockNames(e),ua=e=>(0,R.select)(P).hasChildBlocks(e),ia=e=>(0,R.select)(P).hasChildBlocksWithInserterSupport(e),sa=(e,t)=>{(0,R.dispatch)(P).addBlockStyles(e,t)},da=(e,t)=>{(0,R.dispatch)(P).removeBlockStyles(e,t)},ca=(e,t)=>(0,R.select)(P).getBlockVariations(e,t),la=(e,t)=>{typeof t.name!="string"&&(0,q.default)("Variation names must be unique strings."),(0,R.dispatch)(P).addBlockVariations(e,t)},fa=(e,t)=>{(0,R.dispatch)(P).removeBlockVariations(e,t)},pa=e=>{let{name:t,label:r,usesContext:a,getValues:o,setValues:s,canUserEditValue:c,getFieldsList:h}=e,_=oe((0,R.select)(P)).getBlockBindingsSource(t),b=["label","usesContext"];for(let E in _)if(!b.includes(E)&&_[E]){(0,q.default)('Block bindings source "'+t+'" is already registered.');return}if(!t){(0,q.default)("Block bindings source must contain a name.");return}if(typeof t!="string"){(0,q.default)("Block bindings source name must be a string.");return}if(/[A-Z]+/.test(t)){(0,q.default)("Block bindings source name must not contain uppercase characters.");return}if(!/^[a-z0-9/-]+$/.test(t)){(0,q.default)("Block bindings source name must contain only valid characters: lowercase characters, hyphens, or digits. Example: my-plugin/my-custom-source.");return}if(!/^[a-z0-9-]+\/[a-z0-9-]+$/.test(t)){(0,q.default)("Block bindings source name must contain a namespace and valid characters. Example: my-plugin/my-custom-source.");return}if(!r&&!_?.label){(0,q.default)("Block bindings source must contain a label.");return}if(r&&typeof r!="string"){(0,q.default)("Block bindings source label must be a string.");return}if(r&&_?.label&&r!==_?.label&&(0,q.default)('Block bindings "'+t+'" source label was overridden.'),a&&!Array.isArray(a)){(0,q.default)("Block bindings source usesContext must be an array.");return}if(o&&typeof o!="function"){(0,q.default)("Block bindings source getValues must be a function.");return}if(s&&typeof s!="function"){(0,q.default)("Block bindings source setValues must be a function.");return}if(c&&typeof c!="function"){(0,q.default)("Block bindings source canUserEditValue must be a function.");return}if(h&&typeof h!="function"){(0,q.default)("Block bindings source getFieldsList must be a function.");return}return oe((0,R.dispatch)(P)).addBlockBindingsSource(e)};function ma(e){if(!gt(e)){(0,q.default)('Block bindings source "'+e+'" is not registered.');return}oe((0,R.dispatch)(P)).removeBlockBindingsSource(e)}function gt(e){return oe((0,R.select)(P)).getBlockBindingsSource(e)}function ha(){return oe((0,R.select)(P)).getAllBlockBindingsSources()}On([Dn,Mn]);var ga=["#191e23","#f8f9f9"];function _t(e,t){let r=M(e.name)?.attributes??{},a=t?Object.entries(r).filter(([s,c])=>t==="content"&&s==="metadata"?Object.keys(e.attributes[s]?.bindings??{}).length>0:c.role===t||c.__experimentalRole===t):[];return(a.length?a:Object.entries(r)).every(([s,c])=>{let h=e.attributes[s];return c.hasOwnProperty("default")?h===c.default:c.type==="rich-text"?!h?.length:h===void 0})}function hr(e,t){return e.name===pr()&&_t(e,t)}function $e(e){return!!e&&(typeof e=="string"||(0,mr.isValidElement)(e)||typeof e=="function"||e instanceof mr.Component)}function gr(e){if(e=e||cr,$e(e))return{src:e};if("background"in e){let t=ae(e.background),r=o=>t.contrast(o),a=Math.max(...ga.map(r));return{...e,foreground:e.foreground?e.foreground:ga.find(o=>r(o)===a),shadowColor:t.alpha(.3).toRgbString()}}return e}function de(e){return typeof e=="string"?M(e):e}function yt(e,t,r="visual"){let{__experimentalLabel:a,title:o}=e,s=a&&a(t,{context:r});return s?s.toPlainText?s.toPlainText():(0,ba.__unstableStripHTML)(s):o}function _a(e,t,r,a="vertical"){let o=e?.title,s=e?yt(e,t,"accessibility"):"",c=r!==void 0,h=s&&s!==o;return c&&a==="vertical"?h?(0,W.sprintf)((0,W.__)("%1$s Block. Row %2$d. %3$s"),o,r,s):(0,W.sprintf)((0,W.__)("%1$s Block. Row %2$d"),o,r):c&&a==="horizontal"?h?(0,W.sprintf)((0,W.__)("%1$s Block. Column %2$d. %3$s"),o,r,s):(0,W.sprintf)((0,W.__)("%1$s Block. Column %2$d"),o,r):h?(0,W.sprintf)((0,W.__)("%1$s Block. %2$s"),o,s):(0,W.sprintf)((0,W.__)("%s Block"),o)}function wt(e){if(e.default!==void 0)return e.default;if(e.type==="rich-text")return new Fe.RichTextData}function kt(e){return M(e)!==void 0}function Ge(e,t){let r=M(e);if(r===void 0)throw new Error(`Block type '${e}' is not registered.`);return Object.entries(r.attributes).reduce((a,[o,s])=>{let c=t[o];if(c!==void 0)s.type==="rich-text"?c instanceof Fe.RichTextData?a[o]=c:typeof c=="string"&&(a[o]=Fe.RichTextData.fromHTMLString(c)):s.type==="string"&&c instanceof Fe.RichTextData?a[o]=c.toHTMLString():a[o]=c;else{let h=wt(s);h!==void 0&&(a[o]=h)}return["node","children"].indexOf(s.source)!==-1&&(typeof a[o]=="string"?a[o]=[a[o]]:Array.isArray(a[o])||(a[o]=[])),a},{})}function vt(e,t){let r=M(e)?.attributes;if(!r)return[];let a=Object.keys(r);return t?a.filter(o=>{let s=r[o];return s?.role===t?!0:s?.__experimentalRole===t?((0,bt.default)("__experimentalRole attribute",{since:"6.7",version:"6.8",alternative:"role attribute",hint:`Check the block.json of the ${e} block.`}),!0):!1}):a}var ya=(...e)=>((0,bt.default)("__experimentalGetBlockAttributesNamesByRole",{since:"6.7",version:"6.8",alternative:"getBlockAttributesNamesByRole"}),vt(...e));function wa(e){let t=M(e),r=t?.attributes;return t?.supports?.contentRole?!0:r?!!Object.keys(r)?.some(o=>{let s=r[o];return s?.role==="content"||s?.__experimentalRole==="content"}):!1}function ce(e,t){return Object.fromEntries(Object.entries(e).filter(([r])=>!t.includes(r)))}var ri=[{slug:"text",title:(0,ye.__)("Text")},{slug:"media",title:(0,ye.__)("Media")},{slug:"design",title:(0,ye.__)("Design")},{slug:"widgets",title:(0,ye.__)("Widgets")},{slug:"theme",title:(0,ye.__)("Theme")},{slug:"embed",title:(0,ye.__)("Embeds")},{slug:"reusable",title:(0,ye.__)("Reusable blocks")}];function Et(e){return e.reduce((t,r)=>({...t,[r.name]:r}),{})}function br(e){return e.reduce((t,r)=>(t.some(a=>a.name===r.name)||t.push(r),t),[])}function ti(e={},t){switch(t.type){case"ADD_BOOTSTRAPPED_BLOCK_TYPE":let{name:r,blockType:a}=t;if(e[r])return e;let s=Object.fromEntries(Object.entries(a).filter(([,c])=>c!=null).map(([c,h])=>[kn(c),h]));return s.name=r,{...e,[r]:s};case"REMOVE_BLOCK_TYPES":return ce(e,t.names)}return e}function ni(e={},t){switch(t.type){case"ADD_UNPROCESSED_BLOCK_TYPE":return{...e,[t.name]:t.blockType};case"REMOVE_BLOCK_TYPES":return ce(e,t.names)}return e}function ai(e={},t){switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...Et(t.blockTypes)};case"REMOVE_BLOCK_TYPES":return ce(e,t.names)}return e}function oi(e={},t){switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...Object.fromEntries(Object.entries(Et(t.blockTypes)).map(([a,o])=>[a,br([...(o.styles??[]).map(s=>({...s,source:"block"})),...(e[o.name]??[]).filter(({source:s})=>s!=="block")])]))};case"ADD_BLOCK_STYLES":let r={};return t.blockNames.forEach(a=>{r[a]=br([...e[a]??[],...t.styles])}),{...e,...r};case"REMOVE_BLOCK_STYLES":return{...e,[t.blockName]:(e[t.blockName]??[]).filter(a=>t.styleNames.indexOf(a.name)===-1)}}return e}function ui(e={},t){switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...Object.fromEntries(Object.entries(Et(t.blockTypes)).map(([r,a])=>[r,br([...(a.variations??[]).map(o=>({...o,source:"block"})),...(e[a.name]??[]).filter(({source:o})=>o!=="block")])]))};case"ADD_BLOCK_VARIATIONS":return{...e,[t.blockName]:br([...e[t.blockName]??[],...t.variations])};case"REMOVE_BLOCK_VARIATIONS":return{...e,[t.blockName]:(e[t.blockName]??[]).filter(r=>t.variationNames.indexOf(r.name)===-1)}}return e}function _r(e){return(t=null,r)=>{switch(r.type){case"REMOVE_BLOCK_TYPES":return r.names.indexOf(t)!==-1?null:t;case e:return r.name||null}return t}}var ii=_r("SET_DEFAULT_BLOCK_NAME"),si=_r("SET_FREEFORM_FALLBACK_BLOCK_NAME"),di=_r("SET_UNREGISTERED_FALLBACK_BLOCK_NAME"),ci=_r("SET_GROUPING_BLOCK_NAME");function li(e=ri,t){switch(t.type){case"SET_CATEGORIES":let r=new Map;return(t.categories||[]).forEach(a=>{r.set(a.slug,a)}),[...r.values()];case"UPDATE_CATEGORY":{if(!t.category||!Object.keys(t.category).length)return e;if(e.find(({slug:o})=>o===t.slug))return e.map(o=>o.slug===t.slug?{...o,...t.category}:o)}}return e}function fi(e={},t){switch(t.type){case"ADD_BLOCK_COLLECTION":return{...e,[t.namespace]:{title:t.title,icon:t.icon}};case"REMOVE_BLOCK_COLLECTION":return ce(e,t.namespace)}return e}function pi(e=[],t=[]){let r=Array.from(new Set(e.concat(t)));return r.length>0?r:void 0}function mi(e={},t){switch(t.type){case"ADD_BLOCK_BINDINGS_SOURCE":return{...e,[t.name]:{label:t.label||e[t.name]?.label,usesContext:pi(e[t.name]?.usesContext,t.usesContext),getValues:t.getValues,setValues:t.setValues,canUserEditValue:t.setValues&&t.canUserEditValue,getFieldsList:t.getFieldsList}};case"REMOVE_BLOCK_BINDINGS_SOURCE":return ce(e,t.name)}return e}var va=(0,ka.combineReducers)({bootstrappedBlockTypes:ti,unprocessedBlockTypes:ni,blockTypes:ai,blockStyles:oi,blockVariations:ui,defaultBlockName:ii,freeformFallbackBlockName:si,unregisteredFallbackBlockName:di,groupingBlockName:ci,categories:li,collections:fi,blockBindingsSources:mi});var Nt={};Ie(Nt,{__experimentalHasContentRoleAttribute:()=>qi,getActiveBlockVariation:()=>Ai,getBlockStyles:()=>Bi,getBlockSupport:()=>ja,getBlockType:()=>Me,getBlockTypes:()=>Ma,getBlockVariations:()=>At,getCategories:()=>Ni,getChildBlockNames:()=>St,getCollections:()=>Li,getDefaultBlockName:()=>Pi,getDefaultBlockVariation:()=>Si,getFreeformFallbackBlockName:()=>Ri,getGroupingBlockName:()=>Di,getUnregisteredFallbackBlockName:()=>Oi,hasBlockSupport:()=>za,hasChildBlocks:()=>ji,hasChildBlocksWithInserterSupport:()=>zi,isMatchingSearchTerm:()=>Mi});var Pa=B(Ba(),1),wr=B(Be(),1),Ra=B(xe(),1),Oa=B(J(),1);var Ae=(e,t,r)=>{let a=Array.isArray(t)?t:t.split("."),o=e;return a.forEach(s=>{o=o?.[s]}),o??r};function Aa(e){return typeof e=="object"&&e.constructor===Object&&e!==null}function Tt(e,t){return Aa(e)&&Aa(t)?Object.entries(t).every(([r,a])=>Tt(e?.[r],a)):e===t}var Bt={};Ie(Bt,{getAllBlockBindingsSources:()=>Ei,getBlockBindingsSource:()=>Ti,getBlockBindingsSourceFieldsList:()=>Ci,getBootstrappedBlockType:()=>ki,getSupportedStyles:()=>wi,getUnprocessedBlockTypes:()=>vi,hasContentRoleAttribute:()=>Ct});var Ke=B(Be(),1),Na=B(J(),1);var yi=["background","backgroundColor","color","linkColor","captionColor","buttonColor","headingColor","fontFamily","fontSize","fontStyle","fontWeight","lineHeight","padding","contentSize","wideSize","blockGap","textAlign","textDecoration","textIndent","textTransform","letterSpacing"];function Sa(e,t,r){return e.filter(a=>!(a==="fontSize"&&r==="heading"||a==="textDecoration"&&!t&&r!=="link"||a==="textTransform"&&!t&&!(["heading","h1","h2","h3","h4","h5","h6"].includes(r)||r==="button"||r==="caption"||r==="text")||a==="letterSpacing"&&!t&&!(["heading","h1","h2","h3","h4","h5","h6"].includes(r)||r==="button"||r==="caption"||r==="text")||a==="textIndent"&&!t||a==="textColumns"&&!t))}var wi=(0,Ke.createSelector)((e,t,r)=>{if(!t)return Sa(yi,t,r);let a=Me(e,t);if(!a)return[];let o=[];return a?.supports?.spacing?.blockGap&&o.push("blockGap"),a?.supports?.shadow&&o.push("shadow"),Object.keys(pe).forEach(s=>{if(pe[s].support){if(pe[s].requiresOptOut&&pe[s].support[0]in a.supports&&Ae(a.supports,pe[s].support)!==!1){o.push(s);return}Ae(a.supports,pe[s].support,!1)&&o.push(s)}}),Sa(o,t,r)},(e,t)=>[e.blockTypes[t]]);function ki(e,t){return e.bootstrappedBlockTypes[t]}function vi(e){return e.unprocessedBlockTypes}function Ei(e){return e.blockBindingsSources}function Ti(e,t){return e.blockBindingsSources[t]}var Ci=(0,Ke.createRegistrySelector)(e=>(0,Ke.createSelector)((t,r,a)=>{if(!r.getFieldsList)return[];let o={};if(r?.usesContext?.length)for(let s of r.usesContext)o[s]=a[s];return r.getFieldsList({select:e,context:o})},(t,r,a)=>[r.getFieldsList,r.usesContext,a])),Ct=(e,t)=>{let r=Me(e,t);return r?Object.values(r.attributes).some(({role:a,__experimentalRole:o})=>a==="content"?!0:o==="content"?((0,Na.default)("__experimentalRole attribute",{since:"6.7",version:"6.8",alternative:"role attribute",hint:`Check the block.json of the ${t} block.`}),!0):!1):!1};var Da=(e,t)=>typeof t=="string"?Me(e,t):t,Ma=(0,wr.createSelector)(e=>Object.values(e.blockTypes),e=>[e.blockTypes]);function Me(e,t){return e.blockTypes[t]}function Bi(e,t){return e.blockStyles[t]}var At=(0,wr.createSelector)((e,t,r)=>{let a=e.blockVariations[t];return!a||!r?a:a.filter(o=>(o.scope||["block","inserter"]).includes(r))},(e,t)=>[e.blockVariations[t]]);function Ai(e,t,r,a){let o=At(e,t,a);if(!o)return o;let s=Me(e,t),c=Object.keys(s?.attributes||{}),h,_=0;for(let b of o)if(Array.isArray(b.isActive)){let E=b.isActive.filter(j=>{let I=j.split(".")[0];return c.includes(I)}),L=E.length;if(L===0)continue;E.every(j=>{let I=Ae(b.attributes,j);if(I===void 0)return!1;let G=Ae(r,j);return G instanceof Ra.RichTextData&&(G=G.toHTMLString()),Tt(G,I)})&&L>_&&(h=b,_=L)}else if(b.isActive?.(r,b.attributes))return h||b;return!h&&["block","transform"].includes(a)&&(h=o.find(b=>b?.isDefault&&!Object.hasOwn(b,"isActive"))),h}function Si(e,t,r){let a=At(e,t,r);return[...a].reverse().find(({isDefault:s})=>!!s)||a[0]}function Ni(e){return e.categories}function Li(e){return e.collections}function Pi(e){return e.defaultBlockName}function Ri(e){return e.freeformFallbackBlockName}function Oi(e){return e.unregisteredFallbackBlockName}function Di(e){return e.groupingBlockName}var St=(0,wr.createSelector)((e,t)=>Ma(e).filter(r=>r.parent?.includes(t)).map(({name:r})=>r),e=>[e.blockTypes]),ja=(e,t,r,a)=>{let o=Da(e,t);return o?.supports?Ae(o.supports,r,a):a};function za(e,t,r,a){return!!ja(e,t,r,a)}function La(e){return(0,Pa.default)(e??"").toLowerCase().trim()}function Mi(e,t,r=""){let a=Da(e,t),o=La(r),s=c=>La(c).includes(o);return s(a.title)||a.keywords?.some(s)||s(a.category)||typeof a.description=="string"&&s(a.description)}var ji=(e,t)=>St(e,t).length>0,zi=(e,t)=>St(e,t).some(r=>za(e,r,"inserter",!0)),qi=(...e)=>((0,Oa.default)("__experimentalHasContentRoleAttribute",{since:"6.7",version:"6.8",hint:"This is a private selector."}),Ct(...e));var Dt={};Ie(Dt,{__experimentalReapplyBlockFilters:()=>Ui,addBlockCollection:()=>rs,addBlockStyles:()=>$i,addBlockTypes:()=>Hi,addBlockVariations:()=>Ki,reapplyBlockTypeFilters:()=>Wa,removeBlockCollection:()=>ts,removeBlockStyles:()=>Gi,removeBlockTypes:()=>Fi,removeBlockVariations:()=>Wi,setCategories:()=>Ji,setDefaultBlockName:()=>Yi,setFreeformFallbackBlockName:()=>Xi,setGroupingBlockName:()=>Qi,setUnregisteredFallbackBlockName:()=>Zi,updateCategory:()=>es});var Ka=B(J(),1);function qa(e){return Object.prototype.toString.call(e)==="[object Object]"}function Ia(e){var t,r;return qa(e)===!1?!1:(t=e.constructor,t===void 0?!0:(r=t.prototype,!(qa(r)===!1||r.hasOwnProperty("isPrototypeOf")===!1)))}var Ga=B(Ua(),1),Rt=B(J(),1),Ot=B(We(),1),te=B(pt(),1);var $a={common:"text",formatting:"text",layout:"design"};function xi(e=[],t=[]){let r=[...e];return t.forEach(a=>{let o=r.findIndex(s=>s.name===a.name);o!==-1?r[o]={...r[o],...a}:r.push(a)}),r}var Pr=(e,t)=>({select:r})=>{let a=r.getBootstrappedBlockType(e),o={apiVersion:1,name:e,icon:cr,keywords:[],attributes:{},providesContext:{},usesContext:[],selectors:{},supports:{},styles:[],blockHooks:{},save:()=>null,...a,...t,variations:xi(Array.isArray(a?.variations)?a.variations:[],Array.isArray(t?.variations)?t.variations:[])};(!o.attributes||typeof o.attributes!="object")&&((0,te.default)('The block "'+e+'" is registering attributes as `null` or `undefined`. Use an empty object (`attributes: {}`) or exclude the `attributes` key.'),o.attributes={});let s=(0,Ot.applyFilters)("blocks.registerBlockType",o,e,null);if(s.apiVersion<=2&&(0,Rt.default)("Block with API version 2 or lower",{since:"6.9",hint:`The block "${e}" is registered with API version ${s.apiVersion}. This means that the post editor may work as a non-iframe editor. Since all editors are planned to work as iframes in the future, set the \`apiVersion\` field to 3 and test the block inside the iframe editor.`,link:"https://developer.wordpress.org/block-editor/reference-guides/block-api/block-api-versions/block-migration-for-iframe-editor-compatibility/"}),s.description&&typeof s.description!="string"&&(0,Rt.default)("Declaring non-string block descriptions",{since:"6.2"}),s.deprecated&&(s.deprecated=s.deprecated.map(c=>Object.fromEntries(Object.entries((0,Ot.applyFilters)("blocks.registerBlockType",{...ce(o,He),...c},o.name,c)).filter(([h])=>He.includes(h))))),!Ia(s)){(0,te.default)("Block settings must be a valid object.");return}if(typeof s.save!="function"){(0,te.default)('The "save" property must be a valid function.');return}if("edit"in s&&!(0,Ga.isValidElementType)(s.edit)){(0,te.default)('The "edit" property must be a valid component.');return}if($a.hasOwnProperty(s.category)&&(s.category=$a[s.category]),"category"in s&&!r.getCategories().some(({slug:c})=>c===s.category)&&((0,te.default)('The block "'+e+'" is registered with an invalid category "'+s.category+'".'),delete s.category),!("title"in s)||s.title===""){(0,te.default)('The block "'+e+'" must have a title.');return}if(typeof s.title!="string"){(0,te.default)("Block titles must be strings.");return}if(s.icon=gr(s.icon),!$e(s.icon.src)){(0,te.default)("The icon passed is invalid. The icon should be a string, an element, a function, or an object following the specifications documented in https://developer.wordpress.org/block-editor/developers/block-api/block-registration/#icon-optional");return}if((typeof s?.parent=="string"||s?.parent instanceof String)&&(s.parent=[s.parent],(0,te.default)("Parent must be undefined or an array of strings (block types), but it is a string.")),!Array.isArray(s?.parent)&&s?.parent!==void 0){(0,te.default)("Parent must be undefined or an array of block types, but it is ",s.parent);return}if(s?.parent?.length===1&&e===s.parent[0]){(0,te.default)('Block "'+e+'" cannot be a parent of itself. Please remove the block name from the parent list.');return}return s};function Hi(e){return{type:"ADD_BLOCK_TYPES",blockTypes:Array.isArray(e)?e:[e]}}function Wa(){return({dispatch:e,select:t})=>{let r=[];for(let[a,o]of Object.entries(t.getUnprocessedBlockTypes())){let s=e(Pr(a,o));s&&r.push(s)}r.length&&e.addBlockTypes(r)}}function Ui(){return(0,Ka.default)('wp.data.dispatch( "core/blocks" ).__experimentalReapplyBlockFilters',{since:"6.4",alternative:"reapplyBlockFilters"}),Wa()}function Fi(e){return{type:"REMOVE_BLOCK_TYPES",names:Array.isArray(e)?e:[e]}}function $i(e,t){return{type:"ADD_BLOCK_STYLES",styles:Array.isArray(t)?t:[t],blockNames:Array.isArray(e)?e:[e]}}function Gi(e,t){return{type:"REMOVE_BLOCK_STYLES",styleNames:Array.isArray(t)?t:[t],blockName:e}}function Ki(e,t){return{type:"ADD_BLOCK_VARIATIONS",variations:Array.isArray(t)?t:[t],blockName:e}}function Wi(e,t){return{type:"REMOVE_BLOCK_VARIATIONS",variationNames:Array.isArray(t)?t:[t],blockName:e}}function Yi(e){return{type:"SET_DEFAULT_BLOCK_NAME",name:e}}function Xi(e){return{type:"SET_FREEFORM_FALLBACK_BLOCK_NAME",name:e}}function Zi(e){return{type:"SET_UNREGISTERED_FALLBACK_BLOCK_NAME",name:e}}function Qi(e){return{type:"SET_GROUPING_BLOCK_NAME",name:e}}function Ji(e){return{type:"SET_CATEGORIES",categories:e}}function es(e,t){return{type:"UPDATE_CATEGORY",slug:e,category:t}}function rs(e,t,r){return{type:"ADD_BLOCK_COLLECTION",namespace:e,title:t,icon:r}}function ts(e){return{type:"REMOVE_BLOCK_COLLECTION",namespace:e}}var Mt={};Ie(Mt,{addBlockBindingsSource:()=>os,addBootstrappedBlockType:()=>ns,addUnprocessedBlockType:()=>as,removeBlockBindingsSource:()=>us});function ns(e,t){return{type:"ADD_BOOTSTRAPPED_BLOCK_TYPE",name:e,blockType:t}}function as(e,t){return({dispatch:r})=>{r({type:"ADD_UNPROCESSED_BLOCK_TYPE",name:e,blockType:t});let a=r(Pr(e,t));a&&r.addBlockTypes(a)}}function os(e){return{type:"ADD_BLOCK_BINDINGS_SOURCE",name:e.name,label:e.label,usesContext:e.usesContext,getValues:e.getValues,setValues:e.setValues,canUserEditValue:e.canUserEditValue,getFieldsList:e.getFieldsList}}function us(e){return{type:"REMOVE_BLOCK_BINDINGS_SOURCE",name:e}}var Ya="core/blocks";var P=(0,Rr.createReduxStore)(Ya,{reducer:va,selectors:Nt,actions:Dt});(0,Rr.register)(P);oe(P).registerPrivateSelectors(Bt);oe(P).registerPrivateActions(Mt);var Or,is=new Uint8Array(16);function jt(){if(!Or&&(Or=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Or))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Or(is)}var H=[];for(let e=0;e<256;++e)H.push((e+256).toString(16).slice(1));function Xa(e,t=0){return H[e[t+0]]+H[e[t+1]]+H[e[t+2]]+H[e[t+3]]+"-"+H[e[t+4]]+H[e[t+5]]+"-"+H[e[t+6]]+H[e[t+7]]+"-"+H[e[t+8]]+H[e[t+9]]+"-"+H[e[t+10]]+H[e[t+11]]+H[e[t+12]]+H[e[t+13]]+H[e[t+14]]+H[e[t+15]]}var ss=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),zt={randomUUID:ss};function ds(e,t,r){if(zt.randomUUID&&!t&&!e)return zt.randomUUID();e=e||{};let a=e.random||(e.rng||jt)();if(a[6]=a[6]&15|64,a[8]=a[8]&63|128,t){r=r||0;for(let o=0;o<16;++o)t[r+o]=a[o];return t}return Xa(a)}var Ye=ds;var Dr=B(We(),1);function U(e,t={},r=[]){if(!kt(e))return U("core/missing",{originalName:e,originalContent:"",originalUndelimitedContent:""});let a=Ge(e,t);return{clientId:Ye(),name:e,isValid:!0,attributes:a,innerBlocks:r}}function It(e=[]){return e.map(t=>{let r=Array.isArray(t)?t:[t.name,t.attributes,t.innerBlocks],[a,o,s=[]]=r;return U(a,o,It(s))})}function Vt(e,t={},r){let{name:a}=e;if(!kt(a))return U("core/missing",{originalName:a,originalContent:"",originalUndelimitedContent:""});let o=Ye(),s=Ge(a,{...e.attributes,...t});return{...e,clientId:o,attributes:s,innerBlocks:r||e.innerBlocks.map(c=>Vt(c))}}function xt(e,t={},r){let a=Ye();return{...e,clientId:a,attributes:{...e.attributes,...t},innerBlocks:r||e.innerBlocks.map(o=>xt(o))}}var Qa=(e,t,r)=>{if(!r.length)return!1;let a=r.length>1,o=r[0].name;if(!(je(e)||!a||e.isMultiBlock)||!je(e)&&!r.every(b=>b.name===o)||!(e.type==="block"))return!1;let h=r[0];return!(!(t!=="from"||e.blocks.indexOf(h.name)!==-1||je(e))||!a&&t==="from"&&Za(h.name)&&Za(e.blockName)||!qt(e,r))},cs=e=>e.length?Ue().filter(a=>{let o=ue("from",a.name);return!!he(o,s=>Qa(s,"from",e))}):[],ls=e=>{if(!e.length)return[];let t=e[0],r=M(t.name);return(r?ue("to",r.name):[]).filter(c=>c&&Qa(c,"to",e)).map(c=>c.blocks).flat().map(M)},je=e=>e&&e.type==="block"&&Array.isArray(e.blocks)&&e.blocks.includes("*"),Za=e=>e===fr();function Ja(e){if(!e.length)return[];let t=cs(e),r=ls(e);return[...new Set([...t,...r])]}function he(e,t){let r=(0,Dr.createHooks)();for(let a=0;a<e.length;a++){let o=e[a];t(o)&&r.addFilter("transform","transform/"+a.toString(),s=>s||o,o.priority)}return r.applyFilters("transform",null)}function ue(e,t){if(t===void 0)return Ue().map(({name:h})=>ue(e,h)).flat();let r=de(t),{name:a,transforms:o}=r||{};if(!o||!Array.isArray(o[e]))return[];let s=o.supportedMobileTransforms&&Array.isArray(o.supportedMobileTransforms);return(s?o[e].filter(h=>h.type==="raw"||h.type==="prefix"?!0:!h.blocks||!h.blocks.length?!1:je(h)?!0:h.blocks.every(_=>o.supportedMobileTransforms.includes(_))):o[e]).map(h=>({...h,blockName:a,usingMobileTransformations:s}))}function qt(e,t){if(typeof e.isMatch!="function")return!0;let r=t[0],a=e.isMultiBlock?t.map(s=>s.attributes):r.attributes,o=e.isMultiBlock?t:r;return e.isMatch(a,o)}function eo(e,t){let r=Array.isArray(e)?e:[e],a=r.length>1,o=r[0],s=o.name,c=ue("from",t),h=ue("to",s),_=he(h,N=>N.type==="block"&&(je(N)||N.blocks.indexOf(t)!==-1)&&(!a||N.isMultiBlock)&&qt(N,r))||he(c,N=>N.type==="block"&&(je(N)||N.blocks.indexOf(s)!==-1)&&(!a||N.isMultiBlock)&&qt(N,r));if(!_)return null;let b;return _.isMultiBlock?"__experimentalConvert"in _?b=_.__experimentalConvert(r):b=_.transform(r.map(N=>N.attributes),r.map(N=>N.innerBlocks)):"__experimentalConvert"in _?b=_.__experimentalConvert(o):b=_.transform(o.attributes,o.innerBlocks),b===null||typeof b!="object"||(b=Array.isArray(b)?b:[b],b.some(N=>!M(N.name)))||!b.some(N=>N.name===t)?null:b.map((N,j,I)=>(0,Dr.applyFilters)("blocks.switchToBlockType.transformedBlock",N,e,j,I))}var Ht=(e,t)=>U(e,t.attributes,(t.innerBlocks??[]).map(r=>Ht(r.name,r)));var Go=B(to(),1),Ko=B(Ut(),1);var ve=B(De(),1),ke=B(We(),1),so=B(oo(),1),co=B(Ut(),1),lo=B(J(),1);function we(e,t={}){let{isCommentDelimited:r=!0}=t,{blockName:a,attrs:o={},innerBlocks:s=[],innerContent:c=[]}=e,h=0,_=c.map(b=>b!==null?b:we(s[h++],t)).join(` `).replace(/\n+/g,` `).trim();return r?Ft(a,o,_):_}var fo=B(io(),1);function po(e){let t="wp-block-"+e.replace(/\//,"-").replace(/^core-/,"");return(0,ke.applyFilters)("blocks.getBlockDefaultClassName",t,e)}function mo(e){let t="editor-block-list-item-"+e.replace(/\//,"-").replace(/^core-/,"");return(0,ke.applyFilters)("blocks.getBlockMenuDefaultClassName",t,e)}var $t={},ho={};function Gt(e={}){let{blockType:t,attributes:r}=$t;return Gt.skipFilters?e:(0,ke.applyFilters)("blocks.getSaveContent.extraProps",{...e},t,r)}function go(e={}){let{innerBlocks:t}=ho;if(!Array.isArray(t))return{...e,children:t};let r=Mr(t,{isInnerBlocks:!0});return{...e,children:(0,fo.jsx)(ve.RawHTML,{children:r})}}function Kt(e,t,r=[]){let a=de(e);if(!a?.save)return null;let{save:o}=a;if(o.prototype instanceof ve.Component){let c=new o({attributes:t});o=c.render.bind(c)}$t.blockType=a,$t.attributes=t,ho.innerBlocks=r;let s=o({attributes:t,innerBlocks:r});if(s!==null&&typeof s=="object"&&(0,ke.hasFilter)("blocks.getSaveContent.extraProps")&&!(a.apiVersion>1)){let c=(0,ke.applyFilters)("blocks.getSaveContent.extraProps",{...s.props},a,t);(0,so.isShallowEqual)(c,s.props)||(s=(0,ve.cloneElement)(s,c))}return(0,ke.applyFilters)("blocks.getSaveElement",s,a,t)}function ge(e,t,r){let a=de(e);return(0,ve.renderToString)(Kt(a,t,r))}function fs(e,t){return Object.entries(e.attributes??{}).reduce((r,[a,o])=>{let s=t[a];return s===void 0||o.source!==void 0||o.role==="local"?r:o.__experimentalRole==="local"?((0,lo.default)("__experimentalRole attribute",{since:"6.7",version:"6.8",alternative:"role attribute",hint:`Check the block.json of the ${e?.name} block.`}),r):("default"in o&&JSON.stringify(o.default)===JSON.stringify(s)||(r[a]=s),r)},{})}function ps(e){return JSON.stringify(e).replaceAll("\\\\","\\u005c").replaceAll("--","\\u002d\\u002d").replaceAll("<","\\u003c").replaceAll(">","\\u003e").replaceAll("&","\\u0026").replaceAll('\\"',"\\u0022")}function Xe(e){let t=e.originalContent;if(e.isValid||e.innerBlocks.length)try{t=ge(e.name,e.attributes,e.innerBlocks)}catch{}return t}function Ft(e,t,r){let a=t&&Object.entries(t).length?ps(t)+" ":"",o=e?.startsWith("core/")?e.slice(5):e;return r?`<!-- wp:${o} ${a}--> `+r+` <!-- /wp:${o} -->`:`<!-- wp:${o} ${a}/-->`}function ms(e,{isInnerBlocks:t=!1}={}){if(!e.isValid&&e.__unstableBlockSource)return we(e.__unstableBlockSource);let r=e.name,a=Xe(e);if(r===me()||!t&&r===ee())return a;let o=M(r);if(!o)return a;let s=fs(o,e.attributes);return Ft(r,s,a)}var bo=(()=>{let e=new WeakMap;return t=>{let r=e.get(t);if(r!==void 0)return r;let a=t;a.length===1&&hr(a[0])&&(a=[]);let o=Mr(a);return a.length===1&&a[0].name===ee()&&a[0].name==="core/freeform"&&(o=(0,co.removep)(o)),e.set(t,o),o}})();function Mr(e,t){return(Array.isArray(e)?e:[e]).map(a=>ms(a,t)).join(` `)}var hs=/^#[xX]([A-Fa-f0-9]+)$/,gs=/^#([0-9]+)$/,bs=/^([A-Za-z0-9]+)$/,dl=(function(){function e(t){this.named=t}return e.prototype.parse=function(t){if(t){var r=t.match(hs);if(r)return String.fromCharCode(parseInt(r[1],16));if(r=t.match(gs),r)return String.fromCharCode(parseInt(r[1],10));if(r=t.match(bs),r)return this.named[r[1]]}},e})(),_s=/[\t\n\f ]/,ys=/[A-Za-z]/,ws=/\r\n?/g;function Se(e){return _s.test(e)}function _o(e){return ys.test(e)}function ks(e){return e.replace(ws,` `)}var vs=(function(){function e(t,r){this.delegate=t,this.entityParser=r,this.state="beforeData",this.line=-1,this.column=-1,this.input="",this.index=-1,this.tagNameBuffer="",this.states={beforeData:function(){var a=this.peek();if(a==="<")this.transitionTo("tagOpen"),this.markTagStart(),this.consume();else{if(a===` `){var o=this.tagNameBuffer.toLowerCase();(o==="pre"||o==="textarea")&&this.consume()}this.transitionTo("data"),this.delegate.beginData()}},data:function(){var a=this.peek();a==="<"?(this.delegate.finishData(),this.transitionTo("tagOpen"),this.markTagStart(),this.consume()):a==="&"?(this.consume(),this.delegate.appendToData(this.consumeCharRef()||"&")):(this.consume(),this.delegate.appendToData(a))},tagOpen:function(){var a=this.consume();a==="!"?this.transitionTo("markupDeclarationOpen"):a==="/"?this.transitionTo("endTagOpen"):(a==="@"||a===":"||_o(a))&&(this.transitionTo("tagName"),this.tagNameBuffer="",this.delegate.beginStartTag(),this.appendToTagName(a))},markupDeclarationOpen:function(){var a=this.consume();a==="-"&&this.input.charAt(this.index)==="-"&&(this.consume(),this.transitionTo("commentStart"),this.delegate.beginComment())},commentStart:function(){var a=this.consume();a==="-"?this.transitionTo("commentStartDash"):a===">"?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData(a),this.transitionTo("comment"))},commentStartDash:function(){var a=this.consume();a==="-"?this.transitionTo("commentEnd"):a===">"?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData("-"),this.transitionTo("comment"))},comment:function(){var a=this.consume();a==="-"?this.transitionTo("commentEndDash"):this.delegate.appendToCommentData(a)},commentEndDash:function(){var a=this.consume();a==="-"?this.transitionTo("commentEnd"):(this.delegate.appendToCommentData("-"+a),this.transitionTo("comment"))},commentEnd:function(){var a=this.consume();a===">"?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData("--"+a),this.transitionTo("comment"))},tagName:function(){var a=this.consume();Se(a)?this.transitionTo("beforeAttributeName"):a==="/"?this.transitionTo("selfClosingStartTag"):a===">"?(this.delegate.finishTag(),this.transitionTo("beforeData")):this.appendToTagName(a)},beforeAttributeName:function(){var a=this.peek();if(Se(a)){this.consume();return}else a==="/"?(this.transitionTo("selfClosingStartTag"),this.consume()):a===">"?(this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):a==="="?(this.delegate.reportSyntaxError("attribute name cannot start with equals sign"),this.transitionTo("attributeName"),this.delegate.beginAttribute(),this.consume(),this.delegate.appendToAttributeName(a)):(this.transitionTo("attributeName"),this.delegate.beginAttribute())},attributeName:function(){var a=this.peek();Se(a)?(this.transitionTo("afterAttributeName"),this.consume()):a==="/"?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):a==="="?(this.transitionTo("beforeAttributeValue"),this.consume()):a===">"?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):a==='"'||a==="'"||a==="<"?(this.delegate.reportSyntaxError(a+" is not a valid character within attribute names"),this.consume(),this.delegate.appendToAttributeName(a)):(this.consume(),this.delegate.appendToAttributeName(a))},afterAttributeName:function(){var a=this.peek();if(Se(a)){this.consume();return}else a==="/"?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):a==="="?(this.consume(),this.transitionTo("beforeAttributeValue")):a===">"?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.transitionTo("attributeName"),this.delegate.beginAttribute(),this.consume(),this.delegate.appendToAttributeName(a))},beforeAttributeValue:function(){var a=this.peek();Se(a)?this.consume():a==='"'?(this.transitionTo("attributeValueDoubleQuoted"),this.delegate.beginAttributeValue(!0),this.consume()):a==="'"?(this.transitionTo("attributeValueSingleQuoted"),this.delegate.beginAttributeValue(!0),this.consume()):a===">"?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.transitionTo("attributeValueUnquoted"),this.delegate.beginAttributeValue(!1),this.consume(),this.delegate.appendToAttributeValue(a))},attributeValueDoubleQuoted:function(){var a=this.consume();a==='"'?(this.delegate.finishAttributeValue(),this.transitionTo("afterAttributeValueQuoted")):a==="&"?this.delegate.appendToAttributeValue(this.consumeCharRef()||"&"):this.delegate.appendToAttributeValue(a)},attributeValueSingleQuoted:function(){var a=this.consume();a==="'"?(this.delegate.finishAttributeValue(),this.transitionTo("afterAttributeValueQuoted")):a==="&"?this.delegate.appendToAttributeValue(this.consumeCharRef()||"&"):this.delegate.appendToAttributeValue(a)},attributeValueUnquoted:function(){var a=this.peek();Se(a)?(this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("beforeAttributeName")):a==="/"?(this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):a==="&"?(this.consume(),this.delegate.appendToAttributeValue(this.consumeCharRef()||"&")):a===">"?(this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.consume(),this.delegate.appendToAttributeValue(a))},afterAttributeValueQuoted:function(){var a=this.peek();Se(a)?(this.consume(),this.transitionTo("beforeAttributeName")):a==="/"?(this.consume(),this.transitionTo("selfClosingStartTag")):a===">"?(this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):this.transitionTo("beforeAttributeName")},selfClosingStartTag:function(){var a=this.peek();a===">"?(this.consume(),this.delegate.markTagAsSelfClosing(),this.delegate.finishTag(),this.transitionTo("beforeData")):this.transitionTo("beforeAttributeName")},endTagOpen:function(){var a=this.consume();(a==="@"||a===":"||_o(a))&&(this.transitionTo("tagName"),this.tagNameBuffer="",this.delegate.beginEndTag(),this.appendToTagName(a))}},this.reset()}return e.prototype.reset=function(){this.transitionTo("beforeData"),this.input="",this.index=0,this.line=1,this.column=0,this.delegate.reset()},e.prototype.transitionTo=function(t){this.state=t},e.prototype.tokenize=function(t){this.reset(),this.tokenizePart(t),this.tokenizeEOF()},e.prototype.tokenizePart=function(t){for(this.input+=ks(t);this.index<this.input.length;){var r=this.states[this.state];if(r!==void 0)r.call(this);else throw new Error("unhandled state "+this.state)}},e.prototype.tokenizeEOF=function(){this.flushData()},e.prototype.flushData=function(){this.state==="data"&&(this.delegate.finishData(),this.transitionTo("beforeData"))},e.prototype.peek=function(){return this.input.charAt(this.index)},e.prototype.consume=function(){var t=this.peek();return this.index++,t===` `?(this.line++,this.column=0):this.column++,t},e.prototype.consumeCharRef=function(){var t=this.input.indexOf(";",this.index);if(t!==-1){var r=this.input.slice(this.index,t),a=this.entityParser.parse(r);if(a){for(var o=r.length;o;)this.consume(),o--;return this.consume(),a}}},e.prototype.markTagStart=function(){this.delegate.tagOpen()},e.prototype.appendToTagName=function(t){this.tagNameBuffer+=t,this.delegate.appendToTagName(t)},e})(),yo=(function(){function e(t,r){r===void 0&&(r={}),this.options=r,this.token=null,this.startLine=1,this.startColumn=0,this.tokens=[],this.tokenizer=new vs(this,t),this._currentAttribute=void 0}return e.prototype.tokenize=function(t){return this.tokens=[],this.tokenizer.tokenize(t),this.tokens},e.prototype.tokenizePart=function(t){return this.tokens=[],this.tokenizer.tokenizePart(t),this.tokens},e.prototype.tokenizeEOF=function(){return this.tokens=[],this.tokenizer.tokenizeEOF(),this.tokens[0]},e.prototype.reset=function(){this.token=null,this.startLine=1,this.startColumn=0},e.prototype.current=function(){var t=this.token;if(t===null)throw new Error("token was unexpectedly null");if(arguments.length===0)return t;for(var r=0;r<arguments.length;r++)if(t.type===arguments[r])return t;throw new Error("token type was unexpectedly "+t.type)},e.prototype.push=function(t){this.token=t,this.tokens.push(t)},e.prototype.currentAttribute=function(){return this._currentAttribute},e.prototype.addLocInfo=function(){this.options.loc&&(this.current().loc={start:{line:this.startLine,column:this.startColumn},end:{line:this.tokenizer.line,column:this.tokenizer.column}}),this.startLine=this.tokenizer.line,this.startColumn=this.tokenizer.column},e.prototype.beginData=function(){this.push({type:"Chars",chars:""})},e.prototype.appendToData=function(t){this.current("Chars").chars+=t},e.prototype.finishData=function(){this.addLocInfo()},e.prototype.beginComment=function(){this.push({type:"Comment",chars:""})},e.prototype.appendToCommentData=function(t){this.current("Comment").chars+=t},e.prototype.finishComment=function(){this.addLocInfo()},e.prototype.tagOpen=function(){},e.prototype.beginStartTag=function(){this.push({type:"StartTag",tagName:"",attributes:[],selfClosing:!1})},e.prototype.beginEndTag=function(){this.push({type:"EndTag",tagName:""})},e.prototype.finishTag=function(){this.addLocInfo()},e.prototype.markTagAsSelfClosing=function(){this.current("StartTag").selfClosing=!0},e.prototype.appendToTagName=function(t){this.current("StartTag","EndTag").tagName+=t},e.prototype.beginAttribute=function(){this._currentAttribute=["","",!1]},e.prototype.appendToAttributeName=function(t){this.currentAttribute()[0]+=t},e.prototype.beginAttributeValue=function(t){this.currentAttribute()[2]=t},e.prototype.appendToAttributeValue=function(t){this.currentAttribute()[1]+=t},e.prototype.finishAttributeValue=function(){this.current("StartTag").attributes.push(this._currentAttribute)},e.prototype.reportSyntaxError=function(t){this.current().syntaxError=t},e})();var So=B(ko(),1),No=B(J(),1),Lo=B(Eo(),1);function Ne(){function e(t){return(r,...a)=>t("Block validation: "+r,...a)}return{error:e(console.error),warning:e(console.warn),getItems(){return[]}}}function To(){let e=[],t=Ne();return{error(...r){e.push({log:t.error,args:r})},warning(...r){e.push({log:t.warning,args:r})},getItems(){return e}}}var Es=e=>e,Ts=/[\t\n\r\v\f ]+/g,Cs=/^[\t\n\r\v\f ]*$/,Bs=/^url\s*\(['"\s]*(.*?)['"\s]*\)$/,Po=["allowfullscreen","allowpaymentrequest","allowusermedia","async","autofocus","autoplay","checked","controls","default","defer","disabled","download","formnovalidate","hidden","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected","typemustmatch"],As=["autocapitalize","autocomplete","charset","contenteditable","crossorigin","decoding","dir","draggable","enctype","formenctype","formmethod","http-equiv","inputmode","kind","method","preload","scope","shape","spellcheck","translate","type","wrap"],Ss=[...Po,...As],Co=[Es,Ds],Ns=/^[\da-z]+$/i,Ls=/^#\d+$/,Ps=/^#x[\da-f]+$/i;function Rs(e){return Ns.test(e)||Ls.test(e)||Ps.test(e)}var Os=class{parse(e){if(Rs(e))return(0,Lo.decodeEntities)("&"+e+";")}};function Wt(e){return e.trim().split(Ts)}function Ds(e){return Wt(e).join(" ")}function Ms(e){return e.attributes.filter(t=>{let[r,a]=t;return a||r.indexOf("data-")===0||Ss.includes(r)})}function Bo(e,t,r=Ne()){let a=e.chars,o=t.chars;for(let s=0;s<Co.length;s++){let c=Co[s];if(a=c(a),o=c(o),a===o)return!0}return r.warning("Expected text `%s`, saw `%s`.",t.chars,e.chars),!1}function js(e){return parseFloat(e)===0?"0":e.indexOf(".")===0?"0"+e:e}function zs(e){return Wt(e).map(js).join(" ").replace(Bs,"url($1)")}function qs(e){let t=e.replace(/;?\s*$/,"").split(";").map(r=>{let[a,...o]=r.split(":"),s=o.join(":");return[a.trim(),zs(s.trim())]});return Object.fromEntries(t)}var Is={class:(e,t)=>{let[r,a]=[e,t].map(Wt),o=r.filter(c=>!a.includes(c)),s=a.filter(c=>!r.includes(c));return o.length===0&&s.length===0},style:(e,t)=>(0,So.default)(...[e,t].map(qs)),...Object.fromEntries(Po.map(e=>[e,()=>!0]))};function Vs(e,t,r=Ne()){if(e.length!==t.length)return r.warning("Expected attributes %o, instead saw %o.",t,e),!1;let a={};for(let o=0;o<t.length;o++)a[t[o][0].toLowerCase()]=t[o][1];for(let o=0;o<e.length;o++){let[s,c]=e[o],h=s.toLowerCase();if(!a.hasOwnProperty(h))return r.warning("Encountered unexpected attribute `%s`.",s),!1;let _=a[h],b=Is[h];if(b){if(!b(c,_))return r.warning("Expected attribute `%s` of value `%s`, saw `%s`.",s,_,c),!1}else if(c!==_)return r.warning("Expected attribute `%s` of value `%s`, saw `%s`.",s,_,c),!1}return!0}var xs={StartTag:(e,t,r=Ne())=>e.tagName!==t.tagName&&e.tagName.toLowerCase()!==t.tagName.toLowerCase()?(r.warning("Expected tag name `%s`, instead saw `%s`.",t.tagName,e.tagName),!1):Vs(...[e,t].map(Ms),r),Chars:Bo,Comment:Bo};function Ze(e){let t;for(;t=e.shift();)if(t.type!=="Chars"||!Cs.test(t.chars))return t}function Hs(e,t=Ne()){try{return new yo(new Os).tokenize(e)}catch{t.warning("Malformed HTML detected: %s",e)}return null}function Ao(e,t){return e.selfClosing?!!(t&&t.tagName===e.tagName&&t.type==="EndTag"):!1}function Us(e,t,r=Ne()){if(e===t)return!0;let[a,o]=[e,t].map(h=>Hs(h,r));if(!a||!o)return!1;let s,c;for(;s=Ze(a);){if(c=Ze(o),!c)return r.warning("Expected end of content, instead saw %o.",s),!1;if(s.type!==c.type)return r.warning("Expected token of type `%s` (%o), instead saw `%s` (%o).",c.type,c,s.type,s),!1;let h=xs[s.type];if(h&&!h(s,c,r))return!1;Ao(s,o[0])?Ze(o):Ao(c,a[0])&&Ze(a)}return(c=Ze(o))?(r.warning("Expected %o, instead saw end of content.",c),!1):!0}function be(e,t=e.name){if(e.name===ee()||e.name===me())return[!0,[]];let a=To(),o=de(t),s;try{s=ge(o,e.attributes)}catch(h){return a.error(`Block validation failed because an error occurred while generating block content: %s`,h.toString()),[!1,a.getItems()]}let c=Us(e.originalContent,s,a);return c||a.error(`Block validation failed for \`%s\` (%o). Content generated by \`save\` function: %s Content retrieved from post body: %s`,o.name,o,s,e.originalContent),[c,a.getItems()]}function Ro(e,t,r){(0,No.default)("isValidBlockContent introduces opportunity for data loss",{since:"12.6",plugin:"Gutenberg",alternative:"validateBlock"});let a=de(e),o={name:a.name,attributes:t,innerBlocks:[],originalContent:r},[s]=be(o,a);return s}function jr(e,t){let r={...t};if(e==="core/cover-image"&&(e="core/cover"),(e==="core/text"||e==="core/cover-text")&&(e="core/paragraph"),e&&e.indexOf("core/social-link-")===0&&(r.service=e.substring(17),e="core/social-link"),e&&e.indexOf("core-embed/")===0){let a=e.substring(11),o={speaker:"speaker-deck",polldaddy:"crowdsignal"};r.providerNameSlug=a in o?o[a]:a,["amazon-kindle","wordpress"].includes(a)||(r.responsive=!0),e="core/embed"}if(e==="core/post-comment-author"&&(e="core/comment-author-name"),e==="core/post-comment-content"&&(e="core/comment-content"),e==="core/post-comment-date"&&(e="core/comment-date"),e==="core/comments-query-loop"){e="core/comments";let{className:a=""}=r;a.includes("wp-block-comments-query-loop")||(r.className=["wp-block-comments-query-loop",a].join(" "))}if(e==="core/post-comments"&&(e="core/comments",r.legacy=!0),t.layout?.type==="grid"&&typeof t.layout?.columnCount=="string"&&(r.layout={...r.layout,columnCount:parseInt(t.layout.columnCount,10)}),typeof t.style?.layout?.columnSpan=="string"){let a=parseInt(t.style.layout.columnSpan,10);r.style={...r.style,layout:{...r.style.layout,columnSpan:isNaN(a)?void 0:a}}}if(typeof t.style?.layout?.rowSpan=="string"){let a=parseInt(t.style.layout.rowSpan,10);r.style={...r.style,layout:{...r.style.layout,rowSpan:isNaN(a)?void 0:a}}}return[e,r]}function Yt(e,t){for(var r=t.split("."),a;a=r.shift();){if(!(a in e))return;e=e[a]}return e}var Fs=(function(){var e;return function(){return e||(e=document.implementation.createHTMLDocument("")),e}})();function zr(e,t){if(t){if(typeof e=="string"){var r=Fs();r.body.innerHTML=e,e=r.body}if(typeof t=="function")return t(e);if(Object===t.constructor)return Object.keys(t).reduce(function(a,o){return a[o]=zr(e,t[o]),a},{})}}function Qe(e,t){return arguments.length===1&&(t=e,e=void 0),function(r){var a=r;if(e&&(a=r.querySelector(e)),a)return Yt(a,t)}}function Xt(e,t){return arguments.length===1&&(t=e,e=void 0),function(r){var a=Qe(e,"attributes")(r);if(a&&a.hasOwnProperty(t))return a[t].value}}function Zt(e){return Qe(e,"textContent")}function Qt(e,t){return function(r){var a=r.querySelectorAll(e);return[].map.call(a,function(o){return zr(o,t)})}}function Oo(e,t){var r=0,a,o;t=t||{};function s(){var c=a,h=arguments.length,_,b;e:for(;c;){if(c.args.length!==arguments.length){c=c.next;continue}for(b=0;b<h;b++)if(c.args[b]!==arguments[b]){c=c.next;continue e}return c!==a&&(c===o&&(o=c.prev),c.prev.next=c.next,c.next&&(c.next.prev=c.prev),c.next=a,c.prev=null,a.prev=c,a=c),c.val}for(_=new Array(h),b=0;b<h;b++)_[b]=arguments[b];return c={args:_,val:e.apply(null,_)},a?(a.prev=c,c.next=a):o=c,r===t.maxSize?(o=o.prev,o.next=null):r++,a=c,c.val}return s.clear=function(){a=null,o=null,r=0},s}var Io=B(We(),1),Vo=B(xe(),1);var en=B(xe(),1);var Je=B(J(),1);var Do=B(De(),1),ze=B(J(),1);function $s(e){return(0,ze.default)("wp.blocks.children.getChildrenArray",{since:"6.1",version:"6.3",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),e}function Gs(...e){(0,ze.default)("wp.blocks.children.concat",{since:"6.1",version:"6.3",alternative:"wp.richText.concat",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"});let t=[];for(let r=0;r<e.length;r++){let a=Array.isArray(e[r])?e[r]:[e[r]];for(let o=0;o<a.length;o++){let s=a[o];typeof s=="string"&&typeof t[t.length-1]=="string"?t[t.length-1]+=s:t.push(s)}}return t}function qr(e){(0,ze.default)("wp.blocks.children.fromDOM",{since:"6.1",version:"6.3",alternative:"wp.richText.create",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"});let t=[];for(let r=0;r<e.length;r++)try{t.push(Vr(e[r]))}catch{}return t}function Jt(e){(0,ze.default)("wp.blocks.children.toHTML",{since:"6.1",version:"6.3",alternative:"wp.richText.toHTMLString",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"});let t=e;return(0,Do.renderToString)(t)}function Ir(e){return(0,ze.default)("wp.blocks.children.matcher",{since:"6.1",version:"6.3",alternative:"html source",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),t=>{let r=t;return e&&(r=t.querySelector(e)),r?qr(r.childNodes):[]}}var Mo={concat:Gs,getChildrenArray:$s,fromDOM:qr,toHTML:Jt,matcher:Ir};function Ys(e,t){return(0,Je.default)("wp.blocks.node.isNodeOfType",{since:"6.1",version:"6.3",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),e&&e.type===t}function Xs(e){let t={};for(let r=0;r<e.length;r++){let{name:a,value:o}=e[r];t[a]=o}return t}function Vr(e){if((0,Je.default)("wp.blocks.node.fromDOM",{since:"6.1",version:"6.3",alternative:"wp.richText.create",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),e.nodeType===e.TEXT_NODE)return e.nodeValue;if(e.nodeType!==e.ELEMENT_NODE)throw new TypeError("A block node can only be created from a node of type text or element.");return{type:e.nodeName.toLowerCase(),props:{...Xs(e.attributes),children:qr(e.childNodes)}}}function Zs(e){return(0,Je.default)("wp.blocks.node.toHTML",{since:"6.1",version:"6.3",alternative:"wp.richText.toHTMLString",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),Jt([e])}function xr(e){return(0,Je.default)("wp.blocks.node.matcher",{since:"6.1",version:"6.3",alternative:"html source",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),t=>{let r=t;e&&(r=t.querySelector(e));try{return Vr(r)}catch{return null}}}var jo={isNodeOfType:Ys,fromDOM:Vr,toHTML:Zs,matcher:xr};function zo(e,t){return r=>{let a=r;if(e&&(a=r.querySelector(e)),!a)return"";if(t){let o="",s=a.children.length;for(let c=0;c<s;c++){let h=a.children[c];h.nodeName.toLowerCase()===t&&(o+=h.outerHTML)}return o}return a.innerHTML}}var qo=(e,t)=>r=>{let a=e?r.querySelector(e):r;return a?en.RichTextData.fromHTMLElement(a,{preserveWhiteSpace:t}):en.RichTextData.empty()};var Qs=e=>t=>e(t)!==void 0;function Js(e,t){switch(t){case"rich-text":return e instanceof Vo.RichTextData;case"string":return typeof e=="string";case"boolean":return typeof e=="boolean";case"object":return!!e&&e.constructor===Object;case"null":return e===null;case"array":return Array.isArray(e);case"integer":case"number":return typeof e=="number"}return!0}function ed(e,t){return t.some(r=>Js(e,r))}function rd(e,t,r,a,o){let s;switch(t.source){case void 0:s=a?a[e]:void 0;break;case"raw":s=o;break;case"attribute":case"property":case"html":case"text":case"rich-text":case"children":case"node":case"query":case"tag":s=Le(r,t);break}return(!td(s,t.type)||!nd(s,t.enum))&&(s=void 0),s===void 0&&(s=wt(t)),s}function td(e,t){return t===void 0||ed(e,Array.isArray(t)?t:[t])}function nd(e,t){return!Array.isArray(t)||t.includes(e)}var xo=Oo(e=>{switch(e.source){case"attribute":{let r=Xt(e.selector,e.attribute);return e.type==="boolean"&&(r=Qs(r)),r}case"html":return zo(e.selector,e.multiline);case"text":return Zt(e.selector);case"rich-text":return qo(e.selector,e.__unstablePreserveWhiteSpace);case"children":return Ir(e.selector);case"node":return xr(e.selector);case"query":let t=Object.fromEntries(Object.entries(e.query).map(([r,a])=>[r,xo(a)]));return Qt(e.selector,t);case"tag":{let r=Qe(e.selector,"nodeName");return a=>r(a)?.toLowerCase()}default:console.error(`Unknown source type "${e.source}"`)}});function Ho(e){return zr(e,t=>t)}function Le(e,t){return xo(t)(Ho(e))}function ie(e,t,r={}){let a=Ho(t),o=de(e),s=Object.fromEntries(Object.entries(o.attributes??{}).map(([c,h])=>[c,rd(c,h,a,r,t)]));return(0,Io.applyFilters)("blocks.getBlockAttributes",s,o,t,r)}var ad={type:"string",source:"attribute",selector:"[data-custom-class-name] > *",attribute:"class"};function Uo(e){let t=Le(`<div data-custom-class-name>${e}</div>`,ad);return t?t.trim().split(/\s+/):[]}function Fo(e,t,r){if(!se(t,"customClassName",!0))return e;let a={...e},{className:o,...s}=a,c=ge(t,s),h=Uo(c),b=Uo(r).filter(E=>!h.includes(E));return b.length?a.className=b.join(" "):c&&delete a.className,a}function od(e,t,r){return Le(`<div ${t}>${e}</div>`,r)}function rn(e,t,r,a,o,s){if(!se(t,a,!1))return e;let c={...e},h=od(r,o,s);return h&&(c[a]=h),c}var ud={type:"string",source:"attribute",selector:"[data-aria-label] > *",attribute:"aria-label"},id={type:"string",source:"attribute",selector:"[data-anchor] > *",attribute:"id"};function Pe(e,t){let{attributes:r,originalContent:a}=e,o=r;return o=Fo(r,t,a),o=rn(o,t,a,"ariaLabel","data-aria-label",ud),o=rn(o,t,a,"anchor","data-anchor",id),{...e,attributes:o}}function sd(){return!1}function $o(e,t,r){let a=t.attrs,{deprecated:o}=r;if(!o||!o.length)return e;for(let s=0;s<o.length;s++){let{isEligible:c=sd}=o[s];if(e.isValid&&!c(a,e.innerBlocks,{blockNode:t,block:e}))continue;let h=Object.assign(ce(r,He),o[s]),_={...e,attributes:ie(h,e.originalContent,a)},[b]=be(_,h);if(b||(_=Pe(_,h),[b]=be(_,h)),!b)continue;let E=_.innerBlocks,L=_.attributes,{migrate:N}=h;if(N){let j=N(L,e.innerBlocks);Array.isArray(j)||(j=[j]),[L=a,E=e.innerBlocks]=j}e={...e,attributes:L,innerBlocks:E,isValid:!0,validationIssues:[]}}return e}function dd(e){let[t,r]=jr(e.blockName,e.attrs);return{...e,blockName:t,attrs:r}}function cd(e,t){let r=ee(),a=e.blockName||ee(),o=e.attrs||{},s=e.innerBlocks||[],c=e.innerHTML.trim();return a===r&&a==="core/freeform"&&!t?.__unstableSkipAutop&&(c=(0,Ko.autop)(c).trim()),{...e,blockName:a,attrs:o,innerHTML:c,innerBlocks:s}}function ld(e){let t=me()||ee(),r=we(e,{isCommentDelimited:!1}),a=we(e,{isCommentDelimited:!0});return{blockName:t,attrs:{originalName:e.blockName,originalContent:a,originalUndelimitedContent:r},innerHTML:e.blockName?a:e.innerHTML,innerBlocks:e.innerBlocks,innerContent:e.innerContent}}function fd(e,t){let[r]=be(e,t);if(r)return{...e,isValid:r,validationIssues:[]};let a=Pe(e,t),[o,s]=be(a,t);return{...a,isValid:o,validationIssues:s}}function Hr(e,t){let r=cd(e,t);r=dd(r);let a=M(r.blockName);a||(r=ld(r),a=M(r.blockName));let o=r.blockName===ee()||r.blockName===me();if(!a||!r.innerHTML&&o)return;let s=r.innerBlocks.map(E=>Hr(E,t)).filter(E=>!!E),c=U(r.blockName,ie(a,r.innerHTML,r.attrs),s);c.originalContent=r.innerHTML;let h=fd(c,a),{validationIssues:_}=h,b=$o(h,r,a);return b.isValid||(b.__unstableBlockSource=e),!h.isValid&&b.isValid&&!t?.__unstableSkipMigrationLogs?(console.groupCollapsed("Updated Block: %s",a.name),console.info(`Block successfully updated for \`%s\` (%o). New content generated by \`save\` function: %s Content retrieved from post body: %s`,a.name,a,ge(a,b.attributes),b.originalContent),console.groupEnd()):!h.isValid&&!b.isValid&&_.forEach(({log:E,args:L})=>E(...L)),b}function Ee(e,t){return(0,Go.parse)(e).reduce((r,a)=>{let o=Hr(a,t);return o&&r.push(o),r},[])}var Bu=B(J(),1),Au=B(Z(),1);var Wo=B(De(),1);function Ur(){return ue("from").filter(({type:e})=>e==="raw").map(e=>e.isMatch?e:{...e,isMatch:t=>e.selector&&t.matches(e.selector)})}function Fr(e,t){let r=document.implementation.createHTMLDocument("");return r.body.innerHTML=e,Array.from(r.body.children).flatMap(a=>{let o=he(Ur(),({isMatch:h})=>h(a));if(!o)return Wo.Platform.isNative?Ee(`<!-- wp:html -->${a.outerHTML}<!-- /wp:html -->`):U("core/html",ie("core/html",a.outerHTML));let{transform:s,blockName:c}=o;if(s){let h=s(a,t);return a.hasAttribute("class")&&(h.attributes.className=a.getAttribute("class")),h}return U(c,ie(c,a.outerHTML))})}var er=B(Z(),1);function Te(e,t={}){let r=document.implementation.createHTMLDocument(""),a=document.implementation.createHTMLDocument(""),o=r.body,s=a.body;for(o.innerHTML=e;o.firstChild;){let c=o.firstChild;c.nodeType===c.TEXT_NODE?(0,er.isEmpty)(c)?o.removeChild(c):((!s.lastChild||s.lastChild.nodeName!=="P")&&s.appendChild(a.createElement("P")),s.lastChild.appendChild(c)):c.nodeType===c.ELEMENT_NODE?c.nodeName==="BR"?(c.nextSibling&&c.nextSibling.nodeName==="BR"&&(s.appendChild(a.createElement("P")),o.removeChild(c.nextSibling)),s.lastChild&&s.lastChild.nodeName==="P"&&s.lastChild.hasChildNodes()?s.lastChild.appendChild(c):o.removeChild(c)):c.nodeName==="P"?(0,er.isEmpty)(c)&&!t.raw?o.removeChild(c):s.appendChild(c):(0,er.isPhrasingContent)(c)?((!s.lastChild||s.lastChild.nodeName!=="P")&&s.appendChild(a.createElement("P")),s.lastChild.appendChild(c)):s.appendChild(c):o.removeChild(c)}return s.innerHTML}var rr=B(Z(),1);function $r(e,t){if(e.nodeType!==e.COMMENT_NODE||e.nodeValue!=="nextpage"&&e.nodeValue.indexOf("more")!==0)return;let r=pd(e,t);if(!e.parentNode||e.parentNode.nodeName!=="P")(0,rr.replace)(e,r);else{let a=Array.from(e.parentNode.childNodes),o=a.indexOf(e),s=e.parentNode.parentNode||t.body,c=(h,_)=>(h||(h=t.createElement("p")),h.appendChild(_),h);[a.slice(0,o).reduce(c,null),r,a.slice(o+1).reduce(c,null)].forEach(h=>h&&s.insertBefore(h,e.parentNode)),(0,rr.remove)(e.parentNode)}}function pd(e,t){if(e.nodeValue==="nextpage")return hd(t);let r=e.nodeValue.slice(4).trim(),a=e,o=!1;for(;a=a.nextSibling;)if(a.nodeType===a.COMMENT_NODE&&a.nodeValue==="noteaser"){o=!0,(0,rr.remove)(a);break}return md(r,o,t)}function md(e,t,r){let a=r.createElement("wp-block");return a.dataset.block="core/more",e&&(a.dataset.customText=e),t&&(a.dataset.noTeaser=""),a}function hd(e){let t=e.createElement("wp-block");return t.dataset.block="core/nextpage",t}var Xo=B(Z(),1);function Yo(e){return e.nodeName==="OL"||e.nodeName==="UL"}function gd(e){return Array.from(e.childNodes).map(({nodeValue:t=""})=>t).join("")}function Gr(e){if(!Yo(e))return;let t=e,r=e.previousElementSibling;if(r&&r.nodeName===e.nodeName&&t.children.length===1){for(;t.firstChild;)r.appendChild(t.firstChild);t.parentNode.removeChild(t)}let a=e.parentNode;if(a&&a.nodeName==="LI"&&a.children.length===1&&!/\S/.test(gd(a))){let o=a,s=o.previousElementSibling,c=o.parentNode;s&&(s.appendChild(t),c.removeChild(o))}if(a&&Yo(a)){let o=e.previousElementSibling;o?o.appendChild(e):(0,Xo.unwrap)(e)}}function Kr(e){return t=>{t.nodeName==="BLOCKQUOTE"&&(t.innerHTML=Te(t.innerHTML,e))}}var Zo=B(Z(),1);function bd(e,t){let r=e.nodeName.toLowerCase();return r==="figcaption"||(0,Zo.isTextContent)(e)?!1:r in(t?.figure?.children??{})}function _d(e,t){return e.nodeName.toLowerCase()in(t?.figure?.children?.a?.children??{})}function tn(e,t=e){let r=e.ownerDocument.createElement("figure");t.parentNode.insertBefore(r,t),r.appendChild(e)}function Wr(e,t,r){if(!bd(e,r))return;let a=e,o=e.parentNode;_d(e,r)&&o.nodeName==="A"&&o.childNodes.length===1&&(a=e.parentNode);let s=a.closest("p,div");s?e.classList?(e.classList.contains("alignright")||e.classList.contains("alignleft")||e.classList.contains("aligncenter")||!s.textContent.trim())&&tn(a,s):tn(a,s):tn(a)}var nr=B(Jo(),1);var eu=e=>Array.isArray(e)?e:[e],ru=/(\n|<p>)\s*$/,tu=/^\s*(\n|<\/p>)/;function tr(e,t=0,r=[]){let a=ue("from"),o=he(a,b=>r.indexOf(b.blockName)===-1&&b.type==="shortcode"&&eu(b.tag).some(E=>(0,nr.regexp)(E).test(e)));if(!o)return[e];let c=eu(o.tag).find(b=>(0,nr.regexp)(b).test(e)),h,_=t;if(h=(0,nr.next)(c,e,t)){t=h.index+h.content.length;let b=e.substr(0,h.index),E=e.substr(t);if(!h.shortcode.content?.includes("<")&&!(ru.test(b)&&tu.test(E)))return tr(e,t);if(o.isMatch&&!o.isMatch(h.shortcode.attrs))return tr(e,_,[...r,o.blockName]);let L=[];if(typeof o.transform=="function")L=[].concat(o.transform(h.shortcode.attrs,h)),L=L.map(N=>(N.originalContent=h.shortcode.content,Pe(N,M(N.name))));else{let N=Object.fromEntries(Object.entries(o.attributes).filter(([,Ce])=>Ce.shortcode).map(([Ce,ur])=>[Ce,ur.shortcode(h.shortcode.attrs,h)])),j=M(o.blockName);if(!j)return[e];let I={...j,attributes:o.attributes},G=U(o.blockName,ie(I,h.shortcode.content,N));G.originalContent=h.shortcode.content,G=Pe(G,I),L=[G]}return[...tr(b.replace(ru,"")),...L,...tr(E.replace(tu,""))]}return[e]}var Yr=tr;var ar=B(Z(),1);function yd(e,t){let a={phrasingContentSchema:(0,ar.getPhrasingContentSchema)(t),isPaste:t==="paste"},o=e.map(({isMatch:_,blockName:b,schema:E})=>{let L=se(b,"anchor");return E=typeof E=="function"?E(a):E,!L&&!_?E:E?Object.fromEntries(Object.entries(E).map(([N,j])=>{let I=j.attributes||[];return L&&(I=[...I,"id"]),[N,{...j,attributes:I,isMatch:_||void 0}]})):{}});function s(_,b,E){switch(E){case"children":return _==="*"||b==="*"?"*":{..._,...b};case"attributes":case"require":return[..._||[],...b||[]];case"isMatch":return!_||!b?void 0:(...L)=>_(...L)||b(...L)}}function c(_,b){for(let E in b)_[E]=_[E]?s(_[E],b[E],E):{...b[E]};return _}function h(_,b){for(let E in b)_[E]=_[E]?c(_[E],b[E]):{...b[E]};return _}return o.reduce(h,{})}function Xr(e){return yd(Ur(),e)}function nu(e){if(!/<(?!br[ />])/i.test(e))return!0;let t=document.implementation.createHTMLDocument("");if(t.body.innerHTML=e,t.body.children.length!==1)return!1;let r=t.body.children.item(0),a=r.getElementsByTagName("*");for(let o=0;o<a.length;o++)if(a.item(o).tagName!=="BR")return!1;return r.tagName==="SPAN"}function au(e,t,r,a){Array.from(e).forEach(o=>{au(o.childNodes,t,r,a),t.forEach(s=>{r.contains(o)&&s(o,r,a)})})}function le(e,t=[],r){let a=document.implementation.createHTMLDocument("");return a.body.innerHTML=e,au(a.body.childNodes,t,a,r),a.body.innerHTML}function qe(e,t){let r=e[`${t}Sibling`];if(r&&(0,ar.isPhrasingContent)(r))return r;let{parentNode:a}=e;if(!(!a||!(0,ar.isPhrasingContent)(a)))return qe(a,t)}var Re=B(Z(),1);var ou=B(Z(),1);function nn(e){e.nodeType===e.COMMENT_NODE&&(0,ou.remove)(e)}var uu=B(Z(),1);function wd(e,t){if((0,uu.isTextContent)(e))return!0;if(!t)return!1;let r=e.nodeName.toLowerCase();return[["ul","li","ol"],["h1","h2","h3","h4","h5","h6"]].some(o=>[r,t].filter(s=>!o.includes(s)).length===0)}function iu(e,t){return e.every(r=>wd(r,t)&&iu(Array.from(r.children),t))}function kd(e){return e.nodeName==="BR"&&e.previousSibling&&e.previousSibling.nodeName==="BR"}function su(e,t){let r=document.implementation.createHTMLDocument("");r.body.innerHTML=e;let a=Array.from(r.body.children);return!a.some(kd)&&iu(a,t)}var _e=B(Z(),1);function an(e,t){if(e.nodeName==="SPAN"&&e.style){let{fontWeight:r,fontStyle:a,textDecorationLine:o,textDecoration:s,verticalAlign:c}=e.style;(r==="bold"||r==="700")&&(0,_e.wrap)(t.createElement("strong"),e),a==="italic"&&(0,_e.wrap)(t.createElement("em"),e),(o==="line-through"||s.includes("line-through"))&&(0,_e.wrap)(t.createElement("s"),e),c==="super"?(0,_e.wrap)(t.createElement("sup"),e):c==="sub"&&(0,_e.wrap)(t.createElement("sub"),e)}else e.nodeName==="B"?e=(0,_e.replaceTag)(e,"strong"):e.nodeName==="I"?e=(0,_e.replaceTag)(e,"em"):e.nodeName==="A"&&(e.target&&e.target.toLowerCase()==="_blank"?e.rel="noreferrer noopener":(e.removeAttribute("target"),e.removeAttribute("rel")),e.name&&!e.id&&(e.id=e.name),e.id&&!e.ownerDocument.querySelector(`[href="#${e.id}"]`)&&e.removeAttribute("id"))}function on(e){e.nodeName!=="SCRIPT"&&e.nodeName!=="NOSCRIPT"&&e.nodeName!=="TEMPLATE"&&e.nodeName!=="STYLE"||e.parentNode.removeChild(e)}function Zr(e){if(e.nodeType!==e.ELEMENT_NODE)return;let t=e.getAttribute("style");if(!t||!t.includes("mso-list"))return;t.split(";").reduce((a,o)=>{let[s,c]=o.split(":");return s&&c&&(a[s.trim().toLowerCase()]=c.trim().toLowerCase()),a},{})["mso-list"]==="ignore"&&e.remove()}function un(e){return e.nodeName==="OL"||e.nodeName==="UL"}function du(e,t){if(e.nodeName!=="P")return;let r=e.getAttribute("style");if(!r||!r.includes("mso-list"))return;let a=e.previousElementSibling;if(!a||!un(a)){let E=e.textContent.trim().slice(0,1),L=/[1iIaA]/.test(E),N=t.createElement(L?"ol":"ul");L&&N.setAttribute("type",E),e.parentNode.insertBefore(N,e)}let o=e.previousElementSibling,s=o.nodeName,c=t.createElement("li"),h=o;c.innerHTML=le(e.innerHTML,[Zr]);let _=/mso-list\s*:[^;]+level([0-9]+)/i.exec(r),b=_&&parseInt(_[1],10)-1||0;for(;b--;)h=h.lastChild||h,un(h)&&(h=h.lastChild||h);un(h)||(h=h.appendChild(t.createElement(s))),h.appendChild(c),e.parentNode.removeChild(e)}var fu=B(lu(),1);function pu(e){if(e.nodeName==="IMG"){if(e.src.indexOf("file:")===0&&(e.src=""),e.src.indexOf("data:")===0){let[t,r]=e.src.split(","),[a]=t.slice(5).split(";");if(!r||!a){e.src="";return}let o;try{o=atob(r)}catch{e.src="";return}let s=new Uint8Array(o.length);for(let _=0;_<s.length;_++)s[_]=o.charCodeAt(_);let c=a.replace("/","."),h=new window.File([s],c,{type:a});e.src=(0,fu.createBlobURL)(h)}(e.height===1||e.width===1)&&e.parentNode.removeChild(e)}}function mu(e){e.nodeName==="DIV"&&(e.innerHTML=Te(e.innerHTML))}var bu=B(gu(),1),vd=new bu.default.Converter({noHeaderId:!0,tables:!0,literalMidWordUnderscores:!0,omitExtraWLInCodeBlocks:!0,simpleLineBreaks:!0,strikethrough:!0});function Ed(e){return e.replace(/((?:^|\n)```)([^\n`]+)(```(?:$|\n))/,(t,r,a,o)=>`${r} ${a} ${o}`)}function Td(e){return e.replace(/(^|\n)•( +)/g,"$1*$2")}function _u(e){return vd.makeHtml(Ed(Td(e)))}function yu(e){if(e.nodeName==="IFRAME"){let t=e.ownerDocument.createTextNode(e.src);e.parentNode.replaceChild(t,e)}}var wu=B(Z(),1);function sn(e){!e.id||e.id.indexOf("docs-internal-guid-")!==0||(e.tagName==="B"?(0,wu.unwrap)(e):e.removeAttribute("id"))}function Cd(e){return e===" "||e==="\r"||e===` `||e===" "}function dn(e){if(e.nodeType!==e.TEXT_NODE)return;let t=e;for(;t=t.parentNode;)if(t.nodeType===t.ELEMENT_NODE&&t.nodeName==="PRE")return;let r=e.data.replace(/[ \r\n\t]+/g," ");if(r[0]===" "){let a=qe(e,"previous");(!a||a.nodeName==="BR"||a.textContent.slice(-1)===" ")&&(r=r.slice(1))}if(r[r.length-1]===" "){let a=qe(e,"next");(!a||a.nodeName==="BR"||a.nodeType===a.TEXT_NODE&&Cd(a.textContent[0]))&&(r=r.slice(0,-1))}r?e.data=r:e.parentNode.removeChild(e)}function cn(e){e.nodeName==="BR"&&(qe(e,"next")||e.parentNode.removeChild(e))}function ku(e){e.nodeName==="P"&&(e.hasChildNodes()||e.parentNode.removeChild(e))}function vu(e){if(e.nodeName!=="SPAN"||e.getAttribute("data-stringify-type")!=="paragraph-break")return;let{parentNode:t}=e;t.insertBefore(e.ownerDocument.createElement("br"),e),t.insertBefore(e.ownerDocument.createElement("br"),e),t.removeChild(e)}function Eu(e){let t=/[\p{L}\s]+/gu,r;for(;r=t.exec(e);){if(e[r.index-1]==="{")continue;let o=r[0];if(e[r.index-1]==="\\"&&(o=o.replace(/^[a-zA-Z]+/,"")),!(o.length<6))return!1}return!!(/\\[a-zA-Z]+\s*\{/g.test(e)||[o=>o.includes("^")&&!o.startsWith("^"),o=>["=","+","-","/","*"].some(s=>o.includes(s)),o=>/\\[a-zA-Z]+/g.test(o)].filter(o=>o(e)).length>=2)}function Tu(e){if(e.nodeType===e.ELEMENT_NODE&&e.tagName==="P"&&e.getAttribute("role")==="heading"&&e.hasAttribute("aria-level")){let t=parseInt(e.getAttribute("aria-level"),10);if(t>=1&&t<=6){let r=`H${t}`,a=e.ownerDocument.createElement(r);for(Array.from(e.attributes).forEach(o=>{o.name!=="role"&&o.name!=="aria-level"&&a.setAttribute(o.name,o.value)});e.firstChild;)a.appendChild(e.firstChild);e.parentNode.replaceChild(a,e)}}}var Jr=(...e)=>window?.console?.log?.(...e);function Cu(e){return e=le(e,[on,sn,Zr,an,nn]),e=(0,Re.removeInvalidHTML)(e,(0,Re.getPhrasingContentSchema)("paste"),{inline:!0}),e=le(e,[dn,cn]),Jr(`Processed inline HTML: `,e),e}function et({HTML:e="",plainText:t="",mode:r="AUTO",tagName:a}){if(Jr(`Received HTML (pasteHandler): `,e),Jr(`Received plain text (pasteHandler): `,t),e=e.replace(/<meta[^>]+>/g,""),e=e.replace(/^\s*<html[^>]*>\s*<body[^>]*>(?:\s*<!--\s*StartFragment\s*-->)?/i,""),e=e.replace(/(?:<!--\s*EndFragment\s*-->\s*)?<\/body>\s*<\/html>\s*$/i,""),r!=="INLINE"){let E=e||t;if(E.indexOf("<!-- wp:")!==-1){let L=Ee(E);if(!(L.length===1&&L[0].name==="core/freeform"))return L}}String.prototype.normalize&&(e=e.normalize()),e=le(e,[vu]);let o=t&&(!e||nu(e));if(o&&Eu(t))return[U("core/math",{latex:t})];o&&(e=t,/^\s+$/.test(t)||(e=_u(e)));let s=Yr(e),c=s.length>1;if(o&&!c&&r==="AUTO"&&t.indexOf(` `)===-1&&t.indexOf("<p>")!==0&&e.indexOf("<p>")===0&&(r="INLINE"),r==="INLINE"||r==="AUTO"&&!c&&su(e,a))return Cu(e);let h=(0,Re.getPhrasingContentSchema)("paste"),_=Xr("paste"),b=s.map(E=>{if(typeof E!="string")return E;let L=[sn,du,on,Gr,pu,an,$r,nn,yu,Wr,Kr(),mu,Tu],N={..._,...h};return E=le(E,L,_),E=(0,Re.removeInvalidHTML)(E,N),E=Te(E),E=le(E,[dn,cn,ku],_),Jr(`Processed HTML piece: `,E),Fr(E,et)}).flat().filter(Boolean);if(r==="AUTO"&&b.length===1&&se(b[0].name,"__unstablePasteTextInline",!1)){let E=/^[\n]+|[\n]+$/g,L=t.replace(E,"");if(L!==""&&L.indexOf(` `)===-1)return(0,Re.removeInvalidHTML)(Xe(b[0]),h).replace(E,"")}return b}function Su(e){return(0,Bu.default)("wp.blocks.getPhrasingContentSchema",{since:"5.6",alternative:"wp.dom.getPhrasingContentSchema"}),(0,Au.getPhrasingContentSchema)(e)}function ln({HTML:e=""}){if(e.indexOf("<!-- wp:")!==-1){let a=Ee(e);if(!(a.length===1&&a[0].name==="core/freeform"))return a}let t=Yr(e),r=Xr();return t.map(a=>{if(typeof a!="string")return a;let o=[Gr,$r,Wr,Kr({raw:!0})];return a=le(a,o,r),a=Te(a,{raw:!0}),Fr(a,ln)}).flat().filter(Boolean)}var or=B(Be(),1);function Nu(){return(0,or.select)(P).getCategories()}function Lu(e){(0,or.dispatch)(P).setCategories(e)}function Pu(e,t){(0,or.dispatch)(P).updateCategory(e,t)}var Ru=B(De(),1);function fn(e=[],t=[]){return e.length===t.length&&t.every(([r,,a],o)=>{let s=e[o];return r===s.name&&fn(s.innerBlocks,a)})}var Bd=e=>e?.source==="html",Ad=e=>e?.source==="query";function Ou(e,t){return t?Object.fromEntries(Object.entries(t).map(([r,a])=>[r,Sd(e[r],a)])):{}}function Sd(e,t){return Bd(e)&&Array.isArray(t)?(0,Ru.renderToString)(t):Ad(e)&&t?t.map(r=>Ou(e.query,r)):t}function rt(e=[],t){return t?t.map(([r,a,o],s)=>{let c=e[s];if(c&&c.name===r){let L=rt(c.innerBlocks,o);return{...c,innerBlocks:L}}let h=M(r),_=Ou(h?.attributes??{},a),[b,E]=jr(r,_);return U(b,E,rt([],o))}):e}var Nd=Symbol("fields"),Ld=Symbol("form"),Du={};Gn(Du,{isContentBlock:wa,fieldsKey:Nd,formKey:Ld,parseRawBlock:Hr});var Mu=B(J(),1);function Pd(e){return(0,Mu.default)("wp.blocks.withBlockContentContext",{since:"6.1"}),e}return Hu(Rd);})(); /*! Bundled license information: react-is/cjs/react-is.production.min.js: (** * @license React * react-is.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. *) showdown/dist/showdown.js: (*! showdown v 1.9.1 - 02-11-2019 *) is-plain-object/dist/is-plain-object.mjs: (*! * is-plain-object <https://github.com/jonschlinkert/is-plain-object> * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. *) */ edit-widgets.js 0000644 00000500376 15206720414 0007507 0 ustar 00 var wp; (wp ||= {}).editWidgets = (() => { 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 __export = (target, all) => { for (var name2 in all) __defProp(target, name2, { get: all[name2], enumerable: true }); }; 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 )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // package-external:@wordpress/blocks var require_blocks = __commonJS({ "package-external:@wordpress/blocks"(exports, module) { module.exports = window.wp.blocks; } }); // package-external:@wordpress/data var require_data = __commonJS({ "package-external:@wordpress/data"(exports, module) { module.exports = window.wp.data; } }); // package-external:@wordpress/deprecated var require_deprecated = __commonJS({ "package-external:@wordpress/deprecated"(exports, module) { module.exports = window.wp.deprecated; } }); // package-external:@wordpress/element var require_element = __commonJS({ "package-external:@wordpress/element"(exports, module) { module.exports = window.wp.element; } }); // package-external:@wordpress/block-library var require_block_library = __commonJS({ "package-external:@wordpress/block-library"(exports, module) { module.exports = window.wp.blockLibrary; } }); // package-external:@wordpress/core-data var require_core_data = __commonJS({ "package-external:@wordpress/core-data"(exports, module) { module.exports = window.wp.coreData; } }); // package-external:@wordpress/widgets var require_widgets = __commonJS({ "package-external:@wordpress/widgets"(exports, module) { module.exports = window.wp.widgets; } }); // package-external:@wordpress/preferences var require_preferences = __commonJS({ "package-external:@wordpress/preferences"(exports, module) { module.exports = window.wp.preferences; } }); // 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/i18n var require_i18n = __commonJS({ "package-external:@wordpress/i18n"(exports, module) { module.exports = window.wp.i18n; } }); // package-external:@wordpress/notices var require_notices = __commonJS({ "package-external:@wordpress/notices"(exports, module) { module.exports = window.wp.notices; } }); // package-external:@wordpress/components var require_components = __commonJS({ "package-external:@wordpress/components"(exports, module) { module.exports = window.wp.components; } }); // 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/viewport var require_viewport = __commonJS({ "package-external:@wordpress/viewport"(exports, module) { module.exports = window.wp.viewport; } }); // package-external:@wordpress/compose var require_compose = __commonJS({ "package-external:@wordpress/compose"(exports, module) { module.exports = window.wp.compose; } }); // package-external:@wordpress/plugins var require_plugins = __commonJS({ "package-external:@wordpress/plugins"(exports, module) { module.exports = window.wp.plugins; } }); // 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/block-editor var require_block_editor = __commonJS({ "package-external:@wordpress/block-editor"(exports, module) { module.exports = window.wp.blockEditor; } }); // package-external:@wordpress/hooks var require_hooks = __commonJS({ "package-external:@wordpress/hooks"(exports, module) { module.exports = window.wp.hooks; } }); // package-external:@wordpress/media-utils var require_media_utils = __commonJS({ "package-external:@wordpress/media-utils"(exports, module) { module.exports = window.wp.mediaUtils; } }); // package-external:@wordpress/patterns var require_patterns = __commonJS({ "package-external:@wordpress/patterns"(exports, module) { module.exports = window.wp.patterns; } }); // package-external:@wordpress/keyboard-shortcuts var require_keyboard_shortcuts = __commonJS({ "package-external:@wordpress/keyboard-shortcuts"(exports, module) { module.exports = window.wp.keyboardShortcuts; } }); // package-external:@wordpress/keycodes var require_keycodes = __commonJS({ "package-external:@wordpress/keycodes"(exports, module) { module.exports = window.wp.keycodes; } }); // package-external:@wordpress/url var require_url = __commonJS({ "package-external:@wordpress/url"(exports, module) { module.exports = window.wp.url; } }); // package-external:@wordpress/dom var require_dom = __commonJS({ "package-external:@wordpress/dom"(exports, module) { module.exports = window.wp.dom; } }); // packages/edit-widgets/build-module/index.mjs var index_exports = {}; __export(index_exports, { initialize: () => initialize, initializeEditor: () => initializeEditor, reinitializeEditor: () => reinitializeEditor, store: () => store2 }); var import_blocks3 = __toESM(require_blocks(), 1); var import_data32 = __toESM(require_data(), 1); var import_deprecated6 = __toESM(require_deprecated(), 1); var import_element25 = __toESM(require_element(), 1); var import_block_library2 = __toESM(require_block_library(), 1); var import_core_data12 = __toESM(require_core_data(), 1); var import_widgets5 = __toESM(require_widgets(), 1); var import_preferences10 = __toESM(require_preferences(), 1); // packages/edit-widgets/build-module/store/index.mjs var import_api_fetch = __toESM(require_api_fetch(), 1); var import_data8 = __toESM(require_data(), 1); // packages/edit-widgets/build-module/store/reducer.mjs var import_data = __toESM(require_data(), 1); function widgetAreasOpenState(state = {}, action) { const { type } = action; switch (type) { case "SET_WIDGET_AREAS_OPEN_STATE": { return action.widgetAreasOpenState; } case "SET_IS_WIDGET_AREA_OPEN": { const { clientId, isOpen } = action; return { ...state, [clientId]: isOpen }; } default: { return state; } } } function blockInserterPanel(state = false, action) { switch (action.type) { case "SET_IS_LIST_VIEW_OPENED": return action.isOpen ? false : state; case "SET_IS_INSERTER_OPENED": return action.value; } return state; } function listViewPanel(state = false, action) { switch (action.type) { case "SET_IS_INSERTER_OPENED": return action.value ? false : state; case "SET_IS_LIST_VIEW_OPENED": return action.isOpen; } return state; } function listViewToggleRef(state = { current: null }) { return state; } function inserterSidebarToggleRef(state = { current: null }) { return state; } function widgetSavingLock(state = {}, action) { switch (action.type) { case "LOCK_WIDGET_SAVING": return { ...state, [action.lockName]: true }; case "UNLOCK_WIDGET_SAVING": { const { [action.lockName]: removedLockName, ...restState } = state; return restState; } } return state; } var reducer_default = (0, import_data.combineReducers)({ blockInserterPanel, inserterSidebarToggleRef, listViewPanel, listViewToggleRef, widgetAreasOpenState, widgetSavingLock }); // packages/edit-widgets/build-module/store/resolvers.mjs var resolvers_exports = {}; __export(resolvers_exports, { getWidgetAreas: () => getWidgetAreas, getWidgets: () => getWidgets }); var import_blocks2 = __toESM(require_blocks(), 1); var import_core_data2 = __toESM(require_core_data(), 1); // packages/edit-widgets/build-module/store/actions.mjs var actions_exports2 = {}; __export(actions_exports2, { closeGeneralSidebar: () => closeGeneralSidebar, lockWidgetSaving: () => lockWidgetSaving, moveBlockToWidgetArea: () => moveBlockToWidgetArea, persistStubPost: () => persistStubPost, saveEditedWidgetAreas: () => saveEditedWidgetAreas, saveWidgetArea: () => saveWidgetArea, saveWidgetAreas: () => saveWidgetAreas, setIsInserterOpened: () => setIsInserterOpened, setIsListViewOpened: () => setIsListViewOpened, setIsWidgetAreaOpen: () => setIsWidgetAreaOpen, setWidgetAreasOpenState: () => setWidgetAreasOpenState, setWidgetIdForClientId: () => setWidgetIdForClientId, unlockWidgetSaving: () => unlockWidgetSaving }); var import_i18n3 = __toESM(require_i18n(), 1); var import_notices = __toESM(require_notices(), 1); // node_modules/clsx/dist/clsx.mjs function r(e) { var t, f, n = ""; if ("string" == typeof e || "number" == typeof e) n += e; else if ("object" == typeof e) if (Array.isArray(e)) { var o = e.length; for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f); } else for (f in e) e[f] && (n && (n += " "), n += f); return n; } function clsx() { for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t); return n; } var clsx_default = clsx; // packages/interface/build-module/components/complementary-area/index.mjs var import_components5 = __toESM(require_components(), 1); var import_data6 = __toESM(require_data(), 1); var import_i18n = __toESM(require_i18n(), 1); // packages/icons/build-module/library/block-default.mjs var import_primitives = __toESM(require_primitives(), 1); var import_jsx_runtime = __toESM(require_jsx_runtime(), 1); var block_default_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: "M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z" }) }); // packages/icons/build-module/library/check.mjs var import_primitives2 = __toESM(require_primitives(), 1); var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1); var check_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: "M16.5 7.5 10 13.9l-2.5-2.4-1 1 3.5 3.6 7.5-7.6z" }) }); // packages/icons/build-module/library/close-small.mjs var import_primitives3 = __toESM(require_primitives(), 1); var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1); var close_small_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 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z" }) }); // packages/icons/build-module/library/drawer-left.mjs var import_primitives4 = __toESM(require_primitives(), 1); var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1); var drawer_left_default = /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(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, { fillRule: "evenodd", clipRule: "evenodd", d: "M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zM8.5 18.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h2.5v13zm10-.5c0 .3-.2.5-.5.5h-8v-13h8c.3 0 .5.2.5.5v12z" }) }); // packages/icons/build-module/library/drawer-right.mjs var import_primitives5 = __toESM(require_primitives(), 1); var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1); var drawer_right_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: "M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4 14.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h8v13zm4.5-.5c0 .3-.2.5-.5.5h-2.5v-13H18c.3 0 .5.2.5.5v12z" }) }); // packages/icons/build-module/library/external.mjs var import_primitives6 = __toESM(require_primitives(), 1); var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1); var external_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: "M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z" }) }); // packages/icons/build-module/library/list-view.mjs var import_primitives7 = __toESM(require_primitives(), 1); var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1); var list_view_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: "M3 6h11v1.5H3V6Zm3.5 5.5h11V13h-11v-1.5ZM21 17H10v1.5h11V17Z" }) }); // packages/icons/build-module/library/more-vertical.mjs var import_primitives8 = __toESM(require_primitives(), 1); var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1); var more_vertical_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: "M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z" }) }); // packages/icons/build-module/library/plus.mjs var import_primitives9 = __toESM(require_primitives(), 1); var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1); var plus_default = /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_primitives9.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_primitives9.Path, { d: "M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z" }) }); // packages/icons/build-module/library/redo.mjs var import_primitives10 = __toESM(require_primitives(), 1); var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1); var redo_default = /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_primitives10.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_primitives10.Path, { d: "M15.6 6.5l-1.1 1 2.9 3.3H8c-.9 0-1.7.3-2.3.9-1.4 1.5-1.4 4.2-1.4 5.6v.2h1.5v-.3c0-1.1 0-3.5 1-4.5.3-.3.7-.5 1.3-.5h9.2L14.5 15l1.1 1.1 4.6-4.6-4.6-5z" }) }); // packages/icons/build-module/library/star-empty.mjs var import_primitives11 = __toESM(require_primitives(), 1); var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1); var star_empty_default = /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_primitives11.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_primitives11.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z" }) }); // packages/icons/build-module/library/star-filled.mjs var import_primitives12 = __toESM(require_primitives(), 1); var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1); var star_filled_default = /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_primitives12.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_primitives12.Path, { d: "M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z" }) }); // packages/icons/build-module/library/undo.mjs var import_primitives13 = __toESM(require_primitives(), 1); var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1); var undo_default = /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_primitives13.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_primitives13.Path, { d: "M18.3 11.7c-.6-.6-1.4-.9-2.3-.9H6.7l2.9-3.3-1.1-1-4.5 5L8.5 16l1-1-2.7-2.7H16c.5 0 .9.2 1.3.5 1 1 1 3.4 1 4.5v.3h1.5v-.2c0-1.5 0-4.3-1.5-5.7z" }) }); // packages/interface/build-module/components/complementary-area/index.mjs var import_element2 = __toESM(require_element(), 1); var import_viewport = __toESM(require_viewport(), 1); var import_preferences3 = __toESM(require_preferences(), 1); var import_compose = __toESM(require_compose(), 1); var import_plugins2 = __toESM(require_plugins(), 1); // packages/interface/build-module/components/complementary-area-toggle/index.mjs var import_components = __toESM(require_components(), 1); var import_data5 = __toESM(require_data(), 1); var import_plugins = __toESM(require_plugins(), 1); // packages/interface/build-module/store/index.mjs var import_data4 = __toESM(require_data(), 1); // packages/interface/build-module/store/actions.mjs var actions_exports = {}; __export(actions_exports, { closeModal: () => closeModal, disableComplementaryArea: () => disableComplementaryArea, enableComplementaryArea: () => enableComplementaryArea, openModal: () => openModal, pinItem: () => pinItem, setDefaultComplementaryArea: () => setDefaultComplementaryArea, setFeatureDefaults: () => setFeatureDefaults, setFeatureValue: () => setFeatureValue, toggleFeature: () => toggleFeature, unpinItem: () => unpinItem }); var import_deprecated2 = __toESM(require_deprecated(), 1); var import_preferences = __toESM(require_preferences(), 1); // packages/interface/build-module/store/deprecated.mjs var import_deprecated = __toESM(require_deprecated(), 1); function normalizeComplementaryAreaScope(scope) { if (["core/edit-post", "core/edit-site"].includes(scope)) { (0, import_deprecated.default)(`${scope} interface scope`, { alternative: "core interface scope", hint: "core/edit-post and core/edit-site are merging.", version: "6.6" }); return "core"; } return scope; } function normalizeComplementaryAreaName(scope, name2) { if (scope === "core" && name2 === "edit-site/template") { (0, import_deprecated.default)(`edit-site/template sidebar`, { alternative: "edit-post/document", version: "6.6" }); return "edit-post/document"; } if (scope === "core" && name2 === "edit-site/block-inspector") { (0, import_deprecated.default)(`edit-site/block-inspector sidebar`, { alternative: "edit-post/block", version: "6.6" }); return "edit-post/block"; } return name2; } // packages/interface/build-module/store/actions.mjs var setDefaultComplementaryArea = (scope, area) => { scope = normalizeComplementaryAreaScope(scope); area = normalizeComplementaryAreaName(scope, area); return { type: "SET_DEFAULT_COMPLEMENTARY_AREA", scope, area }; }; var enableComplementaryArea = (scope, area) => ({ registry, dispatch: dispatch2 }) => { if (!area) { return; } scope = normalizeComplementaryAreaScope(scope); area = normalizeComplementaryAreaName(scope, area); const isComplementaryAreaVisible = registry.select(import_preferences.store).get(scope, "isComplementaryAreaVisible"); if (!isComplementaryAreaVisible) { registry.dispatch(import_preferences.store).set(scope, "isComplementaryAreaVisible", true); } dispatch2({ type: "ENABLE_COMPLEMENTARY_AREA", scope, area }); }; var disableComplementaryArea = (scope) => ({ registry }) => { scope = normalizeComplementaryAreaScope(scope); const isComplementaryAreaVisible = registry.select(import_preferences.store).get(scope, "isComplementaryAreaVisible"); if (isComplementaryAreaVisible) { registry.dispatch(import_preferences.store).set(scope, "isComplementaryAreaVisible", false); } }; var pinItem = (scope, item) => ({ registry }) => { if (!item) { return; } scope = normalizeComplementaryAreaScope(scope); item = normalizeComplementaryAreaName(scope, item); const pinnedItems = registry.select(import_preferences.store).get(scope, "pinnedItems"); if (pinnedItems?.[item] === true) { return; } registry.dispatch(import_preferences.store).set(scope, "pinnedItems", { ...pinnedItems, [item]: true }); }; var unpinItem = (scope, item) => ({ registry }) => { if (!item) { return; } scope = normalizeComplementaryAreaScope(scope); item = normalizeComplementaryAreaName(scope, item); const pinnedItems = registry.select(import_preferences.store).get(scope, "pinnedItems"); registry.dispatch(import_preferences.store).set(scope, "pinnedItems", { ...pinnedItems, [item]: false }); }; function toggleFeature(scope, featureName) { return function({ registry }) { (0, import_deprecated2.default)(`dispatch( 'core/interface' ).toggleFeature`, { since: "6.0", alternative: `dispatch( 'core/preferences' ).toggle` }); registry.dispatch(import_preferences.store).toggle(scope, featureName); }; } function setFeatureValue(scope, featureName, value) { return function({ registry }) { (0, import_deprecated2.default)(`dispatch( 'core/interface' ).setFeatureValue`, { since: "6.0", alternative: `dispatch( 'core/preferences' ).set` }); registry.dispatch(import_preferences.store).set(scope, featureName, !!value); }; } function setFeatureDefaults(scope, defaults) { return function({ registry }) { (0, import_deprecated2.default)(`dispatch( 'core/interface' ).setFeatureDefaults`, { since: "6.0", alternative: `dispatch( 'core/preferences' ).setDefaults` }); registry.dispatch(import_preferences.store).setDefaults(scope, defaults); }; } function openModal(name2) { return { type: "OPEN_MODAL", name: name2 }; } function closeModal() { return { type: "CLOSE_MODAL" }; } // packages/interface/build-module/store/selectors.mjs var selectors_exports = {}; __export(selectors_exports, { getActiveComplementaryArea: () => getActiveComplementaryArea, isComplementaryAreaLoading: () => isComplementaryAreaLoading, isFeatureActive: () => isFeatureActive, isItemPinned: () => isItemPinned, isModalActive: () => isModalActive }); var import_data2 = __toESM(require_data(), 1); var import_deprecated4 = __toESM(require_deprecated(), 1); var import_preferences2 = __toESM(require_preferences(), 1); var getActiveComplementaryArea = (0, import_data2.createRegistrySelector)( (select) => (state, scope) => { scope = normalizeComplementaryAreaScope(scope); const isComplementaryAreaVisible = select(import_preferences2.store).get( scope, "isComplementaryAreaVisible" ); if (isComplementaryAreaVisible === void 0) { return void 0; } if (isComplementaryAreaVisible === false) { return null; } return state?.complementaryAreas?.[scope]; } ); var isComplementaryAreaLoading = (0, import_data2.createRegistrySelector)( (select) => (state, scope) => { scope = normalizeComplementaryAreaScope(scope); const isVisible = select(import_preferences2.store).get( scope, "isComplementaryAreaVisible" ); const identifier = state?.complementaryAreas?.[scope]; return isVisible && identifier === void 0; } ); var isItemPinned = (0, import_data2.createRegistrySelector)( (select) => (state, scope, item) => { scope = normalizeComplementaryAreaScope(scope); item = normalizeComplementaryAreaName(scope, item); const pinnedItems = select(import_preferences2.store).get( scope, "pinnedItems" ); return pinnedItems?.[item] ?? true; } ); var isFeatureActive = (0, import_data2.createRegistrySelector)( (select) => (state, scope, featureName) => { (0, import_deprecated4.default)( `select( 'core/interface' ).isFeatureActive( scope, featureName )`, { since: "6.0", alternative: `select( 'core/preferences' ).get( scope, featureName )` } ); return !!select(import_preferences2.store).get(scope, featureName); } ); function isModalActive(state, modalName) { return state.activeModal === modalName; } // packages/interface/build-module/store/reducer.mjs var import_data3 = __toESM(require_data(), 1); function complementaryAreas(state = {}, action) { switch (action.type) { case "SET_DEFAULT_COMPLEMENTARY_AREA": { const { scope, area } = action; if (state[scope]) { return state; } return { ...state, [scope]: area }; } case "ENABLE_COMPLEMENTARY_AREA": { const { scope, area } = action; return { ...state, [scope]: area }; } } return state; } function activeModal(state = null, action) { switch (action.type) { case "OPEN_MODAL": return action.name; case "CLOSE_MODAL": return null; } return state; } var reducer_default2 = (0, import_data3.combineReducers)({ complementaryAreas, activeModal }); // packages/interface/build-module/store/constants.mjs var STORE_NAME = "core/interface"; // packages/interface/build-module/store/index.mjs var store = (0, import_data4.createReduxStore)(STORE_NAME, { reducer: reducer_default2, actions: actions_exports, selectors: selectors_exports }); (0, import_data4.register)(store); // packages/interface/build-module/components/complementary-area-toggle/index.mjs var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1); function roleSupportsCheckedState(role) { return [ "checkbox", "option", "radio", "switch", "menuitemcheckbox", "menuitemradio", "treeitem" ].includes(role); } function ComplementaryAreaToggle({ as = import_components.Button, scope, identifier: identifierProp, icon: iconProp, selectedIcon, name: name2, shortcut, ...props }) { const ComponentToUse = as; const context = (0, import_plugins.usePluginContext)(); const icon = iconProp || context.icon; const identifier = identifierProp || `${context.name}/${name2}`; const isSelected = (0, import_data5.useSelect)( (select) => select(store).getActiveComplementaryArea(scope) === identifier, [identifier, scope] ); const { enableComplementaryArea: enableComplementaryArea2, disableComplementaryArea: disableComplementaryArea2 } = (0, import_data5.useDispatch)(store); return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)( ComponentToUse, { icon: selectedIcon && isSelected ? selectedIcon : icon, "aria-controls": identifier.replace("/", ":"), "aria-checked": roleSupportsCheckedState(props.role) ? isSelected : void 0, onClick: () => { if (isSelected) { disableComplementaryArea2(scope); } else { enableComplementaryArea2(scope, identifier); } }, shortcut, ...props } ); } // packages/interface/build-module/components/complementary-area-header/index.mjs var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1); var ComplementaryAreaHeader = ({ children, className, toggleButtonProps }) => { const toggleButton = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ComplementaryAreaToggle, { icon: close_small_default, ...toggleButtonProps }); return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)( "div", { className: clsx_default( "components-panel__header", "interface-complementary-area-header", className ), tabIndex: -1, children: [ children, toggleButton ] } ); }; var complementary_area_header_default = ComplementaryAreaHeader; // packages/interface/build-module/components/complementary-area-more-menu-item/index.mjs var import_components3 = __toESM(require_components(), 1); // packages/interface/build-module/components/action-item/index.mjs var import_components2 = __toESM(require_components(), 1); var import_element = __toESM(require_element(), 1); var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1); var noop = () => { }; function ActionItemSlot({ name: name2, as: Component2 = import_components2.MenuGroup, fillProps = {}, bubblesVirtually, ...props }) { return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)( import_components2.Slot, { name: name2, bubblesVirtually, fillProps, children: (fills) => { if (!import_element.Children.toArray(fills).length) { return null; } const initializedByPlugins = []; import_element.Children.forEach( fills, ({ props: { __unstableExplicitMenuItem, __unstableTarget } }) => { if (__unstableTarget && __unstableExplicitMenuItem) { initializedByPlugins.push(__unstableTarget); } } ); const children = import_element.Children.map(fills, (child) => { if (!child.props.__unstableExplicitMenuItem && initializedByPlugins.includes( child.props.__unstableTarget )) { return null; } return child; }); return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Component2, { ...props, children }); } } ); } function ActionItem({ name: name2, as: Component2 = import_components2.Button, onClick, ...props }) { return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_components2.Fill, { name: name2, children: ({ onClick: fpOnClick }) => { return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)( Component2, { onClick: onClick || fpOnClick ? (...args) => { (onClick || noop)(...args); (fpOnClick || noop)(...args); } : void 0, ...props } ); } }); } ActionItem.Slot = ActionItemSlot; var action_item_default = ActionItem; // packages/interface/build-module/components/complementary-area-more-menu-item/index.mjs var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1); var PluginsMenuItem = ({ // Menu item is marked with unstable prop for backward compatibility. // They are removed so they don't leak to DOM elements. // @see https://github.com/WordPress/gutenberg/issues/14457 __unstableExplicitMenuItem, __unstableTarget, ...restProps }) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_components3.MenuItem, { ...restProps }); function ComplementaryAreaMoreMenuItem({ scope, target, __unstableExplicitMenuItem, ...props }) { return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)( ComplementaryAreaToggle, { as: (toggleProps) => { return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)( action_item_default, { __unstableExplicitMenuItem, __unstableTarget: `${scope}/${target}`, as: PluginsMenuItem, name: `${scope}/plugin-more-menu`, ...toggleProps } ); }, role: "menuitemcheckbox", selectedIcon: check_default, name: target, scope, ...props } ); } // packages/interface/build-module/components/pinned-items/index.mjs var import_components4 = __toESM(require_components(), 1); var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1); function PinnedItems({ scope, ...props }) { return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_components4.Fill, { name: `PinnedItems/${scope}`, ...props }); } function PinnedItemsSlot({ scope, className, ...props }) { return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_components4.Slot, { name: `PinnedItems/${scope}`, ...props, children: (fills) => fills?.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)( "div", { className: clsx_default( className, "interface-pinned-items" ), children: fills } ) }); } PinnedItems.Slot = PinnedItemsSlot; var pinned_items_default = PinnedItems; // packages/interface/build-module/components/complementary-area/index.mjs var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1); var ANIMATION_DURATION = 0.3; function ComplementaryAreaSlot({ scope, ...props }) { return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_components5.Slot, { name: `ComplementaryArea/${scope}`, ...props }); } var SIDEBAR_WIDTH = 280; var variants = { open: { width: SIDEBAR_WIDTH }, closed: { width: 0 }, mobileOpen: { width: "100vw" } }; function ComplementaryAreaFill({ activeArea, isActive, scope, children, className, id }) { const disableMotion = (0, import_compose.useReducedMotion)(); const isMobileViewport = (0, import_compose.useViewportMatch)("medium", "<"); const previousActiveArea = (0, import_compose.usePrevious)(activeArea); const previousIsActive = (0, import_compose.usePrevious)(isActive); const [, setState] = (0, import_element2.useState)({}); (0, import_element2.useEffect)(() => { setState({}); }, [isActive]); const transition = { type: "tween", duration: disableMotion || isMobileViewport || !!previousActiveArea && !!activeArea && activeArea !== previousActiveArea ? 0 : ANIMATION_DURATION, ease: [0.6, 0, 0.4, 1] }; return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_components5.Fill, { name: `ComplementaryArea/${scope}`, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_components5.__unstableAnimatePresence, { initial: false, children: (previousIsActive || isActive) && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)( import_components5.__unstableMotion.div, { variants, initial: "closed", animate: isMobileViewport ? "mobileOpen" : "open", exit: "closed", transition, className: "interface-complementary-area__fill", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)( "div", { id, className, style: { width: isMobileViewport ? "100vw" : SIDEBAR_WIDTH }, children } ) } ) }) }); } function useAdjustComplementaryListener(scope, identifier, activeArea, isActive, isSmall) { const previousIsSmallRef = (0, import_element2.useRef)(false); const shouldOpenWhenNotSmallRef = (0, import_element2.useRef)(false); const { enableComplementaryArea: enableComplementaryArea2, disableComplementaryArea: disableComplementaryArea2 } = (0, import_data6.useDispatch)(store); (0, import_element2.useEffect)(() => { if (isActive && isSmall && !previousIsSmallRef.current) { disableComplementaryArea2(scope); shouldOpenWhenNotSmallRef.current = true; } else if ( // If there is a flag indicating the complementary area should be // enabled when we go from small to big window size and we are going // from a small to big window size. shouldOpenWhenNotSmallRef.current && !isSmall && previousIsSmallRef.current ) { shouldOpenWhenNotSmallRef.current = false; enableComplementaryArea2(scope, identifier); } else if ( // If the flag is indicating the current complementary should be // reopened but another complementary area becomes active, remove // the flag. shouldOpenWhenNotSmallRef.current && activeArea && activeArea !== identifier ) { shouldOpenWhenNotSmallRef.current = false; } if (isSmall !== previousIsSmallRef.current) { previousIsSmallRef.current = isSmall; } }, [ isActive, isSmall, scope, identifier, activeArea, disableComplementaryArea2, enableComplementaryArea2 ]); } function ComplementaryArea({ children, className, closeLabel = (0, import_i18n.__)("Close plugin"), identifier: identifierProp, header, headerClassName, icon: iconProp, isPinnable = true, panelClassName, scope, name: name2, title, toggleShortcut, isActiveByDefault }) { const context = (0, import_plugins2.usePluginContext)(); const icon = iconProp || context.icon; const identifier = identifierProp || `${context.name}/${name2}`; const [isReady, setIsReady] = (0, import_element2.useState)(false); const { isLoading, isActive, isPinned, activeArea, isSmall, isLarge, showIconLabels } = (0, import_data6.useSelect)( (select) => { const { getActiveComplementaryArea: getActiveComplementaryArea2, isComplementaryAreaLoading: isComplementaryAreaLoading2, isItemPinned: isItemPinned2 } = select(store); const { get } = select(import_preferences3.store); const _activeArea = getActiveComplementaryArea2(scope); return { isLoading: isComplementaryAreaLoading2(scope), isActive: _activeArea === identifier, isPinned: isItemPinned2(scope, identifier), activeArea: _activeArea, isSmall: select(import_viewport.store).isViewportMatch("< medium"), isLarge: select(import_viewport.store).isViewportMatch("large"), showIconLabels: get("core", "showIconLabels") }; }, [identifier, scope] ); const isMobileViewport = (0, import_compose.useViewportMatch)("medium", "<"); useAdjustComplementaryListener( scope, identifier, activeArea, isActive, isSmall ); const { enableComplementaryArea: enableComplementaryArea2, disableComplementaryArea: disableComplementaryArea2, pinItem: pinItem2, unpinItem: unpinItem2 } = (0, import_data6.useDispatch)(store); (0, import_element2.useEffect)(() => { if (isActiveByDefault && activeArea === void 0 && !isSmall) { enableComplementaryArea2(scope, identifier); } else if (activeArea === void 0 && isSmall) { disableComplementaryArea2(scope, identifier); } setIsReady(true); }, [ activeArea, isActiveByDefault, scope, identifier, isSmall, enableComplementaryArea2, disableComplementaryArea2 ]); if (!isReady) { return; } return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [ isPinnable && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(pinned_items_default, { scope, children: isPinned && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)( ComplementaryAreaToggle, { scope, identifier, isPressed: isActive && (!showIconLabels || isLarge), "aria-expanded": isActive, "aria-disabled": isLoading, label: title, icon: showIconLabels ? check_default : icon, showTooltip: !showIconLabels, variant: showIconLabels ? "tertiary" : void 0, size: "compact", shortcut: toggleShortcut } ) }), name2 && isPinnable && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)( ComplementaryAreaMoreMenuItem, { target: name2, scope, icon, identifier, children: title } ), /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)( ComplementaryAreaFill, { activeArea, isActive, className: clsx_default("interface-complementary-area", className), scope, id: identifier.replace("/", ":"), children: [ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)( complementary_area_header_default, { className: headerClassName, closeLabel, onClose: () => disableComplementaryArea2(scope), toggleButtonProps: { label: closeLabel, size: "compact", shortcut: toggleShortcut, scope, identifier }, children: header || /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("h2", { className: "interface-complementary-area-header__title", children: title }), isPinnable && !isMobileViewport && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)( import_components5.Button, { className: "interface-complementary-area__pin-unpin-item", icon: isPinned ? star_filled_default : star_empty_default, label: isPinned ? (0, import_i18n.__)("Unpin from toolbar") : (0, import_i18n.__)("Pin to toolbar"), onClick: () => (isPinned ? unpinItem2 : pinItem2)( scope, identifier ), isPressed: isPinned, "aria-expanded": isPinned, size: "compact" } ) ] }) } ), /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_components5.Panel, { className: panelClassName, children }) ] } ) ] }); } ComplementaryArea.Slot = ComplementaryAreaSlot; var complementary_area_default = ComplementaryArea; // packages/admin-ui/build-module/navigable-region/index.mjs var import_element3 = __toESM(require_element(), 1); var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1); var NavigableRegion = (0, import_element3.forwardRef)( ({ children, className, ariaLabel, as: Tag = "div", ...props }, ref) => { return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)( Tag, { ref, className: clsx_default("admin-ui-navigable-region", className), "aria-label": ariaLabel, role: "region", tabIndex: "-1", ...props, children } ); } ); NavigableRegion.displayName = "NavigableRegion"; var navigable_region_default = NavigableRegion; // packages/interface/build-module/components/interface-skeleton/index.mjs var import_element4 = __toESM(require_element(), 1); var import_components6 = __toESM(require_components(), 1); var import_i18n2 = __toESM(require_i18n(), 1); var import_compose2 = __toESM(require_compose(), 1); var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1); var ANIMATION_DURATION2 = 0.25; var commonTransition = { type: "tween", duration: ANIMATION_DURATION2, ease: [0.6, 0, 0.4, 1] }; function useHTMLClass(className) { (0, import_element4.useEffect)(() => { const element = document && document.querySelector(`html:not(.${className})`); if (!element) { return; } element.classList.toggle(className); return () => { element.classList.toggle(className); }; }, [className]); } var headerVariants = { hidden: { opacity: 1, marginTop: -60 }, visible: { opacity: 1, marginTop: 0 }, distractionFreeHover: { opacity: 1, marginTop: 0, transition: { ...commonTransition, delay: 0.2, delayChildren: 0.2 } }, distractionFreeHidden: { opacity: 0, marginTop: -60 }, distractionFreeDisabled: { opacity: 0, marginTop: 0, transition: { ...commonTransition, delay: 0.8, delayChildren: 0.8 } } }; function InterfaceSkeleton({ isDistractionFree, footer, header, editorNotices, sidebar, secondarySidebar, content, actions, labels, className }, ref) { const [secondarySidebarResizeListener, secondarySidebarSize] = (0, import_compose2.useResizeObserver)(); const isMobileViewport = (0, import_compose2.useViewportMatch)("medium", "<"); const disableMotion = (0, import_compose2.useReducedMotion)(); const defaultTransition = { type: "tween", duration: disableMotion ? 0 : ANIMATION_DURATION2, ease: [0.6, 0, 0.4, 1] }; useHTMLClass("interface-interface-skeleton__html-container"); const defaultLabels = { /* translators: accessibility text for the top bar landmark region. */ header: (0, import_i18n2._x)("Header", "header landmark area"), /* translators: accessibility text for the content landmark region. */ body: (0, import_i18n2.__)("Content"), /* translators: accessibility text for the secondary sidebar landmark region. */ secondarySidebar: (0, import_i18n2.__)("Block Library"), /* translators: accessibility text for the settings landmark region. */ sidebar: (0, import_i18n2._x)("Settings", "settings landmark area"), /* translators: accessibility text for the publish landmark region. */ actions: (0, import_i18n2.__)("Publish"), /* translators: accessibility text for the footer landmark region. */ footer: (0, import_i18n2.__)("Footer") }; const mergedLabels = { ...defaultLabels, ...labels }; return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)( "div", { ref, className: clsx_default( className, "interface-interface-skeleton", !!footer && "has-footer" ), children: [ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "interface-interface-skeleton__editor", children: [ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_components6.__unstableAnimatePresence, { initial: false, children: !!header && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)( navigable_region_default, { as: import_components6.__unstableMotion.div, className: "interface-interface-skeleton__header", "aria-label": mergedLabels.header, initial: isDistractionFree && !isMobileViewport ? "distractionFreeHidden" : "hidden", whileHover: isDistractionFree && !isMobileViewport ? "distractionFreeHover" : "visible", animate: isDistractionFree && !isMobileViewport ? "distractionFreeDisabled" : "visible", exit: isDistractionFree && !isMobileViewport ? "distractionFreeHidden" : "hidden", variants: headerVariants, transition: defaultTransition, children: header } ) }), isDistractionFree && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "interface-interface-skeleton__header", children: editorNotices }), /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "interface-interface-skeleton__body", children: [ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_components6.__unstableAnimatePresence, { initial: false, children: !!secondarySidebar && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)( navigable_region_default, { className: "interface-interface-skeleton__secondary-sidebar", ariaLabel: mergedLabels.secondarySidebar, as: import_components6.__unstableMotion.div, initial: "closed", animate: "open", exit: "closed", variants: { open: { width: secondarySidebarSize.width }, closed: { width: 0 } }, transition: defaultTransition, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)( import_components6.__unstableMotion.div, { style: { position: "absolute", width: isMobileViewport ? "100vw" : "fit-content", height: "100%", left: 0 }, variants: { open: { x: 0 }, closed: { x: "-100%" } }, transition: defaultTransition, children: [ secondarySidebarResizeListener, secondarySidebar ] } ) } ) }), /* @__PURE__ */ (0, import_jsx_runtime21.jsx)( navigable_region_default, { className: "interface-interface-skeleton__content", ariaLabel: mergedLabels.body, children: content } ), !!sidebar && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)( navigable_region_default, { className: "interface-interface-skeleton__sidebar", ariaLabel: mergedLabels.sidebar, children: sidebar } ), !!actions && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)( navigable_region_default, { className: "interface-interface-skeleton__actions", ariaLabel: mergedLabels.actions, children: actions } ) ] }) ] }), !!footer && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)( navigable_region_default, { className: "interface-interface-skeleton__footer", ariaLabel: mergedLabels.footer, children: footer } ) ] } ); } var interface_skeleton_default = (0, import_element4.forwardRef)(InterfaceSkeleton); // packages/edit-widgets/build-module/store/actions.mjs var import_widgets2 = __toESM(require_widgets(), 1); var import_core_data = __toESM(require_core_data(), 1); var import_block_editor = __toESM(require_block_editor(), 1); // packages/edit-widgets/build-module/store/transformers.mjs var import_blocks = __toESM(require_blocks(), 1); var import_widgets = __toESM(require_widgets(), 1); function transformWidgetToBlock(widget) { if (widget.id_base === "block") { const parsedBlocks = (0, import_blocks.parse)(widget.instance.raw.content, { __unstableSkipAutop: true }); if (!parsedBlocks.length) { return (0, import_widgets.addWidgetIdToBlock)( (0, import_blocks.createBlock)("core/paragraph", {}, []), widget.id ); } return (0, import_widgets.addWidgetIdToBlock)(parsedBlocks[0], widget.id); } let attributes; if (widget._embedded.about[0].is_multi) { attributes = { idBase: widget.id_base, instance: widget.instance }; } else { attributes = { id: widget.id }; } return (0, import_widgets.addWidgetIdToBlock)( (0, import_blocks.createBlock)("core/legacy-widget", attributes, []), widget.id ); } function transformBlockToWidget(block, relatedWidget = {}) { let widget; const isValidLegacyWidgetBlock = block.name === "core/legacy-widget" && (block.attributes.id || block.attributes.instance); if (isValidLegacyWidgetBlock) { widget = { ...relatedWidget, id: block.attributes.id ?? relatedWidget.id, id_base: block.attributes.idBase ?? relatedWidget.id_base, instance: block.attributes.instance ?? relatedWidget.instance }; } else { widget = { ...relatedWidget, id_base: "block", instance: { raw: { content: (0, import_blocks.serialize)(block) } } }; } delete widget.rendered; delete widget.rendered_form; return widget; } // packages/edit-widgets/build-module/store/utils.mjs var KIND = "root"; var WIDGET_AREA_ENTITY_TYPE = "sidebar"; var POST_TYPE = "postType"; var buildWidgetAreaPostId = (widgetAreaId) => `widget-area-${widgetAreaId}`; var buildWidgetAreasPostId = () => `widget-areas`; function buildWidgetAreasQuery() { return { per_page: -1 }; } function buildWidgetsQuery() { return { per_page: -1, _embed: "about" }; } var createStubPost = (id, blocks) => ({ id, slug: id, status: "draft", type: "page", blocks, meta: { widgetAreaId: id } }); // packages/edit-widgets/build-module/store/constants.mjs var STORE_NAME2 = "core/edit-widgets"; // packages/edit-widgets/build-module/store/actions.mjs var persistStubPost = (id, blocks) => ({ registry }) => { const stubPost = createStubPost(id, blocks); registry.dispatch(import_core_data.store).receiveEntityRecords( KIND, POST_TYPE, stubPost, { id: stubPost.id }, false ); return stubPost; }; var saveEditedWidgetAreas = () => async ({ select, dispatch: dispatch2, registry }) => { const editedWidgetAreas = select.getEditedWidgetAreas(); if (!editedWidgetAreas?.length) { return; } try { await dispatch2.saveWidgetAreas(editedWidgetAreas); registry.dispatch(import_notices.store).createSuccessNotice((0, import_i18n3.__)("Widgets saved."), { type: "snackbar" }); } catch (e) { registry.dispatch(import_notices.store).createErrorNotice( /* translators: %s: The error message. */ (0, import_i18n3.sprintf)((0, import_i18n3.__)("There was an error. %s"), e.message), { type: "snackbar" } ); } }; var saveWidgetAreas = (widgetAreas) => async ({ dispatch: dispatch2, registry }) => { try { for (const widgetArea of widgetAreas) { await dispatch2.saveWidgetArea(widgetArea.id); } } finally { await registry.dispatch(import_core_data.store).finishResolution( "getEntityRecord", KIND, WIDGET_AREA_ENTITY_TYPE, buildWidgetAreasQuery() ); } }; var saveWidgetArea = (widgetAreaId) => async ({ dispatch: dispatch2, select, registry }) => { const widgets = select.getWidgets(); const post = registry.select(import_core_data.store).getEditedEntityRecord( KIND, POST_TYPE, buildWidgetAreaPostId(widgetAreaId) ); const areaWidgets = Object.values(widgets).filter( ({ sidebar }) => sidebar === widgetAreaId ); const usedReferenceWidgets = []; const widgetsBlocks = post.blocks.filter((block) => { const { id } = block.attributes; if (block.name === "core/legacy-widget" && id) { if (usedReferenceWidgets.includes(id)) { return false; } usedReferenceWidgets.push(id); } return true; }); const deletedWidgets = []; for (const widget of areaWidgets) { const widgetsNewArea = select.getWidgetAreaForWidgetId(widget.id); if (!widgetsNewArea) { deletedWidgets.push(widget); } } const batchMeta = []; const batchTasks = []; const sidebarWidgetsIds = []; for (let i = 0; i < widgetsBlocks.length; i++) { const block = widgetsBlocks[i]; const widgetId = (0, import_widgets2.getWidgetIdFromBlock)(block); const oldWidget = widgets[widgetId]; const widget = transformBlockToWidget(block, oldWidget); sidebarWidgetsIds.push(widgetId); if (oldWidget) { registry.dispatch(import_core_data.store).editEntityRecord( "root", "widget", widgetId, { ...widget, sidebar: widgetAreaId }, { undoIgnore: true } ); const hasEdits = registry.select(import_core_data.store).hasEditsForEntityRecord("root", "widget", widgetId); if (!hasEdits) { continue; } batchTasks.push( ({ saveEditedEntityRecord }) => saveEditedEntityRecord("root", "widget", widgetId) ); } else { batchTasks.push( ({ saveEntityRecord }) => saveEntityRecord("root", "widget", { ...widget, sidebar: widgetAreaId }) ); } batchMeta.push({ block, position: i, clientId: block.clientId }); } for (const widget of deletedWidgets) { batchTasks.push( ({ deleteEntityRecord }) => deleteEntityRecord("root", "widget", widget.id, { force: true }) ); } const records = await registry.dispatch(import_core_data.store).__experimentalBatch(batchTasks); const preservedRecords = records.filter( (record) => !record.hasOwnProperty("deleted") ); const failedWidgetNames = []; for (let i = 0; i < preservedRecords.length; i++) { const widget = preservedRecords[i]; const { block, position } = batchMeta[i]; post.blocks[position].attributes.__internalWidgetId = widget.id; const error = registry.select(import_core_data.store).getLastEntitySaveError("root", "widget", widget.id); if (error) { failedWidgetNames.push(block.attributes?.name || block?.name); } if (!sidebarWidgetsIds[position]) { sidebarWidgetsIds[position] = widget.id; } } if (failedWidgetNames.length) { throw new Error( (0, import_i18n3.sprintf)( /* translators: %s: List of widget names */ (0, import_i18n3.__)("Could not save the following widgets: %s."), failedWidgetNames.join(", ") ) ); } registry.dispatch(import_core_data.store).editEntityRecord( KIND, WIDGET_AREA_ENTITY_TYPE, widgetAreaId, { widgets: sidebarWidgetsIds }, { undoIgnore: true } ); dispatch2(trySaveWidgetArea(widgetAreaId)); registry.dispatch(import_core_data.store).receiveEntityRecords(KIND, POST_TYPE, post, void 0); }; var trySaveWidgetArea = (widgetAreaId) => ({ registry }) => { registry.dispatch(import_core_data.store).saveEditedEntityRecord( KIND, WIDGET_AREA_ENTITY_TYPE, widgetAreaId, { throwOnError: true } ); }; function setWidgetIdForClientId(clientId, widgetId) { return { type: "SET_WIDGET_ID_FOR_CLIENT_ID", clientId, widgetId }; } function setWidgetAreasOpenState(widgetAreasOpenState2) { return { type: "SET_WIDGET_AREAS_OPEN_STATE", widgetAreasOpenState: widgetAreasOpenState2 }; } function setIsWidgetAreaOpen(clientId, isOpen) { return { type: "SET_IS_WIDGET_AREA_OPEN", clientId, isOpen }; } function setIsInserterOpened(value) { return { type: "SET_IS_INSERTER_OPENED", value }; } function setIsListViewOpened(isOpen) { return { type: "SET_IS_LIST_VIEW_OPENED", isOpen }; } var closeGeneralSidebar = () => ({ registry }) => { registry.dispatch(store).disableComplementaryArea(STORE_NAME2); }; var moveBlockToWidgetArea = (clientId, widgetAreaId) => async ({ dispatch: dispatch2, select, registry }) => { const sourceRootClientId = registry.select(import_block_editor.store).getBlockRootClientId(clientId); const widgetAreas = registry.select(import_block_editor.store).getBlocks(); const destinationWidgetAreaBlock = widgetAreas.find( ({ attributes }) => attributes.id === widgetAreaId ); const destinationRootClientId = destinationWidgetAreaBlock.clientId; const destinationInnerBlocksClientIds = registry.select(import_block_editor.store).getBlockOrder(destinationRootClientId); const destinationIndex = destinationInnerBlocksClientIds.length; const isDestinationWidgetAreaOpen = select.getIsWidgetAreaOpen( destinationRootClientId ); if (!isDestinationWidgetAreaOpen) { dispatch2.setIsWidgetAreaOpen(destinationRootClientId, true); } registry.dispatch(import_block_editor.store).moveBlocksToPosition( [clientId], sourceRootClientId, destinationRootClientId, destinationIndex ); }; function unlockWidgetSaving(lockName) { return { type: "UNLOCK_WIDGET_SAVING", lockName }; } function lockWidgetSaving(lockName) { return { type: "LOCK_WIDGET_SAVING", lockName }; } // packages/edit-widgets/build-module/store/resolvers.mjs var getWidgetAreas = () => async ({ dispatch: dispatch2, registry }) => { const query = buildWidgetAreasQuery(); const widgetAreas = await registry.resolveSelect(import_core_data2.store).getEntityRecords(KIND, WIDGET_AREA_ENTITY_TYPE, query); const widgetAreaBlocks = []; const sortedWidgetAreas = widgetAreas.sort((a, b) => { if (a.id === "wp_inactive_widgets") { return 1; } if (b.id === "wp_inactive_widgets") { return -1; } return 0; }); for (const widgetArea of sortedWidgetAreas) { widgetAreaBlocks.push( (0, import_blocks2.createBlock)("core/widget-area", { id: widgetArea.id, name: widgetArea.name }) ); if (!widgetArea.widgets.length) { dispatch2( persistStubPost( buildWidgetAreaPostId(widgetArea.id), [] ) ); } } const widgetAreasOpenState2 = {}; widgetAreaBlocks.forEach((widgetAreaBlock, index) => { widgetAreasOpenState2[widgetAreaBlock.clientId] = index === 0; }); dispatch2(setWidgetAreasOpenState(widgetAreasOpenState2)); dispatch2( persistStubPost(buildWidgetAreasPostId(), widgetAreaBlocks) ); }; var getWidgets = () => async ({ dispatch: dispatch2, registry }) => { const query = buildWidgetsQuery(); const widgets = await registry.resolveSelect(import_core_data2.store).getEntityRecords("root", "widget", query); const groupedBySidebar = {}; for (const widget of widgets) { const block = transformWidgetToBlock(widget); groupedBySidebar[widget.sidebar] = groupedBySidebar[widget.sidebar] || []; groupedBySidebar[widget.sidebar].push(block); } for (const sidebarId in groupedBySidebar) { if (groupedBySidebar.hasOwnProperty(sidebarId)) { dispatch2( persistStubPost( buildWidgetAreaPostId(sidebarId), groupedBySidebar[sidebarId] ) ); } } }; // packages/edit-widgets/build-module/store/selectors.mjs var selectors_exports2 = {}; __export(selectors_exports2, { __experimentalGetInsertionPoint: () => __experimentalGetInsertionPoint, canInsertBlockInWidgetArea: () => canInsertBlockInWidgetArea, getEditedWidgetAreas: () => getEditedWidgetAreas, getIsWidgetAreaOpen: () => getIsWidgetAreaOpen, getParentWidgetAreaBlock: () => getParentWidgetAreaBlock, getReferenceWidgetBlocks: () => getReferenceWidgetBlocks, getWidget: () => getWidget, getWidgetAreaForWidgetId: () => getWidgetAreaForWidgetId, getWidgetAreas: () => getWidgetAreas2, getWidgets: () => getWidgets2, isInserterOpened: () => isInserterOpened, isListViewOpened: () => isListViewOpened, isSavingWidgetAreas: () => isSavingWidgetAreas, isWidgetSavingLocked: () => isWidgetSavingLocked }); var import_data7 = __toESM(require_data(), 1); var import_widgets3 = __toESM(require_widgets(), 1); var import_core_data3 = __toESM(require_core_data(), 1); var import_block_editor2 = __toESM(require_block_editor(), 1); var EMPTY_INSERTION_POINT = { rootClientId: void 0, insertionIndex: void 0 }; var getWidgets2 = (0, import_data7.createRegistrySelector)( (select) => (0, import_data7.createSelector)( () => { const widgets = select(import_core_data3.store).getEntityRecords( "root", "widget", buildWidgetsQuery() ); return ( // Key widgets by their ID. widgets?.reduce( (allWidgets, widget) => ({ ...allWidgets, [widget.id]: widget }), {} ) ?? {} ); }, () => [ select(import_core_data3.store).getEntityRecords( "root", "widget", buildWidgetsQuery() ) ] ) ); var getWidget = (0, import_data7.createRegistrySelector)( (select) => (state, id) => { const widgets = select(STORE_NAME2).getWidgets(); return widgets[id]; } ); var getWidgetAreas2 = (0, import_data7.createRegistrySelector)((select) => () => { const query = buildWidgetAreasQuery(); return select(import_core_data3.store).getEntityRecords( KIND, WIDGET_AREA_ENTITY_TYPE, query ); }); var getWidgetAreaForWidgetId = (0, import_data7.createRegistrySelector)( (select) => (state, widgetId) => { const widgetAreas = select(STORE_NAME2).getWidgetAreas(); return widgetAreas.find((widgetArea) => { const post = select(import_core_data3.store).getEditedEntityRecord( KIND, POST_TYPE, buildWidgetAreaPostId(widgetArea.id) ); const blockWidgetIds = post.blocks.map( (block) => (0, import_widgets3.getWidgetIdFromBlock)(block) ); return blockWidgetIds.includes(widgetId); }); } ); var getParentWidgetAreaBlock = (0, import_data7.createRegistrySelector)( (select) => (state, clientId) => { const { getBlock, getBlockName, getBlockParents } = select(import_block_editor2.store); const blockParents = getBlockParents(clientId); const widgetAreaClientId = blockParents.find( (parentClientId) => getBlockName(parentClientId) === "core/widget-area" ); return getBlock(widgetAreaClientId); } ); var getEditedWidgetAreas = (0, import_data7.createRegistrySelector)( (select) => (state, ids) => { let widgetAreas = select(STORE_NAME2).getWidgetAreas(); if (!widgetAreas) { return []; } if (ids) { widgetAreas = widgetAreas.filter( ({ id }) => ids.includes(id) ); } return widgetAreas.filter( ({ id }) => select(import_core_data3.store).hasEditsForEntityRecord( KIND, POST_TYPE, buildWidgetAreaPostId(id) ) ).map( ({ id }) => select(import_core_data3.store).getEditedEntityRecord( KIND, WIDGET_AREA_ENTITY_TYPE, id ) ); } ); var getReferenceWidgetBlocks = (0, import_data7.createRegistrySelector)( (select) => (state, referenceWidgetName = null) => { const results = []; const widgetAreas = select(STORE_NAME2).getWidgetAreas(); for (const _widgetArea of widgetAreas) { const post = select(import_core_data3.store).getEditedEntityRecord( KIND, POST_TYPE, buildWidgetAreaPostId(_widgetArea.id) ); for (const block of post.blocks) { if (block.name === "core/legacy-widget" && (!referenceWidgetName || block.attributes?.referenceWidgetName === referenceWidgetName)) { results.push(block); } } } return results; } ); var isSavingWidgetAreas = (0, import_data7.createRegistrySelector)((select) => () => { const widgetAreasIds = select(STORE_NAME2).getWidgetAreas()?.map(({ id }) => id); if (!widgetAreasIds) { return false; } for (const id of widgetAreasIds) { const isSaving = select(import_core_data3.store).isSavingEntityRecord( KIND, WIDGET_AREA_ENTITY_TYPE, id ); if (isSaving) { return true; } } const widgetIds = [ ...Object.keys(select(STORE_NAME2).getWidgets()), void 0 // account for new widgets without an ID ]; for (const id of widgetIds) { const isSaving = select(import_core_data3.store).isSavingEntityRecord( "root", "widget", id ); if (isSaving) { return true; } } return false; }); var getIsWidgetAreaOpen = (state, clientId) => { const { widgetAreasOpenState: widgetAreasOpenState2 } = state; return !!widgetAreasOpenState2[clientId]; }; function isInserterOpened(state) { return !!state.blockInserterPanel; } function __experimentalGetInsertionPoint(state) { if (typeof state.blockInserterPanel === "boolean") { return EMPTY_INSERTION_POINT; } return state.blockInserterPanel; } var canInsertBlockInWidgetArea = (0, import_data7.createRegistrySelector)( (select) => (state, blockName) => { const widgetAreas = select(import_block_editor2.store).getBlocks(); const [firstWidgetArea] = widgetAreas; return select(import_block_editor2.store).canInsertBlockType( blockName, firstWidgetArea.clientId ); } ); function isListViewOpened(state) { return state.listViewPanel; } function isWidgetSavingLocked(state) { return Object.keys(state.widgetSavingLock).length > 0; } // packages/edit-widgets/build-module/store/private-selectors.mjs var private_selectors_exports = {}; __export(private_selectors_exports, { getInserterSidebarToggleRef: () => getInserterSidebarToggleRef, getListViewToggleRef: () => getListViewToggleRef }); function getListViewToggleRef(state) { return state.listViewToggleRef; } function getInserterSidebarToggleRef(state) { return state.inserterSidebarToggleRef; } // packages/edit-widgets/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/edit-widgets" ); // packages/edit-widgets/build-module/store/index.mjs var storeConfig = { reducer: reducer_default, selectors: selectors_exports2, resolvers: resolvers_exports, actions: actions_exports2 }; var store2 = (0, import_data8.createReduxStore)(STORE_NAME2, storeConfig); (0, import_data8.register)(store2); import_api_fetch.default.use(function(options, next) { if (options.path?.indexOf("/wp/v2/types/widget-area") === 0) { return Promise.resolve({}); } return next(options); }); unlock(store2).registerPrivateSelectors(private_selectors_exports); // packages/edit-widgets/build-module/filters/move-to-widget-area.mjs var import_block_editor3 = __toESM(require_block_editor(), 1); var import_compose3 = __toESM(require_compose(), 1); var import_data9 = __toESM(require_data(), 1); var import_hooks = __toESM(require_hooks(), 1); var import_widgets4 = __toESM(require_widgets(), 1); var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1); var withMoveToWidgetAreaToolbarItem = (0, import_compose3.createHigherOrderComponent)( (BlockEdit) => (props) => { const { clientId, name: blockName } = props; const { widgetAreas, currentWidgetAreaId, canInsertBlockInWidgetArea: canInsertBlockInWidgetArea2 } = (0, import_data9.useSelect)( (select) => { if (blockName === "core/widget-area") { return {}; } const selectors = select(store2); const widgetAreaBlock = selectors.getParentWidgetAreaBlock(clientId); return { widgetAreas: selectors.getWidgetAreas(), currentWidgetAreaId: widgetAreaBlock?.attributes?.id, canInsertBlockInWidgetArea: selectors.canInsertBlockInWidgetArea(blockName) }; }, [clientId, blockName] ); const { moveBlockToWidgetArea: moveBlockToWidgetArea2 } = (0, import_data9.useDispatch)(store2); const hasMultipleWidgetAreas = widgetAreas?.length > 1; const isMoveToWidgetAreaVisible = blockName !== "core/widget-area" && hasMultipleWidgetAreas && canInsertBlockInWidgetArea2; return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(BlockEdit, { ...props }, "edit"), isMoveToWidgetAreaVisible && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_block_editor3.BlockControls, { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)( import_widgets4.MoveToWidgetArea, { widgetAreas, currentWidgetAreaId, onSelect: (widgetAreaId) => { moveBlockToWidgetArea2( props.clientId, widgetAreaId ); } } ) }) ] }); }, "withMoveToWidgetAreaToolbarItem" ); (0, import_hooks.addFilter)( "editor.BlockEdit", "core/edit-widgets/block-edit", withMoveToWidgetAreaToolbarItem ); // packages/edit-widgets/build-module/filters/replace-media-upload.mjs var import_hooks2 = __toESM(require_hooks(), 1); var import_media_utils = __toESM(require_media_utils(), 1); var replaceMediaUpload = () => import_media_utils.MediaUpload; (0, import_hooks2.addFilter)( "editor.MediaUpload", "core/edit-widgets/replace-media-upload", replaceMediaUpload ); // packages/edit-widgets/build-module/blocks/widget-area/index.mjs var widget_area_exports = {}; __export(widget_area_exports, { metadata: () => block_default, name: () => name, settings: () => settings }); var import_i18n4 = __toESM(require_i18n(), 1); // packages/edit-widgets/build-module/blocks/widget-area/block.json var block_default = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/widget-area", title: "Widget Area", category: "widgets", attributes: { id: { type: "string" }, name: { type: "string" } }, supports: { html: false, inserter: false, customClassName: false, reusable: false, renaming: false, visibility: false, __experimentalToolbar: false, __experimentalParentSelector: false, __experimentalDisableBlockOverlay: true }, editorStyle: "wp-block-widget-area-editor", style: "wp-block-widget-area" }; // packages/edit-widgets/build-module/blocks/widget-area/edit/index.mjs var import_element7 = __toESM(require_element(), 1); var import_data10 = __toESM(require_data(), 1); var import_core_data5 = __toESM(require_core_data(), 1); var import_components7 = __toESM(require_components(), 1); var import_block_editor5 = __toESM(require_block_editor(), 1); // packages/edit-widgets/build-module/blocks/widget-area/edit/inner-blocks.mjs var import_core_data4 = __toESM(require_core_data(), 1); var import_block_editor4 = __toESM(require_block_editor(), 1); var import_element6 = __toESM(require_element(), 1); // packages/edit-widgets/build-module/blocks/widget-area/edit/use-is-dragging-within.mjs var import_element5 = __toESM(require_element(), 1); var useIsDraggingWithin = (elementRef) => { const [isDraggingWithin, setIsDraggingWithin] = (0, import_element5.useState)(false); (0, import_element5.useEffect)(() => { const { ownerDocument } = elementRef.current; function handleDragStart(event) { handleDragEnter(event); } function handleDragEnd() { setIsDraggingWithin(false); } function handleDragEnter(event) { if (elementRef.current.contains(event.target)) { setIsDraggingWithin(true); } else { setIsDraggingWithin(false); } } ownerDocument.addEventListener("dragstart", handleDragStart); ownerDocument.addEventListener("dragend", handleDragEnd); ownerDocument.addEventListener("dragenter", handleDragEnter); return () => { ownerDocument.removeEventListener("dragstart", handleDragStart); ownerDocument.removeEventListener("dragend", handleDragEnd); ownerDocument.removeEventListener("dragenter", handleDragEnter); }; }, []); return isDraggingWithin; }; var use_is_dragging_within_default = useIsDraggingWithin; // packages/edit-widgets/build-module/blocks/widget-area/edit/inner-blocks.mjs var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1); function WidgetAreaInnerBlocks({ id }) { const [blocks, onInput, onChange] = (0, import_core_data4.useEntityBlockEditor)( "root", "postType" ); const innerBlocksRef = (0, import_element6.useRef)(); const isDraggingWithinInnerBlocks = use_is_dragging_within_default(innerBlocksRef); const shouldHighlightDropZone = isDraggingWithinInnerBlocks; const innerBlocksProps = (0, import_block_editor4.useInnerBlocksProps)( { ref: innerBlocksRef }, { value: blocks, onInput, onChange, templateLock: false, renderAppender: import_block_editor4.InnerBlocks.ButtonBlockAppender } ); return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)( "div", { "data-widget-area-id": id, className: clsx_default( "wp-block-widget-area__inner-blocks block-editor-inner-blocks editor-styles-wrapper", { "wp-block-widget-area__highlight-drop-zone": shouldHighlightDropZone } ), children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { ...innerBlocksProps }) } ); } // packages/edit-widgets/build-module/blocks/widget-area/edit/index.mjs var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1); function WidgetAreaEdit({ clientId, attributes: { id, name: name2 } }) { const isOpen = (0, import_data10.useSelect)( (select) => select(store2).getIsWidgetAreaOpen(clientId), [clientId] ); const { setIsWidgetAreaOpen: setIsWidgetAreaOpen2 } = (0, import_data10.useDispatch)(store2); const wrapper = (0, import_element7.useRef)(); const setOpen = (0, import_element7.useCallback)( (openState) => setIsWidgetAreaOpen2(clientId, openState), [clientId] ); const isDragging = useIsDragging(wrapper); const isDraggingWithin = use_is_dragging_within_default(wrapper); const [openedWhileDragging, setOpenedWhileDragging] = (0, import_element7.useState)(false); (0, import_element7.useEffect)(() => { if (!isDragging) { setOpenedWhileDragging(false); return; } if (isDraggingWithin && !isOpen) { setOpen(true); setOpenedWhileDragging(true); } else if (!isDraggingWithin && isOpen && openedWhileDragging) { setOpen(false); } }, [isOpen, isDragging, isDraggingWithin, openedWhileDragging]); const blockProps = (0, import_block_editor5.useBlockProps)(); return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_components7.Panel, { ref: wrapper, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)( import_components7.PanelBody, { title: name2, opened: isOpen, onToggle: () => { setIsWidgetAreaOpen2(clientId, !isOpen); }, scrollAfterOpen: !isDragging, children: ({ opened }) => ( // This is required to ensure LegacyWidget blocks are not // unmounted when the panel is collapsed. Unmounting legacy // widgets may have unintended consequences (e.g. TinyMCE // not being properly reinitialized) /* @__PURE__ */ (0, import_jsx_runtime24.jsx)( import_components7.__unstableDisclosureContent, { className: "wp-block-widget-area__panel-body-content", visible: opened, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)( import_core_data5.EntityProvider, { kind: "root", type: "postType", id: `widget-area-${id}`, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(WidgetAreaInnerBlocks, { id }) } ) } ) ) } ) }) }); } var useIsDragging = (elementRef) => { const [isDragging, setIsDragging] = (0, import_element7.useState)(false); (0, import_element7.useEffect)(() => { const { ownerDocument } = elementRef.current; function handleDragStart() { setIsDragging(true); } function handleDragEnd() { setIsDragging(false); } ownerDocument.addEventListener("dragstart", handleDragStart); ownerDocument.addEventListener("dragend", handleDragEnd); return () => { ownerDocument.removeEventListener("dragstart", handleDragStart); ownerDocument.removeEventListener("dragend", handleDragEnd); }; }, []); return isDragging; }; // packages/edit-widgets/build-module/blocks/widget-area/index.mjs var { name } = block_default; var settings = { title: (0, import_i18n4.__)("Widget Area"), description: (0, import_i18n4.__)("A widget area container."), __experimentalLabel: ({ name: label }) => label, edit: WidgetAreaEdit }; // packages/edit-widgets/build-module/components/layout/index.mjs var import_i18n21 = __toESM(require_i18n(), 1); var import_data31 = __toESM(require_data(), 1); var import_plugins3 = __toESM(require_plugins(), 1); var import_notices4 = __toESM(require_notices(), 1); var import_components22 = __toESM(require_components(), 1); // packages/edit-widgets/build-module/components/error-boundary/index.mjs var import_element8 = __toESM(require_element(), 1); var import_i18n5 = __toESM(require_i18n(), 1); var import_components8 = __toESM(require_components(), 1); var import_block_editor6 = __toESM(require_block_editor(), 1); var import_compose4 = __toESM(require_compose(), 1); var import_hooks3 = __toESM(require_hooks(), 1); var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1); function CopyButton({ text, children }) { const ref = (0, import_compose4.useCopyToClipboard)(text); return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_components8.Button, { __next40pxDefaultSize: true, variant: "secondary", ref, children }); } function ErrorBoundaryWarning({ message, error }) { const actions = [ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(CopyButton, { text: error.stack, children: (0, import_i18n5.__)("Copy Error") }, "copy-error") ]; return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_block_editor6.Warning, { className: "edit-widgets-error-boundary", actions, children: message }); } var ErrorBoundary = class extends import_element8.Component { constructor() { super(...arguments); this.state = { error: null }; } componentDidCatch(error) { (0, import_hooks3.doAction)("editor.ErrorBoundary.errorLogged", error); } static getDerivedStateFromError(error) { return { error }; } render() { if (!this.state.error) { return this.props.children; } return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)( ErrorBoundaryWarning, { message: (0, import_i18n5.__)( "The editor has encountered an unexpected error." ), error: this.state.error } ); } }; // packages/edit-widgets/build-module/components/widget-areas-block-editor-provider/index.mjs var import_components9 = __toESM(require_components(), 1); var import_compose5 = __toESM(require_compose(), 1); var import_media_utils2 = __toESM(require_media_utils(), 1); var import_data13 = __toESM(require_data(), 1); var import_core_data8 = __toESM(require_core_data(), 1); var import_element10 = __toESM(require_element(), 1); var import_block_editor8 = __toESM(require_block_editor(), 1); var import_patterns = __toESM(require_patterns(), 1); var import_preferences4 = __toESM(require_preferences(), 1); var import_block_library = __toESM(require_block_library(), 1); // packages/edit-widgets/build-module/components/keyboard-shortcuts/index.mjs var import_element9 = __toESM(require_element(), 1); var import_keyboard_shortcuts = __toESM(require_keyboard_shortcuts(), 1); var import_keycodes = __toESM(require_keycodes(), 1); var import_data11 = __toESM(require_data(), 1); var import_i18n6 = __toESM(require_i18n(), 1); var import_core_data6 = __toESM(require_core_data(), 1); function KeyboardShortcuts() { const { redo, undo } = (0, import_data11.useDispatch)(import_core_data6.store); const { saveEditedWidgetAreas: saveEditedWidgetAreas2 } = (0, import_data11.useDispatch)(store2); (0, import_keyboard_shortcuts.useShortcut)("core/edit-widgets/undo", (event) => { undo(); event.preventDefault(); }); (0, import_keyboard_shortcuts.useShortcut)("core/edit-widgets/redo", (event) => { redo(); event.preventDefault(); }); (0, import_keyboard_shortcuts.useShortcut)("core/edit-widgets/save", (event) => { event.preventDefault(); saveEditedWidgetAreas2(); }); return null; } function KeyboardShortcutsRegister() { const { registerShortcut } = (0, import_data11.useDispatch)(import_keyboard_shortcuts.store); (0, import_element9.useEffect)(() => { registerShortcut({ name: "core/edit-widgets/undo", category: "global", description: (0, import_i18n6.__)("Undo your last changes."), keyCombination: { modifier: "primary", character: "z" } }); registerShortcut({ name: "core/edit-widgets/redo", category: "global", description: (0, import_i18n6.__)("Redo your last undo."), keyCombination: { modifier: "primaryShift", character: "z" }, // Disable on Apple OS because it conflicts with the browser's // history shortcut. It's a fine alias for both Windows and Linux. // Since there's no conflict for Ctrl+Shift+Z on both Windows and // Linux, we keep it as the default for consistency. aliases: (0, import_keycodes.isAppleOS)() ? [] : [ { modifier: "primary", character: "y" } ] }); registerShortcut({ name: "core/edit-widgets/save", category: "global", description: (0, import_i18n6.__)("Save your changes."), keyCombination: { modifier: "primary", character: "s" } }); registerShortcut({ name: "core/edit-widgets/keyboard-shortcuts", category: "main", description: (0, import_i18n6.__)("Display these keyboard shortcuts."), keyCombination: { modifier: "access", character: "h" } }); registerShortcut({ name: "core/edit-widgets/next-region", category: "global", description: (0, import_i18n6.__)("Navigate to the next part of the editor."), keyCombination: { modifier: "ctrl", character: "`" }, aliases: [ { modifier: "access", character: "n" } ] }); registerShortcut({ name: "core/edit-widgets/previous-region", category: "global", description: (0, import_i18n6.__)("Navigate to the previous part of the editor."), keyCombination: { modifier: "ctrlShift", character: "`" }, aliases: [ { modifier: "access", character: "p" }, { modifier: "ctrlShift", character: "~" } ] }); }, [registerShortcut]); return null; } KeyboardShortcuts.Register = KeyboardShortcutsRegister; var keyboard_shortcuts_default = KeyboardShortcuts; // packages/edit-widgets/build-module/hooks/use-last-selected-widget-area.mjs var import_data12 = __toESM(require_data(), 1); var import_block_editor7 = __toESM(require_block_editor(), 1); var import_core_data7 = __toESM(require_core_data(), 1); var useLastSelectedWidgetArea = () => (0, import_data12.useSelect)((select) => { const { getBlockSelectionEnd, getBlockName } = select(import_block_editor7.store); const selectionEndClientId = getBlockSelectionEnd(); if (getBlockName(selectionEndClientId) === "core/widget-area") { return selectionEndClientId; } const { getParentWidgetAreaBlock: getParentWidgetAreaBlock2 } = select(store2); const widgetAreaBlock = getParentWidgetAreaBlock2(selectionEndClientId); const widgetAreaBlockClientId = widgetAreaBlock?.clientId; if (widgetAreaBlockClientId) { return widgetAreaBlockClientId; } const { getEntityRecord } = select(import_core_data7.store); const widgetAreasPost = getEntityRecord( KIND, POST_TYPE, buildWidgetAreasPostId() ); return widgetAreasPost?.blocks[0]?.clientId; }, []); var use_last_selected_widget_area_default = useLastSelectedWidgetArea; // packages/edit-widgets/build-module/constants.mjs var ALLOW_REUSABLE_BLOCKS = false; // packages/edit-widgets/build-module/components/widget-areas-block-editor-provider/index.mjs var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1); var { ExperimentalBlockEditorProvider } = unlock(import_block_editor8.privateApis); var { PatternsMenuItems } = unlock(import_patterns.privateApis); var { BlockKeyboardShortcuts } = unlock(import_block_library.privateApis); var EMPTY_ARRAY = []; function WidgetAreasBlockEditorProvider({ blockEditorSettings, children, ...props }) { const isLargeViewport = (0, import_compose5.useViewportMatch)("medium"); const { hasUploadPermissions, reusableBlocks, isFixedToolbarActive, keepCaretInsideBlock, pageOnFront, pageForPosts } = (0, import_data13.useSelect)((select) => { const { canUser, getEntityRecord, getEntityRecords } = select(import_core_data8.store); const siteSettings = canUser("read", { kind: "root", name: "site" }) ? getEntityRecord("root", "site") : void 0; return { hasUploadPermissions: canUser("create", { kind: "postType", name: "attachment" }) ?? true, reusableBlocks: ALLOW_REUSABLE_BLOCKS ? getEntityRecords("postType", "wp_block") : EMPTY_ARRAY, isFixedToolbarActive: !!select(import_preferences4.store).get( "core/edit-widgets", "fixedToolbar" ), keepCaretInsideBlock: !!select(import_preferences4.store).get( "core/edit-widgets", "keepCaretInsideBlock" ), pageOnFront: siteSettings?.page_on_front, pageForPosts: siteSettings?.page_for_posts }; }, []); const { setIsInserterOpened: setIsInserterOpened2 } = (0, import_data13.useDispatch)(store2); const settings2 = (0, import_element10.useMemo)(() => { let mediaUploadBlockEditor; if (hasUploadPermissions) { mediaUploadBlockEditor = ({ onError, ...argumentsObject }) => { (0, import_media_utils2.uploadMedia)({ wpAllowedMimeTypes: blockEditorSettings.allowedMimeTypes, onError: ({ message }) => onError(message), ...argumentsObject }); }; } return { ...blockEditorSettings, __experimentalReusableBlocks: reusableBlocks, hasFixedToolbar: isFixedToolbarActive || !isLargeViewport, keepCaretInsideBlock, mediaUpload: mediaUploadBlockEditor, templateLock: "all", __experimentalSetIsInserterOpened: setIsInserterOpened2, pageOnFront, pageForPosts, editorTool: "edit" }; }, [ hasUploadPermissions, blockEditorSettings, isFixedToolbarActive, isLargeViewport, keepCaretInsideBlock, reusableBlocks, setIsInserterOpened2, pageOnFront, pageForPosts ]); const widgetAreaId = use_last_selected_widget_area_default(); const [blocks, onInput, onChange] = (0, import_core_data8.useEntityBlockEditor)( KIND, POST_TYPE, { id: buildWidgetAreasPostId() } ); return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_components9.SlotFillProvider, { children: [ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(keyboard_shortcuts_default.Register, {}), /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(BlockKeyboardShortcuts, {}), /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)( ExperimentalBlockEditorProvider, { value: blocks, onInput, onChange, settings: settings2, useSubRegistry: false, ...props, children: [ children, /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(PatternsMenuItems, { rootClientId: widgetAreaId }) ] } ) ] }); } // packages/edit-widgets/build-module/components/sidebar/index.mjs var import_element12 = __toESM(require_element(), 1); var import_i18n8 = __toESM(require_i18n(), 1); var import_block_editor10 = __toESM(require_block_editor(), 1); var import_components11 = __toESM(require_components(), 1); var import_data15 = __toESM(require_data(), 1); // packages/edit-widgets/build-module/components/sidebar/widget-areas.mjs var import_data14 = __toESM(require_data(), 1); var import_element11 = __toESM(require_element(), 1); var import_block_editor9 = __toESM(require_block_editor(), 1); var import_components10 = __toESM(require_components(), 1); var import_i18n7 = __toESM(require_i18n(), 1); var import_url = __toESM(require_url(), 1); var import_dom = __toESM(require_dom(), 1); var import_jsx_runtime27 = __toESM(require_jsx_runtime(), 1); function WidgetAreas({ selectedWidgetAreaId }) { const widgetAreas = (0, import_data14.useSelect)( (select) => select(store2).getWidgetAreas(), [] ); const selectedWidgetArea = (0, import_element11.useMemo)( () => selectedWidgetAreaId && widgetAreas?.find( (widgetArea) => widgetArea.id === selectedWidgetAreaId ), [selectedWidgetAreaId, widgetAreas] ); let description; if (!selectedWidgetArea) { description = (0, import_i18n7.__)( // eslint-disable-next-line no-restricted-syntax -- 'sidebar' is a common web design term for layouts "Widget Areas are global parts in your site\u2019s layout that can accept blocks. These vary by theme, but are typically parts like your Sidebar or Footer." ); } else if (selectedWidgetAreaId === "wp_inactive_widgets") { description = (0, import_i18n7.__)( "Blocks in this Widget Area will not be displayed in your site." ); } else { description = selectedWidgetArea.description; } return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "edit-widgets-widget-areas", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "edit-widgets-widget-areas__top-container", children: [ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_block_editor9.BlockIcon, { icon: block_default_default }), /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { children: [ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)( "p", { dangerouslySetInnerHTML: { __html: (0, import_dom.safeHTML)(description) } } ), widgetAreas?.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { children: (0, import_i18n7.__)( "Your theme does not contain any Widget Areas." ) }), !selectedWidgetArea && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)( import_components10.Button, { __next40pxDefaultSize: true, href: (0, import_url.addQueryArgs)("customize.php", { "autofocus[panel]": "widgets", return: window.location.pathname }), variant: "tertiary", children: (0, import_i18n7.__)("Manage with live preview") } ) ] }) ] }) }); } // packages/edit-widgets/build-module/components/sidebar/index.mjs var import_jsx_runtime28 = __toESM(require_jsx_runtime(), 1); var SIDEBAR_ACTIVE_BY_DEFAULT = import_element12.Platform.select({ web: true, native: false }); var BLOCK_INSPECTOR_IDENTIFIER = "edit-widgets/block-inspector"; var WIDGET_AREAS_IDENTIFIER = "edit-widgets/block-areas"; var { Tabs } = unlock(import_components11.privateApis); function SidebarHeader({ selectedWidgetAreaBlock }) { return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Tabs.TabList, { children: [ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Tabs.Tab, { tabId: WIDGET_AREAS_IDENTIFIER, children: selectedWidgetAreaBlock ? selectedWidgetAreaBlock.attributes.name : (0, import_i18n8.__)("Widget Areas") }), /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Tabs.Tab, { tabId: BLOCK_INSPECTOR_IDENTIFIER, children: (0, import_i18n8.__)("Block") }) ] }); } function SidebarContent({ hasSelectedNonAreaBlock, currentArea, isGeneralSidebarOpen, selectedWidgetAreaBlock }) { const { enableComplementaryArea: enableComplementaryArea2 } = (0, import_data15.useDispatch)(store); (0, import_element12.useEffect)(() => { if (hasSelectedNonAreaBlock && currentArea === WIDGET_AREAS_IDENTIFIER && isGeneralSidebarOpen) { enableComplementaryArea2( "core/edit-widgets", BLOCK_INSPECTOR_IDENTIFIER ); } if (!hasSelectedNonAreaBlock && currentArea === BLOCK_INSPECTOR_IDENTIFIER && isGeneralSidebarOpen) { enableComplementaryArea2( "core/edit-widgets", WIDGET_AREAS_IDENTIFIER ); } }, [hasSelectedNonAreaBlock, enableComplementaryArea2]); const tabsContextValue = (0, import_element12.useContext)(Tabs.Context); return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)( complementary_area_default, { className: "edit-widgets-sidebar", header: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Tabs.Context.Provider, { value: tabsContextValue, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)( SidebarHeader, { selectedWidgetAreaBlock } ) }), headerClassName: "edit-widgets-sidebar__panel-tabs", title: (0, import_i18n8.__)("Settings"), closeLabel: (0, import_i18n8.__)("Close Settings"), scope: "core/edit-widgets", identifier: currentArea, icon: (0, import_i18n8.isRTL)() ? drawer_left_default : drawer_right_default, isActiveByDefault: SIDEBAR_ACTIVE_BY_DEFAULT, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Tabs.Context.Provider, { value: tabsContextValue, children: [ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)( Tabs.TabPanel, { tabId: WIDGET_AREAS_IDENTIFIER, focusable: false, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)( WidgetAreas, { selectedWidgetAreaId: selectedWidgetAreaBlock?.attributes.id } ) } ), /* @__PURE__ */ (0, import_jsx_runtime28.jsx)( Tabs.TabPanel, { tabId: BLOCK_INSPECTOR_IDENTIFIER, focusable: false, children: hasSelectedNonAreaBlock ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_block_editor10.BlockInspector, {}) : ( // Pretend that Widget Areas are part of the UI by not // showing the Block Inspector when one is selected. /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "block-editor-block-inspector__no-blocks", children: (0, import_i18n8.__)("No block selected.") }) ) } ) ] }) } ); } function Sidebar() { const { currentArea, hasSelectedNonAreaBlock, isGeneralSidebarOpen, selectedWidgetAreaBlock } = (0, import_data15.useSelect)((select) => { const { getSelectedBlock, getBlock, getBlockParentsByBlockName } = select(import_block_editor10.store); const { getActiveComplementaryArea: getActiveComplementaryArea2 } = select(store); const selectedBlock = getSelectedBlock(); const activeArea = getActiveComplementaryArea2(store2.name); let currentSelection = activeArea; if (!currentSelection) { if (selectedBlock) { currentSelection = BLOCK_INSPECTOR_IDENTIFIER; } else { currentSelection = WIDGET_AREAS_IDENTIFIER; } } let widgetAreaBlock; if (selectedBlock) { if (selectedBlock.name === "core/widget-area") { widgetAreaBlock = selectedBlock; } else { widgetAreaBlock = getBlock( getBlockParentsByBlockName( selectedBlock.clientId, "core/widget-area" )[0] ); } } return { currentArea: currentSelection, hasSelectedNonAreaBlock: !!(selectedBlock && selectedBlock.name !== "core/widget-area"), isGeneralSidebarOpen: !!activeArea, selectedWidgetAreaBlock: widgetAreaBlock }; }, []); const { enableComplementaryArea: enableComplementaryArea2 } = (0, import_data15.useDispatch)(store); const onTabSelect = (0, import_element12.useCallback)( (newSelectedTabId) => { if (!!newSelectedTabId) { enableComplementaryArea2( store2.name, newSelectedTabId ); } }, [enableComplementaryArea2] ); return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)( Tabs, { selectedTabId: isGeneralSidebarOpen ? currentArea : null, onSelect: onTabSelect, selectOnMove: false, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)( SidebarContent, { hasSelectedNonAreaBlock, currentArea, isGeneralSidebarOpen, selectedWidgetAreaBlock } ) } ); } // packages/edit-widgets/build-module/components/layout/interface.mjs var import_compose12 = __toESM(require_compose(), 1); var import_block_editor17 = __toESM(require_block_editor(), 1); var import_element22 = __toESM(require_element(), 1); var import_data28 = __toESM(require_data(), 1); var import_i18n18 = __toESM(require_i18n(), 1); var import_preferences8 = __toESM(require_preferences(), 1); // packages/edit-widgets/build-module/components/header/index.mjs var import_block_editor12 = __toESM(require_block_editor(), 1); var import_data22 = __toESM(require_data(), 1); var import_element18 = __toESM(require_element(), 1); var import_i18n16 = __toESM(require_i18n(), 1); var import_components19 = __toESM(require_components(), 1); var import_compose8 = __toESM(require_compose(), 1); var import_preferences6 = __toESM(require_preferences(), 1); // packages/edit-widgets/build-module/components/header/document-tools/index.mjs var import_data18 = __toESM(require_data(), 1); var import_i18n11 = __toESM(require_i18n(), 1); var import_components14 = __toESM(require_components(), 1); var import_block_editor11 = __toESM(require_block_editor(), 1); var import_element15 = __toESM(require_element(), 1); var import_compose6 = __toESM(require_compose(), 1); // packages/edit-widgets/build-module/components/header/undo-redo/undo.mjs var import_i18n9 = __toESM(require_i18n(), 1); var import_components12 = __toESM(require_components(), 1); var import_data16 = __toESM(require_data(), 1); var import_keycodes2 = __toESM(require_keycodes(), 1); var import_core_data9 = __toESM(require_core_data(), 1); var import_element13 = __toESM(require_element(), 1); var import_jsx_runtime29 = __toESM(require_jsx_runtime(), 1); function UndoButton(props, ref) { const hasUndo = (0, import_data16.useSelect)( (select) => select(import_core_data9.store).hasUndo(), [] ); const { undo } = (0, import_data16.useDispatch)(import_core_data9.store); return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)( import_components12.Button, { ...props, ref, icon: !(0, import_i18n9.isRTL)() ? undo_default : redo_default, label: (0, import_i18n9.__)("Undo"), shortcut: import_keycodes2.displayShortcut.primary("z"), "aria-disabled": !hasUndo, onClick: hasUndo ? undo : void 0, size: "compact" } ); } var undo_default2 = (0, import_element13.forwardRef)(UndoButton); // packages/edit-widgets/build-module/components/header/undo-redo/redo.mjs var import_i18n10 = __toESM(require_i18n(), 1); var import_components13 = __toESM(require_components(), 1); var import_data17 = __toESM(require_data(), 1); var import_keycodes3 = __toESM(require_keycodes(), 1); var import_core_data10 = __toESM(require_core_data(), 1); var import_element14 = __toESM(require_element(), 1); var import_jsx_runtime30 = __toESM(require_jsx_runtime(), 1); function RedoButton(props, ref) { const shortcut = (0, import_keycodes3.isAppleOS)() ? import_keycodes3.displayShortcut.primaryShift("z") : import_keycodes3.displayShortcut.primary("y"); const hasRedo = (0, import_data17.useSelect)( (select) => select(import_core_data10.store).hasRedo(), [] ); const { redo } = (0, import_data17.useDispatch)(import_core_data10.store); return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)( import_components13.Button, { ...props, ref, icon: !(0, import_i18n10.isRTL)() ? redo_default : undo_default, label: (0, import_i18n10.__)("Redo"), shortcut, "aria-disabled": !hasRedo, onClick: hasRedo ? redo : void 0, size: "compact" } ); } var redo_default2 = (0, import_element14.forwardRef)(RedoButton); // packages/edit-widgets/build-module/components/header/document-tools/index.mjs var import_jsx_runtime31 = __toESM(require_jsx_runtime(), 1); function DocumentTools() { const isMediumViewport = (0, import_compose6.useViewportMatch)("medium"); const { isInserterOpen, isListViewOpen, inserterSidebarToggleRef: inserterSidebarToggleRef2, listViewToggleRef: listViewToggleRef2 } = (0, import_data18.useSelect)((select) => { const { isInserterOpened: isInserterOpened2, getInserterSidebarToggleRef: getInserterSidebarToggleRef2, isListViewOpened: isListViewOpened2, getListViewToggleRef: getListViewToggleRef2 } = unlock(select(store2)); return { isInserterOpen: isInserterOpened2(), isListViewOpen: isListViewOpened2(), inserterSidebarToggleRef: getInserterSidebarToggleRef2(), listViewToggleRef: getListViewToggleRef2() }; }, []); const { setIsInserterOpened: setIsInserterOpened2, setIsListViewOpened: setIsListViewOpened2 } = (0, import_data18.useDispatch)(store2); const toggleListView = (0, import_element15.useCallback)( () => setIsListViewOpened2(!isListViewOpen), [setIsListViewOpened2, isListViewOpen] ); const toggleInserterSidebar = (0, import_element15.useCallback)( () => setIsInserterOpened2(!isInserterOpen), [setIsInserterOpened2, isInserterOpen] ); return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)( import_block_editor11.NavigableToolbar, { className: "edit-widgets-header-toolbar", "aria-label": (0, import_i18n11.__)("Document tools"), variant: "unstyled", children: [ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)( import_components14.ToolbarItem, { ref: inserterSidebarToggleRef2, as: import_components14.Button, className: "edit-widgets-header-toolbar__inserter-toggle", variant: "primary", isPressed: isInserterOpen, onMouseDown: (event) => { event.preventDefault(); }, onClick: toggleInserterSidebar, icon: plus_default, label: (0, import_i18n11._x)( "Block Inserter", "Generic label for block inserter button" ), size: "compact" } ), isMediumViewport && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_components14.ToolbarItem, { as: undo_default2 }), /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_components14.ToolbarItem, { as: redo_default2 }), /* @__PURE__ */ (0, import_jsx_runtime31.jsx)( import_components14.ToolbarItem, { as: import_components14.Button, className: "edit-widgets-header-toolbar__list-view-toggle", icon: list_view_default, isPressed: isListViewOpen, label: (0, import_i18n11.__)("List View"), onClick: toggleListView, ref: listViewToggleRef2, size: "compact" } ) ] }) ] } ); } var document_tools_default = DocumentTools; // packages/edit-widgets/build-module/components/save-button/index.mjs var import_components15 = __toESM(require_components(), 1); var import_i18n12 = __toESM(require_i18n(), 1); var import_data19 = __toESM(require_data(), 1); var import_jsx_runtime32 = __toESM(require_jsx_runtime(), 1); function SaveButton() { const { hasEditedWidgetAreaIds, isSaving, isWidgetSaveLocked } = (0, import_data19.useSelect)( (select) => { const { getEditedWidgetAreas: getEditedWidgetAreas2, isSavingWidgetAreas: isSavingWidgetAreas2, isWidgetSavingLocked: isWidgetSavingLocked2 } = select(store2); return { hasEditedWidgetAreaIds: getEditedWidgetAreas2()?.length > 0, isSaving: isSavingWidgetAreas2(), isWidgetSaveLocked: isWidgetSavingLocked2() }; }, [] ); const { saveEditedWidgetAreas: saveEditedWidgetAreas2 } = (0, import_data19.useDispatch)(store2); const isDisabled = isWidgetSaveLocked || isSaving || !hasEditedWidgetAreaIds; return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)( import_components15.Button, { variant: "primary", isBusy: isSaving, "aria-disabled": isDisabled, onClick: isDisabled ? void 0 : saveEditedWidgetAreas2, size: "compact", children: isSaving ? (0, import_i18n12.__)("Saving\u2026") : (0, import_i18n12.__)("Update") } ); } var save_button_default = SaveButton; // packages/edit-widgets/build-module/components/more-menu/index.mjs var import_components18 = __toESM(require_components(), 1); var import_element17 = __toESM(require_element(), 1); var import_i18n15 = __toESM(require_i18n(), 1); var import_preferences5 = __toESM(require_preferences(), 1); var import_keycodes5 = __toESM(require_keycodes(), 1); var import_keyboard_shortcuts5 = __toESM(require_keyboard_shortcuts(), 1); var import_compose7 = __toESM(require_compose(), 1); // packages/edit-widgets/build-module/components/keyboard-shortcut-help-modal/index.mjs var import_components16 = __toESM(require_components(), 1); var import_i18n14 = __toESM(require_i18n(), 1); var import_keyboard_shortcuts4 = __toESM(require_keyboard_shortcuts(), 1); var import_data21 = __toESM(require_data(), 1); // packages/edit-widgets/build-module/components/keyboard-shortcut-help-modal/config.mjs var import_i18n13 = __toESM(require_i18n(), 1); var textFormattingShortcuts = [ { keyCombination: { modifier: "primary", character: "b" }, description: (0, import_i18n13.__)("Make the selected text bold.") }, { keyCombination: { modifier: "primary", character: "i" }, description: (0, import_i18n13.__)("Make the selected text italic.") }, { keyCombination: { modifier: "primary", character: "k" }, description: (0, import_i18n13.__)("Convert the selected text into a link.") }, { keyCombination: { modifier: "primaryShift", character: "k" }, description: (0, import_i18n13.__)("Remove a link.") }, { keyCombination: { character: "[[" }, description: (0, import_i18n13.__)("Insert a link to a post or page.") }, { keyCombination: { modifier: "primary", character: "u" }, description: (0, import_i18n13.__)("Underline the selected text.") }, { keyCombination: { modifier: "access", character: "d" }, description: (0, import_i18n13.__)("Strikethrough the selected text.") }, { keyCombination: { modifier: "access", character: "x" }, description: (0, import_i18n13.__)("Make the selected text inline code.") }, { keyCombination: { modifier: "access", character: "0" }, aliases: [ { modifier: "access", character: "7" } ], description: (0, import_i18n13.__)("Convert the current heading to a paragraph.") }, { keyCombination: { modifier: "access", character: "1-6" }, description: (0, import_i18n13.__)( "Convert the current paragraph or heading to a heading of level 1 to 6." ) }, { keyCombination: { modifier: "primaryShift", character: "SPACE" }, description: (0, import_i18n13.__)("Add non breaking space.") } ]; // packages/edit-widgets/build-module/components/keyboard-shortcut-help-modal/shortcut.mjs var import_element16 = __toESM(require_element(), 1); var import_keycodes4 = __toESM(require_keycodes(), 1); var import_jsx_runtime33 = __toESM(require_jsx_runtime(), 1); function KeyCombination({ keyCombination, forceAriaLabel }) { const shortcut = keyCombination.modifier ? import_keycodes4.displayShortcutList[keyCombination.modifier]( keyCombination.character ) : keyCombination.character; const ariaLabel = keyCombination.modifier ? import_keycodes4.shortcutAriaLabel[keyCombination.modifier]( keyCombination.character ) : keyCombination.character; const shortcuts = Array.isArray(shortcut) ? shortcut : [shortcut]; return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)( "kbd", { className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-key-combination", "aria-label": forceAriaLabel || ariaLabel, children: shortcuts.map((character, index) => { if (character === "+") { return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_element16.Fragment, { children: character }, index); } return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)( "kbd", { className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-key", children: character }, index ); }) } ); } function Shortcut({ description, keyCombination, aliases = [], ariaLabel }) { return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-description", children: description }), /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-term", children: [ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)( KeyCombination, { keyCombination, forceAriaLabel: ariaLabel } ), aliases.map((alias, index) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)( KeyCombination, { keyCombination: alias, forceAriaLabel: ariaLabel }, index )) ] }) ] }); } var shortcut_default = Shortcut; // packages/edit-widgets/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.mjs var import_data20 = __toESM(require_data(), 1); var import_keyboard_shortcuts3 = __toESM(require_keyboard_shortcuts(), 1); var import_jsx_runtime34 = __toESM(require_jsx_runtime(), 1); function DynamicShortcut({ name: name2 }) { const { keyCombination, description, aliases } = (0, import_data20.useSelect)( (select) => { const { getShortcutKeyCombination, getShortcutDescription, getShortcutAliases } = select(import_keyboard_shortcuts3.store); return { keyCombination: getShortcutKeyCombination(name2), aliases: getShortcutAliases(name2), description: getShortcutDescription(name2) }; }, [name2] ); if (!keyCombination) { return null; } return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)( shortcut_default, { keyCombination, description, aliases } ); } var dynamic_shortcut_default = DynamicShortcut; // packages/edit-widgets/build-module/components/keyboard-shortcut-help-modal/index.mjs var import_jsx_runtime35 = __toESM(require_jsx_runtime(), 1); var ShortcutList = ({ shortcuts }) => ( /* * Disable reason: The `list` ARIA role is redundant but * Safari+VoiceOver won't announce the list otherwise. */ /* eslint-disable jsx-a11y/no-redundant-roles */ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)( "ul", { className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-list", role: "list", children: shortcuts.map((shortcut, index) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)( "li", { className: "edit-widgets-keyboard-shortcut-help-modal__shortcut", children: typeof shortcut === "string" ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(dynamic_shortcut_default, { name: shortcut }) : /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(shortcut_default, { ...shortcut }) }, index )) } ) ); var ShortcutSection = ({ title, shortcuts, className }) => /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)( "section", { className: clsx_default( "edit-widgets-keyboard-shortcut-help-modal__section", className ), children: [ !!title && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("h2", { className: "edit-widgets-keyboard-shortcut-help-modal__section-title", children: title }), /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ShortcutList, { shortcuts }) ] } ); var ShortcutCategorySection = ({ title, categoryName, additionalShortcuts = [] }) => { const categoryShortcuts = (0, import_data21.useSelect)( (select) => { return select(import_keyboard_shortcuts4.store).getCategoryShortcuts( categoryName ); }, [categoryName] ); return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)( ShortcutSection, { title, shortcuts: categoryShortcuts.concat(additionalShortcuts) } ); }; function KeyboardShortcutHelpModal({ isModalActive: isModalActive2, toggleModal }) { (0, import_keyboard_shortcuts4.useShortcut)("core/edit-widgets/keyboard-shortcuts", toggleModal, { bindGlobal: true }); if (!isModalActive2) { return null; } return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)( import_components16.Modal, { className: "edit-widgets-keyboard-shortcut-help-modal", title: (0, import_i18n14.__)("Keyboard shortcuts"), onRequestClose: toggleModal, children: [ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)( ShortcutSection, { className: "edit-widgets-keyboard-shortcut-help-modal__main-shortcuts", shortcuts: ["core/edit-widgets/keyboard-shortcuts"] } ), /* @__PURE__ */ (0, import_jsx_runtime35.jsx)( ShortcutCategorySection, { title: (0, import_i18n14.__)("Global shortcuts"), categoryName: "global" } ), /* @__PURE__ */ (0, import_jsx_runtime35.jsx)( ShortcutCategorySection, { title: (0, import_i18n14.__)("Selection shortcuts"), categoryName: "selection" } ), /* @__PURE__ */ (0, import_jsx_runtime35.jsx)( ShortcutCategorySection, { title: (0, import_i18n14.__)("Block shortcuts"), categoryName: "block", additionalShortcuts: [ { keyCombination: { character: "/" }, description: (0, import_i18n14.__)( "Change the block type after adding a new paragraph." ), /* translators: The forward-slash character. e.g. '/'. */ ariaLabel: (0, import_i18n14.__)("Forward-slash") } ] } ), /* @__PURE__ */ (0, import_jsx_runtime35.jsx)( ShortcutSection, { title: (0, import_i18n14.__)("Text formatting"), shortcuts: textFormattingShortcuts } ), /* @__PURE__ */ (0, import_jsx_runtime35.jsx)( ShortcutCategorySection, { title: (0, import_i18n14.__)("List View shortcuts"), categoryName: "list-view" } ) ] } ); } // packages/edit-widgets/build-module/components/more-menu/tools-more-menu-group.mjs var import_components17 = __toESM(require_components(), 1); var import_jsx_runtime36 = __toESM(require_jsx_runtime(), 1); var { Fill: ToolsMoreMenuGroup, Slot: Slot4 } = (0, import_components17.createSlotFill)( "EditWidgetsToolsMoreMenuGroup" ); ToolsMoreMenuGroup.Slot = ({ fillProps }) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Slot4, { fillProps, children: (fills) => fills.length > 0 && fills }); var tools_more_menu_group_default = ToolsMoreMenuGroup; // packages/edit-widgets/build-module/components/more-menu/index.mjs var import_jsx_runtime37 = __toESM(require_jsx_runtime(), 1); function MoreMenu() { const [ isKeyboardShortcutsModalActive, setIsKeyboardShortcutsModalVisible ] = (0, import_element17.useState)(false); const toggleKeyboardShortcutsModal = () => setIsKeyboardShortcutsModalVisible(!isKeyboardShortcutsModalActive); (0, import_keyboard_shortcuts5.useShortcut)( "core/edit-widgets/keyboard-shortcuts", toggleKeyboardShortcutsModal ); const isLargeViewport = (0, import_compose7.useViewportMatch)("medium"); return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)( import_components18.DropdownMenu, { icon: more_vertical_default, label: (0, import_i18n15.__)("Options"), popoverProps: { placement: "bottom-end", className: "more-menu-dropdown__content" }, toggleProps: { tooltipPosition: "bottom", size: "compact" }, children: (onClose) => /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [ isLargeViewport && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_components18.MenuGroup, { label: (0, import_i18n15._x)("View", "noun"), children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)( import_preferences5.PreferenceToggleMenuItem, { scope: "core/edit-widgets", name: "fixedToolbar", label: (0, import_i18n15.__)("Top toolbar"), info: (0, import_i18n15.__)( "Access all block and document tools in a single place" ), messageActivated: (0, import_i18n15.__)( "Top toolbar activated" ), messageDeactivated: (0, import_i18n15.__)( "Top toolbar deactivated" ) } ) }), /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_components18.MenuGroup, { label: (0, import_i18n15.__)("Tools"), children: [ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)( import_components18.MenuItem, { onClick: () => { setIsKeyboardShortcutsModalVisible(true); }, shortcut: import_keycodes5.displayShortcut.access("h"), children: (0, import_i18n15.__)("Keyboard shortcuts") } ), /* @__PURE__ */ (0, import_jsx_runtime37.jsx)( import_preferences5.PreferenceToggleMenuItem, { scope: "core/edit-widgets", name: "welcomeGuide", label: (0, import_i18n15.__)("Welcome Guide") } ), /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)( import_components18.MenuItem, { role: "menuitem", icon: external_default, href: (0, import_i18n15.__)( "https://wordpress.org/documentation/article/block-based-widgets-editor/" ), target: "_blank", rel: "noopener noreferrer", children: [ (0, import_i18n15.__)("Help"), /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_components18.VisuallyHidden, { as: "span", /* translators: accessibility text */ children: (0, import_i18n15.__)("(opens in a new tab)") }) ] } ), /* @__PURE__ */ (0, import_jsx_runtime37.jsx)( tools_more_menu_group_default.Slot, { fillProps: { onClose } } ) ] }), /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_components18.MenuGroup, { label: (0, import_i18n15.__)("Preferences"), children: [ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)( import_preferences5.PreferenceToggleMenuItem, { scope: "core/edit-widgets", name: "keepCaretInsideBlock", label: (0, import_i18n15.__)( "Contain text cursor inside block" ), info: (0, import_i18n15.__)( "Aids screen readers by stopping text caret from leaving blocks." ), messageActivated: (0, import_i18n15.__)( "Contain text cursor inside block activated" ), messageDeactivated: (0, import_i18n15.__)( "Contain text cursor inside block deactivated" ) } ), /* @__PURE__ */ (0, import_jsx_runtime37.jsx)( import_preferences5.PreferenceToggleMenuItem, { scope: "core/edit-widgets", name: "themeStyles", info: (0, import_i18n15.__)( "Make the editor look like your theme." ), label: (0, import_i18n15.__)("Use theme styles") } ), isLargeViewport && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)( import_preferences5.PreferenceToggleMenuItem, { scope: "core/edit-widgets", name: "showBlockBreadcrumbs", label: (0, import_i18n15.__)("Display block breadcrumbs"), info: (0, import_i18n15.__)( "Shows block breadcrumbs at the bottom of the editor." ), messageActivated: (0, import_i18n15.__)( "Display block breadcrumbs activated" ), messageDeactivated: (0, import_i18n15.__)( "Display block breadcrumbs deactivated" ) } ) ] }) ] }) } ), /* @__PURE__ */ (0, import_jsx_runtime37.jsx)( KeyboardShortcutHelpModal, { isModalActive: isKeyboardShortcutsModalActive, toggleModal: toggleKeyboardShortcutsModal } ) ] }); } // packages/edit-widgets/build-module/components/header/index.mjs var import_jsx_runtime38 = __toESM(require_jsx_runtime(), 1); function Header() { const isLargeViewport = (0, import_compose8.useViewportMatch)("medium"); const blockToolbarRef = (0, import_element18.useRef)(); const { hasFixedToolbar } = (0, import_data22.useSelect)( (select) => ({ hasFixedToolbar: !!select(import_preferences6.store).get( "core/edit-widgets", "fixedToolbar" ) }), [] ); return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_jsx_runtime38.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "edit-widgets-header", children: [ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "edit-widgets-header__navigable-toolbar-wrapper", children: [ isLargeViewport && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("h1", { className: "edit-widgets-header__title", children: (0, import_i18n16.__)("Widgets") }), !isLargeViewport && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)( import_components19.VisuallyHidden, { as: "h1", className: "edit-widgets-header__title", children: (0, import_i18n16.__)("Widgets") } ), /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(document_tools_default, {}), hasFixedToolbar && isLargeViewport && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "selected-block-tools-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_block_editor12.BlockToolbar, { hideDragHandle: true }) }), /* @__PURE__ */ (0, import_jsx_runtime38.jsx)( import_components19.Popover.Slot, { ref: blockToolbarRef, name: "block-toolbar" } ) ] }) ] }), /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "edit-widgets-header__actions", children: [ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(pinned_items_default.Slot, { scope: "core/edit-widgets" }), /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(save_button_default, {}), /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(MoreMenu, {}) ] }) ] }) }); } var header_default = Header; // packages/edit-widgets/build-module/components/widget-areas-block-editor-content/index.mjs var import_block_editor13 = __toESM(require_block_editor(), 1); var import_compose9 = __toESM(require_compose(), 1); var import_data23 = __toESM(require_data(), 1); var import_element19 = __toESM(require_element(), 1); var import_preferences7 = __toESM(require_preferences(), 1); // packages/edit-widgets/build-module/components/notices/index.mjs var import_notices2 = __toESM(require_notices(), 1); var import_jsx_runtime39 = __toESM(require_jsx_runtime(), 1); function Notices() { return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_jsx_runtime39.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)( import_notices2.InlineNotices, { pinnedNoticesClassName: "edit-widgets-notices__pinned", dismissibleNoticesClassName: "edit-widgets-notices__dismissible" } ), /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_notices2.SnackbarNotices, { className: "edit-widgets-notices__snackbar" }) ] }); } var notices_default = Notices; // packages/edit-widgets/build-module/components/widget-areas-block-editor-content/index.mjs var import_jsx_runtime40 = __toESM(require_jsx_runtime(), 1); function WidgetAreasBlockEditorContent({ blockEditorSettings }) { const hasThemeStyles = (0, import_data23.useSelect)( (select) => !!select(import_preferences7.store).get( "core/edit-widgets", "themeStyles" ), [] ); const isLargeViewport = (0, import_compose9.useViewportMatch)("medium"); const styles = (0, import_element19.useMemo)(() => { return hasThemeStyles ? blockEditorSettings.styles : []; }, [blockEditorSettings, hasThemeStyles]); return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "edit-widgets-block-editor", children: [ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(notices_default, {}), !isLargeViewport && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_block_editor13.BlockToolbar, { hideDragHandle: true }), /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_block_editor13.BlockTools, { children: [ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(keyboard_shortcuts_default, {}), /* @__PURE__ */ (0, import_jsx_runtime40.jsx)( import_block_editor13.__unstableEditorStyles, { styles, scope: ":where(.editor-styles-wrapper)" } ), /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_block_editor13.BlockSelectionClearer, { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_block_editor13.WritingFlow, { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_block_editor13.BlockList, { className: "edit-widgets-main-block-list" }) }) }) ] }) ] }); } // packages/edit-widgets/build-module/components/secondary-sidebar/index.mjs var import_data27 = __toESM(require_data(), 1); // packages/edit-widgets/build-module/components/secondary-sidebar/inserter-sidebar.mjs var import_block_editor15 = __toESM(require_block_editor(), 1); var import_compose10 = __toESM(require_compose(), 1); var import_element20 = __toESM(require_element(), 1); var import_data25 = __toESM(require_data(), 1); // packages/edit-widgets/build-module/hooks/use-widget-library-insertion-point.mjs var import_data24 = __toESM(require_data(), 1); var import_block_editor14 = __toESM(require_block_editor(), 1); var import_core_data11 = __toESM(require_core_data(), 1); var useWidgetLibraryInsertionPoint = () => { const firstRootId = (0, import_data24.useSelect)((select) => { const { getEntityRecord } = select(import_core_data11.store); const widgetAreasPost = getEntityRecord( KIND, POST_TYPE, buildWidgetAreasPostId() ); return widgetAreasPost?.blocks[0]?.clientId; }, []); return (0, import_data24.useSelect)( (select) => { const { getBlockRootClientId, getBlockSelectionEnd, getBlockOrder, getBlockIndex } = select(import_block_editor14.store); const insertionPoint = select(store2).__experimentalGetInsertionPoint(); if (insertionPoint.rootClientId) { return insertionPoint; } const clientId = getBlockSelectionEnd() || firstRootId; const rootClientId = getBlockRootClientId(clientId); if (clientId && rootClientId === "") { return { rootClientId: clientId, insertionIndex: getBlockOrder(clientId).length }; } return { rootClientId, insertionIndex: getBlockIndex(clientId) + 1 }; }, [firstRootId] ); }; var use_widget_library_insertion_point_default = useWidgetLibraryInsertionPoint; // packages/edit-widgets/build-module/components/secondary-sidebar/inserter-sidebar.mjs var import_jsx_runtime41 = __toESM(require_jsx_runtime(), 1); function InserterSidebar() { const isMobileViewport = (0, import_compose10.useViewportMatch)("medium", "<"); const { rootClientId, insertionIndex } = use_widget_library_insertion_point_default(); const { setIsInserterOpened: setIsInserterOpened2 } = (0, import_data25.useDispatch)(store2); const closeInserter = (0, import_element20.useCallback)(() => { return setIsInserterOpened2(false); }, [setIsInserterOpened2]); const libraryRef = (0, import_element20.useRef)(); return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "edit-widgets-layout__inserter-panel", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "edit-widgets-layout__inserter-panel-content", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)( import_block_editor15.__experimentalLibrary, { showInserterHelpPanel: true, shouldFocusBlock: isMobileViewport, rootClientId, __experimentalInsertionIndex: insertionIndex, ref: libraryRef, onClose: closeInserter } ) }) }); } // packages/edit-widgets/build-module/components/secondary-sidebar/list-view-sidebar.mjs var import_block_editor16 = __toESM(require_block_editor(), 1); var import_components20 = __toESM(require_components(), 1); var import_compose11 = __toESM(require_compose(), 1); var import_data26 = __toESM(require_data(), 1); var import_element21 = __toESM(require_element(), 1); var import_i18n17 = __toESM(require_i18n(), 1); var import_keycodes6 = __toESM(require_keycodes(), 1); var import_jsx_runtime42 = __toESM(require_jsx_runtime(), 1); function ListViewSidebar() { const { setIsListViewOpened: setIsListViewOpened2 } = (0, import_data26.useDispatch)(store2); const { getListViewToggleRef: getListViewToggleRef2 } = unlock((0, import_data26.useSelect)(store2)); const [dropZoneElement, setDropZoneElement] = (0, import_element21.useState)(null); const focusOnMountRef = (0, import_compose11.useFocusOnMount)("firstElement"); const closeListView = (0, import_element21.useCallback)(() => { setIsListViewOpened2(false); getListViewToggleRef2().current?.focus(); }, [getListViewToggleRef2, setIsListViewOpened2]); const closeOnEscape = (0, import_element21.useCallback)( (event) => { if (event.keyCode === import_keycodes6.ESCAPE && !event.defaultPrevented) { event.preventDefault(); closeListView(); } }, [closeListView] ); return ( // eslint-disable-next-line jsx-a11y/no-static-element-interactions /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)( "div", { className: "edit-widgets-editor__list-view-panel", onKeyDown: closeOnEscape, children: [ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "edit-widgets-editor__list-view-panel-header", children: [ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("strong", { children: (0, import_i18n17.__)("List View") }), /* @__PURE__ */ (0, import_jsx_runtime42.jsx)( import_components20.Button, { icon: close_small_default, label: (0, import_i18n17.__)("Close"), onClick: closeListView, size: "compact" } ) ] }), /* @__PURE__ */ (0, import_jsx_runtime42.jsx)( "div", { className: "edit-widgets-editor__list-view-panel-content", ref: (0, import_compose11.useMergeRefs)([focusOnMountRef, setDropZoneElement]), children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_block_editor16.__experimentalListView, { dropZoneElement }) } ) ] } ) ); } // packages/edit-widgets/build-module/components/secondary-sidebar/index.mjs var import_jsx_runtime43 = __toESM(require_jsx_runtime(), 1); function SecondarySidebar() { const { isInserterOpen, isListViewOpen } = (0, import_data27.useSelect)((select) => { const { isInserterOpened: isInserterOpened2, isListViewOpened: isListViewOpened2 } = select(store2); return { isInserterOpen: isInserterOpened2(), isListViewOpen: isListViewOpened2() }; }, []); if (isInserterOpen) { return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(InserterSidebar, {}); } if (isListViewOpen) { return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(ListViewSidebar, {}); } return null; } // packages/edit-widgets/build-module/components/layout/interface.mjs var import_jsx_runtime44 = __toESM(require_jsx_runtime(), 1); var interfaceLabels = { /* translators: accessibility text for the widgets screen top bar landmark region. */ header: (0, import_i18n18.__)("Widgets top bar"), /* translators: accessibility text for the widgets screen content landmark region. */ body: (0, import_i18n18.__)("Widgets and blocks"), /* translators: accessibility text for the widgets screen settings landmark region. */ sidebar: (0, import_i18n18.__)("Widgets settings"), /* translators: accessibility text for the widgets screen footer landmark region. */ footer: (0, import_i18n18.__)("Widgets footer") }; function Interface({ blockEditorSettings }) { const isMobileViewport = (0, import_compose12.useViewportMatch)("medium", "<"); const isHugeViewport = (0, import_compose12.useViewportMatch)("huge", ">="); const { setIsInserterOpened: setIsInserterOpened2, setIsListViewOpened: setIsListViewOpened2, closeGeneralSidebar: closeGeneralSidebar2 } = (0, import_data28.useDispatch)(store2); const { hasBlockBreadCrumbsEnabled, hasSidebarEnabled, isInserterOpened: isInserterOpened2, isListViewOpened: isListViewOpened2 } = (0, import_data28.useSelect)( (select) => ({ hasSidebarEnabled: !!select( store ).getActiveComplementaryArea(store2.name), isInserterOpened: !!select(store2).isInserterOpened(), isListViewOpened: !!select(store2).isListViewOpened(), hasBlockBreadCrumbsEnabled: !!select(import_preferences8.store).get( "core/edit-widgets", "showBlockBreadcrumbs" ) }), [] ); (0, import_element22.useEffect)(() => { if (hasSidebarEnabled && !isHugeViewport) { setIsInserterOpened2(false); setIsListViewOpened2(false); } }, [hasSidebarEnabled, isHugeViewport]); (0, import_element22.useEffect)(() => { if ((isInserterOpened2 || isListViewOpened2) && !isHugeViewport) { closeGeneralSidebar2(); } }, [isInserterOpened2, isListViewOpened2, isHugeViewport]); const secondarySidebarLabel = isListViewOpened2 ? (0, import_i18n18.__)("List View") : (0, import_i18n18.__)("Block Library"); const hasSecondarySidebar = isListViewOpened2 || isInserterOpened2; return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)( interface_skeleton_default, { labels: { ...interfaceLabels, secondarySidebar: secondarySidebarLabel }, header: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(header_default, {}), secondarySidebar: hasSecondarySidebar && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(SecondarySidebar, {}), sidebar: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(complementary_area_default.Slot, { scope: "core/edit-widgets" }), content: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_jsx_runtime44.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)( WidgetAreasBlockEditorContent, { blockEditorSettings } ) }), footer: hasBlockBreadCrumbsEnabled && !isMobileViewport && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "edit-widgets-layout__footer", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_block_editor17.BlockBreadcrumb, { rootLabelText: (0, import_i18n18.__)("Widgets") }) }) } ); } var interface_default = Interface; // packages/edit-widgets/build-module/components/layout/unsaved-changes-warning.mjs var import_i18n19 = __toESM(require_i18n(), 1); var import_element23 = __toESM(require_element(), 1); var import_data29 = __toESM(require_data(), 1); function UnsavedChangesWarning() { const isDirty = (0, import_data29.useSelect)((select) => { const { getEditedWidgetAreas: getEditedWidgetAreas2 } = select(store2); const editedWidgetAreas = getEditedWidgetAreas2(); return editedWidgetAreas?.length > 0; }, []); (0, import_element23.useEffect)(() => { const warnIfUnsavedChanges = (event) => { if (isDirty) { event.returnValue = (0, import_i18n19.__)( "You have unsaved changes. If you proceed, they will be lost." ); return event.returnValue; } }; window.addEventListener("beforeunload", warnIfUnsavedChanges); return () => { window.removeEventListener("beforeunload", warnIfUnsavedChanges); }; }, [isDirty]); return null; } // packages/edit-widgets/build-module/components/welcome-guide/index.mjs var import_data30 = __toESM(require_data(), 1); var import_components21 = __toESM(require_components(), 1); var import_i18n20 = __toESM(require_i18n(), 1); var import_element24 = __toESM(require_element(), 1); var import_preferences9 = __toESM(require_preferences(), 1); var import_jsx_runtime45 = __toESM(require_jsx_runtime(), 1); function WelcomeGuide() { const isActive = (0, import_data30.useSelect)( (select) => !!select(import_preferences9.store).get( "core/edit-widgets", "welcomeGuide" ), [] ); const { toggle } = (0, import_data30.useDispatch)(import_preferences9.store); const widgetAreas = (0, import_data30.useSelect)( (select) => select(store2).getWidgetAreas({ per_page: -1 }), [] ); if (!isActive) { return null; } const isEntirelyBlockWidgets = widgetAreas?.every( (widgetArea) => widgetArea.id === "wp_inactive_widgets" || widgetArea.widgets.every( (widgetId) => widgetId.startsWith("block-") ) ); const numWidgetAreas = widgetAreas?.filter( (widgetArea) => widgetArea.id !== "wp_inactive_widgets" ).length ?? 0; return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)( import_components21.Guide, { className: "edit-widgets-welcome-guide", contentLabel: (0, import_i18n20.__)("Welcome to block Widgets"), finishButtonText: (0, import_i18n20.__)("Get started"), onFinish: () => toggle("core/edit-widgets", "welcomeGuide"), pages: [ { image: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)( WelcomeGuideImage, { nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-canvas.svg", animatedSrc: "https://s.w.org/images/block-editor/welcome-canvas.gif" } ), content: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("h1", { className: "edit-widgets-welcome-guide__heading", children: (0, import_i18n20.__)("Welcome to block Widgets") }), isEntirelyBlockWidgets ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_jsx_runtime45.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: "edit-widgets-welcome-guide__text", children: (0, import_i18n20.sprintf)( // Translators: %s: Number of block areas in the current theme. (0, import_i18n20._n)( "Your theme provides %s \u201Cblock\u201D area for you to add and edit content.\xA0Try adding a search bar, social icons, or other types of blocks here and see how they\u2019ll look on your site.", "Your theme provides %s different \u201Cblock\u201D areas for you to add and edit content.\xA0Try adding a search bar, social icons, or other types of blocks here and see how they\u2019ll look on your site.", numWidgetAreas ), numWidgetAreas ) }) }) : /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: "edit-widgets-welcome-guide__text", children: (0, import_i18n20.__)( "You can now add any block to your site\u2019s widget areas. Don\u2019t worry, all of your favorite widgets still work flawlessly." ) }), /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("p", { className: "edit-widgets-welcome-guide__text", children: [ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("strong", { children: (0, import_i18n20.__)( "Want to stick with the old widgets?" ) }), " ", /* @__PURE__ */ (0, import_jsx_runtime45.jsx)( import_components21.ExternalLink, { href: (0, import_i18n20.__)( "https://wordpress.org/plugins/classic-widgets/" ), children: (0, import_i18n20.__)( "Get the Classic Widgets plugin." ) } ) ] }) ] }) ] }) }, { image: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)( WelcomeGuideImage, { nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-editor.svg", animatedSrc: "https://s.w.org/images/block-editor/welcome-editor.gif" } ), content: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("h1", { className: "edit-widgets-welcome-guide__heading", children: (0, import_i18n20.__)("Customize each block") }), /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: "edit-widgets-welcome-guide__text", children: (0, import_i18n20.__)( "Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected." ) }) ] }) }, { image: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)( WelcomeGuideImage, { nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-library.svg", animatedSrc: "https://s.w.org/images/block-editor/welcome-library.gif" } ), content: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("h1", { className: "edit-widgets-welcome-guide__heading", children: (0, import_i18n20.__)("Explore all blocks") }), /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: "edit-widgets-welcome-guide__text", children: (0, import_element24.createInterpolateElement)( (0, import_i18n20.__)( "All of the blocks available to you live in the block library. You\u2019ll find it wherever you see the <InserterIconImage /> icon." ), { InserterIconImage: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)( "img", { className: "edit-widgets-welcome-guide__inserter-icon", alt: (0, import_i18n20.__)("inserter"), src: "data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='18' height='18' rx='2' fill='%231E1E1E'/%3E%3Cpath d='M9.22727 4V14M4 8.77273H14' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E%0A" } ) } ) }) ] }) }, { image: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)( WelcomeGuideImage, { nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-documentation.svg", animatedSrc: "https://s.w.org/images/block-editor/welcome-documentation.gif" } ), content: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("h1", { className: "edit-widgets-welcome-guide__heading", children: (0, import_i18n20.__)("Learn more") }), /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: "edit-widgets-welcome-guide__text", children: (0, import_element24.createInterpolateElement)( (0, import_i18n20.__)( "New to the block editor? Want to learn more about using it? <a>Here's a detailed guide.</a>" ), { a: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)( import_components21.ExternalLink, { href: (0, import_i18n20.__)( "https://wordpress.org/documentation/article/wordpress-block-editor/" ) } ) } ) }) ] }) } ] } ); } function WelcomeGuideImage({ nonAnimatedSrc, animatedSrc }) { return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("picture", { className: "edit-widgets-welcome-guide__image", children: [ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)( "source", { srcSet: nonAnimatedSrc, media: "(prefers-reduced-motion: reduce)" } ), /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("img", { src: animatedSrc, width: "312", height: "240", alt: "" }) ] }); } // packages/edit-widgets/build-module/components/layout/index.mjs var import_jsx_runtime46 = __toESM(require_jsx_runtime(), 1); function Layout({ blockEditorSettings }) { const { createErrorNotice } = (0, import_data31.useDispatch)(import_notices4.store); function onPluginAreaError(name2) { createErrorNotice( (0, import_i18n21.sprintf)( /* translators: %s: plugin name */ (0, import_i18n21.__)( 'The "%s" plugin has encountered an error and cannot be rendered.' ), name2 ) ); } const navigateRegionsProps = (0, import_components22.__unstableUseNavigateRegions)(); return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(ErrorBoundary, { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)( "div", { className: navigateRegionsProps.className, ...navigateRegionsProps, ref: navigateRegionsProps.ref, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)( WidgetAreasBlockEditorProvider, { blockEditorSettings, children: [ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(interface_default, { blockEditorSettings }), /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Sidebar, {}), /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_plugins3.PluginArea, { onError: onPluginAreaError }), /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(UnsavedChangesWarning, {}), /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(WelcomeGuide, {}) ] } ) } ) }); } var layout_default = Layout; // packages/edit-widgets/build-module/index.mjs var import_jsx_runtime47 = __toESM(require_jsx_runtime(), 1); var disabledBlocks = [ "core/more", "core/freeform", "core/template-part", ...ALLOW_REUSABLE_BLOCKS ? [] : ["core/block"] ]; function initializeEditor(id, settings2) { const target = document.getElementById(id); const root = (0, import_element25.createRoot)(target); const coreBlocks = (0, import_block_library2.__experimentalGetCoreBlocks)().filter((block) => { return !(disabledBlocks.includes(block.name) || block.name.startsWith("core/post") || block.name.startsWith("core/query") || block.name.startsWith("core/site") || block.name.startsWith("core/navigation") || block.name.startsWith("core/term")); }); (0, import_data32.dispatch)(import_preferences10.store).setDefaults("core/edit-widgets", { fixedToolbar: false, welcomeGuide: true, showBlockBreadcrumbs: true, themeStyles: true }); (0, import_data32.dispatch)(import_blocks3.store).reapplyBlockTypeFilters(); (0, import_block_library2.registerCoreBlocks)(coreBlocks); (0, import_widgets5.registerLegacyWidgetBlock)(); if (false) { (0, import_block_library2.__experimentalRegisterExperimentalCoreBlocks)({ enableFSEBlocks: ENABLE_EXPERIMENTAL_FSE_BLOCKS }); } (0, import_widgets5.registerLegacyWidgetVariations)(settings2); registerBlock(widget_area_exports); (0, import_widgets5.registerWidgetGroupBlock)(); settings2.__experimentalFetchLinkSuggestions = (search, searchOptions) => (0, import_core_data12.__experimentalFetchLinkSuggestions)(search, searchOptions, settings2); (0, import_blocks3.setFreeformContentHandlerName)("core/html"); root.render( /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_element25.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(layout_default, { blockEditorSettings: settings2 }) }) ); return root; } var initialize = initializeEditor; function reinitializeEditor() { (0, import_deprecated6.default)("wp.editWidgets.reinitializeEditor", { since: "6.2", version: "6.3" }); } var registerBlock = (block) => { if (!block) { return; } const { metadata, settings: settings2, name: name2 } = block; if (metadata) { (0, import_blocks3.unstable__bootstrapServerSideBlockDefinitions)({ [name2]: metadata }); } (0, import_blocks3.registerBlockType)(name2, settings2); }; return __toCommonJS(index_exports); })(); router.js 0000644 00000110173 15206720414 0006426 0 ustar 00 "use strict"; var wp; (wp ||= {}).router = (() => { 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 __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to2, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to2, key) && key !== except) __defProp(to2, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to2; }; 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 )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // package-external:@wordpress/element var require_element = __commonJS({ "package-external:@wordpress/element"(exports, module) { module.exports = window.wp.element; } }); // package-external:@wordpress/url var require_url = __commonJS({ "package-external:@wordpress/url"(exports, module) { module.exports = window.wp.url; } }); // package-external:@wordpress/compose var require_compose = __commonJS({ "package-external:@wordpress/compose"(exports, module) { module.exports = window.wp.compose; } }); // vendor-external:react/jsx-runtime var require_jsx_runtime = __commonJS({ "vendor-external:react/jsx-runtime"(exports, module) { module.exports = window.ReactJSXRuntime; } }); // package-external:@wordpress/private-apis var require_private_apis = __commonJS({ "package-external:@wordpress/private-apis"(exports, module) { module.exports = window.wp.privateApis; } }); // packages/router/build-module/index.mjs var index_exports = {}; __export(index_exports, { privateApis: () => privateApis }); // node_modules/route-recognizer/dist/route-recognizer.es.js var createObject = Object.create; function createMap() { var map2 = createObject(null); map2["__"] = void 0; delete map2["__"]; return map2; } var Target = function Target2(path, matcher, delegate) { this.path = path; this.matcher = matcher; this.delegate = delegate; }; Target.prototype.to = function to(target, callback) { var delegate = this.delegate; if (delegate && delegate.willAddRoute) { target = delegate.willAddRoute(this.matcher.target, target); } this.matcher.add(this.path, target); if (callback) { if (callback.length === 0) { throw new Error("You must have an argument in the function passed to `to`"); } this.matcher.addChild(this.path, target, callback, this.delegate); } }; var Matcher = function Matcher2(target) { this.routes = createMap(); this.children = createMap(); this.target = target; }; Matcher.prototype.add = function add(path, target) { this.routes[path] = target; }; Matcher.prototype.addChild = function addChild(path, target, callback, delegate) { var matcher = new Matcher(target); this.children[path] = matcher; var match2 = generateMatch(path, matcher, delegate); if (delegate && delegate.contextEntered) { delegate.contextEntered(target, match2); } callback(match2); }; function generateMatch(startingPath, matcher, delegate) { function match2(path, callback) { var fullPath = startingPath + path; if (callback) { callback(generateMatch(fullPath, matcher, delegate)); } else { return new Target(fullPath, matcher, delegate); } } return match2; } function addRoute(routeArray, path, handler) { var len = 0; for (var i = 0; i < routeArray.length; i++) { len += routeArray[i].path.length; } path = path.substr(len); var route = { path, handler }; routeArray.push(route); } function eachRoute(baseRoute, matcher, callback, binding) { var routes = matcher.routes; var paths = Object.keys(routes); for (var i = 0; i < paths.length; i++) { var path = paths[i]; var routeArray = baseRoute.slice(); addRoute(routeArray, path, routes[path]); var nested = matcher.children[path]; if (nested) { eachRoute(routeArray, nested, callback, binding); } else { callback.call(binding, routeArray); } } } var map = function(callback, addRouteCallback) { var matcher = new Matcher(); callback(generateMatch("", matcher, this.delegate)); eachRoute([], matcher, function(routes) { if (addRouteCallback) { addRouteCallback(this, routes); } else { this.add(routes); } }, this); }; function normalizePath(path) { return path.split("/").map(normalizeSegment).join("/"); } var SEGMENT_RESERVED_CHARS = /%|\//g; function normalizeSegment(segment) { if (segment.length < 3 || segment.indexOf("%") === -1) { return segment; } return decodeURIComponent(segment).replace(SEGMENT_RESERVED_CHARS, encodeURIComponent); } var PATH_SEGMENT_ENCODINGS = /%(?:2(?:4|6|B|C)|3(?:B|D|A)|40)/g; function encodePathSegment(str) { return encodeURIComponent(str).replace(PATH_SEGMENT_ENCODINGS, decodeURIComponent); } var escapeRegex = /(\/|\.|\*|\+|\?|\||\(|\)|\[|\]|\{|\}|\\)/g; var isArray = Array.isArray; var hasOwnProperty = Object.prototype.hasOwnProperty; function getParam(params, key) { if (typeof params !== "object" || params === null) { throw new Error("You must pass an object as the second argument to `generate`."); } if (!hasOwnProperty.call(params, key)) { throw new Error("You must provide param `" + key + "` to `generate`."); } var value = params[key]; var str = typeof value === "string" ? value : "" + value; if (str.length === 0) { throw new Error("You must provide a param `" + key + "`."); } return str; } var eachChar = []; eachChar[ 0 /* Static */ ] = function(segment, currentState) { var state = currentState; var value = segment.value; for (var i = 0; i < value.length; i++) { var ch = value.charCodeAt(i); state = state.put(ch, false, false); } return state; }; eachChar[ 1 /* Dynamic */ ] = function(_, currentState) { return currentState.put(47, true, true); }; eachChar[ 2 /* Star */ ] = function(_, currentState) { return currentState.put(-1, false, true); }; eachChar[ 4 /* Epsilon */ ] = function(_, currentState) { return currentState; }; var regex = []; regex[ 0 /* Static */ ] = function(segment) { return segment.value.replace(escapeRegex, "\\$1"); }; regex[ 1 /* Dynamic */ ] = function() { return "([^/]+)"; }; regex[ 2 /* Star */ ] = function() { return "(.+)"; }; regex[ 4 /* Epsilon */ ] = function() { return ""; }; var generate = []; generate[ 0 /* Static */ ] = function(segment) { return segment.value; }; generate[ 1 /* Dynamic */ ] = function(segment, params) { var value = getParam(params, segment.value); if (RouteRecognizer.ENCODE_AND_DECODE_PATH_SEGMENTS) { return encodePathSegment(value); } else { return value; } }; generate[ 2 /* Star */ ] = function(segment, params) { return getParam(params, segment.value); }; generate[ 4 /* Epsilon */ ] = function() { return ""; }; var EmptyObject = Object.freeze({}); var EmptyArray = Object.freeze([]); function parse(segments, route, types) { if (route.length > 0 && route.charCodeAt(0) === 47) { route = route.substr(1); } var parts = route.split("/"); var names = void 0; var shouldDecodes = void 0; for (var i = 0; i < parts.length; i++) { var part = parts[i]; var flags = 0; var type = 0; if (part === "") { type = 4; } else if (part.charCodeAt(0) === 58) { type = 1; } else if (part.charCodeAt(0) === 42) { type = 2; } else { type = 0; } flags = 2 << type; if (flags & 12) { part = part.slice(1); names = names || []; names.push(part); shouldDecodes = shouldDecodes || []; shouldDecodes.push((flags & 4) !== 0); } if (flags & 14) { types[type]++; } segments.push({ type, value: normalizeSegment(part) }); } return { names: names || EmptyArray, shouldDecodes: shouldDecodes || EmptyArray }; } function isEqualCharSpec(spec, char, negate) { return spec.char === char && spec.negate === negate; } var State = function State2(states, id, char, negate, repeat) { this.states = states; this.id = id; this.char = char; this.negate = negate; this.nextStates = repeat ? id : null; this.pattern = ""; this._regex = void 0; this.handlers = void 0; this.types = void 0; }; State.prototype.regex = function regex$1() { if (!this._regex) { this._regex = new RegExp(this.pattern); } return this._regex; }; State.prototype.get = function get(char, negate) { var this$1 = this; var nextStates = this.nextStates; if (nextStates === null) { return; } if (isArray(nextStates)) { for (var i = 0; i < nextStates.length; i++) { var child = this$1.states[nextStates[i]]; if (isEqualCharSpec(child, char, negate)) { return child; } } } else { var child$1 = this.states[nextStates]; if (isEqualCharSpec(child$1, char, negate)) { return child$1; } } }; State.prototype.put = function put(char, negate, repeat) { var state; if (state = this.get(char, negate)) { return state; } var states = this.states; state = new State(states, states.length, char, negate, repeat); states[states.length] = state; if (this.nextStates == null) { this.nextStates = state.id; } else if (isArray(this.nextStates)) { this.nextStates.push(state.id); } else { this.nextStates = [this.nextStates, state.id]; } return state; }; State.prototype.match = function match(ch) { var this$1 = this; var nextStates = this.nextStates; if (!nextStates) { return []; } var returned = []; if (isArray(nextStates)) { for (var i = 0; i < nextStates.length; i++) { var child = this$1.states[nextStates[i]]; if (isMatch(child, ch)) { returned.push(child); } } } else { var child$1 = this.states[nextStates]; if (isMatch(child$1, ch)) { returned.push(child$1); } } return returned; }; function isMatch(spec, char) { return spec.negate ? spec.char !== char && spec.char !== -1 : spec.char === char || spec.char === -1; } function sortSolutions(states) { return states.sort(function(a, b) { var ref = a.types || [0, 0, 0]; var astatics = ref[0]; var adynamics = ref[1]; var astars = ref[2]; var ref$1 = b.types || [0, 0, 0]; var bstatics = ref$1[0]; var bdynamics = ref$1[1]; var bstars = ref$1[2]; if (astars !== bstars) { return astars - bstars; } if (astars) { if (astatics !== bstatics) { return bstatics - astatics; } if (adynamics !== bdynamics) { return bdynamics - adynamics; } } if (adynamics !== bdynamics) { return adynamics - bdynamics; } if (astatics !== bstatics) { return bstatics - astatics; } return 0; }); } function recognizeChar(states, ch) { var nextStates = []; for (var i = 0, l = states.length; i < l; i++) { var state = states[i]; nextStates = nextStates.concat(state.match(ch)); } return nextStates; } var RecognizeResults = function RecognizeResults2(queryParams) { this.length = 0; this.queryParams = queryParams || {}; }; RecognizeResults.prototype.splice = Array.prototype.splice; RecognizeResults.prototype.slice = Array.prototype.slice; RecognizeResults.prototype.push = Array.prototype.push; function findHandler(state, originalPath, queryParams) { var handlers = state.handlers; var regex2 = state.regex(); if (!regex2 || !handlers) { throw new Error("state not initialized"); } var captures = originalPath.match(regex2); var currentCapture = 1; var result = new RecognizeResults(queryParams); result.length = handlers.length; for (var i = 0; i < handlers.length; i++) { var handler = handlers[i]; var names = handler.names; var shouldDecodes = handler.shouldDecodes; var params = EmptyObject; var isDynamic = false; if (names !== EmptyArray && shouldDecodes !== EmptyArray) { for (var j = 0; j < names.length; j++) { isDynamic = true; var name = names[j]; var capture = captures && captures[currentCapture++]; if (params === EmptyObject) { params = {}; } if (RouteRecognizer.ENCODE_AND_DECODE_PATH_SEGMENTS && shouldDecodes[j]) { params[name] = capture && decodeURIComponent(capture); } else { params[name] = capture; } } } result[i] = { handler: handler.handler, params, isDynamic }; } return result; } function decodeQueryParamPart(part) { part = part.replace(/\+/gm, "%20"); var result; try { result = decodeURIComponent(part); } catch (error) { result = ""; } return result; } var RouteRecognizer = function RouteRecognizer2() { this.names = createMap(); var states = []; var state = new State(states, 0, -1, true, false); states[0] = state; this.states = states; this.rootState = state; }; RouteRecognizer.prototype.add = function add2(routes, options) { var currentState = this.rootState; var pattern = "^"; var types = [0, 0, 0]; var handlers = new Array(routes.length); var allSegments = []; var isEmpty = true; var j = 0; for (var i = 0; i < routes.length; i++) { var route = routes[i]; var ref = parse(allSegments, route.path, types); var names = ref.names; var shouldDecodes = ref.shouldDecodes; for (; j < allSegments.length; j++) { var segment = allSegments[j]; if (segment.type === 4) { continue; } isEmpty = false; currentState = currentState.put(47, false, false); pattern += "/"; currentState = eachChar[segment.type](segment, currentState); pattern += regex[segment.type](segment); } handlers[i] = { handler: route.handler, names, shouldDecodes }; } if (isEmpty) { currentState = currentState.put(47, false, false); pattern += "/"; } currentState.handlers = handlers; currentState.pattern = pattern + "$"; currentState.types = types; var name; if (typeof options === "object" && options !== null && options.as) { name = options.as; } if (name) { this.names[name] = { segments: allSegments, handlers }; } }; RouteRecognizer.prototype.handlersFor = function handlersFor(name) { var route = this.names[name]; if (!route) { throw new Error("There is no route named " + name); } var result = new Array(route.handlers.length); for (var i = 0; i < route.handlers.length; i++) { var handler = route.handlers[i]; result[i] = handler; } return result; }; RouteRecognizer.prototype.hasRoute = function hasRoute(name) { return !!this.names[name]; }; RouteRecognizer.prototype.generate = function generate$1(name, params) { var route = this.names[name]; var output = ""; if (!route) { throw new Error("There is no route named " + name); } var segments = route.segments; for (var i = 0; i < segments.length; i++) { var segment = segments[i]; if (segment.type === 4) { continue; } output += "/"; output += generate[segment.type](segment, params); } if (output.charAt(0) !== "/") { output = "/" + output; } if (params && params.queryParams) { output += this.generateQueryString(params.queryParams); } return output; }; RouteRecognizer.prototype.generateQueryString = function generateQueryString(params) { var pairs = []; var keys = Object.keys(params); keys.sort(); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = params[key]; if (value == null) { continue; } var pair = encodeURIComponent(key); if (isArray(value)) { for (var j = 0; j < value.length; j++) { var arrayPair = key + "[]=" + encodeURIComponent(value[j]); pairs.push(arrayPair); } } else { pair += "=" + encodeURIComponent(value); pairs.push(pair); } } if (pairs.length === 0) { return ""; } return "?" + pairs.join("&"); }; RouteRecognizer.prototype.parseQueryString = function parseQueryString(queryString) { var pairs = queryString.split("&"); var queryParams = {}; for (var i = 0; i < pairs.length; i++) { var pair = pairs[i].split("="), key = decodeQueryParamPart(pair[0]), keyLength = key.length, isArray2 = false, value = void 0; if (pair.length === 1) { value = "true"; } else { if (keyLength > 2 && key.slice(keyLength - 2) === "[]") { isArray2 = true; key = key.slice(0, keyLength - 2); if (!queryParams[key]) { queryParams[key] = []; } } value = pair[1] ? decodeQueryParamPart(pair[1]) : ""; } if (isArray2) { queryParams[key].push(value); } else { queryParams[key] = value; } } return queryParams; }; RouteRecognizer.prototype.recognize = function recognize(path) { var results; var states = [this.rootState]; var queryParams = {}; var isSlashDropped = false; var hashStart = path.indexOf("#"); if (hashStart !== -1) { path = path.substr(0, hashStart); } var queryStart = path.indexOf("?"); if (queryStart !== -1) { var queryString = path.substr(queryStart + 1, path.length); path = path.substr(0, queryStart); queryParams = this.parseQueryString(queryString); } if (path.charAt(0) !== "/") { path = "/" + path; } var originalPath = path; if (RouteRecognizer.ENCODE_AND_DECODE_PATH_SEGMENTS) { path = normalizePath(path); } else { path = decodeURI(path); originalPath = decodeURI(originalPath); } var pathLen = path.length; if (pathLen > 1 && path.charAt(pathLen - 1) === "/") { path = path.substr(0, pathLen - 1); originalPath = originalPath.substr(0, originalPath.length - 1); isSlashDropped = true; } for (var i = 0; i < path.length; i++) { states = recognizeChar(states, path.charCodeAt(i)); if (!states.length) { break; } } var solutions = []; for (var i$1 = 0; i$1 < states.length; i$1++) { if (states[i$1].handlers) { solutions.push(states[i$1]); } } states = sortSolutions(solutions); var state = solutions[0]; if (state && state.handlers) { if (isSlashDropped && state.pattern && state.pattern.slice(-5) === "(.+)$") { originalPath = originalPath + "/"; } results = findHandler(state, originalPath, queryParams); } return results; }; RouteRecognizer.VERSION = "0.3.4"; RouteRecognizer.ENCODE_AND_DECODE_PATH_SEGMENTS = true; RouteRecognizer.Normalizer = { normalizeSegment, normalizePath, encodePathSegment }; RouteRecognizer.prototype.map = map; var route_recognizer_es_default = RouteRecognizer; // node_modules/@babel/runtime/helpers/esm/extends.js function _extends() { return _extends = Object.assign ? Object.assign.bind() : function(n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } // node_modules/history/index.js var Action; (function(Action2) { Action2["Pop"] = "POP"; Action2["Push"] = "PUSH"; Action2["Replace"] = "REPLACE"; })(Action || (Action = {})); var readOnly = true ? function(obj) { return Object.freeze(obj); } : function(obj) { return obj; }; function warning(cond, message) { if (!cond) { if (typeof console !== "undefined") console.warn(message); try { throw new Error(message); } catch (e) { } } } var BeforeUnloadEventType = "beforeunload"; var PopStateEventType = "popstate"; function createBrowserHistory(options) { if (options === void 0) { options = {}; } var _options = options, _options$window = _options.window, window2 = _options$window === void 0 ? document.defaultView : _options$window; var globalHistory = window2.history; function getIndexAndLocation() { var _window$location = window2.location, pathname = _window$location.pathname, search = _window$location.search, hash = _window$location.hash; var state = globalHistory.state || {}; return [state.idx, readOnly({ pathname, search, hash, state: state.usr || null, key: state.key || "default" })]; } var blockedPopTx = null; function handlePop() { if (blockedPopTx) { blockers.call(blockedPopTx); blockedPopTx = null; } else { var nextAction = Action.Pop; var _getIndexAndLocation = getIndexAndLocation(), nextIndex = _getIndexAndLocation[0], nextLocation = _getIndexAndLocation[1]; if (blockers.length) { if (nextIndex != null) { var delta = index - nextIndex; if (delta) { blockedPopTx = { action: nextAction, location: nextLocation, retry: function retry() { go(delta * -1); } }; go(delta); } } else { true ? warning( false, // TODO: Write up a doc that explains our blocking strategy in // detail and link to it here so people can understand better what // is going on and how to avoid it. "You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation." ) : void 0; } } else { applyTx(nextAction); } } } window2.addEventListener(PopStateEventType, handlePop); var action = Action.Pop; var _getIndexAndLocation2 = getIndexAndLocation(), index = _getIndexAndLocation2[0], location = _getIndexAndLocation2[1]; var listeners = createEvents(); var blockers = createEvents(); if (index == null) { index = 0; globalHistory.replaceState(_extends({}, globalHistory.state, { idx: index }), ""); } function createHref(to2) { return typeof to2 === "string" ? to2 : createPath(to2); } function getNextLocation(to2, state) { if (state === void 0) { state = null; } return readOnly(_extends({ pathname: location.pathname, hash: "", search: "" }, typeof to2 === "string" ? parsePath(to2) : to2, { state, key: createKey() })); } function getHistoryStateAndUrl(nextLocation, index2) { return [{ usr: nextLocation.state, key: nextLocation.key, idx: index2 }, createHref(nextLocation)]; } function allowTx(action2, location2, retry) { return !blockers.length || (blockers.call({ action: action2, location: location2, retry }), false); } function applyTx(nextAction) { action = nextAction; var _getIndexAndLocation3 = getIndexAndLocation(); index = _getIndexAndLocation3[0]; location = _getIndexAndLocation3[1]; listeners.call({ action, location }); } function push(to2, state) { var nextAction = Action.Push; var nextLocation = getNextLocation(to2, state); function retry() { push(to2, state); } if (allowTx(nextAction, nextLocation, retry)) { var _getHistoryStateAndUr = getHistoryStateAndUrl(nextLocation, index + 1), historyState = _getHistoryStateAndUr[0], url = _getHistoryStateAndUr[1]; try { globalHistory.pushState(historyState, "", url); } catch (error) { window2.location.assign(url); } applyTx(nextAction); } } function replace(to2, state) { var nextAction = Action.Replace; var nextLocation = getNextLocation(to2, state); function retry() { replace(to2, state); } if (allowTx(nextAction, nextLocation, retry)) { var _getHistoryStateAndUr2 = getHistoryStateAndUrl(nextLocation, index), historyState = _getHistoryStateAndUr2[0], url = _getHistoryStateAndUr2[1]; globalHistory.replaceState(historyState, "", url); applyTx(nextAction); } } function go(delta) { globalHistory.go(delta); } var history2 = { get action() { return action; }, get location() { return location; }, createHref, push, replace, go, back: function back() { go(-1); }, forward: function forward() { go(1); }, listen: function listen(listener) { return listeners.push(listener); }, block: function block(blocker) { var unblock = blockers.push(blocker); if (blockers.length === 1) { window2.addEventListener(BeforeUnloadEventType, promptBeforeUnload); } return function() { unblock(); if (!blockers.length) { window2.removeEventListener(BeforeUnloadEventType, promptBeforeUnload); } }; } }; return history2; } function promptBeforeUnload(event) { event.preventDefault(); event.returnValue = ""; } function createEvents() { var handlers = []; return { get length() { return handlers.length; }, push: function push(fn) { handlers.push(fn); return function() { handlers = handlers.filter(function(handler) { return handler !== fn; }); }; }, call: function call(arg) { handlers.forEach(function(fn) { return fn && fn(arg); }); } }; } function createKey() { return Math.random().toString(36).substr(2, 8); } function createPath(_ref) { var _ref$pathname = _ref.pathname, pathname = _ref$pathname === void 0 ? "/" : _ref$pathname, _ref$search = _ref.search, search = _ref$search === void 0 ? "" : _ref$search, _ref$hash = _ref.hash, hash = _ref$hash === void 0 ? "" : _ref$hash; if (search && search !== "?") pathname += search.charAt(0) === "?" ? search : "?" + search; if (hash && hash !== "#") pathname += hash.charAt(0) === "#" ? hash : "#" + hash; return pathname; } function parsePath(path) { var parsedPath = {}; if (path) { var hashIndex = path.indexOf("#"); if (hashIndex >= 0) { parsedPath.hash = path.substr(hashIndex); path = path.substr(0, hashIndex); } var searchIndex = path.indexOf("?"); if (searchIndex >= 0) { parsedPath.search = path.substr(searchIndex); path = path.substr(0, searchIndex); } if (path) { parsedPath.pathname = path; } } return parsedPath; } // packages/router/build-module/router.mjs var import_element = __toESM(require_element(), 1); var import_url = __toESM(require_url(), 1); var import_compose = __toESM(require_compose(), 1); var import_jsx_runtime = __toESM(require_jsx_runtime(), 1); var history = createBrowserHistory(); var RoutesContext = (0, import_element.createContext)(null); RoutesContext.displayName = "RoutesContext"; var ConfigContext = (0, import_element.createContext)({ pathArg: "p" }); ConfigContext.displayName = "ConfigContext"; var locationMemo = /* @__PURE__ */ new WeakMap(); function getLocationWithQuery() { const location = history.location; let locationWithQuery = locationMemo.get(location); if (!locationWithQuery) { locationWithQuery = { ...location, query: Object.fromEntries(new URLSearchParams(location.search)) }; locationMemo.set(location, locationWithQuery); } return locationWithQuery; } function useLocation() { const context = (0, import_element.useContext)(RoutesContext); if (!context) { throw new Error("useLocation must be used within a RouterProvider"); } return context; } function useHistory() { const { pathArg, beforeNavigate } = (0, import_element.useContext)(ConfigContext); const navigate = (0, import_compose.useEvent)( async (rawPath, options = {}) => { const query = (0, import_url.getQueryArgs)(rawPath); const path = (0, import_url.getPath)("http://domain.com/" + rawPath) ?? ""; const performPush = () => { const result = beforeNavigate ? beforeNavigate({ path, query }) : { path, query }; return history.push( { search: (0, import_url.buildQueryString)({ [pathArg]: result.path, ...result.query }) }, options.state ); }; const isMediumOrBigger = window.matchMedia("(min-width: 782px)").matches; if (!isMediumOrBigger || !document.startViewTransition || !options.transition) { performPush(); return; } await new Promise((resolve) => { const classname = options.transition ?? ""; document.documentElement.classList.add(classname); const transition = document.startViewTransition( () => performPush() ); transition.finished.finally(() => { document.documentElement.classList.remove(classname); resolve(); }); }); } ); return (0, import_element.useMemo)( () => ({ navigate, back: history.back, invalidate: () => { history.replace({ search: history.location.search }); } }), [navigate] ); } function useMatch(location, matcher, pathArg, matchResolverArgs) { const { query: rawQuery = {} } = location; const [resolvedMatch, setMatch] = (0, import_element.useState)(); (0, import_element.useEffect)(() => { const { [pathArg]: path = "/", ...query } = rawQuery; const ret = matcher.recognize(path)?.[0]; async function resolveMatch(result) { const matchedRoute = result.handler; const resolveFunctions = async (record = {}) => { const entries = await Promise.all( Object.entries(record).map(async ([key, value]) => { if (typeof value === "function") { return [ key, await value({ query, params: result.params, ...matchResolverArgs }) ]; } return [key, value]; }) ); return Object.fromEntries(entries); }; const [resolvedAreas, resolvedWidths] = await Promise.all([ resolveFunctions(matchedRoute.areas), resolveFunctions(matchedRoute.widths) ]); setMatch({ name: matchedRoute.name, areas: resolvedAreas, widths: resolvedWidths, params: result.params, query, path: (0, import_url.addQueryArgs)(path, query) }); } if (!ret) { setMatch({ name: "404", path: (0, import_url.addQueryArgs)(path, query), areas: {}, widths: {}, query, params: {} }); } else { resolveMatch(ret); } return () => setMatch(void 0); }, [matcher, rawQuery, pathArg, matchResolverArgs]); return resolvedMatch; } function RouterProvider({ routes, pathArg, beforeNavigate, children, matchResolverArgs }) { const location = (0, import_element.useSyncExternalStore)( history.listen, getLocationWithQuery, getLocationWithQuery ); const matcher = (0, import_element.useMemo)(() => { const ret = new route_recognizer_es_default(); (routes ?? []).forEach((route) => { ret.add([{ path: route.path, handler: route }], { as: route.name }); }); return ret; }, [routes]); const match2 = useMatch(location, matcher, pathArg, matchResolverArgs); const previousMatch = (0, import_compose.usePrevious)(match2); const config = (0, import_element.useMemo)( () => ({ beforeNavigate, pathArg }), [beforeNavigate, pathArg] ); const renderedMatch = match2 || previousMatch; if (!renderedMatch) { return null; } return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ConfigContext.Provider, { value: config, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RoutesContext.Provider, { value: renderedMatch, children }) }); } // packages/router/build-module/link.mjs var import_element2 = __toESM(require_element(), 1); var import_url2 = __toESM(require_url(), 1); var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1); function useLink(to2, options = {}) { const history2 = useHistory(); const { pathArg, beforeNavigate } = (0, import_element2.useContext)(ConfigContext); function onClick(event) { event?.preventDefault(); history2.navigate(to2, options); } const query = (0, import_url2.getQueryArgs)(to2); const path = (0, import_url2.getPath)("http://domain.com/" + to2) ?? ""; const link = (0, import_element2.useMemo)(() => { return beforeNavigate ? beforeNavigate({ path, query }) : { path, query }; }, [path, query, beforeNavigate]); const [before] = window.location.href.split("?"); return { href: `${before}?${(0, import_url2.buildQueryString)({ [pathArg]: link.path, ...link.query })}`, onClick }; } function Link({ to: to2, options, children, ...props }) { const { href, onClick } = useLink(to2, options); return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("a", { href, onClick, ...props, children }); } // packages/router/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/router" ); // packages/router/build-module/private-apis.mjs var privateApis = {}; lock(privateApis, { useHistory, useLocation, RouterProvider, useLink, Link }); return __toCommonJS(index_exports); })(); style-engine.js 0000644 00000043170 15206720414 0007513 0 ustar 00 "use strict"; var wp; (wp ||= {}).styleEngine = (() => { var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; 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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // packages/style-engine/build-module/index.mjs var index_exports = {}; __export(index_exports, { compileCSS: () => compileCSS, getCSSRules: () => getCSSRules, getCSSValueFromRawStyle: () => getCSSValueFromRawStyle }); // node_modules/tslib/tslib.es6.mjs var __assign = function() { __assign = Object.assign || function __assign2(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; // node_modules/lower-case/dist.es2015/index.js function lowerCase(str) { return str.toLowerCase(); } // node_modules/no-case/dist.es2015/index.js var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g]; var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi; function noCase(input, options) { if (options === void 0) { options = {}; } var _a = options.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options.transform, transform = _c === void 0 ? lowerCase : _c, _d = options.delimiter, delimiter = _d === void 0 ? " " : _d; var result = replace(replace(input, splitRegexp, "$1\0$2"), stripRegexp, "\0"); var start = 0; var end = result.length; while (result.charAt(start) === "\0") start++; while (result.charAt(end - 1) === "\0") end--; return result.slice(start, end).split("\0").map(transform).join(delimiter); } function replace(input, re, value) { if (re instanceof RegExp) return input.replace(re, value); return re.reduce(function(input2, re2) { return input2.replace(re2, value); }, input); } // node_modules/dot-case/dist.es2015/index.js function dotCase(input, options) { if (options === void 0) { options = {}; } return noCase(input, __assign({ delimiter: "." }, options)); } // node_modules/param-case/dist.es2015/index.js function paramCase(input, options) { if (options === void 0) { options = {}; } return dotCase(input, __assign({ delimiter: "-" }, options)); } // packages/style-engine/build-module/styles/constants.mjs var VARIABLE_REFERENCE_PREFIX = "var:"; var VARIABLE_PATH_SEPARATOR_TOKEN_ATTRIBUTE = "|"; var VARIABLE_PATH_SEPARATOR_TOKEN_STYLE = "--"; // packages/style-engine/build-module/styles/utils.mjs var getStyleValueByPath = (object, path) => { let value = object; path.forEach((fieldName) => { value = value?.[fieldName]; }); return value; }; function generateRule(style, options, path, ruleKey) { const styleValue = getStyleValueByPath(style, path); return styleValue ? [ { selector: options?.selector, key: ruleKey, value: getCSSValueFromRawStyle(styleValue) } ] : []; } function generateBoxRules(style, options, path, ruleKeys, individualProperties = ["top", "right", "bottom", "left"]) { const boxStyle = getStyleValueByPath( style, path ); if (!boxStyle) { return []; } const rules = []; if (typeof boxStyle === "string") { rules.push({ selector: options?.selector, key: ruleKeys.default, value: getCSSValueFromRawStyle(boxStyle) }); } else { const sideRules = individualProperties.reduce( (acc, side) => { const value = getCSSValueFromRawStyle( getStyleValueByPath(boxStyle, [side]) ); if (value) { acc.push({ selector: options?.selector, key: ruleKeys?.individual.replace( "%s", upperFirst(side) ), value }); } return acc; }, [] ); rules.push(...sideRules); } return rules; } function getCSSValueFromRawStyle(styleValue) { if (typeof styleValue === "string" && styleValue.startsWith(VARIABLE_REFERENCE_PREFIX)) { const variable = styleValue.slice(VARIABLE_REFERENCE_PREFIX.length).split(VARIABLE_PATH_SEPARATOR_TOKEN_ATTRIBUTE).map( (presetVariable) => paramCase(presetVariable, { splitRegexp: [ /([a-z0-9])([A-Z])/g, // fooBar => foo-bar, 3Bar => 3-bar /([0-9])([a-z])/g, // 3bar => 3-bar /([A-Za-z])([0-9])/g, // Foo3 => foo-3, foo3 => foo-3 /([A-Z])([A-Z][a-z])/g // FOOBar => foo-bar ] }) ).join(VARIABLE_PATH_SEPARATOR_TOKEN_STYLE); return `var(--wp--${variable})`; } return styleValue; } function upperFirst(string) { const [firstLetter, ...rest] = string; return firstLetter.toUpperCase() + rest.join(""); } function camelCaseJoin(strings) { const [firstItem, ...rest] = strings; return firstItem.toLowerCase() + rest.map(upperFirst).join(""); } function safeDecodeURI(uri) { try { return decodeURI(uri); } catch (uriError) { return uri; } } // packages/style-engine/build-module/styles/border/index.mjs function createBorderGenerateFunction(path) { return (style, options) => generateRule(style, options, path, camelCaseJoin(path)); } function createBorderEdgeGenerateFunction(edge) { return (style, options) => { return ["color", "style", "width"].flatMap((key) => { const path = ["border", edge, key]; return createBorderGenerateFunction(path)(style, options); }); }; } var color = { name: "color", generate: createBorderGenerateFunction(["border", "color"]) }; var radius = { name: "radius", generate: (style, options) => { return generateBoxRules( style, options, ["border", "radius"], { default: "borderRadius", individual: "border%sRadius" }, ["topLeft", "topRight", "bottomLeft", "bottomRight"] ); } }; var borderStyle = { name: "style", generate: createBorderGenerateFunction(["border", "style"]) }; var width = { name: "width", generate: createBorderGenerateFunction(["border", "width"]) }; var borderTop = { name: "borderTop", generate: createBorderEdgeGenerateFunction("top") }; var borderRight = { name: "borderRight", generate: createBorderEdgeGenerateFunction("right") }; var borderBottom = { name: "borderBottom", generate: createBorderEdgeGenerateFunction("bottom") }; var borderLeft = { name: "borderLeft", generate: createBorderEdgeGenerateFunction("left") }; var border_default = [ color, borderStyle, width, radius, borderTop, borderRight, borderBottom, borderLeft ]; // packages/style-engine/build-module/styles/color/background.mjs var background = { name: "background", generate: (style, options) => { return generateRule( style, options, ["color", "background"], "backgroundColor" ); } }; var background_default = background; // packages/style-engine/build-module/styles/color/gradient.mjs var gradient = { name: "gradient", generate: (style, options) => { return generateRule( style, options, ["color", "gradient"], "background" ); } }; var gradient_default = gradient; // packages/style-engine/build-module/styles/color/text.mjs var text = { name: "text", generate: (style, options) => { return generateRule(style, options, ["color", "text"], "color"); } }; var text_default = text; // packages/style-engine/build-module/styles/color/index.mjs var color_default = [text_default, gradient_default, background_default]; // packages/style-engine/build-module/styles/dimensions/index.mjs var height = { name: "height", generate: (style, options) => { return generateRule( style, options, ["dimensions", "height"], "height" ); } }; var minHeight = { name: "minHeight", generate: (style, options) => { return generateRule( style, options, ["dimensions", "minHeight"], "minHeight" ); } }; var aspectRatio = { name: "aspectRatio", generate: (style, options) => { return generateRule( style, options, ["dimensions", "aspectRatio"], "aspectRatio" ); } }; var width2 = { name: "width", generate: (style, options) => { return generateRule( style, options, ["dimensions", "width"], "width" ); } }; var dimensions_default = [height, minHeight, aspectRatio, width2]; // packages/style-engine/build-module/styles/background/index.mjs var backgroundImage = { name: "backgroundImage", generate: (style, options) => { const _backgroundImage = style?.background?.backgroundImage; if (typeof _backgroundImage === "object" && _backgroundImage?.url) { return [ { selector: options.selector, key: "backgroundImage", // Passed `url` may already be encoded. To prevent double encoding, decodeURI is executed to revert to the original string. value: `url( '${encodeURI( safeDecodeURI(_backgroundImage.url) )}' )` } ]; } return generateRule( style, options, ["background", "backgroundImage"], "backgroundImage" ); } }; var backgroundPosition = { name: "backgroundPosition", generate: (style, options) => { return generateRule( style, options, ["background", "backgroundPosition"], "backgroundPosition" ); } }; var backgroundRepeat = { name: "backgroundRepeat", generate: (style, options) => { return generateRule( style, options, ["background", "backgroundRepeat"], "backgroundRepeat" ); } }; var backgroundSize = { name: "backgroundSize", generate: (style, options) => { return generateRule( style, options, ["background", "backgroundSize"], "backgroundSize" ); } }; var backgroundAttachment = { name: "backgroundAttachment", generate: (style, options) => { return generateRule( style, options, ["background", "backgroundAttachment"], "backgroundAttachment" ); } }; var background_default2 = [ backgroundImage, backgroundPosition, backgroundRepeat, backgroundSize, backgroundAttachment ]; // packages/style-engine/build-module/styles/shadow/index.mjs var shadow = { name: "shadow", generate: (style, options) => { return generateRule(style, options, ["shadow"], "boxShadow"); } }; var shadow_default = [shadow]; // packages/style-engine/build-module/styles/outline/index.mjs var color2 = { name: "color", generate: (style, options, path = ["outline", "color"], ruleKey = "outlineColor") => { return generateRule(style, options, path, ruleKey); } }; var offset = { name: "offset", generate: (style, options, path = ["outline", "offset"], ruleKey = "outlineOffset") => { return generateRule(style, options, path, ruleKey); } }; var outlineStyle = { name: "style", generate: (style, options, path = ["outline", "style"], ruleKey = "outlineStyle") => { return generateRule(style, options, path, ruleKey); } }; var width3 = { name: "width", generate: (style, options, path = ["outline", "width"], ruleKey = "outlineWidth") => { return generateRule(style, options, path, ruleKey); } }; var outline_default = [color2, outlineStyle, offset, width3]; // packages/style-engine/build-module/styles/spacing/padding.mjs var padding = { name: "padding", generate: (style, options) => { return generateBoxRules(style, options, ["spacing", "padding"], { default: "padding", individual: "padding%s" }); } }; var padding_default = padding; // packages/style-engine/build-module/styles/spacing/margin.mjs var margin = { name: "margin", generate: (style, options) => { return generateBoxRules(style, options, ["spacing", "margin"], { default: "margin", individual: "margin%s" }); } }; var margin_default = margin; // packages/style-engine/build-module/styles/spacing/index.mjs var spacing_default = [margin_default, padding_default]; // packages/style-engine/build-module/styles/typography/index.mjs var fontSize = { name: "fontSize", generate: (style, options) => { return generateRule( style, options, ["typography", "fontSize"], "fontSize" ); } }; var fontStyle = { name: "fontStyle", generate: (style, options) => { return generateRule( style, options, ["typography", "fontStyle"], "fontStyle" ); } }; var fontWeight = { name: "fontWeight", generate: (style, options) => { return generateRule( style, options, ["typography", "fontWeight"], "fontWeight" ); } }; var fontFamily = { name: "fontFamily", generate: (style, options) => { return generateRule( style, options, ["typography", "fontFamily"], "fontFamily" ); } }; var letterSpacing = { name: "letterSpacing", generate: (style, options) => { return generateRule( style, options, ["typography", "letterSpacing"], "letterSpacing" ); } }; var lineHeight = { name: "lineHeight", generate: (style, options) => { return generateRule( style, options, ["typography", "lineHeight"], "lineHeight" ); } }; var textColumns = { name: "textColumns", generate: (style, options) => { return generateRule( style, options, ["typography", "textColumns"], "columnCount" ); } }; var textDecoration = { name: "textDecoration", generate: (style, options) => { return generateRule( style, options, ["typography", "textDecoration"], "textDecoration" ); } }; var textIndent = { name: "textIndent", generate: (style, options) => { return generateRule( style, options, ["typography", "textIndent"], "textIndent" ); } }; var textTransform = { name: "textTransform", generate: (style, options) => { return generateRule( style, options, ["typography", "textTransform"], "textTransform" ); } }; var writingMode = { name: "writingMode", generate: (style, options) => { return generateRule( style, options, ["typography", "writingMode"], "writingMode" ); } }; var typography_default = [ fontFamily, fontSize, fontStyle, fontWeight, letterSpacing, lineHeight, textColumns, textDecoration, textIndent, textTransform, writingMode ]; // packages/style-engine/build-module/styles/index.mjs var styleDefinitions = [ ...border_default, ...color_default, ...dimensions_default, ...outline_default, ...spacing_default, ...typography_default, ...shadow_default, ...background_default2 ]; // packages/style-engine/build-module/index.mjs function compileCSS(style, options = {}) { const rules = getCSSRules(style, options); if (!options?.selector) { const inlineRules = []; rules.forEach((rule) => { inlineRules.push(`${paramCase(rule.key)}: ${rule.value};`); }); return inlineRules.join(" "); } const groupedRules = rules.reduce( (acc, rule) => { const { selector } = rule; if (!selector) { return acc; } if (!acc[selector]) { acc[selector] = []; } acc[selector].push(rule); return acc; }, {} ); const selectorRules = Object.keys(groupedRules).reduce( (acc, subSelector) => { acc.push( `${subSelector} { ${groupedRules[subSelector].map( (rule) => `${paramCase(rule.key)}: ${rule.value};` ).join(" ")} }` ); return acc; }, [] ); return selectorRules.join("\n"); } function getCSSRules(style, options = {}) { const rules = []; styleDefinitions.forEach((definition) => { if (typeof definition.generate === "function") { rules.push(...definition.generate(style, options)); } }); return rules; } return __toCommonJS(index_exports); })(); theme.js 0000644 00000377227 15206720414 0006227 0 ustar 00 var wp; (wp ||= {}).theme = (() => { 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 __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to2, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to2, key) && key !== except) __defProp(to2, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to2; }; 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 )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // 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/element var require_element = __commonJS({ "package-external:@wordpress/element"(exports, module) { module.exports = window.wp.element; } }); // vendor-external:react/jsx-runtime var require_jsx_runtime = __commonJS({ "vendor-external:react/jsx-runtime"(exports, module) { module.exports = window.ReactJSXRuntime; } }); // packages/theme/build-module/index.mjs var index_exports = {}; __export(index_exports, { privateApis: () => privateApis }); // packages/theme/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/theme" ); // packages/theme/build-module/theme-provider.mjs var import_element3 = __toESM(require_element(), 1); // packages/theme/build-module/context.mjs var import_element = __toESM(require_element(), 1); var ThemeContext = (0, import_element.createContext)({ resolvedSettings: { color: {} } }); // packages/theme/node_modules/colorjs.io/src/multiply-matrices.js function dot3(a, b2) { return a[0] * b2[0] + a[1] * b2[1] + a[2] * b2[2]; } function multiply_v3_m3x3(input, matrix, out = [0, 0, 0]) { const x = dot3(input, matrix[0]); const y = dot3(input, matrix[1]); const z = dot3(input, matrix[2]); out[0] = x; out[1] = y; out[2] = z; return out; } // packages/theme/node_modules/colorjs.io/src/util.js function isString(str) { return type(str) === "string"; } function type(o) { let str = Object.prototype.toString.call(o); return (str.match(/^\[object\s+(.*?)\]$/)[1] || "").toLowerCase(); } function serializeNumber(n2, { precision = 16, unit }) { if (isNone(n2)) { return "none"; } n2 = +toPrecision(n2, precision); return n2 + (unit ?? ""); } function isNone(n2) { return n2 === null; } function toPrecision(n2, precision) { if (n2 === 0) { return 0; } let integer = ~~n2; let digits = 0; if (integer && precision) { digits = ~~Math.log10(Math.abs(integer)) + 1; } const multiplier = 10 ** (precision - digits); return Math.floor(n2 * multiplier + 0.5) / multiplier; } function interpolate(start, end, p2) { if (isNaN(start)) { return end; } if (isNaN(end)) { return start; } return start + (end - start) * p2; } function interpolateInv(start, end, value) { return (value - start) / (end - start); } function mapRange(from, to2, value) { if (!from || !to2 || from === to2 || from[0] === to2[0] && from[1] === to2[1] || isNaN(value) || value === null) { return value; } return interpolate(to2[0], to2[1], interpolateInv(from[0], from[1], value)); } function clamp(min, val, max) { return Math.max(Math.min(max, val), min); } function copySign(to2, from) { return Math.sign(to2) === Math.sign(from) ? to2 : -to2; } function spow(base, exp) { return copySign(Math.abs(base) ** exp, base); } function zdiv(n2, d2) { return d2 === 0 ? 0 : n2 / d2; } function bisectLeft(arr, value, lo = 0, hi = arr.length) { while (lo < hi) { const mid = lo + hi >> 1; if (arr[mid] < value) { lo = mid + 1; } else { hi = mid; } } return lo; } function isInstance(arg, constructor) { if (arg instanceof constructor) { return true; } const targetName = constructor.name; while (arg) { const proto = Object.getPrototypeOf(arg); const constructorName = proto?.constructor?.name; if (constructorName === targetName) { return true; } if (!constructorName || constructorName === "Object") { return false; } arg = proto; } return false; } // packages/theme/node_modules/colorjs.io/src/Type.js var Type = class { // Class properties - declared here so that type inference works type; coordMeta; coordRange; /** @type {[number, number]} */ range; /** * @param {any} type * @param {import("./types.js").CoordMeta} coordMeta */ constructor(type2, coordMeta) { if (typeof type2 === "object") { this.coordMeta = type2; } if (coordMeta) { this.coordMeta = coordMeta; this.coordRange = coordMeta.range ?? coordMeta.refRange; } if (typeof type2 === "string") { let params = type2.trim().match(/^(?<type><[a-z]+>)(\[(?<min>-?[.\d]+),\s*(?<max>-?[.\d]+)\])?$/); if (!params) { throw new TypeError(`Cannot parse ${type2} as a type definition.`); } this.type = params.groups.type; let { min, max } = params.groups; if (min || max) { this.range = [+min, +max]; } } } /** @returns {[number, number]} */ get computedRange() { if (this.range) { return this.range; } if (this.type === "<percentage>") { return this.percentageRange(); } else if (this.type === "<angle>") { return [0, 360]; } return null; } get unit() { if (this.type === "<percentage>") { return "%"; } else if (this.type === "<angle>") { return "deg"; } return ""; } /** * Map a number to the internal representation * @param {number} number */ resolve(number) { if (this.type === "<angle>") { return number; } let fromRange = this.computedRange; let toRange = this.coordRange; if (this.type === "<percentage>") { toRange ??= this.percentageRange(); } return mapRange(fromRange, toRange, number); } /** * Serialize a number from the internal representation to a string * @param {number} number * @param {number} [precision] */ serialize(number, precision) { let toRange = this.type === "<percentage>" ? this.percentageRange(100) : this.computedRange; let unit = this.unit; number = mapRange(this.coordRange, toRange, number); return serializeNumber(number, { unit, precision }); } toString() { let ret = this.type; if (this.range) { let [min = "", max = ""] = this.range; ret += `[${min},${max}]`; } return ret; } /** * Returns a percentage range for values of this type * @param {number} scale * @returns {[number, number]} */ percentageRange(scale = 1) { let range; if (this.coordMeta && this.coordMeta.range || this.coordRange && this.coordRange[0] >= 0) { range = [0, 1]; } else { range = [-1, 1]; } return [range[0] * scale, range[1] * scale]; } static get(type2, coordMeta) { if (isInstance(type2, this)) { return type2; } return new this(type2, coordMeta); } }; // packages/theme/node_modules/colorjs.io/src/Format.js var instance = /* @__PURE__ */ Symbol("instance"); var Format = class _Format { // Class properties - declared here so that type inference works type; name; spaceCoords; /** @type {Type[][]} */ coords; /** @type {string | undefined} */ id; /** @type {boolean | undefined} */ alpha; /** * @param {FormatInterface} format * @param {ColorSpace} space */ constructor(format, space = format.space) { format[instance] = this; this.type = "function"; this.name = "color"; Object.assign(this, format); this.space = space; if (this.type === "custom") { return; } this.spaceCoords = Object.values(space.coords); if (!this.coords) { this.coords = this.spaceCoords.map((coordMeta) => { let ret = ["<number>", "<percentage>"]; if (coordMeta.type === "angle") { ret.push("<angle>"); } return ret; }); } this.coords = this.coords.map( /** @param {string | string[] | Type[]} types */ (types, i) => { let coordMeta = this.spaceCoords[i]; if (typeof types === "string") { types = types.trim().split(/\s*\|\s*/); } return types.map((type2) => Type.get(type2, coordMeta)); } ); } /** * @param {Coords} coords * @param {number} precision * @param {Type[]} types */ serializeCoords(coords, precision, types) { types = coords.map((_, i) => Type.get(types?.[i] ?? this.coords[i][0], this.spaceCoords[i])); return coords.map((c, i) => types[i].serialize(c, precision)); } /** * Validates the coordinates of a color against a format's coord grammar and * maps the coordinates to the range or refRange of the coordinates. * @param {Coords} coords * @param {[string, string, string]} types */ coerceCoords(coords, types) { return Object.entries(this.space.coords).map(([id, coordMeta], i) => { let arg = coords[i]; if (isNone(arg) || isNaN(arg)) { return arg; } let providedType = types[i]; let type2 = this.coords[i].find((c) => c.type == providedType); if (!type2) { let coordName = coordMeta.name || id; throw new TypeError( `${providedType ?? /** @type {any} */ arg?.raw ?? arg} not allowed for ${coordName} in ${this.name}()` ); } arg = type2.resolve(arg); if (type2.range) { types[i] = type2.toString(); } return arg; }); } /** * @returns {boolean | Required<FormatInterface>["serialize"]} */ canSerialize() { return this.type === "function" || /** @type {any} */ this.serialize; } /** * @param {string} str * @returns {(import("./types.js").ColorConstructor) | undefined | null} */ parse(str) { return null; } /** * @param {Format | FormatInterface} format * @param {RemoveFirstElement<ConstructorParameters<typeof Format>>} args * @returns {Format} */ static get(format, ...args) { if (!format || isInstance(format, this)) { return ( /** @type {Format} */ format ); } if (format[instance]) { return format[instance]; } return new _Format(format, ...args); } }; // packages/theme/node_modules/colorjs.io/src/hooks.js var Hooks = class { add(name, callback, first) { if (typeof arguments[0] != "string") { for (var name in arguments[0]) { this.add(name, arguments[0][name], arguments[1]); } return; } (Array.isArray(name) ? name : [name]).forEach(function(name2) { this[name2] = this[name2] || []; if (callback) { this[name2][first ? "unshift" : "push"](callback); } }, this); } run(name, env) { this[name] = this[name] || []; this[name].forEach(function(callback) { callback.call(env && env.context ? env.context : env, env); }); } }; var hooks = new Hooks(); var hooks_default = hooks; // packages/theme/node_modules/colorjs.io/src/adapt.js var WHITES = { // for compatibility, the four-digit chromaticity-derived ones everyone else uses D50: [0.3457 / 0.3585, 1, (1 - 0.3457 - 0.3585) / 0.3585], D65: [0.3127 / 0.329, 1, (1 - 0.3127 - 0.329) / 0.329] }; function getWhite(name) { if (Array.isArray(name)) { return name; } return WHITES[name]; } function adapt(W1, W2, XYZ, options = {}) { W1 = getWhite(W1); W2 = getWhite(W2); if (!W1 || !W2) { throw new TypeError( `Missing white point to convert ${!W1 ? "from" : ""}${!W1 && !W2 ? "/" : ""}${!W2 ? "to" : ""}` ); } if (W1 === W2) { return XYZ; } let env = { W1, W2, XYZ, options }; hooks_default.run("chromatic-adaptation-start", env); if (!env.M) { if (env.W1 === WHITES.D65 && env.W2 === WHITES.D50) { env.M = [ [1.0479297925449969, 0.022946870601609652, -0.05019226628920524], [0.02962780877005599, 0.9904344267538799, -0.017073799063418826], [-0.009243040646204504, 0.015055191490298152, 0.7518742814281371] ]; } else if (env.W1 === WHITES.D50 && env.W2 === WHITES.D65) { env.M = [ [0.955473421488075, -0.02309845494876471, 0.06325924320057072], [-0.0283697093338637, 1.0099953980813041, 0.021041441191917323], [0.012314014864481998, -0.020507649298898964, 1.330365926242124] ]; } } hooks_default.run("chromatic-adaptation-end", env); if (env.M) { return multiply_v3_m3x3(env.XYZ, env.M); } else { throw new TypeError("Only Bradford CAT with white points D50 and D65 supported for now."); } } // packages/theme/node_modules/colorjs.io/src/defaults.js var defaults_default = { gamut_mapping: "css", precision: 5, deltaE: "76", // Default deltaE method verbose: globalThis?.process?.env?.NODE_ENV?.toLowerCase() !== "test", warn: function warn(msg) { if (this.verbose) { globalThis?.console?.warn?.(msg); } } }; // packages/theme/node_modules/colorjs.io/src/parse.js function parse(str, options) { let env = { str: String(str)?.trim(), options }; hooks_default.run("parse-start", env); if (env.color) { return env.color; } env.parsed = parseFunction(env.str); let ret; let meta = env.options ? env.options.parseMeta ?? env.options.meta : null; if (env.parsed) { let name = env.parsed.name; let format; let space; let coords = env.parsed.args; let types = coords.map((c, i) => env.parsed.argMeta[i]?.type); if (name === "color") { let id = coords.shift(); types.shift(); let alternateId = id.startsWith("--") ? id.substring(2) : `--${id}`; let ids = [id, alternateId]; format = ColorSpace.findFormat({ name, id: ids, type: "function" }); if (!format) { let didYouMean; let registryId = id in ColorSpace.registry ? id : alternateId; if (registryId in ColorSpace.registry) { let cssId = ColorSpace.registry[registryId].formats?.color?.id; if (cssId) { let altColor = str.replace("color(" + id, "color(" + cssId); didYouMean = `Did you mean ${altColor}?`; } } throw new TypeError( `Cannot parse ${env.str}. ` + (didYouMean ?? "Missing a plugin?") ); } space = format.space; if (format.id.startsWith("--") && !id.startsWith("--")) { defaults_default.warn( `${space.name} is a non-standard space and not currently supported in the CSS spec. Use prefixed color(${format.id}) instead of color(${id}).` ); } if (id.startsWith("--") && !format.id.startsWith("--")) { defaults_default.warn( `${space.name} is a standard space and supported in the CSS spec. Use color(${format.id}) instead of prefixed color(${id}).` ); } } else { format = ColorSpace.findFormat({ name, type: "function" }); space = format.space; } if (meta) { Object.assign(meta, { format, formatId: format.name, types, commas: env.parsed.commas }); } let alpha = 1; if (env.parsed.lastAlpha) { alpha = env.parsed.args.pop(); if (meta) { meta.alphaType = types.pop(); } } let coordCount = format.coords.length; if (coords.length !== coordCount) { throw new TypeError( `Expected ${coordCount} coordinates for ${space.id} in ${env.str}), got ${coords.length}` ); } coords = format.coerceCoords(coords, types); ret = { spaceId: space.id, coords, alpha }; } else { spaceloop: for (let space of ColorSpace.all) { for (let formatId in space.formats) { let format = space.formats[formatId]; if (format.type !== "custom") { continue; } if (format.test && !format.test(env.str)) { continue; } let formatObject = space.getFormat(format); let color = formatObject.parse(env.str); if (color) { if (meta) { Object.assign(meta, { format: formatObject, formatId }); } ret = color; break spaceloop; } } } } if (!ret) { throw new TypeError(`Could not parse ${str} as a color. Missing a plugin?`); } ret.alpha = isNone(ret.alpha) ? ret.alpha : ret.alpha === void 0 ? 1 : clamp(0, ret.alpha, 1); return ret; } var units = { "%": 0.01, deg: 1, grad: 0.9, rad: 180 / Math.PI, turn: 360 }; var regex = { // Need to list calc(NaN) explicitly as otherwise its ending paren would terminate the function call function: /^([a-z]+)\(((?:calc\(NaN\)|.)+?)\)$/i, number: /^([-+]?(?:[0-9]*\.)?[0-9]+(e[-+]?[0-9]+)?)$/i, unitValue: RegExp(`(${Object.keys(units).join("|")})$`), // NOTE The -+ are not just for prefix, but also for idents, and e+N notation! singleArgument: /\/?\s*(none|NaN|calc\(NaN\)|[-+\w.]+(?:%|deg|g?rad|turn)?)/g }; function parseArgument(rawArg) { let meta = {}; let unit = rawArg.match(regex.unitValue)?.[0]; let value = meta.raw = rawArg; if (unit) { meta.type = unit === "%" ? "<percentage>" : "<angle>"; meta.unit = unit; meta.unitless = Number(value.slice(0, -unit.length)); value = meta.unitless * units[unit]; } else if (regex.number.test(value)) { value = Number(value); meta.type = "<number>"; } else if (value === "none") { value = null; } else if (value === "NaN" || value === "calc(NaN)") { value = NaN; meta.type = "<number>"; } else { meta.type = "<ident>"; } return { value: ( /** @type {number} */ value ), meta: ( /** @type {ArgumentMeta} */ meta ) }; } function parseFunction(str) { if (!str) { return; } str = str.trim(); let parts = str.match(regex.function); if (parts) { let args = []; let argMeta = []; let lastAlpha = false; let name = parts[1].toLowerCase(); let separators = parts[2].replace(regex.singleArgument, ($0, rawArg) => { let { value, meta } = parseArgument(rawArg); if ( // If there's a slash here, it's modern syntax $0.startsWith("/") || // If there's still elements to process after there's already 3 in `args` (and the we're not dealing with "color()"), it's likely to be a legacy color like "hsl(0, 0%, 0%, 0.5)" name !== "color" && args.length === 3 ) { lastAlpha = true; } args.push(value); argMeta.push(meta); return ""; }); return { name, args, argMeta, lastAlpha, commas: separators.includes(","), rawName: parts[1], rawArgs: parts[2] }; } } // packages/theme/node_modules/colorjs.io/src/getColor.js function getColor(color, options) { if (Array.isArray(color)) { return color.map((c) => getColor(c, options)); } if (!color) { throw new TypeError("Empty color reference"); } if (isString(color)) { color = parse(color, options); } let space = color.space || color.spaceId; if (typeof space === "string") { color.space = ColorSpace.get(space); } if (color.alpha === void 0) { color.alpha = 1; } return color; } // packages/theme/node_modules/colorjs.io/src/ColorSpace.js var \u03B5 = 75e-6; var ColorSpace = class _ColorSpace { constructor(options) { this.id = options.id; this.name = options.name; this.base = options.base ? _ColorSpace.get(options.base) : null; this.aliases = options.aliases; if (this.base) { this.fromBase = options.fromBase; this.toBase = options.toBase; } let coords = options.coords ?? this.base.coords; for (let name in coords) { if (!("name" in coords[name])) { coords[name].name = name; } } this.coords = coords; let white4 = options.white ?? this.base.white ?? "D65"; this.white = getWhite(white4); this.formats = options.formats ?? {}; for (let name in this.formats) { let format = this.formats[name]; format.type ||= "function"; format.name ||= name; } if (!this.formats.color?.id) { this.formats.color = { ...this.formats.color ?? {}, id: options.cssId || this.id }; } if (options.gamutSpace) { this.gamutSpace = options.gamutSpace === "self" ? this : _ColorSpace.get(options.gamutSpace); } else { if (this.isPolar) { this.gamutSpace = this.base; } else { this.gamutSpace = this; } } if (this.gamutSpace.isUnbounded) { this.inGamut = (coords2, options2) => { return true; }; } this.referred = options.referred; Object.defineProperty(this, "path", { value: getPath(this).reverse(), writable: false, enumerable: true, configurable: true }); hooks_default.run("colorspace-init-end", this); } inGamut(coords, { epsilon = \u03B5 } = {}) { if (!this.equals(this.gamutSpace)) { coords = this.to(this.gamutSpace, coords); return this.gamutSpace.inGamut(coords, { epsilon }); } let coordMeta = Object.values(this.coords); return coords.every((c, i) => { let meta = coordMeta[i]; if (meta.type !== "angle" && meta.range) { if (isNone(c)) { return true; } let [min, max] = meta.range; return (min === void 0 || c >= min - epsilon) && (max === void 0 || c <= max + epsilon); } return true; }); } get isUnbounded() { return Object.values(this.coords).every((coord) => !("range" in coord)); } get cssId() { return this.formats?.color?.id || this.id; } get isPolar() { for (let id in this.coords) { if (this.coords[id].type === "angle") { return true; } } return false; } /** * Lookup a format in this color space * @param {string | object | Format} format - Format id if string. If object, it's converted to a `Format` object and returned. * @returns {Format} */ getFormat(format) { if (!format) { return null; } if (format === "default") { format = Object.values(this.formats)[0]; } else if (typeof format === "string") { format = this.formats[format]; } let ret = Format.get(format, this); if (ret !== format && format.name in this.formats) { this.formats[format.name] = ret; } return ret; } /** * Check if this color space is the same as another color space reference. * Allows proxying color space objects and comparing color spaces with ids. * @param {string | ColorSpace} space ColorSpace object or id to compare to * @returns {boolean} */ equals(space) { if (!space) { return false; } return this === space || this.id === space || this.id === space.id; } to(space, coords) { if (arguments.length === 1) { const color = getColor(space); [space, coords] = [color.space, color.coords]; } space = _ColorSpace.get(space); if (this.equals(space)) { return coords; } coords = coords.map((c) => isNone(c) ? 0 : c); let myPath = this.path; let otherPath = space.path; let connectionSpace, connectionSpaceIndex; for (let i = 0; i < myPath.length; i++) { if (myPath[i].equals(otherPath[i])) { connectionSpace = myPath[i]; connectionSpaceIndex = i; } else { break; } } if (!connectionSpace) { throw new Error( `Cannot convert between color spaces ${this} and ${space}: no connection space was found` ); } for (let i = myPath.length - 1; i > connectionSpaceIndex; i--) { coords = myPath[i].toBase(coords); } for (let i = connectionSpaceIndex + 1; i < otherPath.length; i++) { coords = otherPath[i].fromBase(coords); } return coords; } from(space, coords) { if (arguments.length === 1) { const color = getColor(space); [space, coords] = [color.space, color.coords]; } space = _ColorSpace.get(space); return space.to(this, coords); } toString() { return `${this.name} (${this.id})`; } getMinCoords() { let ret = []; for (let id in this.coords) { let meta = this.coords[id]; let range = meta.range || meta.refRange; ret.push(range?.min ?? 0); } return ret; } static registry = {}; // Returns array of unique color spaces static get all() { return [...new Set(Object.values(_ColorSpace.registry))]; } static register(id, space) { if (arguments.length === 1) { space = arguments[0]; id = space.id; } space = this.get(space); if (this.registry[id] && this.registry[id] !== space) { throw new Error(`Duplicate color space registration: '${id}'`); } this.registry[id] = space; if (arguments.length === 1 && space.aliases) { for (let alias of space.aliases) { this.register(alias, space); } } return space; } /** * Lookup ColorSpace object by name * @param {ColorSpace | string} name */ static get(space, ...alternatives) { if (!space || isInstance(space, this)) { return space; } let argType = type(space); if (argType === "string") { let ret = _ColorSpace.registry[space.toLowerCase()]; if (!ret) { throw new TypeError(`No color space found with id = "${space}"`); } return ret; } if (alternatives.length) { return _ColorSpace.get(...alternatives); } throw new TypeError(`${space} is not a valid color space`); } /** * Look up all color spaces for a format that matches certain criteria * @param {object | string} filters * @param {Array<ColorSpace>} [spaces=ColorSpace.all] * @returns {Format | null} */ static findFormat(filters, spaces = _ColorSpace.all) { if (!filters) { return null; } if (typeof filters === "string") { filters = { name: filters }; } for (let space of spaces) { for (let [name, format] of Object.entries(space.formats)) { format.name ??= name; format.type ??= "function"; let matches = (!filters.name || format.name === filters.name) && (!filters.type || format.type === filters.type); if (filters.id) { let ids = format.ids || [format.id]; let filterIds = Array.isArray(filters.id) ? filters.id : [filters.id]; matches &&= filterIds.some((id) => ids.includes(id)); } if (matches) { let ret = Format.get(format, space); if (ret !== format) { space.formats[format.name] = ret; } return ret; } } } return null; } /** * Get metadata about a coordinate of a color space * * @static * @param {Array | string} ref * @param {ColorSpace | string} [workingSpace] * @return {Object} */ static resolveCoord(ref, workingSpace) { let coordType = type(ref); let space, coord; if (coordType === "string") { if (ref.includes(".")) { [space, coord] = ref.split("."); } else { [space, coord] = [, ref]; } } else if (Array.isArray(ref)) { [space, coord] = ref; } else { space = ref.space; coord = ref.coordId; } space = _ColorSpace.get(space); if (!space) { space = workingSpace; } if (!space) { throw new TypeError( `Cannot resolve coordinate reference ${ref}: No color space specified and relative references are not allowed here` ); } coordType = type(coord); if (coordType === "number" || coordType === "string" && coord >= 0) { let meta = Object.entries(space.coords)[coord]; if (meta) { return { space, id: meta[0], index: coord, ...meta[1] }; } } space = _ColorSpace.get(space); let normalizedCoord = coord.toLowerCase(); let i = 0; for (let id in space.coords) { let meta = space.coords[id]; if (id.toLowerCase() === normalizedCoord || meta.name?.toLowerCase() === normalizedCoord) { return { space, id, index: i, ...meta }; } i++; } throw new TypeError( `No "${coord}" coordinate found in ${space.name}. Its coordinates are: ${Object.keys(space.coords).join(", ")}` ); } static DEFAULT_FORMAT = { type: "functions", name: "color" }; }; function getPath(space) { let ret = [space]; for (let s = space; s = s.base; ) { ret.push(s); } return ret; } // packages/theme/node_modules/colorjs.io/src/spaces/xyz-d65.js var xyz_d65_default = new ColorSpace({ id: "xyz-d65", name: "XYZ D65", coords: { x: { refRange: [0, 1], name: "X" }, y: { refRange: [0, 1], name: "Y" }, z: { refRange: [0, 1], name: "Z" } }, white: "D65", formats: { color: { ids: ["xyz-d65", "xyz"] } }, aliases: ["xyz"] }); // packages/theme/node_modules/colorjs.io/src/RGBColorSpace.js var RGBColorSpace = class extends ColorSpace { /** * Creates a new RGB ColorSpace. * If coords are not specified, they will use the default RGB coords. * Instead of `fromBase()` and `toBase()` functions, * you can specify to/from XYZ matrices and have `toBase()` and `fromBase()` automatically generated. * @param {RGBOptions} options */ constructor(options) { if (!options.coords) { options.coords = { r: { range: [0, 1], name: "Red" }, g: { range: [0, 1], name: "Green" }, b: { range: [0, 1], name: "Blue" } }; } if (!options.base) { options.base = xyz_d65_default; } if (options.toXYZ_M && options.fromXYZ_M) { options.toBase ??= (rgb) => { let xyz = multiply_v3_m3x3(rgb, options.toXYZ_M); if (this.white !== this.base.white) { xyz = adapt(this.white, this.base.white, xyz); } return xyz; }; options.fromBase ??= (xyz) => { xyz = adapt(this.base.white, this.white, xyz); return multiply_v3_m3x3(xyz, options.fromXYZ_M); }; } options.referred ??= "display"; super(options); } }; // packages/theme/node_modules/colorjs.io/src/getAll.js function getAll(color, options) { color = getColor(color); let space = ColorSpace.get(options, options?.space); let precision = options?.precision; let coords; if (!space || color.space.equals(space)) { coords = color.coords.slice(); } else { coords = space.from(color); } return precision === void 0 ? coords : coords.map((coord) => toPrecision(coord, precision)); } // packages/theme/node_modules/colorjs.io/src/get.js function get(color, prop) { color = getColor(color); if (prop === "alpha") { return color.alpha ?? 1; } let { space, index } = ColorSpace.resolveCoord(prop, color.space); let coords = getAll(color, space); return coords[index]; } // packages/theme/node_modules/colorjs.io/src/setAll.js function setAll(color, space, coords, alpha) { color = getColor(color); if (Array.isArray(space)) { [space, coords, alpha] = [color.space, space, coords]; } space = ColorSpace.get(space); color.coords = space === color.space ? coords.slice() : space.to(color.space, coords); if (alpha !== void 0) { color.alpha = alpha; } return color; } setAll.returns = "color"; // packages/theme/node_modules/colorjs.io/src/set.js function set(color, prop, value) { color = getColor(color); if (arguments.length === 2 && type(arguments[1]) === "object") { let object = arguments[1]; for (let p2 in object) { set(color, p2, object[p2]); } } else { if (typeof value === "function") { value = value(get(color, prop)); } if (prop === "alpha") { color.alpha = value; } else { let { space, index } = ColorSpace.resolveCoord(prop, color.space); let coords = getAll(color, space); coords[index] = value; setAll(color, space, coords); } } return color; } set.returns = "color"; // packages/theme/node_modules/colorjs.io/src/spaces/xyz-d50.js var xyz_d50_default = new ColorSpace({ id: "xyz-d50", name: "XYZ D50", white: "D50", base: xyz_d65_default, fromBase: (coords) => adapt(xyz_d65_default.white, "D50", coords), toBase: (coords) => adapt("D50", xyz_d65_default.white, coords) }); // packages/theme/node_modules/colorjs.io/src/spaces/lab.js var \u03B52 = 216 / 24389; var \u03B53 = 24 / 116; var \u03BA = 24389 / 27; var white = WHITES.D50; var lab_default = new ColorSpace({ id: "lab", name: "Lab", coords: { l: { refRange: [0, 100], name: "Lightness" }, a: { refRange: [-125, 125] }, b: { refRange: [-125, 125] } }, // Assuming XYZ is relative to D50, convert to CIE Lab // from CIE standard, which now defines these as a rational fraction white, base: xyz_d50_default, // Convert D50-adapted XYX to Lab // CIE 15.3:2004 section 8.2.1.1 fromBase(XYZ) { let xyz = XYZ.map((value, i) => value / white[i]); let f = xyz.map((value) => value > \u03B52 ? Math.cbrt(value) : (\u03BA * value + 16) / 116); let L = 116 * f[1] - 16; let a = 500 * (f[0] - f[1]); let b2 = 200 * (f[1] - f[2]); return [L, a, b2]; }, // Convert Lab to D50-adapted XYZ // Same result as CIE 15.3:2004 Appendix D although the derivation is different // http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html toBase(Lab) { let [L, a, b2] = Lab; let f = []; f[1] = (L + 16) / 116; f[0] = a / 500 + f[1]; f[2] = f[1] - b2 / 200; let xyz = [ f[0] > \u03B53 ? Math.pow(f[0], 3) : (116 * f[0] - 16) / \u03BA, Lab[0] > 8 ? Math.pow((Lab[0] + 16) / 116, 3) : Lab[0] / \u03BA, f[2] > \u03B53 ? Math.pow(f[2], 3) : (116 * f[2] - 16) / \u03BA ]; return xyz.map((value, i) => value * white[i]); }, formats: { lab: { coords: [ "<percentage> | <number>", "<number> | <percentage>", "<number> | <percentage>" ] } } }); // packages/theme/node_modules/colorjs.io/src/angles.js function constrain(angle) { if (typeof angle !== "number") { return angle; } return (angle % 360 + 360) % 360; } // packages/theme/node_modules/colorjs.io/src/spaces/lch.js var lch_default = new ColorSpace({ id: "lch", name: "LCH", coords: { l: { refRange: [0, 100], name: "Lightness" }, c: { refRange: [0, 150], name: "Chroma" }, h: { refRange: [0, 360], type: "angle", name: "Hue" } }, base: lab_default, fromBase(Lab) { if (this.\u03B5 === void 0) { let range = Object.values(this.base.coords)[1].refRange; let extent = range[1] - range[0]; this.\u03B5 = extent / 1e5; } let [L, a, b2] = Lab; let isAchromatic = Math.abs(a) < this.\u03B5 && Math.abs(b2) < this.\u03B5; let h = isAchromatic ? null : constrain(Math.atan2(b2, a) * 180 / Math.PI); let C = isAchromatic ? 0 : Math.sqrt(a ** 2 + b2 ** 2); return [L, C, h]; }, toBase(lch) { let [L, C, h] = lch; let a = null, b2 = null; if (!isNone(h)) { C = C < 0 ? 0 : C; a = C * Math.cos(h * Math.PI / 180); b2 = C * Math.sin(h * Math.PI / 180); } return [L, a, b2]; }, formats: { lch: { coords: ["<percentage> | <number>", "<number> | <percentage>", "<number> | <angle>"] } } }); // packages/theme/node_modules/colorjs.io/src/deltaE/deltaE2000.js var Gfactor = 25 ** 7; var \u03C0 = Math.PI; var r2d = 180 / \u03C0; var d2r = \u03C0 / 180; function pow7(x) { const x2 = x * x; const x7 = x2 * x2 * x2 * x; return x7; } function deltaE2000_default(color, sample, { kL = 1, kC = 1, kH = 1 } = {}) { [color, sample] = getColor([color, sample]); let [L1, a1, b1] = lab_default.from(color); let C1 = lch_default.from(lab_default, [L1, a1, b1])[1]; let [L2, a2, b2] = lab_default.from(sample); let C2 = lch_default.from(lab_default, [L2, a2, b2])[1]; if (C1 < 0) { C1 = 0; } if (C2 < 0) { C2 = 0; } let Cbar = (C1 + C2) / 2; let C7 = pow7(Cbar); let G = 0.5 * (1 - Math.sqrt(C7 / (C7 + Gfactor))); let adash1 = (1 + G) * a1; let adash2 = (1 + G) * a2; let Cdash1 = Math.sqrt(adash1 ** 2 + b1 ** 2); let Cdash2 = Math.sqrt(adash2 ** 2 + b2 ** 2); let h1 = adash1 === 0 && b1 === 0 ? 0 : Math.atan2(b1, adash1); let h2 = adash2 === 0 && b2 === 0 ? 0 : Math.atan2(b2, adash2); if (h1 < 0) { h1 += 2 * \u03C0; } if (h2 < 0) { h2 += 2 * \u03C0; } h1 *= r2d; h2 *= r2d; let \u0394L = L2 - L1; let \u0394C = Cdash2 - Cdash1; let hdiff = h2 - h1; let hsum = h1 + h2; let habs = Math.abs(hdiff); let \u0394h; if (Cdash1 * Cdash2 === 0) { \u0394h = 0; } else if (habs <= 180) { \u0394h = hdiff; } else if (hdiff > 180) { \u0394h = hdiff - 360; } else if (hdiff < -180) { \u0394h = hdiff + 360; } else { defaults_default.warn("the unthinkable has happened"); } let \u0394H = 2 * Math.sqrt(Cdash2 * Cdash1) * Math.sin(\u0394h * d2r / 2); let Ldash = (L1 + L2) / 2; let Cdash = (Cdash1 + Cdash2) / 2; let Cdash7 = pow7(Cdash); let hdash; if (Cdash1 * Cdash2 === 0) { hdash = hsum; } else if (habs <= 180) { hdash = hsum / 2; } else if (hsum < 360) { hdash = (hsum + 360) / 2; } else { hdash = (hsum - 360) / 2; } let lsq = (Ldash - 50) ** 2; let SL = 1 + 0.015 * lsq / Math.sqrt(20 + lsq); let SC = 1 + 0.045 * Cdash; let T = 1; T -= 0.17 * Math.cos((hdash - 30) * d2r); T += 0.24 * Math.cos(2 * hdash * d2r); T += 0.32 * Math.cos((3 * hdash + 6) * d2r); T -= 0.2 * Math.cos((4 * hdash - 63) * d2r); let SH = 1 + 0.015 * Cdash * T; let \u0394\u03B8 = 30 * Math.exp(-1 * ((hdash - 275) / 25) ** 2); let RC = 2 * Math.sqrt(Cdash7 / (Cdash7 + Gfactor)); let RT = -1 * Math.sin(2 * \u0394\u03B8 * d2r) * RC; let dE = (\u0394L / (kL * SL)) ** 2; dE += (\u0394C / (kC * SC)) ** 2; dE += (\u0394H / (kH * SH)) ** 2; dE += RT * (\u0394C / (kC * SC)) * (\u0394H / (kH * SH)); return Math.sqrt(dE); } // packages/theme/node_modules/colorjs.io/src/spaces/oklab.js var XYZtoLMS_M = [ [0.819022437996703, 0.3619062600528904, -0.1288737815209879], [0.0329836539323885, 0.9292868615863434, 0.0361446663506424], [0.0481771893596242, 0.2642395317527308, 0.6335478284694309] ]; var LMStoXYZ_M = [ [1.2268798758459243, -0.5578149944602171, 0.2813910456659647], [-0.0405757452148008, 1.112286803280317, -0.0717110580655164], [-0.0763729366746601, -0.4214933324022432, 1.5869240198367816] ]; var LMStoLab_M = [ [0.210454268309314, 0.7936177747023054, -0.0040720430116193], [1.9779985324311684, -2.42859224204858, 0.450593709617411], [0.0259040424655478, 0.7827717124575296, -0.8086757549230774] ]; var LabtoLMS_M = [ [1, 0.3963377773761749, 0.2158037573099136], [1, -0.1055613458156586, -0.0638541728258133], [1, -0.0894841775298119, -1.2914855480194092] ]; var oklab_default = new ColorSpace({ id: "oklab", name: "Oklab", coords: { l: { refRange: [0, 1], name: "Lightness" }, a: { refRange: [-0.4, 0.4] }, b: { refRange: [-0.4, 0.4] } }, // Note that XYZ is relative to D65 white: "D65", base: xyz_d65_default, fromBase(XYZ) { let LMS = multiply_v3_m3x3(XYZ, XYZtoLMS_M); LMS[0] = Math.cbrt(LMS[0]); LMS[1] = Math.cbrt(LMS[1]); LMS[2] = Math.cbrt(LMS[2]); return multiply_v3_m3x3(LMS, LMStoLab_M, LMS); }, toBase(OKLab) { let LMSg = multiply_v3_m3x3(OKLab, LabtoLMS_M); LMSg[0] = LMSg[0] ** 3; LMSg[1] = LMSg[1] ** 3; LMSg[2] = LMSg[2] ** 3; return multiply_v3_m3x3(LMSg, LMStoXYZ_M, LMSg); }, formats: { oklab: { coords: [ "<percentage> | <number>", "<number> | <percentage>", "<number> | <percentage>" ] } } }); // packages/theme/node_modules/colorjs.io/src/deltaE/deltaEOK.js function deltaEOK_default(color, sample) { [color, sample] = getColor([color, sample]); let [L1, a1, b1] = oklab_default.from(color); let [L2, a2, b2] = oklab_default.from(sample); let \u0394L = L1 - L2; let \u0394a = a1 - a2; let \u0394b = b1 - b2; return Math.sqrt(\u0394L ** 2 + \u0394a ** 2 + \u0394b ** 2); } // packages/theme/node_modules/colorjs.io/src/inGamut.js var \u03B54 = 75e-6; function inGamut(color, space, { epsilon = \u03B54 } = {}) { color = getColor(color); if (!space) { space = color.space; } space = ColorSpace.get(space); let coords = color.coords; if (space !== color.space) { coords = space.from(color); } return space.inGamut(coords, { epsilon }); } // packages/theme/node_modules/colorjs.io/src/clone.js function clone(color) { return { space: color.space, coords: ( /** @type {Coords} */ color.coords.slice() ), alpha: color.alpha }; } // packages/theme/node_modules/colorjs.io/src/distance.js function distance(color1, color2, space = "lab") { space = ColorSpace.get(space); let coords1 = space.from(color1); let coords2 = space.from(color2); return Math.sqrt( coords1.reduce((acc, c13, i) => { let c23 = coords2[i]; if (isNone(c13) || isNone(c23)) { return acc; } return acc + (c23 - c13) ** 2; }, 0) ); } // packages/theme/node_modules/colorjs.io/src/deltaE/deltaE76.js function deltaE76(color, sample) { return distance(color, sample, "lab"); } // packages/theme/node_modules/colorjs.io/src/deltaE/deltaECMC.js var \u03C02 = Math.PI; var d2r2 = \u03C02 / 180; function deltaECMC_default(color, sample, { l = 2, c = 1 } = {}) { [color, sample] = getColor([color, sample]); let [L1, a1, b1] = lab_default.from(color); let [, C1, H1] = lch_default.from(lab_default, [L1, a1, b1]); let [L2, a2, b2] = lab_default.from(sample); let C2 = lch_default.from(lab_default, [L2, a2, b2])[1]; if (C1 < 0) { C1 = 0; } if (C2 < 0) { C2 = 0; } let \u0394L = L1 - L2; let \u0394C = C1 - C2; let \u0394a = a1 - a2; let \u0394b = b1 - b2; let H2 = \u0394a ** 2 + \u0394b ** 2 - \u0394C ** 2; let SL = 0.511; if (L1 >= 16) { SL = 0.040975 * L1 / (1 + 0.01765 * L1); } let SC = 0.0638 * C1 / (1 + 0.0131 * C1) + 0.638; let T; if (isNone(H1)) { H1 = 0; } if (H1 >= 164 && H1 <= 345) { T = 0.56 + Math.abs(0.2 * Math.cos((H1 + 168) * d2r2)); } else { T = 0.36 + Math.abs(0.4 * Math.cos((H1 + 35) * d2r2)); } let C4 = Math.pow(C1, 4); let F = Math.sqrt(C4 / (C4 + 1900)); let SH = SC * (F * T + 1 - F); let dE = (\u0394L / (l * SL)) ** 2; dE += (\u0394C / (c * SC)) ** 2; dE += H2 / SH ** 2; return Math.sqrt(dE); } // packages/theme/node_modules/colorjs.io/src/spaces/xyz-abs-d65.js var Yw = 203; var xyz_abs_d65_default = new ColorSpace({ // Absolute CIE XYZ, with a D65 whitepoint, // as used in most HDR colorspaces as a starting point. // SDR spaces are converted per BT.2048 // so that diffuse, media white is 203 cd/m² id: "xyz-abs-d65", cssId: "--xyz-abs-d65", name: "Absolute XYZ D65", coords: { x: { refRange: [0, 9504.7], name: "Xa" }, y: { refRange: [0, 1e4], name: "Ya" }, z: { refRange: [0, 10888.3], name: "Za" } }, base: xyz_d65_default, fromBase(XYZ) { return XYZ.map((v) => v * Yw); }, toBase(AbsXYZ) { return AbsXYZ.map((v) => v / Yw); } }); // packages/theme/node_modules/colorjs.io/src/spaces/jzazbz.js var b = 1.15; var g = 0.66; var n = 2610 / 2 ** 14; var ninv = 2 ** 14 / 2610; var c1 = 3424 / 2 ** 12; var c2 = 2413 / 2 ** 7; var c3 = 2392 / 2 ** 7; var p = 1.7 * 2523 / 2 ** 5; var pinv = 2 ** 5 / (1.7 * 2523); var d = -0.56; var d0 = 16295499532821565e-27; var XYZtoCone_M = [ [0.41478972, 0.579999, 0.014648], [-0.20151, 1.120649, 0.0531008], [-0.0166008, 0.2648, 0.6684799] ]; var ConetoXYZ_M = [ [1.9242264357876067, -1.0047923125953657, 0.037651404030618], [0.35031676209499907, 0.7264811939316552, -0.06538442294808501], [-0.09098281098284752, -0.3127282905230739, 1.5227665613052603] ]; var ConetoIab_M = [ [0.5, 0.5, 0], [3.524, -4.066708, 0.542708], [0.199076, 1.096799, -1.295875] ]; var IabtoCone_M = [ [1, 0.13860504327153927, 0.05804731615611883], [1, -0.1386050432715393, -0.058047316156118904], [1, -0.09601924202631895, -0.811891896056039] ]; var jzazbz_default = new ColorSpace({ id: "jzazbz", name: "Jzazbz", coords: { jz: { refRange: [0, 1], name: "Jz" }, az: { refRange: [-0.21, 0.21] }, bz: { refRange: [-0.21, 0.21] } }, base: xyz_abs_d65_default, fromBase(XYZ) { let [Xa, Ya, Za] = XYZ; let Xm = b * Xa - (b - 1) * Za; let Ym = g * Ya - (g - 1) * Xa; let LMS = multiply_v3_m3x3([Xm, Ym, Za], XYZtoCone_M); let PQLMS = ( /** @type {Vector3} } */ LMS.map(function(val) { let num = c1 + c2 * spow(val / 1e4, n); let denom = 1 + c3 * spow(val / 1e4, n); return spow(num / denom, p); }) ); let [Iz, az, bz] = multiply_v3_m3x3(PQLMS, ConetoIab_M); let Jz = (1 + d) * Iz / (1 + d * Iz) - d0; return [Jz, az, bz]; }, toBase(Jzazbz) { let [Jz, az, bz] = Jzazbz; let Iz = (Jz + d0) / (1 + d - d * (Jz + d0)); let PQLMS = multiply_v3_m3x3([Iz, az, bz], IabtoCone_M); let LMS = ( /** @type {Vector3} } */ PQLMS.map(function(val) { let num = c1 - spow(val, pinv); let denom = c3 * spow(val, pinv) - c2; let x = 1e4 * spow(num / denom, ninv); return x; }) ); let [Xm, Ym, Za] = multiply_v3_m3x3(LMS, ConetoXYZ_M); let Xa = (Xm + (b - 1) * Za) / b; let Ya = (Ym + (g - 1) * Xa) / g; return [Xa, Ya, Za]; }, formats: { // https://drafts.csswg.org/css-color-hdr/#Jzazbz jzazbz: { coords: [ "<percentage> | <number>", "<number> | <percentage>", "<number> | <percentage>" ] } } }); // packages/theme/node_modules/colorjs.io/src/spaces/jzczhz.js var jzczhz_default = new ColorSpace({ id: "jzczhz", name: "JzCzHz", coords: { jz: { refRange: [0, 1], name: "Jz" }, cz: { refRange: [0, 0.26], name: "Chroma" }, hz: { refRange: [0, 360], type: "angle", name: "Hue" } }, base: jzazbz_default, fromBase: lch_default.fromBase, toBase: lch_default.toBase, formats: { // https://drafts.csswg.org/css-color-hdr/#JzCzhz jzczhz: { coords: ["<percentage> | <number>", "<number> | <percentage>", "<number> | <angle>"] } } }); // packages/theme/node_modules/colorjs.io/src/deltaE/deltaEJz.js function deltaEJz_default(color, sample) { [color, sample] = getColor([color, sample]); let [Jz1, Cz1, Hz1] = jzczhz_default.from(color); let [Jz2, Cz2, Hz2] = jzczhz_default.from(sample); let \u0394J = Jz1 - Jz2; let \u0394C = Cz1 - Cz2; if (isNone(Hz1) && isNone(Hz2)) { Hz1 = 0; Hz2 = 0; } else if (isNone(Hz1)) { Hz1 = Hz2; } else if (isNone(Hz2)) { Hz2 = Hz1; } let \u0394h = Hz1 - Hz2; let \u0394H = 2 * Math.sqrt(Cz1 * Cz2) * Math.sin(\u0394h / 2 * (Math.PI / 180)); return Math.sqrt(\u0394J ** 2 + \u0394C ** 2 + \u0394H ** 2); } // packages/theme/node_modules/colorjs.io/src/spaces/ictcp.js var c12 = 3424 / 4096; var c22 = 2413 / 128; var c32 = 2392 / 128; var m1 = 2610 / 16384; var m2 = 2523 / 32; var im1 = 16384 / 2610; var im2 = 32 / 2523; var XYZtoLMS_M2 = [ [0.3592832590121217, 0.6976051147779502, -0.035891593232029], [-0.1920808463704993, 1.100476797037432, 0.0753748658519118], [0.0070797844607479, 0.0748396662186362, 0.8433265453898765] ]; var LMStoIPT_M = [ [2048 / 4096, 2048 / 4096, 0], [6610 / 4096, -13613 / 4096, 7003 / 4096], [17933 / 4096, -17390 / 4096, -543 / 4096] ]; var IPTtoLMS_M = [ [0.9999999999999998, 0.0086090370379328, 0.111029625003026], [0.9999999999999998, -0.0086090370379328, -0.1110296250030259], [0.9999999999999998, 0.5600313357106791, -0.3206271749873188] ]; var LMStoXYZ_M2 = [ [2.0701522183894223, -1.3263473389671563, 0.2066510476294053], [0.3647385209748072, 0.6805660249472273, -0.0453045459220347], [-0.0497472075358123, -0.0492609666966131, 1.1880659249923042] ]; var ictcp_default = new ColorSpace({ id: "ictcp", name: "ICTCP", // From BT.2100-2 page 7: // During production, signal values are expected to exceed the // range E′ = [0.0 : 1.0]. This provides processing headroom and avoids // signal degradation during cascaded processing. Such values of E′, // below 0.0 or exceeding 1.0, should not be clipped during production // and exchange. // Values below 0.0 should not be clipped in reference displays (even // though they represent “negative” light) to allow the black level of // the signal (LB) to be properly set using test signals known as “PLUGE” coords: { i: { refRange: [0, 1], // Constant luminance, name: "I" }, ct: { refRange: [-0.5, 0.5], // Full BT.2020 gamut in range [-0.5, 0.5] name: "CT" }, cp: { refRange: [-0.5, 0.5], name: "CP" } }, base: xyz_abs_d65_default, fromBase(XYZ) { let LMS = multiply_v3_m3x3(XYZ, XYZtoLMS_M2); return LMStoICtCp(LMS); }, toBase(ICtCp) { let LMS = ICtCptoLMS(ICtCp); return multiply_v3_m3x3(LMS, LMStoXYZ_M2); }, formats: { ictcp: { coords: [ "<percentage> | <number>", "<number> | <percentage>", "<number> | <percentage>" ] } } }); function LMStoICtCp(LMS) { let PQLMS = ( /** @type {Vector3} */ LMS.map(function(val) { let num = c12 + c22 * (val / 1e4) ** m1; let denom = 1 + c32 * (val / 1e4) ** m1; return (num / denom) ** m2; }) ); return multiply_v3_m3x3(PQLMS, LMStoIPT_M); } function ICtCptoLMS(ICtCp) { let PQLMS = multiply_v3_m3x3(ICtCp, IPTtoLMS_M); let LMS = ( /** @type {Vector3} */ PQLMS.map(function(val) { let num = Math.max(val ** im2 - c12, 0); let denom = c22 - c32 * val ** im2; return 1e4 * (num / denom) ** im1; }) ); return LMS; } // packages/theme/node_modules/colorjs.io/src/deltaE/deltaEITP.js function deltaEITP_default(color, sample) { [color, sample] = getColor([color, sample]); let [I1, T1, P1] = ictcp_default.from(color); let [I2, T2, P2] = ictcp_default.from(sample); return 720 * Math.sqrt((I1 - I2) ** 2 + 0.25 * (T1 - T2) ** 2 + (P1 - P2) ** 2); } // packages/theme/node_modules/colorjs.io/src/deltaE/deltaEOK2.js function deltaEOK2_default(color, sample) { [color, sample] = getColor([color, sample]); let abscale = 2; let [L1, a1, b1] = oklab_default.from(color); let [L2, a2, b2] = oklab_default.from(sample); let \u0394L = L1 - L2; let \u0394a = abscale * (a1 - a2); let \u0394b = abscale * (b1 - b2); return Math.sqrt(\u0394L ** 2 + \u0394a ** 2 + \u0394b ** 2); } // packages/theme/node_modules/colorjs.io/src/spaces/cam16.js var white2 = WHITES.D65; var adaptedCoef = 0.42; var adaptedCoefInv = 1 / adaptedCoef; var tau = 2 * Math.PI; var cat16 = [ [0.401288, 0.650173, -0.051461], [-0.250268, 1.204414, 0.045854], [-2079e-6, 0.048952, 0.953127] ]; var cat16Inv = [ [1.8620678550872327, -1.0112546305316843, 0.14918677544445175], [0.38752654323613717, 0.6214474419314753, -0.008973985167612518], [-0.015841498849333856, -0.03412293802851557, 1.0499644368778496] ]; var m12 = [ [460, 451, 288], [460, -891, -261], [460, -220, -6300] ]; var surroundMap = { dark: [0.8, 0.525, 0.8], dim: [0.9, 0.59, 0.9], average: [1, 0.69, 1] }; var hueQuadMap = { // Red, Yellow, Green, Blue, Red h: [20.14, 90, 164.25, 237.53, 380.14], e: [0.8, 0.7, 1, 1.2, 0.8], H: [0, 100, 200, 300, 400] }; var rad2deg = 180 / Math.PI; var deg2rad = Math.PI / 180; function adapt2(coords, fl) { const temp = ( /** @type {[number, number, number]} */ coords.map((c) => { const x = spow(fl * Math.abs(c) * 0.01, adaptedCoef); return 400 * copySign(x, c) / (x + 27.13); }) ); return temp; } function unadapt(adapted, fl) { const constant = 100 / fl * 27.13 ** adaptedCoefInv; return ( /** @type {[number, number, number]} */ adapted.map((c) => { const cabs = Math.abs(c); return copySign(constant * spow(cabs / (400 - cabs), adaptedCoefInv), c); }) ); } function hueQuadrature(h) { let hp = constrain(h); if (hp <= hueQuadMap.h[0]) { hp += 360; } const i = bisectLeft(hueQuadMap.h, hp) - 1; const [hi, hii] = hueQuadMap.h.slice(i, i + 2); const [ei, eii] = hueQuadMap.e.slice(i, i + 2); const Hi = hueQuadMap.H[i]; const t = (hp - hi) / ei; return Hi + 100 * t / (t + (hii - hp) / eii); } function invHueQuadrature(H) { let Hp = (H % 400 + 400) % 400; const i = Math.floor(0.01 * Hp); Hp = Hp % 100; const [hi, hii] = hueQuadMap.h.slice(i, i + 2); const [ei, eii] = hueQuadMap.e.slice(i, i + 2); return constrain((Hp * (eii * hi - ei * hii) - 100 * hi * eii) / (Hp * (eii - ei) - 100 * eii)); } function environment(refWhite, adaptingLuminance, backgroundLuminance, surround, discounting) { const env = {}; env.discounting = discounting; env.refWhite = refWhite; env.surround = surround; const xyzW = ( /** @type {Vector3} */ refWhite.map((c) => { return c * 100; }) ); env.la = adaptingLuminance; env.yb = backgroundLuminance; const yw = xyzW[1]; const rgbW = multiply_v3_m3x3(xyzW, cat16); let values = surroundMap[env.surround]; const f = values[0]; env.c = values[1]; env.nc = values[2]; const k = 1 / (5 * env.la + 1); const k4 = k ** 4; env.fl = k4 * env.la + 0.1 * (1 - k4) * (1 - k4) * Math.cbrt(5 * env.la); env.flRoot = env.fl ** 0.25; env.n = env.yb / yw; env.z = 1.48 + Math.sqrt(env.n); env.nbb = 0.725 * env.n ** -0.2; env.ncb = env.nbb; const d2 = discounting ? 1 : Math.max(Math.min(f * (1 - 1 / 3.6 * Math.exp((-env.la - 42) / 92)), 1), 0); env.dRgb = /** @type {[number, number, number]} */ rgbW.map((c) => { return interpolate(1, yw / c, d2); }); env.dRgbInv = /** @type {[number, number, number]} */ env.dRgb.map((c) => { return 1 / c; }); const rgbCW = ( /** @type {[number, number, number]} */ rgbW.map((c, i) => { return c * env.dRgb[i]; }) ); const rgbAW = adapt2(rgbCW, env.fl); env.aW = env.nbb * (2 * rgbAW[0] + rgbAW[1] + 0.05 * rgbAW[2]); return env; } var viewingConditions = environment(white2, 64 / Math.PI * 0.2, 20, "average", false); function fromCam16(cam16, env) { if (!(cam16.J !== void 0 ^ cam16.Q !== void 0)) { throw new Error("Conversion requires one and only one: 'J' or 'Q'"); } if (!(cam16.C !== void 0 ^ cam16.M !== void 0 ^ cam16.s !== void 0)) { throw new Error("Conversion requires one and only one: 'C', 'M' or 's'"); } if (!(cam16.h !== void 0 ^ cam16.H !== void 0)) { throw new Error("Conversion requires one and only one: 'h' or 'H'"); } if (cam16.J === 0 || cam16.Q === 0) { return [0, 0, 0]; } let hRad = 0; if (cam16.h !== void 0) { hRad = constrain(cam16.h) * deg2rad; } else { hRad = invHueQuadrature(cam16.H) * deg2rad; } const cosh = Math.cos(hRad); const sinh = Math.sin(hRad); let Jroot = 0; if (cam16.J !== void 0) { Jroot = spow(cam16.J, 1 / 2) * 0.1; } else if (cam16.Q !== void 0) { Jroot = 0.25 * env.c * cam16.Q / ((env.aW + 4) * env.flRoot); } let alpha = 0; if (cam16.C !== void 0) { alpha = cam16.C / Jroot; } else if (cam16.M !== void 0) { alpha = cam16.M / env.flRoot / Jroot; } else if (cam16.s !== void 0) { alpha = 4e-4 * cam16.s ** 2 * (env.aW + 4) / env.c; } const t = spow(alpha * Math.pow(1.64 - Math.pow(0.29, env.n), -0.73), 10 / 9); const et = 0.25 * (Math.cos(hRad + 2) + 3.8); const A = env.aW * spow(Jroot, 2 / env.c / env.z); const p1 = 5e4 / 13 * env.nc * env.ncb * et; const p2 = A / env.nbb; const r = 23 * (p2 + 0.305) * zdiv(t, 23 * p1 + t * (11 * cosh + 108 * sinh)); const a = r * cosh; const b2 = r * sinh; const rgb_c = unadapt( /** @type {Vector3} */ multiply_v3_m3x3([p2, a, b2], m12).map((c) => { return c * 1 / 1403; }), env.fl ); return ( /** @type {Vector3} */ multiply_v3_m3x3( /** @type {Vector3} */ rgb_c.map((c, i) => { return c * env.dRgbInv[i]; }), cat16Inv ).map((c) => { return c / 100; }) ); } function toCam16(xyzd65, env) { const xyz100 = ( /** @type {Vector3} */ xyzd65.map((c) => { return c * 100; }) ); const rgbA = adapt2( /** @type {[number, number, number]} */ multiply_v3_m3x3(xyz100, cat16).map((c, i) => { return c * env.dRgb[i]; }), env.fl ); const a = rgbA[0] + (-12 * rgbA[1] + rgbA[2]) / 11; const b2 = (rgbA[0] + rgbA[1] - 2 * rgbA[2]) / 9; const hRad = (Math.atan2(b2, a) % tau + tau) % tau; const et = 0.25 * (Math.cos(hRad + 2) + 3.8); const t = 5e4 / 13 * env.nc * env.ncb * zdiv(et * Math.sqrt(a ** 2 + b2 ** 2), rgbA[0] + rgbA[1] + 1.05 * rgbA[2] + 0.305); const alpha = spow(t, 0.9) * Math.pow(1.64 - Math.pow(0.29, env.n), 0.73); const A = env.nbb * (2 * rgbA[0] + rgbA[1] + 0.05 * rgbA[2]); const Jroot = spow(A / env.aW, 0.5 * env.c * env.z); const J = 100 * spow(Jroot, 2); const Q = 4 / env.c * Jroot * (env.aW + 4) * env.flRoot; const C = alpha * Jroot; const M = C * env.flRoot; const h = constrain(hRad * rad2deg); const H = hueQuadrature(h); const s = 50 * spow(env.c * alpha / (env.aW + 4), 1 / 2); return { J, C, h, s, Q, M, H }; } var cam16_default = new ColorSpace({ id: "cam16-jmh", cssId: "--cam16-jmh", name: "CAM16-JMh", coords: { j: { refRange: [0, 100], name: "J" }, m: { refRange: [0, 105], name: "Colorfulness" }, h: { refRange: [0, 360], type: "angle", name: "Hue" } }, base: xyz_d65_default, fromBase(xyz) { if (this.\u03B5 === void 0) { this.\u03B5 = Object.values(this.coords)[1].refRange[1] / 1e5; } const cam16 = toCam16(xyz, viewingConditions); const isAchromatic = Math.abs(cam16.M) < this.\u03B5; return [cam16.J, isAchromatic ? 0 : cam16.M, isAchromatic ? null : cam16.h]; }, toBase(cam16) { return fromCam16({ J: cam16[0], M: cam16[1], h: cam16[2] }, viewingConditions); } }); // packages/theme/node_modules/colorjs.io/src/spaces/hct.js var white3 = WHITES.D65; var \u03B55 = 216 / 24389; var \u03BA2 = 24389 / 27; function toLstar(y) { const fy = y > \u03B55 ? Math.cbrt(y) : (\u03BA2 * y + 16) / 116; return 116 * fy - 16; } function fromLstar(lstar) { return lstar > 8 ? Math.pow((lstar + 16) / 116, 3) : lstar / \u03BA2; } function fromHct(coords, env) { let [h, c, t] = coords; let xyz = []; let j = 0; if (t === 0) { return [0, 0, 0]; } let y = fromLstar(t); if (t > 0) { j = 0.00379058511492914 * t ** 2 + 0.608983189401032 * t + 0.9155088574762233; } else { j = 9514440756550361e-21 * t ** 2 + 0.08693057439788597 * t - 21.928975842194614; } const threshold = 2e-12; const max_attempts = 15; let attempt = 0; let last = Infinity; let best = j; while (attempt <= max_attempts) { xyz = fromCam16({ J: j, C: c, h }, env); const delta = Math.abs(xyz[1] - y); if (delta < last) { if (delta <= threshold) { return xyz; } best = j; last = delta; } j = j - (xyz[1] - y) * j / (2 * xyz[1]); attempt += 1; } return fromCam16({ J: j, C: c, h }, env); } function toHct(xyz, env) { const t = toLstar(xyz[1]); if (t === 0) { return [0, 0, 0]; } const cam16 = toCam16(xyz, viewingConditions2); return [constrain(cam16.h), cam16.C, t]; } var viewingConditions2 = environment( white3, 200 / Math.PI * fromLstar(50), fromLstar(50) * 100, "average", false ); var hct_default = new ColorSpace({ id: "hct", name: "HCT", coords: { h: { refRange: [0, 360], type: "angle", name: "Hue" }, c: { refRange: [0, 145], name: "Colorfulness" }, t: { refRange: [0, 100], name: "Tone" } }, base: xyz_d65_default, fromBase(xyz) { if (this.\u03B5 === void 0) { this.\u03B5 = Object.values(this.coords)[1].refRange[1] / 1e5; } let hct = toHct(xyz, viewingConditions2); if (hct[1] < this.\u03B5) { hct[1] = 0; hct[0] = null; } return hct; }, toBase(hct) { return fromHct(hct, viewingConditions2); }, formats: { color: { id: "--hct", coords: ["<number> | <angle>", "<percentage> | <number>", "<percentage> | <number>"] } } }); // packages/theme/node_modules/colorjs.io/src/deltaE/deltaEHCT.js var rad2deg2 = 180 / Math.PI; var deg2rad2 = Math.PI / 180; var ucsCoeff = [1, 7e-3, 0.0228]; function convertUcsAb(coords) { if (coords[1] < 0) { coords = hct_default.fromBase(hct_default.toBase(coords)); } const M = Math.log(Math.max(1 + ucsCoeff[2] * coords[1] * viewingConditions2.flRoot, 1)) / ucsCoeff[2]; const hrad = coords[0] * deg2rad2; const a = M * Math.cos(hrad); const b2 = M * Math.sin(hrad); return [coords[2], a, b2]; } function deltaEHCT_default(color, sample) { [color, sample] = getColor([color, sample]); let [t1, a1, b1] = convertUcsAb(hct_default.from(color)); let [t2, a2, b2] = convertUcsAb(hct_default.from(sample)); return Math.sqrt((t1 - t2) ** 2 + (a1 - a2) ** 2 + (b1 - b2) ** 2); } // packages/theme/node_modules/colorjs.io/src/deltaE/index.js var deltaE_default = { deltaE76, deltaECMC: deltaECMC_default, deltaE2000: deltaE2000_default, deltaEJz: deltaEJz_default, deltaEITP: deltaEITP_default, deltaEOK: deltaEOK_default, deltaEOK2: deltaEOK2_default, deltaEHCT: deltaEHCT_default }; // packages/theme/node_modules/colorjs.io/src/toGamut.js function calcEpsilon(jnd) { const order = !jnd ? 0 : Math.floor(Math.log10(Math.abs(jnd))); return Math.max(parseFloat(`1e${order - 2}`), 1e-6); } var GMAPPRESET = { hct: { method: "hct.c", jnd: 2, deltaEMethod: "hct", blackWhiteClamp: {} }, "hct-tonal": { method: "hct.c", jnd: 0, deltaEMethod: "hct", blackWhiteClamp: { channel: "hct.t", min: 0, max: 100 } } }; function toGamut(color, { method = defaults_default.gamut_mapping, space = void 0, deltaEMethod = "", jnd = 2, blackWhiteClamp = void 0 } = {}) { color = getColor(color); if (isString(arguments[1])) { space = arguments[1]; } else if (!space) { space = color.space; } space = ColorSpace.get(space); if (inGamut(color, space, { epsilon: 0 })) { return ( /** @type {PlainColorObject} */ color ); } let spaceColor; if (method === "css") { spaceColor = toGamutCSS(color, { space }); } else { if (method !== "clip" && !inGamut(color, space)) { if (Object.prototype.hasOwnProperty.call(GMAPPRESET, method)) { ({ method, jnd, deltaEMethod, blackWhiteClamp } = GMAPPRESET[method]); } let de = deltaE2000_default; if (deltaEMethod !== "") { for (let m in deltaE_default) { if ("deltae" + deltaEMethod.toLowerCase() === m.toLowerCase()) { de = deltaE_default[m]; break; } } } if (jnd === 0) { jnd = 1e-16; } let clipped = toGamut(to(color, space), { method: "clip", space }); if (de(color, clipped) > jnd) { if (blackWhiteClamp && Object.keys(blackWhiteClamp).length === 3) { let channelMeta = ColorSpace.resolveCoord(blackWhiteClamp.channel); let channel = get(to(color, channelMeta.space), channelMeta.id); if (isNone(channel)) { channel = 0; } if (channel >= blackWhiteClamp.max) { return to({ space: "xyz-d65", coords: WHITES["D65"] }, color.space); } else if (channel <= blackWhiteClamp.min) { return to({ space: "xyz-d65", coords: [0, 0, 0] }, color.space); } } let coordMeta = ColorSpace.resolveCoord(method); let mapSpace = coordMeta.space; let coordId = coordMeta.id; let mappedColor = to(color, mapSpace); mappedColor.coords.forEach((c, i) => { if (isNone(c)) { mappedColor.coords[i] = 0; } }); let bounds = coordMeta.range || coordMeta.refRange; let min = bounds[0]; let \u03B56 = calcEpsilon(jnd); let low = min; let high = get(mappedColor, coordId); while (high - low > \u03B56) { let clipped2 = clone(mappedColor); clipped2 = toGamut(clipped2, { space, method: "clip" }); let deltaE = de(mappedColor, clipped2); if (deltaE - jnd < \u03B56) { low = get(mappedColor, coordId); } else { high = get(mappedColor, coordId); } set(mappedColor, coordId, (low + high) / 2); } spaceColor = to(mappedColor, space); } else { spaceColor = clipped; } } else { spaceColor = to(color, space); } if (method === "clip" || // Dumb coord clipping // finish off smarter gamut mapping with clip to get rid of ε, see #17 !inGamut(spaceColor, space, { epsilon: 0 })) { let bounds = Object.values(space.coords).map((c) => c.range || []); spaceColor.coords = /** @type {[number, number, number]} */ spaceColor.coords.map((c, i) => { let [min, max] = bounds[i]; if (min !== void 0) { c = Math.max(min, c); } if (max !== void 0) { c = Math.min(c, max); } return c; }); } } if (space !== color.space) { spaceColor = to(spaceColor, color.space); } color.coords = spaceColor.coords; return ( /** @type {PlainColorObject} */ color ); } toGamut.returns = "color"; var COLORS = { WHITE: { space: oklab_default, coords: [1, 0, 0], alpha: 1 }, BLACK: { space: oklab_default, coords: [0, 0, 0], alpha: 1 } }; function toGamutCSS(origin, { space } = {}) { const JND = 0.02; const \u03B56 = 1e-4; origin = getColor(origin); if (!space) { space = origin.space; } space = ColorSpace.get(space); const oklchSpace = ColorSpace.get("oklch"); if (space.isUnbounded) { return to(origin, space); } const origin_OKLCH = to(origin, oklchSpace); let L = origin_OKLCH.coords[0]; if (L >= 1) { const white4 = to(COLORS.WHITE, space); white4.alpha = origin.alpha; return to(white4, space); } if (L <= 0) { const black = to(COLORS.BLACK, space); black.alpha = origin.alpha; return to(black, space); } if (inGamut(origin_OKLCH, space, { epsilon: 0 })) { return to(origin_OKLCH, space); } function clip(_color) { const destColor = to(_color, space); const spaceCoords = Object.values( /** @type {ColorSpace} */ space.coords ); destColor.coords = /** @type {[number, number, number]} */ destColor.coords.map((coord, index) => { if ("range" in spaceCoords[index]) { const [min2, max2] = spaceCoords[index].range; return clamp(min2, coord, max2); } return coord; }); return destColor; } let min = 0; let max = origin_OKLCH.coords[1]; let min_inGamut = true; let current = clone(origin_OKLCH); let clipped = clip(current); let E = deltaEOK_default(clipped, current); if (E < JND) { return clipped; } while (max - min > \u03B56) { const chroma = (min + max) / 2; current.coords[1] = chroma; if (min_inGamut && inGamut(current, space, { epsilon: 0 })) { min = chroma; } else { clipped = clip(current); E = deltaEOK_default(clipped, current); if (E < JND) { if (JND - E < \u03B56) { break; } else { min_inGamut = false; min = chroma; } } else { max = chroma; } } } return clipped; } // packages/theme/node_modules/colorjs.io/src/to.js function to(color, space, { inGamut: inGamut2 } = {}) { color = getColor(color); space = ColorSpace.get(space); let coords = space.from(color); let ret = { space, coords, alpha: color.alpha }; if (inGamut2) { ret = toGamut(ret, inGamut2 === true ? void 0 : inGamut2); } return ret; } to.returns = "color"; // packages/theme/node_modules/colorjs.io/src/serialize.js function serialize(color, options = {}) { let { precision = defaults_default.precision, format, inGamut: inGamut2 = true, coords: coordFormat, alpha: alphaFormat, commas } = options; let ret; let colorWithMeta = ( /** @type {PlainColorObject & ParseOptions} */ getColor(color) ); let formatId = format; let parseMeta = colorWithMeta.parseMeta; if (parseMeta && !format) { if (parseMeta.format.canSerialize()) { format = parseMeta.format; formatId = parseMeta.formatId; } coordFormat ??= parseMeta.types; alphaFormat ??= parseMeta.alphaType; commas ??= parseMeta.commas; } if (formatId) { format = colorWithMeta.space.getFormat(format) ?? ColorSpace.findFormat(formatId); } if (!format) { format = colorWithMeta.space.getFormat("default") ?? ColorSpace.DEFAULT_FORMAT; formatId = format.name; } if (format && format.space && format.space !== colorWithMeta.space) { colorWithMeta = to(colorWithMeta, format.space); } let coords = colorWithMeta.coords.slice(); inGamut2 ||= format.toGamut; if (inGamut2 && !inGamut(colorWithMeta)) { coords = toGamut(clone(colorWithMeta), inGamut2 === true ? void 0 : inGamut2).coords; } if (format.type === "custom") { if (format.serialize) { ret = format.serialize(coords, colorWithMeta.alpha, options); } else { throw new TypeError( `format ${formatId} can only be used to parse colors, not for serialization` ); } } else { let name = format.name || "color"; let args = format.serializeCoords(coords, precision, coordFormat); if (name === "color") { let cssId = format.id || format.ids?.[0] || colorWithMeta.space.cssId || colorWithMeta.space.id; args.unshift(cssId); } let alpha = colorWithMeta.alpha; if (alphaFormat !== void 0 && !(typeof alphaFormat === "object")) { alphaFormat = typeof alphaFormat === "string" ? { type: alphaFormat } : { include: alphaFormat }; } let alphaType = alphaFormat?.type ?? "<number>"; let serializeAlpha = alphaFormat?.include === true || format.alpha === true || alphaFormat?.include !== false && format.alpha !== false && alpha < 1; let strAlpha = ""; commas ??= format.commas; if (serializeAlpha) { if (precision !== null) { let unit; if (alphaType === "<percentage>") { unit = "%"; alpha *= 100; } alpha = serializeNumber(alpha, { precision, unit }); } strAlpha = `${commas ? "," : " /"} ${alpha}`; } ret = `${name}(${args.join(commas ? ", " : " ")}${strAlpha})`; } return ret; } // packages/theme/node_modules/colorjs.io/src/spaces/p3-linear.js var toXYZ_M = [ [0.4865709486482162, 0.26566769316909306, 0.1982172852343625], [0.2289745640697488, 0.6917385218365064, 0.079286914093745], [0, 0.04511338185890264, 1.043944368900976] ]; var fromXYZ_M = [ [2.493496911941425, -0.9313836179191239, -0.40271078445071684], [-0.8294889695615747, 1.7626640603183463, 0.023624685841943577], [0.03584583024378447, -0.07617238926804182, 0.9568845240076872] ]; var p3_linear_default = new RGBColorSpace({ id: "p3-linear", cssId: "display-p3-linear", name: "Linear P3", white: "D65", toXYZ_M, fromXYZ_M }); // packages/theme/node_modules/colorjs.io/src/spaces/srgb-linear.js var toXYZ_M2 = [ [0.41239079926595934, 0.357584339383878, 0.1804807884018343], [0.21263900587151027, 0.715168678767756, 0.07219231536073371], [0.01933081871559182, 0.11919477979462598, 0.9505321522496607] ]; var fromXYZ_M2 = [ [3.2409699419045226, -1.537383177570094, -0.4986107602930034], [-0.9692436362808796, 1.8759675015077202, 0.04155505740717559], [0.05563007969699366, -0.20397695888897652, 1.0569715142428786] ]; var srgb_linear_default = new RGBColorSpace({ id: "srgb-linear", name: "Linear sRGB", white: "D65", toXYZ_M: toXYZ_M2, fromXYZ_M: fromXYZ_M2 }); // packages/theme/node_modules/colorjs.io/src/keywords.js var keywords_default = { aliceblue: [240 / 255, 248 / 255, 1], antiquewhite: [250 / 255, 235 / 255, 215 / 255], aqua: [0, 1, 1], aquamarine: [127 / 255, 1, 212 / 255], azure: [240 / 255, 1, 1], beige: [245 / 255, 245 / 255, 220 / 255], bisque: [1, 228 / 255, 196 / 255], black: [0, 0, 0], blanchedalmond: [1, 235 / 255, 205 / 255], blue: [0, 0, 1], blueviolet: [138 / 255, 43 / 255, 226 / 255], brown: [165 / 255, 42 / 255, 42 / 255], burlywood: [222 / 255, 184 / 255, 135 / 255], cadetblue: [95 / 255, 158 / 255, 160 / 255], chartreuse: [127 / 255, 1, 0], chocolate: [210 / 255, 105 / 255, 30 / 255], coral: [1, 127 / 255, 80 / 255], cornflowerblue: [100 / 255, 149 / 255, 237 / 255], cornsilk: [1, 248 / 255, 220 / 255], crimson: [220 / 255, 20 / 255, 60 / 255], cyan: [0, 1, 1], darkblue: [0, 0, 139 / 255], darkcyan: [0, 139 / 255, 139 / 255], darkgoldenrod: [184 / 255, 134 / 255, 11 / 255], darkgray: [169 / 255, 169 / 255, 169 / 255], darkgreen: [0, 100 / 255, 0], darkgrey: [169 / 255, 169 / 255, 169 / 255], darkkhaki: [189 / 255, 183 / 255, 107 / 255], darkmagenta: [139 / 255, 0, 139 / 255], darkolivegreen: [85 / 255, 107 / 255, 47 / 255], darkorange: [1, 140 / 255, 0], darkorchid: [153 / 255, 50 / 255, 204 / 255], darkred: [139 / 255, 0, 0], darksalmon: [233 / 255, 150 / 255, 122 / 255], darkseagreen: [143 / 255, 188 / 255, 143 / 255], darkslateblue: [72 / 255, 61 / 255, 139 / 255], darkslategray: [47 / 255, 79 / 255, 79 / 255], darkslategrey: [47 / 255, 79 / 255, 79 / 255], darkturquoise: [0, 206 / 255, 209 / 255], darkviolet: [148 / 255, 0, 211 / 255], deeppink: [1, 20 / 255, 147 / 255], deepskyblue: [0, 191 / 255, 1], dimgray: [105 / 255, 105 / 255, 105 / 255], dimgrey: [105 / 255, 105 / 255, 105 / 255], dodgerblue: [30 / 255, 144 / 255, 1], firebrick: [178 / 255, 34 / 255, 34 / 255], floralwhite: [1, 250 / 255, 240 / 255], forestgreen: [34 / 255, 139 / 255, 34 / 255], fuchsia: [1, 0, 1], gainsboro: [220 / 255, 220 / 255, 220 / 255], ghostwhite: [248 / 255, 248 / 255, 1], gold: [1, 215 / 255, 0], goldenrod: [218 / 255, 165 / 255, 32 / 255], gray: [128 / 255, 128 / 255, 128 / 255], green: [0, 128 / 255, 0], greenyellow: [173 / 255, 1, 47 / 255], grey: [128 / 255, 128 / 255, 128 / 255], honeydew: [240 / 255, 1, 240 / 255], hotpink: [1, 105 / 255, 180 / 255], indianred: [205 / 255, 92 / 255, 92 / 255], indigo: [75 / 255, 0, 130 / 255], ivory: [1, 1, 240 / 255], khaki: [240 / 255, 230 / 255, 140 / 255], lavender: [230 / 255, 230 / 255, 250 / 255], lavenderblush: [1, 240 / 255, 245 / 255], lawngreen: [124 / 255, 252 / 255, 0], lemonchiffon: [1, 250 / 255, 205 / 255], lightblue: [173 / 255, 216 / 255, 230 / 255], lightcoral: [240 / 255, 128 / 255, 128 / 255], lightcyan: [224 / 255, 1, 1], lightgoldenrodyellow: [250 / 255, 250 / 255, 210 / 255], lightgray: [211 / 255, 211 / 255, 211 / 255], lightgreen: [144 / 255, 238 / 255, 144 / 255], lightgrey: [211 / 255, 211 / 255, 211 / 255], lightpink: [1, 182 / 255, 193 / 255], lightsalmon: [1, 160 / 255, 122 / 255], lightseagreen: [32 / 255, 178 / 255, 170 / 255], lightskyblue: [135 / 255, 206 / 255, 250 / 255], lightslategray: [119 / 255, 136 / 255, 153 / 255], lightslategrey: [119 / 255, 136 / 255, 153 / 255], lightsteelblue: [176 / 255, 196 / 255, 222 / 255], lightyellow: [1, 1, 224 / 255], lime: [0, 1, 0], limegreen: [50 / 255, 205 / 255, 50 / 255], linen: [250 / 255, 240 / 255, 230 / 255], magenta: [1, 0, 1], maroon: [128 / 255, 0, 0], mediumaquamarine: [102 / 255, 205 / 255, 170 / 255], mediumblue: [0, 0, 205 / 255], mediumorchid: [186 / 255, 85 / 255, 211 / 255], mediumpurple: [147 / 255, 112 / 255, 219 / 255], mediumseagreen: [60 / 255, 179 / 255, 113 / 255], mediumslateblue: [123 / 255, 104 / 255, 238 / 255], mediumspringgreen: [0, 250 / 255, 154 / 255], mediumturquoise: [72 / 255, 209 / 255, 204 / 255], mediumvioletred: [199 / 255, 21 / 255, 133 / 255], midnightblue: [25 / 255, 25 / 255, 112 / 255], mintcream: [245 / 255, 1, 250 / 255], mistyrose: [1, 228 / 255, 225 / 255], moccasin: [1, 228 / 255, 181 / 255], navajowhite: [1, 222 / 255, 173 / 255], navy: [0, 0, 128 / 255], oldlace: [253 / 255, 245 / 255, 230 / 255], olive: [128 / 255, 128 / 255, 0], olivedrab: [107 / 255, 142 / 255, 35 / 255], orange: [1, 165 / 255, 0], orangered: [1, 69 / 255, 0], orchid: [218 / 255, 112 / 255, 214 / 255], palegoldenrod: [238 / 255, 232 / 255, 170 / 255], palegreen: [152 / 255, 251 / 255, 152 / 255], paleturquoise: [175 / 255, 238 / 255, 238 / 255], palevioletred: [219 / 255, 112 / 255, 147 / 255], papayawhip: [1, 239 / 255, 213 / 255], peachpuff: [1, 218 / 255, 185 / 255], peru: [205 / 255, 133 / 255, 63 / 255], pink: [1, 192 / 255, 203 / 255], plum: [221 / 255, 160 / 255, 221 / 255], powderblue: [176 / 255, 224 / 255, 230 / 255], purple: [128 / 255, 0, 128 / 255], rebeccapurple: [102 / 255, 51 / 255, 153 / 255], red: [1, 0, 0], rosybrown: [188 / 255, 143 / 255, 143 / 255], royalblue: [65 / 255, 105 / 255, 225 / 255], saddlebrown: [139 / 255, 69 / 255, 19 / 255], salmon: [250 / 255, 128 / 255, 114 / 255], sandybrown: [244 / 255, 164 / 255, 96 / 255], seagreen: [46 / 255, 139 / 255, 87 / 255], seashell: [1, 245 / 255, 238 / 255], sienna: [160 / 255, 82 / 255, 45 / 255], silver: [192 / 255, 192 / 255, 192 / 255], skyblue: [135 / 255, 206 / 255, 235 / 255], slateblue: [106 / 255, 90 / 255, 205 / 255], slategray: [112 / 255, 128 / 255, 144 / 255], slategrey: [112 / 255, 128 / 255, 144 / 255], snow: [1, 250 / 255, 250 / 255], springgreen: [0, 1, 127 / 255], steelblue: [70 / 255, 130 / 255, 180 / 255], tan: [210 / 255, 180 / 255, 140 / 255], teal: [0, 128 / 255, 128 / 255], thistle: [216 / 255, 191 / 255, 216 / 255], tomato: [1, 99 / 255, 71 / 255], turquoise: [64 / 255, 224 / 255, 208 / 255], violet: [238 / 255, 130 / 255, 238 / 255], wheat: [245 / 255, 222 / 255, 179 / 255], white: [1, 1, 1], whitesmoke: [245 / 255, 245 / 255, 245 / 255], yellow: [1, 1, 0], yellowgreen: [154 / 255, 205 / 255, 50 / 255] }; // packages/theme/node_modules/colorjs.io/src/spaces/srgb.js var coordGrammar = Array(3).fill("<percentage> | <number>[0, 255]"); var coordGrammarNumber = Array(3).fill("<number>[0, 255]"); var srgb_default = new RGBColorSpace({ id: "srgb", name: "sRGB", base: srgb_linear_default, fromBase: (rgb) => { return rgb.map((val) => { let sign = val < 0 ? -1 : 1; let abs = val * sign; if (abs > 31308e-7) { return sign * (1.055 * abs ** (1 / 2.4) - 0.055); } return 12.92 * val; }); }, toBase: (rgb) => { return rgb.map((val) => { let sign = val < 0 ? -1 : 1; let abs = val * sign; if (abs <= 0.04045) { return val / 12.92; } return sign * ((abs + 0.055) / 1.055) ** 2.4; }); }, formats: { rgb: { coords: coordGrammar }, rgb_number: { name: "rgb", commas: true, coords: coordGrammarNumber, alpha: false }, color: { /* use defaults */ }, rgba: { coords: coordGrammar, commas: true, alpha: true }, rgba_number: { name: "rgba", commas: true, coords: coordGrammarNumber }, hex: { type: "custom", toGamut: true, test: (str) => /^#(([a-f0-9]{2}){3,4}|[a-f0-9]{3,4})$/i.test(str), parse(str) { if (str.length <= 5) { str = str.replace(/[a-f0-9]/gi, "$&$&"); } let rgba = []; str.replace(/[a-f0-9]{2}/gi, (component) => { rgba.push(parseInt(component, 16) / 255); }); return { spaceId: "srgb", coords: ( /** @type {Coords} */ rgba.slice(0, 3) ), alpha: ( /** @type {number} */ rgba.slice(3)[0] ) }; }, serialize: (coords, alpha, { collapse = true, // collapse to 3-4 digit hex when possible? alpha: alphaFormat } = {}) => { if (alphaFormat !== false && alpha < 1 || alphaFormat === true) { coords.push(alpha); } coords = /** @type {[number, number, number]} */ coords.map((c) => Math.round(c * 255)); let collapsible = collapse && coords.every((c) => c % 17 === 0); let hex = coords.map((c) => { if (collapsible) { return (c / 17).toString(16); } return c.toString(16).padStart(2, "0"); }).join(""); return "#" + hex; } }, keyword: { type: "custom", test: (str) => /^[a-z]+$/i.test(str), parse(str) { str = str.toLowerCase(); let ret = { spaceId: "srgb", coords: null, alpha: 1 }; if (str === "transparent") { ret.coords = keywords_default.black; ret.alpha = 0; } else { ret.coords = keywords_default[str]; } if (ret.coords) { return ret; } } } } }); // packages/theme/node_modules/colorjs.io/src/spaces/p3.js var p3_default = new RGBColorSpace({ id: "p3", cssId: "display-p3", name: "P3", base: p3_linear_default, // Gamma encoding/decoding is the same as sRGB fromBase: srgb_default.fromBase, toBase: srgb_default.toBase }); // packages/theme/node_modules/colorjs.io/src/luminance.js function getLuminance(color) { return get(color, [xyz_d65_default, "y"]); } // packages/theme/node_modules/colorjs.io/src/contrast/WCAG21.js function contrastWCAG21(color1, color2) { color1 = getColor(color1); color2 = getColor(color2); let Y1 = Math.max(getLuminance(color1), 0); let Y2 = Math.max(getLuminance(color2), 0); if (Y2 > Y1) { [Y1, Y2] = [Y2, Y1]; } return (Y1 + 0.05) / (Y2 + 0.05); } // packages/theme/node_modules/colorjs.io/src/spaces/hsl.js var hsl_default = new ColorSpace({ id: "hsl", name: "HSL", coords: { h: { refRange: [0, 360], type: "angle", name: "Hue" }, s: { range: [0, 100], name: "Saturation" }, l: { range: [0, 100], name: "Lightness" } }, base: srgb_default, // Adapted from https://drafts.csswg.org/css-color-4/better-rgbToHsl.js fromBase: (rgb) => { let max = Math.max(...rgb); let min = Math.min(...rgb); let [r, g2, b2] = rgb; let [h, s, l] = [null, 0, (min + max) / 2]; let d2 = max - min; if (d2 !== 0) { s = l === 0 || l === 1 ? 0 : (max - l) / Math.min(l, 1 - l); switch (max) { case r: h = (g2 - b2) / d2 + (g2 < b2 ? 6 : 0); break; case g2: h = (b2 - r) / d2 + 2; break; case b2: h = (r - g2) / d2 + 4; } h = h * 60; } if (s < 0) { h += 180; s = Math.abs(s); } if (h >= 360) { h -= 360; } return [h, s * 100, l * 100]; }, // Adapted from https://en.wikipedia.org/wiki/HSL_and_HSV#HSL_to_RGB_alternative toBase: (hsl) => { let [h, s, l] = hsl; h = h % 360; if (h < 0) { h += 360; } s /= 100; l /= 100; function f(n2) { let k = (n2 + h / 30) % 12; let a = s * Math.min(l, 1 - l); return l - a * Math.max(-1, Math.min(k - 3, 9 - k, 1)); } return [f(0), f(8), f(4)]; }, formats: { hsl: { coords: ["<number> | <angle>", "<percentage> | <number>", "<percentage> | <number>"] }, hsla: { coords: ["<number> | <angle>", "<percentage> | <number>", "<percentage> | <number>"], commas: true, alpha: true } } }); // packages/theme/node_modules/colorjs.io/src/spaces/oklch.js var oklch_default = new ColorSpace({ id: "oklch", name: "OkLCh", coords: { l: { refRange: [0, 1], name: "Lightness" }, c: { refRange: [0, 0.4], name: "Chroma" }, h: { refRange: [0, 360], type: "angle", name: "Hue" } }, white: "D65", base: oklab_default, fromBase: lch_default.fromBase, toBase: lch_default.toBase, formats: { oklch: { coords: ["<percentage> | <number>", "<number> | <percentage>", "<number> | <angle>"] } } }); // node_modules/memize/dist/index.js function memize(fn, options) { var size = 0; var head; var tail; options = options || {}; function memoized() { var node = head, len = arguments.length, args, i; searchCache: while (node) { if (node.args.length !== arguments.length) { node = node.next; continue; } for (i = 0; i < len; i++) { if (node.args[i] !== arguments[i]) { node = node.next; continue searchCache; } } if (node !== head) { if (node === tail) { tail = node.prev; } node.prev.next = node.next; if (node.next) { node.next.prev = node.prev; } node.next = head; node.prev = null; head.prev = node; head = node; } return node.val; } args = new Array(len); for (i = 0; i < len; i++) { args[i] = arguments[i]; } node = { args, // Generate the result from original function val: fn.apply(null, args) }; if (head) { head.prev = node; node.next = head; } else { tail = node; } if (size === /** @type {MemizeOptions} */ options.maxSize) { tail = /** @type {MemizeCacheNode} */ tail.prev; tail.next = null; } else { size++; } head = node; return node.val; } memoized.clear = function() { head = null; tail = null; size = 0; }; return memoized; } // packages/theme/build-module/use-theme-provider-styles.mjs var import_element2 = __toESM(require_element(), 1); // packages/theme/build-module/color-ramps/lib/register-color-spaces.mjs ColorSpace.register(srgb_default); ColorSpace.register(oklch_default); ColorSpace.register(p3_default); ColorSpace.register(hsl_default); // packages/theme/build-module/prebuilt/ts/color-tokens.mjs var color_tokens_default = { "primary-bgFill1": ["bg-interactive-brand-strong"], "primary-fgFill": [ "fg-interactive-brand-strong", "fg-interactive-brand-strong-active" ], "primary-bgFill2": ["bg-interactive-brand-strong-active"], "primary-surface4": ["bg-interactive-brand-weak-active"], "primary-fgSurface3": [ "fg-interactive-brand", "fg-interactive-brand-active" ], "primary-stroke3": [ "bg-thumb-brand", "bg-thumb-brand-active", "stroke-focus-brand", "stroke-interactive-brand", "stroke-surface-brand-strong" ], "primary-stroke4": ["stroke-interactive-brand-active"], "primary-stroke1": ["stroke-surface-brand"], "primary-surface1": ["bg-surface-brand"], "info-surface2": ["bg-surface-info-weak"], "info-surface4": ["bg-surface-info"], "info-fgSurface4": ["fg-content-info"], "info-fgSurface3": ["fg-content-info-weak"], "info-stroke3": ["stroke-surface-info-strong"], "info-stroke1": ["stroke-surface-info"], "success-surface2": ["bg-surface-success-weak"], "success-surface4": ["bg-surface-success"], "success-fgSurface4": ["fg-content-success"], "success-fgSurface3": ["fg-content-success-weak"], "success-stroke3": ["stroke-surface-success-strong"], "success-stroke1": ["stroke-surface-success"], "warning-surface2": ["bg-surface-warning-weak"], "warning-surface4": ["bg-surface-warning"], "warning-fgSurface4": ["fg-content-warning"], "warning-fgSurface3": ["fg-content-warning-weak"], "warning-stroke3": ["stroke-surface-warning-strong"], "warning-stroke1": ["stroke-surface-warning"], "error-bgFill1": ["bg-interactive-error-strong"], "error-fgFill": [ "fg-interactive-error-strong", "fg-interactive-error-strong-active" ], "error-bgFill2": ["bg-interactive-error-strong-active"], "error-surface2": [ "bg-interactive-error-active", "bg-surface-error-weak" ], "error-surface4": [ "bg-interactive-error-weak-active", "bg-surface-error" ], "error-fgSurface4": ["fg-content-error"], "error-fgSurface3": [ "fg-content-error-weak", "fg-interactive-error", "fg-interactive-error-active" ], "error-stroke3": [ "stroke-interactive-error", "stroke-interactive-error-strong", "stroke-surface-error-strong" ], "error-stroke4": ["stroke-interactive-error-active"], "error-stroke1": ["stroke-surface-error"], "bg-surface2": ["bg-surface-neutral"], "bg-surface5": ["bg-interactive-neutral-strong-disabled"], "bg-surface4": ["bg-interactive-neutral-weak-active"], "bg-surface3": ["bg-surface-neutral-strong"], "bg-fgSurface4": [ "fg-content-neutral", "fg-interactive-neutral", "fg-interactive-neutral-active" ], "bg-fgSurface3": [ "fg-content-neutral-weak", "fg-interactive-neutral-weak" ], "bg-fgSurface2": [ "fg-interactive-neutral-disabled", "fg-interactive-neutral-strong-disabled", "fg-interactive-neutral-weak-disabled" ], "bg-stroke3": [ "bg-thumb-neutral-weak", "stroke-interactive-neutral", "stroke-surface-neutral-strong" ], "bg-stroke4": [ "bg-thumb-neutral-weak-active", "stroke-interactive-neutral-active", "stroke-interactive-neutral-strong" ], "bg-stroke2": [ "bg-thumb-neutral-disabled", "bg-track-neutral", "stroke-interactive-neutral-disabled", "stroke-surface-neutral" ], "bg-stroke1": ["bg-track-neutral-weak", "stroke-surface-neutral-weak"], "bg-bgFillInverted2": ["bg-interactive-neutral-strong-active"], "bg-bgFillInverted1": ["bg-interactive-neutral-strong"], "bg-fgFillInverted": [ "fg-interactive-neutral-strong", "fg-interactive-neutral-strong-active" ], "bg-surface1": ["bg-surface-neutral-weak"], "caution-surface2": ["bg-surface-caution-weak"], "caution-surface4": ["bg-surface-caution"], "caution-fgSurface4": ["fg-content-caution"], "caution-fgSurface3": ["fg-content-caution-weak"] }; // packages/theme/build-module/color-ramps/lib/color-utils.mjs function getColorString(color) { const rgbRounded = serialize(to(color, srgb_default)); return serialize(rgbRounded, { format: "hex" }); } function getContrast(colorA, colorB) { return contrastWCAG21(colorA, colorB); } function clampToGamut(c) { return to(toGamut(c, { space: srgb_default, method: "css" }), oklch_default); } // packages/theme/build-module/color-ramps/lib/constants.mjs var WHITE = to("white", oklch_default); var BLACK = to("black", oklch_default); var UNIVERSAL_CONTRAST_TOPUP = 0.02; var WHITE_TEXT_CONTRAST_MARGIN = 3.1; var ACCENT_SCALE_BASE_LIGHTNESS_THRESHOLDS = { lighter: { min: 0.2, max: 0.4 }, darker: { min: 0.75, max: 0.98 } }; var CONTRAST_EPSILON = 4e-3; var MAX_BISECTION_ITERATIONS = 10; var DEFAULT_SEED_COLORS = { bg: "#f8f8f8", primary: "#3858e9", info: "#0090ff", success: "#4ab866", caution: "#f0d149", warning: "#f0b849", error: "#cc1818" }; // packages/theme/build-module/color-ramps/lib/utils.mjs function buildDependencyGraph(config) { const dependencies = /* @__PURE__ */ new Map(); const dependents = /* @__PURE__ */ new Map(); Object.keys(config).forEach((step) => { dependencies.set(step, []); }); dependents.set("seed", []); Object.keys(config).forEach((step) => { dependents.set(step, []); }); Object.entries(config).forEach(([stepName, stepConfig]) => { const step = stepName; const reference = stepConfig.contrast.reference; dependencies.get(step).push(reference); dependents.get(reference).push(step); if (stepConfig.sameAsIfPossible) { dependencies.get(step).push(stepConfig.sameAsIfPossible); dependents.get(stepConfig.sameAsIfPossible).push(step); } }); return { dependencies, dependents }; } function sortByDependency(config) { const { dependents } = buildDependencyGraph(config); const result = []; const visited = /* @__PURE__ */ new Set(); const visiting = /* @__PURE__ */ new Set(); function visit(node) { if (visiting.has(node)) { throw new Error( `Circular dependency detected involving step: ${String( node )}` ); } if (visited.has(node)) { return; } visiting.add(node); const nodeDependents = dependents.get(node) || []; nodeDependents.forEach((dependent) => { visit(dependent); }); visiting.delete(node); visited.add(node); if (node !== "seed") { result.unshift(node); } } visit("seed"); return result; } function stepsForStep(stepName, config) { const result = /* @__PURE__ */ new Set(); function visit(step) { if (step === "seed" || result.has(step)) { return; } const stepConfig = config[step]; if (!stepConfig) { return; } visit(stepConfig.contrast.reference); if (stepConfig.sameAsIfPossible) { visit(stepConfig.sameAsIfPossible); } result.add(step); } visit(stepName); return Array.from(result); } function computeBetterFgColorDirection(seed, preferLighter) { const contrastAgainstBlack = getContrast(seed, BLACK); const contrastAgainstWhite = getContrast(seed, WHITE); return contrastAgainstBlack > contrastAgainstWhite + (preferLighter ? WHITE_TEXT_CONTRAST_MARGIN : 0) ? { better: "darker", worse: "lighter" } : { better: "lighter", worse: "darker" }; } function adjustContrastTarget(target) { if (target === 1) { return 1; } return target + UNIVERSAL_CONTRAST_TOPUP; } function clampAccentScaleReferenceLightness(rawLightness, direction) { const thresholds = ACCENT_SCALE_BASE_LIGHTNESS_THRESHOLDS[direction]; return Math.max(thresholds.min, Math.min(thresholds.max, rawLightness)); } function solveWithBisect(calculateC, calculateValue, initLowerL, initLowerValue, initUpperL, initUpperValue) { let lowerL = initLowerL; let lowerValue = initLowerValue; let lowerReplaced = false; let upperL = initUpperL; let upperValue = initUpperValue; let upperReplaced = false; let bestC; let bestValue; let iterations = 0; while (true) { iterations++; const newL = (lowerL * upperValue - upperL * lowerValue) / (upperValue - lowerValue); bestC = calculateC(newL); bestValue = calculateValue(bestC); if (Math.abs(bestValue) <= CONTRAST_EPSILON || iterations >= MAX_BISECTION_ITERATIONS) { break; } if (bestValue <= 0) { lowerL = newL; lowerValue = bestValue; if (lowerReplaced) { upperValue /= 2; } lowerReplaced = true; upperReplaced = false; } else { upperL = newL; upperValue = bestValue; if (upperReplaced) { lowerValue /= 2; } upperReplaced = true; lowerReplaced = false; } } return bestC; } // packages/theme/build-module/color-ramps/lib/taper-chroma.mjs function taperChroma(seed, lTarget, options = {}) { const gamut = options.gamut ?? srgb_default; const alpha = options.alpha ?? 0.65; const carry = options.carry ?? 0.5; const cUpperBound = options.cUpperBound ?? 0.45; const radiusLight = options.radiusLight ?? 0.2; const radiusDark = options.radiusDark ?? 0.2; const kLight = options.kLight ?? 0.85; const kDark = options.kDark ?? 0.85; const achromaEpsilon = options.achromaEpsilon ?? 5e-3; const cSeed = Math.max(0, get(seed, [oklch_default, "c"])); let hSeed = get(seed, [oklch_default, "h"]); const chromaIsTiny = cSeed < achromaEpsilon; const hueIsInvalid = hSeed === null || !Number.isFinite(hSeed); if (chromaIsTiny || hueIsInvalid) { if (typeof options.hueFallback === "number") { hSeed = normalizeHue(options.hueFallback); } else { return { space: oklch_default, coords: [clamp01(lTarget), 0, 0], alpha: 1 }; } } const lSeed = clamp01(get(seed, [oklch_default, "l"])); const cmaxSeed = getCachedMaxChromaAtLH(lSeed, hSeed, gamut, cUpperBound); const cmaxTarget = getCachedMaxChromaAtLH( clamp01(lTarget), hSeed, gamut, cUpperBound ); let seedRelative = 0; const denom = cmaxSeed > 0 ? cmaxSeed : 1e-6; seedRelative = clamp01(cSeed / denom); const cIntendedBase = alpha * cmaxTarget; const cWithCarry = cIntendedBase * Math.pow(seedRelative, clamp01(carry)); const t = continuousTaper(lSeed, lTarget, { radiusLight, radiusDark, kLight, kDark }); const cPlanned = cWithCarry * t; const lOut = clamp01(lTarget); return { l: lOut, c: cPlanned }; } function clamp01(x) { if (x < 0) { return 0; } if (x > 1) { return 1; } return x; } function normalizeHue(h) { let hue = h % 360; if (hue < 0) { hue += 360; } return hue; } function raisedCosine(u) { const x = clamp01(u); return 0.5 - 0.5 * Math.cos(Math.PI * x); } function continuousTaper(seedL, targetL, opts) { const d2 = targetL - seedL; if (d2 >= 0) { const u2 = opts.radiusLight > 0 ? Math.abs(d2) / opts.radiusLight : 1; const w2 = raisedCosine(u2 > 1 ? 1 : u2); return 1 - (1 - opts.kLight) * w2; } const u = opts.radiusDark > 0 ? Math.abs(d2) / opts.radiusDark : 1; const w = raisedCosine(u > 1 ? 1 : u); return 1 - (1 - opts.kDark) * w; } var maxChromaCache = /* @__PURE__ */ new Map(); function keyMax(l, h, gamut, cap) { const lq = quantize(l, 0.05); const hq = quantize(normalizeHue(h), 10); const cq = quantize(cap, 0.05); return `${gamut}|L:${lq}|H:${hq}|cap:${cq}`; } function quantize(x, step) { const k = Math.round(x / step); return k * step; } function getCachedMaxChromaAtLH(l, h, gamutSpace, cap) { const gamut = gamutSpace.id; const key = keyMax(l, h, gamut, cap); const hit = maxChromaCache.get(key); if (typeof hit === "number") { return hit; } const computed = maxInGamutChromaAtLH(l, h, gamutSpace, cap); maxChromaCache.set(key, computed); return computed; } function maxInGamutChromaAtLH(l, h, gamutSpace, cap) { const probe = { space: oklch_default, coords: [l, cap, h], alpha: 1 }; const clamped = toGamut(probe, { space: gamutSpace, method: "css" }); return get(clamped, [oklch_default, "c"]); } // packages/theme/build-module/color-ramps/lib/find-color-with-constraints.mjs function cdiff(c13, c23) { return Math.log(c13 / c23); } function findColorMeetingRequirements(reference, seed, target, direction, { lightnessConstraint, taperChromaOptions } = {}) { if (target <= 1) { return { color: reference, reached: true, achieved: 1 }; } function getColorForL(l) { let newL = l; let newC = get(seed, [oklch_default, "c"]); if (taperChromaOptions) { const tapered = taperChroma(seed, newL, taperChromaOptions); if ("l" in tapered && "c" in tapered) { newL = tapered.l; newC = tapered.c; } else { return tapered; } } return clampToGamut({ spaceId: "oklch", coords: [newL, newC, get(seed, [oklch_default, "h"])] }); } const mostContrastingL = direction === "lighter" ? 1 : 0; const mostContrastingColor = direction === "lighter" ? WHITE : BLACK; const highestContrast = getContrast(reference, mostContrastingColor); if (lightnessConstraint) { const colorWithExactL = getColorForL(lightnessConstraint.value); const exactLContrast = getContrast(reference, colorWithExactL); const exactLContrastMeetsTarget = cdiff(exactLContrast, target) >= -CONTRAST_EPSILON; if (exactLContrastMeetsTarget || lightnessConstraint.type === "force") { return { color: colorWithExactL, reached: exactLContrastMeetsTarget, achieved: exactLContrast, deficit: exactLContrastMeetsTarget ? cdiff(exactLContrast, highestContrast) : cdiff(target, exactLContrast) }; } } if (cdiff(highestContrast, target) <= CONTRAST_EPSILON) { return { color: mostContrastingColor, reached: cdiff(highestContrast, target) >= -CONTRAST_EPSILON, achieved: highestContrast, deficit: cdiff(target, highestContrast) }; } const lowerL = get(reference, [oklch_default, "l"]); const lowerContrast = cdiff(1, target); const upperL = mostContrastingL; const upperContrast = cdiff(highestContrast, target); const bestColor = solveWithBisect( getColorForL, (c) => cdiff(getContrast(reference, c), target), lowerL, lowerContrast, upperL, upperContrast ); return { color: bestColor, reached: true, achieved: target, // Negative number that specifies how much room we have. deficit: cdiff(target, highestContrast) }; } // packages/theme/build-module/color-ramps/lib/index.mjs function calculateRamp({ seed, sortedSteps, config, mainDir, oppDir, pinLightness }) { const rampResults = {}; let warnings; let maxDeficit = -Infinity; let maxDeficitDirection = "lighter"; let maxDeficitStep; const calculatedColors = /* @__PURE__ */ new Map(); calculatedColors.set("seed", seed); for (const stepName of sortedSteps) { let computeDirection = function(color, followDirection) { if (followDirection === "main") { return mainDir; } if (followDirection === "opposite") { return oppDir; } if (followDirection === "best") { return computeBetterFgColorDirection( color, contrast.preferLighter ).better; } return followDirection; }; const { contrast, lightness: stepLightnessConstraint, taperChromaOptions, sameAsIfPossible } = config[stepName]; const referenceColor = calculatedColors.get(contrast.reference); if (!referenceColor) { throw new Error( `Reference color for step ${stepName} not found: ${contrast.reference}` ); } if (sameAsIfPossible) { const candidateColor = calculatedColors.get(sameAsIfPossible); if (!candidateColor) { throw new Error( `Same-as color for step ${stepName} not found: ${sameAsIfPossible}` ); } const candidateContrast = getContrast( referenceColor, candidateColor ); const adjustedTarget2 = adjustContrastTarget(contrast.target); if (candidateContrast >= adjustedTarget2) { calculatedColors.set(stepName, candidateColor); rampResults[stepName] = getColorString(candidateColor); continue; } } const computedDir = computeDirection( referenceColor, contrast.followDirection ); const adjustedTarget = adjustContrastTarget(contrast.target); let lightnessConstraint; if (pinLightness?.stepName === stepName) { lightnessConstraint = { value: pinLightness.value, type: "force" }; } else if (stepLightnessConstraint) { lightnessConstraint = { value: stepLightnessConstraint(computedDir), type: "onlyIfSucceeds" }; } const searchResults = findColorMeetingRequirements( referenceColor, seed, adjustedTarget, computedDir, { lightnessConstraint, taperChromaOptions } ); if (!contrast.ignoreWhenAdjustingSeed && searchResults.deficit && searchResults.deficit > maxDeficit) { maxDeficit = searchResults.deficit; maxDeficitDirection = computedDir; maxDeficitStep = stepName; } calculatedColors.set(stepName, searchResults.color); rampResults[stepName] = getColorString(searchResults.color); if (!searchResults.reached && !contrast.ignoreWhenAdjustingSeed) { warnings ??= []; warnings.push(stepName); } } return { rampResults, warnings, maxDeficit, maxDeficitDirection, maxDeficitStep }; } function buildRamp(seedArg, config, { mainDirection, pinLightness, rescaleToFitContrastTargets = true } = {}) { let seed; try { seed = clampToGamut(seedArg); } catch (error) { throw new Error( `Invalid seed color "${seedArg}": ${error instanceof Error ? error.message : "Unknown error"}` ); } let mainDir = "lighter"; let oppDir = "darker"; if (mainDirection) { mainDir = mainDirection; oppDir = mainDirection === "darker" ? "lighter" : "darker"; } else { const { better, worse } = computeBetterFgColorDirection(seed); mainDir = better; oppDir = worse; } const sortedSteps = sortByDependency(config); const { rampResults, warnings, maxDeficit, maxDeficitDirection, maxDeficitStep } = calculateRamp({ seed, sortedSteps, config, mainDir, oppDir, pinLightness }); let bestRamp = rampResults; if (maxDeficit > CONTRAST_EPSILON && rescaleToFitContrastTargets) { let getSeedForL = function(l) { return clampToGamut(set(clone(seed), [oklch_default, "l"], l)); }, getDeficitForSeed = function(s) { const iterationResults = calculateRamp({ seed: s, sortedSteps: iterSteps, config, mainDir, oppDir, pinLightness }); return iterationResults.maxDeficitDirection === maxDeficitDirection ? iterationResults.maxDeficit : -maxDeficit; }; const iterSteps = stepsForStep(maxDeficitStep, config); const lowerSeedL = maxDeficitDirection === "lighter" ? 0 : 1; const lowerDeficit = -maxDeficit; const upperSeedL = get(seed, [oklch_default, "l"]); const upperDeficit = maxDeficit; const bestSeed = solveWithBisect( getSeedForL, getDeficitForSeed, lowerSeedL, lowerDeficit, upperSeedL, upperDeficit ); bestRamp = calculateRamp({ seed: bestSeed, sortedSteps, config, mainDir, oppDir, pinLightness }).rampResults; } if (mainDir === "darker") { const tmpSurface1 = bestRamp.surface1; bestRamp.surface1 = bestRamp.surface3; bestRamp.surface3 = tmpSurface1; } return { ramp: bestRamp, warnings, direction: mainDir }; } // packages/theme/build-module/color-ramps/lib/ramp-configs.mjs var lightnessConstraintForegroundHighContrast = (direction) => direction === "lighter" ? 0.9551 : 0.235; var lightnessConstraintForegroundMediumContrast = (direction) => direction === "lighter" ? 0.77 : 0.56; var lightnessConstraintBgFill = (direction) => direction === "lighter" ? 0.67 : 0.45; var BG_SURFACE_TAPER_CHROMA = { alpha: 0.7 }; var FG_TAPER_CHROMA = { alpha: 0.6, kLight: 0.2, kDark: 0.2 }; var STROKE_TAPER_CHROMA = { alpha: 0.6, radiusDark: 0.01, radiusLight: 0.01, kLight: 0.8, kDark: 0.8 }; var ACCENT_SURFACE_TAPER_CHROMA = { alpha: 0.75, radiusDark: 0.01, radiusLight: 0.01 }; var fgSurface4Config = { contrast: { reference: "surface3", followDirection: "main", target: 7, preferLighter: true }, lightness: lightnessConstraintForegroundHighContrast, taperChromaOptions: FG_TAPER_CHROMA }; var BG_RAMP_CONFIG = { // Surface surface1: { contrast: { reference: "surface2", followDirection: "opposite", target: 1.06, ignoreWhenAdjustingSeed: true }, taperChromaOptions: BG_SURFACE_TAPER_CHROMA }, surface2: { contrast: { reference: "seed", followDirection: "main", target: 1 } }, surface3: { contrast: { reference: "surface2", followDirection: "main", target: 1.06 }, taperChromaOptions: BG_SURFACE_TAPER_CHROMA }, surface4: { contrast: { reference: "surface2", followDirection: "main", target: 1.12 }, taperChromaOptions: BG_SURFACE_TAPER_CHROMA }, surface5: { contrast: { reference: "surface2", followDirection: "main", target: 1.2 }, taperChromaOptions: BG_SURFACE_TAPER_CHROMA }, surface6: { contrast: { reference: "surface2", followDirection: "main", target: 1.4 }, taperChromaOptions: BG_SURFACE_TAPER_CHROMA }, // Bg fill bgFill1: { contrast: { reference: "surface2", followDirection: "main", target: 4 }, lightness: lightnessConstraintBgFill }, bgFill2: { contrast: { reference: "bgFill1", followDirection: "main", target: 1.2 } }, bgFillInverted1: { contrast: { reference: "bgFillInverted2", followDirection: "opposite", target: 1.2 } }, bgFillInverted2: fgSurface4Config, bgFillDark: { contrast: { reference: "surface3", followDirection: "darker", // This is what causes the token to be always dark target: 7, ignoreWhenAdjustingSeed: true }, lightness: lightnessConstraintForegroundHighContrast, taperChromaOptions: FG_TAPER_CHROMA }, // Stroke stroke1: { contrast: { reference: "stroke3", followDirection: "opposite", target: 2.6 }, taperChromaOptions: STROKE_TAPER_CHROMA }, stroke2: { contrast: { reference: "stroke3", followDirection: "opposite", target: 2.4 }, taperChromaOptions: STROKE_TAPER_CHROMA }, stroke3: { contrast: { reference: "surface3", followDirection: "main", target: 3 }, taperChromaOptions: STROKE_TAPER_CHROMA }, stroke4: { contrast: { reference: "stroke3", followDirection: "main", target: 1.5 }, taperChromaOptions: STROKE_TAPER_CHROMA }, // fgSurface fgSurface1: { contrast: { reference: "surface3", followDirection: "main", target: 2, preferLighter: true }, taperChromaOptions: FG_TAPER_CHROMA }, fgSurface2: { contrast: { reference: "surface3", followDirection: "main", target: 3, preferLighter: true }, taperChromaOptions: FG_TAPER_CHROMA }, fgSurface3: { contrast: { reference: "surface3", followDirection: "main", target: 4.5, preferLighter: true }, lightness: lightnessConstraintForegroundMediumContrast, taperChromaOptions: FG_TAPER_CHROMA }, fgSurface4: fgSurface4Config, // fgFill fgFill: { contrast: { reference: "bgFill1", followDirection: "best", target: 4.5, preferLighter: true }, lightness: lightnessConstraintForegroundHighContrast, taperChromaOptions: FG_TAPER_CHROMA }, fgFillInverted: { contrast: { reference: "bgFillInverted1", followDirection: "best", target: 4.5, preferLighter: true }, lightness: lightnessConstraintForegroundHighContrast, taperChromaOptions: FG_TAPER_CHROMA }, fgFillDark: { contrast: { reference: "bgFillDark", followDirection: "best", target: 4.5, preferLighter: true }, lightness: lightnessConstraintForegroundHighContrast, taperChromaOptions: FG_TAPER_CHROMA } }; var ACCENT_RAMP_CONFIG = { ...BG_RAMP_CONFIG, surface1: { ...BG_RAMP_CONFIG.surface1, taperChromaOptions: ACCENT_SURFACE_TAPER_CHROMA }, surface2: { contrast: { reference: "bgFill1", followDirection: "opposite", target: BG_RAMP_CONFIG.bgFill1.contrast.target, ignoreWhenAdjustingSeed: true }, taperChromaOptions: ACCENT_SURFACE_TAPER_CHROMA }, surface3: { ...BG_RAMP_CONFIG.surface3, taperChromaOptions: ACCENT_SURFACE_TAPER_CHROMA }, surface4: { ...BG_RAMP_CONFIG.surface4, taperChromaOptions: ACCENT_SURFACE_TAPER_CHROMA }, surface5: { ...BG_RAMP_CONFIG.surface5, taperChromaOptions: ACCENT_SURFACE_TAPER_CHROMA }, surface6: { ...BG_RAMP_CONFIG.surface6, taperChromaOptions: ACCENT_SURFACE_TAPER_CHROMA }, bgFill1: { contrast: { reference: "seed", followDirection: "main", target: 1 } }, stroke1: { ...BG_RAMP_CONFIG.stroke1 }, stroke2: { ...BG_RAMP_CONFIG.stroke2 }, stroke3: { ...BG_RAMP_CONFIG.stroke3, sameAsIfPossible: "fgSurface3", taperChromaOptions: void 0 }, stroke4: { ...BG_RAMP_CONFIG.stroke4, taperChromaOptions: void 0 }, // fgSurface: do not de-saturate fgSurface1: { ...BG_RAMP_CONFIG.fgSurface1, taperChromaOptions: void 0 }, fgSurface2: { ...BG_RAMP_CONFIG.fgSurface2, taperChromaOptions: void 0 }, fgSurface3: { ...BG_RAMP_CONFIG.fgSurface3, taperChromaOptions: void 0, sameAsIfPossible: "bgFill1" }, fgSurface4: { ...BG_RAMP_CONFIG.fgSurface4, taperChromaOptions: void 0 } }; // packages/theme/build-module/color-ramps/index.mjs function buildBgRamp(seed) { if (typeof seed !== "string" || seed.trim() === "") { throw new Error("Seed color must be a non-empty string"); } return buildRamp(seed, BG_RAMP_CONFIG); } var STEP_TO_PIN = "surface2"; function getBgRampInfo(ramp) { return { mainDirection: ramp.direction, pinLightness: { stepName: STEP_TO_PIN, value: clampAccentScaleReferenceLightness( get(ramp.ramp[STEP_TO_PIN], [oklch_default, "l"]), ramp.direction ) } }; } function buildAccentRamp(seed, bgRamp) { if (typeof seed !== "string" || seed.trim() === "") { throw new Error("Seed color must be a non-empty string"); } const bgRampInfo = bgRamp ? getBgRampInfo(bgRamp) : void 0; return buildRamp(seed, ACCENT_RAMP_CONFIG, bgRampInfo); } // packages/theme/build-module/use-theme-provider-styles.mjs var getCachedBgRamp = memize(buildBgRamp, { maxSize: 10 }); var getCachedAccentRamp = memize(buildAccentRamp, { maxSize: 10 }); var legacyWpComponentsOverridesCSS = [ ["--wp-components-color-accent", "var(--wp-admin-theme-color)"], [ "--wp-components-color-accent-darker-10", "var(--wp-admin-theme-color-darker-10)" ], [ "--wp-components-color-accent-darker-20", "var(--wp-admin-theme-color-darker-20)" ], [ "--wp-components-color-accent-inverted", "var(--wpds-color-fg-interactive-brand-strong, #fff)" ], [ "--wp-components-color-background", "var(--wpds-color-bg-surface-neutral-strong, #ffffff)" ], [ "--wp-components-color-foreground", "var(--wpds-color-fg-content-neutral, #1e1e1e)" ], [ "--wp-components-color-foreground-inverted", "var(--wpds-color-bg-surface-neutral, #f8f8f8)" ], [ "--wp-components-color-gray-100", "var(--wpds-color-bg-surface-neutral, #f8f8f8)" ], [ "--wp-components-color-gray-200", "var(--wpds-color-stroke-surface-neutral, #d8d8d8)" ], [ "--wp-components-color-gray-300", "var(--wpds-color-stroke-surface-neutral, #d8d8d8)" ], [ "--wp-components-color-gray-400", "var(--wpds-color-stroke-interactive-neutral, #8a8a8a)" ], [ "--wp-components-color-gray-600", "var(--wpds-color-stroke-interactive-neutral, #8a8a8a)" ], [ "--wp-components-color-gray-700", "var(--wpds-color-fg-content-neutral-weak, #6d6d6d)" ], [ "--wp-components-color-gray-800", "var(--wpds-color-fg-content-neutral, #1e1e1e)" ] ]; function customRgbFormat(color) { const rgb = to(color, srgb_default); return rgb.coords.map((n2) => Math.round((n2 ?? 0) * 255)).join(", "); } function legacyWpAdminThemeOverridesCSS(accent) { const parsedAccent = to(accent, hsl_default); const parsedL = parsedAccent.coords[2] ?? 0; const darker10 = set( clone(parsedAccent), [hsl_default, "l"], Math.max(0, parsedL - 5) // L reduced by 5% ); const darker20 = set( clone(parsedAccent), [hsl_default, "l"], Math.max(0, parsedL - 10) // L reduced by 10% ); return [ ["--wp-admin-theme-color", getColorString(parsedAccent)], ["--wp-admin-theme-color--rgb", customRgbFormat(parsedAccent)], ["--wp-admin-theme-color-darker-10", getColorString(darker10)], [ "--wp-admin-theme-color-darker-10--rgb", customRgbFormat(darker10) ], ["--wp-admin-theme-color-darker-20", getColorString(darker20)], [ "--wp-admin-theme-color-darker-20--rgb", customRgbFormat(darker20) ] ]; } function colorTokensCSS(computedColorRamps) { const entries = []; for (const [rampName, { ramp }] of computedColorRamps) { for (const [tokenName, tokenValue] of Object.entries(ramp)) { const key = `${rampName}-${tokenName}`; const aliasedBy = color_tokens_default[key] ?? []; for (const aliasedId of aliasedBy) { entries.push([`--wpds-color-${aliasedId}`, tokenValue]); } } } return entries; } function generateStyles({ primary, computedColorRamps }) { return Object.fromEntries( [ // Semantic color tokens colorTokensCSS(computedColorRamps), // Legacy overrides legacyWpAdminThemeOverridesCSS(primary), legacyWpComponentsOverridesCSS ].flat() ); } function useThemeProviderStyles({ color = {} } = {}) { const { resolvedSettings: inheritedSettings } = (0, import_element2.useContext)(ThemeContext); const primary = color.primary ?? inheritedSettings.color?.primary ?? DEFAULT_SEED_COLORS.primary; const bg = color.bg ?? inheritedSettings.color?.bg ?? DEFAULT_SEED_COLORS.bg; const resolvedSettings = (0, import_element2.useMemo)( () => ({ color: { primary, bg } }), [primary, bg] ); const themeProviderStyles = (0, import_element2.useMemo)(() => { const seeds = { ...DEFAULT_SEED_COLORS, bg, primary }; const computedColorRamps = /* @__PURE__ */ new Map(); const bgRamp = getCachedBgRamp(seeds.bg); Object.entries(seeds).forEach(([rampName, seed]) => { if (rampName === "bg") { computedColorRamps.set(rampName, bgRamp); } else { computedColorRamps.set( rampName, getCachedAccentRamp(seed, bgRamp) ); } }); return generateStyles({ primary: seeds.primary, computedColorRamps }); }, [primary, bg]); return { resolvedSettings, themeProviderStyles }; } // packages/theme/build-module/theme-provider.mjs var import_jsx_runtime = __toESM(require_jsx_runtime(), 1); if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='662a5161a8']")) { const style = document.createElement("style"); style.setAttribute("data-wp-hash", "662a5161a8"); style.appendChild(document.createTextNode(".dba930ea7a9438fd__root{display:contents}")); document.head.appendChild(style); } var style_default = { "root": "dba930ea7a9438fd__root" }; function cssObjectToText(values) { return Object.entries(values).map(([key, value]) => `${key}: ${value};`).join(""); } function generateCSSSelector({ instanceId, isRoot }) { const rootSel = `[data-wpds-root-provider="true"]`; const instanceIdSel = `[data-wpds-theme-provider-id="${instanceId}"]`; const selectors = []; if (isRoot) { selectors.push( `:root:has(.${style_default.root}${rootSel}${instanceIdSel})` ); } selectors.push(`.${style_default.root}.${style_default.root}${instanceIdSel}`); return selectors.join(","); } var ThemeProvider = ({ children, color = {}, isRoot = false, density }) => { const instanceId = (0, import_element3.useId)(); const { themeProviderStyles, resolvedSettings } = useThemeProviderStyles({ color }); const contextValue = (0, import_element3.useMemo)( () => ({ resolvedSettings }), [resolvedSettings] ); return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [ themeProviderStyles ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("style", { children: `${generateCSSSelector({ instanceId, isRoot })} {${cssObjectToText(themeProviderStyles)}}` }) : null, /* @__PURE__ */ (0, import_jsx_runtime.jsx)( "div", { "data-wpds-theme-provider-id": instanceId, "data-wpds-root-provider": isRoot, "data-wpds-density": density, className: style_default.root, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ThemeContext.Provider, { value: contextValue, children }) } ) ] }); }; // packages/theme/build-module/private-apis.mjs var privateApis = {}; lock(privateApis, { ThemeProvider, useThemeProviderStyles }); return __toCommonJS(index_exports); })(); dom.min.js 0000644 00000031167 15206720414 0006454 0 ustar 00 "use strict";var wp;(wp||={}).dom=(()=>{var Dt=Object.create;var v=Object.defineProperty;var At=Object.getOwnPropertyDescriptor;var vt=Object.getOwnPropertyNames;var Ot=Object.getPrototypeOf,Lt=Object.prototype.hasOwnProperty;var Ht=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),B=(t,e)=>{for(var r in e)v(t,r,{get:e[r],enumerable:!0})},Z=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of vt(e))!Lt.call(t,n)&&n!==r&&v(t,n,{get:()=>e[n],enumerable:!(o=At(e,n))||o.enumerable});return t};var Ft=(t,e,r)=>(r=t!=null?Dt(Ot(t)):{},Z(e||!t||!t.__esModule?v(r,"default",{value:t,enumerable:!0}):r,t)),Pt=t=>Z(v({},"__esModule",{value:!0}),t);var ut=Ht((Ye,lt)=>{lt.exports=window.wp.deprecated});var Qt={};B(Qt,{__unstableStripHTML:()=>Nt,computeCaretRect:()=>K,documentHasSelection:()=>et,documentHasTextSelection:()=>E,documentHasUncollapsedSelection:()=>tt,focus:()=>Kt,getFilesFromDataTransfer:()=>Jt,getOffsetParent:()=>rt,getPhrasingContentSchema:()=>Et,getRectangleFromRange:()=>h,getScrollContainer:()=>W,insertAfter:()=>y,isEmpty:()=>R,isEntirelySelected:()=>nt,isFormElement:()=>it,isHorizontalEdge:()=>ft,isNumberInput:()=>dt,isPhrasingContent:()=>A,isRTL:()=>T,isSelectionForward:()=>O,isTextContent:()=>Zt,isTextField:()=>C,isVerticalEdge:()=>mt,placeCaretAtHorizontalEdge:()=>pt,placeCaretAtVerticalEdge:()=>gt,remove:()=>g,removeInvalidHTML:()=>Tt,replace:()=>ht,replaceTag:()=>bt,safeHTML:()=>M,unwrap:()=>w,wrap:()=>xt});var z={};B(z,{find:()=>S});function Mt(t){return[t?'[tabindex]:not([tabindex^="-"])':"[tabindex]","a[href]","button:not([disabled])",'input:not([type="hidden"]):not([disabled])',"select:not([disabled])","textarea:not([disabled])",'iframe:not([tabindex^="-"])',"object","embed","summary","area[href]","[contenteditable]:not([contenteditable=false])"].join(",")}function $(t){return t.offsetWidth>0||t.offsetHeight>0||t.getClientRects().length>0}function Vt(t){let e=t.closest("map[name]");if(!e)return!1;let r=t.ownerDocument.querySelector('img[usemap="#'+e.name+'"]');return!!r&&$(r)}function S(t,{sequential:e=!1}={}){let r=t.querySelectorAll(Mt(e));return Array.from(r).filter(o=>{if(!$(o)||o.closest("[inert]"))return!1;let{nodeName:n}=o;return n==="AREA"?Vt(o):!0})}var k={};B(k,{find:()=>jt,findNext:()=>Wt,findPrevious:()=>kt,isTabbableIndex:()=>J});function U(t){let e=t.getAttribute("tabindex");return e===null?0:parseInt(e,10)}function J(t){return U(t)!==-1}function _t(){let t={};return function(r,o){let{nodeName:n,type:i,checked:a,name:s}=o;if(n!=="INPUT"||i!=="radio"||!s)return r.concat(o);let f=t.hasOwnProperty(s);if(!(a||!f))return r;if(f){let d=t[s];r=r.filter(l=>l!==d)}return t[s]=o,r.concat(o)}}function Bt(t,e){return{element:t,index:e}}function zt(t){return t.element}function Ut(t,e){let r=U(t.element),o=U(e.element);return r===o?t.index-e.index:r-o}function j(t){return t.filter(J).map(Bt).sort(Ut).map(zt).reduce(_t(),[])}function jt(t){return j(S(t))}function kt(t){return j(S(t.ownerDocument.body)).reverse().find(e=>t.compareDocumentPosition(e)&t.DOCUMENT_POSITION_PRECEDING)}function Wt(t){return j(S(t.ownerDocument.body)).find(e=>t.compareDocumentPosition(e)&t.DOCUMENT_POSITION_FOLLOWING)}function h(t){if(!t.collapsed){let i=Array.from(t.getClientRects());if(i.length===1)return i[0];let a=i.filter(({width:l})=>l>1);if(a.length===0)return t.getBoundingClientRect();if(a.length===1)return a[0];let{top:s,bottom:f,left:u,right:d}=a[0];for(let{top:l,bottom:c,left:m,right:N}of a)l<s&&(s=l),c>f&&(f=c),m<u&&(u=m),N>d&&(d=N);return new window.DOMRect(u,s,d-u,f-s)}let{startContainer:e}=t,{ownerDocument:r}=e;if(e.nodeName==="BR"){let{parentNode:i}=e;let a=Array.from(i.childNodes).indexOf(e);t=r.createRange(),t.setStart(i,a),t.setEnd(i,a)}let o=t.getClientRects();if(o.length>1)return null;let n=o[0];if(!n||n.height===0){let i=r.createTextNode("\u200B");t=t.cloneRange(),t.insertNode(i),n=t.getClientRects()[0],i.parentNode,i.parentNode.removeChild(i)}return n}function K(t){let e=t.getSelection();let r=e.rangeCount?e.getRangeAt(0):null;return r?h(r):null}function E(t){t.defaultView;let e=t.defaultView.getSelection();let r=e.rangeCount?e.getRangeAt(0):null;return!!r&&!r.collapsed}function b(t){return t?.nodeName==="INPUT"}function C(t){let e=["button","checkbox","hidden","file","radio","image","range","reset","submit","number","email","time"];return b(t)&&t.type&&!e.includes(t.type)||t.nodeName==="TEXTAREA"||t.contentEditable==="true"}function Q(t){if(!b(t)&&!C(t))return!1;try{let{selectionStart:e,selectionEnd:r}=t;return e===null||e!==r}catch{return!0}}function tt(t){return E(t)||!!t.activeElement&&Q(t.activeElement)}function et(t){return!!t.activeElement&&(b(t.activeElement)||C(t.activeElement)||E(t))}function p(t){return t.ownerDocument.defaultView,t.ownerDocument.defaultView.getComputedStyle(t)}function W(t,e="vertical"){if(t){if((e==="vertical"||e==="all")&&t.scrollHeight>t.clientHeight){let{overflowY:r}=p(t);if(/(auto|scroll)/.test(r))return t}if((e==="horizontal"||e==="all")&&t.scrollWidth>t.clientWidth){let{overflowX:r}=p(t);if(/(auto|scroll)/.test(r))return t}return t.ownerDocument===t.parentNode?t:W(t.parentNode,e)}}function rt(t){let e;for(;(e=t.parentNode)&&e.nodeType!==e.ELEMENT_NODE;);return e?p(e).position!=="static"?e:e.offsetParent:null}function x(t){return t.tagName==="INPUT"||t.tagName==="TEXTAREA"}var qt="\uFEFF";function nt(t){if(x(t))return t.selectionStart===0&&t.value.length===t.selectionEnd;if(!t.isContentEditable)return!0;let e=t.textContent||"";if(e===""||e===qt)return!0;let{ownerDocument:r}=t,{defaultView:o}=r;let n=o.getSelection();let i=n.rangeCount?n.getRangeAt(0):null;if(!i)return!0;let{startContainer:a,endContainer:s,startOffset:f,endOffset:u}=i;if(a===t&&s===t&&f===0&&u===t.childNodes.length)return!0;let d=t.lastChild;let l=s.nodeType===s.TEXT_NODE?s.data.length:s.childNodes.length;return ot(a,t,"firstChild")&&ot(s,t,"lastChild")&&f===0&&u===l}function ot(t,e,r){let o=e;do{if(t===o)return!0;for(o=o[r];o&&o.nodeType===o.TEXT_NODE&&o.nodeValue==="";)o=o[r==="lastChild"?"previousSibling":"nextSibling"]}while(o);return!1}function it(t){if(!t)return!1;let{tagName:e}=t;return x(t)||e==="BUTTON"||e==="SELECT"}function T(t){return p(t).direction==="rtl"}function at(t){let e=Array.from(t.getClientRects());if(!e.length)return;let r=Math.min(...e.map(({top:n})=>n));return Math.max(...e.map(({bottom:n})=>n))-r}function O(t){let{anchorNode:e,focusNode:r,anchorOffset:o,focusOffset:n}=t;let i=e.compareDocumentPosition(r);return i&e.DOCUMENT_POSITION_PRECEDING?!1:i&e.DOCUMENT_POSITION_FOLLOWING?!0:i===0?o<=n:!0}function st(t,e,r){if(t.caretRangeFromPoint)return t.caretRangeFromPoint(e,r);if(!t.caretPositionFromPoint)return null;let o=t.caretPositionFromPoint(e,r);if(!o)return null;let n=t.createRange();return n.setStart(o.offsetNode,o.offset),n.collapse(!0),n}function L(t,e,r,o){let n=o.style.zIndex,i=o.style.position,a=o.style.borderRadius,{position:s="static"}=p(o);s==="static"&&(o.style.position="relative"),o.style.zIndex="10000",o.style.borderRadius="0";let f=st(t,e,r);return o.style.zIndex=n,o.style.position=i,o.style.borderRadius=a,f}function H(t,e,r){let o=r();return(!o||!o.startContainer||!t.contains(o.startContainer))&&(t.scrollIntoView(e),o=r(),!o||!o.startContainer||!t.contains(o.startContainer))?null:o}function F(t,e,r=!1){if(x(t)&&typeof t.selectionStart=="number")return t.selectionStart!==t.selectionEnd?!1:e?t.selectionStart===0:t.value.length===t.selectionStart;if(!t.isContentEditable)return!0;let{ownerDocument:o}=t,{defaultView:n}=o;let i=n.getSelection();if(!i||!i.rangeCount)return!1;let a=i.getRangeAt(0),s=a.cloneRange(),f=O(i),u=i.isCollapsed;u||s.collapse(!f);let d=h(s),l=h(a);if(!d||!l)return!1;let c=at(a);if(!u&&c&&c>d.height&&f===e)return!1;let m=T(t)?!e:e,N=t.getBoundingClientRect(),yt=m?N.left+1:N.right-1,wt=e?N.top+1:N.bottom-1,q=H(t,e,()=>L(o,yt,wt,t));if(!q)return!1;let _=h(q);if(!_)return!1;let G=e?"top":"bottom",X=m?"left":"right",It=_[G]-l[G],St=_[X]-d[X],Y=Math.abs(It)<=1,Rt=Math.abs(St)<=1;return r?Y:Y&&Rt}function ft(t,e){return F(t,e)}var ct=Ft(ut(),1);function dt(t){return(0,ct.default)("wp.dom.isNumberInput",{since:"6.1",version:"6.5"}),b(t)&&t.type==="number"&&!isNaN(t.valueAsNumber)}function mt(t,e){return F(t,e,!0)}function Gt(t,e,r){let{ownerDocument:o}=t,n=T(t)?!e:e,i=t.getBoundingClientRect();r===void 0?r=e?i.right-1:i.left+1:r<=i.left?r=i.left+1:r>=i.right&&(r=i.right-1);let a=n?i.bottom-1:i.top+1;return L(o,r,a,t)}function P(t,e,r){if(!t)return;if(t.focus(),x(t)){if(typeof t.selectionStart!="number")return;e?(t.selectionStart=t.value.length,t.selectionEnd=t.value.length):(t.selectionStart=0,t.selectionEnd=0);return}if(!t.isContentEditable)return;let o=H(t,e,()=>Gt(t,e,r));if(!o)return;let{ownerDocument:n}=t,{defaultView:i}=n;let a=i.getSelection();a.removeAllRanges(),a.addRange(o)}function pt(t,e){return P(t,e,void 0)}function gt(t,e,r){return P(t,e,r?.left)}function y(t,e){e.parentNode,e.parentNode.insertBefore(t,e.nextSibling)}function g(t){t.parentNode,t.parentNode.removeChild(t)}function ht(t,e){t.parentNode,y(e,t.parentNode),g(t)}function w(t){let e=t.parentNode;for(;t.firstChild;)e.insertBefore(t.firstChild,t);e.removeChild(t)}function bt(t,e){let r=t.ownerDocument.createElement(e);for(;t.firstChild;)r.appendChild(t.firstChild);return t.parentNode,t.parentNode.replaceChild(r,t),r}function xt(t,e){e.parentNode,e.parentNode.insertBefore(t,e),t.appendChild(e)}function M(t){let{body:e}=document.implementation.createHTMLDocument("");e.innerHTML=t;let r=e.getElementsByTagName("*"),o=r.length;for(;o--;){let n=r[o];if(n.tagName==="SCRIPT")g(n);else{let i=n.attributes.length;for(;i--;){let{name:a}=n.attributes[i];a.startsWith("on")&&n.removeAttribute(a)}}}return e.innerHTML}function Nt(t){t=M(t);let e=document.implementation.createHTMLDocument("");return e.body.innerHTML=t,e.body.textContent||""}function R(t){switch(t.nodeType){case t.TEXT_NODE:return/^[ \f\n\r\t\v\u00a0]*$/.test(t.nodeValue||"");case t.ELEMENT_NODE:return t.hasAttributes()?!1:t.hasChildNodes()?Array.from(t.childNodes).every(R):!0;default:return!0}}var D={strong:{},em:{},s:{},del:{},ins:{},a:{attributes:["href","target","rel","id"]},code:{},abbr:{attributes:["title"]},sub:{},sup:{},br:{},small:{},q:{attributes:["cite"]},dfn:{attributes:["title"]},data:{attributes:["value"]},time:{attributes:["datetime"]},var:{},samp:{},kbd:{},i:{},b:{},u:{},mark:{},ruby:{},rt:{},rp:{},bdi:{attributes:["dir"]},bdo:{attributes:["dir"]},wbr:{},"#text":{}},Xt=["#text","br"];Object.keys(D).filter(t=>!Xt.includes(t)).forEach(t=>{let{[t]:e,...r}=D;D[t].children=r});var Yt={audio:{attributes:["src","preload","autoplay","mediagroup","loop","muted"]},canvas:{attributes:["width","height"]},embed:{attributes:["src","type","width","height"]},img:{attributes:["alt","src","srcset","usemap","ismap","width","height"]},object:{attributes:["data","type","name","usemap","form","width","height"]},video:{attributes:["src","poster","preload","playsinline","autoplay","mediagroup","loop","muted","controls","width","height"]},math:{attributes:["display","xmlns"],children:"*"}},V={...D,...Yt};function Et(t){if(t!=="paste")return V;let{u:e,abbr:r,data:o,time:n,wbr:i,bdi:a,bdo:s,...f}={...V,ins:{children:V.ins.children},del:{children:V.del.children}};return f}function A(t){let e=t.nodeName.toLowerCase();return Et().hasOwnProperty(e)||e==="span"}function Zt(t){let e=t.nodeName.toLowerCase();return D.hasOwnProperty(e)||e==="span"}function Ct(t){return!!t&&t.nodeType===t.ELEMENT_NODE}var $t=()=>{};function I(t,e,r,o){Array.from(t).forEach(n=>{let i=n.nodeName.toLowerCase();if(r.hasOwnProperty(i)&&(!r[i].isMatch||r[i].isMatch?.(n))){if(Ct(n)){let{attributes:a=[],classes:s=[],children:f,require:u=[],allowEmpty:d}=r[i];if(f&&!d&&R(n)){g(n);return}if(n.hasAttributes()&&(Array.from(n.attributes).forEach(({name:l})=>{l!=="class"&&!a.includes(l)&&n.removeAttribute(l)}),n.classList&&n.classList.length)){let l=s.map(c=>c==="*"?()=>!0:typeof c=="string"?m=>m===c:c instanceof RegExp?m=>c.test(m):$t);Array.from(n.classList).forEach(c=>{l.some(m=>m(c))||n.classList.remove(c)}),n.classList.length||n.removeAttribute("class")}if(n.hasChildNodes()){if(f==="*")return;if(f)u.length&&!n.querySelector(u.join(","))?(I(n.childNodes,e,r,o),w(n)):n.parentNode&&n.parentNode.nodeName==="BODY"&&A(n)?(I(n.childNodes,e,r,o),Array.from(n.childNodes).some(l=>!A(l))&&w(n)):I(n.childNodes,e,f,o);else for(;n.firstChild;)g(n.firstChild)}}}else I(n.childNodes,e,r,o),o&&!A(n)&&n.nextElementSibling&&y(e.createElement("br"),n),w(n)})}function Tt(t,e,r){let o=document.implementation.createHTMLDocument("");return o.body.innerHTML=t,I(o.body.childNodes,o,e,r),o.body.innerHTML}function Jt(t){let e=Array.from(t.files);return Array.from(t.items).forEach(r=>{let o=r.getAsFile();o&&!e.find(({name:n,type:i,size:a})=>n===o.name&&i===o.type&&a===o.size)&&e.push(o)}),e}var Kt={focusable:z,tabbable:k};return Pt(Qt);})(); plugins.min.js 0000644 00000011343 15206720414 0007350 0 ustar 00 "use strict";var wp;(wp||={}).plugins=(()=>{var K=Object.create;var g=Object.defineProperty;var Q=Object.getOwnPropertyDescriptor;var Y=Object.getOwnPropertyNames;var Z=Object.getPrototypeOf,aa=Object.prototype.hasOwnProperty;var d=(a,t)=>()=>(t||a((t={exports:{}}).exports,t),t.exports),ta=(a,t)=>{for(var r in t)g(a,r,{get:t[r],enumerable:!0})},B=(a,t,r,f)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Y(t))!aa.call(a,o)&&o!==r&&g(a,o,{get:()=>t[o],enumerable:!(f=Q(t,o))||f.enumerable});return a};var s=(a,t,r)=>(r=a!=null?K(Z(a)):{},B(t||!a||!a.__esModule?g(r,"default",{value:a,enumerable:!0}):r,a)),ea=a=>B(g({},"__esModule",{value:!0}),a);var h=d((ia,T)=>{T.exports=window.wp.element});var P=d((pa,A)=>{A.exports=window.wp.hooks});var z=d((na,V)=>{V.exports=window.wp.isShallowEqual});var j=d((ca,E)=>{E.exports=window.wp.compose});var F=d((ga,U)=>{U.exports=window.wp.deprecated});var v=d((ha,H)=>{H.exports=window.ReactJSXRuntime});var W=d((ba,J)=>{J.exports=window.wp.primitives});var ua={};ta(ua,{PluginArea:()=>X,getPlugin:()=>oa,getPlugins:()=>S,registerPlugin:()=>ra,unregisterPlugin:()=>fa,usePluginContext:()=>O,withPluginContext:()=>M});function D(a,t){var r=0,f,o;t=t||{};function l(){var e=f,C=arguments.length,c,u;a:for(;e;){if(e.args.length!==arguments.length){e=e.next;continue}for(u=0;u<C;u++)if(e.args[u]!==arguments[u]){e=e.next;continue a}return e!==f&&(e===o&&(o=e.prev),e.prev.next=e.next,e.next&&(e.next.prev=e.prev),e.next=f,e.prev=null,f.prev=e,f=e),e.val}for(c=new Array(C),u=0;u<C;u++)c[u]=arguments[u];return e={args:c,val:a.apply(null,c)},f?(f.prev=e,e.next=f):o=e,r===t.maxSize?(o=o.prev,o.next=null):r++,f=e,e.val}return l.clear=function(){f=null,o=null,r=0},l}var y=s(h(),1),i=s(P(),1),G=s(z(),1);var w=s(h(),1),N=s(j(),1),q=s(F(),1),L=s(v(),1),x=(0,w.createContext)({name:null,icon:null});x.displayName="PluginContext";var I=x.Provider;function O(){return(0,w.useContext)(x)}var M=a=>(0,N.createHigherOrderComponent)(t=>((0,q.default)("wp.plugins.withPluginContext",{since:"6.8.0",alternative:"wp.plugins.usePluginContext"}),r=>(0,L.jsx)(x.Consumer,{children:f=>(0,L.jsx)(t,{...r,...a(f,r)})})),"withPluginContext");var _=s(h(),1),$=class extends _.Component{constructor(a){super(a),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(a){let{name:t,onError:r}=this.props;r&&r(t,a)}render(){return this.state.hasError?null:this.props.children}};var p=s(P(),1);var b=s(W(),1),R=s(v(),1),k=(0,R.jsx)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,R.jsx)(b.Path,{d:"M10.5 4v4h3V4H15v4h1.5a1 1 0 011 1v4l-3 4v2a1 1 0 01-1 1h-3a1 1 0 01-1-1v-2l-3-4V9a1 1 0 011-1H9V4h1.5zm.5 12.5v2h2v-2l3-4v-3H8v3l3 4z"})});var m={};function ra(a,t){if(typeof t!="object")return console.error("No settings object provided!"),null;if(typeof a!="string")return console.error("Plugin name must be string."),null;if(!/^[a-z][a-z0-9-]*$/.test(a))return console.error('Plugin name must include only lowercase alphanumeric characters or dashes, and start with a letter. Example: "my-plugin".'),null;m[a]&&console.error(`Plugin "${a}" is already registered.`),t=(0,p.applyFilters)("plugins.registerPlugin",t,a);let{render:r,scope:f}=t;if(typeof r!="function")return console.error('The "render" property must be specified and must be a valid function.'),null;if(f){if(typeof f!="string")return console.error("Plugin scope must be string."),null;if(!/^[a-z][a-z0-9-]*$/.test(f))return console.error('Plugin scope must include only lowercase alphanumeric characters or dashes, and start with a letter. Example: "my-page".'),null}return m[a]={name:a,icon:k,...t},(0,p.doAction)("plugins.pluginRegistered",t,a),t}function fa(a){if(!m[a]){console.error('Plugin "'+a+'" is not registered.');return}let t=m[a];return delete m[a],(0,p.doAction)("plugins.pluginUnregistered",t,a),t}function oa(a){return m[a]}function S(a){return Object.values(m).filter(t=>t.scope===a)}var n=s(v(),1),la=D((a,t)=>({icon:a,name:t}));function sa({scope:a,onError:t}){let r=(0,y.useMemo)(()=>{let o=[];return{subscribe(l){return(0,i.addAction)("plugins.pluginRegistered","core/plugins/plugin-area/plugins-registered",l),(0,i.addAction)("plugins.pluginUnregistered","core/plugins/plugin-area/plugins-unregistered",l),()=>{(0,i.removeAction)("plugins.pluginRegistered","core/plugins/plugin-area/plugins-registered"),(0,i.removeAction)("plugins.pluginUnregistered","core/plugins/plugin-area/plugins-unregistered")}},getValue(){let l=S(a);return(0,G.isShallowEqual)(o,l)||(o=l),o}}},[a]),f=(0,y.useSyncExternalStore)(r.subscribe,r.getValue,r.getValue);return(0,n.jsx)("div",{style:{display:"none"},children:f.map(({icon:o,name:l,render:e})=>(0,n.jsx)(I,{value:la(o,l),children:(0,n.jsx)($,{name:l,onError:t,children:(0,n.jsx)(e,{})})},l))})}var X=sa;return ea(ua);})(); core-commands.min.js 0000644 00000027526 15206720414 0010430 0 ustar 00 var wp;(wp||={}).coreCommands=(()=>{var Ja=Object.create;var V=Object.defineProperty;var Qa=Object.getOwnPropertyDescriptor;var Xa=Object.getOwnPropertyNames;var Ka=Object.getPrototypeOf,Ya=Object.prototype.hasOwnProperty;var n=(a,t)=>()=>(t||a((t={exports:{}}).exports,t),t.exports),at=(a,t)=>{for(var o in t)V(a,o,{get:t[o],enumerable:!0})},wa=(a,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let f of Xa(t))!Ya.call(a,f)&&f!==o&&V(a,f,{get:()=>t[f],enumerable:!(r=Qa(t,f))||r.enumerable});return a};var e=(a,t,o)=>(o=a!=null?Ja(Ka(a)):{},wa(t||!a||!a.__esModule?V(o,"default",{value:a,enumerable:!0}):o,a)),tt=a=>wa(V({},"__esModule",{value:!0}),a);var P=n((nt,va)=>{va.exports=window.wp.element});var W=n((ct,ba)=>{ba.exports=window.wp.router});var E=n((ht,ya)=>{ya.exports=window.wp.commands});var J=n((gt,xa)=>{xa.exports=window.wp.i18n});var g=n((wt,Ca)=>{Ca.exports=window.wp.primitives});var h=n((vt,Sa)=>{Sa.exports=window.ReactJSXRuntime});var ua=n((Ut,La)=>{La.exports=window.wp.coreData});var pa=n((Gt,ka)=>{ka.exports=window.wp.data});var Va=n((It,Ba)=>{Ba.exports=window.wp.url});var Ea=n((Ft,Pa)=>{Pa.exports=window.wp.compose});var za=n((Ot,Ta)=>{Ta.exports=window.wp.htmlEntities});var Aa=n((qt,Ma)=>{Ma.exports=window.wp.privateApis});var ut={};at(ut,{initializeCommandPalette:()=>it,privateApis:()=>ha});var $=e(P(),1),qa=e(W(),1),Za=e(E(),1);var I=e(E(),1),R=e(J(),1);var T=e(g(),1),Q=e(h(),1),X=(0,Q.jsx)(T.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Q.jsx)(T.Path,{d:"M4 20h8v-1.5H4V20zM18.9 3.5c-.6-.6-1.5-.6-2.1 0l-7.2 7.2c-.4-.1-.7 0-1.1.1-.5.2-1.5.7-1.9 2.2-.4 1.7-.8 2.2-1.1 2.7-.1.1-.2.3-.3.4l-.6 1.1H6c2 0 3.4-.4 4.7-1.4.8-.6 1.2-1.4 1.3-2.3 0-.3 0-.5-.1-.7L19 5.7c.5-.6.5-1.6-.1-2.2zM9.7 14.7c-.7.5-1.5.8-2.4 1 .2-.5.5-1.2.8-2.3.2-.6.4-1 .8-1.1.5-.1 1 .1 1.3.3.2.2.3.5.2.8 0 .3-.1.9-.7 1.3z"})});var z=e(g(),1),K=e(h(),1),Y=(0,K.jsx)(z.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,K.jsx)(z.Path,{d:"M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z"})});var M=e(g(),1),aa=e(h(),1),A=(0,aa.jsx)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,aa.jsx)(M.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 j=e(g(),1),ta=e(h(),1),ea=(0,ta.jsx)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,ta.jsx)(j.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 k=e(g(),1),_=e(h(),1),oa=(0,_.jsxs)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,_.jsx)(k.Path,{d:"M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z"}),(0,_.jsx)(k.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 D=e(g(),1),ra=e(h(),1),sa=(0,ra.jsx)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,ra.jsx)(D.Path,{d:"m7.3 9.7 1.4 1.4c.2-.2.3-.3.4-.5 0 0 0-.1.1-.1.3-.5.4-1.1.3-1.6L12 7 9 4 7.2 6.5c-.6-.1-1.1 0-1.6.3 0 0-.1 0-.1.1-.3.1-.4.2-.6.4l1.4 1.4L4 11v1h1l2.3-2.3zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z"})});var U=e(g(),1),fa=e(h(),1),la=(0,fa.jsx)(U.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,fa.jsx)(U.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 G=e(g(),1),ma=e(h(),1),H=(0,ma.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,ma.jsx)(G.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 N=e(g(),1),da=e(h(),1),ia=(0,da.jsx)(N.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,da.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-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 na=e(P(),1),_a=e(ua(),1),Ra=e(pa(),1),et=()=>function(){let t=(0,Ra.useSelect)(r=>r(_a.store).getEntityRecord("root","__unstableBase")?.home,[]);return{isLoading:!1,commands:(0,na.useMemo)(()=>t?[{name:"core/view-site",label:(0,R.__)("View site"),icon:Y,category:"view",callback:({close:r})=>{r(),window.open(t,"_blank")}}]:[],[t])}};function F(a){let t=(0,na.useMemo)(()=>(a??[]).map(o=>{let r=(0,R.sprintf)((0,R.__)("Go to: %s"),o.label);return{name:o.name,label:r,searchLabel:r,category:"view",callback:({close:f})=>{document.location=o.url,f()}}}),[a]);(0,I.useCommands)(t),(0,I.useCommandLoader)({name:"core/view-site",hook:et()})}var x=e(E(),1),b=e(J(),1),w=e(P(),1),C=e(pa(),1),u=e(ua(),1);var Na=e(W(),1),p=e(Va(),1),Ia=e(Ea(),1),Fa=e(za(),1);var ja=e(Aa(),1),{lock:Da,unlock:O}=(0,ja.__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/core-commands");function Ua(a=[],t=""){if(!Array.isArray(a)||!a.length)return[];if(!t)return a;let o=[],r=[];for(let f=0;f<a.length;f++){let l=a[f];l?.title?.raw?.toLowerCase()?.includes(t?.toLowerCase())?o.push(l):r.push(l)}return o.concat(r)}var{useHistory:q}=O(Na.privateApis),Oa={post:sa,page:oa,wp_template:A,wp_template_part:H};function ot(a){let[t,o]=(0,w.useState)(""),r=(0,Ia.useDebounce)(o,250);return(0,w.useEffect)(()=>(r(a),()=>r.cancel()),[r,a]),t}var rt={"/template":"/templates","/pattern":"/patterns"};function y(){return window.__experimentalExtensibleSiteEditor?"admin.php?page=site-editor-v2":"site-editor.php"}function S(a){if(!window.__experimentalExtensibleSiteEditor)return a;for(let[t,o]of Object.entries(rt))if(a===t||a.startsWith(t+"?"))return a.includes("postType=wp_template_part")?"/template-parts":a.replace(t,o);return a}function ca(){let a=(0,p.getPath)(window.location.href);return a?.includes("site-editor.php")||a?.includes("page=site-editor-v2")}var Ga=a=>function({search:o}){let r=q(),{isBlockBasedTheme:f,canCreateTemplate:l}=(0,C.useSelect)(s=>({isBlockBasedTheme:s(u.store).getCurrentTheme()?.is_block_theme,canCreateTemplate:s(u.store).canUser("create",{kind:"postType",name:"wp_template"})}),[]),v=ot(o),{records:m,isLoading:d}=(0,C.useSelect)(s=>{if(!v)return{isLoading:!1};let c={search:v,per_page:10,orderby:"relevance",status:["publish","future","draft","pending","private"]};return{records:s(u.store).getEntityRecords("postType",a,c),isLoading:!s(u.store).hasFinishedResolution("getEntityRecords",["postType",a,c])}},[v]);return{commands:(0,w.useMemo)(()=>(m??[]).map(s=>{let c={name:a+"-"+s.id,searchLabel:s.title?.rendered+" "+s.id,label:s.title?.rendered?(0,Fa.decodeEntities)(s.title?.rendered):(0,b.__)("(no title)"),icon:Oa[a],category:"edit"};if(!l||a==="post"||a==="page"&&!f)return{...c,callback:({close:L})=>{let $a={post:s.id,action:"edit"},Wa=(0,p.addQueryArgs)("post.php",$a);document.location=Wa,L()}};let i=ca();return{...c,callback:({close:L})=>{i?r.navigate(`/${a}/${s.id}?canvas=edit`):document.location=(0,p.addQueryArgs)(y(),{p:`/${a}/${s.id}`,canvas:"edit"}),L()}}}),[l,m,f,r]),isLoading:d}},Ha=a=>function({search:o}){let r=q(),{isBlockBasedTheme:f,canCreateTemplate:l}=(0,C.useSelect)(s=>({isBlockBasedTheme:s(u.store).getCurrentTheme()?.is_block_theme,canCreateTemplate:s(u.store).canUser("create",{kind:"postType",name:a})}),[]),{records:v,isLoading:m}=(0,C.useSelect)(s=>{let{getEntityRecords:c}=s(u.store),i={per_page:-1};return{records:c("postType",a,i),isLoading:!s(u.store).hasFinishedResolution("getEntityRecords",["postType",a,i])}},[]),d=(0,w.useMemo)(()=>Ua(v,o).slice(0,10),[v,o]);return{commands:(0,w.useMemo)(()=>{if(!l||!f&&!a==="wp_template_part")return[];let s=(0,p.getPath)(window.location.href)?.includes("site-editor.php"),c=[];return c.push(...d.map(i=>({name:a+"-"+i.id,searchLabel:i.title?.rendered+" "+i.id,label:i.title?.rendered?i.title?.rendered:(0,b.__)("(no title)"),icon:Oa[a],category:"edit",callback:({close:L})=>{s?r.navigate(`/${a}/${i.id}?canvas=edit`):document.location=(0,p.addQueryArgs)(y(),{p:`/${a}/${i.id}`,canvas:"edit"}),L()}}))),d?.length>0&&a==="wp_template_part"&&c.push({name:"core/edit-site/open-template-parts",label:(0,b.__)("Go to: Template parts"),icon:H,category:"view",callback:({close:i})=>{s?r.navigate(S("/pattern?postType=wp_template_part&categoryId=all-parts")):document.location=(0,p.addQueryArgs)(y(),{p:S("/pattern"),postType:"wp_template_part",categoryId:"all-parts"}),i()}}),c},[l,f,d,r]),isLoading:m}},st=()=>function(){let t=q(),o=ca(),{isBlockBasedTheme:r,canCreateTemplate:f,canCreatePatterns:l}=(0,C.useSelect)(m=>({isBlockBasedTheme:m(u.store).getCurrentTheme()?.is_block_theme,canCreateTemplate:m(u.store).canUser("create",{kind:"postType",name:"wp_template"}),canCreatePatterns:m(u.store).canUser("create",{kind:"postType",name:"wp_block"})}),[]);return{commands:(0,w.useMemo)(()=>{let m=[];return f&&r&&(m.push({name:"core/edit-site/open-styles",label:(0,b.__)("Go to: Styles"),icon:la,category:"view",callback:({close:d})=>{o?t.navigate("/styles"):document.location=(0,p.addQueryArgs)(y(),{p:"/styles"}),d()}}),m.push({name:"core/edit-site/open-navigation",label:(0,b.__)("Go to: Navigation"),icon:ea,category:"view",callback:({close:d})=>{o?t.navigate("/navigation"):document.location=(0,p.addQueryArgs)(y(),{p:"/navigation"}),d()}}),m.push({name:"core/edit-site/open-templates",label:(0,b.__)("Go to: Templates"),icon:A,category:"view",callback:({close:d})=>{o?t.navigate(S("/template")):document.location=(0,p.addQueryArgs)(y(),{p:S("/template")}),d()}})),l&&m.push({name:"core/edit-site/open-patterns",label:(0,b.__)("Go to: Patterns"),icon:ia,category:"view",callback:({close:d})=>{f?(o?t.navigate(S("/pattern")):document.location=(0,p.addQueryArgs)(y(),{p:S("/pattern")}),d()):document.location.href="edit.php?post_type=wp_block"}}),m},[t,o,f,l,r]),isLoading:!1}},ft=()=>function(){let t=q(),o=ca(),{canEditCSS:r}=(0,C.useSelect)(l=>{let{getEntityRecord:v,__experimentalGetCurrentGlobalStylesId:m}=l(u.store),d=m();return{canEditCSS:!!(d?v("root","globalStyles",d):void 0)?._links?.["wp:action-edit-css"]}},[]);return{isLoading:!1,commands:(0,w.useMemo)(()=>r?[{name:"core/open-styles-css",label:(0,b.__)("Open custom CSS"),icon:X,category:"view",callback:({close:l})=>{l(),o?t.navigate("/styles?section=/css"):document.location=(0,p.addQueryArgs)(y(),{p:"/styles",section:"/css"})}}]:[],[t,r,o])}};function Z(a){(0,x.useCommandLoader)({name:"core/edit-site/navigate-pages",hook:Ga("page"),disabled:a}),(0,x.useCommandLoader)({name:"core/edit-site/navigate-posts",hook:Ga("post"),disabled:a}),(0,x.useCommandLoader)({name:"core/edit-site/navigate-templates",hook:Ha("wp_template"),disabled:a}),(0,x.useCommandLoader)({name:"core/edit-site/navigate-template-parts",hook:Ha("wp_template_part"),disabled:a}),(0,x.useCommandLoader)({name:"core/edit-site/basic-navigation",hook:st(),context:"site-editor",disabled:a}),(0,x.useCommandLoader)({name:"core/edit-site/global-styles-css",hook:ft(),disabled:a})}function lt(){F(),Z()}var ha={};Da(ha,{useCommands:lt});var B=e(h(),1),{RouterProvider:mt}=O(qa.privateApis);function dt({settings:a}){let{menu_commands:t,is_network_admin:o}=a;return F(t),Z(o),(0,B.jsx)(mt,{pathArg:"p",children:(0,B.jsx)(Za.CommandMenu,{})})}function it(a){let t=document.createElement("div");document.body.appendChild(t),(0,$.createRoot)(t).render((0,B.jsx)($.StrictMode,{children:(0,B.jsx)(dt,{settings:a})}))}return tt(ut);})(); url.js 0000644 00000056617 15206720414 0005724 0 ustar 00 "use strict"; var wp; (wp ||= {}).url = (() => { 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 __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; 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 )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // node_modules/remove-accents/index.js var require_remove_accents = __commonJS({ "node_modules/remove-accents/index.js"(exports, module) { var characterMap = { "\xC0": "A", "\xC1": "A", "\xC2": "A", "\xC3": "A", "\xC4": "A", "\xC5": "A", "\u1EA4": "A", "\u1EAE": "A", "\u1EB2": "A", "\u1EB4": "A", "\u1EB6": "A", "\xC6": "AE", "\u1EA6": "A", "\u1EB0": "A", "\u0202": "A", "\u1EA2": "A", "\u1EA0": "A", "\u1EA8": "A", "\u1EAA": "A", "\u1EAC": "A", "\xC7": "C", "\u1E08": "C", "\xC8": "E", "\xC9": "E", "\xCA": "E", "\xCB": "E", "\u1EBE": "E", "\u1E16": "E", "\u1EC0": "E", "\u1E14": "E", "\u1E1C": "E", "\u0206": "E", "\u1EBA": "E", "\u1EBC": "E", "\u1EB8": "E", "\u1EC2": "E", "\u1EC4": "E", "\u1EC6": "E", "\xCC": "I", "\xCD": "I", "\xCE": "I", "\xCF": "I", "\u1E2E": "I", "\u020A": "I", "\u1EC8": "I", "\u1ECA": "I", "\xD0": "D", "\xD1": "N", "\xD2": "O", "\xD3": "O", "\xD4": "O", "\xD5": "O", "\xD6": "O", "\xD8": "O", "\u1ED0": "O", "\u1E4C": "O", "\u1E52": "O", "\u020E": "O", "\u1ECE": "O", "\u1ECC": "O", "\u1ED4": "O", "\u1ED6": "O", "\u1ED8": "O", "\u1EDC": "O", "\u1EDE": "O", "\u1EE0": "O", "\u1EDA": "O", "\u1EE2": "O", "\xD9": "U", "\xDA": "U", "\xDB": "U", "\xDC": "U", "\u1EE6": "U", "\u1EE4": "U", "\u1EEC": "U", "\u1EEE": "U", "\u1EF0": "U", "\xDD": "Y", "\xE0": "a", "\xE1": "a", "\xE2": "a", "\xE3": "a", "\xE4": "a", "\xE5": "a", "\u1EA5": "a", "\u1EAF": "a", "\u1EB3": "a", "\u1EB5": "a", "\u1EB7": "a", "\xE6": "ae", "\u1EA7": "a", "\u1EB1": "a", "\u0203": "a", "\u1EA3": "a", "\u1EA1": "a", "\u1EA9": "a", "\u1EAB": "a", "\u1EAD": "a", "\xE7": "c", "\u1E09": "c", "\xE8": "e", "\xE9": "e", "\xEA": "e", "\xEB": "e", "\u1EBF": "e", "\u1E17": "e", "\u1EC1": "e", "\u1E15": "e", "\u1E1D": "e", "\u0207": "e", "\u1EBB": "e", "\u1EBD": "e", "\u1EB9": "e", "\u1EC3": "e", "\u1EC5": "e", "\u1EC7": "e", "\xEC": "i", "\xED": "i", "\xEE": "i", "\xEF": "i", "\u1E2F": "i", "\u020B": "i", "\u1EC9": "i", "\u1ECB": "i", "\xF0": "d", "\xF1": "n", "\xF2": "o", "\xF3": "o", "\xF4": "o", "\xF5": "o", "\xF6": "o", "\xF8": "o", "\u1ED1": "o", "\u1E4D": "o", "\u1E53": "o", "\u020F": "o", "\u1ECF": "o", "\u1ECD": "o", "\u1ED5": "o", "\u1ED7": "o", "\u1ED9": "o", "\u1EDD": "o", "\u1EDF": "o", "\u1EE1": "o", "\u1EDB": "o", "\u1EE3": "o", "\xF9": "u", "\xFA": "u", "\xFB": "u", "\xFC": "u", "\u1EE7": "u", "\u1EE5": "u", "\u1EED": "u", "\u1EEF": "u", "\u1EF1": "u", "\xFD": "y", "\xFF": "y", "\u0100": "A", "\u0101": "a", "\u0102": "A", "\u0103": "a", "\u0104": "A", "\u0105": "a", "\u0106": "C", "\u0107": "c", "\u0108": "C", "\u0109": "c", "\u010A": "C", "\u010B": "c", "\u010C": "C", "\u010D": "c", "C\u0306": "C", "c\u0306": "c", "\u010E": "D", "\u010F": "d", "\u0110": "D", "\u0111": "d", "\u0112": "E", "\u0113": "e", "\u0114": "E", "\u0115": "e", "\u0116": "E", "\u0117": "e", "\u0118": "E", "\u0119": "e", "\u011A": "E", "\u011B": "e", "\u011C": "G", "\u01F4": "G", "\u011D": "g", "\u01F5": "g", "\u011E": "G", "\u011F": "g", "\u0120": "G", "\u0121": "g", "\u0122": "G", "\u0123": "g", "\u0124": "H", "\u0125": "h", "\u0126": "H", "\u0127": "h", "\u1E2A": "H", "\u1E2B": "h", "\u0128": "I", "\u0129": "i", "\u012A": "I", "\u012B": "i", "\u012C": "I", "\u012D": "i", "\u012E": "I", "\u012F": "i", "\u0130": "I", "\u0131": "i", "\u0132": "IJ", "\u0133": "ij", "\u0134": "J", "\u0135": "j", "\u0136": "K", "\u0137": "k", "\u1E30": "K", "\u1E31": "k", "K\u0306": "K", "k\u0306": "k", "\u0139": "L", "\u013A": "l", "\u013B": "L", "\u013C": "l", "\u013D": "L", "\u013E": "l", "\u013F": "L", "\u0140": "l", "\u0141": "l", "\u0142": "l", "\u1E3E": "M", "\u1E3F": "m", "M\u0306": "M", "m\u0306": "m", "\u0143": "N", "\u0144": "n", "\u0145": "N", "\u0146": "n", "\u0147": "N", "\u0148": "n", "\u0149": "n", "N\u0306": "N", "n\u0306": "n", "\u014C": "O", "\u014D": "o", "\u014E": "O", "\u014F": "o", "\u0150": "O", "\u0151": "o", "\u0152": "OE", "\u0153": "oe", "P\u0306": "P", "p\u0306": "p", "\u0154": "R", "\u0155": "r", "\u0156": "R", "\u0157": "r", "\u0158": "R", "\u0159": "r", "R\u0306": "R", "r\u0306": "r", "\u0212": "R", "\u0213": "r", "\u015A": "S", "\u015B": "s", "\u015C": "S", "\u015D": "s", "\u015E": "S", "\u0218": "S", "\u0219": "s", "\u015F": "s", "\u0160": "S", "\u0161": "s", "\u0162": "T", "\u0163": "t", "\u021B": "t", "\u021A": "T", "\u0164": "T", "\u0165": "t", "\u0166": "T", "\u0167": "t", "T\u0306": "T", "t\u0306": "t", "\u0168": "U", "\u0169": "u", "\u016A": "U", "\u016B": "u", "\u016C": "U", "\u016D": "u", "\u016E": "U", "\u016F": "u", "\u0170": "U", "\u0171": "u", "\u0172": "U", "\u0173": "u", "\u0216": "U", "\u0217": "u", "V\u0306": "V", "v\u0306": "v", "\u0174": "W", "\u0175": "w", "\u1E82": "W", "\u1E83": "w", "X\u0306": "X", "x\u0306": "x", "\u0176": "Y", "\u0177": "y", "\u0178": "Y", "Y\u0306": "Y", "y\u0306": "y", "\u0179": "Z", "\u017A": "z", "\u017B": "Z", "\u017C": "z", "\u017D": "Z", "\u017E": "z", "\u017F": "s", "\u0192": "f", "\u01A0": "O", "\u01A1": "o", "\u01AF": "U", "\u01B0": "u", "\u01CD": "A", "\u01CE": "a", "\u01CF": "I", "\u01D0": "i", "\u01D1": "O", "\u01D2": "o", "\u01D3": "U", "\u01D4": "u", "\u01D5": "U", "\u01D6": "u", "\u01D7": "U", "\u01D8": "u", "\u01D9": "U", "\u01DA": "u", "\u01DB": "U", "\u01DC": "u", "\u1EE8": "U", "\u1EE9": "u", "\u1E78": "U", "\u1E79": "u", "\u01FA": "A", "\u01FB": "a", "\u01FC": "AE", "\u01FD": "ae", "\u01FE": "O", "\u01FF": "o", "\xDE": "TH", "\xFE": "th", "\u1E54": "P", "\u1E55": "p", "\u1E64": "S", "\u1E65": "s", "X\u0301": "X", "x\u0301": "x", "\u0403": "\u0413", "\u0453": "\u0433", "\u040C": "\u041A", "\u045C": "\u043A", "A\u030B": "A", "a\u030B": "a", "E\u030B": "E", "e\u030B": "e", "I\u030B": "I", "i\u030B": "i", "\u01F8": "N", "\u01F9": "n", "\u1ED2": "O", "\u1ED3": "o", "\u1E50": "O", "\u1E51": "o", "\u1EEA": "U", "\u1EEB": "u", "\u1E80": "W", "\u1E81": "w", "\u1EF2": "Y", "\u1EF3": "y", "\u0200": "A", "\u0201": "a", "\u0204": "E", "\u0205": "e", "\u0208": "I", "\u0209": "i", "\u020C": "O", "\u020D": "o", "\u0210": "R", "\u0211": "r", "\u0214": "U", "\u0215": "u", "B\u030C": "B", "b\u030C": "b", "\u010C\u0323": "C", "\u010D\u0323": "c", "\xCA\u030C": "E", "\xEA\u030C": "e", "F\u030C": "F", "f\u030C": "f", "\u01E6": "G", "\u01E7": "g", "\u021E": "H", "\u021F": "h", "J\u030C": "J", "\u01F0": "j", "\u01E8": "K", "\u01E9": "k", "M\u030C": "M", "m\u030C": "m", "P\u030C": "P", "p\u030C": "p", "Q\u030C": "Q", "q\u030C": "q", "\u0158\u0329": "R", "\u0159\u0329": "r", "\u1E66": "S", "\u1E67": "s", "V\u030C": "V", "v\u030C": "v", "W\u030C": "W", "w\u030C": "w", "X\u030C": "X", "x\u030C": "x", "Y\u030C": "Y", "y\u030C": "y", "A\u0327": "A", "a\u0327": "a", "B\u0327": "B", "b\u0327": "b", "\u1E10": "D", "\u1E11": "d", "\u0228": "E", "\u0229": "e", "\u0190\u0327": "E", "\u025B\u0327": "e", "\u1E28": "H", "\u1E29": "h", "I\u0327": "I", "i\u0327": "i", "\u0197\u0327": "I", "\u0268\u0327": "i", "M\u0327": "M", "m\u0327": "m", "O\u0327": "O", "o\u0327": "o", "Q\u0327": "Q", "q\u0327": "q", "U\u0327": "U", "u\u0327": "u", "X\u0327": "X", "x\u0327": "x", "Z\u0327": "Z", "z\u0327": "z", "\u0439": "\u0438", "\u0419": "\u0418", "\u0451": "\u0435", "\u0401": "\u0415" }; var chars = Object.keys(characterMap).join("|"); var allAccents = new RegExp(chars, "g"); var firstAccent = new RegExp(chars, ""); function matcher(match) { return characterMap[match]; } var removeAccents2 = function(string) { return string.replace(allAccents, matcher); }; var hasAccents = function(string) { return !!string.match(firstAccent); }; module.exports = removeAccents2; module.exports.has = hasAccents; module.exports.remove = removeAccents2; } }); // packages/url/build-module/index.mjs var index_exports = {}; __export(index_exports, { addQueryArgs: () => addQueryArgs, buildQueryString: () => buildQueryString, cleanForSlug: () => cleanForSlug, filterURLForDisplay: () => filterURLForDisplay, getAuthority: () => getAuthority, getFilename: () => getFilename, getFragment: () => getFragment, getPath: () => getPath, getPathAndQueryString: () => getPathAndQueryString, getProtocol: () => getProtocol, getQueryArg: () => getQueryArg, getQueryArgs: () => getQueryArgs, getQueryString: () => getQueryString, hasQueryArg: () => hasQueryArg, isEmail: () => isEmail, isPhoneNumber: () => isPhoneNumber, isURL: () => isURL, isValidAuthority: () => isValidAuthority, isValidFragment: () => isValidFragment, isValidPath: () => isValidPath, isValidProtocol: () => isValidProtocol, isValidQueryString: () => isValidQueryString, normalizePath: () => normalizePath, prependHTTP: () => prependHTTP, prependHTTPS: () => prependHTTPS, removeQueryArgs: () => removeQueryArgs, safeDecodeURI: () => safeDecodeURI, safeDecodeURIComponent: () => safeDecodeURIComponent }); // packages/url/build-module/is-url.mjs function isURL(url) { try { new URL(url); return true; } catch { return false; } } // packages/url/build-module/is-email.mjs var EMAIL_REGEXP = /^(mailto:)?[a-z0-9._%+-]+@[a-z0-9][a-z0-9.-]*\.[a-z]{2,63}$/i; function isEmail(email) { return EMAIL_REGEXP.test(email); } // packages/url/build-module/is-phone-number.mjs var PHONE_REGEXP = /^(tel:)?(\+)?\d{6,15}$/; function isPhoneNumber(phoneNumber) { phoneNumber = phoneNumber.replace(/[-.() ]/g, ""); return PHONE_REGEXP.test(phoneNumber); } // packages/url/build-module/get-protocol.mjs function getProtocol(url) { const matches = /^([^\s:]+:)/.exec(url); if (matches) { return matches[1]; } } // packages/url/build-module/is-valid-protocol.mjs function isValidProtocol(protocol) { if (!protocol) { return false; } return /^[a-z\-.\+]+[0-9]*:$/i.test(protocol); } // packages/url/build-module/get-authority.mjs function getAuthority(url) { const matches = /^[^\/\s:]+:(?:\/\/)?\/?([^\/\s#?]+)[\/#?]{0,1}\S*$/.exec( url ); if (matches) { return matches[1]; } } // packages/url/build-module/is-valid-authority.mjs function isValidAuthority(authority) { if (!authority) { return false; } return /^[^\s#?]+$/.test(authority); } // packages/url/build-module/get-path.mjs function getPath(url) { const matches = /^[^\/\s:]+:(?:\/\/)?[^\/\s#?]+[\/]([^\s#?]+)[#?]{0,1}\S*$/.exec(url); if (matches) { return matches[1]; } } // packages/url/build-module/is-valid-path.mjs function isValidPath(path) { if (!path) { return false; } return /^[^\s#?]+$/.test(path); } // packages/url/build-module/get-query-string.mjs function getQueryString(url) { let query; try { query = new URL(url, "http://example.com").search.substring(1); } catch (error) { } if (query) { return query; } } // packages/url/build-module/build-query-string.mjs function buildQueryString(data) { let string = ""; const stack = Object.entries(data); let pair; while (pair = stack.shift()) { let [key, value] = pair; const hasNestedData = Array.isArray(value) || value && value.constructor === Object; if (hasNestedData) { const valuePairs = Object.entries(value).reverse(); for (const [member, memberValue] of valuePairs) { stack.unshift([`${key}[${member}]`, memberValue]); } } else if (value !== void 0) { if (value === null) { value = ""; } string += "&" + [key, String(value)].map(encodeURIComponent).join("="); } } return string.substr(1); } // packages/url/build-module/is-valid-query-string.mjs function isValidQueryString(queryString) { if (!queryString) { return false; } return /^[^\s#?\/]+$/.test(queryString); } // packages/url/build-module/get-path-and-query-string.mjs function getPathAndQueryString(url) { const path = getPath(url); const queryString = getQueryString(url); let value = "/"; if (path) { value += path; } if (queryString) { value += `?${queryString}`; } return value; } // packages/url/build-module/get-fragment.mjs function getFragment(url) { const matches = /^\S+?(#[^\s\?]*)/.exec(url); if (matches) { return matches[1]; } } // packages/url/build-module/is-valid-fragment.mjs function isValidFragment(fragment) { if (!fragment) { return false; } return /^#[^\s#?\/]*$/.test(fragment); } // packages/url/build-module/safe-decode-uri-component.mjs function safeDecodeURIComponent(uriComponent) { try { return decodeURIComponent(uriComponent); } catch (uriComponentError) { return uriComponent; } } // packages/url/build-module/get-query-args.mjs function setPath(object, path, value) { const length = path.length; const lastIndex = length - 1; for (let i = 0; i < length; i++) { let key = path[i]; if (!key && Array.isArray(object)) { key = object.length.toString(); } key = ["__proto__", "constructor", "prototype"].includes(key) ? key.toUpperCase() : key; const isNextKeyArrayIndex = !isNaN(Number(path[i + 1])); object[key] = i === lastIndex ? ( // If at end of path, assign the intended value. value ) : ( // Otherwise, advance to the next object in the path, creating // it if it does not yet exist. object[key] || (isNextKeyArrayIndex ? [] : {}) ); if (Array.isArray(object[key]) && !isNextKeyArrayIndex) { object[key] = { ...object[key] }; } object = object[key]; } } function getQueryArgs(url) { return (getQueryString(url) || "").replace(/\+/g, "%20").split("&").reduce((accumulator, keyValue) => { const [key, value = ""] = keyValue.split("=").filter(Boolean).map(safeDecodeURIComponent); if (key) { const segments = key.replace(/\]/g, "").split("["); setPath(accumulator, segments, value); } return accumulator; }, /* @__PURE__ */ Object.create(null)); } // packages/url/build-module/add-query-args.mjs function addQueryArgs(url = "", args) { if (!args || !Object.keys(args).length) { return url; } const fragment = getFragment(url) || ""; let baseUrl = url.replace(fragment, ""); const queryStringIndex = url.indexOf("?"); if (queryStringIndex !== -1) { args = Object.assign(getQueryArgs(url), args); baseUrl = baseUrl.substr(0, queryStringIndex); } return baseUrl + "?" + buildQueryString(args) + fragment; } // packages/url/build-module/get-query-arg.mjs function getQueryArg(url, arg) { return getQueryArgs(url)[arg]; } // packages/url/build-module/has-query-arg.mjs function hasQueryArg(url, arg) { return getQueryArg(url, arg) !== void 0; } // packages/url/build-module/remove-query-args.mjs function removeQueryArgs(url, ...args) { const fragment = url.replace(/^[^#]*/, ""); url = url.replace(/#.*/, ""); const queryStringIndex = url.indexOf("?"); if (queryStringIndex === -1) { return url + fragment; } const query = getQueryArgs(url); const baseURL = url.substr(0, queryStringIndex); args.forEach((arg) => delete query[arg]); const queryString = buildQueryString(query); const updatedUrl = queryString ? baseURL + "?" + queryString : baseURL; return updatedUrl + fragment; } // packages/url/build-module/prepend-http.mjs var USABLE_HREF_REGEXP = /^(?:[a-z]+:|#|\?|\.|\/)/i; function prependHTTP(url) { if (!url) { return url; } url = url.trim(); if (!USABLE_HREF_REGEXP.test(url) && !isEmail(url)) { return "http://" + url; } return url; } // packages/url/build-module/safe-decode-uri.mjs function safeDecodeURI(uri) { try { return decodeURI(uri); } catch (uriError) { return uri; } } // packages/url/build-module/filter-url-for-display.mjs function filterURLForDisplay(url, maxLength = null) { if (!url) { return ""; } let filteredURL = url.replace(/^[a-z\-.\+]+[0-9]*:(\/\/)?/i, "").replace(/^www\./i, ""); if (filteredURL.match(/^[^\/]+\/$/)) { filteredURL = filteredURL.replace("/", ""); } const fileRegexp = /\/([^\/?]+)\.(?:[\w]+)(?=\?|$)/; if (!maxLength || filteredURL.length <= maxLength || !filteredURL.match(fileRegexp)) { return filteredURL; } filteredURL = filteredURL.split("?")[0]; const urlPieces = filteredURL.split("/"); const file = urlPieces[urlPieces.length - 1]; if (file.length <= maxLength) { return "\u2026" + filteredURL.slice(-maxLength); } const index = file.lastIndexOf("."); const [fileName, extension] = [ file.slice(0, index), file.slice(index + 1) ]; const truncatedFile = fileName.slice(-3) + "." + extension; return file.slice(0, maxLength - truncatedFile.length - 1) + "\u2026" + truncatedFile; } // packages/url/build-module/clean-for-slug.mjs var import_remove_accents = __toESM(require_remove_accents(), 1); function cleanForSlug(string) { if (!string) { return ""; } return (0, import_remove_accents.default)(string).replace(/( |–|—)/g, "-").replace(/[\s\./]+/g, "-").replace(/&\S+?;/g, "").replace(/[^\p{L}\p{N}_-]+/gu, "").toLowerCase().replace(/-+/g, "-").replace(/(^-+)|(-+$)/g, ""); } // packages/url/build-module/get-filename.mjs function getFilename(url) { let filename; if (!url) { return; } try { filename = new URL(url, "http://example.com").pathname.split("/").pop(); } catch (error) { } if (filename) { return filename; } } // packages/url/build-module/normalize-path.mjs function normalizePath(path) { const split = path.split("?"); const query = split[1]; const base = split[0]; if (!query) { return base; } return base + "?" + query.split("&").map((entry) => entry.split("=")).map((pair) => pair.map(decodeURIComponent)).sort((a, b) => a[0].localeCompare(b[0])).map((pair) => pair.map(encodeURIComponent)).map((pair) => pair.join("=")).join("&"); } // packages/url/build-module/prepend-https.mjs function prependHTTPS(url) { if (!url) { return url; } if (url.startsWith("http://")) { return url; } url = prependHTTP(url); return url.replace(/^http:/, "https:"); } return __toCommonJS(index_exports); })(); a11y.js 0000644 00000012720 15206720414 0005660 0 ustar 00 "use strict"; var wp; (wp ||= {}).a11y = (() => { 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 __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; 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 )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // package-external:@wordpress/dom-ready var require_dom_ready = __commonJS({ "package-external:@wordpress/dom-ready"(exports, module) { module.exports = window.wp.domReady; } }); // package-external:@wordpress/i18n var require_i18n = __commonJS({ "package-external:@wordpress/i18n"(exports, module) { module.exports = window.wp.i18n; } }); // packages/a11y/build-module/index.mjs var index_exports = {}; __export(index_exports, { setup: () => setup, speak: () => speak }); var import_dom_ready = __toESM(require_dom_ready(), 1); // packages/a11y/build-module/script/add-container.mjs function addContainer(ariaLive = "polite") { const container = document.createElement("div"); container.id = `a11y-speak-${ariaLive}`; container.className = "a11y-speak-region"; container.setAttribute( "style", "position:absolute;margin:-1px;padding:0;height:1px;width:1px;overflow:hidden;clip-path:inset(50%);border:0;word-wrap:normal !important;" ); container.setAttribute("aria-live", ariaLive); container.setAttribute("aria-relevant", "additions text"); container.setAttribute("aria-atomic", "true"); const { body } = document; if (body) { body.appendChild(container); } return container; } // packages/a11y/build-module/script/add-intro-text.mjs var import_i18n = __toESM(require_i18n(), 1); function addIntroText() { const introText = document.createElement("p"); introText.id = "a11y-speak-intro-text"; introText.className = "a11y-speak-intro-text"; introText.textContent = (0, import_i18n.__)("Notifications"); introText.setAttribute( "style", "position:absolute;margin:-1px;padding:0;height:1px;width:1px;overflow:hidden;clip-path:inset(50%);border:0;word-wrap:normal !important;" ); introText.setAttribute("hidden", ""); const { body } = document; if (body) { body.appendChild(introText); } return introText; } // 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/index.mjs function setup() { const introText = document.getElementById("a11y-speak-intro-text"); const containerAssertive = document.getElementById( "a11y-speak-assertive" ); const containerPolite = document.getElementById("a11y-speak-polite"); if (introText === null) { addIntroText(); } if (containerAssertive === null) { addContainer("assertive"); } if (containerPolite === null) { addContainer("polite"); } } (0, import_dom_ready.default)(setup); return __toCommonJS(index_exports); })(); editor.js 0000644 00011766464 15206720414 0006422 0 ustar 00 "use strict"; var wp; (wp ||= {}).editor = (() => { 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 __require = /* @__PURE__ */ ((x2) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x2, { get: (a3, b3) => (typeof require !== "undefined" ? require : a3)[b3] }) : x2)(function(x2) { if (typeof require !== "undefined") return require.apply(this, arguments); throw Error('Dynamic require of "' + x2 + '" is not supported'); }); var __commonJS = (cb, mod) => function __require4() { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; var __export = (target, all) => { for (var name2 in all) __defProp(target, name2, { get: all[name2], enumerable: true }); }; var __copyProps = (to2, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to2, key) && key !== except) __defProp(to2, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to2; }; 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 )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // package-external:@wordpress/data var require_data = __commonJS({ "package-external:@wordpress/data"(exports, module) { module.exports = window.wp.data; } }); // package-external:@wordpress/core-data var require_core_data = __commonJS({ "package-external:@wordpress/core-data"(exports, module) { module.exports = window.wp.coreData; } }); // package-external:@wordpress/element var require_element = __commonJS({ "package-external:@wordpress/element"(exports, module) { module.exports = window.wp.element; } }); // package-external:@wordpress/compose var require_compose = __commonJS({ "package-external:@wordpress/compose"(exports, module) { module.exports = window.wp.compose; } }); // package-external:@wordpress/hooks var require_hooks = __commonJS({ "package-external:@wordpress/hooks"(exports, module) { module.exports = window.wp.hooks; } }); // package-external:@wordpress/block-editor var require_block_editor = __commonJS({ "package-external:@wordpress/block-editor"(exports, module) { module.exports = window.wp.blockEditor; } }); // package-external:@wordpress/blocks var require_blocks = __commonJS({ "package-external:@wordpress/blocks"(exports, module) { module.exports = window.wp.blocks; } }); // package-external:@wordpress/date var require_date = __commonJS({ "package-external:@wordpress/date"(exports, module) { module.exports = window.wp.date; } }); // package-external:@wordpress/url var require_url = __commonJS({ "package-external:@wordpress/url"(exports, module) { module.exports = window.wp.url; } }); // package-external:@wordpress/deprecated var require_deprecated = __commonJS({ "package-external:@wordpress/deprecated"(exports, module) { module.exports = window.wp.deprecated; } }); // package-external:@wordpress/preferences var require_preferences = __commonJS({ "package-external:@wordpress/preferences"(exports, module) { module.exports = window.wp.preferences; } }); // 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/private-apis var require_private_apis = __commonJS({ "package-external:@wordpress/private-apis"(exports, module) { module.exports = window.wp.privateApis; } }); // package-external:@wordpress/a11y var require_a11y = __commonJS({ "package-external:@wordpress/a11y"(exports, module) { module.exports = window.wp.a11y; } }); // 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/notices var require_notices = __commonJS({ "package-external:@wordpress/notices"(exports, module) { module.exports = window.wp.notices; } }); // package-external:@wordpress/i18n var require_i18n = __commonJS({ "package-external:@wordpress/i18n"(exports, module) { module.exports = window.wp.i18n; } }); // package-external:@wordpress/html-entities var require_html_entities = __commonJS({ "package-external:@wordpress/html-entities"(exports, module) { module.exports = window.wp.htmlEntities; } }); // node_modules/fast-deep-equal/index.js var require_fast_deep_equal = __commonJS({ "node_modules/fast-deep-equal/index.js"(exports, module) { "use strict"; module.exports = function equal(a3, b3) { if (a3 === b3) return true; if (a3 && b3 && typeof a3 == "object" && typeof b3 == "object") { if (a3.constructor !== b3.constructor) return false; var length, i3, keys; if (Array.isArray(a3)) { length = a3.length; if (length != b3.length) return false; for (i3 = length; i3-- !== 0; ) if (!equal(a3[i3], b3[i3])) return false; return true; } if (a3.constructor === RegExp) return a3.source === b3.source && a3.flags === b3.flags; if (a3.valueOf !== Object.prototype.valueOf) return a3.valueOf() === b3.valueOf(); if (a3.toString !== Object.prototype.toString) return a3.toString() === b3.toString(); keys = Object.keys(a3); length = keys.length; if (length !== Object.keys(b3).length) return false; for (i3 = length; i3-- !== 0; ) if (!Object.prototype.hasOwnProperty.call(b3, keys[i3])) return false; for (i3 = length; i3-- !== 0; ) { var key = keys[i3]; if (!equal(a3[key], b3[key])) return false; } return true; } return a3 !== a3 && b3 !== b3; }; } }); // package-external:@wordpress/media-utils var require_media_utils = __commonJS({ "package-external:@wordpress/media-utils"(exports, module) { module.exports = window.wp.mediaUtils; } }); // package-external:@wordpress/components var require_components = __commonJS({ "package-external:@wordpress/components"(exports, module) { module.exports = window.wp.components; } }); // package-external:@wordpress/patterns var require_patterns = __commonJS({ "package-external:@wordpress/patterns"(exports, module) { module.exports = window.wp.patterns; } }); // package-external:@wordpress/blob var require_blob = __commonJS({ "package-external:@wordpress/blob"(exports, module) { module.exports = window.wp.blob; } }); // vendor-external:react var require_react = __commonJS({ "vendor-external:react"(exports, module) { module.exports = window.React; } }); // vendor-external:react-dom var require_react_dom = __commonJS({ "vendor-external:react-dom"(exports, module) { module.exports = window.ReactDOM; } }); // node_modules/remove-accents/index.js var require_remove_accents = __commonJS({ "node_modules/remove-accents/index.js"(exports, module) { var characterMap = { "\xC0": "A", "\xC1": "A", "\xC2": "A", "\xC3": "A", "\xC4": "A", "\xC5": "A", "\u1EA4": "A", "\u1EAE": "A", "\u1EB2": "A", "\u1EB4": "A", "\u1EB6": "A", "\xC6": "AE", "\u1EA6": "A", "\u1EB0": "A", "\u0202": "A", "\u1EA2": "A", "\u1EA0": "A", "\u1EA8": "A", "\u1EAA": "A", "\u1EAC": "A", "\xC7": "C", "\u1E08": "C", "\xC8": "E", "\xC9": "E", "\xCA": "E", "\xCB": "E", "\u1EBE": "E", "\u1E16": "E", "\u1EC0": "E", "\u1E14": "E", "\u1E1C": "E", "\u0206": "E", "\u1EBA": "E", "\u1EBC": "E", "\u1EB8": "E", "\u1EC2": "E", "\u1EC4": "E", "\u1EC6": "E", "\xCC": "I", "\xCD": "I", "\xCE": "I", "\xCF": "I", "\u1E2E": "I", "\u020A": "I", "\u1EC8": "I", "\u1ECA": "I", "\xD0": "D", "\xD1": "N", "\xD2": "O", "\xD3": "O", "\xD4": "O", "\xD5": "O", "\xD6": "O", "\xD8": "O", "\u1ED0": "O", "\u1E4C": "O", "\u1E52": "O", "\u020E": "O", "\u1ECE": "O", "\u1ECC": "O", "\u1ED4": "O", "\u1ED6": "O", "\u1ED8": "O", "\u1EDC": "O", "\u1EDE": "O", "\u1EE0": "O", "\u1EDA": "O", "\u1EE2": "O", "\xD9": "U", "\xDA": "U", "\xDB": "U", "\xDC": "U", "\u1EE6": "U", "\u1EE4": "U", "\u1EEC": "U", "\u1EEE": "U", "\u1EF0": "U", "\xDD": "Y", "\xE0": "a", "\xE1": "a", "\xE2": "a", "\xE3": "a", "\xE4": "a", "\xE5": "a", "\u1EA5": "a", "\u1EAF": "a", "\u1EB3": "a", "\u1EB5": "a", "\u1EB7": "a", "\xE6": "ae", "\u1EA7": "a", "\u1EB1": "a", "\u0203": "a", "\u1EA3": "a", "\u1EA1": "a", "\u1EA9": "a", "\u1EAB": "a", "\u1EAD": "a", "\xE7": "c", "\u1E09": "c", "\xE8": "e", "\xE9": "e", "\xEA": "e", "\xEB": "e", "\u1EBF": "e", "\u1E17": "e", "\u1EC1": "e", "\u1E15": "e", "\u1E1D": "e", "\u0207": "e", "\u1EBB": "e", "\u1EBD": "e", "\u1EB9": "e", "\u1EC3": "e", "\u1EC5": "e", "\u1EC7": "e", "\xEC": "i", "\xED": "i", "\xEE": "i", "\xEF": "i", "\u1E2F": "i", "\u020B": "i", "\u1EC9": "i", "\u1ECB": "i", "\xF0": "d", "\xF1": "n", "\xF2": "o", "\xF3": "o", "\xF4": "o", "\xF5": "o", "\xF6": "o", "\xF8": "o", "\u1ED1": "o", "\u1E4D": "o", "\u1E53": "o", "\u020F": "o", "\u1ECF": "o", "\u1ECD": "o", "\u1ED5": "o", "\u1ED7": "o", "\u1ED9": "o", "\u1EDD": "o", "\u1EDF": "o", "\u1EE1": "o", "\u1EDB": "o", "\u1EE3": "o", "\xF9": "u", "\xFA": "u", "\xFB": "u", "\xFC": "u", "\u1EE7": "u", "\u1EE5": "u", "\u1EED": "u", "\u1EEF": "u", "\u1EF1": "u", "\xFD": "y", "\xFF": "y", "\u0100": "A", "\u0101": "a", "\u0102": "A", "\u0103": "a", "\u0104": "A", "\u0105": "a", "\u0106": "C", "\u0107": "c", "\u0108": "C", "\u0109": "c", "\u010A": "C", "\u010B": "c", "\u010C": "C", "\u010D": "c", "C\u0306": "C", "c\u0306": "c", "\u010E": "D", "\u010F": "d", "\u0110": "D", "\u0111": "d", "\u0112": "E", "\u0113": "e", "\u0114": "E", "\u0115": "e", "\u0116": "E", "\u0117": "e", "\u0118": "E", "\u0119": "e", "\u011A": "E", "\u011B": "e", "\u011C": "G", "\u01F4": "G", "\u011D": "g", "\u01F5": "g", "\u011E": "G", "\u011F": "g", "\u0120": "G", "\u0121": "g", "\u0122": "G", "\u0123": "g", "\u0124": "H", "\u0125": "h", "\u0126": "H", "\u0127": "h", "\u1E2A": "H", "\u1E2B": "h", "\u0128": "I", "\u0129": "i", "\u012A": "I", "\u012B": "i", "\u012C": "I", "\u012D": "i", "\u012E": "I", "\u012F": "i", "\u0130": "I", "\u0131": "i", "\u0132": "IJ", "\u0133": "ij", "\u0134": "J", "\u0135": "j", "\u0136": "K", "\u0137": "k", "\u1E30": "K", "\u1E31": "k", "K\u0306": "K", "k\u0306": "k", "\u0139": "L", "\u013A": "l", "\u013B": "L", "\u013C": "l", "\u013D": "L", "\u013E": "l", "\u013F": "L", "\u0140": "l", "\u0141": "l", "\u0142": "l", "\u1E3E": "M", "\u1E3F": "m", "M\u0306": "M", "m\u0306": "m", "\u0143": "N", "\u0144": "n", "\u0145": "N", "\u0146": "n", "\u0147": "N", "\u0148": "n", "\u0149": "n", "N\u0306": "N", "n\u0306": "n", "\u014C": "O", "\u014D": "o", "\u014E": "O", "\u014F": "o", "\u0150": "O", "\u0151": "o", "\u0152": "OE", "\u0153": "oe", "P\u0306": "P", "p\u0306": "p", "\u0154": "R", "\u0155": "r", "\u0156": "R", "\u0157": "r", "\u0158": "R", "\u0159": "r", "R\u0306": "R", "r\u0306": "r", "\u0212": "R", "\u0213": "r", "\u015A": "S", "\u015B": "s", "\u015C": "S", "\u015D": "s", "\u015E": "S", "\u0218": "S", "\u0219": "s", "\u015F": "s", "\u0160": "S", "\u0161": "s", "\u0162": "T", "\u0163": "t", "\u021B": "t", "\u021A": "T", "\u0164": "T", "\u0165": "t", "\u0166": "T", "\u0167": "t", "T\u0306": "T", "t\u0306": "t", "\u0168": "U", "\u0169": "u", "\u016A": "U", "\u016B": "u", "\u016C": "U", "\u016D": "u", "\u016E": "U", "\u016F": "u", "\u0170": "U", "\u0171": "u", "\u0172": "U", "\u0173": "u", "\u0216": "U", "\u0217": "u", "V\u0306": "V", "v\u0306": "v", "\u0174": "W", "\u0175": "w", "\u1E82": "W", "\u1E83": "w", "X\u0306": "X", "x\u0306": "x", "\u0176": "Y", "\u0177": "y", "\u0178": "Y", "Y\u0306": "Y", "y\u0306": "y", "\u0179": "Z", "\u017A": "z", "\u017B": "Z", "\u017C": "z", "\u017D": "Z", "\u017E": "z", "\u017F": "s", "\u0192": "f", "\u01A0": "O", "\u01A1": "o", "\u01AF": "U", "\u01B0": "u", "\u01CD": "A", "\u01CE": "a", "\u01CF": "I", "\u01D0": "i", "\u01D1": "O", "\u01D2": "o", "\u01D3": "U", "\u01D4": "u", "\u01D5": "U", "\u01D6": "u", "\u01D7": "U", "\u01D8": "u", "\u01D9": "U", "\u01DA": "u", "\u01DB": "U", "\u01DC": "u", "\u1EE8": "U", "\u1EE9": "u", "\u1E78": "U", "\u1E79": "u", "\u01FA": "A", "\u01FB": "a", "\u01FC": "AE", "\u01FD": "ae", "\u01FE": "O", "\u01FF": "o", "\xDE": "TH", "\xFE": "th", "\u1E54": "P", "\u1E55": "p", "\u1E64": "S", "\u1E65": "s", "X\u0301": "X", "x\u0301": "x", "\u0403": "\u0413", "\u0453": "\u0433", "\u040C": "\u041A", "\u045C": "\u043A", "A\u030B": "A", "a\u030B": "a", "E\u030B": "E", "e\u030B": "e", "I\u030B": "I", "i\u030B": "i", "\u01F8": "N", "\u01F9": "n", "\u1ED2": "O", "\u1ED3": "o", "\u1E50": "O", "\u1E51": "o", "\u1EEA": "U", "\u1EEB": "u", "\u1E80": "W", "\u1E81": "w", "\u1EF2": "Y", "\u1EF3": "y", "\u0200": "A", "\u0201": "a", "\u0204": "E", "\u0205": "e", "\u0208": "I", "\u0209": "i", "\u020C": "O", "\u020D": "o", "\u0210": "R", "\u0211": "r", "\u0214": "U", "\u0215": "u", "B\u030C": "B", "b\u030C": "b", "\u010C\u0323": "C", "\u010D\u0323": "c", "\xCA\u030C": "E", "\xEA\u030C": "e", "F\u030C": "F", "f\u030C": "f", "\u01E6": "G", "\u01E7": "g", "\u021E": "H", "\u021F": "h", "J\u030C": "J", "\u01F0": "j", "\u01E8": "K", "\u01E9": "k", "M\u030C": "M", "m\u030C": "m", "P\u030C": "P", "p\u030C": "p", "Q\u030C": "Q", "q\u030C": "q", "\u0158\u0329": "R", "\u0159\u0329": "r", "\u1E66": "S", "\u1E67": "s", "V\u030C": "V", "v\u030C": "v", "W\u030C": "W", "w\u030C": "w", "X\u030C": "X", "x\u030C": "x", "Y\u030C": "Y", "y\u030C": "y", "A\u0327": "A", "a\u0327": "a", "B\u0327": "B", "b\u0327": "b", "\u1E10": "D", "\u1E11": "d", "\u0228": "E", "\u0229": "e", "\u0190\u0327": "E", "\u025B\u0327": "e", "\u1E28": "H", "\u1E29": "h", "I\u0327": "I", "i\u0327": "i", "\u0197\u0327": "I", "\u0268\u0327": "i", "M\u0327": "M", "m\u0327": "m", "O\u0327": "O", "o\u0327": "o", "Q\u0327": "Q", "q\u0327": "q", "U\u0327": "U", "u\u0327": "u", "X\u0327": "X", "x\u0327": "x", "Z\u0327": "Z", "z\u0327": "z", "\u0439": "\u0438", "\u0419": "\u0418", "\u0451": "\u0435", "\u0401": "\u0415" }; var chars = Object.keys(characterMap).join("|"); var allAccents = new RegExp(chars, "g"); var firstAccent = new RegExp(chars, ""); function matcher(match3) { return characterMap[match3]; } var removeAccents4 = function(string) { return string.replace(allAccents, matcher); }; var hasAccents = function(string) { return !!string.match(firstAccent); }; module.exports = removeAccents4; module.exports.has = hasAccents; module.exports.remove = removeAccents4; } }); // package-external:@wordpress/style-engine var require_style_engine = __commonJS({ "package-external:@wordpress/style-engine"(exports, module) { module.exports = window.wp.styleEngine; } }); // node_modules/fast-deep-equal/es6/index.js var require_es6 = __commonJS({ "node_modules/fast-deep-equal/es6/index.js"(exports, module) { "use strict"; module.exports = function equal(a3, b3) { if (a3 === b3) return true; if (a3 && b3 && typeof a3 == "object" && typeof b3 == "object") { if (a3.constructor !== b3.constructor) return false; var length, i3, keys; if (Array.isArray(a3)) { length = a3.length; if (length != b3.length) return false; for (i3 = length; i3-- !== 0; ) if (!equal(a3[i3], b3[i3])) return false; return true; } if (a3 instanceof Map && b3 instanceof Map) { if (a3.size !== b3.size) return false; for (i3 of a3.entries()) if (!b3.has(i3[0])) return false; for (i3 of a3.entries()) if (!equal(i3[1], b3.get(i3[0]))) return false; return true; } if (a3 instanceof Set && b3 instanceof Set) { if (a3.size !== b3.size) return false; for (i3 of a3.entries()) if (!b3.has(i3[0])) return false; return true; } if (ArrayBuffer.isView(a3) && ArrayBuffer.isView(b3)) { length = a3.length; if (length != b3.length) return false; for (i3 = length; i3-- !== 0; ) if (a3[i3] !== b3[i3]) return false; return true; } if (a3.constructor === RegExp) return a3.source === b3.source && a3.flags === b3.flags; if (a3.valueOf !== Object.prototype.valueOf) return a3.valueOf() === b3.valueOf(); if (a3.toString !== Object.prototype.toString) return a3.toString() === b3.toString(); keys = Object.keys(a3); length = keys.length; if (length !== Object.keys(b3).length) return false; for (i3 = length; i3-- !== 0; ) if (!Object.prototype.hasOwnProperty.call(b3, keys[i3])) return false; for (i3 = length; i3-- !== 0; ) { var key = keys[i3]; if (!equal(a3[key], b3[key])) return false; } return true; } return a3 !== a3 && b3 !== b3; }; } }); // node_modules/deepmerge/dist/cjs.js var require_cjs = __commonJS({ "node_modules/deepmerge/dist/cjs.js"(exports, module) { "use strict"; var isMergeableObject = function isMergeableObject2(value) { return isNonNullObject(value) && !isSpecial(value); }; function isNonNullObject(value) { return !!value && typeof value === "object"; } function isSpecial(value) { var stringValue = Object.prototype.toString.call(value); return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value); } var canUseSymbol = typeof Symbol === "function" && Symbol.for; var REACT_ELEMENT_TYPE = canUseSymbol ? /* @__PURE__ */ Symbol.for("react.element") : 60103; function isReactElement(value) { return value.$$typeof === REACT_ELEMENT_TYPE; } function emptyTarget(val) { return Array.isArray(val) ? [] : {}; } function cloneUnlessOtherwiseSpecified(value, options) { return options.clone !== false && options.isMergeableObject(value) ? deepmerge2(emptyTarget(value), value, options) : value; } function defaultArrayMerge(target, source, options) { return target.concat(source).map(function(element) { return cloneUnlessOtherwiseSpecified(element, options); }); } function getMergeFunction(key, options) { if (!options.customMerge) { return deepmerge2; } var customMerge = options.customMerge(key); return typeof customMerge === "function" ? customMerge : deepmerge2; } function getEnumerableOwnPropertySymbols(target) { return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) { return Object.propertyIsEnumerable.call(target, symbol); }) : []; } function getKeys(target) { return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target)); } function propertyIsOnObject(object, property) { try { return property in object; } catch (_) { return false; } } function propertyIsUnsafe(target, key) { return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key)); } function mergeObject(target, source, options) { var destination = {}; if (options.isMergeableObject(target)) { getKeys(target).forEach(function(key) { destination[key] = cloneUnlessOtherwiseSpecified(target[key], options); }); } getKeys(source).forEach(function(key) { if (propertyIsUnsafe(target, key)) { return; } if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) { destination[key] = getMergeFunction(key, options)(target[key], source[key], options); } else { destination[key] = cloneUnlessOtherwiseSpecified(source[key], options); } }); return destination; } function deepmerge2(target, source, options) { options = options || {}; options.arrayMerge = options.arrayMerge || defaultArrayMerge; options.isMergeableObject = options.isMergeableObject || isMergeableObject; options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified; var sourceIsArray = Array.isArray(source); var targetIsArray = Array.isArray(target); var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray; if (!sourceAndTargetTypesMatch) { return cloneUnlessOtherwiseSpecified(source, options); } else if (sourceIsArray) { return options.arrayMerge(target, source, options); } else { return mergeObject(target, source, options); } } deepmerge2.all = function deepmergeAll(array, options) { if (!Array.isArray(array)) { throw new Error("first argument should be an array"); } return array.reduce(function(prev, next) { return deepmerge2(prev, next, options); }, {}); }; var deepmerge_1 = deepmerge2; module.exports = deepmerge_1; } }); // node_modules/diff/lib/diff/base.js var require_base = __commonJS({ "node_modules/diff/lib/diff/base.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = Diff; function Diff() { } Diff.prototype = { /*istanbul ignore start*/ /*istanbul ignore end*/ diff: function diff(oldString, newString) { var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; var callback = options.callback; if (typeof options === "function") { callback = options; options = {}; } this.options = options; var self = this; function done(value) { if (callback) { setTimeout(function() { callback(void 0, value); }, 0); return true; } else { return value; } } oldString = this.castInput(oldString); newString = this.castInput(newString); oldString = this.removeEmpty(this.tokenize(oldString)); newString = this.removeEmpty(this.tokenize(newString)); var newLen = newString.length, oldLen = oldString.length; var editLength = 1; var maxEditLength = newLen + oldLen; var bestPath = [{ newPos: -1, components: [] }]; var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0); if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) { return done([{ value: this.join(newString), count: newString.length }]); } function execEditLength() { for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) { var basePath = ( /*istanbul ignore start*/ void 0 ); var addPath = bestPath[diagonalPath - 1], removePath = bestPath[diagonalPath + 1], _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath; if (addPath) { bestPath[diagonalPath - 1] = void 0; } var canAdd = addPath && addPath.newPos + 1 < newLen, canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen; if (!canAdd && !canRemove) { bestPath[diagonalPath] = void 0; continue; } if (!canAdd || canRemove && addPath.newPos < removePath.newPos) { basePath = clonePath(removePath); self.pushComponent(basePath.components, void 0, true); } else { basePath = addPath; basePath.newPos++; self.pushComponent(basePath.components, true, void 0); } _oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath); if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) { return done(buildValues(self, basePath.components, newString, oldString, self.useLongestToken)); } else { bestPath[diagonalPath] = basePath; } } editLength++; } if (callback) { (function exec() { setTimeout(function() { if (editLength > maxEditLength) { return callback(); } if (!execEditLength()) { exec(); } }, 0); })(); } else { while (editLength <= maxEditLength) { var ret = execEditLength(); if (ret) { return ret; } } } }, /*istanbul ignore start*/ /*istanbul ignore end*/ pushComponent: function pushComponent(components, added, removed) { var last = components[components.length - 1]; if (last && last.added === added && last.removed === removed) { components[components.length - 1] = { count: last.count + 1, added, removed }; } else { components.push({ count: 1, added, removed }); } }, /*istanbul ignore start*/ /*istanbul ignore end*/ extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath) { var newLen = newString.length, oldLen = oldString.length, newPos = basePath.newPos, oldPos = newPos - diagonalPath, commonCount = 0; while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newString[newPos + 1], oldString[oldPos + 1])) { newPos++; oldPos++; commonCount++; } if (commonCount) { basePath.components.push({ count: commonCount }); } basePath.newPos = newPos; return oldPos; }, /*istanbul ignore start*/ /*istanbul ignore end*/ equals: function equals(left, right) { if (this.options.comparator) { return this.options.comparator(left, right); } else { return left === right || this.options.ignoreCase && left.toLowerCase() === right.toLowerCase(); } }, /*istanbul ignore start*/ /*istanbul ignore end*/ removeEmpty: function removeEmpty(array) { var ret = []; for (var i3 = 0; i3 < array.length; i3++) { if (array[i3]) { ret.push(array[i3]); } } return ret; }, /*istanbul ignore start*/ /*istanbul ignore end*/ castInput: function castInput(value) { return value; }, /*istanbul ignore start*/ /*istanbul ignore end*/ tokenize: function tokenize(value) { return value.split(""); }, /*istanbul ignore start*/ /*istanbul ignore end*/ join: function join(chars) { return chars.join(""); } }; function buildValues(diff, components, newString, oldString, useLongestToken) { var componentPos = 0, componentLen = components.length, newPos = 0, oldPos = 0; for (; componentPos < componentLen; componentPos++) { var component = components[componentPos]; if (!component.removed) { if (!component.added && useLongestToken) { var value = newString.slice(newPos, newPos + component.count); value = value.map(function(value2, i3) { var oldValue = oldString[oldPos + i3]; return oldValue.length > value2.length ? oldValue : value2; }); component.value = diff.join(value); } else { component.value = diff.join(newString.slice(newPos, newPos + component.count)); } newPos += component.count; if (!component.added) { oldPos += component.count; } } else { component.value = diff.join(oldString.slice(oldPos, oldPos + component.count)); oldPos += component.count; if (componentPos && components[componentPos - 1].added) { var tmp = components[componentPos - 1]; components[componentPos - 1] = components[componentPos]; components[componentPos] = tmp; } } } var lastComponent = components[componentLen - 1]; if (componentLen > 1 && typeof lastComponent.value === "string" && (lastComponent.added || lastComponent.removed) && diff.equals("", lastComponent.value)) { components[componentLen - 2].value += lastComponent.value; components.pop(); } return components; } function clonePath(path) { return { newPos: path.newPos, components: path.components.slice(0) }; } } }); // node_modules/diff/lib/diff/array.js var require_array = __commonJS({ "node_modules/diff/lib/diff/array.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.diffArrays = diffArrays3; exports.arrayDiff = void 0; var _base = _interopRequireDefault(require_base()); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var arrayDiff = new /*istanbul ignore start*/ _base.default(); exports.arrayDiff = arrayDiff; arrayDiff.tokenize = function(value) { return value.slice(); }; arrayDiff.join = arrayDiff.removeEmpty = function(value) { return value; }; function diffArrays3(oldArr, newArr, callback) { return arrayDiff.diff(oldArr, newArr, callback); } } }); // node_modules/diff/lib/util/params.js var require_params = __commonJS({ "node_modules/diff/lib/util/params.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.generateOptions = generateOptions; function generateOptions(options, defaults2) { if (typeof options === "function") { defaults2.callback = options; } else if (options) { for (var name2 in options) { if (options.hasOwnProperty(name2)) { defaults2[name2] = options[name2]; } } } return defaults2; } } }); // node_modules/diff/lib/diff/word.js var require_word = __commonJS({ "node_modules/diff/lib/diff/word.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.diffWords = diffWords3; exports.diffWordsWithSpace = diffWordsWithSpace; exports.wordDiff = void 0; var _base = _interopRequireDefault(require_base()); var _params = require_params(); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var extendedWordChars = /^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/; var reWhitespace = /\S/; var wordDiff = new /*istanbul ignore start*/ _base.default(); exports.wordDiff = wordDiff; wordDiff.equals = function(left, right) { if (this.options.ignoreCase) { left = left.toLowerCase(); right = right.toLowerCase(); } return left === right || this.options.ignoreWhitespace && !reWhitespace.test(left) && !reWhitespace.test(right); }; wordDiff.tokenize = function(value) { var tokens = value.split(/(\s+|[()[\]{}'"]|\b)/); for (var i3 = 0; i3 < tokens.length - 1; i3++) { if (!tokens[i3 + 1] && tokens[i3 + 2] && extendedWordChars.test(tokens[i3]) &&